coder-config 0.40.14 → 0.40.16

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/lib/cli.js CHANGED
@@ -248,9 +248,9 @@ Maintenance:
248
248
  ui stop Stop the UI daemon
249
249
  version Show version info
250
250
 
251
- Plugins (in Claude Code):
252
- /plugin marketplace add regression-io/coder-config-plugins
253
- /plugin install <name>@coder-config-plugins
251
+ Plugins (Claude Code CLI):
252
+ claude plugin marketplace add regression-io/coder-config-plugins
253
+ claude plugin install <name>@coder-config-plugins
254
254
 
255
255
  Examples:
256
256
  coder-config init
package/lib/constants.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * Constants and tool path configurations
3
3
  */
4
4
 
5
- const VERSION = '0.40.14';
5
+ const VERSION = '0.40.16';
6
6
 
7
7
  // Tool-specific path configurations
8
8
  const TOOL_PATHS = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coder-config",
3
- "version": "0.40.14",
3
+ "version": "0.40.16",
4
4
  "description": "Configuration manager for AI coding tools - Claude Code, Gemini CLI, Codex CLI, Antigravity. Manage MCPs, rules, permissions, memory, and workstreams.",
5
5
  "author": "regression.io",
6
6
  "main": "config-loader.js",
@@ -566,7 +566,7 @@ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b)
566
566
  }`,className:"font-mono text-sm min-h-[100px]"})]})]})]})]})]})}const $F=[{id:"Default",name:"Default"},{id:"GitHub",name:"GitHub"},{id:"Monokai",name:"Monokai"},{id:"SolarizedDark",name:"Solarized Dark"},{id:"SolarizedLight",name:"Solarized Light"}],zF=[{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro",description:"Most capable"},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash",description:"Fast and efficient"},{id:"gemini-2.0-pro",name:"Gemini 2.0 Pro",description:"Previous generation"},{id:"gemini-2.0-flash",name:"Gemini 2.0 Flash",description:"Previous generation fast"}];function Rj({settings:e,onSave:t,loading:r,settingsPath:s}){var T,N,R,I;const[o,u]=C.useState(e||{}),[d,l]=C.useState(!1),[c,f]=C.useState("rich"),[m,h]=C.useState(JSON.stringify(e||{},null,2)),[x,w]=C.useState({open:!1,name:"",json:""}),[k,_]=C.useState({}),v=async()=>{l(!0);try{if(c==="json")try{const O=JSON.parse(m);await t(O),u(O)}catch{ee.error("Invalid JSON"),l(!1);return}else await t(o),h(JSON.stringify(o,null,2));ee.success("Settings saved")}finally{l(!1)}},b=(O,$,W)=>{u(Y=>({...Y,[O]:{...Y[O],[$]:W}}))},g=(O,$,W=!1)=>{var Y;return((Y=o==null?void 0:o[O])==null?void 0:Y[$])??W},y=o.mcpServers||{},j=()=>{const{name:O,json:$}=x;if(!O.trim()){ee.error("Please enter a name for the MCP");return}let W;try{W=JSON.parse($)}catch{ee.error("Invalid JSON configuration");return}if(!W.command){ee.error('MCP config must have a "command" field');return}u(Y=>({...Y,mcpServers:{...Y.mcpServers,[O.trim()]:W}})),w({open:!1,name:"",json:""}),ee.success(`Added MCP: ${O}`)},E=O=>{u($=>{const{[O]:W,...Y}=$.mcpServers||{};return{...$,mcpServers:Y}}),ee.success(`Removed MCP: ${O}`)},P=O=>{_($=>({...$,[O]:!$[O]}))};return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-lg bg-blue-500/10 flex items-center justify-center",children:n.jsx(Ft,{className:"w-5 h-5 text-blue-500"})}),n.jsxs("div",{children:[n.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:["Gemini CLI Settings",n.jsxs(Qe,{variant:"outline",className:"text-xs font-normal text-blue-600 border-blue-300 dark:border-blue-700",children:[n.jsx(Ht,{className:"w-3 h-3 mr-1"}),"Google"]})]}),n.jsxs("p",{className:"text-sm text-muted-foreground",children:["Stored in: ",n.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-xs",children:s})]})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("div",{className:"flex bg-muted rounded-lg p-1",children:[n.jsx("button",{className:`px-3 py-1 text-sm rounded-md transition-colors ${c==="rich"?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>f("rich"),children:"Settings"}),n.jsx("button",{className:`px-3 py-1 text-sm rounded-md transition-colors ${c==="json"?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,onClick:()=>{h(JSON.stringify(o,null,2)),f("json")},children:"JSON"})]}),n.jsxs(le,{onClick:v,disabled:d||r,children:[d?n.jsx(ut,{className:"w-4 h-4 mr-2 animate-spin"}):n.jsx(ui,{className:"w-4 h-4 mr-2"}),"Save"]})]})]}),c==="json"?n.jsx("div",{className:"border border-border rounded-lg bg-card overflow-hidden",children:n.jsx(pt,{value:m,onChange:O=>h(O.target.value),className:"font-mono text-sm min-h-[500px] border-0 rounded-none resize-none",placeholder:"{ }"})}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground flex items-center gap-2",children:[n.jsx(Fn,{className:"w-4 h-4 text-blue-500"}),"MCP Servers",n.jsx(Qe,{variant:"secondary",className:"text-xs",children:Object.keys(y).length})]}),n.jsxs(le,{size:"sm",variant:"outline",onClick:()=>w({open:!0,name:"",json:`{
567
567
  "command": "npx",
568
568
  "args": ["-y", "@example/mcp-server"]
569
- }`}),children:[n.jsx(yt,{className:"w-4 h-4 mr-1"}),"Add MCP"]})]}),n.jsx("div",{className:"space-y-2",children:Object.keys(y).length===0?n.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No MCP servers configured"}):Object.entries(y).map(([O,$])=>n.jsxs(Ml,{open:k[O],onOpenChange:()=>P(O),children:[n.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border bg-background group",children:[n.jsxs(Dl,{className:"flex items-center gap-2 flex-1 text-left",children:[k[O]?n.jsx(Sr,{className:"w-4 h-4 text-muted-foreground"}):n.jsx(Kr,{className:"w-4 h-4 text-muted-foreground"}),n.jsx(Fn,{className:"w-4 h-4 text-blue-500"}),n.jsx("span",{className:"font-medium text-sm",children:O}),n.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:$.command})]}),n.jsx(le,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 text-destructive hover:text-destructive",onClick:()=>E(O),children:n.jsx(jn,{className:"w-4 h-4"})})]}),n.jsx(Ll,{children:n.jsx("div",{className:"mt-2 ml-6 p-3 rounded-lg bg-muted/50 border",children:n.jsx("pre",{className:"text-xs font-mono text-muted-foreground overflow-x-auto",children:JSON.stringify($,null,2)})})})]},O))})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(Ht,{className:"w-4 h-4 text-blue-500"}),"Model"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Default Model"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Model used for Gemini CLI sessions"})]}),n.jsxs(fr,{value:g("model","name",""),onValueChange:O=>b("model","name",O),children:[n.jsx(ar,{className:"w-48",children:n.jsx(mr,{placeholder:"Select model"})}),n.jsx(lr,{children:zF.map(O=>n.jsx(xt,{value:O.id,children:n.jsx("div",{className:"flex flex-col",children:n.jsx("span",{children:O.name})})},O.id))})]})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Preview Features"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable access to experimental models and features"})]}),n.jsx(dt,{checked:g("general","previewFeatures",!1),onCheckedChange:O=>b("general","previewFeatures",O)})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(u5,{className:"w-4 h-4 text-blue-500"}),"Appearance"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Theme"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Color theme for the CLI interface"})]}),n.jsxs(fr,{value:g("ui","theme","Default"),onValueChange:O=>b("ui","theme",O),children:[n.jsx(ar,{className:"w-40",children:n.jsx(mr,{})}),n.jsx(lr,{children:$F.map(O=>n.jsx(xt,{value:O.id,children:O.name},O.id))})]})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Output Format"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Format for CLI output"})]}),n.jsxs(fr,{value:g("output","format","text"),onValueChange:O=>b("output","format",O),children:[n.jsx(ar,{className:"w-40",children:n.jsx(mr,{})}),n.jsxs(lr,{children:[n.jsx(xt,{value:"text",children:"Text"}),n.jsx(xt,{value:"json",children:"JSON"})]})]})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(k1,{className:"w-4 h-4 text-blue-500"}),"Display Options"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Dynamic Window Title"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Update title with status icons (Ready, Working, etc.)"})]}),n.jsx(dt,{checked:g("ui","dynamicWindowTitle",!0),onCheckedChange:O=>b("ui","dynamicWindowTitle",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Show Line Numbers"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Display line numbers in chat"})]}),n.jsx(dt,{checked:g("ui","showLineNumbers",!0),onCheckedChange:O=>b("ui","showLineNumbers",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Show Citations"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Display citations for generated text"})]}),n.jsx(dt,{checked:g("ui","showCitations",!1),onCheckedChange:O=>b("ui","showCitations",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Hide Context Summary"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Hide GEMINI.md and MCP servers above input"})]}),n.jsx(dt,{checked:g("ui","hideContextSummary",!1),onCheckedChange:O=>b("ui","hideContextSummary",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Hide Footer"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Remove footer entirely from the UI"})]}),n.jsx(dt,{checked:g("ui","hideFooter",!1),onCheckedChange:O=>b("ui","hideFooter",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Screen Reader Mode"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Render output in plain-text for accessibility"})]}),n.jsx(dt,{checked:((N=(T=o==null?void 0:o.ui)==null?void 0:T.accessibility)==null?void 0:N.screenReader)??!1,onCheckedChange:O=>u($=>{var W;return{...$,ui:{...$.ui,accessibility:{...(W=$.ui)==null?void 0:W.accessibility,screenReader:O}}}})})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(kn,{className:"w-4 h-4 text-blue-500"}),"General"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Vim Mode"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable Vim keybindings in the prompt editor"})]}),n.jsx(dt,{checked:g("general","vimMode",!1),onCheckedChange:O=>b("general","vimMode",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Auto Update"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Allow automatic updates to Gemini CLI"})]}),n.jsx(dt,{checked:g("general","enableAutoUpdate",!0),onCheckedChange:O=>b("general","enableAutoUpdate",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Checkpointing"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable session recovery support"})]}),n.jsx(dt,{checked:((I=(R=o==null?void 0:o.general)==null?void 0:R.checkpointing)==null?void 0:I.enabled)??!1,onCheckedChange:O=>u($=>{var W;return{...$,general:{...$.general,checkpointing:{...(W=$.general)==null?void 0:W.checkpointing,enabled:O}}}})})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Respect .gitignore"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Exclude files matching .gitignore patterns"})]}),n.jsx(dt,{checked:g("general","respectGitignore",!0),onCheckedChange:O=>b("general","respectGitignore",O)})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(as,{className:"w-4 h-4 text-blue-500"}),"Privacy"]}),n.jsx("div",{className:"space-y-4",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Usage Statistics"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Allow collection of anonymous usage data"})]}),n.jsx(dt,{checked:g("privacy","usageStatisticsEnabled",!0),onCheckedChange:O=>b("privacy","usageStatisticsEnabled",O)})]})})]})]}),n.jsx(Tt,{open:x.open,onOpenChange:O=>w({...x,open:O}),children:n.jsxs(St,{className:"bg-card",children:[n.jsxs(Ct,{children:[n.jsx(kt,{children:"Add MCP Server"}),n.jsx(tr,{children:"Add a new MCP server to Gemini CLI"})]}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Name"}),n.jsx(ct,{value:x.name,onChange:O=>w({...x,name:O.target.value}),placeholder:"my-mcp-server",className:"mt-1"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Configuration (JSON)"}),n.jsx(pt,{value:x.json,onChange:O=>w({...x,json:O.target.value}),className:"mt-1 font-mono text-sm",rows:6})]})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"ghost",onClick:()=>w({open:!1,name:"",json:""}),children:"Cancel"}),n.jsxs(le,{onClick:j,children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add MCP"]})]})]})})]})}function HF({content:e,parsed:t,onSave:r,filePath:s}){const o=async l=>{const c=JSON.stringify(l,null,2);r(c)},u=(s==null?void 0:s.includes(".gemini"))||(s==null?void 0:s.includes("/.gemini/")),d=(s==null?void 0:s.includes(".agent"))||(s==null?void 0:s.includes("/antigravity/"));return u&&!d?n.jsx("div",{className:"h-full overflow-auto p-4",children:n.jsx(Rj,{settings:t||{},onSave:o,loading:!1,settingsPath:s||"~/.gemini/settings.json"})}):n.jsx("div",{className:"h-full overflow-auto p-4",children:n.jsx(Tj,{settings:t||{},onSave:o,loading:!1,settingsPath:s||"~/.claude/settings.json"})})}function WF({open:e,onClose:t,item:r,intermediatePaths:s,onMove:o}){const[u,d]=C.useState("copy"),[l,c]=C.useState(null),[f,m]=C.useState(""),[h,x]=C.useState(!1),w=()=>{const k=f.trim()||l;if(!k){ee.error("Please select or enter a target path");return}o(r.path,k,u,h)};return n.jsx(Tt,{open:e,onOpenChange:t,children:n.jsxs(St,{className:"max-w-md",children:[n.jsxs(Ct,{children:[n.jsxs(kt,{children:[u==="copy"?"Copy":"Move"," ",r==null?void 0:r.name]}),n.jsx(tr,{children:"Select a destination for this file"})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex gap-2",children:[n.jsxs(le,{variant:u==="copy"?"default":"outline",size:"sm",onClick:()=>d("copy"),children:[n.jsx(Cu,{className:"w-4 h-4 mr-1"})," Copy"]}),n.jsxs(le,{variant:u==="move"?"default":"outline",size:"sm",onClick:()=>d("move"),children:[n.jsx(j1,{className:"w-4 h-4 mr-1"})," Move"]})]}),n.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:s==null?void 0:s.map(k=>n.jsxs("div",{className:je("flex items-center justify-between p-2 rounded border cursor-pointer",l===k.dir?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"hover:bg-gray-50 dark:hover:bg-slate-800"),onClick:()=>{c(k.dir),m("")},children:[n.jsxs("div",{className:"flex items-center gap-2",children:[k.isHome?n.jsx(Vp,{className:"w-4 h-4"}):n.jsx(wr,{className:"w-4 h-4"}),n.jsx("span",{className:"text-sm",children:k.label})]}),k.hasClaudeFolder?n.jsx(Qe,{variant:"secondary",className:"text-xs",children:"exists"}):n.jsx(Qe,{variant:"outline",className:"text-xs",children:"create"})]},k.dir))}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Or enter custom path:"}),n.jsx(ct,{className:"mt-1 font-mono text-sm",placeholder:"/path/to/directory",value:f,onChange:k=>{m(k.target.value),c(null)}})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(dt,{checked:h,onCheckedChange:x}),n.jsx("span",{className:"text-sm",children:"Merge if target exists"})]})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"ghost",onClick:t,children:"Cancel"}),n.jsx(le,{onClick:w,children:u==="copy"?"Copy":"Move"})]})]})})}function VF({open:e,onClose:t,item:r,onRename:s}){const[o,u]=C.useState("");C.useEffect(()=>{r!=null&&r.name&&u(r.name.replace(/\.md$/,""))},[r,e]);const d=()=>{if(!o.trim()){ee.error("Please enter a name");return}s(r,o.trim())};return n.jsx(Tt,{open:e,onOpenChange:t,children:n.jsxs(St,{className:"sm:max-w-md",children:[n.jsx(Ct,{children:n.jsxs(kt,{children:["Rename ",r==null?void 0:r.type]})}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"New name"}),n.jsx(ct,{className:"mt-1",placeholder:"new-name",value:o,onChange:l=>u(l.target.value),onKeyDown:l=>l.key==="Enter"&&d()}),n.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:".md extension will be added automatically"})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"ghost",onClick:t,children:"Cancel"}),n.jsx(le,{onClick:d,children:"Rename"})]})]})})}function UF({open:e,onClose:t,dir:r,type:s,onCreate:o}){const[u,d]=C.useState("");C.useEffect(()=>{d("")},[e]);const l=()=>{if((s==="command"||s==="rule"||s==="workflow"||s==="memory")&&!u.trim()){ee.error("Please enter a name");return}const m=s==="command"||s==="rule"||s==="workflow"||s==="memory"?u.endsWith(".md")?u:`${u}.md`:u;o(r,m,s)},c=dl[s]||{},f=s==="command"||s==="rule"||s==="workflow"||s==="memory";return n.jsx(Tt,{open:e,onOpenChange:t,children:n.jsxs(St,{className:"max-w-sm",children:[n.jsx(Ct,{children:n.jsxs(kt,{children:["Create ",c.label||s]})}),f&&n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Name"}),n.jsx(ct,{className:"mt-1",placeholder:s==="command"?"my-command.md":s==="workflow"?"my-workflow.md":s==="memory"?"context.md":"my-rule.md",value:u,onChange:m=>d(m.target.value),onKeyDown:m=>m.key==="Enter"&&l()})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"ghost",onClick:t,children:"Cancel"}),n.jsx(le,{onClick:l,children:"Create"})]})]})})}function GF({project:e,onRefresh:t}){var De,Re,Ze;const[r,s]=C.useState([]),[o,u]=C.useState([]),[d,l]=C.useState(null),[c,f]=C.useState(null),[m,h]=C.useState(null),[x,w]=C.useState(()=>{try{return localStorage.getItem("claude-config-expanded-folder")||null}catch{return null}}),[k,_]=C.useState({}),[v,b]=C.useState(!0),[g,y]=C.useState({open:!1,item:null}),[j,E]=C.useState({open:!1,dir:null,type:null}),[P,T]=C.useState({open:!1,item:null}),[N,R]=C.useState(!1),[I,O]=C.useState({open:!1,projectDir:null}),[$,W]=C.useState({open:!1,dir:null,name:null}),[Y,z]=C.useState({open:!1,dir:null}),[K,G]=C.useState({x:0,y:0,item:null}),[U,L]=C.useState(["claude"]),M=C.useCallback(async()=>{var Se;try{b(!0);const[ge,Me,ht,Rt]=await Promise.all([ke.getClaudeFolders(),ke.getIntermediatePaths(),ke.getRegistry(),ke.getConfig()]);if(s(ge),u(Me),l(ht),L(((Se=Rt.config)==null?void 0:Se.enabledTools)||["claude"]),ge.length>0){const pe=localStorage.getItem("claude-config-expanded-folder");if(!pe||!ge.find(be=>be.dir===pe)){const be=ge.filter(Ke=>!Ke.isSubproject),Be=be.length>1?be[be.length-1]:be[0],Ge=(Be==null?void 0:Be.dir)||ge[0].dir;w(Ge);try{localStorage.setItem("claude-config-expanded-folder",Ge)}catch{}}}}catch(ge){ee.error("Failed to load data: "+ge.message)}finally{b(!1)}},[]);C.useEffect(()=>{M(),f(null),h(null)},[M,e==null?void 0:e.dir]);const B=Se=>{const ge=x===Se?null:Se;w(ge);try{ge?localStorage.setItem("claude-config-expanded-folder",ge):localStorage.removeItem("claude-config-expanded-folder")}catch{}},q=async Se=>{f(Se);try{const ge=await ke.getClaudeFile(Se.path);h(ge)}catch(ge){ee.error("Failed to load file: "+ge.message)}},F=async Se=>{if(c)try{await ke.saveClaudeFile(c.path,Se),ee.success("Saved");const ge=await ke.getClaudeFile(c.path);h(ge),M()}catch(ge){ee.error("Failed to save: "+ge.message)}},oe=Se=>{_(ge=>({...ge,[Se]:!ge[Se]}))},fe=(Se,ge)=>{Se.preventDefault(),G({x:Se.clientX,y:Se.clientY,item:ge})},me=async(Se,ge)=>{ge==="command"||ge==="rule"||ge==="workflow"||ge==="memory"?E({open:!0,dir:Se,type:ge}):ge==="claudemd"?z({open:!0,dir:Se}):X(Se,ge==="mcps"?"mcps.json":ge==="settings"?"settings.json":ge==="env"?".env":"CLAUDE.md",ge)},X=async(Se,ge,Me)=>{try{const ht=await ke.createClaudeFile(Se,ge,Me);if(ee.success("Created"),E({open:!1,dir:null,type:null}),await M(),ht.path){const Rt={path:ht.path,name:ge,type:Me==="command"?"command":Me==="rule"?"rule":Me==="workflow"?"workflow":"file"};f(Rt),h(ht.content||"")}}catch(ht){ee.error("Failed to create: "+ht.message)}},H=async(Se,ge)=>{try{const Me=await ke.renameClaudeFile(Se.path,ge);Me.success?(ee.success("Renamed"),T({open:!1,item:null}),await M(),f({...Se,path:Me.newPath,name:ge.endsWith(".md")?ge:`${ge}.md`})):ee.error(Me.error||"Failed to rename")}catch(Me){ee.error("Failed to rename: "+Me.message)}},ae=async Se=>{if(confirm(`Delete ${Se.name}?`))try{await ke.deleteClaudeFile(Se.path),ee.success("Deleted"),(c==null?void 0:c.path)===Se.path&&(f(null),h(null)),M()}catch(ge){ee.error("Failed to delete: "+ge.message)}},ne=async(Se,ge,Me,ht)=>{try{await ke.moveClaudeItem(Se,ge,Me,ht),ee.success(Me==="copy"?"Copied":"Moved"),y({open:!1,item:null}),M()}catch(Rt){ee.error("Failed: "+Rt.message)}},J=async Se=>{if(Se)try{const ge=await ke.addManualSubproject(I.projectDir,Se);ge.success?(ee.success(`Added sub-project: ${Se.split("/").pop()}`),O({open:!1,projectDir:null}),M()):ee.error(ge.error||"Failed to add sub-project")}catch(ge){ee.error("Failed to add sub-project: "+ge.message)}},ie=async Se=>{const ge=r.find(Me=>!Me.isSubproject&&!Me.isHome);if(ge)try{const Me=await ke.removeManualSubproject(ge.dir,Se);Me.success?(ee.success("Removed sub-project"),M()):ee.error(Me.error||"Failed to remove sub-project")}catch(Me){ee.error("Failed to remove sub-project: "+Me.message)}},ye=async Se=>{const ge=r.find(Me=>!Me.isSubproject&&!Me.isHome);if(ge)try{const Me=await ke.hideSubproject(ge.dir,Se);Me.success?(ee.success("Sub-project hidden"),M()):ee.error(Me.error||"Failed to hide sub-project")}catch(Me){ee.error("Failed to hide sub-project: "+Me.message)}},Oe=()=>{if(!c||!m)return n.jsx("div",{className:"h-full flex items-center justify-center text-gray-500 dark:text-slate-400",children:n.jsxs("div",{className:"text-center",children:[n.jsx(Pm,{className:"w-12 h-12 mx-auto mb-2 opacity-50"}),n.jsx("p",{children:"Select a file to edit"})]})});switch(c.type){case"mcps":return n.jsx(HB,{content:m.content,parsed:m.parsed,onSave:F,registry:d});case"settings":return n.jsx(HF,{content:m.content,parsed:m.parsed,onSave:F,filePath:c==null?void 0:c.path});case"command":case"rule":case"workflow":case"claudemd":case"env":return n.jsx(Vb,{content:m.content,onSave:F,fileType:c.type});default:return n.jsx(Vb,{content:m.content,onSave:F,fileType:"claudemd"})}};if(v)return n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx(pr,{className:"w-6 h-6 animate-spin text-gray-400"})});const Ve=r.some(Se=>Se.isSubproject),te=(Se,ge)=>ge===0,de=(Se,ge)=>{const Me=r.findIndex(ht=>ht.isSubproject);return!Se.isSubproject&&(Me>=0?ge===Me-1:ge===r.length-1)};return n.jsxs("div",{className:"h-full flex",children:[n.jsxs("div",{className:"w-76 border-r flex flex-col bg-white dark:bg-slate-950",children:[n.jsxs("div",{className:"flex items-center justify-between p-3 border-b",children:[n.jsx("h2",{className:"font-semibold text-sm",children:"Project Config"}),n.jsxs("div",{className:"flex gap-1",children:[U.includes("claude")&&U.includes("antigravity")&&n.jsxs(le,{variant:"ghost",size:"sm",className:"h-7 px-2",onClick:()=>R(!0),title:"Sync rules between tools",children:[n.jsx(Q4,{className:"w-4 h-4 mr-1"}),"Sync"]}),n.jsx(le,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:M,children:n.jsx(pr,{className:"w-4 h-4"})})]})]}),n.jsx(Nn,{className:"flex-1",children:r.map((Se,ge)=>n.jsx(BB,{folder:Se,isExpanded:x===Se.dir,isHome:te(Se,ge),isProject:de(Se,ge),isSubproject:Se.isSubproject,depth:Se.depth||0,onToggle:()=>B(Se.dir),onCreateFile:me,onInstallPlugin:(Me,ht)=>W({open:!0,dir:Me,name:ht}),onSelectItem:q,selectedPath:c==null?void 0:c.path,onContextMenu:fe,expandedFolders:k,onToggleFolder:oe,hasSubprojects:Ve,onAddSubproject:Me=>O({open:!0,projectDir:Me}),onRemoveSubproject:ie,onHideSubproject:ye},Se.dir))})]}),n.jsxs("div",{className:"flex-1 flex flex-col bg-gray-50 dark:bg-slate-900",children:[c&&n.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b bg-white dark:bg-slate-950",children:[n.jsx("div",{className:"flex items-center gap-2 text-sm",children:n.jsx("span",{className:"text-gray-500 dark:text-slate-400 font-mono truncate max-w-md",children:c.path})}),n.jsxs("div",{className:"flex gap-1",children:[n.jsx(le,{variant:"ghost",size:"sm",onClick:()=>y({open:!0,item:c}),children:n.jsx(Cu,{className:"w-4 h-4"})}),n.jsx(le,{variant:"ghost",size:"sm",onClick:()=>ae(c),children:n.jsx(jn,{className:"w-4 h-4"})})]})]}),n.jsx("div",{className:"flex-1",children:Oe()})]}),K.item&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>G({x:0,y:0,item:null})}),n.jsxs("div",{className:"fixed z-50 bg-white dark:bg-slate-950 rounded-md shadow-lg border py-1 min-w-[160px]",style:{left:K.x,top:K.y},children:[(((De=K.item)==null?void 0:De.type)==="rule"||((Re=K.item)==null?void 0:Re.type)==="command"||((Ze=K.item)==null?void 0:Ze.type)==="workflow")&&n.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center",onClick:()=>{T({open:!0,item:K.item}),G({x:0,y:0,item:null})},children:[n.jsx(N1,{className:"w-4 h-4 mr-2"})," Rename"]}),n.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center",onClick:()=>{y({open:!0,item:K.item}),G({x:0,y:0,item:null})},children:[n.jsx(Cu,{className:"w-4 h-4 mr-2"})," Copy to..."]}),n.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center",onClick:()=>{y({open:!0,item:K.item}),G({x:0,y:0,item:null})},children:[n.jsx(j1,{className:"w-4 h-4 mr-2"})," Move to..."]}),n.jsx("div",{className:"border-t my-1"}),n.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center text-red-600",onClick:()=>{ae(K.item),G({x:0,y:0,item:null})},children:[n.jsx(jn,{className:"w-4 h-4 mr-2"})," Delete"]})]})]}),n.jsx(WF,{open:g.open,onClose:()=>y({open:!1,item:null}),item:g.item,intermediatePaths:o,onMove:ne}),n.jsx(UF,{open:j.open,onClose:()=>E({open:!1,dir:null,type:null}),dir:j.dir,type:j.type,onCreate:X}),n.jsx(VF,{open:P.open,onClose:()=>T({open:!1,item:null}),item:P.item,onRename:H}),n.jsx(YO,{open:N,onOpenChange:R,projectDir:e==null?void 0:e.dir,onSynced:M}),n.jsx(AB,{open:$.open,onOpenChange:Se=>W({...$,open:Se}),projectDir:$.dir,projectName:$.name}),n.jsx(_g,{open:I.open,onOpenChange:Se=>O({...I,open:Se}),onSelect:J,type:"directory",title:"Add Sub-project",initialPath:I.projectDir||"~"}),n.jsx(OB,{open:Y.open,onOpenChange:Se=>{z({...Y,open:Se}),Se||M()},title:"Initialize CLAUDE.md",description:"Running claude /init to generate project-aware CLAUDE.md",cwd:Y.dir,initialCommand:"claude /init; exit",autoCloseOnExit:!0,autoCloseDelay:2e3})]})}function KF({projects:e=[],activeProject:t=null,onSwitch:r,onAddClick:s,onManageClick:o,disabled:u=!1}){const d=(t==null?void 0:t.name)||"No Project";return n.jsxs(ai,{children:[n.jsx(li,{asChild:!0,children:n.jsxs(le,{variant:"outline",className:"gap-2 max-w-[220px] h-9",disabled:u,children:[n.jsx(si,{className:"w-4 h-4 text-indigo-500 flex-shrink-0"}),n.jsx("span",{className:"truncate font-medium",children:d}),n.jsx(Sr,{className:"w-4 h-4 opacity-50 flex-shrink-0"})]})}),n.jsxs(ks,{align:"start",className:"w-72",children:[n.jsx(ul,{className:"text-xs text-gray-500 font-normal",children:"Projects"}),n.jsx(Or,{}),e.length===0?n.jsxs("div",{className:"px-3 py-6 text-sm text-gray-500 text-center",children:[n.jsx(wr,{className:"w-8 h-8 mx-auto mb-2 text-gray-300"}),n.jsx("p",{children:"No projects registered"}),n.jsx("p",{className:"text-xs mt-1",children:"Add a project to get started"})]}):n.jsx("div",{className:"max-h-64 overflow-y-auto",children:e.map(l=>n.jsxs(Pt,{onClick:()=>!l.isActive&&r(l.id),className:`flex items-start gap-2 py-2 cursor-pointer ${l.isActive?"bg-indigo-50":""}`,disabled:l.isActive,children:[n.jsx("div",{className:"mt-0.5 flex-shrink-0",children:l.isActive?n.jsx(Kt,{className:"w-4 h-4 text-indigo-600"}):l.exists?n.jsx(wr,{className:"w-4 h-4 text-gray-400"}):n.jsx(Xu,{className:"w-4 h-4 text-amber-500"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:`truncate font-medium ${l.isActive?"text-indigo-700":""}`,children:l.name}),n.jsx("div",{className:"truncate text-xs text-gray-400 font-mono",children:l.path.replace(/^\/Users\/[^/]+/,"~")}),!l.exists&&n.jsx("div",{className:"text-xs text-amber-600 mt-0.5",children:"Path not found"})]}),l.hasClaudeConfig&&n.jsx("div",{className:"flex-shrink-0",children:n.jsx("div",{className:"w-2 h-2 rounded-full bg-green-400",title:"Has .claude config"})})]},l.id))}),n.jsx(Or,{}),n.jsxs(Pt,{onClick:s,className:"gap-2 cursor-pointer",children:[n.jsx(yt,{className:"w-4 h-4"}),"Add Project"]}),e.length>0&&n.jsxs(Pt,{onClick:o,className:"gap-2 cursor-pointer",children:[n.jsx(Tm,{className:"w-4 h-4"}),"Manage Projects"]})]})]})}const Xf="claude-config-welcome-seen";function qF({onStartTutorial:e}){const[t,r]=C.useState(!1),[s,o]=C.useState(!0);C.useEffect(()=>{if(!localStorage.getItem(Xf)){const c=setTimeout(()=>r(!0),500);return()=>clearTimeout(c)}},[]);const u=()=>{s&&localStorage.setItem(Xf,"true"),r(!1)},d=()=>{s&&localStorage.setItem(Xf,"true"),r(!1),e==null||e()};return n.jsx(Tt,{open:t,onOpenChange:r,children:n.jsxs(St,{className:"sm:max-w-lg",children:[n.jsxs(Ct,{children:[n.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg",children:n.jsx(kn,{className:"w-6 h-6 text-white"})}),n.jsx(kt,{className:"text-2xl",children:"Welcome to Coder Config"})]}),n.jsx(tr,{className:"text-base pt-2",children:"Your control center for Claude Code and AI coding tools."})]}),n.jsxs("div",{className:"py-4 space-y-4",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"We built Coder Config because managing AI coding assistants shouldn't require editing JSON files or memorizing command-line flags. You deserve a visual interface that makes configuration easy."}),n.jsxs("div",{className:"grid grid-cols-3 gap-3 py-2",children:[n.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[n.jsx(ns,{className:"w-5 h-5 mx-auto mb-2 text-indigo-500"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:"MCP Servers"})]}),n.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[n.jsx(as,{className:"w-5 h-5 mx-auto mb-2 text-green-500"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:"Permissions"})]}),n.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[n.jsx(Ht,{className:"w-5 h-5 mx-auto mb-2 text-amber-500"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:"Rules & Memory"})]})]}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Take our guided tutorial to learn the basics, or dive in and explore on your own."}),n.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[n.jsx(jl,{id:"dont-ask",checked:s,onCheckedChange:o}),n.jsx(Bt,{htmlFor:"dont-ask",className:"text-sm text-muted-foreground cursor-pointer",children:"Don't show this again"})]})]}),n.jsxs(It,{className:"flex gap-2 sm:gap-2",children:[n.jsx(le,{variant:"ghost",onClick:u,children:"Skip for now"}),n.jsxs(le,{onClick:d,className:"gap-2",children:[n.jsx(ku,{className:"w-4 h-4"}),"Start Tutorial",n.jsx(Hp,{className:"w-4 h-4"})]})]})]})})}const Jf="claude-config:claude-init-preference";function Mj({open:e,onOpenChange:t,onAdded:r}){const[s,o]=C.useState(""),[u,d]=C.useState(""),[l,c]=C.useState(!1),[f,m]=C.useState(!1),[h,x]=C.useState(!0);C.useEffect(()=>{const v=localStorage.getItem(Jf);v==="never"?x(!1):v==="always"&&x(!0)},[]),C.useEffect(()=>{if(e){o(""),d("");const v=localStorage.getItem(Jf);x(v!=="never")}},[e]),C.useEffect(()=>{if(s&&!u){const v=s.split("/").pop();d(v||"")}},[s]);const w=v=>{o(v),c(!1)},k=async()=>{if(!s){ee.error("Please select a project path");return}m(!0);try{const v=await ke.addProject(s,u||void 0,h);v.error?ee.error(v.error):(v.claudeInitRan?ee.success(`Added project: ${v.project.name} (initialized with Claude Code)`):v.claudeInitError?(ee.success(`Added project: ${v.project.name}`),ee.warning("Could not run claude /init - is Claude Code installed?")):ee.success(`Added project: ${v.project.name}`),r==null||r(v.project),t(!1))}catch(v){ee.error("Failed to add project: "+v.message)}finally{m(!1)}},_=v=>{localStorage.setItem(Jf,v),v==="never"?x(!1):v==="always"&&x(!0),ee.success(`Preference saved: ${v==="always"?"Always":v==="never"?"Never":"Ask each time"} run claude /init`)};return n.jsxs(n.Fragment,{children:[n.jsx(Tt,{open:e,onOpenChange:t,children:n.jsxs(St,{className:"sm:max-w-md",children:[n.jsxs(Ct,{children:[n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(si,{className:"w-5 h-5 text-indigo-500"}),"Add Project"]}),n.jsx(tr,{children:"Register a project folder to quickly switch between projects in the UI."})]}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(Bt,{htmlFor:"path",children:"Project Path"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ct,{id:"path",value:s,onChange:v=>o(v.target.value),placeholder:"/path/to/project",className:"font-mono text-sm flex-1"}),n.jsx(le,{variant:"outline",size:"icon",onClick:()=>c(!0),title:"Browse",children:n.jsx(si,{className:"w-4 h-4"})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(Bt,{htmlFor:"name",children:"Display Name"}),n.jsx(ct,{id:"name",value:u,onChange:v=>d(v.target.value),placeholder:"Auto-filled from folder name"}),n.jsx("p",{className:"text-xs text-gray-500",children:"Optional. Leave empty to use folder name."})]}),n.jsxs("div",{className:"border-t pt-4",children:[n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx(jl,{id:"claudeInit",checked:h,onCheckedChange:x,className:"mt-0.5"}),n.jsxs("div",{className:"flex-1",children:[n.jsxs(Bt,{htmlFor:"claudeInit",className:"flex items-center gap-2 cursor-pointer",children:[n.jsx(Ht,{className:"w-4 h-4 text-orange-500"}),"Initialize with Claude Code"]}),n.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Run ",n.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1 rounded",children:"claude /init"})," to create CLAUDE.md"]})]})]}),n.jsxs("div",{className:"flex gap-2 mt-3",children:[n.jsx(le,{variant:"ghost",size:"sm",className:"text-xs h-7",onClick:()=>_("always"),children:"Always"}),n.jsx(le,{variant:"ghost",size:"sm",className:"text-xs h-7",onClick:()=>_("never"),children:"Never"}),n.jsx(le,{variant:"ghost",size:"sm",className:"text-xs h-7",onClick:()=>_("ask"),children:"Ask each time"})]})]})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),n.jsx(le,{onClick:k,disabled:f||!s,children:f?n.jsxs(n.Fragment,{children:[n.jsx(ut,{className:"w-4 h-4 mr-2 animate-spin"}),"Adding..."]}):"Add Project"})]})]})}),n.jsx(_g,{open:l,onOpenChange:c,onSelect:w,type:"directory",initialPath:"~",title:"Select Project Folder"})]})}const Dj=C.createContext({theme:"auto",setTheme:()=>{},resolvedTheme:"light"});function YF({children:e}){const[t,r]=C.useState(()=>{try{return localStorage.getItem("claude-config-theme")||"auto"}catch{return"auto"}}),[s,o]=C.useState("light");C.useEffect(()=>{const d=window.document.documentElement,l=m=>{let h;m==="auto"?h=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":h=m,o(h),h==="dark"?d.classList.add("dark"):d.classList.remove("dark")};l(t);const c=window.matchMedia("(prefers-color-scheme: dark)"),f=()=>{t==="auto"&&l("auto")};return c.addEventListener("change",f),()=>c.removeEventListener("change",f)},[t]);const u=d=>{r(d);try{localStorage.setItem("claude-config-theme",d)}catch{}};return n.jsx(Dj.Provider,{value:{theme:t,setTheme:u,resolvedTheme:s},children:e})}function XF(){return C.useContext(Dj)}function JF(){const{theme:e,setTheme:t,resolvedTheme:r}=XF(),s=r==="dark"?rb:ib;return n.jsxs(ai,{children:[n.jsx(li,{asChild:!0,children:n.jsxs(le,{variant:"ghost",size:"sm",className:"w-9 px-0",children:[n.jsx(s,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),n.jsxs(ks,{align:"end",children:[n.jsxs(Pt,{onClick:()=>t("light"),className:e==="light"?"bg-accent":"",children:[n.jsx(ib,{className:"mr-2 h-4 w-4"}),"Light"]}),n.jsxs(Pt,{onClick:()=>t("dark"),className:e==="dark"?"bg-accent":"",children:[n.jsx(rb,{className:"mr-2 h-4 w-4"}),"Dark"]}),n.jsxs(Pt,{onClick:()=>t("auto"),className:e==="auto"?"bg-accent":"",children:[n.jsx(k1,{className:"mr-2 h-4 w-4"}),"System"]})]})]})}var QF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ZF=QF.reduce((e,t)=>{const r=Qu(`Primitive.${t}`),s=C.forwardRef((o,u)=>{const{asChild:d,...l}=o,c=d?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(c,{...l,ref:u})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{}),e8="Separator",qb="horizontal",t8=["horizontal","vertical"],Lj=C.forwardRef((e,t)=>{const{decorative:r,orientation:s=qb,...o}=e,u=r8(s)?s:qb,l=r?{role:"none"}:{"aria-orientation":u==="vertical"?u:void 0,role:"separator"};return n.jsx(ZF.div,{"data-orientation":u,...l,...o,ref:t})});Lj.displayName=e8;function r8(e){return t8.includes(e)}var Ij=Lj;const Oj=C.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...s},o)=>n.jsx(Ij,{ref:o,decorative:r,orientation:t,className:je("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...s}));Oj.displayName=Ij.displayName;function n8(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const s8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,i8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,o8={};function Yb(e,t){return(o8.jsx?i8:s8).test(e)}const a8=/[ \t\n\f\r]/g;function l8(e){return typeof e=="object"?e.type==="text"?Xb(e.value):!1:Xb(e)}function Xb(e){return e.replace(a8,"")===""}class Il{constructor(t,r,s){this.normal=r,this.property=t,s&&(this.space=s)}}Il.prototype.normal={};Il.prototype.property={};Il.prototype.space=void 0;function Bj(e,t){const r={},s={};for(const o of e)Object.assign(r,o.property),Object.assign(s,o.normal);return new Il(r,s,t)}function Xm(e){return e.toLowerCase()}class Jr{constructor(t,r){this.attribute=r,this.property=t}}Jr.prototype.attribute="";Jr.prototype.booleanish=!1;Jr.prototype.boolean=!1;Jr.prototype.commaOrSpaceSeparated=!1;Jr.prototype.commaSeparated=!1;Jr.prototype.defined=!1;Jr.prototype.mustUseProperty=!1;Jr.prototype.number=!1;Jr.prototype.overloadedBoolean=!1;Jr.prototype.property="";Jr.prototype.spaceSeparated=!1;Jr.prototype.space=void 0;let c8=0;const ot=Ki(),er=Ki(),Jm=Ki(),Ce=Ki(),Et=Ki(),To=Ki(),nn=Ki();function Ki(){return 2**++c8}const Qm=Object.freeze(Object.defineProperty({__proto__:null,boolean:ot,booleanish:er,commaOrSpaceSeparated:nn,commaSeparated:To,number:Ce,overloadedBoolean:Jm,spaceSeparated:Et},Symbol.toStringTag,{value:"Module"})),Qf=Object.keys(Qm);class Ig extends Jr{constructor(t,r,s,o){let u=-1;if(super(t,r),Jb(this,"space",o),typeof s=="number")for(;++u<Qf.length;){const d=Qf[u];Jb(this,Qf[u],(s&Qm[d])===Qm[d])}}}Ig.prototype.defined=!0;function Jb(e,t,r){r&&(e[t]=r)}function Qo(e){const t={},r={};for(const[s,o]of Object.entries(e.properties)){const u=new Ig(s,e.transform(e.attributes||{},s),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(u.mustUseProperty=!0),t[s]=u,r[Xm(s)]=s,r[Xm(u.attribute)]=s}return new Il(t,r,e.space)}const Fj=Qo({properties:{ariaActiveDescendant:null,ariaAtomic:er,ariaAutoComplete:null,ariaBusy:er,ariaChecked:er,ariaColCount:Ce,ariaColIndex:Ce,ariaColSpan:Ce,ariaControls:Et,ariaCurrent:null,ariaDescribedBy:Et,ariaDetails:null,ariaDisabled:er,ariaDropEffect:Et,ariaErrorMessage:null,ariaExpanded:er,ariaFlowTo:Et,ariaGrabbed:er,ariaHasPopup:null,ariaHidden:er,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Et,ariaLevel:Ce,ariaLive:null,ariaModal:er,ariaMultiLine:er,ariaMultiSelectable:er,ariaOrientation:null,ariaOwns:Et,ariaPlaceholder:null,ariaPosInSet:Ce,ariaPressed:er,ariaReadOnly:er,ariaRelevant:null,ariaRequired:er,ariaRoleDescription:Et,ariaRowCount:Ce,ariaRowIndex:Ce,ariaRowSpan:Ce,ariaSelected:er,ariaSetSize:Ce,ariaSort:null,ariaValueMax:Ce,ariaValueMin:Ce,ariaValueNow:Ce,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function $j(e,t){return t in e?e[t]:t}function zj(e,t){return $j(e,t.toLowerCase())}const u8=Qo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:To,acceptCharset:Et,accessKey:Et,action:null,allow:null,allowFullScreen:ot,allowPaymentRequest:ot,allowUserMedia:ot,alt:null,as:null,async:ot,autoCapitalize:null,autoComplete:Et,autoFocus:ot,autoPlay:ot,blocking:Et,capture:null,charSet:null,checked:ot,cite:null,className:Et,cols:Ce,colSpan:null,content:null,contentEditable:er,controls:ot,controlsList:Et,coords:Ce|To,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ot,defer:ot,dir:null,dirName:null,disabled:ot,download:Jm,draggable:er,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ot,formTarget:null,headers:Et,height:Ce,hidden:Jm,high:Ce,href:null,hrefLang:null,htmlFor:Et,httpEquiv:Et,id:null,imageSizes:null,imageSrcSet:null,inert:ot,inputMode:null,integrity:null,is:null,isMap:ot,itemId:null,itemProp:Et,itemRef:Et,itemScope:ot,itemType:Et,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ot,low:Ce,manifest:null,max:null,maxLength:Ce,media:null,method:null,min:null,minLength:Ce,multiple:ot,muted:ot,name:null,nonce:null,noModule:ot,noValidate:ot,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ot,optimum:Ce,pattern:null,ping:Et,placeholder:null,playsInline:ot,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ot,referrerPolicy:null,rel:Et,required:ot,reversed:ot,rows:Ce,rowSpan:Ce,sandbox:Et,scope:null,scoped:ot,seamless:ot,selected:ot,shadowRootClonable:ot,shadowRootDelegatesFocus:ot,shadowRootMode:null,shape:null,size:Ce,sizes:null,slot:null,span:Ce,spellCheck:er,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ce,step:null,style:null,tabIndex:Ce,target:null,title:null,translate:null,type:null,typeMustMatch:ot,useMap:null,value:er,width:Ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Et,axis:null,background:null,bgColor:null,border:Ce,borderColor:null,bottomMargin:Ce,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ot,declare:ot,event:null,face:null,frame:null,frameBorder:null,hSpace:Ce,leftMargin:Ce,link:null,longDesc:null,lowSrc:null,marginHeight:Ce,marginWidth:Ce,noResize:ot,noHref:ot,noShade:ot,noWrap:ot,object:null,profile:null,prompt:null,rev:null,rightMargin:Ce,rules:null,scheme:null,scrolling:er,standby:null,summary:null,text:null,topMargin:Ce,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ce,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ot,disableRemotePlayback:ot,prefix:null,property:null,results:Ce,security:null,unselectable:null},space:"html",transform:zj}),d8=Qo({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:nn,accentHeight:Ce,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ce,amplitude:Ce,arabicForm:null,ascent:Ce,attributeName:null,attributeType:null,azimuth:Ce,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ce,by:null,calcMode:null,capHeight:Ce,className:Et,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ce,diffuseConstant:Ce,direction:null,display:null,dur:null,divisor:Ce,dominantBaseline:null,download:ot,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ce,enableBackground:null,end:null,event:null,exponent:Ce,externalResourcesRequired:null,fill:null,fillOpacity:Ce,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:To,g2:To,glyphName:To,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ce,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ce,horizOriginX:Ce,horizOriginY:Ce,id:null,ideographic:Ce,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ce,k:Ce,k1:Ce,k2:Ce,k3:Ce,k4:Ce,kernelMatrix:nn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ce,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ce,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ce,overlineThickness:Ce,paintOrder:null,panose1:null,path:null,pathLength:Ce,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Et,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ce,pointsAtY:Ce,pointsAtZ:Ce,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:nn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:nn,rev:nn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:nn,requiredFeatures:nn,requiredFonts:nn,requiredFormats:nn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ce,specularExponent:Ce,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ce,strikethroughThickness:Ce,string:null,stroke:null,strokeDashArray:nn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ce,strokeOpacity:Ce,strokeWidth:null,style:null,surfaceScale:Ce,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:nn,tabIndex:Ce,tableValues:null,target:null,targetX:Ce,targetY:Ce,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:nn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ce,underlineThickness:Ce,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ce,values:null,vAlphabetic:Ce,vMathematical:Ce,vectorEffect:null,vHanging:Ce,vIdeographic:Ce,version:null,vertAdvY:Ce,vertOriginX:Ce,vertOriginY:Ce,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ce,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:$j}),Hj=Qo({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Wj=Qo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:zj}),Vj=Qo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),h8={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},f8=/[A-Z]/g,Qb=/-[a-z]/g,m8=/^data[-\w.:]+$/i;function p8(e,t){const r=Xm(t);let s=t,o=Jr;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&m8.test(t)){if(t.charAt(4)==="-"){const u=t.slice(5).replace(Qb,x8);s="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=t.slice(4);if(!Qb.test(u)){let d=u.replace(f8,g8);d.charAt(0)!=="-"&&(d="-"+d),t="data"+d}}o=Ig}return new o(s,t)}function g8(e){return"-"+e.toLowerCase()}function x8(e){return e.charAt(1).toUpperCase()}const v8=Bj([Fj,u8,Hj,Wj,Vj],"html"),Og=Bj([Fj,d8,Hj,Wj,Vj],"svg");function y8(e){return e.join(" ").trim()}var wo={},Zf,Zb;function b8(){if(Zb)return Zf;Zb=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
569
+ }`}),children:[n.jsx(yt,{className:"w-4 h-4 mr-1"}),"Add MCP"]})]}),n.jsx("div",{className:"space-y-2",children:Object.keys(y).length===0?n.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No MCP servers configured"}):Object.entries(y).map(([O,$])=>n.jsxs(Ml,{open:k[O],onOpenChange:()=>P(O),children:[n.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border bg-background group",children:[n.jsxs(Dl,{className:"flex items-center gap-2 flex-1 text-left",children:[k[O]?n.jsx(Sr,{className:"w-4 h-4 text-muted-foreground"}):n.jsx(Kr,{className:"w-4 h-4 text-muted-foreground"}),n.jsx(Fn,{className:"w-4 h-4 text-blue-500"}),n.jsx("span",{className:"font-medium text-sm",children:O}),n.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:$.command})]}),n.jsx(le,{size:"sm",variant:"ghost",className:"h-7 w-7 p-0 opacity-0 group-hover:opacity-100 text-destructive hover:text-destructive",onClick:()=>E(O),children:n.jsx(jn,{className:"w-4 h-4"})})]}),n.jsx(Ll,{children:n.jsx("div",{className:"mt-2 ml-6 p-3 rounded-lg bg-muted/50 border",children:n.jsx("pre",{className:"text-xs font-mono text-muted-foreground overflow-x-auto",children:JSON.stringify($,null,2)})})})]},O))})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(Ht,{className:"w-4 h-4 text-blue-500"}),"Model"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Default Model"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Model used for Gemini CLI sessions"})]}),n.jsxs(fr,{value:g("model","name",""),onValueChange:O=>b("model","name",O),children:[n.jsx(ar,{className:"w-48",children:n.jsx(mr,{placeholder:"Select model"})}),n.jsx(lr,{children:zF.map(O=>n.jsx(xt,{value:O.id,children:n.jsx("div",{className:"flex flex-col",children:n.jsx("span",{children:O.name})})},O.id))})]})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Preview Features"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable access to experimental models and features"})]}),n.jsx(dt,{checked:g("general","previewFeatures",!1),onCheckedChange:O=>b("general","previewFeatures",O)})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(u5,{className:"w-4 h-4 text-blue-500"}),"Appearance"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Theme"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Color theme for the CLI interface"})]}),n.jsxs(fr,{value:g("ui","theme","Default"),onValueChange:O=>b("ui","theme",O),children:[n.jsx(ar,{className:"w-40",children:n.jsx(mr,{})}),n.jsx(lr,{children:$F.map(O=>n.jsx(xt,{value:O.id,children:O.name},O.id))})]})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Output Format"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Format for CLI output"})]}),n.jsxs(fr,{value:g("output","format","text"),onValueChange:O=>b("output","format",O),children:[n.jsx(ar,{className:"w-40",children:n.jsx(mr,{})}),n.jsxs(lr,{children:[n.jsx(xt,{value:"text",children:"Text"}),n.jsx(xt,{value:"json",children:"JSON"})]})]})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(k1,{className:"w-4 h-4 text-blue-500"}),"Display Options"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Dynamic Window Title"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Update title with status icons (Ready, Working, etc.)"})]}),n.jsx(dt,{checked:g("ui","dynamicWindowTitle",!0),onCheckedChange:O=>b("ui","dynamicWindowTitle",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Show Line Numbers"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Display line numbers in chat"})]}),n.jsx(dt,{checked:g("ui","showLineNumbers",!0),onCheckedChange:O=>b("ui","showLineNumbers",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Show Citations"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Display citations for generated text"})]}),n.jsx(dt,{checked:g("ui","showCitations",!1),onCheckedChange:O=>b("ui","showCitations",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Hide Context Summary"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Hide GEMINI.md and MCP servers above input"})]}),n.jsx(dt,{checked:g("ui","hideContextSummary",!1),onCheckedChange:O=>b("ui","hideContextSummary",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Hide Footer"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Remove footer entirely from the UI"})]}),n.jsx(dt,{checked:g("ui","hideFooter",!1),onCheckedChange:O=>b("ui","hideFooter",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Screen Reader Mode"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Render output in plain-text for accessibility"})]}),n.jsx(dt,{checked:((N=(T=o==null?void 0:o.ui)==null?void 0:T.accessibility)==null?void 0:N.screenReader)??!1,onCheckedChange:O=>u($=>{var W;return{...$,ui:{...$.ui,accessibility:{...(W=$.ui)==null?void 0:W.accessibility,screenReader:O}}}})})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(kn,{className:"w-4 h-4 text-blue-500"}),"General"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Vim Mode"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable Vim keybindings in the prompt editor"})]}),n.jsx(dt,{checked:g("general","vimMode",!1),onCheckedChange:O=>b("general","vimMode",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Auto Update"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Allow automatic updates to Gemini CLI"})]}),n.jsx(dt,{checked:g("general","enableAutoUpdate",!0),onCheckedChange:O=>b("general","enableAutoUpdate",O)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Checkpointing"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable session recovery support"})]}),n.jsx(dt,{checked:((I=(R=o==null?void 0:o.general)==null?void 0:R.checkpointing)==null?void 0:I.enabled)??!1,onCheckedChange:O=>u($=>{var W;return{...$,general:{...$.general,checkpointing:{...(W=$.general)==null?void 0:W.checkpointing,enabled:O}}}})})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Respect .gitignore"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Exclude files matching .gitignore patterns"})]}),n.jsx(dt,{checked:g("general","respectGitignore",!0),onCheckedChange:O=>b("general","respectGitignore",O)})]})]})]}),n.jsxs("div",{className:"border border-border rounded-lg p-4 bg-card",children:[n.jsxs("h3",{className:"text-sm font-medium text-foreground mb-4 flex items-center gap-2",children:[n.jsx(as,{className:"w-4 h-4 text-blue-500"}),"Privacy"]}),n.jsx("div",{className:"space-y-4",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-foreground",children:"Usage Statistics"}),n.jsx("p",{className:"text-xs text-muted-foreground",children:"Allow collection of anonymous usage data"})]}),n.jsx(dt,{checked:g("privacy","usageStatisticsEnabled",!0),onCheckedChange:O=>b("privacy","usageStatisticsEnabled",O)})]})})]})]}),n.jsx(Tt,{open:x.open,onOpenChange:O=>w({...x,open:O}),children:n.jsxs(St,{className:"bg-card",children:[n.jsxs(Ct,{children:[n.jsx(kt,{children:"Add MCP Server"}),n.jsx(tr,{children:"Add a new MCP server to Gemini CLI"})]}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Name"}),n.jsx(ct,{value:x.name,onChange:O=>w({...x,name:O.target.value}),placeholder:"my-mcp-server",className:"mt-1"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Configuration (JSON)"}),n.jsx(pt,{value:x.json,onChange:O=>w({...x,json:O.target.value}),className:"mt-1 font-mono text-sm",rows:6})]})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"ghost",onClick:()=>w({open:!1,name:"",json:""}),children:"Cancel"}),n.jsxs(le,{onClick:j,children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add MCP"]})]})]})})]})}function HF({content:e,parsed:t,onSave:r,filePath:s}){const o=async l=>{const c=JSON.stringify(l,null,2);r(c)},u=(s==null?void 0:s.includes(".gemini"))||(s==null?void 0:s.includes("/.gemini/")),d=(s==null?void 0:s.includes(".agent"))||(s==null?void 0:s.includes("/antigravity/"));return u&&!d?n.jsx("div",{className:"h-full overflow-auto p-4",children:n.jsx(Rj,{settings:t||{},onSave:o,loading:!1,settingsPath:s||"~/.gemini/settings.json"})}):n.jsx("div",{className:"h-full overflow-auto p-4",children:n.jsx(Tj,{settings:t||{},onSave:o,loading:!1,settingsPath:s||"~/.claude/settings.json"})})}function WF({open:e,onClose:t,item:r,intermediatePaths:s,onMove:o}){const[u,d]=C.useState("copy"),[l,c]=C.useState(null),[f,m]=C.useState(""),[h,x]=C.useState(!1),w=()=>{const k=f.trim()||l;if(!k){ee.error("Please select or enter a target path");return}o(r.path,k,u,h)};return n.jsx(Tt,{open:e,onOpenChange:t,children:n.jsxs(St,{className:"max-w-md",children:[n.jsxs(Ct,{children:[n.jsxs(kt,{children:[u==="copy"?"Copy":"Move"," ",r==null?void 0:r.name]}),n.jsx(tr,{children:"Select a destination for this file"})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex gap-2",children:[n.jsxs(le,{variant:u==="copy"?"default":"outline",size:"sm",onClick:()=>d("copy"),children:[n.jsx(Cu,{className:"w-4 h-4 mr-1"})," Copy"]}),n.jsxs(le,{variant:u==="move"?"default":"outline",size:"sm",onClick:()=>d("move"),children:[n.jsx(j1,{className:"w-4 h-4 mr-1"})," Move"]})]}),n.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:s==null?void 0:s.map(k=>n.jsxs("div",{className:je("flex items-center justify-between p-2 rounded border cursor-pointer",l===k.dir?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"hover:bg-gray-50 dark:hover:bg-slate-800"),onClick:()=>{c(k.dir),m("")},children:[n.jsxs("div",{className:"flex items-center gap-2",children:[k.isHome?n.jsx(Vp,{className:"w-4 h-4"}):n.jsx(wr,{className:"w-4 h-4"}),n.jsx("span",{className:"text-sm",children:k.label})]}),k.hasClaudeFolder?n.jsx(Qe,{variant:"secondary",className:"text-xs",children:"exists"}):n.jsx(Qe,{variant:"outline",className:"text-xs",children:"create"})]},k.dir))}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Or enter custom path:"}),n.jsx(ct,{className:"mt-1 font-mono text-sm",placeholder:"/path/to/directory",value:f,onChange:k=>{m(k.target.value),c(null)}})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(dt,{checked:h,onCheckedChange:x}),n.jsx("span",{className:"text-sm",children:"Merge if target exists"})]})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"ghost",onClick:t,children:"Cancel"}),n.jsx(le,{onClick:w,children:u==="copy"?"Copy":"Move"})]})]})})}function VF({open:e,onClose:t,item:r,onRename:s}){const[o,u]=C.useState("");C.useEffect(()=>{r!=null&&r.name&&u(r.name.replace(/\.md$/,""))},[r,e]);const d=()=>{if(!o.trim()){ee.error("Please enter a name");return}s(r,o.trim())};return n.jsx(Tt,{open:e,onOpenChange:t,children:n.jsxs(St,{className:"sm:max-w-md",children:[n.jsx(Ct,{children:n.jsxs(kt,{children:["Rename ",r==null?void 0:r.type]})}),n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"New name"}),n.jsx(ct,{className:"mt-1",placeholder:"new-name",value:o,onChange:l=>u(l.target.value),onKeyDown:l=>l.key==="Enter"&&d()}),n.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1",children:".md extension will be added automatically"})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"ghost",onClick:t,children:"Cancel"}),n.jsx(le,{onClick:d,children:"Rename"})]})]})})}function UF({open:e,onClose:t,dir:r,type:s,onCreate:o}){const[u,d]=C.useState("");C.useEffect(()=>{d("")},[e]);const l=()=>{if((s==="command"||s==="rule"||s==="workflow"||s==="memory")&&!u.trim()){ee.error("Please enter a name");return}const m=s==="command"||s==="rule"||s==="workflow"||s==="memory"?u.endsWith(".md")?u:`${u}.md`:u;o(r,m,s)},c=dl[s]||{},f=s==="command"||s==="rule"||s==="workflow"||s==="memory";return n.jsx(Tt,{open:e,onOpenChange:t,children:n.jsxs(St,{className:"max-w-sm",children:[n.jsx(Ct,{children:n.jsxs(kt,{children:["Create ",c.label||s]})}),f&&n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium",children:"Name"}),n.jsx(ct,{className:"mt-1",placeholder:s==="command"?"my-command.md":s==="workflow"?"my-workflow.md":s==="memory"?"context.md":"my-rule.md",value:u,onChange:m=>d(m.target.value),onKeyDown:m=>m.key==="Enter"&&l()})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"ghost",onClick:t,children:"Cancel"}),n.jsx(le,{onClick:l,children:"Create"})]})]})})}function GF({project:e,onRefresh:t}){var De,Re,Ze;const[r,s]=C.useState([]),[o,u]=C.useState([]),[d,l]=C.useState(null),[c,f]=C.useState(null),[m,h]=C.useState(null),[x,w]=C.useState(()=>{try{return localStorage.getItem("claude-config-expanded-folder")||null}catch{return null}}),[k,_]=C.useState({}),[v,b]=C.useState(!0),[g,y]=C.useState({open:!1,item:null}),[j,E]=C.useState({open:!1,dir:null,type:null}),[P,T]=C.useState({open:!1,item:null}),[N,R]=C.useState(!1),[I,O]=C.useState({open:!1,projectDir:null}),[$,W]=C.useState({open:!1,dir:null,name:null}),[Y,z]=C.useState({open:!1,dir:null}),[K,G]=C.useState({x:0,y:0,item:null}),[U,L]=C.useState(["claude"]),M=C.useCallback(async()=>{var Se;try{b(!0);const[ge,Me,ht,Rt]=await Promise.all([ke.getClaudeFolders(),ke.getIntermediatePaths(),ke.getRegistry(),ke.getConfig()]);if(s(ge),u(Me),l(ht),L(((Se=Rt.config)==null?void 0:Se.enabledTools)||["claude"]),ge.length>0){const pe=localStorage.getItem("claude-config-expanded-folder");if(!pe||!ge.find(be=>be.dir===pe)){const be=ge.filter(Ke=>!Ke.isSubproject),Be=be.length>1?be[be.length-1]:be[0],Ge=(Be==null?void 0:Be.dir)||ge[0].dir;w(Ge);try{localStorage.setItem("claude-config-expanded-folder",Ge)}catch{}}}}catch(ge){ee.error("Failed to load data: "+ge.message)}finally{b(!1)}},[]);C.useEffect(()=>{M(),f(null),h(null)},[M,e==null?void 0:e.dir]);const B=Se=>{const ge=x===Se?null:Se;w(ge);try{ge?localStorage.setItem("claude-config-expanded-folder",ge):localStorage.removeItem("claude-config-expanded-folder")}catch{}},q=async Se=>{f(Se);try{const ge=await ke.getClaudeFile(Se.path);h(ge)}catch(ge){ee.error("Failed to load file: "+ge.message)}},F=async Se=>{if(c)try{await ke.saveClaudeFile(c.path,Se),ee.success("Saved");const ge=await ke.getClaudeFile(c.path);h(ge),M()}catch(ge){ee.error("Failed to save: "+ge.message)}},oe=Se=>{_(ge=>({...ge,[Se]:!ge[Se]}))},fe=(Se,ge)=>{Se.preventDefault(),G({x:Se.clientX,y:Se.clientY,item:ge})},me=async(Se,ge)=>{ge==="command"||ge==="rule"||ge==="workflow"||ge==="memory"?E({open:!0,dir:Se,type:ge}):ge==="claudemd"?z({open:!0,dir:Se}):X(Se,ge==="mcps"?"mcps.json":ge==="settings"?"settings.json":ge==="env"?".env":"CLAUDE.md",ge)},X=async(Se,ge,Me)=>{try{const ht=await ke.createClaudeFile(Se,ge,Me);if(ee.success("Created"),E({open:!1,dir:null,type:null}),await M(),ht.path){const Rt={path:ht.path,name:ge,type:Me==="command"?"command":Me==="rule"?"rule":Me==="workflow"?"workflow":"file"};f(Rt),h(ht.content||"")}}catch(ht){ee.error("Failed to create: "+ht.message)}},H=async(Se,ge)=>{try{const Me=await ke.renameClaudeFile(Se.path,ge);Me.success?(ee.success("Renamed"),T({open:!1,item:null}),await M(),f({...Se,path:Me.newPath,name:ge.endsWith(".md")?ge:`${ge}.md`})):ee.error(Me.error||"Failed to rename")}catch(Me){ee.error("Failed to rename: "+Me.message)}},ae=async Se=>{if(confirm(`Delete ${Se.name}?`))try{await ke.deleteClaudeFile(Se.path),ee.success("Deleted"),(c==null?void 0:c.path)===Se.path&&(f(null),h(null)),M()}catch(ge){ee.error("Failed to delete: "+ge.message)}},ne=async(Se,ge,Me,ht)=>{try{await ke.moveClaudeItem(Se,ge,Me,ht),ee.success(Me==="copy"?"Copied":"Moved"),y({open:!1,item:null}),M()}catch(Rt){ee.error("Failed: "+Rt.message)}},J=async Se=>{if(Se)try{const ge=await ke.addManualSubproject(I.projectDir,Se);ge.success?(ee.success(`Added sub-project: ${Se.split("/").pop()}`),O({open:!1,projectDir:null}),M()):ee.error(ge.error||"Failed to add sub-project")}catch(ge){ee.error("Failed to add sub-project: "+ge.message)}},ie=async Se=>{const ge=r.find(Me=>!Me.isSubproject&&!Me.isHome);if(ge)try{const Me=await ke.removeManualSubproject(ge.dir,Se);Me.success?(ee.success("Removed sub-project"),M()):ee.error(Me.error||"Failed to remove sub-project")}catch(Me){ee.error("Failed to remove sub-project: "+Me.message)}},ye=async Se=>{const ge=r.find(Me=>!Me.isSubproject&&!Me.isHome);if(ge)try{const Me=await ke.hideSubproject(ge.dir,Se);Me.success?(ee.success("Sub-project hidden"),M()):ee.error(Me.error||"Failed to hide sub-project")}catch(Me){ee.error("Failed to hide sub-project: "+Me.message)}},Oe=()=>{if(!c||!m)return n.jsx("div",{className:"h-full flex items-center justify-center text-gray-500 dark:text-slate-400",children:n.jsxs("div",{className:"text-center",children:[n.jsx(Pm,{className:"w-12 h-12 mx-auto mb-2 opacity-50"}),n.jsx("p",{children:"Select a file to edit"})]})});switch(c.type){case"mcps":return n.jsx(HB,{content:m.content,parsed:m.parsed,onSave:F,registry:d});case"settings":return n.jsx(HF,{content:m.content,parsed:m.parsed,onSave:F,filePath:c==null?void 0:c.path});case"command":case"rule":case"workflow":case"claudemd":case"env":return n.jsx(Vb,{content:m.content,onSave:F,fileType:c.type});default:return n.jsx(Vb,{content:m.content,onSave:F,fileType:"claudemd"})}};if(v)return n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx(pr,{className:"w-6 h-6 animate-spin text-gray-400"})});const Ve=r.some(Se=>Se.isSubproject),te=(Se,ge)=>ge===0,de=(Se,ge)=>{const Me=r.findIndex(ht=>ht.isSubproject);return!Se.isSubproject&&(Me>=0?ge===Me-1:ge===r.length-1)};return n.jsxs("div",{className:"h-full flex",children:[n.jsxs("div",{className:"w-76 border-r flex flex-col bg-white dark:bg-slate-950",children:[n.jsxs("div",{className:"flex items-center justify-between p-3 border-b",children:[n.jsx("h2",{className:"font-semibold text-sm",children:"Project Config"}),n.jsxs("div",{className:"flex gap-1",children:[U.includes("claude")&&U.includes("antigravity")&&n.jsxs(le,{variant:"ghost",size:"sm",className:"h-7 px-2",onClick:()=>R(!0),title:"Sync rules between tools",children:[n.jsx(Q4,{className:"w-4 h-4 mr-1"}),"Sync"]}),n.jsx(le,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:M,children:n.jsx(pr,{className:"w-4 h-4"})})]})]}),n.jsx(Nn,{className:"flex-1",children:r.map((Se,ge)=>n.jsx(BB,{folder:Se,isExpanded:x===Se.dir,isHome:te(Se,ge),isProject:de(Se,ge),isSubproject:Se.isSubproject,depth:Se.depth||0,onToggle:()=>B(Se.dir),onCreateFile:me,onInstallPlugin:(Me,ht)=>W({open:!0,dir:Me,name:ht}),onSelectItem:q,selectedPath:c==null?void 0:c.path,onContextMenu:fe,expandedFolders:k,onToggleFolder:oe,hasSubprojects:Ve,onAddSubproject:Me=>O({open:!0,projectDir:Me}),onRemoveSubproject:ie,onHideSubproject:ye},Se.dir))})]}),n.jsxs("div",{className:"flex-1 flex flex-col bg-gray-50 dark:bg-slate-900",children:[c&&n.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b bg-white dark:bg-slate-950",children:[n.jsx("div",{className:"flex items-center gap-2 text-sm",children:n.jsx("span",{className:"text-gray-500 dark:text-slate-400 font-mono truncate max-w-md",children:c.path})}),n.jsxs("div",{className:"flex gap-1",children:[n.jsx(le,{variant:"ghost",size:"sm",onClick:()=>y({open:!0,item:c}),children:n.jsx(Cu,{className:"w-4 h-4"})}),n.jsx(le,{variant:"ghost",size:"sm",onClick:()=>ae(c),children:n.jsx(jn,{className:"w-4 h-4"})})]})]}),n.jsx("div",{className:"flex-1",children:Oe()})]}),K.item&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>G({x:0,y:0,item:null})}),n.jsxs("div",{className:"fixed z-50 bg-white dark:bg-slate-950 rounded-md shadow-lg border py-1 min-w-[160px]",style:{left:K.x,top:K.y},children:[(((De=K.item)==null?void 0:De.type)==="rule"||((Re=K.item)==null?void 0:Re.type)==="command"||((Ze=K.item)==null?void 0:Ze.type)==="workflow")&&n.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center",onClick:()=>{T({open:!0,item:K.item}),G({x:0,y:0,item:null})},children:[n.jsx(N1,{className:"w-4 h-4 mr-2"})," Rename"]}),n.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center",onClick:()=>{y({open:!0,item:K.item}),G({x:0,y:0,item:null})},children:[n.jsx(Cu,{className:"w-4 h-4 mr-2"})," Copy to..."]}),n.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center",onClick:()=>{y({open:!0,item:K.item}),G({x:0,y:0,item:null})},children:[n.jsx(j1,{className:"w-4 h-4 mr-2"})," Move to..."]}),n.jsx("div",{className:"border-t my-1"}),n.jsxs("button",{className:"w-full px-3 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-slate-800 flex items-center text-red-600",onClick:()=>{ae(K.item),G({x:0,y:0,item:null})},children:[n.jsx(jn,{className:"w-4 h-4 mr-2"})," Delete"]})]})]}),n.jsx(WF,{open:g.open,onClose:()=>y({open:!1,item:null}),item:g.item,intermediatePaths:o,onMove:ne}),n.jsx(UF,{open:j.open,onClose:()=>E({open:!1,dir:null,type:null}),dir:j.dir,type:j.type,onCreate:X}),n.jsx(VF,{open:P.open,onClose:()=>T({open:!1,item:null}),item:P.item,onRename:H}),n.jsx(YO,{open:N,onOpenChange:R,projectDir:e==null?void 0:e.dir,onSynced:M}),n.jsx(AB,{open:$.open,onOpenChange:Se=>W({...$,open:Se}),projectDir:$.dir,projectName:$.name}),n.jsx(_g,{open:I.open,onOpenChange:Se=>O({...I,open:Se}),onSelect:J,type:"directory",title:"Add Sub-project",initialPath:I.projectDir||"~"}),n.jsx(OB,{open:Y.open,onOpenChange:Se=>{z({...Y,open:Se}),Se||M()},title:"Initialize CLAUDE.md",description:"Running claude -p /init to generate project-aware CLAUDE.md",cwd:Y.dir,initialCommand:"claude -p /init; exit",autoCloseOnExit:!0,autoCloseDelay:2e3})]})}function KF({projects:e=[],activeProject:t=null,onSwitch:r,onAddClick:s,onManageClick:o,disabled:u=!1}){const d=(t==null?void 0:t.name)||"No Project";return n.jsxs(ai,{children:[n.jsx(li,{asChild:!0,children:n.jsxs(le,{variant:"outline",className:"gap-2 max-w-[220px] h-9",disabled:u,children:[n.jsx(si,{className:"w-4 h-4 text-indigo-500 flex-shrink-0"}),n.jsx("span",{className:"truncate font-medium",children:d}),n.jsx(Sr,{className:"w-4 h-4 opacity-50 flex-shrink-0"})]})}),n.jsxs(ks,{align:"start",className:"w-72",children:[n.jsx(ul,{className:"text-xs text-gray-500 font-normal",children:"Projects"}),n.jsx(Or,{}),e.length===0?n.jsxs("div",{className:"px-3 py-6 text-sm text-gray-500 text-center",children:[n.jsx(wr,{className:"w-8 h-8 mx-auto mb-2 text-gray-300"}),n.jsx("p",{children:"No projects registered"}),n.jsx("p",{className:"text-xs mt-1",children:"Add a project to get started"})]}):n.jsx("div",{className:"max-h-64 overflow-y-auto",children:e.map(l=>n.jsxs(Pt,{onClick:()=>!l.isActive&&r(l.id),className:`flex items-start gap-2 py-2 cursor-pointer ${l.isActive?"bg-indigo-50":""}`,disabled:l.isActive,children:[n.jsx("div",{className:"mt-0.5 flex-shrink-0",children:l.isActive?n.jsx(Kt,{className:"w-4 h-4 text-indigo-600"}):l.exists?n.jsx(wr,{className:"w-4 h-4 text-gray-400"}):n.jsx(Xu,{className:"w-4 h-4 text-amber-500"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:`truncate font-medium ${l.isActive?"text-indigo-700":""}`,children:l.name}),n.jsx("div",{className:"truncate text-xs text-gray-400 font-mono",children:l.path.replace(/^\/Users\/[^/]+/,"~")}),!l.exists&&n.jsx("div",{className:"text-xs text-amber-600 mt-0.5",children:"Path not found"})]}),l.hasClaudeConfig&&n.jsx("div",{className:"flex-shrink-0",children:n.jsx("div",{className:"w-2 h-2 rounded-full bg-green-400",title:"Has .claude config"})})]},l.id))}),n.jsx(Or,{}),n.jsxs(Pt,{onClick:s,className:"gap-2 cursor-pointer",children:[n.jsx(yt,{className:"w-4 h-4"}),"Add Project"]}),e.length>0&&n.jsxs(Pt,{onClick:o,className:"gap-2 cursor-pointer",children:[n.jsx(Tm,{className:"w-4 h-4"}),"Manage Projects"]})]})]})}const Xf="claude-config-welcome-seen";function qF({onStartTutorial:e}){const[t,r]=C.useState(!1),[s,o]=C.useState(!0);C.useEffect(()=>{if(!localStorage.getItem(Xf)){const c=setTimeout(()=>r(!0),500);return()=>clearTimeout(c)}},[]);const u=()=>{s&&localStorage.setItem(Xf,"true"),r(!1)},d=()=>{s&&localStorage.setItem(Xf,"true"),r(!1),e==null||e()};return n.jsx(Tt,{open:t,onOpenChange:r,children:n.jsxs(St,{className:"sm:max-w-lg",children:[n.jsxs(Ct,{children:[n.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center shadow-lg",children:n.jsx(kn,{className:"w-6 h-6 text-white"})}),n.jsx(kt,{className:"text-2xl",children:"Welcome to Coder Config"})]}),n.jsx(tr,{className:"text-base pt-2",children:"Your control center for Claude Code and AI coding tools."})]}),n.jsxs("div",{className:"py-4 space-y-4",children:[n.jsx("p",{className:"text-sm text-muted-foreground",children:"We built Coder Config because managing AI coding assistants shouldn't require editing JSON files or memorizing command-line flags. You deserve a visual interface that makes configuration easy."}),n.jsxs("div",{className:"grid grid-cols-3 gap-3 py-2",children:[n.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[n.jsx(ns,{className:"w-5 h-5 mx-auto mb-2 text-indigo-500"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:"MCP Servers"})]}),n.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[n.jsx(as,{className:"w-5 h-5 mx-auto mb-2 text-green-500"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:"Permissions"})]}),n.jsxs("div",{className:"text-center p-3 rounded-lg bg-muted/50",children:[n.jsx(Ht,{className:"w-5 h-5 mx-auto mb-2 text-amber-500"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:"Rules & Memory"})]})]}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Take our guided tutorial to learn the basics, or dive in and explore on your own."}),n.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[n.jsx(jl,{id:"dont-ask",checked:s,onCheckedChange:o}),n.jsx(Bt,{htmlFor:"dont-ask",className:"text-sm text-muted-foreground cursor-pointer",children:"Don't show this again"})]})]}),n.jsxs(It,{className:"flex gap-2 sm:gap-2",children:[n.jsx(le,{variant:"ghost",onClick:u,children:"Skip for now"}),n.jsxs(le,{onClick:d,className:"gap-2",children:[n.jsx(ku,{className:"w-4 h-4"}),"Start Tutorial",n.jsx(Hp,{className:"w-4 h-4"})]})]})]})})}const Jf="claude-config:claude-init-preference";function Mj({open:e,onOpenChange:t,onAdded:r}){const[s,o]=C.useState(""),[u,d]=C.useState(""),[l,c]=C.useState(!1),[f,m]=C.useState(!1),[h,x]=C.useState(!0);C.useEffect(()=>{const v=localStorage.getItem(Jf);v==="never"?x(!1):v==="always"&&x(!0)},[]),C.useEffect(()=>{if(e){o(""),d("");const v=localStorage.getItem(Jf);x(v!=="never")}},[e]),C.useEffect(()=>{if(s&&!u){const v=s.split("/").pop();d(v||"")}},[s]);const w=v=>{o(v),c(!1)},k=async()=>{if(!s){ee.error("Please select a project path");return}m(!0);try{const v=await ke.addProject(s,u||void 0,h);v.error?ee.error(v.error):(v.claudeInitRan?ee.success(`Added project: ${v.project.name} (initialized with Claude Code)`):v.claudeInitError?(ee.success(`Added project: ${v.project.name}`),ee.warning("Could not run claude /init - is Claude Code installed?")):ee.success(`Added project: ${v.project.name}`),r==null||r(v.project),t(!1))}catch(v){ee.error("Failed to add project: "+v.message)}finally{m(!1)}},_=v=>{localStorage.setItem(Jf,v),v==="never"?x(!1):v==="always"&&x(!0),ee.success(`Preference saved: ${v==="always"?"Always":v==="never"?"Never":"Ask each time"} run claude /init`)};return n.jsxs(n.Fragment,{children:[n.jsx(Tt,{open:e,onOpenChange:t,children:n.jsxs(St,{className:"sm:max-w-md",children:[n.jsxs(Ct,{children:[n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(si,{className:"w-5 h-5 text-indigo-500"}),"Add Project"]}),n.jsx(tr,{children:"Register a project folder to quickly switch between projects in the UI."})]}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(Bt,{htmlFor:"path",children:"Project Path"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ct,{id:"path",value:s,onChange:v=>o(v.target.value),placeholder:"/path/to/project",className:"font-mono text-sm flex-1"}),n.jsx(le,{variant:"outline",size:"icon",onClick:()=>c(!0),title:"Browse",children:n.jsx(si,{className:"w-4 h-4"})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(Bt,{htmlFor:"name",children:"Display Name"}),n.jsx(ct,{id:"name",value:u,onChange:v=>d(v.target.value),placeholder:"Auto-filled from folder name"}),n.jsx("p",{className:"text-xs text-gray-500",children:"Optional. Leave empty to use folder name."})]}),n.jsxs("div",{className:"border-t pt-4",children:[n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx(jl,{id:"claudeInit",checked:h,onCheckedChange:x,className:"mt-0.5"}),n.jsxs("div",{className:"flex-1",children:[n.jsxs(Bt,{htmlFor:"claudeInit",className:"flex items-center gap-2 cursor-pointer",children:[n.jsx(Ht,{className:"w-4 h-4 text-orange-500"}),"Initialize with Claude Code"]}),n.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Run ",n.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1 rounded",children:"claude /init"})," to create CLAUDE.md"]})]})]}),n.jsxs("div",{className:"flex gap-2 mt-3",children:[n.jsx(le,{variant:"ghost",size:"sm",className:"text-xs h-7",onClick:()=>_("always"),children:"Always"}),n.jsx(le,{variant:"ghost",size:"sm",className:"text-xs h-7",onClick:()=>_("never"),children:"Never"}),n.jsx(le,{variant:"ghost",size:"sm",className:"text-xs h-7",onClick:()=>_("ask"),children:"Ask each time"})]})]})]}),n.jsxs(It,{children:[n.jsx(le,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),n.jsx(le,{onClick:k,disabled:f||!s,children:f?n.jsxs(n.Fragment,{children:[n.jsx(ut,{className:"w-4 h-4 mr-2 animate-spin"}),"Adding..."]}):"Add Project"})]})]})}),n.jsx(_g,{open:l,onOpenChange:c,onSelect:w,type:"directory",initialPath:"~",title:"Select Project Folder"})]})}const Dj=C.createContext({theme:"auto",setTheme:()=>{},resolvedTheme:"light"});function YF({children:e}){const[t,r]=C.useState(()=>{try{return localStorage.getItem("claude-config-theme")||"auto"}catch{return"auto"}}),[s,o]=C.useState("light");C.useEffect(()=>{const d=window.document.documentElement,l=m=>{let h;m==="auto"?h=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":h=m,o(h),h==="dark"?d.classList.add("dark"):d.classList.remove("dark")};l(t);const c=window.matchMedia("(prefers-color-scheme: dark)"),f=()=>{t==="auto"&&l("auto")};return c.addEventListener("change",f),()=>c.removeEventListener("change",f)},[t]);const u=d=>{r(d);try{localStorage.setItem("claude-config-theme",d)}catch{}};return n.jsx(Dj.Provider,{value:{theme:t,setTheme:u,resolvedTheme:s},children:e})}function XF(){return C.useContext(Dj)}function JF(){const{theme:e,setTheme:t,resolvedTheme:r}=XF(),s=r==="dark"?rb:ib;return n.jsxs(ai,{children:[n.jsx(li,{asChild:!0,children:n.jsxs(le,{variant:"ghost",size:"sm",className:"w-9 px-0",children:[n.jsx(s,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),n.jsxs(ks,{align:"end",children:[n.jsxs(Pt,{onClick:()=>t("light"),className:e==="light"?"bg-accent":"",children:[n.jsx(ib,{className:"mr-2 h-4 w-4"}),"Light"]}),n.jsxs(Pt,{onClick:()=>t("dark"),className:e==="dark"?"bg-accent":"",children:[n.jsx(rb,{className:"mr-2 h-4 w-4"}),"Dark"]}),n.jsxs(Pt,{onClick:()=>t("auto"),className:e==="auto"?"bg-accent":"",children:[n.jsx(k1,{className:"mr-2 h-4 w-4"}),"System"]})]})]})}var QF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ZF=QF.reduce((e,t)=>{const r=Qu(`Primitive.${t}`),s=C.forwardRef((o,u)=>{const{asChild:d,...l}=o,c=d?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(c,{...l,ref:u})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{}),e8="Separator",qb="horizontal",t8=["horizontal","vertical"],Lj=C.forwardRef((e,t)=>{const{decorative:r,orientation:s=qb,...o}=e,u=r8(s)?s:qb,l=r?{role:"none"}:{"aria-orientation":u==="vertical"?u:void 0,role:"separator"};return n.jsx(ZF.div,{"data-orientation":u,...l,...o,ref:t})});Lj.displayName=e8;function r8(e){return t8.includes(e)}var Ij=Lj;const Oj=C.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...s},o)=>n.jsx(Ij,{ref:o,decorative:r,orientation:t,className:je("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...s}));Oj.displayName=Ij.displayName;function n8(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const s8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,i8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,o8={};function Yb(e,t){return(o8.jsx?i8:s8).test(e)}const a8=/[ \t\n\f\r]/g;function l8(e){return typeof e=="object"?e.type==="text"?Xb(e.value):!1:Xb(e)}function Xb(e){return e.replace(a8,"")===""}class Il{constructor(t,r,s){this.normal=r,this.property=t,s&&(this.space=s)}}Il.prototype.normal={};Il.prototype.property={};Il.prototype.space=void 0;function Bj(e,t){const r={},s={};for(const o of e)Object.assign(r,o.property),Object.assign(s,o.normal);return new Il(r,s,t)}function Xm(e){return e.toLowerCase()}class Jr{constructor(t,r){this.attribute=r,this.property=t}}Jr.prototype.attribute="";Jr.prototype.booleanish=!1;Jr.prototype.boolean=!1;Jr.prototype.commaOrSpaceSeparated=!1;Jr.prototype.commaSeparated=!1;Jr.prototype.defined=!1;Jr.prototype.mustUseProperty=!1;Jr.prototype.number=!1;Jr.prototype.overloadedBoolean=!1;Jr.prototype.property="";Jr.prototype.spaceSeparated=!1;Jr.prototype.space=void 0;let c8=0;const ot=Ki(),er=Ki(),Jm=Ki(),Ce=Ki(),Et=Ki(),To=Ki(),nn=Ki();function Ki(){return 2**++c8}const Qm=Object.freeze(Object.defineProperty({__proto__:null,boolean:ot,booleanish:er,commaOrSpaceSeparated:nn,commaSeparated:To,number:Ce,overloadedBoolean:Jm,spaceSeparated:Et},Symbol.toStringTag,{value:"Module"})),Qf=Object.keys(Qm);class Ig extends Jr{constructor(t,r,s,o){let u=-1;if(super(t,r),Jb(this,"space",o),typeof s=="number")for(;++u<Qf.length;){const d=Qf[u];Jb(this,Qf[u],(s&Qm[d])===Qm[d])}}}Ig.prototype.defined=!0;function Jb(e,t,r){r&&(e[t]=r)}function Qo(e){const t={},r={};for(const[s,o]of Object.entries(e.properties)){const u=new Ig(s,e.transform(e.attributes||{},s),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(u.mustUseProperty=!0),t[s]=u,r[Xm(s)]=s,r[Xm(u.attribute)]=s}return new Il(t,r,e.space)}const Fj=Qo({properties:{ariaActiveDescendant:null,ariaAtomic:er,ariaAutoComplete:null,ariaBusy:er,ariaChecked:er,ariaColCount:Ce,ariaColIndex:Ce,ariaColSpan:Ce,ariaControls:Et,ariaCurrent:null,ariaDescribedBy:Et,ariaDetails:null,ariaDisabled:er,ariaDropEffect:Et,ariaErrorMessage:null,ariaExpanded:er,ariaFlowTo:Et,ariaGrabbed:er,ariaHasPopup:null,ariaHidden:er,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Et,ariaLevel:Ce,ariaLive:null,ariaModal:er,ariaMultiLine:er,ariaMultiSelectable:er,ariaOrientation:null,ariaOwns:Et,ariaPlaceholder:null,ariaPosInSet:Ce,ariaPressed:er,ariaReadOnly:er,ariaRelevant:null,ariaRequired:er,ariaRoleDescription:Et,ariaRowCount:Ce,ariaRowIndex:Ce,ariaRowSpan:Ce,ariaSelected:er,ariaSetSize:Ce,ariaSort:null,ariaValueMax:Ce,ariaValueMin:Ce,ariaValueNow:Ce,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function $j(e,t){return t in e?e[t]:t}function zj(e,t){return $j(e,t.toLowerCase())}const u8=Qo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:To,acceptCharset:Et,accessKey:Et,action:null,allow:null,allowFullScreen:ot,allowPaymentRequest:ot,allowUserMedia:ot,alt:null,as:null,async:ot,autoCapitalize:null,autoComplete:Et,autoFocus:ot,autoPlay:ot,blocking:Et,capture:null,charSet:null,checked:ot,cite:null,className:Et,cols:Ce,colSpan:null,content:null,contentEditable:er,controls:ot,controlsList:Et,coords:Ce|To,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ot,defer:ot,dir:null,dirName:null,disabled:ot,download:Jm,draggable:er,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ot,formTarget:null,headers:Et,height:Ce,hidden:Jm,high:Ce,href:null,hrefLang:null,htmlFor:Et,httpEquiv:Et,id:null,imageSizes:null,imageSrcSet:null,inert:ot,inputMode:null,integrity:null,is:null,isMap:ot,itemId:null,itemProp:Et,itemRef:Et,itemScope:ot,itemType:Et,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ot,low:Ce,manifest:null,max:null,maxLength:Ce,media:null,method:null,min:null,minLength:Ce,multiple:ot,muted:ot,name:null,nonce:null,noModule:ot,noValidate:ot,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ot,optimum:Ce,pattern:null,ping:Et,placeholder:null,playsInline:ot,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ot,referrerPolicy:null,rel:Et,required:ot,reversed:ot,rows:Ce,rowSpan:Ce,sandbox:Et,scope:null,scoped:ot,seamless:ot,selected:ot,shadowRootClonable:ot,shadowRootDelegatesFocus:ot,shadowRootMode:null,shape:null,size:Ce,sizes:null,slot:null,span:Ce,spellCheck:er,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ce,step:null,style:null,tabIndex:Ce,target:null,title:null,translate:null,type:null,typeMustMatch:ot,useMap:null,value:er,width:Ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Et,axis:null,background:null,bgColor:null,border:Ce,borderColor:null,bottomMargin:Ce,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ot,declare:ot,event:null,face:null,frame:null,frameBorder:null,hSpace:Ce,leftMargin:Ce,link:null,longDesc:null,lowSrc:null,marginHeight:Ce,marginWidth:Ce,noResize:ot,noHref:ot,noShade:ot,noWrap:ot,object:null,profile:null,prompt:null,rev:null,rightMargin:Ce,rules:null,scheme:null,scrolling:er,standby:null,summary:null,text:null,topMargin:Ce,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ce,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ot,disableRemotePlayback:ot,prefix:null,property:null,results:Ce,security:null,unselectable:null},space:"html",transform:zj}),d8=Qo({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:nn,accentHeight:Ce,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ce,amplitude:Ce,arabicForm:null,ascent:Ce,attributeName:null,attributeType:null,azimuth:Ce,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ce,by:null,calcMode:null,capHeight:Ce,className:Et,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ce,diffuseConstant:Ce,direction:null,display:null,dur:null,divisor:Ce,dominantBaseline:null,download:ot,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ce,enableBackground:null,end:null,event:null,exponent:Ce,externalResourcesRequired:null,fill:null,fillOpacity:Ce,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:To,g2:To,glyphName:To,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ce,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ce,horizOriginX:Ce,horizOriginY:Ce,id:null,ideographic:Ce,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ce,k:Ce,k1:Ce,k2:Ce,k3:Ce,k4:Ce,kernelMatrix:nn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ce,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ce,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ce,overlineThickness:Ce,paintOrder:null,panose1:null,path:null,pathLength:Ce,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Et,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ce,pointsAtY:Ce,pointsAtZ:Ce,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:nn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:nn,rev:nn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:nn,requiredFeatures:nn,requiredFonts:nn,requiredFormats:nn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ce,specularExponent:Ce,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ce,strikethroughThickness:Ce,string:null,stroke:null,strokeDashArray:nn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ce,strokeOpacity:Ce,strokeWidth:null,style:null,surfaceScale:Ce,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:nn,tabIndex:Ce,tableValues:null,target:null,targetX:Ce,targetY:Ce,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:nn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ce,underlineThickness:Ce,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ce,values:null,vAlphabetic:Ce,vMathematical:Ce,vectorEffect:null,vHanging:Ce,vIdeographic:Ce,version:null,vertAdvY:Ce,vertOriginX:Ce,vertOriginY:Ce,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ce,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:$j}),Hj=Qo({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Wj=Qo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:zj}),Vj=Qo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),h8={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},f8=/[A-Z]/g,Qb=/-[a-z]/g,m8=/^data[-\w.:]+$/i;function p8(e,t){const r=Xm(t);let s=t,o=Jr;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&m8.test(t)){if(t.charAt(4)==="-"){const u=t.slice(5).replace(Qb,x8);s="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=t.slice(4);if(!Qb.test(u)){let d=u.replace(f8,g8);d.charAt(0)!=="-"&&(d="-"+d),t="data"+d}}o=Ig}return new o(s,t)}function g8(e){return"-"+e.toLowerCase()}function x8(e){return e.charAt(1).toUpperCase()}const v8=Bj([Fj,u8,Hj,Wj,Vj],"html"),Og=Bj([Fj,d8,Hj,Wj,Vj],"svg");function y8(e){return e.join(" ").trim()}var wo={},Zf,Zb;function b8(){if(Zb)return Zf;Zb=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
570
570
  `,f="/",m="*",h="",x="comment",w="declaration";function k(v,b){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];b=b||{};var g=1,y=1;function j(Y){var z=Y.match(t);z&&(g+=z.length);var K=Y.lastIndexOf(c);y=~K?Y.length-K:y+Y.length}function E(){var Y={line:g,column:y};return function(z){return z.position=new P(Y),R(),z}}function P(Y){this.start=Y,this.end={line:g,column:y},this.source=b.source}P.prototype.content=v;function T(Y){var z=new Error(b.source+":"+g+":"+y+": "+Y);if(z.reason=Y,z.filename=b.source,z.line=g,z.column=y,z.source=v,!b.silent)throw z}function N(Y){var z=Y.exec(v);if(z){var K=z[0];return j(K),v=v.slice(K.length),z}}function R(){N(r)}function I(Y){var z;for(Y=Y||[];z=O();)z!==!1&&Y.push(z);return Y}function O(){var Y=E();if(!(f!=v.charAt(0)||m!=v.charAt(1))){for(var z=2;h!=v.charAt(z)&&(m!=v.charAt(z)||f!=v.charAt(z+1));)++z;if(z+=2,h===v.charAt(z-1))return T("End of comment missing");var K=v.slice(2,z-2);return y+=2,j(K),v=v.slice(z),y+=2,Y({type:x,comment:K})}}function $(){var Y=E(),z=N(s);if(z){if(O(),!N(o))return T("property missing ':'");var K=N(u),G=Y({type:w,property:_(z[0].replace(e,h)),value:K?_(K[0].replace(e,h)):h});return N(d),G}}function W(){var Y=[];I(Y);for(var z;z=$();)z!==!1&&(Y.push(z),I(Y));return Y}return R(),W()}function _(v){return v?v.replace(l,h):h}return Zf=k,Zf}var ew;function w8(){if(ew)return wo;ew=1;var e=wo&&wo.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(wo,"__esModule",{value:!0}),wo.default=r;const t=e(b8());function r(s,o){let u=null;if(!s||typeof s!="string")return u;const d=(0,t.default)(s),l=typeof o=="function";return d.forEach(c=>{if(c.type!=="declaration")return;const{property:f,value:m}=c;l?o(f,m,c):m&&(u=u||{},u[f]=m)}),u}return wo}var Oa={},tw;function _8(){if(tw)return Oa;tw=1,Object.defineProperty(Oa,"__esModule",{value:!0}),Oa.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,u=function(f){return!f||r.test(f)||e.test(f)},d=function(f,m){return m.toUpperCase()},l=function(f,m){return"".concat(m,"-")},c=function(f,m){return m===void 0&&(m={}),u(f)?f:(f=f.toLowerCase(),m.reactCompat?f=f.replace(o,l):f=f.replace(s,l),f.replace(t,d))};return Oa.camelCase=c,Oa}var Ba,rw;function S8(){if(rw)return Ba;rw=1;var e=Ba&&Ba.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(w8()),r=_8();function s(o,u){var d={};return!o||typeof o!="string"||(0,t.default)(o,function(l,c){l&&c&&(d[(0,r.camelCase)(l,u)]=c)}),d}return s.default=s,Ba=s,Ba}var C8=S8();const k8=ml(C8),Uj=Gj("end"),Bg=Gj("start");function Gj(e){return t;function t(r){const s=r&&r.position&&r.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function j8(e){const t=Bg(e),r=Uj(e);if(t&&r)return{start:t,end:r}}function Ja(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?nw(e.position):"start"in e||"end"in e?nw(e):"line"in e||"column"in e?Zm(e):""}function Zm(e){return sw(e&&e.line)+":"+sw(e&&e.column)}function nw(e){return Zm(e&&e.start)+"-"+Zm(e&&e.end)}function sw(e){return e&&typeof e=="number"?e:1}class Dr extends Error{constructor(t,r,s){super(),typeof r=="string"&&(s=r,r=void 0);let o="",u={},d=!1;if(r&&("line"in r&&"column"in r?u={place:r}:"start"in r&&"end"in r?u={place:r}:"type"in r?u={ancestors:[r],place:r.position}:u={...r}),typeof t=="string"?o=t:!u.cause&&t&&(d=!0,o=t.message,u.cause=t),!u.ruleId&&!u.source&&typeof s=="string"){const c=s.indexOf(":");c===-1?u.ruleId=s:(u.source=s.slice(0,c),u.ruleId=s.slice(c+1))}if(!u.place&&u.ancestors&&u.ancestors){const c=u.ancestors[u.ancestors.length-1];c&&(u.place=c.position)}const l=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=l?l.line:void 0,this.name=Ja(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=d&&u.cause&&typeof u.cause.stack=="string"?u.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Dr.prototype.file="";Dr.prototype.name="";Dr.prototype.reason="";Dr.prototype.message="";Dr.prototype.stack="";Dr.prototype.column=void 0;Dr.prototype.line=void 0;Dr.prototype.ancestors=void 0;Dr.prototype.cause=void 0;Dr.prototype.fatal=void 0;Dr.prototype.place=void 0;Dr.prototype.ruleId=void 0;Dr.prototype.source=void 0;const Fg={}.hasOwnProperty,N8=new Map,E8=/[A-Z]/g,P8=new Set(["table","tbody","thead","tfoot","tr"]),A8=new Set(["td","th"]),Kj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function T8(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=F8(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=B8(r,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Og:v8,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},u=qj(o,e,void 0);return u&&typeof u!="string"?u:o.create(e,o.Fragment,{children:u||void 0},void 0)}function qj(e,t,r){if(t.type==="element")return R8(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return M8(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return L8(e,t,r);if(t.type==="mdxjsEsm")return D8(e,t);if(t.type==="root")return I8(e,t,r);if(t.type==="text")return O8(e,t)}function R8(e,t,r){const s=e.schema;let o=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(o=Og,e.schema=o),e.ancestors.push(t);const u=Xj(e,t.tagName,!1),d=$8(e,t);let l=zg(e,t);return P8.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!l8(c):!0})),Yj(e,d,u,t),$g(d,l),e.ancestors.pop(),e.schema=s,e.create(t,u,d,r)}function M8(e,t){if(t.data&&t.data.estree&&e.evaluater){const s=t.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}fl(e,t.position)}function D8(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);fl(e,t.position)}function L8(e,t,r){const s=e.schema;let o=s;t.name==="svg"&&s.space==="html"&&(o=Og,e.schema=o),e.ancestors.push(t);const u=t.name===null?e.Fragment:Xj(e,t.name,!0),d=z8(e,t),l=zg(e,t);return Yj(e,d,u,t),$g(d,l),e.ancestors.pop(),e.schema=s,e.create(t,u,d,r)}function I8(e,t,r){const s={};return $g(s,zg(e,t)),e.create(t,e.Fragment,s,r)}function O8(e,t){return t.value}function Yj(e,t,r,s){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=s)}function $g(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function B8(e,t,r){return s;function s(o,u,d,l){const f=Array.isArray(d.children)?r:t;return l?f(u,d,l):f(u,d)}}function F8(e,t){return r;function r(s,o,u,d){const l=Array.isArray(u.children),c=Bg(s);return t(o,u,d,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function $8(e,t){const r={};let s,o;for(o in t.properties)if(o!=="children"&&Fg.call(t.properties,o)){const u=H8(e,o,t.properties[o]);if(u){const[d,l]=u;e.tableCellAlignToStyle&&d==="align"&&typeof l=="string"&&A8.has(t.tagName)?s=l:r[d]=l}}if(s){const u=r.style||(r.style={});u[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return r}function z8(e,t){const r={};for(const s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const u=s.data.estree.body[0];u.type;const d=u.expression;d.type;const l=d.properties[0];l.type,Object.assign(r,e.evaluater.evaluateExpression(l.argument))}else fl(e,t.position);else{const o=s.name;let u;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const l=s.value.data.estree.body[0];l.type,u=e.evaluater.evaluateExpression(l.expression)}else fl(e,t.position);else u=s.value===null?!0:s.value;r[o]=u}return r}function zg(e,t){const r=[];let s=-1;const o=e.passKeys?new Map:N8;for(;++s<t.children.length;){const u=t.children[s];let d;if(e.passKeys){const c=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(c){const f=o.get(c)||0;d=c+"-"+f,o.set(c,f+1)}}const l=qj(e,u,d);l!==void 0&&r.push(l)}return r}function H8(e,t,r){const s=p8(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=s.commaSeparated?n8(r):y8(r)),s.property==="style"){let o=typeof r=="object"?r:W8(e,String(r));return e.stylePropertyNameCase==="css"&&(o=V8(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&s.space?h8[s.property]||s.property:s.attribute,r]}}function W8(e,t){try{return k8(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const s=r,o=new Dr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=Kj+"#cannot-parse-style-attribute",o}}function Xj(e,t,r){let s;if(!r)s={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let u=-1,d;for(;++u<o.length;){const l=Yb(o[u])?{type:"Identifier",name:o[u]}:{type:"Literal",value:o[u]};d=d?{type:"MemberExpression",object:d,property:l,computed:!!(u&&l.type==="Literal"),optional:!1}:l}s=d}else s=Yb(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){const o=s.value;return Fg.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(s);fl(e)}function fl(e,t){const r=new Dr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=Kj+"#cannot-handle-mdx-estrees-without-createevaluater",r}function V8(e){const t={};let r;for(r in e)Fg.call(e,r)&&(t[U8(r)]=e[r]);return t}function U8(e){let t=e.replace(E8,G8);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function G8(e){return"-"+e.toLowerCase()}const em={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},K8={};function q8(e,t){const r=K8,s=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,o=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return Jj(e,s,o)}function Jj(e,t,r){if(Y8(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return iw(e.children,t,r)}return Array.isArray(e)?iw(e,t,r):""}function iw(e,t,r){const s=[];let o=-1;for(;++o<e.length;)s[o]=Jj(e[o],t,r);return s.join("")}function Y8(e){return!!(e&&typeof e=="object")}const ow=document.createElement("i");function Hg(e){const t="&"+e+";";ow.innerHTML=t;const r=ow.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function os(e,t,r,s){const o=e.length;let u=0,d;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,r=r>0?r:0,s.length<1e4)d=Array.from(s),d.unshift(t,r),e.splice(...d);else for(r&&e.splice(t,r);u<s.length;)d=s.slice(u,u+1e4),d.unshift(t,0),e.splice(...d),u+=1e4,t+=1e4}function _n(e,t){return e.length>0?(os(e,e.length,0,t),e):t}const aw={}.hasOwnProperty;function X8(e){const t={};let r=-1;for(;++r<e.length;)J8(t,e[r]);return t}function J8(e,t){let r;for(r in t){const o=(aw.call(e,r)?e[r]:void 0)||(e[r]={}),u=t[r];let d;if(u)for(d in u){aw.call(o,d)||(o[d]=[]);const l=u[d];Q8(o[d],Array.isArray(l)?l:l?[l]:[])}}}function Q8(e,t){let r=-1;const s=[];for(;++r<t.length;)(t[r].add==="after"?e:s).push(t[r]);os(e,0,0,s)}function Qj(e,t){const r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function Ro(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Jn=fi(/[A-Za-z]/),ln=fi(/[\dA-Za-z]/),Z8=fi(/[#-'*+\--9=?A-Z^-~]/);function ep(e){return e!==null&&(e<32||e===127)}const tp=fi(/\d/),e7=fi(/[\dA-Fa-f]/),t7=fi(/[!-/:-@[-`{-~]/);function nt(e){return e!==null&&e<-2}function Yr(e){return e!==null&&(e<0||e===32)}function vt(e){return e===-2||e===-1||e===32}const r7=fi(new RegExp("\\p{P}|\\p{S}","u")),n7=fi(/\s/);function fi(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Zo(e){const t=[];let r=-1,s=0,o=0;for(;++r<e.length;){const u=e.charCodeAt(r);let d="";if(u===37&&ln(e.charCodeAt(r+1))&&ln(e.charCodeAt(r+2)))o=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(d=String.fromCharCode(u));else if(u>55295&&u<57344){const l=e.charCodeAt(r+1);u<56320&&l>56319&&l<57344?(d=String.fromCharCode(u,l),o=1):d="�"}else d=String.fromCharCode(u);d&&(t.push(e.slice(s,r),encodeURIComponent(d)),s=r+o+1,d=""),o&&(r+=o,o=0)}return t.join("")+e.slice(s)}function At(e,t,r,s){const o=s?s-1:Number.POSITIVE_INFINITY;let u=0;return d;function d(c){return vt(c)?(e.enter(r),l(c)):t(c)}function l(c){return vt(c)&&u++<o?(e.consume(c),l):(e.exit(r),t(c))}}const s7={tokenize:i7};function i7(e){const t=e.attempt(this.parser.constructs.contentInitial,s,o);let r;return t;function s(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),At(e,t,"linePrefix")}function o(l){return e.enter("paragraph"),u(l)}function u(l){const c=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=c),r=c,d(l)}function d(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return nt(l)?(e.consume(l),e.exit("chunkText"),u):(e.consume(l),d)}}const o7={tokenize:a7},lw={tokenize:l7};function a7(e){const t=this,r=[];let s=0,o,u,d;return l;function l(y){if(s<r.length){const j=r[s];return t.containerState=j[1],e.attempt(j[0].continuation,c,f)(y)}return f(y)}function c(y){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&g();const j=t.events.length;let E=j,P;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){P=t.events[E][1].end;break}b(s);let T=j;for(;T<t.events.length;)t.events[T][1].end={...P},T++;return os(t.events,E+1,0,t.events.slice(j)),t.events.length=T,f(y)}return l(y)}function f(y){if(s===r.length){if(!o)return x(y);if(o.currentConstruct&&o.currentConstruct.concrete)return k(y);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(lw,m,h)(y)}function m(y){return o&&g(),b(s),x(y)}function h(y){return t.parser.lazy[t.now().line]=s!==r.length,d=t.now().offset,k(y)}function x(y){return t.containerState={},e.attempt(lw,w,k)(y)}function w(y){return s++,r.push([t.currentConstruct,t.containerState]),x(y)}function k(y){if(y===null){o&&g(),b(0),e.consume(y);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:u}),_(y)}function _(y){if(y===null){v(e.exit("chunkFlow"),!0),b(0),e.consume(y);return}return nt(y)?(e.consume(y),v(e.exit("chunkFlow")),s=0,t.interrupt=void 0,l):(e.consume(y),_)}function v(y,j){const E=t.sliceStream(y);if(j&&E.push(null),y.previous=u,u&&(u.next=y),u=y,o.defineSkip(y.start),o.write(E),t.parser.lazy[y.start.line]){let P=o.events.length;for(;P--;)if(o.events[P][1].start.offset<d&&(!o.events[P][1].end||o.events[P][1].end.offset>d))return;const T=t.events.length;let N=T,R,I;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(R){I=t.events[N][1].end;break}R=!0}for(b(s),P=T;P<t.events.length;)t.events[P][1].end={...I},P++;os(t.events,N+1,0,t.events.slice(T)),t.events.length=P}}function b(y){let j=r.length;for(;j-- >y;){const E=r[j];t.containerState=E[1],E[0].exit.call(t,e)}r.length=y}function g(){o.write([null]),u=void 0,o=void 0,t.containerState._closeFlow=void 0}}function l7(e,t,r){return At(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function cw(e){if(e===null||Yr(e)||n7(e))return 1;if(r7(e))return 2}function Wg(e,t,r){const s=[];let o=-1;for(;++o<e.length;){const u=e[o].resolveAll;u&&!s.includes(u)&&(t=u(t,r),s.push(u))}return t}const rp={name:"attention",resolveAll:c7,tokenize:u7};function c7(e,t){let r=-1,s,o,u,d,l,c,f,m;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(s=r;s--;)if(e[s][0]==="exit"&&e[s][1].type==="attentionSequence"&&e[s][1]._open&&t.sliceSerialize(e[s][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[s][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[s][1].end.offset-e[s][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;c=e[s][1].end.offset-e[s][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const h={...e[s][1].end},x={...e[r][1].start};uw(h,-c),uw(x,c),d={type:c>1?"strongSequence":"emphasisSequence",start:h,end:{...e[s][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:x},u={type:c>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[r][1].start}},o={type:c>1?"strong":"emphasis",start:{...d.start},end:{...l.end}},e[s][1].end={...d.start},e[r][1].start={...l.end},f=[],e[s][1].end.offset-e[s][1].start.offset&&(f=_n(f,[["enter",e[s][1],t],["exit",e[s][1],t]])),f=_n(f,[["enter",o,t],["enter",d,t],["exit",d,t],["enter",u,t]]),f=_n(f,Wg(t.parser.constructs.insideSpan.null,e.slice(s+1,r),t)),f=_n(f,[["exit",u,t],["enter",l,t],["exit",l,t],["exit",o,t]]),e[r][1].end.offset-e[r][1].start.offset?(m=2,f=_n(f,[["enter",e[r][1],t],["exit",e[r][1],t]])):m=0,os(e,s-1,r-s+3,f),r=s+f.length-m-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function u7(e,t){const r=this.parser.constructs.attentionMarkers.null,s=this.previous,o=cw(s);let u;return d;function d(c){return u=c,e.enter("attentionSequence"),l(c)}function l(c){if(c===u)return e.consume(c),l;const f=e.exit("attentionSequence"),m=cw(c),h=!m||m===2&&o||r.includes(c),x=!o||o===2&&m||r.includes(s);return f._open=!!(u===42?h:h&&(o||!x)),f._close=!!(u===42?x:x&&(m||!h)),t(c)}}function uw(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const d7={name:"autolink",tokenize:h7};function h7(e,t,r){let s=0;return o;function o(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(w){return Jn(w)?(e.consume(w),d):w===64?r(w):f(w)}function d(w){return w===43||w===45||w===46||ln(w)?(s=1,l(w)):f(w)}function l(w){return w===58?(e.consume(w),s=0,c):(w===43||w===45||w===46||ln(w))&&s++<32?(e.consume(w),l):(s=0,f(w))}function c(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):w===null||w===32||w===60||ep(w)?r(w):(e.consume(w),c)}function f(w){return w===64?(e.consume(w),m):Z8(w)?(e.consume(w),f):r(w)}function m(w){return ln(w)?h(w):r(w)}function h(w){return w===46?(e.consume(w),s=0,m):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):x(w)}function x(w){if((w===45||ln(w))&&s++<63){const k=w===45?x:h;return e.consume(w),k}return r(w)}}const Ad={partial:!0,tokenize:f7};function f7(e,t,r){return s;function s(u){return vt(u)?At(e,o,"linePrefix")(u):o(u)}function o(u){return u===null||nt(u)?t(u):r(u)}}const Zj={continuation:{tokenize:p7},exit:g7,name:"blockQuote",tokenize:m7};function m7(e,t,r){const s=this;return o;function o(d){if(d===62){const l=s.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),u}return r(d)}function u(d){return vt(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(d))}}function p7(e,t,r){const s=this;return o;function o(d){return vt(d)?At(e,u,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):u(d)}function u(d){return e.attempt(Zj,t,r)(d)}}function g7(e){e.exit("blockQuote")}const e2={name:"characterEscape",tokenize:x7};function x7(e,t,r){return s;function s(u){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(u),e.exit("escapeMarker"),o}function o(u){return t7(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(u)}}const t2={name:"characterReference",tokenize:v7};function v7(e,t,r){const s=this;let o=0,u,d;return l;function l(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),c}function c(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),u=31,d=ln,m(h))}function f(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),u=6,d=e7,m):(e.enter("characterReferenceValue"),u=7,d=tp,m(h))}function m(h){if(h===59&&o){const x=e.exit("characterReferenceValue");return d===ln&&!Hg(s.sliceSerialize(x))?r(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return d(h)&&o++<u?(e.consume(h),m):r(h)}}const dw={partial:!0,tokenize:b7},hw={concrete:!0,name:"codeFenced",tokenize:y7};function y7(e,t,r){const s=this,o={partial:!0,tokenize:E};let u=0,d=0,l;return c;function c(P){return f(P)}function f(P){const T=s.events[s.events.length-1];return u=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,l=P,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(P)}function m(P){return P===l?(d++,e.consume(P),m):d<3?r(P):(e.exit("codeFencedFenceSequence"),vt(P)?At(e,h,"whitespace")(P):h(P))}function h(P){return P===null||nt(P)?(e.exit("codeFencedFence"),s.interrupt?t(P):e.check(dw,_,j)(P)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(P))}function x(P){return P===null||nt(P)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(P)):vt(P)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),At(e,w,"whitespace")(P)):P===96&&P===l?r(P):(e.consume(P),x)}function w(P){return P===null||nt(P)?h(P):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(P))}function k(P){return P===null||nt(P)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(P)):P===96&&P===l?r(P):(e.consume(P),k)}function _(P){return e.attempt(o,j,v)(P)}function v(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),b}function b(P){return u>0&&vt(P)?At(e,g,"linePrefix",u+1)(P):g(P)}function g(P){return P===null||nt(P)?e.check(dw,_,j)(P):(e.enter("codeFlowValue"),y(P))}function y(P){return P===null||nt(P)?(e.exit("codeFlowValue"),g(P)):(e.consume(P),y)}function j(P){return e.exit("codeFenced"),t(P)}function E(P,T,N){let R=0;return I;function I(z){return P.enter("lineEnding"),P.consume(z),P.exit("lineEnding"),O}function O(z){return P.enter("codeFencedFence"),vt(z)?At(P,$,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):$(z)}function $(z){return z===l?(P.enter("codeFencedFenceSequence"),W(z)):N(z)}function W(z){return z===l?(R++,P.consume(z),W):R>=d?(P.exit("codeFencedFenceSequence"),vt(z)?At(P,Y,"whitespace")(z):Y(z)):N(z)}function Y(z){return z===null||nt(z)?(P.exit("codeFencedFence"),T(z)):N(z)}}}function b7(e,t,r){const s=this;return o;function o(d){return d===null?r(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u)}function u(d){return s.parser.lazy[s.now().line]?r(d):t(d)}}const tm={name:"codeIndented",tokenize:_7},w7={partial:!0,tokenize:S7};function _7(e,t,r){const s=this;return o;function o(f){return e.enter("codeIndented"),At(e,u,"linePrefix",5)(f)}function u(f){const m=s.events[s.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?d(f):r(f)}function d(f){return f===null?c(f):nt(f)?e.attempt(w7,d,c)(f):(e.enter("codeFlowValue"),l(f))}function l(f){return f===null||nt(f)?(e.exit("codeFlowValue"),d(f)):(e.consume(f),l)}function c(f){return e.exit("codeIndented"),t(f)}}function S7(e,t,r){const s=this;return o;function o(d){return s.parser.lazy[s.now().line]?r(d):nt(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),o):At(e,u,"linePrefix",5)(d)}function u(d){const l=s.events[s.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(d):nt(d)?o(d):r(d)}}const C7={name:"codeText",previous:j7,resolve:k7,tokenize:N7};function k7(e){let t=e.length-4,r=3,s,o;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(s=r;++s<t;)if(e[s][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(s=r-1,t++;++s<=t;)o===void 0?s!==t&&e[s][1].type!=="lineEnding"&&(o=s):(s===t||e[s][1].type==="lineEnding")&&(e[o][1].type="codeTextData",s!==o+2&&(e[o][1].end=e[s-1][1].end,e.splice(o+2,s-o-2),t-=s-o-2,s=o+2),o=void 0);return e}function j7(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function N7(e,t,r){let s=0,o,u;return d;function d(h){return e.enter("codeText"),e.enter("codeTextSequence"),l(h)}function l(h){return h===96?(e.consume(h),s++,l):(e.exit("codeTextSequence"),c(h))}function c(h){return h===null?r(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),c):h===96?(u=e.enter("codeTextSequence"),o=0,m(h)):nt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("codeTextData"),f(h))}function f(h){return h===null||h===32||h===96||nt(h)?(e.exit("codeTextData"),c(h)):(e.consume(h),f)}function m(h){return h===96?(e.consume(h),o++,m):o===s?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(u.type="codeTextData",f(h))}}class E7{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){const s=r??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(t,s):t>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(t,r,s){const o=r||0;this.setCursor(Math.trunc(t));const u=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return s&&Fa(this.left,s),u.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Fa(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Fa(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const r=this.left.splice(t,Number.POSITIVE_INFINITY);Fa(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Fa(this.left,r.reverse())}}}function Fa(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function r2(e){const t={};let r=-1,s,o,u,d,l,c,f;const m=new E7(e);for(;++r<m.length;){for(;r in t;)r=t[r];if(s=m.get(r),r&&s[1].type==="chunkFlow"&&m.get(r-1)[1].type==="listItemPrefix"&&(c=s[1]._tokenizer.events,u=0,u<c.length&&c[u][1].type==="lineEndingBlank"&&(u+=2),u<c.length&&c[u][1].type==="content"))for(;++u<c.length&&c[u][1].type!=="content";)c[u][1].type==="chunkText"&&(c[u][1]._isInFirstContentOfListItem=!0,u++);if(s[0]==="enter")s[1].contentType&&(Object.assign(t,P7(m,r)),r=t[r],f=!0);else if(s[1]._container){for(u=r,o=void 0;u--;)if(d=m.get(u),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(o&&(m.get(o)[1].type="lineEndingBlank"),d[1].type="lineEnding",o=u);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;o&&(s[1].end={...m.get(o)[1].start},l=m.slice(o,r),l.unshift(s),m.splice(o,r-o+1,l))}}return os(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!f}function P7(e,t){const r=e.get(t)[1],s=e.get(t)[2];let o=t-1;const u=[];let d=r._tokenizer;d||(d=s.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const l=d.events,c=[],f={};let m,h,x=-1,w=r,k=0,_=0;const v=[_];for(;w;){for(;e.get(++o)[1]!==w;);u.push(o),w._tokenizer||(m=s.sliceStream(w),w.next||m.push(null),h&&d.defineSkip(w.start),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(m),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),h=w,w=w.next}for(w=r;++x<l.length;)l[x][0]==="exit"&&l[x-1][0]==="enter"&&l[x][1].type===l[x-1][1].type&&l[x][1].start.line!==l[x][1].end.line&&(_=x+1,v.push(_),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(d.events=[],w?(w._tokenizer=void 0,w.previous=void 0):v.pop(),x=v.length;x--;){const b=l.slice(v[x],v[x+1]),g=u.pop();c.push([g,g+b.length-1]),e.splice(g,2,b)}for(c.reverse(),x=-1;++x<c.length;)f[k+c[x][0]]=k+c[x][1],k+=c[x][1]-c[x][0]-1;return f}const A7={resolve:R7,tokenize:M7},T7={partial:!0,tokenize:D7};function R7(e){return r2(e),e}function M7(e,t){let r;return s;function s(l){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),o(l)}function o(l){return l===null?u(l):nt(l)?e.check(T7,d,u)(l):(e.consume(l),o)}function u(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function d(l){return e.consume(l),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,o}}function D7(e,t,r){const s=this;return o;function o(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),At(e,u,"linePrefix")}function u(d){if(d===null||nt(d))return r(d);const l=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(d):e.interrupt(s.parser.constructs.flow,r,t)(d)}}function n2(e,t,r,s,o,u,d,l,c){const f=c||Number.POSITIVE_INFINITY;let m=0;return h;function h(b){return b===60?(e.enter(s),e.enter(o),e.enter(u),e.consume(b),e.exit(u),x):b===null||b===32||b===41||ep(b)?r(b):(e.enter(s),e.enter(d),e.enter(l),e.enter("chunkString",{contentType:"string"}),_(b))}function x(b){return b===62?(e.enter(u),e.consume(b),e.exit(u),e.exit(o),e.exit(s),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),w(b))}function w(b){return b===62?(e.exit("chunkString"),e.exit(l),x(b)):b===null||b===60||nt(b)?r(b):(e.consume(b),b===92?k:w)}function k(b){return b===60||b===62||b===92?(e.consume(b),w):w(b)}function _(b){return!m&&(b===null||b===41||Yr(b))?(e.exit("chunkString"),e.exit(l),e.exit(d),e.exit(s),t(b)):m<f&&b===40?(e.consume(b),m++,_):b===41?(e.consume(b),m--,_):b===null||b===32||b===40||ep(b)?r(b):(e.consume(b),b===92?v:_)}function v(b){return b===40||b===41||b===92?(e.consume(b),_):_(b)}}function s2(e,t,r,s,o,u){const d=this;let l=0,c;return f;function f(w){return e.enter(s),e.enter(o),e.consume(w),e.exit(o),e.enter(u),m}function m(w){return l>999||w===null||w===91||w===93&&!c||w===94&&!l&&"_hiddenFootnoteSupport"in d.parser.constructs?r(w):w===93?(e.exit(u),e.enter(o),e.consume(w),e.exit(o),e.exit(s),t):nt(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),h(w))}function h(w){return w===null||w===91||w===93||nt(w)||l++>999?(e.exit("chunkString"),m(w)):(e.consume(w),c||(c=!vt(w)),w===92?x:h)}function x(w){return w===91||w===92||w===93?(e.consume(w),l++,h):h(w)}}function i2(e,t,r,s,o,u){let d;return l;function l(x){return x===34||x===39||x===40?(e.enter(s),e.enter(o),e.consume(x),e.exit(o),d=x===40?41:x,c):r(x)}function c(x){return x===d?(e.enter(o),e.consume(x),e.exit(o),e.exit(s),t):(e.enter(u),f(x))}function f(x){return x===d?(e.exit(u),c(d)):x===null?r(x):nt(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),At(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===d||x===null||nt(x)?(e.exit("chunkString"),f(x)):(e.consume(x),x===92?h:m)}function h(x){return x===d||x===92?(e.consume(x),m):m(x)}}function Qa(e,t){let r;return s;function s(o){return nt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r=!0,s):vt(o)?At(e,s,r?"linePrefix":"lineSuffix")(o):t(o)}}const L7={name:"definition",tokenize:O7},I7={partial:!0,tokenize:B7};function O7(e,t,r){const s=this;let o;return u;function u(w){return e.enter("definition"),d(w)}function d(w){return s2.call(s,e,l,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function l(w){return o=Ro(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),c):r(w)}function c(w){return Yr(w)?Qa(e,f)(w):f(w)}function f(w){return n2(e,m,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function m(w){return e.attempt(I7,h,h)(w)}function h(w){return vt(w)?At(e,x,"whitespace")(w):x(w)}function x(w){return w===null||nt(w)?(e.exit("definition"),s.parser.defined.push(o),t(w)):r(w)}}function B7(e,t,r){return s;function s(l){return Yr(l)?Qa(e,o)(l):r(l)}function o(l){return i2(e,u,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function u(l){return vt(l)?At(e,d,"whitespace")(l):d(l)}function d(l){return l===null||nt(l)?t(l):r(l)}}const F7={name:"hardBreakEscape",tokenize:$7};function $7(e,t,r){return s;function s(u){return e.enter("hardBreakEscape"),e.consume(u),o}function o(u){return nt(u)?(e.exit("hardBreakEscape"),t(u)):r(u)}}const z7={name:"headingAtx",resolve:H7,tokenize:W7};function H7(e,t){let r=e.length-2,s=3,o,u;return e[s][1].type==="whitespace"&&(s+=2),r-2>s&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(s===r-1||r-4>s&&e[r-2][1].type==="whitespace")&&(r-=s+1===r?2:4),r>s&&(o={type:"atxHeadingText",start:e[s][1].start,end:e[r][1].end},u={type:"chunkText",start:e[s][1].start,end:e[r][1].end,contentType:"text"},os(e,s,r-s+1,[["enter",o,t],["enter",u,t],["exit",u,t],["exit",o,t]])),e}function W7(e,t,r){let s=0;return o;function o(m){return e.enter("atxHeading"),u(m)}function u(m){return e.enter("atxHeadingSequence"),d(m)}function d(m){return m===35&&s++<6?(e.consume(m),d):m===null||Yr(m)?(e.exit("atxHeadingSequence"),l(m)):r(m)}function l(m){return m===35?(e.enter("atxHeadingSequence"),c(m)):m===null||nt(m)?(e.exit("atxHeading"),t(m)):vt(m)?At(e,l,"whitespace")(m):(e.enter("atxHeadingText"),f(m))}function c(m){return m===35?(e.consume(m),c):(e.exit("atxHeadingSequence"),l(m))}function f(m){return m===null||m===35||Yr(m)?(e.exit("atxHeadingText"),l(m)):(e.consume(m),f)}}const V7=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],fw=["pre","script","style","textarea"],U7={concrete:!0,name:"htmlFlow",resolveTo:q7,tokenize:Y7},G7={partial:!0,tokenize:J7},K7={partial:!0,tokenize:X7};function q7(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Y7(e,t,r){const s=this;let o,u,d,l,c;return f;function f(F){return m(F)}function m(F){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(F),h}function h(F){return F===33?(e.consume(F),x):F===47?(e.consume(F),u=!0,_):F===63?(e.consume(F),o=3,s.interrupt?t:M):Jn(F)?(e.consume(F),d=String.fromCharCode(F),v):r(F)}function x(F){return F===45?(e.consume(F),o=2,w):F===91?(e.consume(F),o=5,l=0,k):Jn(F)?(e.consume(F),o=4,s.interrupt?t:M):r(F)}function w(F){return F===45?(e.consume(F),s.interrupt?t:M):r(F)}function k(F){const oe="CDATA[";return F===oe.charCodeAt(l++)?(e.consume(F),l===oe.length?s.interrupt?t:$:k):r(F)}function _(F){return Jn(F)?(e.consume(F),d=String.fromCharCode(F),v):r(F)}function v(F){if(F===null||F===47||F===62||Yr(F)){const oe=F===47,fe=d.toLowerCase();return!oe&&!u&&fw.includes(fe)?(o=1,s.interrupt?t(F):$(F)):V7.includes(d.toLowerCase())?(o=6,oe?(e.consume(F),b):s.interrupt?t(F):$(F)):(o=7,s.interrupt&&!s.parser.lazy[s.now().line]?r(F):u?g(F):y(F))}return F===45||ln(F)?(e.consume(F),d+=String.fromCharCode(F),v):r(F)}function b(F){return F===62?(e.consume(F),s.interrupt?t:$):r(F)}function g(F){return vt(F)?(e.consume(F),g):I(F)}function y(F){return F===47?(e.consume(F),I):F===58||F===95||Jn(F)?(e.consume(F),j):vt(F)?(e.consume(F),y):I(F)}function j(F){return F===45||F===46||F===58||F===95||ln(F)?(e.consume(F),j):E(F)}function E(F){return F===61?(e.consume(F),P):vt(F)?(e.consume(F),E):y(F)}function P(F){return F===null||F===60||F===61||F===62||F===96?r(F):F===34||F===39?(e.consume(F),c=F,T):vt(F)?(e.consume(F),P):N(F)}function T(F){return F===c?(e.consume(F),c=null,R):F===null||nt(F)?r(F):(e.consume(F),T)}function N(F){return F===null||F===34||F===39||F===47||F===60||F===61||F===62||F===96||Yr(F)?E(F):(e.consume(F),N)}function R(F){return F===47||F===62||vt(F)?y(F):r(F)}function I(F){return F===62?(e.consume(F),O):r(F)}function O(F){return F===null||nt(F)?$(F):vt(F)?(e.consume(F),O):r(F)}function $(F){return F===45&&o===2?(e.consume(F),K):F===60&&o===1?(e.consume(F),G):F===62&&o===4?(e.consume(F),B):F===63&&o===3?(e.consume(F),M):F===93&&o===5?(e.consume(F),L):nt(F)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(G7,q,W)(F)):F===null||nt(F)?(e.exit("htmlFlowData"),W(F)):(e.consume(F),$)}function W(F){return e.check(K7,Y,q)(F)}function Y(F){return e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),z}function z(F){return F===null||nt(F)?W(F):(e.enter("htmlFlowData"),$(F))}function K(F){return F===45?(e.consume(F),M):$(F)}function G(F){return F===47?(e.consume(F),d="",U):$(F)}function U(F){if(F===62){const oe=d.toLowerCase();return fw.includes(oe)?(e.consume(F),B):$(F)}return Jn(F)&&d.length<8?(e.consume(F),d+=String.fromCharCode(F),U):$(F)}function L(F){return F===93?(e.consume(F),M):$(F)}function M(F){return F===62?(e.consume(F),B):F===45&&o===2?(e.consume(F),M):$(F)}function B(F){return F===null||nt(F)?(e.exit("htmlFlowData"),q(F)):(e.consume(F),B)}function q(F){return e.exit("htmlFlow"),t(F)}}function X7(e,t,r){const s=this;return o;function o(d){return nt(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):r(d)}function u(d){return s.parser.lazy[s.now().line]?r(d):t(d)}}function J7(e,t,r){return s;function s(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Ad,t,r)}}const Q7={name:"htmlText",tokenize:Z7};function Z7(e,t,r){const s=this;let o,u,d;return l;function l(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),c}function c(M){return M===33?(e.consume(M),f):M===47?(e.consume(M),E):M===63?(e.consume(M),y):Jn(M)?(e.consume(M),N):r(M)}function f(M){return M===45?(e.consume(M),m):M===91?(e.consume(M),u=0,k):Jn(M)?(e.consume(M),g):r(M)}function m(M){return M===45?(e.consume(M),w):r(M)}function h(M){return M===null?r(M):M===45?(e.consume(M),x):nt(M)?(d=h,G(M)):(e.consume(M),h)}function x(M){return M===45?(e.consume(M),w):h(M)}function w(M){return M===62?K(M):M===45?x(M):h(M)}function k(M){const B="CDATA[";return M===B.charCodeAt(u++)?(e.consume(M),u===B.length?_:k):r(M)}function _(M){return M===null?r(M):M===93?(e.consume(M),v):nt(M)?(d=_,G(M)):(e.consume(M),_)}function v(M){return M===93?(e.consume(M),b):_(M)}function b(M){return M===62?K(M):M===93?(e.consume(M),b):_(M)}function g(M){return M===null||M===62?K(M):nt(M)?(d=g,G(M)):(e.consume(M),g)}function y(M){return M===null?r(M):M===63?(e.consume(M),j):nt(M)?(d=y,G(M)):(e.consume(M),y)}function j(M){return M===62?K(M):y(M)}function E(M){return Jn(M)?(e.consume(M),P):r(M)}function P(M){return M===45||ln(M)?(e.consume(M),P):T(M)}function T(M){return nt(M)?(d=T,G(M)):vt(M)?(e.consume(M),T):K(M)}function N(M){return M===45||ln(M)?(e.consume(M),N):M===47||M===62||Yr(M)?R(M):r(M)}function R(M){return M===47?(e.consume(M),K):M===58||M===95||Jn(M)?(e.consume(M),I):nt(M)?(d=R,G(M)):vt(M)?(e.consume(M),R):K(M)}function I(M){return M===45||M===46||M===58||M===95||ln(M)?(e.consume(M),I):O(M)}function O(M){return M===61?(e.consume(M),$):nt(M)?(d=O,G(M)):vt(M)?(e.consume(M),O):R(M)}function $(M){return M===null||M===60||M===61||M===62||M===96?r(M):M===34||M===39?(e.consume(M),o=M,W):nt(M)?(d=$,G(M)):vt(M)?(e.consume(M),$):(e.consume(M),Y)}function W(M){return M===o?(e.consume(M),o=void 0,z):M===null?r(M):nt(M)?(d=W,G(M)):(e.consume(M),W)}function Y(M){return M===null||M===34||M===39||M===60||M===61||M===96?r(M):M===47||M===62||Yr(M)?R(M):(e.consume(M),Y)}function z(M){return M===47||M===62||Yr(M)?R(M):r(M)}function K(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):r(M)}function G(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),U}function U(M){return vt(M)?At(e,L,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):L(M)}function L(M){return e.enter("htmlTextData"),d(M)}}const Vg={name:"labelEnd",resolveAll:n9,resolveTo:s9,tokenize:i9},e9={tokenize:o9},t9={tokenize:a9},r9={tokenize:l9};function n9(e){let t=-1;const r=[];for(;++t<e.length;){const s=e[t][1];if(r.push(e[t]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const o=s.type==="labelImage"?4:2;s.type="data",t+=o}}return e.length!==r.length&&os(e,0,e.length,r),e}function s9(e,t){let r=e.length,s=0,o,u,d,l;for(;r--;)if(o=e[r][1],u){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[r][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(d){if(e[r][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(u=r,o.type!=="labelLink")){s=2;break}}else o.type==="labelEnd"&&(d=r);const c={type:e[u][1].type==="labelLink"?"link":"image",start:{...e[u][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[u][1].start},end:{...e[d][1].end}},m={type:"labelText",start:{...e[u+s+2][1].end},end:{...e[d-2][1].start}};return l=[["enter",c,t],["enter",f,t]],l=_n(l,e.slice(u+1,u+s+3)),l=_n(l,[["enter",m,t]]),l=_n(l,Wg(t.parser.constructs.insideSpan.null,e.slice(u+s+4,d-3),t)),l=_n(l,[["exit",m,t],e[d-2],e[d-1],["exit",f,t]]),l=_n(l,e.slice(d+1)),l=_n(l,[["exit",c,t]]),os(e,u,e.length,l),e}function i9(e,t,r){const s=this;let o=s.events.length,u,d;for(;o--;)if((s.events[o][1].type==="labelImage"||s.events[o][1].type==="labelLink")&&!s.events[o][1]._balanced){u=s.events[o][1];break}return l;function l(x){return u?u._inactive?h(x):(d=s.parser.defined.includes(Ro(s.sliceSerialize({start:u.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),c):r(x)}function c(x){return x===40?e.attempt(e9,m,d?m:h)(x):x===91?e.attempt(t9,m,d?f:h)(x):d?m(x):h(x)}function f(x){return e.attempt(r9,m,h)(x)}function m(x){return t(x)}function h(x){return u._balanced=!0,r(x)}}function o9(e,t,r){return s;function s(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),o}function o(h){return Yr(h)?Qa(e,u)(h):u(h)}function u(h){return h===41?m(h):n2(e,d,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function d(h){return Yr(h)?Qa(e,c)(h):m(h)}function l(h){return r(h)}function c(h){return h===34||h===39||h===40?i2(e,f,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):m(h)}function f(h){return Yr(h)?Qa(e,m)(h):m(h)}function m(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):r(h)}}function a9(e,t,r){const s=this;return o;function o(l){return s2.call(s,e,u,d,"reference","referenceMarker","referenceString")(l)}function u(l){return s.parser.defined.includes(Ro(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(l):r(l)}function d(l){return r(l)}}function l9(e,t,r){return s;function s(u){return e.enter("reference"),e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),o}function o(u){return u===93?(e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),e.exit("reference"),t):r(u)}}const c9={name:"labelStartImage",resolveAll:Vg.resolveAll,tokenize:u9};function u9(e,t,r){const s=this;return o;function o(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),u}function u(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),d):r(l)}function d(l){return l===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(l):t(l)}}const d9={name:"labelStartLink",resolveAll:Vg.resolveAll,tokenize:h9};function h9(e,t,r){const s=this;return o;function o(d){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelLink"),u}function u(d){return d===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(d):t(d)}}const rm={name:"lineEnding",tokenize:f9};function f9(e,t){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),At(e,t,"linePrefix")}}const gu={name:"thematicBreak",tokenize:m9};function m9(e,t,r){let s=0,o;return u;function u(f){return e.enter("thematicBreak"),d(f)}function d(f){return o=f,l(f)}function l(f){return f===o?(e.enter("thematicBreakSequence"),c(f)):s>=3&&(f===null||nt(f))?(e.exit("thematicBreak"),t(f)):r(f)}function c(f){return f===o?(e.consume(f),s++,c):(e.exit("thematicBreakSequence"),vt(f)?At(e,l,"whitespace")(f):l(f))}}const Ur={continuation:{tokenize:v9},exit:b9,name:"list",tokenize:x9},p9={partial:!0,tokenize:w9},g9={partial:!0,tokenize:y9};function x9(e,t,r){const s=this,o=s.events[s.events.length-1];let u=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,d=0;return l;function l(w){const k=s.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!s.containerState.marker||w===s.containerState.marker:tp(w)){if(s.containerState.type||(s.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(gu,r,f)(w):f(w);if(!s.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(w)}return r(w)}function c(w){return tp(w)&&++d<10?(e.consume(w),c):(!s.interrupt||d<2)&&(s.containerState.marker?w===s.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),f(w)):r(w)}function f(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||w,e.check(Ad,s.interrupt?r:m,e.attempt(p9,x,h))}function m(w){return s.containerState.initialBlankLine=!0,u++,x(w)}function h(w){return vt(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),x):r(w)}function x(w){return s.containerState.size=u+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(w)}}function v9(e,t,r){const s=this;return s.containerState._closeFlow=void 0,e.check(Ad,o,u);function o(l){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,At(e,t,"listItemIndent",s.containerState.size+1)(l)}function u(l){return s.containerState.furtherBlankLines||!vt(l)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,d(l)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(g9,t,d)(l))}function d(l){return s.containerState._closeFlow=!0,s.interrupt=void 0,At(e,e.attempt(Ur,t,r),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function y9(e,t,r){const s=this;return At(e,o,"listItemIndent",s.containerState.size+1);function o(u){const d=s.events[s.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===s.containerState.size?t(u):r(u)}}function b9(e){e.exit(this.containerState.type)}function w9(e,t,r){const s=this;return At(e,o,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(u){const d=s.events[s.events.length-1];return!vt(u)&&d&&d[1].type==="listItemPrefixWhitespace"?t(u):r(u)}}const mw={name:"setextUnderline",resolveTo:_9,tokenize:S9};function _9(e,t){let r=e.length,s,o,u;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){s=r;break}e[r][1].type==="paragraph"&&(o=r)}else e[r][1].type==="content"&&e.splice(r,1),!u&&e[r][1].type==="definition"&&(u=r);const d={type:"setextHeading",start:{...e[s][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",u?(e.splice(o,0,["enter",d,t]),e.splice(u+1,0,["exit",e[s][1],t]),e[s][1].end={...e[u][1].end}):e[s][1]=d,e.push(["exit",d,t]),e}function S9(e,t,r){const s=this;let o;return u;function u(f){let m=s.events.length,h;for(;m--;)if(s.events[m][1].type!=="lineEnding"&&s.events[m][1].type!=="linePrefix"&&s.events[m][1].type!=="content"){h=s.events[m][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||h)?(e.enter("setextHeadingLine"),o=f,d(f)):r(f)}function d(f){return e.enter("setextHeadingLineSequence"),l(f)}function l(f){return f===o?(e.consume(f),l):(e.exit("setextHeadingLineSequence"),vt(f)?At(e,c,"lineSuffix")(f):c(f))}function c(f){return f===null||nt(f)?(e.exit("setextHeadingLine"),t(f)):r(f)}}const C9={tokenize:k9};function k9(e){const t=this,r=e.attempt(Ad,s,e.attempt(this.parser.constructs.flowInitial,o,At(e,e.attempt(this.parser.constructs.flow,o,e.attempt(A7,o)),"linePrefix")));return r;function s(u){if(u===null){e.consume(u);return}return e.enter("lineEndingBlank"),e.consume(u),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function o(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const j9={resolveAll:a2()},N9=o2("string"),E9=o2("text");function o2(e){return{resolveAll:a2(e==="text"?P9:void 0),tokenize:t};function t(r){const s=this,o=this.parser.constructs[e],u=r.attempt(o,d,l);return d;function d(m){return f(m)?u(m):l(m)}function l(m){if(m===null){r.consume(m);return}return r.enter("data"),r.consume(m),c}function c(m){return f(m)?(r.exit("data"),u(m)):(r.consume(m),c)}function f(m){if(m===null)return!0;const h=o[m];let x=-1;if(h)for(;++x<h.length;){const w=h[x];if(!w.previous||w.previous.call(s,s.previous))return!0}return!1}}}function a2(e){return t;function t(r,s){let o=-1,u;for(;++o<=r.length;)u===void 0?r[o]&&r[o][1].type==="data"&&(u=o,o++):(!r[o]||r[o][1].type!=="data")&&(o!==u+2&&(r[u][1].end=r[o-1][1].end,r.splice(u+2,o-u-2),o=u+2),u=void 0);return e?e(r,s):r}}function P9(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const s=e[r-1][1],o=t.sliceStream(s);let u=o.length,d=-1,l=0,c;for(;u--;){const f=o[u];if(typeof f=="string"){for(d=f.length;f.charCodeAt(d-1)===32;)l++,d--;if(d)break;d=-1}else if(f===-2)c=!0,l++;else if(f!==-1){u++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(l=0),l){const f={type:r===e.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:u?d:s.start._bufferIndex+d,_index:s.start._index+u,line:s.end.line,column:s.end.column-l,offset:s.end.offset-l},end:{...s.end}};s.end={...f.start},s.start.offset===s.end.offset?Object.assign(s,f):(e.splice(r,0,["enter",f,t],["exit",f,t]),r+=2)}r++}return e}const A9={42:Ur,43:Ur,45:Ur,48:Ur,49:Ur,50:Ur,51:Ur,52:Ur,53:Ur,54:Ur,55:Ur,56:Ur,57:Ur,62:Zj},T9={91:L7},R9={[-2]:tm,[-1]:tm,32:tm},M9={35:z7,42:gu,45:[mw,gu],60:U7,61:mw,95:gu,96:hw,126:hw},D9={38:t2,92:e2},L9={[-5]:rm,[-4]:rm,[-3]:rm,33:c9,38:t2,42:rp,60:[d7,Q7],91:d9,92:[F7,e2],93:Vg,95:rp,96:C7},I9={null:[rp,j9]},O9={null:[42,95]},B9={null:[]},F9=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:O9,contentInitial:T9,disable:B9,document:A9,flow:M9,flowInitial:R9,insideSpan:I9,string:D9,text:L9},Symbol.toStringTag,{value:"Module"}));function $9(e,t,r){let s={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const o={},u=[];let d=[],l=[];const c={attempt:T(E),check:T(P),consume:g,enter:y,exit:j,interrupt:T(P,{interrupt:!0})},f={code:null,containerState:{},defineSkip:_,events:[],now:k,parser:e,previous:null,sliceSerialize:x,sliceStream:w,write:h};let m=t.tokenize.call(f,c);return t.resolveAll&&u.push(t),f;function h(O){return d=_n(d,O),v(),d[d.length-1]!==null?[]:(N(t,0),f.events=Wg(u,f.events,f),f.events)}function x(O,$){return H9(w(O),$)}function w(O){return z9(d,O)}function k(){const{_bufferIndex:O,_index:$,line:W,column:Y,offset:z}=s;return{_bufferIndex:O,_index:$,line:W,column:Y,offset:z}}function _(O){o[O.line]=O.column,I()}function v(){let O;for(;s._index<d.length;){const $=d[s._index];if(typeof $=="string")for(O=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===O&&s._bufferIndex<$.length;)b($.charCodeAt(s._bufferIndex));else b($)}}function b(O){m=m(O)}function g(O){nt(O)?(s.line++,s.column=1,s.offset+=O===-3?2:1,I()):O!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===d[s._index].length&&(s._bufferIndex=-1,s._index++)),f.previous=O}function y(O,$){const W=$||{};return W.type=O,W.start=k(),f.events.push(["enter",W,f]),l.push(W),W}function j(O){const $=l.pop();return $.end=k(),f.events.push(["exit",$,f]),$}function E(O,$){N(O,$.from)}function P(O,$){$.restore()}function T(O,$){return W;function W(Y,z,K){let G,U,L,M;return Array.isArray(Y)?q(Y):"tokenize"in Y?q([Y]):B(Y);function B(me){return X;function X(H){const ae=H!==null&&me[H],ne=H!==null&&me.null,J=[...Array.isArray(ae)?ae:ae?[ae]:[],...Array.isArray(ne)?ne:ne?[ne]:[]];return q(J)(H)}}function q(me){return G=me,U=0,me.length===0?K:F(me[U])}function F(me){return X;function X(H){return M=R(),L=me,me.partial||(f.currentConstruct=me),me.name&&f.parser.constructs.disable.null.includes(me.name)?fe():me.tokenize.call($?Object.assign(Object.create(f),$):f,c,oe,fe)(H)}}function oe(me){return O(L,M),z}function fe(me){return M.restore(),++U<G.length?F(G[U]):K}}}function N(O,$){O.resolveAll&&!u.includes(O)&&u.push(O),O.resolve&&os(f.events,$,f.events.length-$,O.resolve(f.events.slice($),f)),O.resolveTo&&(f.events=O.resolveTo(f.events,f))}function R(){const O=k(),$=f.previous,W=f.currentConstruct,Y=f.events.length,z=Array.from(l);return{from:Y,restore:K};function K(){s=O,f.previous=$,f.currentConstruct=W,f.events.length=Y,l=z,I()}}function I(){s.line in o&&s.column<2&&(s.column=o[s.line],s.offset+=o[s.line]-1)}}function z9(e,t){const r=t.start._index,s=t.start._bufferIndex,o=t.end._index,u=t.end._bufferIndex;let d;if(r===o)d=[e[r].slice(s,u)];else{if(d=e.slice(r,o),s>-1){const l=d[0];typeof l=="string"?d[0]=l.slice(s):d.shift()}u>0&&d.push(e[o].slice(0,u))}return d}function H9(e,t){let r=-1;const s=[];let o;for(;++r<e.length;){const u=e[r];let d;if(typeof u=="string")d=u;else switch(u){case-5:{d="\r";break}case-4:{d=`
571
571
  `;break}case-3:{d=`\r
572
572
  `;break}case-2:{d=t?" ":" ";break}case-1:{if(!t&&o)continue;d=" ";break}default:d=String.fromCharCode(u)}o=u===-2,s.push(d)}return s.join("")}function W9(e){const s={constructs:X8([F9,...(e||{}).extensions||[]]),content:o(s7),defined:[],document:o(o7),flow:o(C9),lazy:{},string:o(N9),text:o(E9)};return s;function o(u){return d;function d(l){return $9(s,u,l)}}}function V9(e){for(;!r2(e););return e}const pw=/[\0\t\n\r]/g;function U9(){let e=1,t="",r=!0,s;return o;function o(u,d,l){const c=[];let f,m,h,x,w;for(u=t+(typeof u=="string"?u.toString():new TextDecoder(d||void 0).decode(u)),h=0,t="",r&&(u.charCodeAt(0)===65279&&h++,r=void 0);h<u.length;){if(pw.lastIndex=h,f=pw.exec(u),x=f&&f.index!==void 0?f.index:u.length,w=u.charCodeAt(x),!f){t=u.slice(h);break}if(w===10&&h===x&&s)c.push(-3),s=void 0;else switch(s&&(c.push(-5),s=void 0),h<x&&(c.push(u.slice(h,x)),e+=x-h),w){case 0:{c.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,c.push(-2);e++<m;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:s=!0,e=1}h=x+1}return l&&(s&&c.push(-5),t&&c.push(t),c.push(null)),c}}const G9=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function K9(e){return e.replace(G9,q9)}function q9(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const o=r.charCodeAt(1),u=o===120||o===88;return Qj(r.slice(u?2:1),u?16:10)}return Hg(r)||e}const l2={}.hasOwnProperty;function Y9(e,t,r){return typeof t!="string"&&(r=t,t=void 0),X9(r)(V9(W9(r).document().write(U9()(e,t,!0))))}function X9(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(Re),autolinkProtocol:R,autolinkEmail:R,atxHeading:u(Ve),blockQuote:u(ne),characterEscape:R,characterReference:R,codeFenced:u(J),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:u(J,d),codeText:u(ie,d),codeTextData:R,data:R,codeFlowValue:R,definition:u(ye),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:u(Oe),hardBreakEscape:u(te),hardBreakTrailing:u(te),htmlFlow:u(de,d),htmlFlowData:R,htmlText:u(de,d),htmlTextData:R,image:u(De),label:d,link:u(Re),listItem:u(Se),listItemValue:x,listOrdered:u(Ze,h),listUnordered:u(Ze),paragraph:u(ge),reference:F,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:u(Ve),strong:u(Me),thematicBreak:u(Rt)},exit:{atxHeading:c(),atxHeadingSequence:E,autolink:c(),autolinkEmail:ae,autolinkProtocol:H,blockQuote:c(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:me,characterReference:X,codeFenced:c(v),codeFencedFence:_,codeFencedFenceInfo:w,codeFencedFenceMeta:k,codeFlowValue:I,codeIndented:c(b),codeText:c(z),codeTextData:I,data:I,definition:c(),definitionDestinationString:j,definitionLabelString:g,definitionTitleString:y,emphasis:c(),hardBreakEscape:c($),hardBreakTrailing:c($),htmlFlow:c(W),htmlFlowData:I,htmlText:c(Y),htmlTextData:I,image:c(G),label:L,labelText:U,lineEnding:O,link:c(K),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:oe,resourceDestinationString:M,resourceTitleString:B,resource:q,setextHeading:c(N),setextHeadingLineSequence:T,setextHeadingText:P,strong:c(),thematicBreak:c()}};c2(t,(e||{}).mdastExtensions||[]);const r={};return s;function s(pe){let be={type:"root",children:[]};const Be={stack:[be],tokenStack:[],config:t,enter:l,exit:f,buffer:d,resume:m,data:r},Ge=[];let Ke=-1;for(;++Ke<pe.length;)if(pe[Ke][1].type==="listOrdered"||pe[Ke][1].type==="listUnordered")if(pe[Ke][0]==="enter")Ge.push(Ke);else{const bt=Ge.pop();Ke=o(pe,bt,Ke)}for(Ke=-1;++Ke<pe.length;){const bt=t[pe[Ke][0]];l2.call(bt,pe[Ke][1].type)&&bt[pe[Ke][1].type].call(Object.assign({sliceSerialize:pe[Ke][2].sliceSerialize},Be),pe[Ke][1])}if(Be.tokenStack.length>0){const bt=Be.tokenStack[Be.tokenStack.length-1];(bt[1]||gw).call(Be,void 0,bt[0])}for(be.position={start:Xs(pe.length>0?pe[0][1].start:{line:1,column:1,offset:0}),end:Xs(pe.length>0?pe[pe.length-2][1].end:{line:1,column:1,offset:0})},Ke=-1;++Ke<t.transforms.length;)be=t.transforms[Ke](be)||be;return be}function o(pe,be,Be){let Ge=be-1,Ke=-1,bt=!1,Z,Pe,Le,st;for(;++Ge<=Be;){const et=pe[Ge];switch(et[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{et[0]==="enter"?Ke++:Ke--,st=void 0;break}case"lineEndingBlank":{et[0]==="enter"&&(Z&&!st&&!Ke&&!Le&&(Le=Ge),st=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:st=void 0}if(!Ke&&et[0]==="enter"&&et[1].type==="listItemPrefix"||Ke===-1&&et[0]==="exit"&&(et[1].type==="listUnordered"||et[1].type==="listOrdered")){if(Z){let jt=Ge;for(Pe=void 0;jt--;){const ft=pe[jt];if(ft[1].type==="lineEnding"||ft[1].type==="lineEndingBlank"){if(ft[0]==="exit")continue;Pe&&(pe[Pe][1].type="lineEndingBlank",bt=!0),ft[1].type="lineEnding",Pe=jt}else if(!(ft[1].type==="linePrefix"||ft[1].type==="blockQuotePrefix"||ft[1].type==="blockQuotePrefixWhitespace"||ft[1].type==="blockQuoteMarker"||ft[1].type==="listItemIndent"))break}Le&&(!Pe||Le<Pe)&&(Z._spread=!0),Z.end=Object.assign({},Pe?pe[Pe][1].start:et[1].end),pe.splice(Pe||Ge,0,["exit",Z,et[2]]),Ge++,Be++}if(et[1].type==="listItemPrefix"){const jt={type:"listItem",_spread:!1,start:Object.assign({},et[1].start),end:void 0};Z=jt,pe.splice(Ge,0,["enter",jt,et[2]]),Ge++,Be++,Le=void 0,st=!0}}}return pe[be][1]._spread=bt,Be}function u(pe,be){return Be;function Be(Ge){l.call(this,pe(Ge),Ge),be&&be.call(this,Ge)}}function d(){this.stack.push({type:"fragment",children:[]})}function l(pe,be,Be){this.stack[this.stack.length-1].children.push(pe),this.stack.push(pe),this.tokenStack.push([be,Be||void 0]),pe.position={start:Xs(be.start),end:void 0}}function c(pe){return be;function be(Be){pe&&pe.call(this,Be),f.call(this,Be)}}function f(pe,be){const Be=this.stack.pop(),Ge=this.tokenStack.pop();if(Ge)Ge[0].type!==pe.type&&(be?be.call(this,pe,Ge[0]):(Ge[1]||gw).call(this,pe,Ge[0]));else throw new Error("Cannot close `"+pe.type+"` ("+Ja({start:pe.start,end:pe.end})+"): it’s not open");Be.position.end=Xs(pe.end)}function m(){return q8(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function x(pe){if(this.data.expectingFirstListItemValue){const be=this.stack[this.stack.length-2];be.start=Number.parseInt(this.sliceSerialize(pe),10),this.data.expectingFirstListItemValue=void 0}}function w(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.lang=pe}function k(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.meta=pe}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.value=pe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.value=pe.replace(/(\r?\n|\r)$/g,"")}function g(pe){const be=this.resume(),Be=this.stack[this.stack.length-1];Be.label=be,Be.identifier=Ro(this.sliceSerialize(pe)).toLowerCase()}function y(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.title=pe}function j(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.url=pe}function E(pe){const be=this.stack[this.stack.length-1];if(!be.depth){const Be=this.sliceSerialize(pe).length;be.depth=Be}}function P(){this.data.setextHeadingSlurpLineEnding=!0}function T(pe){const be=this.stack[this.stack.length-1];be.depth=this.sliceSerialize(pe).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function R(pe){const Be=this.stack[this.stack.length-1].children;let Ge=Be[Be.length-1];(!Ge||Ge.type!=="text")&&(Ge=ht(),Ge.position={start:Xs(pe.start),end:void 0},Be.push(Ge)),this.stack.push(Ge)}function I(pe){const be=this.stack.pop();be.value+=this.sliceSerialize(pe),be.position.end=Xs(pe.end)}function O(pe){const be=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Be=be.children[be.children.length-1];Be.position.end=Xs(pe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(be.type)&&(R.call(this,pe),I.call(this,pe))}function $(){this.data.atHardBreak=!0}function W(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.value=pe}function Y(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.value=pe}function z(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.value=pe}function K(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=be,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function G(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const be=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=be,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function U(pe){const be=this.sliceSerialize(pe),Be=this.stack[this.stack.length-2];Be.label=K9(be),Be.identifier=Ro(be).toLowerCase()}function L(){const pe=this.stack[this.stack.length-1],be=this.resume(),Be=this.stack[this.stack.length-1];if(this.data.inReference=!0,Be.type==="link"){const Ge=pe.children;Be.children=Ge}else Be.alt=be}function M(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.url=pe}function B(){const pe=this.resume(),be=this.stack[this.stack.length-1];be.title=pe}function q(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function oe(pe){const be=this.resume(),Be=this.stack[this.stack.length-1];Be.label=be,Be.identifier=Ro(this.sliceSerialize(pe)).toLowerCase(),this.data.referenceType="full"}function fe(pe){this.data.characterReferenceType=pe.type}function me(pe){const be=this.sliceSerialize(pe),Be=this.data.characterReferenceType;let Ge;Be?(Ge=Qj(be,Be==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ge=Hg(be);const Ke=this.stack[this.stack.length-1];Ke.value+=Ge}function X(pe){const be=this.stack.pop();be.position.end=Xs(pe.end)}function H(pe){I.call(this,pe);const be=this.stack[this.stack.length-1];be.url=this.sliceSerialize(pe)}function ae(pe){I.call(this,pe);const be=this.stack[this.stack.length-1];be.url="mailto:"+this.sliceSerialize(pe)}function ne(){return{type:"blockquote",children:[]}}function J(){return{type:"code",lang:null,meta:null,value:""}}function ie(){return{type:"inlineCode",value:""}}function ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Oe(){return{type:"emphasis",children:[]}}function Ve(){return{type:"heading",depth:0,children:[]}}function te(){return{type:"break"}}function de(){return{type:"html",value:""}}function De(){return{type:"image",title:null,url:"",alt:null}}function Re(){return{type:"link",title:null,url:"",children:[]}}function Ze(pe){return{type:"list",ordered:pe.type==="listOrdered",start:null,spread:pe._spread,children:[]}}function Se(pe){return{type:"listItem",spread:pe._spread,checked:null,children:[]}}function ge(){return{type:"paragraph",children:[]}}function Me(){return{type:"strong",children:[]}}function ht(){return{type:"text",value:""}}function Rt(){return{type:"thematicBreak"}}}function Xs(e){return{line:e.line,column:e.column,offset:e.offset}}function c2(e,t){let r=-1;for(;++r<t.length;){const s=t[r];Array.isArray(s)?c2(e,s):J9(e,s)}}function J9(e,t){let r;for(r in t)if(l2.call(t,r))switch(r){case"canContainEols":{const s=t[r];s&&e[r].push(...s);break}case"transforms":{const s=t[r];s&&e[r].push(...s);break}case"enter":case"exit":{const s=t[r];s&&Object.assign(e[r],s);break}}}function gw(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ja({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ja({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ja({start:t.start,end:t.end})+") is still open")}function Q9(e){const t=this;t.parser=r;function r(s){return Y9(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Z9(e,t){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function e$(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
@@ -2332,7 +2332,7 @@ When reporting issues, include:
2332
2332
  - Operating system
2333
2333
  - Error messages or logs
2334
2334
  `}},jH={...hH,...fH,...mH,...pH,...gH,...xH,...vH,...yH,...bH,...wH,..._H,...SH,...CH,...kH};function I2(e){let t=e.replace(/```(\w*)\n([\s\S]*?)```/g,(r,s,o)=>`<pre class="bg-zinc-900 text-zinc-100 p-4 rounded-lg overflow-x-auto my-4"><code class="text-sm">${o.replace(/\\\`/g,"`").replace(/</g,"&lt;").replace(/>/g,"&gt;").trim()}</code></pre>`);return t=t.replace(/(\|[^\n]+\|\n\|[-| :]+\|\n(?:\|[^\n]+\|\n?)+)/g,r=>{const s=r.trim().split(`
2335
- `);if(s.length<2)return r;const o=s[0].split("|").filter(d=>d.trim()).map(d=>`<th class="border border-border px-3 py-2 bg-muted font-semibold text-left">${d.trim()}</th>`).join(""),u=s.slice(2).map(d=>`<tr>${d.split("|").filter(c=>c.trim()).map(c=>`<td class="border border-border px-3 py-2">${c.trim()}</td>`).join("")}</tr>`).join("");return`<table class="w-full border-collapse border border-border my-4"><thead><tr>${o}</tr></thead><tbody>${u}</tbody></table>`}),t.replace(/^### (.*$)/gim,'<h3 class="text-lg font-semibold mt-6 mb-2 text-foreground">$1</h3>').replace(/^## (.*$)/gim,'<h2 class="text-xl font-semibold mt-8 mb-4 text-foreground">$1</h2>').replace(/^# (.*$)/gim,'<h1 class="text-2xl font-bold mb-6 text-foreground">$1</h1>').replace(/!\[([^\]]*)\]\(([^)]+)\)/g,'<img src="$2" alt="$1" class="rounded-lg shadow-lg my-4 max-w-full border border-border" />').replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/`([^`]+)`/g,'<code class="bg-muted px-1.5 py-0.5 rounded text-sm font-mono">$1</code>').replace(/^- (.*$)/gim,'<li class="ml-4">$1</li>').replace(/(<li.*<\/li>\n?)+/g,'<ul class="list-disc my-2">$&</ul>').replace(/^\d+\. (.*$)/gim,'<li class="ml-4">$1</li>').replace(/\n\n/g,'</p><p class="my-3 text-foreground">').replace(/\n/g,"<br/>")}function NH(){const[e,t]=C.useState("installation"),[r,s]=C.useState({"getting-started":!0}),o=d=>{s(l=>({...l,[d]:!l[d]}))},u=jH[e];return n.jsxs("div",{className:"flex h-full",children:[n.jsxs("div",{className:"w-64 border-r border-border bg-muted/50 flex flex-col",children:[n.jsx("div",{className:"p-4 border-b border-border",children:n.jsxs("h2",{className:"font-semibold flex items-center gap-2 text-foreground",children:[n.jsx(Li,{className:"w-5 h-5"}),"Documentation"]})}),n.jsx(Nn,{className:"flex-1",children:n.jsx("div",{className:"p-2",children:dH.map(d=>n.jsxs("div",{className:"mb-1",children:[n.jsxs("button",{className:je("w-full flex items-center gap-2 px-3 py-2 text-sm rounded-md hover:bg-accent text-left",(e===d.id||d.subsections.some(l=>l.id===e))&&"bg-accent"),onClick:()=>{d.subsections.length>0?(o(d.id),r[d.id]||t(d.subsections[0].id)):t(d.id)},children:[n.jsx(d.icon,{className:"w-4 h-4 text-muted-foreground"}),n.jsx("span",{className:"flex-1",children:d.title}),d.isNew&&n.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded font-medium bg-green-500/20 text-green-600 dark:text-green-400",children:"new"}),d.subsections.length>0&&n.jsx(Kr,{className:je("w-4 h-4 text-muted-foreground transition-transform",r[d.id]&&"rotate-90")})]}),d.subsections.length>0&&r[d.id]&&n.jsx("div",{className:"ml-6 mt-1 space-y-1",children:d.subsections.map(l=>n.jsx("button",{className:je("w-full text-left px-3 py-1.5 text-sm rounded-md hover:bg-accent text-foreground",e===l.id&&"bg-accent text-primary font-medium"),onClick:()=>t(l.id),children:l.title},l.id))})]},d.id))})})]}),n.jsx("div",{className:"flex-1 overflow-hidden",children:n.jsx(Nn,{className:"h-full",children:n.jsx("div",{className:"max-w-3xl mx-auto p-8",children:u?n.jsx("div",{className:"prose prose-sm max-w-none",children:n.jsx("div",{dangerouslySetInnerHTML:{__html:I2(u.content)}})}):n.jsxs("div",{className:"text-center text-muted-foreground py-12",children:[n.jsx(Li,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),n.jsx("p",{children:"Select a topic from the sidebar"})]})})})})]})}var EH={};const Lw={development:"bg-blue-100 text-blue-700 border-blue-200 dark:bg-blue-900/30 dark:text-blue-400 dark:border-blue-800",productivity:"bg-green-100 text-green-700 border-green-200 dark:bg-green-900/30 dark:text-green-400 dark:border-green-800",integration:"bg-purple-100 text-purple-700 border-purple-200 dark:bg-purple-900/30 dark:text-purple-400 dark:border-purple-800",external:"bg-orange-100 text-orange-700 border-orange-200 dark:bg-orange-900/30 dark:text-orange-400 dark:border-orange-800",lsp:"bg-cyan-100 text-cyan-700 border-cyan-200 dark:bg-cyan-900/30 dark:text-cyan-400 dark:border-cyan-800",default:"bg-gray-100 text-gray-700 border-gray-200 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-700"};function PH(){var ae,ne,J,ie,ye,Oe,Ve;const[e,t]=C.useState(!0),[r,s]=C.useState({allPlugins:[],categories:[],marketplaces:[],enabledPlugins:null}),[o,u]=C.useState(""),[d,l]=C.useState([]),[c,f]=C.useState([]),[m,h]=C.useState(!0),[x,w]=C.useState(!0),[k,_]=C.useState(!0),[v,b]=C.useState(!0),[g,y]=C.useState("name"),[j,E]=C.useState(null),[P,T]=C.useState({open:!1,repo:""}),[N,R]=C.useState(!1),[I,O]=C.useState({open:!1,plugin:null}),[$,W]=C.useState(!1),Y=async()=>{t(!0);try{const te=await ke.getPlugins();s(te)}catch(te){ee.error("Failed to load plugins: "+te.message)}finally{t(!1)}};C.useEffect(()=>{Y()},[]);const z=C.useMemo(()=>{let te=r.allPlugins||[];if(o){const de=o.toLowerCase();te=te.filter(De=>{var Re,Ze,Se;return((Re=De.name)==null?void 0:Re.toLowerCase().includes(de))||((Ze=De.description)==null?void 0:Ze.toLowerCase().includes(de))||((Se=De.category)==null?void 0:Se.toLowerCase().includes(de))})}return te=te.filter(de=>!(de.sourceType==="external"&&!x||de.sourceType==="internal"&&!m)),te=te.filter(de=>!(de.installed&&!k||!de.installed&&!v)),d.length>0&&(te=te.filter(de=>d.includes(de.category))),c.length>0&&(te=te.filter(de=>c.includes(de.marketplace))),te.sort((de,De)=>{if(g==="installed"){if(de.installed&&!De.installed)return-1;if(!de.installed&&De.installed)return 1}if(g==="category"){const Re=(de.category||"zzz").localeCompare(De.category||"zzz");if(Re!==0)return Re}return de.name.localeCompare(De.name)}),te},[r.allPlugins,o,x,m,k,v,d,c,g]),K=te=>{l(de=>de.includes(te)?de.filter(De=>De!==te):[...de,te])},G=te=>{f(de=>de.includes(te)?de.filter(De=>De!==te):[...de,te])},U=async te=>{E(te);try{const de=await ke.refreshMarketplace(te);de.success?(ee.success(`Refreshed ${te}`),await Y()):ee.error(de.error||"Failed to refresh marketplace")}catch(de){ee.error("Failed to refresh: "+de.message)}finally{E(null)}},L=async()=>{if(!P.repo.trim()){ee.error("Please enter a repository URL");return}try{const te=await ke.addMarketplace("",P.repo.trim());te.success?(ee.success("Marketplace added"),T({open:!1,repo:""}),await Y()):ee.error(te.error||"Failed to add marketplace")}catch(te){ee.error("Failed to add marketplace: "+te.message)}},M=async(te,de,De)=>{W(!0);try{const Re=De!==!0,Ze=await ke.setPluginEnabled(te,de,Re);Ze.success?(ee.success(`Plugin ${Re?"enabled":"disabled"} for ${te===EH.HOME?"~":te}`),await Y()):ee.error(Ze.error||"Failed to update plugin state")}catch(Re){ee.error("Failed to update plugin: "+Re.message)}finally{W(!1)}},B=async(te,de)=>{W(!0);try{const De=await ke.setPluginEnabled(te,de,null);De.success?(ee.success("Plugin override removed"),await Y()):ee.error(De.error||"Failed to remove override")}catch(De){ee.error("Failed to update plugin: "+De.message)}finally{W(!1)}},q=te=>{O({open:!0,plugin:te})},F=(r.allPlugins||[]).filter(te=>te.installed).length,oe=(r.allPlugins||[]).filter(te=>!te.installed).length,fe=(r.allPlugins||[]).filter(te=>te.sourceType==="internal").length,me=(r.allPlugins||[]).filter(te=>te.sourceType==="external").length,X=r.marketplaces||[],H=r.categories||[];return e?n.jsx("div",{className:"flex items-center justify-center h-64",children:n.jsx(ut,{className:"w-8 h-8 animate-spin text-primary"})}):n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"bg-indigo-50 dark:bg-indigo-950/30 border border-indigo-200 dark:border-indigo-800 rounded-lg p-4 flex items-start gap-3",children:[n.jsx(Yu,{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400 flex-shrink-0 mt-0.5"}),n.jsxs("div",{className:"text-sm text-indigo-800 dark:text-indigo-300",children:[n.jsx("p",{className:"font-medium",children:"Install plugins from Project Explorer"}),n.jsxs("p",{className:"text-indigo-600 dark:text-indigo-400 mt-1",children:["Use the ",n.jsx("kbd",{className:"px-1.5 py-0.5 bg-indigo-100 dark:bg-indigo-900 rounded text-xs",children:"+"}),' menu on any project and select "Install Plugins" to add plugins with project-level scope control.']})]})]}),n.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[n.jsxs("div",{className:"p-5 border-b border-gray-200 dark:border-slate-700",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2",children:[n.jsx(Fi,{className:"w-5 h-5 text-indigo-600"}),"Plugin Directory",n.jsxs(Qe,{variant:"outline",className:"ml-2 font-normal",children:[z.length," of ",((ae=r.allPlugins)==null?void 0:ae.length)||0]})]}),n.jsx(le,{variant:"ghost",size:"sm",onClick:Y,disabled:e,children:n.jsx(pr,{className:`w-4 h-4 ${e?"animate-spin":""}`})})]}),n.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx(_l,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),n.jsx(ct,{value:o,onChange:te=>u(te.target.value),placeholder:"Search plugins...",className:"pl-9 bg-white dark:bg-slate-900 border-gray-300 dark:border-slate-700"})]}),n.jsxs(fr,{value:g,onValueChange:y,children:[n.jsx(ar,{className:"w-40",children:n.jsx(mr,{placeholder:"Sort by"})}),n.jsxs(lr,{children:[n.jsx(xt,{value:"name",children:"Name"}),n.jsx(xt,{value:"installed",children:"Installed first"}),n.jsx(xt,{value:"category",children:"Category"})]})]})]}),n.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[n.jsxs(ai,{children:[n.jsx(li,{asChild:!0,children:n.jsxs(le,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1",children:[n.jsx(Yc,{className:"w-3 h-3"}),"Marketplace",c.length>0&&n.jsx(Qe,{variant:"secondary",className:"ml-1 h-4 px-1 text-[10px]",children:c.length}),n.jsx(Sr,{className:"w-3 h-3 ml-1"})]})}),n.jsxs(ks,{align:"start",className:"w-56",children:[n.jsx(ul,{className:"text-xs",children:"Filter by marketplace"}),n.jsx(Or,{}),X.length>0?X.map(te=>n.jsx(cl,{checked:c.includes(te.name),onCheckedChange:()=>G(te.name),children:te.name},te.name)):n.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"No marketplaces"}),n.jsx(Or,{}),n.jsxs(Pt,{onClick:()=>R(!0),children:[n.jsx(kn,{className:"w-3 h-3 mr-2"}),"Manage Marketplaces"]}),c.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Or,{}),n.jsx(Pt,{onClick:()=>f([]),children:"Clear filters"})]})]})]}),n.jsxs(ai,{children:[n.jsx(li,{asChild:!0,children:n.jsxs(le,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1",children:[n.jsx(S1,{className:"w-3 h-3"}),"Category",d.length>0&&n.jsx(Qe,{variant:"secondary",className:"ml-1 h-4 px-1 text-[10px]",children:d.length}),n.jsx(Sr,{className:"w-3 h-3 ml-1"})]})}),n.jsxs(ks,{align:"start",className:"w-48",children:[n.jsx(ul,{className:"text-xs",children:"Filter by category"}),n.jsx(Or,{}),H.map(te=>n.jsx(cl,{checked:d.includes(te),onCheckedChange:()=>K(te),children:te},te)),d.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Or,{}),n.jsx(Pt,{onClick:()=>l([]),children:"Clear filters"})]})]})]}),n.jsxs("div",{className:"flex items-center gap-4 text-xs",children:[n.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[n.jsx(dt,{checked:k,onCheckedChange:_,className:"h-4 w-7 data-[state=checked]:bg-green-600"}),n.jsxs("span",{className:"text-gray-600 dark:text-slate-400",children:["Installed (",F,")"]})]}),n.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[n.jsx(dt,{checked:v,onCheckedChange:b,className:"h-4 w-7 data-[state=checked]:bg-blue-600"}),n.jsxs("span",{className:"text-gray-600 dark:text-slate-400",children:["Available (",oe,")"]})]}),n.jsx("span",{className:"text-gray-300 dark:text-slate-600",children:"|"}),n.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[n.jsx(dt,{checked:m,onCheckedChange:h,className:"h-4 w-7 data-[state=checked]:bg-indigo-600"}),n.jsxs("span",{className:"text-gray-600 dark:text-slate-400 flex items-center gap-1",children:[n.jsx(y1,{className:"w-3 h-3"})," Anthropic (",fe,")"]})]}),n.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[n.jsx(dt,{checked:x,onCheckedChange:w,className:"h-4 w-7 data-[state=checked]:bg-orange-600"}),n.jsxs("span",{className:"text-gray-600 dark:text-slate-400 flex items-center gap-1",children:[n.jsx(Bi,{className:"w-3 h-3"})," Community (",me,")"]})]})]})]})]}),n.jsxs("div",{className:"p-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[z.map((te,de)=>{const De=Lw[te.category]||Lw.default,Re=te.mcpServers?Object.keys(te.mcpServers).length:0,Ze=te.lspServers?Object.keys(te.lspServers).length:0,Se=`${te.name}@${te.marketplace}`,ge=te.enabledState,Me=(ge==null?void 0:ge.merged)===!0;return(ge==null?void 0:ge.merged)!==null&&(ge==null||ge.merged),n.jsxs(Eo.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:Math.min(de*.02,.3)},className:`rounded-lg border p-4 transition-all hover:shadow-md ${Me?"bg-emerald-50 border-emerald-200 dark:bg-emerald-950/20 dark:border-emerald-800":te.installed?"bg-green-50 border-green-200 dark:bg-green-950/20 dark:border-green-800":"bg-white border-gray-200 dark:bg-slate-900 dark:border-slate-700"}`,children:[n.jsxs("div",{className:"flex items-start justify-between mb-2",children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white truncate",children:te.name}),te.sourceType==="external"&&n.jsx(Bi,{className:"w-3.5 h-3.5 text-orange-500 flex-shrink-0",title:"Community plugin"})]}),n.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[te.installed&&n.jsxs(Qe,{variant:"outline",className:"text-green-600 border-green-300 dark:text-green-400 dark:border-green-700 text-[10px]",children:[n.jsx(Kt,{className:"w-2.5 h-2.5 mr-0.5"}),"Installed"]}),Me&&n.jsxs(Qe,{variant:"outline",className:"text-emerald-600 border-emerald-300 dark:text-emerald-400 dark:border-emerald-700 text-[10px]",children:[n.jsx(sb,{className:"w-2.5 h-2.5 mr-0.5"}),"Enabled"]})]})]}),n.jsxs("div",{className:"flex items-center gap-1",children:[te.installed&&n.jsx(zo,{children:n.jsxs(on,{children:[n.jsx(an,{asChild:!0,children:n.jsx(le,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-60 hover:opacity-100",onClick:()=>q(te),children:n.jsx(kn,{className:"w-4 h-4"})})}),n.jsx(qr,{children:n.jsx("p",{children:"Configure per-directory"})})]})}),te.homepage&&n.jsx(le,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-60 hover:opacity-100",onClick:()=>window.open(te.homepage,"_blank"),children:n.jsx(du,{className:"w-4 h-4"})})]})]}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400 mb-3 line-clamp-2",children:te.description||"No description available"}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-2",children:[te.category&&n.jsx(Qe,{variant:"outline",className:`text-[10px] px-1.5 py-0 ${De}`,children:te.category}),te.version&&n.jsxs("span",{className:"text-[10px] text-gray-400 dark:text-slate-500",children:["v",te.version]})]}),(Re>0||Ze>0||te.commands)&&n.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-gray-500 dark:text-slate-500 pt-2 border-t border-gray-100 dark:border-slate-800",children:[Ze>0&&n.jsxs("span",{className:"flex items-center gap-1 bg-cyan-50 dark:bg-cyan-900/20 px-1.5 py-0.5 rounded",children:[n.jsx(ns,{className:"w-3 h-3 text-cyan-600"}),Ze," LSP"]}),Re>0&&n.jsxs("span",{className:"flex items-center gap-1 bg-blue-50 dark:bg-blue-900/20 px-1.5 py-0.5 rounded",children:[n.jsx(Fn,{className:"w-3 h-3 text-blue-600"}),Re," MCP"]}),te.commands&&n.jsxs("span",{className:"flex items-center gap-1 bg-green-50 dark:bg-green-900/20 px-1.5 py-0.5 rounded",children:[n.jsx(Ft,{className:"w-3 h-3 text-green-600"}),"Commands"]})]})]},Se)}),z.length===0&&n.jsxs("div",{className:"col-span-full text-center py-12 text-gray-500 dark:text-slate-400",children:[n.jsx(Fi,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),n.jsx("p",{className:"font-medium",children:"No plugins found"}),n.jsx("p",{className:"text-sm mt-1",children:"Try adjusting your filters or search query"}),(d.length>0||c.length>0||o)&&n.jsx(le,{variant:"link",size:"sm",onClick:()=>{l([]),f([]),u("")},className:"mt-2",children:"Clear all filters"})]})]})]}),n.jsx(Tt,{open:P.open,onOpenChange:te=>T({...P,open:te}),children:n.jsxs(St,{className:"max-w-lg",children:[n.jsxs(Ct,{children:[n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(Yc,{className:"w-5 h-5 text-purple-600"}),"Add Plugin Marketplace"]}),n.jsx(tr,{children:"Add a marketplace from a GitHub repository URL or local path."})]}),n.jsx("div",{className:"space-y-4 py-4",children:n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Repository URL or Path"}),n.jsx(ct,{value:P.repo,onChange:te=>T({...P,repo:te.target.value}),placeholder:"owner/repo or full GitHub URL",className:"mt-1"}),n.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-2",children:"Supported formats:"}),n.jsxs("ul",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1 space-y-1 ml-2",children:[n.jsxs("li",{children:[n.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:"owner/repo"})," — GitHub shorthand"]}),n.jsxs("li",{children:[n.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:"https://github.com/owner/repo"})," — Full URL"]}),n.jsxs("li",{children:[n.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:"/local/path"})," — Local directory"]})]}),n.jsxs("p",{className:"text-xs text-gray-400 dark:text-slate-500 mt-2",children:["Search GitHub for ",n.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:"claude-plugins"})," to find community marketplaces."]})]})}),n.jsxs(It,{children:[n.jsx(le,{variant:"ghost",onClick:()=>T({open:!1,repo:""}),children:"Cancel"}),n.jsxs(le,{onClick:L,className:"bg-purple-600 hover:bg-purple-700 text-white",children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add Marketplace"]})]})]})}),n.jsx(Tt,{open:N,onOpenChange:R,children:n.jsxs(St,{className:"max-w-2xl",children:[n.jsxs(Ct,{children:[n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(Yc,{className:"w-5 h-5 text-purple-600"}),"Plugin Marketplaces",n.jsx(Qe,{variant:"outline",className:"ml-2 font-normal",children:X.length})]}),n.jsx(tr,{children:"Manage your plugin marketplaces. Add external marketplaces to discover more plugins."})]}),n.jsx("div",{className:"py-4",children:X.length>0?n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:X.map(te=>{var De,Re,Ze;const de=(((De=te.plugins)==null?void 0:De.length)||0)+(((Re=te.externalPlugins)==null?void 0:Re.length)||0);return n.jsxs("div",{className:"bg-purple-50 dark:bg-purple-950/20 rounded-lg border border-purple-200 dark:border-purple-800 p-4",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("h3",{className:"font-semibold text-purple-900 dark:text-purple-200",children:te.name}),n.jsx(le,{variant:"ghost",size:"sm",onClick:()=>U(te.name),disabled:j===te.name,className:"h-7 w-7 p-0",children:n.jsx(pr,{className:`w-4 h-4 text-purple-600 dark:text-purple-400 ${j===te.name?"animate-spin":""}`})})]}),n.jsx("p",{className:"text-sm text-purple-700 dark:text-purple-300 mb-2 truncate",children:typeof te.source=="string"?te.source:((Ze=te.source)==null?void 0:Ze.repo)||"Unknown source"}),n.jsxs("div",{className:"flex items-center justify-between text-xs text-purple-600 dark:text-purple-400",children:[n.jsxs("span",{children:[de," plugins"]}),te.lastUpdated&&n.jsxs("span",{children:["Updated: ",new Date(te.lastUpdated).toLocaleDateString()]})]})]},te.name)})}):n.jsxs("div",{className:"text-center py-8 text-gray-500 dark:text-slate-400",children:[n.jsx(Yc,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),n.jsx("p",{children:"No marketplaces configured."}),n.jsx("p",{className:"text-sm mt-1",children:"Add a marketplace to discover plugins."})]})}),n.jsxs(It,{children:[n.jsx(le,{variant:"outline",onClick:()=>R(!1),children:"Close"}),n.jsxs(le,{onClick:()=>{R(!1),T({open:!0,repo:""})},className:"bg-purple-600 hover:bg-purple-700 text-white",children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add Marketplace"]})]})]})}),n.jsx(Tt,{open:I.open,onOpenChange:te=>O({...I,open:te}),children:n.jsxs(St,{className:"max-w-lg",children:[n.jsxs(Ct,{children:[n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(tb,{className:"w-5 h-5 text-emerald-600"}),"Configure Plugin: ",(ne=I.plugin)==null?void 0:ne.name]}),n.jsx(tr,{children:"Enable or disable this plugin for specific directories. Child directories inherit parent settings unless overridden."})]}),n.jsxs("div",{className:"space-y-3 py-4 max-h-[400px] overflow-y-auto",children:[(ye=(ie=(J=I.plugin)==null?void 0:J.enabledState)==null?void 0:ie.perDir)==null?void 0:ye.map((te,de)=>{const De=`${I.plugin.name}@${I.plugin.marketplace}`,Re=te.enabled!==null&&te.enabled!==void 0,Ze=te.enabled===!0,Se=te.enabled===!1;let ge=null;if(!Re&&de>0)for(let Me=de-1;Me>=0;Me--){const ht=I.plugin.enabledState.perDir[Me];if(ht.enabled!==null&&ht.enabled!==void 0){ge=ht.enabled;break}}return n.jsxs("div",{className:`flex items-center justify-between p-3 rounded-lg border ${Ze?"bg-emerald-50 border-emerald-200 dark:bg-emerald-950/30 dark:border-emerald-800":Se?"bg-red-50 border-red-200 dark:bg-red-950/30 dark:border-red-800":"bg-gray-50 border-gray-200 dark:bg-slate-800/50 dark:border-slate-700"}`,children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("code",{className:"text-sm font-mono text-gray-700 dark:text-slate-300 truncate",children:te.label}),!Re&&ge!==null&&n.jsxs(Qe,{variant:"outline",className:"text-[10px] text-gray-500",children:["inherited: ",ge?"on":"off"]})]}),Re&&n.jsx("p",{className:"text-[10px] text-gray-500 dark:text-slate-400 mt-0.5",children:Ze?"Explicitly enabled":"Explicitly disabled"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[Re&&n.jsx(zo,{children:n.jsxs(on,{children:[n.jsx(an,{asChild:!0,children:n.jsx(le,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600",onClick:()=>B(te.dir,De),disabled:$,children:n.jsx(s5,{className:"w-4 h-4"})})}),n.jsx(qr,{children:n.jsx("p",{children:"Remove override (inherit from parent)"})})]})}),n.jsxs("div",{className:"flex items-center gap-1 border rounded-lg overflow-hidden",children:[n.jsx(le,{variant:Ze?"default":"ghost",size:"sm",className:`h-7 px-2 rounded-none ${Ze?"bg-emerald-600 hover:bg-emerald-700 text-white":""}`,onClick:()=>M(te.dir,De,!1),disabled:$||Ze,children:n.jsx(sb,{className:"w-3 h-3"})}),n.jsx(le,{variant:Se?"default":"ghost",size:"sm",className:`h-7 px-2 rounded-none ${Se?"bg-red-600 hover:bg-red-700 text-white":""}`,onClick:()=>M(te.dir,De,!0),disabled:$||Se,children:n.jsx(y5,{className:"w-3 h-3"})})]})]})]},te.dir)}),(!((Ve=(Oe=I.plugin)==null?void 0:Oe.enabledState)!=null&&Ve.perDir)||I.plugin.enabledState.perDir.length===0)&&n.jsxs("div",{className:"text-center py-8 text-gray-500 dark:text-slate-400",children:[n.jsx(tb,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),n.jsx("p",{children:"No config hierarchy found."}),n.jsx("p",{className:"text-sm mt-1",children:"Create a .claude/mcps.json in your project first."})]})]}),n.jsx(It,{children:n.jsx(le,{variant:"ghost",onClick:()=>O({open:!1,plugin:null}),children:"Done"})})]})}),n.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[n.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"Claude Code Plugin Commands"}),n.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-slate-400 font-mono",children:[n.jsx("p",{className:"text-gray-400 dark:text-slate-500",children:"# Add marketplace (one-time)"}),n.jsx("p",{children:"/plugin marketplace add regression-io/coder-config-plugins"}),n.jsx("p",{className:"text-gray-400 dark:text-slate-500 mt-2",children:"# Install plugins from marketplace"}),n.jsx("p",{children:"/plugin install <name>@coder-config-plugins"}),n.jsx("p",{className:"text-gray-400 dark:text-slate-500 mt-2",children:"# Manage plugins"}),n.jsx("p",{children:"/plugin list # List installed"}),n.jsx("p",{children:"/plugin uninstall <name> # Remove plugin"})]})]})]})}function AH({projects:e=[],onWorkstreamChange:t}){var Ke,bt;const[r,s]=C.useState([]),[o,u]=C.useState(!0),[d,l]=C.useState(null),[c,f]=C.useState(!1),[m,h]=C.useState(null),[x,w]=C.useState(!1),[k,_]=C.useState(null),[v,b]=C.useState(new Set),[g,y]=C.useState(""),[j,E]=C.useState(""),[P,T]=C.useState([]),[N,R]=C.useState(!1),[I,O]=C.useState(!1),[$,W]=C.useState({}),[Y,z]=C.useState({}),[K,G]=C.useState({}),[U,L]=C.useState({isInstalled:!1,loading:!0}),[M,B]=C.useState(!1),[q,F]=C.useState(null),[oe,fe]=C.useState([]),[me,X]=C.useState(!1),[H,ae]=C.useState(()=>{try{return JSON.parse(localStorage.getItem("dismissedWorkstreamSuggestions")||"[]")}catch{return[]}});C.useEffect(()=>{Ze(),ne(),J()},[]);const ne=async()=>{try{const Z=await ke.getWorkstreamHookStatus();L({...Z,loading:!1})}catch(Z){L({isInstalled:!1,loading:!1,error:Z.message})}},J=async()=>{try{X(!0);const[Z,Pe]=await Promise.all([ke.getActivitySummary(),ke.getWorkstreamSuggestions()]);F(Z),fe(Pe.suggestions||[])}catch(Z){console.log("Activity data not available:",Z.message)}finally{X(!1)}},ie=Z=>{y(Z.name),T([...Z.projects]),E(`# Auto-generated workstream based on activity patterns
2335
+ `);if(s.length<2)return r;const o=s[0].split("|").filter(d=>d.trim()).map(d=>`<th class="border border-border px-3 py-2 bg-muted font-semibold text-left">${d.trim()}</th>`).join(""),u=s.slice(2).map(d=>`<tr>${d.split("|").filter(c=>c.trim()).map(c=>`<td class="border border-border px-3 py-2">${c.trim()}</td>`).join("")}</tr>`).join("");return`<table class="w-full border-collapse border border-border my-4"><thead><tr>${o}</tr></thead><tbody>${u}</tbody></table>`}),t.replace(/^### (.*$)/gim,'<h3 class="text-lg font-semibold mt-6 mb-2 text-foreground">$1</h3>').replace(/^## (.*$)/gim,'<h2 class="text-xl font-semibold mt-8 mb-4 text-foreground">$1</h2>').replace(/^# (.*$)/gim,'<h1 class="text-2xl font-bold mb-6 text-foreground">$1</h1>').replace(/!\[([^\]]*)\]\(([^)]+)\)/g,'<img src="$2" alt="$1" class="rounded-lg shadow-lg my-4 max-w-full border border-border" />').replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").replace(/`([^`]+)`/g,'<code class="bg-muted px-1.5 py-0.5 rounded text-sm font-mono">$1</code>').replace(/^- (.*$)/gim,'<li class="ml-4">$1</li>').replace(/(<li.*<\/li>\n?)+/g,'<ul class="list-disc my-2">$&</ul>').replace(/^\d+\. (.*$)/gim,'<li class="ml-4">$1</li>').replace(/\n\n/g,'</p><p class="my-3 text-foreground">').replace(/\n/g,"<br/>")}function NH(){const[e,t]=C.useState("installation"),[r,s]=C.useState({"getting-started":!0}),o=d=>{s(l=>({...l,[d]:!l[d]}))},u=jH[e];return n.jsxs("div",{className:"flex h-full",children:[n.jsxs("div",{className:"w-64 border-r border-border bg-muted/50 flex flex-col",children:[n.jsx("div",{className:"p-4 border-b border-border",children:n.jsxs("h2",{className:"font-semibold flex items-center gap-2 text-foreground",children:[n.jsx(Li,{className:"w-5 h-5"}),"Documentation"]})}),n.jsx(Nn,{className:"flex-1",children:n.jsx("div",{className:"p-2",children:dH.map(d=>n.jsxs("div",{className:"mb-1",children:[n.jsxs("button",{className:je("w-full flex items-center gap-2 px-3 py-2 text-sm rounded-md hover:bg-accent text-left",(e===d.id||d.subsections.some(l=>l.id===e))&&"bg-accent"),onClick:()=>{d.subsections.length>0?(o(d.id),r[d.id]||t(d.subsections[0].id)):t(d.id)},children:[n.jsx(d.icon,{className:"w-4 h-4 text-muted-foreground"}),n.jsx("span",{className:"flex-1",children:d.title}),d.isNew&&n.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded font-medium bg-green-500/20 text-green-600 dark:text-green-400",children:"new"}),d.subsections.length>0&&n.jsx(Kr,{className:je("w-4 h-4 text-muted-foreground transition-transform",r[d.id]&&"rotate-90")})]}),d.subsections.length>0&&r[d.id]&&n.jsx("div",{className:"ml-6 mt-1 space-y-1",children:d.subsections.map(l=>n.jsx("button",{className:je("w-full text-left px-3 py-1.5 text-sm rounded-md hover:bg-accent text-foreground",e===l.id&&"bg-accent text-primary font-medium"),onClick:()=>t(l.id),children:l.title},l.id))})]},d.id))})})]}),n.jsx("div",{className:"flex-1 overflow-hidden",children:n.jsx(Nn,{className:"h-full",children:n.jsx("div",{className:"max-w-3xl mx-auto p-8",children:u?n.jsx("div",{className:"prose prose-sm max-w-none",children:n.jsx("div",{dangerouslySetInnerHTML:{__html:I2(u.content)}})}):n.jsxs("div",{className:"text-center text-muted-foreground py-12",children:[n.jsx(Li,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),n.jsx("p",{children:"Select a topic from the sidebar"})]})})})})]})}var EH={};const Lw={development:"bg-blue-100 text-blue-700 border-blue-200 dark:bg-blue-900/30 dark:text-blue-400 dark:border-blue-800",productivity:"bg-green-100 text-green-700 border-green-200 dark:bg-green-900/30 dark:text-green-400 dark:border-green-800",integration:"bg-purple-100 text-purple-700 border-purple-200 dark:bg-purple-900/30 dark:text-purple-400 dark:border-purple-800",external:"bg-orange-100 text-orange-700 border-orange-200 dark:bg-orange-900/30 dark:text-orange-400 dark:border-orange-800",lsp:"bg-cyan-100 text-cyan-700 border-cyan-200 dark:bg-cyan-900/30 dark:text-cyan-400 dark:border-cyan-800",default:"bg-gray-100 text-gray-700 border-gray-200 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-700"};function PH(){var ae,ne,J,ie,ye,Oe,Ve;const[e,t]=C.useState(!0),[r,s]=C.useState({allPlugins:[],categories:[],marketplaces:[],enabledPlugins:null}),[o,u]=C.useState(""),[d,l]=C.useState([]),[c,f]=C.useState([]),[m,h]=C.useState(!0),[x,w]=C.useState(!0),[k,_]=C.useState(!0),[v,b]=C.useState(!0),[g,y]=C.useState("name"),[j,E]=C.useState(null),[P,T]=C.useState({open:!1,repo:""}),[N,R]=C.useState(!1),[I,O]=C.useState({open:!1,plugin:null}),[$,W]=C.useState(!1),Y=async()=>{t(!0);try{const te=await ke.getPlugins();s(te)}catch(te){ee.error("Failed to load plugins: "+te.message)}finally{t(!1)}};C.useEffect(()=>{Y()},[]);const z=C.useMemo(()=>{let te=r.allPlugins||[];if(o){const de=o.toLowerCase();te=te.filter(De=>{var Re,Ze,Se;return((Re=De.name)==null?void 0:Re.toLowerCase().includes(de))||((Ze=De.description)==null?void 0:Ze.toLowerCase().includes(de))||((Se=De.category)==null?void 0:Se.toLowerCase().includes(de))})}return te=te.filter(de=>!(de.sourceType==="external"&&!x||de.sourceType==="internal"&&!m)),te=te.filter(de=>!(de.installed&&!k||!de.installed&&!v)),d.length>0&&(te=te.filter(de=>d.includes(de.category))),c.length>0&&(te=te.filter(de=>c.includes(de.marketplace))),te.sort((de,De)=>{if(g==="installed"){if(de.installed&&!De.installed)return-1;if(!de.installed&&De.installed)return 1}if(g==="category"){const Re=(de.category||"zzz").localeCompare(De.category||"zzz");if(Re!==0)return Re}return de.name.localeCompare(De.name)}),te},[r.allPlugins,o,x,m,k,v,d,c,g]),K=te=>{l(de=>de.includes(te)?de.filter(De=>De!==te):[...de,te])},G=te=>{f(de=>de.includes(te)?de.filter(De=>De!==te):[...de,te])},U=async te=>{E(te);try{const de=await ke.refreshMarketplace(te);de.success?(ee.success(`Refreshed ${te}`),await Y()):ee.error(de.error||"Failed to refresh marketplace")}catch(de){ee.error("Failed to refresh: "+de.message)}finally{E(null)}},L=async()=>{if(!P.repo.trim()){ee.error("Please enter a repository URL");return}try{const te=await ke.addMarketplace("",P.repo.trim());te.success?(ee.success("Marketplace added"),T({open:!1,repo:""}),await Y()):ee.error(te.error||"Failed to add marketplace")}catch(te){ee.error("Failed to add marketplace: "+te.message)}},M=async(te,de,De)=>{W(!0);try{const Re=De!==!0,Ze=await ke.setPluginEnabled(te,de,Re);Ze.success?(ee.success(`Plugin ${Re?"enabled":"disabled"} for ${te===EH.HOME?"~":te}`),await Y()):ee.error(Ze.error||"Failed to update plugin state")}catch(Re){ee.error("Failed to update plugin: "+Re.message)}finally{W(!1)}},B=async(te,de)=>{W(!0);try{const De=await ke.setPluginEnabled(te,de,null);De.success?(ee.success("Plugin override removed"),await Y()):ee.error(De.error||"Failed to remove override")}catch(De){ee.error("Failed to update plugin: "+De.message)}finally{W(!1)}},q=te=>{O({open:!0,plugin:te})},F=(r.allPlugins||[]).filter(te=>te.installed).length,oe=(r.allPlugins||[]).filter(te=>!te.installed).length,fe=(r.allPlugins||[]).filter(te=>te.sourceType==="internal").length,me=(r.allPlugins||[]).filter(te=>te.sourceType==="external").length,X=r.marketplaces||[],H=r.categories||[];return e?n.jsx("div",{className:"flex items-center justify-center h-64",children:n.jsx(ut,{className:"w-8 h-8 animate-spin text-primary"})}):n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"bg-indigo-50 dark:bg-indigo-950/30 border border-indigo-200 dark:border-indigo-800 rounded-lg p-4 flex items-start gap-3",children:[n.jsx(Yu,{className:"w-5 h-5 text-indigo-600 dark:text-indigo-400 flex-shrink-0 mt-0.5"}),n.jsxs("div",{className:"text-sm text-indigo-800 dark:text-indigo-300",children:[n.jsx("p",{className:"font-medium",children:"Install plugins from Project Explorer"}),n.jsxs("p",{className:"text-indigo-600 dark:text-indigo-400 mt-1",children:["Use the ",n.jsx("kbd",{className:"px-1.5 py-0.5 bg-indigo-100 dark:bg-indigo-900 rounded text-xs",children:"+"}),' menu on any project and select "Install Plugins" to add plugins with project-level scope control.']})]})]}),n.jsxs("div",{className:"bg-white dark:bg-slate-950 rounded-xl border border-gray-200 dark:border-slate-800 overflow-hidden shadow-sm",children:[n.jsxs("div",{className:"p-5 border-b border-gray-200 dark:border-slate-700",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2",children:[n.jsx(Fi,{className:"w-5 h-5 text-indigo-600"}),"Plugin Directory",n.jsxs(Qe,{variant:"outline",className:"ml-2 font-normal",children:[z.length," of ",((ae=r.allPlugins)==null?void 0:ae.length)||0]})]}),n.jsx(le,{variant:"ghost",size:"sm",onClick:Y,disabled:e,children:n.jsx(pr,{className:`w-4 h-4 ${e?"animate-spin":""}`})})]}),n.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx(_l,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),n.jsx(ct,{value:o,onChange:te=>u(te.target.value),placeholder:"Search plugins...",className:"pl-9 bg-white dark:bg-slate-900 border-gray-300 dark:border-slate-700"})]}),n.jsxs(fr,{value:g,onValueChange:y,children:[n.jsx(ar,{className:"w-40",children:n.jsx(mr,{placeholder:"Sort by"})}),n.jsxs(lr,{children:[n.jsx(xt,{value:"name",children:"Name"}),n.jsx(xt,{value:"installed",children:"Installed first"}),n.jsx(xt,{value:"category",children:"Category"})]})]})]}),n.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[n.jsxs(ai,{children:[n.jsx(li,{asChild:!0,children:n.jsxs(le,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1",children:[n.jsx(Yc,{className:"w-3 h-3"}),"Marketplace",c.length>0&&n.jsx(Qe,{variant:"secondary",className:"ml-1 h-4 px-1 text-[10px]",children:c.length}),n.jsx(Sr,{className:"w-3 h-3 ml-1"})]})}),n.jsxs(ks,{align:"start",className:"w-56",children:[n.jsx(ul,{className:"text-xs",children:"Filter by marketplace"}),n.jsx(Or,{}),X.length>0?X.map(te=>n.jsx(cl,{checked:c.includes(te.name),onCheckedChange:()=>G(te.name),children:te.name},te.name)):n.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground",children:"No marketplaces"}),n.jsx(Or,{}),n.jsxs(Pt,{onClick:()=>R(!0),children:[n.jsx(kn,{className:"w-3 h-3 mr-2"}),"Manage Marketplaces"]}),c.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Or,{}),n.jsx(Pt,{onClick:()=>f([]),children:"Clear filters"})]})]})]}),n.jsxs(ai,{children:[n.jsx(li,{asChild:!0,children:n.jsxs(le,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1",children:[n.jsx(S1,{className:"w-3 h-3"}),"Category",d.length>0&&n.jsx(Qe,{variant:"secondary",className:"ml-1 h-4 px-1 text-[10px]",children:d.length}),n.jsx(Sr,{className:"w-3 h-3 ml-1"})]})}),n.jsxs(ks,{align:"start",className:"w-48",children:[n.jsx(ul,{className:"text-xs",children:"Filter by category"}),n.jsx(Or,{}),H.map(te=>n.jsx(cl,{checked:d.includes(te),onCheckedChange:()=>K(te),children:te},te)),d.length>0&&n.jsxs(n.Fragment,{children:[n.jsx(Or,{}),n.jsx(Pt,{onClick:()=>l([]),children:"Clear filters"})]})]})]}),n.jsxs("div",{className:"flex items-center gap-4 text-xs",children:[n.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[n.jsx(dt,{checked:k,onCheckedChange:_,className:"h-4 w-7 data-[state=checked]:bg-green-600"}),n.jsxs("span",{className:"text-gray-600 dark:text-slate-400",children:["Installed (",F,")"]})]}),n.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[n.jsx(dt,{checked:v,onCheckedChange:b,className:"h-4 w-7 data-[state=checked]:bg-blue-600"}),n.jsxs("span",{className:"text-gray-600 dark:text-slate-400",children:["Available (",oe,")"]})]}),n.jsx("span",{className:"text-gray-300 dark:text-slate-600",children:"|"}),n.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[n.jsx(dt,{checked:m,onCheckedChange:h,className:"h-4 w-7 data-[state=checked]:bg-indigo-600"}),n.jsxs("span",{className:"text-gray-600 dark:text-slate-400 flex items-center gap-1",children:[n.jsx(y1,{className:"w-3 h-3"})," Anthropic (",fe,")"]})]}),n.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[n.jsx(dt,{checked:x,onCheckedChange:w,className:"h-4 w-7 data-[state=checked]:bg-orange-600"}),n.jsxs("span",{className:"text-gray-600 dark:text-slate-400 flex items-center gap-1",children:[n.jsx(Bi,{className:"w-3 h-3"})," Community (",me,")"]})]})]})]})]}),n.jsxs("div",{className:"p-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[z.map((te,de)=>{const De=Lw[te.category]||Lw.default,Re=te.mcpServers?Object.keys(te.mcpServers).length:0,Ze=te.lspServers?Object.keys(te.lspServers).length:0,Se=`${te.name}@${te.marketplace}`,ge=te.enabledState,Me=(ge==null?void 0:ge.merged)===!0;return(ge==null?void 0:ge.merged)!==null&&(ge==null||ge.merged),n.jsxs(Eo.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:Math.min(de*.02,.3)},className:`rounded-lg border p-4 transition-all hover:shadow-md ${Me?"bg-emerald-50 border-emerald-200 dark:bg-emerald-950/20 dark:border-emerald-800":te.installed?"bg-green-50 border-green-200 dark:bg-green-950/20 dark:border-green-800":"bg-white border-gray-200 dark:bg-slate-900 dark:border-slate-700"}`,children:[n.jsxs("div",{className:"flex items-start justify-between mb-2",children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white truncate",children:te.name}),te.sourceType==="external"&&n.jsx(Bi,{className:"w-3.5 h-3.5 text-orange-500 flex-shrink-0",title:"Community plugin"})]}),n.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[te.installed&&n.jsxs(Qe,{variant:"outline",className:"text-green-600 border-green-300 dark:text-green-400 dark:border-green-700 text-[10px]",children:[n.jsx(Kt,{className:"w-2.5 h-2.5 mr-0.5"}),"Installed"]}),Me&&n.jsxs(Qe,{variant:"outline",className:"text-emerald-600 border-emerald-300 dark:text-emerald-400 dark:border-emerald-700 text-[10px]",children:[n.jsx(sb,{className:"w-2.5 h-2.5 mr-0.5"}),"Enabled"]})]})]}),n.jsxs("div",{className:"flex items-center gap-1",children:[te.installed&&n.jsx(zo,{children:n.jsxs(on,{children:[n.jsx(an,{asChild:!0,children:n.jsx(le,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-60 hover:opacity-100",onClick:()=>q(te),children:n.jsx(kn,{className:"w-4 h-4"})})}),n.jsx(qr,{children:n.jsx("p",{children:"Configure per-directory"})})]})}),te.homepage&&n.jsx(le,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 opacity-60 hover:opacity-100",onClick:()=>window.open(te.homepage,"_blank"),children:n.jsx(du,{className:"w-4 h-4"})})]})]}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-slate-400 mb-3 line-clamp-2",children:te.description||"No description available"}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-2",children:[te.category&&n.jsx(Qe,{variant:"outline",className:`text-[10px] px-1.5 py-0 ${De}`,children:te.category}),te.version&&n.jsxs("span",{className:"text-[10px] text-gray-400 dark:text-slate-500",children:["v",te.version]})]}),(Re>0||Ze>0||te.commands)&&n.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-gray-500 dark:text-slate-500 pt-2 border-t border-gray-100 dark:border-slate-800",children:[Ze>0&&n.jsxs("span",{className:"flex items-center gap-1 bg-cyan-50 dark:bg-cyan-900/20 px-1.5 py-0.5 rounded",children:[n.jsx(ns,{className:"w-3 h-3 text-cyan-600"}),Ze," LSP"]}),Re>0&&n.jsxs("span",{className:"flex items-center gap-1 bg-blue-50 dark:bg-blue-900/20 px-1.5 py-0.5 rounded",children:[n.jsx(Fn,{className:"w-3 h-3 text-blue-600"}),Re," MCP"]}),te.commands&&n.jsxs("span",{className:"flex items-center gap-1 bg-green-50 dark:bg-green-900/20 px-1.5 py-0.5 rounded",children:[n.jsx(Ft,{className:"w-3 h-3 text-green-600"}),"Commands"]})]})]},Se)}),z.length===0&&n.jsxs("div",{className:"col-span-full text-center py-12 text-gray-500 dark:text-slate-400",children:[n.jsx(Fi,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),n.jsx("p",{className:"font-medium",children:"No plugins found"}),n.jsx("p",{className:"text-sm mt-1",children:"Try adjusting your filters or search query"}),(d.length>0||c.length>0||o)&&n.jsx(le,{variant:"link",size:"sm",onClick:()=>{l([]),f([]),u("")},className:"mt-2",children:"Clear all filters"})]})]})]}),n.jsx(Tt,{open:P.open,onOpenChange:te=>T({...P,open:te}),children:n.jsxs(St,{className:"max-w-lg",children:[n.jsxs(Ct,{children:[n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(Yc,{className:"w-5 h-5 text-purple-600"}),"Add Plugin Marketplace"]}),n.jsx(tr,{children:"Add a marketplace from a GitHub repository URL or local path."})]}),n.jsx("div",{className:"space-y-4 py-4",children:n.jsxs("div",{children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-slate-300",children:"Repository URL or Path"}),n.jsx(ct,{value:P.repo,onChange:te=>T({...P,repo:te.target.value}),placeholder:"owner/repo or full GitHub URL",className:"mt-1"}),n.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-400 mt-2",children:"Supported formats:"}),n.jsxs("ul",{className:"text-xs text-gray-500 dark:text-slate-400 mt-1 space-y-1 ml-2",children:[n.jsxs("li",{children:[n.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:"owner/repo"})," — GitHub shorthand"]}),n.jsxs("li",{children:[n.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:"https://github.com/owner/repo"})," — Full URL"]}),n.jsxs("li",{children:[n.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:"/local/path"})," — Local directory"]})]}),n.jsxs("p",{className:"text-xs text-gray-400 dark:text-slate-500 mt-2",children:["Search GitHub for ",n.jsx("code",{className:"bg-gray-100 dark:bg-slate-700 px-1 rounded",children:"claude-plugins"})," to find community marketplaces."]})]})}),n.jsxs(It,{children:[n.jsx(le,{variant:"ghost",onClick:()=>T({open:!1,repo:""}),children:"Cancel"}),n.jsxs(le,{onClick:L,className:"bg-purple-600 hover:bg-purple-700 text-white",children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add Marketplace"]})]})]})}),n.jsx(Tt,{open:N,onOpenChange:R,children:n.jsxs(St,{className:"max-w-2xl",children:[n.jsxs(Ct,{children:[n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(Yc,{className:"w-5 h-5 text-purple-600"}),"Plugin Marketplaces",n.jsx(Qe,{variant:"outline",className:"ml-2 font-normal",children:X.length})]}),n.jsx(tr,{children:"Manage your plugin marketplaces. Add external marketplaces to discover more plugins."})]}),n.jsx("div",{className:"py-4",children:X.length>0?n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:X.map(te=>{var De,Re,Ze;const de=(((De=te.plugins)==null?void 0:De.length)||0)+(((Re=te.externalPlugins)==null?void 0:Re.length)||0);return n.jsxs("div",{className:"bg-purple-50 dark:bg-purple-950/20 rounded-lg border border-purple-200 dark:border-purple-800 p-4",children:[n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("h3",{className:"font-semibold text-purple-900 dark:text-purple-200",children:te.name}),n.jsx(le,{variant:"ghost",size:"sm",onClick:()=>U(te.name),disabled:j===te.name,className:"h-7 w-7 p-0",children:n.jsx(pr,{className:`w-4 h-4 text-purple-600 dark:text-purple-400 ${j===te.name?"animate-spin":""}`})})]}),n.jsx("p",{className:"text-sm text-purple-700 dark:text-purple-300 mb-2 truncate",children:typeof te.source=="string"?te.source:((Ze=te.source)==null?void 0:Ze.repo)||"Unknown source"}),n.jsxs("div",{className:"flex items-center justify-between text-xs text-purple-600 dark:text-purple-400",children:[n.jsxs("span",{children:[de," plugins"]}),te.lastUpdated&&n.jsxs("span",{children:["Updated: ",new Date(te.lastUpdated).toLocaleDateString()]})]})]},te.name)})}):n.jsxs("div",{className:"text-center py-8 text-gray-500 dark:text-slate-400",children:[n.jsx(Yc,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),n.jsx("p",{children:"No marketplaces configured."}),n.jsx("p",{className:"text-sm mt-1",children:"Add a marketplace to discover plugins."})]})}),n.jsxs(It,{children:[n.jsx(le,{variant:"outline",onClick:()=>R(!1),children:"Close"}),n.jsxs(le,{onClick:()=>{R(!1),T({open:!0,repo:""})},className:"bg-purple-600 hover:bg-purple-700 text-white",children:[n.jsx(yt,{className:"w-4 h-4 mr-2"}),"Add Marketplace"]})]})]})}),n.jsx(Tt,{open:I.open,onOpenChange:te=>O({...I,open:te}),children:n.jsxs(St,{className:"max-w-lg",children:[n.jsxs(Ct,{children:[n.jsxs(kt,{className:"flex items-center gap-2",children:[n.jsx(tb,{className:"w-5 h-5 text-emerald-600"}),"Configure Plugin: ",(ne=I.plugin)==null?void 0:ne.name]}),n.jsx(tr,{children:"Enable or disable this plugin for specific directories. Child directories inherit parent settings unless overridden."})]}),n.jsxs("div",{className:"space-y-3 py-4 max-h-[400px] overflow-y-auto",children:[(ye=(ie=(J=I.plugin)==null?void 0:J.enabledState)==null?void 0:ie.perDir)==null?void 0:ye.map((te,de)=>{const De=`${I.plugin.name}@${I.plugin.marketplace}`,Re=te.enabled!==null&&te.enabled!==void 0,Ze=te.enabled===!0,Se=te.enabled===!1;let ge=null;if(!Re&&de>0)for(let Me=de-1;Me>=0;Me--){const ht=I.plugin.enabledState.perDir[Me];if(ht.enabled!==null&&ht.enabled!==void 0){ge=ht.enabled;break}}return n.jsxs("div",{className:`flex items-center justify-between p-3 rounded-lg border ${Ze?"bg-emerald-50 border-emerald-200 dark:bg-emerald-950/30 dark:border-emerald-800":Se?"bg-red-50 border-red-200 dark:bg-red-950/30 dark:border-red-800":"bg-gray-50 border-gray-200 dark:bg-slate-800/50 dark:border-slate-700"}`,children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("code",{className:"text-sm font-mono text-gray-700 dark:text-slate-300 truncate",children:te.label}),!Re&&ge!==null&&n.jsxs(Qe,{variant:"outline",className:"text-[10px] text-gray-500",children:["inherited: ",ge?"on":"off"]})]}),Re&&n.jsx("p",{className:"text-[10px] text-gray-500 dark:text-slate-400 mt-0.5",children:Ze?"Explicitly enabled":"Explicitly disabled"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[Re&&n.jsx(zo,{children:n.jsxs(on,{children:[n.jsx(an,{asChild:!0,children:n.jsx(le,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-gray-400 hover:text-gray-600",onClick:()=>B(te.dir,De),disabled:$,children:n.jsx(s5,{className:"w-4 h-4"})})}),n.jsx(qr,{children:n.jsx("p",{children:"Remove override (inherit from parent)"})})]})}),n.jsxs("div",{className:"flex items-center gap-1 border rounded-lg overflow-hidden",children:[n.jsx(le,{variant:Ze?"default":"ghost",size:"sm",className:`h-7 px-2 rounded-none ${Ze?"bg-emerald-600 hover:bg-emerald-700 text-white":""}`,onClick:()=>M(te.dir,De,!1),disabled:$||Ze,children:n.jsx(sb,{className:"w-3 h-3"})}),n.jsx(le,{variant:Se?"default":"ghost",size:"sm",className:`h-7 px-2 rounded-none ${Se?"bg-red-600 hover:bg-red-700 text-white":""}`,onClick:()=>M(te.dir,De,!0),disabled:$||Se,children:n.jsx(y5,{className:"w-3 h-3"})})]})]})]},te.dir)}),(!((Ve=(Oe=I.plugin)==null?void 0:Oe.enabledState)!=null&&Ve.perDir)||I.plugin.enabledState.perDir.length===0)&&n.jsxs("div",{className:"text-center py-8 text-gray-500 dark:text-slate-400",children:[n.jsx(tb,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),n.jsx("p",{children:"No config hierarchy found."}),n.jsx("p",{className:"text-sm mt-1",children:"Create a .claude/mcps.json in your project first."})]})]}),n.jsx(It,{children:n.jsx(le,{variant:"ghost",onClick:()=>O({open:!1,plugin:null}),children:"Done"})})]})}),n.jsxs("div",{className:"bg-gray-50 dark:bg-slate-900 rounded-lg p-4 border border-transparent dark:border-slate-800",children:[n.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-white mb-2",children:"CLI Commands (Claude Code)"}),n.jsxs("div",{className:"space-y-1 text-sm text-gray-600 dark:text-slate-400 font-mono",children:[n.jsx("p",{className:"text-gray-400 dark:text-slate-500",children:"# Add marketplace (one-time)"}),n.jsx("p",{children:"claude plugin marketplace add regression-io/coder-config-plugins"}),n.jsx("p",{className:"text-gray-400 dark:text-slate-500 mt-2",children:"# Install plugins from marketplace"}),n.jsx("p",{children:"claude plugin install <name>@coder-config-plugins"}),n.jsx("p",{className:"text-gray-400 dark:text-slate-500 mt-2",children:"# Manage plugins"}),n.jsx("p",{children:"claude plugin list # List installed"}),n.jsx("p",{children:"claude plugin uninstall <name> # Remove plugin"})]})]})]})}function AH({projects:e=[],onWorkstreamChange:t}){var Ke,bt;const[r,s]=C.useState([]),[o,u]=C.useState(!0),[d,l]=C.useState(null),[c,f]=C.useState(!1),[m,h]=C.useState(null),[x,w]=C.useState(!1),[k,_]=C.useState(null),[v,b]=C.useState(new Set),[g,y]=C.useState(""),[j,E]=C.useState(""),[P,T]=C.useState([]),[N,R]=C.useState(!1),[I,O]=C.useState(!1),[$,W]=C.useState({}),[Y,z]=C.useState({}),[K,G]=C.useState({}),[U,L]=C.useState({isInstalled:!1,loading:!0}),[M,B]=C.useState(!1),[q,F]=C.useState(null),[oe,fe]=C.useState([]),[me,X]=C.useState(!1),[H,ae]=C.useState(()=>{try{return JSON.parse(localStorage.getItem("dismissedWorkstreamSuggestions")||"[]")}catch{return[]}});C.useEffect(()=>{Ze(),ne(),J()},[]);const ne=async()=>{try{const Z=await ke.getWorkstreamHookStatus();L({...Z,loading:!1})}catch(Z){L({isInstalled:!1,loading:!1,error:Z.message})}},J=async()=>{try{X(!0);const[Z,Pe]=await Promise.all([ke.getActivitySummary(),ke.getWorkstreamSuggestions()]);F(Z),fe(Pe.suggestions||[])}catch(Z){console.log("Activity data not available:",Z.message)}finally{X(!1)}},ie=Z=>{y(Z.name),T([...Z.projects]),E(`# Auto-generated workstream based on activity patterns
2336
2336
 
2337
2337
  These projects are frequently worked on together.`),f(!0)},ye=Z=>{T(Pe=>Pe.filter(Le=>Le!==Z))},Oe=Z=>{P.includes(Z)||T(Pe=>[...Pe,Z])},Ve=async Z=>{const Pe=$[Z];if(!Pe&&!Y[Z]){G(Le=>({...Le,[Z]:!0}));try{const Le=await ke.getSubprojects(Z);z(st=>({...st,[Z]:Le.subprojects||[]}))}catch(Le){console.error("Failed to load subprojects:",Le),z(st=>({...st,[Z]:[]}))}finally{G(Le=>({...Le,[Z]:!1}))}}W(Le=>({...Le,[Z]:!Pe}))},te=Z=>{const Pe=Z.projects.sort().join("|"),Le=[...H,Pe];ae(Le),localStorage.setItem("dismissedWorkstreamSuggestions",JSON.stringify(Le)),fe(st=>st.filter(et=>et.projects.sort().join("|")!==Pe)),ee.success("Suggestion dismissed")},de=oe.filter(Z=>{const Pe=Z.projects.sort().join("|");return!H.includes(Pe)}),De=async()=>{if(confirm("Clear activity data older than 30 days?"))try{const Z=await ke.clearActivity(30);Z.success&&(ee.success(`Cleared ${Z.cleared} old entries`),J())}catch(Z){ee.error("Failed to clear activity: "+Z.message)}},Re=async()=>{B(!0);try{const Z=await ke.installWorkstreamHook();Z.success?(ee.success(Z.message),L(Pe=>({...Pe,isInstalled:!0}))):ee.error(Z.error||"Failed to install hook")}catch(Z){ee.error("Failed to install hook: "+Z.message)}finally{B(!1)}},Ze=async()=>{try{u(!0);const Z=await ke.getWorkstreams();s(Z.workstreams||[])}catch{ee.error("Failed to load workstreams")}finally{u(!1)}},Se=async()=>{if(!g.trim()){ee.error("Name is required");return}R(!0);try{const Z=await ke.createWorkstream(g.trim(),P,j);Z.success?(s(Pe=>[...Pe,Z.workstream]),ee.success(`Created workstream: ${g}`),f(!1),y(""),E(""),T([]),fe(Pe=>Pe.filter(Le=>Le.name!==g.trim()))):ee.error(Z.error||"Failed to create workstream")}catch(Z){ee.error("Failed to create workstream: "+Z.message)}finally{R(!1)}},ge=async Z=>{if(confirm(`Delete workstream "${Z.name}"?
2338
2338
 
@@ -19,7 +19,7 @@
19
19
 
20
20
  <!-- PWA Manifest -->
21
21
  <link rel="manifest" href="/manifest.json">
22
- <script type="module" crossorigin src="/assets/index-Co67P2bU.js"></script>
22
+ <script type="module" crossorigin src="/assets/index-DZrd_FEC.js"></script>
23
23
  <link rel="stylesheet" crossorigin href="/assets/index-DjLdm3Mr.css">
24
24
  </head>
25
25
  <body>
@@ -85,7 +85,7 @@ function addProject(manager, projectPath, name, setProjectDir, runClaudeInit = f
85
85
  // Run claude /init if requested and CLAUDE.md doesn't exist
86
86
  if (runClaudeInit && !fs.existsSync(claudeMd)) {
87
87
  try {
88
- execFileSync('claude', ['/init'], {
88
+ execFileSync('claude', ['-p', '/init'], {
89
89
  cwd: absPath,
90
90
  stdio: 'pipe',
91
91
  timeout: 30000