tweakcc-fixed 2.0.3 → 2.0.4

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.
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{$ as e,A as t,B as n,D as r,E as i,F as a,G as o,H as s,I as c,J as l,L as u,M as d,N as f,P as p,Q as m,R as h,T as g,U as _,V as v,W as y,X as b,Y as x,Z as S,_ as C,a as w,b as ee,d as T,et as E,g as D,h as O,i as k,j as A,k as j,l as M,m as te,n as N,o as P,p as F,r as ne,s as re,t as ie,u as ae,v as oe,w as se,x as ce,y as I,z as L}from"./config-3cQoQoFR.mjs";import{a as R,c as le,d as ue,l as de,n as fe,o as pe,s as z,t as me,u as he}from"./content-CpJOKvLf.mjs";import{Box as B,Text as V,render as ge,useInput as H}from"ink";import{Command as _e}from"commander";import U from"chalk";import ve,{Fragment as ye,createContext as be,useCallback as xe,useContext as W,useEffect as G,useMemo as Se,useRef as Ce,useState as K}from"react";import*as we from"node:os";import Te from"ink-link";import*as Ee from"node:fs/promises";import De from"node:fs/promises";import*as Oe from"node:fs";import*as ke from"node:path";import{execSync as Ae,spawn as je}from"node:child_process";import Me from"gray-matter";import{structuredPatch as Ne}from"diff";import{Fragment as q,jsx as J,jsxs as Y}from"react/jsx-runtime";import Pe from"process";import Fe from"cli-spinners";import*as Ie from"node:readline";var X=({children:e,...t})=>Y(V,{bold:!0,backgroundColor:`#ffd500`,color:`#000`,...t,children:[` `,e,` `]});const Le=[`\x1B[?25l\x1B[0m \x1B[38;2;0;0;0m \x1B[38;2;252;130;0m▂\x1B[38;2;252;130;0m▄\x1B[38;2;252;130;0m▅\x1B[38;2;252;130;0m▇\x1B[38;2;254;131;0m\x1B[48;2;252;130;0m▇\x1B[48;2;252;130;0m▇▇\x1B[48;2;252;130;0m▇\x1B[0m\x1B[38;2;252;130;0m▇\x1B[38;2;252;130;0m▅\x1B[38;2;252;130;0m▄\x1B[38;2;252;130;0m▂ \x1B[0m`,` \x1B[38;2;0;0;0m \x1B[38;2;254;131;0m▗\x1B[38;2;254;131;0m▆\x1B[48;2;254;131;0m \x1B[38;2;254;132;0m╶ \x1B[0m\x1B[38;2;254;131;0m▆\x1B[38;2;254;131;0m▖ \x1B[0m`,` \x1B[7m\x1B[38;2;254;131;0m▘\x1B[0m\x1B[38;2;11;6;0m\x1B[48;2;254;131;0m \x1B[38;2;254;216;182m\x1B[48;2;254;136;12m▃\x1B[38;2;254;249;246m\x1B[48;2;254;143;29m▅\x1B[38;2;254;253;253m\x1B[48;2;254;143;40m▆\x1B[38;2;254;254;253m\x1B[48;2;254;152;68m▆▆▆\x1B[38;2;254;253;252m\x1B[48;2;254;141;34m▆\x1B[38;2;254;247;242m\x1B[48;2;254;140;24m▅\x1B[38;2;254;224;199m\x1B[48;2;254;140;20m▖\x1B[48;2;254;131;0m \x1B[0m\x1B[7m\x1B[38;2;254;131;0m▝\x1B[0m \x1B[0m`,`\x1B[7m\x1B[38;2;251;127;0m▌\x1B[0m\x1B[38;2;251;127;0m\x1B[48;2;253;130;0m▃\x1B[38;2;252;128;0m\x1B[48;2;254;131;0m▃\x1B[38;2;252;129;0m▂\x1B[38;2;253;130;0m▁\x1B[38;2;249;135;16m\x1B[48;2;253;226;202m▋\x1B[38;2;254;254;254m\x1B[48;2;254;254;253m┈\x1B[48;2;246;246;245m┈\x1B[38;2;47;47;47m\x1B[48;2;244;244;243m▂\x1B[38;2;112;112;112m\x1B[48;2;251;251;251m▂\x1B[38;2;254;254;254m\x1B[48;2;254;254;253m▁╌▝\x1B[38;2;254;254;253m\x1B[48;2;254;254;254m▋\x1B[38;2;254;254;254m\x1B[48;2;254;253;252m┈\x1B[38;2;252;209;168m\x1B[48;2;251;129;0m▍\x1B[38;2;253;129;0m\x1B[48;2;254;131;0m▂\x1B[38;2;252;128;0m▃\x1B[38;2;251;127;0m\x1B[48;2;253;130;0m▃\x1B[0m\x1B[38;2;251;127;0m▌\x1B[0m`,`\x1B[38;2;243;118;0m\x1B[48;2;243;118;0m▏\x1B[38;2;245;118;0m\x1B[48;2;248;122;0m▄\x1B[38;2;247;121;0m\x1B[48;2;247;122;0m┈\x1B[38;2;106;68;38m\x1B[48;2;245;123;2m▃\x1B[38;2;39;33;28m\x1B[48;2;211;109;6m▅\x1B[38;2;27;20;12m\x1B[48;2;237;237;237m▌\x1B[48;2;254;254;253m \x1B[38;2;90;90;89m\x1B[48;2;231;230;230m▝\x1B[38;2;215;215;214m\x1B[48;2;48;48;48m▁\x1B[38;2;203;203;202m\x1B[48;2;42;42;42m▂\x1B[38;2;254;254;254m\x1B[48;2;254;254;253m┇╴\x1B[38;2;253;252;252m▂\x1B[38;2;251;250;250m\x1B[48;2;253;253;253m▃\x1B[38;2;249;249;248m\x1B[48;2;252;252;251m▄\x1B[38;2;249;248;248m\x1B[48;2;237;118;0m▍\x1B[38;2;246;121;0m\x1B[48;2;250;125;0m▄\x1B[38;2;246;119;0m\x1B[48;2;249;124;0m▄\x1B[38;2;245;118;0m\x1B[48;2;248;123;0m▄\x1B[38;2;243;118;0m\x1B[48;2;243;118;0m▉\x1B[0m`,`\x1B[38;2;238;108;0m\x1B[48;2;237;109;0m▏\x1B[38;2;238;108;0m\x1B[48;2;241;113;0m▄\x1B[38;2;239;109;0m\x1B[48;2;242;114;0m▄\x1B[38;2;233;109;2m\x1B[48;2;125;73;29m▇\x1B[38;2;225;104;1m\x1B[48;2;50;32;18m▄\x1B[38;2;62;29;2m\x1B[48;2;239;237;237m▌\x1B[38;2;254;253;253m\x1B[48;2;254;254;254m┻\x1B[38;2;254;254;253m▊\x1B[38;2;254;254;254m\x1B[48;2;254;254;253m┊\x1B[38;2;253;253;252m▂\x1B[38;2;251;251;251m\x1B[48;2;254;253;253m▃\x1B[38;2;249;249;249m\x1B[48;2;252;252;252m▄\x1B[38;2;247;247;247m\x1B[48;2;250;250;250m▄\x1B[38;2;245;245;244m\x1B[48;2;248;248;248m▄\x1B[38;2;243;243;242m\x1B[48;2;246;246;245m▄\x1B[38;2;243;242;242m\x1B[48;2;230;109;0m▍\x1B[38;2;239;111;0m\x1B[48;2;243;116;0m▄\x1B[38;2;239;109;0m\x1B[48;2;242;114;0m▄\x1B[38;2;238;108;0m\x1B[48;2;241;113;0m▄\x1B[38;2;237;108;0m\x1B[48;2;238;108;0m▉\x1B[0m`,`\x1B[7m\x1B[38;2;231;98;0m▌\x1B[0m\x1B[38;2;231;98;0m\x1B[48;2;234;103;0m▄\x1B[38;2;231;99;0m\x1B[48;2;235;105;0m▄\x1B[38;2;232;100;0m\x1B[48;2;236;105;0m▄\x1B[38;2;232;101;0m\x1B[48;2;236;106;0m▄\x1B[38;2;223;99;0m\x1B[48;2;247;238;235m▌\x1B[38;2;254;254;254m\x1B[48;2;254;254;253m┊\x1B[38;2;252;252;251m▃\x1B[38;2;250;250;250m\x1B[48;2;253;253;252m▄\x1B[38;2;248;248;247m\x1B[48;2;251;251;250m▄\x1B[38;2;246;245;245m\x1B[48;2;249;248;248m▄\x1B[38;2;243;243;243m\x1B[48;2;246;246;246m▄\x1B[38;2;241;241;241m\x1B[48;2;244;244;244m▄\x1B[38;2;239;239;238m\x1B[48;2;242;242;242m▄\x1B[38;2;237;237;236m\x1B[48;2;240;240;239m▄\x1B[38;2;237;236;236m\x1B[48;2;223;99;0m▍\x1B[38;2;232;100;0m\x1B[48;2;236;106;0m▄\x1B[38;2;231;100;0m\x1B[48;2;235;105;0m▄\x1B[38;2;231;98;0m\x1B[48;2;234;103;0m▄\x1B[0m\x1B[38;2;231;98;0m▌\x1B[0m`,` \x1B[7m\x1B[38;2;224;89;0m▖\x1B[0m\x1B[38;2;224;89;0m\x1B[48;2;228;94;0m▄\x1B[38;2;225;90;0m\x1B[48;2;228;95;0m▄\x1B[38;2;225;91;0m\x1B[48;2;229;96;0m▄\x1B[38;2;217;90;1m\x1B[48;2;97;77;70m▌\x1B[38;2;70;70;70m\x1B[48;2;207;207;207m▆\x1B[38;2;66;65;65m\x1B[48;2;228;228;227m▄\x1B[38;2;66;66;66m\x1B[48;2;233;232;232m▂\x1B[38;2;169;169;169m\x1B[48;2;243;243;243m▁\x1B[38;2;240;239;239m\x1B[48;2;243;242;242m▄\x1B[38;2;238;237;237m\x1B[48;2;241;240;240m▄\x1B[38;2;235;235;235m\x1B[48;2;238;238;238m▄\x1B[38;2;233;233;233m\x1B[48;2;236;236;236m▄\x1B[38;2;231;231;230m\x1B[48;2;234;234;233m▄\x1B[38;2;231;230;230m\x1B[48;2;216;89;0m▍\x1B[38;2;225;90;0m\x1B[48;2;229;95;0m▄\x1B[38;2;224;89;0m\x1B[48;2;228;94;0m▄\x1B[0m\x1B[7m\x1B[38;2;224;89;0m▗\x1B[0m \x1B[0m`,` \x1B[38;2;0;0;0m \x1B[38;2;217;80;0m▝\x1B[7m\x1B[38;2;217;80;0m▂\x1B[0m\x1B[38;2;217;80;0m\x1B[48;2;221;86;0m▄\x1B[38;2;197;78;9m\x1B[48;2;66;66;65m▋\x1B[38;2;65;65;64m\x1B[48;2;60;60;60m▘\x1B[38;2;52;52;51m\x1B[48;2;56;56;56m▗\x1B[38;2;45;45;45m\x1B[48;2;50;50;49m▗\x1B[38;2;42;42;42m\x1B[48;2;46;46;46m┈\x1B[38;2;41;41;41m\x1B[48;2;203;202;202m▆\x1B[38;2;38;38;38m\x1B[48;2;218;218;218m▄\x1B[38;2;45;45;45m\x1B[48;2;221;221;221m▂\x1B[38;2;229;229;229m┊\x1B[38;2;225;225;225m\x1B[48;2;228;228;227m▄\x1B[38;2;225;224;224m\x1B[48;2;209;79;0m▍\x1B[0m\x1B[7m\x1B[38;2;217;80;0m▂\x1B[0m\x1B[38;2;217;80;0m▘ \x1B[0m`,` \x1B[38;2;0;0;0m \x1B[7m\x1B[38;2;191;73;0m▆\x1B[38;2;191;73;0m▄\x1B[38;2;56;55;55m▃\x1B[38;2;46;46;46m▁\x1B[0m\x1B[38;2;20;20;20m\x1B[48;2;42;42;42m▁\x1B[38;2;36;36;36m\x1B[48;2;35;34;34m╴\x1B[38;2;23;23;23m\x1B[48;2;29;29;28m▁\x1B[38;2;10;10;10m\x1B[48;2;22;22;22m▁\x1B[0m\x1B[7m\x1B[38;2;15;15;15m▁\x1B[38;2;22;22;21m▃\x1B[38;2;154;154;154m▅\x1B[38;2;175;116;83m▇\x1B[0m\x1B[38;2;17;15;14m \x1B[0m`,`\x1B[?25h\x1B[0m`];var Re=()=>Y(B,{flexDirection:`row`,height:10,alignItems:`center`,borderStyle:`bold`,borderBottom:!1,borderTop:!1,borderRight:!1,borderColor:`#ff8400`,marginBottom:1,children:[Y(B,{marginBottom:1,paddingLeft:1,flexDirection:`column`,flexGrow:1,children:[J(V,{bold:!0,color:`#ff8400`,children:`Piebald is released!`}),J(V,{children:` `}),Y(V,{children:[`We've released `,J(V,{bold:!0,children:`Piebald`}),`, the ultimate agentic AI developer experience.`]}),Y(V,{children:[`Download it and try it out for free!`,` `,J(Te,{url:`https://piebald.ai/`,fallback:!1,children:J(V,{color:`#ff8400`,children:`https://piebald.ai/`})})]}),J(V,{children:` `}),J(V,{dimColor:!0,color:`gray`,children:`press 'h' to hide`})]}),J(B,{width:22,flexShrink:0,flexDirection:`column`,alignItems:`center`,children:Le.map((e,t)=>J(V,{children:e},t))})]});let Z=function(e){return e.THEMES=`Themes`,e.THINKING_VERBS=`Thinking verbs`,e.THINKING_STYLE=`Thinking style`,e.USER_MESSAGE_DISPLAY=`User message display`,e.INPUT_PATTERN_HIGHLIGHTERS=`Input pattern highlighters`,e.MISC=`Misc`,e.TOOLSETS=`Toolsets`,e.SUBAGENT_MODELS=`Subagent models`,e.CLAUDE_MD_ALT_NAMES=`CLAUDE.md alternative names`,e.SYSTEM_REMINDERS=`System reminders (injection lobotomy)`,e.SKILLS=`Skills (per-skill on/name-only/user-invocable/off)`,e.VIEW_SYSTEM_PROMPTS=`View system prompts`,e.RESTORE_ORIGINAL=`Restore original Claude Code (preserves config.json)`,e.OPEN_CONFIG=`Open config.json`,e.OPEN_CLI=`Open Claude Code's cli.js`,e.EXIT=`Exit`,e}({});function ze({items:e,selectedIndex:t,onSelect:n,onSubmit:r}){return H((i,a)=>{a.upArrow?n(t>0?t-1:e.length-1):a.downArrow?n(t<e.length-1?t+1:0):a.return&&r(e[t].name)}),J(B,{flexDirection:`column`,children:e.map((e,n)=>J(B,{children:Y(V,{children:[Y(V,{bold:n===t,color:n===t?`cyan`:void 0,...n===t?e.selectedStyles??{}:e.styles??{},children:[n===t?`❯ `:` `,e.name]}),e.desc&&n===t&&Y(V,{dimColor:!0,bold:!1,children:[` \x1B[0;2m`,`- `,e.desc]})]})},n))})}const Be=[{name:Z.THEMES,desc:`Modify Claude Code's built-in themes or create your own`},{name:Z.THINKING_VERBS,desc:`Customize the list of verbs that Claude Code uses when it's working`},{name:Z.THINKING_STYLE,desc:`Choose custom spinners`},{name:Z.USER_MESSAGE_DISPLAY,desc:`Customize how user messages are displayed`},{name:Z.INPUT_PATTERN_HIGHLIGHTERS,desc:`Create custom highlighters for patterns in your input`},{name:Z.MISC,desc:`Miscellaneous settings (input box border, etc.)`},{name:Z.TOOLSETS,desc:`Manage toolsets to control which tools are available`},{name:Z.SUBAGENT_MODELS,desc:`Configure which Claude model each subagent uses (Plan, Explore, etc.)`},{name:Z.CLAUDE_MD_ALT_NAMES,desc:`Configure alternative filenames for CLAUDE.md (e.g., AGENTS.md)`},{name:Z.SYSTEM_REMINDERS,desc:`Suppress per-turn <system-reminder> injections (skills list, MCP instructions, claudeMd wrapper, etc.)`},{name:Z.SKILLS,desc:`Per-skill listing control (writes settings.json skillOverrides — no patch needed)`},{name:Z.VIEW_SYSTEM_PROMPTS,desc:`Opens the system prompts directory where you can customize Claude Code's system prompts`}],Ve=[{name:Z.RESTORE_ORIGINAL,desc:`Reverts your Claude Code install to its original state (your customizations are remembered and can be reapplied)`},{name:Z.OPEN_CONFIG,desc:`Opens your tweakcc config file (${ne})`},{name:Z.OPEN_CLI,desc:`Opens Claude Code's cli.js file`},{name:Z.EXIT,desc:`Bye!`}];var He=({onSubmit:e})=>{let t=[...Be,...Ve],[n,r]=K(0);return J(ze,{items:t,selectedIndex:n,onSelect:r,onSubmit:t=>e(t)})};const Ue=()=>Y(B,{flexDirection:`row`,children:[J(X,{children:`tweakcc`}),J(V,{children:` (by `}),J(Te,{url:`https://piebald.ai`,fallback:!1,children:J(V,{color:`#ff8400`,bold:!0,children:`Piebald`})}),J(V,{children:`)`})]}),We=()=>J(B,{children:Y(V,{color:`yellow`,children:[`⭐ `,J(V,{bold:!0,children:`Star the repo at `}),J(Te,{url:`https://github.com/skrabe/tweakcc-fixed`,fallback:!1,children:J(V,{bold:!0,color:`cyan`,children:`https://github.com/skrabe/tweakcc-fixed`})}),J(V,{bold:!0,children:` if you find this useful!`}),` ⭐`]})}),Ge=({notification:e})=>J(B,{borderLeft:!0,borderRight:!1,borderTop:!1,borderBottom:!1,borderStyle:`bold`,borderColor:e.type===`success`?`green`:e.type===`error`?`red`:e.type===`info`?`blue`:`yellow`,paddingLeft:1,flexDirection:`column`,children:J(V,{color:e.type===`success`?`green`:e.type===`error`?`red`:e.type===`info`?`blue`:`yellow`,children:e.message})}),Ke=({onSubmit:e,notification:t,configMigrated:n,showPiebaldAnnouncement:r,changesApplied:i,invocationCommand:a})=>Y(B,{flexDirection:`column`,gap:1,children:[n&&J(B,{children:J(V,{color:`blue`,bold:!0,children:"Note that in tweakcc v3.2.0+, `ccInstallationDir` config is deprecated. You are now migrated to `ccInstallationPath` which supports npm and native installs."})}),J(Ue,{}),J(B,{children:Y(V,{children:[J(V,{bold:!0,children:`Customize your Claude Code installation.`}),` `,Y(V,{dimColor:!0,children:[`Settings will be saved to `,N.replace(we.homedir(),`~`),`/config.json.`]})]})}),J(r?Re:We,{}),t&&J(Ge,{notification:t}),!i&&!t&&J(Ge,{notification:{message:`Your changes are configured but not applied.\nRun \`${a} --apply\` to apply your customizations!`,type:`info`}}),J(He,{onSubmit:e})]});function Q({color:e,backgroundColor:t,bold:n,dimColor:r,children:i}){let a=e?.startsWith(`ansi:`),o=t?.startsWith(`ansi:`);if(a||o){if(ve.Children.toArray(i).some(e=>ve.isValidElement(e)))return J(V,{children:i});let s=U;if(a){let t=e.slice(5);s=s[t]||s}if(o){let e=t.slice(5),n=e.startsWith(`bg`)?e:`bg${e.charAt(0).toUpperCase()}${e.slice(1)}`;s=s[n]||s}n&&(s=s.bold),r&&(s=s.dim);let c=ve.Children.toArray(i).map(e=>typeof e==`string`||typeof e==`number`?String(e):``).join(``);return J(V,{children:s(c)})}return J(V,{color:e,backgroundColor:t,bold:n,dimColor:r,children:i})}function qe({text:e,nonShimmerColors:t,shimmerColors:n,shimmerWidth:r=3,updateDuration:i=50,restartPoint:a=10}){let[o,s]=K(0);return G(()=>{let t=setInterval(()=>{s(t=>{let n=t+1;return n>=e.length+a?-r:n})},i);return()=>clearInterval(t)},[e.length,a,i]),t.length===n.length?J(V,{children:e.split(``).map((i,a)=>{let s=a>=o&&a<o+r&&o<e.length,c=a%t.length;return J(V,{color:s?n[c]:t[c],children:i},a)})}):(console.error(`UltrathinkRainbowShimmer: nonShimmerColors and shimmerColors must have the same length`),J(V,{children:e}))}const Je=Pe.cwd();function Ye({theme:e}){let{ccVersion:t}=W($);return Y(B,{flexDirection:`column`,paddingLeft:1,children:[J(B,{marginBottom:1,children:Y(V,{bold:!0,children:[`Preview: `,e.name]})}),J(B,{borderStyle:`single`,borderColor:`gray`,paddingX:1,children:Y(B,{flexDirection:`column`,children:[Y(B,{flexDirection:`column`,children:[Y(V,{children:[J(Q,{color:e.colors.clawd_body,children:` ▐`}),J(V,{color:e.colors.clawd_body,backgroundColor:e.colors.clawd_background,children:`▛███▜`}),Y(V,{children:[J(Q,{color:e.colors.clawd_body,children:`▌ `}),` `,J(V,{bold:!0,children:`Claude Code`}),` `,t?`v${t}`:`v2.0.14`]})]}),Y(V,{children:[J(Q,{color:e.colors.clawd_body,children:`▝▜`}),J(V,{color:e.colors.clawd_body,backgroundColor:e.colors.clawd_background,children:`█████`}),J(Q,{color:e.colors.clawd_body,children:`▛▘`}),` `,ce(),` · `,I()]}),Y(Q,{color:e.colors.clawd_body,children:[` `,`▘▘ ▝▝`,` `,Je]}),Y(V,{children:[Y(Q,{color:e.colors.success,children:[`Login successful. Press`,` `]}),J(Q,{bold:!0,color:e.colors.success,children:`Enter`}),Y(Q,{color:e.colors.success,children:[` `,`to continue…`]})]})]}),J(V,{children:`╭─────────────────────────────────────────────╮`}),Y(V,{children:[`│ 1 function greet() `,`{`,` `,`│`]}),Y(V,{children:[`│ 2`,` `,J(Q,{backgroundColor:e.colors.diffRemoved,color:e.colors.text,children:`- console.log("`}),J(Q,{backgroundColor:e.colors.diffRemovedWord,children:`Hello, World!`}),J(Q,{backgroundColor:e.colors.diffRemoved,children:`");`}),` `,`│`]}),Y(V,{children:[`│ 2`,` `,J(Q,{backgroundColor:e.colors.diffAdded,color:e.colors.text,children:`+ console.log("`}),J(Q,{backgroundColor:e.colors.diffAddedWord,children:`Hello, Claude!`}),J(Q,{backgroundColor:e.colors.diffAdded,children:`");`}),` `,`│`]}),J(Q,{color:e.colors.warning,children:`╭─────────────────────────────────────────────╮`}),Y(Q,{color:e.colors.warning,children:[`│ Do you trust the files in this folder?`,` `,`│`]}),Y(V,{children:[J(Q,{color:e.colors.warning,children:`│ `}),J(V,{dimColor:!0,children:`Enter to confirm · Esc to exit`}),Y(Q,{color:e.colors.warning,children:[` `,`│`]})]}),J(Q,{color:e.colors.bashBorder,children:`───────────────────────────────────────────────`}),Y(V,{children:[J(Q,{color:e.colors.bashBorder,children:`!`}),J(V,{children:` ls`})]}),J(Q,{color:e.colors.promptBorder,children:`───────────────────────────────────────────────`}),J(V,{children:Y(V,{children:[`> list the dir`,` `,J(qe,{text:`ultrathink`,nonShimmerColors:[e.colors.rainbow_red,e.colors.rainbow_orange,e.colors.rainbow_yellow,e.colors.rainbow_green,e.colors.rainbow_blue,e.colors.rainbow_indigo,e.colors.rainbow_violet],shimmerColors:[e.colors.rainbow_red_shimmer,e.colors.rainbow_orange_shimmer,e.colors.rainbow_yellow_shimmer,e.colors.rainbow_green_shimmer,e.colors.rainbow_blue_shimmer,e.colors.rainbow_indigo_shimmer,e.colors.rainbow_violet_shimmer],shimmerWidth:3,updateDuration:50,restartPoint:10})]})}),J(Q,{color:e.colors.planMode,children:`╭─────────────────────────────────────────────╮`}),Y(V,{children:[J(Q,{color:e.colors.planMode,children:`│ `}),Y(Q,{color:e.colors.permission,children:[`Ready to code?`,` `]}),J(V,{children:`Here is Claude's plan:`}),Y(Q,{color:e.colors.planMode,children:[` `,`│`]})]}),J(Q,{color:e.colors.permission,children:`╭─────────────────────────────────────────────╮`}),Y(V,{children:[J(Q,{color:e.colors.permission,children:`│ `}),J(V,{bold:!0,children:`Permissions:`}),` `,Y(Q,{backgroundColor:e.colors.permission,color:e.colors.inverseText,bold:!0,children:[` `,`Allow`,` `]}),` `,`Deny`,` `,`Workspace`,` `,J(Q,{color:e.colors.permission,children:`│`})]}),J(V,{children:`> list the dir`}),Y(V,{children:[J(Q,{color:e.colors.error,children:`●`}),J(V,{children:` Update(__init__.py)`})]}),Y(V,{children:[J(V,{children:` ⎿ `}),J(Q,{color:e.colors.error,children:`User rejected update to __init__.py`})]}),Y(V,{children:[` `,`1`,` `,Y(Q,{backgroundColor:e.colors.diffRemovedDimmed,children:[`- import`,` `]}),J(Q,{backgroundColor:e.colors.diffRemovedWordDimmed,children:`os`})]}),Y(V,{children:[` `,`2`,` `,Y(Q,{backgroundColor:e.colors.diffAddedDimmed,children:[`+ import`,` `]}),J(Q,{backgroundColor:e.colors.diffAddedWordDimmed,children:`random`})]}),Y(V,{children:[J(Q,{color:e.colors.success,children:`●`}),J(V,{children:` List(.)`})]}),Y(V,{children:[J(V,{children:`●`}),J(V,{children:` The directory `}),J(Q,{color:e.colors.permission,children:`C:\\Users\\user`}),Y(V,{children:[` `,`contains `,J(V,{bold:!0,children:`123`}),` files.`]})]}),Y(V,{children:[J(Q,{color:e.colors.claude,children:`✻ Th`}),J(Q,{color:e.colors.claudeShimmer,children:`ink`}),J(Q,{color:e.colors.claude,children:`ing… `}),J(V,{children:`(esc to interrupt)`})]}),J(V,{children:J(Q,{color:e.colors.autoAccept,children:`⏵⏵ accept edits on (shift+tab to cycle)`})}),J(V,{children:J(Q,{color:e.colors.planMode,children:`⏸ plan mode on (shift+tab to cycle)`})}),J(V,{children:J(Q,{color:e.colors.ide,children:`◯ IDE connected ⧉ 44 lines selected`})})]})})]})}function Xe({colorKey:e,theme:t,bold:n=!1}){let r=t.colors[e];return e===`inverseText`?J(Q,{color:r,backgroundColor:t.colors.permission,bold:n,children:e}):e.startsWith(`diff`)?J(Q,{backgroundColor:r,bold:n,color:t.colors.text,children:e}):J(Q,{color:r,bold:n,children:e})}function Ze({initialValue:e,onColorChange:t,onExit:n,colorKey:r,theme:a}){let o=$e(e)||{h:0,s:50,l:50},s=Qe(e)||{r:128,g:128,b:128},[c,l]=K(o),[u,d]=K(s),[f,p]=K(`hsl`),[m,h]=K(`h`),[_,v]=K(!1),[y,b]=K(!1);G(()=>{let t=$e(e),n=Qe(e);t&&n&&(v(!0),l(t),d(n),v(!1))},[e]),G(()=>{!_&&y&&t(`rgb(${u.r},${u.g},${u.b})`)},[c,u,_,y]),G(()=>{b(!0)},[]);let x=e=>{if(g(e)){let t=i(e),n=$e(t),r=Qe(t);n&&r&&(v(!0),l(n),d(r),v(!1))}};H((e,t)=>{if(e.length>1&&!t.ctrl&&!t.meta){x(e);return}t.return||t.escape?n():t.ctrl&&e===`a`?(p(e=>e===`hsl`?`rgb`:`hsl`),h(e=>f===`hsl`?e===`h`?`r`:e===`s`?`g`:`b`:e===`r`?`h`:e===`g`?`s`:`l`)):t.upArrow?h(f===`hsl`?e=>e===`h`?`l`:e===`s`?`h`:`s`:e=>e===`r`?`b`:e===`g`?`r`:`g`):t.downArrow||t.tab?h(f===`hsl`?e=>e===`h`?`s`:e===`s`?`l`:`h`:e=>e===`r`?`g`:e===`g`?`b`:`r`):t.leftArrow?S(t.shift||t.ctrl||t.meta?-10:-1):t.rightArrow&&S(t.shift||t.ctrl||t.meta?10:1)});let S=e=>{v(!0),f===`hsl`?l(t=>{let n={...t};m===`h`?n.h=Math.max(0,Math.min(359,t.h+e)):m===`s`?n.s=Math.max(0,Math.min(100,t.s+e)):m===`l`&&(n.l=Math.max(0,Math.min(100,t.l+e)));let[r,i,a]=w(n.h,n.s,n.l);return d({r,g:i,b:a}),n}):d(t=>{let n={...t};return m===`r`?n.r=Math.max(0,Math.min(255,t.r+e)):m===`g`?n.g=Math.max(0,Math.min(255,t.g+e)):m===`b`&&(n.b=Math.max(0,Math.min(255,t.b+e))),l(C(n.r,n.g,n.b)),n}),v(!1)},C=(e,t,n)=>{let r=e/255,i=t/255,a=n/255,o=Math.max(r,i,a),s=Math.min(r,i,a),c=o-s,l=(o+s)/2,u=0;c!==0&&(u=l>.5?c/(2-o-s):c/(o+s));let d=0;return c!==0&&(d=o===r?((i-a)/c+(i<a?6:0))/6:o===i?((a-r)/c+2)/6:((r-i)/c+4)/6),{h:Math.round(d*360),s:Math.round(u*100),l:Math.round(l*100)}},w=(e,t,n)=>{e/=360,t/=100,n/=100;let r=(1-Math.abs(2*n-1))*t,i=r*(1-Math.abs(e*6%2-1)),a=n-r/2,o=0,s=0,c=0;return 0<=e&&e<1/6?(o=r,s=i,c=0):1/6<=e&&e<2/6?(o=i,s=r,c=0):2/6<=e&&e<3/6?(o=0,s=r,c=i):3/6<=e&&e<4/6?(o=0,s=i,c=r):4/6<=e&&e<5/6?(o=i,s=0,c=r):5/6<=e&&e<1&&(o=r,s=0,c=i),[Math.round((o+a)*255),Math.round((s+a)*255),Math.round((c+a)*255)]},ee=()=>{let e=[],t=[[255,0,0],[255,127,0],[255,255,0],[127,255,0],[0,255,0],[0,255,127],[0,255,255],[0,127,255],[0,0,255],[127,0,255],[255,0,255],[255,0,127],[255,0,0]];for(let n=0;n<40;n++){let r=n/39*(t.length-1),i=Math.floor(r),a=Math.ceil(r),o=r-i,[s,c,l]=t[i],[u,d,f]=t[a],p=Math.round(s+(u-s)*o),m=Math.round(c+(d-c)*o),h=Math.round(l+(f-l)*o);e.push(J(V,{backgroundColor:`rgb(${p},${m},${h})`,children:` `},n))}return e},T=()=>{let e=[];for(let t=0;t<40;t++){let n=t/39*100,[r,i,a]=w(c.h,n,c.l);e.push(J(V,{backgroundColor:`rgb(${r},${i},${a})`,children:` `},t))}return e},E=()=>{let e=[];for(let t=0;t<40;t++){let n=t/39*100,[r,i,a]=w(c.h,c.s,n);e.push(J(V,{backgroundColor:`rgb(${r},${i},${a})`,children:` `},t))}return e},D=()=>{let[e,t,n]=w(c.h,c.s,c.l);return`rgb(${e},${t},${n})`},O=(e,t,n)=>{let r=e=>e.toString(16).padStart(2,`0`);return`#${r(e)}${r(t)}${r(n)}`},k=()=>{let e=[];for(let t=0;t<40;t++){let n=Math.round(t/39*255);e.push(J(V,{backgroundColor:`rgb(${n},${u.g},${u.b})`,children:` `},t))}return e},A=()=>{let e=[];for(let t=0;t<40;t++){let n=Math.round(t/39*255);e.push(J(V,{backgroundColor:`rgb(${u.r},${n},${u.b})`,children:` `},t))}return e},j=()=>{let e=[];for(let t=0;t<40;t++){let n=Math.round(t/39*255);e.push(J(V,{backgroundColor:`rgb(${u.r},${u.g},${n})`,children:` `},t))}return e},M=(e,t)=>Math.round(e/t*39);return Y(B,{flexDirection:`column`,borderStyle:`single`,borderColor:`white`,padding:1,children:[Y(B,{flexDirection:`column`,children:[J(V,{bold:!0,children:`Color Picker`}),Y(B,{marginBottom:1,flexDirection:`column`,children:[J(V,{color:`gray`,dimColor:!0,children:`←→ to adjust (shift/ctrl/cmd +10)`}),J(V,{color:`gray`,dimColor:!0,children:`↑↓ to change bar`}),J(V,{color:`gray`,dimColor:!0,children:`ctrl+a to switch rgb/hsl`}),J(V,{color:`gray`,dimColor:!0,children:`paste color from clipboard`}),J(V,{color:`gray`,dimColor:!0,children:`enter to exit (auto-saved)`}),J(V,{color:`gray`,dimColor:!0,children:`esc to save and exit`})]})]}),f===`hsl`?Y(q,{children:[Y(B,{marginBottom:1,children:[J(B,{width:25,children:Y(V,{color:m===`h`?`yellow`:`white`,children:[m===`h`?`❯ `:` `,`Hue (`,c.h,`°):`]})}),J(B,{children:ee().map((e,t)=>J(ye,{children:t===M(c.h,360)?J(V,{children:`|`}):e},t))})]}),Y(B,{marginBottom:1,children:[J(B,{width:25,children:Y(V,{color:m===`s`?`yellow`:`white`,children:[m===`s`?`❯ `:` `,`Saturation (`,c.s,`%):`]})}),J(B,{children:T().map((e,t)=>J(ye,{children:t===M(c.s,100)?J(V,{children:`|`}):e},t))})]}),Y(B,{marginBottom:1,children:[J(B,{width:25,children:Y(V,{color:m===`l`?`yellow`:`white`,children:[m===`l`?`❯ `:` `,`Lightness (`,c.l,`%):`]})}),J(B,{children:E().map((e,t)=>J(ye,{children:t===M(c.l,100)?J(V,{children:`|`}):e},t))})]})]}):Y(q,{children:[Y(B,{marginBottom:1,children:[J(B,{width:25,children:Y(V,{color:m===`r`?`yellow`:`white`,children:[m===`r`?`❯ `:` `,`Red (`,u.r,`):`]})}),J(B,{children:k().map((e,t)=>J(ye,{children:t===M(u.r,255)?J(V,{children:`|`}):e},t))})]}),Y(B,{marginBottom:1,children:[J(B,{width:25,children:Y(V,{color:m===`g`?`yellow`:`white`,children:[m===`g`?`❯ `:` `,`Green (`,u.g,`):`]})}),J(B,{children:A().map((e,t)=>J(ye,{children:t===M(u.g,255)?J(V,{children:`|`}):e},t))})]}),Y(B,{marginBottom:1,children:[J(B,{width:25,children:Y(V,{color:m===`b`?`yellow`:`white`,children:[m===`b`?`❯ `:` `,`Blue (`,u.b,`):`]})}),J(B,{children:j().map((e,t)=>J(ye,{children:t===M(u.b,255)?J(V,{children:`|`}):e},t))})]})]}),Y(B,{marginBottom:1,children:[J(V,{children:`Current: `}),J(V,{backgroundColor:D(),children:` `})]}),Y(B,{flexDirection:`row`,justifyContent:`space-between`,children:[Y(B,{flexDirection:`column`,children:[J(V,{dimColor:!0,children:`Hex `}),r?.startsWith(`diff`)?J(V,{backgroundColor:D(),color:a?.colors?.text||`white`,bold:!0,children:O(u.r,u.g,u.b)}):r===`inverseText`?J(V,{color:D(),backgroundColor:a?.colors?.permission,bold:!0,children:O(u.r,u.g,u.b)}):J(V,{color:D(),bold:!0,children:O(u.r,u.g,u.b)})]}),Y(B,{flexDirection:`column`,children:[J(V,{dimColor:!0,children:`RGB `}),r?.startsWith(`diff`)?J(V,{backgroundColor:D(),color:a?.colors?.text||`white`,bold:!0,children:`rgb(${u.r}, ${u.g}, ${u.b})`}):r===`inverseText`?J(V,{color:D(),backgroundColor:a?.colors?.permission,bold:!0,children:`rgb(${u.r}, ${u.g}, ${u.b})`}):J(V,{color:D(),bold:!0,children:`rgb(${u.r}, ${u.g}, ${u.b})`})]}),Y(B,{flexDirection:`column`,children:[J(V,{dimColor:!0,children:`HSL `}),r?.startsWith(`diff`)?J(V,{backgroundColor:D(),color:a?.colors?.text||`white`,bold:!0,children:`hsl(${c.h}, ${c.s}%, ${c.l}%)`}):r===`inverseText`?J(V,{color:D(),backgroundColor:a?.colors?.permission,bold:!0,children:`hsl(${c.h}, ${c.s}%, ${c.l}%)`}):J(V,{color:D(),bold:!0,children:`hsl(${c.h}, ${c.s}%, ${c.l}%)`})]})]})]})}function Qe(e){let t=e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(t)return{r:parseInt(t[1]),g:parseInt(t[2]),b:parseInt(t[3])};let n=e.match(/^#([a-fA-F0-9]{6})$/);if(n){let e=n[1];return{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16)}}return null}function $e(e){let t=e.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);if(t)return{h:parseInt(t[1]),s:parseInt(t[2]),l:parseInt(t[3])};let n=e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(n){let e=parseInt(n[1])/255,t=parseInt(n[2])/255,r=parseInt(n[3])/255,i=Math.max(e,t,r),a=Math.min(e,t,r),o=i-a,s=(i+a)/2,c=0;o!==0&&(c=s>.5?o/(2-i-a):o/(i+a));let l=0;return o!==0&&(l=i===e?((t-r)/o+(t<r?6:0))/6:i===t?((r-e)/o+2)/6:((e-t)/o+4)/6),{h:Math.round(l*360),s:Math.round(c*100),l:Math.round(s*100)}}let r=e.match(/^#([a-fA-F0-9]{6})$/);if(r){let e=r[1],t=parseInt(e.substr(0,2),16)/255,n=parseInt(e.substr(2,2),16)/255,i=parseInt(e.substr(4,2),16)/255,a=Math.max(t,n,i),o=Math.min(t,n,i),s=a-o,c=(a+o)/2,l=0;s!==0&&(l=c>.5?s/(2-a-o):s/(a+o));let u=0;return s!==0&&(u=a===t?((n-i)/s+(n<i?6:0))/6:a===n?((i-t)/s+2)/6:((t-n)/s+4)/6),{h:Math.round(u*360),s:Math.round(l*100),l:Math.round(c*100)}}return{h:0,s:50,l:50}}function et({onBack:e,themeId:n}){let{settings:{themes:r},updateSettings:a}=W($),[o,s]=K(n),c=r.find(e=>e.id===o)||r[0],[l,u]=K(`rgb`),[d,f]=K(0),[p,m]=K(null),[h,_]=K(null),[v,y]=K(``),[b,x]=K(``),[S,C]=K(!1),[w,ee]=K(0),T=xe(e=>{a(t=>{let n=t.themes.findIndex(e=>e.id===o);n!==-1&&e(t.themes[n])})},[o,a]),E=e=>{if(d>=2&&g(e)){let t=i(e),n=D[d-2];T(e=>{e.colors[n]=t})}};H((t,n)=>{if(S){if(n.escape){C(!1),e();return}return}if(p===null&&h===null){if(t.length>1&&!n.ctrl&&!n.meta){E(t);return}if(n.escape)C(!0),ee(0);else if(n.ctrl&&t===`a`)u(e=>e===`rgb`?`hex`:e===`hex`?`hsl`:`rgb`);else if(n.upArrow)f(e=>Math.max(0,e-1));else if(n.downArrow)f(e=>Math.min(D.length+1,e+1));else if(n.return)if(d===0)_(`name`),y(c.name),x(c.name);else if(d===1)_(`id`),y(c.id),x(c.id);else{let e=d-2,t=D[e],n=c.colors[t];m(e),y(n),x(n)}}else if(p!==null)n.ctrl&&t===`a`&&u(e=>e===`rgb`?`hex`:e===`hex`?`hsl`:`rgb`);else if(h!==null)if(n.return){if(h===`id`){let e=o;s(v),a(t=>{let n=t.themes.findIndex(t=>t.id===e);n!==-1&&(t.themes[n].id=v)})}else T(e=>{e.name=v});_(null),y(``),x(``)}else n.escape?(_(null),y(``),x(``)):n.backspace||n.delete?y(e=>e.slice(0,-1)):t&&y(e=>e+t)});let D=Object.keys(c.colors),O=(e,t)=>{let n=e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(!n)return e;let r=parseInt(n[1]),i=parseInt(n[2]),a=parseInt(n[3]);switch(t){case`hex`:{let e=e=>e.toString(16).padStart(2,`0`);return`#${e(r)}${e(i)}${e(a)}`}case`hsl`:{let e=r/255,t=i/255,n=a/255,o=Math.max(e,t,n),s=Math.min(e,t,n),c=o-s,l=(o+s)/2,u=0;c!==0&&(u=l>.5?c/(2-o-s):c/(o+s));let d=0;return c!==0&&(d=o===e?((t-n)/c+(t<n?6:0))/6:o===t?((n-e)/c+2)/6:((e-t)/c+4)/6),`hsl(${Math.round(d*360)}, ${Math.round(u*100)}%, ${Math.round(l*100)}%)`}case`rgb`:default:return e}},k=e=>({autoAccept:`Auto-accept edits mode indicator`,bashBorder:`Bash command border`,claude:`Claude branding color. Used for the Claude logo, the welcome message, and the thinking text.`,claudeShimmer:`Color used for the shimmering effect on the thinking verb.`,claudeBlue_FOR_SYSTEM_SPINNER:`System spinner color (blue variant)`,claudeBlueShimmer_FOR_SYSTEM_SPINNER:`System spinner shimmer color (blue variant)`,permission:`Permission prompt color`,permissionShimmer:`Permission prompt shimmer color`,planMode:`Plan mode indicator`,ide:`Color used for IDE-related messages.`,promptBorder:`Input prompt border color`,promptBorderShimmer:`Input prompt border shimmer color`,text:`Code color. Used in diffs.`,inverseText:`Inverse text color. Used for the text of tabs, where the background is filled in.`,inactive:`Inactive/dimmed text. Used for line numbers and less prominent text.`,subtle:`Subtle text. Used for help text and secondary information.`,suggestion:`Suggestion text color. Used for suggestions for theme names and various other things.`,remember:`Remember/note color. Used for various text relating to memories.`,background:`Background color for certain UI elements`,success:`Success indicator. Used for the bullet on successful tool calls, and various success messages (such as sign in successful).`,error:`Error indicator`,warning:`Warning indicator`,warningShimmer:`Warning shimmer color`,diffAdded:`Added diff background`,diffRemoved:`Removed diff background`,diffAddedDimmed:`Added diff background (dimmed)`,diffRemovedDimmed:`Removed diff background (dimmed)`,diffAddedWord:`Added word highlight`,diffRemovedWord:`Removed word highlight`,diffAddedWordDimmed:`Added word highlight (dimmed)`,diffRemovedWordDimmed:`Removed word highlight (dimmed)`,red_FOR_SUBAGENTS_ONLY:`Red color for sub agents`,blue_FOR_SUBAGENTS_ONLY:`Blue color for sub agents`,green_FOR_SUBAGENTS_ONLY:`Green color for sub agents`,yellow_FOR_SUBAGENTS_ONLY:`Yellow color for sub agents`,purple_FOR_SUBAGENTS_ONLY:`Purple color for sub agents`,orange_FOR_SUBAGENTS_ONLY:`Orange color for sub agents`,pink_FOR_SUBAGENTS_ONLY:`Pink color for sub agents`,cyan_FOR_SUBAGENTS_ONLY:`Cyan color for sub agents`,professionalBlue:`Professional blue color for business contexts?`,rainbow_red:`"ultrathink" rainbow - red`,rainbow_orange:`"ultrathink" rainbow - orange`,rainbow_yellow:`"ultrathink" rainbow - yellow`,rainbow_green:`"ultrathink" rainbow - green`,rainbow_blue:`"ultrathink" rainbow - blue`,rainbow_indigo:`"ultrathink" rainbow - indigo`,rainbow_violet:`"ultrathink" rainbow - violet`,rainbow_red_shimmer:`"ultrathink" rainbow (shimmer) - red`,rainbow_orange_shimmer:`"ultrathink" rainbow (shimmer) - orange`,rainbow_yellow_shimmer:`"ultrathink" rainbow (shimmer) - yellow`,rainbow_green_shimmer:`"ultrathink" rainbow (shimmer) - green`,rainbow_blue_shimmer:`"ultrathink" rainbow (shimmer) - blue`,rainbow_indigo_shimmer:`"ultrathink" rainbow (shimmer) - indigo`,rainbow_violet_shimmer:`"ultrathink" rainbow (shimmer) - violet`,clawd_body:`"Clawd" character body color`,clawd_background:`"Clawd" character background color`,userMessageBackground:`Background color for user messages`,bashMessageBackgroundColor:`Background color for bash command output`,memoryBackgroundColor:`Background color for memory/context information`,rate_limit_fill:`Rate limit indicator fill color`,rate_limit_empty:`Rate limit indicator empty/background color`})[e]||``,A=Math.max(...D.map(e=>e.length));return Y(B,{children:[Y(B,{flexDirection:`column`,width:`50%`,children:[J(B,{children:Y(X,{children:[`Editing theme “`,c.name,`” (`,c.id,`)`]})}),S?Y(B,{flexDirection:`column`,marginTop:1,children:[J(B,{marginBottom:1,children:Y(V,{bold:!0,children:[`Would you like to make “`,c.name,`” your current Claude Code theme?`]})}),J(ze,{items:[{name:`Yes`,desc:`Set ${c.id} as active theme`},{name:`No`,desc:`Go back without changing theme`}],selectedIndex:w,onSelect:ee,onSubmit:()=>{w===0&&t(c.id),C(!1),e()}}),J(V,{dimColor:!0,children:`enter to select, esc to cancel`})]}):p===null&&h===null?Y(q,{children:[Y(B,{marginBottom:1,flexDirection:`column`,children:[J(V,{dimColor:!0,children:`enter to edit theme name, id, or color`}),J(V,{dimColor:!0,children:`ctrl+a to toggle rgb, hex, hsl`}),J(V,{dimColor:!0,children:`paste color from clipboard (when on color)`}),J(V,{dimColor:!0,children:`esc to go back`})]}),d<2?Y(B,{marginBottom:1,borderStyle:`single`,borderTop:!1,borderBottom:!1,borderRight:!1,borderColor:`yellow`,flexDirection:`column`,paddingLeft:1,children:[J(V,{bold:!0,children:d===0?`Theme Name`:`Theme ID`}),J(V,{children:d===0?`The display name for this theme`:"Unique identifier for this theme; used in `.claude.json` to select the theme."})]}):Y(B,{marginBottom:1,borderStyle:`single`,borderTop:!1,borderBottom:!1,borderRight:!1,borderColor:c.colors[D[d-2]],flexDirection:`column`,paddingLeft:1,children:[J(Xe,{colorKey:D[d-2],theme:c,bold:!0}),J(V,{children:k(D[d-2])})]}),Y(B,{flexDirection:`column`,children:[Y(B,{children:[J(V,{color:d===0?`yellow`:`white`,children:d===0?`❯ `:` `}),J(V,{bold:!0,children:`Name: `}),J(V,{children:c.name})]}),Y(B,{marginBottom:1,children:[J(V,{color:d===1?`yellow`:`white`,children:d===1?`❯ `:` `}),J(V,{bold:!0,children:`ID: `}),J(V,{children:c.id})]}),(()=>{if(d<2)return Y(q,{children:[D.slice(0,20).map((e,t)=>{let n=t+2;return Y(B,{children:[J(V,{color:d===n?`yellow`:`white`,children:d===n?`❯ `:` `}),J(B,{width:A+2,children:J(V,{children:J(Xe,{colorKey:e,theme:c,bold:!0})})}),J(Q,{color:c.colors[e],children:O(c.colors[e],l)})]},e)}),D.length>20&&Y(V,{color:`gray`,dimColor:!0,children:[` `,`↓ `,D.length-20,` more below`]})]});let e=d-2,t=Math.max(0,e-10),n=Math.min(D.length,t+20),r=Math.max(0,n-20),i=D.slice(r,n);return Y(q,{children:[r>0&&Y(V,{color:`gray`,dimColor:!0,children:[` `,`↑ `,r,` more above`]}),i.map((e,t)=>{let n=r+t+2;return Y(B,{children:[J(V,{color:d===n?`yellow`:`white`,children:d===n?`❯ `:` `}),J(B,{width:A+2,children:J(V,{children:J(Xe,{colorKey:e,theme:c,bold:!0})})}),J(Q,{color:c.colors[e],children:O(c.colors[e],l)})]},e)}),n<D.length&&Y(V,{color:`gray`,dimColor:!0,children:[` `,`↓ `,D.length-n,` more below`]})]})})()]})]}):h?Y(B,{flexDirection:`column`,marginTop:1,children:[Y(V,{children:[`Editing `,h===`name`?`theme name`:`theme ID`,`:`]}),J(B,{borderStyle:`round`,borderColor:`yellow`,paddingX:1,children:J(V,{children:v})}),J(V,{dimColor:!0,children:`enter to save, esc to cancel`})]}):J(Ze,{initialValue:b,colorKey:D[p],theme:c,onColorChange:e=>{y(e),T(t=>{t.colors[D[p]]=e})},onExit:()=>{T(e=>{e.colors[D[p]]=v}),m(null),y(``),x(``)}})]}),J(B,{width:`50%`,children:J(Ye,{theme:c})})]})}const tt=`https://raw.githubusercontent.com/Piebald-AI/claude-code-themes/main`,nt=`${tt}/index.json`;async function rt(){F(`Fetching community theme index from ${nt}`);let e=await fetch(nt,{headers:{Accept:`application/json`}});if(!e.ok)throw Error(`Failed to fetch community theme index: ${e.status} ${e.statusText}`);return await e.json()}async function it(e){let t=`${tt}/themes/${e}.json`;F(`Fetching community theme from ${t}`);let n=await fetch(t,{headers:{Accept:`application/json`}});if(!n.ok)throw Error(`Failed to fetch community theme "${e}": ${n.status} ${n.statusText}`);return await n.json()}function at({onBack:e}){let{updateSettings:t}=W($),[n,r]=K({status:`loading`}),[i,a]=K(0),[o,s]=K(null),[c,l]=K(!1),[u,d]=K(null),f=Ce(0);G(()=>{rt().then(e=>{r({status:`loaded`,entries:e})}).catch(e=>{r({status:`error`,message:e.message})})},[]);let p=n.status===`loaded`?n.entries:[],m=xe(async e=>{let t=++f.current;l(!0),d(null);try{let n=await it(e);if(t!==f.current)return;s(te(n,E))}catch{if(t!==f.current)return;s(null),d(`Failed to load preview.`)}finally{t===f.current&&l(!1)}},[]),h=xe(async e=>{d(`Downloading theme…`);try{let n=te(await it(e.id),E),r=!1;t(e=>{e.themes.some(e=>e.id===n.id)||(e.themes.push(n),r=!0)}),d(r?`Added "${n.name}" to your themes!`:`Theme "${n.name}" (${n.id}) is already in your config.`)}catch{d(`Failed to download theme.`)}},[t]);return H((t,r)=>{if(r.escape){e();return}if(n.status!==`loaded`)return;let o=n.entries.length;if(o!==0){if(r.upArrow)a(e=>Math.max(0,e-1)),s(null),d(null);else if(r.downArrow)a(e=>Math.min(o-1,e+1)),s(null),d(null);else if(t===` `){let e=n.entries[i];e&&m(e.id)}else if(r.return){let e=n.entries[i];e&&h(e)}}}),n.status===`loading`?Y(B,{flexDirection:`column`,children:[J(X,{children:`Community Themes`}),J(V,{children:`Loading community themes…`})]}):n.status===`error`?Y(B,{flexDirection:`column`,children:[J(X,{children:`Community Themes`}),Y(V,{color:`red`,children:[`Error: `,n.message]}),J(V,{dimColor:!0,children:`esc to go back`})]}):Y(B,{children:[Y(B,{flexDirection:`column`,width:`50%`,children:[J(X,{children:`Community Themes`}),Y(B,{marginBottom:1,flexDirection:`column`,children:[J(V,{dimColor:!0,children:`space to preview theme`}),J(V,{dimColor:!0,children:`enter to download theme`}),J(V,{dimColor:!0,children:`esc to go back`})]}),J(B,{flexDirection:`column`,children:p.map((e,t)=>Y(V,{color:i===t?`yellow`:void 0,children:[i===t?`❯ `:` `,e.name,` (`,e.id,`) by @`,e.author]},e.id))}),u&&J(B,{marginTop:1,children:J(V,{color:`cyan`,children:u})}),c&&J(B,{marginTop:1,children:J(V,{dimColor:!0,children:`Loading preview…`})})]}),J(B,{width:`50%`,children:o?J(Ye,{theme:o}):J(B,{flexDirection:`column`,justifyContent:`center`,alignItems:`center`,height:10,children:J(V,{dimColor:!0,children:`Press space to preview the selected theme.`})})})]})}function ot(e){return e.map(e=>`${e.name} (${e.id})`)}function st({onBack:t}){let{settings:{themes:n},updateSettings:r}=W($),[i,a]=K(0),[o,s]=K(null),[c,l]=K(!0),[u,d]=K(!1),f=n.length+1,p=()=>{let t={colors:{...(n[0]||e.themes[0]).colors},name:`New Custom Theme`,id:`custom-${Date.now()}`};r(e=>{e.themes.push(t)}),s(t.id),l(!1)},m=e=>{n.length<=1||(r(t=>{t.themes=t.themes.filter(t=>t.id!==e)}),i>=n.length-1&&a(Math.max(0,n.length-2)))},h=()=>{r(t=>{t.themes=[...e.themes]}),a(0)},g=i===n.length;if(H((e,r)=>{if(r.escape)t();else if(r.upArrow)a(e=>Math.max(0,e-1));else if(r.downArrow)a(e=>Math.min(f-1,e+1));else if(r.return)if(g)d(!0),l(!1);else{let e=n[i];e&&(s(e.id),l(!1))}else if(e===`n`)p();else if(e===`d`){if(!g){let e=n[i];e&&m(e.id)}}else r.ctrl&&e===`r`&&h()},{isActive:c}),u)return J(at,{onBack:()=>{d(!1),l(!0)}});if(o)return J(et,{themeId:o,onBack:()=>{s(null),l(!0)}});let _=ot(n),v=n.find(e=>_[i]?.includes(`(${e.id})`))||n[0];return n.length===0?J(B,{children:Y(B,{flexDirection:`column`,width:`100%`,children:[J(X,{children:`Themes`}),Y(B,{marginBottom:1,flexDirection:`column`,children:[J(V,{dimColor:!0,children:`n to create a new theme`}),J(V,{dimColor:!0,children:`esc to go back`})]}),J(V,{children:`No themes available!`})]})}):Y(B,{children:[Y(B,{flexDirection:`column`,width:`50%`,children:[J(X,{children:`Themes`}),Y(B,{marginBottom:1,flexDirection:`column`,children:[J(V,{dimColor:!0,children:`n to create a new theme`}),J(V,{dimColor:!0,children:`d to delete a theme`}),J(V,{dimColor:!0,children:`ctrl+r to delete all themes and restore built-in`}),J(V,{dimColor:!0,children:`enter to edit theme`}),J(V,{dimColor:!0,children:`esc to go back`})]}),Y(B,{flexDirection:`column`,children:[_.map((e,t)=>Y(V,{color:i===t?`yellow`:void 0,children:[i===t?`❯ `:` `,e]},t)),Y(V,{color:g?`blue`:void 0,bold:g,children:[g?`❯ `:` `,`Browse community themes…`]})]})]}),J(B,{width:`50%`,children:g?J(B,{flexDirection:`column`,justifyContent:`center`,alignItems:`center`,height:10,children:J(V,{dimColor:!0,children:`Press enter to browse community themes.`})}):J(Ye,{theme:v})})]})}function ct({onBack:t}){let{settings:{thinkingVerbs:{format:n,verbs:r},themes:i},updateSettings:a}=W($),o=[`format`,`verbs`],[s,c]=K(0),l=o[s],[u,d]=K(0),[f,p]=K(!1),[m,h]=K(``),[g,_]=K(!1),[v,y]=K(!1),[b,x]=K(n),S=ee(),C=(i.find(e=>e.id===S)||i.find(e=>e.id===`dark`))?.colors.claude||`rgb(215,119,87)`;return H((i,s)=>{if(v){s.return?(a(e=>{e.thinkingVerbs.format=b}),y(!1)):s.escape?(x(n),y(!1)):s.backspace||s.delete?x(e=>e.slice(0,-1)):i&&x(e=>e+i);return}if(f||g){s.return&&m.trim()?(g?(a(e=>{e.thinkingVerbs.verbs.push(m.trim())}),_(!1)):(a(e=>{e.thinkingVerbs.verbs[u]=m.trim()}),p(!1)),h(``)):s.escape?(h(``),p(!1),_(!1)):s.backspace||s.delete?h(e=>e.slice(0,-1)):i&&h(e=>e+i);return}s.escape?t():s.return?l===`format`&&(x(n),y(!0)):s.tab?s.shift?c(e=>e===0?o.length-1:e-1):c(e=>e===o.length-1?0:e+1):s.upArrow?l===`verbs`&&r.length>0&&d(e=>e>0?e-1:r.length-1):s.downArrow?l===`verbs`&&r.length>0&&d(e=>e<r.length-1?e+1:0):i===`e`&&l===`verbs`?r.length>0&&(h(r[u]),p(!0)):i===`d`&&l===`verbs`?r.length>1&&(a(e=>{e.thinkingVerbs.verbs=e.thinkingVerbs.verbs.filter((e,t)=>t!==u)}),u>=r.length-1&&d(Math.max(0,r.length-2))):i===`n`&&l===`verbs`?(_(!0),h(``)):s.ctrl&&i===`r`&&l===`verbs`&&(a(t=>{t.thinkingVerbs.verbs=[...e.thinkingVerbs.verbs]}),d(0))}),Y(B,{children:[Y(B,{flexDirection:`column`,width:`50%`,children:[Y(B,{marginBottom:1,flexDirection:`column`,children:[J(X,{children:`Thinking Verbs`}),Y(B,{flexDirection:`column`,children:[J(V,{dimColor:!0,children:l===`format`?`enter to edit format`:`changes auto-saved`}),J(V,{dimColor:!0,children:`esc to go back`}),J(V,{dimColor:!0,children:`tab to switch sections`})]})]}),J(B,{marginBottom:1,children:J(V,{dimColor:!0,children:`Customize the verbs shown during generation and their format.`})}),Y(B,{flexDirection:`column`,children:[Y(V,{children:[J(V,{color:l===`format`?`yellow`:void 0,children:l===`format`?`❯ `:` `}),J(V,{bold:!0,color:l===`format`?`yellow`:void 0,children:`Format`})]}),l===`format`&&(v?Y(V,{dimColor:!0,children:[` `,`enter to save`]}):Y(V,{dimColor:!0,children:[` `,`enter to edit`]}))]}),J(B,{marginLeft:2,marginBottom:1,children:J(B,{borderStyle:`round`,borderColor:v?`yellow`:`gray`,children:J(V,{children:v?b:n})})}),J(B,{children:Y(V,{children:[J(V,{color:l===`verbs`?`yellow`:void 0,children:l===`verbs`?`❯ `:` `}),J(V,{bold:!0,color:l===`verbs`?`yellow`:void 0,children:`Verbs`})]})}),l===`verbs`&&J(B,{flexDirection:`column`,children:Y(V,{dimColor:!0,children:[` `,`e to edit · d to delete · n to add new · ctrl+r to reset`]})}),J(B,{marginLeft:2,marginBottom:1,children:Y(B,{flexDirection:`column`,children:[(()=>{let e=Math.max(0,u-4),t=Math.min(r.length,e+8),n=Math.max(0,t-8),i=r.slice(n,t);return Y(q,{children:[n>0&&Y(V,{color:`gray`,dimColor:!0,children:[` `,`↑ `,n,` more above`]}),i.map((e,t)=>{let r=n+t;return Y(V,{color:l===`verbs`&&r===u?`cyan`:void 0,children:[l===`verbs`&&r===u?`❯ `:` `,e]},r)}),t<r.length&&Y(V,{color:`gray`,dimColor:!0,children:[` `,`↓ `,r.length-t,` more below`]})]})})(),g&&Y(B,{alignItems:`center`,children:[J(V,{color:`yellow`,children:`❯ `}),J(B,{borderStyle:`round`,borderColor:`yellow`,children:J(V,{children:m})})]}),f&&Y(B,{marginTop:1,alignItems:`center`,children:[J(V,{children:`Editing: `}),J(B,{borderStyle:`round`,borderColor:`yellow`,children:J(V,{children:m})})]})]})})]}),Y(B,{width:`50%`,flexDirection:`column`,children:[J(B,{marginBottom:1,children:J(V,{bold:!0,children:`Preview`})}),J(B,{borderStyle:`single`,borderColor:`gray`,padding:1,flexDirection:`column`,children:Y(V,{children:[Y(V,{color:C,children:[`✻ `,n.replace(/\{\}/g,r[u]),` `]}),J(V,{children:`(esc to interrupt)`})]})})]})]})}const lt=e=>e.replace(/([a-z])([A-Z])/g,`$1 $2`).replace(/([A-Z])([A-Z][a-z])/g,`$1 $2`).replace(/(\d+)/g,` $1 `).replace(/\s+/g,` `).trim().replace(/^./,e=>e.toUpperCase()),ut=e=>{let t=Math.max(...e.map(e=>e.length));return e.map(e=>e.padEnd(t))},dt=Object.entries(Fe).map(([e,t])=>({name:lt(e),phases:t.frames.map(e=>e.trimEnd()),reverseMirror:!1,updateInterval:t.interval})),ft=[{name:`Default`,phases:e.thinkingStyle.phases,reverseMirror:e.thinkingStyle.reverseMirror},{name:`Wave`,phases:[`▁`,`▃`,`▄`,`▅`,`▆`,`▇`,`█`],reverseMirror:!0},{name:`Glow`,phases:[`░`,`▒`,`▓`,`█`],reverseMirror:!0},{name:`Partial block`,phases:[`▏`,`▎`,`▍`,`▌`,`▋`,`▊`,`▉`,`█`],reverseMirror:!0},{name:`Colors`,phases:[`🔴`,`🟠`,`🟡`,`🟢`,`🔵`,`🟣`],reverseMirror:!1},...dt];function pt({onBack:t}){let{settings:{thinkingStyle:{phases:n,updateInterval:r,reverseMirror:i},themes:a},updateSettings:o}=W($),s=[`reverseMirror`,`updateInterval`,`phases`,`presets`],[c,l]=K(0),u=s[c],[d,f]=K(0),[p,m]=K(0),[h,g]=K(!1),[_,v]=K(``),[y,b]=K(!1),[x,S]=K(!1),[C,w]=K(r.toString()),[T,E]=K(0),D=ee(),O=(a.find(e=>e.id===D)||a.find(e=>e.id===`dark`))?.colors.claude||`rgb(215,119,87)`;G(()=>{if(n.length>0){let e=i?[...n,...[...n].reverse().slice(1,-1)]:n,t=setInterval(()=>{E(t=>(t+1)%e.length)},r);return()=>clearInterval(t)}},[n,r,i]),H((i,a)=>{if(x){if(a.return){let e=parseInt(C);!isNaN(e)&&e>0&&o(t=>{t.thinkingStyle.updateInterval=e}),S(!1)}else a.escape?(w(r.toString()),S(!1)):a.backspace||a.delete?w(e=>e.slice(0,-1)):i&&i.match(/^[0-9]$/)&&w(e=>e+i);return}if(h||y){if(a.return&&_.length){let e=y?[...n,_]:n.map((e,t)=>t===d?_:e);o(t=>{t.thinkingStyle.phases=ut(e)}),g(!1),v(``)}else a.escape?(v(``),g(!1),b(!1)):a.backspace||a.delete?v(e=>e.slice(0,-1)):i&&v(e=>e+i);return}if(a.escape)t();else if(a.return)if(u===`updateInterval`)w(r.toString()),S(!0);else if(u===`presets`){let e=ft[p];o(t=>{t.thinkingStyle.phases=ut([...e.phases]),t.thinkingStyle.reverseMirror=e.reverseMirror,e.updateInterval!==void 0&&(t.thinkingStyle.updateInterval=e.updateInterval)})}else u===`reverseMirror`&&o(e=>{e.thinkingStyle.reverseMirror=!e.thinkingStyle.reverseMirror});else if(a.tab)a.shift?l(e=>e===0?s.length-1:e-1):l(e=>e===s.length-1?0:e+1);else if(a.upArrow)u===`phases`&&n.length>0?f(e=>e>0?e-1:n.length-1):u===`presets`&&m(e=>e>0?e-1:ft.length-1);else if(a.downArrow)u===`phases`&&n.length>0?f(e=>e<n.length-1?e+1:0):u===`presets`&&m(e=>e<ft.length-1?e+1:0);else if(i===` `)u===`reverseMirror`&&o(e=>{e.thinkingStyle.reverseMirror=!e.thinkingStyle.reverseMirror});else if(i===`e`&&u===`phases`)n.length>0&&(v(n[d]),g(!0));else if(i===`a`&&u===`phases`)b(!0),v(``);else if(i===`d`&&u===`phases`)n.length>1&&(o(e=>{e.thinkingStyle.phases=ut(n.filter((e,t)=>t!==d))}),d>=n.length&&f(Math.max(0,n.length-1)));else if(i===`w`&&u===`phases`){if(d>0){let e=[...n];[e[d-1],e[d]]=[e[d],e[d-1]],o(t=>{t.thinkingStyle.phases=e}),f(e=>e-1)}}else if(i===`s`&&u===`phases`){if(d<n.length-1){let e=[...n];[e[d],e[d+1]]=[e[d+1],e[d]],o(t=>{t.thinkingStyle.phases=e}),f(e=>e+1)}}else a.ctrl&&i===`r`&&(o(t=>{t.thinkingStyle=e.thinkingStyle}),f(0),m(0))});let k=i?`●`:`○`,A=(()=>i?[...n,...[...n].reverse().slice(1,-1)]:n)(),j=A.length>0?A[T]:`·`;return J(B,{children:Y(B,{flexDirection:`column`,width:`100%`,children:[Y(B,{flexDirection:`row`,width:`100%`,children:[Y(B,{marginBottom:1,flexDirection:`column`,width:`50%`,children:[J(X,{children:`Thinking style`}),Y(B,{flexDirection:`column`,children:[Y(V,{dimColor:!0,children:[`enter to`,` `,u===`updateInterval`?`edit interval`:u===`presets`?`apply preset`:`save`]}),J(V,{dimColor:!0,children:`esc to go back`}),J(V,{dimColor:!0,children:`tab to switch sections`})]})]}),Y(B,{width:`50%`,flexDirection:`column`,children:[J(B,{children:J(V,{bold:!0,children:`Preview`})}),Y(B,{borderStyle:`single`,borderColor:`gray`,paddingX:1,flexDirection:`row`,children:[J(B,{width:(j?.length??0)+1,children:J(V,{color:O,children:j})}),Y(V,{children:[J(V,{color:O,children:`Thinking… `}),J(V,{children:`(esc to interrupt)`})]})]})]})]}),Y(B,{flexDirection:`row`,gap:4,children:[Y(B,{flexDirection:`column`,children:[Y(V,{children:[J(V,{color:u===`reverseMirror`?`yellow`:void 0,children:u===`reverseMirror`?`❯ `:` `}),J(V,{bold:!0,color:u===`reverseMirror`?`yellow`:void 0,children:`Reverse-mirror phases`})]}),u===`reverseMirror`&&Y(V,{dimColor:!0,children:[` `,`space to toggle`]}),J(B,{marginLeft:2,marginBottom:1,children:Y(V,{children:[k,` `,i?`Enabled`:`Disabled`]})})]}),Y(B,{flexDirection:`column`,children:[Y(V,{children:[J(V,{color:u===`updateInterval`?`yellow`:void 0,children:u===`updateInterval`?`❯ `:` `}),J(V,{bold:!0,color:u===`updateInterval`?`yellow`:void 0,children:`Update interval (ms)`})]}),u===`updateInterval`&&(x?Y(V,{dimColor:!0,children:[` `,`enter to save`]}):Y(V,{dimColor:!0,children:[` `,`enter to edit`]})),J(B,{marginLeft:2,marginBottom:1,children:J(B,{borderStyle:`round`,borderColor:x?`yellow`:`gray`,children:J(V,{children:x?C:r})})})]})]}),J(B,{children:Y(V,{children:[J(V,{color:u===`phases`?`yellow`:void 0,children:u===`phases`?`❯ `:` `}),J(V,{bold:!0,color:u===`phases`?`yellow`:void 0,children:`Phases`})]})}),u===`phases`&&J(B,{marginBottom:1,flexDirection:`column`,children:Y(V,{dimColor:!0,children:[` `,`[e]dit`,` `,`[a]dd`,` `,`[d]elete`,` `,`[w]move up`,` `,`[s]move down`]})}),J(B,{marginLeft:2,marginBottom:1,children:Y(B,{flexDirection:`column`,children:[(()=>{let e=Math.max(0,d-4),t=Math.min(n.length,e+8),r=Math.max(0,t-8),i=n.slice(r,t);return Y(q,{children:[r>0&&Y(V,{color:`gray`,dimColor:!0,children:[` `,`↑ `,r,` more above`]}),i.map((e,t)=>{let n=r+t;return Y(V,{color:u===`phases`&&n===d?`cyan`:void 0,children:[u===`phases`&&n===d?`❯ `:` `,e]},n)}),t<n.length&&Y(V,{color:`gray`,dimColor:!0,children:[` `,`↓ `,n.length-t,` more below`]})]})})(),y&&Y(B,{children:[J(V,{color:`yellow`,children:`❯ `}),J(B,{borderStyle:`round`,borderColor:`yellow`,children:J(V,{children:_})})]}),h&&Y(B,{marginTop:1,children:[J(V,{children:`Editing: `}),J(B,{borderStyle:`round`,borderColor:`yellow`,children:J(V,{children:_})})]})]})}),J(B,{children:Y(V,{children:[J(V,{color:u===`presets`?`yellow`:void 0,children:u===`presets`?`❯ `:` `}),J(V,{bold:!0,color:u===`presets`?`yellow`:void 0,children:`Presets`})]})}),u===`presets`&&Y(V,{dimColor:!0,children:[` `,`Selecting one will overwrite your choice of phases and interval`]}),J(B,{marginLeft:2,marginBottom:1,children:J(B,{flexDirection:`column`,children:(()=>{let e=Math.max(0,p-6),t=Math.min(ft.length,e+12),n=Math.max(0,t-12),r=ft.slice(n,t),i=e=>{let t=e.phases.join(``);return t.length>30?t.slice(0,27)+`…`:t};return Y(q,{children:[n>0&&Y(V,{color:`gray`,dimColor:!0,children:[` `,`↑ `,n,` more above`]}),r.map((e,t)=>{let r=n+t,a=u===`presets`&&r===p;return Y(V,{color:a?`cyan`:void 0,children:[a?`❯ `:` `,e.name,` `,i(e)]},r)}),t<ft.length&&Y(V,{color:`gray`,dimColor:!0,children:[` `,`↓ `,ft.length-t,` more below`]})]})})()})}),J(B,{marginTop:1,children:J(V,{dimColor:!0,children:`ctrl+r to reset all settings to default`})})]})})}function mt(e,t){let n=Ce(!0);G(()=>{if(n.current){n.current=!1;return}return e()},t)}const ht=[{label:`bold`,value:`bold`},{label:`italic`,value:`italic`},{label:`underline`,value:`underline`},{label:`strikethrough`,value:`strikethrough`},{label:`inverse`,value:`inverse`}],gt=[{label:`none`,value:`none`},{label:`single`,value:`single`},{label:`double`,value:`double`},{label:`round`,value:`round`},{label:`bold`,value:`bold`},{label:`singleDouble`,value:`singleDouble`},{label:`doubleSingle`,value:`doubleSingle`},{label:`classic`,value:`classic`},{label:`topBottomSingle`,value:`topBottomSingle`},{label:`topBottomDouble`,value:`topBottomDouble`},{label:`topBottomBold`,value:`topBottomBold`}];function _t({onBack:t}){let{settings:n,updateSettings:r}=W($),[i,a]=K(!1),[o,s]=K(!1),[c,l]=K(!1),[u,d]=K(()=>n.userMessageDisplay.format),[f,p]=K(()=>n.userMessageDisplay.paddingX===`default`?`default`:`custom`),[m,h]=K(()=>n.userMessageDisplay.paddingY===`default`?`default`:`custom`),[g,_]=K(()=>n.userMessageDisplay.paddingX===`default`?`0`:String(n.userMessageDisplay.paddingX)),[v,y]=K(()=>n.userMessageDisplay.paddingY===`default`?`0`:String(n.userMessageDisplay.paddingY)),[b,x]=K(n.userMessageDisplay.fitBoxToContent),[S,C]=K(0),[w,T]=K(()=>[...n.userMessageDisplay.styling]),[E,D]=K(()=>n.userMessageDisplay.foregroundColor===`default`?`default`:`custom`),[O,k]=K(()=>n.userMessageDisplay.foregroundColor===`default`?`rgb(255,255,255)`:n.userMessageDisplay.foregroundColor),[A,j]=K(()=>{let e=n.userMessageDisplay.backgroundColor;return e===null?`none`:e===`default`?`default`:`custom`}),[M,te]=K(()=>{let e=n.userMessageDisplay.backgroundColor;return e===null||e===`default`?`rgb(0,0,0)`:e}),[N,P]=K(()=>gt.findIndex(e=>e.value===n.userMessageDisplay.borderStyle)),[F,ne]=K(()=>n.userMessageDisplay.borderColor),[re,ie]=K(null),[ae,oe]=K(``),se=ee(),ce=n.themes?.find(e=>e.id===se)||n.themes?.[0],[I,L]=K(`text`),R=[`format`,`styling`,`foreground`,`background`],le=[`borderStyle`,`borderColor`,`paddingX`,`paddingY`,`fitBoxToContent`],[ue,de]=K(0),[fe,pe]=K(0),z=I===`text`?R[ue]:le[fe],me=()=>{r(e=>{e.userMessageDisplay.format=u,e.userMessageDisplay.styling=[...w],e.userMessageDisplay.foregroundColor=E===`default`?`default`:O,e.userMessageDisplay.backgroundColor=A===`none`?null:A===`default`?`default`:M,e.userMessageDisplay.borderStyle=gt[N].value,e.userMessageDisplay.borderColor=F,e.userMessageDisplay.paddingX=f===`default`?`default`:parseInt(g)||0,e.userMessageDisplay.paddingY=m===`default`?`default`:parseInt(v)||0,e.userMessageDisplay.fitBoxToContent=b})},he=()=>{d(e.userMessageDisplay.format),T([...e.userMessageDisplay.styling]);let t=e.userMessageDisplay.foregroundColor;D(t===`default`?`default`:`custom`),k(t===`default`?`rgb(255,255,255)`:t);let n=e.userMessageDisplay.backgroundColor;j(n===null?`none`:n===`default`?`default`:`custom`),te(n===null||n===`default`?`rgb(0,0,0)`:n),P(gt.findIndex(t=>t.value===e.userMessageDisplay.borderStyle)),ne(e.userMessageDisplay.borderColor);let i=e.userMessageDisplay.paddingX,a=e.userMessageDisplay.paddingY;p(i===`default`?`default`:`custom`),h(a===`default`?`default`:`custom`),_(i===`default`?`0`:String(i)),y(a===`default`?`0`:String(a)),x(e.userMessageDisplay.fitBoxToContent),r(t=>{t.userMessageDisplay={...e.userMessageDisplay}})};mt(()=>{me()},[u,w,E,O,A,M,N,F,f,m,g,v,b]),H((e,r)=>{if(i){r.return?a(!1):r.escape?(d(n.userMessageDisplay.format),a(!1)):r.backspace||r.delete?d(e=>e.slice(0,-1)):e&&d(t=>t+e);return}if(o){r.return?s(!1):r.escape?(_(String(n.userMessageDisplay.paddingX)),s(!1)):r.backspace||r.delete?_(e=>e.slice(0,-1)):e&&/^\d$/.test(e)&&_(t=>t+e);return}if(c){r.return?l(!1):r.escape?(y(String(n.userMessageDisplay.paddingY)),l(!1)):r.backspace||r.delete?y(e=>e.slice(0,-1)):e&&/^\d$/.test(e)&&y(t=>t+e);return}if(re===null){if(r.escape)t();else if(r.ctrl&&e===`r`)he();else if(r.leftArrow||r.rightArrow)L(e=>e===`text`?`border`:`text`);else if(r.tab)I===`text`?r.shift?de(e=>e===0?R.length-1:e-1):de(e=>e===R.length-1?0:e+1):r.shift?pe(e=>e===0?le.length-1:e-1):pe(e=>e===le.length-1?0:e+1);else if(r.return)z===`format`?a(!0):z===`paddingX`?f===`custom`&&s(!0):z===`paddingY`?m===`custom`&&l(!0):z===`foreground`?E===`custom`&&(oe(O),ie(`foreground`)):z===`background`?A===`custom`&&(oe(M),ie(`background`)):z===`borderColor`&&(oe(F),ie(`border`));else if(r.upArrow)z===`styling`?C(e=>Math.max(0,e-1)):z===`borderStyle`?P(e=>e===0?gt.length-1:e-1):z===`paddingX`?p(e=>e===`default`?`custom`:`default`):z===`paddingY`?h(e=>e===`default`?`custom`:`default`):z===`foreground`?D(e=>{let t=e===`default`?`custom`:`default`;return t===`custom`&&(!O||O===``)&&k(`rgb(255,255,255)`),t}):z===`background`&&j(e=>{let t=e===`default`?`custom`:e===`custom`?`none`:`default`;return t===`custom`&&(!M||M===``)&&te(`rgb(0,0,0)`),t});else if(r.downArrow)z===`styling`?C(e=>Math.min(ht.length-1,e+1)):z===`borderStyle`?P(e=>e===gt.length-1?0:e+1):z===`paddingX`?p(e=>e===`default`?`custom`:`default`):z===`paddingY`?h(e=>e===`default`?`custom`:`default`):z===`foreground`?D(e=>{let t=e===`default`?`custom`:`default`;return t===`custom`&&(!O||O===``)&&k(`rgb(255,255,255)`),t}):z===`background`&&j(e=>{let t=e===`default`?`none`:e===`none`?`custom`:`default`;return t===`custom`&&(!M||M===``)&&te(`rgb(0,0,0)`),t});else if(e===` `)if(z===`styling`){let e=ht[S].value;T(w.indexOf(e)>=0?w.filter(t=>t!==e):[...w,e])}else z===`fitBoxToContent`&&x(e=>!e)}});let ge=e=>{let t=E===`default`?ce?.colors?.text:O,n=A===`none`?void 0:A===`default`?ce?.colors?.userMessageBackground:M,r=gt[N].value,i=f===`default`?0:parseInt(g)||0,a=m===`default`?0:parseInt(v)||0,o=f===`default`?1:i,s=J(V,{bold:w.includes(`bold`),italic:w.includes(`italic`),underline:w.includes(`underline`),strikethrough:w.includes(`strikethrough`),inverse:w.includes(`inverse`),color:t,backgroundColor:n,children:e});if(r===`topBottomSingle`||r===`topBottomDouble`||r===`topBottomBold`){let t=r===`topBottomSingle`?`─`:r===`topBottomDouble`?`═`:`━`,n=e.length+i*2,o=t.repeat(n);return Y(B,{flexDirection:`column`,children:[J(V,{color:F,children:o}),a>0&&J(B,{height:a}),J(B,{paddingX:i,children:s}),a>0&&J(B,{height:a}),J(V,{color:F,children:o})]})}else if(r!==`none`||i>0||a>0||o>0||b){let e={};i>0&&(e.paddingX=i),f===`default`&&i===0&&(e.paddingRight=o),a>0&&(e.paddingY=a);let t=Object.keys(e).length>0?J(B,{...e,children:s}):s,n={};return r!==`none`&&(n.borderStyle=r,n.borderColor=F),b?n.alignSelf=`flex-start`:n.flexGrow=1,r===`none`?t:J(B,{...n,children:t})}else return s};return re?J(Ze,{initialValue:ae,theme:ce,onColorChange:e=>{re===`foreground`?k(e):re===`background`?te(e):re===`border`&&ne(e)},onExit:()=>{ie(null),oe(``)}}):Y(B,{flexDirection:`column`,children:[J(X,{children:`Customize how user messages are displayed`}),Y(B,{flexDirection:`column`,marginBottom:1,children:[J(V,{dimColor:!0,children:`left/right arrows to switch columns · tab to navigate options`}),J(V,{dimColor:!0,children:`enter to edit · ctrl+r to reset · esc to go back`})]}),Y(B,{flexDirection:`row`,gap:1,children:[Y(B,{flexDirection:`column`,width:`50%`,borderStyle:I===`text`?`round`:`single`,borderColor:I===`text`?`yellow`:`gray`,paddingX:1,children:[J(B,{marginBottom:1,children:J(V,{bold:!0,color:I===`text`?`yellow`:void 0,children:`Text & Styling`})}),J(B,{children:Y(V,{color:z===`format`?`yellow`:void 0,bold:z===`format`,children:[z===`format`?`❯ `:` `,`Format String`]})}),z===`format`&&J(B,{marginLeft:2,children:J(V,{dimColor:!0,children:i?`enter to save · esc to cancel`:`enter to edit · use {} as message placeholder`})}),J(B,{marginLeft:2,marginBottom:1,children:J(B,{borderStyle:`round`,borderColor:i?`yellow`:`gray`,children:J(V,{children:u})})}),J(B,{children:Y(V,{color:z===`styling`?`yellow`:void 0,bold:z===`styling`,children:[z===`styling`?`❯ `:` `,`Styling`]})}),z===`styling`&&J(B,{marginLeft:2,children:J(V,{dimColor:!0,children:`up/down to navigate · space to toggle`})}),J(B,{marginLeft:2,marginBottom:1,flexDirection:`column`,children:ht.map((e,t)=>J(B,{children:Y(V,{color:z===`styling`&&S===t?`cyan`:void 0,children:[z===`styling`&&S===t?`❯ `:` `,w.includes(e.value)?`●`:`○`,` `,e.label]})},e.value))}),Y(B,{flexDirection:`row`,gap:1,marginBottom:1,children:[Y(B,{flexDirection:`column`,width:`50%`,children:[J(B,{children:Y(V,{color:z===`foreground`?`yellow`:void 0,bold:z===`foreground`,children:[z===`foreground`?`❯ `:` `,`Foreground`]})}),z===`foreground`&&J(B,{marginLeft:2,children:Y(V,{dimColor:!0,children:[`up/down · `,E===`custom`?`enter`:``]})}),Y(B,{marginLeft:2,flexDirection:`column`,children:[J(B,{children:Y(V,{children:[E===`default`?`● `:`○ `,`Default`]})}),J(B,{children:Y(V,{children:[E===`custom`?`● `:`○ `,`Custom`,E===`custom`&&`: `,E===`custom`&&J(V,{color:O,children:O})]})})]})]}),Y(B,{flexDirection:`column`,width:`50%`,children:[J(B,{children:Y(V,{color:z===`background`?`yellow`:void 0,bold:z===`background`,children:[z===`background`?`❯ `:` `,`Background`]})}),z===`background`&&J(B,{marginLeft:2,children:Y(V,{dimColor:!0,children:[`up/down · `,A===`custom`?`enter`:``]})}),Y(B,{marginLeft:2,flexDirection:`column`,children:[J(B,{children:Y(V,{children:[A===`default`?`● `:`○ `,`Default`]})}),J(B,{children:Y(V,{children:[A===`none`?`● `:`○ `,`None`]})}),J(B,{children:Y(V,{children:[A===`custom`?`● `:`○ `,`Custom`,A===`custom`&&`: `,A===`custom`&&J(V,{backgroundColor:M,children:M})]})})]})]})]})]}),Y(B,{flexDirection:`column`,width:`50%`,borderStyle:I===`border`?`round`:`single`,borderColor:I===`border`?`yellow`:`gray`,paddingX:1,children:[J(B,{marginBottom:1,children:J(V,{bold:!0,color:I===`border`?`yellow`:void 0,children:`Border & Padding`})}),J(B,{children:Y(V,{color:z===`borderStyle`?`yellow`:void 0,bold:z===`borderStyle`,children:[z===`borderStyle`?`❯ `:` `,`Border Style`]})}),z===`borderStyle`&&J(B,{marginLeft:2,children:J(V,{dimColor:!0,children:`up/down to navigate`})}),Y(B,{marginLeft:2,marginBottom:1,flexDirection:`row`,children:[J(B,{flexDirection:`column`,width:`50%`,children:gt.slice(0,6).map((e,t)=>J(B,{children:Y(V,{color:z===`borderStyle`&&N===t?`cyan`:void 0,children:[z===`borderStyle`&&N===t?`❯ `:` `,N===t?`● `:`○ `,e.label]})},e.value))}),J(B,{flexDirection:`column`,width:`50%`,children:gt.slice(6).map((e,t)=>{let n=t+6;return J(B,{children:Y(V,{color:z===`borderStyle`&&N===n?`cyan`:void 0,children:[z===`borderStyle`&&N===n?`❯ `:` `,N===n?`● `:`○ `,e.label]})},e.value)})})]}),J(B,{children:Y(V,{color:z===`borderColor`?`yellow`:void 0,bold:z===`borderColor`,children:[z===`borderColor`?`❯ `:` `,`Border Color`]})}),z===`borderColor`&&J(B,{marginLeft:2,children:J(V,{dimColor:!0,children:`enter to pick color`})}),J(B,{marginLeft:2,marginBottom:1,children:J(V,{color:F,children:F})}),Y(B,{flexDirection:`row`,gap:1,children:[Y(B,{flexDirection:`column`,width:`33%`,children:[J(B,{children:Y(V,{color:z===`paddingX`?`yellow`:void 0,bold:z===`paddingX`,children:[z===`paddingX`?`❯ `:` `,`Padding X`]})}),z===`paddingX`&&J(B,{marginLeft:2,children:J(V,{dimColor:!0,children:o?`enter/esc`:f===`custom`?`up/down · enter`:`up/down`})}),Y(B,{marginLeft:2,flexDirection:`column`,children:[J(B,{children:Y(V,{children:[f===`default`?`● `:`○ `,`Default`]})}),J(B,{children:Y(V,{children:[f===`custom`?`● `:`○ `,`Custom`]})}),f===`custom`&&J(B,{children:J(B,{borderStyle:`round`,borderColor:o?`yellow`:`gray`,children:J(V,{children:g})})})]})]}),Y(B,{flexDirection:`column`,width:`33%`,children:[J(B,{children:Y(V,{color:z===`paddingY`?`yellow`:void 0,bold:z===`paddingY`,children:[z===`paddingY`?`❯ `:` `,`Padding Y`]})}),z===`paddingY`&&J(B,{marginLeft:2,children:J(V,{dimColor:!0,children:c?`enter/esc`:m===`custom`?`up/down · enter`:`up/down`})}),Y(B,{marginLeft:2,flexDirection:`column`,children:[J(B,{children:Y(V,{children:[m===`default`?`● `:`○ `,`Default`]})}),J(B,{children:Y(V,{children:[m===`custom`?`● `:`○ `,`Custom`]})}),m===`custom`&&J(B,{children:J(B,{borderStyle:`round`,borderColor:c?`yellow`:`gray`,children:J(V,{children:v})})})]})]}),Y(B,{flexDirection:`column`,width:`33%`,children:[J(B,{children:Y(V,{color:z===`fitBoxToContent`?`yellow`:void 0,bold:z===`fitBoxToContent`,children:[z===`fitBoxToContent`?`❯ `:` `,b?`●`:`○`,` Fit box to content`]})}),z===`fitBoxToContent`&&J(B,{marginLeft:2,children:J(V,{dimColor:!0,children:`space`})})]})]})]})]}),Y(B,{flexDirection:`column`,marginTop:1,paddingX:1,children:[J(B,{marginBottom:1,children:J(V,{bold:!0,children:`Preview`})}),Y(B,{flexDirection:`row`,gap:2,children:[Y(B,{flexDirection:`column`,width:`50%`,children:[J(B,{marginBottom:1,children:J(V,{underline:!0,children:`Before (Claude Code default):`})}),J(B,{marginLeft:1,children:Y(V,{backgroundColor:ce?.colors?.userMessageBackground,color:ce?.colors?.text,children:[` `,`> list the dir`,` `]})}),J(B,{marginLeft:1,marginTop:1,children:Y(V,{children:[J(V,{color:ce?.colors?.inactive||`#888888`,children:`●`}),J(V,{children:` The directory `}),J(V,{color:ce?.colors?.permission||`#00ff00`,children:`C:\\Users\\user`}),J(V,{children:` contains `}),J(V,{bold:!0,children:`123`}),J(V,{children:` files.`})]})})]}),Y(B,{flexDirection:`column`,width:`50%`,children:[J(B,{marginBottom:1,children:J(V,{underline:!0,children:`After (Your customization):`})}),J(B,{marginLeft:1,flexDirection:`row`,children:(()=>ge(u.replace(/\{\}/g,`list the dir`)))()}),J(B,{marginLeft:1,marginTop:1,children:Y(V,{children:[J(V,{color:ce?.colors?.inactive||`#888888`,children:`●`}),J(V,{children:` The directory `}),J(V,{color:ce?.colors?.permission||`#00ff00`,children:`C:\\Users\\user`}),J(V,{children:` contains `}),J(V,{bold:!0,children:`123`}),J(V,{children:` files.`})]})})]})]})]})]})}const vt=[{label:`bold`,value:`bold`},{label:`italic`,value:`italic`},{label:`underline`,value:`underline`},{label:`strikethrough`,value:`strikethrough`},{label:`inverse`,value:`inverse`}],yt=[[`name`,`regex`,`regexFlags`],[`format`,`styling`],[`foreground`,`background`],[`enabled`],[`testText`]];function bt({testText:e,regex:t,regexFlags:n,format:r,styling:i,foregroundColor:a,backgroundColor:o}){let s=[];try{let c=n.includes(`g`)?n:n+`g`,l=new RegExp(t,c),u=[...e.matchAll(l)];if(u.length===0)return J(V,{children:e});let d=0;return u.forEach((t,n)=>{let c=t.index,l=c+t[0].length;c>d&&s.push(J(V,{children:e.slice(d,c)},`plain-${n}`));let u=r.replace(/\{MATCH\}/g,t[0]);s.push(J(V,{bold:i.includes(`bold`),italic:i.includes(`italic`),underline:i.includes(`underline`),strikethrough:i.includes(`strikethrough`),inverse:i.includes(`inverse`),color:a,backgroundColor:o,children:u},`match-${n}`)),d=l}),d<e.length&&s.push(J(V,{children:e.slice(d)},`plain-end`)),J(q,{children:s})}catch{return J(V,{children:e})}}function xt({highlighterIndex:e,onBack:t}){let{settings:n,updateSettings:r}=W($),i=n.inputPatternHighlighters[e],a=ee(),o=n.themes?.find(e=>e.id===a)||n.themes?.[0],[s,c]=K(i?.name||`New Highlighter`),[l,u]=K(i?.regex||``),[d,f]=K(i?.regexFlags||`g`),[p,m]=K(i?.format||`{MATCH}`),[h,g]=K(i?.styling||[]),[_,v]=K(i?.foregroundColor===null?`none`:`custom`),[y,b]=K(i?.foregroundColor||`rgb(255,0,255)`),[x,S]=K(i?.backgroundColor?`custom`:`none`),[C,w]=K(i?.backgroundColor||`rgb(0,0,0)`),[T,E]=K(i?.enabled??!0),[D,O]=K(n.inputPatternHighlightersTestText||`Type test text here to see highlighting`),[k,A]=K(`name`),[j,M]=K(!1),[te,N]=K(0),[P,F]=K(null),[ne,re]=K(``),[ie,ae]=K(null),[oe,se]=K(0),[ce,I]=K(0);if(G(()=>{let e=yt[oe];A(e[Math.min(ce,e.length-1)])},[oe,ce]),G(()=>{if(!l){ae(null);return}try{new RegExp(l,d),ae(null)}catch(e){ae(e.message)}},[l,d]),G(()=>{e>=0&&r(t=>{t.inputPatternHighlighters[e]&&(t.inputPatternHighlighters[e]={name:s,regex:l,regexFlags:d,format:p,styling:h,foregroundColor:_===`custom`?y:null,backgroundColor:x===`custom`?C:null,enabled:T})})},[e,s,l,d,p,h,_,y,x,C,T]),G(()=>{r(e=>{e.inputPatternHighlightersTestText=D})},[D]),H((e,r)=>{if(j){r.return?M(!1):r.escape?(k===`name`&&c(i?.name||``),k===`regex`&&u(i?.regex||``),k===`regexFlags`&&f(i?.regexFlags||`g`),k===`format`&&m(i?.format||`{MATCH}`),k===`testText`&&O(n.inputPatternHighlightersTestText||`Type test text here to see highlighting`),M(!1)):r.backspace||r.delete?(k===`name`&&c(e=>e.slice(0,-1)),k===`regex`&&u(e=>e.slice(0,-1)),k===`regexFlags`&&f(e=>e.slice(0,-1)),k===`format`&&m(e=>e.slice(0,-1)),k===`testText`&&O(e=>e.slice(0,-1))):e&&e.length===1&&(k===`name`&&c(t=>t+e),k===`regex`&&u(t=>t+e),k===`regexFlags`&&f(t=>t+e),k===`format`&&m(t=>t+e),k===`testText`&&O(t=>t+e));return}if(P===null){if(r.escape)t();else if(r.upArrow)k===`styling`&&te>0?N(e=>e-1):se(e=>Math.max(0,e-1));else if(r.downArrow)k===`styling`&&te<vt.length-1?N(e=>e+1):se(e=>Math.min(yt.length-1,e+1));else if(r.leftArrow)k===`foreground`?v(e=>e===`none`?`custom`:`none`):k===`background`?S(e=>e===`none`?`custom`:`none`):I(e=>Math.max(0,e-1));else if(r.rightArrow)if(k===`foreground`)v(e=>e===`none`?`custom`:`none`);else if(k===`background`)S(e=>e===`none`?`custom`:`none`);else{let e=yt[oe].length-1;I(t=>Math.min(e,t+1))}else if(r.tab){let e=yt.flat(),t=e.indexOf(k);if(r.shift){if(t>0){let n=e[t-1];for(let e=0;e<yt.length;e++){let t=yt[e].indexOf(n);if(t>=0){se(e),I(t);break}}}}else if(t<e.length-1){let n=e[t+1];for(let e=0;e<yt.length;e++){let t=yt[e].indexOf(n);if(t>=0){se(e),I(t);break}}}}else if(r.return)k===`name`||k===`regex`||k===`regexFlags`||k===`format`||k===`testText`?M(!0):k===`foreground`&&_===`custom`?(re(y),F(`foreground`)):k===`background`&&x===`custom`&&(re(C),F(`background`));else if(e===` `)if(k===`styling`){let e=vt[te].value;h.includes(e)?g(h.filter(t=>t!==e)):g([...h,e])}else k===`enabled`&&E(!T)}}),!i)return J(B,{flexDirection:`column`,children:J(V,{color:`red`,children:`Highlighter not found`})});if(P)return J(Ze,{initialValue:ne,theme:o,onColorChange:e=>{P===`foreground`?b(e):P===`background`&&w(e)},onExit:()=>{F(null),re(``)}});let L=e=>k===e,R=e=>({color:L(e)?`yellow`:void 0,bold:L(e)});return Y(B,{flexDirection:`column`,children:[J(X,{children:`Edit Highlighter`}),J(B,{marginBottom:1,flexDirection:`column`,children:J(V,{dimColor:!0,children:`arrows to navigate · enter to edit · space to toggle · esc to go back`})}),Y(B,{flexDirection:`row`,gap:2,marginBottom:1,children:[Y(B,{flexDirection:`column`,width:`30%`,children:[Y(V,{...R(`name`),children:[L(`name`)?`❯ `:` `,`Name`]}),J(B,{marginLeft:2,children:J(B,{borderStyle:`round`,borderColor:L(`name`)?j?`green`:`yellow`:`gray`,children:J(V,{children:s||`(empty)`})})})]}),Y(B,{flexDirection:`column`,width:`45%`,children:[Y(V,{...R(`regex`),children:[L(`regex`)?`❯ `:` `,`Regex Pattern`]}),Y(B,{marginLeft:2,flexDirection:`column`,children:[J(B,{borderStyle:`round`,borderColor:L(`regex`)?j?`green`:`yellow`:ie?`red`:`gray`,children:J(V,{children:l||`(empty)`})}),ie&&J(V,{color:`red`,children:ie})]})]}),Y(B,{flexDirection:`column`,width:`20%`,children:[Y(V,{...R(`regexFlags`),children:[L(`regexFlags`)?`❯ `:` `,`Flags`]}),J(B,{marginLeft:2,children:J(B,{borderStyle:`round`,borderColor:L(`regexFlags`)?j?`green`:`yellow`:`gray`,children:J(V,{children:d||`g`})})})]})]}),Y(B,{flexDirection:`row`,gap:2,marginBottom:1,children:[Y(B,{flexDirection:`column`,width:`50%`,children:[Y(V,{...R(`format`),children:[L(`format`)?`❯ `:` `,`Format String`]}),J(B,{marginLeft:2,children:J(B,{borderStyle:`round`,borderColor:L(`format`)?j?`green`:`yellow`:`gray`,children:J(V,{children:p||`{MATCH}`})})}),L(`format`)&&J(B,{marginLeft:2,children:Y(V,{dimColor:!0,children:[`use `,`{MATCH}`,` as placeholder`]})})]}),Y(B,{flexDirection:`column`,width:`45%`,children:[Y(V,{...R(`styling`),children:[L(`styling`)?`❯ `:` `,`Styling`]}),J(B,{marginLeft:2,flexDirection:`column`,children:vt.map((e,t)=>{let n=h.includes(e.value),r=L(`styling`)&&te===t;return Y(V,{color:r?`cyan`:void 0,children:[r?`❯ `:` `,n?`●`:`○`,` `,e.label]},e.value)})})]})]}),Y(B,{flexDirection:`row`,gap:2,marginBottom:1,children:[Y(B,{flexDirection:`column`,width:`48%`,children:[Y(V,{...R(`foreground`),children:[L(`foreground`)?`❯ `:` `,`Foreground Color`]}),Y(B,{marginLeft:2,flexDirection:`row`,gap:1,children:[Y(V,{color:L(`foreground`)?`yellow`:void 0,children:[`[`,_===`none`?`●`:`○`,`] none`,` `,`[`,_===`custom`?`●`:`○`,`] custom`]}),_===`custom`&&J(B,{borderStyle:`round`,borderColor:L(`foreground`)?`yellow`:`gray`,children:J(V,{color:y,children:` ████ `})})]})]}),Y(B,{flexDirection:`column`,width:`48%`,children:[Y(V,{...R(`background`),children:[L(`background`)?`❯ `:` `,`Background Color`]}),Y(B,{marginLeft:2,flexDirection:`row`,gap:1,children:[Y(V,{color:L(`background`)?`yellow`:void 0,children:[`[`,x===`none`?`●`:`○`,`] none`,` `,`[`,x===`custom`?`●`:`○`,`] custom`]}),x===`custom`&&J(B,{borderStyle:`round`,borderColor:L(`background`)?`yellow`:`gray`,children:Y(V,{backgroundColor:C,children:[` `,` `,` `]})})]})]})]}),J(B,{marginBottom:1,children:Y(V,{...R(`enabled`),children:[L(`enabled`)?`❯ `:` `,`Enabled:`,` `,J(V,{color:T?`green`:`red`,children:T?`● Yes`:`○ No`})]})}),Y(B,{flexDirection:`column`,marginBottom:1,children:[Y(V,{...R(`testText`),children:[L(`testText`)?`❯ `:` `,`Test Text`]}),J(B,{marginLeft:2,children:J(B,{borderStyle:`round`,borderColor:L(`testText`)?j?`green`:`yellow`:`gray`,children:J(V,{children:D||`(empty)`})})})]}),J(B,{borderStyle:`round`,padding:1,children:Y(B,{flexDirection:`column`,children:[J(V,{bold:!0,children:`Live Preview:`}),l?J(B,{marginTop:1,children:J(bt,{testText:D,regex:l,regexFlags:d,format:p,styling:h,foregroundColor:_===`custom`?y:void 0,backgroundColor:x===`custom`?C:void 0})}):J(V,{dimColor:!0,children:`Enter a regex pattern to see the preview`})]})})]})}function St({onBack:t}){let{settings:{inputPatternHighlighters:n,themes:r},updateSettings:i}=W($),a=ee(),o=r.find(e=>e.id===a)||r[0],s=e.themes[0],c=o?.colors.success||s.colors.success,l=o?.colors.error||s.colors.error,[u,d]=K(0),[f,p]=K(null),[m,h]=K(!0),g=()=>{let e={name:`New Highlighter`,regex:``,regexFlags:`g`,format:`{MATCH}`,styling:[],foregroundColor:`rgb(255,0,255)`,backgroundColor:null,enabled:!0};i(t=>{t.inputPatternHighlighters.push(e)}),p(n.length),h(!1)},_=e=>{i(t=>{t.inputPatternHighlighters.splice(e,1)}),u>=n.length-1&&d(Math.max(0,n.length-2))},v=e=>{i(t=>{t.inputPatternHighlighters[e].enabled=!t.inputPatternHighlighters[e].enabled})},y=e=>{e<=0||(i(t=>{let n=t.inputPatternHighlighters[e];t.inputPatternHighlighters.splice(e,1),t.inputPatternHighlighters.splice(e-1,0,n)}),d(e-1))},b=e=>{e>=n.length-1||(i(t=>{let n=t.inputPatternHighlighters[e];t.inputPatternHighlighters.splice(e,1),t.inputPatternHighlighters.splice(e+1,0,n)}),d(e+1))};return H((e,r)=>{r.escape?t():r.upArrow?d(e=>Math.max(0,e-1)):r.downArrow&&n.length>0?d(e=>Math.min(n.length-1,e+1)):r.return&&n.length>0?(p(u),h(!1)):e===`n`?g():e===`x`&&n.length>0?_(u):e===` `&&n.length>0?v(u):e===`u`&&n.length>0&&u>0?y(u):e===`d`&&n.length>0&&u<n.length-1&&b(u)},{isActive:m}),f===null?Y(B,{flexDirection:`column`,children:[J(X,{children:`Input Pattern Highlighters`}),Y(B,{marginBottom:1,flexDirection:`column`,children:[J(V,{dimColor:!0,children:`Create custom highlighters for patterns in your input prompt.`}),J(V,{dimColor:!0,children:`Matched text will be styled and optionally reformatted.`})]}),Y(B,{marginBottom:1,flexDirection:`column`,children:[J(V,{dimColor:!0,children:`n to create a new highlighter`}),n.length>0&&J(V,{dimColor:!0,children:`space to toggle enabled/disabled`}),n.length>0&&J(V,{dimColor:!0,children:`u/d to move highlighter up/down`}),n.length>0&&J(V,{dimColor:!0,children:`x to delete a highlighter`}),n.length>0&&J(V,{dimColor:!0,children:`enter to edit highlighter`}),J(V,{dimColor:!0,children:`esc to go back`})]}),n.length===0?J(V,{children:`No highlighters created yet. Press n to create one.`}):J(B,{flexDirection:`column`,children:n.map((e,t)=>{let n=u===t,r;return n&&(r=`yellow`),Y(B,{flexDirection:`row`,children:[Y(V,{color:r,children:[n?`❯ `:` `,e.enabled?`● `:`○ `,e.name,` `]}),J(V,{dimColor:!0,children:`(`}),e.regex?Y(V,{dimColor:!0,children:[`/`,e.regex,`/`,e.regexFlags]}):J(V,{dimColor:!0,children:`(no regex)`}),e.styling.length>0&&J(q,{children:Y(V,{color:r,dimColor:!e.enabled,children:[` `,`· `,e.styling.join(`, `)]})}),J(V,{dimColor:!0,children:`)`}),e.enabled?J(V,{color:c,children:` enabled`}):J(V,{color:l,children:` disabled`})]},t)})})]}):J(xt,{highlighterIndex:f,onBack:()=>{p(null),h(!0)}})}const Ct=[null,1,5,10,25,50,100,200,250,500,1e3],wt=1e3;function Tt({onSubmit:e}){let{settings:t,updateSettings:n}=W($),[r,i]=K(0),[a,o]=K(!1),s={showTweakccVersion:!0,showPatchesApplied:!0,expandThinkingBlocks:!0,enableConversationTitle:!0,hideStartupBanner:!1,hideCtrlGToEdit:!1,hideStartupClawd:!1,increaseFileReadLimit:!1,suppressLineNumbers:!1,suppressRateLimitOptions:!1,mcpConnectionNonBlocking:!0,mcpServerBatchSize:null,statuslineThrottleMs:null,statuslineUseFixedInterval:!1,tableFormat:`default`,enableSwarmMode:!0,enableSessionMemory:!0,enableDreamMode:!0,enableLeanMemoryTypes:!1,fixSummarizeFromHere:!0,fixRewindSummaryHeader:!0,enableRememberSkill:!1,tokenCountRounding:null,autoAcceptPlanMode:!1,allowBypassPermissionsInSudo:!1,suppressNativeInstallerWarning:!1,filterScrollEscapeSequences:!1,enableWorktreeMode:!0,allowCustomAgentModels:!1,enableContextLimitOverride:!1,enableModelCustomizations:!0,enableVoiceMode:!1,enableVoiceConciseOutput:!0,enableChannelsMode:!1,maxEffortDefault:!1,autoModeClassifierModel:`default`,suppressDeferredTools:!1,claudemdContextOncePerConversation:!0},c=()=>{t.misc||={...s}},l=e=>{let t=[`default`,`sonnet`,`haiku`];return t[(t.indexOf(e)+1)%t.length]},u=e=>{switch(e){case`sonnet`:return`Sonnet 4.6`;case`haiku`:return`Haiku 4.5`;case`default`:default:return`Default (main-loop model)`}},d=e=>{let t=[`default`,`ascii`,`clean`,`clean-top-bottom`];return t[(t.indexOf(e)+1)%t.length]},f=e=>{switch(e){case`ascii`:return`ASCII (| and -)`;case`clean`:return`Clean (no row separators)`;case`clean-top-bottom`:return`Clean with top/bottom`;case`default`:default:return`Default (box-drawing)`}},p=e=>e===null?`Default (3)`:e<=3?`${e} (conservative)`:e<=8?`${e} (recommended)`:`${e} (aggressive)`,m=e=>e===null?`Disabled`:e===0?`0ms (instant)`:`${e}ms`,h=e=>e===null?`Off (exact counts)`:`Round to ${e}`,g=(e,t)=>{let n=Ct.indexOf(e);if(n===-1)return Ct[0];let r;return r=t===`next`?(n+1)%Ct.length:(n-1+Ct.length)%Ct.length,Ct[r]},_=Se(()=>[{id:`removeBorder`,title:`Remove input box border`,description:`Removes the rounded border around the input box for a cleaner look.`,getValue:()=>t.inputBox?.removeBorder??!1,toggle:()=>{n(e=>{e.inputBox||={removeBorder:!1},e.inputBox.removeBorder=!e.inputBox.removeBorder})}},{id:`showVersion`,title:`Show tweakcc version at startup`,description:`Shows the blue "+ tweakcc v<VERSION>" message when starting Claude Code.`,getValue:()=>t.misc?.showTweakccVersion??!0,toggle:()=>{n(e=>{c(),e.misc.showTweakccVersion=!e.misc.showTweakccVersion})}},{id:`showPatches`,title:`Show patches applied indicator at startup`,description:`Shows the green "tweakcc patches are applied" indicator when starting Claude Code.`,getValue:()=>t.misc?.showPatchesApplied??!0,toggle:()=>{n(e=>{c(),e.misc.showPatchesApplied=!e.misc.showPatchesApplied})}},{id:`expandThinking`,title:`Expand thinking blocks`,description:`Makes thinking blocks always expanded by default instead of collapsed.`,getValue:()=>t.misc?.expandThinkingBlocks??!0,toggle:()=>{n(e=>{c(),e.misc.expandThinkingBlocks=!e.misc.expandThinkingBlocks})}},{id:`conversationTitle`,title:`Allow renaming sessions via /title`,description:`Enables /title and /rename commands for manually naming conversations.`,getValue:()=>t.misc?.enableConversationTitle??!0,toggle:()=>{n(e=>{c(),e.misc.enableConversationTitle=!e.misc.enableConversationTitle})}},{id:`enableModelCustomizations`,title:`Enable model customizations (/model shows all models)`,description:`Show all Claude models in /model menu, not just the latest 3. Disable to use Claude Code default model list.`,getValue:()=>t.misc?.enableModelCustomizations??!0,toggle:()=>{n(e=>{c(),e.misc.enableModelCustomizations=!e.misc.enableModelCustomizations})}},{id:`hideStartupBanner`,title:`Hide startup banner`,description:`Hides the startup banner message displayed before first prompt.`,getValue:()=>t.misc?.hideStartupBanner??!1,toggle:()=>{n(e=>{c(),e.misc.hideStartupBanner=!e.misc.hideStartupBanner})}},{id:`hideCtrlG`,title:`Hide ctrl-g to edit prompt hint`,description:`Hides the "ctrl-g to edit prompt" hint shown during streaming.`,getValue:()=>t.misc?.hideCtrlGToEdit??!1,toggle:()=>{n(e=>{c(),e.misc.hideCtrlGToEdit=!e.misc.hideCtrlGToEdit})}},{id:`hideClawd`,title:`Hide startup Clawd ASCII art`,description:`Hides the Clawd ASCII art character shown at startup.`,getValue:()=>t.misc?.hideStartupClawd??!1,toggle:()=>{n(e=>{c(),e.misc.hideStartupClawd=!e.misc.hideStartupClawd})}},{id:`increaseFileReadLimit`,title:`Increase file read token limit`,description:`Increases the maximum file read limit from 25,000 to 1,000,000 tokens.`,getValue:()=>t.misc?.increaseFileReadLimit??!1,toggle:()=>{n(e=>{c(),e.misc.increaseFileReadLimit=!e.misc.increaseFileReadLimit})}},{id:`suppressLineNumbers`,title:`Suppress line numbers in file reads/edits`,description:`Removes line number prefixes from file content to reduce token usage.`,getValue:()=>t.misc?.suppressLineNumbers??!1,toggle:()=>{n(e=>{c(),e.misc.suppressLineNumbers=!e.misc.suppressLineNumbers})}},{id:`suppressRateLimitOptions`,title:`Suppress rate limit options popup`,description:`Prevents the automatic /rate-limit-options command from being triggered when hitting rate limits.`,getValue:()=>t.misc?.suppressRateLimitOptions??!1,toggle:()=>{n(e=>{c(),e.misc.suppressRateLimitOptions=!e.misc.suppressRateLimitOptions})}},{id:`mcpNonBlocking`,title:`Non-blocking MCP startup`,description:`Start immediately while MCP servers connect in background. Reduces startup time ~50% with multiple MCPs.`,getValue:()=>t.misc?.mcpConnectionNonBlocking??!0,toggle:()=>{n(e=>{c(),e.misc.mcpConnectionNonBlocking=!e.misc.mcpConnectionNonBlocking})}},{id:`mcpBatchSize`,title:`MCP server batch size`,description:`Parallel MCP connections (1-20). Use ←/→ to adjust. Higher = faster startup, more resources.`,getValue:()=>t.misc?.mcpServerBatchSize??null,getDisplayValue:()=>p(t.misc?.mcpServerBatchSize??null),toggle:()=>{n(e=>{c(),e.misc.mcpServerBatchSize=null})},increment:()=>{n(e=>{c();let t=e.misc.mcpServerBatchSize??3;e.misc.mcpServerBatchSize=Math.min(20,t+1)})},decrement:()=>{n(e=>{c();let t=(e.misc.mcpServerBatchSize??3)-1;e.misc.mcpServerBatchSize=t<1?null:t})}},{id:`tableFormat`,title:`Table output format`,description:`Controls how Claude formats tables. Default: full borders. ASCII: | and -. Clean: no top/bottom/row separators. Clean+top/bottom: borders but no row separators.`,getValue:()=>t.misc?.tableFormat??`default`,isMultiValue:!0,getDisplayValue:()=>f(t.misc?.tableFormat??`default`),toggle:()=>{n(e=>{c(),e.misc.tableFormat=d(e.misc.tableFormat??`default`)})}},{id:`enableWorktreeMode`,title:`Enable worktree mode (EnterWorktree tool)`,description:`Force-enable the EnterWorktree tool for isolated git worktree sessions by bypassing the tengu_worktree_mode feature flag.`,getValue:()=>t.misc?.enableWorktreeMode??!0,toggle:()=>{n(e=>{c(),e.misc.enableWorktreeMode=!e.misc.enableWorktreeMode})}},{id:`enableVoiceMode`,title:`Enable voice mode (/voice command)`,description:`Force-enable the /voice command by bypassing the tengu_amber_quartz feature gate.`,getValue:()=>t.misc?.enableVoiceMode??!1,toggle:()=>{n(e=>{c(),e.misc.enableVoiceMode=!e.misc.enableVoiceMode})}},{id:`enableVoiceConciseOutput`,title:`Enable concise output for voice mode`,description:`Enable the concise-output prompt used for voice interactions. Only applies when voice mode is enabled.`,getValue:()=>t.misc?.enableVoiceConciseOutput??!0,toggle:()=>{n(e=>{c(),e.misc.enableVoiceConciseOutput=!e.misc.enableVoiceConciseOutput})}},{id:`enableChannelsMode`,title:`Enable channels mode (MCP channel notifications)`,description:`Force-enable MCP channel notifications by bypassing the tengu_harbor feature gate, allowlist, and permission relay.`,getValue:()=>t.misc?.enableChannelsMode??!1,toggle:()=>{n(e=>{c(),e.misc.enableChannelsMode=!e.misc.enableChannelsMode})}},{id:`enableContextLimitOverride`,title:`Override context limit`,description:`Replaces the default model context limit with CLAUDE_CODE_CONTEXT_LIMIT env var. Must be exported manually before launching CC, or falls back to 200K.`,getValue:()=>t.misc?.enableContextLimitOverride??!1,toggle:()=>{n(e=>{c(),e.misc.enableContextLimitOverride=!e.misc.enableContextLimitOverride})}},{id:`statuslineThrottle`,title:`Statusline throttle`,description:`Throttle statusline updates (0-${wt}ms). Use ←/→ to adjust by 50ms. Space to disable. 0 = instant updates.`,getValue:()=>t.misc?.statuslineThrottleMs??null,getDisplayValue:()=>m(t.misc?.statuslineThrottleMs??null),toggle:()=>{n(e=>{c(),e.misc.statuslineThrottleMs=e.misc.statuslineThrottleMs===null?300:null})},increment:()=>{n(e=>{c();let t=e.misc.statuslineThrottleMs??300;e.misc.statuslineThrottleMs=Math.min(wt,t+50)})},decrement:()=>{n(e=>{c();let t=e.misc.statuslineThrottleMs??300;e.misc.statuslineThrottleMs=Math.max(0,t-50)})}},{id:`statuslineFixedInterval`,title:`Statusline fixed interval mode`,description:`Use setInterval instead of throttle. Updates happen on a fixed schedule rather than on-demand.`,getValue:()=>t.misc?.statuslineUseFixedInterval??!1,toggle:()=>{n(e=>{c(),e.misc.statuslineUseFixedInterval=!e.misc.statuslineUseFixedInterval})}},{id:`enableSessionMemory`,title:`Enable session memory`,description:`Force-enable session memory (auto-extraction + past session search) by bypassing the tengu_session_memory and tengu_coral_fern statsig flags.`,getValue:()=>t.misc?.enableSessionMemory??!0,toggle:()=>{n(e=>{c(),e.misc.enableSessionMemory=!e.misc.enableSessionMemory})}},{id:`enableDreamMode`,title:`Enable dream mode`,description:`Force-enable dream (/dream + auto-dream background memory consolidation) by bypassing the tengu_onyx_plover statsig gate. On/off still follows autoDreamEnabled in ~/.claude/settings.json.`,getValue:()=>t.misc?.enableDreamMode??!0,toggle:()=>{n(e=>{c(),e.misc.enableDreamMode=!e.misc.enableDreamMode})}},{id:`fixSummarizeFromHere`,title:`Fix "Summarize from here"`,description:`Make "Summarize from here" summarize only the messages after the rewind point instead of the whole conversation.`,getValue:()=>t.misc?.fixSummarizeFromHere??!0,toggle:()=>{n(e=>{c(),e.misc.fixSummarizeFromHere=!(e.misc.fixSummarizeFromHere??!0)})}},{id:`fixRewindSummaryHeader`,title:`Honest rewind summary header`,description:`Label a rewind summary as a deliberate rewind (you continued forward, then rewound and chose to carry the summary forward) instead of the misleading "ran out of context" header.`,getValue:()=>t.misc?.fixRewindSummaryHeader??!0,toggle:()=>{n(e=>{c(),e.misc.fixRewindSummaryHeader=!(e.misc.fixRewindSummaryHeader??!0)})}},{id:`enableLeanMemoryTypes`,title:`Enable lean memory types`,description:`Force the tengu_ochre_finch statsig gate: memory prompts carry a compact "Types of memory" list and the full taxonomy moves to the on-demand memory-types skill.`,getValue:()=>t.misc?.enableLeanMemoryTypes??!1,toggle:()=>{n(e=>{c(),e.misc.enableLeanMemoryTypes=!e.misc.enableLeanMemoryTypes})}},{id:`enableRememberSkill`,title:`Enable remember skill`,description:`Register a "remember" skill to review session memories and update CLAUDE.local.md with learnings from past sessions.`,getValue:()=>t.misc?.enableRememberSkill??!1,toggle:()=>{n(e=>{c(),e.misc.enableRememberSkill=!e.misc.enableRememberSkill})}},{id:`tokenCountRounding`,title:`Token count rounding`,description:`Round displayed token counts to nearest multiple. Use ←/→ to cycle: Off, 1, 5, 10, 25, 50, 100, 200, 250, 500, 1000.`,getValue:()=>t.misc?.tokenCountRounding??null,getDisplayValue:()=>h(t.misc?.tokenCountRounding??null),toggle:()=>{n(e=>{c(),e.misc.tokenCountRounding=null})},increment:()=>{n(e=>{c(),e.misc.tokenCountRounding=g(e.misc.tokenCountRounding??null,`next`)})},decrement:()=>{n(e=>{c(),e.misc.tokenCountRounding=g(e.misc.tokenCountRounding??null,`prev`)})}},{id:`autoAcceptPlanMode`,title:`Auto-accept plan mode`,description:`Automatically accept plans without the "Ready to code?" confirmation prompt.`,getValue:()=>t.misc?.autoAcceptPlanMode??!1,toggle:()=>{n(e=>{c(),e.misc.autoAcceptPlanMode=!e.misc.autoAcceptPlanMode})}},{id:`allowBypassPermissionsInSudo`,title:`Allow bypassing permissions in sudo`,description:`⚠️ WARNING: Disables a security check. When enabled, Claude can perform system-level operations without prompts. Use extreme caution.`,getValue:()=>t.misc?.allowBypassPermissionsInSudo??!1,toggle:()=>{t.misc?.allowBypassPermissionsInSudo??!1?n(e=>{c(),e.misc.allowBypassPermissionsInSudo=!1}):o(!0)}},{id:`suppressNativeInstallerWarning`,title:`Suppress native installer warning`,description:`Suppress the native installer warning message at startup.`,getValue:()=>t.misc?.suppressNativeInstallerWarning??!1,toggle:()=>{n(e=>{c(),e.misc.suppressNativeInstallerWarning=!e.misc.suppressNativeInstallerWarning})}},{id:`filterScrollEscapeSequences`,title:`Filter scroll escape sequences`,description:`Filter out terminal escape sequences that cause unwanted scrolling.`,getValue:()=>t.misc?.filterScrollEscapeSequences??!1,toggle:()=>{n(e=>{c(),e.misc.filterScrollEscapeSequences=!e.misc.filterScrollEscapeSequences})}},{id:`allowCustomAgentModels`,title:`Allow custom agent models`,description:`Allow arbitrary model names in custom agent frontmatter (e.g. gemini-2.5-flash). Useful with a local proxy for non-Claude models.`,getValue:()=>t.misc?.allowCustomAgentModels??!1,toggle:()=>{n(e=>{c(),e.misc.allowCustomAgentModels=!e.misc.allowCustomAgentModels})}},{id:`maxEffortDefault`,title:`Default Opus 4.7 to max effort`,description:`Patches CC so Opus 4.7 sessions default to "max" reasoning effort instead of "xhigh". /effort and CLAUDE_CODE_EFFORT_LEVEL still override at runtime.`,getValue:()=>t.misc?.maxEffortDefault??!1,toggle:()=>{n(e=>{c(),e.misc.maxEffortDefault=!e.misc.maxEffortDefault})}},{id:`autoModeClassifierModel`,title:`Auto-mode classifier model`,description:`Pin auto-mode bash safety classifier to a fixed model. Default routes to your main-loop model (e.g. Opus 4.7), which gets denied as "temporarily unavailable" when that model is congested. Sonnet/Haiku have more headroom and the binary XML classifier task fits either.`,getValue:()=>t.misc?.autoModeClassifierModel??`default`,getDisplayValue:()=>u(t.misc?.autoModeClassifierModel??`default`),toggle:()=>{n(e=>{c(),e.misc.autoModeClassifierModel=l(e.misc.autoModeClassifierModel??`default`)})}}],[t,n]),v=_.length,y=v-1,b=Se(()=>r<4?0:Math.min(r-4+1,v-4),[r,v]),x=_.slice(b,b+4),S=b>0,C=b+4<v;return H((t,s)=>{a?s.return?(n(e=>{c(),e.misc.allowBypassPermissionsInSudo=!0}),o(!1)):s.escape&&o(!1):s.return||s.escape?e():s.upArrow?i(e=>Math.max(0,e-1)):s.downArrow?i(e=>Math.min(y,e+1)):t===` `?_[r]?.toggle():s.rightArrow?_[r]?.increment?.():s.leftArrow&&_[r]?.decrement?.()}),J(B,{flexDirection:`column`,children:a?J(B,{flexDirection:`column`,paddingX:2,children:Y(B,{borderStyle:`double`,borderColor:`yellow`,padding:2,flexDirection:`column`,children:[J(B,{marginBottom:1,children:J(V,{bold:!0,color:`yellow`,children:`SECURITY WARNING`})}),J(B,{marginBottom:1,children:J(V,{children:`You are about to enable a feature that allows Claude Code to bypass permission checks when running with sudo privileges.`})}),J(B,{marginBottom:1,children:J(V,{color:`red`,children:`This means Claude can perform system-level operations without any prompts or confirmation.`})}),J(B,{marginBottom:1,children:J(V,{bold:!0,children:`Use with extreme caution.`})}),J(B,{children:Y(V,{children:[`Press `,J(V,{color:`red`,children:`Enter`}),` to enable,`,` `,J(V,{color:`green`,children:`Escape`}),` to cancel`]})})]})}):Y(q,{children:[J(B,{marginBottom:1,children:J(X,{children:`Miscellaneous Settings`})}),J(B,{marginBottom:1,children:J(V,{dimColor:!0,children:`Use ↑/↓ to navigate, space to toggle, ←/→ to adjust numbers, enter to go back.`})}),S&&J(B,{children:Y(V,{dimColor:!0,children:[` ↑ `,b,` more above`]})}),x.map((e,t)=>{let n=b+t===r,i=e.getValue(),a=!!e.getDisplayValue,o=!!e.increment,s;s=o?`◆`:a?`◉`:i?`☑`:`☐`;let c;c=a?e.getDisplayValue():typeof i==`boolean`?i?`Enabled`:`Disabled`:String(i??`Default`);let l=n&&o?` ← → `:``;return Y(B,{flexDirection:`column`,children:[J(B,{children:Y(V,{children:[J(V,{color:n?`cyan`:void 0,children:n?`❯ `:` `}),J(V,{bold:!0,color:n?`cyan`:void 0,children:e.title})]})}),J(B,{children:Y(V,{dimColor:!0,children:[` `,e.description]})}),J(B,{marginLeft:4,marginBottom:1,children:Y(V,{children:[s,` `,c,J(V,{dimColor:!0,children:l})]})})]},e.id)}),C&&J(B,{children:Y(V,{dimColor:!0,children:[` `,`↓ `,v-b-4,` more below`]})}),J(B,{marginTop:1,children:Y(V,{dimColor:!0,children:[`Item `,r+1,` of `,v]})})]})})}const Et=`AgentOutputTool.AskUserQuestion.Bash.BashOutputTool.Edit.EnterPlanMode.ExitPlanMode.Glob.Grep.KillShell.ListMcpResourcesTool.LSP.NotebookEdit.Read.ReadMcpResourceTool.Skill.Task.TaskCreate.TaskGet.TaskList.TaskOutput.TaskStop.TaskUpdate.Teammate.TodoWrite.ToolSearch.WebFetch.WebSearch.Write`.split(`.`);function Dt({toolsetIndex:e,onBack:t}){let{settings:n,updateSettings:r}=W($),i=n.toolsets[e],[a,o]=K(i?.name||`New Toolset`),[s,c]=K(i?.allowedTools||[]),[l,u]=K(!1),[d,f]=K(0);G(()=>{i&&r(t=>{let n=t.toolsets[e].name;t.toolsets[e].name=a,t.toolsets[e].allowedTools=s,n!==a&&(t.defaultToolset===n&&(t.defaultToolset=a),t.planModeToolset===n&&(t.planModeToolset=a))})},[a,s]);let p=e=>s===`*`?!0:s.includes(e),m=e=>{e===`All`?c(`*`):e===`None`?c([]):s===`*`?c(Et.filter(t=>t!==e)):s.includes(e)?c(s.filter(t=>t!==e)):c([...s,e])};if(H((e,n)=>{if(l){n.return?u(!1):n.escape?(o(i?.name||`New Toolset`),u(!1)):n.backspace||n.delete?o(e=>e.slice(0,-1)):e&&e.length===1&&o(t=>t+e);return}if(n.escape)t();else if(n.upArrow)f(e=>Math.max(0,e-1));else if(n.downArrow)f(e=>Math.min(Et.length+1,e+1));else if(e===` `||n.return)if(d===0)m(`All`);else if(d===1)m(`None`);else{let e=Et[d-2];e&&m(e)}else e===`n`&&u(!0)}),!i)return J(B,{flexDirection:`column`,children:J(V,{color:`red`,children:`Toolset not found`})});let h=s===`*`,g=Array.isArray(s)&&s.length===0;return Y(B,{flexDirection:`column`,children:[J(X,{children:`Edit Toolset`}),J(B,{marginBottom:1,flexDirection:`column`,children:J(V,{dimColor:!0,children:`n to edit name · space/enter to toggle · esc to go back`})}),Y(B,{marginBottom:1,flexDirection:`column`,children:[J(V,{bold:!0,children:`Name:`}),J(B,{marginLeft:2,children:J(B,{borderStyle:`round`,borderColor:l?`yellow`:`gray`,children:J(V,{children:a})})}),l&&J(B,{marginLeft:2,children:J(V,{dimColor:!0,children:`enter to save · esc to cancel`})})]}),Y(B,{marginBottom:1,flexDirection:`column`,children:[J(V,{bold:!0,children:`Allowed Tools:`}),J(B,{marginLeft:2,children:Y(V,{color:d===0?`cyan`:void 0,children:[d===0?`❯ `:` `,h?`●`:`○`,` All`]})}),J(B,{marginLeft:2,children:Y(V,{color:d===1?`cyan`:void 0,children:[d===1?`❯ `:` `,g?`●`:`○`,` None`]})}),Et.map((e,t)=>{let n=t+2;return J(B,{marginLeft:2,children:Y(V,{color:d===n?`cyan`:void 0,children:[d===n?`❯ `:` `,p(e)?`◉`:`○`,` `,e]})},e)})]}),J(B,{borderStyle:`round`,padding:1,marginTop:1,children:Y(B,{flexDirection:`column`,children:[J(V,{bold:!0,children:`Summary:`}),Y(V,{children:[`Name: `,J(V,{color:`cyan`,children:a})]}),Y(V,{children:[`Tools:`,` `,s===`*`?J(V,{color:`green`,children:`All tools (*)`}):s.length===0?J(V,{color:`red`,children:`No tools ([])`}):Y(V,{color:`yellow`,children:[s.length,` selected`]})]})]})})]})}function Ot({onBack:t}){let{settings:{toolsets:n,defaultToolset:r,planModeToolset:i,themes:a},updateSettings:o}=W($),s=ee(),c=a.find(e=>e.id===s)||a[0],l=e.themes[0],u=c?.colors.planMode||l.colors.planMode,d=c?.colors.autoAccept||l.colors.autoAccept,[f,p]=K(0),[m,h]=K(null),[g,_]=K(!0),v=()=>{let e={name:`New Toolset`,allowedTools:[]};o(t=>{t.toolsets.push(e)}),h(n.length),_(!1)},y=e=>{let t=n[e];o(n=>{n.toolsets.splice(e,1),n.defaultToolset===t.name&&(n.defaultToolset=null),n.planModeToolset===t.name&&(n.planModeToolset=null)}),f>=n.length-1&&p(Math.max(0,n.length-2))},b=e=>{let t=n[e];o(e=>{e.defaultToolset=t.name})},x=e=>{let t=n[e];o(e=>{e.planModeToolset=t.name})};if(H((e,r)=>{r.escape?t():r.upArrow?p(e=>Math.max(0,e-1)):r.downArrow?p(e=>Math.min(n.length-1,e+1)):r.return&&n.length>0?(h(f),_(!1)):e===`n`?v():e===`x`&&n.length>0?y(f):e===`d`&&n.length>0?b(f):e===`p`&&n.length>0&&x(f)},{isActive:g}),m!==null)return J(Dt,{toolsetIndex:m,onBack:()=>{h(null),_(!0)}});let S=e=>e.allowedTools===`*`?`All tools`:e.allowedTools.length===0?`No tools`:`${e.allowedTools.length} tool${e.allowedTools.length===1?``:`s`}`;return Y(B,{flexDirection:`column`,children:[J(X,{children:`Toolsets`}),Y(B,{marginBottom:1,flexDirection:`column`,children:[J(V,{dimColor:!0,children:`n to create a new toolset`}),n.length>0&&J(V,{dimColor:!0,children:`d to set as default toolset`}),n.length>0&&J(V,{dimColor:!0,children:`p to set as plan mode toolset`}),n.length>0&&J(V,{dimColor:!0,children:`x to delete a toolset`}),n.length>0&&J(V,{dimColor:!0,children:`enter to edit toolset`}),J(V,{dimColor:!0,children:`esc to go back`})]}),n.length===0?J(V,{children:`No toolsets created yet. Press n to create one.`}):J(B,{flexDirection:`column`,children:n.map((e,t)=>{let n=e.name===r,a=e.name===i,o=f===t,s;return o&&(s=`yellow`),Y(B,{flexDirection:`row`,children:[Y(V,{color:s,children:[o?`❯ `:` `,e.name,` `]}),Y(V,{color:s,children:[`(`,S(e),`)`]}),n&&J(V,{color:d,children:` ⏵⏵ accept edits`}),a&&J(V,{color:u,children:` ⏸ plan mode`})]},t)})})]})}function kt({onBack:e}){let{settings:t,updateSettings:n}=W($),[r,i]=K(`plan`),[a,o]=K(!1),[s,c]=K(0),l=t.subagentModels||{plan:null,explore:null,generalPurpose:null},u=[{id:`plan`,title:`Plan Agent`,description:`The agent responsible for creating implementation plans.`},{id:`explore`,title:`Explore Agent`,description:`The agent specialized for exploring codebases.`},{id:`generalPurpose`,title:`General-purpose Agent`,description:`The agent used for general multi-step tasks.`}],d=[{label:`Default (Inherited)`,value:null},{label:`sonnet`,value:`sonnet`},{label:`haiku`,value:`haiku`},{label:`opus`,value:`opus`},{label:`sonnet[1m]`,value:`sonnet[1m]`}];return H((t,f)=>{if(a){if(f.escape)o(!1);else if(f.upArrow)c(e=>e>0?e-1:d.length-1);else if(f.downArrow)c(e=>e<d.length-1?e+1:0);else if(f.return){let e=d[s].value;n(t=>{t.subagentModels||={plan:null,explore:null,generalPurpose:null},t.subagentModels[r]=e}),o(!1)}}else if(f.escape)e();else if(f.upArrow){let e=u.findIndex(e=>e.id===r);i(u[e>0?e-1:u.length-1].id)}else if(f.downArrow){let e=u.findIndex(e=>e.id===r);i(u[e<u.length-1?e+1:0].id)}else if(t===` `||f.return){let e=l[r],t=d.findIndex(t=>t.value===e);c(t>=0?t:0),o(!0)}}),a?Y(B,{flexDirection:`column`,children:[J(B,{marginBottom:1,children:Y(X,{children:[`Select Model for`,` `,u.find(e=>e.id===r)?.title]})}),d.map((e,t)=>{let n=t===s;return J(B,{children:Y(V,{color:n?`cyan`:void 0,children:[n?`❯ `:` `,e.label,e.value?Y(V,{dimColor:!0,children:[` (`,e.value,`)`]}):null]})},t)})]}):Y(B,{flexDirection:`column`,children:[J(B,{marginBottom:1,children:J(X,{children:`Subagent Model Settings`})}),J(B,{marginBottom:1,children:J(V,{dimColor:!0,children:`Configure which Claude model each subagent uses. Use arrow keys to navigate, enter or space to change a model, and escape to go back.`})}),u.map(e=>{let t=e.id===r,n=l[e.id],i=d.find(e=>e.value===n)?.label||n||`Default`;return Y(B,{flexDirection:`column`,marginBottom:1,children:[J(B,{children:Y(V,{color:t?`cyan`:void 0,children:[t?`❯ `:` `,J(V,{bold:!0,children:e.title})]})}),J(B,{marginLeft:4,children:J(V,{dimColor:!0,children:e.description})}),J(B,{marginLeft:4,children:Y(V,{children:[`Current: `,J(V,{color:`green`,children:i})]})})]},e.id)})]})}function At({onBack:t}){let{settings:n,updateSettings:r}=W($),i=n.claudeMdAltNames??[],[a,o]=K(0),[s,c]=K(!1),[l,u]=K(``),[d,f]=K(!1);return H((n,p)=>{if(s||d){p.return&&l.trim()?(d?(r(e=>{e.claudeMdAltNames||=[],e.claudeMdAltNames.push(l.trim())}),f(!1)):(r(e=>{e.claudeMdAltNames&&(e.claudeMdAltNames[a]=l.trim())}),c(!1)),u(``)):p.escape?(u(``),c(!1),f(!1)):p.backspace||p.delete?u(e=>e.slice(0,-1)):n&&u(e=>e+n);return}p.escape?t():p.upArrow?i.length>0&&o(e=>e>0?e-1:i.length-1):p.downArrow?i.length>0&&o(e=>e<i.length-1?e+1:0):n===`e`?i.length>0&&(u(i[a]),c(!0)):n===`d`?i.length>0&&(r(e=>{e.claudeMdAltNames&&=e.claudeMdAltNames.filter((e,t)=>t!==a)}),a>=i.length-1&&o(Math.max(0,i.length-2))):n===`n`?(f(!0),u(``)):p.ctrl&&n===`r`?(r(t=>{t.claudeMdAltNames=[...e.claudeMdAltNames??[]]}),o(0)):n===`u`||p.shift&&p.upArrow?i.length>1&&a>0&&(r(e=>{if(!e.claudeMdAltNames)return;let t=e.claudeMdAltNames;[t[a-1],t[a]]=[t[a],t[a-1]]}),o(e=>e-1)):(n===`j`||p.shift&&p.downArrow)&&i.length>1&&a<i.length-1&&(r(e=>{if(!e.claudeMdAltNames)return;let t=e.claudeMdAltNames;[t[a],t[a+1]]=[t[a+1],t[a]]}),o(e=>e+1))}),Y(B,{flexDirection:`column`,children:[Y(B,{marginBottom:1,flexDirection:`column`,children:[J(X,{children:`CLAUDE.md Alternative Names`}),Y(B,{flexDirection:`column`,children:[J(V,{dimColor:!0,children:`changes auto-saved`}),J(V,{dimColor:!0,children:`esc to go back`})]})]}),J(B,{marginBottom:1,flexDirection:`column`,children:J(V,{dimColor:!0,children:`When Claude Code looks for CLAUDE.md and doesn't find it, it will try these alternative filenames in order. This lets you use AGENTS.md (and other file names).`})}),J(B,{marginBottom:1,children:J(V,{dimColor:!0,children:`e to edit · d to delete · n to add new · u/j to move up/down · ctrl+r to reset`})}),Y(B,{flexDirection:`column`,children:[i.length===0?J(V,{children:`No alternative names configured. Press n to add one.`}):J(q,{children:(()=>{let e=Math.max(0,a-6),t=Math.min(i.length,e+12),n=Math.max(0,t-12),r=i.slice(n,t);return Y(q,{children:[n>0&&Y(V,{color:`gray`,dimColor:!0,children:[` `,`↑ `,n,` more above`]}),r.map((e,t)=>{let r=n+t,i=r===a;return Y(V,{color:i?`cyan`:void 0,children:[i?`❯ `:` `,e]},r)}),t<i.length&&Y(V,{color:`gray`,dimColor:!0,children:[` `,`↓ `,i.length-t,` more below`]})]})})()}),d&&Y(B,{alignItems:`center`,children:[J(V,{color:`yellow`,children:`❯ `}),J(B,{borderStyle:`round`,borderColor:`yellow`,children:J(V,{children:l})})]}),s&&Y(B,{marginTop:1,alignItems:`center`,children:[J(V,{children:`Editing: `}),J(B,{borderStyle:`round`,borderColor:`yellow`,children:J(V,{children:l})})]})]})]})}const jt=e=>{let t=ke.join(P,e),n;try{n=Oe.readFileSync(t,`utf8`)}catch{return null}let r=Me(n,{delimiters:[`<!--`,`-->`]}),i=r.data,a=(r.content??``).replace(/^\n+/,``).replace(/\n+$/,``),o=e.replace(/\.md$/,``),s=typeof i.name==`string`?i.name:o,c=typeof i.description==`string`?i.description:``,l;return l=a.trim().length===0?`suppressed`:`default`,{id:o,filename:e,name:s,description:c,state:l,body:a}},Mt=()=>{if(!Oe.existsSync(P))return[];let e=Oe.readdirSync(P).filter(e=>e.endsWith(`.md`)).sort(),t=[];for(let n of e){let e=jt(n);e&&t.push(e)}return t},Nt={default:void 0,customized:`cyan`,suppressed:`green`,missing:`red`},Pt={default:`·`,customized:`◆`,suppressed:`☑`,missing:`?`},Ft={default:`default`,customized:`customized`,suppressed:`suppressed`,missing:`missing`};function It({onSubmit:e}){let{settings:t,updateSettings:n}=W($),[i,a]=K(0),[o,s]=K([]),[c,l]=K(!1),[u,d]=K(0);G(()=>{s(Mt())},[u]);let f=t.misc?.suppressDeferredTools??!1,p=o.length,m=Math.max(0,p-1),h=Se(()=>i<8?0:Math.min(i-8+1,Math.max(0,p-8)),[i,p]),g=o.slice(h,h+8),_=h>0,v=h+8<p;if(H((t,s)=>{if(c){s.return?(n(e=>{e.misc?e.misc.suppressDeferredTools=!0:e.misc={suppressDeferredTools:!0}}),l(!1)):s.escape&&l(!1);return}if(s.escape){e();return}if(s.upArrow)a(e=>Math.max(0,e-1));else if(s.downArrow)a(e=>Math.min(m,e+1));else if(t===`o`||s.return){let e=o[i];e&&r(ke.join(P,e.filename))}else if(t===`d`){let e=o[i];if(e)try{Oe.unlinkSync(ke.join(P,e.filename)),d(e=>e+1)}catch{}}else t===`r`?d(e=>e+1):t===`f`&&(f?n(e=>{e.misc&&(e.misc.suppressDeferredTools=!1)}):l(!0))}),c)return J(B,{flexDirection:`column`,paddingX:2,children:Y(B,{borderStyle:`double`,borderColor:`yellow`,padding:2,flexDirection:`column`,children:[J(B,{marginBottom:1,children:J(V,{bold:!0,color:`yellow`,children:`FOOTGUN TOGGLE`})}),Y(B,{marginBottom:1,flexDirection:`column`,children:[Y(V,{children:[`Suppressing this hides MCP servers, Cron jobs, EnterPlanMode, WebFetch, Monitor, and other `,J(V,{bold:!0,children:`deferred`}),` tools from the model.`]}),Y(V,{children:[`The model only learns these tools exist via this announcement. Without it, it cannot call `,J(V,{bold:!0,children:`ToolSearch`}),` to load their schemas and will report capabilities as unavailable.`]})]}),J(B,{children:Y(V,{children:[`Press `,J(V,{color:`red`,children:`Enter`}),` to enable,`,` `,J(V,{color:`green`,children:`Escape`}),` to cancel`]})})]})});let y=P.replace(we.homedir(),`~`),b=o[i];return Y(B,{flexDirection:`column`,children:[J(B,{marginBottom:1,children:J(X,{children:`System Reminders`})}),Y(B,{marginBottom:1,flexDirection:`column`,children:[Y(V,{children:[`Edit per-turn / per-event `,J(V,{bold:!0,children:`<system-reminder>`}),` `,`injections via `,J(V,{bold:!0,children:`.md files`}),` in `,y,`/`]}),J(V,{dimColor:!0,children:`Empty body = suppress · Custom body = override · Files seeded on first --apply. Re-apply after editing.`})]}),p===0?J(B,{flexDirection:`column`,marginBottom:1,children:Y(V,{color:`yellow`,children:[`No override files yet. Run `,J(V,{bold:!0,children:`tweakcc --apply`}),` to seed defaults.`]})}):Y(q,{children:[_&&J(B,{children:Y(V,{dimColor:!0,children:[` ↑ `,h,` more above`]})}),g.map((e,t)=>{let n=h+t===i;return Y(B,{flexDirection:`row`,children:[J(B,{width:2,children:J(V,{color:n?`cyan`:void 0,children:n?`❯ `:` `})}),J(B,{width:3,children:J(V,{color:Nt[e.state],children:Pt[e.state]})}),J(B,{width:14,children:J(V,{dimColor:!0,color:Nt[e.state],children:Ft[e.state]})}),J(B,{flexGrow:1,children:J(V,{bold:n,color:n?`cyan`:void 0,children:e.name})})]},e.id)}),v&&J(B,{children:Y(V,{dimColor:!0,children:[` `,`↓ `,p-h-8,` more below`]})})]}),b&&J(B,{flexDirection:`column`,marginTop:1,paddingX:1,children:J(V,{dimColor:!0,children:b.description})}),Y(B,{marginTop:1,flexDirection:`column`,children:[Y(V,{dimColor:!0,children:[`↑/↓ navigate · `,J(V,{bold:!0,children:`o`}),`/Enter open in editor ·`,` `,J(V,{bold:!0,children:`d`}),` delete (reset on next --apply) ·`,` `,J(V,{bold:!0,children:`r`}),` reload`]}),Y(V,{dimColor:!0,children:[J(V,{bold:!0,children:`f`}),` toggle deferred-tools footgun [`,J(V,{color:f?`red`:void 0,bold:f,children:f?`SUPPRESSED`:`vanilla`}),`] · Esc go back`]})]})]})}const Lt=[`on`,`name-only`,`user-invocable-only`,`off`],Rt={on:`on (full description)`,"name-only":`name-only (model sees no description)`,"user-invocable-only":`user-invocable (hidden from model, /name still works)`,off:`off (not loaded)`},zt={on:void 0,"name-only":`cyan`,"user-invocable-only":`yellow`,off:`red`},Bt={on:`◉`,"name-only":`◐`,"user-invocable-only":`◑`,off:`○`},Vt=ke.join(we.homedir(),`.claude`,`settings.json`),Ht=[ke.join(we.homedir(),`.claude`,`skills`),ke.join(we.homedir(),`.agents`,`skills`)],Ut=e=>Lt[(Lt.indexOf(e)+1)%Lt.length],Wt=e=>Lt[(Lt.indexOf(e)-1+Lt.length)%Lt.length],Gt=()=>{let e=new Set;for(let t of Ht)if(Oe.existsSync(t))try{let n=Oe.readdirSync(t,{withFileTypes:!0});for(let t of n)(t.isDirectory()||t.isSymbolicLink())&&e.add(t.name)}catch{}return[...e].sort()},Kt=()=>{try{let e=Oe.readFileSync(Vt,`utf8`);return{skillOverrides:JSON.parse(e).skillOverrides??{}}}catch{return{skillOverrides:{}}}},qt=e=>{let t={};try{t=JSON.parse(Oe.readFileSync(Vt,`utf8`))}catch{}t.skillOverrides=e,Oe.writeFileSync(Vt,JSON.stringify(t,null,2))};function Jt({onSubmit:e}){let[t,n]=K({}),[r,i]=K([]),[a,o]=K(0),[s,c]=K(!1);G(()=>{i(Gt()),n(Kt().skillOverrides)},[]);let l=Se(()=>r.map(e=>({name:e,state:t[e]??`on`})),[r,t]),u=l.length,d=Math.max(0,u-1),f=Se(()=>a<10?0:Math.min(a-10+1,Math.max(0,u-10)),[a,u]),p=l.slice(f,f+10),m=(e,r)=>{let i=l[e]?.name;if(!i)return;let a={...t};r===`on`?delete a[i]:a[i]=r,n(a),qt(a),c(!0),setTimeout(()=>c(!1),1500)};H((t,n)=>{if(n.escape||n.return&&u===0){e();return}n.upArrow?o(e=>Math.max(0,e-1)):n.downArrow?o(e=>Math.min(d,e+1)):t===` `||n.rightArrow?m(a,Ut(l[a]?.state??`on`)):n.leftArrow?m(a,Wt(l[a]?.state??`on`)):t===`0`?m(a,`on`):t===`x`&&m(a,`off`)});let h=l[a];return Y(B,{flexDirection:`column`,children:[J(B,{marginBottom:1,children:J(X,{children:`Skills (per-skill skillOverrides)`})}),Y(B,{marginBottom:1,flexDirection:`column`,children:[Y(V,{children:[`Writes `,J(V,{bold:!0,children:`skillOverrides`}),` to`,` `,J(V,{color:`cyan`,children:`~/.claude/settings.json`}),` — CC reads this natively, no tweakcc patch needed.`]}),J(V,{dimColor:!0,children:`Each skill: on / name-only / user-invocable-only / off. CC honors immediately; no --apply required.`})]}),u===0?J(B,{children:Y(V,{color:`yellow`,children:[`No skills found in`,` `,Ht.map(e=>e.replace(we.homedir(),`~`)).join(` or `),`.`]})}):Y(q,{children:[f>0&&J(B,{children:Y(V,{dimColor:!0,children:[` ↑ `,f,` more above`]})}),p.map((e,t)=>{let n=f+t===a;return Y(B,{flexDirection:`row`,children:[J(B,{width:2,children:J(V,{color:n?`cyan`:void 0,children:n?`❯ `:` `})}),J(B,{width:3,children:J(V,{color:zt[e.state],children:Bt[e.state]})}),J(B,{width:26,children:J(V,{dimColor:!0,color:zt[e.state],children:e.state})}),J(B,{flexGrow:1,children:J(V,{bold:n,color:n?`cyan`:void 0,children:e.name})})]},e.name)}),f+10<u&&J(B,{children:Y(V,{dimColor:!0,children:[` `,`↓ `,u-f-10,` more below`]})})]}),h&&J(B,{flexDirection:`column`,marginTop:1,children:J(V,{dimColor:!0,children:Rt[h.state]})}),Y(B,{marginTop:1,flexDirection:`column`,children:[Y(V,{dimColor:!0,children:[`↑/↓ navigate · space/→/← cycle state · `,J(V,{bold:!0,children:`0`}),` set on ·`,` `,J(V,{bold:!0,children:`x`}),` set off · Esc back`]}),s&&J(V,{color:`green`,children:`✓ saved to settings.json`})]})]})}const $=be({settings:e,updateSettings:e=>{},changesApplied:!1,ccVersion:``});function Yt({startupCheckInfo:e,configMigrated:t,invocationCommand:n,initialConfig:i}){let[a,s]=K(i),[c,l]=K(!i.hidePiebaldAnnouncement),u=xe(e=>{let t=JSON.parse(JSON.stringify(a.settings));e(t),s(e=>({...e,settings:t,changesApplied:!1})),ae(e=>{e.settings=t,e.changesApplied=!1})},[a.settings]),[d,f]=K(null),[p,m]=K(null);G(()=>{e.wasUpdated&&e.oldVersion&&(m({message:`Your Claude Code installation was updated from ${e.oldVersion} to ${e.newVersion}, and the patching was likely overwritten
2
+ import{$ as e,A as t,B as n,D as r,E as i,F as a,G as o,H as s,I as c,J as l,L as u,M as d,N as f,P as p,Q as m,R as h,T as g,U as _,V as v,W as y,X as b,Y as x,Z as S,_ as C,a as w,b as ee,d as T,et as E,g as D,h as O,i as k,j as A,k as j,l as M,m as te,n as N,o as P,p as F,r as ne,s as re,t as ie,u as ae,v as oe,w as se,x as ce,y as I,z as L}from"./config-BGsQaczu.mjs";import{a as R,c as le,d as ue,l as de,n as fe,o as pe,s as z,t as me,u as he}from"./content-M0EgBl6Y.mjs";import{Box as B,Text as V,render as ge,useInput as H}from"ink";import{Command as _e}from"commander";import U from"chalk";import ve,{Fragment as ye,createContext as be,useCallback as xe,useContext as W,useEffect as G,useMemo as Se,useRef as Ce,useState as K}from"react";import*as we from"node:os";import Te from"ink-link";import*as Ee from"node:fs/promises";import De from"node:fs/promises";import*as Oe from"node:fs";import*as ke from"node:path";import{execSync as Ae,spawn as je}from"node:child_process";import Me from"gray-matter";import{structuredPatch as Ne}from"diff";import{Fragment as q,jsx as J,jsxs as Y}from"react/jsx-runtime";import Pe from"process";import Fe from"cli-spinners";import*as Ie from"node:readline";var X=({children:e,...t})=>Y(V,{bold:!0,backgroundColor:`#ffd500`,color:`#000`,...t,children:[` `,e,` `]});const Le=[`\x1B[?25l\x1B[0m \x1B[38;2;0;0;0m \x1B[38;2;252;130;0m▂\x1B[38;2;252;130;0m▄\x1B[38;2;252;130;0m▅\x1B[38;2;252;130;0m▇\x1B[38;2;254;131;0m\x1B[48;2;252;130;0m▇\x1B[48;2;252;130;0m▇▇\x1B[48;2;252;130;0m▇\x1B[0m\x1B[38;2;252;130;0m▇\x1B[38;2;252;130;0m▅\x1B[38;2;252;130;0m▄\x1B[38;2;252;130;0m▂ \x1B[0m`,` \x1B[38;2;0;0;0m \x1B[38;2;254;131;0m▗\x1B[38;2;254;131;0m▆\x1B[48;2;254;131;0m \x1B[38;2;254;132;0m╶ \x1B[0m\x1B[38;2;254;131;0m▆\x1B[38;2;254;131;0m▖ \x1B[0m`,` \x1B[7m\x1B[38;2;254;131;0m▘\x1B[0m\x1B[38;2;11;6;0m\x1B[48;2;254;131;0m \x1B[38;2;254;216;182m\x1B[48;2;254;136;12m▃\x1B[38;2;254;249;246m\x1B[48;2;254;143;29m▅\x1B[38;2;254;253;253m\x1B[48;2;254;143;40m▆\x1B[38;2;254;254;253m\x1B[48;2;254;152;68m▆▆▆\x1B[38;2;254;253;252m\x1B[48;2;254;141;34m▆\x1B[38;2;254;247;242m\x1B[48;2;254;140;24m▅\x1B[38;2;254;224;199m\x1B[48;2;254;140;20m▖\x1B[48;2;254;131;0m \x1B[0m\x1B[7m\x1B[38;2;254;131;0m▝\x1B[0m \x1B[0m`,`\x1B[7m\x1B[38;2;251;127;0m▌\x1B[0m\x1B[38;2;251;127;0m\x1B[48;2;253;130;0m▃\x1B[38;2;252;128;0m\x1B[48;2;254;131;0m▃\x1B[38;2;252;129;0m▂\x1B[38;2;253;130;0m▁\x1B[38;2;249;135;16m\x1B[48;2;253;226;202m▋\x1B[38;2;254;254;254m\x1B[48;2;254;254;253m┈\x1B[48;2;246;246;245m┈\x1B[38;2;47;47;47m\x1B[48;2;244;244;243m▂\x1B[38;2;112;112;112m\x1B[48;2;251;251;251m▂\x1B[38;2;254;254;254m\x1B[48;2;254;254;253m▁╌▝\x1B[38;2;254;254;253m\x1B[48;2;254;254;254m▋\x1B[38;2;254;254;254m\x1B[48;2;254;253;252m┈\x1B[38;2;252;209;168m\x1B[48;2;251;129;0m▍\x1B[38;2;253;129;0m\x1B[48;2;254;131;0m▂\x1B[38;2;252;128;0m▃\x1B[38;2;251;127;0m\x1B[48;2;253;130;0m▃\x1B[0m\x1B[38;2;251;127;0m▌\x1B[0m`,`\x1B[38;2;243;118;0m\x1B[48;2;243;118;0m▏\x1B[38;2;245;118;0m\x1B[48;2;248;122;0m▄\x1B[38;2;247;121;0m\x1B[48;2;247;122;0m┈\x1B[38;2;106;68;38m\x1B[48;2;245;123;2m▃\x1B[38;2;39;33;28m\x1B[48;2;211;109;6m▅\x1B[38;2;27;20;12m\x1B[48;2;237;237;237m▌\x1B[48;2;254;254;253m \x1B[38;2;90;90;89m\x1B[48;2;231;230;230m▝\x1B[38;2;215;215;214m\x1B[48;2;48;48;48m▁\x1B[38;2;203;203;202m\x1B[48;2;42;42;42m▂\x1B[38;2;254;254;254m\x1B[48;2;254;254;253m┇╴\x1B[38;2;253;252;252m▂\x1B[38;2;251;250;250m\x1B[48;2;253;253;253m▃\x1B[38;2;249;249;248m\x1B[48;2;252;252;251m▄\x1B[38;2;249;248;248m\x1B[48;2;237;118;0m▍\x1B[38;2;246;121;0m\x1B[48;2;250;125;0m▄\x1B[38;2;246;119;0m\x1B[48;2;249;124;0m▄\x1B[38;2;245;118;0m\x1B[48;2;248;123;0m▄\x1B[38;2;243;118;0m\x1B[48;2;243;118;0m▉\x1B[0m`,`\x1B[38;2;238;108;0m\x1B[48;2;237;109;0m▏\x1B[38;2;238;108;0m\x1B[48;2;241;113;0m▄\x1B[38;2;239;109;0m\x1B[48;2;242;114;0m▄\x1B[38;2;233;109;2m\x1B[48;2;125;73;29m▇\x1B[38;2;225;104;1m\x1B[48;2;50;32;18m▄\x1B[38;2;62;29;2m\x1B[48;2;239;237;237m▌\x1B[38;2;254;253;253m\x1B[48;2;254;254;254m┻\x1B[38;2;254;254;253m▊\x1B[38;2;254;254;254m\x1B[48;2;254;254;253m┊\x1B[38;2;253;253;252m▂\x1B[38;2;251;251;251m\x1B[48;2;254;253;253m▃\x1B[38;2;249;249;249m\x1B[48;2;252;252;252m▄\x1B[38;2;247;247;247m\x1B[48;2;250;250;250m▄\x1B[38;2;245;245;244m\x1B[48;2;248;248;248m▄\x1B[38;2;243;243;242m\x1B[48;2;246;246;245m▄\x1B[38;2;243;242;242m\x1B[48;2;230;109;0m▍\x1B[38;2;239;111;0m\x1B[48;2;243;116;0m▄\x1B[38;2;239;109;0m\x1B[48;2;242;114;0m▄\x1B[38;2;238;108;0m\x1B[48;2;241;113;0m▄\x1B[38;2;237;108;0m\x1B[48;2;238;108;0m▉\x1B[0m`,`\x1B[7m\x1B[38;2;231;98;0m▌\x1B[0m\x1B[38;2;231;98;0m\x1B[48;2;234;103;0m▄\x1B[38;2;231;99;0m\x1B[48;2;235;105;0m▄\x1B[38;2;232;100;0m\x1B[48;2;236;105;0m▄\x1B[38;2;232;101;0m\x1B[48;2;236;106;0m▄\x1B[38;2;223;99;0m\x1B[48;2;247;238;235m▌\x1B[38;2;254;254;254m\x1B[48;2;254;254;253m┊\x1B[38;2;252;252;251m▃\x1B[38;2;250;250;250m\x1B[48;2;253;253;252m▄\x1B[38;2;248;248;247m\x1B[48;2;251;251;250m▄\x1B[38;2;246;245;245m\x1B[48;2;249;248;248m▄\x1B[38;2;243;243;243m\x1B[48;2;246;246;246m▄\x1B[38;2;241;241;241m\x1B[48;2;244;244;244m▄\x1B[38;2;239;239;238m\x1B[48;2;242;242;242m▄\x1B[38;2;237;237;236m\x1B[48;2;240;240;239m▄\x1B[38;2;237;236;236m\x1B[48;2;223;99;0m▍\x1B[38;2;232;100;0m\x1B[48;2;236;106;0m▄\x1B[38;2;231;100;0m\x1B[48;2;235;105;0m▄\x1B[38;2;231;98;0m\x1B[48;2;234;103;0m▄\x1B[0m\x1B[38;2;231;98;0m▌\x1B[0m`,` \x1B[7m\x1B[38;2;224;89;0m▖\x1B[0m\x1B[38;2;224;89;0m\x1B[48;2;228;94;0m▄\x1B[38;2;225;90;0m\x1B[48;2;228;95;0m▄\x1B[38;2;225;91;0m\x1B[48;2;229;96;0m▄\x1B[38;2;217;90;1m\x1B[48;2;97;77;70m▌\x1B[38;2;70;70;70m\x1B[48;2;207;207;207m▆\x1B[38;2;66;65;65m\x1B[48;2;228;228;227m▄\x1B[38;2;66;66;66m\x1B[48;2;233;232;232m▂\x1B[38;2;169;169;169m\x1B[48;2;243;243;243m▁\x1B[38;2;240;239;239m\x1B[48;2;243;242;242m▄\x1B[38;2;238;237;237m\x1B[48;2;241;240;240m▄\x1B[38;2;235;235;235m\x1B[48;2;238;238;238m▄\x1B[38;2;233;233;233m\x1B[48;2;236;236;236m▄\x1B[38;2;231;231;230m\x1B[48;2;234;234;233m▄\x1B[38;2;231;230;230m\x1B[48;2;216;89;0m▍\x1B[38;2;225;90;0m\x1B[48;2;229;95;0m▄\x1B[38;2;224;89;0m\x1B[48;2;228;94;0m▄\x1B[0m\x1B[7m\x1B[38;2;224;89;0m▗\x1B[0m \x1B[0m`,` \x1B[38;2;0;0;0m \x1B[38;2;217;80;0m▝\x1B[7m\x1B[38;2;217;80;0m▂\x1B[0m\x1B[38;2;217;80;0m\x1B[48;2;221;86;0m▄\x1B[38;2;197;78;9m\x1B[48;2;66;66;65m▋\x1B[38;2;65;65;64m\x1B[48;2;60;60;60m▘\x1B[38;2;52;52;51m\x1B[48;2;56;56;56m▗\x1B[38;2;45;45;45m\x1B[48;2;50;50;49m▗\x1B[38;2;42;42;42m\x1B[48;2;46;46;46m┈\x1B[38;2;41;41;41m\x1B[48;2;203;202;202m▆\x1B[38;2;38;38;38m\x1B[48;2;218;218;218m▄\x1B[38;2;45;45;45m\x1B[48;2;221;221;221m▂\x1B[38;2;229;229;229m┊\x1B[38;2;225;225;225m\x1B[48;2;228;228;227m▄\x1B[38;2;225;224;224m\x1B[48;2;209;79;0m▍\x1B[0m\x1B[7m\x1B[38;2;217;80;0m▂\x1B[0m\x1B[38;2;217;80;0m▘ \x1B[0m`,` \x1B[38;2;0;0;0m \x1B[7m\x1B[38;2;191;73;0m▆\x1B[38;2;191;73;0m▄\x1B[38;2;56;55;55m▃\x1B[38;2;46;46;46m▁\x1B[0m\x1B[38;2;20;20;20m\x1B[48;2;42;42;42m▁\x1B[38;2;36;36;36m\x1B[48;2;35;34;34m╴\x1B[38;2;23;23;23m\x1B[48;2;29;29;28m▁\x1B[38;2;10;10;10m\x1B[48;2;22;22;22m▁\x1B[0m\x1B[7m\x1B[38;2;15;15;15m▁\x1B[38;2;22;22;21m▃\x1B[38;2;154;154;154m▅\x1B[38;2;175;116;83m▇\x1B[0m\x1B[38;2;17;15;14m \x1B[0m`,`\x1B[?25h\x1B[0m`];var Re=()=>Y(B,{flexDirection:`row`,height:10,alignItems:`center`,borderStyle:`bold`,borderBottom:!1,borderTop:!1,borderRight:!1,borderColor:`#ff8400`,marginBottom:1,children:[Y(B,{marginBottom:1,paddingLeft:1,flexDirection:`column`,flexGrow:1,children:[J(V,{bold:!0,color:`#ff8400`,children:`Piebald is released!`}),J(V,{children:` `}),Y(V,{children:[`We've released `,J(V,{bold:!0,children:`Piebald`}),`, the ultimate agentic AI developer experience.`]}),Y(V,{children:[`Download it and try it out for free!`,` `,J(Te,{url:`https://piebald.ai/`,fallback:!1,children:J(V,{color:`#ff8400`,children:`https://piebald.ai/`})})]}),J(V,{children:` `}),J(V,{dimColor:!0,color:`gray`,children:`press 'h' to hide`})]}),J(B,{width:22,flexShrink:0,flexDirection:`column`,alignItems:`center`,children:Le.map((e,t)=>J(V,{children:e},t))})]});let Z=function(e){return e.THEMES=`Themes`,e.THINKING_VERBS=`Thinking verbs`,e.THINKING_STYLE=`Thinking style`,e.USER_MESSAGE_DISPLAY=`User message display`,e.INPUT_PATTERN_HIGHLIGHTERS=`Input pattern highlighters`,e.MISC=`Misc`,e.TOOLSETS=`Toolsets`,e.SUBAGENT_MODELS=`Subagent models`,e.CLAUDE_MD_ALT_NAMES=`CLAUDE.md alternative names`,e.SYSTEM_REMINDERS=`System reminders (injection lobotomy)`,e.SKILLS=`Skills (per-skill on/name-only/user-invocable/off)`,e.VIEW_SYSTEM_PROMPTS=`View system prompts`,e.RESTORE_ORIGINAL=`Restore original Claude Code (preserves config.json)`,e.OPEN_CONFIG=`Open config.json`,e.OPEN_CLI=`Open Claude Code's cli.js`,e.EXIT=`Exit`,e}({});function ze({items:e,selectedIndex:t,onSelect:n,onSubmit:r}){return H((i,a)=>{a.upArrow?n(t>0?t-1:e.length-1):a.downArrow?n(t<e.length-1?t+1:0):a.return&&r(e[t].name)}),J(B,{flexDirection:`column`,children:e.map((e,n)=>J(B,{children:Y(V,{children:[Y(V,{bold:n===t,color:n===t?`cyan`:void 0,...n===t?e.selectedStyles??{}:e.styles??{},children:[n===t?`❯ `:` `,e.name]}),e.desc&&n===t&&Y(V,{dimColor:!0,bold:!1,children:[` \x1B[0;2m`,`- `,e.desc]})]})},n))})}const Be=[{name:Z.THEMES,desc:`Modify Claude Code's built-in themes or create your own`},{name:Z.THINKING_VERBS,desc:`Customize the list of verbs that Claude Code uses when it's working`},{name:Z.THINKING_STYLE,desc:`Choose custom spinners`},{name:Z.USER_MESSAGE_DISPLAY,desc:`Customize how user messages are displayed`},{name:Z.INPUT_PATTERN_HIGHLIGHTERS,desc:`Create custom highlighters for patterns in your input`},{name:Z.MISC,desc:`Miscellaneous settings (input box border, etc.)`},{name:Z.TOOLSETS,desc:`Manage toolsets to control which tools are available`},{name:Z.SUBAGENT_MODELS,desc:`Configure which Claude model each subagent uses (Plan, Explore, etc.)`},{name:Z.CLAUDE_MD_ALT_NAMES,desc:`Configure alternative filenames for CLAUDE.md (e.g., AGENTS.md)`},{name:Z.SYSTEM_REMINDERS,desc:`Suppress per-turn <system-reminder> injections (skills list, MCP instructions, claudeMd wrapper, etc.)`},{name:Z.SKILLS,desc:`Per-skill listing control (writes settings.json skillOverrides — no patch needed)`},{name:Z.VIEW_SYSTEM_PROMPTS,desc:`Opens the system prompts directory where you can customize Claude Code's system prompts`}],Ve=[{name:Z.RESTORE_ORIGINAL,desc:`Reverts your Claude Code install to its original state (your customizations are remembered and can be reapplied)`},{name:Z.OPEN_CONFIG,desc:`Opens your tweakcc config file (${ne})`},{name:Z.OPEN_CLI,desc:`Opens Claude Code's cli.js file`},{name:Z.EXIT,desc:`Bye!`}];var He=({onSubmit:e})=>{let t=[...Be,...Ve],[n,r]=K(0);return J(ze,{items:t,selectedIndex:n,onSelect:r,onSubmit:t=>e(t)})};const Ue=()=>Y(B,{flexDirection:`row`,children:[J(X,{children:`tweakcc`}),J(V,{children:` (by `}),J(Te,{url:`https://piebald.ai`,fallback:!1,children:J(V,{color:`#ff8400`,bold:!0,children:`Piebald`})}),J(V,{children:`)`})]}),We=()=>J(B,{children:Y(V,{color:`yellow`,children:[`⭐ `,J(V,{bold:!0,children:`Star the repo at `}),J(Te,{url:`https://github.com/skrabe/tweakcc-fixed`,fallback:!1,children:J(V,{bold:!0,color:`cyan`,children:`https://github.com/skrabe/tweakcc-fixed`})}),J(V,{bold:!0,children:` if you find this useful!`}),` ⭐`]})}),Ge=({notification:e})=>J(B,{borderLeft:!0,borderRight:!1,borderTop:!1,borderBottom:!1,borderStyle:`bold`,borderColor:e.type===`success`?`green`:e.type===`error`?`red`:e.type===`info`?`blue`:`yellow`,paddingLeft:1,flexDirection:`column`,children:J(V,{color:e.type===`success`?`green`:e.type===`error`?`red`:e.type===`info`?`blue`:`yellow`,children:e.message})}),Ke=({onSubmit:e,notification:t,configMigrated:n,showPiebaldAnnouncement:r,changesApplied:i,invocationCommand:a})=>Y(B,{flexDirection:`column`,gap:1,children:[n&&J(B,{children:J(V,{color:`blue`,bold:!0,children:"Note that in tweakcc v3.2.0+, `ccInstallationDir` config is deprecated. You are now migrated to `ccInstallationPath` which supports npm and native installs."})}),J(Ue,{}),J(B,{children:Y(V,{children:[J(V,{bold:!0,children:`Customize your Claude Code installation.`}),` `,Y(V,{dimColor:!0,children:[`Settings will be saved to `,N.replace(we.homedir(),`~`),`/config.json.`]})]})}),J(r?Re:We,{}),t&&J(Ge,{notification:t}),!i&&!t&&J(Ge,{notification:{message:`Your changes are configured but not applied.\nRun \`${a} --apply\` to apply your customizations!`,type:`info`}}),J(He,{onSubmit:e})]});function Q({color:e,backgroundColor:t,bold:n,dimColor:r,children:i}){let a=e?.startsWith(`ansi:`),o=t?.startsWith(`ansi:`);if(a||o){if(ve.Children.toArray(i).some(e=>ve.isValidElement(e)))return J(V,{children:i});let s=U;if(a){let t=e.slice(5);s=s[t]||s}if(o){let e=t.slice(5),n=e.startsWith(`bg`)?e:`bg${e.charAt(0).toUpperCase()}${e.slice(1)}`;s=s[n]||s}n&&(s=s.bold),r&&(s=s.dim);let c=ve.Children.toArray(i).map(e=>typeof e==`string`||typeof e==`number`?String(e):``).join(``);return J(V,{children:s(c)})}return J(V,{color:e,backgroundColor:t,bold:n,dimColor:r,children:i})}function qe({text:e,nonShimmerColors:t,shimmerColors:n,shimmerWidth:r=3,updateDuration:i=50,restartPoint:a=10}){let[o,s]=K(0);return G(()=>{let t=setInterval(()=>{s(t=>{let n=t+1;return n>=e.length+a?-r:n})},i);return()=>clearInterval(t)},[e.length,a,i]),t.length===n.length?J(V,{children:e.split(``).map((i,a)=>{let s=a>=o&&a<o+r&&o<e.length,c=a%t.length;return J(V,{color:s?n[c]:t[c],children:i},a)})}):(console.error(`UltrathinkRainbowShimmer: nonShimmerColors and shimmerColors must have the same length`),J(V,{children:e}))}const Je=Pe.cwd();function Ye({theme:e}){let{ccVersion:t}=W($);return Y(B,{flexDirection:`column`,paddingLeft:1,children:[J(B,{marginBottom:1,children:Y(V,{bold:!0,children:[`Preview: `,e.name]})}),J(B,{borderStyle:`single`,borderColor:`gray`,paddingX:1,children:Y(B,{flexDirection:`column`,children:[Y(B,{flexDirection:`column`,children:[Y(V,{children:[J(Q,{color:e.colors.clawd_body,children:` ▐`}),J(V,{color:e.colors.clawd_body,backgroundColor:e.colors.clawd_background,children:`▛███▜`}),Y(V,{children:[J(Q,{color:e.colors.clawd_body,children:`▌ `}),` `,J(V,{bold:!0,children:`Claude Code`}),` `,t?`v${t}`:`v2.0.14`]})]}),Y(V,{children:[J(Q,{color:e.colors.clawd_body,children:`▝▜`}),J(V,{color:e.colors.clawd_body,backgroundColor:e.colors.clawd_background,children:`█████`}),J(Q,{color:e.colors.clawd_body,children:`▛▘`}),` `,ce(),` · `,I()]}),Y(Q,{color:e.colors.clawd_body,children:[` `,`▘▘ ▝▝`,` `,Je]}),Y(V,{children:[Y(Q,{color:e.colors.success,children:[`Login successful. Press`,` `]}),J(Q,{bold:!0,color:e.colors.success,children:`Enter`}),Y(Q,{color:e.colors.success,children:[` `,`to continue…`]})]})]}),J(V,{children:`╭─────────────────────────────────────────────╮`}),Y(V,{children:[`│ 1 function greet() `,`{`,` `,`│`]}),Y(V,{children:[`│ 2`,` `,J(Q,{backgroundColor:e.colors.diffRemoved,color:e.colors.text,children:`- console.log("`}),J(Q,{backgroundColor:e.colors.diffRemovedWord,children:`Hello, World!`}),J(Q,{backgroundColor:e.colors.diffRemoved,children:`");`}),` `,`│`]}),Y(V,{children:[`│ 2`,` `,J(Q,{backgroundColor:e.colors.diffAdded,color:e.colors.text,children:`+ console.log("`}),J(Q,{backgroundColor:e.colors.diffAddedWord,children:`Hello, Claude!`}),J(Q,{backgroundColor:e.colors.diffAdded,children:`");`}),` `,`│`]}),J(Q,{color:e.colors.warning,children:`╭─────────────────────────────────────────────╮`}),Y(Q,{color:e.colors.warning,children:[`│ Do you trust the files in this folder?`,` `,`│`]}),Y(V,{children:[J(Q,{color:e.colors.warning,children:`│ `}),J(V,{dimColor:!0,children:`Enter to confirm · Esc to exit`}),Y(Q,{color:e.colors.warning,children:[` `,`│`]})]}),J(Q,{color:e.colors.bashBorder,children:`───────────────────────────────────────────────`}),Y(V,{children:[J(Q,{color:e.colors.bashBorder,children:`!`}),J(V,{children:` ls`})]}),J(Q,{color:e.colors.promptBorder,children:`───────────────────────────────────────────────`}),J(V,{children:Y(V,{children:[`> list the dir`,` `,J(qe,{text:`ultrathink`,nonShimmerColors:[e.colors.rainbow_red,e.colors.rainbow_orange,e.colors.rainbow_yellow,e.colors.rainbow_green,e.colors.rainbow_blue,e.colors.rainbow_indigo,e.colors.rainbow_violet],shimmerColors:[e.colors.rainbow_red_shimmer,e.colors.rainbow_orange_shimmer,e.colors.rainbow_yellow_shimmer,e.colors.rainbow_green_shimmer,e.colors.rainbow_blue_shimmer,e.colors.rainbow_indigo_shimmer,e.colors.rainbow_violet_shimmer],shimmerWidth:3,updateDuration:50,restartPoint:10})]})}),J(Q,{color:e.colors.planMode,children:`╭─────────────────────────────────────────────╮`}),Y(V,{children:[J(Q,{color:e.colors.planMode,children:`│ `}),Y(Q,{color:e.colors.permission,children:[`Ready to code?`,` `]}),J(V,{children:`Here is Claude's plan:`}),Y(Q,{color:e.colors.planMode,children:[` `,`│`]})]}),J(Q,{color:e.colors.permission,children:`╭─────────────────────────────────────────────╮`}),Y(V,{children:[J(Q,{color:e.colors.permission,children:`│ `}),J(V,{bold:!0,children:`Permissions:`}),` `,Y(Q,{backgroundColor:e.colors.permission,color:e.colors.inverseText,bold:!0,children:[` `,`Allow`,` `]}),` `,`Deny`,` `,`Workspace`,` `,J(Q,{color:e.colors.permission,children:`│`})]}),J(V,{children:`> list the dir`}),Y(V,{children:[J(Q,{color:e.colors.error,children:`●`}),J(V,{children:` Update(__init__.py)`})]}),Y(V,{children:[J(V,{children:` ⎿ `}),J(Q,{color:e.colors.error,children:`User rejected update to __init__.py`})]}),Y(V,{children:[` `,`1`,` `,Y(Q,{backgroundColor:e.colors.diffRemovedDimmed,children:[`- import`,` `]}),J(Q,{backgroundColor:e.colors.diffRemovedWordDimmed,children:`os`})]}),Y(V,{children:[` `,`2`,` `,Y(Q,{backgroundColor:e.colors.diffAddedDimmed,children:[`+ import`,` `]}),J(Q,{backgroundColor:e.colors.diffAddedWordDimmed,children:`random`})]}),Y(V,{children:[J(Q,{color:e.colors.success,children:`●`}),J(V,{children:` List(.)`})]}),Y(V,{children:[J(V,{children:`●`}),J(V,{children:` The directory `}),J(Q,{color:e.colors.permission,children:`C:\\Users\\user`}),Y(V,{children:[` `,`contains `,J(V,{bold:!0,children:`123`}),` files.`]})]}),Y(V,{children:[J(Q,{color:e.colors.claude,children:`✻ Th`}),J(Q,{color:e.colors.claudeShimmer,children:`ink`}),J(Q,{color:e.colors.claude,children:`ing… `}),J(V,{children:`(esc to interrupt)`})]}),J(V,{children:J(Q,{color:e.colors.autoAccept,children:`⏵⏵ accept edits on (shift+tab to cycle)`})}),J(V,{children:J(Q,{color:e.colors.planMode,children:`⏸ plan mode on (shift+tab to cycle)`})}),J(V,{children:J(Q,{color:e.colors.ide,children:`◯ IDE connected ⧉ 44 lines selected`})})]})})]})}function Xe({colorKey:e,theme:t,bold:n=!1}){let r=t.colors[e];return e===`inverseText`?J(Q,{color:r,backgroundColor:t.colors.permission,bold:n,children:e}):e.startsWith(`diff`)?J(Q,{backgroundColor:r,bold:n,color:t.colors.text,children:e}):J(Q,{color:r,bold:n,children:e})}function Ze({initialValue:e,onColorChange:t,onExit:n,colorKey:r,theme:a}){let o=$e(e)||{h:0,s:50,l:50},s=Qe(e)||{r:128,g:128,b:128},[c,l]=K(o),[u,d]=K(s),[f,p]=K(`hsl`),[m,h]=K(`h`),[_,v]=K(!1),[y,b]=K(!1);G(()=>{let t=$e(e),n=Qe(e);t&&n&&(v(!0),l(t),d(n),v(!1))},[e]),G(()=>{!_&&y&&t(`rgb(${u.r},${u.g},${u.b})`)},[c,u,_,y]),G(()=>{b(!0)},[]);let x=e=>{if(g(e)){let t=i(e),n=$e(t),r=Qe(t);n&&r&&(v(!0),l(n),d(r),v(!1))}};H((e,t)=>{if(e.length>1&&!t.ctrl&&!t.meta){x(e);return}t.return||t.escape?n():t.ctrl&&e===`a`?(p(e=>e===`hsl`?`rgb`:`hsl`),h(e=>f===`hsl`?e===`h`?`r`:e===`s`?`g`:`b`:e===`r`?`h`:e===`g`?`s`:`l`)):t.upArrow?h(f===`hsl`?e=>e===`h`?`l`:e===`s`?`h`:`s`:e=>e===`r`?`b`:e===`g`?`r`:`g`):t.downArrow||t.tab?h(f===`hsl`?e=>e===`h`?`s`:e===`s`?`l`:`h`:e=>e===`r`?`g`:e===`g`?`b`:`r`):t.leftArrow?S(t.shift||t.ctrl||t.meta?-10:-1):t.rightArrow&&S(t.shift||t.ctrl||t.meta?10:1)});let S=e=>{v(!0),f===`hsl`?l(t=>{let n={...t};m===`h`?n.h=Math.max(0,Math.min(359,t.h+e)):m===`s`?n.s=Math.max(0,Math.min(100,t.s+e)):m===`l`&&(n.l=Math.max(0,Math.min(100,t.l+e)));let[r,i,a]=w(n.h,n.s,n.l);return d({r,g:i,b:a}),n}):d(t=>{let n={...t};return m===`r`?n.r=Math.max(0,Math.min(255,t.r+e)):m===`g`?n.g=Math.max(0,Math.min(255,t.g+e)):m===`b`&&(n.b=Math.max(0,Math.min(255,t.b+e))),l(C(n.r,n.g,n.b)),n}),v(!1)},C=(e,t,n)=>{let r=e/255,i=t/255,a=n/255,o=Math.max(r,i,a),s=Math.min(r,i,a),c=o-s,l=(o+s)/2,u=0;c!==0&&(u=l>.5?c/(2-o-s):c/(o+s));let d=0;return c!==0&&(d=o===r?((i-a)/c+(i<a?6:0))/6:o===i?((a-r)/c+2)/6:((r-i)/c+4)/6),{h:Math.round(d*360),s:Math.round(u*100),l:Math.round(l*100)}},w=(e,t,n)=>{e/=360,t/=100,n/=100;let r=(1-Math.abs(2*n-1))*t,i=r*(1-Math.abs(e*6%2-1)),a=n-r/2,o=0,s=0,c=0;return 0<=e&&e<1/6?(o=r,s=i,c=0):1/6<=e&&e<2/6?(o=i,s=r,c=0):2/6<=e&&e<3/6?(o=0,s=r,c=i):3/6<=e&&e<4/6?(o=0,s=i,c=r):4/6<=e&&e<5/6?(o=i,s=0,c=r):5/6<=e&&e<1&&(o=r,s=0,c=i),[Math.round((o+a)*255),Math.round((s+a)*255),Math.round((c+a)*255)]},ee=()=>{let e=[],t=[[255,0,0],[255,127,0],[255,255,0],[127,255,0],[0,255,0],[0,255,127],[0,255,255],[0,127,255],[0,0,255],[127,0,255],[255,0,255],[255,0,127],[255,0,0]];for(let n=0;n<40;n++){let r=n/39*(t.length-1),i=Math.floor(r),a=Math.ceil(r),o=r-i,[s,c,l]=t[i],[u,d,f]=t[a],p=Math.round(s+(u-s)*o),m=Math.round(c+(d-c)*o),h=Math.round(l+(f-l)*o);e.push(J(V,{backgroundColor:`rgb(${p},${m},${h})`,children:` `},n))}return e},T=()=>{let e=[];for(let t=0;t<40;t++){let n=t/39*100,[r,i,a]=w(c.h,n,c.l);e.push(J(V,{backgroundColor:`rgb(${r},${i},${a})`,children:` `},t))}return e},E=()=>{let e=[];for(let t=0;t<40;t++){let n=t/39*100,[r,i,a]=w(c.h,c.s,n);e.push(J(V,{backgroundColor:`rgb(${r},${i},${a})`,children:` `},t))}return e},D=()=>{let[e,t,n]=w(c.h,c.s,c.l);return`rgb(${e},${t},${n})`},O=(e,t,n)=>{let r=e=>e.toString(16).padStart(2,`0`);return`#${r(e)}${r(t)}${r(n)}`},k=()=>{let e=[];for(let t=0;t<40;t++){let n=Math.round(t/39*255);e.push(J(V,{backgroundColor:`rgb(${n},${u.g},${u.b})`,children:` `},t))}return e},A=()=>{let e=[];for(let t=0;t<40;t++){let n=Math.round(t/39*255);e.push(J(V,{backgroundColor:`rgb(${u.r},${n},${u.b})`,children:` `},t))}return e},j=()=>{let e=[];for(let t=0;t<40;t++){let n=Math.round(t/39*255);e.push(J(V,{backgroundColor:`rgb(${u.r},${u.g},${n})`,children:` `},t))}return e},M=(e,t)=>Math.round(e/t*39);return Y(B,{flexDirection:`column`,borderStyle:`single`,borderColor:`white`,padding:1,children:[Y(B,{flexDirection:`column`,children:[J(V,{bold:!0,children:`Color Picker`}),Y(B,{marginBottom:1,flexDirection:`column`,children:[J(V,{color:`gray`,dimColor:!0,children:`←→ to adjust (shift/ctrl/cmd +10)`}),J(V,{color:`gray`,dimColor:!0,children:`↑↓ to change bar`}),J(V,{color:`gray`,dimColor:!0,children:`ctrl+a to switch rgb/hsl`}),J(V,{color:`gray`,dimColor:!0,children:`paste color from clipboard`}),J(V,{color:`gray`,dimColor:!0,children:`enter to exit (auto-saved)`}),J(V,{color:`gray`,dimColor:!0,children:`esc to save and exit`})]})]}),f===`hsl`?Y(q,{children:[Y(B,{marginBottom:1,children:[J(B,{width:25,children:Y(V,{color:m===`h`?`yellow`:`white`,children:[m===`h`?`❯ `:` `,`Hue (`,c.h,`°):`]})}),J(B,{children:ee().map((e,t)=>J(ye,{children:t===M(c.h,360)?J(V,{children:`|`}):e},t))})]}),Y(B,{marginBottom:1,children:[J(B,{width:25,children:Y(V,{color:m===`s`?`yellow`:`white`,children:[m===`s`?`❯ `:` `,`Saturation (`,c.s,`%):`]})}),J(B,{children:T().map((e,t)=>J(ye,{children:t===M(c.s,100)?J(V,{children:`|`}):e},t))})]}),Y(B,{marginBottom:1,children:[J(B,{width:25,children:Y(V,{color:m===`l`?`yellow`:`white`,children:[m===`l`?`❯ `:` `,`Lightness (`,c.l,`%):`]})}),J(B,{children:E().map((e,t)=>J(ye,{children:t===M(c.l,100)?J(V,{children:`|`}):e},t))})]})]}):Y(q,{children:[Y(B,{marginBottom:1,children:[J(B,{width:25,children:Y(V,{color:m===`r`?`yellow`:`white`,children:[m===`r`?`❯ `:` `,`Red (`,u.r,`):`]})}),J(B,{children:k().map((e,t)=>J(ye,{children:t===M(u.r,255)?J(V,{children:`|`}):e},t))})]}),Y(B,{marginBottom:1,children:[J(B,{width:25,children:Y(V,{color:m===`g`?`yellow`:`white`,children:[m===`g`?`❯ `:` `,`Green (`,u.g,`):`]})}),J(B,{children:A().map((e,t)=>J(ye,{children:t===M(u.g,255)?J(V,{children:`|`}):e},t))})]}),Y(B,{marginBottom:1,children:[J(B,{width:25,children:Y(V,{color:m===`b`?`yellow`:`white`,children:[m===`b`?`❯ `:` `,`Blue (`,u.b,`):`]})}),J(B,{children:j().map((e,t)=>J(ye,{children:t===M(u.b,255)?J(V,{children:`|`}):e},t))})]})]}),Y(B,{marginBottom:1,children:[J(V,{children:`Current: `}),J(V,{backgroundColor:D(),children:` `})]}),Y(B,{flexDirection:`row`,justifyContent:`space-between`,children:[Y(B,{flexDirection:`column`,children:[J(V,{dimColor:!0,children:`Hex `}),r?.startsWith(`diff`)?J(V,{backgroundColor:D(),color:a?.colors?.text||`white`,bold:!0,children:O(u.r,u.g,u.b)}):r===`inverseText`?J(V,{color:D(),backgroundColor:a?.colors?.permission,bold:!0,children:O(u.r,u.g,u.b)}):J(V,{color:D(),bold:!0,children:O(u.r,u.g,u.b)})]}),Y(B,{flexDirection:`column`,children:[J(V,{dimColor:!0,children:`RGB `}),r?.startsWith(`diff`)?J(V,{backgroundColor:D(),color:a?.colors?.text||`white`,bold:!0,children:`rgb(${u.r}, ${u.g}, ${u.b})`}):r===`inverseText`?J(V,{color:D(),backgroundColor:a?.colors?.permission,bold:!0,children:`rgb(${u.r}, ${u.g}, ${u.b})`}):J(V,{color:D(),bold:!0,children:`rgb(${u.r}, ${u.g}, ${u.b})`})]}),Y(B,{flexDirection:`column`,children:[J(V,{dimColor:!0,children:`HSL `}),r?.startsWith(`diff`)?J(V,{backgroundColor:D(),color:a?.colors?.text||`white`,bold:!0,children:`hsl(${c.h}, ${c.s}%, ${c.l}%)`}):r===`inverseText`?J(V,{color:D(),backgroundColor:a?.colors?.permission,bold:!0,children:`hsl(${c.h}, ${c.s}%, ${c.l}%)`}):J(V,{color:D(),bold:!0,children:`hsl(${c.h}, ${c.s}%, ${c.l}%)`})]})]})]})}function Qe(e){let t=e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(t)return{r:parseInt(t[1]),g:parseInt(t[2]),b:parseInt(t[3])};let n=e.match(/^#([a-fA-F0-9]{6})$/);if(n){let e=n[1];return{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16)}}return null}function $e(e){let t=e.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);if(t)return{h:parseInt(t[1]),s:parseInt(t[2]),l:parseInt(t[3])};let n=e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(n){let e=parseInt(n[1])/255,t=parseInt(n[2])/255,r=parseInt(n[3])/255,i=Math.max(e,t,r),a=Math.min(e,t,r),o=i-a,s=(i+a)/2,c=0;o!==0&&(c=s>.5?o/(2-i-a):o/(i+a));let l=0;return o!==0&&(l=i===e?((t-r)/o+(t<r?6:0))/6:i===t?((r-e)/o+2)/6:((e-t)/o+4)/6),{h:Math.round(l*360),s:Math.round(c*100),l:Math.round(s*100)}}let r=e.match(/^#([a-fA-F0-9]{6})$/);if(r){let e=r[1],t=parseInt(e.substr(0,2),16)/255,n=parseInt(e.substr(2,2),16)/255,i=parseInt(e.substr(4,2),16)/255,a=Math.max(t,n,i),o=Math.min(t,n,i),s=a-o,c=(a+o)/2,l=0;s!==0&&(l=c>.5?s/(2-a-o):s/(a+o));let u=0;return s!==0&&(u=a===t?((n-i)/s+(n<i?6:0))/6:a===n?((i-t)/s+2)/6:((t-n)/s+4)/6),{h:Math.round(u*360),s:Math.round(l*100),l:Math.round(c*100)}}return{h:0,s:50,l:50}}function et({onBack:e,themeId:n}){let{settings:{themes:r},updateSettings:a}=W($),[o,s]=K(n),c=r.find(e=>e.id===o)||r[0],[l,u]=K(`rgb`),[d,f]=K(0),[p,m]=K(null),[h,_]=K(null),[v,y]=K(``),[b,x]=K(``),[S,C]=K(!1),[w,ee]=K(0),T=xe(e=>{a(t=>{let n=t.themes.findIndex(e=>e.id===o);n!==-1&&e(t.themes[n])})},[o,a]),E=e=>{if(d>=2&&g(e)){let t=i(e),n=D[d-2];T(e=>{e.colors[n]=t})}};H((t,n)=>{if(S){if(n.escape){C(!1),e();return}return}if(p===null&&h===null){if(t.length>1&&!n.ctrl&&!n.meta){E(t);return}if(n.escape)C(!0),ee(0);else if(n.ctrl&&t===`a`)u(e=>e===`rgb`?`hex`:e===`hex`?`hsl`:`rgb`);else if(n.upArrow)f(e=>Math.max(0,e-1));else if(n.downArrow)f(e=>Math.min(D.length+1,e+1));else if(n.return)if(d===0)_(`name`),y(c.name),x(c.name);else if(d===1)_(`id`),y(c.id),x(c.id);else{let e=d-2,t=D[e],n=c.colors[t];m(e),y(n),x(n)}}else if(p!==null)n.ctrl&&t===`a`&&u(e=>e===`rgb`?`hex`:e===`hex`?`hsl`:`rgb`);else if(h!==null)if(n.return){if(h===`id`){let e=o;s(v),a(t=>{let n=t.themes.findIndex(t=>t.id===e);n!==-1&&(t.themes[n].id=v)})}else T(e=>{e.name=v});_(null),y(``),x(``)}else n.escape?(_(null),y(``),x(``)):n.backspace||n.delete?y(e=>e.slice(0,-1)):t&&y(e=>e+t)});let D=Object.keys(c.colors),O=(e,t)=>{let n=e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(!n)return e;let r=parseInt(n[1]),i=parseInt(n[2]),a=parseInt(n[3]);switch(t){case`hex`:{let e=e=>e.toString(16).padStart(2,`0`);return`#${e(r)}${e(i)}${e(a)}`}case`hsl`:{let e=r/255,t=i/255,n=a/255,o=Math.max(e,t,n),s=Math.min(e,t,n),c=o-s,l=(o+s)/2,u=0;c!==0&&(u=l>.5?c/(2-o-s):c/(o+s));let d=0;return c!==0&&(d=o===e?((t-n)/c+(t<n?6:0))/6:o===t?((n-e)/c+2)/6:((e-t)/c+4)/6),`hsl(${Math.round(d*360)}, ${Math.round(u*100)}%, ${Math.round(l*100)}%)`}case`rgb`:default:return e}},k=e=>({autoAccept:`Auto-accept edits mode indicator`,bashBorder:`Bash command border`,claude:`Claude branding color. Used for the Claude logo, the welcome message, and the thinking text.`,claudeShimmer:`Color used for the shimmering effect on the thinking verb.`,claudeBlue_FOR_SYSTEM_SPINNER:`System spinner color (blue variant)`,claudeBlueShimmer_FOR_SYSTEM_SPINNER:`System spinner shimmer color (blue variant)`,permission:`Permission prompt color`,permissionShimmer:`Permission prompt shimmer color`,planMode:`Plan mode indicator`,ide:`Color used for IDE-related messages.`,promptBorder:`Input prompt border color`,promptBorderShimmer:`Input prompt border shimmer color`,text:`Code color. Used in diffs.`,inverseText:`Inverse text color. Used for the text of tabs, where the background is filled in.`,inactive:`Inactive/dimmed text. Used for line numbers and less prominent text.`,subtle:`Subtle text. Used for help text and secondary information.`,suggestion:`Suggestion text color. Used for suggestions for theme names and various other things.`,remember:`Remember/note color. Used for various text relating to memories.`,background:`Background color for certain UI elements`,success:`Success indicator. Used for the bullet on successful tool calls, and various success messages (such as sign in successful).`,error:`Error indicator`,warning:`Warning indicator`,warningShimmer:`Warning shimmer color`,diffAdded:`Added diff background`,diffRemoved:`Removed diff background`,diffAddedDimmed:`Added diff background (dimmed)`,diffRemovedDimmed:`Removed diff background (dimmed)`,diffAddedWord:`Added word highlight`,diffRemovedWord:`Removed word highlight`,diffAddedWordDimmed:`Added word highlight (dimmed)`,diffRemovedWordDimmed:`Removed word highlight (dimmed)`,red_FOR_SUBAGENTS_ONLY:`Red color for sub agents`,blue_FOR_SUBAGENTS_ONLY:`Blue color for sub agents`,green_FOR_SUBAGENTS_ONLY:`Green color for sub agents`,yellow_FOR_SUBAGENTS_ONLY:`Yellow color for sub agents`,purple_FOR_SUBAGENTS_ONLY:`Purple color for sub agents`,orange_FOR_SUBAGENTS_ONLY:`Orange color for sub agents`,pink_FOR_SUBAGENTS_ONLY:`Pink color for sub agents`,cyan_FOR_SUBAGENTS_ONLY:`Cyan color for sub agents`,professionalBlue:`Professional blue color for business contexts?`,rainbow_red:`"ultrathink" rainbow - red`,rainbow_orange:`"ultrathink" rainbow - orange`,rainbow_yellow:`"ultrathink" rainbow - yellow`,rainbow_green:`"ultrathink" rainbow - green`,rainbow_blue:`"ultrathink" rainbow - blue`,rainbow_indigo:`"ultrathink" rainbow - indigo`,rainbow_violet:`"ultrathink" rainbow - violet`,rainbow_red_shimmer:`"ultrathink" rainbow (shimmer) - red`,rainbow_orange_shimmer:`"ultrathink" rainbow (shimmer) - orange`,rainbow_yellow_shimmer:`"ultrathink" rainbow (shimmer) - yellow`,rainbow_green_shimmer:`"ultrathink" rainbow (shimmer) - green`,rainbow_blue_shimmer:`"ultrathink" rainbow (shimmer) - blue`,rainbow_indigo_shimmer:`"ultrathink" rainbow (shimmer) - indigo`,rainbow_violet_shimmer:`"ultrathink" rainbow (shimmer) - violet`,clawd_body:`"Clawd" character body color`,clawd_background:`"Clawd" character background color`,userMessageBackground:`Background color for user messages`,bashMessageBackgroundColor:`Background color for bash command output`,memoryBackgroundColor:`Background color for memory/context information`,rate_limit_fill:`Rate limit indicator fill color`,rate_limit_empty:`Rate limit indicator empty/background color`})[e]||``,A=Math.max(...D.map(e=>e.length));return Y(B,{children:[Y(B,{flexDirection:`column`,width:`50%`,children:[J(B,{children:Y(X,{children:[`Editing theme “`,c.name,`” (`,c.id,`)`]})}),S?Y(B,{flexDirection:`column`,marginTop:1,children:[J(B,{marginBottom:1,children:Y(V,{bold:!0,children:[`Would you like to make “`,c.name,`” your current Claude Code theme?`]})}),J(ze,{items:[{name:`Yes`,desc:`Set ${c.id} as active theme`},{name:`No`,desc:`Go back without changing theme`}],selectedIndex:w,onSelect:ee,onSubmit:()=>{w===0&&t(c.id),C(!1),e()}}),J(V,{dimColor:!0,children:`enter to select, esc to cancel`})]}):p===null&&h===null?Y(q,{children:[Y(B,{marginBottom:1,flexDirection:`column`,children:[J(V,{dimColor:!0,children:`enter to edit theme name, id, or color`}),J(V,{dimColor:!0,children:`ctrl+a to toggle rgb, hex, hsl`}),J(V,{dimColor:!0,children:`paste color from clipboard (when on color)`}),J(V,{dimColor:!0,children:`esc to go back`})]}),d<2?Y(B,{marginBottom:1,borderStyle:`single`,borderTop:!1,borderBottom:!1,borderRight:!1,borderColor:`yellow`,flexDirection:`column`,paddingLeft:1,children:[J(V,{bold:!0,children:d===0?`Theme Name`:`Theme ID`}),J(V,{children:d===0?`The display name for this theme`:"Unique identifier for this theme; used in `.claude.json` to select the theme."})]}):Y(B,{marginBottom:1,borderStyle:`single`,borderTop:!1,borderBottom:!1,borderRight:!1,borderColor:c.colors[D[d-2]],flexDirection:`column`,paddingLeft:1,children:[J(Xe,{colorKey:D[d-2],theme:c,bold:!0}),J(V,{children:k(D[d-2])})]}),Y(B,{flexDirection:`column`,children:[Y(B,{children:[J(V,{color:d===0?`yellow`:`white`,children:d===0?`❯ `:` `}),J(V,{bold:!0,children:`Name: `}),J(V,{children:c.name})]}),Y(B,{marginBottom:1,children:[J(V,{color:d===1?`yellow`:`white`,children:d===1?`❯ `:` `}),J(V,{bold:!0,children:`ID: `}),J(V,{children:c.id})]}),(()=>{if(d<2)return Y(q,{children:[D.slice(0,20).map((e,t)=>{let n=t+2;return Y(B,{children:[J(V,{color:d===n?`yellow`:`white`,children:d===n?`❯ `:` `}),J(B,{width:A+2,children:J(V,{children:J(Xe,{colorKey:e,theme:c,bold:!0})})}),J(Q,{color:c.colors[e],children:O(c.colors[e],l)})]},e)}),D.length>20&&Y(V,{color:`gray`,dimColor:!0,children:[` `,`↓ `,D.length-20,` more below`]})]});let e=d-2,t=Math.max(0,e-10),n=Math.min(D.length,t+20),r=Math.max(0,n-20),i=D.slice(r,n);return Y(q,{children:[r>0&&Y(V,{color:`gray`,dimColor:!0,children:[` `,`↑ `,r,` more above`]}),i.map((e,t)=>{let n=r+t+2;return Y(B,{children:[J(V,{color:d===n?`yellow`:`white`,children:d===n?`❯ `:` `}),J(B,{width:A+2,children:J(V,{children:J(Xe,{colorKey:e,theme:c,bold:!0})})}),J(Q,{color:c.colors[e],children:O(c.colors[e],l)})]},e)}),n<D.length&&Y(V,{color:`gray`,dimColor:!0,children:[` `,`↓ `,D.length-n,` more below`]})]})})()]})]}):h?Y(B,{flexDirection:`column`,marginTop:1,children:[Y(V,{children:[`Editing `,h===`name`?`theme name`:`theme ID`,`:`]}),J(B,{borderStyle:`round`,borderColor:`yellow`,paddingX:1,children:J(V,{children:v})}),J(V,{dimColor:!0,children:`enter to save, esc to cancel`})]}):J(Ze,{initialValue:b,colorKey:D[p],theme:c,onColorChange:e=>{y(e),T(t=>{t.colors[D[p]]=e})},onExit:()=>{T(e=>{e.colors[D[p]]=v}),m(null),y(``),x(``)}})]}),J(B,{width:`50%`,children:J(Ye,{theme:c})})]})}const tt=`https://raw.githubusercontent.com/Piebald-AI/claude-code-themes/main`,nt=`${tt}/index.json`;async function rt(){F(`Fetching community theme index from ${nt}`);let e=await fetch(nt,{headers:{Accept:`application/json`}});if(!e.ok)throw Error(`Failed to fetch community theme index: ${e.status} ${e.statusText}`);return await e.json()}async function it(e){let t=`${tt}/themes/${e}.json`;F(`Fetching community theme from ${t}`);let n=await fetch(t,{headers:{Accept:`application/json`}});if(!n.ok)throw Error(`Failed to fetch community theme "${e}": ${n.status} ${n.statusText}`);return await n.json()}function at({onBack:e}){let{updateSettings:t}=W($),[n,r]=K({status:`loading`}),[i,a]=K(0),[o,s]=K(null),[c,l]=K(!1),[u,d]=K(null),f=Ce(0);G(()=>{rt().then(e=>{r({status:`loaded`,entries:e})}).catch(e=>{r({status:`error`,message:e.message})})},[]);let p=n.status===`loaded`?n.entries:[],m=xe(async e=>{let t=++f.current;l(!0),d(null);try{let n=await it(e);if(t!==f.current)return;s(te(n,E))}catch{if(t!==f.current)return;s(null),d(`Failed to load preview.`)}finally{t===f.current&&l(!1)}},[]),h=xe(async e=>{d(`Downloading theme…`);try{let n=te(await it(e.id),E),r=!1;t(e=>{e.themes.some(e=>e.id===n.id)||(e.themes.push(n),r=!0)}),d(r?`Added "${n.name}" to your themes!`:`Theme "${n.name}" (${n.id}) is already in your config.`)}catch{d(`Failed to download theme.`)}},[t]);return H((t,r)=>{if(r.escape){e();return}if(n.status!==`loaded`)return;let o=n.entries.length;if(o!==0){if(r.upArrow)a(e=>Math.max(0,e-1)),s(null),d(null);else if(r.downArrow)a(e=>Math.min(o-1,e+1)),s(null),d(null);else if(t===` `){let e=n.entries[i];e&&m(e.id)}else if(r.return){let e=n.entries[i];e&&h(e)}}}),n.status===`loading`?Y(B,{flexDirection:`column`,children:[J(X,{children:`Community Themes`}),J(V,{children:`Loading community themes…`})]}):n.status===`error`?Y(B,{flexDirection:`column`,children:[J(X,{children:`Community Themes`}),Y(V,{color:`red`,children:[`Error: `,n.message]}),J(V,{dimColor:!0,children:`esc to go back`})]}):Y(B,{children:[Y(B,{flexDirection:`column`,width:`50%`,children:[J(X,{children:`Community Themes`}),Y(B,{marginBottom:1,flexDirection:`column`,children:[J(V,{dimColor:!0,children:`space to preview theme`}),J(V,{dimColor:!0,children:`enter to download theme`}),J(V,{dimColor:!0,children:`esc to go back`})]}),J(B,{flexDirection:`column`,children:p.map((e,t)=>Y(V,{color:i===t?`yellow`:void 0,children:[i===t?`❯ `:` `,e.name,` (`,e.id,`) by @`,e.author]},e.id))}),u&&J(B,{marginTop:1,children:J(V,{color:`cyan`,children:u})}),c&&J(B,{marginTop:1,children:J(V,{dimColor:!0,children:`Loading preview…`})})]}),J(B,{width:`50%`,children:o?J(Ye,{theme:o}):J(B,{flexDirection:`column`,justifyContent:`center`,alignItems:`center`,height:10,children:J(V,{dimColor:!0,children:`Press space to preview the selected theme.`})})})]})}function ot(e){return e.map(e=>`${e.name} (${e.id})`)}function st({onBack:t}){let{settings:{themes:n},updateSettings:r}=W($),[i,a]=K(0),[o,s]=K(null),[c,l]=K(!0),[u,d]=K(!1),f=n.length+1,p=()=>{let t={colors:{...(n[0]||e.themes[0]).colors},name:`New Custom Theme`,id:`custom-${Date.now()}`};r(e=>{e.themes.push(t)}),s(t.id),l(!1)},m=e=>{n.length<=1||(r(t=>{t.themes=t.themes.filter(t=>t.id!==e)}),i>=n.length-1&&a(Math.max(0,n.length-2)))},h=()=>{r(t=>{t.themes=[...e.themes]}),a(0)},g=i===n.length;if(H((e,r)=>{if(r.escape)t();else if(r.upArrow)a(e=>Math.max(0,e-1));else if(r.downArrow)a(e=>Math.min(f-1,e+1));else if(r.return)if(g)d(!0),l(!1);else{let e=n[i];e&&(s(e.id),l(!1))}else if(e===`n`)p();else if(e===`d`){if(!g){let e=n[i];e&&m(e.id)}}else r.ctrl&&e===`r`&&h()},{isActive:c}),u)return J(at,{onBack:()=>{d(!1),l(!0)}});if(o)return J(et,{themeId:o,onBack:()=>{s(null),l(!0)}});let _=ot(n),v=n.find(e=>_[i]?.includes(`(${e.id})`))||n[0];return n.length===0?J(B,{children:Y(B,{flexDirection:`column`,width:`100%`,children:[J(X,{children:`Themes`}),Y(B,{marginBottom:1,flexDirection:`column`,children:[J(V,{dimColor:!0,children:`n to create a new theme`}),J(V,{dimColor:!0,children:`esc to go back`})]}),J(V,{children:`No themes available!`})]})}):Y(B,{children:[Y(B,{flexDirection:`column`,width:`50%`,children:[J(X,{children:`Themes`}),Y(B,{marginBottom:1,flexDirection:`column`,children:[J(V,{dimColor:!0,children:`n to create a new theme`}),J(V,{dimColor:!0,children:`d to delete a theme`}),J(V,{dimColor:!0,children:`ctrl+r to delete all themes and restore built-in`}),J(V,{dimColor:!0,children:`enter to edit theme`}),J(V,{dimColor:!0,children:`esc to go back`})]}),Y(B,{flexDirection:`column`,children:[_.map((e,t)=>Y(V,{color:i===t?`yellow`:void 0,children:[i===t?`❯ `:` `,e]},t)),Y(V,{color:g?`blue`:void 0,bold:g,children:[g?`❯ `:` `,`Browse community themes…`]})]})]}),J(B,{width:`50%`,children:g?J(B,{flexDirection:`column`,justifyContent:`center`,alignItems:`center`,height:10,children:J(V,{dimColor:!0,children:`Press enter to browse community themes.`})}):J(Ye,{theme:v})})]})}function ct({onBack:t}){let{settings:{thinkingVerbs:{format:n,verbs:r},themes:i},updateSettings:a}=W($),o=[`format`,`verbs`],[s,c]=K(0),l=o[s],[u,d]=K(0),[f,p]=K(!1),[m,h]=K(``),[g,_]=K(!1),[v,y]=K(!1),[b,x]=K(n),S=ee(),C=(i.find(e=>e.id===S)||i.find(e=>e.id===`dark`))?.colors.claude||`rgb(215,119,87)`;return H((i,s)=>{if(v){s.return?(a(e=>{e.thinkingVerbs.format=b}),y(!1)):s.escape?(x(n),y(!1)):s.backspace||s.delete?x(e=>e.slice(0,-1)):i&&x(e=>e+i);return}if(f||g){s.return&&m.trim()?(g?(a(e=>{e.thinkingVerbs.verbs.push(m.trim())}),_(!1)):(a(e=>{e.thinkingVerbs.verbs[u]=m.trim()}),p(!1)),h(``)):s.escape?(h(``),p(!1),_(!1)):s.backspace||s.delete?h(e=>e.slice(0,-1)):i&&h(e=>e+i);return}s.escape?t():s.return?l===`format`&&(x(n),y(!0)):s.tab?s.shift?c(e=>e===0?o.length-1:e-1):c(e=>e===o.length-1?0:e+1):s.upArrow?l===`verbs`&&r.length>0&&d(e=>e>0?e-1:r.length-1):s.downArrow?l===`verbs`&&r.length>0&&d(e=>e<r.length-1?e+1:0):i===`e`&&l===`verbs`?r.length>0&&(h(r[u]),p(!0)):i===`d`&&l===`verbs`?r.length>1&&(a(e=>{e.thinkingVerbs.verbs=e.thinkingVerbs.verbs.filter((e,t)=>t!==u)}),u>=r.length-1&&d(Math.max(0,r.length-2))):i===`n`&&l===`verbs`?(_(!0),h(``)):s.ctrl&&i===`r`&&l===`verbs`&&(a(t=>{t.thinkingVerbs.verbs=[...e.thinkingVerbs.verbs]}),d(0))}),Y(B,{children:[Y(B,{flexDirection:`column`,width:`50%`,children:[Y(B,{marginBottom:1,flexDirection:`column`,children:[J(X,{children:`Thinking Verbs`}),Y(B,{flexDirection:`column`,children:[J(V,{dimColor:!0,children:l===`format`?`enter to edit format`:`changes auto-saved`}),J(V,{dimColor:!0,children:`esc to go back`}),J(V,{dimColor:!0,children:`tab to switch sections`})]})]}),J(B,{marginBottom:1,children:J(V,{dimColor:!0,children:`Customize the verbs shown during generation and their format.`})}),Y(B,{flexDirection:`column`,children:[Y(V,{children:[J(V,{color:l===`format`?`yellow`:void 0,children:l===`format`?`❯ `:` `}),J(V,{bold:!0,color:l===`format`?`yellow`:void 0,children:`Format`})]}),l===`format`&&(v?Y(V,{dimColor:!0,children:[` `,`enter to save`]}):Y(V,{dimColor:!0,children:[` `,`enter to edit`]}))]}),J(B,{marginLeft:2,marginBottom:1,children:J(B,{borderStyle:`round`,borderColor:v?`yellow`:`gray`,children:J(V,{children:v?b:n})})}),J(B,{children:Y(V,{children:[J(V,{color:l===`verbs`?`yellow`:void 0,children:l===`verbs`?`❯ `:` `}),J(V,{bold:!0,color:l===`verbs`?`yellow`:void 0,children:`Verbs`})]})}),l===`verbs`&&J(B,{flexDirection:`column`,children:Y(V,{dimColor:!0,children:[` `,`e to edit · d to delete · n to add new · ctrl+r to reset`]})}),J(B,{marginLeft:2,marginBottom:1,children:Y(B,{flexDirection:`column`,children:[(()=>{let e=Math.max(0,u-4),t=Math.min(r.length,e+8),n=Math.max(0,t-8),i=r.slice(n,t);return Y(q,{children:[n>0&&Y(V,{color:`gray`,dimColor:!0,children:[` `,`↑ `,n,` more above`]}),i.map((e,t)=>{let r=n+t;return Y(V,{color:l===`verbs`&&r===u?`cyan`:void 0,children:[l===`verbs`&&r===u?`❯ `:` `,e]},r)}),t<r.length&&Y(V,{color:`gray`,dimColor:!0,children:[` `,`↓ `,r.length-t,` more below`]})]})})(),g&&Y(B,{alignItems:`center`,children:[J(V,{color:`yellow`,children:`❯ `}),J(B,{borderStyle:`round`,borderColor:`yellow`,children:J(V,{children:m})})]}),f&&Y(B,{marginTop:1,alignItems:`center`,children:[J(V,{children:`Editing: `}),J(B,{borderStyle:`round`,borderColor:`yellow`,children:J(V,{children:m})})]})]})})]}),Y(B,{width:`50%`,flexDirection:`column`,children:[J(B,{marginBottom:1,children:J(V,{bold:!0,children:`Preview`})}),J(B,{borderStyle:`single`,borderColor:`gray`,padding:1,flexDirection:`column`,children:Y(V,{children:[Y(V,{color:C,children:[`✻ `,n.replace(/\{\}/g,r[u]),` `]}),J(V,{children:`(esc to interrupt)`})]})})]})]})}const lt=e=>e.replace(/([a-z])([A-Z])/g,`$1 $2`).replace(/([A-Z])([A-Z][a-z])/g,`$1 $2`).replace(/(\d+)/g,` $1 `).replace(/\s+/g,` `).trim().replace(/^./,e=>e.toUpperCase()),ut=e=>{let t=Math.max(...e.map(e=>e.length));return e.map(e=>e.padEnd(t))},dt=Object.entries(Fe).map(([e,t])=>({name:lt(e),phases:t.frames.map(e=>e.trimEnd()),reverseMirror:!1,updateInterval:t.interval})),ft=[{name:`Default`,phases:e.thinkingStyle.phases,reverseMirror:e.thinkingStyle.reverseMirror},{name:`Wave`,phases:[`▁`,`▃`,`▄`,`▅`,`▆`,`▇`,`█`],reverseMirror:!0},{name:`Glow`,phases:[`░`,`▒`,`▓`,`█`],reverseMirror:!0},{name:`Partial block`,phases:[`▏`,`▎`,`▍`,`▌`,`▋`,`▊`,`▉`,`█`],reverseMirror:!0},{name:`Colors`,phases:[`🔴`,`🟠`,`🟡`,`🟢`,`🔵`,`🟣`],reverseMirror:!1},...dt];function pt({onBack:t}){let{settings:{thinkingStyle:{phases:n,updateInterval:r,reverseMirror:i},themes:a},updateSettings:o}=W($),s=[`reverseMirror`,`updateInterval`,`phases`,`presets`],[c,l]=K(0),u=s[c],[d,f]=K(0),[p,m]=K(0),[h,g]=K(!1),[_,v]=K(``),[y,b]=K(!1),[x,S]=K(!1),[C,w]=K(r.toString()),[T,E]=K(0),D=ee(),O=(a.find(e=>e.id===D)||a.find(e=>e.id===`dark`))?.colors.claude||`rgb(215,119,87)`;G(()=>{if(n.length>0){let e=i?[...n,...[...n].reverse().slice(1,-1)]:n,t=setInterval(()=>{E(t=>(t+1)%e.length)},r);return()=>clearInterval(t)}},[n,r,i]),H((i,a)=>{if(x){if(a.return){let e=parseInt(C);!isNaN(e)&&e>0&&o(t=>{t.thinkingStyle.updateInterval=e}),S(!1)}else a.escape?(w(r.toString()),S(!1)):a.backspace||a.delete?w(e=>e.slice(0,-1)):i&&i.match(/^[0-9]$/)&&w(e=>e+i);return}if(h||y){if(a.return&&_.length){let e=y?[...n,_]:n.map((e,t)=>t===d?_:e);o(t=>{t.thinkingStyle.phases=ut(e)}),g(!1),v(``)}else a.escape?(v(``),g(!1),b(!1)):a.backspace||a.delete?v(e=>e.slice(0,-1)):i&&v(e=>e+i);return}if(a.escape)t();else if(a.return)if(u===`updateInterval`)w(r.toString()),S(!0);else if(u===`presets`){let e=ft[p];o(t=>{t.thinkingStyle.phases=ut([...e.phases]),t.thinkingStyle.reverseMirror=e.reverseMirror,e.updateInterval!==void 0&&(t.thinkingStyle.updateInterval=e.updateInterval)})}else u===`reverseMirror`&&o(e=>{e.thinkingStyle.reverseMirror=!e.thinkingStyle.reverseMirror});else if(a.tab)a.shift?l(e=>e===0?s.length-1:e-1):l(e=>e===s.length-1?0:e+1);else if(a.upArrow)u===`phases`&&n.length>0?f(e=>e>0?e-1:n.length-1):u===`presets`&&m(e=>e>0?e-1:ft.length-1);else if(a.downArrow)u===`phases`&&n.length>0?f(e=>e<n.length-1?e+1:0):u===`presets`&&m(e=>e<ft.length-1?e+1:0);else if(i===` `)u===`reverseMirror`&&o(e=>{e.thinkingStyle.reverseMirror=!e.thinkingStyle.reverseMirror});else if(i===`e`&&u===`phases`)n.length>0&&(v(n[d]),g(!0));else if(i===`a`&&u===`phases`)b(!0),v(``);else if(i===`d`&&u===`phases`)n.length>1&&(o(e=>{e.thinkingStyle.phases=ut(n.filter((e,t)=>t!==d))}),d>=n.length&&f(Math.max(0,n.length-1)));else if(i===`w`&&u===`phases`){if(d>0){let e=[...n];[e[d-1],e[d]]=[e[d],e[d-1]],o(t=>{t.thinkingStyle.phases=e}),f(e=>e-1)}}else if(i===`s`&&u===`phases`){if(d<n.length-1){let e=[...n];[e[d],e[d+1]]=[e[d+1],e[d]],o(t=>{t.thinkingStyle.phases=e}),f(e=>e+1)}}else a.ctrl&&i===`r`&&(o(t=>{t.thinkingStyle=e.thinkingStyle}),f(0),m(0))});let k=i?`●`:`○`,A=(()=>i?[...n,...[...n].reverse().slice(1,-1)]:n)(),j=A.length>0?A[T]:`·`;return J(B,{children:Y(B,{flexDirection:`column`,width:`100%`,children:[Y(B,{flexDirection:`row`,width:`100%`,children:[Y(B,{marginBottom:1,flexDirection:`column`,width:`50%`,children:[J(X,{children:`Thinking style`}),Y(B,{flexDirection:`column`,children:[Y(V,{dimColor:!0,children:[`enter to`,` `,u===`updateInterval`?`edit interval`:u===`presets`?`apply preset`:`save`]}),J(V,{dimColor:!0,children:`esc to go back`}),J(V,{dimColor:!0,children:`tab to switch sections`})]})]}),Y(B,{width:`50%`,flexDirection:`column`,children:[J(B,{children:J(V,{bold:!0,children:`Preview`})}),Y(B,{borderStyle:`single`,borderColor:`gray`,paddingX:1,flexDirection:`row`,children:[J(B,{width:(j?.length??0)+1,children:J(V,{color:O,children:j})}),Y(V,{children:[J(V,{color:O,children:`Thinking… `}),J(V,{children:`(esc to interrupt)`})]})]})]})]}),Y(B,{flexDirection:`row`,gap:4,children:[Y(B,{flexDirection:`column`,children:[Y(V,{children:[J(V,{color:u===`reverseMirror`?`yellow`:void 0,children:u===`reverseMirror`?`❯ `:` `}),J(V,{bold:!0,color:u===`reverseMirror`?`yellow`:void 0,children:`Reverse-mirror phases`})]}),u===`reverseMirror`&&Y(V,{dimColor:!0,children:[` `,`space to toggle`]}),J(B,{marginLeft:2,marginBottom:1,children:Y(V,{children:[k,` `,i?`Enabled`:`Disabled`]})})]}),Y(B,{flexDirection:`column`,children:[Y(V,{children:[J(V,{color:u===`updateInterval`?`yellow`:void 0,children:u===`updateInterval`?`❯ `:` `}),J(V,{bold:!0,color:u===`updateInterval`?`yellow`:void 0,children:`Update interval (ms)`})]}),u===`updateInterval`&&(x?Y(V,{dimColor:!0,children:[` `,`enter to save`]}):Y(V,{dimColor:!0,children:[` `,`enter to edit`]})),J(B,{marginLeft:2,marginBottom:1,children:J(B,{borderStyle:`round`,borderColor:x?`yellow`:`gray`,children:J(V,{children:x?C:r})})})]})]}),J(B,{children:Y(V,{children:[J(V,{color:u===`phases`?`yellow`:void 0,children:u===`phases`?`❯ `:` `}),J(V,{bold:!0,color:u===`phases`?`yellow`:void 0,children:`Phases`})]})}),u===`phases`&&J(B,{marginBottom:1,flexDirection:`column`,children:Y(V,{dimColor:!0,children:[` `,`[e]dit`,` `,`[a]dd`,` `,`[d]elete`,` `,`[w]move up`,` `,`[s]move down`]})}),J(B,{marginLeft:2,marginBottom:1,children:Y(B,{flexDirection:`column`,children:[(()=>{let e=Math.max(0,d-4),t=Math.min(n.length,e+8),r=Math.max(0,t-8),i=n.slice(r,t);return Y(q,{children:[r>0&&Y(V,{color:`gray`,dimColor:!0,children:[` `,`↑ `,r,` more above`]}),i.map((e,t)=>{let n=r+t;return Y(V,{color:u===`phases`&&n===d?`cyan`:void 0,children:[u===`phases`&&n===d?`❯ `:` `,e]},n)}),t<n.length&&Y(V,{color:`gray`,dimColor:!0,children:[` `,`↓ `,n.length-t,` more below`]})]})})(),y&&Y(B,{children:[J(V,{color:`yellow`,children:`❯ `}),J(B,{borderStyle:`round`,borderColor:`yellow`,children:J(V,{children:_})})]}),h&&Y(B,{marginTop:1,children:[J(V,{children:`Editing: `}),J(B,{borderStyle:`round`,borderColor:`yellow`,children:J(V,{children:_})})]})]})}),J(B,{children:Y(V,{children:[J(V,{color:u===`presets`?`yellow`:void 0,children:u===`presets`?`❯ `:` `}),J(V,{bold:!0,color:u===`presets`?`yellow`:void 0,children:`Presets`})]})}),u===`presets`&&Y(V,{dimColor:!0,children:[` `,`Selecting one will overwrite your choice of phases and interval`]}),J(B,{marginLeft:2,marginBottom:1,children:J(B,{flexDirection:`column`,children:(()=>{let e=Math.max(0,p-6),t=Math.min(ft.length,e+12),n=Math.max(0,t-12),r=ft.slice(n,t),i=e=>{let t=e.phases.join(``);return t.length>30?t.slice(0,27)+`…`:t};return Y(q,{children:[n>0&&Y(V,{color:`gray`,dimColor:!0,children:[` `,`↑ `,n,` more above`]}),r.map((e,t)=>{let r=n+t,a=u===`presets`&&r===p;return Y(V,{color:a?`cyan`:void 0,children:[a?`❯ `:` `,e.name,` `,i(e)]},r)}),t<ft.length&&Y(V,{color:`gray`,dimColor:!0,children:[` `,`↓ `,ft.length-t,` more below`]})]})})()})}),J(B,{marginTop:1,children:J(V,{dimColor:!0,children:`ctrl+r to reset all settings to default`})})]})})}function mt(e,t){let n=Ce(!0);G(()=>{if(n.current){n.current=!1;return}return e()},t)}const ht=[{label:`bold`,value:`bold`},{label:`italic`,value:`italic`},{label:`underline`,value:`underline`},{label:`strikethrough`,value:`strikethrough`},{label:`inverse`,value:`inverse`}],gt=[{label:`none`,value:`none`},{label:`single`,value:`single`},{label:`double`,value:`double`},{label:`round`,value:`round`},{label:`bold`,value:`bold`},{label:`singleDouble`,value:`singleDouble`},{label:`doubleSingle`,value:`doubleSingle`},{label:`classic`,value:`classic`},{label:`topBottomSingle`,value:`topBottomSingle`},{label:`topBottomDouble`,value:`topBottomDouble`},{label:`topBottomBold`,value:`topBottomBold`}];function _t({onBack:t}){let{settings:n,updateSettings:r}=W($),[i,a]=K(!1),[o,s]=K(!1),[c,l]=K(!1),[u,d]=K(()=>n.userMessageDisplay.format),[f,p]=K(()=>n.userMessageDisplay.paddingX===`default`?`default`:`custom`),[m,h]=K(()=>n.userMessageDisplay.paddingY===`default`?`default`:`custom`),[g,_]=K(()=>n.userMessageDisplay.paddingX===`default`?`0`:String(n.userMessageDisplay.paddingX)),[v,y]=K(()=>n.userMessageDisplay.paddingY===`default`?`0`:String(n.userMessageDisplay.paddingY)),[b,x]=K(n.userMessageDisplay.fitBoxToContent),[S,C]=K(0),[w,T]=K(()=>[...n.userMessageDisplay.styling]),[E,D]=K(()=>n.userMessageDisplay.foregroundColor===`default`?`default`:`custom`),[O,k]=K(()=>n.userMessageDisplay.foregroundColor===`default`?`rgb(255,255,255)`:n.userMessageDisplay.foregroundColor),[A,j]=K(()=>{let e=n.userMessageDisplay.backgroundColor;return e===null?`none`:e===`default`?`default`:`custom`}),[M,te]=K(()=>{let e=n.userMessageDisplay.backgroundColor;return e===null||e===`default`?`rgb(0,0,0)`:e}),[N,P]=K(()=>gt.findIndex(e=>e.value===n.userMessageDisplay.borderStyle)),[F,ne]=K(()=>n.userMessageDisplay.borderColor),[re,ie]=K(null),[ae,oe]=K(``),se=ee(),ce=n.themes?.find(e=>e.id===se)||n.themes?.[0],[I,L]=K(`text`),R=[`format`,`styling`,`foreground`,`background`],le=[`borderStyle`,`borderColor`,`paddingX`,`paddingY`,`fitBoxToContent`],[ue,de]=K(0),[fe,pe]=K(0),z=I===`text`?R[ue]:le[fe],me=()=>{r(e=>{e.userMessageDisplay.format=u,e.userMessageDisplay.styling=[...w],e.userMessageDisplay.foregroundColor=E===`default`?`default`:O,e.userMessageDisplay.backgroundColor=A===`none`?null:A===`default`?`default`:M,e.userMessageDisplay.borderStyle=gt[N].value,e.userMessageDisplay.borderColor=F,e.userMessageDisplay.paddingX=f===`default`?`default`:parseInt(g)||0,e.userMessageDisplay.paddingY=m===`default`?`default`:parseInt(v)||0,e.userMessageDisplay.fitBoxToContent=b})},he=()=>{d(e.userMessageDisplay.format),T([...e.userMessageDisplay.styling]);let t=e.userMessageDisplay.foregroundColor;D(t===`default`?`default`:`custom`),k(t===`default`?`rgb(255,255,255)`:t);let n=e.userMessageDisplay.backgroundColor;j(n===null?`none`:n===`default`?`default`:`custom`),te(n===null||n===`default`?`rgb(0,0,0)`:n),P(gt.findIndex(t=>t.value===e.userMessageDisplay.borderStyle)),ne(e.userMessageDisplay.borderColor);let i=e.userMessageDisplay.paddingX,a=e.userMessageDisplay.paddingY;p(i===`default`?`default`:`custom`),h(a===`default`?`default`:`custom`),_(i===`default`?`0`:String(i)),y(a===`default`?`0`:String(a)),x(e.userMessageDisplay.fitBoxToContent),r(t=>{t.userMessageDisplay={...e.userMessageDisplay}})};mt(()=>{me()},[u,w,E,O,A,M,N,F,f,m,g,v,b]),H((e,r)=>{if(i){r.return?a(!1):r.escape?(d(n.userMessageDisplay.format),a(!1)):r.backspace||r.delete?d(e=>e.slice(0,-1)):e&&d(t=>t+e);return}if(o){r.return?s(!1):r.escape?(_(String(n.userMessageDisplay.paddingX)),s(!1)):r.backspace||r.delete?_(e=>e.slice(0,-1)):e&&/^\d$/.test(e)&&_(t=>t+e);return}if(c){r.return?l(!1):r.escape?(y(String(n.userMessageDisplay.paddingY)),l(!1)):r.backspace||r.delete?y(e=>e.slice(0,-1)):e&&/^\d$/.test(e)&&y(t=>t+e);return}if(re===null){if(r.escape)t();else if(r.ctrl&&e===`r`)he();else if(r.leftArrow||r.rightArrow)L(e=>e===`text`?`border`:`text`);else if(r.tab)I===`text`?r.shift?de(e=>e===0?R.length-1:e-1):de(e=>e===R.length-1?0:e+1):r.shift?pe(e=>e===0?le.length-1:e-1):pe(e=>e===le.length-1?0:e+1);else if(r.return)z===`format`?a(!0):z===`paddingX`?f===`custom`&&s(!0):z===`paddingY`?m===`custom`&&l(!0):z===`foreground`?E===`custom`&&(oe(O),ie(`foreground`)):z===`background`?A===`custom`&&(oe(M),ie(`background`)):z===`borderColor`&&(oe(F),ie(`border`));else if(r.upArrow)z===`styling`?C(e=>Math.max(0,e-1)):z===`borderStyle`?P(e=>e===0?gt.length-1:e-1):z===`paddingX`?p(e=>e===`default`?`custom`:`default`):z===`paddingY`?h(e=>e===`default`?`custom`:`default`):z===`foreground`?D(e=>{let t=e===`default`?`custom`:`default`;return t===`custom`&&(!O||O===``)&&k(`rgb(255,255,255)`),t}):z===`background`&&j(e=>{let t=e===`default`?`custom`:e===`custom`?`none`:`default`;return t===`custom`&&(!M||M===``)&&te(`rgb(0,0,0)`),t});else if(r.downArrow)z===`styling`?C(e=>Math.min(ht.length-1,e+1)):z===`borderStyle`?P(e=>e===gt.length-1?0:e+1):z===`paddingX`?p(e=>e===`default`?`custom`:`default`):z===`paddingY`?h(e=>e===`default`?`custom`:`default`):z===`foreground`?D(e=>{let t=e===`default`?`custom`:`default`;return t===`custom`&&(!O||O===``)&&k(`rgb(255,255,255)`),t}):z===`background`&&j(e=>{let t=e===`default`?`none`:e===`none`?`custom`:`default`;return t===`custom`&&(!M||M===``)&&te(`rgb(0,0,0)`),t});else if(e===` `)if(z===`styling`){let e=ht[S].value;T(w.indexOf(e)>=0?w.filter(t=>t!==e):[...w,e])}else z===`fitBoxToContent`&&x(e=>!e)}});let ge=e=>{let t=E===`default`?ce?.colors?.text:O,n=A===`none`?void 0:A===`default`?ce?.colors?.userMessageBackground:M,r=gt[N].value,i=f===`default`?0:parseInt(g)||0,a=m===`default`?0:parseInt(v)||0,o=f===`default`?1:i,s=J(V,{bold:w.includes(`bold`),italic:w.includes(`italic`),underline:w.includes(`underline`),strikethrough:w.includes(`strikethrough`),inverse:w.includes(`inverse`),color:t,backgroundColor:n,children:e});if(r===`topBottomSingle`||r===`topBottomDouble`||r===`topBottomBold`){let t=r===`topBottomSingle`?`─`:r===`topBottomDouble`?`═`:`━`,n=e.length+i*2,o=t.repeat(n);return Y(B,{flexDirection:`column`,children:[J(V,{color:F,children:o}),a>0&&J(B,{height:a}),J(B,{paddingX:i,children:s}),a>0&&J(B,{height:a}),J(V,{color:F,children:o})]})}else if(r!==`none`||i>0||a>0||o>0||b){let e={};i>0&&(e.paddingX=i),f===`default`&&i===0&&(e.paddingRight=o),a>0&&(e.paddingY=a);let t=Object.keys(e).length>0?J(B,{...e,children:s}):s,n={};return r!==`none`&&(n.borderStyle=r,n.borderColor=F),b?n.alignSelf=`flex-start`:n.flexGrow=1,r===`none`?t:J(B,{...n,children:t})}else return s};return re?J(Ze,{initialValue:ae,theme:ce,onColorChange:e=>{re===`foreground`?k(e):re===`background`?te(e):re===`border`&&ne(e)},onExit:()=>{ie(null),oe(``)}}):Y(B,{flexDirection:`column`,children:[J(X,{children:`Customize how user messages are displayed`}),Y(B,{flexDirection:`column`,marginBottom:1,children:[J(V,{dimColor:!0,children:`left/right arrows to switch columns · tab to navigate options`}),J(V,{dimColor:!0,children:`enter to edit · ctrl+r to reset · esc to go back`})]}),Y(B,{flexDirection:`row`,gap:1,children:[Y(B,{flexDirection:`column`,width:`50%`,borderStyle:I===`text`?`round`:`single`,borderColor:I===`text`?`yellow`:`gray`,paddingX:1,children:[J(B,{marginBottom:1,children:J(V,{bold:!0,color:I===`text`?`yellow`:void 0,children:`Text & Styling`})}),J(B,{children:Y(V,{color:z===`format`?`yellow`:void 0,bold:z===`format`,children:[z===`format`?`❯ `:` `,`Format String`]})}),z===`format`&&J(B,{marginLeft:2,children:J(V,{dimColor:!0,children:i?`enter to save · esc to cancel`:`enter to edit · use {} as message placeholder`})}),J(B,{marginLeft:2,marginBottom:1,children:J(B,{borderStyle:`round`,borderColor:i?`yellow`:`gray`,children:J(V,{children:u})})}),J(B,{children:Y(V,{color:z===`styling`?`yellow`:void 0,bold:z===`styling`,children:[z===`styling`?`❯ `:` `,`Styling`]})}),z===`styling`&&J(B,{marginLeft:2,children:J(V,{dimColor:!0,children:`up/down to navigate · space to toggle`})}),J(B,{marginLeft:2,marginBottom:1,flexDirection:`column`,children:ht.map((e,t)=>J(B,{children:Y(V,{color:z===`styling`&&S===t?`cyan`:void 0,children:[z===`styling`&&S===t?`❯ `:` `,w.includes(e.value)?`●`:`○`,` `,e.label]})},e.value))}),Y(B,{flexDirection:`row`,gap:1,marginBottom:1,children:[Y(B,{flexDirection:`column`,width:`50%`,children:[J(B,{children:Y(V,{color:z===`foreground`?`yellow`:void 0,bold:z===`foreground`,children:[z===`foreground`?`❯ `:` `,`Foreground`]})}),z===`foreground`&&J(B,{marginLeft:2,children:Y(V,{dimColor:!0,children:[`up/down · `,E===`custom`?`enter`:``]})}),Y(B,{marginLeft:2,flexDirection:`column`,children:[J(B,{children:Y(V,{children:[E===`default`?`● `:`○ `,`Default`]})}),J(B,{children:Y(V,{children:[E===`custom`?`● `:`○ `,`Custom`,E===`custom`&&`: `,E===`custom`&&J(V,{color:O,children:O})]})})]})]}),Y(B,{flexDirection:`column`,width:`50%`,children:[J(B,{children:Y(V,{color:z===`background`?`yellow`:void 0,bold:z===`background`,children:[z===`background`?`❯ `:` `,`Background`]})}),z===`background`&&J(B,{marginLeft:2,children:Y(V,{dimColor:!0,children:[`up/down · `,A===`custom`?`enter`:``]})}),Y(B,{marginLeft:2,flexDirection:`column`,children:[J(B,{children:Y(V,{children:[A===`default`?`● `:`○ `,`Default`]})}),J(B,{children:Y(V,{children:[A===`none`?`● `:`○ `,`None`]})}),J(B,{children:Y(V,{children:[A===`custom`?`● `:`○ `,`Custom`,A===`custom`&&`: `,A===`custom`&&J(V,{backgroundColor:M,children:M})]})})]})]})]})]}),Y(B,{flexDirection:`column`,width:`50%`,borderStyle:I===`border`?`round`:`single`,borderColor:I===`border`?`yellow`:`gray`,paddingX:1,children:[J(B,{marginBottom:1,children:J(V,{bold:!0,color:I===`border`?`yellow`:void 0,children:`Border & Padding`})}),J(B,{children:Y(V,{color:z===`borderStyle`?`yellow`:void 0,bold:z===`borderStyle`,children:[z===`borderStyle`?`❯ `:` `,`Border Style`]})}),z===`borderStyle`&&J(B,{marginLeft:2,children:J(V,{dimColor:!0,children:`up/down to navigate`})}),Y(B,{marginLeft:2,marginBottom:1,flexDirection:`row`,children:[J(B,{flexDirection:`column`,width:`50%`,children:gt.slice(0,6).map((e,t)=>J(B,{children:Y(V,{color:z===`borderStyle`&&N===t?`cyan`:void 0,children:[z===`borderStyle`&&N===t?`❯ `:` `,N===t?`● `:`○ `,e.label]})},e.value))}),J(B,{flexDirection:`column`,width:`50%`,children:gt.slice(6).map((e,t)=>{let n=t+6;return J(B,{children:Y(V,{color:z===`borderStyle`&&N===n?`cyan`:void 0,children:[z===`borderStyle`&&N===n?`❯ `:` `,N===n?`● `:`○ `,e.label]})},e.value)})})]}),J(B,{children:Y(V,{color:z===`borderColor`?`yellow`:void 0,bold:z===`borderColor`,children:[z===`borderColor`?`❯ `:` `,`Border Color`]})}),z===`borderColor`&&J(B,{marginLeft:2,children:J(V,{dimColor:!0,children:`enter to pick color`})}),J(B,{marginLeft:2,marginBottom:1,children:J(V,{color:F,children:F})}),Y(B,{flexDirection:`row`,gap:1,children:[Y(B,{flexDirection:`column`,width:`33%`,children:[J(B,{children:Y(V,{color:z===`paddingX`?`yellow`:void 0,bold:z===`paddingX`,children:[z===`paddingX`?`❯ `:` `,`Padding X`]})}),z===`paddingX`&&J(B,{marginLeft:2,children:J(V,{dimColor:!0,children:o?`enter/esc`:f===`custom`?`up/down · enter`:`up/down`})}),Y(B,{marginLeft:2,flexDirection:`column`,children:[J(B,{children:Y(V,{children:[f===`default`?`● `:`○ `,`Default`]})}),J(B,{children:Y(V,{children:[f===`custom`?`● `:`○ `,`Custom`]})}),f===`custom`&&J(B,{children:J(B,{borderStyle:`round`,borderColor:o?`yellow`:`gray`,children:J(V,{children:g})})})]})]}),Y(B,{flexDirection:`column`,width:`33%`,children:[J(B,{children:Y(V,{color:z===`paddingY`?`yellow`:void 0,bold:z===`paddingY`,children:[z===`paddingY`?`❯ `:` `,`Padding Y`]})}),z===`paddingY`&&J(B,{marginLeft:2,children:J(V,{dimColor:!0,children:c?`enter/esc`:m===`custom`?`up/down · enter`:`up/down`})}),Y(B,{marginLeft:2,flexDirection:`column`,children:[J(B,{children:Y(V,{children:[m===`default`?`● `:`○ `,`Default`]})}),J(B,{children:Y(V,{children:[m===`custom`?`● `:`○ `,`Custom`]})}),m===`custom`&&J(B,{children:J(B,{borderStyle:`round`,borderColor:c?`yellow`:`gray`,children:J(V,{children:v})})})]})]}),Y(B,{flexDirection:`column`,width:`33%`,children:[J(B,{children:Y(V,{color:z===`fitBoxToContent`?`yellow`:void 0,bold:z===`fitBoxToContent`,children:[z===`fitBoxToContent`?`❯ `:` `,b?`●`:`○`,` Fit box to content`]})}),z===`fitBoxToContent`&&J(B,{marginLeft:2,children:J(V,{dimColor:!0,children:`space`})})]})]})]})]}),Y(B,{flexDirection:`column`,marginTop:1,paddingX:1,children:[J(B,{marginBottom:1,children:J(V,{bold:!0,children:`Preview`})}),Y(B,{flexDirection:`row`,gap:2,children:[Y(B,{flexDirection:`column`,width:`50%`,children:[J(B,{marginBottom:1,children:J(V,{underline:!0,children:`Before (Claude Code default):`})}),J(B,{marginLeft:1,children:Y(V,{backgroundColor:ce?.colors?.userMessageBackground,color:ce?.colors?.text,children:[` `,`> list the dir`,` `]})}),J(B,{marginLeft:1,marginTop:1,children:Y(V,{children:[J(V,{color:ce?.colors?.inactive||`#888888`,children:`●`}),J(V,{children:` The directory `}),J(V,{color:ce?.colors?.permission||`#00ff00`,children:`C:\\Users\\user`}),J(V,{children:` contains `}),J(V,{bold:!0,children:`123`}),J(V,{children:` files.`})]})})]}),Y(B,{flexDirection:`column`,width:`50%`,children:[J(B,{marginBottom:1,children:J(V,{underline:!0,children:`After (Your customization):`})}),J(B,{marginLeft:1,flexDirection:`row`,children:(()=>ge(u.replace(/\{\}/g,`list the dir`)))()}),J(B,{marginLeft:1,marginTop:1,children:Y(V,{children:[J(V,{color:ce?.colors?.inactive||`#888888`,children:`●`}),J(V,{children:` The directory `}),J(V,{color:ce?.colors?.permission||`#00ff00`,children:`C:\\Users\\user`}),J(V,{children:` contains `}),J(V,{bold:!0,children:`123`}),J(V,{children:` files.`})]})})]})]})]})]})}const vt=[{label:`bold`,value:`bold`},{label:`italic`,value:`italic`},{label:`underline`,value:`underline`},{label:`strikethrough`,value:`strikethrough`},{label:`inverse`,value:`inverse`}],yt=[[`name`,`regex`,`regexFlags`],[`format`,`styling`],[`foreground`,`background`],[`enabled`],[`testText`]];function bt({testText:e,regex:t,regexFlags:n,format:r,styling:i,foregroundColor:a,backgroundColor:o}){let s=[];try{let c=n.includes(`g`)?n:n+`g`,l=new RegExp(t,c),u=[...e.matchAll(l)];if(u.length===0)return J(V,{children:e});let d=0;return u.forEach((t,n)=>{let c=t.index,l=c+t[0].length;c>d&&s.push(J(V,{children:e.slice(d,c)},`plain-${n}`));let u=r.replace(/\{MATCH\}/g,t[0]);s.push(J(V,{bold:i.includes(`bold`),italic:i.includes(`italic`),underline:i.includes(`underline`),strikethrough:i.includes(`strikethrough`),inverse:i.includes(`inverse`),color:a,backgroundColor:o,children:u},`match-${n}`)),d=l}),d<e.length&&s.push(J(V,{children:e.slice(d)},`plain-end`)),J(q,{children:s})}catch{return J(V,{children:e})}}function xt({highlighterIndex:e,onBack:t}){let{settings:n,updateSettings:r}=W($),i=n.inputPatternHighlighters[e],a=ee(),o=n.themes?.find(e=>e.id===a)||n.themes?.[0],[s,c]=K(i?.name||`New Highlighter`),[l,u]=K(i?.regex||``),[d,f]=K(i?.regexFlags||`g`),[p,m]=K(i?.format||`{MATCH}`),[h,g]=K(i?.styling||[]),[_,v]=K(i?.foregroundColor===null?`none`:`custom`),[y,b]=K(i?.foregroundColor||`rgb(255,0,255)`),[x,S]=K(i?.backgroundColor?`custom`:`none`),[C,w]=K(i?.backgroundColor||`rgb(0,0,0)`),[T,E]=K(i?.enabled??!0),[D,O]=K(n.inputPatternHighlightersTestText||`Type test text here to see highlighting`),[k,A]=K(`name`),[j,M]=K(!1),[te,N]=K(0),[P,F]=K(null),[ne,re]=K(``),[ie,ae]=K(null),[oe,se]=K(0),[ce,I]=K(0);if(G(()=>{let e=yt[oe];A(e[Math.min(ce,e.length-1)])},[oe,ce]),G(()=>{if(!l){ae(null);return}try{new RegExp(l,d),ae(null)}catch(e){ae(e.message)}},[l,d]),G(()=>{e>=0&&r(t=>{t.inputPatternHighlighters[e]&&(t.inputPatternHighlighters[e]={name:s,regex:l,regexFlags:d,format:p,styling:h,foregroundColor:_===`custom`?y:null,backgroundColor:x===`custom`?C:null,enabled:T})})},[e,s,l,d,p,h,_,y,x,C,T]),G(()=>{r(e=>{e.inputPatternHighlightersTestText=D})},[D]),H((e,r)=>{if(j){r.return?M(!1):r.escape?(k===`name`&&c(i?.name||``),k===`regex`&&u(i?.regex||``),k===`regexFlags`&&f(i?.regexFlags||`g`),k===`format`&&m(i?.format||`{MATCH}`),k===`testText`&&O(n.inputPatternHighlightersTestText||`Type test text here to see highlighting`),M(!1)):r.backspace||r.delete?(k===`name`&&c(e=>e.slice(0,-1)),k===`regex`&&u(e=>e.slice(0,-1)),k===`regexFlags`&&f(e=>e.slice(0,-1)),k===`format`&&m(e=>e.slice(0,-1)),k===`testText`&&O(e=>e.slice(0,-1))):e&&e.length===1&&(k===`name`&&c(t=>t+e),k===`regex`&&u(t=>t+e),k===`regexFlags`&&f(t=>t+e),k===`format`&&m(t=>t+e),k===`testText`&&O(t=>t+e));return}if(P===null){if(r.escape)t();else if(r.upArrow)k===`styling`&&te>0?N(e=>e-1):se(e=>Math.max(0,e-1));else if(r.downArrow)k===`styling`&&te<vt.length-1?N(e=>e+1):se(e=>Math.min(yt.length-1,e+1));else if(r.leftArrow)k===`foreground`?v(e=>e===`none`?`custom`:`none`):k===`background`?S(e=>e===`none`?`custom`:`none`):I(e=>Math.max(0,e-1));else if(r.rightArrow)if(k===`foreground`)v(e=>e===`none`?`custom`:`none`);else if(k===`background`)S(e=>e===`none`?`custom`:`none`);else{let e=yt[oe].length-1;I(t=>Math.min(e,t+1))}else if(r.tab){let e=yt.flat(),t=e.indexOf(k);if(r.shift){if(t>0){let n=e[t-1];for(let e=0;e<yt.length;e++){let t=yt[e].indexOf(n);if(t>=0){se(e),I(t);break}}}}else if(t<e.length-1){let n=e[t+1];for(let e=0;e<yt.length;e++){let t=yt[e].indexOf(n);if(t>=0){se(e),I(t);break}}}}else if(r.return)k===`name`||k===`regex`||k===`regexFlags`||k===`format`||k===`testText`?M(!0):k===`foreground`&&_===`custom`?(re(y),F(`foreground`)):k===`background`&&x===`custom`&&(re(C),F(`background`));else if(e===` `)if(k===`styling`){let e=vt[te].value;h.includes(e)?g(h.filter(t=>t!==e)):g([...h,e])}else k===`enabled`&&E(!T)}}),!i)return J(B,{flexDirection:`column`,children:J(V,{color:`red`,children:`Highlighter not found`})});if(P)return J(Ze,{initialValue:ne,theme:o,onColorChange:e=>{P===`foreground`?b(e):P===`background`&&w(e)},onExit:()=>{F(null),re(``)}});let L=e=>k===e,R=e=>({color:L(e)?`yellow`:void 0,bold:L(e)});return Y(B,{flexDirection:`column`,children:[J(X,{children:`Edit Highlighter`}),J(B,{marginBottom:1,flexDirection:`column`,children:J(V,{dimColor:!0,children:`arrows to navigate · enter to edit · space to toggle · esc to go back`})}),Y(B,{flexDirection:`row`,gap:2,marginBottom:1,children:[Y(B,{flexDirection:`column`,width:`30%`,children:[Y(V,{...R(`name`),children:[L(`name`)?`❯ `:` `,`Name`]}),J(B,{marginLeft:2,children:J(B,{borderStyle:`round`,borderColor:L(`name`)?j?`green`:`yellow`:`gray`,children:J(V,{children:s||`(empty)`})})})]}),Y(B,{flexDirection:`column`,width:`45%`,children:[Y(V,{...R(`regex`),children:[L(`regex`)?`❯ `:` `,`Regex Pattern`]}),Y(B,{marginLeft:2,flexDirection:`column`,children:[J(B,{borderStyle:`round`,borderColor:L(`regex`)?j?`green`:`yellow`:ie?`red`:`gray`,children:J(V,{children:l||`(empty)`})}),ie&&J(V,{color:`red`,children:ie})]})]}),Y(B,{flexDirection:`column`,width:`20%`,children:[Y(V,{...R(`regexFlags`),children:[L(`regexFlags`)?`❯ `:` `,`Flags`]}),J(B,{marginLeft:2,children:J(B,{borderStyle:`round`,borderColor:L(`regexFlags`)?j?`green`:`yellow`:`gray`,children:J(V,{children:d||`g`})})})]})]}),Y(B,{flexDirection:`row`,gap:2,marginBottom:1,children:[Y(B,{flexDirection:`column`,width:`50%`,children:[Y(V,{...R(`format`),children:[L(`format`)?`❯ `:` `,`Format String`]}),J(B,{marginLeft:2,children:J(B,{borderStyle:`round`,borderColor:L(`format`)?j?`green`:`yellow`:`gray`,children:J(V,{children:p||`{MATCH}`})})}),L(`format`)&&J(B,{marginLeft:2,children:Y(V,{dimColor:!0,children:[`use `,`{MATCH}`,` as placeholder`]})})]}),Y(B,{flexDirection:`column`,width:`45%`,children:[Y(V,{...R(`styling`),children:[L(`styling`)?`❯ `:` `,`Styling`]}),J(B,{marginLeft:2,flexDirection:`column`,children:vt.map((e,t)=>{let n=h.includes(e.value),r=L(`styling`)&&te===t;return Y(V,{color:r?`cyan`:void 0,children:[r?`❯ `:` `,n?`●`:`○`,` `,e.label]},e.value)})})]})]}),Y(B,{flexDirection:`row`,gap:2,marginBottom:1,children:[Y(B,{flexDirection:`column`,width:`48%`,children:[Y(V,{...R(`foreground`),children:[L(`foreground`)?`❯ `:` `,`Foreground Color`]}),Y(B,{marginLeft:2,flexDirection:`row`,gap:1,children:[Y(V,{color:L(`foreground`)?`yellow`:void 0,children:[`[`,_===`none`?`●`:`○`,`] none`,` `,`[`,_===`custom`?`●`:`○`,`] custom`]}),_===`custom`&&J(B,{borderStyle:`round`,borderColor:L(`foreground`)?`yellow`:`gray`,children:J(V,{color:y,children:` ████ `})})]})]}),Y(B,{flexDirection:`column`,width:`48%`,children:[Y(V,{...R(`background`),children:[L(`background`)?`❯ `:` `,`Background Color`]}),Y(B,{marginLeft:2,flexDirection:`row`,gap:1,children:[Y(V,{color:L(`background`)?`yellow`:void 0,children:[`[`,x===`none`?`●`:`○`,`] none`,` `,`[`,x===`custom`?`●`:`○`,`] custom`]}),x===`custom`&&J(B,{borderStyle:`round`,borderColor:L(`background`)?`yellow`:`gray`,children:Y(V,{backgroundColor:C,children:[` `,` `,` `]})})]})]})]}),J(B,{marginBottom:1,children:Y(V,{...R(`enabled`),children:[L(`enabled`)?`❯ `:` `,`Enabled:`,` `,J(V,{color:T?`green`:`red`,children:T?`● Yes`:`○ No`})]})}),Y(B,{flexDirection:`column`,marginBottom:1,children:[Y(V,{...R(`testText`),children:[L(`testText`)?`❯ `:` `,`Test Text`]}),J(B,{marginLeft:2,children:J(B,{borderStyle:`round`,borderColor:L(`testText`)?j?`green`:`yellow`:`gray`,children:J(V,{children:D||`(empty)`})})})]}),J(B,{borderStyle:`round`,padding:1,children:Y(B,{flexDirection:`column`,children:[J(V,{bold:!0,children:`Live Preview:`}),l?J(B,{marginTop:1,children:J(bt,{testText:D,regex:l,regexFlags:d,format:p,styling:h,foregroundColor:_===`custom`?y:void 0,backgroundColor:x===`custom`?C:void 0})}):J(V,{dimColor:!0,children:`Enter a regex pattern to see the preview`})]})})]})}function St({onBack:t}){let{settings:{inputPatternHighlighters:n,themes:r},updateSettings:i}=W($),a=ee(),o=r.find(e=>e.id===a)||r[0],s=e.themes[0],c=o?.colors.success||s.colors.success,l=o?.colors.error||s.colors.error,[u,d]=K(0),[f,p]=K(null),[m,h]=K(!0),g=()=>{let e={name:`New Highlighter`,regex:``,regexFlags:`g`,format:`{MATCH}`,styling:[],foregroundColor:`rgb(255,0,255)`,backgroundColor:null,enabled:!0};i(t=>{t.inputPatternHighlighters.push(e)}),p(n.length),h(!1)},_=e=>{i(t=>{t.inputPatternHighlighters.splice(e,1)}),u>=n.length-1&&d(Math.max(0,n.length-2))},v=e=>{i(t=>{t.inputPatternHighlighters[e].enabled=!t.inputPatternHighlighters[e].enabled})},y=e=>{e<=0||(i(t=>{let n=t.inputPatternHighlighters[e];t.inputPatternHighlighters.splice(e,1),t.inputPatternHighlighters.splice(e-1,0,n)}),d(e-1))},b=e=>{e>=n.length-1||(i(t=>{let n=t.inputPatternHighlighters[e];t.inputPatternHighlighters.splice(e,1),t.inputPatternHighlighters.splice(e+1,0,n)}),d(e+1))};return H((e,r)=>{r.escape?t():r.upArrow?d(e=>Math.max(0,e-1)):r.downArrow&&n.length>0?d(e=>Math.min(n.length-1,e+1)):r.return&&n.length>0?(p(u),h(!1)):e===`n`?g():e===`x`&&n.length>0?_(u):e===` `&&n.length>0?v(u):e===`u`&&n.length>0&&u>0?y(u):e===`d`&&n.length>0&&u<n.length-1&&b(u)},{isActive:m}),f===null?Y(B,{flexDirection:`column`,children:[J(X,{children:`Input Pattern Highlighters`}),Y(B,{marginBottom:1,flexDirection:`column`,children:[J(V,{dimColor:!0,children:`Create custom highlighters for patterns in your input prompt.`}),J(V,{dimColor:!0,children:`Matched text will be styled and optionally reformatted.`})]}),Y(B,{marginBottom:1,flexDirection:`column`,children:[J(V,{dimColor:!0,children:`n to create a new highlighter`}),n.length>0&&J(V,{dimColor:!0,children:`space to toggle enabled/disabled`}),n.length>0&&J(V,{dimColor:!0,children:`u/d to move highlighter up/down`}),n.length>0&&J(V,{dimColor:!0,children:`x to delete a highlighter`}),n.length>0&&J(V,{dimColor:!0,children:`enter to edit highlighter`}),J(V,{dimColor:!0,children:`esc to go back`})]}),n.length===0?J(V,{children:`No highlighters created yet. Press n to create one.`}):J(B,{flexDirection:`column`,children:n.map((e,t)=>{let n=u===t,r;return n&&(r=`yellow`),Y(B,{flexDirection:`row`,children:[Y(V,{color:r,children:[n?`❯ `:` `,e.enabled?`● `:`○ `,e.name,` `]}),J(V,{dimColor:!0,children:`(`}),e.regex?Y(V,{dimColor:!0,children:[`/`,e.regex,`/`,e.regexFlags]}):J(V,{dimColor:!0,children:`(no regex)`}),e.styling.length>0&&J(q,{children:Y(V,{color:r,dimColor:!e.enabled,children:[` `,`· `,e.styling.join(`, `)]})}),J(V,{dimColor:!0,children:`)`}),e.enabled?J(V,{color:c,children:` enabled`}):J(V,{color:l,children:` disabled`})]},t)})})]}):J(xt,{highlighterIndex:f,onBack:()=>{p(null),h(!0)}})}const Ct=[null,1,5,10,25,50,100,200,250,500,1e3],wt=1e3;function Tt({onSubmit:e}){let{settings:t,updateSettings:n}=W($),[r,i]=K(0),[a,o]=K(!1),s={showTweakccVersion:!0,showPatchesApplied:!0,expandThinkingBlocks:!0,enableConversationTitle:!0,hideStartupBanner:!1,hideCtrlGToEdit:!1,hideStartupClawd:!1,increaseFileReadLimit:!1,suppressLineNumbers:!1,suppressRateLimitOptions:!1,mcpConnectionNonBlocking:!0,mcpServerBatchSize:null,statuslineThrottleMs:null,statuslineUseFixedInterval:!1,tableFormat:`default`,enableSwarmMode:!0,enableSessionMemory:!0,enableDreamMode:!0,enableLeanMemoryTypes:!1,fixSummarizeFromHere:!0,fixRewindSummaryHeader:!0,enableRememberSkill:!1,tokenCountRounding:null,autoAcceptPlanMode:!1,allowBypassPermissionsInSudo:!1,suppressNativeInstallerWarning:!1,filterScrollEscapeSequences:!1,enableWorktreeMode:!0,allowCustomAgentModels:!1,enableContextLimitOverride:!1,enableModelCustomizations:!0,enableVoiceMode:!1,enableVoiceConciseOutput:!0,enableChannelsMode:!1,maxEffortDefault:!1,autoModeClassifierModel:`default`,suppressDeferredTools:!1,claudemdContextOncePerConversation:!0},c=()=>{t.misc||={...s}},l=e=>{let t=[`default`,`sonnet`,`haiku`];return t[(t.indexOf(e)+1)%t.length]},u=e=>{switch(e){case`sonnet`:return`Sonnet 4.6`;case`haiku`:return`Haiku 4.5`;case`default`:default:return`Default (main-loop model)`}},d=e=>{let t=[`default`,`ascii`,`clean`,`clean-top-bottom`];return t[(t.indexOf(e)+1)%t.length]},f=e=>{switch(e){case`ascii`:return`ASCII (| and -)`;case`clean`:return`Clean (no row separators)`;case`clean-top-bottom`:return`Clean with top/bottom`;case`default`:default:return`Default (box-drawing)`}},p=e=>e===null?`Default (3)`:e<=3?`${e} (conservative)`:e<=8?`${e} (recommended)`:`${e} (aggressive)`,m=e=>e===null?`Disabled`:e===0?`0ms (instant)`:`${e}ms`,h=e=>e===null?`Off (exact counts)`:`Round to ${e}`,g=(e,t)=>{let n=Ct.indexOf(e);if(n===-1)return Ct[0];let r;return r=t===`next`?(n+1)%Ct.length:(n-1+Ct.length)%Ct.length,Ct[r]},_=Se(()=>[{id:`removeBorder`,title:`Remove input box border`,description:`Removes the rounded border around the input box for a cleaner look.`,getValue:()=>t.inputBox?.removeBorder??!1,toggle:()=>{n(e=>{e.inputBox||={removeBorder:!1},e.inputBox.removeBorder=!e.inputBox.removeBorder})}},{id:`showVersion`,title:`Show tweakcc version at startup`,description:`Shows the blue "+ tweakcc v<VERSION>" message when starting Claude Code.`,getValue:()=>t.misc?.showTweakccVersion??!0,toggle:()=>{n(e=>{c(),e.misc.showTweakccVersion=!e.misc.showTweakccVersion})}},{id:`showPatches`,title:`Show patches applied indicator at startup`,description:`Shows the green "tweakcc patches are applied" indicator when starting Claude Code.`,getValue:()=>t.misc?.showPatchesApplied??!0,toggle:()=>{n(e=>{c(),e.misc.showPatchesApplied=!e.misc.showPatchesApplied})}},{id:`expandThinking`,title:`Expand thinking blocks`,description:`Makes thinking blocks always expanded by default instead of collapsed.`,getValue:()=>t.misc?.expandThinkingBlocks??!0,toggle:()=>{n(e=>{c(),e.misc.expandThinkingBlocks=!e.misc.expandThinkingBlocks})}},{id:`conversationTitle`,title:`Allow renaming sessions via /title`,description:`Enables /title and /rename commands for manually naming conversations.`,getValue:()=>t.misc?.enableConversationTitle??!0,toggle:()=>{n(e=>{c(),e.misc.enableConversationTitle=!e.misc.enableConversationTitle})}},{id:`enableModelCustomizations`,title:`Enable model customizations (/model shows all models)`,description:`Show all Claude models in /model menu, not just the latest 3. Disable to use Claude Code default model list.`,getValue:()=>t.misc?.enableModelCustomizations??!0,toggle:()=>{n(e=>{c(),e.misc.enableModelCustomizations=!e.misc.enableModelCustomizations})}},{id:`hideStartupBanner`,title:`Hide startup banner`,description:`Hides the startup banner message displayed before first prompt.`,getValue:()=>t.misc?.hideStartupBanner??!1,toggle:()=>{n(e=>{c(),e.misc.hideStartupBanner=!e.misc.hideStartupBanner})}},{id:`hideCtrlG`,title:`Hide ctrl-g to edit prompt hint`,description:`Hides the "ctrl-g to edit prompt" hint shown during streaming.`,getValue:()=>t.misc?.hideCtrlGToEdit??!1,toggle:()=>{n(e=>{c(),e.misc.hideCtrlGToEdit=!e.misc.hideCtrlGToEdit})}},{id:`hideClawd`,title:`Hide startup Clawd ASCII art`,description:`Hides the Clawd ASCII art character shown at startup.`,getValue:()=>t.misc?.hideStartupClawd??!1,toggle:()=>{n(e=>{c(),e.misc.hideStartupClawd=!e.misc.hideStartupClawd})}},{id:`increaseFileReadLimit`,title:`Increase file read token limit`,description:`Increases the maximum file read limit from 25,000 to 1,000,000 tokens.`,getValue:()=>t.misc?.increaseFileReadLimit??!1,toggle:()=>{n(e=>{c(),e.misc.increaseFileReadLimit=!e.misc.increaseFileReadLimit})}},{id:`suppressLineNumbers`,title:`Suppress line numbers in file reads/edits`,description:`Removes line number prefixes from file content to reduce token usage.`,getValue:()=>t.misc?.suppressLineNumbers??!1,toggle:()=>{n(e=>{c(),e.misc.suppressLineNumbers=!e.misc.suppressLineNumbers})}},{id:`suppressRateLimitOptions`,title:`Suppress rate limit options popup`,description:`Prevents the automatic /rate-limit-options command from being triggered when hitting rate limits.`,getValue:()=>t.misc?.suppressRateLimitOptions??!1,toggle:()=>{n(e=>{c(),e.misc.suppressRateLimitOptions=!e.misc.suppressRateLimitOptions})}},{id:`mcpNonBlocking`,title:`Non-blocking MCP startup`,description:`Start immediately while MCP servers connect in background. Reduces startup time ~50% with multiple MCPs.`,getValue:()=>t.misc?.mcpConnectionNonBlocking??!0,toggle:()=>{n(e=>{c(),e.misc.mcpConnectionNonBlocking=!e.misc.mcpConnectionNonBlocking})}},{id:`mcpBatchSize`,title:`MCP server batch size`,description:`Parallel MCP connections (1-20). Use ←/→ to adjust. Higher = faster startup, more resources.`,getValue:()=>t.misc?.mcpServerBatchSize??null,getDisplayValue:()=>p(t.misc?.mcpServerBatchSize??null),toggle:()=>{n(e=>{c(),e.misc.mcpServerBatchSize=null})},increment:()=>{n(e=>{c();let t=e.misc.mcpServerBatchSize??3;e.misc.mcpServerBatchSize=Math.min(20,t+1)})},decrement:()=>{n(e=>{c();let t=(e.misc.mcpServerBatchSize??3)-1;e.misc.mcpServerBatchSize=t<1?null:t})}},{id:`tableFormat`,title:`Table output format`,description:`Controls how Claude formats tables. Default: full borders. ASCII: | and -. Clean: no top/bottom/row separators. Clean+top/bottom: borders but no row separators.`,getValue:()=>t.misc?.tableFormat??`default`,isMultiValue:!0,getDisplayValue:()=>f(t.misc?.tableFormat??`default`),toggle:()=>{n(e=>{c(),e.misc.tableFormat=d(e.misc.tableFormat??`default`)})}},{id:`enableWorktreeMode`,title:`Enable worktree mode (EnterWorktree tool)`,description:`Force-enable the EnterWorktree tool for isolated git worktree sessions by bypassing the tengu_worktree_mode feature flag.`,getValue:()=>t.misc?.enableWorktreeMode??!0,toggle:()=>{n(e=>{c(),e.misc.enableWorktreeMode=!e.misc.enableWorktreeMode})}},{id:`enableVoiceMode`,title:`Enable voice mode (/voice command)`,description:`Force-enable the /voice command by bypassing the tengu_amber_quartz feature gate.`,getValue:()=>t.misc?.enableVoiceMode??!1,toggle:()=>{n(e=>{c(),e.misc.enableVoiceMode=!e.misc.enableVoiceMode})}},{id:`enableVoiceConciseOutput`,title:`Enable concise output for voice mode`,description:`Enable the concise-output prompt used for voice interactions. Only applies when voice mode is enabled.`,getValue:()=>t.misc?.enableVoiceConciseOutput??!0,toggle:()=>{n(e=>{c(),e.misc.enableVoiceConciseOutput=!e.misc.enableVoiceConciseOutput})}},{id:`enableChannelsMode`,title:`Enable channels mode (MCP channel notifications)`,description:`Force-enable MCP channel notifications by bypassing the tengu_harbor feature gate, allowlist, and permission relay.`,getValue:()=>t.misc?.enableChannelsMode??!1,toggle:()=>{n(e=>{c(),e.misc.enableChannelsMode=!e.misc.enableChannelsMode})}},{id:`enableContextLimitOverride`,title:`Override context limit`,description:`Replaces the default model context limit with CLAUDE_CODE_CONTEXT_LIMIT env var. Must be exported manually before launching CC, or falls back to 200K.`,getValue:()=>t.misc?.enableContextLimitOverride??!1,toggle:()=>{n(e=>{c(),e.misc.enableContextLimitOverride=!e.misc.enableContextLimitOverride})}},{id:`statuslineThrottle`,title:`Statusline throttle`,description:`Throttle statusline updates (0-${wt}ms). Use ←/→ to adjust by 50ms. Space to disable. 0 = instant updates.`,getValue:()=>t.misc?.statuslineThrottleMs??null,getDisplayValue:()=>m(t.misc?.statuslineThrottleMs??null),toggle:()=>{n(e=>{c(),e.misc.statuslineThrottleMs=e.misc.statuslineThrottleMs===null?300:null})},increment:()=>{n(e=>{c();let t=e.misc.statuslineThrottleMs??300;e.misc.statuslineThrottleMs=Math.min(wt,t+50)})},decrement:()=>{n(e=>{c();let t=e.misc.statuslineThrottleMs??300;e.misc.statuslineThrottleMs=Math.max(0,t-50)})}},{id:`statuslineFixedInterval`,title:`Statusline fixed interval mode`,description:`Use setInterval instead of throttle. Updates happen on a fixed schedule rather than on-demand.`,getValue:()=>t.misc?.statuslineUseFixedInterval??!1,toggle:()=>{n(e=>{c(),e.misc.statuslineUseFixedInterval=!e.misc.statuslineUseFixedInterval})}},{id:`enableSessionMemory`,title:`Enable session memory`,description:`Force-enable session memory (auto-extraction + past session search) by bypassing the tengu_session_memory and tengu_coral_fern statsig flags.`,getValue:()=>t.misc?.enableSessionMemory??!0,toggle:()=>{n(e=>{c(),e.misc.enableSessionMemory=!e.misc.enableSessionMemory})}},{id:`enableDreamMode`,title:`Enable dream mode`,description:`Force-enable dream (/dream + auto-dream background memory consolidation) by bypassing the tengu_onyx_plover statsig gate. On/off still follows autoDreamEnabled in ~/.claude/settings.json.`,getValue:()=>t.misc?.enableDreamMode??!0,toggle:()=>{n(e=>{c(),e.misc.enableDreamMode=!e.misc.enableDreamMode})}},{id:`fixSummarizeFromHere`,title:`Fix "Summarize from here"`,description:`Make "Summarize from here" summarize only the messages after the rewind point instead of the whole conversation.`,getValue:()=>t.misc?.fixSummarizeFromHere??!0,toggle:()=>{n(e=>{c(),e.misc.fixSummarizeFromHere=!(e.misc.fixSummarizeFromHere??!0)})}},{id:`fixRewindSummaryHeader`,title:`Honest rewind summary header`,description:`Label a rewind summary as a deliberate rewind (you continued forward, then rewound and chose to carry the summary forward) instead of the misleading "ran out of context" header.`,getValue:()=>t.misc?.fixRewindSummaryHeader??!0,toggle:()=>{n(e=>{c(),e.misc.fixRewindSummaryHeader=!(e.misc.fixRewindSummaryHeader??!0)})}},{id:`enableLeanMemoryTypes`,title:`Enable lean memory types`,description:`Force the tengu_ochre_finch statsig gate: memory prompts carry a compact "Types of memory" list and the full taxonomy moves to the on-demand memory-types skill.`,getValue:()=>t.misc?.enableLeanMemoryTypes??!1,toggle:()=>{n(e=>{c(),e.misc.enableLeanMemoryTypes=!e.misc.enableLeanMemoryTypes})}},{id:`enableRememberSkill`,title:`Enable remember skill`,description:`Register a "remember" skill to review session memories and update CLAUDE.local.md with learnings from past sessions.`,getValue:()=>t.misc?.enableRememberSkill??!1,toggle:()=>{n(e=>{c(),e.misc.enableRememberSkill=!e.misc.enableRememberSkill})}},{id:`tokenCountRounding`,title:`Token count rounding`,description:`Round displayed token counts to nearest multiple. Use ←/→ to cycle: Off, 1, 5, 10, 25, 50, 100, 200, 250, 500, 1000.`,getValue:()=>t.misc?.tokenCountRounding??null,getDisplayValue:()=>h(t.misc?.tokenCountRounding??null),toggle:()=>{n(e=>{c(),e.misc.tokenCountRounding=null})},increment:()=>{n(e=>{c(),e.misc.tokenCountRounding=g(e.misc.tokenCountRounding??null,`next`)})},decrement:()=>{n(e=>{c(),e.misc.tokenCountRounding=g(e.misc.tokenCountRounding??null,`prev`)})}},{id:`autoAcceptPlanMode`,title:`Auto-accept plan mode`,description:`Automatically accept plans without the "Ready to code?" confirmation prompt.`,getValue:()=>t.misc?.autoAcceptPlanMode??!1,toggle:()=>{n(e=>{c(),e.misc.autoAcceptPlanMode=!e.misc.autoAcceptPlanMode})}},{id:`allowBypassPermissionsInSudo`,title:`Allow bypassing permissions in sudo`,description:`⚠️ WARNING: Disables a security check. When enabled, Claude can perform system-level operations without prompts. Use extreme caution.`,getValue:()=>t.misc?.allowBypassPermissionsInSudo??!1,toggle:()=>{t.misc?.allowBypassPermissionsInSudo??!1?n(e=>{c(),e.misc.allowBypassPermissionsInSudo=!1}):o(!0)}},{id:`suppressNativeInstallerWarning`,title:`Suppress native installer warning`,description:`Suppress the native installer warning message at startup.`,getValue:()=>t.misc?.suppressNativeInstallerWarning??!1,toggle:()=>{n(e=>{c(),e.misc.suppressNativeInstallerWarning=!e.misc.suppressNativeInstallerWarning})}},{id:`filterScrollEscapeSequences`,title:`Filter scroll escape sequences`,description:`Filter out terminal escape sequences that cause unwanted scrolling.`,getValue:()=>t.misc?.filterScrollEscapeSequences??!1,toggle:()=>{n(e=>{c(),e.misc.filterScrollEscapeSequences=!e.misc.filterScrollEscapeSequences})}},{id:`allowCustomAgentModels`,title:`Allow custom agent models`,description:`Allow arbitrary model names in custom agent frontmatter (e.g. gemini-2.5-flash). Useful with a local proxy for non-Claude models.`,getValue:()=>t.misc?.allowCustomAgentModels??!1,toggle:()=>{n(e=>{c(),e.misc.allowCustomAgentModels=!e.misc.allowCustomAgentModels})}},{id:`maxEffortDefault`,title:`Default Opus 4.7 to max effort`,description:`Patches CC so Opus 4.7 sessions default to "max" reasoning effort instead of "xhigh". /effort and CLAUDE_CODE_EFFORT_LEVEL still override at runtime.`,getValue:()=>t.misc?.maxEffortDefault??!1,toggle:()=>{n(e=>{c(),e.misc.maxEffortDefault=!e.misc.maxEffortDefault})}},{id:`autoModeClassifierModel`,title:`Auto-mode classifier model`,description:`Pin auto-mode bash safety classifier to a fixed model. Default routes to your main-loop model (e.g. Opus 4.7), which gets denied as "temporarily unavailable" when that model is congested. Sonnet/Haiku have more headroom and the binary XML classifier task fits either.`,getValue:()=>t.misc?.autoModeClassifierModel??`default`,getDisplayValue:()=>u(t.misc?.autoModeClassifierModel??`default`),toggle:()=>{n(e=>{c(),e.misc.autoModeClassifierModel=l(e.misc.autoModeClassifierModel??`default`)})}}],[t,n]),v=_.length,y=v-1,b=Se(()=>r<4?0:Math.min(r-4+1,v-4),[r,v]),x=_.slice(b,b+4),S=b>0,C=b+4<v;return H((t,s)=>{a?s.return?(n(e=>{c(),e.misc.allowBypassPermissionsInSudo=!0}),o(!1)):s.escape&&o(!1):s.return||s.escape?e():s.upArrow?i(e=>Math.max(0,e-1)):s.downArrow?i(e=>Math.min(y,e+1)):t===` `?_[r]?.toggle():s.rightArrow?_[r]?.increment?.():s.leftArrow&&_[r]?.decrement?.()}),J(B,{flexDirection:`column`,children:a?J(B,{flexDirection:`column`,paddingX:2,children:Y(B,{borderStyle:`double`,borderColor:`yellow`,padding:2,flexDirection:`column`,children:[J(B,{marginBottom:1,children:J(V,{bold:!0,color:`yellow`,children:`SECURITY WARNING`})}),J(B,{marginBottom:1,children:J(V,{children:`You are about to enable a feature that allows Claude Code to bypass permission checks when running with sudo privileges.`})}),J(B,{marginBottom:1,children:J(V,{color:`red`,children:`This means Claude can perform system-level operations without any prompts or confirmation.`})}),J(B,{marginBottom:1,children:J(V,{bold:!0,children:`Use with extreme caution.`})}),J(B,{children:Y(V,{children:[`Press `,J(V,{color:`red`,children:`Enter`}),` to enable,`,` `,J(V,{color:`green`,children:`Escape`}),` to cancel`]})})]})}):Y(q,{children:[J(B,{marginBottom:1,children:J(X,{children:`Miscellaneous Settings`})}),J(B,{marginBottom:1,children:J(V,{dimColor:!0,children:`Use ↑/↓ to navigate, space to toggle, ←/→ to adjust numbers, enter to go back.`})}),S&&J(B,{children:Y(V,{dimColor:!0,children:[` ↑ `,b,` more above`]})}),x.map((e,t)=>{let n=b+t===r,i=e.getValue(),a=!!e.getDisplayValue,o=!!e.increment,s;s=o?`◆`:a?`◉`:i?`☑`:`☐`;let c;c=a?e.getDisplayValue():typeof i==`boolean`?i?`Enabled`:`Disabled`:String(i??`Default`);let l=n&&o?` ← → `:``;return Y(B,{flexDirection:`column`,children:[J(B,{children:Y(V,{children:[J(V,{color:n?`cyan`:void 0,children:n?`❯ `:` `}),J(V,{bold:!0,color:n?`cyan`:void 0,children:e.title})]})}),J(B,{children:Y(V,{dimColor:!0,children:[` `,e.description]})}),J(B,{marginLeft:4,marginBottom:1,children:Y(V,{children:[s,` `,c,J(V,{dimColor:!0,children:l})]})})]},e.id)}),C&&J(B,{children:Y(V,{dimColor:!0,children:[` `,`↓ `,v-b-4,` more below`]})}),J(B,{marginTop:1,children:Y(V,{dimColor:!0,children:[`Item `,r+1,` of `,v]})})]})})}const Et=`AgentOutputTool.AskUserQuestion.Bash.BashOutputTool.Edit.EnterPlanMode.ExitPlanMode.Glob.Grep.KillShell.ListMcpResourcesTool.LSP.NotebookEdit.Read.ReadMcpResourceTool.Skill.Task.TaskCreate.TaskGet.TaskList.TaskOutput.TaskStop.TaskUpdate.Teammate.TodoWrite.ToolSearch.WebFetch.WebSearch.Write`.split(`.`);function Dt({toolsetIndex:e,onBack:t}){let{settings:n,updateSettings:r}=W($),i=n.toolsets[e],[a,o]=K(i?.name||`New Toolset`),[s,c]=K(i?.allowedTools||[]),[l,u]=K(!1),[d,f]=K(0);G(()=>{i&&r(t=>{let n=t.toolsets[e].name;t.toolsets[e].name=a,t.toolsets[e].allowedTools=s,n!==a&&(t.defaultToolset===n&&(t.defaultToolset=a),t.planModeToolset===n&&(t.planModeToolset=a))})},[a,s]);let p=e=>s===`*`?!0:s.includes(e),m=e=>{e===`All`?c(`*`):e===`None`?c([]):s===`*`?c(Et.filter(t=>t!==e)):s.includes(e)?c(s.filter(t=>t!==e)):c([...s,e])};if(H((e,n)=>{if(l){n.return?u(!1):n.escape?(o(i?.name||`New Toolset`),u(!1)):n.backspace||n.delete?o(e=>e.slice(0,-1)):e&&e.length===1&&o(t=>t+e);return}if(n.escape)t();else if(n.upArrow)f(e=>Math.max(0,e-1));else if(n.downArrow)f(e=>Math.min(Et.length+1,e+1));else if(e===` `||n.return)if(d===0)m(`All`);else if(d===1)m(`None`);else{let e=Et[d-2];e&&m(e)}else e===`n`&&u(!0)}),!i)return J(B,{flexDirection:`column`,children:J(V,{color:`red`,children:`Toolset not found`})});let h=s===`*`,g=Array.isArray(s)&&s.length===0;return Y(B,{flexDirection:`column`,children:[J(X,{children:`Edit Toolset`}),J(B,{marginBottom:1,flexDirection:`column`,children:J(V,{dimColor:!0,children:`n to edit name · space/enter to toggle · esc to go back`})}),Y(B,{marginBottom:1,flexDirection:`column`,children:[J(V,{bold:!0,children:`Name:`}),J(B,{marginLeft:2,children:J(B,{borderStyle:`round`,borderColor:l?`yellow`:`gray`,children:J(V,{children:a})})}),l&&J(B,{marginLeft:2,children:J(V,{dimColor:!0,children:`enter to save · esc to cancel`})})]}),Y(B,{marginBottom:1,flexDirection:`column`,children:[J(V,{bold:!0,children:`Allowed Tools:`}),J(B,{marginLeft:2,children:Y(V,{color:d===0?`cyan`:void 0,children:[d===0?`❯ `:` `,h?`●`:`○`,` All`]})}),J(B,{marginLeft:2,children:Y(V,{color:d===1?`cyan`:void 0,children:[d===1?`❯ `:` `,g?`●`:`○`,` None`]})}),Et.map((e,t)=>{let n=t+2;return J(B,{marginLeft:2,children:Y(V,{color:d===n?`cyan`:void 0,children:[d===n?`❯ `:` `,p(e)?`◉`:`○`,` `,e]})},e)})]}),J(B,{borderStyle:`round`,padding:1,marginTop:1,children:Y(B,{flexDirection:`column`,children:[J(V,{bold:!0,children:`Summary:`}),Y(V,{children:[`Name: `,J(V,{color:`cyan`,children:a})]}),Y(V,{children:[`Tools:`,` `,s===`*`?J(V,{color:`green`,children:`All tools (*)`}):s.length===0?J(V,{color:`red`,children:`No tools ([])`}):Y(V,{color:`yellow`,children:[s.length,` selected`]})]})]})})]})}function Ot({onBack:t}){let{settings:{toolsets:n,defaultToolset:r,planModeToolset:i,themes:a},updateSettings:o}=W($),s=ee(),c=a.find(e=>e.id===s)||a[0],l=e.themes[0],u=c?.colors.planMode||l.colors.planMode,d=c?.colors.autoAccept||l.colors.autoAccept,[f,p]=K(0),[m,h]=K(null),[g,_]=K(!0),v=()=>{let e={name:`New Toolset`,allowedTools:[]};o(t=>{t.toolsets.push(e)}),h(n.length),_(!1)},y=e=>{let t=n[e];o(n=>{n.toolsets.splice(e,1),n.defaultToolset===t.name&&(n.defaultToolset=null),n.planModeToolset===t.name&&(n.planModeToolset=null)}),f>=n.length-1&&p(Math.max(0,n.length-2))},b=e=>{let t=n[e];o(e=>{e.defaultToolset=t.name})},x=e=>{let t=n[e];o(e=>{e.planModeToolset=t.name})};if(H((e,r)=>{r.escape?t():r.upArrow?p(e=>Math.max(0,e-1)):r.downArrow?p(e=>Math.min(n.length-1,e+1)):r.return&&n.length>0?(h(f),_(!1)):e===`n`?v():e===`x`&&n.length>0?y(f):e===`d`&&n.length>0?b(f):e===`p`&&n.length>0&&x(f)},{isActive:g}),m!==null)return J(Dt,{toolsetIndex:m,onBack:()=>{h(null),_(!0)}});let S=e=>e.allowedTools===`*`?`All tools`:e.allowedTools.length===0?`No tools`:`${e.allowedTools.length} tool${e.allowedTools.length===1?``:`s`}`;return Y(B,{flexDirection:`column`,children:[J(X,{children:`Toolsets`}),Y(B,{marginBottom:1,flexDirection:`column`,children:[J(V,{dimColor:!0,children:`n to create a new toolset`}),n.length>0&&J(V,{dimColor:!0,children:`d to set as default toolset`}),n.length>0&&J(V,{dimColor:!0,children:`p to set as plan mode toolset`}),n.length>0&&J(V,{dimColor:!0,children:`x to delete a toolset`}),n.length>0&&J(V,{dimColor:!0,children:`enter to edit toolset`}),J(V,{dimColor:!0,children:`esc to go back`})]}),n.length===0?J(V,{children:`No toolsets created yet. Press n to create one.`}):J(B,{flexDirection:`column`,children:n.map((e,t)=>{let n=e.name===r,a=e.name===i,o=f===t,s;return o&&(s=`yellow`),Y(B,{flexDirection:`row`,children:[Y(V,{color:s,children:[o?`❯ `:` `,e.name,` `]}),Y(V,{color:s,children:[`(`,S(e),`)`]}),n&&J(V,{color:d,children:` ⏵⏵ accept edits`}),a&&J(V,{color:u,children:` ⏸ plan mode`})]},t)})})]})}function kt({onBack:e}){let{settings:t,updateSettings:n}=W($),[r,i]=K(`plan`),[a,o]=K(!1),[s,c]=K(0),l=t.subagentModels||{plan:null,explore:null,generalPurpose:null},u=[{id:`plan`,title:`Plan Agent`,description:`The agent responsible for creating implementation plans.`},{id:`explore`,title:`Explore Agent`,description:`The agent specialized for exploring codebases.`},{id:`generalPurpose`,title:`General-purpose Agent`,description:`The agent used for general multi-step tasks.`}],d=[{label:`Default (Inherited)`,value:null},{label:`sonnet`,value:`sonnet`},{label:`haiku`,value:`haiku`},{label:`opus`,value:`opus`},{label:`sonnet[1m]`,value:`sonnet[1m]`}];return H((t,f)=>{if(a){if(f.escape)o(!1);else if(f.upArrow)c(e=>e>0?e-1:d.length-1);else if(f.downArrow)c(e=>e<d.length-1?e+1:0);else if(f.return){let e=d[s].value;n(t=>{t.subagentModels||={plan:null,explore:null,generalPurpose:null},t.subagentModels[r]=e}),o(!1)}}else if(f.escape)e();else if(f.upArrow){let e=u.findIndex(e=>e.id===r);i(u[e>0?e-1:u.length-1].id)}else if(f.downArrow){let e=u.findIndex(e=>e.id===r);i(u[e<u.length-1?e+1:0].id)}else if(t===` `||f.return){let e=l[r],t=d.findIndex(t=>t.value===e);c(t>=0?t:0),o(!0)}}),a?Y(B,{flexDirection:`column`,children:[J(B,{marginBottom:1,children:Y(X,{children:[`Select Model for`,` `,u.find(e=>e.id===r)?.title]})}),d.map((e,t)=>{let n=t===s;return J(B,{children:Y(V,{color:n?`cyan`:void 0,children:[n?`❯ `:` `,e.label,e.value?Y(V,{dimColor:!0,children:[` (`,e.value,`)`]}):null]})},t)})]}):Y(B,{flexDirection:`column`,children:[J(B,{marginBottom:1,children:J(X,{children:`Subagent Model Settings`})}),J(B,{marginBottom:1,children:J(V,{dimColor:!0,children:`Configure which Claude model each subagent uses. Use arrow keys to navigate, enter or space to change a model, and escape to go back.`})}),u.map(e=>{let t=e.id===r,n=l[e.id],i=d.find(e=>e.value===n)?.label||n||`Default`;return Y(B,{flexDirection:`column`,marginBottom:1,children:[J(B,{children:Y(V,{color:t?`cyan`:void 0,children:[t?`❯ `:` `,J(V,{bold:!0,children:e.title})]})}),J(B,{marginLeft:4,children:J(V,{dimColor:!0,children:e.description})}),J(B,{marginLeft:4,children:Y(V,{children:[`Current: `,J(V,{color:`green`,children:i})]})})]},e.id)})]})}function At({onBack:t}){let{settings:n,updateSettings:r}=W($),i=n.claudeMdAltNames??[],[a,o]=K(0),[s,c]=K(!1),[l,u]=K(``),[d,f]=K(!1);return H((n,p)=>{if(s||d){p.return&&l.trim()?(d?(r(e=>{e.claudeMdAltNames||=[],e.claudeMdAltNames.push(l.trim())}),f(!1)):(r(e=>{e.claudeMdAltNames&&(e.claudeMdAltNames[a]=l.trim())}),c(!1)),u(``)):p.escape?(u(``),c(!1),f(!1)):p.backspace||p.delete?u(e=>e.slice(0,-1)):n&&u(e=>e+n);return}p.escape?t():p.upArrow?i.length>0&&o(e=>e>0?e-1:i.length-1):p.downArrow?i.length>0&&o(e=>e<i.length-1?e+1:0):n===`e`?i.length>0&&(u(i[a]),c(!0)):n===`d`?i.length>0&&(r(e=>{e.claudeMdAltNames&&=e.claudeMdAltNames.filter((e,t)=>t!==a)}),a>=i.length-1&&o(Math.max(0,i.length-2))):n===`n`?(f(!0),u(``)):p.ctrl&&n===`r`?(r(t=>{t.claudeMdAltNames=[...e.claudeMdAltNames??[]]}),o(0)):n===`u`||p.shift&&p.upArrow?i.length>1&&a>0&&(r(e=>{if(!e.claudeMdAltNames)return;let t=e.claudeMdAltNames;[t[a-1],t[a]]=[t[a],t[a-1]]}),o(e=>e-1)):(n===`j`||p.shift&&p.downArrow)&&i.length>1&&a<i.length-1&&(r(e=>{if(!e.claudeMdAltNames)return;let t=e.claudeMdAltNames;[t[a],t[a+1]]=[t[a+1],t[a]]}),o(e=>e+1))}),Y(B,{flexDirection:`column`,children:[Y(B,{marginBottom:1,flexDirection:`column`,children:[J(X,{children:`CLAUDE.md Alternative Names`}),Y(B,{flexDirection:`column`,children:[J(V,{dimColor:!0,children:`changes auto-saved`}),J(V,{dimColor:!0,children:`esc to go back`})]})]}),J(B,{marginBottom:1,flexDirection:`column`,children:J(V,{dimColor:!0,children:`When Claude Code looks for CLAUDE.md and doesn't find it, it will try these alternative filenames in order. This lets you use AGENTS.md (and other file names).`})}),J(B,{marginBottom:1,children:J(V,{dimColor:!0,children:`e to edit · d to delete · n to add new · u/j to move up/down · ctrl+r to reset`})}),Y(B,{flexDirection:`column`,children:[i.length===0?J(V,{children:`No alternative names configured. Press n to add one.`}):J(q,{children:(()=>{let e=Math.max(0,a-6),t=Math.min(i.length,e+12),n=Math.max(0,t-12),r=i.slice(n,t);return Y(q,{children:[n>0&&Y(V,{color:`gray`,dimColor:!0,children:[` `,`↑ `,n,` more above`]}),r.map((e,t)=>{let r=n+t,i=r===a;return Y(V,{color:i?`cyan`:void 0,children:[i?`❯ `:` `,e]},r)}),t<i.length&&Y(V,{color:`gray`,dimColor:!0,children:[` `,`↓ `,i.length-t,` more below`]})]})})()}),d&&Y(B,{alignItems:`center`,children:[J(V,{color:`yellow`,children:`❯ `}),J(B,{borderStyle:`round`,borderColor:`yellow`,children:J(V,{children:l})})]}),s&&Y(B,{marginTop:1,alignItems:`center`,children:[J(V,{children:`Editing: `}),J(B,{borderStyle:`round`,borderColor:`yellow`,children:J(V,{children:l})})]})]})]})}const jt=e=>{let t=ke.join(P,e),n;try{n=Oe.readFileSync(t,`utf8`)}catch{return null}let r=Me(n,{delimiters:[`<!--`,`-->`]}),i=r.data,a=(r.content??``).replace(/^\n+/,``).replace(/\n+$/,``),o=e.replace(/\.md$/,``),s=typeof i.name==`string`?i.name:o,c=typeof i.description==`string`?i.description:``,l;return l=a.trim().length===0?`suppressed`:`default`,{id:o,filename:e,name:s,description:c,state:l,body:a}},Mt=()=>{if(!Oe.existsSync(P))return[];let e=Oe.readdirSync(P).filter(e=>e.endsWith(`.md`)).sort(),t=[];for(let n of e){let e=jt(n);e&&t.push(e)}return t},Nt={default:void 0,customized:`cyan`,suppressed:`green`,missing:`red`},Pt={default:`·`,customized:`◆`,suppressed:`☑`,missing:`?`},Ft={default:`default`,customized:`customized`,suppressed:`suppressed`,missing:`missing`};function It({onSubmit:e}){let{settings:t,updateSettings:n}=W($),[i,a]=K(0),[o,s]=K([]),[c,l]=K(!1),[u,d]=K(0);G(()=>{s(Mt())},[u]);let f=t.misc?.suppressDeferredTools??!1,p=o.length,m=Math.max(0,p-1),h=Se(()=>i<8?0:Math.min(i-8+1,Math.max(0,p-8)),[i,p]),g=o.slice(h,h+8),_=h>0,v=h+8<p;if(H((t,s)=>{if(c){s.return?(n(e=>{e.misc?e.misc.suppressDeferredTools=!0:e.misc={suppressDeferredTools:!0}}),l(!1)):s.escape&&l(!1);return}if(s.escape){e();return}if(s.upArrow)a(e=>Math.max(0,e-1));else if(s.downArrow)a(e=>Math.min(m,e+1));else if(t===`o`||s.return){let e=o[i];e&&r(ke.join(P,e.filename))}else if(t===`d`){let e=o[i];if(e)try{Oe.unlinkSync(ke.join(P,e.filename)),d(e=>e+1)}catch{}}else t===`r`?d(e=>e+1):t===`f`&&(f?n(e=>{e.misc&&(e.misc.suppressDeferredTools=!1)}):l(!0))}),c)return J(B,{flexDirection:`column`,paddingX:2,children:Y(B,{borderStyle:`double`,borderColor:`yellow`,padding:2,flexDirection:`column`,children:[J(B,{marginBottom:1,children:J(V,{bold:!0,color:`yellow`,children:`FOOTGUN TOGGLE`})}),Y(B,{marginBottom:1,flexDirection:`column`,children:[Y(V,{children:[`Suppressing this hides MCP servers, Cron jobs, EnterPlanMode, WebFetch, Monitor, and other `,J(V,{bold:!0,children:`deferred`}),` tools from the model.`]}),Y(V,{children:[`The model only learns these tools exist via this announcement. Without it, it cannot call `,J(V,{bold:!0,children:`ToolSearch`}),` to load their schemas and will report capabilities as unavailable.`]})]}),J(B,{children:Y(V,{children:[`Press `,J(V,{color:`red`,children:`Enter`}),` to enable,`,` `,J(V,{color:`green`,children:`Escape`}),` to cancel`]})})]})});let y=P.replace(we.homedir(),`~`),b=o[i];return Y(B,{flexDirection:`column`,children:[J(B,{marginBottom:1,children:J(X,{children:`System Reminders`})}),Y(B,{marginBottom:1,flexDirection:`column`,children:[Y(V,{children:[`Edit per-turn / per-event `,J(V,{bold:!0,children:`<system-reminder>`}),` `,`injections via `,J(V,{bold:!0,children:`.md files`}),` in `,y,`/`]}),J(V,{dimColor:!0,children:`Empty body = suppress · Custom body = override · Files seeded on first --apply. Re-apply after editing.`})]}),p===0?J(B,{flexDirection:`column`,marginBottom:1,children:Y(V,{color:`yellow`,children:[`No override files yet. Run `,J(V,{bold:!0,children:`tweakcc --apply`}),` to seed defaults.`]})}):Y(q,{children:[_&&J(B,{children:Y(V,{dimColor:!0,children:[` ↑ `,h,` more above`]})}),g.map((e,t)=>{let n=h+t===i;return Y(B,{flexDirection:`row`,children:[J(B,{width:2,children:J(V,{color:n?`cyan`:void 0,children:n?`❯ `:` `})}),J(B,{width:3,children:J(V,{color:Nt[e.state],children:Pt[e.state]})}),J(B,{width:14,children:J(V,{dimColor:!0,color:Nt[e.state],children:Ft[e.state]})}),J(B,{flexGrow:1,children:J(V,{bold:n,color:n?`cyan`:void 0,children:e.name})})]},e.id)}),v&&J(B,{children:Y(V,{dimColor:!0,children:[` `,`↓ `,p-h-8,` more below`]})})]}),b&&J(B,{flexDirection:`column`,marginTop:1,paddingX:1,children:J(V,{dimColor:!0,children:b.description})}),Y(B,{marginTop:1,flexDirection:`column`,children:[Y(V,{dimColor:!0,children:[`↑/↓ navigate · `,J(V,{bold:!0,children:`o`}),`/Enter open in editor ·`,` `,J(V,{bold:!0,children:`d`}),` delete (reset on next --apply) ·`,` `,J(V,{bold:!0,children:`r`}),` reload`]}),Y(V,{dimColor:!0,children:[J(V,{bold:!0,children:`f`}),` toggle deferred-tools footgun [`,J(V,{color:f?`red`:void 0,bold:f,children:f?`SUPPRESSED`:`vanilla`}),`] · Esc go back`]})]})]})}const Lt=[`on`,`name-only`,`user-invocable-only`,`off`],Rt={on:`on (full description)`,"name-only":`name-only (model sees no description)`,"user-invocable-only":`user-invocable (hidden from model, /name still works)`,off:`off (not loaded)`},zt={on:void 0,"name-only":`cyan`,"user-invocable-only":`yellow`,off:`red`},Bt={on:`◉`,"name-only":`◐`,"user-invocable-only":`◑`,off:`○`},Vt=ke.join(we.homedir(),`.claude`,`settings.json`),Ht=[ke.join(we.homedir(),`.claude`,`skills`),ke.join(we.homedir(),`.agents`,`skills`)],Ut=e=>Lt[(Lt.indexOf(e)+1)%Lt.length],Wt=e=>Lt[(Lt.indexOf(e)-1+Lt.length)%Lt.length],Gt=()=>{let e=new Set;for(let t of Ht)if(Oe.existsSync(t))try{let n=Oe.readdirSync(t,{withFileTypes:!0});for(let t of n)(t.isDirectory()||t.isSymbolicLink())&&e.add(t.name)}catch{}return[...e].sort()},Kt=()=>{try{let e=Oe.readFileSync(Vt,`utf8`);return{skillOverrides:JSON.parse(e).skillOverrides??{}}}catch{return{skillOverrides:{}}}},qt=e=>{let t={};try{t=JSON.parse(Oe.readFileSync(Vt,`utf8`))}catch{}t.skillOverrides=e,Oe.writeFileSync(Vt,JSON.stringify(t,null,2))};function Jt({onSubmit:e}){let[t,n]=K({}),[r,i]=K([]),[a,o]=K(0),[s,c]=K(!1);G(()=>{i(Gt()),n(Kt().skillOverrides)},[]);let l=Se(()=>r.map(e=>({name:e,state:t[e]??`on`})),[r,t]),u=l.length,d=Math.max(0,u-1),f=Se(()=>a<10?0:Math.min(a-10+1,Math.max(0,u-10)),[a,u]),p=l.slice(f,f+10),m=(e,r)=>{let i=l[e]?.name;if(!i)return;let a={...t};r===`on`?delete a[i]:a[i]=r,n(a),qt(a),c(!0),setTimeout(()=>c(!1),1500)};H((t,n)=>{if(n.escape||n.return&&u===0){e();return}n.upArrow?o(e=>Math.max(0,e-1)):n.downArrow?o(e=>Math.min(d,e+1)):t===` `||n.rightArrow?m(a,Ut(l[a]?.state??`on`)):n.leftArrow?m(a,Wt(l[a]?.state??`on`)):t===`0`?m(a,`on`):t===`x`&&m(a,`off`)});let h=l[a];return Y(B,{flexDirection:`column`,children:[J(B,{marginBottom:1,children:J(X,{children:`Skills (per-skill skillOverrides)`})}),Y(B,{marginBottom:1,flexDirection:`column`,children:[Y(V,{children:[`Writes `,J(V,{bold:!0,children:`skillOverrides`}),` to`,` `,J(V,{color:`cyan`,children:`~/.claude/settings.json`}),` — CC reads this natively, no tweakcc patch needed.`]}),J(V,{dimColor:!0,children:`Each skill: on / name-only / user-invocable-only / off. CC honors immediately; no --apply required.`})]}),u===0?J(B,{children:Y(V,{color:`yellow`,children:[`No skills found in`,` `,Ht.map(e=>e.replace(we.homedir(),`~`)).join(` or `),`.`]})}):Y(q,{children:[f>0&&J(B,{children:Y(V,{dimColor:!0,children:[` ↑ `,f,` more above`]})}),p.map((e,t)=>{let n=f+t===a;return Y(B,{flexDirection:`row`,children:[J(B,{width:2,children:J(V,{color:n?`cyan`:void 0,children:n?`❯ `:` `})}),J(B,{width:3,children:J(V,{color:zt[e.state],children:Bt[e.state]})}),J(B,{width:26,children:J(V,{dimColor:!0,color:zt[e.state],children:e.state})}),J(B,{flexGrow:1,children:J(V,{bold:n,color:n?`cyan`:void 0,children:e.name})})]},e.name)}),f+10<u&&J(B,{children:Y(V,{dimColor:!0,children:[` `,`↓ `,u-f-10,` more below`]})})]}),h&&J(B,{flexDirection:`column`,marginTop:1,children:J(V,{dimColor:!0,children:Rt[h.state]})}),Y(B,{marginTop:1,flexDirection:`column`,children:[Y(V,{dimColor:!0,children:[`↑/↓ navigate · space/→/← cycle state · `,J(V,{bold:!0,children:`0`}),` set on ·`,` `,J(V,{bold:!0,children:`x`}),` set off · Esc back`]}),s&&J(V,{color:`green`,children:`✓ saved to settings.json`})]})]})}const $=be({settings:e,updateSettings:e=>{},changesApplied:!1,ccVersion:``});function Yt({startupCheckInfo:e,configMigrated:t,invocationCommand:n,initialConfig:i}){let[a,s]=K(i),[c,l]=K(!i.hidePiebaldAnnouncement),u=xe(e=>{let t=JSON.parse(JSON.stringify(a.settings));e(t),s(e=>({...e,settings:t,changesApplied:!1})),ae(e=>{e.settings=t,e.changesApplied=!1})},[a.settings]),[d,f]=K(null),[p,m]=K(null);G(()=>{e.wasUpdated&&e.oldVersion&&(m({message:`Your Claude Code installation was updated from ${e.oldVersion} to ${e.newVersion}, and the patching was likely overwritten
3
3
  (However, your customization are still remembered in ${ne}.)
4
4
 
5
5
  Please reapply your changes by running \`${n} --apply\`.`,type:`warning`}),u(()=>{}))},[]),H((e,t)=>{t.ctrl&&e===`c`&&process.exit(0),(e===`q`||t.escape)&&!d&&process.exit(0),e===`h`&&!d&&c&&(l(!1),ae(e=>{e.hidePiebaldAnnouncement=!0}))},{isActive:!d});let h=t=>{switch(m(null),t){case Z.THEMES:case Z.THINKING_VERBS:case Z.THINKING_STYLE:case Z.USER_MESSAGE_DISPLAY:case Z.INPUT_PATTERN_HIGHLIGHTERS:case Z.MISC:case Z.TOOLSETS:case Z.SUBAGENT_MODELS:case Z.CLAUDE_MD_ALT_NAMES:case Z.SYSTEM_REMINDERS:case Z.SKILLS:f(t);break;case Z.VIEW_SYSTEM_PROMPTS:r(w);break;case Z.RESTORE_ORIGINAL:e.ccInstInfo&&(e.ccInstInfo.nativeInstallationPath?o(e.ccInstInfo):y(e.ccInstInfo)).then(()=>{m({message:`Original Claude Code restored successfully!`,type:`success`}),u(()=>{})});break;case Z.OPEN_CONFIG:j(ne);break;case Z.OPEN_CLI:e.ccInstInfo?.cliPath&&j(e.ccInstInfo.cliPath);break;case Z.EXIT:process.exit(0)}},g=()=>{f(null)};return J($.Provider,{value:{settings:a.settings,updateSettings:u,changesApplied:a.changesApplied,ccVersion:e.ccInstInfo?.version||``},children:J(B,{flexDirection:`column`,children:d===null?J(Ke,{onSubmit:h,notification:p,configMigrated:t,showPiebaldAnnouncement:c,changesApplied:a.changesApplied,invocationCommand:n}):d===Z.THEMES?J(st,{onBack:g}):d===Z.THINKING_VERBS?J(ct,{onBack:g}):d===Z.THINKING_STYLE?J(pt,{onBack:g}):d===Z.USER_MESSAGE_DISPLAY?J(_t,{onBack:g}):d===Z.INPUT_PATTERN_HIGHLIGHTERS?J(St,{onBack:g}):d===Z.MISC?J(Tt,{onSubmit:g}):d===Z.TOOLSETS?J(Ot,{onBack:g}):d===Z.SUBAGENT_MODELS?J(kt,{onBack:g}):d===Z.CLAUDE_MD_ALT_NAMES?J(At,{onBack:g}):d===Z.SYSTEM_REMINDERS?J(It,{onSubmit:g}):d===Z.SKILLS?J(Jt,{onSubmit:g}):null})})}async function Xt(e,t){let n=t??await M(),r=await le(n,e);if(!r)return{startupCheckInfo:null,pendingCandidates:null,config:n};let i=he(r);return i?{startupCheckInfo:null,pendingCandidates:i,config:n}:{startupCheckInfo:await Zt(n,r),pendingCandidates:null,config:n}}async function Zt(e,t){if(!t)return null;if(t.version)try{l(await S(t.version))}catch{}let n=t.version,r=e.ccVersion,i=!1;await O(ie)||(F(`startupCheck: ${ie} not found; backing up cli.js`),await s(t),i=!0);let a=!1;return t.nativeInstallationPath&&!await O(k)&&(F(`startupCheck: ${k} not found; backing up native binary`),await _(t),a=!0),n===r?{wasUpdated:!1,oldVersion:null,newVersion:null,ccInstInfo:t}:(i||(F(`startupCheck: real version (${n}) != backed up version (${r}); backing up cli.js`),await De.unlink(ie),await s(t)),t.nativeInstallationPath&&!a&&(F(`startupCheck: real version (${n}) != backed up version (${r}); backing up native binary`),await O(k)&&await De.unlink(k),await _(t)),{wasUpdated:!0,oldVersion:r,newVersion:n,ccInstInfo:t})}let Qt;async function $t(){if(Qt!==void 0)return Qt;try{return Qt=(await import(`oxfmt`)).format,Qt}catch(e){return F(`Failed to load oxfmt:`,e),Qt=null,null}}async function en(e,t,n){let r=await $t();if(!r)return F(`oxfmt unavailable, skipping format+diff`),null;let i=n?.contextLines??10,a=n?.printWidth??80,o=performance.now(),[s,c]=await Promise.all([r(`original.js`,e,{printWidth:a}),r(`modified.js`,t,{printWidth:a})]),l=performance.now();if(s.errors.length>0||c.errors.length>0)return F(`oxfmt format errors:`,`original:`,s.errors,`modified:`,c.errors),null;let u=Ne(`original.js`,`modified.js`,s.code,c.code,``,``,{context:i}),d=performance.now();return{hunks:u.hunks,changeCount:u.hunks.length,formattedLines:s.code.split(`
@@ -1 +1 @@
1
- import{B as e,F as t,I as n,K as r,L as i,O as a,R as o,V as s,a as c,c as l,h as u,l as d,q as f,r as p,z as m}from"../config-3cQoQoFR.mjs";import{a as h,i as g,n as _,r as v,t as y}from"../content-CpJOKvLf.mjs";import*as b from"node:fs/promises";import*as x from"node:path";async function S(e,t){let n=x.dirname(t);await b.mkdir(n,{recursive:!0}),await b.copyFile(e,t)}async function C(e,t){if(!await u(e))throw Error(`Backup file does not exist: ${e}`);await a(t,await b.readFile(e),`restore`)}function w(){return l()}function T(){return p}function E(){return c}async function D(){return await d()}const O={findChalkVar:i,getModuleLoaderFunction:m,getReactVar:e,getRequireFuncName:s,findTextComponent:o,findBoxComponent:n,clearCaches:t,globalReplace:r,showDiff:f};export{S as backupFile,v as findAllInstallations,w as getTweakccConfigDir,T as getTweakccConfigPath,E as getTweakccSystemPromptsDir,O as helpers,y as readContent,D as readTweakccConfig,C as restoreBackup,g as showInteractiveInstallationPicker,h as tryDetectInstallation,_ as writeContent};
1
+ import{B as e,F as t,I as n,K as r,L as i,O as a,R as o,V as s,a as c,c as l,h as u,l as d,q as f,r as p,z as m}from"../config-BGsQaczu.mjs";import{a as h,i as g,n as _,r as v,t as y}from"../content-M0EgBl6Y.mjs";import*as b from"node:fs/promises";import*as x from"node:path";async function S(e,t){let n=x.dirname(t);await b.mkdir(n,{recursive:!0}),await b.copyFile(e,t)}async function C(e,t){if(!await u(e))throw Error(`Backup file does not exist: ${e}`);await a(t,await b.readFile(e),`restore`)}function w(){return l()}function T(){return p}function E(){return c}async function D(){return await d()}const O={findChalkVar:i,getModuleLoaderFunction:m,getReactVar:e,getRequireFuncName:s,findTextComponent:o,findBoxComponent:n,clearCaches:t,globalReplace:r,showDiff:f};export{S as backupFile,v as findAllInstallations,w as getTweakccConfigDir,T as getTweakccConfigPath,E as getTweakccSystemPromptsDir,O as helpers,y as readContent,D as readTweakccConfig,C as restoreBackup,g as showInteractiveInstallationPicker,h as tryDetectInstallation,_ as writeContent};