arco-workbench 0.1.5 → 0.1.7

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 (188) hide show
  1. package/CONTRIBUTING.md +9 -0
  2. package/README.md +17 -5
  3. package/client/dist/assets/{PhosphorBackdrop-D6cbmLNY.js → PhosphorBackdrop-DVQdBrTw.js} +1 -1
  4. package/client/dist/assets/{ThemedBackgroundShaderImpl-2dyerOi4.js → ThemedBackgroundShaderImpl-BfSs2tB4.js} +1 -1
  5. package/client/dist/assets/{XtermView-AIwo7O3D.js → XtermView-DaMjC8Ny.js} +1 -1
  6. package/client/dist/assets/{galleryEditor-DXAuxS8D.js → galleryEditor-BCQnXj7R.js} +1 -1
  7. package/client/dist/assets/{index-8j6p-pmQ.js → index-COfbHCYv.js} +245 -243
  8. package/client/dist/index.html +1 -1
  9. package/client/src/alerts/desktopAlerts.ts +13 -0
  10. package/client/src/buildCheck.ts +3 -1
  11. package/client/src/components/AppUpdateNotice.tsx +2 -1
  12. package/client/src/components/ClusterRightPanel/AutoPickupControl.tsx +46 -11
  13. package/client/src/components/ClusterRightPanel/MemberRow.tsx +1 -1
  14. package/client/src/components/ClusterRightPanel/index.tsx +2 -1
  15. package/client/src/components/ClusterTaskBoardTab.tsx +54 -3
  16. package/client/src/components/ContextMeter.tsx +7 -0
  17. package/client/src/components/HeaderVersionBox.tsx +7 -4
  18. package/client/src/components/Home/HomeView.tsx +1 -1
  19. package/client/src/components/NeedsYouBadge.tsx +31 -16
  20. package/client/src/components/OperatorQuestionNotice.tsx +10 -1
  21. package/client/src/components/ProvidersPopover.tsx +23 -12
  22. package/client/src/components/TabBar.tsx +11 -8
  23. package/client/src/components/TabStatusChip.tsx +8 -7
  24. package/client/src/components/UpdateAction.tsx +18 -4
  25. package/client/src/components/UpdateResultNotice.tsx +3 -1
  26. package/client/src/components/clusterNeedsYou.ts +27 -8
  27. package/client/src/help/content/cluster.tsx +50 -27
  28. package/client/src/help/content/composer.tsx +8 -1
  29. package/client/src/help/content/header.tsx +25 -14
  30. package/client/src/help/content/misc.tsx +8 -0
  31. package/client/src/help/content/rightPanel.tsx +1 -1
  32. package/client/src/help/content/settings.tsx +1 -1
  33. package/client/src/help/content/tabbar.tsx +2 -1
  34. package/client/src/help/manualSections/clusters.tsx +78 -19
  35. package/client/src/help/manualSections/configuration.tsx +20 -4
  36. package/client/src/help/manualSections/gettingStarted.tsx +10 -0
  37. package/client/src/help/manualSections/maintenance.tsx +50 -8
  38. package/client/src/help/manualSections/plans.tsx +5 -1
  39. package/client/src/help/manualSections/providers.tsx +10 -3
  40. package/client/src/help/manualSections/reference.tsx +1 -1
  41. package/client/src/help/manualSections/workflows.tsx +20 -0
  42. package/client/src/help/manualSections/workspace.tsx +7 -1
  43. package/client/src/questions/waitingQuestion.ts +3 -2
  44. package/client/src/stores/appStore.ts +1 -1
  45. package/client/src/stores/appStore.types.ts +1 -0
  46. package/client/src/stores/appUpdateStore.ts +29 -8
  47. package/client/src/stores/notificationStore.ts +2 -0
  48. package/client/src/utils/activityPresentation.ts +1 -1
  49. package/client/src/utils/tabStatus.ts +8 -0
  50. package/client/src/utils/wsSession.ts +2 -1
  51. package/client/src/voice/commands.ts +4 -3
  52. package/client/src/voice/executor.ts +3 -3
  53. package/client/src/ws/handleServerMessage.ts +22 -2
  54. package/client/src/ws/operatorQuestions.ts +2 -0
  55. package/docs/CLIENT.md +3 -3
  56. package/docs/FEATURES.md +1 -1
  57. package/docs/GETTING_STARTED.md +16 -6
  58. package/docs/GLOSSARY.md +6 -2
  59. package/docs/GOTCHAS.md +17 -5
  60. package/docs/OPERATIONS.md +207 -5
  61. package/docs/PERSISTENCE.md +22 -1
  62. package/docs/PRIMITIVES.md +1 -1
  63. package/docs/PROTOCOL.md +1 -1
  64. package/docs/PROTOCOL_CLUSTER.md +18 -7
  65. package/docs/PROVIDERS.md +10 -5
  66. package/docs/SETTINGS.md +4 -2
  67. package/docs/TASK_LEDGER.md +6 -0
  68. package/docs/VOICE.md +2 -0
  69. package/native/darwin-arm64/manifest.json +1 -1
  70. package/native/win32-arm64/manifest.json +1 -1
  71. package/node_modules/@arco/shared/dist/clusterRolePresets.d.ts +1 -1
  72. package/node_modules/@arco/shared/dist/clusterRolePresets.js +10 -0
  73. package/node_modules/@arco/shared/dist/protocol/autoPickup.d.ts +3 -0
  74. package/node_modules/@arco/shared/dist/protocol/autoPickup.js +9 -1
  75. package/node_modules/@arco/shared/dist/protocol/clientMessages.d.ts +2 -2
  76. package/node_modules/@arco/shared/dist/protocol/models.d.ts +6 -0
  77. package/node_modules/@arco/shared/dist/protocol/notifications.d.ts +4 -0
  78. package/node_modules/@arco/shared/dist/protocol/operatorQuestions.d.ts +12 -0
  79. package/node_modules/@arco/shared/dist/protocol/serverMessages.d.ts +9 -3
  80. package/node_modules/@arco/shared/dist/protocol/workflows.d.ts +1 -0
  81. package/node_modules/@arco/shared/package.json +1 -1
  82. package/package.json +2 -2
  83. package/scripts/packaging/arco.mjs +1 -0
  84. package/scripts/packaging/native-repair.mjs +46 -8
  85. package/scripts/packaging/update.mjs +5 -1
  86. package/server/dist/attention.d.ts +1 -1
  87. package/server/dist/attention.js +6 -4
  88. package/server/dist/capabilities.d.ts +9 -8
  89. package/server/dist/capabilities.js +71 -102
  90. package/server/dist/cliUpdateDecision.d.ts +34 -0
  91. package/server/dist/cliUpdateDecision.js +152 -0
  92. package/server/dist/clusterAutoTurn.d.ts +4 -0
  93. package/server/dist/clusterAutoTurn.js +29 -25
  94. package/server/dist/clusterBusyReminder.js +1 -1
  95. package/server/dist/clusterDirector.js +1 -0
  96. package/server/dist/clusterPeerOps.js +2 -2
  97. package/server/dist/clusterStore.d.ts +3 -0
  98. package/server/dist/clusterStore.js +22 -0
  99. package/server/dist/defaults/models.md +1 -1
  100. package/server/dist/fileAccessPolicy.js +7 -5
  101. package/server/dist/http/workflowDataRoutes.js +1 -1
  102. package/server/dist/index.js +5 -1
  103. package/server/dist/primitives/seedWorker.d.ts +1 -0
  104. package/server/dist/primitives/seedWorker.js +2 -1
  105. package/server/dist/providerConversation.d.ts +9 -0
  106. package/server/dist/providerConversation.js +80 -0
  107. package/server/dist/providers/claude-native/retainedContext.d.ts +4 -0
  108. package/server/dist/providers/claude-native/retainedContext.js +20 -0
  109. package/server/dist/providers/claude-native/worker.d.ts +1 -0
  110. package/server/dist/providers/claude-native/worker.js +34 -6
  111. package/server/dist/providers/codex-appserver/operatorQuestions.d.ts +5 -0
  112. package/server/dist/providers/codex-appserver/operatorQuestions.js +30 -0
  113. package/server/dist/providers/codex-appserver/worker.js +9 -4
  114. package/server/dist/providers/ollama.js +2 -3
  115. package/server/dist/server/broadcast.d.ts +1 -1
  116. package/server/dist/smartPickup.d.ts +2 -1
  117. package/server/dist/smartPickup.js +28 -1
  118. package/server/dist/smartPickupAdapters.d.ts +1 -0
  119. package/server/dist/smartPickupAdapters.js +18 -5
  120. package/server/dist/smartPickupLedger.js +6 -4
  121. package/server/dist/smartPickupObserver.d.ts +1 -0
  122. package/server/dist/smartPickupObserver.js +69 -23
  123. package/server/dist/workers/WorkerManager.d.ts +1 -0
  124. package/server/dist/workers/WorkerManager.js +1 -0
  125. package/server/dist/workers/limits.js +6 -2
  126. package/server/dist/workflowMeta.d.ts +11 -1
  127. package/server/dist/workflowMeta.js +132 -6
  128. package/server/dist/workflows/types.d.ts +1 -0
  129. package/server/dist/ws/clusterHandlers.d.ts +1 -0
  130. package/server/dist/ws/clusterHandlers.js +2 -1
  131. package/server/dist/ws/compactHandlers.d.ts +1 -1
  132. package/server/dist/ws/compactHandlers.js +11 -4
  133. package/server/dist/ws/handoffHandlers.js +16 -6
  134. package/server/dist/ws/operatorQuestionHandlers.d.ts +2 -1
  135. package/server/dist/ws/operatorQuestionHandlers.js +9 -1
  136. package/server/dist/ws/turnEngine.d.ts +2 -4
  137. package/server/dist/ws/turnEngine.js +88 -129
  138. package/server/package.json +1 -1
  139. package/server/src/attention.ts +5 -4
  140. package/server/src/capabilities.ts +70 -111
  141. package/server/src/cliUpdateDecision.ts +159 -0
  142. package/server/src/clusterAutoTurn.ts +26 -21
  143. package/server/src/clusterBusyReminder.ts +1 -1
  144. package/server/src/clusterDirector.ts +1 -0
  145. package/server/src/clusterPeerOps.ts +2 -2
  146. package/server/src/clusterStore.ts +26 -1
  147. package/server/src/defaults/models.md +1 -1
  148. package/server/src/fileAccessPolicy.ts +7 -5
  149. package/server/src/http/workflowDataRoutes.ts +1 -1
  150. package/server/src/index.ts +5 -1
  151. package/server/src/primitives/seedWorker.ts +3 -1
  152. package/server/src/providerConversation.ts +71 -0
  153. package/server/src/providers/claude-native/retainedContext.ts +22 -0
  154. package/server/src/providers/claude-native/worker.ts +33 -5
  155. package/server/src/providers/codex-appserver/operatorQuestions.ts +24 -0
  156. package/server/src/providers/codex-appserver/worker.ts +8 -4
  157. package/server/src/providers/ollama.ts +2 -3
  158. package/server/src/smartPickup.ts +27 -3
  159. package/server/src/smartPickupAdapters.ts +19 -5
  160. package/server/src/smartPickupLedger.ts +6 -4
  161. package/server/src/smartPickupObserver.ts +51 -17
  162. package/server/src/workers/WorkerManager.ts +2 -0
  163. package/server/src/workers/limits.ts +7 -2
  164. package/server/src/workflowMeta.ts +139 -5
  165. package/server/src/workflows/types.ts +1 -0
  166. package/server/src/ws/clusterHandlers.ts +3 -2
  167. package/server/src/ws/compactHandlers.ts +9 -3
  168. package/server/src/ws/handoffHandlers.ts +13 -6
  169. package/server/src/ws/operatorQuestionHandlers.ts +10 -2
  170. package/server/src/ws/turnEngine.ts +80 -135
  171. package/shared/dist/clusterRolePresets.d.ts +1 -1
  172. package/shared/dist/clusterRolePresets.js +10 -0
  173. package/shared/dist/protocol/autoPickup.d.ts +3 -0
  174. package/shared/dist/protocol/autoPickup.js +9 -1
  175. package/shared/dist/protocol/clientMessages.d.ts +2 -2
  176. package/shared/dist/protocol/models.d.ts +6 -0
  177. package/shared/dist/protocol/notifications.d.ts +4 -0
  178. package/shared/dist/protocol/operatorQuestions.d.ts +12 -0
  179. package/shared/dist/protocol/serverMessages.d.ts +9 -3
  180. package/shared/dist/protocol/workflows.d.ts +1 -0
  181. package/shared/src/clusterRolePresets.ts +11 -1
  182. package/shared/src/protocol/autoPickup.ts +14 -1
  183. package/shared/src/protocol/clientMessages.ts +2 -1
  184. package/shared/src/protocol/models.ts +5 -2
  185. package/shared/src/protocol/notifications.ts +5 -0
  186. package/shared/src/protocol/operatorQuestions.ts +13 -0
  187. package/shared/src/protocol/serverMessages.ts +12 -2
  188. package/shared/src/protocol/workflows.ts +4 -0
