@kaitranntt/ccs 8.2.0 → 8.3.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 (301) hide show
  1. package/README.md +12 -0
  2. package/config/base-claude.settings.json +1 -5
  3. package/dist/api/services/cliproxy-profile-bridge.d.ts.map +1 -1
  4. package/dist/api/services/cliproxy-profile-bridge.js +6 -0
  5. package/dist/api/services/cliproxy-profile-bridge.js.map +1 -1
  6. package/dist/api/services/profile-writer.d.ts.map +1 -1
  7. package/dist/api/services/profile-writer.js +18 -8
  8. package/dist/api/services/profile-writer.js.map +1 -1
  9. package/dist/auth/commands/create-command.d.ts.map +1 -1
  10. package/dist/auth/commands/create-command.js +11 -0
  11. package/dist/auth/commands/create-command.js.map +1 -1
  12. package/dist/cliproxy/accounts/account-safety-cross-lane.d.ts +41 -0
  13. package/dist/cliproxy/accounts/account-safety-cross-lane.d.ts.map +1 -0
  14. package/dist/cliproxy/accounts/account-safety-cross-lane.js +177 -0
  15. package/dist/cliproxy/accounts/account-safety-cross-lane.js.map +1 -0
  16. package/dist/cliproxy/accounts/account-safety.d.ts +29 -1
  17. package/dist/cliproxy/accounts/account-safety.d.ts.map +1 -1
  18. package/dist/cliproxy/accounts/account-safety.js +41 -7
  19. package/dist/cliproxy/accounts/account-safety.js.map +1 -1
  20. package/dist/cliproxy/accounts/drain-order.d.ts +277 -0
  21. package/dist/cliproxy/accounts/drain-order.d.ts.map +1 -0
  22. package/dist/cliproxy/accounts/drain-order.js +575 -0
  23. package/dist/cliproxy/accounts/drain-order.js.map +1 -0
  24. package/dist/cliproxy/accounts/pool-state.d.ts +132 -0
  25. package/dist/cliproxy/accounts/pool-state.d.ts.map +1 -0
  26. package/dist/cliproxy/accounts/pool-state.js +201 -0
  27. package/dist/cliproxy/accounts/pool-state.js.map +1 -0
  28. package/dist/cliproxy/accounts/registry.d.ts +17 -1
  29. package/dist/cliproxy/accounts/registry.d.ts.map +1 -1
  30. package/dist/cliproxy/accounts/registry.js +47 -1
  31. package/dist/cliproxy/accounts/registry.js.map +1 -1
  32. package/dist/cliproxy/accounts/types.d.ts +20 -0
  33. package/dist/cliproxy/accounts/types.d.ts.map +1 -1
  34. package/dist/cliproxy/auth/oauth-handler.d.ts.map +1 -1
  35. package/dist/cliproxy/auth/oauth-handler.js +29 -0
  36. package/dist/cliproxy/auth/oauth-handler.js.map +1 -1
  37. package/dist/cliproxy/claude-shadow-warning.d.ts +39 -0
  38. package/dist/cliproxy/claude-shadow-warning.d.ts.map +1 -0
  39. package/dist/cliproxy/claude-shadow-warning.js +187 -0
  40. package/dist/cliproxy/claude-shadow-warning.js.map +1 -0
  41. package/dist/cliproxy/config/base-config-loader.d.ts +6 -5
  42. package/dist/cliproxy/config/base-config-loader.d.ts.map +1 -1
  43. package/dist/cliproxy/config/base-config-loader.js +19 -12
  44. package/dist/cliproxy/config/base-config-loader.js.map +1 -1
  45. package/dist/cliproxy/config/env-builder.d.ts +3 -0
  46. package/dist/cliproxy/config/env-builder.d.ts.map +1 -1
  47. package/dist/cliproxy/config/env-builder.js +158 -20
  48. package/dist/cliproxy/config/env-builder.js.map +1 -1
  49. package/dist/cliproxy/config/generator.d.ts +2 -1
  50. package/dist/cliproxy/config/generator.d.ts.map +1 -1
  51. package/dist/cliproxy/config/generator.js +66 -9
  52. package/dist/cliproxy/config/generator.js.map +1 -1
  53. package/dist/cliproxy/config/thinking-config.d.ts.map +1 -1
  54. package/dist/cliproxy/config/thinking-config.js +2 -0
  55. package/dist/cliproxy/config/thinking-config.js.map +1 -1
  56. package/dist/cliproxy/executor/account-resolution.d.ts.map +1 -1
  57. package/dist/cliproxy/executor/account-resolution.js +5 -0
  58. package/dist/cliproxy/executor/account-resolution.js.map +1 -1
  59. package/dist/cliproxy/executor/auth-coordinator.d.ts +4 -0
  60. package/dist/cliproxy/executor/auth-coordinator.d.ts.map +1 -1
  61. package/dist/cliproxy/executor/auth-coordinator.js +5 -1
  62. package/dist/cliproxy/executor/auth-coordinator.js.map +1 -1
  63. package/dist/cliproxy/executor/index.d.ts.map +1 -1
  64. package/dist/cliproxy/executor/index.js +20 -0
  65. package/dist/cliproxy/executor/index.js.map +1 -1
  66. package/dist/cliproxy/model-catalog.d.ts.map +1 -1
  67. package/dist/cliproxy/model-catalog.js +15 -0
  68. package/dist/cliproxy/model-catalog.js.map +1 -1
  69. package/dist/cliproxy/proxy/upstream-response-timeout.d.ts.map +1 -1
  70. package/dist/cliproxy/proxy/upstream-response-timeout.js +8 -1
  71. package/dist/cliproxy/proxy/upstream-response-timeout.js.map +1 -1
  72. package/dist/cliproxy/quota/quota-fetcher-claude.d.ts +9 -0
  73. package/dist/cliproxy/quota/quota-fetcher-claude.d.ts.map +1 -1
  74. package/dist/cliproxy/quota/quota-fetcher-claude.js +53 -16
  75. package/dist/cliproxy/quota/quota-fetcher-claude.js.map +1 -1
  76. package/dist/cliproxy/quota/quota-fetcher.d.ts.map +1 -1
  77. package/dist/cliproxy/quota/quota-fetcher.js +4 -0
  78. package/dist/cliproxy/quota/quota-fetcher.js.map +1 -1
  79. package/dist/cliproxy/quota/quota-manager.d.ts +7 -0
  80. package/dist/cliproxy/quota/quota-manager.d.ts.map +1 -1
  81. package/dist/cliproxy/quota/quota-manager.js +51 -2
  82. package/dist/cliproxy/quota/quota-manager.js.map +1 -1
  83. package/dist/cliproxy/routing/pool-onboarding-hint.d.ts +95 -0
  84. package/dist/cliproxy/routing/pool-onboarding-hint.d.ts.map +1 -0
  85. package/dist/cliproxy/routing/pool-onboarding-hint.js +172 -0
  86. package/dist/cliproxy/routing/pool-onboarding-hint.js.map +1 -0
  87. package/dist/cliproxy/routing/pool-opt-in-prompt.d.ts +50 -0
  88. package/dist/cliproxy/routing/pool-opt-in-prompt.d.ts.map +1 -0
  89. package/dist/cliproxy/routing/pool-opt-in-prompt.js +232 -0
  90. package/dist/cliproxy/routing/pool-opt-in-prompt.js.map +1 -0
  91. package/dist/cliproxy/routing/routing-strategy.d.ts +132 -0
  92. package/dist/cliproxy/routing/routing-strategy.d.ts.map +1 -1
  93. package/dist/cliproxy/routing/routing-strategy.js +342 -5
  94. package/dist/cliproxy/routing/routing-strategy.js.map +1 -1
  95. package/dist/cliproxy/services/stats-fetcher.d.ts +13 -0
  96. package/dist/cliproxy/services/stats-fetcher.d.ts.map +1 -1
  97. package/dist/cliproxy/services/stats-fetcher.js +25 -1
  98. package/dist/cliproxy/services/stats-fetcher.js.map +1 -1
  99. package/dist/commands/bar/help-subcommand.d.ts +2 -0
  100. package/dist/commands/bar/help-subcommand.d.ts.map +1 -0
  101. package/dist/commands/bar/help-subcommand.js +63 -0
  102. package/dist/commands/bar/help-subcommand.js.map +1 -0
  103. package/dist/commands/bar/index.d.ts +8 -0
  104. package/dist/commands/bar/index.d.ts.map +1 -0
  105. package/dist/commands/bar/index.js +78 -0
  106. package/dist/commands/bar/index.js.map +1 -0
  107. package/dist/commands/bar/install-subcommand.d.ts +92 -0
  108. package/dist/commands/bar/install-subcommand.d.ts.map +1 -0
  109. package/dist/commands/bar/install-subcommand.js +605 -0
  110. package/dist/commands/bar/install-subcommand.js.map +1 -0
  111. package/dist/commands/bar/launch-subcommand.d.ts +64 -0
  112. package/dist/commands/bar/launch-subcommand.d.ts.map +1 -0
  113. package/dist/commands/bar/launch-subcommand.js +236 -0
  114. package/dist/commands/bar/launch-subcommand.js.map +1 -0
  115. package/dist/commands/bar/uninstall-subcommand.d.ts +13 -0
  116. package/dist/commands/bar/uninstall-subcommand.d.ts.map +1 -0
  117. package/dist/commands/bar/uninstall-subcommand.js +78 -0
  118. package/dist/commands/bar/uninstall-subcommand.js.map +1 -0
  119. package/dist/commands/bar/version-subcommand.d.ts +8 -0
  120. package/dist/commands/bar/version-subcommand.d.ts.map +1 -0
  121. package/dist/commands/bar/version-subcommand.js +62 -0
  122. package/dist/commands/bar/version-subcommand.js.map +1 -0
  123. package/dist/commands/cliproxy/help-subcommand.d.ts.map +1 -1
  124. package/dist/commands/cliproxy/help-subcommand.js +20 -1
  125. package/dist/commands/cliproxy/help-subcommand.js.map +1 -1
  126. package/dist/commands/cliproxy/index.d.ts.map +1 -1
  127. package/dist/commands/cliproxy/index.js +20 -0
  128. package/dist/commands/cliproxy/index.js.map +1 -1
  129. package/dist/commands/cliproxy/order-subcommand.d.ts +16 -0
  130. package/dist/commands/cliproxy/order-subcommand.d.ts.map +1 -0
  131. package/dist/commands/cliproxy/order-subcommand.js +520 -0
  132. package/dist/commands/cliproxy/order-subcommand.js.map +1 -0
  133. package/dist/commands/cliproxy/pool-state-renderer.d.ts +40 -0
  134. package/dist/commands/cliproxy/pool-state-renderer.d.ts.map +1 -0
  135. package/dist/commands/cliproxy/pool-state-renderer.js +220 -0
  136. package/dist/commands/cliproxy/pool-state-renderer.js.map +1 -0
  137. package/dist/commands/cliproxy/pool-subcommand.d.ts +10 -0
  138. package/dist/commands/cliproxy/pool-subcommand.d.ts.map +1 -0
  139. package/dist/commands/cliproxy/pool-subcommand.js +112 -0
  140. package/dist/commands/cliproxy/pool-subcommand.js.map +1 -0
  141. package/dist/commands/cliproxy/quota-subcommand.d.ts.map +1 -1
  142. package/dist/commands/cliproxy/quota-subcommand.js +7 -0
  143. package/dist/commands/cliproxy/quota-subcommand.js.map +1 -1
  144. package/dist/commands/cliproxy/routing-subcommand.d.ts.map +1 -1
  145. package/dist/commands/cliproxy/routing-subcommand.js +19 -0
  146. package/dist/commands/cliproxy/routing-subcommand.js.map +1 -1
  147. package/dist/commands/command-catalog.d.ts.map +1 -1
  148. package/dist/commands/command-catalog.js +7 -0
  149. package/dist/commands/command-catalog.js.map +1 -1
  150. package/dist/commands/help-command.d.ts.map +1 -1
  151. package/dist/commands/help-command.js +6 -1
  152. package/dist/commands/help-command.js.map +1 -1
  153. package/dist/commands/root-command-router.d.ts.map +1 -1
  154. package/dist/commands/root-command-router.js +7 -0
  155. package/dist/commands/root-command-router.js.map +1 -1
  156. package/dist/config/loader/yaml-serializer.d.ts.map +1 -1
  157. package/dist/config/loader/yaml-serializer.js +13 -0
  158. package/dist/config/loader/yaml-serializer.js.map +1 -1
  159. package/dist/config/schemas/cliproxy.d.ts +37 -0
  160. package/dist/config/schemas/cliproxy.d.ts.map +1 -1
  161. package/dist/config/schemas/quota.d.ts +26 -2
  162. package/dist/config/schemas/quota.d.ts.map +1 -1
  163. package/dist/config/schemas/quota.js +20 -1
  164. package/dist/config/schemas/quota.js.map +1 -1
  165. package/dist/config/unified-config-loader.d.ts.map +1 -1
  166. package/dist/config/unified-config-loader.js +3 -0
  167. package/dist/config/unified-config-loader.js.map +1 -1
  168. package/dist/dispatcher/flows/account-flow.d.ts.map +1 -1
  169. package/dist/dispatcher/flows/account-flow.js +9 -0
  170. package/dist/dispatcher/flows/account-flow.js.map +1 -1
  171. package/dist/glmt/delta-accumulator.d.ts.map +1 -1
  172. package/dist/glmt/delta-accumulator.js +1 -0
  173. package/dist/glmt/delta-accumulator.js.map +1 -1
  174. package/dist/management/doctor.d.ts.map +1 -1
  175. package/dist/management/doctor.js +10 -0
  176. package/dist/management/doctor.js.map +1 -1
  177. package/dist/proxy/profile-router.d.ts +14 -0
  178. package/dist/proxy/profile-router.d.ts.map +1 -1
  179. package/dist/proxy/profile-router.js +1 -0
  180. package/dist/proxy/profile-router.js.map +1 -1
  181. package/dist/proxy/server/http-helpers.d.ts +5 -0
  182. package/dist/proxy/server/http-helpers.d.ts.map +1 -1
  183. package/dist/proxy/server/http-helpers.js +40 -1
  184. package/dist/proxy/server/http-helpers.js.map +1 -1
  185. package/dist/proxy/server/messages-route.d.ts.map +1 -1
  186. package/dist/proxy/server/messages-route.js +173 -10
  187. package/dist/proxy/server/messages-route.js.map +1 -1
  188. package/dist/proxy/upstream-url.d.ts +42 -2
  189. package/dist/proxy/upstream-url.d.ts.map +1 -1
  190. package/dist/proxy/upstream-url.js +83 -4
  191. package/dist/proxy/upstream-url.js.map +1 -1
  192. package/dist/ui/assets/{Trans-DsGR5Bhb.js → Trans-RG_sMDEu.js} +1 -1
  193. package/dist/ui/assets/accounts-yTXURc-q.js +1 -0
  194. package/dist/ui/assets/{alert-dialog-Do0XfN46.js → alert-dialog-DjvPgzFs.js} +1 -1
  195. package/dist/ui/assets/{api-B7OYas_V.js → api-Ck1dtNEM.js} +3 -3
  196. package/dist/ui/assets/{auth-section-BmTeNetL.js → auth-section-DBnY_LPz.js} +1 -1
  197. package/dist/ui/assets/{backups-section-COawLfTr.js → backups-section-Ci-uL4Of.js} +1 -1
  198. package/dist/ui/assets/{channels-C9LVYmNJ.js → channels-BeS9O5q0.js} +1 -1
  199. package/dist/ui/assets/{checkbox-BkFzg8C-.js → checkbox-DFeFDZBp.js} +1 -1
  200. package/dist/ui/assets/{claude-extension-Ch7L4lTF.js → claude-extension-DS5qN19Z.js} +1 -1
  201. package/dist/ui/assets/{cliproxy-B3uWt6gn.js → cliproxy-D7HJH4mZ.js} +1 -1
  202. package/dist/ui/assets/{cliproxy-ai-providers-Bn1_AdKD.js → cliproxy-ai-providers-oJQZXrtc.js} +1 -1
  203. package/dist/ui/assets/{cliproxy-control-panel-DC4pOOfY.js → cliproxy-control-panel-2mRPEcRj.js} +1 -1
  204. package/dist/ui/assets/codex-D0AUQ6jA.js +30 -0
  205. package/dist/ui/assets/{confirm-dialog-4rb-E8-R.js → confirm-dialog-B37-CVuq.js} +1 -1
  206. package/dist/ui/assets/{copilot-zgPXNkMw.js → copilot-KaaW-mko.js} +2 -2
  207. package/dist/ui/assets/{cursor-lRPpppk-.js → cursor-BKiTgYi5.js} +1 -1
  208. package/dist/ui/assets/{droid-koOj34SB.js → droid-DHdqGnFw.js} +2 -2
  209. package/dist/ui/assets/{globalenv-section-jOkPVwvN.js → globalenv-section-SfZO97nU.js} +1 -1
  210. package/dist/ui/assets/health-CSRS9O0D.js +1 -0
  211. package/dist/ui/assets/icons-DSLG1YsC.js +1 -0
  212. package/dist/ui/assets/{index-D7crOfea.js → index-CGgavq2X.js} +37 -37
  213. package/dist/ui/assets/{index-BLC5PyZn.js → index-ChTYEBCZ.js} +1 -1
  214. package/dist/ui/assets/index-Cu_F55_O.js +1 -0
  215. package/dist/ui/assets/{index-CRhKyfnS.js → index-DJ66NrBH.js} +1 -1
  216. package/dist/ui/assets/index-DWUuSBUe.js +1 -0
  217. package/dist/ui/assets/{index-BK-PSsqi.js → index-DycwEe96.js} +1 -1
  218. package/dist/ui/assets/index-DzFlVVV3.css +1 -0
  219. package/dist/ui/assets/{index-De3yNJ94.js → index-iQuEEGbH.js} +1 -1
  220. package/dist/ui/assets/{logs-BplpQHRb.js → logs-tiZ_51mo.js} +1 -1
  221. package/dist/ui/assets/{masked-input-DuLL3EwS.js → masked-input-D9FVoeMA.js} +1 -1
  222. package/dist/ui/assets/proxy-status-widget-2k26d8pS.js +1 -0
  223. package/dist/ui/assets/{raw-json-settings-editor-panel-ClPqZ6iZ.js → raw-json-settings-editor-panel-CguBh93H.js} +1 -1
  224. package/dist/ui/assets/{searchable-select-BH1b065u.js → searchable-select-C4wShshD.js} +1 -1
  225. package/dist/ui/assets/{separator-BOiJ0l4s.js → separator-mvGlDdEW.js} +1 -1
  226. package/dist/ui/assets/{shared-CunXigZu.js → shared-Ck0yAwbs.js} +1 -1
  227. package/dist/ui/assets/{table-C7ysR1Xz.js → table-DrUJOxKL.js} +1 -1
  228. package/dist/ui/assets/updates-BVHBFcq8.js +1 -0
  229. package/dist/ui/assets/{use-accounts-CwRU3ln9.js → use-accounts-DLtuaniS.js} +1 -1
  230. package/dist/ui/index.html +3 -3
  231. package/dist/utils/browser/mcp-installer.d.ts.map +1 -1
  232. package/dist/utils/browser/mcp-installer.js +5 -34
  233. package/dist/utils/browser/mcp-installer.js.map +1 -1
  234. package/dist/utils/claude-user-config-lock.d.ts +9 -0
  235. package/dist/utils/claude-user-config-lock.d.ts.map +1 -0
  236. package/dist/utils/claude-user-config-lock.js +96 -0
  237. package/dist/utils/claude-user-config-lock.js.map +1 -0
  238. package/dist/utils/image-analysis/mcp-installer.d.ts.map +1 -1
  239. package/dist/utils/image-analysis/mcp-installer.js +5 -34
  240. package/dist/utils/image-analysis/mcp-installer.js.map +1 -1
  241. package/dist/utils/websearch/mcp-installer.d.ts.map +1 -1
  242. package/dist/utils/websearch/mcp-installer.js +112 -78
  243. package/dist/utils/websearch/mcp-installer.js.map +1 -1
  244. package/dist/web-server/model-pricing.d.ts.map +1 -1
  245. package/dist/web-server/model-pricing.js +7 -0
  246. package/dist/web-server/model-pricing.js.map +1 -1
  247. package/dist/web-server/routes/account-routes.d.ts.map +1 -1
  248. package/dist/web-server/routes/account-routes.js +116 -0
  249. package/dist/web-server/routes/account-routes.js.map +1 -1
  250. package/dist/web-server/routes/bar-routes.d.ts +149 -0
  251. package/dist/web-server/routes/bar-routes.d.ts.map +1 -0
  252. package/dist/web-server/routes/bar-routes.js +415 -0
  253. package/dist/web-server/routes/bar-routes.js.map +1 -0
  254. package/dist/web-server/routes/index.d.ts.map +1 -1
  255. package/dist/web-server/routes/index.js +18 -0
  256. package/dist/web-server/routes/index.js.map +1 -1
  257. package/dist/web-server/usage/bar-analytics.d.ts +101 -0
  258. package/dist/web-server/usage/bar-analytics.d.ts.map +1 -0
  259. package/dist/web-server/usage/bar-analytics.js +315 -0
  260. package/dist/web-server/usage/bar-analytics.js.map +1 -0
  261. package/dist/web-server/usage/claude-native-credentials.d.ts +56 -0
  262. package/dist/web-server/usage/claude-native-credentials.d.ts.map +1 -0
  263. package/dist/web-server/usage/claude-native-credentials.js +140 -0
  264. package/dist/web-server/usage/claude-native-credentials.js.map +1 -0
  265. package/dist/web-server/usage/cliproxy-snapshot-reader.d.ts +24 -0
  266. package/dist/web-server/usage/cliproxy-snapshot-reader.d.ts.map +1 -0
  267. package/dist/web-server/usage/cliproxy-snapshot-reader.js +82 -0
  268. package/dist/web-server/usage/cliproxy-snapshot-reader.js.map +1 -0
  269. package/dist/web-server/usage/cliproxy-usage-syncer.d.ts +3 -2
  270. package/dist/web-server/usage/cliproxy-usage-syncer.d.ts.map +1 -1
  271. package/dist/web-server/usage/cliproxy-usage-syncer.js +14 -2
  272. package/dist/web-server/usage/cliproxy-usage-syncer.js.map +1 -1
  273. package/dist/web-server/usage/cliproxy-usage-transformer.d.ts +8 -1
  274. package/dist/web-server/usage/cliproxy-usage-transformer.d.ts.map +1 -1
  275. package/dist/web-server/usage/cliproxy-usage-transformer.js +31 -4
  276. package/dist/web-server/usage/cliproxy-usage-transformer.js.map +1 -1
  277. package/dist/web-server/usage/codex-local-quota-collector.d.ts +74 -0
  278. package/dist/web-server/usage/codex-local-quota-collector.d.ts.map +1 -0
  279. package/dist/web-server/usage/codex-local-quota-collector.js +250 -0
  280. package/dist/web-server/usage/codex-local-quota-collector.js.map +1 -0
  281. package/dist/web-server/usage/data-aggregator.d.ts +11 -0
  282. package/dist/web-server/usage/data-aggregator.d.ts.map +1 -1
  283. package/dist/web-server/usage/data-aggregator.js +29 -1
  284. package/dist/web-server/usage/data-aggregator.js.map +1 -1
  285. package/dist/web-server/usage/native-quota-collector.d.ts +44 -0
  286. package/dist/web-server/usage/native-quota-collector.d.ts.map +1 -0
  287. package/dist/web-server/usage/native-quota-collector.js +378 -0
  288. package/dist/web-server/usage/native-quota-collector.js.map +1 -0
  289. package/dist/web-server/usage/types.d.ts +2 -0
  290. package/dist/web-server/usage/types.d.ts.map +1 -1
  291. package/package.json +1 -1
  292. package/scripts/run-test-bucket.js +183 -17
  293. package/dist/ui/assets/accounts-DHBmHeH-.js +0 -1
  294. package/dist/ui/assets/codex-CcODhykP.js +0 -30
  295. package/dist/ui/assets/health-CxHauE3Y.js +0 -1
  296. package/dist/ui/assets/icons-DzKUh8vG.js +0 -1
  297. package/dist/ui/assets/index-DOfPoKe_.css +0 -1
  298. package/dist/ui/assets/index-DUGnoURR.js +0 -1
  299. package/dist/ui/assets/index-I_ek1xyD.js +0 -1
  300. package/dist/ui/assets/proxy-status-widget-BruRPTSl.js +0 -1
  301. package/dist/ui/assets/updates-BtBCV2xk.js +0 -1
