| 25 | onCancel: () => void; |
| 26 | }; |
| 27 | export function SelectEventMode(t0) { |
| 28 | const $ = _c(23); |
| 29 | const { |
| 30 | hookEventMetadata, |
| 31 | hooksByEvent, |
| 32 | totalHooksCount, |
| 33 | restrictedByPolicy, |
| 34 | onSelectEvent, |
| 35 | onCancel |
| 36 | } = t0; |
| 37 | let t1; |
| 38 | if ($[0] !== totalHooksCount) { |
| 39 | t1 = plural(totalHooksCount, "hook"); |
| 40 | $[0] = totalHooksCount; |
| 41 | $[1] = t1; |
| 42 | } else { |
| 43 | t1 = $[1]; |
| 44 | } |
| 45 | const subtitle = `${totalHooksCount} ${t1} configured`; |
| 46 | let t2; |
| 47 | if ($[2] !== restrictedByPolicy) { |
| 48 | t2 = restrictedByPolicy && <Box flexDirection="column"><Text color="suggestion">{figures.info} Hooks Restricted by Policy</Text><Text dimColor={true}>Only hooks from managed settings can run. User-defined hooks from ~/.claude/settings.json, .claude/settings.json, and .claude/settings.local.json are blocked.</Text></Box>; |
| 49 | $[2] = restrictedByPolicy; |
| 50 | $[3] = t2; |
| 51 | } else { |
| 52 | t2 = $[3]; |
| 53 | } |
| 54 | let t3; |
| 55 | if ($[4] === Symbol.for("react.memo_cache_sentinel")) { |
| 56 | t3 = <Box flexDirection="column"><Text dimColor={true}>{figures.info} This menu is read-only. To add or modify hooks, edit settings.json directly or ask Claude.{" "}<Link url="https://code.claude.com/docs/en/hooks">Learn more</Link></Text></Box>; |
| 57 | $[4] = t3; |
| 58 | } else { |
| 59 | t3 = $[4]; |
| 60 | } |
| 61 | let t4; |
| 62 | if ($[5] !== onSelectEvent) { |
| 63 | t4 = value => { |
| 64 | onSelectEvent(value as HookEvent); |
| 65 | }; |
| 66 | $[5] = onSelectEvent; |
| 67 | $[6] = t4; |
| 68 | } else { |
| 69 | t4 = $[6]; |
| 70 | } |
| 71 | let t5; |
| 72 | if ($[7] !== hookEventMetadata) { |
| 73 | t5 = Object.entries(hookEventMetadata); |
| 74 | $[7] = hookEventMetadata; |
| 75 | $[8] = t5; |
| 76 | } else { |
| 77 | t5 = $[8]; |
| 78 | } |
| 79 | let t6; |
| 80 | if ($[9] !== hooksByEvent || $[10] !== t5) { |
| 81 | t6 = t5.map(t7 => { |
| 82 | const [name, metadata] = t7; |
| 83 | const count = hooksByEvent[name as HookEvent] || 0; |
| 84 | return { |