claude-code-workflow 7.2.18 → 7.2.20

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 (200) hide show
  1. package/.claude/commands/workflow/analyze-with-file.md +33 -8
  2. package/.codex/skills/analyze-with-file/SKILL.md +55 -8
  3. package/ccw/dist/core/routes/agent-definitions-routes.d.ts.map +1 -1
  4. package/ccw/dist/core/routes/agent-definitions-routes.js +152 -6
  5. package/ccw/dist/core/routes/agent-definitions-routes.js.map +1 -1
  6. package/ccw/frontend/dist/assets/{AlertDialog-5DA_OF9w.js → AlertDialog-Cukb0xv2.js} +2 -2
  7. package/ccw/frontend/dist/assets/{AlertDialog-5DA_OF9w.js.map → AlertDialog-Cukb0xv2.js.map} +1 -1
  8. package/ccw/frontend/dist/assets/{AnalysisPage-MoK5luZM.js → AnalysisPage-Ddmv0J4x.js} +2 -2
  9. package/ccw/frontend/dist/assets/{AnalysisPage-MoK5luZM.js.map → AnalysisPage-Ddmv0J4x.js.map} +1 -1
  10. package/ccw/frontend/dist/assets/{ApiSettingsPage-OreSF7CY.js → ApiSettingsPage-DMkrTZDX.js} +2 -2
  11. package/ccw/frontend/dist/assets/{ApiSettingsPage-OreSF7CY.js.map → ApiSettingsPage-DMkrTZDX.js.map} +1 -1
  12. package/ccw/frontend/dist/assets/{CliModeToggle-B_Vu8NDb.js → CliModeToggle-DXenjpbe.js} +2 -2
  13. package/ccw/frontend/dist/assets/{CliModeToggle-B_Vu8NDb.js.map → CliModeToggle-DXenjpbe.js.map} +1 -1
  14. package/ccw/frontend/dist/assets/{CliSessionSharePage-Bb3DrLGF.js → CliSessionSharePage-B-ZIMqmX.js} +2 -2
  15. package/ccw/frontend/dist/assets/{CliSessionSharePage-Bb3DrLGF.js.map → CliSessionSharePage-B-ZIMqmX.js.map} +1 -1
  16. package/ccw/frontend/dist/assets/{CliViewerPage-BS4zrFVp.js → CliViewerPage-9YxGyLxh.js} +2 -2
  17. package/ccw/frontend/dist/assets/{CliViewerPage-BS4zrFVp.js.map → CliViewerPage-9YxGyLxh.js.map} +1 -1
  18. package/ccw/frontend/dist/assets/{CodexLensPage-BWSIk06e.js → CodexLensPage-B_uv5wdn.js} +2 -2
  19. package/ccw/frontend/dist/assets/{CodexLensPage-BWSIk06e.js.map → CodexLensPage-B_uv5wdn.js.map} +1 -1
  20. package/ccw/frontend/dist/assets/{Collapsible-Cw1zJkjU.js → Collapsible-C2qk3yV0.js} +2 -2
  21. package/ccw/frontend/dist/assets/{Collapsible-Cw1zJkjU.js.map → Collapsible-C2qk3yV0.js.map} +1 -1
  22. package/ccw/frontend/dist/assets/{CommandsManagerPage-a240GHzx.js → CommandsManagerPage-DBtaWxLB.js} +2 -2
  23. package/ccw/frontend/dist/assets/{CommandsManagerPage-a240GHzx.js.map → CommandsManagerPage-DBtaWxLB.js.map} +1 -1
  24. package/ccw/frontend/dist/assets/{DeepWikiPage-CZ4pN-5G.js → DeepWikiPage-d9K4_TgG.js} +2 -2
  25. package/ccw/frontend/dist/assets/{DeepWikiPage-CZ4pN-5G.js.map → DeepWikiPage-d9K4_TgG.js.map} +1 -1
  26. package/ccw/frontend/dist/assets/{EndpointsPage-Ct66AIze.js → EndpointsPage-DhW6hYrI.js} +2 -2
  27. package/ccw/frontend/dist/assets/{EndpointsPage-Ct66AIze.js.map → EndpointsPage-DhW6hYrI.js.map} +1 -1
  28. package/ccw/frontend/dist/assets/{ExplorerPage-DAZkXx2Q.js → ExplorerPage-DYYpCvtB.js} +2 -2
  29. package/ccw/frontend/dist/assets/{ExplorerPage-DAZkXx2Q.js.map → ExplorerPage-DYYpCvtB.js.map} +1 -1
  30. package/ccw/frontend/dist/assets/{FixSessionPage-cDE32BH8.js → FixSessionPage-CSmiT5SE.js} +2 -2
  31. package/ccw/frontend/dist/assets/{FixSessionPage-cDE32BH8.js.map → FixSessionPage-CSmiT5SE.js.map} +1 -1
  32. package/ccw/frontend/dist/assets/{FloatingFileBrowser-tgDOT5P0.js → FloatingFileBrowser-DvMsXLdP.js} +2 -2
  33. package/ccw/frontend/dist/assets/{FloatingFileBrowser-tgDOT5P0.js.map → FloatingFileBrowser-DvMsXLdP.js.map} +1 -1
  34. package/ccw/frontend/dist/assets/{FloatingPanel-Diyvdyo1.js → FloatingPanel-sqezhSI8.js} +2 -2
  35. package/ccw/frontend/dist/assets/{FloatingPanel-Diyvdyo1.js.map → FloatingPanel-sqezhSI8.js.map} +1 -1
  36. package/ccw/frontend/dist/assets/{GraphExplorerPage-CPwRsfd2.js → GraphExplorerPage-DS8ghMFM.js} +2 -2
  37. package/ccw/frontend/dist/assets/{GraphExplorerPage-CPwRsfd2.js.map → GraphExplorerPage-DS8ghMFM.js.map} +1 -1
  38. package/ccw/frontend/dist/assets/{HistoryPage-D2F7j-xY.js → HistoryPage-B-x1RyHu.js} +2 -2
  39. package/ccw/frontend/dist/assets/{HistoryPage-D2F7j-xY.js.map → HistoryPage-B-x1RyHu.js.map} +1 -1
  40. package/ccw/frontend/dist/assets/{HookManagerPage-Cq_CqegO.js → HookManagerPage-BbxpDb68.js} +2 -2
  41. package/ccw/frontend/dist/assets/{HookManagerPage-Cq_CqegO.js.map → HookManagerPage-BbxpDb68.js.map} +1 -1
  42. package/ccw/frontend/dist/assets/{InstallationsPage-DeBLZFZg.js → InstallationsPage-3bShz_Ai.js} +2 -2
  43. package/ccw/frontend/dist/assets/{InstallationsPage-DeBLZFZg.js.map → InstallationsPage-3bShz_Ai.js.map} +1 -1
  44. package/ccw/frontend/dist/assets/{IssueHubPage-DqytkqBW.js → IssueHubPage-BQY_Hh3e.js} +2 -2
  45. package/ccw/frontend/dist/assets/{IssueHubPage-DqytkqBW.js.map → IssueHubPage-BQY_Hh3e.js.map} +1 -1
  46. package/ccw/frontend/dist/assets/{LiteTasksPage-BOknokuo.js → LiteTasksPage-vD_8fQcR.js} +17 -22
  47. package/ccw/frontend/dist/assets/LiteTasksPage-vD_8fQcR.js.map +1 -0
  48. package/ccw/frontend/dist/assets/{McpManagerPage-DPF421ki.js → McpManagerPage-CI5ZzB8A.js} +2 -2
  49. package/ccw/frontend/dist/assets/{McpManagerPage-DPF421ki.js.map → McpManagerPage-CI5ZzB8A.js.map} +1 -1
  50. package/ccw/frontend/dist/assets/{MemoryPage-CK-QH9cl.js → MemoryPage-CNuj2eNg.js} +2 -2
  51. package/ccw/frontend/dist/assets/{MemoryPage-CK-QH9cl.js.map → MemoryPage-CNuj2eNg.js.map} +1 -1
  52. package/ccw/frontend/dist/assets/{NotFoundPage-Bk_u5rzz.js → NotFoundPage-BrnAXkb1.js} +2 -2
  53. package/ccw/frontend/dist/assets/{NotFoundPage-Bk_u5rzz.js.map → NotFoundPage-BrnAXkb1.js.map} +1 -1
  54. package/ccw/frontend/dist/assets/{OrchestratorPage-B9ND5ptW.js → OrchestratorPage-CH81PGt4.js} +2 -2
  55. package/ccw/frontend/dist/assets/{OrchestratorPage-B9ND5ptW.js.map → OrchestratorPage-CH81PGt4.js.map} +1 -1
  56. package/ccw/frontend/dist/assets/{ProjectOverviewPage-0DUpa-rl.js → ProjectOverviewPage-dwiEXl2O.js} +2 -2
  57. package/ccw/frontend/dist/assets/{ProjectOverviewPage-0DUpa-rl.js.map → ProjectOverviewPage-dwiEXl2O.js.map} +1 -1
  58. package/ccw/frontend/dist/assets/{PromptHistoryPage-B--0N_wr.js → PromptHistoryPage-CabgLjJU.js} +2 -2
  59. package/ccw/frontend/dist/assets/{PromptHistoryPage-B--0N_wr.js.map → PromptHistoryPage-CabgLjJU.js.map} +1 -1
  60. package/ccw/frontend/dist/assets/{ReviewSessionPage-DJtY0kQl.js → ReviewSessionPage-DAMrNFn8.js} +2 -2
  61. package/ccw/frontend/dist/assets/{ReviewSessionPage-DJtY0kQl.js.map → ReviewSessionPage-DAMrNFn8.js.map} +1 -1
  62. package/ccw/frontend/dist/assets/{RulesManagerPage-yW19Un_V.js → RulesManagerPage-4jzmxPn0.js} +2 -2
  63. package/ccw/frontend/dist/assets/{RulesManagerPage-yW19Un_V.js.map → RulesManagerPage-4jzmxPn0.js.map} +1 -1
  64. package/ccw/frontend/dist/assets/{SessionDetailPage-tr8g0Hc1.js → SessionDetailPage-C5Btktmp.js} +2 -2
  65. package/ccw/frontend/dist/assets/{SessionDetailPage-tr8g0Hc1.js.map → SessionDetailPage-C5Btktmp.js.map} +1 -1
  66. package/ccw/frontend/dist/assets/{SessionsPage-CxDytLfb.js → SessionsPage-CQIB4E8m.js} +2 -2
  67. package/ccw/frontend/dist/assets/{SessionsPage-CxDytLfb.js.map → SessionsPage-CQIB4E8m.js.map} +1 -1
  68. package/ccw/frontend/dist/assets/SettingsPage-Yi9UAfm7.js +150 -0
  69. package/ccw/frontend/dist/assets/SettingsPage-Yi9UAfm7.js.map +1 -0
  70. package/ccw/frontend/dist/assets/{SkillsManagerPage-C0MOJy-C.js → SkillsManagerPage-BqfvYSkT.js} +2 -2
  71. package/ccw/frontend/dist/assets/{SkillsManagerPage-C0MOJy-C.js.map → SkillsManagerPage-BqfvYSkT.js.map} +1 -1
  72. package/ccw/frontend/dist/assets/{SpecsSettingsPage-D9Y6-U-n.js → SpecsSettingsPage-BdVPM5R6.js} +4 -4
  73. package/ccw/frontend/dist/assets/{SpecsSettingsPage-D9Y6-U-n.js.map → SpecsSettingsPage-BdVPM5R6.js.map} +1 -1
  74. package/ccw/frontend/dist/assets/{Switch-BEfkMCxZ.js → Switch-BG929kV0.js} +2 -2
  75. package/ccw/frontend/dist/assets/{Switch-BEfkMCxZ.js.map → Switch-BG929kV0.js.map} +1 -1
  76. package/ccw/frontend/dist/assets/{TabsNavigation-Dit0DM3m.js → TabsNavigation-Bol1y09b.js} +2 -2
  77. package/ccw/frontend/dist/assets/{TabsNavigation-Dit0DM3m.js.map → TabsNavigation-Bol1y09b.js.map} +1 -1
  78. package/ccw/frontend/dist/assets/{TaskDrawer-XN-D_bDk.js → TaskDrawer-Dwutrn8_.js} +2 -2
  79. package/ccw/frontend/dist/assets/{TaskDrawer-XN-D_bDk.js.map → TaskDrawer-Dwutrn8_.js.map} +1 -1
  80. package/ccw/frontend/dist/assets/{TeamPage-BOwkjrDi.js → TeamPage-CpCSwpxD.js} +2 -2
  81. package/ccw/frontend/dist/assets/{TeamPage-BOwkjrDi.js.map → TeamPage-CpCSwpxD.js.map} +1 -1
  82. package/ccw/frontend/dist/assets/{TerminalDashboardPage-X8RymrSN.js → TerminalDashboardPage-DODKjOeK.js} +2 -2
  83. package/ccw/frontend/dist/assets/{TerminalDashboardPage-X8RymrSN.js.map → TerminalDashboardPage-DODKjOeK.js.map} +1 -1
  84. package/ccw/frontend/dist/assets/{archive-BMXBzq8R.js → archive-CQw634kD.js} +2 -2
  85. package/ccw/frontend/dist/assets/{archive-BMXBzq8R.js.map → archive-CQw634kD.js.map} +1 -1
  86. package/ccw/frontend/dist/assets/{archive-restore-DHvAhQBT.js → archive-restore-B-_EG6wE.js} +2 -2
  87. package/ccw/frontend/dist/assets/{archive-restore-DHvAhQBT.js.map → archive-restore-B-_EG6wE.js.map} +1 -1
  88. package/ccw/frontend/dist/assets/{arrow-right-CBObFEN0.js → arrow-right-CcQtxBrU.js} +2 -2
  89. package/ccw/frontend/dist/assets/{arrow-right-CBObFEN0.js.map → arrow-right-CcQtxBrU.js.map} +1 -1
  90. package/ccw/frontend/dist/assets/{bookmark-plus-D-2SQ5pV.js → bookmark-plus-Cl-BbcpR.js} +2 -2
  91. package/ccw/frontend/dist/assets/{bookmark-plus-D-2SQ5pV.js.map → bookmark-plus-Cl-BbcpR.js.map} +1 -1
  92. package/ccw/frontend/dist/assets/{bot-DS7saQkk.js → bot-CLSNSkW_.js} +2 -2
  93. package/ccw/frontend/dist/assets/{bot-DS7saQkk.js.map → bot-CLSNSkW_.js.map} +1 -1
  94. package/ccw/frontend/dist/assets/{braces-D0pAnktp.js → braces-DWwkaDS6.js} +2 -2
  95. package/ccw/frontend/dist/assets/{braces-D0pAnktp.js.map → braces-DWwkaDS6.js.map} +1 -1
  96. package/ccw/frontend/dist/assets/{circle-stop-FWSboNE6.js → circle-stop-DiS7e6ma.js} +2 -2
  97. package/ccw/frontend/dist/assets/{circle-stop-FWSboNE6.js.map → circle-stop-DiS7e6ma.js.map} +1 -1
  98. package/ccw/frontend/dist/assets/{cpu-BNM2uIpY.js → cpu-CuvHUVXO.js} +2 -2
  99. package/ccw/frontend/dist/assets/{cpu-BNM2uIpY.js.map → cpu-CuvHUVXO.js.map} +1 -1
  100. package/ccw/frontend/dist/assets/{ellipsis-vertical-GwdnnWQj.js → ellipsis-vertical-BoVlINSw.js} +2 -2
  101. package/ccw/frontend/dist/assets/{ellipsis-vertical-GwdnnWQj.js.map → ellipsis-vertical-BoVlINSw.js.map} +1 -1
  102. package/ccw/frontend/dist/assets/{eye-kV2pWXQ5.js → eye-BEMOdcAN.js} +2 -2
  103. package/ccw/frontend/dist/assets/{eye-kV2pWXQ5.js.map → eye-BEMOdcAN.js.map} +1 -1
  104. package/ccw/frontend/dist/assets/{eye-off-6o-KYsBM.js → eye-off-C5HS4Ytm.js} +2 -2
  105. package/ccw/frontend/dist/assets/{eye-off-6o-KYsBM.js.map → eye-off-C5HS4Ytm.js.map} +1 -1
  106. package/ccw/frontend/dist/assets/{file-json-Q4_Blhd8.js → file-json-DQ9XLq0B.js} +2 -2
  107. package/ccw/frontend/dist/assets/{file-json-Q4_Blhd8.js.map → file-json-DQ9XLq0B.js.map} +1 -1
  108. package/ccw/frontend/dist/assets/{file-text-DSroEAMu.js → file-text-TGs_qCbw.js} +2 -2
  109. package/ccw/frontend/dist/assets/{file-text-DSroEAMu.js.map → file-text-TGs_qCbw.js.map} +1 -1
  110. package/ccw/frontend/dist/assets/{filter-A5I9Xz7E.js → filter-CIuCqnDB.js} +2 -2
  111. package/ccw/frontend/dist/assets/{filter-A5I9Xz7E.js.map → filter-CIuCqnDB.js.map} +1 -1
  112. package/ccw/frontend/dist/assets/{folder-DNNgXVVH.js → folder-BkivHBwn.js} +2 -2
  113. package/ccw/frontend/dist/assets/{folder-DNNgXVVH.js.map → folder-BkivHBwn.js.map} +1 -1
  114. package/ccw/frontend/dist/assets/{gauge-PfGM68A8.js → gauge-CtM68fVY.js} +2 -2
  115. package/ccw/frontend/dist/assets/{gauge-PfGM68A8.js.map → gauge-CtM68fVY.js.map} +1 -1
  116. package/ccw/frontend/dist/assets/{globe-C3X8YQrU.js → globe-DpnrINqP.js} +2 -2
  117. package/ccw/frontend/dist/assets/{globe-C3X8YQrU.js.map → globe-DpnrINqP.js.map} +1 -1
  118. package/ccw/frontend/dist/assets/{grid-3x3-DpyJO-oF.js → grid-3x3-SjX0a5JH.js} +2 -2
  119. package/ccw/frontend/dist/assets/{grid-3x3-DpyJO-oF.js.map → grid-3x3-SjX0a5JH.js.map} +1 -1
  120. package/ccw/frontend/dist/assets/{hard-drive-C2PQHoNg.js → hard-drive-ByAmnoEg.js} +2 -2
  121. package/ccw/frontend/dist/assets/{hard-drive-C2PQHoNg.js.map → hard-drive-ByAmnoEg.js.map} +1 -1
  122. package/ccw/frontend/dist/assets/{hash-DX8VaW1j.js → hash-DbLc3VOZ.js} +2 -2
  123. package/ccw/frontend/dist/assets/{hash-DX8VaW1j.js.map → hash-DbLc3VOZ.js.map} +1 -1
  124. package/ccw/frontend/dist/assets/{history-BXaQEkhy.js → history-Botz5Z5d.js} +2 -2
  125. package/ccw/frontend/dist/assets/{history-BXaQEkhy.js.map → history-Botz5Z5d.js.map} +1 -1
  126. package/ccw/frontend/dist/assets/{index-BiN-BRcE.js → index-BGvyf4-9.js} +2 -2
  127. package/ccw/frontend/dist/assets/{index-BiN-BRcE.js.map → index-BGvyf4-9.js.map} +1 -1
  128. package/ccw/frontend/dist/assets/index-BoqylFO4.css +39 -0
  129. package/ccw/frontend/dist/assets/{index-B8K8MdMl.js → index-DP_mTJI8.js} +3 -3
  130. package/ccw/frontend/dist/assets/{index-B8K8MdMl.js.map → index-DP_mTJI8.js.map} +1 -1
  131. package/ccw/frontend/dist/assets/{index-Dpe_7YH0.js → index-MkgdhX7a.js} +2 -2
  132. package/ccw/frontend/dist/assets/{index-Dpe_7YH0.js.map → index-MkgdhX7a.js.map} +1 -1
  133. package/ccw/frontend/dist/assets/{index-4zmlzlPo.js → index-ni-tG9rm.js} +2 -2
  134. package/ccw/frontend/dist/assets/{index-4zmlzlPo.js.map → index-ni-tG9rm.js.map} +1 -1
  135. package/ccw/frontend/dist/assets/{layout-grid-CUqTukRt.js → layout-grid-11E4bGJz.js} +2 -2
  136. package/ccw/frontend/dist/assets/{layout-grid-CUqTukRt.js.map → layout-grid-11E4bGJz.js.map} +1 -1
  137. package/ccw/frontend/dist/assets/{lightbulb-h90ex0mh.js → lightbulb-8KrKY82b.js} +2 -2
  138. package/ccw/frontend/dist/assets/{lightbulb-h90ex0mh.js.map → lightbulb-8KrKY82b.js.map} +1 -1
  139. package/ccw/frontend/dist/assets/{link-2-1-DjXqTg.js → link-2-BUn6RILb.js} +2 -2
  140. package/ccw/frontend/dist/assets/{link-2-1-DjXqTg.js.map → link-2-BUn6RILb.js.map} +1 -1
  141. package/ccw/frontend/dist/assets/{link-DbyJpuls.js → link-CmP254Ai.js} +2 -2
  142. package/ccw/frontend/dist/assets/{link-DbyJpuls.js.map → link-CmP254Ai.js.map} +1 -1
  143. package/ccw/frontend/dist/assets/{list-CU0leArg.js → list-BAwzl4a2.js} +2 -2
  144. package/ccw/frontend/dist/assets/{list-CU0leArg.js.map → list-BAwzl4a2.js.map} +1 -1
  145. package/ccw/frontend/dist/assets/{map-pin-DheJ6EJB.js → map-pin-gi342rqk.js} +2 -2
  146. package/ccw/frontend/dist/assets/{map-pin-DheJ6EJB.js.map → map-pin-gi342rqk.js.map} +1 -1
  147. package/ccw/frontend/dist/assets/{messages-square-Bmo5DCr1.js → messages-square-C1Lh8q8b.js} +2 -2
  148. package/ccw/frontend/dist/assets/{messages-square-Bmo5DCr1.js.map → messages-square-C1Lh8q8b.js.map} +1 -1
  149. package/ccw/frontend/dist/assets/{minimize-2-h1gktUQ6.js → minimize-2-OgWNLKdq.js} +2 -2
  150. package/ccw/frontend/dist/assets/{minimize-2-h1gktUQ6.js.map → minimize-2-OgWNLKdq.js.map} +1 -1
  151. package/ccw/frontend/dist/assets/{package-CmuCX6Z_.js → package-Djsvs5qp.js} +2 -2
  152. package/ccw/frontend/dist/assets/{package-CmuCX6Z_.js.map → package-Djsvs5qp.js.map} +1 -1
  153. package/ccw/frontend/dist/assets/{plug-Jz5HaKIu.js → plug-DvSZP2cp.js} +2 -2
  154. package/ccw/frontend/dist/assets/{plug-Jz5HaKIu.js.map → plug-DvSZP2cp.js.map} +1 -1
  155. package/ccw/frontend/dist/assets/{power-CpN5I4BU.js → power-BY7vTLmU.js} +2 -2
  156. package/ccw/frontend/dist/assets/{power-CpN5I4BU.js.map → power-BY7vTLmU.js.map} +1 -1
  157. package/ccw/frontend/dist/assets/{save-B3iyK-h8.js → save-DXfqv84T.js} +2 -2
  158. package/ccw/frontend/dist/assets/{save-B3iyK-h8.js.map → save-DXfqv84T.js.map} +1 -1
  159. package/ccw/frontend/dist/assets/{send-CYO-YU9A.js → send-E2o2LZSX.js} +2 -2
  160. package/ccw/frontend/dist/assets/{send-CYO-YU9A.js.map → send-E2o2LZSX.js.map} +1 -1
  161. package/ccw/frontend/dist/assets/settings-2-ChD1LFHH.js +7 -0
  162. package/ccw/frontend/dist/assets/settings-2-ChD1LFHH.js.map +1 -0
  163. package/ccw/frontend/dist/assets/{square-check-big-1h37S4wz.js → square-check-big-CBymuqmD.js} +2 -2
  164. package/ccw/frontend/dist/assets/{square-check-big-1h37S4wz.js.map → square-check-big-CBymuqmD.js.map} +1 -1
  165. package/ccw/frontend/dist/assets/{square-pen-BS0-oO7y.js → square-pen-BfaiJgOX.js} +2 -2
  166. package/ccw/frontend/dist/assets/{square-pen-BS0-oO7y.js.map → square-pen-BfaiJgOX.js.map} +1 -1
  167. package/ccw/frontend/dist/assets/{star-Dal-o3Lo.js → star-DHMWqZ09.js} +2 -2
  168. package/ccw/frontend/dist/assets/{star-Dal-o3Lo.js.map → star-DHMWqZ09.js.map} +1 -1
  169. package/ccw/frontend/dist/assets/{style-wEWj0pe8.js → style-wvcOEAiM.js} +2 -2
  170. package/ccw/frontend/dist/assets/{style-wEWj0pe8.js.map → style-wvcOEAiM.js.map} +1 -1
  171. package/ccw/frontend/dist/assets/{target-BB9AJiC7.js → target-B8AMmf_N.js} +2 -2
  172. package/ccw/frontend/dist/assets/{target-BB9AJiC7.js.map → target-B8AMmf_N.js.map} +1 -1
  173. package/ccw/frontend/dist/assets/{test-tube-DDnQZrAm.js → test-tube-BpDeTJi1.js} +2 -2
  174. package/ccw/frontend/dist/assets/{test-tube-DDnQZrAm.js.map → test-tube-BpDeTJi1.js.map} +1 -1
  175. package/ccw/frontend/dist/assets/{upload-DshzYJC_.js → upload-pflkdIDG.js} +2 -2
  176. package/ccw/frontend/dist/assets/{upload-DshzYJC_.js.map → upload-pflkdIDG.js.map} +1 -1
  177. package/ccw/frontend/dist/assets/{useApiSettings-DkV-yWup.js → useApiSettings-BPx4DyKT.js} +2 -2
  178. package/ccw/frontend/dist/assets/{useApiSettings-DkV-yWup.js.map → useApiSettings-BPx4DyKT.js.map} +1 -1
  179. package/ccw/frontend/dist/assets/{useCli-CnwgIkqD.js → useCli-D1jfH3XA.js} +2 -2
  180. package/ccw/frontend/dist/assets/{useCli-CnwgIkqD.js.map → useCli-D1jfH3XA.js.map} +1 -1
  181. package/ccw/frontend/dist/assets/{useCommands-S0sc5bfK.js → useCommands-DhR71vpa.js} +2 -2
  182. package/ccw/frontend/dist/assets/{useCommands-S0sc5bfK.js.map → useCommands-DhR71vpa.js.map} +1 -1
  183. package/ccw/frontend/dist/assets/{useDebounce-HxG5rpQo.js → useDebounce-a6Yyer3m.js} +2 -2
  184. package/ccw/frontend/dist/assets/{useDebounce-HxG5rpQo.js.map → useDebounce-a6Yyer3m.js.map} +1 -1
  185. package/ccw/frontend/dist/assets/{useFileExplorer-CTg0zndf.js → useFileExplorer-B8W2JTj2.js} +2 -2
  186. package/ccw/frontend/dist/assets/{useFileExplorer-CTg0zndf.js.map → useFileExplorer-B8W2JTj2.js.map} +1 -1
  187. package/ccw/frontend/dist/assets/{useLocale-C2BlVToA.js → useLocale-aMHdQIL_.js} +2 -2
  188. package/ccw/frontend/dist/assets/{useLocale-C2BlVToA.js.map → useLocale-aMHdQIL_.js.map} +1 -1
  189. package/ccw/frontend/dist/assets/{useSkills-8IWJgwQU.js → useSkills-BHpc2LtN.js} +3 -3
  190. package/ccw/frontend/dist/assets/{useSkills-8IWJgwQU.js.map → useSkills-BHpc2LtN.js.map} +1 -1
  191. package/ccw/frontend/dist/assets/{useSystemSettings-BAtCCf8T.js → useSystemSettings-BFD0SvEF.js} +2 -2
  192. package/ccw/frontend/dist/assets/{useSystemSettings-BAtCCf8T.js.map → useSystemSettings-BFD0SvEF.js.map} +1 -1
  193. package/ccw/frontend/dist/assets/{wand-sparkles-CI1Tfudg.js → wand-sparkles-dYtI2IKM.js} +2 -2
  194. package/ccw/frontend/dist/assets/{wand-sparkles-CI1Tfudg.js.map → wand-sparkles-dYtI2IKM.js.map} +1 -1
  195. package/ccw/frontend/dist/index.html +2 -2
  196. package/package.json +1 -1
  197. package/ccw/frontend/dist/assets/LiteTasksPage-BOknokuo.js.map +0 -1
  198. package/ccw/frontend/dist/assets/SettingsPage-DJltvfrs.js +0 -144
  199. package/ccw/frontend/dist/assets/SettingsPage-DJltvfrs.js.map +0 -1
  200. package/ccw/frontend/dist/assets/index-D6YeIKg_.css +0 -39