package/CONTRIBUTING.md CHANGED
@@ -161,6 +161,15 @@ broadcasts, or persisted store fields should include a descriptive scenario
161
161
  under `scripts/smoke/` and a matching `smoke:<feature>` script in `package.json`.
162
162
  Keep fixtures synthetic and isolate provider calls.
163
163
 
164
+ Metadata writes also open the process-wide Recall index. The existing
165
+ `trackRecallFixture()` helper in
166
+ `server/src/testSupport/recallFixture.test-support.ts` tracks its projections
167
+ and closes its connection at fixture teardown. Fixtures install it before the
168
+ first metadata write and call its returned closure after `settleProjectWrites()`
169
+ and before removing the whole temporary Arco home. Settling writes alone leaves
170
+ the Recall database open. Project-only cleanup keeps the shared index available. Remote-action tests observe the handler's
171
+ terminal broadcast because action acknowledgment means dispatch, not completion.
172
+
164
173
  ---
165
174
 
166
175
  ## Type checks + builds
package/README.md CHANGED
@@ -43,6 +43,13 @@ npm install -g arco-workbench
43
43
  arco setup
44
44
  ```
45
45
 
46
+ When Arco is already installed, do not run `npm install -g arco-workbench` over
47
+ it. Update with `arco update`, or use **UPDATE AND RESTART** from the version
48
+ box, a release toast, or Settings. See
49
+ [Updating Arco](docs/OPERATIONS.md#updating-arco). To clear every older copy
50
+ before a fresh install (package, source checkout, or unknown origin), see
51
+ [Before a fresh install: remove older copies](docs/OPERATIONS.md#before-a-fresh-install-remove-older-copies).
52
+
46
53
  `arco setup` asks before installing the per-user service and creating an
47
54
  application shortcut, starts the service, and opens the local URL. Use the
48
55
  shortcut or `arco open` for a Chromium app window (Chrome, Edge, Brave, Vivaldi
@@ -60,6 +67,8 @@ one that was modified after installation.
60
67
 
61
68
  For Linux service recovery after 0.1.3, see the
62
69
  [package update recovery steps](docs/OPERATIONS.md#packaged-install).
70
+ The same section gives manual update steps when Arco cannot locate npm; stop
71
+ Arco before replacing the package from a terminal where npm works.
63
72
 
64
73
  Use these package commands for maintenance:
65
74
 
@@ -74,10 +83,10 @@ Use these package commands for maintenance:
74
83
  If a global npm install reports `EACCES` on Linux or macOS, use nvm or a
75
84
  user-owned npm prefix (for example under Homebrew's Node, or a prefix you own
76
85
  under your home directory). On Windows, an execution-policy restriction can
77
- block the PowerShell shim; run `arco.cmd` instead. If install fails with
78
- `EEXIST` because an `arco` link already exists in the global bin folder (for
79
- example from an earlier source checkout's `npm link`), remove that link or run
80
- `npm uninstall -g` for the old package, then install again. If `arco doctor`
86
+ block the PowerShell shim; run `arco.cmd` instead. On Windows, `EEXIST` on an
87
+ existing `arco` launcher usually means the earlier package `@ghreprimand/arco`
88
+ is still installed; recover as in
89
+ [Running locally](docs/OPERATIONS.md#running-locally). If `arco doctor`
81
90
  reports missing or incompatible native modules, install the platform build
82
91
  tools and run `arco setup --repair-native`.
83
92
 
@@ -176,7 +185,10 @@ Global state defaults to `~/.arco` on Linux and macOS and
176
185
  different global home. Opening a project creates a `.arco` folder there for
177
186
  workflows and project settings. That folder ships its own `.gitignore` so its
178
187
  contents stay out of Git by default; adding `.arco/` to the project's root
179
- `.gitignore` is a sensible extra safeguard. Provider command-line tools may
188
+ `.gitignore` is a sensible extra safeguard. Treat `.arco/` as local state that
189
+ is not committed, except a skill shared through SHARE WITH REPOSITORY. Put
190
+ files you want kept in the project in the project tree, not only under a
191
+ conversation's `artifacts/` folder. Provider command-line tools may
180
192
  keep their own login data outside the Arco home. See
181
193
  [Persistence](docs/PERSISTENCE.md) for the storage layout and
182
194
  [Backup](docs/BACKUP.md) before moving an installation.
@@ -1,4 +1,4 @@
1
- import{r as F,j as d}from"./index-8j6p-pmQ.js";const W=`// Adapted from the reference terminal crt.js, d52d430. No time-driven scan/band/hum.
1
+ import{r as F,j as d}from"./index-COfbHCYv.js";const W=`// Adapted from the reference terminal crt.js, d52d430. No time-driven scan/band/hum.
2
2
 
3
3
  precision highp float;
4
4
 
@@ -1,4 +1,4 @@
1
- import{u as ll,D as _s,a as cl,T as vs,r as Sr,j as ul}from"./index-8j6p-pmQ.js";/**
1
+ import{u as ll,D as _s,a as cl,T as vs,r as Sr,j as ul}from"./index-COfbHCYv.js";/**
2
2
  * @license
3
3
  * Copyright 2010-2026 Three.js Authors
4
4
  * SPDX-License-Identifier: MIT
@@ -1,4 +1,4 @@
1
- import{r as ee,u as ke,j as pe,T as Le,e as De}from"./index-8j6p-pmQ.js";var ge={exports:{}},Ce;function Re(){return Ce||(Ce=1,(function(se,ie){(function(Z,X){se.exports=X()})(globalThis,(()=>(()=>{var Z={4567:function(M,r,a){var l=this&&this.__decorate||function(e,t,n,u){var _,p=arguments.length,h=p<3?t:u===null?u=Object.getOwnPropertyDescriptor(t,n):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(e,t,n,u);else for(var S=e.length-1;S>=0;S--)(_=e[S])&&(h=(p<3?_(h):p>3?_(t,n,h):_(t,n))||h);return p>3&&h&&Object.defineProperty(t,n,h),h},f=this&&this.__param||function(e,t){return function(n,u){t(n,u,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const o=a(9042),d=a(9924),v=a(844),g=a(4725),c=a(2585),i=a(3656);let s=r.AccessibilityManager=class extends v.Disposable{constructor(e,t,n,u){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=u,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let _=0;_<this._terminal.rows;_++)this._rowElements[_]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[_]);if(this._topBoundaryFocusListener=_=>this._handleBoundaryFocus(_,0),this._bottomBoundaryFocusListener=_=>this._handleBoundaryFocus(_,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new d.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((_=>this._handleResize(_.rows)))),this.register(this._terminal.onRender((_=>this._refreshRows(_.start,_.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((_=>this._handleChar(_)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
1
+ import{r as ee,u as ke,j as pe,T as Le,e as De}from"./index-COfbHCYv.js";var ge={exports:{}},Ce;function Re(){return Ce||(Ce=1,(function(se,ie){(function(Z,X){se.exports=X()})(globalThis,(()=>(()=>{var Z={4567:function(M,r,a){var l=this&&this.__decorate||function(e,t,n,u){var _,p=arguments.length,h=p<3?t:u===null?u=Object.getOwnPropertyDescriptor(t,n):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(e,t,n,u);else for(var S=e.length-1;S>=0;S--)(_=e[S])&&(h=(p<3?_(h):p>3?_(t,n,h):_(t,n))||h);return p>3&&h&&Object.defineProperty(t,n,h),h},f=this&&this.__param||function(e,t){return function(n,u){t(n,u,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const o=a(9042),d=a(9924),v=a(844),g=a(4725),c=a(2585),i=a(3656);let s=r.AccessibilityManager=class extends v.Disposable{constructor(e,t,n,u){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=u,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let _=0;_<this._terminal.rows;_++)this._rowElements[_]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[_]);if(this._topBoundaryFocusListener=_=>this._handleBoundaryFocus(_,0),this._bottomBoundaryFocusListener=_=>this._handleBoundaryFocus(_,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new d.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((_=>this._handleResize(_.rows)))),this.register(this._terminal.onRender((_=>this._refreshRows(_.start,_.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((_=>this._handleChar(_)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
2
2
  `)))),this.register(this._terminal.onA11yTab((_=>this._handleTab(_)))),this.register(this._terminal.onKey((_=>this._handleKey(_.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,i.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,v.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
3
3
  `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=o.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){const n=this._terminal.buffer,u=n.lines.length.toString();for(let _=e;_<=t;_++){const p=n.lines.get(n.ydisp+_),h=[],S=(p==null?void 0:p.translateToString(!0,void 0,void 0,h))||"",E=(n.ydisp+_+1).toString(),k=this._rowElements[_];k&&(S.length===0?(k.innerText=" ",this._rowColumns.set(k,[0,1])):(k.textContent=S,this._rowColumns.set(k,h)),k.setAttribute("aria-posinset",E),k.setAttribute("aria-setsize",u))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){const n=e.target,u=this._rowElements[t===0?1:this._rowElements.length-2];if(n.getAttribute("aria-posinset")===(t===0?"1":`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==u)return;let _,p;if(t===0?(_=n,p=this._rowElements.pop(),this._rowContainer.removeChild(p)):(_=this._rowElements.shift(),p=n,this._rowContainer.removeChild(_)),_.removeEventListener("focus",this._topBoundaryFocusListener),p.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){const h=this._createAccessibilityTreeNode();this._rowElements.unshift(h),this._rowContainer.insertAdjacentElement("afterbegin",h)}else{const h=this._createAccessibilityTreeNode();this._rowElements.push(h),this._rowContainer.appendChild(h)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var S;if(this._rowElements.length===0)return;const e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;const u=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(u)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:u,offset:((S=u.textContent)==null?void 0:S.length)??0}),!this._rowContainer.contains(n.node))return;const _=({node:E,offset:k})=>{const D=E instanceof Text?E.parentNode:E;let w=parseInt(D==null?void 0:D.getAttribute("aria-posinset"),10)-1;if(isNaN(w))return console.warn("row is invalid. Race condition?"),null;const x=this._rowColumns.get(D);if(!x)return console.warn("columns is null. Race condition?"),null;let B=k<x.length?x[k]:x.slice(-1)[0]+1;return B>=this._terminal.cols&&(++w,B=0),{row:w,column:B}},p=_(t),h=_(n);if(p&&h){if(p.row>h.row||p.row===h.row&&p.column>=h.column)throw new Error("invalid range");this._terminal.select(p.column,p.row,(h.row-p.row)*this._terminal.cols-p.column+h.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};r.AccessibilityManager=s=l([f(1,c.IInstantiationService),f(2,g.ICoreBrowserService),f(3,g.IRenderService)],s)},3614:(M,r)=>{function a(d){return d.replace(/\r?\n/g,"\r")}function l(d,v){return v?"\x1B[200~"+d+"\x1B[201~":d}function f(d,v,g,c){d=l(d=a(d),g.decPrivateModes.bracketedPasteMode&&c.rawOptions.ignoreBracketedPasteMode!==!0),g.triggerDataEvent(d,!0),v.value=""}function o(d,v,g){const c=g.getBoundingClientRect(),i=d.clientX-c.left-10,s=d.clientY-c.top-10;v.style.width="20px",v.style.height="20px",v.style.left=`${i}px`,v.style.top=`${s}px`,v.style.zIndex="1000",v.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=a,r.bracketTextForPaste=l,r.copyHandler=function(d,v){d.clipboardData&&d.clipboardData.setData("text/plain",v.selectionText),d.preventDefault()},r.handlePasteEvent=function(d,v,g,c){d.stopPropagation(),d.clipboardData&&f(d.clipboardData.getData("text/plain"),v,g,c)},r.paste=f,r.moveTextAreaUnderMouseCursor=o,r.rightClickHandler=function(d,v,g,c,i){o(d,v,g),i&&c.rightClickSelect(d),v.value=c.selectionText,v.select()}},7239:(M,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const l=a(1505);r.ColorContrastCache=class{constructor(){this._color=new l.TwoKeyMap,this._css=new l.TwoKeyMap}setCss(f,o,d){this._css.set(f,o,d)}getCss(f,o){return this._css.get(f,o)}setColor(f,o,d){this._color.set(f,o,d)}getColor(f,o){return this._color.get(f,o)}clear(){this._color.clear(),this._css.clear()}}},3656:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(a,l,f,o){a.addEventListener(l,f,o);let d=!1;return{dispose:()=>{d||(d=!0,a.removeEventListener(l,f,o))}}}},3551:function(M,r,a){var l=this&&this.__decorate||function(s,e,t,n){var u,_=arguments.length,p=_<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(s,e,t,n);else for(var h=s.length-1;h>=0;h--)(u=s[h])&&(p=(_<3?u(p):_>3?u(e,t,p):u(e,t))||p);return _>3&&p&&Object.defineProperty(e,t,p),p},f=this&&this.__param||function(s,e){return function(t,n){e(t,n,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier=void 0;const o=a(3656),d=a(8460),v=a(844),g=a(2585),c=a(4725);let i=r.Linkifier=class extends v.Disposable{get currentLink(){return this._currentLink}constructor(s,e,t,n,u){super(),this._element=s,this._mouseService=e,this._renderService=t,this._bufferService=n,this._linkProviderService=u,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new d.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new d.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,v.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,v.toDisposable)((()=>{var _;this._lastMouseEvent=void 0,(_=this._activeProviderReplies)==null||_.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,o.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,o.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,o.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,o.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(s){this._lastMouseEvent=s;const e=this._positionFromMouseEvent(s,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;const t=s.composedPath();for(let n=0;n<t.length;n++){const u=t[n];if(u.classList.contains("xterm"))break;if(u.classList.contains("xterm-hover"))return}this._lastBufferCell&&e.x===this._lastBufferCell.x&&e.y===this._lastBufferCell.y||(this._handleHover(e),this._lastBufferCell=e)}_handleHover(s){if(this._activeLine!==s.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(s,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,s)||(this._clearCurrentLink(),this._askForLink(s,!0))}_askForLink(s,e){var n,u;this._activeProviderReplies&&e||((n=this._activeProviderReplies)==null||n.forEach((_=>{_==null||_.forEach((p=>{p.link.dispose&&p.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=s.y);let t=!1;for(const[_,p]of this._linkProviderService.linkProviders.entries())e?(u=this._activeProviderReplies)!=null&&u.get(_)&&(t=this._checkLinkProviderResult(_,s,t)):p.provideLinks(s.y,(h=>{var E,k;if(this._isMouseOut)return;const S=h==null?void 0:h.map((D=>({link:D})));(E=this._activeProviderReplies)==null||E.set(_,S),t=this._checkLinkProviderResult(_,s,t),((k=this._activeProviderReplies)==null?void 0:k.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(s.y,this._activeProviderReplies)}))}_removeIntersectingLinks(s,e){const t=new Set;for(let n=0;n<e.size;n++){const u=e.get(n);if(u)for(let _=0;_<u.length;_++){const p=u[_],h=p.link.range.start.y<s?0:p.link.range.start.x,S=p.link.range.end.y>s?this._bufferService.cols:p.link.range.end.x;for(let E=h;E<=S;E++){if(t.has(E)){u.splice(_--,1);break}t.add(E)}}}}_checkLinkProviderResult(s,e,t){var _;if(!this._activeProviderReplies)return t;const n=this._activeProviderReplies.get(s);let u=!1;for(let p=0;p<s;p++)this._activeProviderReplies.has(p)&&!this._activeProviderReplies.get(p)||(u=!0);if(!u&&n){const p=n.find((h=>this._linkAtPosition(h.link,e)));p&&(t=!0,this._handleNewLink(p))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!t)for(let p=0;p<this._activeProviderReplies.size;p++){const h=(_=this._activeProviderReplies.get(p))==null?void 0:_.find((S=>this._linkAtPosition(S.link,e)));if(h){t=!0,this._handleNewLink(h);break}}return t}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(s){if(!this._currentLink)return;const e=this._positionFromMouseEvent(s,this._element,this._mouseService);e&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(s,this._currentLink.link.text)}_clearCurrentLink(s,e){this._currentLink&&this._lastMouseEvent&&(!s||!e||this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,v.disposeArray)(this._linkCacheDisposables))}_handleNewLink(s){if(!this._lastMouseEvent)return;const e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(s.link,e)&&(this._currentLink=s,this._currentLink.state={decorations:{underline:s.link.decorations===void 0||s.link.decorations.underline,pointerCursor:s.link.decorations===void 0||s.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,s.link,this._lastMouseEvent),s.link.decorations={},Object.defineProperties(s.link.decorations,{pointerCursor:{get:()=>{var t,n;return(n=(t=this._currentLink)==null?void 0:t.state)==null?void 0:n.decorations.pointerCursor},set:t=>{var n;(n=this._currentLink)!=null&&n.state&&this._currentLink.state.decorations.pointerCursor!==t&&(this._currentLink.state.decorations.pointerCursor=t,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",t))}},underline:{get:()=>{var t,n;return(n=(t=this._currentLink)==null?void 0:t.state)==null?void 0:n.decorations.underline},set:t=>{var n,u,_;(n=this._currentLink)!=null&&n.state&&((_=(u=this._currentLink)==null?void 0:u.state)==null?void 0:_.decorations.underline)!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(s.link,t))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((t=>{if(!this._currentLink)return;const n=t.start===0?0:t.start+1+this._bufferService.buffer.ydisp,u=this._bufferService.buffer.ydisp+1+t.end;if(this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=u&&(this._clearCurrentLink(n,u),this._lastMouseEvent)){const _=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);_&&this._askForLink(_,!1)}}))))}_linkHover(s,e,t){var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&s.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(t,e.text)}_fireUnderlineEvent(s,e){const t=s.range,n=this._bufferService.buffer.ydisp,u=this._createLinkUnderlineEvent(t.start.x-1,t.start.y-n-1,t.end.x,t.end.y-n-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(u)}_linkLeave(s,e,t){var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&s.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(t,e.text)}_linkAtPosition(s,e){const t=s.range.start.y*this._bufferService.cols+s.range.start.x,n=s.range.end.y*this._bufferService.cols+s.range.end.x,u=e.y*this._bufferService.cols+e.x;return t<=u&&u<=n}_positionFromMouseEvent(s,e,t){const n=t.getCoords(s,e,this._bufferService.cols,this._bufferService.rows);if(n)return{x:n[0],y:n[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(s,e,t,n,u){return{x1:s,y1:e,x2:t,y2:n,cols:this._bufferService.cols,fg:u}}};r.Linkifier=i=l([f(1,c.IMouseService),f(2,c.IRenderService),f(3,g.IBufferService),f(4,c.ILinkProviderService)],i)},9042:(M,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(M,r,a){var l=this&&this.__decorate||function(c,i,s,e){var t,n=arguments.length,u=n<3?i:e===null?e=Object.getOwnPropertyDescriptor(i,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(c,i,s,e);else for(var _=c.length-1;_>=0;_--)(t=c[_])&&(u=(n<3?t(u):n>3?t(i,s,u):t(i,s))||u);return n>3&&u&&Object.defineProperty(i,s,u),u},f=this&&this.__param||function(c,i){return function(s,e){i(s,e,c)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const o=a(511),d=a(2585);let v=r.OscLinkProvider=class{constructor(c,i,s){this._bufferService=c,this._optionsService=i,this._oscLinkService=s}provideLinks(c,i){var S;const s=this._bufferService.buffer.lines.get(c-1);if(!s)return void i(void 0);const e=[],t=this._optionsService.rawOptions.linkHandler,n=new o.CellData,u=s.getTrimmedLength();let _=-1,p=-1,h=!1;for(let E=0;E<u;E++)if(p!==-1||s.hasContent(E)){if(s.loadCell(E,n),n.hasExtendedAttrs()&&n.extended.urlId){if(p===-1){p=E,_=n.extended.urlId;continue}h=n.extended.urlId!==_}else p!==-1&&(h=!0);if(h||p!==-1&&E===u-1){const k=(S=this._oscLinkService.getLinkData(_))==null?void 0:S.uri;if(k){const D={start:{x:p+1,y:c},end:{x:E+(h||E!==u-1?0:1),y:c}};let w=!1;if(!(t!=null&&t.allowNonHttpProtocols))try{const x=new URL(k);["http:","https:"].includes(x.protocol)||(w=!0)}catch{w=!0}w||e.push({text:k,range:D,activate:(x,B)=>t?t.activate(x,B,D):g(0,B),hover:(x,B)=>{var P;return(P=t==null?void 0:t.hover)==null?void 0:P.call(t,x,B,D)},leave:(x,B)=>{var P;return(P=t==null?void 0:t.leave)==null?void 0:P.call(t,x,B,D)}})}h=!1,n.hasExtendedAttrs()&&n.extended.urlId?(p=E,_=n.extended.urlId):(p=-1,_=-1)}}i(e)}};function g(c,i){if(confirm(`Do you want to navigate to ${i}?
4
4
 
@@ -1,4 +1,4 @@
1
- import{i as F,l as Z,b as ie,c as cn,r as dn,W as un}from"./index-8j6p-pmQ.js";function gn(){let t=document.getElementById("ge-vendor-toast-host");return t||(t=document.createElement("div"),t.id="ge-vendor-toast-host",t.style.cssText="position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:2147483000;display:flex;flex-direction:column;gap:8px;align-items:center;pointer-events:none;",document.body.appendChild(t)),t}function Tt(t,{error:n=!1,duration:s=2600}={}){if(typeof document>"u"||!t)return;const o=gn(),r=document.createElement("div");r.textContent=String(t),r.style.cssText=`pointer-events:auto;max-width:480px;padding:8px 14px;border-radius:4px;font-family:var(--font-body,system-ui);font-size:13px;line-height:1.4;box-shadow:0 4px 18px rgba(0,0,0,0.45);opacity:0;transition:opacity .15s;background:var(--color-bg-elevated,#1a1a1a);color:${n?"var(--color-danger,#e06c75)":"var(--color-fg,#9cdef2)"};border:1px solid ${n?"var(--color-danger,#e06c75)":"var(--color-border-bright,#355a66)"};`,o.appendChild(r),requestAnimationFrame(()=>{r.style.opacity="1"}),setTimeout(()=>{r.style.opacity="0",setTimeout(()=>r.remove(),200)},typeof s=="number"?s:2600)}function pn(t,n){Tt(t,typeof n=="number"?{duration:n}:n||{})}function mn(t){Tt(t,{error:!0,duration:5e3})}function hn(t){return typeof window>"u"||typeof window.confirm!="function"?Promise.resolve(!0):Promise.resolve(window.confirm(String(t)))}function fn(t,{defaultValue:n=""}={}){return typeof window>"u"||typeof window.prompt!="function"?Promise.resolve(null):Promise.resolve(window.prompt(String(t),n))}const W={showToast:pn,showError:mn,styledConfirm:hn,styledPrompt:fn},yn={getJSON(t,n=null){try{const s=localStorage.getItem(t);return s==null?n:JSON.parse(s)}catch{return n}},setJSON(t,n){try{localStorage.setItem(t,JSON.stringify(n))}catch{}},remove(t){try{localStorage.removeItem(t)}catch{}}},Be=new Map;function vn(t,n,s={}){const o=document.getElementById(t);if(!o){console.warn("[DragSort] container not found:",t);return}const r=s.instanceKey||t;Be.has(r)&&(Be.get(r).cleanup(),Be.delete(r));const i={onReorder:s.onReorder||null,handleSelector:s.handleSelector||null,excludeSelector:s.excludeSelector||null,storageKey:s.storageKey||null};let l=null,a=null,c=0,d=[];function u(){let C=Array.from(o.querySelectorAll(n));return i.excludeSelector&&(C=C.filter(M=>!M.matches(i.excludeSelector))),C}function g(C){const M=document.createElement("div");return M.className="drag-placeholder",M.style.height=C+"px",M.style.margin="4px 0",M}function m(C,M){const T=M.getBoundingClientRect(),B=o.getBoundingClientRect(),I=(T.top-B.top)/F()+o.scrollTop,_=(T.left-B.left)/F();c=C-T.top,d=u(),l=M,getComputedStyle(o).position==="static"&&(o.style.position="relative"),a=g(T.height/F()),M.parentNode.insertBefore(a,M),M.classList.add("dragging"),Object.assign(M.style,{position:"absolute",width:T.width/F()+"px",left:_+"px",top:I+"px",zIndex:"9999",pointerEvents:"none",margin:"0",boxSizing:"border-box",transition:"none"})}function w(C){if(!l)return;const M=o.getBoundingClientRect(),T=(C-c-M.top)/F()+o.scrollTop;l.style.top=T+"px";const B=d.filter(O=>O!==l),I=l.getBoundingClientRect(),_=I.top+I.height/2;let P=null;for(const O of B){const A=O.getBoundingClientRect(),D=A.top+A.height/2;if(_<D){P=O;break}}if(P)a.nextElementSibling!==P&&o.insertBefore(a,P);else if(B.length>0){const O=B[B.length-1];a!==O.nextElementSibling&&o.insertBefore(a,O.nextElementSibling)}}function k(){if(!l)return;const C=a.getBoundingClientRect(),M=o.getBoundingClientRect(),T=(C.top-M.top)/F()+o.scrollTop;l.style.transition="top 0.08s ease-out",l.style.top=T+"px",setTimeout(()=>{if(a.parentNode.insertBefore(l,a),a.remove(),l.classList.remove("dragging"),l.style.cssText="",i.storageKey){const B=u().map(I=>I.dataset.sessionId||I.dataset.modelId||I.dataset.filePath).filter(Boolean);B.length&&yn.setJSON(i.storageKey,B)}i.onReorder&&i.onReorder(u()),l=null,a=null,d=[]},80)}function E(C){if(C.button!==0||i.handleSelector&&!C.target.closest(i.handleSelector))return;const M=C.target.closest(n);!M||!o.contains(M)||i.excludeSelector&&M.matches(i.excludeSelector)||(C.preventDefault(),C.stopPropagation(),m(C.clientY,M),document.addEventListener("mousemove",p),document.addEventListener("mouseup",v))}function p(C){w(C.clientY)}function v(){document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",v),k()}let x=null,y=0,f=null;function h(C){if(C.target.closest("button, input, select, a")||i.handleSelector&&!C.target.closest(i.handleSelector))return;const M=C.target.closest(n);if(!M||!o.contains(M)||i.excludeSelector&&M.matches(i.excludeSelector))return;f=M;const T=C.touches[0].clientY;y=T,x=setTimeout(()=>{x=null,f&&(navigator.vibrate&&navigator.vibrate(30),m(T,f),f.classList.add("touch-dragging"))},400)}function L(C){if(x){Math.abs(C.touches[0].clientY-y)>10&&(clearTimeout(x),x=null,f=null);return}l&&(C.preventDefault(),w(C.touches[0].clientY))}function S(){if(x){clearTimeout(x),x=null,f=null;return}l&&(l.classList.remove("touch-dragging"),k())}o.addEventListener("mousedown",E),o.addEventListener("touchstart",h,{passive:!0}),o.addEventListener("touchmove",L,{passive:!1}),o.addEventListener("touchend",S),o.addEventListener("touchcancel",S);const b={cleanup:()=>{o.removeEventListener("mousedown",E),o.removeEventListener("touchstart",h),o.removeEventListener("touchmove",L),o.removeEventListener("touchend",S),o.removeEventListener("touchcancel",S)},refresh:()=>{d=u()}};return Be.set(r,b),b}const Bt={enable:vn};window.dragSortModule=Bt;class Re{constructor(n="AI is processing",s="right",o="spinner"){this.animations={spinner:["|","/","-","\\"],wave:["▁▂▃","▂▃▄","▃▄▅","▄▅▆","▅▆▅","▆▅▄","▅▄▃","▄▃▂","▃▂▁"]},this.animation=o,this.frames=this.animations[o]||this.animations.spinner,this.message=n,this.style=s,this.isRunning=!1,this.currentFrame=0,this.intervalId=null,this.rafId=null,this.element=null}createElement(){if(this.animation==="sinewave")return this._createSineWaveElement();if(this.animation==="whirlpool")return this._createWhirlpoolElement();const n=document.createElement("span");return n.className="ai-spinner",n.style.cssText="font-family: monospace; white-space: pre;",this.element=n,this.updateDisplay(),n}_createSineWaveElement(){const n=document.createElement("span");n.className="ai-spinner ai-spinner-sinewave",n.style.cssText="font-family: monospace; white-space: pre; display: inline-flex; align-items: center; gap: 6px;";const s=document.createElement("canvas");s.width=50,s.height=18,s.style.cssText="display: inline-block; vertical-align: middle;";const o=document.createElement("span");return o.textContent=this.message,this._msgSpan=o,this.style==="left"?(n.appendChild(s),n.appendChild(o)):this.style==="right"?(n.appendChild(o),n.appendChild(s)):n.appendChild(o),this._canvas=s,this._ctx=s.getContext("2d"),this._waveT=0,this._wavePrev=performance.now(),this.element=n,n}_drawSineWave(){const n=this._ctx,s=this._canvas.width,o=this._canvas.height,r=o/2,i=7,l=2.5,a=3,c=s-2*a,d=.44,u=.4,g=2.5,m=performance.now(),w=(m-this._wavePrev)/1e3;this._wavePrev=m;const k=.5*l*2*Math.PI+this._waveT,E=(1+Math.sin(k))/2,p=u+(g-u)*Math.pow(E,1.3);this._waveT+=w*d*p*l*2*Math.PI,n.clearRect(0,0,s,o),n.beginPath();for(let f=0;f<=80;f++){const h=f/80,L=a+h*c,S=h*l*2*Math.PI+this._waveT,b=r+Math.sin(S)*i;f===0?n.moveTo(L,b):n.lineTo(L,b)}n.strokeStyle="rgba(156, 222, 242, 0.5)",n.lineWidth=1.5,n.stroke();const v=s/2,x=.5*l*2*Math.PI+this._waveT,y=r+Math.sin(x)*i;n.beginPath(),n.arc(v,y,1.5,0,Math.PI*2),n.fillStyle="rgba(156, 222, 242, 0.9)",n.fill(),this.isRunning&&(this.rafId=requestAnimationFrame(()=>this._drawSineWave()))}_createWhirlpoolElement(){const n=document.createElement("span");n.className="ai-spinner ai-spinner-whirlpool",n.style.cssText="font-family: monospace; white-space: pre; display: inline-flex; align-items: center; gap: 6px;";const s=this._wpSize||18,o=document.createElement("canvas");o.width=s,o.height=s,o.style.cssText="display: inline-block; vertical-align: middle;";const r=document.createElement("span");return r.textContent=this.message,this._msgSpan=r,this.style==="left"?(n.appendChild(o),n.appendChild(r)):(this.style==="right"&&n.appendChild(r),n.appendChild(o)),this._wpCanvas=o,this._wpCtx=o.getContext("2d"),this._wpFrame=60,this.element=n,n}_drawWhirlpool(){const n=this._wpCtx,s=this._wpCanvas.width,o=this._wpCanvas.height,r=s/2,i=o/2,l=Math.min(s,o)/2-1,a=s>30?3:s>20?2:1.5,c=4,d=.45,u=.08,g=12,m=50,w=this._wpFrame;if(!this._wpColors){const f=getComputedStyle(document.documentElement);this._wpColors={fg:f.getPropertyValue("--red").trim()||f.getPropertyValue("--fg").trim()||"#9cdef2",track:f.getPropertyValue("--border").trim()||"#355a66"}}const k=this._wpColors.fg,E=this._wpColors.track;function p(f,h){const L=l*(1-f),S=f*c*Math.PI*2+h;return{x:r+Math.cos(S)*L,y:i+Math.sin(S)*L}}n.clearRect(0,0,s,o),n.beginPath(),n.arc(r,i,l-a/2,0,Math.PI*2),n.strokeStyle=E,n.lineWidth=a,n.globalAlpha=.35,n.stroke(),n.globalAlpha=1;const v=w*.008%1;n.lineCap="round",n.lineJoin="round";for(let f=g-1;f>=0;f--){const h=(f+1)/g,L=Math.ceil(m*h),S=Math.pow(1-h,2)*.7;n.beginPath();let b=!1,C=-1;for(let M=0;M<=L;M++){const T=M/m;let B=v-T*d;B<0&&(B+=1),b&&C<.3&&B>.7&&(n.stroke(),n.beginPath(),b=!1);const I=p(B,w*u);b?n.lineTo(I.x,I.y):(n.moveTo(I.x,I.y),b=!0),C=B}n.strokeStyle=k,n.lineWidth=a*.8,n.globalAlpha=S,n.stroke()}const x=p(v,w*u);if(n.beginPath(),n.arc(x.x,x.y,Math.max(1,a*.45),0,Math.PI*2),n.fillStyle=k,n.globalAlpha=.9,n.fill(),n.globalAlpha=1,this._wpFrame++,!this.isRunning)return;const y=!!(this.element&&this.element.isConnected);y&&(this._wpWasConnected=!0),y||!this._wpWasConnected?this.rafId=requestAnimationFrame(()=>this._drawWhirlpool()):this.isRunning=!1}updateDisplay(){if(!this.element)return;const n=this.frames[this.currentFrame%this.frames.length];let s="";this.style==="left"?s=`${n} ${this.message}`:this.style==="right"?s=`${this.message} ${n}`:s=this.message,this.element.innerHTML=s}start(n=150){if(!this.isRunning){if(this.isRunning=!0,this.animation==="sinewave"){this._wavePrev=performance.now(),this._drawSineWave();return}if(this.animation==="whirlpool"){this._wpFrame=60,this._drawWhirlpool();return}this.currentFrame=0,this.intervalId=setInterval(()=>{this.currentFrame++,this.updateDisplay()},n)}}stop(){this.isRunning=!1,this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null)}updateMessage(n){this.message=n,(this.animation==="sinewave"||this.animation==="whirlpool")&&this._msgSpan?this._msgSpan.textContent=n:this.updateDisplay()}updateLabel(n){this.message=n,this._msgSpan?this._msgSpan.textContent=n:this.updateDisplay()}destroy(){this.stop(),this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=null}}function wn(t,n="right",s="wave"){return new Re(t,n,s)}function bn(t=24){const n=new Re("","clean","whirlpool");n._wpSize=t;const s=n.createElement(),o=document.createElement("div");return o.className="spinner-whirlpool",o.style.cssText=`width:${t}px;height:${t}px;margin:8px auto;`,o.appendChild(s),n.start(),{element:o,stop:()=>n.stop(),destroy:()=>n.destroy()}}function xn(t="Loading…",n=16){const s=new Re("","clean","whirlpool");s._wpSize=n;const o=s.createElement(),r=document.createElement("div");r.className="lib-loading-row";const i=document.createElement("span");return i.textContent=t,r.appendChild(i),r.appendChild(o),s.start(),r}const _t={create:wn,createWhirlpool:bn,createLoadingRow:xn,Spinner:Re},Ht="odysseus-recent-colors",kn=12;let U=null,ue=null,ce=0,me=100,re=100,xe=null,de=null;function Me(t,n,s){return Math.max(n,Math.min(s,t))}function En(t){if(t=String(t||"").replace("#",""),t.length===3&&(t=t.split("").map(s=>s+s).join("")),!/^[0-9a-f]{6}$/i.test(t))return{r:0,g:0,b:0};const n=parseInt(t,16);return{r:n>>16&255,g:n>>8&255,b:n&255}}function Cn(t,n,s){return"#"+[t,n,s].map(o=>Math.round(Me(o,0,255)).toString(16).padStart(2,"0")).join("")}function Ln(t,n,s){t/=255,n/=255,s/=255;const o=Math.max(t,n,s),r=Math.min(t,n,s),i=o-r;let l;const a=o===0?0:i/o,c=o;return i===0?l=0:o===t?l=(n-s)/i+(n<s?6:0):o===n?l=(s-t)/i+2:l=(t-n)/i+4,{h:l*60,s:a*100,v:c*100}}function Sn(t,n,s){t=(t%360+360)%360,t/=60,n/=100,s/=100;const o=Math.floor(t),r=t-o,i=s*(1-n),l=s*(1-r*n),a=s*(1-(1-r)*n);let c,d,u;switch(o%6){case 0:c=s,d=a,u=i;break;case 1:c=l,d=s,u=i;break;case 2:c=i,d=s,u=a;break;case 3:c=i,d=l,u=s;break;case 4:c=a,d=i,u=s;break;case 5:c=s,d=i,u=l;break}return{r:Math.round(c*255),g:Math.round(d*255),b:Math.round(u*255)}}function we(t,n,s){const{r:o,g:r,b:i}=Sn(t,n,s);return Cn(o,r,i)}function Mn(t){const{r:n,g:s,b:o}=En(t);return Ln(n,s,o)}function Ot(){try{return JSON.parse(localStorage.getItem(Ht)||"[]")}catch{return[]}}function In(t){if(!/^#[0-9a-f]{6}$/i.test(t))return;let n=Ot().filter(s=>s.toLowerCase()!==t.toLowerCase());n.unshift(t.toLowerCase()),n=n.slice(0,kn);try{localStorage.setItem(Ht,JSON.stringify(n))}catch{}}function Pn(){return[{hex:we(ce+180,me,re),label:"Complement"},{hex:we(ce+30,me,re),label:"Analogous +30°"},{hex:we(ce-30,me,re),label:"Analogous -30°"},{hex:we(ce+150,me,re),label:"Split-complement"},{hex:we(ce,me,Me(re>50?re-30:re+30,10,95)),label:"Tone shift"}]}function Tn(){const t=document.createElement("div");return t.className="cp-popover",t.innerHTML=`
1
+ import{i as F,l as Z,b as ie,c as cn,r as dn,W as un}from"./index-COfbHCYv.js";function gn(){let t=document.getElementById("ge-vendor-toast-host");return t||(t=document.createElement("div"),t.id="ge-vendor-toast-host",t.style.cssText="position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:2147483000;display:flex;flex-direction:column;gap:8px;align-items:center;pointer-events:none;",document.body.appendChild(t)),t}function Tt(t,{error:n=!1,duration:s=2600}={}){if(typeof document>"u"||!t)return;const o=gn(),r=document.createElement("div");r.textContent=String(t),r.style.cssText=`pointer-events:auto;max-width:480px;padding:8px 14px;border-radius:4px;font-family:var(--font-body,system-ui);font-size:13px;line-height:1.4;box-shadow:0 4px 18px rgba(0,0,0,0.45);opacity:0;transition:opacity .15s;background:var(--color-bg-elevated,#1a1a1a);color:${n?"var(--color-danger,#e06c75)":"var(--color-fg,#9cdef2)"};border:1px solid ${n?"var(--color-danger,#e06c75)":"var(--color-border-bright,#355a66)"};`,o.appendChild(r),requestAnimationFrame(()=>{r.style.opacity="1"}),setTimeout(()=>{r.style.opacity="0",setTimeout(()=>r.remove(),200)},typeof s=="number"?s:2600)}function pn(t,n){Tt(t,typeof n=="number"?{duration:n}:n||{})}function mn(t){Tt(t,{error:!0,duration:5e3})}function hn(t){return typeof window>"u"||typeof window.confirm!="function"?Promise.resolve(!0):Promise.resolve(window.confirm(String(t)))}function fn(t,{defaultValue:n=""}={}){return typeof window>"u"||typeof window.prompt!="function"?Promise.resolve(null):Promise.resolve(window.prompt(String(t),n))}const W={showToast:pn,showError:mn,styledConfirm:hn,styledPrompt:fn},yn={getJSON(t,n=null){try{const s=localStorage.getItem(t);return s==null?n:JSON.parse(s)}catch{return n}},setJSON(t,n){try{localStorage.setItem(t,JSON.stringify(n))}catch{}},remove(t){try{localStorage.removeItem(t)}catch{}}},Be=new Map;function vn(t,n,s={}){const o=document.getElementById(t);if(!o){console.warn("[DragSort] container not found:",t);return}const r=s.instanceKey||t;Be.has(r)&&(Be.get(r).cleanup(),Be.delete(r));const i={onReorder:s.onReorder||null,handleSelector:s.handleSelector||null,excludeSelector:s.excludeSelector||null,storageKey:s.storageKey||null};let l=null,a=null,c=0,d=[];function u(){let C=Array.from(o.querySelectorAll(n));return i.excludeSelector&&(C=C.filter(M=>!M.matches(i.excludeSelector))),C}function g(C){const M=document.createElement("div");return M.className="drag-placeholder",M.style.height=C+"px",M.style.margin="4px 0",M}function m(C,M){const T=M.getBoundingClientRect(),B=o.getBoundingClientRect(),I=(T.top-B.top)/F()+o.scrollTop,_=(T.left-B.left)/F();c=C-T.top,d=u(),l=M,getComputedStyle(o).position==="static"&&(o.style.position="relative"),a=g(T.height/F()),M.parentNode.insertBefore(a,M),M.classList.add("dragging"),Object.assign(M.style,{position:"absolute",width:T.width/F()+"px",left:_+"px",top:I+"px",zIndex:"9999",pointerEvents:"none",margin:"0",boxSizing:"border-box",transition:"none"})}function w(C){if(!l)return;const M=o.getBoundingClientRect(),T=(C-c-M.top)/F()+o.scrollTop;l.style.top=T+"px";const B=d.filter(O=>O!==l),I=l.getBoundingClientRect(),_=I.top+I.height/2;let P=null;for(const O of B){const A=O.getBoundingClientRect(),D=A.top+A.height/2;if(_<D){P=O;break}}if(P)a.nextElementSibling!==P&&o.insertBefore(a,P);else if(B.length>0){const O=B[B.length-1];a!==O.nextElementSibling&&o.insertBefore(a,O.nextElementSibling)}}function k(){if(!l)return;const C=a.getBoundingClientRect(),M=o.getBoundingClientRect(),T=(C.top-M.top)/F()+o.scrollTop;l.style.transition="top 0.08s ease-out",l.style.top=T+"px",setTimeout(()=>{if(a.parentNode.insertBefore(l,a),a.remove(),l.classList.remove("dragging"),l.style.cssText="",i.storageKey){const B=u().map(I=>I.dataset.sessionId||I.dataset.modelId||I.dataset.filePath).filter(Boolean);B.length&&yn.setJSON(i.storageKey,B)}i.onReorder&&i.onReorder(u()),l=null,a=null,d=[]},80)}function E(C){if(C.button!==0||i.handleSelector&&!C.target.closest(i.handleSelector))return;const M=C.target.closest(n);!M||!o.contains(M)||i.excludeSelector&&M.matches(i.excludeSelector)||(C.preventDefault(),C.stopPropagation(),m(C.clientY,M),document.addEventListener("mousemove",p),document.addEventListener("mouseup",v))}function p(C){w(C.clientY)}function v(){document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",v),k()}let x=null,y=0,f=null;function h(C){if(C.target.closest("button, input, select, a")||i.handleSelector&&!C.target.closest(i.handleSelector))return;const M=C.target.closest(n);if(!M||!o.contains(M)||i.excludeSelector&&M.matches(i.excludeSelector))return;f=M;const T=C.touches[0].clientY;y=T,x=setTimeout(()=>{x=null,f&&(navigator.vibrate&&navigator.vibrate(30),m(T,f),f.classList.add("touch-dragging"))},400)}function L(C){if(x){Math.abs(C.touches[0].clientY-y)>10&&(clearTimeout(x),x=null,f=null);return}l&&(C.preventDefault(),w(C.touches[0].clientY))}function S(){if(x){clearTimeout(x),x=null,f=null;return}l&&(l.classList.remove("touch-dragging"),k())}o.addEventListener("mousedown",E),o.addEventListener("touchstart",h,{passive:!0}),o.addEventListener("touchmove",L,{passive:!1}),o.addEventListener("touchend",S),o.addEventListener("touchcancel",S);const b={cleanup:()=>{o.removeEventListener("mousedown",E),o.removeEventListener("touchstart",h),o.removeEventListener("touchmove",L),o.removeEventListener("touchend",S),o.removeEventListener("touchcancel",S)},refresh:()=>{d=u()}};return Be.set(r,b),b}const Bt={enable:vn};window.dragSortModule=Bt;class Re{constructor(n="AI is processing",s="right",o="spinner"){this.animations={spinner:["|","/","-","\\"],wave:["▁▂▃","▂▃▄","▃▄▅","▄▅▆","▅▆▅","▆▅▄","▅▄▃","▄▃▂","▃▂▁"]},this.animation=o,this.frames=this.animations[o]||this.animations.spinner,this.message=n,this.style=s,this.isRunning=!1,this.currentFrame=0,this.intervalId=null,this.rafId=null,this.element=null}createElement(){if(this.animation==="sinewave")return this._createSineWaveElement();if(this.animation==="whirlpool")return this._createWhirlpoolElement();const n=document.createElement("span");return n.className="ai-spinner",n.style.cssText="font-family: monospace; white-space: pre;",this.element=n,this.updateDisplay(),n}_createSineWaveElement(){const n=document.createElement("span");n.className="ai-spinner ai-spinner-sinewave",n.style.cssText="font-family: monospace; white-space: pre; display: inline-flex; align-items: center; gap: 6px;";const s=document.createElement("canvas");s.width=50,s.height=18,s.style.cssText="display: inline-block; vertical-align: middle;";const o=document.createElement("span");return o.textContent=this.message,this._msgSpan=o,this.style==="left"?(n.appendChild(s),n.appendChild(o)):this.style==="right"?(n.appendChild(o),n.appendChild(s)):n.appendChild(o),this._canvas=s,this._ctx=s.getContext("2d"),this._waveT=0,this._wavePrev=performance.now(),this.element=n,n}_drawSineWave(){const n=this._ctx,s=this._canvas.width,o=this._canvas.height,r=o/2,i=7,l=2.5,a=3,c=s-2*a,d=.44,u=.4,g=2.5,m=performance.now(),w=(m-this._wavePrev)/1e3;this._wavePrev=m;const k=.5*l*2*Math.PI+this._waveT,E=(1+Math.sin(k))/2,p=u+(g-u)*Math.pow(E,1.3);this._waveT+=w*d*p*l*2*Math.PI,n.clearRect(0,0,s,o),n.beginPath();for(let f=0;f<=80;f++){const h=f/80,L=a+h*c,S=h*l*2*Math.PI+this._waveT,b=r+Math.sin(S)*i;f===0?n.moveTo(L,b):n.lineTo(L,b)}n.strokeStyle="rgba(156, 222, 242, 0.5)",n.lineWidth=1.5,n.stroke();const v=s/2,x=.5*l*2*Math.PI+this._waveT,y=r+Math.sin(x)*i;n.beginPath(),n.arc(v,y,1.5,0,Math.PI*2),n.fillStyle="rgba(156, 222, 242, 0.9)",n.fill(),this.isRunning&&(this.rafId=requestAnimationFrame(()=>this._drawSineWave()))}_createWhirlpoolElement(){const n=document.createElement("span");n.className="ai-spinner ai-spinner-whirlpool",n.style.cssText="font-family: monospace; white-space: pre; display: inline-flex; align-items: center; gap: 6px;";const s=this._wpSize||18,o=document.createElement("canvas");o.width=s,o.height=s,o.style.cssText="display: inline-block; vertical-align: middle;";const r=document.createElement("span");return r.textContent=this.message,this._msgSpan=r,this.style==="left"?(n.appendChild(o),n.appendChild(r)):(this.style==="right"&&n.appendChild(r),n.appendChild(o)),this._wpCanvas=o,this._wpCtx=o.getContext("2d"),this._wpFrame=60,this.element=n,n}_drawWhirlpool(){const n=this._wpCtx,s=this._wpCanvas.width,o=this._wpCanvas.height,r=s/2,i=o/2,l=Math.min(s,o)/2-1,a=s>30?3:s>20?2:1.5,c=4,d=.45,u=.08,g=12,m=50,w=this._wpFrame;if(!this._wpColors){const f=getComputedStyle(document.documentElement);this._wpColors={fg:f.getPropertyValue("--red").trim()||f.getPropertyValue("--fg").trim()||"#9cdef2",track:f.getPropertyValue("--border").trim()||"#355a66"}}const k=this._wpColors.fg,E=this._wpColors.track;function p(f,h){const L=l*(1-f),S=f*c*Math.PI*2+h;return{x:r+Math.cos(S)*L,y:i+Math.sin(S)*L}}n.clearRect(0,0,s,o),n.beginPath(),n.arc(r,i,l-a/2,0,Math.PI*2),n.strokeStyle=E,n.lineWidth=a,n.globalAlpha=.35,n.stroke(),n.globalAlpha=1;const v=w*.008%1;n.lineCap="round",n.lineJoin="round";for(let f=g-1;f>=0;f--){const h=(f+1)/g,L=Math.ceil(m*h),S=Math.pow(1-h,2)*.7;n.beginPath();let b=!1,C=-1;for(let M=0;M<=L;M++){const T=M/m;let B=v-T*d;B<0&&(B+=1),b&&C<.3&&B>.7&&(n.stroke(),n.beginPath(),b=!1);const I=p(B,w*u);b?n.lineTo(I.x,I.y):(n.moveTo(I.x,I.y),b=!0),C=B}n.strokeStyle=k,n.lineWidth=a*.8,n.globalAlpha=S,n.stroke()}const x=p(v,w*u);if(n.beginPath(),n.arc(x.x,x.y,Math.max(1,a*.45),0,Math.PI*2),n.fillStyle=k,n.globalAlpha=.9,n.fill(),n.globalAlpha=1,this._wpFrame++,!this.isRunning)return;const y=!!(this.element&&this.element.isConnected);y&&(this._wpWasConnected=!0),y||!this._wpWasConnected?this.rafId=requestAnimationFrame(()=>this._drawWhirlpool()):this.isRunning=!1}updateDisplay(){if(!this.element)return;const n=this.frames[this.currentFrame%this.frames.length];let s="";this.style==="left"?s=`${n} ${this.message}`:this.style==="right"?s=`${this.message} ${n}`:s=this.message,this.element.innerHTML=s}start(n=150){if(!this.isRunning){if(this.isRunning=!0,this.animation==="sinewave"){this._wavePrev=performance.now(),this._drawSineWave();return}if(this.animation==="whirlpool"){this._wpFrame=60,this._drawWhirlpool();return}this.currentFrame=0,this.intervalId=setInterval(()=>{this.currentFrame++,this.updateDisplay()},n)}}stop(){this.isRunning=!1,this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null)}updateMessage(n){this.message=n,(this.animation==="sinewave"||this.animation==="whirlpool")&&this._msgSpan?this._msgSpan.textContent=n:this.updateDisplay()}updateLabel(n){this.message=n,this._msgSpan?this._msgSpan.textContent=n:this.updateDisplay()}destroy(){this.stop(),this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=null}}function wn(t,n="right",s="wave"){return new Re(t,n,s)}function bn(t=24){const n=new Re("","clean","whirlpool");n._wpSize=t;const s=n.createElement(),o=document.createElement("div");return o.className="spinner-whirlpool",o.style.cssText=`width:${t}px;height:${t}px;margin:8px auto;`,o.appendChild(s),n.start(),{element:o,stop:()=>n.stop(),destroy:()=>n.destroy()}}function xn(t="Loading…",n=16){const s=new Re("","clean","whirlpool");s._wpSize=n;const o=s.createElement(),r=document.createElement("div");r.className="lib-loading-row";const i=document.createElement("span");return i.textContent=t,r.appendChild(i),r.appendChild(o),s.start(),r}const _t={create:wn,createWhirlpool:bn,createLoadingRow:xn,Spinner:Re},Ht="odysseus-recent-colors",kn=12;let U=null,ue=null,ce=0,me=100,re=100,xe=null,de=null;function Me(t,n,s){return Math.max(n,Math.min(s,t))}function En(t){if(t=String(t||"").replace("#",""),t.length===3&&(t=t.split("").map(s=>s+s).join("")),!/^[0-9a-f]{6}$/i.test(t))return{r:0,g:0,b:0};const n=parseInt(t,16);return{r:n>>16&255,g:n>>8&255,b:n&255}}function Cn(t,n,s){return"#"+[t,n,s].map(o=>Math.round(Me(o,0,255)).toString(16).padStart(2,"0")).join("")}function Ln(t,n,s){t/=255,n/=255,s/=255;const o=Math.max(t,n,s),r=Math.min(t,n,s),i=o-r;let l;const a=o===0?0:i/o,c=o;return i===0?l=0:o===t?l=(n-s)/i+(n<s?6:0):o===n?l=(s-t)/i+2:l=(t-n)/i+4,{h:l*60,s:a*100,v:c*100}}function Sn(t,n,s){t=(t%360+360)%360,t/=60,n/=100,s/=100;const o=Math.floor(t),r=t-o,i=s*(1-n),l=s*(1-r*n),a=s*(1-(1-r)*n);let c,d,u;switch(o%6){case 0:c=s,d=a,u=i;break;case 1:c=l,d=s,u=i;break;case 2:c=i,d=s,u=a;break;case 3:c=i,d=l,u=s;break;case 4:c=a,d=i,u=s;break;case 5:c=s,d=i,u=l;break}return{r:Math.round(c*255),g:Math.round(d*255),b:Math.round(u*255)}}function we(t,n,s){const{r:o,g:r,b:i}=Sn(t,n,s);return Cn(o,r,i)}function Mn(t){const{r:n,g:s,b:o}=En(t);return Ln(n,s,o)}function Ot(){try{return JSON.parse(localStorage.getItem(Ht)||"[]")}catch{return[]}}function In(t){if(!/^#[0-9a-f]{6}$/i.test(t))return;let n=Ot().filter(s=>s.toLowerCase()!==t.toLowerCase());n.unshift(t.toLowerCase()),n=n.slice(0,kn);try{localStorage.setItem(Ht,JSON.stringify(n))}catch{}}function Pn(){return[{hex:we(ce+180,me,re),label:"Complement"},{hex:we(ce+30,me,re),label:"Analogous +30°"},{hex:we(ce-30,me,re),label:"Analogous -30°"},{hex:we(ce+150,me,re),label:"Split-complement"},{hex:we(ce,me,Me(re>50?re-30:re+30,10,95)),label:"Tone shift"}]}function Tn(){const t=document.createElement("div");return t.className="cp-popover",t.innerHTML=`
2
2
  <div class="cp-sl" data-drag="sl">
3
3
  <div class="cp-sl-white"></div>
4
4
  <div class="cp-sl-black"></div>