auto-coder-web 0.1.65__py3-none-any.whl → 0.1.67__py3-none-any.whl
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.
- auto_coder_web/routers/auto_router.py +3 -7
- auto_coder_web/version.py +1 -1
- auto_coder_web/web/assets/{main-C1svZAzf.css → main-d8KE7Gnq.css} +1 -1
- auto_coder_web/web/assets/main.js +3 -3
- auto_coder_web/web/index.html +1 -1
- {auto_coder_web-0.1.65.dist-info → auto_coder_web-0.1.67.dist-info}/METADATA +4 -3
- {auto_coder_web-0.1.65.dist-info → auto_coder_web-0.1.67.dist-info}/RECORD +10 -10
- {auto_coder_web-0.1.65.dist-info → auto_coder_web-0.1.67.dist-info}/WHEEL +0 -0
- {auto_coder_web-0.1.65.dist-info → auto_coder_web-0.1.67.dist-info}/entry_points.txt +0 -0
- {auto_coder_web-0.1.65.dist-info → auto_coder_web-0.1.67.dist-info}/top_level.txt +0 -0
@@ -511,10 +511,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
511
511
|
`),o=5,a=n.language||"javascript",l=()=>{e&&hr.publish(vr.UI.SHOW_MODAL,{content:n.content,format:"markdown",language:a,title:ie("generatingCode")})};return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title",children:[e&&s.length>o&&x.jsx("button",{onClick:()=>i(!t),className:"message-toggle-button",children:t?x.jsx("svg",{className:"message-toggle-icon text-blue-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):x.jsx("svg",{className:"message-toggle-icon text-blue-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),x.jsx("span",{className:"message-title-icon",children:n.isStreaming?x.jsxs("svg",{className:"animate-spin w-3.5 h-3.5 text-blue-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[x.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),x.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):x.jsx("svg",{className:"w-3.5 h-3.5 text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})})}),x.jsx("span",{className:"text-blue-400 message-title-text text-xs",children:n.isStreaming?ie("generatingCode"):ie("generatedCode")}),e&&x.jsxs(x.Fragment,{children:[x.jsx("button",{onClick:()=>{navigator.clipboard.writeText(r)},className:"ml-auto message-copy-button text-gray-400 hover:text-blue-400",title:ie("copy")||"Copy",children:x.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"})})}),x.jsx("button",{onClick:l,className:"ml-1 message-maximize-button text-gray-400 hover:text-blue-400",title:ie("maximize")||"Maximize",children:x.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5v-4m0 4h-4m4 0l-5-5"})})})]})]}),!t&&x.jsx("div",{className:"message-content-container border border-gray-800",children:x.jsx(Nl,{language:a,style:rc,customStyle:{margin:0,padding:"0.25rem",backgroundColor:"transparent",fontSize:"0.75rem"},wrapLines:!0,wrapLongLines:!0,children:r})})]})},c2t=({message:n})=>{var s;const[e,t]=_.useState(!1),i=n.language||"javascript",r=()=>{var o;hr.publish(vr.UI.SHOW_MODAL,{content:n.content,format:"markdown",language:i,title:((o=n.metadata)==null?void 0:o.fileName)||ie("generatedCode")})};return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title",children:[x.jsx("button",{onClick:()=>t(!e),className:"message-toggle-button",children:e?x.jsx("svg",{className:"message-toggle-icon text-blue-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):x.jsx("svg",{className:"message-toggle-icon text-blue-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),x.jsx("span",{className:"message-title-icon",children:x.jsx("svg",{className:"w-3.5 h-3.5 text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})})}),x.jsx("span",{className:"text-blue-400 message-title-text text-xs",children:ie("generatedCode")||"Generated Code"}),x.jsx("button",{onClick:()=>{navigator.clipboard.writeText(n.content)},className:"ml-auto message-copy-button text-gray-400 hover:text-blue-400",title:ie("copy")||"Copy",children:x.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"})})}),x.jsx("button",{onClick:r,className:"ml-1 message-maximize-button text-gray-400 hover:text-blue-400",title:ie("maximize")||"Maximize",children:x.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5v-4m0 4h-4m4 0l-5-5"})})})]}),!e&&x.jsxs("div",{className:"message-content-container border border-gray-800",children:[((s=n.metadata)==null?void 0:s.fileName)&&x.jsxs("div",{className:"px-2 py-0.5 bg-gray-800/50 border-b border-gray-800 flex items-center",children:[x.jsx("svg",{className:"w-3 h-3 mr-1 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),x.jsx("span",{className:"text-gray-300 font-mono text-xs",children:n.metadata.fileName})]}),x.jsx("div",{className:"p-0 bg-gray-800/20",children:x.jsx(Nl,{language:i,style:rc,customStyle:{margin:0,padding:"0.25rem",backgroundColor:"transparent",fontSize:"0.75rem"},wrapLines:!0,wrapLongLines:!0,children:n.content})})]})]})},d2t=({message:n})=>{var i;const e=n.type==="STREAM"&&((i=n.metadata)==null?void 0:i.stream_out_type)==="code_rank",t=e&&!n.isStreaming;return e?x.jsx(u2t,{message:n,isCompleted:t}):x.jsx(h2t,{message:n})},u2t=({message:n,isCompleted:e})=>{const[t,i]=_.useState(e),r=n.content||"";r.split(`
|
512
512
|
`);const s=n.language||"javascript";return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title",children:[x.jsx("button",{onClick:()=>i(!t),className:"message-toggle-button",children:t?x.jsx("svg",{className:"message-toggle-icon text-purple-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):x.jsx("svg",{className:"message-toggle-icon text-purple-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),x.jsx("span",{className:"message-title-icon",children:x.jsx("svg",{className:"w-4 h-4 text-purple-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})})}),x.jsx("span",{className:"text-purple-400 message-title-text",children:n.isStreaming?ie("rankingCode"):ie("rankedCode")}),n.isStreaming&&x.jsx("span",{className:"ml-2",children:x.jsxs("svg",{className:"animate-spin h-4 w-4 text-yellow-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[x.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),x.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})})]}),!t&&x.jsx("div",{className:"message-content-container",children:x.jsx(Nl,{language:s,style:rc,customStyle:{margin:0,padding:"1rem",backgroundColor:"transparent"},wrapLines:!0,wrapLongLines:!0,children:r})})]})},h2t=({message:n})=>{var r;const e=n.language||"javascript",[t,i]=_.useState(!0);return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title",children:[x.jsx("button",{onClick:()=>i(!t),className:"message-toggle-button",children:t?x.jsx("svg",{className:"message-toggle-icon text-purple-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):x.jsx("svg",{className:"message-toggle-icon text-purple-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),x.jsx("span",{className:"message-title-icon",children:x.jsx("svg",{className:"w-4 h-4 text-purple-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})})}),x.jsx("span",{className:"text-purple-400 message-title-text",children:ie("rankedCode")||"Ranked Code"})]}),!t&&x.jsxs("div",{className:"message-content-container",children:[((r=n.metadata)==null?void 0:r.rankTitle)&&x.jsxs("div",{className:"px-4 py-2 bg-gray-800/50 border-b border-gray-700 flex items-center",children:[x.jsx("svg",{className:"w-4 h-4 mr-2 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})}),x.jsx("span",{className:"text-gray-300 font-mono",children:n.metadata.rankTitle})]}),x.jsx("div",{className:"p-0 bg-gray-800/20",children:x.jsx(Nl,{language:e,style:rc,customStyle:{margin:0,padding:"1rem",backgroundColor:"transparent"},wrapLines:!0,wrapLongLines:!0,children:n.content})})]})]})},f2t=({message:n})=>{var i;const e=n.type==="STREAM"&&((i=n.metadata)==null?void 0:i.stream_out_type)==="lint",t=e&&!n.isStreaming;return e?x.jsx(g2t,{message:n,isCompleted:t}):x.jsx(p2t,{message:n})},g2t=({message:n,isCompleted:e})=>{const[t,i]=_.useState(e),r=n.content||"",s=r.split(`
|
513
513
|
`);return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title",children:[e&&s.length>5&&x.jsx("button",{onClick:()=>i(!t),className:"message-toggle-button",children:t?x.jsx("svg",{className:"message-toggle-icon text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):x.jsx("svg",{className:"message-toggle-icon text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),x.jsx("span",{className:"message-title-icon",children:n.isStreaming?x.jsxs("svg",{className:"animate-spin w-3.5 h-3.5 text-yellow-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[x.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),x.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):x.jsx("svg",{className:"w-3.5 h-3.5 text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),x.jsx("span",{className:"text-yellow-400 message-title-text text-xs",children:n.isStreaming?ie("analyzingCode")||"Analyzing Code":ie("lintResults")||"Lint Results"})]}),!t&&x.jsx("div",{className:"message-content-container border border-gray-800",children:x.jsx("div",{className:"p-2 whitespace-pre-wrap text-xs text-white",children:r})})]})},p2t=({message:n})=>{var i;const[e,t]=_.useState(!1);return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title",children:[x.jsx("button",{onClick:()=>t(!e),className:"message-toggle-button",children:e?x.jsx("svg",{className:"message-toggle-icon text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):x.jsx("svg",{className:"message-toggle-icon text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),x.jsx("span",{className:"message-title-icon",children:x.jsx("svg",{className:"w-3.5 h-3.5 text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),x.jsx("span",{className:"text-yellow-400 message-title-text text-xs",children:ie("lintResults")||"Lint Results"})]}),!e&&x.jsxs("div",{className:"message-content-container border border-gray-800",children:[((i=n.metadata)==null?void 0:i.fileName)&&x.jsxs("div",{className:"px-2 py-0.5 bg-gray-800/50 border-b border-gray-800 flex items-center",children:[x.jsx("svg",{className:"w-3 h-3 mr-1 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),x.jsx("span",{className:"text-gray-300 font-mono text-xs",children:n.metadata.fileName})]}),x.jsx("div",{className:"p-2 whitespace-pre-wrap text-xs text-white",children:n.content})]})]})};function R3e(n,e=2){let t;if(typeof n=="string"){if(t=parseFloat(n),isNaN(t))return""}else t=n;if(typeof t!="number"||isNaN(t))return"";const i=e<0?0:e;return t.toFixed(i)}const m2t=(n,e,t=5)=>{if(n===void 0||e===void 0)return"$0.00000";const i=n+e;return`$${R3e(i,t)}`},v2t=({message:n})=>{const e=_.useRef(null),[t,i]=_.useState(!0),r=()=>{e.current&&i(e.current.offsetWidth>500)};return _.useEffect(()=>{r();const s=new ResizeObserver(()=>{r()});return e.current&&s.observe(e.current),()=>{e.current&&s.unobserve(e.current)}},[]),x.jsx("div",{ref:e,className:"font-mono text-[11px] text-gray-400 flex flex-row items-center gap-2 flex-wrap",children:n.metadata&&x.jsxs(x.Fragment,{children:[n.metadata.file_number!==void 0&&n.metadata.total_files!==void 0&&x.jsx("div",{className:"flex items-center",children:x.jsxs("span",{children:[ie("indexingFiles",{file_number:n.metadata.file_number,file_increment:Number(R3e(n.metadata.file_number/n.metadata.total_files*100))}),"% "]})}),n.metadata.updated_files!==void 0&&x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"flex items-center",children:x.jsx("span",{className:"text-green-500 ml-1",children:n.metadata.updated_files})}),x.jsxs("div",{className:"flex items-center",children:[x.jsxs("span",{children:[ie("removedFiles"),": "]}),x.jsx("span",{className:"text-red-500 ml-1",children:n.metadata.removed_files})]})]}),n.metadata.input_tokens!==void 0&&x.jsxs("div",{className:"flex items-center",children:[x.jsxs("span",{children:[ie("tokens"),": "]}),x.jsxs("span",{className:"text-green-500 ml-1",children:["↑ ",n.metadata.input_tokens]}),x.jsxs("span",{className:"text-red-500 ml-1",children:["↓ ",n.metadata.output_tokens]})]}),n.metadata.input_cost!==void 0&&x.jsxs("div",{className:"flex items-center",children:[x.jsxs("span",{children:[ie("apiCost"),": "]}),x.jsx("span",{className:"text-white ml-1",children:m2t(n.metadata.input_cost,n.metadata.output_cost,5)})]})]})})},b2t=({message:n})=>{const e=()=>{hr.publish(vr.CHAT.REFRESH_FROM_MESSAGE,{messageId:n.id,messageContent:n.content})};return x.jsxs("div",{className:"message-font group relative",children:[" ",x.jsx("button",{onClick:e,className:"absolute top-1 right-1 p-1 rounded text-gray-400 hover:text-gray-200 transition-opacity",title:ie("refreshFromHere")||"Refresh from here",children:x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m-15.357-2a8.001 8.001 0 0015.357 2M15 15H9"})})}),x.jsxs("div",{className:"message-title",children:[x.jsx("span",{className:"message-title-icon",children:x.jsx("svg",{className:"w-4 h-4 text-indigo-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})})}),x.jsx("span",{className:"text-indigo-400 message-title-text",children:ie("user")||"User"})]}),x.jsxs("div",{className:"prose prose-invert prose-xs max-w-none pt-1",children:[" ",x.jsx(hp,{className:"text-gray-200 break-words",components:{code:({className:t,children:i,...r})=>{const s=/language-(\w+)/.exec(t||"");return!s?x.jsx("code",{className:t,...r,children:i}):x.jsx(Nl,{language:s?s[1]:"",style:rc,PreTag:"div",wrapLines:!0,wrapLongLines:!0,children:String(i).replace(/\n$/,"")})}},children:n.content})]})]})},_2t=({message:n})=>{const[e,t]=_.useState(!0),i=_.useMemo(()=>{try{return JSON.parse(n.content).content||""}catch{return n.content}},[n.content]),r=n.language||"javascript",s=()=>{hr.publish(vr.UI.SHOW_MODAL,{content:i,format:"markdown",language:r,title:ie("unmergedBlocks")})};return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title",children:[x.jsx("button",{onClick:()=>t(!e),className:"message-toggle-button",children:e?x.jsx("svg",{className:"message-toggle-icon text-blue-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):x.jsx("svg",{className:"message-toggle-icon text-blue-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),x.jsx("span",{className:"message-title-icon",children:x.jsx("svg",{className:"w-3.5 h-3.5 text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 7v8a2 2 0 002 2h6M8 7V5a2 2 0 012-2h4.586a1 1 0 01.707.293l4.414 4.414a1 1 0 01.293.707V15a2 2 0 01-2 2h-2M8 7H6a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2v-2"})})}),x.jsx("span",{className:"text-blue-400 message-title-text text-xs",children:ie("unmergedBlocks")||"Unmerged Blocks"}),x.jsx("button",{onClick:()=>{navigator.clipboard.writeText(i)},className:"ml-auto message-copy-button text-gray-400 hover:text-blue-400",title:ie("copy")||"Copy",children:x.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"})})}),x.jsx("button",{onClick:s,className:"ml-1 message-maximize-button text-gray-400 hover:text-blue-400",title:ie("maximize")||"Maximize",children:x.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5v-4m0 4h-4m4 0l-5-5"})})})]}),!e&&x.jsx("div",{className:"message-content-container border border-gray-800",children:x.jsx("div",{className:"p-0 bg-gray-800/20",children:x.jsxs(Nl,{language:r,style:rc,customStyle:{margin:0,padding:"0.25rem",backgroundColor:"transparent",fontSize:"0.75rem"},wrapLines:!0,wrapLongLines:!0,children:[i," "]})})})]})},y2t=({message:n})=>{var i;const e=n.type==="STREAM"&&((i=n.metadata)==null?void 0:i.stream_out_type)==="compile",t=e&&!n.isStreaming;return e?x.jsx(C2t,{message:n,isCompleted:t}):x.jsx(S2t,{message:n})},C2t=({message:n,isCompleted:e})=>{const[t,i]=_.useState(e),r=n.content||"",s=r.split(`
|
514
|
-
`);return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title",children:[e&&s.length>5&&x.jsx("button",{onClick:()=>i(!t),className:"message-toggle-button",children:t?x.jsx("svg",{className:"message-toggle-icon text-orange-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):x.jsx("svg",{className:"message-toggle-icon text-orange-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),x.jsx("span",{className:"message-title-icon",children:n.isStreaming?x.jsxs("svg",{className:"animate-spin w-3.5 h-3.5 text-orange-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[x.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),x.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):x.jsx("svg",{className:"w-3.5 h-3.5 text-orange-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),x.jsx("span",{className:"text-orange-400 message-title-text text-xs",children:n.isStreaming?ie("analyzingCompile")||"Analyzing Compile...":ie("compileResults")||"Compile Results"})]}),!t&&x.jsx("div",{className:"message-content-container border border-gray-800",children:x.jsx("div",{className:"p-2 whitespace-pre-wrap text-xs",children:r})})]})},S2t=({message:n})=>{const[e,t]=_.useState(!1),i=_.useMemo(()=>{try{return JSON.parse(n.content).content||n.content}catch{return n.content}},[n.content]),r="bash",s=()=>{hr.publish(vr.UI.SHOW_MODAL,{content:i,format:"plaintext",language:r,title:ie("compileResults")})};return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title",children:[x.jsx("button",{onClick:()=>t(!e),className:"message-toggle-button",children:e?x.jsx("svg",{className:"message-toggle-icon text-orange-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):x.jsx("svg",{className:"message-toggle-icon text-orange-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),x.jsx("span",{className:"message-title-icon",children:x.jsx("svg",{className:"w-3.5 h-3.5 text-orange-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),x.jsx("span",{className:"text-orange-400 message-title-text text-xs",children:ie("compileResults")||"Compile Results"}),x.jsx("button",{onClick:()=>navigator.clipboard.writeText(i),className:"ml-auto message-copy-button text-gray-400 hover:text-orange-400",title:ie("copy")||"Copy",children:x.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"})})}),x.jsx("button",{onClick:s,className:"ml-1 message-maximize-button text-gray-400 hover:text-orange-400",title:ie("maximize")||"Maximize",children:x.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5v-4m0 4h-4m4 0l-5-5"})})})]}),!e&&x.jsx("div",{className:"message-content-container border border-gray-800",children:x.jsx("div",{className:"p-0 bg-gray-800/20",children:x.jsx(Nl,{language:r,style:rc,customStyle:{margin:0,padding:"0.25rem",backgroundColor:"transparent",fontSize:"0.75rem"},wrapLines:!0,wrapLongLines:!0,children:i})})})]})},Txe=({message:n})=>{const[e,t]=_.useState(!0),i=JSON.parse(n.content);i.tool_name;const r=i.path,s=i.diff,o=a=>{const l=[],c=/<<<<<<< SEARCH\n([\s\S]*?)=======\n([\s\S]*?)>>>>>>> REPLACE/gm;let d;for(;(d=c.exec(a))!==null;)l.push({search:d[1].trimEnd(),replace:d[2].trimEnd()});return l.map((u,h)=>x.jsx("div",{className:"mb-1.5 border border-gray-700 rounded overflow-hidden text-xs font-mono shadow-sm",children:x.jsxs("div",{className:"flex",children:[x.jsxs("div",{className:"w-1/2 border-r border-gray-700",children:[x.jsx("div",{className:"bg-gray-800 px-1.5 py-0.5 text-xs font-medium text-gray-300 border-b border-gray-700",children:"SEARCH"}),x.jsx("div",{className:"bg-gray-900 h-56 overflow-auto",children:x.jsx("pre",{className:"px-1.5 py-1 whitespace-pre text-red-300 min-w-full text-xs",children:u.search})})]}),x.jsxs("div",{className:"w-1/2",children:[x.jsx("div",{className:"bg-gray-800 px-1.5 py-0.5 text-xs font-medium text-gray-300 border-b border-gray-700",children:"REPLACE"}),x.jsx("div",{className:"bg-gray-900 h-56 overflow-auto",children:x.jsx("pre",{className:"px-1.5 py-1 whitespace-pre text-green-300 min-w-full text-xs",children:u.replace})})]})]})},h))};return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title flex items-center",children:[x.jsx("button",{onClick:()=>t(!e),className:"message-toggle-button text-gray-400",children:e?x.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):x.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),x.jsx("span",{className:"message-title-icon",children:x.jsxs("svg",{className:"w-4 h-4 text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 20h9"}),x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 4h9"}),x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 12h16"})]})}),x.jsx("span",{className:"message-title-text ml-1 text-yellow-400 font-semibold",children:ie("agenticEditReplaceInFileToolTitle")})]}),!e&&x.jsxs("div",{className:"mt-2 text-white",children:[r,o(s)]})]})},w2t=({message:n})=>{const[e,t]=_.useState(!0);let i="",r=!1,s="",o="";try{const a=JSON.parse(n.content||"{}");i=a.tool_name||"",r=a.success??!1,s=a.message||"",o=a.content||"",i==="ReplaceInFileTool"&&(i=ie("agenticEditToolResultReplaceInFileTool")),i==="WriteToFileTool"&&(i=ie("agenticEditToolResultWriteToFileTool")),i==="ReadFileTool"&&(i=ie("agenticEditToolResultReadFileTool")),i==="ListFilesTool"&&(i=ie("agenticEditToolResultListFilesTool")),i==="SearchFilesTool"&&(i=ie("agenticEditToolResultSearchFilesTool"))}catch(a){console.error("Failed to parse tool result content:",a),s=n.content}return x.jsxs("div",{className:"message-font border border-gray-600 rounded-lg overflow-hidden bg-gray-800/50 mb-4",children:[x.jsx("div",{className:"flex items-center justify-between px-3 py-2 cursor-pointer hover:bg-gray-700/50",onClick:()=>t(!e),children:x.jsxs("div",{className:"flex items-center space-x-2",children:[x.jsx("svg",{className:`w-4 h-4 transition-transform duration-200 ${e?"":"rotate-90"} text-yellow-400`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 5l7 7-7 7"})}),x.jsx("span",{className:"font-semibold text-yellow-400",children:i}),x.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${r?"bg-green-600/30 text-green-400":"bg-red-600/30 text-red-400"}`,children:r?"Success":"Failed"})]})}),x.jsx("div",{className:"mt-1 text-xs text-gray-300 overflow-hidden px-3",children:x.jsx("span",{title:s,className:"hover:underline cursor-help break-words",children:s})}),!e&&o&&x.jsx("div",{className:"p-3 bg-gray-900 overflow-auto text-xs font-mono whitespace-pre-wrap text-gray-200 border-t border-gray-700 max-h-[400px] scrollbar-thin scrollbar-thumb-gray-600",children:o})]})},x2t=({message:n})=>{const[e,t]=_.useState(!0);let i="",r="",s="";try{const o=JSON.parse(n.content||"{}");i=o.path||"N/A";const a=o.content||"";r=a.substring(0,150),s=a.length>150?"...":""}catch(o){console.error("Failed to parse WriteToFileTool content:",o),i="Error parsing content",r=""}return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title flex items-center cursor-pointer",onClick:()=>t(!e),children:[x.jsx("button",{className:"message-toggle-button text-gray-400 mr-1",children:e?x.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):x.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),x.jsx("span",{className:"message-title-icon mr-1",children:x.jsx("svg",{className:"w-4 h-4 text-purple-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),x.jsx("span",{className:"message-title-text text-purple-400 font-semibold",children:ie("agenticEditWriteToFileToolTitle")})]}),x.jsx("div",{className:"mt-1 text-cyan-300 bg-gray-800 px-2 py-1 rounded text-sm font-mono break-all",children:i}),!e&&x.jsxs("div",{className:"mt-2",children:[x.jsx("div",{className:"text-gray-400 text-xs mb-1",children:"Content Snippet:"}),x.jsxs("pre",{className:"bg-gray-900 p-2 rounded text-xs font-mono whitespace-pre-wrap overflow-x-auto text-gray-300 max-h-40",children:[r,s]})]})]})},E2t=({message:n})=>{const[e,t]=_.useState(!1);let i="",r=[];try{const s=JSON.parse(n.content||"{}");i=s.question||"N/A";const o=s.options;if(typeof o=="string")try{r=JSON.parse(o),Array.isArray(r)||(r=[])}catch{r=[]}else Array.isArray(o)?r=o:r=[]}catch(s){console.error("Failed to parse AskFollowupQuestionTool content:",s),i="Error parsing content"}return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title flex items-center cursor-pointer",onClick:()=>t(!e),children:[x.jsx("button",{className:"message-toggle-button text-gray-400 mr-1",children:e?x.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):x.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),x.jsx("span",{className:"message-title-icon mr-1",children:x.jsx("svg",{className:"w-4 h-4 text-orange-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.79 4 4s-1.79 4-4 4c-1.742 0-3.223-.835-3.772-2M12 5v.01M12 19v.01M3.34 16.66l.01-.01M20.66 7.34l-.01.01M16.66 20.66l-.01-.01M7.34 3.34l.01.01M12 22a10 10 0 110-20 10 10 0 010 20z"})})}),x.jsx("span",{className:"message-title-text text-orange-400 font-semibold",children:"AutoCoder is asking a question:"})]}),!e&&x.jsxs("div",{className:"mt-2 space-y-2",children:[x.jsx("div",{className:"text-gray-200",children:i}),r.length>0&&x.jsxs("div",{children:[x.jsx("div",{className:"text-gray-400 text-xs mb-1",children:"Options:"}),x.jsx("ul",{className:"list-disc list-inside text-sm text-gray-300 space-y-1",children:r.map((s,o)=>x.jsx("li",{children:s},o))})]})]})]})},k2t=({message:n})=>{const[e,t]=_.useState(!0);let i="",r=!1;try{const s=JSON.parse(n.content||"{}");i=s.command||"N/A",r=s.requires_approval||!1,i.length<80&&t(!1)}catch(s){console.error("Failed to parse ExecuteCommandTool content:",s),i="Error parsing content"}return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title flex items-center cursor-pointer",onClick:()=>t(!e),children:[x.jsx("button",{className:"message-toggle-button text-gray-400 mr-1",children:e?x.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):x.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),x.jsx("span",{className:"message-title-icon mr-1",children:x.jsx("svg",{className:"w-4 h-4 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 9l4-4 4 4m0 6l-4 4-4-4"})})}),x.jsx("span",{className:"message-title-text text-green-400 font-semibold",children:"AutoCoder wants to execute this command:"})]}),!e&&x.jsx("div",{className:"mt-1 text-yellow-300 bg-gray-800 px-2 py-1 rounded text-sm font-mono break-all",children:i}),x.jsxs("div",{className:`mt-1 text-xs ${r?"text-red-400":"text-gray-400"}`,children:["(Requires Approval: ",r?"Yes":"No",")"]})]})},L2t=({message:n})=>{let e="";try{e=JSON.parse(n.content||"{}").path||"N/A"}catch(t){console.error("Failed to parse ListCodeDefinitionNamesTool content:",t),e="Error parsing content"}return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title flex items-center",children:[x.jsx("span",{className:"message-title-icon mr-1",children:x.jsx("svg",{className:"w-4 h-4 text-teal-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})})}),x.jsx("span",{className:"message-title-text text-teal-400 font-semibold",children:"AutoCoder wants to list definitions in:"})]}),x.jsx("div",{className:"mt-1 text-cyan-300 bg-gray-800 px-2 py-1 rounded text-sm font-mono break-all",children:e})]})},I2t=({message:n})=>{let e="",t=!1;try{const i=JSON.parse(n.content||"{}");e=i.path||"N/A",t=i.recursive||!1}catch(i){console.error("Failed to parse ListFilesTool content:",i),e="Error parsing content"}return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title flex items-center",children:[x.jsx("span",{className:"message-title-icon mr-1",children:x.jsx("svg",{className:"w-4 h-4 text-indigo-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})})}),x.jsx("span",{className:"message-title-text text-indigo-400 font-semibold",children:ie("agenticEditListFilesToolTitle")})]}),x.jsx("div",{className:"mt-1 text-cyan-300 bg-gray-800 px-2 py-1 rounded text-sm font-mono break-all",children:e}),x.jsxs("div",{className:"mt-1 text-xs text-gray-400",children:["(",t?"Recursively":"Top Level Only",")"]})]})},N2t=({message:n})=>{let e="";try{e=JSON.parse(n.content||"{}").path||"N/A"}catch(t){console.error("Failed to parse ReadFileTool content:",t),e="Error parsing content"}return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title flex items-center",children:[x.jsx("span",{className:"message-title-icon mr-1",children:x.jsxs("svg",{className:"w-4 h-4 text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})}),x.jsx("span",{className:"message-title-text text-blue-400 font-semibold",children:ie("agenticEditReadFileToolTitle")})]}),x.jsx("div",{className:"mt-1 text-cyan-300 bg-gray-800 px-2 py-1 rounded text-sm font-mono break-words max-h-[120px] overflow-auto scrollbar-thin scrollbar-thumb-gray-600",children:x.jsx("span",{title:e,className:"hover:underline cursor-help",children:e})})]})},T2t=({message:n})=>{const[e,t]=_.useState(!0);let i="",r="",s="";try{const o=JSON.parse(n.content||"{}");i=o.path||"N/A",r=o.regex||"N/A",s=o.file_pattern||"*"}catch(o){console.error("Failed to parse SearchFilesTool content:",o),i="Error parsing content"}return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title flex items-center cursor-pointer",onClick:()=>t(!e),children:[x.jsx("button",{className:"message-toggle-button text-gray-400 mr-1",children:e?x.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):x.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),x.jsx("span",{className:"message-title-icon mr-1",children:x.jsx("svg",{className:"w-4 h-4 text-pink-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),x.jsx("span",{className:"message-title-text text-pink-400 font-semibold",children:ie("agenticEditSearchFilesToolTitle")})]}),x.jsx("div",{className:"mt-1 text-cyan-300 bg-gray-800 px-2 py-1 rounded text-sm font-mono break-all",children:i}),!e&&x.jsxs("div",{className:"mt-2 space-y-1",children:[x.jsxs("div",{className:"text-xs",children:[x.jsx("span",{className:"text-gray-400",children:"File Pattern: "}),x.jsx("span",{className:"text-yellow-300 font-mono",children:s})]}),x.jsxs("div",{className:"text-xs",children:[x.jsx("span",{className:"text-gray-400",children:"Regex: "}),x.jsx("span",{className:"text-yellow-300 font-mono break-all",children:r})]})]})]})},D2t=({message:n})=>{const[e,t]=_.useState(!0);let i="",r="",s="",o="";try{const a=JSON.parse(n.content||"{}");i=a.server_name||"Default",r=a.tool_name||"Default";const l=a.query||"";s=l.substring(0,100),o=l.length>100?"...":""}catch(a){console.error("Failed to parse UseMcpTool content:",a),i="Error",r="Parsing",s="Content"}return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title flex items-center cursor-pointer",onClick:()=>t(!e),children:[x.jsx("button",{className:"message-toggle-button text-gray-400 mr-1",children:e?x.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):x.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),x.jsx("span",{className:"message-title-icon mr-1",children:x.jsxs("svg",{className:"w-4 h-4 text-cyan-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),x.jsx("span",{className:"message-title-text text-cyan-400 font-semibold",children:"AutoCoder wants to use an MCP tool:"})]}),!e&&x.jsxs("div",{className:"mt-2 space-y-1",children:[x.jsxs("div",{className:"text-xs",children:[x.jsx("span",{className:"text-gray-400",children:"Server: "}),x.jsx("span",{className:"text-blue-300 font-mono",children:i})]}),x.jsxs("div",{className:"text-xs",children:[x.jsx("span",{className:"text-gray-400",children:"Tool: "}),x.jsx("span",{className:"text-blue-300 font-mono",children:r})]}),x.jsxs("div",{className:"text-xs",children:[x.jsx("span",{className:"text-gray-400",children:"Query Snippet: "}),x.jsxs("pre",{className:"bg-gray-900 p-1 rounded text-xs font-mono whitespace-pre-wrap overflow-x-auto text-gray-300",children:[s,o]})]})]})]})},R2t=({message:n})=>{let e="",t="";try{const r=JSON.parse(n.content||"{}");e=r.result||"N/A",t=r.command||""}catch(r){console.error("Failed to parse AttemptCompletionTool content:",r),e="Error parsing content"}const i={...n,content:e};return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title flex items-center mb-2",children:[x.jsx("span",{className:"message-title-icon mr-1",children:x.jsx("svg",{className:"w-4 h-4 text-lime-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),x.jsx("span",{className:"message-title-text text-lime-400 font-semibold",children:"任务完成"})]}),x.jsx("div",{className:"completion-result",children:x.jsx(VP,{message:i})}),t&&x.jsxs("div",{className:"mt-2",children:[x.jsx("span",{className:"text-gray-400 text-xs",children:"Suggested command: "}),x.jsx("span",{className:"text-yellow-300 bg-gray-800 px-2 py-1 rounded text-sm font-mono break-all",children:t})]})]})},M2t=({message:n})=>{var g,m;const[e,t]=_.useState(!1),[i,r]=_.useState([]),[s,o]=_.useState(null),[a,l]=_.useState(""),c=()=>{var p;if(t(!e),!e&&((p=n.metadata)==null?void 0:p.command)==="read_files"&&n.content){const v=D3e(n.content);r(v)}},d=p=>{s===p?o(null):(o(p),l(i[p].content))},u=_.useCallback((p,v)=>{},[]),h=_.useCallback(p=>{p!==void 0&&l(p)},[]),f=_.useCallback(()=>{},[]);return x.jsxs("div",{className:"message-font message-content-container",children:[x.jsxs("div",{className:"bg-gradient-to-r from-gray-800 to-gray-750 px-4 py-3 border-b border-gray-700 flex items-center justify-between cursor-pointer",onClick:c,children:[x.jsxs("div",{className:"flex items-center",children:[x.jsx("span",{className:"message-title-icon",children:x.jsx("svg",{className:"w-5 h-5 text-indigo-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),x.jsx("span",{className:"text-indigo-400 message-title-text",children:ie("agenticFilterCommandResult",{command:(g=n.metadata)==null?void 0:g.command})})]}),x.jsx("div",{className:"text-gray-400",children:x.jsx("svg",{className:`w-5 h-5 transition-transform duration-200 ${e?"transform rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})})]}),e&&x.jsx("div",{className:"p-4 bg-gray-800/30",children:((m=n.metadata)==null?void 0:m.command)==="read_files"?x.jsxs("div",{className:"text-gray-200",children:[x.jsxs("div",{className:"mb-4",children:[x.jsxs("h3",{className:"font-medium text-gray-300 mb-2",children:[ie("files"),":"]}),x.jsx("div",{className:"space-y-1",children:i.map((p,v)=>x.jsxs("div",{className:`flex items-center p-2 rounded cursor-pointer hover:bg-gray-700/50 ${s===v?"bg-gray-700/70 border-l-2 border-indigo-500":""}`,onClick:()=>d(v),children:[x.jsx("svg",{className:"w-4 h-4 mr-2 text-indigo-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),x.jsx("span",{className:"truncate",children:p.file}),x.jsx("svg",{className:`w-4 h-4 ml-auto transition-transform duration-200 ${s===v?"transform rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]},v))})]}),s!==null&&x.jsx("div",{className:"border border-gray-700 rounded-lg overflow-hidden",style:{height:"400px"},children:x.jsx(lle,{initialContent:i[s].content,onContentChange:h,onEditorReady:u,onSubmit:f})})]}):x.jsx("div",{className:"prose prose-invert prose-sm max-w-none",children:x.jsx(hp,{className:"text-gray-200 break-words",components:{code:({className:p,children:v,...b})=>{const y=/language-(\w+)/.exec(p||"");return!y?x.jsx("code",{className:p,...b,children:v}):x.jsx(Nl,{language:y?y[1]:"",style:rc,PreTag:"div",wrapLines:!0,wrapLongLines:!0,customStyle:{borderRadius:"0.375rem",fontSize:"14px"},children:String(v).replace(/\n$/,"")})}},children:n.content})})})]})},A2t=({message:n})=>{var e,t;return x.jsxs("div",{className:"font-mono text-sm",children:[x.jsx("div",{className:"text-indigo-400 font-semibold mb-1",children:ie("commandPreparation")}),x.jsxs("div",{className:"mb-2",children:[x.jsxs("span",{className:"text-gray-400",children:[ie("command"),": "]}),x.jsx("span",{className:"text-white font-semibold",children:(e=n.metadata)==null?void 0:e.command})]}),((t=n.metadata)==null?void 0:t.parameters)&&Object.keys(n.metadata.parameters).length>0&&x.jsxs("div",{children:[x.jsxs("div",{className:"text-gray-400 mb-1",children:[ie("parameters"),":"]}),x.jsx("div",{className:"bg-gray-800 p-2 rounded",children:Object.entries(n.metadata.parameters).map(([i,r])=>x.jsxs("div",{className:"grid grid-cols-[120px_1fr] gap-2 mb-1",children:[x.jsxs("span",{className:"text-indigo-300",children:[i,":"]}),x.jsx("span",{className:"text-white break-all",children:typeof r=="object"?JSON.stringify(r):String(r)})]},i))})]})]})},O2t=({message:n})=>{var i;const e=n.type==="STREAM"&&((i=n.metadata)==null?void 0:i.stream_out_type)==="command_suggestion",t=e&&!n.isStreaming;return e?x.jsx(P2t,{message:n,isCompleted:t}):x.jsx(F2t,{message:n})},P2t=({message:n,isCompleted:e})=>{const[t,i]=_.useState(e),r=n.content||"",s=r.split(`
|
514
|
+
`);return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title",children:[e&&s.length>5&&x.jsx("button",{onClick:()=>i(!t),className:"message-toggle-button",children:t?x.jsx("svg",{className:"message-toggle-icon text-orange-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):x.jsx("svg",{className:"message-toggle-icon text-orange-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),x.jsx("span",{className:"message-title-icon",children:n.isStreaming?x.jsxs("svg",{className:"animate-spin w-3.5 h-3.5 text-orange-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[x.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),x.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):x.jsx("svg",{className:"w-3.5 h-3.5 text-orange-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),x.jsx("span",{className:"text-orange-400 message-title-text text-xs",children:n.isStreaming?ie("analyzingCompile")||"Analyzing Compile...":ie("compileResults")||"Compile Results"})]}),!t&&x.jsx("div",{className:"message-content-container border border-gray-800",children:x.jsx("div",{className:"p-2 whitespace-pre-wrap text-xs",children:r})})]})},S2t=({message:n})=>{const[e,t]=_.useState(!1),i=_.useMemo(()=>{try{return JSON.parse(n.content).content||n.content}catch{return n.content}},[n.content]),r="bash",s=()=>{hr.publish(vr.UI.SHOW_MODAL,{content:i,format:"plaintext",language:r,title:ie("compileResults")})};return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title",children:[x.jsx("button",{onClick:()=>t(!e),className:"message-toggle-button",children:e?x.jsx("svg",{className:"message-toggle-icon text-orange-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):x.jsx("svg",{className:"message-toggle-icon text-orange-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),x.jsx("span",{className:"message-title-icon",children:x.jsx("svg",{className:"w-3.5 h-3.5 text-orange-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),x.jsx("span",{className:"text-orange-400 message-title-text text-xs",children:ie("compileResults")||"Compile Results"}),x.jsx("button",{onClick:()=>navigator.clipboard.writeText(i),className:"ml-auto message-copy-button text-gray-400 hover:text-orange-400",title:ie("copy")||"Copy",children:x.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"})})}),x.jsx("button",{onClick:s,className:"ml-1 message-maximize-button text-gray-400 hover:text-orange-400",title:ie("maximize")||"Maximize",children:x.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5v-4m0 4h-4m4 0l-5-5"})})})]}),!e&&x.jsx("div",{className:"message-content-container border border-gray-800",children:x.jsx("div",{className:"p-0 bg-gray-800/20",children:x.jsx(Nl,{language:r,style:rc,customStyle:{margin:0,padding:"0.25rem",backgroundColor:"transparent",fontSize:"0.75rem"},wrapLines:!0,wrapLongLines:!0,children:i})})})]})},Txe=({message:n})=>{const[e,t]=_.useState(!0),i=JSON.parse(n.content);i.tool_name;const r=i.path,s=i.diff,o=a=>{const l=[],c=/<<<<<<< SEARCH\n([\s\S]*?)=======\n([\s\S]*?)>>>>>>> REPLACE/gm;let d;for(;(d=c.exec(a))!==null;)l.push({search:d[1].trimEnd(),replace:d[2].trimEnd()});return l.map((u,h)=>x.jsx("div",{className:"mb-1.5 border border-gray-700 rounded overflow-hidden text-xs font-mono shadow-sm",children:x.jsxs("div",{className:"flex",children:[x.jsxs("div",{className:"w-1/2 border-r border-gray-700",children:[x.jsx("div",{className:"bg-gray-800 px-1.5 py-0.5 text-xs font-medium text-gray-300 border-b border-gray-700",children:"SEARCH"}),x.jsx("div",{className:"bg-gray-900 h-56 overflow-auto",children:x.jsx("pre",{className:"px-1.5 py-1 whitespace-pre text-red-300 min-w-full text-xs",children:u.search})})]}),x.jsxs("div",{className:"w-1/2",children:[x.jsx("div",{className:"bg-gray-800 px-1.5 py-0.5 text-xs font-medium text-gray-300 border-b border-gray-700",children:"REPLACE"}),x.jsx("div",{className:"bg-gray-900 h-56 overflow-auto",children:x.jsx("pre",{className:"px-1.5 py-1 whitespace-pre text-green-300 min-w-full text-xs",children:u.replace})})]})]})},h))};return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title flex items-center",children:[x.jsx("button",{onClick:()=>t(!e),className:"message-toggle-button text-gray-400",children:e?x.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):x.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),x.jsx("span",{className:"message-title-icon",children:x.jsxs("svg",{className:"w-4 h-4 text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 20h9"}),x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 4h9"}),x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 12h16"})]})}),x.jsx("span",{className:"message-title-text ml-1 text-yellow-400 font-semibold",children:ie("agenticEditReplaceInFileToolTitle")})]}),x.jsx("div",{className:"mt-1 text-gray-300 text-xs whitespace-pre-wrap break-words px-2 py-1",children:x.jsx("span",{title:r,className:"hover:underline cursor-help",children:r})}),!e&&x.jsx("div",{className:"mt-2 text-white",children:o(s)})]})},w2t=({message:n})=>{const[e,t]=_.useState(!0);let i="",r=!1,s="",o="";try{const a=JSON.parse(n.content||"{}");i=a.tool_name||"",r=a.success??!1,s=a.message||"",o=a.content||"",i==="ReplaceInFileTool"&&(i=ie("agenticEditToolResultReplaceInFileTool")),i==="WriteToFileTool"&&(i=ie("agenticEditToolResultWriteToFileTool")),i==="ReadFileTool"&&(i=ie("agenticEditToolResultReadFileTool")),i==="ListFilesTool"&&(i=ie("agenticEditToolResultListFilesTool")),i==="SearchFilesTool"&&(i=ie("agenticEditToolResultSearchFilesTool"))}catch(a){console.error("Failed to parse tool result content:",a),s=n.content}return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title flex items-center",children:[x.jsx("button",{onClick:()=>t(!e),className:"message-toggle-button text-gray-400",children:e?x.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):x.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),x.jsx("span",{className:"message-title-icon",children:x.jsxs("svg",{className:"w-4 h-4 text-yellow-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 20h9"}),x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 4h9"}),x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M4 12h16"})]})}),x.jsx("span",{className:"message-title-text ml-1 text-yellow-400 font-semibold",children:i}),x.jsx("span",{className:`text-xs px-2 py-0.5 ml-2 rounded-full ${r?"bg-green-600/30 text-green-400":"bg-red-600/30 text-red-400"}`,children:r?"Success":"Failed"})]}),x.jsx("div",{className:"mt-1 text-gray-300 text-xs whitespace-pre-wrap break-words px-2 py-1",children:x.jsx("span",{title:s,className:"hover:underline cursor-help",children:s})}),!e&&o&&x.jsx("div",{className:"mt-2 p-2 bg-gray-900 overflow-auto text-xs font-mono whitespace-pre-wrap text-gray-200 border-t border-gray-700 max-h-[400px] scrollbar-thin scrollbar-thumb-gray-600",children:o})]})},x2t=({message:n})=>{const[e,t]=_.useState(!0);let i="",r="",s="";try{const o=JSON.parse(n.content||"{}");i=o.path||"N/A";const a=o.content||"";r=a.substring(0,150),s=a.length>150?"...":""}catch(o){console.error("Failed to parse WriteToFileTool content:",o),i="Error parsing content",r=""}return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title flex items-center cursor-pointer",onClick:()=>t(!e),children:[x.jsx("button",{className:"message-toggle-button text-gray-400 mr-1",children:e?x.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):x.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),x.jsx("span",{className:"message-title-icon mr-1",children:x.jsx("svg",{className:"w-4 h-4 text-purple-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),x.jsx("span",{className:"message-title-text text-purple-400 font-semibold",children:ie("agenticEditWriteToFileToolTitle")})]}),x.jsx("div",{className:"mt-1 text-cyan-300 bg-gray-800 px-2 py-1 rounded text-sm font-mono break-all",children:i}),!e&&x.jsxs("div",{className:"mt-2",children:[x.jsx("div",{className:"text-gray-400 text-xs mb-1",children:"Content Snippet:"}),x.jsxs("pre",{className:"bg-gray-900 p-2 rounded text-xs font-mono whitespace-pre-wrap overflow-x-auto text-gray-300 max-h-40",children:[r,s]})]})]})},E2t=({message:n})=>{const[e,t]=_.useState(!1);let i="",r=[];try{const s=JSON.parse(n.content||"{}");i=s.question||"N/A";const o=s.options;if(typeof o=="string")try{r=JSON.parse(o),Array.isArray(r)||(r=[])}catch{r=[]}else Array.isArray(o)?r=o:r=[]}catch(s){console.error("Failed to parse AskFollowupQuestionTool content:",s),i="Error parsing content"}return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title flex items-center cursor-pointer",onClick:()=>t(!e),children:[x.jsx("button",{className:"message-toggle-button text-gray-400 mr-1",children:e?x.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):x.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),x.jsx("span",{className:"message-title-icon mr-1",children:x.jsx("svg",{className:"w-4 h-4 text-orange-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.79 4 4s-1.79 4-4 4c-1.742 0-3.223-.835-3.772-2M12 5v.01M12 19v.01M3.34 16.66l.01-.01M20.66 7.34l-.01.01M16.66 20.66l-.01-.01M7.34 3.34l.01.01M12 22a10 10 0 110-20 10 10 0 010 20z"})})}),x.jsx("span",{className:"message-title-text text-orange-400 font-semibold",children:"AutoCoder is asking a question:"})]}),!e&&x.jsxs("div",{className:"mt-2 space-y-2",children:[x.jsx("div",{className:"text-gray-200",children:i}),r.length>0&&x.jsxs("div",{children:[x.jsx("div",{className:"text-gray-400 text-xs mb-1",children:"Options:"}),x.jsx("ul",{className:"list-disc list-inside text-sm text-gray-300 space-y-1",children:r.map((s,o)=>x.jsx("li",{children:s},o))})]})]})]})},k2t=({message:n})=>{const[e,t]=_.useState(!0);let i="",r=!1;try{const s=JSON.parse(n.content||"{}");i=s.command||"N/A",r=s.requires_approval||!1,i.length<80&&t(!1)}catch(s){console.error("Failed to parse ExecuteCommandTool content:",s),i="Error parsing content"}return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title flex items-center cursor-pointer",onClick:()=>t(!e),children:[x.jsx("button",{className:"message-toggle-button text-gray-400 mr-1",children:e?x.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):x.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),x.jsx("span",{className:"message-title-icon mr-1",children:x.jsx("svg",{className:"w-4 h-4 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 9l4-4 4 4m0 6l-4 4-4-4"})})}),x.jsx("span",{className:"message-title-text text-green-400 font-semibold",children:"AutoCoder wants to execute this command:"})]}),!e&&x.jsx("div",{className:"mt-1 text-yellow-300 bg-gray-800 px-2 py-1 rounded text-sm font-mono break-all",children:i}),x.jsxs("div",{className:`mt-1 text-xs ${r?"text-red-400":"text-gray-400"}`,children:["(Requires Approval: ",r?"Yes":"No",")"]})]})},L2t=({message:n})=>{let e="";try{e=JSON.parse(n.content||"{}").path||"N/A"}catch(t){console.error("Failed to parse ListCodeDefinitionNamesTool content:",t),e="Error parsing content"}return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title flex items-center",children:[x.jsx("span",{className:"message-title-icon mr-1",children:x.jsx("svg",{className:"w-4 h-4 text-teal-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})})}),x.jsx("span",{className:"message-title-text text-teal-400 font-semibold",children:"AutoCoder wants to list definitions in:"})]}),x.jsx("div",{className:"mt-1 text-cyan-300 bg-gray-800 px-2 py-1 rounded text-sm font-mono break-all",children:e})]})},I2t=({message:n})=>{let e="",t=!1;try{const i=JSON.parse(n.content||"{}");e=i.path||"N/A",t=i.recursive||!1}catch(i){console.error("Failed to parse ListFilesTool content:",i),e="Error parsing content"}return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title flex items-center",children:[x.jsx("span",{className:"message-title-icon mr-1",children:x.jsx("svg",{className:"w-4 h-4 text-indigo-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})})}),x.jsx("span",{className:"message-title-text text-indigo-400 font-semibold",children:ie("agenticEditListFilesToolTitle")})]}),x.jsx("div",{className:"mt-1 text-cyan-300 bg-gray-800 px-2 py-1 rounded text-sm font-mono break-all",children:e}),x.jsxs("div",{className:"mt-1 text-xs text-gray-400",children:["(",t?"Recursively":"Top Level Only",")"]})]})},N2t=({message:n})=>{let e="";try{e=JSON.parse(n.content||"{}").path||"N/A"}catch(t){console.error("Failed to parse ReadFileTool content:",t),e="Error parsing content"}return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title flex items-center",children:[x.jsx("span",{className:"message-title-icon mr-1",children:x.jsxs("svg",{className:"w-4 h-4 text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})}),x.jsx("span",{className:"message-title-text text-blue-400 font-semibold",children:ie("agenticEditReadFileToolTitle")})]}),x.jsx("div",{className:"mt-1 text-cyan-300 bg-gray-800 px-2 py-1 rounded text-sm font-mono break-words max-h-[120px] overflow-auto scrollbar-thin scrollbar-thumb-gray-600",children:x.jsx("span",{title:e,className:"hover:underline cursor-help",children:e})})]})},T2t=({message:n})=>{const[e,t]=_.useState(!0);let i="",r="",s="";try{const o=JSON.parse(n.content||"{}");i=o.path||"N/A",r=o.regex||"N/A",s=o.file_pattern||"*"}catch(o){console.error("Failed to parse SearchFilesTool content:",o),i="Error parsing content"}return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title flex items-center cursor-pointer",onClick:()=>t(!e),children:[x.jsx("button",{className:"message-toggle-button text-gray-400 mr-1",children:e?x.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):x.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),x.jsx("span",{className:"message-title-icon mr-1",children:x.jsx("svg",{className:"w-4 h-4 text-pink-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),x.jsx("span",{className:"message-title-text text-pink-400 font-semibold",children:ie("agenticEditSearchFilesToolTitle")})]}),x.jsx("div",{className:"mt-1 text-cyan-300 bg-gray-800 px-2 py-1 rounded text-sm font-mono break-all",children:i}),!e&&x.jsxs("div",{className:"mt-2 space-y-1",children:[x.jsxs("div",{className:"text-xs",children:[x.jsx("span",{className:"text-gray-400",children:"File Pattern: "}),x.jsx("span",{className:"text-yellow-300 font-mono",children:s})]}),x.jsxs("div",{className:"text-xs",children:[x.jsx("span",{className:"text-gray-400",children:"Regex: "}),x.jsx("span",{className:"text-yellow-300 font-mono break-all",children:r})]})]})]})},D2t=({message:n})=>{const[e,t]=_.useState(!0);let i="",r="",s="",o="";try{const a=JSON.parse(n.content||"{}");i=a.server_name||"Default",r=a.tool_name||"Default";const l=a.query||"";s=l.substring(0,100),o=l.length>100?"...":""}catch(a){console.error("Failed to parse UseMcpTool content:",a),i="Error",r="Parsing",s="Content"}return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title flex items-center cursor-pointer",onClick:()=>t(!e),children:[x.jsx("button",{className:"message-toggle-button text-gray-400 mr-1",children:e?x.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):x.jsx("svg",{className:"message-toggle-icon",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),x.jsx("span",{className:"message-title-icon mr-1",children:x.jsxs("svg",{className:"w-4 h-4 text-cyan-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),x.jsx("span",{className:"message-title-text text-cyan-400 font-semibold",children:"AutoCoder wants to use an MCP tool:"})]}),!e&&x.jsxs("div",{className:"mt-2 space-y-1",children:[x.jsxs("div",{className:"text-xs",children:[x.jsx("span",{className:"text-gray-400",children:"Server: "}),x.jsx("span",{className:"text-blue-300 font-mono",children:i})]}),x.jsxs("div",{className:"text-xs",children:[x.jsx("span",{className:"text-gray-400",children:"Tool: "}),x.jsx("span",{className:"text-blue-300 font-mono",children:r})]}),x.jsxs("div",{className:"text-xs",children:[x.jsx("span",{className:"text-gray-400",children:"Query Snippet: "}),x.jsxs("pre",{className:"bg-gray-900 p-1 rounded text-xs font-mono whitespace-pre-wrap overflow-x-auto text-gray-300",children:[s,o]})]})]})]})},R2t=({message:n})=>{let e="",t="";try{const r=JSON.parse(n.content||"{}");e=r.result||"N/A",t=r.command||""}catch(r){console.error("Failed to parse AttemptCompletionTool content:",r),e="Error parsing content"}const i={...n,content:e};return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title flex items-center mb-2",children:[x.jsx("span",{className:"message-title-icon mr-1",children:x.jsx("svg",{className:"w-4 h-4 text-lime-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),x.jsx("span",{className:"message-title-text text-lime-400 font-semibold",children:"任务完成"})]}),x.jsx("div",{className:"completion-result",children:x.jsx(VP,{message:i})}),t&&x.jsxs("div",{className:"mt-2",children:[x.jsx("span",{className:"text-gray-400 text-xs",children:"Suggested command: "}),x.jsx("span",{className:"text-yellow-300 bg-gray-800 px-2 py-1 rounded text-sm font-mono break-all",children:t})]})]})},M2t=({message:n})=>{var g,m;const[e,t]=_.useState(!1),[i,r]=_.useState([]),[s,o]=_.useState(null),[a,l]=_.useState(""),c=()=>{var p;if(t(!e),!e&&((p=n.metadata)==null?void 0:p.command)==="read_files"&&n.content){const v=D3e(n.content);r(v)}},d=p=>{s===p?o(null):(o(p),l(i[p].content))},u=_.useCallback((p,v)=>{},[]),h=_.useCallback(p=>{p!==void 0&&l(p)},[]),f=_.useCallback(()=>{},[]);return x.jsxs("div",{className:"message-font message-content-container",children:[x.jsxs("div",{className:"bg-gradient-to-r from-gray-800 to-gray-750 px-4 py-3 border-b border-gray-700 flex items-center justify-between cursor-pointer",onClick:c,children:[x.jsxs("div",{className:"flex items-center",children:[x.jsx("span",{className:"message-title-icon",children:x.jsx("svg",{className:"w-5 h-5 text-indigo-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),x.jsx("span",{className:"text-indigo-400 message-title-text",children:ie("agenticFilterCommandResult",{command:(g=n.metadata)==null?void 0:g.command})})]}),x.jsx("div",{className:"text-gray-400",children:x.jsx("svg",{className:`w-5 h-5 transition-transform duration-200 ${e?"transform rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})})]}),e&&x.jsx("div",{className:"p-4 bg-gray-800/30",children:((m=n.metadata)==null?void 0:m.command)==="read_files"?x.jsxs("div",{className:"text-gray-200",children:[x.jsxs("div",{className:"mb-4",children:[x.jsxs("h3",{className:"font-medium text-gray-300 mb-2",children:[ie("files"),":"]}),x.jsx("div",{className:"space-y-1",children:i.map((p,v)=>x.jsxs("div",{className:`flex items-center p-2 rounded cursor-pointer hover:bg-gray-700/50 ${s===v?"bg-gray-700/70 border-l-2 border-indigo-500":""}`,onClick:()=>d(v),children:[x.jsx("svg",{className:"w-4 h-4 mr-2 text-indigo-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),x.jsx("span",{className:"truncate",children:p.file}),x.jsx("svg",{className:`w-4 h-4 ml-auto transition-transform duration-200 ${s===v?"transform rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]},v))})]}),s!==null&&x.jsx("div",{className:"border border-gray-700 rounded-lg overflow-hidden",style:{height:"400px"},children:x.jsx(lle,{initialContent:i[s].content,onContentChange:h,onEditorReady:u,onSubmit:f})})]}):x.jsx("div",{className:"prose prose-invert prose-sm max-w-none",children:x.jsx(hp,{className:"text-gray-200 break-words",components:{code:({className:p,children:v,...b})=>{const y=/language-(\w+)/.exec(p||"");return!y?x.jsx("code",{className:p,...b,children:v}):x.jsx(Nl,{language:y?y[1]:"",style:rc,PreTag:"div",wrapLines:!0,wrapLongLines:!0,customStyle:{borderRadius:"0.375rem",fontSize:"14px"},children:String(v).replace(/\n$/,"")})}},children:n.content})})})]})},A2t=({message:n})=>{var e,t;return x.jsxs("div",{className:"font-mono text-sm",children:[x.jsx("div",{className:"text-indigo-400 font-semibold mb-1",children:ie("commandPreparation")}),x.jsxs("div",{className:"mb-2",children:[x.jsxs("span",{className:"text-gray-400",children:[ie("command"),": "]}),x.jsx("span",{className:"text-white font-semibold",children:(e=n.metadata)==null?void 0:e.command})]}),((t=n.metadata)==null?void 0:t.parameters)&&Object.keys(n.metadata.parameters).length>0&&x.jsxs("div",{children:[x.jsxs("div",{className:"text-gray-400 mb-1",children:[ie("parameters"),":"]}),x.jsx("div",{className:"bg-gray-800 p-2 rounded",children:Object.entries(n.metadata.parameters).map(([i,r])=>x.jsxs("div",{className:"grid grid-cols-[120px_1fr] gap-2 mb-1",children:[x.jsxs("span",{className:"text-indigo-300",children:[i,":"]}),x.jsx("span",{className:"text-white break-all",children:typeof r=="object"?JSON.stringify(r):String(r)})]},i))})]})]})},O2t=({message:n})=>{var i;const e=n.type==="STREAM"&&((i=n.metadata)==null?void 0:i.stream_out_type)==="command_suggestion",t=e&&!n.isStreaming;return e?x.jsx(P2t,{message:n,isCompleted:t}):x.jsx(F2t,{message:n})},P2t=({message:n,isCompleted:e})=>{const[t,i]=_.useState(e),r=n.content||"",s=r.split(`
|
515
515
|
`),o=3,a=s.length>o?s.slice(0,o).join(`
|
516
516
|
`)+"...":r;return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title",children:[x.jsx("button",{onClick:()=>i(!t),className:"message-toggle-button",children:t?x.jsx("svg",{className:"message-toggle-icon text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):x.jsx("svg",{className:"message-toggle-icon text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),x.jsx("span",{className:"message-title-icon",children:x.jsx("svg",{className:"w-4 h-4 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})})}),x.jsxs("span",{className:"text-yellow-400 message-title-text",children:[n.isStreaming?ie("processingStatus"):ie("processingComplete"),"(",ie("agenticFilterContext"),")"]}),n.isStreaming&&x.jsx("span",{className:"ml-2",children:x.jsxs("svg",{className:"animate-spin h-4 w-4 text-yellow-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[x.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),x.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})})]}),x.jsx("div",{className:"message-content-container bg-gray-800/50 p-2 whitespace-pre-wrap text-white break-words",children:t?a:r})]})},F2t=({message:n})=>{const[e,t]=_.useState(!1);return x.jsxs("div",{className:"message-font",children:[x.jsxs("div",{className:"message-title",children:[x.jsx("button",{onClick:()=>t(!e),className:"message-toggle-button",children:e?x.jsx("svg",{className:"message-toggle-icon text-blue-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"})}):x.jsx("svg",{className:"message-toggle-icon text-blue-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z",clipRule:"evenodd"})})}),x.jsx("span",{className:"message-title-icon",children:x.jsx("svg",{className:"w-4 h-4 text-blue-400",viewBox:"0 0 20 20",fill:"currentColor",children:x.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})})}),x.jsx("span",{className:"text-blue-400 message-title-text",children:ie("agenticFilterCommandChoose",{command:n.content.split("(")[0]})})]}),!e&&x.jsx("div",{className:"message-content-container bg-gray-800/50 p-2 whitespace-pre-wrap text-white break-words",children:n.content})]})},M3e=({messages:n,onUserResponse:e})=>{const t=r=>{if(r.length===0)return[];const s=r.slice(0,-1),o=r[r.length-1],a=["code_generate","agentic_filter"];return[...s.filter(c=>{var d;return!(c.contentType==="command_prepare_stat"||c.type==="STREAM"&&!c.isStreaming&&a.includes((d=c.metadata)==null?void 0:d.stream_out_type))}),o]},i=r=>{var s,o,a,l,c,d,u,h,f,g,m,p,v,b,y,C,S,E;if(r.isUser)return x.jsx(b2t,{message:r});if((o=(s=r.metadata)==null?void 0:s.path)!=null&&o.startsWith("/agent/")){if(((a=r.metadata)==null?void 0:a.path)==="/agent/edit"||((l=r.metadata)==null?void 0:l.path)==="/agent/edit/thinking")return x.jsx(Ixe,{message:r});if(((c=r.metadata)==null?void 0:c.path)==="/agent/edit/tool/call"){const L=JSON.parse(r.content);if(L.tool_name==="ReplaceInFileTool")return x.jsx(Txe,{message:r});if(L.tool_name==="WriteToFileTool")return x.jsx(x2t,{message:r});if(L.tool_name==="AskFollowupQuestionTool")return x.jsx(E2t,{message:r});if(L.tool_name==="ExecuteCommandTool")return x.jsx(k2t,{message:r});if(L.tool_name==="ListCodeDefinitionNamesTool")return x.jsx(L2t,{message:r});if(L.tool_name==="ListFilesTool")return x.jsx(I2t,{message:r});if(L.tool_name==="ReadFileTool")return x.jsx(N2t,{message:r});if(L.tool_name==="SearchFilesTool")return x.jsx(T2t,{message:r});if(L.tool_name==="ReplaceInFileTool")return x.jsx(Txe,{message:r});if(L.tool_name==="UseMcpTool")return x.jsx(D2t,{message:r});if(L.tool_name==="AttemptCompletionTool")return x.jsx(R2t,{message:r})}return((d=r.metadata)==null?void 0:d.path)==="/agent/edit/tool/result"?x.jsx(w2t,{message:r}):((u=r.metadata)==null?void 0:u.path)==="/agent/edit/plan/mode/respond"||((h=r.metadata)==null?void 0:h.path)==="/agent/edit/completion"?x.jsx(VP,{message:r}):x.jsx(VP,{message:r})}return((f=r.metadata)==null?void 0:f.stream_out_type)==="agentic_filter"?r.contentType==="command_execute_stat"?x.jsx(M2t,{message:r}):r.contentType==="command_prepare"?x.jsx(A2t,{message:r}):r.contentType==="text"?x.jsx(Nxe,{message:r}):x.jsx(O2t,{message:r}):r.type==="COMPLETION"?x.jsx(JIt,{message:r}):((g=r.metadata)==null?void 0:g.stream_out_type)==="file_number_list"?x.jsx(r2t,{message:r}):((m=r.metadata)==null?void 0:m.stream_out_type)==="index_build"?x.jsx(v2t,{message:r}):((p=r.metadata)==null?void 0:p.stream_out_type)==="code_generate"?x.jsx(a2t,{message:r}):((v=r.metadata)==null?void 0:v.stream_out_type)==="lint"?x.jsx(f2t,{message:r}):((b=r.metadata)==null?void 0:b.stream_out_type)==="compile"?x.jsx(y2t,{message:r}):((y=r.metadata)==null?void 0:y.stream_out_type)==="code_rank"?x.jsx(d2t,{message:r}):((C=r.metadata)==null?void 0:C.stream_out_type)==="unmerged_blocks"?x.jsx(_2t,{message:r}):r.contentType==="summary"?x.jsx(i2t,{message:r}):r.contentType==="token_stat"?x.jsx(XIt,{message:r}):r.contentType==="command_execute_stat"?x.jsx(ZIt,{message:r}):r.contentType==="context_used"?x.jsx(QIt,{message:r}):r.isThinking||r.isStreaming?x.jsx(Ixe,{message:r}):((S=r.metadata)==null?void 0:S.stream_out_type)==="command_suggestion"?x.jsx(e2t,{message:r}):r.contentType==="markdown"&&!((E=r.metadata)!=null&&E.stream_out_type)?x.jsx(VP,{message:r}):x.jsx(Nxe,{message:r})};return x.jsx(x.Fragment,{children:t(n).map((r,s)=>x.jsxs("div",{className:`flex ${r.isUser?"justify-end":"justify-start"} mb-4 w-full`,children:[!r.isUser&&x.jsx("div",{className:"w-7 h-7 rounded-full bg-indigo-600 flex items-center justify-center mr-2 flex-shrink-0",children:x.jsx("svg",{className:"w-4 h-4 text-white",viewBox:"0 0 24 24",fill:"currentColor",children:x.jsx("path",{d:"M13 2L3 14h9l-1 8 10-12h-9l1-8z"})})}),x.jsxs("div",{className:`w-[80%] ${r.isUser?"bg-indigo-600":r.type==="ERROR"?"bg-red-900/80":r.isThinking||r.isStreaming?"bg-gray-700/50":"bg-gray-700"}
|
517
|
-
rounded-xl px-3 py-2 ${r.isUser?"rounded-tr-none":"rounded-tl-none"}`,children:[i(r),r.type==="ASK_USER"&&r.options&&r.options.length>0&&x.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:r.options.map((o,a)=>x.jsx("button",{className:"px-2 py-1 bg-indigo-600 hover:bg-indigo-700 rounded-full text-xs text-white transition-colors",onClick:()=>e(o,r.eventId),children:o},a))})]}),r.isUser&&x.jsx("div",{className:"w-7 h-7 rounded-full bg-gray-600 flex items-center justify-center ml-2 flex-shrink-0",children:x.jsx("svg",{className:"w-4 h-4 text-gray-300",viewBox:"0 0 24 24",fill:"currentColor",children:x.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"})})})]},r.id||s))})},B2t=({messages:n,currentTask:e,onUserResponse:t,onClose:i,onToggleAdaptive:r,isMessageAreaAdaptive:s=!0})=>{const[o,a]=_.useState({inputTokens:0,outputTokens:0,totalCost:0,contextWindowUsage:0,maxContextWindow:100,cacheHits:0,cacheMisses:0}),l=_.useRef(null),c=_.useRef(null),[d,u]=_.useState(!0),[h,f]=_.useState(!1),g=_.useRef(n.length),m=_.useCallback(()=>{var p;(p=l.current)==null||p.scrollIntoView({behavior:"smooth"})},[]);return _.useEffect(()=>{let p=0,v=0,b=0,y=0,C=100,S=0,E=0;n.forEach(L=>{var N,I;L.contentType==="token_stat"&&L.metadata&&(p+=L.metadata.input_tokens||0,v+=L.metadata.output_tokens||0,b+=(L.metadata.input_cost||0)+(L.metadata.output_cost||0),y=Math.max(y,L.metadata.context_window||0),C=L.metadata.max_context_window||C,S+=L.metadata.cache_hit||0,E+=L.metadata.cache_miss||0),((N=L.metadata)==null?void 0:N.stream_out_type)==="index_build"&&((I=L.metadata)!=null&&I.input_tokens)&&(p+=L.metadata.input_tokens||0,v+=L.metadata.output_tokens||0,b+=(L.metadata.input_cost||0)+(L.metadata.output_cost||0),y=Math.max(y,L.metadata.context_window||0),C=L.metadata.max_context_window||C,S+=L.metadata.cache_hit||0,E+=L.metadata.cache_miss||0)}),a({inputTokens:p,outputTokens:v,totalCost:b,contextWindowUsage:y,maxContextWindow:C,cacheHits:S,cacheMisses:E})},[n]),_.useEffect(()=>{const p=()=>{const b=c.current;if(!b)return;f(!0);const y=b.scrollHeight-b.scrollTop-b.clientHeight<20;u(y)},v=c.current;return v&&(v.addEventListener("scroll",p),setTimeout(()=>{v&&c.current===v&&p()},100)),()=>{v&&v.removeEventListener("scroll",p)}},[]),_.useEffect(()=>{const p=n.length,v=p!==g.current;g.current=p,v&&(!h||d)&&setTimeout(()=>{m()},0)},[n,d,h,m]),_.useEffect(()=>{const p=setTimeout(()=>{(!h||d)&&m();const v=c.current;if(v){const b=v.scrollHeight-v.scrollTop-v.clientHeight<20;b!==d&&u(b)}},200);return()=>clearTimeout(p)},[]),x.jsxs("div",{className:"flex flex-col h-full relative",children:[x.jsx("div",{className:"sticky top-0 z-10 bg-gray-800/90 backdrop-blur-sm border-b border-gray-700 shadow-md rounded-t-lg mb-4",children:x.jsxs("div",{className:"px-4 py-3",children:[x.jsxs("div",{className:"mb-2 flex items-center",children:[x.jsx("svg",{className:"w-4 h-4 text-indigo-400 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})}),x.jsx("h2",{className:"text-white font-medium text-sm truncate",children:e||ie("noActiveTask")})]}),x.jsxs("div",{className:"font-mono text-xs text-gray-400 flex flex-row items-center gap-2 flex-wrap text-[11px]",children:[x.jsxs("div",{className:"flex items-center",children:[x.jsxs("span",{children:[ie("tokens"),": "]}),x.jsxs("span",{className:"text-green-500 ml-1",children:["↑ ",o.inputTokens]}),x.jsxs("span",{className:"text-red-500 ml-1",children:["↓ ",o.outputTokens]})]}),x.jsxs("div",{className:"flex items-center",children:[x.jsxs("span",{children:[ie("cache"),": "]}),x.jsxs("span",{className:"text-white ml-1",children:["⊕ ",o.cacheHits]}),x.jsxs("span",{className:"text-white ml-1",children:["→ ",o.cacheMisses]})]}),x.jsxs("div",{className:"flex items-center",children:[x.jsxs("span",{children:[ie("apiCost"),": "]}),x.jsxs("span",{className:"text-white ml-1",children:["$",o.totalCost.toFixed(5)]})]})]})]})}),x.jsxs("div",{className:"flex-grow overflow-y-auto relative",ref:c,children:[x.jsx(M3e,{messages:n,onUserResponse:t}),x.jsx("div",{ref:l}),!d&&n.length>0&&x.jsx("button",{onClick:()=>{var p;(p=l.current)==null||p.scrollIntoView({behavior:"smooth"}),u(!0)},className:"fixed bottom-24 right-4 z-10 bg-indigo-600 hover:bg-indigo-700 text-white rounded-full p-2 shadow-lg flex items-center justify-center",style:{width:"36px",height:"36px"},"aria-label":"滚动到底部",children:x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 14l-7 7m0 0l-7-7m7 7V3"})})})]})]})};U_.config({paths:{vs:"/monaco-editor/min/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});const $2t=({projectName:n})=>{const[e,t]=_.useState([]),[i,r]=_.useState(!0),[s,o]=_.useState(null),[a,l]=_.useState(null),[c,d]=_.useState(null),[u,h]=_.useState(null),[f,g]=_.useState(null),[m,p]=_.useState(!1),[v,b]=_.useState(null),[y,C]=_.useState("split"),[S,E]=_.useState(null),L=_.useRef(null),N=_.useRef(null),I=_.useRef(null),D=_.useRef(null),R=_.useRef(null),[O,M]=_.useState("400px"),[P,B]=_.useState("100%"),H=(Z,ne)=>{let oe;return function(...de){clearTimeout(oe),oe=setTimeout(()=>Z(...de),ne)}},W=_.useCallback(H(()=>{if(D.current&&R.current){const Z=R.current.getBoundingClientRect(),ne=Z.top,de=window.innerHeight-ne-40,ye=Math.max(300,Math.min(de,600));M(`${ye}px`),B(`${Z.width}px`)}},100),[]);_.useEffect(()=>(V(),W(),window.addEventListener("resize",W),()=>{window.removeEventListener("resize",W),L.current=null,N.current=null,I.current=null}),[W]);const V=async()=>{try{r(!0);const Z=await fetch("/api/commits");if(!Z.ok)throw new Error(`Error fetching commits: ${Z.statusText}`);const ne=await Z.json();t(ne.commits),o(null)}catch(Z){o(Z instanceof Error?Z.message:"An unknown error occurred"),console.error("Failed to fetch commits:",Z)}finally{r(!1)}},$=async Z=>{try{d(null);const ne=await fetch(`/api/commits/${Z}`);if(!ne.ok)throw new Error(`Error fetching commit details: ${ne.statusText}`);const oe=await ne.json();d(oe)}catch(ne){console.error("Failed to fetch commit details:",ne)}},F=async(Z,ne)=>{try{p(!0),b(null),g(null),L.current=null,N.current=null,I.current=null,await new Promise(ye=>setTimeout(ye,50));const oe=await fetch(`/api/commits/${Z}/file?file_path=${encodeURIComponent(ne)}`);if(!oe.ok)throw new Error(`Error fetching file diff: ${oe.statusText}`);const de=await oe.json();g(de),setTimeout(W,50)}catch(oe){b(oe instanceof Error?oe.message:"An unknown error occurred"),console.error("Failed to fetch file diff:",oe)}finally{p(!1)}},j=Z=>{a===Z?(l(null),d(null),h(null),g(null),L.current=null,N.current=null,I.current=null,q()):(l(Z),$(Z),h(null),g(null),q())},q=()=>{E(null)},U=Z=>{u===Z?(h(null),g(null),L.current=null,N.current=null,I.current=null,q()):(h(Z),a&&F(a,Z),q())},K=_.useCallback(Z=>{L.current=Z},[]),Q=_.useCallback(Z=>{N.current=Z},[]),se=_.useCallback(Z=>{I.current=Z},[]),J=Z=>{var de;const ne=(de=Z.split(".").pop())==null?void 0:de.toLowerCase();return{js:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",py:"python",java:"java",c:"c",cpp:"cpp",cs:"csharp",go:"go",rs:"rust",rb:"ruby",php:"php",html:"html",css:"css",scss:"scss",json:"json",md:"markdown",yml:"yaml",yaml:"yaml",xml:"xml",sh:"shell",bash:"shell",txt:"plaintext"}[ne||""]||"plaintext"},G=Z=>{const ne=new Date(Z);return new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(ne)},X=()=>{if(!u||!f)return null;const Z=J(u),ne=`diff-${a}-${u}-${y}`,oe=`before-${a}-${u}`,de=`after-${a}-${u}`,ye={readOnly:!0,scrollBeyondLastLine:!1,minimap:{enabled:!1},lineNumbers:"on",wordWrap:"on",automaticLayout:!0,scrollbar:{vertical:"visible",horizontal:"visible",verticalScrollbarSize:14,horizontalScrollbarSize:14}},Se=({viewType:Ce})=>{const Le=S===Ce;return x.jsx("button",{className:"ml-2 text-gray-400 hover:text-white transition-colors",onClick:We=>{We.stopPropagation(),E(Le?null:Ce),setTimeout(W,50)},title:Le?"恢复正常视图":"最大化视图",children:Le?x.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5v-4m0 4h-4m4 0l-5-5"})}):x.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5v-4m0 4h-4m4 0l-5-5"})})})};return y==="unified"?x.jsxs("div",{ref:R,className:"bg-gray-900 rounded-lg border border-gray-700",style:{height:O,width:P,overflow:"hidden"},children:[x.jsxs("div",{className:"py-1 px-3 bg-gray-800 border-b border-gray-700 text-xs font-medium text-gray-300 flex justify-between items-center",children:[x.jsx("span",{children:ie("diffView")}),x.jsx(Se,{viewType:"diff"})]}),x.jsx(ou,{height:"calc(100% - 26px)",width:"100%",defaultLanguage:"diff",value:f.diff_content||"",theme:"vs-dark",onMount:se,options:ye,loading:x.jsx("div",{className:"flex items-center justify-center h-full text-gray-400",children:"Loading diff view..."})},ne)]}):x.jsxs("div",{ref:R,className:"grid grid-cols-3 gap-2",style:{height:O,width:P},children:[(S===null||S==="before")&&x.jsxs("div",{className:`bg-gray-900 rounded-lg border border-gray-700 ${S==="before"?"col-span-3":""}`,style:{overflow:"hidden"},children:[x.jsxs("div",{className:"py-1 px-3 bg-gray-800 border-b border-gray-700 text-xs font-medium text-gray-300 flex justify-between items-center",children:[x.jsxs("span",{children:[ie("beforeChange")," (",f.file_status==="added"?ie("newFile"):u,")"]}),x.jsx(Se,{viewType:"before"})]}),x.jsx(ou,{height:"calc(100% - 26px)",width:"100%",defaultLanguage:Z,value:f.before_content||"",theme:"vs-dark",onMount:K,options:ye,loading:x.jsx("div",{className:"flex items-center justify-center h-full text-gray-400",children:"Loading..."})},oe)]}),(S===null||S==="after")&&x.jsxs("div",{className:`bg-gray-900 rounded-lg border border-gray-700 ${S==="after"?"col-span-3":""}`,style:{overflow:"hidden"},children:[x.jsxs("div",{className:"py-1 px-3 bg-gray-800 border-b border-gray-700 text-xs font-medium text-gray-300 flex justify-between items-center",children:[x.jsxs("span",{children:[ie("afterChange")," (",f.file_status==="deleted"?ie("fileDeleted"):u,")"]}),x.jsx(Se,{viewType:"after"})]}),x.jsx(ou,{height:"calc(100% - 26px)",width:"100%",defaultLanguage:Z,value:f.after_content||"",theme:"vs-dark",onMount:Q,options:ye,loading:x.jsx("div",{className:"flex items-center justify-center h-full text-gray-400",children:"Loading..."})},de)]}),(S===null||S==="diff")&&x.jsxs("div",{className:`bg-gray-900 rounded-lg border border-gray-700 ${S==="diff"?"col-span-3":""}`,style:{overflow:"hidden"},children:[x.jsxs("div",{className:"py-1 px-3 bg-gray-800 border-b border-gray-700 text-xs font-medium text-gray-300 flex justify-between items-center",children:[x.jsx("span",{children:ie("diffView")}),x.jsx(Se,{viewType:"diff"})]}),x.jsx(ou,{height:"calc(100% - 26px)",width:"100%",defaultLanguage:"diff",value:f.diff_content||"",theme:"vs-dark",onMount:se,options:ye,loading:x.jsx("div",{className:"flex items-center justify-center h-full text-gray-400",children:"Loading..."})},`diff-inline-${a}-${u}`)]})]})};return i&&e.length===0?x.jsx("div",{className:"flex items-center justify-center h-full",children:x.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-b-2 border-indigo-500"})}):s&&e.length===0?x.jsxs("div",{className:"flex flex-col items-center justify-center text-center p-4 text-red-400",children:[x.jsx("svg",{className:"w-12 h-12 mb-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),x.jsx("p",{className:"text-lg font-medium mb-2",children:"Error Loading Commits"}),x.jsx("p",{className:"text-sm",children:s}),x.jsx("button",{className:"mt-4 px-4 py-2 bg-indigo-600 hover:bg-indigo-700 rounded text-white transition-colors",onClick:V,children:"Retry"})]}):x.jsxs("div",{className:"flex flex-col h-full",ref:D,children:[x.jsxs("div",{className:"flex justify-between items-center mb-4",children:[x.jsx("h2",{className:"text-lg font-medium text-white",children:ie("commitHistory",{project:n})}),x.jsx("button",{onClick:V,className:"p-1 text-gray-400 hover:text-white transition-colors",title:"Refresh",children:x.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})]}),e.length===0?x.jsxs("div",{className:"flex flex-col items-center justify-center text-center p-6 text-gray-400",children:[x.jsx("svg",{className:"w-12 h-12 mb-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),x.jsx("p",{className:"text-lg font-medium mb-2",children:"No Commit History"}),x.jsx("p",{className:"text-sm",children:"This repository has no commits yet."})]}):x.jsx("div",{className:"flex-1 overflow-y-auto pr-2",children:e.map(Z=>x.jsxs("div",{className:"mb-4",children:[x.jsxs("div",{className:`p-4 rounded-lg cursor-pointer transition-colors ${a===Z.hash?"bg-gray-700 border-l-4 border-indigo-500":"bg-gray-800 hover:bg-gray-750"}`,onClick:()=>j(Z.hash),children:[x.jsxs("div",{className:"flex justify-between items-start",children:[x.jsx("h3",{className:"text-white font-medium mb-2 flex-1 mr-2",children:Z.message}),x.jsx("span",{className:"text-xs font-mono text-gray-400 whitespace-nowrap",children:Z.short_hash})]}),x.jsxs("div",{className:"flex items-center text-xs text-gray-400 mt-2",children:[x.jsx("span",{children:Z.author}),x.jsx("span",{className:"mx-2",children:"•"}),x.jsx("span",{children:G(Z.date)})]}),x.jsxs("div",{className:"flex items-center mt-3 text-xs",children:[x.jsxs("span",{className:"flex items-center text-green-400 mr-3",children:[x.jsxs("span",{className:"font-mono mr-1",children:["+",Z.stats.insertions]}),x.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})})]}),x.jsxs("span",{className:"flex items-center text-red-400 mr-3",children:[x.jsxs("span",{className:"font-mono mr-1",children:["-",Z.stats.deletions]}),x.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 12H4"})})]}),x.jsxs("span",{className:"text-gray-400",children:[Z.stats.files_changed," file",Z.stats.files_changed!==1?"s":""," changed"]})]})]}),a===Z.hash&&c&&x.jsx("div",{className:"mt-2 pl-4 border-l-2 border-gray-700",children:x.jsxs("div",{className:"bg-gray-800 rounded-lg p-4",children:[x.jsxs("div",{className:"flex justify-between items-center mb-3",children:[x.jsx("h4",{className:"text-white text-sm font-medium",children:"Changed Files"}),u&&f&&!m&&x.jsxs("div",{className:"flex space-x-2",children:[x.jsx("button",{className:`px-2 py-1 text-xs rounded ${y==="split"?"bg-indigo-600 text-white":"bg-gray-700 text-gray-300 hover:bg-gray-600"}`,onClick:()=>{C("split"),setTimeout(W,50)},children:ie("splitView")}),x.jsx("button",{className:`px-2 py-1 text-xs rounded ${y==="unified"?"bg-indigo-600 text-white":"bg-gray-700 text-gray-300 hover:bg-gray-600"}`,onClick:()=>{C("unified"),setTimeout(W,50)},children:ie("unifiedView")})]})]}),x.jsx("div",{className:"space-y-2 mb-4",children:c.files.map((ne,oe)=>x.jsxs("div",{className:`text-sm py-2 px-3 rounded cursor-pointer ${u===ne.filename?"bg-gray-700 border-l-2 border-indigo-500":"hover:bg-gray-750"}`,onClick:()=>U(ne.filename),children:[x.jsxs("div",{className:"flex items-center",children:[x.jsx("span",{className:`w-1.5 h-1.5 rounded-full mr-2 ${ne.status==="added"?"bg-green-500":ne.status==="modified"?"bg-yellow-500":ne.status==="deleted"?"bg-red-500":"bg-blue-500"}`}),x.jsx("span",{className:`font-mono ${ne.status==="deleted"?"line-through text-gray-500":"text-gray-300"}`,children:ne.filename})]}),x.jsx("div",{className:"flex text-xs mt-1 ml-4",children:ne.changes&&x.jsxs(x.Fragment,{children:[ne.changes.insertions>0&&x.jsxs("span",{className:"text-green-400 mr-3",children:["+",ne.changes.insertions]}),ne.changes.deletions>0&&x.jsxs("span",{className:"text-red-400",children:["-",ne.changes.deletions]})]})})]},oe))}),m&&x.jsx("div",{className:"flex items-center justify-center py-10",children:x.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-indigo-500"})}),v&&x.jsxs("div",{className:"text-red-400 text-sm p-4 bg-red-900 bg-opacity-25 rounded-lg",children:[x.jsx("p",{className:"font-medium",children:"Error loading file diff:"}),x.jsx("p",{children:v})]}),u&&f&&!m&&!v&&X()]})})]},Z.hash))})]})},H2t=Object.freeze(Object.defineProperty({__proto__:null,default:$2t},Symbol.toStringTag,{value:"Module"}));U_.config({paths:{vs:"/monaco-editor/min/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});const j2t=({projectName:n,commits:e=[]})=>{const[t,i]=_.useState(!1),[r,s]=_.useState(null),[o,a]=_.useState(null),[l,c]=_.useState(null),[d,u]=_.useState(null),[h,f]=_.useState(null),[g,m]=_.useState(!1),[p,v]=_.useState(null),[b,y]=_.useState("split"),[C,S]=_.useState(null),[E,L]=_.useState({show:!1,commitHash:"",commitMessage:""}),[N,I]=_.useState(!1),[D,R]=_.useState(null),[O,M]=_.useState(null),P=_.useRef(null),B=_.useRef(null),H=_.useRef(null),W=_.useRef(null),V=_.useRef(null),[$,F]=_.useState("400px"),[j,q]=_.useState("100%"),U=(je,$e)=>{let De;return function(...xe){clearTimeout(De),De=setTimeout(()=>je(...xe),$e)}},K=_.useCallback(U(()=>{if(W.current&&V.current){const je=V.current.getBoundingClientRect(),$e=je.top,xe=window.innerHeight-$e-40,Te=Math.max(300,Math.min(xe,600));F(`${Te}px`),q(`${je.width}px`)}},100),[]);_.useEffect(()=>(K(),window.addEventListener("resize",K),()=>{window.removeEventListener("resize",K),P.current=null,B.current=null,H.current=null}),[K]);const Q=async je=>{try{c(null);const $e=await fetch(`/api/commits/${je}`);if(!$e.ok)throw new Error(`Error fetching commit details: ${$e.statusText}`);const De=await $e.json();c(De)}catch($e){console.error("Failed to fetch commit details:",$e)}},se=async(je,$e)=>{try{m(!0),v(null),f(null),P.current=null,B.current=null,H.current=null,await new Promise(Te=>setTimeout(Te,50));const De=await fetch(`/api/commits/${je}/file?file_path=${encodeURIComponent($e)}`);if(!De.ok)throw new Error(`Error fetching file diff: ${De.statusText}`);const xe=await De.json();f(xe),setTimeout(K,50)}catch(De){v(De instanceof Error?De.message:"An unknown error occurred"),console.error("Failed to fetch file diff:",De)}finally{m(!1)}},J=je=>{if(o===je)a(null),c(null),u(null),f(null),P.current=null,B.current=null,H.current=null,Se();else{a(je);const $e=e.find(De=>De.hash===je);$e&&$e.files?c($e):Q(je),u(null),f(null),Se()}},G=je=>{d===je?(u(null),f(null),P.current=null,B.current=null,H.current=null,Se()):(u(je),o&&se(o,je),Se())},X=_.useCallback(je=>{P.current=je},[]),Z=_.useCallback(je=>{B.current=je},[]),ne=_.useCallback(je=>{H.current=je},[]),oe=je=>{var xe;const $e=(xe=je.split(".").pop())==null?void 0:xe.toLowerCase();return{js:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",py:"python",java:"java",c:"c",cpp:"cpp",cs:"csharp",go:"go",rs:"rust",rb:"ruby",php:"php",html:"html",css:"css",scss:"scss",json:"json",md:"markdown",yml:"yaml",yaml:"yaml",xml:"xml",sh:"shell",bash:"shell",txt:"plaintext"}[$e||""]||"plaintext"},de=je=>{const $e=new Date(je);return new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format($e)},ye=()=>{if(!d||!h)return null;const je=oe(d),$e=`diff-${o}-${d}-${b}`,De=`before-${o}-${d}`,xe=`after-${o}-${d}`,Te={readOnly:!0,scrollBeyondLastLine:!1,minimap:{enabled:!1},lineNumbers:"on",wordWrap:"on",automaticLayout:!0,scrollbar:{vertical:"visible",horizontal:"visible",verticalScrollbarSize:14,horizontalScrollbarSize:14}},Me=({viewType:He})=>{const we=C===He;return x.jsx("button",{className:"ml-2 text-gray-400 hover:text-white transition-colors",onClick:Ve=>{Ve.stopPropagation(),S(we?null:He),setTimeout(K,50)},title:we?"恢复正常视图":"最大化视图",children:we?x.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5v-4m0 4h-4m4 0l-5-5"})}):x.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5v-4m0 4h-4m4 0l-5-5"})})})};return b==="unified"?x.jsxs("div",{ref:V,className:"bg-gray-900 rounded-lg border border-gray-700",style:{height:$,width:j,overflow:"hidden"},children:[x.jsxs("div",{className:"py-1 px-3 bg-gray-800 border-b border-gray-700 text-xs font-medium text-gray-300 flex justify-between items-center",children:[x.jsx("span",{children:ie("diffView")}),x.jsx(Me,{viewType:"diff"})]}),x.jsx(ou,{height:"calc(100% - 26px)",width:"100%",defaultLanguage:"diff",value:h.diff_content||"",theme:"vs-dark",onMount:ne,options:Te,loading:x.jsx("div",{className:"flex items-center justify-center h-full text-gray-400",children:"Loading diff view..."})},$e)]}):x.jsxs("div",{ref:V,className:"grid grid-cols-3 gap-2",style:{height:$,width:j},children:[(C===null||C==="before")&&x.jsxs("div",{className:`bg-gray-900 rounded-lg border border-gray-700 ${C==="before"?"col-span-3":""}`,style:{overflow:"hidden"},children:[x.jsxs("div",{className:"py-1 px-3 bg-gray-800 border-b border-gray-700 text-xs font-medium text-gray-300 flex justify-between items-center",children:[x.jsxs("span",{children:[ie("beforeChange")," (",h.file_status==="added"?ie("newFile"):d,")"]}),x.jsx(Me,{viewType:"before"})]}),x.jsx(ou,{height:"calc(100% - 26px)",width:"100%",defaultLanguage:je,value:h.before_content||"",theme:"vs-dark",onMount:X,options:Te,loading:x.jsx("div",{className:"flex items-center justify-center h-full text-gray-400",children:"Loading..."})},De)]}),(C===null||C==="after")&&x.jsxs("div",{className:`bg-gray-900 rounded-lg border border-gray-700 ${C==="after"?"col-span-3":""}`,style:{overflow:"hidden"},children:[x.jsxs("div",{className:"py-1 px-3 bg-gray-800 border-b border-gray-700 text-xs font-medium text-gray-300 flex justify-between items-center",children:[x.jsxs("span",{children:[ie("afterChange")," (",h.file_status==="deleted"?ie("fileDeleted"):d,")"]}),x.jsx(Me,{viewType:"after"})]}),x.jsx(ou,{height:"calc(100% - 26px)",width:"100%",defaultLanguage:je,value:h.after_content||"",theme:"vs-dark",onMount:Z,options:Te,loading:x.jsx("div",{className:"flex items-center justify-center h-full text-gray-400",children:"Loading..."})},xe)]}),(C===null||C==="diff")&&x.jsxs("div",{className:`bg-gray-900 rounded-lg border border-gray-700 ${C==="diff"?"col-span-3":""}`,style:{overflow:"hidden"},children:[x.jsxs("div",{className:"py-1 px-3 bg-gray-800 border-b border-gray-700 text-xs font-medium text-gray-300 flex justify-between items-center",children:[x.jsx("span",{children:ie("diffView")}),x.jsx(Me,{viewType:"diff"})]}),x.jsx(ou,{height:"calc(100% - 26px)",width:"100%",defaultLanguage:"diff",value:h.diff_content||"",theme:"vs-dark",onMount:ne,options:Te,loading:x.jsx("div",{className:"flex items-center justify-center h-full text-gray-400",children:"Loading..."})},`diff-inline-${o}-${d}`)]})]})},Se=()=>{S(null)},Ce=(je,$e)=>{je.stopPropagation(),L({show:!0,commitHash:$e.hash,commitMessage:$e.message})},Le=async()=>{try{I(!0),R(null),M(null);const je=await fetch(`/api/commits/${E.commitHash}/revert`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!je.ok){const De=await je.json();throw new Error(De.detail||"Failed to revert commit")}const $e=await je.json();M(`Successfully reverted commit. New revert commit: ${$e.new_commit_hash.substring(0,7)}`),L(De=>({...De,show:!1})),setTimeout(()=>{M(null)},5e3)}catch(je){R(je instanceof Error?je.message:"Failed to revert commit"),console.error("Failed to revert commit:",je)}finally{I(!1)}},We=()=>{L({show:!1,commitHash:"",commitMessage:""}),R(null)};return t&&e.length===0?x.jsx("div",{className:"flex items-center justify-center h-full",children:x.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-b-2 border-indigo-500"})}):r&&e.length===0?x.jsxs("div",{className:"flex flex-col items-center justify-center text-center p-4 text-red-400",children:[x.jsx("svg",{className:"w-12 h-12 mb-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),x.jsx("p",{className:"text-lg font-medium mb-2",children:"Error Loading Changes"}),x.jsx("p",{className:"text-sm",children:r})]}):x.jsxs("div",{className:"flex flex-col h-full",ref:W,children:[E.show&&x.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:x.jsxs("div",{className:"bg-gray-800 rounded-lg shadow-xl max-w-md w-full p-6 border border-gray-700",children:[x.jsx("h3",{className:"text-xl font-semibold text-white mb-4",children:"确认撤销提交"}),x.jsx("p",{className:"text-gray-300 mb-6",children:"您确定要撤销此提交吗?这将创建一个新的提交来撤销更改。"}),x.jsxs("div",{className:"bg-gray-900 p-3 rounded mb-6 border border-gray-700",children:[x.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"提交信息:"}),x.jsx("p",{className:"text-white",children:E.commitMessage}),x.jsxs("p",{className:"text-xs text-gray-500 mt-2",children:["Commit: ",E.commitHash.substring(0,7)]})]}),D&&x.jsx("div",{className:"bg-red-900 bg-opacity-25 text-red-400 p-3 rounded mb-4",children:D}),x.jsxs("div",{className:"flex justify-end space-x-3",children:[x.jsx("button",{className:"px-4 py-2 bg-gray-700 hover:bg-gray-600 text-gray-300 rounded transition-colors",onClick:We,disabled:N,children:"取消"}),x.jsx("button",{className:"px-4 py-2 bg-red-600 hover:bg-red-700 text-white rounded transition-colors flex items-center",onClick:Le,disabled:N,children:N?x.jsxs(x.Fragment,{children:[x.jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[x.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),x.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"处理中..."]}):x.jsx(x.Fragment,{children:"确认撤销"})})]})]})}),O&&x.jsx("div",{className:"fixed top-4 right-4 bg-green-800 text-green-100 p-4 rounded-lg shadow-lg z-50 animate-fade-in-out",children:x.jsxs("div",{className:"flex items-center",children:[x.jsx("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})}),x.jsx("span",{children:O})]})}),x.jsx("div",{className:"flex justify-between items-center mb-4",children:x.jsx("h2",{className:"text-lg font-medium text-white",children:ie("currentChangeTitle")})}),e.length===0?x.jsxs("div",{className:"flex flex-col items-center justify-center text-center p-6 text-gray-400",children:[x.jsx("svg",{className:"w-12 h-12 mb-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),x.jsx("p",{className:"text-lg font-medium mb-2",children:"No Changes Available"}),x.jsx("p",{className:"text-sm",children:"No changes found for the specified commits."})]}):x.jsx("div",{className:"flex-1 overflow-y-auto pr-2",children:e.map(je=>x.jsx("div",{className:"mb-4",children:x.jsxs("div",{className:`p-4 rounded-lg cursor-pointer transition-colors ${o===je.hash?"bg-gray-700 border-l-4 border-indigo-500":"bg-gray-800 hover:bg-gray-750"}`,onClick:()=>J(je.hash),children:[x.jsxs("div",{className:`${je.message.startsWith("<revert>")?"border border-red-500 rounded-lg p-2 relative":""}`,children:[je.message.startsWith("<revert>")&&x.jsx("div",{className:"absolute -top-2 -right-2 bg-red-500 text-white text-xs px-2 py-0.5 rounded-full",children:"已撤销"}),x.jsxs("div",{className:"flex justify-between items-start",children:[x.jsx("h3",{className:"font-medium mb-2 flex-1 mr-2 text-white",children:je.message}),x.jsxs("div",{className:"flex items-center",children:[!je.message.startsWith("<revert>")&&x.jsx("button",{className:"text-gray-400 hover:text-red-400 p-1 mr-1 transition-colors",onClick:$e=>Ce($e,je),title:"撤销此提交",children:x.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"})})}),x.jsx("span",{className:"text-xs font-mono text-gray-400 whitespace-nowrap",children:je.short_hash})]})]}),x.jsxs("div",{className:"flex items-center text-xs text-gray-400 mt-2",children:[x.jsx("span",{children:je.author}),x.jsx("span",{className:"mx-2",children:"•"}),x.jsx("span",{children:de(je.date)})]}),x.jsxs("div",{className:"flex items-center mt-3 text-xs",children:[x.jsxs("span",{className:"flex items-center text-green-400 mr-3",children:[x.jsxs("span",{className:"font-mono mr-1",children:["+",je.stats.insertions]}),x.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})})]}),x.jsxs("span",{className:"flex items-center text-red-400 mr-3",children:[x.jsxs("span",{className:"font-mono mr-1",children:["-",je.stats.deletions]}),x.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 12H4"})})]}),x.jsxs("span",{className:"text-gray-400",children:[je.stats.files_changed," file",je.stats.files_changed!==1?"s":""," changed"]})]})]}),o===je.hash&&l&&x.jsx("div",{className:"mt-2 pl-4 border-l-2 border-gray-700",children:x.jsxs("div",{className:"bg-gray-800 rounded-lg p-4",children:[x.jsxs("div",{className:"flex justify-between items-center mb-3",children:[x.jsx("h4",{className:"text-white text-sm font-medium",children:"Changed Files"}),d&&h&&!g&&x.jsxs("div",{className:"flex space-x-2",children:[x.jsx("button",{className:`px-2 py-1 text-xs rounded ${b==="split"?"bg-indigo-600 text-white":"bg-gray-700 text-gray-300 hover:bg-gray-600"}`,onClick:$e=>{$e.stopPropagation(),y("split"),setTimeout(K,50)},children:ie("splitView")}),x.jsx("button",{className:`px-2 py-1 text-xs rounded ${b==="unified"?"bg-indigo-600 text-white":"bg-gray-700 text-gray-300 hover:bg-gray-600"}`,onClick:$e=>{$e.stopPropagation(),y("unified"),setTimeout(K,50)},children:ie("unifiedView")})]})]}),x.jsx("div",{className:"space-y-2 mb-4",children:l.files.map(($e,De)=>x.jsxs("div",{className:`text-sm py-2 px-3 rounded cursor-pointer ${d===$e.filename?"bg-gray-700 border-l-2 border-indigo-500":"hover:bg-gray-750"}`,onClick:xe=>{xe.stopPropagation(),G($e.filename)},children:[x.jsxs("div",{className:"flex items-center",children:[x.jsx("span",{className:`w-1.5 h-1.5 rounded-full mr-2 ${$e.status==="added"?"bg-green-500":$e.status==="modified"?"bg-yellow-500":$e.status==="deleted"?"bg-red-500":"bg-blue-500"}`}),x.jsx("span",{className:`font-mono ${$e.status==="deleted"?"line-through text-gray-500":"text-gray-300"}`,children:$e.filename})]}),x.jsx("div",{className:"flex text-xs mt-1 ml-4",children:$e.changes&&x.jsxs(x.Fragment,{children:[$e.changes.insertions>0&&x.jsxs("span",{className:"text-green-400 mr-3",children:["+",$e.changes.insertions]}),$e.changes.deletions>0&&x.jsxs("span",{className:"text-red-400",children:["-",$e.changes.deletions]})]})})]},De))}),g&&x.jsx("div",{className:"flex items-center justify-center py-10",children:x.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-indigo-500"})}),p&&x.jsxs("div",{className:"text-red-400 text-sm p-4 bg-red-900 bg-opacity-25 rounded-lg",children:[x.jsx("p",{className:"font-medium",children:"Error loading file diff:"}),x.jsx("p",{children:p})]}),d&&h&&!g&&!p&&ye()]})})]})},je.hash))})]})},W2t=Object.freeze(Object.defineProperty({__proto__:null,default:j2t},Symbol.toStringTag,{value:"Module"}));var _K={exports:{}},yK,Dxe;function z2t(){if(Dxe)return yK;Dxe=1;var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return yK=n,yK}var CK,Rxe;function V2t(){if(Rxe)return CK;Rxe=1;var n=z2t();function e(){}function t(){}return t.resetWarningCache=e,CK=function(){function i(o,a,l,c,d,u){if(u!==n){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}i.isRequired=i;function r(){return i}var s={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:r,element:i,elementType:i,instanceOf:r,node:i,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:t,resetWarningCache:e};return s.PropTypes=s,s},CK}var Mxe;function U2t(){return Mxe||(Mxe=1,_K.exports=V2t()()),_K.exports}var q2t=U2t();const ms=il(q2t);var Vu=typeof window<"u"?window:null,Mle=Vu===null,iT=Mle?void 0:Vu.document,Rh="addEventListener",Mh="removeEventListener",SK="getBoundingClientRect",nI="_a",Ah="_b",Mp="_c",YA="horizontal",Oh=function(){return!1},G2t=Mle?"calc":["","-webkit-","-moz-","-o-"].filter(function(n){var e=iT.createElement("div");return e.style.cssText="width:"+n+"calc(9px)",!!e.style.length}).shift()+"calc",A3e=function(n){return typeof n=="string"||n instanceof String},Axe=function(n){if(A3e(n)){var e=iT.querySelector(n);if(!e)throw new Error("Selector "+n+" did not match a DOM element");return e}return n},Bl=function(n,e,t){var i=n[e];return i!==void 0?i:t},XA=function(n,e,t,i){if(e){if(i==="end")return 0;if(i==="center")return n/2}else if(t){if(i==="start")return 0;if(i==="center")return n/2}return n},K2t=function(n,e){var t=iT.createElement("div");return t.className="gutter gutter-"+e,t},Y2t=function(n,e,t){var i={};return A3e(e)?i[n]=e:i[n]=G2t+"("+e+"% - "+t+"px)",i},X2t=function(n,e){var t;return t={},t[n]=e+"px",t},Oxe=function(n,e){if(e===void 0&&(e={}),Mle)return{};var t=n,i,r,s,o,a,l;Array.from&&(t=Array.from(t));var c=Axe(t[0]),d=c.parentNode,u=getComputedStyle?getComputedStyle(d):null,h=u?u.flexDirection:null,f=Bl(e,"sizes")||t.map(function(){return 100/t.length}),g=Bl(e,"minSize",100),m=Array.isArray(g)?g:t.map(function(){return g}),p=Bl(e,"maxSize",1/0),v=Array.isArray(p)?p:t.map(function(){return p}),b=Bl(e,"expandToMin",!1),y=Bl(e,"gutterSize",10),C=Bl(e,"gutterAlign","center"),S=Bl(e,"snapOffset",30),E=Array.isArray(S)?S:t.map(function(){return S}),L=Bl(e,"dragInterval",1),N=Bl(e,"direction",YA),I=Bl(e,"cursor",N===YA?"col-resize":"row-resize"),D=Bl(e,"gutter",K2t),R=Bl(e,"elementStyle",Y2t),O=Bl(e,"gutterStyle",X2t);N===YA?(i="width",r="clientX",s="left",o="right",a="clientWidth"):N==="vertical"&&(i="height",r="clientY",s="top",o="bottom",a="clientHeight");function M(G,X,Z,ne){var oe=R(i,X,Z,ne);Object.keys(oe).forEach(function(de){G.style[de]=oe[de]})}function P(G,X,Z){var ne=O(i,X,Z);Object.keys(ne).forEach(function(oe){G.style[oe]=ne[oe]})}function B(){return l.map(function(G){return G.size})}function H(G){return"touches"in G?G.touches[0][r]:G[r]}function W(G){var X=l[this.a],Z=l[this.b],ne=X.size+Z.size;X.size=G/this.size*ne,Z.size=ne-G/this.size*ne,M(X.element,X.size,this[Ah],X.i),M(Z.element,Z.size,this[Mp],Z.i)}function V(G){var X,Z=l[this.a],ne=l[this.b];this.dragging&&(X=H(G)-this.start+(this[Ah]-this.dragOffset),L>1&&(X=Math.round(X/L)*L),X<=Z.minSize+Z.snapOffset+this[Ah]?X=Z.minSize+this[Ah]:X>=this.size-(ne.minSize+ne.snapOffset+this[Mp])&&(X=this.size-(ne.minSize+this[Mp])),X>=Z.maxSize-Z.snapOffset+this[Ah]?X=Z.maxSize+this[Ah]:X<=this.size-(ne.maxSize-ne.snapOffset+this[Mp])&&(X=this.size-(ne.maxSize+this[Mp])),W.call(this,X),Bl(e,"onDrag",Oh)(B()))}function $(){var G=l[this.a].element,X=l[this.b].element,Z=G[SK](),ne=X[SK]();this.size=Z[i]+ne[i]+this[Ah]+this[Mp],this.start=Z[s],this.end=Z[o]}function F(G){if(!getComputedStyle)return null;var X=getComputedStyle(G);if(!X)return null;var Z=G[a];return Z===0?null:(N===YA?Z-=parseFloat(X.paddingLeft)+parseFloat(X.paddingRight):Z-=parseFloat(X.paddingTop)+parseFloat(X.paddingBottom),Z)}function j(G){var X=F(d);if(X===null||m.reduce(function(de,ye){return de+ye},0)>X)return G;var Z=0,ne=[],oe=G.map(function(de,ye){var Se=X*de/100,Ce=XA(y,ye===0,ye===G.length-1,C),Le=m[ye]+Ce;return Se<Le?(Z+=Le-Se,ne.push(0),Le):(ne.push(Se-Le),Se)});return Z===0?G:oe.map(function(de,ye){var Se=de;if(Z>0&&ne[ye]-Z>0){var Ce=Math.min(Z,ne[ye]-Z);Z-=Ce,Se=de-Ce}return Se/X*100})}function q(){var G=this,X=l[G.a].element,Z=l[G.b].element;G.dragging&&Bl(e,"onDragEnd",Oh)(B()),G.dragging=!1,Vu[Mh]("mouseup",G.stop),Vu[Mh]("touchend",G.stop),Vu[Mh]("touchcancel",G.stop),Vu[Mh]("mousemove",G.move),Vu[Mh]("touchmove",G.move),G.stop=null,G.move=null,X[Mh]("selectstart",Oh),X[Mh]("dragstart",Oh),Z[Mh]("selectstart",Oh),Z[Mh]("dragstart",Oh),X.style.userSelect="",X.style.webkitUserSelect="",X.style.MozUserSelect="",X.style.pointerEvents="",Z.style.userSelect="",Z.style.webkitUserSelect="",Z.style.MozUserSelect="",Z.style.pointerEvents="",G.gutter.style.cursor="",G.parent.style.cursor="",iT.body.style.cursor=""}function U(G){if(!("button"in G&&G.button!==0)){var X=this,Z=l[X.a].element,ne=l[X.b].element;X.dragging||Bl(e,"onDragStart",Oh)(B()),G.preventDefault(),X.dragging=!0,X.move=V.bind(X),X.stop=q.bind(X),Vu[Rh]("mouseup",X.stop),Vu[Rh]("touchend",X.stop),Vu[Rh]("touchcancel",X.stop),Vu[Rh]("mousemove",X.move),Vu[Rh]("touchmove",X.move),Z[Rh]("selectstart",Oh),Z[Rh]("dragstart",Oh),ne[Rh]("selectstart",Oh),ne[Rh]("dragstart",Oh),Z.style.userSelect="none",Z.style.webkitUserSelect="none",Z.style.MozUserSelect="none",Z.style.pointerEvents="none",ne.style.userSelect="none",ne.style.webkitUserSelect="none",ne.style.MozUserSelect="none",ne.style.pointerEvents="none",X.gutter.style.cursor=I,X.parent.style.cursor=I,iT.body.style.cursor=I,$.call(X),X.dragOffset=H(G)-X.end}}f=j(f);var K=[];l=t.map(function(G,X){var Z={element:Axe(G),size:f[X],minSize:m[X],maxSize:v[X],snapOffset:E[X],i:X},ne;if(X>0&&(ne={a:X-1,b:X,dragging:!1,direction:N,parent:d},ne[Ah]=XA(y,X-1===0,!1,C),ne[Mp]=XA(y,!1,X===t.length-1,C),h==="row-reverse"||h==="column-reverse")){var oe=ne.a;ne.a=ne.b,ne.b=oe}if(X>0){var de=D(X,N,Z.element);P(de,y,X),ne[nI]=U.bind(ne),de[Rh]("mousedown",ne[nI]),de[Rh]("touchstart",ne[nI]),d.insertBefore(de,Z.element),ne.gutter=de}return M(Z.element,Z.size,XA(y,X===0,X===t.length-1,C),X),X>0&&K.push(ne),Z});function Q(G){var X=G.i===K.length,Z=X?K[G.i-1]:K[G.i];$.call(Z);var ne=X?Z.size-G.minSize-Z[Mp]:G.minSize+Z[Ah];W.call(Z,ne)}l.forEach(function(G){var X=G.element[SK]()[i];X<G.minSize&&(b?Q(G):G.minSize=X)});function se(G){var X=j(G);X.forEach(function(Z,ne){if(ne>0){var oe=K[ne-1],de=l[oe.a],ye=l[oe.b];de.size=X[ne-1],ye.size=Z,M(de.element,de.size,oe[Ah],de.i),M(ye.element,ye.size,oe[Mp],ye.i)}})}function J(G,X){K.forEach(function(Z){if(X!==!0?Z.parent.removeChild(Z.gutter):(Z.gutter[Mh]("mousedown",Z[nI]),Z.gutter[Mh]("touchstart",Z[nI])),G!==!0){var ne=R(i,Z.a.size,Z[Ah]);Object.keys(ne).forEach(function(oe){l[Z.a].element.style[oe]="",l[Z.b].element.style[oe]=""})}})}return{setSizes:se,getSizes:B,collapse:function(X){Q(l[X])},destroy:J,parent:d,pairs:K}};function wK(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)===-1&&(t[i]=n[i]);return t}var eC=function(n){function e(){n.apply(this,arguments)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.componentDidMount=function(){var i=this.props;i.children;var r=i.gutter,s=wK(i,["children","gutter"]),o=s;o.gutter=function(a,l){var c;return r?c=r(a,l):(c=document.createElement("div"),c.className="gutter gutter-"+l),c.__isSplitGutter=!0,c},this.split=Oxe(this.parent.children,o)},e.prototype.componentDidUpdate=function(i){var r=this,s=this.props;s.children;var o=s.minSize,a=s.sizes,l=s.collapsed,c=wK(s,["children","minSize","sizes","collapsed"]),d=c,u=i.minSize,h=i.sizes,f=i.collapsed,g=["maxSize","expandToMin","gutterSize","gutterAlign","snapOffset","dragInterval","direction","cursor"],m=g.map(function(b){return r.props[b]!==i[b]}).reduce(function(b,y){return b||y},!1);if(Array.isArray(o)&&Array.isArray(u)){var p=!1;o.forEach(function(b,y){p=p||b!==u[y]}),m=m||p}else Array.isArray(o)||Array.isArray(u)?m=!0:m=m||o!==u;if(m)d.minSize=o,d.sizes=a||this.split.getSizes(),this.split.destroy(!0,!0),d.gutter=function(b,y,C){return C.previousSibling},this.split=Oxe(Array.from(this.parent.children).filter(function(b){return!b.__isSplitGutter}),d);else if(a){var v=!1;a.forEach(function(b,y){v=v||b!==h[y]}),v&&this.split.setSizes(this.props.sizes)}Number.isInteger(l)&&(l!==f||m)&&this.split.collapse(l)},e.prototype.componentWillUnmount=function(){this.split.destroy(),delete this.split},e.prototype.render=function(){var i=this,r=this.props;r.sizes,r.minSize,r.maxSize,r.expandToMin,r.gutterSize,r.gutterAlign,r.snapOffset,r.dragInterval,r.direction,r.cursor,r.gutter,r.elementStyle,r.gutterStyle,r.onDrag,r.onDragStart,r.onDragEnd,r.collapsed;var s=r.children,o=wK(r,["sizes","minSize","maxSize","expandToMin","gutterSize","gutterAlign","snapOffset","dragInterval","direction","cursor","gutter","elementStyle","gutterStyle","onDrag","onDragStart","onDragEnd","collapsed","children"]),a=o;return ke.createElement("div",Object.assign({},{ref:function(l){i.parent=l}},a),s)},e}(ke.Component);eC.propTypes={sizes:ms.arrayOf(ms.number),minSize:ms.oneOfType([ms.number,ms.arrayOf(ms.number)]),maxSize:ms.oneOfType([ms.number,ms.arrayOf(ms.number)]),expandToMin:ms.bool,gutterSize:ms.number,gutterAlign:ms.string,snapOffset:ms.oneOfType([ms.number,ms.arrayOf(ms.number)]),dragInterval:ms.number,direction:ms.string,cursor:ms.string,gutter:ms.func,elementStyle:ms.func,gutterStyle:ms.func,onDrag:ms.func,onDragStart:ms.func,onDragEnd:ms.func,collapsed:ms.number,children:ms.arrayOf(ms.element)};eC.defaultProps={sizes:void 0,minSize:void 0,maxSize:void 0,expandToMin:void 0,gutterSize:void 0,gutterAlign:void 0,snapOffset:void 0,dragInterval:void 0,direction:void 0,cursor:void 0,gutter:void 0,elementStyle:void 0,gutterStyle:void 0,onDrag:void 0,onDragStart:void 0,onDragEnd:void 0,collapsed:void 0,children:void 0};const al=[];for(let n=0;n<256;++n)al.push((n+256).toString(16).slice(1));function Z2t(n,e=0){return(al[n[e+0]]+al[n[e+1]]+al[n[e+2]]+al[n[e+3]]+"-"+al[n[e+4]]+al[n[e+5]]+"-"+al[n[e+6]]+al[n[e+7]]+"-"+al[n[e+8]]+al[n[e+9]]+"-"+al[n[e+10]]+al[n[e+11]]+al[n[e+12]]+al[n[e+13]]+al[n[e+14]]+al[n[e+15]]).toLowerCase()}let xK;const Q2t=new Uint8Array(16);function J2t(){if(!xK){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");xK=crypto.getRandomValues.bind(crypto)}return xK(Q2t)}const eNt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Pxe={randomUUID:eNt};function g3(n,e,t){var r;if(Pxe.randomUUID&&!n)return Pxe.randomUUID();n=n||{};const i=n.random??((r=n.rng)==null?void 0:r.call(n))??J2t();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,Z2t(i)}const tNt=({chatListName:n,chatLists:e,setChatListName:t,loadChatList:i,setCurrentSessionName:r,showNewChatModal:s,deleteChatList:o,getChatTitle:a,renameChatList:l=async()=>!1})=>{const[c,d]=_.useState(!1),[u,h]=_.useState(null),[f,g]=_.useState(""),m=_.useRef(null),p=10,v=100,b=async I=>{fs.confirm({title:"确认删除",content:`确定要删除对话 "${I}" 吗?此操作不可撤销。`,okText:"删除",okType:"danger",cancelText:"取消",onOk:async()=>{await o(I),pt.success("对话已删除")}})},y=(I,D)=>{D&&D.stopPropagation(),h(I),g(I),setTimeout(()=>{var R;(R=m.current)==null||R.focus()},0)},C=I=>{I&&I.stopPropagation(),h(null)},S=async(I,D)=>{if(D&&D.stopPropagation(),!f.trim()){pt.error("对话名称不能为空");return}if(f===I){h(null);return}if(e.includes(f)){pt.error("已存在同名对话");return}await l(I,f)?(pt.success("对话已重命名"),n===I&&(t(f),await r(f))):pt.error("重命名失败"),h(null)},E=c?e.slice(0,v):e.slice(0,p),L=e.length>p,N=[{key:"new-chat",label:x.jsxs("div",{className:"flex items-center w-full group text-white font-medium",children:[x.jsx(xa,{className:"mr-1",style:{fontSize:"12px"}}),x.jsx("span",{children:"新建对话"})]})},...E.length>0?[{type:"divider"}]:[],...E.map(I=>({key:I,label:x.jsx("div",{className:`flex justify-between items-center w-full group ${n===I?"bg-indigo-700/40 rounded-sm":""}`,onClick:D=>{u===I&&D.stopPropagation()},children:u===I?x.jsxs("div",{className:"flex items-center w-full",onClick:D=>D.stopPropagation(),children:[x.jsx(ei,{ref:m,value:f,onChange:D=>g(D.target.value),onPressEnter:()=>S(I),size:"small",className:"mr-1 text-black",autoFocus:!0}),x.jsx(sn,{type:"text",size:"small",className:"text-green-500 p-0 flex items-center justify-center",icon:x.jsx(Tb,{}),onClick:D=>S(I,D)}),x.jsx(sn,{type:"text",size:"small",className:"text-red-500 p-0 flex items-center justify-center",icon:x.jsx($f,{}),onClick:C})]}):x.jsxs(x.Fragment,{children:[x.jsx("span",{className:`truncate max-w-[150px] ${n===I?"text-white font-medium":"text-gray-200"}`,children:I}),x.jsxs("div",{className:"flex opacity-0 group-hover:opacity-100 transition-opacity",children:[x.jsx(sn,{type:"text",size:"small",className:"text-white p-0 mx-1 flex items-center justify-center",icon:x.jsx(kd,{}),onClick:D=>y(I,D)}),x.jsx(sn,{type:"text",size:"small",className:"text-white p-0 flex items-center justify-center",icon:x.jsx(Jl,{}),onClick:D=>{D.stopPropagation(),b(I)}})]})]})})})),...L&&!c?[{key:"show-more",label:x.jsxs("div",{className:"flex items-center justify-center w-full text-gray-300 hover:text-white py-1 border-t border-gray-700 mt-1",children:[x.jsx(oR,{className:"mr-1",style:{fontSize:"10px"}}),x.jsxs("span",{children:["显示更多 (",Math.min(e.length-p,v-p),")"]})]})}]:[],...c&&L?[{key:"show-less",label:x.jsx("div",{className:"flex items-center justify-center w-full text-gray-300 hover:text-white py-1 border-t border-gray-700 mt-1",children:x.jsx("span",{children:"收起"})})}]:[]];return x.jsx(xk,{menu:{items:N,onClick:async({key:I})=>{I==="new-chat"?s():I==="show-more"?d(!0):I==="show-less"?d(!1):(t(I),await i(I),await r(I))},style:{backgroundColor:"#1F2937",borderColor:"#4B5563",color:"#FFFFFF"}},trigger:["click"],placement:"bottomRight",arrow:{pointAtCenter:!0},children:x.jsx(rr,{title:n||a(),children:x.jsx(sn,{icon:x.jsx(SQ,{style:{fontSize:"12px"}}),size:"small",className:`flex items-center justify-center text-gray-300 border-gray-600 ${n?"bg-indigo-600 hover:bg-indigo-700 border-indigo-500":"bg-gray-700 hover:bg-gray-600"} px-1 py-0 h-6 w-6`})})})},nNt=async n=>{const e=new FormData;e.append("file",n);const t=await fetch("/api/upload/image",{method:"POST",body:e});if(!t.ok)throw new Error("Upload failed");return await t.json()};function Gd(n,e=0){return n[n.length-(1+e)]}function iNt(n){if(n.length===0)throw new Error("Invalid tail call");return[n.slice(0,n.length-1),n[n.length-1]]}function zr(n,e,t=(i,r)=>i===r){if(n===e)return!0;if(!n||!e||n.length!==e.length)return!1;for(let i=0,r=n.length;i<r;i++)if(!t(n[i],e[i]))return!1;return!0}function rNt(n,e){const t=n.length-1;e<t&&(n[e]=n[t]),n.pop()}function rT(n,e,t){return sNt(n.length,i=>t(n[i],e))}function sNt(n,e){let t=0,i=n-1;for(;t<=i;){const r=(t+i)/2|0,s=e(r);if(s<0)t=r+1;else if(s>0)i=r-1;else return r}return-(t+1)}function zQ(n,e,t){if(n=n|0,n>=e.length)throw new TypeError("invalid index");const i=e[Math.floor(e.length*Math.random())],r=[],s=[],o=[];for(const a of e){const l=t(a,i);l<0?r.push(a):l>0?s.push(a):o.push(a)}return n<r.length?zQ(n,r,t):n<r.length+o.length?o[0]:zQ(n-(r.length+o.length),s,t)}function Fxe(n,e){const t=[];let i;for(const r of n.slice(0).sort(e))!i||e(i[0],r)!==0?(i=[r],t.push(i)):i.push(r);return t}function*Ale(n,e){let t,i;for(const r of n)i!==void 0&&e(i,r)?t.push(r):(t&&(yield t),t=[r]),i=r;t&&(yield t)}function O3e(n,e){for(let t=0;t<=n.length;t++)e(t===0?void 0:n[t-1],t===n.length?void 0:n[t])}function oNt(n,e){for(let t=0;t<n.length;t++)e(t===0?void 0:n[t-1],n[t],t+1===n.length?void 0:n[t+1])}function hh(n){return n.filter(e=>!!e)}function Bxe(n){let e=0;for(let t=0;t<n.length;t++)n[t]&&(n[e]=n[t],e+=1);n.length=e}function P3e(n){return!Array.isArray(n)||n.length===0}function Xa(n){return Array.isArray(n)&&n.length>0}function zm(n,e=t=>t){const t=new Set;return n.filter(i=>{const r=e(i);return t.has(r)?!1:(t.add(r),!0)})}function Ole(n,e){return n.length>0?n[0]:e}function Hl(n,e){let t=typeof e=="number"?n:0;typeof e=="number"?t=n:(t=0,e=n);const i=[];if(t<=e)for(let r=t;r<e;r++)i.push(r);else for(let r=t;r>e;r--)i.push(r);return i}function C8(n,e,t){const i=n.slice(0,e),r=n.slice(e);return i.concat(t,r)}function EK(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.unshift(e))}function ZA(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.push(e))}function VQ(n,e){for(const t of e)n.push(t)}function Ple(n){return Array.isArray(n)?n:[n]}function aNt(n,e,t){const i=F3e(n,e),r=n.length,s=t.length;n.length=r+s;for(let o=r-1;o>=i;o--)n[o+s]=n[o];for(let o=0;o<s;o++)n[o+i]=t[o]}function $xe(n,e,t,i){const r=F3e(n,e);let s=n.splice(r,t);return s===void 0&&(s=[]),aNt(n,r,i),s}function F3e(n,e){return e<0?Math.max(e+n.length,0):Math.min(e,n.length)}var sT;(function(n){function e(s){return s<0}n.isLessThan=e;function t(s){return s<=0}n.isLessThanOrEqual=t;function i(s){return s>0}n.isGreaterThan=i;function r(s){return s===0}n.isNeitherLessOrGreaterThan=r,n.greaterThan=1,n.lessThan=-1,n.neitherLessOrGreaterThan=0})(sT||(sT={}));function bl(n,e){return(t,i)=>e(n(t),n(i))}function lNt(...n){return(e,t)=>{for(const i of n){const r=i(e,t);if(!sT.isNeitherLessOrGreaterThan(r))return r}return sT.neitherLessOrGreaterThan}}const lh=(n,e)=>n-e,cNt=(n,e)=>lh(n?1:0,e?1:0);function B3e(n){return(e,t)=>-n(e,t)}class Vm{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t<this.items.length&&e(this.items[t]);)t++;const i=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,i}takeFromEndWhile(e){let t=this.lastIdx;for(;t>=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}const tx=class tx{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new tx(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new tx(t=>this.iterate(i=>t(e(i))))}findLast(e){let t;return this.iterate(i=>(e(i)&&(t=i),!0)),t}findLastMaxBy(e){let t,i=!0;return this.iterate(r=>((i||sT.isGreaterThan(e(r,t)))&&(i=!1,t=r),!0)),t}};tx.empty=new tx(e=>{});let Dy=tx;class p3{constructor(e){this._indexMap=e}static createSortPermutation(e,t){const i=Array.from(e.keys()).sort((r,s)=>t(e[r],e[s]));return new p3(i)}apply(e){return e.map((t,i)=>e[this._indexMap[i]])}inverse(){const e=this._indexMap.slice();for(let t=0;t<this._indexMap.length;t++)e[this._indexMap[t]]=t;return new p3(e)}}function Xl(n){return typeof n=="string"}function Do(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&!(n instanceof RegExp)&&!(n instanceof Date)}function dNt(n){const e=Object.getPrototypeOf(Uint8Array);return typeof n=="object"&&n instanceof e}function m_(n){return typeof n=="number"&&!isNaN(n)}function Hxe(n){return!!n&&typeof n[Symbol.iterator]=="function"}function $3e(n){return n===!0||n===!1}function Ya(n){return typeof n>"u"}function Hg(n){return!fd(n)}function fd(n){return Ya(n)||n===null}function Mi(n,e){if(!n)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function gb(n){if(fd(n))throw new Error("Assertion Failed: argument is undefined or null");return n}function oT(n){return typeof n=="function"}function uNt(n,e){const t=Math.min(n.length,e.length);for(let i=0;i<t;i++)hNt(n[i],e[i])}function hNt(n,e){if(Xl(e)){if(typeof n!==e)throw new Error(`argument does not match constraint: typeof ${e}`)}else if(oT(e)){try{if(n instanceof e)return}catch{}if(!fd(n)&&n.constructor===e||e.length===1&&e.call(void 0,n)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function nm(n){if(!n||typeof n!="object"||n instanceof RegExp)return n;const e=Array.isArray(n)?[]:{};return Object.entries(n).forEach(([t,i])=>{e[t]=i&&typeof i=="object"?nm(i):i}),e}function fNt(n){if(!n||typeof n!="object")return n;const e=[n];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(H3e.call(t,i)){const r=t[i];typeof r=="object"&&!Object.isFrozen(r)&&!dNt(r)&&e.push(r)}}return n}const H3e=Object.prototype.hasOwnProperty;function j3e(n,e){return UQ(n,e,new Set)}function UQ(n,e,t){if(fd(n))return n;const i=e(n);if(typeof i<"u")return i;if(Array.isArray(n)){const r=[];for(const s of n)r.push(UQ(s,e,t));return r}if(Do(n)){if(t.has(n))throw new Error("Cannot clone recursive data-structure");t.add(n);const r={};for(const s in n)H3e.call(n,s)&&(r[s]=UQ(n[s],e,t));return t.delete(n),r}return n}function S8(n,e,t=!0){return Do(n)?(Do(e)&&Object.keys(e).forEach(i=>{i in n?t&&(Do(n[i])&&Do(e[i])?S8(n[i],e[i],t):n[i]=e[i]):n[i]=e[i]}),n):e}function Ic(n,e){if(n===e)return!0;if(n==null||e===null||e===void 0||typeof n!=typeof e||typeof n!="object"||Array.isArray(n)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(n)){if(n.length!==e.length)return!1;for(t=0;t<n.length;t++)if(!Ic(n[t],e[t]))return!1}else{const r=[];for(i in n)r.push(i);r.sort();const s=[];for(i in e)s.push(i);if(s.sort(),!Ic(r,s))return!1;for(t=0;t<r.length;t++)if(!Ic(n[r[t]],e[r[t]]))return!1}return!0}function gNt(n){let e=[];for(;Object.prototype!==n;)e=e.concat(Object.getOwnPropertyNames(n)),n=Object.getPrototypeOf(n);return e}function qQ(n){const e=[];for(const t of gNt(n))typeof n[t]=="function"&&e.push(t);return e}function pNt(n,e){const t=r=>function(){const s=Array.prototype.slice.call(arguments,0);return e(r,s)},i={};for(const r of n)i[r]=t(r);return i}function W3e(){return globalThis._VSCODE_NLS_MESSAGES}function Fle(){return globalThis._VSCODE_NLS_LANGUAGE}const mNt=Fle()==="pseudo"||typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function m3(n,e){let t;return e.length===0?t=n:t=n.replace(/\{(\d+)\}/g,(i,r)=>{const s=r[0],o=e[s];let a=i;return typeof o=="string"?a=o:(typeof o=="number"||typeof o=="boolean"||o===void 0||o===null)&&(a=String(o)),a}),mNt&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function T(n,e,...t){return m3(typeof n=="number"?z3e(n,e):e,t)}function z3e(n,e){var i;const t=(i=W3e())==null?void 0:i[n];if(typeof t!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${n} !!!`)}return t}function wn(n,e,...t){let i;typeof n=="number"?i=z3e(n,e):i=e;const r=m3(i,t);return{value:r,original:e===i?r:m3(e,t)}}const Nw="en";let v3=!1,b3=!1,UP=!1,V3e=!1,Ble=!1,$le=!1,U3e=!1,QA,qP=Nw,jxe=Nw,vNt,Fh;const Tm=globalThis;let ll;var wDe;typeof Tm.vscode<"u"&&typeof Tm.vscode.process<"u"?ll=Tm.vscode.process:typeof process<"u"&&typeof((wDe=process==null?void 0:process.versions)==null?void 0:wDe.node)=="string"&&(ll=process);var xDe;const bNt=typeof((xDe=ll==null?void 0:ll.versions)==null?void 0:xDe.electron)=="string",_Nt=bNt&&(ll==null?void 0:ll.type)==="renderer";var EDe;if(typeof ll=="object"){v3=ll.platform==="win32",b3=ll.platform==="darwin",UP=ll.platform==="linux",UP&&ll.env.SNAP&&ll.env.SNAP_REVISION,ll.env.CI||ll.env.BUILD_ARTIFACTSTAGINGDIRECTORY,QA=Nw,qP=Nw;const n=ll.env.VSCODE_NLS_CONFIG;if(n)try{const e=JSON.parse(n);QA=e.userLocale,jxe=e.osLocale,qP=e.resolvedLanguage||Nw,vNt=(EDe=e.languagePack)==null?void 0:EDe.translationsConfigFile}catch{}V3e=!0}else typeof navigator=="object"&&!_Nt?(Fh=navigator.userAgent,v3=Fh.indexOf("Windows")>=0,b3=Fh.indexOf("Macintosh")>=0,$le=(Fh.indexOf("Macintosh")>=0||Fh.indexOf("iPad")>=0||Fh.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,UP=Fh.indexOf("Linux")>=0,U3e=(Fh==null?void 0:Fh.indexOf("Mobi"))>=0,Ble=!0,qP=Fle()||Nw,QA=navigator.language.toLowerCase(),jxe=QA):console.error("Unable to resolve platform.");const ua=v3,ci=b3,Sl=UP,Qg=V3e,UC=Ble,yNt=Ble&&typeof Tm.importScripts=="function",CNt=yNt?Tm.origin:void 0,If=$le,q3e=U3e,Jg=Fh,SNt=qP,wNt=typeof Tm.postMessage=="function"&&!Tm.importScripts,G3e=(()=>{if(wNt){const n=[];Tm.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,r=n.length;i<r;i++){const s=n[i];if(s.id===t.data.vscodeScheduleAsyncWork){n.splice(i,1),s.callback();return}}});let e=0;return t=>{const i=++e;n.push({id:i,callback:t}),Tm.postMessage({vscodeScheduleAsyncWork:i},"*")}}return n=>setTimeout(n)})(),Lc=b3||$le?2:v3?1:3;let Wxe=!0,zxe=!1;function K3e(){if(!zxe){zxe=!0;const n=new Uint8Array(2);n[0]=1,n[1]=2,Wxe=new Uint16Array(n.buffer)[0]===513}return Wxe}const Y3e=!!(Jg&&Jg.indexOf("Chrome")>=0),xNt=!!(Jg&&Jg.indexOf("Firefox")>=0),ENt=!!(!Y3e&&Jg&&Jg.indexOf("Safari")>=0),kNt=!!(Jg&&Jg.indexOf("Edg/")>=0),LNt=!!(Jg&&Jg.indexOf("Android")>=0),ya={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var _i;(function(n){function e(C){return C&&typeof C=="object"&&typeof C[Symbol.iterator]=="function"}n.is=e;const t=Object.freeze([]);function i(){return t}n.empty=i;function*r(C){yield C}n.single=r;function s(C){return e(C)?C:r(C)}n.wrap=s;function o(C){return C||t}n.from=o;function*a(C){for(let S=C.length-1;S>=0;S--)yield C[S]}n.reverse=a;function l(C){return!C||C[Symbol.iterator]().next().done===!0}n.isEmpty=l;function c(C){return C[Symbol.iterator]().next().value}n.first=c;function d(C,S){let E=0;for(const L of C)if(S(L,E++))return!0;return!1}n.some=d;function u(C,S){for(const E of C)if(S(E))return E}n.find=u;function*h(C,S){for(const E of C)S(E)&&(yield E)}n.filter=h;function*f(C,S){let E=0;for(const L of C)yield S(L,E++)}n.map=f;function*g(C,S){let E=0;for(const L of C)yield*S(L,E++)}n.flatMap=g;function*m(...C){for(const S of C)yield*S}n.concat=m;function p(C,S,E){let L=E;for(const N of C)L=S(L,N);return L}n.reduce=p;function*v(C,S,E=C.length){for(S<0&&(S+=C.length),E<0?E+=C.length:E>C.length&&(E=C.length);S<E;S++)yield C[S]}n.slice=v;function b(C,S=Number.POSITIVE_INFINITY){const E=[];if(S===0)return[E,C];const L=C[Symbol.iterator]();for(let N=0;N<S;N++){const I=L.next();if(I.done)return[E,n.empty()];E.push(I.value)}return[E,{[Symbol.iterator](){return L}}]}n.consume=b;async function y(C){const S=[];for await(const E of C)S.push(E);return Promise.resolve(S)}n.asyncToArray=y})(_i||(_i={}));var Sm;let fo=(Sm=class{constructor(e){this.element=e,this.next=Sm.Undefined,this.prev=Sm.Undefined}},Sm.Undefined=new Sm(void 0),Sm);class hl{constructor(){this._first=fo.Undefined,this._last=fo.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===fo.Undefined}clear(){let e=this._first;for(;e!==fo.Undefined;){const t=e.next;e.prev=fo.Undefined,e.next=fo.Undefined,e=t}this._first=fo.Undefined,this._last=fo.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new fo(e);if(this._first===fo.Undefined)this._first=i,this._last=i;else if(t){const s=this._last;this._last=i,i.prev=s,s.next=i}else{const s=this._first;this._first=i,i.next=s,s.prev=i}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(i))}}shift(){if(this._first!==fo.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==fo.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==fo.Undefined&&e.next!==fo.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===fo.Undefined&&e.next===fo.Undefined?(this._first=fo.Undefined,this._last=fo.Undefined):e.next===fo.Undefined?(this._last=this._last.prev,this._last.next=fo.Undefined):e.prev===fo.Undefined&&(this._first=this._first.next,this._first.prev=fo.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==fo.Undefined;)yield e.element,e=e.next}}const _3="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function INt(n=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of _3)n.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const Hle=INt();function jle(n){let e=Hle;if(n&&n instanceof RegExp)if(n.global)e=n;else{let t="g";n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.unicode&&(t+="u"),e=new RegExp(n.source,t)}return e.lastIndex=0,e}const X3e=new hl;X3e.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function aT(n,e,t,i,r){if(e=jle(e),r||(r=_i.first(X3e)),t.length>r.maxLen){let c=n-r.maxLen/2;return c<0?c=0:i+=c,t=t.substring(c,n+r.maxLen/2),aT(n,e,t,i,r)}const s=Date.now(),o=n-1-i;let a=-1,l=null;for(let c=1;!(Date.now()-s>=r.timeBudget);c++){const d=o-r.windowSize*c;e.lastIndex=Math.max(0,d);const u=NNt(e,t,o,a);if(!u&&l||(l=u,d<=0))break;a=d}if(l){const c={word:l[0],startColumn:i+1+l.index,endColumn:i+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function NNt(n,e,t,i){let r;for(;r=n.exec(e);){const s=r.index||0;if(s<=t&&n.lastIndex>=t)return r;if(i>0&&s>i)return null}return null}const lg=8;class Z3e{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class Q3e{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class Fr{constructor(e,t,i,r){this.id=e,this.name=t,this.defaultValue=i,this.schema=r}applyUpdate(e,t){return w8(e,t)}compute(e,t,i){return i}}class T2{constructor(e,t){this.newValue=e,this.didChange=t}}function w8(n,e){if(typeof n!="object"||typeof e!="object"||!n||!e)return new T2(e,n!==e);if(Array.isArray(n)||Array.isArray(e)){const i=Array.isArray(n)&&Array.isArray(e)&&zr(n,e);return new T2(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const r=w8(n[i],e[i]);r.didChange&&(n[i]=r.newValue,t=!0)}return new T2(n,t)}class wR{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return w8(e,t)}validate(e){return this.defaultValue}}class Dk{constructor(e,t,i,r){this.id=e,this.name=t,this.defaultValue=i,this.schema=r}applyUpdate(e,t){return w8(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}}function en(n,e){return typeof n>"u"?e:n==="false"?!1:!!n}class Di extends Dk{constructor(e,t,i,r=void 0){typeof r<"u"&&(r.type="boolean",r.default=i),super(e,t,i,r)}validate(e){return en(e,this.defaultValue)}}function A0(n,e,t,i){if(typeof n>"u")return e;let r=parseInt(n,10);return isNaN(r)?e:(r=Math.max(t,r),r=Math.min(i,r),r|0)}class mr extends Dk{static clampedInt(e,t,i,r){return A0(e,t,i,r)}constructor(e,t,i,r,s,o=void 0){typeof o<"u"&&(o.type="integer",o.default=i,o.minimum=r,o.maximum=s),super(e,t,i,o),this.minimum=r,this.maximum=s}validate(e){return mr.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function TNt(n,e,t,i){if(typeof n>"u")return e;const r=vd.float(n,e);return vd.clamp(r,t,i)}class vd extends Dk{static clamp(e,t,i){return e<t?t:e>i?i:e}static float(e,t){if(typeof e=="number")return e;if(typeof e>"u")return t;const i=parseFloat(e);return isNaN(i)?t:i}constructor(e,t,i,r,s){typeof s<"u"&&(s.type="number",s.default=i),super(e,t,i,s),this.validationFn=r}validate(e){return this.validationFn(vd.float(e,this.defaultValue))}}class Ga extends Dk{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,i,r=void 0){typeof r<"u"&&(r.type="string",r.default=i),super(e,t,i,r)}validate(e){return Ga.string(e,this.defaultValue)}}function ls(n,e,t,i){return typeof n!="string"?e:i&&n in i?i[n]:t.indexOf(n)===-1?e:n}class os extends Dk{constructor(e,t,i,r,s=void 0){typeof s<"u"&&(s.type="string",s.enum=r,s.default=i),super(e,t,i,s),this._allowedValues=r}validate(e){return ls(e,this.defaultValue,this._allowedValues)}}class JA extends Fr{constructor(e,t,i,r,s,o,a=void 0){typeof a<"u"&&(a.type="string",a.enum=s,a.default=r),super(e,t,i,a),this._allowedValues=s,this._convert=o}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function DNt(n){switch(n){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class RNt extends Fr{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[T("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached."),T("accessibilitySupport.on","Optimize for usage with a Screen Reader."),T("accessibilitySupport.off","Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:T("accessibilitySupport","Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return i===0?e.accessibilitySupport:i}}class MNt extends Fr{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:T("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:T("comments.ignoreEmptyLines","Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertSpace:en(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:en(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function ANt(n){switch(n){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var Wo;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(Wo||(Wo={}));function ONt(n){switch(n){case"line":return Wo.Line;case"block":return Wo.Block;case"underline":return Wo.Underline;case"line-thin":return Wo.LineThin;case"block-outline":return Wo.BlockOutline;case"underline-thin":return Wo.UnderlineThin}}class PNt extends wR{constructor(){super(143)}compute(e,t,i){const r=["monaco-editor"];return t.get(39)&&r.push(t.get(39)),e.extraEditorClassName&&r.push(e.extraEditorClassName),t.get(74)==="default"?r.push("mouse-default"):t.get(74)==="copy"&&r.push("mouse-copy"),t.get(112)&&r.push("showUnused"),t.get(141)&&r.push("showDeprecated"),r.join(" ")}}class FNt extends Di{constructor(){super(37,"emptySelectionClipboard",!0,{description:T("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class BNt extends Fr{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(41,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:T("find.cursorMoveOnType","Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[T("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),T("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),T("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:T("find.seedSearchStringFromSelection","Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[T("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),T("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),T("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:T("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:T("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:ci},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:T("find.addExtraSpaceOnTop","Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:T("find.loop","Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:en(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":ls(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":ls(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:en(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:en(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:en(t.loop,this.defaultValue.loop)}}}const Zp=class Zp extends Fr{constructor(){super(51,"fontLigatures",Zp.OFF,{anyOf:[{type:"boolean",description:T("fontLigatures","Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:T("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:T("fontLigaturesGeneral","Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"||e.length===0?Zp.OFF:e==="true"?Zp.ON:e:e?Zp.ON:Zp.OFF}};Zp.OFF='"liga" off, "calt" off',Zp.ON='"liga" on, "calt" on';let v_=Zp;const Qp=class Qp extends Fr{constructor(){super(54,"fontVariations",Qp.OFF,{anyOf:[{type:"boolean",description:T("fontVariations","Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:T("fontVariationSettings","Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:T("fontVariationsGeneral","Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?Qp.OFF:e==="true"?Qp.TRANSLATE:e:e?Qp.TRANSLATE:Qp.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}};Qp.OFF="normal",Qp.TRANSLATE="translate";let lT=Qp;class $Nt extends wR{constructor(){super(50)}compute(e,t,i){return e.fontInfo}}class HNt extends Dk{constructor(){super(52,"fontSize",_l.fontSize,{type:"number",minimum:6,maximum:100,default:_l.fontSize,description:T("fontSize","Controls the font size in pixels.")})}validate(e){const t=vd.float(e,this.defaultValue);return t===0?_l.fontSize:vd.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}const gg=class gg extends Fr{constructor(){super(53,"fontWeight",_l.fontWeight,{anyOf:[{type:"number",minimum:gg.MINIMUM_VALUE,maximum:gg.MAXIMUM_VALUE,errorMessage:T("fontWeightErrorMessage",'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:gg.SUGGESTION_VALUES}],default:_l.fontWeight,description:T("fontWeight",'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(mr.clampedInt(e,_l.fontWeight,gg.MINIMUM_VALUE,gg.MAXIMUM_VALUE))}};gg.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"],gg.MINIMUM_VALUE=1,gg.MAXIMUM_VALUE=1e3;let GQ=gg;class jNt extends Fr{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",multipleTests:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:"",alternativeTestsCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[T("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),T("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),T("editor.gotoLocation.multiple.goto","Go to the primary result and enable Peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(58,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:T("editor.gotoLocation.multiple.deprecated","This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":{description:T("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:T("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:T("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:T("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:T("editor.editor.gotoLocation.multipleReferences","Controls the behavior the 'Go to References'-command when multiple target locations exist."),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:T("alternativeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:T("alternativeTypeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:T("alternativeDeclarationCommand","Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:T("alternativeImplementationCommand","Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:T("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{multiple:ls(t.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:t.multipleDefinitions??ls(t.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:t.multipleTypeDefinitions??ls(t.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:t.multipleDeclarations??ls(t.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:t.multipleImplementations??ls(t.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:t.multipleReferences??ls(t.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),multipleTests:t.multipleTests??ls(t.multipleTests,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Ga.string(t.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Ga.string(t.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Ga.string(t.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Ga.string(t.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Ga.string(t.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand),alternativeTestsCommand:Ga.string(t.alternativeTestsCommand,this.defaultValue.alternativeTestsCommand)}}}class WNt extends Fr{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(60,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:T("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:T("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:T("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,description:T("hover.hidingDelay","Controls the delay in milliseconds after which the hover is hidden. Requires `editor.hover.sticky` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:T("hover.above","Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:en(t.enabled,this.defaultValue.enabled),delay:mr.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:en(t.sticky,this.defaultValue.sticky),hidingDelay:mr.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:en(t.above,this.defaultValue.above)}}}class Ex extends wR{constructor(){super(146)}compute(e,t,i){return Ex.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let r=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(r=Math.max(r,t-1));const s=(i+e.viewLineCount+r)/(e.pixelRatio*e.height),o=Math.floor(e.viewLineCount/s);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:r,desiredRatio:s,minimapLineCount:o}}static _computeMinimapLayout(e,t){const i=e.outerWidth,r=e.outerHeight,s=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(s*r),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:r};const o=t.stableMinimapLayoutInput,a=o&&e.outerHeight===o.outerHeight&&e.lineHeight===o.lineHeight&&e.typicalHalfwidthCharacterWidth===o.typicalHalfwidthCharacterWidth&&e.pixelRatio===o.pixelRatio&&e.scrollBeyondLastLine===o.scrollBeyondLastLine&&e.paddingTop===o.paddingTop&&e.paddingBottom===o.paddingBottom&&e.minimap.enabled===o.minimap.enabled&&e.minimap.side===o.minimap.side&&e.minimap.size===o.minimap.size&&e.minimap.showSlider===o.minimap.showSlider&&e.minimap.renderCharacters===o.minimap.renderCharacters&&e.minimap.maxColumn===o.minimap.maxColumn&&e.minimap.scale===o.minimap.scale&&e.verticalScrollbarWidth===o.verticalScrollbarWidth&&e.isViewportWrapping===o.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,d=e.scrollBeyondLastLine,u=e.minimap.renderCharacters;let h=s>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const f=e.minimap.maxColumn,g=e.minimap.size,m=e.minimap.side,p=e.verticalScrollbarWidth,v=e.viewLineCount,b=e.remainingWidth,y=e.isViewportWrapping,C=u?2:3;let S=Math.floor(s*r);const E=S/s;let L=!1,N=!1,I=C*h,D=h/s,R=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:V,extraLinesBeforeFirstLine:$,extraLinesBeyondLastLine:F,desiredRatio:j,minimapLineCount:q}=Ex.computeContainedMinimapLineCount({viewLineCount:v,scrollBeyondLastLine:d,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:r,lineHeight:l,pixelRatio:s});if(v/q>1)L=!0,N=!0,h=1,I=1,D=h/s;else{let K=!1,Q=h+1;if(g==="fit"){const se=Math.ceil(($+v+F)*I);y&&a&&b<=t.stableFitRemainingWidth?(K=!0,Q=t.stableFitMaxMinimapScale):K=se>S}if(g==="fill"||K){L=!0;const se=h;I=Math.min(l*s,Math.max(1,Math.floor(1/j))),y&&a&&b<=t.stableFitRemainingWidth&&(Q=t.stableFitMaxMinimapScale),h=Math.min(Q,Math.max(1,Math.floor(I/C))),h>se&&(R=Math.min(2,h/se)),D=h/s/R,S=Math.ceil(Math.max(V,$+v+F)*I),y?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=b,t.stableFitMaxMinimapScale=h):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const O=Math.floor(f*D),M=Math.min(O,Math.max(0,Math.floor((b-p-2)*D/(c+D)))+lg);let P=Math.floor(s*M);const B=P/s;P=Math.floor(P*R);const H=u?1:2,W=m==="left"?0:i-M-p;return{renderMinimap:H,minimapLeft:W,minimapWidth:M,minimapHeightIsEditorHeight:L,minimapIsSampling:N,minimapScale:h,minimapLineHeight:I,minimapCanvasInnerWidth:P,minimapCanvasInnerHeight:S,minimapCanvasOuterWidth:B,minimapCanvasOuterHeight:E}}static computeLayout(e,t){const i=t.outerWidth|0,r=t.outerHeight|0,s=t.lineHeight|0,o=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,d=t.viewLineCount,u=e.get(138),h=u==="inherit"?e.get(137):u,f=h==="inherit"?e.get(133):h,g=e.get(136),m=t.isDominatedByLongLines,p=e.get(57),v=e.get(68).renderType!==0,b=e.get(69),y=e.get(106),C=e.get(84),S=e.get(73),E=e.get(104),L=E.verticalScrollbarSize,N=E.verticalHasArrows,I=E.arrowSize,D=E.horizontalScrollbarSize,R=e.get(43),O=e.get(111)!=="never";let M=e.get(66);R&&O&&(M+=16);let P=0;if(v){const G=Math.max(o,b);P=Math.round(G*l)}let B=0;p&&(B=s*t.glyphMarginDecorationLaneCount);let H=0,W=H+B,V=W+P,$=V+M;const F=i-B-P-M;let j=!1,q=!1,U=-1;h==="inherit"&&m?(j=!0,q=!0):f==="on"||f==="bounded"?q=!0:f==="wordWrapColumn"&&(U=g);const K=Ex._computeMinimapLayout({outerWidth:i,outerHeight:r,lineHeight:s,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:y,paddingTop:C.top,paddingBottom:C.bottom,minimap:S,verticalScrollbarWidth:L,viewLineCount:d,remainingWidth:F,isViewportWrapping:q},t.memory||new Q3e);K.renderMinimap!==0&&K.minimapLeft===0&&(H+=K.minimapWidth,W+=K.minimapWidth,V+=K.minimapWidth,$+=K.minimapWidth);const Q=F-K.minimapWidth,se=Math.max(1,Math.floor((Q-L-2)/a)),J=N?I:0;return q&&(U=Math.max(1,se),f==="bounded"&&(U=Math.min(U,g))),{width:i,height:r,glyphMarginLeft:H,glyphMarginWidth:B,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:W,lineNumbersWidth:P,decorationsLeft:V,decorationsWidth:M,contentLeft:$,contentWidth:Q,minimap:K,viewportColumn:se,isWordWrapMinified:j,isViewportWrapping:q,wrappingColumn:U,verticalScrollbarWidth:L,horizontalScrollbarHeight:D,overviewRuler:{top:J,width:L,height:r-2*J,right:0}}}}class zNt extends Fr{constructor(){super(140,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[T("wrappingStrategy.simple","Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),T("wrappingStrategy.advanced","Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:T("wrappingStrategy","Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return ls(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}var Zu;(function(n){n.Off="off",n.OnCode="onCode",n.On="on"})(Zu||(Zu={}));class VNt extends Fr{constructor(){const e={enabled:Zu.OnCode};super(65,"lightbulb",e,{"editor.lightbulb.enabled":{type:"string",tags:["experimental"],enum:[Zu.Off,Zu.OnCode,Zu.On],default:e.enabled,enumDescriptions:[T("editor.lightbulb.enabled.off","Disable the code action menu."),T("editor.lightbulb.enabled.onCode","Show the code action menu when the cursor is on lines with code."),T("editor.lightbulb.enabled.on","Show the code action menu when the cursor is on lines with code or on empty lines.")],description:T("enabled","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:ls(e.enabled,this.defaultValue.enabled,[Zu.Off,Zu.OnCode,Zu.On])}}}class UNt extends Fr{constructor(){const e={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(116,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:T("editor.stickyScroll.enabled","Shows the nested current scopes during the scroll at the top of the editor."),tags:["experimental"]},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:20,description:T("editor.stickyScroll.maxLineCount","Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:T("editor.stickyScroll.defaultModel","Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:T("editor.stickyScroll.scrollWithEditor","Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:en(t.enabled,this.defaultValue.enabled),maxLineCount:mr.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:ls(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:en(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class qNt extends Fr{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(142,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:T("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[T("editor.inlayHints.on","Inlay hints are enabled"),T("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",ci?"Ctrl+Option":"Ctrl+Alt"),T("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",ci?"Ctrl+Option":"Ctrl+Alt"),T("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:T("inlayHints.fontSize","Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:T("inlayHints.fontFamily","Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:T("inlayHints.padding","Enables the padding around the inlay hints in the editor.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return typeof t.enabled=="boolean"&&(t.enabled=t.enabled?"on":"off"),{enabled:ls(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:mr.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Ga.string(t.fontFamily,this.defaultValue.fontFamily),padding:en(t.padding,this.defaultValue.padding)}}}class GNt extends Fr{constructor(){super(66,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):mr.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?mr.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class KNt extends vd{constructor(){super(67,"lineHeight",_l.lineHeight,e=>vd.clamp(e,0,150),{markdownDescription:T("lineHeight",`Controls the line height.
|
517
|
+
rounded-xl px-3 py-2 ${r.isUser?"rounded-tr-none":"rounded-tl-none"}`,children:[i(r),r.type==="ASK_USER"&&r.options&&r.options.length>0&&x.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:r.options.map((o,a)=>x.jsx("button",{className:"px-2 py-1 bg-indigo-600 hover:bg-indigo-700 rounded-full text-xs text-white transition-colors",onClick:()=>e(o,r.eventId),children:o},a))})]}),r.isUser&&x.jsx("div",{className:"w-7 h-7 rounded-full bg-gray-600 flex items-center justify-center ml-2 flex-shrink-0",children:x.jsx("svg",{className:"w-4 h-4 text-gray-300",viewBox:"0 0 24 24",fill:"currentColor",children:x.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"})})})]},r.id||s))})},B2t=({messages:n,currentTask:e,onUserResponse:t,onClose:i,onToggleAdaptive:r,isMessageAreaAdaptive:s=!0})=>{const[o,a]=_.useState({inputTokens:0,outputTokens:0,totalCost:0,contextWindowUsage:0,maxContextWindow:100,cacheHits:0,cacheMisses:0}),l=_.useRef(null),c=_.useRef(null),[d,u]=_.useState(!0),[h,f]=_.useState(!1),g=_.useRef(n.length),m=_.useCallback(()=>{var p;(p=l.current)==null||p.scrollIntoView({behavior:"smooth"})},[]);return _.useEffect(()=>{let p=0,v=0,b=0,y=0,C=100,S=0,E=0;n.forEach(L=>{var N,I;L.contentType==="token_stat"&&L.metadata&&(p+=L.metadata.input_tokens||0,v+=L.metadata.output_tokens||0,b+=(L.metadata.input_cost||0)+(L.metadata.output_cost||0),y=Math.max(y,L.metadata.context_window||0),C=L.metadata.max_context_window||C,S+=L.metadata.cache_hit||0,E+=L.metadata.cache_miss||0),((N=L.metadata)==null?void 0:N.stream_out_type)==="index_build"&&((I=L.metadata)!=null&&I.input_tokens)&&(p+=L.metadata.input_tokens||0,v+=L.metadata.output_tokens||0,b+=(L.metadata.input_cost||0)+(L.metadata.output_cost||0),y=Math.max(y,L.metadata.context_window||0),C=L.metadata.max_context_window||C,S+=L.metadata.cache_hit||0,E+=L.metadata.cache_miss||0)}),a({inputTokens:p,outputTokens:v,totalCost:b,contextWindowUsage:y,maxContextWindow:C,cacheHits:S,cacheMisses:E})},[n]),_.useEffect(()=>{const p=()=>{const b=c.current;if(!b)return;f(!0);const y=b.scrollHeight-b.scrollTop-b.clientHeight<60;u(y)},v=c.current;return v&&(v.addEventListener("scroll",p),setTimeout(()=>{v&&c.current===v&&p()},100)),()=>{v&&v.removeEventListener("scroll",p)}},[]),_.useEffect(()=>{const p=n.length,v=p!==g.current;g.current=p,v&&(!h||d)&&setTimeout(()=>{m()},0)},[n,d,h,m]),_.useEffect(()=>{const p=setTimeout(()=>{(!h||d)&&m();const v=c.current;if(v){const b=v.scrollHeight-v.scrollTop-v.clientHeight<20;b!==d&&u(b)}},200);return()=>clearTimeout(p)},[]),x.jsxs("div",{className:"flex flex-col h-full relative",children:[x.jsx("div",{className:"sticky top-0 z-10 bg-gray-800/90 backdrop-blur-sm border-b border-gray-700 shadow-md rounded-t-lg mb-4",children:x.jsxs("div",{className:"px-4 py-3",children:[x.jsxs("div",{className:"mb-2 flex items-center",children:[x.jsx("svg",{className:"w-4 h-4 text-indigo-400 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})}),x.jsx("h2",{className:"text-white font-medium text-sm truncate",children:e||ie("noActiveTask")})]}),x.jsxs("div",{className:"font-mono text-xs text-gray-400 flex flex-row items-center gap-2 flex-wrap text-[11px]",children:[x.jsxs("div",{className:"flex items-center",children:[x.jsxs("span",{children:[ie("tokens"),": "]}),x.jsxs("span",{className:"text-green-500 ml-1",children:["↑ ",o.inputTokens]}),x.jsxs("span",{className:"text-red-500 ml-1",children:["↓ ",o.outputTokens]})]}),x.jsxs("div",{className:"flex items-center",children:[x.jsxs("span",{children:[ie("cache"),": "]}),x.jsxs("span",{className:"text-white ml-1",children:["⊕ ",o.cacheHits]}),x.jsxs("span",{className:"text-white ml-1",children:["→ ",o.cacheMisses]})]}),x.jsxs("div",{className:"flex items-center",children:[x.jsxs("span",{children:[ie("apiCost"),": "]}),x.jsxs("span",{className:"text-white ml-1",children:["$",o.totalCost.toFixed(5)]})]})]})]})}),x.jsxs("div",{className:"flex-grow overflow-y-auto relative",ref:c,children:[x.jsx(M3e,{messages:n,onUserResponse:t}),x.jsx("div",{ref:l}),!d&&n.length>0&&x.jsx("button",{onClick:()=>{var p;(p=l.current)==null||p.scrollIntoView({behavior:"smooth"}),u(!0)},className:"fixed bottom-24 right-4 z-10 bg-indigo-600 hover:bg-indigo-700 text-white rounded-full p-2 shadow-lg flex items-center justify-center",style:{width:"36px",height:"36px"},"aria-label":"滚动到底部",children:x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 14l-7 7m0 0l-7-7m7 7V3"})})})]})]})};U_.config({paths:{vs:"/monaco-editor/min/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});const $2t=({projectName:n})=>{const[e,t]=_.useState([]),[i,r]=_.useState(!0),[s,o]=_.useState(null),[a,l]=_.useState(null),[c,d]=_.useState(null),[u,h]=_.useState(null),[f,g]=_.useState(null),[m,p]=_.useState(!1),[v,b]=_.useState(null),[y,C]=_.useState("split"),[S,E]=_.useState(null),L=_.useRef(null),N=_.useRef(null),I=_.useRef(null),D=_.useRef(null),R=_.useRef(null),[O,M]=_.useState("400px"),[P,B]=_.useState("100%"),H=(Z,ne)=>{let oe;return function(...de){clearTimeout(oe),oe=setTimeout(()=>Z(...de),ne)}},W=_.useCallback(H(()=>{if(D.current&&R.current){const Z=R.current.getBoundingClientRect(),ne=Z.top,de=window.innerHeight-ne-40,ye=Math.max(300,Math.min(de,600));M(`${ye}px`),B(`${Z.width}px`)}},100),[]);_.useEffect(()=>(V(),W(),window.addEventListener("resize",W),()=>{window.removeEventListener("resize",W),L.current=null,N.current=null,I.current=null}),[W]);const V=async()=>{try{r(!0);const Z=await fetch("/api/commits");if(!Z.ok)throw new Error(`Error fetching commits: ${Z.statusText}`);const ne=await Z.json();t(ne.commits),o(null)}catch(Z){o(Z instanceof Error?Z.message:"An unknown error occurred"),console.error("Failed to fetch commits:",Z)}finally{r(!1)}},$=async Z=>{try{d(null);const ne=await fetch(`/api/commits/${Z}`);if(!ne.ok)throw new Error(`Error fetching commit details: ${ne.statusText}`);const oe=await ne.json();d(oe)}catch(ne){console.error("Failed to fetch commit details:",ne)}},F=async(Z,ne)=>{try{p(!0),b(null),g(null),L.current=null,N.current=null,I.current=null,await new Promise(ye=>setTimeout(ye,50));const oe=await fetch(`/api/commits/${Z}/file?file_path=${encodeURIComponent(ne)}`);if(!oe.ok)throw new Error(`Error fetching file diff: ${oe.statusText}`);const de=await oe.json();g(de),setTimeout(W,50)}catch(oe){b(oe instanceof Error?oe.message:"An unknown error occurred"),console.error("Failed to fetch file diff:",oe)}finally{p(!1)}},j=Z=>{a===Z?(l(null),d(null),h(null),g(null),L.current=null,N.current=null,I.current=null,q()):(l(Z),$(Z),h(null),g(null),q())},q=()=>{E(null)},U=Z=>{u===Z?(h(null),g(null),L.current=null,N.current=null,I.current=null,q()):(h(Z),a&&F(a,Z),q())},K=_.useCallback(Z=>{L.current=Z},[]),Q=_.useCallback(Z=>{N.current=Z},[]),se=_.useCallback(Z=>{I.current=Z},[]),J=Z=>{var de;const ne=(de=Z.split(".").pop())==null?void 0:de.toLowerCase();return{js:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",py:"python",java:"java",c:"c",cpp:"cpp",cs:"csharp",go:"go",rs:"rust",rb:"ruby",php:"php",html:"html",css:"css",scss:"scss",json:"json",md:"markdown",yml:"yaml",yaml:"yaml",xml:"xml",sh:"shell",bash:"shell",txt:"plaintext"}[ne||""]||"plaintext"},G=Z=>{const ne=new Date(Z);return new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(ne)},X=()=>{if(!u||!f)return null;const Z=J(u),ne=`diff-${a}-${u}-${y}`,oe=`before-${a}-${u}`,de=`after-${a}-${u}`,ye={readOnly:!0,scrollBeyondLastLine:!1,minimap:{enabled:!1},lineNumbers:"on",wordWrap:"on",automaticLayout:!0,scrollbar:{vertical:"visible",horizontal:"visible",verticalScrollbarSize:14,horizontalScrollbarSize:14}},Se=({viewType:Ce})=>{const Le=S===Ce;return x.jsx("button",{className:"ml-2 text-gray-400 hover:text-white transition-colors",onClick:We=>{We.stopPropagation(),E(Le?null:Ce),setTimeout(W,50)},title:Le?"恢复正常视图":"最大化视图",children:Le?x.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5v-4m0 4h-4m4 0l-5-5"})}):x.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5v-4m0 4h-4m4 0l-5-5"})})})};return y==="unified"?x.jsxs("div",{ref:R,className:"bg-gray-900 rounded-lg border border-gray-700",style:{height:O,width:P,overflow:"hidden"},children:[x.jsxs("div",{className:"py-1 px-3 bg-gray-800 border-b border-gray-700 text-xs font-medium text-gray-300 flex justify-between items-center",children:[x.jsx("span",{children:ie("diffView")}),x.jsx(Se,{viewType:"diff"})]}),x.jsx(ou,{height:"calc(100% - 26px)",width:"100%",defaultLanguage:"diff",value:f.diff_content||"",theme:"vs-dark",onMount:se,options:ye,loading:x.jsx("div",{className:"flex items-center justify-center h-full text-gray-400",children:"Loading diff view..."})},ne)]}):x.jsxs("div",{ref:R,className:"grid grid-cols-3 gap-2",style:{height:O,width:P},children:[(S===null||S==="before")&&x.jsxs("div",{className:`bg-gray-900 rounded-lg border border-gray-700 ${S==="before"?"col-span-3":""}`,style:{overflow:"hidden"},children:[x.jsxs("div",{className:"py-1 px-3 bg-gray-800 border-b border-gray-700 text-xs font-medium text-gray-300 flex justify-between items-center",children:[x.jsxs("span",{children:[ie("beforeChange")," (",f.file_status==="added"?ie("newFile"):u,")"]}),x.jsx(Se,{viewType:"before"})]}),x.jsx(ou,{height:"calc(100% - 26px)",width:"100%",defaultLanguage:Z,value:f.before_content||"",theme:"vs-dark",onMount:K,options:ye,loading:x.jsx("div",{className:"flex items-center justify-center h-full text-gray-400",children:"Loading..."})},oe)]}),(S===null||S==="after")&&x.jsxs("div",{className:`bg-gray-900 rounded-lg border border-gray-700 ${S==="after"?"col-span-3":""}`,style:{overflow:"hidden"},children:[x.jsxs("div",{className:"py-1 px-3 bg-gray-800 border-b border-gray-700 text-xs font-medium text-gray-300 flex justify-between items-center",children:[x.jsxs("span",{children:[ie("afterChange")," (",f.file_status==="deleted"?ie("fileDeleted"):u,")"]}),x.jsx(Se,{viewType:"after"})]}),x.jsx(ou,{height:"calc(100% - 26px)",width:"100%",defaultLanguage:Z,value:f.after_content||"",theme:"vs-dark",onMount:Q,options:ye,loading:x.jsx("div",{className:"flex items-center justify-center h-full text-gray-400",children:"Loading..."})},de)]}),(S===null||S==="diff")&&x.jsxs("div",{className:`bg-gray-900 rounded-lg border border-gray-700 ${S==="diff"?"col-span-3":""}`,style:{overflow:"hidden"},children:[x.jsxs("div",{className:"py-1 px-3 bg-gray-800 border-b border-gray-700 text-xs font-medium text-gray-300 flex justify-between items-center",children:[x.jsx("span",{children:ie("diffView")}),x.jsx(Se,{viewType:"diff"})]}),x.jsx(ou,{height:"calc(100% - 26px)",width:"100%",defaultLanguage:"diff",value:f.diff_content||"",theme:"vs-dark",onMount:se,options:ye,loading:x.jsx("div",{className:"flex items-center justify-center h-full text-gray-400",children:"Loading..."})},`diff-inline-${a}-${u}`)]})]})};return i&&e.length===0?x.jsx("div",{className:"flex items-center justify-center h-full",children:x.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-b-2 border-indigo-500"})}):s&&e.length===0?x.jsxs("div",{className:"flex flex-col items-center justify-center text-center p-4 text-red-400",children:[x.jsx("svg",{className:"w-12 h-12 mb-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),x.jsx("p",{className:"text-lg font-medium mb-2",children:"Error Loading Commits"}),x.jsx("p",{className:"text-sm",children:s}),x.jsx("button",{className:"mt-4 px-4 py-2 bg-indigo-600 hover:bg-indigo-700 rounded text-white transition-colors",onClick:V,children:"Retry"})]}):x.jsxs("div",{className:"flex flex-col h-full",ref:D,children:[x.jsxs("div",{className:"flex justify-between items-center mb-4",children:[x.jsx("h2",{className:"text-lg font-medium text-white",children:ie("commitHistory",{project:n})}),x.jsx("button",{onClick:V,className:"p-1 text-gray-400 hover:text-white transition-colors",title:"Refresh",children:x.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})]}),e.length===0?x.jsxs("div",{className:"flex flex-col items-center justify-center text-center p-6 text-gray-400",children:[x.jsx("svg",{className:"w-12 h-12 mb-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),x.jsx("p",{className:"text-lg font-medium mb-2",children:"No Commit History"}),x.jsx("p",{className:"text-sm",children:"This repository has no commits yet."})]}):x.jsx("div",{className:"flex-1 overflow-y-auto pr-2",children:e.map(Z=>x.jsxs("div",{className:"mb-4",children:[x.jsxs("div",{className:`p-4 rounded-lg cursor-pointer transition-colors ${a===Z.hash?"bg-gray-700 border-l-4 border-indigo-500":"bg-gray-800 hover:bg-gray-750"}`,onClick:()=>j(Z.hash),children:[x.jsxs("div",{className:"flex justify-between items-start",children:[x.jsx("h3",{className:"text-white font-medium mb-2 flex-1 mr-2",children:Z.message}),x.jsx("span",{className:"text-xs font-mono text-gray-400 whitespace-nowrap",children:Z.short_hash})]}),x.jsxs("div",{className:"flex items-center text-xs text-gray-400 mt-2",children:[x.jsx("span",{children:Z.author}),x.jsx("span",{className:"mx-2",children:"•"}),x.jsx("span",{children:G(Z.date)})]}),x.jsxs("div",{className:"flex items-center mt-3 text-xs",children:[x.jsxs("span",{className:"flex items-center text-green-400 mr-3",children:[x.jsxs("span",{className:"font-mono mr-1",children:["+",Z.stats.insertions]}),x.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})})]}),x.jsxs("span",{className:"flex items-center text-red-400 mr-3",children:[x.jsxs("span",{className:"font-mono mr-1",children:["-",Z.stats.deletions]}),x.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 12H4"})})]}),x.jsxs("span",{className:"text-gray-400",children:[Z.stats.files_changed," file",Z.stats.files_changed!==1?"s":""," changed"]})]})]}),a===Z.hash&&c&&x.jsx("div",{className:"mt-2 pl-4 border-l-2 border-gray-700",children:x.jsxs("div",{className:"bg-gray-800 rounded-lg p-4",children:[x.jsxs("div",{className:"flex justify-between items-center mb-3",children:[x.jsx("h4",{className:"text-white text-sm font-medium",children:"Changed Files"}),u&&f&&!m&&x.jsxs("div",{className:"flex space-x-2",children:[x.jsx("button",{className:`px-2 py-1 text-xs rounded ${y==="split"?"bg-indigo-600 text-white":"bg-gray-700 text-gray-300 hover:bg-gray-600"}`,onClick:()=>{C("split"),setTimeout(W,50)},children:ie("splitView")}),x.jsx("button",{className:`px-2 py-1 text-xs rounded ${y==="unified"?"bg-indigo-600 text-white":"bg-gray-700 text-gray-300 hover:bg-gray-600"}`,onClick:()=>{C("unified"),setTimeout(W,50)},children:ie("unifiedView")})]})]}),x.jsx("div",{className:"space-y-2 mb-4",children:c.files.map((ne,oe)=>x.jsxs("div",{className:`text-sm py-2 px-3 rounded cursor-pointer ${u===ne.filename?"bg-gray-700 border-l-2 border-indigo-500":"hover:bg-gray-750"}`,onClick:()=>U(ne.filename),children:[x.jsxs("div",{className:"flex items-center",children:[x.jsx("span",{className:`w-1.5 h-1.5 rounded-full mr-2 ${ne.status==="added"?"bg-green-500":ne.status==="modified"?"bg-yellow-500":ne.status==="deleted"?"bg-red-500":"bg-blue-500"}`}),x.jsx("span",{className:`font-mono ${ne.status==="deleted"?"line-through text-gray-500":"text-gray-300"}`,children:ne.filename})]}),x.jsx("div",{className:"flex text-xs mt-1 ml-4",children:ne.changes&&x.jsxs(x.Fragment,{children:[ne.changes.insertions>0&&x.jsxs("span",{className:"text-green-400 mr-3",children:["+",ne.changes.insertions]}),ne.changes.deletions>0&&x.jsxs("span",{className:"text-red-400",children:["-",ne.changes.deletions]})]})})]},oe))}),m&&x.jsx("div",{className:"flex items-center justify-center py-10",children:x.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-indigo-500"})}),v&&x.jsxs("div",{className:"text-red-400 text-sm p-4 bg-red-900 bg-opacity-25 rounded-lg",children:[x.jsx("p",{className:"font-medium",children:"Error loading file diff:"}),x.jsx("p",{children:v})]}),u&&f&&!m&&!v&&X()]})})]},Z.hash))})]})},H2t=Object.freeze(Object.defineProperty({__proto__:null,default:$2t},Symbol.toStringTag,{value:"Module"}));U_.config({paths:{vs:"/monaco-editor/min/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});const j2t=({projectName:n,commits:e=[]})=>{const[t,i]=_.useState(!1),[r,s]=_.useState(null),[o,a]=_.useState(null),[l,c]=_.useState(null),[d,u]=_.useState(null),[h,f]=_.useState(null),[g,m]=_.useState(!1),[p,v]=_.useState(null),[b,y]=_.useState("split"),[C,S]=_.useState(null),[E,L]=_.useState({show:!1,commitHash:"",commitMessage:""}),[N,I]=_.useState(!1),[D,R]=_.useState(null),[O,M]=_.useState(null),P=_.useRef(null),B=_.useRef(null),H=_.useRef(null),W=_.useRef(null),V=_.useRef(null),[$,F]=_.useState("400px"),[j,q]=_.useState("100%"),U=(je,$e)=>{let De;return function(...xe){clearTimeout(De),De=setTimeout(()=>je(...xe),$e)}},K=_.useCallback(U(()=>{if(W.current&&V.current){const je=V.current.getBoundingClientRect(),$e=je.top,xe=window.innerHeight-$e-40,Te=Math.max(300,Math.min(xe,600));F(`${Te}px`),q(`${je.width}px`)}},100),[]);_.useEffect(()=>(K(),window.addEventListener("resize",K),()=>{window.removeEventListener("resize",K),P.current=null,B.current=null,H.current=null}),[K]);const Q=async je=>{try{c(null);const $e=await fetch(`/api/commits/${je}`);if(!$e.ok)throw new Error(`Error fetching commit details: ${$e.statusText}`);const De=await $e.json();c(De)}catch($e){console.error("Failed to fetch commit details:",$e)}},se=async(je,$e)=>{try{m(!0),v(null),f(null),P.current=null,B.current=null,H.current=null,await new Promise(Te=>setTimeout(Te,50));const De=await fetch(`/api/commits/${je}/file?file_path=${encodeURIComponent($e)}`);if(!De.ok)throw new Error(`Error fetching file diff: ${De.statusText}`);const xe=await De.json();f(xe),setTimeout(K,50)}catch(De){v(De instanceof Error?De.message:"An unknown error occurred"),console.error("Failed to fetch file diff:",De)}finally{m(!1)}},J=je=>{if(o===je)a(null),c(null),u(null),f(null),P.current=null,B.current=null,H.current=null,Se();else{a(je);const $e=e.find(De=>De.hash===je);$e&&$e.files?c($e):Q(je),u(null),f(null),Se()}},G=je=>{d===je?(u(null),f(null),P.current=null,B.current=null,H.current=null,Se()):(u(je),o&&se(o,je),Se())},X=_.useCallback(je=>{P.current=je},[]),Z=_.useCallback(je=>{B.current=je},[]),ne=_.useCallback(je=>{H.current=je},[]),oe=je=>{var xe;const $e=(xe=je.split(".").pop())==null?void 0:xe.toLowerCase();return{js:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",py:"python",java:"java",c:"c",cpp:"cpp",cs:"csharp",go:"go",rs:"rust",rb:"ruby",php:"php",html:"html",css:"css",scss:"scss",json:"json",md:"markdown",yml:"yaml",yaml:"yaml",xml:"xml",sh:"shell",bash:"shell",txt:"plaintext"}[$e||""]||"plaintext"},de=je=>{const $e=new Date(je);return new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format($e)},ye=()=>{if(!d||!h)return null;const je=oe(d),$e=`diff-${o}-${d}-${b}`,De=`before-${o}-${d}`,xe=`after-${o}-${d}`,Te={readOnly:!0,scrollBeyondLastLine:!1,minimap:{enabled:!1},lineNumbers:"on",wordWrap:"on",automaticLayout:!0,scrollbar:{vertical:"visible",horizontal:"visible",verticalScrollbarSize:14,horizontalScrollbarSize:14}},Me=({viewType:He})=>{const we=C===He;return x.jsx("button",{className:"ml-2 text-gray-400 hover:text-white transition-colors",onClick:Ve=>{Ve.stopPropagation(),S(we?null:He),setTimeout(K,50)},title:we?"恢复正常视图":"最大化视图",children:we?x.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5v-4m0 4h-4m4 0l-5-5"})}):x.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5v-4m0 4h-4m4 0l-5-5"})})})};return b==="unified"?x.jsxs("div",{ref:V,className:"bg-gray-900 rounded-lg border border-gray-700",style:{height:$,width:j,overflow:"hidden"},children:[x.jsxs("div",{className:"py-1 px-3 bg-gray-800 border-b border-gray-700 text-xs font-medium text-gray-300 flex justify-between items-center",children:[x.jsx("span",{children:ie("diffView")}),x.jsx(Me,{viewType:"diff"})]}),x.jsx(ou,{height:"calc(100% - 26px)",width:"100%",defaultLanguage:"diff",value:h.diff_content||"",theme:"vs-dark",onMount:ne,options:Te,loading:x.jsx("div",{className:"flex items-center justify-center h-full text-gray-400",children:"Loading diff view..."})},$e)]}):x.jsxs("div",{ref:V,className:"grid grid-cols-3 gap-2",style:{height:$,width:j},children:[(C===null||C==="before")&&x.jsxs("div",{className:`bg-gray-900 rounded-lg border border-gray-700 ${C==="before"?"col-span-3":""}`,style:{overflow:"hidden"},children:[x.jsxs("div",{className:"py-1 px-3 bg-gray-800 border-b border-gray-700 text-xs font-medium text-gray-300 flex justify-between items-center",children:[x.jsxs("span",{children:[ie("beforeChange")," (",h.file_status==="added"?ie("newFile"):d,")"]}),x.jsx(Me,{viewType:"before"})]}),x.jsx(ou,{height:"calc(100% - 26px)",width:"100%",defaultLanguage:je,value:h.before_content||"",theme:"vs-dark",onMount:X,options:Te,loading:x.jsx("div",{className:"flex items-center justify-center h-full text-gray-400",children:"Loading..."})},De)]}),(C===null||C==="after")&&x.jsxs("div",{className:`bg-gray-900 rounded-lg border border-gray-700 ${C==="after"?"col-span-3":""}`,style:{overflow:"hidden"},children:[x.jsxs("div",{className:"py-1 px-3 bg-gray-800 border-b border-gray-700 text-xs font-medium text-gray-300 flex justify-between items-center",children:[x.jsxs("span",{children:[ie("afterChange")," (",h.file_status==="deleted"?ie("fileDeleted"):d,")"]}),x.jsx(Me,{viewType:"after"})]}),x.jsx(ou,{height:"calc(100% - 26px)",width:"100%",defaultLanguage:je,value:h.after_content||"",theme:"vs-dark",onMount:Z,options:Te,loading:x.jsx("div",{className:"flex items-center justify-center h-full text-gray-400",children:"Loading..."})},xe)]}),(C===null||C==="diff")&&x.jsxs("div",{className:`bg-gray-900 rounded-lg border border-gray-700 ${C==="diff"?"col-span-3":""}`,style:{overflow:"hidden"},children:[x.jsxs("div",{className:"py-1 px-3 bg-gray-800 border-b border-gray-700 text-xs font-medium text-gray-300 flex justify-between items-center",children:[x.jsx("span",{children:ie("diffView")}),x.jsx(Me,{viewType:"diff"})]}),x.jsx(ou,{height:"calc(100% - 26px)",width:"100%",defaultLanguage:"diff",value:h.diff_content||"",theme:"vs-dark",onMount:ne,options:Te,loading:x.jsx("div",{className:"flex items-center justify-center h-full text-gray-400",children:"Loading..."})},`diff-inline-${o}-${d}`)]})]})},Se=()=>{S(null)},Ce=(je,$e)=>{je.stopPropagation(),L({show:!0,commitHash:$e.hash,commitMessage:$e.message})},Le=async()=>{try{I(!0),R(null),M(null);const je=await fetch(`/api/commits/${E.commitHash}/revert`,{method:"POST",headers:{"Content-Type":"application/json"}});if(!je.ok){const De=await je.json();throw new Error(De.detail||"Failed to revert commit")}const $e=await je.json();M(`Successfully reverted commit. New revert commit: ${$e.new_commit_hash.substring(0,7)}`),L(De=>({...De,show:!1})),setTimeout(()=>{M(null)},5e3)}catch(je){R(je instanceof Error?je.message:"Failed to revert commit"),console.error("Failed to revert commit:",je)}finally{I(!1)}},We=()=>{L({show:!1,commitHash:"",commitMessage:""}),R(null)};return t&&e.length===0?x.jsx("div",{className:"flex items-center justify-center h-full",children:x.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-b-2 border-indigo-500"})}):r&&e.length===0?x.jsxs("div",{className:"flex flex-col items-center justify-center text-center p-4 text-red-400",children:[x.jsx("svg",{className:"w-12 h-12 mb-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),x.jsx("p",{className:"text-lg font-medium mb-2",children:"Error Loading Changes"}),x.jsx("p",{className:"text-sm",children:r})]}):x.jsxs("div",{className:"flex flex-col h-full",ref:W,children:[E.show&&x.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:x.jsxs("div",{className:"bg-gray-800 rounded-lg shadow-xl max-w-md w-full p-6 border border-gray-700",children:[x.jsx("h3",{className:"text-xl font-semibold text-white mb-4",children:"确认撤销提交"}),x.jsx("p",{className:"text-gray-300 mb-6",children:"您确定要撤销此提交吗?这将创建一个新的提交来撤销更改。"}),x.jsxs("div",{className:"bg-gray-900 p-3 rounded mb-6 border border-gray-700",children:[x.jsx("p",{className:"text-sm text-gray-400 mb-1",children:"提交信息:"}),x.jsx("p",{className:"text-white",children:E.commitMessage}),x.jsxs("p",{className:"text-xs text-gray-500 mt-2",children:["Commit: ",E.commitHash.substring(0,7)]})]}),D&&x.jsx("div",{className:"bg-red-900 bg-opacity-25 text-red-400 p-3 rounded mb-4",children:D}),x.jsxs("div",{className:"flex justify-end space-x-3",children:[x.jsx("button",{className:"px-4 py-2 bg-gray-700 hover:bg-gray-600 text-gray-300 rounded transition-colors",onClick:We,disabled:N,children:"取消"}),x.jsx("button",{className:"px-4 py-2 bg-red-600 hover:bg-red-700 text-white rounded transition-colors flex items-center",onClick:Le,disabled:N,children:N?x.jsxs(x.Fragment,{children:[x.jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[x.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),x.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"处理中..."]}):x.jsx(x.Fragment,{children:"确认撤销"})})]})]})}),O&&x.jsx("div",{className:"fixed top-4 right-4 bg-green-800 text-green-100 p-4 rounded-lg shadow-lg z-50 animate-fade-in-out",children:x.jsxs("div",{className:"flex items-center",children:[x.jsx("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})}),x.jsx("span",{children:O})]})}),x.jsx("div",{className:"flex justify-between items-center mb-4",children:x.jsx("h2",{className:"text-lg font-medium text-white",children:ie("currentChangeTitle")})}),e.length===0?x.jsxs("div",{className:"flex flex-col items-center justify-center text-center p-6 text-gray-400",children:[x.jsx("svg",{className:"w-12 h-12 mb-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),x.jsx("p",{className:"text-lg font-medium mb-2",children:"No Changes Available"}),x.jsx("p",{className:"text-sm",children:"No changes found for the specified commits."})]}):x.jsx("div",{className:"flex-1 overflow-y-auto pr-2",children:e.map(je=>x.jsx("div",{className:"mb-4",children:x.jsxs("div",{className:`p-4 rounded-lg cursor-pointer transition-colors ${o===je.hash?"bg-gray-700 border-l-4 border-indigo-500":"bg-gray-800 hover:bg-gray-750"}`,onClick:()=>J(je.hash),children:[x.jsxs("div",{className:`${je.message.startsWith("<revert>")?"border border-red-500 rounded-lg p-2 relative":""}`,children:[je.message.startsWith("<revert>")&&x.jsx("div",{className:"absolute -top-2 -right-2 bg-red-500 text-white text-xs px-2 py-0.5 rounded-full",children:"已撤销"}),x.jsxs("div",{className:"flex justify-between items-start",children:[x.jsx("h3",{className:"font-medium mb-2 flex-1 mr-2 text-white",children:je.message}),x.jsxs("div",{className:"flex items-center",children:[!je.message.startsWith("<revert>")&&x.jsx("button",{className:"text-gray-400 hover:text-red-400 p-1 mr-1 transition-colors",onClick:$e=>Ce($e,je),title:"撤销此提交",children:x.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M3 10h10a8 8 0 018 8v2M3 10l6 6m-6-6l6-6"})})}),x.jsx("span",{className:"text-xs font-mono text-gray-400 whitespace-nowrap",children:je.short_hash})]})]}),x.jsxs("div",{className:"flex items-center text-xs text-gray-400 mt-2",children:[x.jsx("span",{children:je.author}),x.jsx("span",{className:"mx-2",children:"•"}),x.jsx("span",{children:de(je.date)})]}),x.jsxs("div",{className:"flex items-center mt-3 text-xs",children:[x.jsxs("span",{className:"flex items-center text-green-400 mr-3",children:[x.jsxs("span",{className:"font-mono mr-1",children:["+",je.stats.insertions]}),x.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})})]}),x.jsxs("span",{className:"flex items-center text-red-400 mr-3",children:[x.jsxs("span",{className:"font-mono mr-1",children:["-",je.stats.deletions]}),x.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 12H4"})})]}),x.jsxs("span",{className:"text-gray-400",children:[je.stats.files_changed," file",je.stats.files_changed!==1?"s":""," changed"]})]})]}),o===je.hash&&l&&x.jsx("div",{className:"mt-2 pl-4 border-l-2 border-gray-700",children:x.jsxs("div",{className:"bg-gray-800 rounded-lg p-4",children:[x.jsxs("div",{className:"flex justify-between items-center mb-3",children:[x.jsx("h4",{className:"text-white text-sm font-medium",children:"Changed Files"}),d&&h&&!g&&x.jsxs("div",{className:"flex space-x-2",children:[x.jsx("button",{className:`px-2 py-1 text-xs rounded ${b==="split"?"bg-indigo-600 text-white":"bg-gray-700 text-gray-300 hover:bg-gray-600"}`,onClick:$e=>{$e.stopPropagation(),y("split"),setTimeout(K,50)},children:ie("splitView")}),x.jsx("button",{className:`px-2 py-1 text-xs rounded ${b==="unified"?"bg-indigo-600 text-white":"bg-gray-700 text-gray-300 hover:bg-gray-600"}`,onClick:$e=>{$e.stopPropagation(),y("unified"),setTimeout(K,50)},children:ie("unifiedView")})]})]}),x.jsx("div",{className:"space-y-2 mb-4",children:l.files.map(($e,De)=>x.jsxs("div",{className:`text-sm py-2 px-3 rounded cursor-pointer ${d===$e.filename?"bg-gray-700 border-l-2 border-indigo-500":"hover:bg-gray-750"}`,onClick:xe=>{xe.stopPropagation(),G($e.filename)},children:[x.jsxs("div",{className:"flex items-center",children:[x.jsx("span",{className:`w-1.5 h-1.5 rounded-full mr-2 ${$e.status==="added"?"bg-green-500":$e.status==="modified"?"bg-yellow-500":$e.status==="deleted"?"bg-red-500":"bg-blue-500"}`}),x.jsx("span",{className:`font-mono ${$e.status==="deleted"?"line-through text-gray-500":"text-gray-300"}`,children:$e.filename})]}),x.jsx("div",{className:"flex text-xs mt-1 ml-4",children:$e.changes&&x.jsxs(x.Fragment,{children:[$e.changes.insertions>0&&x.jsxs("span",{className:"text-green-400 mr-3",children:["+",$e.changes.insertions]}),$e.changes.deletions>0&&x.jsxs("span",{className:"text-red-400",children:["-",$e.changes.deletions]})]})})]},De))}),g&&x.jsx("div",{className:"flex items-center justify-center py-10",children:x.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-indigo-500"})}),p&&x.jsxs("div",{className:"text-red-400 text-sm p-4 bg-red-900 bg-opacity-25 rounded-lg",children:[x.jsx("p",{className:"font-medium",children:"Error loading file diff:"}),x.jsx("p",{children:p})]}),d&&h&&!g&&!p&&ye()]})})]})},je.hash))})]})},W2t=Object.freeze(Object.defineProperty({__proto__:null,default:j2t},Symbol.toStringTag,{value:"Module"}));var _K={exports:{}},yK,Dxe;function z2t(){if(Dxe)return yK;Dxe=1;var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return yK=n,yK}var CK,Rxe;function V2t(){if(Rxe)return CK;Rxe=1;var n=z2t();function e(){}function t(){}return t.resetWarningCache=e,CK=function(){function i(o,a,l,c,d,u){if(u!==n){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}i.isRequired=i;function r(){return i}var s={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:r,element:i,elementType:i,instanceOf:r,node:i,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:t,resetWarningCache:e};return s.PropTypes=s,s},CK}var Mxe;function U2t(){return Mxe||(Mxe=1,_K.exports=V2t()()),_K.exports}var q2t=U2t();const ms=il(q2t);var Vu=typeof window<"u"?window:null,Mle=Vu===null,iT=Mle?void 0:Vu.document,Rh="addEventListener",Mh="removeEventListener",SK="getBoundingClientRect",nI="_a",Ah="_b",Mp="_c",YA="horizontal",Oh=function(){return!1},G2t=Mle?"calc":["","-webkit-","-moz-","-o-"].filter(function(n){var e=iT.createElement("div");return e.style.cssText="width:"+n+"calc(9px)",!!e.style.length}).shift()+"calc",A3e=function(n){return typeof n=="string"||n instanceof String},Axe=function(n){if(A3e(n)){var e=iT.querySelector(n);if(!e)throw new Error("Selector "+n+" did not match a DOM element");return e}return n},Bl=function(n,e,t){var i=n[e];return i!==void 0?i:t},XA=function(n,e,t,i){if(e){if(i==="end")return 0;if(i==="center")return n/2}else if(t){if(i==="start")return 0;if(i==="center")return n/2}return n},K2t=function(n,e){var t=iT.createElement("div");return t.className="gutter gutter-"+e,t},Y2t=function(n,e,t){var i={};return A3e(e)?i[n]=e:i[n]=G2t+"("+e+"% - "+t+"px)",i},X2t=function(n,e){var t;return t={},t[n]=e+"px",t},Oxe=function(n,e){if(e===void 0&&(e={}),Mle)return{};var t=n,i,r,s,o,a,l;Array.from&&(t=Array.from(t));var c=Axe(t[0]),d=c.parentNode,u=getComputedStyle?getComputedStyle(d):null,h=u?u.flexDirection:null,f=Bl(e,"sizes")||t.map(function(){return 100/t.length}),g=Bl(e,"minSize",100),m=Array.isArray(g)?g:t.map(function(){return g}),p=Bl(e,"maxSize",1/0),v=Array.isArray(p)?p:t.map(function(){return p}),b=Bl(e,"expandToMin",!1),y=Bl(e,"gutterSize",10),C=Bl(e,"gutterAlign","center"),S=Bl(e,"snapOffset",30),E=Array.isArray(S)?S:t.map(function(){return S}),L=Bl(e,"dragInterval",1),N=Bl(e,"direction",YA),I=Bl(e,"cursor",N===YA?"col-resize":"row-resize"),D=Bl(e,"gutter",K2t),R=Bl(e,"elementStyle",Y2t),O=Bl(e,"gutterStyle",X2t);N===YA?(i="width",r="clientX",s="left",o="right",a="clientWidth"):N==="vertical"&&(i="height",r="clientY",s="top",o="bottom",a="clientHeight");function M(G,X,Z,ne){var oe=R(i,X,Z,ne);Object.keys(oe).forEach(function(de){G.style[de]=oe[de]})}function P(G,X,Z){var ne=O(i,X,Z);Object.keys(ne).forEach(function(oe){G.style[oe]=ne[oe]})}function B(){return l.map(function(G){return G.size})}function H(G){return"touches"in G?G.touches[0][r]:G[r]}function W(G){var X=l[this.a],Z=l[this.b],ne=X.size+Z.size;X.size=G/this.size*ne,Z.size=ne-G/this.size*ne,M(X.element,X.size,this[Ah],X.i),M(Z.element,Z.size,this[Mp],Z.i)}function V(G){var X,Z=l[this.a],ne=l[this.b];this.dragging&&(X=H(G)-this.start+(this[Ah]-this.dragOffset),L>1&&(X=Math.round(X/L)*L),X<=Z.minSize+Z.snapOffset+this[Ah]?X=Z.minSize+this[Ah]:X>=this.size-(ne.minSize+ne.snapOffset+this[Mp])&&(X=this.size-(ne.minSize+this[Mp])),X>=Z.maxSize-Z.snapOffset+this[Ah]?X=Z.maxSize+this[Ah]:X<=this.size-(ne.maxSize-ne.snapOffset+this[Mp])&&(X=this.size-(ne.maxSize+this[Mp])),W.call(this,X),Bl(e,"onDrag",Oh)(B()))}function $(){var G=l[this.a].element,X=l[this.b].element,Z=G[SK](),ne=X[SK]();this.size=Z[i]+ne[i]+this[Ah]+this[Mp],this.start=Z[s],this.end=Z[o]}function F(G){if(!getComputedStyle)return null;var X=getComputedStyle(G);if(!X)return null;var Z=G[a];return Z===0?null:(N===YA?Z-=parseFloat(X.paddingLeft)+parseFloat(X.paddingRight):Z-=parseFloat(X.paddingTop)+parseFloat(X.paddingBottom),Z)}function j(G){var X=F(d);if(X===null||m.reduce(function(de,ye){return de+ye},0)>X)return G;var Z=0,ne=[],oe=G.map(function(de,ye){var Se=X*de/100,Ce=XA(y,ye===0,ye===G.length-1,C),Le=m[ye]+Ce;return Se<Le?(Z+=Le-Se,ne.push(0),Le):(ne.push(Se-Le),Se)});return Z===0?G:oe.map(function(de,ye){var Se=de;if(Z>0&&ne[ye]-Z>0){var Ce=Math.min(Z,ne[ye]-Z);Z-=Ce,Se=de-Ce}return Se/X*100})}function q(){var G=this,X=l[G.a].element,Z=l[G.b].element;G.dragging&&Bl(e,"onDragEnd",Oh)(B()),G.dragging=!1,Vu[Mh]("mouseup",G.stop),Vu[Mh]("touchend",G.stop),Vu[Mh]("touchcancel",G.stop),Vu[Mh]("mousemove",G.move),Vu[Mh]("touchmove",G.move),G.stop=null,G.move=null,X[Mh]("selectstart",Oh),X[Mh]("dragstart",Oh),Z[Mh]("selectstart",Oh),Z[Mh]("dragstart",Oh),X.style.userSelect="",X.style.webkitUserSelect="",X.style.MozUserSelect="",X.style.pointerEvents="",Z.style.userSelect="",Z.style.webkitUserSelect="",Z.style.MozUserSelect="",Z.style.pointerEvents="",G.gutter.style.cursor="",G.parent.style.cursor="",iT.body.style.cursor=""}function U(G){if(!("button"in G&&G.button!==0)){var X=this,Z=l[X.a].element,ne=l[X.b].element;X.dragging||Bl(e,"onDragStart",Oh)(B()),G.preventDefault(),X.dragging=!0,X.move=V.bind(X),X.stop=q.bind(X),Vu[Rh]("mouseup",X.stop),Vu[Rh]("touchend",X.stop),Vu[Rh]("touchcancel",X.stop),Vu[Rh]("mousemove",X.move),Vu[Rh]("touchmove",X.move),Z[Rh]("selectstart",Oh),Z[Rh]("dragstart",Oh),ne[Rh]("selectstart",Oh),ne[Rh]("dragstart",Oh),Z.style.userSelect="none",Z.style.webkitUserSelect="none",Z.style.MozUserSelect="none",Z.style.pointerEvents="none",ne.style.userSelect="none",ne.style.webkitUserSelect="none",ne.style.MozUserSelect="none",ne.style.pointerEvents="none",X.gutter.style.cursor=I,X.parent.style.cursor=I,iT.body.style.cursor=I,$.call(X),X.dragOffset=H(G)-X.end}}f=j(f);var K=[];l=t.map(function(G,X){var Z={element:Axe(G),size:f[X],minSize:m[X],maxSize:v[X],snapOffset:E[X],i:X},ne;if(X>0&&(ne={a:X-1,b:X,dragging:!1,direction:N,parent:d},ne[Ah]=XA(y,X-1===0,!1,C),ne[Mp]=XA(y,!1,X===t.length-1,C),h==="row-reverse"||h==="column-reverse")){var oe=ne.a;ne.a=ne.b,ne.b=oe}if(X>0){var de=D(X,N,Z.element);P(de,y,X),ne[nI]=U.bind(ne),de[Rh]("mousedown",ne[nI]),de[Rh]("touchstart",ne[nI]),d.insertBefore(de,Z.element),ne.gutter=de}return M(Z.element,Z.size,XA(y,X===0,X===t.length-1,C),X),X>0&&K.push(ne),Z});function Q(G){var X=G.i===K.length,Z=X?K[G.i-1]:K[G.i];$.call(Z);var ne=X?Z.size-G.minSize-Z[Mp]:G.minSize+Z[Ah];W.call(Z,ne)}l.forEach(function(G){var X=G.element[SK]()[i];X<G.minSize&&(b?Q(G):G.minSize=X)});function se(G){var X=j(G);X.forEach(function(Z,ne){if(ne>0){var oe=K[ne-1],de=l[oe.a],ye=l[oe.b];de.size=X[ne-1],ye.size=Z,M(de.element,de.size,oe[Ah],de.i),M(ye.element,ye.size,oe[Mp],ye.i)}})}function J(G,X){K.forEach(function(Z){if(X!==!0?Z.parent.removeChild(Z.gutter):(Z.gutter[Mh]("mousedown",Z[nI]),Z.gutter[Mh]("touchstart",Z[nI])),G!==!0){var ne=R(i,Z.a.size,Z[Ah]);Object.keys(ne).forEach(function(oe){l[Z.a].element.style[oe]="",l[Z.b].element.style[oe]=""})}})}return{setSizes:se,getSizes:B,collapse:function(X){Q(l[X])},destroy:J,parent:d,pairs:K}};function wK(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)===-1&&(t[i]=n[i]);return t}var eC=function(n){function e(){n.apply(this,arguments)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.componentDidMount=function(){var i=this.props;i.children;var r=i.gutter,s=wK(i,["children","gutter"]),o=s;o.gutter=function(a,l){var c;return r?c=r(a,l):(c=document.createElement("div"),c.className="gutter gutter-"+l),c.__isSplitGutter=!0,c},this.split=Oxe(this.parent.children,o)},e.prototype.componentDidUpdate=function(i){var r=this,s=this.props;s.children;var o=s.minSize,a=s.sizes,l=s.collapsed,c=wK(s,["children","minSize","sizes","collapsed"]),d=c,u=i.minSize,h=i.sizes,f=i.collapsed,g=["maxSize","expandToMin","gutterSize","gutterAlign","snapOffset","dragInterval","direction","cursor"],m=g.map(function(b){return r.props[b]!==i[b]}).reduce(function(b,y){return b||y},!1);if(Array.isArray(o)&&Array.isArray(u)){var p=!1;o.forEach(function(b,y){p=p||b!==u[y]}),m=m||p}else Array.isArray(o)||Array.isArray(u)?m=!0:m=m||o!==u;if(m)d.minSize=o,d.sizes=a||this.split.getSizes(),this.split.destroy(!0,!0),d.gutter=function(b,y,C){return C.previousSibling},this.split=Oxe(Array.from(this.parent.children).filter(function(b){return!b.__isSplitGutter}),d);else if(a){var v=!1;a.forEach(function(b,y){v=v||b!==h[y]}),v&&this.split.setSizes(this.props.sizes)}Number.isInteger(l)&&(l!==f||m)&&this.split.collapse(l)},e.prototype.componentWillUnmount=function(){this.split.destroy(),delete this.split},e.prototype.render=function(){var i=this,r=this.props;r.sizes,r.minSize,r.maxSize,r.expandToMin,r.gutterSize,r.gutterAlign,r.snapOffset,r.dragInterval,r.direction,r.cursor,r.gutter,r.elementStyle,r.gutterStyle,r.onDrag,r.onDragStart,r.onDragEnd,r.collapsed;var s=r.children,o=wK(r,["sizes","minSize","maxSize","expandToMin","gutterSize","gutterAlign","snapOffset","dragInterval","direction","cursor","gutter","elementStyle","gutterStyle","onDrag","onDragStart","onDragEnd","collapsed","children"]),a=o;return ke.createElement("div",Object.assign({},{ref:function(l){i.parent=l}},a),s)},e}(ke.Component);eC.propTypes={sizes:ms.arrayOf(ms.number),minSize:ms.oneOfType([ms.number,ms.arrayOf(ms.number)]),maxSize:ms.oneOfType([ms.number,ms.arrayOf(ms.number)]),expandToMin:ms.bool,gutterSize:ms.number,gutterAlign:ms.string,snapOffset:ms.oneOfType([ms.number,ms.arrayOf(ms.number)]),dragInterval:ms.number,direction:ms.string,cursor:ms.string,gutter:ms.func,elementStyle:ms.func,gutterStyle:ms.func,onDrag:ms.func,onDragStart:ms.func,onDragEnd:ms.func,collapsed:ms.number,children:ms.arrayOf(ms.element)};eC.defaultProps={sizes:void 0,minSize:void 0,maxSize:void 0,expandToMin:void 0,gutterSize:void 0,gutterAlign:void 0,snapOffset:void 0,dragInterval:void 0,direction:void 0,cursor:void 0,gutter:void 0,elementStyle:void 0,gutterStyle:void 0,onDrag:void 0,onDragStart:void 0,onDragEnd:void 0,collapsed:void 0,children:void 0};const al=[];for(let n=0;n<256;++n)al.push((n+256).toString(16).slice(1));function Z2t(n,e=0){return(al[n[e+0]]+al[n[e+1]]+al[n[e+2]]+al[n[e+3]]+"-"+al[n[e+4]]+al[n[e+5]]+"-"+al[n[e+6]]+al[n[e+7]]+"-"+al[n[e+8]]+al[n[e+9]]+"-"+al[n[e+10]]+al[n[e+11]]+al[n[e+12]]+al[n[e+13]]+al[n[e+14]]+al[n[e+15]]).toLowerCase()}let xK;const Q2t=new Uint8Array(16);function J2t(){if(!xK){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");xK=crypto.getRandomValues.bind(crypto)}return xK(Q2t)}const eNt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Pxe={randomUUID:eNt};function g3(n,e,t){var r;if(Pxe.randomUUID&&!n)return Pxe.randomUUID();n=n||{};const i=n.random??((r=n.rng)==null?void 0:r.call(n))??J2t();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,Z2t(i)}const tNt=({chatListName:n,chatLists:e,setChatListName:t,loadChatList:i,setCurrentSessionName:r,showNewChatModal:s,deleteChatList:o,getChatTitle:a,renameChatList:l=async()=>!1})=>{const[c,d]=_.useState(!1),[u,h]=_.useState(null),[f,g]=_.useState(""),m=_.useRef(null),p=10,v=100,b=async I=>{fs.confirm({title:"确认删除",content:`确定要删除对话 "${I}" 吗?此操作不可撤销。`,okText:"删除",okType:"danger",cancelText:"取消",onOk:async()=>{await o(I),pt.success("对话已删除")}})},y=(I,D)=>{D&&D.stopPropagation(),h(I),g(I),setTimeout(()=>{var R;(R=m.current)==null||R.focus()},0)},C=I=>{I&&I.stopPropagation(),h(null)},S=async(I,D)=>{if(D&&D.stopPropagation(),!f.trim()){pt.error("对话名称不能为空");return}if(f===I){h(null);return}if(e.includes(f)){pt.error("已存在同名对话");return}await l(I,f)?(pt.success("对话已重命名"),n===I&&(t(f),await r(f))):pt.error("重命名失败"),h(null)},E=c?e.slice(0,v):e.slice(0,p),L=e.length>p,N=[{key:"new-chat",label:x.jsxs("div",{className:"flex items-center w-full group text-white font-medium",children:[x.jsx(xa,{className:"mr-1",style:{fontSize:"12px"}}),x.jsx("span",{children:"新建对话"})]})},...E.length>0?[{type:"divider"}]:[],...E.map(I=>({key:I,label:x.jsx("div",{className:`flex justify-between items-center w-full group ${n===I?"bg-indigo-700/40 rounded-sm":""}`,onClick:D=>{u===I&&D.stopPropagation()},children:u===I?x.jsxs("div",{className:"flex items-center w-full",onClick:D=>D.stopPropagation(),children:[x.jsx(ei,{ref:m,value:f,onChange:D=>g(D.target.value),onPressEnter:()=>S(I),size:"small",className:"mr-1 text-black",autoFocus:!0}),x.jsx(sn,{type:"text",size:"small",className:"text-green-500 p-0 flex items-center justify-center",icon:x.jsx(Tb,{}),onClick:D=>S(I,D)}),x.jsx(sn,{type:"text",size:"small",className:"text-red-500 p-0 flex items-center justify-center",icon:x.jsx($f,{}),onClick:C})]}):x.jsxs(x.Fragment,{children:[x.jsx("span",{className:`truncate max-w-[150px] ${n===I?"text-white font-medium":"text-gray-200"}`,children:I}),x.jsxs("div",{className:"flex opacity-0 group-hover:opacity-100 transition-opacity",children:[x.jsx(sn,{type:"text",size:"small",className:"text-white p-0 mx-1 flex items-center justify-center",icon:x.jsx(kd,{}),onClick:D=>y(I,D)}),x.jsx(sn,{type:"text",size:"small",className:"text-white p-0 flex items-center justify-center",icon:x.jsx(Jl,{}),onClick:D=>{D.stopPropagation(),b(I)}})]})]})})})),...L&&!c?[{key:"show-more",label:x.jsxs("div",{className:"flex items-center justify-center w-full text-gray-300 hover:text-white py-1 border-t border-gray-700 mt-1",children:[x.jsx(oR,{className:"mr-1",style:{fontSize:"10px"}}),x.jsxs("span",{children:["显示更多 (",Math.min(e.length-p,v-p),")"]})]})}]:[],...c&&L?[{key:"show-less",label:x.jsx("div",{className:"flex items-center justify-center w-full text-gray-300 hover:text-white py-1 border-t border-gray-700 mt-1",children:x.jsx("span",{children:"收起"})})}]:[]];return x.jsx(xk,{menu:{items:N,onClick:async({key:I})=>{I==="new-chat"?s():I==="show-more"?d(!0):I==="show-less"?d(!1):(t(I),await i(I),await r(I))},style:{backgroundColor:"#1F2937",borderColor:"#4B5563",color:"#FFFFFF"}},trigger:["click"],placement:"bottomRight",arrow:{pointAtCenter:!0},children:x.jsx(rr,{title:n||a(),children:x.jsx(sn,{icon:x.jsx(SQ,{style:{fontSize:"12px"}}),size:"small",className:`flex items-center justify-center text-gray-300 border-gray-600 ${n?"bg-indigo-600 hover:bg-indigo-700 border-indigo-500":"bg-gray-700 hover:bg-gray-600"} px-1 py-0 h-6 w-6`})})})},nNt=async n=>{const e=new FormData;e.append("file",n);const t=await fetch("/api/upload/image",{method:"POST",body:e});if(!t.ok)throw new Error("Upload failed");return await t.json()};function Gd(n,e=0){return n[n.length-(1+e)]}function iNt(n){if(n.length===0)throw new Error("Invalid tail call");return[n.slice(0,n.length-1),n[n.length-1]]}function zr(n,e,t=(i,r)=>i===r){if(n===e)return!0;if(!n||!e||n.length!==e.length)return!1;for(let i=0,r=n.length;i<r;i++)if(!t(n[i],e[i]))return!1;return!0}function rNt(n,e){const t=n.length-1;e<t&&(n[e]=n[t]),n.pop()}function rT(n,e,t){return sNt(n.length,i=>t(n[i],e))}function sNt(n,e){let t=0,i=n-1;for(;t<=i;){const r=(t+i)/2|0,s=e(r);if(s<0)t=r+1;else if(s>0)i=r-1;else return r}return-(t+1)}function zQ(n,e,t){if(n=n|0,n>=e.length)throw new TypeError("invalid index");const i=e[Math.floor(e.length*Math.random())],r=[],s=[],o=[];for(const a of e){const l=t(a,i);l<0?r.push(a):l>0?s.push(a):o.push(a)}return n<r.length?zQ(n,r,t):n<r.length+o.length?o[0]:zQ(n-(r.length+o.length),s,t)}function Fxe(n,e){const t=[];let i;for(const r of n.slice(0).sort(e))!i||e(i[0],r)!==0?(i=[r],t.push(i)):i.push(r);return t}function*Ale(n,e){let t,i;for(const r of n)i!==void 0&&e(i,r)?t.push(r):(t&&(yield t),t=[r]),i=r;t&&(yield t)}function O3e(n,e){for(let t=0;t<=n.length;t++)e(t===0?void 0:n[t-1],t===n.length?void 0:n[t])}function oNt(n,e){for(let t=0;t<n.length;t++)e(t===0?void 0:n[t-1],n[t],t+1===n.length?void 0:n[t+1])}function hh(n){return n.filter(e=>!!e)}function Bxe(n){let e=0;for(let t=0;t<n.length;t++)n[t]&&(n[e]=n[t],e+=1);n.length=e}function P3e(n){return!Array.isArray(n)||n.length===0}function Xa(n){return Array.isArray(n)&&n.length>0}function zm(n,e=t=>t){const t=new Set;return n.filter(i=>{const r=e(i);return t.has(r)?!1:(t.add(r),!0)})}function Ole(n,e){return n.length>0?n[0]:e}function Hl(n,e){let t=typeof e=="number"?n:0;typeof e=="number"?t=n:(t=0,e=n);const i=[];if(t<=e)for(let r=t;r<e;r++)i.push(r);else for(let r=t;r>e;r--)i.push(r);return i}function C8(n,e,t){const i=n.slice(0,e),r=n.slice(e);return i.concat(t,r)}function EK(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.unshift(e))}function ZA(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.push(e))}function VQ(n,e){for(const t of e)n.push(t)}function Ple(n){return Array.isArray(n)?n:[n]}function aNt(n,e,t){const i=F3e(n,e),r=n.length,s=t.length;n.length=r+s;for(let o=r-1;o>=i;o--)n[o+s]=n[o];for(let o=0;o<s;o++)n[o+i]=t[o]}function $xe(n,e,t,i){const r=F3e(n,e);let s=n.splice(r,t);return s===void 0&&(s=[]),aNt(n,r,i),s}function F3e(n,e){return e<0?Math.max(e+n.length,0):Math.min(e,n.length)}var sT;(function(n){function e(s){return s<0}n.isLessThan=e;function t(s){return s<=0}n.isLessThanOrEqual=t;function i(s){return s>0}n.isGreaterThan=i;function r(s){return s===0}n.isNeitherLessOrGreaterThan=r,n.greaterThan=1,n.lessThan=-1,n.neitherLessOrGreaterThan=0})(sT||(sT={}));function bl(n,e){return(t,i)=>e(n(t),n(i))}function lNt(...n){return(e,t)=>{for(const i of n){const r=i(e,t);if(!sT.isNeitherLessOrGreaterThan(r))return r}return sT.neitherLessOrGreaterThan}}const lh=(n,e)=>n-e,cNt=(n,e)=>lh(n?1:0,e?1:0);function B3e(n){return(e,t)=>-n(e,t)}class Vm{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t<this.items.length&&e(this.items[t]);)t++;const i=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,i}takeFromEndWhile(e){let t=this.lastIdx;for(;t>=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}const tx=class tx{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new tx(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new tx(t=>this.iterate(i=>t(e(i))))}findLast(e){let t;return this.iterate(i=>(e(i)&&(t=i),!0)),t}findLastMaxBy(e){let t,i=!0;return this.iterate(r=>((i||sT.isGreaterThan(e(r,t)))&&(i=!1,t=r),!0)),t}};tx.empty=new tx(e=>{});let Dy=tx;class p3{constructor(e){this._indexMap=e}static createSortPermutation(e,t){const i=Array.from(e.keys()).sort((r,s)=>t(e[r],e[s]));return new p3(i)}apply(e){return e.map((t,i)=>e[this._indexMap[i]])}inverse(){const e=this._indexMap.slice();for(let t=0;t<this._indexMap.length;t++)e[this._indexMap[t]]=t;return new p3(e)}}function Xl(n){return typeof n=="string"}function Do(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&!(n instanceof RegExp)&&!(n instanceof Date)}function dNt(n){const e=Object.getPrototypeOf(Uint8Array);return typeof n=="object"&&n instanceof e}function m_(n){return typeof n=="number"&&!isNaN(n)}function Hxe(n){return!!n&&typeof n[Symbol.iterator]=="function"}function $3e(n){return n===!0||n===!1}function Ya(n){return typeof n>"u"}function Hg(n){return!fd(n)}function fd(n){return Ya(n)||n===null}function Mi(n,e){if(!n)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function gb(n){if(fd(n))throw new Error("Assertion Failed: argument is undefined or null");return n}function oT(n){return typeof n=="function"}function uNt(n,e){const t=Math.min(n.length,e.length);for(let i=0;i<t;i++)hNt(n[i],e[i])}function hNt(n,e){if(Xl(e)){if(typeof n!==e)throw new Error(`argument does not match constraint: typeof ${e}`)}else if(oT(e)){try{if(n instanceof e)return}catch{}if(!fd(n)&&n.constructor===e||e.length===1&&e.call(void 0,n)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function nm(n){if(!n||typeof n!="object"||n instanceof RegExp)return n;const e=Array.isArray(n)?[]:{};return Object.entries(n).forEach(([t,i])=>{e[t]=i&&typeof i=="object"?nm(i):i}),e}function fNt(n){if(!n||typeof n!="object")return n;const e=[n];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(H3e.call(t,i)){const r=t[i];typeof r=="object"&&!Object.isFrozen(r)&&!dNt(r)&&e.push(r)}}return n}const H3e=Object.prototype.hasOwnProperty;function j3e(n,e){return UQ(n,e,new Set)}function UQ(n,e,t){if(fd(n))return n;const i=e(n);if(typeof i<"u")return i;if(Array.isArray(n)){const r=[];for(const s of n)r.push(UQ(s,e,t));return r}if(Do(n)){if(t.has(n))throw new Error("Cannot clone recursive data-structure");t.add(n);const r={};for(const s in n)H3e.call(n,s)&&(r[s]=UQ(n[s],e,t));return t.delete(n),r}return n}function S8(n,e,t=!0){return Do(n)?(Do(e)&&Object.keys(e).forEach(i=>{i in n?t&&(Do(n[i])&&Do(e[i])?S8(n[i],e[i],t):n[i]=e[i]):n[i]=e[i]}),n):e}function Ic(n,e){if(n===e)return!0;if(n==null||e===null||e===void 0||typeof n!=typeof e||typeof n!="object"||Array.isArray(n)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(n)){if(n.length!==e.length)return!1;for(t=0;t<n.length;t++)if(!Ic(n[t],e[t]))return!1}else{const r=[];for(i in n)r.push(i);r.sort();const s=[];for(i in e)s.push(i);if(s.sort(),!Ic(r,s))return!1;for(t=0;t<r.length;t++)if(!Ic(n[r[t]],e[r[t]]))return!1}return!0}function gNt(n){let e=[];for(;Object.prototype!==n;)e=e.concat(Object.getOwnPropertyNames(n)),n=Object.getPrototypeOf(n);return e}function qQ(n){const e=[];for(const t of gNt(n))typeof n[t]=="function"&&e.push(t);return e}function pNt(n,e){const t=r=>function(){const s=Array.prototype.slice.call(arguments,0);return e(r,s)},i={};for(const r of n)i[r]=t(r);return i}function W3e(){return globalThis._VSCODE_NLS_MESSAGES}function Fle(){return globalThis._VSCODE_NLS_LANGUAGE}const mNt=Fle()==="pseudo"||typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function m3(n,e){let t;return e.length===0?t=n:t=n.replace(/\{(\d+)\}/g,(i,r)=>{const s=r[0],o=e[s];let a=i;return typeof o=="string"?a=o:(typeof o=="number"||typeof o=="boolean"||o===void 0||o===null)&&(a=String(o)),a}),mNt&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function T(n,e,...t){return m3(typeof n=="number"?z3e(n,e):e,t)}function z3e(n,e){var i;const t=(i=W3e())==null?void 0:i[n];if(typeof t!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${n} !!!`)}return t}function wn(n,e,...t){let i;typeof n=="number"?i=z3e(n,e):i=e;const r=m3(i,t);return{value:r,original:e===i?r:m3(e,t)}}const Nw="en";let v3=!1,b3=!1,UP=!1,V3e=!1,Ble=!1,$le=!1,U3e=!1,QA,qP=Nw,jxe=Nw,vNt,Fh;const Tm=globalThis;let ll;var wDe;typeof Tm.vscode<"u"&&typeof Tm.vscode.process<"u"?ll=Tm.vscode.process:typeof process<"u"&&typeof((wDe=process==null?void 0:process.versions)==null?void 0:wDe.node)=="string"&&(ll=process);var xDe;const bNt=typeof((xDe=ll==null?void 0:ll.versions)==null?void 0:xDe.electron)=="string",_Nt=bNt&&(ll==null?void 0:ll.type)==="renderer";var EDe;if(typeof ll=="object"){v3=ll.platform==="win32",b3=ll.platform==="darwin",UP=ll.platform==="linux",UP&&ll.env.SNAP&&ll.env.SNAP_REVISION,ll.env.CI||ll.env.BUILD_ARTIFACTSTAGINGDIRECTORY,QA=Nw,qP=Nw;const n=ll.env.VSCODE_NLS_CONFIG;if(n)try{const e=JSON.parse(n);QA=e.userLocale,jxe=e.osLocale,qP=e.resolvedLanguage||Nw,vNt=(EDe=e.languagePack)==null?void 0:EDe.translationsConfigFile}catch{}V3e=!0}else typeof navigator=="object"&&!_Nt?(Fh=navigator.userAgent,v3=Fh.indexOf("Windows")>=0,b3=Fh.indexOf("Macintosh")>=0,$le=(Fh.indexOf("Macintosh")>=0||Fh.indexOf("iPad")>=0||Fh.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,UP=Fh.indexOf("Linux")>=0,U3e=(Fh==null?void 0:Fh.indexOf("Mobi"))>=0,Ble=!0,qP=Fle()||Nw,QA=navigator.language.toLowerCase(),jxe=QA):console.error("Unable to resolve platform.");const ua=v3,ci=b3,Sl=UP,Qg=V3e,UC=Ble,yNt=Ble&&typeof Tm.importScripts=="function",CNt=yNt?Tm.origin:void 0,If=$le,q3e=U3e,Jg=Fh,SNt=qP,wNt=typeof Tm.postMessage=="function"&&!Tm.importScripts,G3e=(()=>{if(wNt){const n=[];Tm.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,r=n.length;i<r;i++){const s=n[i];if(s.id===t.data.vscodeScheduleAsyncWork){n.splice(i,1),s.callback();return}}});let e=0;return t=>{const i=++e;n.push({id:i,callback:t}),Tm.postMessage({vscodeScheduleAsyncWork:i},"*")}}return n=>setTimeout(n)})(),Lc=b3||$le?2:v3?1:3;let Wxe=!0,zxe=!1;function K3e(){if(!zxe){zxe=!0;const n=new Uint8Array(2);n[0]=1,n[1]=2,Wxe=new Uint16Array(n.buffer)[0]===513}return Wxe}const Y3e=!!(Jg&&Jg.indexOf("Chrome")>=0),xNt=!!(Jg&&Jg.indexOf("Firefox")>=0),ENt=!!(!Y3e&&Jg&&Jg.indexOf("Safari")>=0),kNt=!!(Jg&&Jg.indexOf("Edg/")>=0),LNt=!!(Jg&&Jg.indexOf("Android")>=0),ya={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var _i;(function(n){function e(C){return C&&typeof C=="object"&&typeof C[Symbol.iterator]=="function"}n.is=e;const t=Object.freeze([]);function i(){return t}n.empty=i;function*r(C){yield C}n.single=r;function s(C){return e(C)?C:r(C)}n.wrap=s;function o(C){return C||t}n.from=o;function*a(C){for(let S=C.length-1;S>=0;S--)yield C[S]}n.reverse=a;function l(C){return!C||C[Symbol.iterator]().next().done===!0}n.isEmpty=l;function c(C){return C[Symbol.iterator]().next().value}n.first=c;function d(C,S){let E=0;for(const L of C)if(S(L,E++))return!0;return!1}n.some=d;function u(C,S){for(const E of C)if(S(E))return E}n.find=u;function*h(C,S){for(const E of C)S(E)&&(yield E)}n.filter=h;function*f(C,S){let E=0;for(const L of C)yield S(L,E++)}n.map=f;function*g(C,S){let E=0;for(const L of C)yield*S(L,E++)}n.flatMap=g;function*m(...C){for(const S of C)yield*S}n.concat=m;function p(C,S,E){let L=E;for(const N of C)L=S(L,N);return L}n.reduce=p;function*v(C,S,E=C.length){for(S<0&&(S+=C.length),E<0?E+=C.length:E>C.length&&(E=C.length);S<E;S++)yield C[S]}n.slice=v;function b(C,S=Number.POSITIVE_INFINITY){const E=[];if(S===0)return[E,C];const L=C[Symbol.iterator]();for(let N=0;N<S;N++){const I=L.next();if(I.done)return[E,n.empty()];E.push(I.value)}return[E,{[Symbol.iterator](){return L}}]}n.consume=b;async function y(C){const S=[];for await(const E of C)S.push(E);return Promise.resolve(S)}n.asyncToArray=y})(_i||(_i={}));var Sm;let fo=(Sm=class{constructor(e){this.element=e,this.next=Sm.Undefined,this.prev=Sm.Undefined}},Sm.Undefined=new Sm(void 0),Sm);class hl{constructor(){this._first=fo.Undefined,this._last=fo.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===fo.Undefined}clear(){let e=this._first;for(;e!==fo.Undefined;){const t=e.next;e.prev=fo.Undefined,e.next=fo.Undefined,e=t}this._first=fo.Undefined,this._last=fo.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new fo(e);if(this._first===fo.Undefined)this._first=i,this._last=i;else if(t){const s=this._last;this._last=i,i.prev=s,s.next=i}else{const s=this._first;this._first=i,i.next=s,s.prev=i}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(i))}}shift(){if(this._first!==fo.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==fo.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==fo.Undefined&&e.next!==fo.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===fo.Undefined&&e.next===fo.Undefined?(this._first=fo.Undefined,this._last=fo.Undefined):e.next===fo.Undefined?(this._last=this._last.prev,this._last.next=fo.Undefined):e.prev===fo.Undefined&&(this._first=this._first.next,this._first.prev=fo.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==fo.Undefined;)yield e.element,e=e.next}}const _3="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function INt(n=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of _3)n.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const Hle=INt();function jle(n){let e=Hle;if(n&&n instanceof RegExp)if(n.global)e=n;else{let t="g";n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.unicode&&(t+="u"),e=new RegExp(n.source,t)}return e.lastIndex=0,e}const X3e=new hl;X3e.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function aT(n,e,t,i,r){if(e=jle(e),r||(r=_i.first(X3e)),t.length>r.maxLen){let c=n-r.maxLen/2;return c<0?c=0:i+=c,t=t.substring(c,n+r.maxLen/2),aT(n,e,t,i,r)}const s=Date.now(),o=n-1-i;let a=-1,l=null;for(let c=1;!(Date.now()-s>=r.timeBudget);c++){const d=o-r.windowSize*c;e.lastIndex=Math.max(0,d);const u=NNt(e,t,o,a);if(!u&&l||(l=u,d<=0))break;a=d}if(l){const c={word:l[0],startColumn:i+1+l.index,endColumn:i+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function NNt(n,e,t,i){let r;for(;r=n.exec(e);){const s=r.index||0;if(s<=t&&n.lastIndex>=t)return r;if(i>0&&s>i)return null}return null}const lg=8;class Z3e{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class Q3e{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class Fr{constructor(e,t,i,r){this.id=e,this.name=t,this.defaultValue=i,this.schema=r}applyUpdate(e,t){return w8(e,t)}compute(e,t,i){return i}}class T2{constructor(e,t){this.newValue=e,this.didChange=t}}function w8(n,e){if(typeof n!="object"||typeof e!="object"||!n||!e)return new T2(e,n!==e);if(Array.isArray(n)||Array.isArray(e)){const i=Array.isArray(n)&&Array.isArray(e)&&zr(n,e);return new T2(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const r=w8(n[i],e[i]);r.didChange&&(n[i]=r.newValue,t=!0)}return new T2(n,t)}class wR{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return w8(e,t)}validate(e){return this.defaultValue}}class Dk{constructor(e,t,i,r){this.id=e,this.name=t,this.defaultValue=i,this.schema=r}applyUpdate(e,t){return w8(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}}function en(n,e){return typeof n>"u"?e:n==="false"?!1:!!n}class Di extends Dk{constructor(e,t,i,r=void 0){typeof r<"u"&&(r.type="boolean",r.default=i),super(e,t,i,r)}validate(e){return en(e,this.defaultValue)}}function A0(n,e,t,i){if(typeof n>"u")return e;let r=parseInt(n,10);return isNaN(r)?e:(r=Math.max(t,r),r=Math.min(i,r),r|0)}class mr extends Dk{static clampedInt(e,t,i,r){return A0(e,t,i,r)}constructor(e,t,i,r,s,o=void 0){typeof o<"u"&&(o.type="integer",o.default=i,o.minimum=r,o.maximum=s),super(e,t,i,o),this.minimum=r,this.maximum=s}validate(e){return mr.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function TNt(n,e,t,i){if(typeof n>"u")return e;const r=vd.float(n,e);return vd.clamp(r,t,i)}class vd extends Dk{static clamp(e,t,i){return e<t?t:e>i?i:e}static float(e,t){if(typeof e=="number")return e;if(typeof e>"u")return t;const i=parseFloat(e);return isNaN(i)?t:i}constructor(e,t,i,r,s){typeof s<"u"&&(s.type="number",s.default=i),super(e,t,i,s),this.validationFn=r}validate(e){return this.validationFn(vd.float(e,this.defaultValue))}}class Ga extends Dk{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,i,r=void 0){typeof r<"u"&&(r.type="string",r.default=i),super(e,t,i,r)}validate(e){return Ga.string(e,this.defaultValue)}}function ls(n,e,t,i){return typeof n!="string"?e:i&&n in i?i[n]:t.indexOf(n)===-1?e:n}class os extends Dk{constructor(e,t,i,r,s=void 0){typeof s<"u"&&(s.type="string",s.enum=r,s.default=i),super(e,t,i,s),this._allowedValues=r}validate(e){return ls(e,this.defaultValue,this._allowedValues)}}class JA extends Fr{constructor(e,t,i,r,s,o,a=void 0){typeof a<"u"&&(a.type="string",a.enum=s,a.default=r),super(e,t,i,a),this._allowedValues=s,this._convert=o}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function DNt(n){switch(n){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class RNt extends Fr{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[T("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached."),T("accessibilitySupport.on","Optimize for usage with a Screen Reader."),T("accessibilitySupport.off","Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:T("accessibilitySupport","Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return i===0?e.accessibilitySupport:i}}class MNt extends Fr{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:T("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:T("comments.ignoreEmptyLines","Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertSpace:en(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:en(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function ANt(n){switch(n){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var Wo;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(Wo||(Wo={}));function ONt(n){switch(n){case"line":return Wo.Line;case"block":return Wo.Block;case"underline":return Wo.Underline;case"line-thin":return Wo.LineThin;case"block-outline":return Wo.BlockOutline;case"underline-thin":return Wo.UnderlineThin}}class PNt extends wR{constructor(){super(143)}compute(e,t,i){const r=["monaco-editor"];return t.get(39)&&r.push(t.get(39)),e.extraEditorClassName&&r.push(e.extraEditorClassName),t.get(74)==="default"?r.push("mouse-default"):t.get(74)==="copy"&&r.push("mouse-copy"),t.get(112)&&r.push("showUnused"),t.get(141)&&r.push("showDeprecated"),r.join(" ")}}class FNt extends Di{constructor(){super(37,"emptySelectionClipboard",!0,{description:T("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class BNt extends Fr{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(41,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:T("find.cursorMoveOnType","Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[T("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),T("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),T("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:T("find.seedSearchStringFromSelection","Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[T("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),T("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),T("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:T("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:T("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:ci},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:T("find.addExtraSpaceOnTop","Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:T("find.loop","Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:en(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":ls(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":ls(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:en(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:en(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:en(t.loop,this.defaultValue.loop)}}}const Zp=class Zp extends Fr{constructor(){super(51,"fontLigatures",Zp.OFF,{anyOf:[{type:"boolean",description:T("fontLigatures","Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:T("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:T("fontLigaturesGeneral","Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"||e.length===0?Zp.OFF:e==="true"?Zp.ON:e:e?Zp.ON:Zp.OFF}};Zp.OFF='"liga" off, "calt" off',Zp.ON='"liga" on, "calt" on';let v_=Zp;const Qp=class Qp extends Fr{constructor(){super(54,"fontVariations",Qp.OFF,{anyOf:[{type:"boolean",description:T("fontVariations","Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:T("fontVariationSettings","Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:T("fontVariationsGeneral","Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?Qp.OFF:e==="true"?Qp.TRANSLATE:e:e?Qp.TRANSLATE:Qp.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}};Qp.OFF="normal",Qp.TRANSLATE="translate";let lT=Qp;class $Nt extends wR{constructor(){super(50)}compute(e,t,i){return e.fontInfo}}class HNt extends Dk{constructor(){super(52,"fontSize",_l.fontSize,{type:"number",minimum:6,maximum:100,default:_l.fontSize,description:T("fontSize","Controls the font size in pixels.")})}validate(e){const t=vd.float(e,this.defaultValue);return t===0?_l.fontSize:vd.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}const gg=class gg extends Fr{constructor(){super(53,"fontWeight",_l.fontWeight,{anyOf:[{type:"number",minimum:gg.MINIMUM_VALUE,maximum:gg.MAXIMUM_VALUE,errorMessage:T("fontWeightErrorMessage",'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:gg.SUGGESTION_VALUES}],default:_l.fontWeight,description:T("fontWeight",'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(mr.clampedInt(e,_l.fontWeight,gg.MINIMUM_VALUE,gg.MAXIMUM_VALUE))}};gg.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"],gg.MINIMUM_VALUE=1,gg.MAXIMUM_VALUE=1e3;let GQ=gg;class jNt extends Fr{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",multipleTests:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:"",alternativeTestsCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[T("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),T("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),T("editor.gotoLocation.multiple.goto","Go to the primary result and enable Peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(58,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:T("editor.gotoLocation.multiple.deprecated","This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":{description:T("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:T("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:T("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:T("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:T("editor.editor.gotoLocation.multipleReferences","Controls the behavior the 'Go to References'-command when multiple target locations exist."),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:T("alternativeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:T("alternativeTypeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:T("alternativeDeclarationCommand","Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:T("alternativeImplementationCommand","Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:T("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{multiple:ls(t.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:t.multipleDefinitions??ls(t.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:t.multipleTypeDefinitions??ls(t.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:t.multipleDeclarations??ls(t.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:t.multipleImplementations??ls(t.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:t.multipleReferences??ls(t.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),multipleTests:t.multipleTests??ls(t.multipleTests,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Ga.string(t.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Ga.string(t.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Ga.string(t.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Ga.string(t.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Ga.string(t.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand),alternativeTestsCommand:Ga.string(t.alternativeTestsCommand,this.defaultValue.alternativeTestsCommand)}}}class WNt extends Fr{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(60,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:T("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:T("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:T("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,description:T("hover.hidingDelay","Controls the delay in milliseconds after which the hover is hidden. Requires `editor.hover.sticky` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:T("hover.above","Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:en(t.enabled,this.defaultValue.enabled),delay:mr.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:en(t.sticky,this.defaultValue.sticky),hidingDelay:mr.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:en(t.above,this.defaultValue.above)}}}class Ex extends wR{constructor(){super(146)}compute(e,t,i){return Ex.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let r=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(r=Math.max(r,t-1));const s=(i+e.viewLineCount+r)/(e.pixelRatio*e.height),o=Math.floor(e.viewLineCount/s);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:r,desiredRatio:s,minimapLineCount:o}}static _computeMinimapLayout(e,t){const i=e.outerWidth,r=e.outerHeight,s=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(s*r),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:r};const o=t.stableMinimapLayoutInput,a=o&&e.outerHeight===o.outerHeight&&e.lineHeight===o.lineHeight&&e.typicalHalfwidthCharacterWidth===o.typicalHalfwidthCharacterWidth&&e.pixelRatio===o.pixelRatio&&e.scrollBeyondLastLine===o.scrollBeyondLastLine&&e.paddingTop===o.paddingTop&&e.paddingBottom===o.paddingBottom&&e.minimap.enabled===o.minimap.enabled&&e.minimap.side===o.minimap.side&&e.minimap.size===o.minimap.size&&e.minimap.showSlider===o.minimap.showSlider&&e.minimap.renderCharacters===o.minimap.renderCharacters&&e.minimap.maxColumn===o.minimap.maxColumn&&e.minimap.scale===o.minimap.scale&&e.verticalScrollbarWidth===o.verticalScrollbarWidth&&e.isViewportWrapping===o.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,d=e.scrollBeyondLastLine,u=e.minimap.renderCharacters;let h=s>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const f=e.minimap.maxColumn,g=e.minimap.size,m=e.minimap.side,p=e.verticalScrollbarWidth,v=e.viewLineCount,b=e.remainingWidth,y=e.isViewportWrapping,C=u?2:3;let S=Math.floor(s*r);const E=S/s;let L=!1,N=!1,I=C*h,D=h/s,R=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:V,extraLinesBeforeFirstLine:$,extraLinesBeyondLastLine:F,desiredRatio:j,minimapLineCount:q}=Ex.computeContainedMinimapLineCount({viewLineCount:v,scrollBeyondLastLine:d,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:r,lineHeight:l,pixelRatio:s});if(v/q>1)L=!0,N=!0,h=1,I=1,D=h/s;else{let K=!1,Q=h+1;if(g==="fit"){const se=Math.ceil(($+v+F)*I);y&&a&&b<=t.stableFitRemainingWidth?(K=!0,Q=t.stableFitMaxMinimapScale):K=se>S}if(g==="fill"||K){L=!0;const se=h;I=Math.min(l*s,Math.max(1,Math.floor(1/j))),y&&a&&b<=t.stableFitRemainingWidth&&(Q=t.stableFitMaxMinimapScale),h=Math.min(Q,Math.max(1,Math.floor(I/C))),h>se&&(R=Math.min(2,h/se)),D=h/s/R,S=Math.ceil(Math.max(V,$+v+F)*I),y?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=b,t.stableFitMaxMinimapScale=h):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const O=Math.floor(f*D),M=Math.min(O,Math.max(0,Math.floor((b-p-2)*D/(c+D)))+lg);let P=Math.floor(s*M);const B=P/s;P=Math.floor(P*R);const H=u?1:2,W=m==="left"?0:i-M-p;return{renderMinimap:H,minimapLeft:W,minimapWidth:M,minimapHeightIsEditorHeight:L,minimapIsSampling:N,minimapScale:h,minimapLineHeight:I,minimapCanvasInnerWidth:P,minimapCanvasInnerHeight:S,minimapCanvasOuterWidth:B,minimapCanvasOuterHeight:E}}static computeLayout(e,t){const i=t.outerWidth|0,r=t.outerHeight|0,s=t.lineHeight|0,o=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,d=t.viewLineCount,u=e.get(138),h=u==="inherit"?e.get(137):u,f=h==="inherit"?e.get(133):h,g=e.get(136),m=t.isDominatedByLongLines,p=e.get(57),v=e.get(68).renderType!==0,b=e.get(69),y=e.get(106),C=e.get(84),S=e.get(73),E=e.get(104),L=E.verticalScrollbarSize,N=E.verticalHasArrows,I=E.arrowSize,D=E.horizontalScrollbarSize,R=e.get(43),O=e.get(111)!=="never";let M=e.get(66);R&&O&&(M+=16);let P=0;if(v){const G=Math.max(o,b);P=Math.round(G*l)}let B=0;p&&(B=s*t.glyphMarginDecorationLaneCount);let H=0,W=H+B,V=W+P,$=V+M;const F=i-B-P-M;let j=!1,q=!1,U=-1;h==="inherit"&&m?(j=!0,q=!0):f==="on"||f==="bounded"?q=!0:f==="wordWrapColumn"&&(U=g);const K=Ex._computeMinimapLayout({outerWidth:i,outerHeight:r,lineHeight:s,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:y,paddingTop:C.top,paddingBottom:C.bottom,minimap:S,verticalScrollbarWidth:L,viewLineCount:d,remainingWidth:F,isViewportWrapping:q},t.memory||new Q3e);K.renderMinimap!==0&&K.minimapLeft===0&&(H+=K.minimapWidth,W+=K.minimapWidth,V+=K.minimapWidth,$+=K.minimapWidth);const Q=F-K.minimapWidth,se=Math.max(1,Math.floor((Q-L-2)/a)),J=N?I:0;return q&&(U=Math.max(1,se),f==="bounded"&&(U=Math.min(U,g))),{width:i,height:r,glyphMarginLeft:H,glyphMarginWidth:B,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:W,lineNumbersWidth:P,decorationsLeft:V,decorationsWidth:M,contentLeft:$,contentWidth:Q,minimap:K,viewportColumn:se,isWordWrapMinified:j,isViewportWrapping:q,wrappingColumn:U,verticalScrollbarWidth:L,horizontalScrollbarHeight:D,overviewRuler:{top:J,width:L,height:r-2*J,right:0}}}}class zNt extends Fr{constructor(){super(140,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[T("wrappingStrategy.simple","Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),T("wrappingStrategy.advanced","Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:T("wrappingStrategy","Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return ls(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}var Zu;(function(n){n.Off="off",n.OnCode="onCode",n.On="on"})(Zu||(Zu={}));class VNt extends Fr{constructor(){const e={enabled:Zu.OnCode};super(65,"lightbulb",e,{"editor.lightbulb.enabled":{type:"string",tags:["experimental"],enum:[Zu.Off,Zu.OnCode,Zu.On],default:e.enabled,enumDescriptions:[T("editor.lightbulb.enabled.off","Disable the code action menu."),T("editor.lightbulb.enabled.onCode","Show the code action menu when the cursor is on lines with code."),T("editor.lightbulb.enabled.on","Show the code action menu when the cursor is on lines with code or on empty lines.")],description:T("enabled","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:ls(e.enabled,this.defaultValue.enabled,[Zu.Off,Zu.OnCode,Zu.On])}}}class UNt extends Fr{constructor(){const e={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(116,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:T("editor.stickyScroll.enabled","Shows the nested current scopes during the scroll at the top of the editor."),tags:["experimental"]},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:20,description:T("editor.stickyScroll.maxLineCount","Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:T("editor.stickyScroll.defaultModel","Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:T("editor.stickyScroll.scrollWithEditor","Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:en(t.enabled,this.defaultValue.enabled),maxLineCount:mr.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:ls(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:en(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class qNt extends Fr{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(142,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:T("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[T("editor.inlayHints.on","Inlay hints are enabled"),T("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",ci?"Ctrl+Option":"Ctrl+Alt"),T("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",ci?"Ctrl+Option":"Ctrl+Alt"),T("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:T("inlayHints.fontSize","Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:T("inlayHints.fontFamily","Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:T("inlayHints.padding","Enables the padding around the inlay hints in the editor.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return typeof t.enabled=="boolean"&&(t.enabled=t.enabled?"on":"off"),{enabled:ls(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:mr.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Ga.string(t.fontFamily,this.defaultValue.fontFamily),padding:en(t.padding,this.defaultValue.padding)}}}class GNt extends Fr{constructor(){super(66,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):mr.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?mr.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class KNt extends vd{constructor(){super(67,"lineHeight",_l.lineHeight,e=>vd.clamp(e,0,150),{markdownDescription:T("lineHeight",`Controls the line height.
|
518
518
|
- Use 0 to automatically compute the line height from the font size.
|
519
519
|
- Values between 0 and 8 will be used as a multiplier with the font size.
|
520
520
|
- Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,i){return e.fontInfo.lineHeight}}class YNt extends Fr{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,sectionHeaderFontSize:9,sectionHeaderLetterSpacing:1};super(73,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:T("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:T("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[T("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),T("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),T("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:T("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:T("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:T("minimap.showSlider","Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:T("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:T("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:T("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")},"editor.minimap.showRegionSectionHeaders":{type:"boolean",default:e.showRegionSectionHeaders,description:T("minimap.showRegionSectionHeaders","Controls whether named regions are shown as section headers in the minimap.")},"editor.minimap.showMarkSectionHeaders":{type:"boolean",default:e.showMarkSectionHeaders,description:T("minimap.showMarkSectionHeaders","Controls whether MARK: comments are shown as section headers in the minimap.")},"editor.minimap.sectionHeaderFontSize":{type:"number",default:e.sectionHeaderFontSize,description:T("minimap.sectionHeaderFontSize","Controls the font size of section headers in the minimap.")},"editor.minimap.sectionHeaderLetterSpacing":{type:"number",default:e.sectionHeaderLetterSpacing,description:T("minimap.sectionHeaderLetterSpacing","Controls the amount of space (in pixels) between characters of section header. This helps the readability of the header in small font sizes.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:en(t.enabled,this.defaultValue.enabled),autohide:en(t.autohide,this.defaultValue.autohide),size:ls(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:ls(t.side,this.defaultValue.side,["right","left"]),showSlider:ls(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:en(t.renderCharacters,this.defaultValue.renderCharacters),scale:mr.clampedInt(t.scale,1,1,3),maxColumn:mr.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:en(t.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:en(t.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),sectionHeaderFontSize:vd.clamp(t.sectionHeaderFontSize??this.defaultValue.sectionHeaderFontSize,4,32),sectionHeaderLetterSpacing:vd.clamp(t.sectionHeaderLetterSpacing??this.defaultValue.sectionHeaderLetterSpacing,0,5)}}}function XNt(n){return n==="ctrlCmd"?ci?"metaKey":"ctrlKey":"altKey"}class ZNt extends Fr{constructor(){super(84,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:T("padding.top","Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:T("padding.bottom","Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{top:mr.clampedInt(t.top,0,0,1e3),bottom:mr.clampedInt(t.bottom,0,0,1e3)}}}class QNt extends Fr{constructor(){const e={enabled:!0,cycle:!0};super(86,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:T("parameterHints.enabled","Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:T("parameterHints.cycle","Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:en(t.enabled,this.defaultValue.enabled),cycle:en(t.cycle,this.defaultValue.cycle)}}}class JNt extends wR{constructor(){super(144)}compute(e,t,i){return e.pixelRatio}}class eTt extends Fr{constructor(){super(88,"placeholder",void 0)}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e:this.defaultValue}}class tTt extends Fr{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[T("on","Quick suggestions show inside the suggest widget"),T("inline","Quick suggestions show as ghost text"),T("off","Quick suggestions are disabled")]}];super(90,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:T("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:T("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:T("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:T("quickSuggestions","Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the {0}-setting which controls if suggestions are triggered by special characters.","`#editor.suggestOnTriggerCharacters#`")}),this.defaultValue=e}validate(e){if(typeof e=="boolean"){const c=e?"on":"off";return{comments:c,strings:c,other:c}}if(!e||typeof e!="object")return this.defaultValue;const{other:t,comments:i,strings:r}=e,s=["on","inline","off"];let o,a,l;return typeof t=="boolean"?o=t?"on":"off":o=ls(t,this.defaultValue.other,s),typeof i=="boolean"?a=i?"on":"off":a=ls(i,this.defaultValue.comments,s),typeof r=="boolean"?l=r?"on":"off":l=ls(r,this.defaultValue.strings,s),{other:o,comments:a,strings:l}}}class nTt extends Fr{constructor(){super(68,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[T("lineNumbers.off","Line numbers are not rendered."),T("lineNumbers.on","Line numbers are rendered as absolute number."),T("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),T("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:T("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return typeof e<"u"&&(typeof e=="function"?(t=4,i=e):e==="interval"?t=3:e==="relative"?t=2:e==="on"?t=1:t=0),{renderType:t,renderFn:i}}}function y3(n){const e=n.get(99);return e==="editable"?n.get(92):e!=="on"}class iTt extends Fr{constructor(){const e=[],t={type:"number",description:T("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(103,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:T("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:T("rulers","Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){const t=[];for(const i of e)if(typeof i=="number")t.push({column:mr.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){const r=i;t.push({column:mr.clampedInt(r.column,0,0,1e4),color:r.color})}return t.sort((i,r)=>i.column-r.column),t}return this.defaultValue}}class rTt extends Fr{constructor(){super(93,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function Vxe(n,e){if(typeof n!="string")return e;switch(n){case"hidden":return 2;case"visible":return 3;default:return 1}}let sTt=class extends Fr{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1,ignoreHorizontalScrollbarInContentHeight:!1};super(104,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[T("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),T("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),T("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:T("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[T("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),T("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),T("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:T("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:T("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:T("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:T("scrollbar.scrollByPage","Controls whether clicks scroll by page or jump to click position.")},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:"boolean",default:e.ignoreHorizontalScrollbarInContentHeight,description:T("scrollbar.ignoreHorizontalScrollbarInContentHeight","When set, the horizontal scrollbar will not increase the size of the editor's content.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e,i=mr.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),r=mr.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:mr.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:Vxe(t.vertical,this.defaultValue.vertical),horizontal:Vxe(t.horizontal,this.defaultValue.horizontal),useShadows:en(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:en(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:en(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:en(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:en(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:mr.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:r,verticalSliderSize:mr.clampedInt(t.verticalSliderSize,r,0,1e3),scrollByPage:en(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:en(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}};const id="inUntrustedWorkspace",Wl={allowedCharacters:"editor.unicodeHighlight.allowedCharacters",invisibleCharacters:"editor.unicodeHighlight.invisibleCharacters",nonBasicASCII:"editor.unicodeHighlight.nonBasicASCII",ambiguousCharacters:"editor.unicodeHighlight.ambiguousCharacters",includeComments:"editor.unicodeHighlight.includeComments",includeStrings:"editor.unicodeHighlight.includeStrings",allowedLocales:"editor.unicodeHighlight.allowedLocales"};class oTt extends Fr{constructor(){const e={nonBasicASCII:id,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:id,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(126,"unicodeHighlight",e,{[Wl.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,id],default:e.nonBasicASCII,description:T("unicodeHighlight.nonBasicASCII","Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")},[Wl.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:T("unicodeHighlight.invisibleCharacters","Controls whether characters that just reserve space or have no width at all are highlighted.")},[Wl.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:T("unicodeHighlight.ambiguousCharacters","Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[Wl.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,id],default:e.includeComments,description:T("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[Wl.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,id],default:e.includeStrings,description:T("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[Wl.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:T("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[Wl.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:T("unicodeHighlight.allowedLocales","Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(Ic(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},i=!0)),t.allowedLocales&&e&&(Ic(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},i=!0));const r=super.applyUpdate(e,t);return i?new T2(r.newValue,!0):r}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:kx(t.nonBasicASCII,id,[!0,!1,id]),invisibleCharacters:en(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:en(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:kx(t.includeComments,id,[!0,!1,id]),includeStrings:kx(t.includeStrings,id,[!0,!1,id]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if(typeof e!="object"||!e)return t;const i={};for(const[r,s]of Object.entries(e))s===!0&&(i[r]=!0);return i}}class aTt extends Fr{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1,fontFamily:"default"};super(62,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:T("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[T("inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),T("inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion."),T("inlineSuggest.showToolbar.never","Never show the inline suggestion toolbar.")],description:T("inlineSuggest.showToolbar","Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:T("inlineSuggest.suppressSuggestions","Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")},"editor.inlineSuggest.fontFamily":{type:"string",default:e.fontFamily,description:T("inlineSuggest.fontFamily","Controls the font family of the inline suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:en(t.enabled,this.defaultValue.enabled),mode:ls(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:ls(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),suppressSuggestions:en(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:en(t.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:Ga.string(t.fontFamily,this.defaultValue.fontFamily)}}}class lTt extends Fr{constructor(){const e={enabled:!1,showToolbar:"onHover",fontFamily:"default",keepOnBlur:!1};super(63,"experimentalInlineEdit",e,{"editor.experimentalInlineEdit.enabled":{type:"boolean",default:e.enabled,description:T("inlineEdit.enabled","Controls whether to show inline edits in the editor.")},"editor.experimentalInlineEdit.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[T("inlineEdit.showToolbar.always","Show the inline edit toolbar whenever an inline suggestion is shown."),T("inlineEdit.showToolbar.onHover","Show the inline edit toolbar when hovering over an inline suggestion."),T("inlineEdit.showToolbar.never","Never show the inline edit toolbar.")],description:T("inlineEdit.showToolbar","Controls when to show the inline edit toolbar.")},"editor.experimentalInlineEdit.fontFamily":{type:"string",default:e.fontFamily,description:T("inlineEdit.fontFamily","Controls the font family of the inline edit.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:en(t.enabled,this.defaultValue.enabled),showToolbar:ls(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),fontFamily:Ga.string(t.fontFamily,this.defaultValue.fontFamily),keepOnBlur:en(t.keepOnBlur,this.defaultValue.keepOnBlur)}}}class cTt extends Fr{constructor(){const e={enabled:ya.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:ya.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:T("bracketPairColorization.enabled","Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.","`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:e.independentColorPoolPerBracketType,description:T("bracketPairColorization.independentColorPoolPerBracketType","Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:en(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:en(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class dTt extends Fr{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(16,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[T("editor.guides.bracketPairs.true","Enables bracket pair guides."),T("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),T("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:T("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[T("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),T("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),T("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:T("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:T("editor.guides.highlightActiveBracketPair","Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:T("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[T("editor.guides.highlightActiveIndentation.true","Highlights the active indent guide."),T("editor.guides.highlightActiveIndentation.always","Highlights the active indent guide even if bracket guides are highlighted."),T("editor.guides.highlightActiveIndentation.false","Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:T("editor.guides.highlightActiveIndentation","Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{bracketPairs:kx(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:kx(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:en(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:en(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:kx(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function kx(n,e,t){const i=t.indexOf(n);return i===-1?e:t[i]}class uTt extends Fr{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!1,localityBonus:!1,shareSuggestSelections:!1,selectionMode:"always",showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(119,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[T("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),T("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:T("suggest.insertMode","Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:T("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:T("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:T("suggest.shareSuggestSelections","Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[T("suggest.insertMode.always","Always select a suggestion when automatically triggering IntelliSense."),T("suggest.insertMode.never","Never select a suggestion when automatically triggering IntelliSense."),T("suggest.insertMode.whenTriggerCharacter","Select a suggestion only when triggering IntelliSense from a trigger character."),T("suggest.insertMode.whenQuickSuggestion","Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:T("suggest.selectionMode","Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions ({0} and {1}) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.","`#editor.quickSuggestions#`","`#editor.suggestOnTriggerCharacters#`")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:T("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:T("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:T("suggest.showStatusBar","Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:T("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:T("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:T("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:T("deprecated","This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.matchOnWordStartOnly","When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:T("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:ls(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:en(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:en(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:en(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:en(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:ls(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:en(t.showIcons,this.defaultValue.showIcons),showStatusBar:en(t.showStatusBar,this.defaultValue.showStatusBar),preview:en(t.preview,this.defaultValue.preview),previewMode:ls(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:en(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:en(t.showMethods,this.defaultValue.showMethods),showFunctions:en(t.showFunctions,this.defaultValue.showFunctions),showConstructors:en(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:en(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:en(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:en(t.showFields,this.defaultValue.showFields),showVariables:en(t.showVariables,this.defaultValue.showVariables),showClasses:en(t.showClasses,this.defaultValue.showClasses),showStructs:en(t.showStructs,this.defaultValue.showStructs),showInterfaces:en(t.showInterfaces,this.defaultValue.showInterfaces),showModules:en(t.showModules,this.defaultValue.showModules),showProperties:en(t.showProperties,this.defaultValue.showProperties),showEvents:en(t.showEvents,this.defaultValue.showEvents),showOperators:en(t.showOperators,this.defaultValue.showOperators),showUnits:en(t.showUnits,this.defaultValue.showUnits),showValues:en(t.showValues,this.defaultValue.showValues),showConstants:en(t.showConstants,this.defaultValue.showConstants),showEnums:en(t.showEnums,this.defaultValue.showEnums),showEnumMembers:en(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:en(t.showKeywords,this.defaultValue.showKeywords),showWords:en(t.showWords,this.defaultValue.showWords),showColors:en(t.showColors,this.defaultValue.showColors),showFiles:en(t.showFiles,this.defaultValue.showFiles),showReferences:en(t.showReferences,this.defaultValue.showReferences),showFolders:en(t.showFolders,this.defaultValue.showFolders),showTypeParameters:en(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:en(t.showSnippets,this.defaultValue.showSnippets),showUsers:en(t.showUsers,this.defaultValue.showUsers),showIssues:en(t.showIssues,this.defaultValue.showIssues)}}}class hTt extends Fr{constructor(){super(114,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:T("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:T("selectSubwords","Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),default:!0,type:"boolean"}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{selectLeadingAndTrailingWhitespace:en(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:en(e.selectSubwords,this.defaultValue.selectSubwords)}}}class fTt extends Fr{constructor(){const e=[];super(131,"wordSegmenterLocales",e,{anyOf:[{description:T("wordSegmenterLocales","Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),type:"string"},{description:T("wordSegmenterLocales","Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),type:"array",items:{type:"string"}}]})}validate(e){if(typeof e=="string"&&(e=[e]),Array.isArray(e)){const t=[];for(const i of e)if(typeof i=="string")try{Intl.Segmenter.supportedLocalesOf(i).length>0&&t.push(i)}catch{}return t}return this.defaultValue}}class gTt extends Fr{constructor(){super(139,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[T("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),T("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),T("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),T("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:T("wrappingIndent","Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,t,i){return t.get(2)===2?0:i}}class pTt extends wR{constructor(){super(147)}compute(e,t,i){const r=t.get(146);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:r.isWordWrapMinified,isViewportWrapping:r.isViewportWrapping,wrappingColumn:r.wrappingColumn}}}class mTt extends Fr{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:T("dropIntoEditor.enabled","Controls whether you can drag and drop a file into a text editor by holding down the `Shift` key (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:T("dropIntoEditor.showDropSelector","Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped."),enum:["afterDrop","never"],enumDescriptions:[T("dropIntoEditor.showDropSelector.afterDrop","Show the drop selector widget after a file is dropped into the editor."),T("dropIntoEditor.showDropSelector.never","Never show the drop selector widget. Instead the default drop provider is always used.")],default:"afterDrop"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:en(t.enabled,this.defaultValue.enabled),showDropSelector:ls(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class vTt extends Fr{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(85,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:T("pasteAs.enabled","Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:T("pasteAs.showPasteSelector","Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted."),enum:["afterPaste","never"],enumDescriptions:[T("pasteAs.showPasteSelector.afterPaste","Show the paste selector widget after content is pasted into the editor."),T("pasteAs.showPasteSelector.never","Never show the paste selector widget. Instead the default pasting behavior is always used.")],default:"afterPaste"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:en(t.enabled,this.defaultValue.enabled),showPasteSelector:ls(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const bTt="Consolas, 'Courier New', monospace",_Tt="Menlo, Monaco, 'Courier New', monospace",yTt="'Droid Sans Mono', 'monospace', monospace",_l={fontFamily:ci?_Tt:Sl?yTt:bTt,fontWeight:"normal",fontSize:ci?12:14,lineHeight:0,letterSpacing:0},Tw=[];function St(n){return Tw[n.id]=n,n}const jf={acceptSuggestionOnCommitCharacter:St(new Di(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:T("acceptSuggestionOnCommitCharacter","Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:St(new os(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",T("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:T("acceptSuggestionOnEnter","Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:St(new RNt),accessibilityPageSize:St(new mr(3,"accessibilityPageSize",10,1,1073741824,{description:T("accessibilityPageSize","Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default."),tags:["accessibility"]})),ariaLabel:St(new Ga(4,"ariaLabel",T("editorViewAccessibleLabel","Editor content"))),ariaRequired:St(new Di(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:St(new Di(8,"screenReaderAnnounceInlineSuggestion",!0,{description:T("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:St(new os(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",T("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),T("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:T("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:St(new os(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",T("editor.autoClosingComments.languageDefined","Use language configurations to determine when to autoclose comments."),T("editor.autoClosingComments.beforeWhitespace","Autoclose comments only when the cursor is to the left of whitespace."),""],description:T("autoClosingComments","Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:St(new os(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",T("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:T("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:St(new os(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",T("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:T("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:St(new os(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",T("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),T("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:T("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:St(new JA(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],DNt,{enumDescriptions:[T("editor.autoIndent.none","The editor will not insert indentation automatically."),T("editor.autoIndent.keep","The editor will keep the current line's indentation."),T("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),T("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),T("editor.autoIndent.full","The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:T("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:St(new Di(13,"automaticLayout",!1)),autoSurround:St(new os(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[T("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),T("editor.autoSurround.quotes","Surround with quotes but not brackets."),T("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:T("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:St(new cTt),bracketPairGuides:St(new dTt),stickyTabStops:St(new Di(117,"stickyTabStops",!1,{description:T("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:St(new Di(17,"codeLens",!0,{description:T("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:St(new Ga(18,"codeLensFontFamily","",{description:T("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:St(new mr(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:T("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:St(new Di(20,"colorDecorators",!0,{description:T("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:St(new os(149,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[T("editor.colorDecoratorActivatedOn.clickAndHover","Make the color picker appear both on click and hover of the color decorator"),T("editor.colorDecoratorActivatedOn.hover","Make the color picker appear on hover of the color decorator"),T("editor.colorDecoratorActivatedOn.click","Make the color picker appear on click of the color decorator")],description:T("colorDecoratorActivatedOn","Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:St(new mr(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:T("colorDecoratorsLimit","Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:St(new Di(22,"columnSelection",!1,{description:T("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:St(new MNt),contextmenu:St(new Di(24,"contextmenu",!0)),copyWithSyntaxHighlighting:St(new Di(25,"copyWithSyntaxHighlighting",!0,{description:T("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:St(new JA(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],ANt,{description:T("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:St(new os(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[T("cursorSmoothCaretAnimation.off","Smooth caret animation is disabled."),T("cursorSmoothCaretAnimation.explicit","Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),T("cursorSmoothCaretAnimation.on","Smooth caret animation is always enabled.")],description:T("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:St(new JA(28,"cursorStyle",Wo.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],ONt,{description:T("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:St(new mr(29,"cursorSurroundingLines",0,0,1073741824,{description:T("cursorSurroundingLines","Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:St(new os(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[T("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),T("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],markdownDescription:T("cursorSurroundingLinesStyle","Controls when `#editor.cursorSurroundingLines#` should be enforced.")})),cursorWidth:St(new mr(31,"cursorWidth",0,0,1073741824,{markdownDescription:T("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:St(new Di(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:St(new Di(33,"disableMonospaceOptimizations",!1)),domReadOnly:St(new Di(34,"domReadOnly",!1)),dragAndDrop:St(new Di(35,"dragAndDrop",!0,{description:T("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:St(new FNt),dropIntoEditor:St(new mTt),stickyScroll:St(new UNt),experimentalWhitespaceRendering:St(new os(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[T("experimentalWhitespaceRendering.svg","Use a new rendering method with svgs."),T("experimentalWhitespaceRendering.font","Use a new rendering method with font characters."),T("experimentalWhitespaceRendering.off","Use the stable rendering method.")],description:T("experimentalWhitespaceRendering","Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:St(new Ga(39,"extraEditorClassName","")),fastScrollSensitivity:St(new vd(40,"fastScrollSensitivity",5,n=>n<=0?5:n,{markdownDescription:T("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:St(new BNt),fixedOverflowWidgets:St(new Di(42,"fixedOverflowWidgets",!1)),folding:St(new Di(43,"folding",!0,{description:T("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:St(new os(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[T("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),T("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:T("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:St(new Di(45,"foldingHighlight",!0,{description:T("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:St(new Di(46,"foldingImportsByDefault",!1,{description:T("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:St(new mr(47,"foldingMaximumRegions",5e3,10,65e3,{description:T("foldingMaximumRegions","The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.")})),unfoldOnClickAfterEndOfLine:St(new Di(48,"unfoldOnClickAfterEndOfLine",!1,{description:T("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:St(new Ga(49,"fontFamily",_l.fontFamily,{description:T("fontFamily","Controls the font family.")})),fontInfo:St(new $Nt),fontLigatures2:St(new v_),fontSize:St(new HNt),fontWeight:St(new GQ),fontVariations:St(new lT),formatOnPaste:St(new Di(55,"formatOnPaste",!1,{description:T("formatOnPaste","Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:St(new Di(56,"formatOnType",!1,{description:T("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:St(new Di(57,"glyphMargin",!0,{description:T("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:St(new jNt),hideCursorInOverviewRuler:St(new Di(59,"hideCursorInOverviewRuler",!1,{description:T("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:St(new WNt),inDiffEditor:St(new Di(61,"inDiffEditor",!1)),letterSpacing:St(new vd(64,"letterSpacing",_l.letterSpacing,n=>vd.clamp(n,-5,20),{description:T("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:St(new VNt),lineDecorationsWidth:St(new GNt),lineHeight:St(new KNt),lineNumbers:St(new nTt),lineNumbersMinChars:St(new mr(69,"lineNumbersMinChars",5,1,300)),linkedEditing:St(new Di(70,"linkedEditing",!1,{description:T("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:St(new Di(71,"links",!0,{description:T("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:St(new os(72,"matchBrackets","always",["always","near","never"],{description:T("matchBrackets","Highlight matching brackets.")})),minimap:St(new YNt),mouseStyle:St(new os(74,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:St(new vd(75,"mouseWheelScrollSensitivity",1,n=>n===0?1:n,{markdownDescription:T("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:St(new Di(76,"mouseWheelZoom",!1,{markdownDescription:ci?T("mouseWheelZoom.mac","Zoom the font of the editor when using mouse wheel and holding `Cmd`."):T("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:St(new Di(77,"multiCursorMergeOverlapping",!0,{description:T("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:St(new JA(78,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],XNt,{markdownEnumDescriptions:[T("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),T("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:T({key:"multiCursorModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),multiCursorPaste:St(new os(79,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[T("multiCursorPaste.spread","Each cursor pastes a single line of the text."),T("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:T("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:St(new mr(80,"multiCursorLimit",1e4,1,1e5,{markdownDescription:T("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:St(new os(81,"occurrencesHighlight","singleFile",["off","singleFile","multiFile"],{markdownEnumDescriptions:[T("occurrencesHighlight.off","Does not highlight occurrences."),T("occurrencesHighlight.singleFile","Highlights occurrences only in the current file."),T("occurrencesHighlight.multiFile","Experimental: Highlights occurrences across all valid open files.")],markdownDescription:T("occurrencesHighlight","Controls whether occurrences should be highlighted across open files.")})),overviewRulerBorder:St(new Di(82,"overviewRulerBorder",!0,{description:T("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:St(new mr(83,"overviewRulerLanes",3,0,3)),padding:St(new ZNt),pasteAs:St(new vTt),parameterHints:St(new QNt),peekWidgetDefaultFocus:St(new os(87,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[T("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),T("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:T("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),placeholder:St(new eTt),definitionLinkOpensInPeek:St(new Di(89,"definitionLinkOpensInPeek",!1,{description:T("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:St(new tTt),quickSuggestionsDelay:St(new mr(91,"quickSuggestionsDelay",10,0,1073741824,{description:T("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:St(new Di(92,"readOnly",!1)),readOnlyMessage:St(new rTt),renameOnType:St(new Di(94,"renameOnType",!1,{description:T("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:T("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:St(new Di(95,"renderControlCharacters",!0,{description:T("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:St(new os(96,"renderFinalNewline",Sl?"dimmed":"on",["off","on","dimmed"],{description:T("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:St(new os(97,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",T("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:T("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:St(new Di(98,"renderLineHighlightOnlyWhenFocus",!1,{description:T("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:St(new os(99,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:St(new os(100,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",T("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),T("renderWhitespace.selection","Render whitespace characters only on selected text."),T("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:T("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:St(new mr(101,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:St(new Di(102,"roundedSelection",!0,{description:T("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:St(new iTt),scrollbar:St(new sTt),scrollBeyondLastColumn:St(new mr(105,"scrollBeyondLastColumn",4,0,1073741824,{description:T("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:St(new Di(106,"scrollBeyondLastLine",!0,{description:T("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:St(new Di(107,"scrollPredominantAxis",!0,{description:T("scrollPredominantAxis","Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:St(new Di(108,"selectionClipboard",!0,{description:T("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:Sl})),selectionHighlight:St(new Di(109,"selectionHighlight",!0,{description:T("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:St(new Di(110,"selectOnLineNumbers",!0)),showFoldingControls:St(new os(111,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[T("showFoldingControls.always","Always show the folding controls."),T("showFoldingControls.never","Never show the folding controls and reduce the gutter size."),T("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:T("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:St(new Di(112,"showUnused",!0,{description:T("showUnused","Controls fading out of unused code.")})),showDeprecated:St(new Di(141,"showDeprecated",!0,{description:T("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:St(new qNt),snippetSuggestions:St(new os(113,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[T("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),T("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),T("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),T("snippetSuggestions.none","Do not show snippet suggestions.")],description:T("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:St(new hTt),smoothScrolling:St(new Di(115,"smoothScrolling",!1,{description:T("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:St(new mr(118,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:St(new uTt),inlineSuggest:St(new aTt),inlineEdit:St(new lTt),inlineCompletionsAccessibilityVerbose:St(new Di(150,"inlineCompletionsAccessibilityVerbose",!1,{description:T("inlineCompletionsAccessibilityVerbose","Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:St(new mr(120,"suggestFontSize",0,0,1e3,{markdownDescription:T("suggestFontSize","Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:St(new mr(121,"suggestLineHeight",0,0,1e3,{markdownDescription:T("suggestLineHeight","Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.","`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:St(new Di(122,"suggestOnTriggerCharacters",!0,{description:T("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:St(new os(123,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[T("suggestSelection.first","Always select the first suggestion."),T("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),T("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:T("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:St(new os(124,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[T("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),T("tabCompletion.off","Disable tab completions."),T("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:T("tabCompletion","Enables tab completions.")})),tabIndex:St(new mr(125,"tabIndex",0,-1,1073741824)),unicodeHighlight:St(new oTt),unusualLineTerminators:St(new os(127,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[T("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),T("unusualLineTerminators.off","Unusual line terminators are ignored."),T("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:T("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:St(new Di(128,"useShadowDOM",!0)),useTabStops:St(new Di(129,"useTabStops",!0,{description:T("useTabStops","Spaces and tabs are inserted and deleted in alignment with tab stops.")})),wordBreak:St(new os(130,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[T("wordBreak.normal","Use the default line break rule."),T("wordBreak.keepAll","Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:T("wordBreak","Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSegmenterLocales:St(new fTt),wordSeparators:St(new Ga(132,"wordSeparators",_3,{description:T("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:St(new os(133,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[T("wordWrap.off","Lines will never wrap."),T("wordWrap.on","Lines will wrap at the viewport width."),T({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),T({key:"wordWrap.bounded",comment:["- viewport means the edge of the visible window size.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:T({key:"wordWrap",comment:["- 'off', 'on', 'wordWrapColumn' and 'bounded' refer to values the setting can take and should not be localized.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:St(new Ga(134,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:St(new Ga(135,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:St(new mr(136,"wordWrapColumn",80,1,1073741824,{markdownDescription:T({key:"wordWrapColumn",comment:["- `editor.wordWrap` refers to a different setting and should not be localized.","- 'wordWrapColumn' and 'bounded' refer to values the different setting can take and should not be localized."]},"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:St(new os(137,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:St(new os(138,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:St(new PNt),defaultColorDecorators:St(new Di(148,"defaultColorDecorators",!1,{markdownDescription:T("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:St(new JNt),tabFocusMode:St(new Di(145,"tabFocusMode",!1,{markdownDescription:T("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:St(new Ex),wrappingInfo:St(new pTt),wrappingIndent:St(new gTt),wrappingStrategy:St(new zNt)};class CTt{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?SE.isErrorNoTelemetry(e)?new SE(e.message+`
|
@@ -1465,4 +1465,4 @@ An.version="2.30.1";dhn(eo);An.fn=an;An.min=Qfn;An.max=Jfn;An.now=egn;An.utc=Cp;
|
|
1465
1465
|
${e==="preview_static"?"bg-gradient-to-r from-blue-500 to-indigo-600 text-white shadow-md shadow-blue-500/20 hover:shadow-lg hover:shadow-blue-500/30 hover:from-blue-600 hover:to-indigo-700 transform hover:-translate-y-0.5":"bg-gray-800/60 text-gray-400 hover:bg-gray-700/80 hover:text-white hover:shadow-sm"} flex items-center space-x-1`,onClick:()=>t("preview_static"),title:ie("previewChangesStatic"),children:[x.jsxs("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]}),x.jsx("span",{children:ie("previewChangesStatic")})]}),x.jsxs("button",{className:`px-2 py-1 rounded text-xs font-medium transition-all duration-300
|
1466
1466
|
${e==="filegroup"?"bg-gradient-to-r from-blue-500 to-indigo-600 text-white shadow-md shadow-blue-500/20 hover:shadow-lg hover:shadow-blue-500/30 hover:from-blue-600 hover:to-indigo-700 transform hover:-translate-y-0.5":"bg-gray-800/60 text-gray-400 hover:bg-gray-700/80 hover:text-white hover:shadow-sm"} flex items-center space-x-2`,onClick:()=>t("filegroup"),children:[x.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),x.jsx("span",{children:ie("fileGroups")})]}),x.jsxs("button",{className:`px-2 py-1 rounded text-xs font-medium transition-all duration-300
|
1467
1467
|
${e==="settings"?"bg-gradient-to-r from-blue-500 to-indigo-600 text-white shadow-md shadow-blue-500/20 hover:shadow-lg hover:shadow-blue-500/30 hover:from-blue-600 hover:to-indigo-700 transform hover:-translate-y-0.5":"bg-gray-800/60 text-gray-400 hover:bg-gray-700/80 hover:text-white hover:shadow-sm"} flex items-center space-x-2`,onClick:()=>t("settings"),children:[x.jsxs("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),x.jsx("span",{children:ie("settings")})]}),x.jsxs("div",{className:"relative tools-dropdown-container",children:[x.jsxs("button",{className:`px-2 py-1 rounded text-xs font-medium transition-all duration-300
|
1468
|
-
${e==="clipboard"?"bg-gradient-to-r from-blue-500 to-indigo-600 text-white shadow-md shadow-blue-500/20 hover:shadow-lg hover:shadow-blue-500/30 hover:from-blue-600 hover:to-indigo-700 transform hover:-translate-y-0.5":"bg-gray-800/60 text-gray-400 hover:bg-gray-700/80 hover:text-white hover:shadow-sm"} flex items-center space-x-2`,onClick:B,children:[x.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),x.jsx("span",{children:ie("more")})]}),g&&x.jsx("div",{className:"absolute z-10 mt-2 w-56 origin-top-right rounded-md bg-gray-800 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",children:x.jsx("div",{className:"py-1",children:x.jsxs("button",{className:`w-full px-4 py-2 text-sm flex items-center space-x-2 ${e==="clipboard"?"bg-blue-600 text-white":"text-gray-300 hover:bg-gray-700"}`,onClick:()=>{t("clipboard"),m(!1)},children:[x.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})}),x.jsx("span",{children:ie("clipboard")})]})})})]})]})}),x.jsxs("div",{className:"flex-1 overflow-hidden",children:[x.jsx("div",{className:`h-full ${e==="code"?"block":"hidden"}`,children:x.jsx(oon,{selectedFiles:c})}),x.jsx("div",{className:`h-full ${e==="filegroup"?"block":"hidden"}`,children:x.jsx(gon,{})}),x.jsx("div",{className:`h-full ${e==="clipboard"?"block":"hidden"}`,children:x.jsx("div",{className:"h-full p-4",children:x.jsx(ou,{theme:"vs-dark",height:"100%",value:i,onChange:H=>r(H||""),defaultLanguage:"plaintext",options:{minimap:{enabled:!1},fontSize:14,lineNumbers:"on",wordWrap:"on",automaticLayout:!0}})})}),x.jsx("div",{className:`h-full ${e==="preview_static"?"block":"hidden"}`,children:x.jsx(qon,{files:s})}),x.jsx("div",{className:`h-full ${e==="preview_editable"?"block":"hidden"}`,children:x.jsx(Gon,{files:s})}),x.jsx("div",{className:`h-full ${e==="history"?"block":"hidden"}`,children:x.jsx(_.Suspense,{fallback:x.jsx("div",{className:"p-4 text-gray-400 text-center",children:"Loading History..."}),children:x.jsx(Dmn,{})})}),x.jsx("div",{className:`h-full ${e==="settings"?"block":"hidden"}`,children:x.jsx(Non,{})}),x.jsx("div",{className:`h-full ${e==="todo"?"block":"hidden"}`,children:x.jsx(Nmn,{})})]})]}),x.jsxs("div",{className:"border-t border-gray-700 flex flex-col overflow-hidden",children:[x.jsx("div",{className:"bg-[#1f1f1f] border-b border-gray-700 px-2",children:x.jsx("div",{className:"flex items-center gap-1",children:["Output","Terminal"].map((H,W)=>x.jsx("button",{className:`px-2 py-0.5 text-xs rounded-t transition-colors ${h===H.toLowerCase()?"text-white bg-[#2d2d2d]":"text-gray-400 hover:text-white"}`,onClick:()=>f(H.toLowerCase()),children:H},H))})}),x.jsxs("div",{className:"flex-1 bg-[#2d2d2d] overflow-auto",children:[x.jsx("div",{className:`h-full ${h==="output"?"block":"hidden"}`,children:x.jsx(jon,{requestId:a})}),x.jsx("div",{className:`h-full ${h==="terminal"?"block":"hidden"}`,children:x.jsx(Hon,{})})]})]})]})})})]}),x.jsx(Tmn,{isOpen:p,onClose:()=>v(!1),content:b,format:C,language:E,title:N})]})},Mmn=({isOpen:n,onClose:e,onSelectFile:t})=>{const[i,r]=_.useState(""),[s,o]=_.useState([]),[a,l]=_.useState(-1),[c,d]=_.useState(!1),[u,h]=_.useState(!1),f=_.useRef(null),g=_.useRef(null),m=_.useCallback(async C=>{if(!C){o([]),l(-1),h(!1);return}try{d(!0);const[S,E]=await Promise.all([fetch(`/api/completions/files?name=${encodeURIComponent(C)}`),fetch(`/api/completions/symbols?name=${encodeURIComponent(C)}`)]),L=await S.json(),N=await E.json(),I=[...L.completions,...N.completions];o(I),l(I.length>0?0:-1),h(I.length===0)}catch(S){console.error("Error fetching completions:",S),h(!0)}finally{d(!1)}},[]),p=async()=>{if(i)try{d(!0);const C=await fetch(`/api/index/query?query=${encodeURIComponent(i)}`);if(!C.ok)throw new Error(`Server responded with ${C.status}`);const E=(await C.json()).sources.map(L=>({name:L.module_name.split("/").pop()||L.module_name,path:L.module_name,display:L.module_name}));o(E),l(E.length>0?0:-1),h(!1)}catch(C){console.error("Error performing smart search:",C)}finally{d(!1)}},v=C=>{t(C),b()},b=()=>{r(""),o([]),l(-1),h(!1),e()},y=C=>{s.length!==0&&(C.key==="ArrowDown"?(C.preventDefault(),l(S=>S<s.length-1?S+1:S)):C.key==="ArrowUp"?(C.preventDefault(),l(S=>S>0?S-1:0)):C.key==="Enter"&&a>=0&&(C.preventDefault(),v(s[a].path)))};return _.useEffect(()=>{if(a>=0&&g.current){const C=g.current.querySelector(`[data-index="${a}"]`);C&&C.scrollIntoView({block:"nearest"})}},[a]),_.useEffect(()=>{if(n&&f.current){const C=setTimeout(()=>{var S;(S=f.current)==null||S.focus()},100);return()=>clearTimeout(C)}},[n]),x.jsxs(fs,{title:ie("searchFilesAndSymbols"),open:n,onCancel:b,footer:null,width:600,className:"dark-theme-modal",styles:{content:{backgroundColor:"#1f2937",padding:"20px"},header:{backgroundColor:"#1f2937",borderBottom:"1px solid #374151"},body:{backgroundColor:"#1f2937"},mask:{backgroundColor:"rgba(0, 0, 0, 0.6)"}},children:[x.jsx("div",{className:"my-4",children:x.jsx(ei,{ref:f,autoFocus:!0,placeholder:ie("searchFilesAndSymbolsPlaceholder"),value:i,onChange:C=>{r(C.target.value),m(C.target.value)},onKeyDown:C=>{C.key==="Escape"?b():y(C)},className:"dark-theme-input bg-gray-800 text-gray-200 border-gray-700",style:{backgroundColor:"#1f2937",borderColor:"#374151",color:"#e5e7eb"}})}),x.jsx("div",{ref:g,className:"dark-theme-list max-h-96 overflow-y-auto",children:c?x.jsx("div",{className:"flex justify-center items-center py-4 text-gray-400",children:"Loading..."}):u?x.jsxs("div",{className:"flex flex-col items-center py-4",children:[x.jsx("p",{className:"text-gray-400 mb-3",children:"No exact matches found. Try smart search?"}),x.jsx(sn,{type:"primary",icon:x.jsx(G1,{}),onClick:p,className:"bg-blue-600 hover:bg-blue-700 border-blue-600",children:"Smart Search"})]}):x.jsx(Yl,{dataSource:s,renderItem:(C,S)=>x.jsx(Yl.Item,{"data-index":S,className:`cursor-pointer text-gray-200 border-gray-700 ${a===S?"bg-gray-700":"hover:bg-gray-700"}`,onClick:()=>v(C.path),children:x.jsxs("div",{className:"flex flex-col",children:[x.jsx("span",{className:"text-white",children:C.display}),x.jsxs("span",{className:"text-gray-400 text-sm",children:[C.path,C.name!==C.path&&` (${C.name})`]})]})}),locale:{emptyText:"No results found"}})})]})},Amn=({onInitializationComplete:n})=>{const[e,t]=_.useState(0),[i,r]=_.useState(!1),[s,o]=_.useState(""),[a,l]=_.useState(!1);_.useEffect(()=>{e===1&&c()},[e]);const c=async()=>{try{l(!0);const g=await(await fetch("/api/guess/project_type")).json();o(g.project_type||"")}catch(f){console.error("Error fetching project type:",f)}finally{l(!1)}},d=async()=>{r(!0);try{(await fetch("/api/initialization-project",{method:"POST"})).ok?t(1):pt.error(ie("failedToInitialize")||"Failed to initialize project")}catch(f){console.error("Error initializing project:",f),pt.error(ie("failedToInitialize")||"Failed to initialize project")}finally{r(!1)}},u=async()=>{l(!0);try{(await fetch(`/api/congigure/project_type?project_type=${encodeURIComponent(s)}`,{method:"PUT"})).ok?(pt.success(ie("projectConfigurationComplete")||"Project configuration complete"),n()):pt.error(ie("failedToConfigureProjectType")||"Failed to configure project type")}catch(f){console.error("Error configuring project type:",f),pt.error(ie("failedToConfigureProjectType")||"Failed to configure project type")}finally{l(!1)}},h=[{title:ie("initializeProject")||"Initialize Project",content:x.jsxs("div",{className:"text-center p-6",children:[x.jsx("h2",{className:"initialization-title",children:ie("projectNeedsInitialization")||"This project needs to be initialized"}),x.jsx("p",{className:"initialization-description",children:ie("initializationExplanation")||"Initialize the project to set up necessary files and configurations"}),x.jsx(sn,{type:"primary",size:"large",onClick:d,loading:i,className:"dark-button",children:ie("initializeNow")||"Initialize Now"})]})},{title:ie("configureProjectType")||"Configure Project Type",content:x.jsxs("div",{className:"text-center p-6",children:[x.jsx("h2",{className:"initialization-title",children:ie("configureProjectTypeTitle")||"Configure Project Type"}),x.jsx("p",{className:"initialization-description",children:ie("projectTypeExplanation")||"Project type defines file extensions AI should focus on"}),a?x.jsx(vu,{}):x.jsxs(x.Fragment,{children:[x.jsx(ei,{className:"dark-input mb-4 max-w-md mx-auto",value:s,onChange:f=>o(f.target.value),placeholder:ie("projectTypePlaceholder")||"e.g. js,ts,jsx,tsx"}),x.jsx(sn,{type:"primary",size:"large",onClick:u,loading:a,className:"dark-button",children:ie("saveConfiguration")||"Save Configuration"})]})]})}];return x.jsx("div",{className:"initialization-page flex items-center justify-center p-4",children:x.jsxs(Fg,{className:"initialization-card",bordered:!1,children:[x.jsx(UPe,{current:e,items:h.map(f=>({title:f.title})),className:"mb-8"}),x.jsx("div",{className:"p-4 rounded",children:h[e].content})]})})},Omn=()=>{const[n,e]=_.useState("todo"),[t,i]=_.useState("terminal"),[r,s]=_.useState(""),[o,a]=_.useState(""),[l,c]=_.useState([]),[d,u]=_.useState(""),[h,f]=_.useState(!1),[g,m]=_.useState([]),[p,v]=_.useState(!1),[b,y]=_.useState(!0),[C,S]=_.useState(null),[E,L]=_.useState(!0),N=_.useCallback(M=>{m([{path:M,isSelected:!0}]),e("code")},[]);VVe(["meta+p","ctrl+p"],M=>{M.preventDefault(),f(!0)},{enableOnFormTags:!0,preventDefault:!0}),_.useEffect(()=>{jvt().then(()=>{fetch("/api/project-path").then(M=>M.json()).then(M=>{const P=M.project_path,B=P?P.split("/").pop():"";a(B)}).catch(M=>console.error("Error fetching project path:",M)),I(),fetch("/api/config/ui/mode").then(M=>M.json()).then(M=>{v(M.mode==="expert")}).catch(M=>console.error("Error loading mode preference:",M))})},[]);const I=async()=>{try{L(!0);const P=await(await fetch("/api/initialization-status")).json();S(P.initialized)}catch(M){console.error("Error checking initialization status:",M),S(!1)}finally{L(!1)}},D=async()=>{const M=!p;v(M);try{(await fetch("/api/config/ui/mode",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:M?"expert":"agent"})})).ok||console.error("Failed to save mode preference")}catch(P){console.error("Error saving mode preference:",P)}},R=()=>{y(!b)},O=()=>{S(!0)};return E?x.jsx("div",{className:"h-screen flex items-center justify-center bg-gray-900 text-white",children:x.jsxs("div",{className:"text-center",children:[x.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-white mx-auto mb-4"}),x.jsx("p",{children:ie("loadingProject")||"Loading project..."})]})}):C?x.jsx(chn,{children:x.jsxs("div",{className:"h-screen flex flex-col bg-gray-900 relative",children:[x.jsxs("div",{className:"fixed top-0 right-0 z-10 flex items-center",children:[x.jsx(sn,{type:"text",size:"small",onClick:R,className:"bg-gray-700 text-gray-300 h-8 w-8 flex items-center justify-center rounded-bl-lg",icon:x.jsx("span",{className:"text-sm",children:b?"≫":"≪"})}),b&&x.jsxs("div",{className:"bg-gray-800 p-2 border-b border-l border-gray-700 flex items-center space-x-2 rounded-bl-lg shadow-md",children:[x.jsx("span",{className:"text-gray-400 text-sm",children:ie("autoMode")}),x.jsx(Jd,{checked:p,onChange:D,size:"small",className:"bg-gray-600"}),x.jsx("span",{className:"text-gray-400 text-sm",children:ie("expertMode")})]})]}),!p&&x.jsx(Jbt,{projectName:o,onSwitchToExpertMode:()=>v(!0)}),p&&x.jsx(Rmn,{projectName:o,activePanel:n,setActivePanel:e,clipboardContent:r,setClipboardContent:s,previewFiles:l,setPreviewFiles:c,requestId:d,setRequestId:u,selectedFiles:g,setSelectedFiles:m,onSwitchToAutoMode:()=>v(!1)}),x.jsx(Mmn,{isOpen:h,onClose:()=>f(!1),onSelectFile:N})]})}):x.jsx(Amn,{onInitializationComplete:O})};IVe.createRoot(document.getElementById("root")).render(x.jsx(ke.StrictMode,{children:x.jsx(Omn,{})}));export{sn as B,Fg as C,vr as E,$n as I,Yl as L,fs as M,CE as R,Q1 as S,Xg as T,Pe as _,dR as a,Xr as b,ke as c,ou as d,hr as e,SQ as f,su as g,Nl as h,u_e as i,x as j,yQ as k,U_ as l,QR as m,_ as r,pt as s,P8e as t,rc as v};
|
1468
|
+
${e==="clipboard"?"bg-gradient-to-r from-blue-500 to-indigo-600 text-white shadow-md shadow-blue-500/20 hover:shadow-lg hover:shadow-blue-500/30 hover:from-blue-600 hover:to-indigo-700 transform hover:-translate-y-0.5":"bg-gray-800/60 text-gray-400 hover:bg-gray-700/80 hover:text-white hover:shadow-sm"} flex items-center space-x-2`,onClick:B,children:[x.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),x.jsx("span",{children:ie("more")})]}),g&&x.jsx("div",{className:"absolute z-10 mt-2 w-56 origin-top-right rounded-md bg-gray-800 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",children:x.jsx("div",{className:"py-1",children:x.jsxs("button",{className:`w-full px-4 py-2 text-sm flex items-center space-x-2 ${e==="clipboard"?"bg-blue-600 text-white":"text-gray-300 hover:bg-gray-700"}`,onClick:()=>{t("clipboard"),m(!1)},children:[x.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:x.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})}),x.jsx("span",{children:ie("clipboard")})]})})})]})]})}),x.jsxs("div",{className:"flex-1 overflow-hidden",children:[x.jsx("div",{className:`h-full ${e==="code"?"block":"hidden"}`,children:x.jsx(oon,{selectedFiles:c})}),x.jsx("div",{className:`h-full ${e==="filegroup"?"block":"hidden"}`,children:x.jsx(gon,{})}),x.jsx("div",{className:`h-full ${e==="clipboard"?"block":"hidden"}`,children:x.jsx("div",{className:"h-full p-4",children:x.jsx(ou,{theme:"vs-dark",height:"100%",value:i,onChange:H=>r(H||""),defaultLanguage:"plaintext",options:{minimap:{enabled:!1},fontSize:14,lineNumbers:"on",wordWrap:"on",automaticLayout:!0}})})}),x.jsx("div",{className:`h-full ${e==="preview_static"?"block":"hidden"}`,children:x.jsx(qon,{files:s})}),x.jsx("div",{className:`h-full ${e==="preview_editable"?"block":"hidden"}`,children:x.jsx(Gon,{files:s})}),x.jsx("div",{className:`h-full ${e==="history"?"block":"hidden"}`,children:x.jsx(_.Suspense,{fallback:x.jsx("div",{className:"p-4 text-gray-400 text-center",children:"Loading History..."}),children:x.jsx(Dmn,{})})}),x.jsx("div",{className:`h-full ${e==="settings"?"block":"hidden"}`,children:x.jsx(Non,{})}),x.jsx("div",{className:`h-full ${e==="todo"?"block":"hidden"}`,children:x.jsx(Nmn,{})})]})]}),x.jsxs("div",{className:"border-t border-gray-700 flex flex-col overflow-hidden",children:[x.jsx("div",{className:"bg-[#1f1f1f] border-b border-gray-700 px-2",children:x.jsx("div",{className:"flex items-center gap-1",children:["Output","Terminal"].map((H,W)=>x.jsx("button",{className:`px-2 py-0.5 text-xs rounded-t transition-colors ${h===H.toLowerCase()?"text-white bg-[#2d2d2d]":"text-gray-400 hover:text-white"}`,onClick:()=>f(H.toLowerCase()),children:H},H))})}),x.jsxs("div",{className:"flex-1 bg-[#2d2d2d] overflow-auto",children:[x.jsx("div",{className:`h-full ${h==="output"?"block":"hidden"}`,children:x.jsx(jon,{requestId:a})}),x.jsx("div",{className:`h-full ${h==="terminal"?"block":"hidden"}`,children:x.jsx(Hon,{})})]})]})]})})})]}),x.jsx(Tmn,{isOpen:p,onClose:()=>v(!1),content:b,format:C,language:E,title:N})]})},Mmn=({isOpen:n,onClose:e,onSelectFile:t})=>{const[i,r]=_.useState(""),[s,o]=_.useState([]),[a,l]=_.useState(-1),[c,d]=_.useState(!1),[u,h]=_.useState(!1),f=_.useRef(null),g=_.useRef(null),m=_.useCallback(async C=>{if(!C){o([]),l(-1),h(!1);return}try{d(!0);const[S,E]=await Promise.all([fetch(`/api/completions/files?name=${encodeURIComponent(C)}`),fetch(`/api/completions/symbols?name=${encodeURIComponent(C)}`)]),L=await S.json(),N=await E.json(),I=[...L.completions,...N.completions];o(I),l(I.length>0?0:-1),h(I.length===0)}catch(S){console.error("Error fetching completions:",S),h(!0)}finally{d(!1)}},[]),p=async()=>{if(i)try{d(!0);const C=await fetch(`/api/index/query?query=${encodeURIComponent(i)}`);if(!C.ok)throw new Error(`Server responded with ${C.status}`);const E=(await C.json()).sources.map(L=>({name:L.module_name.split("/").pop()||L.module_name,path:L.module_name,display:L.module_name}));o(E),l(E.length>0?0:-1),h(!1)}catch(C){console.error("Error performing smart search:",C)}finally{d(!1)}},v=C=>{t(C),b()},b=()=>{r(""),o([]),l(-1),h(!1),e()},y=C=>{s.length!==0&&(C.key==="ArrowDown"?(C.preventDefault(),l(S=>S<s.length-1?S+1:S)):C.key==="ArrowUp"?(C.preventDefault(),l(S=>S>0?S-1:0)):C.key==="Enter"&&a>=0&&(C.preventDefault(),v(s[a].path)))};return _.useEffect(()=>{if(a>=0&&g.current){const C=g.current.querySelector(`[data-index="${a}"]`);C&&C.scrollIntoView({block:"nearest"})}},[a]),_.useEffect(()=>{if(n&&f.current){const C=setTimeout(()=>{var S;(S=f.current)==null||S.focus()},100);return()=>clearTimeout(C)}},[n]),x.jsxs(fs,{title:ie("searchFilesAndSymbols"),open:n,onCancel:b,footer:null,width:600,className:"dark-theme-modal",styles:{content:{backgroundColor:"#1f2937",padding:"20px"},header:{backgroundColor:"#1f2937",borderBottom:"1px solid #374151"},body:{backgroundColor:"#1f2937"},mask:{backgroundColor:"rgba(0, 0, 0, 0.6)"}},children:[x.jsx("div",{className:"my-4",children:x.jsx(ei,{ref:f,autoFocus:!0,placeholder:ie("searchFilesAndSymbolsPlaceholder"),value:i,onChange:C=>{r(C.target.value),m(C.target.value)},onKeyDown:C=>{C.key==="Escape"?b():y(C)},className:"dark-theme-input bg-gray-800 text-gray-200 border-gray-700",style:{backgroundColor:"#1f2937",borderColor:"#374151",color:"#e5e7eb"}})}),x.jsx("div",{ref:g,className:"dark-theme-list max-h-96 overflow-y-auto",children:c?x.jsx("div",{className:"flex justify-center items-center py-4 text-gray-400",children:"Loading..."}):u?x.jsxs("div",{className:"flex flex-col items-center py-4",children:[x.jsx("p",{className:"text-gray-400 mb-3",children:"No exact matches found. Try smart search?"}),x.jsx(sn,{type:"primary",icon:x.jsx(G1,{}),onClick:p,className:"bg-blue-600 hover:bg-blue-700 border-blue-600",children:"Smart Search"})]}):x.jsx(Yl,{dataSource:s,renderItem:(C,S)=>x.jsx(Yl.Item,{"data-index":S,className:`cursor-pointer text-gray-200 border-gray-700 ${a===S?"bg-gray-700":"hover:bg-gray-700"}`,onClick:()=>v(C.path),children:x.jsxs("div",{className:"flex flex-col",children:[x.jsx("span",{className:"text-white",children:C.display}),x.jsxs("span",{className:"text-gray-400 text-sm",children:[C.path,C.name!==C.path&&` (${C.name})`]})]})}),locale:{emptyText:"No results found"}})})]})},Amn=({onInitializationComplete:n})=>{const[e,t]=_.useState(0),[i,r]=_.useState(!1),[s,o]=_.useState(""),[a,l]=_.useState(!1);_.useEffect(()=>{e===1&&c()},[e]);const c=async()=>{try{l(!0);const g=await(await fetch("/api/guess/project_type")).json();o(g.project_type||"")}catch(f){console.error("Error fetching project type:",f)}finally{l(!1)}},d=async()=>{r(!0);try{(await fetch("/api/initialization-project",{method:"POST"})).ok?t(1):pt.error(ie("failedToInitialize")||"Failed to initialize project")}catch(f){console.error("Error initializing project:",f),pt.error(ie("failedToInitialize")||"Failed to initialize project")}finally{r(!1)}},u=async()=>{l(!0);try{(await fetch(`/api/congigure/project_type?project_type=${encodeURIComponent(s)}`,{method:"PUT"})).ok?(pt.success(ie("projectConfigurationComplete")||"Project configuration complete"),n()):pt.error(ie("failedToConfigureProjectType")||"Failed to configure project type")}catch(f){console.error("Error configuring project type:",f),pt.error(ie("failedToConfigureProjectType")||"Failed to configure project type")}finally{l(!1)}},h=[{title:ie("initializeProject")||"Initialize Project",content:x.jsxs("div",{className:"text-center p-6",children:[x.jsx("h2",{className:"initialization-title",children:ie("projectNeedsInitialization")||"This project needs to be initialized"}),x.jsx("p",{className:"initialization-description",children:ie("initializationExplanation")||"Initialize the project to set up necessary files and configurations"}),x.jsx(sn,{type:"primary",size:"large",onClick:d,loading:i,className:"dark-button",children:ie("initializeNow")||"Initialize Now"})]})},{title:ie("configureProjectType")||"Configure Project Type",content:x.jsxs("div",{className:"text-center p-6",children:[x.jsx("h2",{className:"initialization-title",children:ie("configureProjectTypeTitle")||"Configure Project Type"}),x.jsx("p",{className:"initialization-description",children:ie("projectTypeExplanation")||"Project type defines file extensions AI should focus on"}),a?x.jsx(vu,{}):x.jsxs(x.Fragment,{children:[x.jsx(ei,{className:"dark-input mb-4 max-w-md mx-auto",value:s,onChange:f=>o(f.target.value),placeholder:ie("projectTypePlaceholder")||"e.g. js,ts,jsx,tsx"}),x.jsx(sn,{type:"primary",size:"large",onClick:u,loading:a,className:"dark-button",children:ie("saveConfiguration")||"Save Configuration"})]})]})}];return x.jsx("div",{className:"initialization-page flex items-center justify-center p-4",children:x.jsxs(Fg,{className:"initialization-card",bordered:!1,children:[x.jsx(UPe,{current:e,items:h.map(f=>({title:f.title})),className:"mb-8"}),x.jsx("div",{className:"p-4 rounded",children:h[e].content})]})})},Omn=()=>{const[n,e]=_.useState("code"),[t,i]=_.useState("terminal"),[r,s]=_.useState(""),[o,a]=_.useState(""),[l,c]=_.useState([]),[d,u]=_.useState(""),[h,f]=_.useState(!1),[g,m]=_.useState([]),[p,v]=_.useState(!1),[b,y]=_.useState(!0),[C,S]=_.useState(null),[E,L]=_.useState(!0),N=_.useCallback(M=>{m([{path:M,isSelected:!0}]),e("code")},[]);VVe(["meta+p","ctrl+p"],M=>{M.preventDefault(),f(!0)},{enableOnFormTags:!0,preventDefault:!0}),_.useEffect(()=>{jvt().then(()=>{fetch("/api/project-path").then(M=>M.json()).then(M=>{const P=M.project_path,B=P?P.split("/").pop():"";a(B)}).catch(M=>console.error("Error fetching project path:",M)),I(),fetch("/api/config/ui/mode").then(M=>M.json()).then(M=>{v(M.mode==="expert")}).catch(M=>console.error("Error loading mode preference:",M))})},[]);const I=async()=>{try{L(!0);const P=await(await fetch("/api/initialization-status")).json();S(P.initialized)}catch(M){console.error("Error checking initialization status:",M),S(!1)}finally{L(!1)}},D=async()=>{const M=!p;v(M);try{(await fetch("/api/config/ui/mode",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:M?"expert":"agent"})})).ok||console.error("Failed to save mode preference")}catch(P){console.error("Error saving mode preference:",P)}},R=()=>{y(!b)},O=()=>{S(!0)};return E?x.jsx("div",{className:"h-screen flex items-center justify-center bg-gray-900 text-white",children:x.jsxs("div",{className:"text-center",children:[x.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-white mx-auto mb-4"}),x.jsx("p",{children:ie("loadingProject")||"Loading project..."})]})}):C?x.jsx(chn,{children:x.jsxs("div",{className:"h-screen flex flex-col bg-gray-900 relative",children:[x.jsxs("div",{className:"fixed top-0 right-0 z-10 flex items-center",children:[x.jsx(sn,{type:"text",size:"small",onClick:R,className:"bg-gray-700 text-gray-300 h-8 w-8 flex items-center justify-center rounded-bl-lg",icon:x.jsx("span",{className:"text-sm",children:b?"≫":"≪"})}),b&&x.jsxs("div",{className:"bg-gray-800 p-2 border-b border-l border-gray-700 flex items-center space-x-2 rounded-bl-lg shadow-md",children:[x.jsx("span",{className:"text-gray-400 text-sm",children:ie("autoMode")}),x.jsx(Jd,{checked:p,onChange:D,size:"small",className:"bg-gray-600"}),x.jsx("span",{className:"text-gray-400 text-sm",children:ie("expertMode")})]})]}),!p&&x.jsx(Jbt,{projectName:o,onSwitchToExpertMode:()=>v(!0)}),p&&x.jsx(Rmn,{projectName:o,activePanel:n,setActivePanel:e,clipboardContent:r,setClipboardContent:s,previewFiles:l,setPreviewFiles:c,requestId:d,setRequestId:u,selectedFiles:g,setSelectedFiles:m,onSwitchToAutoMode:()=>v(!1)}),x.jsx(Mmn,{isOpen:h,onClose:()=>f(!1),onSelectFile:N})]})}):x.jsx(Amn,{onInitializationComplete:O})};IVe.createRoot(document.getElementById("root")).render(x.jsx(ke.StrictMode,{children:x.jsx(Omn,{})}));export{sn as B,Fg as C,vr as E,$n as I,Yl as L,fs as M,CE as R,Q1 as S,Xg as T,Pe as _,dR as a,Xr as b,ke as c,ou as d,hr as e,SQ as f,su as g,Nl as h,u_e as i,x as j,yQ as k,U_ as l,QR as m,_ as r,pt as s,P8e as t,rc as v};
|