claude-code-workflow 7.2.10 → 7.2.11

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 (322) hide show
  1. package/.claude/agents/cli-planning-agent.md +3 -0
  2. package/.claude/agents/debug-explore-agent.md +1 -0
  3. package/.claude/agents/tdd-developer.md +1 -0
  4. package/.claude/agents/team-worker.md +1 -1
  5. package/.claude/agents/test-action-planning-agent.md +3 -0
  6. package/.claude/agents/test-context-search-agent.md +1 -0
  7. package/.claude/agents/test-fix-agent.md +3 -0
  8. package/.claude/skills/review-code/SKILL.md +2 -0
  9. package/.claude/skills/review-cycle/SKILL.md +4 -0
  10. package/.claude/skills/skill-simplify/phases/02-optimize.md +4 -0
  11. package/.claude/skills/spec-generator/phases/05-epics-stories.md +4 -0
  12. package/.claude/skills/team-arch-opt/specs/team-config.json +5 -5
  13. package/.claude/skills/team-frontend-debug/roles/analyzer/role.md +3 -2
  14. package/.claude/skills/team-perf-opt/roles/coordinator/commands/monitor.md +1 -1
  15. package/.claude/skills/team-perf-opt/specs/team-config.json +5 -5
  16. package/.claude/skills/team-quality-assurance/roles/executor/role.md +2 -1
  17. package/.claude/skills/team-review/roles/reviewer/role.md +2 -1
  18. package/.claude/skills/team-tech-debt/roles/scanner/role.md +2 -1
  19. package/.claude/skills/team-testing/roles/executor/role.md +2 -1
  20. package/.claude/skills/team-testing/roles/generator/role.md +2 -1
  21. package/.claude/skills/team-ultra-analyze/roles/explorer/role.md +2 -1
  22. package/.claude/skills/team-ux-improve/specs/team-config.json +6 -6
  23. package/.claude/skills/workflow-execute/phases/06-review.md +4 -4
  24. package/.claude/skills/workflow-lite-test-review/SKILL.md +2 -0
  25. package/.claude/skills/workflow-plan/phases/05-plan-verify.md +4 -0
  26. package/.claude/skills/workflow-tdd-plan/phases/02-context-gathering.md +1 -0
  27. package/.claude/skills/workflow-tdd-plan/phases/05-tdd-task-generation.md +2 -1
  28. package/.claude/skills/workflow-test-fix/phases/02-test-context-gather.md +1 -0
  29. package/.claude/skills/workflow-test-fix/phases/05-test-cycle-execute.md +2 -1
  30. package/.claude/skills/workflow-tune/SKILL.md +487 -0
  31. package/.claude/skills/workflow-tune/phases/01-setup.md +548 -0
  32. package/.claude/skills/workflow-tune/phases/02-step-execute.md +197 -0
  33. package/.claude/skills/workflow-tune/phases/03-step-analyze.md +386 -0
  34. package/.claude/skills/workflow-tune/phases/04-synthesize.md +257 -0
  35. package/.claude/skills/workflow-tune/phases/05-optimize-report.md +246 -0
  36. package/.claude/skills/workflow-tune/specs/workflow-eval-criteria.md +57 -0
  37. package/.claude/skills/workflow-tune/templates/step-analysis-prompt.md +88 -0
  38. package/.claude/skills/workflow-tune/templates/synthesis-prompt.md +90 -0
  39. package/.codex/skills/analyze-with-file/SKILL.md +2 -0
  40. package/.codex/skills/debug-with-file/SKILL.md +4 -0
  41. package/.codex/skills/issue-discover/SKILL.md +1 -0
  42. package/.codex/skills/review-cycle/phases/02-parallel-review.md +3 -0
  43. package/.codex/skills/team-designer/agents/validation-reporter.md +186 -0
  44. package/.codex/skills/team-iterdev/agents/gc-controller.md +193 -0
  45. package/.codex/skills/team-iterdev/agents/task-analyzer.md +206 -0
  46. package/.codex/skills/team-lifecycle-v4/agents/quality-gate.md +165 -0
  47. package/.codex/skills/team-lifecycle-v4/agents/requirement-clarifier.md +163 -0
  48. package/.codex/skills/team-lifecycle-v4/agents/supervisor.md +182 -0
  49. package/.codex/skills/team-uidesign/agents/completion-handler.md +177 -0
  50. package/.codex/skills/team-uidesign/agents/gc-loop-handler.md +162 -0
  51. package/.codex/skills/workflow-test-fix-cycle/phases/01-test-fix-gen.md +4 -0
  52. package/.codex/skills/workflow-test-fix-cycle/phases/02-test-cycle-execute.md +2 -0
  53. package/ccw/dist/commands/spec.d.ts.map +1 -1
  54. package/ccw/dist/commands/spec.js +9 -4
  55. package/ccw/dist/commands/spec.js.map +1 -1
  56. package/ccw/dist/core/routes/codexlens-routes.d.ts.map +1 -1
  57. package/ccw/dist/core/routes/codexlens-routes.js +3 -1
  58. package/ccw/dist/core/routes/codexlens-routes.js.map +1 -1
  59. package/ccw/dist/tools/spec-index-builder.d.ts +8 -4
  60. package/ccw/dist/tools/spec-index-builder.d.ts.map +1 -1
  61. package/ccw/dist/tools/spec-index-builder.js +8 -4
  62. package/ccw/dist/tools/spec-index-builder.js.map +1 -1
  63. package/ccw/dist/tools/spec-init.d.ts +1 -1
  64. package/ccw/dist/tools/spec-init.d.ts.map +1 -1
  65. package/ccw/dist/tools/spec-init.js +127 -0
  66. package/ccw/dist/tools/spec-init.js.map +1 -1
  67. package/ccw/dist/tools/spec-loader.d.ts.map +1 -1
  68. package/ccw/dist/tools/spec-loader.js +2 -1
  69. package/ccw/dist/tools/spec-loader.js.map +1 -1
  70. package/ccw/frontend/dist/assets/{AlertDialog-gTMl4gSG.js → AlertDialog-BW9jiZ-p.js} +2 -2
  71. package/ccw/frontend/dist/assets/{AlertDialog-gTMl4gSG.js.map → AlertDialog-BW9jiZ-p.js.map} +1 -1
  72. package/ccw/frontend/dist/assets/{AnalysisPage-Bc4p4SvJ.js → AnalysisPage-ds-w_nVO.js} +2 -2
  73. package/ccw/frontend/dist/assets/{AnalysisPage-Bc4p4SvJ.js.map → AnalysisPage-ds-w_nVO.js.map} +1 -1
  74. package/ccw/frontend/dist/assets/{ApiSettingsPage-CVK108u2.js → ApiSettingsPage-DlCbXxTz.js} +2 -2
  75. package/ccw/frontend/dist/assets/{ApiSettingsPage-CVK108u2.js.map → ApiSettingsPage-DlCbXxTz.js.map} +1 -1
  76. package/ccw/frontend/dist/assets/{CliModeToggle-34Sjwl05.js → CliModeToggle-Dq3nL4fF.js} +2 -2
  77. package/ccw/frontend/dist/assets/{CliModeToggle-34Sjwl05.js.map → CliModeToggle-Dq3nL4fF.js.map} +1 -1
  78. package/ccw/frontend/dist/assets/{CliSessionSharePage-bJZAYI38.js → CliSessionSharePage-BNDkEE4u.js} +2 -2
  79. package/ccw/frontend/dist/assets/{CliSessionSharePage-bJZAYI38.js.map → CliSessionSharePage-BNDkEE4u.js.map} +1 -1
  80. package/ccw/frontend/dist/assets/{CliViewerPage-VYnQGjxU.js → CliViewerPage-ChM-uNx_.js} +2 -2
  81. package/ccw/frontend/dist/assets/{CliViewerPage-VYnQGjxU.js.map → CliViewerPage-ChM-uNx_.js.map} +1 -1
  82. package/ccw/frontend/dist/assets/CodexLensPage-DOcsYNQk.js +2 -0
  83. package/ccw/frontend/dist/assets/CodexLensPage-DOcsYNQk.js.map +1 -0
  84. package/ccw/frontend/dist/assets/{Collapsible-B_xd1Qbg.js → Collapsible-CRNbykXN.js} +2 -2
  85. package/ccw/frontend/dist/assets/{Collapsible-B_xd1Qbg.js.map → Collapsible-CRNbykXN.js.map} +1 -1
  86. package/ccw/frontend/dist/assets/{CommandsManagerPage-Bjx1bPbH.js → CommandsManagerPage-C2JWcemF.js} +2 -2
  87. package/ccw/frontend/dist/assets/{CommandsManagerPage-Bjx1bPbH.js.map → CommandsManagerPage-C2JWcemF.js.map} +1 -1
  88. package/ccw/frontend/dist/assets/{DeepWikiPage-EgHsHvAH.js → DeepWikiPage-CvleOtJy.js} +2 -2
  89. package/ccw/frontend/dist/assets/{DeepWikiPage-EgHsHvAH.js.map → DeepWikiPage-CvleOtJy.js.map} +1 -1
  90. package/ccw/frontend/dist/assets/{EndpointsPage-CuwpbCzK.js → EndpointsPage-CMOWQG64.js} +2 -2
  91. package/ccw/frontend/dist/assets/{EndpointsPage-CuwpbCzK.js.map → EndpointsPage-CMOWQG64.js.map} +1 -1
  92. package/ccw/frontend/dist/assets/{ExplorerPage-cvlx0Zw0.js → ExplorerPage-DaFPRlNo.js} +2 -2
  93. package/ccw/frontend/dist/assets/{ExplorerPage-cvlx0Zw0.js.map → ExplorerPage-DaFPRlNo.js.map} +1 -1
  94. package/ccw/frontend/dist/assets/{FixSessionPage-C74-MPza.js → FixSessionPage-CC4p04Az.js} +2 -2
  95. package/ccw/frontend/dist/assets/{FixSessionPage-C74-MPza.js.map → FixSessionPage-CC4p04Az.js.map} +1 -1
  96. package/ccw/frontend/dist/assets/{FloatingFileBrowser-x_-6y_n2.js → FloatingFileBrowser-DROn1xZ5.js} +2 -2
  97. package/ccw/frontend/dist/assets/{FloatingFileBrowser-x_-6y_n2.js.map → FloatingFileBrowser-DROn1xZ5.js.map} +1 -1
  98. package/ccw/frontend/dist/assets/{FloatingPanel-BGwmbJR1.js → FloatingPanel-CmL_yhDv.js} +2 -2
  99. package/ccw/frontend/dist/assets/{FloatingPanel-BGwmbJR1.js.map → FloatingPanel-CmL_yhDv.js.map} +1 -1
  100. package/ccw/frontend/dist/assets/{GraphExplorerPage-Bg5-aQxi.js → GraphExplorerPage-DCV5ybKE.js} +2 -2
  101. package/ccw/frontend/dist/assets/{GraphExplorerPage-Bg5-aQxi.js.map → GraphExplorerPage-DCV5ybKE.js.map} +1 -1
  102. package/ccw/frontend/dist/assets/{HistoryPage-C00fh0HE.js → HistoryPage-D0fYQZgc.js} +2 -2
  103. package/ccw/frontend/dist/assets/{HistoryPage-C00fh0HE.js.map → HistoryPage-D0fYQZgc.js.map} +1 -1
  104. package/ccw/frontend/dist/assets/{HookManagerPage-CtVTB_ae.js → HookManagerPage-D2FuJfsM.js} +2 -2
  105. package/ccw/frontend/dist/assets/{HookManagerPage-CtVTB_ae.js.map → HookManagerPage-D2FuJfsM.js.map} +1 -1
  106. package/ccw/frontend/dist/assets/{InstallationsPage-CYuMQDbC.js → InstallationsPage-tjklillZ.js} +2 -2
  107. package/ccw/frontend/dist/assets/{InstallationsPage-CYuMQDbC.js.map → InstallationsPage-tjklillZ.js.map} +1 -1
  108. package/ccw/frontend/dist/assets/{IssueHubPage-T_VSvUMh.js → IssueHubPage-E4JVrhO1.js} +2 -2
  109. package/ccw/frontend/dist/assets/{IssueHubPage-T_VSvUMh.js.map → IssueHubPage-E4JVrhO1.js.map} +1 -1
  110. package/ccw/frontend/dist/assets/{LiteTasksPage-DmcgvIvi.js → LiteTasksPage-aJuRoyLt.js} +2 -2
  111. package/ccw/frontend/dist/assets/{LiteTasksPage-DmcgvIvi.js.map → LiteTasksPage-aJuRoyLt.js.map} +1 -1
  112. package/ccw/frontend/dist/assets/{McpManagerPage-C_a7QSKz.js → McpManagerPage-BJeuWJv1.js} +2 -2
  113. package/ccw/frontend/dist/assets/{McpManagerPage-C_a7QSKz.js.map → McpManagerPage-BJeuWJv1.js.map} +1 -1
  114. package/ccw/frontend/dist/assets/{MemoryPage-CWKmXY5k.js → MemoryPage-BI4FAXhs.js} +2 -2
  115. package/ccw/frontend/dist/assets/{MemoryPage-CWKmXY5k.js.map → MemoryPage-BI4FAXhs.js.map} +1 -1
  116. package/ccw/frontend/dist/assets/{NotFoundPage-B1duXK6r.js → NotFoundPage-DD2svchp.js} +2 -2
  117. package/ccw/frontend/dist/assets/{NotFoundPage-B1duXK6r.js.map → NotFoundPage-DD2svchp.js.map} +1 -1
  118. package/ccw/frontend/dist/assets/{OrchestratorPage-Ib9TM6HE.js → OrchestratorPage-FC__7yYa.js} +2 -2
  119. package/ccw/frontend/dist/assets/{OrchestratorPage-Ib9TM6HE.js.map → OrchestratorPage-FC__7yYa.js.map} +1 -1
  120. package/ccw/frontend/dist/assets/{ProjectOverviewPage-sXSWMbF8.js → ProjectOverviewPage-DBB_-FzV.js} +2 -2
  121. package/ccw/frontend/dist/assets/{ProjectOverviewPage-sXSWMbF8.js.map → ProjectOverviewPage-DBB_-FzV.js.map} +1 -1
  122. package/ccw/frontend/dist/assets/{PromptHistoryPage-B6jaqG12.js → PromptHistoryPage-BwOAvCH8.js} +2 -2
  123. package/ccw/frontend/dist/assets/{PromptHistoryPage-B6jaqG12.js.map → PromptHistoryPage-BwOAvCH8.js.map} +1 -1
  124. package/ccw/frontend/dist/assets/{ReviewSessionPage-D5qJyr3s.js → ReviewSessionPage-Dd1-g_gp.js} +2 -2
  125. package/ccw/frontend/dist/assets/{ReviewSessionPage-D5qJyr3s.js.map → ReviewSessionPage-Dd1-g_gp.js.map} +1 -1
  126. package/ccw/frontend/dist/assets/{RulesManagerPage-DyawK8QE.js → RulesManagerPage-B3RGdsKD.js} +2 -2
  127. package/ccw/frontend/dist/assets/{RulesManagerPage-DyawK8QE.js.map → RulesManagerPage-B3RGdsKD.js.map} +1 -1
  128. package/ccw/frontend/dist/assets/{SessionDetailPage-Cym_RvC9.js → SessionDetailPage-DM-W5R8K.js} +2 -2
  129. package/ccw/frontend/dist/assets/{SessionDetailPage-Cym_RvC9.js.map → SessionDetailPage-DM-W5R8K.js.map} +1 -1
  130. package/ccw/frontend/dist/assets/{SessionsPage-Dkc1Hv8W.js → SessionsPage-BVz1KCc7.js} +2 -2
  131. package/ccw/frontend/dist/assets/{SessionsPage-Dkc1Hv8W.js.map → SessionsPage-BVz1KCc7.js.map} +1 -1
  132. package/ccw/frontend/dist/assets/{SettingsPage-Rik9cUIj.js → SettingsPage-ComW7EZS.js} +4 -4
  133. package/ccw/frontend/dist/assets/{SettingsPage-Rik9cUIj.js.map → SettingsPage-ComW7EZS.js.map} +1 -1
  134. package/ccw/frontend/dist/assets/{SkillsManagerPage-BGDWYAyI.js → SkillsManagerPage-CKom9XwV.js} +2 -2
  135. package/ccw/frontend/dist/assets/{SkillsManagerPage-BGDWYAyI.js.map → SkillsManagerPage-CKom9XwV.js.map} +1 -1
  136. package/ccw/frontend/dist/assets/{SpecsSettingsPage-CTiA1DMP.js → SpecsSettingsPage-DQz7WP2s.js} +2 -2
  137. package/ccw/frontend/dist/assets/{SpecsSettingsPage-CTiA1DMP.js.map → SpecsSettingsPage-DQz7WP2s.js.map} +1 -1
  138. package/ccw/frontend/dist/assets/{Switch-BgAFC-Wk.js → Switch-BPMdND9H.js} +2 -2
  139. package/ccw/frontend/dist/assets/{Switch-BgAFC-Wk.js.map → Switch-BPMdND9H.js.map} +1 -1
  140. package/ccw/frontend/dist/assets/{TabsNavigation-drSnu5jn.js → TabsNavigation-qqt70VYL.js} +2 -2
  141. package/ccw/frontend/dist/assets/{TabsNavigation-drSnu5jn.js.map → TabsNavigation-qqt70VYL.js.map} +1 -1
  142. package/ccw/frontend/dist/assets/{TaskDrawer-ePC__6-P.js → TaskDrawer-BqK_qiHX.js} +2 -2
  143. package/ccw/frontend/dist/assets/{TaskDrawer-ePC__6-P.js.map → TaskDrawer-BqK_qiHX.js.map} +1 -1
  144. package/ccw/frontend/dist/assets/{TeamPage-C6bdFWn8.js → TeamPage-u5_i0Rgh.js} +2 -2
  145. package/ccw/frontend/dist/assets/{TeamPage-C6bdFWn8.js.map → TeamPage-u5_i0Rgh.js.map} +1 -1
  146. package/ccw/frontend/dist/assets/{TerminalDashboardPage-Zofi_DZM.js → TerminalDashboardPage-rUtC9e40.js} +2 -2
  147. package/ccw/frontend/dist/assets/{TerminalDashboardPage-Zofi_DZM.js.map → TerminalDashboardPage-rUtC9e40.js.map} +1 -1
  148. package/ccw/frontend/dist/assets/{archive-Bza1KlB9.js → archive-C3u8YNQF.js} +2 -2
  149. package/ccw/frontend/dist/assets/{archive-Bza1KlB9.js.map → archive-C3u8YNQF.js.map} +1 -1
  150. package/ccw/frontend/dist/assets/{archive-restore-CpsDm-cG.js → archive-restore-DfQ998g5.js} +2 -2
  151. package/ccw/frontend/dist/assets/{archive-restore-CpsDm-cG.js.map → archive-restore-DfQ998g5.js.map} +1 -1
  152. package/ccw/frontend/dist/assets/{arrow-right-CibG_LVO.js → arrow-right-BshJM9Po.js} +2 -2
  153. package/ccw/frontend/dist/assets/{arrow-right-CibG_LVO.js.map → arrow-right-BshJM9Po.js.map} +1 -1
  154. package/ccw/frontend/dist/assets/{bookmark-plus-BheO8EgG.js → bookmark-plus-D03qJyOZ.js} +2 -2
  155. package/ccw/frontend/dist/assets/{bookmark-plus-BheO8EgG.js.map → bookmark-plus-D03qJyOZ.js.map} +1 -1
  156. package/ccw/frontend/dist/assets/{bot-BlhM0Nl0.js → bot-CyzWuwq0.js} +2 -2
  157. package/ccw/frontend/dist/assets/{bot-BlhM0Nl0.js.map → bot-CyzWuwq0.js.map} +1 -1
  158. package/ccw/frontend/dist/assets/{braces-Dqjg_eCO.js → braces-BPgtyjsG.js} +2 -2
  159. package/ccw/frontend/dist/assets/{braces-Dqjg_eCO.js.map → braces-BPgtyjsG.js.map} +1 -1
  160. package/ccw/frontend/dist/assets/{circle-stop-DYZSLYU0.js → circle-stop-Dix1AOmw.js} +2 -2
  161. package/ccw/frontend/dist/assets/{circle-stop-DYZSLYU0.js.map → circle-stop-Dix1AOmw.js.map} +1 -1
  162. package/ccw/frontend/dist/assets/{cpu-DWCyAOAv.js → cpu-CCQ4Q0Zh.js} +2 -2
  163. package/ccw/frontend/dist/assets/{cpu-DWCyAOAv.js.map → cpu-CCQ4Q0Zh.js.map} +1 -1
  164. package/ccw/frontend/dist/assets/{ellipsis-vertical-DIyoSEHx.js → ellipsis-vertical-BpTysg-Y.js} +2 -2
  165. package/ccw/frontend/dist/assets/{ellipsis-vertical-DIyoSEHx.js.map → ellipsis-vertical-BpTysg-Y.js.map} +1 -1
  166. package/ccw/frontend/dist/assets/{eye-DUy7aLEx.js → eye-DGY1rAZs.js} +2 -2
  167. package/ccw/frontend/dist/assets/{eye-DUy7aLEx.js.map → eye-DGY1rAZs.js.map} +1 -1
  168. package/ccw/frontend/dist/assets/{eye-off-CGRUVRDR.js → eye-off-D8t3JfWG.js} +2 -2
  169. package/ccw/frontend/dist/assets/{eye-off-CGRUVRDR.js.map → eye-off-D8t3JfWG.js.map} +1 -1
  170. package/ccw/frontend/dist/assets/{file-json-BxLBtU9d.js → file-json-BAdJb0n8.js} +2 -2
  171. package/ccw/frontend/dist/assets/{file-json-BxLBtU9d.js.map → file-json-BAdJb0n8.js.map} +1 -1
  172. package/ccw/frontend/dist/assets/{file-text-BoHsW2es.js → file-text-DrJFiOUB.js} +2 -2
  173. package/ccw/frontend/dist/assets/{file-text-BoHsW2es.js.map → file-text-DrJFiOUB.js.map} +1 -1
  174. package/ccw/frontend/dist/assets/{filter-B4vOqP6B.js → filter-CKqzYbz7.js} +2 -2
  175. package/ccw/frontend/dist/assets/{filter-B4vOqP6B.js.map → filter-CKqzYbz7.js.map} +1 -1
  176. package/ccw/frontend/dist/assets/{folder-BKhwCNFG.js → folder-CV8511y9.js} +2 -2
  177. package/ccw/frontend/dist/assets/{folder-BKhwCNFG.js.map → folder-CV8511y9.js.map} +1 -1
  178. package/ccw/frontend/dist/assets/{gauge-Dgf64gkT.js → gauge-XKvmu_uU.js} +2 -2
  179. package/ccw/frontend/dist/assets/{gauge-Dgf64gkT.js.map → gauge-XKvmu_uU.js.map} +1 -1
  180. package/ccw/frontend/dist/assets/{globe-Cus_S6Ux.js → globe-C56cDUzX.js} +2 -2
  181. package/ccw/frontend/dist/assets/{globe-Cus_S6Ux.js.map → globe-C56cDUzX.js.map} +1 -1
  182. package/ccw/frontend/dist/assets/{grid-3x3-DM08hpAN.js → grid-3x3-Bya-suFW.js} +2 -2
  183. package/ccw/frontend/dist/assets/{grid-3x3-DM08hpAN.js.map → grid-3x3-Bya-suFW.js.map} +1 -1
  184. package/ccw/frontend/dist/assets/{hard-drive-eCtll84F.js → hard-drive-CmuTZpsB.js} +2 -2
  185. package/ccw/frontend/dist/assets/{hard-drive-eCtll84F.js.map → hard-drive-CmuTZpsB.js.map} +1 -1
  186. package/ccw/frontend/dist/assets/{hash-Bd1RD285.js → hash-CRPT_tJQ.js} +2 -2
  187. package/ccw/frontend/dist/assets/{hash-Bd1RD285.js.map → hash-CRPT_tJQ.js.map} +1 -1
  188. package/ccw/frontend/dist/assets/{history-eyyCQA6b.js → history-C1pJZQCL.js} +2 -2
  189. package/ccw/frontend/dist/assets/{history-eyyCQA6b.js.map → history-C1pJZQCL.js.map} +1 -1
  190. package/ccw/frontend/dist/assets/{index-ZnmWxcZg.js → index-B6TpijCe.js} +2 -2
  191. package/ccw/frontend/dist/assets/{index-ZnmWxcZg.js.map → index-B6TpijCe.js.map} +1 -1
  192. package/ccw/frontend/dist/assets/{index-b2C0iFd1.js → index-Bcq-7r6F.js} +2 -2
  193. package/ccw/frontend/dist/assets/{index-b2C0iFd1.js.map → index-Bcq-7r6F.js.map} +1 -1
  194. package/ccw/frontend/dist/assets/{index-Cs2ShCCy.js → index-CI8-rBff.js} +2 -2
  195. package/ccw/frontend/dist/assets/{index-Cs2ShCCy.js.map → index-CI8-rBff.js.map} +1 -1
  196. package/ccw/frontend/dist/assets/{index-CY6Lueph.js → index-Dmt9OiEf.js} +2 -2
  197. package/ccw/frontend/dist/assets/{index-CY6Lueph.js.map → index-Dmt9OiEf.js.map} +1 -1
  198. package/ccw/frontend/dist/assets/{index-DfeBbFXo.js → index-anSMmEF8.js} +2 -2
  199. package/ccw/frontend/dist/assets/{index-DfeBbFXo.js.map → index-anSMmEF8.js.map} +1 -1
  200. package/ccw/frontend/dist/assets/{index-B6I7GQC5.js → index-dWT2M6Ef.js} +4 -4
  201. package/ccw/frontend/dist/assets/{index-B6I7GQC5.js.map → index-dWT2M6Ef.js.map} +1 -1
  202. package/ccw/frontend/dist/assets/{layout-grid-ChrTrCby.js → layout-grid-TSO0BFQE.js} +2 -2
  203. package/ccw/frontend/dist/assets/{layout-grid-ChrTrCby.js.map → layout-grid-TSO0BFQE.js.map} +1 -1
  204. package/ccw/frontend/dist/assets/{lightbulb-CvXiTlzN.js → lightbulb-Caj6fIQD.js} +2 -2
  205. package/ccw/frontend/dist/assets/{lightbulb-CvXiTlzN.js.map → lightbulb-Caj6fIQD.js.map} +1 -1
  206. package/ccw/frontend/dist/assets/{link-2-W0Nl17ec.js → link-2-DE9lMxa-.js} +2 -2
  207. package/ccw/frontend/dist/assets/{link-2-W0Nl17ec.js.map → link-2-DE9lMxa-.js.map} +1 -1
  208. package/ccw/frontend/dist/assets/{link-CL4JmoHb.js → link-BZtPgLW0.js} +2 -2
  209. package/ccw/frontend/dist/assets/{link-CL4JmoHb.js.map → link-BZtPgLW0.js.map} +1 -1
  210. package/ccw/frontend/dist/assets/{list-CDmYFcio.js → list-DubWyY-U.js} +2 -2
  211. package/ccw/frontend/dist/assets/{list-CDmYFcio.js.map → list-DubWyY-U.js.map} +1 -1
  212. package/ccw/frontend/dist/assets/{map-pin-0Mfsw_3d.js → map-pin-DwN_48AF.js} +2 -2
  213. package/ccw/frontend/dist/assets/{map-pin-0Mfsw_3d.js.map → map-pin-DwN_48AF.js.map} +1 -1
  214. package/ccw/frontend/dist/assets/{messages-square-C6h08ple.js → messages-square-bjxvaiM9.js} +2 -2
  215. package/ccw/frontend/dist/assets/{messages-square-C6h08ple.js.map → messages-square-bjxvaiM9.js.map} +1 -1
  216. package/ccw/frontend/dist/assets/{minimize-2-Cbu2yRzi.js → minimize-2-CGfBKD_V.js} +2 -2
  217. package/ccw/frontend/dist/assets/{minimize-2-Cbu2yRzi.js.map → minimize-2-CGfBKD_V.js.map} +1 -1
  218. package/ccw/frontend/dist/assets/{package-CoLVUZGJ.js → package-nzWY6ilt.js} +2 -2
  219. package/ccw/frontend/dist/assets/{package-CoLVUZGJ.js.map → package-nzWY6ilt.js.map} +1 -1
  220. package/ccw/frontend/dist/assets/{plug-BYTYqsw1.js → plug-CiLce49C.js} +2 -2
  221. package/ccw/frontend/dist/assets/{plug-BYTYqsw1.js.map → plug-CiLce49C.js.map} +1 -1
  222. package/ccw/frontend/dist/assets/{power-DmIojFl-.js → power-CFLmB-U9.js} +2 -2
  223. package/ccw/frontend/dist/assets/{power-DmIojFl-.js.map → power-CFLmB-U9.js.map} +1 -1
  224. package/ccw/frontend/dist/assets/{save-BFa03OnG.js → save-DuO6OF0C.js} +2 -2
  225. package/ccw/frontend/dist/assets/{save-BFa03OnG.js.map → save-DuO6OF0C.js.map} +1 -1
  226. package/ccw/frontend/dist/assets/{send-Vet3sN4J.js → send-CZk9p0mM.js} +2 -2
  227. package/ccw/frontend/dist/assets/{send-Vet3sN4J.js.map → send-CZk9p0mM.js.map} +1 -1
  228. package/ccw/frontend/dist/assets/{square-check-big-B9nzZRfE.js → square-check-big-BY_1YQQg.js} +2 -2
  229. package/ccw/frontend/dist/assets/{square-check-big-B9nzZRfE.js.map → square-check-big-BY_1YQQg.js.map} +1 -1
  230. package/ccw/frontend/dist/assets/{square-pen-C7K13x4Z.js → square-pen-CnZgm6g-.js} +2 -2
  231. package/ccw/frontend/dist/assets/{square-pen-C7K13x4Z.js.map → square-pen-CnZgm6g-.js.map} +1 -1
  232. package/ccw/frontend/dist/assets/{star-BCQHcnSe.js → star-Cn1F0qy7.js} +2 -2
  233. package/ccw/frontend/dist/assets/{star-BCQHcnSe.js.map → star-Cn1F0qy7.js.map} +1 -1
  234. package/ccw/frontend/dist/assets/{style-CJsrp48L.js → style-Dxs1iXCV.js} +2 -2
  235. package/ccw/frontend/dist/assets/{style-CJsrp48L.js.map → style-Dxs1iXCV.js.map} +1 -1
  236. package/ccw/frontend/dist/assets/{target-CBzCJCB1.js → target-Bz1fLRKH.js} +2 -2
  237. package/ccw/frontend/dist/assets/{target-CBzCJCB1.js.map → target-Bz1fLRKH.js.map} +1 -1
  238. package/ccw/frontend/dist/assets/{test-tube-BYTc5mvQ.js → test-tube-C6qCYlDr.js} +2 -2
  239. package/ccw/frontend/dist/assets/{test-tube-BYTc5mvQ.js.map → test-tube-C6qCYlDr.js.map} +1 -1
  240. package/ccw/frontend/dist/assets/{upload-DzyQj7ib.js → upload-C71kd4Qs.js} +2 -2
  241. package/ccw/frontend/dist/assets/{upload-DzyQj7ib.js.map → upload-C71kd4Qs.js.map} +1 -1
  242. package/ccw/frontend/dist/assets/{useApiSettings-CFPww7gU.js → useApiSettings-CqP2BAJ7.js} +2 -2
  243. package/ccw/frontend/dist/assets/{useApiSettings-CFPww7gU.js.map → useApiSettings-CqP2BAJ7.js.map} +1 -1
  244. package/ccw/frontend/dist/assets/{useCli-ByL_a5CD.js → useCli-PCoPoVeM.js} +2 -2
  245. package/ccw/frontend/dist/assets/{useCli-ByL_a5CD.js.map → useCli-PCoPoVeM.js.map} +1 -1
  246. package/ccw/frontend/dist/assets/{useCommands-BvKIoOzB.js → useCommands-3OfPQPw4.js} +2 -2
  247. package/ccw/frontend/dist/assets/{useCommands-BvKIoOzB.js.map → useCommands-3OfPQPw4.js.map} +1 -1
  248. package/ccw/frontend/dist/assets/{useDebounce-CmKmoP7n.js → useDebounce-bXiFhQx9.js} +2 -2
  249. package/ccw/frontend/dist/assets/{useDebounce-CmKmoP7n.js.map → useDebounce-bXiFhQx9.js.map} +1 -1
  250. package/ccw/frontend/dist/assets/{useFileExplorer-G5UoArCU.js → useFileExplorer-DEyUm46_.js} +2 -2
  251. package/ccw/frontend/dist/assets/{useFileExplorer-G5UoArCU.js.map → useFileExplorer-DEyUm46_.js.map} +1 -1
  252. package/ccw/frontend/dist/assets/{useLocale-D2iHK44M.js → useLocale-sXTrdxcJ.js} +2 -2
  253. package/ccw/frontend/dist/assets/{useLocale-D2iHK44M.js.map → useLocale-sXTrdxcJ.js.map} +1 -1
  254. package/ccw/frontend/dist/assets/{useSkills-CYU4zqhm.js → useSkills-D0W0kXYm.js} +3 -3
  255. package/ccw/frontend/dist/assets/{useSkills-CYU4zqhm.js.map → useSkills-D0W0kXYm.js.map} +1 -1
  256. package/ccw/frontend/dist/assets/{useSystemSettings-JznNpij7.js → useSystemSettings-DZ-8lZsG.js} +2 -2
  257. package/ccw/frontend/dist/assets/{useSystemSettings-JznNpij7.js.map → useSystemSettings-DZ-8lZsG.js.map} +1 -1
  258. package/ccw/frontend/dist/assets/{wand-sparkles-DqS0VCeN.js → wand-sparkles-83GmAYuw.js} +2 -2
  259. package/ccw/frontend/dist/assets/{wand-sparkles-DqS0VCeN.js.map → wand-sparkles-83GmAYuw.js.map} +1 -1
  260. package/ccw/frontend/dist/index.html +1 -1
  261. package/package.json +1 -1
  262. package/.claude/skills/team-arch-opt/role-specs/analyzer.md +0 -80
  263. package/.claude/skills/team-arch-opt/role-specs/designer.md +0 -118
  264. package/.claude/skills/team-arch-opt/role-specs/refactorer.md +0 -106
  265. package/.claude/skills/team-arch-opt/role-specs/reviewer.md +0 -116
  266. package/.claude/skills/team-arch-opt/role-specs/validator.md +0 -117
  267. package/.claude/skills/team-brainstorm/role-specs/challenger.md +0 -63
  268. package/.claude/skills/team-brainstorm/role-specs/evaluator.md +0 -58
  269. package/.claude/skills/team-brainstorm/role-specs/ideator.md +0 -71
  270. package/.claude/skills/team-brainstorm/role-specs/synthesizer.md +0 -59
  271. package/.claude/skills/team-frontend/role-specs/analyst.md +0 -91
  272. package/.claude/skills/team-frontend/role-specs/architect.md +0 -85
  273. package/.claude/skills/team-frontend/role-specs/developer.md +0 -92
  274. package/.claude/skills/team-frontend/role-specs/qa.md +0 -78
  275. package/.claude/skills/team-issue/role-specs/explorer.md +0 -95
  276. package/.claude/skills/team-issue/role-specs/implementer.md +0 -89
  277. package/.claude/skills/team-issue/role-specs/integrator.md +0 -86
  278. package/.claude/skills/team-issue/role-specs/planner.md +0 -83
  279. package/.claude/skills/team-issue/role-specs/reviewer.md +0 -89
  280. package/.claude/skills/team-iterdev/role-specs/architect.md +0 -64
  281. package/.claude/skills/team-iterdev/role-specs/developer.md +0 -73
  282. package/.claude/skills/team-iterdev/role-specs/reviewer.md +0 -65
  283. package/.claude/skills/team-iterdev/role-specs/tester.md +0 -87
  284. package/.claude/skills/team-perf-opt/role-specs/benchmarker.md +0 -110
  285. package/.claude/skills/team-perf-opt/role-specs/optimizer.md +0 -102
  286. package/.claude/skills/team-perf-opt/role-specs/profiler.md +0 -73
  287. package/.claude/skills/team-perf-opt/role-specs/reviewer.md +0 -91
  288. package/.claude/skills/team-perf-opt/role-specs/strategist.md +0 -114
  289. package/.claude/skills/team-planex/role-specs/executor.md +0 -90
  290. package/.claude/skills/team-planex/role-specs/planner.md +0 -110
  291. package/.claude/skills/team-quality-assurance/role-specs/analyst.md +0 -79
  292. package/.claude/skills/team-quality-assurance/role-specs/executor.md +0 -64
  293. package/.claude/skills/team-quality-assurance/role-specs/generator.md +0 -67
  294. package/.claude/skills/team-quality-assurance/role-specs/scout.md +0 -66
  295. package/.claude/skills/team-quality-assurance/role-specs/strategist.md +0 -70
  296. package/.claude/skills/team-review/role-specs/fixer.md +0 -75
  297. package/.claude/skills/team-review/role-specs/reviewer.md +0 -66
  298. package/.claude/skills/team-review/role-specs/scanner.md +0 -70
  299. package/.claude/skills/team-roadmap-dev/role-specs/executor.md +0 -71
  300. package/.claude/skills/team-roadmap-dev/role-specs/planner.md +0 -77
  301. package/.claude/skills/team-roadmap-dev/role-specs/verifier.md +0 -73
  302. package/.claude/skills/team-tech-debt/role-specs/assessor.md +0 -70
  303. package/.claude/skills/team-tech-debt/role-specs/executor.md +0 -80
  304. package/.claude/skills/team-tech-debt/role-specs/planner.md +0 -71
  305. package/.claude/skills/team-tech-debt/role-specs/scanner.md +0 -85
  306. package/.claude/skills/team-tech-debt/role-specs/validator.md +0 -83
  307. package/.claude/skills/team-testing/role-specs/analyst.md +0 -94
  308. package/.claude/skills/team-testing/role-specs/executor.md +0 -97
  309. package/.claude/skills/team-testing/role-specs/generator.md +0 -96
  310. package/.claude/skills/team-testing/role-specs/strategist.md +0 -82
  311. package/.claude/skills/team-uidesign/role-specs/designer.md +0 -72
  312. package/.claude/skills/team-uidesign/role-specs/implementer.md +0 -74
  313. package/.claude/skills/team-uidesign/role-specs/researcher.md +0 -84
  314. package/.claude/skills/team-uidesign/role-specs/reviewer.md +0 -70
  315. package/.claude/skills/team-ux-improve/role-specs/designer.md +0 -191
  316. package/.claude/skills/team-ux-improve/role-specs/diagnoser.md +0 -110
  317. package/.claude/skills/team-ux-improve/role-specs/explorer.md +0 -109
  318. package/.claude/skills/team-ux-improve/role-specs/implementer.md +0 -164
  319. package/.claude/skills/team-ux-improve/role-specs/scanner.md +0 -117
  320. package/.claude/skills/team-ux-improve/role-specs/tester.md +0 -163
  321. package/ccw/frontend/dist/assets/CodexLensPage-My6DnfN6.js +0 -2
  322. package/ccw/frontend/dist/assets/CodexLensPage-My6DnfN6.js.map +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B6I7GQC5.js","assets/index-D6YeIKg_.css"])))=>i.map(i=>d[i]);