@@ -1,3 +1,43 @@
1
- export declare function resolveOpenAIChatCompletionsUrl(baseUrl: string): string;
2
- export declare function resolveOpenAIModelsUrl(baseUrl: string): string;
1
+ /**
2
+ * Resolve upstream URLs for OpenAI-compat proxy requests.
3
+ *
4
+ * Two modes are supported:
5
+ *
6
+ * 1. Default (OpenAI mode) - appends `/chat/completions` or `/models` to the
7
+ * base URL so requests are routed to the OpenAI-compatible endpoint of the
8
+ * upstream provider.
9
+ *
10
+ * 2. Anthropic passthrough - some providers (e.g. Kimi coding endpoints)
11
+ * expose an Anthropic-compatible `/v1/messages` endpoint and reject
12
+ * OpenAI-format requests. For these profiles we preserve the incoming
13
+ * Anthropic body and forward it directly to the provider's
14
+ * `/v1/messages` endpoint.
15
+ *
16
+ * Passthrough is enabled when:
17
+ * - `CCS_OPENAI_PROXY_PASSTHROUGH=1` is set in the profile env, OR
18
+ * - The base URL is a known Anthropic-style provider host.
19
+ */
20
+ /**
21
+ * Returns true if the profile should pass Anthropic-format requests through
22
+ * directly to the upstream provider, skipping the OpenAI translation.
23
+ */
24
+ export declare function isAnthropicPassthroughProfile(baseUrl: string, options?: {
25
+ forcePassthrough?: boolean;
26
+ }): boolean;
27
+ /**
28
+ * Resolve the upstream URL for a chat completions request.
29
+ *
30
+ * For OpenAI-compatible providers this resolves to
31
+ * `<base>/v1/chat/completions`. For Anthropic passthrough providers this
32
+ * resolves to `<base>/v1/messages`.
33
+ */
34
+ export declare function resolveOpenAIChatCompletionsUrl(baseUrl: string, options?: {
35
+ passthrough?: boolean;
36
+ }): string;
37
+ /**
38
+ * Resolve the upstream URL for the models endpoint.
39
+ */
40
+ export declare function resolveOpenAIModelsUrl(baseUrl: string, options?: {
41
+ passthrough?: boolean;
42
+ }): string;
3
43
  //# sourceMappingURL=upstream-url.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"upstream-url.d.ts","sourceRoot":"","sources":["../../src/proxy/upstream-url.ts"],"names":[],"mappings":"AAuCA,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEvE;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE9D"}
