yepanywhere 0.7.0 → 0.8.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 (1663) hide show
  1. package/README.md +63 -67
  2. package/bundled/@yep-anywhere/shared/dist/__tests__/relay-mux.test.d.ts +2 -0
  3. package/bundled/@yep-anywhere/shared/dist/__tests__/relay-mux.test.d.ts.map +1 -0
  4. package/bundled/@yep-anywhere/shared/dist/__tests__/relay-mux.test.js +43 -0
  5. package/bundled/@yep-anywhere/shared/dist/__tests__/relay-mux.test.js.map +1 -0
  6. package/bundled/@yep-anywhere/shared/dist/__tests__/server-capabilities.test.d.ts +2 -0
  7. package/bundled/@yep-anywhere/shared/dist/__tests__/server-capabilities.test.d.ts.map +1 -0
  8. package/bundled/@yep-anywhere/shared/dist/__tests__/server-capabilities.test.js +220 -0
  9. package/bundled/@yep-anywhere/shared/dist/__tests__/server-capabilities.test.js.map +1 -0
  10. package/bundled/@yep-anywhere/shared/dist/agent-context.d.ts +1 -1
  11. package/bundled/@yep-anywhere/shared/dist/agent-context.d.ts.map +1 -1
  12. package/bundled/@yep-anywhere/shared/dist/agent-context.js +1 -1
  13. package/bundled/@yep-anywhere/shared/dist/agent-context.js.map +1 -1
  14. package/bundled/@yep-anywhere/shared/dist/app-types.d.ts +39 -3
  15. package/bundled/@yep-anywhere/shared/dist/app-types.d.ts.map +1 -1
  16. package/bundled/@yep-anywhere/shared/dist/app-types.js +327 -0
  17. package/bundled/@yep-anywhere/shared/dist/app-types.js.map +1 -1
  18. package/bundled/@yep-anywhere/shared/dist/binary-framing.d.ts +36 -2
  19. package/bundled/@yep-anywhere/shared/dist/binary-framing.d.ts.map +1 -1
  20. package/bundled/@yep-anywhere/shared/dist/binary-framing.js +155 -4
  21. package/bundled/@yep-anywhere/shared/dist/binary-framing.js.map +1 -1
  22. package/bundled/@yep-anywhere/shared/dist/capability-ids.d.ts +344 -0
  23. package/bundled/@yep-anywhere/shared/dist/capability-ids.d.ts.map +1 -0
  24. package/bundled/@yep-anywhere/shared/dist/capability-ids.js +368 -0
  25. package/bundled/@yep-anywhere/shared/dist/capability-ids.js.map +1 -0
  26. package/bundled/@yep-anywhere/shared/dist/claude-additional-models.d.ts +4 -0
  27. package/bundled/@yep-anywhere/shared/dist/claude-additional-models.d.ts.map +1 -1
  28. package/bundled/@yep-anywhere/shared/dist/claude-additional-models.js +16 -7
  29. package/bundled/@yep-anywhere/shared/dist/claude-additional-models.js.map +1 -1
  30. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SystemEntrySchema.d.ts +1 -0
  31. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SystemEntrySchema.d.ts.map +1 -1
  32. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SystemEntrySchema.js +1 -0
  33. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/entry/SystemEntrySchema.js.map +1 -1
  34. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/guards.d.ts +29 -0
  35. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/guards.d.ts.map +1 -1
  36. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/guards.js +63 -0
  37. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/guards.js.map +1 -1
  38. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/index.d.ts +2 -0
  39. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/index.d.ts.map +1 -1
  40. package/bundled/@yep-anywhere/shared/dist/claude-steering.d.ts +10 -0
  41. package/bundled/@yep-anywhere/shared/dist/claude-steering.d.ts.map +1 -0
  42. package/bundled/@yep-anywhere/shared/dist/claude-steering.js +51 -0
  43. package/bundled/@yep-anywhere/shared/dist/claude-steering.js.map +1 -0
  44. package/bundled/@yep-anywhere/shared/dist/codex-schema/index.d.ts +1 -1
  45. package/bundled/@yep-anywhere/shared/dist/codex-schema/index.js +1 -1
  46. package/bundled/@yep-anywhere/shared/dist/codex-schema/session.d.ts +180 -4
  47. package/bundled/@yep-anywhere/shared/dist/codex-schema/session.d.ts.map +1 -1
  48. package/bundled/@yep-anywhere/shared/dist/codex-schema/session.js +62 -1
  49. package/bundled/@yep-anywhere/shared/dist/codex-schema/session.js.map +1 -1
  50. package/bundled/@yep-anywhere/shared/dist/codex-tool-correlation.d.ts +3 -3
  51. package/bundled/@yep-anywhere/shared/dist/codex-tool-correlation.d.ts.map +1 -1
  52. package/bundled/@yep-anywhere/shared/dist/codex-tool-correlation.js +7 -3
  53. package/bundled/@yep-anywhere/shared/dist/codex-tool-correlation.js.map +1 -1
  54. package/bundled/@yep-anywhere/shared/dist/filePathDetection.d.ts.map +1 -1
  55. package/bundled/@yep-anywhere/shared/dist/filePathDetection.js +1 -0
  56. package/bundled/@yep-anywhere/shared/dist/filePathDetection.js.map +1 -1
  57. package/bundled/@yep-anywhere/shared/dist/git-status.d.ts +302 -7
  58. package/bundled/@yep-anywhere/shared/dist/git-status.d.ts.map +1 -1
  59. package/bundled/@yep-anywhere/shared/dist/git-status.js +1 -1
  60. package/bundled/@yep-anywhere/shared/dist/git-status.js.map +1 -1
  61. package/bundled/@yep-anywhere/shared/dist/glossary/compiler.d.ts +3 -0
  62. package/bundled/@yep-anywhere/shared/dist/glossary/compiler.d.ts.map +1 -0
  63. package/bundled/@yep-anywhere/shared/dist/glossary/compiler.js +308 -0
  64. package/bundled/@yep-anywhere/shared/dist/glossary/compiler.js.map +1 -0
  65. package/bundled/@yep-anywhere/shared/dist/glossary/index.d.ts +6 -0
  66. package/bundled/@yep-anywhere/shared/dist/glossary/index.d.ts.map +1 -0
  67. package/bundled/@yep-anywhere/shared/dist/glossary/index.js +6 -0
  68. package/bundled/@yep-anywhere/shared/dist/glossary/index.js.map +1 -0
  69. package/bundled/@yep-anywhere/shared/dist/glossary/markdown.d.ts +16 -0
  70. package/bundled/@yep-anywhere/shared/dist/glossary/markdown.d.ts.map +1 -0
  71. package/bundled/@yep-anywhere/shared/dist/glossary/markdown.js +434 -0
  72. package/bundled/@yep-anywhere/shared/dist/glossary/markdown.js.map +1 -0
  73. package/bundled/@yep-anywhere/shared/dist/glossary/matcher.d.ts +4 -0
  74. package/bundled/@yep-anywhere/shared/dist/glossary/matcher.d.ts.map +1 -0
  75. package/bundled/@yep-anywhere/shared/dist/glossary/matcher.js +124 -0
  76. package/bundled/@yep-anywhere/shared/dist/glossary/matcher.js.map +1 -0
  77. package/bundled/@yep-anywhere/shared/dist/glossary/normalization.d.ts +10 -0
  78. package/bundled/@yep-anywhere/shared/dist/glossary/normalization.d.ts.map +1 -0
  79. package/bundled/@yep-anywhere/shared/dist/glossary/normalization.js +155 -0
  80. package/bundled/@yep-anywhere/shared/dist/glossary/normalization.js.map +1 -0
  81. package/bundled/@yep-anywhere/shared/dist/glossary/types.d.ts +142 -0
  82. package/bundled/@yep-anywhere/shared/dist/glossary/types.d.ts.map +1 -0
  83. package/bundled/@yep-anywhere/shared/dist/glossary/types.js +14 -0
  84. package/bundled/@yep-anywhere/shared/dist/glossary/types.js.map +1 -0
  85. package/bundled/@yep-anywhere/shared/dist/heartbeat.d.ts +19 -0
  86. package/bundled/@yep-anywhere/shared/dist/heartbeat.d.ts.map +1 -0
  87. package/bundled/@yep-anywhere/shared/dist/heartbeat.js +5 -0
  88. package/bundled/@yep-anywhere/shared/dist/heartbeat.js.map +1 -0
  89. package/bundled/@yep-anywhere/shared/dist/host-agent-processes.d.ts +36 -0
  90. package/bundled/@yep-anywhere/shared/dist/host-agent-processes.d.ts.map +1 -0
  91. package/bundled/@yep-anywhere/shared/dist/host-agent-processes.js +2 -0
  92. package/bundled/@yep-anywhere/shared/dist/host-agent-processes.js.map +1 -0
  93. package/bundled/@yep-anywhere/shared/dist/host-identity.d.ts.map +1 -1
  94. package/bundled/@yep-anywhere/shared/dist/host-identity.js +1 -2
  95. package/bundled/@yep-anywhere/shared/dist/host-identity.js.map +1 -1
  96. package/bundled/@yep-anywhere/shared/dist/idle-reap.d.ts +8 -0
  97. package/bundled/@yep-anywhere/shared/dist/idle-reap.d.ts.map +1 -0
  98. package/bundled/@yep-anywhere/shared/dist/idle-reap.js +18 -0
  99. package/bundled/@yep-anywhere/shared/dist/idle-reap.js.map +1 -0
  100. package/bundled/@yep-anywhere/shared/dist/index.d.ts +30 -11
  101. package/bundled/@yep-anywhere/shared/dist/index.d.ts.map +1 -1
  102. package/bundled/@yep-anywhere/shared/dist/index.js +27 -8
  103. package/bundled/@yep-anywhere/shared/dist/index.js.map +1 -1
  104. package/bundled/@yep-anywhere/shared/dist/jsonlTable.d.ts +1 -1
  105. package/bundled/@yep-anywhere/shared/dist/jsonlTable.d.ts.map +1 -1
  106. package/bundled/@yep-anywhere/shared/dist/jsonlTable.js +5 -2
  107. package/bundled/@yep-anywhere/shared/dist/jsonlTable.js.map +1 -1
  108. package/bundled/@yep-anywhere/shared/dist/linear-regex.d.ts +2 -0
  109. package/bundled/@yep-anywhere/shared/dist/linear-regex.d.ts.map +1 -0
  110. package/bundled/@yep-anywhere/shared/dist/linear-regex.js +362 -0
  111. package/bundled/@yep-anywhere/shared/dist/linear-regex.js.map +1 -0
  112. package/bundled/@yep-anywhere/shared/dist/markdown-files.d.ts +5 -0
  113. package/bundled/@yep-anywhere/shared/dist/markdown-files.d.ts.map +1 -0
  114. package/bundled/@yep-anywhere/shared/dist/markdown-files.js +26 -0
  115. package/bundled/@yep-anywhere/shared/dist/markdown-files.js.map +1 -0
  116. package/bundled/@yep-anywhere/shared/dist/nested-harness-launch.d.ts +29 -0
  117. package/bundled/@yep-anywhere/shared/dist/nested-harness-launch.d.ts.map +1 -0
  118. package/bundled/@yep-anywhere/shared/dist/nested-harness-launch.js +243 -0
  119. package/bundled/@yep-anywhere/shared/dist/nested-harness-launch.js.map +1 -0
  120. package/bundled/@yep-anywhere/shared/dist/opencode-schema/events.d.ts +41 -0
  121. package/bundled/@yep-anywhere/shared/dist/opencode-schema/events.d.ts.map +1 -1
  122. package/bundled/@yep-anywhere/shared/dist/opencode-schema/events.js +14 -0
  123. package/bundled/@yep-anywhere/shared/dist/opencode-schema/events.js.map +1 -1
  124. package/bundled/@yep-anywhere/shared/dist/opencode-schema/session.d.ts +9 -0
  125. package/bundled/@yep-anywhere/shared/dist/opencode-schema/session.d.ts.map +1 -1
  126. package/bundled/@yep-anywhere/shared/dist/opencode-schema/session.js +2 -0
  127. package/bundled/@yep-anywhere/shared/dist/opencode-schema/session.js.map +1 -1
  128. package/bundled/@yep-anywhere/shared/dist/project-code-names.d.ts +15 -0
  129. package/bundled/@yep-anywhere/shared/dist/project-code-names.d.ts.map +1 -0
  130. package/bundled/@yep-anywhere/shared/dist/project-code-names.js +78 -0
  131. package/bundled/@yep-anywhere/shared/dist/project-code-names.js.map +1 -0
  132. package/bundled/@yep-anywhere/shared/dist/project-path-links.d.ts +19 -0
  133. package/bundled/@yep-anywhere/shared/dist/project-path-links.d.ts.map +1 -0
  134. package/bundled/@yep-anywhere/shared/dist/project-path-links.js +50 -0
  135. package/bundled/@yep-anywhere/shared/dist/project-path-links.js.map +1 -0
  136. package/bundled/@yep-anywhere/shared/dist/project-queue.d.ts +3 -1
  137. package/bundled/@yep-anywhere/shared/dist/project-queue.d.ts.map +1 -1
  138. package/bundled/@yep-anywhere/shared/dist/project-queue.js.map +1 -1
  139. package/bundled/@yep-anywhere/shared/dist/provider-subscription-usage.d.ts +39 -0
  140. package/bundled/@yep-anywhere/shared/dist/provider-subscription-usage.d.ts.map +1 -0
  141. package/bundled/@yep-anywhere/shared/dist/provider-subscription-usage.js +21 -0
  142. package/bundled/@yep-anywhere/shared/dist/provider-subscription-usage.js.map +1 -0
  143. package/bundled/@yep-anywhere/shared/dist/public-shares.d.ts +100 -2
  144. package/bundled/@yep-anywhere/shared/dist/public-shares.d.ts.map +1 -1
  145. package/bundled/@yep-anywhere/shared/dist/public-shares.js +94 -1
  146. package/bundled/@yep-anywhere/shared/dist/public-shares.js.map +1 -1
  147. package/bundled/@yep-anywhere/shared/dist/relay-mux.d.ts +58 -0
  148. package/bundled/@yep-anywhere/shared/dist/relay-mux.d.ts.map +1 -0
  149. package/bundled/@yep-anywhere/shared/dist/relay-mux.js +116 -0
  150. package/bundled/@yep-anywhere/shared/dist/relay-mux.js.map +1 -0
  151. package/bundled/@yep-anywhere/shared/dist/relay.d.ts +11 -3
  152. package/bundled/@yep-anywhere/shared/dist/relay.d.ts.map +1 -1
  153. package/bundled/@yep-anywhere/shared/dist/relay.js +7 -1
  154. package/bundled/@yep-anywhere/shared/dist/relay.js.map +1 -1
  155. package/bundled/@yep-anywhere/shared/dist/review-comments.d.ts +355 -0
  156. package/bundled/@yep-anywhere/shared/dist/review-comments.d.ts.map +1 -0
  157. package/bundled/@yep-anywhere/shared/dist/review-comments.js +857 -0
  158. package/bundled/@yep-anywhere/shared/dist/review-comments.js.map +1 -0
  159. package/bundled/@yep-anywhere/shared/dist/security-clients.d.ts +1070 -0
  160. package/bundled/@yep-anywhere/shared/dist/security-clients.d.ts.map +1 -0
  161. package/bundled/@yep-anywhere/shared/dist/security-clients.js +330 -0
  162. package/bundled/@yep-anywhere/shared/dist/security-clients.js.map +1 -0
  163. package/bundled/@yep-anywhere/shared/dist/server-capabilities.d.ts +1261 -2
  164. package/bundled/@yep-anywhere/shared/dist/server-capabilities.d.ts.map +1 -1
  165. package/bundled/@yep-anywhere/shared/dist/server-capabilities.js +1624 -18
  166. package/bundled/@yep-anywhere/shared/dist/server-capabilities.js.map +1 -1
  167. package/bundled/@yep-anywhere/shared/dist/session/UnifiedSession.d.ts +3 -0
  168. package/bundled/@yep-anywhere/shared/dist/session/UnifiedSession.d.ts.map +1 -1
  169. package/bundled/@yep-anywhere/shared/dist/skill-invocations.d.ts +56 -0
  170. package/bundled/@yep-anywhere/shared/dist/skill-invocations.d.ts.map +1 -0
  171. package/bundled/@yep-anywhere/shared/dist/skill-invocations.js +179 -0
  172. package/bundled/@yep-anywhere/shared/dist/skill-invocations.js.map +1 -0
  173. package/bundled/@yep-anywhere/shared/dist/subagent-depth.d.ts +7 -0
  174. package/bundled/@yep-anywhere/shared/dist/subagent-depth.d.ts.map +1 -0
  175. package/bundled/@yep-anywhere/shared/dist/subagent-depth.js +11 -0
  176. package/bundled/@yep-anywhere/shared/dist/subagent-depth.js.map +1 -0
  177. package/bundled/@yep-anywhere/shared/dist/tool-result-media.d.ts +21 -0
  178. package/bundled/@yep-anywhere/shared/dist/tool-result-media.d.ts.map +1 -0
  179. package/bundled/@yep-anywhere/shared/dist/tool-result-media.js +8 -0
  180. package/bundled/@yep-anywhere/shared/dist/tool-result-media.js.map +1 -0
  181. package/bundled/@yep-anywhere/shared/dist/toon.d.ts +1 -1
  182. package/bundled/@yep-anywhere/shared/dist/toon.js +1 -1
  183. package/bundled/@yep-anywhere/shared/dist/types.d.ts +167 -31
  184. package/bundled/@yep-anywhere/shared/dist/types.d.ts.map +1 -1
  185. package/bundled/@yep-anywhere/shared/dist/types.js +38 -2
  186. package/bundled/@yep-anywhere/shared/dist/types.js.map +1 -1
  187. package/bundled/@yep-anywhere/shared/dist/user-message-metadata.d.ts +2 -0
  188. package/bundled/@yep-anywhere/shared/dist/user-message-metadata.d.ts.map +1 -1
  189. package/bundled/@yep-anywhere/shared/package.json +1 -1
  190. package/client-dist/_headers +17 -0
  191. package/client-dist/assets/ActivityPage-B9q2bxQG.js +1 -0
  192. package/client-dist/assets/AgentsPage-BJQFd1Lq.css +1 -0
  193. package/client-dist/assets/AgentsPage-D2BeReoU.js +2 -0
  194. package/client-dist/assets/App-BCuhyupw.js +2 -0
  195. package/client-dist/assets/App-D0_8DZ_p.css +1 -0
  196. package/client-dist/assets/AttachmentChip-CXZaCUv_.css +1 -0
  197. package/client-dist/assets/AttachmentChip-DeFRfm3S.js +1 -0
  198. package/client-dist/assets/AuthContext-ttH_RHyv.js +1 -0
  199. package/client-dist/assets/BangCommandDisplayObject-Csd_4G38.js +2 -0
  200. package/client-dist/assets/BangCommandDisplayObject-DDvXHqkT.css +1 -0
  201. package/client-dist/assets/BangCommandsPage-4tAg1P-B.js +1 -0
  202. package/client-dist/assets/BangCommandsPage-Bo6q40bU.css +1 -0
  203. package/client-dist/assets/BrowserDebugToolbarButton-d5UWhDkL.js +1 -0
  204. package/client-dist/assets/CodexUpdatePrompt-C0NYRpC1.js +1 -0
  205. package/client-dist/assets/EmulatorPage-B_SHr-YK.css +1 -0
  206. package/client-dist/assets/EmulatorPage-CaGjOU02.js +1 -0
  207. package/client-dist/assets/FilePage-CFYA8Jmz.js +1 -0
  208. package/client-dist/assets/FileViewer-4aDxZNTu.js +326 -0
  209. package/client-dist/assets/FileViewer-CzrwiYp4.css +1 -0
  210. package/client-dist/assets/FilterDropdown-CB_tRt6g.css +1 -0
  211. package/client-dist/assets/FilterDropdown-DefBPgy4.js +1 -0
  212. package/client-dist/assets/FloatingActionButton-CPVF8aGh.js +1 -0
  213. package/client-dist/assets/GitStatusPage-BMAX1XtQ.js +15 -0
  214. package/client-dist/assets/GitStatusPage-DiqFcPhe.css +1 -0
  215. package/client-dist/assets/GlobalSessionsPage-1KH8bdTH.css +1 -0
  216. package/client-dist/assets/GlobalSessionsPage-BhQXZsnZ.js +1 -0
  217. package/client-dist/assets/GlossaryContext-C4ZqYUH9.css +1 -0
  218. package/client-dist/assets/GlossaryContext-Cp_4G9df.js +1 -0
  219. package/client-dist/assets/HeartbeatTextArea-CjOFU5D8.js +1 -0
  220. package/client-dist/assets/HeartbeatTextArea-Dr6VozUp.css +1 -0
  221. package/client-dist/assets/HostIdentityContext-BuhXEIrO.js +1 -0
  222. package/client-dist/assets/HostIdentityMarker-DKxUjPEf.js +1 -0
  223. package/client-dist/assets/HostsPage--bWNVMY2.js +1 -0
  224. package/client-dist/assets/HostsPage-Da-F6Wx_.css +1 -0
  225. package/client-dist/assets/InboxContext-BKyIY7qc.js +1 -0
  226. package/client-dist/assets/InboxPage-DafjmvUl.css +1 -0
  227. package/client-dist/assets/InboxPage-wbKwNVKg.js +1 -0
  228. package/client-dist/assets/LoginPage-GYi_XEnG.js +1 -0
  229. package/client-dist/assets/MarkdownPreview-AEv1dNzV.js +1 -0
  230. package/client-dist/assets/MarkdownPreview-D0wBwpSu.css +1 -0
  231. package/client-dist/assets/MessageInput-C2p_cEHF.css +1 -0
  232. package/client-dist/assets/MessageInput-COCoVatC.js +3 -0
  233. package/client-dist/assets/MessageList-BHFVgfnL.js +6 -0
  234. package/client-dist/assets/MessageList-C9Z7aFHx.css +1 -0
  235. package/client-dist/assets/Modal-C59BcdHD.js +15 -0
  236. package/client-dist/assets/Modal-DydQGLdZ.css +1 -0
  237. package/client-dist/assets/NavigationLayout-BNRJ1SpX.js +2 -0
  238. package/client-dist/assets/NavigationLayout-ChjNahB_.css +1 -0
  239. package/client-dist/assets/NewSessionPage-CNO3t_Zi.js +1 -0
  240. package/client-dist/assets/PageHeader-DLhedAPm.js +1 -0
  241. package/client-dist/assets/ProjectSessionDefaultsModal-C5tcoqx_.css +1 -0
  242. package/client-dist/assets/ProjectSessionDefaultsModal-D7s41P9z.js +1 -0
  243. package/client-dist/assets/ProjectsPage-8yEzRoSP.css +1 -0
  244. package/client-dist/assets/ProjectsPage-D2-mjMXS.js +1 -0
  245. package/client-dist/assets/ProviderBadge-C8td51kV.js +1 -0
  246. package/client-dist/assets/ProviderChildSessionDetail-B9xcZcb6.js +129 -0
  247. package/client-dist/assets/ProviderChildSessionDetail-rZPKSfqF.css +1 -0
  248. package/client-dist/assets/ProviderChildSessionPage-BjoskULT.css +1 -0
  249. package/client-dist/assets/ProviderChildSessionPage-DuJN7uHD.js +1 -0
  250. package/client-dist/assets/SchemaValidationContext-CiLezKRZ.css +1 -0
  251. package/client-dist/assets/SchemaValidationContext-oxtR_d_G.js +1 -0
  252. package/client-dist/assets/SessionPage-BVeMOC--.css +1 -0
  253. package/client-dist/assets/SessionPage-UUYKBNUl.js +36 -0
  254. package/client-dist/assets/SourceFileHeaderActions-czvC1JKL.js +1 -0
  255. package/client-dist/assets/ThinkingControls-CmOG-fOQ.css +1 -0
  256. package/client-dist/assets/ThinkingControls-Yv0aTXJC.js +1 -0
  257. package/client-dist/assets/VoiceInputButton-COdV4sNA.js +1 -0
  258. package/client-dist/assets/VoiceInputButton-CTd6zXtZ.css +1 -0
  259. package/client-dist/assets/WorkstreamsPage-BCC_7j6h.js +1 -0
  260. package/client-dist/assets/WorkstreamsPage-kESwpARF.css +1 -0
  261. package/client-dist/assets/YepAnywhereLogo-B15FCqEj.js +1 -0
  262. package/client-dist/assets/activityBus-VjgeGPMB.js +42 -0
  263. package/client-dist/assets/appHref-ByaEnJGJ.js +1 -0
  264. package/client-dist/assets/de-DKHK9Tu3.js +6 -0
  265. package/client-dist/assets/deviceDetection-BVPclkty.js +1 -0
  266. package/client-dist/assets/es-XSkBrKBg.js +6 -0
  267. package/client-dist/assets/fr-DKUJaPhN.js +6 -0
  268. package/client-dist/assets/frontendReload-t1MBqojn.js +1 -0
  269. package/client-dist/assets/index-8yMgG4-w.css +1 -0
  270. package/client-dist/assets/index-BlfKG1Oa.js +16 -0
  271. package/client-dist/assets/index-CRz1GJAq.css +1 -0
  272. package/client-dist/assets/index-CgkTqljR.js +2 -0
  273. package/client-dist/assets/index-D47M-JMk.js +33 -0
  274. package/client-dist/assets/index-DnwFOiB5.js +1 -0
  275. package/client-dist/assets/index-YFIFpYSg.js +1 -0
  276. package/client-dist/assets/ja-BDnQUlyD.js +6 -0
  277. package/client-dist/assets/newSessionPrefill-B03klTbN.js +1 -0
  278. package/client-dist/assets/react-runtime-Dw4bUKEF.js +41 -0
  279. package/client-dist/assets/registerServiceWorker-DkTc70d4.js +1 -0
  280. package/client-dist/assets/sessionHistorySearch.worker-3xcA03g5.js +60 -0
  281. package/client-dist/assets/sessionNavigationState-B0NurMU6.js +1 -0
  282. package/client-dist/assets/sourceControlNavigationState-w3TYNwib.js +1 -0
  283. package/client-dist/assets/sourceRuntime-Dzap6qZX.js +11 -0
  284. package/client-dist/assets/sourceTransportPaths-CbOCoJJb.js +1 -0
  285. package/client-dist/assets/speechDraftTransaction-B6k3bStO.js +1 -0
  286. package/client-dist/assets/text-BehwCDu9.js +1 -0
  287. package/client-dist/assets/types-Cm98CR-a.js +1 -0
  288. package/client-dist/assets/useActivityBusState-DemwlSNp.js +1 -0
  289. package/client-dist/assets/useCodexUpdateStatus-bHHkvK4K.js +1 -0
  290. package/client-dist/assets/useDocumentTitle-rx41kKWp.js +1 -0
  291. package/client-dist/assets/useEmulators-CpDUcdfL.js +1 -0
  292. package/client-dist/assets/useFileActivity-C70dzD5U.js +1 -0
  293. package/client-dist/assets/useFloatingActionButtonEnabled-sLWhUZYo.js +1 -0
  294. package/client-dist/assets/useKeepMobileKeyboardOpenAfterDelivery-BMDI-BSY.js +1 -0
  295. package/client-dist/assets/useProviders-BWp3tEXv.js +1 -0
  296. package/client-dist/assets/useRecentSessions-BeuekUHb.js +1 -0
  297. package/client-dist/assets/useRecentSessions-Bks9U2oh.css +1 -0
  298. package/client-dist/assets/useRelativeNow-B6kyvcmL.js +1 -0
  299. package/client-dist/assets/useReloadNotifications-B1Gip4qS.js +1 -0
  300. package/client-dist/assets/useSidebarWidth-CNuw7NNf.js +1 -0
  301. package/client-dist/assets/useSourceControlCleanLanding-BSY1vDSq.js +1 -0
  302. package/client-dist/assets/useStableToolPreviewRendering-BQc8-VNa.css +1 -0
  303. package/client-dist/assets/useStableToolPreviewRendering-RDapEGRz.js +9 -0
  304. package/client-dist/assets/useStreamingEnabled-CiYhaw0s.js +59 -0
  305. package/client-dist/assets/useStreamingEnabled-DkWnufW2.css +1 -0
  306. package/client-dist/assets/useWiderConversationActivityPreviews-D-57jNSG.js +1 -0
  307. package/client-dist/assets/zh-CN-D56LyPRG.js +7 -0
  308. package/client-dist/badge.svg +1 -0
  309. package/client-dist/debug-streaming.html +2 -2
  310. package/client-dist/icon.svg +1 -0
  311. package/client-dist/index.html +10 -4
  312. package/client-dist/manifest.json +13 -0
  313. package/client-dist/sw.js +245 -61
  314. package/dist/app.d.ts +51 -2
  315. package/dist/app.d.ts.map +1 -1
  316. package/dist/app.js +685 -142
  317. package/dist/app.js.map +1 -1
  318. package/dist/augments/augment-generator.d.ts +1 -1
  319. package/dist/augments/augment-generator.js +2 -2
  320. package/dist/augments/augment-generator.js.map +1 -1
  321. package/dist/augments/edit-augments.d.ts +21 -1
  322. package/dist/augments/edit-augments.d.ts.map +1 -1
  323. package/dist/augments/edit-augments.js +222 -32
  324. package/dist/augments/edit-augments.js.map +1 -1
  325. package/dist/augments/edit-raw-patch.d.ts +6 -0
  326. package/dist/augments/edit-raw-patch.d.ts.map +1 -1
  327. package/dist/augments/edit-raw-patch.js +29 -1
  328. package/dist/augments/edit-raw-patch.js.map +1 -1
  329. package/dist/augments/finalized-message-augmenter.d.ts +18 -0
  330. package/dist/augments/finalized-message-augmenter.d.ts.map +1 -0
  331. package/dist/augments/finalized-message-augmenter.js +306 -0
  332. package/dist/augments/finalized-message-augmenter.js.map +1 -0
  333. package/dist/augments/index.d.ts +1 -1
  334. package/dist/augments/index.d.ts.map +1 -1
  335. package/dist/augments/index.js +1 -1
  336. package/dist/augments/index.js.map +1 -1
  337. package/dist/augments/markdown-augments.d.ts +6 -9
  338. package/dist/augments/markdown-augments.d.ts.map +1 -1
  339. package/dist/augments/markdown-augments.js +145 -4
  340. package/dist/augments/markdown-augments.js.map +1 -1
  341. package/dist/augments/markdown-file-preview.d.ts +16 -0
  342. package/dist/augments/markdown-file-preview.d.ts.map +1 -0
  343. package/dist/augments/markdown-file-preview.js +122 -0
  344. package/dist/augments/markdown-file-preview.js.map +1 -0
  345. package/dist/augments/message-utils.d.ts +0 -5
  346. package/dist/augments/message-utils.d.ts.map +1 -1
  347. package/dist/augments/message-utils.js +0 -20
  348. package/dist/augments/message-utils.js.map +1 -1
  349. package/dist/augments/project-path-links.d.ts +47 -0
  350. package/dist/augments/project-path-links.d.ts.map +1 -0
  351. package/dist/augments/project-path-links.js +478 -0
  352. package/dist/augments/project-path-links.js.map +1 -0
  353. package/dist/augments/read-augments.d.ts +1 -1
  354. package/dist/augments/read-augments.d.ts.map +1 -1
  355. package/dist/augments/read-augments.js +8 -4
  356. package/dist/augments/read-augments.js.map +1 -1
  357. package/dist/augments/safe-markdown.d.ts +39 -1
  358. package/dist/augments/safe-markdown.d.ts.map +1 -1
  359. package/dist/augments/safe-markdown.js +592 -158
  360. package/dist/augments/safe-markdown.js.map +1 -1
  361. package/dist/augments/stream-augmenter.d.ts +13 -3
  362. package/dist/augments/stream-augmenter.d.ts.map +1 -1
  363. package/dist/augments/stream-augmenter.js +39 -241
  364. package/dist/augments/stream-augmenter.js.map +1 -1
  365. package/dist/augments/task-list-augments.d.ts +8 -0
  366. package/dist/augments/task-list-augments.d.ts.map +1 -1
  367. package/dist/augments/task-list-augments.js +44 -2
  368. package/dist/augments/task-list-augments.js.map +1 -1
  369. package/dist/augments/write-augments.d.ts +1 -1
  370. package/dist/augments/write-augments.d.ts.map +1 -1
  371. package/dist/augments/write-augments.js +7 -4
  372. package/dist/augments/write-augments.js.map +1 -1
  373. package/dist/auth/AuthService.d.ts +5 -7
  374. package/dist/auth/AuthService.d.ts.map +1 -1
  375. package/dist/auth/AuthService.js +35 -25
  376. package/dist/auth/AuthService.js.map +1 -1
  377. package/dist/auth/routes.d.ts +5 -0
  378. package/dist/auth/routes.d.ts.map +1 -1
  379. package/dist/auth/routes.js +26 -3
  380. package/dist/auth/routes.js.map +1 -1
  381. package/dist/cli.js +211 -0
  382. package/dist/cli.js.map +1 -1
  383. package/dist/codex/normalization.d.ts +2 -0
  384. package/dist/codex/normalization.d.ts.map +1 -1
  385. package/dist/codex/normalization.js +76 -84
  386. package/dist/codex/normalization.js.map +1 -1
  387. package/dist/codex/subagentActivity.d.ts +3 -0
  388. package/dist/codex/subagentActivity.d.ts.map +1 -0
  389. package/dist/codex/subagentActivity.js +15 -0
  390. package/dist/codex/subagentActivity.js.map +1 -0
  391. package/dist/codex/webRun.d.ts.map +1 -1
  392. package/dist/codex/webRun.js +1 -3
  393. package/dist/codex/webRun.js.map +1 -1
  394. package/dist/config.d.ts +10 -0
  395. package/dist/config.d.ts.map +1 -1
  396. package/dist/config.js +37 -2
  397. package/dist/config.js.map +1 -1
  398. package/dist/crypto/index.d.ts +1 -1
  399. package/dist/crypto/index.d.ts.map +1 -1
  400. package/dist/crypto/index.js +1 -1
  401. package/dist/crypto/index.js.map +1 -1
  402. package/dist/crypto/nacl-wrapper.d.ts +2 -0
  403. package/dist/crypto/nacl-wrapper.d.ts.map +1 -1
  404. package/dist/crypto/nacl-wrapper.js +10 -19
  405. package/dist/crypto/nacl-wrapper.js.map +1 -1
  406. package/dist/crypto/srp-server.js +2 -2
  407. package/dist/defaults.d.ts.map +1 -1
  408. package/dist/defaults.js +1 -1
  409. package/dist/defaults.js.map +1 -1
  410. package/dist/desktop/DesktopBootstrapService.d.ts +43 -0
  411. package/dist/desktop/DesktopBootstrapService.d.ts.map +1 -0
  412. package/dist/desktop/DesktopBootstrapService.js +126 -0
  413. package/dist/desktop/DesktopBootstrapService.js.map +1 -0
  414. package/dist/desktop/providerDetection.d.ts +15 -0
  415. package/dist/desktop/providerDetection.d.ts.map +1 -0
  416. package/dist/desktop/providerDetection.js +54 -0
  417. package/dist/desktop/providerDetection.js.map +1 -0
  418. package/dist/desktop/startup.d.ts +3 -0
  419. package/dist/desktop/startup.d.ts.map +1 -0
  420. package/dist/desktop/startup.js +52 -0
  421. package/dist/desktop/startup.js.map +1 -0
  422. package/dist/dev-wrapper-client.d.ts +14 -0
  423. package/dist/dev-wrapper-client.d.ts.map +1 -0
  424. package/dist/dev-wrapper-client.js +87 -0
  425. package/dist/dev-wrapper-client.js.map +1 -0
  426. package/dist/envSettings.d.ts +5 -4
  427. package/dist/envSettings.d.ts.map +1 -1
  428. package/dist/envSettings.js +41 -7
  429. package/dist/envSettings.js.map +1 -1
  430. package/dist/frontend/static.d.ts +2 -0
  431. package/dist/frontend/static.d.ts.map +1 -1
  432. package/dist/frontend/static.js +25 -13
  433. package/dist/frontend/static.js.map +1 -1
  434. package/dist/git/authorPalette.d.ts +15 -0
  435. package/dist/git/authorPalette.d.ts.map +1 -0
  436. package/dist/git/authorPalette.js +222 -0
  437. package/dist/git/authorPalette.js.map +1 -0
  438. package/dist/git/authorPalette.test.d.ts +2 -0
  439. package/dist/git/authorPalette.test.d.ts.map +1 -0
  440. package/dist/git/authorPalette.test.js +127 -0
  441. package/dist/git/authorPalette.test.js.map +1 -0
  442. package/dist/git/binaryDiff.d.ts +10 -0
  443. package/dist/git/binaryDiff.d.ts.map +1 -0
  444. package/dist/git/binaryDiff.js +33 -0
  445. package/dist/git/binaryDiff.js.map +1 -0
  446. package/dist/git/blame.d.ts +14 -0
  447. package/dist/git/blame.d.ts.map +1 -0
  448. package/dist/git/blame.js +276 -0
  449. package/dist/git/blame.js.map +1 -0
  450. package/dist/git/diffPreviewGuards.d.ts +52 -0
  451. package/dist/git/diffPreviewGuards.d.ts.map +1 -0
  452. package/dist/git/diffPreviewGuards.js +116 -0
  453. package/dist/git/diffPreviewGuards.js.map +1 -0
  454. package/dist/git/diffResult.d.ts +32 -0
  455. package/dist/git/diffResult.d.ts.map +1 -0
  456. package/dist/git/diffResult.js +89 -0
  457. package/dist/git/diffResult.js.map +1 -0
  458. package/dist/git/fileChanges.d.ts +13 -0
  459. package/dist/git/fileChanges.d.ts.map +1 -0
  460. package/dist/git/fileChanges.js +95 -0
  461. package/dist/git/fileChanges.js.map +1 -0
  462. package/dist/git/gitExec.d.ts +42 -0
  463. package/dist/git/gitExec.d.ts.map +1 -0
  464. package/dist/git/gitExec.js +53 -0
  465. package/dist/git/gitExec.js.map +1 -0
  466. package/dist/highlighting/index.d.ts +17 -0
  467. package/dist/highlighting/index.d.ts.map +1 -1
  468. package/dist/highlighting/index.js +130 -9
  469. package/dist/highlighting/index.js.map +1 -1
  470. package/dist/highlighting/index.test.d.ts +2 -0
  471. package/dist/highlighting/index.test.d.ts.map +1 -0
  472. package/dist/highlighting/index.test.js +57 -0
  473. package/dist/highlighting/index.test.js.map +1 -0
  474. package/dist/index.js +358 -43
  475. package/dist/index.js.map +1 -1
  476. package/dist/indexes/SessionDiscoveryIndex.d.ts +11 -0
  477. package/dist/indexes/SessionDiscoveryIndex.d.ts.map +1 -1
  478. package/dist/indexes/SessionDiscoveryIndex.js +43 -11
  479. package/dist/indexes/SessionDiscoveryIndex.js.map +1 -1
  480. package/dist/indexes/SessionIndexService.d.ts +15 -3
  481. package/dist/indexes/SessionIndexService.d.ts.map +1 -1
  482. package/dist/indexes/SessionIndexService.js +84 -26
  483. package/dist/indexes/SessionIndexService.js.map +1 -1
  484. package/dist/indexes/index.d.ts +1 -1
  485. package/dist/indexes/index.d.ts.map +1 -1
  486. package/dist/indexes/index.js +1 -1
  487. package/dist/indexes/index.js.map +1 -1
  488. package/dist/lib/coalescingSaver.d.ts +32 -0
  489. package/dist/lib/coalescingSaver.d.ts.map +1 -0
  490. package/dist/lib/coalescingSaver.js +68 -0
  491. package/dist/lib/coalescingSaver.js.map +1 -0
  492. package/dist/lib/lruCollections.d.ts +14 -0
  493. package/dist/lib/lruCollections.d.ts.map +1 -0
  494. package/dist/lib/lruCollections.js +21 -0
  495. package/dist/lib/lruCollections.js.map +1 -0
  496. package/dist/lib/sourceVersionedSingleFlight.d.ts +90 -0
  497. package/dist/lib/sourceVersionedSingleFlight.d.ts.map +1 -0
  498. package/dist/lib/sourceVersionedSingleFlight.js +256 -0
  499. package/dist/lib/sourceVersionedSingleFlight.js.map +1 -0
  500. package/dist/logging/logger.d.ts.map +1 -1
  501. package/dist/logging/logger.js +23 -20
  502. package/dist/logging/logger.js.map +1 -1
  503. package/dist/maintenance/server.d.ts +2 -0
  504. package/dist/maintenance/server.d.ts.map +1 -1
  505. package/dist/maintenance/server.js +51 -8
  506. package/dist/maintenance/server.js.map +1 -1
  507. package/dist/media/ToolResultMediaMessageMaterializer.d.ts +11 -0
  508. package/dist/media/ToolResultMediaMessageMaterializer.d.ts.map +1 -0
  509. package/dist/media/ToolResultMediaMessageMaterializer.js +155 -0
  510. package/dist/media/ToolResultMediaMessageMaterializer.js.map +1 -0
  511. package/dist/media/ToolResultMediaStore.d.ts +64 -0
  512. package/dist/media/ToolResultMediaStore.d.ts.map +1 -0
  513. package/dist/media/ToolResultMediaStore.js +624 -0
  514. package/dist/media/ToolResultMediaStore.js.map +1 -0
  515. package/dist/media/inlineImageData.d.ts +24 -0
  516. package/dist/media/inlineImageData.d.ts.map +1 -0
  517. package/dist/media/inlineImageData.js +159 -0
  518. package/dist/media/inlineImageData.js.map +1 -0
  519. package/dist/metadata/ProjectCodeNameRegistry.d.ts +26 -0
  520. package/dist/metadata/ProjectCodeNameRegistry.d.ts.map +1 -0
  521. package/dist/metadata/ProjectCodeNameRegistry.js +156 -0
  522. package/dist/metadata/ProjectCodeNameRegistry.js.map +1 -0
  523. package/dist/metadata/ProjectMetadataService.d.ts +29 -6
  524. package/dist/metadata/ProjectMetadataService.d.ts.map +1 -1
  525. package/dist/metadata/ProjectMetadataService.js +205 -23
  526. package/dist/metadata/ProjectMetadataService.js.map +1 -1
  527. package/dist/metadata/SessionMetadataService.d.ts +96 -10
  528. package/dist/metadata/SessionMetadataService.d.ts.map +1 -1
  529. package/dist/metadata/SessionMetadataService.js +249 -35
  530. package/dist/metadata/SessionMetadataService.js.map +1 -1
  531. package/dist/metadata/index.d.ts +2 -2
  532. package/dist/metadata/index.d.ts.map +1 -1
  533. package/dist/metadata/index.js.map +1 -1
  534. package/dist/middleware/auth.d.ts +3 -0
  535. package/dist/middleware/auth.d.ts.map +1 -1
  536. package/dist/middleware/auth.js +15 -6
  537. package/dist/middleware/auth.js.map +1 -1
  538. package/dist/middleware/authenticated-transport.d.ts +21 -0
  539. package/dist/middleware/authenticated-transport.d.ts.map +1 -0
  540. package/dist/middleware/authenticated-transport.js +12 -0
  541. package/dist/middleware/authenticated-transport.js.map +1 -0
  542. package/dist/middleware/error-handler.d.ts +14 -0
  543. package/dist/middleware/error-handler.d.ts.map +1 -0
  544. package/dist/middleware/error-handler.js +40 -0
  545. package/dist/middleware/error-handler.js.map +1 -0
  546. package/dist/middleware/file-access.d.ts +5 -0
  547. package/dist/middleware/file-access.d.ts.map +1 -1
  548. package/dist/middleware/file-access.js +5 -2
  549. package/dist/middleware/file-access.js.map +1 -1
  550. package/dist/notifications/NotificationService.d.ts.map +1 -1
  551. package/dist/notifications/NotificationService.js +2 -1
  552. package/dist/notifications/NotificationService.js.map +1 -1
  553. package/dist/projects/codex-scanner.d.ts +1 -0
  554. package/dist/projects/codex-scanner.d.ts.map +1 -1
  555. package/dist/projects/codex-scanner.js +5 -2
  556. package/dist/projects/codex-scanner.js.map +1 -1
  557. package/dist/projects/gemini-project-map.d.ts +7 -1
  558. package/dist/projects/gemini-project-map.d.ts.map +1 -1
  559. package/dist/projects/gemini-project-map.js +68 -27
  560. package/dist/projects/gemini-project-map.js.map +1 -1
  561. package/dist/projects/gemini-scanner.d.ts.map +1 -1
  562. package/dist/projects/gemini-scanner.js.map +1 -1
  563. package/dist/projects/glossaryIndexService.d.ts +77 -0
  564. package/dist/projects/glossaryIndexService.d.ts.map +1 -0
  565. package/dist/projects/glossaryIndexService.js +547 -0
  566. package/dist/projects/glossaryIndexService.js.map +1 -0
  567. package/dist/projects/managedProjectDir.d.ts +25 -0
  568. package/dist/projects/managedProjectDir.d.ts.map +1 -0
  569. package/dist/projects/managedProjectDir.js +77 -0
  570. package/dist/projects/managedProjectDir.js.map +1 -0
  571. package/dist/projects/paths.d.ts +2 -0
  572. package/dist/projects/paths.d.ts.map +1 -1
  573. package/dist/projects/paths.js +5 -0
  574. package/dist/projects/paths.js.map +1 -1
  575. package/dist/projects/projectGlossarySubscriptionManager.d.ts +87 -0
  576. package/dist/projects/projectGlossarySubscriptionManager.d.ts.map +1 -0
  577. package/dist/projects/projectGlossarySubscriptionManager.js +622 -0
  578. package/dist/projects/projectGlossarySubscriptionManager.js.map +1 -0
  579. package/dist/projects/projectPathIndex.d.ts +224 -0
  580. package/dist/projects/projectPathIndex.d.ts.map +1 -0
  581. package/dist/projects/projectPathIndex.js +1087 -0
  582. package/dist/projects/projectPathIndex.js.map +1 -0
  583. package/dist/projects/projectStoragePolicy.d.ts +41 -0
  584. package/dist/projects/projectStoragePolicy.d.ts.map +1 -0
  585. package/dist/projects/projectStoragePolicy.js +285 -0
  586. package/dist/projects/projectStoragePolicy.js.map +1 -0
  587. package/dist/projects/projectWorktreeCoverage.d.ts +14 -0
  588. package/dist/projects/projectWorktreeCoverage.d.ts.map +1 -0
  589. package/dist/projects/projectWorktreeCoverage.js +94 -0
  590. package/dist/projects/projectWorktreeCoverage.js.map +1 -0
  591. package/dist/projects/projectWorktreeProjection.d.ts +46 -0
  592. package/dist/projects/projectWorktreeProjection.d.ts.map +1 -0
  593. package/dist/projects/projectWorktreeProjection.js +275 -0
  594. package/dist/projects/projectWorktreeProjection.js.map +1 -0
  595. package/dist/projects/projectWorktreeScan.d.ts +23 -0
  596. package/dist/projects/projectWorktreeScan.d.ts.map +1 -0
  597. package/dist/projects/projectWorktreeScan.js +378 -0
  598. package/dist/projects/projectWorktreeScan.js.map +1 -0
  599. package/dist/projects/projectWorktreeSubscriptionManager.d.ts +131 -0
  600. package/dist/projects/projectWorktreeSubscriptionManager.d.ts.map +1 -0
  601. package/dist/projects/projectWorktreeSubscriptionManager.js +1314 -0
  602. package/dist/projects/projectWorktreeSubscriptionManager.js.map +1 -0
  603. package/dist/projects/scanner.d.ts +16 -2
  604. package/dist/projects/scanner.d.ts.map +1 -1
  605. package/dist/projects/scanner.js +85 -24
  606. package/dist/projects/scanner.js.map +1 -1
  607. package/dist/push/InactivityPushNotifier.d.ts +0 -5
  608. package/dist/push/InactivityPushNotifier.d.ts.map +1 -1
  609. package/dist/push/InactivityPushNotifier.js +2 -17
  610. package/dist/push/InactivityPushNotifier.js.map +1 -1
  611. package/dist/push/PushNotifier.d.ts +0 -4
  612. package/dist/push/PushNotifier.d.ts.map +1 -1
  613. package/dist/push/PushNotifier.js +2 -17
  614. package/dist/push/PushNotifier.js.map +1 -1
  615. package/dist/push/PushService.d.ts +2 -8
  616. package/dist/push/PushService.d.ts.map +1 -1
  617. package/dist/push/PushService.js +8 -22
  618. package/dist/push/PushService.js.map +1 -1
  619. package/dist/push/routes.d.ts.map +1 -1
  620. package/dist/push/routes.js +8 -0
  621. package/dist/push/routes.js.map +1 -1
  622. package/dist/recents/RecentsService.d.ts +1 -6
  623. package/dist/recents/RecentsService.d.ts.map +1 -1
  624. package/dist/recents/RecentsService.js +2 -20
  625. package/dist/recents/RecentsService.js.map +1 -1
  626. package/dist/remote-access/RemoteAccessService.d.ts +1 -6
  627. package/dist/remote-access/RemoteAccessService.d.ts.map +1 -1
  628. package/dist/remote-access/RemoteAccessService.js +2 -18
  629. package/dist/remote-access/RemoteAccessService.js.map +1 -1
  630. package/dist/remote-access/RemoteSessionService.d.ts +12 -7
  631. package/dist/remote-access/RemoteSessionService.d.ts.map +1 -1
  632. package/dist/remote-access/RemoteSessionService.js +65 -40
  633. package/dist/remote-access/RemoteSessionService.js.map +1 -1
  634. package/dist/review/ReviewCaptureService.d.ts +20 -0
  635. package/dist/review/ReviewCaptureService.d.ts.map +1 -0
  636. package/dist/review/ReviewCaptureService.js +441 -0
  637. package/dist/review/ReviewCaptureService.js.map +1 -0
  638. package/dist/review/ReviewCommentService.d.ts +171 -0
  639. package/dist/review/ReviewCommentService.d.ts.map +1 -0
  640. package/dist/review/ReviewCommentService.js +1240 -0
  641. package/dist/review/ReviewCommentService.js.map +1 -0
  642. package/dist/review/ReviewResponseObserver.d.ts +21 -0
  643. package/dist/review/ReviewResponseObserver.d.ts.map +1 -0
  644. package/dist/review/ReviewResponseObserver.js +29 -0
  645. package/dist/review/ReviewResponseObserver.js.map +1 -0
  646. package/dist/review/composeReviewTurn.d.ts +37 -0
  647. package/dist/review/composeReviewTurn.d.ts.map +1 -0
  648. package/dist/review/composeReviewTurn.js +128 -0
  649. package/dist/review/composeReviewTurn.js.map +1 -0
  650. package/dist/review/relocateAnchors.d.ts +41 -0
  651. package/dist/review/relocateAnchors.d.ts.map +1 -0
  652. package/dist/review/relocateAnchors.js +136 -0
  653. package/dist/review/relocateAnchors.js.map +1 -0
  654. package/dist/review/repositoryPath.d.ts +7 -0
  655. package/dist/review/repositoryPath.d.ts.map +1 -0
  656. package/dist/review/repositoryPath.js +54 -0
  657. package/dist/review/repositoryPath.js.map +1 -0
  658. package/dist/review/reviewSessionLauncher.d.ts +43 -0
  659. package/dist/review/reviewSessionLauncher.d.ts.map +1 -0
  660. package/dist/review/reviewSessionLauncher.js +143 -0
  661. package/dist/review/reviewSessionLauncher.js.map +1 -0
  662. package/dist/routes/bang-commands.d.ts +2 -1
  663. package/dist/routes/bang-commands.d.ts.map +1 -1
  664. package/dist/routes/bang-commands.js +35 -16
  665. package/dist/routes/bang-commands.js.map +1 -1
  666. package/dist/routes/browser-debug.d.ts +5 -0
  667. package/dist/routes/browser-debug.d.ts.map +1 -0
  668. package/dist/routes/browser-debug.js +182 -0
  669. package/dist/routes/browser-debug.js.map +1 -0
  670. package/dist/routes/desktop-bootstrap.d.ts +11 -0
  671. package/dist/routes/desktop-bootstrap.d.ts.map +1 -0
  672. package/dist/routes/desktop-bootstrap.js +84 -0
  673. package/dist/routes/desktop-bootstrap.js.map +1 -0
  674. package/dist/routes/files.d.ts +5 -0
  675. package/dist/routes/files.d.ts.map +1 -1
  676. package/dist/routes/files.js +318 -305
  677. package/dist/routes/files.js.map +1 -1
  678. package/dist/routes/git-browse.d.ts +21 -0
  679. package/dist/routes/git-browse.d.ts.map +1 -0
  680. package/dist/routes/git-browse.js +490 -0
  681. package/dist/routes/git-browse.js.map +1 -0
  682. package/dist/routes/git-file-projections.d.ts +21 -0
  683. package/dist/routes/git-file-projections.d.ts.map +1 -0
  684. package/dist/routes/git-file-projections.js +256 -0
  685. package/dist/routes/git-file-projections.js.map +1 -0
  686. package/dist/routes/git-file-revision.d.ts +10 -0
  687. package/dist/routes/git-file-revision.d.ts.map +1 -0
  688. package/dist/routes/git-file-revision.js +164 -0
  689. package/dist/routes/git-file-revision.js.map +1 -0
  690. package/dist/routes/git-inclusive-to-head.d.ts +5 -0
  691. package/dist/routes/git-inclusive-to-head.d.ts.map +1 -0
  692. package/dist/routes/git-inclusive-to-head.js +36 -0
  693. package/dist/routes/git-inclusive-to-head.js.map +1 -0
  694. package/dist/routes/git-incoming-commits.d.ts +13 -0
  695. package/dist/routes/git-incoming-commits.d.ts.map +1 -0
  696. package/dist/routes/git-incoming-commits.js +94 -0
  697. package/dist/routes/git-incoming-commits.js.map +1 -0
  698. package/dist/routes/git-projection-diff.d.ts +12 -0
  699. package/dist/routes/git-projection-diff.d.ts.map +1 -0
  700. package/dist/routes/git-projection-diff.js +158 -0
  701. package/dist/routes/git-projection-diff.js.map +1 -0
  702. package/dist/routes/git-projections.d.ts +5 -0
  703. package/dist/routes/git-projections.d.ts.map +1 -0
  704. package/dist/routes/git-projections.js +34 -0
  705. package/dist/routes/git-projections.js.map +1 -0
  706. package/dist/routes/git-status.d.ts +4 -0
  707. package/dist/routes/git-status.d.ts.map +1 -1
  708. package/dist/routes/git-status.js +267 -133
  709. package/dist/routes/git-status.js.map +1 -1
  710. package/dist/routes/git-working-tree-files.d.ts +22 -0
  711. package/dist/routes/git-working-tree-files.d.ts.map +1 -0
  712. package/dist/routes/git-working-tree-files.js +143 -0
  713. package/dist/routes/git-working-tree-files.js.map +1 -0
  714. package/dist/routes/global-sessions.d.ts +23 -2
  715. package/dist/routes/global-sessions.d.ts.map +1 -1
  716. package/dist/routes/global-sessions.js +129 -6
  717. package/dist/routes/global-sessions.js.map +1 -1
  718. package/dist/routes/glossary-artifacts.d.ts +9 -0
  719. package/dist/routes/glossary-artifacts.d.ts.map +1 -0
  720. package/dist/routes/glossary-artifacts.js +23 -0
  721. package/dist/routes/glossary-artifacts.js.map +1 -0
  722. package/dist/routes/host-agent-processes.d.ts +11 -0
  723. package/dist/routes/host-agent-processes.d.ts.map +1 -0
  724. package/dist/routes/host-agent-processes.js +44 -0
  725. package/dist/routes/host-agent-processes.js.map +1 -0
  726. package/dist/routes/inbox.d.ts +2 -0
  727. package/dist/routes/inbox.d.ts.map +1 -1
  728. package/dist/routes/inbox.js +60 -9
  729. package/dist/routes/inbox.js.map +1 -1
  730. package/dist/routes/limited-json-body.d.ts +7 -0
  731. package/dist/routes/limited-json-body.d.ts.map +1 -0
  732. package/dist/routes/limited-json-body.js +71 -0
  733. package/dist/routes/limited-json-body.js.map +1 -0
  734. package/dist/routes/local-file.d.ts +2 -0
  735. package/dist/routes/local-file.d.ts.map +1 -1
  736. package/dist/routes/local-file.js +225 -99
  737. package/dist/routes/local-file.js.map +1 -1
  738. package/dist/routes/local-image.d.ts +2 -0
  739. package/dist/routes/local-image.d.ts.map +1 -1
  740. package/dist/routes/local-image.js +34 -11
  741. package/dist/routes/local-image.js.map +1 -1
  742. package/dist/routes/local-resource-policy.d.ts +2 -0
  743. package/dist/routes/local-resource-policy.d.ts.map +1 -1
  744. package/dist/routes/local-resource-policy.js +0 -0
  745. package/dist/routes/local-resource-policy.js.map +1 -1
  746. package/dist/routes/mutable-file-cache.d.ts +28 -0
  747. package/dist/routes/mutable-file-cache.d.ts.map +1 -0
  748. package/dist/routes/mutable-file-cache.js +73 -0
  749. package/dist/routes/mutable-file-cache.js.map +1 -0
  750. package/dist/routes/onboarding.d.ts +1 -0
  751. package/dist/routes/onboarding.d.ts.map +1 -1
  752. package/dist/routes/onboarding.js +3 -0
  753. package/dist/routes/onboarding.js.map +1 -1
  754. package/dist/routes/processes.d.ts +1 -1
  755. package/dist/routes/processes.d.ts.map +1 -1
  756. package/dist/routes/processes.js +40 -11
  757. package/dist/routes/processes.js.map +1 -1
  758. package/dist/routes/project-queue-response.d.ts.map +1 -1
  759. package/dist/routes/project-queue-response.js +2 -1
  760. package/dist/routes/project-queue-response.js.map +1 -1
  761. package/dist/routes/project-session-defaults.d.ts +9 -0
  762. package/dist/routes/project-session-defaults.d.ts.map +1 -0
  763. package/dist/routes/project-session-defaults.js +104 -0
  764. package/dist/routes/project-session-defaults.js.map +1 -0
  765. package/dist/routes/projectParam.d.ts +9 -0
  766. package/dist/routes/projectParam.d.ts.map +1 -0
  767. package/dist/routes/projectParam.js +19 -0
  768. package/dist/routes/projectParam.js.map +1 -0
  769. package/dist/routes/projects.d.ts +4 -0
  770. package/dist/routes/projects.d.ts.map +1 -1
  771. package/dist/routes/projects.js +81 -2
  772. package/dist/routes/projects.js.map +1 -1
  773. package/dist/routes/provider-host.d.ts +12 -0
  774. package/dist/routes/provider-host.d.ts.map +1 -0
  775. package/dist/routes/provider-host.js +184 -0
  776. package/dist/routes/provider-host.js.map +1 -0
  777. package/dist/routes/providers.d.ts +10 -1
  778. package/dist/routes/providers.d.ts.map +1 -1
  779. package/dist/routes/providers.js +160 -50
  780. package/dist/routes/providers.js.map +1 -1
  781. package/dist/routes/public-file-shares.d.ts +18 -0
  782. package/dist/routes/public-file-shares.d.ts.map +1 -0
  783. package/dist/routes/public-file-shares.js +163 -0
  784. package/dist/routes/public-file-shares.js.map +1 -0
  785. package/dist/routes/public-share-json-stream.d.ts +5 -0
  786. package/dist/routes/public-share-json-stream.d.ts.map +1 -0
  787. package/dist/routes/public-share-json-stream.js +159 -0
  788. package/dist/routes/public-share-json-stream.js.map +1 -0
  789. package/dist/routes/public-share-management-freeze.d.ts +5 -0
  790. package/dist/routes/public-share-management-freeze.d.ts.map +1 -0
  791. package/dist/routes/public-share-management-freeze.js +89 -0
  792. package/dist/routes/public-share-management-freeze.js.map +1 -0
  793. package/dist/routes/public-share-management.d.ts +7 -0
  794. package/dist/routes/public-share-management.d.ts.map +1 -0
  795. package/dist/routes/public-share-management.js +136 -0
  796. package/dist/routes/public-share-management.js.map +1 -0
  797. package/dist/routes/public-shares.d.ts +15 -3
  798. package/dist/routes/public-shares.d.ts.map +1 -1
  799. package/dist/routes/public-shares.js +483 -143
  800. package/dist/routes/public-shares.js.map +1 -1
  801. package/dist/routes/review-comments.d.ts +27 -0
  802. package/dist/routes/review-comments.d.ts.map +1 -0
  803. package/dist/routes/review-comments.js +443 -0
  804. package/dist/routes/review-comments.js.map +1 -0
  805. package/dist/routes/review-inbox.d.ts +13 -0
  806. package/dist/routes/review-inbox.d.ts.map +1 -0
  807. package/dist/routes/review-inbox.js +102 -0
  808. package/dist/routes/review-inbox.js.map +1 -0
  809. package/dist/routes/review-submissions.d.ts +13 -0
  810. package/dist/routes/review-submissions.d.ts.map +1 -0
  811. package/dist/routes/review-submissions.js +248 -0
  812. package/dist/routes/review-submissions.js.map +1 -0
  813. package/dist/routes/security-clients.d.ts +4 -0
  814. package/dist/routes/security-clients.d.ts.map +1 -0
  815. package/dist/routes/security-clients.js +118 -0
  816. package/dist/routes/security-clients.js.map +1 -0
  817. package/dist/routes/server-admin.d.ts +2 -1
  818. package/dist/routes/server-admin.d.ts.map +1 -1
  819. package/dist/routes/server-admin.js +4 -1
  820. package/dist/routes/server-admin.js.map +1 -1
  821. package/dist/routes/server-info.d.ts +2 -1
  822. package/dist/routes/server-info.d.ts.map +1 -1
  823. package/dist/routes/server-info.js +2 -1
  824. package/dist/routes/server-info.js.map +1 -1
  825. package/dist/routes/session-archive.d.ts +13 -0
  826. package/dist/routes/session-archive.d.ts.map +1 -0
  827. package/dist/routes/session-archive.js +26 -0
  828. package/dist/routes/session-archive.js.map +1 -0
  829. package/dist/routes/session-claude-resume-guard.d.ts.map +1 -1
  830. package/dist/routes/session-claude-resume-guard.js +7 -4
  831. package/dist/routes/session-claude-resume-guard.js.map +1 -1
  832. package/dist/routes/session-done.d.ts +11 -0
  833. package/dist/routes/session-done.d.ts.map +1 -0
  834. package/dist/routes/session-done.js +20 -0
  835. package/dist/routes/session-done.js.map +1 -0
  836. package/dist/routes/session-existing-identity.d.ts +23 -0
  837. package/dist/routes/session-existing-identity.d.ts.map +1 -0
  838. package/dist/routes/session-existing-identity.js +73 -0
  839. package/dist/routes/session-existing-identity.js.map +1 -0
  840. package/dist/routes/session-index.d.ts.map +1 -1
  841. package/dist/routes/session-index.js.map +1 -1
  842. package/dist/routes/session-metadata-patch.d.ts +1 -0
  843. package/dist/routes/session-metadata-patch.d.ts.map +1 -1
  844. package/dist/routes/session-metadata-patch.js +9 -2
  845. package/dist/routes/session-metadata-patch.js.map +1 -1
  846. package/dist/routes/session-provider-resolution.d.ts +4 -2
  847. package/dist/routes/session-provider-resolution.d.ts.map +1 -1
  848. package/dist/routes/session-provider-resolution.js +3 -1
  849. package/dist/routes/session-provider-resolution.js.map +1 -1
  850. package/dist/routes/session-queue-summaries.d.ts +2 -0
  851. package/dist/routes/session-queue-summaries.d.ts.map +1 -1
  852. package/dist/routes/session-queue-summaries.js +24 -11
  853. package/dist/routes/session-queue-summaries.js.map +1 -1
  854. package/dist/routes/session-recovered-queue.d.ts +1 -1
  855. package/dist/routes/session-recovered-queue.d.ts.map +1 -1
  856. package/dist/routes/session-recovered-queue.js +1 -0
  857. package/dist/routes/session-recovered-queue.js.map +1 -1
  858. package/dist/routes/session-terminate.d.ts +13 -0
  859. package/dist/routes/session-terminate.d.ts.map +1 -0
  860. package/dist/routes/session-terminate.js +24 -0
  861. package/dist/routes/session-terminate.js.map +1 -0
  862. package/dist/routes/session-wake.d.ts +4 -0
  863. package/dist/routes/session-wake.d.ts.map +1 -0
  864. package/dist/routes/session-wake.js +54 -0
  865. package/dist/routes/session-wake.js.map +1 -0
  866. package/dist/routes/sessions.d.ts +11 -0
  867. package/dist/routes/sessions.d.ts.map +1 -1
  868. package/dist/routes/sessions.js +1521 -407
  869. package/dist/routes/sessions.js.map +1 -1
  870. package/dist/routes/settings-parsers.d.ts +3 -0
  871. package/dist/routes/settings-parsers.d.ts.map +1 -1
  872. package/dist/routes/settings-parsers.js +154 -12
  873. package/dist/routes/settings-parsers.js.map +1 -1
  874. package/dist/routes/settings.d.ts +16 -0
  875. package/dist/routes/settings.d.ts.map +1 -1
  876. package/dist/routes/settings.js +220 -24
  877. package/dist/routes/settings.js.map +1 -1
  878. package/dist/routes/tool-result-media.d.ts +10 -0
  879. package/dist/routes/tool-result-media.d.ts.map +1 -0
  880. package/dist/routes/tool-result-media.js +40 -0
  881. package/dist/routes/tool-result-media.js.map +1 -0
  882. package/dist/routes/untrusted-file-response.d.ts +18 -0
  883. package/dist/routes/untrusted-file-response.d.ts.map +1 -0
  884. package/dist/routes/untrusted-file-response.js +95 -0
  885. package/dist/routes/untrusted-file-response.js.map +1 -0
  886. package/dist/routes/upload.d.ts +2 -0
  887. package/dist/routes/upload.d.ts.map +1 -1
  888. package/dist/routes/upload.js +63 -31
  889. package/dist/routes/upload.js.map +1 -1
  890. package/dist/routes/version.d.ts +43 -3
  891. package/dist/routes/version.d.ts.map +1 -1
  892. package/dist/routes/version.js +114 -7
  893. package/dist/routes/version.js.map +1 -1
  894. package/dist/routes/workstreams.d.ts.map +1 -1
  895. package/dist/routes/workstreams.js.map +1 -1
  896. package/dist/routes/ws-message-router.d.ts +2 -1
  897. package/dist/routes/ws-message-router.d.ts.map +1 -1
  898. package/dist/routes/ws-message-router.js +12 -9
  899. package/dist/routes/ws-message-router.js.map +1 -1
  900. package/dist/routes/ws-relay-handlers.d.ts +95 -17
  901. package/dist/routes/ws-relay-handlers.d.ts.map +1 -1
  902. package/dist/routes/ws-relay-handlers.js +813 -72
  903. package/dist/routes/ws-relay-handlers.js.map +1 -1
  904. package/dist/routes/ws-relay.d.ts +24 -0
  905. package/dist/routes/ws-relay.d.ts.map +1 -1
  906. package/dist/routes/ws-relay.js +27 -6
  907. package/dist/routes/ws-relay.js.map +1 -1
  908. package/dist/routes/ws-srp-handlers.d.ts +2 -1
  909. package/dist/routes/ws-srp-handlers.d.ts.map +1 -1
  910. package/dist/routes/ws-srp-handlers.js +45 -2
  911. package/dist/routes/ws-srp-handlers.js.map +1 -1
  912. package/dist/routes/ws-transport-auth.d.ts +7 -0
  913. package/dist/routes/ws-transport-auth.d.ts.map +1 -1
  914. package/dist/routes/ws-transport-auth.js +7 -0
  915. package/dist/routes/ws-transport-auth.js.map +1 -1
  916. package/dist/routes/ws-transport-message-auth.d.ts.map +1 -1
  917. package/dist/routes/ws-transport-message-auth.js +54 -19
  918. package/dist/routes/ws-transport-message-auth.js.map +1 -1
  919. package/dist/sdk/cli-detection.d.ts +34 -4
  920. package/dist/sdk/cli-detection.d.ts.map +1 -1
  921. package/dist/sdk/cli-detection.js +134 -31
  922. package/dist/sdk/cli-detection.js.map +1 -1
  923. package/dist/sdk/messageQueue.d.ts +22 -1
  924. package/dist/sdk/messageQueue.d.ts.map +1 -1
  925. package/dist/sdk/messageQueue.js +63 -3
  926. package/dist/sdk/messageQueue.js.map +1 -1
  927. package/dist/sdk/mock.d.ts +24 -1
  928. package/dist/sdk/mock.d.ts.map +1 -1
  929. package/dist/sdk/mock.js +71 -0
  930. package/dist/sdk/mock.js.map +1 -1
  931. package/dist/sdk/providers/__mocks__/claude.d.ts +6 -0
  932. package/dist/sdk/providers/__mocks__/claude.d.ts.map +1 -1
  933. package/dist/sdk/providers/__mocks__/claude.js +9 -0
  934. package/dist/sdk/providers/__mocks__/claude.js.map +1 -1
  935. package/dist/sdk/providers/__mocks__/factory.d.ts.map +1 -1
  936. package/dist/sdk/providers/__mocks__/factory.js +5 -1
  937. package/dist/sdk/providers/__mocks__/factory.js.map +1 -1
  938. package/dist/sdk/providers/__mocks__/index.d.ts +1 -1
  939. package/dist/sdk/providers/__mocks__/index.d.ts.map +1 -1
  940. package/dist/sdk/providers/__mocks__/index.js +1 -1
  941. package/dist/sdk/providers/__mocks__/index.js.map +1 -1
  942. package/dist/sdk/providers/acp/client.d.ts +12 -3
  943. package/dist/sdk/providers/acp/client.d.ts.map +1 -1
  944. package/dist/sdk/providers/acp/client.js +24 -6
  945. package/dist/sdk/providers/acp/client.js.map +1 -1
  946. package/dist/sdk/providers/agentctl-session-env.d.ts +3 -2
  947. package/dist/sdk/providers/agentctl-session-env.d.ts.map +1 -1
  948. package/dist/sdk/providers/agentctl-session-env.js +35 -9
  949. package/dist/sdk/providers/agentctl-session-env.js.map +1 -1
  950. package/dist/sdk/providers/claude-gateway-launcher.d.ts +74 -0
  951. package/dist/sdk/providers/claude-gateway-launcher.d.ts.map +1 -0
  952. package/dist/sdk/providers/claude-gateway-launcher.js +338 -0
  953. package/dist/sdk/providers/claude-gateway-launcher.js.map +1 -0
  954. package/dist/sdk/providers/claude-gateway.d.ts +67 -0
  955. package/dist/sdk/providers/claude-gateway.d.ts.map +1 -0
  956. package/dist/sdk/providers/claude-gateway.js +354 -0
  957. package/dist/sdk/providers/claude-gateway.js.map +1 -0
  958. package/dist/sdk/providers/claude-ollama.d.ts +3 -1
  959. package/dist/sdk/providers/claude-ollama.d.ts.map +1 -1
  960. package/dist/sdk/providers/claude-ollama.js +7 -4
  961. package/dist/sdk/providers/claude-ollama.js.map +1 -1
  962. package/dist/sdk/providers/claude-retention.d.ts +2 -0
  963. package/dist/sdk/providers/claude-retention.d.ts.map +1 -1
  964. package/dist/sdk/providers/claude-retention.js +55 -2
  965. package/dist/sdk/providers/claude-retention.js.map +1 -1
  966. package/dist/sdk/providers/claude-steer-background.d.ts +30 -0
  967. package/dist/sdk/providers/claude-steer-background.d.ts.map +1 -0
  968. package/dist/sdk/providers/claude-steer-background.js +102 -0
  969. package/dist/sdk/providers/claude-steer-background.js.map +1 -0
  970. package/dist/sdk/providers/claude.d.ts +48 -8
  971. package/dist/sdk/providers/claude.d.ts.map +1 -1
  972. package/dist/sdk/providers/claude.js +470 -104
  973. package/dist/sdk/providers/claude.js.map +1 -1
  974. package/dist/sdk/providers/codex-account-commands.d.ts +24 -0
  975. package/dist/sdk/providers/codex-account-commands.d.ts.map +1 -0
  976. package/dist/sdk/providers/codex-account-commands.js +261 -0
  977. package/dist/sdk/providers/codex-account-commands.js.map +1 -0
  978. package/dist/sdk/providers/codex-model-catalog.d.ts.map +1 -1
  979. package/dist/sdk/providers/codex-model-catalog.js +5 -2
  980. package/dist/sdk/providers/codex-model-catalog.js.map +1 -1
  981. package/dist/sdk/providers/codex-notification-guards.d.ts +16 -1
  982. package/dist/sdk/providers/codex-notification-guards.d.ts.map +1 -1
  983. package/dist/sdk/providers/codex-notification-guards.js +50 -0
  984. package/dist/sdk/providers/codex-notification-guards.js.map +1 -1
  985. package/dist/sdk/providers/codex-oss.d.ts +5 -0
  986. package/dist/sdk/providers/codex-oss.d.ts.map +1 -1
  987. package/dist/sdk/providers/codex-oss.js +25 -3
  988. package/dist/sdk/providers/codex-oss.js.map +1 -1
  989. package/dist/sdk/providers/codex-protocol/generated/ImageGenerationFailure.d.ts +6 -0
  990. package/dist/sdk/providers/codex-protocol/generated/ImageGenerationFailure.d.ts.map +1 -0
  991. package/dist/sdk/providers/codex-protocol/generated/ImageGenerationFailure.js +3 -0
  992. package/dist/sdk/providers/codex-protocol/generated/ImageGenerationFailure.js.map +1 -0
  993. package/dist/sdk/providers/codex-protocol/generated/ImageGenerationItem.d.ts +3 -0
  994. package/dist/sdk/providers/codex-protocol/generated/ImageGenerationItem.d.ts.map +1 -1
  995. package/dist/sdk/providers/codex-protocol/generated/ResponseItem.d.ts +4 -1
  996. package/dist/sdk/providers/codex-protocol/generated/ResponseItem.d.ts.map +1 -1
  997. package/dist/sdk/providers/codex-protocol/generated/v2/AgentMessageDelivery.d.ts +2 -0
  998. package/dist/sdk/providers/codex-protocol/generated/v2/AgentMessageDelivery.d.ts.map +1 -0
  999. package/dist/sdk/providers/codex-protocol/generated/v2/AgentMessageDelivery.js +3 -0
  1000. package/dist/sdk/providers/codex-protocol/generated/v2/AgentMessageDelivery.js.map +1 -0
  1001. package/dist/sdk/providers/codex-protocol/generated/v2/CodexErrorInfo.d.ts +1 -1
  1002. package/dist/sdk/providers/codex-protocol/generated/v2/CodexErrorInfo.d.ts.map +1 -1
  1003. package/dist/sdk/providers/codex-protocol/generated/v2/CollabAgentTool.d.ts +1 -1
  1004. package/dist/sdk/providers/codex-protocol/generated/v2/CollabAgentTool.d.ts.map +1 -1
  1005. package/dist/sdk/providers/codex-protocol/generated/v2/CollabAgentToolCallStatus.d.ts +1 -1
  1006. package/dist/sdk/providers/codex-protocol/generated/v2/CollabAgentToolCallStatus.d.ts.map +1 -1
  1007. package/dist/sdk/providers/codex-protocol/generated/v2/CommandAction.d.ts +2 -2
  1008. package/dist/sdk/providers/codex-protocol/generated/v2/CommandAction.d.ts.map +1 -1
  1009. package/dist/sdk/providers/codex-protocol/generated/v2/CommandExecutionApprovalKind.d.ts +5 -0
  1010. package/dist/sdk/providers/codex-protocol/generated/v2/CommandExecutionApprovalKind.d.ts.map +1 -0
  1011. package/dist/sdk/providers/codex-protocol/generated/v2/CommandExecutionApprovalKind.js +3 -0
  1012. package/dist/sdk/providers/codex-protocol/generated/v2/CommandExecutionApprovalKind.js.map +1 -0
  1013. package/dist/sdk/providers/codex-protocol/generated/v2/CommandExecutionRequestApprovalParams.d.ts +6 -0
  1014. package/dist/sdk/providers/codex-protocol/generated/v2/CommandExecutionRequestApprovalParams.d.ts.map +1 -1
  1015. package/dist/sdk/providers/codex-protocol/generated/v2/CyberAccessProgram.d.ts +6 -0
  1016. package/dist/sdk/providers/codex-protocol/generated/v2/CyberAccessProgram.d.ts.map +1 -0
  1017. package/dist/sdk/providers/codex-protocol/generated/v2/CyberAccessProgram.js +3 -0
  1018. package/dist/sdk/providers/codex-protocol/generated/v2/CyberAccessProgram.js.map +1 -0
  1019. package/dist/sdk/providers/codex-protocol/generated/v2/MisalignmentErrorDetails.d.ts +16 -0
  1020. package/dist/sdk/providers/codex-protocol/generated/v2/MisalignmentErrorDetails.d.ts.map +1 -0
  1021. package/dist/sdk/providers/codex-protocol/generated/v2/MisalignmentErrorDetails.js +3 -0
  1022. package/dist/sdk/providers/codex-protocol/generated/v2/MisalignmentErrorDetails.js.map +1 -0
  1023. package/dist/sdk/providers/codex-protocol/generated/v2/MisalignmentSteer.d.ts +4 -0
  1024. package/dist/sdk/providers/codex-protocol/generated/v2/MisalignmentSteer.d.ts.map +1 -0
  1025. package/dist/sdk/providers/codex-protocol/generated/v2/MisalignmentSteer.js +3 -0
  1026. package/dist/sdk/providers/codex-protocol/generated/v2/MisalignmentSteer.js.map +1 -0
  1027. package/dist/sdk/providers/codex-protocol/generated/v2/SkillDependencies.d.ts +5 -0
  1028. package/dist/sdk/providers/codex-protocol/generated/v2/SkillDependencies.d.ts.map +1 -0
  1029. package/dist/sdk/providers/codex-protocol/generated/v2/SkillDependencies.js +3 -0
  1030. package/dist/sdk/providers/codex-protocol/generated/v2/SkillDependencies.js.map +1 -0
  1031. package/dist/sdk/providers/codex-protocol/generated/v2/SkillErrorInfo.d.ts +5 -0
  1032. package/dist/sdk/providers/codex-protocol/generated/v2/SkillErrorInfo.d.ts.map +1 -0
  1033. package/dist/sdk/providers/codex-protocol/generated/v2/SkillErrorInfo.js +3 -0
  1034. package/dist/sdk/providers/codex-protocol/generated/v2/SkillErrorInfo.js.map +1 -0
  1035. package/dist/sdk/providers/codex-protocol/generated/v2/SkillInterface.d.ts +18 -0
  1036. package/dist/sdk/providers/codex-protocol/generated/v2/SkillInterface.d.ts.map +1 -0
  1037. package/dist/sdk/providers/codex-protocol/generated/v2/SkillInterface.js +3 -0
  1038. package/dist/sdk/providers/codex-protocol/generated/v2/SkillInterface.js.map +1 -0
  1039. package/dist/sdk/providers/codex-protocol/generated/v2/SkillMetadata.d.ts +22 -0
  1040. package/dist/sdk/providers/codex-protocol/generated/v2/SkillMetadata.d.ts.map +1 -0
  1041. package/dist/sdk/providers/codex-protocol/generated/v2/SkillMetadata.js +3 -0
  1042. package/dist/sdk/providers/codex-protocol/generated/v2/SkillMetadata.js.map +1 -0
  1043. package/dist/sdk/providers/codex-protocol/generated/v2/SkillScope.d.ts +2 -0
  1044. package/dist/sdk/providers/codex-protocol/generated/v2/SkillScope.d.ts.map +1 -0
  1045. package/dist/sdk/providers/codex-protocol/generated/v2/SkillScope.js +3 -0
  1046. package/dist/sdk/providers/codex-protocol/generated/v2/SkillScope.js.map +1 -0
  1047. package/dist/sdk/providers/codex-protocol/generated/v2/SkillToolDependency.d.ts +9 -0
  1048. package/dist/sdk/providers/codex-protocol/generated/v2/SkillToolDependency.d.ts.map +1 -0
  1049. package/dist/sdk/providers/codex-protocol/generated/v2/SkillToolDependency.js +3 -0
  1050. package/dist/sdk/providers/codex-protocol/generated/v2/SkillToolDependency.js.map +1 -0
  1051. package/dist/sdk/providers/codex-protocol/generated/v2/SkillsListEntry.d.ts +8 -0
  1052. package/dist/sdk/providers/codex-protocol/generated/v2/SkillsListEntry.d.ts.map +1 -0
  1053. package/dist/sdk/providers/codex-protocol/generated/v2/SkillsListEntry.js +3 -0
  1054. package/dist/sdk/providers/codex-protocol/generated/v2/SkillsListEntry.js.map +1 -0
  1055. package/dist/sdk/providers/codex-protocol/generated/v2/SkillsListParams.d.ts +11 -0
  1056. package/dist/sdk/providers/codex-protocol/generated/v2/SkillsListParams.d.ts.map +1 -0
  1057. package/dist/sdk/providers/codex-protocol/generated/v2/SkillsListParams.js +3 -0
  1058. package/dist/sdk/providers/codex-protocol/generated/v2/SkillsListParams.js.map +1 -0
  1059. package/dist/sdk/providers/codex-protocol/generated/v2/SkillsListResponse.d.ts +5 -0
  1060. package/dist/sdk/providers/codex-protocol/generated/v2/SkillsListResponse.d.ts.map +1 -0
  1061. package/dist/sdk/providers/codex-protocol/generated/v2/SkillsListResponse.js +3 -0
  1062. package/dist/sdk/providers/codex-protocol/generated/v2/SkillsListResponse.js.map +1 -0
  1063. package/dist/sdk/providers/codex-protocol/generated/v2/SubAgentActivityKind.d.ts +1 -1
  1064. package/dist/sdk/providers/codex-protocol/generated/v2/SubAgentActivityKind.d.ts.map +1 -1
  1065. package/dist/sdk/providers/codex-protocol/generated/v2/Thread.d.ts +13 -0
  1066. package/dist/sdk/providers/codex-protocol/generated/v2/Thread.d.ts.map +1 -1
  1067. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkParams.d.ts +3 -1
  1068. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkParams.d.ts.map +1 -1
  1069. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadItem.d.ts +18 -0
  1070. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadItem.d.ts.map +1 -1
  1071. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadReadParams.d.ts +3 -0
  1072. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadReadParams.d.ts.map +1 -1
  1073. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeParams.d.ts +3 -1
  1074. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeParams.d.ts.map +1 -1
  1075. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeResponse.d.ts +4 -4
  1076. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadSection.d.ts +19 -0
  1077. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadSection.d.ts.map +1 -0
  1078. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadSection.js +3 -0
  1079. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadSection.js.map +1 -0
  1080. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadSectionAppearance.d.ts +8 -0
  1081. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadSectionAppearance.d.ts.map +1 -0
  1082. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadSectionAppearance.js +3 -0
  1083. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadSectionAppearance.js.map +1 -0
  1084. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadStartParams.d.ts +5 -0
  1085. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadStartParams.d.ts.map +1 -1
  1086. package/dist/sdk/providers/codex-protocol/generated/v2/ToolRequestUserInputParams.d.ts +4 -0
  1087. package/dist/sdk/providers/codex-protocol/generated/v2/ToolRequestUserInputParams.d.ts.map +1 -1
  1088. package/dist/sdk/providers/codex-protocol/generated/v2/TurnError.d.ts +5 -0
  1089. package/dist/sdk/providers/codex-protocol/generated/v2/TurnError.d.ts.map +1 -1
  1090. package/dist/sdk/providers/codex-protocol/generated/v2/TurnPlanStep.d.ts +6 -0
  1091. package/dist/sdk/providers/codex-protocol/generated/v2/TurnPlanStep.d.ts.map +1 -0
  1092. package/dist/sdk/providers/codex-protocol/generated/v2/TurnPlanStep.js +3 -0
  1093. package/dist/sdk/providers/codex-protocol/generated/v2/TurnPlanStep.js.map +1 -0
  1094. package/dist/sdk/providers/codex-protocol/generated/v2/TurnPlanStepStatus.d.ts +2 -0
  1095. package/dist/sdk/providers/codex-protocol/generated/v2/TurnPlanStepStatus.d.ts.map +1 -0
  1096. package/dist/sdk/providers/codex-protocol/generated/v2/TurnPlanStepStatus.js +3 -0
  1097. package/dist/sdk/providers/codex-protocol/generated/v2/TurnPlanStepStatus.js.map +1 -0
  1098. package/dist/sdk/providers/codex-protocol/generated/v2/TurnPlanUpdatedNotification.d.ts +8 -0
  1099. package/dist/sdk/providers/codex-protocol/generated/v2/TurnPlanUpdatedNotification.d.ts.map +1 -0
  1100. package/dist/sdk/providers/codex-protocol/generated/v2/TurnPlanUpdatedNotification.js +3 -0
  1101. package/dist/sdk/providers/codex-protocol/generated/v2/TurnPlanUpdatedNotification.js.map +1 -0
  1102. package/dist/sdk/providers/codex-protocol/generated/v2/TurnSettingsUpdateParams.d.ts +29 -0
  1103. package/dist/sdk/providers/codex-protocol/generated/v2/TurnSettingsUpdateParams.d.ts.map +1 -0
  1104. package/dist/sdk/providers/codex-protocol/generated/v2/TurnSettingsUpdateParams.js +3 -0
  1105. package/dist/sdk/providers/codex-protocol/generated/v2/TurnSettingsUpdateParams.js.map +1 -0
  1106. package/dist/sdk/providers/codex-protocol/generated/v2/TurnSettingsUpdateResponse.d.ts +5 -0
  1107. package/dist/sdk/providers/codex-protocol/generated/v2/TurnSettingsUpdateResponse.d.ts.map +1 -0
  1108. package/dist/sdk/providers/codex-protocol/generated/v2/TurnSettingsUpdateResponse.js +3 -0
  1109. package/dist/sdk/providers/codex-protocol/generated/v2/TurnSettingsUpdateResponse.js.map +1 -0
  1110. package/dist/sdk/providers/codex-protocol/generated/v2/TurnSettingsUpdateStatus.d.ts +2 -0
  1111. package/dist/sdk/providers/codex-protocol/generated/v2/TurnSettingsUpdateStatus.d.ts.map +1 -0
  1112. package/dist/sdk/providers/codex-protocol/generated/v2/TurnSettingsUpdateStatus.js +3 -0
  1113. package/dist/sdk/providers/codex-protocol/generated/v2/TurnSettingsUpdateStatus.js.map +1 -0
  1114. package/dist/sdk/providers/codex-protocol/generated/v2/TurnStartParams.d.ts +19 -0
  1115. package/dist/sdk/providers/codex-protocol/generated/v2/TurnStartParams.d.ts.map +1 -1
  1116. package/dist/sdk/providers/codex-protocol/generated/v2/TurnToolOutput.d.ts +7 -0
  1117. package/dist/sdk/providers/codex-protocol/generated/v2/TurnToolOutput.d.ts.map +1 -0
  1118. package/dist/sdk/providers/codex-protocol/generated/v2/TurnToolOutput.js +3 -0
  1119. package/dist/sdk/providers/codex-protocol/generated/v2/TurnToolOutput.js.map +1 -0
  1120. package/dist/sdk/providers/codex-protocol/index.d.ts +7 -0
  1121. package/dist/sdk/providers/codex-protocol/index.d.ts.map +1 -1
  1122. package/dist/sdk/providers/codex-summary-helpers.d.ts.map +1 -1
  1123. package/dist/sdk/providers/codex-summary-helpers.js +1 -1
  1124. package/dist/sdk/providers/codex-summary-helpers.js.map +1 -1
  1125. package/dist/sdk/providers/codex.d.ts +50 -3
  1126. package/dist/sdk/providers/codex.d.ts.map +1 -1
  1127. package/dist/sdk/providers/codex.js +1214 -201
  1128. package/dist/sdk/providers/codex.js.map +1 -1
  1129. package/dist/sdk/providers/env-filter.d.ts +7 -0
  1130. package/dist/sdk/providers/env-filter.d.ts.map +1 -1
  1131. package/dist/sdk/providers/env-filter.js +21 -0
  1132. package/dist/sdk/providers/env-filter.js.map +1 -1
  1133. package/dist/sdk/providers/gemini-acp.d.ts.map +1 -1
  1134. package/dist/sdk/providers/gemini-acp.js +5 -4
  1135. package/dist/sdk/providers/gemini-acp.js.map +1 -1
  1136. package/dist/sdk/providers/gemini.d.ts.map +1 -1
  1137. package/dist/sdk/providers/gemini.js +6 -7
  1138. package/dist/sdk/providers/gemini.js.map +1 -1
  1139. package/dist/sdk/providers/grok-acp.d.ts +26 -19
  1140. package/dist/sdk/providers/grok-acp.d.ts.map +1 -1
  1141. package/dist/sdk/providers/grok-acp.js +145 -208
  1142. package/dist/sdk/providers/grok-acp.js.map +1 -1
  1143. package/dist/sdk/providers/grok-interject-text.d.ts +19 -0
  1144. package/dist/sdk/providers/grok-interject-text.d.ts.map +1 -0
  1145. package/dist/sdk/providers/grok-interject-text.js +43 -0
  1146. package/dist/sdk/providers/grok-interject-text.js.map +1 -0
  1147. package/dist/sdk/providers/grok-tool-normalization.d.ts +38 -0
  1148. package/dist/sdk/providers/grok-tool-normalization.d.ts.map +1 -0
  1149. package/dist/sdk/providers/grok-tool-normalization.js +938 -0
  1150. package/dist/sdk/providers/grok-tool-normalization.js.map +1 -0
  1151. package/dist/sdk/providers/index.d.ts +24 -1
  1152. package/dist/sdk/providers/index.d.ts.map +1 -1
  1153. package/dist/sdk/providers/index.js +69 -3
  1154. package/dist/sdk/providers/index.js.map +1 -1
  1155. package/dist/sdk/providers/managed-codex-auth.d.ts +45 -0
  1156. package/dist/sdk/providers/managed-codex-auth.d.ts.map +1 -0
  1157. package/dist/sdk/providers/managed-codex-auth.js +407 -0
  1158. package/dist/sdk/providers/managed-codex-auth.js.map +1 -0
  1159. package/dist/sdk/providers/managed-codex-transcript-mirror.d.ts +84 -0
  1160. package/dist/sdk/providers/managed-codex-transcript-mirror.d.ts.map +1 -0
  1161. package/dist/sdk/providers/managed-codex-transcript-mirror.js +505 -0
  1162. package/dist/sdk/providers/managed-codex-transcript-mirror.js.map +1 -0
  1163. package/dist/sdk/providers/managed-runner-entry.d.ts +3 -0
  1164. package/dist/sdk/providers/managed-runner-entry.d.ts.map +1 -0
  1165. package/dist/sdk/providers/managed-runner-entry.js +222 -0
  1166. package/dist/sdk/providers/managed-runner-entry.js.map +1 -0
  1167. package/dist/sdk/providers/managed-ssh-agent-session.d.ts +36 -0
  1168. package/dist/sdk/providers/managed-ssh-agent-session.d.ts.map +1 -0
  1169. package/dist/sdk/providers/managed-ssh-agent-session.js +771 -0
  1170. package/dist/sdk/providers/managed-ssh-agent-session.js.map +1 -0
  1171. package/dist/sdk/providers/managed-ssh-diagnostic-provider.d.ts +29 -0
  1172. package/dist/sdk/providers/managed-ssh-diagnostic-provider.d.ts.map +1 -0
  1173. package/dist/sdk/providers/managed-ssh-diagnostic-provider.js +85 -0
  1174. package/dist/sdk/providers/managed-ssh-diagnostic-provider.js.map +1 -0
  1175. package/dist/sdk/providers/managed-ssh-target.d.ts +169 -0
  1176. package/dist/sdk/providers/managed-ssh-target.d.ts.map +1 -0
  1177. package/dist/sdk/providers/managed-ssh-target.js +1067 -0
  1178. package/dist/sdk/providers/managed-ssh-target.js.map +1 -0
  1179. package/dist/sdk/providers/managed-ssh-workspace.d.ts +63 -0
  1180. package/dist/sdk/providers/managed-ssh-workspace.d.ts.map +1 -0
  1181. package/dist/sdk/providers/managed-ssh-workspace.js +458 -0
  1182. package/dist/sdk/providers/managed-ssh-workspace.js.map +1 -0
  1183. package/dist/sdk/providers/opencode-binary-selection.d.ts +14 -0
  1184. package/dist/sdk/providers/opencode-binary-selection.d.ts.map +1 -0
  1185. package/dist/sdk/providers/opencode-binary-selection.js +37 -0
  1186. package/dist/sdk/providers/opencode-binary-selection.js.map +1 -0
  1187. package/dist/sdk/providers/opencode-models.d.ts +12 -4
  1188. package/dist/sdk/providers/opencode-models.d.ts.map +1 -1
  1189. package/dist/sdk/providers/opencode-models.js +21 -8
  1190. package/dist/sdk/providers/opencode-models.js.map +1 -1
  1191. package/dist/sdk/providers/opencode-tools.d.ts +10 -0
  1192. package/dist/sdk/providers/opencode-tools.d.ts.map +1 -1
  1193. package/dist/sdk/providers/opencode-tools.js +47 -18
  1194. package/dist/sdk/providers/opencode-tools.js.map +1 -1
  1195. package/dist/sdk/providers/opencode.d.ts +6 -4
  1196. package/dist/sdk/providers/opencode.d.ts.map +1 -1
  1197. package/dist/sdk/providers/opencode.js +94 -44
  1198. package/dist/sdk/providers/opencode.js.map +1 -1
  1199. package/dist/sdk/providers/pi-launch-target.d.ts +20 -0
  1200. package/dist/sdk/providers/pi-launch-target.d.ts.map +1 -0
  1201. package/dist/sdk/providers/pi-launch-target.js +68 -0
  1202. package/dist/sdk/providers/pi-launch-target.js.map +1 -0
  1203. package/dist/sdk/providers/pi-tools.d.ts.map +1 -1
  1204. package/dist/sdk/providers/pi-tools.js +26 -0
  1205. package/dist/sdk/providers/pi-tools.js.map +1 -1
  1206. package/dist/sdk/providers/pi.d.ts +3 -2
  1207. package/dist/sdk/providers/pi.d.ts.map +1 -1
  1208. package/dist/sdk/providers/pi.js +35 -30
  1209. package/dist/sdk/providers/pi.js.map +1 -1
  1210. package/dist/sdk/providers/provider-runtime-fake.d.ts +10 -0
  1211. package/dist/sdk/providers/provider-runtime-fake.d.ts.map +1 -0
  1212. package/dist/sdk/providers/provider-runtime-fake.js +154 -0
  1213. package/dist/sdk/providers/provider-runtime-fake.js.map +1 -0
  1214. package/dist/sdk/providers/provider-runtime-host.d.ts +104 -0
  1215. package/dist/sdk/providers/provider-runtime-host.d.ts.map +1 -0
  1216. package/dist/sdk/providers/provider-runtime-host.js +888 -0
  1217. package/dist/sdk/providers/provider-runtime-host.js.map +1 -0
  1218. package/dist/sdk/providers/provider-runtime-socket-adapter.d.ts +15 -0
  1219. package/dist/sdk/providers/provider-runtime-socket-adapter.d.ts.map +1 -0
  1220. package/dist/sdk/providers/provider-runtime-socket-adapter.js +106 -0
  1221. package/dist/sdk/providers/provider-runtime-socket-adapter.js.map +1 -0
  1222. package/dist/sdk/providers/provider-runtime-stdio.d.ts +61 -0
  1223. package/dist/sdk/providers/provider-runtime-stdio.d.ts.map +1 -0
  1224. package/dist/sdk/providers/provider-runtime-stdio.js +527 -0
  1225. package/dist/sdk/providers/provider-runtime-stdio.js.map +1 -0
  1226. package/dist/sdk/providers/provider-runtime-worker.d.ts +2 -0
  1227. package/dist/sdk/providers/provider-runtime-worker.d.ts.map +1 -0
  1228. package/dist/sdk/providers/provider-runtime-worker.js +182 -0
  1229. package/dist/sdk/providers/provider-runtime-worker.js.map +1 -0
  1230. package/dist/sdk/providers/provider-session-owner.d.ts +126 -0
  1231. package/dist/sdk/providers/provider-session-owner.d.ts.map +1 -0
  1232. package/dist/sdk/providers/provider-session-owner.js +677 -0
  1233. package/dist/sdk/providers/provider-session-owner.js.map +1 -0
  1234. package/dist/sdk/providers/provider-subscription-usage.d.ts +4 -0
  1235. package/dist/sdk/providers/provider-subscription-usage.d.ts.map +1 -0
  1236. package/dist/sdk/providers/provider-subscription-usage.js +204 -0
  1237. package/dist/sdk/providers/provider-subscription-usage.js.map +1 -0
  1238. package/dist/sdk/providers/staticSlashCommands.d.ts.map +1 -1
  1239. package/dist/sdk/providers/staticSlashCommands.js +13 -0
  1240. package/dist/sdk/providers/staticSlashCommands.js.map +1 -1
  1241. package/dist/sdk/providers/types.d.ts +152 -11
  1242. package/dist/sdk/providers/types.d.ts.map +1 -1
  1243. package/dist/sdk/providers/types.js +66 -1
  1244. package/dist/sdk/providers/types.js.map +1 -1
  1245. package/dist/sdk/remote-shell.d.ts +6 -0
  1246. package/dist/sdk/remote-shell.d.ts.map +1 -0
  1247. package/dist/sdk/remote-shell.js +15 -0
  1248. package/dist/sdk/remote-shell.js.map +1 -0
  1249. package/dist/sdk/remote-spawn.d.ts +22 -0
  1250. package/dist/sdk/remote-spawn.d.ts.map +1 -1
  1251. package/dist/sdk/remote-spawn.js +54 -27
  1252. package/dist/sdk/remote-spawn.js.map +1 -1
  1253. package/dist/sdk/session-sync.d.ts +5 -0
  1254. package/dist/sdk/session-sync.d.ts.map +1 -1
  1255. package/dist/sdk/session-sync.js +51 -12
  1256. package/dist/sdk/session-sync.js.map +1 -1
  1257. package/dist/sdk/slashCommandEmulation.d.ts +2 -6
  1258. package/dist/sdk/slashCommandEmulation.d.ts.map +1 -1
  1259. package/dist/sdk/slashCommandEmulation.js +12 -19
  1260. package/dist/sdk/slashCommandEmulation.js.map +1 -1
  1261. package/dist/sdk/types.d.ts +52 -6
  1262. package/dist/sdk/types.d.ts.map +1 -1
  1263. package/dist/security/approvalAuditLog.js.map +1 -1
  1264. package/dist/services/BrowserDebugService.d.ts +71 -0
  1265. package/dist/services/BrowserDebugService.d.ts.map +1 -0
  1266. package/dist/services/BrowserDebugService.js +285 -0
  1267. package/dist/services/BrowserDebugService.js.map +1 -0
  1268. package/dist/services/BrowserProfileService.d.ts +1 -6
  1269. package/dist/services/BrowserProfileService.d.ts.map +1 -1
  1270. package/dist/services/BrowserProfileService.js +2 -18
  1271. package/dist/services/BrowserProfileService.js.map +1 -1
  1272. package/dist/services/CacheMissBillingMonitor.d.ts +4 -0
  1273. package/dist/services/CacheMissBillingMonitor.d.ts.map +1 -1
  1274. package/dist/services/CacheMissBillingMonitor.js +161 -24
  1275. package/dist/services/CacheMissBillingMonitor.js.map +1 -1
  1276. package/dist/services/CodexUpdateChecker.d.ts +22 -6
  1277. package/dist/services/CodexUpdateChecker.d.ts.map +1 -1
  1278. package/dist/services/CodexUpdateChecker.js +128 -15
  1279. package/dist/services/CodexUpdateChecker.js.map +1 -1
  1280. package/dist/services/ConnectedBrowsersService.d.ts +5 -1
  1281. package/dist/services/ConnectedBrowsersService.d.ts.map +1 -1
  1282. package/dist/services/ConnectedBrowsersService.js +18 -1
  1283. package/dist/services/ConnectedBrowsersService.js.map +1 -1
  1284. package/dist/services/DirtyFileEditorService.d.ts +47 -0
  1285. package/dist/services/DirtyFileEditorService.d.ts.map +1 -0
  1286. package/dist/services/DirtyFileEditorService.js +382 -0
  1287. package/dist/services/DirtyFileEditorService.js.map +1 -0
  1288. package/dist/services/GitUntrackedCacheService.d.ts +44 -0
  1289. package/dist/services/GitUntrackedCacheService.d.ts.map +1 -0
  1290. package/dist/services/GitUntrackedCacheService.js +420 -0
  1291. package/dist/services/GitUntrackedCacheService.js.map +1 -0
  1292. package/dist/services/HeartbeatCandidateRegistry.d.ts +114 -0
  1293. package/dist/services/HeartbeatCandidateRegistry.d.ts.map +1 -0
  1294. package/dist/services/HeartbeatCandidateRegistry.js +215 -0
  1295. package/dist/services/HeartbeatCandidateRegistry.js.map +1 -0
  1296. package/dist/services/HostAgentProcessService.d.ts +40 -0
  1297. package/dist/services/HostAgentProcessService.d.ts.map +1 -0
  1298. package/dist/services/HostAgentProcessService.js +392 -0
  1299. package/dist/services/HostAgentProcessService.js.map +1 -0
  1300. package/dist/services/InstallService.d.ts +13 -0
  1301. package/dist/services/InstallService.d.ts.map +1 -1
  1302. package/dist/services/InstallService.js +86 -12
  1303. package/dist/services/InstallService.js.map +1 -1
  1304. package/dist/services/LegacyPublicShareReader.d.ts +27 -0
  1305. package/dist/services/LegacyPublicShareReader.d.ts.map +1 -0
  1306. package/dist/services/LegacyPublicShareReader.js +684 -0
  1307. package/dist/services/LegacyPublicShareReader.js.map +1 -0
  1308. package/dist/services/ModelInfoService.d.ts +2 -3
  1309. package/dist/services/ModelInfoService.d.ts.map +1 -1
  1310. package/dist/services/ModelInfoService.js +7 -19
  1311. package/dist/services/ModelInfoService.js.map +1 -1
  1312. package/dist/services/NetworkBindingService.d.ts +1 -6
  1313. package/dist/services/NetworkBindingService.d.ts.map +1 -1
  1314. package/dist/services/NetworkBindingService.js +2 -18
  1315. package/dist/services/NetworkBindingService.js.map +1 -1
  1316. package/dist/services/ProjectQueueScheduler.d.ts +15 -4
  1317. package/dist/services/ProjectQueueScheduler.d.ts.map +1 -1
  1318. package/dist/services/ProjectQueueScheduler.js +167 -10
  1319. package/dist/services/ProjectQueueScheduler.js.map +1 -1
  1320. package/dist/services/ProjectQueueService.d.ts +3 -0
  1321. package/dist/services/ProjectQueueService.d.ts.map +1 -1
  1322. package/dist/services/ProjectQueueService.js +97 -5
  1323. package/dist/services/ProjectQueueService.js.map +1 -1
  1324. package/dist/services/ProviderInstallationCoordinator.d.ts +136 -0
  1325. package/dist/services/ProviderInstallationCoordinator.d.ts.map +1 -0
  1326. package/dist/services/ProviderInstallationCoordinator.js +636 -0
  1327. package/dist/services/ProviderInstallationCoordinator.js.map +1 -0
  1328. package/dist/services/PublicFileShareStore.d.ts +53 -0
  1329. package/dist/services/PublicFileShareStore.d.ts.map +1 -0
  1330. package/dist/services/PublicFileShareStore.js +297 -0
  1331. package/dist/services/PublicFileShareStore.js.map +1 -0
  1332. package/dist/services/PublicSharePrivateStorage.d.ts +15 -0
  1333. package/dist/services/PublicSharePrivateStorage.d.ts.map +1 -0
  1334. package/dist/services/PublicSharePrivateStorage.js +82 -0
  1335. package/dist/services/PublicSharePrivateStorage.js.map +1 -0
  1336. package/dist/services/PublicShareRevisionRepository.d.ts +87 -0
  1337. package/dist/services/PublicShareRevisionRepository.d.ts.map +1 -0
  1338. package/dist/services/PublicShareRevisionRepository.js +809 -0
  1339. package/dist/services/PublicShareRevisionRepository.js.map +1 -0
  1340. package/dist/services/PublicShareService.d.ts +93 -33
  1341. package/dist/services/PublicShareService.d.ts.map +1 -1
  1342. package/dist/services/PublicShareService.js +544 -295
  1343. package/dist/services/PublicShareService.js.map +1 -1
  1344. package/dist/services/PublicShareStore.d.ts +132 -0
  1345. package/dist/services/PublicShareStore.d.ts.map +1 -0
  1346. package/dist/services/PublicShareStore.js +973 -0
  1347. package/dist/services/PublicShareStore.js.map +1 -0
  1348. package/dist/services/RelayClientService.d.ts.map +1 -1
  1349. package/dist/services/RelayClientService.js +24 -10
  1350. package/dist/services/RelayClientService.js.map +1 -1
  1351. package/dist/services/SecurityClientService.d.ts +88 -0
  1352. package/dist/services/SecurityClientService.d.ts.map +1 -0
  1353. package/dist/services/SecurityClientService.js +1036 -0
  1354. package/dist/services/SecurityClientService.js.map +1 -0
  1355. package/dist/services/ServerSettingsService.d.ts +70 -7
  1356. package/dist/services/ServerSettingsService.d.ts.map +1 -1
  1357. package/dist/services/ServerSettingsService.js +186 -39
  1358. package/dist/services/ServerSettingsService.js.map +1 -1
  1359. package/dist/services/SessionCatalogService.d.ts +203 -0
  1360. package/dist/services/SessionCatalogService.d.ts.map +1 -0
  1361. package/dist/services/SessionCatalogService.js +931 -0
  1362. package/dist/services/SessionCatalogService.js.map +1 -0
  1363. package/dist/services/SessionQueuePersistenceService.d.ts.map +1 -1
  1364. package/dist/services/SessionQueuePersistenceService.js +1 -2
  1365. package/dist/services/SessionQueuePersistenceService.js.map +1 -1
  1366. package/dist/services/SessionWakeService.d.ts +55 -0
  1367. package/dist/services/SessionWakeService.d.ts.map +1 -0
  1368. package/dist/services/SessionWakeService.js +139 -0
  1369. package/dist/services/SessionWakeService.js.map +1 -0
  1370. package/dist/services/WorkstreamService.d.ts.map +1 -1
  1371. package/dist/services/WorkstreamService.js +18 -4
  1372. package/dist/services/WorkstreamService.js.map +1 -1
  1373. package/dist/services/bangCompletions.d.ts +25 -7
  1374. package/dist/services/bangCompletions.d.ts.map +1 -1
  1375. package/dist/services/bangCompletions.js +85 -18
  1376. package/dist/services/bangCompletions.js.map +1 -1
  1377. package/dist/services/host-awake/HostAwakeService.d.ts.map +1 -1
  1378. package/dist/services/host-awake/HostAwakeService.js +8 -2
  1379. package/dist/services/host-awake/HostAwakeService.js.map +1 -1
  1380. package/dist/services/host-awake/MacHostAwakeBackend.d.ts.map +1 -1
  1381. package/dist/services/host-awake/MacHostAwakeBackend.js +1 -1
  1382. package/dist/services/host-awake/MacHostAwakeBackend.js.map +1 -1
  1383. package/dist/services/host-awake/WindowsHostAwakeBackend.d.ts +2 -0
  1384. package/dist/services/host-awake/WindowsHostAwakeBackend.d.ts.map +1 -1
  1385. package/dist/services/host-awake/WindowsHostAwakeBackend.js +13 -4
  1386. package/dist/services/host-awake/WindowsHostAwakeBackend.js.map +1 -1
  1387. package/dist/services/index.d.ts +4 -1
  1388. package/dist/services/index.d.ts.map +1 -1
  1389. package/dist/services/index.js +4 -1
  1390. package/dist/services/index.js.map +1 -1
  1391. package/dist/services/installationOwnerProbe.d.ts +20 -0
  1392. package/dist/services/installationOwnerProbe.d.ts.map +1 -0
  1393. package/dist/services/installationOwnerProbe.js +67 -0
  1394. package/dist/services/installationOwnerProbe.js.map +1 -0
  1395. package/dist/services/projectWorkIdle.d.ts +10 -0
  1396. package/dist/services/projectWorkIdle.d.ts.map +1 -1
  1397. package/dist/services/projectWorkIdle.js +6 -1
  1398. package/dist/services/projectWorkIdle.js.map +1 -1
  1399. package/dist/services/providerProcessClassifier.d.ts +18 -0
  1400. package/dist/services/providerProcessClassifier.d.ts.map +1 -0
  1401. package/dist/services/providerProcessClassifier.js +64 -0
  1402. package/dist/services/providerProcessClassifier.js.map +1 -0
  1403. package/dist/services/sessionHeartbeatDefaults.d.ts +11 -0
  1404. package/dist/services/sessionHeartbeatDefaults.d.ts.map +1 -0
  1405. package/dist/services/sessionHeartbeatDefaults.js +29 -0
  1406. package/dist/services/sessionHeartbeatDefaults.js.map +1 -0
  1407. package/dist/session-sandbox-network-launcher.mjs +279 -0
  1408. package/dist/session-sandbox.d.ts +81 -0
  1409. package/dist/session-sandbox.d.ts.map +1 -0
  1410. package/dist/session-sandbox.js +770 -0
  1411. package/dist/session-sandbox.js.map +1 -0
  1412. package/dist/sessions/agent-excerpt.d.ts.map +1 -1
  1413. package/dist/sessions/agent-excerpt.js +5 -1
  1414. package/dist/sessions/agent-excerpt.js.map +1 -1
  1415. package/dist/sessions/catalog-adapters/grok-catalog-adapter.d.ts +19 -0
  1416. package/dist/sessions/catalog-adapters/grok-catalog-adapter.d.ts.map +1 -0
  1417. package/dist/sessions/catalog-adapters/grok-catalog-adapter.js +140 -0
  1418. package/dist/sessions/catalog-adapters/grok-catalog-adapter.js.map +1 -0
  1419. package/dist/sessions/catalog-adapters/opencode-catalog-adapter.d.ts +29 -0
  1420. package/dist/sessions/catalog-adapters/opencode-catalog-adapter.d.ts.map +1 -0
  1421. package/dist/sessions/catalog-adapters/opencode-catalog-adapter.js +168 -0
  1422. package/dist/sessions/catalog-adapters/opencode-catalog-adapter.js.map +1 -0
  1423. package/dist/sessions/catalog-adapters/pi-catalog-adapter.d.ts +24 -0
  1424. package/dist/sessions/catalog-adapters/pi-catalog-adapter.d.ts.map +1 -0
  1425. package/dist/sessions/catalog-adapters/pi-catalog-adapter.js +114 -0
  1426. package/dist/sessions/catalog-adapters/pi-catalog-adapter.js.map +1 -0
  1427. package/dist/sessions/catalog-adapters/row.d.ts +37 -0
  1428. package/dist/sessions/catalog-adapters/row.d.ts.map +1 -0
  1429. package/dist/sessions/catalog-adapters/row.js +39 -0
  1430. package/dist/sessions/catalog-adapters/row.js.map +1 -0
  1431. package/dist/sessions/catalog-types.d.ts +66 -0
  1432. package/dist/sessions/catalog-types.d.ts.map +1 -0
  1433. package/dist/sessions/catalog-types.js +4 -0
  1434. package/dist/sessions/catalog-types.js.map +1 -0
  1435. package/dist/sessions/claude-summary.d.ts +41 -1
  1436. package/dist/sessions/claude-summary.d.ts.map +1 -1
  1437. package/dist/sessions/claude-summary.js +53 -20
  1438. package/dist/sessions/claude-summary.js.map +1 -1
  1439. package/dist/sessions/claude-transcript-cache.d.ts +54 -0
  1440. package/dist/sessions/claude-transcript-cache.d.ts.map +1 -0
  1441. package/dist/sessions/claude-transcript-cache.js +359 -0
  1442. package/dist/sessions/claude-transcript-cache.js.map +1 -0
  1443. package/dist/sessions/codex-discovery.d.ts +2 -2
  1444. package/dist/sessions/codex-discovery.d.ts.map +1 -1
  1445. package/dist/sessions/codex-discovery.js +10 -6
  1446. package/dist/sessions/codex-discovery.js.map +1 -1
  1447. package/dist/sessions/codex-provider-child-projection.d.ts +47 -0
  1448. package/dist/sessions/codex-provider-child-projection.d.ts.map +1 -0
  1449. package/dist/sessions/codex-provider-child-projection.js +289 -0
  1450. package/dist/sessions/codex-provider-child-projection.js.map +1 -0
  1451. package/dist/sessions/codex-reader.d.ts +41 -1
  1452. package/dist/sessions/codex-reader.d.ts.map +1 -1
  1453. package/dist/sessions/codex-reader.js +562 -280
  1454. package/dist/sessions/codex-reader.js.map +1 -1
  1455. package/dist/sessions/codex-user-turn-provenance.d.ts +21 -2
  1456. package/dist/sessions/codex-user-turn-provenance.d.ts.map +1 -1
  1457. package/dist/sessions/codex-user-turn-provenance.js +55 -15
  1458. package/dist/sessions/codex-user-turn-provenance.js.map +1 -1
  1459. package/dist/sessions/dag.d.ts +0 -11
  1460. package/dist/sessions/dag.d.ts.map +1 -1
  1461. package/dist/sessions/dag.js +37 -36
  1462. package/dist/sessions/dag.js.map +1 -1
  1463. package/dist/sessions/gemini-reader.d.ts.map +1 -1
  1464. package/dist/sessions/gemini-reader.js +2 -2
  1465. package/dist/sessions/gemini-reader.js.map +1 -1
  1466. package/dist/sessions/grok-reader.d.ts +11 -27
  1467. package/dist/sessions/grok-reader.d.ts.map +1 -1
  1468. package/dist/sessions/grok-reader.js +204 -417
  1469. package/dist/sessions/grok-reader.js.map +1 -1
  1470. package/dist/sessions/merged-reader.d.ts +46 -0
  1471. package/dist/sessions/merged-reader.d.ts.map +1 -0
  1472. package/dist/sessions/merged-reader.js +157 -0
  1473. package/dist/sessions/merged-reader.js.map +1 -0
  1474. package/dist/sessions/normalization.d.ts +14 -2
  1475. package/dist/sessions/normalization.d.ts.map +1 -1
  1476. package/dist/sessions/normalization.js +474 -75
  1477. package/dist/sessions/normalization.js.map +1 -1
  1478. package/dist/sessions/opencode-db-reader.d.ts +44 -0
  1479. package/dist/sessions/opencode-db-reader.d.ts.map +1 -1
  1480. package/dist/sessions/opencode-db-reader.js +158 -0
  1481. package/dist/sessions/opencode-db-reader.js.map +1 -1
  1482. package/dist/sessions/opencode-reader.d.ts +9 -11
  1483. package/dist/sessions/opencode-reader.d.ts.map +1 -1
  1484. package/dist/sessions/opencode-reader.js +196 -14
  1485. package/dist/sessions/opencode-reader.js.map +1 -1
  1486. package/dist/sessions/pagination.d.ts.map +1 -1
  1487. package/dist/sessions/pagination.js.map +1 -1
  1488. package/dist/sessions/persisted-augments.d.ts +12 -1
  1489. package/dist/sessions/persisted-augments.d.ts.map +1 -1
  1490. package/dist/sessions/persisted-augments.js +69 -190
  1491. package/dist/sessions/persisted-augments.js.map +1 -1
  1492. package/dist/sessions/pi-reader.d.ts +6 -1
  1493. package/dist/sessions/pi-reader.d.ts.map +1 -1
  1494. package/dist/sessions/pi-reader.js +22 -6
  1495. package/dist/sessions/pi-reader.js.map +1 -1
  1496. package/dist/sessions/provider-catalog-family.d.ts +7 -0
  1497. package/dist/sessions/provider-catalog-family.d.ts.map +1 -0
  1498. package/dist/sessions/provider-catalog-family.js +40 -0
  1499. package/dist/sessions/provider-catalog-family.js.map +1 -0
  1500. package/dist/sessions/provider-child-sessions.d.ts +15 -0
  1501. package/dist/sessions/provider-child-sessions.d.ts.map +1 -0
  1502. package/dist/sessions/provider-child-sessions.js +40 -0
  1503. package/dist/sessions/provider-child-sessions.js.map +1 -0
  1504. package/dist/sessions/provider-resolution.d.ts +8 -1
  1505. package/dist/sessions/provider-resolution.d.ts.map +1 -1
  1506. package/dist/sessions/provider-resolution.js +46 -1
  1507. package/dist/sessions/provider-resolution.js.map +1 -1
  1508. package/dist/sessions/reader.d.ts +8 -1
  1509. package/dist/sessions/reader.d.ts.map +1 -1
  1510. package/dist/sessions/reader.js +64 -19
  1511. package/dist/sessions/reader.js.map +1 -1
  1512. package/dist/sessions/recap-overlays.d.ts +13 -1
  1513. package/dist/sessions/recap-overlays.d.ts.map +1 -1
  1514. package/dist/sessions/recap-overlays.js +56 -0
  1515. package/dist/sessions/recap-overlays.js.map +1 -1
  1516. package/dist/sessions/resume-exemption.d.ts +9 -6
  1517. package/dist/sessions/resume-exemption.d.ts.map +1 -1
  1518. package/dist/sessions/resume-exemption.js +12 -6
  1519. package/dist/sessions/resume-exemption.js.map +1 -1
  1520. package/dist/sessions/sessionCollectionGeneration.d.ts +49 -0
  1521. package/dist/sessions/sessionCollectionGeneration.d.ts.map +1 -0
  1522. package/dist/sessions/sessionCollectionGeneration.js +64 -0
  1523. package/dist/sessions/sessionCollectionGeneration.js.map +1 -0
  1524. package/dist/sessions/summary-parser-worker-client.d.ts.map +1 -1
  1525. package/dist/sessions/summary-parser-worker-client.js +4 -3
  1526. package/dist/sessions/summary-parser-worker-client.js.map +1 -1
  1527. package/dist/sessions/types.d.ts +38 -2
  1528. package/dist/sessions/types.d.ts.map +1 -1
  1529. package/dist/sessions/types.js +8 -0
  1530. package/dist/sessions/types.js.map +1 -1
  1531. package/dist/subscriptions.d.ts +7 -1
  1532. package/dist/subscriptions.d.ts.map +1 -1
  1533. package/dist/subscriptions.js +229 -46
  1534. package/dist/subscriptions.js.map +1 -1
  1535. package/dist/supervisor/ExternalSessionTracker.d.ts +5 -0
  1536. package/dist/supervisor/ExternalSessionTracker.d.ts.map +1 -1
  1537. package/dist/supervisor/ExternalSessionTracker.js +8 -2
  1538. package/dist/supervisor/ExternalSessionTracker.js.map +1 -1
  1539. package/dist/supervisor/Process.d.ts +178 -40
  1540. package/dist/supervisor/Process.d.ts.map +1 -1
  1541. package/dist/supervisor/Process.js +829 -265
  1542. package/dist/supervisor/Process.js.map +1 -1
  1543. package/dist/supervisor/ProcessViewerLifecycle.d.ts +72 -0
  1544. package/dist/supervisor/ProcessViewerLifecycle.d.ts.map +1 -0
  1545. package/dist/supervisor/ProcessViewerLifecycle.js +358 -0
  1546. package/dist/supervisor/ProcessViewerLifecycle.js.map +1 -0
  1547. package/dist/supervisor/SessionActivationCoordinator.d.ts +132 -0
  1548. package/dist/supervisor/SessionActivationCoordinator.d.ts.map +1 -0
  1549. package/dist/supervisor/SessionActivationCoordinator.js +603 -0
  1550. package/dist/supervisor/SessionActivationCoordinator.js.map +1 -0
  1551. package/dist/supervisor/SessionDoneCoordinator.d.ts +43 -0
  1552. package/dist/supervisor/SessionDoneCoordinator.d.ts.map +1 -0
  1553. package/dist/supervisor/SessionDoneCoordinator.js +293 -0
  1554. package/dist/supervisor/SessionDoneCoordinator.js.map +1 -0
  1555. package/dist/supervisor/SessionViewerPresence.d.ts +19 -0
  1556. package/dist/supervisor/SessionViewerPresence.d.ts.map +1 -0
  1557. package/dist/supervisor/SessionViewerPresence.js +45 -0
  1558. package/dist/supervisor/SessionViewerPresence.js.map +1 -0
  1559. package/dist/supervisor/Supervisor.d.ts +178 -88
  1560. package/dist/supervisor/Supervisor.d.ts.map +1 -1
  1561. package/dist/supervisor/Supervisor.js +1268 -342
  1562. package/dist/supervisor/Supervisor.js.map +1 -1
  1563. package/dist/supervisor/WorkerQueue.d.ts +15 -0
  1564. package/dist/supervisor/WorkerQueue.d.ts.map +1 -1
  1565. package/dist/supervisor/WorkerQueue.js +18 -1
  1566. package/dist/supervisor/WorkerQueue.js.map +1 -1
  1567. package/dist/supervisor/composeTimeAnchor.d.ts +20 -4
  1568. package/dist/supervisor/composeTimeAnchor.d.ts.map +1 -1
  1569. package/dist/supervisor/composeTimeAnchor.js +35 -6
  1570. package/dist/supervisor/composeTimeAnchor.js.map +1 -1
  1571. package/dist/supervisor/deferredDeliverySettings.d.ts +7 -0
  1572. package/dist/supervisor/deferredDeliverySettings.d.ts.map +1 -1
  1573. package/dist/supervisor/deferredDeliverySettings.js +6 -0
  1574. package/dist/supervisor/deferredDeliverySettings.js.map +1 -1
  1575. package/dist/supervisor/heartbeatSchedule.d.ts +73 -0
  1576. package/dist/supervisor/heartbeatSchedule.d.ts.map +1 -0
  1577. package/dist/supervisor/heartbeatSchedule.js +134 -0
  1578. package/dist/supervisor/heartbeatSchedule.js.map +1 -0
  1579. package/dist/supervisor/sessionSandboxMetadata.d.ts +23 -0
  1580. package/dist/supervisor/sessionSandboxMetadata.d.ts.map +1 -0
  1581. package/dist/supervisor/sessionSandboxMetadata.js +11 -0
  1582. package/dist/supervisor/sessionSandboxMetadata.js.map +1 -0
  1583. package/dist/supervisor/types.d.ts +54 -9
  1584. package/dist/supervisor/types.d.ts.map +1 -1
  1585. package/dist/supervisor/types.js.map +1 -1
  1586. package/dist/uploads/AttachmentStagingService.d.ts +3 -0
  1587. package/dist/uploads/AttachmentStagingService.d.ts.map +1 -1
  1588. package/dist/uploads/AttachmentStagingService.js +13 -2
  1589. package/dist/uploads/AttachmentStagingService.js.map +1 -1
  1590. package/dist/uploads/attachmentAccess.d.ts +8 -0
  1591. package/dist/uploads/attachmentAccess.d.ts.map +1 -0
  1592. package/dist/uploads/attachmentAccess.js +50 -0
  1593. package/dist/uploads/attachmentAccess.js.map +1 -0
  1594. package/dist/uploads/index.d.ts +1 -1
  1595. package/dist/uploads/index.d.ts.map +1 -1
  1596. package/dist/uploads/index.js +1 -1
  1597. package/dist/uploads/index.js.map +1 -1
  1598. package/dist/uploads/manager.d.ts +5 -1
  1599. package/dist/uploads/manager.d.ts.map +1 -1
  1600. package/dist/uploads/manager.js +16 -7
  1601. package/dist/uploads/manager.js.map +1 -1
  1602. package/dist/utils/codexRolloutFiles.d.ts +10 -0
  1603. package/dist/utils/codexRolloutFiles.d.ts.map +1 -1
  1604. package/dist/utils/codexRolloutFiles.js +14 -0
  1605. package/dist/utils/codexRolloutFiles.js.map +1 -1
  1606. package/dist/utils/filePermissions.d.ts +22 -1
  1607. package/dist/utils/filePermissions.d.ts.map +1 -1
  1608. package/dist/utils/filePermissions.js +186 -5
  1609. package/dist/utils/filePermissions.js.map +1 -1
  1610. package/dist/utils/npmCommand.d.ts +14 -0
  1611. package/dist/utils/npmCommand.d.ts.map +1 -0
  1612. package/dist/utils/npmCommand.js +19 -0
  1613. package/dist/utils/npmCommand.js.map +1 -0
  1614. package/dist/utils/posixShell.d.ts +10 -0
  1615. package/dist/utils/posixShell.d.ts.map +1 -0
  1616. package/dist/utils/posixShell.js +12 -0
  1617. package/dist/utils/posixShell.js.map +1 -0
  1618. package/dist/utils/projectFileAccess.d.ts +13 -0
  1619. package/dist/utils/projectFileAccess.d.ts.map +1 -0
  1620. package/dist/utils/projectFileAccess.js +89 -0
  1621. package/dist/utils/projectFileAccess.js.map +1 -0
  1622. package/dist/utils/utf8Text.d.ts +10 -0
  1623. package/dist/utils/utf8Text.d.ts.map +1 -0
  1624. package/dist/utils/utf8Text.js +52 -0
  1625. package/dist/utils/utf8Text.js.map +1 -0
  1626. package/dist/watcher/BatchProcessor.d.ts +55 -0
  1627. package/dist/watcher/BatchProcessor.d.ts.map +1 -1
  1628. package/dist/watcher/BatchProcessor.js +130 -16
  1629. package/dist/watcher/BatchProcessor.js.map +1 -1
  1630. package/dist/watcher/EventBus.d.ts +18 -4
  1631. package/dist/watcher/EventBus.d.ts.map +1 -1
  1632. package/dist/watcher/EventBus.js.map +1 -1
  1633. package/dist/watcher/FileWatcher.d.ts +33 -4
  1634. package/dist/watcher/FileWatcher.d.ts.map +1 -1
  1635. package/dist/watcher/FileWatcher.js +273 -67
  1636. package/dist/watcher/FileWatcher.js.map +1 -1
  1637. package/dist/watcher/FocusedSessionWatchManager.d.ts +13 -1
  1638. package/dist/watcher/FocusedSessionWatchManager.d.ts.map +1 -1
  1639. package/dist/watcher/FocusedSessionWatchManager.js +110 -31
  1640. package/dist/watcher/FocusedSessionWatchManager.js.map +1 -1
  1641. package/dist/watcher/ProviderSessionWatcherRegistry.d.ts +52 -0
  1642. package/dist/watcher/ProviderSessionWatcherRegistry.d.ts.map +1 -0
  1643. package/dist/watcher/ProviderSessionWatcherRegistry.js +108 -0
  1644. package/dist/watcher/ProviderSessionWatcherRegistry.js.map +1 -0
  1645. package/dist/watcher/index.d.ts +3 -1
  1646. package/dist/watcher/index.d.ts.map +1 -1
  1647. package/dist/watcher/index.js +1 -0
  1648. package/dist/watcher/index.js.map +1 -1
  1649. package/dist/websocketLimits.d.ts +4 -0
  1650. package/dist/websocketLimits.d.ts.map +1 -0
  1651. package/dist/websocketLimits.js +5 -0
  1652. package/dist/websocketLimits.js.map +1 -0
  1653. package/dist/yaModuleEnv.d.ts.map +1 -1
  1654. package/dist/yaModuleEnv.js +7 -1
  1655. package/dist/yaModuleEnv.js.map +1 -1
  1656. package/package.json +6 -5
  1657. package/client-dist/assets/de-BNhVdIq4.js +0 -6
  1658. package/client-dist/assets/es-Csn9n24J.js +0 -6
  1659. package/client-dist/assets/fr-DKx4tSpo.js +0 -6
  1660. package/client-dist/assets/index-7OpGawa_.css +0 -1
  1661. package/client-dist/assets/index-CSJgXvUR.js +0 -593
  1662. package/client-dist/assets/ja-DAkhkwQZ.js +0 -6
  1663. package/client-dist/assets/zh-CN-B7lY0cc6.js +0 -6
@@ -0,0 +1,16 @@
1
+ import{r as l,j as t,u as K,U,c as li,P as wo,Q as Co,V as No,W as Eo,X as ko,l as _o,i as Mo,Y as Ao,T as Do,Z as On,$ as Un,a0 as gs,a1 as Po,a2 as Fn,a3 as Bn,a4 as Hn,a5 as Io,a6 as Lo,a7 as Ro,a8 as Oo,D as Uo,a9 as Wn,aa as Fo,ab as Bo,ac as Ho,ad as Wo,ae as $o,af as Vo,ag as zo,ah as Go,ai as Ko,aj as $n,ak as Vn,al as zn,am as Yo,an as Gn,ao as Kn,ap as Yn,aq as Qo,ar as Qn,as as Xn,at as qn,au as Jn,av as Zn,aw as ea,ax as ta,ay as sa,az as na,aA as aa,aB as ia,aC as oa,aD as Xo,aE as qo,aF as Jo,aG as Zo,aH as er,aI as tr,aJ as sr,e as nr,L as ci,G as Bt,B as Ye,E as ar,a as ir,d as or}from"./index-D47M-JMk.js";import{g as ra,b as Je,s as me,i as rr,a6 as lr,a7 as cr,a8 as dr,c as ur,a9 as pr,aa as mr,ab as hr,ac as gr,ad as fr,ae as br,af as xr,ag as vr,ah as Sr,d as yr,j as jr,V as Tr,G as di,v as wr,ai as Cr,aj as Nr,R as Er,k as kr,ak as _r,e as Mr,D as Ar,al as Dr}from"./activityBus-VjgeGPMB.js";import{P as fs}from"./PageHeader-DLhedAPm.js";import{f as We,a as At,u as rs,h as ui,e as ls,M as Pr,c as Ir,d as Lr}from"./Modal-C59BcdHD.js";import{MainContent as bs}from"./index-DnwFOiB5.js";import{H as Rr,E as pi,I as xs,s as mi,F as Or,T as Ht,J as Wt,K as Ur,L as Fr,N as Br,O as Hr,j as Wr,u as $r}from"./NavigationLayout-BNRJ1SpX.js";import{f as ze,a as he,an as jt,i as Vr,ao as zr,b as Gr,h as Kr}from"./sourceRuntime-Dzap6qZX.js";import{b as Yr,L as Qr,M as Xr,N as qr,O as Jr,P as Zr,T as Tt}from"./FileViewer-4aDxZNTu.js";import{b as el,u as tl,g as sl,a as hi,d as nl,f as al}from"./useReloadNotifications-B1Gip4qS.js";import{D as il,a as ol,H as rl}from"./HeartbeatTextArea-CjOFU5D8.js";import{a as Ce,u as ll,c as cl}from"./frontendReload-t1MBqojn.js";import{u as dl,T as ul,M as pl,b as ml}from"./useStableToolPreviewRendering-RDapEGRz.js";import{B as hl,C as gl,H as la,D as ca,E as da,F as vs,I as fl,u as bl}from"./GlossaryContext-Cp_4G9df.js";import{u as xl}from"./useFloatingActionButtonEnabled-sLWhUZYo.js";import{u as vl,a as Sl}from"./useWiderConversationActivityPreviews-D-57jNSG.js";import{l as yl,m as jl,G as ua,x as pa,y as ma,D as Ss,z as Tl,A as wl,u as Cl,B as Xs,E as gi,o as Nl,W as El,F as kl,H as _l}from"./useStreamingEnabled-CiYhaw0s.js";import{C as Le,c as Ml,f as Al,e as Dl,i as Pl,M as Il,T as Ll,k as Rl,l as Ol,R as Ul,h as Fl,x as Bl,y as Hl,u as fi,z as Wl,A as $l,B as Vl,E as zl,F as Gl}from"./ThinkingControls-Yv0aTXJC.js";import{g as ha,b as ga,c as fa,r as qt,n as Kl,e as Yl,H as ss,d as bi,P as Ql,h as Xl,j as ql,k as Jl,C as Zl,l as ec}from"./types-Cm98CR-a.js";import{u as xi}from"./useRelativeNow-B6kyvcmL.js";import{u as tc,a as sc}from"./SchemaValidationContext-oxtR_d_G.js";import{t as nc}from"./appHref-ByaEnJGJ.js";import{p as vi}from"./deviceDetection-BVPclkty.js";import{u as ac,d as ic,E as oc,e as rc,f as ba}from"./useEmulators-CpDUcdfL.js";import{F as ns}from"./FilterDropdown-DefBPgy4.js";import{a as lc}from"./AuthContext-ttH_RHyv.js";import{u as cc}from"./useKeepMobileKeyboardOpenAfterDelivery-BMDI-BSY.js";import{w as Si,g as qs,a as Jt,a1 as dc,F as xa,q as uc,x as pc,v as mc,z as hc,A as gc,B as fc,D as bc,U as xc,E as vc,R as wt,W as ys,X as Sc,Y as va,Z as yc,T as jc,a2 as Tc,a3 as wc}from"./VoiceInputButton-COdV4sNA.js";import{g as yi,r as Cc,a as Nc,b as Ec,P as kc}from"./ProviderBadge-C8td51kV.js";import{u as ji,g as Ti,a as _c}from"./useProviders-BWp3tEXv.js";import{u as Mc}from"./useCodexUpdateStatus-bHHkvK4K.js";import{u as Ac}from"./HostIdentityContext-BuhXEIrO.js";import{u as Dc}from"./useSourceControlCleanLanding-BSY1vDSq.js";import"./react-runtime-Dw4bUKEF.js";import"./text-BehwCDu9.js";import"./HostIdentityMarker-DKxUjPEf.js";import"./useSidebarWidth-CNuw7NNf.js";import"./useFileActivity-C70dzD5U.js";import"./YepAnywhereLogo-B15FCqEj.js";import"./sourceTransportPaths-CbOCoJJb.js";import"./index-CgkTqljR.js";import"./MarkdownPreview-AEv1dNzV.js";import"./newSessionPrefill-B03klTbN.js";const wi="The client renders Markdown, including LaTeX math. Prefer \\( ... \\) for inline math and \\[ ... \\] for display math. Use LaTeX notation where it improves clarity.";function Pc({globalInstructions:e,hints:s}){const n=e||"",a=n.trim(),i=[];if(s!=null&&s.latexMathRendering&&i.push(wi),i.length===0)return n||void 0;const o=[`[Client capabilities]
2
+ ${i.join(`
3
+ `)}`];return a&&o.push(`[Global instructions]
4
+ ${a}`),o.join(`
5
+
6
+ `)}const Ci=200,Ic=100;function Ni(e){for(const s of e){const n=s.codePointAt(0);if(n!==void 0&&(n<32||n===127))return!0}return!1}function Lc(e){return e.length>0&&e.length<=Ci&&!/\s/u.test(e)&&!Ni(e)}function Rc(e){return e.length>0&&e.length<=Ic&&e.trim()===e&&!Ni(e)}const Ei=32;function Oc(e){if(typeof e!="string")return null;const s=e.trim();if(s.length===0||s.length>Ei)return null;if(typeof Intl.Segmenter!="function")return Array.from(s).length===1?s:null;const a=new Intl.Segmenter(void 0,{granularity:"grapheme"}).segment(s)[Symbol.iterator]();return a.next().done||!a.next().done?null:s}const mt="wss://relay.yepanywhere.com/ws",Uc=/^[A-Za-z][A-Za-z0-9+.-]*:\/\//;function Fc(e){return Uc.test(e)?e:`wss://${e}`}function Bc(e){return e.replace(/\/+$/,"")||"/ws"}function Js(e){const s=e.trim();if(!s)throw new Error("Relay URL is required");let n;try{n=new URL(Fc(s))}catch{throw new Error("Relay URL must be a valid host or URL")}if(n.protocol==="https:"?n.protocol="wss:":n.protocol==="http:"&&(n.protocol="ws:"),n.protocol!=="ws:"&&n.protocol!=="wss:")throw new Error("Relay URL must use ws:// or wss://");if(!n.hostname)throw new Error("Relay URL must include a host");if(n.username||n.password)throw new Error("Relay URL must not include credentials");if(n.search||n.hash)throw new Error("Relay URL must not include query or hash");return n.pathname=Bc(n.pathname),n.toString()}const ct="https://yepanywhere.com/remote",Hc=/^[A-Za-z][A-Za-z0-9+.-]*:\/\//;function Wc(e){return Hc.test(e)?e:`https://${e}`}function $c(e){return e.replace(/\/+$/,"")}function ki(e){const s=$c(e);return s==="/"?"":s}function as(e){const s=e.trim();if(!s)throw new Error("YA URL is required");let n;try{n=new URL(Wc(s))}catch{throw new Error("YA URL must be a valid host or URL")}if(n.protocol!=="https:"&&n.protocol!=="http:")throw new Error("YA URL must use http:// or https://");if(!n.hostname)throw new Error("YA URL must include a host");if(n.username||n.password)throw new Error("YA URL must not include credentials");if(n.search||n.hash)throw new Error("YA URL must not include query or hash");const a=ki(n.pathname);return`${n.origin}${a}`}function _i(e,s){const n=as(e),a=new URL(n),i=ki(a.pathname),o=s.map(r=>encodeURIComponent(r));return a.pathname=[i,...o].filter(Boolean).join("/"),a.pathname.startsWith("/")||(a.pathname=`/${a.pathname}`),a.search="",a.hash="",a.toString()}function Sa(e){return _i(e,["login","relay"])}function Vc(e){return _i(e,["share"])}const Ls=30,Rs=300;function Os(e){if(!(typeof e!="number"||!Number.isFinite(e)))return Math.min(Rs,Math.max(0,Math.round(e)))}const ya=0,js=4,zc=1,Gc=24,Zt=-1,Ts=72;function Kc(e){return e<0?Zt:e}const Yc=10,Qc=1,Xc=100;function qc(e){return typeof e=="number"&&Number.isInteger(e)&&e>=Qc&&e<=Xc}const Mi=1;function ja(e,s){switch(e){case"auto":return s("themeAuto");case"light":return s("themeLight");case"dark":return s("themeDark");case"verydark":return s("themeVerydark")}}function Ta(e,s){switch(e){case"compact":return s("sidebarSpacingCompact");case"comfortable":return s("sidebarSpacingComfortable")}}function wa(e,s){switch(e){case"system":return s("outputProseFontSystem");case"inter":return s("outputProseFontInter");case"alegreya-sans":return s("outputProseFontAlegreyaSans");case"source-serif-4":return s("outputProseFontSourceSerif4")}}function Jc(e,s){switch(e){case"system":return s("outputFixedFontSystem");case"iosevka":return s("outputFixedFontIosevka");case"ibm-plex-mono":return s("outputFixedFontIbmPlexMono");case"fira-mono":return s("outputFixedFontFiraMono")}}function Ca(e,s){switch(e){case"en":return s("localeNameEn");case"zh-CN":return s("localeNameZhCn");case"es":return s("localeNameEs");case"fr":return s("localeNameFr");case"de":return s("localeNameDe");case"ja":return s("localeNameJa")}}function Zc(e){return[{id:"appearance",label:e("settingsAppearanceTitle"),description:e("settingsAppearanceDescription")},{id:"performance",label:e("settingsPerformanceTitle"),description:e("settingsPerformanceDescription")},{id:"toolbar",label:e("settingsToolbarTitle"),description:e("settingsToolbarDescription")},{id:"model",label:e("settingsModelTitle"),description:e("settingsModelDescription")},{id:"message-delivery",label:e("settingsMessageDeliveryTitle"),description:e("settingsMessageDeliveryDescription")},{id:"source-control",label:e("settingsSourceControlTitle"),description:e("settingsSourceControlDescription")},{id:"storage",label:e("settingsStorageTitle"),description:e("settingsStorageDescription")},{id:"agent-context",label:e("settingsAgentContextTitle"),description:e("settingsAgentContextDescription")},{id:"notifications",label:e("settingsNotificationsTitle"),description:e("settingsNotificationsDescription")},{id:"webhooks",label:e("settingsWebhooksTitle"),description:e("settingsWebhooksDescription")},{id:"devices",label:e("settingsDevicesTitle"),description:e("settingsDevicesDescription")},{id:"local-access",label:e("settingsLocalAccessTitle"),description:e("settingsLocalAccessDescription")},{id:"remote",label:e("settingsRemoteTitle"),description:e("settingsRemoteDescription")},{id:"providers",label:e("settingsProvidersTitle"),description:e("settingsProvidersDescription")},{id:"cache-miss-billing",label:e("settingsCacheMissBillingTitle"),description:e("settingsCacheMissBillingDescription")},{id:"speech",label:e("settingsSpeechTitle"),description:e("settingsSpeechDescription")},{id:"remote-executors",label:e("settingsRemoteExecutorsTitle"),description:e("settingsRemoteExecutorsDescription")},{id:"environment",label:e("settingsEnvironmentTitle"),description:e("settingsEnvironmentDescription")},{id:"development",label:e("settingsDevelopmentTitle"),description:e("settingsDevelopmentDescription")},{id:"about",label:e("settingsAboutTitle"),description:e("settingsAboutDescription")}]}function ed(e){return{id:"emulator",label:e("settingsEmulatorTitle"),description:e("settingsEmulatorDescription")}}const Us="yep-anywhere:remote-compatibility-dismissal-change",Fs=1440*60*1e3,td="1",sd="dismissed",ut="snooze-until:";function $t(e){const s=new Set,n=Date.now();for(const a of e)try{const i=window.localStorage.getItem(a);if(!i)continue;if(i===sd){const o=n+Fs;window.localStorage.setItem(a,`${ut}${o}`),s.add(a);continue}if(i===td){const o=n+Fs;window.localStorage.setItem(a,`${ut}${o}`),s.add(a);continue}if(i.startsWith(ut)){const o=Number(i.slice(ut.length));Number.isFinite(o)&&o>n?s.add(a):window.localStorage.removeItem(a)}}catch{}return s}function nd(e){const s=Date.now();let n=null;for(const a of e)try{const i=window.localStorage.getItem(a);if(!(i!=null&&i.startsWith(ut)))continue;const o=Number(i.slice(ut.length));if(!Number.isFinite(o)||o<=s)continue;n=n===null?o:Math.min(n,o)}catch{}return n}function Bs(e){window.dispatchEvent(new CustomEvent(Us,{detail:e}))}function ad(e){const s=e.map(n=>n.dismissKey);if(s.length!==0){for(const n of s)try{window.localStorage.removeItem(n)}catch{}Bs({keys:s,action:"restore"})}}function id(e){const s=l.useMemo(()=>e.map(p=>p.dismissKey),[e]),[n,a]=l.useState(()=>new Set),[i,o]=l.useState(()=>$t(s));l.useEffect(()=>{a(p=>new Set([...p].filter(c=>s.includes(c)))),o($t(s))},[s]),l.useEffect(()=>{const p=nd(s);if(p===null)return;const c=Math.max(0,p-Date.now()),x=setTimeout(()=>{o($t(s))},c);return()=>clearTimeout(x)},[s,i]),l.useEffect(()=>{const p=x=>{var v;const b=x.detail;(v=b==null?void 0:b.keys)!=null&&v.length&&(a(T=>{const I=new Set(T);for(const C of b.keys)s.includes(C)&&(b.action==="dismiss"?I.add(C):b.action==="restore"&&I.delete(C));return I}),o(T=>{const I=new Set(T);for(const C of b.keys)s.includes(C)&&(b.action==="snooze"?I.add(C):b.action==="restore"&&I.delete(C));return I}))},c=()=>{o($t(s))};return window.addEventListener(Us,p),window.addEventListener("storage",c),()=>{window.removeEventListener(Us,p),window.removeEventListener("storage",c)}},[s]);const r=l.useMemo(()=>e.filter(p=>!n.has(p.dismissKey)&&!i.has(p.dismissKey)),[e,n,i]),d=l.useMemo(()=>e.filter(p=>n.has(p.dismissKey)||i.has(p.dismissKey)),[e,n,i]),u=l.useCallback(p=>{a(c=>new Set([...c,p.dismissKey])),Bs({keys:[p.dismissKey],action:"dismiss"})},[]),h=l.useCallback(p=>{const c=`${ut}${Date.now()+Fs}`;try{window.localStorage.setItem(p.dismissKey,c)}catch{}o(x=>new Set([...x,p.dismissKey])),Bs({keys:[p.dismissKey],action:"snooze"})},[]),f=l.useCallback(p=>{ad(p)},[]);return{dismissNotice:u,dismissedNotices:d,restoreNotices:f,snoozeNotice:h,visibleNotices:r}}const Na="0.4.0",Ea=2,od="0.5.1",rd=3,ld="0.4.29",cd=0,dd=10,ht="npm update -g yepanywhere",ud=["git fetch origin","git merge origin/main","pnpm install","pnpm build"].join(`
7
+ `),pd="git fetch origin && git merge origin/main && pnpm install && pnpm build",ka={blocking:0,security:1,recommended:2,info:3};function md(e){if(!e.relayUsername)return[];const s=[],n=pt(e.currentVersion),a=hd(e),i=e.requiredRemoteCompatibilityLevel??cd,o=e.recommendedRemoteCompatibilityLevel??dd,r=e.resumeProtocolVersion!==void 0&&e.resumeProtocolVersion<Ea,d=e.resumeProtocolVersion===void 0&&Aa(e.currentVersion,Na),u=e.resumeProtocolVersion!==void 0&&e.resumeProtocolVersion>=Ea&&e.resumeProtocolVersion<rd;if(r||d){const p=ws(e.latestVersion,Na),c=gt(e,p.label);s.push({id:"relay-resume-security",severity:"blocking",title:"Server update required",body:"This hosted client requires current relay session-resume server verification. Update the local server, or use localhost, a tunnel, or a VPN with the old server.",guidance:c.text,versionSummary:Vt(e.currentVersion,p.label,e.installSource),action:c.action,dismissKey:ft(e,"relay-resume-security",(n==null?void 0:n.normalized)??(e.resumeProtocolVersion!==void 0?`resume-protocol-${e.resumeProtocolVersion}`:"unknown-version"))})}if(u){const p=ws(e.latestVersion,od),c=gt(e,p.label);s.push({id:"relay-resume-v3-grace",severity:"security",title:"Server update required soon",body:"This server uses the older relay session-resume protocol. Remote login still works during the compatibility window, but update the YA server soon; future hosted clients will require the newer server-verification protocol for security.",guidance:c.text,versionSummary:Vt(e.currentVersion,p.label,e.installSource),action:c.action,dismissKey:ft(e,"relay-resume-v3-grace",(n==null?void 0:n.normalized)??"resume-protocol-2")})}if(a<i){const p=gt(e,`compatibility level ${i}`),c=`remote-compat-required-${i}`;s.push({id:c,severity:"blocking",title:"Server update required",body:"This hosted client requires a newer YA server compatibility level for basic remote use. Update the local server, or use localhost, a tunnel, or a VPN with the old server.",guidance:p.text,versionSummary:Ma(a,i,"required"),action:p.action,dismissKey:ft(e,c,`${a}-to-${i}`)})}else if(a<o){const p=gt(e,`compatibility level ${o}`),c=`remote-compat-level-${o}`;s.push({id:c,severity:"recommended",title:"Update local server soon",body:"This hosted client is newer than your local YA server. Basic remote use should still work, but update the server soon to avoid missing or unstable newer remote features.",guidance:p.text,versionSummary:Ma(a,o),action:p.action,dismissKey:ft(e,c,`${a}-to-${o}`)})}const h=e.recommendedBaselineVersion??ld;if(Aa(e.currentVersion,h)){const p=`backend-api-compat-${h}`,c=ws(e.latestVersion,h),x=gt(e,c.label);s.push({id:p,severity:"recommended",title:"Update recommended",body:"This hosted client includes backend/API compatibility changes. Basic remote use should still work, but updating the local server is recommended for this release.",guidance:x.text,versionSummary:Vt(e.currentVersion,c.label,e.installSource),action:x.action,dismissKey:ft(e,p,`${(n==null?void 0:n.normalized)??"unknown-version"}-to-${h}`)})}if(!s.some(p=>p.id.startsWith("backend-api-compat-")||p.id.startsWith("remote-compat-")||p.id==="relay-resume-security"||p.id==="relay-resume-v3-grace")&&e.updateAvailable&&e.latestVersion){const p=is(e.latestVersion),c=gt(e,p);s.push({id:"remote-update-available",severity:"recommended",title:"Update available",body:`Yep Anywhere ${p} is available for this server.`,guidance:c.text,versionSummary:Vt(e.currentVersion,p,e.installSource,"latest"),action:c.action,dismissKey:ft(e,"remote-update-available",`${(n==null?void 0:n.normalized)??e.currentVersion??"unknown-version"}-to-${e.latestVersion}`)})}return s.sort((p,c)=>{const x=ka[p.severity]-ka[c.severity];if(x!==0)return x;const b=_a(p.id)-_a(c.id);return b!==0?b:p.id.localeCompare(c.id)})}function _a(e){return e==="relay-resume-security"||e==="relay-resume-v3-grace"?0:e.startsWith("remote-compat-")?1:e.startsWith("backend-api-compat-")?2:e==="remote-update-available"?3:4}function hd(e){const s=e.remoteCompatibilityLevel;return typeof s=="number"&&Number.isSafeInteger(s)&&s>=0?s:0}function ws(e,s){const n=Di(e,s);return e&&n!==null&&n>=0?{label:is(e),version:e}:{label:`${is(s)}+`,version:s}}function Ma(e,s,n="recommended"){return`Compatibility level ${e}; ${n} ${s}`}function Vt(e,s,n,a="recommended"){return`Server ${Ai(e,n)}; ${a} ${s}`}function Ai(e,s){return pt(e)?is(e??""):s==="source"?"source checkout (version unknown)":"version unknown"}function gt(e,s){const n=gd(e);return n==="source"?{text:`Source checkout detected. Merge origin/main, run pnpm install and pnpm build, then restart the server to update to ${s}.`,action:{label:"Copy source steps",command:ud,commandPreview:pd}}:n==="npm-global"?{text:`Run ${ht} on the host, then restart the server to update to ${s}.`,action:{label:"Copy npm command",command:ht,commandPreview:ht}}:{text:`Update the host install, then restart the server to update to ${s}. If this host was installed with npm, run ${ht}.`,action:{label:"Copy npm command",command:ht,commandPreview:ht}}}function gd(e){var s;return e.installSource?e.installSource:(s=pt(e.currentVersion))!=null&&s.sourceBuild?"source":"unknown"}function is(e){return e.startsWith("v")?e:`v${e}`}function Aa(e,s){const n=Di(e,s);return n!==null&&n<0}function Di(e,s){const n=pt(e),a=pt(s);if(!n||!a)return null;for(const i of["major","minor","patch"])if(n[i]!==a[i])return n[i]<a[i]?-1:1;return n.prerelease===a.prerelease?0:n.sourceBuild?1:a.sourceBuild?-1:n.prerelease===null?1:a.prerelease===null||n.prerelease<a.prerelease?-1:1}function pt(e){const s=e==null?void 0:e.trim().replace(/^v/,"");if(!s)return null;const n=s.match(/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/);if(!n)return null;const a=n[1],i=n[2],o=n[3];if(a===void 0||i===void 0||o===void 0)return null;const r=n[4],d=/^\d+-g[0-9a-f]+$/iu.test(r??"");return{major:Number.parseInt(a,10),minor:Number.parseInt(i,10),patch:Number.parseInt(o,10),prerelease:r??null,sourceBuild:d,stable:r===void 0,normalized:`${a}.${i}.${o}${r?`-${r}`:""}`}}function ft(e,s,n){var i;return`remote-notice-dismissed:${((i=e.installId)==null?void 0:i.trim())||(e.relayUsername?`relay-${e.relayUsername}`:"unknown-server")}:${s}:${n}`}const fd="_root_6tif2_1",bd="_floating_6tif2_14",xd="_inline_6tif2_23",vd="_critical_6tif2_28",Sd="_content_6tif2_33",yd="_headline_6tif2_42",jd="_title_6tif2_50",Td="_meta_6tif2_55",wd="_body_6tif2_61",Cd="_guidance_6tif2_68",Nd="_count_6tif2_75",Ed="_actions_6tif2_84",kd="_commandField_6tif2_91",_d="_commandInput_6tif2_98",Md="_commandInputMulti_6tif2_110",Ad="_copyButton_6tif2_114",Dd="_copied_6tif2_128",Pd="_button_6tif2_132",Id="_buttonPrimary_6tif2_149",ye={root:fd,floating:bd,inline:xd,critical:vd,content:Sd,headline:yd,title:jd,meta:Td,body:wd,guidance:Cd,count:Nd,actions:Ed,commandField:kd,commandInput:_d,commandInputMulti:Md,copyButton:Ad,copied:Dd,button:Pd,buttonPrimary:Id},Ld={floating:ye.floating,inline:ye.inline},Rd={info:void 0,recommended:void 0,security:ye.critical,blocking:ye.critical};function Od({notice:e,noticeCount:s=1,placement:n,onDismiss:a,onRestore:i,onSnooze:o}){var u;const r=e.action,d=r!=null&&r.command?{command:r.command,label:r.label,lines:r.command.split(`
8
+ `).length}:null;return t.jsxs("section",{className:[ye.root,Ld[n],Rd[e.severity]].filter(Boolean).join(" "),role:e.severity==="security"||e.severity==="blocking"?"alert":"status","data-testid":"remote-compatibility-notice",children:[t.jsxs("div",{className:ye.content,children:[t.jsxs("div",{className:ye.headline,children:[t.jsx("strong",{className:ye.title,children:e.title}),e.versionSummary&&t.jsx("span",{className:ye.meta,children:e.versionSummary}),s>1&&t.jsxs("span",{className:ye.count,children:[s," notices"]})]}),t.jsx("span",{className:ye.body,children:e.body}),e.guidance&&t.jsx("span",{className:ye.guidance,children:e.guidance}),d&&t.jsxs("div",{className:ye.commandField,children:[d.lines>1?t.jsx("textarea",{className:`${ye.commandInput} ${ye.commandInputMulti}`,value:d.command,readOnly:!0,rows:Math.min(d.lines,4),"aria-label":`${d.label} text`,onFocus:h=>h.currentTarget.select()}):t.jsx("input",{className:ye.commandInput,value:d.command,readOnly:!0,"aria-label":`${d.label} text`,onFocus:h=>h.currentTarget.select()}),t.jsx(Yr,{text:d.command,label:d.label,copiedLabel:"Copied",className:ye.copyButton,copiedClassName:ye.copied})]})]}),t.jsxs("div",{className:ye.actions,children:[((u=e.action)==null?void 0:u.href)&&t.jsx("a",{className:`${ye.button} ${ye.buttonPrimary}`,href:e.action.href,children:e.action.label}),i&&t.jsx("button",{type:"button",className:`${ye.button} ${ye.buttonPrimary}`,onClick:i,children:"Show reminder"}),a&&t.jsx("button",{type:"button",className:ye.button,onClick:a,children:"Dismiss"}),o&&e.severity!=="info"&&t.jsx("button",{type:"button",className:ye.button,onClick:o,children:"Remind me later"})]})]})}let lt=null;function Ud(){const[e,s]=l.useState(!1),[n,a]=l.useState(!1);l.useEffect(()=>{if(window.matchMedia("(display-mode: standalone)").matches||"standalone"in navigator&&navigator.standalone===!0){a(!0);return}lt&&s(!0);const r=u=>{u.preventDefault(),lt=u,s(!0)},d=()=>{a(!0),s(!1),lt=null};return window.addEventListener("beforeinstallprompt",r),window.addEventListener("appinstalled",d),()=>{window.removeEventListener("beforeinstallprompt",r),window.removeEventListener("appinstalled",d)}},[]);const i=l.useCallback(async()=>{if(!lt)return!1;await lt.prompt();const{outcome:o}=await lt.userChoice;return o==="accepted"?(s(!1),lt=null,!0):!1},[]);return{canInstall:e,isInstalled:n,install:i}}function Pi(e){return e.trim().toLowerCase().split(/\s+/).filter(Boolean)}function Zs(e,s){const n=Pi(e);if(n.length===0)return!1;const a=s.filter(i=>!!i).map(i=>i.toLowerCase());return a.length===0?!1:n.every(i=>a.some(o=>o.includes(i)))}function Fd(e,s){const n=Pi(s),a=e.toLowerCase(),i=[];for(const u of n){let h=0;for(;h<=a.length-u.length;){const f=a.indexOf(u,h);if(f<0)break;i.push([f,f+u.length]),h=f+1}}if(i.length===0)return[{text:e,match:!1}];i.sort((u,h)=>u[0]-h[0]||u[1]-h[1]);const o=[];for(const[u,h]of i){const f=o[o.length-1];f&&u<=f[1]?f[1]=Math.max(f[1],h):o.push([u,h])}const r=[];let d=0;for(const[u,h]of o)u>d&&r.push({text:e.slice(d,u),match:!1}),r.push({text:e.slice(u,h),match:!0}),d=h;return d<e.length&&r.push({text:e.slice(d),match:!1}),r}function Bd(e){return e.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"")}const Ii=l.createContext(null),en=Ii.Provider;function cs(){return l.useContext(Ii)}const Li=l.createContext(null),Da=Li.Provider;function Hd(){return l.useContext(Li)}function St(e,s){const n=Fd(e,s);return n.some(a=>a.match)?n.map((a,i)=>a.match?t.jsx("mark",{className:"settings-search-mark",children:a.text},i):t.jsx(l.Fragment,{children:a.text},i)):e}function we({children:e}){const s=cs();return s&&!s.sectionMatched?null:t.jsx(t.Fragment,{children:e})}const Wd=1800;function $d(){var e;return typeof window<"u"&&!!((e=window.matchMedia)!=null&&e.call(window,"(prefers-reduced-motion: reduce)").matches)}function w({id:e,as:s="div",title:n,label:a,description:i,keywords:o,valueText:r,className:d,baseClassName:u="settings-item",layout:h="standard",containerProps:f,info:p,children:c,after:x,searchable:b=!0}){const{t:v}=K(),T=cs(),I=Hd(),C=e??Bd(a),O=l.useRef(null),k=l.useCallback($=>{O.current=$},[]),[y,S]=l.useState(!1),m=!T&&(I==null?void 0:I.target)===C,_=I==null?void 0:I.consume;if(l.useEffect(()=>{var $;!m||!_||(_(),($=O.current)==null||$.scrollIntoView({block:"center",behavior:$d()?"auto":"smooth"}),S(!0))},[m,_]),l.useEffect(()=>{if(!y)return;const $=setTimeout(()=>S(!1),Wd);return()=>clearTimeout($)},[y]),T&&!b)return null;const A=T?T.sectionMatched||Zs(T.query,[a,i,...o??[],...T.matchValues&&r?[r]:[]]):!1;if(T&&!A)return null;const P=p??(T?t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:St(a,T.query)}),i&&t.jsx("p",{children:St(i,T.query)})]}):t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:a}),i&&t.jsx("p",{children:i})]})),M=T?T.sectionTitle?`${T.categoryLabel} › ${T.sectionTitle}`:T.categoryLabel:null,R=[u,d,h==="custom"?"settings-item--custom-layout":null,T?"settings-search-match":null,y?"settings-item--jump-flash":null].filter(Boolean).join(" "),N=t.jsxs(t.Fragment,{children:[t.jsx(s,{...f,className:R,"data-settings-item":C,title:n,ref:k,children:h==="custom"?t.jsxs(t.Fragment,{children:[c,T&&M&&t.jsxs("button",{type:"button",className:"settings-search-origin","aria-label":v("settingsSearchJumpTo",{location:M}),onClick:()=>T.jumpToItem(C),children:[M," ›"]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"settings-item-info",children:[P,T&&M&&t.jsxs("button",{type:"button",className:"settings-search-origin","aria-label":v("settingsSearchJumpTo",{location:M}),onClick:()=>T.jumpToItem(C),children:[M," ›"]})]}),c]})}),x]});return T&&A&&!T.sectionMatched?t.jsx(en,{value:{...T,sectionMatched:!0},children:N}):N}const Ri=l.createContext(null),Hs=Ri.Provider;function _e(e){const s=l.useContext(Ri);l.useEffect(()=>{if(s)return s(e),()=>s(null)},[s,e])}function Vd(){const[e,s]=l.useState(null);return{title:e,setTitle:s}}function oe({title:e,description:s,keywords:n,className:a,children:i}){const o=cs(),r=o?o.sectionMatched||Zs(o.query,[e,s,...n??[]]):!1,d=l.useMemo(()=>o?{...o,sectionMatched:r,sectionTitle:e??o.sectionTitle}:null,[o,r,e]),u=["settings-section",a,o&&r?"settings-search-section-match":null].filter(Boolean).join(" "),h=t.jsxs("section",{className:u,children:[e&&t.jsx("h2",{children:o?St(e,o.query):e}),s&&t.jsx("p",{className:"settings-section-description",children:o?St(s,o.query):s}),i]});return d?t.jsx(en,{value:d,children:h}):h}function Cs(e){if(typeof e!="string")return;const s=e.trim();return s&&s!=="unknown"?s:void 0}function zd(){if(typeof window>"u")return null;const e=window.__YEP_DESKTOP_RUNTIME__;if(!e||typeof e!="object")return null;const s=e,n=Cs(s.desktopVersion);return n?{desktopVersion:n,bundledYaVersion:Cs(s.bundledYaVersion),commit:Cs(s.commit)}:null}function Pa(e){const s=e.trim();return/^v\d+\.\d+\.\d+/.test(s)?s:/^\d+\.\d+\.\d+/.test(s)?`v${s}`:s}function Gd(){const{t:e}=K();_e(e("aboutTitle"));const{canInstall:s,isInstalled:n,install:a}=Ud(),{version:i,loading:o,error:r,refetchFresh:d}=We({freshOnMount:!0}),u=At(),{resetOnboarding:h}=el(),f=zd(),p=(u==null?void 0:u.currentRelayUsername)??null,c=l.useCallback(P=>P?md({currentVersion:(P==null?void 0:P.current)??null,latestVersion:(P==null?void 0:P.latest)??null,updateAvailable:(P==null?void 0:P.updateAvailable)??!1,installSource:P==null?void 0:P.installSource,resumeProtocolVersion:P==null?void 0:P.resumeProtocolVersion,remoteCompatibilityLevel:P==null?void 0:P.remoteCompatibilityLevel,capabilities:P==null?void 0:P.capabilities,relayUsername:p}):[],[p]),x=l.useMemo(()=>c(i),[c,i]),b=x[0],{dismissedNotices:v,restoreNotices:T,visibleNotices:I}=id(x),C=I.length===0?v[0]:null,[O,k]=l.useState(!1),[y,S]=l.useState(0);l.useEffect(()=>(ze("/status/workers").then(P=>S(ra(P))).catch(()=>{}),Je.on("worker-activity-changed",P=>{S(ra(P))})),[]),l.useEffect(()=>{if(O)return Je.on("reconnect",()=>{k(!1)})},[O]);const m=l.useCallback(async()=>{k(!0);try{await he.restartServer()}catch{}},[]),_=l.useCallback(()=>{T(x)},[x,T]),A=l.useCallback(async()=>{const P=await d();T(c(P??i))},[c,d,T,i]);return t.jsx(oe,{children:t.jsxs("div",{className:"settings-group",children:[(s||n)&&t.jsx(w,{label:e("aboutInstallTitle"),description:e(n?"aboutInstalledDescription":"aboutInstallDescription"),children:n?t.jsx("span",{className:"settings-status-badge",children:e("aboutInstalled")}):t.jsx("button",{type:"button",className:"settings-button",onClick:a,children:e("aboutInstall")})}),t.jsx(we,{children:t.jsxs("div",{className:"settings-item settings-version-item",children:[t.jsxs("div",{className:"settings-version-item__row",children:[t.jsxs("div",{className:"settings-item-info",children:[t.jsx("strong",{children:e("aboutVersionTitle")}),f?t.jsxs(t.Fragment,{children:[t.jsxs("p",{children:[e("aboutDesktopVersion")," ",Pa(f.desktopVersion)]}),t.jsxs("p",{children:[e("aboutBundledYaVersion")," ",Pa(f.bundledYaVersion??"0.8.0")]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("p",{children:[e("aboutServerVersion")," ",i?t.jsxs(t.Fragment,{children:[Ai(i.current,i.installSource),pt(i.current)&&i.updateAvailable&&i.latest?t.jsxs("span",{className:"settings-update-available",children:[" ",e("aboutVersionAvailable",{version:i.latest})]}):pt(i.current)&&i.latest?t.jsxs("span",{className:"settings-up-to-date",children:[" ",e("aboutUpToDate")]}):null]}):e("loginLoading")]}),t.jsxs("p",{children:[e("aboutClientVersion")," v","0.8.0"]})]}),r&&t.jsx("p",{className:"settings-warning",children:e("aboutUnableRefresh")}),(i==null?void 0:i.updateAvailable)&&!b&&t.jsx("p",{className:"settings-update-hint",children:e("aboutUpdateHint")})]}),t.jsx("div",{className:"settings-item-actions",children:t.jsx("button",{type:"button",className:"settings-button",onClick:()=>void A(),disabled:o,children:e(o?"aboutChecking":"aboutCheckUpdates")})})]}),C&&t.jsx(Od,{notice:C,noticeCount:x.length,placement:"inline",onRestore:_})]})}),t.jsx(w,{label:e("developmentRestartTitle"),description:e("developmentRestartDescription"),info:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:e("developmentRestartTitle")}),t.jsx("p",{children:e("developmentRestartDescription")}),y>0&&!O&&t.jsx("p",{className:"settings-warning",children:e("developmentInterruptedWarning",{count:y,suffix:y!==1?"s ":" "})})]}),children:t.jsx("button",{type:"button",className:`settings-button ${y>0?"settings-button-danger":""}`,onClick:m,disabled:O,children:O?e("developmentRestarting"):y>0?e("developmentRestartAnyway"):e("developmentRestart")})}),t.jsx(w,{label:e("aboutReportBugTitle"),description:e("aboutReportBugDescription"),children:t.jsx("a",{href:"https://github.com/kzahel/yepanywhere/issues",target:"_blank",rel:"noopener noreferrer",className:"settings-button",children:e("aboutReportBug")})}),t.jsx(w,{label:e("aboutSetupWizardTitle"),description:e("aboutSetupWizardDescription"),children:t.jsx("button",{type:"button",className:"settings-button",onClick:h,children:e("aboutLaunchWizard")})})]})})}const Oi=l.createContext(null),Ws=Oi.Provider;function tn(e,s){const n=l.useContext(Oi),a=l.useMemo(()=>e?{canUndo:e,undo:s}:null,[e,s]);l.useEffect(()=>{if(n)return n(a),()=>n(null)},[n,a])}function Kd(){const[e,s]=l.useState(null);return{registration:e,setRegistration:s}}function Yd(e,s){return JSON.stringify(e)===JSON.stringify(s)}function $e(e,s,n=Yd){const a=l.useRef(null);a.current===null&&e!=null&&(a.current=e);const i=a.current,o=i!=null&&e!=null&&!n(e,i),r=l.useCallback(()=>{const d=a.current;if(d!=null)return s(d)},[s]);tn(o,r)}const Ia=1e4,bt=ol,es=il;function La(e){const s=Number.parseInt(e,10);return Number.isFinite(s)&&s>=1?Math.min(s,1440):es}function Qd(){var $;const{t:e}=K();_e(e("agentContextTitle"));const{settings:s,isLoading:n,error:a,updateSettings:i}=Ce(),[o,r]=l.useState(""),[d,u]=l.useState(String(es)),[h,f]=l.useState(bt),[p,c]=l.useState(!1),[x,b]=l.useState(!1),[v,T]=l.useState(!1),[I,C]=l.useState(null),[O,k]=l.useState(!1);l.useEffect(()=>{var D;s&&(r(s.globalInstructions??""),u(String(s.heartbeatTurnsAfterMinutes??es)),f(s.heartbeatTurnText??bt),c(((D=s.agentContextHints)==null?void 0:D.latexMathRendering)??!1),k(!0))},[s]);const y=(s==null?void 0:s.globalInstructions)??"",S=(s==null?void 0:s.heartbeatTurnsAfterMinutes)??es,m=(s==null?void 0:s.heartbeatTurnText)??bt,_=(($=s==null?void 0:s.agentContextHints)==null?void 0:$.latexMathRendering)??!1,A=l.useMemo(()=>Pc({globalInstructions:o,hints:{latexMathRendering:p}}),[o,p]),P=l.useMemo(()=>O?{instructions:o,heartbeatTurnsAfterMinutes:d,heartbeatTurnText:h,latexMathRendering:p}:null,[O,o,d,h,p]),M=l.useCallback(D=>{r(D.instructions),u(D.heartbeatTurnsAfterMinutes),f(D.heartbeatTurnText),c(D.latexMathRendering),T(!1),C(null),i({globalInstructions:D.instructions.trim()||void 0,heartbeatTurnsAfterMinutes:La(D.heartbeatTurnsAfterMinutes),heartbeatTurnText:D.heartbeatTurnText.trim()||bt,agentContextHints:{latexMathRendering:D.latexMathRendering}}).catch(()=>{})},[i]);$e(P,M);const R=l.useCallback(D=>{const L=D.instructions??o,F=D.heartbeatTurnsAfterMinutes??d,E=D.heartbeatTurnText??h,V=D.latexMathRendering??p;T(L!==y||F!==String(S)||E!==m||V!==_)},[h,d,o,p,m,S,y,_]),N=l.useCallback(async()=>{b(!0),C(null);try{await i({globalInstructions:o.trim()||void 0,heartbeatTurnsAfterMinutes:La(d),heartbeatTurnText:h.trim()||bt,agentContextHints:{latexMathRendering:p}}),T(!1)}catch(D){C(D instanceof Error?D.message:e("agentContextSaveFailed"))}finally{b(!1)}},[h,d,o,p,e,i]);return n?t.jsx(oe,{description:e("agentContextLoading")}):t.jsxs(oe,{description:e("agentContextDescription"),keywords:[e("agentContextGlobalInstructions"),e("agentContextGlobalInstructionsDescription"),e("agentContextSuggestedLatexTitle"),e("agentContextSuggestedLatexDescription"),e("agentContextHeartbeatAfterTitle"),e("agentContextHeartbeatAfterDescription"),e("agentContextHeartbeatTextTitle"),e("agentContextHeartbeatTextDescription")],children:[t.jsxs("div",{className:"settings-group",children:[t.jsxs(w,{label:e("agentContextGlobalInstructions"),description:e("agentContextGlobalInstructionsDescription"),layout:"custom",containerProps:{style:{flexDirection:"column",alignItems:"stretch"}},children:[t.jsxs("div",{className:"settings-item-info",children:[t.jsx("strong",{children:e("agentContextGlobalInstructions")}),t.jsx("p",{children:e("agentContextGlobalInstructionsDescription")})]}),t.jsx("textarea",{className:"settings-textarea",value:o,onChange:D=>{const L=D.target.value.slice(0,Ia);r(L),R({instructions:L}),C(null)},placeholder:e("agentContextPlaceholder"),rows:10}),t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:"var(--space-2)"},children:[t.jsx("span",{className:"settings-hint",children:e("agentContextCharacters",{current:o.length.toLocaleString(),max:Ia.toLocaleString()})}),t.jsx("button",{type:"button",className:"settings-button",disabled:!v||x,onClick:N,children:e(x?"providersSaving":"providersSave")})]})]}),t.jsx(we,{children:t.jsxs("div",{className:"settings-subsection-heading",children:[t.jsx("strong",{children:e("agentContextSuggestedHintsTitle")}),t.jsx("p",{children:e("agentContextSuggestedHintsDescription")})]})}),t.jsxs(w,{as:"label",label:e("agentContextSuggestedLatexTitle"),description:e("agentContextSuggestedLatexDescription"),layout:"custom",children:[t.jsxs("div",{className:"settings-item-info",children:[t.jsx("strong",{children:e("agentContextSuggestedLatexTitle")}),t.jsx("p",{children:e("agentContextSuggestedLatexDescription")})]}),t.jsx("input",{type:"checkbox",checked:p,onChange:D=>{const L=D.target.checked;c(L),R({latexMathRendering:L}),C(null)},"aria-label":e("agentContextSuggestedLatexTitle")})]}),t.jsxs(we,{children:[t.jsxs("div",{className:"settings-item",style:{flexDirection:"column",alignItems:"stretch"},children:[t.jsxs("div",{className:"settings-item-info",children:[t.jsx("strong",{children:e("agentContextSuggestedLatexPreviewTitle")}),t.jsx("p",{children:e("agentContextSuggestedLatexPreviewDescription")})]}),t.jsx("pre",{className:"settings-command-preview",children:`[Client capabilities]
9
+ ${wi}`})]}),t.jsxs("details",{children:[t.jsx("summary",{className:"settings-hint",children:e("agentContextPreviewSummary")}),t.jsx("pre",{className:"settings-command-preview",children:A??e("agentContextPreviewEmpty")})]})]})]}),t.jsxs("div",{className:"settings-group",children:[t.jsx(w,{label:e("agentContextHeartbeatAfterTitle"),description:e("agentContextHeartbeatAfterDescription"),children:t.jsx("input",{type:"number",className:"settings-input-small",min:1,max:1440,value:d,onChange:D=>{u(D.target.value),R({heartbeatTurnsAfterMinutes:D.target.value}),C(null)}})}),t.jsxs(w,{label:e("agentContextHeartbeatTextTitle"),description:e("agentContextHeartbeatTextDescription"),layout:"custom",containerProps:{style:{flexDirection:"column",alignItems:"stretch"}},children:[t.jsxs("div",{className:"settings-item-info",children:[t.jsx("strong",{children:e("agentContextHeartbeatTextTitle")}),t.jsx("p",{children:e("agentContextHeartbeatTextDescription")})]}),t.jsx(rl,{className:"settings-input",value:h,onChange:D=>{f(D),R({heartbeatTurnText:D}),C(null)},placeholder:bt})]})]}),t.jsx(we,{children:(I||a)&&t.jsx("p",{className:"settings-warning",children:I||a})})]})}const Xd=["flat","flat-white","emoji"],Ui="flat",$s=new Set;function Fi(){return typeof globalThis.localStorage>"u"||typeof globalThis.localStorage.getItem!="function"?null:globalThis.localStorage}function qd(e){return e==="flat"||e==="flat-white"||e==="emoji"}function Jd(){const e=Fi(),s=(e==null?void 0:e.getItem(U.settingsIconStyle))??null;if(qd(s))return s;const n=e==null?void 0:e.getItem(U.flatSettingsIcons);return n==="true"?"flat":n==="false"?"emoji":Ui}function Zd(e){var n;const s=Fi();!s||typeof s.setItem!="function"||(s.setItem(U.settingsIconStyle,e),(n=s.removeItem)==null||n.call(s,U.flatSettingsIcons))}function eu(e){return $s.add(e),()=>$s.delete(e)}function tu(){return Jd()}function su(){for(const e of $s)e()}function nu(e){Zd(e),su()}function Bi(){const e=l.useSyncExternalStore(eu,tu,()=>Ui),s=l.useCallback(nu,[]);return{settingsIconStyle:e,setSettingsIconStyle:s}}const au={width:22,height:22,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};function ke(e){const{children:s,...n}=e;return t.jsx("svg",{...au,"aria-hidden":"true",...n,children:s})}const Hi={appearance:"🎨",performance:"⚡",toolbar:"🎛️",model:"🧠","cache-miss-billing":"🧾","message-delivery":"📨","source-control":"🔎",storage:"🗄️","agent-context":"📋",notifications:"🔔",webhooks:"🪝",devices:"📱","local-access":"🔒",remote:"🌐",providers:"🔌",speech:"🎙️","remote-executors":"🖥️",environment:"⚙️",about:"ℹ️",emulator:"🤖",development:"🛠️"},Wi={appearance:t.jsxs(ke,{strokeWidth:2.5,children:[t.jsx("rect",{x:"2",y:"2",width:"20",height:"20",rx:"3"}),t.jsx("text",{x:"3.5",y:"13",fontSize:"15",fontWeight:"700",fill:"currentColor",stroke:"none",fontFamily:"system-ui, -apple-system, BlinkMacSystemFont, sans-serif",children:"A"}),t.jsx("rect",{x:"17",y:"4",width:"5",height:"5",rx:"1",fill:"#15803d"}),t.jsx("rect",{x:"17",y:"10",width:"5",height:"5",rx:"1",fill:"#1e40af"}),t.jsx("rect",{x:"17",y:"16",width:"5",height:"5",rx:"1",fill:"#b91c1c"})]}),performance:t.jsxs(ke,{strokeWidth:2.5,children:[t.jsx("path",{d:"M4 15a8 8 0 0 1 16 0"}),t.jsx("path",{d:"M6.5 18h11"}),t.jsx("path",{d:"m12 14 4-5"}),t.jsx("path",{d:"M12 14h.01"}),t.jsx("path",{d:"M7.8 10.8 6.4 9.4"}),t.jsx("path",{d:"M16.2 10.8 17.6 9.4"})]}),model:t.jsxs(ke,{strokeWidth:2.5,children:[t.jsx("path",{d:"M12 18V5"}),t.jsx("path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4"}),t.jsx("path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5"}),t.jsx("path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77"}),t.jsx("path",{d:"M18 18a4 4 0 0 0 2-7.464"}),t.jsx("path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517"}),t.jsx("path",{d:"M6 18a4 4 0 0 1-2-7.464"}),t.jsx("path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77"})]}),toolbar:t.jsxs(ke,{children:[t.jsx("rect",{x:"2",y:"9",width:"20",height:"6",rx:"2"}),t.jsx("circle",{cx:"7",cy:"12",r:"0.8",fill:"currentColor"}),t.jsx("circle",{cx:"12",cy:"12",r:"0.8",fill:"currentColor"}),t.jsx("circle",{cx:"17",cy:"12",r:"0.8",fill:"currentColor"})]}),"cache-miss-billing":t.jsxs(ke,{children:[t.jsx("path",{d:"M5 3v18l2-1 2 1 2-1 2 1 2-1 2 1 2-1V3Z"}),t.jsx("path",{d:"M8 7h8"}),t.jsx("path",{d:"M8 11h5"}),t.jsx("path",{d:"m15 11 2 2 2-2"}),t.jsx("path",{d:"m17 13V8"}),t.jsx("path",{d:"M8 16h4"})]}),"message-delivery":t.jsxs(ke,{children:[t.jsx("path",{d:"M22 2 11 13"}),t.jsx("path",{d:"m22 2-7 20-4-9-9-4Z"})]}),"source-control":t.jsxs(ke,{children:[t.jsx("circle",{cx:"10",cy:"10",r:"6"}),t.jsx("path",{d:"m14.5 14.5 5 5"}),t.jsx("path",{d:"M7 10h6"})]}),storage:t.jsxs(ke,{children:[t.jsx("ellipse",{cx:"12",cy:"5",rx:"8",ry:"3"}),t.jsx("path",{d:"M4 5v7c0 1.7 3.6 3 8 3s8-1.3 8-3V5"}),t.jsx("path",{d:"M4 12v7c0 1.7 3.6 3 8 3s8-1.3 8-3v-7"})]}),"agent-context":t.jsxs(ke,{children:[t.jsx("rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1"}),t.jsx("path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}),t.jsx("path",{d:"M12 11h4"}),t.jsx("path",{d:"M12 16h4"}),t.jsx("path",{d:"M8 11h.01"}),t.jsx("path",{d:"M8 16h.01"})]}),notifications:t.jsxs(ke,{children:[t.jsx("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),t.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]}),webhooks:t.jsxs(ke,{children:[t.jsx("path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2"}),t.jsx("path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06"}),t.jsx("path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8"})]}),devices:t.jsxs(ke,{children:[t.jsx("rect",{x:"7",y:"2",width:"10",height:"20",rx:"2",ry:"2"}),t.jsx("line",{x1:"12",y1:"18",x2:"12.01",y2:"18"})]}),"local-access":t.jsxs(ke,{children:[t.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"}),t.jsx("path",{d:"M5 11h14v11H5V11z M10.5 15a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0z M11.25 17.5h1.5v3h-1.5z",fill:"currentColor",fillRule:"evenodd"})]}),remote:t.jsxs(ke,{children:[t.jsx("circle",{cx:"12",cy:"12",r:"9"}),t.jsx("path",{d:"M12 3v18"}),t.jsx("path",{d:"M3 12h18"}),t.jsx("path",{d:"M5.5 7.5c2.5 1 11 1 13 0"}),t.jsx("path",{d:"M5.5 16.5c2.5-1 11-1 13 0"})]}),providers:t.jsxs(ke,{children:[t.jsx("rect",{x:"6",y:"8",width:"12",height:"6",rx:"1"}),t.jsx("line",{x1:"9",y1:"8",x2:"9",y2:"3"}),t.jsx("line",{x1:"15",y1:"8",x2:"15",y2:"3"}),t.jsx("path",{d:"M12 14v5"}),t.jsx("path",{d:"M8 19h8"})]}),speech:t.jsxs(ke,{children:[t.jsx("path",{d:"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"}),t.jsx("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),t.jsx("line",{x1:"12",y1:"19",x2:"12",y2:"23"}),t.jsx("path",{d:"M8 23h8"})]}),"remote-executors":t.jsxs(ke,{children:[t.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),t.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),t.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]}),environment:t.jsxs(ke,{children:[t.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),t.jsx("path",{d:"M6 9l3 3-3 3"}),t.jsx("line",{x1:"12",y1:"15",x2:"17",y2:"15"})]}),about:t.jsxs(ke,{children:[t.jsx("circle",{cx:"12",cy:"12",r:"10"}),t.jsx("path",{d:"M12 16v-4"}),t.jsx("path",{d:"M12 8h.01"})]}),emulator:t.jsxs(ke,{children:[t.jsx("rect",{x:"5",y:"6",width:"14",height:"10",rx:"2"}),t.jsx("circle",{cx:"9",cy:"10",r:"1.4",fill:"currentColor"}),t.jsx("circle",{cx:"15",cy:"10",r:"1.4",fill:"currentColor"}),t.jsx("path",{d:"M8 14h8"}),t.jsx("line",{x1:"7",y1:"6",x2:"5",y2:"3"}),t.jsx("line",{x1:"17",y1:"6",x2:"19",y2:"3"}),t.jsx("circle",{cx:"5",cy:"3",r:"0.8",fill:"currentColor"}),t.jsx("circle",{cx:"19",cy:"3",r:"0.8",fill:"currentColor"})]}),development:t.jsxs(ke,{children:[t.jsx("path",{d:"M14.5 6.5l3 3-7 7-3-3 7-7z"}),t.jsx("path",{d:"M17 3l4 4M3 17l4 4"}),t.jsx("path",{d:"M10 14l-1.5 1.5"}),t.jsx("circle",{cx:"18",cy:"6",r:"1.5",fill:"currentColor"})]})};function iu({id:e}){const{settingsIconStyle:s}=Bi(),n=s==="emoji"?Hi[e]:Wi[e];if(!n)return null;const a=["settings-category-icon",`settings-category-icon-${e}`,`settings-category-icon-${s}`].join(" ");return t.jsx("span",{className:a,"aria-hidden":"true",children:n})}function Et(e,s,n){return Math.min(n,Math.max(s,e))}function Ns(e,s,n,a){if(e!==null)return Et(e,n,a);if(s===void 0)throw new Error("A null range value requires unsetSliderValue");return s}function ot(e){const{id:s,min:n,max:a,numberMin:i=n,numberMax:o=a,step:r=1,list:d,value:u,unsetSliderValue:h,unit:f,disabled:p,ariaLabel:c,className:x,onEdit:b,snapTextToStep:v=!0}=e,[T,I]=l.useState(()=>Ns(u,h,n,a)),[C,O]=l.useState(u===null?"":String(u));l.useEffect(()=>{I(Ns(u,h,n,a)),O(u===null?"":String(u))},[a,n,h,u]);const k=l.useCallback(A=>{const P=n+Math.round((A-n)/r)*r;return Et(P,n,a)},[a,n,r]),y=l.useCallback(()=>{I(Ns(u,h,n,a)),O(u===null?"":String(u))},[a,n,h,u]),S=l.useCallback((A,P=!0,M=n,R=a)=>{const N=P?k(A):Et(A,M,R);if(h!==void 0&&N===h){I(h),O(""),e.unsetSliderValue!==void 0&&e.onCommit(null);return}I(Et(N,n,a)),O(String(N)),e.onCommit(N)},[a,n,k,e,h]),m=l.useCallback(()=>{if(C.trim()===""){e.unsetSliderValue!==void 0?(I(e.unsetSliderValue),O(""),e.onCommit(null)):y();return}const A=Number(C);if(!Number.isFinite(A)){y();return}S(A,v,i,o)},[S,o,i,e,y,v,C]),_=A=>{A.key==="Enter"?(A.preventDefault(),m(),A.currentTarget.blur()):A.key==="Escape"&&(A.preventDefault(),y(),A.currentTarget.blur())};return t.jsxs("span",{className:x?`output-appearance-slider-row ${x}`:"output-appearance-slider-row",children:[t.jsx(Le,{id:s,min:n,max:a,step:r,list:d,value:T,disabled:p,"aria-label":c,onDraftChange:A=>{O(A===h?"":String(A)),b==null||b()},onCommit:S}),t.jsxs("span",{className:"output-appearance-number-wrap",children:[t.jsx("input",{id:s?`${s}-number`:void 0,type:"number",className:"settings-input-small output-appearance-number",min:i,max:o,step:v?r:"any",value:C,disabled:p,"aria-label":c,onChange:A=>{const P=A.currentTarget.value;if(O(P),P.trim()===""){h!==void 0&&(b==null||b());return}const M=Number(P);Number.isFinite(M)&&(I(Et(M,n,a)),b==null||b())},onBlur:m,onKeyDown:_}),f&&t.jsx("span",{className:"output-appearance-unit",children:f})]})]})}const ou="$E=mc^2$";function ue(e){return Number.isInteger(e),String(e)}function se(e,s,n){return{value:e,restore:a=>{const i=a;s(i),n==null||n(i)}}}function Ra(e,s){switch(e){case"flat":return s("appearanceSettingsIconStyleFlat");case"flat-white":return s("appearanceSettingsIconStyleFlatWhite");case"emoji":return s("appearanceSettingsIconStyleEmoji")}}function Oa(e,s){switch(e){case"block":return s("appearanceQuoteReplyButtonsBlock");case"paragraph-hover":return s("appearanceQuoteReplyButtonsParagraphHover");case"paragraph-always":return s("appearanceQuoteReplyButtonsParagraphAlways")}}function ru(){const{locale:e,setLocale:s,t:n}=K();_e(n("appearanceSectionTitle"));const a=li(),i=rs(),{fontSizePercent:o,setFontSizePercent:r}=wo(),{sidebarSpacing:d,setSidebarSpacing:u}=Co(),{outputFont:h,outputUiFont:f,userTurnFontSizeOffsetPx:p,outputFontSizePx:c,outputFixedFont:x,outputFixedFontSizeOffsetPx:b,outputThinkingFontSizeOffsetPx:v,outputMathFontSizeOffsetPx:T,outputLineSpacingPercent:I,outputVerticalSpacingPercent:C,outputToolPreviewLineCount:O,setOutputFont:k,setOutputUiFont:y,setUserTurnFontSizeOffsetPx:S,setOutputFontSizePx:m,setOutputFixedFont:_,setOutputFixedFontSizeOffsetPx:A,setOutputThinkingFontSizeOffsetPx:P,setOutputMathFontSizeOffsetPx:M,setOutputLineSpacingPercent:R,setOutputVerticalSpacingPercent:N,setOutputToolPreviewLineCount:$,resetOutputAppearance:D}=No(),{tabSize:L,setTabSize:F}=Eo(),{contentMaxWidth:E,setContentMaxWidth:V}=ko(),{widerConversationActivityPreviews:te,setWiderConversationActivityPreviews:ne}=vl(),{glossaryHintsEnabled:ae,setGlossaryHintsEnabled:Z}=hl(),{version:ee}=We(),xe=me(ee,rr),{hoverCardMaxHeightPx:z,setHoverCardMaxHeightPx:re}=gl(),{tooltipMode:Ne,tooltipDelayMs:pe,setTooltipMode:ge,setTooltipDelayMs:Te}=_o(),{generatedTitleLength:G,setGeneratedTitleLength:ie}=yl(),{generatedTitleEnabled:ce,setGeneratedTitleEnabled:Ae}=jl(),Pe=fl(z,!0),[Re,De]=l.useState(()=>String(E)),[B,X]=l.useState(()=>String(z)),[H,q]=l.useState(()=>String(G)),[fe,Ie]=l.useState(()=>ue(c)),[Ue,W]=l.useState(()=>ue(b)),[ve,Me]=l.useState(()=>ue(v)),[je,Ee]=l.useState(()=>ue(T)),[Ge,Ke]=l.useState(()=>ue(I)),[rt,Qe]=l.useState(()=>ue(C)),[st,Ze]=l.useState(()=>ue(O)),{theme:Y,setTheme:J}=Mo(),{settingsIconStyle:j,setSettingsIconStyle:Q}=Bi(),{compactMultiImageGalleries:de,inlineMediaExpandedByDefault:Fe,setCompactMultiImageGalleries:nt,setInlineMediaExpandedByDefault:at}=Qr(),{recentProjectPathLinksEnabled:Pt,setRecentProjectPathLinksEnabled:It}=dl(),{quoteReplyButtonMode:yt,setQuoteReplyButtonMode:Lt}=Xr(),{selectionQuoteActionEnabled:Rt,setSelectionQuoteActionEnabled:Ot,selectionTextCopyActionEnabled:Ut,setSelectionTextCopyActionEnabled:Ft,selectionSourceCopyActionEnabled:ds,setSelectionSourceCopyActionEnabled:cn,selectionRichCopyActionEnabled:dn,setSelectionRichCopyActionEnabled:un,selectionNewSessionActionEnabled:pn,setSelectionNewSessionActionEnabled:mn}=qr(),{funPhrasesEnabled:hn,setFunPhrasesEnabled:gn}=Sl(),{floatingActionButtonEnabled:fn,setFloatingActionButtonEnabled:bn}=xl(),{sidebarDuplicateHidingEnabled:xn,setSidebarDuplicateHidingEnabled:vn}=Rr(),{projectCodeNamesEnabled:us,setProjectCodeNamesEnabled:Sn,projectCodeNameActivityPulseEnabled:yn,setProjectCodeNameActivityPulseEnabled:jn}=ll(),{tabTitleActivityEnabled:ps,setTabTitleActivityEnabled:Tn}=tl(),{showConnectionBars:wn,setShowConnectionBars:Cn}=ui(),yo=l.useMemo(()=>Jr(ou).html,[]),ms=[se(e,s),se(o,r),se(d,u),se(h,k),se(f,y),se(p,S),se(c,m,g=>Ie(ue(g))),se(x,_),se(b,A,g=>W(ue(g))),se(v,P,g=>Me(ue(g))),se(T,M,g=>Ee(ue(g))),se(I,R,g=>Ke(ue(g))),se(C,N,g=>Qe(ue(g))),se(O,$,g=>Ze(ue(g))),se(L,F),se(E,V,g=>De(String(g))),se(te,ne),se(ae,Z),se(pe,Te),se(Ne,ge),se(z,re,g=>X(String(g))),se(ce,Ae),se(G,ie,g=>q(String(g))),se(Y,J),se(j,Q),se(Fe,at),se(de,nt),se(Pt,It),se(yt,Lt),se(Rt,Ot),se(Ut,Ft),se(ds,cn),se(dn,un),se(pn,mn),se(hn,gn),se(fn,bn),se(xn,vn),se(us,Sn),se(ps,Tn),se(yn,jn),se(wn,Cn)],Nn=l.useRef(ms);Nn.current=ms;const jo=ms.map(g=>g.value),To=l.useCallback(g=>{Nn.current.forEach((Xe,hs)=>{Xe.restore(g[hs])})},[]);$e(jo,To);const Ve=g=>n(g);l.useEffect(()=>{De(String(E))},[E]),l.useEffect(()=>{X(String(z))},[z]),l.useEffect(()=>{q(String(G))},[G]),l.useEffect(()=>{Ie(ue(c))},[c]),l.useEffect(()=>{W(ue(b))},[b]),l.useEffect(()=>{Me(ue(v))},[v]),l.useEffect(()=>{Ee(ue(T))},[T]),l.useEffect(()=>{Ke(ue(I))},[I]),l.useEffect(()=>{Qe(ue(C))},[C]),l.useEffect(()=>{Ze(ue(O))},[O]);const En=()=>{const g=Number.parseInt(Re,10);V(Number.isFinite(g)?g:gs)},kn=()=>{const g=Number(B);re(Number.isFinite(g)?g:vs)},_n=()=>{const g=Number(H);ie(Number.isFinite(g)?g:Ss)},Mn=()=>{const g=Number(fe);m(Number.isFinite(g)?g:qo)},An=()=>{const g=Number(Ue);A(Number.isFinite(g)?g:Zo)},Dn=()=>{const g=Number(ve);P(Number.isFinite(g)?g:Jo)},Pn=()=>{const g=Number(je);M(Number.isFinite(g)?g:er)},In=()=>{const g=Number(Ge);R(Number.isFinite(g)?g:tr)},Ln=()=>{const g=Number(rt);N(Number.isFinite(g)?g:sr)},Rn=()=>{const g=Number(st);$(Number.isFinite(g)?g:Xo)};return t.jsx(oe,{keywords:["font","typography","text size","line spacing","sidebar layout density compact comfortable spacing","generated titles","conversation view activity previews thinking"],children:t.jsxs("div",{className:"settings-group",children:[t.jsx(w,{label:n("appearanceLanguageTitle"),description:n("appearanceLanguageDescription"),valueText:Ca(e,Ve),children:t.jsx("select",{className:"settings-select",value:e,onChange:g=>s(g.target.value),"aria-label":n("appearanceLanguageTitle"),children:Ao.map(g=>t.jsx("option",{value:g,children:Ca(g,Ve)},g))})}),t.jsx(w,{label:n("appearanceThemeTitle"),valueText:ja(Y,Ve),children:t.jsx("div",{className:"font-size-selector",children:Do.map(g=>t.jsx("button",{type:"button",className:`font-size-option ${Y===g?"active":""}`,onClick:()=>J(g),children:ja(g,Ve)},g))})}),t.jsx(w,{label:n("appearanceSettingsIconStyleTitle"),description:n("appearanceSettingsIconStyleDescription"),valueText:Ra(j,Ve),className:"settings-item--wide-control",children:t.jsx("div",{className:"font-size-selector settings-icon-style-selector",role:"group","aria-label":n("appearanceSettingsIconStyleTitle"),children:Xd.map(g=>{const Xe=j===g,hs=g==="emoji"?Hi["local-access"]:Wi["local-access"];return t.jsxs("button",{type:"button",className:`font-size-option settings-icon-style-option ${Xe?"active":""}`,onClick:()=>Q(g),"aria-pressed":Xe,children:[t.jsx("span",{className:`settings-category-icon settings-category-icon-local-access settings-category-icon-${g} settings-icon-style-preview`,"aria-hidden":"true",children:hs}),t.jsx("span",{children:Ra(g,Ve)})]},g)})})}),t.jsx(w,{label:n("appearanceContentWidthTitle"),description:n("appearanceContentWidthDescription"),className:"settings-item--wide-control",children:t.jsxs("div",{className:"settings-item-actions",children:[t.jsx(Le,{min:Un,max:On,step:10,value:E,onDraftChange:g=>De(String(g)),onCommit:V,"aria-label":n("appearanceContentWidthTitle")}),t.jsxs("span",{className:"settings-input-unit",children:[t.jsx("input",{type:"number",className:"settings-input-small",min:Un,max:On,step:10,value:Re,onChange:g=>De(g.target.value),onBlur:En,onKeyDown:g=>{g.key==="Enter"&&(En(),g.currentTarget.blur())},"aria-label":n("appearanceContentWidthTitle")}),n("appearanceContentWidthUnit")]}),t.jsx("button",{type:"button",className:"settings-inline-x",onClick:()=>{V(gs),De(String(gs))},"aria-label":n("appearanceContentWidthReset"),title:n("appearanceContentWidthReset"),children:"×"})]})}),t.jsx(w,{label:n("appearanceSidebarSpacingTitle"),description:n("appearanceSidebarSpacingDescription"),keywords:["sidebar spacing","layout","compact","comfortable"],valueText:Ta(d,Ve),className:"settings-item--wide-control",children:t.jsx("div",{className:"font-size-selector",role:"radiogroup","aria-label":n("appearanceSidebarSpacingTitle"),children:Po.map(g=>{const Xe=d===g;return t.jsx("button",{type:"button",className:`font-size-option ${Xe?"active":""}`,role:"radio","aria-checked":Xe,onClick:()=>u(g),children:Ta(g,Ve)},g)})})}),t.jsx(w,{label:n("appearanceOutputToolPreviewLinesLabel"),className:"settings-item--wide-control",children:t.jsxs("div",{className:"settings-item-actions",children:[t.jsx(Le,{min:Hn,max:Bn,step:Fn,value:O,onDraftChange:g=>Ze(ue(g)),onCommit:$,"aria-label":n("appearanceOutputToolPreviewLinesLabel")}),t.jsxs("span",{className:"settings-input-unit",children:[t.jsx("input",{type:"number",className:"settings-input-small",min:Hn,max:Bn,step:Fn,value:st,onChange:g=>Ze(g.target.value),onBlur:Rn,onKeyDown:g=>{g.key==="Enter"&&(Rn(),g.currentTarget.blur())},"aria-label":n("appearanceOutputToolPreviewLinesLabel")}),n("appearanceOutputToolPreviewLinesUnit")]})]})}),t.jsx(w,{label:n("appearanceWiderActivityPreviewsTitle"),description:n("appearanceWiderActivityPreviewsDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:te,onChange:g=>ne(g.target.checked),"aria-label":n("appearanceWiderActivityPreviewsTitle")}),t.jsx("span",{className:"toggle-slider"})]})}),t.jsx(w,{label:n("appearanceTabSizeTitle"),description:n("appearanceTabSizeDescription"),valueText:L,children:t.jsx("div",{className:"font-size-selector",children:Io.map(g=>t.jsx("button",{type:"button",className:`font-size-option ${L===g?"active":""}`,onClick:()=>F(g),children:g},g))})}),t.jsxs(w,{label:n("appearanceGeneratedTitlesTitle"),description:n("appearanceGeneratedTitlesDescription"),keywords:[n("appearanceGeneratedTitleLengthTitle"),n("appearanceGeneratedTitleLengthDescription")],layout:"custom",baseClassName:"settings-item-group",className:"generated-title-settings",children:[t.jsxs("div",{className:"settings-item-group-row",children:[t.jsxs("div",{className:"settings-item-info",children:[t.jsx("strong",{children:n("appearanceGeneratedTitlesTitle")}),t.jsx("p",{children:n("appearanceGeneratedTitlesDescription")})]}),t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:ce,onChange:g=>Ae(g.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})]}),ce&&t.jsxs("div",{className:"settings-item-group-row settings-item-group-row--field settings-item-group-row--wide-control",children:[t.jsxs("div",{className:"settings-item-info",children:[t.jsx("strong",{children:n("appearanceGeneratedTitleLengthTitle")}),t.jsx("p",{children:n("appearanceGeneratedTitleLengthDescription")})]}),t.jsxs("div",{className:"settings-item-actions",children:[t.jsx(Le,{min:ma,max:pa,step:ua,value:G,onDraftChange:g=>q(String(g)),onCommit:ie,"aria-label":n("appearanceGeneratedTitleLengthTitle")}),t.jsxs("span",{className:"settings-input-unit",children:[t.jsx("input",{type:"number",className:"settings-input-small",min:ma,max:pa,step:ua,value:H,onChange:g=>q(g.target.value),onBlur:_n,onKeyDown:g=>{g.key==="Enter"&&(_n(),g.currentTarget.blur())},"aria-label":n("appearanceGeneratedTitleLengthTitle")}),n("appearanceGeneratedTitleLengthUnit")]}),t.jsx("button",{type:"button",className:"settings-inline-x",onClick:()=>{ie(Ss),q(String(Ss))},"aria-label":n("appearanceGeneratedTitleLengthReset"),title:n("appearanceGeneratedTitleLengthReset"),children:"×"})]})]})]}),xe&&t.jsx(w,{label:n("appearanceGlossaryHintsTitle"),description:n("appearanceGlossaryHintsDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:ae,onChange:g=>Z(g.target.checked),"aria-label":n("appearanceGlossaryHintsTitle")}),t.jsx("span",{className:"toggle-slider"})]})}),t.jsx(w,{label:n("appearanceTooltipDelayTitle"),description:n("appearanceTooltipDelayDescription"),className:"settings-item--wide-control settings-item--tooltip-control",children:t.jsxs("div",{className:"settings-item-actions tooltip-settings-actions",children:[t.jsxs("div",{className:"font-size-selector tooltip-mode-selector",role:"group","aria-label":n("appearanceTooltipModeTitle"),children:[t.jsx("button",{type:"button",className:`font-size-option ${Ne==="themed"?"active":""}`,onClick:()=>ge("themed"),children:n("appearanceTooltipModeThemed")}),t.jsx("button",{type:"button",className:`font-size-option ${Ne==="native"?"active":""}`,onClick:()=>ge("native"),children:n("appearanceTooltipModeNative")})]}),t.jsx(ot,{id:"tooltip-delay",min:Oo,max:Ro,step:Lo,value:pe,unit:n("appearanceTooltipDelayUnit"),ariaLabel:n("appearanceTooltipDelayTitle"),onEdit:()=>ge("themed"),onCommit:Te}),t.jsx("button",{type:"button",className:"settings-inline-x",onClick:()=>{Te(Uo)},"aria-label":n("appearanceTooltipReset"),title:n("appearanceTooltipReset"),children:"×"})]})}),t.jsx(w,{label:n("appearanceHoverCardHeightTitle"),description:n("appearanceHoverCardHeightDescription"),className:"settings-item--wide-control",children:t.jsxs("div",{className:"settings-item-actions",children:[t.jsx(Le,{min:da,max:ca,step:la,value:z,onDraftChange:g=>X(String(g)),onCommit:re,"aria-label":n("appearanceHoverCardHeightTitle")}),t.jsxs("span",{className:"settings-input-unit",children:[t.jsx("input",{type:"number",className:"settings-input-small",min:da,max:ca,step:la,value:B,onChange:g=>X(g.target.value),onBlur:kn,onKeyDown:g=>{g.key==="Enter"&&(kn(),g.currentTarget.blur())},"aria-label":n("appearanceHoverCardHeightTitle")}),n("appearanceHoverCardHeightUnit")]}),t.jsxs("span",{className:"settings-hovercard-lines",children:["(",Pe," ",n(Pe===1?"appearanceHoverCardLineUnit":"appearanceHoverCardLinesUnit"),")"]}),t.jsx("button",{type:"button",className:"settings-inline-x",onClick:()=>{re(vs),X(String(vs))},"aria-label":n("appearanceHoverCardReset"),title:n("appearanceHoverCardReset"),children:"×"})]})}),t.jsx(w,{label:n("appearanceInlineImagesTitle"),description:n("appearanceInlineImagesDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:Fe,onChange:g=>at(g.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})}),t.jsx(w,{label:n("appearanceImageGalleriesTitle"),description:n("appearanceImageGalleriesDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox","aria-label":n("appearanceImageGalleriesTitle"),checked:de,onChange:g=>nt(g.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})}),t.jsx(w,{label:n("appearanceRecentProjectPathLinksTitle"),description:n("appearanceRecentProjectPathLinksDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox","aria-label":n("appearanceRecentProjectPathLinksTitle"),checked:Pt,onChange:g=>It(g.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})}),t.jsx(w,{label:n("appearanceQuoteReplyButtonsTitle"),description:n("appearanceQuoteReplyButtonsDescription"),valueText:Oa(yt,Ve),className:"settings-item--wide-control",children:t.jsx("div",{className:"font-size-selector",role:"radiogroup","aria-label":n("appearanceQuoteReplyButtonsTitle"),children:Zr.map(g=>{const Xe=yt===g;return t.jsx("button",{type:"button",className:`font-size-option ${Xe?"active":""}`,role:"radio","aria-checked":Xe,onClick:()=>Lt(g),children:Oa(g,Ve)},g)})})}),t.jsxs(w,{label:n("appearanceSelectionQuoteActionTitle"),description:n("appearanceSelectionQuoteActionDescription"),children:[t.jsx(Tt,{kind:"quote",label:n("sessionQuoteSelection"),specimen:!0}),t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox","aria-label":n("appearanceSelectionQuoteActionTitle"),checked:Rt,onChange:g=>Ot(g.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})]}),t.jsxs(w,{label:n("appearanceSelectionTextCopyActionTitle"),description:n("appearanceSelectionTextCopyActionDescription"),children:[t.jsx(Tt,{kind:"text",label:n("sessionCopySelectionText"),specimen:!0}),t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox","aria-label":n("appearanceSelectionTextCopyActionTitle"),checked:Ut,onChange:g=>Ft(g.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})]}),t.jsxs(w,{label:n("appearanceSelectionSourceCopyActionTitle"),description:n("appearanceSelectionSourceCopyActionDescription"),children:[t.jsx(Tt,{kind:"source",label:n("sessionCopySelectionSource"),specimen:!0}),t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox","aria-label":n("appearanceSelectionSourceCopyActionTitle"),checked:ds,onChange:g=>cn(g.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})]}),t.jsxs(w,{label:n("appearanceSelectionRichCopyActionTitle"),description:n("appearanceSelectionRichCopyActionDescription"),children:[t.jsx(Tt,{kind:"rich",label:n("sessionCopySelectionRich"),specimen:!0}),t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox","aria-label":n("appearanceSelectionRichCopyActionTitle"),checked:dn,onChange:g=>un(g.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})]}),t.jsxs(w,{label:n("appearanceSelectionNewSessionActionTitle"),description:n("appearanceSelectionNewSessionActionDescription"),children:[t.jsx(Tt,{kind:"newSession",label:n("sessionNewSessionFromSelection"),specimen:!0}),t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox","aria-label":n("appearanceSelectionNewSessionActionTitle"),checked:pn,onChange:g=>mn(g.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})]}),t.jsx(w,{label:n("appearanceFunPhrasesTitle"),description:n("appearanceFunPhrasesDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:hn,onChange:g=>gn(g.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})}),t.jsx(w,{label:n("appearanceFloatingActionButtonTitle"),description:n("appearanceFloatingActionButtonDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:fn,onChange:g=>bn(g.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})}),t.jsx(w,{label:n("appearanceSidebarDuplicateHidingTitle"),description:n("appearanceSidebarDuplicateHidingDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:xn,onChange:g=>vn(g.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})}),t.jsx(w,{label:n("appearanceProjectCodeNamesTitle"),description:n("appearanceProjectCodeNamesDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:us,onChange:g=>Sn(g.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})}),t.jsx(w,{label:n("appearanceTabTitleActivityTitle"),description:n("appearanceTabTitleActivityDescription"),children:t.jsx("div",{className:"settings-item-actions",children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:ps,onChange:g=>Tn(g.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})})}),t.jsx(w,{label:n("appearanceProjectCodeNameActivityPulseTitle"),description:n("appearanceProjectCodeNameActivityPulseDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:yn,disabled:!us||!ps,onChange:g=>jn(g.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})}),t.jsx(w,{label:n("appearanceConnectionBarsTitle"),description:n("appearanceConnectionBarsDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:wn,onChange:g=>Cn(g.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})}),t.jsx(w,{label:n("appearanceToolbarSettingsShortcutTitle"),description:n("appearanceToolbarSettingsShortcutDescription"),children:t.jsx("div",{className:"settings-item-actions",children:t.jsx("button",{type:"button",className:"settings-button",onClick:()=>a(`${i}/settings/toolbar`),children:n("appearanceToolbarSettingsShortcutAction")})})}),t.jsx(w,{label:n("appearanceOutputTypographyTitle"),keywords:[n("appearanceOutputUiFontLabel"),n("appearanceFontSizeTitle"),n("appearanceUserTurnSizeOffsetLabel"),n("appearanceOutputFontLabel"),n("appearanceOutputFontSizeLabel"),n("appearanceOutputThinkingSizeOffsetLabel"),n("appearanceOutputFixedFontLabel"),n("appearanceOutputFixedSizeOffsetLabel"),n("appearanceOutputMathSizeOffsetLabel"),n("appearanceOutputLineSpacingLabel"),n("appearanceOutputVerticalSpacingLabel")],layout:"custom",className:"output-appearance-settings",children:t.jsxs("div",{className:"output-appearance-panel",children:[t.jsxs("div",{className:"output-appearance-controls",children:[t.jsx("div",{className:"output-appearance-title settings-item-info",children:t.jsx("strong",{children:n("appearanceOutputTypographyTitle")})}),t.jsxs("div",{className:"output-appearance-control",children:[t.jsx("span",{className:"output-appearance-label",children:n("appearanceOutputUiFontLabel")}),t.jsx("div",{className:"font-size-selector output-font-selector",children:Wn.map(g=>t.jsx("button",{type:"button",className:`font-size-option output-font-option output-font-option-${g} ${f===g?"active":""}`,onClick:()=>y(g),children:wa(g,Ve)},g))})]}),t.jsxs("label",{className:"output-appearance-control",htmlFor:"ui-font-scale",children:[t.jsx("span",{className:"output-appearance-label",children:n("appearanceFontSizeTitle")}),t.jsx(ot,{id:"ui-font-scale",min:$o,max:Wo,numberMin:Ho,numberMax:Bo,step:Fo,value:o,unit:"%",list:"ui-font-scale-presets",ariaLabel:n("appearanceFontSizeTitle"),snapTextToStep:!1,onCommit:r})]}),t.jsx("datalist",{id:"ui-font-scale-presets",children:Vo.map(g=>t.jsx("option",{value:g,label:`${g}%`},g))}),t.jsxs("label",{className:"output-appearance-control",htmlFor:"user-turn-font-size-offset",children:[t.jsx("span",{className:"output-appearance-label",children:n("appearanceUserTurnSizeOffsetLabel")}),t.jsx(ot,{id:"user-turn-font-size-offset",min:Ko,max:Go,step:zo,value:p,unit:"px",ariaLabel:n("appearanceUserTurnSizeOffsetLabel"),onCommit:S})]}),t.jsxs("div",{className:"output-appearance-control",children:[t.jsx("span",{className:"output-appearance-label",children:n("appearanceOutputFontLabel")}),t.jsx("div",{className:"font-size-selector output-font-selector",children:Wn.map(g=>t.jsx("button",{type:"button",className:`font-size-option output-font-option output-font-option-${g} ${h===g?"active":""}`,onClick:()=>k(g),children:wa(g,Ve)},g))})]}),t.jsxs("label",{className:"output-appearance-control",htmlFor:"output-font-size",children:[t.jsx("span",{className:"output-appearance-label",children:n("appearanceOutputFontSizeLabel")}),t.jsxs("span",{className:"output-appearance-slider-row",children:[t.jsx(Le,{id:"output-font-size",min:zn,max:Vn,step:$n,value:c,list:"output-font-size-presets",onDraftChange:g=>Ie(ue(g)),onCommit:m}),t.jsxs("span",{className:"output-appearance-number-wrap",children:[t.jsx("input",{type:"number",className:"settings-input-small output-appearance-number",min:zn,max:Vn,step:$n,value:fe,onChange:g=>Ie(g.target.value),onBlur:Mn,onKeyDown:g=>{g.key==="Enter"&&(Mn(),g.currentTarget.blur())},"aria-label":n("appearanceOutputFontSizeLabel")}),t.jsx("span",{className:"output-appearance-unit",children:"px"})]})]})]}),t.jsx("datalist",{id:"output-font-size-presets",children:Yo.map(g=>t.jsx("option",{value:g.value,label:g.label},g.value))}),t.jsxs("label",{className:"output-appearance-control",htmlFor:"output-thinking-size-offset",children:[t.jsx("span",{className:"output-appearance-label",children:n("appearanceOutputThinkingSizeOffsetLabel")}),t.jsxs("span",{className:"output-appearance-slider-row",children:[t.jsx(Le,{id:"output-thinking-size-offset",min:Yn,max:Kn,step:Gn,value:v,onDraftChange:g=>Me(ue(g)),onCommit:P}),t.jsxs("span",{className:"output-appearance-number-wrap",children:[t.jsx("input",{type:"number",className:"settings-input-small output-appearance-number",min:Yn,max:Kn,step:Gn,value:ve,onChange:g=>Me(g.target.value),onBlur:Dn,onKeyDown:g=>{g.key==="Enter"&&(Dn(),g.currentTarget.blur())},"aria-label":n("appearanceOutputThinkingSizeOffsetLabel")}),t.jsx("span",{className:"output-appearance-unit",children:"px"})]})]})]}),t.jsxs("div",{className:"output-appearance-control",children:[t.jsx("span",{className:"output-appearance-label",children:n("appearanceOutputFixedFontLabel")}),t.jsx("div",{className:"font-size-selector output-font-selector",children:Qo.map(g=>t.jsx("button",{type:"button",className:`font-size-option output-font-option output-fixed-font-option-${g} ${x===g?"active":""}`,onClick:()=>_(g),children:Jc(g,Ve)},g))})]}),t.jsxs("label",{className:"output-appearance-control",htmlFor:"output-fixed-size-offset",children:[t.jsx("span",{className:"output-appearance-label",children:n("appearanceOutputFixedSizeOffsetLabel")}),t.jsxs("span",{className:"output-appearance-slider-row",children:[t.jsx(Le,{id:"output-fixed-size-offset",min:qn,max:Xn,step:Qn,value:b,onDraftChange:g=>W(ue(g)),onCommit:A}),t.jsxs("span",{className:"output-appearance-number-wrap",children:[t.jsx("input",{type:"number",className:"settings-input-small output-appearance-number",min:qn,max:Xn,step:Qn,value:Ue,onChange:g=>W(g.target.value),onBlur:An,onKeyDown:g=>{g.key==="Enter"&&(An(),g.currentTarget.blur())},"aria-label":n("appearanceOutputFixedSizeOffsetLabel")}),t.jsx("span",{className:"output-appearance-unit",children:"px"})]})]})]}),t.jsxs("label",{className:"output-appearance-control",htmlFor:"output-math-size-offset",children:[t.jsx("span",{className:"output-appearance-label",children:n("appearanceOutputMathSizeOffsetLabel")}),t.jsxs("span",{className:"output-appearance-slider-row",children:[t.jsx(Le,{id:"output-math-size-offset",min:ea,max:Zn,step:Jn,value:T,onDraftChange:g=>Ee(ue(g)),onCommit:M}),t.jsxs("span",{className:"output-appearance-number-wrap",children:[t.jsx("input",{type:"number",className:"settings-input-small output-appearance-number",min:ea,max:Zn,step:Jn,value:je,onChange:g=>Ee(g.target.value),onBlur:Pn,onKeyDown:g=>{g.key==="Enter"&&(Pn(),g.currentTarget.blur())},"aria-label":n("appearanceOutputMathSizeOffsetLabel")}),t.jsx("span",{className:"output-appearance-unit",children:"px"})]})]})]}),t.jsxs("label",{className:"output-appearance-control",htmlFor:"output-line-spacing",children:[t.jsx("span",{className:"output-appearance-label",children:n("appearanceOutputLineSpacingLabel")}),t.jsxs("span",{className:"output-appearance-slider-row",children:[t.jsx(Le,{id:"output-line-spacing",min:na,max:sa,step:ta,value:I,onDraftChange:g=>Ke(ue(g)),onCommit:R}),t.jsxs("span",{className:"output-appearance-number-wrap",children:[t.jsx("input",{type:"number",className:"settings-input-small output-appearance-number",min:na,max:sa,step:ta,value:Ge,onChange:g=>Ke(g.target.value),onBlur:In,onKeyDown:g=>{g.key==="Enter"&&(In(),g.currentTarget.blur())},"aria-label":n("appearanceOutputLineSpacingLabel")}),t.jsx("span",{className:"output-appearance-unit",children:"%"})]})]})]}),t.jsxs("label",{className:"output-appearance-control",htmlFor:"output-vertical-spacing",children:[t.jsx("span",{className:"output-appearance-label",children:n("appearanceOutputVerticalSpacingLabel")}),t.jsxs("span",{className:"output-appearance-slider-row",children:[t.jsx(Le,{id:"output-vertical-spacing",min:oa,max:ia,step:aa,value:C,onDraftChange:g=>Qe(ue(g)),onCommit:N}),t.jsxs("span",{className:"output-appearance-number-wrap",children:[t.jsx("input",{type:"number",className:"settings-input-small output-appearance-number",min:oa,max:ia,step:aa,value:rt,onChange:g=>Qe(g.target.value),onBlur:Ln,onKeyDown:g=>{g.key==="Enter"&&(Ln(),g.currentTarget.blur())},"aria-label":n("appearanceOutputVerticalSpacingLabel")}),t.jsx("span",{className:"output-appearance-unit",children:"%"})]})]})]})]}),t.jsxs("div",{className:"output-appearance-specimen",children:[t.jsxs("div",{className:"output-appearance-specimen-header",children:[t.jsx("span",{className:"output-appearance-specimen-label",children:n("appearanceOutputSpecimenLabel")}),t.jsx("button",{type:"button",className:"settings-button settings-button-secondary",onClick:D,children:n("appearanceOutputTypographyReset")})]}),t.jsxs("div",{className:"output-appearance-preview",role:"region","aria-label":n("appearanceOutputPreviewLabel"),children:[t.jsxs("div",{className:"output-preview-system",children:[t.jsx("span",{className:"output-preview-system-icon",children:"ok"}),t.jsx("span",{children:"System note: applied after reconnect."})]}),t.jsxs("div",{className:"output-preview-prose",children:[t.jsxs("p",{children:["Inline code like ",t.jsx("code",{children:"codex update"})," stays fixed width; prose wraps at phone width."]}),t.jsx("pre",{className:"output-preview-fixed",children:t.jsx("code",{children:`f0 = (x: 0) => ({ ok: x + 1 });
10
+ fn S(v) -> { return v[0] ?? false }`})}),t.jsxs("p",{children:["Inline math:"," ",t.jsx("span",{className:"output-preview-math",dangerouslySetInnerHTML:{__html:yo}})]}),t.jsxs("ul",{children:[t.jsxs("li",{children:["Tokens: ",t.jsx("code",{children:"fixed width"})]}),t.jsx("li",{children:"Math uses a TeX-like face."})]})]}),t.jsx("div",{className:"output-preview-thinking thinking-content",children:t.jsx(ul,{text:"**Spacing** — thinking text stays quieter and smaller."})}),t.jsxs("div",{className:"output-preview-diff","aria-hidden":"true",children:[t.jsxs("div",{children:[t.jsx("span",{className:"output-preview-diff-gutter",children:"+"}),t.jsx("span",{children:"Diff prose follows the prose font."})]}),t.jsxs("div",{children:[t.jsx("span",{className:"output-preview-diff-gutter",children:"-"}),t.jsx("span",{children:"Paragraph space can be dialed down."})]})]}),t.jsxs("div",{className:"output-preview-ui","aria-hidden":"true",children:[t.jsx("div",{className:"output-preview-ui-title",children:"Session title — uses the UI font and size"}),t.jsx("div",{className:"output-preview-ui-composer",children:"Composer: type a message to the agent…"}),t.jsx("div",{className:"message message-user-prompt",children:t.jsx("div",{className:"text-block",children:n("appearanceUserTurnPreview")})}),t.jsx("div",{className:"output-preview-ui-caption",children:"Caption · updated 2m ago · 3 files"})]})]})]})]})})]})})}const lu="_tokenInput_12zei_8",cu="_evidence_12zei_12",du="_recencyControl_12zei_19",uu="_chartPanel_12zei_20",pu="_recencyHeader_12zei_27",mu="_eventTableSection_12zei_36",hu="_recencyInputs_12zei_58",gu="_expectedExpiryToggle_12zei_65",fu="_sliderStack_12zei_92",bu="_sliderLabels_12zei_104",xu="_recencyTextInput_12zei_113",vu="_chartGrid_12zei_126",Be={tokenInput:lu,evidence:cu,recencyControl:du,chartPanel:uu,recencyHeader:pu,eventTableSection:mu,recencyInputs:hu,expectedExpiryToggle:gu,sliderStack:fu,sliderLabels:bu,recencyTextInput:xu,chartGrid:vu},Su=["misses","hits","all"],$i="misses";function yu(e){return Su.includes(e)?e:void 0}const _t=nr(U.cacheMissEventOutcomeFilter,$i,yu);_t.set;_t.reset;function ju(){return{outcomeFilter:l.useSyncExternalStore(_t.subscribe,_t.read,()=>$i),setOutcomeFilter:_t.set}}const Tu="_viewer_v96yw_1",wu="_toolbar_v96yw_8",Cu="_filterControls_v96yw_17",Nu="_filterLabel_v96yw_25",Eu="_outcomeLabel_v96yw_34",ku="_matchCount_v96yw_55",_u="_scroller_v96yw_62",Mu="_table_v96yw_67",Au="_tupleColumn_v96yw_93",Du="_eventTimeColumn_v96yw_97",Pu="_resultColumn_v96yw_101",Iu="_kindColumn_v96yw_102",Lu="_gapColumn_v96yw_106",Ru="_openColumn_v96yw_110",Ou="_tokensColumn_v96yw_114",Uu="_messageColumn_v96yw_118",Fu="_groupRow_v96yw_122",Bu="_groupButton_v96yw_126",Hu="_groupSummary_v96yw_141",Wu="_eventRow_v96yw_146",$u="_numeric_v96yw_163",Vu="_age_v96yw_168",zu="_messageReference_v96yw_169",Gu="_eventTimestamp_v96yw_178",Ku="_sessionMarker_v96yw_195",Yu="_messageJump_v96yw_204",Qu="_miss_v96yw_219",Xu="_hit_v96yw_224",qu="_expectedMiss_v96yw_229",Ju="_openLink_v96yw_234",le={viewer:Tu,toolbar:wu,filterControls:Cu,filterLabel:Nu,outcomeLabel:Eu,matchCount:ku,scroller:_u,table:Mu,tupleColumn:Au,eventTimeColumn:Du,resultColumn:Pu,kindColumn:Iu,gapColumn:Lu,openColumn:Ru,tokensColumn:Ou,messageColumn:Uu,groupRow:Fu,groupButton:Bu,groupSummary:Hu,eventRow:Wu,numeric:$u,age:Vu,messageReference:zu,eventTimestamp:Gu,sessionMarker:Ku,messageJump:Yu,miss:Qu,hit:Xu,expectedMiss:qu,openLink:Ju};function Zu(e,s){var n;return`${e.provider} / ${((n=e.model)==null?void 0:n.trim())||s}`}function sn(e){return e.outcome!=="expected-cache-hit"}function ep(e,s){const n=new Map;for(const a of e){const i=Zu(a,s),o=Date.parse(a.timestamp),r=n.get(i)??{key:i,tuple:i,events:[],misses:0,newestTimestampMs:0};r.events.push(a),sn(a)&&(r.misses+=1),Number.isFinite(o)&&(r.newestTimestampMs=Math.max(r.newestTimestampMs,o)),n.set(i,r)}return[...n.values()].map(a=>({...a,events:a.events.sort((i,o)=>o.timestamp.localeCompare(i.timestamp))})).sort((a,i)=>i.newestTimestampMs-a.newestTimestampMs)}function tp(e){return new Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(e)}function sp(e){return sn(e)?e.wastedInputTokens:e.observedUsage.cacheReadTokens??0}function np(e){const s=Date.parse(e);if(!Number.isFinite(s))return{date:e,time:"",title:e};const n=new Date(s);return{date:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric"}).format(n),time:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit",second:"2-digit"}).format(n),title:n.toLocaleString()}}function ap(e){if(e===void 0)return"—";if(e<6e4)return"<1m";const s=Math.floor(e/6e4);if(s<60)return`${s}m`;const n=Math.floor(s/60),a=s%60;return a>0?`${n}h ${a}m`:`${n}h`}function Ua(e){return e.messageIndex!==void 0?`#${e.messageIndex}`:e.messageId?e.messageId.length>8?`${e.messageId.slice(0,8)}…`:e.messageId:"—"}function ip(e,s){return s==="all"?!0:s==="misses"?sn(e):e.outcome==="expected-cache-hit"}function op(e){const s=[...new Set(e.map(n=>n.sessionId))].sort();return new Map(s.map((n,a)=>[n,{"--cache-session-color":`hsl(${(a*137.508+12)%360} 70% 52%)`}]))}function rp(e,s){return e.messageIndex!==void 0&&s.messageIndex!==void 0&&e.messageIndex!==s.messageIndex?s.messageIndex-e.messageIndex:s.timestamp.localeCompare(e.timestamp)}function lp({events:e,basePath:s,recencyHours:n}){const{t:a}=K(),i=xi(6e4),{outcomeFilter:o,setOutcomeFilter:r}=ju(),[d,u]=l.useState(""),[h,f]=l.useState(()=>new Set),[p,c]=l.useState(null),x=l.useRef(new Map),b=l.useMemo(()=>e.filter(S=>ip(S,o)),[e,o]),v=l.useMemo(()=>{const S=d.trim().toLocaleLowerCase();return ep(b,a("cacheMissUnknownModel")).filter(m=>!S||m.tuple.toLocaleLowerCase().includes(S))},[b,a,d]),T=l.useMemo(()=>op(e),[e]),I=l.useMemo(()=>{const S=new Map,m=new Map;for(const A of v)for(const P of A.events){if(m.set(P.id,A.key),P.messageIndex===void 0)continue;const M=S.get(P.sessionId)??[];M.push(P),S.set(P.sessionId,M)}const _=new Map;for(const A of S.values()){A.sort(rp);for(let P=0;P+1<A.length;P+=1){const M=A[P],R=A[P+1];M&&R&&_.set(M.id,R.id)}}return{groupByEventId:m,previousByEventId:_}},[v]);l.useEffect(()=>{var m;if(!p)return;const S=x.current.get(p);if(!S){c(null);return}(m=S.scrollIntoView)==null||m.call(S,{block:"center"}),S.focus({preventScroll:!0}),c(null)},[p]);const C=S=>{f(m=>{const _=new Set(m);return _.has(S)?_.delete(S):_.add(S),_})},O=S=>{const m=I.previousByEventId.get(S);if(!m)return;const _=I.groupByEventId.get(m);_&&f(A=>{if(!A.has(_))return A;const P=new Set(A);return P.delete(_),P}),c(m)},k=v.reduce((S,m)=>S+m.events.length,0),y=n===null?a("cacheMissEventVisibleCount",{shown:k,total:e.length}):a("cacheMissEventVisibleCountRecent",{shown:k,total:e.length,hours:n});return t.jsxs("div",{className:le.viewer,children:[t.jsxs("div",{className:le.toolbar,children:[t.jsxs("div",{className:le.filterControls,children:[t.jsxs("label",{className:le.outcomeLabel,children:[t.jsx("span",{children:a("cacheMissEventResultHeader")}),t.jsxs("select",{value:o,onChange:S=>r(S.currentTarget.value),children:[t.jsx("option",{value:"misses",children:a("cacheMissEventResultMiss")}),t.jsx("option",{value:"hits",children:a("cacheMissEventResultHit")}),t.jsx("option",{value:"all",children:a("cacheMissEventResultAll")})]})]}),t.jsxs("label",{className:le.filterLabel,children:[t.jsx("span",{children:a("cacheMissEventFilterLabel")}),t.jsx("input",{type:"search",value:d,onChange:S=>u(S.currentTarget.value),placeholder:a("cacheMissEventFilterPlaceholder")})]})]}),t.jsx("span",{className:le.matchCount,children:y})]}),v.length===0?t.jsx("p",{className:"settings-empty",children:e.length===0?a("cacheMissBillingEventsEmpty"):b.length===0?a("activityNoMatches"):a("cacheMissEventFilterEmpty")}):t.jsx("div",{className:le.scroller,children:t.jsxs("table",{className:le.table,children:[t.jsxs("colgroup",{children:[t.jsx("col",{className:le.tupleColumn}),t.jsx("col",{className:le.eventTimeColumn}),t.jsx("col",{className:le.resultColumn}),t.jsx("col",{className:le.gapColumn}),t.jsx("col",{className:le.tokensColumn}),t.jsx("col",{className:le.kindColumn}),t.jsx("col",{className:le.messageColumn}),t.jsx("col",{className:le.openColumn})]}),t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{title:a("cacheMissEventTupleHeaderTitle"),children:a("cacheMissEventTupleHeader")}),t.jsx("th",{title:a("cacheMissEventAgeHeaderTitle"),children:a("cacheMissEventAgeHeader")}),t.jsx("th",{title:a("cacheMissEventResultHeaderTitle"),children:a("cacheMissEventResultHeader")}),t.jsx("th",{title:a("cacheMissEventIdleHeaderTitle"),children:a("cacheMissEventIdleHeader")}),t.jsx("th",{title:a("cacheMissEventTokensHeaderTitle"),children:a("cacheMissEventTokensHeader")}),t.jsx("th",{title:a("cacheMissEventKindHeaderTitle"),children:a("cacheMissEventKindHeader")}),t.jsx("th",{title:a("cacheMissEventMessageHeaderTitle"),children:a("cacheMissEventMessageHeader")}),t.jsx("th",{title:a("cacheMissEventSessionHeaderTitle"),children:a("cacheMissEventSessionHeader")})]})}),v.map(S=>{const m=h.has(S.key);return t.jsxs("tbody",{children:[t.jsxs("tr",{className:le.groupRow,children:[t.jsx("th",{scope:"rowgroup",children:t.jsxs("button",{type:"button",className:le.groupButton,"aria-expanded":!m,"aria-label":a(m?"cacheMissEventExpandGroup":"cacheMissEventCollapseGroup",{tuple:S.tuple}),onClick:()=>C(S.key),children:[t.jsx("span",{"aria-hidden":"true",children:m?"▸":"▾"}),t.jsx("span",{children:S.tuple})]})}),t.jsxs("td",{colSpan:7,className:le.groupSummary,children:[a("cacheMissEventGroupSummary",{count:S.events.length,misses:S.misses}),S.newestTimestampMs>0&&t.jsxs(t.Fragment,{children:[" · ",t.jsx(pl,{timestampMs:S.newestTimestampMs,nowMs:i,className:le.age,formatLabel:_=>_==="now"?a("cacheMissEventNewestNow"):a("cacheMissEventNewestAge",{age:_})})]})]})]}),!m&&S.events.map(_=>{const A=np(_.timestamp),P=I.previousByEventId.get(_.id),M=P?a("cacheMissPrev"):void 0,R=[_.messageId,M].filter(Boolean).join(`
11
+ `);return t.jsxs("tr",{className:le.eventRow,style:T.get(_.sessionId),tabIndex:-1,ref:N=>{N?x.current.set(_.id,N):x.current.delete(_.id)},children:[t.jsx("td",{"aria-hidden":"true"}),t.jsx("td",{children:t.jsxs("time",{className:le.eventTimestamp,dateTime:_.timestamp,title:A.title,children:[t.jsx("span",{children:A.date}),t.jsx("span",{children:A.time})]})}),t.jsx("td",{className:_.outcome==="expected-cache-hit"?le.hit:_.outcome==="expected-cache-expiry"?le.expectedMiss:le.miss,children:_.outcome==="expected-cache-hit"?a("cacheMissEventResultHit"):_.outcome==="expected-cache-expiry"?a("cacheMissEventResultExpectedMiss"):a("cacheMissEventResultMiss")}),t.jsx("td",{children:ap(_.elapsedSinceExpectedCacheMs)}),t.jsx("td",{className:le.numeric,children:tp(sp(_))}),t.jsx("td",{children:_.expectedCacheSource==="fork"?a("cacheMissEventKindFork"):a("cacheMissEventKindWarm")}),t.jsxs("td",{className:le.messageReference,children:[t.jsx("span",{className:le.sessionMarker,"aria-hidden":"true"}),P?t.jsx("button",{type:"button",className:le.messageJump,title:R||void 0,"aria-label":M,onClick:()=>O(_.id),children:Ua(_)}):t.jsx("span",{title:R||void 0,children:Ua(_)})]}),t.jsx("td",{children:t.jsx(ci,{className:le.openLink,to:`${s}${_.sessionPath}`,title:a("cacheMissBillingOpenSession"),children:a("cacheMissEventOpen")})})]},_.id)})]},S.key)})]})})]})}const cp="_chart_k0wbw_1",dp="_bars_k0wbw_7",up="_bar_k0wbw_7",pp="_barLabel_k0wbw_24",mp="_barTrack_k0wbw_30",hp="_barFill_k0wbw_37",gp="_probabilityFill_k0wbw_50",fp="_providerFill_k0wbw_54",bp="_barValue_k0wbw_58",xp="_barCount_k0wbw_64",be={chart:cp,bars:dp,bar:up,barLabel:pp,barTrack:mp,barFill:hp,probabilityFill:gp,providerFill:fp,barValue:bp,barCount:xp};function Vi(e){return e.outcome!=="expected-cache-hit"}function zi(e){const s=new Map;for(const n of e){if(n.elapsedSinceExpectedCacheMs===void 0)continue;const a=n.elapsedSinceExpectedCacheMs/6e4;if(!Number.isFinite(a)||a<0)continue;const i=a<.5?0:a<1?.5:2**Math.floor(Math.log2(a)),o=i===0?.5:i*2,r=s.get(i)??{fromMinutes:i,toMinutes:o,misses:0,hits:0,wastedTokens:0,events:[]};r.events.push(n),Vi(n)?(r.misses+=1,r.wastedTokens+=n.wastedInputTokens):r.hits+=1,s.set(i,r)}return[...s.values()].sort((n,a)=>n.fromMinutes-a.fromMinutes)}function Fa(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${Math.round(e/1e3)}K`:String(e)}function Ba(e){return e===0?"0":e<1?`${e*60}s`:`${e}m`}function Gi(e){return`${Ba(e.fromMinutes)}–${Ba(e.toMinutes)}`}function vp(e,s){var n;return`${e.provider} / ${((n=e.model)==null?void 0:n.trim())||s}`}function nn(e,s,n,a){const i=[...new Set(e.map(o=>vp(o,s)))].sort();return i.length>0?`${n}
12
+ ${i.join(`
13
+ `)}`:a}function Ki(e){const s=e.misses+e.hits;return s===0?0:e.misses/s}function Yi(e){const s=e*100;return s===0?"0%":s<.1?`${s.toFixed(2)}%`:s<10?`${s.toFixed(1)}%`:`${Math.round(s)}%`}function Qi(e){return e<=0?0:Math.log10(1+Math.min(1,e)*999)/3*100}function Sp({events:e}){const{t:s}=K(),n=r=>nn(r,s("cacheMissUnknownModel"),s("cacheMissTupleTooltipHeading"),s("cacheMissTupleTooltipEmpty")),a=zi(e);if(a.length===0)return t.jsx("p",{className:"settings-empty",children:s("cacheMissChartEmpty")});const i=Math.max(...a.map(r=>r.wastedTokens),1),o=a.reduce((r,d)=>r+d.wastedTokens,0);return t.jsxs("div",{className:be.chart,children:[t.jsx("p",{className:"settings-hint",children:s("cacheMissChartTotal",{tokens:Fa(o)})}),t.jsx("ol",{className:be.bars,children:a.map(r=>t.jsxs("li",{className:be.bar,title:n(r.events),children:[t.jsx("span",{className:be.barLabel,children:Gi(r)}),t.jsx("span",{className:be.barTrack,children:t.jsx("span",{className:be.barFill,style:{width:`${Math.round(r.wastedTokens/i*100)}%`},"data-empty":r.wastedTokens===0?"":void 0})}),t.jsx("span",{className:be.barValue,children:Fa(r.wastedTokens)}),t.jsx("span",{className:be.barCount,children:s("cacheMissChartRatio",{misses:String(r.misses),total:String(r.misses+r.hits)})})]},r.fromMinutes))})]})}function yp({events:e}){const{t:s}=K(),n=o=>nn(o,s("cacheMissUnknownModel"),s("cacheMissTupleTooltipHeading"),s("cacheMissTupleTooltipEmpty")),a=e.filter(o=>o.completeProbabilitySample===!0),i=zi(a);return i.length===0?t.jsx("p",{className:"settings-empty",children:s("cacheMissProbabilityEmpty")}):t.jsxs("div",{className:be.chart,children:[t.jsx("p",{className:"settings-hint",children:s("cacheMissProbabilitySampleNote")}),t.jsx("ol",{className:be.bars,children:i.map(o=>{const r=Ki(o);return t.jsxs("li",{className:be.bar,title:n(o.events),children:[t.jsx("span",{className:be.barLabel,children:Gi(o)}),t.jsx("span",{className:be.barTrack,children:t.jsx("span",{className:`${be.barFill} ${be.probabilityFill}`,style:{width:`${Qi(r)}%`},"data-empty":r===0?"":void 0})}),t.jsx("span",{className:be.barValue,children:Yi(r)}),t.jsx("span",{className:be.barCount,children:s("cacheMissChartRatio",{misses:String(o.misses),total:String(o.misses+o.hits)})})]},o.fromMinutes)})})]})}function jp(e){const s=new Map;for(const n of e){if(n.completeProbabilitySample!==!0)continue;const a=s.get(n.provider)??{provider:n.provider,misses:0,hits:0,events:[]};a.events.push(n),Vi(n)?a.misses+=1:a.hits+=1,s.set(n.provider,a)}return[...s.values()].sort((n,a)=>n.provider.localeCompare(a.provider))}function Tp({events:e}){const{t:s}=K(),n=i=>nn(i,s("cacheMissUnknownModel"),s("cacheMissTupleTooltipHeading"),s("cacheMissTupleTooltipEmpty")),a=jp(e);return a.length===0?t.jsx("p",{className:"settings-empty",children:s("cacheMissProviderEmpty")}):t.jsxs("div",{className:be.chart,children:[t.jsx("p",{className:"settings-hint",children:s("cacheMissProbabilitySampleNote")}),t.jsx("ol",{className:be.bars,children:a.map(i=>{const o=Ki(i);return t.jsxs("li",{className:be.bar,title:n(i.events),children:[t.jsx("span",{className:be.barLabel,children:i.provider}),t.jsx("span",{className:be.barTrack,children:t.jsx("span",{className:`${be.barFill} ${be.providerFill}`,style:{width:`${Qi(o)}%`},"data-empty":o===0?"":void 0})}),t.jsx("span",{className:be.barValue,children:Yi(o)}),t.jsx("span",{className:be.barCount,children:s("cacheMissChartRatio",{misses:String(i.misses),total:String(i.misses+i.hits)})})]},i.provider)})})]})}const Ha=500,kt=96,Es=kt+1;function xt(e,s,n,a){const i=Number.parseInt(e,10);return Number.isFinite(i)?Math.max(n,Math.min(a,i)):s}function Wa(e){return{...ha,...e,providerFreshWindowMinutes:{...ha.providerFreshWindowMinutes,...e==null?void 0:e.providerFreshWindowMinutes}}}function vt(e,s){return e.providerFreshWindowMinutes[s]??e.freshWindowMinutes}function $a(e,s){if(s)return e;const n={...e};return delete n.ignoreAfterMinutes,n}function wp(e,s,n,a,i=!1){const o=s===null?null:a-s*60*6e4;return e.filter(r=>{if(!i&&!r.expectedInputCost.freshEnough)return!1;const d=Date.parse(r.timestamp);return o!==null&&(!Number.isFinite(d)||d<o)?!1:n===0||r.elapsedSinceExpectedCacheMs===void 0||r.elapsedSinceExpectedCacheMs<=n*6e4})}function Cp(){const{t:e}=K();_e(e("cacheMissBillingTitle"));const{version:s}=We(),n=me(s,lr),a=me(s,cr),i=rs(),{settings:o,isLoading:r,error:d,updateSettings:u}=Ce(),[h,f]=l.useState([]),[p,c]=l.useState(null),[x,b]=l.useState(null),[v,T]=l.useState(""),[I,C]=l.useState(!1),O=xi(6e4),k=Wa(o==null?void 0:o.cacheMissBilling),y=l.useCallback(async M=>{const R=Wa(o==null?void 0:o.cacheMissBilling);await u({cacheMissBilling:$a({...R,...M,providerFreshWindowMinutes:{...R.providerFreshWindowMinutes,...M.providerFreshWindowMinutes}},n)})},[o==null?void 0:o.cacheMissBilling,n,u]),S=l.useCallback(async M=>{await u({cacheMissBilling:$a(M,n)})},[n,u]);$e(o?k:null,S);const m=wp(h,x,k.ignoreAfterMinutes,O,I);l.useEffect(()=>{let M=!1;return he.getCacheMissBillingEvents(Ha,a).then(R=>{M||(f(R.events),c(null))}).catch(R=>{M||c(R instanceof Error?R.message:e("cacheMissBillingEventsLoadError"))}),()=>{M=!0}},[a,e]),l.useEffect(()=>{const M=$=>{f(D=>[$.record,...D.filter(F=>F.id!==$.record.id)].slice(0,Ha))},R=Je.on("cache-miss-billing",M),N=a?Je.on("cache-miss-billing-expected-expiry",M):void 0;return()=>{R(),N==null||N()}},[a]);const _=M=>{if(M===Es){b(null),T("");return}b(M),T(String(M))},A=M=>{if(T(M),M.trim()===""){b(null);return}const R=Number.parseInt(M,10);Number.isInteger(R)&&R>=1&&R<=kt&&b(R)},P=()=>{if(v.trim()==="")return;const M=xt(v,x??kt,1,kt);b(M),T(String(M))};return r?t.jsx(oe,{description:e("cacheMissBillingLoading")}):t.jsxs(t.Fragment,{children:[t.jsxs(oe,{description:e("cacheMissBillingDescription"),children:[t.jsxs("div",{className:"settings-group",children:[t.jsx(w,{as:"label",label:e("cacheMissBillingEnableTitle"),description:e("cacheMissBillingEnableDescription"),children:t.jsx("input",{type:"checkbox",checked:k.enabled,onChange:M=>void y({enabled:M.currentTarget.checked}),"aria-label":e("cacheMissBillingEnableTitle")})}),t.jsx(w,{as:"label",label:e("cacheMissBillingToastTitle"),description:e("cacheMissBillingToastDescription"),children:t.jsx("input",{type:"checkbox",checked:k.showToasts,disabled:!k.enabled,onChange:M=>void y({showToasts:M.currentTarget.checked}),"aria-label":e("cacheMissBillingToastTitle")})}),t.jsx(w,{label:e("cacheMissBillingClaudeFreshWindowTitle"),description:e("cacheMissBillingClaudeFreshWindowDescription"),className:"settings-item--wide-control",children:t.jsx("div",{className:"settings-item-actions",children:t.jsxs("span",{className:"settings-input-unit",children:[t.jsx("input",{type:"number",className:"settings-input-small",min:1,max:1440,defaultValue:vt(k,"claude"),disabled:!k.enabled,onBlur:M=>{const R=vt(k,"claude"),N=xt(M.currentTarget.value,R,1,1440);M.currentTarget.value=String(N),N!==R&&y({providerFreshWindowMinutes:{claude:N}})},"aria-label":e("cacheMissBillingClaudeFreshWindowTitle")},`fresh-claude-${vt(k,"claude")}`),t.jsx("span",{children:e("cacheMissBillingMinutesUnit")})]})})}),t.jsx(w,{label:e("cacheMissBillingCodexFreshWindowTitle"),description:e("cacheMissBillingCodexFreshWindowDescription"),className:"settings-item--wide-control",children:t.jsx("div",{className:"settings-item-actions",children:t.jsxs("span",{className:"settings-input-unit",children:[t.jsx("input",{type:"number",className:"settings-input-small",min:1,max:1440,defaultValue:vt(k,"codex"),disabled:!k.enabled,onBlur:M=>{const R=vt(k,"codex"),N=xt(M.currentTarget.value,R,1,1440);M.currentTarget.value=String(N),N!==R&&y({providerFreshWindowMinutes:{codex:N}})},"aria-label":e("cacheMissBillingCodexFreshWindowTitle")},`fresh-codex-${vt(k,"codex")}`),t.jsx("span",{children:e("cacheMissBillingMinutesUnit")})]})})}),t.jsx(w,{label:e("cacheMissBillingMinimumTokensTitle"),description:e("cacheMissBillingMinimumTokensDescription"),className:"settings-item--wide-control",children:t.jsx("div",{className:"settings-item-actions",children:t.jsxs("span",{className:"settings-input-unit",children:[t.jsx("input",{type:"number",className:`settings-input-small ${Be.tokenInput}`,min:1,max:5e6,step:1e3,defaultValue:k.minimumWastedTokens,disabled:!k.enabled,onBlur:M=>{const R=xt(M.currentTarget.value,k.minimumWastedTokens,1,5e6);M.currentTarget.value=String(R),R!==k.minimumWastedTokens&&y({minimumWastedTokens:R})},"aria-label":e("cacheMissBillingMinimumTokensTitle")},`minimum-${k.minimumWastedTokens}`),t.jsx("span",{children:e("cacheMissBillingTokensUnit")})]})})}),t.jsx(w,{label:e("cacheMissBillingRecentActivityTitle"),description:e("cacheMissBillingRecentActivityDescription"),className:"settings-item--wide-control",children:t.jsx("div",{className:"settings-item-actions",children:t.jsxs("span",{className:"settings-input-unit",children:[t.jsx("input",{type:"number",className:"settings-input-small",min:0,max:1440,defaultValue:k.recentActivityMinutes,disabled:!k.enabled,onBlur:M=>{const R=xt(M.currentTarget.value,k.recentActivityMinutes,0,1440);M.currentTarget.value=String(R),R!==k.recentActivityMinutes&&y({recentActivityMinutes:R})},"aria-label":e("cacheMissBillingRecentActivityTitle")},`recent-${k.recentActivityMinutes}`),t.jsx("span",{children:e("cacheMissBillingMinutesUnit")})]})})}),n&&t.jsx(w,{label:e("cacheMissBillingIgnoreAfterTitle"),description:e("cacheMissBillingIgnoreAfterDescription"),className:"settings-item--wide-control",children:t.jsx("div",{className:"settings-item-actions",children:t.jsxs("span",{className:"settings-input-unit",children:[t.jsx("input",{type:"number",className:"settings-input-small",min:0,max:1440,defaultValue:k.ignoreAfterMinutes,disabled:!k.enabled,onBlur:M=>{const R=xt(M.currentTarget.value,k.ignoreAfterMinutes,0,1440);M.currentTarget.value=String(R),R!==k.ignoreAfterMinutes&&y({ignoreAfterMinutes:R})},"aria-label":e("cacheMissBillingIgnoreAfterTitle")},`ignore-after-${k.ignoreAfterMinutes}`),t.jsx("span",{children:e("cacheMissBillingMinutesUnit")})]})})})]}),d&&t.jsx("p",{className:"settings-warning",children:d})]}),t.jsxs(oe,{title:e("cacheMissEvidenceTitle"),description:e("cacheMissEvidenceDescription"),children:[p&&t.jsx("p",{className:"settings-warning",children:p}),t.jsx(we,{children:t.jsxs("div",{className:Be.evidence,children:[t.jsxs("div",{className:Be.recencyControl,children:[t.jsxs("div",{className:Be.recencyHeader,children:[t.jsxs("div",{children:[t.jsx("h3",{children:e("cacheMissRecencyTitle")}),t.jsx("p",{children:e("cacheMissRecencyDescription")})]}),t.jsx("span",{children:e("cacheMissRecencySummary",{shown:m.length,total:h.length})})]}),a&&t.jsxs("label",{className:Be.expectedExpiryToggle,children:[t.jsx("input",{type:"checkbox",checked:I,onChange:M=>C(M.currentTarget.checked),"aria-label":e("cacheMissExpectedExpiryToggleTitle")}),t.jsxs("span",{children:[t.jsx("strong",{children:e("cacheMissExpectedExpiryToggleTitle")}),t.jsx("span",{children:e("cacheMissExpectedExpiryToggleDescription")})]})]}),t.jsxs("div",{className:Be.recencyInputs,children:[t.jsxs("div",{className:Be.sliderStack,children:[t.jsx("input",{type:"range",min:1,max:Es,step:1,value:x??Es,onChange:M=>_(Number.parseInt(M.currentTarget.value,10)),"aria-label":e("cacheMissRecencySliderLabel")}),t.jsxs("div",{className:Be.sliderLabels,"aria-hidden":"true",children:[t.jsx("span",{children:"1h"}),t.jsx("span",{children:"96h"}),t.jsx("span",{children:"∞"})]})]}),t.jsxs("label",{className:Be.recencyTextInput,children:[t.jsx("span",{children:e("cacheMissRecencyHoursLabel")}),t.jsxs("span",{className:"settings-input-unit",children:[t.jsx("input",{type:"number",min:1,max:kt,value:v,placeholder:"∞",onChange:M=>A(M.currentTarget.value),onBlur:P}),t.jsx("span",{children:e("cacheMissRecencyHoursUnit")})]})]})]})]}),t.jsxs("div",{className:Be.chartGrid,children:[t.jsxs("section",{className:Be.chartPanel,children:[t.jsx("h3",{children:e("cacheMissChartTitle")}),t.jsx("p",{children:e("cacheMissChartDescription")}),t.jsx(Sp,{events:m})]}),t.jsxs("section",{className:Be.chartPanel,children:[t.jsx("h3",{children:e("cacheMissProbabilityTitle")}),t.jsx("p",{children:e("cacheMissProbabilityDescription")}),t.jsx(yp,{events:m})]}),t.jsxs("section",{className:Be.chartPanel,children:[t.jsx("h3",{children:e("cacheMissProviderTitle")}),t.jsx("p",{children:e("cacheMissProviderDescription")}),t.jsx(Tp,{events:m})]})]}),t.jsxs("section",{className:Be.eventTableSection,children:[t.jsx("h3",{children:e("cacheMissEventsTitle")}),t.jsx("p",{children:e("cacheMissBillingEventsDescription")}),t.jsx(lp,{events:m,basePath:i,recencyHours:x})]})]})})]})]})}function Np(e){let s;try{s=Js(e)}catch{return null}const n=new URL(s);if(!n.pathname.endsWith("/ws"))return null;const a=n.pathname.slice(0,-3),i=new URL(n);i.pathname=`${a}/mux`;const o=new URL(n);return o.protocol=n.protocol==="wss:"?"https:":"http:",o.pathname=`${a}/`,{healthUrl:new URL("health",o).toString(),httpBaseUrl:o.toString(),key:`${n.protocol}//${n.host}${a}`,muxUrl:i.toString(),relayUrl:s,statsUrl:new URL("stats",o).toString()}}const Va={"live-tail":"developmentSessionScrollMemoryModeLiveTailDescription","remember-place":"developmentSessionScrollMemoryModeRememberPlaceDescription","no-memory":"developmentSessionScrollMemoryModeNoMemoryDescription"},zt={"live-tail":"developmentSessionScrollMemoryModeLiveTail","remember-place":"developmentSessionScrollMemoryModeRememberPlace","no-memory":"developmentSessionScrollMemoryModeNoMemory"};function Ep(){var F;const{t:e}=K(),s=rs(),n=At(),a=n!=null&&n.connection?n.currentRelayUsername?sl(n.currentRelayUsername):n.currentHostId?hi(n.currentHostId):void 0:void 0,i=(a==null?void 0:a.mode)==="relay"?a.relayUrl:void 0,o=i?(F=Np(i))==null?void 0:F.statsUrl:void 0;_e(e("developmentSectionTitle"));const{isManualReloadMode:r,pendingReloads:d,connected:u,reloadBackend:h,unsafeToRestart:f,interruptibleSessionCount:p,queuedSessionMessageCount:c}=nl(),{settings:x,setEnabled:b}=tc(),{crossHostDelegationEnabled:v,setCrossHostDelegationEnabled:T,relayDebugEnabled:I,setRelayDebugEnabled:C,remoteLogCollectionEnabled:O,setRemoteLogCollectionEnabled:k}=ui(),{sessionScrollBehaviorMode:y,setSessionScrollBehaviorMode:S}=pi(),{ignoredTools:m,clearIgnoredTools:_}=sc(),{settings:A,updateSetting:P}=Ce(),M=l.useMemo(()=>A?{validationEnabled:x.enabled,crossHostDelegationEnabled:v,relayDebugEnabled:I,remoteLogCollectionEnabled:O,sessionScrollBehaviorMode:y,serviceWorkerEnabled:A.serviceWorkerEnabled??!0,workstreamsEnabled:A.workstreamsEnabled??!1}:null,[x.enabled,v,I,O,A,y]),R=l.useCallback(E=>{b(E.validationEnabled),T(E.crossHostDelegationEnabled),C(E.relayDebugEnabled),k(E.remoteLogCollectionEnabled),S(E.sessionScrollBehaviorMode),P("serviceWorkerEnabled",E.serviceWorkerEnabled),P("workstreamsEnabled",E.workstreamsEnabled)},[b,T,C,k,S,P]);$e(M,R);const[N,$]=l.useState(!1);l.useEffect(()=>{N&&u&&$(!1)},[N,u]);const D=async()=>{$(!0),await h()},L=p>0&&c>0?e("developmentInterruptedWarningActiveAndQueued",{activeCount:p,activeSuffix:p!==1?"s":"",queuedCount:c,queuedSuffix:c!==1?"s":""}):c>0?e("developmentInterruptedWarningQueued",{count:c,suffix:c!==1?"s":""}):e("developmentInterruptedWarning",{count:p,suffix:p!==1?"s ":" "});return t.jsxs(oe,{children:[t.jsxs("div",{className:"settings-group",children:[t.jsx(w,{label:e("developmentSchemaTitle"),description:e("developmentSchemaDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:x.enabled,onChange:E=>b(E.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})}),m.length>0&&t.jsx(w,{label:e("developmentIgnoredToolsTitle"),description:e("developmentIgnoredToolsDescription"),info:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:e("developmentIgnoredToolsTitle")}),t.jsx("p",{children:e("developmentIgnoredToolsDescription")}),t.jsx("div",{className:"ignored-tools-list",children:m.map(E=>t.jsx("span",{className:"ignored-tool-badge",children:E},E))})]}),children:t.jsx("button",{type:"button",className:"settings-button settings-button-secondary",onClick:_,children:e("developmentClearIgnored")})}),t.jsx(w,{label:e("developmentCrossHostDelegationTitle"),description:e("developmentCrossHostDelegationDescription"),className:"settings-item--wide-control",children:t.jsxs("div",{className:"settings-item-actions",children:[v&&t.jsx(ci,{className:"settings-button settings-button-secondary",to:`${s}/-/hosts`,children:e("developmentHostsPreviewOpen")}),t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox","aria-label":e("developmentCrossHostDelegationTitle"),checked:v,onChange:E=>T(E.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})]})}),o&&t.jsx(w,{label:e("developmentRelayMonitorTitle"),description:e("developmentRelayMonitorDescription"),children:t.jsx("a",{className:"settings-button settings-button-secondary",href:o,target:"_blank",rel:"noreferrer",children:e("developmentRelayMonitorOpen")})}),t.jsx(w,{label:e("developmentRelayDebugTitle"),description:e("developmentRelayDebugDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox","aria-label":e("developmentRelayDebugTitle"),checked:I,onChange:E=>C(E.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})}),t.jsx(w,{label:e("developmentDiagnosticsTitle"),description:e("developmentDiagnosticsDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:O,onChange:E=>k(E.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})}),t.jsx(w,{label:e("developmentServiceWorkerTitle"),description:e("developmentServiceWorkerDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:(A==null?void 0:A.serviceWorkerEnabled)??!0,onChange:E=>P("serviceWorkerEnabled",E.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})}),t.jsx(w,{label:e("developmentWorkstreamsTitle"),description:e("developmentWorkstreamsDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:(A==null?void 0:A.workstreamsEnabled)??!1,onChange:E=>P("workstreamsEnabled",E.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})})]}),t.jsx("div",{className:"settings-group",children:t.jsx(w,{label:e("developmentSessionScrollMemoryTitle"),description:e("developmentSessionScrollMemoryDescription"),keywords:[e("developmentSessionScrollMemoryControlTitle"),e("developmentSessionScrollMemoryKeywords"),...xs.flatMap(E=>[e(zt[E]),e(Va[E])])],valueText:e(zt[y]),className:"settings-item--wide-control",info:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:e("developmentSessionScrollMemoryTitle")}),t.jsx("p",{children:e("developmentSessionScrollMemoryDescription")}),t.jsx("ul",{className:"settings-option-description-list",children:xs.map(E=>t.jsxs("li",{children:[t.jsx("strong",{children:e(zt[E])}),t.jsx("span",{children:e(Va[E])})]},E))})]}),children:t.jsx("div",{className:"settings-item-actions",children:t.jsx("select",{className:"settings-select",value:y,onChange:E=>S(E.target.value),"aria-label":e("developmentSessionScrollMemoryControlTitle"),children:xs.map(E=>t.jsx("option",{value:E,children:e(zt[E])},E))})})})}),r&&t.jsx("div",{className:"settings-group",children:t.jsx(w,{label:e("developmentRestartTitle"),description:e("developmentRestartDescription"),info:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:e("developmentRestartTitle")}),t.jsxs("p",{children:[e("developmentRestartDescription"),d.backend&&t.jsxs("span",{className:"settings-pending",children:[" ",e("developmentChangesPending")]})]}),f&&t.jsx("p",{className:"settings-warning",children:L})]}),children:t.jsx("button",{type:"button",className:`settings-button ${f?"settings-button-danger":""}`,onClick:D,disabled:N,children:e(N?"developmentRestarting":f?"developmentRestartAnyway":"developmentRestart")})})})]})}const kp=1e4;function _p(e,s){return e===s||JSON.stringify(e)===JSON.stringify(s)}function Dt({fetcher:e,current:s,apply:n,enabled:a=!0,isEqual:i=_p,minIntervalMs:o=kp}){const r=l.useRef(e);r.current=e;const d=l.useRef(s);d.current=s;const u=l.useRef(n);u.current=n;const h=l.useRef(i);h.current=i;const f=l.useRef(Date.now()),p=l.useRef(!1);l.useEffect(()=>{if(!a)return;const c=async()=>{if(!p.current&&!(Date.now()-f.current<o)){p.current=!0;try{const v=await r.current();f.current=Date.now();const T=d.current;(T===null||!h.current(T,v))&&u.current(v)}catch{}finally{p.current=!1}}},x=Je.on("reconnect",()=>{c()}),b=Je.on("refresh",()=>{c()});return()=>{x(),b()}},[a,o])}function Mp(){const[e,s]=l.useState({profiles:[],isLoading:!0,error:null}),n=l.useCallback(async()=>{s(i=>({...i,isLoading:!0,error:null}));try{const{profiles:i}=await he.getBrowserProfiles();s({profiles:i,isLoading:!1,error:null})}catch(i){console.error("[useBrowserProfiles] Failed to fetch:",i),s(o=>({...o,isLoading:!1,error:i instanceof Error?i.message:"Failed to load profiles"}))}},[]);l.useEffect(()=>{n()},[n]),Dt({fetcher:()=>he.getBrowserProfiles().then(i=>i.profiles),current:e.profiles,apply:i=>s(o=>({...o,profiles:i,error:null}))});const a=l.useCallback(async i=>{s(o=>({...o,isLoading:!0,error:null}));try{await he.deleteBrowserProfile(i),await n()}catch(o){console.error("[useBrowserProfiles] Failed to delete:",o),s(r=>({...r,isLoading:!1,error:o instanceof Error?o.message:"Failed to delete profile"}))}},[n]);return{...e,deleteProfile:a,refetch:n}}function Xi(){const[e,s]=l.useState({connections:new Map,isLoading:!0,error:null}),n=l.useCallback(async(i=!1)=>{i||s(o=>({...o,isLoading:!0,error:null}));try{const{connections:o}=await he.getConnections(),r=new Map;for(const d of o)r.set(d.browserProfileId,d);s(d=>({...d,connections:r,isLoading:!1,error:null}))}catch(o){if(console.error("[useConnectedDevices] Failed to fetch:",o),i)return;s(r=>({...r,isLoading:!1,error:o instanceof Error?o.message:"Failed to load connections"}))}},[]),a=l.useCallback(()=>n(!1),[n]);return l.useEffect(()=>{n()},[n]),l.useEffect(()=>{const i=Je.on("browser-tab-connected",u=>{s(h=>{var p;const f=new Map(h.connections);return f.set(u.browserProfileId,{browserProfileId:u.browserProfileId,connectionCount:u.tabCount,connectedAt:u.timestamp,deviceName:(p=h.connections.get(u.browserProfileId))==null?void 0:p.deviceName}),{...h,connections:f}})}),o=Je.on("browser-tab-disconnected",u=>{s(h=>{const f=new Map(h.connections);if(u.tabCount===0)f.delete(u.browserProfileId);else{const p=f.get(u.browserProfileId);p&&f.set(u.browserProfileId,{...p,connectionCount:u.tabCount})}return{...h,connections:f}})}),r=Je.on("reconnect",()=>{n(!0)}),d=Je.on("refresh",()=>{n(!0)});return()=>{i(),o(),r(),d()}},[n]),{...e,connectionList:Array.from(e.connections.values()),refetch:a}}const Mt="ya:push-subscription-changed";function za(){window.dispatchEvent(new Event(Mt))}function Ap(){const[e,s]=l.useState({devices:[],isLoading:!0,error:null}),n=l.useCallback(async()=>{s(o=>({...o,isLoading:!0,error:null}));try{const{subscriptions:o}=await he.getPushSubscriptions();s({devices:o,isLoading:!1,error:null})}catch(o){console.error("[useSubscribedDevices] Failed to fetch:",o),s(r=>({...r,isLoading:!1,error:o instanceof Error?o.message:"Failed to load devices"}))}},[]);l.useEffect(()=>{n()},[n]),l.useEffect(()=>{const o=()=>{n()};return window.addEventListener(Mt,o),()=>window.removeEventListener(Mt,o)},[n]),Dt({fetcher:()=>he.getPushSubscriptions().then(o=>o.subscriptions),current:e.devices,apply:o=>s(r=>({...r,devices:o,error:null}))});const a=l.useCallback(async o=>{s(r=>({...r,isLoading:!0,error:null}));try{await he.deletePushSubscription(o),await n()}catch(r){console.error("[useSubscribedDevices] Failed to remove:",r),s(d=>({...d,isLoading:!1,error:r instanceof Error?r.message:"Failed to remove device"}))}},[n]),i=l.useCallback(async(o,r={})=>{await he.testPush(o,r.message,r.displayUrgency,r.deliveryUrgency)},[]);return{...e,removeDevice:a,sendTest:i,refetch:n}}const Dp=nc("sw.js"),Pp=6e4,Vs="push-permission-request-timed-out";class Ga extends Error{}function an(){const[e,s]=l.useState({isSupported:!1,isSubscribed:!1,isLoading:!0,error:null,permission:"default",browserProfileId:null}),[n,a]=l.useState(null),i=l.useRef(null),o=typeof window<"u"&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window;l.useEffect(()=>{(async()=>{if(!o){const x=localStorage.getItem(Ye.browserProfileId);s(b=>({...b,isSupported:!1,isLoading:!1,error:"Push notifications not supported in this browser",browserProfileId:x}));return}try{const x=await navigator.serviceWorker.register(Dp);a(x),await navigator.serviceWorker.ready;const b=await x.pushManager.getSubscription(),v=Bt();s({isSupported:!0,isSubscribed:!!b,isLoading:!1,error:null,permission:Notification.permission,browserProfileId:v})}catch(x){console.error("[usePushNotifications] Init error:",x),s(b=>({...b,isSupported:!0,isLoading:!1,error:x instanceof Error?x.message:"Failed to initialize"}))}})()},[o]),l.useEffect(()=>{if(!n)return;let c=!1;const x=async()=>{try{const b=await n.pushManager.getSubscription();if(c)return;s(v=>({...v,isSubscribed:!!b,isLoading:!1,error:null}))}catch(b){if(c)return;s(v=>({...v,isLoading:!1,error:b instanceof Error?b.message:"Failed to refresh subscription"}))}};return window.addEventListener(Mt,x),()=>{c=!0,window.removeEventListener(Mt,x)}},[n]),l.useEffect(()=>{if(!o)return;const c=()=>{var v;const b=Notification.permission;b!=="default"&&((v=i.current)==null||v.call(i,b)),s(T=>b===T.permission?T:{...T,permission:b,error:b==="granted"&&T.error===Vs?null:T.error})},x=()=>{document.visibilityState==="visible"&&c()};return window.addEventListener("focus",c),document.addEventListener("visibilitychange",x),()=>{window.removeEventListener("focus",c),document.removeEventListener("visibilitychange",x)}},[o]);const r=l.useCallback(async()=>{let c;try{return await Promise.race([Notification.requestPermission(),new Promise(x=>{i.current=x}),new Promise((x,b)=>{c=window.setTimeout(()=>{b(new Ga)},Pp)})])}finally{i.current=null,c!==void 0&&window.clearTimeout(c)}},[]),d=l.useCallback(async()=>{if(!n){s(c=>({...c,error:"Service worker not ready"}));return}s(c=>({...c,isLoading:!0,error:null}));try{const c=await r();if(s(C=>({...C,permission:c})),c!=="granted"){s(C=>({...C,isLoading:!1,error:"Notification permission denied"}));return}const{publicKey:x}=await he.getPushPublicKey(),b=Ip(x),v=await n.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:b.buffer}),T=Bt(),I=v.toJSON();await he.subscribePush(T,I,Lp()),s(C=>({...C,isSubscribed:!0,isLoading:!1,error:null,browserProfileId:T})),za()}catch(c){if(c instanceof Ga){s(x=>({...x,isLoading:!1,error:Vs}));return}console.error("[usePushNotifications] Subscribe error:",c),s(x=>({...x,isLoading:!1,error:c instanceof Error?c.message:"Failed to subscribe"}))}},[n,r]),u=l.useCallback(async()=>{if(!n){s(c=>({...c,error:"Service worker not ready"}));return}s(c=>({...c,isLoading:!0,error:null}));try{const c=await n.pushManager.getSubscription();c&&await c.unsubscribe();const x=Bt();await he.unsubscribePush(x),s(b=>({...b,isSubscribed:!1,isLoading:!1,error:null})),za()}catch(c){console.error("[usePushNotifications] Unsubscribe error:",c),s(x=>({...x,isLoading:!1,error:c instanceof Error?c.message:"Failed to unsubscribe"}))}},[n]),h=l.useCallback(async(c="normal",x="high")=>{const b=Bt();s(v=>({...v,isLoading:!0,error:null}));try{return await he.testPush(b,void 0,c,x),s(v=>({...v,isLoading:!1})),!0}catch(v){return console.error("[usePushNotifications] Test push error:",v),s(T=>({...T,isLoading:!1,error:v instanceof Error?v.message:"Failed to send test"})),!1}},[]),f=l.useCallback(async()=>{var x;const c=(x=navigator.serviceWorker)==null?void 0:x.controller;return c?new Promise(b=>{const v=new MessageChannel;v.port1.onmessage=T=>{var I;b(((I=T.data)==null?void 0:I.logs)||[])},c.postMessage({type:"get-sw-logs"},[v.port2]),setTimeout(()=>b([]),2e3)}):(console.warn("[usePushNotifications] No active service worker"),[])},[]),p=l.useCallback(async()=>{var x;const c=(x=navigator.serviceWorker)==null?void 0:x.controller;if(c)return new Promise(b=>{const v=new MessageChannel;v.port1.onmessage=()=>b(),c.postMessage({type:"clear-sw-logs"},[v.port2]),setTimeout(b,1e3)})},[]);return{...e,subscribe:d,unsubscribe:u,sendTest:h,getSwLogs:f,clearSwLogs:p}}function Ip(e){const s="=".repeat((4-e.length%4)%4),n=(e+s).replace(/-/g,"+").replace(/_/g,"/"),a=window.atob(n),i=new Uint8Array(a.length);for(let o=0;o<a.length;++o)i[o]=a.charCodeAt(o);return i}function Lp(){const e=navigator.userAgent;return/iPhone/.test(e)?"iPhone":/iPad/.test(e)?"iPad":/Android/.test(e)?"Android":/Mac/.test(e)?"Mac":/Windows/.test(e)?"Windows":/Linux/.test(e)?"Linux":"Browser"}function Ka(e,s){const n=new Date(e),i=new Date().getTime()-n.getTime(),o=Math.floor(i/(1e3*60)),r=Math.floor(i/(1e3*60*60)),d=Math.floor(i/(1e3*60*60*24));return o<1?s("devicesJustNow"):o<60?s("devicesMinutesAgo",{count:o,suffix:o===1?"":"s"}):r<24?s("devicesHoursAgo",{count:r,suffix:r===1?"":"s"}):d===1?s("devicesYesterday"):d<7?`${d} days ago`:n.toLocaleDateString()}function Rp(){const{t:e}=K();_e(e("devicesProfilesTitle"));const{profiles:s,isLoading:n,error:a,deleteProfile:i}=Mp(),{browserProfileId:o}=an(),{connections:r}=Xi();return t.jsx(oe,{description:e("devicesProfilesDescription"),children:t.jsxs(we,{children:[a&&t.jsx("p",{className:"form-error",children:a}),t.jsx("div",{className:"settings-group",children:n?t.jsx("p",{className:"settings-hint",children:e("devicesLoadingProfiles")}):s.length===0?t.jsx("p",{className:"settings-hint",children:e("devicesEmpty")}):t.jsx("div",{className:"device-list",children:s.map(d=>{const u=d.browserProfileId===o,h=r.has(d.browserProfileId),f=d.deviceName||`${d.browserProfileId.slice(0,8)}...`;return t.jsxs("div",{className:"device-list-item device-profile-item",children:[t.jsxs("div",{className:"device-list-info",children:[t.jsxs("strong",{children:[t.jsx("span",{className:`device-status ${h?"device-status-online":"device-status-offline"}`,title:e(h?"devicesConnected":"devicesDisconnected")}),f,u&&t.jsx("span",{className:"device-current-badge",children:e("devicesThisDevice")})]}),t.jsx("div",{className:"device-origins",children:d.origins.map(p=>{const{browser:c,os:x}=vi(p.userAgent);return t.jsxs("div",{className:"device-origin",children:[t.jsx("code",{className:"device-origin-url",children:p.origin}),t.jsxs("span",{className:"device-origin-details",children:[c," · ",x]}),t.jsx("span",{className:"device-origin-time",children:e("devicesLastSeen",{date:Ka(p.lastSeen,e)})})]},p.origin)})}),t.jsx("p",{className:"device-profile-meta",children:e("devicesFirstSeen",{date:Ka(d.createdAt,e)})})]}),t.jsx("button",{type:"button",className:"settings-button settings-button-danger-subtle",onClick:()=>i(d.browserProfileId),title:e("devicesForgetThisDevice"),children:e("devicesForget")})]},d.browserProfileId)})})})]})})}const Op=["high","medium","low"];function Up(e,s,n){return n!=null&&n.length?n.includes("start"):e==="emulator"&&s==="stopped"}function Fp(e,s,n){return n!=null&&n.length?n.includes("stop"):e==="emulator"&&s!=="stopped"}function Bp(){const{t:e}=K();_e(e("emulatorSectionTitle"));const{emulators:s,loading:n,error:a,startEmulator:i,stopEmulator:o,refresh:r}=ac(),{maxFps:d,setMaxFps:u,maxWidth:h,setMaxWidth:f,quality:p,setQuality:c,adaptiveFps:x,setAdaptiveFps:b}=ic(),{settings:v,isLoading:T,error:I,updateSetting:C}=Ce(),[O,k]=l.useState(""),[y,S]=l.useState(null),m=(v==null?void 0:v.chromeOsHosts)??[],_=l.useMemo(()=>v?{maxFps:d,maxWidth:h,quality:p,adaptiveFps:x,deviceBridgeEnabled:v.deviceBridgeEnabled??!1,chromeOsHosts:v.chromeOsHosts??[]}:null,[v,d,h,p,x]),A=l.useCallback(N=>{u(N.maxFps),f(N.maxWidth),c(N.quality),b(N.adaptiveFps),C("deviceBridgeEnabled",N.deviceBridgeEnabled),C("chromeOsHosts",N.chromeOsHosts),S(null)},[u,f,c,b,C]);$e(_,A);const P=async()=>{const N=O.trim();if(!N){S(e("emulatorHostAliasRequired"));return}if(/\s/.test(N)){S(e("emulatorHostAliasNoSpaces"));return}const $=Array.from(new Set([...m,N]));try{await C("chromeOsHosts",$),k(""),S(null),await r()}catch(D){S(D instanceof Error?D.message:e("emulatorHostAliasSaveFailed"))}},M=async N=>{const $=m.filter(D=>D.toLowerCase()!==N.toLowerCase());try{await C("chromeOsHosts",$),S(null),await r()}catch(D){S(D instanceof Error?D.message:e("emulatorHostAliasRemoveFailed"))}},R=(v==null?void 0:v.deviceBridgeEnabled)??!1;return t.jsxs(oe,{children:[t.jsx("p",{className:"settings-description",children:e("emulatorSectionDescription")}),t.jsx("div",{className:"settings-group",children:t.jsx(w,{label:e("emulatorEnableTitle"),description:e("emulatorEnableDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:R,onChange:N=>{C("deviceBridgeEnabled",N.target.checked)},disabled:T}),t.jsx("span",{className:"toggle-slider"})]})})}),R?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"settings-group",children:[t.jsx("h3",{children:e("emulatorStreamQualityTitle")}),t.jsx("p",{className:"settings-description",children:e("emulatorStreamQualityDescription")}),t.jsx(w,{label:e("emulatorFrameRateTitle"),description:e("emulatorFrameRateDescription"),children:t.jsx("div",{className:"font-size-selector",children:oc.map(N=>t.jsxs("button",{type:"button",className:`font-size-option ${d===N?"active":""}`,onClick:()=>u(N),children:[N," fps"]},N))})}),t.jsx(w,{label:e("emulatorResolutionTitle"),description:e("emulatorResolutionDescription"),children:t.jsx("div",{className:"font-size-selector",children:rc.map(N=>t.jsxs("button",{type:"button",className:`font-size-option ${h===N?"active":""}`,onClick:()=>f(N),children:[N,"p"]},N))})}),t.jsx(w,{label:e("emulatorQualityTitle"),description:e("emulatorQualityDescription"),valueText:ba(p),children:t.jsx("div",{className:"font-size-selector",children:Op.map(N=>t.jsx("button",{type:"button",className:`font-size-option ${p===N?"active":""}`,onClick:()=>c(N),children:ba(N)},N))})}),t.jsx(w,{label:e("emulatorAdaptiveFpsTitle"),description:e("emulatorAdaptiveFpsDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:x,onChange:N=>b(N.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})})]}),t.jsxs("div",{className:"settings-group",children:[t.jsx("h3",{children:e("emulatorChromeOsHostsTitle")}),t.jsxs("p",{className:"settings-description",children:[e("emulatorChromeOsHostsDescription"),t.jsx("code",{children:" chromeroot"}),e("emulatorChromeOsHostsDescriptionSuffix")]}),t.jsx(w,{label:e("emulatorAddHostAliasTitle"),description:e("emulatorAddHostAliasDescription"),children:t.jsxs("form",{className:"settings-item-actions",onSubmit:N=>{N.preventDefault(),P()},children:[t.jsx("input",{type:"text",name:"chromeosHost",placeholder:e("emulatorHostAliasPlaceholder"),className:"settings-select",autoComplete:"off",value:O,onChange:N=>k(N.target.value)}),t.jsx("button",{type:"submit",className:"settings-button",disabled:T,children:e("projectsAddConfirm")})]})}),t.jsxs(we,{children:[y&&t.jsx("p",{className:"settings-error",children:y}),I&&t.jsx("p",{className:"settings-error",children:I}),m.length===0?t.jsx("p",{className:"settings-muted",children:e("emulatorNoChromeOsHosts")}):m.map(N=>t.jsxs("div",{className:"settings-item",children:[t.jsxs("div",{className:"settings-item-info",children:[t.jsx("span",{className:"settings-item-label",children:N}),t.jsxs("span",{className:"settings-item-description",children:["Device ID: chromeos:",N]})]}),t.jsx("div",{className:"settings-item-action",children:t.jsx("button",{type:"button",className:"settings-button",onClick:()=>{M(N)},disabled:T,children:e("emulatorRemove")})})]},N))]})]}),t.jsx(we,{children:t.jsxs("div",{className:"settings-group",children:[t.jsx("h3",{children:e("emulatorDiscoveredDevicesTitle")}),n&&t.jsx("p",{className:"settings-muted",children:e("projectsLoading")}),a&&t.jsx("p",{className:"settings-error",children:a}),!n&&s.length===0&&t.jsx("p",{className:"settings-muted",children:e("emulatorNoDevicesFound")}),s.map(N=>t.jsxs("div",{className:"settings-item",children:[t.jsxs("div",{className:"settings-item-info",children:[t.jsx("span",{className:"settings-item-label",children:N.label||N.avd||N.id}),t.jsxs("span",{className:"settings-item-description",children:[N.type," - ",N.id," - ",N.state]})]}),t.jsx("div",{className:"settings-item-action",children:Fp(N.type,N.state,N.actions)?t.jsx("button",{type:"button",className:"settings-button",onClick:()=>o(N.id),children:e("emulatorStop")}):Up(N.type,N.state,N.actions)?t.jsx("button",{type:"button",className:"settings-button",onClick:()=>i(N.id),children:e("emulatorStart")}):null})]},N.id))]})})]}):null]})}const Hp="_filter_a5a08_3",Wp="_group_a5a08_17",$p="_groupTitle_a5a08_21",Vp="_row_a5a08_29",zp="_unset_a5a08_36",Gp="_head_a5a08_40",Kp="_name_a5a08_47",Yp="_secretBadge_a5a08_54",Qp="_value_a5a08_64",Xp="_valueUnset_a5a08_72",qp="_description_a5a08_78",Jp="_note_a5a08_85",Oe={filter:Hp,group:Wp,groupTitle:$p,row:Vp,unset:zp,head:Gp,name:Kp,secretBadge:Yp,value:Qp,valueUnset:Xp,description:qp,note:Jp};function Zp(e){const s=[],n=new Map;for(const a of e){let i=n.get(a.group);i||(i={group:a.group,entries:[]},n.set(a.group,i),s.push(i)),i.entries.push(a)}return s}function em(){const{t:e}=K();_e(e("environmentSectionTitle"));const[s,n]=l.useState(null),[a,i]=l.useState(!1),[o,r]=l.useState(!1),d=cs();l.useEffect(()=>{let p=!1;return he.getEnvSettings().then(c=>{p||n(c.entries)}).catch(()=>{p||i(!0)}),()=>{p=!0}},[]);const u=l.useMemo(()=>(s==null?void 0:s.filter(p=>d||o||p.set))??[],[s,d,o]),h=l.useMemo(()=>Zp(u),[u]),f=(s==null?void 0:s.filter(p=>p.set).length)??0;return t.jsxs(oe,{description:e("environmentSectionDescription"),children:[t.jsxs(we,{children:[a&&t.jsx("p",{className:"settings-warning",children:e("environmentLoadError")}),!a&&s===null&&t.jsx("p",{children:e("environmentLoading")}),!a&&s&&t.jsxs("label",{className:Oe.filter,children:[t.jsx("span",{children:e("environmentShowLabel")}),t.jsxs("select",{className:"settings-select",value:o?"all":"set",onChange:p=>r(p.target.value==="all"),children:[t.jsx("option",{value:"set",children:e("environmentShowSet",{count:f})}),t.jsx("option",{value:"all",children:e("environmentShowAll",{count:s.length})})]})]}),!a&&s&&!o&&h.length===0&&t.jsx("p",{className:"settings-empty",children:e("environmentEmptySet")})]}),h.map(p=>t.jsxs("div",{className:`settings-group ${Oe.group}`,children:[t.jsx(we,{children:t.jsx("h3",{className:Oe.groupTitle,children:p.group})}),p.entries.map(c=>t.jsx(tm,{entry:c},c.name))]},p.group))]})}function tm({entry:e}){const{t:s}=K();return t.jsxs(w,{label:e.name,description:e.description,keywords:[e.group,e.note].filter(n=>!!n),layout:"custom",baseClassName:Oe.row,className:e.set?void 0:Oe.unset,children:[t.jsxs("div",{className:Oe.head,children:[t.jsx("code",{className:Oe.name,children:e.name}),e.secret&&t.jsx("span",{className:Oe.secretBadge,children:s("environmentSecretBadge")}),t.jsx(sm,{entry:e})]}),t.jsx("p",{className:Oe.description,children:e.description}),e.note&&t.jsx("p",{className:Oe.note,children:e.note})]})}function sm({entry:e}){const{t:s}=K();return e.set?e.value===""?t.jsx("span",{className:`${Oe.value} ${Oe.valueUnset}`,children:s("environmentValueEmpty")}):t.jsx("code",{className:Oe.value,children:e.value}):t.jsx("span",{className:`${Oe.value} ${Oe.valueUnset}`,children:s("environmentValueNotSet")})}const nm=2e3,am=5e3;function im(){const{t:e}=K();_e(e("lifecycleWebhooksTitle"));const{settings:s,isLoading:n,error:a,updateSettings:i}=Ce(),[o,r]=l.useState(!1),[d,u]=l.useState(""),[h,f]=l.useState(""),[p,c]=l.useState(!0),[x,b]=l.useState(!1),[v,T]=l.useState(!1),[I,C]=l.useState(null),[O,k]=l.useState(!1),y=(s==null?void 0:s.lifecycleWebhooksEnabled)??!1,S=(s==null?void 0:s.lifecycleWebhookUrl)??"",m=(s==null?void 0:s.lifecycleWebhookToken)??"",_=(s==null?void 0:s.lifecycleWebhookDryRun)??!0,A=d.trim(),P=h.trim(),M=o!==y||A!==S||P!==m||p!==_;l.useEffect(()=>{s&&(v||x||(r(y),u(S),f(m),c(_),k(!0)))},[v,x,_,y,m,S,s]);const R=l.useMemo(()=>O?{enabled:o,url:d,token:h,dryRun:p}:null,[O,o,d,h,p]),N=l.useCallback(D=>{r(D.enabled),u(D.url),f(D.token),c(D.dryRun),T(!1),C(null),i({lifecycleWebhooksEnabled:D.enabled,lifecycleWebhookUrl:D.url.trim()||void 0,lifecycleWebhookToken:D.token.trim()||void 0,lifecycleWebhookDryRun:D.dryRun}).catch(()=>{})},[i]);$e(R,N);const $=l.useCallback(async()=>{b(!0),C(null);try{await i({lifecycleWebhooksEnabled:o,lifecycleWebhookUrl:A||void 0,lifecycleWebhookToken:P||void 0,lifecycleWebhookDryRun:p}),r(o),u(A),f(P),c(p),T(!1)}catch(D){C(D instanceof Error?D.message:e("lifecycleWebhooksSaveFailed"))}finally{b(!1)}},[p,o,P,A,e,i]);return n?t.jsx(oe,{description:e("lifecycleWebhooksLoading")}):t.jsx(oe,{description:e("lifecycleWebhooksDescription"),keywords:[e("lifecycleWebhooksEnableTitle"),e("lifecycleWebhooksEnableDescription"),e("lifecycleWebhooksUrlTitle"),e("lifecycleWebhooksUrlDescription"),e("lifecycleWebhooksTokenTitle"),e("lifecycleWebhooksTokenDescription"),e("lifecycleWebhooksDryRunTitle"),e("lifecycleWebhooksDryRunDescription")],children:t.jsxs("div",{className:"settings-group",children:[t.jsxs(w,{as:"label",label:e("lifecycleWebhooksEnableTitle"),description:e("lifecycleWebhooksEnableDescription"),layout:"custom",children:[t.jsxs("div",{className:"settings-item-info",children:[t.jsx("strong",{children:e("lifecycleWebhooksEnableTitle")}),t.jsx("p",{children:e("lifecycleWebhooksEnableDescription")})]}),t.jsx("input",{type:"checkbox",checked:o,onChange:D=>{r(D.target.checked),T(!0),C(null)}})]}),t.jsxs(w,{label:e("lifecycleWebhooksUrlTitle"),description:e("lifecycleWebhooksUrlDescription"),layout:"custom",containerProps:{style:{flexDirection:"column",alignItems:"stretch"}},children:[t.jsxs("div",{className:"settings-item-info",children:[t.jsx("strong",{children:e("lifecycleWebhooksUrlTitle")}),t.jsx("p",{children:e("lifecycleWebhooksUrlDescription")})]}),t.jsx("input",{"aria-label":e("lifecycleWebhooksUrlTitle"),autoComplete:"off",type:"url",className:"settings-input",id:"lifecycle-webhook-url",name:"yep-lifecycle-webhook-url",value:d,onChange:D=>{const L=D.target.value.slice(0,nm);u(L),T(!0),C(null)},placeholder:"https://example.com/hooks/yep",spellCheck:!1})]}),t.jsxs(w,{label:e("lifecycleWebhooksTokenTitle"),description:e("lifecycleWebhooksTokenDescription"),layout:"custom",containerProps:{style:{flexDirection:"column",alignItems:"stretch"}},children:[t.jsxs("div",{className:"settings-item-info",children:[t.jsx("strong",{children:e("lifecycleWebhooksTokenTitle")}),t.jsx("p",{children:e("lifecycleWebhooksTokenDescription")})]}),t.jsx("input",{"aria-label":e("lifecycleWebhooksTokenTitle"),autoComplete:"new-password",type:"password",className:"settings-input",id:"lifecycle-webhook-token",name:"yep-lifecycle-webhook-token",value:h,onChange:D=>{const L=D.target.value.slice(0,am);f(L),T(!0),C(null)},placeholder:e("lifecycleWebhooksTokenPlaceholder"),spellCheck:!1})]}),t.jsxs(w,{as:"label",label:e("lifecycleWebhooksDryRunTitle"),description:e("lifecycleWebhooksDryRunDescription"),layout:"custom",children:[t.jsxs("div",{className:"settings-item-info",children:[t.jsx("strong",{children:e("lifecycleWebhooksDryRunTitle")}),t.jsx("p",{children:e("lifecycleWebhooksDryRunDescription")})]}),t.jsx("input",{type:"checkbox",checked:p,onChange:D=>{c(D.target.checked),T(!0),C(null)}})]}),t.jsx("div",{className:"settings-item",style:{justifyContent:"flex-end",gap:"var(--space-2)"},children:t.jsx("button",{type:"button",className:"settings-button",disabled:!M||x,onClick:$,children:e(x?"providersSaving":"providersSave")})}),(I||a)&&t.jsx("p",{className:"settings-warning",children:I||a})]})})}function om(){const[e,s]=l.useState(null),[n,a]=l.useState(!0),[i,o]=l.useState(null),[r,d]=l.useState(!1),u=l.useRef(!1),h=l.useCallback(async()=>{a(!0),o(null);try{const c=await he.getNetworkBinding();s(c)}catch(c){o(c instanceof Error?c:new Error(String(c)))}finally{a(!1)}},[]);l.useEffect(()=>{u.current||(u.current=!0,h())},[h]),Dt({fetcher:()=>he.getNetworkBinding(),current:e,apply:c=>{s(c),o(null)},enabled:!r});const f=l.useCallback(async c=>{d(!0),o(null);try{const x=await he.setNetworkBinding(c);if(!x.success)throw new Error(x.error??"Failed to update binding");return await h(),{redirectUrl:x.redirectUrl}}catch(x){const b=x instanceof Error?x:new Error(String(x));throw o(b),b}finally{d(!1)}},[h]),p=l.useCallback(async()=>{d(!0),o(null);try{const c=await he.disableNetworkBinding();if(!c.success)throw new Error(c.error??"Failed to disable network socket");await h()}catch(c){const x=c instanceof Error?c:new Error(String(c));throw o(x),x}finally{d(!1)}},[h]);return{binding:e,loading:n,error:i,applying:r,updateBinding:f,disableNetwork:p,refetch:h}}function rm(){const[e,s]=l.useState(null),[n,a]=l.useState(!0),[i,o]=l.useState(null),r=l.useRef(!1),d=l.useCallback(async()=>{a(!0),o(null);try{const u=await he.getServerInfo();s(u)}catch(u){o(u instanceof Error?u:new Error(String(u)))}finally{a(!1)}},[]);return l.useEffect(()=>{r.current||(r.current=!0,d())},[d]),Dt({fetcher:()=>he.getServerInfo(),current:e,apply:u=>{s(u),o(null)}}),{serverInfo:e,loading:n,error:i,refetch:d}}const lm="_customFoldersControls_1rgy3_1",cm="_customFoldersInput_1rgy3_11",dm="_customFoldersButton_1rgy3_17",ks={customFoldersControls:lm,customFoldersInput:cm,customFoldersButton:dm};function Gt(e){return{projects:e.projects,uploads:e.uploads,temp:e.temp,home:e.home,customText:e.custom.join(`
14
+ `)}}function Ya(e){return{projects:e.projects,uploads:e.uploads,temp:e.temp,home:e.home,custom:e.customText.split(`
15
+ `).map(s=>s.trim()).filter(Boolean)}}function _s(e,s){return e.projects===s.projects&&e.uploads===s.uploads&&e.temp===s.temp&&e.home===s.home&&e.custom.length===s.custom.length&&e.custom.every((n,a)=>n===s.custom[a])}function Kt(e){return{...e,custom:[...e.custom]}}function um(e){const s=e.trim();return s==="/"||/^[A-Za-z]:[\\/]?$/.test(s)}function pm(){const{t:e}=K();_e(e("settingsLocalAccessTitle"));const s=lc(),n=At(),{serverInfo:a,loading:i}=rm(),{version:o}=We(),{binding:r,loading:d,applying:u,updateBinding:h}=om(),{settings:f,isLoading:p,error:c,updateSettings:x,updateSetting:b}=Ce(),v=me(o,dr),T=v?(f==null?void 0:f.approvalAuditLogEnabled)??!1:!0,[I,C]=l.useState(""),[O,k]=l.useState(!1),[y,S]=l.useState(""),[m,_]=l.useState(""),[A,P]=l.useState(!1),[M,R]=l.useState(!1),[N,$]=l.useState(""),[D,L]=l.useState(""),[F,E]=l.useState(!1),[V,te]=l.useState(""),[ne,ae]=l.useState(Gt(jt)),[Z,ee]=l.useState(null),[xe,z]=l.useState(null),[re,Ne]=l.useState(!1),pe=l.useRef(null),ge=l.useRef(null),Te=l.useRef(Promise.resolve()),G=l.useRef(0),[ie,ce]=l.useState(null),[Ae,Pe]=l.useState(!1),[Re,De]=l.useState(!1);l.useEffect(()=>{if(!s&&!n)return;let Y=!1;return he.getFileAccessInfo().then(J=>{Y||ee(J)}).catch(()=>{}),()=>{Y=!0}},[s,n]);const[B,X]=l.useState(!1);l.useEffect(()=>{if(!r||!s||!f||B)return;C(String(r.localhost.port)),k(r.network.enabled),S(r.network.host??""),P(s.authEnabled),R(s.localhostOpen);const Y=f.allowedHosts;Y==="*"?(E(!0),te("")):(E(!1),te(Y??""));const J=Kt(f.fileAccess??jt);pe.current??(pe.current=J),ge.current=J,ae(Gt(J)),X(!0)},[s,r,B,f]),l.useEffect(()=>{if(!n||s||!f||B)return;const Y=Kt(f.fileAccess??jt);pe.current??(pe.current=Y),ge.current=Y,ae(Gt(Y)),X(!0)},[s,B,n,f]),l.useEffect(()=>{f&&(ge.current=Kt(f.fileAccess??jt))},[f]);const H=(Y,J)=>Y?"*":J.trim()||void 0,q=(Y,J,j,Q,de,Fe,nt,at)=>{if(!f||!r||!s)return!1;const Pt=Y!==String(r.localhost.port),It=J!==r.network.enabled,yt=j!==(r.network.host??""),Lt=Q!==s.authEnabled,Rt=de.length>0,Ot=at!==s.localhostOpen,Ut=H(Fe,nt),Ft=f.allowedHosts;return Pt||It||yt||Lt||Rt||Ot||(Ut??"")!==(Ft??"")},fe=Y=>{Pe(q(Y.port??I,Y.networkEnabled??O,Y.iface??y,Y.requirePw??A,Y.password??N,Y.allowAll??F,Y.hostsText??V,Y.localhostOpen??M))},Ie=l.useCallback(Y=>{if(!f||Z!=null&&Z.envPinned)return Promise.resolve();const J=Ya(Y),j=++G.current;z(null),Ne(!0);const Q=Te.current.catch(()=>{}).then(async()=>{ge.current&&_s(ge.current,J)||(await x({fileAccess:J}),ge.current=Kt(J))}).catch(de=>{z(de instanceof Error?de.message:e("localAccessErrorApplyFailed"))}).finally(()=>{G.current===j&&Ne(!1)});return Te.current=Q,Q},[Z==null?void 0:Z.envPinned,f,e,x]),Ue=Y=>{const J={...ne,...Y};ae(J),Ie(J)},W=f?f.fileAccess??jt:null,ve=Ya(ne),Me=pe.current,je=W!==null&&!_s(ve,W),Ee=W!==null&&Me!==null&&!_s(W,Me),Ge=W!==null&&(ve.custom.length!==W.custom.length||ve.custom.some((Y,J)=>Y!==W.custom[J])),Ke=l.useCallback(()=>{if(!f)return;if(!r||!s){ce(null),Pe(!1);return}C(String(r.localhost.port)),k(r.network.enabled),S(r.network.host??""),_(""),P(s.authEnabled),R(s.localhostOpen),$(""),L("");const Y=f.allowedHosts;Y==="*"?(E(!0),te("")):(E(!1),te(Y??"")),ce(null),Pe(!1)},[s,r,f]),rt=l.useCallback(async()=>{await Te.current;const Y=pe.current;if(z(null),Y&&!(Z!=null&&Z.envPinned)&&(je||Ee)){const J=Gt(Y);ae(J),await Ie(J)}Ke()},[Ee,je,Z==null?void 0:Z.envPinned,Ke,Ie]);tn(Ae||je||Ee,rt);const Qe=()=>{const Y=ne.customText.split(`
16
+ `).some(J=>um(J));return t.jsxs(w,{label:e("fileAccessTitle"),description:e("fileAccessDescription"),keywords:[e("fileAccessAllowedFoldersTitle"),e("fileAccessProjects"),e("fileAccessProjectsDescription"),e("fileAccessUploads"),e("fileAccessTemp"),e("fileAccessHome"),e("fileAccessHomeDescription"),e("fileAccessCustomTitle"),e("fileAccessCustomDescription")],layout:"custom",className:"file-access-settings-panel",containerProps:{role:"group","aria-labelledby":"file-access-settings-title","aria-describedby":"file-access-settings-description"},children:[t.jsxs("div",{className:"file-access-settings-header",children:[t.jsx("strong",{id:"file-access-settings-title",children:e("fileAccessTitle")}),t.jsx("p",{id:"file-access-settings-description",children:e("fileAccessDescription")})]}),Z!=null&&Z.envPinned?t.jsx("div",{className:"file-access-settings-list",children:t.jsxs("div",{className:"file-access-setting-row file-access-setting-row--readonly",children:[t.jsxs("div",{className:"settings-item-info",children:[t.jsx("strong",{children:e("fileAccessAllowedFoldersTitle")}),t.jsx("p",{children:e("fileAccessEnvPinnedHint")})]}),t.jsxs("span",{className:"settings-value-readonly",children:[Z.envPaths.length>0?Z.envPaths.join(", "):e("fileAccessNone")," ",t.jsx("span",{className:"settings-hint",children:e("fileAccessSetViaEnv")})]})]})}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"file-access-settings-list",children:[t.jsxs("div",{className:"file-access-setting-row",children:[t.jsxs("div",{className:"settings-item-info",children:[t.jsx("strong",{children:e("fileAccessProjects")}),t.jsx("p",{children:e("fileAccessProjectsDescription")})]}),t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox","aria-label":e("fileAccessProjects"),checked:ne.projects,onChange:J=>Ue({projects:J.target.checked})}),t.jsx("span",{className:"toggle-slider"})]})]}),t.jsxs("div",{className:"file-access-setting-row",children:[t.jsx("div",{className:"settings-item-info",children:t.jsx("strong",{children:e("fileAccessUploads")})}),t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox","aria-label":e("fileAccessUploads"),checked:ne.uploads,onChange:J=>Ue({uploads:J.target.checked})}),t.jsx("span",{className:"toggle-slider"})]})]}),t.jsxs("div",{className:"file-access-setting-row",children:[t.jsxs("div",{className:"settings-item-info",children:[t.jsx("strong",{children:e("fileAccessTemp")}),Z&&Z.tempPaths.length>0&&t.jsx("p",{className:"settings-hint",children:Z.tempPaths.join(", ")})]}),t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox","aria-label":e("fileAccessTemp"),checked:ne.temp,onChange:J=>Ue({temp:J.target.checked})}),t.jsx("span",{className:"toggle-slider"})]})]}),t.jsxs("div",{className:"file-access-setting-row",children:[t.jsxs("div",{className:"settings-item-info",children:[t.jsx("strong",{children:e("fileAccessHome")}),t.jsx("p",{children:e("fileAccessHomeDescription")})]}),ne.home&&t.jsx("span",{className:"settings-status-badge settings-status-warning",children:e("fileAccessHomeCaution")}),t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox","aria-label":e("fileAccessHome"),checked:ne.home,onChange:J=>Ue({home:J.target.checked})}),t.jsx("span",{className:"toggle-slider"})]})]}),t.jsxs("div",{className:"file-access-setting-row file-access-setting-row--field",children:[t.jsxs("div",{className:"settings-item-info",children:[t.jsx("strong",{children:e("fileAccessCustomTitle")}),t.jsx("p",{children:e("fileAccessCustomDescription")})]}),t.jsxs("div",{className:ks.customFoldersControls,children:[t.jsx("textarea",{className:`${ks.customFoldersInput} settings-input`,rows:3,"aria-label":e("fileAccessCustomTitle"),value:ne.customText,placeholder:e("fileAccessCustomPlaceholder"),onChange:J=>ae(j=>({...j,customText:J.target.value})),onBlur:()=>{Ge&&Ie(ne)}}),t.jsx("button",{type:"button",className:`${ks.customFoldersButton} settings-button`,disabled:!Ge||re,onClick:()=>void Ie(ne),children:e(re&&Ge?"fileAccessCustomSaving":Ge?"fileAccessCustomSave":"fileAccessCustomSaved")})]})]})]}),xe&&t.jsx("p",{className:"form-error file-access-settings-warning",children:xe}),Y&&t.jsx("p",{className:"form-warning file-access-settings-warning",children:e("fileAccessWholeDiskWarning")})]})]})},st=()=>t.jsx(w,{label:e("localAccessApprovalAuditTitle"),description:e(v?"localAccessApprovalAuditDescription":"localAccessApprovalAuditUnsupportedDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:T,disabled:!v||!f,onChange:Y=>b("approvalAuditLogEnabled",Y.target.checked),"aria-label":e("localAccessApprovalAuditTitle")}),t.jsx("span",{className:"toggle-slider"})]})}),Ze=async()=>{if(!s)return;ce(null);const Y=Number.parseInt(I,10);if(Number.isNaN(Y)||Y<1||Y>65535){ce(e("localAccessErrorPortRange"));return}const J=A&&!s.authEnabled,j=A&&s.authEnabled&&N.length>0;if(J||j){if(N.length<6){ce(e("localAccessErrorPasswordLength"));return}if(N!==D){ce(e("localAccessErrorPasswordMismatch"));return}}const Q=y==="custom"?m:y;De(!0);try{const de={};r!=null&&r.localhost.overriddenByCli||(de.localhostPort=Y),r!=null&&r.network.overriddenByCli||(de.network={enabled:O,host:O?Q:void 0});const Fe=await h(de);J?(await s.enableAuth(N),$(""),L("")):j?(await s.changePassword(N),$(""),L("")):!A&&s.authEnabled&&await s.disableAuth(),M!==s.localhostOpen&&await s.setLocalhostOpen(M);const nt=H(F,V);if(await x({allowedHosts:nt??""}),Fe.redirectUrl){const at=new URL(Fe.redirectUrl);at.pathname=window.location.pathname,at.search=window.location.search,window.location.href=at.toString()}else Pe(!1)}catch(de){ce(de instanceof Error?de.message:e("localAccessErrorApplyFailed"))}finally{De(!1)}};if(s){if(i||d||p||s.isLoading||!B)return t.jsx(oe,{description:e("localAccessLoading")});const J=A;return t.jsxs(oe,{description:e("localAccessDescription"),children:[t.jsx(we,{children:t.jsx("div",{className:"settings-group",children:t.jsxs("div",{className:"settings-item",children:[t.jsxs("div",{className:"settings-item-info",children:[t.jsx("strong",{children:e("localAccessStatusTitle")}),t.jsx("p",{children:a?(()=>{const j=r==null?void 0:r.network.host,Q=(r==null?void 0:r.network.port)??a.port,de=j==="0.0.0.0"||j==="::",Fe=Q===a.port;return r!=null&&r.network.enabled&&de&&Fe?t.jsxs(t.Fragment,{children:[e("localAccessListeningOn")," ",t.jsxs("code",{children:[j,":",Q]})]}):t.jsxs(t.Fragment,{children:[e("localAccessListeningOn")," ",t.jsxs("code",{children:[a.host,":",a.port]}),(r==null?void 0:r.network.enabled)&&j&&t.jsxs(t.Fragment,{children:[" ",e("localAccessListeningAnd")," ",t.jsxs("code",{children:[j,":",Q]})]})]})})():e("localAccessUnableToFetch")})]}),(a==null?void 0:a.localhostOnly)&&!(r!=null&&r.network.enabled)&&t.jsx("span",{className:"settings-status-badge settings-status-detected",children:e("localAccessBadgeLocalOnly")}),((a==null?void 0:a.boundToAllInterfaces)||(r==null?void 0:r.network.enabled))&&!s.authEnabled&&t.jsx("span",{className:"settings-status-badge settings-status-warning",children:e("localAccessBadgeNetworkExposed")})]})})}),t.jsxs("form",{className:"settings-group",onSubmit:j=>{j.preventDefault(),Ze()},children:[t.jsx(w,{label:e("localAccessListeningPortTitle"),description:e("localAccessListeningPortDescription"),children:r!=null&&r.localhost.overriddenByCli?t.jsxs("span",{className:"settings-value-readonly",children:[r.localhost.port," ",t.jsx("span",{className:"settings-hint",children:e("localAccessSetViaPort")})]}):t.jsx("input",{type:"number",className:"settings-input-small",value:I,onChange:j=>{C(j.target.value),fe({port:j.target.value})},min:1,max:65535,autoComplete:"off"})}),t.jsx(w,{label:e("localAccessNetworkTitle"),description:e("localAccessNetworkDescription"),children:r!=null&&r.network.overriddenByCli?t.jsxs("span",{className:"settings-value-readonly",children:[r.network.host,":",r.network.port," ",t.jsx("span",{className:"settings-hint",children:e("localAccessSetViaHost")})]}):t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:O,onChange:j=>{k(j.target.checked),fe({networkEnabled:j.target.checked})}}),t.jsx("span",{className:"toggle-slider"})]})}),O&&!(r!=null&&r.network.overriddenByCli)&&r&&t.jsx(w,{label:e("localAccessInterfaceTitle"),description:e("localAccessInterfaceDescription"),children:t.jsx(ns,{label:e("localAccessInterfaceTitle"),placeholder:e("localAccessInterfacePlaceholder"),multiSelect:!1,align:"right",options:[...r.interfaces.map(j=>({value:j.address,label:j.displayName})),{value:"0.0.0.0",label:e("localAccessInterfaceAll")},{value:"custom",label:e("localAccessInterfaceCustom")}],selected:y?[y]:[],onChange:j=>{const Q=j[0]??"";S(Q),fe({iface:Q})}})}),O&&!(r!=null&&r.network.overriddenByCli)&&y==="custom"&&t.jsx(w,{label:e("localAccessCustomIpTitle"),description:e("localAccessCustomIpDescription"),className:"settings-item-inline-field",children:t.jsx("input",{type:"text",className:"settings-input",placeholder:"192.168.1.100",value:m,onChange:j=>_(j.target.value)})}),t.jsx(w,{label:e("localAccessAllowAllHostsTitle"),description:e("localAccessAllowAllHostsDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:F,onChange:j=>{E(j.target.checked),fe({allowAll:j.target.checked})}}),t.jsx("span",{className:"toggle-slider"})]})}),!F&&t.jsx(w,{label:e("localAccessAllowedHostsTitle"),description:e("localAccessAllowedHostsDescription"),className:"settings-item-inline-field",children:t.jsx("input",{type:"text",className:"settings-input",placeholder:e("localAccessAllowedHostsPlaceholder"),value:V,onChange:j=>{te(j.target.value),fe({hostsText:j.target.value})}})}),t.jsx(we,{children:t.jsx("p",{className:"form-hint",children:e("localAccessAllowedHostsHint")})}),Qe(),!s.authDisabledByEnv&&t.jsx(w,{label:e("localAccessRequirePasswordTitle"),description:e("localAccessRequirePasswordDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:A,onChange:j=>{P(j.target.checked),fe({requirePw:j.target.checked})}}),t.jsx("span",{className:"toggle-slider"})]})}),J&&t.jsxs(t.Fragment,{children:[t.jsx(we,{children:t.jsx("input",{type:"text",name:"username",autoComplete:"username",style:{position:"absolute",visibility:"hidden",pointerEvents:"none"},tabIndex:-1})}),t.jsx(w,{label:e("localAccessPasswordTitle"),description:s.authEnabled?e("localAccessPasswordKeepCurrent"):e("localAccessPasswordMinLength"),className:"settings-item-inline-field",children:t.jsx("input",{type:"password",className:"settings-input",value:N,onChange:j=>{$(j.target.value),fe({password:j.target.value})},autoComplete:"new-password",placeholder:s.authEnabled?e("localAccessPasswordNewPlaceholder"):e("localAccessPasswordPlaceholder")})}),N.length>0&&t.jsx(w,{label:e("localAccessConfirmPasswordTitle"),className:"settings-item-inline-field",children:t.jsx("input",{type:"password",className:"settings-input",value:D,onChange:j=>L(j.target.value),autoComplete:"new-password",placeholder:e("localAccessConfirmPasswordPlaceholder")})}),!s.authEnabled&&t.jsx(we,{children:t.jsx("p",{className:"form-hint",children:e("localAccessPasswordResetHint")})})]}),s.hasDesktopToken&&!A&&!s.authDisabledByEnv&&t.jsx(w,{label:e("localAccessLocalhostOpenTitle"),description:e("localAccessLocalhostOpenDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:M,onChange:j=>{R(j.target.checked),fe({localhostOpen:j.target.checked})}}),t.jsx("span",{className:"toggle-slider"})]})}),s.authDisabledByEnv&&t.jsx(we,{children:t.jsx("p",{className:"form-warning",children:e("localAccessAuthDisabled")})}),t.jsx(we,{children:t.jsxs("div",{className:"settings-item",children:[ie&&t.jsx("p",{className:"form-error",children:ie}),t.jsx("button",{type:"submit",className:"settings-button",disabled:!Ae||Re||u,children:e(Re||u?"localAccessApplying":"localAccessApply")})]})})]}),t.jsx("div",{className:"settings-group",children:st()}),s.authEnabled&&s.isAuthenticated&&t.jsx("div",{className:"settings-group",children:t.jsx(w,{id:"local-access-logout",label:e("remoteAccessLogoutTitle"),description:e("localAccessLogoutDescription"),children:t.jsx("button",{type:"button",className:"settings-button settings-button-danger",onClick:s.logout,children:e("remoteAccessLogout")})})})]})}if(n){const Y=!!f&&B;return t.jsxs(oe,{description:e("localAccessRemoteDescription"),children:[Y?t.jsx("div",{className:"settings-group",children:Qe()}):t.jsx(we,{children:t.jsx("div",{className:"settings-group",children:t.jsx("div",{className:"settings-item",children:t.jsxs("div",{className:"settings-item-info",children:[t.jsx("strong",{children:e("fileAccessTitle")}),t.jsx("p",{children:c??e("localAccessLoading")})]})})})}),t.jsx("div",{className:"settings-group",children:st()}),t.jsx("div",{className:"settings-group",children:t.jsx(w,{id:"local-access-remote-logout",label:e("remoteAccessLogoutTitle"),description:e("localAccessRemoteLogoutDescription"),children:t.jsx("button",{type:"button",className:"settings-button settings-button-danger",onClick:()=>n.disconnect(),children:e("remoteAccessLogout")})})})]})}return null}const mm=["steer","queue"],hm=["off","before","after"],Qa=120,qi=86400,Xa=400;function Ms(e){const s=Number.parseInt(e,10);return!Number.isFinite(s)||s<0?0:Math.min(s,qi)}function As(e){const s=Number.parseInt(e,10);return Os(s)??Ls}function gm(){var Pe,Re,De,B,X;const{t:e}=K();_e(e("messageDeliveryTitle"));const{settings:s,isLoading:n,error:a,updateSettings:i}=Ce(),{version:o}=We(),r=mi(o),d=Or(o),{keepMobileKeyboardOpenAfterDelivery:u,setKeepMobileKeyboardOpenAfterDelivery:h}=cc(),[f,p]=l.useState(null),[c,x]=l.useState(null),[b,v]=l.useState(null),[T,I]=l.useState(null),[C,O]=l.useState(null),[k,y]=l.useState(null),[S,m]=l.useState(null),[_,A]=l.useState(null),[P,M]=l.useState(null),R=l.useRef(null),N=(s==null?void 0:s.deferredJoinWindowSeconds)??0,$=Os(s==null?void 0:s.projectQueueQuietSeconds)??Ls,D=(s==null?void 0:s.composeAnchorsEnabled)??!1,L=(s==null?void 0:s.turnTimestamps)??"off",F=((Pe=s==null?void 0:s.clientDefaults)==null?void 0:Pe.bangCommandsEnabled)??!1,E=((Re=s==null?void 0:s.clientDefaults)==null?void 0:Re.busyComposerDefaultAction)??"steer",V=((De=s==null?void 0:s.clientDefaults)==null?void 0:De.steerNowDefault)??ga,te=((B=s==null?void 0:s.clientDefaults)==null?void 0:B.patientQueueDefault)??!1,ne=((X=s==null?void 0:s.clientDefaults)==null?void 0:X.projectQueueCtrlEnterEnabled)??fa;l.useEffect(()=>{var H,q,fe,Ie,Ue;s&&!R.current&&(R.current={joinWindowSeconds:s.deferredJoinWindowSeconds??0,projectQueueQuietSeconds:Os(s.projectQueueQuietSeconds)??Ls,composeAnchorsEnabled:s.composeAnchorsEnabled??!1,turnTimestamps:s.turnTimestamps??"off",bangCommandsEnabled:((H=s.clientDefaults)==null?void 0:H.bangCommandsEnabled)??!1,busyComposerDefaultAction:((q=s.clientDefaults)==null?void 0:q.busyComposerDefaultAction)??"steer",steerNowDefault:((fe=s.clientDefaults)==null?void 0:fe.steerNowDefault)??ga,patientQueueDefault:((Ie=s.clientDefaults)==null?void 0:Ie.patientQueueDefault)??!1,projectQueueCtrlEnterEnabled:((Ue=s.clientDefaults)==null?void 0:Ue.projectQueueCtrlEnterEnabled)??fa,keepMobileKeyboardOpenAfterDelivery:u})},[u,s]);const ae=f??String(N),Z=Ms(ae),ee=c??String($),xe=As(ee),z=b??D,re=T??L,Ne=C??F,pe=k??E,ge=S??V,Te=_??te,G=P??ne;l.useEffect(()=>{if(f===null)return;const H=Ms(f);if(H===N)return;const q=setTimeout(()=>{i({deferredJoinWindowSeconds:H}).catch(()=>{})},Xa);return()=>clearTimeout(q)},[f,N,i]),l.useEffect(()=>{if(!r||c===null)return;const H=As(c);if(H===$)return;const q=setTimeout(()=>{i({projectQueueQuietSeconds:H}).catch(()=>{})},Xa);return()=>clearTimeout(q)},[c,$,r,i]),l.useEffect(()=>{f!==null&&Ms(f)===N&&p(null)},[f,N]),l.useEffect(()=>{c!==null&&As(c)===$&&x(null)},[c,$]),l.useEffect(()=>{b!==null&&b===D&&v(null)},[b,D]),l.useEffect(()=>{T!==null&&T===L&&I(null)},[T,L]),l.useEffect(()=>{C!==null&&C===F&&O(null)},[C,F]),l.useEffect(()=>{k!==null&&k===E&&y(null)},[k,E]),l.useEffect(()=>{S!==null&&S===V&&m(null)},[S,V]),l.useEffect(()=>{_!==null&&_===te&&A(null)},[_,te]),l.useEffect(()=>{P!==null&&P===ne&&M(null)},[P,ne]);const ie=R.current,ce=!!ie&&(Z!==ie.joinWindowSeconds||r&&xe!==ie.projectQueueQuietSeconds||z!==ie.composeAnchorsEnabled||re!==ie.turnTimestamps||d&&Ne!==ie.bangCommandsEnabled||pe!==ie.busyComposerDefaultAction||ge!==ie.steerNowDefault||Te!==ie.patientQueueDefault||r&&G!==ie.projectQueueCtrlEnterEnabled||u!==ie.keepMobileKeyboardOpenAfterDelivery),Ae=l.useCallback(async()=>{const H=R.current;H&&(p(null),x(null),v(null),I(null),O(null),y(null),m(null),A(null),M(null),h(H.keepMobileKeyboardOpenAfterDelivery),await i({deferredJoinWindowSeconds:H.joinWindowSeconds,...r?{projectQueueQuietSeconds:H.projectQueueQuietSeconds}:{},composeAnchorsEnabled:H.composeAnchorsEnabled,turnTimestamps:H.turnTimestamps,clientDefaults:{...d?{bangCommandsEnabled:H.bangCommandsEnabled}:{},busyComposerDefaultAction:H.busyComposerDefaultAction,steerNowDefault:H.steerNowDefault,patientQueueDefault:H.patientQueueDefault,...r?{projectQueueCtrlEnterEnabled:H.projectQueueCtrlEnterEnabled}:{}}}).catch(()=>{}))},[h,d,r,i]);return tn(ce,Ae),n?t.jsx(oe,{description:e("messageDeliveryLoading")}):t.jsx(oe,{description:e("messageDeliveryDescription"),children:t.jsxs("div",{className:"settings-group",children:[t.jsxs(w,{label:e("messageDeliveryJoinWindowTitle"),description:e("messageDeliveryJoinWindowDescription"),valueText:ae,className:"model-settings-item",children:[t.jsxs("span",{className:"output-appearance-slider-row",children:[t.jsx(Le,{id:"message-delivery-join-window",min:0,max:Qa,step:5,value:Math.min(Z,Qa),"aria-label":e("messageDeliveryJoinWindowTitle"),onCommit:H=>p(String(H))}),t.jsxs("span",{className:"output-appearance-number-wrap",children:[t.jsx("input",{type:"number",className:"settings-input-small output-appearance-number",min:0,max:qi,value:ae,onChange:H=>p(H.target.value),"aria-label":e("messageDeliveryJoinWindowTitle")}),t.jsx("span",{className:"output-appearance-unit",children:"s"})]})]}),t.jsx("span",{className:"settings-hint",children:Z===0?e("messageDeliveryJoinWindowOffHint"):e("messageDeliveryJoinWindowOnHint",{seconds:String(Z)})})]}),r&&t.jsxs(w,{label:e("messageDeliveryProjectQueueQuietTitle"),description:e("messageDeliveryProjectQueueQuietDescription"),valueText:ee,className:"model-settings-item",children:[t.jsxs("span",{className:"output-appearance-slider-row",children:[t.jsx(Le,{id:"message-delivery-project-queue-quiet",min:0,max:Rs,step:5,value:xe,"aria-label":e("messageDeliveryProjectQueueQuietTitle"),onCommit:H=>x(String(H))}),t.jsxs("span",{className:"output-appearance-number-wrap",children:[t.jsx("input",{type:"number",className:"settings-input-small output-appearance-number",min:0,max:Rs,value:ee,onChange:H=>x(H.target.value),"aria-label":e("messageDeliveryProjectQueueQuietTitle")}),t.jsx("span",{className:"output-appearance-unit",children:"s"})]})]}),t.jsx("span",{className:"settings-hint",children:xe===0?e("messageDeliveryProjectQueueQuietOffHint"):e("messageDeliveryProjectQueueQuietOnHint",{seconds:String(xe)})})]}),t.jsx(w,{as:"label",label:e("messageDeliveryComposeAnchorsTitle"),description:e("messageDeliveryComposeAnchorsDescription"),children:t.jsx("input",{type:"checkbox",checked:z,onChange:H=>{const q=H.target.checked;v(q),i({composeAnchorsEnabled:q}).catch(()=>{})},"aria-label":e("messageDeliveryComposeAnchorsTitle")})}),t.jsx(w,{label:e("messageDeliveryTurnTimestampsTitle"),description:e("messageDeliveryTurnTimestampsDescription"),children:t.jsxs("select",{className:"settings-select",value:re,onChange:H=>{const q=H.target.value;hm.includes(q)&&(I(q),i({turnTimestamps:q}).catch(()=>{}))},"aria-label":e("messageDeliveryTurnTimestampsTitle"),children:[t.jsx("option",{value:"off",children:e("messageDeliveryTurnTimestampsOff")}),t.jsx("option",{value:"before",children:e("messageDeliveryTurnTimestampsBefore")}),t.jsx("option",{value:"after",children:e("messageDeliveryTurnTimestampsAfter")})]})}),d&&t.jsx(w,{as:"label",label:e("messageDeliveryBangCommandsTitle"),description:e("messageDeliveryBangCommandsDescription"),children:t.jsx("input",{type:"checkbox",checked:Ne,onChange:H=>{const q=H.target.checked;O(q),i({clientDefaults:{bangCommandsEnabled:q}}).catch(()=>{})},"aria-label":e("messageDeliveryBangCommandsTitle")})}),t.jsx(w,{as:"label",label:e("messageDeliveryKeepMobileKeyboardOpenTitle"),description:e("messageDeliveryKeepMobileKeyboardOpenDescription"),children:t.jsx("input",{type:"checkbox",checked:u,onChange:H=>h(H.target.checked),"aria-label":e("messageDeliveryKeepMobileKeyboardOpenTitle")})}),t.jsx(w,{label:e("appearanceToolbarDefaultActionTitle"),description:e("appearanceToolbarDefaultActionDescription"),children:t.jsxs("select",{className:"settings-select",value:pe,onChange:H=>{const q=H.target.value;mm.includes(q)&&(y(q),i({clientDefaults:{busyComposerDefaultAction:q}}).catch(()=>{}))},"aria-label":e("appearanceToolbarDefaultActionTitle"),children:[t.jsx("option",{value:"steer",children:e("appearanceToolbarDefaultActionSteer")}),t.jsx("option",{value:"queue",children:e("appearanceToolbarDefaultActionQueue")})]})}),t.jsx(w,{as:"label",label:e("messageDeliverySteerNowDefaultTitle"),description:e("messageDeliverySteerNowDefaultDescription"),children:t.jsx("input",{type:"checkbox",checked:ge,onChange:H=>{const q=H.target.checked;m(q),i({clientDefaults:{steerNowDefault:q}}).catch(()=>{})},"aria-label":e("messageDeliverySteerNowDefaultTitle")})}),t.jsx(w,{as:"label",label:e("messageDeliveryPatientQueueDefaultTitle"),description:e("messageDeliveryPatientQueueDefaultDescription"),children:t.jsx("input",{type:"checkbox",checked:Te,onChange:H=>{const q=H.target.checked;A(q),i({clientDefaults:{patientQueueDefault:q}}).catch(()=>{})},"aria-label":e("messageDeliveryPatientQueueDefaultTitle")})}),r&&t.jsx(w,{as:"label",label:e("messageDeliveryProjectQueueShortcutTitle"),description:e("messageDeliveryProjectQueueShortcutDescription"),children:t.jsx("input",{type:"checkbox",checked:G,onChange:H=>{const q=H.target.checked;M(q),i({clientDefaults:{projectQueueCtrlEnterEnabled:q}}).catch(()=>{})},"aria-label":e("messageDeliveryProjectQueueShortcutTitle")})}),a&&t.jsx("p",{className:"settings-warning",children:a})]})})}const fm="_sessionDefaultsPanel_y0h0g_16",bm="_intro_y0h0g_29",xm="_relatedDivider_y0h0g_30",Ds={sessionDefaultsPanel:fm,intro:bm,relatedDivider:xm};function Ji({id:e,value:s,updateSetting:n,description:a,keywords:i,searchable:o=!0}){const{t:r}=K(),{showToast:d}=ls(),u=l.useCallback(async h=>{try{await n("claudeAutoCompactPercentOverride",h===0?void 0:h),d(r("providersClaudeAutoCompactSaved"),"success")}catch(f){d(f instanceof Error?f.message:r("providersClaudeAutoCompactSaveError"),"error")}},[d,r,n]);return t.jsx(w,{id:e,searchable:o,label:r("providersClaudeAutoCompactTitle"),description:a??r("providersClaudeAutoCompactDescription"),keywords:["compact","context","threshold","percentage","claude auto","autocompact","providers","session defaults",...i??[]],valueText:s===void 0?r("providersClaudeAutoCompactOff"):`${s}%`,className:"settings-item--wide-control",children:t.jsx(ot,{id:`${e}-input`,min:0,max:100,step:1,value:s??0,unit:"%",ariaLabel:r("providersClaudeAutoCompactTitle"),onCommit:h=>void u(h)})})}function Zi({id:e,modelId:s,contextWindow:n,storedPercent:a,map:i,updateSetting:o,disabled:r,description:d,className:u,keywords:h,searchable:f=!0}){const{t:p}=K(),[c,x]=l.useState(a);l.useEffect(()=>{x(a)},[a]);const b=n&&c>0?`${Math.round(n*c/100/1024)}K`:null,v=l.useCallback(I=>{if(!s||s==="default")return;const C={...i};I>0&&I<100?C[s]=Math.round(I):delete C[s],o("clientDefaults",{compactAtContextPercent:C}).catch(()=>{})},[i,s,o]),T=c>0?p("modelSettingsCompactThresholdOnHint",{percent:String(c),tokens:b??"—"}):p("modelSettingsCompactThresholdOffHint");return t.jsx(w,{id:e,searchable:f,label:p("modelSettingsCompactThresholdTitle"),description:d??p("modelSettingsCompactThresholdDescription"),keywords:["compact","early compact","context early","autocompact","compaction threshold","/compact","session defaults","providers",...h??[]],valueText:T,className:u??"settings-item--wide-control",children:t.jsxs("div",{children:[t.jsxs("span",{className:"output-appearance-slider-row",children:[t.jsx(Le,{min:0,max:99,step:1,value:c,disabled:r,"aria-label":p("modelSettingsCompactThresholdTitle"),onDraftChange:x,onCommit:v}),t.jsxs("span",{className:"output-appearance-number-wrap",children:[t.jsx("input",{type:"number",className:"settings-input-small output-appearance-number",min:0,max:99,step:1,value:c,disabled:r,"aria-label":p("modelSettingsCompactThresholdTitle"),onChange:I=>x(Number(I.target.value)),onBlur:()=>v(c)}),t.jsx("span",{className:"output-appearance-unit",children:"%"})]})]}),t.jsx("span",{className:"settings-hint",children:T})]})})}const eo=["off","side-session","fork"],to=[...Ql],vm=[...Xl];function Sm(e,s){const n=Ti(e);if(s){const a=n.find(i=>i.name===s);if(a)return a}return _c(e)}function ym(e,s){var n,a,i;if(s){const o=e.find(r=>r.id===s);if(o)return o.id}return((n=e.find(o=>o.isDefault))==null?void 0:n.id)??((a=e.find(o=>o.id==="default"))==null?void 0:a.id)??((i=e[0])==null?void 0:i.id)??null}function qa(e,s,n){const a=e==="claude"?qt(Jt()):void 0,i=qs(n,e,{model:a});return ym(s,i.model)}function jm(e,s){return s!=null&&s.recapMode&&eo.includes(s.recapMode)?s.recapMode:"off"}function Tm(e){return e!=null&&e.promptSuggestionMode&&to.includes(e.promptSuggestionMode)?e.promptSuggestionMode:"off"}function wm(e,s){const n=s==null?void 0:s.helperSideModel;return n&&(n===ss||n===bi||e.some(a=>a.id===n))?n:ss}function Cm(e,s){const n=e==null?void 0:e.promptCacheKeepalive,a=e&&(s!=null&&s.providers)?s.providers[e.name]:void 0;return{mode:(a==null?void 0:a.mode)??(n==null?void 0:n.defaultMode)??"off",inactivityMinutes:(a==null?void 0:a.inactivityMinutes)??(n==null?void 0:n.defaultInactivityMinutes)??ql}}function Nm(e){return Number.isFinite(e)?Math.min(1440,Math.max(1,Math.round(e))):null}function Em(){var Qe,st,Ze,Y,J;const{t:e}=K();_e(e("modelSettingsTitle"));const{showToast:s}=ls(),{model:n,setModel:a,effortLevel:i,setEffortLevel:o,thinkingMode:r,setThinkingMode:d,showThinking:u,setShowThinking:h}=Si(),{providers:f,loading:p}=ji(),[c,x]=Tl(),{settings:b,isLoading:v,updateSetting:T}=Ce(),{version:I}=We(),C=Ml(I),O=Ti(f),k=b==null?void 0:b.newSessionDefaults,y=l.useMemo(()=>b?{model:n,effortLevel:i,thinkingMode:r,showThinking:u,newSessionDefaults:b.newSessionDefaults??{},promptCacheKeepalive:b.promptCacheKeepalive??{}}:null,[b,n,i,r,u]),S=l.useCallback(j=>{a(j.model),o(j.effortLevel),d(j.thinkingMode),h(j.showThinking),T("newSessionDefaults",j.newSessionDefaults),T("promptCacheKeepalive",j.promptCacheKeepalive)},[a,o,d,h,T]);$e(y,S);const m=Sm(f,k==null?void 0:k.provider)??null,{usage:_}=Al(m==null?void 0:m.name),A=C&&Dl(m==null?void 0:m.name),P=(m==null?void 0:m.models)??[],M=m===null?null:qa(m.name,P,k),R=m?qs(k,m.name,{model:m.name==="claude"?qt(Jt()):void 0,thinkingMode:r,effortLevel:i}):{},N=P,$=jm(m,k),D=A&&(k==null?void 0:k.sandboxLevel)==="project-write"&&$==="side-session"?"off":$,L=Kl((k==null?void 0:k.recapAfterSeconds)??Yl),F=Tm(k),E=Cm(m,b==null?void 0:b.promptCacheKeepalive),V=wm(N,R),te=P.find(j=>j.id===M)??null,ne=(M?(st=(Qe=b==null?void 0:b.clientDefaults)==null?void 0:Qe.compactAtContextPercent)==null?void 0:st[M]:void 0)??0,ae=((Ze=b==null?void 0:b.clientDefaults)==null?void 0:Ze.forceYaOrchestratedCompaction)===!0,Z=((m==null?void 0:m.name.startsWith("claude"))===!0||(m==null?void 0:m.supportsNativeCompactThreshold)===!0)&&te!=null&&M!=="default",ee=O.find(j=>j.name==="claude"),xe=(ee==null?void 0:ee.supportsLaunchCompactPercentOverride)===!0,z=yi({provider:m,model:te,translate:e}),re=Cc(R.effortLevel??"high",z),Ne=Nc({provider:m,model:te,effortOptions:z}),pe=Ec(R.thinkingMode??"off",Ne),ge=Pl({model:te}),Te=ge.includes((k==null?void 0:k.permissionMode)??"default")?(k==null?void 0:k.permissionMode)??"default":"default",G={default:e("modeDefaultLabel"),acceptEdits:e("modeAcceptEditsLabel"),plan:e("modePlanLabel"),bypassPermissions:e("modeBypassPermissionsLabel"),auto:e("modeAutoLabel")},ie={default:e("modeDefaultDescription"),acceptEdits:e("modeAcceptEditsDescription"),plan:e("modePlanDescription"),bypassPermissions:e("modeBypassPermissionsDescription"),auto:e("modeAutoDescription")},ce={off:e("recapModeOff"),native:e("recapModeNative"),"side-session":e("recapModeSideSession"),fork:e("recapModeFork")},Ae={off:e("promptSuggestionModeOff"),native:e("promptSuggestionModeNative")},Pe={off:e("promptSuggestionModeOffDescription"),native:e("promptSuggestionModeNativeDescription")},Re={auto:e("promptCacheKeepaliveModeAuto"),off:e("promptCacheKeepaliveModeOff")},De={auto:e("promptCacheKeepaliveModeAutoDescription",{minutes:E.inactivityMinutes}),off:e("promptCacheKeepaliveModeOffDescription")},B={off:e("recapAfterSecondsLabel"),native:e("recapAfterSecondsInlineNative"),"side-session":e("recapAfterSecondsInlineSideSession"),fork:e("recapAfterSecondsInlineFork")},X=(m==null?void 0:m.supportsPermissionMode)??!0,q=((m==null?void 0:m.supportsThinkingToggle)??!0)&&Ne.some(j=>j!=="off"),fe=eo,Ie=to,Ue=D==="side-session",W=((Y=m==null?void 0:m.promptCacheKeepalive)==null?void 0:Y.supportsNoContextPollutionNudge)===!0,ve=P.map(j=>{const Q=j.size?`${j.name} (${(j.size/1073741824).toFixed(1)} GB)`:j.name,de=[];return j.parameterSize&&de.push(j.parameterSize),j.contextWindow&&de.push(`${Math.round(j.contextWindow/1024)}K ctx`),j.parentModel&&de.push(j.parentModel),j.quantizationLevel&&de.push(j.quantizationLevel),{value:j.id,label:Q,description:j.description??de.join(" · "),icon:m?t.jsx(kc,{provider:m.name,model:j.id}):void 0,meta:t.jsx(Il,{usage:_,modelId:j.id})}}),Me=[{value:ss,label:e("helperSideModelCheapest")},{value:bi,label:e("helperSideModelSameAsMain"),description:M??void 0},...N.map(j=>({value:j.id,label:j.name,description:j.description}))],je=async j=>{try{const Q={...k,...j};C||(delete Q.sandboxLevel,delete Q.sandboxNetworkFirewall),await T("newSessionDefaults",Q),s(e("newSessionDefaultsSaved"),"success")}catch(Q){s(Q instanceof Error?Q.message:e("newSessionDefaultsSaveError"),"error")}},Ee=async j=>{m&&await je(xa({...k,provider:m.name},m.name,j,{model:m.name==="claude"?qt(Jt()):void 0,thinkingMode:r,effortLevel:i}))},Ge=async j=>{if(!m)return;const Q=(b==null?void 0:b.promptCacheKeepalive)??{},de={...Q.providers};de[m.name]={...de[m.name],...j};try{await T("promptCacheKeepalive",{...Q,providers:de}),s(e("promptCacheKeepaliveSaved"),"success")}catch(Fe){s(Fe instanceof Error?Fe.message:e("promptCacheKeepaliveSaveError"),"error")}},Ke=async j=>{const Q=O.find(nt=>nt.name===j);if(!Q)return;const de=Q.models??[],Fe=qa(Q.name,de,k)??void 0;await je(xa({...k,provider:Q.name},Q.name,{model:Fe},{model:Q.name==="claude"?qt(Jt()):void 0,thinkingMode:r,effortLevel:i}))},rt=async j=>{m&&await Ee({model:j})};return t.jsxs(oe,{title:e("modelSettingsSessionDefaultsTitle"),keywords:["session defaults","default model","provider","permission mode","thinking","recap","prompt suggestions","compact","early compact","context early","autocompact","prompt cache keepalive","sandbox bubblewrap project writes","helper model","fork summary"],children:[t.jsx("div",{className:"settings-group",children:t.jsxs("div",{className:`settings-session-defaults-panel ${Ds.sessionDefaultsPanel}`,children:[t.jsx("p",{className:Ds.intro,children:e("modelSettingsNewSessionDefaultsIntro")}),t.jsx(w,{id:"session-default-provider",label:e("modelSettingsDefaultProviderTitle"),description:e("modelSettingsDefaultProviderDescription"),keywords:["provider","ai provider",e("newSessionProviderTitle"),...O.map(j=>j.displayName)],valueText:m==null?void 0:m.displayName,className:"new-session-provider-section session-default-provider-section settings-item--session-default-block settings-item--wide-control",children:t.jsx("div",{className:"provider-options",children:O.map(j=>t.jsxs("button",{type:"button",className:`provider-option ${(m==null?void 0:m.name)===j.name?"selected":""}`,onClick:()=>void Ke(j.name),disabled:p||v,children:[t.jsx("span",{className:`provider-option-dot provider-${j.name}`}),t.jsx("div",{className:"provider-option-content",children:t.jsx("span",{className:"provider-option-label",children:j.displayName})})]},j.name))})}),t.jsx(w,{id:"session-default-model",label:e("modelSettingsDefaultModelTitle"),description:e("modelSettingsDefaultModelDescription"),keywords:["model","default model",e("newSessionModelTitle")],valueText:M??void 0,className:"new-session-model-section session-default-model-section settings-item--session-default-block settings-item--wide-control",children:t.jsx("div",{className:"new-session-model-field",children:P.length>0?t.jsx(ns,{label:e("newSessionModelTitle"),options:ve,selected:M?[M]:[],onChange:j=>{const Q=j[0];Q&&rt(Q)},multiSelect:!1,placeholder:e("newSessionModelPlaceholder"),fullWidth:!0}):t.jsx("span",{className:"model-settings-empty",children:e("modelSwitchEmpty")})})}),q&&t.jsx(w,{id:"session-default-thinking",label:e("modelSettingsThinkingTitle"),description:e("modelSettingsThinkingDescription"),keywords:["thinking","effort","reasoning mode"],valueText:`${pe} ${re??""}`.trim(),className:"new-session-helper-section session-default-thinking-section settings-item--session-default-block settings-item--wide-control",children:t.jsx(Ll,{mode:pe,modeOptions:Ne,onSetMode:j=>void Ee({thinkingMode:j}),level:re,effortOptions:z,onSetEffort:j=>void Ee({effortLevel:j}),onSetEffortMode:j=>void Ee({thinkingMode:"on",effortLevel:j}),showThinkingControl:!1,provider:m==null?void 0:m.name,t:e,className:"thinking-controls-panel--inline session-default-thinking-controls"})}),X&&t.jsx(w,{id:"session-default-permission-mode",label:e("newSessionModeTitle"),keywords:["permission mode","bypass","plan","accept edits"],valueText:G[Te],className:"new-session-mode-section session-default-mode-section settings-item--session-default-block settings-item--wide-control",children:t.jsx("div",{className:"mode-options",children:ge.map(j=>t.jsxs("button",{type:"button",className:`mode-option ${Te===j?"selected":""}`,onClick:()=>void je({permissionMode:j}),disabled:v,children:[t.jsx("span",{className:`mode-option-dot mode-${j}`}),t.jsxs("div",{className:"mode-option-content",children:[t.jsx("span",{className:"mode-option-label",children:G[j]}),t.jsx("span",{className:"mode-option-desc",children:ie[j]})]})]},j))})}),A&&t.jsx(w,{id:"session-default-sandbox",as:"label",label:e("modelSettingsSandboxDefaultTitle"),description:`${e("newSessionSandboxDescription")} ${e("newSessionSandboxAvailability")}`,keywords:["sandbox","bubblewrap","project writes",e("newSessionSandboxLabel")],valueText:(k==null?void 0:k.sandboxLevel)==="project-write"?e("newSessionSandboxLabel"):void 0,className:"new-session-helper-section session-default-sandbox-section settings-item--session-default-block",children:t.jsx("input",{type:"checkbox",checked:(k==null?void 0:k.sandboxLevel)==="project-write",disabled:v,onChange:j=>{const Q=j.currentTarget.checked;je({sandboxLevel:Q?"project-write":"none",sandboxNetworkFirewall:Q?!0:void 0,...Q&&$==="side-session"?{recapMode:"off"}:{}})},"aria-label":e("modelSettingsSandboxDefaultTitle")})}),A&&t.jsx(w,{id:"session-default-sandbox-network-firewall",as:"label",label:e("newSessionSandboxNetworkFirewallLabel"),description:e("newSessionSandboxNetworkFirewallDescription"),keywords:["sandbox","network","firewall","localhost"],valueText:(k==null?void 0:k.sandboxLevel)==="project-write"&&k.sandboxNetworkFirewall!==!1?e("newSessionSandboxNetworkFirewallLabel"):void 0,className:"new-session-helper-section session-default-sandbox-section settings-item--session-default-block",children:t.jsx("input",{type:"checkbox",checked:(k==null?void 0:k.sandboxLevel)==="project-write"&&k.sandboxNetworkFirewall!==!1,disabled:v||(k==null?void 0:k.sandboxLevel)!=="project-write",onChange:j=>{je({sandboxNetworkFirewall:j.currentTarget.checked})},"aria-label":e("newSessionSandboxNetworkFirewallLabel")})}),t.jsx(w,{id:"session-default-show-thinking",label:e("showThinkingTitle"),description:e("showThinkingHint"),keywords:["show thinking","reasoning","display thinking"],valueText:String(u),className:"new-session-helper-section session-default-show-thinking-section settings-item--session-default-block settings-item--wide-control",children:t.jsx(Rl,{value:u,onChange:h,t:e,showLabel:!1})}),t.jsx(w,{id:"session-default-recap",label:e("newSessionRecapTitle"),keywords:["recap","away summary","side session","fork"],valueText:ce[D],className:"new-session-helper-section session-default-recap-section settings-item--session-default-block settings-item--wide-control",after:D!=="off"?t.jsx(Ul,{value:L,disabled:v,label:B[D],mode:D,className:"recap-after-seconds-control--inline",onCommit:j=>je({recapAfterSeconds:j})}):void 0,children:t.jsx("div",{className:"new-session-helper-options",children:fe.map(j=>t.jsxs("button",{type:"button",className:`new-session-helper-option ${D===j?"selected":""}`,onClick:()=>void je({recapMode:j}),disabled:v||A&&(k==null?void 0:k.sandboxLevel)==="project-write"&&j==="side-session",title:Ol(j,e,L),children:[t.jsx("span",{className:`mode-option-dot recap-${j}`}),t.jsx("span",{children:ce[j]})]},j))})}),Ue&&t.jsx(w,{id:"session-default-helper-model",label:e("helperSideModelTitle"),description:e("helperSideModelDescription"),keywords:["helper model","tailed recap","side session model","recap model"],valueText:V,className:"new-session-helper-section session-default-helper-model-section settings-item--session-default-block settings-item--wide-control",children:t.jsx(ns,{label:e("helperSideModelTitle"),options:Me,selected:[V],onChange:j=>{const Q=j[0]??ss;Ee({helperSideModel:Q})},multiSelect:!1,placeholder:e("helperSideModelCheapest"),fullWidth:!0})}),t.jsx(w,{id:"session-default-suggestions",label:e("newSessionPromptSuggestionsTitle"),keywords:["suggestions","prompt suggestions","nudge"],valueText:Ae[F],className:"new-session-helper-section session-default-suggestions-section settings-item--session-default-block settings-item--wide-control",children:t.jsx("div",{className:"new-session-helper-options",children:Ie.map(j=>t.jsxs("button",{type:"button",className:`new-session-helper-option ${F===j?"selected":""}`,onClick:()=>void je({promptSuggestionMode:j}),disabled:v,title:Pe[j],children:[t.jsx("span",{className:`mode-option-dot suggestion-${j}`}),t.jsx("span",{children:Ae[j]})]},j))})}),t.jsxs("div",{className:Ds.relatedDivider,children:[t.jsx("strong",{children:e("modelSettingsRelatedBehaviorTitle")}),t.jsx("span",{children:e("modelSettingsRelatedBehaviorDescription")})]}),t.jsx(w,{id:"session-default-fork-summary",as:"label",label:e("modelSettingsForkSummaryAutoOpenTitle"),description:e("modelSettingsForkSummaryAutoOpenDescription"),keywords:["fork","fork summary","forked session",e("modelSettingsForkSummaryAutoOpenLabel")],valueText:c?e("modelSettingsForkSummaryAutoOpenLabel"):void 0,className:"new-session-helper-section session-default-fork-summary-section settings-item--session-default-block",children:t.jsx("input",{type:"checkbox",checked:c,onChange:j=>x(j.target.checked),"aria-label":e("modelSettingsForkSummaryAutoOpenLabel")})}),Z&&M&&t.jsx(Zi,{id:"session-default-compact-early",modelId:M,contextWindow:te==null?void 0:te.contextWindow,storedPercent:ne,map:(J=b==null?void 0:b.clientDefaults)==null?void 0:J.compactAtContextPercent,updateSetting:T,disabled:v,className:"new-session-helper-section session-default-compact-section settings-item--session-default-block settings-item--wide-control"}),xe&&t.jsx(Ji,{id:"session-default-claude-auto-compact",value:b==null?void 0:b.claudeAutoCompactPercentOverride,updateSetting:T,description:e("providersClaudeAutoCompactMirrorDescription"),searchable:!1}),Z&&(m==null?void 0:m.supportsNativeCompactThreshold)===!0&&t.jsx(w,{id:"session-default-force-ya-compaction",as:"label",label:e("modelSettingsForceYaCompactionLabel"),description:e("modelSettingsForceYaCompactionDescription"),keywords:["force ya","orchestrated compaction","ya compact","/compact"],valueText:ae?e("modelSettingsForceYaCompactionLabel"):void 0,className:"new-session-helper-section session-default-force-ya-section settings-item--session-default-block",children:t.jsx("input",{type:"checkbox",checked:ae,disabled:v,onChange:j=>{T("clientDefaults",{forceYaOrchestratedCompaction:j.currentTarget.checked})},"aria-label":e("modelSettingsForceYaCompactionLabel")})}),W&&m&&t.jsx(w,{id:"session-default-prompt-cache",label:e("promptCacheKeepaliveTitle"),description:[e("promptCacheKeepaliveDescription",{provider:m.displayName}),e("promptCacheKeepaliveCadenceHint")].join(" "),keywords:["prompt cache","keepalive","cache refresh","inactivity"],valueText:`${E.mode} ${E.inactivityMinutes}m`,className:"new-session-helper-section session-default-cache-keepalive-section settings-item--session-default-block settings-item--wide-control",children:t.jsxs("div",{className:"session-default-cache-keepalive-controls",children:[t.jsx("div",{className:"new-session-helper-options",children:vm.map(j=>t.jsxs("button",{type:"button",className:`new-session-helper-option ${E.mode===j?"selected":""}`,onClick:()=>void Ge({mode:j}),disabled:v,title:De[j],children:[t.jsx("span",{className:`mode-option-dot keepalive-${j}`}),t.jsx("span",{children:Re[j]})]},j))}),t.jsxs("label",{className:"prompt-cache-keepalive-cadence",children:[t.jsx("span",{children:e("promptCacheKeepaliveCadenceLabel")}),t.jsx("input",{type:"number",min:1,max:1440,step:1,defaultValue:E.inactivityMinutes,disabled:v||E.mode==="off","aria-label":e("promptCacheKeepaliveCadenceAria"),onBlur:j=>{const Q=Nm(Number(j.currentTarget.value));if(Q===null){j.currentTarget.value=String(E.inactivityMinutes);return}j.currentTarget.value=String(Q),Q!==E.inactivityMinutes&&Ge({inactivityMinutes:Q})}},`${m.name}-${E.inactivityMinutes}`),t.jsx("span",{children:e("promptCacheKeepaliveCadenceUnit")})]})]})})]})}),(m==null?void 0:m.name)==="claude"&&t.jsx("div",{className:"settings-group",children:t.jsx(w,{label:e("modelSettingsModelTitle"),description:e("modelSettingsModelDescription"),className:"model-settings-item",children:t.jsx("div",{className:"font-size-selector model-settings-chip-group",children:dc.map(j=>t.jsx("button",{type:"button",className:`font-size-option ${n===j.value?"active":""}`,onClick:()=>a(j.value),children:j.label},j.value))})})})]})}function km(){const{t:e}=K(),{isSupported:s,isSubscribed:n,isLoading:a,error:i,permission:o,subscribe:r,unsubscribe:d}=an(),{notifyInApp:u,setNotifyInApp:h}=al(),f=i===Vs?e("pushTogglePermissionRequestTimedOut"):i,p=async()=>{n?await d():await r()};if(!s){const c=i==null?void 0:i.includes("Service worker disabled in dev mode");return t.jsx(w,{label:e("pushToggleTitle"),description:i||e("pushToggleUnsupported"),info:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:e("pushToggleTitle")}),t.jsx("p",{children:i||e("pushToggleUnsupported")}),c&&t.jsxs("div",{className:"settings-info-box",style:{marginTop:"0.5rem"},children:[t.jsx("p",{children:e("pushToggleThisDeviceOnly")}),t.jsx("p",{children:e("pushToggleDevModeHint")})]}),t.jsx("p",{style:{marginTop:"0.5rem"},children:t.jsx("a",{href:"https://github.com/kzahel/yepanywhere/blob/main/docs/push-notifications.md",target:"_blank",rel:"noopener noreferrer",children:e("pushToggleTroubleshooting")})})]})})}return o==="denied"?t.jsx(w,{label:e("pushToggleTitle"),description:e("pushToggleBlocked"),info:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:e("pushToggleTitle")}),t.jsx("p",{className:"settings-warning",children:e("pushToggleBlocked")})]})}):t.jsxs(t.Fragment,{children:[t.jsx(w,{label:e("pushToggleTitle"),description:e("pushToggleDescription"),info:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:e("pushToggleTitle")}),t.jsx("p",{children:e("pushToggleDescription")}),f&&t.jsx("p",{className:"settings-error",children:f})]}),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:n,onChange:p,disabled:a}),t.jsx("span",{className:"toggle-slider"})]})}),n&&t.jsx(w,{label:e("pushToggleNotifyInAppTitle"),description:e("pushToggleNotifyInAppDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:u,onChange:c=>h(c.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})})]})}function _m(){const[e,s]=l.useState({settings:null,isLoading:!0,error:null});l.useEffect(()=>{(async()=>{try{const{settings:i}=await he.getNotificationSettings();s({settings:i,isLoading:!1,error:null})}catch(i){console.error("[useNotificationSettings] Failed to fetch:",i),s(o=>({...o,isLoading:!1,error:i instanceof Error?i.message:"Failed to load settings"}))}})()},[]),Dt({fetcher:()=>he.getNotificationSettings().then(a=>a.settings),current:e.settings,apply:a=>s(i=>({...i,settings:a,error:null}))});const n=l.useCallback(async(a,i)=>{s(o=>({...o,isLoading:!0,error:null}));try{const{settings:o}=await he.updateNotificationSettings({[a]:i});s({settings:o,isLoading:!1,error:null})}catch(o){console.error("[useNotificationSettings] Failed to update:",o),s(r=>({...r,isLoading:!1,error:o instanceof Error?o.message:"Failed to update"}))}},[]);return{...e,updateSetting:n}}const Mm="_diagnostics_3p1f9_1",Am="_diagnosticsSummary_3p1f9_9",Dm="_diagnosticsBody_3p1f9_52",Pm="_testRow_3p1f9_64",Im="_testActions_3p1f9_70",Ct={diagnostics:Mm,diagnosticsSummary:Am,diagnosticsBody:Dm,testRow:Pm,testActions:Im};function Lm(e,s,n){const a=e||"Unknown device";return s!=null&&s.includes("google")?{displayName:a,browserType:n==="android"?"(Android/Chrome)":"(Chrome)"}:s!=null&&s.includes("apple")||s!=null&&s.includes("push.apple")?{displayName:a,browserType:n==="ios"?"(iOS/Safari)":"(Safari)"}:s!=null&&s.includes("mozilla")||s!=null&&s.includes("push.services.mozilla")?{displayName:a,browserType:"(Firefox)"}:{displayName:a,browserType:""}}function Rm(e,s){const n=new Date(e),i=new Date().getTime()-n.getTime(),o=Math.floor(i/(1e3*60*60*24));return o===0?new Date().toLocaleDateString():o===1?new Date(Date.now()-864e5).toLocaleDateString():o<7?s("hostPickerLastConnectedDays",{count:o}):n.toLocaleDateString()}function Om(e,s,n){const a=new Map;for(const o of e){const{displayName:r,browserType:d}=Lm(o.deviceName,o.endpointDomain,o.deviceType),u=s.get(o.browserProfileId);a.set(o.browserProfileId,{browserProfileId:o.browserProfileId,displayName:r,browserType:d,isSubscribed:!0,deviceType:o.deviceType,isConnected:!!u,tabCount:(u==null?void 0:u.connectionCount)??0,subscribedAt:o.createdAt,isCurrentDevice:o.browserProfileId===n})}for(const[o,r]of s)if(!a.has(o)){const d=o.slice(0,8);a.set(o,{browserProfileId:o,displayName:d,browserType:"",isSubscribed:!1,deviceType:"unknown",isConnected:!0,tabCount:r.connectionCount,isCurrentDevice:o===n})}const i=Array.from(a.values());return i.sort((o,r)=>o.isCurrentDevice&&!r.isCurrentDevice?-1:!o.isCurrentDevice&&r.isCurrentDevice?1:o.isConnected&&!r.isConnected?-1:!o.isConnected&&r.isConnected?1:o.isConnected&&r.isConnected?r.tabCount-o.tabCount:o.subscribedAt&&r.subscribedAt?new Date(r.subscribedAt).getTime()-new Date(o.subscribedAt).getTime():0),i}function Um(e){return e.isSubscribed&&(e.deviceType==="android"||e.deviceType==="ios"||e.deviceType==="mobile")}const Fm=[{key:"toolApproval",id:"notifications-tool-approvals",titleKey:"notificationsToolApprovalsTitle",descriptionKey:"notificationsToolApprovalsDescription",defaultValue:!0},{key:"userQuestion",id:"notifications-questions",titleKey:"notificationsQuestionsTitle",descriptionKey:"notificationsQuestionsDescription",defaultValue:!0},{key:"sessionHalted",id:"notifications-session-halted",titleKey:"notificationsSessionHaltedTitle",descriptionKey:"notificationsSessionHaltedDescription",defaultValue:!1},{key:"projectInactive",id:"notifications-project-inactive",titleKey:"notificationsProjectInactiveTitle",descriptionKey:"notificationsProjectInactiveDescription",defaultValue:!1},{key:"yaInactive",id:"notifications-ya-inactive",titleKey:"notificationsYaInactiveTitle",descriptionKey:"notificationsYaInactiveDescription",defaultValue:!1}];function Bm(e){return e==="high"?"pushDeliveryHigh":e==="low"?"pushDeliveryLow":e==="very-low"?"pushDeliveryVeryLow":"pushDeliveryNormal"}function Hm(){const{t:e}=K();_e(e("settingsNotificationsTitle"));const{browserProfileId:s,unsubscribe:n}=an(),{devices:a,isLoading:i,removeDevice:o,sendTest:r}=Ap(),{connections:d,isLoading:u}=Xi(),{settings:h,isLoading:f,updateSetting:p}=_m(),c=a.length>0,x=i||u,[b,v]=l.useState("normal"),[T,I]=l.useState("high"),[C,O]=l.useState(()=>new Set),[k,y]=l.useState(null),S=l.useMemo(()=>h?{toolApproval:h.toolApproval,userQuestion:h.userQuestion,sessionHalted:h.sessionHalted,projectInactive:h.projectInactive,yaInactive:h.yaInactive}:null,[h]),m=l.useCallback(E=>{p("toolApproval",E.toolApproval),p("userQuestion",E.userQuestion),p("sessionHalted",E.sessionHalted),p("projectInactive",E.projectInactive),p("yaInactive",E.yaInactive)},[p]);$e(S,m);const _=Om(a,d,s),A=l.useMemo(()=>_.filter(Um),[_]),P=A.some(E=>C.has(E.browserProfileId)),M=l.useCallback(()=>e("pushTestMessage",{priority:e(Bm(T))}),[e,T]),R=l.useCallback((E,V)=>{O(te=>{const ne=new Set(te);for(const ae of E)V?ne.add(ae):ne.delete(ae);return ne})},[]),N=l.useCallback(async E=>{R([E.browserProfileId],!0),y(null);try{await r(E.browserProfileId,{displayUrgency:b,deliveryUrgency:T,message:M()}),y({kind:"success",message:e("notificationsTestSentToDevice",{device:E.displayName})})}catch(V){y({kind:"error",message:V instanceof Error?V.message:e("notificationsTestFailed")})}finally{R([E.browserProfileId],!1)}},[M,R,r,e,T,b]),$=l.useCallback(async()=>{const E=A.map(V=>V.browserProfileId);if(E.length!==0){R(E,!0),y(null);try{const V=await Promise.allSettled(A.map(ne=>r(ne.browserProfileId,{displayUrgency:b,deliveryUrgency:T,message:M()}))),te=V.filter(ne=>ne.status==="rejected");te.length>0?y({kind:"error",message:e("notificationsTestPartialFailure",{failed:te.length,total:V.length})}):y({kind:"success",message:e("notificationsTestSentToMobile",{count:V.length})})}finally{R(E,!1)}}},[M,R,A,r,e,T,b]),D=l.useCallback(async E=>{if(E.isCurrentDevice){await n();return}await o(E.browserProfileId)},[o,n]),L=!c,F=L?e("notificationsNoSubscribedDevices"):void 0;return t.jsxs(t.Fragment,{children:[t.jsx(oe,{title:e("notificationsThisBrowserTitle"),description:e("notificationsThisBrowserDescription"),children:t.jsx("div",{className:"settings-group",children:t.jsx(km,{})})}),t.jsxs(oe,{title:e("notificationsEventsTitle"),description:e("notificationsEventsDescription"),children:[t.jsx(we,{children:L&&!i&&t.jsx("div",{className:"settings-info-box settings-subsection-hint",children:t.jsx("p",{children:e("notificationsNoSubscribedDevices")})})}),t.jsx("div",{className:"settings-group",children:Fm.map(E=>t.jsx(w,{id:E.id,title:F,label:e(E.titleKey),description:e(E.descriptionKey),children:t.jsxs("label",{className:"toggle-switch",title:F,children:[t.jsx("input",{type:"checkbox",checked:(h==null?void 0:h[E.key])??E.defaultValue,onChange:V=>p(E.key,V.target.checked),disabled:f||L}),t.jsx("span",{className:"toggle-slider"})]})},E.key))})]}),t.jsx(oe,{title:e("notificationsDevicesTitle"),description:e("notificationsDevicesDescription"),children:t.jsxs(we,{children:[t.jsx("div",{className:"settings-group",children:x?t.jsx("p",{className:"settings-hint",children:e("notificationsLoadingDevices")}):_.length===0?t.jsx("p",{className:"settings-hint",children:e("notificationsNoDevices")}):t.jsx("div",{className:"device-list",children:_.map(E=>t.jsxs("div",{className:"device-list-item",children:[t.jsxs("div",{className:"device-list-info",children:[t.jsxs("strong",{children:[E.displayName,E.browserType&&` ${E.browserType}`,E.isCurrentDevice&&t.jsx("span",{className:"device-current-badge",children:e("notificationsThisDevice")})]}),t.jsxs("p",{children:[E.isConnected?t.jsx("span",{className:"device-status device-status-online",children:E.tabCount===1?e("notificationsOneTab"):e("notificationsTabs",{count:E.tabCount})}):t.jsx("span",{className:"device-status device-status-offline",children:e("notificationsOffline")}),!E.isSubscribed&&t.jsx("span",{className:"device-no-push",children:e("notificationsNoPush")}),E.subscribedAt&&t.jsx("span",{className:"device-subscribed-date",children:e("notificationsSubscribed",{date:Rm(E.subscribedAt,e)})})]})]}),E.isSubscribed&&t.jsxs("div",{className:"device-list-actions",children:[t.jsx("button",{type:"button",className:"settings-button",onClick:()=>N(E),disabled:C.has(E.browserProfileId),title:e("notificationsTestDevice"),children:e("notificationsTest")}),t.jsx("button",{type:"button",className:"settings-button settings-button-danger-subtle",onClick:()=>D(E),title:E.isCurrentDevice?e("notificationsRemoveThisDevice"):e("notificationsRemoveDevice"),children:e("notificationsRemove")})]})]},E.browserProfileId))})}),c&&t.jsxs("details",{className:Ct.diagnostics,children:[t.jsx("summary",{className:Ct.diagnosticsSummary,children:t.jsxs("span",{children:[t.jsx("strong",{children:e("notificationsDiagnosticsTitle")}),t.jsx("span",{children:e("notificationsDiagnosticsDescription")})]})}),t.jsx("div",{className:Ct.diagnosticsBody,children:t.jsx("div",{className:"settings-group",children:t.jsxs("div",{className:`settings-item push-test-controls ${Ct.testRow}`,children:[t.jsxs("div",{className:"settings-item-info",children:[t.jsx("strong",{children:e("notificationsTestPushTitle")}),t.jsx("p",{children:e("notificationsTestPushDescription")}),t.jsx("p",{className:`push-test-status ${(k==null?void 0:k.kind)==="error"?"settings-error":"settings-hint"}`,"aria-live":"polite",children:(k==null?void 0:k.message)??" "})]}),t.jsxs("div",{className:`settings-item-actions ${Ct.testActions}`,children:[t.jsxs("select",{className:"settings-select","aria-label":e("pushToggleDisplayBehavior"),value:b,onChange:E=>v(E.target.value),disabled:P,children:[t.jsx("option",{value:"normal",children:e("pushToggleUrgencyNormal")}),t.jsx("option",{value:"persistent",children:e("pushToggleUrgencyPersistent")}),t.jsx("option",{value:"silent",children:e("pushToggleUrgencySilent")})]}),t.jsxs("select",{className:"settings-select","aria-label":e("pushTestDeliveryPriority"),value:T,onChange:E=>I(E.target.value),disabled:P,children:[t.jsx("option",{value:"high",children:e("pushDeliveryHigh")}),t.jsx("option",{value:"normal",children:e("pushDeliveryNormal")}),t.jsx("option",{value:"low",children:e("pushDeliveryLow")}),t.jsx("option",{value:"very-low",children:e("pushDeliveryVeryLow")})]}),t.jsx("button",{type:"button",className:"settings-button",onClick:$,disabled:A.length===0||P,title:A.length===0?e("notificationsNoMobilePushDevices"):e("notificationsSendToMobileDevices",{count:A.length}),children:e("notificationsSendToMobileDevices",{count:A.length})})]})]})})})]})]})})]})}function Ja(e,s){let n=0,a=Number.POSITIVE_INFINITY;return e.forEach((i,o)=>{const r=Math.abs(i-s);r<a&&(a=r,n=o)}),n}function Za(e){const s=e/1048576;return s<10?s.toFixed(1):String(Math.round(s))}function Wm(){const{t:e}=K();_e(e("performanceSectionTitle"));const{streamingEnabled:s,setStreamingEnabled:n}=wl(),{sessionLoadingProgressEnabled:a,setSessionLoadingProgressEnabled:i}=Cl(),{sessionDomLingerEnabled:o,sessionActiveWindowTrimEnabled:r,sessionTranscriptCacheBudgetMb:d,sessionTranscriptCacheTtlHours:u,setSessionDomLingerEnabled:h,setSessionActiveWindowTrimEnabled:f,setSessionTranscriptCacheBudgetMb:p,setSessionTranscriptCacheTtlHours:c}=pi(),{stableToolPreviewRendering:x,setStableToolPreviewRendering:b}=ml(),{version:v}=We(),{settings:T,isLoading:I,error:C,updateSetting:O}=Ce(),k=me(v,ur),y=(T==null?void 0:T.hostProcessObservabilityEnabled)??!0,[S,m]=l.useState(!1),[_,A]=l.useState(null),[P,M]=l.useState(null),R=_??Ja(Ht,d),N=P??Ja(Wt,u),$=Ht[R]??0,D=Wt[N]??1,L=$===0?e("commonOff"):e("performanceTranscriptCacheMbValue",{count:$}),F=D<24?e("performanceTranscriptCacheTtlHoursValue",{count:D}):e("performanceTranscriptCacheTtlDaysValue",{count:Math.round(D/24)}),E=l.useMemo(()=>{if($===0)return null;const z=Ur(),re=z??Fr,Ne=Math.max(1,Math.floor($*1024*1024/re)),pe=(re/(1024*1024)).toFixed(1);return e(z!==null?"performanceTranscriptCacheEquivalentLast":"performanceTranscriptCacheEquivalentTypical",{count:Ne,size:pe})},[$,e]),V=Vr(),te=V.totalBytes>0?e("performanceTranscriptCacheCurrentUsage",{warmSize:Za(V.warmCacheBytes),liveSize:Za(V.liveRetainedBytes)}):null,ne=l.useCallback(z=>{A(null);const re=Ht[z];re!==void 0&&p(re)},[p]),ae=l.useCallback(z=>{M(null);const re=Wt[z];re!==void 0&&c(re)},[c]),Z=l.useCallback(async z=>{m(!0);try{await O("hostProcessObservabilityEnabled",z)}catch{}finally{m(!1)}},[O]),ee=l.useMemo(()=>({streamingEnabled:s,sessionLoadingProgressEnabled:a,sessionDomLingerEnabled:o,sessionActiveWindowTrimEnabled:r,sessionTranscriptCacheBudgetMb:d,sessionTranscriptCacheTtlHours:u,stableToolPreviewRendering:x,hostProcessObservabilityEnabled:y}),[s,a,o,r,d,u,x,y]),xe=l.useCallback(z=>{n(z.streamingEnabled),i(z.sessionLoadingProgressEnabled),h(z.sessionDomLingerEnabled),f(z.sessionActiveWindowTrimEnabled),p(z.sessionTranscriptCacheBudgetMb),c(z.sessionTranscriptCacheTtlHours),b(z.stableToolPreviewRendering),k&&z.hostProcessObservabilityEnabled!==y&&Z(z.hostProcessObservabilityEnabled)},[n,i,h,f,p,c,b,y,k,Z]);return $e(ee,xe),t.jsx(oe,{description:e("performanceSectionDescription"),children:t.jsxs("div",{className:"settings-group",children:[t.jsx(w,{label:e("appearanceStreamingTitle"),description:e("appearanceStreamingDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:s,onChange:z=>n(z.target.checked),"aria-label":e("appearanceStreamingTitle")}),t.jsx("span",{className:"toggle-slider"})]})}),t.jsx(w,{label:e("appearanceSessionLoadingProgressTitle"),description:e("appearanceSessionLoadingProgressDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:a,onChange:z=>i(z.target.checked),"aria-label":e("appearanceSessionLoadingProgressTitle")}),t.jsx("span",{className:"toggle-slider"})]})}),t.jsx(w,{label:e("performanceKeepRecentSessionMountedTitle"),description:e("performanceKeepRecentSessionMountedDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:o,onChange:z=>h(z.target.checked),"aria-label":e("performanceKeepRecentSessionMountedTitle")}),t.jsx("span",{className:"toggle-slider"})]})}),t.jsx(w,{label:e("performanceActiveWindowTrimTitle"),description:e("performanceActiveWindowTrimDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:r,onChange:z=>f(z.target.checked),"aria-label":e("performanceActiveWindowTrimTitle")}),t.jsx("span",{className:"toggle-slider"})]})}),t.jsx(w,{label:e("performanceTranscriptCacheTitle"),description:e("performanceTranscriptCacheDescription"),valueText:L,className:"settings-item--wide-control",info:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:e("performanceTranscriptCacheTitle")}),t.jsx("p",{children:e("performanceTranscriptCacheDescription")}),E?t.jsx("p",{children:E}):null,te?t.jsx("p",{children:te}):null]}),children:t.jsxs("div",{className:"settings-item-actions",children:[t.jsx(Le,{min:0,max:Ht.length-1,step:1,value:R,onDraftChange:A,onCommit:ne,"aria-label":e("performanceTranscriptCacheTitle")}),t.jsx("span",{className:"settings-input-unit",children:L})]})}),t.jsx(w,{label:e("performanceTranscriptCacheTtlTitle"),description:e("performanceTranscriptCacheTtlDescription"),valueText:F,className:"settings-item--wide-control",children:t.jsxs("div",{className:"settings-item-actions",children:[t.jsx(Le,{min:0,max:Wt.length-1,step:1,value:N,onDraftChange:M,onCommit:ae,disabled:$===0,"aria-label":e("performanceTranscriptCacheTtlTitle")}),t.jsx("span",{className:"settings-input-unit",children:F})]})}),t.jsx(w,{label:e("appearanceStableToolPreviewTitle"),description:e("appearanceStableToolPreviewDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:x,onChange:z=>b(z.target.checked),"aria-label":e("appearanceStableToolPreviewTitle")}),t.jsx("span",{className:"toggle-slider"})]})}),k&&t.jsx(w,{label:e("performanceHostProcessObservabilityTitle"),description:e("performanceHostProcessObservabilityDescription"),keywords:["Agents","CPU","memory","external processes"],after:C?t.jsx("p",{className:"settings-error",children:C}):null,children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:y,disabled:I||S,onChange:z=>void Z(z.target.checked),"aria-label":e("performanceHostProcessObservabilityTitle")}),t.jsx("span",{className:"toggle-slider"})]})})]})})}const $m="You are a helpful coding assistant. You help users with software engineering tasks. You have access to tools for reading files, editing files, running shell commands, and searching code. Use tools when needed to answer questions or make changes. Be concise and direct.",Vm="claude auth login --claudeai",so="yep-anywhere:claude-ollama-deprecation-v1",zm=!1,Ps=-1;function Gm(){try{return window.localStorage.getItem(so)!=="dismissed"}catch{return!0}}function Km(){try{window.localStorage.setItem(so,"dismissed")}catch{}}function Ym(){const{t:e}=K(),{settings:s,updateSetting:n}=Ce(),[a,i]=l.useState(""),[o,r]=l.useState(!1),[d,u]=l.useState(!1),h=(s==null?void 0:s.ollamaUrl)??"";l.useEffect(()=>{s&&i(s.ollamaUrl??"")},[s]);const f=l.useCallback(async()=>{r(!0);try{await n("ollamaUrl",a.trim()||void 0),u(!1)}catch{}finally{r(!1)}},[a,n]);return t.jsxs("div",{style:{marginTop:"var(--space-2)",width:"100%"},children:[t.jsxs("div",{style:{display:"flex",gap:"var(--space-2)",alignItems:"center"},children:[t.jsx("input",{type:"text",className:"settings-input",value:a,onChange:p=>{i(p.target.value),u(p.target.value!==h)},placeholder:"http://localhost:11434",style:{flex:1}}),t.jsx("button",{type:"button",className:"settings-button",disabled:!d||o,onClick:f,children:e(o?"providersSaving":"providersSave")})]}),t.jsx("span",{className:"settings-hint",children:e("providersOllamaUrlHint")})]})}function Qm(){const{t:e}=K(),{settings:s,updateSetting:n}=Ce(),a=(s==null?void 0:s.ollamaUseFullSystemPrompt)??!1;return t.jsxs("label",{style:{display:"flex",gap:"var(--space-2)",alignItems:"center",marginTop:"var(--space-2)",cursor:"pointer"},children:[t.jsx("input",{type:"checkbox",checked:a,onChange:i=>n("ollamaUseFullSystemPrompt",i.target.checked)}),t.jsx("span",{children:e("providersUseFullPrompt")}),t.jsx("span",{className:"settings-hint",style:{marginLeft:"auto"},children:e("providersUseFullPromptHint")})]})}function Xm(){const{t:e}=K(),{settings:s,updateSetting:n}=Ce(),[a,i]=l.useState(""),[o,r]=l.useState(!1),[d,u]=l.useState(!1),h=(s==null?void 0:s.ollamaSystemPrompt)??"";l.useEffect(()=>{s&&i(s.ollamaSystemPrompt??"")},[s]);const f=l.useCallback(async()=>{r(!0);try{await n("ollamaSystemPrompt",a.trim()||void 0),u(!1)}catch{}finally{r(!1)}},[a,n]);return t.jsxs("div",{style:{marginTop:"var(--space-2)",width:"100%"},children:[t.jsx("textarea",{className:"settings-textarea",value:a,onChange:p=>{i(p.target.value),u(p.target.value!==h)},placeholder:$m,rows:4}),t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:"var(--space-2)"},children:[t.jsx("span",{className:"settings-hint",children:e("providersOllamaPromptHint")}),t.jsx("button",{type:"button",className:"settings-button",disabled:!d||o,onClick:f,children:e(o?"providersSaving":"providersSave")})]})]})}function qm(){const{t:e}=K(),{settings:s,updateSetting:n}=Ce(),a=(s==null?void 0:s.grokBuildUseXaiApiKey)??!1;return t.jsxs("label",{style:{display:"flex",gap:"var(--space-2)",alignItems:"flex-start",marginTop:"var(--space-2)",cursor:"pointer"},children:[t.jsx("input",{type:"checkbox",checked:a,onChange:i=>n("grokBuildUseXaiApiKey",i.target.checked),style:{marginTop:"0.2rem"}}),t.jsxs("span",{children:[t.jsx("span",{children:e("providersGrokUseXaiApiKey")}),t.jsx("span",{className:"settings-hint",style:{display:"block"},children:e("providersGrokUseXaiApiKeyHint")})]})]})}function Jm(){const{t:e}=K(),{showToast:s}=ls(),{settings:n,updateSetting:a}=Ce(),{status:i,isChecking:o,isInstalling:r,error:d,installOutput:u,refresh:h,install:f}=Mc(),p=(n==null?void 0:n.codexUpdatePolicy)??"notify",c=(i==null?void 0:i.updateMethod)==="npm",x=l.useCallback(async v=>{try{await navigator.clipboard.writeText(v),s(e("providersCodexUpdateCommandCopied"),"success")}catch{s(e("providersCodexUpdateCopyFailed"),"error")}},[s,e]);if(!(i!=null&&i.installed)||!i.latest)return null;const b=i.updateAvailable;return t.jsxs("div",{style:{marginTop:"var(--space-2)",width:"100%"},children:[t.jsxs("div",{style:{display:"flex",gap:"var(--space-2)",alignItems:"center",flexWrap:"wrap"},children:[b?t.jsxs("span",{children:[t.jsx("strong",{children:e("providersCodexUpdateAvailable")})," ",i.installed," → ",i.latest]}):t.jsx("span",{className:"settings-hint",children:e("providersCodexUpdateUpToDate",{version:i.installed})}),t.jsx("button",{type:"button",className:"settings-button",onClick:()=>void h(!0),disabled:o,style:{marginLeft:"auto"},children:e(o?"providersCodexUpdateChecking":"providersCodexUpdateCheckNow")}),i.releaseUrl&&b&&t.jsx("a",{href:i.releaseUrl,target:"_blank",rel:"noopener noreferrer",className:"settings-link",children:e("providersCodexUpdateReleaseNotes")})]}),b&&t.jsxs("div",{style:{display:"flex",gap:"var(--space-2)",alignItems:"center",marginTop:"var(--space-2)",flexWrap:"wrap"},children:[i.updateMethod==="npm"?t.jsx("button",{type:"button",className:"settings-button",onClick:()=>void f(),disabled:r,children:e(r?"providersCodexUpdateInstalling":"providersCodexUpdateNow")}):i.manualInstallCommand?t.jsx("span",{className:"settings-hint",children:e("providersCodexUpdateWithInstaller")}):null,i.manualInstallCommand?t.jsxs(t.Fragment,{children:[t.jsx("code",{style:{padding:"2px 6px",background:"var(--color-surface-raised, #f5f5f5)",borderRadius:4,fontSize:"0.85em"},children:i.manualInstallCommand}),t.jsx("button",{type:"button",className:"settings-button",onClick:()=>void x(i.manualInstallCommand??""),children:e("remoteSetupCopy")})]}):i.updateMethod==="manual"?t.jsx("span",{className:"settings-hint",children:e("providersCodexUpdateManualInstallHint")}):null]}),d&&t.jsx("p",{className:"settings-hint",style:{color:"var(--color-error)"},children:d}),u&&t.jsxs("details",{style:{marginTop:"var(--space-2)"},children:[t.jsx("summary",{className:"settings-hint",children:e("providersCodexUpdateInstallOutput")}),t.jsx("pre",{style:{fontSize:"0.8em",whiteSpace:"pre-wrap",maxHeight:200,overflow:"auto"},children:u})]}),t.jsxs("fieldset",{style:{border:"none",padding:0,marginTop:"var(--space-3)",display:"flex",gap:"var(--space-3)",flexWrap:"wrap"},children:[t.jsx("legend",{className:"settings-hint",style:{marginBottom:4},children:e("providersCodexUpdatePolicyTitle")}),["auto","notify","off"].map(v=>{const T=v==="auto"&&!c;return t.jsxs("label",{style:{display:"inline-flex",gap:4,alignItems:"center",opacity:T?.55:1,cursor:T?"not-allowed":"pointer"},title:T?e("providersCodexUpdatePolicyAutoUnavailable"):void 0,children:[t.jsx("input",{type:"radio",name:"codex-update-policy",value:v,checked:p===v,disabled:T,onChange:()=>void a("codexUpdatePolicy",v)}),t.jsx("span",{children:e(v==="auto"?"commonAuto":v==="notify"?"providersCodexUpdatePolicyNotify":"commonOff")})]},v)})]})]})}function Zm({value:e,updateSetting:s}){const{t:n}=K(),a={auto:n("providersCodexReasoningSummaryAutomatic"),concise:n("providersCodexReasoningSummaryConcise"),detailed:n("providersCodexReasoningSummaryDetailed"),none:n("providersCodexReasoningSummaryOff")};return t.jsx(w,{id:"provider-codex-reasoning-summary",label:n("providersCodexReasoningSummaryTitle"),description:n("providersCodexReasoningSummaryDescription"),keywords:["model_reasoning_summary","reasoning summary","auto","concise","detailed","none","off"],valueText:a[e],children:t.jsx("select",{className:"settings-select","aria-label":n("providersCodexReasoningSummaryAria"),value:e,onChange:i=>{ec(i.target.value)&&s("codexReasoningSummary",i.target.value)},children:Zl.map(i=>t.jsx("option",{value:i,children:a[i]},i))})})}function eh(){const{settings:e}=Ce(),s=(e==null?void 0:e.ollamaUseFullSystemPrompt)??!1;return t.jsxs(t.Fragment,{children:[t.jsx(Ym,{}),t.jsx(Qm,{}),!s&&t.jsx(Xm,{})]})}function th({reloadProviders:e,supportsAutostart:s}){const n="http://localhost:4141",{t:a}=K(),{settings:i,updateSetting:o,updateSettings:r}=Ce(),[d,u]=l.useState(""),[h,f]=l.useState(""),[p,c]=l.useState(!1),x=(i==null?void 0:i.claudeGatewayUrl)??"",b=(i==null?void 0:i.claudeGatewayStartCommand)??"",v=d.trim()!==x||s&&h.trim()!==b;l.useEffect(()=>{u((i==null?void 0:i.claudeGatewayUrl)??"")},[i==null?void 0:i.claudeGatewayUrl]),l.useEffect(()=>{f((i==null?void 0:i.claudeGatewayStartCommand)??"")},[i==null?void 0:i.claudeGatewayStartCommand]);const T=l.useCallback(async()=>{c(!0);try{s?await r({claudeGatewayUrl:d.trim()||void 0,claudeGatewayStartCommand:h.trim()||void 0}):await o("claudeGatewayUrl",d.trim()||void 0),await e()}catch{}finally{c(!1)}},[e,h,s,o,r,d]);return t.jsxs("div",{id:"provider-claude-gateway-configuration",className:"settings-subsection",children:[t.jsx("h3",{children:a("providersClaudeGatewayTitle")}),t.jsx("p",{className:"settings-hint",children:a("providersClaudeGatewayDescription")}),t.jsxs("form",{className:"claude-gateway-settings-control",onSubmit:I=>{I.preventDefault(),v&&!p&&T()},children:[t.jsxs("div",{className:"claude-gateway-settings-row",children:[t.jsx("input",{type:"url",className:"settings-input",value:d,onChange:I=>u(I.target.value),onFocus:()=>{d.trim()||u(n)},placeholder:n,"aria-label":a("providersClaudeGatewayUrlAria")}),t.jsx("button",{type:"submit",className:"settings-button",disabled:!v||p,children:a(p?"providersSaving":"providersSave")})]}),s&&t.jsxs(t.Fragment,{children:[t.jsxs("label",{className:"claude-gateway-start-command",children:[t.jsx("span",{children:a("providersClaudeGatewayStartCommandLabel")}),t.jsx("input",{type:"text",className:"settings-input",value:h,maxLength:1e4,onChange:I=>f(I.target.value),placeholder:a("providersClaudeGatewayStartCommandPlaceholder"),"aria-label":a("providersClaudeGatewayStartCommandAria")})]}),t.jsx("p",{className:"settings-hint",children:a("providersClaudeGatewayStartCommandHint")})]}),t.jsx("p",{className:"settings-hint",children:a("providersClaudeGatewayIsolationHint")})]})]})}function ei({id:e,setting:s,title:n,description:a}){const{settings:i,updateSetting:o}=Ce(),r=(i==null?void 0:i[s])??!0;return t.jsxs("div",{id:e,className:"settings-subsection",children:[t.jsxs("label",{children:[t.jsx("input",{type:"checkbox",checked:r,"aria-label":n,onChange:d=>void o(s,d.target.checked)})," ",t.jsx("strong",{children:n})]}),t.jsx("p",{className:"settings-hint",children:a})]})}function sh({command:e,onCopy:s}){const{t:n}=K();return t.jsxs("div",{className:"settings-command-panel",children:[t.jsx("div",{className:"settings-command-preview",role:"group","aria-label":n("providersClaudeLoginCommandPreviewAria"),children:t.jsx("code",{children:e})}),t.jsx("button",{type:"button",className:"settings-button",onClick:()=>s(e),children:n("providersClaudeLoginCommandCopy")})]})}function nh({serverProviders:e,settings:s,updateSetting:n}){var h,f,p,c,x,b;const{t:a}=K(),i=e.find(v=>v.name==="claude"),o=qs(s==null?void 0:s.newSessionDefaults,"claude"),r=typeof o.model=="string"&&o.model!=="default"?o.model:(f=(h=i==null?void 0:i.models)==null?void 0:h[0])==null?void 0:f.id;if(!r||r==="default")return null;const d=(p=i==null?void 0:i.models)==null?void 0:p.find(v=>v.id===r),u=((x=(c=s==null?void 0:s.clientDefaults)==null?void 0:c.compactAtContextPercent)==null?void 0:x[r])??0;return t.jsx(Zi,{id:"provider-ya-compact-early",modelId:r,contextWindow:d==null?void 0:d.contextWindow,storedPercent:u,map:(b=s==null?void 0:s.clientDefaults)==null?void 0:b.compactAtContextPercent,updateSetting:n,description:a("providersYaCompactEarlyMirrorDescription",{model:(d==null?void 0:d.name)??r}),searchable:!1})}function ah({modelOptions:e,selections:s,updateSetting:n,reloadProviders:a}){const{t:i}=K(),o=l.useRef(null),[r,d]=l.useState(!1),[u,h]=l.useState(null),[f,p]=l.useState(""),[c,x]=l.useState(!1),[b,v]=l.useState(null),T=l.useMemo(()=>new Set(s.map(m=>m.id)),[s]),I=l.useMemo(()=>{const m=new Set(e.map(_=>_.id));return[...e,...s.filter(_=>!m.has(_.id)).map(_=>({id:_.id,name:_.label,description:_.origin==="registry"?i("providersAdditionalModelsUnlistedDescription"):i("providersAdditionalModelsCustomDescription"),catalogGroup:"additional"}))]},[e,s,i]),C=s.length===0?i("providersAdditionalModelsNone"):s.length===1?i("providersAdditionalModelsOne"):i("providersAdditionalModelsMany",{count:String(s.length)}),O=l.useCallback(async m=>{x(!0),v(null);try{await n("claudeAdditionalModels",m),await a()}catch(_){v(_ instanceof Error?_.message:i("providersAdditionalModelsSaveError"))}finally{x(!1)}},[a,i,n]),k=l.useCallback(m=>{const _=T.has(m.id)?s.filter(A=>A.id!==m.id):[...s,{id:m.id,label:m.name,origin:"registry"}];O(_)},[O,T,s]),y=l.useCallback(()=>{const m=f.trim();if(!Lc(m)){v(i("providersAdditionalModelsInvalidId"));return}if(T.has(m)){v(i("providersAdditionalModelsDuplicateId"));return}const _=e.find(P=>P.id===m);if(!_&&!Rc(m)){v(i("providersAdditionalModelsInvalidId"));return}const A=_?{id:m,label:_.name,origin:"registry"}:{id:m,label:m,origin:"custom"};p(""),O([...s,A])},[f,e,O,T,s,i]),S=l.useCallback(()=>{var _;const m=(_=o.current)==null?void 0:_.getBoundingClientRect();h(m?{bottom:m.bottom,height:m.height,left:m.left,right:m.right,top:m.top,width:m.width}:null),v(null),d(!0)},[]);return t.jsxs(t.Fragment,{children:[t.jsx(w,{id:"provider-claude-additional-models",label:i("providersAdditionalModelsTitle"),description:i("providersAdditionalModelsDescription"),valueText:C,className:"providers-additional-models-setting",children:t.jsxs("button",{ref:o,type:"button",className:"settings-button settings-button-secondary providers-additional-models-trigger",onClick:S,"aria-haspopup":"dialog",children:[t.jsx("span",{children:C}),t.jsx("span",{"aria-hidden":"true",children:"▾"})]})}),r&&t.jsx(Pr,{title:i("providersAdditionalModelsTitle"),onClose:()=>d(!1),anchorRect:u,children:t.jsxs("div",{className:"providers-additional-models-editor",children:[t.jsx("p",{className:"settings-hint",children:i("providersAdditionalModelsEditorDescription")}),t.jsx("div",{className:"providers-additional-models-list",children:I.map(m=>t.jsxs("label",{className:"providers-additional-model-option",children:[t.jsx("input",{type:"checkbox",checked:T.has(m.id),disabled:c,onChange:()=>k(m)}),t.jsxs("span",{children:[t.jsx("strong",{children:m.name}),t.jsx("code",{children:m.id}),m.description&&t.jsx("span",{className:"settings-hint",children:m.description})]})]},m.id))}),t.jsxs("details",{className:"providers-additional-models-custom",children:[t.jsx("summary",{children:i("providersAdditionalModelsCustomTitle")}),t.jsx("p",{className:"settings-hint",children:i("providersAdditionalModelsCustomHint")}),t.jsxs("div",{className:"providers-additional-models-custom-row",children:[t.jsx("input",{type:"text",className:"settings-input",value:f,maxLength:Ci,placeholder:i("providersAdditionalModelsCustomPlaceholder"),"aria-label":i("providersAdditionalModelsCustomInputAria"),onChange:m=>p(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),y())}}),t.jsx("button",{type:"button",className:"settings-button",disabled:c||!f.trim(),onClick:y,children:i("providersAdditionalModelsAdd")})]})]}),c&&t.jsx("p",{className:"settings-hint",children:i("providersSaving")}),b&&t.jsx("p",{className:"settings-warning",children:b})]})})]})}function ih(){const{t:e}=K();_e(e("providersSectionTitle"));const[s,n]=l.useState(Gm),{showToast:a}=ls(),{providers:i,refetch:o}=ji(),{settings:r,updateSetting:d}=Ce(),{version:u}=We(),h=me(u,pr),f=me(u,mr),p=me(u,hr),c=me(u,gr),x=me(u,fr),b=me(u,br),v=me(u,xr),T=me(u,vr),I=(r==null?void 0:r.idleReapHours)??Gc,C=(r==null?void 0:r.subagentMaxDepth)===void 0?zc:r.subagentMaxDepth,O=l.useCallback(async m=>{try{await navigator.clipboard.writeText(m),a(e("providersClaudeLoginCommandCopied"),"success")}catch{a(e("providersClaudeLoginCommandCopyError"),"error")}},[a,e]),k=l.useCallback(()=>{n(!1),Km()},[]),S=zr().flatMap(m=>{const _=i.find(A=>A.name===m.id);return m.id==="claude-ollama"&&!_?[]:m.id==="claude-gateway"&&!_&&!p?[]:[{...m,installed:(_==null?void 0:_.installed)??!1,authenticated:(_==null?void 0:_.authenticated)??!1,loginCommand:_==null?void 0:_.loginCommand,additionalModelOptions:_==null?void 0:_.additionalModelOptions,supportsLaunchCompactPercentOverride:(_==null?void 0:_.supportsLaunchCompactPercentOverride)===!0}]});return t.jsxs(oe,{description:e("providersSectionDescription"),children:[zm,t.jsxs("div",{className:"settings-group",children:[T&&t.jsx(w,{id:"providers-subagent-max-depth",label:e("providersSubagentMaxDepthLabel"),description:e("providersSubagentMaxDepthDescription"),className:"settings-item--wide-control",valueText:C===null?e("providersSubagentMaxDepthProviderDefault"):C===0?e("providersSubagentMaxDepthDisabled"):e("providersSubagentMaxDepthValue",{value:C}),children:t.jsxs("div",{children:[t.jsx(ot,{id:"providers-subagent-max-depth-control",min:Ps,max:js,numberMin:ya,numberMax:js,step:1,list:"providers-subagent-max-depth-ticks",value:C,unsetSliderValue:Ps,unit:e("providersSubagentMaxDepthUnit"),ariaLabel:e("providersSubagentMaxDepthAria"),onCommit:m=>{d("subagentMaxDepth",m)}}),t.jsxs("datalist",{id:"providers-subagent-max-depth-ticks",children:[t.jsx("option",{value:Ps,label:e("providersSubagentMaxDepthProviderDefault")}),t.jsx("option",{value:ya}),t.jsx("option",{value:"1"}),t.jsx("option",{value:"2"}),t.jsx("option",{value:"3"}),t.jsx("option",{value:js})]}),t.jsx("p",{className:"settings-hint",children:e("providersSubagentMaxDepthCoverage")})]})}),v&&t.jsx(w,{id:"providers-idle-reap-hours",label:e("providersIdleReapHoursLabel"),description:e("providersIdleReapHoursDescription"),className:"settings-item--wide-control",valueText:I<0?e("providersIdleReapNever"):e("providersIdleReapHoursValue",{value:I}),children:t.jsxs("div",{children:[t.jsx(ot,{id:"providers-idle-reap-hours-control",min:Zt,max:Ts,numberMin:Zt,numberMax:Ts,step:1,list:"providers-idle-reap-hours-ticks",value:I,unit:e("providersIdleReapHoursUnit"),ariaLabel:e("providersIdleReapHoursAria"),snapTextToStep:!1,onCommit:m=>{d("idleReapHours",Kc(m))}}),t.jsxs("datalist",{id:"providers-idle-reap-hours-ticks",children:[t.jsx("option",{value:Zt,label:e("providersIdleReapNever")}),t.jsx("option",{value:"0"}),t.jsx("option",{value:"24"}),t.jsx("option",{value:"48"}),t.jsx("option",{value:Ts})]}),t.jsx("p",{className:"settings-hint",children:e("providersIdleReapNeverHint")})]})}),S.map(m=>t.jsxs(l.Fragment,{children:[t.jsx(w,{id:`provider-${m.id}`,label:m.displayName,description:m.metadata.description,keywords:m.id==="claude-gateway"?["gateway URL","start command","autostart","disable agent","disable plan mode"]:void 0,after:m.id==="claude-ollama"&&s?t.jsxs("div",{className:"provider-deprecation-notice",role:"status",children:[t.jsx("span",{children:e("providersClaudeOllamaDeprecationNotice")}),t.jsx("button",{type:"button",className:"provider-deprecation-notice__dismiss","aria-label":e("providersClaudeOllamaDeprecationDismissAria"),onClick:k,children:"×"})]}):void 0,info:t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"settings-item-header",children:[t.jsx("strong",{children:m.displayName}),m.installed?t.jsx("span",{className:"settings-status-badge settings-status-detected",children:e("providersDetected")}):t.jsx("span",{className:"settings-status-badge settings-status-not-detected",children:e("providersNotDetected")})]}),t.jsx("p",{children:m.metadata.description}),m.metadata.limitations.length>0&&t.jsx("ul",{className:"settings-limitations",children:m.metadata.limitations.map(_=>t.jsx("li",{children:_},_))}),m.id==="claude"&&m.installed&&!m.authenticated&&t.jsxs("div",{style:{marginTop:"var(--space-2)"},children:[t.jsx("p",{className:"settings-hint",children:e("providersClaudeLoginHint")}),t.jsx(sh,{command:m.loginCommand??Vm,onCopy:_=>void O(_)})]}),m.id==="claude-ollama"&&t.jsx(eh,{}),m.id==="grok"&&t.jsx(qm,{}),m.id==="claude-gateway"&&p&&t.jsxs(t.Fragment,{children:[t.jsx(th,{reloadProviders:o,supportsAutostart:c}),x&&t.jsx(ei,{id:"provider-claude-gateway-disable-agent",setting:"claudeGatewayDisableAgent",title:e("providersClaudeGatewayDisableAgentTitle"),description:e("providersClaudeGatewayDisableAgentDescription")}),b&&t.jsx(ei,{id:"provider-claude-gateway-disable-plan-mode",setting:"claudeGatewayDisablePlanMode",title:e("providersClaudeGatewayDisablePlanModeTitle"),description:e("providersClaudeGatewayDisablePlanModeDescription")})]}),m.id==="codex"&&m.installed&&t.jsx(Jm,{})]}),children:m.metadata.website&&t.jsx("a",{href:m.metadata.website,target:"_blank",rel:"noopener noreferrer",className:"settings-link",children:e("providersWebsite")})}),m.id==="codex"&&f&&t.jsx(Zm,{value:(r==null?void 0:r.codexReasoningSummary)??Jl,updateSetting:d}),m.id==="claude"&&m.supportsLaunchCompactPercentOverride&&t.jsx(Ji,{id:"provider-claude-auto-compact",value:r==null?void 0:r.claudeAutoCompactPercentOverride,updateSetting:d}),m.id==="claude"&&t.jsx(nh,{serverProviders:i,settings:r,updateSetting:d}),m.id==="claude"&&h&&t.jsx(ah,{modelOptions:m.additionalModelOptions??[],selections:(r==null?void 0:r.claudeAdditionalModels)??[],updateSetting:d,reloadProviders:o})]},m.id))]})]})}function oh(){const[e,s]=l.useState(null),[n,a]=l.useState(null),[i,o]=l.useState(null),[r,d]=l.useState([]),[u,h]=l.useState(!0),[f,p]=l.useState(null),c=l.useCallback(async()=>{try{const[y,S,m,_]=await Promise.all([ze("/remote-access/config"),ze("/remote-access/relay"),ze("/remote-access/relay/status"),ze("/remote-access/sessions")]);s(y),a(S.relay),o(m),d(_.sessions),p(null)}catch(y){console.error("[useRemoteAccess] Failed to fetch config:",y),p(y instanceof Error?y.message:"Failed to fetch config")}},[]);l.useEffect(()=>{h(!0),c().finally(()=>h(!1))},[c]);const x=l.useCallback(async y=>{try{await ze("/remote-access/configure",{method:"POST",body:JSON.stringify({password:y})}),await c()}catch(S){const m=S instanceof Error?S.message:"Failed to configure remote access";throw p(m),new Error(m)}},[c]),b=l.useCallback(async()=>{try{await ze("/remote-access/enable",{method:"POST"}),await c()}catch(y){const S=y instanceof Error?y.message:"Failed to enable remote access";throw p(S),new Error(S)}},[c]),v=l.useCallback(async()=>{try{await ze("/remote-access/disable",{method:"POST"}),await c()}catch(y){const S=y instanceof Error?y.message:"Failed to disable remote access";throw p(S),new Error(S)}},[c]),T=l.useCallback(async()=>{try{await ze("/remote-access/clear",{method:"POST"}),await c()}catch(y){const S=y instanceof Error?y.message:"Failed to clear remote access credentials";throw p(S),new Error(S)}},[c]),I=l.useCallback(async y=>{try{await ze("/remote-access/relay",{method:"PUT",body:JSON.stringify(y)}),await c()}catch(S){const m=S instanceof Error?S.message:"Failed to update relay configuration";throw p(m),new Error(m)}},[c]),C=l.useCallback(async()=>{try{await ze("/remote-access/relay",{method:"DELETE"}),await c()}catch(y){const S=y instanceof Error?y.message:"Failed to clear relay configuration";throw p(S),new Error(S)}},[c]),O=l.useCallback(async y=>{try{await ze(`/remote-access/sessions/${y}`,{method:"DELETE"}),await c()}catch(S){const m=S instanceof Error?S.message:"Failed to revoke session";throw p(m),new Error(m)}},[c]),k=l.useCallback(async()=>{try{await ze("/remote-access/sessions",{method:"DELETE"}),await c()}catch(y){const S=y instanceof Error?y.message:"Failed to revoke all sessions";throw p(S),new Error(S)}},[c]);return{config:e,relayConfig:n,relayStatus:i,sessions:r,loading:u,error:f,configure:x,enable:b,disable:v,clearCredentials:T,updateRelayConfig:I,clearRelayConfig:C,revokeSession:O,revokeAllSessions:k,refresh:c}}var dt=(e=>(e[e.Border=-1]="Border",e[e.Data=0]="Data",e[e.Function=1]="Function",e[e.Position=2]="Position",e[e.Timing=3]="Timing",e[e.Alignment=4]="Alignment",e))(dt||{}),rh=Object.defineProperty,lh=(e,s,n)=>s in e?rh(e,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[s]=n,Yt=(e,s,n)=>(lh(e,typeof s!="symbol"?s+"":s,n),n);const ch=[0,1],no=[1,0],ao=[2,3],io=[3,2],dh={L:ch,M:no,Q:ao,H:io},uh=/^[0-9]*$/,ph=/^[A-Z0-9 $%*+.\/:-]*$/,Is="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",on=1,rn=40,ti=3,mh=3,Qt=40,hh=10,oo=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],ro=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];class gh{constructor(s,n,a,i){if(this.version=s,this.ecc=n,Yt(this,"size"),Yt(this,"mask"),Yt(this,"modules",[]),Yt(this,"types",[]),s<on||s>rn)throw new RangeError("Version value out of range");if(i<-1||i>7)throw new RangeError("Mask value out of range");this.size=s*4+17;const o=Array.from({length:this.size},()=>!1);for(let d=0;d<this.size;d++)this.modules.push(o.slice()),this.types.push(o.map(()=>0));this.drawFunctionPatterns();const r=this.addEccAndInterleave(a);if(this.drawCodewords(r),i===-1){let d=1e9;for(let u=0;u<8;u++){this.applyMask(u),this.drawFormatBits(u);const h=this.getPenaltyScore();h<d&&(i=u,d=h),this.applyMask(u)}}this.mask=i,this.applyMask(i),this.drawFormatBits(i)}getModule(s,n){return s>=0&&s<this.size&&n>=0&&n<this.size&&this.modules[n][s]}drawFunctionPatterns(){for(let a=0;a<this.size;a++)this.setFunctionModule(6,a,a%2===0,dt.Timing),this.setFunctionModule(a,6,a%2===0,dt.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const s=this.getAlignmentPatternPositions(),n=s.length;for(let a=0;a<n;a++)for(let i=0;i<n;i++)a===0&&i===0||a===0&&i===n-1||a===n-1&&i===0||this.drawAlignmentPattern(s[a],s[i]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(s){const n=this.ecc[1]<<3|s;let a=n;for(let o=0;o<10;o++)a=a<<1^(a>>>9)*1335;const i=(n<<10|a)^21522;for(let o=0;o<=5;o++)this.setFunctionModule(8,o,et(i,o));this.setFunctionModule(8,7,et(i,6)),this.setFunctionModule(8,8,et(i,7)),this.setFunctionModule(7,8,et(i,8));for(let o=9;o<15;o++)this.setFunctionModule(14-o,8,et(i,o));for(let o=0;o<8;o++)this.setFunctionModule(this.size-1-o,8,et(i,o));for(let o=8;o<15;o++)this.setFunctionModule(8,this.size-15+o,et(i,o));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let s=this.version;for(let a=0;a<12;a++)s=s<<1^(s>>>11)*7973;const n=this.version<<12|s;for(let a=0;a<18;a++){const i=et(n,a),o=this.size-11+a%3,r=Math.floor(a/3);this.setFunctionModule(o,r,i),this.setFunctionModule(r,o,i)}}drawFinderPattern(s,n){for(let a=-4;a<=4;a++)for(let i=-4;i<=4;i++){const o=Math.max(Math.abs(i),Math.abs(a)),r=s+i,d=n+a;r>=0&&r<this.size&&d>=0&&d<this.size&&this.setFunctionModule(r,d,o!==2&&o!==4,dt.Position)}}drawAlignmentPattern(s,n){for(let a=-2;a<=2;a++)for(let i=-2;i<=2;i++)this.setFunctionModule(s+i,n+a,Math.max(Math.abs(i),Math.abs(a))!==1,dt.Alignment)}setFunctionModule(s,n,a,i=dt.Function){this.modules[n][s]=a,this.types[n][s]=i}addEccAndInterleave(s){const n=this.version,a=this.ecc;if(s.length!==ts(n,a))throw new RangeError("Invalid argument");const i=ro[a[0]][n],o=oo[a[0]][n],r=Math.floor(zs(n)/8),d=i-r%i,u=Math.floor(r/i),h=[],f=wh(o);for(let c=0,x=0;c<i;c++){const b=s.slice(x,x+u-o+(c<d?0:1));x+=b.length;const v=Ch(b,f);c<d&&b.push(0),h.push(b.concat(v))}const p=[];for(let c=0;c<h[0].length;c++)h.forEach((x,b)=>{(c!==u-o||b>=d)&&p.push(x[c])});return p}drawCodewords(s){if(s.length!==Math.floor(zs(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let a=this.size-1;a>=1;a-=2){a===6&&(a=5);for(let i=0;i<this.size;i++)for(let o=0;o<2;o++){const r=a-o,u=(a+1&2)===0?this.size-1-i:i;!this.types[u][r]&&n<s.length*8&&(this.modules[u][r]=et(s[n>>>3],7-(n&7)),n++)}}}applyMask(s){if(s<0||s>7)throw new RangeError("Mask value out of range");for(let n=0;n<this.size;n++)for(let a=0;a<this.size;a++){let i;switch(s){case 0:i=(a+n)%2===0;break;case 1:i=n%2===0;break;case 2:i=a%3===0;break;case 3:i=(a+n)%3===0;break;case 4:i=(Math.floor(a/3)+Math.floor(n/2))%2===0;break;case 5:i=a*n%2+a*n%3===0;break;case 6:i=(a*n%2+a*n%3)%2===0;break;case 7:i=((a+n)%2+a*n%3)%2===0;break;default:throw new Error("Unreachable")}!this.types[n][a]&&i&&(this.modules[n][a]=!this.modules[n][a])}}getPenaltyScore(){let s=0;for(let o=0;o<this.size;o++){let r=!1,d=0;const u=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[o][h]===r?(d++,d===5?s+=ti:d>5&&s++):(this.finderPenaltyAddHistory(d,u),r||(s+=this.finderPenaltyCountPatterns(u)*Qt),r=this.modules[o][h],d=1);s+=this.finderPenaltyTerminateAndCount(r,d,u)*Qt}for(let o=0;o<this.size;o++){let r=!1,d=0;const u=[0,0,0,0,0,0,0];for(let h=0;h<this.size;h++)this.modules[h][o]===r?(d++,d===5?s+=ti:d>5&&s++):(this.finderPenaltyAddHistory(d,u),r||(s+=this.finderPenaltyCountPatterns(u)*Qt),r=this.modules[h][o],d=1);s+=this.finderPenaltyTerminateAndCount(r,d,u)*Qt}for(let o=0;o<this.size-1;o++)for(let r=0;r<this.size-1;r++){const d=this.modules[o][r];d===this.modules[o][r+1]&&d===this.modules[o+1][r]&&d===this.modules[o+1][r+1]&&(s+=mh)}let n=0;for(const o of this.modules)n=o.reduce((r,d)=>r+(d?1:0),n);const a=this.size*this.size,i=Math.ceil(Math.abs(n*20-a*10)/a)-1;return s+=i*hh,s}getAlignmentPatternPositions(){if(this.version===1)return[];{const s=Math.floor(this.version/7)+2,n=this.version===32?26:Math.ceil((this.version*4+4)/(s*2-2))*2,a=[6];for(let i=this.size-7;a.length<s;i-=n)a.splice(1,0,i);return a}}finderPenaltyCountPatterns(s){const n=s[1],a=n>0&&s[2]===n&&s[3]===n*3&&s[4]===n&&s[5]===n;return(a&&s[0]>=n*4&&s[6]>=n?1:0)+(a&&s[6]>=n*4&&s[0]>=n?1:0)}finderPenaltyTerminateAndCount(s,n,a){return s&&(this.finderPenaltyAddHistory(n,a),n=0),n+=this.size,this.finderPenaltyAddHistory(n,a),this.finderPenaltyCountPatterns(a)}finderPenaltyAddHistory(s,n){n[0]===0&&(s+=this.size),n.pop(),n.unshift(s)}}function tt(e,s,n){if(s<0||s>31||e>>>s)throw new RangeError("Value out of range");for(let a=s-1;a>=0;a--)n.push(e>>>a&1)}function et(e,s){return(e>>>s&1)!==0}class ln{constructor(s,n,a){if(this.mode=s,this.numChars=n,this.bitData=a,n<0)throw new RangeError("Invalid argument");this.bitData=a.slice()}getData(){return this.bitData.slice()}}const fh=[1,10,12,14],bh=[2,9,11,13],xh=[4,8,16,16];function lo(e,s){return e[Math.floor((s+7)/17)+1]}function co(e){const s=[];for(const n of e)tt(n,8,s);return new ln(xh,e.length,s)}function vh(e){if(!uo(e))throw new RangeError("String contains non-numeric characters");const s=[];for(let n=0;n<e.length;){const a=Math.min(e.length-n,3);tt(Number.parseInt(e.substring(n,n+a),10),a*3+1,s),n+=a}return new ln(fh,e.length,s)}function Sh(e){if(!po(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");const s=[];let n;for(n=0;n+2<=e.length;n+=2){let a=Is.indexOf(e.charAt(n))*45;a+=Is.indexOf(e.charAt(n+1)),tt(a,11,s)}return n<e.length&&tt(Is.indexOf(e.charAt(n)),6,s),new ln(bh,e.length,s)}function yh(e){return e===""?[]:uo(e)?[vh(e)]:po(e)?[Sh(e)]:[co(Th(e))]}function uo(e){return uh.test(e)}function po(e){return ph.test(e)}function jh(e,s){let n=0;for(const a of e){const i=lo(a.mode,s);if(a.numChars>=1<<i)return Number.POSITIVE_INFINITY;n+=4+i+a.bitData.length}return n}function Th(e){e=encodeURI(e);const s=[];for(let n=0;n<e.length;n++)e.charAt(n)!=="%"?s.push(e.charCodeAt(n)):(s.push(Number.parseInt(e.substring(n+1,n+3),16)),n+=2);return s}function zs(e){if(e<on||e>rn)throw new RangeError("Version number out of range");let s=(16*e+128)*e+64;if(e>=2){const n=Math.floor(e/7)+2;s-=(25*n-10)*n-55,e>=7&&(s-=36)}return s}function ts(e,s){return Math.floor(zs(e)/8)-oo[s[0]][e]*ro[s[0]][e]}function wh(e){if(e<1||e>255)throw new RangeError("Degree out of range");const s=[];for(let a=0;a<e-1;a++)s.push(0);s.push(1);let n=1;for(let a=0;a<e;a++){for(let i=0;i<s.length;i++)s[i]=Gs(s[i],n),i+1<s.length&&(s[i]^=s[i+1]);n=Gs(n,2)}return s}function Ch(e,s){const n=s.map(a=>0);for(const a of e){const i=a^n.shift();n.push(0),s.forEach((o,r)=>n[r]^=Gs(o,i))}return n}function Gs(e,s){if(e>>>8||s>>>8)throw new RangeError("Byte out of range");let n=0;for(let a=7;a>=0;a--)n=n<<1^(n>>>7)*285,n^=(s>>>a&1)*e;return n}function Nh(e,s,n=1,a=40,i=-1,o=!0){if(!(on<=n&&n<=a&&a<=rn)||i<-1||i>7)throw new RangeError("Invalid value");let r,d;for(r=n;;r++){const p=ts(r,s)*8,c=jh(e,r);if(c<=p){d=c;break}if(r>=a)throw new RangeError("Data too long")}for(const p of[no,ao,io])o&&d<=ts(r,p)*8&&(s=p);const u=[];for(const p of e){tt(p.mode[0],4,u),tt(p.numChars,lo(p.mode,r),u);for(const c of p.getData())u.push(c)}const h=ts(r,s)*8;tt(0,Math.min(4,h-u.length),u),tt(0,(8-u.length%8)%8,u);for(let p=236;u.length<h;p^=253)tt(p,8,u);const f=Array.from({length:Math.ceil(u.length/8)},()=>0);return u.forEach((p,c)=>f[c>>>3]|=p<<7-(c&7)),new gh(r,s,f,i)}function Eh(e,s){const{ecc:n="L",boostEcc:a=!1,minVersion:i=1,maxVersion:o=40,maskPattern:r=-1,border:d=1}={},u=typeof e=="string"?yh(e):Array.isArray(e)?[co(e)]:void 0;if(!u)throw new Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);const h=Nh(u,dh[n],i,o,r,a);return kh({version:h.version,maskPattern:h.mask,size:h.size,data:h.modules,types:h.types},d)}function kh(e,s=1){if(!s)return e;const{size:n}=e,a=n+s*2;e.size=a,e.data.forEach(o=>{for(let r=0;r<s;r++)o.unshift(!1),o.push(!1)});for(let o=0;o<s;o++)e.data.unshift(Array.from({length:a},r=>!1)),e.data.push(Array.from({length:a},r=>!1));const i=dt.Border;e.types.forEach(o=>{for(let r=0;r<s;r++)o.unshift(i),o.push(i)});for(let o=0;o<s;o++)e.types.unshift(Array.from({length:a},r=>i)),e.types.push(Array.from({length:a},r=>i));return e}function _h({value:e,size:s=200,color:n="#000000",bgColor:a="#ffffff"}){const{data:i}=Eh(e),o=i.length,r=s/o;let d="";for(let u=0;u<o;u++){const h=i[u];if(h){for(let f=0;f<o;f++)if(h[f]){const p=f*r,c=u*r;d+=`M${p},${c}h${r}v${r}h-${r}z`}}}return t.jsxs("svg",{width:s,height:s,viewBox:`0 0 ${s} ${s}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"QR code",children:[t.jsx("rect",{width:s,height:s,fill:a}),t.jsx("path",{d,fill:n})]})}function Mh(e){return new Date(e).toLocaleDateString()}function si(e,s){const n=new Date(e),i=new Date().getTime()-n.getTime(),o=Math.floor(i/(1e3*60)),r=Math.floor(i/(1e3*60*60)),d=Math.floor(i/(1e3*60*60*24));return o<1?s("remoteSetupJustNow"):o<60?s("remoteSetupMinutesAgo",{count:o,suffix:o===1?"":"s"}):r<24?s("remoteSetupHoursAgo",{count:r,suffix:r===1?"":"s"}):d===1?s("remoteSetupYesterday"):d<7?s("hostPickerLastConnectedDays",{count:d}):Mh(e)}function Ah(e,s,n,a){if(!s)return{text:a("remoteSetupStatusDisabled"),className:"status-disabled"};if(!n)return{text:a("remoteSetupStatusNotConfigured"),className:"status-warning"};switch(e){case"waiting":return{text:a("remoteSetupStatusConnected"),className:"status-success"};case"connecting":return{text:a("remoteSetupStatusConnecting"),className:"status-pending"};case"registering":return{text:a("remoteSetupStatusRegistering"),className:"status-pending"};case"rejected":return{text:a("remoteSetupStatusUsernameTaken"),className:"status-error"};default:return{text:a("remoteSetupStatusDisconnected"),className:"status-warning"}}}function ni(e){try{return Js(e)}catch{return e.trim()}}function Dh(e){try{return as(e)}catch{return e.trim()}}function Ph({title:e="Remote Access",description:s="Access your server from anywhere.",onSetupComplete:n,yaClientInfo:a}){const{t:i}=K(),{config:o,relayConfig:r,relayStatus:d,sessions:u,loading:h,error:f,configure:p,enable:c,disable:x,updateRelayConfig:b,revokeSession:v,revokeAllSessions:T,refresh:I}=oh(),{settings:C,isLoading:O,updateSetting:k}=Ce(),[y,S]=l.useState(""),[m,_]=l.useState(""),[A,P]=l.useState(""),[M,R]=l.useState("default"),[N,$]=l.useState(""),[D,L]=l.useState("default"),[F,E]=l.useState(""),[V,te]=l.useState(!1),[ne,ae]=l.useState(null),[Z,ee]=l.useState(!1),[xe,z]=l.useState(!1),[re,Ne]=l.useState(null),[pe,ge]=l.useState(!1);l.useEffect(()=>{r&&(S(r.username),r.url===mt?(R("default"),$("")):(R("custom"),$(r.url)))},[r]),l.useEffect(()=>{if(!C)return;const W=C.yaClientBaseUrl??"";W?(L("custom"),E(W)):(L("default"),E(""))},[C]),l.useEffect(()=>{const W=y!==((r==null?void 0:r.username)??""),ve=m.length>0,Me=ni(M==="default"?mt:N),je=(r==null?void 0:r.url)??mt,Ee=Me!==je,Ge=Dh(D==="default"?ct:F),Ke=(C==null?void 0:C.yaClientBaseUrl)??ct;z(W||ve||Ee||Ge!==Ke)},[y,m,M,N,r,D,F,C==null?void 0:C.yaClientBaseUrl]),l.useEffect(()=>{if((d==null?void 0:d.status)==="connecting"||(d==null?void 0:d.status)==="registering"){const W=setInterval(I,2e3);return()=>clearInterval(W)}},[d==null?void 0:d.status,I]);const Te=(o==null?void 0:o.enabled)??!1,G=!!(o!=null&&o.username),ie=()=>M==="default"?mt:N,ce=()=>ni(ie()),Ae=()=>D==="default"?ct:F,Pe=()=>{try{return as(Ae())}catch{return ct}},Re=async()=>{if(ae(null),!y.trim())return ae(i("remoteSetupErrorUsernameRequired")),!1;if(y.length<3)return ae(i("remoteSetupErrorUsernameShort")),!1;if(!G&&!m)return ae(i("remoteSetupErrorPasswordRequired")),!1;if(m&&m.length<8)return ae(i("remoteSetupErrorPasswordShort")),!1;if(m&&m!==A)return ae(i("remoteSetupErrorPasswordMismatch")),!1;if(M==="custom"&&!N.trim())return ae(i("remoteSetupErrorCustomRelayRequired")),!1;if(D==="custom"&&!F.trim())return ae(i("remoteSetupErrorCustomYaRequired")),!1;try{let W;try{W=Js(ie())}catch(Ee){return ae(Ee instanceof Error?Ee.message:i("remoteSetupErrorSaveFailed")),!1}(y!==(r==null?void 0:r.username)||W!==(r==null?void 0:r.url))&&await b({url:W,username:y});let Me;try{Me=as(Ae())}catch(Ee){return ae(Ee instanceof Error?Ee.message:i("remoteSetupErrorSaveFailed")),!1}const je=(C==null?void 0:C.yaClientBaseUrl)??ct;return Me!==je&&await k("yaClientBaseUrl",D==="default"?null:Me),m&&(await p(m),Ne(m)),_(""),P(""),z(!1),!0}catch(W){return ae(W instanceof Error?W.message:i("remoteSetupErrorSaveFailed")),!1}},De=async W=>{ae(null),te(!0);try{if(W)if(xe){if(!await Re()){te(!1);return}n==null||n()}else G&&(await c(),n==null||n());else await x()}catch(ve){ae(ve instanceof Error?ve.message:i("remoteSetupErrorUpdateFailed"))}finally{te(!1)}},B=async W=>{W.preventDefault(),te(!0),await Re()&&(n==null||n()),te(!1)},X=async W=>{await navigator.clipboard.writeText(W),ee(!0),setTimeout(()=>ee(!1),3e3)};if(h||O)return t.jsxs("div",{className:"remote-access-setup",children:[t.jsx("div",{className:"remote-access-header",children:t.jsxs("div",{children:[t.jsx("h3",{children:e}),t.jsx("p",{children:s})]})}),t.jsx("div",{className:"remote-access-loading",children:i("remoteSetupLoading")})]});const H=Ah((d==null?void 0:d.status)??null,Te,G,i),q=(()=>{const W=Sa(Pe()),ve=new URLSearchParams;y&&ve.set("u",y);const Me=ce();Me!==mt&&ve.set("r",Me);const je=ve.toString();return je?`${W}?${je}`:W})(),fe=(()=>{if(!re||!y)return null;const W=new URLSearchParams;W.set("u",y),W.set("p",re);const ve=ce();return ve!==mt&&W.set("r",ve),`${Sa(Pe())}#${W.toString()}`})(),Ie=Te&&(d==null?void 0:d.status)==="waiting"&&fe!==null,Ue=G||y&&m;return t.jsxs("div",{className:"remote-access-setup",children:[t.jsxs("div",{className:"remote-access-header",children:[t.jsxs("div",{children:[t.jsx("h3",{children:e}),t.jsx("p",{children:s})]}),t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:Te,onChange:W=>De(W.target.checked),disabled:V||!Te&&!Ue}),t.jsx("span",{className:"toggle-slider"})]})]}),t.jsxs("form",{onSubmit:B,className:"remote-access-form",children:[t.jsxs("div",{className:"form-field",children:[t.jsx("label",{htmlFor:"remote-username",children:i("remoteSetupUsername")}),t.jsx("input",{id:"remote-username",type:"text",value:y,onChange:W=>S(W.target.value.toLowerCase()),placeholder:i("remoteSetupUsernamePlaceholder"),minLength:3,maxLength:32,pattern:"[a-z0-9][a-z0-9-]*[a-z0-9]|[a-z0-9]{1,2}",title:i("remoteSetupUsernameHint"),autoComplete:"username",disabled:V})]}),t.jsxs("div",{className:"form-field",children:[t.jsx("label",{htmlFor:"remote-password",children:i(G?"remoteSetupNewPassword":"remoteSetupPassword")}),t.jsx("input",{id:"remote-password",type:"password",value:m,onChange:W=>_(W.target.value),placeholder:G?"••••••••":"",minLength:8,autoComplete:"new-password",disabled:V})]}),m&&t.jsxs("div",{className:"form-field",children:[t.jsx("label",{htmlFor:"remote-confirm",children:i("remoteSetupConfirmPassword")}),t.jsx("input",{id:"remote-confirm",type:"password",value:A,onChange:W=>P(W.target.value),minLength:8,autoComplete:"new-password",disabled:V})]}),t.jsxs("div",{className:"form-field",children:[t.jsx("label",{htmlFor:"relay-select",children:i("remoteSetupRelayServer")}),t.jsxs("select",{id:"relay-select",value:M,onChange:W=>R(W.target.value),disabled:V,className:"form-select",children:[t.jsx("option",{value:"default",children:i("remoteSetupRelayDefault")}),t.jsx("option",{value:"custom",children:i("remoteSetupRelayCustom")})]})]}),M==="custom"&&t.jsxs("div",{className:"form-field",children:[t.jsx("label",{htmlFor:"custom-relay-url",children:i("remoteSetupCustomRelayUrl")}),t.jsx("input",{id:"custom-relay-url",type:"text",value:N,onChange:W=>$(W.target.value),placeholder:i("remoteSetupCustomRelayPlaceholder"),disabled:V})]}),t.jsxs("div",{className:"form-field",children:[t.jsx("label",{htmlFor:"ya-client-select",children:i("remoteSetupYaClient")}),t.jsxs("select",{id:"ya-client-select",value:D,onChange:W=>L(W.target.value),disabled:V,className:"form-select",children:[t.jsx("option",{value:"default",children:i("remoteSetupYaClientDefault")}),t.jsx("option",{value:"custom",children:i("remoteSetupYaClientCustom")})]})]}),D==="custom"&&t.jsxs("div",{className:"form-field",children:[t.jsx("label",{htmlFor:"custom-ya-client-url",children:i("remoteSetupCustomYaClientUrl")}),t.jsx("input",{id:"custom-ya-client-url",type:"text",value:F,onChange:W=>E(W.target.value),placeholder:i("remoteSetupCustomYaClientPlaceholder"),disabled:V})]}),a,t.jsxs("div",{className:"remote-access-status",children:[t.jsx("span",{className:"status-label",children:i("remoteSetupStatus")}),t.jsx("span",{className:`status-indicator ${H.className}`,children:H.text}),(d==null?void 0:d.error)&&t.jsx("span",{className:"status-error-detail",children:d.error})]}),(ne||f)&&t.jsx("p",{className:"form-error",children:ne||f}),Te&&y&&t.jsxs("div",{className:"remote-access-connect",children:[t.jsx("span",{className:"connect-label",children:i("remoteSetupConnectFrom")}),t.jsxs("div",{className:"connect-url-row",children:[t.jsx("code",{className:"connect-url",children:q}),t.jsx("button",{type:"button",className:"copy-button",onClick:()=>X(q),title:i("remoteSetupCopyUrl"),children:i(Z?"remoteSetupCopied":"remoteSetupCopy")})]})]}),Ie&&t.jsxs("div",{className:"remote-access-qr",children:[t.jsx("button",{type:"button",className:"qr-toggle-button",onClick:()=>ge(!pe),children:i(pe?"remoteSetupHideQr":"remoteSetupShowQr")}),pe&&fe&&t.jsxs("div",{className:"qr-code-container",children:[t.jsx(_h,{value:fe,size:200}),t.jsx("p",{className:"qr-code-hint",children:i("remoteSetupQrHint")})]})]}),t.jsxs("div",{className:"remote-access-sessions",children:[t.jsxs("div",{className:"sessions-header",children:[t.jsx("span",{className:"sessions-title",children:i("remoteSetupSessions",{count:u.length})}),u.length>0&&t.jsx("button",{type:"button",className:"revoke-all-button",onClick:()=>T(),disabled:V,title:i("remoteSetupRevokeEffect"),children:i("remoteSetupRevokeAll")})]}),t.jsx("p",{className:"settings-hint",children:i("remoteSetupSessionsDescription")}),u.length===0?t.jsx("p",{className:"sessions-empty",children:i("remoteSetupNoSessions")}):t.jsx("ul",{className:"sessions-list",children:u.map(W=>{const{browser:ve,os:Me}=W.userAgent?vi(W.userAgent):{browser:i("remoteSetupUnknownBrowser"),os:i("remoteSetupUnknownOs")},je=W.userAgent||W.origin;return t.jsxs("li",{className:"session-item",children:[t.jsx("div",{className:"session-info",children:je?t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"session-device",children:[ve," · ",Me]}),W.origin&&t.jsx("code",{className:"session-origin",children:W.origin}),t.jsxs("span",{className:"session-dates",children:[i("remoteSetupCreated",{date:si(W.createdAt,i)})," ","·"," ",i("remoteSetupLastUsed",{date:si(W.lastUsed,i)})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"session-created",children:[i("remoteSetupCreatedLabel")," ",new Date(W.createdAt).toLocaleDateString()]}),t.jsxs("span",{className:"session-last-used",children:[i("remoteSetupLastUsedLabel")," ",new Date(W.lastUsed).toLocaleDateString()]})]})}),t.jsx("button",{type:"button",className:"revoke-button",onClick:()=>v(W.sessionId),disabled:V,title:i("remoteSetupRevokeEffect"),children:i("remoteSetupRevoke")})]},W.sessionId)})})]}),xe&&t.jsx("div",{className:"remote-access-actions",children:t.jsx("button",{type:"submit",className:"settings-button",disabled:V,children:i(V?"remoteSetupSaving":"remoteSetupUpdate")})})]})]})}const mo={status:null},Ih=Lr({endpoint:"host-awake-status"}),Ks=new Map,Ys=new Set;function Lh(){for(const e of Array.from(Ys))e()}function Rh(e){return Ys.add(e),()=>Ys.delete(e)}function Oh(e){return Ks.get(e)??mo}function Uh(e,s,n){const a=Ks.get(e);(a==null?void 0:a.observedAt)!==void 0&&a.observedAt>n||(Ks.set(e,{status:s,observedAt:n}),Lh())}function Fh(e){const s=Gr();At();const n=!0,a=l.useSyncExternalStore(Rh,()=>Oh(s),()=>mo),i=Ir({sourceKey:s,key:Ih,bootstrapTier:"supplementary",enabled:e,ready:n,hasData:a.observedAt!==void 0,staleTimeMs:0,revalidateOn:["reconnect"],fetcher:o=>{var d;const r=((d=o.meta)==null?void 0:d.forceServerRefresh)===!0;return Kr().getOrCreateSourceRuntime(o.sourceKey).transport.fetch(`/settings/host-awake/status${r?"?refresh=1":""}`)},applySnapshot:(o,r)=>{Uh(r.sourceKey,o.status,r.requestStartedAt)}});return{status:a.status,isLoading:i.loading,error:i.error,refetch:(o=!1)=>i.refetch({force:!0,meta:o?{forceServerRefresh:!0}:void 0})}}const Bh=Vc(ct),Hh=["💻","🖥️","🗄️","🏠","☁️","❤️","⭐","🔵"];function Wh({currentIcon:e,disabled:s,onChange:n}){const{t:a}=K(),[i,o]=l.useState(e),[r,d]=l.useState(!1),u=Oc(i),h=i.trim().length>0&&u===null;l.useEffect(()=>o(e),[e]);const f=async p=>{d(!0);try{await n(p)}catch{o(e)}finally{d(!1)}};return t.jsx(w,{label:a("hostIdentityTitle"),description:a("hostIdentityDescription"),className:"settings-item--wide-control host-identity-settings",children:t.jsxs("div",{className:"host-identity-controls",children:[t.jsx("div",{className:"host-identity-presets",role:"group","aria-label":a("hostIdentityPresetsAria"),children:Hh.map(p=>t.jsx("button",{type:"button",className:`host-identity-preset${e===p?" active":""}`,"aria-label":a("hostIdentityUsePreset",{icon:p}),"aria-pressed":e===p,disabled:s||r,onClick:()=>{o(p),f({icon:p})},children:p},p))}),t.jsxs("form",{className:"host-identity-custom",onSubmit:p=>{p.preventDefault(),u&&u!==e&&f({icon:u})},children:[t.jsx("input",{className:"settings-input host-identity-input",value:i,maxLength:Ei,"aria-label":a("hostIdentityCustomLabel"),placeholder:a("hostIdentityCustomPlaceholder"),disabled:s||r,onChange:p=>o(p.target.value),onBlur:p=>{const c=p.relatedTarget;c instanceof HTMLElement&&c.dataset.hostIdentityClear!==void 0||u&&u!==e&&f({icon:u})}}),e&&t.jsx("button",{type:"button",className:"settings-button settings-button-secondary","data-host-identity-clear":!0,disabled:s||r,onClick:()=>{o(""),f(void 0)},children:a("hostIdentityClear")})]}),h&&t.jsx("p",{className:"settings-warning host-identity-validation",children:a("hostIdentityInvalid")})]})})}function $h({status:e,statusError:s,statusLoading:n,settingsLoading:a,mode:i,batteryFloorPercent:o,onUpdate:r,onRefresh:d}){const{t:u}=K(),[h,f]=l.useState(String(o)),[p,c]=l.useState(!1),x=i!=="off",b=(e==null?void 0:e.state)==="unsupported"||(e==null?void 0:e.support.idleSleepPrevention)===!1,v=Number(h),T=qc(v);l.useEffect(()=>{f(String(o))},[o]);const I=async O=>{c(!0);try{await r(O),await d()}catch{f(String(o))}finally{c(!1)}},C=(()=>{if(s)return u("hostAwakeStatusFetchError");if(!e)return u("hostAwakeStatusLoading");switch(e.state){case"active":return u("hostAwakeStatusActive");case"paused-low-battery":return u("hostAwakeStatusPaused",{percent:e.batteryFloorPercent});case"unsupported":return e.reason?u("hostAwakeStatusUnavailableReason",{reason:e.reason}):u("hostAwakeStatusUnavailable");case"error":return u("hostAwakeStatusError",{reason:e.reason??u("hostAwakeStatusUnknownError")});default:return u("hostAwakeStatusDisabled")}})();return t.jsxs("div",{className:"settings-group",children:[t.jsx(w,{label:u("hostAwakeTitle"),description:u("hostAwakeDescription"),info:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:u("hostAwakeTitle")}),t.jsx("p",{children:u("hostAwakeDescription")}),t.jsx("p",{className:(e==null?void 0:e.state)==="error"||b?"settings-warning":"settings-hint",children:C}),(e==null?void 0:e.batteryPercent)!==void 0&&t.jsx("p",{className:"settings-hint",children:u("hostAwakeBatteryObserved",{percent:e.batteryPercent,time:e.powerObservedAt?new Date(e.powerObservedAt).toLocaleString():u("hostAwakeBatteryObservedUnknownTime")})}),!x&&t.jsx("button",{type:"button",className:"settings-button settings-button-secondary",disabled:n||p,onClick:()=>void d(),children:u("hostAwakeRefresh")})]}),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:x,disabled:a||n||p||!e||b&&!x,onChange:O=>void I({hostAwakeMode:O.target.checked?"idle":"off"})}),t.jsx("span",{className:"toggle-slider"})]})}),x&&(e==null?void 0:e.hasInternalBattery)===!0&&e.support.batteryFloor&&t.jsxs(w,{label:u("hostAwakeBatteryFloorTitle"),description:u("hostAwakeBatteryFloorDescription"),className:"settings-item--wide-control",children:[t.jsxs("form",{className:"host-awake-floor-controls",onSubmit:O=>{O.preventDefault(),T&&I({hostAwakeBatteryFloorPercent:v})},children:[t.jsx("input",{type:"number",className:"settings-input settings-input-small",min:1,max:100,step:1,value:h,"aria-label":u("hostAwakeBatteryFloorInput"),disabled:p,onChange:O=>f(O.target.value)}),t.jsx("span",{"aria-hidden":"true",children:"%"}),t.jsx("button",{type:"submit",className:"settings-button",disabled:p||!T||v===o,children:u("hostAwakeBatteryFloorSave")})]}),!T&&t.jsx("p",{className:"settings-warning",children:u("hostAwakeBatteryFloorInvalid")})]})]})}function Vh(){var L;const{t:e}=K();_e(e("settingsRemoteTitle"));const s=At(),{supported:n}=Ac(),{version:a}=We(),i=me(a,Sr),o=me(a,yr),[r,d]=l.useState(!1);l.useEffect(()=>{o||d(!1)},[o]);const{status:u,isLoading:h,error:f,refetch:p}=Fh(i),{settings:c,isLoading:x,error:b,updateSetting:v,updateSettings:T}=Ce(),I=(c==null?void 0:c.publicSharesEnabled)??!1,{status:C}=bl({poll:I}),O=()=>{s==null||s.disconnect(),Hr(),window.location.replace(cl(window.location.href,String(Date.now())))},k=(C==null?void 0:C.defaultYaClientBaseUrl)??ct,y=(c==null?void 0:c.yaClientBaseUrl)??(C==null?void 0:C.yaClientBaseUrl)??k,S=(C==null?void 0:C.defaultViewerBaseUrl)??Bh,m=(C==null?void 0:C.viewerBaseUrl)??S,A=(F=>F?F.configured?F.remoteAccessEnabled?F.relayStatus!=="waiting"?{className:"settings-warning",text:e("advancedPublicShareRelayTemporarilyUnavailable",{status:F.relayStatus??"unknown"})}:{className:"settings-hint",text:e("advancedPublicShareReady")}:{className:"settings-warning",text:e("advancedPublicShareRemoteAccessDisabled")}:{className:"settings-warning",text:e("advancedPublicShareRelayMissing")}:null)(C),P=async F=>{!F&&o&&!window.confirm(typeof(C==null?void 0:C.totalValidLinks)=="number"?e("advancedPublicShareDisableConfirm",{count:C.totalValidLinks}):e("advancedPublicShareDisableConfirmUnknown"))||(await v("publicSharesEnabled",F),F||d(!1))},M=n?t.jsx(Wh,{currentIcon:((L=c==null?void 0:c.hostIdentity)==null?void 0:L.icon)??"",disabled:x,onChange:F=>v("hostIdentity",F)}):null,R=i?t.jsx($h,{status:u,statusError:f,statusLoading:h,settingsLoading:x,mode:(c==null?void 0:c.hostAwakeMode)??"off",batteryFloorPercent:(c==null?void 0:c.hostAwakeBatteryFloorPercent)??Yc,onUpdate:T,onRefresh:async()=>{await p(!0)}}):null,N=t.jsxs("div",{className:"settings-group",children:[t.jsx(w,{label:e("advancedPublicShareTitle"),description:e("advancedPublicShareDescription"),info:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:e("advancedPublicShareTitle")}),t.jsx("p",{children:e("advancedPublicShareDescription")}),t.jsx("p",{children:e("advancedPublicSharePrivacyWarning")}),t.jsx("p",{children:e("advancedPublicShareExistingManagement")}),A&&t.jsx("p",{className:A.className,children:A.text}),(C==null?void 0:C.relayUrl)&&t.jsx("p",{className:"settings-hint",style:{wordBreak:"break-all"},children:e("advancedPublicShareRelayEffective",{username:C.relayUsername??"",url:C.relayUrl})})]}),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:I,disabled:x,onChange:F=>void P(F.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})}),o&&t.jsx(w,{id:"manage-public-shares",label:e("advancedPublicShareManageTitle"),description:e("advancedPublicShareManageDescription"),keywords:["public share","broadcast","link","manage","revoke","viewer"],children:t.jsx("button",{type:"button",className:"settings-button settings-button-secondary",onClick:()=>d(!0),children:e("advancedPublicShareManageButton")})}),r&&o&&t.jsx(Br,{creationReady:!1,onClose:()=>d(!1)})]}),$=t.jsx(we,{children:t.jsxs("div",{className:"form-hint",children:[t.jsxs("p",{children:[t.jsx("strong",{children:e("advancedYaClientTitle")}),"."," ",e("advancedYaClientDescription")]}),t.jsx("p",{style:{wordBreak:"break-all"},children:e("advancedYaClientEffective",{url:y})}),t.jsx("p",{style:{wordBreak:"break-all"},children:e("advancedPublicShareViewerEffective",{url:m})}),(C==null?void 0:C.yaClientBaseUrlError)&&t.jsx("p",{className:"settings-warning",children:C.yaClientBaseUrlError})]})}),D=t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"settings-group",children:t.jsx(w,{label:e("developmentPersistRemoteTitle"),description:`${e("developmentPersistRemoteDescriptionPrefix")} remote-sessions.json ${e("developmentPersistRemoteDescriptionSuffix")}`,info:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:e("developmentPersistRemoteTitle")}),t.jsxs("p",{children:[e("developmentPersistRemoteDescriptionPrefix")," ",t.jsx("code",{children:"remote-sessions.json"})," ",e("developmentPersistRemoteDescriptionSuffix")]})]}),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:(c==null?void 0:c.persistRemoteSessionsToDisk)??!1,disabled:x,onChange:F=>void v("persistRemoteSessionsToDisk",F.target.checked)}),t.jsx("span",{className:"toggle-slider"})]})})}),b&&t.jsx("p",{className:"settings-warning",children:b})]});if(s){const F=s.currentHostId?hi(s.currentHostId):null,E=(F==null?void 0:F.displayName)||s.storedUsername||e("remoteAccessDefaultHost");return t.jsxs(oe,{description:e("remoteAccessConnectedDescription"),children:[R,N,$,t.jsxs("div",{className:"settings-group",children:[t.jsx(w,{label:e("remoteAccessCurrentHostTitle"),description:E,children:t.jsx("div",{className:"settings-item-actions",children:t.jsx("button",{type:"button",className:"settings-button",onClick:O,children:e("sidebarSwitchHost")})})}),M,(F==null?void 0:F.relayUrl)&&t.jsx(w,{label:e("remoteAccessRelayUrlTitle"),description:F.relayUrl}),t.jsx(w,{label:e("remoteAccessLogoutTitle"),description:e("remoteAccessLogoutDescription"),children:t.jsx("button",{type:"button",className:"settings-button settings-button-danger",onClick:()=>s.disconnect(),children:e("remoteAccessLogout")})})]}),D]})}return t.jsxs(oe,{children:[M&&t.jsx("div",{className:"settings-group",children:M}),R,N,t.jsx(we,{children:t.jsx(Ph,{title:e("remoteAccessConnectedTitle"),description:e("remoteAccessSetupDescription"),yaClientInfo:$})}),D]})}const zh="_addRow_19i6y_1",Gh="_input_19i6y_7",Kh="_addButton_19i6y_22",Yh="_list_19i6y_42",Qh="_item_19i6y_48",Xh="_itemInfo_19i6y_54",qh="_host_19i6y_61",Jh="_error_19i6y_66",Zh="_details_19i6y_70",eg="_actions_19i6y_76",tg="_testButton_19i6y_81",sg="_removeButton_19i6y_82",ng="_requirements_19i6y_108",ag="_addItem_19i6y_120",He={addRow:zh,input:Gh,addButton:Kh,list:Yh,item:Qh,itemInfo:Xh,host:qh,error:Jh,details:Zh,actions:eg,testButton:tg,removeButton:sg,requirements:ng,addItem:ag};function ig(){const{t:e}=K();_e(e("remoteExecutorsTitle"));const{executors:s,loading:n,addExecutor:a,removeExecutor:i,replaceExecutors:o,testExecutor:r}=Fl(),[d,u]=l.useState(""),[h,f]=l.useState(!1),[p,c]=l.useState(null),[x,b]=l.useState({}),v=l.useMemo(()=>n?null:{executors:s},[n,s]),T=l.useCallback(async y=>{await o(y.executors),c(null)},[o]);$e(v,T);const I=async()=>{if(!(!d.trim()||h)){f(!0),c(null);try{await a(d.trim()),u("")}catch(y){c(y instanceof Error?y.message:e("remoteExecutorsAddFailed"))}finally{f(!1)}}},C=async y=>{try{await i(y),b(S=>{const{[y]:m,..._}=S;return _})}catch(S){console.error("Failed to remove executor:",S)}},O=async y=>{b(S=>({...S,[y]:{testing:!0}}));try{const S=await r(y);b(m=>({...m,[y]:{testing:!1,result:S}}))}catch(S){b(m=>({...m,[y]:{testing:!1,result:{success:!1,error:S instanceof Error?S.message:e("remoteExecutorsConnectionFailed")}}}))}},k=y=>{y.key==="Enter"&&(y.preventDefault(),I())};return t.jsxs(oe,{description:e("remoteExecutorsDescription"),children:[t.jsx("div",{className:"settings-group",children:t.jsxs(w,{label:e("remoteExecutorsAddTitle"),description:e("remoteExecutorsAddDescription"),className:He.addItem,children:[t.jsxs("div",{className:He.addRow,children:[t.jsx("input",{type:"text",value:d,onChange:y=>u(y.target.value),onKeyDown:k,placeholder:e("remoteExecutorsHostPlaceholder"),disabled:h,className:He.input}),t.jsx("button",{type:"button",onClick:I,disabled:!d.trim()||h,className:He.addButton,children:e(h?"remoteExecutorsAdding":"remoteExecutorsAdd")})]}),p&&t.jsx("p",{className:"settings-error",children:p})]})}),t.jsx(we,{children:t.jsxs("div",{className:"settings-group",children:[t.jsx("h3",{children:e("remoteExecutorsConfigured")}),n?t.jsx("p",{className:"settings-loading",children:e("loginLoading")}):s.length===0?t.jsx("p",{className:"settings-empty",children:e("remoteExecutorsEmpty")}):t.jsx("div",{className:He.list,children:s.map(y=>{var m;const S=x[y];return t.jsxs("div",{className:He.item,children:[t.jsxs("div",{className:He.itemInfo,children:[t.jsx("span",{className:He.host,children:y}),(S==null?void 0:S.result)&&t.jsx("span",{className:`settings-status-badge ${S.result.success?"settings-status-detected":"settings-status-not-detected"}`,children:S.result.success?e("remoteExecutorsConnected"):e("remoteExecutorsFailed")})]}),(S==null?void 0:S.result)&&!S.result.success&&t.jsx("p",{className:`settings-error ${He.error}`,children:S.result.error}),((m=S==null?void 0:S.result)==null?void 0:m.success)&&t.jsx("p",{className:He.details,children:S.result.claudeAvailable?S.result.claudeVersion?e("remoteExecutorsClaudeVersion",{version:S.result.claudeVersion}):e("remoteExecutorsClaudeAvailable"):e("remoteExecutorsClaudeMissing")}),t.jsxs("div",{className:He.actions,children:[t.jsx("button",{type:"button",onClick:()=>O(y),disabled:S==null?void 0:S.testing,className:He.testButton,children:S!=null&&S.testing?e("remoteExecutorsTesting"):e("remoteExecutorsTestConnection")}),t.jsx("button",{type:"button",onClick:()=>C(y),className:He.removeButton,children:e("remoteExecutorsRemove")})]})]},y)})})]})}),t.jsx(we,{children:t.jsxs("div",{className:"settings-group",children:[t.jsx("h3",{children:e("remoteExecutorsSetupRequirements")}),t.jsxs("ul",{className:He.requirements,children:[t.jsx("li",{children:e("remoteExecutorsRequirementSshConfig")}),t.jsx("li",{children:e("remoteExecutorsRequirementKeyAuth")}),t.jsx("li",{children:e("remoteExecutorsRequirementClaude")}),t.jsx("li",{children:e("remoteExecutorsRequirementPaths")})]})]})})]})}const ho=[U.locale,U.theme,U.fontSize,U.sidebarSpacing,U.outputProseFont,U.outputUiFont,U.userTurnFontSizeOffset,U.outputProseFontSize,U.outputFixedFont,U.outputFixedFontSizeOffset,U.outputProseThinkingFontSizeOffset,U.outputProseMathFontSizeOffset,U.outputProseLineSpacingPercent,U.outputProseVerticalSpacing,U.outputProseVerticalSpacingPercent,U.outputToolPreviewLineCount,U.tabSize,U.contentMaxWidth,U.sourceControlCleanLanding,U.sidebarWidth,U.sidebarExpanded,U.sidebarMinimized,U.sidebarSectionExpansion,U.sidebarDuplicateHidingEnabled,U.funPhrases,U.streamingEnabled,U.speechKeepMicWarm,U.speechReducePlayback,U.speechUnspokenPunctuation,U.speechFollowUpListenMs,U.speechAsrAttributionMs,U.speechMessagePrefixMode,U.speechMessageCustomPrefix,U.floatingActionButtonEnabled,U.keepMobileKeyboardOpenAfterDelivery,U.developerMode,U.conversationView,U.conversationViewTurnLimit,U.widerConversationActivityPreviews,U.glossaryHints,U.sessionToolbarPresence,U.waveformButtonBackgroundOpacityPercent,U.tooltipMode,U.tooltipDelayMs,U.sessionHoverCardShowDelayMs,U.sessionHoverCardMaxHeightPx,U.sessionGeneratedTitleEnabled,U.sessionGeneratedTitleLength,U.quoteReplyButtonMode,U.selectionQuoteActionEnabled,U.selectionSourceCopyActionEnabled,U.selectionRichCopyActionEnabled,U.sessionThinkingVisible,U.sessionThinkingLatestOnly,U.sessionLoadingProgress,U.sessionDomLinger,U.sessionActiveWindowTrim,U.sessionTranscriptCache,U.sessionTranscriptCacheBudgetMb,U.sessionTranscriptCacheTtlHours,U.sessionScrollBehavior,U.sessionDetailShadowDiagnostics,U.stableToolPreviewRendering,U.inlineMediaExpandedByDefault,U.compactMultiImageGalleries,U.recentProjectPathLinks,U.schemaValidation,U.emulatorMaxFps,U.emulatorMaxWidth,U.emulatorQuality,U.emulatorAdaptiveFps,U.attachmentUploadQuality,U.tabTitleActivityEnabled,U.projectCodeNamesEnabled,U.projectCodeNameActivityPulseEnabled,U.settingsIconStyle,Ye.model,Ye.thinkingLevel,Ye.thinkingMode,Ye.showThinking,Ye.voiceInputEnabled,Ye.speechMethod,Ye.speechSmartTurn,Ye.grokSpeechAudio,Ye.parakeetSpeechModel,Ye.notifyInApp];function go(e=window.localStorage){const s={};for(const n of ho){const a=e.getItem(n);a!==null&&(s[n]=a)}return s}function ai(e,s){for(const n of ho){const a=Object.hasOwn(e,n)?e[n]:void 0;typeof a=="string"?s.setItem(n,a):s.removeItem(n)}}function og(e,s=window.localStorage){if(e.version!==Mi)throw new Error(`Unsupported browser settings version: ${e.version}`);const n=go(s);try{ai(e.values,s)}catch(a){throw ai(n,s),a}}function rg(e){const s=new Date(e);return Number.isNaN(s.getTime())?e:s.toLocaleString()}function ii(){const{t:e}=K(),[s,n]=l.useState(null),[a,i]=l.useState("fetching"),[o,r]=l.useState(null);l.useEffect(()=>{let f=!1;return he.getBrowserSettingsBackup().then(p=>{f||n(p.backup)}).catch(()=>{f||r(e("settingsBackupUnavailable"))}).finally(()=>{f||i(null)}),()=>{f=!0}},[e]);const d=async()=>{i("saving"),r(null);try{const f=await he.saveBrowserSettingsBackup({version:Mi,values:go()});n(f.backup)}catch{r(e("settingsBackupSaveFailed"))}finally{i(null)}},u=()=>{if(!(!s||!window.confirm(e("settingsBackupLoadConfirm")))){i("loading"),r(null);try{og(s),window.location.reload()}catch{r(e("settingsBackupLoadFailed")),i(null)}}},h=o||(a==="fetching"?e("settingsBackupChecking"):s?e("settingsBackupSavedAt",{time:rg(s.savedAt)}):e("settingsBackupEmpty"));return t.jsxs("section",{className:"settings-backup-actions","aria-label":e("settingsBackupTitle"),children:[t.jsx("span",{className:"settings-backup-title",children:e("settingsBackupTitle")}),t.jsx("span",{className:"settings-backup-status",children:e("settingsBackupDescription")}),t.jsxs("div",{className:"settings-backup-buttons",children:[t.jsx("button",{type:"button",className:"settings-button",onClick:()=>void d(),disabled:a!==null,title:e("settingsBackupSaveTooltip"),children:e(a==="saving"?"settingsBackupSaving":"settingsBackupSave")}),t.jsx("button",{type:"button",className:"settings-button",onClick:u,disabled:a!==null||!s,title:e("settingsBackupLoadTooltip"),children:e(a==="loading"?"settingsBackupLoading":"settingsBackupLoad")})]}),t.jsx("span",{className:`settings-backup-status ${o?"error":""}`,role:o?"alert":"status",children:h})]})}function Qs({category:e,isActive:s,onClick:n,highlightQuery:a}){return t.jsxs("button",{type:"button",className:`settings-category-item ${s?"active":""}`,onClick:n,children:[t.jsx(iu,{id:e.id}),t.jsxs("div",{className:"settings-category-text",children:[t.jsx("span",{className:"settings-category-label",children:a?St(e.label,a):e.label}),t.jsx("span",{className:"settings-category-description",children:a?St(e.description,a):e.description})]}),t.jsx("span",{className:"settings-category-chevron",children:"›"})]})}const lg="_bar_1p6js_6",cg="_inputWrap_1p6js_13",dg="_input_1p6js_13",ug="_clear_1p6js_33",pg="_valuesToggle_1p6js_51",Nt={bar:lg,inputWrap:cg,input:dg,clear:ug,valuesToggle:pg};function mg(){const[e,s]=l.useState(()=>localStorage.getItem(U.settingsSearchMatchValues)==="true"),n=l.useCallback(a=>{s(a),localStorage.setItem(U.settingsSearchMatchValues,String(a))},[]);return[e,n]}function hg({query:e,onQueryChange:s,matchValues:n,onMatchValuesChange:a}){const{t:i}=K(),o=ar(i("settingsSearchMatchValuesTooltip")),r=e.trim()!=="";return t.jsxs("form",{className:Nt.bar,role:"search",autoComplete:"off",onSubmit:d=>d.preventDefault(),children:[t.jsxs("div",{className:Nt.inputWrap,children:[t.jsx("input",{type:"search",name:"settings-search",autoComplete:"off",className:`settings-input ${Nt.input}`,placeholder:i("settingsSearchPlaceholder"),"aria-label":i("settingsSearchPlaceholder"),value:e,onChange:d=>s(d.target.value),onKeyDown:d=>{d.key==="Escape"&&e!==""&&(d.stopPropagation(),s(""))}}),e!==""&&t.jsx("button",{type:"button",className:Nt.clear,"aria-label":i("settingsSearchClear"),onClick:()=>s(""),children:"×"})]}),r&&t.jsxs("label",{className:Nt.valuesToggle,...o,children:[t.jsx("input",{type:"checkbox",checked:n,onChange:d=>a(d.target.checked)}),i("settingsSearchMatchValues")]})]})}const gg=e=>{},fg=e=>{},bg=l.memo(function({Component:s}){return t.jsx(Hs,{value:gg,children:t.jsx(Ws,{value:fg,children:t.jsx(s,{})})})});function xg({categories:e,components:s,query:n,matchValues:a,onJumpToItem:i,onOpenCategory:o}){const{t:r}=K(),d=l.useRef(null),[u,h]=l.useState(null),f=e.filter(c=>Zs(n,[c.label,c.description]));l.useLayoutEffect(()=>{const c=d.current;if(!c)return;const x=()=>{h(c.querySelectorAll("[data-settings-item].settings-search-match").length)};x();const b=new MutationObserver(x);return b.observe(c,{attributes:!0,attributeFilter:["class","data-settings-item"],childList:!0,subtree:!0}),()=>b.disconnect()},[n,a]);const p=f.length>0||u===null||u>0;return t.jsxs("div",{className:"settings-search-results",children:[f.length>0&&t.jsxs("div",{className:"settings-search-category-matches",children:[t.jsx("h3",{className:"settings-search-heading",children:r("settingsSearchCategoriesHeading")}),t.jsx("div",{className:"settings-category-list",children:f.map(c=>t.jsx(Qs,{category:c,isActive:!1,onClick:()=>o(c.id),highlightQuery:n},c.id))})]}),t.jsx("div",{ref:d,children:e.map(c=>{const x=s[c.id];return x?t.jsx(vg,{category:c,Component:x,query:n,matchValues:a,onJumpToItem:i,onOpenCategory:o},c.id):null})}),!p&&t.jsx("p",{className:"settings-search-no-results",children:r("settingsSearchNoResults",{query:n})}),t.jsx("span",{className:"settings-search-live-count","aria-live":"polite",children:r("settingsSearchResultCount",{count:(u??0)+f.length})})]})}function vg({category:e,Component:s,query:n,matchValues:a,onJumpToItem:i,onOpenCategory:o}){const r=l.useMemo(()=>({query:n,matchValues:a,sectionMatched:!1,categoryLabel:e.label,jumpToItem:d=>i(e.id,d)}),[n,a,e.id,e.label,i]);return t.jsxs("section",{className:"settings-search-pane","data-category":e.id,children:[t.jsx("h3",{className:"settings-search-pane-title",children:t.jsxs("button",{type:"button",onClick:()=>o(e.id),children:[e.label," ›"]})}),t.jsx(en,{value:r,children:t.jsx(bg,{Component:s})})]})}const Sg="Ctrl+Z / ⌘Z",yg=new Set(["date","datetime-local","email","month","number","password","search","tel","text","time","url","week"]);function jg(e){return e instanceof HTMLElement?e.isContentEditable||e instanceof HTMLTextAreaElement?!0:e instanceof HTMLInputElement&&yg.has(e.type):!1}function Tg({registration:e,paneTitle:s}){const{t:n}=K(),a=(e==null?void 0:e.canUndo)??!1,i=n("settingsUndoSnapshotTooltip",{page:s,shortcut:Sg});return l.useEffect(()=>{if(!a||!e)return;const o=r=>{r.defaultPrevented||r.isComposing||r.repeat||r.altKey||r.shiftKey||!r.ctrlKey&&!r.metaKey||r.key.toLowerCase()!=="z"||jg(r.target)||(r.preventDefault(),e.undo())};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[a,e]),t.jsx("button",{type:"button",className:"settings-button",onClick:()=>void(e==null?void 0:e.undo()),title:a?i:void 0,"aria-label":a?i:n("settingsUndoChanges"),disabled:!a,"aria-hidden":!a,tabIndex:a?0:-1,style:{visibility:a?"visible":"hidden"},children:n("settingsUndoChanges")})}function wg(){var De;const{t:e}=K();_e(e("speechSettingsTitle"));const{voiceInputEnabled:s,setVoiceInputEnabled:n,speechMethod:a,hasStoredSpeechMethod:i,setSpeechMethod:o,speechSmartTurnSettings:r,setSpeechSmartTurnSettings:d,parakeetSpeechModel:u,setParakeetSpeechModel:h}=Si(),f=l.useId(),p=l.useId(),{keepMicWarm:c,setKeepMicWarm:x,reducePlayback:b,setReducePlayback:v,unspokenPunctuation:T,setUnspokenPunctuation:I,followUpListenMs:C,setFollowUpListenMs:O,asrAttributionMs:k,setAsrAttributionMs:y,speechMessagePrefixMode:S,setSpeechMessagePrefixMode:m,speechMessageCustomPrefix:_,setSpeechMessageCustomPrefix:A}=uc(),{browserXaiSttApiKey:P,hasBrowserXaiSttApiKey:M,setBrowserXaiSttApiKey:R}=pc(),{relayTransport:N,relayedServerSpeechAvailable:$}=mc(),{version:D,loading:L}=We(),F=l.useMemo(()=>({voiceInputEnabled:s,speechMethod:a,speechSmartTurnSettings:r,keepMicWarm:c,reducePlayback:b,unspokenPunctuation:T,followUpListenMs:C,asrAttributionMs:k,speechMessagePrefixMode:S,speechMessageCustomPrefix:_,parakeetSpeechModel:u,browserXaiSttApiKey:P}),[s,a,r,c,b,T,C,k,S,_,u,P]),E=l.useCallback(B=>{n(B.voiceInputEnabled),o(B.speechMethod),d(B.speechSmartTurnSettings),x(B.keepMicWarm),v(B.reducePlayback),I(B.unspokenPunctuation),O(B.followUpListenMs),y(B.asrAttributionMs),m(B.speechMessagePrefixMode),A(B.speechMessageCustomPrefix),h(B.parakeetSpeechModel),R(B.browserXaiSttApiKey)},[n,o,d,x,v,I,O,y,m,A,h,R]);$e(F,E);const V=!jr(D)||me(D,Tr),te=(D==null?void 0:D.voiceBackends)??[],ne=(D==null?void 0:D.voiceBackendStatuses)??[],ae=ne.length>0?ne.map(B=>B.id):te,Z=hc(ae,void 0,{directXaiAvailable:M}).map(B=>{const X=ne.find(fe=>fe.id===B.id),H=(X==null?void 0:X.validationStatus)==="pending",q=(X==null?void 0:X.validationStatus)==="disabled";return{value:B.id,label:B.label,description:H?e("speechSettingsBackendValidating"):q?X.disabledReason||e("speechSettingsBackendUnavailable"):B.description,disabled:!B.clientSupported||H||q}}),ee=gc(a,te,i,{directXaiAvailable:M,browserNativeAvailable:fc()}),xe=((De=Z.find(B=>B.value===ee))==null?void 0:De.label)??ee??e("speechSettingsBackendUnavailable"),z=ee===null?{}:bc(ee,D==null?void 0:D.voiceBackendCapabilities),re=ee!==null&&wc(ee),Ne=ee!==null&&wt(ee),pe=xc(u),ge=l.useMemo(()=>{const B=[],X=H=>{wt(H)&&!B.includes(H)&&B.push(H)};ee!==null&&X(ee);for(const H of te)X(H);return B},[ee,te]),G=ee!==null&&vc({methodId:ee,serverCapabilities:D==null?void 0:D.voiceBackendCapabilities,relayTransport:N,relayedServerSpeechAvailable:$})&&z.smartTurn===!0,ie=N&&re&&!$?e("speechSettingsStreamingRelayUnavailable"):e("speechSettingsSmartTurnUnavailable",{backend:xe}),ce=l.useCallback((B,X)=>{const H=X??ee;if(H===null||!wt(H))return;const q=ys(B);Sc(H,q).catch(fe=>{console.warn("[YaSTT] Speech model prewarm failed",fe instanceof Error?fe.message:String(fe))})},[ee]),Ae=l.useCallback(B=>{B.key==="Enter"&&(B.preventDefault(),ce(B.currentTarget.value))},[ce]),Pe=l.useCallback(B=>{if(ee===null)return;const X=ys(B),H=va(X,ee,ge);H&&(h(X),H!==ee&&o(H),ce(X,H))},[ge,ce,ee,h,o]),Re=l.useCallback(B=>{if(!wt(B))return;const X=yc(u,B);X!==ys(u)&&h(X),ce(X,B)},[u,ce,h]);return t.jsx(oe,{description:e("speechSettingsDescription"),children:t.jsxs("div",{className:"settings-group",children:[t.jsx(w,{label:e("speechSettingsVoiceInputTitle"),description:e("speechSettingsVoiceInputDescription"),info:t.jsxs(t.Fragment,{children:[t.jsx("strong",{children:e("speechSettingsVoiceInputTitle")}),t.jsx("p",{children:e("speechSettingsVoiceInputDescription")}),!V&&t.jsx("p",{className:"settings-hint",children:e("speechSettingsServerDisabled")})]}),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:s&&V,disabled:L||!V,onChange:B=>n(B.target.checked),"aria-label":e("speechSettingsVoiceInputTitle")}),t.jsx("span",{className:"toggle-slider"})]})}),Ne&&t.jsx(w,{label:e("speechSettingsParakeetModelTitle"),description:e("speechSettingsParakeetModelDescription"),className:"model-settings-item",children:t.jsxs("div",{className:"speech-backend-settings-field",children:[t.jsxs("select",{id:f,className:"settings-select speech-parakeet-model-select",value:pe,onChange:B=>{const X=B.currentTarget.value;X&&Pe(X)},"aria-label":e("speechSettingsParakeetModelPresetLabel"),children:[t.jsx("option",{value:"",children:e("speechSettingsParakeetCustomModel")}),jc.map(B=>{const X=va(B.value,ee,ge),H=B.supportedBackends.map(Tc).join(" or ");return t.jsx("option",{value:B.value,disabled:!X,children:X?B.label:`${B.label} (${e("speechSettingsParakeetModelRequiresBackend",{backend:H})})`},B.value)})]}),t.jsx("input",{id:p,className:"settings-input",value:u,placeholder:e("speechSettingsParakeetModelPlaceholder"),autoComplete:"off",spellCheck:!1,onChange:B=>h(B.currentTarget.value),onBlur:B=>ce(B.currentTarget.value),onKeyDown:Ae,"aria-label":e("speechSettingsParakeetModelInputLabel")}),t.jsx("p",{className:"settings-hint",children:e("speechSettingsParakeetModelHint")})]})}),t.jsx(w,{label:e("speechSettingsBackendTitle"),description:e("speechSettingsBackendDescription"),valueText:xe,className:"model-settings-item",after:N&&!$&&ee==="ya-grok"&&t.jsx("p",{className:"settings-hint",children:e("speechSettingsStreamingRelayUnavailable")}),children:t.jsxs("div",{className:"speech-backend-settings-field",children:[t.jsx(ns,{label:e("speechSettingsBackendTitle"),options:Z,selected:ee===null?[]:[ee],onChange:B=>{const X=B[0];X&&(wt(X)&&Re(X),o(X))},multiSelect:!1,placeholder:e(ee===null?"speechSettingsBackendUnavailable":"speechSettingsBackendPlaceholder"),fullWidth:!0}),te.length===0&&t.jsx("p",{className:"settings-hint",children:e("speechSettingsNoServerBackends")})]})}),t.jsx(w,{label:e("speechSettingsXaiKeyTitle"),description:e("speechSettingsXaiKeyDescription"),className:"model-settings-item",children:t.jsx("input",{type:"password",id:"xai-stt-api-key",name:"xai-stt-api-key",className:"settings-input",value:P,placeholder:e("speechSettingsXaiKeyPlaceholder"),autoComplete:"new-password",spellCheck:!1,onChange:B=>{R(B.currentTarget.value)},"aria-label":e("speechSettingsXaiKeyTitle")})}),t.jsx(w,{label:e("speechSettingsUnspokenPunctuationTitle"),description:e("speechSettingsUnspokenPunctuationDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:T,onChange:B=>I(B.target.checked),"aria-label":e("speechSettingsUnspokenPunctuationTitle")}),t.jsx("span",{className:"toggle-slider"})]})}),t.jsx(w,{label:e("speechSettingsKeepMicWarmTitle"),description:e("speechSettingsKeepMicWarmDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:c,onChange:B=>x(B.target.checked),"aria-label":e("speechSettingsKeepMicWarmTitle")}),t.jsx("span",{className:"toggle-slider"})]})}),t.jsx(w,{label:e("speechSettingsReducePlaybackTitle"),description:e("speechSettingsReducePlaybackDescription"),children:t.jsxs("label",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox",checked:b,onChange:B=>v(B.target.checked),"aria-label":e("speechSettingsReducePlaybackTitle")}),t.jsx("span",{className:"toggle-slider"})]})}),t.jsx(w,{label:e("speechSettingsSmartTurnTitle"),description:e("speechSettingsSmartTurnDescription",{backend:xe}),className:"model-settings-item",children:G?t.jsx(Bl,{settings:r,onChange:d}):t.jsx("p",{className:"settings-hint",children:ie})}),t.jsx(w,{label:e("speechSettingsMessagePrefixTitle"),description:e("speechSettingsMessagePrefixDescription"),className:"model-settings-item",children:t.jsx(Hl,{showDescription:!1})})]})})}function Cg(){const{t:e}=K();_e(e("sourceControlSettingsTitle"));const{version:s,refetch:n}=We(),a=me(s,di),i=me(s,wr),{settings:o,isLoading:r,error:d,updateSettings:u}=Ce(),h=(o==null?void 0:o.sourceReviewSubmissionsEnabled)??!1,f=(o==null?void 0:o.liveWorktreeMonitoringEnabled)??!1,{sourceControlCleanLanding:p,setSourceControlCleanLanding:c}=Dc(),x=l.useMemo(()=>o?{sourceControlCleanLanding:p,...a?{sourceReviewSubmissionsEnabled:h}:{},...i?{liveWorktreeMonitoringEnabled:f}:{}}:null,[f,i,a,h,o,p]),b=l.useCallback(v=>{c(v.sourceControlCleanLanding);const T={};"sourceReviewSubmissionsEnabled"in v&&(T.sourceReviewSubmissionsEnabled=v.sourceReviewSubmissionsEnabled),"liveWorktreeMonitoringEnabled"in v&&(T.liveWorktreeMonitoringEnabled=v.liveWorktreeMonitoringEnabled),u(T).then(()=>n()).catch(()=>{})},[n,c,u]);return $e(x,b),!a&&!i?null:r?t.jsx(oe,{description:e("sourceControlSettingsLoading")}):t.jsxs(oe,{description:e("sourceControlSettingsDescription"),children:[t.jsxs("div",{className:"settings-group",children:[a&&t.jsx(w,{className:"settings-item--wide-control",label:e("sourceControlCleanLandingTitle"),description:e("sourceControlCleanLandingDescription"),valueText:e(p==="latest-commit"?"sourceControlCleanLandingLatestCommit":"sourceControlCleanLandingWorkingTree"),children:t.jsxs("select",{className:"settings-select","aria-label":e("sourceControlCleanLandingTitle"),value:p,onChange:v=>c(v.target.value),children:[t.jsx("option",{value:"working-tree",children:e("sourceControlCleanLandingWorkingTree")}),t.jsx("option",{value:"latest-commit",children:e("sourceControlCleanLandingLatestCommit")})]})}),a&&t.jsx(w,{as:"label",label:e("sourceReviewSubmissionsSettingTitle"),description:e("sourceReviewSubmissionsSettingDescription"),children:t.jsxs("span",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox","aria-label":e("sourceReviewSubmissionsSettingTitle"),checked:h,onChange:v=>{u({sourceReviewSubmissionsEnabled:v.target.checked}).catch(()=>{})}}),t.jsx("span",{className:"toggle-slider"})]})}),i&&t.jsx(w,{as:"label",label:e("liveWorktreeMonitoringSettingTitle"),description:e("liveWorktreeMonitoringSettingDescription"),children:t.jsxs("span",{className:"toggle-switch",children:[t.jsx("input",{type:"checkbox","aria-label":e("liveWorktreeMonitoringSettingTitle"),checked:f,onChange:v=>{u({liveWorktreeMonitoringEnabled:v.target.checked}).then(()=>n()).catch(()=>{})}}),t.jsx("span",{className:"toggle-slider"})]})})]}),d&&t.jsx("p",{className:"settings-error",children:d})]})}const Ng="_setting_uyw46_1",Eg="_choices_uyw46_7",kg="_choice_uyw46_7",_g="_selected_uyw46_40",Mg="_choiceText_uyw46_74",Ag="_choiceHeading_uyw46_81",Dg="_choiceDescription_uyw46_89",Pg="_defaultBadge_uyw46_96",qe={setting:Ng,choices:Eg,choice:kg,selected:_g,choiceText:Mg,choiceHeading:Ag,choiceDescription:Dg,defaultBadge:Pg};function Xt({name:e,value:s,label:n,description:a,checked:i,disabled:o,isDefault:r=!1,onChange:d}){const{t:u}=K();return t.jsxs("label",{className:`${qe.choice} ${i?qe.selected:""}`.trim(),children:[t.jsx("input",{type:"radio",name:e,value:s,"aria-label":n,checked:i,disabled:o,onChange:d}),t.jsxs("span",{className:qe.choiceText,children:[t.jsxs("span",{className:qe.choiceHeading,children:[t.jsx("span",{children:n}),r&&t.jsx("span",{className:qe.defaultBadge,children:u("storageChoiceDefault")})]}),t.jsx("span",{className:qe.choiceDescription,children:a})]})]})}function Ig(){const{t:e}=K();_e(e("storageSettingsTitle"));const{version:s}=We(),n=me(s,Cr),a=me(s,Nr),{settings:i,isLoading:o,error:r,updateSettings:d}=Ce(),u=(i==null?void 0:i.projectDirectoryStorage)??"app-data",h=(i==null?void 0:i.toolResultMediaPreservation)??"on-demand",f=l.useMemo(()=>i?{projectLocation:u,mediaPreservation:h,supportsProjectLocation:n,supportsMediaPreservation:a}:null,[h,u,i,a,n]),p=l.useCallback(c=>{d({...c.supportsProjectLocation?{projectDirectoryStorage:c.projectLocation}:{},...c.supportsMediaPreservation?{toolResultMediaPreservation:c.mediaPreservation}:{}}).catch(()=>{})},[d]);return $e(f,p),o?t.jsx(oe,{description:e("storageSettingsLoading")}):t.jsxs(oe,{description:e("storageSettingsDescription"),keywords:[".yep",".attachments","YEP_DATA_DIR"],children:[t.jsxs("div",{className:"settings-group",children:[t.jsx(w,{id:"project-data-location",className:qe.setting,label:e("projectDataLocationTitle"),description:e("projectDataLocationDescription"),keywords:[".yep",".attachments","YEP_DATA_DIR"],valueText:e(u==="project"?"projectDataLocationProject":"projectDataLocationAppData"),after:n?null:t.jsx("p",{className:"settings-warning",children:e("projectDataLocationUpdateRequired")}),children:t.jsxs("fieldset",{className:qe.choices,"aria-label":e("projectDataLocationTitle"),children:[t.jsx(Xt,{name:"project-data-location",value:"app-data",label:e("projectDataLocationAppData"),description:e("projectDataLocationAppDataDescription"),checked:n&&u==="app-data",disabled:!n,isDefault:!0,onChange:()=>{d({projectDirectoryStorage:"app-data"}).catch(()=>{})}}),t.jsx(Xt,{name:"project-data-location",value:"project",label:e("projectDataLocationProject"),description:e("projectDataLocationProjectDescription"),checked:n&&u==="project",disabled:!n,onChange:()=>{d({projectDirectoryStorage:"project"}).catch(()=>{})}})]})}),t.jsx(w,{id:"tool-result-images",className:qe.setting,label:e("toolResultImagesStorageTitle"),description:e("toolResultImagesStorageDescription"),keywords:["tool results","image","preserve","storage"],valueText:e(h==="preserve"?"toolResultImagesPreserve":"toolResultImagesOnDemand"),after:a?null:t.jsx("p",{className:"settings-warning",children:e("toolResultImagesUpdateRequired")}),children:t.jsxs("fieldset",{className:qe.choices,"aria-label":e("toolResultImagesStorageTitle"),children:[t.jsx(Xt,{name:"tool-result-images",value:"on-demand",label:e("toolResultImagesOnDemand"),description:e("toolResultImagesOnDemandDescription"),checked:a&&h==="on-demand",disabled:!a,isDefault:!0,onChange:()=>{d({toolResultMediaPreservation:"on-demand"}).catch(()=>{})}}),t.jsx(Xt,{name:"tool-result-images",value:"preserve",label:e("toolResultImagesPreserve"),description:e("toolResultImagesPreserveDescription"),checked:a&&h==="preserve",disabled:!a,onChange:()=>{d({toolResultMediaPreservation:"preserve"}).catch(()=>{})}})]})})]}),r&&t.jsx("p",{className:"settings-warning",children:r})]})}const fo={inputTokens:168e3,percentage:84,contextWindow:2e5},Se=()=>{},Lg=Object.fromEntries(Wl.map(e=>[e,!1]));function Rg(e){return{...Lg,[e]:!0}}function bo(e){const{t:s}=K(),n=l.useMemo(()=>({prefix:s("toolbarLivenessVerifiedIdle"),timestampMs:e-240*1e3,tone:"muted",title:s("toolbarPreviewSessionStatus")}),[e,s]),a=l.useMemo(()=>yi({provider:"codex",model:"gpt-5.5-codex",translate:s}),[s]);return l.useMemo(()=>({t:s,modeControl:{mode:"bypassPermissions",onModeChange:Se},attachmentControl:{canAttach:!0,attachmentCount:1,onAttachClick:Se},slashControl:{commands:["model","btw","compact","done"].map(Nl),onSelectCommand:Se},thinkingControl:{mode:"auto",level:"max",effortOptions:a,onSetMode:Se,onSetEffort:Se,onToggleEnabled:Se,showThinking:"default",onSetShowThinking:Se},renderModeControl:{state:"mixed",title:s("toolbarRenderModeMixed"),onToggle:Se},conversationViewControl:{enabled:!0,title:s("toolbarConversationViewDisable"),onToggle:Se},browserDebugControl:{active:!1,connected:!1,remainingFraction:0,title:s("toolbarBrowserDebugEnable"),onToggle:Se,onReactivate:Se,onReload:Se},nudgeControl:{enabled:!0,title:s("sessionHeartbeatTitle"),onClick:Se,onContextMenu:o=>o.preventDefault(),onTouchStart:Se,onTouchEnd:o=>o.preventDefault(),onClearTouch:Se},doneControl:{onDone:Se,title:s("syntheticDoneToolbarTitle")},speechControl:{showMethodSelector:!1,methodOptions:[],selectedMethod:"browser-native",onMethodChange:Se,voiceButton:{kind:"preview"}},statusControl:{showToolbarStatus:!0,showLivenessChip:!0,livenessDisplay:n,livenessSummary:s("toolbarLivenessSummary",{state:s("toolbarLivenessVerifiedIdle"),age:s("toolbarRelativeAgePast",{age:"4m"})}),nowMs:e,showLastActivityChip:!1,showLastActivityPrefix:!1,lastActivityMs:null,lastActivityIsPast:!1,positionTimestampMs:null,showPositionTimestamp:!1,hasPositionAge:!1,hasLastActivityAge:!1},shortcutsControl:{open:!1,isearchScope:null,setOpen:Se,settingsOpen:!1,setSettingsOpen:Se,hasDualActions:!0,enterActionKind:"steer",canSwapEnterAction:!1,queueShortcutLabel:s("toolbarShortcutQueueCurrentTurn")},send:{onSend:Se,canSend:!0,primaryActionKind:"steer",primaryActionLabel:s("toolbarSteerTooltip"),tooltip:s("toolbarSteerTooltip"),icon:"↗",showSteerNowMode:!0,steerNowEnabled:!1,onToggleSteerNow:Se,queue:{onQueue:Se,hasDualActions:!0,queueTooltip:s("toolbarQueueTooltip")}},btw:{onClick:Se,pressed:!1,mode:"start",title:s("toolbarBtwStartTitle")},projectQueue:{onProjectQueue:Se,onProjectQueueNewSession:Se,canSend:!0,tooltip:s("toolbarProjectQueueTooltip"),newSessionTooltip:s("toolbarProjectQueueNewSessionTooltip")}}),[a,n,e,s])}function xo(){const e=l.useRef(null);return l.useEffect(()=>{const s=e.current;if(s)return s.inert=!0,()=>{s.inert=!1}},[]),e}function Og(){const{t:e}=K(),{visibility:s,priority:n}=fi(),{waveformButtonBackgroundOpacityPercent:a}=Xs(),i=l.useMemo(()=>Date.now(),[]),o=bo(i),r=xo();return t.jsx("div",{className:"session-toolbar-preview","aria-hidden":"true",children:t.jsx("div",{ref:r,className:"session-toolbar-preview-content",children:t.jsx(gi,{t:e,visibility:s,priority:n,modeControl:o.modeControl,attachmentControl:o.attachmentControl,slashControl:o.slashControl,thinkingControl:o.thinkingControl,renderModeControl:o.renderModeControl,conversationViewControl:o.conversationViewControl,browserDebugControl:o.browserDebugControl,nudgeControl:o.nudgeControl,doneControl:o.doneControl,speechControl:o.speechControl,speechWaveformActive:s.waveform,speechWaveformPreview:!0,waveformButtonBackgroundOpacityPercent:a,statusControl:o.statusControl,shortcutsControl:o.shortcutsControl,actionsControl:{contextUsage:fo,btw:o.btw,send:o.send,projectQueue:o.projectQueue}})})})}function Ug({activationLabel:e,controlKey:s,onActivate:n}){const{t:a}=K(),i=l.useMemo(()=>Date.now(),[]),o=bo(i),{waveformButtonBackgroundOpacityPercent:r}=Xs(),d=xo(),u={...o.send,alternate:void 0,onSend:void 0,queue:void 0},h=s==="contextUsage"?{contextUsage:fo}:s==="btw"?{btw:o.btw}:s==="projectQueue"?{projectQueue:{...o.projectQueue,onProjectQueueNewSession:void 0},send:u}:s==="projectQueueNewSessionShortcut"?{projectQueue:{...o.projectQueue,onProjectQueue:void 0},send:u}:s==="steerNow"?{send:u}:{},f=c=>{n&&(c.key!=="Enter"&&c.key!==" "||(c.preventDefault(),n()))},p=t.jsx("div",{ref:d,className:"session-toolbar-preview-content",children:t.jsx(gi,{t:a,visibility:Rg(s),modeControl:o.modeControl,attachmentControl:o.attachmentControl,slashControl:o.slashControl,thinkingControl:o.thinkingControl,renderModeControl:o.renderModeControl,conversationViewControl:o.conversationViewControl,browserDebugControl:o.browserDebugControl,nudgeControl:o.nudgeControl,doneControl:o.doneControl,speechControl:o.speechControl,speechWaveformActive:s==="waveform",speechWaveformPreview:s==="waveform",waveformButtonBackgroundOpacityPercent:r,statusControl:o.statusControl,shortcutsControl:o.shortcutsControl,actionsControl:h})});return n?t.jsx("div",{className:"toolbar-control-preview session-toolbar-preview is-interactive","aria-label":e,onClick:n,onKeyDown:f,role:"button",tabIndex:0,children:p}):t.jsx("div",{className:"toolbar-control-preview session-toolbar-preview","aria-hidden":!0,children:p})}const Fg="_settings_7eciy_1",Bg="_sideGroups_7eciy_6",Hg="_sideGroup_7eciy_6",Wg="_sideGroupTitle_7eciy_19",$g="_sideGroupEmpty_7eciy_27",Vg="_waveformOpacityControl_7eciy_34",zg="_waveformOpacityCopy_7eciy_43",it={settings:Fg,sideGroups:Bg,sideGroup:Hg,sideGroupTitle:Wg,sideGroupEmpty:$g,waveformOpacityControl:Vg,waveformOpacityCopy:zg},Gg=["steer","queue"],Kg=["primary","alternate","microphone"],Yg=new Set(["composerRecall"]),Qg=new Set(["modeSelector","attachments","slashMenu","thinkingToggle","renderMode","conversationView","browserDebug","nudge","syntheticDone","sessionStatus","shortcutsHelp","contextUsage","btw","steerNow","projectQueue","projectQueueNewSessionShortcut"]),os=["first","mid","last","pin"];function vo(e){return`session-toolbar-presence-${e}`}function Xg(e,s,n){if(s&&n<=0)return"appearanceToolbarPresenceOffCaption";const a=n-(s?1:0);if(a<=0)return"appearanceToolbarPresenceHiddenCaption";if(!e)return"appearanceToolbarPresenceShownCaption";switch(os[a-1]){case"first":return"appearanceToolbarPresenceFirstCaption";case"mid":return"appearanceToolbarPresenceMidCaption";case"last":return"appearanceToolbarPresenceLastCaption";default:return"appearanceToolbarPresencePinCaption"}}function qg({control:e,presence:s,onCommitNotch:n}){const{t:a}=K(),[i,o]=l.useState(null),r=e.canDisable?1:0,d=(e.canSetPriority?os.length:1)+r,u=s==="off"?0:s==="hidden"?r:e.canSetPriority?r+1+Math.max(0,os.indexOf(s)):r+1,h=i??u,f=a(Xg(e.canSetPriority,e.canDisable,h)),p=vo(e.key),c=`${p}-caption`,x=()=>o(null);return t.jsxs("span",{className:"session-toolbar-presence",children:[t.jsx(Le,{id:p,className:"session-toolbar-presence-range",min:0,max:d,step:1,value:u,onDraftChange:o,onCommit:b=>{o(null),n(e,b)},onBlur:x,onKeyUp:x,onPointerUp:x,onPointerCancel:x,"aria-label":a("appearanceToolbarPresenceAria",{control:e.title}),"aria-valuetext":f,"aria-describedby":c}),t.jsx("span",{className:"session-toolbar-presence-ticks","aria-hidden":"true",children:Array.from({length:d+1},(b,v)=>t.jsx("span",{className:`session-toolbar-presence-tick${v<=h?" is-reached":""}`},v))}),t.jsxs("span",{className:"session-toolbar-presence-labels","aria-hidden":"true",children:[t.jsx("span",{children:a(e.canDisable?"appearanceToolbarOff":"appearanceToolbarHide")}),t.jsx("span",{children:a("appearanceToolbarShowAlways")})]}),t.jsx("span",{className:"session-toolbar-presence-caption",id:c,children:f})]})}function Jg(){var $,D;const{t:e}=K();_e(e("appearanceSessionToolbarTitle"));const{presence:s,setControlPresence:n,resetPresence:a}=fi(),[i]=l.useState(()=>({...s})),{settings:o,error:r,updateSettings:d}=Ce(),{version:u}=We(),{conversationViewTurnLimit:h,setConversationViewTurnLimit:f}=$l(),{waveformButtonBackgroundOpacityPercent:p,setWaveformButtonBackgroundOpacityPercent:c}=Xs(),x=mi(u),b=me(u,Er),v=me(u,kr),T=Wr(u),I=(($=o==null?void 0:o.clientDefaults)==null?void 0:$.busyComposerDefaultAction)??"steer",C=((D=o==null?void 0:o.clientDefaults)==null?void 0:D.collapsedComposerButton)??"primary",O=l.useMemo(()=>o?{toolbarPresence:s,busyComposerDefaultAction:I,collapsedComposerButton:C,conversationViewTurnLimit:h,waveformButtonBackgroundOpacityPercent:p}:null,[I,C,h,o,s,p]),k=l.useCallback(L=>{if(L){for(const[F,E]of Object.entries(L.toolbarPresence))n(F,E);f(L.conversationViewTurnLimit),c(L.waveformButtonBackgroundOpacityPercent),d({clientDefaults:{busyComposerDefaultAction:L.busyComposerDefaultAction,collapsedComposerButton:L.collapsedComposerButton}}).catch(()=>{})}},[n,f,c,d]);$e(O,k);const y=(L,F,E,V)=>({key:L,title:F,description:E,side:V,canSetPriority:Qg.has(L),canDisable:L==="syntheticDone",hasToolbarPreview:!Yg.has(L)}),S=[y("modeSelector",e("appearanceToolbarModeTitle"),e("appearanceToolbarModeDescription"),"left"),y("attachments",e("appearanceToolbarAttachmentsTitle"),e("appearanceToolbarAttachmentsDescription"),"left"),y("slashMenu",e("appearanceToolbarSlashTitle"),e("appearanceToolbarSlashDescription"),"left"),y("thinkingToggle",e("appearanceToolbarThinkingTitle"),e("appearanceToolbarThinkingDescription"),"left"),y("renderMode",e("appearanceToolbarRenderModeTitle"),e("appearanceToolbarRenderModeDescription"),"left"),y("conversationView",e("appearanceToolbarConversationViewTitle"),e("appearanceToolbarConversationViewDescription"),"left"),...b?[y("browserDebug",e("appearanceToolbarBrowserDebugTitle"),e("appearanceToolbarBrowserDebugDescription"),"left")]:[],y("nudge",e("appearanceToolbarNudgeTitle"),e("appearanceToolbarNudgeDescription"),"left"),...v?[y("syntheticDone",e("appearanceToolbarSyntheticDoneTitle"),e("appearanceToolbarSyntheticDoneDescription"),"left")]:[],y("microphone",e("appearanceToolbarMicrophoneTitle"),e("appearanceToolbarMicrophoneDescription"),"left"),y("waveform",e("appearanceToolbarWaveformTitle"),e("appearanceToolbarWaveformDescription"),"left"),y("sessionStatus",e("appearanceToolbarStatusTitle"),e("appearanceToolbarStatusDescription"),"right"),y("shortcutsHelp",e("appearanceToolbarShortcutsTitle"),e("appearanceToolbarShortcutsDescription"),"right"),y("contextUsage",e("appearanceToolbarContextTitle"),e("appearanceToolbarContextDescription"),"right"),y("btw",e("appearanceToolbarBtwTitle"),e("appearanceToolbarBtwDescription"),"right"),y("steerNow",e("appearanceToolbarSteerNowTitle"),e("appearanceToolbarSteerNowDescription"),"right"),y("composerRecall",e("appearanceToolbarComposerRecallTitle"),e("appearanceToolbarComposerRecallDescription"),"right")];x&&S.push(y("projectQueue",e("appearanceToolbarProjectQueueTitle"),e("appearanceToolbarProjectQueueDescription"),"right")),T&&S.push(y("projectQueueNewSessionShortcut",e("appearanceToolbarProjectQueueNewSessionShortcutTitle"),e("appearanceToolbarProjectQueueNewSessionShortcutDescription"),"right"));const m=S.filter(L=>(i[L.key]==="hidden"||i[L.key]==="off")&&L.side==="left"),_=S.filter(L=>(i[L.key]==="hidden"||i[L.key]==="off")&&L.side==="right"),A=S.filter(L=>i[L.key]!=="hidden"&&i[L.key]!=="off"&&L.side==="left"),P=S.filter(L=>i[L.key]!=="hidden"&&i[L.key]!=="off"&&L.side==="right"),M=l.useCallback((L,F)=>{const E=L.canDisable&&F<=0?"off":F<=(L.canDisable?1:0)?"hidden":L.canSetPriority?os[F-1-(L.canDisable?1:0)]??"pin":"pin";s[L.key]!==E&&n(L.key,E)},[n,s]),R=(L,F)=>t.jsxs("div",{className:`session-toolbar-control-row is-${F} ${s[L.key]==="hidden"||s[L.key]==="off"?"is-currently-hidden":"is-currently-shown"}`,children:[L.hasToolbarPreview&&t.jsx("span",{className:"session-toolbar-control-preview-cell",children:t.jsx(Ug,{activationLabel:e("appearanceToolbarActivateControl",{control:L.title}),controlKey:L.key,onActivate:()=>{var E;(E=document.getElementById(vo(L.key)))==null||E.focus()}})}),t.jsxs("span",{className:"session-toolbar-control-copy",children:[t.jsx("strong",{children:L.title}),t.jsx("span",{children:L.description}),L.key==="waveform"&&t.jsxs("span",{className:it.waveformOpacityControl,children:[t.jsxs("span",{className:it.waveformOpacityCopy,children:[t.jsx("strong",{children:e("appearanceToolbarWaveformButtonOpacityTitle")}),t.jsx("span",{children:e("appearanceToolbarWaveformButtonOpacityDescription")})]}),t.jsx(ot,{id:"waveform-control-background-opacity",min:_l,max:kl,step:El,value:p,unit:e("appearanceToolbarWaveformButtonOpacityUnit"),ariaLabel:e("appearanceToolbarWaveformButtonOpacityTitle"),onCommit:c})]})]}),t.jsx("span",{className:"session-toolbar-control-actions",children:t.jsx(qg,{control:L,presence:s[L.key],onCommitNotch:M})})]},L.key),N=(L,F,E)=>t.jsxs("div",{className:it.sideGroup,children:[t.jsx("div",{className:it.sideGroupTitle,children:L}),F.length===0&&E==="hidden"?t.jsx("p",{className:it.sideGroupEmpty,children:e("appearanceToolbarSideNoneHidden")}):F.map(V=>R(V,E))]});return t.jsx(oe,{description:e("appearanceSessionToolbarDescription"),children:t.jsxs("div",{className:"settings-group",children:[t.jsx(w,{label:e("appearanceToolbarDefaultActionTitle"),description:e("appearanceToolbarDefaultActionDescription"),children:t.jsxs("select",{className:"settings-select",value:I,onChange:L=>{const F=L.target.value;Gg.includes(F)&&d({clientDefaults:{busyComposerDefaultAction:F}}).catch(()=>{})},"aria-label":e("appearanceToolbarDefaultActionTitle"),children:[t.jsx("option",{value:"steer",children:e("appearanceToolbarDefaultActionSteer")}),t.jsx("option",{value:"queue",children:e("appearanceToolbarDefaultActionQueue")})]})}),t.jsx(w,{label:e("appearanceToolbarCollapsedButtonTitle"),description:e("appearanceToolbarCollapsedButtonDescription"),children:t.jsxs("select",{className:"settings-select",value:C,onChange:L=>{const F=L.target.value;Kg.includes(F)&&d({clientDefaults:{collapsedComposerButton:F}}).catch(()=>{})},"aria-label":e("appearanceToolbarCollapsedButtonTitle"),children:[t.jsx("option",{value:"primary",children:e("appearanceToolbarCollapsedButtonPrimary")}),t.jsx("option",{value:"alternate",children:e("appearanceToolbarCollapsedButtonAlternate")}),t.jsx("option",{value:"microphone",children:e("appearanceToolbarCollapsedButtonMicrophone")})]})}),t.jsx(w,{label:e("appearanceToolbarConversationViewTurnLimitTitle"),description:e("appearanceToolbarConversationViewTurnLimitDescription"),className:"settings-item--wide-control",children:t.jsx(ot,{id:"conversation-view-turn-limit",min:Gl,max:zl,step:Vl,value:h,unit:e("appearanceToolbarConversationViewTurnLimitUnit"),ariaLabel:e("appearanceToolbarConversationViewTurnLimitTitle"),onCommit:f})}),t.jsxs(w,{label:e("appearanceSessionToolbarTitle"),description:e("appearanceSessionToolbarDescription"),keywords:S.flatMap(L=>[L.title,L.description]),layout:"custom",className:it.settings,children:[t.jsx(Og,{}),t.jsxs("div",{className:"session-toolbar-zone",children:[t.jsxs("div",{className:"session-toolbar-zone-heading",children:[t.jsx("strong",{children:e("appearanceToolbarHiddenHeading")}),t.jsx("span",{children:e("appearanceToolbarHiddenDescription")})]}),t.jsxs("div",{className:it.sideGroups,children:[N(e("appearanceToolbarSideLeft"),m,"hidden"),N(e("appearanceToolbarSideRight"),_,"hidden")]})]}),t.jsx("div",{className:"session-toolbar-zone-separator"}),t.jsxs("div",{className:"session-toolbar-zone",children:[t.jsxs("div",{className:"session-toolbar-zone-heading",children:[t.jsx("strong",{children:e("appearanceToolbarShownHeading")}),t.jsx("span",{children:e("appearanceToolbarShownDescription")})]}),t.jsxs("div",{className:it.sideGroups,children:[N(e("appearanceToolbarSideLeft"),A,"shown"),N(e("appearanceToolbarSideRight"),P,"shown")]})]}),t.jsx("div",{className:"settings-item-actions",children:t.jsx("button",{type:"button",className:"settings-button settings-button-secondary",onClick:()=>{a()},children:e("appearanceSessionToolbarReset")})})]}),r&&t.jsx("p",{className:"settings-warning",children:r})]})})}const oi={appearance:ru,performance:Wm,toolbar:Jg,model:Em,"cache-miss-billing":Cp,"message-delivery":gm,"source-control":Cg,storage:Ig,"agent-context":Qd,notifications:Hm,webhooks:im,devices:Rp,"local-access":pm,remote:Vh,providers:ih,speech:wg,"remote-executors":ig,emulator:Bp,environment:em,about:Gd,development:Ep},Zg=700;function ef(e){return e>=Zg}function So(e){return!!e&&typeof e=="object"}function tf(e){return e?{settingsDetailOpenedFromList:!0}:void 0}function ri(e){return So(e)&&e.settingsDetailOpenedFromList===!0}function sf({currentCategory:e,useTwoColumnSettings:s}){return s&&!!e}function nf(){return typeof window>"u"?1200:window.innerWidth}function af(){const[e,s]=l.useState(null),[n,a]=l.useState(nf);return l.useLayoutEffect(()=>{if(!e)return;const i=()=>{a(e.clientWidth)};if(i(),typeof ResizeObserver>"u")return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i);const o=new ResizeObserver(i);return o.observe(e),()=>o.disconnect()},[e]),[s,n]}function of(e){if(typeof e.scrollTo=="function"){e.scrollTo({top:0,behavior:"auto"});return}e.scrollTop=0}function Qf(){var Te;const{t:e}=K(),{category:s}=ir(),n=li(),a=or(),i=rs(),{openSidebar:o,isWideScreen:r,toggleSidebar:d,isSidebarCollapsed:u}=$r(),[h,f]=af(),p=l.useRef(null),c=ef(f),{version:x}=We(),b=me(x,_r),{registration:v,setRegistration:T}=Kd(),{title:I,setTitle:C}=Vd(),[O,k]=l.useState(""),[y,S]=mg(),m=l.useDeferredValue(O.trim()),_=O.trim()!=="",[A,P]=l.useState(null);l.useEffect(()=>{const G=a.state;So(G)&&typeof G.settingsJumpTarget=="string"&&P(G.settingsJumpTarget)},[a.state]);const M=l.useCallback(()=>P(null),[]),R=l.useMemo(()=>({target:A,consume:M}),[A,M]),N=[...Zc(G=>e(G))];if(!me(x,di)){const G=N.findIndex(ie=>ie.id==="source-control");G>=0&&N.splice(G,1)}if(me(x,Mr)||me(x,Ar)||me(x,Dr)){const G=N.findIndex(ie=>ie.id==="about");N.splice(G>=0?G:N.length,0,ed(ie=>e(ie)))}const $=s||(c?(Te=N[0])==null?void 0:Te.id:void 0),D=l.useCallback(G=>{p.current=G},[]),L=l.useCallback(()=>{const G=p.current;G&&of(G)},[]);l.useLayoutEffect(()=>{a.key,L()},[a.key,L]);const F=()=>{ri(a.state)?n(-1):n(`${i}/settings`,{replace:!!s}),L()},E=()=>{if(s){F();return}n(`${i}/settings`,{replace:!0}),L()},V=(G,ie)=>{k("");const ce=!s||ri(a.state),Ae=tf(ce);n(`${i}/settings/${G}`,{replace:sf({currentCategory:s,useTwoColumnSettings:c}),state:ie?{...Ae,settingsJumpTarget:ie}:Ae})},te=G=>{V(G)},ne=(G,ie)=>{V(G,ie)},ae=t.jsx(hg,{query:O,onQueryChange:k,matchValues:y,onMatchValuesChange:S}),Z=_?t.jsx(xg,{categories:N,components:oi,query:m||O.trim(),matchValues:y,onJumpToItem:ne,onOpenCategory:te}):null,ee=()=>{F()},xe=$?oi[$]:null,z=N.find(G=>G.id===$),re=I??(z==null?void 0:z.label)??e("pageTitleSettings"),Ne=$==="model"?e("modelSettingsSessionDefaultsDescription"):null,pe=t.jsxs("span",{className:"settings-breadcrumb",children:[t.jsx("button",{type:"button",className:"session-title settings-breadcrumb-root",onClick:E,children:e("pageTitleSettings")}),t.jsx("span",{className:"settings-breadcrumb-sep","aria-hidden":"true",children:"›"}),t.jsx("span",{className:"settings-breadcrumb-current",children:re}),Ne&&t.jsx("span",{className:"settings-breadcrumb-description",children:Ne})]}),ge=t.jsx(Tg,{registration:v,paneTitle:re});return c?t.jsxs(bs,{isWideScreen:r,innerRef:h,children:[t.jsx(fs,{title:re,titleElement:pe,onOpenSidebar:o,onToggleSidebar:d,isWideScreen:r,isSidebarCollapsed:u,actions:ge}),t.jsx("main",{ref:D,className:"page-scroll-container",children:t.jsxs("div",{className:"settings-two-column",children:[t.jsxs("nav",{className:"settings-category-nav",children:[ae,t.jsxs("div",{className:"settings-category-list",children:[N.map(G=>t.jsx(Qs,{category:G,isActive:!_&&$===G.id,onClick:()=>V(G.id)},G.id)),b&&t.jsx(ii,{})]})]}),t.jsx("div",{className:"settings-content-panel",children:Z??t.jsx(Da,{value:R,children:t.jsx(Hs,{value:C,children:t.jsx(Ws,{value:T,children:xe&&t.jsx(xe,{})})})})})]})})]}):s?t.jsxs(bs,{isWideScreen:r,innerRef:h,children:[t.jsx(fs,{title:re,onOpenSidebar:o,showBack:!0,onBack:ee,actions:ge}),t.jsx("main",{ref:D,className:"page-scroll-container",children:t.jsx("div",{className:"page-content-inner",children:t.jsx(Da,{value:R,children:t.jsx(Hs,{value:C,children:t.jsx(Ws,{value:T,children:xe&&t.jsx(xe,{})})})})})})]}):t.jsxs(bs,{isWideScreen:r,innerRef:h,children:[t.jsx(fs,{title:e("pageTitleSettings"),onTitleClick:E,onOpenSidebar:o,onToggleSidebar:d,isWideScreen:r,isSidebarCollapsed:u}),t.jsx("main",{ref:D,className:"page-scroll-container",children:t.jsxs("div",{className:"page-content-inner settings-category-list-shell",children:[ae,Z??t.jsxs("div",{className:"settings-category-list",children:[N.map(G=>t.jsx(Qs,{category:G,isActive:!1,onClick:()=>V(G.id)},G.id)),b&&t.jsx(ii,{})]})]})})]})}export{Qf as SettingsLayout};