2
- import{O as Z,r as d,ab as vs,u as O,co as Se,j as e,al as ws,cp as ys,cq as he,cr as Oe,cs as ks,ct as J,cu as Cs,cv as Ss,cw as Ts,cx as Ms,aq as Es,ar as Fs,as as ze,c as I,at as Ls,au as Us,C as V,B as _,bq as W,e as b,X as G,cy as Te,ap as Me,cz as Ds,cA as Ps,cB as Ee,aV as qe,cC as Is,I as H,_ as A,R as Y,a7 as ke,cD as Rs,bu as $e,U as Hs,l as As,cE as ge,cF as Os,cG as zs,cH as $s,S as Vs,cI as Bs,cJ as Ve,aw as Fe,cK as _s,aP as qs,an as Ws,cL as Gs,i as Ks,F as Js,N as Xs,aU as Qs,bX as Ys}from"./index-B6I7GQC5.js";import{A as Zs,a as et,b as st,c as tt,d as at,e as nt,f as rt,g as it}from"./AlertDialog-gTMl4gSG.js";import{u as lt,a as ot,b as ct,c as dt,d as mt,e as ut,f as xt,g as ht,h as gt,i as ft,j as pt,k as bt,l as jt}from"./useSystemSettings-JznNpij7.js";import{u as Nt}from"./useLocale-D2iHK44M.js";import{T as vt}from"./test-tube-BYTc5mvQ.js";import{L as wt}from"./link-CL4JmoHb.js";import{S as yt}from"./send-Vet3sN4J.js";import{E as ee}from"./eye-off-CGRUVRDR.js";import{E as se}from"./eye-DUy7aLEx.js";import{S as We}from"./save-BFa03OnG.js";import{u as kt}from"./useDebounce-CmKmoP7n.js";import{C as Ge}from"./cpu-DWCyAOAv.js";import{U as Ct}from"./upload-DzyQj7ib.js";import{P as St}from"./package-CoLVUZGJ.js";import{F as Tt}from"./folder-BKhwCNFG.js";/**
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-dWT2M6Ef.js","assets/index-D6YeIKg_.css"])))=>i.map(i=>d[i]);
2
+ import{O as Z,r as d,ab as vs,u as O,co as Se,j as e,al as ws,cp as ys,cq as he,cr as Oe,cs as ks,ct as J,cu as Cs,cv as Ss,cw as Ts,cx as Ms,aq as Es,ar as Fs,as as ze,c as I,at as Ls,au as Us,C as V,B as _,bq as W,e as b,X as G,cy as Te,ap as Me,cz as Ds,cA as Ps,cB as Ee,aV as qe,cC as Is,I as H,_ as A,R as Y,a7 as ke,cD as Rs,bu as $e,U as Hs,l as As,cE as ge,cF as Os,cG as zs,cH as $s,S as Vs,cI as Bs,cJ as Ve,aw as Fe,cK as _s,aP as qs,an as Ws,cL as Gs,i as Ks,F as Js,N as Xs,aU as Qs,bX as Ys}from"./index-dWT2M6Ef.js";import{A as Zs,a as et,b as st,c as tt,d as at,e as nt,f as rt,g as it}from"./AlertDialog-BW9jiZ-p.js";import{u as lt,a as ot,b as ct,c as dt,d as mt,e as ut,f as xt,g as ht,h as gt,i as ft,j as pt,k as bt,l as jt}from"./useSystemSettings-DZ-8lZsG.js";import{u as Nt}from"./useLocale-sXTrdxcJ.js";import{T as vt}from"./test-tube-C6qCYlDr.js";import{L as wt}from"./link-BZtPgLW0.js";import{S as yt}from"./send-CZk9p0mM.js";import{E as ee}from"./eye-off-D8t3JfWG.js";import{E as se}from"./eye-DGY1rAZs.js";import{S as We}from"./save-DuO6OF0C.js";import{u as kt}from"./useDebounce-bXiFhQx9.js";import{C as Ge}from"./cpu-CCQ4Q0Zh.js";import{U as Ct}from"./upload-C71kd4Qs.js";import{P as St}from"./package-nzWY6ilt.js";import{F as Tt}from"./folder-CV8511y9.js";/**
3
3
  * @license lucide-react v0.460.0 - ISC
4
4
  *
5
5
  * This source code is licensed under the ISC license.
@@ -140,5 +140,5 @@ import{O as Z,r as d,ab as vs,u as O,co as Se,j as e,al as ws,cp as ys,cq as he,
140
140
  border-2 border-border bg-bg text-text\r
141
141
  hover:bg-surface transition-all duration-200\r
142
142
  focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2\r
143
- `,children:s({id:"theme.share.cancel"})})]})]})]}),e.jsx(Zs,{open:le!==null,onOpenChange:Ae,children:e.jsxs(et,{children:[e.jsxs(st,{children:[e.jsx(tt,{children:"Delete Theme Slot?"}),e.jsx(at,{children:"This action cannot be undone. The theme slot will be permanently deleted."})]}),e.jsxs(nt,{children:[e.jsx(rt,{onClick:Ae,children:"Cancel"}),e.jsx(it,{onClick:xs,children:"Delete"})]})]})})]})]})}const Ot=[{value:"en",label:"English",flag:"🇺🇸"},{value:"zh",label:"中文",flag:"🇨🇳"}];function zt({compact:s=!1,className:t}){const{locale:a,setLocale:i}=Nt();return e.jsxs(Es,{value:a,onValueChange:i,children:[e.jsx(Fs,{className:I(s?"w-[110px]":"w-[160px]","gap-2",t),"aria-label":"Select language",children:s?e.jsxs(e.Fragment,{children:[e.jsx(Je,{className:"w-4 h-4"}),e.jsx(ze,{})]}):e.jsx(ze,{})}),e.jsx(Ls,{children:Ot.map(c=>e.jsx(Us,{value:c.value,children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-base",children:c.flag}),e.jsx("span",{children:c.label})]})},c.value))})]})}const Ce={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"]}},$t={"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 Be(){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 Vt({config:s,expandedPlatform:t,testing:a,onToggleExpand:i,onUpdateConfig:c,onTest:o,onSave:u,saving:p}){const{formatMessage:M}=O(),g=["discord","telegram","feishu","dingtalk","wecom","email","webhook"],F=x=>{switch(x){case"discord":return e.jsx(Is,{className:"w-4 h-4"});case"telegram":return e.jsx(yt,{className:"w-4 h-4"});case"feishu":return e.jsx(qe,{className:"w-4 h-4"});case"dingtalk":return e.jsx(Ee,{className:"w-4 h-4"});case"wecom":return e.jsx(Ps,{className:"w-4 h-4"});case"email":return e.jsx(Ds,{className:"w-4 h-4"});case"webhook":return e.jsx(wt,{className:"w-4 h-4"})}},y=x=>{switch(x){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"}}},L=x=>{var w;const j=y(x);switch(x){case"discord":return!!j.webhookUrl;case"telegram":return!!j.botToken&&!!j.chatId;case"feishu":return!!j.webhookUrl;case"dingtalk":return!!j.webhookUrl;case"wecom":return!!j.webhookUrl;case"email":const m=j;return!!(m.host&&m.username&&m.password&&m.from&&((w=m.to)==null?void 0:w.length)>0);case"webhook":return!!j.url}};return e.jsx("div",{className:"grid gap-3",children:g.map(x=>{const j=Ce[x],w=y(x),m=L(x),D=t===x;return e.jsxs(V,{className:"overflow-hidden",children:[e.jsx("div",{className:"p-4 cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>i(D?null:x),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:I("p-2 rounded-lg",w.enabled&&m?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:F(x)}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:j.name}),m&&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"}),M({id:"settings.remoteNotifications.configured"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:j.description})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{variant:w.enabled?"default":"outline",size:"sm",className:"h-7",onClick:k=>{k.stopPropagation(),c(x,{enabled:!w.enabled})},children:w.enabled?e.jsx(W,{className:"w-3.5 h-3.5"}):e.jsx(G,{className:"w-3.5 h-3.5"})}),D?e.jsx(Te,{className:"w-4 h-4 text-muted-foreground"}):e.jsx(Me,{className:"w-4 h-4 text-muted-foreground"})]})]})}),D&&e.jsxs("div",{className:"border-t border-border p-4 space-y-4 bg-muted/30",children:[x==="discord"&&e.jsx(Bt,{config:w,onUpdate:k=>c("discord",k)}),x==="telegram"&&e.jsx(_t,{config:w,onUpdate:k=>c("telegram",k)}),x==="feishu"&&e.jsx(Wt,{config:w,onUpdate:k=>c("feishu",k)}),x==="dingtalk"&&e.jsx(Gt,{config:w,onUpdate:k=>c("dingtalk",k)}),x==="wecom"&&e.jsx(Kt,{config:w,onUpdate:k=>c("wecom",k)}),x==="email"&&e.jsx(Jt,{config:w,onUpdate:k=>c("email",k)}),x==="webhook"&&e.jsx(qt,{config:w,onUpdate:k=>c("webhook",k)}),e.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>o(x,w),disabled:a===x||!m,children:[e.jsx(vt,{className:I("w-3.5 h-3.5 mr-1",a===x&&"animate-pulse")}),M({id:"settings.remoteNotifications.testConnection"})]}),e.jsx(b,{variant:"default",size:"sm",onClick:u,disabled:p,children:M({id:"settings.remoteNotifications.save"})})]})]})]},x)})})}function Bt({config:s,onUpdate:t}){const{formatMessage:a}=O(),[i,c]=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(H,{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(b,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!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(H,{value:s.username||"",onChange:o=>t({username:o.target.value}),placeholder:"CCW Notification",className:"mt-1"})]})]})}function _t({config:s,onUpdate:t}){const{formatMessage:a}=O(),[i,c]=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(H,{type:i?"text":"password",value:s.botToken||"",onChange:o=>t({botToken:o.target.value}),placeholder:"1234567890:ABCdefGHIjklMNOpqrsTUVwxyz",className:"flex-1"}),e.jsx(b,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!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(H,{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}=O();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(H,{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(b,{variant:s.method==="POST"?"default":"outline",size:"sm",onClick:()=>t({method:"POST"}),children:"POST"}),e.jsx(b,{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(H,{value:s.headers?JSON.stringify(s.headers):"",onChange:i=>{try{const c=i.target.value?JSON.parse(i.target.value):void 0;t({headers:c})}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 Wt({config:s,onUpdate:t}){const{formatMessage:a}=O(),[i,c]=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(H,{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(b,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!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(H,{value:s.title||"",onChange:o=>t({title:o.target.value}),placeholder:"CCW Notification",className:"mt-1"})]})]})}function Gt({config:s,onUpdate:t}){var o;const{formatMessage:a}=O(),[i,c]=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(H,{type:i?"text":"password",value:s.webhookUrl||"",onChange:u=>t({webhookUrl:u.target.value}),placeholder:"https://oapi.dingtalk.com/robot/send?access_token=...",className:"flex-1"}),e.jsx(b,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!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(H,{value:((o=s.keywords)==null?void 0:o.join(", "))||"",onChange:u=>t({keywords:u.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 Kt({config:s,onUpdate:t}){var o;const{formatMessage:a}=O(),[i,c]=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(H,{type:i?"text":"password",value:s.webhookUrl||"",onChange:u=>t({webhookUrl:u.target.value}),placeholder:"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=...",className:"flex-1"}),e.jsx(b,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!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(H,{value:((o=s.mentionedList)==null?void 0:o.join(", "))||"",onChange:u=>t({mentionedList:u.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 Jt({config:s,onUpdate:t}){var o;const{formatMessage:a}=O(),[i,c]=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(H,{value:s.host||"",onChange:u=>t({host:u.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(H,{type:"number",value:s.port||587,onChange:u=>t({port:parseInt(u.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:u=>t({secure:u.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(H,{value:s.username||"",onChange:u=>t({username:u.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(H,{type:i?"text":"password",value:s.password||"",onChange:u=>t({password:u.target.value}),placeholder:"********",className:"flex-1"}),e.jsx(b,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!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(H,{value:s.from||"",onChange:u=>t({from:u.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(H,{value:((o=s.to)==null?void 0:o.join(", "))||"",onChange:u=>t({to:u.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 Xt({className:s}){const{formatMessage:t}=O(),[a,i]=d.useState(null),[c,o]=d.useState(!0),[u,p]=d.useState(!1),[M,g]=d.useState(null),[F,y]=d.useState(null),[L,x]=d.useState(null),j=d.useCallback(async()=>{o(!0);try{const f=await fetch("/api/notifications/remote/config");if(f.ok){const N=await f.json();i(N)}else i(Be())}catch(f){console.error("Failed to load remote notification config:",f),i(Be())}finally{o(!1)}},[]);d.useEffect(()=>{j()},[j]);const w=d.useCallback(async f=>{p(!0);try{const N=await fetch("/api/notifications/remote/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)});if(N.ok){const r=await N.json();i(r.config),A.success(t({id:"settings.remoteNotifications.saved"}))}else throw new Error(`HTTP ${N.status}`)}catch{A.error(t({id:"settings.remoteNotifications.saveError"}))}finally{p(!1)}},[t]),m=d.useCallback(async(f,N)=>{g(f);try{const h=await(await fetch("/api/notifications/remote/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({platform:f,config:N})})).json();h.success?A.success(t({id:"settings.remoteNotifications.testSuccess"}),{description:`${h.responseTime}ms`}):A.error(t({id:"settings.remoteNotifications.testFailed"}),{description:h.error})}catch{A.error(t({id:"settings.remoteNotifications.testError"}))}finally{g(null)}},[t]),D=()=>{a&&w({...a,enabled:!a.enabled})},k=(f,N)=>{if(!a)return;const r={...a,platforms:{...a.platforms,[f]:{...a.platforms[f],...N}}};i(r)},S=(f,N)=>{if(!a)return;const r=[...a.events];r[f]={...r[f],...N},i({...a,events:r})},P=(f,N)=>{if(!a)return;const r=a.events[f],h=r.platforms.includes(N)?r.platforms.filter(l=>l!==N):[...r.platforms,N];S(f,{platforms:h})},B=["discord","telegram","feishu","dingtalk","wecom","email","webhook"],R=async()=>{if(confirm(t({id:"settings.remoteNotifications.resetConfirm"})))try{const f=await fetch("/api/notifications/remote/reset",{method:"POST"});if(f.ok){const N=await f.json();i(N.config),A.success(t({id:"settings.remoteNotifications.resetSuccess"}))}}catch{A.error(t({id:"settings.remoteNotifications.resetError"}))}};return c?e.jsx(V,{className:I("p-6",s),children:e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(Y,{className:"w-5 h-5 animate-spin text-muted-foreground"})})}):a?e.jsxs(V,{className:I("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(Ee,{className:"w-5 h-5 text-primary"}):e.jsx(Mt,{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(b,{variant:"outline",size:"sm",onClick:()=>j(),disabled:c,children:e.jsx(Y,{className:I("w-3.5 h-3.5",c&&"animate-spin")})}),e.jsx(b,{variant:a.enabled?"default":"outline",size:"sm",onClick:D,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(Vt,{config:a,expandedPlatform:F,testing:M,onToggleExpand:y,onUpdateConfig:k,onTest:m,onSave:()=>w(a),saving:u})]}),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((f,N)=>{const r=$t[f.event],h=L===N;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:()=>x(h?null:N),children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:I("p-2 rounded-lg",f.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:[f.platforms.slice(0,3).map(l=>e.jsx(_,{variant:"secondary",className:"text-xs",children:Ce[l].name},l)),f.platforms.length>3&&e.jsxs(_,{variant:"secondary",className:"text-xs",children:["+",f.platforms.length-3]}),f.platforms.length===0&&e.jsx(_,{variant:"outline",className:"text-xs text-muted-foreground",children:t({id:"settings.remoteNotifications.noPlatforms"})})]}),e.jsx(b,{variant:f.enabled?"default":"outline",size:"sm",className:"h-7",onClick:l=>{l.stopPropagation(),S(N,{enabled:!f.enabled})},children:f.enabled?e.jsx(W,{className:"w-3.5 h-3.5"}):e.jsx(G,{className:"w-3.5 h-3.5"})}),h?e.jsx(Te,{className:"w-4 h-4 text-muted-foreground"}):e.jsx(Me,{className:"w-4 h-4 text-muted-foreground"})]})]}),h&&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:B.map(l=>{const E=f.platforms.includes(l),z=Ce[l],q=a.platforms[l],$=q==null?void 0:q.enabled;return e.jsxs(b,{variant:E?"default":"outline",size:"sm",className:I("h-8",!$&&!E&&"opacity-50"),onClick:()=>P(N,l),children:[E&&e.jsx(W,{className:"w-3 h-3 mr-1"}),z.name,!$&&!E&&e.jsx(ke,{className:"w-3 h-3 ml-1 opacity-50"})]},l)})})]})]},f.event)})})]}),e.jsxs("div",{className:"flex items-center justify-between mt-6 pt-4 border-t border-border",children:[e.jsx(b,{variant:"outline",size:"sm",onClick:R,children:t({id:"settings.remoteNotifications.reset"})}),e.jsxs(b,{variant:"default",size:"sm",onClick:()=>w(a),disabled:u,children:[e.jsx(We,{className:"w-4 h-4 mr-1"}),t(u?{id:"settings.remoteNotifications.saving"}:{id:"settings.remoteNotifications.save"})]})]})]})]}):null}function Qt({value:s,label:t,description:a,selected:i,onClick:c}){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:c,className:I("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:I("text-sm font-medium",i&&"text-primary"),children:t}),e.jsx("div",{className:"text-xs text-muted-foreground",children:a})]})]})}function Yt({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(c=>e.jsxs(b,{type:"button",variant:s===c?"default":"outline",size:"sm",disabled:a,onClick:()=>t(c),children:[c,"s"]},c))})}function Zt(){const{formatMessage:s}=O(),{preferences:t,updatePreference:a,resetPreferences:i}=Rs(),c=[{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(V,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(qe,{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($e,{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(Et,{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:c.map(o=>e.jsx(Qt,{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(Hs,{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(b,{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(As,{className:"w-4 h-4 text-muted-foreground"}),e.jsx($e,{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(Yt,{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(b,{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(Lt,{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(b,{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(b,{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(b,{variant:"outline",size:"sm",onClick:i,children:s({id:"common.resetToDefaults",defaultMessage:"Reset to Defaults"})})})]})]})}function ea(){const s=document.cookie.match(/XSRF-TOKEN=([^;]+)/);return s?decodeURIComponent(s[1]):null}function _e({value:s,onChange:t,placeholder:a}){const[i,c]=d.useState(!1),[o,u]=d.useState(null),p=kt(s,500);d.useEffect(()=>{if(p){c(!0),u(null);const g=setTimeout(()=>{p.trim().length>0?u(null):u("Path cannot be empty."),c(!1)},1e3);return()=>clearTimeout(g)}else u(null),c(!1)},[p]);const M=async()=>{const{selectFile:g}=await Ys(async()=>{const{selectFile:L}=await import("./index-B6I7GQC5.js").then(x=>x.gc);return{selectFile:L}},__vite__mapDeps([0,1])),F=s?s.replace(/[/\\][^/\\]*$/,""):void 0,y=await g(F);y.path&&!y.cancelled&&!y.error&&t(y.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(H,{value:s,onChange:g=>t(g.target.value),placeholder:a,className:I("flex-1",o&&"border-destructive")}),i&&e.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3",children:e.jsx(Xs,{className:"h-4 w-4 animate-spin text-muted-foreground"})})]}),e.jsx(b,{type:"button",variant:"outline",size:"sm",className:"shrink-0 h-9",onClick:M,title:"Browse",children:e.jsx(Qs,{className:"w-4 h-4"})})]}),o&&e.jsx("p",{className:"text-xs text-destructive mt-1",children:o})]})}const sa=new Set(["gemini","qwen","opencode"]),ta=new Set(["claude"]);function Qe(s){return sa.has(s)?"envFile":ta.has(s)?"settingsFile":"none"}function aa({toolId:s,config:t,isDefault:a,isExpanded:i,toolAvailable:c,isSaving:o,onToggleExpand:u,onToggleEnabled:p,onSetDefault:M,onUpdateModel:g,onUpdateTags:F,onUpdateAvailableModels:y,onUpdateEnvFile:L,onUpdateSettingsFile:x,onUpdateEffort:j,onSaveToBackend:w}){const{formatMessage:m}=O(),[D,k]=d.useState(""),[S,P]=d.useState(""),B=()=>{const l=D.trim();l&&!t.tags.includes(l)&&(F([...t.tags,l]),k(""))},R=l=>{F(t.tags.filter(E=>E!==l))},f=()=>{const l=S.trim(),E=t.availableModels||[];l&&!E.includes(l)&&(y([...E,l]),P(""))},N=l=>{const E=t.availableModels||[];y(E.filter(z=>z!==l))},r=["分析","Debug","implementation","refactoring","testing"],h=Qe(s);return e.jsxs(V,{className:I("overflow-hidden",!t.enabled&&"opacity-60"),children:[e.jsxs("div",{className:"p-4 cursor-pointer hover:bg-muted/50 transition-colors",onClick:u,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:I("p-2 rounded-lg",t.enabled?"bg-primary/10":"bg-muted"),children:e.jsx(Ge,{className:I("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:m({id:"settings.cliTools.default"})}),e.jsx(_,{variant:"outline",className:"text-xs",children:t.type}),c!==void 0&&e.jsx("span",{className:I("inline-block w-2 h-2 rounded-full",c?"bg-green-500":"bg-red-400"),title:c?"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(b,{variant:t.enabled?"default":"outline",size:"sm",className:"h-8",onClick:l=>{l.stopPropagation(),p()},children:t.enabled?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"w-4 h-4 mr-1"}),m({id:"settings.cliTools.enabled"})]}):e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-1"}),m({id:"settings.cliTools.disabled"})]})}),i?e.jsx(Te,{className:"w-5 h-5 text-muted-foreground"}):e.jsx(Me,{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(l=>e.jsx(_,{variant:"secondary",className:"text-xs",children:l},l))})]}),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:m({id:"settings.cliTools.primaryModel"})}),e.jsx(H,{value:t.primaryModel,onChange:l=>g("primaryModel",l.target.value),className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:m({id:"settings.cliTools.secondaryModel"})}),e.jsx(H,{value:t.secondaryModel,onChange:l=>g("secondaryModel",l.target.value),className:"mt-1"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:m({id:"apiSettings.cliSettings.tags"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:m({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(l=>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:[l,e.jsx("button",{type:"button",onClick:()=>R(l),className:"hover:text-destructive transition-colors","aria-label":m({id:"apiSettings.cliSettings.removeTag"}),children:e.jsx(G,{className:"w-3 h-3"})})]},l)),e.jsx("input",{type:"text",value:D,onChange:l=>k(l.target.value),onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),B())},placeholder:t.tags.length===0?m({id:"apiSettings.cliSettings.tagInputPlaceholder"}):"",className:"flex-1 min-w-[120px] bg-transparent border-0 outline-none text-sm placeholder:text-muted-foreground"})]}),e.jsx(b,{type:"button",size:"sm",onClick:B,variant:"outline",className:"shrink-0",children:e.jsx(ke,{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:[m({id:"apiSettings.cliSettings.predefinedTags"}),":"]}),r.map(l=>e.jsx("button",{type:"button",onClick:()=>{t.tags.includes(l)||F([...t.tags,l])},disabled:t.tags.includes(l),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:l},l))]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:m({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(l=>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:[l,e.jsx("button",{type:"button",onClick:()=>N(l),className:"hover:text-destructive transition-colors",children:e.jsx(G,{className:"w-3 h-3"})})]},l)),e.jsx("input",{type:"text",value:S,onChange:l=>P(l.target.value),onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),f())},placeholder:(t.availableModels||[]).length===0?m({id:"apiSettings.cliSettings.availableModelsPlaceholder"}):"",className:"flex-1 min-w-[120px] bg-transparent border-0 outline-none text-sm placeholder:text-muted-foreground"})]}),e.jsx(b,{type:"button",size:"sm",onClick:f,variant:"outline",className:"shrink-0",children:e.jsx(ke,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:m({id:"apiSettings.cliSettings.availableModelsHint"})})]}),h==="envFile"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:m({id:"settings.cliTools.envFile"})}),e.jsx(_e,{value:t.envFile||"",onChange:l=>L(l||void 0),placeholder:m({id:"settings.cliTools.envFilePlaceholder"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:m({id:"settings.cliTools.envFileHint"})})]}),h==="settingsFile"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:m({id:"apiSettings.cliSettings.settingsFile"})}),e.jsx(_e,{value:t.settingsFile||"",onChange:l=>x(l||void 0),placeholder:m({id:"apiSettings.cliSettings.settingsFilePlaceholder"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:m({id:"apiSettings.cliSettings.settingsFileHint"})})]}),h==="settingsFile"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:m({id:"settings.cliTools.effort"})}),e.jsx("div",{className:"flex gap-2",children:["low","medium","high"].map(l=>{const E=t.effort||"high",z=`settings.cliTools.effort${l.charAt(0).toUpperCase()+l.slice(1)}`;return e.jsx("button",{type:"button",onClick:()=>j(l==="high"&&!t.effort?void 0:l),className:I("px-3 py-1.5 rounded-md text-sm border transition-colors",E===l?"bg-primary text-primary-foreground border-primary":"border-border hover:bg-muted"),children:m({id:z})},l)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:m({id:"settings.cliTools.effortHint"})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[!a&&t.enabled&&e.jsx(b,{variant:"outline",size:"sm",onClick:M,children:m({id:"settings.cliTools.setDefault"})}),e.jsxs(b,{variant:"default",size:"sm",onClick:w,disabled:o,children:[e.jsx(We,{className:"w-4 h-4 mr-1"}),m(o?{id:"settings.cliTools.saving"}:{id:"settings.cliTools.saveToConfig"})]})]})]})]})}function na(){const{formatMessage:s}=O(),{data:t,isLoading:a}=lt(),{toggle:i,isPending:c}=ot(),{data:o,isLoading:u}=ct(),{toggle:p,isPending:M}=dt(),{data:g,isLoading:F}=mt(),{toggle:y,isPending:L}=ut(),{refresh:x,isPending:j}=xt(),{exportSettings:w,isPending:m}=ht(),{importSettings:D,isPending:k}=gt(),S=d.useRef(null),P=d.useCallback(async()=>{try{const R=await w(),f=new Blob([JSON.stringify(R,null,2)],{type:"application/json"}),N=URL.createObjectURL(f),r=document.createElement("a"),h=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19);r.href=N,r.download=`ccw-settings-${h}.json`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(N),A.success(s({id:"settings.responseLanguage.exportSuccess"}))}catch{A.error(s({id:"settings.responseLanguage.exportError"}))}},[w,s]),B=d.useCallback(async R=>{var N;const f=(N=R.target.files)==null?void 0:N[0];if(f){if(R.target.value="",!f.name.endsWith(".json")&&f.type!=="application/json"){A.error(s({id:"settings.responseLanguage.importInvalidFile"}));return}try{const r=await f.text(),h=JSON.parse(r);if(!h.version||!h.settings){A.error(s({id:"settings.responseLanguage.importInvalidStructure"}));return}const l=await D(h);l.success?A.success(s({id:"settings.responseLanguage.importSuccess"},{imported:l.imported,skipped:l.skipped})):A.error(s({id:"settings.responseLanguage.importError"}))}catch(r){r instanceof SyntaxError?A.error(s({id:"settings.responseLanguage.importInvalidJson"})):A.error(s({id:"settings.responseLanguage.importError"}))}}},[D,s]);return e.jsxs(V,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Ft,{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(b,{variant:t!=null&&t.claudeEnabled?"default":"outline",size:"sm",className:"h-7",disabled:a||c,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(b,{variant:t!=null&&t.codexEnabled?"default":"outline",size:"sm",className:"h-7",disabled:a||c,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(Fe,{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(_s,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium",children:s({id:"settings.responseLanguage.windowsPlatform"})})]}),e.jsx(b,{variant:o!=null&&o.enabled?"default":"outline",size:"sm",className:"h-7",disabled:u||M,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(qs,{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(b,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",disabled:F||j,onClick:()=>x(),title:s({id:"settings.responseLanguage.refreshConfig"}),children:e.jsx(Y,{className:I("w-3.5 h-3.5",j&&"animate-spin")})}),e.jsx(b,{variant:g!=null&&g.enabled?"default":"outline",size:"sm",className:"h-7",disabled:F||L,onClick:()=>y(!(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:S,type:"file",accept:".json,application/json",onChange:B,className:"hidden"}),e.jsx(b,{variant:"outline",size:"sm",className:"h-7",disabled:k,onClick:()=>{var R;return(R=S.current)==null?void 0:R.click()},children:k?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(Ct,{className:"w-3.5 h-3.5 mr-1"}),s({id:"settings.responseLanguage.import"})]})}),e.jsx(b,{variant:"outline",size:"sm",className:"h-7",disabled:m,onClick:P,children:m?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(Ws,{className:"w-3.5 h-3.5 mr-1"}),s({id:"settings.responseLanguage.export"})]})})]})]})})]})}function ra(){const{formatMessage:s}=O(),[t,a]=d.useState(null),[i,c]=d.useState(!1),[o,u]=d.useState(null),[p,M]=d.useState(null),[g,F]=d.useState(()=>{try{const x=localStorage.getItem("ccw.autoUpdate");return x===null?!0:JSON.parse(x)}catch{return!0}}),y=async(x=!1)=>{x||c(!0),u(null);try{const j=await fetch("/api/version-check");if(!j.ok)throw new Error(`HTTP ${j.status}`);const w=await j.json();if(!w.currentVersion)throw new Error("Invalid response");a(w),M(new Date)}catch(j){x||u(j instanceof Error?j.message:"Unknown error")}finally{c(!1)}};d.useEffect(()=>{if(y(!0),!g)return;const x=setInterval(()=>y(!0),3600*1e3);return()=>clearInterval(x)},[g]);const L=x=>{F(x),localStorage.setItem("ccw.autoUpdate",JSON.stringify(x))};return e.jsxs(V,{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(Ke,{className:"w-5 h-5"}),s({id:"settings.versionCheck.title"})]}),e.jsxs(b,{variant:"outline",size:"sm",disabled:i,onClick:()=>y(),children:[e.jsx(Y,{className:I("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:I("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(Fe,{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(b,{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:x=>L(x.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 ia(){const{formatMessage:s}=O(),{installations:t,isLoading:a,refetch:i}=ft(),{upgrade:c,isPending:o}=pt(),{data:u}=bt();return e.jsxs(V,{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(St,{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(b,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>i(),title:s({id:"settings.systemStatus.refresh"}),children:e.jsx(Y,{className:I("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 M=p.installation_mode==="Global",g=new Date(p.installation_date).toLocaleDateString(),F=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:I("inline-flex items-center justify-center w-8 h-8 rounded-lg",M?"bg-primary/10 text-primary":"bg-orange-500/10 text-orange-500"),children:M?e.jsx(Gs,{className:"w-4 h-4"}):e.jsx(Tt,{className:"w-4 h-4"})}),e.jsx("span",{className:"text-sm font-medium",children:s(M?{id:"settings.systemStatus.global"}:{id:"settings.systemStatus.path"})}),e.jsxs(_,{variant:"secondary",className:"text-xs font-mono",children:["v",F]})]}),e.jsxs(b,{variant:"ghost",size:"sm",className:"h-7",disabled:o,onClick:()=>c(p.installation_path),children:[e.jsx(Ke,{className:I("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(Ks,{className:"w-3 h-3"}),g]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Js,{className:"w-3 h-3"}),p.files_count," ",s({id:"settings.systemStatus.files"})]})]})]},p.manifest_id)}),u&&!u.installed&&u.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(Fe,{className:"w-4 h-4"}),s({id:"settings.systemStatus.incomplete"})," — ",u.missingFiles.length," ",s({id:"settings.systemStatus.missingFiles"}).toLowerCase()]}),e.jsxs("ul",{className:"text-xs text-muted-foreground list-disc list-inside",children:[u.missingFiles.slice(0,4).map(p=>e.jsx("li",{children:p},p)),u.missingFiles.length>4&&e.jsxs("li",{children:["+",u.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 la({cliTools:s,defaultCliTool:t,expandedTools:a,savingTools:i,onToggleExpand:c,onToggleEnabled:o,onSetDefault:u,onUpdateModel:p,onUpdateTags:M,onUpdateAvailableModels:g,onUpdateEnvFile:F,onUpdateSettingsFile:y,onUpdateEffort:L,onSaveToBackend:x,formatMessage:j}){const{data:w}=jt();return e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-muted-foreground mb-4",children:[j({id:"settings.cliTools.description"})," ",e.jsx("strong",{className:"text-foreground",children:t})]}),e.jsx("div",{className:"space-y-3",children:Object.entries(s).map(([m,D])=>{const k=w==null?void 0:w[m];return e.jsx(aa,{toolId:m,config:D,isDefault:m===t,isExpanded:a.has(m),toolAvailable:k==null?void 0:k.available,isSaving:i.has(m),onToggleExpand:()=>c(m),onToggleEnabled:()=>o(m),onSetDefault:()=>u(m),onUpdateModel:(S,P)=>p(m,S,P),onUpdateTags:S=>M(m,S),onUpdateAvailableModels:S=>g(m,S),onUpdateEnvFile:S=>F(m,S),onUpdateSettingsFile:S=>y(m,S),onUpdateEffort:S=>L(m,S),onSaveToBackend:()=>x(m)},m)})})]})}function ya(){const{formatMessage:s}=O(),{theme:t,setTheme:a}=Se(),i=ge(Os),c=ge(zs),o=ge($s),{updateCliTool:u,setDefaultCliTool:p,setUserPreferences:M,resetUserPreferences:g}=ge(),[F,y]=d.useState(new Set),[L,x]=d.useState(new Set),j=r=>{y(h=>{const l=new Set(h);return l.has(r)?l.delete(r):l.add(r),l})},w=r=>{u(r,{enabled:!i[r].enabled})},m=r=>{p(r)},D=(r,h,l)=>{u(r,{[h]:l})},k=(r,h)=>{u(r,{tags:h})},S=(r,h)=>{u(r,{availableModels:h})},P=(r,h)=>{u(r,{envFile:h})},B=(r,h)=>{u(r,{settingsFile:h})},R=(r,h)=>{u(r,{effort:h})},f=d.useCallback(async r=>{const h=i[r];if(h){x(l=>new Set(l).add(r));try{const l={enabled:h.enabled,primaryModel:h.primaryModel,secondaryModel:h.secondaryModel,tags:h.tags,availableModels:h.availableModels},E=Qe(r);E==="envFile"?l.envFile=h.envFile||null:E==="settingsFile"&&(l.settingsFile=h.settingsFile||null,l.effort=h.effort||null);const z=ea(),q={"Content-Type":"application/json"};z&&(q["X-CSRF-Token"]=z);const $=await fetch(`/api/cli/config/${r}`,{method:"PUT",headers:q,body:JSON.stringify(l),credentials:"same-origin"});if(!$.ok)throw new Error(`HTTP ${$.status}`);A.success(s({id:"settings.cliTools.configSaved"}),{description:r})}catch{A.error(s({id:"settings.cliTools.configSaveError"}),{description:r})}finally{x(l=>{const E=new Set(l);return E.delete(r),E})}}},[i,s]),N=(r,h)=>{M({[r]:h})};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(Vs,{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(V,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Bs,{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(At,{})]}),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(b,{variant:t==="system"?"default":"outline",size:"sm",onClick:()=>a("system"),children:s({id:"settings.appearance.themeOptions.system"})})]})]})]}),e.jsxs(V,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Je,{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(zt,{})]})})]}),e.jsx(na,{}),e.jsx(Zt,{}),e.jsx(ia,{}),e.jsx(ra,{}),e.jsxs(V,{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.cliTools"})]}),e.jsx(la,{cliTools:i,defaultCliTool:c,expandedTools:F,savingTools:L,onToggleExpand:j,onToggleEnabled:w,onSetDefault:m,onUpdateModel:D,onUpdateTags:k,onUpdateAvailableModels:S,onUpdateEnvFile:P,onUpdateSettingsFile:B,onUpdateEffort:R,onSaveToBackend:f,formatMessage:s})]}),e.jsxs(V,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Y,{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(b,{variant:o.autoRefresh?"default":"outline",size:"sm",onClick:()=>N("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(b,{variant:o.refreshInterval===r?"default":"outline",size:"sm",onClick:()=>N("refreshInterval",r),children:[r/1e3,"s"]},r))})]})]})]}),e.jsxs(V,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Ee,{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(b,{variant:o.notificationsEnabled?"default":"outline",size:"sm",onClick:()=>N("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(b,{variant:o.soundEnabled?"default":"outline",size:"sm",onClick:()=>N("soundEnabled",!o.soundEnabled),children:o.soundEnabled?s({id:"settings.notifications.on"}):s({id:"settings.notifications.off"})})]})]})]}),e.jsx(Xt,{}),e.jsxs(V,{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(b,{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{ya as SettingsPage,ya as default};
144
- //# sourceMappingURL=SettingsPage-Rik9cUIj.js.map
143
+ `,children:s({id:"theme.share.cancel"})})]})]})]}),e.jsx(Zs,{open:le!==null,onOpenChange:Ae,children:e.jsxs(et,{children:[e.jsxs(st,{children:[e.jsx(tt,{children:"Delete Theme Slot?"}),e.jsx(at,{children:"This action cannot be undone. The theme slot will be permanently deleted."})]}),e.jsxs(nt,{children:[e.jsx(rt,{onClick:Ae,children:"Cancel"}),e.jsx(it,{onClick:xs,children:"Delete"})]})]})})]})]})}const Ot=[{value:"en",label:"English",flag:"🇺🇸"},{value:"zh",label:"中文",flag:"🇨🇳"}];function zt({compact:s=!1,className:t}){const{locale:a,setLocale:i}=Nt();return e.jsxs(Es,{value:a,onValueChange:i,children:[e.jsx(Fs,{className:I(s?"w-[110px]":"w-[160px]","gap-2",t),"aria-label":"Select language",children:s?e.jsxs(e.Fragment,{children:[e.jsx(Je,{className:"w-4 h-4"}),e.jsx(ze,{})]}):e.jsx(ze,{})}),e.jsx(Ls,{children:Ot.map(c=>e.jsx(Us,{value:c.value,children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-base",children:c.flag}),e.jsx("span",{children:c.label})]})},c.value))})]})}const Ce={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"]}},$t={"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 Be(){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 Vt({config:s,expandedPlatform:t,testing:a,onToggleExpand:i,onUpdateConfig:c,onTest:o,onSave:u,saving:p}){const{formatMessage:M}=O(),g=["discord","telegram","feishu","dingtalk","wecom","email","webhook"],F=x=>{switch(x){case"discord":return e.jsx(Is,{className:"w-4 h-4"});case"telegram":return e.jsx(yt,{className:"w-4 h-4"});case"feishu":return e.jsx(qe,{className:"w-4 h-4"});case"dingtalk":return e.jsx(Ee,{className:"w-4 h-4"});case"wecom":return e.jsx(Ps,{className:"w-4 h-4"});case"email":return e.jsx(Ds,{className:"w-4 h-4"});case"webhook":return e.jsx(wt,{className:"w-4 h-4"})}},y=x=>{switch(x){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"}}},L=x=>{var w;const j=y(x);switch(x){case"discord":return!!j.webhookUrl;case"telegram":return!!j.botToken&&!!j.chatId;case"feishu":return!!j.webhookUrl;case"dingtalk":return!!j.webhookUrl;case"wecom":return!!j.webhookUrl;case"email":const m=j;return!!(m.host&&m.username&&m.password&&m.from&&((w=m.to)==null?void 0:w.length)>0);case"webhook":return!!j.url}};return e.jsx("div",{className:"grid gap-3",children:g.map(x=>{const j=Ce[x],w=y(x),m=L(x),D=t===x;return e.jsxs(V,{className:"overflow-hidden",children:[e.jsx("div",{className:"p-4 cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>i(D?null:x),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:I("p-2 rounded-lg",w.enabled&&m?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:F(x)}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:j.name}),m&&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"}),M({id:"settings.remoteNotifications.configured"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:j.description})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{variant:w.enabled?"default":"outline",size:"sm",className:"h-7",onClick:k=>{k.stopPropagation(),c(x,{enabled:!w.enabled})},children:w.enabled?e.jsx(W,{className:"w-3.5 h-3.5"}):e.jsx(G,{className:"w-3.5 h-3.5"})}),D?e.jsx(Te,{className:"w-4 h-4 text-muted-foreground"}):e.jsx(Me,{className:"w-4 h-4 text-muted-foreground"})]})]})}),D&&e.jsxs("div",{className:"border-t border-border p-4 space-y-4 bg-muted/30",children:[x==="discord"&&e.jsx(Bt,{config:w,onUpdate:k=>c("discord",k)}),x==="telegram"&&e.jsx(_t,{config:w,onUpdate:k=>c("telegram",k)}),x==="feishu"&&e.jsx(Wt,{config:w,onUpdate:k=>c("feishu",k)}),x==="dingtalk"&&e.jsx(Gt,{config:w,onUpdate:k=>c("dingtalk",k)}),x==="wecom"&&e.jsx(Kt,{config:w,onUpdate:k=>c("wecom",k)}),x==="email"&&e.jsx(Jt,{config:w,onUpdate:k=>c("email",k)}),x==="webhook"&&e.jsx(qt,{config:w,onUpdate:k=>c("webhook",k)}),e.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[e.jsxs(b,{variant:"outline",size:"sm",onClick:()=>o(x,w),disabled:a===x||!m,children:[e.jsx(vt,{className:I("w-3.5 h-3.5 mr-1",a===x&&"animate-pulse")}),M({id:"settings.remoteNotifications.testConnection"})]}),e.jsx(b,{variant:"default",size:"sm",onClick:u,disabled:p,children:M({id:"settings.remoteNotifications.save"})})]})]})]},x)})})}function Bt({config:s,onUpdate:t}){const{formatMessage:a}=O(),[i,c]=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(H,{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(b,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!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(H,{value:s.username||"",onChange:o=>t({username:o.target.value}),placeholder:"CCW Notification",className:"mt-1"})]})]})}function _t({config:s,onUpdate:t}){const{formatMessage:a}=O(),[i,c]=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(H,{type:i?"text":"password",value:s.botToken||"",onChange:o=>t({botToken:o.target.value}),placeholder:"1234567890:ABCdefGHIjklMNOpqrsTUVwxyz",className:"flex-1"}),e.jsx(b,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!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(H,{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}=O();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(H,{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(b,{variant:s.method==="POST"?"default":"outline",size:"sm",onClick:()=>t({method:"POST"}),children:"POST"}),e.jsx(b,{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(H,{value:s.headers?JSON.stringify(s.headers):"",onChange:i=>{try{const c=i.target.value?JSON.parse(i.target.value):void 0;t({headers:c})}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 Wt({config:s,onUpdate:t}){const{formatMessage:a}=O(),[i,c]=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(H,{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(b,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!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(H,{value:s.title||"",onChange:o=>t({title:o.target.value}),placeholder:"CCW Notification",className:"mt-1"})]})]})}function Gt({config:s,onUpdate:t}){var o;const{formatMessage:a}=O(),[i,c]=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(H,{type:i?"text":"password",value:s.webhookUrl||"",onChange:u=>t({webhookUrl:u.target.value}),placeholder:"https://oapi.dingtalk.com/robot/send?access_token=...",className:"flex-1"}),e.jsx(b,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!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(H,{value:((o=s.keywords)==null?void 0:o.join(", "))||"",onChange:u=>t({keywords:u.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 Kt({config:s,onUpdate:t}){var o;const{formatMessage:a}=O(),[i,c]=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(H,{type:i?"text":"password",value:s.webhookUrl||"",onChange:u=>t({webhookUrl:u.target.value}),placeholder:"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=...",className:"flex-1"}),e.jsx(b,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!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(H,{value:((o=s.mentionedList)==null?void 0:o.join(", "))||"",onChange:u=>t({mentionedList:u.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 Jt({config:s,onUpdate:t}){var o;const{formatMessage:a}=O(),[i,c]=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(H,{value:s.host||"",onChange:u=>t({host:u.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(H,{type:"number",value:s.port||587,onChange:u=>t({port:parseInt(u.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:u=>t({secure:u.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(H,{value:s.username||"",onChange:u=>t({username:u.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(H,{type:i?"text":"password",value:s.password||"",onChange:u=>t({password:u.target.value}),placeholder:"********",className:"flex-1"}),e.jsx(b,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>c(!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(H,{value:s.from||"",onChange:u=>t({from:u.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(H,{value:((o=s.to)==null?void 0:o.join(", "))||"",onChange:u=>t({to:u.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 Xt({className:s}){const{formatMessage:t}=O(),[a,i]=d.useState(null),[c,o]=d.useState(!0),[u,p]=d.useState(!1),[M,g]=d.useState(null),[F,y]=d.useState(null),[L,x]=d.useState(null),j=d.useCallback(async()=>{o(!0);try{const f=await fetch("/api/notifications/remote/config");if(f.ok){const N=await f.json();i(N)}else i(Be())}catch(f){console.error("Failed to load remote notification config:",f),i(Be())}finally{o(!1)}},[]);d.useEffect(()=>{j()},[j]);const w=d.useCallback(async f=>{p(!0);try{const N=await fetch("/api/notifications/remote/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)});if(N.ok){const r=await N.json();i(r.config),A.success(t({id:"settings.remoteNotifications.saved"}))}else throw new Error(`HTTP ${N.status}`)}catch{A.error(t({id:"settings.remoteNotifications.saveError"}))}finally{p(!1)}},[t]),m=d.useCallback(async(f,N)=>{g(f);try{const h=await(await fetch("/api/notifications/remote/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({platform:f,config:N})})).json();h.success?A.success(t({id:"settings.remoteNotifications.testSuccess"}),{description:`${h.responseTime}ms`}):A.error(t({id:"settings.remoteNotifications.testFailed"}),{description:h.error})}catch{A.error(t({id:"settings.remoteNotifications.testError"}))}finally{g(null)}},[t]),D=()=>{a&&w({...a,enabled:!a.enabled})},k=(f,N)=>{if(!a)return;const r={...a,platforms:{...a.platforms,[f]:{...a.platforms[f],...N}}};i(r)},S=(f,N)=>{if(!a)return;const r=[...a.events];r[f]={...r[f],...N},i({...a,events:r})},P=(f,N)=>{if(!a)return;const r=a.events[f],h=r.platforms.includes(N)?r.platforms.filter(l=>l!==N):[...r.platforms,N];S(f,{platforms:h})},B=["discord","telegram","feishu","dingtalk","wecom","email","webhook"],R=async()=>{if(confirm(t({id:"settings.remoteNotifications.resetConfirm"})))try{const f=await fetch("/api/notifications/remote/reset",{method:"POST"});if(f.ok){const N=await f.json();i(N.config),A.success(t({id:"settings.remoteNotifications.resetSuccess"}))}}catch{A.error(t({id:"settings.remoteNotifications.resetError"}))}};return c?e.jsx(V,{className:I("p-6",s),children:e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(Y,{className:"w-5 h-5 animate-spin text-muted-foreground"})})}):a?e.jsxs(V,{className:I("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(Ee,{className:"w-5 h-5 text-primary"}):e.jsx(Mt,{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(b,{variant:"outline",size:"sm",onClick:()=>j(),disabled:c,children:e.jsx(Y,{className:I("w-3.5 h-3.5",c&&"animate-spin")})}),e.jsx(b,{variant:a.enabled?"default":"outline",size:"sm",onClick:D,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(Vt,{config:a,expandedPlatform:F,testing:M,onToggleExpand:y,onUpdateConfig:k,onTest:m,onSave:()=>w(a),saving:u})]}),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((f,N)=>{const r=$t[f.event],h=L===N;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:()=>x(h?null:N),children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:I("p-2 rounded-lg",f.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:[f.platforms.slice(0,3).map(l=>e.jsx(_,{variant:"secondary",className:"text-xs",children:Ce[l].name},l)),f.platforms.length>3&&e.jsxs(_,{variant:"secondary",className:"text-xs",children:["+",f.platforms.length-3]}),f.platforms.length===0&&e.jsx(_,{variant:"outline",className:"text-xs text-muted-foreground",children:t({id:"settings.remoteNotifications.noPlatforms"})})]}),e.jsx(b,{variant:f.enabled?"default":"outline",size:"sm",className:"h-7",onClick:l=>{l.stopPropagation(),S(N,{enabled:!f.enabled})},children:f.enabled?e.jsx(W,{className:"w-3.5 h-3.5"}):e.jsx(G,{className:"w-3.5 h-3.5"})}),h?e.jsx(Te,{className:"w-4 h-4 text-muted-foreground"}):e.jsx(Me,{className:"w-4 h-4 text-muted-foreground"})]})]}),h&&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:B.map(l=>{const E=f.platforms.includes(l),z=Ce[l],q=a.platforms[l],$=q==null?void 0:q.enabled;return e.jsxs(b,{variant:E?"default":"outline",size:"sm",className:I("h-8",!$&&!E&&"opacity-50"),onClick:()=>P(N,l),children:[E&&e.jsx(W,{className:"w-3 h-3 mr-1"}),z.name,!$&&!E&&e.jsx(ke,{className:"w-3 h-3 ml-1 opacity-50"})]},l)})})]})]},f.event)})})]}),e.jsxs("div",{className:"flex items-center justify-between mt-6 pt-4 border-t border-border",children:[e.jsx(b,{variant:"outline",size:"sm",onClick:R,children:t({id:"settings.remoteNotifications.reset"})}),e.jsxs(b,{variant:"default",size:"sm",onClick:()=>w(a),disabled:u,children:[e.jsx(We,{className:"w-4 h-4 mr-1"}),t(u?{id:"settings.remoteNotifications.saving"}:{id:"settings.remoteNotifications.save"})]})]})]})]}):null}function Qt({value:s,label:t,description:a,selected:i,onClick:c}){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:c,className:I("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:I("text-sm font-medium",i&&"text-primary"),children:t}),e.jsx("div",{className:"text-xs text-muted-foreground",children:a})]})]})}function Yt({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(c=>e.jsxs(b,{type:"button",variant:s===c?"default":"outline",size:"sm",disabled:a,onClick:()=>t(c),children:[c,"s"]},c))})}function Zt(){const{formatMessage:s}=O(),{preferences:t,updatePreference:a,resetPreferences:i}=Rs(),c=[{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(V,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(qe,{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($e,{className:"text-sm font-medium flex items-center gap-2",children:[e.jsx(Et,{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:c.map(o=>e.jsx(Qt,{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(Hs,{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(b,{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(As,{className:"w-4 h-4 text-muted-foreground"}),e.jsx($e,{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(Yt,{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(b,{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(Lt,{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(b,{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(b,{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(b,{variant:"outline",size:"sm",onClick:i,children:s({id:"common.resetToDefaults",defaultMessage:"Reset to Defaults"})})})]})]})}function ea(){const s=document.cookie.match(/XSRF-TOKEN=([^;]+)/);return s?decodeURIComponent(s[1]):null}function _e({value:s,onChange:t,placeholder:a}){const[i,c]=d.useState(!1),[o,u]=d.useState(null),p=kt(s,500);d.useEffect(()=>{if(p){c(!0),u(null);const g=setTimeout(()=>{p.trim().length>0?u(null):u("Path cannot be empty."),c(!1)},1e3);return()=>clearTimeout(g)}else u(null),c(!1)},[p]);const M=async()=>{const{selectFile:g}=await Ys(async()=>{const{selectFile:L}=await import("./index-dWT2M6Ef.js").then(x=>x.gc);return{selectFile:L}},__vite__mapDeps([0,1])),F=s?s.replace(/[/\\][^/\\]*$/,""):void 0,y=await g(F);y.path&&!y.cancelled&&!y.error&&t(y.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(H,{value:s,onChange:g=>t(g.target.value),placeholder:a,className:I("flex-1",o&&"border-destructive")}),i&&e.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3",children:e.jsx(Xs,{className:"h-4 w-4 animate-spin text-muted-foreground"})})]}),e.jsx(b,{type:"button",variant:"outline",size:"sm",className:"shrink-0 h-9",onClick:M,title:"Browse",children:e.jsx(Qs,{className:"w-4 h-4"})})]}),o&&e.jsx("p",{className:"text-xs text-destructive mt-1",children:o})]})}const sa=new Set(["gemini","qwen","opencode"]),ta=new Set(["claude"]);function Qe(s){return sa.has(s)?"envFile":ta.has(s)?"settingsFile":"none"}function aa({toolId:s,config:t,isDefault:a,isExpanded:i,toolAvailable:c,isSaving:o,onToggleExpand:u,onToggleEnabled:p,onSetDefault:M,onUpdateModel:g,onUpdateTags:F,onUpdateAvailableModels:y,onUpdateEnvFile:L,onUpdateSettingsFile:x,onUpdateEffort:j,onSaveToBackend:w}){const{formatMessage:m}=O(),[D,k]=d.useState(""),[S,P]=d.useState(""),B=()=>{const l=D.trim();l&&!t.tags.includes(l)&&(F([...t.tags,l]),k(""))},R=l=>{F(t.tags.filter(E=>E!==l))},f=()=>{const l=S.trim(),E=t.availableModels||[];l&&!E.includes(l)&&(y([...E,l]),P(""))},N=l=>{const E=t.availableModels||[];y(E.filter(z=>z!==l))},r=["分析","Debug","implementation","refactoring","testing"],h=Qe(s);return e.jsxs(V,{className:I("overflow-hidden",!t.enabled&&"opacity-60"),children:[e.jsxs("div",{className:"p-4 cursor-pointer hover:bg-muted/50 transition-colors",onClick:u,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:I("p-2 rounded-lg",t.enabled?"bg-primary/10":"bg-muted"),children:e.jsx(Ge,{className:I("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:m({id:"settings.cliTools.default"})}),e.jsx(_,{variant:"outline",className:"text-xs",children:t.type}),c!==void 0&&e.jsx("span",{className:I("inline-block w-2 h-2 rounded-full",c?"bg-green-500":"bg-red-400"),title:c?"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(b,{variant:t.enabled?"default":"outline",size:"sm",className:"h-8",onClick:l=>{l.stopPropagation(),p()},children:t.enabled?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"w-4 h-4 mr-1"}),m({id:"settings.cliTools.enabled"})]}):e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"w-4 h-4 mr-1"}),m({id:"settings.cliTools.disabled"})]})}),i?e.jsx(Te,{className:"w-5 h-5 text-muted-foreground"}):e.jsx(Me,{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(l=>e.jsx(_,{variant:"secondary",className:"text-xs",children:l},l))})]}),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:m({id:"settings.cliTools.primaryModel"})}),e.jsx(H,{value:t.primaryModel,onChange:l=>g("primaryModel",l.target.value),className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:m({id:"settings.cliTools.secondaryModel"})}),e.jsx(H,{value:t.secondaryModel,onChange:l=>g("secondaryModel",l.target.value),className:"mt-1"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:m({id:"apiSettings.cliSettings.tags"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:m({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(l=>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:[l,e.jsx("button",{type:"button",onClick:()=>R(l),className:"hover:text-destructive transition-colors","aria-label":m({id:"apiSettings.cliSettings.removeTag"}),children:e.jsx(G,{className:"w-3 h-3"})})]},l)),e.jsx("input",{type:"text",value:D,onChange:l=>k(l.target.value),onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),B())},placeholder:t.tags.length===0?m({id:"apiSettings.cliSettings.tagInputPlaceholder"}):"",className:"flex-1 min-w-[120px] bg-transparent border-0 outline-none text-sm placeholder:text-muted-foreground"})]}),e.jsx(b,{type:"button",size:"sm",onClick:B,variant:"outline",className:"shrink-0",children:e.jsx(ke,{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:[m({id:"apiSettings.cliSettings.predefinedTags"}),":"]}),r.map(l=>e.jsx("button",{type:"button",onClick:()=>{t.tags.includes(l)||F([...t.tags,l])},disabled:t.tags.includes(l),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:l},l))]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:m({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(l=>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:[l,e.jsx("button",{type:"button",onClick:()=>N(l),className:"hover:text-destructive transition-colors",children:e.jsx(G,{className:"w-3 h-3"})})]},l)),e.jsx("input",{type:"text",value:S,onChange:l=>P(l.target.value),onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),f())},placeholder:(t.availableModels||[]).length===0?m({id:"apiSettings.cliSettings.availableModelsPlaceholder"}):"",className:"flex-1 min-w-[120px] bg-transparent border-0 outline-none text-sm placeholder:text-muted-foreground"})]}),e.jsx(b,{type:"button",size:"sm",onClick:f,variant:"outline",className:"shrink-0",children:e.jsx(ke,{className:"w-4 h-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:m({id:"apiSettings.cliSettings.availableModelsHint"})})]}),h==="envFile"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:m({id:"settings.cliTools.envFile"})}),e.jsx(_e,{value:t.envFile||"",onChange:l=>L(l||void 0),placeholder:m({id:"settings.cliTools.envFilePlaceholder"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:m({id:"settings.cliTools.envFileHint"})})]}),h==="settingsFile"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:m({id:"apiSettings.cliSettings.settingsFile"})}),e.jsx(_e,{value:t.settingsFile||"",onChange:l=>x(l||void 0),placeholder:m({id:"apiSettings.cliSettings.settingsFilePlaceholder"})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:m({id:"apiSettings.cliSettings.settingsFileHint"})})]}),h==="settingsFile"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-foreground",children:m({id:"settings.cliTools.effort"})}),e.jsx("div",{className:"flex gap-2",children:["low","medium","high"].map(l=>{const E=t.effort||"high",z=`settings.cliTools.effort${l.charAt(0).toUpperCase()+l.slice(1)}`;return e.jsx("button",{type:"button",onClick:()=>j(l==="high"&&!t.effort?void 0:l),className:I("px-3 py-1.5 rounded-md text-sm border transition-colors",E===l?"bg-primary text-primary-foreground border-primary":"border-border hover:bg-muted"),children:m({id:z})},l)})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:m({id:"settings.cliTools.effortHint"})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[!a&&t.enabled&&e.jsx(b,{variant:"outline",size:"sm",onClick:M,children:m({id:"settings.cliTools.setDefault"})}),e.jsxs(b,{variant:"default",size:"sm",onClick:w,disabled:o,children:[e.jsx(We,{className:"w-4 h-4 mr-1"}),m(o?{id:"settings.cliTools.saving"}:{id:"settings.cliTools.saveToConfig"})]})]})]})]})}function na(){const{formatMessage:s}=O(),{data:t,isLoading:a}=lt(),{toggle:i,isPending:c}=ot(),{data:o,isLoading:u}=ct(),{toggle:p,isPending:M}=dt(),{data:g,isLoading:F}=mt(),{toggle:y,isPending:L}=ut(),{refresh:x,isPending:j}=xt(),{exportSettings:w,isPending:m}=ht(),{importSettings:D,isPending:k}=gt(),S=d.useRef(null),P=d.useCallback(async()=>{try{const R=await w(),f=new Blob([JSON.stringify(R,null,2)],{type:"application/json"}),N=URL.createObjectURL(f),r=document.createElement("a"),h=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19);r.href=N,r.download=`ccw-settings-${h}.json`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(N),A.success(s({id:"settings.responseLanguage.exportSuccess"}))}catch{A.error(s({id:"settings.responseLanguage.exportError"}))}},[w,s]),B=d.useCallback(async R=>{var N;const f=(N=R.target.files)==null?void 0:N[0];if(f){if(R.target.value="",!f.name.endsWith(".json")&&f.type!=="application/json"){A.error(s({id:"settings.responseLanguage.importInvalidFile"}));return}try{const r=await f.text(),h=JSON.parse(r);if(!h.version||!h.settings){A.error(s({id:"settings.responseLanguage.importInvalidStructure"}));return}const l=await D(h);l.success?A.success(s({id:"settings.responseLanguage.importSuccess"},{imported:l.imported,skipped:l.skipped})):A.error(s({id:"settings.responseLanguage.importError"}))}catch(r){r instanceof SyntaxError?A.error(s({id:"settings.responseLanguage.importInvalidJson"})):A.error(s({id:"settings.responseLanguage.importError"}))}}},[D,s]);return e.jsxs(V,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Ft,{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(b,{variant:t!=null&&t.claudeEnabled?"default":"outline",size:"sm",className:"h-7",disabled:a||c,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(b,{variant:t!=null&&t.codexEnabled?"default":"outline",size:"sm",className:"h-7",disabled:a||c,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(Fe,{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(_s,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium",children:s({id:"settings.responseLanguage.windowsPlatform"})})]}),e.jsx(b,{variant:o!=null&&o.enabled?"default":"outline",size:"sm",className:"h-7",disabled:u||M,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(qs,{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(b,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",disabled:F||j,onClick:()=>x(),title:s({id:"settings.responseLanguage.refreshConfig"}),children:e.jsx(Y,{className:I("w-3.5 h-3.5",j&&"animate-spin")})}),e.jsx(b,{variant:g!=null&&g.enabled?"default":"outline",size:"sm",className:"h-7",disabled:F||L,onClick:()=>y(!(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:S,type:"file",accept:".json,application/json",onChange:B,className:"hidden"}),e.jsx(b,{variant:"outline",size:"sm",className:"h-7",disabled:k,onClick:()=>{var R;return(R=S.current)==null?void 0:R.click()},children:k?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(Ct,{className:"w-3.5 h-3.5 mr-1"}),s({id:"settings.responseLanguage.import"})]})}),e.jsx(b,{variant:"outline",size:"sm",className:"h-7",disabled:m,onClick:P,children:m?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(Ws,{className:"w-3.5 h-3.5 mr-1"}),s({id:"settings.responseLanguage.export"})]})})]})]})})]})}function ra(){const{formatMessage:s}=O(),[t,a]=d.useState(null),[i,c]=d.useState(!1),[o,u]=d.useState(null),[p,M]=d.useState(null),[g,F]=d.useState(()=>{try{const x=localStorage.getItem("ccw.autoUpdate");return x===null?!0:JSON.parse(x)}catch{return!0}}),y=async(x=!1)=>{x||c(!0),u(null);try{const j=await fetch("/api/version-check");if(!j.ok)throw new Error(`HTTP ${j.status}`);const w=await j.json();if(!w.currentVersion)throw new Error("Invalid response");a(w),M(new Date)}catch(j){x||u(j instanceof Error?j.message:"Unknown error")}finally{c(!1)}};d.useEffect(()=>{if(y(!0),!g)return;const x=setInterval(()=>y(!0),3600*1e3);return()=>clearInterval(x)},[g]);const L=x=>{F(x),localStorage.setItem("ccw.autoUpdate",JSON.stringify(x))};return e.jsxs(V,{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(Ke,{className:"w-5 h-5"}),s({id:"settings.versionCheck.title"})]}),e.jsxs(b,{variant:"outline",size:"sm",disabled:i,onClick:()=>y(),children:[e.jsx(Y,{className:I("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:I("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(Fe,{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(b,{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:x=>L(x.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 ia(){const{formatMessage:s}=O(),{installations:t,isLoading:a,refetch:i}=ft(),{upgrade:c,isPending:o}=pt(),{data:u}=bt();return e.jsxs(V,{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(St,{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(b,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:()=>i(),title:s({id:"settings.systemStatus.refresh"}),children:e.jsx(Y,{className:I("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 M=p.installation_mode==="Global",g=new Date(p.installation_date).toLocaleDateString(),F=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:I("inline-flex items-center justify-center w-8 h-8 rounded-lg",M?"bg-primary/10 text-primary":"bg-orange-500/10 text-orange-500"),children:M?e.jsx(Gs,{className:"w-4 h-4"}):e.jsx(Tt,{className:"w-4 h-4"})}),e.jsx("span",{className:"text-sm font-medium",children:s(M?{id:"settings.systemStatus.global"}:{id:"settings.systemStatus.path"})}),e.jsxs(_,{variant:"secondary",className:"text-xs font-mono",children:["v",F]})]}),e.jsxs(b,{variant:"ghost",size:"sm",className:"h-7",disabled:o,onClick:()=>c(p.installation_path),children:[e.jsx(Ke,{className:I("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(Ks,{className:"w-3 h-3"}),g]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(Js,{className:"w-3 h-3"}),p.files_count," ",s({id:"settings.systemStatus.files"})]})]})]},p.manifest_id)}),u&&!u.installed&&u.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(Fe,{className:"w-4 h-4"}),s({id:"settings.systemStatus.incomplete"})," — ",u.missingFiles.length," ",s({id:"settings.systemStatus.missingFiles"}).toLowerCase()]}),e.jsxs("ul",{className:"text-xs text-muted-foreground list-disc list-inside",children:[u.missingFiles.slice(0,4).map(p=>e.jsx("li",{children:p},p)),u.missingFiles.length>4&&e.jsxs("li",{children:["+",u.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 la({cliTools:s,defaultCliTool:t,expandedTools:a,savingTools:i,onToggleExpand:c,onToggleEnabled:o,onSetDefault:u,onUpdateModel:p,onUpdateTags:M,onUpdateAvailableModels:g,onUpdateEnvFile:F,onUpdateSettingsFile:y,onUpdateEffort:L,onSaveToBackend:x,formatMessage:j}){const{data:w}=jt();return e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-muted-foreground mb-4",children:[j({id:"settings.cliTools.description"})," ",e.jsx("strong",{className:"text-foreground",children:t})]}),e.jsx("div",{className:"space-y-3",children:Object.entries(s).map(([m,D])=>{const k=w==null?void 0:w[m];return e.jsx(aa,{toolId:m,config:D,isDefault:m===t,isExpanded:a.has(m),toolAvailable:k==null?void 0:k.available,isSaving:i.has(m),onToggleExpand:()=>c(m),onToggleEnabled:()=>o(m),onSetDefault:()=>u(m),onUpdateModel:(S,P)=>p(m,S,P),onUpdateTags:S=>M(m,S),onUpdateAvailableModels:S=>g(m,S),onUpdateEnvFile:S=>F(m,S),onUpdateSettingsFile:S=>y(m,S),onUpdateEffort:S=>L(m,S),onSaveToBackend:()=>x(m)},m)})})]})}function ya(){const{formatMessage:s}=O(),{theme:t,setTheme:a}=Se(),i=ge(Os),c=ge(zs),o=ge($s),{updateCliTool:u,setDefaultCliTool:p,setUserPreferences:M,resetUserPreferences:g}=ge(),[F,y]=d.useState(new Set),[L,x]=d.useState(new Set),j=r=>{y(h=>{const l=new Set(h);return l.has(r)?l.delete(r):l.add(r),l})},w=r=>{u(r,{enabled:!i[r].enabled})},m=r=>{p(r)},D=(r,h,l)=>{u(r,{[h]:l})},k=(r,h)=>{u(r,{tags:h})},S=(r,h)=>{u(r,{availableModels:h})},P=(r,h)=>{u(r,{envFile:h})},B=(r,h)=>{u(r,{settingsFile:h})},R=(r,h)=>{u(r,{effort:h})},f=d.useCallback(async r=>{const h=i[r];if(h){x(l=>new Set(l).add(r));try{const l={enabled:h.enabled,primaryModel:h.primaryModel,secondaryModel:h.secondaryModel,tags:h.tags,availableModels:h.availableModels},E=Qe(r);E==="envFile"?l.envFile=h.envFile||null:E==="settingsFile"&&(l.settingsFile=h.settingsFile||null,l.effort=h.effort||null);const z=ea(),q={"Content-Type":"application/json"};z&&(q["X-CSRF-Token"]=z);const $=await fetch(`/api/cli/config/${r}`,{method:"PUT",headers:q,body:JSON.stringify(l),credentials:"same-origin"});if(!$.ok)throw new Error(`HTTP ${$.status}`);A.success(s({id:"settings.cliTools.configSaved"}),{description:r})}catch{A.error(s({id:"settings.cliTools.configSaveError"}),{description:r})}finally{x(l=>{const E=new Set(l);return E.delete(r),E})}}},[i,s]),N=(r,h)=>{M({[r]:h})};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(Vs,{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(V,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Bs,{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(At,{})]}),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(b,{variant:t==="system"?"default":"outline",size:"sm",onClick:()=>a("system"),children:s({id:"settings.appearance.themeOptions.system"})})]})]})]}),e.jsxs(V,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Je,{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(zt,{})]})})]}),e.jsx(na,{}),e.jsx(Zt,{}),e.jsx(ia,{}),e.jsx(ra,{}),e.jsxs(V,{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.cliTools"})]}),e.jsx(la,{cliTools:i,defaultCliTool:c,expandedTools:F,savingTools:L,onToggleExpand:j,onToggleEnabled:w,onSetDefault:m,onUpdateModel:D,onUpdateTags:k,onUpdateAvailableModels:S,onUpdateEnvFile:P,onUpdateSettingsFile:B,onUpdateEffort:R,onSaveToBackend:f,formatMessage:s})]}),e.jsxs(V,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Y,{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(b,{variant:o.autoRefresh?"default":"outline",size:"sm",onClick:()=>N("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(b,{variant:o.refreshInterval===r?"default":"outline",size:"sm",onClick:()=>N("refreshInterval",r),children:[r/1e3,"s"]},r))})]})]})]}),e.jsxs(V,{className:"p-6",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2 mb-4",children:[e.jsx(Ee,{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(b,{variant:o.notificationsEnabled?"default":"outline",size:"sm",onClick:()=>N("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(b,{variant:o.soundEnabled?"default":"outline",size:"sm",onClick:()=>N("soundEnabled",!o.soundEnabled),children:o.soundEnabled?s({id:"settings.notifications.on"}):s({id:"settings.notifications.off"})})]})]})]}),e.jsx(Xt,{}),e.jsxs(V,{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(b,{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{ya as SettingsPage,ya as default};
144
+ //# sourceMappingURL=SettingsPage-ComW7EZS.js.map