1
+ {"version":3,"file":"upstream-url.d.ts","sourceRoot":"","sources":["../../src/proxy/upstream-url.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AA4BH;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAO,GAC3C,OAAO,CAYT;AAiDD;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO,GACtC,MAAM,CAKR;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO,GACtC,MAAM,CAKR"}
@@ -1,6 +1,25 @@
1
1
  "use strict";
2
+ /**
3
+ * Resolve upstream URLs for OpenAI-compat proxy requests.
4
+ *
5
+ * Two modes are supported:
6
+ *
7
+ * 1. Default (OpenAI mode) - appends `/chat/completions` or `/models` to the
8
+ * base URL so requests are routed to the OpenAI-compatible endpoint of the
9
+ * upstream provider.
10
+ *
11
+ * 2. Anthropic passthrough - some providers (e.g. Kimi coding endpoints)
12
+ * expose an Anthropic-compatible `/v1/messages` endpoint and reject
13
+ * OpenAI-format requests. For these profiles we preserve the incoming
14
+ * Anthropic body and forward it directly to the provider's
15
+ * `/v1/messages` endpoint.
16
+ *
17
+ * Passthrough is enabled when:
18
+ * - `CCS_OPENAI_PROXY_PASSTHROUGH=1` is set in the profile env, OR
19
+ * - The base URL is a known Anthropic-style provider host.
20
+ */
2
21
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveOpenAIModelsUrl = exports.resolveOpenAIChatCompletionsUrl = void 0;
22
+ exports.resolveOpenAIModelsUrl = exports.resolveOpenAIChatCompletionsUrl = exports.isAnthropicPassthroughProfile = void 0;
4
23
  function normalizePathname(pathname) {
5
24
  const trimmed = pathname.replace(/\/+$/, '');
6
25
  return trimmed || '';
@@ -10,14 +29,58 @@ function ensureSupportedProtocol(parsed) {
10
29
  throw new Error(`Unsupported upstream protocol: ${parsed.protocol}`);
11
30
  }
12
31
  }
32
+ function isAnthropicPassthroughHost(hostname) {
33
+ const normalized = hostname.toLowerCase();
34
+ return (normalized === 'api.anthropic.com' ||
35
+ normalized.endsWith('.anthropic.com') ||
36
+ normalized === 'api.kimi.com' ||
37
+ normalized.endsWith('.kimi.com'));
38
+ }
13
39
  function isOpenRouterHost(hostname) {
14
40
  const normalized = hostname.toLowerCase();
15
41
  return normalized === 'openrouter.ai' || normalized.endsWith('.openrouter.ai');
16
42
  }
17
- function buildResolvedUrl(baseUrl, suffix) {
43
+ /**
44
+ * Returns true if the profile should pass Anthropic-format requests through
45
+ * directly to the upstream provider, skipping the OpenAI translation.
46
+ */
47
+ function isAnthropicPassthroughProfile(baseUrl, options = {}) {
48
+ if (options.forcePassthrough) {
49
+ return true;
50
+ }
51
+ let parsed;
52
+ try {
53
+ parsed = new URL(baseUrl);
54
+ }
55
+ catch {
56
+ return false;
57
+ }
58
+ ensureSupportedProtocol(parsed);
59
+ return isAnthropicPassthroughHost(parsed.hostname);
60
+ }
61
+ exports.isAnthropicPassthroughProfile = isAnthropicPassthroughProfile;
62
+ /**
63
+ * Build the upstream URL for either the messages path or the models path.
64
+ * When passthrough is enabled, the messages path is appended verbatim
65
+ * (i.e. `/v1/messages`); otherwise the OpenAI suffix is appended.
66
+ */
67
+ function buildResolvedUrl(baseUrl, suffix, options = {}) {
18
68
  const parsed = new URL(baseUrl);
19
69
  ensureSupportedProtocol(parsed);
20
70
  const pathname = normalizePathname(parsed.pathname);
71
+ if (options.passthrough) {
72
+ // For Anthropic passthrough, the suffix is always `/v1/messages` or
73
+ // `/v1/models`. If the base URL already ends in `/v1` we drop the
74
+ // duplicated prefix; otherwise we append the suffix verbatim.
75
+ if (pathname.endsWith('/v1') && suffix.startsWith('/v1/')) {
76
+ parsed.pathname = `${pathname}${suffix.slice(3)}`;
77
+ parsed.search = '';
78
+ return parsed.toString();
79
+ }
80
+ parsed.pathname = pathname ? `${pathname}${suffix}` : suffix;
81
+ parsed.search = '';
82
+ return parsed.toString();
83
+ }
21
84
  if (pathname.endsWith(suffix)) {
22
85
  return parsed.toString();
23
86
  }
@@ -32,11 +95,27 @@ function buildResolvedUrl(baseUrl, suffix) {
32
95
  parsed.pathname = pathname ? `${pathname}/v1${suffix}` : `/v1${suffix}`;
33
96
  return parsed.toString();
34
97
  }
35
- function resolveOpenAIChatCompletionsUrl(baseUrl) {
98
+ /**
99
+ * Resolve the upstream URL for a chat completions request.
100
+ *
101
+ * For OpenAI-compatible providers this resolves to
102
+ * `<base>/v1/chat/completions`. For Anthropic passthrough providers this
103
+ * resolves to `<base>/v1/messages`.
104
+ */
105
+ function resolveOpenAIChatCompletionsUrl(baseUrl, options = {}) {
106
+ if (options.passthrough) {
107
+ return buildResolvedUrl(baseUrl, '/v1/messages', { passthrough: true });
108
+ }
36
109
  return buildResolvedUrl(baseUrl, '/chat/completions');
37
110
  }
38
111
  exports.resolveOpenAIChatCompletionsUrl = resolveOpenAIChatCompletionsUrl;
39
- function resolveOpenAIModelsUrl(baseUrl) {
112
+ /**
113
+ * Resolve the upstream URL for the models endpoint.
114
+ */
115
+ function resolveOpenAIModelsUrl(baseUrl, options = {}) {
116
+ if (options.passthrough) {
117
+ return buildResolvedUrl(baseUrl, '/v1/models', { passthrough: true });
118
+ }
40
119
  return buildResolvedUrl(baseUrl, '/models');
41
120
  }
42
121
  exports.resolveOpenAIModelsUrl = resolveOpenAIModelsUrl;
@@ -1 +1 @@
1
- {"version":3,"file":"upstream-url.js","sourceRoot":"","sources":["../../src/proxy/upstream-url.ts"],"names":[],"mappings":";;;AAAA,SAAS,iBAAiB,CAAC,QAAgB;IACzC,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC7C,OAAO,OAAO,IAAI,EAAE,CAAC;AACvB,CAAC;AAED,SAAS,uBAAuB,CAAC,MAAW;IAC1C,IAAI,MAAM,CAAC,QAAQ,KAAK,OAAO,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAChE,MAAM,IAAI,KAAK,CAAC,kCAAkC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;IACvE,CAAC;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,QAAgB;IACxC,MAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IAC1C,OAAO,UAAU,KAAK,eAAe,IAAI,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AACjF,CAAC;AAED,SAAS,gBAAgB,CAAC,OAAe,EAAE,MAAc;IACvD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;IAChC,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAEhC,MAAM,QAAQ,GAAG,iBAAiB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACpD,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9B,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAED,IAAI,gBAAgB,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACnE,MAAM,CAAC,QAAQ,GAAG,GAAG,QAAQ,MAAM,MAAM,EAAE,CAAC;QAC5C,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAED,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1D,MAAM,CAAC,QAAQ,GAAG,GAAG,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,EAAE,CAAC;QACjF,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAED,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,MAAM,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,MAAM,EAAE,CAAC;IACxE,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;AAC3B,CAAC;AAED,SAAgB,+BAA+B,CAAC,OAAe;IAC7D,OAAO,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC;AACxD,CAAC;AAFD,0EAEC;AAED,SAAgB,sBAAsB,CAAC,OAAe;IACpD,OAAO,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AAC9C,CAAC;AAFD,wDAEC"}
1
+ {"version":3,"file":"upstream-url.js","sourceRoot":"","sources":["../../src/proxy/upstream-url.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;AAEH,SAAS,iBAAiB,CAAC,QAAgB;IACzC,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC7C,OAAO,OAAO,IAAI,EAAE,CAAC;AACvB,CAAC;AAED,SAAS,uBAAuB,CAAC,MAAW;IAC1C,IAAI,MAAM,CAAC,QAAQ,KAAK,OAAO,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAChE,MAAM,IAAI,KAAK,CAAC,kCAAkC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;IACvE,CAAC;AACH,CAAC;AAED,SAAS,0BAA0B,CAAC,QAAgB;IAClD,MAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IAC1C,OAAO,CACL,UAAU,KAAK,mBAAmB;QAClC,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC;QACrC,UAAU,KAAK,cAAc;QAC7B,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,CACjC,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CAAC,QAAgB;IACxC,MAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IAC1C,OAAO,UAAU,KAAK,eAAe,IAAI,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AACjF,CAAC;AAED;;;GAGG;AACH,SAAgB,6BAA6B,CAC3C,OAAe,EACf,UAA0C,EAAE;IAE5C,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,MAAW,CAAC;IAChB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;IACD,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAChC,OAAO,0BAA0B,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AACrD,CAAC;AAfD,sEAeC;AAED;;;;GAIG;AACH,SAAS,gBAAgB,CACvB,OAAe,EACf,MAAc,EACd,UAAqC,EAAE;IAEvC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;IAChC,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAEhC,MAAM,QAAQ,GAAG,iBAAiB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAEpD,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;QACxB,oEAAoE;QACpE,kEAAkE;QAClE,8DAA8D;QAC9D,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YAC1D,MAAM,CAAC,QAAQ,GAAG,GAAG,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YAClD,MAAM,CAAC,MAAM,GAAG,EAAE,CAAC;YACnB,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC3B,CAAC;QACD,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,GAAG,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;QAC7D,MAAM,CAAC,MAAM,GAAG,EAAE,CAAC;QACnB,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAED,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9B,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAED,IAAI,gBAAgB,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACnE,MAAM,CAAC,QAAQ,GAAG,GAAG,QAAQ,MAAM,MAAM,EAAE,CAAC;QAC5C,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAED,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1D,MAAM,CAAC,QAAQ,GAAG,GAAG,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,EAAE,CAAC;QACjF,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAED,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,MAAM,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,MAAM,EAAE,CAAC;IACxE,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;AAC3B,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,+BAA+B,CAC7C,OAAe,EACf,UAAqC,EAAE;IAEvC,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;QACxB,OAAO,gBAAgB,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC;AACxD,CAAC;AARD,0EAQC;AAED;;GAEG;AACH,SAAgB,sBAAsB,CACpC,OAAe,EACf,UAAqC,EAAE;IAEvC,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;QACxB,OAAO,gBAAgB,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AAC9C,CAAC;AARD,wDAQC"}
@@ -1 +1 @@
1
- import{g as K,r as A}from"./react-vendor-Bjx91N7w.js";import{bP as U,bQ as X,bR as q,bS as ee,bT as D,bU as H,bV as L,bW as te,bX as ne}from"./index-D7crOfea.js";var W,M;function re(){return M||(M=1,W={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),W}var se=re();const ae=K(se);var ie=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function Z(e){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(ae[n[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){var r=e.indexOf("-->");return{type:"comment",comment:r!==-1?e.slice(4,r):""}}for(var i=new RegExp(ie),s=null;(s=i.exec(e))!==null;)if(s[0].trim())if(s[1]){var o=s[1].trim(),l=[o,""];o.indexOf("=")>-1&&(l=o.split("=")),t.attrs[l[0]]=l[1],i.lastIndex--}else s[2]&&(t.attrs[s[2]]=s[3].trim().substring(1,s[3].length-1));return t}var oe=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,le=/^\s*$/,ce=Object.create(null);function J(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?(function(n){var r=[];for(var i in n)r.push(i+'="'+n[i]+'"');return r.length?" "+r.join(" "):""})(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(J,"")+"</"+t.name+">";case"comment":return e+"<!--"+t.comment+"-->"}}var ue={parse:function(e,t){t||(t={}),t.components||(t.components=ce);var n,r=[],i=[],s=-1,o=!1;if(e.indexOf("<")!==0){var l=e.indexOf("<");r.push({type:"text",content:l===-1?e:e.substring(0,l)})}return e.replace(oe,function(c,p){if(o){if(c!=="</"+n.name+">")return;o=!1}var f,v=c.charAt(1)!=="/",C=c.startsWith("<!--"),g=p+c.length,u=e.charAt(g);if(C){var j=Z(c);return s<0?(r.push(j),r):((f=i[s]).children.push(j),r)}if(v&&(s++,(n=Z(c)).type==="tag"&&t.components[n.name]&&(n.type="component",o=!0),n.voidElement||o||!u||u==="<"||n.children.push({type:"text",content:e.slice(g,e.indexOf("<",g))}),s===0&&r.push(n),(f=i[s-1])&&f.children.push(n),i[s]=n),(!v||n.voidElement)&&(s>-1&&(n.voidElement||n.name===c.slice(2,-1))&&(s--,n=s===-1?r:i[s]),!o&&u!=="<"&&u)){f=s===-1?r:i[s].children;var h=e.indexOf("<",g),$=e.slice(g,h===-1?void 0:h);le.test($)&&($=" "),(h>-1&&s+f.length>=0||$!==" ")&&f.push({type:"text",content:$})}}),r},stringify:function(e){return e.reduce(function(t,n){return t+J("",n)},"")}};const z=(e,t)=>{if(!e)return!1;const n=e.props?.children??e.children;return t?n.length>0:!!n},B=e=>{if(!e)return[];const t=e.props?.children??e.children;return e.props?.i18nIsDynamicList?_(t):t},pe=e=>Array.isArray(e)&&e.every(A.isValidElement),_=e=>Array.isArray(e)?e:[e],fe=(e,t)=>{const n={...t};return n.props={...t.props,...e.props},n},me=e=>{const t={};if(!e)return t;const n=r=>{_(r).forEach(s=>{D(s)||(z(s)?n(B(s)):L(s)&&!A.isValidElement(s)&&Object.assign(t,s))})};return n(e),t},Y=(e,t,n,r)=>{if(!e)return"";let i="";const s=_(e),o=t?.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return s.forEach((l,c)=>{if(D(l)){i+=`${l}`;return}if(A.isValidElement(l)){const{props:p,type:f}=l,v=Object.keys(p).length,C=o.indexOf(f)>-1,g=p.children;if(!g&&C&&!v){i+=`<${f}/>`;return}if(!g&&(!C||v)||p.i18nIsDynamicList){i+=`<${c}></${c}>`;return}if(C&&v===1&&D(g)){i+=`<${f}>${g}</${f}>`;return}const u=Y(g,t,n,r);i+=`<${c}>${u}</${c}>`;return}if(l===null){H(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:r});return}if(L(l)){const{format:p,...f}=l,v=Object.keys(f);if(v.length===1){const C=p?`${v[0]}, ${p}`:v[0];i+=`{{${C}}}`;return}H(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:r,child:l});return}H(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:r,child:l})}),i},he=(e,t=[],n={})=>{if(!e)return e;const r=Object.keys(n),i=[...t,...r];let s="",o=0;for(;o<e.length;)if(e[o]==="<"){let l=!1;const c=e.slice(o).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);if(c){const p=c[1];(/^\d+$/.test(p)||i.includes(p))&&(l=!0,s+=c[0],o+=c[0].length)}if(!l){const p=e.slice(o).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(p){const f=p[1];(/^\d+$/.test(f)||i.includes(f))&&(l=!0,s+=p[0],o+=p[0].length)}}l||(s+="&lt;",o+=1)}else s+=e[o],o+=1;return s},de=(e,t,n,r,i,s,o)=>{if(n==="")return[];const l=i.transKeepBasicHtmlNodesFor||[],c=n&&new RegExp(l.map(d=>`<${d}`).join("|")).test(n);if(!e&&!t&&!c&&!o)return[n];const p=t??{},f=d=>{_(d).forEach(y=>{D(y)||(z(y)?f(B(y)):L(y)&&!A.isValidElement(y)&&Object.assign(p,y))})};f(e);const v=he(n,l,p),C=ue.parse(`<0>${v}</0>`),g={...p,...s},u=(d,O,y)=>{const N=B(d),I=h(N,O.children,y);return pe(N)&&I.length===0||d.props?.i18nIsDynamicList?N:I},j=(d,O,y,N,I)=>{d.dummy?(d.children=O,y.push(A.cloneElement(d,{key:N},I?void 0:O))):y.push(...A.Children.map([d],m=>{const a="data-i18n-is-dynamic-list",V={key:N,[a]:void 0};return m&&m.props&&Object.keys(m.props).forEach(T=>{T==="ref"||T==="children"||T==="i18nIsDynamicList"||T===a||(V[T]=m.props[T])}),A.cloneElement(m,V,I?null:O)}))},h=(d,O,y)=>{const N=_(d);return _(O).reduce((m,a,V)=>{const T=a.children?.[0]?.content&&r.services.interpolator.interpolate(a.children[0].content,g,r.language);if(a.type==="tag"){let x=N[parseInt(a.name,10)];!x&&t&&(x=t[a.name]),y.length===1&&!x&&(x=y[0][a.name]),x||(x={});const k={...a.attrs};o&&Object.keys(k).forEach(E=>{const P=k[E];D(P)&&(k[E]=te(P))});const b=Object.keys(k).length!==0?fe({props:k},x):x,S=A.isValidElement(b),F=S&&z(a,!0)&&!a.voidElement,w=c&&L(b)&&b.dummy&&!S,R=L(t)&&Object.hasOwnProperty.call(t,a.name);if(D(b)){const E=r.services.interpolator.interpolate(b,g,r.language);m.push(E)}else if(z(b)||F){const E=u(b,a,y);j(b,E,m,V)}else if(w){const E=h(N,a.children,y);j(b,E,m,V)}else if(Number.isNaN(parseFloat(a.name)))if(R){const E=u(b,a,y);j(b,E,m,V,a.voidElement)}else if(i.transSupportBasicHtmlNodes&&l.indexOf(a.name)>-1)if(a.voidElement)m.push(A.createElement(a.name,{key:`${a.name}-${V}`}));else{const E=h(N,a.children,y);m.push(A.createElement(a.name,{key:`${a.name}-${V}`},E))}else if(a.voidElement)m.push(`<${a.name} />`);else{const E=h(N,a.children,y);m.push(`<${a.name}>${E}</${a.name}>`)}else if(L(b)&&!S){const E=a.children[0]?T:null;E&&m.push(E)}else j(b,T,m,V,a.children.length!==1||!T)}else if(a.type==="text"){const x=i.transWrapTextNodes,k=typeof i.unescape=="function"?i.unescape:q().unescape,b=o?k(r.services.interpolator.interpolate(a.content,g,r.language)):r.services.interpolator.interpolate(a.content,g,r.language);x?m.push(A.createElement(x,{key:`${a.name}-${V}`},b)):m.push(b)}return m},[])},$=h([{dummy:!0,children:e||[]}],C,_(e||[]));return B($[0])},Q=(e,t,n)=>{const r=e.key||t,i=A.cloneElement(e,{key:r});if(!i.props||!i.props.children||n.indexOf(`${t}/>`)<0&&n.indexOf(`${t} />`)<0)return i;function s(){return A.createElement(A.Fragment,null,i)}return A.createElement(s,{key:r})},ye=(e,t)=>e.map((n,r)=>Q(n,r,t)),ge=(e,t)=>{const n={};return Object.keys(e).forEach(r=>{Object.assign(n,{[r]:Q(e[r],r,t)})}),n},Ee=(e,t,n,r)=>e?Array.isArray(e)?ye(e,t):L(e)?ge(e,t):(U(n,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:r}),null):null,be=e=>!L(e)||Array.isArray(e)?!1:Object.keys(e).reduce((t,n)=>t&&Number.isNaN(Number.parseFloat(n)),!0);function ve({children:e,count:t,parent:n,i18nKey:r,context:i,tOptions:s={},values:o,defaults:l,components:c,ns:p,i18n:f,t:v,shouldUnescape:C,...g}){const u=f||X();if(!u)return U(u,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:r}),e;const j=v||u.t.bind(u)||(G=>G),h={...q(),...u.options?.react};let $=p||j.ns||u.options?.defaultNS;$=D($)?[$]:$||["translation"];const{transDefaultProps:d}=h,O=d?.tOptions?{...d.tOptions,...s}:s,y=C??d?.shouldUnescape,N=d?.values?{...d.values,...o}:o,I=d?.components?{...d.components,...c}:c,m=Y(e,h,u,r),a=l||O?.defaultValue||m||h.transEmptyNodeValue||(typeof r=="function"?ee(r):r),{hashTransKey:V}=h,T=r||(V?V(m||a):m||a);u.options?.interpolation?.defaultVariables?o=N&&Object.keys(N).length>0?{...N,...u.options.interpolation.defaultVariables}:{...u.options.interpolation.defaultVariables}:o=N;const x=me(e);x&&typeof x.count=="number"&&t===void 0&&(t=x.count);const k=o||t!==void 0&&!u.options?.interpolation?.alwaysFormat||!e?O.interpolation:{interpolation:{...O.interpolation,prefix:"#$?",suffix:"?$#"}},b={...O,context:i||O.context,count:t,...o,...k,defaultValue:a,ns:$};let S=T?j(T,b):a;S===T&&a&&(S=a);const F=Ee(I,S,u,r);let w=F||e,R=null;be(F)&&(R=F,w=e);const E=de(w,R,S,u,h,b,y),P=n??h.defaultTransParent;return P?A.createElement(P,g,E):E}function xe({children:e,count:t,parent:n,i18nKey:r,context:i,tOptions:s={},values:o,defaults:l,components:c,ns:p,i18n:f,t:v,shouldUnescape:C,...g}){const{i18n:u,defaultNS:j}=A.useContext(ne)||{},h=f||u||X(),$=v||h?.t.bind(h);return ve({children:e,count:t,parent:n,i18nKey:r,context:i,tOptions:s,values:o,defaults:l,components:c,ns:p||$?.ns||j||h?.options?.defaultNS,i18n:h,t:v,shouldUnescape:C,...g})}export{xe as T};
1
+ import{g as K,r as A}from"./react-vendor-Bjx91N7w.js";import{bP as U,bQ as X,bR as q,bS as ee,bT as D,bU as H,bV as L,bW as te,bX as ne}from"./index-CGgavq2X.js";var W,M;function re(){return M||(M=1,W={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),W}var se=re();const ae=K(se);var ie=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function Z(e){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(ae[n[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){var r=e.indexOf("-->");return{type:"comment",comment:r!==-1?e.slice(4,r):""}}for(var i=new RegExp(ie),s=null;(s=i.exec(e))!==null;)if(s[0].trim())if(s[1]){var o=s[1].trim(),l=[o,""];o.indexOf("=")>-1&&(l=o.split("=")),t.attrs[l[0]]=l[1],i.lastIndex--}else s[2]&&(t.attrs[s[2]]=s[3].trim().substring(1,s[3].length-1));return t}var oe=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,le=/^\s*$/,ce=Object.create(null);function J(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?(function(n){var r=[];for(var i in n)r.push(i+'="'+n[i]+'"');return r.length?" "+r.join(" "):""})(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(J,"")+"</"+t.name+">";case"comment":return e+"<!--"+t.comment+"-->"}}var ue={parse:function(e,t){t||(t={}),t.components||(t.components=ce);var n,r=[],i=[],s=-1,o=!1;if(e.indexOf("<")!==0){var l=e.indexOf("<");r.push({type:"text",content:l===-1?e:e.substring(0,l)})}return e.replace(oe,function(c,p){if(o){if(c!=="</"+n.name+">")return;o=!1}var f,v=c.charAt(1)!=="/",C=c.startsWith("<!--"),g=p+c.length,u=e.charAt(g);if(C){var j=Z(c);return s<0?(r.push(j),r):((f=i[s]).children.push(j),r)}if(v&&(s++,(n=Z(c)).type==="tag"&&t.components[n.name]&&(n.type="component",o=!0),n.voidElement||o||!u||u==="<"||n.children.push({type:"text",content:e.slice(g,e.indexOf("<",g))}),s===0&&r.push(n),(f=i[s-1])&&f.children.push(n),i[s]=n),(!v||n.voidElement)&&(s>-1&&(n.voidElement||n.name===c.slice(2,-1))&&(s--,n=s===-1?r:i[s]),!o&&u!=="<"&&u)){f=s===-1?r:i[s].children;var h=e.indexOf("<",g),$=e.slice(g,h===-1?void 0:h);le.test($)&&($=" "),(h>-1&&s+f.length>=0||$!==" ")&&f.push({type:"text",content:$})}}),r},stringify:function(e){return e.reduce(function(t,n){return t+J("",n)},"")}};const z=(e,t)=>{if(!e)return!1;const n=e.props?.children??e.children;return t?n.length>0:!!n},B=e=>{if(!e)return[];const t=e.props?.children??e.children;return e.props?.i18nIsDynamicList?_(t):t},pe=e=>Array.isArray(e)&&e.every(A.isValidElement),_=e=>Array.isArray(e)?e:[e],fe=(e,t)=>{const n={...t};return n.props={...t.props,...e.props},n},me=e=>{const t={};if(!e)return t;const n=r=>{_(r).forEach(s=>{D(s)||(z(s)?n(B(s)):L(s)&&!A.isValidElement(s)&&Object.assign(t,s))})};return n(e),t},Y=(e,t,n,r)=>{if(!e)return"";let i="";const s=_(e),o=t?.transSupportBasicHtmlNodes?t.transKeepBasicHtmlNodesFor??[]:[];return s.forEach((l,c)=>{if(D(l)){i+=`${l}`;return}if(A.isValidElement(l)){const{props:p,type:f}=l,v=Object.keys(p).length,C=o.indexOf(f)>-1,g=p.children;if(!g&&C&&!v){i+=`<${f}/>`;return}if(!g&&(!C||v)||p.i18nIsDynamicList){i+=`<${c}></${c}>`;return}if(C&&v===1&&D(g)){i+=`<${f}>${g}</${f}>`;return}const u=Y(g,t,n,r);i+=`<${c}>${u}</${c}>`;return}if(l===null){H(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:r});return}if(L(l)){const{format:p,...f}=l,v=Object.keys(f);if(v.length===1){const C=p?`${v[0]}, ${p}`:v[0];i+=`{{${C}}}`;return}H(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:r,child:l});return}H(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:r,child:l})}),i},he=(e,t=[],n={})=>{if(!e)return e;const r=Object.keys(n),i=[...t,...r];let s="",o=0;for(;o<e.length;)if(e[o]==="<"){let l=!1;const c=e.slice(o).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);if(c){const p=c[1];(/^\d+$/.test(p)||i.includes(p))&&(l=!0,s+=c[0],o+=c[0].length)}if(!l){const p=e.slice(o).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(p){const f=p[1];(/^\d+$/.test(f)||i.includes(f))&&(l=!0,s+=p[0],o+=p[0].length)}}l||(s+="&lt;",o+=1)}else s+=e[o],o+=1;return s},de=(e,t,n,r,i,s,o)=>{if(n==="")return[];const l=i.transKeepBasicHtmlNodesFor||[],c=n&&new RegExp(l.map(d=>`<${d}`).join("|")).test(n);if(!e&&!t&&!c&&!o)return[n];const p=t??{},f=d=>{_(d).forEach(y=>{D(y)||(z(y)?f(B(y)):L(y)&&!A.isValidElement(y)&&Object.assign(p,y))})};f(e);const v=he(n,l,p),C=ue.parse(`<0>${v}</0>`),g={...p,...s},u=(d,O,y)=>{const N=B(d),I=h(N,O.children,y);return pe(N)&&I.length===0||d.props?.i18nIsDynamicList?N:I},j=(d,O,y,N,I)=>{d.dummy?(d.children=O,y.push(A.cloneElement(d,{key:N},I?void 0:O))):y.push(...A.Children.map([d],m=>{const a="data-i18n-is-dynamic-list",V={key:N,[a]:void 0};return m&&m.props&&Object.keys(m.props).forEach(T=>{T==="ref"||T==="children"||T==="i18nIsDynamicList"||T===a||(V[T]=m.props[T])}),A.cloneElement(m,V,I?null:O)}))},h=(d,O,y)=>{const N=_(d);return _(O).reduce((m,a,V)=>{const T=a.children?.[0]?.content&&r.services.interpolator.interpolate(a.children[0].content,g,r.language);if(a.type==="tag"){let x=N[parseInt(a.name,10)];!x&&t&&(x=t[a.name]),y.length===1&&!x&&(x=y[0][a.name]),x||(x={});const k={...a.attrs};o&&Object.keys(k).forEach(E=>{const P=k[E];D(P)&&(k[E]=te(P))});const b=Object.keys(k).length!==0?fe({props:k},x):x,S=A.isValidElement(b),F=S&&z(a,!0)&&!a.voidElement,w=c&&L(b)&&b.dummy&&!S,R=L(t)&&Object.hasOwnProperty.call(t,a.name);if(D(b)){const E=r.services.interpolator.interpolate(b,g,r.language);m.push(E)}else if(z(b)||F){const E=u(b,a,y);j(b,E,m,V)}else if(w){const E=h(N,a.children,y);j(b,E,m,V)}else if(Number.isNaN(parseFloat(a.name)))if(R){const E=u(b,a,y);j(b,E,m,V,a.voidElement)}else if(i.transSupportBasicHtmlNodes&&l.indexOf(a.name)>-1)if(a.voidElement)m.push(A.createElement(a.name,{key:`${a.name}-${V}`}));else{const E=h(N,a.children,y);m.push(A.createElement(a.name,{key:`${a.name}-${V}`},E))}else if(a.voidElement)m.push(`<${a.name} />`);else{const E=h(N,a.children,y);m.push(`<${a.name}>${E}</${a.name}>`)}else if(L(b)&&!S){const E=a.children[0]?T:null;E&&m.push(E)}else j(b,T,m,V,a.children.length!==1||!T)}else if(a.type==="text"){const x=i.transWrapTextNodes,k=typeof i.unescape=="function"?i.unescape:q().unescape,b=o?k(r.services.interpolator.interpolate(a.content,g,r.language)):r.services.interpolator.interpolate(a.content,g,r.language);x?m.push(A.createElement(x,{key:`${a.name}-${V}`},b)):m.push(b)}return m},[])},$=h([{dummy:!0,children:e||[]}],C,_(e||[]));return B($[0])},Q=(e,t,n)=>{const r=e.key||t,i=A.cloneElement(e,{key:r});if(!i.props||!i.props.children||n.indexOf(`${t}/>`)<0&&n.indexOf(`${t} />`)<0)return i;function s(){return A.createElement(A.Fragment,null,i)}return A.createElement(s,{key:r})},ye=(e,t)=>e.map((n,r)=>Q(n,r,t)),ge=(e,t)=>{const n={};return Object.keys(e).forEach(r=>{Object.assign(n,{[r]:Q(e[r],r,t)})}),n},Ee=(e,t,n,r)=>e?Array.isArray(e)?ye(e,t):L(e)?ge(e,t):(U(n,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:r}),null):null,be=e=>!L(e)||Array.isArray(e)?!1:Object.keys(e).reduce((t,n)=>t&&Number.isNaN(Number.parseFloat(n)),!0);function ve({children:e,count:t,parent:n,i18nKey:r,context:i,tOptions:s={},values:o,defaults:l,components:c,ns:p,i18n:f,t:v,shouldUnescape:C,...g}){const u=f||X();if(!u)return U(u,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:r}),e;const j=v||u.t.bind(u)||(G=>G),h={...q(),...u.options?.react};let $=p||j.ns||u.options?.defaultNS;$=D($)?[$]:$||["translation"];const{transDefaultProps:d}=h,O=d?.tOptions?{...d.tOptions,...s}:s,y=C??d?.shouldUnescape,N=d?.values?{...d.values,...o}:o,I=d?.components?{...d.components,...c}:c,m=Y(e,h,u,r),a=l||O?.defaultValue||m||h.transEmptyNodeValue||(typeof r=="function"?ee(r):r),{hashTransKey:V}=h,T=r||(V?V(m||a):m||a);u.options?.interpolation?.defaultVariables?o=N&&Object.keys(N).length>0?{...N,...u.options.interpolation.defaultVariables}:{...u.options.interpolation.defaultVariables}:o=N;const x=me(e);x&&typeof x.count=="number"&&t===void 0&&(t=x.count);const k=o||t!==void 0&&!u.options?.interpolation?.alwaysFormat||!e?O.interpolation:{interpolation:{...O.interpolation,prefix:"#$?",suffix:"?$#"}},b={...O,context:i||O.context,count:t,...o,...k,defaultValue:a,ns:$};let S=T?j(T,b):a;S===T&&a&&(S=a);const F=Ee(I,S,u,r);let w=F||e,R=null;be(F)&&(R=F,w=e);const E=de(w,R,S,u,h,b,y),P=n??h.defaultTransParent;return P?A.createElement(P,g,E):E}function xe({children:e,count:t,parent:n,i18nKey:r,context:i,tOptions:s={},values:o,defaults:l,components:c,ns:p,i18n:f,t:v,shouldUnescape:C,...g}){const{i18n:u,defaultNS:j}=A.useContext(ne)||{},h=f||u||X(),$=v||h?.t.bind(h);return ve({children:e,count:t,parent:n,i18nKey:r,context:i,tOptions:s,values:o,defaults:l,components:c,ns:p||$?.ns||j||h?.options?.defaultNS,i18n:h,t:v,shouldUnescape:C,...g})}export{xe as T};
@@ -0,0 +1 @@
1
+ import{j as e}from"./radix-ui-nu4wz29m.js";import{r as k,e as Ae}from"./react-vendor-Bjx91N7w.js";import{e as Pe,f as se,g as De}from"./tanstack-bhJxV1h8.js";import{T as Te,a as Se,b as te,c as Re,d as _e,e as Oe}from"./table-DrUJOxKL.js";import{a as R,ai as q,aj as W,ak as J,al as Q,am as Y,L as S,I as E,z as P,aE as pe,e as p,j as Ge,k as Me,l as ze,m as Le,n as ae,bi as ne,bj as re,bk as ce,B as C,c as $e,C as O,s as M,t as z,a0 as F,b as G,f as Ie,g as He,h as Fe,x as Be}from"./index-CGgavq2X.js";import{A as Ue,a as Ke,b as Ee,c as Ze,d as Ve,e as Xe,f as qe,g as We}from"./alert-dialog-DjvPgzFs.js";import{a as fe,b as Je,c as Qe,d as Ye,e as es,u as ss,f as ts}from"./use-accounts-DLtuaniS.js";import{b2 as Z,b3 as L,b4 as ee,aI as be,$ as je,b5 as Ne,aj as ye,x as as,b6 as ns,b7 as rs,n as V,au as cs,V as os,b8 as ds,a8 as ls,a0 as ve,a7 as B,T as X,y as is,p as oe,U as xs,aa as de,Z as le}from"./icons-DSLG1YsC.js";import{C as ie}from"./checkbox-DFeFDZBp.js";import"./notifications-B4_o8bcr.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./charts-eIPy2oG6.js";const xe=64,us=/^[a-zA-Z][a-zA-Z0-9_-]*$/;function ms({account:a,groupSummaries:x,plainCcsLane:t,onClose:m}){const{t:s}=R(),u=fe(),[r,l]=k.useState(a.context_mode==="shared"?"shared":"isolated"),[g,b]=k.useState(a.context_group||"default"),[h,v]=k.useState(a.continuity_mode==="deeper"?"deeper":"standard"),d=k.useMemo(()=>g.trim().toLowerCase().replace(/\s+/g,"-"),[g]),c=k.useMemo(()=>x.find(f=>f.group===d),[x,d]),N=d.length>0&&d.length<=xe&&us.test(d),j=r==="isolated"||N,y=r==="shared"?Math.max((c?.sharedCount??0)-(a.context_mode==="shared"&&a.context_group===d?1:0),0):0,n=r==="shared"?Math.max((c?.deeperCount??0)-(a.continuity_mode==="deeper"&&a.context_group===d?1:0),0):0,o=t?.account_name===a.name,i=!!t&&!o,w=`ccs auth default ${a.name}`,D=`ccs auth backup ${a.name}`,A=(f,I,_,H)=>{if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(f.key))return;f.preventDefault();const ke=_.indexOf(I),we=f.key==="ArrowLeft"||f.key==="ArrowUp"?-1:1,Ce=(ke+we+_.length)%_.length;H(_[Ce])},$=t?t.kind==="native"?s("continuityOverview.lane.native"):t.kind==="account-default"?s("continuityOverview.lane.accountDefault",{name:t.account_name||""}):t.kind==="account-inherited"?s("continuityOverview.lane.accountInherited",{name:t.account_name||""}):t.kind==="profile-default"?s("continuityOverview.lane.profileDefault",{name:t.profile_name||"default"}):t.label:"",T=()=>{j&&u.mutate({name:a.name,context_mode:r,context_group:r==="shared"?d:void 0,continuity_mode:r==="shared"?h:void 0},{onSuccess:()=>{m()}})},U=f=>{f||m()};return e.jsx(q,{open:!0,onOpenChange:U,children:e.jsxs(W,{className:"sm:max-w-md",children:[e.jsxs(J,{children:[e.jsx(Q,{children:s("editAccountContext.title")}),e.jsx(Y,{children:s("editAccountContext.description",{name:a.name})})]}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(S,{className:"text-sm font-semibold",children:s("editAccountContext.syncMode")})}),e.jsxs("div",{className:"flex p-0.5 bg-muted/60 hover:bg-muted/80 transition-colors rounded-xl border border-border/40 w-full",role:"radiogroup","aria-label":s("editAccountContext.syncMode"),children:[e.jsxs("button",{type:"button",role:"radio","aria-checked":r==="isolated",tabIndex:r==="isolated"?0:-1,onClick:()=>l("isolated"),onKeyDown:f=>A(f,r,["isolated","shared"],l),className:`flex-1 flex justify-center items-center gap-2 px-3 py-1.5 rounded-[10px] text-sm font-medium transition-all duration-200 overflow-hidden ${r==="isolated"?"bg-background text-blue-600 dark:text-blue-400 shadow-sm ring-1 ring-border/50":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[e.jsx(Z,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:s("editAccountContext.isolatedOption")})]}),e.jsxs("button",{type:"button",role:"radio","aria-checked":r==="shared",tabIndex:r==="shared"?0:-1,onClick:()=>l("shared"),onKeyDown:f=>A(f,r,["isolated","shared"],l),className:`flex-1 flex justify-center items-center gap-2 px-3 py-1.5 rounded-[10px] text-sm font-medium transition-all duration-200 overflow-hidden ${r==="shared"?"bg-background text-emerald-600 dark:text-emerald-400 shadow-sm ring-1 ring-border/50":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[e.jsx(L,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:s("editAccountContext.sharedOption")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground pt-1 px-1",children:s(r==="isolated"?"editAccountContext.isolatedModeHint":"editAccountContext.sharedModeHint")})]}),r==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{htmlFor:"context-group",children:s("editAccountContext.historySyncGroup")}),e.jsx(E,{id:"context-group",value:g,onChange:f=>b(f.target.value),placeholder:s("editAccountContext.groupPlaceholder"),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("editAccountContext.groupHint",{max:xe})}),!N&&e.jsx("p",{className:"text-xs text-destructive",children:s("editAccountContext.invalidGroup")})]}),r==="shared"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(S,{className:"text-sm font-semibold",children:s("editAccountContext.continuityDepth")})}),e.jsxs("div",{className:"flex p-0.5 bg-muted/60 hover:bg-muted/80 transition-colors rounded-xl border border-border/40 w-full",role:"radiogroup","aria-label":s("editAccountContext.continuityDepth"),children:[e.jsxs("button",{type:"button",role:"radio","aria-checked":h==="standard",tabIndex:h==="standard"?0:-1,onClick:()=>v("standard"),onKeyDown:f=>A(f,h,["standard","deeper"],v),className:`flex-1 flex justify-center items-center gap-2 px-3 py-1.5 rounded-[10px] text-sm font-medium transition-all duration-200 overflow-hidden ${h==="standard"?"bg-background text-emerald-600 dark:text-emerald-400 shadow-sm ring-1 ring-border/50":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[e.jsx(L,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:s("editAccountContext.standardOption")})]}),e.jsxs("button",{type:"button",role:"radio","aria-checked":h==="deeper",tabIndex:h==="deeper"?0:-1,onClick:()=>v("deeper"),onKeyDown:f=>A(f,h,["standard","deeper"],v),className:`flex-1 flex justify-center items-center gap-2 px-3 py-1.5 rounded-[10px] text-sm font-medium transition-all duration-200 overflow-hidden ${h==="deeper"?"bg-background text-indigo-600 dark:text-indigo-400 shadow-sm ring-1 ring-border/50":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[e.jsx(ee,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:s("editAccountContext.deeperOption")})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground pt-1 px-1",children:s(h==="standard"?"editAccountContext.standardHint":"editAccountContext.deeperHint")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("editAccountContext.credentialsIsolated")}),i&&e.jsx("div",{className:"rounded-[14px] border border-amber-200 bg-amber-50/50 p-4 text-xs shadow-sm dark:border-amber-900/40 dark:bg-amber-900/10",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"font-medium text-foreground",children:s("continuityOverview.plainLaneTitle")}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:s("continuityOverview.plainLaneDescription",{lane:$||"plain ccs",name:a.name})}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs -r"}),e.jsx(P,{value:"ccs -r",size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs auth backup default"}),e.jsx(P,{value:"ccs auth backup default",size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:D}),e.jsx(P,{value:D,size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:w}),e.jsx(P,{value:w,size:"icon"})]})]})]})}),e.jsx("div",{className:`rounded-[14px] border p-4 text-xs shadow-sm transition-colors ${r==="isolated"?"bg-blue-50/50 border-blue-200 dark:bg-blue-900/10 dark:border-blue-800/40":"bg-muted/40 border-border/60"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[r==="isolated"?e.jsx(be,{className:"h-4 w-4 text-blue-500 mt-0.5 shrink-0"}):e.jsx(je,{className:"h-4 w-4 text-muted-foreground mt-0.5 shrink-0"}),e.jsxs("div",{className:"space-y-1.5 flex-1 text-muted-foreground leading-relaxed",children:[r==="isolated"?e.jsx("p",{className:"text-foreground font-medium selection:bg-blue-200",children:s("editAccountContext.isolatedImplication")}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:[e.jsx("span",{className:"text-foreground font-medium",children:s("editAccountContext.sameGroupRule",{group:d})})," ",y>0?s("editAccountContext.sameGroupPeerCount",{count:y}):s("editAccountContext.noSameGroupPeer")]}),h==="deeper"&&e.jsx("p",{children:n>0?s("editAccountContext.deeperReady",{count:n}):e.jsx("span",{className:"text-amber-600 dark:text-amber-500",children:s("editAccountContext.deeperNeedsPeers")})})]}),e.jsx("p",{className:`pt-1.5 text-[11px] ${r==="isolated"?"text-blue-700/70 dark:text-blue-300/60":"text-muted-foreground/70"}`,children:s("editAccountContext.resumeOriginalWarning")})]})]})})]}),e.jsxs(pe,{children:[e.jsx(p,{variant:"outline",onClick:m,disabled:u.isPending,children:s("editAccountContext.cancel")}),e.jsx(p,{onClick:T,disabled:!j||u.isPending,children:u.isPending?s("editAccountContext.saving"):s("editAccountContext.save")})]})]})})}function hs({account:a,onClose:x}){const{t}=R(),m=Je(),[s,u]=k.useState(a.shared_resource_mode||"shared"),r=()=>{m.mutate({name:a.name,shared_resource_mode:s},{onSuccess:()=>{x()}})};return e.jsx(q,{open:!0,onOpenChange:x,children:e.jsxs(W,{className:"sm:max-w-[425px]",children:[e.jsxs(J,{children:[e.jsx(Q,{children:t("editAccountSharedResources.title")}),e.jsx(Y,{children:t("editAccountSharedResources.description",{name:a.name})})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(S,{htmlFor:"resource-mode",children:t("editAccountSharedResources.resourceMode")}),e.jsxs(Ge,{value:s,onValueChange:l=>u(l),children:[e.jsx(Me,{id:"resource-mode",className:"w-full",children:e.jsx(ze,{placeholder:t("editAccountSharedResources.selectResourceMode")})}),e.jsxs(Le,{children:[e.jsx(ae,{value:"shared",children:e.jsxs("div",{className:"flex flex-col items-start py-1",children:[e.jsx("span",{className:"font-medium text-sm",children:t("editAccountSharedResources.sharedOption")}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:t("editAccountSharedResources.sharedHint")})]})}),e.jsx(ae,{value:"profile-local",children:e.jsxs("div",{className:"flex flex-col items-start py-1",children:[e.jsx("span",{className:"font-medium text-sm",children:t("editAccountSharedResources.profileLocalOption")}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:t("editAccountSharedResources.profileLocalHint")})]})})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:t("editAccountSharedResources.implicationTitle")}),s==="shared"?e.jsxs(ne,{className:"border-emerald-500/20 bg-emerald-500/5",children:[e.jsx(Ne,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400"}),e.jsx(re,{className:"text-xs font-semibold text-emerald-800 dark:text-emerald-300",children:t("editAccountSharedResources.sharedOption")}),e.jsx(ce,{className:"text-xs text-emerald-700/80 dark:text-emerald-400/80",children:t("editAccountSharedResources.sharedImplication")})]}):e.jsxs(ne,{className:"border-amber-500/20 bg-amber-500/5",children:[e.jsx(ye,{className:"h-4 w-4 text-amber-600 dark:text-amber-400"}),e.jsx(re,{className:"text-xs font-semibold text-amber-800 dark:text-amber-300",children:t("editAccountSharedResources.profileLocalOption")}),e.jsx(ce,{className:"text-xs text-amber-700/80 dark:text-amber-400/80",children:t("editAccountSharedResources.profileLocalImplication")})]})]}),a.shared_resource_inferred&&e.jsxs("div",{className:"flex items-start gap-2 rounded-md bg-muted/50 p-3",children:[e.jsx(as,{className:"h-4 w-4 mt-0.5 text-muted-foreground shrink-0"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:t("accountsTable.legacyReview")})]})]}),e.jsxs(pe,{children:[e.jsx(p,{variant:"outline",onClick:x,children:t("editAccountSharedResources.cancel")}),e.jsx(p,{onClick:r,disabled:m.isPending,children:m.isPending?t("editAccountSharedResources.saving"):t("editAccountSharedResources.save")})]})]})})}function ue({data:a,defaultAccount:x,groupSummaries:t,plainCcsLane:m}){const{t:s}=R(),u=Qe(),r=Ye(),l=es(),g=fe(),[b,h]=k.useState(null),[v,d]=k.useState(null),[c,N]=k.useState(null),j=[{accessorKey:"name",header:s("accountsTable.name"),size:200,cell:({row:n})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:n.original.name}),n.original.name===x&&e.jsx("span",{className:"text-xs bg-primary/10 text-primary px-1.5 py-0.5 rounded border border-primary/20",children:s("accountsTable.defaultBadge")})]})},{accessorKey:"type",header:s("accountsTable.type"),size:100,cell:({row:n})=>e.jsx("span",{className:"capitalize text-muted-foreground",children:n.original.type||"oauth"})},{accessorKey:"created",header:s("accountsTable.created"),size:150,cell:({row:n})=>{const o=new Date(n.original.created);return e.jsx("span",{className:"text-muted-foreground",children:o.toLocaleDateString()})}},{accessorKey:"last_used",header:s("accountsTable.lastUsed"),size:150,cell:({row:n})=>{if(!n.original.last_used)return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});const o=new Date(n.original.last_used);return e.jsx("span",{className:"text-muted-foreground",children:o.toLocaleDateString()})}},{id:"context",header:s("accountsTable.historySync"),size:170,cell:({row:n})=>{if(n.original.type==="cliproxy")return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});if((n.original.context_mode||"isolated")==="shared"){const i=n.original.context_group||"default",w=n.original.continuity_mode==="deeper";return e.jsxs("div",{className:"flex flex-col items-start gap-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsx(C,{variant:"outline",className:`font-mono text-[10px] uppercase px-1.5 py-0 border ${w?"text-indigo-700 border-indigo-300/60 bg-indigo-50/50 dark:text-indigo-300 dark:border-indigo-900/40 dark:bg-indigo-900/20":"text-emerald-700 border-emerald-300/60 bg-emerald-50/50 dark:text-emerald-300 dark:border-emerald-900/40 dark:bg-emerald-900/20"}`,children:s(w?"accountsTable.badges.deeper":"accountsTable.badges.shared")}),e.jsx("span",{className:"text-xs font-semibold text-foreground/80",children:i})]}),e.jsx("p",{className:"text-[10px] text-muted-foreground whitespace-nowrap",children:n.original.sameGroupPeerCount>0?s("accountsTable.sameGroupPeerCount",{count:n.original.sameGroupPeerCount}):s("accountsTable.noSameGroupPeer")})]})}return n.original.context_inferred?e.jsxs("div",{className:"flex flex-col items-start gap-1",children:[e.jsx(C,{variant:"outline",className:"text-amber-700 border-amber-300/60 bg-amber-50/50 dark:text-amber-400 dark:border-amber-900/40 dark:bg-amber-900/20 font-mono text-[10px] uppercase px-1.5 py-0",children:s("accountsTable.badges.legacy")}),e.jsx("p",{className:"text-[10px] text-amber-700/80 dark:text-amber-400/80 whitespace-nowrap",children:s("accountsTable.legacyReview")})]}):e.jsx("div",{className:"flex flex-col items-start gap-1.5",children:e.jsx(C,{variant:"secondary",className:"font-mono text-[10px] uppercase px-1.5 py-0 text-muted-foreground bg-muted/60 border-transparent shadow-none",children:s("accountsTable.badges.isolated")})})}},{id:"resources",header:s("accountsTable.sharedResources"),size:150,cell:({row:n})=>{if(n.original.type==="cliproxy")return e.jsx("span",{className:"text-muted-foreground/50",children:"-"});const o=n.original.shared_resource_mode||"shared",i=n.original.shared_resource_inferred;return e.jsxs("div",{className:"flex flex-col items-start gap-1",children:[e.jsx(C,{variant:o==="shared"?"outline":"secondary",className:$e("font-mono text-[10px] uppercase px-1.5 py-0",o==="shared"?"text-emerald-700 border-emerald-300/60 bg-emerald-50/50 dark:text-emerald-300 dark:border-emerald-900/40 dark:bg-emerald-900/20":"text-muted-foreground bg-muted/60 border-transparent shadow-none"),children:s(o==="shared"?"accountsTable.resourcesShared":"accountsTable.resourcesProfileLocal")}),i&&e.jsx("p",{className:"text-[10px] text-amber-700/80 dark:text-amber-400/80 whitespace-nowrap",children:s("accountsTable.legacyReview")})]})}},{id:"actions",header:s("accountsTable.actions"),size:220,cell:({row:n})=>{const o=n.original.name===x,i=u.isPending||r.isPending||g.isPending,w=n.original.type==="cliproxy",D=n.original.context_inferred||n.original.continuity_inferred;return e.jsxs("div",{className:"flex items-center gap-1",children:[!w&&e.jsxs(p,{variant:"outline",size:"sm",className:"h-8 px-2",disabled:i,onClick:()=>d(n.original),title:s("accountsTable.syncTitle"),children:[e.jsx(ns,{className:"w-3.5 h-3.5 mr-1"}),s("accountsTable.sync")]}),!w&&e.jsxs(p,{variant:"outline",size:"sm",className:"h-8 px-2",disabled:i,onClick:()=>N(n.original),title:s("accountsTable.resourcesTitle"),children:[e.jsx(Ne,{className:"w-3.5 h-3.5 mr-1"}),s("accountsTable.sharedResources")]}),!w&&D&&e.jsxs(p,{variant:"ghost",size:"sm",className:"h-8 px-2 text-amber-700 hover:text-amber-700 hover:bg-amber-500/10 dark:text-amber-400 dark:hover:text-amber-400",disabled:i,onClick:()=>g.mutate({name:n.original.name,context_mode:n.original.context_mode==="shared"?"shared":"isolated",context_group:n.original.context_mode==="shared"?n.original.context_group||"default":void 0,continuity_mode:n.original.context_mode==="shared"?n.original.continuity_mode==="deeper"?"deeper":"standard":void 0}),title:s("accountsTable.confirmLegacyTitle"),children:[e.jsx(rs,{className:"w-3 h-3 mr-1"}),s("accountsTable.confirm")]}),e.jsxs(p,{variant:o?"secondary":"default",size:"sm",className:"h-8 px-2",disabled:o||i,onClick:()=>u.mutate(n.original.name),children:[e.jsx(V,{className:`w-3 h-3 mr-1 ${o?"opacity-50":""}`}),s(o?"accountsTable.active":"accountsTable.setDefault")]}),e.jsx(p,{variant:"ghost",size:"sm",className:"h-8 px-2 text-destructive hover:text-destructive hover:bg-destructive/10",disabled:o||i,onClick:()=>h(n.original.name),title:s(o?"accountsTable.cannotDeleteDefault":"accountsTable.deleteAccount"),children:e.jsx(cs,{className:"w-4 h-4"})})]})}}],y=Pe({data:a,columns:j,getCoreRowModel:De()});return a.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:s("accountsTable.noAccounts")}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"border rounded-md",children:e.jsxs(Te,{children:[e.jsx(Se,{children:y.getHeaderGroups().map(n=>e.jsx(te,{children:n.headers.map(o=>{const i={name:"w-[180px]",type:"w-[80px]",created:"w-[120px]",last_used:"w-[120px]",context:"w-[150px]",resources:"w-[120px]",actions:"w-[320px]"}[o.id]||"w-auto";return e.jsx(Re,{className:i,children:o.isPlaceholder?null:se(o.column.columnDef.header,o.getContext())},o.id)})},n.id))}),e.jsx(_e,{children:y.getRowModel().rows.map(n=>e.jsx(te,{children:n.getVisibleCells().map(o=>e.jsx(Oe,{children:se(o.column.columnDef.cell,o.getContext())},o.id))},n.id))})]})}),x&&e.jsx("div",{className:"flex justify-end",children:e.jsxs(p,{variant:"outline",size:"sm",onClick:()=>l.mutate(),disabled:l.isPending,children:[e.jsx(os,{className:"w-4 h-4 mr-2"}),s("accountsTable.resetToDefault")]})})]}),v&&e.jsx(ms,{account:v,groupSummaries:t,plainCcsLane:m,onClose:()=>d(null)}),c&&e.jsx(hs,{account:c,onClose:()=>N(null)}),e.jsx(Ue,{open:!!b,onOpenChange:n=>!n&&h(null),children:e.jsxs(Ke,{children:[e.jsxs(Ee,{children:[e.jsx(Ze,{children:s("accountsTable.deleteDialogTitle")}),e.jsx(Ve,{children:s("accountsTable.deleteDialogDesc",{name:b??""})})]}),e.jsxs(Xe,{children:[e.jsx(qe,{children:s("accountsTable.cancel")}),e.jsx(We,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{b&&(r.mutate(b),h(null))},children:s("accountsTable.delete")})]})]})})]})}function me({totalAccounts:a,isolatedCount:x,sharedPeerGroups:t,deeperReadyGroups:m}){const{t:s}=R(),u=m[0]||t[0]||"daily",r=a<2?"empty":m.length>0?"deeper":t.length>0?"shared":a>=2&&x===a?"isolated":a===0?"empty":"mixed",l=`ccs auth create work2 --share-context --context-group ${u} --deeper-continuity`;return e.jsxs(O,{className:"overflow-hidden",children:[e.jsx(M,{className:"pb-3",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(z,{className:"text-lg",children:s("accountRouteGuide.title")}),e.jsx(F,{children:s("accountRouteGuide.description")})]}),e.jsx(C,{variant:r==="deeper"?"default":"secondary",children:s(`accountRouteGuide.status.${r}`)})]})}),e.jsxs(G,{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[e.jsxs("section",{className:"rounded-md border bg-blue-50/50 p-3 text-sm dark:bg-blue-900/10",children:[e.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[e.jsx(ye,{className:"h-4 w-4 text-blue-600 dark:text-blue-400"}),s("accountRouteGuide.cards.isolated.title")]}),e.jsx("p",{className:"mt-1.5 text-xs leading-relaxed text-muted-foreground",children:s("accountRouteGuide.cards.isolated.desc")})]}),e.jsxs("section",{className:"rounded-md border bg-emerald-50/50 p-3 text-sm dark:bg-emerald-900/10",children:[e.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[e.jsx(ds,{className:"h-4 w-4 text-emerald-600 dark:text-emerald-400"}),s("accountRouteGuide.cards.select.title")]}),e.jsx("p",{className:"mt-1.5 text-xs leading-relaxed text-muted-foreground",children:s("accountRouteGuide.cards.select.desc")})]}),e.jsxs("section",{className:"rounded-md border bg-sky-50/50 p-3 text-sm dark:bg-sky-900/10",children:[e.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[e.jsx(ls,{className:"h-4 w-4 text-sky-600 dark:text-sky-400"}),s("accountRouteGuide.cards.settings.title")]}),e.jsx("p",{className:"mt-1.5 text-xs leading-relaxed text-muted-foreground",children:s("accountRouteGuide.cards.settings.desc")})]}),e.jsxs("section",{className:"rounded-md border bg-indigo-50/50 p-3 text-sm dark:bg-indigo-900/10",children:[e.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[e.jsx(L,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-400"}),s("accountRouteGuide.cards.sync.title")]}),e.jsx("p",{className:"mt-1.5 text-xs leading-relaxed text-muted-foreground",children:s("accountRouteGuide.cards.sync.desc")})]})]}),e.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-md border bg-background p-3",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:[e.jsx(ve,{className:"h-3.5 w-3.5"}),s("accountRouteGuide.commands.isolated")]}),["ccs auth create work","ccs auth create personal","ccs work","ccs personal"].map(g=>e.jsxs("div",{className:"mt-2 flex items-start gap-2 rounded-md bg-muted px-2 py-2 font-mono text-[11px]",children:[e.jsx("span",{className:"flex-1 break-all",children:g}),e.jsx(P,{value:g,size:"icon"})]},g))]}),e.jsxs("div",{className:"rounded-md border bg-background p-3",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:[e.jsx(ee,{className:"h-3.5 w-3.5"}),s("accountRouteGuide.commands.sync")]}),e.jsxs("div",{className:"flex items-start gap-2 rounded-md bg-muted px-2 py-2 font-mono text-[11px]",children:[e.jsx("span",{className:"flex-1 break-all",children:l}),e.jsx(P,{value:l,size:"icon"})]}),e.jsx("p",{className:"mt-2 text-xs leading-relaxed text-muted-foreground",children:s("accountRouteGuide.commands.syncDesc",{group:u})})]})]})]})]})}const K=({titleKey:a,descKey:x})=>{const{t}=R();return e.jsxs(Ie,{children:[e.jsx(He,{asChild:!0,children:e.jsx(p,{variant:"ghost",size:"icon","aria-label":t(a),className:"h-5 w-5 rounded-full hover:bg-muted text-muted-foreground/70 transition-colors",children:e.jsx(je,{className:"h-3 w-3"})})}),e.jsxs(Fe,{className:"w-72 p-4 rounded-xl shadow-lg border-border/50 text-sm",side:"top",align:"center",children:[e.jsx("p",{className:"font-semibold tracking-tight",children:t(a)}),e.jsx("p",{className:"mt-1.5 text-muted-foreground leading-relaxed",children:t(x)})]})]})};function he({totalAccounts:a,primaryAccountName:x,isolatedCount:t,sharedStandardCount:m,deeperSharedCount:s,sharedAloneCount:u,sharedPeerAccountCount:r,deeperReadyAccountCount:l,sharedPeerGroups:g,deeperReadyGroups:b,legacyTargetCount:h,cliproxyCount:v,plainCcsLane:d}){const{t:c}=R(),N=d?d.kind==="native"?c("continuityOverview.lane.native"):d.kind==="account-default"?c("continuityOverview.lane.accountDefault",{name:d.account_name||""}):d.kind==="account-inherited"?c("continuityOverview.lane.accountInherited",{name:d.account_name||""}):d.kind==="profile-default"?c("continuityOverview.lane.profileDefault",{name:d.profile_name||"default"}):d.label:"",j=a<2?"single":g.length===0?t===a?"isolated":"shared-alone":b.length===0?"shared-standard":t>0||u>0||l<r||b.length<g.length?"partial":"ready",y=b[0]||g[0]||"default",n=b.length>0&&(t>0||m>0||g.length>b.length),i={ready:e.jsx(is,{className:"h-6 w-6 text-emerald-600 dark:text-emerald-400"}),"shared-standard":e.jsx(L,{className:"h-6 w-6 text-blue-600 dark:text-blue-400"}),single:e.jsx(be,{className:"h-6 w-6 text-stone-400"}),isolated:e.jsx(Z,{className:"h-6 w-6 text-amber-600 dark:text-amber-400"}),"shared-alone":e.jsx(X,{className:"h-6 w-6 text-amber-600 dark:text-amber-400"}),partial:e.jsx(X,{className:"h-6 w-6 text-amber-600 dark:text-amber-400"})}[j],w=!!x&&d?.account_name===x,D=a>0&&!!d&&(!x||!w),A=a>1&&j!=="ready";return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(O,{className:"flex flex-col justify-between overflow-hidden relative group p-0 border-border bg-card shadow-sm hover:shadow-md transition-shadow duration-300",children:e.jsxs(G,{className:"p-6 flex flex-col h-full bg-gradient-to-br from-card to-muted/20 space-y-4",children:[e.jsx("div",{className:"flex items-start justify-between gap-4",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start gap-4",children:[e.jsx("div",{className:"rounded-2xl bg-background p-3 shadow-sm ring-1 ring-border/50 self-start shrink-0",children:i}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h3",{className:"text-lg font-semibold tracking-tight",children:c(`continuityReadiness.messages.${j}.title`,{group:y})}),e.jsx(C,{variant:j==="ready"?"default":"secondary",className:"rounded-full px-2.5 py-0.5 font-medium shadow-sm",children:c(`continuityReadiness.state.${j}`)})]}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-lg leading-relaxed",children:c(`continuityReadiness.messages.${j}.description`,{group:y,count:u})})]})]})}),e.jsxs("div",{className:"mt-auto pt-4 flex flex-wrap items-center gap-2",children:[v>0&&e.jsx(C,{variant:"outline",className:"text-blue-700 bg-blue-50/50 border-blue-200/60 dark:border-blue-900/40 dark:bg-blue-900/20 dark:text-blue-300",children:c("historySyncLearningMap.cliproxyManaged",{count:v})}),h>0&&e.jsx(C,{variant:"outline",className:"text-amber-700 bg-amber-50/50 border-amber-200/60 dark:border-amber-900/40 dark:bg-amber-900/20 dark:text-amber-300",children:c("historySyncLearningMap.legacyConfirmation",{count:h})}),g.length>0&&b.length===0&&e.jsx(C,{variant:"secondary",className:"font-mono text-[11px] px-2 bg-muted/50 text-muted-foreground border-transparent",children:c("continuityOverview.recommendBadge",{group:y})}),n&&e.jsx(C,{variant:"secondary",className:"font-mono text-[11px] px-2 bg-muted/50 text-muted-foreground border-transparent",children:c("continuityOverview.partialBadge",{group:y})})]})]})}),(D||A)&&e.jsx(O,{className:"border-dashed",children:e.jsxs(G,{className:"p-5 space-y-4",children:[D&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:c("continuityOverview.plainLaneTitle")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:c("continuityOverview.plainLaneDescription",{lane:N||"plain ccs"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs -r"}),e.jsx(P,{value:"ccs -r",size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs auth backup default"}),e.jsx(P,{value:"ccs auth backup default",size:"icon"})]}),x?e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:`ccs auth default ${x}`}),e.jsx(P,{value:`ccs auth default ${x}`,size:"icon"})]}):e.jsx("p",{className:"text-xs text-muted-foreground",children:c("continuityOverview.setDefaultHint")})]})]}),A&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:c("continuityReadiness.stepsTitle")}),e.jsxs("ol",{className:"space-y-1 pl-5 text-sm text-muted-foreground",children:[e.jsx("li",{children:c("continuityReadiness.steps.syncBoth")}),e.jsx("li",{children:c("continuityReadiness.steps.sameGroup",{group:y})}),e.jsx("li",{children:c("continuityReadiness.steps.enableDeeper")}),e.jsx("li",{children:c("continuityReadiness.steps.resumeOriginal")})]})]})]})}),e.jsxs("div",{className:"flex flex-col md:flex-row items-center gap-3",children:[e.jsxs("div",{className:"flex-1 w-full flex items-center justify-between p-3.5 rounded-xl border border-blue-300/40 bg-blue-50/50 dark:border-blue-900/30 dark:bg-blue-900/10 shadow-sm transition-colors hover:bg-blue-100/40 dark:hover:bg-blue-900/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Z,{className:"h-4 w-4 text-blue-700/80 dark:text-blue-400/80"}),e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-blue-900 dark:text-blue-200",children:c("historySyncLearningMap.isolated")}),e.jsx(K,{titleKey:"accountsPage.isolated",descKey:"accountsPage.isolatedDesc"})]}),e.jsx("span",{className:"text-lg font-mono font-bold text-blue-900 dark:text-blue-200",children:t})]}),e.jsx(B,{className:"hidden md:block h-4 w-4 text-muted-foreground/40 shrink-0"}),e.jsxs("div",{className:"flex-1 w-full flex items-center justify-between p-3.5 rounded-xl border border-emerald-300/40 bg-emerald-50/50 dark:border-emerald-900/30 dark:bg-emerald-900/10 shadow-sm transition-colors hover:bg-emerald-100/40 dark:hover:bg-emerald-900/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{className:"h-4 w-4 text-emerald-700/80 dark:text-emerald-400/80"}),e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-emerald-900 dark:text-emerald-200",children:c("historySyncLearningMap.shared")}),e.jsx(K,{titleKey:"accountsPage.sharedStandard",descKey:"accountsPage.sharedStandardDesc"})]}),e.jsx("span",{className:"text-lg font-mono font-bold text-emerald-900 dark:text-emerald-200",children:m})]}),e.jsx(B,{className:"hidden md:block h-4 w-4 text-muted-foreground/40 shrink-0"}),e.jsxs("div",{className:"flex-1 w-full flex items-center justify-between p-3.5 rounded-xl border border-indigo-300/40 bg-indigo-50/50 dark:border-indigo-900/30 dark:bg-indigo-900/10 shadow-sm transition-colors hover:bg-indigo-100/40 dark:hover:bg-indigo-900/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ee,{className:"h-4 w-4 text-indigo-700/80 dark:text-indigo-400/80"}),e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-indigo-900 dark:text-indigo-200",children:c("historySyncLearningMap.deeper")}),e.jsx(K,{titleKey:"accountsPage.sharedDeeper",descKey:"accountsPage.sharedDeeperDesc"})]}),e.jsx("span",{className:"text-lg font-mono font-bold text-indigo-900 dark:text-indigo-200",children:s})]})]})]})}const ge=64;function gs({open:a,onClose:x}){const{t}=R(),[m,s]=k.useState(""),[u,r]=k.useState(!1),[l,g]=k.useState(""),[b,h]=k.useState(!1),[v,d]=k.useState(!1),c=/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(m),N=l.trim().toLowerCase().replace(/\s+/g,"-"),j=N.length===0||N.length<=ge&&/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(N),y=m&&c?[`ccs auth create ${m}`,u?N.length>0?`--context-group ${N}`:"--share-context":"",u&&b?"--deeper-continuity":""].filter(Boolean).join(" "):t("createAuthProfileDialog.commandFallback"),n=async()=>{!c||u&&!j||(await navigator.clipboard.writeText(y),d(!0),setTimeout(()=>d(!1),2e3))},o=()=>{s(""),r(!1),g(""),h(!1),d(!1),x()};return e.jsx(q,{open:a,onOpenChange:i=>!i&&o(),children:e.jsxs(W,{className:"sm:max-w-md",children:[e.jsxs(J,{children:[e.jsx(Q,{children:t("createAuthProfileDialog.title")}),e.jsx(Y,{children:t("createAuthProfileDialog.description")})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{htmlFor:"profile-name",children:t("createAuthProfileDialog.profileName")}),e.jsx(E,{id:"profile-name",value:m,onChange:i=>s(i.target.value),placeholder:t("createAuthProfileDialog.profileNamePlaceholder"),autoComplete:"off"}),m&&!c&&e.jsx("p",{className:"text-xs text-destructive",children:t("createAuthProfileDialog.invalidProfileName")})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ie,{id:"share-context",checked:u,onCheckedChange:i=>r(i===!0)}),e.jsx(S,{htmlFor:"share-context",className:"cursor-pointer",children:t("createAuthProfileDialog.enableSharedHistory")})]}),u&&e.jsxs("div",{className:"space-y-2 pl-6",children:[e.jsx(S,{htmlFor:"context-group",children:t("createAuthProfileDialog.historySyncGroupOptional")}),e.jsx(E,{id:"context-group",value:l,onChange:i=>g(i.target.value),placeholder:t("createAuthProfileDialog.historySyncGroupPlaceholder"),autoComplete:"off"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("createAuthProfileDialog.historySyncGroupHint")}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx(ie,{id:"deeper-continuity",checked:b,onCheckedChange:i=>h(i===!0)}),e.jsx(S,{htmlFor:"deeper-continuity",className:"cursor-pointer",children:t("createAuthProfileDialog.deeperContinuity")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("createAuthProfileDialog.deeperContinuityHint")}),l.trim().length>0&&!j&&e.jsx("p",{className:"text-xs text-destructive",children:t("createAuthProfileDialog.invalidContextGroup",{max:ge})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(S,{children:t("createAuthProfileDialog.command")}),e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-md font-mono text-sm",children:[e.jsx(ve,{className:"w-4 h-4 text-muted-foreground shrink-0"}),e.jsx("code",{className:"flex-1 break-all",children:y}),e.jsx(p,{variant:"ghost",size:"sm",className:"shrink-0 h-8 px-2",onClick:n,disabled:!c||u&&!j,children:v?e.jsx(V,{className:"w-4 h-4 text-green-500"}):e.jsx(oe,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[e.jsx("p",{children:t("createAuthProfileDialog.afterRunPrefix")}),e.jsxs("ol",{className:"list-decimal list-inside pl-2 space-y-0.5",children:[e.jsx("li",{children:t("createAuthProfileDialog.afterRunStep1")}),e.jsx("li",{children:t("createAuthProfileDialog.afterRunStep2")})]}),e.jsx("p",{className:"pt-1",children:t("createAuthProfileDialog.poolingHint")})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx(p,{variant:"ghost",onClick:o,children:t("createAuthProfileDialog.close")}),e.jsx(p,{onClick:n,disabled:!c||u&&!j,children:v?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"w-4 h-4 mr-2"}),t("createAuthProfileDialog.copied")]}):e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 mr-2"}),t("createAuthProfileDialog.copyCommand")]})})]})]})]})})}function Ts(){const{t:a}=R(),x=Ae(),{data:t,isLoading:m}=ss(),s=ts(),[u,r]=k.useState(!1),l=t?.accounts||[],g=t?.cliproxyCount||0,b=t?.legacyContextCount||0,h=t?.legacyContinuityCount||0,v=t?.sharedCount||0,d=t?.sharedStandardCount||0,c=t?.deeperSharedCount||0,N=t?.isolatedCount||0,j=t?.sharedAloneCount||0,y=t?.sharedPeerAccountCount||0,n=t?.deeperReadyAccountCount||0,o=t?.sharedPeerGroups||[],i=t?.deeperReadyGroups||[],w=t?.sharedGroups||[],D=t?.groupSummaries||[],A=t?.plainCcsLane||null,$=l.filter(H=>H.context_inferred||H.continuity_inferred),T=$.length,U=T>0,f=()=>x("/cliproxy?provider=claude"),I=()=>x("/cliproxy?provider=claude&action=auth"),_=()=>s.mutate($);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden h-full min-h-0 lg:flex",children:[e.jsxs("div",{className:"w-80 border-r flex flex-col bg-muted/20 shrink-0",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(xs,{className:"h-5 w-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:a("accountsPage.title")})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[a("accountsPage.managePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),a("accountsPage.manageSuffix")]})]}),e.jsx(Be,{className:"flex-1",children:e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:a("accountsPage.primaryActions")}),e.jsxs(p,{size:"sm",className:"w-full justify-start",onClick:()=>r(!0),children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),a("accountsPage.createAccount")]}),e.jsxs(p,{size:"sm",className:"w-full justify-start",onClick:I,children:[e.jsx(le,{className:"w-4 h-4 mr-2"}),a("accountsPage.authClaudeInPool")]}),e.jsxs(p,{variant:"outline",size:"sm",className:"w-full justify-start",onClick:f,children:[a("accountsPage.openClaudePoolSettings"),e.jsx(B,{className:"w-4 h-4 ml-auto"})]})]}),U?e.jsxs("section",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:a("accountsPage.migrationFollowup")}),e.jsxs("div",{className:"rounded-md border border-amber-500/50 bg-amber-500/10 p-3 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(X,{className:"h-4 w-4 mt-0.5 text-amber-700 dark:text-amber-400 shrink-0"}),e.jsxs("div",{className:"space-y-1 text-xs",children:[b>0&&e.jsx("p",{className:"text-amber-800 dark:text-amber-300",children:a("accountsPage.legacyContextPending",{count:b})}),h>0&&e.jsx("p",{className:"text-amber-800 dark:text-amber-300",children:a("accountsPage.legacyContinuityPending",{count:h})})]})]}),e.jsx(p,{variant:"secondary",size:"sm",className:"w-full justify-start",onClick:_,disabled:s.isPending||T===0,children:s.isPending?a("accountsPage.confirmingLegacy"):a("accountsPage.confirmLegacy",{count:T})})]})]}):e.jsx("div",{className:"rounded-md border bg-background px-3 py-2 text-xs text-muted-foreground",children:a("accountsPage.noLegacyFollowup")}),e.jsxs(O,{children:[e.jsxs(M,{className:"pb-2",children:[e.jsx(z,{className:"text-sm",children:a("accountsPage.quickCommands")}),e.jsx(F,{children:a("accountsPage.quickCommandsDesc")})]}),e.jsxs(G,{className:"space-y-2",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs auth create work --share-context --context-group sprint-a --deeper-continuity"}),e.jsx(P,{value:"ccs auth create work --share-context --context-group sprint-a --deeper-continuity",size:"icon"})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-2 font-mono text-[11px] flex items-start gap-2",children:[e.jsx("span",{className:"flex-1 break-all",children:"ccs cliproxy auth claude"}),e.jsx(P,{value:"ccs cliproxy auth claude",size:"icon"})]})]})]})]})})]}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col bg-background",children:[e.jsxs("div",{className:"px-5 py-4 border-b bg-background",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(C,{variant:"outline",children:a("accountsPage.workspaceBadge")}),e.jsx(C,{variant:"secondary",children:a("accountsPage.historySyncBadge")}),e.jsx(C,{variant:"secondary",children:a("accountsPage.resourcesBadge")})]}),e.jsx("h2",{className:"mt-2 text-xl font-semibold tracking-tight",children:a("accountsPage.authAccounts")}),e.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:[a("accountsPage.tableScopePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),a("accountsPage.tableScopeMiddle"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:a("accountsTable.sync")}),a("accountsPage.tableScopeSuffix")]})]}),e.jsxs("div",{className:"flex-1 min-h-0 p-5 space-y-4 overflow-y-auto",children:[e.jsx(he,{totalAccounts:l.length,primaryAccountName:l.length===1?l[0]?.name:null,isolatedCount:N,sharedStandardCount:d,deeperSharedCount:c,sharedAloneCount:j,sharedPeerAccountCount:y,deeperReadyAccountCount:n,sharedGroups:w,sharedPeerGroups:o,deeperReadyGroups:i,legacyTargetCount:T,cliproxyCount:g,plainCcsLane:A}),e.jsx(me,{totalAccounts:l.length,isolatedCount:N,sharedPeerGroups:o,deeperReadyGroups:i}),e.jsxs(O,{className:"flex flex-col",children:[e.jsxs(M,{className:"pb-3",children:[e.jsx(z,{className:"text-lg",children:a("accountsPage.accountMatrix")}),e.jsx(F,{children:a("accountsPage.sharedTotalDesc",{count:v})})]}),e.jsx(G,{children:m?e.jsx("div",{className:"text-muted-foreground",children:a("accountsPage.loadingAccounts")}):e.jsx(ue,{data:l,defaultAccount:t?.default??null,groupSummaries:D,plainCcsLane:A})})]})]})]})]}),e.jsxs("div",{className:"p-4 space-y-4 lg:hidden",children:[e.jsxs(O,{children:[e.jsxs(M,{children:[e.jsx(z,{className:"text-lg",children:a("accountsPage.title")}),e.jsxs(F,{children:[a("accountsPage.managePrefix"),e.jsx("code",{className:"mx-1 rounded bg-muted px-1 py-0.5",children:"ccs auth"}),a("accountsPage.mobileManageSuffix")]})]}),e.jsxs(G,{className:"space-y-2",children:[e.jsxs(p,{className:"w-full",onClick:()=>r(!0),children:[e.jsx(de,{className:"w-4 h-4 mr-2"}),a("accountsPage.createAccount")]}),e.jsxs(p,{variant:"outline",className:"w-full",onClick:f,children:[a("accountsPage.openCliProxyClaudePool"),e.jsx(B,{className:"w-4 h-4 ml-2"})]}),e.jsxs(p,{variant:"outline",className:"w-full",onClick:I,children:[a("accountsPage.authClaudeInPool"),e.jsx(le,{className:"w-4 h-4 ml-2"})]}),e.jsx(p,{variant:"outline",className:"w-full",onClick:_,disabled:s.isPending||T===0,children:s.isPending?a("accountsPage.confirmingLegacy"):a("accountsPage.confirmLegacy",{count:T})})]})]}),e.jsx(he,{totalAccounts:l.length,primaryAccountName:l.length===1?l[0]?.name:null,isolatedCount:N,sharedStandardCount:d,deeperSharedCount:c,sharedAloneCount:j,sharedPeerAccountCount:y,deeperReadyAccountCount:n,sharedGroups:w,sharedPeerGroups:o,deeperReadyGroups:i,legacyTargetCount:T,cliproxyCount:g,plainCcsLane:A}),e.jsx(me,{totalAccounts:l.length,isolatedCount:N,sharedPeerGroups:o,deeperReadyGroups:i}),e.jsxs(O,{children:[e.jsx(M,{className:"pb-3",children:e.jsx(z,{className:"text-base",children:a("accountsPage.accountMatrix")})}),e.jsx(G,{children:m?e.jsx("div",{className:"text-muted-foreground",children:a("accountsPage.loadingAccounts")}):e.jsx(ue,{data:l,defaultAccount:t?.default??null,groupSummaries:D,plainCcsLane:A})})]})]}),e.jsx(gs,{open:u,onClose:()=>r(!1)})]})}export{Ts as AccountsPage};
@@ -1 +1 @@
1
- import{j as e,a3 as s,a4 as r,a5 as n,a6 as i,a7 as d,a8 as c,a9 as u,aa as f}from"./radix-ui-nu4wz29m.js";import"./react-vendor-Bjx91N7w.js";import{c as o,bY as l}from"./index-D7crOfea.js";function A({...a}){return e.jsx(s,{"data-slot":"alert-dialog",...a})}function g({...a}){return e.jsx(u,{"data-slot":"alert-dialog-portal",...a})}function m({className:a,...t}){return e.jsx(f,{"data-slot":"alert-dialog-overlay",className:o("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",a),...t})}function D({className:a,...t}){return e.jsxs(g,{children:[e.jsx(m,{}),e.jsx(r,{"data-slot":"alert-dialog-content",className:o("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",a),...t})]})}function b({className:a,...t}){return e.jsx("div",{"data-slot":"alert-dialog-header",className:o("flex flex-col gap-2 text-center sm:text-left",a),...t})}function N({className:a,...t}){return e.jsx("div",{"data-slot":"alert-dialog-footer",className:o("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",a),...t})}function v({className:a,...t}){return e.jsx(n,{"data-slot":"alert-dialog-title",className:o("text-lg font-semibold",a),...t})}function w({className:a,...t}){return e.jsx(i,{"data-slot":"alert-dialog-description",className:o("text-muted-foreground text-sm",a),...t})}function y({className:a,...t}){return e.jsx(c,{className:o(l(),a),...t})}function z({className:a,...t}){return e.jsx(d,{className:o(l({variant:"outline"}),a),...t})}export{A,D as a,b,v as c,w as d,N as e,z as f,y as g};
1
+ import{j as e,a3 as s,a4 as r,a5 as n,a6 as i,a7 as d,a8 as c,a9 as u,aa as f}from"./radix-ui-nu4wz29m.js";import"./react-vendor-Bjx91N7w.js";import{c as o,bY as l}from"./index-CGgavq2X.js";function A({...a}){return e.jsx(s,{"data-slot":"alert-dialog",...a})}function g({...a}){return e.jsx(u,{"data-slot":"alert-dialog-portal",...a})}function m({className:a,...t}){return e.jsx(f,{"data-slot":"alert-dialog-overlay",className:o("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",a),...t})}function D({className:a,...t}){return e.jsxs(g,{children:[e.jsx(m,{}),e.jsx(r,{"data-slot":"alert-dialog-content",className:o("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",a),...t})]})}function b({className:a,...t}){return e.jsx("div",{"data-slot":"alert-dialog-header",className:o("flex flex-col gap-2 text-center sm:text-left",a),...t})}function N({className:a,...t}){return e.jsx("div",{"data-slot":"alert-dialog-footer",className:o("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",a),...t})}function v({className:a,...t}){return e.jsx(n,{"data-slot":"alert-dialog-title",className:o("text-lg font-semibold",a),...t})}function w({className:a,...t}){return e.jsx(i,{"data-slot":"alert-dialog-description",className:o("text-muted-foreground text-sm",a),...t})}function y({className:a,...t}){return e.jsx(c,{className:o(l(),a),...t})}function z({className:a,...t}){return e.jsx(d,{className:o(l({variant:"outline"}),a),...t})}export{A,D as a,b,v as c,w as d,N as e,z as f,y as g};