@neuralnomads/codenomad-dev 0.13.3-dev-20260402-19a4c3df → 0.13.3-dev-20260403-d0a0325d

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/auth/manager.js +5 -1
  2. package/dist/events/bus.js +4 -0
  3. package/dist/index.js +14 -0
  4. package/dist/server/http-server.js +279 -1
  5. package/dist/server/routes/sidecars.js +46 -0
  6. package/dist/sidecars/manager.js +193 -0
  7. package/package.json +1 -1
  8. package/public/assets/{ChangesTab-CmUh1lD6.js → ChangesTab-Cga3cJ27.js} +2 -2
  9. package/public/assets/{DiffToolbar-BO2mraG6.js → DiffToolbar-ysD8YAOp.js} +1 -1
  10. package/public/assets/{FilesTab-eqP9iJFz.js → FilesTab-CNEdrGlK.js} +2 -2
  11. package/public/assets/{GitChangesTab-DyQyRmoO.js → GitChangesTab-C4JCkCnw.js} +2 -2
  12. package/public/assets/{SplitFilePanel-DvXBnKhO.js → SplitFilePanel-DyezmCo2.js} +1 -1
  13. package/public/assets/{StatusTab-B2B6v-Eg.js → StatusTab-BJqHpvHN.js} +1 -1
  14. package/public/assets/{bundle-full-CWbff1l0.js → bundle-full-DwOhsFtX.js} +1 -1
  15. package/public/assets/{diff-viewer-D0a6LOK6.js → diff-viewer-B8i46pSx.js} +1 -1
  16. package/public/assets/index-4cIw-BDV.js +1 -0
  17. package/public/assets/{index-C9VkLCt-.js → index-Bfgb6hSQ.js} +1 -1
  18. package/public/assets/index-C3ecDP5_.js +1 -0
  19. package/public/assets/{index-Dl_aI0rQ.js → index-C5H7aIod.js} +1 -1
  20. package/public/assets/index-C5c6mvR5.js +1 -0
  21. package/public/assets/index-CD-C2Kdk.js +1 -0
  22. package/public/assets/index-CJQRbTtv.js +2 -0
  23. package/public/assets/index-CQD0rDm8.js +1 -0
  24. package/public/assets/{index-Y07FhVRK.css → index-CRyEAEtJ.css} +1 -1
  25. package/public/assets/index-Dcj6nNO-.js +1 -0
  26. package/public/assets/{loading-BMaruoBO.js → loading-C5GsedyF.js} +1 -1
  27. package/public/assets/main-BpgxtqbO.js +56 -0
  28. package/public/assets/{markdown-2ayBrByq.js → markdown-aU4KPoLk.js} +3 -3
  29. package/public/assets/{monaco-viewer-DUhWC7BI.js → monaco-viewer-BCffFoQZ.js} +1 -1
  30. package/public/assets/{todo-D5pIlYqO.js → todo-CShSQjpC.js} +1 -1
  31. package/public/assets/{tool-call-BuEF2-g9.js → tool-call-jzprw2Fo.js} +3 -3
  32. package/public/assets/{unified-picker-C-OVvqSd.js → unified-picker-C20-DAtu.js} +1 -1
  33. package/public/assets/{wrap-text-DD_eCVvu.js → wrap-text-CIfNyrm2.js} +1 -1
  34. package/public/index.html +4 -4
  35. package/public/loading.html +4 -4
  36. package/public/sw.js +1 -1
  37. package/public/assets/index-BTg3IYTI.js +0 -1
  38. package/public/assets/index-CY6GNG9A.js +0 -1
  39. package/public/assets/index-CfoVNw2d.js +0 -2
  40. package/public/assets/index-DHqgtrcH.js +0 -1
  41. package/public/assets/index-DPhIvE8c.js +0 -1
  42. package/public/assets/index-Wj66Yen3.js +0 -1
  43. package/public/assets/index-vxahkr1I.js +0 -1
  44. package/public/assets/main-CH4aDUD4.js +0 -56
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/bundle-full-CWbff1l0.js","assets/index-CfoVNw2d.js","assets/git-diff-vendor-CAv-4upN.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css","assets/monaco-viewer-DUhWC7BI.js","assets/index-Y07FhVRK.css"])))=>i.map(i=>d[i]);
2
- var Qe=Object.defineProperty;var de=o=>{throw TypeError(o)};var Oe=(o,t,e)=>t in o?Qe(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;var k=(o,t,e)=>Oe(o,typeof t!="symbol"?t+"":t,e),De=(o,t,e)=>t.has(o)||de("Cannot "+e);var ke=(o,t,e)=>t.has(o)?de("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(o):t.set(o,e);var B=(o,t,e)=>(De(o,t,"access private method"),e);import{t as je,_ as Ne}from"./index-CfoVNw2d.js";import{k as Fe}from"./monaco-viewer-DUhWC7BI.js";import{am as Q,v as b}from"./main-CH4aDUD4.js";import"./git-diff-vendor-CAv-4upN.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";function se(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let S=se();function Te(o){S=o}const ze=/[&<>"']/,Ue=new RegExp(ze.source,"g"),Re=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Ge=new RegExp(Re.source,"g"),Ke={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},xe=o=>Ke[o];function x(o,t){if(t){if(ze.test(o))return o.replace(Ue,xe)}else if(Re.test(o))return o.replace(Ge,xe);return o}const We=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Xe(o){return o.replace(We,(t,e)=>(e=e.toLowerCase(),e==="colon"?":":e.charAt(0)==="#"?e.charAt(1)==="x"?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""))}const Ve=/(^|[^\[])\^/g;function d(o,t){let e=typeof o=="string"?o:o.source;t=t||"";const n={replace:(i,r)=>{let s=typeof r=="string"?r:r.source;return s=s.replace(Ve,"$1"),e=e.replace(i,s),n},getRegex:()=>new RegExp(e,t)};return n}function me(o){try{o=encodeURI(o).replace(/%25/g,"%")}catch{return null}return o}const A={exec:()=>null};function be(o,t){const e=o.replace(/\|/g,(r,s,l)=>{let a=!1,u=s;for(;--u>=0&&l[u]==="\\";)a=!a;return a?"|":" |"}),n=e.split(/ \|/);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(/\\\|/g,"|");return n}function H(o,t,e){const n=o.length;if(n===0)return"";let i=0;for(;i<n&&o.charAt(n-i-1)===t;)i++;return o.slice(0,n-i)}function Je(o,t){if(o.indexOf(t[1])===-1)return-1;let e=0;for(let n=0;n<o.length;n++)if(o[n]==="\\")n++;else if(o[n]===t[0])e++;else if(o[n]===t[1]&&(e--,e<0))return n;return-1}function we(o,t,e,n){const i=t.href,r=t.title?x(t.title):null,s=o[1].replace(/\\([\[\]])/g,"$1");if(o[0].charAt(0)!=="!"){n.state.inLink=!0;const l={type:"link",raw:e,href:i,title:r,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,l}return{type:"image",raw:e,href:i,title:r,text:x(s)}}function Ye(o,t){const e=o.match(/^(\s+)(?:```)/);if(e===null)return t;const n=e[1];return t.split(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/bundle-full-DwOhsFtX.js","assets/index-CJQRbTtv.js","assets/git-diff-vendor-CAv-4upN.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css","assets/monaco-viewer-BCffFoQZ.js","assets/index-CRyEAEtJ.css"])))=>i.map(i=>d[i]);
2
+ var Qe=Object.defineProperty;var de=o=>{throw TypeError(o)};var Oe=(o,t,e)=>t in o?Qe(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;var k=(o,t,e)=>Oe(o,typeof t!="symbol"?t+"":t,e),De=(o,t,e)=>t.has(o)||de("Cannot "+e);var ke=(o,t,e)=>t.has(o)?de("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(o):t.set(o,e);var B=(o,t,e)=>(De(o,t,"access private method"),e);import{t as je,_ as Ne}from"./index-CJQRbTtv.js";import{k as Fe}from"./monaco-viewer-BCffFoQZ.js";import{am as Q,v as b}from"./main-BpgxtqbO.js";import"./git-diff-vendor-CAv-4upN.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";function se(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let S=se();function Te(o){S=o}const ze=/[&<>"']/,Ue=new RegExp(ze.source,"g"),Re=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Ge=new RegExp(Re.source,"g"),Ke={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},xe=o=>Ke[o];function x(o,t){if(t){if(ze.test(o))return o.replace(Ue,xe)}else if(Re.test(o))return o.replace(Ge,xe);return o}const We=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Xe(o){return o.replace(We,(t,e)=>(e=e.toLowerCase(),e==="colon"?":":e.charAt(0)==="#"?e.charAt(1)==="x"?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""))}const Ve=/(^|[^\[])\^/g;function d(o,t){let e=typeof o=="string"?o:o.source;t=t||"";const n={replace:(i,r)=>{let s=typeof r=="string"?r:r.source;return s=s.replace(Ve,"$1"),e=e.replace(i,s),n},getRegex:()=>new RegExp(e,t)};return n}function me(o){try{o=encodeURI(o).replace(/%25/g,"%")}catch{return null}return o}const A={exec:()=>null};function be(o,t){const e=o.replace(/\|/g,(r,s,l)=>{let a=!1,u=s;for(;--u>=0&&l[u]==="\\";)a=!a;return a?"|":" |"}),n=e.split(/ \|/);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(/\\\|/g,"|");return n}function H(o,t,e){const n=o.length;if(n===0)return"";let i=0;for(;i<n&&o.charAt(n-i-1)===t;)i++;return o.slice(0,n-i)}function Je(o,t){if(o.indexOf(t[1])===-1)return-1;let e=0;for(let n=0;n<o.length;n++)if(o[n]==="\\")n++;else if(o[n]===t[0])e++;else if(o[n]===t[1]&&(e--,e<0))return n;return-1}function we(o,t,e,n){const i=t.href,r=t.title?x(t.title):null,s=o[1].replace(/\\([\[\]])/g,"$1");if(o[0].charAt(0)!=="!"){n.state.inLink=!0;const l={type:"link",raw:e,href:i,title:r,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,l}return{type:"image",raw:e,href:i,title:r,text:x(s)}}function Ye(o,t){const e=o.match(/^(\s+)(?:```)/);if(e===null)return t;const n=e[1];return t.split(`
3
3
  `).map(i=>{const r=i.match(/^\s+/);if(r===null)return i;const[s]=r;return s.length>=n.length?i.slice(n.length):i}).join(`
4
4
  `)}class N{constructor(t){k(this,"options");k(this,"rules");k(this,"lexer");this.options=t||S}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const n=e[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:H(n,`
5
5
  `)}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const n=e[0],i=Ye(n,e[3]||"");return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:i}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(/#$/.test(n)){const i=H(n,"#");(this.options.pedantic||!i||/ $/.test(i))&&(n=i.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:e[0]}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let n=e[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
@@ -44,7 +44,7 @@ ${t}</tr>
44
44
  `}tablecell(t,e){const n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
45
45
  `}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return"<br>"}del(t){return`<del>${t}</del>`}link(t,e,n){const i=me(t);if(i===null)return n;t=i;let r='<a href="'+t+'"';return e&&(r+=' title="'+e+'"'),r+=">"+n+"</a>",r}image(t,e,n){const i=me(t);if(i===null)return n;t=i;let r=`<img src="${t}" alt="${n}"`;return e&&(r+=` title="${e}"`),r+=">",r}text(t){return t}}class ce{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,e,n){return""+n}image(t,e,n){return""+n}br(){return""}}class y{constructor(t){k(this,"options");k(this,"renderer");k(this,"textRenderer");this.options=t||S,this.options.renderer=this.options.renderer||new U,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ce}static parse(t,e){return new y(e).parse(t)}static parseInline(t,e){return new y(e).parseInline(t)}parse(t,e=!0){let n="";for(let i=0;i<t.length;i++){const r=t[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]){const s=r,l=this.options.extensions.renderers[s.type].call({parser:this},s);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(s.type)){n+=l||"";continue}}switch(r.type){case"space":continue;case"hr":{n+=this.renderer.hr();continue}case"heading":{const s=r;n+=this.renderer.heading(this.parseInline(s.tokens),s.depth,Xe(this.parseInline(s.tokens,this.textRenderer)));continue}case"code":{const s=r;n+=this.renderer.code(s.text,s.lang,!!s.escaped);continue}case"table":{const s=r;let l="",a="";for(let c=0;c<s.header.length;c++)a+=this.renderer.tablecell(this.parseInline(s.header[c].tokens),{header:!0,align:s.align[c]});l+=this.renderer.tablerow(a);let u="";for(let c=0;c<s.rows.length;c++){const p=s.rows[c];a="";for(let h=0;h<p.length;h++)a+=this.renderer.tablecell(this.parseInline(p[h].tokens),{header:!1,align:s.align[h]});u+=this.renderer.tablerow(a)}n+=this.renderer.table(l,u);continue}case"blockquote":{const s=r,l=this.parse(s.tokens);n+=this.renderer.blockquote(l);continue}case"list":{const s=r,l=s.ordered,a=s.start,u=s.loose;let c="";for(let p=0;p<s.items.length;p++){const h=s.items[p],f=h.checked,T=h.task;let m="";if(h.task){const z=this.renderer.checkbox(!!f);u?h.tokens.length>0&&h.tokens[0].type==="paragraph"?(h.tokens[0].text=z+" "+h.tokens[0].text,h.tokens[0].tokens&&h.tokens[0].tokens.length>0&&h.tokens[0].tokens[0].type==="text"&&(h.tokens[0].tokens[0].text=z+" "+h.tokens[0].tokens[0].text)):h.tokens.unshift({type:"text",text:z+" "}):m+=z+" "}m+=this.parse(h.tokens,u),c+=this.renderer.listitem(m,T,!!f)}n+=this.renderer.list(c,l,a);continue}case"html":{const s=r;n+=this.renderer.html(s.text,s.block);continue}case"paragraph":{const s=r;n+=this.renderer.paragraph(this.parseInline(s.tokens));continue}case"text":{let s=r,l=s.tokens?this.parseInline(s.tokens):s.text;for(;i+1<t.length&&t[i+1].type==="text";)s=t[++i],l+=`
46
46
  `+(s.tokens?this.parseInline(s.tokens):s.text);n+=e?this.renderer.paragraph(l):l;continue}default:{const s='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}parseInline(t,e){e=e||this.renderer;let n="";for(let i=0;i<t.length;i++){const r=t[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]){const s=this.options.extensions.renderers[r.type].call({parser:this},r);if(s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)){n+=s||"";continue}}switch(r.type){case"escape":{const s=r;n+=e.text(s.text);break}case"html":{const s=r;n+=e.html(s.text);break}case"link":{const s=r;n+=e.link(s.href,s.title,this.parseInline(s.tokens,e));break}case"image":{const s=r;n+=e.image(s.href,s.title,s.text);break}case"strong":{const s=r;n+=e.strong(this.parseInline(s.tokens,e));break}case"em":{const s=r;n+=e.em(this.parseInline(s.tokens,e));break}case"codespan":{const s=r;n+=e.codespan(s.text);break}case"br":{n+=e.br();break}case"del":{const s=r;n+=e.del(this.parseInline(s.tokens,e));break}case"text":{const s=r;n+=e.text(s.text);break}default:{const s='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}}class v{constructor(t){k(this,"options");this.options=t||S}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}}k(v,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));var L,ne,Ee;class _t{constructor(...t){ke(this,L);k(this,"defaults",se());k(this,"options",this.setOptions);k(this,"parse",B(this,L,ne).call(this,w.lex,y.parse));k(this,"parseInline",B(this,L,ne).call(this,w.lexInline,y.parseInline));k(this,"Parser",y);k(this,"Renderer",U);k(this,"TextRenderer",ce);k(this,"Lexer",w);k(this,"Tokenizer",N);k(this,"Hooks",v);this.use(...t)}walkTokens(t,e){var i,r;let n=[];for(const s of t)switch(n=n.concat(e.call(this,s)),s.type){case"table":{const l=s;for(const a of l.header)n=n.concat(this.walkTokens(a.tokens,e));for(const a of l.rows)for(const u of a)n=n.concat(this.walkTokens(u.tokens,e));break}case"list":{const l=s;n=n.concat(this.walkTokens(l.items,e));break}default:{const l=s;(r=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&r[l.type]?this.defaults.extensions.childTokens[l.type].forEach(a=>{const u=l[a].flat(1/0);n=n.concat(this.walkTokens(u,e))}):l.tokens&&(n=n.concat(this.walkTokens(l.tokens,e)))}}return n}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{const i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){const s=e.renderers[r.name];s?e.renderers[r.name]=function(...l){let a=r.renderer.apply(this,l);return a===!1&&(a=s.apply(this,l)),a}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const s=e[r.level];s?s.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),i.extensions=e),n.renderer){const r=this.defaults.renderer||new U(this.defaults);for(const s in n.renderer){if(!(s in r))throw new Error(`renderer '${s}' does not exist`);if(s==="options")continue;const l=s,a=n.renderer[l],u=r[l];r[l]=(...c)=>{let p=a.apply(r,c);return p===!1&&(p=u.apply(r,c)),p||""}}i.renderer=r}if(n.tokenizer){const r=this.defaults.tokenizer||new N(this.defaults);for(const s in n.tokenizer){if(!(s in r))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;const l=s,a=n.tokenizer[l],u=r[l];r[l]=(...c)=>{let p=a.apply(r,c);return p===!1&&(p=u.apply(r,c)),p}}i.tokenizer=r}if(n.hooks){const r=this.defaults.hooks||new v;for(const s in n.hooks){if(!(s in r))throw new Error(`hook '${s}' does not exist`);if(s==="options")continue;const l=s,a=n.hooks[l],u=r[l];v.passThroughHooks.has(s)?r[l]=c=>{if(this.defaults.async)return Promise.resolve(a.call(r,c)).then(h=>u.call(r,h));const p=a.call(r,c);return u.call(r,p)}:r[l]=(...c)=>{let p=a.apply(r,c);return p===!1&&(p=u.apply(r,c)),p}}i.hooks=r}if(n.walkTokens){const r=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(l){let a=[];return a.push(s.call(this,l)),r&&(a=a.concat(r.call(this,l))),a}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return w.lex(t,e??this.defaults)}parser(t,e){return y.parse(t,e??this.defaults)}}L=new WeakSet,ne=function(t,e){return(n,i)=>{const r={...i},s={...this.defaults,...r};this.defaults.async===!0&&r.async===!1&&(s.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),s.async=!0);const l=B(this,L,Ee).call(this,!!s.silent,!!s.async);if(typeof n>"u"||n===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s),s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then(a=>t(a,s)).then(a=>s.hooks?s.hooks.processAllTokens(a):a).then(a=>s.walkTokens?Promise.all(this.walkTokens(a,s.walkTokens)).then(()=>a):a).then(a=>e(a,s)).then(a=>s.hooks?s.hooks.postprocess(a):a).catch(l);try{s.hooks&&(n=s.hooks.preprocess(n));let a=t(n,s);s.hooks&&(a=s.hooks.processAllTokens(a)),s.walkTokens&&this.walkTokens(a,s.walkTokens);let u=e(a,s);return s.hooks&&(u=s.hooks.postprocess(u)),u}catch(a){return l(a)}}},Ee=function(t,e){return n=>{if(n.message+=`
47
- Please report this to https://github.com/markedjs/marked.`,t){const i="<p>An error occurred:</p><pre>"+x(n.message+"",!0)+"</pre>";return e?Promise.resolve(i):i}if(e)return Promise.reject(n);throw n}};const _=new _t;function g(o,t){return _.parse(o,t)}g.options=g.setOptions=function(o){return _.setOptions(o),g.defaults=_.defaults,Te(g.defaults),g};g.getDefaults=se;g.defaults=S;g.use=function(...o){return _.use(...o),g.defaults=_.defaults,Te(g.defaults),g};g.walkTokens=function(o,t){return _.walkTokens(o,t)};g.parseInline=_.parseInline;g.Parser=y;g.parser=y.parse;g.Renderer=U;g.TextRenderer=ce;g.Lexer=w;g.lexer=w.lex;g.Tokenizer=N;g.Hooks=v;g.parse=g;g.options;g.setOptions;g.use;g.walkTokens;g.parseInline;y.parse;w.lex;const Pe=Fe("actions");let $=null,R=null,G="light",K=!1,C=!1,O=!1,$e=!1,Y=null,qe=null;const E=new Set,ee=new Set,P=[];let D=!1;const j=[];function Bt(o){return j.push(o),()=>{const t=j.indexOf(o);t>-1&&j.splice(t,1)}}function Lt(){for(const o of j)try{o()}catch(t){Pe.error("Error in language listener",t)}}async function X(){return $||R||(R=(async()=>(await Ze()).createHighlighter({themes:["github-light","github-light-high-contrast","github-dark"],langs:[]}))().catch(o=>{throw R=null,o}),$=await R,R=null,$)}async function Ze(){return Y||(Y=Ne(()=>import("./bundle-full-CWbff1l0.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])).then(o=>(qe=o.bundledLanguages,o))),Y}function Be(){$||R||X().catch(o=>{Pe.warn("Failed to initialize markdown highlighter",o)})}function he(o){return o.trim().toLowerCase()}function ue(o){const t=he(o),e=qe;if(!e)return{canonical:null,raw:t};if(t in e)return{canonical:t,raw:t};for(const[n,i]of Object.entries(e)){const r=i.aliases;if(r!=null&&r.includes(t))return{canonical:n,raw:t}}return{canonical:null,raw:t}}function He(o){const t=new Set;try{const e=g.lexer(o);g.walkTokens(e,n=>{if((n==null?void 0:n.type)!=="code")return;const i=typeof n.lang=="string"?n.lang:"";i.trim()&&t.add(i.trim())})}catch{return[]}return[...t]}function Ht(o){const t=He(o);for(const e of t){const n=he(e);if(!n||n==="text")continue;const{canonical:i,raw:r}=ue(e),s=i||r;if(!(s==="text"||r==="text")&&(!$||!E.has(s)))return!0}return!1}async function St(o){if(C)return;const t=He(o);for(const e of t){const n=he(e);n&&n!=="text"&&(E.has(n)||ee.has(n)||(ee.add(n),P.push(async()=>{try{await Ze();const{canonical:i,raw:r}=ue(e),s=i||r;if(s==="text"||r==="text")return;await(await X()).loadLanguage(s),E.add(s),E.add(r),Lt()}catch{}finally{ee.delete(n)}})))}P.length>0&&!D&&It()}async function It(){if(!(D||P.length===0)){for(D=!0;P.length>0;){const o=P.shift();o&&await o()}D=!1}}function Me(o){if(G=o?"dark":"light",$e)return;g.setOptions({breaks:!0,gfm:!0});const t=new g.Renderer;t.code=(e,n)=>{const i=Q(e),r=encodeURIComponent(i),s=n&&n.trim()?n.trim():"text",l=b(s),a=b(je("markdown.copy")),u=`
47
+ Please report this to https://github.com/markedjs/marked.`,t){const i="<p>An error occurred:</p><pre>"+x(n.message+"",!0)+"</pre>";return e?Promise.resolve(i):i}if(e)return Promise.reject(n);throw n}};const _=new _t;function g(o,t){return _.parse(o,t)}g.options=g.setOptions=function(o){return _.setOptions(o),g.defaults=_.defaults,Te(g.defaults),g};g.getDefaults=se;g.defaults=S;g.use=function(...o){return _.use(...o),g.defaults=_.defaults,Te(g.defaults),g};g.walkTokens=function(o,t){return _.walkTokens(o,t)};g.parseInline=_.parseInline;g.Parser=y;g.parser=y.parse;g.Renderer=U;g.TextRenderer=ce;g.Lexer=w;g.lexer=w.lex;g.Tokenizer=N;g.Hooks=v;g.parse=g;g.options;g.setOptions;g.use;g.walkTokens;g.parseInline;y.parse;w.lex;const Pe=Fe("actions");let $=null,R=null,G="light",K=!1,C=!1,O=!1,$e=!1,Y=null,qe=null;const E=new Set,ee=new Set,P=[];let D=!1;const j=[];function Bt(o){return j.push(o),()=>{const t=j.indexOf(o);t>-1&&j.splice(t,1)}}function Lt(){for(const o of j)try{o()}catch(t){Pe.error("Error in language listener",t)}}async function X(){return $||R||(R=(async()=>(await Ze()).createHighlighter({themes:["github-light","github-light-high-contrast","github-dark"],langs:[]}))().catch(o=>{throw R=null,o}),$=await R,R=null,$)}async function Ze(){return Y||(Y=Ne(()=>import("./bundle-full-DwOhsFtX.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])).then(o=>(qe=o.bundledLanguages,o))),Y}function Be(){$||R||X().catch(o=>{Pe.warn("Failed to initialize markdown highlighter",o)})}function he(o){return o.trim().toLowerCase()}function ue(o){const t=he(o),e=qe;if(!e)return{canonical:null,raw:t};if(t in e)return{canonical:t,raw:t};for(const[n,i]of Object.entries(e)){const r=i.aliases;if(r!=null&&r.includes(t))return{canonical:n,raw:t}}return{canonical:null,raw:t}}function He(o){const t=new Set;try{const e=g.lexer(o);g.walkTokens(e,n=>{if((n==null?void 0:n.type)!=="code")return;const i=typeof n.lang=="string"?n.lang:"";i.trim()&&t.add(i.trim())})}catch{return[]}return[...t]}function Ht(o){const t=He(o);for(const e of t){const n=he(e);if(!n||n==="text")continue;const{canonical:i,raw:r}=ue(e),s=i||r;if(!(s==="text"||r==="text")&&(!$||!E.has(s)))return!0}return!1}async function St(o){if(C)return;const t=He(o);for(const e of t){const n=he(e);n&&n!=="text"&&(E.has(n)||ee.has(n)||(ee.add(n),P.push(async()=>{try{await Ze();const{canonical:i,raw:r}=ue(e),s=i||r;if(s==="text"||r==="text")return;await(await X()).loadLanguage(s),E.add(s),E.add(r),Lt()}catch{}finally{ee.delete(n)}})))}P.length>0&&!D&&It()}async function It(){if(!(D||P.length===0)){for(D=!0;P.length>0;){const o=P.shift();o&&await o()}D=!1}}function Me(o){if(G=o?"dark":"light",$e)return;g.setOptions({breaks:!0,gfm:!0});const t=new g.Renderer;t.code=(e,n)=>{const i=Q(e),r=encodeURIComponent(i),s=n&&n.trim()?n.trim():"text",l=b(s),a=b(je("markdown.copy")),u=`
48
48
  <div class="code-block-header">
49
49
  <span class="code-block-language">${l}</span>
50
50
  <button class="code-block-copy" data-code="${r}">
@@ -12,4 +12,4 @@ ${a}
12
12
  }`:Ze(a,[`.${t}`],{extraProperties:e.extraProperties,propertyNameCache:r}).join(`
13
13
  `)).join(`
14
14
  `);return((i=e.cache)==null?void 0:i.create(e.name,o,e.componentId))||Zn(e.name,o,e.componentId)}function Qn(e,t){"styleSheet"in e?e.styleSheet.cssText=t:(e.innerText="",e.appendChild(document.createTextNode(t)))}function ms(e,t){for(const n in t){const r=t[n];r!==void 0&&(r===null?e.removeAttribute(n):e.setAttribute(n,r))}}function ys(e,t){const n=document.createElement("style");return n.type="text/css",t&&ms(n,t),Qn(n,e),n}function Tt(e){let t=Number(e.getAttribute("data-uses"));t++,e.setAttribute("data-uses",t.toString())}const ln="suid-injectFirst";function bs(e,t,n){Array.isArray(e)&&(e=e.join(`
15
- `));const r=t==null?void 0:t.id,o=document.head||document.getElementsByTagName("head")[0],s=r&&document.getElementById(r);if(s&&s instanceof HTMLStyleElement)return Qn(s,e),Tt(s),s;{s&&s.remove();const i=ys(e,t);if(Tt(i),n){let a=o.querySelector(`#${ln}`);a||(a=document.createElement("style"),a.setAttribute("id",ln),o.prepend(a)),o.insertBefore(i,a)}else o.appendChild(i);return i}}function ws(e,t="css-"){if(typeof e=="string")return document.getElementById(e);const n=[...e.classList].find(r=>r.startsWith(t));if(n)return document.getElementById(n.slice(t.length))}function un(e,t=!0){let n=Number(e.getAttribute("data-uses"));n--,n<=0?t?e.remove():e.setAttribute("data-uses","0"):e.setAttribute("data-uses",n.toString())}function fc(e){if(typeof e!="string")throw new Error("MUI: `capitalize(string)` expects a string argument.");return e.charAt(0).toUpperCase()+e.slice(1)}function hc(e,t=166){let n;function r(...o){const s=()=>{e.apply(null,o)};clearTimeout(n),n=setTimeout(s,t)}return r.clear=()=>{clearTimeout(n)},r}function gc(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}function Cs(e){return e&&e.ownerDocument||document}function pc(e){return Cs(e).defaultView||window}function er(){return Math.random().toString(36).substring(2,15).slice(0,8)}let ct=!0,Pt=!1,dn;const Ss={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function Os(e){const{type:t,tagName:n}=e;return!!(n==="INPUT"&&Ss[t]&&!e.readOnly||n==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function xs(e){e.metaKey||e.altKey||e.ctrlKey||(ct=!0)}function yt(){ct=!1}function vs(){this.visibilityState==="hidden"&&Pt&&(ct=!0)}function ks(e){e.addEventListener("keydown",xs,!0),e.addEventListener("mousedown",yt,!0),e.addEventListener("pointerdown",yt,!0),e.addEventListener("touchstart",yt,!0),e.addEventListener("visibilitychange",vs,!0)}function $s(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return ct||Os(t)}function mc(){const e=s=>{s!=null&&ks(s.ownerDocument)},[t,n]=$(!1);function r(){return t()?(Pt=!0,window.clearTimeout(dn),dn=window.setTimeout(()=>{Pt=!1},100),n(!1),!0):!1}function o(s){return $s(s)?(n(!0),!0):!1}return{isFocusVisibleRef:{get current(){return t()}},onFocus:o,onBlur:r,ref:e}}const As=new gs;function Es(e){return e?Array.isArray(e)?e.flat(1/0).filter(t=>!!t):[e]:[]}function Is(){if(!O.context)return er();const e=Ur().replaceAll("-",""),t=9,n=Math.ceil(e.length/t),r=[];for(let o=1;o<=n;++o){const s=(o-1)*t,i=Number(e.slice(s,s+t));r.push(i.toString(32))}return r.join("-")}function tr(e){const t=Le($o),[n,r]=$(""),o=Is();let s,i=!1;return Q(a=>{var l;const c=e();let u;if(c){const d=us(Es(c));i="@global"in d,u=ps({name:"css",props:d,cache:As,componentId:o}),s=ws(u.id),s?Tt(s):s=bs(u.rules,{id:u.id,nonce:(l=t.cache)==null?void 0:l.nonce},t.injectFirst),a!=null&&a.styleElement&&un(a.styleElement)}return typeof(u==null?void 0:u.className)=="string"?r(u.className):r(""),{className:u==null?void 0:u.className,styleElement:s}},void 0),be(()=>{s&&un(s,t.cleanupStyles??i)}),n}function de(e,t,n={}){for(const r in e){const o=e[r];if(Xn(r))n[r]=de(o,t);else if(It(r))n[r]=de(o,t);else if(Yn(r)){n[r]={};for(const s in o)n[r][s]=de(o[s],t)}else if(Jn(r))n[r]=de(o,t);else{const s=t(r,o);if(s)for(const i in s)n[i]=It(i)?{...n[i],...s[i]}:s[i];else n[r]=o}}return n}const Ts=new Set(["animationIterationCount","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","columns","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridRow","gridRowEnd","gridRowSpan","gridRowStart","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","msGridRow","msGridRowSpan","msGridColumn","msGridColumnSpan","fontWeight","lineHeight","opacity","order","orphans","tabSize","widows","zIndex","zoom","WebkitLineClamp","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth"]);function nr(e,t){if(typeof t=="number")return{[e]:Ts.has(e)?t.toString():`${t}px`}}function fn(e,t={}){return de(e,nr,t)}function Qe(e,t,n){if(typeof n!="string")return n;const r=n.split(".");let o=e[t];for(let s=0;s<r.length&&(o=o==null?void 0:o[r[s]],!!o);s++);return o??n}function Ps(e,t){return t.split(".").reduce((n,r)=>n&&n[r]?n[r]:null,e)}function Ms(e,t,n,r){const o=Ps(e,t)||n;return typeof o=="number"?s=>typeof s=="string"?s:o*s:Array.isArray(o)?s=>typeof s=="string"?s:o[s]:typeof o=="function"?o:()=>{}}const q={x:["Left","Right"],y:["Top","Bottom"]};function rr(e){return typeof e=="number"?`${e}px`:e}function or(e,t){return(n,r)=>t(e,n,r)}function h(e,t){return t?(n,r)=>({[e]:t(e,n,r)}):n=>({[e]:n})}function Ie(e){return h(e,(t,n)=>rr(n))}function M(e,t,n){const r=t.map(o=>`${e}${o}`);return n?(o,s)=>r.reduce((i,a)=>(i[a]=n(a,o,s),i),{}):o=>r.reduce((s,i)=>(s[i]=o,s),{})}function Fs(){return{...Ds(),...Ls(),...Rs(),...Ns(),...Bs(),...Us(),...js(),...Vs(),..._s()}}function Ds(){return{displayPrint:or("displayPrint",(e,t)=>({"@media print":{display:t}})),displayRaw:h("display"),overflow:h("overflow"),textOverflow:h("textOverflow"),visibility:h("visibility"),whiteSpace:h("whiteSpace")}}function Ls(){return{flexBasis:h("flexBasis"),flexDirection:h("flexDirection"),flexWrap:h("flexWrap"),justifyContent:h("justifyContent"),alignItems:h("alignItems"),alignContent:h("alignContent"),order:h("order"),flex:h("flex"),flexGrow:h("flexGrow"),flexShrink:h("flexShrink"),alignSelf:h("alignSelf"),justifyItems:h("justifyItems"),justifySelf:h("justifySelf")}}function Rs(){const e=(t,n,r)=>Ms(r,"spacing",8)(n);return{gap:h("gap",e),columnGap:h("columnGap",e),rowGap:h("rowGap",e),gridColumn:h("gridColumn"),gridRow:h("gridRow"),gridAutoFlow:h("gridAutoFlow"),gridAutoColumns:h("gridAutoColumns"),gridAutoRows:h("gridAutoRows"),gridTemplateColumns:h("gridTemplateColumns"),gridTemplateRows:h("gridTemplateRows"),gridTemplateAreas:h("gridTemplateAreas"),gridArea:h("gridArea")}}function Ns(){return{position:h("position"),zIndex:h("zIndex",(e,t,n)=>{var r;return((r=n.zIndex)==null?void 0:r[e])??t}),top:Ie("top"),right:Ie("right"),bottom:Ie("bottom"),left:Ie("left")}}function Bs(){const e=(t,n,r)=>Qe(r,"palette",n);return{color:h("color",e),bgcolor:h("backgroundColor",e),backgroundColor:h("backgroundColor",e)}}function Us(){const e=(t,n,r)=>(t==="maxWidth"&&(n=r.breakpoints.values[t]??n),typeof n=="number"&&(n=n>0&&n<=1?`${n*100}%`:`${n}px`),n);return{width:h("width",e),maxWidth:h("maxWidth",e),minWidth:h("minWidth",e),height:h("height",e),maxHeight:h("maxHeight",e),minHeight:h("minHeight",e),boxSizing:h("boxSizing",e)}}function js(){const e=(n,r)=>typeof r=="number"?`${r}px solid`:r,t=(n,r,o)=>Qe(o,"palette",r);return{border:h("border",e),borderTop:h("borderTop",e),borderRight:h("borderRight",e),borderBottom:h("borderBottom",e),borderLeft:h("borderLeft",e),borderColor:h("borderColor",t),borderTopColor:h("borderTopColor",t),borderRightColor:h("borderRightColor",t),borderBottomColor:h("borderBottomColor",t),borderLeftColor:h("borderLeftColor",t),borderRadius:h("borderRadius",(n,r,o)=>typeof r=="number"?`${o.shape.borderRadius*r}px`:r)}}function _s(){const e=(t,n,r)=>Qe(r,"typography",n);return{typography:or("typography",(t,n,r)=>Qe(r,"typography",n)),fontFamily:h("fontFamily",e),fontSize:h("fontSize",(t,n,r)=>rr(e(t,n,r))),fontStyle:h("fontStyle",e),fontWeight:h("fontWeight",e),letterSpacing:Ie("letterSpacing"),lineHeight:h("lineHeight"),textAlign:h("textAlign"),textTransform:h("textTransform")}}function Vs(){const e=(r,o,s)=>s.spacing(o),t="margin",n="padding";return{m:h(t,e),mt:h("marginTop",e),mr:h("marginRight",e),mb:h("marginBottom",e),ml:h("marginLeft",e),mx:M(t,q.x,e),my:M(t,q.y,e),margin:h(t,e),marginTop:h("marginTop",e),marginRight:h("marginRight",e),marginBottom:h("marginBottom",e),marginLeft:h("marginLeft",e),marginX:M(t,q.x,e),marginY:M(t,q.y,e),marginInline:M(t,["Inline","InlineStart"],e),marginInlineStart:h("marginInlineStart",e),marginInlineEnd:h("marginInlineEnd",e),marginBlock:M(t,["BlockStart","BlockEnd"],e),marginBlockStart:h("marginBlockStart",e),marginBlockEnd:h("marginBlockEnd",e),p:h(n,e),pt:h("paddingTop",e),pr:h("paddingRight",e),pb:h("paddingBottom",e),pl:h("paddingLeft",e),px:M(n,q.x,e),py:M(n,q.y,e),padding:h(n,e),paddingTop:h("paddingTop",e),paddingRight:h("paddingRight",e),paddingBottom:h("paddingBottom",e),paddingLeft:h("paddingLeft",e),paddingX:M(n,q.x,e),paddingY:M(n,q.y,e),paddingInline:M(n,["Inline","InlineStart"],e),paddingInlineStart:h("paddingInlineStart",e),paddingInlineEnd:h("paddingInlineEnd",e),paddingBlock:M(n,["BlockStart","BlockEnd"],e),paddingBlockStart:h("paddingBlockStart",e),paddingBlockEnd:h("paddingBlockEnd",e)}}const Kt=Fs(),yc=Object.keys(Kt);function Ws(e,t,n){return Kt[e](t,n)}function hn(e,t,n){return e in Kt?Ws(e,t,n):nr(e,t)}function zs(e,t){return de(e,(n,r)=>{if(typeof r=="function"&&(r=r(t)),r==null)return r;if(typeof r=="object"){const o={};for(const s of t.breakpoints.keys)o[t.breakpoints.up(s)]={};return Object.assign(o,vo({theme:t},r,s=>hn(n,s,t)??{[n]:s}))}else return hn(n,r,t)})}function sr(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=sr(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ks(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=sr(e))&&(r&&(r+=" "),r+=t);return r}const ir=["ownerState","theme","sx","as"];function Hs(e,t){var n,r;return(r=(n=t.components)==null?void 0:n[e])==null?void 0:r.styleOverrides}function Gs(e,t,n,r,o={}){return k(()=>{const s=e(),i=Hs(o.name,s),a=r.ownerState,c=n.reduce((l,d)=>{let f;return typeof d=="function"?f=d({ownerState:a,theme:s,get sx(){return r.sx},get as(){return r.as},props:r}):d&&(f=d),f&&l.push(fn(f,{name:t,__resolved:!0})),l},[]);let u=[];return o.overridesResolver&&typeof o.overridesResolver=="function"&&i&&(u=o.overridesResolver(r,i).map(l=>l?fn(l,{}):null).filter(Boolean)),c.concat(u)})}function ar(e,t){e.__suid=t}function gn(e){if(typeof e=="function")return e.__suid}function qs(e){return function(n,r={}){let o,s;if(r.name){const a=r.slot||"Root";s=o=`${r.name}-${a.slice(0,1).toLowerCase()+a.slice(1)}`}else s=`styled-${er()}`,o="css";const i=gn(n);return function(...a){function c(u){let l;const d=()=>{const A=u.theme;return A||l||(l=e&&e.onUseTheme?e.onUseTheme():zt())},[,f]=ot(u,r.skipProps||ir),g=Gs(d,o,a,u,r),p=()=>{const A=u.sx;return A?Array.isArray(A)?A:[A]:[]},b=()=>{if(i)return n;const A=u.as;return A||n},y=i?()=>i:k(()=>gn(b())),x=r.skipSx?()=>g():()=>{const A=d();return[...g(),...p().map(G=>G.__resolved?G:zs(G,A))]},R=tr(()=>y()?void 0:x());return Gn(b,An(f,{get children(){return u.children},get component(){return y()?u.component:null},get as(){return i?u.as:void 0},get sx(){return y()?x():void 0},get ownerState(){return y()==="system"?u.ownerState:void 0},get class(){return Ks([...new Set([u.class,s,R()])])}}))}return ar(c,"system"),s&&(c.toString=()=>`.${s}`),c}}}const bc=[...ir,"classes"],wc=qs({onUseTheme:()=>Hn()}),Js="codenomad.client-id",Xs="codenomad.connection-id";let _e=null,Ve=null;function Mt(){return{clientId:Ys(),connectionId:Zs()}}function Ys(){return _e||(_e=cr(Js,window.localStorage),_e)}function Zs(){return Ve||(Ve=cr(Xs,window.sessionStorage),Ve)}function cr(e,t){if(typeof window>"u")return bt();try{const r=t.getItem(e);if(r&&r.trim())return r.trim()}catch{return bt()}const n=bt();try{t.setItem(e,n)}catch{}return n}function bt(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var Ft={exports:{}},wt,pn;function Qs(){if(pn)return wt;pn=1;var e=1e3,t=e*60,n=t*60,r=n*24,o=r*7,s=r*365.25;wt=function(l,d){d=d||{};var f=typeof l;if(f==="string"&&l.length>0)return i(l);if(f==="number"&&isFinite(l))return d.long?c(l):a(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))};function i(l){if(l=String(l),!(l.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(d){var f=parseFloat(d[1]),g=(d[2]||"ms").toLowerCase();switch(g){case"years":case"year":case"yrs":case"yr":case"y":return f*s;case"weeks":case"week":case"w":return f*o;case"days":case"day":case"d":return f*r;case"hours":case"hour":case"hrs":case"hr":case"h":return f*n;case"minutes":case"minute":case"mins":case"min":case"m":return f*t;case"seconds":case"second":case"secs":case"sec":case"s":return f*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function a(l){var d=Math.abs(l);return d>=r?Math.round(l/r)+"d":d>=n?Math.round(l/n)+"h":d>=t?Math.round(l/t)+"m":d>=e?Math.round(l/e)+"s":l+"ms"}function c(l){var d=Math.abs(l);return d>=r?u(l,d,r,"day"):d>=n?u(l,d,n,"hour"):d>=t?u(l,d,t,"minute"):d>=e?u(l,d,e,"second"):l+" ms"}function u(l,d,f,g){var p=d>=f*1.5;return Math.round(l/f)+" "+g+(p?"s":"")}return wt}function ei(e){n.debug=n,n.default=n,n.coerce=c,n.disable=i,n.enable=o,n.enabled=a,n.humanize=Qs(),n.destroy=u,Object.keys(e).forEach(l=>{n[l]=e[l]}),n.names=[],n.skips=[],n.formatters={};function t(l){let d=0;for(let f=0;f<l.length;f++)d=(d<<5)-d+l.charCodeAt(f),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(l){let d,f=null,g,p;function b(...y){if(!b.enabled)return;const x=b,R=Number(new Date),A=R-(d||R);x.diff=A,x.prev=d,x.curr=R,d=R,y[0]=n.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let G=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(gt,Fr)=>{if(gt==="%%")return"%";G++;const Xt=n.formatters[Fr];if(typeof Xt=="function"){const Dr=y[G];gt=Xt.call(x,Dr),y.splice(G,1),G--}return gt}),n.formatArgs.call(x,y),(x.log||n.log).apply(x,y)}return b.namespace=l,b.useColors=n.useColors(),b.color=n.selectColor(l),b.extend=r,b.destroy=n.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(g!==n.namespaces&&(g=n.namespaces,p=n.enabled(l)),p),set:y=>{f=y}}),typeof n.init=="function"&&n.init(b),b}function r(l,d){const f=n(this.namespace+(typeof d>"u"?":":d)+l);return f.log=this.log,f}function o(l){n.save(l),n.namespaces=l,n.names=[],n.skips=[];const d=(typeof l=="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const f of d)f[0]==="-"?n.skips.push(f.slice(1)):n.names.push(f)}function s(l,d){let f=0,g=0,p=-1,b=0;for(;f<l.length;)if(g<d.length&&(d[g]===l[f]||d[g]==="*"))d[g]==="*"?(p=g,b=f,g++):(f++,g++);else if(p!==-1)g=p+1,b++,f=b;else return!1;for(;g<d.length&&d[g]==="*";)g++;return g===d.length}function i(){const l=[...n.names,...n.skips.map(d=>"-"+d)].join(",");return n.enable(""),l}function a(l){for(const d of n.skips)if(s(l,d))return!1;for(const d of n.names)if(s(l,d))return!0;return!1}function c(l){return l instanceof Error?l.stack||l.message:l}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var ti=ei;(function(e,t){var n={};t.formatArgs=o,t.save=s,t.load=i,t.useColors=r,t.storage=a(),t.destroy=(()=>{let u=!1;return()=>{u||(u=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let u;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(u=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(u[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o(u){if(u[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+u[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;u.splice(1,0,l,"color: inherit");let d=0,f=0;u[0].replace(/%[a-zA-Z%]/g,g=>{g!=="%%"&&(d++,g==="%c"&&(f=d))}),u.splice(f,0,l)}t.log=console.debug||console.log||(()=>{});function s(u){try{u?t.storage.setItem("debug",u):t.storage.removeItem("debug")}catch{}}function i(){let u;try{u=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch{}return!u&&typeof process<"u"&&"env"in process&&(u=n.DEBUG),u}function a(){try{return localStorage}catch{}}e.exports=ti(t);const{formatters:c}=e.exports;c.j=function(u){try{return JSON.stringify(u)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}})(Ft,Ft.exports);var ni=Ft.exports;const Dt=_r(ni),ve=["sse","api","session","actions"],lr="opencode:logger:namespaces",Ct=new Map,j=new Set,V=typeof globalThis<"u"?globalThis.console:void 0;function Ne(){j.size===0?Dt.disable():Dt.enable(Array.from(j).join(","))}function lt(){var e;if(!(typeof window>"u"||!(window!=null&&window.localStorage)))try{window.localStorage.setItem(lr,JSON.stringify(Array.from(j)))}catch(t){(e=V==null?void 0:V.warn)==null||e.call(V,"Failed to persist logger namespaces",t)}}function ri(){var e;if(!(typeof window>"u"||!(window!=null&&window.localStorage)))try{const t=window.localStorage.getItem(lr);if(!t)return;const n=JSON.parse(t);if(!Array.isArray(n))return;for(const r of n)ve.includes(r)&&j.add(r)}catch(t){(e=V==null?void 0:V.warn)==null||e.call(V,"Failed to hydrate logger namespaces",t)}}ri();Ne();function oi(e){const n=Dt(e),r=(o,s)=>{n(o,...s)};return{log:(...o)=>n(...o),info:(...o)=>n(...o),warn:(...o)=>r("[warn]",o),error:(...o)=>r("[error]",o)}}function ie(e){if(!ve.includes(e))throw new Error(`Unknown logger namespace: ${e}`);return Ct.has(e)||Ct.set(e,oi(e)),Ct.get(e)}function si(){return ve.map(e=>({name:e,enabled:j.has(e)}))}function ii(e){if(!ve.includes(e))throw new Error(`Unknown logger namespace: ${e}`);j.has(e)||(j.add(e),lt(),Ne())}function ai(e){if(!ve.includes(e))throw new Error(`Unknown logger namespace: ${e}`);j.has(e)&&(j.delete(e),lt(),Ne())}function ci(){j.clear(),lt(),Ne()}function li(){ve.forEach(e=>j.add(e)),lt(),Ne()}const ui={listLoggerNamespaces:si,enableLogger:ii,disableLogger:ai,enableAllLoggers:li,disableAllLoggers:ci};function di(){typeof window>"u"||(window.codenomadLogger=ui)}di();var kn;const fi=typeof window<"u"?(kn=window.location)==null?void 0:kn.origin:void 0,hi=typeof window<"u"?window.__CODENOMAD_API_BASE__??fi:void 0,gi=typeof window<"u"?window.__CODENOMAD_EVENTS_URL__??"/api/events":"/api/events",X=hi,St=pi(X,gi),Cc=X;function Sc(e,t){const n=encodeURIComponent(e),r=encodeURIComponent(t);return mi(`/workspaces/${n}/plugin/background-processes/${r}/stream`)}function pi(e,t){if(t.startsWith("http://")||t.startsWith("https://"))return t;if(e){const n=t.startsWith("/")?t:`/${t}`;return`${e}${n}`}return t}function mi(e){if(e.startsWith("http://")||e.startsWith("https://")||!X)return e;const t=e.startsWith("/")?e:`/${e}`;return`${X}${t}`}const mn=ie("api"),We=ie("sse");function ur(e){const t={};if(!e)return t;if(e instanceof Headers)return e.forEach((n,r)=>{t[r]=n}),t;if(Array.isArray(e)){for(const[n,r]of e)t[n]=r;return t}return{...e}}function Z(e,t){if(t){mn.info(e,t);return}mn.info(e)}async function m(e,t){const n=X?new URL(e,X).toString():e,r=ur(t==null?void 0:t.headers);(t==null?void 0:t.body)!==void 0&&(r["Content-Type"]="application/json");const o=((t==null?void 0:t.method)??"GET").toUpperCase(),s=Date.now();Z(`${o} ${e}`);try{const i=await fetch(n,{...t,headers:r,credentials:(t==null?void 0:t.credentials)??"include"});if(!i.ok){const c=await i.text();throw Z(`${o} ${e} -> ${i.status}`,{durationMs:Date.now()-s,error:c}),new Error(c||`Request failed with ${i.status}`)}const a=Date.now()-s;return Z(`${o} ${e} -> ${i.status}`,{durationMs:a}),i.status===204?void 0:await i.json()}catch(i){throw Z(`${o} ${e} failed`,{durationMs:Date.now()-s,error:i}),i}}async function yi(e,t){const n=X?new URL(e,X).toString():e,r=ur(t==null?void 0:t.headers);(t==null?void 0:t.body)!==void 0&&!r["Content-Type"]&&(r["Content-Type"]="application/json");const o=((t==null?void 0:t.method)??"GET").toUpperCase(),s=Date.now();Z(`${o} ${e}`);const i=await fetch(n,{...t,headers:r,credentials:(t==null?void 0:t.credentials)??"include"});if(!i.ok){const a=await i.text();throw Z(`${o} ${e} -> ${i.status}`,{durationMs:Date.now()-s,error:a}),new Error(a||`Request failed with ${i.status}`)}return Z(`${o} ${e} -> ${i.status}`,{durationMs:Date.now()-s}),i}const _={fetchWorkspaces(){return m("/api/workspaces")},fetchWorktrees(e){return m(`/api/workspaces/${encodeURIComponent(e)}/worktrees`)},createWorktree(e,t){return m(`/api/workspaces/${encodeURIComponent(e)}/worktrees`,{method:"POST",body:JSON.stringify(t)})},deleteWorktree(e,t,n){const r=new URLSearchParams;n!=null&&n.force&&r.set("force","true");const o=r.toString()?`?${r.toString()}`:"";return m(`/api/workspaces/${encodeURIComponent(e)}/worktrees/${encodeURIComponent(t)}${o}`,{method:"DELETE"})},readWorktreeMap(e){return m(`/api/workspaces/${encodeURIComponent(e)}/worktrees/map`)},writeWorktreeMap(e,t){return m(`/api/workspaces/${encodeURIComponent(e)}/worktrees/map`,{method:"PUT",body:JSON.stringify(t)})},createWorkspace(e){return m("/api/workspaces",{method:"POST",body:JSON.stringify(e)})},fetchServerMeta(){return m("/api/meta")},probeRemoteServer(e){return m("/api/remote-servers/probe",{method:"POST",body:JSON.stringify(e)})},fetchAuthStatus(){return m("/api/auth/status")},setServerPassword(e){return m("/api/auth/password",{method:"POST",body:JSON.stringify({password:e})})},deleteWorkspace(e){return m(`/api/workspaces/${encodeURIComponent(e)}`,{method:"DELETE"})},listWorkspaceFiles(e,t="."){const n=new URLSearchParams({path:t});return m(`/api/workspaces/${encodeURIComponent(e)}/files?${n.toString()}`)},searchWorkspaceFiles(e,t,n){const r=t.trim();if(!r)return Promise.resolve([]);const o=new URLSearchParams({q:r});return n!=null&&n.limit&&o.set("limit",String(n.limit)),n!=null&&n.type&&o.set("type",n.type),m(`/api/workspaces/${encodeURIComponent(e)}/files/search?${o.toString()}`)},readWorkspaceFile(e,t){const n=new URLSearchParams({path:t});return m(`/api/workspaces/${encodeURIComponent(e)}/files/content?${n.toString()}`)},writeWorkspaceFile(e,t,n){const r=new URLSearchParams({path:t});return m(`/api/workspaces/${encodeURIComponent(e)}/files/content?${r.toString()}`,{method:"PUT",body:JSON.stringify({contents:n})})},fetchConfigOwner(e){return m(`/api/storage/config/${encodeURIComponent(e)}`)},patchConfigOwner(e,t){return m(`/api/storage/config/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t??{})})},fetchStateOwner(e){return m(`/api/storage/state/${encodeURIComponent(e)}`)},patchStateOwner(e,t){return m(`/api/storage/state/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t??{})})},validateBinary(e){return m("/api/storage/binaries/validate",{method:"POST",body:JSON.stringify({path:e})})},fetchSpeechCapabilities(){return m("/api/speech/capabilities")},transcribeAudio(e){return m("/api/speech/transcribe",{method:"POST",body:JSON.stringify(e)})},synthesizeSpeech(e){return m("/api/speech/synthesize",{method:"POST",body:JSON.stringify(e)})},synthesizeSpeechStream(e,t){return yi("/api/speech/synthesize/stream",{method:"POST",body:JSON.stringify(e),signal:t})},listFileSystem(e,t){const n=new URLSearchParams;e&&e!=="."&&n.set("path",e),(t==null?void 0:t.includeFiles)!==void 0&&n.set("includeFiles",String(t.includeFiles));const r=n.toString();return m(r?`/api/filesystem?${r}`:"/api/filesystem")},createFileSystemFolder(e,t){return m("/api/filesystem/folders",{method:"POST",body:JSON.stringify({parentPath:e,name:t})})},readInstanceData(e){return m(`/api/storage/instances/${encodeURIComponent(e)}`)},writeInstanceData(e,t){return m(`/api/storage/instances/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})},deleteInstanceData(e){return m(`/api/storage/instances/${encodeURIComponent(e)}`,{method:"DELETE"})},listBackgroundProcesses(e){return m(`/workspaces/${encodeURIComponent(e)}/plugin/background-processes`)},stopBackgroundProcess(e,t){return m(`/workspaces/${encodeURIComponent(e)}/plugin/background-processes/${encodeURIComponent(t)}/stop`,{method:"POST"})},terminateBackgroundProcess(e,t){return m(`/workspaces/${encodeURIComponent(e)}/plugin/background-processes/${encodeURIComponent(t)}/terminate`,{method:"POST"})},updateVoiceMode(e,t){const n=Mt();return m(`/workspaces/${encodeURIComponent(e)}/plugin/voice-mode`,{method:"POST",body:JSON.stringify({...n,enabled:t})})},sendClientConnectionPong(e){return m("/api/client-connections/pong",{method:"POST",body:JSON.stringify(e)})},fetchBackgroundProcessOutput(e,t,n){const r=new URLSearchParams;n!=null&&n.method&&r.set("method",n.method),n!=null&&n.pattern&&r.set("pattern",n.pattern),n!=null&&n.lines&&r.set("lines",String(n.lines)),(n==null?void 0:n.maxBytes)!==void 0&&r.set("maxBytes",String(n.maxBytes));const o=r.toString(),s=o?`?${o}`:"";return m(`/workspaces/${encodeURIComponent(e)}/plugin/background-processes/${encodeURIComponent(t)}/output${s}`)},connectEvents(e,t,n){const r=Mt(),o=bi(r);We.info(`Connecting to ${o}`);const s=new EventSource(o,{withCredentials:!0});return s.onmessage=i=>{try{const a=JSON.parse(i.data);e(a)}catch(a){We.error("Failed to parse event",a)}},s.onerror=()=>{We.warn("EventSource error, closing stream"),t==null||t()},s.addEventListener("codenomad.client.ping",i=>{try{const a=i.data?JSON.parse(i.data):{};n==null||n(a)}catch(a){We.error("Failed to parse ping event",a)}}),s}};function bi(e){const t=new URL(St,typeof window<"u"?window.location.origin:"http://localhost");return t.searchParams.set("clientId",e.clientId),t.searchParams.set("connectionId",e.connectionId),St.startsWith("http://")||St.startsWith("https://")?t.toString():`${t.pathname}${t.search}`}const yn=1e3,wi=1e4,Lt=ie("sse");function ze(e,t){if(t){Lt.info(e,t);return}Lt.info(e)}class Ci{constructor(){this.handlers=new Map,this.openHandlers=new Set,this.source=null,this.retryDelay=yn,this.connect()}connect(){this.source&&this.source.close(),ze("Connecting to backend events stream"),this.source=_.connectEvents(t=>this.dispatch(t),()=>this.scheduleReconnect(),t=>{_.sendClientConnectionPong({...Mt(),pingTs:t.ts}).catch(n=>{Lt.error("Failed to send client connection pong",n)})}),this.source.onopen=()=>{ze("Events stream connected"),this.retryDelay=yn,this.openHandlers.forEach(t=>t())}}scheduleReconnect(){this.source&&(this.source.close(),this.source=null),ze("Events stream disconnected, scheduling reconnect",{delayMs:this.retryDelay}),setTimeout(()=>{this.retryDelay=Math.min(this.retryDelay*2,wi),this.connect()},this.retryDelay)}dispatch(t){var n,r;ze(`event ${t.type}`),(n=this.handlers.get("*"))==null||n.forEach(o=>o(t)),(r=this.handlers.get(t.type))==null||r.forEach(o=>o(t))}on(t,n){this.handlers.has(t)||this.handlers.set(t,new Set);const r=this.handlers.get(t);return r.add(n),()=>r.delete(n)}onOpen(t){return this.openHandlers.add(t),()=>this.openHandlers.delete(t)}}const Ot=new Ci,Si=ie("actions"),bn={messageHistory:[],agentModelSelections:{}};function wn(e,t){if(e===t)return!0;if(typeof e=="object"&&e!==null&&typeof t=="object"&&t!==null)try{return JSON.stringify(e)===JSON.stringify(t)}catch(n){Si.warn("Failed to compare config objects",n)}return!1}class Oi{constructor(){this.configOwnerCache=new Map,this.stateOwnerCache=new Map,this.configOwnerLoadPromises=new Map,this.stateOwnerLoadPromises=new Map,this.configOwnerListeners=new Map,this.stateOwnerListeners=new Map,this.instanceDataCache=new Map,this.instanceDataListeners=new Map,this.instanceLoadPromises=new Map,Ot.on("storage.configChanged",t=>{t.type==="storage.configChanged"&&this.setOwnerCache("config",t.owner,t.value)}),Ot.on("storage.stateChanged",t=>{t.type==="storage.stateChanged"&&this.setOwnerCache("state",t.owner,t.value)}),Ot.on("instance.dataChanged",t=>{t.type==="instance.dataChanged"&&this.setInstanceDataCache(t.instanceId,t.data)})}async loadConfigOwner(t){const n=this.configOwnerCache.get(t);if(n)return n;if(!this.configOwnerLoadPromises.has(t)){const r=_.fetchConfigOwner(t).then(o=>(this.setOwnerCache("config",t,o),o)).finally(()=>{this.configOwnerLoadPromises.delete(t)});this.configOwnerLoadPromises.set(t,r)}return this.configOwnerLoadPromises.get(t)}async patchConfigOwner(t,n){const r=await _.patchConfigOwner(t,n);return this.setOwnerCache("config",t,r),r}async loadStateOwner(t){const n=this.stateOwnerCache.get(t);if(n)return n;if(!this.stateOwnerLoadPromises.has(t)){const r=_.fetchStateOwner(t).then(o=>(this.setOwnerCache("state",t,o),o)).finally(()=>{this.stateOwnerLoadPromises.delete(t)});this.stateOwnerLoadPromises.set(t,r)}return this.stateOwnerLoadPromises.get(t)}async patchStateOwner(t,n){const r=await _.patchStateOwner(t,n);return this.setOwnerCache("state",t,r),r}async loadInstanceData(t){const n=this.instanceDataCache.get(t);if(n)return n;if(!this.instanceLoadPromises.has(t)){const r=_.readInstanceData(t).then(o=>{const s=this.normalizeInstanceData(o);return this.setInstanceDataCache(t,s),s}).finally(()=>{this.instanceLoadPromises.delete(t)});this.instanceLoadPromises.set(t,r)}return this.instanceLoadPromises.get(t)}async saveInstanceData(t,n){const r=this.normalizeInstanceData(n);await _.writeInstanceData(t,r),this.setInstanceDataCache(t,r)}async deleteInstanceData(t){await _.deleteInstanceData(t),this.setInstanceDataCache(t,bn)}onConfigOwnerChanged(t,n){this.configOwnerListeners.has(t)||this.configOwnerListeners.set(t,new Set);const r=this.configOwnerListeners.get(t);r.add(n);const o=this.configOwnerCache.get(t);return o&&n(o),()=>{r.delete(n),r.size===0&&this.configOwnerListeners.delete(t)}}onStateOwnerChanged(t,n){this.stateOwnerListeners.has(t)||this.stateOwnerListeners.set(t,new Set);const r=this.stateOwnerListeners.get(t);r.add(n);const o=this.stateOwnerCache.get(t);return o&&n(o),()=>{r.delete(n),r.size===0&&this.stateOwnerListeners.delete(t)}}onInstanceDataChanged(t,n){this.instanceDataListeners.has(t)||this.instanceDataListeners.set(t,new Set);const r=this.instanceDataListeners.get(t);r.add(n);const o=this.instanceDataCache.get(t);return o&&n(o),()=>{r.delete(n),r.size===0&&this.instanceDataListeners.delete(t)}}setOwnerCache(t,n,r){if(n==="*"){t==="config"?this.configOwnerCache.clear():this.stateOwnerCache.clear();return}const o=t==="config"?this.configOwnerCache:this.stateOwnerCache,s=t==="config"?this.configOwnerListeners:this.stateOwnerListeners,i=o.get(n);if(i&&wn(i,r)){o.set(n,r);return}o.set(n,r);const a=s.get(n);if(a)for(const c of a)c(r)}normalizeInstanceData(t){const n=t??bn,r=Array.isArray(n.messageHistory)?[...n.messageHistory]:[],o={...n.agentModelSelections??{}};return{...n,messageHistory:r,agentModelSelections:o}}setInstanceDataCache(t,n){const r=this.normalizeInstanceData(n),o=this.instanceDataCache.get(t);if(o&&wn(o,r)){this.instanceDataCache.set(t,r);return}this.instanceDataCache.set(t,r),this.notifyInstanceDataChanged(t,r)}notifyInstanceDataChanged(t,n){const r=this.instanceDataListeners.get(t);if(r)for(const o of r)o(n)}}const B=new Oi,dr=ie("api"),ut={messageHistory:[],agentModelSelections:{}},[Ht,fr]=$(new Map),Ke=new Map,Se=new Map;function hr(e){const t=e??ut;return{...t,messageHistory:Array.isArray(t.messageHistory)?[...t.messageHistory]:[],agentModelSelections:{...t.agentModelSelections??{}}}}function Cn(e){if(Se.has(e))return;const t=B.onInstanceDataChanged(e,n=>{et(e,n)});Se.set(e,t)}function xi(e){const t=Se.get(e);t&&(t(),Se.delete(e))}function et(e,t){fr(n=>{const r=new Map(n);return r.set(e,hr(t)),r})}async function dt(e){if(!e||Ht().has(e))return;if(Ke.has(e)){await Ke.get(e);return}const t=B.loadInstanceData(e).then(n=>{et(e,n),Cn(e)}).catch(n=>{dr.warn("Failed to load instance data",n),et(e,ut),Cn(e)}).finally(()=>{Ke.delete(e)});Ke.set(e,t),await t}async function gr(e,t){if(!e)return;await dt(e);const n=Ht().get(e)??ut,r=hr(n);t(r);try{await B.saveInstanceData(e,r)}catch(o){dr.warn("Failed to persist instance data",o)}et(e,r)}function pr(e){return Ht().get(e)??ut}function vi(e){fr(t=>{if(!t.has(e))return t;const n=new Map(t);return n.delete(e),n}),xi(e)}const ki=xe(),$i={getInstanceConfig:pr,ensureInstanceConfig:dt,updateInstanceConfig:gr,clearInstanceConfig:vi},Oc=e=>(be(()=>{for(const t of Se.values())t();Se.clear()}),te(ki.Provider,{value:$i,get children(){return e.children}})),Ai=ie("api"),[Sn,Rt]=$(null),[xc,On]=$(!1),[vc,Je]=$(null);let ke=null;async function Ei(e=!1){return!e&&Sn()?Sn():ke||(On(!0),Je(null),ke=_.fetchSpeechCapabilities().then(t=>(Rt(t),Je(null),t)).catch(t=>(Ai.error("Failed to load speech capabilities",t),Rt(null),Je(t instanceof Error?t.message:String(t)),null)).finally(()=>{On(!1),ke=null}),ke)}function Ii(){Rt(null),Je(null)}const C=ie("actions"),Ti=20,Pi=5,Mi=50,S={showThinkingBlocks:!1,showKeyboardShortcutHints:!0,thinkingBlocksExpansion:"expanded",showTimelineTools:!0,promptSubmitOnEnter:!1,showPromptVoiceInput:!0,diffViewMode:"split",toolOutputExpansion:"expanded",diagnosticsExpansion:"expanded",toolInputsVisibility:"collapsed",showUsageMetrics:!0,autoCleanupBlankSessions:!0,osNotificationsEnabled:!1,osNotificationsAllowWhenVisible:!1,notifyOnNeedsInput:!0,notifyOnIdle:!0},le={provider:"openai-compatible",sttModel:"gpt-4o-mini-transcribe",ttsModel:"gpt-4o-mini-tts",ttsVoice:"alloy",playbackMode:"streaming",ttsFormat:"mp3"};function mr(e){const t=e??{};return{showThinkingBlocks:t.showThinkingBlocks??S.showThinkingBlocks,showKeyboardShortcutHints:t.showKeyboardShortcutHints??S.showKeyboardShortcutHints,thinkingBlocksExpansion:t.thinkingBlocksExpansion??S.thinkingBlocksExpansion,showTimelineTools:t.showTimelineTools??S.showTimelineTools,promptSubmitOnEnter:t.promptSubmitOnEnter??S.promptSubmitOnEnter,showPromptVoiceInput:t.showPromptVoiceInput??S.showPromptVoiceInput,locale:t.locale??S.locale,diffViewMode:t.diffViewMode??S.diffViewMode,toolOutputExpansion:t.toolOutputExpansion??S.toolOutputExpansion,diagnosticsExpansion:t.diagnosticsExpansion??S.diagnosticsExpansion,toolInputsVisibility:t.toolInputsVisibility==="hidden"||t.toolInputsVisibility==="collapsed"||t.toolInputsVisibility==="expanded"?t.toolInputsVisibility:S.toolInputsVisibility,showUsageMetrics:t.showUsageMetrics??S.showUsageMetrics,autoCleanupBlankSessions:t.autoCleanupBlankSessions??S.autoCleanupBlankSessions,osNotificationsEnabled:t.osNotificationsEnabled??S.osNotificationsEnabled,osNotificationsAllowWhenVisible:t.osNotificationsAllowWhenVisible??S.osNotificationsAllowWhenVisible,notifyOnNeedsInput:t.notifyOnNeedsInput??S.notifyOnNeedsInput,notifyOnIdle:t.notifyOnIdle??S.notifyOnIdle}}function yr(e){if(!e||typeof e!="object"||Array.isArray(e))return{};const t={};for(const[n,r]of Object.entries(e))typeof r=="string"&&(t[n]=r);return t}function br(e){const t=e??{};return{provider:t.provider==="openai-compatible"?t.provider:le.provider,apiKey:typeof t.apiKey=="string"&&t.apiKey.trim()?t.apiKey.trim():void 0,hasApiKey:t.hasApiKey===!0||typeof t.apiKey=="string"&&t.apiKey.trim().length>0,baseUrl:typeof t.baseUrl=="string"&&t.baseUrl.trim()?t.baseUrl.trim():void 0,sttModel:typeof t.sttModel=="string"&&t.sttModel.trim()?t.sttModel.trim():le.sttModel,ttsModel:typeof t.ttsModel=="string"&&t.ttsModel.trim()?t.ttsModel.trim():le.ttsModel,ttsVoice:typeof t.ttsVoice=="string"&&t.ttsVoice.trim()?t.ttsVoice.trim():le.ttsVoice,playbackMode:t.playbackMode==="buffered"||t.playbackMode==="streaming"?t.playbackMode:le.playbackMode,ttsFormat:t.ttsFormat==="wav"||t.ttsFormat==="opus"||t.ttsFormat==="aac"||t.ttsFormat==="mp3"?t.ttsFormat:le.ttsFormat}}function $e(e,t){if(!Array.isArray(e))return[];const n=[];for(const r of e){const o=t(r);o&&n.push(o)}return n}function Fi(e){var n,r,o;const t=e??{};return{recentFolders:$e(t.recentFolders,s=>{if(!s||typeof s!="object")return null;const i=s.path,a=s.lastAccessed;if(typeof i!="string")return null;const c=typeof a=="number"?a:Date.now();return{path:i,lastAccessed:c}}),opencodeBinaries:$e(t.opencodeBinaries,s=>{if(!s||typeof s!="object")return null;const i=s.path;if(typeof i!="string")return null;const a=typeof s.lastUsed=="number"?s.lastUsed:Date.now(),c=typeof s.version=="string"?s.version:void 0,u=typeof s.label=="string"?s.label:void 0;return{path:i,version:c,label:u,lastUsed:a}}),remoteServers:$e(t.remoteServers,s=>{if(!s||typeof s!="object")return null;const i=typeof s.id=="string"?s.id.trim():"",a=typeof s.name=="string"?s.name.trim():"",c=typeof s.baseUrl=="string"?s.baseUrl.trim():"";if(!i||!a||!c)return null;const u=typeof s.createdAt=="string"?s.createdAt:new Date().toISOString(),l=typeof s.updatedAt=="string"?s.updatedAt:u,d=typeof s.lastConnectedAt=="string"?s.lastConnectedAt:void 0;return{id:i,name:a,baseUrl:c,skipTlsVerify:!!s.skipTlsVerify,createdAt:u,updatedAt:l,lastConnectedAt:d}}).sort((s,i)=>{const a=s.lastConnectedAt??s.updatedAt;return(i.lastConnectedAt??i.updatedAt).localeCompare(a)}),models:{recents:$e((n=t.models)==null?void 0:n.recents,s=>{if(!s||typeof s!="object")return null;const i=s.providerId,a=s.modelId;return typeof i!="string"||typeof a!="string"?null:{providerId:i,modelId:a}}),favorites:$e((r=t.models)==null?void 0:r.favorites,s=>{if(!s||typeof s!="object")return null;const i=s.providerId,a=s.modelId;return typeof i!="string"||typeof a!="string"?null:{providerId:i,modelId:a}}),thinkingSelections:yr((o=t.models)==null?void 0:o.thinkingSelections)}}}function Di(e){const t=e??{},n=t.listeningMode==="all"?"all":"local",r=t.logLevel==="INFO"||t.logLevel==="WARN"||t.logLevel==="ERROR"||t.logLevel==="DEBUG"?t.logLevel:"DEBUG",o=typeof t.opencodeBinary=="string"&&t.opencodeBinary.trim()?t.opencodeBinary:"opencode",s=yr(t.environmentVariables),i=br(t.speech);return{listeningMode:n,logLevel:r,opencodeBinary:o,environmentVariables:s,speech:i}}function wr(e){return`${e.providerId}/${e.modelId}`}function Cr(e,t){const n=t.filter(r=>r.path!==e);return n.unshift({path:e,lastAccessed:Date.now()}),n.slice(0,Ti)}function Gt(e,t,n){const r=Date.now(),o=n.find(i=>i.path===e);if(o){const i={...o,lastUsed:r,version:t??o.version},a=n.filter(c=>c.path!==e);return[i,...a]}return[t?{path:e,version:t,lastUsed:r}:{path:e,lastUsed:r},...n].slice(0,10)}function Li(e,t){const n=e.id?t.find(o=>o.id===e.id):void 0,r=new Date().toISOString();return{id:(n==null?void 0:n.id)??e.id??Ri(),name:e.name.trim(),baseUrl:e.baseUrl.trim(),skipTlsVerify:!!e.skipTlsVerify,createdAt:(n==null?void 0:n.createdAt)??r,updatedAt:r,lastConnectedAt:n==null?void 0:n.lastConnectedAt}}function Sr(e,t){const n=t.filter(r=>r.id!==e.id);return[e,...n].sort((r,o)=>{const s=r.lastConnectedAt??r.updatedAt;return(o.lastConnectedAt??o.updatedAt).localeCompare(s)})}function Ri(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`remote-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}const[qt,tt]=$({}),[Ni,nt]=$({}),[Bi,rt]=$({}),[Or,Pe]=$(!1),Ui=k(()=>mr(qt().settings)),xr=k(()=>qt().theme??"system"),ae=k(()=>Di(Ni())),z=k(()=>Fi(Bi())),P=Ui,ft=k(()=>z().recentFolders),Be=k(()=>z().opencodeBinaries),Oe=k(()=>z().remoteServers);let He=null;async function ht(){Or()||(He||(He=Promise.all([B.loadConfigOwner("ui"),B.loadConfigOwner("server"),B.loadStateOwner("ui")]).then(([e,t,n])=>{tt(e),nt(t),rt(n),Pe(!0)}).catch(e=>{C.error("Failed to load settings",e),tt({}),nt({}),rt({}),Pe(!0)}).finally(()=>{He=null})),await He)}async function H(e,t){await ht();const n=await B.patchConfigOwner(e,t);e==="ui"&&tt(n),e==="server"&&nt(n)}async function D(e,t){await ht();const n=await B.patchStateOwner(e,t);rt(n)}function L(e){const t=qt(),r={settings:mr({...t.settings??{},...e})};H("ui",r).catch(o=>C.error("Failed to patch ui settings",o))}function vr(e){L(e)}function ji(e){xr()!==e&&H("ui",{theme:e}).catch(t=>C.error("Failed to set theme",t))}async function _i(e){ae().listeningMode!==e&&await H("server",{listeningMode:e})}function Jt(e){H("server",{environmentVariables:e}).catch(t=>C.error("Failed to update environment variables",t))}function Vi(e,t){const n=ae().environmentVariables;Jt({...n,[e]:t})}function Wi(e){const t=ae().environmentVariables,{[e]:n,...r}=t;Jt(r)}function zi(e){const t=e&&e.trim().length>0?e:"opencode";H("server",{opencodeBinary:t}).catch(r=>C.error("Failed to set default binary",r));const n=Gt(t,void 0,Be());D("ui",{opencodeBinaries:n}).catch(r=>C.error("Failed to update binary list",r))}function Ki(e){H("server",{logLevel:e??"DEBUG"}).catch(n=>C.error("Failed to set log level",n))}async function Hi(e){const t=e.apiKey,{apiKey:n,...r}=e,o=br({...ae().speech,...r,...t===null?{}:{apiKey:t}}),{hasApiKey:s,...i}=o,a={...i,...t===null?{apiKey:null}:{}};try{await H("server",{speech:a})}catch(c){throw C.error("Failed to update speech settings",c),c}}function Gi(e,t){const n=Gt(e,t,Be());D("ui",{opencodeBinaries:n}).catch(r=>C.error("Failed to add binary",r))}function qi(e){const t=Be().filter(n=>n.path!==e);D("ui",{opencodeBinaries:t}).catch(n=>C.error("Failed to remove binary",n)),ae().opencodeBinary===e&&H("server",{opencodeBinary:"opencode"}).catch(n=>C.error("Failed to reset default binary",n))}function Ji(e){const t=Cr(e,ft());D("ui",{recentFolders:t}).catch(n=>C.error("Failed to add recent folder",n))}function Xi(e){const t=ft().filter(n=>n.path!==e);D("ui",{recentFolders:t}).catch(n=>C.error("Failed to remove recent folder",n))}async function Yi(e){const t=Li(e,Oe());return await D("ui",{remoteServers:Sr(t,Oe())}),t}async function Zi(e){const t=Oe().find(o=>o.id===e);if(!t)return;const n=new Date().toISOString(),r={...t,updatedAt:n,lastConnectedAt:n};await D("ui",{remoteServers:Sr(r,Oe())})}function Qi(e){const t=Oe().filter(n=>n.id!==e);D("ui",{remoteServers:t}).catch(n=>C.error("Failed to remove remote server",n))}function ea(e,t){const n=t&&t.trim().length>0?t:ae().opencodeBinary,r=Cr(e,ft()),o=Gt(n,void 0,Be());D("ui",{recentFolders:r,opencodeBinaries:o}).catch(s=>C.error("Failed to update ui state on launch",s)),H("server",{opencodeBinary:n}).catch(s=>C.error("Failed to persist selected binary",s))}function ta(e){if(!e.providerId||!e.modelId)return;const n=z().models.recents.filter(o=>o.providerId!==e.providerId||o.modelId!==e.modelId),r=[e,...n].slice(0,Pi);D("ui",{models:{recents:r}}).catch(o=>C.error("Failed to update model recents",o))}function na(e){return!e.providerId||!e.modelId?!1:z().models.favorites.some(t=>t.providerId===e.providerId&&t.modelId===e.modelId)}function ra(e){if(!e.providerId||!e.modelId)return;const t=z().models.favorites,r=t.some(o=>o.providerId===e.providerId&&o.modelId===e.modelId)?t.filter(o=>o.providerId!==e.providerId||o.modelId!==e.modelId):[e,...t.filter(o=>o.providerId!==e.providerId||o.modelId!==e.modelId)].slice(0,Mi);D("ui",{models:{favorites:r}}).catch(o=>C.error("Failed to update model favorites",o))}function oa(e){if(!(!e.providerId||!e.modelId))return z().models.thinkingSelections[wr(e)]}function sa(e,t){if(!e.providerId||!e.modelId)return;const n=wr(e);if(z().models.thinkingSelections[n]===t)return;const o={...z().models.thinkingSelections};t?o[n]=t:delete o[n],D("ui",{models:{thinkingSelections:o}}).catch(s=>C.error("Failed to update thinking selection",s))}function ia(e){P().diffViewMode!==e&&L({diffViewMode:e})}function aa(e){P().toolOutputExpansion!==e&&L({toolOutputExpansion:e})}function ca(e){P().diagnosticsExpansion!==e&&L({diagnosticsExpansion:e})}function la(e){P().toolInputsVisibility!==e&&L({toolInputsVisibility:e})}function ua(e){P().thinkingBlocksExpansion!==e&&L({thinkingBlocksExpansion:e})}function da(){L({showThinkingBlocks:!P().showThinkingBlocks})}function fa(){vr({showKeyboardShortcutHints:!P().showKeyboardShortcutHints})}function ha(){L({showTimelineTools:!P().showTimelineTools})}function ga(){L({showUsageMetrics:!P().showUsageMetrics})}function pa(){L({promptSubmitOnEnter:!P().promptSubmitOnEnter})}function ma(){L({showPromptVoiceInput:!P().showPromptVoiceInput})}function ya(){const e=!P().autoCleanupBlankSessions;C.info("toggle auto cleanup",{value:e}),L({autoCleanupBlankSessions:e})}async function ba(e,t,n){!e||!t||!n.providerId||!n.modelId||(await dt(e),await gr(e,r=>{const o={...r.agentModelSelections??{}},s=o[t];s&&s.providerId===n.providerId&&s.modelId===n.modelId||(o[t]=n,r.agentModelSelections=o)}))}async function wa(e,t){return!e||!t?void 0:(await dt(e),(pr(e).agentModelSelections??{})[t])}ht().catch(e=>{C.error("Failed to initialize settings",e)});const kr=xe(),Ca={isLoaded:Or,preferences:P,updatePreferences:vr,themePreference:xr,setThemePreference:ji,serverSettings:ae,setListeningMode:_i,updateEnvironmentVariables:Jt,addEnvironmentVariable:Vi,removeEnvironmentVariable:Wi,updateLastUsedBinary:zi,updateLogLevel:Ki,updateSpeechSettings:Hi,recentFolders:ft,opencodeBinaries:Be,remoteServers:Oe,uiState:z,addRecentFolder:Ji,removeRecentFolder:Xi,addOpenCodeBinary:Gi,removeOpenCodeBinary:qi,saveRemoteServerProfile:Yi,markRemoteServerConnected:Zi,removeRemoteServerProfile:Qi,recordWorkspaceLaunch:ea,addRecentModelPreference:ta,isFavoriteModelPreference:na,toggleFavoriteModelPreference:ra,getModelThinkingSelection:oa,setModelThinkingSelection:sa,toggleShowThinkingBlocks:da,toggleKeyboardShortcutHints:fa,toggleShowTimelineTools:ha,toggleUsageMetrics:ga,toggleAutoCleanupBlankSessions:ya,togglePromptSubmitOnEnter:pa,toggleShowPromptVoiceInput:ma,setDiffViewMode:ia,setToolOutputExpansion:aa,setDiagnosticsExpansion:ca,setThinkingBlocksExpansion:ua,setToolInputsVisibility:la,setAgentModelPreference:ba,getAgentModelPreference:wa},kc=e=>(st(()=>{ht().catch(o=>{C.error("Failed to initialize settings",o)});const t=B.onConfigOwnerChanged("ui",o=>{tt(o),Pe(!0)}),n=B.onConfigOwnerChanged("server",o=>{nt(o),Pe(!0),Ii(),Ei(!0)}),r=B.onStateOwnerChanged("ui",o=>{rt(o),Pe(!0)});return()=>{t(),n(),r()}}),te(kr.Provider,{value:Ca,get children(){return e.children}}));function Sa(){const e=Le(kr);if(!e)throw new Error("useConfig must be used within ConfigProvider");return e}function Oa(e,t,n){const r={};return Object.keys(e).forEach(o=>{r[o]=e[o].reduce((s,i)=>(i&&(n&&n[i]&&s.push(n[i]),s.push(t(i))),s),[]).join(" ")}),r}const xa=Symbol("solid-inspect"),va=xe();function ka(e){function t(n){var r;return(r=Le(va))!=null&&r.enabled?{Component:t,props:n,$INSPECT:xa}:e(n)}return Object.defineProperty(t,"name",{value:e.name}),t.toString=e.toString,t}function $r(){return function(e){function t(a){const c=!!e.slotClasses,u=()=>{if(!e.slotClasses)throw new Error("'slotClasses' option is not defined");if(!e.utilityClass)throw new Error("'utilityClass' option is not defined");return Oa(e.slotClasses(a),e.utilityClass,a.classes??"")},l=yo({});return c&&jr(()=>{const d=u();fe(()=>{for(const f in d)l[f]=d[f]})}),l}function n(a){const[c,u]=ot(a,e.selfPropNames);return{allProps:a,props:c,otherProps:u}}function r(a){return is({propDefaults:a.propDefaults||e.propDefaults,props:a.props,name:e.name})}function o(a){const c=r({props:a});return n(c)}function s(a,c=!0){return a=ka(a),a.toString=()=>`.${e.name}-root`,c&&ar(a,"base"),a}function i(a){const c=s(function(l){const{allProps:d,otherProps:f,props:g}=o(l),p=e.autoCallUseClasses??!0?t(d):{};return a({allProps:d,otherProps:f,props:g,classes:p})});return Object.defineProperty(c,"name",{value:a.name}),c}return{name:e.name,selfPropNames:e.selfPropNames,component:i,defineComponent:s,useClasses:t,useThemeProps:r,useProps:o,splitInProps:n}}}const $a=$r()({name:"MuiGlobalStyles",selfPropNames:["styles"]}),Aa=$a.component(function({props:t}){return tr(()=>({"@global":t.styles||{}})),[]}),Ea=$r()({name:"MuiCssBaseline",selfPropNames:["children","enableColorScheme"],propDefaults:({set:e})=>e({enableColorScheme:!1})}),Ia=(e,t)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...t&&{colorScheme:e.palette.mode}}),Ta=e=>({color:e.palette.text.primary,...e.typography.body1,backgroundColor:e.palette.background.default,"@media print":{backgroundColor:e.palette.common.white}}),Pa=(e,t=!1)=>({html:Ia(e,t),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:{margin:0,...Ta(e),"&::backdrop":{backgroundColor:e.palette.background.default}}}),Ma=Ea.component(function({props:t}){const n=Hn();return te(Aa,{get styles(){return Pa(n,t.enableColorScheme)}})}),Ar=xe();function xn(e){if(!(typeof document>"u")){if(e==="system"){document.documentElement.removeAttribute("data-theme");return}document.documentElement.setAttribute("data-theme",e)}}const Fa={backgroundDefault:"#ffffff",backgroundPaper:"#f5f5f5",primary:"#0066ff",primaryContrast:"#ffffff",textPrimary:"#1a1a1a",textSecondary:"#666666",divider:"#e0e0e0"},Da={backgroundDefault:"#1a1a1a",backgroundPaper:"#2a2a2a",primary:"#0080ff",primaryContrast:"#1a1a1a",textPrimary:"#cfd4dc",textSecondary:"#999999",divider:"#3a3a3a"},Y=(e,t,n)=>{if(!n)return t;const r=n.getPropertyValue(e);return r&&r.trim()||t},La=e=>{const t=e?Da:Fa,n=typeof window<"u"?getComputedStyle(document.documentElement):null;return{backgroundDefault:Y("--surface-base",t.backgroundDefault,n),backgroundPaper:Y("--surface-secondary",t.backgroundPaper,n),primary:Y("--accent-primary",t.primary,n),primaryContrast:Y("--text-inverted",t.primaryContrast,n),textPrimary:Y("--text-primary",t.textPrimary,n),textSecondary:Y("--text-secondary",t.textSecondary,n),divider:Y("--border-base",t.divider,n)}};function $c(e){const t=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null,{themePreference:n,setThemePreference:r}=Sa(),[o,s]=$(!0),[i,a]=$(0),c=()=>n(),u=()=>{const p=c();return p==="dark"?!0:p==="light"?!1:(t==null?void 0:t.matches)??!1},l=()=>{const p=c(),b=u();xn(p==="system"?"system":p),s(b),typeof window<"u"?requestAnimationFrame(()=>a(y=>y+1)):a(y=>y+1)};ee(()=>{l()}),st(()=>{if(!t)return;const p=()=>{l()};return t.addEventListener("change",p),()=>{t.removeEventListener("change",p)}});const d=p=>{r(p)},f=()=>{const p=c();d(p==="system"?"light":p==="light"?"dark":"system")},g=k(()=>{i();const p=La(o());return Wn({palette:{mode:o()?"dark":"light",primary:{main:p.primary,contrastText:p.primaryContrast},secondary:{main:p.primary},background:{default:p.backgroundDefault,paper:p.backgroundPaper},text:{primary:p.textPrimary,secondary:p.textSecondary},divider:p.divider},typography:{fontFamily:"var(--font-family-sans)"},shape:{borderRadius:8},components:{MuiIconButton:{styleOverrides:{root:{color:"inherit","&.Mui-disabled":{color:"var(--text-muted)",opacity:.55}}}},MuiDrawer:{styleOverrides:{paper:{backgroundColor:"var(--surface-secondary)",color:"var(--text-primary)"}}},MuiAppBar:{styleOverrides:{root:{backgroundColor:"var(--surface-secondary)",color:"var(--text-primary)",boxShadow:"none",borderBottom:"1px solid var(--border-base)",zIndex:10}}},MuiToolbar:{styleOverrides:{root:{minHeight:"56px"}}}}})});return te(Ar.Provider,{value:{isDark:o,themeMode:c,setThemeMode:d,cycleThemeMode:f},get children(){return te(as,{get theme(){return g()},get children(){return[te(Ma,{}),Xr(()=>e.children)]}})}})}function Er(){const e=Le(Ar);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const Ra="0.52.2",Nt=`https://cdn.jsdelivr.net/npm/monaco-editor@${Ra}/min/vs`,N="/monaco/vs";let Ge=null;function Na(e,t){return new Promise((n,r)=>{const o=setTimeout(()=>r(new Error("timeout")),t);e.then(s=>{clearTimeout(o),n(s)}).catch(s=>{clearTimeout(o),r(s)})})}async function Ba(){if(typeof fetch>"u")return!1;try{const e=new AbortController,t=fetch(`${Nt}/loader.js`,{method:"HEAD",signal:e.signal}),n=await Na(t,1200);return e.abort(),n.ok}catch{return!1}}function Ua(){return typeof document>"u"||document.querySelector('script[data-monaco-loader="true"]')?Promise.resolve():new Promise((t,n)=>{const r=document.createElement("script");r.dataset.monacoLoader="true",r.src=`${N}/loader.js`,r.async=!0,r.onload=()=>t(),r.onerror=()=>n(new Error("Failed to load Monaco AMD loader")),document.head.appendChild(r)})}function ja(){if(typeof document>"u"||document.querySelector('link[data-monaco-editor-css="true"]'))return;const t=document.createElement("link");t.rel="stylesheet",t.href=`${N}/editor/editor.main.css`,t.dataset.monacoEditorCss="true",document.head.appendChild(t)}function _a(){const e=globalThis,t=e.MonacoEnvironment??{},n="/monaco.worker.js";e.MonacoEnvironment={...t,getWorkerUrl(r,o){return n}}}function Ir(){const e=globalThis.require;if(!e)throw new Error("Monaco AMD loader is not available");return e}function Va(){const t=Ir().config;if(!t)throw new Error("require.config is not available");return t}function Bt(e){const t=Ir();return new Promise((n,r)=>{t(e,(...o)=>n(o),o=>r(o))})}function Wa(e){const t=String(e||"plaintext");return!t||t==="plaintext"?null:t==="typescript"||t==="javascript"?"vs/language/typescript/monaco.contribution":t==="json"?"vs/language/json/monaco.contribution":t==="css"||t==="scss"||t==="less"?"vs/language/css/monaco.contribution":t==="html"?"vs/language/html/monaco.contribution":t==="toml"?"vs/basic-languages/toml/toml":`vs/basic-languages/${t}/${t}`}const vn=new Set,xt=new Map;async function Tr(e){const t=Wa(e);if(!t||vn.has(t))return;const n=xt.get(t);if(n)return n;const r=(async()=>{let o=!1;try{await Bt([t]),o=!0}catch{}finally{o&&vn.add(t),xt.delete(t)}})();return xt.set(t,r),r}async function Pr(){return Ge||(Ge=(async()=>{await Ua(),_a(),ja();const e=await Ba(),t=Va(),n={vs:N};e&&(n["vs/basic-languages"]=`${Nt}/basic-languages`,n["vs/language"]=`${Nt}/language`,n["vs/basic-languages/python"]=`${N}/basic-languages/python`,n["vs/basic-languages/markdown"]=`${N}/basic-languages/markdown`,n["vs/basic-languages/cpp"]=`${N}/basic-languages/cpp`,n["vs/basic-languages/kotlin"]=`${N}/basic-languages/kotlin`,n["vs/language/typescript"]=`${N}/language/typescript`,n["vs/language/html"]=`${N}/language/html`,n["vs/language/json"]=`${N}/language/json`,n["vs/language/css"]=`${N}/language/css`),t({paths:n,ignoreDuplicateModules:["vs/editor/editor.main"]});const[r]=await Bt(["vs/editor/editor.main"]);return await Bt(["vs/basic-languages/monaco.contribution"]).catch(()=>[]),globalThis.monaco??r})(),Ge)}const za=5,J=new Map;function Ka(e,t){J.delete(e),J.set(e,t)}function Ha(){for(;J.size>za;){const e=J.keys().next().value;if(!e)return;const t=J.get(e);J.delete(e);try{t==null||t.model.dispose()}catch{}}}function Ut(e){const t=J.get(e.cacheKey);if(t)return Ka(e.cacheKey,t),t.model.getValue()!==e.value&&t.model.setValue(e.value),t.model;const n=e.monaco.Uri.parse(`opencode://model/${encodeURIComponent(e.cacheKey)}`),r=e.monaco.editor.createModel(e.value,"plaintext",n),o={model:r};return J.set(e.cacheKey,o),Ha(),r}let qe=null;function Ga(e){var o;if(qe)return qe;const t=new Map,n=new Map,r=typeof((o=e==null?void 0:e.languages)==null?void 0:o.getLanguages)=="function"?e.languages.getLanguages():[];if(Array.isArray(r))for(const s of r){const i=typeof(s==null?void 0:s.id)=="string"?s.id:null;if(!i)continue;const a=Array.isArray(s==null?void 0:s.filenames)?s.filenames:[];for(const u of a)typeof u=="string"&&(t.has(u)||t.set(u,i));const c=Array.isArray(s==null?void 0:s.extensions)?s.extensions:[];for(const u of c)typeof u=="string"&&(n.has(u)||n.set(u,i))}return qe={fileNameToId:t,extToId:n},qe}function qa(e){return e===".gitignore"||e===".gitattributes"||e===".gitmodules"||e==="Makefile"||e.startsWith("Makefile.")?"shell":null}function Mr(e,t){const n=String(t||"").trim(),r=n.split("/").pop()||n,o=qa(r);if(o)return o;const s=Ga(e),i=s.fileNameToId.get(r);if(i)return i;const a=r.lastIndexOf(".");if(a>0){const c=r.slice(a),u=s.extToId.get(c);if(u)return u}return"plaintext"}var Ja=In("<div class=monaco-viewer>");function Xa(e){const{isDark:t}=Er();let n,r=null,o=null;const[s,i]=$(!1),a=()=>{try{r==null||r.setModel(null)}catch{}try{r==null||r.dispose()}catch{}r=null};return st(()=>{let c=!1;(async()=>(o=await Pr(),!c&&(!n||!o||(o.editor.setTheme(t()?"vs-dark":"vs"),r=o.editor.createDiffEditor(n,{readOnly:!0,automaticLayout:!0,renderSideBySide:!0,renderSideBySideInlineBreakpoint:0,renderMarginRevertIcon:!1,minimap:{enabled:!1},scrollBeyondLastLine:!1,renderWhitespace:"selection",fontSize:13,wordWrap:e.wordWrap==="on"?"on":"off",glyphMargin:!1,folding:!1,lineNumbersMinChars:4,lineDecorationsWidth:12,diffAlgorithm:"legacy",maxComputationTime:1e4}),i(!0)))))(),be(()=>{c=!0,i(!1),a()})}),ee(()=>{!s()||!o||!r||o.editor.setTheme(t()?"vs-dark":"vs")}),ee(()=>{var d,f,g,p,b,y;if(!s()||!o||!r)return;const c=e.viewMode==="unified"?"unified":"split",u=e.contextMode==="collapsed"?"collapsed":"expanded",l=e.wordWrap==="on"?"on":"off";r.updateOptions({renderSideBySide:c==="split",renderSideBySideInlineBreakpoint:0,hideUnchangedRegions:u==="collapsed"?{enabled:!0}:{enabled:!1},wordWrap:l});try{(g=(f=(d=r.getOriginalEditor)==null?void 0:d.call(r))==null?void 0:f.updateOptions)==null||g.call(f,{wordWrap:l})}catch{}try{(y=(b=(p=r.getModifiedEditor)==null?void 0:p.call(r))==null?void 0:b.updateOptions)==null||y.call(b,{wordWrap:l})}catch{}}),ee(()=>{if(!s()||!o||!r)return;const c=Mr(o,e.path),u=`${e.scopeKey}:diff:${e.path}:before`,l=`${e.scopeKey}:diff:${e.path}:after`,d=Ut({monaco:o,cacheKey:u,value:e.before}),f=Ut({monaco:o,cacheKey:l,value:e.after});r.setModel({original:d,modified:f}),Tr(c).then(()=>{try{o.editor.setModelLanguage(d,c),o.editor.setModelLanguage(f,c)}catch{}})}),(()=>{var c=Ja(),u=n;return typeof u=="function"?jt(u,c):n=c,c})()}const Ac=Object.freeze(Object.defineProperty({__proto__:null,MonacoDiffViewer:Xa},Symbol.toStringTag,{value:"Module"}));var Ya=In("<div class=monaco-viewer>");function Za(e){const{isDark:t}=Er();let n,r=null,o=null;const[s,i]=$(!1),a=()=>{try{r==null||r.setModel(null)}catch{}try{r==null||r.dispose()}catch{}r=null},c=()=>{!r||!e.onSave||e.onSave(r.getValue())};return st(()=>{let u=!1;(async()=>(o=await Pr(),!u&&(!n||!o||(o.editor.setTheme(t()?"vs-dark":"vs"),r=o.editor.create(n,{value:"",language:"plaintext",readOnly:!1,automaticLayout:!0,lineNumbers:"on",minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:"off",renderWhitespace:"selection",fontSize:13}),r.addCommand(o.KeyMod.CtrlCmd|o.KeyCode.KeyS,c),r.onDidChangeModelContent(()=>{e.onContentChange&&e.onContentChange(r.getValue())}),i(!0)))))(),be(()=>{u=!0,i(!1),a()})}),ee(()=>{!s()||!o||!r||o.editor.setTheme(t()?"vs-dark":"vs")}),ee(()=>{if(!s()||!o||!r)return;const u=Mr(o,e.path),l=`${e.scopeKey}:file:${e.path}`,d=Ut({monaco:o,cacheKey:l,value:e.content});r.setModel(d),Tr(u).then(()=>{try{o.editor.setModelLanguage(d,u)}catch{}})}),(()=>{var u=Ya(),l=n;return typeof l=="function"?jt(l,u):n=u,u})()}const Ec=Object.freeze(Object.defineProperty({__proto__:null,MonacoFileViewer:Za},Symbol.toStringTag,{value:"Module"}));export{gr as $,ta as A,oa as B,Cc as C,ic as D,P as E,dt as F,wc as G,uc as H,$r as I,Ks as J,fc as K,yc as L,qs as M,ir as N,dc as O,sc as P,gc as Q,Cs as R,pc as S,hc as T,bc as U,yo as V,mc as W,Oo as X,So as Y,Er as Z,pr as _,to as a,Sc as a0,ra as a1,sa as a2,_i as a3,xc as a4,vc as a5,B as a6,rc as a7,Oc as a8,$c as a9,kc as aa,Ac as ab,Ec as ac,Tn as b,ac as c,vt as d,Hn as e,Zr as f,oc as g,_ as h,kt as i,no as j,ie as k,Sa as l,Xr as m,ro as n,Ot as o,lc as p,wa as q,z as r,oo as s,In as t,jt as u,cc as v,Ei as w,Sn as x,ae as y,ba as z};
15
+ `));const r=t==null?void 0:t.id,o=document.head||document.getElementsByTagName("head")[0],s=r&&document.getElementById(r);if(s&&s instanceof HTMLStyleElement)return Qn(s,e),Tt(s),s;{s&&s.remove();const i=ys(e,t);if(Tt(i),n){let a=o.querySelector(`#${ln}`);a||(a=document.createElement("style"),a.setAttribute("id",ln),o.prepend(a)),o.insertBefore(i,a)}else o.appendChild(i);return i}}function ws(e,t="css-"){if(typeof e=="string")return document.getElementById(e);const n=[...e.classList].find(r=>r.startsWith(t));if(n)return document.getElementById(n.slice(t.length))}function un(e,t=!0){let n=Number(e.getAttribute("data-uses"));n--,n<=0?t?e.remove():e.setAttribute("data-uses","0"):e.setAttribute("data-uses",n.toString())}function fc(e){if(typeof e!="string")throw new Error("MUI: `capitalize(string)` expects a string argument.");return e.charAt(0).toUpperCase()+e.slice(1)}function hc(e,t=166){let n;function r(...o){const s=()=>{e.apply(null,o)};clearTimeout(n),n=setTimeout(s,t)}return r.clear=()=>{clearTimeout(n)},r}function gc(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}function Cs(e){return e&&e.ownerDocument||document}function pc(e){return Cs(e).defaultView||window}function er(){return Math.random().toString(36).substring(2,15).slice(0,8)}let ct=!0,Pt=!1,dn;const Ss={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function Os(e){const{type:t,tagName:n}=e;return!!(n==="INPUT"&&Ss[t]&&!e.readOnly||n==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function xs(e){e.metaKey||e.altKey||e.ctrlKey||(ct=!0)}function yt(){ct=!1}function vs(){this.visibilityState==="hidden"&&Pt&&(ct=!0)}function ks(e){e.addEventListener("keydown",xs,!0),e.addEventListener("mousedown",yt,!0),e.addEventListener("pointerdown",yt,!0),e.addEventListener("touchstart",yt,!0),e.addEventListener("visibilitychange",vs,!0)}function $s(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return ct||Os(t)}function mc(){const e=s=>{s!=null&&ks(s.ownerDocument)},[t,n]=$(!1);function r(){return t()?(Pt=!0,window.clearTimeout(dn),dn=window.setTimeout(()=>{Pt=!1},100),n(!1),!0):!1}function o(s){return $s(s)?(n(!0),!0):!1}return{isFocusVisibleRef:{get current(){return t()}},onFocus:o,onBlur:r,ref:e}}const As=new gs;function Es(e){return e?Array.isArray(e)?e.flat(1/0).filter(t=>!!t):[e]:[]}function Is(){if(!O.context)return er();const e=Ur().replaceAll("-",""),t=9,n=Math.ceil(e.length/t),r=[];for(let o=1;o<=n;++o){const s=(o-1)*t,i=Number(e.slice(s,s+t));r.push(i.toString(32))}return r.join("-")}function tr(e){const t=Le($o),[n,r]=$(""),o=Is();let s,i=!1;return Q(a=>{var l;const c=e();let u;if(c){const d=us(Es(c));i="@global"in d,u=ps({name:"css",props:d,cache:As,componentId:o}),s=ws(u.id),s?Tt(s):s=bs(u.rules,{id:u.id,nonce:(l=t.cache)==null?void 0:l.nonce},t.injectFirst),a!=null&&a.styleElement&&un(a.styleElement)}return typeof(u==null?void 0:u.className)=="string"?r(u.className):r(""),{className:u==null?void 0:u.className,styleElement:s}},void 0),be(()=>{s&&un(s,t.cleanupStyles??i)}),n}function de(e,t,n={}){for(const r in e){const o=e[r];if(Xn(r))n[r]=de(o,t);else if(It(r))n[r]=de(o,t);else if(Yn(r)){n[r]={};for(const s in o)n[r][s]=de(o[s],t)}else if(Jn(r))n[r]=de(o,t);else{const s=t(r,o);if(s)for(const i in s)n[i]=It(i)?{...n[i],...s[i]}:s[i];else n[r]=o}}return n}const Ts=new Set(["animationIterationCount","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","columns","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridRow","gridRowEnd","gridRowSpan","gridRowStart","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","msGridRow","msGridRowSpan","msGridColumn","msGridColumnSpan","fontWeight","lineHeight","opacity","order","orphans","tabSize","widows","zIndex","zoom","WebkitLineClamp","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth"]);function nr(e,t){if(typeof t=="number")return{[e]:Ts.has(e)?t.toString():`${t}px`}}function fn(e,t={}){return de(e,nr,t)}function Qe(e,t,n){if(typeof n!="string")return n;const r=n.split(".");let o=e[t];for(let s=0;s<r.length&&(o=o==null?void 0:o[r[s]],!!o);s++);return o??n}function Ps(e,t){return t.split(".").reduce((n,r)=>n&&n[r]?n[r]:null,e)}function Ms(e,t,n,r){const o=Ps(e,t)||n;return typeof o=="number"?s=>typeof s=="string"?s:o*s:Array.isArray(o)?s=>typeof s=="string"?s:o[s]:typeof o=="function"?o:()=>{}}const q={x:["Left","Right"],y:["Top","Bottom"]};function rr(e){return typeof e=="number"?`${e}px`:e}function or(e,t){return(n,r)=>t(e,n,r)}function h(e,t){return t?(n,r)=>({[e]:t(e,n,r)}):n=>({[e]:n})}function Ie(e){return h(e,(t,n)=>rr(n))}function M(e,t,n){const r=t.map(o=>`${e}${o}`);return n?(o,s)=>r.reduce((i,a)=>(i[a]=n(a,o,s),i),{}):o=>r.reduce((s,i)=>(s[i]=o,s),{})}function Fs(){return{...Ds(),...Ls(),...Rs(),...Ns(),...Bs(),...Us(),...js(),...Vs(),..._s()}}function Ds(){return{displayPrint:or("displayPrint",(e,t)=>({"@media print":{display:t}})),displayRaw:h("display"),overflow:h("overflow"),textOverflow:h("textOverflow"),visibility:h("visibility"),whiteSpace:h("whiteSpace")}}function Ls(){return{flexBasis:h("flexBasis"),flexDirection:h("flexDirection"),flexWrap:h("flexWrap"),justifyContent:h("justifyContent"),alignItems:h("alignItems"),alignContent:h("alignContent"),order:h("order"),flex:h("flex"),flexGrow:h("flexGrow"),flexShrink:h("flexShrink"),alignSelf:h("alignSelf"),justifyItems:h("justifyItems"),justifySelf:h("justifySelf")}}function Rs(){const e=(t,n,r)=>Ms(r,"spacing",8)(n);return{gap:h("gap",e),columnGap:h("columnGap",e),rowGap:h("rowGap",e),gridColumn:h("gridColumn"),gridRow:h("gridRow"),gridAutoFlow:h("gridAutoFlow"),gridAutoColumns:h("gridAutoColumns"),gridAutoRows:h("gridAutoRows"),gridTemplateColumns:h("gridTemplateColumns"),gridTemplateRows:h("gridTemplateRows"),gridTemplateAreas:h("gridTemplateAreas"),gridArea:h("gridArea")}}function Ns(){return{position:h("position"),zIndex:h("zIndex",(e,t,n)=>{var r;return((r=n.zIndex)==null?void 0:r[e])??t}),top:Ie("top"),right:Ie("right"),bottom:Ie("bottom"),left:Ie("left")}}function Bs(){const e=(t,n,r)=>Qe(r,"palette",n);return{color:h("color",e),bgcolor:h("backgroundColor",e),backgroundColor:h("backgroundColor",e)}}function Us(){const e=(t,n,r)=>(t==="maxWidth"&&(n=r.breakpoints.values[t]??n),typeof n=="number"&&(n=n>0&&n<=1?`${n*100}%`:`${n}px`),n);return{width:h("width",e),maxWidth:h("maxWidth",e),minWidth:h("minWidth",e),height:h("height",e),maxHeight:h("maxHeight",e),minHeight:h("minHeight",e),boxSizing:h("boxSizing",e)}}function js(){const e=(n,r)=>typeof r=="number"?`${r}px solid`:r,t=(n,r,o)=>Qe(o,"palette",r);return{border:h("border",e),borderTop:h("borderTop",e),borderRight:h("borderRight",e),borderBottom:h("borderBottom",e),borderLeft:h("borderLeft",e),borderColor:h("borderColor",t),borderTopColor:h("borderTopColor",t),borderRightColor:h("borderRightColor",t),borderBottomColor:h("borderBottomColor",t),borderLeftColor:h("borderLeftColor",t),borderRadius:h("borderRadius",(n,r,o)=>typeof r=="number"?`${o.shape.borderRadius*r}px`:r)}}function _s(){const e=(t,n,r)=>Qe(r,"typography",n);return{typography:or("typography",(t,n,r)=>Qe(r,"typography",n)),fontFamily:h("fontFamily",e),fontSize:h("fontSize",(t,n,r)=>rr(e(t,n,r))),fontStyle:h("fontStyle",e),fontWeight:h("fontWeight",e),letterSpacing:Ie("letterSpacing"),lineHeight:h("lineHeight"),textAlign:h("textAlign"),textTransform:h("textTransform")}}function Vs(){const e=(r,o,s)=>s.spacing(o),t="margin",n="padding";return{m:h(t,e),mt:h("marginTop",e),mr:h("marginRight",e),mb:h("marginBottom",e),ml:h("marginLeft",e),mx:M(t,q.x,e),my:M(t,q.y,e),margin:h(t,e),marginTop:h("marginTop",e),marginRight:h("marginRight",e),marginBottom:h("marginBottom",e),marginLeft:h("marginLeft",e),marginX:M(t,q.x,e),marginY:M(t,q.y,e),marginInline:M(t,["Inline","InlineStart"],e),marginInlineStart:h("marginInlineStart",e),marginInlineEnd:h("marginInlineEnd",e),marginBlock:M(t,["BlockStart","BlockEnd"],e),marginBlockStart:h("marginBlockStart",e),marginBlockEnd:h("marginBlockEnd",e),p:h(n,e),pt:h("paddingTop",e),pr:h("paddingRight",e),pb:h("paddingBottom",e),pl:h("paddingLeft",e),px:M(n,q.x,e),py:M(n,q.y,e),padding:h(n,e),paddingTop:h("paddingTop",e),paddingRight:h("paddingRight",e),paddingBottom:h("paddingBottom",e),paddingLeft:h("paddingLeft",e),paddingX:M(n,q.x,e),paddingY:M(n,q.y,e),paddingInline:M(n,["Inline","InlineStart"],e),paddingInlineStart:h("paddingInlineStart",e),paddingInlineEnd:h("paddingInlineEnd",e),paddingBlock:M(n,["BlockStart","BlockEnd"],e),paddingBlockStart:h("paddingBlockStart",e),paddingBlockEnd:h("paddingBlockEnd",e)}}const Kt=Fs(),yc=Object.keys(Kt);function Ws(e,t,n){return Kt[e](t,n)}function hn(e,t,n){return e in Kt?Ws(e,t,n):nr(e,t)}function zs(e,t){return de(e,(n,r)=>{if(typeof r=="function"&&(r=r(t)),r==null)return r;if(typeof r=="object"){const o={};for(const s of t.breakpoints.keys)o[t.breakpoints.up(s)]={};return Object.assign(o,vo({theme:t},r,s=>hn(n,s,t)??{[n]:s}))}else return hn(n,r,t)})}function sr(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=sr(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ks(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=sr(e))&&(r&&(r+=" "),r+=t);return r}const ir=["ownerState","theme","sx","as"];function Hs(e,t){var n,r;return(r=(n=t.components)==null?void 0:n[e])==null?void 0:r.styleOverrides}function Gs(e,t,n,r,o={}){return k(()=>{const s=e(),i=Hs(o.name,s),a=r.ownerState,c=n.reduce((l,d)=>{let f;return typeof d=="function"?f=d({ownerState:a,theme:s,get sx(){return r.sx},get as(){return r.as},props:r}):d&&(f=d),f&&l.push(fn(f,{name:t,__resolved:!0})),l},[]);let u=[];return o.overridesResolver&&typeof o.overridesResolver=="function"&&i&&(u=o.overridesResolver(r,i).map(l=>l?fn(l,{}):null).filter(Boolean)),c.concat(u)})}function ar(e,t){e.__suid=t}function gn(e){if(typeof e=="function")return e.__suid}function qs(e){return function(n,r={}){let o,s;if(r.name){const a=r.slot||"Root";s=o=`${r.name}-${a.slice(0,1).toLowerCase()+a.slice(1)}`}else s=`styled-${er()}`,o="css";const i=gn(n);return function(...a){function c(u){let l;const d=()=>{const A=u.theme;return A||l||(l=e&&e.onUseTheme?e.onUseTheme():zt())},[,f]=ot(u,r.skipProps||ir),g=Gs(d,o,a,u,r),p=()=>{const A=u.sx;return A?Array.isArray(A)?A:[A]:[]},b=()=>{if(i)return n;const A=u.as;return A||n},y=i?()=>i:k(()=>gn(b())),x=r.skipSx?()=>g():()=>{const A=d();return[...g(),...p().map(G=>G.__resolved?G:zs(G,A))]},R=tr(()=>y()?void 0:x());return Gn(b,An(f,{get children(){return u.children},get component(){return y()?u.component:null},get as(){return i?u.as:void 0},get sx(){return y()?x():void 0},get ownerState(){return y()==="system"?u.ownerState:void 0},get class(){return Ks([...new Set([u.class,s,R()])])}}))}return ar(c,"system"),s&&(c.toString=()=>`.${s}`),c}}}const bc=[...ir,"classes"],wc=qs({onUseTheme:()=>Hn()}),Js="codenomad.client-id",Xs="codenomad.connection-id";let _e=null,Ve=null;function Mt(){return{clientId:Ys(),connectionId:Zs()}}function Ys(){return _e||(_e=cr(Js,window.localStorage),_e)}function Zs(){return Ve||(Ve=cr(Xs,window.sessionStorage),Ve)}function cr(e,t){if(typeof window>"u")return bt();try{const r=t.getItem(e);if(r&&r.trim())return r.trim()}catch{return bt()}const n=bt();try{t.setItem(e,n)}catch{}return n}function bt(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var Ft={exports:{}},wt,pn;function Qs(){if(pn)return wt;pn=1;var e=1e3,t=e*60,n=t*60,r=n*24,o=r*7,s=r*365.25;wt=function(l,d){d=d||{};var f=typeof l;if(f==="string"&&l.length>0)return i(l);if(f==="number"&&isFinite(l))return d.long?c(l):a(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))};function i(l){if(l=String(l),!(l.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(d){var f=parseFloat(d[1]),g=(d[2]||"ms").toLowerCase();switch(g){case"years":case"year":case"yrs":case"yr":case"y":return f*s;case"weeks":case"week":case"w":return f*o;case"days":case"day":case"d":return f*r;case"hours":case"hour":case"hrs":case"hr":case"h":return f*n;case"minutes":case"minute":case"mins":case"min":case"m":return f*t;case"seconds":case"second":case"secs":case"sec":case"s":return f*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function a(l){var d=Math.abs(l);return d>=r?Math.round(l/r)+"d":d>=n?Math.round(l/n)+"h":d>=t?Math.round(l/t)+"m":d>=e?Math.round(l/e)+"s":l+"ms"}function c(l){var d=Math.abs(l);return d>=r?u(l,d,r,"day"):d>=n?u(l,d,n,"hour"):d>=t?u(l,d,t,"minute"):d>=e?u(l,d,e,"second"):l+" ms"}function u(l,d,f,g){var p=d>=f*1.5;return Math.round(l/f)+" "+g+(p?"s":"")}return wt}function ei(e){n.debug=n,n.default=n,n.coerce=c,n.disable=i,n.enable=o,n.enabled=a,n.humanize=Qs(),n.destroy=u,Object.keys(e).forEach(l=>{n[l]=e[l]}),n.names=[],n.skips=[],n.formatters={};function t(l){let d=0;for(let f=0;f<l.length;f++)d=(d<<5)-d+l.charCodeAt(f),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(l){let d,f=null,g,p;function b(...y){if(!b.enabled)return;const x=b,R=Number(new Date),A=R-(d||R);x.diff=A,x.prev=d,x.curr=R,d=R,y[0]=n.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let G=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(gt,Fr)=>{if(gt==="%%")return"%";G++;const Xt=n.formatters[Fr];if(typeof Xt=="function"){const Dr=y[G];gt=Xt.call(x,Dr),y.splice(G,1),G--}return gt}),n.formatArgs.call(x,y),(x.log||n.log).apply(x,y)}return b.namespace=l,b.useColors=n.useColors(),b.color=n.selectColor(l),b.extend=r,b.destroy=n.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(g!==n.namespaces&&(g=n.namespaces,p=n.enabled(l)),p),set:y=>{f=y}}),typeof n.init=="function"&&n.init(b),b}function r(l,d){const f=n(this.namespace+(typeof d>"u"?":":d)+l);return f.log=this.log,f}function o(l){n.save(l),n.namespaces=l,n.names=[],n.skips=[];const d=(typeof l=="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const f of d)f[0]==="-"?n.skips.push(f.slice(1)):n.names.push(f)}function s(l,d){let f=0,g=0,p=-1,b=0;for(;f<l.length;)if(g<d.length&&(d[g]===l[f]||d[g]==="*"))d[g]==="*"?(p=g,b=f,g++):(f++,g++);else if(p!==-1)g=p+1,b++,f=b;else return!1;for(;g<d.length&&d[g]==="*";)g++;return g===d.length}function i(){const l=[...n.names,...n.skips.map(d=>"-"+d)].join(",");return n.enable(""),l}function a(l){for(const d of n.skips)if(s(l,d))return!1;for(const d of n.names)if(s(l,d))return!0;return!1}function c(l){return l instanceof Error?l.stack||l.message:l}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var ti=ei;(function(e,t){var n={};t.formatArgs=o,t.save=s,t.load=i,t.useColors=r,t.storage=a(),t.destroy=(()=>{let u=!1;return()=>{u||(u=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let u;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(u=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(u[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o(u){if(u[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+u[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;u.splice(1,0,l,"color: inherit");let d=0,f=0;u[0].replace(/%[a-zA-Z%]/g,g=>{g!=="%%"&&(d++,g==="%c"&&(f=d))}),u.splice(f,0,l)}t.log=console.debug||console.log||(()=>{});function s(u){try{u?t.storage.setItem("debug",u):t.storage.removeItem("debug")}catch{}}function i(){let u;try{u=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch{}return!u&&typeof process<"u"&&"env"in process&&(u=n.DEBUG),u}function a(){try{return localStorage}catch{}}e.exports=ti(t);const{formatters:c}=e.exports;c.j=function(u){try{return JSON.stringify(u)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}})(Ft,Ft.exports);var ni=Ft.exports;const Dt=_r(ni),ve=["sse","api","session","actions"],lr="opencode:logger:namespaces",Ct=new Map,j=new Set,V=typeof globalThis<"u"?globalThis.console:void 0;function Ne(){j.size===0?Dt.disable():Dt.enable(Array.from(j).join(","))}function lt(){var e;if(!(typeof window>"u"||!(window!=null&&window.localStorage)))try{window.localStorage.setItem(lr,JSON.stringify(Array.from(j)))}catch(t){(e=V==null?void 0:V.warn)==null||e.call(V,"Failed to persist logger namespaces",t)}}function ri(){var e;if(!(typeof window>"u"||!(window!=null&&window.localStorage)))try{const t=window.localStorage.getItem(lr);if(!t)return;const n=JSON.parse(t);if(!Array.isArray(n))return;for(const r of n)ve.includes(r)&&j.add(r)}catch(t){(e=V==null?void 0:V.warn)==null||e.call(V,"Failed to hydrate logger namespaces",t)}}ri();Ne();function oi(e){const n=Dt(e),r=(o,s)=>{n(o,...s)};return{log:(...o)=>n(...o),info:(...o)=>n(...o),warn:(...o)=>r("[warn]",o),error:(...o)=>r("[error]",o)}}function ie(e){if(!ve.includes(e))throw new Error(`Unknown logger namespace: ${e}`);return Ct.has(e)||Ct.set(e,oi(e)),Ct.get(e)}function si(){return ve.map(e=>({name:e,enabled:j.has(e)}))}function ii(e){if(!ve.includes(e))throw new Error(`Unknown logger namespace: ${e}`);j.has(e)||(j.add(e),lt(),Ne())}function ai(e){if(!ve.includes(e))throw new Error(`Unknown logger namespace: ${e}`);j.has(e)&&(j.delete(e),lt(),Ne())}function ci(){j.clear(),lt(),Ne()}function li(){ve.forEach(e=>j.add(e)),lt(),Ne()}const ui={listLoggerNamespaces:si,enableLogger:ii,disableLogger:ai,enableAllLoggers:li,disableAllLoggers:ci};function di(){typeof window>"u"||(window.codenomadLogger=ui)}di();var kn;const fi=typeof window<"u"?(kn=window.location)==null?void 0:kn.origin:void 0,hi=typeof window<"u"?window.__CODENOMAD_API_BASE__??fi:void 0,gi=typeof window<"u"?window.__CODENOMAD_EVENTS_URL__??"/api/events":"/api/events",X=hi,St=pi(X,gi),Cc=X;function Sc(e,t){const n=encodeURIComponent(e),r=encodeURIComponent(t);return mi(`/workspaces/${n}/plugin/background-processes/${r}/stream`)}function pi(e,t){if(t.startsWith("http://")||t.startsWith("https://"))return t;if(e){const n=t.startsWith("/")?t:`/${t}`;return`${e}${n}`}return t}function mi(e){if(e.startsWith("http://")||e.startsWith("https://")||!X)return e;const t=e.startsWith("/")?e:`/${e}`;return`${X}${t}`}const mn=ie("api"),We=ie("sse");function ur(e){const t={};if(!e)return t;if(e instanceof Headers)return e.forEach((n,r)=>{t[r]=n}),t;if(Array.isArray(e)){for(const[n,r]of e)t[n]=r;return t}return{...e}}function Z(e,t){if(t){mn.info(e,t);return}mn.info(e)}async function m(e,t){const n=X?new URL(e,X).toString():e,r=ur(t==null?void 0:t.headers);(t==null?void 0:t.body)!==void 0&&(r["Content-Type"]="application/json");const o=((t==null?void 0:t.method)??"GET").toUpperCase(),s=Date.now();Z(`${o} ${e}`);try{const i=await fetch(n,{...t,headers:r,credentials:(t==null?void 0:t.credentials)??"include"});if(!i.ok){const c=await i.text();throw Z(`${o} ${e} -> ${i.status}`,{durationMs:Date.now()-s,error:c}),new Error(c||`Request failed with ${i.status}`)}const a=Date.now()-s;return Z(`${o} ${e} -> ${i.status}`,{durationMs:a}),i.status===204?void 0:await i.json()}catch(i){throw Z(`${o} ${e} failed`,{durationMs:Date.now()-s,error:i}),i}}async function yi(e,t){const n=X?new URL(e,X).toString():e,r=ur(t==null?void 0:t.headers);(t==null?void 0:t.body)!==void 0&&!r["Content-Type"]&&(r["Content-Type"]="application/json");const o=((t==null?void 0:t.method)??"GET").toUpperCase(),s=Date.now();Z(`${o} ${e}`);const i=await fetch(n,{...t,headers:r,credentials:(t==null?void 0:t.credentials)??"include"});if(!i.ok){const a=await i.text();throw Z(`${o} ${e} -> ${i.status}`,{durationMs:Date.now()-s,error:a}),new Error(a||`Request failed with ${i.status}`)}return Z(`${o} ${e} -> ${i.status}`,{durationMs:Date.now()-s}),i}const _={fetchWorkspaces(){return m("/api/workspaces")},fetchWorktrees(e){return m(`/api/workspaces/${encodeURIComponent(e)}/worktrees`)},createWorktree(e,t){return m(`/api/workspaces/${encodeURIComponent(e)}/worktrees`,{method:"POST",body:JSON.stringify(t)})},deleteWorktree(e,t,n){const r=new URLSearchParams;n!=null&&n.force&&r.set("force","true");const o=r.toString()?`?${r.toString()}`:"";return m(`/api/workspaces/${encodeURIComponent(e)}/worktrees/${encodeURIComponent(t)}${o}`,{method:"DELETE"})},readWorktreeMap(e){return m(`/api/workspaces/${encodeURIComponent(e)}/worktrees/map`)},writeWorktreeMap(e,t){return m(`/api/workspaces/${encodeURIComponent(e)}/worktrees/map`,{method:"PUT",body:JSON.stringify(t)})},createWorkspace(e){return m("/api/workspaces",{method:"POST",body:JSON.stringify(e)})},fetchSidecars(){return m("/api/sidecars")},createSidecar(e){return m("/api/sidecars",{method:"POST",body:JSON.stringify(e)})},updateSidecar(e,t){return m(`/api/sidecars/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})},deleteSidecar(e){return m(`/api/sidecars/${encodeURIComponent(e)}`,{method:"DELETE"})},fetchServerMeta(){return m("/api/meta")},probeRemoteServer(e){return m("/api/remote-servers/probe",{method:"POST",body:JSON.stringify(e)})},fetchAuthStatus(){return m("/api/auth/status")},setServerPassword(e){return m("/api/auth/password",{method:"POST",body:JSON.stringify({password:e})})},deleteWorkspace(e){return m(`/api/workspaces/${encodeURIComponent(e)}`,{method:"DELETE"})},listWorkspaceFiles(e,t="."){const n=new URLSearchParams({path:t});return m(`/api/workspaces/${encodeURIComponent(e)}/files?${n.toString()}`)},searchWorkspaceFiles(e,t,n){const r=t.trim();if(!r)return Promise.resolve([]);const o=new URLSearchParams({q:r});return n!=null&&n.limit&&o.set("limit",String(n.limit)),n!=null&&n.type&&o.set("type",n.type),m(`/api/workspaces/${encodeURIComponent(e)}/files/search?${o.toString()}`)},readWorkspaceFile(e,t){const n=new URLSearchParams({path:t});return m(`/api/workspaces/${encodeURIComponent(e)}/files/content?${n.toString()}`)},writeWorkspaceFile(e,t,n){const r=new URLSearchParams({path:t});return m(`/api/workspaces/${encodeURIComponent(e)}/files/content?${r.toString()}`,{method:"PUT",body:JSON.stringify({contents:n})})},fetchConfigOwner(e){return m(`/api/storage/config/${encodeURIComponent(e)}`)},patchConfigOwner(e,t){return m(`/api/storage/config/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t??{})})},fetchStateOwner(e){return m(`/api/storage/state/${encodeURIComponent(e)}`)},patchStateOwner(e,t){return m(`/api/storage/state/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t??{})})},validateBinary(e){return m("/api/storage/binaries/validate",{method:"POST",body:JSON.stringify({path:e})})},fetchSpeechCapabilities(){return m("/api/speech/capabilities")},transcribeAudio(e){return m("/api/speech/transcribe",{method:"POST",body:JSON.stringify(e)})},synthesizeSpeech(e){return m("/api/speech/synthesize",{method:"POST",body:JSON.stringify(e)})},synthesizeSpeechStream(e,t){return yi("/api/speech/synthesize/stream",{method:"POST",body:JSON.stringify(e),signal:t})},listFileSystem(e,t){const n=new URLSearchParams;e&&e!=="."&&n.set("path",e),(t==null?void 0:t.includeFiles)!==void 0&&n.set("includeFiles",String(t.includeFiles));const r=n.toString();return m(r?`/api/filesystem?${r}`:"/api/filesystem")},createFileSystemFolder(e,t){return m("/api/filesystem/folders",{method:"POST",body:JSON.stringify({parentPath:e,name:t})})},readInstanceData(e){return m(`/api/storage/instances/${encodeURIComponent(e)}`)},writeInstanceData(e,t){return m(`/api/storage/instances/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})},deleteInstanceData(e){return m(`/api/storage/instances/${encodeURIComponent(e)}`,{method:"DELETE"})},listBackgroundProcesses(e){return m(`/workspaces/${encodeURIComponent(e)}/plugin/background-processes`)},stopBackgroundProcess(e,t){return m(`/workspaces/${encodeURIComponent(e)}/plugin/background-processes/${encodeURIComponent(t)}/stop`,{method:"POST"})},terminateBackgroundProcess(e,t){return m(`/workspaces/${encodeURIComponent(e)}/plugin/background-processes/${encodeURIComponent(t)}/terminate`,{method:"POST"})},updateVoiceMode(e,t){const n=Mt();return m(`/workspaces/${encodeURIComponent(e)}/plugin/voice-mode`,{method:"POST",body:JSON.stringify({...n,enabled:t})})},sendClientConnectionPong(e){return m("/api/client-connections/pong",{method:"POST",body:JSON.stringify(e)})},fetchBackgroundProcessOutput(e,t,n){const r=new URLSearchParams;n!=null&&n.method&&r.set("method",n.method),n!=null&&n.pattern&&r.set("pattern",n.pattern),n!=null&&n.lines&&r.set("lines",String(n.lines)),(n==null?void 0:n.maxBytes)!==void 0&&r.set("maxBytes",String(n.maxBytes));const o=r.toString(),s=o?`?${o}`:"";return m(`/workspaces/${encodeURIComponent(e)}/plugin/background-processes/${encodeURIComponent(t)}/output${s}`)},connectEvents(e,t,n){const r=Mt(),o=bi(r);We.info(`Connecting to ${o}`);const s=new EventSource(o,{withCredentials:!0});return s.onmessage=i=>{try{const a=JSON.parse(i.data);e(a)}catch(a){We.error("Failed to parse event",a)}},s.onerror=()=>{We.warn("EventSource error, closing stream"),t==null||t()},s.addEventListener("codenomad.client.ping",i=>{try{const a=i.data?JSON.parse(i.data):{};n==null||n(a)}catch(a){We.error("Failed to parse ping event",a)}}),s}};function bi(e){const t=new URL(St,typeof window<"u"?window.location.origin:"http://localhost");return t.searchParams.set("clientId",e.clientId),t.searchParams.set("connectionId",e.connectionId),St.startsWith("http://")||St.startsWith("https://")?t.toString():`${t.pathname}${t.search}`}const yn=1e3,wi=1e4,Lt=ie("sse");function ze(e,t){if(t){Lt.info(e,t);return}Lt.info(e)}class Ci{constructor(){this.handlers=new Map,this.openHandlers=new Set,this.source=null,this.retryDelay=yn,this.connect()}connect(){this.source&&this.source.close(),ze("Connecting to backend events stream"),this.source=_.connectEvents(t=>this.dispatch(t),()=>this.scheduleReconnect(),t=>{_.sendClientConnectionPong({...Mt(),pingTs:t.ts}).catch(n=>{Lt.error("Failed to send client connection pong",n)})}),this.source.onopen=()=>{ze("Events stream connected"),this.retryDelay=yn,this.openHandlers.forEach(t=>t())}}scheduleReconnect(){this.source&&(this.source.close(),this.source=null),ze("Events stream disconnected, scheduling reconnect",{delayMs:this.retryDelay}),setTimeout(()=>{this.retryDelay=Math.min(this.retryDelay*2,wi),this.connect()},this.retryDelay)}dispatch(t){var n,r;ze(`event ${t.type}`),(n=this.handlers.get("*"))==null||n.forEach(o=>o(t)),(r=this.handlers.get(t.type))==null||r.forEach(o=>o(t))}on(t,n){this.handlers.has(t)||this.handlers.set(t,new Set);const r=this.handlers.get(t);return r.add(n),()=>r.delete(n)}onOpen(t){return this.openHandlers.add(t),()=>this.openHandlers.delete(t)}}const Ot=new Ci,Si=ie("actions"),bn={messageHistory:[],agentModelSelections:{}};function wn(e,t){if(e===t)return!0;if(typeof e=="object"&&e!==null&&typeof t=="object"&&t!==null)try{return JSON.stringify(e)===JSON.stringify(t)}catch(n){Si.warn("Failed to compare config objects",n)}return!1}class Oi{constructor(){this.configOwnerCache=new Map,this.stateOwnerCache=new Map,this.configOwnerLoadPromises=new Map,this.stateOwnerLoadPromises=new Map,this.configOwnerListeners=new Map,this.stateOwnerListeners=new Map,this.instanceDataCache=new Map,this.instanceDataListeners=new Map,this.instanceLoadPromises=new Map,Ot.on("storage.configChanged",t=>{t.type==="storage.configChanged"&&this.setOwnerCache("config",t.owner,t.value)}),Ot.on("storage.stateChanged",t=>{t.type==="storage.stateChanged"&&this.setOwnerCache("state",t.owner,t.value)}),Ot.on("instance.dataChanged",t=>{t.type==="instance.dataChanged"&&this.setInstanceDataCache(t.instanceId,t.data)})}async loadConfigOwner(t){const n=this.configOwnerCache.get(t);if(n)return n;if(!this.configOwnerLoadPromises.has(t)){const r=_.fetchConfigOwner(t).then(o=>(this.setOwnerCache("config",t,o),o)).finally(()=>{this.configOwnerLoadPromises.delete(t)});this.configOwnerLoadPromises.set(t,r)}return this.configOwnerLoadPromises.get(t)}async patchConfigOwner(t,n){const r=await _.patchConfigOwner(t,n);return this.setOwnerCache("config",t,r),r}async loadStateOwner(t){const n=this.stateOwnerCache.get(t);if(n)return n;if(!this.stateOwnerLoadPromises.has(t)){const r=_.fetchStateOwner(t).then(o=>(this.setOwnerCache("state",t,o),o)).finally(()=>{this.stateOwnerLoadPromises.delete(t)});this.stateOwnerLoadPromises.set(t,r)}return this.stateOwnerLoadPromises.get(t)}async patchStateOwner(t,n){const r=await _.patchStateOwner(t,n);return this.setOwnerCache("state",t,r),r}async loadInstanceData(t){const n=this.instanceDataCache.get(t);if(n)return n;if(!this.instanceLoadPromises.has(t)){const r=_.readInstanceData(t).then(o=>{const s=this.normalizeInstanceData(o);return this.setInstanceDataCache(t,s),s}).finally(()=>{this.instanceLoadPromises.delete(t)});this.instanceLoadPromises.set(t,r)}return this.instanceLoadPromises.get(t)}async saveInstanceData(t,n){const r=this.normalizeInstanceData(n);await _.writeInstanceData(t,r),this.setInstanceDataCache(t,r)}async deleteInstanceData(t){await _.deleteInstanceData(t),this.setInstanceDataCache(t,bn)}onConfigOwnerChanged(t,n){this.configOwnerListeners.has(t)||this.configOwnerListeners.set(t,new Set);const r=this.configOwnerListeners.get(t);r.add(n);const o=this.configOwnerCache.get(t);return o&&n(o),()=>{r.delete(n),r.size===0&&this.configOwnerListeners.delete(t)}}onStateOwnerChanged(t,n){this.stateOwnerListeners.has(t)||this.stateOwnerListeners.set(t,new Set);const r=this.stateOwnerListeners.get(t);r.add(n);const o=this.stateOwnerCache.get(t);return o&&n(o),()=>{r.delete(n),r.size===0&&this.stateOwnerListeners.delete(t)}}onInstanceDataChanged(t,n){this.instanceDataListeners.has(t)||this.instanceDataListeners.set(t,new Set);const r=this.instanceDataListeners.get(t);r.add(n);const o=this.instanceDataCache.get(t);return o&&n(o),()=>{r.delete(n),r.size===0&&this.instanceDataListeners.delete(t)}}setOwnerCache(t,n,r){if(n==="*"){t==="config"?this.configOwnerCache.clear():this.stateOwnerCache.clear();return}const o=t==="config"?this.configOwnerCache:this.stateOwnerCache,s=t==="config"?this.configOwnerListeners:this.stateOwnerListeners,i=o.get(n);if(i&&wn(i,r)){o.set(n,r);return}o.set(n,r);const a=s.get(n);if(a)for(const c of a)c(r)}normalizeInstanceData(t){const n=t??bn,r=Array.isArray(n.messageHistory)?[...n.messageHistory]:[],o={...n.agentModelSelections??{}};return{...n,messageHistory:r,agentModelSelections:o}}setInstanceDataCache(t,n){const r=this.normalizeInstanceData(n),o=this.instanceDataCache.get(t);if(o&&wn(o,r)){this.instanceDataCache.set(t,r);return}this.instanceDataCache.set(t,r),this.notifyInstanceDataChanged(t,r)}notifyInstanceDataChanged(t,n){const r=this.instanceDataListeners.get(t);if(r)for(const o of r)o(n)}}const B=new Oi,dr=ie("api"),ut={messageHistory:[],agentModelSelections:{}},[Ht,fr]=$(new Map),Ke=new Map,Se=new Map;function hr(e){const t=e??ut;return{...t,messageHistory:Array.isArray(t.messageHistory)?[...t.messageHistory]:[],agentModelSelections:{...t.agentModelSelections??{}}}}function Cn(e){if(Se.has(e))return;const t=B.onInstanceDataChanged(e,n=>{et(e,n)});Se.set(e,t)}function xi(e){const t=Se.get(e);t&&(t(),Se.delete(e))}function et(e,t){fr(n=>{const r=new Map(n);return r.set(e,hr(t)),r})}async function dt(e){if(!e||Ht().has(e))return;if(Ke.has(e)){await Ke.get(e);return}const t=B.loadInstanceData(e).then(n=>{et(e,n),Cn(e)}).catch(n=>{dr.warn("Failed to load instance data",n),et(e,ut),Cn(e)}).finally(()=>{Ke.delete(e)});Ke.set(e,t),await t}async function gr(e,t){if(!e)return;await dt(e);const n=Ht().get(e)??ut,r=hr(n);t(r);try{await B.saveInstanceData(e,r)}catch(o){dr.warn("Failed to persist instance data",o)}et(e,r)}function pr(e){return Ht().get(e)??ut}function vi(e){fr(t=>{if(!t.has(e))return t;const n=new Map(t);return n.delete(e),n}),xi(e)}const ki=xe(),$i={getInstanceConfig:pr,ensureInstanceConfig:dt,updateInstanceConfig:gr,clearInstanceConfig:vi},Oc=e=>(be(()=>{for(const t of Se.values())t();Se.clear()}),te(ki.Provider,{value:$i,get children(){return e.children}})),Ai=ie("api"),[Sn,Rt]=$(null),[xc,On]=$(!1),[vc,Je]=$(null);let ke=null;async function Ei(e=!1){return!e&&Sn()?Sn():ke||(On(!0),Je(null),ke=_.fetchSpeechCapabilities().then(t=>(Rt(t),Je(null),t)).catch(t=>(Ai.error("Failed to load speech capabilities",t),Rt(null),Je(t instanceof Error?t.message:String(t)),null)).finally(()=>{On(!1),ke=null}),ke)}function Ii(){Rt(null),Je(null)}const C=ie("actions"),Ti=20,Pi=5,Mi=50,S={showThinkingBlocks:!1,showKeyboardShortcutHints:!0,thinkingBlocksExpansion:"expanded",showTimelineTools:!0,promptSubmitOnEnter:!1,showPromptVoiceInput:!0,diffViewMode:"split",toolOutputExpansion:"expanded",diagnosticsExpansion:"expanded",toolInputsVisibility:"collapsed",showUsageMetrics:!0,autoCleanupBlankSessions:!0,osNotificationsEnabled:!1,osNotificationsAllowWhenVisible:!1,notifyOnNeedsInput:!0,notifyOnIdle:!0},le={provider:"openai-compatible",sttModel:"gpt-4o-mini-transcribe",ttsModel:"gpt-4o-mini-tts",ttsVoice:"alloy",playbackMode:"streaming",ttsFormat:"mp3"};function mr(e){const t=e??{};return{showThinkingBlocks:t.showThinkingBlocks??S.showThinkingBlocks,showKeyboardShortcutHints:t.showKeyboardShortcutHints??S.showKeyboardShortcutHints,thinkingBlocksExpansion:t.thinkingBlocksExpansion??S.thinkingBlocksExpansion,showTimelineTools:t.showTimelineTools??S.showTimelineTools,promptSubmitOnEnter:t.promptSubmitOnEnter??S.promptSubmitOnEnter,showPromptVoiceInput:t.showPromptVoiceInput??S.showPromptVoiceInput,locale:t.locale??S.locale,diffViewMode:t.diffViewMode??S.diffViewMode,toolOutputExpansion:t.toolOutputExpansion??S.toolOutputExpansion,diagnosticsExpansion:t.diagnosticsExpansion??S.diagnosticsExpansion,toolInputsVisibility:t.toolInputsVisibility==="hidden"||t.toolInputsVisibility==="collapsed"||t.toolInputsVisibility==="expanded"?t.toolInputsVisibility:S.toolInputsVisibility,showUsageMetrics:t.showUsageMetrics??S.showUsageMetrics,autoCleanupBlankSessions:t.autoCleanupBlankSessions??S.autoCleanupBlankSessions,osNotificationsEnabled:t.osNotificationsEnabled??S.osNotificationsEnabled,osNotificationsAllowWhenVisible:t.osNotificationsAllowWhenVisible??S.osNotificationsAllowWhenVisible,notifyOnNeedsInput:t.notifyOnNeedsInput??S.notifyOnNeedsInput,notifyOnIdle:t.notifyOnIdle??S.notifyOnIdle}}function yr(e){if(!e||typeof e!="object"||Array.isArray(e))return{};const t={};for(const[n,r]of Object.entries(e))typeof r=="string"&&(t[n]=r);return t}function br(e){const t=e??{};return{provider:t.provider==="openai-compatible"?t.provider:le.provider,apiKey:typeof t.apiKey=="string"&&t.apiKey.trim()?t.apiKey.trim():void 0,hasApiKey:t.hasApiKey===!0||typeof t.apiKey=="string"&&t.apiKey.trim().length>0,baseUrl:typeof t.baseUrl=="string"&&t.baseUrl.trim()?t.baseUrl.trim():void 0,sttModel:typeof t.sttModel=="string"&&t.sttModel.trim()?t.sttModel.trim():le.sttModel,ttsModel:typeof t.ttsModel=="string"&&t.ttsModel.trim()?t.ttsModel.trim():le.ttsModel,ttsVoice:typeof t.ttsVoice=="string"&&t.ttsVoice.trim()?t.ttsVoice.trim():le.ttsVoice,playbackMode:t.playbackMode==="buffered"||t.playbackMode==="streaming"?t.playbackMode:le.playbackMode,ttsFormat:t.ttsFormat==="wav"||t.ttsFormat==="opus"||t.ttsFormat==="aac"||t.ttsFormat==="mp3"?t.ttsFormat:le.ttsFormat}}function $e(e,t){if(!Array.isArray(e))return[];const n=[];for(const r of e){const o=t(r);o&&n.push(o)}return n}function Fi(e){var n,r,o;const t=e??{};return{recentFolders:$e(t.recentFolders,s=>{if(!s||typeof s!="object")return null;const i=s.path,a=s.lastAccessed;if(typeof i!="string")return null;const c=typeof a=="number"?a:Date.now();return{path:i,lastAccessed:c}}),opencodeBinaries:$e(t.opencodeBinaries,s=>{if(!s||typeof s!="object")return null;const i=s.path;if(typeof i!="string")return null;const a=typeof s.lastUsed=="number"?s.lastUsed:Date.now(),c=typeof s.version=="string"?s.version:void 0,u=typeof s.label=="string"?s.label:void 0;return{path:i,version:c,label:u,lastUsed:a}}),remoteServers:$e(t.remoteServers,s=>{if(!s||typeof s!="object")return null;const i=typeof s.id=="string"?s.id.trim():"",a=typeof s.name=="string"?s.name.trim():"",c=typeof s.baseUrl=="string"?s.baseUrl.trim():"";if(!i||!a||!c)return null;const u=typeof s.createdAt=="string"?s.createdAt:new Date().toISOString(),l=typeof s.updatedAt=="string"?s.updatedAt:u,d=typeof s.lastConnectedAt=="string"?s.lastConnectedAt:void 0;return{id:i,name:a,baseUrl:c,skipTlsVerify:!!s.skipTlsVerify,createdAt:u,updatedAt:l,lastConnectedAt:d}}).sort((s,i)=>{const a=s.lastConnectedAt??s.updatedAt;return(i.lastConnectedAt??i.updatedAt).localeCompare(a)}),models:{recents:$e((n=t.models)==null?void 0:n.recents,s=>{if(!s||typeof s!="object")return null;const i=s.providerId,a=s.modelId;return typeof i!="string"||typeof a!="string"?null:{providerId:i,modelId:a}}),favorites:$e((r=t.models)==null?void 0:r.favorites,s=>{if(!s||typeof s!="object")return null;const i=s.providerId,a=s.modelId;return typeof i!="string"||typeof a!="string"?null:{providerId:i,modelId:a}}),thinkingSelections:yr((o=t.models)==null?void 0:o.thinkingSelections)}}}function Di(e){const t=e??{},n=t.listeningMode==="all"?"all":"local",r=t.logLevel==="INFO"||t.logLevel==="WARN"||t.logLevel==="ERROR"||t.logLevel==="DEBUG"?t.logLevel:"DEBUG",o=typeof t.opencodeBinary=="string"&&t.opencodeBinary.trim()?t.opencodeBinary:"opencode",s=yr(t.environmentVariables),i=br(t.speech);return{listeningMode:n,logLevel:r,opencodeBinary:o,environmentVariables:s,speech:i}}function wr(e){return`${e.providerId}/${e.modelId}`}function Cr(e,t){const n=t.filter(r=>r.path!==e);return n.unshift({path:e,lastAccessed:Date.now()}),n.slice(0,Ti)}function Gt(e,t,n){const r=Date.now(),o=n.find(i=>i.path===e);if(o){const i={...o,lastUsed:r,version:t??o.version},a=n.filter(c=>c.path!==e);return[i,...a]}return[t?{path:e,version:t,lastUsed:r}:{path:e,lastUsed:r},...n].slice(0,10)}function Li(e,t){const n=e.id?t.find(o=>o.id===e.id):void 0,r=new Date().toISOString();return{id:(n==null?void 0:n.id)??e.id??Ri(),name:e.name.trim(),baseUrl:e.baseUrl.trim(),skipTlsVerify:!!e.skipTlsVerify,createdAt:(n==null?void 0:n.createdAt)??r,updatedAt:r,lastConnectedAt:n==null?void 0:n.lastConnectedAt}}function Sr(e,t){const n=t.filter(r=>r.id!==e.id);return[e,...n].sort((r,o)=>{const s=r.lastConnectedAt??r.updatedAt;return(o.lastConnectedAt??o.updatedAt).localeCompare(s)})}function Ri(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`remote-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}const[qt,tt]=$({}),[Ni,nt]=$({}),[Bi,rt]=$({}),[Or,Pe]=$(!1),Ui=k(()=>mr(qt().settings)),xr=k(()=>qt().theme??"system"),ae=k(()=>Di(Ni())),z=k(()=>Fi(Bi())),P=Ui,ft=k(()=>z().recentFolders),Be=k(()=>z().opencodeBinaries),Oe=k(()=>z().remoteServers);let He=null;async function ht(){Or()||(He||(He=Promise.all([B.loadConfigOwner("ui"),B.loadConfigOwner("server"),B.loadStateOwner("ui")]).then(([e,t,n])=>{tt(e),nt(t),rt(n),Pe(!0)}).catch(e=>{C.error("Failed to load settings",e),tt({}),nt({}),rt({}),Pe(!0)}).finally(()=>{He=null})),await He)}async function H(e,t){await ht();const n=await B.patchConfigOwner(e,t);e==="ui"&&tt(n),e==="server"&&nt(n)}async function D(e,t){await ht();const n=await B.patchStateOwner(e,t);rt(n)}function L(e){const t=qt(),r={settings:mr({...t.settings??{},...e})};H("ui",r).catch(o=>C.error("Failed to patch ui settings",o))}function vr(e){L(e)}function ji(e){xr()!==e&&H("ui",{theme:e}).catch(t=>C.error("Failed to set theme",t))}async function _i(e){ae().listeningMode!==e&&await H("server",{listeningMode:e})}function Jt(e){H("server",{environmentVariables:e}).catch(t=>C.error("Failed to update environment variables",t))}function Vi(e,t){const n=ae().environmentVariables;Jt({...n,[e]:t})}function Wi(e){const t=ae().environmentVariables,{[e]:n,...r}=t;Jt(r)}function zi(e){const t=e&&e.trim().length>0?e:"opencode";H("server",{opencodeBinary:t}).catch(r=>C.error("Failed to set default binary",r));const n=Gt(t,void 0,Be());D("ui",{opencodeBinaries:n}).catch(r=>C.error("Failed to update binary list",r))}function Ki(e){H("server",{logLevel:e??"DEBUG"}).catch(n=>C.error("Failed to set log level",n))}async function Hi(e){const t=e.apiKey,{apiKey:n,...r}=e,o=br({...ae().speech,...r,...t===null?{}:{apiKey:t}}),{hasApiKey:s,...i}=o,a={...i,...t===null?{apiKey:null}:{}};try{await H("server",{speech:a})}catch(c){throw C.error("Failed to update speech settings",c),c}}function Gi(e,t){const n=Gt(e,t,Be());D("ui",{opencodeBinaries:n}).catch(r=>C.error("Failed to add binary",r))}function qi(e){const t=Be().filter(n=>n.path!==e);D("ui",{opencodeBinaries:t}).catch(n=>C.error("Failed to remove binary",n)),ae().opencodeBinary===e&&H("server",{opencodeBinary:"opencode"}).catch(n=>C.error("Failed to reset default binary",n))}function Ji(e){const t=Cr(e,ft());D("ui",{recentFolders:t}).catch(n=>C.error("Failed to add recent folder",n))}function Xi(e){const t=ft().filter(n=>n.path!==e);D("ui",{recentFolders:t}).catch(n=>C.error("Failed to remove recent folder",n))}async function Yi(e){const t=Li(e,Oe());return await D("ui",{remoteServers:Sr(t,Oe())}),t}async function Zi(e){const t=Oe().find(o=>o.id===e);if(!t)return;const n=new Date().toISOString(),r={...t,updatedAt:n,lastConnectedAt:n};await D("ui",{remoteServers:Sr(r,Oe())})}function Qi(e){const t=Oe().filter(n=>n.id!==e);D("ui",{remoteServers:t}).catch(n=>C.error("Failed to remove remote server",n))}function ea(e,t){const n=t&&t.trim().length>0?t:ae().opencodeBinary,r=Cr(e,ft()),o=Gt(n,void 0,Be());D("ui",{recentFolders:r,opencodeBinaries:o}).catch(s=>C.error("Failed to update ui state on launch",s)),H("server",{opencodeBinary:n}).catch(s=>C.error("Failed to persist selected binary",s))}function ta(e){if(!e.providerId||!e.modelId)return;const n=z().models.recents.filter(o=>o.providerId!==e.providerId||o.modelId!==e.modelId),r=[e,...n].slice(0,Pi);D("ui",{models:{recents:r}}).catch(o=>C.error("Failed to update model recents",o))}function na(e){return!e.providerId||!e.modelId?!1:z().models.favorites.some(t=>t.providerId===e.providerId&&t.modelId===e.modelId)}function ra(e){if(!e.providerId||!e.modelId)return;const t=z().models.favorites,r=t.some(o=>o.providerId===e.providerId&&o.modelId===e.modelId)?t.filter(o=>o.providerId!==e.providerId||o.modelId!==e.modelId):[e,...t.filter(o=>o.providerId!==e.providerId||o.modelId!==e.modelId)].slice(0,Mi);D("ui",{models:{favorites:r}}).catch(o=>C.error("Failed to update model favorites",o))}function oa(e){if(!(!e.providerId||!e.modelId))return z().models.thinkingSelections[wr(e)]}function sa(e,t){if(!e.providerId||!e.modelId)return;const n=wr(e);if(z().models.thinkingSelections[n]===t)return;const o={...z().models.thinkingSelections};t?o[n]=t:delete o[n],D("ui",{models:{thinkingSelections:o}}).catch(s=>C.error("Failed to update thinking selection",s))}function ia(e){P().diffViewMode!==e&&L({diffViewMode:e})}function aa(e){P().toolOutputExpansion!==e&&L({toolOutputExpansion:e})}function ca(e){P().diagnosticsExpansion!==e&&L({diagnosticsExpansion:e})}function la(e){P().toolInputsVisibility!==e&&L({toolInputsVisibility:e})}function ua(e){P().thinkingBlocksExpansion!==e&&L({thinkingBlocksExpansion:e})}function da(){L({showThinkingBlocks:!P().showThinkingBlocks})}function fa(){vr({showKeyboardShortcutHints:!P().showKeyboardShortcutHints})}function ha(){L({showTimelineTools:!P().showTimelineTools})}function ga(){L({showUsageMetrics:!P().showUsageMetrics})}function pa(){L({promptSubmitOnEnter:!P().promptSubmitOnEnter})}function ma(){L({showPromptVoiceInput:!P().showPromptVoiceInput})}function ya(){const e=!P().autoCleanupBlankSessions;C.info("toggle auto cleanup",{value:e}),L({autoCleanupBlankSessions:e})}async function ba(e,t,n){!e||!t||!n.providerId||!n.modelId||(await dt(e),await gr(e,r=>{const o={...r.agentModelSelections??{}},s=o[t];s&&s.providerId===n.providerId&&s.modelId===n.modelId||(o[t]=n,r.agentModelSelections=o)}))}async function wa(e,t){return!e||!t?void 0:(await dt(e),(pr(e).agentModelSelections??{})[t])}ht().catch(e=>{C.error("Failed to initialize settings",e)});const kr=xe(),Ca={isLoaded:Or,preferences:P,updatePreferences:vr,themePreference:xr,setThemePreference:ji,serverSettings:ae,setListeningMode:_i,updateEnvironmentVariables:Jt,addEnvironmentVariable:Vi,removeEnvironmentVariable:Wi,updateLastUsedBinary:zi,updateLogLevel:Ki,updateSpeechSettings:Hi,recentFolders:ft,opencodeBinaries:Be,remoteServers:Oe,uiState:z,addRecentFolder:Ji,removeRecentFolder:Xi,addOpenCodeBinary:Gi,removeOpenCodeBinary:qi,saveRemoteServerProfile:Yi,markRemoteServerConnected:Zi,removeRemoteServerProfile:Qi,recordWorkspaceLaunch:ea,addRecentModelPreference:ta,isFavoriteModelPreference:na,toggleFavoriteModelPreference:ra,getModelThinkingSelection:oa,setModelThinkingSelection:sa,toggleShowThinkingBlocks:da,toggleKeyboardShortcutHints:fa,toggleShowTimelineTools:ha,toggleUsageMetrics:ga,toggleAutoCleanupBlankSessions:ya,togglePromptSubmitOnEnter:pa,toggleShowPromptVoiceInput:ma,setDiffViewMode:ia,setToolOutputExpansion:aa,setDiagnosticsExpansion:ca,setThinkingBlocksExpansion:ua,setToolInputsVisibility:la,setAgentModelPreference:ba,getAgentModelPreference:wa},kc=e=>(st(()=>{ht().catch(o=>{C.error("Failed to initialize settings",o)});const t=B.onConfigOwnerChanged("ui",o=>{tt(o),Pe(!0)}),n=B.onConfigOwnerChanged("server",o=>{nt(o),Pe(!0),Ii(),Ei(!0)}),r=B.onStateOwnerChanged("ui",o=>{rt(o),Pe(!0)});return()=>{t(),n(),r()}}),te(kr.Provider,{value:Ca,get children(){return e.children}}));function Sa(){const e=Le(kr);if(!e)throw new Error("useConfig must be used within ConfigProvider");return e}function Oa(e,t,n){const r={};return Object.keys(e).forEach(o=>{r[o]=e[o].reduce((s,i)=>(i&&(n&&n[i]&&s.push(n[i]),s.push(t(i))),s),[]).join(" ")}),r}const xa=Symbol("solid-inspect"),va=xe();function ka(e){function t(n){var r;return(r=Le(va))!=null&&r.enabled?{Component:t,props:n,$INSPECT:xa}:e(n)}return Object.defineProperty(t,"name",{value:e.name}),t.toString=e.toString,t}function $r(){return function(e){function t(a){const c=!!e.slotClasses,u=()=>{if(!e.slotClasses)throw new Error("'slotClasses' option is not defined");if(!e.utilityClass)throw new Error("'utilityClass' option is not defined");return Oa(e.slotClasses(a),e.utilityClass,a.classes??"")},l=yo({});return c&&jr(()=>{const d=u();fe(()=>{for(const f in d)l[f]=d[f]})}),l}function n(a){const[c,u]=ot(a,e.selfPropNames);return{allProps:a,props:c,otherProps:u}}function r(a){return is({propDefaults:a.propDefaults||e.propDefaults,props:a.props,name:e.name})}function o(a){const c=r({props:a});return n(c)}function s(a,c=!0){return a=ka(a),a.toString=()=>`.${e.name}-root`,c&&ar(a,"base"),a}function i(a){const c=s(function(l){const{allProps:d,otherProps:f,props:g}=o(l),p=e.autoCallUseClasses??!0?t(d):{};return a({allProps:d,otherProps:f,props:g,classes:p})});return Object.defineProperty(c,"name",{value:a.name}),c}return{name:e.name,selfPropNames:e.selfPropNames,component:i,defineComponent:s,useClasses:t,useThemeProps:r,useProps:o,splitInProps:n}}}const $a=$r()({name:"MuiGlobalStyles",selfPropNames:["styles"]}),Aa=$a.component(function({props:t}){return tr(()=>({"@global":t.styles||{}})),[]}),Ea=$r()({name:"MuiCssBaseline",selfPropNames:["children","enableColorScheme"],propDefaults:({set:e})=>e({enableColorScheme:!1})}),Ia=(e,t)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...t&&{colorScheme:e.palette.mode}}),Ta=e=>({color:e.palette.text.primary,...e.typography.body1,backgroundColor:e.palette.background.default,"@media print":{backgroundColor:e.palette.common.white}}),Pa=(e,t=!1)=>({html:Ia(e,t),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:{margin:0,...Ta(e),"&::backdrop":{backgroundColor:e.palette.background.default}}}),Ma=Ea.component(function({props:t}){const n=Hn();return te(Aa,{get styles(){return Pa(n,t.enableColorScheme)}})}),Ar=xe();function xn(e){if(!(typeof document>"u")){if(e==="system"){document.documentElement.removeAttribute("data-theme");return}document.documentElement.setAttribute("data-theme",e)}}const Fa={backgroundDefault:"#ffffff",backgroundPaper:"#f5f5f5",primary:"#0066ff",primaryContrast:"#ffffff",textPrimary:"#1a1a1a",textSecondary:"#666666",divider:"#e0e0e0"},Da={backgroundDefault:"#1a1a1a",backgroundPaper:"#2a2a2a",primary:"#0080ff",primaryContrast:"#1a1a1a",textPrimary:"#cfd4dc",textSecondary:"#999999",divider:"#3a3a3a"},Y=(e,t,n)=>{if(!n)return t;const r=n.getPropertyValue(e);return r&&r.trim()||t},La=e=>{const t=e?Da:Fa,n=typeof window<"u"?getComputedStyle(document.documentElement):null;return{backgroundDefault:Y("--surface-base",t.backgroundDefault,n),backgroundPaper:Y("--surface-secondary",t.backgroundPaper,n),primary:Y("--accent-primary",t.primary,n),primaryContrast:Y("--text-inverted",t.primaryContrast,n),textPrimary:Y("--text-primary",t.textPrimary,n),textSecondary:Y("--text-secondary",t.textSecondary,n),divider:Y("--border-base",t.divider,n)}};function $c(e){const t=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null,{themePreference:n,setThemePreference:r}=Sa(),[o,s]=$(!0),[i,a]=$(0),c=()=>n(),u=()=>{const p=c();return p==="dark"?!0:p==="light"?!1:(t==null?void 0:t.matches)??!1},l=()=>{const p=c(),b=u();xn(p==="system"?"system":p),s(b),typeof window<"u"?requestAnimationFrame(()=>a(y=>y+1)):a(y=>y+1)};ee(()=>{l()}),st(()=>{if(!t)return;const p=()=>{l()};return t.addEventListener("change",p),()=>{t.removeEventListener("change",p)}});const d=p=>{r(p)},f=()=>{const p=c();d(p==="system"?"light":p==="light"?"dark":"system")},g=k(()=>{i();const p=La(o());return Wn({palette:{mode:o()?"dark":"light",primary:{main:p.primary,contrastText:p.primaryContrast},secondary:{main:p.primary},background:{default:p.backgroundDefault,paper:p.backgroundPaper},text:{primary:p.textPrimary,secondary:p.textSecondary},divider:p.divider},typography:{fontFamily:"var(--font-family-sans)"},shape:{borderRadius:8},components:{MuiIconButton:{styleOverrides:{root:{color:"inherit","&.Mui-disabled":{color:"var(--text-muted)",opacity:.55}}}},MuiDrawer:{styleOverrides:{paper:{backgroundColor:"var(--surface-secondary)",color:"var(--text-primary)"}}},MuiAppBar:{styleOverrides:{root:{backgroundColor:"var(--surface-secondary)",color:"var(--text-primary)",boxShadow:"none",borderBottom:"1px solid var(--border-base)",zIndex:10}}},MuiToolbar:{styleOverrides:{root:{minHeight:"56px"}}}}})});return te(Ar.Provider,{value:{isDark:o,themeMode:c,setThemeMode:d,cycleThemeMode:f},get children(){return te(as,{get theme(){return g()},get children(){return[te(Ma,{}),Xr(()=>e.children)]}})}})}function Er(){const e=Le(Ar);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const Ra="0.52.2",Nt=`https://cdn.jsdelivr.net/npm/monaco-editor@${Ra}/min/vs`,N="/monaco/vs";let Ge=null;function Na(e,t){return new Promise((n,r)=>{const o=setTimeout(()=>r(new Error("timeout")),t);e.then(s=>{clearTimeout(o),n(s)}).catch(s=>{clearTimeout(o),r(s)})})}async function Ba(){if(typeof fetch>"u")return!1;try{const e=new AbortController,t=fetch(`${Nt}/loader.js`,{method:"HEAD",signal:e.signal}),n=await Na(t,1200);return e.abort(),n.ok}catch{return!1}}function Ua(){return typeof document>"u"||document.querySelector('script[data-monaco-loader="true"]')?Promise.resolve():new Promise((t,n)=>{const r=document.createElement("script");r.dataset.monacoLoader="true",r.src=`${N}/loader.js`,r.async=!0,r.onload=()=>t(),r.onerror=()=>n(new Error("Failed to load Monaco AMD loader")),document.head.appendChild(r)})}function ja(){if(typeof document>"u"||document.querySelector('link[data-monaco-editor-css="true"]'))return;const t=document.createElement("link");t.rel="stylesheet",t.href=`${N}/editor/editor.main.css`,t.dataset.monacoEditorCss="true",document.head.appendChild(t)}function _a(){const e=globalThis,t=e.MonacoEnvironment??{},n="/monaco.worker.js";e.MonacoEnvironment={...t,getWorkerUrl(r,o){return n}}}function Ir(){const e=globalThis.require;if(!e)throw new Error("Monaco AMD loader is not available");return e}function Va(){const t=Ir().config;if(!t)throw new Error("require.config is not available");return t}function Bt(e){const t=Ir();return new Promise((n,r)=>{t(e,(...o)=>n(o),o=>r(o))})}function Wa(e){const t=String(e||"plaintext");return!t||t==="plaintext"?null:t==="typescript"||t==="javascript"?"vs/language/typescript/monaco.contribution":t==="json"?"vs/language/json/monaco.contribution":t==="css"||t==="scss"||t==="less"?"vs/language/css/monaco.contribution":t==="html"?"vs/language/html/monaco.contribution":t==="toml"?"vs/basic-languages/toml/toml":`vs/basic-languages/${t}/${t}`}const vn=new Set,xt=new Map;async function Tr(e){const t=Wa(e);if(!t||vn.has(t))return;const n=xt.get(t);if(n)return n;const r=(async()=>{let o=!1;try{await Bt([t]),o=!0}catch{}finally{o&&vn.add(t),xt.delete(t)}})();return xt.set(t,r),r}async function Pr(){return Ge||(Ge=(async()=>{await Ua(),_a(),ja();const e=await Ba(),t=Va(),n={vs:N};e&&(n["vs/basic-languages"]=`${Nt}/basic-languages`,n["vs/language"]=`${Nt}/language`,n["vs/basic-languages/python"]=`${N}/basic-languages/python`,n["vs/basic-languages/markdown"]=`${N}/basic-languages/markdown`,n["vs/basic-languages/cpp"]=`${N}/basic-languages/cpp`,n["vs/basic-languages/kotlin"]=`${N}/basic-languages/kotlin`,n["vs/language/typescript"]=`${N}/language/typescript`,n["vs/language/html"]=`${N}/language/html`,n["vs/language/json"]=`${N}/language/json`,n["vs/language/css"]=`${N}/language/css`),t({paths:n,ignoreDuplicateModules:["vs/editor/editor.main"]});const[r]=await Bt(["vs/editor/editor.main"]);return await Bt(["vs/basic-languages/monaco.contribution"]).catch(()=>[]),globalThis.monaco??r})(),Ge)}const za=5,J=new Map;function Ka(e,t){J.delete(e),J.set(e,t)}function Ha(){for(;J.size>za;){const e=J.keys().next().value;if(!e)return;const t=J.get(e);J.delete(e);try{t==null||t.model.dispose()}catch{}}}function Ut(e){const t=J.get(e.cacheKey);if(t)return Ka(e.cacheKey,t),t.model.getValue()!==e.value&&t.model.setValue(e.value),t.model;const n=e.monaco.Uri.parse(`opencode://model/${encodeURIComponent(e.cacheKey)}`),r=e.monaco.editor.createModel(e.value,"plaintext",n),o={model:r};return J.set(e.cacheKey,o),Ha(),r}let qe=null;function Ga(e){var o;if(qe)return qe;const t=new Map,n=new Map,r=typeof((o=e==null?void 0:e.languages)==null?void 0:o.getLanguages)=="function"?e.languages.getLanguages():[];if(Array.isArray(r))for(const s of r){const i=typeof(s==null?void 0:s.id)=="string"?s.id:null;if(!i)continue;const a=Array.isArray(s==null?void 0:s.filenames)?s.filenames:[];for(const u of a)typeof u=="string"&&(t.has(u)||t.set(u,i));const c=Array.isArray(s==null?void 0:s.extensions)?s.extensions:[];for(const u of c)typeof u=="string"&&(n.has(u)||n.set(u,i))}return qe={fileNameToId:t,extToId:n},qe}function qa(e){return e===".gitignore"||e===".gitattributes"||e===".gitmodules"||e==="Makefile"||e.startsWith("Makefile.")?"shell":null}function Mr(e,t){const n=String(t||"").trim(),r=n.split("/").pop()||n,o=qa(r);if(o)return o;const s=Ga(e),i=s.fileNameToId.get(r);if(i)return i;const a=r.lastIndexOf(".");if(a>0){const c=r.slice(a),u=s.extToId.get(c);if(u)return u}return"plaintext"}var Ja=In("<div class=monaco-viewer>");function Xa(e){const{isDark:t}=Er();let n,r=null,o=null;const[s,i]=$(!1),a=()=>{try{r==null||r.setModel(null)}catch{}try{r==null||r.dispose()}catch{}r=null};return st(()=>{let c=!1;(async()=>(o=await Pr(),!c&&(!n||!o||(o.editor.setTheme(t()?"vs-dark":"vs"),r=o.editor.createDiffEditor(n,{readOnly:!0,automaticLayout:!0,renderSideBySide:!0,renderSideBySideInlineBreakpoint:0,renderMarginRevertIcon:!1,minimap:{enabled:!1},scrollBeyondLastLine:!1,renderWhitespace:"selection",fontSize:13,wordWrap:e.wordWrap==="on"?"on":"off",glyphMargin:!1,folding:!1,lineNumbersMinChars:4,lineDecorationsWidth:12,diffAlgorithm:"legacy",maxComputationTime:1e4}),i(!0)))))(),be(()=>{c=!0,i(!1),a()})}),ee(()=>{!s()||!o||!r||o.editor.setTheme(t()?"vs-dark":"vs")}),ee(()=>{var d,f,g,p,b,y;if(!s()||!o||!r)return;const c=e.viewMode==="unified"?"unified":"split",u=e.contextMode==="collapsed"?"collapsed":"expanded",l=e.wordWrap==="on"?"on":"off";r.updateOptions({renderSideBySide:c==="split",renderSideBySideInlineBreakpoint:0,hideUnchangedRegions:u==="collapsed"?{enabled:!0}:{enabled:!1},wordWrap:l});try{(g=(f=(d=r.getOriginalEditor)==null?void 0:d.call(r))==null?void 0:f.updateOptions)==null||g.call(f,{wordWrap:l})}catch{}try{(y=(b=(p=r.getModifiedEditor)==null?void 0:p.call(r))==null?void 0:b.updateOptions)==null||y.call(b,{wordWrap:l})}catch{}}),ee(()=>{if(!s()||!o||!r)return;const c=Mr(o,e.path),u=`${e.scopeKey}:diff:${e.path}:before`,l=`${e.scopeKey}:diff:${e.path}:after`,d=Ut({monaco:o,cacheKey:u,value:e.before}),f=Ut({monaco:o,cacheKey:l,value:e.after});r.setModel({original:d,modified:f}),Tr(c).then(()=>{try{o.editor.setModelLanguage(d,c),o.editor.setModelLanguage(f,c)}catch{}})}),(()=>{var c=Ja(),u=n;return typeof u=="function"?jt(u,c):n=c,c})()}const Ac=Object.freeze(Object.defineProperty({__proto__:null,MonacoDiffViewer:Xa},Symbol.toStringTag,{value:"Module"}));var Ya=In("<div class=monaco-viewer>");function Za(e){const{isDark:t}=Er();let n,r=null,o=null;const[s,i]=$(!1),a=()=>{try{r==null||r.setModel(null)}catch{}try{r==null||r.dispose()}catch{}r=null},c=()=>{!r||!e.onSave||e.onSave(r.getValue())};return st(()=>{let u=!1;(async()=>(o=await Pr(),!u&&(!n||!o||(o.editor.setTheme(t()?"vs-dark":"vs"),r=o.editor.create(n,{value:"",language:"plaintext",readOnly:!1,automaticLayout:!0,lineNumbers:"on",minimap:{enabled:!1},scrollBeyondLastLine:!1,wordWrap:"off",renderWhitespace:"selection",fontSize:13}),r.addCommand(o.KeyMod.CtrlCmd|o.KeyCode.KeyS,c),r.onDidChangeModelContent(()=>{e.onContentChange&&e.onContentChange(r.getValue())}),i(!0)))))(),be(()=>{u=!0,i(!1),a()})}),ee(()=>{!s()||!o||!r||o.editor.setTheme(t()?"vs-dark":"vs")}),ee(()=>{if(!s()||!o||!r)return;const u=Mr(o,e.path),l=`${e.scopeKey}:file:${e.path}`,d=Ut({monaco:o,cacheKey:l,value:e.content});r.setModel(d),Tr(u).then(()=>{try{o.editor.setModelLanguage(d,u)}catch{}})}),(()=>{var u=Ya(),l=n;return typeof l=="function"?jt(l,u):n=u,u})()}const Ec=Object.freeze(Object.defineProperty({__proto__:null,MonacoFileViewer:Za},Symbol.toStringTag,{value:"Module"}));export{gr as $,ta as A,oa as B,Cc as C,ic as D,P as E,dt as F,wc as G,uc as H,$r as I,Ks as J,fc as K,yc as L,qs as M,ir as N,dc as O,sc as P,gc as Q,Cs as R,pc as S,hc as T,bc as U,yo as V,mc as W,Oo as X,So as Y,Er as Z,pr as _,to as a,Sc as a0,ra as a1,sa as a2,_i as a3,xc as a4,vc as a5,B as a6,rc as a7,Oc as a8,$c as a9,kc as aa,Ac as ab,Ec as ac,Tn as b,ac as c,vt as d,Hn as e,Zr as f,oc as g,_ as h,kt as i,no as j,ie as k,Sa as l,Xr as m,ro as n,Ot as o,lc as p,wa as q,z as r,oo as s,In as t,jt as u,cc as v,Ei as w,Sn as x,ae as y,ba as z};
@@ -1 +1 @@
1
- import{t as u,i as d,d as $,a as S}from"./monaco-viewer-DUhWC7BI.js";import{n as f,S as A,a as b,F as w}from"./git-diff-vendor-CAv-4upN.js";import{r as F}from"./main-CH4aDUD4.js";import{t as i,u as z}from"./index-CfoVNw2d.js";var P=u("<div class=tool-call-todo-empty>"),R=u("<div class=tool-call-todo-region><div class=tool-call-todos role=list>"),k=u("<span>"),B=u("<div class=tool-call-todo-item role=listitem><span class=tool-call-todo-checkbox></span><div class=tool-call-todo-body><div class=tool-call-todo-heading><span class=tool-call-todo-text>");function E(t){return t==="completed"||t==="in_progress"||t==="cancelled"?t:"pending"}function y(t){if(!t)return[];const{metadata:e}=F(t),o=Array.isArray(e.todos)?e.todos:[],m=[];for(let n=0;n<o.length;n++){const r=o[n],s=typeof(r==null?void 0:r.content)=="string"?r.content.trim():"";if(!s)continue;const c=E(r.status),a=typeof(r==null?void 0:r.id)=="string"&&r.id.length>0?r.id:`${n}-${s}`;m.push({id:a,content:s,status:c})}return m}function T(t){return t.reduce((e,o)=>(e.total+=1,e[o.status]=(e[o.status]||0)+1,e),{total:0,pending:0,in_progress:0,completed:0,cancelled:0})}function G(t,e){switch(e){case"completed":return t("toolCall.renderer.todo.status.completed");case"in_progress":return t("toolCall.renderer.todo.status.inProgress");case"cancelled":return t("toolCall.renderer.todo.status.cancelled");default:return t("toolCall.renderer.todo.status.pending")}}function I(t){const{t:e}=z(),o=y(t.state);return T(o).total===0?(()=>{var n=P();return d(n,()=>t.emptyLabel??e("toolCall.renderer.todo.empty")),n})():(()=>{var n=R(),r=n.firstChild;return d(r,f(w,{each:o,children:s=>{const c=G(e,s.status);return(()=>{var a=B(),g=a.firstChild,L=g.nextSibling,p=L.firstChild,x=p.firstChild;return $(g,"aria-label",c),d(x,()=>s.content),d(p,f(A,{get when(){return t.showStatusLabel!==!1},get children(){var l=k();return d(l,c),b(()=>S(l,`tool-call-todo-status tool-call-todo-status-${s.status}`)),l}}),null),b(l=>{var v=s.status==="completed",h=s.status==="cancelled",C=s.status==="in_progress",_=s.status;return v!==l.e&&a.classList.toggle("tool-call-todo-item-completed",l.e=v),h!==l.t&&a.classList.toggle("tool-call-todo-item-cancelled",l.t=h),C!==l.a&&a.classList.toggle("tool-call-todo-item-active",l.a=C),_!==l.o&&$(g,"data-status",l.o=_),l},{e:void 0,t:void 0,a:void 0,o:void 0}),a})()}})),n})()}function N(t){if(!t)return i("toolCall.renderer.todo.title.plan");const e=y(t);if(t.status!=="completed"||e.length===0)return i("toolCall.renderer.todo.title.plan");const o=T(e);return o.pending===o.total?i("toolCall.renderer.todo.title.creating"):o.completed===o.total?i("toolCall.renderer.todo.title.completing"):i("toolCall.renderer.todo.title.updating")}const H={tools:["todowrite","todoread"],getAction:()=>i("toolCall.renderer.action.planning"),getTitle({toolState:t}){return N(t())},renderBody({toolState:t}){const e=t();return e?f(I,{state:e}):null}};export{I as T,H as t};
1
+ import{t as u,i as d,d as $,a as S}from"./monaco-viewer-BCffFoQZ.js";import{n as f,S as A,a as b,F as w}from"./git-diff-vendor-CAv-4upN.js";import{r as F}from"./main-BpgxtqbO.js";import{t as i,u as z}from"./index-CJQRbTtv.js";var P=u("<div class=tool-call-todo-empty>"),R=u("<div class=tool-call-todo-region><div class=tool-call-todos role=list>"),k=u("<span>"),B=u("<div class=tool-call-todo-item role=listitem><span class=tool-call-todo-checkbox></span><div class=tool-call-todo-body><div class=tool-call-todo-heading><span class=tool-call-todo-text>");function E(t){return t==="completed"||t==="in_progress"||t==="cancelled"?t:"pending"}function y(t){if(!t)return[];const{metadata:e}=F(t),o=Array.isArray(e.todos)?e.todos:[],m=[];for(let n=0;n<o.length;n++){const r=o[n],s=typeof(r==null?void 0:r.content)=="string"?r.content.trim():"";if(!s)continue;const c=E(r.status),a=typeof(r==null?void 0:r.id)=="string"&&r.id.length>0?r.id:`${n}-${s}`;m.push({id:a,content:s,status:c})}return m}function T(t){return t.reduce((e,o)=>(e.total+=1,e[o.status]=(e[o.status]||0)+1,e),{total:0,pending:0,in_progress:0,completed:0,cancelled:0})}function G(t,e){switch(e){case"completed":return t("toolCall.renderer.todo.status.completed");case"in_progress":return t("toolCall.renderer.todo.status.inProgress");case"cancelled":return t("toolCall.renderer.todo.status.cancelled");default:return t("toolCall.renderer.todo.status.pending")}}function I(t){const{t:e}=z(),o=y(t.state);return T(o).total===0?(()=>{var n=P();return d(n,()=>t.emptyLabel??e("toolCall.renderer.todo.empty")),n})():(()=>{var n=R(),r=n.firstChild;return d(r,f(w,{each:o,children:s=>{const c=G(e,s.status);return(()=>{var a=B(),g=a.firstChild,L=g.nextSibling,p=L.firstChild,x=p.firstChild;return $(g,"aria-label",c),d(x,()=>s.content),d(p,f(A,{get when(){return t.showStatusLabel!==!1},get children(){var l=k();return d(l,c),b(()=>S(l,`tool-call-todo-status tool-call-todo-status-${s.status}`)),l}}),null),b(l=>{var v=s.status==="completed",h=s.status==="cancelled",C=s.status==="in_progress",_=s.status;return v!==l.e&&a.classList.toggle("tool-call-todo-item-completed",l.e=v),h!==l.t&&a.classList.toggle("tool-call-todo-item-cancelled",l.t=h),C!==l.a&&a.classList.toggle("tool-call-todo-item-active",l.a=C),_!==l.o&&$(g,"data-status",l.o=_),l},{e:void 0,t:void 0,a:void 0,o:void 0}),a})()}})),n})()}function N(t){if(!t)return i("toolCall.renderer.todo.title.plan");const e=y(t);if(t.status!=="completed"||e.length===0)return i("toolCall.renderer.todo.title.plan");const o=T(e);return o.pending===o.total?i("toolCall.renderer.todo.title.creating"):o.completed===o.total?i("toolCall.renderer.todo.title.completing"):i("toolCall.renderer.todo.title.updating")}const H={tools:["todowrite","todoread"],getAction:()=>i("toolCall.renderer.action.planning"),getTitle({toolState:t}){return N(t())},renderBody({toolState:t}){const e=t();return e?f(I,{state:e}):null}};export{I as T,H as t};