From bbcecde8cddce3c9703ee6fede45c388f259e894 Mon Sep 17 00:00:00 2001
From: brsbl <57682038+brsbl@users.noreply.github.com>
Date: Sun, 18 Oct 2026 22:46:14 +0000
Subject: [PATCH 1/2] Use neutral workspace chrome in Theme Preview
---
plugins/theme-preview/PLUGIN_OVERVIEW.md | 15 +++++++++++++++
plugins/theme-preview/app.tsx | 2 +-
plugins/theme-preview/package.json | 2 +-
3 files changed, 17 insertions(+), 2 deletions(-)
create mode 100644 plugins/theme-preview/PLUGIN_OVERVIEW.md
diff --git a/plugins/theme-preview/PLUGIN_OVERVIEW.md b/plugins/theme-preview/PLUGIN_OVERVIEW.md
new file mode 100644
index 000000000..1f548a217
--- /dev/null
+++ b/plugins/theme-preview/PLUGIN_OVERVIEW.md
@@ -0,0 +1,15 @@
+## Judge a theme on app surfaces
+
+Open Theme Preview from the sidebar to inspect your palette on a sample bb interface. Switch between Thread, New thread, Split, and Settings views to check the sidebar, conversation, panels, and overlays.
+
+## Compare palettes and modes
+
+The theme picker includes bundled, plugin, and custom themes. Each row previews its own colors and typography. Selecting a row applies the theme and mode to bb itself, including other open windows.
+
+Below the preview, inspect typography, control samples, sidebar states, and resolved surface, text, accent, status, and border values. Text and status samples include contrast ratios against their backgrounds.
+
+## Iterate beside an agent
+
+Keep the preview beside a thread while an agent edits a theme. Saved theme changes refresh the preview and reapply the active palette. The bundled theme-authoring skill explains theme files and tokens.
+
+Requires bb 0.38 or newer. No external account is required; agent-assisted theme editing uses your configured provider.
diff --git a/plugins/theme-preview/app.tsx b/plugins/theme-preview/app.tsx
index 250dfceee..a39f155ef 100644
--- a/plugins/theme-preview/app.tsx
+++ b/plugins/theme-preview/app.tsx
@@ -206,7 +206,7 @@ function Sidebar({ selected, split, hover }: { selected?: boolean; split?: boole
- brsbl
+ Workspace
);
}
diff --git a/plugins/theme-preview/package.json b/plugins/theme-preview/package.json
index 967275fb6..d337679aa 100644
--- a/plugins/theme-preview/package.json
+++ b/plugins/theme-preview/package.json
@@ -3,7 +3,7 @@
"version": "0.1.0",
"type": "module",
"private": true,
- "files": ["assets", "dist", "docs", "skills", "README.md"],
+ "files": ["assets", "dist", "docs", "skills", "README.md", "PLUGIN_OVERVIEW.md"],
"engines": { "bb": ">=0.38.0", "bbPluginSdk": ">=0.4.6" },
"bb": {
"name": "Theme Preview",
From d31d0ecd0ea1018ff33c4efff7b8e58c41dbe688 Mon Sep 17 00:00:00 2001
From: brsbl <57682038+brsbl@users.noreply.github.com>
Date: Sun, 18 Oct 2026 22:55:36 +0000
Subject: [PATCH 2/2] Update tracked preview bundle for neutral workspace label
---
plugins/theme-preview/dist/app.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/theme-preview/dist/app.js b/plugins/theme-preview/dist/app.js
index c0b45a8e7..e5a3ffe59 100644
--- a/plugins/theme-preview/dist/app.js
+++ b/plugins/theme-preview/dist/app.js
@@ -1,2 +1,2 @@
-var te=globalThis.__bbPluginRuntime;if(te==null||te.pluginSdkApp==null)throw new Error('Cannot load "@get-bb/plugin-sdk/app": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var N=te.pluginSdkApp,ut="default"in N?N.default:N,{Markdown:pt,ThreadChat:gt,ThreadTitle:mt,UrlLink:ft,definePluginApp:me,experimental_BranchPicker:ht,experimental_Diff:bt,experimental_FileLink:vt,experimental_Icon:xt,experimental_NewThreadComposer:yt,experimental_PermissionModePicker:wt,experimental_ProviderIcon:St,experimental_ProviderModelPicker:kt,experimental_SourceCode:Rt,experimental_useAppPanel:Tt,experimental_useBranches:zt,experimental_useCheckoutState:Ct,experimental_useCodeTheme:Mt,experimental_useFixedTabTarget:Bt,experimental_useProviders:It,experimental_useSidebarThreadActions:$t,experimental_useSidebarThreadPullRequest:Et,experimental_useSidebarThreadSplit:Pt,experimental_useSidebarThreads:Ft,useBbContext:Wt,useBbNavigate:fe,useComposer:_t,useComposerView:Ht,useEnvironmentProviders:Lt,useRealtime:he,useRealtimeConnectionState:At,useRpc:be,useSdk:Nt,useSettings:Dt,useSidebarSplitLayout:Ot,useSidebarThreadDraft:Vt,useSidebarThreadDraftIds:Gt,useSidebarThreadRowStatus:Ut,useSidebarThreadRowStatuses:jt,useSidebarThreadShortcut:qt}=N;var ne=globalThis.__bbPluginRuntime;if(ne==null||ne.react==null)throw new Error('Cannot load "react": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var D=ne.react,Kt="default"in D?D.default:D,{Activity:Xt,Children:Qt,Component:Jt,Fragment:Zt,Profiler:en,PureComponent:tn,StrictMode:nn,Suspense:on,act:rn,cache:an,cacheSignal:sn,captureOwnerStack:dn,cloneElement:ln,createContext:cn,createElement:un,createRef:pn,forwardRef:gn,isValidElement:mn,lazy:fn,memo:hn,startTransition:bn,unstable_useCacheRefresh:vn,use:xn,useActionState:yn,useCallback:wn,useContext:Sn,useDebugValue:kn,useDeferredValue:Rn,useEffect:W,useEffectEvent:Tn,useId:zn,useImperativeHandle:Cn,useInsertionEffect:Mn,useLayoutEffect:O,useMemo:ve,useOptimistic:Bn,useReducer:In,useRef:I,useState:T,useSyncExternalStore:$n,useTransition:En,version:Pn}=D;function xe(n){let o=Math.max(0,n.controlTop-n.boundaryTop-8),r=Math.max(0,n.boundaryBottom-n.controlBottom-8),a=r<520&&o>r?"up":"down";return{side:a,maxHeight:Math.min(520,Math.floor(a==="up"?o:r))}}function oe(n){let o=n.trim();return o.endsWith("%")?Number.parseFloat(o)*2.55:Number.parseFloat(o)}function He(n){if(n===void 0)return 1;let o=n.trim();return o.endsWith("%")?Number.parseFloat(o)/100:Number.parseFloat(o)}function re(n){let o=/rgba?\(([^)]+)\)/.exec(n);if(!o)return null;let r=o[1].replace(/\s*\/\s*/g,","),a=r.includes(",")?r.split(","):r.trim().split(/\s+/);if(a.length<3||a.length>4)return null;let s=[oe(a[0]),oe(a[1]),oe(a[2]),He(a[3])];return s.every(Number.isFinite)?s:null}function ie(n,o){let r=n[3]+o[3]*(1-n[3]);return r===0?[0,0,0,0]:[(n[0]*n[3]+o[0]*o[3]*(1-n[3]))/r,(n[1]*n[3]+o[1]*o[3]*(1-n[3]))/r,(n[2]*n[3]+o[2]*o[3]*(1-n[3]))/r,r]}function ye(n){let o=r=>{let a=r/255;return a<=.03928?a/12.92:((a+.055)/1.055)**2.4};return .2126*o(n[0])+.7152*o(n[1])+.0722*o(n[2])}function we(n,o,r="rgb(255, 255, 255)"){let a=re(n),s=re(o),d=re(r);if(!a||!s||!d)return null;let l=d[3]<1?ie(d,[255,255,255,1]):d,u=ie(s,l),c=ie(a,u),f=ye(c),g=ye(u);return(Math.max(f,g)+.05)/(Math.min(f,g)+.05)}var V=class{#e=0;begin(){return this.#e+=1,this.#e}isLatest(o){return o===this.#e}};var ae=globalThis.__bbPluginRuntime;if(ae==null||ae.jsxRuntime==null)throw new Error('Cannot load "react/jsx-runtime": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var G=ae.jsxRuntime,Hn="default"in G?G.default:G,{Fragment:_,jsx:t,jsxs:i}=G;var e=(n,o)=>o===void 0?`var(--${n})`:`var(--${n}, ${o})`,C=e("font-sans","ui-sans-serif, system-ui, sans-serif"),x=e("font-mono","ui-monospace, SFMono-Regular, Menlo, monospace"),Le=10,Ce=16,le=10,Se=["thread","new","split","settings"],Ae={thread:"Thread",new:"New thread",split:"Split",settings:"Settings"},Ne={thread:"open thread \xB7 timeline TOC \xB7 side panel \xB7 row menu, hover card, toast",new:"empty state and composer",split:"two panes, one focused",settings:"page header, cards, controls"},K=1280,X=780,ke=2e4;function Re(n,o){let r,a=new Promise((s,d)=>{r=setTimeout(()=>d(new Error(`${o} timed out after ${ke/1e3} seconds`)),ke)});return Promise.race([n,a]).finally(()=>{r!==void 0&&clearTimeout(r)})}function L({color:n,size:o=6}){return t("span",{style:{display:"inline-block",width:o,height:o,borderRadius:999,background:n,flex:"none"}})}function De({children:n,style:o}){return t("div",{style:{fontFamily:x,fontSize:10,letterSpacing:"0.08em",textTransform:"uppercase",color:e("muted-foreground"),...o},children:n})}function z({children:n,tone:o="outline"}){let r={outline:{boxShadow:`inset 0 0 0 1px ${e("border")}`,color:e("foreground")},primary:{background:e("primary"),color:e("primary-foreground")},secondary:{background:e("secondary"),color:e("secondary-foreground")},success:{background:`color-mix(in srgb, ${e("success")} 16%, transparent)`,color:e("success")},warning:{background:`color-mix(in srgb, ${e("warning")} 16%, transparent)`,color:e("warning-text",e("warning"))},destructive:{background:`color-mix(in srgb, ${e("destructive")} 16%, transparent)`,color:e("destructive-text",e("destructive"))},merged:{background:`color-mix(in srgb, ${e("pr-merged")} 16%, transparent)`,color:e("pr-merged")}};return t("span",{style:{display:"inline-flex",alignItems:"center",gap:5,height:20,padding:"0 7px",borderRadius:6,fontSize:11,fontWeight:500,lineHeight:1,whiteSpace:"nowrap",...r[o]},children:n})}function U({children:n,variant:o="default",size:r="md",disabled:a=!1}){let s={default:{background:e("foreground"),color:e("background",e("canvas"))},secondary:{background:e("secondary"),color:e("secondary-foreground")},outline:{boxShadow:`inset 0 0 0 1px ${e("input")}`,color:e("foreground")},ghost:{color:e("foreground")},destructive:{background:e("destructive"),color:e("destructive-foreground")}};return t("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6,borderRadius:8,whiteSpace:"nowrap",height:r==="sm"?26:30,padding:r==="sm"?"0 10px":"0 12px",fontSize:r==="sm"?12:13,fontWeight:500,opacity:a?.5:1,fontFamily:C,...s[o]},children:n})}function Me({on:n}){return t("span",{style:{width:30,height:17,borderRadius:999,background:e(n?"primary":"input"),position:"relative",display:"inline-block",flex:"none"},children:t("span",{style:{position:"absolute",top:2,left:n?15:2,width:13,height:13,borderRadius:999,background:n?e("primary-foreground"):e("background","#fff")}})})}function Te({focused:n=!1,value:o,placeholder:r,width:a=190}){return i("div",{style:{height:30,width:a,borderRadius:8,boxSizing:"border-box",padding:"0 10px",display:"flex",alignItems:"center",gap:1,boxShadow:n?`inset 0 0 0 1px ${e("ring")}, 0 0 0 3px color-mix(in srgb, ${e("ring")} 28%, transparent)`:`inset 0 0 0 1px ${e("input")}`,background:e("background","transparent"),fontSize:12.5,fontFamily:C,color:e(o?"foreground":"muted-foreground")},children:[o??r,n?t("span",{style:{width:1,height:14,background:e("foreground")}}):null]})}var ce={position:"relative",inset:"auto",zIndex:"auto"};function Oe(n){switch(n){case"hover":return{background:e("sidebar-accent"),color:e("sidebar-accent-foreground")};case"selected":return{background:e("state-active")};case"split":return{background:e("bb-sidebar-open-in-split-background",`color-mix(in oklch, ${e("sidebar-accent")} 50%, ${e("sidebar")})`)};default:return{}}}function B({label:n,state:o="rest",dot:r}){return i("div",{style:{display:"flex",alignItems:"center",gap:8,height:28,padding:"0 10px",borderRadius:Le,fontSize:13,color:e("sidebar-foreground"),...Oe(o)},children:[t("span",{style:{flex:1,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:n}),r==="unread"?t(L,{color:e("foreground"),size:5}):r==="status"?t(L,{color:`color-mix(in srgb, ${e("muted-foreground")} 60%, transparent)`,size:5}):null]})}function j({selected:n,split:o,hover:r}){return i("div",{className:"fixed bg-sidebar",style:{...ce,width:248,height:"100%",flex:"none",background:e("sidebar"),color:e("sidebar-foreground"),borderRight:`1px solid ${e("border-seam",e("border"))}`,display:"flex",flexDirection:"column",padding:"10px 8px",boxSizing:"border-box",fontFamily:C},children:[t("div",{style:{display:"flex",alignItems:"center",height:30,padding:"0 10px",fontSize:13,fontWeight:600},children:"bb-plugins"}),t(B,{label:"New thread"}),t("div",{style:{fontSize:11,color:e("muted-foreground"),padding:"6px 10px 4px"},children:"Today"}),t(B,{label:"Endless theme family \u2014 blacklight",state:n?"selected":"rest",dot:"unread"}),t(B,{label:"Specimen sheets + social grid",state:o?"split":"rest",dot:"status"}),t(B,{label:"theme-preview plugin",state:r?"hover":"rest"}),t(B,{label:"Crit: endless-color light foil",dot:"unread"}),t("div",{style:{fontSize:11,color:e("muted-foreground"),padding:"12px 10px 4px"},children:"Yesterday"}),t(B,{label:"Fix pink split row (oklch mix)",dot:"status"}),t(B,{label:"Hue census battery"}),t("div",{style:{flex:1}}),t("div",{style:{display:"flex",alignItems:"center",height:30,padding:"0 10px",fontSize:12.5,color:e("muted-foreground")},children:"brsbl"})]})}var Q={background:e("popover"),color:e("popover-foreground"),boxShadow:`inset 0 0 0 1px ${e("border")}, ${e("shadow-md","0 4px 16px rgba(0,0,0,.2)")}`,borderRadius:10,fontFamily:C,fontSize:13};function q({children:n,hover:o=!1,destructive:r=!1,kbd:a}){return i("div",{style:{display:"flex",alignItems:"center",gap:8,height:28,padding:"0 10px",borderRadius:6,margin:"0 4px",background:o?e("accent"):void 0,color:r?e("destructive-text",e("destructive")):e(o?"accent-foreground":"popover-foreground")},children:[t("span",{style:{flex:1},children:n}),a?t("span",{style:{fontFamily:x,fontSize:11,color:e("muted-foreground")},children:a}):null]})}function Ve({style:n}){return i("div",{style:{...Q,width:200,padding:"5px 0",...n},children:[t(q,{kbd:"\u2318\u21E7O",children:"Open in split"}),t(q,{hover:!0,kbd:"\u2318R",children:"Rename"}),t(q,{children:"Move to section"}),t("div",{style:{height:1,background:e("border"),margin:"5px 0"}}),t(q,{destructive:!0,children:"Delete thread"})]})}function Ge({style:n}){return i("div",{style:{...Q,width:280,padding:13,...n},children:[i("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:7},children:[t(L,{color:e("warning")})," ",t("span",{style:{fontWeight:600},children:"Specimen sheets + social grid"})]}),t("div",{style:{fontSize:12.5,color:e("muted-foreground"),lineHeight:"18px",marginBottom:10},children:"Regenerating both sheets against the new ramp."}),i("div",{style:{display:"flex",gap:6},children:[t(z,{tone:"outline",children:"bb/endless-theme"}),t(z,{tone:"merged",children:"#42"})]})]})}function Ue({style:n}){return i("div",{style:{...Q,width:280,padding:"11px 13px",display:"flex",gap:10,alignItems:"flex-start",boxShadow:`inset 0 0 0 1px ${e("border")}, ${e("shadow-lg","0 8px 24px rgba(0,0,0,.25)")}`,...n},children:[t(L,{color:e("success"),size:8}),i("div",{style:{flex:1},children:[t("div",{style:{fontWeight:600,marginBottom:2},children:"Theme applied"}),t("div",{style:{fontSize:12.5,color:e("muted-foreground")},children:"endless-color is now active."})]})]})}function se({children:n}){return t("div",{style:{alignSelf:"flex-end",maxWidth:"70%",background:e("surface-recessed","rgba(127,127,127,.05)"),boxShadow:`inset 0 0 0 1px ${e("border-seam",e("border"))}`,borderRadius:Ce,padding:"10px 14px"},children:n})}function je(){let n=(o,r)=>t("div",{style:{padding:"0 12px",whiteSpace:"pre",background:r==="add"?`color-mix(in srgb, ${e("diff-added")} 18%, transparent)`:r==="del"?`color-mix(in srgb, ${e("diff-removed")} 18%, transparent)`:void 0},children:o},o);return i("div",{style:{borderRadius:le,overflow:"hidden",boxShadow:`inset 0 0 0 1px ${e("border-seam",e("border"))}`,fontFamily:x,fontSize:12,lineHeight:"19px",color:e("foreground"),padding:"8px 0"},children:[i("div",{style:{padding:"0 12px 6px",fontSize:11,display:"flex",gap:8,color:e("muted-foreground")},children:[t("span",{style:{color:e("file-accent",e("muted-foreground"))},children:"themes/endless-color.css"}),t("span",{children:"+2 \u22121"})]}),n(" .dark .fixed.bg-sidebar {"),n("- --sidebar: #1d1d1d;","del"),n("+ --sidebar: #070707;","add"),n(" }")]})}function ze({focused:n=!1,text:o}){return i("div",{style:{borderRadius:Ce,background:e("background",e("canvas")),padding:"12px 12px 10px",display:"flex",flexDirection:"column",gap:12,boxShadow:n?`inset 0 0 0 1px ${e("ring")}, 0 0 0 3px color-mix(in srgb, ${e("ring")} 25%, transparent)`:`inset 0 0 0 1px ${e("border")}`},children:[t("div",{style:{fontSize:13.5,color:e(o?"foreground":"muted-foreground"),minHeight:20},children:o??"Ask for a follow-up."}),i("div",{style:{display:"flex",alignItems:"center",gap:6},children:[t("span",{style:{fontSize:12,color:e("muted-foreground")},children:"claude-fable-5"}),t("div",{style:{flex:1}}),t("div",{style:{width:26,height:26,borderRadius:8,background:e(o?"primary":"muted"),color:e(o?"primary-foreground":"muted-foreground"),display:"grid",placeItems:"center",fontSize:12},children:"\u2191"})]})]})}function qe(){let n=[["Theme tokens","28 resolved","success"],["Contrast floor","AA passed","success"],["Reference sheet","Updated","secondary"]];return i("div",{style:{borderRadius:le,background:e("surface-recessed","rgba(127,127,127,.05)"),boxShadow:`inset 0 0 0 1px ${e("border-seam",e("border"))}`,padding:"10px 12px"},children:[t("div",{style:{fontSize:12.5,fontWeight:600,marginBottom:6},children:"Verification summary"}),n.map(([o,r,a])=>i("div",{style:{display:"flex",alignItems:"center",gap:10,minHeight:25,borderTop:`1px solid ${e("border-hairline",e("border"))}`},children:[t("span",{style:{flex:1,color:e("muted-foreground")},children:o}),t(z,{tone:a,children:r})]},o))]})}function Ye(){let n=["Three blacks were fragmenting the frame\u2026","Selection now reads rgba(47,180,255,.20)\u2026","Tightened the raised surfaces and kept seams neutral\u2026"];return i("div",{style:{position:"absolute",right:10,top:58,zIndex:4,display:"flex",alignItems:"flex-start"},children:[t("div",{id:"thread-toc-panel-preview",style:{position:"absolute",right:36,top:0,width:292,paddingRight:4},children:i("div",{"data-tp-toc":"panel",style:{padding:4,borderRadius:8,background:e("popover"),color:e("popover-foreground"),boxShadow:`inset 0 0 0 1px ${e("border")}, ${e("shadow-lg","0 8px 24px rgba(0,0,0,.22)")}`},children:[i("div",{style:{display:"flex",alignItems:"center",gap:2,paddingBottom:4},children:[t("span",{style:{borderRadius:6,padding:"5px 8px",background:e("state-hover"),color:e("foreground"),fontSize:11.5,fontWeight:600},children:"Agent messages"}),t("span",{style:{borderRadius:6,padding:"5px 8px",color:e("muted-foreground"),fontSize:11.5},children:"Your messages"})]}),t("div",{style:{display:"flex",flexDirection:"column"},children:n.map((o,r)=>t("div",{style:{borderRadius:6,padding:"6px 8px",fontSize:12,lineHeight:"16px",background:r===1?e("state-hover"):void 0,color:e(r===1?"foreground":"muted-foreground")},children:o},o))})]})}),t("div",{"aria-label":"Thread table of contents",style:{width:32,padding:"8px 0",display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[12,12,20,12,12].map((o,r)=>t("span",{style:{width:o,height:3,borderRadius:999,background:r===2?`color-mix(in srgb, ${e("foreground")} 70%, transparent)`:`color-mix(in srgb, ${e("foreground")} 20%, transparent)`}},r))})]})}function Y({title:n="Endless theme family \u2014 blacklight pass",active:o=!0,narrow:r=!1,empty:a=!1,marker:s=!1,toc:d=!1,children:l}){let u=r?20:30;return i("div",{style:{flex:1,minWidth:0,height:"100%",background:e("canvas",e("background")),color:e("foreground"),display:"flex",flexDirection:"column",fontFamily:C,position:"relative"},children:[a?i("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:20,padding:`0 ${u}px`},children:[t("div",{style:{fontSize:21,fontWeight:600,letterSpacing:"-0.01em"},children:"What are we building?"}),t("div",{style:{width:"100%",maxWidth:620},children:t(ze,{focused:!0,text:"make the blacklight variant feel like the reference"})}),t("div",{style:{display:"flex",gap:8},children:["Fix the failing build","Review open PRs"].map(c=>t("span",{style:{fontSize:12.5,padding:"6px 12px",borderRadius:999,boxShadow:`inset 0 0 0 1px ${e("border")}`,color:e("muted-foreground")},children:c},c))})]}):i(_,{children:[i("div",{style:{height:48,display:"flex",alignItems:"center",gap:10,padding:`0 ${u}px`,flex:"none",position:"relative"},children:[s&&o?t("span",{style:{position:"absolute",left:0,right:0,top:0,height:2,background:e("primary")}}):null,t("span",{style:{fontSize:13.5,fontWeight:600,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:n}),i(z,{tone:"success",children:[t(L,{color:e("success"),size:6})," Running"]}),r?null:t(z,{tone:"outline",children:"bb/endless-theme-plugin"})]}),i("div",{style:{flex:1,overflow:"hidden",padding:`22px ${d?54:u}px 0 ${u}px`,display:"flex",flexDirection:"column",justifyContent:"space-between",gap:16,fontSize:13.5,lineHeight:"21px"},children:[t(se,{children:"make the blacklight variant feel like the reference \u2014 neon orange seam, blue selection, calm UV canvas."}),i("div",{children:["Three blacks were fragmenting the frame. The base theme's"," ",t("code",{style:{fontFamily:x,fontSize:"0.92em",fontWeight:600,background:e("surface-recessed"),padding:"1px 5px",borderRadius:4},children:".fixed.bg-sidebar"})," ","block was overriding the variant's sidebar tokens, so it rendered ",t("span",{style:{fontFamily:x,fontSize:"0.92em"},children:"#1d1d1d"})," instead of true black."]}),t(je,{}),i("div",{style:{color:e("muted-foreground"),fontSize:12.5,display:"flex",alignItems:"center",gap:8},children:[t("span",{style:{width:1,height:18,background:e("timeline-accent",e("border"))}}),"14:02 \xB7 ",t("span",{style:{color:e("file-accent",e("muted-foreground")),fontFamily:x},children:"themes/endless-color.css"})]}),t(se,{children:"looks right \u2014 now match the selection blue to the glove."}),i("div",{children:["Done. Selection now reads ",t("span",{style:{fontFamily:x,fontSize:"0.92em"},children:"rgba(47,180,255,.20)"})," over the canvas, and file paths pick up the glove's steel blue \u2014 ",t("span",{style:{color:e("file-accent",e("muted-foreground")),fontFamily:x,fontSize:"0.92em"},children:"build-color.py"})," shows it inline.",t("span",{"data-tp-selection":"sample",style:{background:e("selection-color-default",e("surface-selected")),color:e("foreground"),borderRadius:3,padding:"0 3px",WebkitBoxDecorationBreak:"clone",boxDecorationBreak:"clone"},children:" Selected text stays readable."})]}),i("div",{style:{color:e("muted-foreground"),fontSize:12.5,display:"flex",alignItems:"center",gap:8},children:[t("span",{style:{width:1,height:18,background:e("timeline-accent",e("border"))}}),"14:18 \xB7 checks completed"]}),t(qe,{}),t(se,{children:"keep the hierarchy calm \u2014 orange should guide the eye, not fill the room."}),t("div",{children:"Tightened the raised surfaces and kept the content seams neutral. The sidebar edge is the only persistent orange line; focus and selection stay blue, so the two signals never compete."})]}),t("div",{style:{padding:`12px ${u}px 18px`,flex:"none"},children:t(ze,{focused:o})})]}),d?t(Ye,{}):null,l]})}function Ke(){let n=(o,r)=>i("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:12,fontSize:12.5,height:28},children:[t("span",{style:{color:e("muted-foreground")},children:o}),t("span",{style:{color:e("foreground"),textAlign:"right",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:r})]},o);return i("div",{className:"bg-sidebar",style:{...ce,width:280,height:"100%",flex:"none",background:e("sidebar"),color:e("sidebar-foreground"),borderLeft:`1px solid ${e("border-seam",e("border"))}`,fontFamily:C,display:"flex",flexDirection:"column"},children:[t("div",{style:{height:48,display:"flex",alignItems:"center",gap:14,padding:"0 16px",fontSize:12.5},children:["Info","Files","Changes"].map((o,r)=>t("span",{style:{color:e(r===0?"foreground":"muted-foreground"),fontWeight:r===0?600:400},children:o},o))}),i("div",{style:{padding:"14px 16px",display:"flex",flexDirection:"column",gap:14},children:[i("div",{children:[n("Status",t(z,{tone:"success",children:"Running"})),n("Agent","Claude Fable 5"),n("Branch",t("span",{style:{fontFamily:x,fontSize:12},children:"bb/endless-theme"})),n("Pull request",t(z,{tone:"merged",children:"Merged #42"}))]}),i("div",{children:[t(De,{style:{marginBottom:4},children:"Files"}),["themes/endless-color.css","build-color.py"].map(o=>t("div",{style:{height:24,fontSize:12.5,fontFamily:x,color:e("file-accent",e("foreground")),overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:o},o))]}),t("div",{style:{borderRadius:le,background:e("surface-recessed-soft-solid",e("card")),boxShadow:`inset 0 0 0 1px ${e("border-hairline",e("border"))}`,padding:"10px 12px",fontSize:12.5,color:e("readback-foreground",e("muted-foreground")),lineHeight:"18px"},children:"Sidebar reads true black with the orange seam; blue selection at .20."})]})]})}function Xe(){return t("div",{style:{flex:1,minWidth:0,height:"100%",background:e("canvas",e("background")),color:e("foreground"),fontFamily:C,overflow:"hidden"},children:i("div",{style:{maxWidth:720,margin:"0 auto",padding:"36px 32px"},children:[i("div",{style:{borderRadius:14,padding:"24px 26px",marginBottom:22,background:`linear-gradient(135deg, ${e("secondary")} 0%, ${e("accent")} 100%)`,boxShadow:`inset 0 0 0 1px ${e("border-hairline",e("border"))}`},children:[t("div",{style:{fontSize:21,fontWeight:600,letterSpacing:"-0.01em",marginBottom:6},children:"Extensions"}),t("div",{style:{fontSize:13.5,color:e("muted-foreground"),maxWidth:440,lineHeight:"20px"},children:"Plugins add surfaces, agents and themes to bb."})]}),t("div",{style:{display:"flex",gap:18,borderBottom:`1px solid ${e("border")}`,marginBottom:18,fontSize:13},children:["Installed","Marketplace","Themes"].map((n,o)=>t("span",{style:{padding:"0 0 8px",color:e(o===0?"foreground":"muted-foreground"),fontWeight:o===0?600:400,boxShadow:o===0?`inset 0 -2px 0 0 ${e("primary")}`:void 0},children:n},n))}),t("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},children:["Endless","Endless Color","Theme Preview","Plugin Guide"].map((n,o)=>i("div",{style:{borderRadius:12,background:e("card"),boxShadow:`inset 0 0 0 1px ${e("border")}, ${e("shadow-xs","none")}`,padding:"12px 14px",display:"flex",gap:12,alignItems:"center"},children:[i("div",{style:{flex:1,minWidth:0},children:[t("div",{style:{fontSize:13,fontWeight:600},children:n}),i("div",{style:{fontSize:12,color:e("muted-foreground")},children:["v0.1.",o]})]}),t(Me,{on:o!==3})]},n))})]})})}function Qe({view:n}){switch(n){case"thread":return i(_,{children:[t(j,{selected:!0}),t(Y,{toc:!0}),t(Ke,{}),t(Ve,{style:{position:"absolute",left:196,top:118,zIndex:5}}),t(Ge,{style:{position:"absolute",left:254,top:292,zIndex:5}}),t(Ue,{style:{position:"absolute",right:20,bottom:20,zIndex:5}})]});case"new":return i(_,{children:[t(j,{hover:!0}),t(Y,{empty:!0})]});case"split":return i(_,{children:[t(j,{selected:!0,split:!0}),t(Y,{narrow:!0,marker:!0}),t("div",{style:{width:1,background:e("border-seam-vertical",e("border-seam",e("border"))),flex:"none"}}),t(Y,{title:"Specimen sheets + social grid",active:!1,narrow:!0,marker:!0})]});case"settings":return i(_,{children:[t(j,{}),t(Xe,{})]})}}function Je({view:n,fitBoth:o=!1}){let r=I(null),[a,s]=T({zoom:.8,height:X});return O(()=>{let d=r.current;if(!d)return;let l=()=>{if(o){let g=Math.min(1,Math.max(.24,Math.min(d.clientWidth/K,d.clientHeight/X)));s({zoom:g,height:X});return}let c=Math.min(1,Math.max(.24,d.clientWidth/K)),f=Math.min(1400,Math.max(620,Math.floor(d.clientHeight/c)));s({zoom:c,height:f})};l();let u=new ResizeObserver(l);return u.observe(d),()=>u.disconnect()},[o]),t("div",{ref:r,style:{flex:1,minHeight:0,display:"flex",alignItems:"flex-start",justifyContent:"center",overflow:"hidden"},children:t("div",{style:{width:K,height:a.height,zoom:a.zoom,display:"flex",overflow:"hidden",borderRadius:12,position:"relative",flex:"none",boxShadow:e("shadow-lg","0 10px 30px rgba(0,0,0,.25)"),background:e("canvas",e("background"))},children:t(Qe,{view:n})})})}var Be=["canvas","sidebar","card","popover","secondary","muted","surface-recessed-solid","surface-scrim"],Ie=[{title:"Ink",tokens:["foreground","muted-foreground","subtle-foreground","readback-foreground","sidebar-foreground"]},{title:"Accent",tokens:["primary","file-accent","timeline-accent","surface-selected","state-hover","state-active"]},{title:"Status",tokens:["success","warning","destructive","pr-merged","diff-added","diff-removed"]},{title:"Lines",tokens:["border","border-hairline","border-seam","sidebar-border","input","ring"]}],Ze=[...Be,...Ie.flatMap(n=>n.tokens)];function et(n){let o=/rgba?\(([^)]+)\)/.exec(n),r=null;if(o)r=o[1].split(",").map(g=>parseFloat(g.trim()));else if(n){let g=document.createElement("canvas");g.width=1,g.height=1;let h=g.getContext("2d",{willReadFrequently:!0});if(h){h.clearRect(0,0,1,1),h.fillStyle=n,h.fillRect(0,0,1,1);let[M,w,E,S]=h.getImageData(0,0,1,1).data;r=[M,w,E,S/255]}}if(!r||r.length<3||r.some(g=>!Number.isFinite(g)))return{rgb:"",hex:"\u2014"};let[a,s,d,l]=r,u=[a,s,d].map(g=>Math.round(g)),c="#"+u.map(g=>g.toString(16).padStart(2,"0")).join(""),f=l===void 0?1:l;return{rgb:f<1?`rgba(${u.join(", ")}, ${f})`:`rgb(${u.join(", ")})`,hex:f<1?`${c} ${Math.round(f*100)}%`:c}}function tt(n,o){let[r,a]=T({});return W(()=>{let s=setTimeout(()=>{let d=getComputedStyle(document.documentElement),l=document.createElement("div");l.className="fixed bg-sidebar",l.style.cssText="position:fixed;left:-9999px;top:-9999px;width:0;height:0;pointer-events:none",document.body.appendChild(l);let u=getComputedStyle(l),c=document.createElement("span");c.style.cssText="position:fixed;left:-9999px;top:-9999px;width:1px;height:1px",document.body.appendChild(c);let f={};for(let g of n){let h=d.getPropertyValue(`--${g}`).trim(),M=u.getPropertyValue(`--${g}`).trim();c.style.backgroundColor="",c.style.backgroundColor=`var(--${g})`;let w=h?et(getComputedStyle(c).backgroundColor):{rgb:"",hex:"\u2014"};f[g]={value:h,hex:w.hex,rgb:w.rgb,sidebar:M&&M!==h?M:null}}l.remove(),c.remove(),a(f)},350);return()=>clearTimeout(s)},[n,o]),r}function $e({name:n,computed:o,contrastAgainst:r}){let a=o[n],s=r&&a?.rgb&&o[r]?.rgb?we(a.rgb,o[r].rgb,r==="canvas"?void 0:o.canvas?.rgb):null;return i("div",{style:{display:"grid",gridTemplateColumns:r?"24px minmax(0, 1fr) 72px 46px":"24px minmax(0, 1fr) 72px",alignItems:"center",columnGap:6,height:22},children:[t("span",{title:a?.sidebar?`${a.value}
+var te=globalThis.__bbPluginRuntime;if(te==null||te.pluginSdkApp==null)throw new Error('Cannot load "@get-bb/plugin-sdk/app": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var N=te.pluginSdkApp,ut="default"in N?N.default:N,{Markdown:pt,ThreadChat:gt,ThreadTitle:mt,UrlLink:ft,definePluginApp:me,experimental_BranchPicker:ht,experimental_Diff:bt,experimental_FileLink:vt,experimental_Icon:xt,experimental_NewThreadComposer:yt,experimental_PermissionModePicker:wt,experimental_ProviderIcon:St,experimental_ProviderModelPicker:kt,experimental_SourceCode:Rt,experimental_useAppPanel:Tt,experimental_useBranches:zt,experimental_useCheckoutState:Ct,experimental_useCodeTheme:Mt,experimental_useFixedTabTarget:Bt,experimental_useProviders:It,experimental_useSidebarThreadActions:$t,experimental_useSidebarThreadPullRequest:Et,experimental_useSidebarThreadSplit:Pt,experimental_useSidebarThreads:Ft,useBbContext:Wt,useBbNavigate:fe,useComposer:_t,useComposerView:Ht,useEnvironmentProviders:Lt,useRealtime:he,useRealtimeConnectionState:At,useRpc:be,useSdk:Nt,useSettings:Dt,useSidebarSplitLayout:Ot,useSidebarThreadDraft:Vt,useSidebarThreadDraftIds:Gt,useSidebarThreadRowStatus:Ut,useSidebarThreadRowStatuses:jt,useSidebarThreadShortcut:qt}=N;var ne=globalThis.__bbPluginRuntime;if(ne==null||ne.react==null)throw new Error('Cannot load "react": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var D=ne.react,Kt="default"in D?D.default:D,{Activity:Xt,Children:Qt,Component:Jt,Fragment:Zt,Profiler:en,PureComponent:tn,StrictMode:nn,Suspense:on,act:rn,cache:an,cacheSignal:sn,captureOwnerStack:dn,cloneElement:ln,createContext:cn,createElement:un,createRef:pn,forwardRef:gn,isValidElement:mn,lazy:fn,memo:hn,startTransition:bn,unstable_useCacheRefresh:vn,use:xn,useActionState:yn,useCallback:wn,useContext:Sn,useDebugValue:kn,useDeferredValue:Rn,useEffect:W,useEffectEvent:Tn,useId:zn,useImperativeHandle:Cn,useInsertionEffect:Mn,useLayoutEffect:O,useMemo:ve,useOptimistic:Bn,useReducer:In,useRef:I,useState:T,useSyncExternalStore:$n,useTransition:En,version:Pn}=D;function xe(n){let o=Math.max(0,n.controlTop-n.boundaryTop-8),r=Math.max(0,n.boundaryBottom-n.controlBottom-8),a=r<520&&o>r?"up":"down";return{side:a,maxHeight:Math.min(520,Math.floor(a==="up"?o:r))}}function oe(n){let o=n.trim();return o.endsWith("%")?Number.parseFloat(o)*2.55:Number.parseFloat(o)}function He(n){if(n===void 0)return 1;let o=n.trim();return o.endsWith("%")?Number.parseFloat(o)/100:Number.parseFloat(o)}function re(n){let o=/rgba?\(([^)]+)\)/.exec(n);if(!o)return null;let r=o[1].replace(/\s*\/\s*/g,","),a=r.includes(",")?r.split(","):r.trim().split(/\s+/);if(a.length<3||a.length>4)return null;let s=[oe(a[0]),oe(a[1]),oe(a[2]),He(a[3])];return s.every(Number.isFinite)?s:null}function ie(n,o){let r=n[3]+o[3]*(1-n[3]);return r===0?[0,0,0,0]:[(n[0]*n[3]+o[0]*o[3]*(1-n[3]))/r,(n[1]*n[3]+o[1]*o[3]*(1-n[3]))/r,(n[2]*n[3]+o[2]*o[3]*(1-n[3]))/r,r]}function ye(n){let o=r=>{let a=r/255;return a<=.03928?a/12.92:((a+.055)/1.055)**2.4};return .2126*o(n[0])+.7152*o(n[1])+.0722*o(n[2])}function we(n,o,r="rgb(255, 255, 255)"){let a=re(n),s=re(o),d=re(r);if(!a||!s||!d)return null;let l=d[3]<1?ie(d,[255,255,255,1]):d,u=ie(s,l),c=ie(a,u),f=ye(c),g=ye(u);return(Math.max(f,g)+.05)/(Math.min(f,g)+.05)}var V=class{#e=0;begin(){return this.#e+=1,this.#e}isLatest(o){return o===this.#e}};var ae=globalThis.__bbPluginRuntime;if(ae==null||ae.jsxRuntime==null)throw new Error('Cannot load "react/jsx-runtime": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var G=ae.jsxRuntime,Hn="default"in G?G.default:G,{Fragment:_,jsx:t,jsxs:i}=G;var e=(n,o)=>o===void 0?`var(--${n})`:`var(--${n}, ${o})`,C=e("font-sans","ui-sans-serif, system-ui, sans-serif"),x=e("font-mono","ui-monospace, SFMono-Regular, Menlo, monospace"),Le=10,Ce=16,le=10,Se=["thread","new","split","settings"],Ae={thread:"Thread",new:"New thread",split:"Split",settings:"Settings"},Ne={thread:"open thread \xB7 timeline TOC \xB7 side panel \xB7 row menu, hover card, toast",new:"empty state and composer",split:"two panes, one focused",settings:"page header, cards, controls"},K=1280,X=780,ke=2e4;function Re(n,o){let r,a=new Promise((s,d)=>{r=setTimeout(()=>d(new Error(`${o} timed out after ${ke/1e3} seconds`)),ke)});return Promise.race([n,a]).finally(()=>{r!==void 0&&clearTimeout(r)})}function L({color:n,size:o=6}){return t("span",{style:{display:"inline-block",width:o,height:o,borderRadius:999,background:n,flex:"none"}})}function De({children:n,style:o}){return t("div",{style:{fontFamily:x,fontSize:10,letterSpacing:"0.08em",textTransform:"uppercase",color:e("muted-foreground"),...o},children:n})}function z({children:n,tone:o="outline"}){let r={outline:{boxShadow:`inset 0 0 0 1px ${e("border")}`,color:e("foreground")},primary:{background:e("primary"),color:e("primary-foreground")},secondary:{background:e("secondary"),color:e("secondary-foreground")},success:{background:`color-mix(in srgb, ${e("success")} 16%, transparent)`,color:e("success")},warning:{background:`color-mix(in srgb, ${e("warning")} 16%, transparent)`,color:e("warning-text",e("warning"))},destructive:{background:`color-mix(in srgb, ${e("destructive")} 16%, transparent)`,color:e("destructive-text",e("destructive"))},merged:{background:`color-mix(in srgb, ${e("pr-merged")} 16%, transparent)`,color:e("pr-merged")}};return t("span",{style:{display:"inline-flex",alignItems:"center",gap:5,height:20,padding:"0 7px",borderRadius:6,fontSize:11,fontWeight:500,lineHeight:1,whiteSpace:"nowrap",...r[o]},children:n})}function U({children:n,variant:o="default",size:r="md",disabled:a=!1}){let s={default:{background:e("foreground"),color:e("background",e("canvas"))},secondary:{background:e("secondary"),color:e("secondary-foreground")},outline:{boxShadow:`inset 0 0 0 1px ${e("input")}`,color:e("foreground")},ghost:{color:e("foreground")},destructive:{background:e("destructive"),color:e("destructive-foreground")}};return t("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6,borderRadius:8,whiteSpace:"nowrap",height:r==="sm"?26:30,padding:r==="sm"?"0 10px":"0 12px",fontSize:r==="sm"?12:13,fontWeight:500,opacity:a?.5:1,fontFamily:C,...s[o]},children:n})}function Me({on:n}){return t("span",{style:{width:30,height:17,borderRadius:999,background:e(n?"primary":"input"),position:"relative",display:"inline-block",flex:"none"},children:t("span",{style:{position:"absolute",top:2,left:n?15:2,width:13,height:13,borderRadius:999,background:n?e("primary-foreground"):e("background","#fff")}})})}function Te({focused:n=!1,value:o,placeholder:r,width:a=190}){return i("div",{style:{height:30,width:a,borderRadius:8,boxSizing:"border-box",padding:"0 10px",display:"flex",alignItems:"center",gap:1,boxShadow:n?`inset 0 0 0 1px ${e("ring")}, 0 0 0 3px color-mix(in srgb, ${e("ring")} 28%, transparent)`:`inset 0 0 0 1px ${e("input")}`,background:e("background","transparent"),fontSize:12.5,fontFamily:C,color:e(o?"foreground":"muted-foreground")},children:[o??r,n?t("span",{style:{width:1,height:14,background:e("foreground")}}):null]})}var ce={position:"relative",inset:"auto",zIndex:"auto"};function Oe(n){switch(n){case"hover":return{background:e("sidebar-accent"),color:e("sidebar-accent-foreground")};case"selected":return{background:e("state-active")};case"split":return{background:e("bb-sidebar-open-in-split-background",`color-mix(in oklch, ${e("sidebar-accent")} 50%, ${e("sidebar")})`)};default:return{}}}function B({label:n,state:o="rest",dot:r}){return i("div",{style:{display:"flex",alignItems:"center",gap:8,height:28,padding:"0 10px",borderRadius:Le,fontSize:13,color:e("sidebar-foreground"),...Oe(o)},children:[t("span",{style:{flex:1,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:n}),r==="unread"?t(L,{color:e("foreground"),size:5}):r==="status"?t(L,{color:`color-mix(in srgb, ${e("muted-foreground")} 60%, transparent)`,size:5}):null]})}function j({selected:n,split:o,hover:r}){return i("div",{className:"fixed bg-sidebar",style:{...ce,width:248,height:"100%",flex:"none",background:e("sidebar"),color:e("sidebar-foreground"),borderRight:`1px solid ${e("border-seam",e("border"))}`,display:"flex",flexDirection:"column",padding:"10px 8px",boxSizing:"border-box",fontFamily:C},children:[t("div",{style:{display:"flex",alignItems:"center",height:30,padding:"0 10px",fontSize:13,fontWeight:600},children:"bb-plugins"}),t(B,{label:"New thread"}),t("div",{style:{fontSize:11,color:e("muted-foreground"),padding:"6px 10px 4px"},children:"Today"}),t(B,{label:"Endless theme family \u2014 blacklight",state:n?"selected":"rest",dot:"unread"}),t(B,{label:"Specimen sheets + social grid",state:o?"split":"rest",dot:"status"}),t(B,{label:"theme-preview plugin",state:r?"hover":"rest"}),t(B,{label:"Crit: endless-color light foil",dot:"unread"}),t("div",{style:{fontSize:11,color:e("muted-foreground"),padding:"12px 10px 4px"},children:"Yesterday"}),t(B,{label:"Fix pink split row (oklch mix)",dot:"status"}),t(B,{label:"Hue census battery"}),t("div",{style:{flex:1}}),t("div",{style:{display:"flex",alignItems:"center",height:30,padding:"0 10px",fontSize:12.5,color:e("muted-foreground")},children:"Workspace"})]})}var Q={background:e("popover"),color:e("popover-foreground"),boxShadow:`inset 0 0 0 1px ${e("border")}, ${e("shadow-md","0 4px 16px rgba(0,0,0,.2)")}`,borderRadius:10,fontFamily:C,fontSize:13};function q({children:n,hover:o=!1,destructive:r=!1,kbd:a}){return i("div",{style:{display:"flex",alignItems:"center",gap:8,height:28,padding:"0 10px",borderRadius:6,margin:"0 4px",background:o?e("accent"):void 0,color:r?e("destructive-text",e("destructive")):e(o?"accent-foreground":"popover-foreground")},children:[t("span",{style:{flex:1},children:n}),a?t("span",{style:{fontFamily:x,fontSize:11,color:e("muted-foreground")},children:a}):null]})}function Ve({style:n}){return i("div",{style:{...Q,width:200,padding:"5px 0",...n},children:[t(q,{kbd:"\u2318\u21E7O",children:"Open in split"}),t(q,{hover:!0,kbd:"\u2318R",children:"Rename"}),t(q,{children:"Move to section"}),t("div",{style:{height:1,background:e("border"),margin:"5px 0"}}),t(q,{destructive:!0,children:"Delete thread"})]})}function Ge({style:n}){return i("div",{style:{...Q,width:280,padding:13,...n},children:[i("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:7},children:[t(L,{color:e("warning")})," ",t("span",{style:{fontWeight:600},children:"Specimen sheets + social grid"})]}),t("div",{style:{fontSize:12.5,color:e("muted-foreground"),lineHeight:"18px",marginBottom:10},children:"Regenerating both sheets against the new ramp."}),i("div",{style:{display:"flex",gap:6},children:[t(z,{tone:"outline",children:"bb/endless-theme"}),t(z,{tone:"merged",children:"#42"})]})]})}function Ue({style:n}){return i("div",{style:{...Q,width:280,padding:"11px 13px",display:"flex",gap:10,alignItems:"flex-start",boxShadow:`inset 0 0 0 1px ${e("border")}, ${e("shadow-lg","0 8px 24px rgba(0,0,0,.25)")}`,...n},children:[t(L,{color:e("success"),size:8}),i("div",{style:{flex:1},children:[t("div",{style:{fontWeight:600,marginBottom:2},children:"Theme applied"}),t("div",{style:{fontSize:12.5,color:e("muted-foreground")},children:"endless-color is now active."})]})]})}function se({children:n}){return t("div",{style:{alignSelf:"flex-end",maxWidth:"70%",background:e("surface-recessed","rgba(127,127,127,.05)"),boxShadow:`inset 0 0 0 1px ${e("border-seam",e("border"))}`,borderRadius:Ce,padding:"10px 14px"},children:n})}function je(){let n=(o,r)=>t("div",{style:{padding:"0 12px",whiteSpace:"pre",background:r==="add"?`color-mix(in srgb, ${e("diff-added")} 18%, transparent)`:r==="del"?`color-mix(in srgb, ${e("diff-removed")} 18%, transparent)`:void 0},children:o},o);return i("div",{style:{borderRadius:le,overflow:"hidden",boxShadow:`inset 0 0 0 1px ${e("border-seam",e("border"))}`,fontFamily:x,fontSize:12,lineHeight:"19px",color:e("foreground"),padding:"8px 0"},children:[i("div",{style:{padding:"0 12px 6px",fontSize:11,display:"flex",gap:8,color:e("muted-foreground")},children:[t("span",{style:{color:e("file-accent",e("muted-foreground"))},children:"themes/endless-color.css"}),t("span",{children:"+2 \u22121"})]}),n(" .dark .fixed.bg-sidebar {"),n("- --sidebar: #1d1d1d;","del"),n("+ --sidebar: #070707;","add"),n(" }")]})}function ze({focused:n=!1,text:o}){return i("div",{style:{borderRadius:Ce,background:e("background",e("canvas")),padding:"12px 12px 10px",display:"flex",flexDirection:"column",gap:12,boxShadow:n?`inset 0 0 0 1px ${e("ring")}, 0 0 0 3px color-mix(in srgb, ${e("ring")} 25%, transparent)`:`inset 0 0 0 1px ${e("border")}`},children:[t("div",{style:{fontSize:13.5,color:e(o?"foreground":"muted-foreground"),minHeight:20},children:o??"Ask for a follow-up."}),i("div",{style:{display:"flex",alignItems:"center",gap:6},children:[t("span",{style:{fontSize:12,color:e("muted-foreground")},children:"claude-fable-5"}),t("div",{style:{flex:1}}),t("div",{style:{width:26,height:26,borderRadius:8,background:e(o?"primary":"muted"),color:e(o?"primary-foreground":"muted-foreground"),display:"grid",placeItems:"center",fontSize:12},children:"\u2191"})]})]})}function qe(){let n=[["Theme tokens","28 resolved","success"],["Contrast floor","AA passed","success"],["Reference sheet","Updated","secondary"]];return i("div",{style:{borderRadius:le,background:e("surface-recessed","rgba(127,127,127,.05)"),boxShadow:`inset 0 0 0 1px ${e("border-seam",e("border"))}`,padding:"10px 12px"},children:[t("div",{style:{fontSize:12.5,fontWeight:600,marginBottom:6},children:"Verification summary"}),n.map(([o,r,a])=>i("div",{style:{display:"flex",alignItems:"center",gap:10,minHeight:25,borderTop:`1px solid ${e("border-hairline",e("border"))}`},children:[t("span",{style:{flex:1,color:e("muted-foreground")},children:o}),t(z,{tone:a,children:r})]},o))]})}function Ye(){let n=["Three blacks were fragmenting the frame\u2026","Selection now reads rgba(47,180,255,.20)\u2026","Tightened the raised surfaces and kept seams neutral\u2026"];return i("div",{style:{position:"absolute",right:10,top:58,zIndex:4,display:"flex",alignItems:"flex-start"},children:[t("div",{id:"thread-toc-panel-preview",style:{position:"absolute",right:36,top:0,width:292,paddingRight:4},children:i("div",{"data-tp-toc":"panel",style:{padding:4,borderRadius:8,background:e("popover"),color:e("popover-foreground"),boxShadow:`inset 0 0 0 1px ${e("border")}, ${e("shadow-lg","0 8px 24px rgba(0,0,0,.22)")}`},children:[i("div",{style:{display:"flex",alignItems:"center",gap:2,paddingBottom:4},children:[t("span",{style:{borderRadius:6,padding:"5px 8px",background:e("state-hover"),color:e("foreground"),fontSize:11.5,fontWeight:600},children:"Agent messages"}),t("span",{style:{borderRadius:6,padding:"5px 8px",color:e("muted-foreground"),fontSize:11.5},children:"Your messages"})]}),t("div",{style:{display:"flex",flexDirection:"column"},children:n.map((o,r)=>t("div",{style:{borderRadius:6,padding:"6px 8px",fontSize:12,lineHeight:"16px",background:r===1?e("state-hover"):void 0,color:e(r===1?"foreground":"muted-foreground")},children:o},o))})]})}),t("div",{"aria-label":"Thread table of contents",style:{width:32,padding:"8px 0",display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[12,12,20,12,12].map((o,r)=>t("span",{style:{width:o,height:3,borderRadius:999,background:r===2?`color-mix(in srgb, ${e("foreground")} 70%, transparent)`:`color-mix(in srgb, ${e("foreground")} 20%, transparent)`}},r))})]})}function Y({title:n="Endless theme family \u2014 blacklight pass",active:o=!0,narrow:r=!1,empty:a=!1,marker:s=!1,toc:d=!1,children:l}){let u=r?20:30;return i("div",{style:{flex:1,minWidth:0,height:"100%",background:e("canvas",e("background")),color:e("foreground"),display:"flex",flexDirection:"column",fontFamily:C,position:"relative"},children:[a?i("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:20,padding:`0 ${u}px`},children:[t("div",{style:{fontSize:21,fontWeight:600,letterSpacing:"-0.01em"},children:"What are we building?"}),t("div",{style:{width:"100%",maxWidth:620},children:t(ze,{focused:!0,text:"make the blacklight variant feel like the reference"})}),t("div",{style:{display:"flex",gap:8},children:["Fix the failing build","Review open PRs"].map(c=>t("span",{style:{fontSize:12.5,padding:"6px 12px",borderRadius:999,boxShadow:`inset 0 0 0 1px ${e("border")}`,color:e("muted-foreground")},children:c},c))})]}):i(_,{children:[i("div",{style:{height:48,display:"flex",alignItems:"center",gap:10,padding:`0 ${u}px`,flex:"none",position:"relative"},children:[s&&o?t("span",{style:{position:"absolute",left:0,right:0,top:0,height:2,background:e("primary")}}):null,t("span",{style:{fontSize:13.5,fontWeight:600,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:n}),i(z,{tone:"success",children:[t(L,{color:e("success"),size:6})," Running"]}),r?null:t(z,{tone:"outline",children:"bb/endless-theme-plugin"})]}),i("div",{style:{flex:1,overflow:"hidden",padding:`22px ${d?54:u}px 0 ${u}px`,display:"flex",flexDirection:"column",justifyContent:"space-between",gap:16,fontSize:13.5,lineHeight:"21px"},children:[t(se,{children:"make the blacklight variant feel like the reference \u2014 neon orange seam, blue selection, calm UV canvas."}),i("div",{children:["Three blacks were fragmenting the frame. The base theme's"," ",t("code",{style:{fontFamily:x,fontSize:"0.92em",fontWeight:600,background:e("surface-recessed"),padding:"1px 5px",borderRadius:4},children:".fixed.bg-sidebar"})," ","block was overriding the variant's sidebar tokens, so it rendered ",t("span",{style:{fontFamily:x,fontSize:"0.92em"},children:"#1d1d1d"})," instead of true black."]}),t(je,{}),i("div",{style:{color:e("muted-foreground"),fontSize:12.5,display:"flex",alignItems:"center",gap:8},children:[t("span",{style:{width:1,height:18,background:e("timeline-accent",e("border"))}}),"14:02 \xB7 ",t("span",{style:{color:e("file-accent",e("muted-foreground")),fontFamily:x},children:"themes/endless-color.css"})]}),t(se,{children:"looks right \u2014 now match the selection blue to the glove."}),i("div",{children:["Done. Selection now reads ",t("span",{style:{fontFamily:x,fontSize:"0.92em"},children:"rgba(47,180,255,.20)"})," over the canvas, and file paths pick up the glove's steel blue \u2014 ",t("span",{style:{color:e("file-accent",e("muted-foreground")),fontFamily:x,fontSize:"0.92em"},children:"build-color.py"})," shows it inline.",t("span",{"data-tp-selection":"sample",style:{background:e("selection-color-default",e("surface-selected")),color:e("foreground"),borderRadius:3,padding:"0 3px",WebkitBoxDecorationBreak:"clone",boxDecorationBreak:"clone"},children:" Selected text stays readable."})]}),i("div",{style:{color:e("muted-foreground"),fontSize:12.5,display:"flex",alignItems:"center",gap:8},children:[t("span",{style:{width:1,height:18,background:e("timeline-accent",e("border"))}}),"14:18 \xB7 checks completed"]}),t(qe,{}),t(se,{children:"keep the hierarchy calm \u2014 orange should guide the eye, not fill the room."}),t("div",{children:"Tightened the raised surfaces and kept the content seams neutral. The sidebar edge is the only persistent orange line; focus and selection stay blue, so the two signals never compete."})]}),t("div",{style:{padding:`12px ${u}px 18px`,flex:"none"},children:t(ze,{focused:o})})]}),d?t(Ye,{}):null,l]})}function Ke(){let n=(o,r)=>i("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:12,fontSize:12.5,height:28},children:[t("span",{style:{color:e("muted-foreground")},children:o}),t("span",{style:{color:e("foreground"),textAlign:"right",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:r})]},o);return i("div",{className:"bg-sidebar",style:{...ce,width:280,height:"100%",flex:"none",background:e("sidebar"),color:e("sidebar-foreground"),borderLeft:`1px solid ${e("border-seam",e("border"))}`,fontFamily:C,display:"flex",flexDirection:"column"},children:[t("div",{style:{height:48,display:"flex",alignItems:"center",gap:14,padding:"0 16px",fontSize:12.5},children:["Info","Files","Changes"].map((o,r)=>t("span",{style:{color:e(r===0?"foreground":"muted-foreground"),fontWeight:r===0?600:400},children:o},o))}),i("div",{style:{padding:"14px 16px",display:"flex",flexDirection:"column",gap:14},children:[i("div",{children:[n("Status",t(z,{tone:"success",children:"Running"})),n("Agent","Claude Fable 5"),n("Branch",t("span",{style:{fontFamily:x,fontSize:12},children:"bb/endless-theme"})),n("Pull request",t(z,{tone:"merged",children:"Merged #42"}))]}),i("div",{children:[t(De,{style:{marginBottom:4},children:"Files"}),["themes/endless-color.css","build-color.py"].map(o=>t("div",{style:{height:24,fontSize:12.5,fontFamily:x,color:e("file-accent",e("foreground")),overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:o},o))]}),t("div",{style:{borderRadius:le,background:e("surface-recessed-soft-solid",e("card")),boxShadow:`inset 0 0 0 1px ${e("border-hairline",e("border"))}`,padding:"10px 12px",fontSize:12.5,color:e("readback-foreground",e("muted-foreground")),lineHeight:"18px"},children:"Sidebar reads true black with the orange seam; blue selection at .20."})]})]})}function Xe(){return t("div",{style:{flex:1,minWidth:0,height:"100%",background:e("canvas",e("background")),color:e("foreground"),fontFamily:C,overflow:"hidden"},children:i("div",{style:{maxWidth:720,margin:"0 auto",padding:"36px 32px"},children:[i("div",{style:{borderRadius:14,padding:"24px 26px",marginBottom:22,background:`linear-gradient(135deg, ${e("secondary")} 0%, ${e("accent")} 100%)`,boxShadow:`inset 0 0 0 1px ${e("border-hairline",e("border"))}`},children:[t("div",{style:{fontSize:21,fontWeight:600,letterSpacing:"-0.01em",marginBottom:6},children:"Extensions"}),t("div",{style:{fontSize:13.5,color:e("muted-foreground"),maxWidth:440,lineHeight:"20px"},children:"Plugins add surfaces, agents and themes to bb."})]}),t("div",{style:{display:"flex",gap:18,borderBottom:`1px solid ${e("border")}`,marginBottom:18,fontSize:13},children:["Installed","Marketplace","Themes"].map((n,o)=>t("span",{style:{padding:"0 0 8px",color:e(o===0?"foreground":"muted-foreground"),fontWeight:o===0?600:400,boxShadow:o===0?`inset 0 -2px 0 0 ${e("primary")}`:void 0},children:n},n))}),t("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},children:["Endless","Endless Color","Theme Preview","Plugin Guide"].map((n,o)=>i("div",{style:{borderRadius:12,background:e("card"),boxShadow:`inset 0 0 0 1px ${e("border")}, ${e("shadow-xs","none")}`,padding:"12px 14px",display:"flex",gap:12,alignItems:"center"},children:[i("div",{style:{flex:1,minWidth:0},children:[t("div",{style:{fontSize:13,fontWeight:600},children:n}),i("div",{style:{fontSize:12,color:e("muted-foreground")},children:["v0.1.",o]})]}),t(Me,{on:o!==3})]},n))})]})})}function Qe({view:n}){switch(n){case"thread":return i(_,{children:[t(j,{selected:!0}),t(Y,{toc:!0}),t(Ke,{}),t(Ve,{style:{position:"absolute",left:196,top:118,zIndex:5}}),t(Ge,{style:{position:"absolute",left:254,top:292,zIndex:5}}),t(Ue,{style:{position:"absolute",right:20,bottom:20,zIndex:5}})]});case"new":return i(_,{children:[t(j,{hover:!0}),t(Y,{empty:!0})]});case"split":return i(_,{children:[t(j,{selected:!0,split:!0}),t(Y,{narrow:!0,marker:!0}),t("div",{style:{width:1,background:e("border-seam-vertical",e("border-seam",e("border"))),flex:"none"}}),t(Y,{title:"Specimen sheets + social grid",active:!1,narrow:!0,marker:!0})]});case"settings":return i(_,{children:[t(j,{}),t(Xe,{})]})}}function Je({view:n,fitBoth:o=!1}){let r=I(null),[a,s]=T({zoom:.8,height:X});return O(()=>{let d=r.current;if(!d)return;let l=()=>{if(o){let g=Math.min(1,Math.max(.24,Math.min(d.clientWidth/K,d.clientHeight/X)));s({zoom:g,height:X});return}let c=Math.min(1,Math.max(.24,d.clientWidth/K)),f=Math.min(1400,Math.max(620,Math.floor(d.clientHeight/c)));s({zoom:c,height:f})};l();let u=new ResizeObserver(l);return u.observe(d),()=>u.disconnect()},[o]),t("div",{ref:r,style:{flex:1,minHeight:0,display:"flex",alignItems:"flex-start",justifyContent:"center",overflow:"hidden"},children:t("div",{style:{width:K,height:a.height,zoom:a.zoom,display:"flex",overflow:"hidden",borderRadius:12,position:"relative",flex:"none",boxShadow:e("shadow-lg","0 10px 30px rgba(0,0,0,.25)"),background:e("canvas",e("background"))},children:t(Qe,{view:n})})})}var Be=["canvas","sidebar","card","popover","secondary","muted","surface-recessed-solid","surface-scrim"],Ie=[{title:"Ink",tokens:["foreground","muted-foreground","subtle-foreground","readback-foreground","sidebar-foreground"]},{title:"Accent",tokens:["primary","file-accent","timeline-accent","surface-selected","state-hover","state-active"]},{title:"Status",tokens:["success","warning","destructive","pr-merged","diff-added","diff-removed"]},{title:"Lines",tokens:["border","border-hairline","border-seam","sidebar-border","input","ring"]}],Ze=[...Be,...Ie.flatMap(n=>n.tokens)];function et(n){let o=/rgba?\(([^)]+)\)/.exec(n),r=null;if(o)r=o[1].split(",").map(g=>parseFloat(g.trim()));else if(n){let g=document.createElement("canvas");g.width=1,g.height=1;let h=g.getContext("2d",{willReadFrequently:!0});if(h){h.clearRect(0,0,1,1),h.fillStyle=n,h.fillRect(0,0,1,1);let[M,w,E,S]=h.getImageData(0,0,1,1).data;r=[M,w,E,S/255]}}if(!r||r.length<3||r.some(g=>!Number.isFinite(g)))return{rgb:"",hex:"\u2014"};let[a,s,d,l]=r,u=[a,s,d].map(g=>Math.round(g)),c="#"+u.map(g=>g.toString(16).padStart(2,"0")).join(""),f=l===void 0?1:l;return{rgb:f<1?`rgba(${u.join(", ")}, ${f})`:`rgb(${u.join(", ")})`,hex:f<1?`${c} ${Math.round(f*100)}%`:c}}function tt(n,o){let[r,a]=T({});return W(()=>{let s=setTimeout(()=>{let d=getComputedStyle(document.documentElement),l=document.createElement("div");l.className="fixed bg-sidebar",l.style.cssText="position:fixed;left:-9999px;top:-9999px;width:0;height:0;pointer-events:none",document.body.appendChild(l);let u=getComputedStyle(l),c=document.createElement("span");c.style.cssText="position:fixed;left:-9999px;top:-9999px;width:1px;height:1px",document.body.appendChild(c);let f={};for(let g of n){let h=d.getPropertyValue(`--${g}`).trim(),M=u.getPropertyValue(`--${g}`).trim();c.style.backgroundColor="",c.style.backgroundColor=`var(--${g})`;let w=h?et(getComputedStyle(c).backgroundColor):{rgb:"",hex:"\u2014"};f[g]={value:h,hex:w.hex,rgb:w.rgb,sidebar:M&&M!==h?M:null}}l.remove(),c.remove(),a(f)},350);return()=>clearTimeout(s)},[n,o]),r}function $e({name:n,computed:o,contrastAgainst:r}){let a=o[n],s=r&&a?.rgb&&o[r]?.rgb?we(a.rgb,o[r].rgb,r==="canvas"?void 0:o.canvas?.rgb):null;return i("div",{style:{display:"grid",gridTemplateColumns:r?"24px minmax(0, 1fr) 72px 46px":"24px minmax(0, 1fr) 72px",alignItems:"center",columnGap:6,height:22},children:[t("span",{title:a?.sidebar?`${a.value}
sidebar: ${a.sidebar}`:a?.value,style:{width:24,height:14,borderRadius:3,background:a?.value?e(n):"transparent",boxShadow:`inset 0 0 0 1px ${a?.sidebar?e("warning"):e("border-hairline",e("border"))}`}}),t("span",{style:{fontFamily:x,fontSize:10.5,color:e("foreground"),overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:n}),t("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",fontFamily:x,fontSize:10.5,color:e("muted-foreground"),textAlign:"right",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"},children:a?.hex??""}),r?t("span",{title:`contrast vs --${r} \xB7 WCAG floor 4.5:1`,style:{fontFamily:x,fontSize:10.5,textAlign:"right",fontVariantNumeric:"tabular-nums",color:s===null||s>=4.5?e("success"):e("destructive-text",e("destructive")),fontWeight:s!==null&&s<4.5?600:400,whiteSpace:"nowrap"},children:s===null?"":`${s.toFixed(2)}:1`}):null]})}function H({title:n,note:o,wide:r=!1,children:a}){return i("div",{style:{marginBottom:14,gridColumn:r?"1 / -1":void 0,minWidth:0},children:[i("div",{style:{display:"flex",alignItems:"baseline",gap:8,minHeight:18,marginBottom:6,overflow:"hidden"},children:[t("span",{style:{fontSize:12,fontWeight:650,color:e("foreground"),whiteSpace:"nowrap"},children:n}),o?t("span",{style:{minWidth:0,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontSize:10.5,color:e("muted-foreground")},children:o}):null]}),a]})}function nt(){return i("div",{style:{display:"flex",flexDirection:"column",gap:3},children:[t("span",{style:{fontSize:15,fontWeight:600,letterSpacing:"-0.005em"},children:"Title \xB7 foreground 600"}),t("span",{style:{fontSize:13.5},children:"Body at 13.5 \u2014 the thing most pixels are."}),t("span",{style:{fontSize:13,color:e("muted-foreground")},children:"Muted \xB7 labels and captions"}),t("span",{style:{fontSize:12.5,color:e("subtle-foreground",e("muted-foreground"))},children:"Subtle \xB7 secondary metadata"}),i("span",{style:{fontSize:13},children:["inline ",t("code",{style:{fontFamily:x,fontSize:"0.92em",fontWeight:600,background:e("surface-recessed"),padding:"1px 5px",borderRadius:4},children:"--token"})," \xB7 ",t("span",{style:{fontFamily:x,fontSize:12.5,color:e("file-accent","inherit")},children:"path/file.tsx"})," \xB7 ",t("span",{style:{color:e("primary"),textDecoration:"underline",textUnderlineOffset:3},children:"link"})]})]})}function ot({computed:n,catalog:o,mode:r,pendingSelection:a,selectionSlow:s,selectionFailed:d,onPick:l,onRetry:u}){return i("div",{children:[i("div",{style:{display:"flex",alignItems:"baseline",gap:8,minHeight:22,marginBottom:12},children:[t("span",{style:{fontSize:13,fontWeight:650,letterSpacing:"-0.005em"},children:"Theme surfaces"}),t("span",{style:{fontSize:10.5,color:e("muted-foreground")},children:"live values"})]}),t(H,{title:"Theme",note:"applies live",children:t(st,{catalog:o,mode:r,pendingSelection:a,selectionSlow:s,selectionFailed:d,onPick:l,onRetry:u})}),t(H,{title:"Surfaces",note:"amber = sidebar override",children:t("div",{style:{display:"flex",flexDirection:"column",gap:1},children:Be.map(c=>t($e,{name:c,computed:n},c))})})]})}function rt({computed:n}){return i("div",{children:[i("div",{style:{display:"flex",alignItems:"baseline",gap:9,minHeight:22,marginBottom:14},children:[t("span",{style:{fontSize:13,fontWeight:650,letterSpacing:"-0.005em"},children:"Style guide"}),t("span",{style:{fontSize:11,color:e("muted-foreground")},children:"visual specimens + live token readout"})]}),i("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(240px, 1fr))",columnGap:24,alignItems:"start"},children:[t(H,{title:"Visual controls",note:"preview only",wide:!0,children:i("div",{style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center"},children:[t(U,{size:"sm",children:"Default"}),t(U,{size:"sm",variant:"secondary",children:"Secondary"}),t(U,{size:"sm",variant:"outline",children:"Outline"}),t(U,{size:"sm",variant:"destructive",children:"Delete"}),t(Me,{on:!0}),t(Te,{placeholder:"Search threads\u2026",width:150}),t(Te,{focused:!0,value:"endless",width:110}),i(z,{tone:"success",children:[t(L,{color:e("success"),size:6})," Running"]}),t(z,{tone:"warning",children:"Attention"}),t(z,{tone:"destructive",children:"Failed"}),t(z,{tone:"merged",children:"Merged"}),t(z,{tone:"outline",children:"branch"})]})}),t(H,{title:"Type",note:"visual specimen",children:t(nt,{})}),Ie.map(o=>t(H,{title:o.title,note:o.title==="Ink"?"ratio vs its surface \xB7 floor 4.5:1":o.title==="Status"?"ratio vs canvas":void 0,children:t("div",{style:{display:"flex",flexDirection:"column",gap:1},children:o.tokens.map(r=>t($e,{name:r,computed:n,contrastAgainst:o.title==="Ink"?r==="sidebar-foreground"?"sidebar":"canvas":o.title==="Status"?"canvas":void 0},r))})},o.title)),t(H,{title:"Sidebar rows",note:"1:1, in the real sidebar scope",children:i("div",{className:"fixed bg-sidebar",style:{...ce,overflow:"hidden",background:e("sidebar"),boxShadow:`inset 0 0 0 1px ${e("border-seam",e("border"))}`,borderRadius:10,padding:6},children:[t(B,{label:"rest \xB7 unread",dot:"unread"}),t(B,{label:"hover \xB7 sidebar-accent",state:"hover"}),t(B,{label:"open thread \xB7 state-active",state:"selected"}),t(B,{label:"open in split",state:"split",dot:"status"})]})})]})]})}var it=["sidebar","canvas","card","primary","accent"];function Ee({swatch:n,w:o=13,h:r=20}){return t("span",{style:{display:"flex",gap:3,flex:"none"},children:it.map(a=>t("span",{title:`--${a==="accent"?"file-accent":a}: ${n?.[a]??"bundled with the app, not readable from disk"}`,style:{width:o,height:r,borderRadius:3,flex:"none",background:n?.[a]??"transparent",boxShadow:`inset 0 0 0 1px ${n?.[a]?e("border-hairline",e("border")):e("border")}`,opacity:n?.[a]?1:.35}},a))})}function at({entry:n,mode:o,active:r,onPick:a}){let s=o==="dark"?n.dark:n.light,d=s?.canvas??(o==="dark"?"#1a1a1a":"#f4f4f4"),l=s?.foreground??(o==="dark"?"#e6e6e6":"#111111"),u=s?.fontSans??n.light?.fontSans??n.dark?.fontSans??C,c=s?.fontMono??n.light?.fontMono??n.dark?.fontMono??x;return i("button",{type:"button",onClick:a,style:{appearance:"none",border:0,cursor:"pointer",textAlign:"left",padding:"4px 6px",borderRadius:7,display:"flex",alignItems:"center",gap:8,width:"100%",fontFamily:C,background:r?e("accent"):"transparent",color:e(r?"accent-foreground":"popover-foreground")},children:[t(Ee,{swatch:s,w:10,h:16}),t("span",{style:{flex:1,minWidth:0,fontSize:12,fontWeight:r?600:500,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:n.name}),i("span",{style:{display:"inline-flex",alignItems:"baseline",gap:5,padding:"1px 6px",borderRadius:4,flex:"none",background:d,color:l,boxShadow:`inset 0 0 0 1px ${e("border-hairline",e("border"))}`},children:[t("span",{style:{fontFamily:u,fontSize:12.5,fontWeight:600},children:"Aa"}),t("span",{style:{fontFamily:c,fontSize:11},children:"Aa"})]}),t("span",{style:{fontSize:10.5,color:e("muted-foreground"),width:28,flex:"none",textTransform:"capitalize"},children:o})]})}function st({catalog:n,mode:o,pendingSelection:r,selectionSlow:a,selectionFailed:s,onPick:d,onRetry:l}){let[u,c]=T(!1),[f,g]=T({side:"down",maxHeight:520}),h=I(null);O(()=>{if(!u)return;let b=h.current,m=b?.closest("[data-tp-root]");if(!b||!m)return;let v=()=>{let k=b.querySelector("[data-tp-theme-control]");if(!k)return;let R=k.getBoundingClientRect(),$=m.getBoundingClientRect();g(xe({controlTop:R.top,controlBottom:R.bottom,boundaryTop:Math.max(0,$.top),boundaryBottom:Math.min(window.innerHeight,$.bottom)}))};return v(),window.addEventListener("resize",v),m.addEventListener("scroll",v,{passive:!0}),()=>{window.removeEventListener("resize",v),m.removeEventListener("scroll",v)}},[u]),W(()=>{if(!u)return;let b=v=>{h.current?.contains(v.target)||c(!1)},m=v=>{if(v.key==="Escape"&&c(!1),v.key==="ArrowDown"||v.key==="ArrowUp"){v.preventDefault();let k=Array.from(h.current?.querySelectorAll("[role=listbox] button")??[]);if(k.length===0)return;let R=k.indexOf(document.activeElement),$=R===-1?0:(R+(v.key==="ArrowDown"?1:k.length-1))%k.length;k[$].focus()}};return document.addEventListener("mousedown",b),document.addEventListener("keydown",m),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",m)}},[u]);let M=r?.themeId??n.activeThemeId,w=n.themes.find(b=>b.id===M)??n.themes[0],E=w?o==="dark"?w.dark:w.light:null,S=r!==null,J=S?`${a?"Still applying":"Applying"} ${w?.name??"theme"} ${o}`:`${w?.name??"Theme"} ${o}`;return i("div",{ref:h,style:{position:"relative"},children:[i("button",{"data-tp-theme-control":"",type:"button","aria-haspopup":"listbox","aria-expanded":u,"aria-busy":S,"aria-label":J,disabled:S,onClick:()=>c(b=>!b),style:{appearance:"none",border:0,cursor:S?"wait":"pointer",fontFamily:C,display:"inline-flex",alignItems:"center",gap:5,height:24,padding:"0 6px",borderRadius:7,background:e("card"),color:e("foreground"),fontSize:11.5,fontWeight:500,maxWidth:200,boxShadow:`inset 0 0 0 1px ${e("border")}, ${e("shadow-xs","none")}`,opacity:S?.72:1},children:[t(Ee,{swatch:E,w:6,h:11}),t("span",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",minWidth:0},children:w?.name??"theme"}),t("span",{style:{color:e("muted-foreground"),textTransform:"capitalize",fontSize:10.5,flex:"none"},children:o}),t("span",{"aria-hidden":"true",style:{color:e("muted-foreground"),fontSize:9,flex:"none"},children:S?"\u2026":"\u25BE"})]}),u?t("div",{role:"listbox","aria-label":"Theme and mode",style:{...Q,position:"absolute",top:f.side==="down"?28:void 0,bottom:f.side==="up"?28:void 0,right:0,width:296,padding:4,zIndex:30,maxHeight:f.maxHeight,overflowY:"auto"},children:n.themes.map(b=>i("div",{style:{padding:"1px 0"},children:[["light","dark"].map(m=>t(at,{entry:b,mode:m,active:b.id===n.activeThemeId&&m===o,onPick:()=>{d(b.id,m),c(!1)}},m)),t("div",{style:{height:1,background:e("border-hairline",e("border")),margin:"3px 6px"}})]},b.id))}):null,s?i("div",{role:"alert",style:{display:"flex",alignItems:"center",gap:7,marginTop:6,minHeight:20,fontSize:10.5,color:e("destructive-text",e("destructive"))},children:[t("span",{children:"Theme didn\u2019t apply."}),t("button",{type:"button","aria-label":"Retry theme",onClick:l,style:{appearance:"none",border:0,padding:0,cursor:"pointer",background:"transparent",color:"inherit",font:"inherit",fontWeight:650,textDecoration:"underline",textUnderlineOffset:2},children:"Retry"})]}):null]})}var de="bb.theme";function dt(){let n=()=>document.documentElement.classList.contains("dark")?"dark":"light",[o,r]=T(n);return W(()=>{let s=new MutationObserver(()=>r(n()));return s.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>s.disconnect()},[]),[o,s=>{let d=localStorage.getItem(de);localStorage.setItem(de,s),window.dispatchEvent(new StorageEvent("storage",{key:de,oldValue:d,newValue:s,storageArea:localStorage})),document.documentElement.classList.toggle("dark",s==="dark"),r(s)}]}function lt({on:n,onChange:o,children:r}){return t("button",{type:"button",onClick:o,style:{appearance:"none",border:0,cursor:"pointer",fontFamily:C,fontSize:11.5,fontWeight:n?600:500,height:22,padding:"0 8px",borderRadius:6,background:n?e("card"):"transparent",color:e(n?"foreground":"muted-foreground"),boxShadow:n?`inset 0 0 0 1px ${e("border")}, ${e("shadow-xs","none")}`:"none"},children:r})}function ct({subPath:n}){let o=be(),[r,a]=dt(),s=fe(),d=I(null),[l,u]=T({compact:!1,stageHeight:620}),[c,f]=T({activeThemeId:null,themes:[],revision:0}),[g,h]=T(null),[M,w]=T(null),[E,S]=T(null),[J,b]=T(!1),m=I(new V),v=I(!1),k=I(!1),R=I(!1),$=ve(()=>{let p=n.split("/").filter(Boolean)[0]??"";return Se.includes(p)?p:"thread"},[n]),Z=I(()=>{});W(()=>{let p=!1,y=()=>{if(v.current||k.current){R.current=!0;return}R.current=!1,k.current=!0;let P=m.current.begin();Re(o.call("themeCatalog",{}),"Theme catalog").then(A=>{!p&&!R.current&&m.current.isLatest(P)&&(f(A),h(null))}).catch(A=>{!p&&!R.current&&m.current.isLatest(P)&&h(String(A))}).finally(()=>{k.current=!1,!p&&R.current&&y()})};Z.current=y,y();let F=setInterval(y,8e3);return()=>{p=!0,clearInterval(F)}},[o]),he("theme-preview:changed",()=>Z.current()),W(()=>{if(!M){b(!1);return}let p=setTimeout(()=>b(!0),5e3);return()=>clearTimeout(p)},[M]),O(()=>{let p=d.current;if(!p)return;let y=()=>{let P=p.clientWidth<920,A=P?p.clientWidth:p.clientWidth-276,_e=Math.round(Math.max(0,A-32)/K*X+26),ge=Math.min(720,Math.max(P?320:500,_e));u(ee=>ee.compact===P&&ee.stageHeight===ge?ee:{compact:P,stageHeight:ge})};y();let F=new ResizeObserver(y);return F.observe(p),window.addEventListener("resize",y),()=>{F.disconnect(),window.removeEventListener("resize",y)}},[]);let ue=p=>{if(v.current)return;a(p.mode),v.current=!0,w(p),S(null),h(null);let y=m.current.begin();Re(o.call("setTheme",{themeId:p.themeId}),"Theme selection").then(F=>{m.current.isLatest(y)&&(f(F),S(null))}).catch(()=>{m.current.isLatest(y)&&S(p)}).finally(()=>{m.current.isLatest(y)&&(v.current=!1,w(null),R.current&&Z.current())})},Pe=(p,y)=>ue({themeId:p,mode:y}),Fe=()=>{E&&ue(E)},We=`${r}:${c.activeThemeId??""}:${c.revision}`,pe=tt(Ze,We);return i("div",{ref:d,"data-tp-root":!0,style:{height:"100%",overflowY:"auto",overflowX:"hidden",background:e("canvas",e("background")),color:e("foreground"),fontFamily:C},children:[i("div",{style:{position:"sticky",top:0,zIndex:20,display:"flex",alignItems:"center",flexWrap:"wrap",rowGap:6,gap:8,padding:"8px 16px",borderBottom:`1px solid ${e("border-seam",e("border"))}`,background:e("canvas",e("background"))},children:[t("div",{style:{display:"inline-flex",gap:1,padding:2,borderRadius:8,background:e("surface-recessed",e("muted"))},children:Se.map(p=>t(lt,{on:p===$,onChange:()=>s.toPluginPanel("preview",{subPath:p}),children:Ae[p]},p))}),l.compact?null:t("span",{style:{fontSize:11.5,color:e("muted-foreground")},children:Ne[$]}),t("div",{style:{flex:1}}),g?t("span",{style:{fontSize:12,color:e("destructive-text",e("destructive"))},children:g}):null]}),i("div",{"data-tp-layout":l.compact?"stacked":"stage-with-surfaces",style:{minHeight:0,display:"grid",gridTemplateColumns:l.compact?"minmax(0, 1fr)":"minmax(0, 1fr) 276px",gridTemplateRows:l.compact?`${l.stageHeight}px auto`:void 0,height:l.compact?void 0:l.stageHeight,borderBottom:`1px solid ${e("border-seam",e("border"))}`},children:[t("div",{"data-tp-section":"frame",style:{minWidth:0,minHeight:0,display:"flex",flexDirection:"column",padding:"12px 16px 14px"},children:t(Je,{view:$,fitBoth:!0})}),t("div",{"data-tp-section":"surfaces",style:{minWidth:0,padding:"16px 16px 20px",borderLeft:l.compact?void 0:`1px solid ${e("border-seam",e("border"))}`,borderTop:l.compact?`1px solid ${e("border-seam",e("border"))}`:void 0,background:e("surface-recessed-soft-solid",e("card"))},children:t(ot,{computed:pe,catalog:c,mode:r,pendingSelection:M,selectionSlow:J,selectionFailed:E!==null,onPick:Pe,onRetry:Fe})})]}),t("div",{"data-tp-section":"guide",style:{margin:"18px 16px 24px",padding:"18px 18px 22px",borderRadius:14,background:e("card"),boxShadow:`inset 0 0 0 1px ${e("border-seam",e("border"))}, ${e("shadow-xs","none")}`},children:t(rt,{computed:pe})})]})}var Vn=me(n=>{n.slots.navPanel({id:"preview",title:"Theme Preview",icon:"Palette",path:"preview",component:ct})});export{Vn as default};