@opensumi/cli-engine 3.8.3-next-1742291358.0 → 3.8.3-next-1742817599.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/browser.js +3 -3
- package/package.json +10 -10
package/lib/browser/browser.js
CHANGED
|
@@ -31263,7 +31263,7 @@ The user's OS is ${(0,p.getOperatingSystemName)()}. The absolute path of the use
|
|
|
31263
31263
|
`);let R=0,P=!1;for(let k=0;k<M.length;k++){const F=M[k].trim();if(typeof R>"u"&&F.match(/^\s*\|/)){const L=F.match(/(\|[^\|]+)(?=\||$)/g);L&&(R=L.length)}else if(typeof R=="number")if(F.match(/^\s*\|/)&&k===M.length-1)P=!0;else return}if(R>0){const k=P?M.slice(0,-1).join(`
|
|
31264
31264
|
`):O,F=!!k.match(/\|\s*$/),L=k+(F?"":"|")+`
|
|
31265
31265
|
|${" --- |".repeat(R)}`;return p.marked.lexer(L)}}function T(I){return I.reduce((O,M)=>O+M.raw,"")}function D(I){for(const{type:O,raw:M}of I.tokens){if(O!=="text")continue;const R=M.split(`
|
|
31266
|
-
`),P=R[R.length-1],k=[{condition:P.includes("`"),action:d},{condition:P.includes("**"),action:y},{condition:P.match(/\*\w/),action:E},{condition:P.match(/(^|\s)__\w/),action:A},{condition:P.match(/(^|\s)_\w/),action:f},{condition:P.match(/(^|\s)\[.*\]\(\w*/),action:a},{condition:P.match(/(^|\s)\[\w/),action:b}];for(const F of k)if(F.condition)return F.action(I)}}},49601:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatMentionInput=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(46541),c=e(41869),p=e(81878),v=e(43718),m=e(92323),_=e(54414),s=e(47720),g=e(72665),l=e(51500),h=e(19413),u=e(27397),d=n.__importDefault(e(6960)),E=e(96086),f=e(44692),a=y=>{const{onSend:A,disabled:S=!1}=y,[w,T]=(0,r.useState)(y.value||""),[D,I]=(0,r.useState)(y.images||[]),O=(0,c.useInjectable)(h.IChatInternalService),M=(0,c.useInjectable)(m.CommandService),R=(0,c.useInjectable)(s.FileSearchServicePath),P=(0,c.useInjectable)(c.RecentFilesManager),k=(0,c.useInjectable)(l.IWorkspaceService),F=(0,c.useInjectable)(_.WorkbenchEditorService),L=(0,c.useInjectable)(c.LabelService),B=(0,c.useInjectable)(g.IMessageService),j=(0,c.useInjectable)(v.ChatFeatureRegistryToken),W=r.default.useCallback(()=>{M.executeCommand(u.OPEN_MCP_CONFIG_COMMAND.id)},[M]);(0,r.useEffect)(()=>{y.value!==w&&T(y.value||"")},[y.value]);const U=[{id:f.MentionType.FILE,type:f.MentionType.FILE,text:"File",icon:(0,p.getIcon)("file"),getHighestLevelItems:()=>{const H=F.currentEditor,K=H?.currentUri;return K?[{id:K.codeUri.fsPath,type:f.MentionType.FILE,text:K.displayName,value:K.codeUri.fsPath,description:`(${(0,v.localize)("aiNative.chat.defaultContextFile")})`,contextId:K.codeUri.fsPath,icon:L.getIcon(K)}]:[]},getItems:async H=>{if(H){const K=(await k.roots).map(X=>new v.URI(X.uri).codeUri.fsPath.toString()),Z=await R.find(H,{rootUris:K,useGitIgnore:!0,noIgnoreParent:!0,fuzzyMatch:!0,limit:10});return Promise.all(Z.map(async X=>{var ie;const oe=new v.URI(X),le=(ie=await k.asRelativePath(oe.parent))===null||ie===void 0?void 0:ie.path;return{id:oe.codeUri.fsPath,type:f.MentionType.FILE,text:oe.displayName,value:oe.codeUri.fsPath,description:le||"",contextId:oe.codeUri.fsPath,icon:L.getIcon(oe)}}))}else{const K=await P.getMostRecentlyOpenedFiles();return Promise.all(K.map(async Z=>{var X;const ie=new v.URI(Z),oe=(X=await k.asRelativePath(ie.parent))===null||X===void 0?void 0:X.path;return{id:ie.codeUri.fsPath,type:f.MentionType.FILE,text:ie.displayName,value:ie.codeUri.fsPath,description:oe||"",contextId:ie.codeUri.fsPath,icon:L.getIcon(ie)}}))}}},{id:f.MentionType.FOLDER,type:f.MentionType.FOLDER,text:"Folder",icon:(0,p.getIcon)("folder"),getHighestLevelItems:()=>{var H,K;const Z=F.currentEditor,X=(H=Z?.currentUri)===null||H===void 0?void 0:H.parent;return X?X.toString()===((K=k.workspace)===null||K===void 0?void 0:K.uri)?[]:[{id:X.codeUri.fsPath,type:f.MentionType.FOLDER,text:X.displayName,value:X.codeUri.fsPath,description:`(${(0,v.localize)("aiNative.chat.defaultContextFolder")})`,contextId:X.codeUri.fsPath,icon:(0,p.getIcon)("folder")}]:[]},getItems:async H=>{let K=[];if(H){const Z=(await k.roots).map(ie=>new v.URI(ie.uri).codeUri.fsPath),X=await R.find(H,{rootUris:Z,useGitIgnore:!0,noIgnoreParent:!0,fuzzyMatch:!0,limit:10,onlyFolders:!0});K=await Promise.all(X.map(async ie=>{var oe;const le=new v.URI(ie);return{id:le.codeUri.fsPath,type:f.MentionType.FOLDER,text:le.displayName,value:le.codeUri.fsPath,description:((oe=await k.asRelativePath(le.parent))===null||oe===void 0?void 0:oe.path)||"",contextId:le.codeUri.fsPath,icon:(0,p.getIcon)("folder")}}))}else{const Z=await P.getMostRecentlyOpenedFiles(),X=Array.from(new Set(Z.map(ie=>new v.URI(ie).parent.codeUri.fsPath)));K=await Promise.all(X.map(async ie=>{const oe=new v.URI(ie),le=await k.asRelativePath(oe);return{id:oe.codeUri.fsPath,type:f.MentionType.FOLDER,text:oe.displayName,value:oe.codeUri.fsPath,description:le?.root?le.path:"",contextId:oe.codeUri.fsPath,icon:(0,p.getIcon)("folder")}}))}return K.filter(Z=>{var X;return Z.id!==new v.URI((X=k.workspace)===null||X===void 0?void 0:X.uri).codeUri.fsPath})}}],Q=(0,r.useMemo)(()=>({modelOptions:[{label:"QWQ 32B",value:"qwq-32b"},{label:"DeepSeek R1",value:"deepseek-r1"}],defaultModel:"deepseek-r1",buttons:[{id:"mcp-server",icon:"mcp",title:"MCP Server",onClick:W,position:f.FooterButtonPosition.LEFT},{id:"upload-image",icon:"image",title:(0,v.localize)("aiNative.chat.imageUpload"),onClick:()=>{const H=document.createElement("input");H.type="file",H.accept="image/*",H.onchange=K=>{const Z=K.target.files;Z?.length&&Y(Array.from(Z))},H.click()},position:f.FooterButtonPosition.LEFT}],showModelSelector:!0}),[W]),V=(0,r.useCallback)(()=>{O.cancelRequest()},[]),$=(0,r.useCallback)(async(H,K)=>{S||(A(H,D.map(Z=>Z.toString()),void 0,void 0,K),I(y.images||[]))},[A,D,S]),Y=(0,r.useCallback)(async H=>{const K=["image/jpeg","image/jpg","image/png","image/webp","image/gif"];if(H.filter(le=>!K.includes(le.type)).length>0){B.error("Only JPG, PNG, WebP and GIF images are supported");return}const X=j.getImageUploadProvider();if(!X){B.error("No image upload provider found");return}const ie=await Promise.all(H.map(le=>X.imageUpload(le))),oe=[...D,...ie];I(oe)},[D]),z=(0,r.useCallback)(H=>{I(D.filter((K,Z)=>Z!==H))},[D]);return r.default.createElement("div",{className:d.default.chat_input_container},D.length>0&&r.default.createElement(b,{images:D,onDelete:z}),r.default.createElement(E.MentionInput,{mentionItems:U,onSend:$,onStop:V,loading:S,labelService:L,workspaceService:k,placeholder:(0,v.localize)("aiNative.chat.input.placeholder.default"),footerConfig:Q,onImageUpload:Y}))};t.ChatMentionInput=a;const b=({images:y,onDelete:A})=>r.default.createElement("div",null,r.default.createElement("div",{className:d.default.thumbnail_container},y.map((S,w)=>r.default.createElement("div",{key:w,className:d.default.thumbnail},r.default.createElement(o.Image,{src:S.toString()}),r.default.createElement("button",{onClick:()=>A(w),className:d.default.delete_button},r.default.createElement(p.Icon,{iconClass:"codicon codicon-close"}))))))},92635:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatNotify=t.ChatReply=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(48412),p=e(91416),v=e(78569),m=e(72871),_=e(41869),s=e(81878),g=e(89195),l=e(43718),h=e(52416),u=e(90684),d=e(19413),E=e(56474),f=e(17319),a=n.__importDefault(e(6960)),b=T=>{const D=(0,_.useInjectable)(_.LabelService),I=(0,_.useInjectable)(_.CommandService),O=(L,B,j)=>{let W=D.getIcon(L,{isDirectory:B});return B&&j&&(W+=" expanded"),W},M=(0,o.useMemo)(()=>{const L=B=>{const j=typeof B.type=="number"?B.type===l.FileType.Directory:!!B.children,W=new l.URI(B.uri);return{label:B.label,iconClassName:O(W,j,j),expandable:!0,expanded:!0,children:j?(B.children||[]).map(L):null,uri:W}};return(T.treeData.children||[]).map(L)},[T.treeData]),[R,P]=(0,o.useState)(22),k=(0,o.useRef)(null),F=L=>{k.current=L;const B=()=>{let j=L.getModel().root.branchSize;j<1?j=1:j>20&&(j=20),P(j*22)};B(),L.onDidUpdate(B)};return M.length?o.default.createElement("div",{className:a.default.tree_container},o.default.createElement(p.BasicRecycleTree,{height:R,treeData:M,onContextMenu:L=>L.preventDefault(),onClick:(L,B)=>{!k.current||!B||(v.BasicCompositeTreeNode.is(B)?B.raw.iconClassName=O(B.raw.uri,!0,B.expanded):I.executeCommand(_.EDITOR_COMMANDS.OPEN_RESOURCE.id,B.raw.uri,{disableNavigate:!0,preview:!0}))},onReady:F,treeName:T.treeData.label,leaveBottomBlank:!1,baseIndent:0})):null},y=T=>{const{toolCall:D,messageId:I}=T,O=(0,_.useInjectable)(l.ChatAgentViewServiceToken),[M,R]=(0,o.useState)(null);return(0,o.useEffect)(()=>{const P=O.getChatComponent("toolCall");if(P){const{component:F,initialProps:L}=P;R(o.default.createElement(F,{...L,value:D,messageId:I}));return}R(o.default.createElement("div",null,o.default.createElement(g.Loading,null),o.default.createElement("span",{style:{marginLeft:4}},"\u6B63\u5728\u52A0\u8F7D\u7EC4\u4EF6"))),O.getChatComponentDeferred("toolCall").promise.then(({component:F,initialProps:L})=>{R(o.default.createElement(F,{...L,value:D,messageId:I}))})},[D.state]),M},A=T=>{const D=(0,_.useInjectable)(l.ChatAgentViewServiceToken),[I,O]=(0,o.useState)(null);return(0,o.useEffect)(()=>{const M=D.getChatComponent(T.component);if(M){const{component:P,initialProps:k}=M;O(o.default.createElement(P,{...k,value:T.value,messageId:T.messageId}));return}O(o.default.createElement("div",null,o.default.createElement(g.Loading,null),o.default.createElement("span",{style:{marginLeft:4}},"\u6B63\u5728\u52A0\u8F7D\u7EC4\u4EF6"))),D.getChatComponentDeferred(T.component).promise.then(({component:P,initialProps:k})=>{O(o.default.createElement(P,{...k,value:T.value}))})},[T.component,T.value]),I},S=T=>{var D,I;const{relationId:O,request:M,startTime:R=0,onRegenerate:P,onDidChange:k,onDone:F,agentId:L,command:B,history:j,msgId:W}=T,[,U]=(0,o.useReducer)(_e=>(_e+1)%1e6,0),Q=(0,_.useInjectable)(l.IAIReporter),V=(0,_.useInjectable)(h.IIconService),$=(0,_.useInjectable)(_.IContextKeyService),Y=(0,_.useInjectable)(d.IChatInternalService),z=(0,_.useInjectable)(l.ChatServiceToken),H=(0,_.useInjectable)(d.IChatAgentService),K=(0,_.useInjectable)(l.ChatRenderRegistryToken),[Z,X]=(0,o.useState)(M.response.isComplete?new Set(M.response.responseContents.map((_e,te)=>_e.kind==="reasoning"?te:-1).filter(_e=>_e!==-1)):new Set);(0,o.useEffect)(()=>{M.response.isComplete&&X(new Set(M.response.responseContents.map((_e,te)=>_e.kind==="reasoning"?te:-1).filter(_e=>_e!==-1)))},[M.response.isComplete]),(0,o.useEffect)(()=>{const _e=new _.DisposableCollection;return _e.push(M.response.onDidChange(()=>{j.updateAssistantMessage(W,{content:M.response.responseText}),M.response.isComplete&&(F&&F(),Q.end(O,{assistantMessage:M.response.responseText,replytime:Date.now()-R,success:!0,isStop:!1,command:B,agentId:L,messageId:W,sessionId:Y.sessionModel.sessionId})),(0,o.startTransition)(()=>{k?.(),U()})})),()=>_e.dispose()},[O,k,F]);const ie=(0,o.useCallback)(()=>{M.response.reset(),P?.()},[P]),oe=(0,o.useCallback)(_e=>{if(K.chatAIRoleRender){const te=K.chatAIRoleRender;return o.default.createElement(te,{content:_e.value})}return o.default.createElement(E.ChatMarkdown,{markdown:_e,fillInIncompleteTokens:!0})},[K,K.chatAIRoleRender]),le=_e=>o.default.createElement(b,{treeData:_e}),pe=_e=>o.default.createElement("div",{className:a.default.placeholder},o.default.createElement(s.Icon,{iconClass:V.fromString("$(codicon/sync~spin)")}),o.default.createElement("div",{className:a.default.placeholder_content},oe(_e))),q=o.default.useMemo(()=>M.response.responseContents.map((_e,te)=>{let ge;if(_e.kind==="asyncContent")ge=pe(new u.MarkdownString(_e.content));else if(_e.kind==="treeData")ge=le(_e.treeData);else if(_e.kind==="component")ge=o.default.createElement(A,{component:_e.component,value:_e.value,messageId:W});else if(_e.kind==="toolCall")ge=o.default.createElement(y,{toolCall:_e.content,messageId:W});else if(_e.kind==="reasoning"){const Te=te===M.response.responseContents.length-1&&!M.response.isComplete;ge=o.default.createElement("div",{className:(0,r.default)(a.default.reasoning,{[a.default.thinking]:Te})},o.default.createElement(c.Button,{size:"small",type:"secondary",className:a.default.thinking,onClick:()=>{Te||(Z.has(te)?Z.delete(te):Z.add(te),X(new Set(Z)))}},o.default.createElement(s.Icon,{iconClass:"codicon codicon-sparkle"}),(0,l.localize)("aiNative.chat.thinking"),Te?o.default.createElement(g.Loading,null):Z.has(te)?o.default.createElement(s.Icon,{iconClass:"codicon codicon-chevron-right"}):o.default.createElement(s.Icon,{iconClass:"codicon codicon-chevron-down"})),Z.has(te)?null:o.default.createElement("div",{className:a.default.reasoning_content},oe(new u.MarkdownString(_e.content))))}else ge=oe(_e.content);return o.default.createElement(o.Fragment,{key:`${_e.kind}-${te}`},ge)}),[M.response.responseContents,Z]),Ee=o.default.useMemo(()=>M.response.followups?M.response.followups.map((_e,te)=>{let ge=null;if(_e.kind==="reply"){const Te=o.default.createElement("a",{onClick:()=>{z.sendMessage({...H.parseMessage(_e.message),reportExtra:{actionSource:l.ActionSourceEnum.Chat,actionType:l.ActionTypeEnum.Followup}})}},_e.title||_e.message);ge=_e.tooltip?o.default.createElement(m.Tooltip,{title:_e.tooltip},Te):Te}else _e.when&&!$.match(_e.when)&&(ge=null),ge=o.default.createElement(c.Button,{type:"default"},_e.title);return ge&&o.default.createElement(o.Fragment,{key:te},ge)}):null,[M.response.followups]);return M.response.isComplete?o.default.createElement(f.ChatThinkingResult,{hasMessage:M.response.responseParts.length>0||M.response.responseContents.length>0||!!(!((D=M.response.errorDetails)===null||D===void 0)&&D.message),onRegenerate:ie,requestId:M.requestId},o.default.createElement("div",{className:a.default.ai_chat_response_container},!((I=M.response.errorDetails)===null||I===void 0)&&I.message?o.default.createElement("div",{className:a.default.error},o.default.createElement(s.Icon,{className:(0,s.getIcon)("close-circle")}),o.default.createElement("span",null,M.response.errorDetails.message)):o.default.createElement(o.default.Fragment,null,q,Ee?.length!==0&&o.default.createElement("div",{className:a.default.followups},Ee)))):o.default.createElement(f.ChatThinking,{message:M.response.responseText},q)};t.ChatReply=S;const w=T=>{const{chunk:D}=T,I=(0,_.useInjectable)(l.ChatRenderRegistryToken),O=o.default.useMemo(()=>{let M;if(D.kind==="component")M=o.default.createElement(A,{component:D.component,value:D.value});else{let R=o.default.createElement(E.ChatMarkdown,{markdown:D.content,fillInIncompleteTokens:!0});if(I.chatAIRoleRender){const P=I.chatAIRoleRender;R=o.default.createElement(P,{content:D.content})}M=R}return M},[D]);return o.default.createElement(f.ChatThinkingResult,{hasMessage:!0,requestId:T.requestId,showRegenerate:!1},o.default.createElement("div",{className:a.default.ai_chat_response_container},O))};t.ChatNotify=w},17319:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatThinkingResult=t.ChatThinking=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(41869),c=e(89195),p=e(68974),v=e(43718),m=e(19413),_=n.__importDefault(e(6960)),s=l=>{const{children:h,message:u,thinkingText:d}=l,E=(0,o.useInjectable)(v.ChatRenderRegistryToken),f=(0,r.useMemo)(()=>E.chatThinkingRender,[E,E.chatThinkingRender]),a=(0,r.useMemo)(()=>Array.isArray(h)?h.length===0:!h,[h]),b=(0,r.useCallback)(()=>a?f?r.default.createElement(f,{thinkingText:d}):r.default.createElement("span",{className:_.default.thinking_text},d||"Thinking..."):h,[u,h,d,f]);return r.default.createElement(r.default.Fragment,null,r.default.createElement("div",{className:_.default.content},b()),r.default.createElement("div",{className:_.default.thinking_container},r.default.createElement("div",{className:_.default.stop},!f&&r.default.createElement("span",{className:_.default.progress_bar},a&&r.default.createElement(p.Progress,{loading:!0,wrapperClassName:_.default.ai_native_progress_wrapper})))))};t.ChatThinking=s;const g=({children:l,message:h,onRegenerate:u,requestId:d,hasMessage:E=!0,showRegenerate:f})=>{const a=(0,o.useInjectable)(m.IChatInternalService),[b,y]=(0,r.useState)(a.latestRequestId),A=(0,o.useInjectable)(v.ChatRenderRegistryToken);(0,r.useEffect)(()=>{const I=a.onChangeRequestId(O=>{y(O)});return()=>I.dispose()},[a]);const S=(0,r.useMemo)(()=>A.chatThinkingResultRender,[A,A.chatThinkingResultRender]),w=(0,r.useCallback)(()=>{u&&u()},[u]),T=(0,r.useCallback)(()=>{if(typeof E=="boolean"?!E:!h?.trim()){const I=(0,v.localize)("aiNative.chat.stop.immediately");return S?r.default.createElement(S,{thinkingResult:I}):r.default.createElement("span",null,I)}return l},[h,E,l]),D=(0,r.useMemo)(()=>(0,v.isUndefined)(f)?b===d&&!!d:!!f,[b,d,f]);return r.default.createElement(r.default.Fragment,null,r.default.createElement("div",{className:_.default.content},T()),r.default.createElement("div",{className:_.default.thinking_container},r.default.createElement("div",{className:_.default.bottom_container},r.default.createElement("div",{className:_.default.reset},D?r.default.createElement(c.EnhanceIcon,{icon:"refresh",wrapperClassName:_.default.text_btn,className:_.default.transform,onClick:w,tabIndex:0,role:"button"},r.default.createElement("span",null,(0,v.localize)("aiNative.operate.afresh.title"))):null),r.default.createElement("div",{className:_.default.thumbs},r.default.createElement(c.Thumbs,{relationId:d,wrapperClassName:_.default.icon_btn})))))};t.ChatThinkingResult=g},34817:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatToolRender=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(41869),p=e(81878),v=e(89195),m=e(43718),_=e(33783),s=e(77633),g=e(25834),l=n.__importDefault(e(16796)),h=u=>{var d,E,f;const{value:a,messageId:b}=u,[y,A]=(0,o.useState)(!1),S=(0,c.useInjectable)(s.TokenMCPServerRegistry);if(!a||!a.function||!a.id)return null;const w=((d=S.getMCPTool(a.function.name))===null||d===void 0?void 0:d.label)||a.function.name,T=S.getToolComponent(a.function.name),D=R=>{switch(R){case"streaming-start":case"streaming":return{label:"Generating",icon:o.default.createElement(v.Loading,null)};case"complete":return{label:"Complete",icon:o.default.createElement(p.Icon,{iconClass:"codicon codicon-check"})};case"result":return{label:"Result Ready",icon:o.default.createElement(p.Icon,{iconClass:"codicon codicon-check-all"})};default:return{label:R||"Unknown",icon:o.default.createElement(p.Icon,{iconClass:"codicon codicon-question"})}}},I=()=>{var R;try{return a.state!=="complete"&&a.state!=="result"?{}:JSON.parse(((R=a.function)===null||R===void 0?void 0:R.arguments)||"{}")}catch{return{}}},O=()=>{A(!y)},M=D(a.state);return T&&(a.state==="complete"||a.state==="result")?o.default.createElement(T,{state:a.state,args:I(),result:a.result,index:a.index,messageId:b,toolCallId:a.id}):o.default.createElement("div",{className:l.default.chat_tool_render},o.default.createElement("div",{className:l.default.tool_header,onClick:O},o.default.createElement("div",{className:l.default.tool_name},o.default.createElement(p.Icon,{iconClass:`codicon codicon-chevron-${y?"down":"right"}`}),o.default.createElement(p.Icon,{size:"small",iconClass:(0,r.default)("codicon codicon-tools",l.default.tool_icon)}),o.default.createElement("span",{className:l.default.tool_label},w)),a.state&&o.default.createElement("div",{className:l.default.tool_state},o.default.createElement("span",{className:l.default.state_icon},M.icon))),o.default.createElement("div",{className:(0,r.default)(l.default.tool_content,{[l.default.expanded]:y})},((E=a?.function)===null||E===void 0?void 0:E.arguments)&&o.default.createElement("div",{className:l.default.tool_arguments},o.default.createElement("div",{className:l.default.section_label},(0,_.localize)("ai.native.mcp.tool.arguments"),":"),o.default.createElement(g.CodeEditorWithHighlight,{input:(f=a?.function)===null||f===void 0?void 0:f.arguments,language:"json",relationId:(0,m.uuid)(4)})),a?.result&&o.default.createElement("div",{className:l.default.tool_result},o.default.createElement("div",{className:l.default.section_label},(0,_.localize)("ai.native.mcp.tool.results"),":"),o.default.createElement(g.CodeEditorWithHighlight,{input:a.result,language:"json",relationId:(0,m.uuid)(4)}))))};t.ChatToolRender=h},29039:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SlashCustomRender=void 0;const r=e(85608).__importStar(e(14041)),o=e(41869),c=e(43718),p=e(19413),v=m=>{const{userMessage:_,relationId:s,requestId:g,renderContent:l,startTime:h,agentId:u,command:d}=m,E=(0,o.useInjectable)(p.IChatInternalService),f=(0,o.useInjectable)(c.IAIReporter);return r.useEffect(()=>{E.setLatestRequestId(g),f.end(s,{message:_,replytime:Date.now()-h,success:!0,isStop:!1,agentId:u,command:d})},[l,g,s]),r.createElement("div",null,l({userMessage:_}))};t.SlashCustomRender=v},86556:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WelcomeMessage=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(41869),c=e(81878),p=e(4246),v=e(43718),m=e(90684);e(41937);const _=e(19413),s=e(56474),g=e(17319),l=e(78048),h=n.__importDefault(e(6960)),u=()=>{var d,E;const f=(0,o.useInjectable)(v.ChatServiceToken),a=(0,o.useInjectable)(_.IChatAgentService),b=(0,o.useInjectable)(v.ChatFeatureRegistryToken),y=(0,o.useInjectable)(v.ChatRenderRegistryToken),[A,S]=r.useState([]);(0,o.useUpdateOnEvent)(b.onDidWelcomeMessageChange);const w=r.useMemo(()=>{if(!b.chatWelcomeMessageModel)return[];const{sampleQuestions:O=[]}=b.chatWelcomeMessageModel;return O.map(l.extractIcon)},[(d=b.chatWelcomeMessageModel)===null||d===void 0?void 0:d.sampleQuestions]),T=r.useMemo(()=>{if(!b.chatWelcomeMessageModel)return"";const{content:O}=b.chatWelcomeMessageModel;return O},[(E=b.chatWelcomeMessageModel)===null||E===void 0?void 0:E.content]);if(r.useEffect(()=>{const O=a.onDidChangeAgents(async()=>{const R=(await a.getAllSampleQuestions()).map(l.extractIcon);S(R)});return()=>O.dispose()},[]),!T)return r.createElement(g.ChatThinking,{thinkingText:(0,v.localize)("aiNative.chat.welcome.loading.text")});const D=r.useMemo(()=>w.concat(A),[w,A]);return r.useMemo(()=>{if(y.chatWelcomeRender){const O=y.chatWelcomeRender;return r.createElement(O,{message:T,sampleQuestions:D})}return r.createElement("div",{className:h.default.chat_welcome_head},r.createElement("div",{className:h.default.chat_container_des},(0,m.isMarkdownString)(T)?r.createElement(s.ChatMarkdown,{key:"welcome",markdown:T}):T),r.createElement("div",{className:h.default.chat_container_content},D.map((O,M)=>{const R=r.createElement("a",{className:h.default.link_item,onClick:(0,p.withPrevented)(()=>{f.sendMessage({...a.parseMessage(O.message),reportExtra:{actionType:v.ActionTypeEnum.Welcome,actionSource:v.ActionSourceEnum.Chat}})})},O.icon?r.createElement(c.Icon,{className:O.icon,style:{color:"inherit",marginRight:"4px"}}):"",r.createElement("span",null,O.title));return O.tooltip?r.createElement(c.Tooltip,{title:O.tooltip,key:M},R):r.createElement(r.Fragment,{key:M},R)})))},[y.chatWelcomeRender,T,D])};t.WelcomeMessage=u},83933:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.highLightLanguageSupport=void 0,t.highLightLanguageSupport=["1c","abnf","accesslog","actionscript","ada","angelscript","apache","applescript","arcade","arduino","armasm","xml","asciidoc","aspectj","autohotkey","autoit","avrasm","awk","axapta","bash","basic","bnf","brainfuck","c-like","c","cal","capnproto","ceylon","clean","clojure","clojure-repl","cmake","coffeescript","coq","cos","cpp","crmsh","crystal","csharp","csp","css","d","markdown","dart","delphi","diff","django","dns","dockerfile","dos","dsconfig","dts","dust","ebnf","elixir","elm","ruby","erb","erlang-repl","erlang","excel","fix","flix","fortran","fsharp","gams","gauss","gcode","gherkin","glsl","gml","go","golo","gradle","groovy","haml","handlebars","haskell","haxe","hsp","htmlbars","http","hy","inform7","ini","irpf90","isbl","java","javascript","jboss-cli","json","julia","julia-repl","kotlin","lasso","latex","ldif","leaf","less","lisp","livecodeserver","livescript","llvm","lsl","lua","makefile","mathematica","matlab","maxima","mel","mercury","mipsasm","mizar","perl","mojolicious","monkey","moonscript","n1ql","nginx","nim","nix","node-repl","nsis","objectivec","ocaml","openscad","oxygene","parser3","pf","pgsql","php","php-template","plaintext","pony","powershell","processing","profile","prolog","properties","protobuf","puppet","purebasic","python","python-repl","q","qml","r","reasonml","rib","roboconf","routeros","rsl","ruleslanguage","rust","sas","scala","scheme","scilab","scss","shell","smali","smalltalk","sml","sqf","sql_more","sql","stan","stata","step21","stylus","subunit","swift","taggerscript","yaml","tap","tcl","thrift","tp","twig","typescript","vala","vbnet","vbscript","vbscript-html","verilog","vhdl","vim","x86asm","xl","xquery","zephir"]},96086:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MentionInput=t.WHITE_SPACE_TEXT=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(81878),p=e(89195),v=e(70392),m=n.__importDefault(e(97599)),_=e(80732),s=e(44692);t.WHITE_SPACE_TEXT=" ";const g=({mentionItems:l=[],onSend:h,onStop:u,loading:d=!1,mentionKeyword:E=s.MENTION_KEYWORD,onSelectionChange:f,onImageUpload:a,labelService:b,workspaceService:y,placeholder:A="Ask anything, @ to mention",footerConfig:S={buttons:[],showModelSelector:!1}})=>{const w=o.useRef(null),[T,D]=o.useState({active:!1,startPos:null,filter:"",position:{top:0,left:0},activeIndex:0,level:0,parentType:null,secondLevelFilter:"",inlineSearchActive:!1,inlineSearchStartPos:null,loading:!1}),[I,O]=o.useState(S.defaultModel||""),[M,R]=o.useState({}),[P,k]=o.useState([]),[F,L]=o.useState(-1),[B,j]=o.useState(""),[W,U]=o.useState(!1),Q=()=>T.level===0?l:T.parentType?T.loading?M[T.parentType]||[]:M[T.parentType]||[]:[],$=((Ee,_e)=>{const[te,ge]=o.useState(Ee);return o.useEffect(()=>{const Te=setTimeout(()=>{ge(Ee)},_e);return()=>{clearTimeout(Te)}},[Ee,_e]),te})(T.secondLevelFilter,300);o.useEffect(()=>{if(T.level===1&&T.parentType&&$!==void 0){const Ee=l.find(te=>te.id===T.parentType);if(!Ee)return;D(te=>({...te,loading:!0})),(async()=>{try{const te=[];if(Ee.getHighestLevelItems){const ge=Ee.getHighestLevelItems();for(const Te of ge)te.some(Pe=>Pe.id===Te.id)||te.push(Te);R(Te=>({...Te,[T.parentType]:ge}))}if(Ee.getItems)try{const ge=await Ee.getItems($),Te=[...te];for(const Pe of ge)Te.some(Ae=>Ae.id===Pe.id)||Te.push(Pe);R(Pe=>({...Pe,[T.parentType]:Te}))}catch{D(Te=>({...Te,loading:!1}))}D(ge=>({...ge,loading:!1}))}catch{D(ge=>({...ge,loading:!1}))}})()}},[$,T.level,T.parentType]);const Y=Ee=>{const _e=window.getSelection();if(!_e||!_e.rangeCount)return 0;const te=_e.getRangeAt(0),ge=te.cloneRange();return ge.selectNodeContents(Ee),ge.setEnd(te.endContainer,te.endOffset),ge.toString().length},z=()=>{W&&(U(!1),L(-1));const Ee=window.getSelection();if(!Ee||!Ee.rangeCount||!w.current)return;const _e=w.current.textContent||"",te=Y(w.current);if(_e[te-1]===E&&!T.active&&!T.inlineSearchActive&&D({active:!0,startPos:te,filter:E,position:{top:0,left:0},activeIndex:0,level:0,parentType:null,secondLevelFilter:"",inlineSearchActive:!1,inlineSearchStartPos:null,loading:!1}),T.active&&T.level===0&&T.startPos!==null)if(te<T.startPos)D(ge=>({...ge,active:!1}));else{const ge=_e.substring(T.startPos-1,te);D(Te=>({...Te,filter:ge,activeIndex:0}))}if(T.inlineSearchActive&&T.inlineSearchStartPos!==null&&T.parentType){const ge=l.find(Ae=>Ae.id===T.parentType);if(!ge)return;const Te=`@${ge.type}:`,Pe=T.inlineSearchStartPos-Te.length;if(Pe>=0&&te>Pe+Te.length){const Ae=_e.substring(Pe+Te.length,te);Ae!==T.secondLevelFilter&&D(we=>({...we,secondLevelFilter:Ae,active:!0,activeIndex:0}))}else te<=Pe&&D(Ae=>({...Ae,inlineSearchActive:!1,active:!1}))}if(w.current&&(w.current.scrollHeight>120?w.current.style.overflowY="auto":w.current.style.overflowY="hidden"),w.current){const ge=w.current.innerHTML;(ge===""||ge==="<br>"||ge==="<br/>")&&(w.current.innerHTML="")}},H=Ee=>{if(Ee.key==="Escape"&&(T.active||T.inlineSearchActive)){T.level>0?D(te=>({...te,level:0,activeIndex:0,secondLevelFilter:"",inlineSearchActive:!1})):D(te=>({...te,active:!1,inlineSearchActive:!1})),Ee.preventDefault();return}if(Ee.key===s.MENTION_KEYWORD&&!T.active&&!T.inlineSearchActive&&w.current){const te=Y(w.current);D({active:!0,startPos:te+1,filter:E,position:{top:0,left:0},activeIndex:0,level:0,parentType:null,secondLevelFilter:"",inlineSearchActive:!1,inlineSearchStartPos:null,loading:!1})}if((Ee.key==="ArrowUp"||Ee.key==="ArrowDown")&&!Ee.shiftKey&&!Ee.ctrlKey&&!Ee.metaKey&&!Ee.altKey){if(!T.active&&!T.inlineSearchActive&&w.current&&P.length>0){const te=w.current.innerHTML;if(!te||te==="<br>"||W&&F>=0&&P[P.length-1-F]===te){Ee.preventDefault(),W||(j(te),U(!0));let Te=F;Ee.key==="ArrowUp"?Te=Math.min(P.length-1,F+1):Te=Math.max(-1,F-1),L(Te),Te===-1?w.current.innerHTML=B:w.current.innerHTML=P[P.length-1-Te];const Pe=document.createRange();Pe.selectNodeContents(w.current),Pe.collapse(!1);const Ae=window.getSelection();Ae&&(Ae.removeAllRanges(),Ae.addRange(Pe));return}}}else W&&Ee.key!=="ArrowUp"&&Ee.key!=="ArrowDown"&&(U(!1),L(-1));if(Ee.key==="Enter"){if(Ee.nativeEvent.isComposing)return;if(!Ee.shiftKey&&(Ee.preventDefault(),!T.active)){le();return}}if(!T.active)return;let _e=Q();if(T.level===0&&T.filter&&T.filter.length>1){const te=T.filter.substring(1).toLowerCase();_e=_e.filter(ge=>ge.text.toLowerCase().includes(te))}_e.length!==0&&(Ee.key==="ArrowDown"?(D(te=>({...te,activeIndex:(te.activeIndex+1)%_e.length})),Ee.preventDefault()):Ee.key==="ArrowUp"?(D(te=>({...te,activeIndex:(te.activeIndex-1+_e.length)%_e.length})),Ee.preventDefault()):(Ee.key==="Enter"||Ee.key==="Tab")&&_e.length>0&&(ie(_e[T.activeIndex]),Ee.preventDefault()))},K=()=>{},Z=async Ee=>{const _e=Ee.clipboardData.items,te=[];for(let fe=0;fe<_e.length;fe++)if(_e[fe].kind==="file"&&_e[fe].type.startsWith("image/")){const xe=_e[fe].getAsFile();xe&&te.push(xe)}if(Ee.preventDefault(),te.length>0&&a){await a(te);return}const Te=Ee.clipboardData.getData("text/plain").replace(/\t/g," ").replace(/\n\s*\n/g,`
|
|
31266
|
+
`),P=R[R.length-1],k=[{condition:P.includes("`"),action:d},{condition:P.includes("**"),action:y},{condition:P.match(/\*\w/),action:E},{condition:P.match(/(^|\s)__\w/),action:A},{condition:P.match(/(^|\s)_\w/),action:f},{condition:P.match(/(^|\s)\[.*\]\(\w*/),action:a},{condition:P.match(/(^|\s)\[\w/),action:b}];for(const F of k)if(F.condition)return F.action(I)}}},49601:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatMentionInput=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(46541),c=e(41869),p=e(81878),v=e(43718),m=e(92323),_=e(54414),s=e(47720),g=e(72665),l=e(51500),h=e(19413),u=e(27397),d=n.__importDefault(e(6960)),E=e(96086),f=e(44692),a=y=>{const{onSend:A,disabled:S=!1}=y,[w,T]=(0,r.useState)(y.value||""),[D,I]=(0,r.useState)(y.images||[]),O=(0,c.useInjectable)(h.IChatInternalService),M=(0,c.useInjectable)(m.CommandService),R=(0,c.useInjectable)(s.FileSearchServicePath),P=(0,c.useInjectable)(c.RecentFilesManager),k=(0,c.useInjectable)(l.IWorkspaceService),F=(0,c.useInjectable)(_.WorkbenchEditorService),L=(0,c.useInjectable)(c.LabelService),B=(0,c.useInjectable)(g.IMessageService),j=(0,c.useInjectable)(v.ChatFeatureRegistryToken),W=r.default.useCallback(()=>{M.executeCommand(u.OPEN_MCP_CONFIG_COMMAND.id)},[M]);(0,r.useEffect)(()=>{y.value!==w&&T(y.value||"")},[y.value]);const U=[{id:f.MentionType.FILE,type:f.MentionType.FILE,text:"File",icon:(0,p.getIcon)("file"),getHighestLevelItems:()=>{const H=F.currentEditor,K=H?.currentUri;return K?[{id:K.codeUri.fsPath,type:f.MentionType.FILE,text:K.displayName,value:K.codeUri.fsPath,description:`(${(0,v.localize)("aiNative.chat.defaultContextFile")})`,contextId:K.codeUri.fsPath,icon:L.getIcon(K)}]:[]},getItems:async H=>{if(H){const K=(await k.roots).map(X=>new v.URI(X.uri).codeUri.fsPath.toString()),Z=await R.find(H,{rootUris:K,useGitIgnore:!0,noIgnoreParent:!0,fuzzyMatch:!0,limit:10});return Promise.all(Z.map(async X=>{var ie;const oe=new v.URI(X),le=(ie=await k.asRelativePath(oe.parent))===null||ie===void 0?void 0:ie.path;return{id:oe.codeUri.fsPath,type:f.MentionType.FILE,text:oe.displayName,value:oe.codeUri.fsPath,description:le||"",contextId:oe.codeUri.fsPath,icon:L.getIcon(oe)}}))}else{const K=await P.getMostRecentlyOpenedFiles();return Promise.all(K.map(async Z=>{var X;const ie=new v.URI(Z),oe=(X=await k.asRelativePath(ie.parent))===null||X===void 0?void 0:X.path;return{id:ie.codeUri.fsPath,type:f.MentionType.FILE,text:ie.displayName,value:ie.codeUri.fsPath,description:oe||"",contextId:ie.codeUri.fsPath,icon:L.getIcon(ie)}}))}}},{id:f.MentionType.FOLDER,type:f.MentionType.FOLDER,text:"Folder",icon:(0,p.getIcon)("folder"),getHighestLevelItems:()=>{var H,K;const Z=F.currentEditor,X=(H=Z?.currentUri)===null||H===void 0?void 0:H.parent;return X?X.toString()===((K=k.workspace)===null||K===void 0?void 0:K.uri)?[]:[{id:X.codeUri.fsPath,type:f.MentionType.FOLDER,text:X.displayName,value:X.codeUri.fsPath,description:`(${(0,v.localize)("aiNative.chat.defaultContextFolder")})`,contextId:X.codeUri.fsPath,icon:(0,p.getIcon)("folder")}]:[]},getItems:async H=>{let K=[];if(H){const Z=(await k.roots).map(oe=>new v.URI(oe.uri).codeUri.fsPath.toString()),X=await R.find(H,{rootUris:Z,useGitIgnore:!0,noIgnoreParent:!0,fuzzyMatch:!0,excludePatterns:["**/node_modules/**/*","**/.git/**/*"],limit:10}),ie=Array.from(new Set(X.map(oe=>new v.URI(oe).parent.toString()).filter(oe=>{var le;return oe!==((le=k.workspace)===null||le===void 0?void 0:le.uri.toString())})));return Promise.all(ie.map(async oe=>{var le;const pe=new v.URI(oe);return{id:pe.codeUri.fsPath,type:f.MentionType.FOLDER,text:pe.displayName,value:pe.codeUri.fsPath,description:((le=await k.asRelativePath(pe.parent))===null||le===void 0?void 0:le.path)||"",contextId:pe.codeUri.fsPath,icon:(0,p.getIcon)("folder")}}))}else{const Z=await P.getMostRecentlyOpenedFiles(),X=Array.from(new Set(Z.map(ie=>new v.URI(ie).parent.codeUri.fsPath)));K=await Promise.all(X.map(async ie=>{const oe=new v.URI(ie),le=await k.asRelativePath(oe);return{id:oe.codeUri.fsPath,type:f.MentionType.FOLDER,text:oe.displayName,value:oe.codeUri.fsPath,description:le?.root?le.path:"",contextId:oe.codeUri.fsPath,icon:(0,p.getIcon)("folder")}}))}return K.filter(Z=>{var X;return Z.id!==new v.URI((X=k.workspace)===null||X===void 0?void 0:X.uri).codeUri.fsPath})}}],Q=(0,r.useMemo)(()=>({modelOptions:[{label:"QWQ 32B",value:"qwq-32b"},{label:"DeepSeek R1",value:"deepseek-r1"}],defaultModel:"deepseek-r1",buttons:[{id:"mcp-server",icon:"mcp",title:"MCP Server",onClick:W,position:f.FooterButtonPosition.LEFT},{id:"upload-image",icon:"image",title:(0,v.localize)("aiNative.chat.imageUpload"),onClick:()=>{const H=document.createElement("input");H.type="file",H.accept="image/*",H.onchange=K=>{const Z=K.target.files;Z?.length&&Y(Array.from(Z))},H.click()},position:f.FooterButtonPosition.LEFT}],showModelSelector:!0}),[W]),V=(0,r.useCallback)(()=>{O.cancelRequest()},[]),$=(0,r.useCallback)(async(H,K)=>{S||(A(H,D.map(Z=>Z.toString()),void 0,void 0,K),I(y.images||[]))},[A,D,S]),Y=(0,r.useCallback)(async H=>{const K=["image/jpeg","image/jpg","image/png","image/webp","image/gif"];if(H.filter(le=>!K.includes(le.type)).length>0){B.error("Only JPG, PNG, WebP and GIF images are supported");return}const X=j.getImageUploadProvider();if(!X){B.error("No image upload provider found");return}const ie=await Promise.all(H.map(le=>X.imageUpload(le))),oe=[...D,...ie];I(oe)},[D]),z=(0,r.useCallback)(H=>{I(D.filter((K,Z)=>Z!==H))},[D]);return r.default.createElement("div",{className:d.default.chat_input_container},D.length>0&&r.default.createElement(b,{images:D,onDelete:z}),r.default.createElement(E.MentionInput,{mentionItems:U,onSend:$,onStop:V,loading:S,labelService:L,workspaceService:k,placeholder:(0,v.localize)("aiNative.chat.input.placeholder.default"),footerConfig:Q,onImageUpload:Y}))};t.ChatMentionInput=a;const b=({images:y,onDelete:A})=>r.default.createElement("div",null,r.default.createElement("div",{className:d.default.thumbnail_container},y.map((S,w)=>r.default.createElement("div",{key:w,className:d.default.thumbnail},r.default.createElement(o.Image,{src:S.toString()}),r.default.createElement("button",{onClick:()=>A(w),className:d.default.delete_button},r.default.createElement(p.Icon,{iconClass:"codicon codicon-close"}))))))},92635:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatNotify=t.ChatReply=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(48412),p=e(91416),v=e(78569),m=e(72871),_=e(41869),s=e(81878),g=e(89195),l=e(43718),h=e(52416),u=e(90684),d=e(19413),E=e(56474),f=e(17319),a=n.__importDefault(e(6960)),b=T=>{const D=(0,_.useInjectable)(_.LabelService),I=(0,_.useInjectable)(_.CommandService),O=(L,B,j)=>{let W=D.getIcon(L,{isDirectory:B});return B&&j&&(W+=" expanded"),W},M=(0,o.useMemo)(()=>{const L=B=>{const j=typeof B.type=="number"?B.type===l.FileType.Directory:!!B.children,W=new l.URI(B.uri);return{label:B.label,iconClassName:O(W,j,j),expandable:!0,expanded:!0,children:j?(B.children||[]).map(L):null,uri:W}};return(T.treeData.children||[]).map(L)},[T.treeData]),[R,P]=(0,o.useState)(22),k=(0,o.useRef)(null),F=L=>{k.current=L;const B=()=>{let j=L.getModel().root.branchSize;j<1?j=1:j>20&&(j=20),P(j*22)};B(),L.onDidUpdate(B)};return M.length?o.default.createElement("div",{className:a.default.tree_container},o.default.createElement(p.BasicRecycleTree,{height:R,treeData:M,onContextMenu:L=>L.preventDefault(),onClick:(L,B)=>{!k.current||!B||(v.BasicCompositeTreeNode.is(B)?B.raw.iconClassName=O(B.raw.uri,!0,B.expanded):I.executeCommand(_.EDITOR_COMMANDS.OPEN_RESOURCE.id,B.raw.uri,{disableNavigate:!0,preview:!0}))},onReady:F,treeName:T.treeData.label,leaveBottomBlank:!1,baseIndent:0})):null},y=T=>{const{toolCall:D,messageId:I}=T,O=(0,_.useInjectable)(l.ChatAgentViewServiceToken),[M,R]=(0,o.useState)(null);return(0,o.useEffect)(()=>{const P=O.getChatComponent("toolCall");if(P){const{component:F,initialProps:L}=P;R(o.default.createElement(F,{...L,value:D,messageId:I}));return}R(o.default.createElement("div",null,o.default.createElement(g.Loading,null),o.default.createElement("span",{style:{marginLeft:4}},"\u6B63\u5728\u52A0\u8F7D\u7EC4\u4EF6"))),O.getChatComponentDeferred("toolCall").promise.then(({component:F,initialProps:L})=>{R(o.default.createElement(F,{...L,value:D,messageId:I}))})},[D.state]),M},A=T=>{const D=(0,_.useInjectable)(l.ChatAgentViewServiceToken),[I,O]=(0,o.useState)(null);return(0,o.useEffect)(()=>{const M=D.getChatComponent(T.component);if(M){const{component:P,initialProps:k}=M;O(o.default.createElement(P,{...k,value:T.value,messageId:T.messageId}));return}O(o.default.createElement("div",null,o.default.createElement(g.Loading,null),o.default.createElement("span",{style:{marginLeft:4}},"\u6B63\u5728\u52A0\u8F7D\u7EC4\u4EF6"))),D.getChatComponentDeferred(T.component).promise.then(({component:P,initialProps:k})=>{O(o.default.createElement(P,{...k,value:T.value}))})},[T.component,T.value]),I},S=T=>{var D,I;const{relationId:O,request:M,startTime:R=0,onRegenerate:P,onDidChange:k,onDone:F,agentId:L,command:B,history:j,msgId:W}=T,[,U]=(0,o.useReducer)(_e=>(_e+1)%1e6,0),Q=(0,_.useInjectable)(l.IAIReporter),V=(0,_.useInjectable)(h.IIconService),$=(0,_.useInjectable)(_.IContextKeyService),Y=(0,_.useInjectable)(d.IChatInternalService),z=(0,_.useInjectable)(l.ChatServiceToken),H=(0,_.useInjectable)(d.IChatAgentService),K=(0,_.useInjectable)(l.ChatRenderRegistryToken),[Z,X]=(0,o.useState)(M.response.isComplete?new Set(M.response.responseContents.map((_e,te)=>_e.kind==="reasoning"?te:-1).filter(_e=>_e!==-1)):new Set);(0,o.useEffect)(()=>{M.response.isComplete&&X(new Set(M.response.responseContents.map((_e,te)=>_e.kind==="reasoning"?te:-1).filter(_e=>_e!==-1)))},[M.response.isComplete]),(0,o.useEffect)(()=>{const _e=new _.DisposableCollection;return _e.push(M.response.onDidChange(()=>{j.updateAssistantMessage(W,{content:M.response.responseText}),M.response.isComplete&&(F&&F(),Q.end(O,{assistantMessage:M.response.responseText,replytime:Date.now()-R,success:!0,isStop:!1,command:B,agentId:L,messageId:W,sessionId:Y.sessionModel.sessionId})),(0,o.startTransition)(()=>{k?.(),U()})})),()=>_e.dispose()},[O,k,F]);const ie=(0,o.useCallback)(()=>{M.response.reset(),P?.()},[P]),oe=(0,o.useCallback)(_e=>{if(K.chatAIRoleRender){const te=K.chatAIRoleRender;return o.default.createElement(te,{content:_e.value})}return o.default.createElement(E.ChatMarkdown,{markdown:_e,fillInIncompleteTokens:!0})},[K,K.chatAIRoleRender]),le=_e=>o.default.createElement(b,{treeData:_e}),pe=_e=>o.default.createElement("div",{className:a.default.placeholder},o.default.createElement(s.Icon,{iconClass:V.fromString("$(codicon/sync~spin)")}),o.default.createElement("div",{className:a.default.placeholder_content},oe(_e))),q=o.default.useMemo(()=>M.response.responseContents.map((_e,te)=>{let ge;if(_e.kind==="asyncContent")ge=pe(new u.MarkdownString(_e.content));else if(_e.kind==="treeData")ge=le(_e.treeData);else if(_e.kind==="component")ge=o.default.createElement(A,{component:_e.component,value:_e.value,messageId:W});else if(_e.kind==="toolCall")ge=o.default.createElement(y,{toolCall:_e.content,messageId:W});else if(_e.kind==="reasoning"){const Te=te===M.response.responseContents.length-1&&!M.response.isComplete;ge=o.default.createElement("div",{className:(0,r.default)(a.default.reasoning,{[a.default.thinking]:Te})},o.default.createElement(c.Button,{size:"small",type:"secondary",className:a.default.thinking,onClick:()=>{Te||(Z.has(te)?Z.delete(te):Z.add(te),X(new Set(Z)))}},o.default.createElement(s.Icon,{iconClass:"codicon codicon-sparkle"}),(0,l.localize)("aiNative.chat.thinking"),Te?o.default.createElement(g.Loading,null):Z.has(te)?o.default.createElement(s.Icon,{iconClass:"codicon codicon-chevron-right"}):o.default.createElement(s.Icon,{iconClass:"codicon codicon-chevron-down"})),Z.has(te)?null:o.default.createElement("div",{className:a.default.reasoning_content},oe(new u.MarkdownString(_e.content))))}else ge=oe(_e.content);return o.default.createElement(o.Fragment,{key:`${_e.kind}-${te}`},ge)}),[M.response.responseContents,Z]),Ee=o.default.useMemo(()=>M.response.followups?M.response.followups.map((_e,te)=>{let ge=null;if(_e.kind==="reply"){const Te=o.default.createElement("a",{onClick:()=>{z.sendMessage({...H.parseMessage(_e.message),reportExtra:{actionSource:l.ActionSourceEnum.Chat,actionType:l.ActionTypeEnum.Followup}})}},_e.title||_e.message);ge=_e.tooltip?o.default.createElement(m.Tooltip,{title:_e.tooltip},Te):Te}else _e.when&&!$.match(_e.when)&&(ge=null),ge=o.default.createElement(c.Button,{type:"default"},_e.title);return ge&&o.default.createElement(o.Fragment,{key:te},ge)}):null,[M.response.followups]);return M.response.isComplete?o.default.createElement(f.ChatThinkingResult,{hasMessage:M.response.responseParts.length>0||M.response.responseContents.length>0||!!(!((D=M.response.errorDetails)===null||D===void 0)&&D.message),onRegenerate:ie,requestId:M.requestId},o.default.createElement("div",{className:a.default.ai_chat_response_container},!((I=M.response.errorDetails)===null||I===void 0)&&I.message?o.default.createElement("div",{className:a.default.error},o.default.createElement(s.Icon,{className:(0,s.getIcon)("close-circle")}),o.default.createElement("span",null,M.response.errorDetails.message)):o.default.createElement(o.default.Fragment,null,q,Ee?.length!==0&&o.default.createElement("div",{className:a.default.followups},Ee)))):o.default.createElement(f.ChatThinking,{message:M.response.responseText},q)};t.ChatReply=S;const w=T=>{const{chunk:D}=T,I=(0,_.useInjectable)(l.ChatRenderRegistryToken),O=o.default.useMemo(()=>{let M;if(D.kind==="component")M=o.default.createElement(A,{component:D.component,value:D.value});else{let R=o.default.createElement(E.ChatMarkdown,{markdown:D.content,fillInIncompleteTokens:!0});if(I.chatAIRoleRender){const P=I.chatAIRoleRender;R=o.default.createElement(P,{content:D.content})}M=R}return M},[D]);return o.default.createElement(f.ChatThinkingResult,{hasMessage:!0,requestId:T.requestId,showRegenerate:!1},o.default.createElement("div",{className:a.default.ai_chat_response_container},O))};t.ChatNotify=w},17319:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatThinkingResult=t.ChatThinking=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(41869),c=e(89195),p=e(68974),v=e(43718),m=e(19413),_=n.__importDefault(e(6960)),s=l=>{const{children:h,message:u,thinkingText:d}=l,E=(0,o.useInjectable)(v.ChatRenderRegistryToken),f=(0,r.useMemo)(()=>E.chatThinkingRender,[E,E.chatThinkingRender]),a=(0,r.useMemo)(()=>Array.isArray(h)?h.length===0:!h,[h]),b=(0,r.useCallback)(()=>a?f?r.default.createElement(f,{thinkingText:d}):r.default.createElement("span",{className:_.default.thinking_text},d||"Thinking..."):h,[u,h,d,f]);return r.default.createElement(r.default.Fragment,null,r.default.createElement("div",{className:_.default.content},b()),r.default.createElement("div",{className:_.default.thinking_container},r.default.createElement("div",{className:_.default.stop},!f&&r.default.createElement("span",{className:_.default.progress_bar},a&&r.default.createElement(p.Progress,{loading:!0,wrapperClassName:_.default.ai_native_progress_wrapper})))))};t.ChatThinking=s;const g=({children:l,message:h,onRegenerate:u,requestId:d,hasMessage:E=!0,showRegenerate:f})=>{const a=(0,o.useInjectable)(m.IChatInternalService),[b,y]=(0,r.useState)(a.latestRequestId),A=(0,o.useInjectable)(v.ChatRenderRegistryToken);(0,r.useEffect)(()=>{const I=a.onChangeRequestId(O=>{y(O)});return()=>I.dispose()},[a]);const S=(0,r.useMemo)(()=>A.chatThinkingResultRender,[A,A.chatThinkingResultRender]),w=(0,r.useCallback)(()=>{u&&u()},[u]),T=(0,r.useCallback)(()=>{if(typeof E=="boolean"?!E:!h?.trim()){const I=(0,v.localize)("aiNative.chat.stop.immediately");return S?r.default.createElement(S,{thinkingResult:I}):r.default.createElement("span",null,I)}return l},[h,E,l]),D=(0,r.useMemo)(()=>(0,v.isUndefined)(f)?b===d&&!!d:!!f,[b,d,f]);return r.default.createElement(r.default.Fragment,null,r.default.createElement("div",{className:_.default.content},T()),r.default.createElement("div",{className:_.default.thinking_container},r.default.createElement("div",{className:_.default.bottom_container},r.default.createElement("div",{className:_.default.reset},D?r.default.createElement(c.EnhanceIcon,{icon:"refresh",wrapperClassName:_.default.text_btn,className:_.default.transform,onClick:w,tabIndex:0,role:"button"},r.default.createElement("span",null,(0,v.localize)("aiNative.operate.afresh.title"))):null),r.default.createElement("div",{className:_.default.thumbs},r.default.createElement(c.Thumbs,{relationId:d,wrapperClassName:_.default.icon_btn})))))};t.ChatThinkingResult=g},34817:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatToolRender=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(41869),p=e(81878),v=e(89195),m=e(43718),_=e(33783),s=e(77633),g=e(25834),l=n.__importDefault(e(16796)),h=u=>{var d,E,f;const{value:a,messageId:b}=u,[y,A]=(0,o.useState)(!1),S=(0,c.useInjectable)(s.TokenMCPServerRegistry);if(!a||!a.function||!a.id)return null;const w=((d=S.getMCPTool(a.function.name))===null||d===void 0?void 0:d.label)||a.function.name,T=S.getToolComponent(a.function.name),D=R=>{switch(R){case"streaming-start":case"streaming":return{label:"Generating",icon:o.default.createElement(v.Loading,null)};case"complete":return{label:"Complete",icon:o.default.createElement(p.Icon,{iconClass:"codicon codicon-check"})};case"result":return{label:"Result Ready",icon:o.default.createElement(p.Icon,{iconClass:"codicon codicon-check-all"})};default:return{label:R||"Unknown",icon:o.default.createElement(p.Icon,{iconClass:"codicon codicon-question"})}}},I=()=>{var R;try{return a.state!=="complete"&&a.state!=="result"?{}:JSON.parse(((R=a.function)===null||R===void 0?void 0:R.arguments)||"{}")}catch{return{}}},O=()=>{A(!y)},M=D(a.state);return T&&(a.state==="complete"||a.state==="result")?o.default.createElement(T,{state:a.state,args:I(),result:a.result,index:a.index,messageId:b,toolCallId:a.id}):o.default.createElement("div",{className:l.default.chat_tool_render},o.default.createElement("div",{className:l.default.tool_header,onClick:O},o.default.createElement("div",{className:l.default.tool_name},o.default.createElement(p.Icon,{iconClass:`codicon codicon-chevron-${y?"down":"right"}`}),o.default.createElement(p.Icon,{size:"small",iconClass:(0,r.default)("codicon codicon-tools",l.default.tool_icon)}),o.default.createElement("span",{className:l.default.tool_label},w)),a.state&&o.default.createElement("div",{className:l.default.tool_state},o.default.createElement("span",{className:l.default.state_icon},M.icon))),o.default.createElement("div",{className:(0,r.default)(l.default.tool_content,{[l.default.expanded]:y})},((E=a?.function)===null||E===void 0?void 0:E.arguments)&&o.default.createElement("div",{className:l.default.tool_arguments},o.default.createElement("div",{className:l.default.section_label},(0,_.localize)("ai.native.mcp.tool.arguments"),":"),o.default.createElement(g.CodeEditorWithHighlight,{input:(f=a?.function)===null||f===void 0?void 0:f.arguments,language:"json",relationId:(0,m.uuid)(4)})),a?.result&&o.default.createElement("div",{className:l.default.tool_result},o.default.createElement("div",{className:l.default.section_label},(0,_.localize)("ai.native.mcp.tool.results"),":"),o.default.createElement(g.CodeEditorWithHighlight,{input:a.result,language:"json",relationId:(0,m.uuid)(4)}))))};t.ChatToolRender=h},29039:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SlashCustomRender=void 0;const r=e(85608).__importStar(e(14041)),o=e(41869),c=e(43718),p=e(19413),v=m=>{const{userMessage:_,relationId:s,requestId:g,renderContent:l,startTime:h,agentId:u,command:d}=m,E=(0,o.useInjectable)(p.IChatInternalService),f=(0,o.useInjectable)(c.IAIReporter);return r.useEffect(()=>{E.setLatestRequestId(g),f.end(s,{message:_,replytime:Date.now()-h,success:!0,isStop:!1,agentId:u,command:d})},[l,g,s]),r.createElement("div",null,l({userMessage:_}))};t.SlashCustomRender=v},86556:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WelcomeMessage=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(41869),c=e(81878),p=e(4246),v=e(43718),m=e(90684);e(41937);const _=e(19413),s=e(56474),g=e(17319),l=e(78048),h=n.__importDefault(e(6960)),u=()=>{var d,E;const f=(0,o.useInjectable)(v.ChatServiceToken),a=(0,o.useInjectable)(_.IChatAgentService),b=(0,o.useInjectable)(v.ChatFeatureRegistryToken),y=(0,o.useInjectable)(v.ChatRenderRegistryToken),[A,S]=r.useState([]);(0,o.useUpdateOnEvent)(b.onDidWelcomeMessageChange);const w=r.useMemo(()=>{if(!b.chatWelcomeMessageModel)return[];const{sampleQuestions:O=[]}=b.chatWelcomeMessageModel;return O.map(l.extractIcon)},[(d=b.chatWelcomeMessageModel)===null||d===void 0?void 0:d.sampleQuestions]),T=r.useMemo(()=>{if(!b.chatWelcomeMessageModel)return"";const{content:O}=b.chatWelcomeMessageModel;return O},[(E=b.chatWelcomeMessageModel)===null||E===void 0?void 0:E.content]);if(r.useEffect(()=>{const O=a.onDidChangeAgents(async()=>{const R=(await a.getAllSampleQuestions()).map(l.extractIcon);S(R)});return()=>O.dispose()},[]),!T)return r.createElement(g.ChatThinking,{thinkingText:(0,v.localize)("aiNative.chat.welcome.loading.text")});const D=r.useMemo(()=>w.concat(A),[w,A]);return r.useMemo(()=>{if(y.chatWelcomeRender){const O=y.chatWelcomeRender;return r.createElement(O,{message:T,sampleQuestions:D})}return r.createElement("div",{className:h.default.chat_welcome_head},r.createElement("div",{className:h.default.chat_container_des},(0,m.isMarkdownString)(T)?r.createElement(s.ChatMarkdown,{key:"welcome",markdown:T}):T),r.createElement("div",{className:h.default.chat_container_content},D.map((O,M)=>{const R=r.createElement("a",{className:h.default.link_item,onClick:(0,p.withPrevented)(()=>{f.sendMessage({...a.parseMessage(O.message),reportExtra:{actionType:v.ActionTypeEnum.Welcome,actionSource:v.ActionSourceEnum.Chat}})})},O.icon?r.createElement(c.Icon,{className:O.icon,style:{color:"inherit",marginRight:"4px"}}):"",r.createElement("span",null,O.title));return O.tooltip?r.createElement(c.Tooltip,{title:O.tooltip,key:M},R):r.createElement(r.Fragment,{key:M},R)})))},[y.chatWelcomeRender,T,D])};t.WelcomeMessage=u},83933:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.highLightLanguageSupport=void 0,t.highLightLanguageSupport=["1c","abnf","accesslog","actionscript","ada","angelscript","apache","applescript","arcade","arduino","armasm","xml","asciidoc","aspectj","autohotkey","autoit","avrasm","awk","axapta","bash","basic","bnf","brainfuck","c-like","c","cal","capnproto","ceylon","clean","clojure","clojure-repl","cmake","coffeescript","coq","cos","cpp","crmsh","crystal","csharp","csp","css","d","markdown","dart","delphi","diff","django","dns","dockerfile","dos","dsconfig","dts","dust","ebnf","elixir","elm","ruby","erb","erlang-repl","erlang","excel","fix","flix","fortran","fsharp","gams","gauss","gcode","gherkin","glsl","gml","go","golo","gradle","groovy","haml","handlebars","haskell","haxe","hsp","htmlbars","http","hy","inform7","ini","irpf90","isbl","java","javascript","jboss-cli","json","julia","julia-repl","kotlin","lasso","latex","ldif","leaf","less","lisp","livecodeserver","livescript","llvm","lsl","lua","makefile","mathematica","matlab","maxima","mel","mercury","mipsasm","mizar","perl","mojolicious","monkey","moonscript","n1ql","nginx","nim","nix","node-repl","nsis","objectivec","ocaml","openscad","oxygene","parser3","pf","pgsql","php","php-template","plaintext","pony","powershell","processing","profile","prolog","properties","protobuf","puppet","purebasic","python","python-repl","q","qml","r","reasonml","rib","roboconf","routeros","rsl","ruleslanguage","rust","sas","scala","scheme","scilab","scss","shell","smali","smalltalk","sml","sqf","sql_more","sql","stan","stata","step21","stylus","subunit","swift","taggerscript","yaml","tap","tcl","thrift","tp","twig","typescript","vala","vbnet","vbscript","vbscript-html","verilog","vhdl","vim","x86asm","xl","xquery","zephir"]},96086:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MentionInput=t.WHITE_SPACE_TEXT=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(81878),p=e(89195),v=e(70392),m=n.__importDefault(e(97599)),_=e(80732),s=e(44692);t.WHITE_SPACE_TEXT=" ";const g=({mentionItems:l=[],onSend:h,onStop:u,loading:d=!1,mentionKeyword:E=s.MENTION_KEYWORD,onSelectionChange:f,onImageUpload:a,labelService:b,workspaceService:y,placeholder:A="Ask anything, @ to mention",footerConfig:S={buttons:[],showModelSelector:!1}})=>{const w=o.useRef(null),[T,D]=o.useState({active:!1,startPos:null,filter:"",position:{top:0,left:0},activeIndex:0,level:0,parentType:null,secondLevelFilter:"",inlineSearchActive:!1,inlineSearchStartPos:null,loading:!1}),[I,O]=o.useState(S.defaultModel||""),[M,R]=o.useState({}),[P,k]=o.useState([]),[F,L]=o.useState(-1),[B,j]=o.useState(""),[W,U]=o.useState(!1),Q=()=>T.level===0?l:T.parentType?T.loading?M[T.parentType]||[]:M[T.parentType]||[]:[],$=((Ee,_e)=>{const[te,ge]=o.useState(Ee);return o.useEffect(()=>{const Te=setTimeout(()=>{ge(Ee)},_e);return()=>{clearTimeout(Te)}},[Ee,_e]),te})(T.secondLevelFilter,300);o.useEffect(()=>{if(T.level===1&&T.parentType&&$!==void 0){const Ee=l.find(te=>te.id===T.parentType);if(!Ee)return;D(te=>({...te,loading:!0})),(async()=>{try{const te=[];if(Ee.getHighestLevelItems){const ge=Ee.getHighestLevelItems();for(const Te of ge)te.some(Pe=>Pe.id===Te.id)||te.push(Te);R(Te=>({...Te,[T.parentType]:ge}))}if(Ee.getItems)try{const ge=await Ee.getItems($),Te=[...te];for(const Pe of ge)Te.some(Ae=>Ae.id===Pe.id)||Te.push(Pe);R(Pe=>({...Pe,[T.parentType]:Te}))}catch{D(Te=>({...Te,loading:!1}))}D(ge=>({...ge,loading:!1}))}catch{D(ge=>({...ge,loading:!1}))}})()}},[$,T.level,T.parentType]);const Y=Ee=>{const _e=window.getSelection();if(!_e||!_e.rangeCount)return 0;const te=_e.getRangeAt(0),ge=te.cloneRange();return ge.selectNodeContents(Ee),ge.setEnd(te.endContainer,te.endOffset),ge.toString().length},z=()=>{W&&(U(!1),L(-1));const Ee=window.getSelection();if(!Ee||!Ee.rangeCount||!w.current)return;const _e=w.current.textContent||"",te=Y(w.current);if(_e[te-1]===E&&!T.active&&!T.inlineSearchActive&&D({active:!0,startPos:te,filter:E,position:{top:0,left:0},activeIndex:0,level:0,parentType:null,secondLevelFilter:"",inlineSearchActive:!1,inlineSearchStartPos:null,loading:!1}),T.active&&T.level===0&&T.startPos!==null)if(te<T.startPos)D(ge=>({...ge,active:!1}));else{const ge=_e.substring(T.startPos-1,te);D(Te=>({...Te,filter:ge,activeIndex:0}))}if(T.inlineSearchActive&&T.inlineSearchStartPos!==null&&T.parentType){const ge=l.find(Ae=>Ae.id===T.parentType);if(!ge)return;const Te=`@${ge.type}:`,Pe=T.inlineSearchStartPos-Te.length;if(Pe>=0&&te>Pe+Te.length){const Ae=_e.substring(Pe+Te.length,te);Ae!==T.secondLevelFilter&&D(we=>({...we,secondLevelFilter:Ae,active:!0,activeIndex:0}))}else te<=Pe&&D(Ae=>({...Ae,inlineSearchActive:!1,active:!1}))}if(w.current&&(w.current.scrollHeight>120?w.current.style.overflowY="auto":w.current.style.overflowY="hidden"),w.current){const ge=w.current.innerHTML;(ge===""||ge==="<br>"||ge==="<br/>")&&(w.current.innerHTML="")}},H=Ee=>{if(Ee.key==="Escape"&&(T.active||T.inlineSearchActive)){T.level>0?D(te=>({...te,level:0,activeIndex:0,secondLevelFilter:"",inlineSearchActive:!1})):D(te=>({...te,active:!1,inlineSearchActive:!1})),Ee.preventDefault();return}if(Ee.key===s.MENTION_KEYWORD&&!T.active&&!T.inlineSearchActive&&w.current){const te=Y(w.current);D({active:!0,startPos:te+1,filter:E,position:{top:0,left:0},activeIndex:0,level:0,parentType:null,secondLevelFilter:"",inlineSearchActive:!1,inlineSearchStartPos:null,loading:!1})}if((Ee.key==="ArrowUp"||Ee.key==="ArrowDown")&&!Ee.shiftKey&&!Ee.ctrlKey&&!Ee.metaKey&&!Ee.altKey){if(!T.active&&!T.inlineSearchActive&&w.current&&P.length>0){const te=w.current.innerHTML;if(!te||te==="<br>"||W&&F>=0&&P[P.length-1-F]===te){Ee.preventDefault(),W||(j(te),U(!0));let Te=F;Ee.key==="ArrowUp"?Te=Math.min(P.length-1,F+1):Te=Math.max(-1,F-1),L(Te),Te===-1?w.current.innerHTML=B:w.current.innerHTML=P[P.length-1-Te];const Pe=document.createRange();Pe.selectNodeContents(w.current),Pe.collapse(!1);const Ae=window.getSelection();Ae&&(Ae.removeAllRanges(),Ae.addRange(Pe));return}}}else W&&Ee.key!=="ArrowUp"&&Ee.key!=="ArrowDown"&&(U(!1),L(-1));if(Ee.key==="Enter"){if(Ee.nativeEvent.isComposing)return;if(!Ee.shiftKey&&(Ee.preventDefault(),!T.active)){le();return}}if(!T.active)return;let _e=Q();if(T.level===0&&T.filter&&T.filter.length>1){const te=T.filter.substring(1).toLowerCase();_e=_e.filter(ge=>ge.text.toLowerCase().includes(te))}_e.length!==0&&(Ee.key==="ArrowDown"?(D(te=>({...te,activeIndex:(te.activeIndex+1)%_e.length})),Ee.preventDefault()):Ee.key==="ArrowUp"?(D(te=>({...te,activeIndex:(te.activeIndex-1+_e.length)%_e.length})),Ee.preventDefault()):(Ee.key==="Enter"||Ee.key==="Tab")&&_e.length>0&&(ie(_e[T.activeIndex]),Ee.preventDefault()))},K=()=>{},Z=async Ee=>{const _e=Ee.clipboardData.items,te=[];for(let fe=0;fe<_e.length;fe++)if(_e[fe].kind==="file"&&_e[fe].type.startsWith("image/")){const xe=_e[fe].getAsFile();xe&&te.push(xe)}if(Ee.preventDefault(),te.length>0&&a){await a(te);return}const Te=Ee.clipboardData.getData("text/plain").replace(/\t/g," ").replace(/\n\s*\n/g,`
|
|
31267
31267
|
|
|
31268
31268
|
`).replace(/[ \t]+$/gm,""),Pe=window.getSelection();if(!Pe||!Pe.rangeCount)return;const Ae=Pe.getRangeAt(0);Ae.deleteContents();const we=Te.split(`
|
|
31269
31269
|
`),be=document.createDocumentFragment();we.forEach((fe,xe)=>{const Re=fe.replace(/^[ ]+/g,me=>{const re=document.createElement("span");return re.innerHTML="\xA0".repeat(me.length),re.innerHTML}),Be=document.createElement("span");for(Be.innerHTML=Re;Be.firstChild;)be.appendChild(Be.firstChild);xe<we.length-1&&be.appendChild(document.createElement("br"))}),Ae.insertNode(be),Ae.setStartAfter(be),Ae.setEndAfter(be),Pe.removeAllRanges(),Pe.addRange(Ae),z()};o.useEffect(()=>{w.current&&A&&!w.current.textContent&&w.current.setAttribute("data-placeholder",A)},[A]);const X=Ee=>{var _e;T.active&&!(!((_e=document.querySelector(`.${m.default.mention_panel}`))===null||_e===void 0)&&_e.contains(Ee.target))&&D(te=>({...te,active:!1,inlineSearchActive:!1}))};o.useEffect(()=>(document.addEventListener("click",X,!0),()=>{document.removeEventListener("click",X,!0)}),[T.active]);const ie=(Ee,_e=!1)=>{var te;if(!w.current)return;if(Ee.getItems){const me=window.getSelection();if(!me||!me.rangeCount)return;if(T.level===0&&T.startPos!==null){let re,he,Oe;const Se=document.createTreeWalker(w.current,NodeFilter.SHOW_TEXT);let Fe=0,Ge;for(;Ge=Se.nextNode();){const Ke=((te=Ge.textContent)===null||te===void 0?void 0:te.length)||0;if(T.startPos-1>=Fe&&T.startPos-1<Fe+Ke){re=Ge,he=T.startPos-1-Fe;const ft=_e?T.startPos+T.filter.length-1:Y(w.current);Oe=Math.min(ft-Fe,Ke);break}Fe+=Ke}if(re){const Ke=document.createRange();Ke.setStart(re,he),Ke.setEnd(re,Oe),Ke.deleteContents();const ft=document.createTextNode(`${E}${Ee.type}:`);Ke.insertNode(ft);const ot=document.createRange();ot.setStartAfter(ft),ot.setEndAfter(ft),me.removeAllRanges(),me.addRange(ot),D(Mt=>({...Mt,active:!0,level:1,parentType:Ee.id,inlineSearchActive:!0,inlineSearchStartPos:Y(w.current),secondLevelFilter:"",activeIndex:0})),w.current.focus();return}}return}const ge=window.getSelection();if(!ge||!ge.rangeCount)return;if(T.inlineSearchActive&&T.parentType&&T.inlineSearchStartPos!==null){const me=l.find(Oe=>Oe.id===T.parentType);if(!me)return;const re=`${E}${me.type}:`,he=T.inlineSearchStartPos-re.length;if(he>=0){let lt=function(At){if(At.nodeType===3)Mt.push({node:At,start:ft,end:ft+At.textContent.length}),ft+=At.textContent.length;else if(At.nodeType===1){const rt=At.childNodes||[];for(const st of Array.from(rt))lt(st)}};const Oe=document.createElement("span");if(Oe.className=m.default.mention_tag,Oe.dataset.id=Ee.id,Oe.dataset.type=Ee.type,Oe.dataset.contextId=Ee.contextId||"",Oe.contentEditable="false",Ee.type==="file"||Ee.type==="folder"){const At=document.createElement("span");At.className=(0,r.default)(m.default.mention_icon,Ee.type==="file"?b?.getIcon(new v.URI(Ee.text)):(0,c.getIcon)("folder")),Oe.appendChild(At)}const Se=y?.workspace;let Fe=Ee.text;Se&&Ee.contextId&&(Fe=Ee.contextId.replace(new v.URI(Se.uri).codeUri.fsPath,"").slice(1));const Ge=document.createTextNode(Fe);Oe.appendChild(Ge);const Ke=document.createRange();let ft=0,ot=!1;const Mt=[];lt(w.current);for(const At of Mt){if(he>=At.start&&he<=At.end){const rt=he-At.start;Ke.setStart(At.node,rt),ot=!0}if(ot){const rt=_e?he+re.length+T.secondLevelFilter.length:Y(w.current);if(rt>=At.start&&rt<=At.end){const st=rt-At.start;Ke.setEnd(At.node,st);break}}}if(ot){Ke.deleteContents(),Ke.insertNode(Oe);const At=document.createRange();At.setStartAfter(Oe),At.setEndAfter(Oe),ge.removeAllRanges(),ge.addRange(At);const rt=document.createTextNode("\xA0");At.insertNode(rt),At.setStartAfter(rt),At.setEndAfter(rt),ge.removeAllRanges(),ge.addRange(At)}D(At=>({...At,active:!1,inlineSearchActive:!1})),w.current.focus();return}}const Te=document.createElement("span");if(Te.className=m.default.mention_tag,Te.dataset.id=Ee.id,Te.dataset.type=Ee.type,Te.dataset.contextId=Ee.contextId||"",Te.contentEditable="false",Ee.type==="file"||Ee.type==="folder"){const me=document.createElement("span");me.className=(0,r.default)(m.default.mention_icon,Ee.type==="file"?b?.getIcon(new v.URI(Ee.text)):(0,c.getIcon)("folder")),Te.appendChild(me)}const Pe=y?.workspace;let Ae=Ee.text;Pe&&Ee.contextId&&(Ae=Ee.contextId.replace(new v.URI(Pe.uri).codeUri.fsPath,"").slice(1));const we=document.createTextNode(Ae);Te.appendChild(we);let be=0,fe=!1;const xe=[];function Re(me){if(me.nodeType===3)xe.push({node:me,start:be,end:be+me.textContent.length}),be+=me.textContent.length;else if(me.nodeType===1){const re=me.childNodes;for(const he of Array.from(re))Re(he)}}Re(w.current);const Be=document.createRange();if(T.startPos!==null)for(const me of xe){if(T.startPos-1>=me.start&&T.startPos-1<=me.end){const re=T.startPos-1-me.start;Be.setStart(me.node,re),fe=!0}if(fe){const re=_e?T.startPos+T.filter.length-1:Y(w.current);if(re>=me.start&&re<=me.end){const he=re-me.start;Be.setEnd(me.node,he);break}}}if(fe){Be.deleteContents(),Be.insertNode(Te);const me=document.createRange();me.setStartAfter(Te),me.setEndAfter(Te),ge.removeAllRanges(),ge.addRange(me);const re=document.createTextNode("\xA0");me.insertNode(re),me.setStartAfter(re),me.setEndAfter(re),ge.removeAllRanges(),ge.addRange(me)}D(me=>({...me,active:!1})),w.current.focus()},oe=o.useCallback(Ee=>{O(Ee),f?.(Ee)},[I,f]),le=()=>{if(!w.current)return;const Ee=w.current.innerHTML;if(!Ee)return;const _e=document.createElement("div");_e.innerHTML=Ee,_e.querySelectorAll(`.${m.default.mention_tag}`).forEach(Te=>{var Pe;const Ae=Te.getAttribute("data-context-id");if(Ae){const we=document.createTextNode(`{{${E}${Te.getAttribute("data-type")}:${Ae}}}`);(Pe=Te.parentNode)===null||Pe===void 0||Pe.replaceChild(we,Te)}});let ge=_e.innerHTML;ge=ge.trim().replaceAll(t.WHITE_SPACE_TEXT," "),Ee&&(k(Te=>[...Te,Ee]),L(-1),U(!1)),h&&h(ge,{model:I,...S}),w.current.innerHTML="",w.current&&(w.current.style.overflowY="hidden",w.current.style.height="auto")},pe=o.useCallback(()=>{u&&u()},[u]),q=o.useCallback(Ee=>(S.buttons||[]).filter(_e=>_e.position===Ee).map(_e=>o.createElement(c.Popover,{key:_e.id,overlayClassName:m.default.popover_icon,id:`ai-chat-${_e.id}`,position:c.PopoverPosition.top,title:_e.title},o.createElement(p.EnhanceIcon,{className:(0,r.default)(_e.icon?(0,c.getIcon)(_e.icon):_e.iconClass,m.default[`${_e.id}_logo`]),tabIndex:0,role:"button",ariaLabel:_e.title,onClick:_e.onClick}))),[S.buttons]);return o.createElement("div",{className:m.default.input_container},T.active&&o.createElement("div",{className:m.default.mention_panel_container},o.createElement(_.MentionPanel,{items:Q(),activeIndex:T.activeIndex,onSelectItem:Ee=>ie(Ee,!0),position:{top:0,left:0},filter:T.level===0?T.filter:T.secondLevelFilter,visible:!0,level:T.level,loading:T.loading})),o.createElement("div",{className:m.default.editor_area},o.createElement("div",{ref:w,className:m.default.editor,contentEditable:!0,onInput:z,onKeyDown:H,onPaste:Z,onCompositionEnd:K})),o.createElement("div",{className:m.default.footer},o.createElement("div",{className:m.default.left_control},S.showModelSelector&&o.createElement(c.Select,{options:S.modelOptions||[],value:I,onChange:oe,className:m.default.model_selector,size:"small"}),q(s.FooterButtonPosition.LEFT)),o.createElement("div",{className:m.default.right_control},q(s.FooterButtonPosition.RIGHT),o.createElement(c.Popover,{overlayClassName:m.default.popover_icon,id:"ai-chat-send",position:c.PopoverPosition.top,content:d?"Stop":"Send"},d?o.createElement(p.EnhanceIcon,{wrapperClassName:m.default.stop_logo,className:(0,r.default)((0,c.getIcon)("stop"),m.default.stop_logo_icon),tabIndex:0,role:"button",ariaLabel:"Stop",onClick:pe}):o.createElement(p.EnhanceIcon,{wrapperClassName:m.default.send_logo,className:(0,r.default)((0,c.getIcon)("send-outlined"),m.default.send_logo_icon),tabIndex:0,role:"button",onClick:le,ariaLabel:"Send"})))))};t.MentionInput=g},40167:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MentionItem=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(81878),p=n.__importDefault(e(97599)),v=({item:m,isActive:_,onClick:s})=>o.createElement("div",{className:`${p.default.mention_item} ${_?p.default.active:""}`,onClick:()=>s(m)},o.createElement("div",{className:p.default.mention_item_left},o.createElement(c.Icon,{className:(0,r.default)(p.default.mention_item_icon,m.icon)}),o.createElement("span",{className:p.default.mention_item_text},m.text),o.createElement("span",{className:p.default.mention_item_description},m.description)),m.getItems&&o.createElement(c.Icon,{className:(0,r.default)(p.default.mention_item_right,(0,c.getIcon)("arrowright"))}));t.MentionItem=v},80732:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MentionPanel=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=n.__importDefault(e(97599)),c=e(40167),p=({items:v,activeIndex:m,onSelectItem:_,position:s,filter:g,visible:l,level:h,loading:u=!1})=>{const d=r.useRef(null);if(r.useEffect(()=>{if(l&&d.current){const a=d.current.querySelector(`.${o.default.mention_item}.${o.default.active}`);a&&a.scrollIntoView({block:"nearest"})}},[m,l]),!l)return null;const f=(()=>{let a=v;if(h===0){if(g&&g.length>1){const b=g.substring(1).toLowerCase();a=v.filter(y=>y.text.toLowerCase().includes(b))}}else g&&g.length>0&&(a=v.filter(b=>b.text.toLowerCase().includes(g.toLowerCase())));return a})();return h===0&&f.length===0?null:r.createElement("div",{ref:d,className:o.default.mention_panel,style:{top:s.top,left:s.left}},u&&r.createElement("div",{className:o.default.loading_bar}),v.length>0?r.createElement("ul",{className:o.default.mention_list},v.map((a,b)=>r.createElement(c.MentionItem,{key:a.id,item:a,isActive:b===m,onClick:()=>_(a,!0)}))):r.createElement("div",{className:o.default.no_results},u?"\u6B63\u5728\u641C\u7D22...":"\u65E0\u5339\u914D\u7ED3\u679C"))};t.MentionPanel=p},44692:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MENTION_KEYWORD=t.MentionType=t.FooterButtonPosition=void 0;var e;(function(r){r.LEFT="left",r.RIGHT="right"})(e||(t.FooterButtonPosition=e={}));var n;(function(r){r.FILE="file",r.FOLDER="folder",r.CODE="code"})(n||(t.MentionType=n={})),t.MENTION_KEYWORD="@"},78048:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractIcon=t.createMessageByAI=t.createMessageByUser=void 0;const n=e(41869),r="",o=m=>({...m,type:"text",className:`${m.position==="left"?"rce-ai-msg":"rce-user-msg"} ${m.className?m.className:""}`}),c=(m,_)=>o({...m,position:"right",title:r,className:_,role:1});t.createMessageByUser=c;const p=(m,_)=>o({...m,position:"left",title:"",className:_,role:2});t.createMessageByAI=p;const v=m=>{let{title:_}=m;const{message:s,tooltip:g}=m;let l=m.icon||"";if(!_)return{icon:l,title:s,message:s,tooltip:g};const h=_.match(/^\$\(([a-z.]+\/)?([a-z0-9-]+)(~[a-z]+)?\)/i);if(h){const[u,d,E,f]=h,a=d?d.slice(0,-1):n.CODICON_OWNER;l=(0,n.getExternalIcon)(E,a),f&&(l+=` ${f.slice(1)}`),_=_.slice(u.length)}return{icon:l,title:_,message:s,tooltip:g}};t.extractIcon=v},19957:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LlmContextContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(46044);let p=class{initialize(){this.llmContextService.startAutoCollection()}};t.LlmContextContribution=p,n.__decorate([(0,r.Autowired)(c.LLMContextServiceToken),n.__metadata("design:type",Object)],p.prototype,"llmContextService",void 0),t.LlmContextContribution=p=n.__decorate([(0,o.Domain)(o.ClientAppContribution)],p)},63536:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LLMContextServiceImpl=void 0;const n=e(85608),r=e(76003),o=e(11050),c=e(25234),p=e(19083),v=e(86560),m=e(96689),_=e(82196),s=e(14951),g=e(6287),l=e(20868);let h=class extends c.WithEventBus{constructor(){super(...arguments),this.isAutoCollecting=!1,this.contextVersion=0,this.maxAttachFilesLimit=10,this.maxAttachFoldersLimit=10,this.maxViewFilesLimit=20,this.attachedFiles=[],this.attachedFolders=[],this.recentlyViewFiles=[],this.onDidContextFilesChangeEmitter=new v.Emitter,this.onDidContextFilesChangeEvent=this.onDidContextFilesChangeEmitter.event}addFileToList(d,E,f){const a=E.findIndex(b=>b.uri.toString()===d.uri.toString());a>-1&&E.splice(a,1),E.push(d),E.length>f&&E.shift()}addFolderToList(d,E,f){const a=E.findIndex(b=>b.uri.toString()===d.uri.toString());a>-1&&E.splice(a,1),E.push(d),E.length>f&&E.shift()}addFileToContext(d,E,f=!1){if(!d)return;const a={uri:d,selection:E},b=f?this.attachedFiles:this.recentlyViewFiles,y=f?this.maxAttachFilesLimit:this.maxViewFilesLimit;f&&this.docModelManager.createModelReference(d),this.addFileToList(a,b,y),this.notifyContextChange()}addFolderToContext(d){if(!d)return;const E={uri:d};this.addFolderToList(E,this.attachedFolders,this.maxAttachFoldersLimit),this.notifyContextChange()}notifyContextChange(){this.onDidContextFilesChangeEmitter.fire(this.getAllContextFiles())}cleanFileContext(){this.attachedFiles=[],this.attachedFolders=[],this.notifyContextChange()}getAllContextFiles(){return{viewed:this.recentlyViewFiles,attached:this.attachedFiles,attachedFolders:this.attachedFolders,version:this.contextVersion++}}removeFileFromContext(d,E=!1){const f=E?this.attachedFiles:this.recentlyViewFiles,a=f.findIndex(b=>b.uri.toString()===d.toString());a>-1&&f.splice(a,1),this.notifyContextChange()}startAutoCollection(){this.isAutoCollecting||(this.isAutoCollecting=!0,this.startAutoCollectionInternal())}startAutoCollectionInternal(){this.disposables.push(this.eventBus.on(m.EditorDocumentModelCreationEvent,d=>{d.payload.uri.scheme==="file"&&this.addFileToContext(d.payload.uri,void 0,!1)})),this.disposables.push(this.eventBus.on(m.EditorDocumentModelRemovalEvent,d=>{d.payload.scheme==="file"&&this.removeFileFromContext(d.payload,!1)})),this.disposables.push(this.eventBus.on(m.EditorDocumentModelSavedEvent,d=>{d.payload.scheme})),this.disposables.push(this.eventBus.on(_.EditorSelectionChangeEvent,d=>{if(d.payload.selections.length>0){const E=[d.payload.selections[0].selectionStartLineNumber,d.payload.selections[0].positionLineNumber].sort();E[0]===E[1]?this.addFileToContext(d.payload.editorUri,void 0,!1):this.addFileToContext(d.payload.editorUri,E.sort((f,a)=>f-a),!1)}}))}stopAutoCollection(){this.dispose()}async serialize(){const d=this.getAllContextFiles(),E=v.URI.file(this.appConfig.workspaceDir);return{recentlyViewFiles:this.serializeRecentlyViewFiles(d.viewed,E),attachedFiles:this.serializeAttachedFiles(d.attached,E),attachedFolders:await this.serializeAttachedFolders(d.attachedFolders,E)}}async serializeAttachedFolders(d,E){const f=Array.from(new Set(d.map(a=>a.uri.toString())));return Promise.all(f.map(async a=>{var b;const y=new v.URI(a);return`\`\`\`
|
|
@@ -31468,7 +31468,7 @@ ${m.content}
|
|
|
31468
31468
|
\`\`\`
|
|
31469
31469
|
</current_opened_file>`:""}};t.DefaultChatAgentPromptProvider=p,n.__decorate([(0,r.Autowired)(o.WorkbenchEditorService),n.__metadata("design:type",o.WorkbenchEditorService)],p.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(c.IWorkspaceService),n.__metadata("design:type",Object)],p.prototype,"workspaceService",void 0),t.DefaultChatAgentPromptProvider=p=n.__decorate([(0,r.Injectable)()],p)},69820:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EPartialEdit=t.MCP_SERVER_TYPE=t.NearestCodeBlockType=void 0;var e;(function(o){o.Block="block",o.Line="line"})(e||(t.NearestCodeBlockType=e={}));var n;(function(o){o.STDIO="stdio",o.SSE="sse",o.BUILTIN="builtin"})(n||(t.MCP_SERVER_TYPE=n={}));var r;(function(o){o.accept="accept",o.discard="discard"})(r||(t.EPartialEdit=r={}))},98864:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cleanAttachedTextWrapper=t.getToolName=t.extractCodeBlocks=t.isDocumentValid=t.isDocumentTooShort=t.isDocumentTooLarge=void 0;const n=e(19413),r="```",o=10,c=g=>{try{g.getText()}catch(l){if(l instanceof RangeError)return!0}return!1};t.isDocumentTooLarge=c;const p=g=>g.getText().length<o;t.isDocumentTooShort=p;const v=g=>!((0,t.isDocumentTooLarge)(g)||(0,t.isDocumentTooShort)(g));t.isDocumentValid=v;const m=g=>{const l=g.split(`
|
|
31470
31470
|
`);let h=[],u=!1,d=0;return l.forEach((E,f)=>{if(!u&&E.trim().startsWith(r))u=!0,d=f+1;else if(u&&E.trim().startsWith(r)){u=!1;const a=f;h=l.slice(d,a)}u&&d!==f+1&&h.push(E)}),h.join(`
|
|
31471
|
-
`)};t.extractCodeBlocks=m;const _=(g,l=n.BUILTIN_MCP_SERVER_NAME)=>`mcp_${l}_${g}`;t.getToolName=_;const s=g=>{const l=/`<attached_file>(.*)`/g,h=/`<attached_folder>(.*)`/g;return g=g.replace(l,"$1"),g=g.replace(h,"$1"),g};t.cleanAttachedTextWrapper=s},26471:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(19413),t)},15504:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentReactions=t.CommentReactionSwitcher=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(41869),c=e(81878),p=e(25918),v=e(93899),m=e(52416),_=e(69635),s=n.__importDefault(e(38877)),g=({thread:h,comment:u,className:d})=>{const E=`${h.providerId}_${h.id}_${u.id}`,f=`${v.MenuId.CommentReactionSwitcherMenu}_${E}`,a=(0,o.useInjectable)(v.IMenuRegistry),b=(0,o.useInjectable)(v.AbstractMenuService);r.default.useEffect(()=>{const A=new o.Disposable,S=`${v.MenuId.CommentReactionSwitcherSubmenu}_${E}`;return A.addDispose(a.registerMenuItem(f,{submenu:S,label:S,iconClass:(0,o.getExternalIcon)("reactions"),group:"navigation"})),A.addDispose(a.registerMenuItems(S,u.reactions.map(w=>({command:{id:_.SwitchCommandReaction,label:w.label},extraTailArgs:[{thread:h,comment:u,reaction:w}]})))),()=>A.dispose()},[]);const y=r.default.useMemo(()=>b.createMenu(f),[]);return r.default.createElement(p.InlineActionBar,{className:d,menus:y,regroup:A=>[A,[]],type:"icon"})};t.CommentReactionSwitcher=g;const l=({thread:h,comment:u})=>{var d;const E=(0,o.useInjectable)(o.IEventBus),f=(0,o.useInjectable)(m.IIconService),a=r.default.useCallback(b=>{E.fire(new _.CommentReactionClick({thread:h,comment:u,reaction:b}))},[]);return r.default.createElement("div",{className:s.default.comment_reactions},(d=u.reactions)===null||d===void 0?void 0:d.filter(b=>b.count!==0).map(b=>r.default.createElement(c.Button,{key:b.label,onClick:()=>a(b),type:"secondary",size:"small",title:b.label,className:s.default.comment_reaction,iconClass:f.fromIcon("",b.iconPath.toString(),m.IconType.Background)},"\xA0",b.count)))};t.CommentReactions=l},54143:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsBody=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=n.__importDefault(e(43144)),c=e(84605),p=n.__importDefault(e(38877)),v=e(70154),m=({root:_,children:s})=>o.default.createPortal(s,_);t.CommentsBody=r.default.memo(({body:_})=>{const s=r.default.useRef(null),[g,l]=r.default.useState(null),h=r.default.useMemo(()=>{const u=(0,c.createMarkedRenderer)();return u.link=(d,E,f)=>`<a target="_blank" rel="noopener" href="${d}" title="${E}">${f}</a>`,u},[]);return r.default.useEffect(()=>{if(s.current){const u=s.current.attachShadow({mode:"open"});g||l(u)}},[]),r.default.createElement("div",{ref:s,className:p.default.comment_shadow_box},g&&r.default.createElement(m,{root:g},r.default.createElement("style",null,v.markdownCss),r.default.createElement("div",{dangerouslySetInnerHTML:{__html:(0,c.toMarkdownHtml)(typeof _=="string"?_:_.value,{gfm:!0,breaks:!1,pedantic:!1,smartLists:!0,smartypants:!1,renderer:h})}})))})},66480:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsFeatureRegistry=void 0;const n=e(85608),r=e(76003);let o=class{constructor(){this.config={},this.options={},this.panelTreeNodeHandlers=[],this.mentionsOptions={},this.providerFeature=new Map}registerConfig(p){this.config={...this.config,...p}}registerPanelTreeNodeHandler(p){this.panelTreeNodeHandlers.push(p)}registerPanelOptions(p){this.options={...this.options,...p}}registerFileUploadHandler(p){this.fileUploadHandler=p}registerMentionsOptions(p){this.mentionsOptions=p}registerZoneWidgetRender(p){this.zoneWidgetRender=p}getConfig(){return this.config}getCommentsPanelOptions(){return this.options}getCommentsPanelTreeNodeHandlers(){return this.panelTreeNodeHandlers}getFileUploadHandler(){return this.fileUploadHandler}getMentionsOptions(){return this.mentionsOptions}getZoneWidgetRender(){return this.zoneWidgetRender}registerProviderFeature(p,v){this.providerFeature.set(p,v)}getProviderFeature(p){return this.providerFeature.get(p)}};t.CommentsFeatureRegistry=o,t.CommentsFeatureRegistry=o=n.__decorate([(0,r.Injectable)()],o)},37357:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentItem=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(97267),c=e(41869),p=e(25918),v=e(93899),m=e(69635),_=e(15504),s=e(54143),g=e(42018),l=n.__importDefault(e(38877)),h=({timestamp:f})=>{const a=r.default.useMemo(()=>{const b=new Date(f);return(0,c.toLocalString)(b)},[f]);return r.default.createElement("span",{className:l.default.comment_item_timestamp},a)},u=(f,a)=>{const b=(0,c.useInjectable)(v.AbstractMenuService),{body:y,contextValue:A}=a,[S,w]=r.default.useState(""),T=(0,c.useInjectable)(m.ICommentsFeatureRegistry),D=r.default.useMemo(()=>T.getFileUploadHandler(),[]);r.default.useEffect(()=>{w(y)},[y]);const I=r.default.useMemo(()=>f.createScoped(),[]),O=r.default.useMemo(()=>I.createKey("commentIsEmpty",!a.body),[]),M=r.default.useMemo(()=>b.createMenu(v.MenuId.CommentsCommentContext,I),[]),R=r.default.useMemo(()=>b.createMenu(v.MenuId.CommentsCommentTitle,I),[]),P=r.default.useRef(I.createKey("comment",A));r.default.useEffect(()=>{P.current.set(A)},[A]);const k=r.default.useCallback(L=>{O.set(!L.target.value),w(L.target.value)},[]),F=r.default.useCallback(async L=>{if(D){const B=await D(S,L);w(j=>{const W=j+B;return O.set(!W),W})}},[S]);return[S,w,k,M,R,F]},d=({reply:f,thread:a})=>{var b;const{contextKeyService:y}=a,{author:A,label:S,body:w,mode:T,timestamp:D}=f,I=(b=A.iconPath)===null||b===void 0?void 0:b.toString(),[O,M,R,P,k,F]=u(y,f),L=r.default.useMemo(()=>{const B=(0,c.toMarkdownHtml)(typeof w=="string"?w:w.value);return/^\<p\>[^<>]+\<\/p\>\n$/.test(B)},[w]);return r.default.createElement("div",{className:l.default.reply_item},(0,c.isUndefined)(T)||T===m.CommentMode.Preview?r.default.createElement("div",null,L?r.default.createElement(r.default.Fragment,null,I&&r.default.createElement("img",{className:l.default.reply_item_icon,src:I,alt:A.name}),r.default.createElement("span",{className:l.default.comment_item_author_name},A.name),D&&r.default.createElement(h,{timestamp:D}),typeof S=="string"?r.default.createElement("span",{className:l.default.comment_item_label},S):S," : ",r.default.createElement("span",{className:l.default.comment_item_body},typeof w=="string"?w:w.value),f.reactions&&f.reactions.length>0&&r.default.createElement(_.CommentReactionSwitcher,{className:l.default.reply_item_title,thread:a,comment:f}),r.default.createElement(p.InlineActionBar,{separator:"inline",className:l.default.reply_item_title,menus:k,context:[{thread:a,comment:f,menuId:v.MenuId.CommentsCommentTitle}],type:"icon"})):r.default.createElement(r.default.Fragment,null,r.default.createElement("div",{className:l.default.comment_item_markdown_header},r.default.createElement("div",null,I&&r.default.createElement("img",{className:l.default.reply_item_icon,src:I,alt:A.name}),r.default.createElement("span",{className:l.default.comment_item_author_name},A.name),D&&r.default.createElement(h,{timestamp:D}),typeof S=="string"?r.default.createElement("span",{className:l.default.comment_item_label},S):S," : "),r.default.createElement(p.InlineActionBar,{separator:"inline",className:l.default.reply_item_title,menus:k,context:[{thread:a,comment:f,menuId:v.MenuId.CommentsCommentTitle}],type:"icon"})),r.default.createElement(s.CommentsBody,{body:w}))):r.default.createElement("div",null,r.default.createElement(g.CommentsTextArea,{value:typeof O=="string"?O:O.value,autoFocus:!0,onChange:R,dragFiles:F}),r.default.createElement(p.InlineActionBar,{className:l.default.comment_item_reply,menus:P,context:[{thread:a,comment:f,body:O,menuId:v.MenuId.CommentsCommentContext}],type:"button",separator:"inline",afterClick:()=>{M(w)}})),f.reactions&&f.reactions.length>0&&r.default.createElement(_.CommentReactions,{thread:a,comment:f}))},E=({thread:f,commentThreadContext:a,widget:b})=>{var y,A;const[S,w]=r.default.useState(!1),[T,D]=r.default.useState(""),{contextKeyService:I}=f,O=(0,c.useAutorun)(f.readOnly),[M,...R]=(0,c.useAutorun)(f.comments),{author:P,label:k,body:F,mode:L,timestamp:B}=M,j=(0,c.isString)(P.iconPath)?P.iconPath:!((y=P.iconPath)===null||y===void 0)&&y.authority?(A=P.iconPath)===null||A===void 0?void 0:A.toString():"",[W,U,Q,V,$,Y]=u(I,M),z=(0,c.useInjectable)(m.ICommentsFeatureRegistry),H=r.default.useMemo(()=>z.getFileUploadHandler(),[]),K=r.default.useMemo(()=>I.createKey("commentIsEmpty",!0),[]);function Z(ie){K.set(!ie.target.value),D(ie.target.value)}const X=r.default.useCallback(async ie=>{if(H){const oe=await H(W,ie);D(le=>{const pe=le+oe;return K.set(!pe),pe})}},[T]);return r.default.createElement("div",{className:l.default.comment_item},j&&r.default.createElement("img",{className:l.default.comment_item_icon,src:j,alt:P.name}),r.default.createElement("div",{className:l.default.comment_item_content},r.default.createElement("div",{className:l.default.comment_item_head},r.default.createElement("div",{className:l.default.comment_item_name},r.default.createElement("span",{className:l.default.comment_item_author_name},P.name),B&&r.default.createElement(h,{timestamp:B}),typeof k=="string"?r.default.createElement("span",{className:l.default.comment_item_label},k):k),r.default.createElement("div",{className:l.default.comment_item_actions},M.reactions&&M.reactions.length>0&&r.default.createElement(_.CommentReactionSwitcher,{thread:f,comment:M}),!O&&r.default.createElement(o.Button,{className:l.default.comment_item_reply_button,size:"small",type:"secondary",onClick:()=>w(!0)},(0,c.localize)("comments.thread.action.reply")),r.default.createElement(p.InlineActionBar,{menus:$,context:[{thread:f,comment:M,menuId:v.MenuId.CommentsCommentTitle}],type:"button"}))),(0,c.isUndefined)(L)||L===m.CommentMode.Preview?r.default.createElement(s.CommentsBody,{body:F}):r.default.createElement("div",null,r.default.createElement(g.CommentsTextArea,{value:typeof W=="string"?W:W.value,autoFocus:!0,onChange:Q,dragFiles:Y}),r.default.createElement(p.InlineActionBar,{className:l.default.comment_item_context,menus:V,context:[{thread:f,comment:M,body:W,menuId:v.MenuId.CommentsCommentContext}],separator:"inline",type:"button",afterClick:()=>{U(F)}})),M.reactions&&M.reactions.length>0&&r.default.createElement(_.CommentReactions,{thread:f,comment:M}),(R.length>0||S)&&r.default.createElement("div",{className:l.default.comment_item_reply_wrap},R.map(ie=>r.default.createElement(d,{key:ie.id,thread:f,reply:ie})),S&&r.default.createElement("div",null,r.default.createElement(g.CommentsTextArea,{autoFocus:!0,value:T,onChange:Z,placeholder:`${(0,c.localize)("comments.reply.placeholder")}...`,dragFiles:X}),r.default.createElement(p.InlineActionBar,{className:l.default.comment_item_reply,menus:a,context:[{thread:f,text:T,widget:b,menuId:v.MenuId.CommentsCommentThreadContext}],separator:"inline",type:"button",afterClick:()=>{D(""),w(!1)}})))))};t.CommentItem=E},53878:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsPanel=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),c=e(41869),p=e(69635),v=n.__importDefault(e(38877)),m=e(5167),_=e(47842),s=({viewState:g})=>{const l=(0,c.useInjectable)(_.CommentModelService),[h,u]=(0,r.useState)(),d=(0,r.useRef)(null),E=(0,c.useInjectable)(p.ICommentsFeatureRegistry),{handleTreeBlur:f}=l;(0,r.useEffect)(()=>{u(l.treeModel);const T=l.onDidUpdateTreeModel(D=>{u(D)});return()=>{T.dispose()}},[]);const a=(0,r.useCallback)(T=>{l.handleTreeHandler(T)},[l]),b=(0,r.useCallback)(T=>r.default.createElement(m.CommentNodeRendered,{item:T.item,itemType:T.itemType,decorations:l.decorations.getDecorations(T.item),defaultLeftPadding:8,onTwistierClick:l.handleTwistierClick,onClick:l.handleItemClick,leftPadding:8}),[h]),y=(0,r.useMemo)(()=>E.getCommentsPanelOptions(),[]),A=(0,r.useMemo)(()=>y.header,[y]),S=(0,r.useMemo)(()=>r.default.createElement("div",{className:v.default.panel_placeholder},y.defaultPlaceholder||(0,c.localize)("comments.panel.placeholder")),[y]),w=(0,r.useCallback)(()=>h?r.default.createElement(o.RecycleTree,{height:g.height-(A?.height||0),itemHeight:m.COMMENT_TREE_NODE_HEIGHT,onReady:a,model:h,placeholder:()=>S},b):S,[h,A,g.height]);return r.default.createElement("div",{className:v.default.comment_panel,tabIndex:-1,onBlur:f,ref:d},A?.component,w())};t.CommentsPanel=s},42018:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsTextArea=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(34801),c=e(97267),p=e(41869),v=e(69635),m=e(54143),_=n.__importDefault(e(38877)),s=e(73136),g="@",l="@[__display__](__id__)",h=(u,d)=>`@${d}`;t.CommentsTextArea=r.default.forwardRef((u,d)=>{const{focusDelay:E=0,autoFocus:f=!1,placeholder:a="",onFocus:b,onBlur:y,onChange:A,maxRows:S=10,minRows:w=2,value:T,initialHeight:D,dragFiles:I}=u,[O,M]=r.default.useState(0),R=(0,p.useInjectable)(v.ICommentsFeatureRegistry),P=r.default.useRef(null),k=r.default.useRef(null),F=r.default.useRef(null);r.default.useImperativeHandle(d,()=>P.current);const L=r.default.useCallback(async $=>{var Y;$.stopPropagation(),$.preventDefault();const z=(Y=$.clipboardData)===null||Y===void 0?void 0:Y.files;z&&I&&await I(z),P.current&&(P.current.focus(),W(P.current.value))},[I]),B=r.default.useCallback(async $=>{var Y;$.stopPropagation(),$.preventDefault();const z=(Y=$.dataTransfer)===null||Y===void 0?void 0:Y.files;z&&I&&await I(z),P.current&&(P.current.focus(),W(P.current.value))},[I]),j=r.default.useCallback($=>{$.stopPropagation(),$.preventDefault(),$.dataTransfer.dropEffect="copy"},[]),W=r.default.useCallback($=>{const Y=P.current;if(Y){const z=$.toString().length;Y.setSelectionRange(z,z)}},[]);r.default.useEffect(()=>{var $;const Y=P.current;if(!Y)return;D&&Y.style&&(Y.style.height=D),E&&setTimeout(()=>{Y.focus({preventScroll:!0})},E),W(T);function z(H){var K,Z,X;const ie=H.target;ie&&(ie.nodeName.toUpperCase()==="TEXTAREA"&&ie.scrollHeight>ie.clientHeight||ie.nodeName.toUpperCase()==="UL"||((K=ie.parentElement)===null||K===void 0?void 0:K.nodeName.toUpperCase())==="UL"||((X=(Z=ie.parentElement)===null||Z===void 0?void 0:Z.parentElement)===null||X===void 0?void 0:X.nodeName.toUpperCase())==="UL")&&H.stopPropagation()}return($=k.current)===null||$===void 0||$.addEventListener("mousewheel",z,!0),()=>{var H;(H=k.current)===null||H===void 0||H.removeEventListener("mousewheel",z,!0)}},[]),r.default.useEffect(()=>{O===0&&(setTimeout(()=>{var $;($=P.current)===null||$===void 0||$.focus({preventScroll:!0})},E),W(T))},[O]);const U=r.default.useMemo(()=>(0,s.getMentionBoxStyle)({minRows:w,maxRows:S}),[w,S]),Q=r.default.useMemo(()=>R.getMentionsOptions(),[R]),V=r.default.useCallback(async($,Y)=>{if(Q.providerData){const z=await Q.providerData($);Y(z)}else Y([])},[Q]);return r.default.createElement("div",{className:_.default.textarea_container},r.default.createElement(c.Tabs,{mini:!0,value:O,onChange:$=>M($),tabs:[(0,p.localize)("comments.thread.textarea.write"),(0,p.localize)("comments.thread.textarea.preview")]}),r.default.createElement("div",null,O===0?r.default.createElement("div",{ref:k},r.default.createElement(o.MentionsInput,{autoFocus:f,onPaste:L,inputRef:P,onDragOver:j,onDrop:B,ref:F,value:T,placeholder:a,onChange:A,onFocus:b,onBlur:y,style:U},r.default.createElement(o.Mention,{markup:Q.markup||l,renderSuggestion:Q.renderSuggestion,trigger:g,data:V,displayTransform:Q.displayTransform||h}))):r.default.createElement("div",{className:_.default.textarea_preview},r.default.createElement(m.CommentsBody,{body:T}))))})},49867:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsThread=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(91830),p=e(54414),v=e(28423),m=e(69635),_=e(90366);let s=class extends o.Disposable{set contextValue(l){this._contextKeyService.createKey("thread",l)}get contextValue(){return this._contextKeyService.getContextKeyValue("thread")}get onDidChangeCollapsibleState(){return this.onDidChangeCollapsibleStateEmitter.event}get onDidChange(){return this.onDidChangeEmitter.event}constructor(l,h,u,d){super(),this.uri=l,this.range=h,this.providerId=u,this.options=d,this.comments=(0,v.observableValue)(this,[]),this.label=(0,v.observableValue)(this,void 0),this.readOnly=(0,v.observableValue)(this,!1),this.isCollapsed=(0,v.observableValue)(this,!1),this.onDidChangeCollapsibleStateEmitter=new o.Emitter,this.widgets=new Map,this._id=`thread_${(0,o.uuid)()}`,this.onDidChangeEmitter=new o.Emitter,this.threadHeaderTitle=(0,v.derived)(this,A=>{const S=this.label.read(A);if(S)return S;const w=this.comments.read(A);if(w.length){const T=new Set(w.map(D=>`@${D.author.name}`));return`${(0,o.localize)("comments.participants")}: `+[...T].join(" ")}else return(0,o.localize)("comments.zone.title")}),this.toggle=A=>{if(this.comments.get().length>0){const w=this.widgets.get(A);w&&w.toggle()}else this.dispose()},this.updateComments(d.comments?d.comments.map(A=>({...A,id:(0,o.uuid)()})):[]),this.data=this.options.data,this._contextKeyService=this.registerDispose(this.globalContextKeyService.createScoped()),new c.ResourceContextKey(this._contextKeyService).set(l),this._contextKeyService.createKey("thread",d.contextValue),(0,v.transaction)(A=>{this.setReadOnly(!!d.readOnly),this.label.set(d.label,A),this.isCollapsed.set(!!this.options.isCollapsed,A)});const f=this._contextKeyService.createKey("threadsLength",this.commentsService.getThreadsByUri(l).length),a=this.comments.get(),b=this._contextKeyService.createKey("commentsLength",a.length),y=this._contextKeyService.createKey("commentThreadIsEmpty",!a.length);this._contextKeyService.createKey("commentController",u),this.addDispose((0,v.autorun)(A=>{const S=this.comments.read(A).length;b.set(S),y.set(!S)})),this.addDispose((0,v.autorun)(A=>{this.isCollapsed.read(A)?this.hideAll():this.showAll()})),this.addDispose(this.commentsService.onThreadsChanged(A=>{A.uri.isEqual(l)&&f.set(this.commentsService.getThreadsByUri(l).length)})),this.addDispose({dispose:()=>{this.updateComments([])}}),this.onDidChangeEmitter.fire()}updateComments(l){(0,v.transaction)(h=>{this.comments.set(l,h)})}getWidgetByEditor(l){return this.widgets.get(l)}get id(){return this._id}get contextKeyService(){return this._contextKeyService}setReadOnly(l){(0,v.transaction)(h=>{this.readOnly.set(l,h),this._contextKeyService.createKey("readOnly",l)})}getEditorsByUri(l){return this.editorCollectionService.listEditors().filter(h=>{var u;return(u=h.currentUri)===null||u===void 0?void 0:u.isEqual(l)})}addWidgetByEditor(l){const h=this.injector.get(_.CommentsZoneWidget,[l,this,{arrowColor:"var(--peekView-border)"}]);return this.addDispose(h.onChangeZoneWidget(()=>{const u=this.commentsService.commentsThreads.filter(f=>this.isEqual(f)),d=u.findIndex(f=>f===this),E=u.slice(d+1);for(const f of E)if(f.isShowWidget(l)){const a=f.getWidgetByEditor(l);a?.resize()}})),this.addDispose(h),this.widgets.set(l,h),l.onDispose(()=>{h.dispose(),this.widgets.delete(l)}),h}show(l){if(l){let h=this.widgets.get(l);h||(h=this.addWidgetByEditor(l)),h.show()}else this.getEditorsByUri(this.uri).forEach(u=>{var d;let E=this.widgets.get(u);E||(E=this.addWidgetByEditor(u)),!((d=u.currentUri)===null||d===void 0)&&d.isEqual(this.uri)&&E.show()})}showWidgetsIfShowed(){var l;for(const h of this.getEditorsByUri(this.uri)){let u=this.widgets.get(h);u||(u=this.addWidgetByEditor(h)),!((l=h.currentUri)===null||l===void 0)&&l.isEqual(this.uri)&&setTimeout(()=>{u?.show()},0)}}hideWidgetsByDispose(){var l;for(const[h,u]of this.widgets)!(!((l=h.currentUri)===null||l===void 0)&&l.isEqual(this.uri))&&u.dispose()}isShowWidget(l){if(l){const h=this.widgets.get(l);return h?h.isShow:!1}else{for(const[,h]of this.widgets)return h.isShow;return!1}}hide(l){if(l){const h=this.widgets.get(l);h?.hide()}else this.hideAll()}showAll(){(0,v.transaction)(l=>{this.isCollapsed.set(!1,l)});for(const[,l]of this.widgets)l.show();this.onDidChangeCollapsibleStateEmitter.fire(m.CommentThreadCollapsibleState.Expanded)}hideAll(l){var h;(0,v.transaction)(u=>{this.isCollapsed.set(!0,u)});for(const[u,d]of this.widgets)l?!(!((h=u.currentUri)===null||h===void 0)&&h.isEqual(this.uri))&&d.dispose():d.hide();this.onDidChangeCollapsibleStateEmitter.fire(m.CommentThreadCollapsibleState.Collapsed)}addComment(...l){const h=this.comments.get();(0,v.transaction)(u=>{this.comments.set([...h,...l.map(d=>({...d,id:(0,o.uuid)()}))],u)}),this.onDidChangeEmitter.fire()}removeComment(l){(0,v.transaction)(h=>{this.comments.set(this.comments.get().filter(u=>u!==l),h)}),this.onDidChangeEmitter.fire()}isEqual(l){return l.uri.isEqual(this.uri)&&l.range.startLineNumber===this.range.startLineNumber&&l.range.endLineNumber===this.range.endLineNumber}};t.CommentsThread=s,n.__decorate([(0,r.Autowired)(m.ICommentsService),n.__metadata("design:type",Object)],s.prototype,"commentsService",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],s.prototype,"globalContextKeyService",void 0),n.__decorate([(0,r.Autowired)(p.EditorCollectionService),n.__metadata("design:type",p.EditorCollectionService)],s.prototype,"editorCollectionService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],s.prototype,"injector",void 0),t.CommentsThread=s=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[o.URI,Object,String,Object])],s)},73804:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsZoneService=void 0;const n=e(85608),r=e(76003),o=e(93899),c=e(43718),p=e(69635),v=e(49867);let m=class extends c.Disposable{constructor(s){super(),this.thread=s}setCurrentCommentThread(s){this.commentService.setCurrentCommentThread(s)}get commentThreadTitle(){return this.registerDispose(this.menuService.createMenu(o.MenuId.CommentsCommentThreadTitle,this.thread.contextKeyService))}get commentThreadContext(){return this.registerDispose(this.menuService.createMenu(o.MenuId.CommentsCommentThreadContext,this.thread.contextKeyService))}};t.CommentsZoneService=m,n.__decorate([(0,r.Autowired)(o.AbstractMenuService),n.__metadata("design:type",o.AbstractMenuService)],m.prototype,"menuService",void 0),n.__decorate([(0,r.Autowired)(p.ICommentsService),n.__metadata("design:type",Object)],m.prototype,"commentService",void 0),n.__decorate([c.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],m.prototype,"commentThreadTitle",null),n.__decorate([c.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],m.prototype,"commentThreadContext",null),t.CommentsZoneService=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[v.CommentsThread])],m)},90366:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsZoneWidget=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),c=n.__importDefault(e(25873)),p=e(76003),v=e(41869),m=e(25918),_=e(93899),s=e(20303),g=e(69635),l=e(37357),h=e(42018),u=e(73804),d=n.__importDefault(e(38877)),E=({thread:a,widget:b})=>{const{contextKeyService:y}=a,A=(0,v.useAutorun)(a.comments),S=(0,v.useAutorun)(a.threadHeaderTitle),T=(0,v.useInjectable)(p.INJECTOR_TOKEN).get(u.CommentsZoneService,[a]),D=(0,v.useInjectable)(g.ICommentsFeatureRegistry),I=o.default.useMemo(()=>D.getFileUploadHandler(),[]),[O,M]=o.default.useState(""),R=o.default.useMemo(()=>y.createKey("commentIsEmpty",!O),[]),P=T.commentThreadTitle,k=T.commentThreadContext,F=o.default.useCallback(V=>{const{value:$}=V.target;M($),R.set(!$)},[]),L=o.default.useMemo(()=>{var V;return((V=D.getProviderFeature(a.providerId))===null||V===void 0?void 0:V.placeholder)||`${(0,v.localize)("comments.reply.placeholder")}...`},[]),B=o.default.useCallback(async V=>{if(I){const $=await I(O,V);M(Y=>{const z=Y+$;return R.set(!z),z})}},[O]);o.default.useEffect(()=>{const V=b.onFirstDisplay(()=>{setTimeout(()=>{b.coreEditor.monacoEditor.revealLine(a.range.endLineNumber+1)},0)});return()=>{V.dispose()}},[]);const j=o.default.useCallback(()=>{T.setCurrentCommentThread(T.thread)},[]),W=o.default.useCallback(()=>{T.setCurrentCommentThread(void 0)},[]),U=o.default.useCallback(()=>{T.setCurrentCommentThread(T.thread)},[]),Q=o.default.useCallback(()=>{T.setCurrentCommentThread(void 0)},[]);return o.default.createElement("div",{tabIndex:-1,onMouseOver:j,onMouseOut:W,onFocus:U,onBlur:Q,className:(0,r.default)(a.options.threadClassName,d.default.comment_container)},o.default.createElement("div",{className:(0,r.default)(a.options.threadHeadClassName,d.default.head)},o.default.createElement("div",{className:d.default.review_title},S),o.default.createElement(m.InlineActionBar,{menus:P,context:[{thread:a,widget:b,menuId:_.MenuId.CommentsCommentThreadTitle}],separator:"inline",type:"icon"})),o.default.createElement("div",{className:d.default.comment_body},A.length>0?o.default.createElement(l.CommentItem,{widget:b,commentThreadContext:k,thread:a}):o.default.createElement("div",null,o.default.createElement(h.CommentsTextArea,{focusDelay:100,initialHeight:"auto",value:O,onChange:F,placeholder:L,dragFiles:B}),o.default.createElement("div",{className:d.default.comment_bottom_actions},o.default.createElement(m.InlineActionBar,{className:d.default.comment_reply_actions,separator:"inline",type:"button",context:[{text:O,widget:b,thread:a,menuId:_.MenuId.CommentsCommentThreadContext}],menus:k})))))};let f=class extends s.ResizeZoneWidget{_fillContainer(){}constructor(b,y,A){super(b.monacoEditor,y.range,{...A,showInHiddenAreas:!0}),this.thread=y,this._onShow=new v.Emitter,this.onShow=this._onShow.event,this._onHide=new v.Emitter,this.onHide=this._onHide.event,this._editor=b,this._isShow=!y.isCollapsed.get();const S=document.createElement("div");this._container.appendChild(S),this.observeContainer(S);const w=this.commentsFeatureRegistry.getZoneWidgetRender();this.wrapperRoot=c.default.createRoot(S),this.wrapperRoot.render(o.default.createElement(v.ConfigProvider,{value:this.appConfig},w?w(this.thread,this):o.default.createElement(E,{thread:this.thread,widget:this}))),this.addDispose({dispose:()=>{var T;(T=this.wrapperRoot)===null||T===void 0||T.unmount(),this.wrapperRoot=void 0}})}get coreEditor(){return this._editor}get isShow(){return this._isShow}show(){super.show(),this._isShow=!0,this._onShow.fire()}hide(){super.hide(),this._isShow=!1,this._onHide.fire()}toggle(){this._isShow?this.hide():this.show()}applyClass(){}applyStyle(){}};t.CommentsZoneWidget=f,n.__decorate([(0,p.Autowired)(v.AppConfig),n.__metadata("design:type",Object)],f.prototype,"appConfig",void 0),n.__decorate([(0,p.Autowired)(g.ICommentsFeatureRegistry),n.__metadata("design:type",Object)],f.prototype,"commentsFeatureRegistry",void 0),t.CommentsZoneWidget=f=n.__decorate([(0,p.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Object,Object])],f)},62604:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsBrowserContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(93899),p=e(57517),v=e(63067),m=e(69635),_=e(47842);let s=class extends o.Disposable{onStart(){this.registerCommentsFeature(),this.listenToCreateCommentsPanel(),this.commentsService.init()}get panelBadge(){const l=this.commentsService.commentsThreads.length;return l?l+"":""}registerCommands(l){l.registerCommand({id:m.CollapseId,label:"%comments.panel.action.collapse%",iconClass:(0,o.getIcon)("collapse-all")},{execute:()=>{this.commentModelService.collapsedAll()}}),l.registerCommand({id:m.CloseThreadId,label:"%comments.thread.action.close%",iconClass:(0,o.getIcon)("up")},{execute:h=>{const{thread:u,widget:d}=h;u.comments.get().length?d.isShow&&d.toggle():u.dispose()}}),l.registerCommand({id:m.SwitchCommandReaction},{execute:h=>{this.eventBus.fire(new m.CommentReactionClick(h))}})}registerMenus(l){l.registerMenuItem(c.MenuId.CommentsCommentThreadTitle,{command:m.CloseThreadId,group:"inline",order:Number.MAX_SAFE_INTEGER})}registerToolbarItems(l){l.registerItem({id:m.CollapseId,viewId:m.CommentPanelId,command:m.CollapseId,tooltip:(0,o.localize)("comments.panel.action.collapse")})}registerCommentsFeature(){this.contributions.getContributions().forEach((l,h)=>{this.addDispose(this.commentsService.registerCommentRangeProvider(`contribution_${h}`,{getCommentingRanges:u=>l.provideCommentingRanges(u)})),l.registerCommentsFeature&&l.registerCommentsFeature(this.commentsFeatureRegistry)})}listenToCreateCommentsPanel(){this.commentsFeatureRegistry.getCommentsPanelOptions().defaultShow?this.commentsService.registerCommentPanel():o.Event.once(this.commentsService.onThreadsCreated)(()=>{this.commentsService.registerCommentPanel()}),this.addDispose(o.Event.debounce(this.commentsService.onThreadsChanged,()=>{},100)(()=>{const l=this.layoutService.getTabbarHandler(m.CommentPanelId);l?.setBadge(this.panelBadge)},this))}registerEditorFeature(l){l.registerEditorFeatureContribution({contribute:h=>this.commentsService.handleOnCreateEditor(h),provideEditorOptionsForUri:async h=>(await this.commentsService.getContributionRanges(h)).length?{lineDecorationsWidth:25,lineNumbersMinChars:5}:{}})}};t.CommentsBrowserContribution=s,n.__decorate([(0,r.Autowired)(m.ICommentsService),n.__metadata("design:type",Object)],s.prototype,"commentsService",void 0),n.__decorate([(0,r.Autowired)(v.IMainLayoutService),n.__metadata("design:type",Object)],s.prototype,"layoutService",void 0),n.__decorate([(0,r.Autowired)(m.ICommentsFeatureRegistry),n.__metadata("design:type",Object)],s.prototype,"commentsFeatureRegistry",void 0),n.__decorate([(0,r.Autowired)(m.CommentsContribution),n.__metadata("design:type",Object)],s.prototype,"contributions",void 0),n.__decorate([(0,r.Autowired)(o.IEventBus),n.__metadata("design:type",Object)],s.prototype,"eventBus",void 0),n.__decorate([(0,r.Autowired)(_.CommentModelService),n.__metadata("design:type",_.CommentModelService)],s.prototype,"commentModelService",void 0),t.CommentsBrowserContribution=s=n.__decorate([(0,o.Domain)(o.ClientAppContribution,p.BrowserEditorContribution,o.CommandContribution,o.TabBarToolbarContribution,c.MenuContribution)],s)},55011:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsService=void 0;const n=e(85608),r=n.__importDefault(e(53435)),o=n.__importDefault(e(87809)),c=e(76003),p=e(41869),v=e(57517),m=e(63067),_=e(20868),s=n.__importStar(e(20868)),g=e(62663),l=e(52416),h=n.__importStar(e(24347)),u=e(69635),d=e(53878),E=e(49867),f=e(53711);let a=class extends p.Disposable{constructor(){super(...arguments),this.decorationChangeEmitter=new p.Emitter,this.threads=new Map,this.threadsChangeEmitter=new p.Emitter,this.threadsCommentChangeEmitter=new p.Emitter,this.commentRangeProviderChangeEmitter=new p.Emitter,this.onDidChangeCurrentCommentThreadEmitter=new p.Emitter,this.threadsCreatedEmitter=new p.Emitter,this.rangeProviderMap=new Map,this.rangeOwner=new Map,this.providerDecorationCache=new p.LRUCache(1e4),this.commentRangeDecorationMap=new Map,this.shouldShowCommentsSchemes=new Set(["file","git","diff"]),this.decorationProviderDisposer=p.Disposable.NULL,this.activeThreadDecorationIds=[],this.allEditors=[],this.editorCommentingRangeSpaceReservedMap=new Map,this.editorLineDecorationsWidthMap=new Map}get commentsThreads(){return[...this.threads.values()]}get isMultiCommentsForSingleLine(){var y;return!!(!((y=this.commentsFeatureRegistry.getConfig())===null||y===void 0)&&y.isMultiCommentsForSingleLine)}get currentAuthorAvatar(){var y,A;return(A=(y=this.commentsFeatureRegistry.getConfig())===null||y===void 0?void 0:y.author)===null||A===void 0?void 0:A.avatar}get filterThreadDecoration(){var y;return(y=this.commentsFeatureRegistry.getConfig())===null||y===void 0?void 0:y.filterThreadDecoration}get onThreadsChanged(){return this.threadsChangeEmitter.event}get onThreadsCommentChange(){return this.threadsCommentChangeEmitter.event}get onThreadsCreated(){return this.threadsCreatedEmitter.event}get onCommentRangeProviderChange(){return this.commentRangeProviderChangeEmitter.event}get onDidChangeCurrentCommentThread(){return this.onDidChangeCurrentCommentThreadEmitter.event}setCurrentCommentThread(y){this.onDidChangeCurrentCommentThreadEmitter.fire(y)}createThreadDecoration(y){var A;const S=y.comments.get(),w=S.length===0?this.currentAuthorAvatar:(A=S[0].author.iconPath)===null||A===void 0?void 0:A.toString(),T=w?`${this.iconService.fromIcon("",w,l.IconType.Background)} avatar-icon`:this.iconService.fromString("$(comment)"),D={description:"comments-thread-decoration",glyphMarginClassName:w?["comment-thread",T].join(" "):["comment-range","comment-thread",T].join(" ")};return h.ModelDecorationOptions.createDynamic(D)}updateActiveThreadDecoration(y){var A;const S=this.getCurrentEditor(y?.uri);if(!S)return;(A=this.currentThreadCollapseStateListener)===null||A===void 0||A.dispose();const w=[];if(y){const T=y.range;y.isCollapsed.get()||(this.currentThreadCollapseStateListener=y.onDidChangeCollapsibleState(D=>{D===u.CommentThreadCollapsibleState.Collapsed&&this.updateActiveThreadDecoration(void 0)}),w.push({range:T,options:this.createThreadRangeActiveDecoration()}))}this.activeThreadDecorationIds=S.monacoEditor.deltaDecorations(this.activeThreadDecorationIds,w)}createDottedRangeDecoration(){const y={description:"comments-multiline-hover-decoration",linesDecorationsClassName:["comment-range","multiline-add"].join(" ")};return h.ModelDecorationOptions.createDynamic(y)}createHoverDecoration(){const y={description:"comments-hover-decoration",linesDecorationsClassName:["comment-range","line-hover","comment-add"].join(" ")};return h.ModelDecorationOptions.createDynamic(y)}createThreadRangeActiveDecoration(){const y={description:"comments-thread-range-active-decoration",isWholeLine:!1,zIndex:20,className:"comment-thread-range-current",shouldFillLineOnLineBreak:!0};return h.ModelDecorationOptions.createDynamic(y)}createThreadRangeDecoration(){const y={description:"comments-thread-range-decoration",isWholeLine:!1,zIndex:20,className:"comment-thread-range",shouldFillLineOnLineBreak:!0};return h.ModelDecorationOptions.createDynamic(y)}createCommentRangeDecoration(){const y={description:"comments-range-decoration",linesDecorationsClassName:["comment-range","comment-diff-added"].join(" ")};return h.ModelDecorationOptions.createDynamic(y)}init(){const y=this.resourceService.getSupportedSchemes();for(const A of y)this.shouldShowCommentsSchemes.add(A);this.addDispose(this.resourceService.onRegisterResourceProvider(A=>{A.scheme&&(this.shouldShowCommentsSchemes.add(A.scheme),this.registerDecorationProvider())})),this.addDispose(this.resourceService.onUnregisterResourceProvider(A=>{A.scheme&&(this.shouldShowCommentsSchemes.delete(A.scheme),this.registerDecorationProvider())})),this.registerDecorationProvider()}getCurrentEditor(y){var A;if(y){for(const S of this.allEditors)if(!((A=S.currentUri)===null||A===void 0)&&A.isEqual(y))return this.editor=S,S}return this.editor}handleOnCreateEditor(y){this.allEditors.push(y),this.editor=y;const A=new p.Disposable;let S=[],w=!1;return A.addDispose(y.monacoEditor.onMouseDown(T=>{if(T.target.type===g.monacoBrowser.editor.MouseTargetType.GUTTER_LINE_DECORATIONS&&T.target.element&&T.target.element.className.indexOf("comment-add")>-1){const{target:D}=T;if(D&&D.range){const{range:I}=D;this.startCommentRange=I,T.event.stopPropagation()}}else if(T.target.type===g.monacoBrowser.editor.MouseTargetType.GUTTER_GLYPH_MARGIN&&T.target.element&&T.target.element.className.indexOf("comment-thread")>-1){const{target:D}=T;if(D&&D.range){const{range:I}=D,O=this.commentsThreads.filter(M=>y.currentUri&&M.uri.isEqual(y.currentUri)&&M.range.endLineNumber===I.endLineNumber);O.length&&(O.some(R=>R.isShowWidget(y))?O.forEach(R=>R.hide(y)):O.forEach(R=>R.show(y)))}T.event.stopPropagation()}})),A.addDispose(y.monacoEditor.onMouseUp(async T=>{if(this.startCommentRange){if(w){this.renderCommentRange(y),w=!1,this.startCommentRange=null,this.endCommentRange=null;return}let D=this.startCommentRange;this.endCommentRange&&(this.endCommentRange.startLineNumber<this.startCommentRange.startLineNumber?(D.startColumn=this.endCommentRange.startColumn,D.startLineNumber=this.endCommentRange.startLineNumber):(D.endColumn=this.endCommentRange.endColumn,D.endLineNumber=this.endCommentRange.endLineNumber)),y.currentUri&&(D=await this.getValidRange(D,y.currentUri)),D&&(this.commentsThreads.some(I=>I.comments.get().length===0&&y.currentUri&&I.uri.isEqual(y.currentUri)&&I.range.startLineNumber===D.startLineNumber&&I.range.endLineNumber===D.endLineNumber)||this.createThread(y.currentUri,D).show(y),T.event.stopPropagation())}else if(T.target.type===g.monacoBrowser.editor.MouseTargetType.GUTTER_LINE_DECORATIONS&&T.target.element&&T.target.element.className.indexOf("comment-range")>-1&&T.target.element.className.indexOf("comment-thread")<0){const{target:D}=T,I=D.range;I&&(this.commentsThreads.some(O=>O.comments.get().length===0&&y.currentUri&&O.uri.isEqual(y.currentUri)&&O.range.startLineNumber===I.startLineNumber&&O.range.endLineNumber===I.endLineNumber)||this.createThread(y.currentUri,I).show(y),T.event.stopPropagation())}this.startCommentRange=null,this.endCommentRange=null})),A.addDispose(y.monacoEditor.onMouseMove(async T=>{var D,I,O;const M=y.currentUri,R=T.target.range;if(this.startCommentRange){if(!((D=T.target.element)===null||D===void 0)&&D.className||!((O=(I=T.target.element)===null||I===void 0?void 0:I.offsetParent)===null||O===void 0)&&O.className.includes("diff-hidden-lines")&&(w=!0),M&&R){let P={startLineNumber:this.startCommentRange.startLineNumber,endLineNumber:R.endLineNumber,startColumn:this.startCommentRange.startColumn,endColumn:R.endColumn};this.startCommentRange.startLineNumber>R.startLineNumber&&(P={startLineNumber:R.startLineNumber,endLineNumber:this.startCommentRange.endLineNumber,startColumn:R.startColumn,endColumn:this.startCommentRange.endColumn}),this.renderCommentRange(y,P),this.endCommentRange=R}}else if(M&&R&&await this.shouldShowHoverDecoration(M,R)){const P=[{range:(0,_.positionToRange)(R.startLineNumber),options:this.createHoverDecoration()}];S=y.monacoEditor.deltaDecorations(S,P)}})),A.addDispose(y.monacoEditor.onMouseLeave(async T=>{var D;const I=(D=T.target)===null||D===void 0?void 0:D.range,O=[];!this.startCommentRange&&I&&O.push({range:(0,_.positionToRange)(I.startLineNumber),options:this.createCommentRangeDecoration()}),S=y.monacoEditor.deltaDecorations(S,O)})),A.addDispose(this.onCommentRangeProviderChange(()=>{this.renderCommentRange(y)})),A.addDispose(p.Event.any(this.onThreadsChanged,this.onThreadsCommentChange,this.onThreadsCreated)(T=>{const D=this.getCurrentEditor(T.uri);D&&this.renderCommentRange(D),this.updateActiveThreadDecoration(void 0)})),A.addDispose(this.onDidChangeCurrentCommentThread(T=>{this.updateActiveThreadDecoration(T)})),this.tryUpdateReservedSpace(y),A.addDispose(y.monacoEditor.onDidChangeModel(()=>{this.renderCommentRange(y),this.tryUpdateReservedSpace(y)})),A}async getValidRange(y,A){if(!A)return y;const S=await this.getContributionRanges(A);if(S.length===0)return y;const w=S.find(T=>{if(y.startLineNumber>=T.startLineNumber&&y.startLineNumber<=T.endLineNumber)return!0});return w&&w.endLineNumber<y.endLineNumber?{startLineNumber:y.startLineNumber,startColumn:y.startColumn,endLineNumber:w.endLineNumber,endColumn:w.endColumn}:y}ensureCommentingRangeReservedAmount(y){const A=this.getExistingCommentEditorOptions(y),S=this.editorLineDecorationsWidthMap.get(y.getId());A.lineDecorationsWidth!==S&&y.updateOptions({lineDecorationsWidth:this.getWithCommentsLineDecorationWidth(y,A.lineDecorationsWidth)})}async tryUpdateReservedSpace(y){if(!y)return;let A=this.editorCommentingRangeSpaceReservedMap.get(y.getId())||!1;const S=y.currentUri?this.shouldShowCommentsSchemes.has(y.currentUri.scheme):!1,w=this.commentsThreads.some(D=>y.currentUri&&D.uri.isEqual(y.currentUri)&&D.comments.get().length>0),T=S||w;if(T)if(A)this.ensureCommentingRangeReservedAmount(y);else{A=!0;const{lineDecorationsWidth:D,extraEditorClassName:I}=this.getExistingCommentEditorOptions(y),O=this.getWithCommentsEditorOptions(y,I,D);this.updateEditorLayoutOptions(y,O.extraEditorClassName,O.lineDecorationsWidth)}else if(!T&&A){A=!1;const{lineDecorationsWidth:D,extraEditorClassName:I}=this.getExistingCommentEditorOptions(y),O=this.getWithoutCommentsEditorOptions(y,I,D);this.updateEditorLayoutOptions(y,O.extraEditorClassName,O.lineDecorationsWidth)}this.editorCommentingRangeSpaceReservedMap.set(y.getId(),A)}getExistingCommentEditorOptions(y){const A=y.monacoEditor.getOption(s.EditorOption.lineDecorationsWidth);let S=[];const w=y.monacoEditor.getRawOptions().extraEditorClassName;return w&&(S=w.split(" ")),{lineDecorationsWidth:A,extraEditorClassName:S}}getWithoutCommentsEditorOptions(y,A,S){let w=S;const T=A.findIndex(I=>I==="inline-comment");T>=0&&A.splice(T,1);const D=y.monacoEditor.getOptions();return D.get(s.EditorOption.folding)&&D.get(s.EditorOption.showFoldingControls)!=="never"&&(w+=11),w-=24,{extraEditorClassName:A,lineDecorationsWidth:w}}updateEditorLayoutOptions(y,A,S){y.updateOptions({extraEditorClassName:A.join(" "),lineDecorationsWidth:S})}getWithCommentsEditorOptions(y,A,S){return A.push("inline-comment"),{lineDecorationsWidth:this.getWithCommentsLineDecorationWidth(y,S),extraEditorClassName:A}}getWithCommentsLineDecorationWidth(y,A){let S=A;const w=y.monacoEditor.getOptions();return w.get(s.EditorOption.folding)&&w.get(s.EditorOption.showFoldingControls)!=="never"&&(S-=11),S+=24,this.editorLineDecorationsWidthMap.set(y.getId(),S),S}async renderCommentRange(y,A={startLineNumber:0,endLineNumber:0,startColumn:0,endColumn:0}){if(!y.currentUri)return;const S=await this.getContributionRanges(y.currentUri);if(S.length>0){const w=[];S.map(D=>{if(A.startLineNumber===0&&A.endLineNumber===0)w.push({range:D,options:this.createCommentRangeDecoration()});else if(A.startLineNumber<=D.startLineNumber&&A.endLineNumber>=D.endLineNumber)w.push({range:D,options:this.createDottedRangeDecoration()},{range:D,options:this.createThreadRangeDecoration()});else if(A.endLineNumber>=D.endLineNumber)if(A.startLineNumber<=D.endLineNumber){const I={startLineNumber:A.startLineNumber,endLineNumber:D.endLineNumber,startColumn:A.startColumn,endColumn:D.endColumn},O={startLineNumber:D.startLineNumber,endLineNumber:I.startLineNumber-1,startColumn:D.startColumn,endColumn:I.endColumn};w.push({range:O,options:this.createCommentRangeDecoration()},{range:I,options:this.createDottedRangeDecoration()},{range:I,options:this.createThreadRangeDecoration()})}else w.push({range:D,options:this.createCommentRangeDecoration()});else if(A.endLineNumber<D.endLineNumber)if(A.endLineNumber>=D.startLineNumber)if(A.startLineNumber>=D.startLineNumber){const I={startLineNumber:D.startLineNumber,startColumn:D.startColumn,endLineNumber:A.startLineNumber-1,endColumn:A.startColumn},O={startLineNumber:A.endLineNumber+1,startColumn:A.endColumn,endLineNumber:D.endLineNumber,endColumn:D.endColumn},M=A.startLineNumber!==D.startLineNumber?[{range:I,options:this.createCommentRangeDecoration()}]:[];M.push({range:A,options:this.createDottedRangeDecoration()}),M.push({range:A,options:this.createThreadRangeDecoration()}),M.push({range:O,options:this.createCommentRangeDecoration()}),w.push(...M)}else{const I={startLineNumber:D.startLineNumber,startColumn:D.startColumn,endLineNumber:A.endLineNumber,endColumn:A.endColumn},O={startLineNumber:I.endLineNumber+1,startColumn:I.endColumn,endLineNumber:D.endLineNumber,endColumn:D.endColumn};w.push({range:I,options:this.createDottedRangeDecoration()},{range:I,options:this.createThreadRangeDecoration()},{range:O,options:this.createCommentRangeDecoration()})}else w.push({range:D,options:this.createCommentRangeDecoration()})});const T=this.commentRangeDecorationMap.get(y.currentUri.toString())||[];this.commentRangeDecorationMap.set(y.currentUri.toString(),y.monacoEditor.deltaDecorations(T,w))}else this.commentRangeDecorationMap.set(y.currentUri.toString(),[])}async shouldShowHoverDecoration(y,A){return this.shouldShowCommentsSchemes.has(y.scheme)?(await this.getContributionRanges(y)).some(T=>A.startLineNumber<=T.endLineNumber):!1}createThread(y,A,S={comments:[],readOnly:!1}){const w=this.getProviderIdsByLine(A.endLineNumber)[0],T=this.injector.get(E.CommentsThread,[y,A,w,S]);return T.onDispose(()=>{this.threads.delete(T.id),this.threadsChangeEmitter.fire(T),this.decorationChangeEmitter.fire(y)}),T.onDidChange(()=>{this.threadsChangeEmitter.fire(T)}),this.threads.set(T.id,T),this.addDispose(T),this.threadsChangeEmitter.fire(T),this.threadsCreatedEmitter.fire(T),this.decorationChangeEmitter.fire(y),T}getThreadsByUri(y){return this.commentsThreads.filter(A=>A.uri.isEqual(y)).sort((A,S)=>A.range.startLineNumber-S.range.startLineNumber)}handleCommentFileNode(y){const A=[],S=[...this.threads.values()].filter(T=>T.comments.get().length),w=(0,o.default)(S,T=>T.uri);return Object.keys(w).map(T=>{var D;const I=w[T];if(I.length===0)return;const O=new p.URI(this.appConfig.workspaceDir),M=new p.URI(T),R=(D=O.relative(M))===null||D===void 0?void 0:D.toString();A.push(new f.CommentFileNode(this,I,R,M.codeUri.fsPath,this.labelService.getIcon(M),M,y))}),A}handleCommentContentNode(y){var A;const S=[];for(const w of y.threads){const T=w.comments.get(),[D]=T,I=typeof D.body=="string"?D.body:D.body.value;let O=`[Ln ${w.range.startLineNumber}]`;w.range.startLineNumber!==w.range.endLineNumber&&(O=`[Ln ${w.range.startLineNumber}-${w.range.endLineNumber}]`),S.push(new f.CommentContentNode(this,w,I,O,D.author.iconPath&&(!((A=D.author.iconPath)===null||A===void 0)&&A.authority)?this.iconService.fromIcon("",D.author.iconPath.toString(),l.IconType.Background):(0,p.getIcon)("message"),D.author,y.resource,y))}return S}handleCommentReplyNode(y){const A=[],S=y.thread,w=S.comments.get(),[T,...D]=w,I=D[D.length-1].author.name;return A.push(new f.CommentReplyNode(this,S,(0,p.formatLocalize)("comment.reply.count",D?.length||0),(0,p.formatLocalize)("comment.reply.lastReply",I),"",y.resource,y)),A}async resolveChildren(y){let A=[];if(y?f.CommentRoot.isRoot(y)?A=this.handleCommentFileNode(y):f.CommentFileNode.is(y)?A=this.handleCommentContentNode(y):f.CommentContentNode.is(y)&&(A=this.handleCommentReplyNode(y)):A.push(new f.CommentRoot(this)),A.length===1&&f.CommentRoot.isRoot(A[0]))return A;const S=this.commentsFeatureRegistry.getCommentsPanelTreeNodeHandlers();if(S.length>0)for(const w of S)A=w(A);return A}async getContributionRanges(y){const A=this.providerDecorationCache.get(y.toString());if(A)return await A.promise;const S=this.documentService.getModelReference(y,"Get Comment Range"),w=[];for(const O of this.rangeProviderMap){const[M,R]=O;w.push((async()=>{if(!S?.instance)return;const P=await R.getCommentingRanges(S.instance);return P&&P.length&&this.rangeOwner.set(M,P),P})())}const T=new p.Deferred;this.providerDecorationCache.set(y.toString(),T);const D=(await Promise.all(w)).filter(Boolean);S?.dispose();const I=(0,r.default)(D).filter(Boolean);return T.resolve(I),I}fireThreadCommentChange(y){this.threadsCommentChangeEmitter.fire(y)}registerDecorationProvider(){this.decorationProviderDisposer.dispose(),this.decorationProviderDisposer=this.editorDecorationCollectionService.registerDecorationProvider({schemes:[...this.shouldShowCommentsSchemes.values()],key:"comments",onDidDecorationChange:this.decorationChangeEmitter.event,provideEditorDecoration:y=>this.commentsThreads.map(A=>(A.uri.codeUri.path===y.codeUri.path?A.comments.get().length&&A.showWidgetsIfShowed():A.hide(),A)).filter(A=>{const S=A.uri.isEqual(y);return this.filterThreadDecoration?S&&this.filterThreadDecoration(A):S}).map(A=>({range:{startLineNumber:A.range.endLineNumber,endLineNumber:A.range.endLineNumber,startColumn:A.range.endColumn,endColumn:A.range.endColumn},options:this.createThreadDecoration(A)}))}),this.addDispose(this.decorationProviderDisposer)}registerCommentPanel(){this.layoutService.getTabbarHandler(u.CommentPanelId)||this.layoutService.collectTabbarComponent([{id:u.CommentPanelId,component:d.CommentsPanel}],{badge:this.panelBadge,containerId:u.CommentPanelId,title:(0,p.localize)("comments").toUpperCase(),hidden:!1,activateKeyBinding:"ctrlcmd+shift+c",...this.commentsFeatureRegistry.getCommentsPanelOptions()},"bottom")}get panelBadge(){const y=this.commentsThreads.length;return y?y+"":""}registerCommentRangeProvider(y,A){return this.rangeProviderMap.set(y,A),this.providerDecorationCache.clear(),this.commentRangeProviderChangeEmitter.fire(),p.Disposable.create(()=>{this.rangeProviderMap.delete(y),this.rangeOwner.delete(y),this.providerDecorationCache.clear()})}forceUpdateDecoration(){var y,A,S;const w=(y=this.workbenchEditorService.currentEditor)===null||y===void 0?void 0:y.currentUri;w&&this.decorationChangeEmitter.fire(w);const T=(S=(A=this.workbenchEditorService.currentEditorGroup)===null||A===void 0?void 0:A.diffEditor)===null||S===void 0?void 0:S.originalEditor.currentUri;T&&this.decorationChangeEmitter.fire(T)}getProviderIdsByLine(y){const A=[];if(this.rangeOwner.size===1)return[this.rangeOwner.keys().next().value];for(const S of this.rangeOwner){const[w,T]=S;T&&T.some(D=>D.startLineNumber<=y&&y<=D.endLineNumber)&&A.push(w)}return A}};t.CommentsService=a,n.__decorate([(0,c.Autowired)(c.INJECTOR_TOKEN),n.__metadata("design:type",c.Injector)],a.prototype,"injector",void 0),n.__decorate([(0,c.Autowired)(p.AppConfig),n.__metadata("design:type",Object)],a.prototype,"appConfig",void 0),n.__decorate([(0,c.Autowired)(v.IEditorDecorationCollectionService),n.__metadata("design:type",Object)],a.prototype,"editorDecorationCollectionService",void 0),n.__decorate([(0,c.Autowired)(l.IIconService),n.__metadata("design:type",Object)],a.prototype,"iconService",void 0),n.__decorate([(0,c.Autowired)(p.LabelService),n.__metadata("design:type",p.LabelService)],a.prototype,"labelService",void 0),n.__decorate([(0,c.Autowired)(u.ICommentsFeatureRegistry),n.__metadata("design:type",Object)],a.prototype,"commentsFeatureRegistry",void 0),n.__decorate([(0,c.Autowired)(v.IEditorDocumentModelService),n.__metadata("design:type",Object)],a.prototype,"documentService",void 0),n.__decorate([(0,c.Autowired)(m.IMainLayoutService),n.__metadata("design:type",Object)],a.prototype,"layoutService",void 0),n.__decorate([(0,c.Autowired)(v.WorkbenchEditorService),n.__metadata("design:type",v.WorkbenchEditorService)],a.prototype,"workbenchEditorService",void 0),n.__decorate([(0,c.Autowired)(v.ResourceService),n.__metadata("design:type",v.ResourceService)],a.prototype,"resourceService",void 0),n.__decorate([p.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],a.prototype,"isMultiCommentsForSingleLine",null),n.__decorate([p.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],a.prototype,"currentAuthorAvatar",null),n.__decorate([p.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],a.prototype,"filterThreadDecoration",null),t.CommentsService=a=n.__decorate([(0,c.Injectable)()],a)},54230:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsModule=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(69635),p=e(66480),v=e(62604),m=e(55011),_=e(47842);let s=class extends o.BrowserModule{constructor(){super(...arguments),this.contributionProvider=c.CommentsContribution,this.providers=[{token:c.ICommentsService,useClass:m.CommentsService},{token:_.CommentModelService,useClass:_.CommentModelService},{token:c.ICommentsFeatureRegistry,useClass:p.CommentsFeatureRegistry},v.CommentsBrowserContribution]}};t.CommentsModule=s,t.CommentsModule=s=n.__decorate([(0,r.Injectable)()],s)},70154:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.markdownCss=void 0,t.markdownCss=`
|
|
31471
|
+
`)};t.extractCodeBlocks=m;const _=(g,l=n.BUILTIN_MCP_SERVER_NAME)=>`mcp_${l}_${g}`;t.getToolName=_;const s=g=>{const l=/`<attached_file>(.*)`/g,h=/`<attached_folder>(.*)`/g;return g=g.replace(l,"$1"),g=g.replace(h,"$1"),g};t.cleanAttachedTextWrapper=s},26471:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(19413),t)},15504:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentReactions=t.CommentReactionSwitcher=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(41869),c=e(81878),p=e(25918),v=e(93899),m=e(52416),_=e(69635),s=n.__importDefault(e(38877)),g=({thread:h,comment:u,className:d})=>{const E=`${h.providerId}_${h.id}_${u.id}`,f=`${v.MenuId.CommentReactionSwitcherMenu}_${E}`,a=(0,o.useInjectable)(v.IMenuRegistry),b=(0,o.useInjectable)(v.AbstractMenuService);r.default.useEffect(()=>{const A=new o.Disposable,S=`${v.MenuId.CommentReactionSwitcherSubmenu}_${E}`;return A.addDispose(a.registerMenuItem(f,{submenu:S,label:S,iconClass:(0,o.getExternalIcon)("reactions"),group:"navigation"})),A.addDispose(a.registerMenuItems(S,u.reactions.map(w=>({command:{id:_.SwitchCommandReaction,label:w.label},extraTailArgs:[{thread:h,comment:u,reaction:w}]})))),()=>A.dispose()},[]);const y=r.default.useMemo(()=>b.createMenu(f),[]);return r.default.createElement(p.InlineActionBar,{className:d,menus:y,regroup:A=>[A,[]],type:"icon"})};t.CommentReactionSwitcher=g;const l=({thread:h,comment:u})=>{var d;const E=(0,o.useInjectable)(o.IEventBus),f=(0,o.useInjectable)(m.IIconService),a=r.default.useCallback(b=>{E.fire(new _.CommentReactionClick({thread:h,comment:u,reaction:b}))},[]);return r.default.createElement("div",{className:s.default.comment_reactions},(d=u.reactions)===null||d===void 0?void 0:d.filter(b=>b.count!==0).map(b=>r.default.createElement(c.Button,{key:b.label,onClick:()=>a(b),type:"secondary",size:"small",title:b.label,className:s.default.comment_reaction,iconClass:f.fromIcon("",b.iconPath.toString(),m.IconType.Background)},"\xA0",b.count)))};t.CommentReactions=l},54143:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsBody=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=n.__importDefault(e(43144)),c=e(84605),p=n.__importDefault(e(38877)),v=e(70154),m=({root:_,children:s})=>o.default.createPortal(s,_);t.CommentsBody=r.default.memo(({body:_})=>{const s=r.default.useRef(null),[g,l]=r.default.useState(null),h=r.default.useMemo(()=>{const u=(0,c.createMarkedRenderer)();return u.link=(d,E,f)=>`<a target="_blank" rel="noopener" href="${d}" title="${E}">${f}</a>`,u},[]);return r.default.useEffect(()=>{if(s.current){const u=s.current.attachShadow({mode:"open"});g||l(u)}},[]),r.default.createElement("div",{ref:s,className:p.default.comment_shadow_box},g&&r.default.createElement(m,{root:g},r.default.createElement("style",null,v.markdownCss),r.default.createElement("div",{dangerouslySetInnerHTML:{__html:(0,c.toMarkdownHtml)(typeof _=="string"?_:_.value,{gfm:!0,breaks:!1,pedantic:!1,smartLists:!0,smartypants:!1,renderer:h})}})))})},66480:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsFeatureRegistry=void 0;const n=e(85608),r=e(76003);let o=class{constructor(){this.config={},this.options={},this.panelTreeNodeHandlers=[],this.mentionsOptions={},this.providerFeature=new Map}registerConfig(p){this.config={...this.config,...p}}registerPanelTreeNodeHandler(p){this.panelTreeNodeHandlers.push(p)}registerPanelOptions(p){this.options={...this.options,...p}}registerFileUploadHandler(p){this.fileUploadHandler=p}registerMentionsOptions(p){this.mentionsOptions=p}registerZoneWidgetRender(p){this.zoneWidgetRender=p}getConfig(){return this.config}getCommentsPanelOptions(){return this.options}getCommentsPanelTreeNodeHandlers(){return this.panelTreeNodeHandlers}getFileUploadHandler(){return this.fileUploadHandler}getMentionsOptions(){return this.mentionsOptions}getZoneWidgetRender(){return this.zoneWidgetRender}registerProviderFeature(p,v){this.providerFeature.set(p,v)}getProviderFeature(p){return this.providerFeature.get(p)}};t.CommentsFeatureRegistry=o,t.CommentsFeatureRegistry=o=n.__decorate([(0,r.Injectable)()],o)},37357:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentItem=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(97267),c=e(41869),p=e(25918),v=e(93899),m=e(69635),_=e(15504),s=e(54143),g=e(42018),l=n.__importDefault(e(38877)),h=({timestamp:f})=>{const a=r.default.useMemo(()=>{const b=new Date(f);return(0,c.toLocalString)(b)},[f]);return r.default.createElement("span",{className:l.default.comment_item_timestamp},a)},u=(f,a)=>{const b=(0,c.useInjectable)(v.AbstractMenuService),{body:y,contextValue:A}=a,[S,w]=r.default.useState(""),T=(0,c.useInjectable)(m.ICommentsFeatureRegistry),D=r.default.useMemo(()=>T.getFileUploadHandler(),[]);r.default.useEffect(()=>{w(y)},[y]);const I=r.default.useMemo(()=>f.createScoped(),[]),O=r.default.useMemo(()=>I.createKey("commentIsEmpty",!a.body),[]),M=r.default.useMemo(()=>b.createMenu(v.MenuId.CommentsCommentContext,I),[]),R=r.default.useMemo(()=>b.createMenu(v.MenuId.CommentsCommentTitle,I),[]),P=r.default.useRef(I.createKey("comment",A));r.default.useEffect(()=>{P.current.set(A)},[A]);const k=r.default.useCallback(L=>{O.set(!L.target.value),w(L.target.value)},[]),F=r.default.useCallback(async L=>{if(D){const B=await D(S,L);w(j=>{const W=j+B;return O.set(!W),W})}},[S]);return[S,w,k,M,R,F]},d=({reply:f,thread:a})=>{var b;const{contextKeyService:y}=a,{author:A,label:S,body:w,mode:T,timestamp:D}=f,I=(b=A.iconPath)===null||b===void 0?void 0:b.toString(),[O,M,R,P,k,F]=u(y,f),L=r.default.useMemo(()=>{const B=(0,c.toMarkdownHtml)(typeof w=="string"?w:w.value);return/^\<p\>[^<>]+\<\/p\>\n$/.test(B)},[w]);return r.default.createElement("div",{className:l.default.reply_item},(0,c.isUndefined)(T)||T===m.CommentMode.Preview?r.default.createElement("div",null,L?r.default.createElement(r.default.Fragment,null,I&&r.default.createElement("img",{className:l.default.reply_item_icon,src:I,alt:A.name}),r.default.createElement("span",{className:l.default.comment_item_author_name},A.name),D&&r.default.createElement(h,{timestamp:D}),typeof S=="string"?r.default.createElement("span",{className:l.default.comment_item_label},S):S," : ",r.default.createElement("span",{className:l.default.comment_item_body},typeof w=="string"?w:w.value),f.reactions&&f.reactions.length>0&&r.default.createElement(_.CommentReactionSwitcher,{className:l.default.reply_item_title,thread:a,comment:f}),r.default.createElement(p.InlineActionBar,{separator:"inline",className:l.default.reply_item_title,menus:k,context:[{thread:a,comment:f,menuId:v.MenuId.CommentsCommentTitle}],type:"icon"})):r.default.createElement(r.default.Fragment,null,r.default.createElement("div",{className:l.default.comment_item_markdown_header},r.default.createElement("div",null,I&&r.default.createElement("img",{className:l.default.reply_item_icon,src:I,alt:A.name}),r.default.createElement("span",{className:l.default.comment_item_author_name},A.name),D&&r.default.createElement(h,{timestamp:D}),typeof S=="string"?r.default.createElement("span",{className:l.default.comment_item_label},S):S," : "),r.default.createElement(p.InlineActionBar,{separator:"inline",className:l.default.reply_item_title,menus:k,context:[{thread:a,comment:f,menuId:v.MenuId.CommentsCommentTitle}],type:"icon"})),r.default.createElement(s.CommentsBody,{body:w}))):r.default.createElement("div",null,r.default.createElement(g.CommentsTextArea,{value:typeof O=="string"?O:O.value,autoFocus:!0,onChange:R,dragFiles:F}),r.default.createElement(p.InlineActionBar,{className:l.default.comment_item_reply,menus:P,context:[{thread:a,comment:f,body:O,menuId:v.MenuId.CommentsCommentContext}],type:"button",separator:"inline",afterClick:()=>{M(w)}})),f.reactions&&f.reactions.length>0&&r.default.createElement(_.CommentReactions,{thread:a,comment:f}))},E=({thread:f,commentThreadContext:a,widget:b})=>{var y,A;const[S,w]=r.default.useState(!1),[T,D]=r.default.useState(""),{contextKeyService:I}=f,O=(0,c.useAutorun)(f.readOnly),[M,...R]=(0,c.useAutorun)(f.comments),{author:P,label:k,body:F,mode:L,timestamp:B}=M,j=(0,c.isString)(P.iconPath)?P.iconPath:!((y=P.iconPath)===null||y===void 0)&&y.authority?(A=P.iconPath)===null||A===void 0?void 0:A.toString():"",[W,U,Q,V,$,Y]=u(I,M),z=(0,c.useInjectable)(m.ICommentsFeatureRegistry),H=r.default.useMemo(()=>z.getFileUploadHandler(),[]),K=r.default.useMemo(()=>I.createKey("commentIsEmpty",!0),[]);function Z(ie){K.set(!ie.target.value),D(ie.target.value)}const X=r.default.useCallback(async ie=>{if(H){const oe=await H(W,ie);D(le=>{const pe=le+oe;return K.set(!pe),pe})}},[T]);return r.default.createElement("div",{className:l.default.comment_item},j&&r.default.createElement("img",{className:l.default.comment_item_icon,src:j,alt:P.name}),r.default.createElement("div",{className:l.default.comment_item_content},r.default.createElement("div",{className:l.default.comment_item_head},r.default.createElement("div",{className:l.default.comment_item_name},r.default.createElement("span",{className:l.default.comment_item_author_name},P.name),B&&r.default.createElement(h,{timestamp:B}),typeof k=="string"?r.default.createElement("span",{className:l.default.comment_item_label},k):k),r.default.createElement("div",{className:l.default.comment_item_actions},M.reactions&&M.reactions.length>0&&r.default.createElement(_.CommentReactionSwitcher,{thread:f,comment:M}),!O&&r.default.createElement(o.Button,{className:l.default.comment_item_reply_button,size:"small",type:"secondary",onClick:()=>w(!0)},(0,c.localize)("comments.thread.action.reply")),r.default.createElement(p.InlineActionBar,{menus:$,context:[{thread:f,comment:M,menuId:v.MenuId.CommentsCommentTitle}],type:"button"}))),(0,c.isUndefined)(L)||L===m.CommentMode.Preview?r.default.createElement(s.CommentsBody,{body:F}):r.default.createElement("div",null,r.default.createElement(g.CommentsTextArea,{value:typeof W=="string"?W:W.value,autoFocus:!0,onChange:Q,dragFiles:Y}),r.default.createElement(p.InlineActionBar,{className:l.default.comment_item_context,menus:V,context:[{thread:f,comment:M,body:W,menuId:v.MenuId.CommentsCommentContext}],separator:"inline",type:"button",afterClick:()=>{U(F)}})),M.reactions&&M.reactions.length>0&&r.default.createElement(_.CommentReactions,{thread:f,comment:M}),(R.length>0||S)&&r.default.createElement("div",{className:l.default.comment_item_reply_wrap},R.map(ie=>r.default.createElement(d,{key:ie.id,thread:f,reply:ie})),S&&r.default.createElement("div",null,r.default.createElement(g.CommentsTextArea,{autoFocus:!0,value:T,onChange:Z,placeholder:`${(0,c.localize)("comments.reply.placeholder")}...`,dragFiles:X}),r.default.createElement(p.InlineActionBar,{className:l.default.comment_item_reply,menus:a,context:[{thread:f,text:T,widget:b,menuId:v.MenuId.CommentsCommentThreadContext}],separator:"inline",type:"button",afterClick:()=>{D(""),w(!1)}})))))};t.CommentItem=E},53878:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsPanel=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),c=e(41869),p=e(69635),v=n.__importDefault(e(38877)),m=e(5167),_=e(47842),s=({viewState:g})=>{const l=(0,c.useInjectable)(_.CommentModelService),[h,u]=(0,r.useState)(),d=(0,r.useRef)(null),E=(0,c.useInjectable)(p.ICommentsFeatureRegistry),{handleTreeBlur:f}=l;(0,r.useEffect)(()=>{u(l.treeModel);const T=l.onDidUpdateTreeModel(D=>{u(D)});return()=>{T.dispose()}},[]);const a=(0,r.useCallback)(T=>{l.handleTreeHandler(T)},[l]),b=(0,r.useCallback)(T=>r.default.createElement(m.CommentNodeRendered,{item:T.item,itemType:T.itemType,decorations:l.decorations.getDecorations(T.item),defaultLeftPadding:8,onTwistierClick:l.handleTwistierClick,onClick:l.handleItemClick,leftPadding:8}),[h]),y=(0,r.useMemo)(()=>E.getCommentsPanelOptions(),[]),A=(0,r.useMemo)(()=>y.header,[y]),S=(0,r.useMemo)(()=>r.default.createElement("div",{className:v.default.panel_placeholder},y.defaultPlaceholder||(0,c.localize)("comments.panel.placeholder")),[y]),w=(0,r.useCallback)(()=>h?r.default.createElement(o.RecycleTree,{height:g.height-(A?.height||0),itemHeight:m.COMMENT_TREE_NODE_HEIGHT,onReady:a,model:h,placeholder:()=>S},b):S,[h,A,g.height]);return r.default.createElement("div",{className:v.default.comment_panel,tabIndex:-1,onBlur:f,ref:d},A?.component,w())};t.CommentsPanel=s},42018:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsTextArea=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(34801),c=e(97267),p=e(41869),v=e(69635),m=e(54143),_=n.__importDefault(e(38877)),s=e(73136),g="@",l="@[__display__](__id__)",h=(u,d)=>`@${d}`;t.CommentsTextArea=r.default.forwardRef((u,d)=>{const{focusDelay:E=0,autoFocus:f=!1,placeholder:a="",onFocus:b,onBlur:y,onChange:A,maxRows:S=10,minRows:w=2,value:T,initialHeight:D,dragFiles:I}=u,[O,M]=r.default.useState(0),R=(0,p.useInjectable)(v.ICommentsFeatureRegistry),P=r.default.useRef(null),k=r.default.useRef(null),F=r.default.useRef(null);r.default.useImperativeHandle(d,()=>P.current);const L=r.default.useCallback(async $=>{var Y;$.stopPropagation(),$.preventDefault();const z=(Y=$.clipboardData)===null||Y===void 0?void 0:Y.files;z&&I&&await I(z),P.current&&(P.current.focus(),W(P.current.value))},[I]),B=r.default.useCallback(async $=>{var Y;$.stopPropagation(),$.preventDefault();const z=(Y=$.dataTransfer)===null||Y===void 0?void 0:Y.files;z&&I&&await I(z),P.current&&(P.current.focus(),W(P.current.value))},[I]),j=r.default.useCallback($=>{$.stopPropagation(),$.preventDefault(),$.dataTransfer.dropEffect="copy"},[]),W=r.default.useCallback($=>{const Y=P.current;if(Y){const z=$.toString().length;Y.setSelectionRange(z,z)}},[]);r.default.useEffect(()=>{var $;const Y=P.current;if(!Y)return;D&&Y.style&&(Y.style.height=D),E&&setTimeout(()=>{Y.focus({preventScroll:!0})},E),W(T);function z(H){var K,Z,X;const ie=H.target;ie&&(ie.nodeName.toUpperCase()==="TEXTAREA"&&ie.scrollHeight>ie.clientHeight||ie.nodeName.toUpperCase()==="UL"||((K=ie.parentElement)===null||K===void 0?void 0:K.nodeName.toUpperCase())==="UL"||((X=(Z=ie.parentElement)===null||Z===void 0?void 0:Z.parentElement)===null||X===void 0?void 0:X.nodeName.toUpperCase())==="UL")&&H.stopPropagation()}return($=k.current)===null||$===void 0||$.addEventListener("mousewheel",z,!0),()=>{var H;(H=k.current)===null||H===void 0||H.removeEventListener("mousewheel",z,!0)}},[]),r.default.useEffect(()=>{O===0&&(setTimeout(()=>{var $;($=P.current)===null||$===void 0||$.focus({preventScroll:!0})},E),W(T))},[O]);const U=r.default.useMemo(()=>(0,s.getMentionBoxStyle)({minRows:w,maxRows:S}),[w,S]),Q=r.default.useMemo(()=>R.getMentionsOptions(),[R]),V=r.default.useCallback(async($,Y)=>{if(Q.providerData){const z=await Q.providerData($);Y(z)}else Y([])},[Q]);return r.default.createElement("div",{className:_.default.textarea_container},r.default.createElement(c.Tabs,{mini:!0,value:O,onChange:$=>M($),tabs:[(0,p.localize)("comments.thread.textarea.write"),(0,p.localize)("comments.thread.textarea.preview")]}),r.default.createElement("div",null,O===0?r.default.createElement("div",{ref:k},r.default.createElement(o.MentionsInput,{autoFocus:f,onPaste:L,inputRef:P,onDragOver:j,onDrop:B,ref:F,value:T,placeholder:a,onChange:A,onFocus:b,onBlur:y,style:U},r.default.createElement(o.Mention,{markup:Q.markup||l,renderSuggestion:Q.renderSuggestion,trigger:g,data:V,displayTransform:Q.displayTransform||h}))):r.default.createElement("div",{className:_.default.textarea_preview},r.default.createElement(m.CommentsBody,{body:T}))))})},49867:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsThread=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(91830),p=e(54414),v=e(28423),m=e(69635),_=e(90366);let s=class extends o.Disposable{set contextValue(l){this._contextKeyService.createKey("thread",l)}get contextValue(){return this._contextKeyService.getContextKeyValue("thread")}get onDidChangeCollapsibleState(){return this.onDidChangeCollapsibleStateEmitter.event}get onDidChange(){return this.onDidChangeEmitter.event}constructor(l,h,u,d){super(),this.uri=l,this.range=h,this.providerId=u,this.options=d,this.comments=(0,v.observableValue)(this,[]),this.label=(0,v.observableValue)(this,void 0),this.readOnly=(0,v.observableValue)(this,!1),this.isCollapsed=(0,v.observableValue)(this,!1),this.onDidChangeCollapsibleStateEmitter=new o.Emitter,this.widgets=new Map,this._id=`thread_${(0,o.uuid)()}`,this.onDidChangeEmitter=new o.Emitter,this.threadHeaderTitle=(0,v.derived)(this,A=>{const S=this.label.read(A);if(S)return S;const w=this.comments.read(A);if(w.length){const T=new Set(w.map(D=>`@${D.author.name}`));return`${(0,o.localize)("comments.participants")}: `+[...T].join(" ")}else return(0,o.localize)("comments.zone.title")}),this.toggle=A=>{if(this.comments.get().length>0){const w=this.widgets.get(A);w&&w.toggle()}else this.dispose()},this.updateComments(d.comments?d.comments.map(A=>({...A,id:(0,o.uuid)()})):[]),this.data=this.options.data,this._contextKeyService=this.registerDispose(this.globalContextKeyService.createScoped()),new c.ResourceContextKey(this._contextKeyService).set(l),this._contextKeyService.createKey("thread",d.contextValue),(0,v.transaction)(A=>{this.setReadOnly(!!d.readOnly),this.label.set(d.label,A),this.isCollapsed.set(!!this.options.isCollapsed,A)});const f=this._contextKeyService.createKey("threadsLength",this.commentsService.getThreadsByUri(l).length),a=this.comments.get(),b=this._contextKeyService.createKey("commentsLength",a.length),y=this._contextKeyService.createKey("commentThreadIsEmpty",!a.length);this._contextKeyService.createKey("commentController",u),this.addDispose((0,v.autorun)(A=>{const S=this.comments.read(A).length;b.set(S),y.set(!S)})),this.addDispose((0,v.autorun)(A=>{this.isCollapsed.read(A)?this.hideAll():this.showAll()})),this.addDispose(this.commentsService.onThreadsChanged(A=>{A.uri.isEqual(l)&&f.set(this.commentsService.getThreadsByUri(l).length)})),this.addDispose({dispose:()=>{this.updateComments([])}}),this.onDidChangeEmitter.fire()}updateComments(l){(0,v.transaction)(h=>{this.comments.set(l,h)})}getWidgetByEditor(l){return this.widgets.get(l)}get id(){return this._id}get contextKeyService(){return this._contextKeyService}setReadOnly(l){(0,v.transaction)(h=>{this.readOnly.set(l,h),this._contextKeyService.createKey("readOnly",l)})}getEditorsByUri(l){return this.editorCollectionService.listEditors().filter(h=>{var u;return(u=h.currentUri)===null||u===void 0?void 0:u.isEqual(l)})}addWidgetByEditor(l){const h=this.injector.get(_.CommentsZoneWidget,[l,this,{arrowColor:"var(--peekView-border)"}]);return this.addDispose(h.onChangeZoneWidget(()=>{const u=this.commentsService.commentsThreads.filter(f=>this.isEqual(f)),d=u.findIndex(f=>f===this),E=u.slice(d+1);for(const f of E)if(f.isShowWidget(l)){const a=f.getWidgetByEditor(l);a?.resize()}})),this.addDispose(h),this.widgets.set(l,h),l.onDispose(()=>{h.dispose(),this.widgets.delete(l)}),h}show(l){if(l){let h=this.widgets.get(l);h||(h=this.addWidgetByEditor(l)),h.show()}else this.getEditorsByUri(this.uri).forEach(u=>{var d;let E=this.widgets.get(u);E||(E=this.addWidgetByEditor(u)),!((d=u.currentUri)===null||d===void 0)&&d.isEqual(this.uri)&&E.show()})}showWidgetsIfShowed(){var l;for(const h of this.getEditorsByUri(this.uri)){let u=this.widgets.get(h);u||(u=this.addWidgetByEditor(h)),!((l=h.currentUri)===null||l===void 0)&&l.isEqual(this.uri)&&setTimeout(()=>{u.disposed||u?.show()},0)}}hideWidgetsByDispose(){var l;for(const[h,u]of this.widgets)!(!((l=h.currentUri)===null||l===void 0)&&l.isEqual(this.uri))&&u.dispose()}isShowWidget(l){if(l){const h=this.widgets.get(l);return h?h.isShow:!1}else{for(const[,h]of this.widgets)return h.isShow;return!1}}hide(l){if(l){const h=this.widgets.get(l);h?.hide()}else this.hideAll()}showAll(){(0,v.transaction)(l=>{this.isCollapsed.set(!1,l)});for(const[,l]of this.widgets)l.show();this.onDidChangeCollapsibleStateEmitter.fire(m.CommentThreadCollapsibleState.Expanded)}hideAll(l){var h;(0,v.transaction)(u=>{this.isCollapsed.set(!0,u)});for(const[u,d]of this.widgets)l?!(!((h=u.currentUri)===null||h===void 0)&&h.isEqual(this.uri))&&d.dispose():d.hide();this.onDidChangeCollapsibleStateEmitter.fire(m.CommentThreadCollapsibleState.Collapsed)}addComment(...l){const h=this.comments.get();(0,v.transaction)(u=>{this.comments.set([...h,...l.map(d=>({...d,id:(0,o.uuid)()}))],u)}),this.onDidChangeEmitter.fire()}removeComment(l){(0,v.transaction)(h=>{this.comments.set(this.comments.get().filter(u=>u!==l),h)}),this.onDidChangeEmitter.fire()}isEqual(l){return l.uri.isEqual(this.uri)&&l.range.startLineNumber===this.range.startLineNumber&&l.range.endLineNumber===this.range.endLineNumber}};t.CommentsThread=s,n.__decorate([(0,r.Autowired)(m.ICommentsService),n.__metadata("design:type",Object)],s.prototype,"commentsService",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],s.prototype,"globalContextKeyService",void 0),n.__decorate([(0,r.Autowired)(p.EditorCollectionService),n.__metadata("design:type",p.EditorCollectionService)],s.prototype,"editorCollectionService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],s.prototype,"injector",void 0),t.CommentsThread=s=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[o.URI,Object,String,Object])],s)},73804:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsZoneService=void 0;const n=e(85608),r=e(76003),o=e(93899),c=e(43718),p=e(69635),v=e(49867);let m=class extends c.Disposable{constructor(s){super(),this.thread=s}setCurrentCommentThread(s){this.commentService.setCurrentCommentThread(s)}get commentThreadTitle(){return this.registerDispose(this.menuService.createMenu(o.MenuId.CommentsCommentThreadTitle,this.thread.contextKeyService))}get commentThreadContext(){return this.registerDispose(this.menuService.createMenu(o.MenuId.CommentsCommentThreadContext,this.thread.contextKeyService))}};t.CommentsZoneService=m,n.__decorate([(0,r.Autowired)(o.AbstractMenuService),n.__metadata("design:type",o.AbstractMenuService)],m.prototype,"menuService",void 0),n.__decorate([(0,r.Autowired)(p.ICommentsService),n.__metadata("design:type",Object)],m.prototype,"commentService",void 0),n.__decorate([c.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],m.prototype,"commentThreadTitle",null),n.__decorate([c.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],m.prototype,"commentThreadContext",null),t.CommentsZoneService=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[v.CommentsThread])],m)},90366:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsZoneWidget=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),c=n.__importDefault(e(25873)),p=e(76003),v=e(41869),m=e(25918),_=e(93899),s=e(20303),g=e(69635),l=e(37357),h=e(42018),u=e(73804),d=n.__importDefault(e(38877)),E=({thread:a,widget:b})=>{const{contextKeyService:y}=a,A=(0,v.useAutorun)(a.comments),S=(0,v.useAutorun)(a.threadHeaderTitle),T=(0,v.useInjectable)(p.INJECTOR_TOKEN).get(u.CommentsZoneService,[a]),D=(0,v.useInjectable)(g.ICommentsFeatureRegistry),I=o.default.useMemo(()=>D.getFileUploadHandler(),[]),[O,M]=o.default.useState(""),R=o.default.useMemo(()=>y.createKey("commentIsEmpty",!O),[]),P=T.commentThreadTitle,k=T.commentThreadContext,F=o.default.useCallback(V=>{const{value:$}=V.target;M($),R.set(!$)},[]),L=o.default.useMemo(()=>{var V;return((V=D.getProviderFeature(a.providerId))===null||V===void 0?void 0:V.placeholder)||`${(0,v.localize)("comments.reply.placeholder")}...`},[]),B=o.default.useCallback(async V=>{if(I){const $=await I(O,V);M(Y=>{const z=Y+$;return R.set(!z),z})}},[O]);o.default.useEffect(()=>{const V=b.onFirstDisplay(()=>{setTimeout(()=>{b.coreEditor.monacoEditor.revealLine(a.range.endLineNumber+1)},0)});return()=>{V.dispose()}},[]);const j=o.default.useCallback(()=>{T.setCurrentCommentThread(T.thread)},[]),W=o.default.useCallback(()=>{T.setCurrentCommentThread(void 0)},[]),U=o.default.useCallback(()=>{T.setCurrentCommentThread(T.thread)},[]),Q=o.default.useCallback(()=>{T.setCurrentCommentThread(void 0)},[]);return o.default.createElement("div",{tabIndex:-1,onMouseOver:j,onMouseOut:W,onFocus:U,onBlur:Q,className:(0,r.default)(a.options.threadClassName,d.default.comment_container)},o.default.createElement("div",{className:(0,r.default)(a.options.threadHeadClassName,d.default.head)},o.default.createElement("div",{className:d.default.review_title},S),o.default.createElement(m.InlineActionBar,{menus:P,context:[{thread:a,widget:b,menuId:_.MenuId.CommentsCommentThreadTitle}],separator:"inline",type:"icon"})),o.default.createElement("div",{className:d.default.comment_body},A.length>0?o.default.createElement(l.CommentItem,{widget:b,commentThreadContext:k,thread:a}):o.default.createElement("div",null,o.default.createElement(h.CommentsTextArea,{focusDelay:100,initialHeight:"auto",value:O,onChange:F,placeholder:L,dragFiles:B}),o.default.createElement("div",{className:d.default.comment_bottom_actions},o.default.createElement(m.InlineActionBar,{className:d.default.comment_reply_actions,separator:"inline",type:"button",context:[{text:O,widget:b,thread:a,menuId:_.MenuId.CommentsCommentThreadContext}],menus:k})))))};let f=class extends s.ResizeZoneWidget{_fillContainer(){}constructor(b,y,A){super(b.monacoEditor,y.range,{...A,showInHiddenAreas:!0}),this.thread=y,this._onShow=new v.Emitter,this.onShow=this._onShow.event,this._onHide=new v.Emitter,this.onHide=this._onHide.event,this._editor=b,this._isShow=!y.isCollapsed.get();const S=document.createElement("div");this._container.appendChild(S),this.observeContainer(S);const w=this.commentsFeatureRegistry.getZoneWidgetRender();this.wrapperRoot=c.default.createRoot(S),this.wrapperRoot.render(o.default.createElement(v.ConfigProvider,{value:this.appConfig},w?w(this.thread,this):o.default.createElement(E,{thread:this.thread,widget:this}))),this.addDispose({dispose:()=>{var T;(T=this.wrapperRoot)===null||T===void 0||T.unmount(),this.wrapperRoot=void 0}})}get coreEditor(){return this._editor}get isShow(){return this._isShow}show(){super.show(),this._isShow=!0,this._onShow.fire()}hide(){super.hide(),this._isShow=!1,this._onHide.fire()}toggle(){this._isShow?this.hide():this.show()}applyClass(){}applyStyle(){}};t.CommentsZoneWidget=f,n.__decorate([(0,p.Autowired)(v.AppConfig),n.__metadata("design:type",Object)],f.prototype,"appConfig",void 0),n.__decorate([(0,p.Autowired)(g.ICommentsFeatureRegistry),n.__metadata("design:type",Object)],f.prototype,"commentsFeatureRegistry",void 0),t.CommentsZoneWidget=f=n.__decorate([(0,p.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Object,Object])],f)},62604:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsBrowserContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(93899),p=e(57517),v=e(63067),m=e(69635),_=e(47842);let s=class extends o.Disposable{onStart(){this.registerCommentsFeature(),this.listenToCreateCommentsPanel(),this.commentsService.init()}get panelBadge(){const l=this.commentsService.commentsThreads.length;return l?l+"":""}registerCommands(l){l.registerCommand({id:m.CollapseId,label:"%comments.panel.action.collapse%",iconClass:(0,o.getIcon)("collapse-all")},{execute:()=>{this.commentModelService.collapsedAll()}}),l.registerCommand({id:m.CloseThreadId,label:"%comments.thread.action.close%",iconClass:(0,o.getIcon)("up")},{execute:h=>{const{thread:u,widget:d}=h;u.comments.get().length?d.isShow&&d.toggle():u.dispose()}}),l.registerCommand({id:m.SwitchCommandReaction},{execute:h=>{this.eventBus.fire(new m.CommentReactionClick(h))}})}registerMenus(l){l.registerMenuItem(c.MenuId.CommentsCommentThreadTitle,{command:m.CloseThreadId,group:"inline",order:Number.MAX_SAFE_INTEGER})}registerToolbarItems(l){l.registerItem({id:m.CollapseId,viewId:m.CommentPanelId,command:m.CollapseId,tooltip:(0,o.localize)("comments.panel.action.collapse")})}registerCommentsFeature(){this.contributions.getContributions().forEach((l,h)=>{this.addDispose(this.commentsService.registerCommentRangeProvider(`contribution_${h}`,{getCommentingRanges:u=>l.provideCommentingRanges(u)})),l.registerCommentsFeature&&l.registerCommentsFeature(this.commentsFeatureRegistry)})}listenToCreateCommentsPanel(){this.commentsFeatureRegistry.getCommentsPanelOptions().defaultShow?this.commentsService.registerCommentPanel():o.Event.once(this.commentsService.onThreadsCreated)(()=>{this.commentsService.registerCommentPanel()}),this.addDispose(o.Event.debounce(this.commentsService.onThreadsChanged,()=>{},100)(()=>{const l=this.layoutService.getTabbarHandler(m.CommentPanelId);l?.setBadge(this.panelBadge)},this))}registerEditorFeature(l){l.registerEditorFeatureContribution({contribute:h=>this.commentsService.handleOnCreateEditor(h),provideEditorOptionsForUri:async h=>(await this.commentsService.getContributionRanges(h)).length?{lineDecorationsWidth:25,lineNumbersMinChars:5}:{}})}};t.CommentsBrowserContribution=s,n.__decorate([(0,r.Autowired)(m.ICommentsService),n.__metadata("design:type",Object)],s.prototype,"commentsService",void 0),n.__decorate([(0,r.Autowired)(v.IMainLayoutService),n.__metadata("design:type",Object)],s.prototype,"layoutService",void 0),n.__decorate([(0,r.Autowired)(m.ICommentsFeatureRegistry),n.__metadata("design:type",Object)],s.prototype,"commentsFeatureRegistry",void 0),n.__decorate([(0,r.Autowired)(m.CommentsContribution),n.__metadata("design:type",Object)],s.prototype,"contributions",void 0),n.__decorate([(0,r.Autowired)(o.IEventBus),n.__metadata("design:type",Object)],s.prototype,"eventBus",void 0),n.__decorate([(0,r.Autowired)(_.CommentModelService),n.__metadata("design:type",_.CommentModelService)],s.prototype,"commentModelService",void 0),t.CommentsBrowserContribution=s=n.__decorate([(0,o.Domain)(o.ClientAppContribution,p.BrowserEditorContribution,o.CommandContribution,o.TabBarToolbarContribution,c.MenuContribution)],s)},55011:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsService=void 0;const n=e(85608),r=n.__importDefault(e(53435)),o=n.__importDefault(e(87809)),c=e(76003),p=e(41869),v=e(57517),m=e(63067),_=e(20868),s=n.__importStar(e(20868)),g=e(62663),l=e(52416),h=n.__importStar(e(24347)),u=e(69635),d=e(53878),E=e(49867),f=e(53711);let a=class extends p.Disposable{constructor(){super(...arguments),this.decorationChangeEmitter=new p.Emitter,this.threads=new Map,this.threadsChangeEmitter=new p.Emitter,this.threadsCommentChangeEmitter=new p.Emitter,this.commentRangeProviderChangeEmitter=new p.Emitter,this.onDidChangeCurrentCommentThreadEmitter=new p.Emitter,this.threadsCreatedEmitter=new p.Emitter,this.rangeProviderMap=new Map,this.rangeOwner=new Map,this.providerDecorationCache=new p.LRUCache(1e4),this.commentRangeDecorationMap=new Map,this.shouldShowCommentsSchemes=new Set(["file","git","diff"]),this.decorationProviderDisposer=p.Disposable.NULL,this.activeThreadDecorationIds=[],this.allEditors=[],this.editorCommentingRangeSpaceReservedMap=new Map,this.editorLineDecorationsWidthMap=new Map}get commentsThreads(){return[...this.threads.values()]}get isMultiCommentsForSingleLine(){var y;return!!(!((y=this.commentsFeatureRegistry.getConfig())===null||y===void 0)&&y.isMultiCommentsForSingleLine)}get currentAuthorAvatar(){var y,A;return(A=(y=this.commentsFeatureRegistry.getConfig())===null||y===void 0?void 0:y.author)===null||A===void 0?void 0:A.avatar}get filterThreadDecoration(){var y;return(y=this.commentsFeatureRegistry.getConfig())===null||y===void 0?void 0:y.filterThreadDecoration}get onThreadsChanged(){return this.threadsChangeEmitter.event}get onThreadsCommentChange(){return this.threadsCommentChangeEmitter.event}get onThreadsCreated(){return this.threadsCreatedEmitter.event}get onCommentRangeProviderChange(){return this.commentRangeProviderChangeEmitter.event}get onDidChangeCurrentCommentThread(){return this.onDidChangeCurrentCommentThreadEmitter.event}setCurrentCommentThread(y){this.onDidChangeCurrentCommentThreadEmitter.fire(y)}createThreadDecoration(y){var A;const S=y.comments.get(),w=S.length===0?this.currentAuthorAvatar:(A=S[0].author.iconPath)===null||A===void 0?void 0:A.toString(),T=w?`${this.iconService.fromIcon("",w,l.IconType.Background)} avatar-icon`:this.iconService.fromString("$(comment)"),D={description:"comments-thread-decoration",glyphMarginClassName:w?["comment-thread",T].join(" "):["comment-range","comment-thread",T].join(" ")};return h.ModelDecorationOptions.createDynamic(D)}updateActiveThreadDecoration(y){var A;const S=this.getCurrentEditor(y?.uri);if(!S)return;(A=this.currentThreadCollapseStateListener)===null||A===void 0||A.dispose();const w=[];if(y){const T=y.range;y.isCollapsed.get()||(this.currentThreadCollapseStateListener=y.onDidChangeCollapsibleState(D=>{D===u.CommentThreadCollapsibleState.Collapsed&&this.updateActiveThreadDecoration(void 0)}),w.push({range:T,options:this.createThreadRangeActiveDecoration()}))}this.activeThreadDecorationIds=S.monacoEditor.deltaDecorations(this.activeThreadDecorationIds,w)}createDottedRangeDecoration(){const y={description:"comments-multiline-hover-decoration",linesDecorationsClassName:["comment-range","multiline-add"].join(" ")};return h.ModelDecorationOptions.createDynamic(y)}createHoverDecoration(){const y={description:"comments-hover-decoration",linesDecorationsClassName:["comment-range","line-hover","comment-add"].join(" ")};return h.ModelDecorationOptions.createDynamic(y)}createThreadRangeActiveDecoration(){const y={description:"comments-thread-range-active-decoration",isWholeLine:!1,zIndex:20,className:"comment-thread-range-current",shouldFillLineOnLineBreak:!0};return h.ModelDecorationOptions.createDynamic(y)}createThreadRangeDecoration(){const y={description:"comments-thread-range-decoration",isWholeLine:!1,zIndex:20,className:"comment-thread-range",shouldFillLineOnLineBreak:!0};return h.ModelDecorationOptions.createDynamic(y)}createCommentRangeDecoration(){const y={description:"comments-range-decoration",linesDecorationsClassName:["comment-range","comment-diff-added"].join(" ")};return h.ModelDecorationOptions.createDynamic(y)}init(){const y=this.resourceService.getSupportedSchemes();for(const A of y)this.shouldShowCommentsSchemes.add(A);this.addDispose(this.resourceService.onRegisterResourceProvider(A=>{A.scheme&&(this.shouldShowCommentsSchemes.add(A.scheme),this.registerDecorationProvider())})),this.addDispose(this.resourceService.onUnregisterResourceProvider(A=>{A.scheme&&(this.shouldShowCommentsSchemes.delete(A.scheme),this.registerDecorationProvider())})),this.registerDecorationProvider()}getCurrentEditor(y){var A;if(y){for(const S of this.allEditors)if(!((A=S.currentUri)===null||A===void 0)&&A.isEqual(y))return this.editor=S,S}return this.editor}handleOnCreateEditor(y){this.allEditors.push(y),this.editor=y;const A=new p.Disposable;let S=[],w=!1;return A.addDispose(y.monacoEditor.onMouseDown(T=>{if(T.target.type===g.monacoBrowser.editor.MouseTargetType.GUTTER_LINE_DECORATIONS&&T.target.element&&T.target.element.className.indexOf("comment-add")>-1){const{target:D}=T;if(D&&D.range){const{range:I}=D;this.startCommentRange=I,T.event.stopPropagation()}}else if(T.target.type===g.monacoBrowser.editor.MouseTargetType.GUTTER_GLYPH_MARGIN&&T.target.element&&T.target.element.className.indexOf("comment-thread")>-1){const{target:D}=T;if(D&&D.range){const{range:I}=D,O=this.commentsThreads.filter(M=>y.currentUri&&M.uri.isEqual(y.currentUri)&&M.range.endLineNumber===I.endLineNumber);O.length&&(O.some(R=>R.isShowWidget(y))?O.forEach(R=>R.hide(y)):O.forEach(R=>R.show(y)))}T.event.stopPropagation()}})),A.addDispose(y.monacoEditor.onMouseUp(async T=>{if(this.startCommentRange){if(w){this.renderCommentRange(y),w=!1,this.startCommentRange=null,this.endCommentRange=null;return}let D=this.startCommentRange;this.endCommentRange&&(this.endCommentRange.startLineNumber<this.startCommentRange.startLineNumber?(D.startColumn=this.endCommentRange.startColumn,D.startLineNumber=this.endCommentRange.startLineNumber):(D.endColumn=this.endCommentRange.endColumn,D.endLineNumber=this.endCommentRange.endLineNumber)),y.currentUri&&(D=await this.getValidRange(D,y.currentUri)),D&&(this.commentsThreads.some(I=>I.comments.get().length===0&&y.currentUri&&I.uri.isEqual(y.currentUri)&&I.range.startLineNumber===D.startLineNumber&&I.range.endLineNumber===D.endLineNumber)||this.createThread(y.currentUri,D).show(y),T.event.stopPropagation())}else if(T.target.type===g.monacoBrowser.editor.MouseTargetType.GUTTER_LINE_DECORATIONS&&T.target.element&&T.target.element.className.indexOf("comment-range")>-1&&T.target.element.className.indexOf("comment-thread")<0){const{target:D}=T,I=D.range;I&&(this.commentsThreads.some(O=>O.comments.get().length===0&&y.currentUri&&O.uri.isEqual(y.currentUri)&&O.range.startLineNumber===I.startLineNumber&&O.range.endLineNumber===I.endLineNumber)||this.createThread(y.currentUri,I).show(y),T.event.stopPropagation())}this.startCommentRange=null,this.endCommentRange=null})),A.addDispose(y.monacoEditor.onMouseMove(async T=>{var D,I,O;const M=y.currentUri,R=T.target.range;if(this.startCommentRange){if(!((D=T.target.element)===null||D===void 0)&&D.className||!((O=(I=T.target.element)===null||I===void 0?void 0:I.offsetParent)===null||O===void 0)&&O.className.includes("diff-hidden-lines")&&(w=!0),M&&R){let P={startLineNumber:this.startCommentRange.startLineNumber,endLineNumber:R.endLineNumber,startColumn:this.startCommentRange.startColumn,endColumn:R.endColumn};this.startCommentRange.startLineNumber>R.startLineNumber&&(P={startLineNumber:R.startLineNumber,endLineNumber:this.startCommentRange.endLineNumber,startColumn:R.startColumn,endColumn:this.startCommentRange.endColumn}),this.renderCommentRange(y,P),this.endCommentRange=R}}else if(M&&R&&await this.shouldShowHoverDecoration(M,R)){const P=[{range:(0,_.positionToRange)(R.startLineNumber),options:this.createHoverDecoration()}];S=y.monacoEditor.deltaDecorations(S,P)}})),A.addDispose(y.monacoEditor.onMouseLeave(async T=>{var D;const I=(D=T.target)===null||D===void 0?void 0:D.range,O=[];!this.startCommentRange&&I&&O.push({range:(0,_.positionToRange)(I.startLineNumber),options:this.createCommentRangeDecoration()}),S=y.monacoEditor.deltaDecorations(S,O)})),A.addDispose(this.onCommentRangeProviderChange(()=>{this.renderCommentRange(y)})),A.addDispose(p.Event.any(this.onThreadsChanged,this.onThreadsCommentChange,this.onThreadsCreated)(T=>{const D=this.getCurrentEditor(T.uri);D&&this.renderCommentRange(D),this.updateActiveThreadDecoration(void 0)})),A.addDispose(this.onDidChangeCurrentCommentThread(T=>{this.updateActiveThreadDecoration(T)})),this.tryUpdateReservedSpace(y),A.addDispose(y.monacoEditor.onDidChangeModel(()=>{this.renderCommentRange(y),this.tryUpdateReservedSpace(y)})),A}async getValidRange(y,A){if(!A)return y;const S=await this.getContributionRanges(A);if(S.length===0)return y;const w=S.find(T=>{if(y.startLineNumber>=T.startLineNumber&&y.startLineNumber<=T.endLineNumber)return!0});return w&&w.endLineNumber<y.endLineNumber?{startLineNumber:y.startLineNumber,startColumn:y.startColumn,endLineNumber:w.endLineNumber,endColumn:w.endColumn}:y}ensureCommentingRangeReservedAmount(y){const A=this.getExistingCommentEditorOptions(y),S=this.editorLineDecorationsWidthMap.get(y.getId());A.lineDecorationsWidth!==S&&y.updateOptions({lineDecorationsWidth:this.getWithCommentsLineDecorationWidth(y,A.lineDecorationsWidth)})}async tryUpdateReservedSpace(y){if(!y)return;let A=this.editorCommentingRangeSpaceReservedMap.get(y.getId())||!1;const S=y.currentUri?this.shouldShowCommentsSchemes.has(y.currentUri.scheme):!1,w=this.commentsThreads.some(D=>y.currentUri&&D.uri.isEqual(y.currentUri)&&D.comments.get().length>0),T=S||w;if(T)if(A)this.ensureCommentingRangeReservedAmount(y);else{A=!0;const{lineDecorationsWidth:D,extraEditorClassName:I}=this.getExistingCommentEditorOptions(y),O=this.getWithCommentsEditorOptions(y,I,D);this.updateEditorLayoutOptions(y,O.extraEditorClassName,O.lineDecorationsWidth)}else if(!T&&A){A=!1;const{lineDecorationsWidth:D,extraEditorClassName:I}=this.getExistingCommentEditorOptions(y),O=this.getWithoutCommentsEditorOptions(y,I,D);this.updateEditorLayoutOptions(y,O.extraEditorClassName,O.lineDecorationsWidth)}this.editorCommentingRangeSpaceReservedMap.set(y.getId(),A)}getExistingCommentEditorOptions(y){const A=y.monacoEditor.getOption(s.EditorOption.lineDecorationsWidth);let S=[];const w=y.monacoEditor.getRawOptions().extraEditorClassName;return w&&(S=w.split(" ")),{lineDecorationsWidth:A,extraEditorClassName:S}}getWithoutCommentsEditorOptions(y,A,S){let w=S;const T=A.findIndex(I=>I==="inline-comment");T>=0&&A.splice(T,1);const D=y.monacoEditor.getOptions();return D.get(s.EditorOption.folding)&&D.get(s.EditorOption.showFoldingControls)!=="never"&&(w+=11),w-=24,{extraEditorClassName:A,lineDecorationsWidth:w}}updateEditorLayoutOptions(y,A,S){y.updateOptions({extraEditorClassName:A.join(" "),lineDecorationsWidth:S})}getWithCommentsEditorOptions(y,A,S){return A.push("inline-comment"),{lineDecorationsWidth:this.getWithCommentsLineDecorationWidth(y,S),extraEditorClassName:A}}getWithCommentsLineDecorationWidth(y,A){let S=A;const w=y.monacoEditor.getOptions();return w.get(s.EditorOption.folding)&&w.get(s.EditorOption.showFoldingControls)!=="never"&&(S-=11),S+=24,this.editorLineDecorationsWidthMap.set(y.getId(),S),S}async renderCommentRange(y,A={startLineNumber:0,endLineNumber:0,startColumn:0,endColumn:0}){if(!y.currentUri)return;const S=await this.getContributionRanges(y.currentUri);if(S.length>0){const w=[];S.map(D=>{if(A.startLineNumber===0&&A.endLineNumber===0)w.push({range:D,options:this.createCommentRangeDecoration()});else if(A.startLineNumber<=D.startLineNumber&&A.endLineNumber>=D.endLineNumber)w.push({range:D,options:this.createDottedRangeDecoration()},{range:D,options:this.createThreadRangeDecoration()});else if(A.endLineNumber>=D.endLineNumber)if(A.startLineNumber<=D.endLineNumber){const I={startLineNumber:A.startLineNumber,endLineNumber:D.endLineNumber,startColumn:A.startColumn,endColumn:D.endColumn},O={startLineNumber:D.startLineNumber,endLineNumber:I.startLineNumber-1,startColumn:D.startColumn,endColumn:I.endColumn};w.push({range:O,options:this.createCommentRangeDecoration()},{range:I,options:this.createDottedRangeDecoration()},{range:I,options:this.createThreadRangeDecoration()})}else w.push({range:D,options:this.createCommentRangeDecoration()});else if(A.endLineNumber<D.endLineNumber)if(A.endLineNumber>=D.startLineNumber)if(A.startLineNumber>=D.startLineNumber){const I={startLineNumber:D.startLineNumber,startColumn:D.startColumn,endLineNumber:A.startLineNumber-1,endColumn:A.startColumn},O={startLineNumber:A.endLineNumber+1,startColumn:A.endColumn,endLineNumber:D.endLineNumber,endColumn:D.endColumn},M=A.startLineNumber!==D.startLineNumber?[{range:I,options:this.createCommentRangeDecoration()}]:[];M.push({range:A,options:this.createDottedRangeDecoration()}),M.push({range:A,options:this.createThreadRangeDecoration()}),M.push({range:O,options:this.createCommentRangeDecoration()}),w.push(...M)}else{const I={startLineNumber:D.startLineNumber,startColumn:D.startColumn,endLineNumber:A.endLineNumber,endColumn:A.endColumn},O={startLineNumber:I.endLineNumber+1,startColumn:I.endColumn,endLineNumber:D.endLineNumber,endColumn:D.endColumn};w.push({range:I,options:this.createDottedRangeDecoration()},{range:I,options:this.createThreadRangeDecoration()},{range:O,options:this.createCommentRangeDecoration()})}else w.push({range:D,options:this.createCommentRangeDecoration()})});const T=this.commentRangeDecorationMap.get(y.currentUri.toString())||[];this.commentRangeDecorationMap.set(y.currentUri.toString(),y.monacoEditor.deltaDecorations(T,w))}else this.commentRangeDecorationMap.set(y.currentUri.toString(),[])}async shouldShowHoverDecoration(y,A){return this.shouldShowCommentsSchemes.has(y.scheme)?(await this.getContributionRanges(y)).some(T=>A.startLineNumber<=T.endLineNumber):!1}createThread(y,A,S={comments:[],readOnly:!1}){const w=this.getProviderIdsByLine(A.endLineNumber)[0],T=this.injector.get(E.CommentsThread,[y,A,w,S]);return T.onDispose(()=>{this.threads.delete(T.id),this.threadsChangeEmitter.fire(T),this.decorationChangeEmitter.fire(y)}),T.onDidChange(()=>{this.threadsChangeEmitter.fire(T)}),this.threads.set(T.id,T),this.addDispose(T),this.threadsChangeEmitter.fire(T),this.threadsCreatedEmitter.fire(T),this.decorationChangeEmitter.fire(y),T}getThreadsByUri(y){return this.commentsThreads.filter(A=>A.uri.isEqual(y)).sort((A,S)=>A.range.startLineNumber-S.range.startLineNumber)}handleCommentFileNode(y){const A=[],S=[...this.threads.values()].filter(T=>T.comments.get().length),w=(0,o.default)(S,T=>T.uri);return Object.keys(w).map(T=>{var D;const I=w[T];if(I.length===0)return;const O=new p.URI(this.appConfig.workspaceDir),M=new p.URI(T),R=(D=O.relative(M))===null||D===void 0?void 0:D.toString();A.push(new f.CommentFileNode(this,I,R,M.codeUri.fsPath,this.labelService.getIcon(M),M,y))}),A}handleCommentContentNode(y){var A;const S=[];for(const w of y.threads){const T=w.comments.get(),[D]=T,I=typeof D.body=="string"?D.body:D.body.value;let O=`[Ln ${w.range.startLineNumber}]`;w.range.startLineNumber!==w.range.endLineNumber&&(O=`[Ln ${w.range.startLineNumber}-${w.range.endLineNumber}]`),S.push(new f.CommentContentNode(this,w,I,O,D.author.iconPath&&(!((A=D.author.iconPath)===null||A===void 0)&&A.authority)?this.iconService.fromIcon("",D.author.iconPath.toString(),l.IconType.Background):(0,p.getIcon)("message"),D.author,y.resource,y))}return S}handleCommentReplyNode(y){const A=[],S=y.thread,w=S.comments.get(),[T,...D]=w,I=D[D.length-1].author.name;return A.push(new f.CommentReplyNode(this,S,(0,p.formatLocalize)("comment.reply.count",D?.length||0),(0,p.formatLocalize)("comment.reply.lastReply",I),"",y.resource,y)),A}async resolveChildren(y){let A=[];if(y?f.CommentRoot.isRoot(y)?A=this.handleCommentFileNode(y):f.CommentFileNode.is(y)?A=this.handleCommentContentNode(y):f.CommentContentNode.is(y)&&(A=this.handleCommentReplyNode(y)):A.push(new f.CommentRoot(this)),A.length===1&&f.CommentRoot.isRoot(A[0]))return A;const S=this.commentsFeatureRegistry.getCommentsPanelTreeNodeHandlers();if(S.length>0)for(const w of S)A=w(A);return A}async getContributionRanges(y){const A=this.providerDecorationCache.get(y.toString());if(A)return await A.promise;const S=this.documentService.getModelReference(y,"Get Comment Range"),w=[];for(const O of this.rangeProviderMap){const[M,R]=O;w.push((async()=>{if(!S?.instance)return;const P=await R.getCommentingRanges(S.instance);return P&&P.length&&this.rangeOwner.set(M,P),P})())}const T=new p.Deferred;this.providerDecorationCache.set(y.toString(),T);const D=(await Promise.all(w)).filter(Boolean);S?.dispose();const I=(0,r.default)(D).filter(Boolean);return T.resolve(I),I}fireThreadCommentChange(y){this.threadsCommentChangeEmitter.fire(y)}registerDecorationProvider(){this.decorationProviderDisposer.dispose(),this.decorationProviderDisposer=this.editorDecorationCollectionService.registerDecorationProvider({schemes:[...this.shouldShowCommentsSchemes.values()],key:"comments",onDidDecorationChange:this.decorationChangeEmitter.event,provideEditorDecoration:y=>this.commentsThreads.map(A=>(A.uri.codeUri.path===y.codeUri.path?A.comments.get().length&&A.showWidgetsIfShowed():A.hide(),A)).filter(A=>{const S=A.uri.isEqual(y);return this.filterThreadDecoration?S&&this.filterThreadDecoration(A):S}).map(A=>({range:{startLineNumber:A.range.endLineNumber,endLineNumber:A.range.endLineNumber,startColumn:A.range.endColumn,endColumn:A.range.endColumn},options:this.createThreadDecoration(A)}))}),this.addDispose(this.decorationProviderDisposer)}registerCommentPanel(){this.layoutService.getTabbarHandler(u.CommentPanelId)||this.layoutService.collectTabbarComponent([{id:u.CommentPanelId,component:d.CommentsPanel}],{badge:this.panelBadge,containerId:u.CommentPanelId,title:(0,p.localize)("comments").toUpperCase(),hidden:!1,activateKeyBinding:"ctrlcmd+shift+c",...this.commentsFeatureRegistry.getCommentsPanelOptions()},"bottom")}get panelBadge(){const y=this.commentsThreads.length;return y?y+"":""}registerCommentRangeProvider(y,A){return this.rangeProviderMap.set(y,A),this.providerDecorationCache.clear(),this.commentRangeProviderChangeEmitter.fire(),p.Disposable.create(()=>{this.rangeProviderMap.delete(y),this.rangeOwner.delete(y),this.providerDecorationCache.clear()})}forceUpdateDecoration(){var y,A,S;const w=(y=this.workbenchEditorService.currentEditor)===null||y===void 0?void 0:y.currentUri;w&&this.decorationChangeEmitter.fire(w);const T=(S=(A=this.workbenchEditorService.currentEditorGroup)===null||A===void 0?void 0:A.diffEditor)===null||S===void 0?void 0:S.originalEditor.currentUri;T&&this.decorationChangeEmitter.fire(T)}getProviderIdsByLine(y){const A=[];if(this.rangeOwner.size===1)return[this.rangeOwner.keys().next().value];for(const S of this.rangeOwner){const[w,T]=S;T&&T.some(D=>D.startLineNumber<=y&&y<=D.endLineNumber)&&A.push(w)}return A}};t.CommentsService=a,n.__decorate([(0,c.Autowired)(c.INJECTOR_TOKEN),n.__metadata("design:type",c.Injector)],a.prototype,"injector",void 0),n.__decorate([(0,c.Autowired)(p.AppConfig),n.__metadata("design:type",Object)],a.prototype,"appConfig",void 0),n.__decorate([(0,c.Autowired)(v.IEditorDecorationCollectionService),n.__metadata("design:type",Object)],a.prototype,"editorDecorationCollectionService",void 0),n.__decorate([(0,c.Autowired)(l.IIconService),n.__metadata("design:type",Object)],a.prototype,"iconService",void 0),n.__decorate([(0,c.Autowired)(p.LabelService),n.__metadata("design:type",p.LabelService)],a.prototype,"labelService",void 0),n.__decorate([(0,c.Autowired)(u.ICommentsFeatureRegistry),n.__metadata("design:type",Object)],a.prototype,"commentsFeatureRegistry",void 0),n.__decorate([(0,c.Autowired)(v.IEditorDocumentModelService),n.__metadata("design:type",Object)],a.prototype,"documentService",void 0),n.__decorate([(0,c.Autowired)(m.IMainLayoutService),n.__metadata("design:type",Object)],a.prototype,"layoutService",void 0),n.__decorate([(0,c.Autowired)(v.WorkbenchEditorService),n.__metadata("design:type",v.WorkbenchEditorService)],a.prototype,"workbenchEditorService",void 0),n.__decorate([(0,c.Autowired)(v.ResourceService),n.__metadata("design:type",v.ResourceService)],a.prototype,"resourceService",void 0),n.__decorate([p.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],a.prototype,"isMultiCommentsForSingleLine",null),n.__decorate([p.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],a.prototype,"currentAuthorAvatar",null),n.__decorate([p.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],a.prototype,"filterThreadDecoration",null),t.CommentsService=a=n.__decorate([(0,c.Injectable)()],a)},54230:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsModule=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(69635),p=e(66480),v=e(62604),m=e(55011),_=e(47842);let s=class extends o.BrowserModule{constructor(){super(...arguments),this.contributionProvider=c.CommentsContribution,this.providers=[{token:c.ICommentsService,useClass:m.CommentsService},{token:_.CommentModelService,useClass:_.CommentModelService},{token:c.ICommentsFeatureRegistry,useClass:p.CommentsFeatureRegistry},v.CommentsBrowserContribution]}};t.CommentsModule=s,t.CommentsModule=s=n.__decorate([(0,r.Injectable)()],s)},70154:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.markdownCss=void 0,t.markdownCss=`
|
|
31472
31472
|
h1, h2, h3, h4, h5, h6, p {
|
|
31473
31473
|
color: var(--foreground);
|
|
31474
31474
|
word-break: break-all;
|
|
@@ -31515,7 +31515,7 @@ ${a}`)}return this.keybindingsChanged.fire({affectsCommands:[E.command]}),{dispo
|
|
|
31515
31515
|
}
|
|
31516
31516
|
`}async selectDebugType(){const y=this.workbenchEditorService.currentEditor;if(!y)return;const A=y.currentDocumentModel;if(!A)return;const S=await this.debug.getDebuggersForLanguage(A.languageId);return this.quickPick.show(S.map(({label:w,type:T})=>({label:w,value:T}),{placeholder:"Select Environment"}))}async load(){await this.whenReady;const y=this.debugConfigurationStorage.get("configurations");y&&y.current&&(this.current=this.find(y.current.name,y.current.workspaceFolderUri,y.current.index))}async save(){const y={},{current:A}=this;A&&(y.current={name:A.configuration.name,workspaceFolderUri:A.workspaceFolderUri,index:A.index}),await this.debugConfigurationStorage.set("configurations",y)}canSetBreakpointsIn(y){if(!y)return!1;const A=y.getLanguageId();return!A||A==="jsonc"||A==="log"?!1:this.debugPreferences["preference.debug.allowBreakpointsEverywhere"]?!0:this.breakpointModeIdsSet.has(A)}addSupportBreakpoints(y){this.breakpointModeIdsSet.add(y)}removeSupportBreakpoints(y){this.breakpointModeIdsSet.delete(y)}registerDebugger(y){if(y.type!=="*"){if(this.getDebugger(y.type))return;this.debuggers.push(y)}}getDebugger(y){return this.debuggers.filter(A=>A.type===y).pop()}getDebuggers(){return this.debuggers.filter(y=>!!y)}getDebuggerLabel(y){const A=this.internalDebugConfigurationOverride.get(y);if(A)return A.label||y;const S=this.internalDebugConfigurationProviders.get(y);if(S)return S.label||y;const w=this.getDebugger(y);if(w)return w.label||y}getDebuggerExtraPopupHint(y){const A=this.internalDebugConfigurationOverride.get(y);if(A)return A.popupHint||void 0;const S=this.internalDebugConfigurationProviders.get(y);if(S)return S.popupHint||void 0}};t.DebugConfigurationManager=a,a.DEFAULT_UPDATE_MODEL_TIMEOUT=500,r.__decorate([(0,c.Autowired)(g.IWorkspaceService),r.__metadata("design:type",Object)],a.prototype,"workspaceService",void 0),r.__decorate([(0,c.Autowired)(v.WorkbenchEditorService),r.__metadata("design:type",v.WorkbenchEditorService)],a.prototype,"workbenchEditorService",void 0),r.__decorate([(0,c.Autowired)(u.IDebugServer),r.__metadata("design:type",Object)],a.prototype,"debug",void 0),r.__decorate([(0,c.Autowired)(s.QuickPickService),r.__metadata("design:type",Object)],a.prototype,"quickPick",void 0),r.__decorate([(0,c.Autowired)(p.IContextKeyService),r.__metadata("design:type",Object)],a.prototype,"contextKeyService",void 0),r.__decorate([(0,c.Autowired)(_.IFileServiceClient),r.__metadata("design:type",Object)],a.prototype,"filesystem",void 0),r.__decorate([(0,c.Autowired)(p.PreferenceService),r.__metadata("design:type",Object)],a.prototype,"preferences",void 0),r.__decorate([(0,c.Autowired)(p.PreferenceConfigurations),r.__metadata("design:type",p.PreferenceConfigurations)],a.prototype,"preferenceConfigurations",void 0),r.__decorate([(0,c.Autowired)(l.WorkspaceVariableContribution),r.__metadata("design:type",l.WorkspaceVariableContribution)],a.prototype,"workspaceVariables",void 0),r.__decorate([(0,c.Autowired)(p.StorageProvider),r.__metadata("design:type",Function)],a.prototype,"storageProvider",void 0),r.__decorate([(0,c.Autowired)(p.CommandService),r.__metadata("design:type",Object)],a.prototype,"commandService",void 0),r.__decorate([(0,c.Autowired)(f.DebugPreferences),r.__metadata("design:type",Object)],a.prototype,"debugPreferences",void 0),r.__decorate([(0,c.Autowired)(m.IEditorDocumentModelService),r.__metadata("design:type",Object)],a.prototype,"documentService",void 0),r.__decorate([(0,c.Autowired)(m.EditorCollectionService),r.__metadata("design:type",m.EditorCollectionService)],a.prototype,"editorCollectionService",void 0),r.__decorate([(0,c.Autowired)(p.ILoggerManagerClient),r.__metadata("design:type",Object)],a.prototype,"loggerManagerClient",void 0),t.DebugConfigurationManager=a=n=r.__decorate([(0,c.Injectable)(),r.__metadata("design:paramtypes",[])],a)},11357:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConfigurationModel=void 0;const n=e(41869),r=e(64582);class o{constructor(p,v){this.workspaceFolderUri=p,this.preferences=v,this.onDidChangeEmitter=new n.Emitter,this.onDidChange=this.onDidChangeEmitter.event,this.toDispose=new n.DisposableCollection(this.onDidChangeEmitter),this.reconcile(),this.toDispose.push(this.preferences.onPreferenceChanged(m=>{m.preferenceName==="launch"&&m.affects(p)&&this.reconcile()}))}get uri(){return this.json.uri}dispose(){this.toDispose.dispose()}get onDispose(){return this.toDispose.onDispose}get configurations(){return this.json.configurations}async reconcile(){this.json=this.parseConfigurations(),this.onDidChangeEmitter.fire(void 0)}parseConfigurations(){const p=[],{configUri:v,value:m}=this.preferences.resolve("launch",void 0,this.workspaceFolderUri);if((0,n.isDefined)(m)&&"configurations"in m&&Array.isArray(m.configurations))for(const _ of m.configurations)r.DebugConfiguration.is(_)&&p.push(_);return{uri:v,configurations:p}}}t.DebugConfigurationModel=o},59053:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugContribution=t.DebugBreakpointWidgetCommands=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(21634),p=e(68456),v=e(93899),m=e(43718),_=e(57517),s=e(14951),g=e(2156),l=e(63067),h=e(24429),u=n.__importStar(e(20868)),d=e(64582),E=e(4983),f=e(99797),a=e(85815),b=e(17280),y=e(37499),A=e(31141),S=e(40453),w=e(69946),T=e(38029),D=e(52943),I=e(78606),O=n.__importDefault(e(96547)),M=e(97319),R=e(85347),P=e(16067),k=e(20676),F=e(96090),L=e(35199),B=e(32756),j=e(18028),W=e(28875),U=e(64611),Q=/launch\.json$/;var V;(function(z){z[z.json=0]="json",z[z.editor=1]="editor"})(V||(V={}));var $;(function(z){z.ACCEPT={id:"debug.breakpointWidget.accept"},z.CLOSE={id:"debug.breakpointWidget.close"}})($||(t.DebugBreakpointWidgetCommands=$={}));let Y=class{constructor(){this.schema=A.debugPreferencesSchema,this.firstSessionStart=!0,this.openedViewSessions=new Set}get selectedBreakpoint(){const{selectedBreakpoint:H}=this.breakpointManager;return H}registerEditorComponent(H){H.registerEditorSideWidget({id:d.DEBUG_FLOATING_CLICK_WIDGET,component:a.FloatingClickWidget,displaysOnResource:K=>{const{configUri:Z}=this.preferences.resolve("launch");return Z?Z.isEqual(K.uri)&&Q.test(K.uri.toString()):!1}})}registerComponent(H){H.register("@opensumi/ide-debug",[{component:U.DebugWatchView,id:d.DEBUG_WATCH_ID,name:(0,o.localize)("debug.watch.title"),when:`${E.CONTEXT_DEBUGGERS_AVAILABLE.equalsTo(!0)} || ${E.CONTEXT_IN_DEBUG_MODE.equalsTo(!0)}`,collapsed:!1},{component:j.DebugCallStackView,id:d.DEBUG_STACK_ID,name:(0,o.localize)("debug.callStack.title"),when:`${E.CONTEXT_DEBUGGERS_AVAILABLE.equalsTo(!0)} || ${E.CONTEXT_IN_DEBUG_MODE.equalsTo(!0)}`,collapsed:!1},{component:W.DebugVariableView,id:d.DEBUG_VARIABLES_ID,name:(0,o.localize)("debug.variables.title"),when:`${E.CONTEXT_DEBUGGERS_AVAILABLE.equalsTo(!0)} || ${E.CONTEXT_IN_DEBUG_MODE.equalsTo(!0)}`,collapsed:!1},{component:R.DebugBreakpointView,id:d.DEBUG_BREAKPOINTS_ID,name:(0,o.localize)("debug.breakpoints.title"),when:`${E.CONTEXT_DEBUGGERS_AVAILABLE.equalsTo(!0)} || ${E.CONTEXT_IN_DEBUG_MODE.equalsTo(!0)}`,collapsed:!1},{component:h.WelcomeView,id:d.DEBUG_WELCOME_ID,name:"Debug Welcome",when:`${E.CONTEXT_DEBUGGERS_AVAILABLE.equalsTo(!1)} && ${E.CONTEXT_IN_DEBUG_MODE.equalsTo(!1)}`,initialProps:{viewId:d.DEBUG_WELCOME_ID}}],{iconClass:(0,o.getIcon)("debug"),priority:7,title:(0,o.localize)("debug.container.title"),containerId:d.DEBUG_CONTAINER_ID,titleComponent:k.DebugConfigurationContainerView,activateKeyBinding:"ctrlcmd+shift+d"})}async initialize(){this.fileSystem.registerProvider(d.DEBUG_SCHEME,this.shadowFileServiceProvider),this.debugEditorController.init(),this.debugProgressService.run(this.sessionManager)}onStart(){this.viewsRegistry.registerViewWelcomeContent(d.DEBUG_WELCOME_ID,{content:(0,o.formatLocalize)("welcome-view.noLaunchJson",o.COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION.id,d.DEBUG_COMMANDS.SHOW_ALL_AUTOMATIC_DEBUG_CONFIGURATIONS.id),when:"default"}),this.sessionManager.onDidCreateDebugSession(H=>{this.debugModel.init(H)}),this.sessionManager.onDidStartDebugSession(H=>{const{internalConsoleOptions:K}=H.configuration,Z=H.configuration.openDebug||this.debugPreferences["debug.openDebug"];if(Z==="openOnSessionStart"||Z==="openOnFirstSessionStart")this.firstSessionStart&&this.openDebugView();else if(Z!=="neverOpen"){const X=H.parentSession,ie=X?.id||H.id;this.openedViewSessions.has(ie)||(this.openedViewSessions.add(ie),this.openDebugView())}(K==="openOnSessionStart"||K==="openOnFirstSessionStart"&&this.firstSessionStart)&&this.openDebugConsoleView(),this.firstSessionStart=!1,this.commandService.tryExecuteCommand("statusbar.changeBackgroundColor","var(--statusBar-debuggingBackground)"),this.commandService.tryExecuteCommand("statusbar.changeColor","var(--statusBar-debuggingForeground)")}),this.sessionManager.onDidStopDebugSession(H=>{const{openDebug:K}=H.configuration;K==="openOnDebugBreak"&&this.openDebugView()}),this.sessionManager.onDidDestroyDebugSession(()=>{this.sessionManager.sessions.length===0&&(this.commandService.tryExecuteCommand("statusbar.changeBackgroundColor","var(--statusBar-background)"),this.commandService.tryExecuteCommand("statusbar.changeColor"))}),this.configurations.whenReady.then(()=>{this.configurations.load(),this.configurations.onDidChange(()=>this.configurations.save())}),this.breakpointManager.load().then(()=>{this.breakpointManager.onDidChangeBreakpoints(()=>this.breakpointManager.save()),this.breakpointManager.onDidChangeExceptionsBreakpoints(()=>this.breakpointManager.save()),this.breakpointManager.onDidChangeMarkers(()=>this.breakpointManager.save())}),this.extensionsPointService.appendExtensionPoint(["browserViews","properties"],{extensionPoint:d.DEBUG_CONTAINER_ID,frameworkKind:["opensumi"],jsonSchema:{...c.browserViews.properties,description:(0,o.formatLocalize)("sumiContributes.browserViews.location.custom",(0,o.localize)("menu-bar.title.debug"))}})}openDebugView(){const H=this.mainlayoutService.getTabbarHandler(d.DEBUG_CONTAINER_ID);H&&!H.isVisible&&H.activate()}openDebugConsoleView(){this.debugConsole.isVisible||this.debugConsole.activate()}onDidRender(){const H=this.mainlayoutService.getTabbarHandler(d.DEBUG_CONTAINER_ID);H&&H.setTitleComponent(k.DebugConfigurationContainerView)}registerCommands(H){H.registerCommand(o.COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION,{execute:(K=V.json)=>{if(K===V.editor)return this.debugConfigurationService.openLaunchEditor();this.debugConfigurationService.openConfiguration()}}),H.registerCommand(d.DEBUG_COMMANDS.REMOVE_ALL_BREAKPOINTS,{execute:()=>{this.debugBreakpointsService.removeAllBreakpoints()}}),H.registerCommand(d.DEBUG_COMMANDS.START,{execute:()=>{this.debugConfigurationService.start()}}),H.registerCommand(d.DEBUG_COMMANDS.STOP,{execute:()=>{this.debugToolbarService.doStop()}}),H.registerCommand(d.DEBUG_COMMANDS.NEXT,{execute:()=>{this.debugToolbarService.doStepIn()}}),H.registerCommand(d.DEBUG_COMMANDS.PREV,{execute:()=>{this.debugToolbarService.doStepOut()}}),H.registerCommand(d.DEBUG_COMMANDS.CONTINUE,{execute:()=>{this.debugToolbarService.doContinue()}}),H.registerCommand(d.DEBUG_COMMANDS.PAUSE,{execute:()=>{this.debugToolbarService.doPause()}}),H.registerCommand(d.DEBUG_COMMANDS.OVER,{execute:()=>{this.debugToolbarService.doStepOver()}}),H.registerCommand(d.DEBUG_COMMANDS.RESTART,{execute:()=>{this.debugToolbarService.doRestart()}}),H.registerCommand(d.DEBUG_COMMANDS.TOGGLE_BREAKPOINTS,{execute:()=>{this.debugBreakpointsService.toggleBreakpoints()}}),H.registerCommand(d.DEBUG_COMMANDS.ACTIVE_BREAKPOINTS,{execute:()=>{const{enable:K}=this.debugBreakpointsService;K.get()||this.debugBreakpointsService.toggleBreakpoints()}}),H.registerCommand(d.DEBUG_COMMANDS.DEACTIVE_BREAKPOINTS,{execute:()=>{const{enable:K}=this.debugBreakpointsService;K.get()&&this.debugBreakpointsService.toggleBreakpoints()}}),H.registerCommand(d.DEBUG_COMMANDS.EDIT_BREAKPOINT,{execute:async K=>{this.reporterService.point(d.DEBUG_REPORT_NAME===null||d.DEBUG_REPORT_NAME===void 0?void 0:d.DEBUG_REPORT_NAME.DEBUG_BREAKPOINT,"edit");const Z=this.debugEditorController.model;if(!Z)return;const{uri:X}=Z,ie=this.breakpointManager.getBreakpoint(X,K.lineNumber);ie&&(this.breakpointManager.selectedBreakpoint={breakpoint:ie,model:Z});const{selectedBreakpoint:oe}=this;if(oe){const{openBreakpointView:le}=oe.model;let pe="condition";if(oe.breakpoint){const q=oe.breakpoint.raw;q.condition?pe="condition":q.hitCondition?pe="hitCondition":q.logMessage&&(pe="logMessage")}le(K,oe.breakpoint&&oe.breakpoint.raw,pe)}},isVisible:()=>!!this.selectedBreakpoint&&!!this.selectedBreakpoint.breakpoint}),H.registerCommand(d.DEBUG_COMMANDS.DISABLE_BREAKPOINT,{execute:async K=>{const{selectedBreakpoint:Z}=this;if(Z){const{uri:X}=Z.model,ie=this.breakpointManager.getBreakpoint(X,K.lineNumber);ie&&(ie.enabled=!1,this.breakpointManager.updateBreakpoint(ie))}},isVisible:()=>!!this.selectedBreakpoint&&!!this.selectedBreakpoint.breakpoint&&this.selectedBreakpoint.breakpoint.enabled,isEnabled:()=>!!this.selectedBreakpoint&&!!this.selectedBreakpoint.breakpoint&&this.selectedBreakpoint.breakpoint.enabled}),H.registerCommand(d.DEBUG_COMMANDS.ENABLE_BREAKPOINT,{execute:async K=>{const{selectedBreakpoint:Z}=this;if(Z){const{uri:X}=Z.model,ie=this.breakpointManager.getBreakpoint(X,K.lineNumber);ie&&(ie.enabled=!0,this.breakpointManager.updateBreakpoint(ie))}},isVisible:()=>!!this.selectedBreakpoint&&!!this.selectedBreakpoint.breakpoint&&!this.selectedBreakpoint.breakpoint.enabled,isEnabled:()=>!!this.selectedBreakpoint&&!!this.selectedBreakpoint.breakpoint&&!this.selectedBreakpoint.breakpoint.enabled}),H.registerCommand(d.DEBUG_COMMANDS.DELETE_BREAKPOINT,{execute:async K=>{const{selectedBreakpoint:Z}=this;if(Z){const{uri:X}=Z.model,ie=this.breakpointManager.getBreakpoint(X,K.lineNumber);ie&&this.breakpointManager.delBreakpoint(ie)}},isVisible:()=>!!this.selectedBreakpoint&&!!this.selectedBreakpoint.breakpoint,isEnabled:()=>!!this.selectedBreakpoint&&!!this.selectedBreakpoint.breakpoint}),H.registerCommand(d.DEBUG_COMMANDS.ADD_CONDITIONAL_BREAKPOINT,{execute:async K=>{const{selectedBreakpoint:Z}=this;if(Z){const{uri:X,openBreakpointView:ie,toggleBreakpoint:oe}=Z.model;oe(K);const le=this.breakpointManager.getBreakpoint(X,K.lineNumber);le&&(this.breakpointManager.selectedBreakpoint={breakpoint:le,model:Z.model}),ie(K,Z.breakpoint&&Z.breakpoint.raw,"condition")}},isVisible:()=>!!this.selectedBreakpoint&&!this.selectedBreakpoint.breakpoint,isEnabled:()=>!!this.selectedBreakpoint&&!this.selectedBreakpoint.breakpoint}),H.registerCommand(d.DEBUG_COMMANDS.ADD_LOGPOINT,{execute:async K=>{const{selectedBreakpoint:Z}=this;if(Z){const{openBreakpointView:X,toggleBreakpoint:ie,uri:oe}=Z.model;ie(K);const le=this.breakpointManager.getBreakpoint(oe,K.lineNumber);le&&(this.breakpointManager.selectedBreakpoint={breakpoint:le,model:Z.model}),X(K,Z.breakpoint&&Z.breakpoint.raw,"logMessage")}},isVisible:()=>!!this.selectedBreakpoint&&!this.selectedBreakpoint.breakpoint,isEnabled:()=>!!this.selectedBreakpoint&&!this.selectedBreakpoint.breakpoint}),H.registerCommand(d.DEBUG_COMMANDS.ADD_BREAKPOINT,{execute:async K=>{const{selectedBreakpoint:Z}=this;if(Z){const{toggleBreakpoint:X}=Z.model;X(K)}},isVisible:()=>!!this.selectedBreakpoint&&!this.selectedBreakpoint.breakpoint,isEnabled:()=>!!this.selectedBreakpoint&&!this.selectedBreakpoint.breakpoint}),H.registerCommand($.ACCEPT,{execute:()=>{const{selectedBreakpoint:K}=this;if(K){const{acceptBreakpoint:Z}=K.model;Z()}},isVisible:()=>!!this.selectedBreakpoint&&!!this.selectedBreakpoint.breakpoint,isEnabled:()=>!!this.selectedBreakpoint&&!!this.selectedBreakpoint.breakpoint}),H.registerCommand($.CLOSE,{execute:()=>{const{selectedBreakpoint:K}=this;if(K){const{closeBreakpointView:Z}=K.model;Z()}},isVisible:()=>!!this.selectedBreakpoint&&!!this.selectedBreakpoint.breakpoint,isEnabled:()=>!!this.selectedBreakpoint&&!!this.selectedBreakpoint.breakpoint}),H.registerCommand(d.DEBUG_COMMANDS.RUN_TO_CURSOR,{execute:K=>{this.debugRunToCursorService.run(K)},isEnabled:()=>this.debugContextKey.contextDebugState.get()==="Stopped"}),H.registerCommand(d.DEBUG_COMMANDS.FORCE_RUN_TO_CURSOR,{execute:K=>{this.debugRunToCursorService.run(K,!0)},isEnabled:()=>this.debugContextKey.contextDebugState.get()==="Stopped"}),H.registerCommand(d.DEBUG_COMMANDS.SHOW_ALL_AUTOMATIC_DEBUG_CONFIGURATIONS,{execute:async()=>{const K=await this.configurations.showDynamicConfigurationsTypesQuickPick();if(K)return await this.debugConfigurationService.showDynamicQuickPick(K)},isEnabled:()=>!0})}registerToolbarItems(H){H.registerItem({id:d.DEBUG_COMMANDS.REMOVE_ALL_BREAKPOINTS.id,command:d.DEBUG_COMMANDS.REMOVE_ALL_BREAKPOINTS.id,iconClass:(0,o.getIcon)("close-all"),viewId:d.DEBUG_BREAKPOINTS_ID,tooltip:(0,o.localize)("debug.breakpoint.removeAll")}),H.registerItem({id:d.DEBUG_COMMANDS.DEACTIVE_BREAKPOINTS.id,command:d.DEBUG_COMMANDS.DEACTIVE_BREAKPOINTS.id,iconClass:(0,o.getIcon)("deactivate-breakpoints"),viewId:d.DEBUG_BREAKPOINTS_ID,tooltip:(0,o.localize)("debug.breakpoint.deactive"),when:E.CONTEXT_ACTIVE_BREAKPOINTS.equalsTo(!0)}),H.registerItem({id:d.DEBUG_COMMANDS.ACTIVE_BREAKPOINTS.id,command:d.DEBUG_COMMANDS.ACTIVE_BREAKPOINTS.id,iconClass:`${(0,o.getIcon)("activate-breakpoints")} ${O.default.debug_activate_breakpoints_icon}`,viewId:d.DEBUG_BREAKPOINTS_ID,tooltip:(0,o.localize)("debug.breakpoint.active"),when:E.CONTEXT_ACTIVE_BREAKPOINTS.equalsTo(!1)})}registerSchema(H){H.registerSchema(d.launchDefaultSchemaUri,w.launchSchema,["launch.json"])}registerKeybindings(H){H.registerKeybinding({command:d.DEBUG_COMMANDS.START.id,keybinding:"f5",when:`!${E.CONTEXT_IN_DEBUG_MODE.raw}`}),H.registerKeybinding({command:d.DEBUG_COMMANDS.CONTINUE.id,keybinding:"f5",when:E.CONTEXT_IN_DEBUG_MODE.raw}),H.registerKeybinding({command:d.DEBUG_COMMANDS.STOP.id,keybinding:"shift+f5",when:E.CONTEXT_IN_DEBUG_MODE.raw}),H.registerKeybinding({command:d.DEBUG_COMMANDS.NEXT.id,keybinding:"f11",when:E.CONTEXT_IN_DEBUG_MODE.raw}),H.registerKeybinding({command:d.DEBUG_COMMANDS.PREV.id,keybinding:"shift+f11",when:E.CONTEXT_IN_DEBUG_MODE.raw}),H.registerKeybinding({command:d.DEBUG_COMMANDS.OVER.id,keybinding:"f10",when:E.CONTEXT_IN_DEBUG_MODE.raw}),H.registerKeybinding({command:d.DEBUG_COMMANDS.RESTART.id,keybinding:"shift+ctrlcmd+f5",when:E.CONTEXT_IN_DEBUG_MODE.raw}),H.registerKeybinding({command:$.ACCEPT.id,keybinding:"enter",when:E.CONTEXT_BREAKPOINT_INPUT_FOCUSED.raw}),H.registerKeybinding({command:$.CLOSE.id,keybinding:"esc",when:E.CONTEXT_BREAKPOINT_INPUT_FOCUSED.raw}),H.registerKeybinding({command:d.DEBUG_COMMANDS.EXCEPTION_WIDGET_CLOSE.id,keybinding:"esc",when:E.CONTEXT_EXCEPTION_WIDGET_VISIBLE.raw})}registerMenus(H){H.registerMenuItem(v.MenuId.DebugBreakpointsContext,{command:d.DEBUG_COMMANDS.DELETE_BREAKPOINT.id,group:"1_has_breakpoint",order:1}),H.registerMenuItem(v.MenuId.DebugBreakpointsContext,{command:d.DEBUG_COMMANDS.EDIT_BREAKPOINT.id,group:"1_has_breakpoint",order:2}),H.registerMenuItem(v.MenuId.DebugBreakpointsContext,{command:d.DEBUG_COMMANDS.DISABLE_BREAKPOINT.id,group:"1_has_breakpoint",order:3}),H.registerMenuItem(v.MenuId.DebugBreakpointsContext,{command:d.DEBUG_COMMANDS.ENABLE_BREAKPOINT.id,group:"1_has_breakpoint",order:4}),H.registerMenuItem(v.MenuId.DebugBreakpointsContext,{command:d.DEBUG_COMMANDS.ADD_BREAKPOINT.id,group:"2_has_not_breakpoint"}),H.registerMenuItem(v.MenuId.DebugBreakpointsContext,{command:d.DEBUG_COMMANDS.ADD_CONDITIONAL_BREAKPOINT.id,group:"2_has_not_breakpoint"}),H.registerMenuItem(v.MenuId.DebugBreakpointsContext,{command:d.DEBUG_COMMANDS.ADD_LOGPOINT.id,group:"2_has_not_breakpoint"}),H.registerMenuItem(v.MenuId.EditorContext,{command:{id:d.DEBUG_COMMANDS.RUN_TO_CURSOR.id,label:d.DEBUG_COMMANDS.RUN_TO_CURSOR.label||""},when:`${E.CONTEXT_IN_DEBUG_MODE.raw}`,group:"debug",order:2}),H.registerMenuItem(v.MenuId.EditorContext,{command:{id:d.DEBUG_COMMANDS.FORCE_RUN_TO_CURSOR.id,label:d.DEBUG_COMMANDS.FORCE_RUN_TO_CURSOR.label||""},when:`${E.CONTEXT_IN_DEBUG_MODE.raw}`,group:"debug",order:2}),H.registerMenuItem(v.MenuId.EditorTitle,{submenu:v.MenuId.EditorTitleRun,label:(0,o.localize)("debug.menu.title.run"),iconClass:(0,o.getIcon)("start"),group:"navigation",order:-1})}isPosition(H){return H instanceof u.Position}registerEditorFeature(H){let K;H.registerEditorFeatureContribution({contribute:Z=>(K=this.injector.get(D.DebugEditorContribution,[Z]),K.contribute(Z))}),(0,m.runWhenIdle)(()=>{K?.registerDecorationType()}),this.preferenceSettings.setEnumLabels("debug.console.filter.mode",{filter:(0,o.localize)("preference.debug.console.filter.mode.filter"),matcher:(0,o.localize)("preference.debug.console.filter.mode.matcher")})}};t.DebugContribution=Y,n.__decorate([(0,r.Autowired)(l.IMainLayoutService),n.__metadata("design:type",Object)],Y.prototype,"mainlayoutService",void 0),n.__decorate([(0,r.Autowired)(f.BreakpointManager),n.__metadata("design:type",f.BreakpointManager)],Y.prototype,"breakpointManager",void 0),n.__decorate([(0,r.Autowired)(y.DebugConfigurationManager),n.__metadata("design:type",y.DebugConfigurationManager)],Y.prototype,"configurations",void 0),n.__decorate([(0,r.Autowired)(d.IDebugModelManager),n.__metadata("design:type",Object)],Y.prototype,"debugEditorController",void 0),n.__decorate([(0,r.Autowired)(M.DebugBreakpointsService),n.__metadata("design:type",M.DebugBreakpointsService)],Y.prototype,"debugBreakpointsService",void 0),n.__decorate([(0,r.Autowired)(B.DebugViewModel),n.__metadata("design:type",B.DebugViewModel)],Y.prototype,"debugModel",void 0),n.__decorate([(0,r.Autowired)(A.DebugPreferences),n.__metadata("design:type",Object)],Y.prototype,"debugPreferences",void 0),n.__decorate([(0,r.Autowired)(L.DebugConsoleService),n.__metadata("design:type",L.DebugConsoleService)],Y.prototype,"debugConsole",void 0),n.__decorate([(0,r.Autowired)(P.DebugConfigurationService),n.__metadata("design:type",P.DebugConfigurationService)],Y.prototype,"debugConfigurationService",void 0),n.__decorate([(0,r.Autowired)(d.IDebugSessionManager),n.__metadata("design:type",T.DebugSessionManager)],Y.prototype,"sessionManager",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],Y.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(F.DebugToolbarService),n.__metadata("design:type",F.DebugToolbarService)],Y.prototype,"debugToolbarService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],Y.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],Y.prototype,"preferences",void 0),n.__decorate([(0,r.Autowired)(o.IReporterService),n.__metadata("design:type",Object)],Y.prototype,"reporterService",void 0),n.__decorate([(0,r.Autowired)(l.IViewsRegistry),n.__metadata("design:type",Object)],Y.prototype,"viewsRegistry",void 0),n.__decorate([(0,r.Autowired)(s.IShadowFileProvider),n.__metadata("design:type",Object)],Y.prototype,"shadowFileServiceProvider",void 0),n.__decorate([(0,r.Autowired)(s.IFileServiceClient),n.__metadata("design:type",g.FileServiceClient)],Y.prototype,"fileSystem",void 0),n.__decorate([(0,r.Autowired)(o.IPreferenceSettingsService),n.__metadata("design:type",Object)],Y.prototype,"preferenceSettings",void 0),n.__decorate([(0,r.Autowired)(S.DebugProgressService),n.__metadata("design:type",S.DebugProgressService)],Y.prototype,"debugProgressService",void 0),n.__decorate([(0,r.Autowired)(I.DebugRunToCursorService),n.__metadata("design:type",I.DebugRunToCursorService)],Y.prototype,"debugRunToCursorService",void 0),n.__decorate([(0,r.Autowired)(b.DebugContextKey),n.__metadata("design:type",b.DebugContextKey)],Y.prototype,"debugContextKey",void 0),n.__decorate([(0,r.Autowired)(m.IExtensionsSchemaService),n.__metadata("design:type",Object)],Y.prototype,"extensionsPointService",void 0),t.DebugContribution=Y=n.__decorate([(0,o.Domain)(o.ClientAppContribution,o.ComponentContribution,p.TabBarToolbarContribution,o.CommandContribution,o.KeybindingContribution,o.JsonSchemaContribution,o.PreferenceContribution,v.MenuContribution,_.BrowserEditorContribution)],Y)},84303:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugExceptionWidget=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=n.__importDefault(e(25873)),c=e(76003),p=e(41869),v=e(43718),m=e(20303),_=e(31324),s=e(58542);e(39889);function g({info:h,layout:u}){var d;const E=(0,p.useInjectable)(s.LinkDetector),f=(0,r.useRef)(null);return r.default.useEffect(()=>{var a;f.current&&f.current.appendChild(E.linkify(((a=h.details)===null||a===void 0?void 0:a.stackTrace)||"",!0)),u()},[h.details,(d=h.details)===null||d===void 0?void 0:d.stackTrace,f]),r.default.createElement("div",{className:"exception_widget"},r.default.createElement("div",{className:"title"},r.default.createElement("div",{className:"label"},h.id?(0,v.formatLocalize)("debug.widget.exception.thrownWithId",h.id):(0,v.localize)("debug.widget.exception.thrown"))),h.description?r.default.createElement("div",{className:"description"},h.description):null,h.details&&h.details.stackTrace?r.default.createElement("div",{className:"stack_trace",ref:f}):null)}let l=class extends m.ZoneWidget{constructor(u,d){super(u),this.exceptionInfo=d,this.create()}applyClass(){}applyStyle(){}_fillContainer(u){this.setCssClass("exception_widget_container");const d=this.editor.getOption(_.EditorOption.fontInfo);u.style.fontSize=`${d.fontSize}px`,u.style.lineHeight=`${d.lineHeight}px`,u.tabIndex=0,o.default.createRoot(u).render(r.default.createElement(p.ConfigProvider,{value:this.configContext},r.default.createElement(g,{info:this.exceptionInfo,layout:()=>this.layout(void 0)})))}layout(u){this._container.style.height="initial";const d=this.editor.getOption(_.EditorOption.lineHeight),E=Math.round(d/3),f=Math.ceil((this._container.offsetHeight+E)/d);this._relayout(f)}focus(){this._container.focus()}};t.DebugExceptionWidget=l,n.__decorate([(0,c.Autowired)(p.AppConfig),n.__metadata("design:type",Object)],l.prototype,"configContext",void 0),t.DebugExceptionWidget=l=n.__decorate([(0,c.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Object])],l)},58542:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LinkDetector=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(43718),p=e(54414),v=e(42933),m=n.__importDefault(e(80315)),_="\\u0000-\\u0020\\u007f-\\u009f",s=new RegExp("(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\\/\\/|data:|www\\.)[^\\s"+_+'"]{2,}[^\\s'+_+`"')}\\],:;.!?]`,"ug"),g=/(?:[a-zA-Z]:(?:(?:\\|\/)[\w\.-]*)+)/,l=/(?:(?:\~|\.)(?:(?:\\|\/)[\w\.-]*)+)/,h=new RegExp(`(${g.source}|${l.source})`),u=/((?:\~|\.)?(?:\/[\w\.-]*)+)/,d=/(?:\:([\d]+))?(?:\:([\d]+))?/,E=new RegExp(`${c.isWindows?h.source:u.source}${d.source}`,"g"),f=2e3;let a=class{linkify(y,A,S){if(A){const T=y.split(`
|
|
31517
31517
|
`);for(let O=0;O<T.length-1;O++)T[O]=T[O]+`
|
|
31518
|
-
`;T[T.length-1]||T.pop();const D=T.map(O=>this.linkify(O,!1,S));if(D.length===1)return D[0];const I=document.createElement("span");return D.forEach(O=>I.appendChild(O)),I}const w=document.createElement("span");for(const T of this.detectLinks(y))try{switch(T.kind){case"text":w.appendChild(document.createTextNode(T.value));break;case"web":w.appendChild(this.createWebLink(T.value));break;case"path":{const D=T.captures[0],I=T.captures[1]?Number(T.captures[1]):0,O=T.captures[2]?Number(T.captures[2]):0;w.appendChild(this.createPathLink(T.value,D,I,O,S));break}}}catch{w.appendChild(document.createTextNode(T.value))}return w}createWebLink(y){const A=this.createLink(y),S=c.URI.parse(y);return this.decorateLink(A,async()=>{if(S.scheme===o.Schemes.file){const w=S.toString(),T=o.OS.type()===c.OperatingSystem.Windows?c.path.win32:c.path.posix,D=c.path.normalize(T.sep===c.path.posix.sep&&c.isWindows?w.replace(/\\/g,c.path.posix.sep):w);await this.workbenchEditorService.open(c.URI.parse(D));return}this.openerService.open(y)}),A}createPathLink(y,A,S,w,T){if(A[0]==="/"&&A[1]==="/")return document.createTextNode(y);if(A[0]==="."){if(!T)return document.createTextNode(y);const O=T.toResource(A),M=this.createLink(y);return this.decorateLink(M,()=>{this.workbenchEditorService.open(c.URI.parse(O.toString()))}),M}const D=this.createLink(y);D.tabIndex=0;const I=c.URI.file(c.path.normalize(A));return this.fileServiceClient.getFileStat(I.toString()).then(O=>{!O||O&&O.isDirectory||this.decorateLink(D,()=>{this.workbenchEditorService.open(c.URI.parse(I.toString()),{range:{startColumn:w,startLineNumber:S,endLineNumber:S,endColumn:w}})})}),D}createLink(y){const A=document.createElement("a");return A.textContent=y,A}decorateLink(y,A){y.classList.add(m.default.link),y.title=(0,o.formatLocalize)("debug.console.followLink",c.isMacintosh?"Cmd":"Ctrl"),y.onmousemove=S=>{y.classList.toggle(m.default.pointer,c.isMacintosh?S.metaKey:S.ctrlKey)},y.onmouseleave=()=>y.classList.remove(m.default.pointer),y.onclick=S=>{const w=window.getSelection();!w||w.type==="Range"||(c.isMacintosh?S.metaKey:S.ctrlKey)&&(S.preventDefault(),S.stopImmediatePropagation(),A(!1))}}detectLinks(y){if(!y)return[];if(y.length>f)return[{kind:"text",value:y,captures:[]}];const A=[s,E],S=["web","path"],w=[],T=(D,I)=>{if(I>=A.length){w.push({value:D,kind:"text",captures:[]});return}const O=A[I];let M=0,R;for(O.lastIndex=0;(R=O.exec(D))!==null;){const k=D.substring(M,R.index);k&&T(k,I+1);const F=R[0];w.push({value:F,kind:S[I],captures:R.slice(1)}),M=R.index+F.length}const P=D.substring(M);P&&T(P,I+1)};return T(y,0),w}};t.LinkDetector=a,n.__decorate([(0,r.Autowired)(p.WorkbenchEditorService),n.__metadata("design:type",p.WorkbenchEditorService)],a.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(v.IFileServiceClient),n.__metadata("design:type",Object)],a.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(o.IOpenerService),n.__metadata("design:type",Object)],a.prototype,"openerService",void 0),t.LinkDetector=a=n.__decorate([(0,r.Injectable)({multiple:!0})],a)},61752:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugMemoryFileSystemProvider=void 0;const n=e(85608),r=n.__importDefault(e(17228)),o=e(76003),c=e(43718),p=e(64582),v=e(38029),{Path:m}=c.path;let _=class{constructor(){this.memoryFdCounter=0,this.changeEmitter=new c.Emitter,this.fdMemory=new Map,this.capabilities=1028,this.onDidChangeCapabilities=c.Event.None,this.onDidChangeFile=this.changeEmitter.event,this.emptyBuffer=this.toBuffer("")}stat(l){return Promise.resolve({type:c.FileType.File,uri:l.toString(),mtime:0,ctime:0,size:0,lastModification:0,isDirectory:!1})}async readFile(l){const h=this.parseUri(l);if(!h)return this.emptyBuffer;if(!h.offset)return this.emptyBuffer;const{session:u,memoryReference:d,offset:E}=h,f=new Uint8Array(E.toOffset-E.fromOffset),a=this.memoryFdCounter++;let b=u.getMemory(d);return E&&(b=new s(b,E)),this.fdMemory.set(a,{session:u,region:b}),await this.read(a,E.fromOffset,f,0,f.length),f}async read(l,h,u,d,E){const f=this.fdMemory.get(l);if(!f)return;const a=await f.region.read(h,E);let b=0;for(const y of a)switch(y.type){case 1:return b;case 2:return b>0?b:this.logger.error(y.error);case 0:{const A=Math.max(0,h-y.offset),S=y.data.slice(A,Math.min(y.data.byteLength,A+(E-b)));u.set(S.buffer,d+b),b+=S.byteLength;break}default:this.logger.log(y)}return b}toBuffer(l){return c.BinaryBuffer.fromString(l).buffer}parseUri(l){if(l.scheme!==p.DEBUG_MEMORY_SCHEME)return;const h=this.debugSessionManager.sessions.find(f=>f.id.toLowerCase()===l.authority.toLowerCase());if(!h)return;let u;const d=/range=([0-9]+):([0-9]+)/.exec(l.query);d&&(u={fromOffset:Number(d[1]),toOffset:Number(d[2])});const[,E]=l.path.split(m.separator);return{session:h,offset:u,readOnly:!h.capabilities.supportsWriteMemoryRequest,sessionId:l.authority,memoryReference:decodeURIComponent(E)}}readDirectory(){throw new Error("Not allowed")}createDirectory(){throw new Error("Not allowed")}rename(){throw new Error("Not allowed")}delete(){throw new Error("Not allowed")}watch(){throw new Error("Not allowed")}writeFile(){throw new Error("Method not implemented.")}};t.DebugMemoryFileSystemProvider=_,n.__decorate([(0,o.Autowired)(p.IDebugSessionManager),n.__metadata("design:type",v.DebugSessionManager)],_.prototype,"debugSessionManager",void 0),n.__decorate([(0,o.Autowired)(c.ILogger),n.__metadata("design:type",Object)],_.prototype,"logger",void 0),t.DebugMemoryFileSystemProvider=_=n.__decorate([(0,o.Injectable)()],_);class s extends c.Disposable{constructor(l,h){super(),this.parent=l,this.range=h,this.invalidateEmitter=new c.Emitter,this.onDidInvalidate=this.invalidateEmitter.event,this.width=this.range.toOffset-this.range.fromOffset,this.writable=l.writable,this.registerDispose(l),this.registerDispose(l.onDidInvalidate(u=>{const d=(0,r.default)(u.fromOffset-h.fromOffset,0,this.width),E=(0,r.default)(u.toOffset-h.fromOffset,0,this.width);E>d&&this.invalidateEmitter.fire({fromOffset:d,toOffset:E})}))}read(l,h){if(l<0)throw new RangeError(`Invalid fromOffset: ${l}`);return this.parent.read(this.range.fromOffset+l,this.range.fromOffset+Math.min(h,this.width))}write(l,h){return this.parent.write(this.range.fromOffset+l,h)}}},31141:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugPreferences=t.IDebugConfiguration=t.debugPreferencesSchema=void 0,t.createDebugPreferences=o,t.injectDebugPreferences=c;const n=e(41869);t.debugPreferencesSchema={type:"object",properties:{"debug.trace":{type:"boolean",default:!1,description:(0,n.localize)("preference.debug.trace")},"debug.debugViewLocation":{enum:["default","left","right","bottom"],default:"default",description:(0,n.localize)("preference.debug.debugViewLocation")},"debug.openDebug":{enum:["neverOpen","openOnSessionStart","openOnFirstSessionStart","openOnDebugBreak"],default:"openOnDebugBreak",description:(0,n.localize)("preference.debug.openDebug")},"debug.internalConsoleOptions":{enum:["neverOpen","openOnSessionStart","openOnFirstSessionStart"],default:"openOnFirstSessionStart",description:(0,n.localize)("preference.debug.internalConsoleOptions")},"debug.allowBreakpointsEverywhere":{type:"boolean",description:(0,n.localize)("preference.debug.allowBreakpointsEverywhere"),default:!1}}};class r{}t.IDebugConfiguration=r,t.DebugPreferences=Symbol("DebugPreferences");function o(p){return(0,n.createPreferenceProxy)(p,t.debugPreferencesSchema)}function c(p){p.addProviders({token:t.DebugPreferences,useFactory:v=>{const m=v.get(n.PreferenceService);return o(m)}}),p.addProviders({token:n.PreferenceContribution,useValue:{schema:t.debugPreferencesSchema}})}},40453:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProgressService=void 0;const r=e(85608),o=e(76003),c=e(41869),p=e(68969),v=e(43718),m=e(26296);let _=n=class{constructor(){this.toDispose=[]}async onDebugServiceStateChange(g){this.progressResolve&&(this.progressResolve(),this.progressResolve=void 0),g===m.DebugState.Initializing&&this.progressService.getIndicator(n.DEBUG_PANEL_PROGRESS_ID)&&this.progressService.withProgress({location:n.DEBUG_PANEL_PROGRESS_ID},l=>new Promise(h=>this.progressResolve=h))}run(g){let l;const h=u=>{l=new v.DisposableCollection,u&&(l?.push(u.onDidChangeState(d=>this.onDebugServiceStateChange(d))),l?.push(u.onDidProgressStart(async d=>{const E=new Promise(f=>{const a=c.Event.any(c.Event.filter(u.onDidProgressEnd,b=>b.body.progressId===d.body.progressId),u.onDidExitAdapter)(()=>{a.dispose(),f()})});this.progressService.getIndicator(n.DEBUG_PANEL_PROGRESS_ID)&&this.progressService.withProgress({location:n.DEBUG_PANEL_PROGRESS_ID},()=>E),this.progressService.withProgress({location:v.ProgressLocation.Notification,title:d.body.title,cancellable:d.body.cancellable,silent:!0,delay:500},f=>{let a=0;const b=A=>{let S;typeof A.percentage=="number"&&(S=A.percentage-a,a+=S),f.report({message:A.message,increment:S,total:typeof S=="number"?100:void 0})};d.body.message&&b(d.body);const y=u.onDidProgressUpdate(A=>{A.body.progressId===d.body.progressId&&b(A.body)});return E.then(()=>y.dispose())},()=>u.cancel(d.body.progressId))})))};this.toDispose.push(g.onDidChangeActiveDebugSession(({current:u})=>{l&&l.dispose(),h(u)})),h(g.currentSession)}};t.DebugProgressService=_,_.DEBUG_PANEL_PROGRESS_ID="debug",r.__decorate([(0,o.Autowired)(p.IProgressService),r.__metadata("design:type",Object)],_.prototype,"progressService",void 0),t.DebugProgressService=_=n=r.__decorate([(0,o.Injectable)()],_)},69946:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.launchSchema=t.DebugSchemaManager=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(64582),p=e(70159),v=e(37499),{deepClone:m}=o.objects;let _=class{async update(){const g=this.config.getDebuggers(),l={...m(t.launchSchema)},h=l.properties.configurations.items,u=g.map(d=>({attributes:Object.keys(d.configurationAttributes||{}).map(E=>d.configurationAttributes[E]),configurationSnippets:d.configurationSnippets}));for(const{attributes:d,configurationSnippets:E}of u)d&&h.oneOf&&h.oneOf.push(...d),E&&h.defaultSnippets&&h.defaultSnippets.push(...E);this.schemaRegistry.registerSchema(c.launchExtensionSchemaUri,l,["launch.json"])}};t.DebugSchemaManager=_,n.__decorate([(0,r.Autowired)(p.IDebugServer),n.__metadata("design:type",Object)],_.prototype,"debug",void 0),n.__decorate([(0,r.Autowired)(o.IJSONSchemaRegistry),n.__metadata("design:type",Object)],_.prototype,"schemaRegistry",void 0),n.__decorate([(0,r.Autowired)(v.DebugConfigurationManager),n.__metadata("design:type",v.DebugConfigurationManager)],_.prototype,"config",void 0),t.DebugSchemaManager=_=n.__decorate([(0,r.Injectable)()],_),t.launchSchema={$id:c.launchSchemaUri,type:"object",title:"Launch",required:[],default:{version:"0.2.0",configurations:[]},properties:{version:{type:"string",description:"Version of this file format.",default:"0.2.0"},configurations:{type:"array",description:"List of configurations. Add new configurations or edit existing ones by using IntelliSense.",items:{defaultSnippets:[],type:"object",oneOf:[]}}}}},90408:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugService=void 0;const n=e(85608),r=e(76003),o=e(41869);let c=class{constructor(){this.onDidDebugContributionPointChangeEmitter=new o.Emitter,this.debugContributionPointsMap=new Map}registerDebugContributionPoints(v,m){this.debugContributionPointsMap.has(v)||(this.debugContributionPointsMap.set(v,m),this.onDidDebugContributionPointChangeEmitter.fire({path:v,contributions:m}))}unregisterDebugContributionPoints(v){const m=this.debugContributionPointsMap.get(v);m&&(this.debugContributionPointsMap.delete(v),this.onDidDebugContributionPointChangeEmitter.fire({path:v,contributions:m,removed:!0}))}get debugContributionPoints(){return this.debugContributionPointsMap}get onDidDebugContributionPointChange(){return this.onDidDebugContributionPointChangeEmitter.event}};t.DebugService=c,t.DebugService=c=n.__decorate([(0,r.Injectable)()],c)},3520:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSessionConnection=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(64582),p=e(38029),v=new Set(["breakpoint","capabilities","continued","exited","initialized","loadedSource","module","output","process","stopped","terminated","thread","progressStart","progressUpdate","progressEnd","invalidated"]);let m=class{constructor(s,g,l){this.sessionId=s,this.connectionFactory=g,this.traceOutputChannel=l,this.pendingRequests=new Map,this.requestHandlers=new Map,this.onDidCustomEventEmitter=new o.Emitter,this.onDidCustomEvent=this.onDidCustomEventEmitter.event,this.toDispose=new o.DisposableCollection(this.onDidCustomEventEmitter,o.Disposable.create(()=>this.pendingRequests.clear()),o.Disposable.create(()=>this.emitters.clear())),this.allThreadsContinued=!0,this.emitters=new Map,this.connection=this.createConnection()}get disposed(){return this.toDispose.disposed}dispose(){this.toDispose.dispose()}async createConnection(){if(this.disposed)throw new Error("Connection has been already disposed.");{const s=await this.connectionFactory(this.sessionId);return s.onceClose((g,l)=>{this.fire("exited",{code:g,reason:l})}),s.onMessage(g=>this.handleMessage(g)),this.toDispose.push(o.Disposable.create(()=>{s.dispose()})),s}}async sendRequest(s,g,l,h){var u;s==="initialize"&&(this.sessionAdapterID=g.adapterID);const d=this.manager.reportTime(c.DEBUG_REPORT_NAME.DEBUG_ADAPTER_PROTOCOL_TIME,{sessionId:this.sessionId,threadId:g&&g.threadId||((u=this.manager.currentThread)===null||u===void 0?void 0:u.raw.id)}),E=await this.doSendRequest(s,g,h),f={adapterID:this.sessionAdapterID,request:l.request};if(s==="threads"&&(f.amount=E.body.threads.length),d(s,f),(s==="next"||s==="stepIn"||s==="stepOut"||s==="stepBack"||s==="reverseContinue"||s==="restartFrame")&&this.fireContinuedEvent(g.threadId),s==="continue"){const a=E;return(a&&a.body&&a.body.allThreadsContinued)!==void 0&&(this.allThreadsContinued=E.body.allThreadsContinued),this.fireContinuedEvent(g.threadId,this.allThreadsContinued),E}return E}async sendCustomRequest(s,g){var l;return(l=await this.doSendRequest(s,g))===null||l===void 0?void 0:l.body}async doSendRequest(s,g=null,l){const h=new o.Deferred,u={seq:(0,c.getSequenceId)(),type:"request",command:s};let d;return g&&(u.arguments=g),this.pendingRequests.set(u.seq,E=>{d&&d.dispose(),E.success?h.resolve(E):h.reject(E)}),l&&(d=l.onCancellationRequested(async()=>{d.dispose();const E=this.manager.getSession(this.sessionId);E&&E.capabilities.supportsCancelRequest&&E.sendRequest("cancel",{requestId:u.seq})})),await this.send(u),h.promise}async send(s){const g=await this.connection,l=JSON.stringify(s);this.traceOutputChannel&&this.traceOutputChannel.appendLine(`${this.sessionId.substring(0,8)} [UI -> adapter]: ${l}`),g.send(l)}handleMessage(s){this.traceOutputChannel&&this.traceOutputChannel.appendLine(`${this.sessionId.substring(0,8)} [adapter -> UI ]: ${s}`);const g=JSON.parse(s);g.type==="request"?this.handleRequest(g):g.type==="response"?this.handleResponse(g):g.type==="event"&&this.handleEvent(g)}handleResponse(s){const g=this.pendingRequests.get(s.request_seq);g&&(this.pendingRequests.delete(s.request_seq),g(s))}onRequest(s,g){this.requestHandlers.set(s,g)}async handleRequest(s){const g={type:"response",seq:(0,c.getSequenceId)(),command:s.command,request_seq:s.seq,success:!0},l=this.requestHandlers.get(s.command);if(l)try{g.body=await l(s)}catch(h){g.success=!1,g.message=h.message}else(0,o.getDebugLogger)().error("Unhandled request",s);await this.send(g)}handleEvent(s){"event"in s?(s.event==="continued"&&(this.allThreadsContinued=s.body.allThreadsContinued!==!1),v.has(s.event)?this.doFire(s.event,s):this.onDidCustomEventEmitter.fire(s)):this.fire("exited",s)}on(s,g){return this.disposed?o.Disposable.create(()=>{}):this.getEmitter(s).event(g)}fire(s,g){this.doFire(s,g)}doFire(s,g){this.disposed||this.getEmitter(s).fire(g)}getEmitter(s){const g=this.emitters.get(s)||this.newEmitter();return this.emitters.set(s,g),g}newEmitter(){const s=new o.Emitter;return this.toDispose.push(s),s}fireContinuedEvent(s,g=!1){this.fire("continued",{type:"event",event:"continued",body:{threadId:s,allThreadsContinued:g},seq:(0,c.getSequenceId)()})}};t.DebugSessionConnection=m,n.__decorate([(0,r.Autowired)(c.IDebugSessionManager),n.__metadata("design:type",p.DebugSessionManager)],m.prototype,"manager",void 0),t.DebugSessionConnection=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)()),n.__param(1,(0,r.Optional)()),n.__param(2,(0,r.Optional)()),n.__metadata("design:paramtypes",[String,Function,Object])],m)},97186:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSessionFactory=t.DebugSessionContributionRegistryImpl=t.DebugSessionContributionRegistry=t.DebugSessionContribution=void 0;const n=e(85608),r=e(76003),o=e(41869);t.DebugSessionContribution=Symbol("DebugSessionContribution"),t.DebugSessionContributionRegistry=Symbol("DebugSessionContributionRegistry");let c=class{constructor(){this.contribs=new Map,this.init()}init(){for(const v of this.contributions.getContributions())this.contribs.set(v.debugType,v)}get(v){return this.contribs.get(v)}};t.DebugSessionContributionRegistryImpl=c,n.__decorate([(0,r.Autowired)(t.DebugSessionContribution),n.__metadata("design:type",Object)],c.prototype,"contributions",void 0),t.DebugSessionContributionRegistryImpl=c=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],c),t.DebugSessionFactory=Symbol("DebugSessionFactory")},38029:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSessionManager=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(26542),p=e(54414),v=e(72665),m=e(93950),_=e(80907),s=e(64582),g=e(79845),l=e(80712),h=e(17280),u=e(97186),d=e(5905);let E=class{fireDidChange(a){this.inDebugModeKey.set(this.inDebugMode),this.onDidChangeEmitter.fire(a)}constructor(){this._uid=(0,o.uuid)(),this._sessions=new Map,this._extraMap=new Map,this._actionIndex=0,this.onWillStartDebugSessionEmitter=new o.Emitter,this.onWillStartDebugSession=this.onWillStartDebugSessionEmitter.event,this.onWillResolveDebugConfigurationEmitter=new o.Emitter,this.onWillResolveDebugConfiguration=this.onWillResolveDebugConfigurationEmitter.event,this.onDidCreateDebugSessionEmitter=new o.Emitter,this.onDidCreateDebugSession=this.onDidCreateDebugSessionEmitter.event,this.onDidStartDebugSessionEmitter=new o.Emitter,this.onDidStartDebugSession=this.onDidStartDebugSessionEmitter.event,this.onDidStopDebugSessionEmitter=new o.Emitter,this.onDidStopDebugSession=this.onDidStopDebugSessionEmitter.event,this.onDidChangeActiveDebugSessionEmitter=new o.Emitter,this.onDidChangeActiveDebugSession=this.onDidChangeActiveDebugSessionEmitter.event,this.onDidDestroyDebugSessionEmitter=new o.Emitter,this.onDidDestroyDebugSession=this.onDidDestroyDebugSessionEmitter.event,this.onDidReceiveDebugSessionCustomEventEmitter=new o.Emitter,this.onDidReceiveDebugSessionCustomEvent=this.onDidReceiveDebugSessionCustomEventEmitter.event,this.onDidChangeEmitter=new o.Emitter,this.onDidChange=this.onDidChangeEmitter.event,this.configurationIds=new Map,this.toDisposeOnCurrentSession=new o.DisposableCollection,this.init()}init(){this.debugTypeKey=this.contextKeyService.createKey(s.CONTEXT_DEBUG_TYPE_KEY,void 0),this.inDebugModeKey=this.contextKeyService.createKey(s.CONTEXT_IN_DEBUG_MODE_KEY,this.inDebugMode),this.debugStopped=this.contextKeyService.createKey(s.CONTEXT_DEBUG_STOPPED_KEY,!1),this.modelManager.onModelChanged(a=>{const{newModelUrl:b}=a;if(b){const y=o.URI.parse(b.toString()),A=this.modelManager.model;if(this.currentSession&&this.currentThread&&A){const S=this.currentThread.frames.find(w=>{var T;return((T=w.source)===null||T===void 0?void 0:T.uri.toString())===y.toString()});S&&S!==this.currentFrame&&(this.currentThread.currentFrame=S,setTimeout(()=>{this.workbenchEditorService.currentEditor&&this.workbenchEditorService.currentEditor.monacoEditor.revealLineInCenter(S.raw.line)},0))}}})}_getExtra(a,b){if(a==null)return;const y=this._extraMap.get(a);if(y)return{traceId:y.traceId,remote:y.remote,adapterID:y.adapterID,request:y.request,...b&&y.threads.get(`${b}`)}}getExtra(a,b){return this._getExtra(a,b)}_setExtra(a,b,y){const A=this._extraMap.get(a);A&&(y?A.threads.set(b,y):A.threads.delete(b))}setExtra(a,b,y){return this._setExtra(a,b,y)}report(a,b,y){return y={traceId:this._uid,...this._getExtra(y?.sessionId,y?.threadId),...y},this.reporterService.point(a,b,y)}reportTime(a,b){const y=this.reporterService.time(a);return(A,S)=>(S={...b,...S},S={traceId:this._uid,...this._getExtra(S?.sessionId,S?.threadId),...S},y.timeEnd(A,S))}reportAction(a,b,y){var A,S,w;let T=this._getExtra(a,b);T&&(b&&!T.threadId&&(T={...T}),this._actionIndex+=1,T.action=`${y}-${this._actionIndex}`,T.filePath=(S=(A=this.currentFrame)===null||A===void 0?void 0:A.raw.source)===null||S===void 0?void 0:S.path,T.fileLineNumber=(w=this.currentFrame)===null||w===void 0?void 0:w.raw.line,this._setExtra(a,`${b??""}`,T))}async start(a){const{configuration:b}=a,y={adapterID:b.type,request:b.request==="launch"?"launch":"attach",traceId:this._uid,remote:0,threads:new Map};if((0,d.isRemoteAttach)(b)&&(y.remote=1),this.report(s.DEBUG_REPORT_NAME.DEBUG_BREAKPOINT,"number",{count:this.breakpoints.getBreakpoints().length,...y}),!a.configuration.__restart&&this.isExistedDebugSession(a)){this.messageService.error((0,o.formatLocalize)("debug.launch.existed",a.configuration.name));return}try{const A=this.reportTime(s.DEBUG_REPORT_NAME.DEBUG_SESSION_START_TIME,y);await this.fireWillStartDebugSession();const S=await this.resolveConfiguration(a);if(S){if(S.configuration.preLaunchTask){this.debugProgressService.onDebugServiceStateChange(s.DebugState.Initializing);const T=o.Uri.parse(S.workspaceFolderUri),D=await this.taskService.getTask(T,S.configuration.preLaunchTask);if(D){const I=this.reportTime(s.DEBUG_REPORT_NAME.DEBUG_PRE_LAUNCH_TASK_TIME,y),O=await this.taskService.run(D);O.exitCode!==0&&this.messageService.error(`The preLaunchTask ${S.configuration.preLaunchTask} exitCode is ${O.exitCode}`),I(T.toString(),{exitCode:O.exitCode})}this.debugProgressService.onDebugServiceStateChange(s.DebugState.Running)}}else{a.configuration.type?this.messageService.error((0,o.formatLocalize)("debug.notSupported.type",a.configuration.type)):this.messageService.error((0,o.localize)("debug.notSupported.any"));return}const w=await this.debug.createDebugSession(S);if(A(S.configuration.type,{adapterID:S.configuration.type,request:S.configuration.request,sessionId:w}),!w){this.messageService.error((0,o.formatLocalize)("debug.launch.typeNotSupported",S.configuration.type));return}return this.doStart(w,S,y)}catch(A){throw this.messageService.error((0,o.localize)("debug.launch.catchError")),A}}async fireWillStartDebugSession(){await o.WaitUntilEvent.fire(this.onWillStartDebugSessionEmitter,{})}async resolveConfiguration(a){if(s.IDebugSessionDTO.is(a))return a;const{workspaceFolderUri:b,index:y,noDebug:A,parentSession:S,repl:w,compact:T,lifecycleManagedByParent:D}=a,I=await this.resolveDebugConfiguration(a.configuration,b);I&&!("cwd"in I)&&(I.cwd="${workspaceFolder}");let O=await this.variableResolver.resolve(I,{});if(!O){O===null&&this.commandService.executeCommand(o.COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION.id);return}if(O=await this.resolveDebugConfigurationWithSubstitutedVariables(O,b),!O){O===null&&this.commandService.executeCommand(o.COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION.id);return}const M=O.name+b,R=this.configurationIds.has(M)?this.configurationIds.get(M)+1:0;return this.configurationIds.set(M,R),{id:R,configuration:O,workspaceFolderUri:b,index:y,noDebug:A,parentSession:S,repl:w,compact:T,lifecycleManagedByParent:D}}async resolveDebugConfiguration(a,b){return await this.fireWillResolveDebugConfiguration(a.type),this.debug.resolveDebugConfiguration(a,b)}async resolveDebugConfigurationWithSubstitutedVariables(a,b){return this.debug.resolveDebugConfigurationWithSubstitutedVariables(a,b)}async fireWillResolveDebugConfiguration(a){await o.WaitUntilEvent.fire(this.onWillResolveDebugConfigurationEmitter,{debugType:a})}async doStart(a,b,y){const A=this.sessionContributionRegistry.get(b.configuration.type);if(!A)return;const w=A.debugSessionFactory().get(a,b);this._sessions.set(a,w),this._extraMap.set(a,y),b.lifecycleManagedByParent||this.updateCurrentSession(w),this.debugTypeKey.set(w.configuration.type),this.onDidCreateDebugSessionEmitter.fire(w);let T=s.DebugState.Inactive;return w.onDidChange(()=>{var D,I;T!==w.state&&(T=w.state,T===s.DebugState.Stopped?(this.onDidStopDebugSessionEmitter.fire(w),this.debugStopped.set(!0)):this.debugStopped.set(!1)),this.debugContextKey.contextSetVariableSupported.set((D=w.capabilities.supportsSetVariable)!==null&&D!==void 0?D:!1),this.debugContextKey.contextRestartFrameSupported.set((I=w.capabilities.supportsRestartFrame)!==null&&I!==void 0?I:!1),this.debugContextKey.contextDebugState.set(s.DebugState[w.state]),this.debugContextKey.contextInDebugMode.set(T!==s.DebugState.Inactive)}),w.on("terminated",D=>{const I=D.body&&D.body.restart;I?this.doRestart(w,I):this.destroy(w.id)}),w.on("exited",()=>this.destroy(w.id)),w.start().then(()=>this.onDidStartDebugSessionEmitter.fire(w)),w.onDidCustomEvent(({event:D,body:I})=>this.onDidReceiveDebugSessionCustomEventEmitter.fire({event:D,body:I,session:w})),w}isExistedDebugSession(a){const{name:b}=a.configuration;for(const[,y]of this._sessions)if(y.configuration.name===b&&!y.terminated)return!0;return!1}async restart(a=this.currentSession){return a&&this.doRestart(a)}async doRestart(a,b){const{options:y,configuration:A}=a;return await a.restart({arguments:A})?a:(await a.terminate(!0),A.__restart=b,this.start(y))}updateCurrentSession(a){this.currentSession=a||this.sessions[this.sessions.length-1]}get inDebugMode(){return this.state>s.DebugState.Inactive}get currentThread(){const a=this.currentSession;return a&&a.currentThread}get state(){const a=this.currentSession;return a?a.state:s.DebugState.Inactive}get currentFrame(){const{currentThread:a}=this;return a&&a.currentFrame}get topFrame(){const{currentThread:a}=this;return a&&a.topFrame}getSession(a){if(a)return this._sessions.get(a)}get sessions(){return Array.from(this._sessions.values()).filter(a=>a.state>s.DebugState.Inactive)}get currentSession(){return this._currentSession}set currentSession(a){if(this._currentSession===a)return;this.toDisposeOnCurrentSession.dispose();const b=this._currentSession;this._currentSession=a,this.onDidChangeActiveDebugSessionEmitter.fire({previous:b,current:a}),a&&(this.toDisposeOnCurrentSession.push(a.onDidChange(()=>{this.currentFrame===this.topFrame&&this.open(),this.fireDidChange(a)})),this.toDisposeOnCurrentSession.push(a.onCurrentThreadChange(()=>{this.fireDidChange(a)}))),this.open(),this.fireDidChange(a)}open(){const{currentFrame:a}=this;a&&a.open()}async stopSession(a,b=!1){return a?b?a.disconnect():a.terminate():Promise.all(this.sessions.map(y=>b?y.disconnect():y.terminate()))}destroy(a){if(a){const b=this._sessions.get(a);b&&this.doDestroy(b)}else this._sessions.forEach(b=>this.doDestroy(b))}doDestroy(a){this.debug.terminateDebugSession(a.id),this.remove(a.id),a.dispose(),this.onDidDestroyDebugSessionEmitter.fire(a)}remove(a){this._sessions.delete(a);const{currentSession:b}=this;b&&b.id===a&&this.updateCurrentSession(void 0),setTimeout(()=>{this._extraMap.delete(a)})}};t.DebugSessionManager=E,n.__decorate([(0,r.Autowired)(c.LabelService),n.__metadata("design:type",c.LabelService)],E.prototype,"labelProvider",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],E.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(u.DebugSessionContributionRegistry),n.__metadata("design:type",Object)],E.prototype,"sessionContributionRegistry",void 0),n.__decorate([(0,r.Autowired)(s.IDebugServer),n.__metadata("design:type",Object)],E.prototype,"debug",void 0),n.__decorate([(0,r.Autowired)(p.WorkbenchEditorService),n.__metadata("design:type",p.WorkbenchEditorService)],E.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(v.IMessageService),n.__metadata("design:type",Object)],E.prototype,"messageService",void 0),n.__decorate([(0,r.Autowired)(_.IVariableResolverService),n.__metadata("design:type",Object)],E.prototype,"variableResolver",void 0),n.__decorate([(0,r.Autowired)(l.BreakpointManager),n.__metadata("design:type",l.BreakpointManager)],E.prototype,"breakpoints",void 0),n.__decorate([(0,r.Autowired)(s.IDebugModelManager),n.__metadata("design:type",Object)],E.prototype,"modelManager",void 0),n.__decorate([(0,r.Autowired)(m.ITaskService),n.__metadata("design:type",Object)],E.prototype,"taskService",void 0),n.__decorate([(0,r.Autowired)(o.IReporterService),n.__metadata("design:type",Object)],E.prototype,"reporterService",void 0),n.__decorate([(0,r.Autowired)(g.IDebugProgress),n.__metadata("design:type",Object)],E.prototype,"debugProgressService",void 0),n.__decorate([(0,r.Autowired)(h.DebugContextKey),n.__metadata("design:type",h.DebugContextKey)],E.prototype,"debugContextKey",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],E.prototype,"commandService",void 0),t.DebugSessionManager=E=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],E)},29539:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSession=void 0;const r=e(85608).__importDefault(e(12784)),o=e(41869),c=e(43718),p=e(64582),v=e(32385),m=e(99797),_=e(88776),s=e(7885);class g{fireDidChange(){this.onDidChangeEmitter.fire(void 0),this.onStateChange()}get capabilities(){return this._capabilities}get supportsThreadIdCorrespond(){return!!this.capabilities.supportsThreadIdCorrespond}constructor(h,u,d,E,f,a,b,y,A,S,w){this.id=h,this.options=u,this.connection=d,this.terminalService=E,this.workbenchEditorService=f,this.breakpointManager=a,this.modelManager=b,this.labelProvider=y,this.messages=A,this.fileSystem=S,this.sessionManager=w,this.onDidChangeEmitter=new o.Emitter,this.onDidChange=this.onDidChangeEmitter.event,this._onDidChangeCallStack=new o.Emitter,this.onDidChangeCallStack=this._onDidChangeCallStack.event,this._onVariableChange=new o.Emitter,this.onVariableChange=this._onVariableChange.event,this._onCurrentThreadChange=new o.Emitter,this.onCurrentThreadChange=this._onCurrentThreadChange.event,this._onDidStop=new o.Emitter,this.onDidStop=this._onDidStop.event,this._onDidContinued=new o.Emitter,this.onDidContinued=this._onDidContinued.event,this._onDidThread=new o.Emitter,this.onDidThread=this._onDidThread.event,this._onRequest=new o.Emitter,this.onRequest=this._onRequest.event,this._onDidExitAdapter=new o.Emitter,this.onDidExitAdapter=this._onDidExitAdapter.event,this._onDidProgressStart=new o.Emitter,this.onDidProgressStart=this._onDidProgressStart.event,this._onDidProgressUpdate=new o.Emitter,this.onDidProgressUpdate=this._onDidProgressUpdate.event,this._onDidProgressEnd=new o.Emitter,this.onDidProgressEnd=this._onDidProgressEnd.event,this._onDidInvalidated=new o.Emitter,this.onDidInvalidated=this._onDidInvalidated.event,this._onDidChangeState=new o.Emitter,this.onDidChangeState=this._onDidChangeState.event,this._onDidInvalidMemory=new o.Emitter,this.onDidInvalidateMemory=this._onDidInvalidMemory.event,this.toDispose=new o.DisposableCollection,this._capabilities={},this.updateDeffered=null,this.exitDeferred=new o.Deferred,this.cancellationMap=new Map,this.toDisposeOnCurrentThread=new o.DisposableCollection,this.initialized=!1,this.id2Breakpoint=new Map,this.settingBreakpoints=null,this._multipleThreadPaused=new Map,this.sources=new Map,this._threads=new Map,this.scheduleUpdateThreads=(0,r.default)(()=>this.updateThreads(void 0),100),this.pendingThreads=Promise.resolve(),this.terminated=!1,this.connection.onRequest("runInTerminal",async T=>await this.runInTerminal(T)),this.toDispose.pushAll([this.onDidChangeEmitter,this.connection,this.on("initialized",()=>{this.configure()}),this.on("breakpoint",({body:T})=>this.onUpdateBreakpoint(T)),this.on("continued",async T=>{const{body:{allThreadsContinued:D,threadId:I}}=T;if(this.handleCancellation(I),this.supportsThreadIdCorrespond){I?this._multipleThreadPaused.delete(I):D!==!1&&this._multipleThreadPaused.clear(),await this.updateCurrentThread(),this._onDidContinued.fire(T);return}if(D!==!1){this.clearThreads(),this._onDidContinued.fire(T);return}(0,c.isDefined)(I)&&this.clearThread(I),this.onStateChange(),this._onDidContinued.fire(T)}),this.on("stopped",async T=>{const{body:D}=T;this.stoppedDetails=D;const{threadId:I}=D,O=this.sessionManager.reportTime(p.DEBUG_REPORT_NAME.DEBUG_STOPPED,{sessionId:this.id,threadId:I});if(this.supportsThreadIdCorrespond===!0){if(await this.collectPausedThread(D),D.threadId&&this._multipleThreadPaused.has(D.threadId)){const R=this._multipleThreadPaused.get(D.threadId);await this.updateCurrentThread(R),await this.updateCurrentThreadFramesOnFocus()}}else this.updateDeffered=new o.Deferred,await this.updateThreads(D),await this.updateCurrentThreadFramesOnFocus(),this.updateDeffered.resolve();O("stopped");const M=this.sessionManager.getExtra(this.id,I);I&&M&&M.action&&(M.action=void 0,this.sessionManager.setExtra(this.id,`${I??""}`,M)),this.onStateChange(),this.sessionManager.currentSession=this,this._onDidStop.fire(T)}),this.on("thread",T=>{const{body:{reason:D,threadId:I}}=T;if(this.supportsThreadIdCorrespond){this.state===p.DebugState.Stopped&&this._onDidThread.fire(T);return}D==="started"?this.scheduleUpdateThreads():D==="exited"&&this.clearThread(I),this._onDidThread.fire(T)}),this.on("terminated",()=>{this.terminated=!0}),this.on("exited",T=>{this.exitDeferred.resolve(T)}),this.on("progressStart",T=>{this._onDidProgressStart.fire(T)}),this.on("progressUpdate",T=>{this._onDidProgressUpdate.fire(T)}),this.on("progressEnd",T=>{this._onDidProgressEnd.fire(T)}),this.on("memory",T=>{this._onDidInvalidMemory.fire(T)}),this.on("invalidated",async T=>{this._onDidInvalidated.fire(T),T.body.areas&&T.body.areas.length===1&&(T.body.areas[0]==="variables"||T.body.areas[0]==="watch")||(this.cancelAllRequests(),this.clearThreads(),await this.updateThreads(this.stoppedDetails)),this.fireDidChange()}),this.on("capabilities",T=>this.updateCapabilities(T.body.capabilities)),this.breakpointManager.onDidChangeBreakpoints(T=>this.runtimeUpdateBreakpoint(T)),this.breakpointManager.onDidChangeExceptionsBreakpoints(T=>{this.breakpointManager.breakpointsEnabled&&this.setExceptionBreakpoints(T)}),c.Disposable.create(()=>{this.breakpointManager.clearAllStatus(this.id)})])}getMemory(h){return new v.MemoryRegion(h,this)}get configuration(){return this.options.configuration}get parentSession(){return this.options.parentSession}get lifecycleManagedByParent(){return this.options.lifecycleManagedByParent}get compact(){return!!this.options.compact}async start(){await this.workbenchEditorService.saveAll(),await this.initialize(),await this.launchOrAttach()}async runInTerminal({arguments:{title:h,cwd:u,args:d,env:E}}){return this.doRunInTerminal({name:h,cwd:u,env:E,args:d})}async doRunInTerminal(h){var u;const d=this.terminalService.terminals.find(b=>b.name===h.name&&b.isActive);let E;const f=await this.terminalService.getDefaultShellPath(),a=(0,p.prepareCommand)(f,h.args,!1,(u=h.cwd)===null||u===void 0?void 0:u.toString(),h.env);if(d)a&&this.terminalService.sendText(d.id,a),E=await this.terminalService.getProcessId(d.id);else{const b=await this.terminalService.createTerminal(h);b.show(),a&&(this.terminalService.sendText(b.id,a),E=await this.terminalService.getProcessId(b.id))}return{processId:E}}async initialize(){const h=await this.connection.sendRequest("initialize",{clientID:"OpenSumi",clientName:"OpenSumi IDE",adapterID:this.configuration.type,locale:(0,c.getLanguageId)(),linesStartAt1:!0,columnsStartAt1:!0,pathFormat:"path",supportsVariableType:!1,supportsVariablePaging:!1,supportsRunInTerminalRequest:!0,supportsProgressReporting:!0,supportsInvalidatedEvent:!0,supportsMemoryEvent:!0,supportsMemoryReferences:!0},this.configuration);this.updateCapabilities(h.body||{}),this.onStateChange()}async launchOrAttach(){var h;if(this.parentSession&&this.parentSession.state===p.DebugState.Inactive)throw(0,o.canceled)();try{this.configuration.request==="attach"?await this.sendRequest("attach",this.configuration):await this.sendRequest("launch",this.configuration)}catch(u){throw this.fireExited(u),this.messages.error(u.message||((h=u.body)===null||h===void 0?void 0:h.error.format)||(0,o.localize)("debug.console.errorMessage")),u&&u.message}}async configure(){await this.initBreakpoints(),this.breakpointManager.setExceptionBreakpoints(this.capabilities.exceptionBreakpointFilters||[]),this.initialized=!0,this.capabilities.supportsConfigurationDoneRequest&&this.sendRequest("configurationDone",{}),this.supportsThreadIdCorrespond||await this.updateThreads(void 0)}async setExceptionBreakpoints(h){return this.sendRequest("setExceptionBreakpoints",h)}onStateChange(){const h=this.state;this.previousState!==h&&(this.previousState=h,this._onDidChangeState.fire(h))}async onUpdateBreakpoint(h){let u;this.settingBreakpoints&&await this.settingBreakpoints.promise;try{const d=h.breakpoint;switch(h.reason){case"new":if(d.source&&typeof d.line=="number"&&d.id&&!this.id2Breakpoint.has(d.id)){const E=_.DebugSource.toUri(d.source),f=m.DebugBreakpoint.create(E,{line:d.line,column:d.column});f.status.set(this.id,d),this.addBreakpoint(f)}break;case"removed":d.id&&(u=this.id2Breakpoint.get(d.id),u&&this.delBreakpoint(u));break;case"changed":d.id&&(u=this.id2Breakpoint.get(d.id),u&&(u.status.set(this.id,d),this.breakpointManager.updateBreakpoint(u,!0)));break;default:break}}finally{}}async setBreakpoints(h){const u=[];for(const d of h){const E=await this.toSource(d),f=this.breakpointManager.getBreakpoints(d).filter(a=>this.breakpointManager.breakpointsEnabled&&a.enabled);u.push(this.sendRequest("setBreakpoints",{source:E.raw,sourceModified:!1,lines:f.map(a=>a.raw.line),breakpoints:f.map(a=>a.raw)}).then(a=>(a.body.breakpoints.forEach((b,y)=>{var A,S;b.id&&this.id2Breakpoint.set(b.id,f[y]);const w=f[y];w.raw.line=(A=b.line)!==null&&A!==void 0?A:w.raw.line,w.raw.column=(S=b.column)!==null&&S!==void 0?S:w.raw.column,w.status.set(this.id,b)}),this.breakpointManager.updateBreakpoints(f,!0),this.breakpointManager.resolveBpDeffered(),Promise.resolve())).catch(a=>{if(!(a instanceof Error)){const y=a.message?`${a.message}`:"Breakpoint not valid for current debug session";f.forEach(A=>{A.status.set(this.id,{verified:!1,message:y}),this.breakpointManager.updateBreakpoint(A,!0)})}}))}return await Promise.all(u)}delBreakpoint(h){return this.breakpointManager.delBreakpoint(h)}async addBreakpoint(h,u){return u&&this.breakpointManager.setBpDeffered(),this.breakpointManager.addBreakpoint(h),this.breakpointManager.promiseBpDeffered()}async runtimeUpdateBreakpoint(h){const{affected:u,statusUpdated:d}=h;if(!d)return await this.setBreakpoints(u)}async initBreakpoints(){this.settingBreakpoints=new o.Deferred,this.id2Breakpoint.clear(),this.configuration.noDebug||await this.setBreakpoints(this.breakpointManager.affected.map(h=>o.URI.parse(h))),this.settingBreakpoints.resolve(),this.settingBreakpoints=null}get currentThread(){return this._currentThread}set currentThread(h){this.toDisposeOnCurrentThread.dispose(),this._currentThread=h,h&&this.toDisposeOnCurrentThread.push(h.onDidChanged(()=>this.fireDidChange()))}get multipleThreadPaused(){return this._multipleThreadPaused}hasInMultipleThreadPaused(h){return this._multipleThreadPaused.has(h)}clearThreads(){var h;const u=this.sessionManager.reportTime(p.DEBUG_REPORT_NAME.DEBUG_UI_FRONTEND_TIME,{sessionId:this.id,threadId:(h=this.currentThread)===null||h===void 0?void 0:h.id,threadAmount:this.threadCount});this._threads.forEach(d=>{d.clear()}),this._onDidChangeCallStack.fire(),this.collocationThread(),u("clearThreads")}clearThread(h){const u=this.sessionManager.reportTime(p.DEBUG_REPORT_NAME.DEBUG_UI_FRONTEND_TIME,{sessionId:this.id,threadId:h,threadAmount:this.threadCount}),d=this._threads.get(h);d&&(d.clear(),this._onDidChangeCallStack.fire()),this.collocationThread(),u("clearThread")}get state(){if(this.connection.disposed)return p.DebugState.Inactive;if(!this.initialized)return p.DebugState.Initializing;const h=this.currentThread;return h?h.stopped?p.DebugState.Stopped:p.DebugState.Running:this.supportsThreadIdCorrespond?p.DebugState.Running:this.stoppedThreads.next().value?p.DebugState.Stopped:p.DebugState.Running}get currentFrame(){return this.currentThread&&this.currentThread.currentFrame}async getScopes(h){const{currentFrame:u}=this;return u?u.getScopes(h):[]}get label(){return p.IDebugSessionDTO.is(this.options)&&this.options.id?this.configuration.name+" ("+(this.options.id+1)+")":this.configuration.name}get visible(){return this.state>p.DebugState.Inactive}getSource(h){const u=_.DebugSource.toUri(h).toString(),d=this.sources.get(u)||new _.DebugSource(this,this.labelProvider,this.modelManager,this.workbenchEditorService,this.fileSystem);return d.update({raw:h}),this.sources.set(u,d),d}getSourceForUri(h){return this.sources.get(h.toString())}async toSource(h){const u=this.getSourceForUri(h);return u||this.getSource(await this.toDebugSource(h))}async toDebugSource(h){if(h.scheme===_.DebugSource.SCHEME)return{name:h.path.toString(),sourceReference:Number(h.query)};const u=h.displayName;let d=h.toString();return h.scheme===c.Schemes.file&&(d=await this.fileSystem.getFsPath(d)),{name:u,path:d,adapterData:void 0,sourceReference:void 0}}get threads(){return Array.from(this._threads.values())}get threadCount(){return this._threads.size}*getThreads(h){for(const u of this.threads)h(u)&&(yield u)}get runningThreads(){return this.getThreads(h=>!h.stopped)}get stoppedThreads(){return this.getThreads(h=>h.stopped)}async rawFetchThreads(h){const u=typeof h>"u"?null:{threadId:h},d=await this.sendRequest("threads",u);return d&&d.body&&d.body.threads&&Array.isArray(d.body.threads)?Promise.resolve(d.body.threads):Promise.resolve([])}async fetchThreads(){const h=await this.rawFetchThreads(),u=this._threads,d=[];for(const E of h){const f=E.id,a=u.get(f)||new s.DebugThread(this);d.push(a),a.update({raw:E})}return Promise.resolve(d)}updateThreads(h){return this.pendingThreads=this.pendingThreads.then(async()=>{try{const u=await this.rawFetchThreads();this.doUpdateThreads(u,h)}catch{}})}doUpdateThreads(h,u){const d=this.sessionManager.reportTime(p.DEBUG_REPORT_NAME.DEBUG_UI_FRONTEND_TIME,{sessionId:this.id,threadId:u?.threadId,threadAmount:h.length}),E=[];h.forEach(f=>{if(E.push(f.id),this._threads.has(f.id)){if(f.name){const a=this._threads.get(f.id);a&&(a.raw.name=f.name)}}else{const a=new s.DebugThread(this),b={raw:f};a.update(b),this._threads.set(f.id,a)}}),this._threads.forEach(f=>{var a;const{raw:{id:b}}=f;E.indexOf(b)===-1&&this._threads.delete(b),u&&(u.allThreadsStopped||u.threadId===b)&&((a=this._threads.get(b))===null||a===void 0||a.update({stoppedDetails:u}))}),this.collocationThread(u),d("doUpdateThreads")}collocationThread(h){var u;const{currentThread:d}=this;let E=d&&d.raw.id;h&&!h.preserveFocusHint&&h.threadId&&(E=h.threadId),this.currentThread=typeof E=="number"&&this._threads.get(E)||this._threads.values().next().value,((u=this.currentThread)===null||u===void 0?void 0:u.raw.id)!==E&&this.fireDidChange()}async updateCurrentThread(h){h?(this.currentThread=h,this._onCurrentThreadChange.fire(this.currentThread)):(this.currentThread=void 0,this._onCurrentThreadChange.fire(void 0))}async collectPausedThread(h){const u=await this.rawFetchThreads(h?.threadId);if(u.length===0)return new Map;const d=h.threadId&&this._multipleThreadPaused.has(h.threadId)?this._multipleThreadPaused.get(h.threadId):new s.DebugThread(this),E={raw:u[0]};return h&&(h.allThreadsStopped||h.threadId===u[0].id)&&(E.stoppedDetails=h),d&&(d.update(E),await this.rawFetchFrames(d),this._multipleThreadPaused.set(d.raw.id,d)),this._multipleThreadPaused}async updateCurrentThreadFramesOnFocus(){await this.rawFetchFrames(this.currentThread),this._onDidChangeCallStack.fire();const h=this.workbenchEditorService.currentEditor,u=d=>{this.stoppedDetails&&!this.stoppedDetails.preserveFocusHint&&(this.currentThread.currentFrame=d)};if(this.currentThread&&!this.currentFrame){const d=this.currentThread.frames.filter(E=>E&&E.source&&E.source.raw.presentationHint!=="deemphasize");if(d.length===0)return;if(h){const E=h.monacoEditor.getModel();if(E){const f=o.URI.parse(E.uri.toString()),a=d.filter(b=>b.source.uri.toString()===f.toString());a.length>0?u(a[0]):u(d[0])}}else u(d[0])}}async rawFetchFrames(h){!h||h.frameCount||(this.capabilities.supportsDelayedStackTraceLoading?(await h.rawFetchFrames(1),await h.rawFetchFrames(19)):await h.rawFetchFrames())}async terminate(h){if(this.initialized=!0,this.cancelAllRequests(),this.lifecycleManagedByParent&&this.parentSession){await this.parentSession.terminate(h);return}!this.terminated&&this.capabilities.supportsTerminateRequest&&this.configuration.request==="launch"?(this.terminated=!0,this.sendRequest("terminate",{restart:h}),await this.exited(1e3)||await this.disconnect(h)):await this.disconnect(h)}async disconnect(h){try{this.lifecycleManagedByParent&&this.parentSession?this.parentSession.disconnect(h):this.sendRequest("disconnect",{restart:h})}catch(d){this.fireExited(d);return}finally{this._onDidExitAdapter.fire(),this.onStateChange()}const u=500;await this.exited(u)||this.fireExited(new Error(`timeout after ${u} ms`))}updateCapabilities(h){Object.assign(this._capabilities,h)}fireExited(h){this.connection.fire("exited",{reason:h})}exited(h){return Promise.race([this.exitDeferred.promise.then(()=>!0,()=>!1),new Promise(u=>{setTimeout(u,h,!1)})])}async restart(h){return this.cancelAllRequests(),this.capabilities.supportsRestartRequest?(this.terminated=!1,this.lifecycleManagedByParent&&this.parentSession?await this.parentSession.restart({arguments:this.parentSession.configuration}):await this.sendRequest("restart",h),!0):!1}dispose(){this.toDispose.dispose()}async evaluate(h,u){var d;this.updateDeffered&&await((d=this.updateDeffered)===null||d===void 0?void 0:d.promise);const E=this.currentFrame&&this.currentFrame.raw.id;return(await this.sendRequest("evaluate",{expression:h,frameId:E,context:u})).body}async variables(h,u="named"){return(await this.sendRequest("variables",{variablesReference:h,filter:u})).body}async goto(h){if(this.capabilities.supportsGotoTargetsRequest)return await this.sendRequest("goto",h)}async exceptionInfo(h){return this.capabilities.supportsExceptionInfoRequest?this.sendRequest("exceptionInfo",h):Promise.reject(new Error("exceptionInfo not supported"))}async cancel(h){return this.sendRequest("cancel",{progressId:h})}async setVariableValue(h){if(this.capabilities.supportsSetVariable){const u=await this.sendRequest("setVariable",h);return this._onVariableChange.fire(),u}}async breakpointLocations(h,u){var d;const E=await this.toSource(h),a=(((d=(await this.sendRequest("breakpointLocations",{source:E.raw,line:u})).body)===null||d===void 0?void 0:d.breakpoints)||[]).map(b=>({lineNumber:b.line,column:b.column||1}));return Object.values(a.reduce((b,y)=>({...b,[`${y.lineNumber}:${y.column}`]:y}),{}))}async sendRequest(h,u,d){var E,f,a;if(!this._capabilities.supportsTerminateRequest&&h==="terminate"||!this._capabilities.supportsCompletionsRequest&&h==="completions"||!this._capabilities.supportsTerminateThreadsRequest&&h==="terminateThreads")throw new Error(`debug: ${h} not supported`);let b;["continue","next","stepIn","stepOut","threads"].some(y=>h===y)&&this.handleCancellation((E=this.currentThread)===null||E===void 0?void 0:E.raw.id),["stackTrace","scopes","variables","completions","threads"].some(y=>h===y)&&(b=!((f=this.currentThread)===null||f===void 0)&&f.raw.id?this.getNewCancellationToken((a=this.currentThread)===null||a===void 0?void 0:a.raw.id,d):void 0);try{return await this.connection.sendRequest(h,u,this.configuration,b)}finally{this._onRequest.fire(h)}}async takeCommand(h){return new Promise(u=>{const d=this.onRequest(E=>{E===h&&(d.dispose(),u())})})}sendCustomRequest(h,u){return this.connection.sendCustomRequest(h,u)}on(h,u){return this.connection.on(h,u)}get onDidCustomEvent(){return this.connection.onDidCustomEvent}hasSeparateRepl(){return!this.parentSession||this.options.repl!=="mergeWithParent"}reportTime(h,u){return this.sessionManager.reportTime(h,u)}getNewCancellationToken(h,u){const d=new c.CancellationTokenSource(u),E=this.cancellationMap.get(h)||[];return E.push(d),this.cancellationMap.set(h,E),d.token}cancelAllRequests(){this.cancellationMap.forEach(h=>h.forEach(u=>u.cancel())),this.cancellationMap.clear()}handleCancellation(h){if(h){const u=this.cancellationMap.get(h);this.cancellationMap.delete(h),u&&u.forEach(d=>d.cancel())}else this.cancelAllRequests()}getDebugProtocolBreakpoint(h){const u=this.breakpointManager.getBreakpoints().find(d=>d.id===h);if(u){const d=u.status.get(this.id);return{id:d?.id,verified:!!d?.verified,message:d?.message,source:d?.source,line:d?.line,column:d?.column,endLine:d?.endLine,endColumn:d?.endColumn,instructionReference:d?.instructionReference,offset:d?.offset}}}currentEditor(){var h;return(h=this.getModel())===null||h===void 0?void 0:h.getEditor()}getModel(){return this.modelManager.model}async readMemory(h,u,d){return this.capabilities.supportsReadMemoryRequest?await this.sendRequest("readMemory",{count:d,memoryReference:h,offset:u}):Promise.resolve(void 0)}async writeMemory(h,u,d,E){return this.capabilities.supportsWriteMemoryRequest?await this.sendRequest("writeMemory",{memoryReference:h,offset:u,allowPartial:E,data:d}):Promise.resolve(void 0)}}t.DebugSession=g},5905:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseSnippet=t.CharWidthReader=t.DEFAULT_WORD_REGEXP=t.USUAL_WORD_SEPARATORS=void 0,t.isExtensionHostDebugging=c,t.matchAll=p,t.isRemoteAttach=v;const n=e(41869),r=e(57711),{equalsIgnoreCase:o}=n.strings;function c(g){return g.type&&o(g.type==="vslsShare"?g.adapterProxy.configuration.type:g.type,"extensionhost")}function p(g,l){let h;const u=[];for(;(h=l.exec(g))!==null;)u.push(h);return u}function v(g){if(g.request==="attach"){const l={node:"address",java:"hostName",go:"host",cppdbg:"miDebuggerServerAddress",python:"host"},{type:h}=g,u=g[l[h]];return u?!["localhost","0.0.0.0","127.0.0.1","::1"].includes(u):!0}return!1}t.USUAL_WORD_SEPARATORS="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function m(g=""){let l="(-?\\d*\\.\\d\\w*)|([^";for(const h of t.USUAL_WORD_SEPARATORS)g.indexOf(h)>=0||(l+="\\"+h);return l+="\\s]+)",new RegExp(l,"g")}t.DEFAULT_WORD_REGEXP=m();class _{static getInstance(){return _._INSTANCE||(_._INSTANCE=new _),_._INSTANCE}constructor(){this._cache=new Map,this._canvas=document.createElement("canvas")}getCharWidth(l,h){const u=l+h;if(this._cache.has(u))return this._cache.get(u);const d=this._canvas.getContext("2d");d.font=h;const f=d.measureText(l).width;return this._cache.set(u,f),f}}t.CharWidthReader=_,_._INSTANCE=null;const s=g=>{const l=new RegExp(/^\^\"(.*)\"/gm),h=new r.SnippetParser;return new RegExp(/\${\d+:(.*)/).test(g)||l.test(g)?h.parse(g).toString().replace(l,"$1"):g};t.parseSnippet=s},17475:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugBreakpointWidget=t.TopStackType=void 0;const r=e(85608),o=e(76003),c=e(41869),p=e(43718),v=r.__importStar(e(20868)),m=e(64582),_=e(97319),s=e(4983),g=e(27562);var l;(function(u){u[u.exception=0]="exception",u[u.debugger=1]="debugger"})(l||(t.TopStackType=l={}));let h=n=class extends p.Disposable{constructor(){super(),this.breakpointWidgetInputFocus=s.CONTEXT_BREAKPOINT_INPUT_FOCUSED.bind(this.contextKeyService)}get position(){return this._position}get values(){var d;return(d=this.zone)===null||d===void 0?void 0:d.values}get breakpointType(){var d;return(d=this.zone)===null||d===void 0?void 0:d.breakpointType}show(d,E,f="condition"){this.dispose(),this._position=d,this.addDispose(this.zone=this.injector.get(g.DebugBreakpointZoneWidget,[this.editor,{...E},f])),this.addDispose(this.zone.onDidChangeBreakpoint(({context:a,value:b})=>{E&&(E[a]=b)})),this.addDispose(this.zone.onFocus(()=>{this.breakpointWidgetInputFocus.set(!0)})),this.addDispose(this.zone.onBlur(()=>{this.breakpointWidgetInputFocus.set(!1)})),this.addDispose(this.zone.onDispose(()=>{this._position=void 0,this.breakpointWidgetInputFocus.set(!1)})),this.zone.show(v.positionToRange(d),n.LINE_HEIGHT_NUMBER)}hide(){var d;(d=this.zone)===null||d===void 0||d.hide()}};t.DebugBreakpointWidget=h,h.LINE_HEIGHT_NUMBER=2,r.__decorate([(0,o.Autowired)(m.DebugEditor),r.__metadata("design:type",Object)],h.prototype,"editor",void 0),r.__decorate([(0,o.Autowired)(_.DebugBreakpointsService),r.__metadata("design:type",_.DebugBreakpointsService)],h.prototype,"debugBreakpointsService",void 0),r.__decorate([(0,o.Autowired)(c.IContextKeyService),r.__metadata("design:type",Object)],h.prototype,"contextKeyService",void 0),r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],h.prototype,"injector",void 0),t.DebugBreakpointWidget=h=n=r.__decorate([(0,o.Injectable)(),r.__metadata("design:paramtypes",[])],h)},27562:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugBreakpointZoneWidget=void 0;const r=e(85608),o=r.__importDefault(e(14041)),c=r.__importDefault(e(25873)),p=e(76003),v=e(97267),m=e(41869),_=e(43718),s=e(20303),g=e(52416),l=e(31324),h=e(64582),u=e(97319),d=r.__importDefault(e(55797));let E=n=class extends s.ZoneWidget{_fillContainer(a){}get values(){return{...this.contexts,[this.context]:this.input&&this.input.monacoEditor.getValue()||void 0}}get breakpointType(){return this.context}constructor(a,b={},y="condition"){super(a),this.editor=a,this.contexts=b,this.context=y,this._onDidChangeBreakpoint=new _.Emitter,this.onDidChangeBreakpoint=this._onDidChangeBreakpoint.event,this._onFocus=new _.Emitter,this.onFocus=this._onFocus.event,this._onBlur=new _.Emitter,this.onBlur=this._onBlur.event,this.inputFocusHandler=()=>{this._onFocus.fire()},this.inputBlurHandler=()=>{this._onBlur.fire()},this.selectContextHandler=A=>{this.input&&(this.contexts[this.context]=this.input.monacoEditor.getValue()||void 0),this.context=A,this.setInputMode(),this.render()},this._wrapper=document.createElement("div"),this._selection=document.createElement("div"),this._input=document.createElement("div"),this._container.appendChild(this._wrapper),this._wrapper.appendChild(this._selection),this._wrapper.appendChild(this._input),c.default.createRoot(this._input).render(o.default.createElement(o.default.Fragment,null))}hide(){this.input&&(this.input.dispose(),this.input=void 0),super.dispose()}show(a,b){super.show(a,b),this.debugBreakpointsService.createBreakpointInput(this._input).then(y=>{this.input=y;const{monacoEditor:A}=this.input;this.setInputMode(),this.addDispose(A.onDidBlurEditorWidget(()=>{this.inputBlurHandler()})),this.addDispose(A.onDidFocusEditorWidget(()=>{this.inputFocusHandler()})),this.addDispose(A.onDidChangeModelContent(S=>{if(!this.input)return;A.getValue().length===0?this.ensureRenderPlaceholder():this.clearPlaceholder();const T=A.getModel().getLineCount();this._relayout(T+1)})),this.syncPreContent()})}createDecorations(){this.input&&this.input.monacoEditor.getValue().length===0&&this.input.monacoEditor.deltaDecorations([],[{range:{startLineNumber:1,endLineNumber:0,startColumn:0,endColumn:1},options:{description:"debug-breakpoint-zone-widget",afterContentClassName:d.default.input_placeholder}}])}renderOption(a,b){return o.default.createElement(v.Option,{value:a},b)}setInputMode(){var a,b;const y=(a=this.editor.getModel())===null||a===void 0?void 0:a.getLanguageId(),A=(b=this.input)===null||b===void 0?void 0:b.monacoEditor.getModel();A&&y&&A.setLanguage(this.context==="logMessage"?"plaintext":y)}renderPlaceholder(){if(!this.input)return;this.clearPlaceholder();const a=`'${this.placeholder}' !important`;this.cssRenderDisposable=this.cssManager.addClass(n.INPUT_PLACEHOLDER_AFTER,{content:a})}ensureRenderPlaceholder(){this.input&&(this.createDecorations(),this.renderPlaceholder())}syncPreContent(){if(this.input){this.input.focus();const a=this.contexts[this.context]||"";this.input.monacoEditor.setValue(a)}}clearPlaceholder(){this.cssRenderDisposable&&(this.cssRenderDisposable.dispose(),this.cssRenderDisposable=void 0)}applyClass(){if(this._wrapper.className=d.default.debug_breakpoint_wrapper,this._selection.className=d.default.debug_breakpoint_selected,this._input.className=d.default.debug_breakpoint_input,!this.editor.getModel())return;const b=this.editor.getOption(l.EditorOption.lineHeight),y=this.editor.getOption(l.EditorOption.fontSize),A=b-y;this._input.style.marginTop=A+"px"}applyStyle(){this.syncPreContent(),c.default.createRoot(this._selection).render(o.default.createElement(v.Select,{value:this.context,selectedRenderer:()=>o.default.createElement("span",{className:"kt-select-option"},this.getContextToLocalize(this.context)),onChange:this.selectContextHandler},this.renderOption("condition",this.getContextToLocalize("condition")),this.renderOption("hitCondition",this.getContextToLocalize("hitCondition")),this.renderOption("logMessage",this.getContextToLocalize("logMessage"))))}getContextToLocalize(a){switch(a){case"logMessage":return(0,_.localize)("debug.expression.logMessage");case"hitCondition":return(0,_.localize)("debug.expression.hitCondition");default:return(0,_.localize)("debug.expression.condition")}}get placeholder(){switch(this.context){case"logMessage":return(0,_.localize)("debug.expression.log.placeholder");case"hitCondition":return(0,_.localize)("debug.expression.hit.placeholder");default:return(0,_.localize)("debug.expression.condition.placeholder")}}};t.DebugBreakpointZoneWidget=E,E.INPUT_PLACEHOLDER_AFTER=d.default.input_placeholder+"::after",r.__decorate([(0,p.Autowired)(u.DebugBreakpointsService),r.__metadata("design:type",u.DebugBreakpointsService)],E.prototype,"debugBreakpointsService",void 0),r.__decorate([(0,p.Autowired)(m.PreferenceService),r.__metadata("design:type",Object)],E.prototype,"preferenceService",void 0),r.__decorate([(0,p.Autowired)(g.ICSSStyleService),r.__metadata("design:type",Object)],E.prototype,"cssManager",void 0),t.DebugBreakpointZoneWidget=E=n=r.__decorate([(0,p.Injectable)({multiple:!0}),r.__metadata("design:paramtypes",[Object,Object,String])],E)},52943:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugEditorContribution=void 0;const r=e(85608),o=e(76003),c=e(41869),p=e(54414),v=e(51553),m=r.__importStar(e(20868)),_=e(79865),s=e(44781),g=e(38390),l=e(17280),h=e(84303),u=e(38029),d=e(16170),E=e(64582),f=e(5905),a="inlinevaluedecoration",b=100,y=150,A=500,{flatten:S}=c.arrays;class w{constructor(R,P){this.column=R,this.text=P}}function T(M,R,P=1073741824){return R.length>y&&(R=R.substr(0,y)+"..."),{range:{startLineNumber:M,endLineNumber:M,startColumn:P,endColumn:P},renderOptions:{after:{contentText:R,backgroundColor:"rgba(255, 200, 0, 0.2)",margin:"10px"},dark:{after:{color:"rgba(255, 255, 255, 0.5)"}},light:{after:{color:"rgba(0, 0, 0, 0.5)"}}}}}function D(M,R,P,k){const F=new Map;for(const j of M)if(F.set(j.name,j.value),F.size>=b)break;const L=new Map;F.forEach((j,W)=>{const U=k.get(W);if(U)for(const Q of U)R.containsPosition(new c.Position(Q,0))&&(L.has(Q)||L.set(Q,[]),L.get(Q).indexOf(W)===-1&&L.get(Q).push(W))});const B=[];return L.forEach((j,W)=>{const U=j.sort((Q,V)=>{const $=P.getLineContent(W);return $.indexOf(Q)-$.indexOf(V)}).map(Q=>`${Q} = ${F.get(Q)}`).join(", ");B.push(T(W,U))}),B}function I(M){const R=new Map;if(!M)return R;for(let P=1,k=M.getLineCount();P<=k;++P){const F=M.getLineContent(P);if(F.length>A)continue;M.tokenization.forceTokenization(P);const L=M.tokenization.getLineTokens(P);for(let B=0,j=L.getCount();B<j;B++)if(L.getStandardTokenType(B)===g.StandardTokenType.Other){f.DEFAULT_WORD_REGEXP.lastIndex=0;const U=L.getStartOffset(B),Q=L.getEndOffset(B),V=F.substring(U,Q),$=f.DEFAULT_WORD_REGEXP.exec(V);if($){const Y=$[0];R.has(Y)||R.set(Y,[]),R.get(Y).push(P)}}}return R}let O=n=class{constructor(R){this.editor=R,this.disposer=new c.Disposable,this.editorDisposer=new c.Disposable}contribute(R){return this.disposer.addDispose(this.debugSessionManager.onDidChangeActiveDebugSession(()=>{const P=this.debugSessionManager.currentSession;P&&(this.editorDisposer.addDispose(P.onDidChange(async()=>{var k,F;this.setHoverEnabled(R,P.state===E.DebugState.Running);const L=(k=P.currentThread)===null||k===void 0?void 0:k.currentFrame;L&&R.currentUri&&!((F=L.source)===null||F===void 0)&&F.uri.isEqual(R.currentUri)&&await this.toggleExceptionWidget()})),this.editorDisposer.addDispose(P.onDidExitAdapter(()=>{this.setHoverEnabled(R,!0)})),this.editorDisposer.addDispose(this.editorService.onActiveResourceChange(k=>{var F;k?.uri.toString()===((F=P.getModel())===null||F===void 0?void 0:F.uri.toString())?this.setHoverEnabled(R):this.setHoverEnabled(R,!0)})),this.disposer.addDispose([c.Event.any(P.onDidChangeCallStack,P.onDidStop)(async()=>{await this.directRunUpdateInlineValueDecorations(R)}),P.onDidExitAdapter(()=>{this.removeInlineValuesScheduler(R).schedule(),this.editorDisposer.dispose()})]),this.disposer.addDispose(P.onDidChangeState(k=>{k!==E.DebugState.Stopped&&this.toggleExceptionWidget()})),this.disposer.addDispose(P),this.registerEditorListener(R))})),this.disposer.addDispose(this.debugSessionManager.onDidDestroyDebugSession(()=>{this.closeExceptionWidget()})),this.disposer.addDispose(this.editorDisposer),this.toggleExceptionWidget(),this.disposer}registerEditorListener(R){this.editorDisposer.addDispose(R.monacoEditor.onKeyDown(async P=>{var k,F,L,B,j;if(((L=(F=(k=this.debugSessionManager.currentSession)===null||k===void 0?void 0:k.currentFrame)===null||F===void 0?void 0:F.source)===null||L===void 0?void 0:L.uri.toString())===((B=R.currentUri)===null||B===void 0?void 0:B.toString())&&P.keyCode===m.KeyCode.Alt){this.setHoverEnabled(R,!0),(j=this.debugModelManager.model)===null||j===void 0||j.getDebugHoverWidget().hide();const W=R.monacoEditor.onKeyUp(async U=>{var Q;U.keyCode===m.KeyCode.Alt&&(this.setHoverEnabled(R,!1),(Q=this.debugModelManager.model)===null||Q===void 0||Q.getDebugHoverWidget().show(),W.dispose())})}})),this.editorDisposer.addDispose(R.monacoEditor.onDidChangeModelContent(async()=>{n.MEMOIZER.clear(),await this.directRunUpdateInlineValueDecorations(R)})),this.editorDisposer.addDispose(R.monacoEditor.onDidChangeModel(async()=>{this.toggleExceptionWidget(),await this.directRunUpdateInlineValueDecorations(R)}))}registerDecorationType(){this.overrideServicesRegistry.getRegisteredService(c.ServiceNames.CODE_EDITOR_SERVICE).registerDecorationType("inline-value-decoration",a,{})}setHoverEnabled(R,P=!this.debugContextKey.contextInDebugMode.get()){R.monacoEditor.updateOptions({hover:{enabled:P}})}async directRunUpdateInlineValueDecorations(R){var P;const k=(P=this.debugSessionManager.currentSession)===null||P===void 0?void 0:P.currentFrame;k&&(n.MEMOIZER.clear(),await this.updateInlineValueDecorations(k,R))}removeInlineValuesScheduler(R){return new c.RunOnceScheduler(()=>R.monacoEditor.removeDecorationsByType(a),100)}async updateInlineValueDecorations(R,P){var k;if(!P)return;const F="{0} = {1}",L=", ",B=P.monacoEditor.getModel();if(!this.preferenceService.get("debug.inline.values")||!B||!R||B.uri.toString()!==((k=R.source)===null||k===void 0?void 0:k.uri.toString())){this.removeInlineValuesScheduler(P).isScheduled()||this.removeInlineValuesScheduler(P).schedule();return}this.removeInlineValuesScheduler(P).cancel();let j;if(_.languageFeaturesService.inlineValuesProvider.has(B)){const W=async(H,K)=>{const Z=await R.getMostSpecificScopes(R.range()),X=K?H:H.toLowerCase();for(const ie of Z){await ie.ensureLoaded();const le=(ie.children||[]).find(pe=>K?pe.name===X:pe.name.toLowerCase()===X);if(le)return le.value}},U={frameId:R.raw.id,stoppedLocation:(()=>{const H=R.range();return new s.Range(H.startLineNumber,H.startColumn+1,H.endLineNumber,H.endColumn+1)})()},Q=new c.CancellationTokenSource().token,V=P.monacoEditor.getVisibleRanges(),$=_.languageFeaturesService.inlineValuesProvider.ordered(B).reverse();j=[];const Y=new Map,z=S($.map(H=>V.map(K=>Promise.resolve(H.provideInlineValues(B,K,U,Q)).then(async Z=>{if(Z)for(const X of Z){let ie;switch(X.type){case"text":ie=X.text;break;case"variable":{let oe=X.variableName;oe||(oe=B.getLineContent(X.range.startLineNumber).substring(X.range.startColumn-1,X.range.endColumn-1));const le=await W(oe,X.caseSensitiveLookup);le&&(ie=c.strings.format(F,oe,le));break}case"expression":{let oe=X.expression;if(oe||(oe=B.getLineContent(X.range.startLineNumber).substring(X.range.startColumn-1,X.range.endColumn-1)),oe){const le=new d.DebugWatchRoot(R.thread.session),pe=new d.DebugWatchNode(R.thread.session,oe,le);await pe.evaluate(oe),pe.available&&(ie=c.strings.format(F,oe,pe.description))}break}}if(ie){const oe=X.range.startLineNumber;let le=Y.get(oe);le||(le=[],Y.set(oe,le)),le.some(pe=>pe.text===ie)||le.push(new w(X.range.startColumn,ie))}}},Z=>{(0,c.onUnexpectedExternalError)(Z)}))));await Promise.all(z),Y.forEach((H,K)=>{if(H.length>0){H=H.sort((X,ie)=>X.column-ie.column);const Z=H.map(X=>X.text).join(L);j.push(T(K,Z))}})}else{const W=await R.getMostSpecificScopes(R.range());j=(await Promise.all(W.map(async Q=>{await Q.ensureLoaded();const V=Q.children||[],$=R.range(),Y=Q.range();let z=new s.Range(0,0,$.startLineNumber,$.startColumn);return Y&&(z=z.setStartPosition(Y.startLineNumber,Y.startColumn)),D(V,z,B,I(P?.monacoEditor.getModel()))}))).reduce((Q,V)=>Q.concat(V),[])}P.monacoEditor.setDecorationsByType("inline-value-decoration",a,j)}async toggleExceptionWidget(){var R,P;const k=this.debugSessionManager.currentSession;if(!k){this.closeExceptionWidget();return}const{currentThread:F}=k;if(!F){this.closeExceptionWidget();return}const L=F.frames.find(j=>!!(j&&j.source&&j.source.available&&j.source.presentationHint!=="deemphasize"));if(!L){this.closeExceptionWidget();return}const B=(R=this.editor.currentUri)===null||R===void 0?void 0:R.isEqual((P=L.source)===null||P===void 0?void 0:P.uri);if(this.debugExceptionWidget&&!B)this.closeExceptionWidget();else if(B){const j=await F?.fetchExceptionInfo();j&&this.showExceptionWidget(j,k,L.range().startLineNumber,L.range().startColumn)}}showExceptionWidget(R,P,k,F){this.debugExceptionWidget&&this.debugExceptionWidget.dispose();const L=P?.currentEditor();this.debugExceptionWidget=this.injector.get(h.DebugExceptionWidget,[L,R]),this.debugExceptionWidget.show(m.positionToRange({lineNumber:k,column:F}),10),this.debugExceptionWidget.focus(),L?.revealRangeInCenter({startLineNumber:k,startColumn:F,endLineNumber:k,endColumn:F}),this.debugContextKey.contextExceptionWidgetVisible.set(!0)}closeExceptionWidget(){this.debugExceptionWidget&&(this.debugContextKey.contextExceptionWidgetVisible.set(!1),this.debugExceptionWidget.dispose(),this.debugExceptionWidget=void 0)}};t.DebugEditorContribution=O,O.MEMOIZER=(0,c.createMemoizer)(),r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],O.prototype,"injector",void 0),r.__decorate([(0,o.Autowired)(c.IContextKeyService),r.__metadata("design:type",Object)],O.prototype,"contextKeyService",void 0),r.__decorate([(0,o.Autowired)(E.IDebugModelManager),r.__metadata("design:type",Object)],O.prototype,"debugModelManager",void 0),r.__decorate([(0,o.Autowired)(E.IDebugSessionManager),r.__metadata("design:type",u.DebugSessionManager)],O.prototype,"debugSessionManager",void 0),r.__decorate([(0,o.Autowired)(c.PreferenceService),r.__metadata("design:type",Object)],O.prototype,"preferenceService",void 0),r.__decorate([(0,o.Autowired)(c.MonacoOverrideServiceRegistry),r.__metadata("design:type",c.MonacoOverrideServiceRegistry)],O.prototype,"overrideServicesRegistry",void 0),r.__decorate([(0,o.Autowired)(p.WorkbenchEditorService),r.__metadata("design:type",v.WorkbenchEditorServiceImpl)],O.prototype,"editorService",void 0),r.__decorate([(0,o.Autowired)(l.DebugContextKey),r.__metadata("design:type",l.DebugContextKey)],O.prototype,"debugContextKey",void 0),t.DebugEditorContribution=O=n=r.__decorate([(0,o.Injectable)(),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[Object])],O)},74257:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugExpressionProvider=void 0;const n=e(85608),r=e(76003),o=e(43718),c=n.__importStar(e(20868)),p=e(39266),{coalesce:v}=o.arrays;let m=class{async get(s,g){var l,h;let u,d;if(this.evaluatableExpressionService.hasEvaluatableExpressProvider(s)){const E=new o.CancellationTokenSource,f=this.evaluatableExpressionService.getSupportedEvaluatableExpressionProvider(s),a=new c.Position(g.startLineNumber,g.startColumn),b=f.map(A=>Promise.resolve(A.provideEvaluatableExpression(s,a,E.token)).then(S=>S,()=>{})),y=await Promise.all(b).then(v);y.length>0&&(u=(l=y[0])===null||l===void 0?void 0:l.expression,d=(h=y[0])===null||h===void 0?void 0:h.range,!u&&d&&(u=s.getLineContent(a.lineNumber).substring(d.startColumn-1,d.endColumn-1)))}else{const E=s.getLineContent(g.startLineNumber),{start:f,end:a}=this.getExactExpressionStartAndEnd(E,g.startColumn,g.endColumn);u=E.substring(f-1,a)}return u}getExactExpressionStartAndEnd(s,g,l){let h,u=0;const d=/([^()[\]{}<>\s+\-/%~#^;=|,`!]|->)+/g;let E=null;for(;E=d.exec(s);){const f=E.index+1,a=f+E[0].length;if(f<=g&&a>=l){h=E[0],u=f;break}}if(h){const f=/\w+/g;let a=null;for(;(a=f.exec(h))&&!(a.index+1+u+a[0].length>=l););a&&(h=h.substring(0,f.lastIndex))}return h?{start:u,end:u+h.length-1}:{start:0,end:0}}};t.DebugExpressionProvider=m,n.__decorate([(0,r.Autowired)(p.IEvaluatableExpressionService),n.__metadata("design:type",Object)],m.prototype,"evaluatableExpressionService",void 0),t.DebugExpressionProvider=m=n.__decorate([(0,r.Injectable)()],m)},3367:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverModel=void 0;const r=e(85608),o=e(76003),c=e(97267),p=e(41869),v=e(98650);let m=n=class extends c.TreeModel{constructor(s){super(),this.flushDispatchChangeDelayer=new p.ThrottledDelayer(n.DEFAULT_FLUSH_DELAY),this.init(s)}init(s){this.root=s,this.root.watcher.on(c.TreeNodeEvent.BranchDidUpdate,()=>{this.flushDispatchChangeDelayer.isTriggered()||this.flushDispatchChangeDelayer.cancel(),this.flushDispatchChangeDelayer.trigger(async()=>{this.dispatchChange()})})}};t.DebugHoverModel=m,m.DEFAULT_FLUSH_DELAY=100,t.DebugHoverModel=m=n=r.__decorate([(0,o.Injectable)({multiple:!0}),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[v.ExpressionContainer])],m)},23217:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverSource=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(64582),p=e(38029),v=e(98650);let m=class{constructor(){this.onDidChangeEmitter=new o.Emitter,this.onDidChange=this.onDidChangeEmitter.event}dispose(){this._expression=void 0}get expression(){return this._expression}clearEvaluate(){this.onDidChangeEmitter.fire(void 0)}async evaluate(s){const g=await this.doEvaluate(s);return this._expression=g,this.onDidChangeEmitter.fire(g),g}async doEvaluate(s){const{currentSession:g}=this.sessions;if(g){if(g.capabilities.supportsEvaluateForHovers){const l=new v.DebugHoverVariableRoot(s,g);return await l.evaluate("hover"),l.available&&l||void 0}return this.findVariable(s.split(".").map(l=>l.trim()).filter(l=>!!l))}}async findVariable(s){const{currentFrame:g}=this.sessions;if(!g)return;let l;const h=await g.getScopes();for(const u of h){const d=await this.doFindVariable(u,s);if(!l)l=d;else if(d&&d.value!==l.value)return}return l}async doFindVariable(s,g){await s.ensureLoaded();const l=s.children,h=[];if(l){for(const u of l)(u instanceof v.DebugVariableContainer||u instanceof v.DebugVariable)&&u.name===g[0]&&h.push(u);if(h.length===1)return g.length===1?h[0]:this.doFindVariable(h[0],g.slice(1))}}};t.DebugHoverSource=m,n.__decorate([(0,r.Autowired)(c.IDebugSessionManager),n.__metadata("design:type",p.DebugSessionManager)],m.prototype,"sessions",void 0),t.DebugHoverSource=m=n.__decorate([(0,r.Injectable)()],m)},85322:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverTreeModelService=void 0;const r=e(85608),o=e(76003),c=e(97267),p=e(41869),v=e(98650),m=r.__importDefault(e(57259)),_=e(3367),s=e(23217),{Path:g}=p.path;let l=n=class{constructor(){this._changeEventDispatchQueue=[],this.selectedDecoration=new c.Decoration(m.default.mod_selected),this.focusedDecoration=new c.Decoration(m.default.mod_focused),this.loadingDecoration=new c.Decoration(m.default.mod_loading),this._selectedNodes=[],this.onDidRefreshedEmitter=new p.Emitter,this.onDidUpdateTreeModelOrVariableEmitter=new p.Emitter,this.disposableCollection=new p.DisposableCollection,this.activeNodeDecoration=(u,d=!0)=>{if(this.preContextMenuFocusedNode&&(this.focusedDecoration.removeTarget(this.preContextMenuFocusedNode),this.selectedDecoration.removeTarget(this.preContextMenuFocusedNode),this.preContextMenuFocusedNode=null),u){if(this.selectedNodes.length>0)for(const E of this.selectedDecoration.appliedTargets.keys())this.selectedDecoration.removeTarget(E);this.focusedNode&&this.focusedDecoration.removeTarget(this.focusedNode),this.selectedDecoration.addTarget(u),this.focusedDecoration.addTarget(u),this._focusedNode=u,this._selectedNodes=[u],d&&this.treeModel.dispatchChange()}},this.activeNodeFocusedDecoration=(u,d=!1)=>{this.focusedNode!==u&&(d?(this.preContextMenuFocusedNode?(this.focusedDecoration.removeTarget(this.preContextMenuFocusedNode),this.selectedDecoration.removeTarget(this.preContextMenuFocusedNode)):this.focusedNode&&this.focusedDecoration.removeTarget(this.focusedNode),this.preContextMenuFocusedNode=u):this.focusedNode&&(this.preContextMenuFocusedNode=null,this.focusedDecoration.removeTarget(this.focusedNode)),u&&(this.selectedDecoration.addTarget(u),this.focusedDecoration.addTarget(u),this._focusedNode=u,this._selectedNodes.push(u))),this.treeModel.dispatchChange()},this.enactiveNodeDecoration=()=>{this.focusedNode&&(this.focusedDecoration.removeTarget(this.focusedNode),this.treeModel.dispatchChange()),this._focusedNode=void 0},this.handleTreeBlur=()=>{this.enactiveNodeDecoration()},this.handleTwistierClick=u=>{v.ExpressionContainer.is(u)?(this.activeNodeDecoration(u,!1),this.toggleDirectory(u)):this.activeNodeDecoration(u)},this.toggleDirectory=async u=>{u.expanded?this.treeHandle.collapseNode(u):this.treeHandle.expandNode(u)},this.flushEventQueue=()=>{let u;if(!this._changeEventDispatchQueue||this._changeEventDispatchQueue.length===0)return;this._changeEventDispatchQueue.sort((E,f)=>{const a=g.pathDepth(E),b=g.pathDepth(f);return a-b});const d=[this._changeEventDispatchQueue[0]];for(const E of this._changeEventDispatchQueue)d.some(f=>E.indexOf(f)===0)||d.push(E);return u=(0,p.pSeries)(d.map(E=>async()=>{var f;const a=(f=this.treeModel.root)===null||f===void 0?void 0:f.watchEvents.get(E);return a&&typeof a.callback=="function"&&await a.callback({type:c.WatchEvent.Changed,path:E}),null})),this._changeEventDispatchQueue=[],u},this.debugHoverSource.onDidChange(async u=>{if(!u){this.onDidUpdateTreeModelOrVariableEmitter.fire({treeModel:void 0,variable:void 0});return}u instanceof v.DebugVariable?(this.dispose(),this.onDidUpdateTreeModelOrVariableEmitter.fire({variable:u})):(await this.initTreeModel(u),this.onDidUpdateTreeModelOrVariableEmitter.fire({treeModel:this.treeModel}))})}get onDidRefreshed(){return this.onDidRefreshedEmitter.event}get onDidUpdateTreeModelOrVariable(){return this.onDidUpdateTreeModelOrVariableEmitter.event}get flushEventQueuePromise(){return this.flushEventQueueDeferred&&this.flushEventQueueDeferred.promise}get treeHandle(){return this._debugHoverTreeHandle}get decorations(){return this._decorations}get treeModel(){return this._treeModel}get whenReady(){return this._whenReady}get focusedNode(){return this._focusedNode}get selectedNodes(){return this._selectedNodes}dispose(){this.disposableCollection.disposed||this.disposableCollection.dispose()}listenTreeViewChange(){var u,d;this.dispose(),this.disposableCollection.push((u=this.treeModel)===null||u===void 0?void 0:u.root.watcher.on(c.TreeNodeEvent.WillResolveChildren,E=>{this.loadingDecoration.addTarget(E)})),this.disposableCollection.push((d=this.treeModel)===null||d===void 0?void 0:d.root.watcher.on(c.TreeNodeEvent.DidResolveChildren,E=>{this.loadingDecoration.removeTarget(E)}))}async initTreeModel(u){if(u)return this._treeModel=this.injector.get(_.DebugHoverModel,[u]),this.initDecorations(u),this.listenTreeViewChange(),this._treeModel}initDecorations(u){this._decorations=new c.DecorationsManager(u),this._decorations.addDecoration(this.selectedDecoration),this._decorations.addDecoration(this.focusedDecoration),this._decorations.addDecoration(this.loadingDecoration)}removeNodeDecoration(){this.decorations&&(this.decorations.removeDecoration(this.selectedDecoration),this.decorations.removeDecoration(this.focusedDecoration))}handleTreeHandler(u){this._debugHoverTreeHandle=u}async refresh(u=this.treeModel.root){!v.ExpressionContainer.is(u)&&u.parent&&(u=u.parent),this.queueChangeEvent(u.path,()=>{this.onDidRefreshedEmitter.fire()})}queueChangeEvent(u,d){this.flushEventQueueDeferred||(this.flushEventQueueDeferred=new p.Deferred,clearTimeout(this._eventFlushTimeout),this._eventFlushTimeout=setTimeout(async()=>{var E;await this.flushEventQueue(),(E=this.flushEventQueueDeferred)===null||E===void 0||E.resolve(),this.flushEventQueueDeferred=null,d()},n.DEFAULT_FLUSH_FILE_EVENT_DELAY)),this._changeEventDispatchQueue.indexOf(u)===-1&&this._changeEventDispatchQueue.push(u)}};t.DebugHoverTreeModelService=l,l.DEFAULT_FLUSH_FILE_EVENT_DELAY=100,r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],l.prototype,"injector",void 0),r.__decorate([(0,o.Autowired)(s.DebugHoverSource),r.__metadata("design:type",s.DebugHoverSource)],l.prototype,"debugHoverSource",void 0),t.DebugHoverTreeModelService=l=n=r.__decorate([(0,o.Injectable)(),r.__metadata("design:paramtypes",[])],l)},65960:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverWidget=void 0;const r=e(85608),o=r.__importDefault(e(12784)),c=r.__importDefault(e(14041)),p=r.__importDefault(e(25873)),v=e(76003),m=e(41869),_=r.__importStar(e(20868)),s=e(62663),g=e(64582),l=e(38029),h=e(74257),u=e(23217),d=e(63940);let E=n=class{constructor(){this.toDispose=new m.DisposableCollection,this.allowEditorOverflow=!0,this.doSchedule=(0,o.default)(a=>a(),300),this.init()}init(){this.toDispose.pushAll([m.Disposable.create(()=>this.editor.removeContentWidget(this)),m.Disposable.create(()=>this.hide()),this.sessions.onDidChange(()=>{this.isEditorFrame()||this.hide()})]),this.renderView()}handleWindowWheel(a){a.stopPropagation()}getId(){return n.ID}getDomNode(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.classList.add(n.ID)),this.domNode}getPosition(){var a;const b=this.options&&this.options.selection.getStartPosition(),y=b&&((a=this.editor.getModel())===null||a===void 0?void 0:a.getWordAtPosition(b));return b&&y?{position:new _.Position(b.lineNumber,y.startColumn),preference:[s.monacoBrowser.editor.ContentWidgetPositionPreference.BELOW,s.monacoBrowser.editor.ContentWidgetPositionPreference.ABOVE]}:null}dispose(){this.toDispose.dispose()}show(a){this.schedule(()=>this.doShow(a),a&&a.immediate)}hide(a){this.schedule(()=>this.doHide(),a&&a.immediate)}schedule(a,b=!0){b?(this.doSchedule.cancel(),a()):this.doSchedule(a)}isEditorFrame(){const{currentFrame:a}=this.sessions;return!!a&&!!a.source&&!!this.editor.getModel()&&this.editor.getModel().uri.toString()===a.source.uri.toString()}doHide(){window.removeEventListener("mousewheel",this.handleWindowWheel,!0),this.getDomNode().contains(document.activeElement)&&this.editor.focus(),this.hoverSource.dispose(),this.hoverSource.clearEvaluate(),this.options=void 0,this.editor.removeContentWidget(this)}layoutContentWidget(){this.editor.layoutContentWidget(this)}renderView(){p.default.createRoot(this.getDomNode()).render(c.default.createElement(m.ConfigProvider,{value:this.configContext},c.default.createElement(d.DebugHoverView,null))),this.layoutContentWidget()}async doShow(a=this.options){if(!this.isEditorFrame()||!a||this.options&&this.options.selection.equalsRange(a.selection))return;this.options=a;const b=await this.expressionProvider.get(this.editor.getModel(),a.selection);b&&(this.hoverSource.clearEvaluate(),await this.hoverSource.evaluate(b)&&(this.reporterService.point(g.DEBUG_REPORT_NAME===null||g.DEBUG_REPORT_NAME===void 0?void 0:g.DEBUG_REPORT_NAME.DEBUG_VARIABLES,"hover",b),this.editor.addContentWidget(this),window.addEventListener("mousewheel",this.handleWindowWheel,!0)))}};t.DebugHoverWidget=E,E.ID="debug-hover-widget",r.__decorate([(0,v.Autowired)(g.DebugEditor),r.__metadata("design:type",Object)],E.prototype,"editor",void 0),r.__decorate([(0,v.Autowired)(g.IDebugSessionManager),r.__metadata("design:type",l.DebugSessionManager)],E.prototype,"sessions",void 0),r.__decorate([(0,v.Autowired)(h.DebugExpressionProvider),r.__metadata("design:type",h.DebugExpressionProvider)],E.prototype,"expressionProvider",void 0),r.__decorate([(0,v.Autowired)(u.DebugHoverSource),r.__metadata("design:type",u.DebugHoverSource)],E.prototype,"hoverSource",void 0),r.__decorate([(0,v.Autowired)(m.AppConfig),r.__metadata("design:type",Object)],E.prototype,"configContext",void 0),r.__decorate([(0,v.Autowired)(m.IReporterService),r.__metadata("design:type",Object)],E.prototype,"reporterService",void 0),t.DebugHoverWidget=E=n=r.__decorate([(0,v.Injectable)(),r.__metadata("design:paramtypes",[])],E)},63940:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverView=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),c=e(97267),p=e(41869),v=e(1149),m=e(28875),_=e(85322),s=n.__importDefault(e(94084)),g=()=>{const l=(0,p.useInjectable)(_.DebugHoverTreeModelService),h=(0,p.useInjectable)(v.LayoutViewSizeConfig),u=250,d=420,E=4,[f,a]=o.default.useState({}),[b,y]=o.default.useState(u),A=o.default.useRef(null);o.default.useEffect(()=>(l.onDidUpdateTreeModelOrVariable(async M=>{const{treeModel:R,variable:P}=M;R&&await R.ensureReady,a({treeModel:R,variable:P})}),S(),()=>{l.removeNodeDecoration()}),[]),o.default.useEffect(()=>{let M;return y(u),f.treeModel&&(M=f.treeModel.root.watcher.on(c.TreeNodeEvent.DidChangeExpansionState,()=>{var R,P;const k=Math.max(u,(((R=f.treeModel)===null||R===void 0?void 0:R.root.branchSize)||0)*22),F=(P=A.current)===null||P===void 0?void 0:P.getBoundingClientRect();if(F){const L=F.top,B=window.innerHeight-L-h.statusBarHeight-E;y(Math.min(B,k,d))}else y(Math.min(d,k))})),()=>{M?.dispose()}},[f.treeModel]);const S=async()=>{l.treeModel&&(await l.treeModel.ensureReady,a({treeModel:l.treeModel}))},w=M=>{l.handleTreeHandler({...M,getModel:()=>f?.treeModel,hasDirectFocus:()=>A.current===document.activeElement})},T=(M,R)=>{M.stopPropagation();const{handleTwistierClick:P}=l;R&&P(R)},D=!!f.treeModel&&!!f.treeModel.root.variablesReference,I=o.default.useCallback(M=>{const R=l.decorations.getDecorations(M.item);return o.default.createElement(m.DebugVariableRenderedNode,{item:M.item,itemType:M.itemType,decorations:R,onClick:T,onTwistierClick:T,defaultLeftPadding:0,leftPadding:4})},[f.treeModel]),O=()=>D?o.default.createElement("div",{className:s.default.debug_hover_content,tabIndex:-1,ref:A},o.default.createElement(c.RecycleTree,{height:b,itemHeight:m.DEBUG_VARIABLE_TREE_NODE_HEIGHT,onReady:w,model:f.treeModel,placeholder:()=>o.default.createElement("span",null),overflow:"auto"},I)):null;return o.default.createElement("div",{className:s.default.debug_hover},f.treeModel?o.default.createElement("div",{className:(0,r.default)(s.default.debug_hover_title,D&&s.default.has_complex_value),title:f.treeModel.root.name},f.treeModel.root.name):f.variable&&o.default.createElement("div",{className:(0,r.default)(s.default.debug_hover_title,D&&s.default.has_complex_value),title:f.variable.name},f.variable.value),O())};t.DebugHoverView=g},71569:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugModelManager=void 0;const n=e(85608),r=e(76003),o=e(43718),c=e(54414),p=e(64582),v=e(99797),m=e(37499);let _=class extends o.Disposable{constructor(){super(),this.toDispose=new o.DisposableCollection,this._onMouseDown=new o.Emitter,this._onMouseMove=new o.Emitter,this._onMouseLeave=new o.Emitter,this._onMouseUp=new o.Emitter,this.onMouseDown=this._onMouseDown,this.onMouseMove=this._onMouseMove,this.onMouseLeave=this._onMouseLeave,this.onMouseUp=this._onMouseUp,this._onModelChanged=new o.Emitter,this.onModelChanged=this._onModelChanged.event,this.models=new Map}dispose(){for(const g of this.models.values())this.toDispose.pushAll(g);this.toDispose.dispose(),this.models.clear()}init(){this.editorCollection.onCodeEditorCreate(g=>this.push(g)),this.breakpointManager.onDidChangeBreakpoints(g=>{const{currentEditor:l}=this.editorService,h=l&&l.currentUri;h&&this.render(h),this.closeBreakpointIfAffected(g)})}get model(){const{currentEditor:g}=this.editorService,l=g&&g.currentUri;if(l){const h=this.models.get(l.toString());return h&&h[0]}}closeBreakpointIfAffected({affected:g,removed:l}){g.forEach(h=>{const u=this.models.get(h.toString());if(u)for(const d of u){const E=d.getBreakpointWidget(),f=E.position;if(!f)return;for(const a of l)a.raw.line===f.lineNumber&&E.dispose()}})}render(g){const l=this.models.get(g.toString());if(l)for(const h of l)h.render()}push(g){const l=g.monacoEditor;g.onRefOpen(u=>{const d=u.instance.uri.toString(),E=this.models.get(d)||[];let f=!1;if(E.length>0){for(const a of E)if(a.getEditor()._id===l._id){a.render(),f=!0;break}}if(!f){const a=u.instance.getMonacoModel(),b=this.debugModelFactory(l);E.push(b),this.models.set(d,E),a.onWillDispose(()=>{b.dispose(),this.models.delete(d)})}});const h=(u,d)=>{const E=l.getModel();if(!E)throw new Error("Not find model");this.handleMouseEvent(new o.URI(E.uri.toString()),u,d,l)};this.toDispose.push(l.onMouseMove(u=>h(p.DebugModelSupportedEventType.move,u))),this.toDispose.push(l.onMouseDown(u=>h(p.DebugModelSupportedEventType.down,u))),this.toDispose.push(l.onMouseLeave(u=>h(p.DebugModelSupportedEventType.leave,u))),this.toDispose.push(l.onContextMenu(u=>h(p.DebugModelSupportedEventType.contextMenu,u))),this.toDispose.push(l.onDidChangeModel(u=>this._onModelChanged.fire(u)))}resolve(g){const l=this.models.get(g.toString());if(l)return l}handleMouseEvent(g,l,h,u){const d=this.models.get(g.toString());if(!(!d||!this.debugConfigurationManager.canSetBreakpointsIn(d[0].getEditor().getModel()))){for(const f of d)if(f.getEditor().getId()===u.getId()){switch(l){case p.DebugModelSupportedEventType.contextMenu:f.onContextMenu(h);break;case p.DebugModelSupportedEventType.down:f.onMouseDown(h);break;case p.DebugModelSupportedEventType.leave:f.onMouseLeave(h);break;case p.DebugModelSupportedEventType.move:f.onMouseMove(h);break;default:break}break}}}};t.DebugModelManager=_,n.__decorate([(0,r.Autowired)(c.WorkbenchEditorService),n.__metadata("design:type",c.WorkbenchEditorService)],_.prototype,"editorService",void 0),n.__decorate([(0,r.Autowired)(c.EditorCollectionService),n.__metadata("design:type",c.EditorCollectionService)],_.prototype,"editorCollection",void 0),n.__decorate([(0,r.Autowired)(p.DebugModelFactory),n.__metadata("design:type",Function)],_.prototype,"debugModelFactory",void 0),n.__decorate([(0,r.Autowired)(v.BreakpointManager),n.__metadata("design:type",v.BreakpointManager)],_.prototype,"breakpointManager",void 0),n.__decorate([(0,r.Autowired)(m.DebugConfigurationManager),n.__metadata("design:type",m.DebugConfigurationManager)],_.prototype,"debugConfigurationManager",void 0),t.DebugModelManager=_=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],_)},91260:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugModel=void 0;const r=e(85608),o=r.__importDefault(e(12784)),c=e(76003),p=e(41869),v=e(93899),m=e(43718),_=r.__importStar(e(20868)),s=e(62663),g=e(52416),l=e(64582),h=e(24395),u=e(26296),d=e(99797),E=e(38949),f=e(38029),a=e(97319),b=e(17475),y=e(65960),A=r.__importStar(e(26571));let S=n=class{static createContainer(D,I){return D.createChild([{token:h.DebugEditor,useValue:I},{token:y.DebugHoverWidget,useClass:y.DebugHoverWidget},{token:b.DebugBreakpointWidget,useClass:b.DebugBreakpointWidget},{token:l.IDebugModel,useClass:n}])}static createModel(D,I){return n.createContainer(D,I).get(l.IDebugModel)}get uri(){return this._uri}constructor(){this.toDispose=new m.DisposableCollection,this.frameDecorations=[],this.updatingDecorations=!1,this.breakpointDecorations=[],this.breakpointRanges=new Map,this.currentBreakpointDecorations=[],this.candidateDecorations=[],this.renderFrames=(0,o.default)((D=[])=>{var I;if(this.toDispose.disposed||((I=this.editor.getModel())===null||I===void 0?void 0:I.uri.toString())!==this._uri.toString())return;const O=this.createFrameDecorations().concat(D);this.frameDecorations=this.deltaDecorations(this.frameDecorations,O)},100),this.toggleBreakpoint=(D=this.position)=>{this.doToggleBreakpoint(D)},this.openBreakpointView=(D,I,O)=>{this.breakpointWidget.show(D,I,O)},this.closeBreakpointView=()=>{this.breakpointWidget.hide()},this.acceptBreakpoint=()=>{const{position:D,values:I}=this.breakpointWidget;if(this.reporterService.point(l.DEBUG_REPORT_NAME===null||l.DEBUG_REPORT_NAME===void 0?void 0:l.DEBUG_REPORT_NAME.DEBUG_BREAKPOINT,this.breakpointWidget.breakpointType),D&&I){const O=this.getBreakpoint(D);O?(O.raw.condition=I.condition,O.raw.hitCondition=I.hitCondition,O.raw.logMessage=I.logMessage,this.breakpointManager.updateBreakpoint(O)):this.breakpointManager.addBreakpoint(d.DebugBreakpoint.create(this._uri,{line:D.lineNumber,...I})),this.breakpointWidget.hide()}},this.hintDecorations=[],this.init()}async init(){const D=this.editor.getModel();let I;this._uri=new m.URI(D.uri.toString()),this.decorator=new E.DebugDecorator,this.toDispose.pushAll([this.breakpointWidget,this.editor.onKeyDown(()=>this.debugHoverWidget.hide({immediate:!1})),this.editor.onDidChangeModelContent(()=>this.renderFrames()),this.debugSessionManager.onDidChange(()=>this.renderFrames()),this.debugBreakpointsService.onDidFocusedBreakpoints(({range:O})=>{this.preferenceService.getValid("debug.breakpoint.editorHint",!0)&&(this.renderFrames([{options:A.FOCUS_BREAKPOINTS_STACK_FRAME_DECORATION,range:O}]),I&&clearTimeout(I),I=window.setTimeout(()=>{this.renderFrames(),clearTimeout(I)},300))}),this.editor.getModel().onDidChangeContent(()=>this.updateBreakpoints()),this.editor.onDidChangeModel(()=>{this.closeBreakpointView()})]),this.renderFrames(),this.render()}dispose(){this.toDispose.dispose()}get position(){return this._position||this.editor.getPosition()}get breakpoint(){return this.getBreakpoint()}getBreakpoint(D){return this.breakpointManager.getBreakpoint(this._uri,D?D.lineNumber:void 0)}createFrameDecorations(){var D;const I=[],{currentFrame:O,topFrame:M}=this.debugSessionManager;if(!O||!O.source||O.source.uri.toString()!==((D=this.editor.getModel())===null||D===void 0?void 0:D.uri.toString()))return I;const R=new _.Range(O.raw.line,O.raw.column,O.raw.line,1<<30),P=new _.Range(O.raw.line,O.raw.column,O.raw.line,O.raw.column+1);if(M===O)if(I.push({options:A.TOP_STACK_FRAME_MARGIN,range:P}),O.thread.stoppedDetails&&O.thread.stoppedDetails.reason==="exception")I.push({options:A.TOP_STACK_FRAME_EXCEPTION_DECORATION,range:R});else{I.push({options:A.TOP_STACK_FRAME_DECORATION,range:R});const{topFrameRange:k}=this;k&&k.startLineNumber===O.raw.line&&k.startColumn!==O.raw.column&&I.push({options:A.TOP_STACK_FRAME_INLINE_DECORATION,range:R}),this.topFrameRange=R}else I.push({options:A.FOCUSED_STACK_FRAME_MARGIN,range:P}),I.push({options:A.FOCUSED_STACK_FRAME_DECORATION,range:R});return I}deltaDecorations(D,I){this.updatingDecorations=!0;try{return this.editor.deltaDecorations(D,I)}finally{this.updatingDecorations=!1}}focusStackFrame(){this.renderFrames()}async render(){await this.renderBreakpoints(),this.renderFrames()}async renderBreakpoints(){await this.breakpointManager.whenReady,this.renderNormalBreakpoints(),this.renderCurrentBreakpoints()}renderNormalBreakpoints(){const D=this.createBreakpointDecorations();this.breakpointDecorations=this.deltaDecorations(this.breakpointDecorations,D),this.updateBreakpointRanges()}updateBreakpoints(){if(this.areBreakpointsAffected()){const D=this.createBreakpoints();this.breakpointManager.setBreakpoints(this._uri,D)}}areBreakpointsAffected(){if(this.updatingDecorations||!this.editor.getModel())return!1;for(const D of this.breakpointDecorations){const I=this.editor.getModel().getDecorationRange(D),O=this.breakpointRanges.get(D);if(!I||!I.equalsRange(O))return!0}return!1}createBreakpoints(){const{_uri:D}=this,I=new Set,O=[];for(const M of this.breakpointDecorations){const R=this.editor.getModel().getDecorationRange(M);if(R&&!I.has(R.startLineNumber)){const P=R.startLineNumber,k=this.breakpointRanges.get(M),F=k&&this.breakpointManager.getBreakpoint(D,k.startLineNumber)||{},L=d.DebugBreakpoint.create(D,{...F.raw||{},line:P},F.enabled);O.push(L),I.add(P)}}return O}createBreakpointDecorations(){return this.breakpointManager.getBreakpoints(this._uri).map(I=>this.createBreakpointDecoration(I))}createBreakpointDecoration(D){const I=D.raw.line,O=D.raw.column||0;return{range:new _.Range(I,O,I,O+1),options:{description:"breakpoint-decoration",stickiness:A.STICKINESS}}}async renderCurrentBreakpoints(){const D=this.breakpointManager.getBreakpoints(this._uri),I=this.createCurrentBreakpointDecorations(),O=this.deltaDecorations(this.currentBreakpointDecorations.map(({decorationId:P})=>P),I);this.currentBreakpointDecorations.forEach(P=>{P.inlineWidget&&P.inlineWidget.dispose()}),this.currentBreakpointDecorations=O.map((P,k)=>{const F=I[k],L=D[k],B=(L.enabled?A.BREAKPOINT_DECORATION:A.BREAKPOINT_DECORATION_DISABLED).glyphMarginClassName,j=F.options.beforeContentClassName?new w(this.editor,P,B,L,this.breakpointManager):void 0;return{breakpoint:L,decorationId:P,inlineWidget:j}});const M=await this.getCandidateBreakpoints(D),R=this.deltaDecorations(this.candidateDecorations.map(({decorationId:P})=>P),M);this.candidateDecorations.forEach(P=>{P.inlineWidget.dispose()}),this.candidateDecorations=R.map((P,k)=>{const{breakpoint:F}=M[k],L=(F?A.BREAKPOINT_DECORATION:A.BREAKPOINT_DECORATION_DISABLED).glyphMarginClassName,B=new w(this.editor,P,L,F,this.breakpointManager);return{decorationId:P,inlineWidget:B}})}async getCandidateBreakpoints(D){const I=this.editor.getModel(),O=this.debugSessionManager.currentSession;if(!I||!O?.capabilities.supportsBreakpointLocationsRequest)return[];const M=Array.from(new Set(D.map(P=>P.raw.line))),R=[];return await Promise.all(M.map(async P=>{const k=await O.breakpointLocations(this._uri,P);if(k.length<=1)return;const F=I.getLineCount();if(P>F)return;const L=I.getLineFirstNonWhitespaceColumn(P),B=I.getLineLastNonWhitespaceColumn(P);k.forEach(j=>{const W=new _.Range(j.lineNumber,j.column,j.lineNumber,j.column+1);if(j.column<=L||j.column>B)return;const U=this.currentBreakpointDecorations.find(({breakpoint:Q})=>Q.raw.line===W.startLineNumber&&Q.raw.column===W.startColumn);U?.inlineWidget||R.push({range:W,options:{description:"debug-breakpoint-placeholder",stickiness:_.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,beforeContentClassName:U?void 0:"debug-breakpoint-placeholder"},breakpoint:U?.breakpoint})})})),R}createCurrentBreakpointDecorations(){return this.breakpointManager.getBreakpoints(this._uri).filter(I=>(0,d.isDebugBreakpoint)(I)).map(I=>this.createCurrentBreakpointDecoration(I))}createCurrentBreakpointDecoration(D){const I=this.debugSessionManager.currentSession,O=D.status.get(I&&I.id||""),M=O&&O.line?O.line:D.raw.line,R=D.raw.column||0,P=this.editor.getModel(),k=P.getLineCount(),F=M>k?!1:R>P.getLineFirstNonWhitespaceColumn(M),L=new _.Range(M,R,M,R+1),{className:B,message:j}=this.decorator.getDecoration(D,!!I,this.breakpointManager.breakpointsEnabled),W=this.preferenceService.getValid("debug.breakpoint.showBreakpointsInOverviewRuler",!1);let U=null;return W&&(U={color:this.themeService.getColor({id:g.debugIconBreakpointForeground}),position:_.editor.OverviewRulerLane.Left}),{range:L,options:{description:"debug-breakpoint-placeholder",glyphMarginClassName:B,glyphMarginHoverMessage:j.map(Q=>({value:Q})),stickiness:A.STICKINESS,beforeContentClassName:F?"debug-breakpoint-placeholder":void 0,overviewRuler:U}}}updateBreakpointRanges(){this.breakpointRanges.clear();for(const D of this.breakpointDecorations){const I=this.editor.getModel().getDecorationRange(D);this.breakpointRanges.set(D,I)}}showHover(D){const I=D.target.type,O=m.isOSX?"metaKey":"ctrlKey";D.event.altKey||I===s.monacoBrowser.editor.MouseTargetType.CONTENT_WIDGET&&D.target.detail===this.debugHoverWidget.getId()&&!D.event[O]||(I===s.monacoBrowser.editor.MouseTargetType.CONTENT_TEXT?this.debugHoverWidget.show({selection:D.target.range,immediate:!1}):this.debugHoverWidget.hide({immediate:!1}))}hideHover({event:D}){const I=this.debugHoverWidget.getDomNode().getBoundingClientRect();(D.posx<I.left||D.posx>I.right||D.posy<I.top||D.posy>I.bottom)&&this.debugHoverWidget.hide({immediate:!1})}doToggleBreakpoint(D=this.position){const I=this.breakpointManager.getBreakpoints(this._uri,{lineNumber:D.lineNumber});if(I.length)for(const O of I)this.breakpointManager.delBreakpoint(O);else this.breakpointManager.addBreakpoint(d.DebugBreakpoint.create(this._uri,{line:D.lineNumber}))}get contributedContextMenu(){return this.menuService.createMenu(v.MenuId.DebugBreakpointsContext,this.contextKeyService)}onContextMenu(D){var I;if(this.marginFreeFromNonDebugDecorations((I=D.target.position)===null||I===void 0?void 0:I.lineNumber)&&D.target&&D.target.type===s.monacoBrowser.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const O=this.breakpointManager.getBreakpoint(this._uri,D.target.position.lineNumber);this.breakpointManager.selectedBreakpoint={breakpoint:O,model:this};const M=this.contributedContextMenu,R=(0,v.generateMergedCtxMenu)({menus:M});this.ctxMenuRenderer.show({anchor:D.event.browserEvent,menuNodes:R,args:[D.target.position]})}}marginFreeFromNonDebugDecorations(D){const I=this.editor.getLineDecorations(D);if(Array.isArray(I))for(const{options:O}of I){const M=O.glyphMarginClassName;if(M&&(M.includes("testing-run-glyph")||M.includes("interface-navigation-glyph")))return!1}return!0}onMouseDown(D){var I;this.marginFreeFromNonDebugDecorations((I=D.target.position)===null||I===void 0?void 0:I.lineNumber)&&(D.target&&D.target.type===s.monacoBrowser.editor.MouseTargetType.GUTTER_GLYPH_MARGIN&&(D.event.rightButton||(this.editor.focus(),this.toggleBreakpoint(D.target.position))),this.hintBreakpoint(D))}onMouseMove(D){var I;if(!this.marginFreeFromNonDebugDecorations((I=D.target.position)===null||I===void 0?void 0:I.lineNumber)){this.onMouseLeave(D);return}this.showHover(D),this.hintBreakpoint(D)}onMouseLeave(D){this.hideHover(D),this.deltaHintDecorations([])}hintBreakpoint(D){const I=this.createHintDecorations(D);this.deltaHintDecorations(I)}deltaHintDecorations(D){this.hintDecorations=this.deltaDecorations(this.hintDecorations,D)}createHintDecorations(D){if(D.target&&D.target.type===s.monacoBrowser.editor.MouseTargetType.GUTTER_GLYPH_MARGIN||D.target.type===s.monacoBrowser.editor.MouseTargetType.GUTTER_LINE_NUMBERS){const I=D.target.position.lineNumber;return this.breakpointManager.getBreakpoint(this._uri,I)?[]:[{range:new _.Range(I,1,I,1),options:A.BREAKPOINT_HINT_DECORATION}]}return[]}getBreakpoints(D,I){return this.breakpointManager.getBreakpoints(D,I)}getEditor(){return this.editor}getBreakpointWidget(){return this.breakpointWidget}getDebugHoverWidget(){return this.debugHoverWidget}};t.DebugModel=S,r.__decorate([(0,c.Autowired)(h.DebugEditor),r.__metadata("design:type",Object)],S.prototype,"editor",void 0),r.__decorate([(0,c.Autowired)(b.DebugBreakpointWidget),r.__metadata("design:type",b.DebugBreakpointWidget)],S.prototype,"breakpointWidget",void 0),r.__decorate([(0,c.Autowired)(y.DebugHoverWidget),r.__metadata("design:type",y.DebugHoverWidget)],S.prototype,"debugHoverWidget",void 0),r.__decorate([(0,c.Autowired)(u.IDebugSessionManager),r.__metadata("design:type",f.DebugSessionManager)],S.prototype,"debugSessionManager",void 0),r.__decorate([(0,c.Autowired)(a.DebugBreakpointsService),r.__metadata("design:type",a.DebugBreakpointsService)],S.prototype,"debugBreakpointsService",void 0),r.__decorate([(0,c.Autowired)(d.BreakpointManager),r.__metadata("design:type",d.BreakpointManager)],S.prototype,"breakpointManager",void 0),r.__decorate([(0,c.Autowired)(v.AbstractMenuService),r.__metadata("design:type",v.AbstractMenuService)],S.prototype,"menuService",void 0),r.__decorate([(0,c.Autowired)(p.IContextKeyService),r.__metadata("design:type",Object)],S.prototype,"contextKeyService",void 0),r.__decorate([(0,c.Autowired)(v.ICtxMenuRenderer),r.__metadata("design:type",v.ICtxMenuRenderer)],S.prototype,"ctxMenuRenderer",void 0),r.__decorate([(0,c.Autowired)(p.IReporterService),r.__metadata("design:type",Object)],S.prototype,"reporterService",void 0),r.__decorate([(0,c.Autowired)(p.PreferenceService),r.__metadata("design:type",Object)],S.prototype,"preferenceService",void 0),r.__decorate([(0,c.Autowired)(g.IThemeService),r.__metadata("design:type",Object)],S.prototype,"themeService",void 0),r.__decorate([m.memoize,r.__metadata("design:type",Object),r.__metadata("design:paramtypes",[])],S.prototype,"contributedContextMenu",null),t.DebugModel=S=n=r.__decorate([(0,c.Injectable)(),r.__metadata("design:paramtypes",[])],S);class w extends m.Disposable{constructor(D,I,O,M,R){super(),this.editor=D,this.decorationId=I,this.breakpoint=M,this.breakpointManager=R,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.range=this.editor.getModel().getDecorationRange(I),this.addDispose(this.editor.onDidChangeModelDecorations(()=>{const k=this.editor.getModel().getDecorationRange(this.decorationId);this.range&&!this.range.equalsRange(k)&&(this.range=k,this.editor.layoutContentWidget(this))})),this.addDispose(m.Disposable.create(()=>{this.editor.removeContentWidget(this)})),this.create(O),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(D){const I=document.createElement("div");I.className="inline-breakpoint-widget",D&&(0,p.addClassName)(I,D),this.domNode=I;const{EditorOption:O}=_.editor,M=()=>{const R=this.editor.getOption(O.lineHeight);I.style.height=`${R}px`,I.style.width=`${Math.ceil(.8*R)}px`,I.style.marginLeft="4px"};M(),this.addDispose(new p.DomListener(I,"click",async()=>{this.breakpoint?this.breakpointManager.delBreakpoint(this.breakpoint):this.breakpointManager.addBreakpoint(d.DebugBreakpoint.create(this.editor.getModel().uri,{line:this.range.startLineNumber,column:this.range.startColumn}))})),this.addDispose(this.editor.onDidChangeConfiguration(R=>{(R.hasChanged(O.fontSize)||R.hasChanged(O.lineHeight))&&M()}))}getId(){return(0,m.uuid)()}getDomNode(){return this.domNode}getPosition(){return this.range?(this.domNode.classList.toggle("line-start",this.range.startColumn===1),{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn-1},preference:[s.monacoBrowser.editor.ContentWidgetPositionPreference.EXACT]}):null}}r.__decorate([m.memoize,r.__metadata("design:type",Function),r.__metadata("design:paramtypes",[]),r.__metadata("design:returntype",void 0)],w.prototype,"getId",null)},78606:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugRunToCursorService=void 0;const n=e(85608),r=e(76003),o=e(54414),c=e(26296),p=e(66089),v=e(38029),m=e(97319);let _=class{constructor(){}async run(g,l=!1){const h=this.sessionManager.currentSession;if(!h||h.state!==c.DebugState.Stopped)return;const u=this.workbenchEditorService.currentEditor;if(u){if(!u.monacoEditor)return}else return;const{monacoEditor:d}=u,E=d.getPosition();if(!(d.hasModel()&&E))return;const f=h.getModel();if(!f)return;const a=!!f.getBreakpoints(g,{column:E.column,lineNumber:E.lineNumber}).length;let b,y=h.currentThread,A=[];if(!a){l&&(A=f.getBreakpoints().filter(T=>T.enabled).filter(T=>T.raw.column!==E.column&&T.raw.line!==E.lineNumber),A.forEach(T=>{this.debugBreakpointsService.toggleBreakpointEnable(T)}));const w=await this.addBreakpoints(g,E);if(!w){this.recoverStatus(A);return}w.thread&&(y=w.thread),w.breakpoint&&(b=w.breakpoint)}if(!y){this.recoverStatus(A);return}const S=y.session.onDidChangeState(()=>{const w=h.state;(w===c.DebugState.Stopped||w===c.DebugState.Inactive)&&(b&&h.delBreakpoint(b),S.dispose())});await y.continue(),this.recoverStatus(A)}async addBreakpoints(g,l){const h=this.sessionManager.currentSession;if(!h)return;let u=1;const d=h.currentFrame;d&&d.range().startLineNumber===l.lineNumber&&(u=l.column||1);const E=p.DebugBreakpoint.create(g,{line:l.lineNumber,column:u});if(await h.addBreakpoint(E,!0),!E)return{breakpoint:void 0,thread:h.currentThread};let f=h.currentThread,a=0;const b=h.threads.filter(y=>y.stopped);if(a<3&&h.currentThread&&b.includes(h.currentThread)&&(f=h.currentThread,a=3),a<2){const y=b.find(A=>A.topFrame);y&&(f=y,a=2)}return a<1&&(f=b[0],a=2),{thread:f,breakpoint:E}}recoverStatus(g){g.forEach(l=>{this.debugBreakpointsService.toggleBreakpointEnable(l)})}};t.DebugRunToCursorService=_,n.__decorate([(0,r.Autowired)(c.IDebugSessionManager),n.__metadata("design:type",v.DebugSessionManager)],_.prototype,"sessionManager",void 0),n.__decorate([(0,r.Autowired)(o.WorkbenchEditorService),n.__metadata("design:type",o.WorkbenchEditorService)],_.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(m.DebugBreakpointsService),n.__metadata("design:type",m.DebugBreakpointsService)],_.prototype,"debugBreakpointsService",void 0),t.DebugRunToCursorService=_=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],_)},26571:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BREAKPOINT_DECORATION_DISABLED=t.BREAKPOINT_DECORATION=t.BREAKPOINT_HINT_DECORATION=t.TOP_STACK_FRAME_INLINE_DECORATION=t.FOCUSED_STACK_FRAME_DECORATION=t.TOP_STACK_FRAME_EXCEPTION_DECORATION=t.FOCUS_BREAKPOINTS_STACK_FRAME_DECORATION=t.TOP_STACK_FRAME_DECORATION=t.FOCUSED_STACK_FRAME_MARGIN=t.TOP_STACK_FRAME_MARGIN=t.BREAK_PONINT_HOVER_MARGIN=t.STICKINESS=void 0;const r=e(85608).__importStar(e(20868));t.STICKINESS=r.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,t.BREAK_PONINT_HOVER_MARGIN={description:"debug-hover",glyphMarginClassName:"sumi-debug-hover",linesDecorationsClassName:"sumi-debug-hover",isWholeLine:!0},t.TOP_STACK_FRAME_MARGIN={description:"debug-top-stack-frame",glyphMarginClassName:"sumi-debug-top-stack-frame",stickiness:t.STICKINESS},t.FOCUSED_STACK_FRAME_MARGIN={description:"debug-focused-stack-frame",glyphMarginClassName:"sumi-debug-focused-stack-frame",stickiness:t.STICKINESS},t.TOP_STACK_FRAME_DECORATION={description:"debug-top-stack-frame-line",isWholeLine:!0,className:"sumi-debug-top-stack-frame-line",stickiness:t.STICKINESS},t.FOCUS_BREAKPOINTS_STACK_FRAME_DECORATION={description:"focus-breakpoints-stack-frame-line",isWholeLine:!0,className:"sumi-focus-breakpoints-stack-frame-line",stickiness:t.STICKINESS},t.TOP_STACK_FRAME_EXCEPTION_DECORATION={description:"debug-top-stack-frame-exception-line",isWholeLine:!0,className:"sumi-debug-top-stack-frame-exception-line",stickiness:t.STICKINESS},t.FOCUSED_STACK_FRAME_DECORATION={description:"debug-focused-stack-frame-line",isWholeLine:!0,className:"sumi-debug-focused-stack-frame-line",stickiness:t.STICKINESS},t.TOP_STACK_FRAME_INLINE_DECORATION={description:"debug-top-stack-frame-column",beforeContentClassName:"sumi-debug-top-stack-frame-column"},t.BREAKPOINT_HINT_DECORATION={description:"debug-breakpoint-hint",glyphMarginClassName:"sumi-debug-breakpoint-hint",stickiness:t.STICKINESS},t.BREAKPOINT_DECORATION={description:"debug-breakpoint",glyphMarginClassName:"sumi-debug-breakpoint",stickiness:t.STICKINESS},t.BREAKPOINT_DECORATION_DISABLED={description:"debug-breakpoint-disabled",glyphMarginClassName:"sumi-debug-breakpoint-disabled",stickiness:t.STICKINESS}},39266:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EvaluatableExpressionServiceImpl=t.IEvaluatableExpressionService=void 0;const n=e(85608),r=e(76003),o=e(40497),c=new o.LanguageFeatureRegistry;t.IEvaluatableExpressionService=Symbol("IEvaluatableExpressionService");let p=class{getSupportedEvaluatableExpressionProvider(m){return c.ordered(m)}registerEvaluatableExpressionProvider(m,_){return c.register(m,_)}hasEvaluatableExpressProvider(m){return c.has(m)}};t.EvaluatableExpressionServiceImpl=p,t.EvaluatableExpressionServiceImpl=p=n.__decorate([(0,r.Injectable)()],p)},75935:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(17475),t),n.__exportStar(e(65960),t),n.__exportStar(e(91260),t),n.__exportStar(e(71569),t),n.__exportStar(e(26571),t),n.__exportStar(e(74257),t)},33969:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugModule=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(91825),p=e(64582),v=e(99797),m=e(3005),_=e(37499),s=e(59053),g=e(31141),l=e(40453),h=e(90408),u=e(97186),d=e(38029),E=e(75935),f=e(23217),a=e(39266),b=e(23434),y=e(52369),A=e(44888),S=e(84784),w=e(15153),T=e(11456),D=e(37243),I=e(86752),O=e(14600);e(51377);let M=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:f.DebugHoverSource,useClass:f.DebugHoverSource},{token:E.DebugExpressionProvider,useClass:E.DebugExpressionProvider},{token:p.IDebugModelManager,useClass:E.DebugModelManager},{token:p.IDebugSessionManager,useClass:d.DebugSessionManager},{token:v.BreakpointManager,useClass:v.BreakpointManager},{token:_.DebugConfigurationManager,useClass:_.DebugConfigurationManager},{token:a.IEvaluatableExpressionService,useClass:a.EvaluatableExpressionServiceImpl},{token:c.FolderFilePreferenceProvider,useClass:b.LaunchFolderPreferenceProvider,dropdownForTag:!0,tag:"launch"},{token:p.DebugModelFactory,useFactory:P=>k=>E.DebugModel.createModel(P,k)},{token:u.DebugSessionContributionRegistry,useClass:u.DebugSessionContributionRegistryImpl},{token:p.IDebugService,useClass:h.DebugService},{token:p.ILaunchService,useClass:A.LaunchService},{token:p.IDebugProgress,useClass:l.DebugProgressService},{token:p.IDebugConsoleModelService,useClass:w.DebugConsoleModelService},y.LaunchPreferencesContribution,s.DebugContribution,T.DebugConsoleContribution,I.VariablesPanelContribution,D.DebugCallStackContribution,O.WatchPanelContribution,{token:m.DebugCallStackItemTypeKey,useFactory:P=>P.get(o.IContextKeyService).createKey("callStackItemType")}],this.contributionProvider=u.DebugSessionContribution,this.preferences=g.injectDebugPreferences,this.isOverlay=!0,this.component=S.DebugToolbarOverlayWidget}};t.DebugModule=M,t.DebugModule=M=n.__decorate([(0,r.Injectable)()],M)},39553:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(35721),t),n.__exportStar(e(20391),t)},35721:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MarkerManager=t.MarkerCollection=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(14951);class p{constructor(_,s){this.uri=_,this.kind=s,this.owner2Markers=new Map}get empty(){return!this.owner2Markers.size}getOwners(){return Array.from(this.owner2Markers.keys())}getMarkers(_){return this.owner2Markers.get(_)||[]}setMarkers(_,s){const g=this.owner2Markers.get(_);return s.length>0?this.owner2Markers.set(_,s.map(l=>this.createMarker(_,l))):this.owner2Markers.delete(_),g||[]}createMarker(_,s){return Object.freeze({uri:this.uri.toString(),kind:this.kind,owner:_,data:s})}findMarkers(_){if(_.owner)return this.owner2Markers.has(_.owner)?this.filterMarkers(_,this.owner2Markers.get(_.owner)):[];{const s=[];for(const g of this.owner2Markers.values())s.push(...this.filterMarkers(_,g));return s}}filterMarkers(_,s){return s?_.dataFilter?s.filter(g=>_.dataFilter(g.data)):s:[]}}t.MarkerCollection=p;let v=class{constructor(){this.uri2MarkerCollection=new Map,this.onDidChangeMarkersEmitter=new o.Emitter,this.init()}init(){this.fileService.onFilesChanged(_=>{const s=_.filter(({type:g})=>g===c.FileChangeType.DELETED);s.length&&this.cleanMarkers(s)})}cleanMarkers(_){for(const s of this.uri2MarkerCollection.keys()){const g=new o.URI(s);c.FileChangeEvent.isDeleted(_,g)&&this.cleanAllMarkers(g)}}get onDidChangeMarkers(){return this.onDidChangeMarkersEmitter.event}fireOnDidChangeMarkers(_){this.onDidChangeMarkersEmitter.fire(_)}setMarkers(_,s,g){const l=_.toString(),h=this.uri2MarkerCollection.get(l)||new p(_,this.getKind()),u=h.setMarkers(s,g);return h.empty?this.uri2MarkerCollection.delete(_.toString()):this.uri2MarkerCollection.set(l,h),this.fireOnDidChangeMarkers(_),u}findMarkers(_={}){if(_.uri){const g=this.uri2MarkerCollection.get(_.uri.toString());return g?g.findMarkers(_):[]}const s=[];for(const g of this.getUris())s.push(...this.uri2MarkerCollection.get(g).findMarkers(_));return s}getUris(){return this.uri2MarkerCollection.keys()}cleanAllMarkers(_){if(_)this.doCleanAllMarkers(_);else for(const s of this.getUris())this.doCleanAllMarkers(new o.URI(s))}doCleanAllMarkers(_){const s=_.toString();this.uri2MarkerCollection.get(s)!==void 0&&(this.uri2MarkerCollection.delete(s),this.fireOnDidChangeMarkers(_))}};t.MarkerManager=v,n.__decorate([(0,r.Autowired)(c.IFileServiceClient),n.__metadata("design:type",Object)],v.prototype,"fileService",void 0),t.MarkerManager=v=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],v)},20391:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},88776:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSource=t.DebugSourceData=void 0;const n=e(41869);class r{}t.DebugSourceData=r;class o extends r{constructor(p,v,m,_,s){super(),this.session=p,this.labelProvider=v,this.modelManager=m,this.workbenchEditorService=_,this.fileSystem=s}get uri(){return o.toUri(this.raw)}get available(){return!!this.raw}get presentationHint(){return this.raw.presentationHint}update(p){Object.assign(this,p)}async open(p,v){if(this.uri.scheme===o.SCHEME){const m=await this.load();await this.fileSystem.setContent({uri:this.uri.toString(),lastModification:0},m)}if(v&&v.raw){const{line:m,column:_}=v.raw,s={startLineNumber:m,startColumn:typeof _=="number"?_:0,endLineNumber:m,endColumn:1/0};await this.workbenchEditorService.open(this.uri,{...p,range:s}),v.thread.currentFrame=v;const g=this.modelManager.resolve(this.uri);if(g)for(const l of g)l.focusStackFrame()}else await this.workbenchEditorService.open(this.uri,p)}async load(){const p=this.raw,v=p.sourceReference;return(await this.session.sendRequest("source",{sourceReference:v,source:p})).body.content}get inMemory(){return this.uri.scheme===o.SCHEME}get reference(){return this.raw.sourceReference}get name(){return this.inMemory?this.raw.name||this.uri.path.base||this.uri.path.toString():this.labelProvider.getName(this.uri)}get longName(){return this.inMemory?this.name:this.labelProvider.getLongName(this.uri)}static toUri(p){if(p.sourceReference&&p.sourceReference>0)return new n.URI().withScheme(o.SCHEME).withPath(p.name).withQuery(String(p.sourceReference));if(!p.path)throw new Error("Unrecognized source type: "+JSON.stringify(p));return p.path.match(o.SCHEME_PATTERN)?new n.URI(p.path):new n.URI(n.Uri.file(p.path))}}t.DebugSource=o,o.SCHEME="debug",o.SCHEME_PATTERN=/^[a-zA-Z][a-zA-Z0-9\+\-\.]+:/},44485:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShowMoreDebugStackFrame=t.DebugStackFrame=t.DebugStackFrameData=void 0;const n=e(41869),r=e(44781),o=e(98650);class c{}t.DebugStackFrameData=c;class p extends c{static is(_){return!!_&&"raw"in _}constructor(_,s){super(),this.thread=_,this.session=s}get id(){return this.session.id+":"+this.thread.id+":"+this.raw.id}get source(){return this._source}update(_){Object.assign(this,_),this._source=this.raw.source&&this.session.getSource(this.raw.source)}async restart(){return this.session.capabilities.supportsRestartFrame?await this.session.sendRequest("restartFrame",{frameId:this.raw.id}):Promise.reject(new Error("restartFrame not supported"))}get canRestart(){return typeof this.raw.canRestart=="boolean"?this.raw.canRestart:!0}async open(_){if(!this.source)return;const{line:s,column:g,endLine:l,endColumn:h}=this.raw;let u={startLineNumber:s,startColumn:g,endLineNumber:s,endColumn:1/0};typeof l=="number"&&(u={...u,endLineNumber:l,endColumn:typeof h=="number"?h:1/0}),this.source.open({..._,range:u})}toArgs(_){return Object.assign({},_,{frameId:this.raw.id})}getScopes(_){return this.doGetScopes(_)}async doGetScopes(_){try{return(await this.session.sendRequest("scopes",this.toArgs())).body.scopes.map(g=>new o.DebugScope(g,this.session,_))}catch{return[]}}range(){const _=this.raw;return new r.Range(_.line,_.column,_.endLine||_.line,_.endColumn||_.column)}async getMostSpecificScopes(_){const g=(await this.doGetScopes()).filter(u=>!u.getRawScope().expensive);if(!g.some(u=>!!u.range()))return g;const h=g.filter(u=>u.range()&&r.Range.containsRange(u.range(),_)).sort((u,d)=>u.range().endLineNumber-u.range().startLineNumber-(d.range().endLineNumber-d.range().startLineNumber));return h.length?h:g}}t.DebugStackFrame=p;class v{constructor(_,s,g,l,h){this.nextFrame=_,this.frames=s,this.session=g,this.origin=l,this._open=h,this.open=()=>{this._open(this)}}get name(){return(0,n.formatLocalize)("debug.stack.showMoreAndOrigin",this.frames.length,this.origin)}get id(){var _;return`${this.session.id}:showMore:${(_=this.nextFrame)===null||_===void 0?void 0:_.id}`}}t.ShowMoreDebugStackFrame=v},7885:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugThread=t.DebugThreadData=void 0;const n=e(41869),r=e(64582),o=e(44485);class c{}t.DebugThreadData=c;class p extends c{constructor(m){super(),this.session=m,this._onDidChanged=new n.Emitter,this.onDidChanged=this._onDidChanged.event,this._frames=new Map,this.pendingFetch=Promise.resolve([])}get id(){return this.session.id+":"+this.raw.id}get threadId(){return this.raw.id}get currentFrame(){return this._currentFrame}set currentFrame(m){this._currentFrame=m,this._onDidChanged.fire()}get stopped(){return!!this.stoppedDetails}update(m){Object.assign(this,m),"stoppedDetails"in m&&this.clearFrames()}clear(){this.update({raw:this.raw,stoppedDetails:void 0})}continue(){return this.session.sendRequest("continue",this.toArgs())}stepOver(){return this.session.sendRequest("next",this.toArgs())}stepIn(){return this.session.sendRequest("stepIn",this.toArgs())}stepOut(){return this.session.sendRequest("stepOut",this.toArgs())}pause(){return this.session.sendRequest("pause",this.toArgs())}terminate(){return this.session.sendRequest("terminateThreads",{threadIds:[this.raw.id]})}get frames(){return Array.from(this._frames.values())}get topFrame(){return this.frames[0]}get frameCount(){return this._frames.size}async rawFetchFrames(m=20){return this.pendingFetch=this.pendingFetch.then(async()=>{try{const _=this.frameCount,s=await this.doFetchFrames(_,m);return this.doUpdateFrames(s)}catch{return[]}})}async fetchExceptionInfo(){var m;try{if(((m=this.stoppedDetails)===null||m===void 0?void 0:m.reason)==="exception"&&this.session.capabilities.supportsExceptionInfoRequest){const _=await this.session.exceptionInfo(this.toArgs());if(_)return{id:_.body.exceptionId,description:_.body.description,breakMode:_.body.breakMode,details:_.body.details}}}catch{return}}async fetchFrames(m=20){const _=await this.rawFetchFrames(m);return this.updateCurrentFrame(),_}async doFetchFrames(m,_){try{const s=await this.session.sendRequest("stackTrace",this.toArgs({startFrame:m,levels:_}));return this.stoppedDetails&&(this.stoppedDetails.totalFrames=s.body.totalFrames),s.body.stackFrames}catch(s){return this.stoppedDetails&&(this.stoppedDetails.framesErrorMessage=s.message),[]}}doUpdateFrames(m){const _=this.session.reportTime(r.DEBUG_REPORT_NAME.DEBUG_UI_FRONTEND_TIME,{sessionId:this.session.id,threadId:this.raw.id,threadAmount:this.session.threadCount}),s=new Map(this._frames);for(const l of m){const h=l.id;if(!this._frames.has(h)){const u=new o.DebugStackFrame(this,this.session);this._frames.set(h,u),u.update({raw:l}),s.set(h,u)}}const g=[...s.values()];return _("doUpdateFrames"),g}clearFrames(){this._frames.clear(),this.updateCurrentFrame()}updateCurrentFrame(){const{currentFrame:m}=this,_=m&&m.raw.id;this.currentFrame=typeof _=="number"&&this._frames.get(_)||this._frames.values().next().value}toArgs(m){return Object.assign({},m,{threadId:this.raw.id})}}t.DebugThread=p},14190:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugWatch=t.IDebugWatchData=void 0;const r=e(85608).__importDefault(e(97331)),o=e(41869),c=e(64582),p=e(98650);t.IDebugWatchData=Symbol("IDebugWatchData");class v{constructor(_,s){this.manager=_,this.reporterService=s,this.toDispose=new o.DisposableCollection,this.fireDidChange=(0,r.default)(()=>this.onDidChangeEmitter.fire(),50),this.fireVariableChange=(0,r.default)(()=>this.onDidVariableChangeEmitter.fire(),50),this.fireExpressionChange=(0,r.default)(g=>this.onDidExExpressionChangeEmitter.fire(g),50),this._expressions=[],this.onDidChangeEmitter=new o.Emitter,this.onDidVariableChangeEmitter=new o.Emitter,this.onDidExExpressionChangeEmitter=new o.Emitter,this.whenReady=this.init()}get onDidChange(){return this.onDidChangeEmitter.event}get onDidVariableChange(){return this.onDidVariableChangeEmitter.event}get onDidExpressionChange(){return this.onDidExExpressionChangeEmitter.event}async getRoot(){const _=[],s=new p.DebugWatchRoot(this.manager.currentSession);for(const g of this._expressions){const l=new p.DebugWatchNode(this.manager.currentSession,g,s);await l.evaluate(),_.push(l)}return s.updatePresetChildren(_),this._root=s,this._root}async init(){this.toDispose.push(this.manager.onDidStopDebugSession(()=>{this.fireDidChange()})),this.toDispose.push(this.manager.onDidDestroyDebugSession(()=>{this.fireDidChange()})),this.toDispose.push(this.manager.onDidChangeActiveDebugSession(()=>{const _=this.manager.currentSession;_&&(_.onVariableChange(()=>{this.fireVariableChange()}),_.onDidChangeCallStack(()=>{this.fireVariableChange()}))}))}async clear(){this.updateWatchExpressions([]),this.fireExpressionChange([]),this.fireDidChange()}async updateWatchExpressions(_){this._expressions=_}addWatchExpression(_){this.reporterService.point(c.DEBUG_REPORT_NAME===null||c.DEBUG_REPORT_NAME===void 0?void 0:c.DEBUG_REPORT_NAME.DEBUG_WATCH,c.DEBUG_COMMANDS.ADD_WATCHER.id,{value:_}),this._expressions.indexOf(_)===-1&&(this._expressions.push(_),this.fireExpressionChange(this._expressions))}renameWatchExpression(_,s){const g=this._expressions.indexOf(_);g>=0&&this._expressions.splice(g,1,s),this.fireExpressionChange(this._expressions)}removeWatchExpression(_){const s=this._expressions.indexOf(_);s>=0&&this._expressions.splice(s,1),this.fireExpressionChange(this._expressions)}}t.DebugWatch=v},50755:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(88776),t),n.__exportStar(e(44485),t),n.__exportStar(e(7885),t),n.__exportStar(e(14190),t)},53741:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CheckboxWidget=void 0;const n=e(85608),r=e(51632),o=n.__importDefault(e(14041)),c=e(97267),p=n.__importDefault(e(93089)),v=m=>{var _,s;const{disabled:g,formContext:l,id:h,label:u,hideLabel:d,onBlur:E,onChange:f,onFocus:a,readonly:b,value:y,registry:A,options:S,schema:w,uiSchema:T}=m,{readonlyAsDisabled:D=!0}=l,I=(0,r.getTemplate)("DescriptionFieldTemplate",A,S),O=({target:F})=>f(F.checked),P={onBlur:b?void 0:({target:F})=>E(h,F.checked),onFocus:b?void 0:({target:F})=>a(h,F.checked)},k=(s=(_=S.description)!==null&&_!==void 0?_:w.description)!==null&&s!==void 0?s:w.markdownDescription;return o.default.createElement("div",{className:p.default.checkbox_widget_control},!d&&o.default.createElement("label",{title:u,className:p.default.field_label},u),o.default.createElement(c.CheckBox,{checked:typeof y>"u"?!1:y,disabled:g||D&&b,id:h,name:h,onChange:b?void 0:O,...P,"aria-describedby":(0,r.ariaDescribedByIds)(h),label:k,className:p.default.checkbox}))};t.CheckboxWidget=v},93306:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnyOfField=void 0;const n=e(85608),r=e(51632),o=n.__importDefault(e(14041)),c=e(97267),p=n.__importDefault(e(93089)),v=m=>{var _,s;const{disabled:g,formContext:l,idSchema:h,onBlur:u,id:d,onChange:E,onFocus:f,options:a,placeholder:b,readonly:y,registry:A,name:S,required:w,schema:T,uiOptions:D}=m,{readonlyAsDisabled:I=!0}=l,O=({target:L})=>E(L.value===""?a.emptyValue:L.value),M=({target:L})=>u(d,L.value),R=({target:L})=>f(d,L.value),P=(s=(_=a.description)!==null&&_!==void 0?_:T.description)!==null&&s!==void 0?s:T.markdownDescription,k=(0,r.getTemplate)("TitleFieldTemplate",A,D),F=(0,r.getTemplate)("DescriptionFieldTemplate",A,D);return o.default.createElement("div",{className:p.default.any_of_widget_control},S&&o.default.createElement("div",{className:p.default.object_title},o.default.createElement(k,{id:(0,r.titleId)(h),title:S,required:w,schema:T,registry:A})),P&&o.default.createElement("div",{className:p.default.object_description},o.default.createElement(F,{id:(0,r.descriptionId)(h),description:P,schema:T,registry:A})),o.default.createElement(c.Input,{disabled:g||I&&y,onBlur:y?void 0:M,onChange:y?void 0:O,onFocus:y?void 0:R,placeholder:b,autoComplete:"off"}))};t.AnyOfField=v},32475:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayField=void 0;const n=e(85608),r=e(67030),o=n.__importStar(e(14041)),c=e(43718),p=(0,r.getDefaultRegistry)().fields.ArrayField,v=m=>{const{onChange:_}=m,s=(0,o.useCallback)(g=>{Array.isArray(g)&&_(g.map(l=>(0,c.isUndefined)(l)?"":l))},[_]);return o.default.createElement(p,{...m,onChange:s})};t.ArrayField=v},59299:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectField=void 0;const n=e(85608),r=e(67030),o=n.__importStar(e(14041)),c=e(41869),p=e(43718),v=e(64582),m=(0,r.getDefaultRegistry)().fields.ObjectField,_=s=>{const g=(0,c.useInjectable)(v.ILaunchService),{idSchema:l,onChange:h}=s;return(0,o.useEffect)(()=>{const{$id:u}=l,d=new p.Disposable;return u==="root"&&d.addDispose(g.onChangeFormData(E=>h(E))),()=>d.dispose()},[l]),o.default.createElement(m,{...s})};t.ObjectField=_},66216:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TitleField=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=n.__importDefault(e(93089)),c=p=>{const{title:v}=p;return v?r.default.createElement("label",{title:v,className:o.default.field_label},v):null};t.TitleField=c},81638:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelectWidget=void 0;const n=e(85608),r=e(51632),o=n.__importStar(e(14041)),c=e(97267),p=n.__importDefault(e(93089)),v=m=>{const{schema:_,value:s,id:g,registry:l,uiOptions:h,name:u,required:d,onChange:E}=m,f=_.description,a=(0,r.getTemplate)("TitleFieldTemplate",l,h),b=(0,r.getTemplate)("DescriptionFieldTemplate",l,h),y=(0,o.useMemo)(()=>_&&_.enum?_.enum:[],[_,_.enum]);return o.default.createElement("div",{className:p.default.select_widget_control},u&&o.default.createElement("div",{className:p.default.object_title},o.default.createElement(a,{id:(0,r.titleId)(g),title:u,required:d,schema:_,registry:l})),f&&o.default.createElement("div",{className:p.default.object_description},o.default.createElement(b,{id:(0,r.descriptionId)(g),description:f,schema:_,registry:l})),o.default.createElement(c.Select,{key:g,value:s,dropdownRenderType:"absolute",onChange:E},y.map(A=>o.default.createElement(c.Option,{value:A,label:A,key:A},A))))};t.SelectWidget=v},20023:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextWidget=void 0;const n=e(85608),r=e(51632),o=n.__importStar(e(14041)),c=e(97267),p=e(64582),v=e(5905),m=n.__importDefault(e(93089)),_=s=>{const{disabled:g,formContext:l,id:h,onBlur:u,onChange:d,onFocus:E,options:f,placeholder:a,readonly:b,schema:y,value:A,registry:S,label:w,hideLabel:T,required:D,uiSchema:I,uiOptions:O}=s,{readonlyAsDisabled:M=!0}=l,R=(0,r.getTemplate)("TitleFieldTemplate",S,O),P=(0,r.getTemplate)("DescriptionFieldTemplate",S,O),k=(0,o.useMemo)(()=>typeof A!="string"?A:(0,v.parseSnippet)(A),[A]),F=({target:W})=>{d(W.value===""?f.emptyValue:W.value),u(h,W.value)},L=({target:W})=>E(h,W.value),B=(0,o.useMemo)(()=>y.type!==p.JSON_SCHEMA_TYPE.STRING&&y.type!==p.JSON_SCHEMA_TYPE.NUMBER?p.JSON_SCHEMA_TYPE.STRING:y.type,[y,y.type]),j=(0,o.useMemo)(()=>y.description||"",[y,y.description]);return o.default.createElement("div",null,!T&&w&&o.default.createElement("div",{className:m.default.object_title},o.default.createElement(R,{id:(0,r.titleId)(h),title:w,required:D,schema:y,uiSchema:I,registry:S})),j&&o.default.createElement("div",{className:m.default.object_description},o.default.createElement(P,{id:(0,r.descriptionId)(h),description:j,schema:y,uiSchema:I,registry:S})),o.default.createElement(c.Input,{disabled:g||M&&b,id:h,name:h,onBlur:b?void 0:F,onFocus:b?void 0:L,placeholder:a,type:B,value:k,className:m.default.text_widget_control,autoComplete:"off"}))};t.TextWidget=_},23434:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LaunchFolderPreferenceProvider=void 0;const n=e(85608),r=e(76003),o=e(91825);let c=class extends o.FolderFilePreferenceProvider{parse(v){const m=super.parse(v);if(m!==void 0)return{launch:{...m}}}getPath(v){if(v==="launch")return[];if(v.startsWith("launch."))return[v.substr(7)]}};t.LaunchFolderPreferenceProvider=c,t.LaunchFolderPreferenceProvider=c=n.__decorate([(0,r.Injectable)()],c)},52369:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LaunchPreferencesContribution=t.LaunchResourceProvider=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(64102),p=e(39496),v=e(57517),m=e(4983),_=e(10938),s=e(67858);let g=class{constructor(){this.scheme=m.LAUNCH_VIEW_SCHEME}provideResource(u){return{supportsRevive:!0,name:(0,o.localize)("menu-bar.title.debug"),icon:(0,o.getIcon)("debug"),uri:u}}provideResourceSubname(){return null}async shouldCloseResource(){return!0}};t.LaunchResourceProvider=g,t.LaunchResourceProvider=g=n.__decorate([(0,r.Injectable)()],g);let l=class{constructor(){this.schema=_.launchPreferencesSchema,this.name="launch"}registerResource(u){u.registerResourceProvider(this.prefResourceProvider)}registerEditorComponent(u){u.registerEditorComponent({component:s.LaunchViewContainer,uid:m.LAUNCH_VIEW_COMPONENT_ID,scheme:m.LAUNCH_VIEW_SCHEME}),u.registerEditorComponentResolver(m.LAUNCH_VIEW_SCHEME,(d,E,f)=>{f([{type:v.EditorOpenType.component,componentId:m.LAUNCH_VIEW_COMPONENT_ID}])})}registerMenus(u){u.registerMenuItem(p.MenuId.EditorTitle,{command:o.COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION.id,iconClass:(0,o.getIcon)("open"),group:"navigation",when:`resourceScheme == ${m.LAUNCH_VIEW_SCHEME}`})}};t.LaunchPreferencesContribution=l,n.__decorate([(0,r.Autowired)(g),n.__metadata("design:type",g)],l.prototype,"prefResourceProvider",void 0),t.LaunchPreferencesContribution=l=n.__decorate([(0,o.Domain)(o.PreferenceContribution,o.PreferenceConfiguration,v.BrowserEditorContribution,c.MenuContribution)],l)},10938:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.launchPreferencesSchema=void 0;const n=e(64582);t.launchPreferencesSchema={type:"object",scope:"resource",properties:{launch:{$ref:n.launchSchemaUri,description:"Global debug launch configuration. Should be used as an alternative to 'launch.json' that is shared across workspaces",defaultValue:{configurations:[],compounds:[]}}}}},44888:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LaunchService=void 0;const n=e(85608),r=n.__importStar(e(23304)),o=n.__importDefault(e(41263)),c=e(76003),p=e(41869),v=e(43718),m=e(14951),_=e(64582),s="configurations";let g=class{constructor(){this._onRawSchemaProperties=new v.Emitter,this.onRawSchemaProperties=this._onRawSchemaProperties.event,this._onChangeSchema=new v.Emitter,this.onChangeSchema=this._onChangeSchema.event,this._onChangeFormData=new v.Emitter,this.onChangeFormData=this._onChangeFormData.event}get rawSchemaProperties(){return this._rawSchemaProperties}get schema(){return this._schema}get formData(){return this._formData}async openLaunchConfiguration(){await this.commandService.executeCommand(p.COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION.id)}setRawSchemaProperties(h){this._rawSchemaProperties=h,this._onRawSchemaProperties.fire(h)}nextNewSchema(h){this._schema=h,this._onChangeSchema.fire(h)}nextNewFormData(h,u=!0){this._formData=h,u&&this._onChangeFormData.fire(h)}addNewItem(h){if(h==="")return;const{properties:u}=this.rawSchemaProperties,d={...this.formData},E=u[h],{default:f,type:a}=E;(0,o.default)(d,h,f||this.getDefaultValue(a)),(0,o.default)(this.schema.properties,h,E),this.nextNewSchema(this.schema),this.nextNewFormData(d)}delItem(h){if(h==="")return;const{properties:u}=this.schema,d={...this.formData};delete d[h],delete u[h],this.nextNewSchema(this.schema),this.nextNewFormData(d)}getDefaultValue(h){switch(h){case _.JSON_SCHEMA_TYPE.ARRAY:return[];case _.JSON_SCHEMA_TYPE.BOOLEAN:return!1;case _.JSON_SCHEMA_TYPE.NULL:return null;case _.JSON_SCHEMA_TYPE.NUMBER:return 0;case _.JSON_SCHEMA_TYPE.OBJECT:return{};case _.JSON_SCHEMA_TYPE.STRING:default:return""}}async readResourceContent(h){try{const{content:u}=await this.fileSystem.readFile(h.toString());return u.toString()}catch{return""}}async modifyConfigurationsInResource(h,u,d){const E=await this.fileSystem.getFileStat(h.toString());if(E&&E.type===v.FileType.File){const{formData:f}=u,a=await this.readResourceContent(h),y=r.parse(a)[s];if(!y)return;Array.isArray(y)&&y.length-1>=d&&y.splice(d,1,f);const A=r.modify(a,[s],y,{isArrayInsertion:!1,formattingOptions:{tabSize:2,insertSpaces:!0,eol:`
|
|
31518
|
+
`;T[T.length-1]||T.pop();const D=T.map(O=>this.linkify(O,!1,S));if(D.length===1)return D[0];const I=document.createElement("span");return D.forEach(O=>I.appendChild(O)),I}const w=document.createElement("span");for(const T of this.detectLinks(y))try{switch(T.kind){case"text":w.appendChild(document.createTextNode(T.value));break;case"web":w.appendChild(this.createWebLink(T.value));break;case"path":{const D=T.captures[0],I=T.captures[1]?Number(T.captures[1]):0,O=T.captures[2]?Number(T.captures[2]):0;w.appendChild(this.createPathLink(T.value,D,I,O,S));break}}}catch{w.appendChild(document.createTextNode(T.value))}return w}createWebLink(y){const A=this.createLink(y),S=c.URI.parse(y);return this.decorateLink(A,async()=>{if(S.scheme===o.Schemes.file){const w=S.toString(),T=o.OS.type()===c.OperatingSystem.Windows?c.path.win32:c.path.posix,D=c.path.normalize(T.sep===c.path.posix.sep&&c.isWindows?w.replace(/\\/g,c.path.posix.sep):w);await this.workbenchEditorService.open(c.URI.parse(D));return}this.openerService.open(y)}),A}createPathLink(y,A,S,w,T){if(A[0]==="/"&&A[1]==="/")return document.createTextNode(y);if(A[0]==="."){if(!T)return document.createTextNode(y);const O=T.toResource(A),M=this.createLink(y);return this.decorateLink(M,()=>{this.workbenchEditorService.open(c.URI.parse(O.toString()))}),M}const D=this.createLink(y);D.tabIndex=0;const I=c.URI.file(c.path.normalize(A));return this.fileServiceClient.getFileStat(I.toString()).then(O=>{!O||O&&O.isDirectory||this.decorateLink(D,()=>{this.workbenchEditorService.open(c.URI.parse(I.toString()),{range:{startColumn:w,startLineNumber:S,endLineNumber:S,endColumn:w}})})}),D}createLink(y){const A=document.createElement("a");return A.textContent=y,A}decorateLink(y,A){y.classList.add(m.default.link),y.title=(0,o.formatLocalize)("debug.console.followLink",c.isMacintosh?"Cmd":"Ctrl"),y.onmousemove=S=>{y.classList.toggle(m.default.pointer,c.isMacintosh?S.metaKey:S.ctrlKey)},y.onmouseleave=()=>y.classList.remove(m.default.pointer),y.onclick=S=>{const w=window.getSelection();!w||w.type==="Range"||(c.isMacintosh?S.metaKey:S.ctrlKey)&&(S.preventDefault(),S.stopImmediatePropagation(),A(!1))}}detectLinks(y){if(!y)return[];if(y.length>f)return[{kind:"text",value:y,captures:[]}];const A=[s,E],S=["web","path"],w=[],T=(D,I)=>{if(I>=A.length){w.push({value:D,kind:"text",captures:[]});return}const O=A[I];let M=0,R;for(O.lastIndex=0;(R=O.exec(D))!==null;){const k=D.substring(M,R.index);k&&T(k,I+1);const F=R[0];w.push({value:F,kind:S[I],captures:R.slice(1)}),M=R.index+F.length}const P=D.substring(M);P&&T(P,I+1)};return T(y,0),w}};t.LinkDetector=a,n.__decorate([(0,r.Autowired)(p.WorkbenchEditorService),n.__metadata("design:type",p.WorkbenchEditorService)],a.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(v.IFileServiceClient),n.__metadata("design:type",Object)],a.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(o.IOpenerService),n.__metadata("design:type",Object)],a.prototype,"openerService",void 0),t.LinkDetector=a=n.__decorate([(0,r.Injectable)({multiple:!0})],a)},61752:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugMemoryFileSystemProvider=void 0;const n=e(85608),r=n.__importDefault(e(17228)),o=e(76003),c=e(43718),p=e(64582),v=e(38029),{Path:m}=c.path;let _=class{constructor(){this.memoryFdCounter=0,this.changeEmitter=new c.Emitter,this.fdMemory=new Map,this.capabilities=1028,this.onDidChangeCapabilities=c.Event.None,this.onDidChangeFile=this.changeEmitter.event,this.emptyBuffer=this.toBuffer("")}stat(l){return Promise.resolve({type:c.FileType.File,uri:l.toString(),mtime:0,ctime:0,size:0,lastModification:0,isDirectory:!1})}async readFile(l){const h=this.parseUri(l);if(!h)return this.emptyBuffer;if(!h.offset)return this.emptyBuffer;const{session:u,memoryReference:d,offset:E}=h,f=new Uint8Array(E.toOffset-E.fromOffset),a=this.memoryFdCounter++;let b=u.getMemory(d);return E&&(b=new s(b,E)),this.fdMemory.set(a,{session:u,region:b}),await this.read(a,E.fromOffset,f,0,f.length),f}async read(l,h,u,d,E){const f=this.fdMemory.get(l);if(!f)return;const a=await f.region.read(h,E);let b=0;for(const y of a)switch(y.type){case 1:return b;case 2:return b>0?b:this.logger.error(y.error);case 0:{const A=Math.max(0,h-y.offset),S=y.data.slice(A,Math.min(y.data.byteLength,A+(E-b)));u.set(S.buffer,d+b),b+=S.byteLength;break}default:this.logger.log(y)}return b}toBuffer(l){return c.BinaryBuffer.fromString(l).buffer}parseUri(l){if(l.scheme!==p.DEBUG_MEMORY_SCHEME)return;const h=this.debugSessionManager.sessions.find(f=>f.id.toLowerCase()===l.authority.toLowerCase());if(!h)return;let u;const d=/range=([0-9]+):([0-9]+)/.exec(l.query);d&&(u={fromOffset:Number(d[1]),toOffset:Number(d[2])});const[,E]=l.path.split(m.separator);return{session:h,offset:u,readOnly:!h.capabilities.supportsWriteMemoryRequest,sessionId:l.authority,memoryReference:decodeURIComponent(E)}}readDirectory(){throw new Error("Not allowed")}createDirectory(){throw new Error("Not allowed")}rename(){throw new Error("Not allowed")}delete(){throw new Error("Not allowed")}watch(){throw new Error("Not allowed")}writeFile(){throw new Error("Method not implemented.")}};t.DebugMemoryFileSystemProvider=_,n.__decorate([(0,o.Autowired)(p.IDebugSessionManager),n.__metadata("design:type",v.DebugSessionManager)],_.prototype,"debugSessionManager",void 0),n.__decorate([(0,o.Autowired)(c.ILogger),n.__metadata("design:type",Object)],_.prototype,"logger",void 0),t.DebugMemoryFileSystemProvider=_=n.__decorate([(0,o.Injectable)()],_);class s extends c.Disposable{constructor(l,h){super(),this.parent=l,this.range=h,this.invalidateEmitter=new c.Emitter,this.onDidInvalidate=this.invalidateEmitter.event,this.width=this.range.toOffset-this.range.fromOffset,this.writable=l.writable,this.registerDispose(l),this.registerDispose(l.onDidInvalidate(u=>{const d=(0,r.default)(u.fromOffset-h.fromOffset,0,this.width),E=(0,r.default)(u.toOffset-h.fromOffset,0,this.width);E>d&&this.invalidateEmitter.fire({fromOffset:d,toOffset:E})}))}read(l,h){if(l<0)throw new RangeError(`Invalid fromOffset: ${l}`);return this.parent.read(this.range.fromOffset+l,this.range.fromOffset+Math.min(h,this.width))}write(l,h){return this.parent.write(this.range.fromOffset+l,h)}}},31141:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugPreferences=t.IDebugConfiguration=t.debugPreferencesSchema=void 0,t.createDebugPreferences=o,t.injectDebugPreferences=c;const n=e(41869);t.debugPreferencesSchema={type:"object",properties:{"debug.trace":{type:"boolean",default:!1,description:(0,n.localize)("preference.debug.trace")},"debug.debugViewLocation":{enum:["default","left","right","bottom"],default:"default",description:(0,n.localize)("preference.debug.debugViewLocation")},"debug.openDebug":{enum:["neverOpen","openOnSessionStart","openOnFirstSessionStart","openOnDebugBreak"],default:"openOnDebugBreak",description:(0,n.localize)("preference.debug.openDebug")},"debug.internalConsoleOptions":{enum:["neverOpen","openOnSessionStart","openOnFirstSessionStart"],default:"openOnFirstSessionStart",description:(0,n.localize)("preference.debug.internalConsoleOptions")},"debug.allowBreakpointsEverywhere":{type:"boolean",description:(0,n.localize)("preference.debug.allowBreakpointsEverywhere"),default:!1}}};class r{}t.IDebugConfiguration=r,t.DebugPreferences=Symbol("DebugPreferences");function o(p){return(0,n.createPreferenceProxy)(p,t.debugPreferencesSchema)}function c(p){p.addProviders({token:t.DebugPreferences,useFactory:v=>{const m=v.get(n.PreferenceService);return o(m)}}),p.addProviders({token:n.PreferenceContribution,useValue:{schema:t.debugPreferencesSchema}})}},40453:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugProgressService=void 0;const r=e(85608),o=e(76003),c=e(41869),p=e(68969),v=e(43718),m=e(26296);let _=n=class{constructor(){this.toDispose=[]}async onDebugServiceStateChange(g){this.progressResolve&&(this.progressResolve(),this.progressResolve=void 0),g===m.DebugState.Initializing&&this.progressService.getIndicator(n.DEBUG_PANEL_PROGRESS_ID)&&this.progressService.withProgress({location:n.DEBUG_PANEL_PROGRESS_ID},l=>new Promise(h=>this.progressResolve=h))}run(g){let l;const h=u=>{l=new v.DisposableCollection,u&&(l?.push(u.onDidChangeState(d=>this.onDebugServiceStateChange(d))),l?.push(u.onDidProgressStart(async d=>{const E=new Promise(f=>{const a=c.Event.any(c.Event.filter(u.onDidProgressEnd,b=>b.body.progressId===d.body.progressId),u.onDidExitAdapter)(()=>{a.dispose(),f()})});this.progressService.getIndicator(n.DEBUG_PANEL_PROGRESS_ID)&&this.progressService.withProgress({location:n.DEBUG_PANEL_PROGRESS_ID},()=>E),this.progressService.withProgress({location:v.ProgressLocation.Notification,title:d.body.title,cancellable:d.body.cancellable,silent:!0,delay:500},f=>{let a=0;const b=A=>{let S;typeof A.percentage=="number"&&(S=A.percentage-a,a+=S),f.report({message:A.message,increment:S,total:typeof S=="number"?100:void 0})};d.body.message&&b(d.body);const y=u.onDidProgressUpdate(A=>{A.body.progressId===d.body.progressId&&b(A.body)});return E.then(()=>y.dispose())},()=>u.cancel(d.body.progressId))})))};this.toDispose.push(g.onDidChangeActiveDebugSession(({current:u})=>{l&&l.dispose(),h(u)})),h(g.currentSession)}};t.DebugProgressService=_,_.DEBUG_PANEL_PROGRESS_ID="debug",r.__decorate([(0,o.Autowired)(p.IProgressService),r.__metadata("design:type",Object)],_.prototype,"progressService",void 0),t.DebugProgressService=_=n=r.__decorate([(0,o.Injectable)()],_)},69946:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.launchSchema=t.DebugSchemaManager=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(64582),p=e(70159),v=e(37499),{deepClone:m}=o.objects;let _=class{async update(){const g=this.config.getDebuggers(),l={...m(t.launchSchema)},h=l.properties.configurations.items,u=g.map(d=>({attributes:Object.keys(d.configurationAttributes||{}).map(E=>d.configurationAttributes[E]),configurationSnippets:d.configurationSnippets}));for(const{attributes:d,configurationSnippets:E}of u)d&&h.oneOf&&h.oneOf.push(...d),E&&h.defaultSnippets&&h.defaultSnippets.push(...E);this.schemaRegistry.registerSchema(c.launchExtensionSchemaUri,l,["launch.json"])}};t.DebugSchemaManager=_,n.__decorate([(0,r.Autowired)(p.IDebugServer),n.__metadata("design:type",Object)],_.prototype,"debug",void 0),n.__decorate([(0,r.Autowired)(o.IJSONSchemaRegistry),n.__metadata("design:type",Object)],_.prototype,"schemaRegistry",void 0),n.__decorate([(0,r.Autowired)(v.DebugConfigurationManager),n.__metadata("design:type",v.DebugConfigurationManager)],_.prototype,"config",void 0),t.DebugSchemaManager=_=n.__decorate([(0,r.Injectable)()],_),t.launchSchema={$id:c.launchSchemaUri,type:"object",title:"Launch",required:[],default:{version:"0.2.0",configurations:[]},properties:{version:{type:"string",description:"Version of this file format.",default:"0.2.0"},configurations:{type:"array",description:"List of configurations. Add new configurations or edit existing ones by using IntelliSense.",items:{defaultSnippets:[],type:"object",oneOf:[]}}}}},90408:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugService=void 0;const n=e(85608),r=e(76003),o=e(41869);let c=class{constructor(){this.onDidDebugContributionPointChangeEmitter=new o.Emitter,this.debugContributionPointsMap=new Map}registerDebugContributionPoints(v,m){this.debugContributionPointsMap.has(v)||(this.debugContributionPointsMap.set(v,m),this.onDidDebugContributionPointChangeEmitter.fire({path:v,contributions:m}))}unregisterDebugContributionPoints(v){const m=this.debugContributionPointsMap.get(v);m&&(this.debugContributionPointsMap.delete(v),this.onDidDebugContributionPointChangeEmitter.fire({path:v,contributions:m,removed:!0}))}get debugContributionPoints(){return this.debugContributionPointsMap}get onDidDebugContributionPointChange(){return this.onDidDebugContributionPointChangeEmitter.event}};t.DebugService=c,t.DebugService=c=n.__decorate([(0,r.Injectable)()],c)},3520:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSessionConnection=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(64582),p=e(38029),v=new Set(["breakpoint","capabilities","continued","exited","initialized","loadedSource","module","output","process","stopped","terminated","thread","progressStart","progressUpdate","progressEnd","invalidated"]);let m=class{constructor(s,g,l){this.sessionId=s,this.connectionFactory=g,this.traceOutputChannel=l,this.pendingRequests=new Map,this.requestHandlers=new Map,this.onDidCustomEventEmitter=new o.Emitter,this.onDidCustomEvent=this.onDidCustomEventEmitter.event,this.toDispose=new o.DisposableCollection(this.onDidCustomEventEmitter,o.Disposable.create(()=>this.pendingRequests.clear()),o.Disposable.create(()=>this.emitters.clear())),this.allThreadsContinued=!0,this.emitters=new Map,this.connection=this.createConnection()}get disposed(){return this.toDispose.disposed}dispose(){this.toDispose.dispose()}async createConnection(){if(this.disposed)throw new Error("Connection has been already disposed.");{const s=await this.connectionFactory(this.sessionId);return s.onceClose((g,l)=>{this.fire("exited",{code:g,reason:l})}),s.onMessage(g=>this.handleMessage(g)),this.toDispose.push(o.Disposable.create(()=>{s.dispose()})),s}}async sendRequest(s,g,l,h){var u;s==="initialize"&&(this.sessionAdapterID=g.adapterID);const d=this.manager.reportTime(c.DEBUG_REPORT_NAME.DEBUG_ADAPTER_PROTOCOL_TIME,{sessionId:this.sessionId,threadId:g&&g.threadId||((u=this.manager.currentThread)===null||u===void 0?void 0:u.raw.id)}),E=await this.doSendRequest(s,g,h),f={adapterID:this.sessionAdapterID,request:l.request};if(s==="threads"&&(f.amount=E.body.threads.length),d(s,f),(s==="next"||s==="stepIn"||s==="stepOut"||s==="stepBack"||s==="reverseContinue"||s==="restartFrame")&&this.fireContinuedEvent(g.threadId),s==="continue"){const a=E;return(a&&a.body&&a.body.allThreadsContinued)!==void 0&&(this.allThreadsContinued=E.body.allThreadsContinued),this.fireContinuedEvent(g.threadId,this.allThreadsContinued),E}return E}async sendCustomRequest(s,g){var l;return(l=await this.doSendRequest(s,g))===null||l===void 0?void 0:l.body}async doSendRequest(s,g=null,l){const h=new o.Deferred,u={seq:(0,c.getSequenceId)(),type:"request",command:s};let d;return g&&(u.arguments=g),this.pendingRequests.set(u.seq,E=>{d&&d.dispose(),E.success?h.resolve(E):h.reject(E)}),l&&(d=l.onCancellationRequested(async()=>{d.dispose();const E=this.manager.getSession(this.sessionId);E&&E.capabilities.supportsCancelRequest&&E.sendRequest("cancel",{requestId:u.seq})})),await this.send(u),h.promise}async send(s){const g=await this.connection,l=JSON.stringify(s);this.traceOutputChannel&&this.traceOutputChannel.appendLine(`${this.sessionId.substring(0,8)} [UI -> adapter]: ${l}`),g.send(l)}handleMessage(s){this.traceOutputChannel&&this.traceOutputChannel.appendLine(`${this.sessionId.substring(0,8)} [adapter -> UI ]: ${s}`);const g=JSON.parse(s);g.type==="request"?this.handleRequest(g):g.type==="response"?this.handleResponse(g):g.type==="event"&&this.handleEvent(g)}handleResponse(s){const g=this.pendingRequests.get(s.request_seq);g&&(this.pendingRequests.delete(s.request_seq),g(s))}onRequest(s,g){this.requestHandlers.set(s,g)}async handleRequest(s){const g={type:"response",seq:(0,c.getSequenceId)(),command:s.command,request_seq:s.seq,success:!0},l=this.requestHandlers.get(s.command);if(l)try{g.body=await l(s)}catch(h){g.success=!1,g.message=h.message}else(0,o.getDebugLogger)().error("Unhandled request",s);await this.send(g)}handleEvent(s){"event"in s?(s.event==="continued"&&(this.allThreadsContinued=s.body.allThreadsContinued!==!1),v.has(s.event)?this.doFire(s.event,s):this.onDidCustomEventEmitter.fire(s)):this.fire("exited",s)}on(s,g){return this.disposed?o.Disposable.create(()=>{}):this.getEmitter(s).event(g)}fire(s,g){this.doFire(s,g)}doFire(s,g){this.disposed||this.getEmitter(s).fire(g)}getEmitter(s){const g=this.emitters.get(s)||this.newEmitter();return this.emitters.set(s,g),g}newEmitter(){const s=new o.Emitter;return this.toDispose.push(s),s}fireContinuedEvent(s,g=!1){this.fire("continued",{type:"event",event:"continued",body:{threadId:s,allThreadsContinued:g},seq:(0,c.getSequenceId)()})}};t.DebugSessionConnection=m,n.__decorate([(0,r.Autowired)(c.IDebugSessionManager),n.__metadata("design:type",p.DebugSessionManager)],m.prototype,"manager",void 0),t.DebugSessionConnection=m=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)()),n.__param(1,(0,r.Optional)()),n.__param(2,(0,r.Optional)()),n.__metadata("design:paramtypes",[String,Function,Object])],m)},97186:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSessionFactory=t.DebugSessionContributionRegistryImpl=t.DebugSessionContributionRegistry=t.DebugSessionContribution=void 0;const n=e(85608),r=e(76003),o=e(41869);t.DebugSessionContribution=Symbol("DebugSessionContribution"),t.DebugSessionContributionRegistry=Symbol("DebugSessionContributionRegistry");let c=class{constructor(){this.contribs=new Map,this.init()}init(){for(const v of this.contributions.getContributions())this.contribs.set(v.debugType,v)}get(v){return this.contribs.get(v)}};t.DebugSessionContributionRegistryImpl=c,n.__decorate([(0,r.Autowired)(t.DebugSessionContribution),n.__metadata("design:type",Object)],c.prototype,"contributions",void 0),t.DebugSessionContributionRegistryImpl=c=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],c),t.DebugSessionFactory=Symbol("DebugSessionFactory")},38029:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSessionManager=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(26542),p=e(54414),v=e(72665),m=e(93950),_=e(80907),s=e(64582),g=e(79845),l=e(80712),h=e(17280),u=e(97186),d=e(5905);let E=class{fireDidChange(a){this.inDebugModeKey.set(this.inDebugMode),this.onDidChangeEmitter.fire(a)}constructor(){this._uid=(0,o.uuid)(),this._sessions=new Map,this._extraMap=new Map,this._actionIndex=0,this.onWillStartDebugSessionEmitter=new o.Emitter,this.onWillStartDebugSession=this.onWillStartDebugSessionEmitter.event,this.onWillResolveDebugConfigurationEmitter=new o.Emitter,this.onWillResolveDebugConfiguration=this.onWillResolveDebugConfigurationEmitter.event,this.onDidCreateDebugSessionEmitter=new o.Emitter,this.onDidCreateDebugSession=this.onDidCreateDebugSessionEmitter.event,this.onDidStartDebugSessionEmitter=new o.Emitter,this.onDidStartDebugSession=this.onDidStartDebugSessionEmitter.event,this.onDidStopDebugSessionEmitter=new o.Emitter,this.onDidStopDebugSession=this.onDidStopDebugSessionEmitter.event,this.onDidChangeActiveDebugSessionEmitter=new o.Emitter,this.onDidChangeActiveDebugSession=this.onDidChangeActiveDebugSessionEmitter.event,this.onDidDestroyDebugSessionEmitter=new o.Emitter,this.onDidDestroyDebugSession=this.onDidDestroyDebugSessionEmitter.event,this.onDidReceiveDebugSessionCustomEventEmitter=new o.Emitter,this.onDidReceiveDebugSessionCustomEvent=this.onDidReceiveDebugSessionCustomEventEmitter.event,this.onDidChangeEmitter=new o.Emitter,this.onDidChange=this.onDidChangeEmitter.event,this.configurationIds=new Map,this.toDisposeOnCurrentSession=new o.DisposableCollection,this.init()}init(){this.debugTypeKey=this.contextKeyService.createKey(s.CONTEXT_DEBUG_TYPE_KEY,void 0),this.inDebugModeKey=this.contextKeyService.createKey(s.CONTEXT_IN_DEBUG_MODE_KEY,this.inDebugMode),this.debugStopped=this.contextKeyService.createKey(s.CONTEXT_DEBUG_STOPPED_KEY,!1),this.modelManager.onModelChanged(a=>{const{newModelUrl:b}=a;if(b){const y=o.URI.parse(b.toString()),A=this.modelManager.model;if(this.currentSession&&this.currentThread&&A){const S=this.currentThread.frames.find(w=>{var T;return((T=w.source)===null||T===void 0?void 0:T.uri.toString())===y.toString()});S&&S!==this.currentFrame&&(this.currentThread.currentFrame=S,setTimeout(()=>{this.workbenchEditorService.currentEditor&&this.workbenchEditorService.currentEditor.monacoEditor.revealLineInCenter(S.raw.line)},0))}}})}_getExtra(a,b){if(a==null)return;const y=this._extraMap.get(a);if(y)return{traceId:y.traceId,remote:y.remote,adapterID:y.adapterID,request:y.request,...b&&y.threads.get(`${b}`)}}getExtra(a,b){return this._getExtra(a,b)}_setExtra(a,b,y){const A=this._extraMap.get(a);A&&(y?A.threads.set(b,y):A.threads.delete(b))}setExtra(a,b,y){return this._setExtra(a,b,y)}report(a,b,y){return y={traceId:this._uid,...this._getExtra(y?.sessionId,y?.threadId),...y},this.reporterService.point(a,b,y)}reportTime(a,b){const y=this.reporterService.time(a);return(A,S)=>(S={...b,...S},S={traceId:this._uid,...this._getExtra(S?.sessionId,S?.threadId),...S},y.timeEnd(A,S))}reportAction(a,b,y){var A,S,w;let T=this._getExtra(a,b);T&&(b&&!T.threadId&&(T={...T}),this._actionIndex+=1,T.action=`${y}-${this._actionIndex}`,T.filePath=(S=(A=this.currentFrame)===null||A===void 0?void 0:A.raw.source)===null||S===void 0?void 0:S.path,T.fileLineNumber=(w=this.currentFrame)===null||w===void 0?void 0:w.raw.line,this._setExtra(a,`${b??""}`,T))}async start(a){const{configuration:b}=a,y={adapterID:b.type,request:b.request==="launch"?"launch":"attach",traceId:this._uid,remote:0,threads:new Map};if((0,d.isRemoteAttach)(b)&&(y.remote=1),this.report(s.DEBUG_REPORT_NAME.DEBUG_BREAKPOINT,"number",{count:this.breakpoints.getBreakpoints().length,...y}),!a.configuration.__restart&&this.isExistedDebugSession(a)){this.messageService.error((0,o.formatLocalize)("debug.launch.existed",a.configuration.name));return}try{const A=this.reportTime(s.DEBUG_REPORT_NAME.DEBUG_SESSION_START_TIME,y);await this.fireWillStartDebugSession();const S=await this.resolveConfiguration(a);if(S){if(S.configuration.preLaunchTask){this.debugProgressService.onDebugServiceStateChange(s.DebugState.Initializing);const T=o.Uri.parse(S.workspaceFolderUri),D=await this.taskService.getTask(T,S.configuration.preLaunchTask);if(D){const I=this.reportTime(s.DEBUG_REPORT_NAME.DEBUG_PRE_LAUNCH_TASK_TIME,y),O=await this.taskService.run(D);O.exitCode!==0&&this.messageService.error(`The preLaunchTask ${S.configuration.preLaunchTask} exitCode is ${O.exitCode}`),I(T.toString(),{exitCode:O.exitCode})}this.debugProgressService.onDebugServiceStateChange(s.DebugState.Running)}}else{a.configuration.type?this.messageService.error((0,o.formatLocalize)("debug.notSupported.type",a.configuration.type)):this.messageService.error((0,o.localize)("debug.notSupported.any"));return}const w=await this.debug.createDebugSession(S);if(A(S.configuration.type,{adapterID:S.configuration.type,request:S.configuration.request,sessionId:w}),!w){this.messageService.error((0,o.formatLocalize)("debug.launch.typeNotSupported",S.configuration.type));return}return this.doStart(w,S,y)}catch(A){throw this.messageService.error((0,o.localize)("debug.launch.catchError")),A}}async fireWillStartDebugSession(){await o.WaitUntilEvent.fire(this.onWillStartDebugSessionEmitter,{})}async resolveConfiguration(a){if(s.IDebugSessionDTO.is(a))return a;const{workspaceFolderUri:b,index:y,noDebug:A,parentSession:S,repl:w,compact:T,lifecycleManagedByParent:D}=a,I=await this.resolveDebugConfiguration(a.configuration,b);I&&!("cwd"in I)&&(I.cwd="${workspaceFolder}");let O=await this.variableResolver.resolve(I,{});if(!O){O===null&&this.commandService.executeCommand(o.COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION.id);return}if(O=await this.resolveDebugConfigurationWithSubstitutedVariables(O,b),!O){O===null&&this.commandService.executeCommand(o.COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION.id);return}const M=O.name+b,R=this.configurationIds.has(M)?this.configurationIds.get(M)+1:0;return this.configurationIds.set(M,R),{id:R,configuration:O,workspaceFolderUri:b,index:y,noDebug:A,parentSession:S,repl:w,compact:T,lifecycleManagedByParent:D}}async resolveDebugConfiguration(a,b){return await this.fireWillResolveDebugConfiguration(a.type),this.debug.resolveDebugConfiguration(a,b)}async resolveDebugConfigurationWithSubstitutedVariables(a,b){return this.debug.resolveDebugConfigurationWithSubstitutedVariables(a,b)}async fireWillResolveDebugConfiguration(a){await o.WaitUntilEvent.fire(this.onWillResolveDebugConfigurationEmitter,{debugType:a})}async doStart(a,b,y){const A=this.sessionContributionRegistry.get(b.configuration.type);if(!A)return;const w=A.debugSessionFactory().get(a,b);this._sessions.set(a,w),this._extraMap.set(a,y),b.lifecycleManagedByParent||this.updateCurrentSession(w),this.debugTypeKey.set(w.configuration.type),this.onDidCreateDebugSessionEmitter.fire(w);let T=s.DebugState.Inactive;return w.onDidChange(()=>{var D,I;T!==w.state&&(T=w.state,T===s.DebugState.Stopped?(this.onDidStopDebugSessionEmitter.fire(w),this.debugStopped.set(!0)):this.debugStopped.set(!1)),this.debugContextKey.contextSetVariableSupported.set((D=w.capabilities.supportsSetVariable)!==null&&D!==void 0?D:!1),this.debugContextKey.contextRestartFrameSupported.set((I=w.capabilities.supportsRestartFrame)!==null&&I!==void 0?I:!1),this.debugContextKey.contextDebugState.set(s.DebugState[w.state]),this.debugContextKey.contextInDebugMode.set(T!==s.DebugState.Inactive)}),w.on("terminated",D=>{const I=D.body&&D.body.restart;I?this.doRestart(w,I):this.destroy(w.id)}),w.on("exited",()=>this.destroy(w.id)),w.start().then(()=>this.onDidStartDebugSessionEmitter.fire(w)),w.onDidCustomEvent(({event:D,body:I})=>this.onDidReceiveDebugSessionCustomEventEmitter.fire({event:D,body:I,session:w})),w}isExistedDebugSession(a){const{name:b}=a.configuration;for(const[,y]of this._sessions)if(y.configuration.name===b&&!y.terminated)return!0;return!1}async restart(a=this.currentSession){return a&&this.doRestart(a)}async doRestart(a,b){const{options:y,configuration:A}=a;return await a.restart({arguments:A})?a:(await a.terminate(!0),A.__restart=b,this.start(y))}updateCurrentSession(a){this.currentSession=a||this.sessions[this.sessions.length-1]}get inDebugMode(){return this.state>s.DebugState.Inactive}get currentThread(){const a=this.currentSession;return a&&a.currentThread}get state(){const a=this.currentSession;return a?a.state:s.DebugState.Inactive}get currentFrame(){const{currentThread:a}=this;return a&&a.currentFrame}get topFrame(){const{currentThread:a}=this;return a&&a.topFrame}getSession(a){if(a)return this._sessions.get(a)}get sessions(){return Array.from(this._sessions.values()).filter(a=>a.state>s.DebugState.Inactive)}get currentSession(){return this._currentSession}set currentSession(a){if(this._currentSession===a)return;this.toDisposeOnCurrentSession.dispose();const b=this._currentSession;this._currentSession=a,this.onDidChangeActiveDebugSessionEmitter.fire({previous:b,current:a}),a&&(this.toDisposeOnCurrentSession.push(a.onDidChange(()=>{this.currentFrame===this.topFrame&&this.open(),this.fireDidChange(a)})),this.toDisposeOnCurrentSession.push(a.onCurrentThreadChange(()=>{this.fireDidChange(a)}))),this.open(),this.fireDidChange(a)}open(){const{currentFrame:a}=this;a&&a.open()}async stopSession(a,b=!1){return a?b?a.disconnect():a.terminate():Promise.all(this.sessions.map(y=>b?y.disconnect():y.terminate()))}destroy(a){if(a){const b=this._sessions.get(a);b&&this.doDestroy(b)}else this._sessions.forEach(b=>this.doDestroy(b))}doDestroy(a){this.debug.terminateDebugSession(a.id),this.remove(a.id),a.dispose(),this.onDidDestroyDebugSessionEmitter.fire(a)}remove(a){this._sessions.delete(a);const{currentSession:b}=this;b&&b.id===a&&this.updateCurrentSession(void 0),setTimeout(()=>{this._extraMap.delete(a)})}};t.DebugSessionManager=E,n.__decorate([(0,r.Autowired)(c.LabelService),n.__metadata("design:type",c.LabelService)],E.prototype,"labelProvider",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],E.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(u.DebugSessionContributionRegistry),n.__metadata("design:type",Object)],E.prototype,"sessionContributionRegistry",void 0),n.__decorate([(0,r.Autowired)(s.IDebugServer),n.__metadata("design:type",Object)],E.prototype,"debug",void 0),n.__decorate([(0,r.Autowired)(p.WorkbenchEditorService),n.__metadata("design:type",p.WorkbenchEditorService)],E.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(v.IMessageService),n.__metadata("design:type",Object)],E.prototype,"messageService",void 0),n.__decorate([(0,r.Autowired)(_.IVariableResolverService),n.__metadata("design:type",Object)],E.prototype,"variableResolver",void 0),n.__decorate([(0,r.Autowired)(l.BreakpointManager),n.__metadata("design:type",l.BreakpointManager)],E.prototype,"breakpoints",void 0),n.__decorate([(0,r.Autowired)(s.IDebugModelManager),n.__metadata("design:type",Object)],E.prototype,"modelManager",void 0),n.__decorate([(0,r.Autowired)(m.ITaskService),n.__metadata("design:type",Object)],E.prototype,"taskService",void 0),n.__decorate([(0,r.Autowired)(o.IReporterService),n.__metadata("design:type",Object)],E.prototype,"reporterService",void 0),n.__decorate([(0,r.Autowired)(g.IDebugProgress),n.__metadata("design:type",Object)],E.prototype,"debugProgressService",void 0),n.__decorate([(0,r.Autowired)(h.DebugContextKey),n.__metadata("design:type",h.DebugContextKey)],E.prototype,"debugContextKey",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],E.prototype,"commandService",void 0),t.DebugSessionManager=E=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],E)},29539:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSession=void 0;const r=e(85608).__importDefault(e(12784)),o=e(41869),c=e(43718),p=e(64582),v=e(32385),m=e(99797),_=e(88776),s=e(7885);class g{fireDidChange(){this.onDidChangeEmitter.fire(void 0),this.onStateChange()}get capabilities(){return this._capabilities}get supportsThreadIdCorrespond(){return!!this.capabilities.supportsThreadIdCorrespond}constructor(h,u,d,E,f,a,b,y,A,S,w){this.id=h,this.options=u,this.connection=d,this.terminalService=E,this.workbenchEditorService=f,this.breakpointManager=a,this.modelManager=b,this.labelProvider=y,this.messages=A,this.fileSystem=S,this.sessionManager=w,this.onDidChangeEmitter=new o.Emitter,this.onDidChange=this.onDidChangeEmitter.event,this._onDidChangeCallStack=new o.Emitter,this.onDidChangeCallStack=this._onDidChangeCallStack.event,this._onVariableChange=new o.Emitter,this.onVariableChange=this._onVariableChange.event,this._onCurrentThreadChange=new o.Emitter,this.onCurrentThreadChange=this._onCurrentThreadChange.event,this._onDidStop=new o.Emitter,this.onDidStop=this._onDidStop.event,this._onDidContinued=new o.Emitter,this.onDidContinued=this._onDidContinued.event,this._onDidThread=new o.Emitter,this.onDidThread=this._onDidThread.event,this._onRequest=new o.Emitter,this.onRequest=this._onRequest.event,this._onDidExitAdapter=new o.Emitter,this.onDidExitAdapter=this._onDidExitAdapter.event,this._onDidProgressStart=new o.Emitter,this.onDidProgressStart=this._onDidProgressStart.event,this._onDidProgressUpdate=new o.Emitter,this.onDidProgressUpdate=this._onDidProgressUpdate.event,this._onDidProgressEnd=new o.Emitter,this.onDidProgressEnd=this._onDidProgressEnd.event,this._onDidInvalidated=new o.Emitter,this.onDidInvalidated=this._onDidInvalidated.event,this._onDidChangeState=new o.Emitter,this.onDidChangeState=this._onDidChangeState.event,this._onDidInvalidMemory=new o.Emitter,this.onDidInvalidateMemory=this._onDidInvalidMemory.event,this.toDispose=new o.DisposableCollection,this._capabilities={},this.updateDeffered=null,this.exitDeferred=new o.Deferred,this.cancellationMap=new Map,this.toDisposeOnCurrentThread=new o.DisposableCollection,this.initialized=!1,this.id2Breakpoint=new Map,this.settingBreakpoints=null,this._multipleThreadPaused=new Map,this.sources=new Map,this._threads=new Map,this.scheduleUpdateThreads=(0,r.default)(()=>this.updateThreads(void 0),100),this.pendingThreads=Promise.resolve(),this.terminated=!1,this.connection.onRequest("runInTerminal",async T=>await this.runInTerminal(T)),this.toDispose.pushAll([this.onDidChangeEmitter,this.connection,this.on("initialized",()=>{this.configure()}),this.on("breakpoint",({body:T})=>this.onUpdateBreakpoint(T)),this.on("continued",async T=>{const{body:{allThreadsContinued:D,threadId:I}}=T;if(this.handleCancellation(I),this.supportsThreadIdCorrespond){I?this._multipleThreadPaused.delete(I):D!==!1&&this._multipleThreadPaused.clear(),await this.updateCurrentThread(),this._onDidContinued.fire(T);return}if(D!==!1){this.clearThreads(),this._onDidContinued.fire(T);return}(0,c.isDefined)(I)&&this.clearThread(I),this.onStateChange(),this._onDidContinued.fire(T)}),this.on("stopped",async T=>{const{body:D}=T;this.stoppedDetails=D;const{threadId:I}=D,O=this.sessionManager.reportTime(p.DEBUG_REPORT_NAME.DEBUG_STOPPED,{sessionId:this.id,threadId:I});if(this.supportsThreadIdCorrespond===!0){if(await this.collectPausedThread(D),D.threadId&&this._multipleThreadPaused.has(D.threadId)){const R=this._multipleThreadPaused.get(D.threadId);await this.updateCurrentThread(R),await this.updateCurrentThreadFramesOnFocus()}}else this.updateDeffered=new o.Deferred,await this.updateThreads(D),await this.updateCurrentThreadFramesOnFocus(),this.updateDeffered.resolve();O("stopped");const M=this.sessionManager.getExtra(this.id,I);I&&M&&M.action&&(M.action=void 0,this.sessionManager.setExtra(this.id,`${I??""}`,M)),this.onStateChange(),this.sessionManager.currentSession=this,this._onDidStop.fire(T)}),this.on("thread",T=>{const{body:{reason:D,threadId:I}}=T;if(this.supportsThreadIdCorrespond){this.state===p.DebugState.Stopped&&this._onDidThread.fire(T);return}D==="started"?this.scheduleUpdateThreads():D==="exited"&&this.clearThread(I),this._onDidThread.fire(T)}),this.on("terminated",()=>{this.terminated=!0}),this.on("exited",T=>{this.exitDeferred.resolve(T)}),this.on("progressStart",T=>{this._onDidProgressStart.fire(T)}),this.on("progressUpdate",T=>{this._onDidProgressUpdate.fire(T)}),this.on("progressEnd",T=>{this._onDidProgressEnd.fire(T)}),this.on("memory",T=>{this._onDidInvalidMemory.fire(T)}),this.on("invalidated",async T=>{this._onDidInvalidated.fire(T),T.body.areas&&T.body.areas.length===1&&(T.body.areas[0]==="variables"||T.body.areas[0]==="watch")||(this.cancelAllRequests(),this.clearThreads(),await this.updateThreads(this.stoppedDetails)),this.fireDidChange()}),this.on("capabilities",T=>this.updateCapabilities(T.body.capabilities)),this.breakpointManager.onDidChangeBreakpoints(T=>this.runtimeUpdateBreakpoint(T)),this.breakpointManager.onDidChangeExceptionsBreakpoints(T=>{this.breakpointManager.breakpointsEnabled&&this.setExceptionBreakpoints(T)}),c.Disposable.create(()=>{this.breakpointManager.clearAllStatus(this.id)})])}getMemory(h){return new v.MemoryRegion(h,this)}get configuration(){return this.options.configuration}get parentSession(){return this.options.parentSession}get lifecycleManagedByParent(){return this.options.lifecycleManagedByParent}get compact(){return!!this.options.compact}async start(){await this.workbenchEditorService.saveAll(),await this.initialize(),await this.launchOrAttach()}async runInTerminal({arguments:{title:h,cwd:u,args:d,env:E}}){return this.doRunInTerminal({name:h,cwd:u,env:E,args:d})}async doRunInTerminal(h){var u;const d=this.terminalService.terminals.find(b=>b.name===h.name&&b.isActive);let E;const f=await this.terminalService.getDefaultShellPath(),a=(0,p.prepareCommand)(f,h.args,!1,(u=h.cwd)===null||u===void 0?void 0:u.toString(),h.env);if(d)a&&this.terminalService.sendText(d.id,a),E=await this.terminalService.getProcessId(d.id);else{const b=await this.terminalService.createTerminal(h);b.show(),a&&(this.terminalService.sendText(b.id,a),E=await this.terminalService.getProcessId(b.id))}return{processId:E}}async initialize(){const h=await this.connection.sendRequest("initialize",{clientID:"OpenSumi",clientName:"OpenSumi IDE",adapterID:this.configuration.type,locale:(0,c.getLanguageId)(),linesStartAt1:!0,columnsStartAt1:!0,pathFormat:"path",supportsVariableType:!1,supportsVariablePaging:!1,supportsRunInTerminalRequest:!0,supportsProgressReporting:!0,supportsInvalidatedEvent:!0,supportsMemoryEvent:!0,supportsMemoryReferences:!0},this.configuration);this.updateCapabilities(h.body||{}),this.onStateChange()}async launchOrAttach(){var h;if(this.parentSession&&this.parentSession.state===p.DebugState.Inactive)throw(0,o.canceled)();try{this.configuration.request==="attach"?await this.sendRequest("attach",this.configuration):await this.sendRequest("launch",this.configuration)}catch(u){throw this.fireExited(u),this.messages.error(u.message||((h=u.body)===null||h===void 0?void 0:h.error.format)||(0,o.localize)("debug.console.errorMessage")),u&&u.message}}async configure(){await this.initBreakpoints(),this.breakpointManager.setExceptionBreakpoints(this.capabilities.exceptionBreakpointFilters||[]),this.initialized=!0,this.capabilities.supportsConfigurationDoneRequest&&this.sendRequest("configurationDone",{}),this.supportsThreadIdCorrespond||await this.updateThreads(void 0)}async setExceptionBreakpoints(h){return this.sendRequest("setExceptionBreakpoints",h)}onStateChange(){const h=this.state;this.previousState!==h&&(this.previousState=h,this._onDidChangeState.fire(h))}async onUpdateBreakpoint(h){let u;this.settingBreakpoints&&await this.settingBreakpoints.promise;try{const d=h.breakpoint;switch(h.reason){case"new":if(d.source&&typeof d.line=="number"&&d.id&&!this.id2Breakpoint.has(d.id)){const E=_.DebugSource.toUri(d.source),f=m.DebugBreakpoint.create(E,{line:d.line,column:d.column});f.status.set(this.id,d),this.addBreakpoint(f)}break;case"removed":d.id&&(u=this.id2Breakpoint.get(d.id),u&&this.delBreakpoint(u));break;case"changed":d.id&&(u=this.id2Breakpoint.get(d.id),u&&(u.status.set(this.id,d),this.breakpointManager.updateBreakpoint(u,!0)));break;default:break}}finally{}}async setBreakpoints(h){const u=[];for(const d of h){const E=await this.toSource(d),f=this.breakpointManager.getBreakpoints(d).filter(a=>this.breakpointManager.breakpointsEnabled&&a.enabled);u.push(this.sendRequest("setBreakpoints",{source:E.raw,sourceModified:!1,lines:f.map(a=>a.raw.line),breakpoints:f.map(a=>a.raw)}).then(a=>(a.body.breakpoints.forEach((b,y)=>{var A,S;b.id&&this.id2Breakpoint.set(b.id,f[y]);const w=f[y];w.raw.line=(A=b.line)!==null&&A!==void 0?A:w.raw.line,w.raw.column=(S=b.column)!==null&&S!==void 0?S:w.raw.column,w.status.set(this.id,b)}),this.breakpointManager.updateBreakpoints(f,!0),this.breakpointManager.resolveBpDeffered(),Promise.resolve())).catch(a=>{if(!(a instanceof Error)){const y=a.message?`${a.message}`:"Breakpoint not valid for current debug session";f.forEach(A=>{A.status.set(this.id,{verified:!1,message:y}),this.breakpointManager.updateBreakpoint(A,!0)})}}))}return await Promise.all(u)}delBreakpoint(h){return this.breakpointManager.delBreakpoint(h)}async addBreakpoint(h,u){return u&&this.breakpointManager.setBpDeffered(),this.breakpointManager.addBreakpoint(h),this.breakpointManager.promiseBpDeffered()}async runtimeUpdateBreakpoint(h){const{affected:u,statusUpdated:d}=h;if(!d)return await this.setBreakpoints(u)}async initBreakpoints(){this.settingBreakpoints=new o.Deferred,this.id2Breakpoint.clear(),this.configuration.noDebug||await this.setBreakpoints(this.breakpointManager.affected.map(h=>o.URI.parse(h))),this.settingBreakpoints.resolve(),this.settingBreakpoints=null}get currentThread(){return this._currentThread}set currentThread(h){this.toDisposeOnCurrentThread.dispose(),this._currentThread=h,h&&this.toDisposeOnCurrentThread.push(h.onDidChanged(()=>this.fireDidChange()))}get multipleThreadPaused(){return this._multipleThreadPaused}hasInMultipleThreadPaused(h){return this._multipleThreadPaused.has(h)}clearThreads(){var h;const u=this.sessionManager.reportTime(p.DEBUG_REPORT_NAME.DEBUG_UI_FRONTEND_TIME,{sessionId:this.id,threadId:(h=this.currentThread)===null||h===void 0?void 0:h.id,threadAmount:this.threadCount});this._threads.forEach(d=>{d.clear()}),this._onDidChangeCallStack.fire(),this.collocationThread(),u("clearThreads")}clearThread(h){const u=this.sessionManager.reportTime(p.DEBUG_REPORT_NAME.DEBUG_UI_FRONTEND_TIME,{sessionId:this.id,threadId:h,threadAmount:this.threadCount}),d=this._threads.get(h);d&&(d.clear(),this._onDidChangeCallStack.fire()),this.collocationThread(),u("clearThread")}get state(){if(this.connection.disposed)return p.DebugState.Inactive;if(!this.initialized)return p.DebugState.Initializing;const h=this.currentThread;return h?h.stopped?p.DebugState.Stopped:p.DebugState.Running:this.supportsThreadIdCorrespond?p.DebugState.Running:this.stoppedThreads.next().value?p.DebugState.Stopped:p.DebugState.Running}get currentFrame(){return this.currentThread&&this.currentThread.currentFrame}async getScopes(h){const{currentFrame:u}=this;return u?u.getScopes(h):[]}get label(){return p.IDebugSessionDTO.is(this.options)&&this.options.id?this.configuration.name+" ("+(this.options.id+1)+")":this.configuration.name}get visible(){return this.state>p.DebugState.Inactive}getSource(h){const u=_.DebugSource.toUri(h).toString(),d=this.sources.get(u)||new _.DebugSource(this,this.labelProvider,this.modelManager,this.workbenchEditorService,this.fileSystem);return d.update({raw:h}),this.sources.set(u,d),d}getSourceForUri(h){return this.sources.get(h.toString())}async toSource(h){const u=this.getSourceForUri(h);return u||this.getSource(await this.toDebugSource(h))}async toDebugSource(h){if(h.scheme===_.DebugSource.SCHEME)return{name:h.path.toString(),sourceReference:Number(h.query)};const u=h.displayName;let d=h.toString();return h.scheme===c.Schemes.file&&(d=await this.fileSystem.getFsPath(d)),{name:u,path:d,adapterData:void 0,sourceReference:void 0}}get threads(){return Array.from(this._threads.values())}get threadCount(){return this._threads.size}*getThreads(h){for(const u of this.threads)h(u)&&(yield u)}get runningThreads(){return this.getThreads(h=>!h.stopped)}get stoppedThreads(){return this.getThreads(h=>h.stopped)}async rawFetchThreads(h){const u=typeof h>"u"?null:{threadId:h},d=await this.sendRequest("threads",u);return d&&d.body&&d.body.threads&&Array.isArray(d.body.threads)?Promise.resolve(d.body.threads):Promise.resolve([])}async fetchThreads(){const h=await this.rawFetchThreads(),u=this._threads,d=[];for(const E of h){const f=E.id,a=u.get(f)||new s.DebugThread(this);d.push(a),a.update({raw:E})}return Promise.resolve(d)}updateThreads(h){return this.pendingThreads=this.pendingThreads.then(async()=>{try{const u=await this.rawFetchThreads();this.doUpdateThreads(u,h)}catch{}})}doUpdateThreads(h,u){const d=this.sessionManager.reportTime(p.DEBUG_REPORT_NAME.DEBUG_UI_FRONTEND_TIME,{sessionId:this.id,threadId:u?.threadId,threadAmount:h.length}),E=[];h.forEach(f=>{if(E.push(f.id),this._threads.has(f.id)){if(f.name){const a=this._threads.get(f.id);a&&(a.raw.name=f.name)}}else{const a=new s.DebugThread(this),b={raw:f};a.update(b),this._threads.set(f.id,a)}}),this._threads.forEach(f=>{var a;const{raw:{id:b}}=f;E.indexOf(b)===-1&&this._threads.delete(b),u&&(u.allThreadsStopped||u.threadId===b)&&((a=this._threads.get(b))===null||a===void 0||a.update({stoppedDetails:u}))}),this.collocationThread(u),d("doUpdateThreads")}collocationThread(h){var u;const{currentThread:d}=this;let E=d&&d.raw.id;h&&!h.preserveFocusHint&&h.threadId&&(E=h.threadId),this.currentThread=typeof E=="number"&&this._threads.get(E)||this._threads.values().next().value,((u=this.currentThread)===null||u===void 0?void 0:u.raw.id)!==E&&this.fireDidChange()}async updateCurrentThread(h){h?(this.currentThread=h,this._onCurrentThreadChange.fire(this.currentThread)):(this.currentThread=void 0,this._onCurrentThreadChange.fire(void 0))}async collectPausedThread(h){const u=await this.rawFetchThreads(h?.threadId);if(u.length===0)return new Map;const d=h.threadId&&this._multipleThreadPaused.has(h.threadId)?this._multipleThreadPaused.get(h.threadId):new s.DebugThread(this),E={raw:u[0]};return h&&(h.allThreadsStopped||h.threadId===u[0].id)&&(E.stoppedDetails=h),d&&(d.update(E),await this.rawFetchFrames(d),this._multipleThreadPaused.set(d.raw.id,d)),this._multipleThreadPaused}async updateCurrentThreadFramesOnFocus(){await this.rawFetchFrames(this.currentThread),this._onDidChangeCallStack.fire();const h=this.workbenchEditorService.currentEditor,u=d=>{this.stoppedDetails&&!this.stoppedDetails.preserveFocusHint&&(this.currentThread.currentFrame=d)};if(this.currentThread&&!this.currentFrame){const d=this.currentThread.frames.filter(E=>E&&E.source&&E.source.raw.presentationHint!=="deemphasize");if(d.length===0)return;if(h){const E=h.monacoEditor.getModel();if(E){const f=o.URI.parse(E.uri.toString()),a=d.filter(b=>b.source.uri.toString()===f.toString());a.length>0?u(a[0]):u(d[0])}}else u(d[0])}}async rawFetchFrames(h){!h||h.frameCount||(this.capabilities.supportsDelayedStackTraceLoading?(await h.rawFetchFrames(1),await h.rawFetchFrames(19)):await h.rawFetchFrames())}async terminate(h){if(this.initialized=!0,this.cancelAllRequests(),this.lifecycleManagedByParent&&this.parentSession){await this.parentSession.terminate(h);return}!this.terminated&&this.capabilities.supportsTerminateRequest&&this.configuration.request==="launch"?(this.terminated=!0,this.sendRequest("terminate",{restart:h}),await this.exited(1e3)||await this.disconnect(h)):await this.disconnect(h)}async disconnect(h){try{this.lifecycleManagedByParent&&this.parentSession?this.parentSession.disconnect(h):this.sendRequest("disconnect",{restart:h})}catch(d){this.fireExited(d);return}finally{this._onDidExitAdapter.fire(),this.onStateChange()}const u=500;await this.exited(u)||this.fireExited(new Error(`timeout after ${u} ms`))}updateCapabilities(h){Object.assign(this._capabilities,h)}fireExited(h){this.connection.fire("exited",{reason:h})}exited(h){return Promise.race([this.exitDeferred.promise.then(()=>!0,()=>!1),new Promise(u=>{setTimeout(u,h,!1)})])}async restart(h){return this.cancelAllRequests(),this.capabilities.supportsRestartRequest?(this.terminated=!1,this.lifecycleManagedByParent&&this.parentSession?await this.parentSession.restart({arguments:this.parentSession.configuration}):await this.sendRequest("restart",h),!0):!1}dispose(){this.toDispose.dispose()}async evaluate(h,u){var d;this.updateDeffered&&await((d=this.updateDeffered)===null||d===void 0?void 0:d.promise);const E=this.currentFrame&&this.currentFrame.raw.id;return(await this.sendRequest("evaluate",{expression:h,frameId:E,context:u})).body}async variables(h,u="named"){return(await this.sendRequest("variables",{variablesReference:h,filter:u})).body}async goto(h){if(this.capabilities.supportsGotoTargetsRequest)return await this.sendRequest("goto",h)}async exceptionInfo(h){return this.capabilities.supportsExceptionInfoRequest?this.sendRequest("exceptionInfo",h):Promise.reject(new Error("exceptionInfo not supported"))}async cancel(h){return this.sendRequest("cancel",{progressId:h})}async setVariableValue(h){if(this.capabilities.supportsSetVariable){const u=await this.sendRequest("setVariable",h);return this._onVariableChange.fire(),u}}async breakpointLocations(h,u){var d;const E=await this.toSource(h),a=(((d=(await this.sendRequest("breakpointLocations",{source:E.raw,line:u})).body)===null||d===void 0?void 0:d.breakpoints)||[]).map(b=>({lineNumber:b.line,column:b.column||1}));return Object.values(a.reduce((b,y)=>({...b,[`${y.lineNumber}:${y.column}`]:y}),{}))}async sendRequest(h,u,d){var E,f,a;if(!this._capabilities.supportsTerminateRequest&&h==="terminate"||!this._capabilities.supportsCompletionsRequest&&h==="completions"||!this._capabilities.supportsTerminateThreadsRequest&&h==="terminateThreads")throw new Error(`debug: ${h} not supported`);let b;["continue","next","stepIn","stepOut","threads"].some(y=>h===y)&&this.handleCancellation((E=this.currentThread)===null||E===void 0?void 0:E.raw.id),["stackTrace","scopes","variables","completions","threads"].some(y=>h===y)&&(b=!((f=this.currentThread)===null||f===void 0)&&f.raw.id?this.getNewCancellationToken((a=this.currentThread)===null||a===void 0?void 0:a.raw.id,d):void 0);try{return await this.connection.sendRequest(h,u,this.configuration,b)}finally{this._onRequest.fire(h)}}async takeCommand(h){return new Promise(u=>{const d=this.onRequest(E=>{E===h&&(d.dispose(),u())})})}sendCustomRequest(h,u){return this.connection.sendCustomRequest(h,u)}on(h,u){return this.connection.on(h,u)}get onDidCustomEvent(){return this.connection.onDidCustomEvent}hasSeparateRepl(){return!this.parentSession||this.options.repl!=="mergeWithParent"}reportTime(h,u){return this.sessionManager.reportTime(h,u)}getNewCancellationToken(h,u){const d=new c.CancellationTokenSource(u),E=this.cancellationMap.get(h)||[];return E.push(d),this.cancellationMap.set(h,E),d.token}cancelAllRequests(){this.cancellationMap.forEach(h=>h.forEach(u=>u.cancel())),this.cancellationMap.clear()}handleCancellation(h){if(h){const u=this.cancellationMap.get(h);this.cancellationMap.delete(h),u&&u.forEach(d=>d.cancel())}else this.cancelAllRequests()}getDebugProtocolBreakpoint(h){const u=this.breakpointManager.getBreakpoints().find(d=>d.id===h);if(u){const d=u.status.get(this.id);return{id:d?.id,verified:!!d?.verified,message:d?.message,source:d?.source,line:d?.line,column:d?.column,endLine:d?.endLine,endColumn:d?.endColumn,instructionReference:d?.instructionReference,offset:d?.offset}}}currentEditor(){var h;return(h=this.getModel())===null||h===void 0?void 0:h.getEditor()}getModel(){return this.modelManager.model}async readMemory(h,u,d){return this.capabilities.supportsReadMemoryRequest?await this.sendRequest("readMemory",{count:d,memoryReference:h,offset:u}):Promise.resolve(void 0)}async writeMemory(h,u,d,E){return this.capabilities.supportsWriteMemoryRequest?await this.sendRequest("writeMemory",{memoryReference:h,offset:u,allowPartial:E,data:d}):Promise.resolve(void 0)}}t.DebugSession=g},5905:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseSnippet=t.CharWidthReader=t.DEFAULT_WORD_REGEXP=t.USUAL_WORD_SEPARATORS=void 0,t.isExtensionHostDebugging=c,t.matchAll=p,t.isRemoteAttach=v;const n=e(41869),r=e(57711),{equalsIgnoreCase:o}=n.strings;function c(g){return g.type&&o(g.type==="vslsShare"?g.adapterProxy.configuration.type:g.type,"extensionhost")}function p(g,l){let h;const u=[];for(;(h=l.exec(g))!==null;)u.push(h);return u}function v(g){if(g.request==="attach"){const l={node:"address",java:"hostName",go:"host",cppdbg:"miDebuggerServerAddress",python:"host"},{type:h}=g,u=g[l[h]];return u?!["localhost","0.0.0.0","127.0.0.1","::1"].includes(u):!0}return!1}t.USUAL_WORD_SEPARATORS="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function m(g=""){let l="(-?\\d*\\.\\d\\w*)|([^";for(const h of t.USUAL_WORD_SEPARATORS)g.indexOf(h)>=0||(l+="\\"+h);return l+="\\s]+)",new RegExp(l,"g")}t.DEFAULT_WORD_REGEXP=m();class _{static getInstance(){return _._INSTANCE||(_._INSTANCE=new _),_._INSTANCE}constructor(){this._cache=new Map,this._canvas=document.createElement("canvas")}getCharWidth(l,h){const u=l+h;if(this._cache.has(u))return this._cache.get(u);const d=this._canvas.getContext("2d");d.font=h;const f=d.measureText(l).width;return this._cache.set(u,f),f}}t.CharWidthReader=_,_._INSTANCE=null;const s=g=>{const l=new RegExp(/^\^\"(.*)\"/gm),h=new r.SnippetParser;return new RegExp(/\${\d+:(.*)/).test(g)||l.test(g)?h.parse(g).toString().replace(l,"$1"):g};t.parseSnippet=s},17475:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugBreakpointWidget=t.TopStackType=void 0;const r=e(85608),o=e(76003),c=e(41869),p=e(43718),v=r.__importStar(e(20868)),m=e(64582),_=e(97319),s=e(4983),g=e(27562);var l;(function(u){u[u.exception=0]="exception",u[u.debugger=1]="debugger"})(l||(t.TopStackType=l={}));let h=n=class extends p.Disposable{constructor(){super(),this.breakpointWidgetInputFocus=s.CONTEXT_BREAKPOINT_INPUT_FOCUSED.bind(this.contextKeyService)}get position(){return this._position}get values(){var d;return(d=this.zone)===null||d===void 0?void 0:d.values}get breakpointType(){var d;return(d=this.zone)===null||d===void 0?void 0:d.breakpointType}show(d,E,f="condition"){this.dispose(),this._position=d,this.addDispose(this.zone=this.injector.get(g.DebugBreakpointZoneWidget,[this.editor,{...E},f])),this.addDispose(this.zone.onDidChangeBreakpoint(({context:a,value:b})=>{E&&(E[a]=b)})),this.addDispose(this.zone.onFocus(()=>{this.breakpointWidgetInputFocus.set(!0)})),this.addDispose(this.zone.onBlur(()=>{this.breakpointWidgetInputFocus.set(!1)})),this.addDispose(this.zone.onDispose(()=>{this._position=void 0,this.breakpointWidgetInputFocus.set(!1)})),this.zone.show(v.positionToRange(d),n.LINE_HEIGHT_NUMBER)}hide(){var d;(d=this.zone)===null||d===void 0||d.hide()}};t.DebugBreakpointWidget=h,h.LINE_HEIGHT_NUMBER=2,r.__decorate([(0,o.Autowired)(m.DebugEditor),r.__metadata("design:type",Object)],h.prototype,"editor",void 0),r.__decorate([(0,o.Autowired)(_.DebugBreakpointsService),r.__metadata("design:type",_.DebugBreakpointsService)],h.prototype,"debugBreakpointsService",void 0),r.__decorate([(0,o.Autowired)(c.IContextKeyService),r.__metadata("design:type",Object)],h.prototype,"contextKeyService",void 0),r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],h.prototype,"injector",void 0),t.DebugBreakpointWidget=h=n=r.__decorate([(0,o.Injectable)(),r.__metadata("design:paramtypes",[])],h)},27562:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugBreakpointZoneWidget=void 0;const r=e(85608),o=r.__importDefault(e(14041)),c=r.__importDefault(e(25873)),p=e(76003),v=e(97267),m=e(41869),_=e(43718),s=e(20303),g=e(52416),l=e(31324),h=e(64582),u=e(97319),d=r.__importDefault(e(55797));let E=n=class extends s.ZoneWidget{_fillContainer(a){}get values(){return{...this.contexts,[this.context]:this.input&&this.input.monacoEditor.getValue()||void 0}}get breakpointType(){return this.context}constructor(a,b={},y="condition"){super(a),this.editor=a,this.contexts=b,this.context=y,this._onDidChangeBreakpoint=new _.Emitter,this.onDidChangeBreakpoint=this._onDidChangeBreakpoint.event,this._onFocus=new _.Emitter,this.onFocus=this._onFocus.event,this._onBlur=new _.Emitter,this.onBlur=this._onBlur.event,this.inputFocusHandler=()=>{this._onFocus.fire()},this.inputBlurHandler=()=>{this._onBlur.fire()},this.selectContextHandler=A=>{this.input&&(this.contexts[this.context]=this.input.monacoEditor.getValue()||void 0),this.context=A,this.setInputMode(),this.render()},this._wrapper=document.createElement("div"),this._selection=document.createElement("div"),this._input=document.createElement("div"),this._container.appendChild(this._wrapper),this._wrapper.appendChild(this._selection),this._wrapper.appendChild(this._input),c.default.createRoot(this._input).render(o.default.createElement(o.default.Fragment,null))}hide(){this.input&&(this.input.dispose(),this.input=void 0),super.dispose()}show(a,b){super.show(a,b),this.debugBreakpointsService.createBreakpointInput(this._input).then(y=>{this.input=y;const{monacoEditor:A}=this.input;this.setInputMode(),this.addDispose(A.onDidBlurEditorWidget(()=>{this.inputBlurHandler()})),this.addDispose(A.onDidFocusEditorWidget(()=>{this.inputFocusHandler()})),this.addDispose(A.onDidChangeModelContent(S=>{if(!this.input)return;A.getValue().length===0?this.ensureRenderPlaceholder():this.clearPlaceholder();const T=A.getModel().getLineCount();this._relayout(T+1)})),this.syncPreContent()})}createDecorations(){this.input&&this.input.monacoEditor.getValue().length===0&&this.input.monacoEditor.deltaDecorations([],[{range:{startLineNumber:1,endLineNumber:0,startColumn:0,endColumn:1},options:{description:"debug-breakpoint-zone-widget",afterContentClassName:d.default.input_placeholder}}])}renderOption(a,b){return o.default.createElement(v.Option,{value:a},b)}setInputMode(){var a,b;const y=(a=this.editor.getModel())===null||a===void 0?void 0:a.getLanguageId(),A=(b=this.input)===null||b===void 0?void 0:b.monacoEditor.getModel();A&&y&&A.setLanguage(this.context==="logMessage"?"plaintext":y)}renderPlaceholder(){if(!this.input)return;this.clearPlaceholder();const a=`'${this.placeholder}' !important`;this.cssRenderDisposable=this.cssManager.addClass(n.INPUT_PLACEHOLDER_AFTER,{content:a})}ensureRenderPlaceholder(){this.input&&(this.createDecorations(),this.renderPlaceholder())}syncPreContent(){if(this.input){this.input.focus();const a=this.contexts[this.context]||"";this.input.monacoEditor.setValue(a)}}clearPlaceholder(){this.cssRenderDisposable&&(this.cssRenderDisposable.dispose(),this.cssRenderDisposable=void 0)}applyClass(){if(this._wrapper.className=d.default.debug_breakpoint_wrapper,this._selection.className=d.default.debug_breakpoint_selected,this._input.className=d.default.debug_breakpoint_input,!this.editor.getModel())return;const b=this.editor.getOption(l.EditorOption.lineHeight),y=this.editor.getOption(l.EditorOption.fontSize),A=b-y;this._input.style.marginTop=A+"px"}applyStyle(){this.syncPreContent(),c.default.createRoot(this._selection).render(o.default.createElement(v.Select,{value:this.context,selectedRenderer:()=>o.default.createElement("span",{className:"kt-select-option"},this.getContextToLocalize(this.context)),onChange:this.selectContextHandler},this.renderOption("condition",this.getContextToLocalize("condition")),this.renderOption("hitCondition",this.getContextToLocalize("hitCondition")),this.renderOption("logMessage",this.getContextToLocalize("logMessage"))))}getContextToLocalize(a){switch(a){case"logMessage":return(0,_.localize)("debug.expression.logMessage");case"hitCondition":return(0,_.localize)("debug.expression.hitCondition");default:return(0,_.localize)("debug.expression.condition")}}get placeholder(){switch(this.context){case"logMessage":return(0,_.localize)("debug.expression.log.placeholder");case"hitCondition":return(0,_.localize)("debug.expression.hit.placeholder");default:return(0,_.localize)("debug.expression.condition.placeholder")}}};t.DebugBreakpointZoneWidget=E,E.INPUT_PLACEHOLDER_AFTER=d.default.input_placeholder+"::after",r.__decorate([(0,p.Autowired)(u.DebugBreakpointsService),r.__metadata("design:type",u.DebugBreakpointsService)],E.prototype,"debugBreakpointsService",void 0),r.__decorate([(0,p.Autowired)(m.PreferenceService),r.__metadata("design:type",Object)],E.prototype,"preferenceService",void 0),r.__decorate([(0,p.Autowired)(g.ICSSStyleService),r.__metadata("design:type",Object)],E.prototype,"cssManager",void 0),t.DebugBreakpointZoneWidget=E=n=r.__decorate([(0,p.Injectable)({multiple:!0}),r.__metadata("design:paramtypes",[Object,Object,String])],E)},52943:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugEditorContribution=void 0;const r=e(85608),o=e(76003),c=e(41869),p=e(54414),v=e(51553),m=r.__importStar(e(20868)),_=e(79865),s=e(44781),g=e(38390),l=e(17280),h=e(84303),u=e(38029),d=e(16170),E=e(64582),f=e(5905),a="inlinevaluedecoration",b=100,y=150,A=500,{flatten:S}=c.arrays;class w{constructor(R,P){this.column=R,this.text=P}}function T(M,R,P=1073741824){return R.length>y&&(R=R.substr(0,y)+"..."),{range:{startLineNumber:M,endLineNumber:M,startColumn:P,endColumn:P},renderOptions:{after:{contentText:R,backgroundColor:"rgba(255, 200, 0, 0.2)",margin:"10px"},dark:{after:{color:"rgba(255, 255, 255, 0.5)"}},light:{after:{color:"rgba(0, 0, 0, 0.5)"}}}}}function D(M,R,P,k){const F=new Map;for(const j of M)if(F.set(j.name,j.value),F.size>=b)break;const L=new Map;F.forEach((j,W)=>{const U=k.get(W);if(U)for(const Q of U)R.containsPosition(new c.Position(Q,0))&&(L.has(Q)||L.set(Q,[]),L.get(Q).indexOf(W)===-1&&L.get(Q).push(W))});const B=[];return L.forEach((j,W)=>{const U=j.sort((Q,V)=>{const $=P.getLineContent(W);return $.indexOf(Q)-$.indexOf(V)}).map(Q=>`${Q} = ${F.get(Q)}`).join(", ");B.push(T(W,U))}),B}function I(M){const R=new Map;if(!M)return R;for(let P=1,k=M.getLineCount();P<=k;++P){const F=M.getLineContent(P);if(F.length>A)continue;M.tokenization.forceTokenization(P);const L=M.tokenization.getLineTokens(P);for(let B=0,j=L.getCount();B<j;B++)if(L.getStandardTokenType(B)===g.StandardTokenType.Other){f.DEFAULT_WORD_REGEXP.lastIndex=0;const U=L.getStartOffset(B),Q=L.getEndOffset(B),V=F.substring(U,Q),$=f.DEFAULT_WORD_REGEXP.exec(V);if($){const Y=$[0];R.has(Y)||R.set(Y,[]),R.get(Y).push(P)}}}return R}let O=n=class{constructor(R){this.editor=R,this.disposer=new c.Disposable,this.editorDisposer=new c.Disposable}contribute(R){return this.disposer.addDispose(this.debugSessionManager.onDidChangeActiveDebugSession(()=>{const P=this.debugSessionManager.currentSession;P&&(this.editorDisposer.addDispose(P.onDidChange(async()=>{var k,F;this.setHoverEnabled(R,P.state===E.DebugState.Running);const L=(k=P.currentThread)===null||k===void 0?void 0:k.currentFrame;L&&R.currentUri&&!((F=L.source)===null||F===void 0)&&F.uri.isEqual(R.currentUri)&&await this.toggleExceptionWidget()})),this.editorDisposer.addDispose(P.onDidExitAdapter(()=>{this.setHoverEnabled(R,!0)})),this.editorDisposer.addDispose(this.editorService.onActiveResourceChange(k=>{var F;k?.uri.toString()===((F=P.getModel())===null||F===void 0?void 0:F.uri.toString())?this.setHoverEnabled(R):this.setHoverEnabled(R,!0)})),this.disposer.addDispose([c.Event.any(P.onDidChangeCallStack,P.onDidStop)(async()=>{await this.directRunUpdateInlineValueDecorations(R)}),P.onDidExitAdapter(()=>{this.removeInlineValuesScheduler(R).schedule(),this.editorDisposer.dispose()})]),this.disposer.addDispose(P.onDidChangeState(k=>{k!==E.DebugState.Stopped&&this.toggleExceptionWidget()})),this.disposer.addDispose(P),this.registerEditorListener(R))})),this.disposer.addDispose(this.debugSessionManager.onDidDestroyDebugSession(()=>{this.closeExceptionWidget()})),this.disposer.addDispose(this.editorDisposer),this.toggleExceptionWidget(),this.disposer}registerEditorListener(R){this.editorDisposer.addDispose(R.monacoEditor.onKeyDown(async P=>{var k,F,L,B,j;if(((L=(F=(k=this.debugSessionManager.currentSession)===null||k===void 0?void 0:k.currentFrame)===null||F===void 0?void 0:F.source)===null||L===void 0?void 0:L.uri.toString())===((B=R.currentUri)===null||B===void 0?void 0:B.toString())&&P.keyCode===m.KeyCode.Alt){this.setHoverEnabled(R,!0),(j=this.debugModelManager.model)===null||j===void 0||j.getDebugHoverWidget().hide();const W=R.monacoEditor.onKeyUp(async U=>{var Q;U.keyCode===m.KeyCode.Alt&&(this.setHoverEnabled(R,!1),(Q=this.debugModelManager.model)===null||Q===void 0||Q.getDebugHoverWidget().show(),W.dispose())})}})),this.editorDisposer.addDispose(R.monacoEditor.onDidChangeModelContent(async()=>{n.MEMOIZER.clear(),await this.directRunUpdateInlineValueDecorations(R)})),this.editorDisposer.addDispose(R.monacoEditor.onDidChangeModel(async()=>{this.toggleExceptionWidget(),await this.directRunUpdateInlineValueDecorations(R)}))}registerDecorationType(){this.overrideServicesRegistry.getRegisteredService(c.ServiceNames.CODE_EDITOR_SERVICE).registerDecorationType("inline-value-decoration",a,{})}setHoverEnabled(R,P=!this.debugContextKey.contextInDebugMode.get()){R.monacoEditor.updateOptions({hover:{enabled:P}})}async directRunUpdateInlineValueDecorations(R){var P;const k=(P=this.debugSessionManager.currentSession)===null||P===void 0?void 0:P.currentFrame;k&&(n.MEMOIZER.clear(),await this.updateInlineValueDecorations(k,R))}removeInlineValuesScheduler(R){return new c.RunOnceScheduler(()=>R.monacoEditor.removeDecorationsByType(a),100)}async updateInlineValueDecorations(R,P){var k;if(!P)return;const F="{0} = {1}",L=", ",B=P.monacoEditor.getModel();if(!this.preferenceService.get("debug.inline.values")||!B||!R||B.uri.toString()!==((k=R.source)===null||k===void 0?void 0:k.uri.toString())){this.removeInlineValuesScheduler(P).isScheduled()||this.removeInlineValuesScheduler(P).schedule();return}this.removeInlineValuesScheduler(P).cancel();let j;if(_.languageFeaturesService.inlineValuesProvider.has(B)){const W=async(H,K)=>{const Z=await R.getMostSpecificScopes(R.range()),X=K?H:H.toLowerCase();for(const ie of Z){await ie.ensureLoaded();const le=(ie.children||[]).find(pe=>K?pe.name===X:pe.name.toLowerCase()===X);if(le)return le.value}},U={frameId:R.raw.id,stoppedLocation:(()=>{const H=R.range();return new s.Range(H.startLineNumber,H.startColumn+1,H.endLineNumber,H.endColumn+1)})()},Q=new c.CancellationTokenSource().token,V=P.monacoEditor.getVisibleRanges(),$=_.languageFeaturesService.inlineValuesProvider.ordered(B).reverse();j=[];const Y=new Map,z=S($.map(H=>V.map(K=>Promise.resolve(H.provideInlineValues(B,K,U,Q)).then(async Z=>{if(Z)for(const X of Z){let ie;switch(X.type){case"text":ie=X.text;break;case"variable":{let oe=X.variableName;oe||(oe=B.getLineContent(X.range.startLineNumber).substring(X.range.startColumn-1,X.range.endColumn-1));const le=await W(oe,X.caseSensitiveLookup);le&&(ie=c.strings.format(F,oe,le));break}case"expression":{let oe=X.expression;if(oe||(oe=B.getLineContent(X.range.startLineNumber).substring(X.range.startColumn-1,X.range.endColumn-1)),oe){const le=new d.DebugWatchRoot(R.thread.session),pe=new d.DebugWatchNode(R.thread.session,oe,le);await pe.evaluate(oe),pe.available&&(ie=c.strings.format(F,oe,pe.description))}break}}if(ie){const oe=X.range.startLineNumber;let le=Y.get(oe);le||(le=[],Y.set(oe,le)),le.some(pe=>pe.text===ie)||le.push(new w(X.range.startColumn,ie))}}},Z=>{(0,c.onUnexpectedExternalError)(Z)}))));await Promise.all(z),Y.forEach((H,K)=>{if(H.length>0){H=H.sort((X,ie)=>X.column-ie.column);const Z=H.map(X=>X.text).join(L);j.push(T(K,Z))}})}else{const W=await R.getMostSpecificScopes(R.range());j=(await Promise.all(W.map(async Q=>{await Q.ensureLoaded();const V=Q.children||[],$=R.range(),Y=Q.range();let z=new s.Range(0,0,$.startLineNumber,$.startColumn);return Y&&(z=z.setStartPosition(Y.startLineNumber,Y.startColumn)),D(V,z,B,I(P?.monacoEditor.getModel()))}))).reduce((Q,V)=>Q.concat(V),[])}P.monacoEditor.setDecorationsByType("inline-value-decoration",a,j)}async toggleExceptionWidget(){var R,P;const k=this.debugSessionManager.currentSession;if(!k){this.closeExceptionWidget();return}const{currentThread:F}=k;if(!F){this.closeExceptionWidget();return}const L=F.frames.find(j=>!!(j&&j.source&&j.source.available&&j.source.presentationHint!=="deemphasize"));if(!L){this.closeExceptionWidget();return}const B=(R=this.editor.currentUri)===null||R===void 0?void 0:R.isEqual((P=L.source)===null||P===void 0?void 0:P.uri);if(this.debugExceptionWidget&&!B)this.closeExceptionWidget();else if(B){const j=await F?.fetchExceptionInfo();j&&this.showExceptionWidget(j,k,L.range().startLineNumber,L.range().startColumn)}}showExceptionWidget(R,P,k,F){this.debugExceptionWidget&&this.debugExceptionWidget.dispose();const L=P?.currentEditor();this.debugExceptionWidget=this.injector.get(h.DebugExceptionWidget,[L,R]),this.debugExceptionWidget.show(m.positionToRange({lineNumber:k,column:F}),10),this.debugExceptionWidget.focus(),L?.revealRangeInCenter({startLineNumber:k,startColumn:F,endLineNumber:k,endColumn:F}),this.debugContextKey.contextExceptionWidgetVisible.set(!0)}closeExceptionWidget(){this.debugExceptionWidget&&(this.debugContextKey.contextExceptionWidgetVisible.set(!1),this.debugExceptionWidget.dispose(),this.debugExceptionWidget=void 0)}};t.DebugEditorContribution=O,O.MEMOIZER=(0,c.createMemoizer)(),r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],O.prototype,"injector",void 0),r.__decorate([(0,o.Autowired)(c.IContextKeyService),r.__metadata("design:type",Object)],O.prototype,"contextKeyService",void 0),r.__decorate([(0,o.Autowired)(E.IDebugModelManager),r.__metadata("design:type",Object)],O.prototype,"debugModelManager",void 0),r.__decorate([(0,o.Autowired)(E.IDebugSessionManager),r.__metadata("design:type",u.DebugSessionManager)],O.prototype,"debugSessionManager",void 0),r.__decorate([(0,o.Autowired)(c.PreferenceService),r.__metadata("design:type",Object)],O.prototype,"preferenceService",void 0),r.__decorate([(0,o.Autowired)(c.MonacoOverrideServiceRegistry),r.__metadata("design:type",c.MonacoOverrideServiceRegistry)],O.prototype,"overrideServicesRegistry",void 0),r.__decorate([(0,o.Autowired)(p.WorkbenchEditorService),r.__metadata("design:type",v.WorkbenchEditorServiceImpl)],O.prototype,"editorService",void 0),r.__decorate([(0,o.Autowired)(l.DebugContextKey),r.__metadata("design:type",l.DebugContextKey)],O.prototype,"debugContextKey",void 0),t.DebugEditorContribution=O=n=r.__decorate([(0,o.Injectable)(),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[Object])],O)},74257:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugExpressionProvider=void 0;const n=e(85608),r=e(76003),o=e(43718),c=n.__importStar(e(20868)),p=e(39266),{coalesce:v}=o.arrays;let m=class{async get(s,g){var l,h;let u,d;if(this.evaluatableExpressionService.hasEvaluatableExpressProvider(s)){const E=new o.CancellationTokenSource,f=this.evaluatableExpressionService.getSupportedEvaluatableExpressionProvider(s),a=new c.Position(g.startLineNumber,g.startColumn),b=f.map(A=>Promise.resolve(A.provideEvaluatableExpression(s,a,E.token)).then(S=>S,()=>{})),y=await Promise.all(b).then(v);y.length>0&&(u=(l=y[0])===null||l===void 0?void 0:l.expression,d=(h=y[0])===null||h===void 0?void 0:h.range,!u&&d&&(u=s.getLineContent(a.lineNumber).substring(d.startColumn-1,d.endColumn-1)))}else{const E=s.getLineContent(g.startLineNumber),{start:f,end:a}=this.getExactExpressionStartAndEnd(E,g.startColumn,g.endColumn);u=E.substring(f-1,a)}return u}getExactExpressionStartAndEnd(s,g,l){let h,u=0;const d=/([^()[\]{}<>\s+\-/%~#^;=|,`!]|->)+/g;let E=null;for(;E=d.exec(s);){const f=E.index+1,a=f+E[0].length;if(f<=g&&a>=l){h=E[0],u=f;break}}if(h){const f=/\w+/g;let a=null;for(;(a=f.exec(h))&&!(a.index+1+u+a[0].length>=l););a&&(h=h.substring(0,f.lastIndex))}return h?{start:u,end:u+h.length-1}:{start:0,end:0}}};t.DebugExpressionProvider=m,n.__decorate([(0,r.Autowired)(p.IEvaluatableExpressionService),n.__metadata("design:type",Object)],m.prototype,"evaluatableExpressionService",void 0),t.DebugExpressionProvider=m=n.__decorate([(0,r.Injectable)()],m)},3367:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverModel=void 0;const r=e(85608),o=e(76003),c=e(97267),p=e(41869),v=e(98650);let m=n=class extends c.TreeModel{constructor(s){super(),this.flushDispatchChangeDelayer=new p.ThrottledDelayer(n.DEFAULT_FLUSH_DELAY),this.init(s)}init(s){this.root=s,this.root.watcher.on(c.TreeNodeEvent.BranchDidUpdate,()=>{this.flushDispatchChangeDelayer.isTriggered()||this.flushDispatchChangeDelayer.cancel(),this.flushDispatchChangeDelayer.trigger(async()=>{this.dispatchChange()})})}};t.DebugHoverModel=m,m.DEFAULT_FLUSH_DELAY=100,t.DebugHoverModel=m=n=r.__decorate([(0,o.Injectable)({multiple:!0}),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[v.ExpressionContainer])],m)},23217:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverSource=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(64582),p=e(38029),v=e(98650);let m=class{constructor(){this.onDidChangeEmitter=new o.Emitter,this.onDidChange=this.onDidChangeEmitter.event}dispose(){this._expression=void 0}get expression(){return this._expression}clearEvaluate(){this.onDidChangeEmitter.fire(void 0)}async evaluate(s){const g=await this.doEvaluate(s);return this._expression=g,this.onDidChangeEmitter.fire(g),g}async doEvaluate(s){const{currentSession:g}=this.sessions;if(g){if(g.capabilities.supportsEvaluateForHovers){const l=new v.DebugHoverVariableRoot(s,g);return await l.evaluate("hover"),l.available&&l||void 0}return this.findVariable(s.split(".").map(l=>l.trim()).filter(l=>!!l))}}async findVariable(s){const{currentFrame:g}=this.sessions;if(!g)return;let l;const h=await g.getScopes();for(const u of h){const d=await this.doFindVariable(u,s);if(!l)l=d;else if(d&&d.value!==l.value)return}return l}async doFindVariable(s,g){await s.ensureLoaded();const l=s.children,h=[];if(l){for(const u of l)(u instanceof v.DebugVariableContainer||u instanceof v.DebugVariable)&&u.name===g[0]&&h.push(u);if(h.length===1)return g.length===1?h[0]:this.doFindVariable(h[0],g.slice(1))}}};t.DebugHoverSource=m,n.__decorate([(0,r.Autowired)(c.IDebugSessionManager),n.__metadata("design:type",p.DebugSessionManager)],m.prototype,"sessions",void 0),t.DebugHoverSource=m=n.__decorate([(0,r.Injectable)()],m)},85322:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverTreeModelService=void 0;const r=e(85608),o=e(76003),c=e(97267),p=e(41869),v=e(98650),m=r.__importDefault(e(57259)),_=e(3367),s=e(23217),{Path:g}=p.path;let l=n=class{constructor(){this._changeEventDispatchQueue=[],this.selectedDecoration=new c.Decoration(m.default.mod_selected),this.focusedDecoration=new c.Decoration(m.default.mod_focused),this.loadingDecoration=new c.Decoration(m.default.mod_loading),this._selectedNodes=[],this.onDidRefreshedEmitter=new p.Emitter,this.onDidUpdateTreeModelOrVariableEmitter=new p.Emitter,this.disposableCollection=new p.DisposableCollection,this.activeNodeDecoration=(u,d=!0)=>{if(this.preContextMenuFocusedNode&&(this.focusedDecoration.removeTarget(this.preContextMenuFocusedNode),this.selectedDecoration.removeTarget(this.preContextMenuFocusedNode),this.preContextMenuFocusedNode=null),u){if(this.selectedNodes.length>0)for(const E of this.selectedDecoration.appliedTargets.keys())this.selectedDecoration.removeTarget(E);this.focusedNode&&this.focusedDecoration.removeTarget(this.focusedNode),this.selectedDecoration.addTarget(u),this.focusedDecoration.addTarget(u),this._focusedNode=u,this._selectedNodes=[u],d&&this.treeModel.dispatchChange()}},this.activeNodeFocusedDecoration=(u,d=!1)=>{this.focusedNode!==u&&(d?(this.preContextMenuFocusedNode?(this.focusedDecoration.removeTarget(this.preContextMenuFocusedNode),this.selectedDecoration.removeTarget(this.preContextMenuFocusedNode)):this.focusedNode&&this.focusedDecoration.removeTarget(this.focusedNode),this.preContextMenuFocusedNode=u):this.focusedNode&&(this.preContextMenuFocusedNode=null,this.focusedDecoration.removeTarget(this.focusedNode)),u&&(this.selectedDecoration.addTarget(u),this.focusedDecoration.addTarget(u),this._focusedNode=u,this._selectedNodes.push(u))),this.treeModel.dispatchChange()},this.enactiveNodeDecoration=()=>{this.focusedNode&&(this.focusedDecoration.removeTarget(this.focusedNode),this.treeModel.dispatchChange()),this._focusedNode=void 0},this.handleTreeBlur=()=>{this.enactiveNodeDecoration()},this.handleTwistierClick=u=>{v.ExpressionContainer.is(u)?(this.activeNodeDecoration(u,!1),this.toggleDirectory(u)):this.activeNodeDecoration(u)},this.toggleDirectory=async u=>{u.expanded?this.treeHandle.collapseNode(u):this.treeHandle.expandNode(u)},this.flushEventQueue=()=>{let u;if(!this._changeEventDispatchQueue||this._changeEventDispatchQueue.length===0)return;this._changeEventDispatchQueue.sort((E,f)=>{const a=g.pathDepth(E),b=g.pathDepth(f);return a-b});const d=[this._changeEventDispatchQueue[0]];for(const E of this._changeEventDispatchQueue)d.some(f=>E.indexOf(f)===0)||d.push(E);return u=(0,p.pSeries)(d.map(E=>async()=>{var f;const a=(f=this.treeModel.root)===null||f===void 0?void 0:f.watchEvents.get(E);return a&&typeof a.callback=="function"&&await a.callback({type:c.WatchEvent.Changed,path:E}),null})),this._changeEventDispatchQueue=[],u},this.debugHoverSource.onDidChange(async u=>{if(!u){this.onDidUpdateTreeModelOrVariableEmitter.fire({treeModel:void 0,variable:void 0});return}u instanceof v.DebugVariable?(this.dispose(),this.onDidUpdateTreeModelOrVariableEmitter.fire({variable:u})):(await this.initTreeModel(u),this.onDidUpdateTreeModelOrVariableEmitter.fire({treeModel:this.treeModel}))})}get onDidRefreshed(){return this.onDidRefreshedEmitter.event}get onDidUpdateTreeModelOrVariable(){return this.onDidUpdateTreeModelOrVariableEmitter.event}get flushEventQueuePromise(){return this.flushEventQueueDeferred&&this.flushEventQueueDeferred.promise}get treeHandle(){return this._debugHoverTreeHandle}get decorations(){return this._decorations}get treeModel(){return this._treeModel}get whenReady(){return this._whenReady}get focusedNode(){return this._focusedNode}get selectedNodes(){return this._selectedNodes}dispose(){this.disposableCollection.disposed||this.disposableCollection.dispose()}listenTreeViewChange(){var u,d;this.dispose(),this.disposableCollection.push((u=this.treeModel)===null||u===void 0?void 0:u.root.watcher.on(c.TreeNodeEvent.WillResolveChildren,E=>{this.loadingDecoration.addTarget(E)})),this.disposableCollection.push((d=this.treeModel)===null||d===void 0?void 0:d.root.watcher.on(c.TreeNodeEvent.DidResolveChildren,E=>{this.loadingDecoration.removeTarget(E)}))}async initTreeModel(u){if(u)return this._treeModel=this.injector.get(_.DebugHoverModel,[u]),this.initDecorations(u),this.listenTreeViewChange(),this._treeModel}initDecorations(u){this._decorations=new c.DecorationsManager(u),this._decorations.addDecoration(this.selectedDecoration),this._decorations.addDecoration(this.focusedDecoration),this._decorations.addDecoration(this.loadingDecoration)}removeNodeDecoration(){this.decorations&&(this.decorations.removeDecoration(this.selectedDecoration),this.decorations.removeDecoration(this.focusedDecoration))}handleTreeHandler(u){this._debugHoverTreeHandle=u}async refresh(u=this.treeModel.root){!v.ExpressionContainer.is(u)&&u.parent&&(u=u.parent),this.queueChangeEvent(u.path,()=>{this.onDidRefreshedEmitter.fire()})}queueChangeEvent(u,d){this.flushEventQueueDeferred||(this.flushEventQueueDeferred=new p.Deferred,clearTimeout(this._eventFlushTimeout),this._eventFlushTimeout=setTimeout(async()=>{var E;await this.flushEventQueue(),(E=this.flushEventQueueDeferred)===null||E===void 0||E.resolve(),this.flushEventQueueDeferred=null,d()},n.DEFAULT_FLUSH_FILE_EVENT_DELAY)),this._changeEventDispatchQueue.indexOf(u)===-1&&this._changeEventDispatchQueue.push(u)}};t.DebugHoverTreeModelService=l,l.DEFAULT_FLUSH_FILE_EVENT_DELAY=100,r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],l.prototype,"injector",void 0),r.__decorate([(0,o.Autowired)(s.DebugHoverSource),r.__metadata("design:type",s.DebugHoverSource)],l.prototype,"debugHoverSource",void 0),t.DebugHoverTreeModelService=l=n=r.__decorate([(0,o.Injectable)(),r.__metadata("design:paramtypes",[])],l)},65960:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverWidget=void 0;const r=e(85608),o=r.__importDefault(e(12784)),c=r.__importDefault(e(14041)),p=r.__importDefault(e(25873)),v=e(76003),m=e(41869),_=r.__importStar(e(20868)),s=e(62663),g=e(64582),l=e(38029),h=e(74257),u=e(23217),d=e(63940);let E=n=class{constructor(){this.toDispose=new m.DisposableCollection,this.allowEditorOverflow=!0,this.doSchedule=(0,o.default)(a=>a(),300),this.init()}init(){this.toDispose.pushAll([m.Disposable.create(()=>this.editor.removeContentWidget(this)),m.Disposable.create(()=>this.hide()),this.sessions.onDidChange(()=>{this.isEditorFrame()||this.hide()})]),this.renderView()}handleWindowWheel(a){a.stopPropagation()}getId(){return n.ID}getDomNode(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.classList.add(n.ID)),this.domNode}getPosition(){var a;const b=this.options&&this.options.selection.getStartPosition(),y=b&&((a=this.editor.getModel())===null||a===void 0?void 0:a.getWordAtPosition(b));return b&&y?{position:new _.Position(b.lineNumber,y.startColumn),preference:[s.monacoBrowser.editor.ContentWidgetPositionPreference.BELOW,s.monacoBrowser.editor.ContentWidgetPositionPreference.ABOVE]}:null}dispose(){this.toDispose.dispose()}show(a){this.schedule(()=>this.doShow(a),a&&a.immediate)}hide(a){this.schedule(()=>this.doHide(),a&&a.immediate)}schedule(a,b=!0){b?(this.doSchedule.cancel(),a()):this.doSchedule(a)}isEditorFrame(){const{currentFrame:a}=this.sessions;return!!a&&!!a.source&&!!this.editor.getModel()&&this.editor.getModel().uri.toString()===a.source.uri.toString()}doHide(){window.removeEventListener("mousewheel",this.handleWindowWheel,!0),this.getDomNode().contains(document.activeElement)&&this.editor.focus(),this.hoverSource.dispose(),this.hoverSource.clearEvaluate(),this.options=void 0,this.editor.removeContentWidget(this)}layoutContentWidget(){this.editor.layoutContentWidget(this)}renderView(){p.default.createRoot(this.getDomNode()).render(c.default.createElement(m.ConfigProvider,{value:this.configContext},c.default.createElement(d.DebugHoverView,null))),this.layoutContentWidget()}async doShow(a=this.options){if(!this.isEditorFrame()||!a||this.options&&this.options.selection.equalsRange(a.selection))return;this.options=a;const b=await this.expressionProvider.get(this.editor.getModel(),a.selection);b&&(this.hoverSource.clearEvaluate(),await this.hoverSource.evaluate(b)&&(this.reporterService.point(g.DEBUG_REPORT_NAME===null||g.DEBUG_REPORT_NAME===void 0?void 0:g.DEBUG_REPORT_NAME.DEBUG_VARIABLES,"hover",b),this.editor.addContentWidget(this),window.addEventListener("mousewheel",this.handleWindowWheel,!0)))}};t.DebugHoverWidget=E,E.ID="debug-hover-widget",r.__decorate([(0,v.Autowired)(g.DebugEditor),r.__metadata("design:type",Object)],E.prototype,"editor",void 0),r.__decorate([(0,v.Autowired)(g.IDebugSessionManager),r.__metadata("design:type",l.DebugSessionManager)],E.prototype,"sessions",void 0),r.__decorate([(0,v.Autowired)(h.DebugExpressionProvider),r.__metadata("design:type",h.DebugExpressionProvider)],E.prototype,"expressionProvider",void 0),r.__decorate([(0,v.Autowired)(u.DebugHoverSource),r.__metadata("design:type",u.DebugHoverSource)],E.prototype,"hoverSource",void 0),r.__decorate([(0,v.Autowired)(m.AppConfig),r.__metadata("design:type",Object)],E.prototype,"configContext",void 0),r.__decorate([(0,v.Autowired)(m.IReporterService),r.__metadata("design:type",Object)],E.prototype,"reporterService",void 0),t.DebugHoverWidget=E=n=r.__decorate([(0,v.Injectable)(),r.__metadata("design:paramtypes",[])],E)},63940:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverView=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),c=e(97267),p=e(41869),v=e(1149),m=e(28875),_=e(85322),s=n.__importDefault(e(94084)),g=()=>{const l=(0,p.useInjectable)(_.DebugHoverTreeModelService),h=(0,p.useInjectable)(v.LayoutViewSizeConfig),u=250,d=420,E=4,[f,a]=o.default.useState({}),[b,y]=o.default.useState(u),A=o.default.useRef(null);o.default.useEffect(()=>(l.onDidUpdateTreeModelOrVariable(async M=>{const{treeModel:R,variable:P}=M;R&&await R.ensureReady,a({treeModel:R,variable:P})}),S(),()=>{l.removeNodeDecoration()}),[]),o.default.useEffect(()=>{let M;return y(u),f.treeModel&&(M=f.treeModel.root.watcher.on(c.TreeNodeEvent.DidChangeExpansionState,()=>{var R,P;const k=Math.max(u,(((R=f.treeModel)===null||R===void 0?void 0:R.root.branchSize)||0)*22),F=(P=A.current)===null||P===void 0?void 0:P.getBoundingClientRect();if(F){const L=F.top,B=window.innerHeight-L-h.statusBarHeight-E;y(Math.min(B,k,d))}else y(Math.min(d,k))})),()=>{M?.dispose()}},[f.treeModel]);const S=async()=>{l.treeModel&&(await l.treeModel.ensureReady,a({treeModel:l.treeModel}))},w=M=>{l.handleTreeHandler({...M,getModel:()=>f?.treeModel,hasDirectFocus:()=>A.current===document.activeElement})},T=(M,R)=>{M.stopPropagation();const{handleTwistierClick:P}=l;R&&P(R)},D=!!f.treeModel&&!!f.treeModel.root.variablesReference,I=o.default.useCallback(M=>{const R=l.decorations.getDecorations(M.item);return o.default.createElement(m.DebugVariableRenderedNode,{item:M.item,itemType:M.itemType,decorations:R,onClick:T,onTwistierClick:T,defaultLeftPadding:0,leftPadding:4})},[f.treeModel]),O=()=>D?o.default.createElement("div",{className:s.default.debug_hover_content,tabIndex:-1,ref:A},o.default.createElement(c.RecycleTree,{height:b,itemHeight:m.DEBUG_VARIABLE_TREE_NODE_HEIGHT,onReady:w,model:f.treeModel,placeholder:()=>o.default.createElement("span",null),overflow:"auto"},I)):null;return o.default.createElement("div",{className:s.default.debug_hover},f.treeModel?o.default.createElement("div",{className:(0,r.default)(s.default.debug_hover_title,D&&s.default.has_complex_value),title:f.treeModel.root.name},f.treeModel.root.name):f.variable&&o.default.createElement("div",{className:(0,r.default)(s.default.debug_hover_title,D&&s.default.has_complex_value),title:f.variable.name},f.variable.value),O())};t.DebugHoverView=g},71569:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugModelManager=void 0;const n=e(85608),r=e(76003),o=e(43718),c=e(54414),p=e(64582),v=e(99797),m=e(37499);let _=class extends o.Disposable{constructor(){super(),this.toDispose=new o.DisposableCollection,this._onMouseDown=new o.Emitter,this._onMouseMove=new o.Emitter,this._onMouseLeave=new o.Emitter,this._onMouseUp=new o.Emitter,this.onMouseDown=this._onMouseDown,this.onMouseMove=this._onMouseMove,this.onMouseLeave=this._onMouseLeave,this.onMouseUp=this._onMouseUp,this._onModelChanged=new o.Emitter,this.onModelChanged=this._onModelChanged.event,this.models=new Map}dispose(){for(const g of this.models.values())this.toDispose.pushAll(g);this.toDispose.dispose(),this.models.clear()}init(){this.editorCollection.onCodeEditorCreate(g=>this.push(g)),this.breakpointManager.onDidChangeBreakpoints(g=>{const{currentEditor:l}=this.editorService,h=l&&l.currentUri;h&&this.render(h),this.closeBreakpointIfAffected(g)})}get model(){const{currentEditor:g}=this.editorService,l=g&&g.currentUri;if(l){const h=this.models.get(l.toString());return h&&h[0]}}closeBreakpointIfAffected({affected:g,removed:l}){g.forEach(h=>{const u=this.models.get(h.toString());if(u)for(const d of u){const E=d.getBreakpointWidget(),f=E.position;if(!f)return;for(const a of l)a.raw.line===f.lineNumber&&E.dispose()}})}render(g){const l=this.models.get(g.toString());if(l)for(const h of l)h.render()}push(g){const l=g.monacoEditor;g.onRefOpen(u=>{const d=u.instance.uri.toString(),E=this.models.get(d)||[];let f=!1;if(E.length>0){for(const a of E)if(a.getEditor()._id===l._id){a.render(),f=!0;break}}if(!f){const a=u.instance.getMonacoModel(),b=this.debugModelFactory(l);E.push(b),this.models.set(d,E),a.onWillDispose(()=>{b.dispose(),this.models.delete(d)})}});const h=(u,d)=>{const E=l.getModel();if(!E)throw new Error("Not find model");this.handleMouseEvent(new o.URI(E.uri.toString()),u,d,l)};this.toDispose.push(l.onMouseMove(u=>h(p.DebugModelSupportedEventType.move,u))),this.toDispose.push(l.onMouseDown(u=>h(p.DebugModelSupportedEventType.down,u))),this.toDispose.push(l.onMouseLeave(u=>h(p.DebugModelSupportedEventType.leave,u))),this.toDispose.push(l.onContextMenu(u=>h(p.DebugModelSupportedEventType.contextMenu,u))),this.toDispose.push(l.onDidChangeModel(u=>this._onModelChanged.fire(u)))}resolve(g){const l=this.models.get(g.toString());if(l)return l}handleMouseEvent(g,l,h,u){const d=this.models.get(g.toString());if(!(!d||!this.debugConfigurationManager.canSetBreakpointsIn(d[0].getEditor().getModel()))){for(const f of d)if(f.getEditor().getId()===u.getId()){switch(l){case p.DebugModelSupportedEventType.contextMenu:f.onContextMenu(h);break;case p.DebugModelSupportedEventType.down:f.onMouseDown(h);break;case p.DebugModelSupportedEventType.leave:f.onMouseLeave(h);break;case p.DebugModelSupportedEventType.move:f.onMouseMove(h);break;default:break}break}}}};t.DebugModelManager=_,n.__decorate([(0,r.Autowired)(c.WorkbenchEditorService),n.__metadata("design:type",c.WorkbenchEditorService)],_.prototype,"editorService",void 0),n.__decorate([(0,r.Autowired)(c.EditorCollectionService),n.__metadata("design:type",c.EditorCollectionService)],_.prototype,"editorCollection",void 0),n.__decorate([(0,r.Autowired)(p.DebugModelFactory),n.__metadata("design:type",Function)],_.prototype,"debugModelFactory",void 0),n.__decorate([(0,r.Autowired)(v.BreakpointManager),n.__metadata("design:type",v.BreakpointManager)],_.prototype,"breakpointManager",void 0),n.__decorate([(0,r.Autowired)(m.DebugConfigurationManager),n.__metadata("design:type",m.DebugConfigurationManager)],_.prototype,"debugConfigurationManager",void 0),t.DebugModelManager=_=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],_)},91260:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugModel=void 0;const r=e(85608),o=r.__importDefault(e(12784)),c=e(76003),p=e(41869),v=e(93899),m=e(43718),_=r.__importStar(e(20868)),s=e(62663),g=e(52416),l=e(64582),h=e(24395),u=e(26296),d=e(99797),E=e(38949),f=e(38029),a=e(97319),b=e(17475),y=e(65960),A=r.__importStar(e(26571));let S=n=class{static createContainer(D,I){return D.createChild([{token:h.DebugEditor,useValue:I},{token:y.DebugHoverWidget,useClass:y.DebugHoverWidget},{token:b.DebugBreakpointWidget,useClass:b.DebugBreakpointWidget},{token:l.IDebugModel,useClass:n}])}static createModel(D,I){return n.createContainer(D,I).get(l.IDebugModel)}get uri(){return this._uri}constructor(){this.toDispose=new m.DisposableCollection,this.frameDecorations=[],this.updatingDecorations=!1,this.breakpointDecorations=[],this.breakpointRanges=new Map,this.currentBreakpointDecorations=[],this.candidateDecorations=[],this.renderFrames=(0,o.default)((D=[])=>{var I;if(this.toDispose.disposed||((I=this.editor.getModel())===null||I===void 0?void 0:I.uri.toString())!==this._uri.toString())return;const O=this.createFrameDecorations().concat(D);this.frameDecorations=this.deltaDecorations(this.frameDecorations,O)},100),this.toggleBreakpoint=(D=this.position)=>{this.doToggleBreakpoint(D)},this.openBreakpointView=(D,I,O)=>{this.breakpointWidget.show(D,I,O)},this.closeBreakpointView=()=>{this.breakpointWidget.hide()},this.acceptBreakpoint=()=>{const{position:D,values:I}=this.breakpointWidget;if(this.reporterService.point(l.DEBUG_REPORT_NAME===null||l.DEBUG_REPORT_NAME===void 0?void 0:l.DEBUG_REPORT_NAME.DEBUG_BREAKPOINT,this.breakpointWidget.breakpointType),D&&I){const O=this.getBreakpoint(D);O?(O.raw.condition=I.condition,O.raw.hitCondition=I.hitCondition,O.raw.logMessage=I.logMessage,this.breakpointManager.updateBreakpoint(O)):this.breakpointManager.addBreakpoint(d.DebugBreakpoint.create(this._uri,{line:D.lineNumber,...I})),this.breakpointWidget.hide()}},this.hintDecorations=[],this.init()}async init(){const D=this.editor.getModel();let I;this._uri=new m.URI(D.uri.toString()),this.decorator=new E.DebugDecorator,this.toDispose.pushAll([this.breakpointWidget,this.editor.onKeyDown(O=>{O.code==="Escape"&&!O.altKey&&!O.shiftKey&&!O.metaKey?this.debugHoverWidget.hide({immediate:!0}):this.debugHoverWidget.hide({immediate:!1})}),this.editor.onDidChangeModelContent(()=>this.renderFrames()),this.debugSessionManager.onDidChange(()=>this.renderFrames()),this.debugBreakpointsService.onDidFocusedBreakpoints(({range:O})=>{this.preferenceService.getValid("debug.breakpoint.editorHint",!0)&&(this.renderFrames([{options:A.FOCUS_BREAKPOINTS_STACK_FRAME_DECORATION,range:O}]),I&&clearTimeout(I),I=window.setTimeout(()=>{this.renderFrames(),clearTimeout(I)},300))}),this.editor.getModel().onDidChangeContent(()=>this.updateBreakpoints()),this.editor.onDidChangeModel(()=>{this.closeBreakpointView()})]),this.renderFrames(),this.render()}dispose(){this.toDispose.dispose()}get position(){return this._position||this.editor.getPosition()}get breakpoint(){return this.getBreakpoint()}getBreakpoint(D){return this.breakpointManager.getBreakpoint(this._uri,D?D.lineNumber:void 0)}createFrameDecorations(){var D;const I=[],{currentFrame:O,topFrame:M}=this.debugSessionManager;if(!O||!O.source||O.source.uri.toString()!==((D=this.editor.getModel())===null||D===void 0?void 0:D.uri.toString()))return I;const R=new _.Range(O.raw.line,O.raw.column,O.raw.line,1<<30),P=new _.Range(O.raw.line,O.raw.column,O.raw.line,O.raw.column+1);if(M===O)if(I.push({options:A.TOP_STACK_FRAME_MARGIN,range:P}),O.thread.stoppedDetails&&O.thread.stoppedDetails.reason==="exception")I.push({options:A.TOP_STACK_FRAME_EXCEPTION_DECORATION,range:R});else{I.push({options:A.TOP_STACK_FRAME_DECORATION,range:R});const{topFrameRange:k}=this;k&&k.startLineNumber===O.raw.line&&k.startColumn!==O.raw.column&&I.push({options:A.TOP_STACK_FRAME_INLINE_DECORATION,range:R}),this.topFrameRange=R}else I.push({options:A.FOCUSED_STACK_FRAME_MARGIN,range:P}),I.push({options:A.FOCUSED_STACK_FRAME_DECORATION,range:R});return I}deltaDecorations(D,I){this.updatingDecorations=!0;try{return this.editor.deltaDecorations(D,I)}finally{this.updatingDecorations=!1}}focusStackFrame(){this.renderFrames()}async render(){await this.renderBreakpoints(),this.renderFrames()}async renderBreakpoints(){await this.breakpointManager.whenReady,this.renderNormalBreakpoints(),this.renderCurrentBreakpoints()}renderNormalBreakpoints(){const D=this.createBreakpointDecorations();this.breakpointDecorations=this.deltaDecorations(this.breakpointDecorations,D),this.updateBreakpointRanges()}updateBreakpoints(){if(this.areBreakpointsAffected()){const D=this.createBreakpoints();this.breakpointManager.setBreakpoints(this._uri,D)}}areBreakpointsAffected(){if(this.updatingDecorations||!this.editor.getModel())return!1;for(const D of this.breakpointDecorations){const I=this.editor.getModel().getDecorationRange(D),O=this.breakpointRanges.get(D);if(!I||!I.equalsRange(O))return!0}return!1}createBreakpoints(){const{_uri:D}=this,I=new Set,O=[];for(const M of this.breakpointDecorations){const R=this.editor.getModel().getDecorationRange(M);if(R&&!I.has(R.startLineNumber)){const P=R.startLineNumber,k=this.breakpointRanges.get(M),F=k&&this.breakpointManager.getBreakpoint(D,k.startLineNumber)||{},L=d.DebugBreakpoint.create(D,{...F.raw||{},line:P},F.enabled);O.push(L),I.add(P)}}return O}createBreakpointDecorations(){return this.breakpointManager.getBreakpoints(this._uri).map(I=>this.createBreakpointDecoration(I))}createBreakpointDecoration(D){const I=D.raw.line,O=D.raw.column||0;return{range:new _.Range(I,O,I,O+1),options:{description:"breakpoint-decoration",stickiness:A.STICKINESS}}}async renderCurrentBreakpoints(){const D=this.breakpointManager.getBreakpoints(this._uri),I=this.createCurrentBreakpointDecorations(),O=this.deltaDecorations(this.currentBreakpointDecorations.map(({decorationId:P})=>P),I);this.currentBreakpointDecorations.forEach(P=>{P.inlineWidget&&P.inlineWidget.dispose()}),this.currentBreakpointDecorations=O.map((P,k)=>{const F=I[k],L=D[k],B=(L.enabled?A.BREAKPOINT_DECORATION:A.BREAKPOINT_DECORATION_DISABLED).glyphMarginClassName,j=F.options.beforeContentClassName?new w(this.editor,P,B,L,this.breakpointManager):void 0;return{breakpoint:L,decorationId:P,inlineWidget:j}});const M=await this.getCandidateBreakpoints(D),R=this.deltaDecorations(this.candidateDecorations.map(({decorationId:P})=>P),M);this.candidateDecorations.forEach(P=>{P.inlineWidget.dispose()}),this.candidateDecorations=R.map((P,k)=>{const{breakpoint:F}=M[k],L=(F?A.BREAKPOINT_DECORATION:A.BREAKPOINT_DECORATION_DISABLED).glyphMarginClassName,B=new w(this.editor,P,L,F,this.breakpointManager);return{decorationId:P,inlineWidget:B}})}async getCandidateBreakpoints(D){const I=this.editor.getModel(),O=this.debugSessionManager.currentSession;if(!I||!O?.capabilities.supportsBreakpointLocationsRequest)return[];const M=Array.from(new Set(D.map(P=>P.raw.line))),R=[];return await Promise.all(M.map(async P=>{const k=await O.breakpointLocations(this._uri,P);if(k.length<=1)return;const F=I.getLineCount();if(P>F)return;const L=I.getLineFirstNonWhitespaceColumn(P),B=I.getLineLastNonWhitespaceColumn(P);k.forEach(j=>{const W=new _.Range(j.lineNumber,j.column,j.lineNumber,j.column+1);if(j.column<=L||j.column>B)return;const U=this.currentBreakpointDecorations.find(({breakpoint:Q})=>Q.raw.line===W.startLineNumber&&Q.raw.column===W.startColumn);U?.inlineWidget||R.push({range:W,options:{description:"debug-breakpoint-placeholder",stickiness:_.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,beforeContentClassName:U?void 0:"debug-breakpoint-placeholder"},breakpoint:U?.breakpoint})})})),R}createCurrentBreakpointDecorations(){return this.breakpointManager.getBreakpoints(this._uri).filter(I=>(0,d.isDebugBreakpoint)(I)).map(I=>this.createCurrentBreakpointDecoration(I))}createCurrentBreakpointDecoration(D){const I=this.debugSessionManager.currentSession,O=D.status.get(I&&I.id||""),M=O&&O.line?O.line:D.raw.line,R=D.raw.column||0,P=this.editor.getModel(),k=P.getLineCount(),F=M>k?!1:R>P.getLineFirstNonWhitespaceColumn(M),L=new _.Range(M,R,M,R+1),{className:B,message:j}=this.decorator.getDecoration(D,!!I,this.breakpointManager.breakpointsEnabled),W=this.preferenceService.getValid("debug.breakpoint.showBreakpointsInOverviewRuler",!1);let U=null;return W&&(U={color:this.themeService.getColor({id:g.debugIconBreakpointForeground}),position:_.editor.OverviewRulerLane.Left}),{range:L,options:{description:"debug-breakpoint-placeholder",glyphMarginClassName:B,glyphMarginHoverMessage:j.map(Q=>({value:Q})),stickiness:A.STICKINESS,beforeContentClassName:F?"debug-breakpoint-placeholder":void 0,overviewRuler:U}}}updateBreakpointRanges(){this.breakpointRanges.clear();for(const D of this.breakpointDecorations){const I=this.editor.getModel().getDecorationRange(D);this.breakpointRanges.set(D,I)}}showHover(D){const I=D.target.type,O=m.isOSX?"metaKey":"ctrlKey";D.event.altKey||I===s.monacoBrowser.editor.MouseTargetType.CONTENT_WIDGET&&D.target.detail===this.debugHoverWidget.getId()&&!D.event[O]||(I===s.monacoBrowser.editor.MouseTargetType.CONTENT_TEXT?this.debugHoverWidget.show({selection:D.target.range,immediate:!1}):this.debugHoverWidget.hide({immediate:!1}))}hideHover({event:D}){const I=this.debugHoverWidget.getDomNode().getBoundingClientRect();(D.posx<I.left||D.posx>I.right||D.posy<I.top||D.posy>I.bottom)&&this.debugHoverWidget.hide({immediate:!1})}doToggleBreakpoint(D=this.position){const I=this.breakpointManager.getBreakpoints(this._uri,{lineNumber:D.lineNumber});if(I.length)for(const O of I)this.breakpointManager.delBreakpoint(O);else this.breakpointManager.addBreakpoint(d.DebugBreakpoint.create(this._uri,{line:D.lineNumber}))}get contributedContextMenu(){return this.menuService.createMenu(v.MenuId.DebugBreakpointsContext,this.contextKeyService)}onContextMenu(D){var I;if(this.marginFreeFromNonDebugDecorations((I=D.target.position)===null||I===void 0?void 0:I.lineNumber)&&D.target&&D.target.type===s.monacoBrowser.editor.MouseTargetType.GUTTER_GLYPH_MARGIN){const O=this.breakpointManager.getBreakpoint(this._uri,D.target.position.lineNumber);this.breakpointManager.selectedBreakpoint={breakpoint:O,model:this};const M=this.contributedContextMenu,R=(0,v.generateMergedCtxMenu)({menus:M});this.ctxMenuRenderer.show({anchor:D.event.browserEvent,menuNodes:R,args:[D.target.position]})}}marginFreeFromNonDebugDecorations(D){const I=this.editor.getLineDecorations(D);if(Array.isArray(I))for(const{options:O}of I){const M=O.glyphMarginClassName;if(M&&(M.includes("testing-run-glyph")||M.includes("interface-navigation-glyph")))return!1}return!0}onMouseDown(D){var I;this.marginFreeFromNonDebugDecorations((I=D.target.position)===null||I===void 0?void 0:I.lineNumber)&&(D.target&&D.target.type===s.monacoBrowser.editor.MouseTargetType.GUTTER_GLYPH_MARGIN&&(D.event.rightButton||(this.editor.focus(),this.toggleBreakpoint(D.target.position))),this.hintBreakpoint(D))}onMouseMove(D){var I;if(!this.marginFreeFromNonDebugDecorations((I=D.target.position)===null||I===void 0?void 0:I.lineNumber)){this.onMouseLeave(D);return}this.showHover(D),this.hintBreakpoint(D)}onMouseLeave(D){this.hideHover(D),this.deltaHintDecorations([])}hintBreakpoint(D){const I=this.createHintDecorations(D);this.deltaHintDecorations(I)}deltaHintDecorations(D){this.hintDecorations=this.deltaDecorations(this.hintDecorations,D)}createHintDecorations(D){if(D.target&&D.target.type===s.monacoBrowser.editor.MouseTargetType.GUTTER_GLYPH_MARGIN||D.target.type===s.monacoBrowser.editor.MouseTargetType.GUTTER_LINE_NUMBERS){const I=D.target.position.lineNumber;return this.breakpointManager.getBreakpoint(this._uri,I)?[]:[{range:new _.Range(I,1,I,1),options:A.BREAKPOINT_HINT_DECORATION}]}return[]}getBreakpoints(D,I){return this.breakpointManager.getBreakpoints(D,I)}getEditor(){return this.editor}getBreakpointWidget(){return this.breakpointWidget}getDebugHoverWidget(){return this.debugHoverWidget}};t.DebugModel=S,r.__decorate([(0,c.Autowired)(h.DebugEditor),r.__metadata("design:type",Object)],S.prototype,"editor",void 0),r.__decorate([(0,c.Autowired)(b.DebugBreakpointWidget),r.__metadata("design:type",b.DebugBreakpointWidget)],S.prototype,"breakpointWidget",void 0),r.__decorate([(0,c.Autowired)(y.DebugHoverWidget),r.__metadata("design:type",y.DebugHoverWidget)],S.prototype,"debugHoverWidget",void 0),r.__decorate([(0,c.Autowired)(u.IDebugSessionManager),r.__metadata("design:type",f.DebugSessionManager)],S.prototype,"debugSessionManager",void 0),r.__decorate([(0,c.Autowired)(a.DebugBreakpointsService),r.__metadata("design:type",a.DebugBreakpointsService)],S.prototype,"debugBreakpointsService",void 0),r.__decorate([(0,c.Autowired)(d.BreakpointManager),r.__metadata("design:type",d.BreakpointManager)],S.prototype,"breakpointManager",void 0),r.__decorate([(0,c.Autowired)(v.AbstractMenuService),r.__metadata("design:type",v.AbstractMenuService)],S.prototype,"menuService",void 0),r.__decorate([(0,c.Autowired)(p.IContextKeyService),r.__metadata("design:type",Object)],S.prototype,"contextKeyService",void 0),r.__decorate([(0,c.Autowired)(v.ICtxMenuRenderer),r.__metadata("design:type",v.ICtxMenuRenderer)],S.prototype,"ctxMenuRenderer",void 0),r.__decorate([(0,c.Autowired)(p.IReporterService),r.__metadata("design:type",Object)],S.prototype,"reporterService",void 0),r.__decorate([(0,c.Autowired)(p.PreferenceService),r.__metadata("design:type",Object)],S.prototype,"preferenceService",void 0),r.__decorate([(0,c.Autowired)(g.IThemeService),r.__metadata("design:type",Object)],S.prototype,"themeService",void 0),r.__decorate([m.memoize,r.__metadata("design:type",Object),r.__metadata("design:paramtypes",[])],S.prototype,"contributedContextMenu",null),t.DebugModel=S=n=r.__decorate([(0,c.Injectable)(),r.__metadata("design:paramtypes",[])],S);class w extends m.Disposable{constructor(D,I,O,M,R){super(),this.editor=D,this.decorationId=I,this.breakpoint=M,this.breakpointManager=R,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.range=this.editor.getModel().getDecorationRange(I),this.addDispose(this.editor.onDidChangeModelDecorations(()=>{const k=this.editor.getModel().getDecorationRange(this.decorationId);this.range&&!this.range.equalsRange(k)&&(this.range=k,this.editor.layoutContentWidget(this))})),this.addDispose(m.Disposable.create(()=>{this.editor.removeContentWidget(this)})),this.create(O),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(D){const I=document.createElement("div");I.className="inline-breakpoint-widget",D&&(0,p.addClassName)(I,D),this.domNode=I;const{EditorOption:O}=_.editor,M=()=>{const R=this.editor.getOption(O.lineHeight);I.style.height=`${R}px`,I.style.width=`${Math.ceil(.8*R)}px`,I.style.marginLeft="4px"};M(),this.addDispose(new p.DomListener(I,"click",async()=>{this.breakpoint?this.breakpointManager.delBreakpoint(this.breakpoint):this.breakpointManager.addBreakpoint(d.DebugBreakpoint.create(this.editor.getModel().uri,{line:this.range.startLineNumber,column:this.range.startColumn}))})),this.addDispose(this.editor.onDidChangeConfiguration(R=>{(R.hasChanged(O.fontSize)||R.hasChanged(O.lineHeight))&&M()}))}getId(){return(0,m.uuid)()}getDomNode(){return this.domNode}getPosition(){return this.range?(this.domNode.classList.toggle("line-start",this.range.startColumn===1),{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn-1},preference:[s.monacoBrowser.editor.ContentWidgetPositionPreference.EXACT]}):null}}r.__decorate([m.memoize,r.__metadata("design:type",Function),r.__metadata("design:paramtypes",[]),r.__metadata("design:returntype",void 0)],w.prototype,"getId",null)},78606:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugRunToCursorService=void 0;const n=e(85608),r=e(76003),o=e(54414),c=e(26296),p=e(66089),v=e(38029),m=e(97319);let _=class{constructor(){}async run(g,l=!1){const h=this.sessionManager.currentSession;if(!h||h.state!==c.DebugState.Stopped)return;const u=this.workbenchEditorService.currentEditor;if(u){if(!u.monacoEditor)return}else return;const{monacoEditor:d}=u,E=d.getPosition();if(!(d.hasModel()&&E))return;const f=h.getModel();if(!f)return;const a=!!f.getBreakpoints(g,{column:E.column,lineNumber:E.lineNumber}).length;let b,y=h.currentThread,A=[];if(!a){l&&(A=f.getBreakpoints().filter(T=>T.enabled).filter(T=>T.raw.column!==E.column&&T.raw.line!==E.lineNumber),A.forEach(T=>{this.debugBreakpointsService.toggleBreakpointEnable(T)}));const w=await this.addBreakpoints(g,E);if(!w){this.recoverStatus(A);return}w.thread&&(y=w.thread),w.breakpoint&&(b=w.breakpoint)}if(!y){this.recoverStatus(A);return}const S=y.session.onDidChangeState(()=>{const w=h.state;(w===c.DebugState.Stopped||w===c.DebugState.Inactive)&&(b&&h.delBreakpoint(b),S.dispose())});await y.continue(),this.recoverStatus(A)}async addBreakpoints(g,l){const h=this.sessionManager.currentSession;if(!h)return;let u=1;const d=h.currentFrame;d&&d.range().startLineNumber===l.lineNumber&&(u=l.column||1);const E=p.DebugBreakpoint.create(g,{line:l.lineNumber,column:u});if(await h.addBreakpoint(E,!0),!E)return{breakpoint:void 0,thread:h.currentThread};let f=h.currentThread,a=0;const b=h.threads.filter(y=>y.stopped);if(a<3&&h.currentThread&&b.includes(h.currentThread)&&(f=h.currentThread,a=3),a<2){const y=b.find(A=>A.topFrame);y&&(f=y,a=2)}return a<1&&(f=b[0],a=2),{thread:f,breakpoint:E}}recoverStatus(g){g.forEach(l=>{this.debugBreakpointsService.toggleBreakpointEnable(l)})}};t.DebugRunToCursorService=_,n.__decorate([(0,r.Autowired)(c.IDebugSessionManager),n.__metadata("design:type",v.DebugSessionManager)],_.prototype,"sessionManager",void 0),n.__decorate([(0,r.Autowired)(o.WorkbenchEditorService),n.__metadata("design:type",o.WorkbenchEditorService)],_.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(m.DebugBreakpointsService),n.__metadata("design:type",m.DebugBreakpointsService)],_.prototype,"debugBreakpointsService",void 0),t.DebugRunToCursorService=_=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],_)},26571:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BREAKPOINT_DECORATION_DISABLED=t.BREAKPOINT_DECORATION=t.BREAKPOINT_HINT_DECORATION=t.TOP_STACK_FRAME_INLINE_DECORATION=t.FOCUSED_STACK_FRAME_DECORATION=t.TOP_STACK_FRAME_EXCEPTION_DECORATION=t.FOCUS_BREAKPOINTS_STACK_FRAME_DECORATION=t.TOP_STACK_FRAME_DECORATION=t.FOCUSED_STACK_FRAME_MARGIN=t.TOP_STACK_FRAME_MARGIN=t.BREAK_PONINT_HOVER_MARGIN=t.STICKINESS=void 0;const r=e(85608).__importStar(e(20868));t.STICKINESS=r.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,t.BREAK_PONINT_HOVER_MARGIN={description:"debug-hover",glyphMarginClassName:"sumi-debug-hover",linesDecorationsClassName:"sumi-debug-hover",isWholeLine:!0},t.TOP_STACK_FRAME_MARGIN={description:"debug-top-stack-frame",glyphMarginClassName:"sumi-debug-top-stack-frame",stickiness:t.STICKINESS},t.FOCUSED_STACK_FRAME_MARGIN={description:"debug-focused-stack-frame",glyphMarginClassName:"sumi-debug-focused-stack-frame",stickiness:t.STICKINESS},t.TOP_STACK_FRAME_DECORATION={description:"debug-top-stack-frame-line",isWholeLine:!0,className:"sumi-debug-top-stack-frame-line",stickiness:t.STICKINESS},t.FOCUS_BREAKPOINTS_STACK_FRAME_DECORATION={description:"focus-breakpoints-stack-frame-line",isWholeLine:!0,className:"sumi-focus-breakpoints-stack-frame-line",stickiness:t.STICKINESS},t.TOP_STACK_FRAME_EXCEPTION_DECORATION={description:"debug-top-stack-frame-exception-line",isWholeLine:!0,className:"sumi-debug-top-stack-frame-exception-line",stickiness:t.STICKINESS},t.FOCUSED_STACK_FRAME_DECORATION={description:"debug-focused-stack-frame-line",isWholeLine:!0,className:"sumi-debug-focused-stack-frame-line",stickiness:t.STICKINESS},t.TOP_STACK_FRAME_INLINE_DECORATION={description:"debug-top-stack-frame-column",beforeContentClassName:"sumi-debug-top-stack-frame-column"},t.BREAKPOINT_HINT_DECORATION={description:"debug-breakpoint-hint",glyphMarginClassName:"sumi-debug-breakpoint-hint",stickiness:t.STICKINESS},t.BREAKPOINT_DECORATION={description:"debug-breakpoint",glyphMarginClassName:"sumi-debug-breakpoint",stickiness:t.STICKINESS},t.BREAKPOINT_DECORATION_DISABLED={description:"debug-breakpoint-disabled",glyphMarginClassName:"sumi-debug-breakpoint-disabled",stickiness:t.STICKINESS}},39266:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EvaluatableExpressionServiceImpl=t.IEvaluatableExpressionService=void 0;const n=e(85608),r=e(76003),o=e(40497),c=new o.LanguageFeatureRegistry;t.IEvaluatableExpressionService=Symbol("IEvaluatableExpressionService");let p=class{getSupportedEvaluatableExpressionProvider(m){return c.ordered(m)}registerEvaluatableExpressionProvider(m,_){return c.register(m,_)}hasEvaluatableExpressProvider(m){return c.has(m)}};t.EvaluatableExpressionServiceImpl=p,t.EvaluatableExpressionServiceImpl=p=n.__decorate([(0,r.Injectable)()],p)},75935:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(17475),t),n.__exportStar(e(65960),t),n.__exportStar(e(91260),t),n.__exportStar(e(71569),t),n.__exportStar(e(26571),t),n.__exportStar(e(74257),t)},33969:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugModule=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(91825),p=e(64582),v=e(99797),m=e(3005),_=e(37499),s=e(59053),g=e(31141),l=e(40453),h=e(90408),u=e(97186),d=e(38029),E=e(75935),f=e(23217),a=e(39266),b=e(23434),y=e(52369),A=e(44888),S=e(84784),w=e(15153),T=e(11456),D=e(37243),I=e(86752),O=e(14600);e(51377);let M=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:f.DebugHoverSource,useClass:f.DebugHoverSource},{token:E.DebugExpressionProvider,useClass:E.DebugExpressionProvider},{token:p.IDebugModelManager,useClass:E.DebugModelManager},{token:p.IDebugSessionManager,useClass:d.DebugSessionManager},{token:v.BreakpointManager,useClass:v.BreakpointManager},{token:_.DebugConfigurationManager,useClass:_.DebugConfigurationManager},{token:a.IEvaluatableExpressionService,useClass:a.EvaluatableExpressionServiceImpl},{token:c.FolderFilePreferenceProvider,useClass:b.LaunchFolderPreferenceProvider,dropdownForTag:!0,tag:"launch"},{token:p.DebugModelFactory,useFactory:P=>k=>E.DebugModel.createModel(P,k)},{token:u.DebugSessionContributionRegistry,useClass:u.DebugSessionContributionRegistryImpl},{token:p.IDebugService,useClass:h.DebugService},{token:p.ILaunchService,useClass:A.LaunchService},{token:p.IDebugProgress,useClass:l.DebugProgressService},{token:p.IDebugConsoleModelService,useClass:w.DebugConsoleModelService},y.LaunchPreferencesContribution,s.DebugContribution,T.DebugConsoleContribution,I.VariablesPanelContribution,D.DebugCallStackContribution,O.WatchPanelContribution,{token:m.DebugCallStackItemTypeKey,useFactory:P=>P.get(o.IContextKeyService).createKey("callStackItemType")}],this.contributionProvider=u.DebugSessionContribution,this.preferences=g.injectDebugPreferences,this.isOverlay=!0,this.component=S.DebugToolbarOverlayWidget}};t.DebugModule=M,t.DebugModule=M=n.__decorate([(0,r.Injectable)()],M)},39553:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(35721),t),n.__exportStar(e(20391),t)},35721:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MarkerManager=t.MarkerCollection=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(14951);class p{constructor(_,s){this.uri=_,this.kind=s,this.owner2Markers=new Map}get empty(){return!this.owner2Markers.size}getOwners(){return Array.from(this.owner2Markers.keys())}getMarkers(_){return this.owner2Markers.get(_)||[]}setMarkers(_,s){const g=this.owner2Markers.get(_);return s.length>0?this.owner2Markers.set(_,s.map(l=>this.createMarker(_,l))):this.owner2Markers.delete(_),g||[]}createMarker(_,s){return Object.freeze({uri:this.uri.toString(),kind:this.kind,owner:_,data:s})}findMarkers(_){if(_.owner)return this.owner2Markers.has(_.owner)?this.filterMarkers(_,this.owner2Markers.get(_.owner)):[];{const s=[];for(const g of this.owner2Markers.values())s.push(...this.filterMarkers(_,g));return s}}filterMarkers(_,s){return s?_.dataFilter?s.filter(g=>_.dataFilter(g.data)):s:[]}}t.MarkerCollection=p;let v=class{constructor(){this.uri2MarkerCollection=new Map,this.onDidChangeMarkersEmitter=new o.Emitter,this.init()}init(){this.fileService.onFilesChanged(_=>{const s=_.filter(({type:g})=>g===c.FileChangeType.DELETED);s.length&&this.cleanMarkers(s)})}cleanMarkers(_){for(const s of this.uri2MarkerCollection.keys()){const g=new o.URI(s);c.FileChangeEvent.isDeleted(_,g)&&this.cleanAllMarkers(g)}}get onDidChangeMarkers(){return this.onDidChangeMarkersEmitter.event}fireOnDidChangeMarkers(_){this.onDidChangeMarkersEmitter.fire(_)}setMarkers(_,s,g){const l=_.toString(),h=this.uri2MarkerCollection.get(l)||new p(_,this.getKind()),u=h.setMarkers(s,g);return h.empty?this.uri2MarkerCollection.delete(_.toString()):this.uri2MarkerCollection.set(l,h),this.fireOnDidChangeMarkers(_),u}findMarkers(_={}){if(_.uri){const g=this.uri2MarkerCollection.get(_.uri.toString());return g?g.findMarkers(_):[]}const s=[];for(const g of this.getUris())s.push(...this.uri2MarkerCollection.get(g).findMarkers(_));return s}getUris(){return this.uri2MarkerCollection.keys()}cleanAllMarkers(_){if(_)this.doCleanAllMarkers(_);else for(const s of this.getUris())this.doCleanAllMarkers(new o.URI(s))}doCleanAllMarkers(_){const s=_.toString();this.uri2MarkerCollection.get(s)!==void 0&&(this.uri2MarkerCollection.delete(s),this.fireOnDidChangeMarkers(_))}};t.MarkerManager=v,n.__decorate([(0,r.Autowired)(c.IFileServiceClient),n.__metadata("design:type",Object)],v.prototype,"fileService",void 0),t.MarkerManager=v=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],v)},20391:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},88776:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugSource=t.DebugSourceData=void 0;const n=e(41869);class r{}t.DebugSourceData=r;class o extends r{constructor(p,v,m,_,s){super(),this.session=p,this.labelProvider=v,this.modelManager=m,this.workbenchEditorService=_,this.fileSystem=s}get uri(){return o.toUri(this.raw)}get available(){return!!this.raw}get presentationHint(){return this.raw.presentationHint}update(p){Object.assign(this,p)}async open(p,v){if(this.uri.scheme===o.SCHEME){const m=await this.load();await this.fileSystem.setContent({uri:this.uri.toString(),lastModification:0},m)}if(v&&v.raw){const{line:m,column:_}=v.raw,s={startLineNumber:m,startColumn:typeof _=="number"?_:0,endLineNumber:m,endColumn:1/0};await this.workbenchEditorService.open(this.uri,{...p,range:s}),v.thread.currentFrame=v;const g=this.modelManager.resolve(this.uri);if(g)for(const l of g)l.focusStackFrame()}else await this.workbenchEditorService.open(this.uri,p)}async load(){const p=this.raw,v=p.sourceReference;return(await this.session.sendRequest("source",{sourceReference:v,source:p})).body.content}get inMemory(){return this.uri.scheme===o.SCHEME}get reference(){return this.raw.sourceReference}get name(){return this.inMemory?this.raw.name||this.uri.path.base||this.uri.path.toString():this.labelProvider.getName(this.uri)}get longName(){return this.inMemory?this.name:this.labelProvider.getLongName(this.uri)}static toUri(p){if(p.sourceReference&&p.sourceReference>0)return new n.URI().withScheme(o.SCHEME).withPath(p.name).withQuery(String(p.sourceReference));if(!p.path)throw new Error("Unrecognized source type: "+JSON.stringify(p));return p.path.match(o.SCHEME_PATTERN)?new n.URI(p.path):new n.URI(n.Uri.file(p.path))}}t.DebugSource=o,o.SCHEME="debug",o.SCHEME_PATTERN=/^[a-zA-Z][a-zA-Z0-9\+\-\.]+:/},44485:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShowMoreDebugStackFrame=t.DebugStackFrame=t.DebugStackFrameData=void 0;const n=e(41869),r=e(44781),o=e(98650);class c{}t.DebugStackFrameData=c;class p extends c{static is(_){return!!_&&"raw"in _}constructor(_,s){super(),this.thread=_,this.session=s}get id(){return this.session.id+":"+this.thread.id+":"+this.raw.id}get source(){return this._source}update(_){Object.assign(this,_),this._source=this.raw.source&&this.session.getSource(this.raw.source)}async restart(){return this.session.capabilities.supportsRestartFrame?await this.session.sendRequest("restartFrame",{frameId:this.raw.id}):Promise.reject(new Error("restartFrame not supported"))}get canRestart(){return typeof this.raw.canRestart=="boolean"?this.raw.canRestart:!0}async open(_){if(!this.source)return;const{line:s,column:g,endLine:l,endColumn:h}=this.raw;let u={startLineNumber:s,startColumn:g,endLineNumber:s,endColumn:1/0};typeof l=="number"&&(u={...u,endLineNumber:l,endColumn:typeof h=="number"?h:1/0}),this.source.open({..._,range:u})}toArgs(_){return Object.assign({},_,{frameId:this.raw.id})}getScopes(_){return this.doGetScopes(_)}async doGetScopes(_){try{return(await this.session.sendRequest("scopes",this.toArgs())).body.scopes.map(g=>new o.DebugScope(g,this.session,_))}catch{return[]}}range(){const _=this.raw;return new r.Range(_.line,_.column,_.endLine||_.line,_.endColumn||_.column)}async getMostSpecificScopes(_){const g=(await this.doGetScopes()).filter(u=>!u.getRawScope().expensive);if(!g.some(u=>!!u.range()))return g;const h=g.filter(u=>u.range()&&r.Range.containsRange(u.range(),_)).sort((u,d)=>u.range().endLineNumber-u.range().startLineNumber-(d.range().endLineNumber-d.range().startLineNumber));return h.length?h:g}}t.DebugStackFrame=p;class v{constructor(_,s,g,l,h){this.nextFrame=_,this.frames=s,this.session=g,this.origin=l,this._open=h,this.open=()=>{this._open(this)}}get name(){return(0,n.formatLocalize)("debug.stack.showMoreAndOrigin",this.frames.length,this.origin)}get id(){var _;return`${this.session.id}:showMore:${(_=this.nextFrame)===null||_===void 0?void 0:_.id}`}}t.ShowMoreDebugStackFrame=v},7885:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugThread=t.DebugThreadData=void 0;const n=e(41869),r=e(64582),o=e(44485);class c{}t.DebugThreadData=c;class p extends c{constructor(m){super(),this.session=m,this._onDidChanged=new n.Emitter,this.onDidChanged=this._onDidChanged.event,this._frames=new Map,this.pendingFetch=Promise.resolve([])}get id(){return this.session.id+":"+this.raw.id}get threadId(){return this.raw.id}get currentFrame(){return this._currentFrame}set currentFrame(m){this._currentFrame=m,this._onDidChanged.fire()}get stopped(){return!!this.stoppedDetails}update(m){Object.assign(this,m),"stoppedDetails"in m&&this.clearFrames()}clear(){this.update({raw:this.raw,stoppedDetails:void 0})}continue(){return this.session.sendRequest("continue",this.toArgs())}stepOver(){return this.session.sendRequest("next",this.toArgs())}stepIn(){return this.session.sendRequest("stepIn",this.toArgs())}stepOut(){return this.session.sendRequest("stepOut",this.toArgs())}pause(){return this.session.sendRequest("pause",this.toArgs())}terminate(){return this.session.sendRequest("terminateThreads",{threadIds:[this.raw.id]})}get frames(){return Array.from(this._frames.values())}get topFrame(){return this.frames[0]}get frameCount(){return this._frames.size}async rawFetchFrames(m=20){return this.pendingFetch=this.pendingFetch.then(async()=>{try{const _=this.frameCount,s=await this.doFetchFrames(_,m);return this.doUpdateFrames(s)}catch{return[]}})}async fetchExceptionInfo(){var m;try{if(((m=this.stoppedDetails)===null||m===void 0?void 0:m.reason)==="exception"&&this.session.capabilities.supportsExceptionInfoRequest){const _=await this.session.exceptionInfo(this.toArgs());if(_)return{id:_.body.exceptionId,description:_.body.description,breakMode:_.body.breakMode,details:_.body.details}}}catch{return}}async fetchFrames(m=20){const _=await this.rawFetchFrames(m);return this.updateCurrentFrame(),_}async doFetchFrames(m,_){try{const s=await this.session.sendRequest("stackTrace",this.toArgs({startFrame:m,levels:_}));return this.stoppedDetails&&(this.stoppedDetails.totalFrames=s.body.totalFrames),s.body.stackFrames}catch(s){return this.stoppedDetails&&(this.stoppedDetails.framesErrorMessage=s.message),[]}}doUpdateFrames(m){const _=this.session.reportTime(r.DEBUG_REPORT_NAME.DEBUG_UI_FRONTEND_TIME,{sessionId:this.session.id,threadId:this.raw.id,threadAmount:this.session.threadCount}),s=new Map(this._frames);for(const l of m){const h=l.id;if(!this._frames.has(h)){const u=new o.DebugStackFrame(this,this.session);this._frames.set(h,u),u.update({raw:l}),s.set(h,u)}}const g=[...s.values()];return _("doUpdateFrames"),g}clearFrames(){this._frames.clear(),this.updateCurrentFrame()}updateCurrentFrame(){const{currentFrame:m}=this,_=m&&m.raw.id;this.currentFrame=typeof _=="number"&&this._frames.get(_)||this._frames.values().next().value}toArgs(m){return Object.assign({},m,{threadId:this.raw.id})}}t.DebugThread=p},14190:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugWatch=t.IDebugWatchData=void 0;const r=e(85608).__importDefault(e(97331)),o=e(41869),c=e(64582),p=e(98650);t.IDebugWatchData=Symbol("IDebugWatchData");class v{constructor(_,s){this.manager=_,this.reporterService=s,this.toDispose=new o.DisposableCollection,this.fireDidChange=(0,r.default)(()=>this.onDidChangeEmitter.fire(),50),this.fireVariableChange=(0,r.default)(()=>this.onDidVariableChangeEmitter.fire(),50),this.fireExpressionChange=(0,r.default)(g=>this.onDidExExpressionChangeEmitter.fire(g),50),this._expressions=[],this.onDidChangeEmitter=new o.Emitter,this.onDidVariableChangeEmitter=new o.Emitter,this.onDidExExpressionChangeEmitter=new o.Emitter,this.whenReady=this.init()}get onDidChange(){return this.onDidChangeEmitter.event}get onDidVariableChange(){return this.onDidVariableChangeEmitter.event}get onDidExpressionChange(){return this.onDidExExpressionChangeEmitter.event}async getRoot(){const _=[],s=new p.DebugWatchRoot(this.manager.currentSession);for(const g of this._expressions){const l=new p.DebugWatchNode(this.manager.currentSession,g,s);await l.evaluate(),_.push(l)}return s.updatePresetChildren(_),this._root=s,this._root}async init(){this.toDispose.push(this.manager.onDidStopDebugSession(()=>{this.fireDidChange()})),this.toDispose.push(this.manager.onDidDestroyDebugSession(()=>{this.fireDidChange()})),this.toDispose.push(this.manager.onDidChangeActiveDebugSession(()=>{const _=this.manager.currentSession;_&&(_.onVariableChange(()=>{this.fireVariableChange()}),_.onDidChangeCallStack(()=>{this.fireVariableChange()}))}))}async clear(){this.updateWatchExpressions([]),this.fireExpressionChange([]),this.fireDidChange()}async updateWatchExpressions(_){this._expressions=_}addWatchExpression(_){this.reporterService.point(c.DEBUG_REPORT_NAME===null||c.DEBUG_REPORT_NAME===void 0?void 0:c.DEBUG_REPORT_NAME.DEBUG_WATCH,c.DEBUG_COMMANDS.ADD_WATCHER.id,{value:_}),this._expressions.indexOf(_)===-1&&(this._expressions.push(_),this.fireExpressionChange(this._expressions))}renameWatchExpression(_,s){const g=this._expressions.indexOf(_);g>=0&&this._expressions.splice(g,1,s),this.fireExpressionChange(this._expressions)}removeWatchExpression(_){const s=this._expressions.indexOf(_);s>=0&&this._expressions.splice(s,1),this.fireExpressionChange(this._expressions)}}t.DebugWatch=v},50755:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(88776),t),n.__exportStar(e(44485),t),n.__exportStar(e(7885),t),n.__exportStar(e(14190),t)},53741:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CheckboxWidget=void 0;const n=e(85608),r=e(51632),o=n.__importDefault(e(14041)),c=e(97267),p=n.__importDefault(e(93089)),v=m=>{var _,s;const{disabled:g,formContext:l,id:h,label:u,hideLabel:d,onBlur:E,onChange:f,onFocus:a,readonly:b,value:y,registry:A,options:S,schema:w,uiSchema:T}=m,{readonlyAsDisabled:D=!0}=l,I=(0,r.getTemplate)("DescriptionFieldTemplate",A,S),O=({target:F})=>f(F.checked),P={onBlur:b?void 0:({target:F})=>E(h,F.checked),onFocus:b?void 0:({target:F})=>a(h,F.checked)},k=(s=(_=S.description)!==null&&_!==void 0?_:w.description)!==null&&s!==void 0?s:w.markdownDescription;return o.default.createElement("div",{className:p.default.checkbox_widget_control},!d&&o.default.createElement("label",{title:u,className:p.default.field_label},u),o.default.createElement(c.CheckBox,{checked:typeof y>"u"?!1:y,disabled:g||D&&b,id:h,name:h,onChange:b?void 0:O,...P,"aria-describedby":(0,r.ariaDescribedByIds)(h),label:k,className:p.default.checkbox}))};t.CheckboxWidget=v},93306:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnyOfField=void 0;const n=e(85608),r=e(51632),o=n.__importDefault(e(14041)),c=e(97267),p=n.__importDefault(e(93089)),v=m=>{var _,s;const{disabled:g,formContext:l,idSchema:h,onBlur:u,id:d,onChange:E,onFocus:f,options:a,placeholder:b,readonly:y,registry:A,name:S,required:w,schema:T,uiOptions:D}=m,{readonlyAsDisabled:I=!0}=l,O=({target:L})=>E(L.value===""?a.emptyValue:L.value),M=({target:L})=>u(d,L.value),R=({target:L})=>f(d,L.value),P=(s=(_=a.description)!==null&&_!==void 0?_:T.description)!==null&&s!==void 0?s:T.markdownDescription,k=(0,r.getTemplate)("TitleFieldTemplate",A,D),F=(0,r.getTemplate)("DescriptionFieldTemplate",A,D);return o.default.createElement("div",{className:p.default.any_of_widget_control},S&&o.default.createElement("div",{className:p.default.object_title},o.default.createElement(k,{id:(0,r.titleId)(h),title:S,required:w,schema:T,registry:A})),P&&o.default.createElement("div",{className:p.default.object_description},o.default.createElement(F,{id:(0,r.descriptionId)(h),description:P,schema:T,registry:A})),o.default.createElement(c.Input,{disabled:g||I&&y,onBlur:y?void 0:M,onChange:y?void 0:O,onFocus:y?void 0:R,placeholder:b,autoComplete:"off"}))};t.AnyOfField=v},32475:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayField=void 0;const n=e(85608),r=e(67030),o=n.__importStar(e(14041)),c=e(43718),p=(0,r.getDefaultRegistry)().fields.ArrayField,v=m=>{const{onChange:_}=m,s=(0,o.useCallback)(g=>{Array.isArray(g)&&_(g.map(l=>(0,c.isUndefined)(l)?"":l))},[_]);return o.default.createElement(p,{...m,onChange:s})};t.ArrayField=v},59299:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectField=void 0;const n=e(85608),r=e(67030),o=n.__importStar(e(14041)),c=e(41869),p=e(43718),v=e(64582),m=(0,r.getDefaultRegistry)().fields.ObjectField,_=s=>{const g=(0,c.useInjectable)(v.ILaunchService),{idSchema:l,onChange:h}=s;return(0,o.useEffect)(()=>{const{$id:u}=l,d=new p.Disposable;return u==="root"&&d.addDispose(g.onChangeFormData(E=>h(E))),()=>d.dispose()},[l]),o.default.createElement(m,{...s})};t.ObjectField=_},66216:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TitleField=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=n.__importDefault(e(93089)),c=p=>{const{title:v}=p;return v?r.default.createElement("label",{title:v,className:o.default.field_label},v):null};t.TitleField=c},81638:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelectWidget=void 0;const n=e(85608),r=e(51632),o=n.__importStar(e(14041)),c=e(97267),p=n.__importDefault(e(93089)),v=m=>{const{schema:_,value:s,id:g,registry:l,uiOptions:h,name:u,required:d,onChange:E}=m,f=_.description,a=(0,r.getTemplate)("TitleFieldTemplate",l,h),b=(0,r.getTemplate)("DescriptionFieldTemplate",l,h),y=(0,o.useMemo)(()=>_&&_.enum?_.enum:[],[_,_.enum]);return o.default.createElement("div",{className:p.default.select_widget_control},u&&o.default.createElement("div",{className:p.default.object_title},o.default.createElement(a,{id:(0,r.titleId)(g),title:u,required:d,schema:_,registry:l})),f&&o.default.createElement("div",{className:p.default.object_description},o.default.createElement(b,{id:(0,r.descriptionId)(g),description:f,schema:_,registry:l})),o.default.createElement(c.Select,{key:g,value:s,dropdownRenderType:"absolute",onChange:E},y.map(A=>o.default.createElement(c.Option,{value:A,label:A,key:A},A))))};t.SelectWidget=v},20023:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextWidget=void 0;const n=e(85608),r=e(51632),o=n.__importStar(e(14041)),c=e(97267),p=e(64582),v=e(5905),m=n.__importDefault(e(93089)),_=s=>{const{disabled:g,formContext:l,id:h,onBlur:u,onChange:d,onFocus:E,options:f,placeholder:a,readonly:b,schema:y,value:A,registry:S,label:w,hideLabel:T,required:D,uiSchema:I,uiOptions:O}=s,{readonlyAsDisabled:M=!0}=l,R=(0,r.getTemplate)("TitleFieldTemplate",S,O),P=(0,r.getTemplate)("DescriptionFieldTemplate",S,O),k=(0,o.useMemo)(()=>typeof A!="string"?A:(0,v.parseSnippet)(A),[A]),F=({target:W})=>{d(W.value===""?f.emptyValue:W.value),u(h,W.value)},L=({target:W})=>E(h,W.value),B=(0,o.useMemo)(()=>y.type!==p.JSON_SCHEMA_TYPE.STRING&&y.type!==p.JSON_SCHEMA_TYPE.NUMBER?p.JSON_SCHEMA_TYPE.STRING:y.type,[y,y.type]),j=(0,o.useMemo)(()=>y.description||"",[y,y.description]);return o.default.createElement("div",null,!T&&w&&o.default.createElement("div",{className:m.default.object_title},o.default.createElement(R,{id:(0,r.titleId)(h),title:w,required:D,schema:y,uiSchema:I,registry:S})),j&&o.default.createElement("div",{className:m.default.object_description},o.default.createElement(P,{id:(0,r.descriptionId)(h),description:j,schema:y,uiSchema:I,registry:S})),o.default.createElement(c.Input,{disabled:g||M&&b,id:h,name:h,onBlur:b?void 0:F,onFocus:b?void 0:L,placeholder:a,type:B,value:k,className:m.default.text_widget_control,autoComplete:"off"}))};t.TextWidget=_},23434:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LaunchFolderPreferenceProvider=void 0;const n=e(85608),r=e(76003),o=e(91825);let c=class extends o.FolderFilePreferenceProvider{parse(v){const m=super.parse(v);if(m!==void 0)return{launch:{...m}}}getPath(v){if(v==="launch")return[];if(v.startsWith("launch."))return[v.substr(7)]}};t.LaunchFolderPreferenceProvider=c,t.LaunchFolderPreferenceProvider=c=n.__decorate([(0,r.Injectable)()],c)},52369:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LaunchPreferencesContribution=t.LaunchResourceProvider=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(64102),p=e(39496),v=e(57517),m=e(4983),_=e(10938),s=e(67858);let g=class{constructor(){this.scheme=m.LAUNCH_VIEW_SCHEME}provideResource(u){return{supportsRevive:!0,name:(0,o.localize)("menu-bar.title.debug"),icon:(0,o.getIcon)("debug"),uri:u}}provideResourceSubname(){return null}async shouldCloseResource(){return!0}};t.LaunchResourceProvider=g,t.LaunchResourceProvider=g=n.__decorate([(0,r.Injectable)()],g);let l=class{constructor(){this.schema=_.launchPreferencesSchema,this.name="launch"}registerResource(u){u.registerResourceProvider(this.prefResourceProvider)}registerEditorComponent(u){u.registerEditorComponent({component:s.LaunchViewContainer,uid:m.LAUNCH_VIEW_COMPONENT_ID,scheme:m.LAUNCH_VIEW_SCHEME}),u.registerEditorComponentResolver(m.LAUNCH_VIEW_SCHEME,(d,E,f)=>{f([{type:v.EditorOpenType.component,componentId:m.LAUNCH_VIEW_COMPONENT_ID}])})}registerMenus(u){u.registerMenuItem(p.MenuId.EditorTitle,{command:o.COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION.id,iconClass:(0,o.getIcon)("open"),group:"navigation",when:`resourceScheme == ${m.LAUNCH_VIEW_SCHEME}`})}};t.LaunchPreferencesContribution=l,n.__decorate([(0,r.Autowired)(g),n.__metadata("design:type",g)],l.prototype,"prefResourceProvider",void 0),t.LaunchPreferencesContribution=l=n.__decorate([(0,o.Domain)(o.PreferenceContribution,o.PreferenceConfiguration,v.BrowserEditorContribution,c.MenuContribution)],l)},10938:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.launchPreferencesSchema=void 0;const n=e(64582);t.launchPreferencesSchema={type:"object",scope:"resource",properties:{launch:{$ref:n.launchSchemaUri,description:"Global debug launch configuration. Should be used as an alternative to 'launch.json' that is shared across workspaces",defaultValue:{configurations:[],compounds:[]}}}}},44888:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LaunchService=void 0;const n=e(85608),r=n.__importStar(e(23304)),o=n.__importDefault(e(41263)),c=e(76003),p=e(41869),v=e(43718),m=e(14951),_=e(64582),s="configurations";let g=class{constructor(){this._onRawSchemaProperties=new v.Emitter,this.onRawSchemaProperties=this._onRawSchemaProperties.event,this._onChangeSchema=new v.Emitter,this.onChangeSchema=this._onChangeSchema.event,this._onChangeFormData=new v.Emitter,this.onChangeFormData=this._onChangeFormData.event}get rawSchemaProperties(){return this._rawSchemaProperties}get schema(){return this._schema}get formData(){return this._formData}async openLaunchConfiguration(){await this.commandService.executeCommand(p.COMMON_COMMANDS.OPEN_LAUNCH_CONFIGURATION.id)}setRawSchemaProperties(h){this._rawSchemaProperties=h,this._onRawSchemaProperties.fire(h)}nextNewSchema(h){this._schema=h,this._onChangeSchema.fire(h)}nextNewFormData(h,u=!0){this._formData=h,u&&this._onChangeFormData.fire(h)}addNewItem(h){if(h==="")return;const{properties:u}=this.rawSchemaProperties,d={...this.formData},E=u[h],{default:f,type:a}=E;(0,o.default)(d,h,f||this.getDefaultValue(a)),(0,o.default)(this.schema.properties,h,E),this.nextNewSchema(this.schema),this.nextNewFormData(d)}delItem(h){if(h==="")return;const{properties:u}=this.schema,d={...this.formData};delete d[h],delete u[h],this.nextNewSchema(this.schema),this.nextNewFormData(d)}getDefaultValue(h){switch(h){case _.JSON_SCHEMA_TYPE.ARRAY:return[];case _.JSON_SCHEMA_TYPE.BOOLEAN:return!1;case _.JSON_SCHEMA_TYPE.NULL:return null;case _.JSON_SCHEMA_TYPE.NUMBER:return 0;case _.JSON_SCHEMA_TYPE.OBJECT:return{};case _.JSON_SCHEMA_TYPE.STRING:default:return""}}async readResourceContent(h){try{const{content:u}=await this.fileSystem.readFile(h.toString());return u.toString()}catch{return""}}async modifyConfigurationsInResource(h,u,d){const E=await this.fileSystem.getFileStat(h.toString());if(E&&E.type===v.FileType.File){const{formData:f}=u,a=await this.readResourceContent(h),y=r.parse(a)[s];if(!y)return;Array.isArray(y)&&y.length-1>=d&&y.splice(d,1,f);const A=r.modify(a,[s],y,{isArrayInsertion:!1,formattingOptions:{tabSize:2,insertSpaces:!0,eol:`
|
|
31519
31519
|
`}}),S=r.applyEdits(a,A);await this.fileSystem.setContent(E,S)}}};t.LaunchService=g,n.__decorate([(0,c.Autowired)(m.IFileServiceClient),n.__metadata("design:type",Object)],g.prototype,"fileSystem",void 0),n.__decorate([(0,c.Autowired)(v.CommandService),n.__metadata("design:type",Object)],g.prototype,"commandService",void 0),t.LaunchService=g=n.__decorate([(0,c.Injectable)()],g)},67858:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LaunchViewContainer=void 0;const n=e(85608),r=e(67030),o=n.__importDefault(e(17932)),c=n.__importDefault(e(53373)),p=n.__importDefault(e(46123)),v=n.__importDefault(e(97331)),m=n.__importStar(e(14041)),_=n.__importDefault(e(19686)),s=e(97267),g=e(41869),l=e(81878),h=e(25918),u=e(1237),d=e(85084),E=e(53670),f=e(60709),a=e(70159),b=e(37499),y=e(5905),A=e(53741),S=e(93306),w=e(32475),T=e(59299),D=e(66216),I=e(81638),O=e(20023),M=n.__importDefault(e(52402)),R=e(24650),P=e(77874),k=e(27953),F=e(44115),L=e(51773),B=e(67481),j=e(5062),W=e(74447),U=e(56551),Q=({resource:z})=>{const{uri:H}=z,K=(0,g.useInjectable)(g.IJSONSchemaRegistry),Z=(0,g.useInjectable)(b.DebugConfigurationManager),X=(0,g.useInjectable)(a.ILaunchService),ie=(0,g.useInjectable)(g.CommandService),[oe,le]=(0,m.useState)(0),[pe,q]=(0,m.useState)(),[Ee,_e]=(0,m.useState)([]);(0,m.useEffect)(()=>{const Re=new g.Disposable;return Re.addDispose(K.onDidChangeSchema(Be=>{Be===f.launchExtensionSchemaUri&&ge(K.getSchemaContributions())})),Re.addDispose(Z.onDidChange(async()=>{Te()})),ge(K.getSchemaContributions()),Te(),()=>Re.dispose()},[]);const te=(0,m.useMemo)(()=>H.withScheme(g.Schemes.file),[H]),ge=(0,m.useCallback)(Re=>{const Be=Re.schemas[f.launchExtensionSchemaUri];Be&&q(Be)},[pe]),Te=(0,m.useCallback)(()=>{const Re=Z.all;Array.isArray(Re)&&_e(Re.map(Be=>new R.ConfigurationItemsModel(Be.configuration.name,Be.configuration)))},[]),Pe=(0,m.useMemo)(()=>pe?(0,p.default)(pe,["properties","configurations","items","defaultSnippets"])||[]:[],[pe]),Ae=(0,m.useCallback)((Re,Be)=>{const{configuration:me}=Re;me&&le(Be)},[]),we=(0,m.useMemo)(()=>{if(Ee&&!(0,g.isUndefined)(oe)){const Re=Ee[oe];if(!Re)return;const{configuration:Be,description:me,label:re}=Re;return Be?{body:Be,description:me,label:re}:void 0}},[Ee,oe]),be=(0,m.useCallback)(async Re=>{const{configuration:Be}=Re;await Z.insertConfiguration(te,Be),ie.executeCommand(g.EDITOR_COMMANDS.SAVE_URI.id,te)},[Pe]),fe=(0,v.default)(async(Re,Be)=>await X.modifyConfigurationsInResource(te,Re,Be),100),xe=(0,m.useCallback)(async Re=>{const{formData:Be}=Re;!Be||(0,g.isUndefined)(oe)||fe(Re,oe)},[oe,we]);return m.default.createElement(s.ComponentContextProvider,{value:{getIcon:g.getIcon,localize:g.localize}},m.default.createElement("div",{className:M.default.launch_container},m.default.createElement(l.SplitPanel,{id:"launch-container",resizeHandleClassName:M.default.devider,className:M.default.launch_panel,direction:"left-to-right"},m.default.createElement(V,{"data-sp-defaultSize":240,"data-sp-minSize":150,inputConfigurationItems:Ee,snippetItems:Pe,onSelectedConfiguration:Ae,onAddConfigurationItems:be,currentConfigurationIndex:oe}),m.default.createElement(Y,{"data-sp-flex":1,snippetItem:we,schemaContributions:pe,onChange:xe}))))};t.LaunchViewContainer=Q;const V=({snippetItems:z,onSelectedConfiguration:H,onAddConfigurationItems:K,inputConfigurationItems:Z,currentConfigurationIndex:X})=>{const ie=(0,g.useInjectable)(a.ILaunchService),[oe,le]=m.default.useState(!1),[pe,q]=(0,m.useState)(Z);(0,m.useEffect)(()=>{if(pe.length===0&&(0,g.isUndefined)(X))return;const Pe=pe[X];Pe&&Pe.configuration&&ie.nextNewFormData(Pe.configuration,!1)},[X,pe]),(0,m.useEffect)(()=>{q([...Z])},[Z]);const Ee=(0,m.useCallback)((Pe,Ae)=>{H(Pe,Ae)},[]),_e=({data:Pe,index:Ae})=>m.default.createElement("div",{key:Ae,className:(0,c.default)(M.default.configuration_item,X===Ae?M.default.selected:""),onClick:()=>Ee(Pe,Ae)},m.default.createElement("div",{className:M.default.configuration_wrapper},m.default.createElement("span",{className:M.default.configuration_description},Pe.label))),te=(0,m.useCallback)(Pe=>{le(!1);const{label:Ae}=Pe,we=z.find(Re=>Re.label===Ae);if(!we)return;const{body:be}=we;if(!(0,g.isObject)(be))return;const fe=Object.keys(be).reduce((Re,Be)=>{const me=be[Be];return typeof me=="string"?Re[Be]=(0,y.parseSnippet)(me):Array.isArray(me)&&(Re[Be]=me.map(re=>typeof re=="string"?(0,y.parseSnippet)(re):re)),Re},be),xe=new R.ConfigurationItemsModel(we.label,fe);xe.setDescription(we.description||""),K(xe)},[pe,z]),ge=Pe=>{le(Pe)},Te=(0,m.useMemo)(()=>m.default.createElement(h.MenuActionList,{data:z.map(Pe=>new u.LabelMenuItemNode(Pe.label)),afterClick:Pe=>te(Pe)}),[z,pe]);return m.default.createElement("div",{className:M.default.launch_indexes_container},m.default.createElement(_.default,{className:M.default.configuration_items_box},({width:Pe,height:Ae})=>pe.length===0?m.default.createElement("div",{style:{width:Pe},className:M.default.not_configuration_content},(0,g.localize)("debug.action.no.configuration")):m.default.createElement(s.RecycleList,{width:Pe,height:Ae,data:pe,template:_e})),m.default.createElement("div",{className:M.default.foot_box},m.default.createElement(s.Button,{className:M.default.button,placement:"topCenter",menu:Te,moreVisible:oe,onVisibleChange:ge},(0,g.localize)("debug.action.add.configuration"))))},$=(0,r.withTheme)({widgets:{TextWidget:O.TextWidget,SelectWidget:I.SelectWidget,CheckboxWidget:A.CheckboxWidget},fields:{ObjectField:T.ObjectField}}),Y=({snippetItem:z,schemaContributions:H,onChange:K})=>{if(!z)return m.default.createElement("div",{className:M.default.no_onfiguration},(0,g.localize)("debug.action.no.configuration"));const Z=(0,g.useInjectable)(a.ILaunchService),X=(0,m.useMemo)(()=>{const le=(0,d.acquireAjv)(),q=((0,p.default)(H,["properties","configurations","items","oneOf"])||[]).find(Ee=>{const{body:_e}=z;return le.validate(Ee,_e)});if(q)return Z.setRawSchemaProperties(q),q},[z,H]),ie=(0,m.useMemo)(()=>{if(!(X&&X.properties))return;const{label:le,body:pe,description:q}=z,{properties:Ee,required:_e}=X,te=Object.keys(pe).reduce((Te,Pe)=>{const Ae=Ee[Pe];return Ae?.type===f.JSON_SCHEMA_TYPE.ARRAY&&(0,g.isUndefined)(Ae?.items)&&(Ae.items={type:f.JSON_SCHEMA_TYPE.STRING}),Array.isArray(Ae?.type)&&(Ae.type=Ae.type[0]||f.JSON_SCHEMA_TYPE.STRING),Array.isArray(Ae?.anyOf)&&(Ae.anyOf=Ae.anyOf.filter(we=>Object.keys(we).length>0)),Ae?.type===f.JSON_SCHEMA_TYPE.OBJECT&&!(0,g.isUndefined)(Ae?.additionalProperties)&&(Ae.additionalProperties={type:f.JSON_SCHEMA_TYPE.STRING}),Ae?.type===f.JSON_SCHEMA_TYPE.OBJECT&&!(0,g.isUndefined)(Ae?.properties)&&Object.keys(Ae.properties).length>6&&(Ae.properties={},Ae[E.MASSIVE_PROPERTY_FLAG]=!0),!Ae?.description&&Ae?.markdownDescription&&(Ae.description=Ae.markdownDescription),Te[Pe]=Ae,Te},{}),ge={title:le,type:f.JSON_SCHEMA_TYPE.OBJECT,required:_e,description:q,properties:te};return Z.nextNewSchema(ge),ge},[z,X]),oe=(0,m.useCallback)(le=>{if(!(X&&X.properties)||!(ie&&ie.properties))return;const{label:pe}=le;Z.addNewItem(pe)},[z,X,ie]);return m.default.createElement("div",{className:M.default.launch_schema_body_container},ie&&X&&m.default.createElement($,{formData:z.body,schema:ie,validator:o.default,fields:{AnyOfField:S.AnyOfField,OneOfField:S.AnyOfField,ArrayField:w.ArrayField},onChange:K,templates:{ArrayFieldTemplate:F.ArrayFieldTemplate,ArrayFieldItemTemplate:k.ArrayFieldItemTemplate,DescriptionFieldTemplate:j.DescriptionFieldTemplate,FieldTemplate:W.FieldTemplate,ObjectFieldTemplate:U.ObjectFieldTemplate,WrapIfAdditionalTemplate:P.WrapIfAdditionalTemplate,BaseInputTemplate:L.BaseInputTemplate,TitleFieldTemplate:D.TitleField,ButtonTemplates:{MoveUpButton:B.MoveUpButton,MoveDownButton:B.MoveDownButton,RemoveButton:B.RemoveButton,SubmitButton:le=>m.default.createElement(B.AddItemButton,{...le,onAddClick:oe}),AddButton:B.AddButton,CopyButton:B.CopyButton}}}))}},24650:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationItemsModel=void 0;const n=e(43718);class r{get uniqueID(){return this._uniqueID}get description(){return this._description}constructor(c,p){this.label=c,this.configuration=p,this._uniqueID=(0,n.uuid)(6)}setDescription(c){this._description=c}}t.ConfigurationItemsModel=r},77874:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WrapIfAdditionalTemplate=void 0;const n=e(85608),r=e(51632),o=n.__importStar(e(14041)),c=e(97267),p=e(41869),v=e(43718),m=e(64582),_=e(44888),s=n.__importDefault(e(40043)),g=l=>{const{children:h,classNames:u,style:d,disabled:E,id:f,label:a,onKeyChange:b,onDropPropertyClick:y,readonly:A,registry:S,schema:w}=l,T=(0,p.useInjectable)(_.LaunchService),{readonlyAsDisabled:D=!0}=S.formContext,{templates:I}=S,{RemoveButton:O}=I.ButtonTemplates,M=r.ADDITIONAL_PROPERTY_FLAG in w,R=m.MASSIVE_PROPERTY_FLAG in w,P=(0,r.getTemplate)("TitleFieldTemplate",S),k=(0,r.getTemplate)("DescriptionFieldTemplate",S),F=(0,o.useMemo)(()=>w.description||w.markdownDescription,[w]),L=(0,o.useCallback)(async()=>{await T.openLaunchConfiguration()},[]);if(R)return o.default.createElement("div",{className:u,style:d},a&&o.default.createElement("div",{className:s.default.object_title},o.default.createElement(P,{id:(0,r.titleId)(f),title:a,schema:w,registry:S})),F&&o.default.createElement("div",{className:s.default.object_description},o.default.createElement(k,{id:(0,r.descriptionId)(f),description:F,schema:w,registry:S})),o.default.createElement("div",{className:s.default.control_wrap},o.default.createElement("a",{onClick:L},(0,v.localize)("debug.launch.view.edit.inLaunchJson"))));if(!M)return o.default.createElement("div",{className:u,style:d},h);const B=(0,o.useCallback)(({target:j})=>b(j.value),[b]);return o.default.createElement("div",{className:u,style:d},o.default.createElement("div",{className:s.default.additional_field_template},o.default.createElement("div",{className:s.default.form_additional_container},o.default.createElement("div",{className:s.default.form_additional},o.default.createElement(c.Input,{className:s.default.form_control,defaultValue:a,value:a,placeholder:(0,v.formatLocalize)("debug.launch.view.template.input.placeholder","Key"),disabled:E||D&&A,id:`${f}-key`,name:`${f}-key`,onBlur:A?void 0:B,type:"text"})),o.default.createElement("div",{className:s.default.form_additional_children},h),o.default.createElement(O,{disabled:E||A,onClick:y(a),registry:S}))))};t.WrapIfAdditionalTemplate=g},27953:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayFieldItemTemplate=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=n.__importDefault(e(40043)),p={width:"100%"},v={width:"calc(100% / 4)"},m=_=>{const{className:s,children:g,disabled:l,hasCopy:h,hasMoveDown:u,hasMoveUp:d,hasRemove:E,hasToolbar:f,index:a,onCopyIndexClick:b,onDropIndexClick:y,onReorderClick:A,readonly:S,registry:w}=_,{CopyButton:T,MoveDownButton:D,MoveUpButton:I,RemoveButton:O}=w.templates.ButtonTemplates,M=(0,o.useMemo)(()=>b(a),[a,b]),R=(0,o.useMemo)(()=>y(a),[a,y]),P=(0,o.useMemo)(()=>A(a,a-1),[a,A]),k=(0,o.useMemo)(()=>A(a,a+1),[a,A]);return o.default.createElement("div",{key:`array-item-${a}`,className:(0,r.default)(s,c.default.array_field_item_template)},o.default.createElement("div",{className:c.default.control_field},o.default.cloneElement(g,{name:""})),f&&o.default.createElement("div",{className:c.default.toolbar},o.default.createElement("div",{style:p},(d||u)&&o.default.createElement(I,{disabled:l||S||!d,onClick:P,style:v,registry:w}),(d||u)&&o.default.createElement(D,{disabled:l||S||!u,onClick:k,style:v,registry:w}),h&&o.default.createElement(T,{disabled:l||S,onClick:M,style:v,registry:w}),E&&o.default.createElement(O,{disabled:l||S,onClick:R,style:v,registry:w}))))};t.ArrayFieldItemTemplate=m},44115:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArrayFieldTemplate=void 0;const n=e(85608),r=e(51632),o=n.__importDefault(e(53373)),c=n.__importDefault(e(14041)),p=n.__importDefault(e(40043)),v=m=>{const{canAdd:_,className:s,disabled:g,formContext:l,idSchema:h,items:u,onAddClick:d,readonly:E,registry:f,required:a,schema:b,title:y,uiSchema:A}=m,S=(0,r.getUiOptions)(A),w=(0,r.getTemplate)("ArrayFieldDescriptionTemplate",f,S),T=(0,r.getTemplate)("ArrayFieldItemTemplate",f,S),D=(0,r.getTemplate)("ArrayFieldTitleTemplate",f,S),{ButtonTemplates:{AddButton:I}}=f.templates;return c.default.createElement("fieldset",{className:(0,o.default)(s),id:h.$id},c.default.createElement("div",{className:p.default.array_field_template},(S.title||y)&&c.default.createElement("div",{className:p.default.array_item_label},c.default.createElement(D,{idSchema:h,required:a,title:S.title||y,schema:b,uiSchema:A,registry:f})),(S.description||b.description)&&c.default.createElement("div",{className:p.default.array_item_description},c.default.createElement(w,{description:S.description||b.description,idSchema:h,schema:b,uiSchema:A,registry:f})),u&&u.map(({key:O,...M})=>c.default.createElement(T,{key:O,...M})),_&&c.default.createElement("div",{className:p.default.array_item_add},c.default.createElement(I,{disabled:g||E,onClick:d,registry:f}))))};t.ArrayFieldTemplate=v},51773:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseInputTemplate=void 0;const n=e(85608),r=e(51632),o=n.__importDefault(e(14041)),c=e(97267),p={width:"100%"},v=m=>{const{disabled:_,formContext:s,id:g,onBlur:l,onChange:h,onChangeOverride:u,onFocus:d,options:E,placeholder:f,readonly:a,schema:b,value:y,type:A}=m,S=(0,r.getInputProps)(b,A,E,!1),{readonlyAsDisabled:w=!0}=s,T=R=>h(R),D=u||(({target:R})=>h(R.value===""?E.emptyValue:R.value)),I=({target:R})=>l(g,R.value),O=({target:R})=>d(g,R.value),M=o.default.createElement(c.Input,{disabled:_||w&&a,id:g,name:g,onBlur:a?void 0:I,onChange:a?void 0:D,onFocus:a?void 0:O,placeholder:f,style:p,list:b.examples?(0,r.examplesId)(g):void 0,...S,value:y,"aria-describedby":(0,r.ariaDescribedByIds)(g,!!b.examples)});return o.default.createElement(o.default.Fragment,null,M,Array.isArray(b.examples)&&o.default.createElement("datalist",{id:(0,r.examplesId)(g)},b.examples.concat(b.default&&!b.examples.includes(b.default)?[b.default]:[]).map(R=>o.default.createElement("option",{key:R,value:R}))))};t.BaseInputTemplate=v},67481:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddItemButton=t.CopyButton=t.AddButton=t.RemoveButton=t.MoveDownButton=t.MoveUpButton=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),c=e(81139),p=e(41869),v=e(25918),m=e(1237),_=e(43718),s=e(64582),g=n.__importDefault(e(40043)),l=a=>r.default.createElement(o.Button,{...a,type:"primary",icon:c.defaultIconfont.arrowup},r.default.createElement("span",{className:(0,o.getIcon)(c.defaultIconfont.arrowup)}));t.MoveUpButton=l;const h=a=>r.default.createElement(o.Button,{...a,type:"primary",icon:c.defaultIconfont.arrowdown},r.default.createElement("span",{className:(0,o.getIcon)(c.defaultIconfont.arrowdown)}));t.MoveDownButton=h;const u=a=>r.default.createElement(o.Button,{...a,type:"danger",icon:c.defaultIconfont.delete},r.default.createElement("span",{className:(0,o.getIcon)(c.defaultIconfont.delete)}));t.RemoveButton=u;const d=a=>r.default.createElement(o.Button,{...a,type:"primary",icon:c.defaultIconfont.plus},r.default.createElement("span",{className:(0,o.getIcon)(c.defaultIconfont.plus)})," ",(0,_.localize)("debug.launch.view.template.button.addItem"));t.AddButton=d;const E=a=>r.default.createElement(o.Button,{...a,type:"primary",icon:c.defaultIconfont["file-copy"]},r.default.createElement("span",{className:(0,o.getIcon)(c.defaultIconfont["file-copy"])}));t.CopyButton=E;const f=a=>{const{registry:{rootSchema:b},onAddClick:y}=a,A=(0,p.useInjectable)(s.ILaunchService),[S,w]=r.default.useState(!1),[T,D]=r.default.useState([]),{rawSchemaProperties:I}=A,O=(0,r.useCallback)(P=>w(P),[]),M=(0,r.useCallback)(P=>{w(!1),y(P)},[]),R=(0,r.useCallback)(()=>{const{properties:P}=I,{properties:k}=b;if(!P||!k)return;const F=Object.keys(P).filter(L=>!Object.hasOwn(k,L)).map(L=>new m.LabelMenuItemNode(L));D(F)},[b,I]);return(0,r.useEffect)(()=>{const P=new _.Disposable;return P.addDispose(A.onChangeSchema(()=>{requestAnimationFrame(()=>{R()})})),R(),()=>P.dispose()},[I,b]),r.default.createElement(o.Button,{type:"secondary",icon:c.defaultIconfont.plus,className:g.default.add_new_field,menu:r.default.createElement(v.MenuActionList,{afterClick:M,data:T,style:{maxHeight:600}}),moreVisible:S,onVisibleChange:O},r.default.createElement("span",{className:(0,o.getIcon)(c.defaultIconfont.plus)})," ",(0,_.localize)("debug.launch.view.template.button.submit"))};t.AddItemButton=f},5062:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DescriptionFieldTemplate=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=n.__importDefault(e(40043)),c=p=>{const{id:v,schema:m}=p,_=(0,r.useMemo)(()=>{var s;return(s=m.description)!==null&&s!==void 0?s:m.markdownDescription},[m,m.description,m.markdownDescription]);return _?r.default.createElement("span",{id:v,className:o.default.description_field_template},_):null};t.DescriptionFieldTemplate=c},74447:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FieldTemplate=void 0;const n=e(85608),r=e(51632),o=n.__importDefault(e(53373)),c=n.__importDefault(e(14041)),p=v=>{const{classNames:m,style:_,children:s,id:g,schema:l,label:h,hidden:u,formContext:d,uiSchema:E,registry:f,disabled:a,onDropPropertyClick:b,onKeyChange:y,required:A,readonly:S}=v,{wrapperStyle:w}=d,T=(0,r.getUiOptions)(E),D=(0,r.getTemplate)("WrapIfAdditionalTemplate",f,T);return u?null:c.default.createElement(D,{classNames:m,style:_,disabled:a,id:g,label:h,onDropPropertyClick:b,onKeyChange:y,readonly:S,required:A,schema:l,uiSchema:E,registry:f},g==="root"?s:c.default.createElement("div",{className:(0,o.default)(m),style:w},s))};t.FieldTemplate=p},56551:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectFieldTemplate=void 0;const n=e(85608),r=e(51632),o=n.__importDefault(e(53373)),c=n.__importStar(e(14041)),p=e(97267),v=e(41869),m=e(70159),_=n.__importDefault(e(40043)),s=l=>{const{schema:h,uiSchema:u,formData:d}=l,{properties:E}=h;return E?Object.keys(E).length===0?!0:Object.values(E).some(f=>f[r.ADDITIONAL_PROPERTY_FLAG])?(0,r.canExpand)(h,u,d):!1:!1},g=l=>{const{schema:h,uiSchema:u,required:d,registry:E,idSchema:f,title:a,disabled:b,readonly:y,properties:A,onAddClick:S}=l,w=(0,v.useInjectable)(m.ILaunchService),T=(0,r.getUiOptions)(u),D=(0,r.getTemplate)("TitleFieldTemplate",E,T),I=(0,r.getTemplate)("DescriptionFieldTemplate",E,T),{ButtonTemplates:{AddButton:O}}=E.templates,M=(0,c.useMemo)(()=>{var L;return(L=l.description)!==null&&L!==void 0?L:h.markdownDescription},[l.description,h]),R=(0,c.useMemo)(()=>f.$id==="root"?(0,o.default)(_.default.object_field_container,_.default.root_object_field_container):_.default.object_field_container,[f]),P=(0,c.useMemo)(()=>f.$id==="root"?(0,o.default)(_.default.property_wrapper,_.default.root_property_wrapper):_.default.property_wrapper,[f]),k=(0,c.useCallback)(L=>{const{name:B}=L;w.delItem(B)},[]),F=(0,c.useCallback)(L=>{const{rawSchemaProperties:B}=w;if(!B)return null;const j=B.required||[];return c.default.createElement("div",{key:L.name,className:P,onKeyDown:W=>{W.key===v.Key.ENTER.code&&(W.preventDefault(),W.stopPropagation())}},L.content,j.includes(L.name)||f.$id!=="root"?null:c.default.createElement("div",{className:_.default.wrapper_delete,onClick:()=>k(L)},c.default.createElement("span",{className:(0,o.default)((0,p.getIcon)("close-circle"),_.default.close_icon)})))},[A,w.rawSchemaProperties,f]);return c.default.createElement("div",{className:_.default.object_field_template},c.default.createElement("fieldset",null,c.default.createElement("div",{className:R},a&&c.default.createElement("div",{className:_.default.object_title},c.default.createElement(D,{id:(0,r.titleId)(f),title:a,required:d,schema:h,uiSchema:u,registry:E})),M&&c.default.createElement("div",{className:_.default.object_description},c.default.createElement(I,{id:(0,r.descriptionId)(f),description:M,schema:h,uiSchema:u,registry:E})),A.filter(L=>!L.hidden).map(L=>F(L))),s(l)&&c.default.createElement(O,{onClick:S(h),disabled:b||y,registry:E})))};t.ObjectFieldTemplate=g},81450:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnsiConsoleNode=t.TreeWithLinkWrapper=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),c=n.__importDefault(e(43144)),p=e(97267),v=e(41869),m=n.__importDefault(e(80315)),_=l=>{if(typeof l>"u")return(0,r.default)(m.default.variable_repl_text,m.default.info);switch(l){case v.MessageType.Error:return(0,r.default)(m.default.variable_repl_text,m.default.error);case v.MessageType.Warning:return(0,r.default)(m.default.variable_repl_text,m.default.warn);case v.MessageType.Info:return(0,r.default)(m.default.variable_repl_text,m.default.info);default:return(0,r.default)(m.default.variable_repl_text,m.default.info)}};class s extends o.default.Component{componentDidMount(){if(this.props.html){const h=c.default.findDOMNode(this);h?.appendChild(this.props.html)}}render(){return o.default.createElement("code",{className:this.props.className})}}t.TreeWithLinkWrapper=s;class g extends p.TreeNode{get parent(){return this._compositeTreeNode}static is(h){return!!h&&!!h.template}constructor(h,u,d,E,f,a,b){var y;super({},u),this.description=h,this._compositeTreeNode=u,this.linkDetector=d,this.ansiNode=E,this.severity=f,this.source=a,this.line=b,this.linkDetectorHTML=(y=this.ansiNode)!==null&&y!==void 0?y:this.linkDetector.linkify(this.description)}get name(){return`log_${this.id}`}get el(){return this.linkDetectorHTML}get template(){return()=>o.default.createElement(s,{className:_(this.severity),html:this.linkDetectorHTML})}}t.AnsiConsoleNode=g},98650:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugHoverVariableRoot=t.DebugVariableRoot=t.DebugWatchRoot=t.DebugConsoleRoot=t.DebugConsoleNode=t.DebugConsoleVariableContainer=t.DebugWatchNode=t.DebugScope=t.DebugVariableContainer=t.DebugVariable=t.DebugVirtualVariable=t.ExpressionContainer=t.ExpressionNode=t.DebugConsoleTreeService=t.ExpressionTreeService=void 0;const n=e(97267),r=e(41869),o=e(43718),c=e(55121),p=e(44781),v="undefined";class m{constructor(T,D,I){this.session=T,this.source=D,this.line=I}async resolveChildren(T){var D;return A.is(T)&&!T.variablesReference&&!T.presetChildren?await((D=this.session)===null||D===void 0?void 0:D.getScopes(T))||[]:await this.doResolve(T)}async doResolve(T){const D=[];if(!T)return D;if(Array.isArray(T.presetChildren))return T.presetChildren;if(!this.session||this.session.terminated)return D;const{variablesReference:I,startOfVariables:O,indexedVariables:M,namedVariables:R}=T;if(R)return await this.fetch(D,I,"named",T),D;if(M){let P=g.BASE_CHUNK_SIZE;for(;M>P*g.BASE_CHUNK_SIZE;)P*=g.BASE_CHUNK_SIZE;if(M>P){const k=Math.ceil(M/P);for(let F=0;F<k;F++){const L=T.startOfVariables+F*P,B=Math.min(P,M-F*P);D.push(new l({session:this.session,variablesReference:T.variablesReference,namedVariables:0,indexedVariables:B,startOfVariables:L,name:`[${L}..${L+B-1}]`},T))}return D}}return await this.fetch(D,I,"indexed",T,O,M),D}async fetch(T,D,I,O,M,R){try{const P=await this.session.sendRequest("variables",{variablesReference:D,filter:I,start:M,count:R}),{variables:k}=P.body;for(const F of k)F.variablesReference?T.push(new u(this.session,F,O,this.source,this.line)):T.push(new h(this.session,F,O))}catch(P){T.push({severity:r.MessageType.Error,visible:!!P.message,message:P.message})}}sortComparator(T,D){return(0,o.isDefined)(T.variablesReference)&&(0,o.isDefined)(D.variablesReference)?T.variablesReference-D.variablesReference:T.constructor===D.constructor?T.name>D.name?1:T.name<D.name?-1:0:n.CompositeTreeNode.is(T)?1:n.CompositeTreeNode.is(D)?-1:0}}t.ExpressionTreeService=m;class _ extends m{sortComparator(T,D){return T?D?0:-1:1}}t.DebugConsoleTreeService=_;class s extends n.TreeNode{constructor(T,D){var I;super(new m(T.session,T.source,T.line),D,void 0,{name:String((I=T.session)===null||I===void 0?void 0:I.id)}),this.variablesReference=T.variablesReference||0,this.namedVariables=T.namedVariables,this.indexedVariables=T.indexedVariables,this.memoryReference=T.memoryReference,this.source=T.source,this.line=T.line}get badge(){return this.source?`${this.source.name}:${this.line}`:""}get displayName(){return this.name}}t.ExpressionNode=s;class g extends n.CompositeTreeNode{constructor(T,D,I,O){var M;super(I||new m(T.session,T.source,T.line),D,void 0,{name:O||((M=T.session)===null||M===void 0?void 0:M.id)}),this.session=T.session,this.variablesReference=T.variablesReference||0,this.namedVariables=T.namedVariables,this.indexedVariables=T.indexedVariables,this.startOfVariables=T.startOfVariables||0,this.memoryReference=T.memoryReference,this.source=T.source,this.line=T.line}get badge(){return this.source?`${this.source.name}:${this.line}`:""}get displayName(){return this.name}get path(){return this.parent?new c.Path(this.parent.path).join(String(this.id)).toString():String(this.id)}}t.ExpressionContainer=g,g.BASE_CHUNK_SIZE=100;class l extends g{constructor(T,D){super(T,D,void 0,T.name),this._name=T.name}}t.DebugVirtualVariable=l;class h extends s{constructor(T,D,I){super({session:T,variablesReference:D.variablesReference,namedVariables:D.namedVariables,indexedVariables:D.indexedVariables,memoryReference:D.memoryReference},I),this.session=T,this.variable=D}get variableMenuContext(){return this.variable.__vscodeVariableMenuContext||""}toDebugProtocolObject(){return{name:this.name,variablesReference:this.variable.variablesReference||0,value:this.value,evaluateName:this.evaluateName,memoryReference:this.memoryReference}}get name(){if(this.variable){if(this.variable.name)return this.variable.name;if(this.variable.evaluateName){const T=/\["(.+)"]/.exec(this.variable.evaluateName);if(T)return T[1];{const D=this.variable.evaluateName.split(".");return D[D.length-1]}}}return String(this.id)}get evaluateName(){var T;return((T=this.variable)===null||T===void 0?void 0:T.evaluateName)||""}get description(){return this.value||v}get value(){return this._value||this.variable.value}get variableType(){return this._type||this.variable.type}get supportSetVariable(){return!!this.session&&!!this.session.capabilities.supportsSetVariable}async setValue(T){if(!this.session||this.session.terminated)return;const{name:D,parent:I}=this,O=I.variablesReference;try{const M=await this.session.sendRequest("setVariable",{variablesReference:O,name:D,value:T});this._value=M.body.value,this._type=M.body.type,this.variablesReference=M.body.variablesReference||0,this.namedVariables=M.body.namedVariables,this.indexedVariables=M.body.indexedVariables}catch(M){throw M}}getRawScope(){let T=this.parent;for(;T!==void 0&&!(T instanceof d);)T=T?.parent;return T.getRawScope()}}t.DebugVariable=h;class u extends g{constructor(T,D,I,O,M){super({session:T,variablesReference:D.variablesReference,namedVariables:D.namedVariables,indexedVariables:D.indexedVariables,memoryReference:D.memoryReference,source:O,line:M},I,void 0,D?.name||(D.evaluateName?/\["(.+)"]/.exec(D.evaluateName)?/\["(.+)"]/.exec(D.evaluateName)[1]:D.evaluateName.split(".")[D.evaluateName.split(".").length-1]:"")),this.session=T,this.variable=D}get variableMenuContext(){return this.variable.__vscodeVariableMenuContext||""}toDebugProtocolObject(){return{name:this.name,variablesReference:this.variable.variablesReference||0,value:this.value,evaluateName:this.evaluateName,memoryReference:this.memoryReference}}get name(){if(this.variable){if(this.variable.name)return this.variable.name;if(this.variable.evaluateName){const T=/\["(.+)"]/.exec(this.variable.evaluateName);if(T)return T[1];{const D=this.variable.evaluateName.split(".");return D[D.length-1]}}}return this.variable.type||String(this.id)}get evaluateName(){var T;return((T=this.variable)===null||T===void 0?void 0:T.evaluateName)||""}get description(){return this._value||this.variable.value||v}get tooltip(){return this.variableType||this.description}get variableType(){return this._variableType||this.variable.type}get value(){return this._value||this.variable.value}get supportSetVariable(){return!!this.session&&!!this.session.capabilities.supportsSetVariable}async setValue(T){if(!this.session||this.session.terminated)return;const{name:D,parent:I}=this;if(!I)return;const O=I.variablesReference,M=await this.session.sendRequest("setVariable",{variablesReference:O,name:D,value:T});this._value=M.body.value,this._variableType=M.body.type,this.variablesReference=M.body.variablesReference||0,this.namedVariables=M.body.namedVariables,this.indexedVariables=M.body.indexedVariables}getRawScope(){let T=this.parent;for(;T!==void 0&&!(T instanceof d);)T=T?.parent;return T.getRawScope()}}t.DebugVariableContainer=u,u.BOOLEAN_REGEX=/^true|false$/i,u.STRING_REGEX=/^(['"]).*\1$/;class d extends g{constructor(T,D,I){super({session:D,variablesReference:T.variablesReference,namedVariables:T.namedVariables,indexedVariables:T.indexedVariables},I,void 0,T.name),this.raw=T,this.session=D}getRawScope(){return this.raw}range(){const T=this.getRawScope();return T.line&&T.column&&T.endLine&&T.endColumn?new p.Range(T.line,T.column,T.endLine,T.endColumn):void 0}}t.DebugScope=d;class E extends g{static is(T){return!!T&&!!T.expression}constructor(T,D,I){super({session:T},I,void 0,D),this.session=T,this.expression=D}get description(){return this._available?this._description||v:E.notAvailable}get available(){return this._available}getRawWatch(){return this.raw}async evaluate(T="watch"){if(this.session)try{this._available=!0;const{expression:D}=this,I=await this.session.evaluate(D,T);I&&(this.name=this.expression,this._description=I.result,this.variablesReference=I.variablesReference,this.namedVariables=I.namedVariables,this.indexedVariables=I.indexedVariables,this.memoryReference=I.memoryReference,this.raw=I)}catch(D){this.name=this.expression,this._description=D.message}else this.name=this.expression,this._available=!1}async getClipboardValue(){if(this.session&&this.session.capabilities.supportsValueFormattingOptions)try{const{expression:T}=this,D=await this.session.evaluate(T,"clipboard");if(D)return D.result}catch{return""}else return this._description}}t.DebugWatchNode=E,E.notAvailable=(0,r.localize)("debug.watch.notAvailable");class f extends u{static is(T){return!!T&&T.uniqueID===f.uniqueID}get uniqueID(){return f.uniqueID}get description(){return this.variable?this.variable.value:v}get tooltip(){return this.variable?this.variable.value:""}}t.DebugConsoleVariableContainer=f,f.uniqueID="DebugConsoleVariable";class a extends g{static is(T){return!!T&&!!T.expression}get available(){return this._available}constructor(T,D,I){super(T,I,void 0,D),this.options=T,this.expression=D,this._description=v}get description(){return this._description}async evaluate(T="repl"){const{expression:D}=this;if(this.session)try{if(typeof D=="string"&&D){const I=await this.session.evaluate(D,T);I&&(this.name=D,this._description=I.result,this.variablesReference=I.variablesReference,this.namedVariables=I.namedVariables,this.indexedVariables=I.indexedVariables,this.memoryReference=I.memoryReference,this._available=!0)}else if(this.options.variablesReference){const I=await this.session.variables(this.options.variablesReference);I.variables.length&&(this.name=I.variables.map(O=>O.value).join(`
|
|
31520
31520
|
`),this._description="",this._available=!0)}}catch(I){this._available=!1,this.name=D,this._description=I.message}else this._available=!1,this.name=D}}t.DebugConsoleNode=a;class b extends g{static is(T){return!!T&&!T.parent}constructor(T,D=[]){super({session:T},void 0,new _(T)),this.session=T,this.presetChildren=D}get expanded(){return!0}updatePresetChildren(T){this.presetChildren=T}}t.DebugConsoleRoot=b;class y extends g{static is(T){return!!T&&!T.parent}constructor(T,D=[]){super({session:T},void 0),this.session=T,this.presetChildren=D}get expanded(){return!0}updatePresetChildren(T){this.presetChildren=T}}t.DebugWatchRoot=y;class A extends u{static is(T){return!!T&&!T.parent}constructor(T){super(T,{},void 0),this.session=T}get expanded(){return!0}}t.DebugVariableRoot=A;class S extends g{constructor(T,D){super({session:D}),this.expression=T,this.session=D,this._value="",this._available=!1}get name(){return this._value}get available(){return this._available}async evaluate(T="repl"){if(this.session)try{const{expression:D}=this,I=await this.session.evaluate(D,T);I&&(this._value=I.result,this._available=!0,this.variablesReference=I.variablesReference,this.namedVariables=I.namedVariables,this.indexedVariables=I.indexedVariables,this.memoryReference=I.memoryReference)}catch(D){this._value=D.message,this._available=!1}else this._value="Please start a debug session to evaluate",this._available=!1}}t.DebugHoverVariableRoot=S},16170:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(98650),t),n.__exportStar(e(81450),t)},57332:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BreakpointsTreeNode=void 0;const n=e(43718),r=e(99797);class o{constructor(p,v){this.label="",this._onDescriptionChange=new n.Emitter;const{breakpoint:m}=v;this._uri=p,this.label=(0,r.isDebugBreakpoint)(m)?p.displayName:"",this.rawData=v,this.rawData.onDescriptionChange=this._onDescriptionChange.event}get breakpoint(){return this.rawData.breakpoint}get uri(){return this._uri}fireDescriptionChange(p){this.rawData.description=p,this._onDescriptionChange.fire(p)}}t.BreakpointsTreeNode=o},97319:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugBreakpointsService=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(26542),p=e(54414),v=e(57517),m=e(28423),_=e(51500),s=e(26199),g=e(64582),l=e(26296),h=e(99797),u=e(38029),d=e(32756),E=e(57332);let f=class extends o.WithEventBus{get inputEditor(){return this._inputEditor}constructor(){super(),this._onDidChangeBreakpointsTreeNode=new o.Emitter,this.onDidChangeBreakpointsTreeNode=this._onDidChangeBreakpointsTreeNode.event,this._onDidFocusedBreakpoints=new o.Emitter,this.onDidFocusedBreakpoints=this._onDidFocusedBreakpoints.event,this.treeNodeMap=new Map,this.enable=(0,m.observableValue)(this,!1),this.inDebugMode=(0,m.observableValue)(this,!1),this.toggleBreakpointEnable=b=>{if((0,h.isDebugBreakpoint)(b)){const y=this.breakpoints.getBreakpoint(o.URI.parse(b.uri),{lineNumber:b.raw.line,column:b.raw.column});y&&(y.enabled=!y.enabled,this.breakpoints.updateBreakpoint(y))}(0,h.isDebugExceptionBreakpoint)(b)&&this.breakpoints.updateExceptionBreakpoints(b.filter,!b.default)},this.init()}launchFocusedBreakpoints(b){this._onDidFocusedBreakpoints.fire(b)}async init(){await this.updateRoots(),this.workspaceService.onWorkspaceChanged(async()=>{this.updateRoots(),this.updateBreakpoints()}),this.breakpoints.onDidChangeBreakpoints(()=>{this.updateBreakpoints()}),this.breakpoints.onDidChangeExceptionsBreakpoints(()=>{this.updateBreakpoints()}),this.breakpoints.whenReady.then(()=>{this.updateBreakpoints()}),this.contextKeyService.onDidChangeContext(b=>{b.payload.affectsSome(new Set([g.CONTEXT_IN_DEBUG_MODE_KEY]))&&(0,m.transaction)(y=>{this.inDebugMode.set(this.contextKeyService.getContextKeyValue(g.CONTEXT_IN_DEBUG_MODE_KEY)||!1,y)})})}getBreakpointDecoration(b,y=!1,A=!0){return new h.DebugDecorator().getDecoration(b,y,A)}onRenameFile(b){this.removeBreakpoints(b.payload.oldUri)}onDeleteFile(b){this.removeBreakpoints(b.payload.oldUri)}removeBreakpoints(b){this.breakpoints.cleanAllMarkers(b),this.updateBreakpoints()}async updateRoots(){(0,m.transaction)(y=>{this.enable.set(this.breakpoints.breakpointsEnabled,y),this.inDebugMode.set(this.contextKeyService.getContextKeyValue(g.CONTEXT_IN_DEBUG_MODE_KEY)||!1,y)});const b=await this.workspaceService.roots;this.roots=b.map(y=>new o.URI(y.uri))}extractNodes(b){if((0,h.isDebugBreakpoint)(b))return{id:b.id,name:"",description:"",onDescriptionChange:o.Event.None,breakpoint:b};if((0,h.isDebugExceptionBreakpoint)(b))return{id:b.filter,name:b.label,onDescriptionChange:o.Event.None,description:"",breakpoint:b}}async updateBreakpoints(){await this.breakpoints.whenReady,this.treeNodeMap.clear(),[...this.breakpoints.getExceptionBreakpoints(),...this.breakpoints.getBreakpoints()].forEach(y=>{const A=this.extractNodes(y);if(A){const S=(0,h.isDebugBreakpoint)(y)?o.URI.parse(y.uri):h.EXCEPTION_BREAKPOINT_URI,w=this.treeNodeMap.get(S.toString())||[];w.push(new E.BreakpointsTreeNode(S,A)),this.treeNodeMap.set(S.toString(),w)}}),this._onDidChangeBreakpointsTreeNode.fire(this.treeNodeMap)}async getDocumentModelRef(b){const y=this.documentService.getModelReference(b);return y||this.documentService.createModelReference(b)}async refreshBreakpointsInfo(){const b=this.treeNodeMap.values(),y=Array.from(b).reduce((A,S)=>A.concat(S),[]);for await(const A of y){const{rawData:S,uri:w}=A;if((0,h.isDebugBreakpoint)(S.breakpoint)){const T=S.breakpoint.raw.line,D=await this.getDocumentModelRef(w);if(!D)return;const I=D.instance.getMonacoModel(),O=I.getLineCount();if(T>O)return;const M=I.getLineContent(T);A.fireDescriptionChange(M.trim()),D.dispose()}}}removeAllBreakpoints(){this.breakpoints.clearBreakpoints()}delBreakpoint(b){this.breakpoints.delBreakpoint(b)}toggleBreakpoints(){this.breakpoints.breakpointsEnabled=!this.breakpoints.breakpointsEnabled,(0,m.transaction)(b=>{this.enable.set(this.breakpoints.breakpointsEnabled,b)}),this.enable.get()?this.reporterService.point(g.DEBUG_REPORT_NAME===null||g.DEBUG_REPORT_NAME===void 0?void 0:g.DEBUG_REPORT_NAME.DEBUG_BREAKPOINT,"enabled"):this.reporterService.point(g.DEBUG_REPORT_NAME===null||g.DEBUG_REPORT_NAME===void 0?void 0:g.DEBUG_REPORT_NAME.DEBUG_BREAKPOINT,"unenabled")}async createBreakpointInput(b){this._inputEditor=await this.editorService.createCodeEditor(b,{...(0,p.getSimpleEditorOptions)(),lineHeight:21,scrollbar:{horizontal:"hidden",vertical:"hidden",handleMouseWheel:!1},acceptSuggestionOnEnter:"on",renderIndentGuides:!1});const A=(await this.documentService.createModelReference(new o.URI("debug/breakpoint/expression/input").withScheme(o.Schemes.walkThroughSnippet))).instance.getMonacoModel();return A.updateOptions({tabSize:2}),this._inputEditor.monacoEditor.setModel(A),Promise.resolve(this.inputEditor)}};t.DebugBreakpointsService=f,n.__decorate([(0,r.Autowired)(d.DebugViewModel),n.__metadata("design:type",d.DebugViewModel)],f.prototype,"model",void 0),n.__decorate([(0,r.Autowired)(_.IWorkspaceService),n.__metadata("design:type",Object)],f.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(h.BreakpointManager),n.__metadata("design:type",h.BreakpointManager)],f.prototype,"breakpoints",void 0),n.__decorate([(0,r.Autowired)(l.IDebugSessionManager),n.__metadata("design:type",u.DebugSessionManager)],f.prototype,"sessions",void 0),n.__decorate([(0,r.Autowired)(c.LabelService),n.__metadata("design:type",c.LabelService)],f.prototype,"labelProvider",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],f.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(o.IReporterService),n.__metadata("design:type",Object)],f.prototype,"reporterService",void 0),n.__decorate([(0,r.Autowired)(p.EditorCollectionService),n.__metadata("design:type",p.EditorCollectionService)],f.prototype,"editorService",void 0),n.__decorate([(0,r.Autowired)(v.IEditorDocumentModelService),n.__metadata("design:type",Object)],f.prototype,"documentService",void 0),n.__decorate([(0,o.OnEvent)(s.WorkspaceEditDidRenameFileEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[s.WorkspaceEditDidRenameFileEvent]),n.__metadata("design:returntype",void 0)],f.prototype,"onRenameFile",null),n.__decorate([(0,o.OnEvent)(s.WorkspaceEditDidDeleteFileEvent),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[s.WorkspaceEditDidDeleteFileEvent]),n.__metadata("design:returntype",void 0)],f.prototype,"onDeleteFile",null),t.DebugBreakpointsService=f=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],f)},85347:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BreakpointItem=t.BreakpointFileItem=t.DebugBreakpointView=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(97267),p=e(41869),v=n.__importStar(e(20868)),m=e(64582),_=e(99797),s=n.__importDefault(e(96547)),g=e(97319),l=({viewState:d})=>{const E=(0,p.useInjectable)(g.DebugBreakpointsService),f=(0,o.useRef)(!1),[a,b]=(0,o.useState)([]),{enable:y,inDebugMode:A,toggleBreakpointEnable:S}=E,w=(0,p.useAutorun)(y),T=(0,p.useAutorun)(A),D=O=>{const{data:M,inDebugMode:R,breakpointEnabled:P}=O;if((0,_.isDebugBreakpoint)(M.breakpoint)){if(!(R?(0,_.isDebugBreakpoint)(M.breakpoint)&&(0,_.isRuntimeBreakpoint)(M.breakpoint):!0))return"sumi-debug-breakpoint-unverified";const{className:F}=E.getBreakpointDecoration(M.breakpoint,R,P);return F}return""},I=(0,o.useCallback)(O=>{const{roots:M}=E,R=[];O.forEach(([P,k],F)=>{var L;if(_.EXCEPTION_BREAKPOINT_URI.toString()===P)k.forEach((j,W)=>{R.push({label:"",order:F*100+W,expandable:!1,twisterPlaceholderClassName:s.default.tree_item_twister_placeholder_fill,children:[],description:o.default.createElement(t.BreakpointItem,{toggle:()=>S(j.breakpoint),data:j.rawData})})});else{const j=p.URI.parse(P),W=M.filter(V=>V.isEqualOrParent(j))[0],U=W?((L=W.relative(j))===null||L===void 0?void 0:L.toString())||"":p.URI.parse(P).displayName,Q=k.map(V=>V.breakpoint);R.push({label:U,order:F,twisterClassName:s.default.tree_item_twister,renderLabel:o.default.createElement(t.BreakpointFileItem,{label:U,breakpointItems:Q,title:j.toString()}),expandable:!0,expanded:!0,children:k.map(V=>({...V,label:"",expandable:!1,twisterClassName:s.default.tree_item_twister,twisterPlaceholderClassName:s.default.tree_item_twister_placeholder,breakpoint:V.breakpoint,iconClassName:(0,r.default)(D({data:V.rawData,inDebugMode:T,breakpointEnabled:w}),s.default.debug_breakpoints_icon),description:o.default.createElement(t.BreakpointItem,{toggle:()=>S(V.breakpoint),data:V.rawData})}))})}}),f.current||b(R)},[a]);return(0,o.useEffect)(()=>{const O=new p.Disposable;return I(Array.from(E.treeNodeMap.entries())),O.addDispose(E.onDidChangeBreakpointsTreeNode(M=>{I(Array.from(M.entries()))})),()=>{f.current=!0,O.dispose()}},[]),(0,o.useEffect)(()=>{a.length>0&&requestAnimationFrame(()=>{E.refreshBreakpointsInfo()})},[a]),o.default.createElement("div",{className:(0,r.default)(s.default.debug_breakpoints,!w&&s.default.debug_breakpoints_disabled)},o.default.createElement(c.BasicRecycleTree,{onIconClick:(O,M)=>{M.raw.breakpoint&&S(M.raw.breakpoint)},sortComparator:(O,M)=>{if(typeof O.order<"u"&&typeof M.order<"u")return O.order>M.order?1:O.order<M.order?-1:0},indent:18,baseIndent:8,treeData:a,height:d.height}))};t.DebugBreakpointView=l;const h=({label:d,title:E,breakpointItems:f})=>{const a=(0,p.useInjectable)(g.DebugBreakpointsService),b=(0,o.useMemo)(()=>f.some(T=>T.enabled),[f]),[y,A]=o.default.useState(b),S=(0,o.useCallback)(T=>{f.filter(I=>I.enabled===T).forEach(I=>{a.toggleBreakpointEnable(I)}),A(!y)},[y]),w=(0,o.useCallback)(T=>{T.stopPropagation(),f.forEach(D=>{a.delBreakpoint(D)})},[]);return o.default.createElement("div",{className:s.default.debug_breakpoints_file_item},o.default.createElement("div",{className:s.default.file_item_control},o.default.createElement(c.CheckBox,{className:(0,r.default)(s.default.debug_breakpoints_icon,s.default.file_item_checkbox),onChange:()=>S(y),checked:y}),o.default.createElement("i",{className:(0,r.default)((0,p.getIcon)("file-text"),s.default.file_item_icon,s.default.debug_breakpoints_icon)}),o.default.createElement("span",{title:E},d)),o.default.createElement("div",{className:s.default.file_item_control_right},o.default.createElement("i",{className:(0,r.default)((0,p.getIcon)("close"),s.default.close_icon),onClick:T=>w(T)})))};t.BreakpointFileItem=h;const u=({data:d,toggle:E})=>{const f=(0,_.isDebugBreakpoint)(d.breakpoint)?d.breakpoint.enabled:!!d.breakpoint.default,a=(0,p.useInjectable)(m.IDebugSessionManager),b=(0,p.useInjectable)(p.CommandService),y=(0,p.useInjectable)(g.DebugBreakpointsService),[A,S]=o.default.useState(f),[w,T]=o.default.useState(void 0),[D,I]=o.default.useState(d.description),O=(0,o.useMemo)(()=>{const L={preview:!0,focus:!0};if(!(0,_.isDebugBreakpoint)(d.breakpoint))return L;if(w)L.range={startColumn:w.column||0,endColumn:w.column||0,startLineNumber:w.line,endLineNumber:w.line};else{const{raw:B}=d.breakpoint;L.range={startColumn:B.column||0,endColumn:B.column||0,startLineNumber:B.line,endLineNumber:B.line}}return L},[w,d.breakpoint]),M=()=>{E(),S(!A)},R=async()=>{d.breakpoint.uri&&(await b.executeCommand(p.EDITOR_COMMANDS.OPEN_RESOURCE.id,new p.URI(d.breakpoint.uri),O),y.launchFocusedBreakpoints({uri:new p.URI(d.breakpoint.uri),range:O.range}))};o.default.useEffect(()=>{const L=new p.Disposable,B=()=>{if((0,_.isDebugBreakpoint)(d.breakpoint)&&(0,_.isRuntimeBreakpoint)(d.breakpoint)){const j=(0,_.getStatus)(d.breakpoint);T(j)}};return L.addDispose(a.onDidChangeActiveDebugSession(()=>B())),B(),L.addDispose(d.onDescriptionChange(I)),()=>{T(void 0),L.dispose()}},[]);const P=L=>{L.stopPropagation(),y.delBreakpoint(d.breakpoint)},k=async L=>{L.stopPropagation(),await b.executeCommand(p.EDITOR_COMMANDS.OPEN_RESOURCE.id,new p.URI(d.breakpoint.uri),O);const{range:B}=O,j=new v.Position(B?.startLineNumber||1,B?.startColumn||1);await b.executeCommand(m.DEBUG_COMMANDS.EDIT_BREAKPOINT.id,j)},F=(0,o.useMemo)(()=>D?o.default.createElement("span",{className:s.default.debug_breakpoints_description},D):(0,_.isDebugBreakpoint)(d.breakpoint)?o.default.createElement("span",{className:(0,r.default)(s.default.debug_breakpoints_description,s.default.blank)},`< ${(0,p.localize)("debug.breakpoint.blank")} >`):null,[D,d.breakpoint]);return o.default.createElement("div",{className:(0,r.default)(s.default.debug_breakpoints_item)},o.default.createElement(c.CheckBox,{className:s.default.debug_breakpoints_icon,id:d.id,onChange:M,checked:A}),o.default.createElement("div",{className:s.default.debug_breakpoints_wrapper,onClick:R},d.name&&o.default.createElement("span",{className:s.default.debug_breakpoints_name},d.name),F),(0,_.isDebugBreakpoint)(d.breakpoint)?o.default.createElement(o.default.Fragment,null,o.default.createElement("div",{className:s.default.debug_breakpoints_item_control},O.range&&o.default.createElement("i",{title:(0,p.localize)("debug.menu.edit.breakpoint"),onClick:L=>k(L),className:(0,r.default)(s.default.debug_edit_breakpoints_icon,(0,p.getExternalIcon)("edit"))}),o.default.createElement("i",{title:(0,p.localize)("debug.menu.delete.breakpoint"),onClick:L=>P(L),className:(0,r.default)(s.default.debug_remove_breakpoints_icon,(0,p.getIcon)("close"))})),o.default.createElement(c.Badge,{className:s.default.debug_breakpoints_badge},d.breakpoint.raw.line,!!d.breakpoint.raw.column&&`:${d.breakpoint.raw.column}`)):null)};t.BreakpointItem=u},16067:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConfigurationService=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(28423),p=e(51500),v=e(68810),m=e(64582),_=e(26296),s=e(37499),g=e(38029),l=e(35199),h=e(32756);let u=class{constructor(){this.currentValue=(0,c.observableValue)(this,m.DEFAULT_ADD_CONFIGURATION_KEY),this.float=(0,c.observableValue)(this,!1),this.configurationOptions=(0,c.observableValue)(this,[]),this.dynamicConfigurations=(0,c.observableValue)(this,[]),this.isMultiRootWorkspace=(0,c.observableValue)(this,!1),this.workspaceRoots=(0,c.observableValue)(this,[]),this.start=async()=>{const E=this.debugConfigurationManager.current;E?this.debugSessionManager.start(E):this.debugConfigurationManager.addConfiguration()},this.openConfiguration=()=>{const{current:E}=this.debugConfigurationManager,f=E?.workspaceFolderUri;this.debugConfigurationManager.openConfiguration(f)},this.openLaunchEditor=()=>{this.debugConfigurationManager.openLaunchEditor()},this.openDebugConsole=()=>{this.debugConsoleService.activate()},this.addConfiguration=E=>{this.debugConfigurationManager.addConfiguration(typeof E=="string"?E:void 0)},this.getLaunchUri=()=>{const E=this.workspaceVariables.getWorkspaceRootUri();return new o.URI(E.toString()).resolve(`${this.preferenceConfigurations.getPaths()[0]}/launch.json`)},this.insertConfiguration=E=>{this.debugConfigurationManager.insertConfiguration(this.getLaunchUri(),E)},this.showDynamicQuickPickToInsert=async()=>{const E=await this.debugConfigurationManager.showDynamicConfigurationsTypesQuickPick();if(E){const f=await this.debugConfigurationManager.showDynamicConfigurationsQuickPick(E);f&&this.insertConfiguration(f)}},this.getDynamicSupportTypes=async()=>await this.debugConfigurationManager.getDynamicConfigurationsSupportTypes(),this.updateConfiguration=(E,f,a)=>{this.debugConfigurationManager.current=this.debugConfigurationManager.find(E,f,a)},this.showDynamicQuickPick=async E=>{const f=await this.debugConfigurationManager.showDynamicConfigurationsQuickPick(E);f&&this.debugSessionManager.start({configuration:f,workspaceFolderUri:this.workspaceRoots.get()[0],index:-1})},this.toName=({configuration:E,workspaceFolderUri:f})=>!f||!this.workspaceService.isMultiRootWorkspaceEnabled?E.name:E.name+" ("+new o.URI(f).path.base+")",this._whenReady=this.init()}get whenReady(){return this._whenReady}async init(){await this.debugConfigurationManager.whenReady,await this.updateConfigurationOptions(),this.debugConfigurationManager.onDidChange(async()=>{this.updateConfigurationOptions()}),this.preferenceService.onPreferenceChanged(E=>{const{preferenceName:f,newValue:a}=E;f==="debug.toolbar.float"&&this.float.get()!==a&&this.updateFloat(a)}),this.eventBus.on(m.DebugConfigurationsReadyEvent,()=>{this.updateDynamicConfigurations()}),await this.updateWorkspaceState(),this.workspaceService.onWorkspaceChanged(async()=>{await this.updateWorkspaceState()}),this.updateFloat(!!this.preferenceService.get("debug.toolbar.float"))}async updateWorkspaceState(){const E=(await this.workspaceService.tryGetRoots()).map(f=>f.uri);(0,c.transaction)(f=>{this.isMultiRootWorkspace.set(this.workspaceService.isMultiRootWorkspaceOpened,f),this.workspaceRoots.set(E,f)})}async updateDynamicConfigurations(){const E=await this.debugConfigurationManager.getDynamicConfigurationsSupportTypes();(0,c.transaction)(f=>{this.dynamicConfigurations.set(E,f)})}updateFloat(E){this.float.set(E,void 0)}updateCurrentValue(E){(0,c.transaction)(f=>{this.currentValue.set(E,f)})}async updateConfigurationOptions(){(0,c.transaction)(f=>{this.configurationOptions.set(this.debugConfigurationManager.all,f)});const{current:E}=this.debugConfigurationManager;if(E){const f=this.toValue(E);this.updateCurrentValue(f)}else this.updateCurrentValue(m.DEFAULT_ADD_CONFIGURATION_KEY);this.updateDynamicConfigurations()}toValue({configuration:E,workspaceFolderUri:f,index:a}){if(!f)return E.name;if((0,o.isUndefined)(a)){const b=this.debugConfigurationManager.find(E.name,f);return b&&b.index?this.toValue(b):this.currentValue.get()}return E.name+m.DEFAULT_CONFIGURATION_NAME_SEPARATOR+f+m.DEFAULT_CONFIGURATION_INDEX_SEPARATOR+a}};t.DebugConfigurationService=u,n.__decorate([(0,r.Autowired)(p.IWorkspaceService),n.__metadata("design:type",Object)],u.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(s.DebugConfigurationManager),n.__metadata("design:type",s.DebugConfigurationManager)],u.prototype,"debugConfigurationManager",void 0),n.__decorate([(0,r.Autowired)(_.IDebugSessionManager),n.__metadata("design:type",g.DebugSessionManager)],u.prototype,"debugSessionManager",void 0),n.__decorate([(0,r.Autowired)(h.DebugViewModel),n.__metadata("design:type",h.DebugViewModel)],u.prototype,"debugViewModel",void 0),n.__decorate([(0,r.Autowired)(l.DebugConsoleService),n.__metadata("design:type",l.DebugConsoleService)],u.prototype,"debugConsoleService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],u.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(v.WorkspaceVariableContribution),n.__metadata("design:type",v.WorkspaceVariableContribution)],u.prototype,"workspaceVariables",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceConfigurations),n.__metadata("design:type",o.PreferenceConfigurations)],u.prototype,"preferenceConfigurations",void 0),n.__decorate([(0,r.Autowired)(o.IEventBus),n.__metadata("design:type",Object)],u.prototype,"eventBus",void 0),t.DebugConfigurationService=u=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],u)},20676:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugControllerView=t.DebugConfigurationContainerView=t.DebugActionBar=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),c=e(97267),p=e(41869),v=e(77331),m=e(64582),_=e(66498),s=n.__importDefault(e(90463)),g=e(16067),l=e(84784),h=o.default.memo(({currentValue:E,options:f,dynamicOptions:a,onChangeConfiguration:b,isMultiRootWorkspace:y,addConfigurationLabel:A,editConfigurationLabel:S,toValue:w,workspaceRoots:T,isElectronRenderer:D})=>{const I=o.default.useCallback(R=>R&&R.length?R.map((P,k)=>{const F=y?`${P.configuration.name} (${new p.URI(P.workspaceFolderUri).displayName})`:P.configuration.name;return D?o.default.createElement("option",{key:k,value:w(P),label:F},F):o.default.createElement(c.Option,{key:k,value:w(P),label:F},F)}):D?[o.default.createElement("option",{value:m.DEFAULT_NO_CONFIGURATION_KEY,key:m.DEFAULT_NO_CONFIGURATION_KEY,label:(0,p.localize)("debug.action.no.configuration")},(0,p.localize)("debug.action.no.configuration"))]:[o.default.createElement(c.Option,{value:m.DEFAULT_NO_CONFIGURATION_KEY,key:m.DEFAULT_NO_CONFIGURATION_KEY,label:(0,p.localize)("debug.action.no.configuration")},(0,p.localize)("debug.action.no.configuration"))],[y]),O=o.default.useCallback(()=>{if(y){let R=A;const P=T.map((F,L)=>{const B=`${A} (${new p.URI(F).displayName})`;return R.length<B.length&&(R=B),D?o.default.createElement("option",{value:`${m.DEFAULT_ADD_CONFIGURATION_KEY}${L}`,key:`${m.DEFAULT_ADD_CONFIGURATION_KEY}${L}`,label:B},B):o.default.createElement(c.Option,{value:`${m.DEFAULT_ADD_CONFIGURATION_KEY}${L}`,key:`${m.DEFAULT_ADD_CONFIGURATION_KEY}${L}`,label:B},B)});return(D?[o.default.createElement("option",{disabled:!0,key:"--",value:R.replace(/./g,"-")},R.replace(/./g,"-"))]:[o.default.createElement(c.Option,{disabled:!0,key:"--",value:"",className:s.default.select_divider_container})]).concat(P)}else{const R=A;return D?[o.default.createElement("option",{disabled:!0,key:"--",value:R.replace(/./g,"-")},R.replace(/./g,"-")),o.default.createElement("option",{value:m.DEFAULT_ADD_CONFIGURATION_KEY,key:m.DEFAULT_ADD_CONFIGURATION_KEY,label:R},R),o.default.createElement("option",{value:m.DEFAULT_EDIT_CONFIGURATION_KEY,key:m.DEFAULT_EDIT_CONFIGURATION_KEY,label:S},S)]:[o.default.createElement(c.Option,{disabled:!0,key:"--",value:R.replace(/./g,"-"),className:s.default.select_divider_container}),o.default.createElement(c.Option,{value:m.DEFAULT_ADD_CONFIGURATION_KEY,key:m.DEFAULT_ADD_CONFIGURATION_KEY,label:R},R),o.default.createElement(c.Option,{value:m.DEFAULT_EDIT_CONFIGURATION_KEY,key:m.DEFAULT_EDIT_CONFIGURATION_KEY,label:S},S)]}},[y,A]),M=o.default.useCallback(R=>{if(!y&&R&&R.length)return R.map(k=>{const F=k.label||k.type,L=`${m.DEFAULT_DYNAMIC_CONFIGURATION_KEY}${k.type}`,{popupHint:B}=k;return D?o.default.createElement("option",{key:L,value:L,label:F},F):o.default.createElement(c.Option,{key:L,value:L,label:F},B?o.default.createElement(c.Popover,{id:`debug_configuration_pop_${L}`,title:B,overlayClassName:s.default.config_popover_insert},F):F)})},[y,a]);return D?o.default.createElement(v.Select,{value:E,onChange:b,className:(0,r.default)(s.default.debug_selection,s.default.special_radius)},I(f),O(),a&&M(a)):o.default.createElement(c.Select,{value:E,onChange:b,className:(0,r.default)(s.default.debug_selection,s.default.special_radius),allowOptionsOverflow:!0},I(f),O(),a&&M(a))});t.DebugActionBar=o.default.memo(({runDebug:E,openConfiguration:f,openDebugConsole:a})=>o.default.createElement("div",{className:s.default.debug_actions},o.default.createElement(_.DebugAction,{id:"debug.action.start",icon:"start",label:(0,p.localize)("debug.action.start"),run:E}),o.default.createElement(_.DebugAction,{id:"debug.action.open.configuration",icon:"setting",label:(0,p.localize)("debug.action.open.configuration"),run:f}),o.default.createElement(_.DebugAction,{id:"debug.action.debug.console",icon:"terminal",label:(0,p.localize)("debug.action.debug.console"),run:a})));const u=()=>{const E=(0,p.useInjectable)(g.DebugConfigurationService),f=(0,p.useAutorun)(E.float);return o.default.createElement(o.default.Fragment,null,o.default.createElement(t.DebugControllerView,{className:s.default.debug_configuration_container}),!f&&o.default.createElement(l.DebugToolbarView,{float:!1,className:s.default.debug_action_bar_internal}))};t.DebugConfigurationContainerView=u;const d=E=>{const{toValue:f,openConfiguration:a,addConfiguration:b,openDebugConsole:y,updateConfiguration:A,start:S,showDynamicQuickPick:w,currentValue:T,configurationOptions:D,dynamicConfigurations:I,isMultiRootWorkspace:O,workspaceRoots:M}=(0,p.useInjectable)(g.DebugConfigurationService),R=(0,p.useAutorun)(I),P=(0,p.useAutorun)(T),k=(0,p.useAutorun)(D),F=(0,p.useAutorun)(O),L=(0,p.useAutorun)(M),B=(0,p.useInjectable)(p.AppConfig),j=(0,p.localize)("debug.action.add.configuration"),W=(0,p.localize)("debug.action.edit.configuration"),{CustomActionBar:U}=E,Q=o.default.useCallback(V=>{let $;if(typeof V=="object"?$=V.target.value:$=V,$.startsWith(m.DEFAULT_ADD_CONFIGURATION_KEY)){const Y=$.slice(m.DEFAULT_ADD_CONFIGURATION_KEY.length);b(Y?M[Y]:M[0])}else if($===m.DEFAULT_EDIT_CONFIGURATION_KEY)a();else if($.startsWith(m.DEFAULT_DYNAMIC_CONFIGURATION_KEY)){const Y=$.slice(m.DEFAULT_DYNAMIC_CONFIGURATION_KEY.length);w(Y)}else{const[Y,z]=$.split(m.DEFAULT_CONFIGURATION_NAME_SEPARATOR),[H,K]=z.split(m.DEFAULT_CONFIGURATION_INDEX_SEPARATOR);A(Y,H,+K)}},[]);return o.default.createElement("div",{className:(0,r.default)(s.default.debug_configuration_toolbar,E.className||"")},o.default.createElement(h,{currentValue:P,options:k,dynamicOptions:R,workspaceRoots:L,isMultiRootWorkspace:F,onChangeConfiguration:Q,addConfigurationLabel:j,editConfigurationLabel:W,toValue:f,isElectronRenderer:B.isElectronRenderer}),U?o.default.createElement(U,null):o.default.createElement(t.DebugActionBar,{runDebug:S,openConfiguration:a,openDebugConsole:y}))};t.DebugControllerView=d},96090:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugToolbarService=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(93899),p=e(37406),v=e(28423),m=e(64582),_=e(32756);let s=class{constructor(){this.state=(0,v.observableValue)(this,m.DebugState.Inactive),this.currentSession=(0,v.observableValue)(this,void 0),this.sessions=(0,v.observableValue)(this,[]),this.toolBarMenuMap=new Map,this.doStart=async()=>await this.model.start(),this.doRestart=async()=>{const l=this.instrumentReporter("restart"),h=await this.model.restart();return l(),h},this.doStop=async()=>{if(!this.model.currentSession)return;const l=this.instrumentReporter("stop"),h=await this.model.currentSession.terminate();return l(),h},this.doContinue=async()=>{if(!this.model.currentThread)return;const l=this.instrumentReporter("continue"),h=await this.model.currentThread.continue();return l(),h},this.doPause=async()=>{if(!this.model.currentThread)return;const l=this.instrumentReporter("pause"),h=await this.model.currentThread.pause();return l(),h},this.doStepOver=async()=>{if(!this.model.currentThread)return;const l=this.instrumentReporter("stepOver"),h=await this.model.currentThread.stepOver();return l(),h},this.doStepIn=async()=>{if(!this.model.currentThread)return;const l=this.instrumentReporter("stepIn"),h=await this.model.currentThread.stepIn();return l(),h},this.doStepOut=async()=>{if(!this.model.currentThread)return;const l=this.instrumentReporter("stepOut"),h=await this.model.currentThread.stepOut();return l(),h},this.updateCurrentSession=l=>{this.model.currentSession=l},this.model.onDidChange(()=>{this.updateToolBarMenu(),this.updateModel()})}get mainUIService(){return this.injector.get(p.IElectronMainUIService)}updateModel(){(0,v.transaction)(l=>{this.state.set(this.model.state,l),this.currentSession.set(this.model.currentSession,l),this.sessions.set(Array.from(this.model.sessions).filter(h=>h&&h.state>m.DebugState.Inactive),l)})}updateToolBarMenu(){const l=this.currentSession.get();if(l&&l.id&&!this.toolBarMenuMap.has(l.id)){const h=this.contextMenuService.createMenu({id:c.MenuId.DebugToolBar,contextKeyService:this.contextKeyService.createScoped()});l.on("terminated",()=>{this.toolBarMenuMap.delete(l.id)}),this.toolBarMenuMap.set(l.id,h)}}instrumentReporter(l){var h,u,d,E;const f=this.model.currentSession,a=(h=f.configuration)===null||h===void 0?void 0:h.type,b=this.model.currentThread,y=(u=b?.raw)===null||u===void 0?void 0:u.id;this.model.reportAction(f.id,y,l);const A={type:a,request:(E=(d=this.currentSession.get())===null||d===void 0?void 0:d.configuration)===null||E===void 0?void 0:E.request,sessionId:f.id,threadId:y};this.model.report(m.DEBUG_REPORT_NAME.DEBUG_TOOLBAR_OPERATION,l,A);const S=this.model.reportTime(m.DEBUG_REPORT_NAME.DEBUG_TOOLBAR_OPERATION_TIME,A);return()=>{S(l)}}};t.DebugToolbarService=s,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],s.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(c.AbstractContextMenuService),n.__metadata("design:type",c.AbstractContextMenuService)],s.prototype,"contextMenuService",void 0),n.__decorate([(0,r.Autowired)(_.DebugViewModel),n.__metadata("design:type",_.DebugViewModel)],s.prototype,"model",void 0),n.__decorate([(0,r.Autowired)(o.IReporterService),n.__metadata("design:type",Object)],s.prototype,"reporterService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],s.prototype,"injector",void 0),n.__decorate([o.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],s.prototype,"mainUIService",null),t.DebugToolbarService=s=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],s)},84784:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugToolbarOverlayWidget=t.DebugToolbarView=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(76003),p=e(97267),v=e(41869),m=e(25918),_=e(77331),s=e(1149),g=e(28423),l=e(64582),h=e(66498),u=e(5905),d=n.__importDefault(e(90463)),E=e(16067),f=e(96090);let a=class{constructor(){this._x=(0,g.observableValue)(this,0),this._line=(0,g.observableValue)(this,0),this._enable=(0,g.observableValue)(this,!1),this.y=0,this.last=0,this.origin=0,this.state=(0,g.derived)(this,D=>({enable:this._enable.read(D),x:this._x.read(D),line:this._line.read(D)}))}setEnable(D){(0,g.transaction)(I=>{this._enable.set(D,I)})}onMouseDown(D){this.setEnable(!0),this.y=D.clientY,this.origin=D.clientX}onMouseMove(D){D.stopPropagation(),(0,g.transaction)(I=>{this._enable.get()&&(this._x.set(D.clientX-this.origin+this.last,I),this._line.set(D.clientY-this.y>10?1:0,I))})}onMouseUp(){this.setEnable(!1),this.last=this._x.get()}};a=n.__decorate([(0,c.Injectable)()],a);const b=T=>{var D;const{state:I,toolBarMenuMap:O,doStop:M,doStepIn:R,doStepOut:P,doStepOver:k,doContinue:F,doRestart:L,doPause:B,currentSession:j,sessions:W,updateCurrentSession:U}=(0,v.useInjectable)(f.DebugToolbarService),Q=(0,v.useAutorun)(I),V=(0,v.useAutorun)(j),$=(0,v.useAutorun)(W),{isElectronRenderer:Y}=(0,v.useInjectable)(v.AppConfig),z=!!V&&((D=V.configuration)===null||D===void 0?void 0:D.request)==="attach"&&!(0,u.isExtensionHostDebugging)(V.configuration),H=V&&V.id,K=(0,o.useCallback)(pe=>{if(pe&&pe.id){const q=O.get(pe.id);if(q)return o.default.createElement(m.InlineMenuBar,{menus:q})}return null},[O]),Z=(0,o.useCallback)(pe=>z?o.default.createElement(h.DebugAction,{run:M,enabled:pe!==l.DebugState.Inactive,icon:"disconnect",label:(0,v.localize)("debug.action.disattach")}):o.default.createElement(h.DebugAction,{run:M,enabled:pe!==l.DebugState.Inactive,icon:"stop",label:(0,v.localize)("debug.action.stop")}),[M]),X=(0,o.useCallback)(pe=>pe===l.DebugState.Stopped?o.default.createElement(h.DebugAction,{run:F,icon:"continue",label:(0,v.localize)("debug.action.continue")}):o.default.createElement(h.DebugAction,{run:B,enabled:Q===l.DebugState.Running,icon:"pause",label:(0,v.localize)("debug.action.pause")}),[B,F]),ie=(0,o.useCallback)(pe=>pe.map(q=>Y?o.default.createElement("option",{key:q.id,value:q.id},q.label):o.default.createElement(p.Option,{key:q.id,label:q.label,value:q.id},q.label)),[]),oe=(0,o.useCallback)(pe=>{if(pe.length>1)return o.default.createElement("div",{className:(0,r.default)(d.default.debug_selection)},Y?o.default.createElement(_.Select,{value:H,onChange:le},ie(pe)):o.default.createElement(p.Select,{className:(0,r.default)(d.default.debug_selection,d.default.special_radius),size:T.float?"small":"default",value:H,options:pe.map(q=>({label:q.label,value:q.id})),onChange:le},ie(pe)))},[H]),le=(0,o.useCallback)(pe=>{let q=pe;if(Y&&(q=pe.target.value),!!$)for(const Ee of $)Ee.id===q&&U(Ee)},[$,U]);return o.default.createElement("div",{className:(0,r.default)(d.default.debug_action_bar,T.className||"")},oe($.filter(pe=>!pe.parentSession)),o.default.createElement("div",{className:d.default.debug_actions},X(Q),o.default.createElement(h.DebugAction,{run:k,enabled:Q===l.DebugState.Stopped,icon:"step",label:(0,v.localize)("debug.action.step-over")}),o.default.createElement(h.DebugAction,{run:R,enabled:Q===l.DebugState.Stopped,icon:"step-in",label:(0,v.localize)("debug.action.step-into")}),o.default.createElement(h.DebugAction,{run:P,enabled:Q===l.DebugState.Stopped,icon:"step-out",label:(0,v.localize)("debug.action.step-out")}),o.default.createElement(h.DebugAction,{run:L,enabled:Q!==l.DebugState.Inactive,icon:"reload",label:(0,v.localize)("debug.action.restart")}),Z(Q),K(V)))};t.DebugToolbarView=b;const y="debug.toolbar.top",A="debug.toolbar.height",S=()=>{const T=(0,v.useInjectable)(v.PreferenceService),{isElectronRenderer:D}=(0,v.useInjectable)(v.AppConfig),I=(0,v.useInjectable)(s.LayoutViewSizeConfig),O=(0,v.useDesignStyles)(d.default.debug_toolbar_wrapper,"debug_toolbar_wrapper"),[M,R]=(0,o.useState)(0),P=(0,v.useInjectable)(a),k=(0,v.useAutorun)(P.state),F=(0,v.useInjectable)(f.DebugToolbarService),L=(0,v.useAutorun)(F.state);(0,o.useEffect)(()=>{const W=new v.DisposableCollection,U=T.get(y)||0;if(D){const Q=F.mainUIService;Q.isFullScreen(v.electronEnv.currentWindowId).then(V=>{R(V?U:U+I.calcOnlyTitleBarHeight())}),W.push(Q.on("fullScreenStatusChange",(V,$)=>{V===v.electronEnv.currentWindowId&&R($?U:U+I.calcOnlyTitleBarHeight())}))}else R(U);return()=>{W.dispose()}},[]);const B=T.get(A)||0,j=(0,r.default)({[O]:!0,[d.default.debug_toolbar_wrapper_electron]:D});return L?o.default.createElement("div",{style:{pointerEvents:k.enable?"all":"none"},className:d.default.debug_toolbar_container,onMouseMove:W=>P.onMouseMove(W),onMouseUp:W=>P.onMouseUp()},o.default.createElement("div",{style:{transform:`translateX(${k.x}px) translateY(${M+k.line*B}px)`,height:`${B}px`},className:j},o.default.createElement("div",{className:(0,r.default)(d.default.debug_toolbar_drag_wrapper)},o.default.createElement("div",{className:(0,r.default)((0,v.getIcon)("drag"),d.default.debug_toolbar_drag),onMouseDown:W=>P.onMouseDown(W),onMouseMove:W=>P.onMouseMove(W)})),o.default.createElement(t.DebugToolbarView,{float:!0}))):(P.setEnable(!1),null)},w=()=>{const T=(0,v.useInjectable)(E.DebugConfigurationService);return(0,v.useAutorun)(T.float)?o.default.createElement(S,null):null};t.DebugToolbarOverlayWidget=w},53378:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConsoleFilterModel=void 0;const r=e(85608),o=e(76003),c=e(41869);let p=n=class{constructor(){this._parsedQueries=[]}set filterQuery(m){if(this._parsedQueries=[],m=m.trim(),m&&m!==""){const _=(0,c.splitGlobAware)(m,",").map(s=>s.trim()).filter(s=>!!s.length);for(const s of _)s.startsWith("!")?this._parsedQueries.push({type:"exclude",query:s.slice(1)}):this._parsedQueries.push({type:"include",query:s})}}filter(m){let _=!1,s=!1;for(const{type:g,query:l}of this._parsedQueries){if(g==="exclude"&&n.matchQuery(l,m))return!1;g==="include"&&(_=!0,n.matchQuery(l,m)&&(s=!0))}return _&&s}};t.DebugConsoleFilterModel=p,p.matchQuery=c.matchesFuzzy,t.DebugConsoleFilterModel=p=n=r.__decorate([(0,o.Injectable)({multiple:!0})],p)},1276:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConsoleFilterService=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(5905),p=e(53378),v=e(62665),{convertSimple2RegExpPattern:m}=o.strings;let _=class{constructor(){this._onDidValueChange=new o.Emitter,this._onDidFocus=new o.Emitter,this._filterText="",this.filterModel=new p.DebugConsoleFilterModel}get onDidValueChange(){return this._onDidValueChange.event}get onDidFocus(){return this._onDidFocus.event}focusInput(){this._onDidFocus.fire()}get filterText(){return this._filterText}setFilterText(g){return this._filterText!==g&&(this._filterText=g,this.filterModel.filterQuery=this._filterText,this._onDidValueChange.fire(this._filterText)),this}filter(g){const l=v.ansiToText(g);return this._filterText===""||this.filterModel.filter(l)}findMatches(g){const l=new RegExp(m(this._filterText.toLowerCase()),"g");if(this._filterText.trim()==="")return[];const h=(0,c.matchAll)(g.toLowerCase(),l),u=this._filterText.length;return u===0?[]:h.map(E=>({startIndex:E.index!==void 0?E.index:-1,count:u})).filter(E=>E.startIndex>=0)}};t.DebugConsoleFilterService=_,t.DebugConsoleFilterService=_=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],_)},4161:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConsoleFilterView=void 0;const n=e(85608),r=n.__importDefault(e(12784)),o=n.__importDefault(e(14041)),c=e(15857),p=e(41869),v=e(1276),m=n.__importDefault(e(80315)),_=()=>{const s=(0,p.useInjectable)(v.DebugConsoleFilterService),[g,l]=o.default.useState(""),[h,u]=o.default.useState(),d=(0,p.useDesignStyles)(m.default.debug_console_filter,"debug_console_filter"),E=(0,p.useDesignStyles)(m.default.filter_input,"filter_input"),f=(0,r.default)(y=>{l(y),s.setFilterText(y),h&&h.addToHistory(y)},400);o.default.useEffect(()=>{const y=s.onDidValueChange(A=>{l(A)});return()=>{y.dispose()}},[]);const a=y=>{u(y)},b=y=>{h&&(y.keyCode===p.Key.ARROW_UP.keyCode?h.showPreviousValue():y.keyCode===p.Key.ARROW_DOWN.keyCode&&h.showNextValue())};return o.default.useEffect(()=>{const y=s.onDidFocus(()=>{h&&h.focus()});return()=>{y.dispose()}},[h]),o.default.createElement("div",{className:d},o.default.createElement(c.HistoryInputBox,{hasClear:!0,className:E,value:g,placeholder:(0,p.localize)("debug.console.filter.placeholder"),onValueChange:f,onReady:a,onKeyDown:b}))};t.DebugConsoleFilterView=_},80390:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConsoleTreeModel=void 0;const r=e(85608),o=e(76003),c=e(97267),p=e(41869),v=e(98650);let m=n=class extends c.TreeModel{constructor(s){super(),this.flushDispatchChangeDelayer=new p.ThrottledDelayer(n.DEFAULT_FLUSH_DELAY),this._tempScrollOffset=0,this.init(s)}get isScrollBottom(){return this._tempScrollOffset=Math.max(this.state.scrollOffset,this._tempScrollOffset),this._tempScrollOffset===this.state.scrollOffset}init(s){this.root=s,this.root.watcher.on(c.TreeNodeEvent.BranchDidUpdate,()=>{this.flushDispatchChangeDelayer.isTriggered()||this.flushDispatchChangeDelayer.cancel(),this.flushDispatchChangeDelayer.trigger(async()=>{this.dispatchChange()})})}};t.DebugConsoleTreeModel=m,m.DEFAULT_FLUSH_DELAY=100,t.DebugConsoleTreeModel=m=n=r.__decorate([(0,o.Injectable)({multiple:!0}),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[v.ExpressionContainer])],m)},75563:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DebugConsoleSession=void 0;const n=e(85608),r=n.__importDefault(e(97331)),o=e(76003),c=e(43718),p=e(52416),v=e(92679),m=e(58542),_=e(29539),s=e(16170),g=e(80390);let l=class{constructor(u,d){this.session=u,this.treeModel=d,this.toDispose=new c.DisposableCollection,this.fireDidChange=(0,r.default)(()=>this.onDidChangeEmitter.fire(),50),this.onDidChangeEmitter=new c.Emitter,this.init()}resolveChildren(){return(this.treeModel.root.flattenedBranch||[]).map(d=>this.treeModel.root.getTreeNodeById(d))}getLastItem(){const{flattenedBranch:u}=this.treeModel.root,d=u?.length?u[u.length-1]:void 0;return d?this.treeModel.root.getTreeNodeById(d):void 0}init(){this.toDispose.push(this.session.on("output",u=>this.logOutput(this.session,u)))}addChildSession(u){this.toDispose.push(u.on("output",d=>this.logOutput(u,d)))}get onDidChange(){return this.onDidChangeEmitter.event}clear(){this.fireDidChange()}async logOutput(u,d){var E;const f="\x1B[2J",a=d.body,{category:b,variablesReference:y,source:A,line:S}=a;if(!this.treeModel)return;const w=b==="stderr"?c.MessageType.Error:b==="stdout"?c.MessageType.Info:b==="console"?c.MessageType.Warning:c.MessageType.Info;if(b==="telemetry"){this.logger.debug(`telemetry/${d.body.output}`,d.body.data);return}if(y){const T=new s.DebugConsoleNode({session:u,variablesReference:y,source:A,line:S},"",(E=this.treeModel)===null||E===void 0?void 0:E.root);await T.evaluate(),this.treeModel.root.insertItem(T)}else if(typeof a.output=="string"){let T=a.output;T.indexOf(f)>=0&&(this.clearConsole(),await this.insertItemWithAnsi((0,c.localize)("debug.console.consoleCleare"),c.MessageType.Info),T=T.substring(T.lastIndexOf(f)+f.length));const D=this.getLastItem();D&&!D.description.endsWith(`
|
|
31521
31521
|
`)&&!D.description.endsWith(`\r
|