@@ -1,144 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B8K8MdMl.js","assets/index-D6YeIKg_.css"])))=>i.map(i=>d[i]);
2
- import{O as Z,r as d,ab as ys,u as H,co as Ee,j as e,al as ws,cp as ks,cq as he,cr as _e,cs as Cs,ct as J,cu as Ss,cv as Ts,cw as Es,cx as Ms,aq as Fs,ar as Ls,as as $e,c as A,at as Ds,au as Us,C as _,B as $,bq as W,e as N,X as G,cy as Me,ap as pe,cz as Ps,cA as Is,cB as Fe,aV as Ge,cC as As,I as U,_ as I,R as X,a7 as Se,cD as Rs,bu as Be,U as Os,l as Hs,cE as zs,cF as _s,ao as $s,cG as Bs,cH as ge,cI as Vs,cJ as qs,cK as Ws,S as Gs,cL as Ks,cM as Ve,aw as Le,cN as Js,aP as Xs,an as Qs,cO as Ys,i as Zs,F as et,N as st,aU as tt,bX as at}from"./index-B8K8MdMl.js";import{A as nt,a as rt,b as it,c as lt,d as ot,e as ct,f as dt,g as mt}from"./AlertDialog-5DA_OF9w.js";import{u as ut,a as xt,b as ht,c as gt,d as ft,e as pt,f as bt,g as jt,h as Nt,i as vt,j as yt,k as wt,l as kt}from"./useSystemSettings-BAtCCf8T.js";import{u as Ct}from"./useLocale-C2BlVToA.js";import{T as St}from"./test-tube-DDnQZrAm.js";import{L as Tt}from"./link-DbyJpuls.js";import{S as Et}from"./send-CYO-YU9A.js";import{E as ee}from"./eye-off-6o-KYsBM.js";import{E as se}from"./eye-kV2pWXQ5.js";import{S as De}from"./save-B3iyK-h8.js";import{B as Mt}from"./bot-DS7saQkk.js";import{u as Ft}from"./useDebounce-HxG5rpQo.js";import{C as Ke}from"./cpu-BNM2uIpY.js";import{U as Lt}from"./upload-DshzYJC_.js";import{P as Dt}from"./package-CmuCX6Z_.js";import{F as Ut}from"./folder-DNNgXVVH.js";/**
3
- * @license lucide-react v0.460.0 - ISC
4
- *
5
- * This source code is licensed under the ISC license.
6
- * See the LICENSE file in the root directory of this source tree.
7
- */const Pt=Z("BellOff",[["path",{d:"M8.7 3A6 6 0 0 1 18 8a21.3 21.3 0 0 0 .6 5",key:"o7mx20"}],["path",{d:"M17 17H3s3-2 3-9a4.67 4.67 0 0 1 .3-1.7",key:"16f1lm"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
8
- * @license lucide-react v0.460.0 - ISC
9
- *
10
- * This source code is licensed under the ISC license.
11
- * See the LICENSE file in the root directory of this source tree.
12
- */const Je=Z("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/**
13
- * @license lucide-react v0.460.0 - ISC
14
- *
15
- * This source code is licensed under the ISC license.
16
- * See the LICENSE file in the root directory of this source tree.
17
- */const Xe=Z("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/**
18
- * @license lucide-react v0.460.0 - ISC
19
- *
20
- * This source code is licensed under the ISC license.
21
- * See the LICENSE file in the root directory of this source tree.
22
- */const It=Z("LayoutPanelLeft",[["rect",{width:"7",height:"18",x:"3",y:"3",rx:"1",key:"2obqm"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}]]);/**
23
- * @license lucide-react v0.460.0 - ISC
24
- *
25
- * This source code is licensed under the ISC license.
26
- * See the LICENSE file in the root directory of this source tree.
27
- */const At=Z("MessageSquareText",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M13 8H7",key:"14i4kc"}],["path",{d:"M17 12H7",key:"16if0g"}]]);/**
28
- * @license lucide-react v0.460.0 - ISC
29
- *
30
- * This source code is licensed under the ISC license.
31
- * See the LICENSE file in the root directory of this source tree.
32
- */const Rt=Z("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);function Qe(){const s=document.cookie.match(/XSRF-TOKEN=([^;]+)/);return s?decodeURIComponent(s[1]):null}async function Ot(s,t=1,a=20){const i=new URLSearchParams({query:s,page:String(t),per_page:String(a)}),l=await fetch(`/api/unsplash/search?${i}`,{credentials:"same-origin"});if(!l.ok){const o=await l.json().catch(()=>({}));throw new Error(o.error||`Unsplash search failed: ${l.status}`)}return l.json()}async function Ht(s){const t={"Content-Type":s.type,"X-Filename":encodeURIComponent(s.name)},a=Qe();a&&(t["X-CSRF-Token"]=a);const i=await fetch("/api/background/upload",{method:"POST",headers:t,credentials:"same-origin",body:s});if(!i.ok){const l=await i.json().catch(()=>({}));throw new Error(l.error||`Upload failed: ${i.status}`)}return i.json()}async function zt(s){const t={"Content-Type":"application/json"},a=Qe();a&&(t["X-CSRF-Token"]=a),await fetch("/api/unsplash/download",{method:"POST",headers:t,credentials:"same-origin",body:JSON.stringify({downloadLocation:s})})}function _t(s,t=1,a=20){const[i,l]=d.useState(s);return d.useEffect(()=>{const o=setTimeout(()=>{l(s)},500);return()=>clearTimeout(o)},[s]),ys({queryKey:["unsplash-search",i,t,a],queryFn:()=>Ot(i,t,a),enabled:i.trim().length>0,staleTime:300*1e3,retry:1})}const $t=[{value:"gradient-only",labelId:"theme.background.mode.gradientOnly"},{value:"image-only",labelId:"theme.background.mode.imageOnly"},{value:"image-gradient",labelId:"theme.background.mode.imageGradient"}];function Bt(){const{formatMessage:s}=H(),{backgroundConfig:t,setBackgroundMode:a,setBackgroundImage:i,updateBackgroundEffect:l}=Ee(),[o,x]=d.useState(""),[p,C]=d.useState(1),[g,k]=d.useState(""),[h,F]=d.useState(!1),[m,b]=d.useState(null),v=d.useRef(null),{data:u,isLoading:P,isError:S,error:E}=_t(o,p),R=t.mode!=="gradient-only",V=d.useCallback(async r=>{i(r.regularUrl,{photographerName:r.photographer,photographerUrl:r.photographerUrl,photoUrl:r.photoUrl}),zt(r.downloadLocation).catch(()=>{})},[i]),O=d.useCallback(()=>{g.trim()&&(i(g.trim(),null),k(""))},[g,i]),j=d.useCallback(()=>{i(null,null)},[i]),y=d.useCallback(async r=>{var c;const f=(c=r.target.files)==null?void 0:c[0];if(f){if(r.target.value="",b(null),f.size>10*1024*1024){b(s({id:"theme.background.fileTooLarge"}));return}if(!f.type.startsWith("image/")||!["image/jpeg","image/png","image/webp","image/gif"].includes(f.type)){b(s({id:"theme.background.invalidType"}));return}F(!0);try{const L=await Ht(f);i(L.url,null)}catch(L){b(L.message||s({id:"theme.background.uploadError"}))}finally{F(!1)}}},[s,i]);return e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-medium text-text",children:s({id:"theme.background.title"})}),e.jsx("div",{className:"flex gap-2",role:"radiogroup","aria-label":s({id:"theme.background.title"}),children:$t.map(({value:r,labelId:f})=>e.jsx("button",{onClick:()=>a(r),role:"radio","aria-checked":t.mode===r,className:`
33
- flex-1 px-3 py-2 rounded-lg text-xs font-medium
34
- transition-all duration-200 border-2
35
- ${t.mode===r?"border-accent bg-surface shadow-md":"border-border bg-bg hover:bg-surface"}
36
- focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2
37
- `,children:s({id:f})},r))}),R&&e.jsxs("div",{className:"space-y-3",children:[t.imageUrl&&e.jsxs("div",{className:"relative rounded-lg overflow-hidden border border-border",children:[e.jsx("img",{src:t.imageUrl,alt:"Current background",className:"w-full h-32 object-cover"}),e.jsx("button",{onClick:j,className:"absolute top-2 right-2 px-2 py-1 text-xs bg-black/60 text-white rounded hover:bg-black/80 transition-colors",children:s({id:"theme.background.removeImage"})}),t.attribution&&e.jsxs("div",{className:"absolute bottom-0 left-0 right-0 px-2 py-1 bg-black/50 text-white text-xs",children:["Photo by"," ",e.jsx("a",{href:`${t.attribution.photographerUrl}?utm_source=ccw&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"underline",children:t.attribution.photographerName})," ","on"," ",e.jsx("a",{href:"https://unsplash.com/?utm_source=ccw&utm_medium=referral",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"Unsplash"})]})]}),e.jsx("input",{type:"text",value:o,onChange:r=>{x(r.target.value),C(1)},placeholder:s({id:"theme.background.searchPlaceholder"}),className:`w-full px-3 py-2 text-sm rounded-lg border border-border bg-bg text-text
38
- focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-1`}),P&&e.jsx("div",{className:"flex justify-center py-4",children:e.jsx("div",{className:"w-5 h-5 border-2 border-border border-t-accent rounded-full animate-spin"})}),S&&e.jsx("p",{className:"text-xs text-destructive py-2",children:(E==null?void 0:E.message)||s({id:"theme.background.searchError"})}),u&&u.photos.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-3 gap-2 max-h-60 overflow-y-auto",children:u.photos.map(r=>e.jsx("button",{onClick:()=>V(r),className:`
39
- relative rounded overflow-hidden border-2 transition-all
40
- hover:border-accent focus:outline-none focus:ring-2 focus:ring-accent
41
- ${t.imageUrl===r.regularUrl?"border-accent ring-2 ring-accent":"border-transparent"}
42
- `,children:e.jsx("img",{src:r.thumbUrl,alt:`Photo by ${r.photographer}`,className:"w-full h-20 object-cover",loading:"lazy"})},r.id))}),u.totalPages>1&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("button",{onClick:()=>C(r=>Math.max(1,r-1)),disabled:p<=1,className:"px-2 py-1 text-xs rounded border border-border disabled:opacity-50 hover:bg-surface",children:s({id:"theme.background.prev"})}),e.jsxs("span",{className:"text-xs text-text-secondary",children:[p," / ",u.totalPages]}),e.jsx("button",{onClick:()=>C(r=>Math.min(u.totalPages,r+1)),disabled:p>=u.totalPages,className:"px-2 py-1 text-xs rounded border border-border disabled:opacity-50 hover:bg-surface",children:s({id:"theme.background.next"})})]})]}),u&&u.photos.length===0&&o.trim()&&e.jsx("p",{className:"text-xs text-text-secondary py-2 text-center",children:s({id:"theme.background.noResults"})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"url",value:g,onChange:r=>k(r.target.value),placeholder:s({id:"theme.background.customUrlPlaceholder"}),className:`flex-1 px-3 py-2 text-xs rounded-lg border border-border bg-bg text-text
43
- focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-1`}),e.jsx("button",{onClick:O,disabled:!g.trim(),className:"px-3 py-2 text-xs rounded-lg bg-accent text-white disabled:opacity-50 hover:opacity-90 transition-opacity",children:s({id:"theme.background.apply"})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("input",{ref:v,type:"file",accept:"image/jpeg,image/png,image/webp,image/gif",onChange:y,className:"hidden"}),e.jsx("button",{onClick:()=>{var r;return(r=v.current)==null?void 0:r.click()},disabled:h,className:`w-full px-3 py-2 text-xs rounded-lg border border-dashed border-border
44
- bg-bg text-text hover:bg-surface hover:border-accent
45
- disabled:opacity-50 transition-all flex items-center justify-center gap-2`,children:h?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-3.5 h-3.5 border-2 border-border border-t-accent rounded-full animate-spin"}),s({id:"theme.background.uploading"})]}):s({id:"theme.background.upload"})}),m&&e.jsx("p",{className:"text-xs text-destructive",children:m})]})]}),R&&e.jsxs("div",{className:"space-y-3 pt-2 border-t border-border",children:[e.jsx("h4",{className:"text-xs font-medium text-text-secondary",children:s({id:"theme.background.effects"})}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("label",{className:"text-xs text-text",children:s({id:"theme.background.blur"})}),e.jsxs("span",{className:"text-xs text-text-secondary",children:[t.effects.blur,"px"]})]}),e.jsx("input",{type:"range",min:"0",max:"20",step:"1",value:t.effects.blur,onChange:r=>l("blur",Number(r.target.value)),className:"w-full accent-[hsl(var(--accent))]"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("label",{className:"text-xs text-text",children:s({id:"theme.background.darken"})}),e.jsxs("span",{className:"text-xs text-text-secondary",children:[t.effects.darkenOpacity,"%"]})]}),e.jsx("input",{type:"range",min:"0",max:"80",step:"1",value:t.effects.darkenOpacity,onChange:r=>l("darkenOpacity",Number(r.target.value)),className:"w-full accent-[hsl(var(--accent))]"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("label",{className:"text-xs text-text",children:s({id:"theme.background.saturation"})}),e.jsxs("span",{className:"text-xs text-text-secondary",children:[t.effects.saturation,"%"]})]}),e.jsx("input",{type:"range",min:"0",max:"200",step:"5",value:t.effects.saturation,onChange:r=>l("saturation",Number(r.target.value)),className:"w-full accent-[hsl(var(--accent))]"})]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:t.effects.enableFrostedGlass,onChange:r=>l("enableFrostedGlass",r.target.checked),className:"w-4 h-4 rounded border-border text-accent focus:ring-2 focus:ring-accent focus:ring-offset-2"}),e.jsx("span",{className:"text-sm text-text",children:s({id:"theme.background.frostedGlass"})})]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:t.effects.enableGrain,onChange:r=>l("enableGrain",r.target.checked),className:"w-4 h-4 rounded border-border text-accent focus:ring-2 focus:ring-accent focus:ring-offset-2"}),e.jsx("span",{className:"text-sm text-text",children:s({id:"theme.background.grain"})})]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:t.effects.enableVignette,onChange:r=>l("enableVignette",r.target.checked),className:"w-4 h-4 rounded border-border text-accent focus:ring-2 focus:ring-accent focus:ring-offset-2"}),e.jsx("span",{className:"text-sm text-text",children:s({id:"theme.background.vignette"})})]})]})]})}function Vt(){const{formatMessage:s}=H(),{colorScheme:t,resolvedTheme:a,customHue:i,isCustomTheme:l,gradientLevel:o,enableHoverGlow:x,enableBackgroundAnimation:p,motionPreference:C,setColorScheme:g,setTheme:k,setCustomHue:h,setGradientLevel:F,setEnableHoverGlow:m,setEnableBackgroundAnimation:b,setMotionPreference:v,styleTier:u,setStyleTier:P,themeSlots:S,activeSlotId:E,canAddSlot:R,setActiveSlot:V,copySlot:O,renameSlot:j,deleteSlot:y,undoDeleteSlot:r,exportThemeCode:f,importThemeCode:c,setBackgroundConfig:L}=Ee(),{addToast:z,removeToast:q}=ws(),[B,be]=d.useState(i),[Ue,Pe]=d.useState([]),[Ze,Ie]=d.useState({}),[es,je]=d.useState(!1),[Q,Ne]=d.useState(null),[re,ie]=d.useState(""),[le,ve]=d.useState(null),te=d.useRef(null),oe=d.useRef(null),[ye,Ae]=d.useState(!1),[ss,we]=d.useState(""),[T,ce]=d.useState(null),[ts,de]=d.useState(null),[me,ue]=d.useState(null),[as,Re]=d.useState(!1);d.useEffect(()=>{be(i)},[i]);const K=a,ae=n=>{const w=he(B??180,K)[n];return w?`hsl(${w})`:"#888"},ns=[{id:"soft",nameKey:"theme.styleTier.soft",descKey:"theme.styleTier.softDesc"},{id:"standard",nameKey:"theme.styleTier.standard",descKey:"theme.styleTier.standardDesc"},{id:"high-contrast",nameKey:"theme.styleTier.highContrast",descKey:"theme.styleTier.highContrastDesc"}],rs=n=>{const D=he(i??220,K),w=n==="standard"?D:_e(D,n,K);return{bg:w["--bg"]?`hsl(${w["--bg"]})`:"#888",surface:w["--surface"]?`hsl(${w["--surface"]})`:"#888",accent:w["--accent"]?`hsl(${w["--accent"]})`:"#888"}},ke=n=>{l&&h(null),g(n)},is=()=>{i===null&&h(180)},ls=()=>{if(B!==null){h(B);const M=he(B,a),w=Es(M).filter(Y=>!Y.passed);if(w.length>0){Pe(w);const Y={};for(const ne of w){const vs=`${ne.fgVar}|${ne.bgVar}`;Y[vs]=Ms(ne.fgVar,ne.bgVar,M,ne.required)}Ie(Y),je(!0)}else Pe([]),Ie({}),je(!1)}},os=()=>{h(null),be(null)},cs=n=>{k(n)},ds=n=>{if(n.key==="ArrowRight"||n.key==="ArrowDown"){n.preventDefault();const D=(J.findIndex(w=>w.id===t)+1)%J.length;ke(J[D].id)}else if(n.key==="ArrowLeft"||n.key==="ArrowUp"){n.preventDefault();const D=(J.findIndex(w=>w.id===t)-1+J.length)%J.length;ke(J[D].id)}},ms=d.useCallback(n=>{n!==E&&V(n)},[E,V]),us=d.useCallback(()=>{R&&O()},[R,O]),Oe=d.useCallback((n,M)=>{Ne(n),ie(M),setTimeout(()=>{var D;return(D=te.current)==null?void 0:D.focus()},0)},[]),Ce=d.useCallback(()=>{Q&&re.trim()&&j(Q,re.trim()),Ne(null),ie("")},[Q,re,j]),He=d.useCallback(()=>{Ne(null),ie("")},[]),xs=d.useCallback(n=>{n.key==="Enter"?(n.preventDefault(),Ce()):n.key==="Escape"&&(n.preventDefault(),He())},[Ce,He]),hs=d.useCallback(()=>{if(!le)return;y(le),ve(null),oe.current&&q(oe.current);const n=z("info",s({id:"theme.slot.undoDelete"}),void 0,{duration:1e4,dismissible:!0,action:{label:s({id:"theme.slot.undo"}),onClick:()=>{r(),q(n),oe.current=null}}});oe.current=n},[le,y,z,q,r,s]),ze=d.useCallback(()=>{ve(null)},[]),gs=d.useCallback(async()=>{try{const n=f();await navigator.clipboard.writeText(n),Re(!0),setTimeout(()=>Re(!1),2e3)}catch{z("error","Failed to copy to clipboard")}},[f,z]),fs=d.useCallback(()=>{Ae(!0),we(""),ce(null),de(null),ue(null)},[]),xe=d.useCallback(()=>{Ae(!1),we(""),ce(null),de(null),ue(null)},[]),ps=d.useCallback(n=>{if(we(n),ue(null),de(null),ce(null),!n.trim())return;const M=c(n);M.ok?(ce(M.payload),M.warning&&de(M.warning)):ue(M.error)},[c]),bs=d.useCallback(()=>{T&&(!R&&E==="default"?(T.customHue!==null?h(T.customHue):(h(null),g(T.colorScheme)),F(T.gradientLevel),m(T.enableHoverGlow),b(T.enableBackgroundAnimation),P(T.styleTier)):R?(O(),T.customHue!==null?h(T.customHue):(h(null),g(T.colorScheme)),F(T.gradientLevel),m(T.enableHoverGlow),b(T.enableBackgroundAnimation),P(T.styleTier)):(T.customHue!==null?h(T.customHue):(h(null),g(T.colorScheme)),F(T.gradientLevel),m(T.enableHoverGlow),b(T.enableBackgroundAnimation),P(T.styleTier)),L(T.backgroundConfig??ks),z("success",s({id:"theme.share.importSuccess"})),xe())},[T,R,E,O,h,g,F,m,b,P,L,z,s,xe]),js=d.useCallback(n=>{const M=n.customHue??220,D=he(M,K),w=n.styleTier==="standard"?D:_e(D,n.styleTier,K);return{bg:w["--bg"]?`hsl(${w["--bg"]})`:"#888",surface:w["--surface"]?`hsl(${w["--surface"]})`:"#888",accent:w["--accent"]?`hsl(${w["--accent"]})`:"#888",text:w["--text"]?`hsl(${w["--text"]})`:"#888"}},[K]),Ns=n=>{switch(n){case"incompatible_version":return"theme.share.incompatibleVersion";default:return"theme.share.invalidCode"}};return d.useEffect(()=>{Q&&te.current&&(te.current.focus(),te.current.select())},[Q]),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h3",{className:"text-sm font-medium text-text",children:s({id:"theme.slot.title"})}),e.jsxs("button",{onClick:us,disabled:!R,title:R?s({id:"theme.slot.copy"}):s({id:"theme.slot.limitReached"},{limit:Cs}),className:`
46
- px-2 py-1 rounded text-xs font-medium
47
- transition-all duration-200
48
- ${R?"bg-accent text-white hover:bg-accent-hover focus:ring-2 focus:ring-accent focus:ring-offset-1":"bg-muted text-muted-text cursor-not-allowed"}
49
- focus:outline-none
50
- `,children:["+ ",s({id:"theme.slot.copy"})]})]}),e.jsx("div",{className:"flex gap-2",role:"tablist","aria-label":s({id:"theme.slot.title"}),children:S.map(n=>{const M=n.id===E,D=n.id===Q;return e.jsxs("div",{role:"tab","aria-selected":M,tabIndex:M?0:-1,onClick:()=>ms(n.id),className:`
51
- relative flex-1 min-w-0 p-2.5 rounded-lg cursor-pointer
52
- transition-all duration-200 border-2 group
53
- ${M?"border-accent bg-surface shadow-md":"border-border bg-bg hover:bg-surface"}
54
- focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-1
55
- `,children:[M&&e.jsx("span",{className:"absolute -top-1 -right-1 w-2.5 h-2.5 rounded-full bg-accent border-2 border-bg"}),e.jsx("div",{className:"flex items-center gap-1 min-w-0",children:D?e.jsx("input",{ref:te,type:"text",value:re,onChange:w=>ie(w.target.value),onKeyDown:xs,onBlur:Ce,onClick:w=>w.stopPropagation(),className:`\r
56
- w-full px-1 py-0.5 text-xs font-medium text-text\r
57
- bg-bg border border-accent rounded\r
58
- focus:outline-none focus:ring-1 focus:ring-accent\r
59
- `,maxLength:20}):e.jsx("span",{className:"text-xs font-medium text-text truncate",title:n.name,onDoubleClick:w=>{w.stopPropagation(),n.isDefault||Oe(n.id,n.name)},children:n.name})}),M&&!D&&e.jsx("span",{className:"text-[10px] text-accent font-medium mt-0.5 block",children:s({id:"theme.slot.active"})}),!n.isDefault&&!D&&e.jsxs("div",{className:`\r
60
- absolute top-1 right-1 flex gap-0.5\r
61
- opacity-0 group-hover:opacity-100 transition-opacity duration-150\r
62
- `,children:[e.jsx("button",{onClick:w=>{w.stopPropagation(),Oe(n.id,n.name)},title:s({id:"theme.slot.rename"}),className:`\r
63
- p-0.5 rounded text-text-tertiary hover:text-text hover:bg-surface-hover\r
64
- transition-colors duration-150 focus:outline-none\r
65
- `,children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M11.5 1.5L14.5 4.5L5 14H2V11L11.5 1.5Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsx("button",{onClick:w=>{w.stopPropagation(),ve(n.id)},title:s({id:"theme.slot.delete"}),className:`\r
66
- p-0.5 rounded text-text-tertiary hover:text-error hover:bg-error-light\r
67
- transition-colors duration-150 focus:outline-none\r
68
- `,children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),n.isDefault&&e.jsx("div",{className:`\r
69
- absolute top-1 right-1 flex gap-0.5\r
70
- opacity-0 group-hover:opacity-100 transition-opacity duration-150\r
71
- `,children:e.jsx("button",{disabled:!0,title:s({id:"theme.slot.cannotDeleteDefault"}),className:"p-0.5 rounded text-muted-text cursor-not-allowed",children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})})]},n.id)})})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-text mb-3",children:s({id:"theme.title.colorScheme"})}),e.jsxs("div",{className:"grid grid-cols-5 gap-3",role:"group","aria-label":"Color scheme selection",onKeyDown:ds,children:[J.map(n=>e.jsxs("button",{onClick:()=>ke(n.id),"aria-label":s({id:"theme.select.colorScheme"},{name:s({id:`theme.colorScheme.${n.id}`})}),"aria-selected":t===n.id&&!l,role:"radio",className:`
72
- flex flex-col items-center gap-2 p-3 rounded-lg
73
- transition-all duration-200 border-2
74
- ${t===n.id&&!l?"border-accent bg-surface shadow-md":"border-border bg-bg hover:bg-surface"}
75
- focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2
76
- `,children:[e.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-border shadow-sm",style:{backgroundColor:n.accentColor},"aria-hidden":"true"}),e.jsx("span",{className:"text-xs font-medium text-text text-center",children:s({id:`theme.colorScheme.${n.id}`})})]},n.id)),e.jsxs("button",{onClick:is,"aria-label":s({id:"theme.select.colorScheme"},{name:s({id:"theme.colorScheme.custom"})}),"aria-selected":l,role:"radio",className:`
77
- flex flex-col items-center gap-2 p-3 rounded-lg
78
- transition-all duration-200 border-2
79
- ${l?"border-accent bg-surface shadow-md":"border-border bg-bg hover:bg-surface"}
80
- focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2
81
- `,children:[e.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-border shadow-sm",style:{background:`linear-gradient(135deg, ${ae("--accent")}, ${ae("--primary")})`},"aria-hidden":"true"}),e.jsx("span",{className:"text-xs font-medium text-text text-center",children:s({id:"theme.colorScheme.custom"})})]})]})]}),l&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-medium text-text mb-3",children:s({id:"theme.title.customHue"})}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("label",{htmlFor:"hue-slider",className:"text-xs text-text-secondary",children:s({id:"theme.hueValue"},{value:B??180})})}),e.jsx("input",{id:"hue-slider",type:"range",min:"0",max:"360",step:"1",value:B??180,onChange:n=>be(Number(n.target.value)),className:"w-full h-2 rounded-lg appearance-none cursor-pointer",style:{background:`linear-gradient(to right,
82
- hsl(0, 70%, 60%), hsl(60, 70%, 60%), hsl(120, 70%, 60%),
83
- hsl(180, 70%, 60%), hsl(240, 70%, 60%), hsl(300, 70%, 60%), hsl(360, 70%, 60%))`},"aria-label":s({id:"theme.title.customHue"})}),e.jsxs("div",{className:"flex gap-3 items-end",children:[e.jsxs("span",{className:"text-xs text-text-secondary pb-1",children:[s({id:"theme.preview"}),":"]}),e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("div",{className:"w-10 h-10 rounded border-2 border-border shadow-sm",style:{backgroundColor:ae("--bg")}}),e.jsx("span",{className:"text-[10px] text-text-tertiary",children:s({id:"theme.preview.background"})})]}),e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("div",{className:"w-10 h-10 rounded border-2 border-border shadow-sm",style:{backgroundColor:ae("--surface")}}),e.jsx("span",{className:"text-[10px] text-text-tertiary",children:s({id:"theme.preview.surface"})})]}),e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("div",{className:"w-10 h-10 rounded border-2 border-border shadow-sm",style:{backgroundColor:ae("--accent")}}),e.jsx("span",{className:"text-[10px] text-text-tertiary",children:s({id:"theme.preview.accent"})})]})]}),e.jsxs("div",{className:"flex gap-2 pt-2",children:[e.jsx("button",{onClick:ls,disabled:B===i,className:`
84
- flex-1 px-4 py-2 rounded-lg text-sm font-medium
85
- transition-all duration-200
86
- ${B===i?"bg-muted text-muted-text cursor-not-allowed":"bg-accent text-white hover:bg-accent-hover focus:ring-2 focus:ring-accent focus:ring-offset-2"}
87
- `,children:s({id:"theme.save"})}),e.jsx("button",{onClick:os,className:`\r
88
- px-4 py-2 rounded-lg text-sm font-medium\r
89
- border-2 border-border bg-bg text-text\r
90
- hover:bg-surface transition-all duration-200\r
91
- focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2\r
92
- `,children:s({id:"theme.reset"})})]})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-text mb-3",children:s({id:"theme.styleTier.label"})}),e.jsx("div",{className:"grid grid-cols-3 gap-3",role:"radiogroup","aria-label":s({id:"theme.styleTier.label"}),children:ns.map(n=>{const M=rs(n.id),D=u===n.id;return e.jsxs("button",{onClick:()=>P(n.id),role:"radio","aria-checked":D,className:`
93
- flex flex-col items-center gap-2 p-3 rounded-lg
94
- transition-all duration-200 border-2
95
- ${D?"border-accent bg-surface shadow-md":"border-border bg-bg hover:bg-surface"}
96
- focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2
97
- `,children:[e.jsxs("div",{className:"flex gap-1","aria-hidden":"true",children:[e.jsx("div",{className:"w-5 h-5 rounded-sm border border-border",style:{backgroundColor:M.bg}}),e.jsx("div",{className:"w-5 h-5 rounded-sm border border-border",style:{backgroundColor:M.surface}}),e.jsx("div",{className:"w-5 h-5 rounded-sm border border-border",style:{backgroundColor:M.accent}})]}),e.jsx("span",{className:"text-xs font-medium text-text text-center",children:s({id:n.nameKey})}),e.jsx("span",{className:"text-[10px] text-text-tertiary text-center leading-tight",children:s({id:n.descKey})})]},n.id)})})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-text mb-3",children:s({id:"theme.gradient.title"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex gap-2",role:"radiogroup","aria-label":s({id:"theme.gradient.title"}),children:["off","standard","enhanced"].map(n=>e.jsx("button",{onClick:()=>F(n),role:"radio","aria-checked":o===n,className:`
98
- flex-1 px-3 py-2 rounded-lg text-sm font-medium
99
- transition-all duration-200 border-2
100
- ${o===n?"border-accent bg-surface shadow-md":"border-border bg-bg hover:bg-surface"}
101
- focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2
102
- `,children:s({id:`theme.gradient.${n}`})},n))}),e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:x,onChange:n=>m(n.target.checked),className:`\r
103
- w-4 h-4 rounded border-border text-accent\r
104
- focus:ring-2 focus:ring-accent focus:ring-offset-2\r
105
- `}),e.jsx("span",{className:"text-sm text-text",children:s({id:"theme.gradient.hoverGlow"})})]}),e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:p,onChange:n=>b(n.target.checked),className:`\r
106
- w-4 h-4 rounded border-border text-accent\r
107
- focus:ring-2 focus:ring-accent focus:ring-offset-2\r
108
- `}),e.jsx("span",{className:"text-sm text-text",children:s({id:"theme.gradient.bgAnimation"})})]})]})]}),e.jsx(Bt,{}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-text mb-3",children:s({id:"theme.motion.label"})}),e.jsx("div",{className:"flex gap-2",role:"radiogroup","aria-label":s({id:"theme.motion.label"}),children:["system","reduce","enable"].map(n=>e.jsx("button",{onClick:()=>v(n),role:"radio","aria-checked":C===n,className:`
109
- flex-1 px-3 py-2 rounded-lg text-sm font-medium
110
- transition-all duration-200 border-2
111
- ${C===n?"border-accent bg-surface shadow-md":"border-border bg-bg hover:bg-surface"}
112
- focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2
113
- `,children:s({id:`theme.motion.${n}`})},n))})]}),es&&Ue.length>0&&e.jsxs("div",{className:"p-3 rounded-lg bg-warning-light border border-warning text-warning-text space-y-2",children:[e.jsx("p",{className:"text-xs font-medium",children:s({id:"theme.accessibility.contrastWarning"})}),e.jsx("ul",{className:"text-xs space-y-1",children:Ue.map(n=>{const M=`${n.fgVar}|${n.bgVar}`,D=Ze[M]||[];return e.jsxs("li",{className:"space-y-1",children:[e.jsxs("span",{children:[n.fgVar," / ",n.bgVar,": ",n.ratio,":1 (min ",n.required,":1)"]}),D.length>0&&e.jsx("div",{className:"ml-2 text-[10px]",children:D.slice(0,1).map((w,Y)=>e.jsx("span",{className:"block",children:s({id:"theme.accessibility.fixSuggestion"},{target:w.target==="fg"?n.fgVar:n.bgVar,original:w.original,suggested:w.suggested,ratio:w.resultRatio})},Y))})]},M)})}),e.jsx("button",{onClick:()=>je(!1),className:"text-xs font-medium underline",children:s({id:"theme.accessibility.dismiss"})})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-text mb-3",children:s({id:"theme.title.themeMode"})}),e.jsx("div",{className:"grid grid-cols-2 gap-3",role:"group","aria-label":"Theme mode selection",children:Ss.map(n=>e.jsxs("button",{onClick:()=>cs(n.id),"aria-label":s({id:"theme.select.themeMode"},{name:s({id:`theme.themeMode.${n.id}`})}),"aria-selected":K===n.id,role:"radio",className:`
114
- flex items-center justify-center gap-2 p-3 rounded-lg
115
- transition-all duration-200 border-2
116
- ${K===n.id?"border-accent bg-surface shadow-md":"border-border bg-bg hover:bg-surface"}
117
- focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2
118
- `,children:[e.jsx("span",{className:"text-lg","aria-hidden":"true",children:n.id==="light"?"☀️":"🌙"}),e.jsx("span",{className:"text-sm font-medium text-text",children:s({id:`theme.themeMode.${n.id}`})})]},n.id))})]}),e.jsx("div",{className:"p-3 rounded-lg bg-surface border border-border",children:e.jsx("p",{className:"text-xs text-text-secondary",children:s({id:"theme.current"},{name:Ts(t,K)})})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-text mb-3",children:s({id:"theme.share.label"})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:gs,className:`\r
119
- flex-1 px-3 py-2 rounded-lg text-sm font-medium\r
120
- border-2 border-border bg-bg text-text\r
121
- hover:bg-surface transition-all duration-200\r
122
- focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2\r
123
- `,children:s(as?{id:"theme.share.copied"}:{id:"theme.share.copyCode"})}),e.jsx("button",{onClick:ye?xe:fs,className:`
124
- flex-1 px-3 py-2 rounded-lg text-sm font-medium
125
- transition-all duration-200 border-2
126
- ${ye?"border-accent bg-surface shadow-md":"border-border bg-bg text-text hover:bg-surface"}
127
- focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2
128
- `,children:s({id:"theme.share.import"})})]}),ye&&e.jsxs("div",{className:"mt-3 space-y-3",children:[e.jsx("textarea",{value:ss,onChange:n=>ps(n.target.value),placeholder:s({id:"theme.share.paste"}),rows:3,className:`\r
129
- w-full px-3 py-2 rounded-lg text-sm font-mono\r
130
- bg-bg border-2 border-border text-text\r
131
- placeholder-text-tertiary resize-none\r
132
- focus:outline-none focus:ring-2 focus:ring-accent focus:border-accent\r
133
- `}),me&&e.jsx("div",{className:"p-2 rounded-lg bg-error-light border border-error text-error-text text-xs",children:s({id:Ns(me)})}),ts&&!me&&e.jsx("div",{className:"p-2 rounded-lg bg-warning-light border border-warning text-warning-text text-xs",children:s({id:"theme.share.versionWarning"})}),T&&!me&&e.jsxs("div",{className:"p-3 rounded-lg bg-surface border border-border space-y-3",children:[e.jsx("p",{className:"text-xs font-medium text-text",children:s({id:"theme.share.preview"})}),e.jsx("div",{className:"flex gap-3 items-end",children:(()=>{const n=js(T);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("div",{className:"w-10 h-10 rounded border-2 border-border shadow-sm",style:{backgroundColor:n.bg}}),e.jsx("span",{className:"text-[10px] text-text-tertiary",children:s({id:"theme.preview.background"})})]}),e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("div",{className:"w-10 h-10 rounded border-2 border-border shadow-sm",style:{backgroundColor:n.surface}}),e.jsx("span",{className:"text-[10px] text-text-tertiary",children:s({id:"theme.preview.surface"})})]}),e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("div",{className:"w-10 h-10 rounded border-2 border-border shadow-sm",style:{backgroundColor:n.accent}}),e.jsx("span",{className:"text-[10px] text-text-tertiary",children:s({id:"theme.preview.accent"})})]})]})})()}),e.jsxs("div",{className:"text-xs text-text-secondary space-y-1",children:[e.jsxs("p",{children:[s({id:"theme.styleTier.label"}),": ",s({id:`theme.styleTier.${T.styleTier==="high-contrast"?"highContrast":T.styleTier}`})]}),e.jsxs("p",{children:[s({id:"theme.gradient.title"}),": ",s({id:`theme.gradient.${T.gradientLevel}`})]}),T.customHue!==null&&e.jsx("p",{children:s({id:"theme.hueValue"},{value:T.customHue})}),T.customHue===null&&e.jsxs("p",{children:[s({id:"theme.title.colorScheme"}),": ",s({id:`theme.colorScheme.${T.colorScheme}`})]})]}),e.jsxs("div",{className:"flex gap-2 pt-1",children:[e.jsx("button",{onClick:bs,className:`\r
134
- flex-1 px-4 py-2 rounded-lg text-sm font-medium\r
135
- bg-accent text-white hover:bg-accent-hover\r
136
- transition-all duration-200\r
137
- focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2\r
138
- `,children:s({id:"theme.share.apply"})}),e.jsx("button",{onClick:xe,className:`\r
139
- px-4 py-2 rounded-lg text-sm font-medium\r
140
- border-2 border-border bg-bg text-text\r
141
- hover:bg-surface transition-all duration-200\r
142
- focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2\r
143
- `,children:s({id:"theme.share.cancel"})})]})]})]}),e.jsx(nt,{open:le!==null,onOpenChange:ze,children:e.jsxs(rt,{children:[e.jsxs(it,{children:[e.jsx(lt,{children:"Delete Theme Slot?"}),e.jsx(ot,{children:"This action cannot be undone. The theme slot will be permanently deleted."})]}),e.jsxs(ct,{children:[e.jsx(dt,{onClick:ze,children:"Cancel"}),e.jsx(mt,{onClick:hs,children:"Delete"})]})]})})]})]})}const qt=[{value:"en",label:"English",flag:"🇺🇸"},{value:"zh",label:"中文",flag:"🇨🇳"}];function Wt({compact:s=!1,className:t}){const{locale:a,setLocale:i}=Ct();return e.jsxs(Fs,{value:a,onValueChange:i,children:[e.jsx(Ls,{className:A(s?"w-[110px]":"w-[160px]","gap-2",t),"aria-label":"Select language",children:s?e.jsxs(e.Fragment,{children:[e.jsx(Xe,{className:"w-4 h-4"}),e.jsx($e,{})]}):e.jsx($e,{})}),e.jsx(Ds,{children:qt.map(l=>e.jsx(Us,{value:l.value,children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-base",children:l.flag}),e.jsx("span",{children:l.label})]})},l.value))})]})}const Te={discord:{id:"discord",name:"Discord",icon:"message-circle",description:"Send notifications to Discord channels via webhook",requiredFields:["webhookUrl"]},telegram:{id:"telegram",name:"Telegram",icon:"send",description:"Send notifications to Telegram chats via bot",requiredFields:["botToken","chatId"]},feishu:{id:"feishu",name:"Feishu",icon:"message-square",description:"Send notifications to Feishu (Lark) via webhook with rich card support",requiredFields:["webhookUrl"]},dingtalk:{id:"dingtalk",name:"DingTalk",icon:"bell",description:"Send notifications to DingTalk via webhook",requiredFields:["webhookUrl"]},wecom:{id:"wecom",name:"WeCom",icon:"users",description:"Send notifications to WeCom (WeChat Work) via webhook",requiredFields:["webhookUrl"]},email:{id:"email",name:"Email",icon:"mail",description:"Send notifications via SMTP email",requiredFields:["host","username","password","from","to"]},webhook:{id:"webhook",name:"Custom Webhook",icon:"link",description:"Send notifications to a custom HTTP endpoint",requiredFields:["url"]}},Gt={"ask-user-question":{id:"ask-user-question",name:"Ask User Question",description:"Notification when Claude asks a question via AskUserQuestion",icon:"help-circle"},"session-start":{id:"session-start",name:"Session Start",description:"Notification when a CLI session starts",icon:"play"},"session-end":{id:"session-end",name:"Session End",description:"Notification when a CLI session ends",icon:"square"},"task-completed":{id:"task-completed",name:"Task Completed",description:"Notification when a task completes successfully",icon:"check-circle"},"task-failed":{id:"task-failed",name:"Task Failed",description:"Notification when a task fails",icon:"alert-circle"}};function qe(){return{enabled:!1,platforms:{},events:[{event:"ask-user-question",platforms:["discord","telegram"],enabled:!0},{event:"session-start",platforms:[],enabled:!1},{event:"session-end",platforms:[],enabled:!1},{event:"task-completed",platforms:[],enabled:!1},{event:"task-failed",platforms:["discord","telegram"],enabled:!0}],timeout:1e4}}function Kt({config:s,expandedPlatform:t,testing:a,onToggleExpand:i,onUpdateConfig:l,onTest:o,onSave:x,saving:p}){const{formatMessage:C}=H(),g=["discord","telegram","feishu","dingtalk","wecom","email","webhook"],k=m=>{switch(m){case"discord":return e.jsx(As,{className:"w-4 h-4"});case"telegram":return e.jsx(Et,{className:"w-4 h-4"});case"feishu":return e.jsx(Ge,{className:"w-4 h-4"});case"dingtalk":return e.jsx(Fe,{className:"w-4 h-4"});case"wecom":return e.jsx(Is,{className:"w-4 h-4"});case"email":return e.jsx(Ps,{className:"w-4 h-4"});case"webhook":return e.jsx(Tt,{className:"w-4 h-4"})}},h=m=>{switch(m){case"discord":return s.platforms.discord||{enabled:!1,webhookUrl:""};case"telegram":return s.platforms.telegram||{enabled:!1,botToken:"",chatId:""};case"feishu":return s.platforms.feishu||{enabled:!1,webhookUrl:""};case"dingtalk":return s.platforms.dingtalk||{enabled:!1,webhookUrl:""};case"wecom":return s.platforms.wecom||{enabled:!1,webhookUrl:""};case"email":return s.platforms.email||{enabled:!1,host:"",port:587,username:"",password:"",from:"",to:[]};case"webhook":return s.platforms.webhook||{enabled:!1,url:"",method:"POST"}}},F=m=>{var v;const b=h(m);switch(m){case"discord":return!!b.webhookUrl;case"telegram":return!!b.botToken&&!!b.chatId;case"feishu":return!!b.webhookUrl;case"dingtalk":return!!b.webhookUrl;case"wecom":return!!b.webhookUrl;case"email":const u=b;return!!(u.host&&u.username&&u.password&&u.from&&((v=u.to)==null?void 0:v.length)>0);case"webhook":return!!b.url}};return e.jsx("div",{className:"grid gap-3",children:g.map(m=>{const b=Te[m],v=h(m),u=F(m),P=t===m;return e.jsxs(_,{className:"overflow-hidden",children:[e.jsx("div",{className:"p-4 cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>i(P?null:m),children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:A("p-2 rounded-lg",v.enabled&&u?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:k(m)}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:b.name}),u&&e.jsxs($,{variant:"outline",className:"text-xs text-green-600 border-green-500/30",children:[e.jsx(W,{className:"w-3 h-3 mr-1"}),C({id:"settings.remoteNotifications.configured"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:b.description})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{variant:v.enabled?"default":"outline",size:"sm",className:"h-7",onClick:S=>{S.stopPropagation(),l(m,{enabled:!v.enabled})},children:v.enabled?e.jsx(W,{className:"w-3.5 h-3.5"}):e.jsx(G,{className:"w-3.5 h-3.5"})}),P?e.jsx(Me,{className:"w-4 h-4 text-muted-foreground"}):e.jsx(pe,{className:"w-4 h-4 text-muted-foreground"})]})]})}),P&&e.jsxs("div",{className:"border-t border-border p-4 space-y-4 bg-muted/30",children:[m==="discord"&&e.jsx(Jt,{config:v,onUpdate:S=>l("discord",S)}),m==="telegram"&&e.jsx(Xt,{config:v,onUpdate:S=>l("telegram",S)}),m==="feishu"&&e.jsx(Yt,{config:v,onUpdate:S=>l("feishu",S)}),m==="dingtalk"&&e.jsx(Zt,{config:v,onUpdate:S=>l("dingtalk",S)}),m==="wecom"&&e.jsx(ea,{config:v,onUpdate:S=>l("wecom",S)}),m==="email"&&e.jsx(sa,{config:v,onUpdate:S=>l("email",S)}),m==="webhook"&&e.jsx(Qt,{config:v,onUpdate:S=>l("webhook",S)}),e.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[e.jsxs(N,{variant:"outline",size:"sm",onClick:()=>o(m,v),disabled:a===m||!u,children:[e.jsx(St,{className:A("w-3.5 h-3.5 mr-1",a===m&&"animate-pulse")}),C({id:"settings.remoteNotifications.testConnection"})]}),e.jsx(N,{variant:"default",size:"sm",onClick:x,disabled:p,children:C({id:"settings.remoteNotifications.save"})})]})]})]},m)})})}function Jt({config:s,onUpdate:t}){const{formatMessage:a}=H(),[i,l]=d.useState(!1);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.discord.webhookUrl"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(U,{type:i?"text":"password",value:s.webhookUrl||"",onChange:o=>t({webhookUrl:o.target.value}),placeholder:"https://discord.com/api/webhooks/...",className:"flex-1"}),e.jsx(N,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>l(!i),children:i?e.jsx(ee,{className:"w-4 h-4"}):e.jsx(se,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.discord.webhookUrlHint"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.discord.username"})}),e.jsx(U,{value:s.username||"",onChange:o=>t({username:o.target.value}),placeholder:"CCW Notification",className:"mt-1"})]})]})}function Xt({config:s,onUpdate:t}){const{formatMessage:a}=H(),[i,l]=d.useState(!1);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.telegram.botToken"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(U,{type:i?"text":"password",value:s.botToken||"",onChange:o=>t({botToken:o.target.value}),placeholder:"1234567890:ABCdefGHIjklMNOpqrsTUVwxyz",className:"flex-1"}),e.jsx(N,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>l(!i),children:i?e.jsx(ee,{className:"w-4 h-4"}):e.jsx(se,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.telegram.botTokenHint"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.telegram.chatId"})}),e.jsx(U,{value:s.chatId||"",onChange:o=>t({chatId:o.target.value}),placeholder:"-1001234567890",className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.telegram.chatIdHint"})})]})]})}function Qt({config:s,onUpdate:t}){const{formatMessage:a}=H();return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.webhook.url"})}),e.jsx(U,{value:s.url||"",onChange:i=>t({url:i.target.value}),placeholder:"https://your-server.com/webhook",className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.webhook.method"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(N,{variant:s.method==="POST"?"default":"outline",size:"sm",onClick:()=>t({method:"POST"}),children:"POST"}),e.jsx(N,{variant:s.method==="PUT"?"default":"outline",size:"sm",onClick:()=>t({method:"PUT"}),children:"PUT"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.webhook.headers"})}),e.jsx(U,{value:s.headers?JSON.stringify(s.headers):"",onChange:i=>{try{const l=i.target.value?JSON.parse(i.target.value):void 0;t({headers:l})}catch{}},placeholder:'{"Authorization": "Bearer token"}',className:"mt-1 font-mono text-xs"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.webhook.headersHint"})})]})]})}function Yt({config:s,onUpdate:t}){const{formatMessage:a}=H(),[i,l]=d.useState(!1);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.feishu.webhookUrl"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(U,{type:i?"text":"password",value:s.webhookUrl||"",onChange:o=>t({webhookUrl:o.target.value}),placeholder:"https://open.feishu.cn/open-apis/bot/v2/hook/...",className:"flex-1"}),e.jsx(N,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>l(!i),children:i?e.jsx(ee,{className:"w-4 h-4"}):e.jsx(se,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.feishu.webhookUrlHint"})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"feishu-useCard",checked:s.useCard||!1,onChange:o=>t({useCard:o.target.checked}),className:"rounded border-border"}),e.jsx("label",{htmlFor:"feishu-useCard",className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.feishu.useCard"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:a({id:"settings.remoteNotifications.feishu.useCardHint"})}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.feishu.title"})}),e.jsx(U,{value:s.title||"",onChange:o=>t({title:o.target.value}),placeholder:"CCW Notification",className:"mt-1"})]})]})}function Zt({config:s,onUpdate:t}){var o;const{formatMessage:a}=H(),[i,l]=d.useState(!1);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.dingtalk.webhookUrl"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(U,{type:i?"text":"password",value:s.webhookUrl||"",onChange:x=>t({webhookUrl:x.target.value}),placeholder:"https://oapi.dingtalk.com/robot/send?access_token=...",className:"flex-1"}),e.jsx(N,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>l(!i),children:i?e.jsx(ee,{className:"w-4 h-4"}):e.jsx(se,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.dingtalk.webhookUrlHint"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.dingtalk.keywords"})}),e.jsx(U,{value:((o=s.keywords)==null?void 0:o.join(", "))||"",onChange:x=>t({keywords:x.target.value.split(",").map(p=>p.trim()).filter(Boolean)}),placeholder:"keyword1, keyword2",className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.dingtalk.keywordsHint"})})]})]})}function ea({config:s,onUpdate:t}){var o;const{formatMessage:a}=H(),[i,l]=d.useState(!1);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.wecom.webhookUrl"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(U,{type:i?"text":"password",value:s.webhookUrl||"",onChange:x=>t({webhookUrl:x.target.value}),placeholder:"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=...",className:"flex-1"}),e.jsx(N,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>l(!i),children:i?e.jsx(ee,{className:"w-4 h-4"}):e.jsx(se,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.wecom.webhookUrlHint"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.wecom.mentionedList"})}),e.jsx(U,{value:((o=s.mentionedList)==null?void 0:o.join(", "))||"",onChange:x=>t({mentionedList:x.target.value.split(",").map(p=>p.trim()).filter(Boolean)}),placeholder:"userid1, userid2, @all",className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.wecom.mentionedListHint"})})]})]})}function sa({config:s,onUpdate:t}){var o;const{formatMessage:a}=H(),[i,l]=d.useState(!1);return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.email.host"})}),e.jsx(U,{value:s.host||"",onChange:x=>t({host:x.target.value}),placeholder:"smtp.gmail.com",className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.email.hostHint"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.email.port"})}),e.jsx(U,{type:"number",value:s.port||587,onChange:x=>t({port:parseInt(x.target.value,10)||587}),placeholder:"587",className:"mt-1"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"email-secure",checked:s.secure||!1,onChange:x=>t({secure:x.target.checked}),className:"rounded border-border"}),e.jsx("label",{htmlFor:"email-secure",className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.email.secure"})})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.email.username"})}),e.jsx(U,{value:s.username||"",onChange:x=>t({username:x.target.value}),placeholder:"your-email@gmail.com",className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.email.password"})}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx(U,{type:i?"text":"password",value:s.password||"",onChange:x=>t({password:x.target.value}),placeholder:"********",className:"flex-1"}),e.jsx(N,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>l(!i),children:i?e.jsx(ee,{className:"w-4 h-4"}):e.jsx(se,{className:"w-4 h-4"})})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.email.from"})}),e.jsx(U,{value:s.from||"",onChange:x=>t({from:x.target.value}),placeholder:"noreply@example.com",className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:a({id:"settings.remoteNotifications.email.to"})}),e.jsx(U,{value:((o=s.to)==null?void 0:o.join(", "))||"",onChange:x=>t({to:x.target.value.split(",").map(p=>p.trim()).filter(Boolean)}),placeholder:"user1@example.com, user2@example.com",className:"mt-1"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a({id:"settings.remoteNotifications.email.toHint"})})]})]})}function ta({className:s}){const{formatMessage:t}=H(),[a,i]=d.useState(null),[l,o]=d.useState(!0),[x,p]=d.useState(!1),[C,g]=d.useState(null),[k,h]=d.useState(null),[F,m]=d.useState(null),b=d.useCallback(async()=>{o(!0);try{const j=await fetch("/api/notifications/remote/config");if(j.ok){const y=await j.json();i(y)}else i(qe())}catch(j){console.error("Failed to load remote notification config:",j),i(qe())}finally{o(!1)}},[]);d.useEffect(()=>{b()},[b]);const v=d.useCallback(async j=>{p(!0);try{const y=await fetch("/api/notifications/remote/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)});if(y.ok){const r=await y.json();i(r.config),I.success(t({id:"settings.remoteNotifications.saved"}))}else throw new Error(`HTTP ${y.status}`)}catch{I.error(t({id:"settings.remoteNotifications.saveError"}))}finally{p(!1)}},[t]),u=d.useCallback(async(j,y)=>{g(j);try{const f=await(await fetch("/api/notifications/remote/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({platform:j,config:y})})).json();f.success?I.success(t({id:"settings.remoteNotifications.testSuccess"}),{description:`${f.responseTime}ms`}):I.error(t({id:"settings.remoteNotifications.testFailed"}),{description:f.error})}catch{I.error(t({id:"settings.remoteNotifications.testError"}))}finally{g(null)}},[t]),P=()=>{a&&v({...a,enabled:!a.enabled})},S=(j,y)=>{if(!a)return;const r={...a,platforms:{...a.platforms,[j]:{...a.platforms[j],...y}}};i(r)},E=(j,y)=>{if(!a)return;const r=[...a.events];r[j]={...r[j],...y},i({...a,events:r})},R=(j,y)=>{if(!a)return;const r=a.events[j],f=r.platforms.includes(y)?r.platforms.filter(c=>c!==y):[...r.platforms,y];E(j,{platforms:f})},V=["discord","telegram","feishu","dingtalk","wecom","email","webhook"],O=async()=>{if(confirm(t({id:"settings.remoteNotifications.resetConfirm"})))try{const j=await fetch("/api/notifications/remote/reset",{method:"POST"});if(j.ok){const y=await j.json();i(y.config),I.success(t({id:"settings.remoteNotifications.resetSuccess"}))}}catch{I.error(t({id:"settings.remoteNotifications.resetError"}))}};return l?e.jsx(_,{className:A("p-6",s),children:e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(X,{className:"w-5 h-5 animate-spin text-muted-foreground"})})}):a?e.jsxs(_,{className:A("p-6",s),children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[a.enabled?e.jsx(Fe,{className:"w-5 h-5 text-primary"}):e.jsx(Pt,{className:"w-5 h-5 text-muted-foreground"}),t({id:"settings.remoteNotifications.title"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{variant:"outline",size:"sm",onClick:()=>b(),disabled:l,children:e.jsx(X,{className:A("w-3.5 h-3.5",l&&"animate-spin")})}),e.jsx(N,{variant:a.enabled?"default":"outline",size:"sm",onClick:P,children:a.enabled?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"w-4 h-4 mr-1"}),t({id:"settings.remoteNotifications.enabled"})]}):e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-1"}),t({id:"settings.remoteNotifications.disabled"})]})})]})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:t({id:"settings.remoteNotifications.description"})}),a.enabled&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-4 mb-6",children:[e.jsx("h3",{className:"text-sm font-medium text-foreground",children:t({id:"settings.remoteNotifications.platforms"})}),e.jsx(Kt,{config:a,expandedPlatform:k,testing:C,onToggleExpand:h,onUpdateConfig:S,onTest:u,onSave:()=>v(a),saving:x})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-medium text-foreground",children:t({id:"settings.remoteNotifications.events"})}),e.jsx("div",{className:"grid gap-3",children:a.events.map((j,y)=>{const r=Gt[j.event],f=F===y;return e.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between p-3 cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>m(f?null:y),children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:A("p-2 rounded-lg",j.enabled?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:e.jsx("span",{className:"text-sm",children:r.icon})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:r.name}),e.jsx("p",{className:"text-xs text-muted-foreground",children:r.description})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex gap-1 flex-wrap max-w-xs",children:[j.platforms.slice(0,3).map(c=>e.jsx($,{variant:"secondary",className:"text-xs",children:Te[c].name},c)),j.platforms.length>3&&e.jsxs($,{variant:"secondary",className:"text-xs",children:["+",j.platforms.length-3]}),j.platforms.length===0&&e.jsx($,{variant:"outline",className:"text-xs text-muted-foreground",children:t({id:"settings.remoteNotifications.noPlatforms"})})]}),e.jsx(N,{variant:j.enabled?"default":"outline",size:"sm",className:"h-7",onClick:c=>{c.stopPropagation(),E(y,{enabled:!j.enabled})},children:j.enabled?e.jsx(W,{className:"w-3.5 h-3.5"}):e.jsx(G,{className:"w-3.5 h-3.5"})}),f?e.jsx(Me,{className:"w-4 h-4 text-muted-foreground"}):e.jsx(pe,{className:"w-4 h-4 text-muted-foreground"})]})]}),f&&e.jsxs("div",{className:"border-t border-border p-4 space-y-3 bg-muted/20",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:t({id:"settings.remoteNotifications.selectPlatforms"})}),e.jsx("div",{className:"flex flex-wrap gap-2",children:V.map(c=>{const L=j.platforms.includes(c),z=Te[c],q=a.platforms[c],B=q==null?void 0:q.enabled;return e.jsxs(N,{variant:L?"default":"outline",size:"sm",className:A("h-8",!B&&!L&&"opacity-50"),onClick:()=>R(y,c),children:[L&&e.jsx(W,{className:"w-3 h-3 mr-1"}),z.name,!B&&!L&&e.jsx(Se,{className:"w-3 h-3 ml-1 opacity-50"})]},c)})})]})]},j.event)})})]}),e.jsxs("div",{className:"flex items-center justify-between mt-6 pt-4 border-t border-border",children:[e.jsx(N,{variant:"outline",size:"sm",onClick:O,children:t({id:"settings.remoteNotifications.reset"})}),e.jsxs(N,{variant:"default",size:"sm",onClick:()=>v(a),disabled:x,children:[e.jsx(De,{className:"w-4 h-4 mr-1"}),t(x?{id:"settings.remoteNotifications.saving"}:{id:"settings.remoteNotifications.save"})]})]})]})]}):null}function aa({value:s,label:t,description:a,selected:i,onClick:l}){const o={modal:e.jsx("div",{className:"w-8 h-8 border-2 border-current rounded-lg flex items-center justify-center",children:e.jsx("div",{className:"w-4 h-3 border border-current rounded-sm"})}),drawer:e.jsx("div",{className:"w-8 h-8 border-2 border-current rounded-lg flex items-end justify-end p-0.5",children:e.jsx("div",{className:"w-2 h-6 border border-current rounded-sm"})}),sheet:e.jsx("div",{className:"w-8 h-8 border-2 border-current rounded-lg flex items-end justify-center p-0.5",children:e.jsx("div",{className:"w-6 h-2 border border-current rounded-sm"})}),fullscreen:e.jsx("div",{className:"w-8 h-8 border-2 border-current rounded-lg flex items-center justify-center",children:e.jsx("div",{className:"w-5 h-4 border border-current rounded-sm"})})};return e.jsxs("button",{type:"button",onClick:l,className:A("flex flex-col items-center gap-2 p-3 rounded-lg border-2 transition-all","hover:bg-accent/50",i?"border-primary bg-primary/10 text-primary":"border-border text-muted-foreground"),children:[o[s],e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:A("text-sm font-medium",i&&"text-primary"),children:t}),e.jsx("div",{className:"text-xs text-muted-foreground",children:a})]})]})}function na({value:s,onChange:t,disabled:a}){const i=[10,20,30,45,60,90,120];return e.jsx("div",{className:"flex flex-wrap gap-2",children:i.map(l=>e.jsxs(N,{type:"button",variant:s===l?"default":"outline",size:"sm",disabled:a,onClick:()=>t(l),children:[l,"s"]},l))})}function ra(){const{formatMessage:s}=H(),{preferences:t,updatePreference:a,resetPreferences:i}=Rs(),l=[{value:"modal",label:s({id:"settings.a2ui.styleModal",defaultMessage:"Modal"}),description:s({id:"settings.a2ui.styleModalDesc",defaultMessage:"Centered"})},{value:"drawer",label:s({id:"settings.a2ui.styleDrawer",defaultMessage:"Drawer"}),description:s({id:"settings.a2ui.styleDrawerDesc",defaultMessage:"Side panel"})},{value:"sheet",label:s({id:"settings.a2ui.styleSheet",defaultMessage:"Sheet"}),description:s({id:"settings.a2ui.styleSheetDesc",defaultMessage:"Bottom"})},{value:"fullscreen",label:s({id:"settings.a2ui.styleFullscreen",defaultMessage:"Fullscreen"}),description:s({id:"settings.a2ui.styleFullscreenDesc",defaultMessage:"Full screen"})}];return e.jsxs(_,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Ge,{className:"w-5 h-5"}),s({id:"settings.sections.a2ui",defaultMessage:"A2UI Preferences"})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs(Be,{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(It,{className:"w-4 h-4"}),s({id:"settings.a2ui.dialogStyle",defaultMessage:"Dialog Style"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.a2ui.dialogStyleDesc",defaultMessage:"Choose how A2UI dialogs are displayed"})}),e.jsx("div",{className:"grid grid-cols-4 gap-2",children:l.map(o=>e.jsx(aa,{value:o.value,label:o.label,description:o.description,selected:t.dialogStyle===o.value,onClick:()=>a("dialogStyle",o.value)},o.value))})]}),e.jsxs("div",{className:"flex items-center justify-between py-2 border-t border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Os,{className:"w-4 h-4 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s({id:"settings.a2ui.smartMode",defaultMessage:"Smart Mode"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.a2ui.smartModeDesc",defaultMessage:"Auto-select style based on question type"})})]})]}),e.jsx(N,{variant:t.smartModeEnabled?"default":"outline",size:"sm",onClick:()=>a("smartModeEnabled",!t.smartModeEnabled),children:t.smartModeEnabled?s({id:"common.enabled",defaultMessage:"Enabled"}):s({id:"common.disabled",defaultMessage:"Disabled"})})]}),e.jsxs("div",{className:"space-y-3 py-2 border-t border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Hs,{className:"w-4 h-4 text-muted-foreground"}),e.jsx(Be,{className:"text-sm font-medium",children:s({id:"settings.a2ui.autoSelectionDuration",defaultMessage:"Auto-Selection Duration"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.a2ui.autoSelectionDurationDesc",defaultMessage:"Countdown before auto-selecting default option"})}),e.jsx(na,{value:t.autoSelectionDuration,onChange:o=>a("autoSelectionDuration",o)})]}),e.jsxs("div",{className:"flex items-center justify-between py-2 border-t border-border",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s({id:"settings.a2ui.pauseOnInteraction",defaultMessage:"Pause on Interaction"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.a2ui.pauseOnInteractionDesc",defaultMessage:"Pause countdown when you interact with the dialog"})})]}),e.jsx(N,{variant:t.pauseOnInteraction?"default":"outline",size:"sm",onClick:()=>a("pauseOnInteraction",!t.pauseOnInteraction),children:t.pauseOnInteraction?s({id:"common.enabled",defaultMessage:"Enabled"}):s({id:"common.disabled",defaultMessage:"Disabled"})})]}),e.jsxs("div",{className:"flex items-center justify-between py-2 border-t border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Rt,{className:"w-4 h-4 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s({id:"settings.a2ui.soundNotification",defaultMessage:"Sound Notification"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.a2ui.soundNotificationDesc",defaultMessage:"Play sound before auto-submit (3 seconds before)"})})]})]}),e.jsx(N,{variant:t.autoSelectionSoundEnabled?"default":"outline",size:"sm",onClick:()=>a("autoSelectionSoundEnabled",!t.autoSelectionSoundEnabled),children:t.autoSelectionSoundEnabled?s({id:"common.enabled",defaultMessage:"Enabled"}):s({id:"common.disabled",defaultMessage:"Disabled"})})]}),e.jsxs("div",{className:"flex items-center justify-between py-2 border-t border-border",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s({id:"settings.a2ui.showToolbarButton",defaultMessage:"Show Toolbar Button"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.a2ui.showToolbarButtonDesc",defaultMessage:"Show A2UI quick action button in the toolbar"})})]}),e.jsx(N,{variant:t.showA2UIButtonInToolbar?"default":"outline",size:"sm",onClick:()=>a("showA2UIButtonInToolbar",!t.showA2UIButtonInToolbar),children:t.showA2UIButtonInToolbar?s({id:"common.enabled",defaultMessage:"Enabled"}):s({id:"common.disabled",defaultMessage:"Disabled"})})]}),e.jsx("div",{className:"flex justify-end pt-4 border-t border-border",children:e.jsx(N,{variant:"outline",size:"sm",onClick:i,children:s({id:"common.resetToDefaults",defaultMessage:"Reset to Defaults"})})})]})]})}const ia=["","low","medium","high"],la=["","low","medium","high","max"],fe=["sonnet","opus","haiku","inherit"];function oa({agent:s,onSaved:t}){const[a,i]=d.useState(s.model),[l,o]=d.useState(s.effort),[x,p]=d.useState(!1),C=a!==s.model||l!==s.effort,g=s.type==="codex"?ia:la,k=d.useCallback(async()=>{p(!0);try{const h={filePath:s.filePath};a!==s.model&&(h.model=a),l!==s.effort&&(h.effort=l),await Bs(s.type,s.name,h),I.success(`Updated ${s.name}`),t()}catch(h){I.error(`Failed to update ${s.name}: ${h.message}`)}finally{p(!1)}},[s,a,l,t]);return d.useEffect(()=>{i(s.model),o(s.effort)},[s.model,s.effort]),e.jsxs("div",{className:"flex items-center gap-3 py-2 px-3 rounded-md border border-border bg-card hover:bg-accent/30 transition-colors",children:[e.jsx($,{variant:s.type==="codex"?"default":"secondary",className:"text-xs shrink-0",children:s.type}),e.jsx("span",{className:"text-sm font-medium text-foreground min-w-[140px] truncate",title:s.name,children:s.name}),e.jsxs("div",{className:"flex items-center gap-1 flex-1 min-w-0",children:[e.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:"Model:"}),s.type==="claude"?e.jsxs("div",{className:"flex gap-1 flex-1 min-w-0",children:[e.jsxs("select",{className:"h-7 text-xs rounded border border-input bg-background px-2 shrink-0",value:fe.includes(a)?a:"__custom__",onChange:h=>{h.target.value!=="__custom__"&&i(h.target.value)},children:[fe.map(h=>e.jsx("option",{value:h,children:h||"(none)"},h)),!fe.includes(a)&&e.jsx("option",{value:"__custom__",children:"custom"})]}),!fe.includes(a)&&e.jsx(U,{className:"h-7 text-xs flex-1 min-w-[100px]",value:a,onChange:h=>i(h.target.value),placeholder:"model id"})]}):e.jsx(U,{className:"h-7 text-xs flex-1 min-w-[100px]",value:a,onChange:h=>i(h.target.value),placeholder:"model id"})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Effort:"}),e.jsx("select",{className:"h-7 text-xs rounded border border-input bg-background px-2",value:l,onChange:h=>o(h.target.value),children:g.map(h=>e.jsx("option",{value:h,children:h||"—"},h))})]}),e.jsxs(N,{variant:"outline",size:"sm",className:"h-7 px-2 shrink-0",disabled:!C||x,onClick:k,children:[e.jsx(De,{className:"w-3 h-3 mr-1"}),x?"...":"Save"]})]})}function ca({installationPath:s,agents:t,onSaved:a}){const[i,l]=d.useState(!0);return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("button",{type:"button",className:"flex items-center gap-2 w-full text-left py-1 hover:text-primary transition-colors",onClick:()=>l(!i),children:[i?e.jsx(pe,{className:"w-4 h-4"}):e.jsx($s,{className:"w-4 h-4"}),e.jsx("span",{className:"text-sm font-medium text-foreground truncate",title:s,children:s}),e.jsxs($,{variant:"outline",className:"text-xs ml-auto shrink-0",children:[t.length," agents"]})]}),i&&e.jsx("div",{className:"space-y-1 ml-6",children:t.map(o=>e.jsx(oa,{agent:o,onSaved:a},o.filePath))})]})}function da(){const[s,t]=d.useState([]),[a,i]=d.useState(!0),[l,o]=d.useState(""),[x,p]=d.useState(""),[C,g]=d.useState(!1),k=d.useCallback(async()=>{try{i(!0);const m=await zs();t(m.agents)}catch(m){I.error(`Failed to load agents: ${m.message}`)}finally{i(!1)}},[]);d.useEffect(()=>{k()},[k]);const h=s.reduce((m,b)=>{const v=b.installationPath;return m[v]||(m[v]=[]),m[v].push(b),m},{}),F=d.useCallback(async()=>{if(!l&&!x){I.error("Set a model or effort value first");return}g(!0);try{const m=s.map(v=>({filePath:v.filePath,type:v.type})),b=await _s({targets:m,model:l||void 0,effort:x||void 0});I.success(`Updated ${b.updated}/${b.total} agents`),k()}catch(m){I.error(`Batch update failed: ${m.message}`)}finally{g(!1)}},[s,l,x,k]);return e.jsxs(_,{className:"p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Mt,{className:"w-5 h-5"}),"Agent Definitions"]}),e.jsxs(N,{variant:"ghost",size:"sm",onClick:k,disabled:a,children:[e.jsx(X,{className:A("w-4 h-4 mr-1",a&&"animate-spin")}),"Refresh"]})]}),e.jsxs("div",{className:"flex items-center gap-3 p-3 mb-4 rounded-md border border-border bg-muted/30",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground shrink-0",children:"Batch:"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Model:"}),e.jsx(U,{className:"h-7 text-xs w-[160px]",value:l,onChange:m=>o(m.target.value),placeholder:"model for all"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:"Effort:"}),e.jsxs("select",{className:"h-7 text-xs rounded border border-input bg-background px-2",value:x,onChange:m=>p(m.target.value),children:[e.jsx("option",{value:"",children:"—"}),e.jsx("option",{value:"low",children:"low"}),e.jsx("option",{value:"medium",children:"medium"}),e.jsx("option",{value:"high",children:"high"}),e.jsx("option",{value:"max",children:"max (claude only)"})]})]}),e.jsx(N,{variant:"default",size:"sm",className:"h-7",disabled:C||!l&&!x,onClick:F,children:C?"Applying...":"Apply to All"})]}),a?e.jsx("div",{className:"text-center text-sm text-muted-foreground py-8",children:"Loading agents..."}):s.length===0?e.jsx("div",{className:"text-center text-sm text-muted-foreground py-8",children:"No agent definitions found. Install CCW to a project first."}):e.jsx("div",{className:"space-y-4",children:Object.entries(h).map(([m,b])=>e.jsx(ca,{installationPath:m,agents:b,onSaved:k},m))})]})}function ma(){const s=document.cookie.match(/XSRF-TOKEN=([^;]+)/);return s?decodeURIComponent(s[1]):null}function We({value:s,onChange:t,placeholder:a}){const[i,l]=d.useState(!1),[o,x]=d.useState(null),p=Ft(s,500);d.useEffect(()=>{if(p){l(!0),x(null);const g=setTimeout(()=>{p.trim().length>0?x(null):x("Path cannot be empty."),l(!1)},1e3);return()=>clearTimeout(g)}else x(null),l(!1)},[p]);const C=async()=>{const{selectFile:g}=await at(async()=>{const{selectFile:F}=await import("./index-B8K8MdMl.js").then(m=>m.gf);return{selectFile:F}},__vite__mapDeps([0,1])),k=s?s.replace(/[/\\][^/\\]*$/,""):void 0,h=await g(k);h.path&&!h.cancelled&&!h.error&&t(h.path)};return e.jsxs("div",{children:[e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(U,{value:s,onChange:g=>t(g.target.value),placeholder:a,className:A("flex-1",o&&"border-destructive")}),i&&e.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3",children:e.jsx(st,{className:"h-4 w-4 animate-spin text-muted-foreground"})})]}),e.jsx(N,{type:"button",variant:"outline",size:"sm",className:"shrink-0 h-9",onClick:C,title:"Browse",children:e.jsx(tt,{className:"w-4 h-4"})})]}),o&&e.jsx("p",{className:"text-xs text-destructive mt-1",children:o})]})}const ua=new Set(["gemini","qwen","opencode"]),xa=new Set(["claude"]);function Ye(s){return ua.has(s)?"envFile":xa.has(s)?"settingsFile":"none"}function ha({toolId:s,config:t,isDefault:a,isExpanded:i,toolAvailable:l,isSaving:o,onToggleExpand:x,onToggleEnabled:p,onSetDefault:C,onUpdateModel:g,onUpdateTags:k,onUpdateAvailableModels:h,onUpdateEnvFile:F,onUpdateSettingsFile:m,onUpdateEffort:b,onSaveToBackend:v}){const{formatMessage:u}=H(),[P,S]=d.useState(""),[E,R]=d.useState(""),V=()=>{const c=P.trim();c&&!t.tags.includes(c)&&(k([...t.tags,c]),S(""))},O=c=>{k(t.tags.filter(L=>L!==c))},j=()=>{const c=E.trim(),L=t.availableModels||[];c&&!L.includes(c)&&(h([...L,c]),R(""))},y=c=>{const L=t.availableModels||[];h(L.filter(z=>z!==c))},r=["分析","Debug","implementation","refactoring","testing"],f=Ye(s);return e.jsxs(_,{className:A("overflow-hidden",!t.enabled&&"opacity-60"),children:[e.jsxs("div",{className:"p-4 cursor-pointer hover:bg-muted/50 transition-colors",onClick:x,children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:A("p-2 rounded-lg",t.enabled?"bg-primary/10":"bg-muted"),children:e.jsx(Ke,{className:A("w-5 h-5",t.enabled?"text-primary":"text-muted-foreground")})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-foreground capitalize",children:s}),a&&e.jsx($,{variant:"default",className:"text-xs",children:u({id:"settings.cliTools.default"})}),e.jsx($,{variant:"outline",className:"text-xs",children:t.type}),l!==void 0&&e.jsx("span",{className:A("inline-block w-2 h-2 rounded-full",l?"bg-green-500":"bg-red-400"),title:l?"Available":"Unavailable"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:t.primaryModel})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{variant:t.enabled?"default":"outline",size:"sm",className:"h-8",onClick:c=>{c.stopPropagation(),p()},children:t.enabled?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"w-4 h-4 mr-1"}),u({id:"settings.cliTools.enabled"})]}):e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-1"}),u({id:"settings.cliTools.disabled"})]})}),i?e.jsx(Me,{className:"w-5 h-5 text-muted-foreground"}):e.jsx(pe,{className:"w-5 h-5 text-muted-foreground"})]})]}),t.tags&&t.tags.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:t.tags.map(c=>e.jsx($,{variant:"secondary",className:"text-xs",children:c},c))})]}),i&&e.jsxs("div",{className:"border-t border-border p-4 space-y-4 bg-muted/30",children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:u({id:"settings.cliTools.primaryModel"})}),e.jsx(U,{value:t.primaryModel,onChange:c=>g("primaryModel",c.target.value),className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:u({id:"settings.cliTools.secondaryModel"})}),e.jsx(U,{value:t.secondaryModel,onChange:c=>g("secondaryModel",c.target.value),className:"mt-1"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:u({id:"apiSettings.cliSettings.tags"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:u({id:"apiSettings.cliSettings.tagsDescription"})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"flex-1 flex flex-wrap gap-1.5 p-2 border border-input bg-background rounded-md min-h-[38px] focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",children:[t.tags.map(c=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-primary/10 text-primary rounded text-xs h-6",children:[c,e.jsx("button",{type:"button",onClick:()=>O(c),className:"hover:text-destructive transition-colors","aria-label":u({id:"apiSettings.cliSettings.removeTag"}),children:e.jsx(G,{className:"w-3 h-3"})})]},c)),e.jsx("input",{type:"text",value:P,onChange:c=>S(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),V())},placeholder:t.tags.length===0?u({id:"apiSettings.cliSettings.tagInputPlaceholder"}):"",className:"flex-1 min-w-[120px] bg-transparent border-0 outline-none text-sm placeholder:text-muted-foreground"})]}),e.jsx(N,{type:"button",size:"sm",onClick:V,variant:"outline",className:"shrink-0",children:e.jsx(Se,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.jsxs("span",{className:"text-xs text-muted-foreground",children:[u({id:"apiSettings.cliSettings.predefinedTags"}),":"]}),r.map(c=>e.jsx("button",{type:"button",onClick:()=>{t.tags.includes(c)||k([...t.tags,c])},disabled:t.tags.includes(c),className:"text-xs px-2 py-0.5 rounded border border-border hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:c},c))]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:u({id:"apiSettings.cliSettings.availableModels"})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"flex-1 flex flex-wrap gap-1.5 p-2 border border-input bg-background rounded-md min-h-[38px] focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",children:[(t.availableModels||[]).map(c=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-primary/10 text-primary rounded text-xs h-6",children:[c,e.jsx("button",{type:"button",onClick:()=>y(c),className:"hover:text-destructive transition-colors",children:e.jsx(G,{className:"w-3 h-3"})})]},c)),e.jsx("input",{type:"text",value:E,onChange:c=>R(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),j())},placeholder:(t.availableModels||[]).length===0?u({id:"apiSettings.cliSettings.availableModelsPlaceholder"}):"",className:"flex-1 min-w-[120px] bg-transparent border-0 outline-none text-sm placeholder:text-muted-foreground"})]}),e.jsx(N,{type:"button",size:"sm",onClick:j,variant:"outline",className:"shrink-0",children:e.jsx(Se,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:u({id:"apiSettings.cliSettings.availableModelsHint"})})]}),f==="envFile"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:u({id:"settings.cliTools.envFile"})}),e.jsx(We,{value:t.envFile||"",onChange:c=>F(c||void 0),placeholder:u({id:"settings.cliTools.envFilePlaceholder"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:u({id:"settings.cliTools.envFileHint"})})]}),f==="settingsFile"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:u({id:"apiSettings.cliSettings.settingsFile"})}),e.jsx(We,{value:t.settingsFile||"",onChange:c=>m(c||void 0),placeholder:u({id:"apiSettings.cliSettings.settingsFilePlaceholder"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:u({id:"apiSettings.cliSettings.settingsFileHint"})})]}),f==="settingsFile"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:u({id:"settings.cliTools.effort"})}),e.jsx("div",{className:"flex gap-2",children:["low","medium","high"].map(c=>{const L=t.effort||"high",z=`settings.cliTools.effort${c.charAt(0).toUpperCase()+c.slice(1)}`;return e.jsx("button",{type:"button",onClick:()=>b(c==="high"&&!t.effort?void 0:c),className:A("px-3 py-1.5 rounded-md text-sm border transition-colors",L===c?"bg-primary text-primary-foreground border-primary":"border-border hover:bg-muted"),children:u({id:z})},c)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:u({id:"settings.cliTools.effortHint"})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[!a&&t.enabled&&e.jsx(N,{variant:"outline",size:"sm",onClick:C,children:u({id:"settings.cliTools.setDefault"})}),e.jsxs(N,{variant:"default",size:"sm",onClick:v,disabled:o,children:[e.jsx(De,{className:"w-4 h-4 mr-1"}),u(o?{id:"settings.cliTools.saving"}:{id:"settings.cliTools.saveToConfig"})]})]})]})]})}function ga(){const{formatMessage:s}=H(),{data:t,isLoading:a}=ut(),{toggle:i,isPending:l}=xt(),{data:o,isLoading:x}=ht(),{toggle:p,isPending:C}=gt(),{data:g,isLoading:k}=ft(),{toggle:h,isPending:F}=pt(),{refresh:m,isPending:b}=bt(),{exportSettings:v,isPending:u}=jt(),{importSettings:P,isPending:S}=Nt(),E=d.useRef(null),R=d.useCallback(async()=>{try{const O=await v(),j=new Blob([JSON.stringify(O,null,2)],{type:"application/json"}),y=URL.createObjectURL(j),r=document.createElement("a"),f=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19);r.href=y,r.download=`ccw-settings-${f}.json`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(y),I.success(s({id:"settings.responseLanguage.exportSuccess"}))}catch{I.error(s({id:"settings.responseLanguage.exportError"}))}},[v,s]),V=d.useCallback(async O=>{var y;const j=(y=O.target.files)==null?void 0:y[0];if(j){if(O.target.value="",!j.name.endsWith(".json")&&j.type!=="application/json"){I.error(s({id:"settings.responseLanguage.importInvalidFile"}));return}try{const r=await j.text(),f=JSON.parse(r);if(!f.version||!f.endpoints){I.error(s({id:"settings.responseLanguage.importInvalidStructure"}));return}const c=await P(f);c.success?I.success(s({id:"settings.responseLanguage.importSuccess"},{imported:c.imported,skipped:c.skipped})):I.error(s({id:"settings.responseLanguage.importError"}))}catch(r){r instanceof SyntaxError?I.error(s({id:"settings.responseLanguage.importInvalidJson"})):I.error(s({id:"settings.responseLanguage.importError"}))}}},[P,s]);return e.jsxs(_,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(At,{className:"w-5 h-5"}),s({id:"settings.sections.responseLanguage"})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:s({id:"settings.responseLanguage.chineseClaude"})}),e.jsx($,{variant:"default",className:"text-xs",children:"Claude"})]}),e.jsx(N,{variant:t!=null&&t.claudeEnabled?"default":"outline",size:"sm",className:"h-7",disabled:a||l,onClick:()=>i(!(t!=null&&t.claudeEnabled),"claude"),children:t!=null&&t.claudeEnabled?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.enabled"})]}):e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.disabled"})]})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.responseLanguage.chineseClaudeDesc"})})]}),e.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:s({id:"settings.responseLanguage.chineseCodex"})}),e.jsx($,{variant:"secondary",className:"text-xs",children:"Codex"})]}),e.jsx(N,{variant:t!=null&&t.codexEnabled?"default":"outline",size:"sm",className:"h-7",disabled:a||l,onClick:()=>i(!(t!=null&&t.codexEnabled),"codex"),children:t!=null&&t.codexEnabled?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.enabled"})]}):e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.disabled"})]})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.responseLanguage.chineseCodexDesc"})}),(t==null?void 0:t.codexNeedsMigration)&&e.jsxs("p",{className:"text-xs text-yellow-500",children:[e.jsx(Le,{className:"w-3 h-3 inline mr-1"}),s({id:"settings.responseLanguage.migrationWarning"})]})]}),e.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Js,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium",children:s({id:"settings.responseLanguage.windowsPlatform"})})]}),e.jsx(N,{variant:o!=null&&o.enabled?"default":"outline",size:"sm",className:"h-7",disabled:x||C,onClick:()=>p(!(o!=null&&o.enabled)),children:o!=null&&o.enabled?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.enabled"})]}):e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.disabled"})]})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.responseLanguage.windowsPlatformDesc"})})]}),e.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Xs,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium",children:s({id:"settings.responseLanguage.cliEnhancement"})}),e.jsx($,{variant:"secondary",className:"text-xs",children:"Codex"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[(g==null?void 0:g.enabled)&&e.jsx(N,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",disabled:k||b,onClick:()=>m(),title:s({id:"settings.responseLanguage.refreshConfig"}),children:e.jsx(X,{className:A("w-3.5 h-3.5",b&&"animate-spin")})}),e.jsx(N,{variant:g!=null&&g.enabled?"default":"outline",size:"sm",className:"h-7",disabled:k||F,onClick:()=>h(!(g!=null&&g.enabled)),children:g!=null&&g.enabled?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.enabled"})]}):e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-1"}),s({id:"settings.responseLanguage.disabled"})]})})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.responseLanguage.cliEnhancementDesc"})}),(g==null?void 0:g.enabled)&&e.jsx("p",{className:"text-xs text-muted-foreground/70",children:s({id:"settings.responseLanguage.cliEnhancementHint"})})]})]}),e.jsx("div",{className:"mt-4 pt-4 border-t border-border",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.responseLanguage.exportImportHint"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{ref:E,type:"file",accept:".json,application/json",onChange:V,className:"hidden"}),e.jsx(N,{variant:"outline",size:"sm",className:"h-7",disabled:S,onClick:()=>{var O;return(O=E.current)==null?void 0:O.click()},children:S?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-3.5 h-3.5 border-2 border-border border-t-accent rounded-full animate-spin mr-1"}),s({id:"settings.responseLanguage.importing"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Lt,{className:"w-3.5 h-3.5 mr-1"}),s({id:"settings.responseLanguage.import"})]})}),e.jsx(N,{variant:"outline",size:"sm",className:"h-7",disabled:u,onClick:R,children:u?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-3.5 h-3.5 border-2 border-border border-t-accent rounded-full animate-spin mr-1"}),s({id:"settings.responseLanguage.exporting"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Qs,{className:"w-3.5 h-3.5 mr-1"}),s({id:"settings.responseLanguage.export"})]})})]})]})})]})}function fa(){const{formatMessage:s}=H(),[t,a]=d.useState(null),[i,l]=d.useState(!1),[o,x]=d.useState(null),[p,C]=d.useState(null),[g,k]=d.useState(()=>{try{const m=localStorage.getItem("ccw.autoUpdate");return m===null?!0:JSON.parse(m)}catch{return!0}}),h=async(m=!1)=>{m||l(!0),x(null);try{const b=await fetch("/api/version-check");if(!b.ok)throw new Error(`HTTP ${b.status}`);const v=await b.json();if(!v.currentVersion)throw new Error("Invalid response");a(v),C(new Date)}catch(b){m||x(b instanceof Error?b.message:"Unknown error")}finally{l(!1)}};d.useEffect(()=>{if(h(!0),!g)return;const m=setInterval(()=>h(!0),3600*1e3);return()=>clearInterval(m)},[g]);const F=m=>{k(m),localStorage.setItem("ccw.autoUpdate",JSON.stringify(m))};return e.jsxs(_,{className:"p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Je,{className:"w-5 h-5"}),s({id:"settings.versionCheck.title"})]}),e.jsxs(N,{variant:"outline",size:"sm",disabled:i,onClick:()=>h(),children:[e.jsx(X,{className:A("w-3.5 h-3.5 mr-1.5",i&&"animate-spin")}),s(i?{id:"settings.versionCheck.checking"}:{id:"settings.versionCheck.checkNow"})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:s({id:"settings.versionCheck.currentVersion"})}),e.jsx($,{variant:"secondary",className:"font-mono text-xs",children:(t==null?void 0:t.currentVersion)??"..."})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:s({id:"settings.versionCheck.latestVersion"})}),e.jsx($,{variant:t!=null&&t.hasUpdate?"default":"secondary",className:"font-mono text-xs",children:(t==null?void 0:t.latestVersion)??"..."})]}),t&&e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-border",children:[e.jsx("span",{className:"text-sm font-medium",children:t.hasUpdate?s({id:"settings.versionCheck.updateAvailable"}):s({id:"settings.versionCheck.upToDate"})}),e.jsx("span",{className:A("inline-block w-2.5 h-2.5 rounded-full",t.hasUpdate?"bg-orange-500":"bg-green-500")})]}),o&&e.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-border",children:[e.jsx(Le,{className:"w-4 h-4 text-destructive flex-shrink-0"}),e.jsxs("span",{className:"text-sm text-destructive",children:[s({id:"settings.versionCheck.checkFailed"}),": ",o]})]})]}),(t==null?void 0:t.hasUpdate)&&e.jsxs("div",{className:"rounded-lg border border-orange-500/30 bg-orange-500/5 p-4 space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-foreground mb-1",children:s({id:"settings.versionCheck.updateCommand"})}),e.jsx("code",{className:"text-xs font-mono bg-muted px-3 py-1.5 rounded block",children:t.updateCommand})]}),e.jsx(N,{variant:"outline",size:"sm",asChild:!0,children:e.jsx("a",{href:"https://github.com/dyw0830/ccw/releases",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5",children:s({id:"settings.versionCheck.viewRelease"})})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:g,onChange:m=>F(m.target.checked),className:"rounded border-input"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium",children:s({id:"settings.versionCheck.autoCheck"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s({id:"settings.versionCheck.autoCheckDesc"})})]})]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[s({id:"settings.versionCheck.lastChecked"}),":"," ",p?p.toLocaleTimeString():s({id:"settings.versionCheck.never"})]})]})]})]})}function pa(){const{formatMessage:s}=H(),{installations:t,isLoading:a,refetch:i}=vt(),{upgrade:l,isPending:o}=yt(),{data:x}=wt();return e.jsxs(_,{className:"p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[e.jsx(Dt,{className:"w-5 h-5"}),s({id:"settings.systemStatus.title"}),!a&&e.jsxs("span",{className:"text-sm font-normal text-muted-foreground",children:[t.length," ",s({id:"settings.systemStatus.installations"})]})]}),e.jsx("div",{className:"flex items-center gap-1",children:e.jsx(N,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>i(),title:s({id:"settings.systemStatus.refresh"}),children:e.jsx(X,{className:A("w-3.5 h-3.5",a&&"animate-spin")})})})]}),a?e.jsx("div",{className:"text-sm text-muted-foreground py-4 text-center",children:s({id:"settings.systemStatus.checking"})}):t.length===0?e.jsxs("div",{className:"text-center py-6 space-y-2",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.systemStatus.noInstallations"})}),e.jsx("div",{className:"bg-muted/50 rounded-md p-3 inline-block",children:e.jsx("code",{className:"text-xs font-mono",children:"ccw install"})})]}):e.jsxs("div",{className:"space-y-3",children:[t.map(p=>{const C=p.installation_mode==="Global",g=new Date(p.installation_date).toLocaleDateString(),k=p.application_version!=="unknown"?p.application_version:p.installer_version;return e.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:A("inline-flex items-center justify-center w-8 h-8 rounded-lg",C?"bg-primary/10 text-primary":"bg-orange-500/10 text-orange-500"),children:C?e.jsx(Ys,{className:"w-4 h-4"}):e.jsx(Ut,{className:"w-4 h-4"})}),e.jsx("span",{className:"text-sm font-medium",children:s(C?{id:"settings.systemStatus.global"}:{id:"settings.systemStatus.path"})}),e.jsxs($,{variant:"secondary",className:"text-xs font-mono",children:["v",k]})]}),e.jsxs(N,{variant:"ghost",size:"sm",className:"h-7",disabled:o,onClick:()=>l(p.installation_path),children:[e.jsx(Je,{className:A("w-3.5 h-3.5 mr-1",o&&"animate-spin")}),s(o?{id:"settings.systemStatus.upgrading"}:{id:"settings.systemStatus.upgrade"})]})]}),e.jsx("div",{className:"text-xs text-muted-foreground bg-muted/50 rounded px-2 py-1 font-mono truncate",title:p.installation_path,children:p.installation_path}),e.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Zs,{className:"w-3 h-3"}),g]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(et,{className:"w-3 h-3"}),p.files_count," ",s({id:"settings.systemStatus.files"})]})]})]},p.manifest_id)}),x&&!x.installed&&x.missingFiles.length>0&&e.jsxs("div",{className:"rounded-lg border border-yellow-500/50 bg-yellow-500/5 p-4 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-yellow-600 dark:text-yellow-500",children:[e.jsx(Le,{className:"w-4 h-4"}),s({id:"settings.systemStatus.incomplete"})," — ",x.missingFiles.length," ",s({id:"settings.systemStatus.missingFiles"}).toLowerCase()]}),e.jsxs("ul",{className:"text-xs text-muted-foreground list-disc list-inside",children:[x.missingFiles.slice(0,4).map(p=>e.jsx("li",{children:p},p)),x.missingFiles.length>4&&e.jsxs("li",{children:["+",x.missingFiles.length-4," more..."]})]}),e.jsxs("div",{className:"bg-muted/50 rounded-md p-2",children:[e.jsxs("p",{className:"text-xs font-medium mb-1",children:[s({id:"settings.systemStatus.runToFix"}),":"]}),e.jsx("code",{className:"text-xs font-mono bg-background px-2 py-1 rounded block",children:"ccw install"})]})]})]})]})}function ba({cliTools:s,defaultCliTool:t,expandedTools:a,savingTools:i,onToggleExpand:l,onToggleEnabled:o,onSetDefault:x,onUpdateModel:p,onUpdateTags:C,onUpdateAvailableModels:g,onUpdateEnvFile:k,onUpdateSettingsFile:h,onUpdateEffort:F,onSaveToBackend:m,formatMessage:b}){const{data:v}=kt();return e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-muted-foreground mb-4",children:[b({id:"settings.cliTools.description"})," ",e.jsx("strong",{className:"text-foreground",children:t})]}),e.jsx("div",{className:"space-y-3",children:Object.entries(s).map(([u,P])=>{const S=v==null?void 0:v[u];return e.jsx(ha,{toolId:u,config:P,isDefault:u===t,isExpanded:a.has(u),toolAvailable:S==null?void 0:S.available,isSaving:i.has(u),onToggleExpand:()=>l(u),onToggleEnabled:()=>o(u),onSetDefault:()=>x(u),onUpdateModel:(E,R)=>p(u,E,R),onUpdateTags:E=>C(u,E),onUpdateAvailableModels:E=>g(u,E),onUpdateEnvFile:E=>k(u,E),onUpdateSettingsFile:E=>h(u,E),onUpdateEffort:E=>F(u,E),onSaveToBackend:()=>m(u)},u)})})]})}function Ia(){const{formatMessage:s}=H(),{theme:t,setTheme:a}=Ee(),i=ge(Vs),l=ge(qs),o=ge(Ws),{updateCliTool:x,setDefaultCliTool:p,setUserPreferences:C,resetUserPreferences:g}=ge(),[k,h]=d.useState(new Set),[F,m]=d.useState(new Set),b=r=>{h(f=>{const c=new Set(f);return c.has(r)?c.delete(r):c.add(r),c})},v=r=>{x(r,{enabled:!i[r].enabled})},u=r=>{p(r)},P=(r,f,c)=>{x(r,{[f]:c})},S=(r,f)=>{x(r,{tags:f})},E=(r,f)=>{x(r,{availableModels:f})},R=(r,f)=>{x(r,{envFile:f})},V=(r,f)=>{x(r,{settingsFile:f})},O=(r,f)=>{x(r,{effort:f})},j=d.useCallback(async r=>{const f=i[r];if(f){m(c=>new Set(c).add(r));try{const c={enabled:f.enabled,primaryModel:f.primaryModel,secondaryModel:f.secondaryModel,tags:f.tags,availableModels:f.availableModels},L=Ye(r);L==="envFile"?c.envFile=f.envFile||null:L==="settingsFile"&&(c.settingsFile=f.settingsFile||null,c.effort=f.effort||null);const z=ma(),q={"Content-Type":"application/json"};z&&(q["X-CSRF-Token"]=z);const B=await fetch(`/api/cli/config/${r}`,{method:"PUT",headers:q,body:JSON.stringify(c),credentials:"same-origin"});if(!B.ok)throw new Error(`HTTP ${B.status}`);I.success(s({id:"settings.cliTools.configSaved"}),{description:r})}catch{I.error(s({id:"settings.cliTools.configSaveError"}),{description:r})}finally{m(c=>{const L=new Set(c);return L.delete(r),L})}}},[i,s]),y=(r,f)=>{C({[r]:f})};return e.jsxs("div",{className:"max-w-4xl mx-auto space-y-8",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold text-foreground flex items-center gap-2",children:[e.jsx(Gs,{className:"w-6 h-6 text-primary"}),s({id:"settings.title"})]}),e.jsx("p",{className:"text-muted-foreground mt-1",children:s({id:"settings.description"})})]}),e.jsxs(_,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Ks,{className:"w-5 h-5"}),s({id:"settings.sections.appearance"})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground mb-1",children:s({id:"settings.appearance.theme"})}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:s({id:"settings.appearance.description"})}),e.jsx(Vt,{})]}),e.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-border",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:s({id:"settings.appearance.systemFollow"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.appearance.systemFollowDesc"})})]}),e.jsx(N,{variant:t==="system"?"default":"outline",size:"sm",onClick:()=>a("system"),children:s({id:"settings.appearance.themeOptions.system"})})]})]})]}),e.jsxs(_,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Xe,{className:"w-5 h-5"}),s({id:"settings.sections.language"})]}),e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:s({id:"settings.language.displayLanguage"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.language.chooseLanguage"})})]}),e.jsx(Wt,{})]})})]}),e.jsx(ga,{}),e.jsx(ra,{}),e.jsx(pa,{}),e.jsx(fa,{}),e.jsxs(_,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Ke,{className:"w-5 h-5"}),s({id:"settings.sections.cliTools"})]}),e.jsx(ba,{cliTools:i,defaultCliTool:l,expandedTools:k,savingTools:F,onToggleExpand:b,onToggleEnabled:v,onSetDefault:u,onUpdateModel:P,onUpdateTags:S,onUpdateAvailableModels:E,onUpdateEnvFile:R,onUpdateSettingsFile:V,onUpdateEffort:O,onSaveToBackend:j,formatMessage:s})]}),e.jsx(da,{}),e.jsxs(_,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(X,{className:"w-5 h-5"}),s({id:"settings.dataRefresh.title"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:s({id:"settings.dataRefresh.autoRefresh"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.dataRefresh.autoRefreshDesc"})})]}),e.jsx(N,{variant:o.autoRefresh?"default":"outline",size:"sm",onClick:()=>y("autoRefresh",!o.autoRefresh),children:o.autoRefresh?s({id:"settings.dataRefresh.enabled"}):s({id:"settings.dataRefresh.disabled"})})]}),o.autoRefresh&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:s({id:"settings.dataRefresh.refreshInterval"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.dataRefresh.refreshIntervalDesc"})})]}),e.jsx("div",{className:"flex gap-2",children:[15e3,3e4,6e4,12e4].map(r=>e.jsxs(N,{variant:o.refreshInterval===r?"default":"outline",size:"sm",onClick:()=>y("refreshInterval",r),children:[r/1e3,"s"]},r))})]})]})]}),e.jsxs(_,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Fe,{className:"w-5 h-5"}),s({id:"settings.notifications.title"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:s({id:"settings.notifications.enableNotifications"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.notifications.enableNotificationsDesc"})})]}),e.jsx(N,{variant:o.notificationsEnabled?"default":"outline",size:"sm",onClick:()=>y("notificationsEnabled",!o.notificationsEnabled),children:o.notificationsEnabled?s({id:"settings.dataRefresh.enabled"}):s({id:"settings.dataRefresh.disabled"})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-foreground",children:s({id:"settings.notifications.soundEffects"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s({id:"settings.notifications.soundEffectsDesc"})})]}),e.jsx(N,{variant:o.soundEnabled?"default":"outline",size:"sm",onClick:()=>y("soundEnabled",!o.soundEnabled),children:o.soundEnabled?s({id:"settings.notifications.on"}):s({id:"settings.notifications.off"})})]})]})]}),e.jsx(ta,{}),e.jsxs(_,{className:"p-6 border-destructive/50",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Ve,{className:"w-5 h-5"}),s({id:"common.actions.reset"})]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:s({id:"settings.reset.description"})}),e.jsxs(N,{variant:"destructive",onClick:()=>{confirm(s({id:"settings.reset.confirm"}))&&g()},children:[e.jsx(Ve,{className:"w-4 h-4 mr-2"}),s({id:"common.actions.resetToDefaults"})]})]})]})}export{Ia as SettingsPage,Ia as default};
144
- //# sourceMappingURL=SettingsPage-DJltvfrs.js.map