@opensumi/cli-engine 3.6.5-next-1736232455.0 → 3.6.5-next-1736238377.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 +1 -1
- package/package.json +10 -10
package/lib/browser/browser.js
CHANGED
|
@@ -28417,7 +28417,7 @@ Tokenizing line: ${O}`);for(let K=0;K<N.tokens.length;K++){const U=N.tokens[K];j
|
|
|
28417
28417
|
|
|
28418
28418
|
`),this}appendMarkdown(s){return this.value+=s,this}appendCodeblock(s,h){return this.value+="\n```",this.value+=s,this.value+=`
|
|
28419
28419
|
`,this.value+=h,this.value+="\n```\n",this}}t.MarkdownString=m;function E(v){return v instanceof m?!0:v&&typeof v=="object"?typeof v.value=="string"&&(typeof v.isTrusted=="boolean"||v.isTrusted===void 0)&&(typeof v.supportThemeIcons=="boolean"||v.supportThemeIcons===void 0):!1}function p(v){const s=[],h=v.split("|").map(g=>g.trim());v=h[0];const c=h[1];if(c){const g=/height=(\d+)/.exec(c),d=/width=(\d+)/.exec(c),u=g?g[1]:"",_=d?d[1]:"",f=isFinite(parseInt(_,10)),a=isFinite(parseInt(u,10));f&&s.push(`width="${_}"`),a&&s.push(`height="${u}"`)}return{href:v,dimensions:s}}},53886:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(84811),t),n.__exportStar(e(38677),t),n.__exportStar(e(32112),t),n.__exportStar(e(58063),t),n.__exportStar(e(3484),t),n.__exportStar(e(84569),t),n.__exportStar(e(92771),t),n.__exportStar(e(87330),t),n.__exportStar(e(37070),t),n.__exportStar(e(32504),t),n.__exportStar(e(78941),t),n.__exportStar(e(69403),t)},32112:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},69403:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OverviewRulerLane=void 0;var e;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(e||(t.OverviewRulerLane=e={}))},58063:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3484:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},92771:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},51418:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},73294:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},50288:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},37846:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.knownProtocols=void 0;const n=e(11431),r=e(46147);t.knownProtocols=new Map,t.knownProtocols.set(r.ExtHostAPIIdentifier.ExtHostDocuments,n.ExtensionDocumentProtocol)},35250:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectIdentifier=void 0;var e;(function(n){n.name="$ident";function r(l,m){return Object.defineProperty(l,n.name,{value:m,enumerable:!0}),l}n.mixin=r;function o(l){return l[n.name]}n.of=o})(e||(t.ObjectIdentifier=e={}))},16363:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},70858:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isLittleEndian=m,t.encodeSemanticTokensDto=E,t.decodeSemanticTokensDto=v;function e(s){for(let h=0,c=s.length;h<c;h+=4){const g=s[h+0],d=s[h+1],u=s[h+2],_=s[h+3];s[h+0]=_,s[h+1]=u,s[h+2]=d,s[h+3]=g}}function n(s){const h=new Uint8Array(s.buffer,s.byteOffset,s.length*4);return m()||e(h),h}function r(s){const h=s;if(m()||e(h),h.byteOffset%4===0)return new Uint32Array(h.buffer,h.byteOffset,h.length/4);{const c=new Uint8Array(h.byteLength);return c.set(h),new Uint32Array(c.buffer,c.byteOffset,c.length/4)}}let o=!0,l=!1;function m(){if(!l){l=!0;const s=new Uint8Array(2);s[0]=1,s[1]=2,o=new Uint16Array(s.buffer)[0]===513}return o}function E(s){const h=new Uint32Array(p(s));let c=0;if(h[c++]=s.id,s.type==="full")h[c++]=1,h[c++]=s.data.length,h.set(s.data,c),c+=s.data.length;else{h[c++]=2,h[c++]=s.deltas.length;for(const g of s.deltas)h[c++]=g.start,h[c++]=g.deleteCount,g.data?(h[c++]=g.data.length,h.set(g.data,c),c+=g.data.length):h[c++]=0}return n(h)}function p(s){let h=0;if(h+=2,s.type==="full")h+=1+s.data.length;else{h+=1,h+=3*s.deltas.length;for(const c of s.deltas)c.data&&(h+=c.data.length)}return h}function v(s){const h=r(s);let c=0;const g=h[c++];if(h[c++]===1){const f=h[c++],a=h.subarray(c,c+f);return c+=f,{id:g,type:"full",data:a}}const u=h[c++],_=[];for(let f=0;f<u;f++){const a=h[c++],b=h[c++],y=h[c++];let S;y>0&&(S=h.subarray(c,c+y),c+=y),_[f]={start:a,deleteCount:b,data:S}}return{id:g,type:"delta",deltas:_}}},29490:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},89225:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.startsWith=e,t.endsWith=n,t.isLowerAsciiLetter=r,t.isUpperAsciiLetter=o,t.equalsIgnoreCase=m,t.escapeRegExpCharacters=p,t.startsWithIgnoreCase=v;function e(s,h){if(s.length<h.length)return!1;if(s===h)return!0;for(let c=0;c<h.length;c++)if(s[c]!==h[c])return!1;return!0}function n(s,h){const c=s.length-h.length;return c>0?s.indexOf(h,c)===c:c===0?s===h:!1}function r(s){return s>=97&&s<=122}function o(s){return s>=65&&s<=90}function l(s){return r(s)||o(s)}function m(s,h){const c=s?s.length:0,g=h?h.length:0;return c!==g?!1:E(s,h)}function E(s,h,c=s.length){if(typeof s!="string"||typeof h!="string")return!1;for(let g=0;g<c;g++){const d=s.charCodeAt(g),u=h.charCodeAt(g);if(d!==u){if(l(d)&&l(u)){const _=Math.abs(d-u);if(_!==0&&_!==32)return!1}else if(String.fromCharCode(d).toLowerCase()!==String.fromCharCode(u).toLowerCase())return!1}}return!0}function p(s){return s.replace(/[-\\{}*+?|^$.[\]()#]/g,"\\$&")}function v(s,h){const c=h.length;return h.length>s.length?!1:E(s,h,c)}},54741:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskFilterDTO=void 0;var e;(function(n){function r(l){return l}n.from=r;function o(l){if(l)return Object.assign(Object.create(null),l)}n.to=o})(e||(t.TaskFilterDTO=e={}))},25535:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},54056:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TestItemRootImpl=t.TestItemImpl=t.MixedTestItemController=t.InvalidTestItemError=t.DuplicateTestItemError=t.diffTestItems=t.getPrivateApiFor=t.createPrivateApiFor=void 0;const e=new WeakMap,n=(_,f)=>{const a={controllerId:f};return e.set(_,a),a};t.createPrivateApiFor=n;const r=_=>e.get(_);t.getPrivateApiFor=r;const o=(_,f,a,b)=>{let y=a;return{enumerable:!0,configurable:!1,get(){return y},set(S){var A;if(!b(y,S)){const w=y;y=S,(A=_.listener)===null||A===void 0||A.call(_,{op:3,key:f,value:S,previous:w})}}}},l=(_,f)=>_===f,m={range:(_,f)=>_===f?!0:!_||!f?!1:_.isEqual(f),label:l,description:l,sortText:l,busy:l,error:l,canResolveChildren:l,tags:(_,f)=>!(_.length!==f.length||_.some(a=>!f.find(b=>a.id===b.id)))},E=Object.keys(m),p=(_,f)=>({range:o(_,"range",void 0,m.range),label:o(_,"label",f,m.label),description:o(_,"description",void 0,m.description),sortText:o(_,"sortText",void 0,m.sortText),canResolveChildren:o(_,"canResolveChildren",!1,m.canResolveChildren),busy:o(_,"busy",!1,m.busy),error:o(_,"error",void 0,m.error),tags:o(_,"tags",[],m.tags)}),v=(_,f)=>{const a=new Map;for(const b of E){const y=m[b];y(_[b],f[b])||a.set(b,f[b])}return a};t.diffTestItems=v;class s extends Error{constructor(f){super(`Attempted to insert a duplicate test item ID ${f}`)}}t.DuplicateTestItemError=s;class h extends Error{constructor(f){super(`TestItem with ID "${f}" is invalid. Make sure to create it from the createTestItem method.`)}}t.InvalidTestItemError=h;class c extends Error{constructor(f,a,b){super(`TestItem with ID "${f}" is from controller "${a}" and cannot be added as a child of an item from controller "${b}".`)}}t.MixedTestItemController=c;const g=_=>{const f=(0,t.getPrivateApiFor)(_);let a=new Map;return{get size(){return a.size},forEach(b,y){for(const S of a.values())b.call(y,S,this)},replace(b){var y;const S=new Map,A=new Set(a.keys()),w={op:4,ops:[]};for(const T of b){if(!(T instanceof d))throw new h(T.id);const D=(0,t.getPrivateApiFor)(T).controllerId;if(D!==f.controllerId)throw new c(T.id,D,f.controllerId);if(S.has(T.id))throw new s(T.id);S.set(T.id,T),A.delete(T.id),w.ops.push({op:0,item:T})}for(const T of A.keys())w.ops.push({op:1,id:T});(y=f.listener)===null||y===void 0||y.call(f,w),a=S},add(b){var y;if(!(b instanceof d))throw new h(b.id);a.set(b.id,b),(y=f.listener)===null||y===void 0||y.call(f,{op:0,item:b})},delete(b){var y;a.delete(b)&&((y=f.listener)===null||y===void 0||y.call(f,{op:1,id:b}))},get(b){return a.get(b)},toJSON(){return Array.from(a.values())},[Symbol.iterator](){return a.values()}}};class d{constructor(f,a,b,y){if(a.includes("\0"))throw new Error(`Test IDs may not include the ${JSON.stringify(a)} symbol`);const S=(0,t.createPrivateApiFor)(this,f);Object.defineProperties(this,{id:{value:a,enumerable:!0,writable:!1},uri:{value:y,enumerable:!0,writable:!1},parent:{enumerable:!1,get(){return S.parent instanceof u?void 0:S.parent}},children:{value:g(this),enumerable:!0,writable:!1},...p(S,b)})}invalidateResults(){var f,a;(a=(f=(0,t.getPrivateApiFor)(this)).listener)===null||a===void 0||a.call(f,{op:2})}}t.TestItemImpl=d;class u extends d{constructor(f,a){super(f,f,a,void 0)}}t.TestItemRootImpl=u},82086:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4809:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},86162:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TreeviewsService=t.ITreeViewsService=t.TreeViewSelection=t.TreeViewItem=t.TreeItemCheckboxState=void 0;var e;(function(l){l[l.Unchecked=0]="Unchecked",l[l.Checked=1]="Checked"})(e||(t.TreeItemCheckboxState=e={}));class n{}t.TreeViewItem=n;var r;(function(l){function m(E){return!!E&&typeof E=="object"&&"treeViewId"in E&&"treeItemId"in E}l.is=m})(r||(t.TreeViewSelection=r={})),t.ITreeViewsService=Symbol("ITreeViewsService");class o{constructor(){this._dragOperations=new Map,this._renderedElements=new Map}removeDragOperationTransfer(m){if(m&&this._dragOperations.has(m)){const E=this._dragOperations.get(m);return this._dragOperations.delete(m),E}}addDragOperationTransfer(m,E){this._dragOperations.set(m,E)}getRenderedTreeElement(m){if(this._renderedElements.has(m))return this._renderedElements.get(m)}addRenderedTreeItemElement(m,E){this._renderedElements.set(m,E)}removeRenderedTreeItemElement(m){this._renderedElements.has(m)&&this._renderedElements.delete(m)}}t.TreeviewsService=o},64945:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43710:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=o,t.mixin=l,t.illegalArgument=m,t.isLocationArray=E,t.isDefinitionLinkArray=p,t.reviveRegExp=v,t.reviveIndentationRule=s,t.reviveOnEnterRule=h,t.reviveOnEnterRules=c,t.serializeEnterRules=g,t.serializeRegExp=d,t.serializeIndentation=u,t.serializeAutoClosingPairs=_;const r=e(85608).__importStar(e(51328));function o(f){return typeof f=="object"&&f!==null&&!Array.isArray(f)&&!(f instanceof RegExp)&&!(f instanceof Date)}function l(f,a,b=!0){return o(f)?(o(a)&&Object.keys(a).forEach(y=>{y in f?b&&(o(f[y])&&o(a[y])?l(f[y],a[y],b):f[y]=a[y]):f[y]=a[y]}),f):a}function m(f){return f?new Error(`Illegal argument: ${f}`):new Error("Illegal argument")}function E(f){return Array.isArray(f)&&f.length>0&&f[0]instanceof r.Location}function p(f){return Array.isArray(f)&&f.length>0&&f[0].hasOwnProperty("targetUri")&&f[0].hasOwnProperty("targetRange")}function v(f){if(!(typeof f>"u"||f===null))return new RegExp(f.pattern,f.flags)}function s(f){if(!(typeof f>"u"||f===null))return{increaseIndentPattern:v(f.increaseIndentPattern),decreaseIndentPattern:v(f.decreaseIndentPattern),indentNextLinePattern:v(f.indentNextLinePattern),unIndentedLinePattern:v(f.unIndentedLinePattern)}}function h(f){return{beforeText:v(f.beforeText),afterText:v(f.afterText),action:f.action,previousLineText:v(f.previousLineText)}}function c(f){if(!(typeof f>"u"||f===null))return f.map(h)}function g(f){if(!(typeof f>"u"||f===null))return f.map(a=>({action:a.action,beforeText:d(a.beforeText),afterText:d(a.afterText),previousLineText:d(a.previousLineText)}))}function d(f){if(!(typeof f>"u"||f===null))return{pattern:f.source,flags:(f.global?"g":"")+(f.ignoreCase?"i":"")+(f.multiline?"m":"")}}function u(f){if(!(typeof f>"u"||f===null))return{increaseIndentPattern:d(f.increaseIndentPattern),decreaseIndentPattern:d(f.decreaseIndentPattern),indentNextLinePattern:d(f.indentNextLinePattern),unIndentedLinePattern:d(f.unIndentedLinePattern)}}function _(f){if(f)return f.map(a=>({open:a.open,close:a.close,notIn:a.notIn?a.notIn.map(b=>r.SyntaxTokenType.toString(b)):void 0}))}},96833:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},98116:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebviewViewResolverRegistrationRemovalEvent=t.WebviewViewResolverRegistrationEvent=void 0;const n=e(43718);class r extends n.BasicEvent{}t.WebviewViewResolverRegistrationEvent=r;class o extends n.BasicEvent{}t.WebviewViewResolverRegistrationRemovalEvent=o},55467:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},92622:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationTarget=void 0,t.reviveWorkspaceEditDto=o;const n=e(43718);var r;(function(l){l[l.Global=1]="Global",l[l.Workspace=2]="Workspace",l[l.WorkspaceFolder=3]="WorkspaceFolder"})(r||(t.ConfigurationTarget=r={}));function o(l){if(l&&l.edits)for(const m of l.edits)if(typeof m.resource=="object")m.resource=n.URI.from(m.resource),m.options={openDirtyInEditor:!0},m.textEdit=m.textEdit,m.versionId=m.versionId;else{const E=m;E.newResource=m.newResource?n.URI.from(m.newResource):void 0,E.oldResource=m.oldResource?n.URI.from(m.oldResource):void 0,E.options={...E.options,showInEditor:!1}}return l}},57646:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BinaryEditorComponent=void 0;const r=e(85608).__importDefault(e(14041)),o=e(76003),l=e(41869),m=e(37406),E=e(57517),p=e(88819),v=s=>{const h=s.resource.uri.codeUri.fsPath,c=(0,l.useInjectable)(o.INJECTOR_TOKEN),g=(0,l.useInjectable)(l.AppConfig),d=(0,l.useInjectable)(E.WorkbenchEditorService),u=(0,l.useInjectable)(l.IEventBus),_=()=>{const a=d.currentResource;a&&(a.metadata={...a.metadata,skipPreventBinary:!0},u.fire(new E.ResourceOpenTypeChangedEvent(a.uri)))},f=[{label:(0,l.localize)("editor.file.prevent.stillOpen"),onClick:()=>_()}];return g.isElectronRenderer&&f.push({label:(0,l.localize)("editor.openExternal"),onClick:()=>c.get(m.IElectronMainUIService).openPath(h)}),r.default.createElement(p.PreventComponent,{description:(0,l.localize)("editor.cannotOpenBinary"),actions:f})};t.BinaryEditorComponent=v},60387:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalkThroughSnippetSchemeDocumentProvider=t.VscodeSchemeDocumentProvider=t.FileSchemeDocumentProvider=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(96405),m=e(68692),E=e(14951),p=e(80449);let v=class extends m.BaseFileSystemEditorDocumentProvider{handlesUri(g){return g.scheme===o.Schemes.file?20:-1}handlesScheme(){return!1}provideEncoding(g){return super.provideEncoding(g)}preferLanguageForUri(g){if(["settings.json"].includes(g.path.base))return"jsonc"}async saveDocumentModel(g,d,u,_,f,a=!1,b=`
|
|
28420
|
-
`,y){const S=this.hashCalculateService.calculate(u);return d.length>p.FILE_SAVE_BY_CHANGE_THRESHOLD?await this.fileSchemeDocClient.saveByChange(g.toString(),{baseMd5:S,changes:_,eol:b},f,a,y):await this.fileSchemeDocClient.saveByContent(g.toString(),{baseMd5:S,content:d},f,a,y)}async provideEditorDocumentModelContentMd5(g,d){return this.fileSchemeDocClient.getMd5(g.toString(),d)}};t.FileSchemeDocumentProvider=v,n.__decorate([(0,r.Autowired)(E.IFileServiceClient),n.__metadata("design:type",Object)],v.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(p.IFileSchemeDocClient),n.__metadata("design:type",Object)],v.prototype,"fileSchemeDocClient",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],v.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(l.IHashCalculateService),n.__metadata("design:type",Object)],v.prototype,"hashCalculateService",void 0),t.FileSchemeDocumentProvider=v=n.__decorate([(0,r.Injectable)()],v);let s=class{constructor(){this._onDidChangeContent=new o.Emitter,this.onDidChangeContent=this._onDidChangeContent.event,this.listeners={}}isReadonly(g){return!0}handlesScheme(g){return g==="vscode"}async provideEditorDocumentModelContent(g,d){return this.getSchemaContent(g)}getSchemaContent(g){const d=g.toString(),u=this.jsonRegistry.getSchemaContributions().schemas[d];if(u){const _=JSON.stringify(u);if(!this.listeners[d]){const f=o.Disposable.create(()=>{this.jsonRegistry.onDidChangeSchema(a=>{a===d&&this._onDidChangeContent.fire(g)})});this.listeners[d]=f}return _}return"{}"}onDidDisposeModel(g){g.toString()&&(this.listeners[g.toString()].dispose(),delete this.listeners[g.toString()])}};t.VscodeSchemeDocumentProvider=s,n.__decorate([(0,r.Autowired)(o.ISchemaStore),n.__metadata("design:type",Object)],s.prototype,"schemaStore",void 0),n.__decorate([(0,r.Autowired)(o.IJSONSchemaRegistry),n.__metadata("design:type",Object)],s.prototype,"jsonRegistry",void 0),t.VscodeSchemeDocumentProvider=s=n.__decorate([(0,r.Injectable)()],s);let h=class{constructor(){this.documentContentMaps=new Map,this._onDidChangeContent=new o.Emitter,this.onDidChangeContent=this._onDidChangeContent.event}handlesScheme(g){return g===o.Schemes.walkThroughSnippet}provideEditorDocumentModelContent(g,d){return this.documentContentMaps.has(g.toString())||this.documentContentMaps.set(g.toString(),""),this.documentContentMaps.get(g.toString())}isReadonly(){return!1}preferLanguageForUri(){return"plaintext"}};t.WalkThroughSnippetSchemeDocumentProvider=h,t.WalkThroughSnippetSchemeDocumentProvider=h=n.__decorate([(0,r.Injectable)()],h)},41352:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSchemeDocClientService=void 0;const n=e(85608),r=e(76003),o=e(80449);let l=class{saveByChange(E,p,v,s,h){return this.fileDocBackendService.$saveByChange(E,p,v,s,h)}saveByContent(E,p,v,s,h){return this.fileDocBackendService.$saveByContent(E,p,v,s,h)}getMd5(E,p){return this.fileDocBackendService.$getMd5(E,p)}};t.FileSchemeDocClientService=l,n.__decorate([(0,r.Autowired)(o.FileSchemeDocNodeServicePath),n.__metadata("design:type",Object)],l.prototype,"fileDocBackendService",void 0),t.FileSchemeDocClientService=l=n.__decorate([(0,r.Injectable)()],l)},17276:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSystemEditorComponentContribution=t.FileSystemEditorResourceContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(26542),m=e(57517),E=e(17878),p=e(42933),v=e(57646),s=e(60387),h=e(88819),c=e(99025),g="video-preview",d="image-preview",u="external-file",_="large-file-prevent";let f=class{registerResource(y){y.registerResourceProvider(this.untitledResourceProvider)}registerEditorDocumentModelContentProvider(y){y.registerEditorDocumentModelContentProvider(this.fileSchemeDocumentProvider),y.registerEditorDocumentModelContentProvider(this.vscodeSchemeDocumentProvider),y.registerEditorDocumentModelContentProvider(this.walkThroughSnippetSchemeDocumentProvider),y.registerEditorDocumentModelContentProvider(this.untitledSchemeDocumentProvider)}};t.FileSystemEditorResourceContribution=f,n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",s.FileSchemeDocumentProvider)],f.prototype,"fileSchemeDocumentProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",s.VscodeSchemeDocumentProvider)],f.prototype,"vscodeSchemeDocumentProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",s.WalkThroughSnippetSchemeDocumentProvider)],f.prototype,"walkThroughSnippetSchemeDocumentProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",E.UntitledSchemeResourceProvider)],f.prototype,"untitledResourceProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",E.UntitledSchemeDocumentProvider)],f.prototype,"untitledSchemeDocumentProvider",void 0),t.FileSystemEditorResourceContribution=f=n.__decorate([(0,o.Domain)(m.BrowserEditorContribution)],f);let a=class{constructor(){this.cachedFileType=new o.LRUMap(200,100),this.fileServiceClient.onFilesChanged(y=>{y.forEach(S=>{this.cachedFileType.delete(S.uri.toString())})})}registerEditorComponent(y){y.registerEditorComponent({component:c.ImagePreview,uid:d,scheme:o.Schemes.file}),y.registerEditorComponent({component:c.VideoPreview,uid:g,scheme:o.Schemes.file}),y.registerEditorComponent({component:v.BinaryEditorComponent,uid:u,scheme:o.Schemes.file}),y.registerEditorComponent({component:h.LargeFilePrevent,uid:_,scheme:o.Schemes.file}),y.registerEditorComponentResolver(S=>S===o.Schemes.file||this.fileServiceClient.handlesScheme(S)?10:-1,(S,A)=>{A.length===0&&A.push({type:m.EditorOpenType.component,componentId:u})}),y.registerEditorComponentResolver(S=>S===o.Schemes.file||this.fileServiceClient.handlesScheme(S)?10:-1,async(S,A)=>{const w=await this.getFileType(S.uri.toString());switch(w){case"image":{A.push({type:m.EditorOpenType.component,componentId:d});break}case"video":{A.push({type:m.EditorOpenType.component,componentId:g});break}case"binary":case"text":{const{metadata:T,uri:D}=S,I=T||{};if(w==="binary"&&!I.skipPreventBinary)break;const O=await this.fileServiceClient.getFileStat(D.toString());await this.preference.ready;const L=this.preference.getValid("editor.largeFile",4*1024*1024*1024);O&&(O.size||0)>L&&!I.skipPreventTooLarge?A.push({type:m.EditorOpenType.component,componentId:_}):A.push({type:m.EditorOpenType.code,title:(0,o.localize)("editorOpenType.code")});break}}}),y.registerEditorComponentResolver(o.Schemes.untitled,(S,A,w)=>{w([{type:m.EditorOpenType.code,priority:"default"}])})}async getFileType(y){return this.cachedFileType.has(y)||((0,l.getLanguageIdFromMonaco)(new o.URI(y))?this.cachedFileType.set(y,"text"):this.cachedFileType.set(y,await this.getRealFileType(y))),this.cachedFileType.get(y)}async getRealFileType(y){try{return await this.fileServiceClient.getFileType(y)}catch{return"text"}}};t.FileSystemEditorComponentContribution=a,n.__decorate([(0,r.Autowired)(p.IFileServiceClient),n.__metadata("design:type",Object)],a.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],a.prototype,"preference",void 0),t.FileSystemEditorComponentContribution=a=n.__decorate([(0,o.Domain)(m.BrowserEditorContribution),n.__metadata("design:paramtypes",[])],a)},52568:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSchemeModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(80449),m=e(41352),E=e(17276);let p=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[E.FileSystemEditorResourceContribution,E.FileSystemEditorComponentContribution,{token:l.IFileSchemeDocClient,useClass:m.FileSchemeDocClientService}],this.backServices=[{servicePath:l.FileSchemeDocNodeServicePath}]}};t.FileSchemeModule=p,t.FileSchemeModule=p=n.__decorate([(0,r.Injectable)()],p)},88819:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LargeFilePrevent=t.PreventComponent=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),l=e(41869),m=e(81878),E=e(54414),p=e(82196),v=n.__importDefault(e(19996)),s=c=>o.default.createElement("div",{className:v.default["error-page"]},o.default.createElement("div",{className:(0,r.default)(v.default.icon,(0,l.getExternalIcon)("warning"))}),o.default.createElement("div",{className:v.default.description},c.description),o.default.createElement("div",{className:v.default["actions-wrapper"]},c.actions.map((g,d)=>o.default.createElement(m.Button,{key:d,onClick:()=>g.onClick(),className:v.default["action-button"]},g.label))));t.PreventComponent=s;const h=()=>{const c=(0,l.useInjectable)(E.WorkbenchEditorService),g=(0,l.useInjectable)(l.IEventBus),d=()=>{const u=c.currentResource;u&&(u.metadata={...u.metadata,skipPreventTooLarge:!0},g.fire(new p.ResourceOpenTypeChangedEvent(u.uri)))};return o.default.createElement(t.PreventComponent,{description:(0,l.localize)("editor.largeFile.prevent"),actions:[{label:(0,l.localize)("editor.file.prevent.stillOpen"),onClick:()=>d()}]})};t.LargeFilePrevent=h},99025:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImagePreview=t.VideoPreview=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(41869),l=e(40827),m=n.__importDefault(e(19996)),E=s=>{const h=(0,o.useInjectable)(l.StaticResourceService);return{src:r.default.useMemo(()=>h.resolveStaticResource(s.uri).toString(),[s])}},p=s=>{const{src:h}=E(s.resource);return r.default.createElement("div",{className:m.default.kt_video_preview},r.default.createElement("video",{autoPlay:!0,controls:!0,className:m.default.kt_video,src:h}))};t.VideoPreview=p;const v=s=>{const h=r.default.useRef(),c=r.default.useRef(),{src:g}=E(s.resource);return r.default.useEffect(()=>{const d=new o.Disposable;return h.current&&(h.current.src=g),()=>{d.dispose()}},[s.resource]),r.default.createElement("div",{className:m.default.kt_image_preview},r.default.createElement("div",{ref:c},r.default.createElement("img",{ref:d=>d&&(h.current=d)})))};t.ImagePreview=v},80449:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChangeType=t.FileSchemeDocNodeServicePath=t.IFileSchemeDocNodeService=t.IFileSchemeDocClient=t.FILE_SAVE_BY_CHANGE_THRESHOLD=t.FILE_ON_DISK_SCHEME=void 0,t.FILE_ON_DISK_SCHEME="fileOnDisk",t.FILE_SAVE_BY_CHANGE_THRESHOLD=1e5,t.IFileSchemeDocClient=Symbol("IFileSchemeDocClient"),t.IFileSchemeDocNodeService=Symbol("FileSchemeDocNodeService"),t.FileSchemeDocNodeServicePath="FileSchemeDocNodeService";var e;(function(n){n[n.ADDED=1]="ADDED",n[n.REMOVED=2]="REMOVED"})(e||(t.ChangeType=e={}))},15625:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IFileSearchService=t.FileSearchServicePath=void 0,t.FileSearchServicePath="FileSearchServicePath",t.IFileSearchService=Symbol("FileSearchService")},84660:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(15625),t)},2156:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileServiceClient=t.BrowserFileSystemRegistryImpl=void 0;const n=e(85608),r=e(32852),o=e(76003),l=e(41869),m=e(43718),E=e(37406),p=e(8170),v=e(41682),s=e(42933),h=e(81952);let c=class{constructor(){this.providers=new Map}registerFileSystemProvider(u){const _=u.scheme;return this.providers.set(_,u),{dispose:()=>{this.providers.delete(_)}}}};t.BrowserFileSystemRegistryImpl=c,t.BrowserFileSystemRegistryImpl=c=n.__decorate([(0,o.Injectable)()],c);let g=class{get clientId(){return this.applicationService.clientId}constructor(){this.watcherWithSchemaMap=new Map,this.watcherDisposerMap=new Map,this.onFileChangedEmitter=new l.Emitter,this.onFileProviderChangedEmitter=new l.Emitter,this._onFilesChanged=new l.Emitter,this.onFilesChanged=this._onFilesChanged.event,this._onFileProviderChanged=new l.Emitter,this.onFileProviderChanged=this._onFileProviderChanged.event,this._onDidChangeFileSystemProviderRegistrations=new l.Emitter,this.onDidChangeFileSystemProviderRegistrations=this._onDidChangeFileSystemProviderRegistrations.event,this._onWillActivateFileSystemProvider=new l.Emitter,this.onWillActivateFileSystemProvider=this._onWillActivateFileSystemProvider.event,this._onDidChangeFileSystemProviderCapabilities=new l.Emitter,this.onDidChangeFileSystemProviderCapabilities=this._onDidChangeFileSystemProviderCapabilities.event,this.filesExcludesMatcherList=[],this.watcherId=0,this.toDisposable=new l.DisposableCollection,this.watchFileExcludes=[],this.watchFileExcludesMatcherList=[],this.filesExcludes=[],this.workspaceRoots=[],this._providerChanged=new Set,this.fsProviders=new Map,this.userHomeDeferred=new l.Deferred,this.options={encoding:"utf8",overwrite:!1,recursive:!0,moveToTrash:!0},this.uriWatcherMap=new Map,this.toDisposable.push(this.onDidChangeFileSystemProviderRegistrations(u=>{u.added&&u.scheme===m.Schemes.file&&this.doGetCurrentUserHome()}))}async initialize(){const u=await this.getProvider(m.Schemes.file);u.initialize&&await u.initialize(this.clientId,this.appConfig.recursiveWatcherBackend)}async doGetCurrentUserHome(){const _=(await this.getProvider(m.Schemes.file)).getCurrentUserHome();this.userHomeDeferred.resolve(_)}handlesScheme(u){return this.registry.providers.has(u)||this.fsProviders.has(u)}dispose(){return this.toDisposable.dispose()}async resolveContent(u,_){const f=this.convertUri(u),b=await(await this.getProvider(f.scheme)).readFile(f.codeUri),y=b.data||b;return{content:l.BinaryBuffer.wrap(Uint8Array.from(y)).toString(_?.encoding)}}async readFile(u){const _=this.convertUri(u),a=await(await this.getProvider(_.scheme)).readFile(_.codeUri),b=a.data||a;return{content:l.BinaryBuffer.wrap(Uint8Array.from(b))}}async readFileStream(u){const _=this.convertUri(u);return await(await this.getProvider(_.scheme)).readFileStream(_.codeUri)}async getFileStat(u,_=!0){const f=this.convertUri(u),a=await this.getProvider(f.scheme);try{const b=await a.stat(f.codeUri);if(!b)throw s.FileSystemError.FileNotFound(f.codeUri.toString(),"File not found.");return this.filterStat(b,_)}catch(b){if(s.FileSystemError.FileNotFound.is(b))return}}async setContent(u,_,f){const a=this.convertUri(u.uri),b=await this.getProvider(a.scheme),y=await b.stat(a.codeUri);if(!y)throw s.FileSystemError.FileNotFound(u.uri,"File not found.");if(y.isDirectory)throw s.FileSystemError.FileIsADirectory(u.uri,"Cannot set the content.");if(!await this.isInSync(u,y))throw this.createOutOfSyncError(u);return await b.writeFile(a.codeUri,typeof _=="string"?l.BinaryBuffer.fromString(_).buffer:_,{create:!1,overwrite:!0,encoding:f?.encoding}),await b.stat(a.codeUri)}async updateContent(u,_,f){const a=this.convertUri(u.uri),b=await this.getProvider(a.scheme),y=await b.stat(a.codeUri);if(!y)throw s.FileSystemError.FileNotFound(u.uri,"File not found.");if(y.isDirectory)throw s.FileSystemError.FileIsADirectory(u.uri,"Cannot set the content.");if(!this.checkInSync(u,y))throw this.createOutOfSyncError(u);if(_.length===0)return y;const S=await b.readFile(a.codeUri),A=this.applyContentChanges(l.BinaryBuffer.wrap(S).toString(f?.encoding),_);await b.writeFile(a.codeUri,l.BinaryBuffer.fromString(A).buffer,{create:!1,overwrite:!0,encoding:f?.encoding});const w=await b.stat(a.codeUri);if(!w)throw s.FileSystemError.FileNotFound(a.codeUri.toString(),"File not found.");return w}async createFile(u,_){const f=this.convertUri(u),a=await this.getProvider(f.scheme),b=l.BinaryBuffer.fromString(_?.content||"").buffer;let y=await a.writeFile(f.codeUri,b,{create:!0,overwrite:_&&_.overwrite||!1,encoding:_?.encoding});return y=y||await a.stat(f.codeUri),y}async createFolder(u){const _=this.convertUri(u),f=await this.getProvider(_.scheme),a=await f.createDirectory(_.codeUri);return a||await f.stat(_.codeUri)}async move(u,_,f){const a=this.convertUri(u),b=this.convertUri(_),y=await this.getProvider(a.scheme),S=await y.rename(a.codeUri,b.codeUri,{overwrite:!!(f&&f.overwrite)});return S||await y.stat(b.codeUri)}async copy(u,_,f){const a=this.convertUri(u),b=this.convertUri(_),y=await this.getProvider(a.scheme),S=await this.doGetOverwrite(f);if(!(0,s.containsExtraFileMethod)(y,"copy"))throw this.getErrorProvideNotSupport(a.scheme,"copy");const A=await y.copy(a.codeUri,b.codeUri,{overwrite:!!S});return A||await y.stat(b.codeUri)}async getFsPath(u){if(u.startsWith("file:/"))return l.FileUri.fsPath(u)}fireFilesChange(u){const _=u.changes.map(f=>({uri:f.uri,type:f.type}));this._onFilesChanged.fire(_),this.eventBus.fire(new l.FilesChangeEvent(_))}async watchFileChanges(u,_){const a=(this.appConfig.pollingWatcherDirectories||[]).some(I=>u.path.toString().startsWith(I)),b=this.convertUri(u.toString()),y=this.uriWatcherMap.get(b.toString());if(y)if(y.isDisposed())this.uriWatcherMap.delete(b.toString());else return y;const S=this.watcherId++,A=await this.getProvider(b.scheme),w=this.watcherWithSchemaMap.get(b.scheme)||[],T=await A.watch(b.codeUri,{excludes:_,pollingWatch:a});this.watcherDisposerMap.set(S,{dispose:async()=>{const I=this.uriWatcherMap.get(b.toString());await Promise.all([A.unwatch&&A.unwatch(T),I&&I.dispose()]),this.uriWatcherMap.delete(b.toString())}}),w.push(S),this.watcherWithSchemaMap.set(b.scheme,w);const D=new h.FileSystemWatcher({fileServiceClient:this,watchId:S,uri:u});return this.uriWatcherMap.set(b.toString(),D),D}async setWatchFileExcludes(u){return await(await this.getProvider(m.Schemes.file)).setWatchFileExcludes(u)}async getWatchFileExcludes(){return await(await this.getProvider(m.Schemes.file)).getWatchFileExcludes()}async setFilesExcludes(u,_){this.filesExcludes=u,this.filesExcludesMatcherList=[],_&&this.setWorkspaceRoots(_),this.updateExcludeMatcher()}async setWorkspaceRoots(u){this.workspaceRoots=u,this.updateExcludeMatcher()}async unwatchFileChanges(u){const _=this.watcherDisposerMap.get(u);if(!(!_||!_.dispose))return this.watcherDisposerMap.delete(u),_.dispose()}async delete(u,_){if(this.appConfig.isElectronRenderer&&_?.moveToTrash!==!1){const b=new l.URI(u);if(b.scheme===m.Schemes.file)return this.injector.get(E.IElectronMainUIService).moveToTrash(b.codeUri.fsPath)}const f=this.convertUri(u),a=await this.getProvider(f.scheme);await a.stat(f.codeUri),await a.delete(f.codeUri,{recursive:!0,moveToTrash:await this.doGetMoveToTrash(_)})}async getEncoding(u){return"utf8"}listCapabilities(){return v.Iterable.map(this.fsProviders,([u,_])=>({scheme:u,capabilities:_.capabilities}))}registerProvider(u,_){if(this.fsProviders.has(u))throw new Error(`The file system provider for \`${u}\` already registered`);const f=[];this.fsProviders.set(u,_),this._onDidChangeFileSystemProviderRegistrations.fire({added:!0,scheme:u,provider:_}),f.push({dispose:()=>{this._onDidChangeFileSystemProviderRegistrations.fire({added:!1,scheme:u,provider:_}),this.fsProviders.delete(u),this._providerChanged.add(u)}}),_.onDidChangeFile&&f.push(_.onDidChangeFile(b=>this.fireFilesChange({changes:b}))),this.toDisposable.push(_.onDidChangeCapabilities(()=>this._onDidChangeFileSystemProviderCapabilities.fire({provider:_,scheme:u}))),f.push({dispose:async()=>{const b=[];(this.watcherWithSchemaMap.get(u)||[]).forEach(y=>b.push(this.unwatchFileChanges(y))),await Promise.all(b)}}),this._providerChanged.add(u),this.onFileProviderChangedEmitter.fire(Array.from(this._providerChanged)),this.toDisposable.pushAll(f);const a=new l.DisposableCollection;return a.pushAll(f),this._onFileProviderChanged.fire(Array.from(this._providerChanged)),a}async access(u,_=s.FileAccess.Constants.F_OK){const f=this.convertUri(u),a=await this.getProvider(f.scheme);if(!(0,s.containsExtraFileMethod)(a,"access"))throw this.getErrorProvideNotSupport(f.scheme,"access");return await a.access(f.codeUri,_)}async getFileType(u){const _=this.convertUri(u),f=await this.getProvider(_.scheme);if(!(0,s.containsExtraFileMethod)(f,"getFileType"))throw this.getErrorProvideNotSupport(_.scheme,"getFileType");return await f.getFileType(u)}async getCurrentUserHome(){return this.userHomeDeferred.promise}getErrorProvideNotSupport(u,_){return`Scheme ${u} not support this function: ${_}.`}convertUri(u){const _=new l.URI(u);if(!_.scheme)throw new Error(`Unsupported convert Uri with non-scheme Uri: ${u}`);return _}updateExcludeMatcher(){this.filesExcludes.forEach(u=>{this.workspaceRoots.length>0?this.workspaceRoots.forEach(_=>{const a=new l.URI(_).resolve(u).path.toString();this.filesExcludesMatcherList.push((0,l.parseGlob)(a))}):this.filesExcludesMatcherList.push((0,l.parseGlob)(u))})}async shouldWaitProvider(u){const _=await this._onWillActivateFileSystemProvider.fireAndAwait({scheme:u}),{result:f}=_[0];if(f&&f.includes(u)){const a=await l.Event.toPromise(l.Event.filter(this.onFileProviderChanged,b=>b.includes(u)));if(!(0,m.isUndefined)(a))return!0}return!1}async getProvider(u){this._providerChanged.has(u)&&(await this.eventBus.fireAndAwait(new l.ExtensionActivateEvent({topic:"onFileSystem",data:u}),{timeout:3e3}),this._providerChanged.delete(u));const _=this.fsProviders.get(u);if(!_)throw new Error(`Not find ${u} provider.`);return _}async isReadonly(u){try{const _=new l.URI(u);return!!(await(await this.getProvider(_.scheme)).stat(this.convertUri(u).codeUri)).readonly}catch{return!1}}isExclude(u){const _=new l.URI(u);return this.filesExcludesMatcherList.some(f=>f(_.path.toString()))}filterStat(u,_=!0){if(u&&!this.isExclude(u.uri))return u.children&&_&&(u.children=this.filterStatChildren(u.children)),u}filterStatChildren(u){const _=[];return u.forEach(f=>{if(this.isExclude(f.uri))return!1;const a=this.filterStat(f);a&&_.push(a)}),_}applyContentChanges(u,_){let f=r.TextDocument.create("","",1,u);for(const a of _){let b=a.text;if(a.range){const y=f.offsetAt(a.range.start),S=f.offsetAt(a.range.end);b=f.getText().substr(0,y)+a.text+f.getText().substr(S)}f=r.TextDocument.create(f.uri,f.languageId,f.version,b)}return f.getText()}async isInSync(u,_){return!!this.checkInSync(u,_)}checkInSync(u,_){return _.lastModification===u.lastModification&&_.size===u.size}createOutOfSyncError(u){return s.FileSystemError.FileIsOutOfSync(u.uri)}async doGetEncoding(u){return u&&typeof u.encoding<"u"?u.encoding:this.options.encoding}async doGetOverwrite(u){return u&&typeof u.overwrite<"u"?u.overwrite:this.options.overwrite}async doGetRecursive(u){return u&&typeof u.recursive<"u"?u.recursive:this.options.recursive}async doGetMoveToTrash(u){return u&&typeof u.moveToTrash<"u"?u.moveToTrash:this.options.moveToTrash}};t.FileServiceClient=g,n.__decorate([(0,o.Autowired)(s.IBrowserFileSystemRegistry),n.__metadata("design:type",c)],g.prototype,"registry",void 0),n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],g.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(m.IEventBus),n.__metadata("design:type",Object)],g.prototype,"eventBus",void 0),n.__decorate([(0,o.Autowired)(l.AppConfig),n.__metadata("design:type",Object)],g.prototype,"appConfig",void 0),n.__decorate([(0,o.Autowired)(p.IApplicationService),n.__metadata("design:type",Object)],g.prototype,"applicationService",void 0),t.FileServiceClient=g=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],g)},69037:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileServiceContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(42933),m=e(2156);let E=class{constructor(){this._disposables=new o.DisposableStore,this._disposables.add(this.fileSystem.registerProvider(o.Schemes.file,this.diskFileServiceProvider))}async initialize(){const v=this.contributionProvider.getContributions();await Promise.all(v.map(async s=>{s.registerProvider&&await s.registerProvider(this.fileSystem)})),await Promise.all(v.map(async s=>{s.onFileServiceReady&&await s.onFileServiceReady()})),this.fileSystem.initialize&&await this.fileSystem.initialize()}dispose(){this._disposables.dispose()}};t.FileServiceContribution=E,n.__decorate([(0,r.Autowired)(l.IFileServiceClient),n.__metadata("design:type",m.FileServiceClient)],E.prototype,"fileSystem",void 0),n.__decorate([(0,r.Autowired)(l.IDiskFileProvider),n.__metadata("design:type",Object)],E.prototype,"diskFileServiceProvider",void 0),n.__decorate([(0,r.Autowired)(o.FsProviderContribution),n.__metadata("design:type",Object)],E.prototype,"contributionProvider",void 0),t.FileServiceContribution=E=n.__decorate([(0,o.Domain)(o.ClientAppContribution),n.__metadata("design:paramtypes",[])],E)},60476:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiskFsProviderClient=t.CoreFileServiceProviderClient=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(42933);class m{constructor(){this.onDidChangeFileEmitter=new o.Emitter,this.onDidChangeFile=this.onDidChangeFileEmitter.event}watch(v,s){return this.fileServiceProvider.watch(v,s)}unwatch(v){return this.fileServiceProvider.unwatch&&this.fileServiceProvider.unwatch(v)}async stat(v){return await this.fileServiceProvider.stat(v)}readDirectory(v){return this.fileServiceProvider.readDirectory(v)}createDirectory(v){return this.fileServiceProvider.createDirectory(v)}async readFile(v,s){return s&&(0,o.getDebugLogger)("fileService.fsProvider").warn("encoding option for fsProvider.readFile is deprecated"),await this.fileServiceProvider.readFile(v)}readFileStream(v){if(this.fileServiceProvider.readFileStream)return this.fileServiceProvider.readFileStream(v);throw new Error("readFileStream not supported")}writeFile(v,s,h){return this.fileServiceProvider.writeFile(v,Array.from(s),h)}delete(v,s){return this.fileServiceProvider.delete(v,s)}rename(v,s,h){return this.fileServiceProvider.rename(v,s,h)}}t.CoreFileServiceProviderClient=m,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],m.prototype,"injector",void 0);let E=class extends m{constructor(){super(...arguments),this.onDidChangeCapabilities=o.Event.None}get capabilities(){return this._capabilities||(this._capabilities=12318,o.isLinux&&(this._capabilities|=1024)),this._capabilities}async initialize(v,s){var h,c;if(!((h=this.fileServiceProvider)===null||h===void 0)&&h.initialize)try{await((c=this.fileServiceProvider)===null||c===void 0?void 0:c.initialize(v,s))}catch(g){(0,o.getDebugLogger)("fileService.fsProvider").error("initialize error",g)}}setWatchFileExcludes(v){return this.fileServiceProvider.setWatchFileExcludes(v)}getWatchFileExcludes(){return this.fileServiceProvider.getWatchFileExcludes()}onDidFilesChanged(v){const s=v.changes.map(h=>({uri:h.uri,type:h.type}));this.onDidChangeFileEmitter.fire(s)}copy(v,s,h){return this.fileServiceProvider.copy(v,s,h)}access(v,s){return this.fileServiceProvider.access(v,s)}getCurrentUserHome(){return this.fileServiceProvider.getCurrentUserHome()}getFileType(v){return this.fileServiceProvider.getFileType(v)}};t.DiskFsProviderClient=E,n.__decorate([(0,r.Autowired)(l.DiskFileServicePath),n.__metadata("design:type",Object)],E.prototype,"fileServiceProvider",void 0),n.__decorate([(0,o.debounce)(100),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[Array]),n.__metadata("design:returntype",void 0)],E.prototype,"setWatchFileExcludes",null),t.DiskFsProviderClient=E=n.__decorate([(0,r.Injectable)()],E)},96708:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileServiceClientModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(42933),m=e(70671),E=e(2156),p=e(69037),v=e(60476),s=e(23188);let h=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:l.IFileServiceClient,useClass:E.FileServiceClient},{token:l.IBrowserFileSystemRegistry,useClass:E.BrowserFileSystemRegistryImpl},{token:l.IDiskFileProvider,useClass:v.DiskFsProviderClient},{token:l.IShadowFileProvider,useClass:s.ShadowFileSystemProvider},p.FileServiceContribution],this.backServices=[{servicePath:l.DiskFileServicePath,clientToken:l.IDiskFileProvider,protocol:m.DiskFileServiceProtocol}]}};t.FileServiceClientModule=h,t.FileServiceClientModule=h=n.__decorate([(0,r.Injectable)()],h)},23188:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShadowFileSystemProvider=void 0;const n=e(85608),r=e(76003),o=e(41869);let l=class{constructor(){this.capabilities=2048,this.onDidChangeCapabilities=o.Event.None,this.readonly=!0,this.shadowFiles=new Map,this.fileChangeEmitter=new o.Emitter,this.onDidChangeFile=this.fileChangeEmitter.event}unwatch(E){throw new Error("Method not implemented.")}readFileStream(E){throw new Error("Method not implemented.")}watch(E,p){throw new Error("Method not implemented.")}stat(E){return Promise.resolve({uri:E.toString(),lastModification:0})}readDirectory(E){throw new Error("Method not implemented.")}createDirectory(E){throw new Error("Method not implemented.")}readFile(E){return this.shadowFiles.get(E.toString())||o.BinaryBuffer.fromString("no available").buffer}writeFile(E,p,v){this.shadowFiles.set(E.toString(),p)}delete(E,p){throw new Error("Method not implemented.")}rename(E,p,v){throw new Error("Method not implemented.")}copy(E,p,v){throw new Error("Method not implemented.")}exists(E){throw new Error("Method not implemented.")}access(E,p){throw new Error("Method not implemented.")}};t.ShadowFileSystemProvider=l,t.ShadowFileSystemProvider=l=n.__decorate([(0,r.Injectable)()],l)},81952:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSystemWatcher=void 0;const n=e(43718);function r(l,m){return l.filter(E=>!!E.uri.startsWith(m))}class o{constructor(m){this.toDispose=new n.DisposableCollection,this.changeEmitter=new n.Emitter,this.toDispose.push(this.changeEmitter),this.fileServiceClient=m.fileServiceClient,this.watchId=m.watchId,this.uri=m.uri,this.fileServiceClient.onFilesChanged(E=>{const p=r(E,this.uri.toString());p&&p.length>0&&this.changeEmitter.fire(p)})}get onFilesChanged(){return this.changeEmitter.event}dispose(){return Promise.all([this.toDispose.dispose(),this.fileServiceClient.unwatchFileChanges(this.watchId)])}isDisposed(){return this.toDispose.disposed}}t.FileSystemWatcher=o},91813:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EXT_LIST_TEXT=t.EXT_LIST_IMAGE=t.EXT_LIST_VIDEO=void 0,t.getFileTypeByExt=e,t.EXT_LIST_VIDEO=new Set(["mp4","webm","mkv","mov","mts","flv","avi","wmv"]),t.EXT_LIST_IMAGE=new Set(["png","gif","jpg","jpeg","svg","bmp","avif","cr2","cr3","dng","flif","heic","icns","jxl","jpm","jpx","nef","raf","rw2","tif","orf","webp","apng"]),t.EXT_LIST_TEXT=new Set(["xml"]);function e(n){let r="text";return n&&(t.EXT_LIST_IMAGE.has(n)?r="image":t.EXT_LIST_VIDEO.has(n)?r="video":t.EXT_LIST_TEXT.has(n)?r="text":r="binary"),r}},79929:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IBrowserFileSystemRegistry=t.IFileServiceClient=void 0;const n=e(43718);t.IFileServiceClient=n.IFileServiceClient,t.IBrowserFileSystemRegistry=Symbol("IBrowserFileSystemRegistry")},49818:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSystemError=t.FileOperationError=t.FileSystemProviderError=t.FileSystemProviderErrorCode=t.FileAccess=t.IFileService=t.IShadowFileProvider=t.IDiskFileProvider=t.FileStat=t.FileType=void 0,t.createFileSystemProviderError=v,t.markAsFileSystemProviderError=s,t.containsExtraFileMethod=c,t.notEmpty=g,t.isErrnoException=d,t.handleError=u;const n=e(85608),r=e(43718);var o=e(31036);Object.defineProperty(t,"FileType",{enumerable:!0,get:function(){return o.FileType}}),Object.defineProperty(t,"FileStat",{enumerable:!0,get:function(){return o.FileStat}}),n.__exportStar(e(11854),t),t.IDiskFileProvider=Symbol("IDiskFileProvider"),t.IShadowFileProvider=Symbol("IShadowFileProvider"),t.IFileService=Symbol("IFileService");var l;(function(_){let f;(function(a){a.F_OK=0,a.R_OK=4,a.W_OK=2,a.X_OK=1})(f=_.Constants||(_.Constants={}))})(l||(t.FileAccess=l={}));var m;(function(_){_.FileExists="EntryExists",_.FileNotFound="EntryNotFound",_.FileNotADirectory="EntryNotADirectory",_.FileIsADirectory="EntryIsADirectory",_.FileIsOutOfSync="FileIsOutOfSync",_.FileExceedsMemoryLimit="EntryExceedsMemoryLimit",_.FileTooLarge="EntryTooLarge",_.FileWriteLocked="EntryWriteLocked",_.NoPermissions="NoPermissions",_.Unavailable="Unavailable",_.Unknown="Unknown"})(m||(t.FileSystemProviderErrorCode=m={}));class E extends Error{static declare(f,a){return Object.assign((...b)=>v(a(...b),f),{is:b=>{var y;return(y=b.stack)===null||y===void 0?void 0:y.startsWith(f)}})}constructor(f,a){super(f),this.code=a}is(f){return this.name===f.name}}t.FileSystemProviderError=E;class p extends Error{constructor(f,a,b){super(f),this.fileOperationResult=a,this.options=b}static isFileOperationError(f){return f instanceof Error&&!(0,r.isUndefinedOrNull)(f.fileOperationResult)}}t.FileOperationError=p;function v(_,f){const a=new E(_.toString(),f);return s(a,f),a}function s(_,f){return _.name=f?`${f} (FileSystemError)`:"FileSystemError",_}var h;(function(_){_.FileNotFound=E.declare(m.FileNotFound,(f,a)=>`${a?a+" ":""} '${f}' is not found.`),_.FileExists=E.declare(m.FileExists,(f,a)=>`${a?a+" ":""}'${f}' already exists.`),_.FileNotADirectory=E.declare(m.FileNotADirectory,(f,a)=>`${a?a+" ":""}'${f}' is not a directory.`),_.FileIsADirectory=E.declare(m.FileIsADirectory,(f,a)=>`${a?a+" ":""}'${f}' is a directory.`),_.FileIsOutOfSync=E.declare(m.FileIsOutOfSync,(f,a)=>`${a?a+" ":""}'${f}' is out of sync.`),_.FileExceedsMemoryLimit=E.declare(m.FileExceedsMemoryLimit,(f,a)=>`${a?a+" ":""}'${f}' is exceeds memory limit.`),_.FileTooLarge=E.declare(m.FileTooLarge,(f,a)=>`${a?a+" ":""}'${f}' is too large.`),_.FileWriteLocked=E.declare(m.FileWriteLocked,(f,a)=>`${a?a+" ":""}'${f}' is locked.`),_.FileIsNoPermissions=E.declare(m.NoPermissions,(f,a)=>`${a?a+" ":""}'${f}' is no permissions.`),_.Unavailable=E.declare(m.Unavailable,(f,a)=>`${a?a+" ":""}'${f}' is unavailable.`),_.Unknown=E.declare(m.Unknown,(f,a)=>`${a?a+" ":""}'${f}' is unkonw.`)})(h||(t.FileSystemError=h={}));function c(_,f){return(0,r.hasProperty)(_,f)&&(0,r.isFunction)(_[f])}function g(_){return _!==void 0}function d(_){return _.code!==void 0&&_.errno!==void 0}function u(_){var f,a,b,y,S;if(d(_))switch(_.code){case"EEXIST":throw h.FileExists(r.Uri.file((f=_.path)!==null&&f!==void 0?f:""));case"EPERM":case"EACCESS":throw h.FileIsNoPermissions(r.Uri.file((a=_.path)!==null&&a!==void 0?a:""));case"ENOENT":throw h.FileNotFound(r.Uri.file((b=_.path)!==null&&b!==void 0?b:""));case"ENOTDIR":throw h.FileNotADirectory(r.Uri.file((y=_.path)!==null&&y!==void 0?y:""));case"EISDIR":throw h.FileIsADirectory(r.Uri.file((S=_.path)!==null&&S!==void 0?S:""))}throw _}},42933:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(79929),t),n.__exportStar(e(49818),t),n.__exportStar(e(28217),t),n.__exportStar(e(91813),t),n.__exportStar(e(50295),t)},70671:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiskFileServiceProtocol=void 0;const n=e(26387),r=e(52890),o=e(50295);t.DiskFileServiceProtocol={name:o.DiskFileServicePath,methods:[{method:"readFile",request:[{name:"uri",type:r.UriComponentsProto}],response:{type:n.Type.binary()}}]}},50295:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileExtServicePath=t.FileWatcherServicePath=t.ShadowFileServicePath=t.DiskFileServicePath=t.FileServicePath=void 0,t.FileServicePath="FileService",t.DiskFileServicePath="DiskFileService",t.ShadowFileServicePath="ShadowFileService",t.FileWatcherServicePath="FileWatcherService",t.FileExtServicePath="FileExtServicePath"},28217:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WatcherProcessManagerProxy=t.WatcherServiceProxy=t.WATCHER_INIT_DATA_KEY=t.SUMI_WATCHER_PROCESS_SOCK_KEY=t.INsfw=void 0;const n=e(86058);var r;(function(o){let l;(function(m){m[m.CREATED=0]="CREATED",m[m.DELETED=1]="DELETED",m[m.MODIFIED=2]="MODIFIED",m[m.RENAMED=3]="RENAMED"})(l=o.actions||(o.actions={}))})(r||(t.INsfw=r={})),t.SUMI_WATCHER_PROCESS_SOCK_KEY="sumi-watcher-process-sock",t.WATCHER_INIT_DATA_KEY="sumi-watcher-init-data",t.WatcherServiceProxy=new n.ProxyIdentifier("WatcherHostServiceImpl"),t.WatcherProcessManagerProxy=new n.ProxyIdentifier("WatcherProcessManagerProxy")},14951:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(42933),t)},57942:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeDialogModel=void 0;const r=e(85608),o=e(76003),l=e(97267),m=e(41869),E=e(26542),p=e(6250),v=e(2812),s=r.__importDefault(e(89200)),h=e(9018);let c=n=class{static createContainer(d,u){return d.createChild([{token:p.IFileDialogTreeService,useValue:u},{token:p.IFileDialogModel,useClass:n}])}static createModel(d,u){return n.createContainer(d,u).get(p.IFileDialogModel)}constructor(){this.selectedDecoration=new l.Decoration(s.default.mod_selected),this.focusedDecoration=new l.Decoration(s.default.mod_focused),this.loadingDecoration=new l.Decoration(s.default.mod_loading),this.cutDecoration=new l.Decoration(s.default.mod_cut),this._selectedFiles=[],this.disposableCollection=new m.DisposableCollection,this.onDidFocusedFileChangeEmitter=new m.Emitter,this.onDidSelectedFileChangeEmitter=new m.Emitter,this.clearFileSelectedDecoration=()=>{this._selectedFiles.forEach(d=>{this.selectedDecoration.removeTarget(d)}),this._selectedFiles=[],this.onDidSelectedFileChangeEmitter.fire([])},this.activeFileDecoration=(d,u=!0)=>{d!==this.treeModel.root&&(this.preContextMenuFocusedFile&&(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile),this.preContextMenuFocusedFile=null),d&&(this.selectedFiles.length>0&&this.selectedFiles.forEach(_=>{this.selectedDecoration.removeTarget(_)}),this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.selectedDecoration.addTarget(d),this.focusedDecoration.addTarget(d),this._focusedFile=d,this._selectedFiles=[d],this.onDidFocusedFileChangeEmitter.fire(d.uri),this.onDidSelectedFileChangeEmitter.fire([d.uri]),u&&this.treeModel.dispatchChange()))},this.selectFileDecoration=(d,u=!0)=>{d!==this.treeModel.root&&(this.preContextMenuFocusedFile&&(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile),this.preContextMenuFocusedFile=null),d&&(this.selectedFiles.length>0&&this.selectedFiles.forEach(_=>{this.selectedDecoration.removeTarget(_)}),this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.selectedDecoration.addTarget(d),this._selectedFiles=[d],this.onDidSelectedFileChangeEmitter.fire([d.uri]),u&&this.treeModel.dispatchChange()))},this.activeFileFocusedDecoration=(d,u=!1)=>{d!==this.treeModel.root&&(this.focusedFile!==d&&(u?(this.preContextMenuFocusedFile?(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile)):this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.preContextMenuFocusedFile=d):this.focusedFile&&(this.preContextMenuFocusedFile=null,this.focusedDecoration.removeTarget(this.focusedFile)),d&&(this.selectedDecoration.addTarget(d),this.focusedDecoration.addTarget(d),this._focusedFile=d,this._selectedFiles.push(d),this.onDidFocusedFileChangeEmitter.fire(d.uri),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(_=>_.uri)))),this.treeModel.dispatchChange())},this.activeFileSelectedDecoration=d=>{this._selectedFiles.indexOf(d)>-1||(this._selectedFiles.push(d),this.selectedDecoration.addTarget(d),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(u=>u.uri)),this.treeModel.dispatchChange())},this.activeFileDecorationByRange=(d,u)=>{for(this.clearFileSelectedDecoration(),this.preContextMenuFocusedFile=null;d<=u;d++){const _=this.treeModel.root.getTreeNodeAtIndex(d);_&&(this._selectedFiles.push(_),this.selectedDecoration.addTarget(_))}this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(_=>_.uri)),this.treeModel.dispatchChange()},this.enactiveFileDecoration=()=>{this.focusedFile&&(this.focusedDecoration.removeTarget(this.focusedFile),this.onDidFocusedFileChangeEmitter.fire(),this.treeModel.dispatchChange()),this._focusedFile=void 0},this.toggleDirectory=async d=>{d.expanded?this.fileTreeHandle.collapseNode(d):this.fileTreeHandle.expandNode(d)},this.handleTreeBlur=()=>{this.enactiveFileDecoration()},this.handleTreeFocus=()=>{},this.handleItemRangeClick=(d,u)=>{if(!this.focusedFile)this.handleItemClick(d,u);else if(this.focusedFile&&this.focusedFile!==d){const _=this.treeModel.root.getIndexAtTreeNode(d),f=this.treeModel.root.getIndexAtTreeNode(this.focusedFile);f>_?this.activeFileDecorationByRange(_,f):f<_&&this.activeFileDecorationByRange(f,_)}},this.handleItemToggleClick=(d,u)=>{u!==l.TreeNodeType.CompositeTreeNode&&u!==l.TreeNodeType.TreeNode||(this.selectedFiles.indexOf(d)>-1?this.focusedFile===d?this.enactiveFileDecoration():this.activeFileFocusedDecoration(d):this.activeFileSelectedDecoration(d))},this.handleItemClick=(d,u)=>{this.clickTimes++,(u===l.TreeNodeType.CompositeTreeNode||u===l.TreeNodeType.TreeNode)&&this.activeFileDecoration(d),u===l.TreeNodeType.CompositeTreeNode&&this.corePreferences["workbench.list.openMode"]==="singleClick"&&this.toggleDirectory(d),this.clickTimer&&clearTimeout(this.clickTimer),this.clickTimer=setTimeout(()=>{this.clickTimes>1&&u!==l.TreeNodeType.TreeNode&&this.corePreferences["workbench.list.openMode"]==="doubleClick"&&this.toggleDirectory(d),this.clickTimes=0},200)},this.getDirectoryList=()=>this.fileTreeDialogService.getDirectoryList(),this._whenReady=this.initTreeModel()}get onDidFocusedFileChange(){return this.onDidFocusedFileChangeEmitter.event}get onDidSelectedFileChange(){return this.onDidSelectedFileChangeEmitter.event}get fileTreeHandle(){return this._fileTreeHandle}get decorations(){return this._decorations}get treeModel(){return this._treeModel}get whenReady(){return this._whenReady}get focusedFile(){return this._focusedFile}get selectedFiles(){return this._selectedFiles}async initTreeModel(){const d=(await this.fileTreeDialogService.resolveChildren())[0];this._treeModel=this.injector.get(v.FileTreeModel,[d]),this.initDecorations(d),this.disposableCollection.push(this._decorations),this.disposableCollection.push(this.labelService.onDidChange(()=>{this.treeModel.dispatchChange()})),this.disposableCollection.push(this.treeModel.root.watcher.on(l.TreeNodeEvent.WillResolveChildren,u=>{this.loadingDecoration.addTarget(u)})),this.disposableCollection.push(this.treeModel.root.watcher.on(l.TreeNodeEvent.DidResolveChildren,u=>{this.loadingDecoration.removeTarget(u)}))}async updateTreeModel(d){const u=await this.fileTreeDialogService.resolveRoot(d);if(u&&u.length>0){const _=u[0];this._treeModel=this.injector.get(v.FileTreeModel,[_]),this.clearFileSelectedDecoration(),this.initDecorations(_)}}initDecorations(d){this._decorations&&this._decorations.dispose(),this._decorations=new l.DecorationsManager(d),this._decorations.addDecoration(this.selectedDecoration),this._decorations.addDecoration(this.focusedDecoration),this._decorations.addDecoration(this.cutDecoration),this._decorations.addDecoration(this.loadingDecoration)}handleTreeHandler(d){this._fileTreeHandle=d}dispose(){this.disposableCollection.dispose()}};t.FileTreeDialogModel=c,c.FILE_TREE_SNAPSHOT_KEY="FILE_TREE_SNAPSHOT",c.DEFAULT_LOCATION_FLUSH_DELAY=500,r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],c.prototype,"injector",void 0),r.__decorate([(0,o.Autowired)(p.IFileDialogTreeService),r.__metadata("design:type",h.FileTreeDialogService)],c.prototype,"fileTreeDialogService",void 0),r.__decorate([(0,o.Autowired)(E.LabelService),r.__metadata("design:type",E.LabelService)],c.prototype,"labelService",void 0),r.__decorate([(0,o.Autowired)(m.CorePreferences),r.__metadata("design:type",Object)],c.prototype,"corePreferences",void 0),t.FileTreeDialogModel=c=n=r.__decorate([(0,o.Injectable)(),r.__metadata("design:paramtypes",[])],c)},69748:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FILE_TREE_BADGE_LIMIT=t.FILE_TREE_NODE_HEIGHT=t.FileTreeDialogNode=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),l=e(97267),m=e(41869),E=e(69959),p=n.__importDefault(e(89200)),v=({item:s,onClick:h,itemType:c,labelService:g,leftPadding:d=8,onTwistierClick:u,decorations:_,defaultLeftPadding:f=8,template:a})=>{const b=c===l.TreeNodeType.RenamePrompt,y=c===l.TreeNodeType.NewPrompt,S=b||y,A=(0,m.useDesignStyles)(p.default.expansion_toggle,"expansion_toggle"),w=(0,m.useDesignStyles)(p.default.file_tree_node,"file_tree_node"),T=K=>{(c===l.TreeNodeType.TreeNode||c===l.TreeNodeType.CompositeTreeNode)&&h(K,s,c)},D=K=>{(c===l.TreeNodeType.TreeNode||c===l.TreeNodeType.CompositeTreeNode)&&(u?u(K,s,c):h(K,s,c))},I=c===l.TreeNodeType.CompositeTreeNode;let O;S?y?O=`${f+(s.parent.depth+1||0)*(d||0)}px`:O=`${f+(s.target.depth||0)*(d||0)}px`:O=I?`${f+(s.depth||0)*(d||0)}px`:`${f+(s.depth||0)*(d||0)+8}px`;const L={height:t.FILE_TREE_NODE_HEIGHT,lineHeight:`${t.FILE_TREE_NODE_HEIGHT}px`,paddingLeft:O},R=(K,U)=>{if(_&&_?.classlist.indexOf(p.default.mod_loading)>-1)return o.default.createElement(l.Loading,null);if(S&&K instanceof l.PromptHandle){let X=!1;if(b?X=K.target.type===l.TreeNodeType.CompositeTreeNode:X=K.type===l.TreeNodeType.CompositeTreeNode,X)return o.default.createElement("div",{className:(0,r.default)(p.default.file_tree_node_segment,A,(0,m.getIcon)("arrow-right"),{[`${p.default.mod_collapsed}`]:y||!(b&&K.target.type===l.TreeNodeType.CompositeTreeNode&&K.target.expanded)})})}else return o.default.createElement("div",{onClick:U,className:(0,r.default)(p.default.file_tree_node_segment,A,(0,m.getIcon)("arrow-right"),{[`${p.default.mod_collapsed}`]:!K.expanded})})},M=K=>{let U,X;S&&K instanceof l.PromptHandle?K instanceof l.RenamePromptHandle?(U=K.target.uri.resolve(K.$.value),X=E.Directory.is(K.target)):(U=K.parent.uri.resolve(K.$.value),X=K.type===l.TreeNodeType.CompositeTreeNode):(U=K.uri,X=K.filestat.isDirectory);const z=g.getIcon(U,{isDirectory:X});return o.default.createElement("div",{className:(0,r.default)(p.default.file_icon,z,{expanded:X&&K.expanded}),style:{height:t.FILE_TREE_NODE_HEIGHT,lineHeight:`${t.FILE_TREE_NODE_HEIGHT}px`}})},k=K=>a?o.default.createElement(a,null):S&&K instanceof l.PromptHandle?o.default.createElement("div",{className:(0,r.default)(p.default.file_tree_node_segment,p.default.file_tree_node_inputbox)},o.default.createElement("div",{className:(0,r.default)("input-box",p.default.file_tree_node_prompt_box)},o.default.createElement(K.ProxiedInput,{wrapperStyle:{height:t.FILE_TREE_NODE_HEIGHT,padding:"0 5px"}}))):o.default.createElement("div",{className:(0,r.default)(p.default.file_tree_node_segment,p.default.file_tree_node_displayname)},K.name),B=()=>o.default.createElement("div",{className:(0,r.default)(p.default.file_tree_node_segment,p.default.file_tree_node_tail)},x()),x=()=>null,N=K=>{if(I)return R(K,D);if(S)return R(K,()=>{})},j=()=>s.tooltip||s.name;return o.default.createElement("div",{key:s.id,onClick:T,title:j(),className:(0,r.default)(w,_?_.classlist:null),style:L,draggable:c===l.TreeNodeType.TreeNode||c===l.TreeNodeType.CompositeTreeNode},o.default.createElement("div",{className:(0,r.default)(p.default.file_tree_node_content)},N(s),M(s),o.default.createElement("div",{className:S?p.default.file_tree_node_prompt_wrap:p.default.file_tree_node_overflow_wrap},k(s)),B()))};t.FileTreeDialogNode=v,t.FILE_TREE_NODE_HEIGHT=22,t.FILE_TREE_BADGE_LIMIT=99},68195:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileDialogContextKey=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(66e3);let m=class{initScopedContext(p){this._contextKeyService=this.globalContextKeyService.createScoped(p),this.fileDialogViewVisibleContext=l.FileDialogViewVisibleContext.bind(this._contextKeyService)}get service(){return this._contextKeyService}};t.FileDialogContextKey=m,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],m.prototype,"globalContextKeyService",void 0),t.FileDialogContextKey=m=n.__decorate([(0,r.Injectable)()],m)},9018:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeDialogService=void 0;const n=e(85608),r=e(76003),o=e(97267),l=e(41869),m=e(26542),E=e(51500),p=e(6250),v=e(68195);let s=class extends o.Tree{constructor(c){super(),this._whenReady=this.resolveWorkspaceRoot(c)}get whenReady(){return this._whenReady}async resolveWorkspaceRoot(c){if(c){const g=new l.URI(c).withScheme(l.Schemes.file),d=await this.fileTreeAPI.resolveFileStat(g);d&&(this.workspaceRoot=d)}}async resolveChildren(c){if(c){if(c.uri){const{children:g}=await this.fileTreeAPI.resolveChildren(this,c.uri.toString(),c);return g}}else{this.workspaceRoot||(this.workspaceRoot=(await this.workspaceService.roots)[0]);const{children:g}=await this.fileTreeAPI.resolveChildren(this,this.workspaceRoot);return this.root=g[0],g}return[]}async resolveRoot(c){let g;/^file:\/\//.test(c)&&(g=new l.URI(c)),g=l.URI.file(c);const d=await this.fileTreeAPI.resolveFileStat(g);if(d){const{children:u}=await this.fileTreeAPI.resolveChildren(this,d);return this.root=u[0],u}}getDirectoryList(){const c=[];if(!this.root)return c;let g=new l.URI(this.workspaceRoot.uri);if(g&&g.parent)for(;g.parent;){const d=g.codeUri.fsPath;if(c.indexOf(d)>=0)break;c.push(d),g=g.parent}else c.push(g.codeUri.fsPath.toString());return c}sortComparator(c,g){return c.constructor===g.constructor?c.name.startsWith(".")&&!g.name.startsWith(".")?1:!c.name.startsWith(".")&&g.name.startsWith(".")?-1:c.name.localeCompare(g.name,"kn",{numeric:!0}):c.type===o.TreeNodeType.CompositeTreeNode?-1:g.type===o.TreeNodeType.CompositeTreeNode?1:0}initContextKey(c){c&&this.fileDialogContextKey.initScopedContext(c)}get contextKey(){return this.fileDialogContextKey}dispose(){super.dispose()}};t.FileTreeDialogService=s,n.__decorate([(0,r.Autowired)(p.IFileTreeAPI),n.__metadata("design:type",Object)],s.prototype,"fileTreeAPI",void 0),n.__decorate([(0,r.Autowired)(E.IWorkspaceService),n.__metadata("design:type",Object)],s.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(m.LabelService),n.__metadata("design:type",m.LabelService)],s.prototype,"labelService",void 0),n.__decorate([(0,r.Autowired)(v.FileDialogContextKey),n.__metadata("design:type",v.FileDialogContextKey)],s.prototype,"fileDialogContextKey",void 0),t.FileTreeDialogService=s=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[String])],s)},51888:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileDialog=t.FILE_TREE_DIALOG_HEIGHT=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),l=e(41869),m=e(68974),E=e(72665),p=e(69748),v=n.__importDefault(e(13294));t.FILE_TREE_DIALOG_HEIGHT=22;const s=({options:h,model:c,isOpenDialog:g,fileService:d})=>{const u=(0,l.useInjectable)(E.IDialogService),_=(0,r.useRef)(null),[f,a]=(0,r.useState)(h.defaultFileName||""),[b,y]=(0,r.useState)(!1),[S,A]=(0,r.useState)(""),[w,T]=(0,r.useState)([]);(0,r.useEffect)(()=>{var G;return c&&(y(!1),O(),(G=d.contextKey.fileDialogViewVisibleContext)===null||G===void 0||G.set(!0)),()=>{c.dispose()}},[c]),(0,r.useEffect)(()=>{h.defaultFileName&&a(h.defaultFileName)},[h]),(0,r.useEffect)(()=>{if(b){const G=c.getDirectoryList();T(G)}},[b]);const D=(0,r.useCallback)(()=>{const G=c.selectedFiles.map(J=>J.uri.path.toString());if(f&&h.showNameInput&&(G?.length===1||h.defaultUri)){const J=G?.length===1?G[0]:h.defaultUri.path.toString();u.hide([l.path.join(J,f)])}else G.length>0?u.hide(G):h.defaultUri?u.hide([h.defaultUri.path.toString()]):c.treeModel&&c.treeModel.root?u.hide([c.treeModel.root.uri.path.toString()]):u.hide([]);y(!1),d.contextKey.fileDialogViewVisibleContext.set(!1)},[b,u,c,f,h]),I=(0,r.useCallback)(()=>{y(!1),u.hide(),d.contextKey.fileDialogViewVisibleContext.set(!1)},[b,u]),O=(0,r.useCallback)(async()=>{await c.whenReady,await c.treeModel.ensureReady,A(c.treeModel.root.uri.codeUri.fsPath),y(!0)},[c,S,b]),L=!g,R=(0,r.useCallback)(G=>{c.handleTreeHandler({...G,getModel:()=>c.treeModel})},[c]),M=(0,r.useCallback)((G,J)=>{G.stopPropagation();const{toggleDirectory:Y}=c;Y(J)},[c]),k=(0,r.useCallback)(G=>B(G)?!1:G.shiftKey,[]),B=(0,r.useCallback)(G=>{const{metaKey:J,ctrlKey:Y}=G;return l.isMacintosh&&J||Y},[]),x=(0,r.useCallback)((G,J,Y)=>{var H;G.stopPropagation();const{handleItemClick:$,handleItemToggleClick:Z,handleItemRangeClick:re}=c;if(!J)return;const ce=k(event),ge=B(event);if(ce&&!L&&h.canSelectMany)re(J,Y);else if(ge&&!L&&h.canSelectMany)Z(J,Y);else if(L)Y===o.TreeNodeType.CompositeTreeNode&&$(J,Y);else if(h.canSelectFiles&&Y===o.TreeNodeType.TreeNode){const Ae=new Set(Object.values((H=h.filters)!==null&&H!==void 0?H:{}).flat().map(te=>`.${te}`));if(Ae.size>0){const te=l.URI.parse(J.filestat.uri).path.ext;Ae.has(te)&&$(J,Y)}else $(J,Y)}else h.canSelectFolders&&Y===o.TreeNodeType.CompositeTreeNode&&$(J,Y)},[c,L,h]),N=(0,r.useCallback)(async G=>{y(!1),A(G),await c.updateTreeModel(G),y(!0)},[c,b,S]),j=(0,r.useCallback)(G=>r.default.createElement(p.FileTreeDialogNode,{item:G.item,itemType:G.itemType,labelService:c.labelService,decorations:c.decorations.getDecorations(G.item),onClick:x,onTwistierClick:M,defaultLeftPadding:8,leftPadding:8}),[c.treeModel]),K=(0,r.useCallback)(()=>{if(b){if(c.treeModel)return r.default.createElement(o.RecycleTree,{height:300,itemHeight:t.FILE_TREE_DIALOG_HEIGHT,onReady:R,model:c.treeModel},j)}else return r.default.createElement(m.Progress,{loading:!0})},[b,c]),U=(0,r.useCallback)(()=>{if(w.length>0)return r.default.createElement(o.Select,{onChange:N,className:v.default.select_control,size:"small",value:S},w.map((G,J)=>r.default.createElement(o.Option,{value:G,key:`${J} - ${G}`},G)))},[w,S]),X=(0,r.useCallback)(G=>{const{key:J}=l.KeyCode.createKeyCode(G),Y=G.shiftKey||G.metaKey||G.altKey||G.ctrlKey;J&&l.Key.ENTER.keyCode===J.keyCode&&!Y&&D()},[D]);(0,r.useEffect)(()=>{var G;return _.current&&(d.initContextKey(_.current),d.contextKey.fileDialogViewVisibleContext.set(!0),(G=_.current)===null||G===void 0||G.addEventListener("keyup",X)),()=>{var J;(J=_.current)===null||J===void 0||J.removeEventListener("keyup",X)}},[]);const z=(0,r.useMemo)(()=>r.default.createElement(r.default.Fragment,null,r.default.createElement("div",{className:v.default.file_dialog_directory},U()),r.default.createElement("div",{className:v.default.file_dialog_content},K())),[U,K]),Q=(0,r.useMemo)(()=>r.default.createElement("div",{className:v.default.file_dialog_buttons},r.default.createElement(o.Button,{onClick:I,type:"secondary",className:v.default.button},(0,l.localize)("dialog.file.close")),r.default.createElement(o.Button,{onClick:D,type:"primary",className:v.default.button,disabled:L&&h.showNameInput&&f.length===0},g&&h.openLabel||(0,l.localize)("dialog.file.ok"))),[I,D,L,g,f,h]);return r.default.createElement("div",{className:v.default.file_dialog_wrapper,ref:_},r.default.createElement("div",{className:v.default.file_dialog_directory_title},g?h.title||(0,l.localize)("dialog.file.openLabel"):h.saveLabel||(0,l.localize)("dialog.file.saveLabel")),z,!g&&h.showNameInput&&r.default.createElement("div",{className:v.default.file_dialog_file_container},r.default.createElement("span",{className:v.default.file_dialog_file_name},(0,l.localize)("dialog.file.name"),": "),r.default.createElement(o.Input,{size:"small",value:f,autoFocus:!0,selection:{start:0,end:f.indexOf(".")||f.length},onChange:G=>a(G.target.value)})),Q)};t.FileDialog=s},89508:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WindowDialogServiceImpl=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(76003),l=e(41869),m=e(37406),E=e(14951),p=e(72665),v=e(57942),s=n.__importDefault(e(13294)),h=e(9018),c=e(51888);let g=class{constructor(){this.idx=1,this._whenReady=this.init()}async init(){this.recentGlobalStorage=await this.storageProvider(l.STORAGE_NAMESPACE.GLOBAL_RECENT_DATA);const u=await this.recentGlobalStorage.get("RECENT_DIALOG_DEFAULT_URI");if(u)this._defaultUri=new l.URI(u);else{const _=await this.fileServiceClient.getCurrentUserHome();this._defaultUri=new l.URI(_.uri)}}get defaultUri(){return this._defaultUri}get whenReady(){return this._whenReady}async updateRecentDefaultUri(u){this.recentGlobalStorage.set("RECENT_DIALOG_DEFAULT_URI",u.toString()),this._defaultUri=u}async showOpenDialog(u={}){this.dialogService.reset(),await this.whenReady;const _={canSelectFiles:!0,canSelectFolders:!1,canSelectMany:!1};if(this.appConfig.isElectronRenderer&&!this.appConfig.isRemote){const f=this.injector.get(m.IElectronMainUIService),a=[];u.canSelectFiles&&a.push("openFile"),u.canSelectFolders&&a.push("openDirectory"),u.canSelectMany&&a.push("multiSelections"),l.isMacintosh&&a.push("treatPackageAsDirectory","createDirectory");const b=u.defaultUri||this.defaultUri,y=await f.showOpenDialog(l.electronEnv.currentWindowId,{defaultPath:b.codeUri.fsPath,title:u.title,buttonLabel:u.openLabel,properties:a});if(y&&y.length>0){const S=y.map(A=>l.URI.file(A));return this.updateRecentDefaultUri(S[0].parent),S}else return}else{u.defaultUri||(u.defaultUri=this.defaultUri);let f;u.defaultUri?f=this.injector.get(h.FileTreeDialogService,[u.defaultUri.toString()]):f=this.injector.get(h.FileTreeDialogService),await f.whenReady;const a=v.FileTreeDialogModel.createModel(this.injector,f),b=await this.dialogService.open({message:r.default.createElement(c.FileDialog,{key:this.idx++,fileService:f,model:a,options:{..._,...u},isOpenDialog:!0}),type:l.MessageType.Empty,buttons:[],closable:!0,props:{className:s.default.file_dialog_wrapper}});if(this.dialogService.reset(),b&&b.length>0){const y=b.map(S=>l.URI.file(S));return this.updateRecentDefaultUri(y[0].parent),y}else return}}async showSaveDialog(u={}){if(await this.whenReady,this.appConfig.isElectronRenderer&&!this.appConfig.isRemote){const _=u.defaultUri||this.defaultUri,a=await this.injector.get(m.IElectronMainUIService).showSaveDialog(l.electronEnv.currentWindowId,{defaultPath:_.resolve(u.defaultFileName||"").codeUri.fsPath,title:u.saveLabel,message:u.saveLabel});if(a){const b=l.URI.file(a);return this.updateRecentDefaultUri(b.parent),b}else return}else{u.defaultUri||(u.defaultUri=this.defaultUri);let _;u.defaultUri?_=this.injector.get(h.FileTreeDialogService,[u.defaultUri.toString()]):_=this.injector.get(h.FileTreeDialogService),await _.whenReady;const f=v.FileTreeDialogModel.createModel(this.injector,_),a=await this.dialogService.open({message:r.default.createElement(c.FileDialog,{key:this.idx++,fileService:_,model:f,options:u,isOpenDialog:!1}),type:l.MessageType.Empty,buttons:[],closable:!0,props:{className:s.default.file_dialog_wrapper}});if(this.dialogService.reset(),a&&a.length>0){const b=l.URI.file(a[0]);return this.updateRecentDefaultUri(b.parent),b}else return}}};t.WindowDialogServiceImpl=g,n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],g.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(p.IDialogService),n.__metadata("design:type",Object)],g.prototype,"dialogService",void 0),n.__decorate([(0,o.Autowired)(E.IFileServiceClient),n.__metadata("design:type",Object)],g.prototype,"fileServiceClient",void 0),n.__decorate([(0,o.Autowired)(l.StorageProvider),n.__metadata("design:type",Function)],g.prototype,"storageProvider",void 0),n.__decorate([(0,o.Autowired)(l.AppConfig),n.__metadata("design:type",Object)],g.prototype,"appConfig",void 0),t.WindowDialogServiceImpl=g=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],g)},88014:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileContextKey=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(16413);let m=class{constructor(){this.explorerResourceIsFolder=l.ExplorerResourceIsFolderContext.bind(this.globalContextKeyService),this.explorerViewletVisibleContext=l.ExplorerViewletVisibleContext.bind(this.globalContextKeyService)}initScopedContext(p){this._contextKeyService=this.globalContextKeyService.createScoped(p),this.explorerFocused=l.ExplorerFocusedContext.bind(this._contextKeyService),this.explorerResourceCut=l.ExplorerResourceCut.bind(this._contextKeyService),this.filesExplorerFocused=l.FilesExplorerFocusedContext.bind(this._contextKeyService),this.filesExplorerInputFocused=l.FilesExplorerInputFocusedContext.bind(this._contextKeyService),this.filesExplorerFilteredContext=l.FilesExplorerFilteredContext.bind(this._contextKeyService),this.explorerCompressedFocusContext=l.ExplorerCompressedFocusContext.bind(this._contextKeyService),this.explorerCompressedFirstFocusContext=l.ExplorerCompressedFirstFocusContext.bind(this._contextKeyService),this.explorerCompressedLastFocusContext=l.ExplorerCompressedLastFocusContext.bind(this._contextKeyService)}get service(){return this._contextKeyService}};t.FileContextKey=m,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],m.prototype,"globalContextKeyService",void 0),t.FileContextKey=m=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],m)},40439:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(16413),m=e(93899),E=e(68969),p=e(98295),v=e(41893),s=e(54414),h=e(32595),c=e(63067),g=e(58296),d=e(72665),u=e(51500),_=e(6250),f=e(69959),a=e(56384),b=e(57781),y=e(97738),S=e(4446);let A=class{constructor(){this._disposables=new o.DisposableStore,this.isRendered=!1,this.deleteThrottler=new o.Throttler,this.willDeleteUris=[]}initialize(){this.workspaceService.initFileServiceExclude().then(async()=>{await this.fileTreeService.init(),this.fileTreeModelService.initTreeModel()}),this.progressService.registerProgressIndicator(h.EXPLORER_CONTAINER_ID)}async onStart(){this.viewsRegistry.registerViewWelcomeContent(_.RESOURCE_VIEW_ID,{content:(0,o.formatLocalize)("welcome-view.noFolderHelp",o.FILE_COMMANDS.OPEN_FOLDER.id),group:g.ViewContentGroups.Open,order:1}),this.mainLayoutService.collectViewComponent({id:_.RESOURCE_VIEW_ID,name:this.getWorkspaceTitle(),weight:3,priority:9,collapsed:!1,component:a.FileTree},h.EXPLORER_CONTAINER_ID),this._disposables.add(this.workspaceService.onWorkspaceLocationChanged(()=>{const T=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);T&&T.updateViewTitle(_.RESOURCE_VIEW_ID,this.getWorkspaceTitle())}))}onDidStart(){const T=this.injector.get(S.SymlinkDecorationsProvider,[this.fileTreeService]);this.decorationService.registerDecorationsProvider(T)}onDidRender(){this.isRendered=!0;const T=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);T&&(this.fileTreeModelService.whenReady.then(()=>{this.fileTreeModelService.contextKey.explorerViewletVisibleContext.set(T.isActivated())}),T.onActivate(()=>{this.fileTreeModelService.performLocationOnHandleShow(),this.fileTreeModelService.contextKey.explorerViewletVisibleContext.set(!0)}),T.onInActivate(()=>{this.fileTreeModelService.handleTreeBlur(),this.fileTreeModelService.contextKey.explorerViewletVisibleContext.set(!1)}))}getWorkspaceTitle(){let T=(0,o.localize)("file.empty.defaultTitle");const D=this.workspaceService.workspace;return D&&(T=new o.URI(D.uri).displayName,!D.isDirectory&&T.endsWith(`.${this.workspaceService.workspaceSuffixName}`)&&(T=T.slice(0,T.lastIndexOf(".")),T===u.UNTITLED_WORKSPACE))?(0,o.localize)("file.workspace.defaultTip"):T}onReconnect(){this.fileTreeService.reWatch()}revealFile(T){if(T)if(this.isRendered){const D=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);!D||!D.isVisible||D.isCollapsed(_.RESOURCE_VIEW_ID)?this.fileTreeModelService.locationOnShow(T):this.fileTreeModelService.location(T)}else this.fileTreeModelService.locationOnShow(T)}registerMenus(T){T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.NEW_FILE.id,label:(0,o.localize)("file.new")},order:1,group:"0_new"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.NEW_FOLDER.id,label:(0,o.localize)("file.folder.new")},order:2,group:"0_new"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.WORKSPACE_COMMANDS.ADD_WORKSPACE_FOLDER.id,label:(0,o.localize)("workspace.addFolderToWorkspace")},order:1,group:"0_workspace",when:"config.workspace.supportMultiRootWorkspace"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.WORKSPACE_COMMANDS.REMOVE_WORKSPACE_FOLDER.id,label:(0,o.localize)("workspace.removeFolderFromWorkspace")},order:1,group:"0_workspace",when:"config.workspace.supportMultiRootWorkspace"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_RESOURCES.id,label:(0,o.localize)("file.open")},order:1,group:"1_open"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_TO_THE_SIDE.id,label:(0,o.localize)("file.open.side")},order:2,group:"1_open"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_TYPE_WITH.id,label:(0,o.localize)("file.open.type")},order:3,group:"1_open"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_TERMINAL_WITH_PATH.id,label:(0,o.localize)("file.filetree.openTerminalWithPath")},when:"workbench.panel.terminal",order:4,group:"1_open"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.SEARCH_ON_FOLDER.id,label:(0,o.localize)("file.search.folder")},order:1,group:"2_search"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.DELETE_FILE.id,label:(0,o.localize)("file.delete")},order:1,group:"7_modification"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.RENAME_FILE.id,label:(0,o.localize)("file.rename")},order:3,group:"7_modification"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COMPARE_SELECTED.id,label:(0,o.localize)("file.compare")},order:2,group:"3_compare"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_FILE.id,label:(0,o.localize)("file.copy.file")},order:1,group:"5_cutcopypaste"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.CUT_FILE.id,label:(0,o.localize)("file.cut.file")},order:2,group:"5_cutcopypaste"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.PASTE_FILE.id,label:(0,o.localize)("file.paste.file")},order:3,group:"5_cutcopypaste"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_PATH.id,label:(0,o.localize)("file.copy.path")},group:"6_copypath"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_RELATIVE_PATH.id,label:(0,o.localize)("file.copy.relativepath")},group:"6_copypath"})}registerCommands(T){const D=()=>{this.fileTreeService.filterMode&&this.fileTreeService.toggleFilterMode()};T.registerCommand(o.FILE_COMMANDS.OPEN_TERMINAL_WITH_PATH,{execute:O=>{let L=O;if(!L)return;const R=this.fileTreeService.getNodeByPathOrUri(L);R&&!R.filestat.isDirectory&&(L=R.uri.parent),this.commandService.executeCommand(o.TERMINAL_COMMANDS.OPEN_WITH_PATH.id,L)}}),T.registerCommand(o.FILE_COMMANDS.SEARCH_ON_FOLDER,{execute:async O=>{var L;let R=O;if(R||(this.fileTreeModelService.focusedFile?R=this.fileTreeModelService.focusedFile.uri:this.fileTreeModelService.selectedFiles.length>0&&(R=(L=this.fileTreeModelService.selectedFiles[0])===null||L===void 0?void 0:L.uri)),!R)return;let M;if(this.fileTreeService.isMultipleWorkspace)for(const k of await this.workspaceService.roots){const B=new o.URI(k.uri);if(B.isEqualOrParent(R)){M=`./${B.relative(R).toString()}`;break}}else if(this.workspaceService.workspace){const k=new o.URI(this.workspaceService.workspace.uri);k.isEqualOrParent(R)&&(M=`./${k.relative(R).toString()}`)}this.commandService.executeCommand(o.SEARCH_COMMANDS.OPEN_SEARCH.id,{includeValue:M+"/"})},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&f.Directory.is(this.fileTreeModelService.contextMenuFile)}),T.registerCommand(o.FILE_COMMANDS.LOCATION,{execute:O=>{O?this.revealFile(O):this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0&&this.revealFile(this.fileTreeModelService.selectedFiles[0].uri)}}),T.registerCommand(o.FILE_COMMANDS.LOCATION_WITH_EDITOR,{execute:()=>{var O,L,R;((L=(O=this.workbenchEditorService.currentEditor)===null||O===void 0?void 0:O.currentUri)===null||L===void 0?void 0:L.scheme)===o.Schemes.file&&this.revealFile((R=this.workbenchEditorService.currentEditor)===null||R===void 0?void 0:R.currentUri)}}),T.registerCommand(o.FILE_COMMANDS.COLLAPSE_ALL,{execute:()=>{const O=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);!O||!O.isVisible||this.fileTreeModelService.collapseAll()}}),T.registerCommand(o.FILE_COMMANDS.REFRESH_ALL,{execute:async()=>{const O=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);!O||!O.isVisible||await this.fileTreeService.refresh()}}),T.registerCommand(o.FILE_COMMANDS.DELETE_FILE,{execute:(O,L)=>{if(D(),L?this.willDeleteUris=this.willDeleteUris.concat(L):this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0?this.willDeleteUris=this.willDeleteUris.concat(this.fileTreeModelService.selectedFiles.map(R=>R.uri)):this.fileTreeModelService.focusedFile&&this.willDeleteUris.push(this.fileTreeModelService.focusedFile.uri),this.willDeleteUris.length!==0)return this.deleteThrottler.queue(this.doDelete.bind(this))},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),T.registerCommand(o.FILE_COMMANDS.RENAME_FILE,{execute:O=>{if(D(),!O)if(this.fileTreeModelService.contextMenuFile)O=this.fileTreeModelService.contextMenuFile.uri;else if(this.fileTreeModelService.focusedFile)O=this.fileTreeModelService.focusedFile.uri;else return;this.fileTreeModelService.renamePrompt(O)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),T.registerCommand(o.FILE_COMMANDS.NEW_FILE,{execute:async O=>{var L;if(D(),O)this.fileTreeModelService.newFilePrompt(O);else if(this.fileTreeService.isCompactMode&&this.fileTreeModelService.activeUri)this.fileTreeModelService.newFilePrompt(this.fileTreeModelService.activeUri);else if(this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0)this.fileTreeModelService.newFilePrompt(this.fileTreeModelService.selectedFiles[0].uri);else{let R;this.fileTreeService.isMultipleWorkspace?R=new o.URI((await this.workspaceService.roots)[0].uri):R=new o.URI((L=this.workspaceService.workspace)===null||L===void 0?void 0:L.uri),this.fileTreeModelService.newFilePrompt(R)}}}),T.registerCommand(o.FILE_COMMANDS.NEW_FOLDER,{execute:async O=>{var L;if(D(),O)this.fileTreeModelService.newDirectoryPrompt(O);else if(this.fileTreeService.isCompactMode&&this.fileTreeModelService.activeUri)this.fileTreeModelService.newDirectoryPrompt(this.fileTreeModelService.activeUri);else if(this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0)this.fileTreeModelService.newDirectoryPrompt(this.fileTreeModelService.selectedFiles[0].uri);else{let R;this.fileTreeService.isMultipleWorkspace?R=new o.URI((await this.workspaceService.roots)[0].uri):R=new o.URI((L=this.workspaceService.workspace)===null||L===void 0?void 0:L.uri),this.fileTreeModelService.newDirectoryPrompt(R)}}}),T.registerCommand(o.FILE_COMMANDS.COMPARE_SELECTED,{execute:(O,L)=>{if(L&&L.length){const R=this.workbenchEditorService.currentEditor;R&&R.currentUri&&this.fileTreeService.compare(L[0],R.currentUri)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!f.Directory.is(this.fileTreeModelService.contextMenuFile)}),T.registerCommand(o.FILE_COMMANDS.OPEN_RESOURCES,{execute:O=>{this.fileTreeService.openAndFixedFile(O)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!f.Directory.is(this.fileTreeModelService.contextMenuFile)}),T.registerCommand(o.FILE_COMMANDS.OPEN_TO_THE_SIDE,{execute:O=>{this.fileTreeService.openToTheSide(O)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!f.Directory.is(this.fileTreeModelService.contextMenuFile)});const I=(O,L)=>{const{availableOpenTypes:R,currentOpenType:M}=this.workbenchEditorService.currentEditorGroup;if(!(R&&O&&M))return{items:[],selectIndex:-1};const k=this.preferenceService.get("workbench.editorAssociations"),B=[],x=(U,X)=>X.type===s.EditorOpenType.code?U.type===s.EditorOpenType.code:X.type===s.EditorOpenType.component&&U.type===s.EditorOpenType.component?U.componentId===X.componentId:!1,N=(U,X)=>(U?U+=(0,o.localize)("file.open.type.detail.and")+X:U=X,U);let j,K;if(k){const U=Object.keys(k).find(X=>(0,o.match)(X,O.path.toString().toLowerCase())||(0,o.match)(X,O.path.base.toLowerCase()));j=U&&k[U]}return R.forEach((U,X)=>{var z;const Q={label:U.title||U.componentId||U.type,detail:U.title,run:G=>L(G,U)};x(M,U)&&(Q.description=N(Q.description,(0,o.localize)("file.open.type.detail.active")),K=X),j&&(!((z=U.componentId)===null||z===void 0)&&z.endsWith(j))&&(Q.description=N(Q.description,(0,o.localize)("file.open.type.detail.default"))),B.push(new o.QuickOpenItem(Q))}),{items:B,selectIndex:K}};T.registerCommand(o.FILE_COMMANDS.OPEN_TYPE_WITH,{execute:O=>{const L=(B,x)=>{var N,j;return B===o.Mode.OPEN?((N=this.workbenchEditorService.currentEditorGroup)===null||N===void 0||N.changeOpenType((j=x.componentId)!==null&&j!==void 0?j:x.type),!0):!1},{items:R,selectIndex:M}=I(O,L);if(R.length===0||typeof M>"u")return;const k=B=>{this.quickOpenService.open({onType:(x,N)=>N(B)},{fuzzyMatchLabel:!0,ignoreFocusOut:!1,placeholder:(0,o.formatLocalize)("file.open.type.placeholder",O.path.base),selectIndex:()=>M})};R.push(new o.QuickOpenItem({label:(0,o.formatLocalize)("file.open.type.preference.default",`*${O.path.ext}`),showBorder:!0,run:B=>{if(B===o.Mode.OPEN){const x=(K,U)=>{var X,z,Q;if(K===o.Mode.OPEN){const G="workbench.editorAssociations",J=this.preferenceService.resolve(G).scope,Y=this.preferenceService.get(G);return this.preferenceService.set(G,{...Y||{},[`*${O.path.ext}`]:(X=U.componentId)!==null&&X!==void 0?X:U.type},J),(z=this.workbenchEditorService.currentEditorGroup)===null||z===void 0||z.changeOpenType((Q=U.componentId)!==null&&Q!==void 0?Q:U.type),!0}return!1},{items:N,selectIndex:j}=I(O,x);if(N.length===0||typeof j>"u")return!0;k(N)}return!1}})),k(R)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!f.Directory.is(this.fileTreeModelService.contextMenuFile)}),T.registerCommand(o.FILE_COMMANDS.COPY_PATH,{execute:async O=>{if(!O)return;let R=O.path.toString();if(O.scheme===s.DIFF_SCHEME){const k=O.getParsedQuery();R=new o.URI(k.modified).path.toString()}let M=decodeURIComponent(R);await this.appService.backendOS===o.OperatingSystem.Windows&&(M=M.slice(1)),await this.clipboardService.writeText(M)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile}),T.registerCommand(o.FILE_COMMANDS.COPY_RELATIVE_PATH,{execute:async O=>{if(!O)return;if(O.scheme===s.DIFF_SCHEME){const R=O.getParsedQuery();O=new o.URI(R.modified).withScheme("file")}let L;if(this.fileTreeService.isMultipleWorkspace)for(const R of await this.workspaceService.roots){if(L=new o.URI(R.uri),L.isEqual(O))return await this.clipboardService.writeText("./");if(L.isEqualOrParent(O))return await this.clipboardService.writeText(decodeURIComponent(L.relative(O).toString()))}else if(this.workspaceService.workspace)return L=new o.URI(this.workspaceService.workspace.uri),L.isEqual(O)?await this.clipboardService.writeText("./"):await this.clipboardService.writeText(decodeURIComponent(L.relative(O).toString()))},isVisible:()=>!!this.fileTreeModelService.contextMenuFile}),T.registerCommand(o.FILE_COMMANDS.COPY_FILE,{execute:(O,L)=>{if(L&&L.length)this.fileTreeModelService.copyFile(L);else{const R=this.fileTreeModelService.selectedFiles.map(M=>M.uri);R&&R.length&&this.fileTreeModelService.copyFile(R)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)||!!this.fileTreeModelService.focusedFile&&!this.fileTreeModelService.focusedFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),T.registerCommand(o.FILE_COMMANDS.SELECT_CURRENT_NODE,{execute:(O,L)=>{if(L&&L.length)this.fileTreeModelService.selectChildNode(L);else{const R=this.fileTreeModelService.selectedFiles.map(M=>M.uri);R&&R.length&&this.fileTreeModelService.selectChildNode(R)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)||!!this.fileTreeModelService.focusedFile&&!this.fileTreeModelService.focusedFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),T.registerCommand(o.FILE_COMMANDS.CUT_FILE,{execute:(O,L)=>{if(L&&L.length)this.fileTreeModelService.cutFile(L);else{const R=this.fileTreeModelService.selectedFiles.map(M=>M.uri);R&&R.length&&this.fileTreeModelService.cutFile(R)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)||!!this.fileTreeModelService.focusedFile&&!this.fileTreeModelService.focusedFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),T.registerCommand(o.FILE_COMMANDS.PASTE_FILE,{execute:O=>{if(D(),O)this.fileTreeModelService.pasteFile(O);else if(this.fileTreeModelService.focusedFile){let L;this.fileTreeModelService.activeUri?L=this.fileTreeModelService.activeUri:L=this.fileTreeModelService.focusedFile.uri,this.fileTreeModelService.pasteFile(L)}},isEnabled:()=>this.fileTreeModelService.pasteStore&&this.fileTreeModelService.pasteStore.type!==_.PasteTypes.NONE||this.appConfig.isElectronRenderer}),T.registerCommand(o.FILE_COMMANDS.VSCODE_OPEN_FOLDER,{execute:(O,L)=>{const R=this.injector.get(o.IWindowService),M={newWindow:!0};return typeof L=="boolean"?M.newWindow=L:M.newWindow=typeof L?.forceNewWindow=="boolean"?L.forceNewWindow:!0,O?R.openWorkspace(O,M):this.commandService.executeCommand(o.FILE_COMMANDS.OPEN_FOLDER.id,M)},isVisible:()=>{const O=this.preferenceService.get("application.supportsOpenFolder");return O??!1}}),T.registerCommand(o.FILE_COMMANDS.OPEN_FOLDER,{execute:O=>{const L=this.injector.get(o.IWindowService);this.appConfig.isElectronRenderer?this.injector.get(o.IElectronNativeDialogService).showOpenDialog({title:(0,o.localize)("workspace.openDirectory"),properties:["openDirectory"]}).then(M=>{M&&M.length>0&&L.openWorkspace(o.URI.file(M[0]),O||{newWindow:!0})}):this.injector.get(d.IWindowDialogService).showOpenDialog({title:(0,o.localize)("workspace.openDirectory"),canSelectFiles:!1,canSelectFolders:!0}).then(M=>{var k;M&&M.length>0&&this.injector.get(u.IWorkspaceService).open(M[0],{preserveWindow:(k=O?.newWindow)!==null&&k!==void 0?k:!1})})},isVisible:()=>{const O=this.preferenceService.get("application.supportsOpenFolder");return O??!1}}),T.registerCommand(o.FILE_COMMANDS.OPEN_WORKSPACE,{execute:O=>{if(!this.preferenceService.get("application.supportsOpenWorkspace"))return;const R=this.injector.get(o.IWindowService);this.appConfig.isElectronRenderer?this.injector.get(o.IElectronNativeDialogService).showOpenDialog({title:(0,o.localize)("workspace.openWorkspace"),properties:["openFile"],filters:[{name:(0,o.localize)("workspace.openWorkspaceTitle"),extensions:[this.workspaceService.workspaceSuffixName]}]}).then(k=>{k&&k.length>0&&R.openWorkspace(o.URI.file(k[0]),O||{newWindow:!0})}):this.injector.get(d.IWindowDialogService).showOpenDialog({title:(0,o.localize)("workspace.openWorkspace"),canSelectFiles:!0,canSelectFolders:!1,canSelectMany:!1,filters:{workspace:[this.workspaceService.workspaceSuffixName]}}).then(k=>{var B;k&&k.length>0&&this.injector.get(u.IWorkspaceService).open(k[0],{preserveWindow:(B=O?.newWindow)!==null&&B!==void 0?B:!1})})},isVisible:()=>{const O=this.preferenceService.get("application.supportsOpenWorkspace");return O??!1}}),T.registerCommand(o.FILE_COMMANDS.REVEAL_IN_EXPLORER,{execute:O=>{var L;let R=O instanceof o.URI?O:O?.uri;const M=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);M&&!M.isVisible&&M.activate(),M&&M.isCollapsed(_.RESOURCE_VIEW_ID)&&M?.setCollapsed(_.RESOURCE_VIEW_ID,!1),!R&&(!((L=this.workbenchEditorService.currentEditor)===null||L===void 0)&&L.currentUri)&&(R=this.workbenchEditorService.currentEditor.currentUri),R&&this.revealFile(o.URI.parse(R.toString()))}}),T.registerCommand(o.FILE_COMMANDS.FOCUS_FILES,{execute:()=>{const O=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);O&&O.activate()}}),T.registerCommand(o.FILE_COMMANDS.OPEN_FILE,{execute:O=>this.windowDialogService.showOpenDialog(O)}),T.registerCommand(o.FILE_COMMANDS.SAVE_FILE,{execute:O=>this.windowDialogService.showSaveDialog(O)}),T.registerCommand(o.FILE_COMMANDS.FILTER_TOGGLE,{execute:()=>this.fileTreeService.toggleFilterMode()}),T.registerCommand(o.FILE_COMMANDS.FILTER_OPEN,{execute:()=>{if(!this.fileTreeService.filterMode)return this.fileTreeService.toggleFilterMode()}}),T.registerCommand(o.FILE_COMMANDS.FILTER_CLOSE,{execute:()=>{this.fileTreeService.filterMode&&this.fileTreeService.toggleFilterMode()}}),T.registerCommand(o.FILE_COMMANDS.NEXT,{execute:()=>{this.fileTreeModelService.moveToNext()}}),T.registerCommand(o.FILE_COMMANDS.PREV,{execute:()=>{this.fileTreeModelService.moveToPrev()}}),T.registerCommand(o.FILE_COMMANDS.COLLAPSE,{execute:()=>{this.fileTreeModelService.collapseCurrentFile()}}),T.registerCommand(o.FILE_COMMANDS.EXPAND,{execute:()=>{this.fileTreeModelService.expandCurrentFile()}}),T.registerCommand(o.FILE_COMMANDS.TOGGLE_OR_OPEN,{execute:()=>{this.fileTreeModelService.toggleOrOpenCurrentFile()}}),T.registerCommand(o.WORKSPACE_COMMANDS.REMOVE_WORKSPACE_FOLDER,{execute:async(O,L)=>{if(D(),!L.length||!this.workspaceService.isMultiRootWorkspaceOpened)return;const R=await this.workspaceService.roots,M=L.filter(k=>R.find(B=>B.uri===k.toString()));M.length>0&&await this.workspaceService.removeRoots(M)},isVisible:()=>this.workspaceService.isMultiRootWorkspaceOpened&&!!this.fileTreeModelService.contextMenuFile&&!!this.workspaceService.tryGetRoots().find(O=>{var L;return O.uri===((L=this.fileTreeModelService.contextMenuFile)===null||L===void 0?void 0:L.uri.toString())})})}registerKeybindings(T){T.registerKeybinding({command:o.FILE_COMMANDS.COPY_FILE.id,keybinding:"ctrlcmd+c",when:`${l.FilesExplorerFocusedContext.raw} && !${l.FilesExplorerInputFocusedContext.raw} && !${l.FilesExplorerFilteredContext.raw}`}),T.registerKeybinding({command:o.FILE_COMMANDS.PASTE_FILE.id,keybinding:"ctrlcmd+v",when:`${l.FilesExplorerFocusedContext.raw} && !${l.FilesExplorerInputFocusedContext.raw} && !${l.FilesExplorerFilteredContext.raw}`}),T.registerKeybinding({command:o.FILE_COMMANDS.CUT_FILE.id,keybinding:"ctrlcmd+x",when:`${l.FilesExplorerFocusedContext.raw} && !${l.FilesExplorerInputFocusedContext.raw} && !${l.FilesExplorerFilteredContext.raw}`}),T.registerKeybinding({command:o.FILE_COMMANDS.SELECT_CURRENT_NODE.id,keybinding:"ctrlcmd+a",when:`${l.FilesExplorerFocusedContext.raw} && !${l.FilesExplorerInputFocusedContext.raw} && !${l.FilesExplorerFilteredContext.raw}`}),T.registerKeybinding({command:o.FILE_COMMANDS.RENAME_FILE.id,keybinding:"enter",when:`${l.FilesExplorerFocusedContext.raw} && !${l.FilesExplorerInputFocusedContext.raw} && !${l.FilesExplorerFilteredContext.raw}`}),T.registerKeybinding({command:o.FILE_COMMANDS.DELETE_FILE.id,keybinding:"ctrlcmd+backspace",when:`${l.FilesExplorerFocusedContext.raw} && !${l.FilesExplorerInputFocusedContext.raw} && !${l.FilesExplorerFilteredContext.raw}`}),T.registerKeybinding({command:o.FILE_COMMANDS.FILTER_OPEN.id,keybinding:"ctrlcmd+f",when:`${l.FilesExplorerFocusedContext.raw} && !${l.FilesExplorerFilteredContext.raw}`}),T.registerKeybinding({command:o.FILE_COMMANDS.FILTER_CLOSE.id,keybinding:"esc",when:`${l.FilesExplorerFocusedContext.raw} && ${l.FilesExplorerFilteredContext.raw}`}),T.registerKeybinding({command:o.FILE_COMMANDS.NEXT.id,keybinding:"down",when:`${l.FilesExplorerFocusedContext.raw} && !${l.FilesExplorerInputFocusedContext.raw} && !${l.FilesExplorerFilteredContext.raw}`}),T.registerKeybinding({command:o.FILE_COMMANDS.PREV.id,keybinding:"up",when:`${l.FilesExplorerFocusedContext.raw} && !${l.FilesExplorerInputFocusedContext.raw} && !${l.FilesExplorerFilteredContext.raw}`}),T.registerKeybinding({command:o.FILE_COMMANDS.EXPAND.id,keybinding:"right",when:`${l.FilesExplorerFocusedContext.raw} && !${l.FilesExplorerInputFocusedContext.raw} && !${l.FilesExplorerFilteredContext.raw}`}),T.registerKeybinding({command:o.FILE_COMMANDS.COLLAPSE.id,keybinding:"left",when:`${l.FilesExplorerFocusedContext.raw} && !${l.FilesExplorerInputFocusedContext.raw} && !${l.FilesExplorerFilteredContext.raw}`}),T.registerKeybinding({command:o.FILE_COMMANDS.TOGGLE_OR_OPEN.id,keybinding:"space",when:`${l.FilesExplorerFocusedContext.raw} && !${l.FilesExplorerInputFocusedContext.raw} && !${l.FilesExplorerFilteredContext.raw}`})}registerToolbarItems(T){T.registerItem({id:o.FILE_COMMANDS.LOCATION_WITH_EDITOR.id,command:o.FILE_COMMANDS.LOCATION_WITH_EDITOR.id,label:(0,o.localize)("file.location"),viewId:_.RESOURCE_VIEW_ID,when:`view == '${_.RESOURCE_VIEW_ID}' && !config.explorer.autoReveal && !${l.FilesExplorerFilteredContext.raw}`,order:0}),T.registerItem({id:o.FILE_COMMANDS.NEW_FILE.id,command:o.FILE_COMMANDS.NEW_FILE.id,label:(0,o.localize)("file.new"),viewId:_.RESOURCE_VIEW_ID,when:`view == '${_.RESOURCE_VIEW_ID}' && !${l.FilesExplorerFilteredContext.raw}`,order:1}),T.registerItem({id:o.FILE_COMMANDS.NEW_FOLDER.id,command:o.FILE_COMMANDS.NEW_FOLDER.id,label:(0,o.localize)("file.folder.new"),viewId:_.RESOURCE_VIEW_ID,when:`view == '${_.RESOURCE_VIEW_ID}' && !${l.FilesExplorerFilteredContext.raw}`,order:2}),T.registerItem({id:o.FILE_COMMANDS.FILTER_TOGGLE.id,command:o.FILE_COMMANDS.FILTER_TOGGLE.id,label:(0,o.localize)("file.filetree.filter"),viewId:_.RESOURCE_VIEW_ID,toggledWhen:`${l.FilesExplorerFilteredContext.raw}`,order:3}),T.registerItem({id:o.FILE_COMMANDS.REFRESH_ALL.id,command:o.FILE_COMMANDS.REFRESH_ALL.id,label:(0,o.localize)("file.refresh"),viewId:_.RESOURCE_VIEW_ID,when:`view == '${_.RESOURCE_VIEW_ID}' && !${l.FilesExplorerFilteredContext.raw}`,order:4}),T.registerItem({id:o.FILE_COMMANDS.COLLAPSE_ALL.id,command:o.FILE_COMMANDS.COLLAPSE_ALL.id,label:(0,o.localize)("file.collapse"),viewId:_.RESOURCE_VIEW_ID,order:5}),T.registerItem({id:o.WORKSPACE_COMMANDS.ADD_WORKSPACE_FOLDER.id,command:o.WORKSPACE_COMMANDS.ADD_WORKSPACE_FOLDER.id,label:(0,o.localize)("workspace.addFolderToWorkspace"),viewId:_.RESOURCE_VIEW_ID,order:0,group:"file_explore_workspace",when:"config.workspace.supportMultiRootWorkspace"})}doDelete(){const T=this.willDeleteUris.slice();return this.willDeleteUris=[],this.fileTreeModelService.deleteFileByUris(T)}dispose(){this._disposables.dispose()}};t.FileTreeContribution=A,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],A.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(_.IFileTreeService),n.__metadata("design:type",b.FileTreeService)],A.prototype,"fileTreeService",void 0),n.__decorate([(0,r.Autowired)(c.IMainLayoutService),n.__metadata("design:type",Object)],A.prototype,"mainLayoutService",void 0),n.__decorate([(0,r.Autowired)(E.IProgressService),n.__metadata("design:type",Object)],A.prototype,"progressService",void 0),n.__decorate([(0,r.Autowired)(u.IWorkspaceService),n.__metadata("design:type",Object)],A.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(y.FileTreeModelService),n.__metadata("design:type",y.FileTreeModelService)],A.prototype,"fileTreeModelService",void 0),n.__decorate([(0,r.Autowired)(v.IDecorationsService),n.__metadata("design:type",v.IDecorationsService)],A.prototype,"decorationService",void 0),n.__decorate([(0,r.Autowired)(s.WorkbenchEditorService),n.__metadata("design:type",s.WorkbenchEditorService)],A.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],A.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(d.IWindowDialogService),n.__metadata("design:type",Object)],A.prototype,"windowDialogService",void 0),n.__decorate([(0,r.Autowired)(o.IClipboardService),n.__metadata("design:type",Object)],A.prototype,"clipboardService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],A.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(o.QuickOpenService),n.__metadata("design:type",Object)],A.prototype,"quickOpenService",void 0),n.__decorate([(0,r.Autowired)(c.IViewsRegistry),n.__metadata("design:type",Object)],A.prototype,"viewsRegistry",void 0),n.__decorate([(0,r.Autowired)(o.IApplicationService),n.__metadata("design:type",Object)],A.prototype,"appService",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],A.prototype,"appConfig",void 0),t.FileTreeContribution=A=n.__decorate([(0,p.Domain)(m.MenuContribution,o.CommandContribution,o.KeybindingContribution,o.TabBarToolbarContribution,o.ClientAppContribution,c.MainLayoutContribution)],A)},2812:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeModel=void 0;const r=e(85608),o=e(76003),l=e(97267),m=e(41869),E=e(69959),p=e(93239);let v=n=class extends l.TreeModel{constructor(h){super(),this.flushDispatchChangeDelayer=new m.ThrottledDelayer(n.DEFAULT_FLUSH_DELAY),this.init(h)}init(h){this.root=h,this.root.watcher.on(l.TreeNodeEvent.BranchDidUpdate,this.doDispatchChange.bind(this)),this.decorationService.onDidChange(this.doDispatchChange.bind(this))}doDispatchChange(){this.flushDispatchChangeDelayer.isTriggered()||this.flushDispatchChangeDelayer.cancel(),this.flushDispatchChangeDelayer.trigger(async()=>{this.dispatchChange()})}};t.FileTreeModel=v,v.DEFAULT_FLUSH_DELAY=100,r.__decorate([(0,o.Autowired)(p.FileTreeDecorationService),r.__metadata("design:type",p.FileTreeDecorationService)],v.prototype,"decorationService",void 0),t.FileTreeModel=v=n=r.__decorate([(0,o.Injectable)({multiple:!0}),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[E.Directory])],v)},46377:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FILE_TREE_BADGE_LIMIT=t.FILE_TREE_NODE_HEIGHT=t.FileTreeNode=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),l=e(97267),m=e(41869),E=e(69959),p=n.__importDefault(e(89200)),{Path:v}=m.path,s=({item:h,onClick:c,onDoubleClick:g,onContextMenu:d,dndService:u,itemType:_,decorationService:f,labelService:a,leftPadding:b=8,onTwistierClick:y,decorations:S,defaultLeftPadding:A=8,template:w,hasFolderIcons:T,hasFileIcons:D,hidesExplorerArrows:I,hasPrompt:O,iconService:L})=>{const[R,M]=o.default.useState(-1),k=_===l.TreeNodeType.RenamePrompt,B=_===l.TreeNodeType.NewPrompt,x=k||B,N=!x&&h.name.indexOf(v.separator)>=0,j=(0,m.useDesignStyles)(p.default.expansion_toggle,"expansion_toggle"),K=(0,m.useDesignStyles)(p.default.file_tree_node,"file_tree_node"),U=x?null:f.getDecoration(h.uri,E.Directory.is(h)),X=ye=>{(_===l.TreeNodeType.TreeNode||_===l.TreeNodeType.CompositeTreeNode)&&(N&&M(h.name.split(v.separator).length-1),c(ye,h,_))},z=ye=>{(_===l.TreeNodeType.TreeNode||_===l.TreeNodeType.CompositeTreeNode)&&(N&&M(h.name.split(v.separator).length-1),g(ye,h,_))},Q=ye=>{(_===l.TreeNodeType.TreeNode||_===l.TreeNodeType.CompositeTreeNode)&&(y?y(ye,h,_):c(ye,h,_))},G=o.default.useCallback(ye=>{ye.nativeEvent.which!==0&&(_===l.TreeNodeType.TreeNode||_===l.TreeNodeType.CompositeTreeNode)&&d(ye,h,_)},[d,h]),J=o.default.useCallback(ye=>{const{handleDragStart:_e}=u;(_===l.TreeNodeType.TreeNode||_===l.TreeNodeType.CompositeTreeNode)&&_e(ye,h)},[u,h]),Y=o.default.useCallback(ye=>{const{handleDragLeave:_e}=u;(_===l.TreeNodeType.TreeNode||_===l.TreeNodeType.CompositeTreeNode)&&_e(ye,h)},[u,h]),H=o.default.useCallback(ye=>{const{handleDragEnter:_e}=u;(_===l.TreeNodeType.TreeNode||_===l.TreeNodeType.CompositeTreeNode)&&_e(ye,h)},[u,h]),$=o.default.useCallback(ye=>{const{handleDrop:_e}=u;(_===l.TreeNodeType.TreeNode||_===l.TreeNodeType.CompositeTreeNode)&&_e(ye,h)},[u,h]),Z=o.default.useCallback(ye=>{const{handleDragOver:_e}=u;(_===l.TreeNodeType.TreeNode||_===l.TreeNodeType.CompositeTreeNode)&&_e(ye,h)},[u,h]);let re=_===l.TreeNodeType.CompositeTreeNode,ce;x?B?(re=h.type===l.TreeNodeType.CompositeTreeNode,ce=`${A+(h.parent.depth+1||0)*(b||0)+(re?0:T?I?0:20:0)}px`):(re=h.target.type===l.TreeNodeType.CompositeTreeNode,ce=`${A+(h.target.depth||0)*(b||0)+(re?0:T?I?0:20:0)}px`):ce=`${A+(h.depth||0)*(b||0)+(re?0:T?I?0:20:0)}px`;const ge={color:U?U.color:"",height:t.FILE_TREE_NODE_HEIGHT,lineHeight:`${t.FILE_TREE_NODE_HEIGHT}px`,paddingLeft:ce,opacity:O&&!x?".6":"1"},Ae=(ye,_e)=>{if(S&&S?.classlist.indexOf(p.default.mod_loading)>-1)return o.default.createElement(l.Loading,null);if(x&&ye instanceof l.PromptHandle){let Ce=!1;if(k?Ce=ye.target.type===l.TreeNodeType.CompositeTreeNode:Ce=ye.type===l.TreeNodeType.CompositeTreeNode,Ce)return o.default.createElement("div",{className:(0,r.default)(p.default.file_tree_node_segment,j,(0,m.getIcon)("arrow-right"),{[`${p.default.mod_collapsed}`]:B||!(k&&ye.target.type===l.TreeNodeType.CompositeTreeNode&&ye.target.expanded)})})}else return o.default.createElement("div",{onClick:_e,className:(0,r.default)(p.default.file_tree_node_segment,j,(0,m.getIcon)("arrow-right"),{[`${p.default.mod_collapsed}`]:!ye.expanded})})},te=ye=>{let _e,Ce;x&&ye instanceof l.PromptHandle?ye instanceof l.RenamePromptHandle?(_e=ye.target.uri.resolve(ye.$.value),Ce=E.Directory.is(ye.target)):(_e=ye.parent.uri.resolve(ye.$.value),Ce=ye.type===l.TreeNodeType.CompositeTreeNode):(_e=ye.uri,Ce=ye.filestat.isDirectory);const Ee=a.getIcon(_e,{isDirectory:Ce,isOpenedDirectory:Ce&&ye.expanded});return Ce&&!T||!Ce&&!D?null:o.default.createElement("div",{className:(0,r.default)(p.default.file_icon,Ee,{expanded:Ce&&ye.expanded}),style:{height:t.FILE_TREE_NODE_HEIGHT,lineHeight:`${t.FILE_TREE_NODE_HEIGHT}px`}})},Pe=ye=>{if(w)return o.default.createElement(w,null);if(x&&ye instanceof l.PromptHandle)return o.default.createElement("div",{className:(0,r.default)(p.default.file_tree_node_segment,p.default.file_tree_node_inputbox)},o.default.createElement("div",{className:(0,r.default)("input-box",p.default.file_tree_node_prompt_box)},o.default.createElement(ye.ProxiedInput,{wrapperStyle:{height:t.FILE_TREE_NODE_HEIGHT,padding:"0 5px"}})));if(N){const _e=ye.displayName.split(v.separator),Ce=_e.map((Ee,xe)=>{const Ye=_e.slice(0,xe+1).join(v.separator),Ue=We=>{We.stopPropagation(),M(xe);const Ve=h.parent.uri.resolve(_e.slice(0,xe+1).join(v.separator));c(We,h,_,Ve)},Qe=We=>{We.stopPropagation(),M(xe);const Ve=h.parent.uri.resolve(_e.slice(0,xe+1).join(v.separator));d(We,h,_,Ve)},we=We=>{We.stopPropagation(),We.preventDefault(),R!==xe&&(M(xe),u.handleDragOver(We,h))},le=We=>{We.stopPropagation(),We.preventDefault(),M(-1)},Se=We=>{We.stopPropagation(),R!==xe&&M(xe);const Ve=h.parent.uri.resolve(_e.slice(0,xe+1).join(v.separator));u.handleDragStart(We,h,Ve)},Oe=We=>{const Ve=h.parent.uri.resolve(_e.slice(0,xe+1).join(v.separator));u.handleDrop(We,h,Ve)},Fe=(0,r.default)(R===xe&&p.default.active,p.default.compact_name);return o.default.createElement("span",{key:Ye},o.default.createElement("a",{className:Fe,draggable:!0,onContextMenu:Qe,onDragStart:Se,onDragOver:we,onDragLeave:le,onDrop:Oe,onClick:Ue},Ee),xe!==_e.length-1?o.default.createElement("span",{className:p.default.compact_name_separator},v.separator):null)});return o.default.createElement("div",{className:(0,r.default)(p.default.file_tree_node_segment,p.default.file_tree_node_displayname)},Ce)}return o.default.createElement("div",{className:(0,r.default)(p.default.file_tree_node_segment,p.default.file_tree_node_displayname)},a.getName(ye.uri)||ye.displayName)},Te=()=>o.default.createElement("div",{className:(0,r.default)(p.default.file_tree_node_segment,p.default.file_tree_node_tail)},ie()),ie=()=>U?o.default.createElement("div",{className:p.default.file_tree_node_status},(0,m.transformLabelWithCodicon)(U.badge.slice(),{color:"inherit"},L.fromString.bind(L))):null,se=ye=>{if(I)return null;if(re)return Ae(ye,Q);if(x)return Ae(ye,()=>{})},me=()=>{let ye=h.tooltip;return U&&U.badge&&(ye+=` \u2022 ${U.tooltip}`),ye};return o.default.createElement("div",{key:h.id,onClick:X,onDoubleClick:z,onContextMenu:G,onDragStart:J,onDragOver:Z,onDragEnter:H,onDragLeave:Y,onDrop:$,title:me(),className:(0,r.default)(K,S?S.classlist:null),style:ge,draggable:_===l.TreeNodeType.TreeNode||_===l.TreeNodeType.CompositeTreeNode,"data-id":h.id},o.default.createElement("div",{className:(0,r.default)(p.default.file_tree_node_content)},se(h),te(h),o.default.createElement("div",{className:x?p.default.file_tree_node_prompt_wrap:p.default.file_tree_node_overflow_wrap},Pe(h)),Te()))};t.FileTreeNode=s,t.FILE_TREE_NODE_HEIGHT=22,t.FILE_TREE_BADGE_LIMIT=99},56384:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTree=t.FILE_TREE_FILTER_DELAY=t.FILTER_AREA_HEIGHT=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(97267),m=e(41869),E=e(68974),p=e(24429),v=e(87420),s=e(6250),h=e(46377),c=n.__importDefault(e(2613)),g=e(97738);t.FILTER_AREA_HEIGHT=30,t.FILE_TREE_FILTER_DELAY=500;const d=(0,l.RecycleTreeFilterDecorator)(l.RecycleTree),u=({viewState:f})=>{const[a,b]=(0,o.useState)(!1),[y,S]=(0,o.useState)(!0),[A,w]=(0,o.useState)(!1),[T,D]=(0,o.useState)(!1),[I,O]=(0,o.useState)(),L=(0,o.useRef)(null),R=(0,o.useRef)(new m.DisposableCollection),{height:M}=f,k=(0,m.useInjectable)(s.IFileTreeService),{iconService:B,locationToCurrentFile:x,filterMode:N,indent:j,baseIndent:K}=k,U=(0,m.useInjectable)(g.FileTreeModelService),[X,z]=(0,o.useState)({indent:j,baseIndent:K}),[Q,G]=(0,o.useState)(N),[J,Y]=(0,o.useState)(B.currentTheme||{hasFolderIcons:!0,hasFileIcons:!0,hidesExplorerArrows:!0}),H=(0,o.useCallback)(Ye=>$(Ye)?!1:Ye.shiftKey,[]),$=(0,o.useCallback)(Ye=>{const{metaKey:Ue,ctrlKey:Qe}=Ye;return m.isOSX&&Ue||Qe},[]),Z=(0,o.useCallback)((Ye,Ue,Qe,we)=>{Ye.stopPropagation();const{handleItemClick:le,handleItemToggleClick:Se,handleItemRangeClick:Oe}=U;if(!Ue)return;const Fe=H(Ye),We=$(Ye);Fe?Oe(Ue,Qe):We?Se(Ue,Qe):le(Ue,Qe,we)},[]),re=(0,o.useCallback)((Ye,Ue,Qe)=>{Ye.stopPropagation();const{handleItemDoubleClick:we}=U;Ue&&we(Ue,Qe)},[]),ce=(0,o.useCallback)((Ye,Ue)=>{Ye.stopPropagation();const{toggleDirectory:Qe}=U;Qe(Ue)},[]);(0,o.useEffect)(()=>{a&&U.onFileTreeModelChange(async Ye=>{S(!0),Ye&&await Ye.ensureReady,O(Ye),S(!1)})},[a]),(0,o.useEffect)(()=>{var Ye,Ue,Qe;const we=new m.CancellationTokenSource;return te(we.token),(Ye=R.current)===null||Ye===void 0||Ye.push(B.onThemeChange(le=>{Y(le)})),(Ue=R.current)===null||Ue===void 0||Ue.push(k.onTreeIndentChange(({indent:le,baseIndent:Se})=>{z({indent:le,baseIndent:Se})})),(Qe=R.current)===null||Qe===void 0||Qe.push(k.onFilterModeChange(le=>{G(le)})),()=>{var le;we.cancel(),(le=R.current)===null||le===void 0||le.dispose()}},[]);const ge=(0,o.useCallback)((Ye,Ue)=>{let Qe;if(Ye&&Ue)for(Qe=Ye.parentNode;Qe;){if(Ue===Qe)return!0;Qe=Qe.parentNode}return!1},[]),Ae=(0,o.useCallback)(Ye=>{ge(Ye.relatedTarget,L.current)||!Ye.relatedTarget||(w(!1),U.handleTreeBlur())},[L.current]);(0,o.useEffect)(()=>{Q||(U.fileTreeHandle&&U.fileTreeHandle.clearFilter(),U.selectedFiles.length===1&&U.location(U.selectedFiles[0].uri))},[Q]),(0,o.useEffect)(()=>{const Ye=new m.DisposableCollection;return I&&(Ye.push(U.onDidFocusedFileChange(Ue=>{Ue?Ue.isEqual((I?.root).uri)?A||w(!A):A&&w(!A):Ue||A&&w(!A)})),Ye.push(U.onDidContextMenuFileChange(Ue=>{Ue?Ue.isEqual((I?.root).uri)?A||w(!A):A&&w(!A):Ue||A&&w(!A)}))),()=>{Ye.dispose()}},[I,A]);const te=(0,o.useCallback)(async Ye=>{var Ue;if(await U.whenReady,!Ye.isCancellationRequested){if(U.treeModel){if(await U.treeModel.ensureReady,O(U.treeModel),Ye.isCancellationRequested)return;L.current&&k.initContextKey(L.current)}S(!1),!((Ue=R.current)===null||Ue===void 0)&&Ue.disposed||b(!0)}},[U,R.current]),Pe=(0,o.useCallback)(Ye=>{U.handleTreeHandler({...Ye,getModel:()=>U.treeModel,hasDirectFocus:()=>L.current===document.activeElement})},[L.current,I]),Te=(0,o.useCallback)(()=>{const{handleItemClick:Ye}=U;Ye()},[]),ie=(0,o.useCallback)(()=>{U.handleDblClick()},[]),se=(0,o.useCallback)(()=>{const{handleTreeFocus:Ye}=U;Ye()},[]),me=(0,o.useCallback)(Ye=>{const{handleContextMenu:Ue}=U;Ue(Ye)},[]),ye=(0,o.useCallback)(Ye=>{Ye.stopPropagation(),Ye.preventDefault()},[]),_e=(0,o.useCallback)(Ye=>{Ye.preventDefault(),D(!0)},[]),Ce=(0,o.useCallback)(()=>{D(!1)},[]),Ee=(0,o.useCallback)(Ye=>{const{handleDrop:Ue}=U.dndService;D(!1),Ue(Ye)},[]),xe=(0,o.useCallback)((Ye,Ue,Qe,we)=>{const{handleContextMenu:le}=U;le(Ye,Ue,we)},[]);return o.default.createElement("div",{className:(0,r.default)(c.default.file_tree,T&&c.default.outer_drag_over,A&&c.default.outer_active),tabIndex:-1,ref:L,onClick:Te,onDoubleClick:ie,onFocus:se,onBlur:Ae,onContextMenu:me,draggable:!0,onDragStart:ye,onDragLeave:Ce,onDragOver:_e,onDrop:Ee},o.default.createElement(_,{isLoading:y,isReady:a,height:M,model:I,iconTheme:J,treeIndent:X,filterMode:Q,locationToCurrentFile:x,onTreeReady:Pe,onContextMenu:xe,onItemClick:Z,onItemDoubleClick:re,onTwistierClick:ce}))};t.FileTree=u;const _=(0,o.memo)(({isReady:f,isLoading:a,height:b,model:y,filterMode:S,treeIndent:A,iconTheme:w,onTreeReady:T,onItemClick:D,onItemDoubleClick:I,onContextMenu:O,onTwistierClick:L})=>{const R=(0,m.useInjectable)(s.IFileTreeService),M=(0,m.useInjectable)(v.IIconService),{decorationService:k,labelService:B,locationToCurrentFile:x}=R,N=(0,m.useInjectable)(g.FileTreeModelService),j=(0,o.useCallback)(K=>o.default.createElement(h.FileTreeNode,{item:K.item,itemType:K.itemType,template:K.template,decorationService:k,labelService:B,iconService:M,dndService:N.dndService,decorations:N.decorations.getDecorations(K.item),onClick:D,onDoubleClick:I,onTwistierClick:L,onContextMenu:O,defaultLeftPadding:A.baseIndent,leftPadding:A.indent,hasPrompt:K.hasPrompt,hasFolderIcons:w.hasFolderIcons,hasFileIcons:w.hasFileIcons,hidesExplorerArrows:w.hidesExplorerArrows}),[y,A,w]);return f?a?o.default.createElement(E.Progress,{loading:!0}):y?o.default.createElement(d,{height:b,itemHeight:h.FILE_TREE_NODE_HEIGHT,onReady:T,model:y,filterEnabled:S,filterAfterClear:x,filterAutoFocus:!0,leaveBottomBlank:!0},j):o.default.createElement(p.WelcomeView,{viewId:s.FILE_EXPLORER_WELCOME_ID}):o.default.createElement(E.Progress,{loading:!0})});_.displayName="FileTreeView"},57781:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeService=void 0;const n=e(85608),r=e(76003),o=e(97267),l=e(41869),m=e(18193),E=e(26542),p=e(42933),v=e(52416),s=e(51500),h=e(6250),c=e(69959),g=e(88014),d=e(93239),{Path:u}=l.path;let _=class extends o.Tree{constructor(){super(...arguments),this._fileServiceWatchers=new Map,this._symbolicFiles=new Map,this._changeEventDispatchQueue=new Set,this._readyToWatch=!1,this._watchRootsQueue=[],this.effectedNodes=[],this.onWorkspaceChangeEmitter=new l.Emitter,this.onTreeIndentChangeEmitter=new l.Emitter,this.onFilterModeChangeEmitter=new l.Emitter,this.onNodeRefreshedEmitter=new l.Emitter,this._filterMode=!1,this._refreshable=!0,this.refreshEffectNode=()=>{const a=this.effectedNodes.slice(0);if(this.effectedNodes=[],a.find(y=>c.Directory.isRoot(y)))this.refresh();else for(const y of a)this.refresh(y)},this.flushEventQueue=async()=>{if(!this._changeEventDispatchQueue||this._changeEventDispatchQueue.size===0)return;const a=Array.from(this._changeEventDispatchQueue),b=this.sortPaths(a);(!this.refreshCancelToken||this.refreshCancelToken.token.isCancellationRequested)&&(this.refreshCancelToken=new l.CancellationTokenSource);const y=(0,l.pSeries)(b.map(S=>async()=>{c.Directory.is(S.node)&&await S.node.refresh(this.refreshCancelToken)}));return this._changeEventDispatchQueue.clear(),await y},this.locationToCurrentFile=()=>{this.commandService.executeCommand(l.FILE_COMMANDS.LOCATION.id)}}get onNodeRefreshed(){return this.onNodeRefreshedEmitter.event}get refreshable(){return this._refreshable}get filterMode(){return this._filterMode}get baseIndent(){return this._baseIndent}get indent(){return this._indent}get onWorkspaceChange(){return this.onWorkspaceChangeEmitter.event}get onTreeIndentChange(){return this.onTreeIndentChangeEmitter.event}get onFilterModeChange(){return this.onFilterModeChangeEmitter.event}get isCompactMode(){return this._isCompactMode}get contextKey(){return this.fileContextKey}async init(){this._roots=await this.workspaceService.roots,await this.preferenceService.ready,this._baseIndent=this.preferenceService.getValid("explorer.fileTree.baseIndent",8),this._indent=this.preferenceService.getValid("explorer.fileTree.indent",8),this._isCompactMode=this.preferenceService.getValid("explorer.compactFolders",!0),this.toDispose.push(this.workspaceService.onWorkspaceChanged(a=>{this._roots=a;const b=new l.URI(a[0].uri),y=new c.Directory(this,void 0,b,b.displayName,a[0],this.fileTreeAPI.getReadableTooltip(b));this.root=y,this.onWorkspaceChangeEmitter.fire(y),this.refresh()})),this.toDispose.push(this.workspaceService.onWorkspaceFileExcludeChanged(()=>{this.refresh()})),this.toDispose.push(l.Disposable.create(()=>{var a;(a=this._root)===null||a===void 0||a.dispose(),this._roots=null})),this.toDispose.push(this.corePreferences.onPreferenceChanged(a=>{a.preferenceName==="explorer.fileTree.baseIndent"?(this._baseIndent=a.newValue||8,this.onTreeIndentChangeEmitter.fire({indent:this.indent,baseIndent:this.baseIndent})):a.preferenceName==="explorer.fileTree.indent"?(this._indent=a.newValue||8,this.onTreeIndentChangeEmitter.fire({indent:this.indent,baseIndent:this.baseIndent})):a.preferenceName==="explorer.compactFolders"&&(this._isCompactMode=a.newValue,this.refresh())}))}initContextKey(a){this.fileContextKey.initScopedContext(a)}startWatchFileEvent(){return this._readyToWatch=!0,Promise.all(this._watchRootsQueue.map(a=>this.watchFilesChange(a)))}async resolveChildren(a){var b,y,S,A;let w=[];if(a){if(c.Directory.isRoot(a)&&this.isMultipleWorkspace){const T=await this.workspaceService.roots;for(const D of T){const I=this.fileTreeAPI.toNode(this,D,a,this.workspaceService.getWorkspaceName(new l.URI(D.uri)));this.watchFilesChange(new l.URI(D.uri)),w=w.concat(I),(I.filestat.isSymbolicLink||I.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(I.filestat.uri,I)}return w}if(a.uri){const T=await this.fileTreeAPI.resolveChildren(this,a.uri.toString(),a,this.isCompactMode&&!c.Directory.isRoot(a));w=T.children,w.forEach(I=>{(I.filestat.isSymbolicLink||I.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(I.filestat.uri,I)});const D=T.filestat;if(D&&this.isCompactMode&&!c.Directory.isRoot(a)){const I=new l.URI(D.uri),O=a.parent;if(a&&O){let L=a.name;if(a.filestat.isSymbolicLink){const R=(y=new l.URI(a.filestat.realUri).relative(I))===null||y===void 0?void 0:y.toString();R&&(L=R,L=[a.uri.displayName].concat(L.split(u.separator)).join(u.separator))}else O.filestat.isSymbolicLink?L=(S=new l.URI(O.filestat.realUri).relative(I))===null||S===void 0?void 0:S.toString():L=(A=O.uri.relative(I))===null||A===void 0?void 0:A.toString();L&&L!==a.name&&a.updateMetaData({name:L,uri:I,tooltip:this.fileTreeAPI.getReadableTooltip(I),fileStat:D})}}return w}}else if(this._roots||(this._roots=await this.workspaceService.roots),this.isMultipleWorkspace){const T=new l.URI((b=this.workspaceService.workspace)===null||b===void 0?void 0:b.uri);let D=T.displayName;D=D.slice(0,D.lastIndexOf("."));const I={...this.workspaceService.workspace,isDirectory:!0},O=new c.Directory(this,void 0,T,D,I,this.fileTreeAPI.getReadableTooltip(T));return this.root=O,[O]}else if(this._roots.length>0)return w=await(await this.fileTreeAPI.resolveChildren(this,this._roots[0])).children,w.forEach(T=>{const D=this.workspaceService.getWorkspaceName(T.uri);D&&D!==T.name&&T.updateMetaData({name:D}),(T.filestat.isSymbolicLink||T.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(T.filestat.uri,T)}),this.watchFilesChange(new l.URI(this._roots[0].uri)),this.root=w[0],w;return[]}async watchFilesChange(a){if(!this._readyToWatch){this._watchRootsQueue.push(a);return}const b=await this.fileServiceClient.watchFileChanges(a);this.toDispose.push(b),this.toDispose.push(b.onFilesChanged(y=>{this.onFilesChanged(y)})),this._fileServiceWatchers.set(a.toString(),b)}updateRefreshable(a){var b;a!==this.refreshable&&(this._refreshable=a,this._refreshable?this.doHandleQueueChange():(b=this.refreshCancelToken)===null||b===void 0||b.cancel())}isContentFile(a){return!!a&&"filestat"in a&&!a.filestat.isDirectory}isFileContentChanged(a){return a.type===p.FileChangeType.UPDATED&&this.isContentFile(this.getNodeByPathOrUri(a.uri))}getAffectedChanges(a){const b=[];for(const y of a)this.isFileContentChanged(y)||b.push(y);return b}isRootAffected(a){return this._roots?a.some(b=>b.type>p.FileChangeType.UPDATED&&this._roots&&this._roots.find(y=>b.uri.indexOf(y.uri)>=0)):!1}async onFilesChanged(a){const b=await this.getAffectedNodes(this.getAffectedChanges(a));return b.length>0?this.effectedNodes=this.effectedNodes.concat(b):!(b.length>0)&&this.isRootAffected(a)&&this.effectedNodes.push(this.root),this.refreshEffectNode()}async getFileTreeNodePathByUri(a){var b,y,S,A,w,T;if(!a)return;let D;if(this.isMultipleWorkspace){if(this._roots||(this._roots=await this.workspaceService.roots),D=(A=this._roots.find(I=>new l.URI(I.uri).isEqualOrParent(a)))===null||A===void 0?void 0:A.uri,D){const I=new l.URI(D);if(I.isEqualOrParent(a))return new u(((w=this.root)===null||w===void 0?void 0:w.path)||"/").join(I.displayName).join(((T=I.relative(a))===null||T===void 0?void 0:T.toString())||"").toString()}}else if(D=(b=this.workspaceService.workspace)===null||b===void 0?void 0:b.uri,D){const I=new l.URI(D);if(I.isEqualOrParent(a))return new u(((y=this.root)===null||y===void 0?void 0:y.path)||"").join(((S=I.relative(a))===null||S===void 0?void 0:S.toString())||"").toString()}}async moveNodeByPath(a,b,y,S,A=o.TreeNodeType.TreeNode){const w=new u(a.path).join(y).toString(),T=new u(b.path).join(S).toString();if(w&&T&&T!==w){const D=a.moveNode(w,T);return D&&c.File.is(D)&&(D.updateMetaData({uri:b.uri.resolve(S),fileStat:{...b.filestat,uri:b.uri.resolve(S).toString(),isDirectory:A!==o.TreeNodeType.TreeNode},tooltip:this.fileTreeAPI.getReadableTooltip(b.uri.resolve(S))}),c.Directory.is(D)&&this.updateChildren(D)),D}}async updateChildren(a){const b=a.children;if(!(!b||b.length===0)){for(const y of b)if(c.File.is(y)){const S=a.uri.resolve(y.uri.displayName);y.updateMetaData({uri:S,fileStat:{...y.filestat,uri:S.toString(),isDirectory:!!c.Directory.is(y)},tooltip:this.fileTreeAPI.getReadableTooltip(S)}),c.Directory.is(y)&&this.updateChildren(y)}}}async addNode(a,b,y){let S,A;const w=u.splitPath(b);if(w.length>1){let D=a.uri;for(const I of w)D=D.resolve(I);!this.isCompactMode||c.Directory.isRoot(a)?A=w[0]:y===o.TreeNodeType.CompositeTreeNode?A=b:A=w.slice(0,w.length-1).join(u.separator)}else A=b;S={uri:a.uri.resolve(A).toString(),isDirectory:y===o.TreeNodeType.CompositeTreeNode||w.length>1,isSymbolicLink:!1,lastModification:new Date().getTime()};const T=await this.fileTreeAPI.toNode(this,S,a,A);return T&&a.addNode(T),T}async deleteAffectedNodeByPath(a,b){var y,S;const A=this.getNodeByPathOrUri(a);A&&A.parent&&(this.isCompactMode&&!b?((y=A.parent.children)===null||y===void 0?void 0:y.length)===2?this.refresh((S=A.parent)===null||S===void 0?void 0:S.parent):this.refresh(A.parent):A.parent.removeNode(A.path))}async deleteAffectedNodes(a,b=[]){const y=[];for(const S of a){const A=this.getNodeByPathOrUri(S);A&&c.File.is(A)&&y.push(A)}for(const S of y)!S?.parent||this._changeEventDispatchQueue.has(S?.parent.path)||await this.deleteAffectedNodeByPath(S.path);return b.filter(S=>S.type!==p.FileChangeType.DELETED)}async getAffectedNodes(a){const b=[];for(const y of a){const S=new l.URI(y.uri),A=this.getNodeByPathOrUri(S.parent);A&&b.push(A)}return b}isFileURI(a){return/^file:\/\//.test(a)}getNodeByPathOrUri(a){var b,y,S,A;let w,T;if(typeof a!="string"?(T=a,a=a.toString()):this.isFileURI(a)?T=new l.URI(a):!this.isFileURI(a)&&typeof a=="string"&&(w=a),this.isFileURI(a)&&T){if(this._symbolicFiles.has(T?.toString()))return this._symbolicFiles.get(T.toString());let D;if(this.isMultipleWorkspace?this._roots&&(D=(y=this._roots.find(I=>new l.URI(I.uri).isEqualOrParent(T)))===null||y===void 0?void 0:y.uri):D=(b=this.workspaceService.workspace)===null||b===void 0?void 0:b.uri,this.root&&D){const I=new l.URI(D);if(I.isEqualOrParent(T)){const O=I.relative(T);O&&(w=new u(this.root.path).join(O.toString()).toString())}}}if(w){const D=(S=this.root)===null||S===void 0?void 0:S.getTreeNodeByPath(w);if(!D){let I;const O=w.split(u.separator);for(;O.length>=1;){O.pop();const L=O.join(u.separator);if(I=(A=this.root)===null||A===void 0?void 0:A.getTreeNodeByPath(L),I)break}if(I&&c.Directory.is(I)){for(const L of I.children||[])if(L.path.includes(w))return L}}return D}}sortComparator(a,b){return a.constructor===b.constructor?a.name.localeCompare(b.name,"en",{numeric:!0}):a.type===o.TreeNodeType.CompositeTreeNode?-1:b.type===o.TreeNodeType.CompositeTreeNode?1:0}get contextMenuContextKeyService(){return this.fileContextKey?this.fileContextKey.service:this.contextKeyService}reWatch(){for(const[a,b]of this._fileServiceWatchers)b.dispose(),this.watchFilesChange(new l.URI(a))}get isMultipleWorkspace(){return!!this.workspaceService.workspace&&!this.workspaceService.workspace.isDirectory}getDisplayName(a){return this.workspaceService.getWorkspaceName(a)}async refresh(a=this.root){if(a)return c.Directory.is(a)||c.File.is(a)&&a.parent&&(a=a.parent),this._changeEventDispatchQueue.add(a.path),this.doHandleQueueChange()}async doHandleQueueChange(){if(this.refreshable)try{await this.flushEventQueue()}catch(a){this.logger.error("flush file change event queue error:",a)}finally{this.onNodeRefreshedEmitter.fire()}}sortPaths(a){const y=a.slice().map(A=>({node:this.getNodeByPathOrUri(A),path:A})).filter(A=>A&&!!A.node);a.length>1&&y.sort((A,w)=>{var T,D;const I=((T=A.node)===null||T===void 0?void 0:T.depth)||0,O=((D=w.node)===null||D===void 0?void 0:D.depth)||0;return I-O});const S=[];for(let A=y.length-1;A>=0;A--){const w=y[A];let T=!1;for(let D=0;D<A;D++){const I=y[D];c.Directory.is(I)&&w.node.path.startsWith(I.node.path)&&(T=!0)}T||S.push(w)}return S}openFile(a){const b=this.preferenceService.get("editor.previewMode");this.commandService.executeCommand(l.EDITOR_COMMANDS.OPEN_RESOURCE.id,a,{disableNavigate:!0,preview:b})}openAndFixedFile(a){this.commandService.executeCommand(l.EDITOR_COMMANDS.OPEN_RESOURCE.id,a,{disableNavigate:!0,preview:!1,focus:!0})}openToTheSide(a){this.commandService.executeCommand(l.EDITOR_COMMANDS.OPEN_RESOURCE.id,a,{disableNavigate:!0,split:4})}compare(a,b){this.commandService.executeCommand(l.EDITOR_COMMANDS.COMPARE.id,{original:a,modified:b})}toggleFilterMode(){var a;this._filterMode=!this.filterMode,this.onFilterModeChangeEmitter.fire(this.filterMode),(a=this.fileContextKey)===null||a===void 0||a.filesExplorerFilteredContext.set(this.filterMode),this.filterMode===!1&&this.commandService.executeCommand(l.FILE_COMMANDS.LOCATION.id)}};t.FileTreeService=_,n.__decorate([(0,r.Autowired)(h.IFileTreeAPI),n.__metadata("design:type",Object)],_.prototype,"fileTreeAPI",void 0),n.__decorate([(0,r.Autowired)(l.CommandService),n.__metadata("design:type",Object)],_.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(l.IContextKeyService),n.__metadata("design:type",Object)],_.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(s.IWorkspaceService),n.__metadata("design:type",Object)],_.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(m.CorePreferences),n.__metadata("design:type",Object)],_.prototype,"corePreferences",void 0),n.__decorate([(0,r.Autowired)(l.PreferenceService),n.__metadata("design:type",Object)],_.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(E.LabelService),n.__metadata("design:type",E.LabelService)],_.prototype,"labelService",void 0),n.__decorate([(0,r.Autowired)(d.FileTreeDecorationService),n.__metadata("design:type",d.FileTreeDecorationService)],_.prototype,"decorationService",void 0),n.__decorate([(0,r.Autowired)(p.IFileServiceClient),n.__metadata("design:type",Object)],_.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(v.IIconService),n.__metadata("design:type",Object)],_.prototype,"iconService",void 0),n.__decorate([(0,r.Autowired)(l.ILogger),n.__metadata("design:type",Object)],_.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(g.FileContextKey),n.__metadata("design:type",g.FileContextKey)],_.prototype,"fileContextKey",void 0),t.FileTreeService=_=n.__decorate([(0,r.Injectable)()],_)},83709:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeNextModule=void 0;const n=e(85608),r=e(41869),o=e(72665),l=e(41103),m=e(6250),E=e(89508),p=e(40439),v=e(57781),s=e(88808),h=e(93239),c=e(97738),g=e(24861);let d=class extends r.BrowserModule{constructor(){super(...arguments),this.providers=[{token:m.IFileTreeAPI,useClass:s.FileTreeAPI},{token:h.FileTreeDecorationService,useClass:h.FileTreeDecorationService},{token:m.IFileTreeService,useClass:v.FileTreeService},{token:c.FileTreeModelService,useClass:c.FileTreeModelService},{token:o.IWindowDialogService,useClass:E.WindowDialogServiceImpl},p.FileTreeContribution]}};t.FileTreeNextModule=d,t.FileTreeNextModule=d=n.__decorate([(0,r.Domain)(g.name),(0,r.ModuleDependencies)([l.WorkspaceModule])],d)},88808:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeAPI=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),m=e(42933),E=e(72665),p=e(26199),v=e(69959);let s=class{constructor(){this.cacheFileStat=new Map}async resolveChildren(c,g,d,u){var _;let f;if(!this.userhomePath){const a=await this.fileServiceClient.getCurrentUserHome();a&&(this.userhomePath=new l.URI(a.uri))}if(typeof g=="string"?f=await this.fileServiceClient.getFileStat(g):f=await this.fileServiceClient.getFileStat(g.uri),f){if(((_=f.children)===null||_===void 0?void 0:_.length)===1&&f.children[0].isDirectory&&u)return await this.resolveChildren(c,f.children[0].uri,d,u);{const a={...f,isInSymbolicDirectory:d?.filestat.isSymbolicLink||d?.filestat.isInSymbolicDirectory};return{children:this.toNodes(c,a,d),filestat:a}}}else return{children:[],filestat:null}}async resolveNodeByPath(c,g,d){const u=await this.fileServiceClient.getFileStat(g);if(u)return this.toNode(c,u,d)}async resolveFileStat(c){return await this.fileServiceClient.getFileStat(c.toString())}toNodes(c,g,d){if(d){if(g.children)return g.children.map(u=>this.toNode(c,u,d))}else return[this.toNode(c,g,d)];return[]}toNode(c,g,d,u){var _;const f=new l.URI(g.uri),a=u||f.displayName;let b;return g.isInSymbolicDirectory=(_=d?.filestat.isSymbolicLink)!==null&&_!==void 0?_:d?.filestat.isInSymbolicDirectory,g.isDirectory?b=new v.Directory(c,d,f,a,g,this.getReadableTooltip(f)):b=new v.File(c,d,f,a,g,this.getReadableTooltip(f)),b}async mvFiles(c,g){const d=[];for(const f of c)if(f.url.isEqualOrParent(g))return;const u=c.sort((f,a)=>f.toString().length-a.toString().length),_=[];for(const f of u)_.length>0&&_.find(a=>a.url.isEqualOrParent(f.url))||_.push(f);if(this.corePreferences["explorer.confirmMove"]){const f=(0,l.localize)("file.confirm.move.ok"),a=(0,l.localize)("file.confirm.move.cancel");if(await this.dialogService.warning((0,l.formatLocalize)("file.confirm.move",`[ ${_.map(y=>y.url.displayName).join(",")} ]`,g.displayName),[a,f])!==f)return}for(const f of _){const a=await this.mv(f.url,g.resolve(f.url.displayName),f.isDirectory);a&&d.push(a)}return d}async mv(c,g,d=!1){try{await this.workspaceEditService.apply({edits:[{newResource:g,oldResource:c,options:{isDirectory:d,overwrite:!0}}]})}catch(u){return u.message}}async createFile(c,g){try{await this.workspaceEditService.apply({edits:[{newResource:c,options:{content:g}}]})}catch(d){return d.message}this.commandService.executeCommand(o.EDITOR_COMMANDS.OPEN_RESOURCE.id,c,{disableNavigate:!0,focus:!0})}async createDirectory(c){try{await this.workspaceEditService.apply({edits:[{newResource:c,options:{isDirectory:!0}}]})}catch(g){return g.message}}async delete(c){try{await this.workspaceEditService.apply({edits:[{oldResource:c,options:{}}]});return}catch(g){return g.message}}async copyFile(c,g){let d=1,u;try{u=await this.fileServiceClient.access(g.toString())}catch(_){return _.message}for(;u;){const _=g.displayName.replace(/\Wcopy\W\d+/,""),f=l.path.extname(_),b=`${l.path.basename(_,f)} copy ${d}${f}`;g=g.parent.resolve(b),d++;try{u=await this.fileServiceClient.access(g.toString())}catch{return}}try{return await this.fileServiceClient.copy(c.toString(),g.toString())}catch(_){return _.message}}getReadableTooltip(c){const g=c.toString(),d=this.userhomePath&&this.userhomePath.toString();return this.userhomePath&&this.userhomePath.isEqualOrParent(c)?decodeURIComponent(g.replace(d,"~")):decodeURIComponent(c.withScheme("").toString())}};t.FileTreeAPI=s,n.__decorate([(0,r.Autowired)(m.IFileServiceClient),n.__metadata("design:type",Object)],s.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(p.IWorkspaceEditService),n.__metadata("design:type",Object)],s.prototype,"workspaceEditService",void 0),n.__decorate([(0,r.Autowired)(l.CommandService),n.__metadata("design:type",Object)],s.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(o.CorePreferences),n.__metadata("design:type",Object)],s.prototype,"corePreferences",void 0),n.__decorate([(0,r.Autowired)(E.IDialogService),n.__metadata("design:type",Object)],s.prototype,"dialogService",void 0),t.FileTreeAPI=s=n.__decorate([(0,r.Injectable)()],s)},93239:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeDecorationService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(41893),m=e(52416);let E=class{constructor(){this.disposeCollection=new o.DisposableCollection,this.onDidChangeEmitter=new o.Emitter,this.cacheDecorations=new Map,this.disposeCollection.pushAll([this.decorationsService.onDidChangeDecorations(v=>{var s,h,c;const g=(h=(s=v._data)===null||s===void 0?void 0:s._iter)===null||h===void 0?void 0:h._value;if(g){const d=new o.URI(g),u=this.getDecoration(d);this.cacheDecorations.has(g)?((c=this.cacheDecorations.get(g))===null||c===void 0?void 0:c.tooltip)!==u?.tooltip&&this.onDidChangeEmitter.fire():(this.cacheDecorations.set(g,u),this.onDidChangeEmitter.fire())}}),this.themeService.onThemeChange(()=>{this.onDidChangeEmitter.fire()})])}get onDidChange(){return this.onDidChangeEmitter.event}getDecoration(v,s=!1){v instanceof o.URI&&(v=o.Uri.parse(v.toString()));const h=this.decorationsService.getDecoration(v,s);return h?{...h,color:this.themeService.getColor({id:h.color})}:{color:"",tooltip:"",badge:""}}dispose(){this.disposeCollection.dispose()}};t.FileTreeDecorationService=E,n.__decorate([(0,r.Autowired)(l.IDecorationsService),n.__metadata("design:type",l.IDecorationsService)],E.prototype,"decorationsService",void 0),n.__decorate([(0,r.Autowired)(m.IThemeService),n.__metadata("design:type",Object)],E.prototype,"themeService",void 0),t.FileTreeDecorationService=E=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],E)},30577:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DragAndDropService=void 0;const r=e(85608),o=e(76003),l=e(97267),m=e(41869),E=e(53622),p=e(14951),v=e(72665),s=e(51500),h=e(6250),c=e(69959),g=r.__importDefault(e(89200)),d=r.__importDefault(e(2613)),u=e(57781),_=e(97738);let f=n=class extends m.WithEventBus{constructor(b){super(),this.model=b,this.toCancelNodeExpansion=new m.DisposableCollection,this.beingDraggedDec=new l.Decoration(g.default.mod_dragging),this.draggedOverDec=new l.Decoration(g.default.mod_dragover),this.beingDraggedNodes=[],this.dragOverTrigger=new m.ThrottledDelayer(n.MS_TILL_DRAGGED_OVER_EXPANDS),this.handleDragStart=(y,S,A)=>{y.stopPropagation();const w=O=>{this.handleDragEnd(O,S)};y.currentTarget.addEventListener("dragend",w,!1);let T=this.model.selectedFiles,D=!1;for(const O of T)O&&O.id===S.id&&(D=!0);D||(T=[S]),this.beingDraggedNodes=T,this.beingDraggedActiveUri=A;const I=T.find(O=>!c.Directory.is(O));if(I&&y.dataTransfer.setData("uri",I.uri.toString()),y.dataTransfer.setData("beingDraggedNodes",JSON.stringify(this.beingDraggedNodes.map(O=>O.uri.toString()))),I){const O=I;O.uri.scheme==="file"&&y.dataTransfer.setData("DownloadURL",`application/octet-stream:${O.displayName}:data:application/octet-stream;base64,${(0,m.encodeBase64)(m.BinaryBuffer.fromString(O.filestat.uri))}`)}if(T.forEach(O=>{this.beingDraggedDec.addTarget(O,l.TargetMatchMode.Self)}),y.dataTransfer){let O;T.length===1?O=A?A.displayName:typeof S.name=="string"?S.name:"":O=String(T.length);const L=document.createElement("div");L.className=d.default.file_tree_drag_image,L.textContent=O,document.body.appendChild(L),y.dataTransfer.setDragImage(L,-10,-10),setTimeout(()=>document.body.removeChild(L),0)}},this.handleDragEnter=(y,S)=>{y.stopPropagation(),y.preventDefault()},this.handleDragLeave=(y,S)=>{y.preventDefault(),y.stopPropagation(),this.toCancelNodeExpansion.dispose(),this.potentialParent&&(this.draggedOverDec.removeTarget(this.potentialParent),this.model.treeModel.dispatchChange())},this.handleDragOver=(y,S)=>{if(y.preventDefault(),y.stopPropagation(),!this.toCancelNodeExpansion.disposed||this.beingDraggedNodes.indexOf(S)>=0)return;this.draggedOverNode=S;const A=c.Directory.is(S)&&S.expanded?S:S.parent;(this.potentialParent!==A||!this.draggedOverDec.hasTarget(A))&&(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=A,this.draggedOverDec.addTarget(this.potentialParent,l.TargetMatchMode.SelfAndChildren),this.model.treeModel.dispatchChange()),this.potentialParent!==S&&c.Directory.is(S)&&(this.dragOverTrigger.trigger(async()=>{S.expanded?(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=S,this.draggedOverDec.addTarget(this.potentialParent,l.TargetMatchMode.SelfAndChildren)):(await S.setExpanded(!0),this.draggedOverNode===S&&(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=S,this.draggedOverDec.addTarget(this.potentialParent,l.TargetMatchMode.SelfAndChildren))),this.model.treeModel.dispatchChange()}),this.toCancelNodeExpansion.push(m.Disposable.create(()=>{this.dragOverTrigger.isTriggered()||this.dragOverTrigger.cancel()})))},this.handleDrop=async(y,S,A)=>{var w,T;this.eventBus.fire(new E.FileTreeDropEvent({event:y.nativeEvent,targetDir:A?A.codeUri.path:S&&S instanceof c.File?(w=S.parent)===null||w===void 0?void 0:w.uri.codeUri.path:S?S.uri.codeUri.path:new m.URI((T=this.workspaceService.workspace)===null||T===void 0?void 0:T.uri).codeUri.path}));try{y.preventDefault(),y.stopPropagation(),y.dataTransfer.dropEffect="copy";let D;const I=!!this.beingDraggedActiveUri;this.fileTreeService.isCompactMode&&A&&!S?.uri.isEqual(A)?D=null:S?D=c.Directory.is(S)?S:S.parent:D=this.root;let O;if(this.beingDraggedActiveUri){const L=this.fileTreeService.getNodeByPathOrUri(this.beingDraggedActiveUri);O=[new c.Directory(this.fileTreeService,L?.parent,this.beingDraggedActiveUri,this.beingDraggedActiveUri.displayName,{uri:this.beingDraggedActiveUri.toString(),isDirectory:!0,lastModification:new Date().getTime()},this.beingDraggedActiveUri.displayName)]}else if(O=this.beingDraggedNodes,!O||O.length===0)try{const L=JSON.parse(y.dataTransfer.getData("beingDraggedNodes"));L&&L.length!==0&&(O=L.map(R=>this.fileTreeService.getNodeByPathOrUri(new m.URI(R))).filter(Boolean),O.length||(O=await Promise.all(L.map(async R=>{const M=new m.URI(R);let k;const B=await this.filesystem.getFileStat(M.toString());return B?.isDirectory?k=new c.Directory(this.fileTreeService,this.root,M,M.displayName,{uri:M.toString(),isDirectory:!0,lastModification:new Date().getTime()},M.displayName):k=new c.File(this.fileTreeService,this.root,M,M.displayName,{uri:M.toString(),isDirectory:!0,lastModification:new Date().getTime()},M.displayName),k}))))}catch{}if(O.length>0){const L=A||D&&D.uri,R=O.filter(M=>M&&M.parent&&(this.beingDraggedActiveUri?!M.parent.uri.isEqual(L):!0));if(R.length>0){const M=await this.fileTreeAPI.mvFiles(R.map(k=>({url:k.uri,isDirectory:k.filestat.isDirectory})),L);if(M&&M.length>0)M.forEach(k=>{this.messageService.error(k)});else if(M){if(D)if(this.fileTreeService.isCompactMode&&I){for(const k of R)this.fileTreeService.refresh(k.parent);this.fileTreeService.refresh(D)}else for(const k of R){const B=D.uri.resolve(k.name);this.fileTreeService.moveNodeByPath(k.parent,D,k.name,k.name,k.type),k.updateMetaData({name:B.displayName,fileStat:{...k.filestat,uri:B.toString()},uri:B,tooltip:this.fileTreeAPI.getReadableTooltip(B)}),c.Directory.is(k)&&this.fileTreeService.refresh(k)}else if(S){if(this.fileTreeService.isCompactMode&&I)for(const k of R)this.fileTreeService.refresh(k.parent);else for(const k of R)this.fileTreeService.deleteAffectedNodeByPath(k.path);this.fileTreeService.refresh(S.parent)}}else return}}S&&this.beingDraggedDec.removeTarget(S),this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.beingDraggedNodes.forEach(L=>{this.beingDraggedDec.removeTarget(L)}),this.beingDraggedNodes=[],this.beingDraggedActiveUri=void 0,this.potentialParent=null,this.model.treeModel.dispatchChange(),this.toCancelNodeExpansion.disposed||this.toCancelNodeExpansion.dispose()}catch(D){this.logger.error(D)}},this.handleDragEnd=(y,S)=>{this.beingDraggedDec.removeTarget(S),this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.beingDraggedNodes.forEach(A=>{this.beingDraggedDec.removeTarget(A)}),this.beingDraggedNodes=[],this.beingDraggedActiveUri=void 0,this.potentialParent=null,this.model.treeModel.dispatchChange(),this.toCancelNodeExpansion.disposed||this.toCancelNodeExpansion.dispose()},this.model.decorations.addDecoration(this.beingDraggedDec),this.model.decorations.addDecoration(this.draggedOverDec)}get root(){return this.model.treeModel.root}};t.DragAndDropService=f,f.MS_TILL_DRAGGED_OVER_EXPANDS=500,r.__decorate([(0,o.Autowired)(h.IFileTreeAPI),r.__metadata("design:type",Object)],f.prototype,"fileTreeAPI",void 0),r.__decorate([(0,o.Autowired)(m.ILogger),r.__metadata("design:type",Object)],f.prototype,"logger",void 0),r.__decorate([(0,o.Autowired)(v.IMessageService),r.__metadata("design:type",Object)],f.prototype,"messageService",void 0),r.__decorate([(0,o.Autowired)(h.IFileTreeService),r.__metadata("design:type",u.FileTreeService)],f.prototype,"fileTreeService",void 0),r.__decorate([(0,o.Autowired)(p.IFileServiceClient),r.__metadata("design:type",Object)],f.prototype,"filesystem",void 0),r.__decorate([(0,o.Autowired)(s.IWorkspaceService),r.__metadata("design:type",Object)],f.prototype,"workspaceService",void 0),t.DragAndDropService=f=n=r.__decorate([(0,o.Injectable)(),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[_.FileTreeModelService])],f)},97738:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeModelService=void 0;const r=e(85608),o=e(76003),l=e(97267),m=e(41869),E=e(91830),p=e(93899),v=e(26542),s=e(54414),h=e(14951),c=e(63067),g=e(53576),d=e(72665),u=e(6250),_=e(69959),f=e(2812),a=e(46377),b=r.__importDefault(e(89200)),y=e(57781),S=e(30577),{Path:A,isValidBasename:w}=m.path,{coalesce:T}=m.arrays,{trim:D,rtrim:I}=m.strings;let O=n=class{constructor(){this._isDisposed=!1,this._whenReady=new m.Deferred,this.selectedDecoration=new l.Decoration(b.default.mod_selected),this.focusedDecoration=new l.Decoration(b.default.mod_focused),this.contextMenuDecoration=new l.Decoration(b.default.mod_actived),this.loadingDecoration=new l.Decoration(b.default.mod_loading),this.cutDecoration=new l.Decoration(b.default.mod_cut),this._selectedFiles=[],this.disposableCollection=new m.DisposableCollection,this._isMultiSelected=!1,this.refreshedActionDelayer=new m.ThrottledDelayer(n.DEFAULT_REFRESHED_ACTION_DELAY),this.labelChangedDelayer=new m.ThrottledDelayer(n.DEFAULT_LABEL_CHANGED_DELAY),this.locationThrottler=new m.Throttler,this.onDidFocusedFileChangeEmitter=new m.Emitter,this.onDidContextMenuFileChangeEmitter=new m.Emitter,this.onDidSelectedFileChangeEmitter=new m.Emitter,this.onFileTreeModelChangeEmitter=new m.Emitter,this._initTreeModelReady=!1,this.clearFileSelectedDecoration=()=>{this.selectedDecoration.clearAppliedTarget(),this._selectedFiles=[]},this.activeFileDecoration=(R,M=!0)=>{this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),R&&(this.selectedFiles.length>0&&this.selectedDecoration.clearAppliedTarget(),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.selectedDecoration.addTarget(R),this.focusedDecoration.addTarget(R),this.focusedFile=R,this.selectedFiles=[R],M&&this.treeModel.dispatchChange())},this.selectFileDecoration=(R,M=!0)=>{R!==this.treeModel.root&&(this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),R&&(this.selectedFiles.length>0&&this.selectedDecoration.clearAppliedTarget(),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.selectedDecoration.addTarget(R),this._selectedFiles=[R],M&&this.treeModel.dispatchChange()))},this.activateFileActivedDecoration=R=>{this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),this.focusedFile&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this.contextMenuDecoration.addTarget(R),this.contextMenuFile=R,this.treeModel.dispatchChange()},this.activateFileFocusedDecoration=R=>{this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),this.focusedDecoration.addTarget(R),this.focusedFile=R,this.treeModel.dispatchChange()},this.activeFileFocusedDecoration=(R,M=!1)=>{R!==this.treeModel.root&&(this.focusedFile!==R&&(M?(this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.contextMenuFile=R):this.focusedFile&&(this.contextMenuFile=void 0,this.focusedDecoration.clearAppliedTarget()),R&&(this._selectedFiles.indexOf(R)<0&&(this.selectedDecoration.addTarget(R),this._selectedFiles.push(R),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(k=>k.uri))),this.focusedDecoration.addTarget(R),this.focusedFile=R)),this.treeModel.dispatchChange())},this.toggleFileSelectedDecoration=R=>{const M=this._selectedFiles.indexOf(R);M>-1?(this.focusedFile===R&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this._selectedFiles.splice(M,1),this.selectedDecoration.clearAppliedTarget()):(this._selectedFiles.push(R),this.selectedDecoration.addTarget(R),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.focusedFile=R,this.focusedDecoration.addTarget(R)),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(k=>k.uri)),this.treeModel.dispatchChange()},this.activeFileDecorationByRange=(R,M)=>{for(this.clearFileSelectedDecoration(),this.contextMenuFile=void 0;R<=M;R++){const k=this.treeModel.root.getTreeNodeAtIndex(R);k&&(this._selectedFiles.push(k),this.selectedDecoration.addTarget(k))}this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(k=>k.uri)),this.treeModel.dispatchChange()},this.deactivateFileDecoration=()=>{var R;this.focusedFile&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this.contextMenuFile&&this.contextMenuDecoration.removeTarget(this.contextMenuFile),(R=this.treeModel)===null||R===void 0||R.dispatchChange()},this.toggleDirectory=async R=>{R.expanded?this.fileTreeHandle.collapseNode(R):this.fileTreeHandle.expandNode(R)},this.handleDblClick=()=>{this.commandService.executeCommand(m.FILE_COMMANDS.NEW_FILE.id)},this.handleContextMenu=(R,M,k)=>{var B;R.stopPropagation(),R.preventDefault();let x,N;M?(N=M,this._isMultiSelected?this.selectedFiles.indexOf(N)>=0?x=this.selectedFiles:x=[N]:x=[N]):(x=[this.treeModel.root],N=this.treeModel.root),this.activateFileActivedDecoration(N),this.setFileTreeContextKey(N),this.fileTreeService.isCompactMode&&k?(this._activeUri=k,(B=this.contextKey)===null||B===void 0||B.explorerResourceIsFolder.set(!0)):k||(this._activeUri=null);const j=this.contextMenuService.createMenu({id:p.MenuId.ExplorerContext,contextKeyService:this.fileTreeService.contextMenuContextKeyService}),K=j.getMergedMenuNodes();j.dispose(),this.updateExplorerCompressedContextKey(N,k);const{x:U,y:X}=R.nativeEvent;this.ctxMenuRenderer.show({anchor:{x:U,y:X},menuNodes:K,args:k?[k,[k]]:[N.uri,x.map(z=>z.uri)]})},this.handleTreeBlur=()=>{var R,M,k;this._isDisposed||((M=(R=this.contextKey)===null||R===void 0?void 0:R.filesExplorerFocused)===null||M===void 0||M.set(!1),this.deactivateFileDecoration(),(k=this.contextKey)===null||k===void 0||k.explorerResourceIsFolder.set(!1))},this.handleTreeFocus=()=>{var R,M;(M=(R=this.contextKey)===null||R===void 0?void 0:R.filesExplorerFocused)===null||M===void 0||M.set(!0)},this.handleItemRangeClick=(R,M)=>{if(!this.focusedFile)this.handleItemClick(R,M);else if(this.focusedFile&&this.focusedFile!==R){this._isMultiSelected=!0;const k=this.treeModel.root.getIndexAtTreeNode(R),B=this.treeModel.root.getIndexAtTreeNode(this.focusedFile);B>k?this.activeFileDecorationByRange(k,B):B<k&&this.activeFileDecorationByRange(B,k)}},this.handleItemToggleClick=(R,M)=>{this._isMultiSelected=!0,!(M!==l.TreeNodeType.CompositeTreeNode&&M!==l.TreeNodeType.TreeNode)&&this.toggleFileSelectedDecoration(R)},this.handleItemClick=(R,M=this.fileTreeService.isMultipleWorkspace?l.TreeNodeType.TreeNode:l.TreeNodeType.CompositeTreeNode,k)=>{var B,x,N,j;if(this.treeModel&&(R||(R=this.treeModel.root),this.updateExplorerCompressedContextKey(R,k),this._isMultiSelected=!1,(M===l.TreeNodeType.CompositeTreeNode||M===l.TreeNodeType.TreeNode)&&this.activeFileDecoration(R),this.fileTreeService.isCompactMode&&k?(this._activeUri=k,(B=this.contextKey)===null||B===void 0||B.explorerResourceIsFolder.set(!0)):k||(this._activeUri=null,(x=this.contextKey)===null||x===void 0||x.explorerResourceIsFolder.set(M===l.TreeNodeType.CompositeTreeNode)),this.corePreferences["workbench.list.openMode"]==="singleClick")){if(M===l.TreeNodeType.CompositeTreeNode){if((N=this.contextKey)===null||N===void 0||N.explorerResourceIsFolder.set(!0),R===this.treeModel.root)return;this.toggleDirectory(R)}else if(M===l.TreeNodeType.TreeNode){if((j=this.contextKey)===null||j===void 0||j.explorerResourceIsFolder.set(!1),R===this.treeModel.root)return;this.fileTreeService.openFile(R.uri),this.mainlayoutService.bottomExpanded&&this.commandService.executeCommand(g.RETRACT_BOTTOM_PANEL.id)}}},this.handleItemDoubleClick=(R,M)=>{M===l.TreeNodeType.TreeNode?this.fileTreeService.openAndFixedFile(R.uri):this.corePreferences["workbench.list.openMode"]==="doubleClick"&&this.toggleDirectory(R)},this.validateFileName=(R,M)=>{var k;if(M=this.getWellFormedFileName(M),!M||M.length===0||/^\s+$/.test(M))return{message:(0,m.localize)("validate.tree.emptyFileNameError"),type:l.PROMPT_VALIDATE_TYPE.ERROR,value:M};if(M[0]==="/"||M[0]==="\\")return{message:(0,m.localize)("validate.tree.fileNameStartsWithSlashError"),type:l.PROMPT_VALIDATE_TYPE.ERROR,value:M};if(M[0]===" "||M[M.length-1]===" ")return{message:(0,m.localize)("validate.tree.fileNameFollowOrStartWithSpaceWarning"),type:l.PROMPT_VALIDATE_TYPE.WARNING,value:M};let B;if(R.target){const N=R.target;if(M===N.name)return null;B=N.parent}else B=R.parent;return B&&!(R instanceof l.RenamePromptHandle&&R.target.displayName.indexOf(A.separator)>0)&&((k=B.children)===null||k===void 0?void 0:k.find(K=>K.name===M))?{message:(0,m.formatLocalize)("validate.tree.fileNameExistsError",M),type:l.PROMPT_VALIDATE_TYPE.ERROR,value:M}:T(M.split(/[\\/]/)).some(N=>!w(N))?{message:(0,m.formatLocalize)("validate.tree.invalidFileNameError",this.trimLongName(M)),type:l.PROMPT_VALIDATE_TYPE.ERROR,value:M}:null},this.proxyPrompt=R=>{let M=!1;const k=async z=>{const Q=await this.fileTreeService.getNodeByPathOrUri(z);Q&&(_.Directory.is(Q)?this.selectFileDecoration(Q):this.location(Q.uri))},B=async z=>{var Q,G,J;if(this.validateMessage=void 0,R instanceof l.RenamePromptHandle){const Y=R.target,H=R.target.displayName.split(A.separator),$=Y.name.indexOf(A.separator)>0;if($&&this.activeUri&&!R.target.uri.toString().includes(this.activeUri.toString()))return!1;const Z=this.activeUri?H.length-R.target.uri.toString().replace(this.activeUri.toString(),"").split(A.separator).length:-1,re=Z===-1?[]:H.slice(0,Z).concat(z);let ce=Y.uri,ge=Y.parent.uri.resolve(z);if($&&((Q=this.activeUri)===null||Q===void 0?void 0:Q.displayName)===z||!$&&z===Y.name)return!0;R.addAddonAfter("loading_indicator"),$&&re.length>0&&_.Directory.is(Y.parent)&&(ce=Y.parent.uri.resolve(H.slice(0,Z+1).join(A.separator)),ge=Y.parent.uri.resolve(re.concat().join(A.separator)));const Ae=await this.fileTreeAPI.mv(ce,ge,Y.type===l.TreeNodeType.CompositeTreeNode);if(Ae)return this.validateMessage={type:l.PROMPT_VALIDATE_TYPE.ERROR,message:Ae,value:z},this.fileTreeService.updateRefreshable(!0),R.addValidateMessage(this.validateMessage),!1;if(this.fileTreeService.updateRefreshable(!1),R.removeAddonAfter(),!$&&Y.parent){const te=await this.fileTreeService.moveNodeByPath(Y.parent,Y.parent,Y.name,z,Y.type);te&&this.selectFileDecoration(te,!1),this.fileTreeService.updateRefreshable(!0)}else if(_.Directory.is(Y)&&!_.Directory.isRoot(Y)){Y.updateMetaData({name:re.concat(H.slice(Z+1)).join(A.separator),uri:ge,fileStat:{...Y.filestat,uri:ge.toString()},tooltip:this.fileTreeAPI.getReadableTooltip(ge)}),this.treeModel.dispatchChange();let te;_.Directory.is(Y.parent)&&(!((G=Y.parent.children)===null||G===void 0)&&G.find(Pe=>Y.path.indexOf(Pe.path)>=0))?te=this.fileTreeService.refresh(Y.parent):te=this.fileTreeService.refresh(Y),te.then(()=>{k(ge)})}R.removeAddonAfter()}else if(R instanceof l.NewPromptHandle){const Y=R.parent,H=Y.uri.resolve(z);let $;if(R.addAddonAfter("loading_indicator"),this.fileTreeService.updateRefreshable(!0),R.type===l.TreeNodeType.CompositeTreeNode?$=await this.fileTreeAPI.createDirectory(H):$=await this.fileTreeAPI.createFile(H),R.removeAddonAfter(),$)return this.validateMessage={type:l.PROMPT_VALIDATE_TYPE.ERROR,message:$,value:z},this.fileTreeService.updateRefreshable(!1),R.addValidateMessage(this.validateMessage),!1;if(z.includes(A.separator)&&this.fileTreeService.refresh(Y).then(()=>{k(Y.uri.resolve(z))}),this.fileTreeService.isCompactMode)if(R.type===l.TreeNodeType.CompositeTreeNode)if((!Y.children||Y.children.length===0)&&!_.Directory.isRoot(Y)){const re=Y.uri.resolve(z),ce=[Y.name].concat(z).join(A.separator);Y.updateMetaData({name:ce,uri:re,fileStat:{...Y.filestat,uri:re.toString()},tooltip:this.fileTreeAPI.getReadableTooltip(re)}),k(re)}else await this.fileTreeService.addNode(Y,z,R.type),k(Y.uri.resolve(z));else await this.fileTreeService.addNode(Y,z,R.type),k(Y.uri.resolve(z));else await this.fileTreeService.addNode(Y,z,R.type),k(Y.uri.resolve(z))}return(J=this.contextKey)===null||J===void 0||J.filesExplorerInputFocused.set(!1),!0},x=async z=>{var Q,G,J,Y;if(this.validateMessage&&this.validateMessage.type===l.PROMPT_VALIDATE_TYPE.ERROR)return this.validateMessage=void 0,!0;if(M)return!1;if(!z){(Q=this.contextKey)===null||Q===void 0||Q.explorerCompressedFocusContext.set(!1),(G=this.contextKey)===null||G===void 0||G.explorerCompressedFirstFocusContext.set(!1),(J=this.contextKey)===null||J===void 0||J.explorerCompressedLastFocusContext.set(!1),this.fileTreeService.isCompactMode&&R instanceof l.NewPromptHandle&&this.fileTreeService.refresh(R.parent);return}return(Y=this.contextKey)===null||Y===void 0||Y.filesExplorerInputFocused.set(!1),await B(z),!0},N=async z=>{if(M=!0,this.validateMessage&&this.validateMessage.type===l.PROMPT_VALIDATE_TYPE.ERROR)return!1;if(z.trim()===""||this.validateMessage&&this.validateMessage.type!==l.PROMPT_VALIDATE_TYPE.ERROR)return this.validateMessage=void 0,!0;const Q=await B(z);return M=!1,!!Q},j=async()=>{var z;(z=this.contextKey)===null||z===void 0||z.filesExplorerInputFocused.set(!0)},K=()=>{var z;this.fileTreeService.updateRefreshable(!0),(z=this.contextKey)===null||z===void 0||z.filesExplorerInputFocused.set(!1),this.contextMenuFile&&this.selectFileDecoration(this.contextMenuFile,!0)},U=()=>{var z;(z=this.contextKey)===null||z===void 0||z.filesExplorerInputFocused.set(!1),this.fileTreeService.isCompactMode&&R instanceof l.NewPromptHandle&&this.fileTreeService.refresh(R.parent)},X=z=>{const Q=this.validateFileName(R,z);Q?(this.validateMessage=Q,R.addValidateMessage(Q)):!Q&&this.validateMessage&&this.validateMessage.value!==z&&(this.validateMessage=void 0,R.removeValidateMessage())};R.destroyed||(this.fileTreeService.updateRefreshable(!1),R.onChange(X),R.onCommit(N),R.onBlur(x),R.onFocus(j),R.onDestroy(K),R.onCancel(U))},this.copyFile=async R=>{var M;this.pasteStore&&this.pasteStore.type===u.PasteTypes.CUT&&(this._pasteStore.files.forEach(B=>{B&&this.cutDecoration.removeTarget(B)}),(M=this.contextKey)===null||M===void 0||M.explorerResourceCut.set(!1)),this.treeModel.dispatchChange();const k=[];for(const B of R){const x=this.fileTreeService.getNodeByPathOrUri(B);x&&k.push(x)}this._pasteStore={files:k,type:u.PasteTypes.COPY},this.clipboardService.writeResources(R)},this.pasteFile=async R=>{var M,k;let B=!1,x=this.fileTreeService.getNodeByPathOrUri(R.toString());if(!x)return;let N=this.pasteStore,j=!1;if(!N){const K=await this.clipboardService.readResources();if(!K||!K.length)return;N={files:[],type:u.PasteTypes.COPY,crossFiles:K},j=!0}if(N){if(_.Directory.is(x)||(B=!0,x=x.parent),j){const K=(0,m.localize)("file.confirm.paste.ok"),U=(0,m.localize)("file.confirm.paste.cancel");if(await this.dialogService.warning((0,m.formatLocalize)("file.confirm.paste",`[ ${(M=N.crossFiles)===null||M===void 0?void 0:M.map(z=>z.displayName).join(",")} ]`,_.Directory.isRoot(x)?x.uri.displayName:x.displayName),[U,K])!==K)return}if(N.type===u.PasteTypes.CUT){for(const U of N.files)U&&this.cutDecoration.removeTarget(U),x.expanded||await x.setExpanded(!0);const K=await this.fileTreeAPI.mvFiles(N.crossFiles?N.crossFiles.map(U=>{var X;return{url:U,isDirectory:((X=this.fileTreeService.getNodeByPathOrUri(U))===null||X===void 0?void 0:X.filestat.isDirectory)||!1}}):N.files.map(U=>({url:U.uri,isDirectory:U.filestat.isDirectory})),x.uri);K&&K.length>0&&(K.forEach(U=>{this.messageService.error(U)}),this.fileTreeService.refresh()),(k=this.contextKey)===null||k===void 0||k.explorerResourceCut.set(!1),this.treeModel.dispatchChange(),this._pasteStore={files:[],type:u.PasteTypes.NONE,crossFiles:void 0}}else if(N.type===u.PasteTypes.COPY){const K=N.crossFiles?N.crossFiles:N.files.map(U=>U.uri);for(const U of K){x.uri.isEqual(U)&&!B&&(x=x.parent);const X=x.uri.resolve(U.displayName);x.expanded||await x.setExpanded(!0);const z=await this.fileTreeAPI.copyFile(U,X);if(z)if(z.uri){const Q=new m.URI(z.uri),G=await this.filesystem.getFileStat(U.toString());this.fileTreeService.addNode(x,Q.displayName,G?.isDirectory?l.TreeNodeType.CompositeTreeNode:l.TreeNodeType.TreeNode)}else this.messageService.error(`Error when copy file: ${U.toString()}, ${z}`)}}}},this.cutFile=async R=>{var M;R.length>0&&((M=this.contextKey)===null||M===void 0||M.explorerResourceCut.set(!0)),this._pasteStore&&this._pasteStore.type===u.PasteTypes.CUT&&this._pasteStore.files.forEach(B=>{this.cutDecoration.removeTarget(B)});const k=[];for(const B of R){const x=this.fileTreeService.getNodeByPathOrUri(B);x&&k.push(x)}this._pasteStore={files:k,type:u.PasteTypes.CUT};for(const B of k)B&&this.cutDecoration.addTarget(B);this.treeModel.dispatchChange()},this.location=async R=>{if(await this.whenReady,!this.fileTreeService.filterMode)return this._fileToLocation=R,this.locationThrottler.queue(this.doLocation)},this.doLocation=async()=>{if(!this._fileToLocation)return;const R=this._fileToLocation;let M;if(typeof R=="string"?M=R:M=await this.fileTreeService.getFileTreeNodePathByUri(R),M){if(!this.fileTreeHandle)return;const k=await this.fileTreeHandle.ensureVisible(M,"center",!0);k&&this.selectFileDecoration(k)}this._fileToLocation=void 0},this.locationOnShow=R=>{this._nextLocationTarget=R},this.performLocationOnHandleShow=async()=>{this._nextLocationTarget&&(await this.location(this._nextLocationTarget),this._nextLocationTarget=void 0)}}get onDidFocusedFileChange(){return this.onDidFocusedFileChangeEmitter.event}get onDidContextMenuFileChange(){return this.onDidContextMenuFileChangeEmitter.event}get onDidSelectedFileChange(){return this.onDidSelectedFileChangeEmitter.event}get onFileTreeModelChange(){return this.onFileTreeModelChangeEmitter.event}get fileTreeHandle(){return this._fileTreeHandle}get decorations(){return this._decorations}get treeModel(){return this._treeModel}get dndService(){return this._dndService}get whenReady(){return this._whenReady.promise}get focusedFile(){return this._focusedFile}set focusedFile(R){this.onDidFocusedFileChangeEmitter.fire(R?R.uri:void 0),this._focusedFile=R}get contextMenuFile(){return this._contextMenuFile}set contextMenuFile(R){this.onDidContextMenuFileChangeEmitter.fire(R?R.uri:void 0),this._contextMenuFile=R}get selectedFiles(){return this._selectedFiles}set selectedFiles(R){this.onDidSelectedFileChangeEmitter.fire(R?R.map(M=>M.uri):[]),this._selectedFiles=R}get activeUri(){return this._activeUri}get pasteStore(){return this._pasteStore}get explorerStorage(){return this._explorerStorage}get currentRelativeUriContextKey(){return this._currentRelativeUriContextKey||(this._currentRelativeUriContextKey=this.fileTreeService.contextMenuContextKeyService.createKey("filetreeContextRelativeUri","")),this._currentRelativeUriContextKey}get currentContextUriContextKey(){return this._currentContextUriContextKey||(this._currentContextUriContextKey=this.fileTreeService.contextMenuContextKeyService.createKey("filetreeContextUri","")),this._currentContextUriContextKey}get contextMenuResourceContext(){return this._contextMenuResourceContext||(this._contextMenuResourceContext=new E.ResourceContextKey(this.fileTreeService.contextMenuContextKeyService)),this._contextMenuResourceContext}get contextKey(){return this.fileTreeService.contextKey}get initTreeModelReady(){return this._initTreeModelReady}async initTreeModel(){this._initTreeModelReady=!1;const R=(await this.fileTreeService.resolveChildren())[0];if(!R){this._whenReady.resolve();return}this._treeModel=this.injector.get(f.FileTreeModel,[R]),this.initDecorations(R),this._dndService=this.injector.get(S.DragAndDropService,[this]),this.treeStateWatcher=this._treeModel.getTreeStateWatcher(!0),this.disposableCollection.push(this.fileTreeService.onNodeRefreshed(()=>{this.initTreeModelReady&&(this.refreshedActionDelayer.isTriggered()||this.refreshedActionDelayer.cancel(),this.refreshedActionDelayer.trigger(async()=>{if(this.selectedFiles.length===0){const k=this.editorService.currentEditor;k&&k.currentUri&&this.location(k.currentUri)}this.fileTreeService.isCompactMode||(this._activeUri=null)}))})),this.disposableCollection.push(this.fileTreeService.onWorkspaceChange(()=>{this.disposableCollection.dispose(),this.initTreeModel()})),this.disposableCollection.push(this.labelService.onDidChange(async()=>{this.initTreeModelReady&&(this.labelChangedDelayer.isTriggered()||this.labelChangedDelayer.cancel(),this.labelChangedDelayer.trigger(async()=>{this.fileTreeService.refresh()}))})),this.disposableCollection.push(this.treeModel.root.watcher.on(l.TreeNodeEvent.WillResolveChildren,k=>{this.loadingDecoration.addTarget(k),this.treeModel.dispatchChange()})),this.disposableCollection.push(this.treeModel.root.watcher.on(l.TreeNodeEvent.DidResolveChildren,k=>{this.loadingDecoration.clearAppliedTarget(),this.treeModel.dispatchChange()})),this._explorerStorage=await this.storageProvider(m.STORAGE_NAMESPACE.EXPLORER);const M=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY);M&&await this.loadFileTreeSnapshot(M),this.disposableCollection.push(this.treeStateWatcher.onDidChange(()=>{if(!this._initTreeModelReady)return;const k=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),B=this.treeStateWatcher.snapshot();this.explorerStorage.set(n.FILE_TREE_SNAPSHOT_KEY,{...k,...B})})),this.fileTreeService.startWatchFileEvent(),this.onFileTreeModelChangeEmitter.fire(this._treeModel),this._whenReady.resolve(),this._initTreeModelReady=!0}initDecorations(R){this._decorations=new l.DecorationsManager(R),this._decorations.addDecoration(this.selectedDecoration),this._decorations.addDecoration(this.focusedDecoration),this._decorations.addDecoration(this.contextMenuDecoration),this._decorations.addDecoration(this.cutDecoration),this._decorations.addDecoration(this.loadingDecoration)}setFileTreeContextKey(R){var M;this.currentContextUriContextKey.set(R.uri.toString()),this.currentRelativeUriContextKey.set((this.treeModel.root.uri.relative(R.uri)||"").toString()),this.contextMenuResourceContext.set(R.uri),(M=this.contextKey)===null||M===void 0||M.explorerResourceIsFolder.set(R&&R.type===l.TreeNodeType.CompositeTreeNode)}async loadFileTreeSnapshot(R){await this._treeModel.loadTreeState(R)}updateExplorerCompressedContextKey(R,M){var k,B,x,N,j,K,U,X,z,Q,G,J,Y,H,$,Z;if(R&&M){(k=this.contextKey)===null||k===void 0||k.explorerCompressedFocusContext.set(!0);const re=new A(R.name);re.name===M.displayName?((B=this.contextKey)===null||B===void 0||B.explorerCompressedLastFocusContext.set(!0),(x=this.contextKey)===null||x===void 0||x.explorerCompressedFirstFocusContext.set(!1)):re.root&&re.root.name===M.displayName?((N=this.contextKey)===null||N===void 0||N.explorerCompressedLastFocusContext.set(!1),(j=this.contextKey)===null||j===void 0||j.explorerCompressedFirstFocusContext.set(!0)):((K=this.contextKey)===null||K===void 0||K.explorerCompressedLastFocusContext.set(!1),(U=this.contextKey)===null||U===void 0||U.explorerCompressedFirstFocusContext.set(!1))}else R?R.name.indexOf(A.separator)>0?((X=this.contextKey)===null||X===void 0||X.explorerCompressedFocusContext.set(!0),(z=this.contextKey)===null||z===void 0||z.explorerCompressedFirstFocusContext.set(!1),(Q=this.contextKey)===null||Q===void 0||Q.explorerCompressedLastFocusContext.set(!0)):((G=this.contextKey)===null||G===void 0||G.explorerCompressedFocusContext.set(!1),(J=this.contextKey)===null||J===void 0||J.explorerCompressedFirstFocusContext.set(!1),(Y=this.contextKey)===null||Y===void 0||Y.explorerCompressedLastFocusContext.set(!1)):((H=this.contextKey)===null||H===void 0||H.explorerCompressedFocusContext.set(!1),($=this.contextKey)===null||$===void 0||$.explorerCompressedFirstFocusContext.set(!1),(Z=this.contextKey)===null||Z===void 0||Z.explorerCompressedLastFocusContext.set(!1))}handleTreeHandler(R){this._fileTreeHandle=R}toggleOrOpenCurrentFile(){let R;this.focusedFile?R=this.focusedFile:this.contextMenuFile&&(R=this.contextMenuFile),R&&(this.activeFileDecoration(R),_.Directory.is(R)?this.toggleDirectory(R):this.fileTreeService.openFile(R.uri))}moveToNext(){let R;if(this.focusedFile?R=this.focusedFile:this.contextMenuFile&&(R=this.contextMenuFile),!R)return;const k=this.treeModel.root.getIndexAtTreeNode(R)+1,B=this.treeModel.root.getTreeNodeAtIndex(k),x=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),N=(k+1)*a.FILE_TREE_NODE_HEIGHT-(x.scrollPosition||0),{height:j}=this.fileTreeHandle.getCurrentSize();B&&(this.activateFileFocusedDecoration(B),N>j&&this.fileTreeHandle.ensureVisible(B,"end"))}moveToPrev(){let R;if(this.focusedFile?R=this.focusedFile:this.contextMenuFile&&(R=this.contextMenuFile),!R)return;const M=this.treeModel.root.getIndexAtTreeNode(R);if(M===0)return;const k=M-1,B=this.treeModel.root.getTreeNodeAtIndex(k);if(!B)return;const x=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),N=k*a.FILE_TREE_NODE_HEIGHT;this.activateFileFocusedDecoration(B),(x.scrollPosition||0)>N&&this.fileTreeHandle.ensureVisible(B,"start")}async collapseCurrentFile(){let R;this.focusedFile?(R=this.focusedFile,this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0):this.contextMenuFile&&(R=this.contextMenuFile,this.focusedDecoration.removeTarget(this.contextMenuFile),this.contextMenuFile=void 0);const M=this.selectedFiles.indexOf(R);M>=0&&(this.selectedFiles.splice(M,1),this.selectedDecoration.removeTarget(R));let k;if(_.Directory.is(R)&&R.expanded)k=R;else if(R)_.Directory.isRoot(R.parent)?k=R:k=R.parent;else return;this.focusedFile=k,k&&k.expanded&&(await this.fileTreeHandle.collapseNode(k),this.activeFileFocusedDecoration(k,!0))}async expandCurrentFile(){let R;this.focusedFile?(R=this.focusedFile,this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0):this.contextMenuFile&&(R=this.contextMenuFile,this.focusedDecoration.removeTarget(this.contextMenuFile),this.contextMenuFile=void 0);const M=this.selectedFiles.indexOf(R);M>=0&&(this.selectedFiles.splice(M,1),this.selectedDecoration.removeTarget(R)),this.focusedFile=R,_.Directory.is(R)&&(R.expanded||await this.fileTreeHandle.expandNode(R))}async collapseAll(){await this.treeModel.root.collapsedAll();const R=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY);R&&this.explorerStorage.set(n.FILE_TREE_SNAPSHOT_KEY,{...R,expandedDirectories:{atSurface:[],buried:[]}})}async deleteFileByUris(R){var M;if(R.length===0)return;if(this.corePreferences["explorer.confirmDelete"]){const N=(0,m.localize)("file.confirm.delete.ok"),j=(0,m.localize)("file.confirm.delete.cancel"),K=`[ ${R.slice(0,5).map(X=>X.displayName).join(",")}${R.length>5?" ...":""} ]`;if(await this.dialogService.warning((0,m.formatLocalize)("file.confirm.delete",K),[j,N])!==N)return}const k=this.fileTreeService.sortPaths(R);let B;if(this.treeModel.root.branchSize===R.length)B=void 0;else if(this.selectedFiles.length&&!k.find(N=>N.path.toString()===this.selectedFiles[0].uri.toString()))B=this.selectedFiles[0];else{const N=(M=k[k.length-1])===null||M===void 0?void 0:M.node;if(!N)B=void 0;else{let K=this.treeModel.root.getIndexAtTreeNode(N)+1;if(K>=this.treeModel.root.branchSize){const U=k[0].node;K=this.treeModel.root.getIndexAtTreeNode(U)-1}B=this.treeModel.root.getTreeNodeAtIndex(K)}}const x=[];k.forEach(N=>{this.loadingDecoration.addTarget(N.node),x.push(this.deleteFile(N.node,N.path).then(j=>(this.loadingDecoration.removeTarget(N.node),j)))}),this.treeModel.dispatchChange(),await Promise.all(x),B&&this.activeFileDecoration(B)}async deleteFile(R,M){const k=typeof M=="string"?new m.URI(M):M,B=await this.fileTreeAPI.delete(k);return B?(this.messageService.error(B),!1):((N=>{var j,K,U;N.uri.isEqual(k)?this.fileTreeService.deleteAffectedNodeByPath(N.path):this.fileTreeService.refresh(R.parent),this.loadingDecoration.removeTarget(N),(j=this.contextKey)===null||j===void 0||j.explorerCompressedFocusContext.set(!1),(K=this.contextKey)===null||K===void 0||K.explorerCompressedFirstFocusContext.set(!1),(U=this.contextKey)===null||U===void 0||U.explorerCompressedLastFocusContext.set(!1)})(R),!0)}getWellFormedFileName(R){return R&&(R=D(R," "),R=I(R,"."),R=I(R,"/"),R=I(R,"\\"),R)}trimLongName(R){return R&&R.length>255?`${R.substr(0,255)}...`:R}async getPromptTarget(R,M){let k;if(R.isEqual(this.treeModel.root.uri))k=await this.fileTreeService.getNodeByPathOrUri(R);else if(this.focusedFile)k=this.focusedFile;else if(this.contextMenuFile)k=this.contextMenuFile;else if(this.selectedFiles.length>0){const x=this.selectedFiles[this.selectedFiles.length-1];if(this.treeModel.root.isItemVisibleAtSurface(x))k=x;else{const N=await this.fileTreeService.getFileTreeNodePathByUri(R);k=await this.treeModel.root.loadTreeNodeByPath(N)}}else k=await this.fileTreeService.getNodeByPathOrUri(R);k||(k=this.treeModel.root);const B=A.splitPath(k.name);if(_.Directory.isRoot(k))return k;if(k.name!==R.displayName&&B[B.length-1]!==R.displayName&&M){const x=R.relative(k.uri).toString(),N=k.name.replace(`${A.separator}${x}`,""),j=k.parent.uri.resolve(N),K=x.split(A.separator)[0];if(!N)return;if(k.children)for(const U of k.children)this.fileTreeService.deleteAffectedNodeByPath(U.path,!0);k.updateMetaData({name:N?.toString(),uri:j,tooltip:this.fileTreeAPI.getReadableTooltip(j),fileStat:{...k.filestat,uri:j.toString()}}),this.fileTreeService.addNode(k,K,l.TreeNodeType.CompositeTreeNode)}return k}async newFilePrompt(R){const M=await this.getPromptTarget(R,!0);M&&this.proxyPrompt(await this.fileTreeHandle.promptNewTreeNode(M))}async newDirectoryPrompt(R){const M=await this.getPromptTarget(R,!0);M&&this.proxyPrompt(await this.fileTreeHandle.promptNewCompositeTreeNode(M))}async renamePrompt(R){const M=await this.getPromptTarget(R);M&&this.proxyPrompt(await this.fileTreeHandle.promptRename(M,R.displayName))}selectChildNode(R){var M;for(const k of R){const B=this.fileTreeService.getNodeByPathOrUri(k);if(B){const x=_.Directory.isRoot(B)?B.children:(M=B.parent)===null||M===void 0?void 0:M.children;if(x){const N=x[0],j=x[x.length-1],K=this.treeModel.root.getIndexAtTreeNode(N),U=this.treeModel.root.getIndexAtTreeNode(j);this.activeFileDecorationByRange(K,U)}}}}dispose(){this._isDisposed=!0}};t.FileTreeModelService=O,O.FILE_TREE_SNAPSHOT_KEY="FILE_TREE_SNAPSHOT",O.DEFAULT_REFRESHED_ACTION_DELAY=500,O.DEFAULT_LOCATION_FLUSH_DELAY=200,O.DEFAULT_LABEL_CHANGED_DELAY=500,r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],O.prototype,"injector",void 0),r.__decorate([(0,o.Autowired)(u.IFileTreeService),r.__metadata("design:type",y.FileTreeService)],O.prototype,"fileTreeService",void 0),r.__decorate([(0,o.Autowired)(m.CorePreferences),r.__metadata("design:type",Object)],O.prototype,"corePreferences",void 0),r.__decorate([(0,o.Autowired)(p.ICtxMenuRenderer),r.__metadata("design:type",p.ICtxMenuRenderer)],O.prototype,"ctxMenuRenderer",void 0),r.__decorate([(0,o.Autowired)(p.AbstractContextMenuService),r.__metadata("design:type",p.AbstractContextMenuService)],O.prototype,"contextMenuService",void 0),r.__decorate([(0,o.Autowired)(u.IFileTreeAPI),r.__metadata("design:type",Object)],O.prototype,"fileTreeAPI",void 0),r.__decorate([(0,o.Autowired)(h.IFileServiceClient),r.__metadata("design:type",Object)],O.prototype,"filesystem",void 0),r.__decorate([(0,o.Autowired)(m.StorageProvider),r.__metadata("design:type",Function)],O.prototype,"storageProvider",void 0),r.__decorate([(0,o.Autowired)(d.IDialogService),r.__metadata("design:type",Object)],O.prototype,"dialogService",void 0),r.__decorate([(0,o.Autowired)(v.LabelService),r.__metadata("design:type",v.LabelService)],O.prototype,"labelService",void 0),r.__decorate([(0,o.Autowired)(d.IMessageService),r.__metadata("design:type",Object)],O.prototype,"messageService",void 0),r.__decorate([(0,o.Autowired)(s.WorkbenchEditorService),r.__metadata("design:type",s.WorkbenchEditorService)],O.prototype,"editorService",void 0),r.__decorate([(0,o.Autowired)(m.CommandService),r.__metadata("design:type",Object)],O.prototype,"commandService",void 0),r.__decorate([(0,o.Autowired)(c.IMainLayoutService),r.__metadata("design:type",Object)],O.prototype,"mainlayoutService",void 0),r.__decorate([(0,o.Autowired)(m.IClipboardService),r.__metadata("design:type",Object)],O.prototype,"clipboardService",void 0),t.FileTreeModelService=O=n=r.__decorate([(0,o.Injectable)()],O)},4446:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SymlinkDecorationsProvider=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(57781);let m=class{constructor(p){this.fileTreeService=p,this.label="symbollink",this.onDidChangeEmitter=new o.Emitter}get onDidChange(){return this.onDidChangeEmitter.event}provideDecorations(p){const v=this.fileTreeService.getNodeByPathOrUri(p.toString());if(v&&v.filestat&&v.filestat.isSymbolicLink)return{letter:"\u2937",source:v.filestat.uri,color:"gitDecoration.ignoredResourceForeground",tooltip:(0,o.localize)("file.tooltip.symbolicLink"),weight:-1,bubble:!v.filestat.isDirectory}}};t.SymlinkDecorationsProvider=m,t.SymlinkDecorationsProvider=m=n.__decorate([n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[l.FileTreeService])],m)},69959:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.File=t.Directory=void 0;const n=e(97267),r=e(41869);class o extends n.CompositeTreeNode{static is(E){return n.CompositeTreeNode.is(E)}constructor(E,p,v=new r.URI(""),s="",h={children:[],isDirectory:!0,uri:"",lastModification:0},c){super(E,p,void 0,{name:s}),this.uri=v,this.filestat=h,this.tooltip=c,p||(this.isExpanded=!0)}get displayName(){return this.name}updateName(E){this.name!==E&&(n.TreeNode.removeTreeNode(this.id,this.path),this.name=E,n.TreeNode.setTreeNode(this.id,this.path,this))}updateURI(E){this.uri=E}updateFileStat(E){this.filestat=E}updateToolTip(E){this.tooltip=E}updateMetaData(E){const{fileStat:p,tooltip:v,name:s,uri:h}=E;s&&this.updateName(s),p&&this.updateFileStat(p),h&&this.updateURI(h),v&&this.updateToolTip(v)}}t.Directory=o;class l extends n.TreeNode{static is(E){return n.TreeNode.is(E)}constructor(E,p,v=new r.URI(""),s="",h={children:[],isDirectory:!1,uri:"",lastModification:0},c){super(E,p,void 0,{name:s}),this.uri=v,this.filestat=h,this.tooltip=c}get displayName(){return this.name}updateName(E){this.name!==E&&(n.TreeNode.removeTreeNode(this.id,this.path),this.name=E,n.TreeNode.setTreeNode(this.id,this.path,this))}updateURI(E){this.uri=E}updateFileStat(E){this.filestat=E}updateToolTip(E){this.tooltip=E}updateMetaData(E){const{fileStat:p,tooltip:v,name:s,uri:h}=E;s&&this.updateName(s),p&&this.updateFileStat(p),h&&this.updateURI(h),v&&this.updateToolTip(v)}}t.File=l},6250:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RESOURCE_VIEW_ID=t.IFileDialogTreeService=t.IFileDialogModel=t.PasteTypes=t.FileStatNode=t.FileTreeExpandedStatusUpdateEvent=t.IFileTreeService=t.IFileTreeAPI=t.FILE_EXPLORER_WELCOME_ID=void 0;const n=e(43718);t.FILE_EXPLORER_WELCOME_ID="file-explorer",t.IFileTreeAPI=Symbol("IFileTreeAPI"),t.IFileTreeService=Symbol("IFileTreeService");class r extends n.BasicEvent{}t.FileTreeExpandedStatusUpdateEvent=r;var o;(function(m){function E(s){return!!s&&"filestat"in s}m.is=E;function p(s){return!!s&&"filestat"in s&&!s.fileStat.isDirectory}m.isContentFile=p;function v(s){if(E(s))return s.filestat.uri}m.getUri=v})(o||(t.FileStatNode=o={}));var l;(function(m){m[m.NONE=0]="NONE",m[m.COPY=1]="COPY",m[m.CUT=2]="CUT"})(l||(t.PasteTypes=l={})),t.IFileDialogModel=Symbol("IFileDialogModel"),t.IFileDialogTreeService=Symbol("IFileDialogTreeService"),t.RESOURCE_VIEW_ID="file-explorer"},87518:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(6250),t),n.__exportStar(e(83709),t)},67240:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.browserViews=void 0,t.browserViews={"sumiContributes.contributes":"Declare all contributions of the OpenSumi Extension.","sumiContributes.common.command":'The command to execute. The command must be declared in "contributes.command" (except built-in commands)',"sumiContributes.common.when":"This condition must be true to display this item","sumiContributes.common.group":"The group this item belongs to","sumiContributes.browserViews":"Provide a custom view to the editor","sumiContributes.browserViews.left":"Provide a view in the left activity bar container","sumiContributes.browserViews.right":"Provide a view in the right activity bar container","sumiContributes.browserViews.bottom":"Provides a view in the bottom tab bar container (no icon will be rendered, so a title is required)","sumiContributes.browserViews.location.custom":'Provide a view to the "{0}" container',"sumiContributes.browserViews.view.id":"View id, browser/index needs to export a component with the same name as this id","sumiContributes.browserViews.view.icon":"Icon name, reference: [icon](https://opensumi.github.io/core/)","sumiContributes.browserViews.view.iconPath":"local icon relative path","sumiContributes.browserViews.view.title":"View title (will be displayed when type is bottom)","sumiContributes.browserViews.view.titleComponentId":"The id of the custom view title component, the characteristics are exactly the same as the normal browserView","sumiContributes.browserViews.view.expanded":"Do you need to expand to full screen, which will cover up the editor area","sumiContributes.browserMain":"Declare the extension browser entry (the path to the compiled code file relative to the extension directory)","sumiContributes.nodeMain":"Declare the extension node entry (the path to the compiled code file relative to the extension directory)","sumiContributes.workerMain":"Declare the extension workser entry (the path to the compiled code file relative to the extension directory)","sumiContributes.viewsProxies":'Declare the component id that needs to be bound to the componentProxy call, which is the same as the export name. For example, after declaring ["component"], the xxxx function of the component component of the browser layer can be called at the node layer through **`context.componentProxy.component.xxxx`**',"sumiContributes.toolbar":"Toolbar is located on the right side of the menu bar at the top of the IDE by default, and can also be displayed as a separate column","sumiContributes.toolbar.actions":"Used to describe the elements on the Toolbar, currently only supports `button` and `select`, we call it action, in some cases it needs to be used with the Toolbar API","sumiContributes.toolbar.actions.id":"unique identifier","sumiContributes.toolbar.actions.weight":"Order weight, the larger the value, the higher the ranking","sumiContributes.toolbar.actions.preferredPosition":`Register the position of this action, if strictPosition exists, this option has no effect
|
|
28420
|
+
`,y){const S=this.hashCalculateService.calculate(u);return d.length>p.FILE_SAVE_BY_CHANGE_THRESHOLD?await this.fileSchemeDocClient.saveByChange(g.toString(),{baseMd5:S,changes:_,eol:b},f,a,y):await this.fileSchemeDocClient.saveByContent(g.toString(),{baseMd5:S,content:d},f,a,y)}async provideEditorDocumentModelContentMd5(g,d){return this.fileSchemeDocClient.getMd5(g.toString(),d)}};t.FileSchemeDocumentProvider=v,n.__decorate([(0,r.Autowired)(E.IFileServiceClient),n.__metadata("design:type",Object)],v.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(p.IFileSchemeDocClient),n.__metadata("design:type",Object)],v.prototype,"fileSchemeDocClient",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],v.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(l.IHashCalculateService),n.__metadata("design:type",Object)],v.prototype,"hashCalculateService",void 0),t.FileSchemeDocumentProvider=v=n.__decorate([(0,r.Injectable)()],v);let s=class{constructor(){this._onDidChangeContent=new o.Emitter,this.onDidChangeContent=this._onDidChangeContent.event,this.listeners={}}isReadonly(g){return!0}handlesScheme(g){return g==="vscode"}async provideEditorDocumentModelContent(g,d){return this.getSchemaContent(g)}getSchemaContent(g){const d=g.toString(),u=this.jsonRegistry.getSchemaContributions().schemas[d];if(u){const _=JSON.stringify(u);if(!this.listeners[d]){const f=o.Disposable.create(()=>{this.jsonRegistry.onDidChangeSchema(a=>{a===d&&this._onDidChangeContent.fire(g)})});this.listeners[d]=f}return _}return"{}"}onDidDisposeModel(g){g.toString()&&(this.listeners[g.toString()].dispose(),delete this.listeners[g.toString()])}};t.VscodeSchemeDocumentProvider=s,n.__decorate([(0,r.Autowired)(o.ISchemaStore),n.__metadata("design:type",Object)],s.prototype,"schemaStore",void 0),n.__decorate([(0,r.Autowired)(o.IJSONSchemaRegistry),n.__metadata("design:type",Object)],s.prototype,"jsonRegistry",void 0),t.VscodeSchemeDocumentProvider=s=n.__decorate([(0,r.Injectable)()],s);let h=class{constructor(){this.documentContentMaps=new Map,this._onDidChangeContent=new o.Emitter,this.onDidChangeContent=this._onDidChangeContent.event}handlesScheme(g){return g===o.Schemes.walkThroughSnippet}provideEditorDocumentModelContent(g,d){return this.documentContentMaps.has(g.toString())||this.documentContentMaps.set(g.toString(),""),this.documentContentMaps.get(g.toString())}isReadonly(){return!1}preferLanguageForUri(){return"plaintext"}};t.WalkThroughSnippetSchemeDocumentProvider=h,t.WalkThroughSnippetSchemeDocumentProvider=h=n.__decorate([(0,r.Injectable)()],h)},41352:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSchemeDocClientService=void 0;const n=e(85608),r=e(76003),o=e(80449);let l=class{saveByChange(E,p,v,s,h){return this.fileDocBackendService.$saveByChange(E,p,v,s,h)}saveByContent(E,p,v,s,h){return this.fileDocBackendService.$saveByContent(E,p,v,s,h)}getMd5(E,p){return this.fileDocBackendService.$getMd5(E,p)}};t.FileSchemeDocClientService=l,n.__decorate([(0,r.Autowired)(o.FileSchemeDocNodeServicePath),n.__metadata("design:type",Object)],l.prototype,"fileDocBackendService",void 0),t.FileSchemeDocClientService=l=n.__decorate([(0,r.Injectable)()],l)},17276:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSystemEditorComponentContribution=t.FileSystemEditorResourceContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(26542),m=e(57517),E=e(17878),p=e(42933),v=e(57646),s=e(60387),h=e(88819),c=e(99025),g="video-preview",d="image-preview",u="external-file",_="large-file-prevent";let f=class{registerResource(y){y.registerResourceProvider(this.untitledResourceProvider)}registerEditorDocumentModelContentProvider(y){y.registerEditorDocumentModelContentProvider(this.fileSchemeDocumentProvider),y.registerEditorDocumentModelContentProvider(this.vscodeSchemeDocumentProvider),y.registerEditorDocumentModelContentProvider(this.walkThroughSnippetSchemeDocumentProvider),y.registerEditorDocumentModelContentProvider(this.untitledSchemeDocumentProvider)}};t.FileSystemEditorResourceContribution=f,n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",s.FileSchemeDocumentProvider)],f.prototype,"fileSchemeDocumentProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",s.VscodeSchemeDocumentProvider)],f.prototype,"vscodeSchemeDocumentProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",s.WalkThroughSnippetSchemeDocumentProvider)],f.prototype,"walkThroughSnippetSchemeDocumentProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",E.UntitledSchemeResourceProvider)],f.prototype,"untitledResourceProvider",void 0),n.__decorate([(0,r.Autowired)(),n.__metadata("design:type",E.UntitledSchemeDocumentProvider)],f.prototype,"untitledSchemeDocumentProvider",void 0),t.FileSystemEditorResourceContribution=f=n.__decorate([(0,o.Domain)(m.BrowserEditorContribution)],f);let a=class{constructor(){this.cachedFileType=new o.LRUMap(200,100),this.fileServiceClient.onFilesChanged(y=>{y.forEach(S=>{this.cachedFileType.delete(S.uri.toString())})})}registerEditorComponent(y){y.registerEditorComponent({component:c.ImagePreview,uid:d,scheme:o.Schemes.file}),y.registerEditorComponent({component:c.VideoPreview,uid:g,scheme:o.Schemes.file}),y.registerEditorComponent({component:v.BinaryEditorComponent,uid:u,scheme:o.Schemes.file}),y.registerEditorComponent({component:h.LargeFilePrevent,uid:_,scheme:o.Schemes.file}),y.registerEditorComponentResolver(S=>S===o.Schemes.file||this.fileServiceClient.handlesScheme(S)?10:-1,(S,A)=>{A.length===0&&A.push({type:m.EditorOpenType.component,componentId:u})}),y.registerEditorComponentResolver(S=>S===o.Schemes.file||this.fileServiceClient.handlesScheme(S)?10:-1,async(S,A)=>{const w=await this.getFileType(S.uri.toString());switch(w){case"image":{A.push({type:m.EditorOpenType.component,componentId:d});break}case"video":{A.push({type:m.EditorOpenType.component,componentId:g});break}case"binary":case"text":{const{metadata:T,uri:D}=S,I=T||{};if(w==="binary"&&!I.skipPreventBinary)break;const O=await this.fileServiceClient.getFileStat(D.toString());await this.preference.ready;const L=this.preference.getValid("editor.largeFile",4*1024*1024*1024);O&&(O.size||0)>L&&!I.skipPreventTooLarge?A.push({type:m.EditorOpenType.component,componentId:_}):A.push({type:m.EditorOpenType.code,title:(0,o.localize)("editorOpenType.code")});break}}}),y.registerEditorComponentResolver(o.Schemes.untitled,(S,A,w)=>{w([{type:m.EditorOpenType.code,priority:"default"}])})}async getFileType(y){return this.cachedFileType.has(y)||((0,l.getLanguageIdFromMonaco)(new o.URI(y))?this.cachedFileType.set(y,"text"):this.cachedFileType.set(y,await this.getRealFileType(y))),this.cachedFileType.get(y)}async getRealFileType(y){try{return await this.fileServiceClient.getFileType(y)}catch{return"text"}}};t.FileSystemEditorComponentContribution=a,n.__decorate([(0,r.Autowired)(p.IFileServiceClient),n.__metadata("design:type",Object)],a.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],a.prototype,"preference",void 0),t.FileSystemEditorComponentContribution=a=n.__decorate([(0,o.Domain)(m.BrowserEditorContribution),n.__metadata("design:paramtypes",[])],a)},52568:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSchemeModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(80449),m=e(41352),E=e(17276);let p=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[E.FileSystemEditorResourceContribution,E.FileSystemEditorComponentContribution,{token:l.IFileSchemeDocClient,useClass:m.FileSchemeDocClientService}],this.backServices=[{servicePath:l.FileSchemeDocNodeServicePath}]}};t.FileSchemeModule=p,t.FileSchemeModule=p=n.__decorate([(0,r.Injectable)()],p)},88819:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LargeFilePrevent=t.PreventComponent=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),l=e(41869),m=e(81878),E=e(54414),p=e(82196),v=n.__importDefault(e(19996)),s=c=>o.default.createElement("div",{className:v.default["error-page"]},o.default.createElement("div",{className:(0,r.default)(v.default.icon,(0,l.getExternalIcon)("warning"))}),o.default.createElement("div",{className:v.default.description},c.description),o.default.createElement("div",{className:v.default["actions-wrapper"]},c.actions.map((g,d)=>o.default.createElement(m.Button,{key:d,onClick:()=>g.onClick(),className:v.default["action-button"]},g.label))));t.PreventComponent=s;const h=()=>{const c=(0,l.useInjectable)(E.WorkbenchEditorService),g=(0,l.useInjectable)(l.IEventBus),d=()=>{const u=c.currentResource;u&&(u.metadata={...u.metadata,skipPreventTooLarge:!0},g.fire(new p.ResourceOpenTypeChangedEvent(u.uri)))};return o.default.createElement(t.PreventComponent,{description:(0,l.localize)("editor.largeFile.prevent"),actions:[{label:(0,l.localize)("editor.file.prevent.stillOpen"),onClick:()=>d()}]})};t.LargeFilePrevent=h},99025:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImagePreview=t.VideoPreview=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(41869),l=e(40827),m=n.__importDefault(e(19996)),E=s=>{const h=(0,o.useInjectable)(l.StaticResourceService);return{src:r.default.useMemo(()=>h.resolveStaticResource(s.uri).toString(),[s])}},p=s=>{const{src:h}=E(s.resource);return r.default.createElement("div",{className:m.default.kt_video_preview},r.default.createElement("video",{autoPlay:!0,controls:!0,className:m.default.kt_video,src:h}))};t.VideoPreview=p;const v=s=>{const h=r.default.useRef(),c=r.default.useRef(),{src:g}=E(s.resource);return r.default.useEffect(()=>{const d=new o.Disposable;return h.current&&(h.current.src=g),()=>{d.dispose()}},[s.resource]),r.default.createElement("div",{className:m.default.kt_image_preview},r.default.createElement("div",{ref:c},r.default.createElement("img",{ref:d=>d&&(h.current=d)})))};t.ImagePreview=v},80449:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChangeType=t.FileSchemeDocNodeServicePath=t.IFileSchemeDocNodeService=t.IFileSchemeDocClient=t.FILE_SAVE_BY_CHANGE_THRESHOLD=t.FILE_ON_DISK_SCHEME=void 0,t.FILE_ON_DISK_SCHEME="fileOnDisk",t.FILE_SAVE_BY_CHANGE_THRESHOLD=1e5,t.IFileSchemeDocClient=Symbol("IFileSchemeDocClient"),t.IFileSchemeDocNodeService=Symbol("FileSchemeDocNodeService"),t.FileSchemeDocNodeServicePath="FileSchemeDocNodeService";var e;(function(n){n[n.ADDED=1]="ADDED",n[n.REMOVED=2]="REMOVED"})(e||(t.ChangeType=e={}))},15625:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IFileSearchService=t.FileSearchServicePath=void 0,t.FileSearchServicePath="FileSearchServicePath",t.IFileSearchService=Symbol("FileSearchService")},84660:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(15625),t)},2156:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileServiceClient=t.BrowserFileSystemRegistryImpl=void 0;const n=e(85608),r=e(32852),o=e(76003),l=e(41869),m=e(43718),E=e(37406),p=e(8170),v=e(41682),s=e(42933),h=e(81952);let c=class{constructor(){this.providers=new Map}registerFileSystemProvider(u){const _=u.scheme;return this.providers.set(_,u),{dispose:()=>{this.providers.delete(_)}}}};t.BrowserFileSystemRegistryImpl=c,t.BrowserFileSystemRegistryImpl=c=n.__decorate([(0,o.Injectable)()],c);let g=class{get clientId(){return this.applicationService.clientId}constructor(){this.watcherWithSchemaMap=new Map,this.watcherDisposerMap=new Map,this.onFileChangedEmitter=new l.Emitter,this.onFileProviderChangedEmitter=new l.Emitter,this._onFilesChanged=new l.Emitter,this.onFilesChanged=this._onFilesChanged.event,this._onFileProviderChanged=new l.Emitter,this.onFileProviderChanged=this._onFileProviderChanged.event,this._onDidChangeFileSystemProviderRegistrations=new l.Emitter,this.onDidChangeFileSystemProviderRegistrations=this._onDidChangeFileSystemProviderRegistrations.event,this._onWillActivateFileSystemProvider=new l.Emitter,this.onWillActivateFileSystemProvider=this._onWillActivateFileSystemProvider.event,this._onDidChangeFileSystemProviderCapabilities=new l.Emitter,this.onDidChangeFileSystemProviderCapabilities=this._onDidChangeFileSystemProviderCapabilities.event,this.filesExcludesMatcherList=[],this.watcherId=0,this.toDisposable=new l.DisposableCollection,this.watchFileExcludes=[],this.watchFileExcludesMatcherList=[],this.filesExcludes=[],this.workspaceRoots=[],this._providerChanged=new Set,this.fsProviders=new Map,this.userHomeDeferred=new l.Deferred,this.options={encoding:"utf8",overwrite:!1,recursive:!0,moveToTrash:!0},this.uriWatcherMap=new Map,this.toDisposable.push(this.onDidChangeFileSystemProviderRegistrations(u=>{u.added&&u.scheme===m.Schemes.file&&this.doGetCurrentUserHome()}))}async initialize(){const u=await this.getProvider(m.Schemes.file);u.initialize&&await u.initialize(this.clientId,this.appConfig.recursiveWatcherBackend)}async doGetCurrentUserHome(){const _=(await this.getProvider(m.Schemes.file)).getCurrentUserHome();this.userHomeDeferred.resolve(_)}handlesScheme(u){return this.registry.providers.has(u)||this.fsProviders.has(u)}dispose(){return this.toDisposable.dispose()}async resolveContent(u,_){const f=this.convertUri(u),b=await(await this.getProvider(f.scheme)).readFile(f.codeUri),y=b.data||b;return{content:l.BinaryBuffer.wrap(Uint8Array.from(y)).toString(_?.encoding)}}async readFile(u){const _=this.convertUri(u),a=await(await this.getProvider(_.scheme)).readFile(_.codeUri),b=a.data||a;return{content:l.BinaryBuffer.wrap(Uint8Array.from(b))}}async readFileStream(u){const _=this.convertUri(u);return await(await this.getProvider(_.scheme)).readFileStream(_.codeUri)}async getFileStat(u,_=!0){const f=this.convertUri(u),a=await this.getProvider(f.scheme);try{const b=await a.stat(f.codeUri);if(!b)throw s.FileSystemError.FileNotFound(f.codeUri.toString(),"File not found.");return this.filterStat(b,_)}catch(b){if(s.FileSystemError.FileNotFound.is(b))return}}async setContent(u,_,f){const a=this.convertUri(u.uri),b=await this.getProvider(a.scheme),y=await b.stat(a.codeUri);if(!y)throw s.FileSystemError.FileNotFound(u.uri,"File not found.");if(y.isDirectory)throw s.FileSystemError.FileIsADirectory(u.uri,"Cannot set the content.");if(!await this.isInSync(u,y))throw this.createOutOfSyncError(u);return await b.writeFile(a.codeUri,typeof _=="string"?l.BinaryBuffer.fromString(_).buffer:_,{create:!1,overwrite:!0,encoding:f?.encoding}),await b.stat(a.codeUri)}async updateContent(u,_,f){const a=this.convertUri(u.uri),b=await this.getProvider(a.scheme),y=await b.stat(a.codeUri);if(!y)throw s.FileSystemError.FileNotFound(u.uri,"File not found.");if(y.isDirectory)throw s.FileSystemError.FileIsADirectory(u.uri,"Cannot set the content.");if(!this.checkInSync(u,y))throw this.createOutOfSyncError(u);if(_.length===0)return y;const S=await b.readFile(a.codeUri),A=this.applyContentChanges(l.BinaryBuffer.wrap(S).toString(f?.encoding),_);await b.writeFile(a.codeUri,l.BinaryBuffer.fromString(A).buffer,{create:!1,overwrite:!0,encoding:f?.encoding});const w=await b.stat(a.codeUri);if(!w)throw s.FileSystemError.FileNotFound(a.codeUri.toString(),"File not found.");return w}async createFile(u,_){const f=this.convertUri(u),a=await this.getProvider(f.scheme),b=l.BinaryBuffer.fromString(_?.content||"").buffer;let y=await a.writeFile(f.codeUri,b,{create:!0,overwrite:_&&_.overwrite||!1,encoding:_?.encoding});return y=y||await a.stat(f.codeUri),y}async createFolder(u){const _=this.convertUri(u),f=await this.getProvider(_.scheme),a=await f.createDirectory(_.codeUri);return a||await f.stat(_.codeUri)}async move(u,_,f){const a=this.convertUri(u),b=this.convertUri(_),y=await this.getProvider(a.scheme),S=await y.rename(a.codeUri,b.codeUri,{overwrite:!!(f&&f.overwrite)});return S||await y.stat(b.codeUri)}async copy(u,_,f){const a=this.convertUri(u),b=this.convertUri(_),y=await this.getProvider(a.scheme),S=await this.doGetOverwrite(f);if(!(0,s.containsExtraFileMethod)(y,"copy"))throw this.getErrorProvideNotSupport(a.scheme,"copy");const A=await y.copy(a.codeUri,b.codeUri,{overwrite:!!S});return A||await y.stat(b.codeUri)}async getFsPath(u){if(u.startsWith("file:/"))return l.FileUri.fsPath(u)}fireFilesChange(u){const _=u.changes.map(f=>({uri:f.uri,type:f.type}));this._onFilesChanged.fire(_),this.eventBus.fire(new l.FilesChangeEvent(_))}async watchFileChanges(u,_){const a=(this.appConfig.pollingWatcherDirectories||[]).some(I=>u.path.toString().startsWith(I)),b=this.convertUri(u.toString()),y=this.uriWatcherMap.get(b.toString());if(y)if(y.isDisposed())this.uriWatcherMap.delete(b.toString());else return y;const S=this.watcherId++,A=await this.getProvider(b.scheme),w=this.watcherWithSchemaMap.get(b.scheme)||[],T=await A.watch(b.codeUri,{excludes:_,pollingWatch:a});this.watcherDisposerMap.set(S,{dispose:async()=>{const I=this.uriWatcherMap.get(b.toString());await Promise.all([A.unwatch&&A.unwatch(T),I&&I.dispose()]),this.uriWatcherMap.delete(b.toString())}}),w.push(S),this.watcherWithSchemaMap.set(b.scheme,w);const D=new h.FileSystemWatcher({fileServiceClient:this,watchId:S,uri:u});return this.uriWatcherMap.set(b.toString(),D),D}async setWatchFileExcludes(u){return await(await this.getProvider(m.Schemes.file)).setWatchFileExcludes(u)}async getWatchFileExcludes(){return await(await this.getProvider(m.Schemes.file)).getWatchFileExcludes()}async setFilesExcludes(u,_){this.filesExcludes=u,this.filesExcludesMatcherList=[],_&&this.setWorkspaceRoots(_),this.updateExcludeMatcher()}async setWorkspaceRoots(u){this.workspaceRoots=u,this.updateExcludeMatcher()}async unwatchFileChanges(u){const _=this.watcherDisposerMap.get(u);if(!(!_||!_.dispose))return this.watcherDisposerMap.delete(u),_.dispose()}async delete(u,_){if(this.appConfig.isElectronRenderer&&_?.moveToTrash!==!1){const b=new l.URI(u);if(b.scheme===m.Schemes.file)return this.injector.get(E.IElectronMainUIService).moveToTrash(b.codeUri.fsPath)}const f=this.convertUri(u),a=await this.getProvider(f.scheme);await a.stat(f.codeUri),await a.delete(f.codeUri,{recursive:!0,moveToTrash:await this.doGetMoveToTrash(_)})}async getEncoding(u){return"utf8"}listCapabilities(){return v.Iterable.map(this.fsProviders,([u,_])=>({scheme:u,capabilities:_.capabilities}))}registerProvider(u,_){if(this.fsProviders.has(u))throw new Error(`The file system provider for \`${u}\` already registered`);const f=[];this.fsProviders.set(u,_),this._onDidChangeFileSystemProviderRegistrations.fire({added:!0,scheme:u,provider:_}),f.push({dispose:()=>{this._onDidChangeFileSystemProviderRegistrations.fire({added:!1,scheme:u,provider:_}),this.fsProviders.delete(u),this._providerChanged.add(u)}}),_.onDidChangeFile&&f.push(_.onDidChangeFile(b=>this.fireFilesChange({changes:b}))),this.toDisposable.push(_.onDidChangeCapabilities(()=>this._onDidChangeFileSystemProviderCapabilities.fire({provider:_,scheme:u}))),f.push({dispose:async()=>{const b=[];(this.watcherWithSchemaMap.get(u)||[]).forEach(y=>b.push(this.unwatchFileChanges(y))),await Promise.all(b)}}),this._providerChanged.add(u),this.onFileProviderChangedEmitter.fire(Array.from(this._providerChanged)),this.toDisposable.pushAll(f);const a=new l.DisposableCollection;return a.pushAll(f),this._onFileProviderChanged.fire(Array.from(this._providerChanged)),a}async access(u,_=s.FileAccess.Constants.F_OK){const f=this.convertUri(u),a=await this.getProvider(f.scheme);if(!(0,s.containsExtraFileMethod)(a,"access"))throw this.getErrorProvideNotSupport(f.scheme,"access");return await a.access(f.codeUri,_)}async getFileType(u){const _=this.convertUri(u),f=await this.getProvider(_.scheme);if(!(0,s.containsExtraFileMethod)(f,"getFileType"))throw this.getErrorProvideNotSupport(_.scheme,"getFileType");return await f.getFileType(u)}async getCurrentUserHome(){return this.userHomeDeferred.promise}getErrorProvideNotSupport(u,_){return`Scheme ${u} not support this function: ${_}.`}convertUri(u){const _=new l.URI(u);if(!_.scheme)throw new Error(`Unsupported convert Uri with non-scheme Uri: ${u}`);return _}updateExcludeMatcher(){this.filesExcludes.forEach(u=>{this.workspaceRoots.length>0?this.workspaceRoots.forEach(_=>{const a=new l.URI(_).resolve(u).path.toString();this.filesExcludesMatcherList.push((0,l.parseGlob)(a))}):this.filesExcludesMatcherList.push((0,l.parseGlob)(u))})}async shouldWaitProvider(u){const _=await this._onWillActivateFileSystemProvider.fireAndAwait({scheme:u}),{result:f}=_[0];if(f&&f.includes(u)){const a=await l.Event.toPromise(l.Event.filter(this.onFileProviderChanged,b=>b.includes(u)));if(!(0,m.isUndefined)(a))return!0}return!1}async getProvider(u){this._providerChanged.has(u)&&(await this.eventBus.fireAndAwait(new l.ExtensionActivateEvent({topic:"onFileSystem",data:u}),{timeout:3e3}),this._providerChanged.delete(u));const _=this.fsProviders.get(u);if(!_)throw new Error(`Not find ${u} provider.`);return _}async isReadonly(u){try{const _=new l.URI(u);return!!(await(await this.getProvider(_.scheme)).stat(this.convertUri(u).codeUri)).readonly}catch{return!1}}isExclude(u){const _=new l.URI(u);return this.filesExcludesMatcherList.some(f=>f(_.path.toString()))}filterStat(u,_=!0){if(u&&!this.isExclude(u.uri))return u.children&&_&&(u.children=this.filterStatChildren(u.children)),u}filterStatChildren(u){const _=[];return u.forEach(f=>{if(this.isExclude(f.uri))return!1;const a=this.filterStat(f);a&&_.push(a)}),_}applyContentChanges(u,_){let f=r.TextDocument.create("","",1,u);for(const a of _){let b=a.text;if(a.range){const y=f.offsetAt(a.range.start),S=f.offsetAt(a.range.end);b=f.getText().substr(0,y)+a.text+f.getText().substr(S)}f=r.TextDocument.create(f.uri,f.languageId,f.version,b)}return f.getText()}async isInSync(u,_){return!!this.checkInSync(u,_)}checkInSync(u,_){return _.lastModification===u.lastModification&&_.size===u.size}createOutOfSyncError(u){return s.FileSystemError.FileIsOutOfSync(u.uri)}async doGetEncoding(u){return u&&typeof u.encoding<"u"?u.encoding:this.options.encoding}async doGetOverwrite(u){return u&&typeof u.overwrite<"u"?u.overwrite:this.options.overwrite}async doGetRecursive(u){return u&&typeof u.recursive<"u"?u.recursive:this.options.recursive}async doGetMoveToTrash(u){return u&&typeof u.moveToTrash<"u"?u.moveToTrash:this.options.moveToTrash}};t.FileServiceClient=g,n.__decorate([(0,o.Autowired)(s.IBrowserFileSystemRegistry),n.__metadata("design:type",c)],g.prototype,"registry",void 0),n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],g.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(m.IEventBus),n.__metadata("design:type",Object)],g.prototype,"eventBus",void 0),n.__decorate([(0,o.Autowired)(l.AppConfig),n.__metadata("design:type",Object)],g.prototype,"appConfig",void 0),n.__decorate([(0,o.Autowired)(p.IApplicationService),n.__metadata("design:type",Object)],g.prototype,"applicationService",void 0),t.FileServiceClient=g=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],g)},69037:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileServiceContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(42933),m=e(2156);let E=class{constructor(){this._disposables=new o.DisposableStore,this._disposables.add(this.fileSystem.registerProvider(o.Schemes.file,this.diskFileServiceProvider))}async initialize(){const v=this.contributionProvider.getContributions();await Promise.all(v.map(async s=>{s.registerProvider&&await s.registerProvider(this.fileSystem)})),await Promise.all(v.map(async s=>{s.onFileServiceReady&&await s.onFileServiceReady()})),this.fileSystem.initialize&&await this.fileSystem.initialize()}dispose(){this._disposables.dispose()}};t.FileServiceContribution=E,n.__decorate([(0,r.Autowired)(l.IFileServiceClient),n.__metadata("design:type",m.FileServiceClient)],E.prototype,"fileSystem",void 0),n.__decorate([(0,r.Autowired)(l.IDiskFileProvider),n.__metadata("design:type",Object)],E.prototype,"diskFileServiceProvider",void 0),n.__decorate([(0,r.Autowired)(o.FsProviderContribution),n.__metadata("design:type",Object)],E.prototype,"contributionProvider",void 0),t.FileServiceContribution=E=n.__decorate([(0,o.Domain)(o.ClientAppContribution),n.__metadata("design:paramtypes",[])],E)},60476:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiskFsProviderClient=t.CoreFileServiceProviderClient=void 0;const n=e(85608),r=e(76003),o=e(43718),l=e(42933);class m{constructor(){this.onDidChangeFileEmitter=new o.Emitter,this.onDidChangeFile=this.onDidChangeFileEmitter.event}watch(v,s){return this.fileServiceProvider.watch(v,s)}unwatch(v){return this.fileServiceProvider.unwatch&&this.fileServiceProvider.unwatch(v)}async stat(v){return await this.fileServiceProvider.stat(v)}readDirectory(v){return this.fileServiceProvider.readDirectory(v)}createDirectory(v){return this.fileServiceProvider.createDirectory(v)}async readFile(v,s){return s&&(0,o.getDebugLogger)("fileService.fsProvider").warn("encoding option for fsProvider.readFile is deprecated"),await this.fileServiceProvider.readFile(v)}readFileStream(v){if(this.fileServiceProvider.readFileStream)return this.fileServiceProvider.readFileStream(v);throw new Error("readFileStream not supported")}writeFile(v,s,h){return this.fileServiceProvider.writeFile(v,Array.from(s),h)}delete(v,s){return this.fileServiceProvider.delete(v,s)}rename(v,s,h){return this.fileServiceProvider.rename(v,s,h)}}t.CoreFileServiceProviderClient=m,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],m.prototype,"injector",void 0);let E=class extends m{constructor(){super(...arguments),this.onDidChangeCapabilities=o.Event.None}get capabilities(){return this._capabilities||(this._capabilities=12318,o.isLinux&&(this._capabilities|=1024)),this._capabilities}async initialize(v,s){var h,c;if(!((h=this.fileServiceProvider)===null||h===void 0)&&h.initialize)try{await((c=this.fileServiceProvider)===null||c===void 0?void 0:c.initialize(v,s))}catch(g){(0,o.getDebugLogger)("fileService.fsProvider").error("initialize error",g)}}setWatchFileExcludes(v){return this.fileServiceProvider.setWatchFileExcludes(v)}getWatchFileExcludes(){return this.fileServiceProvider.getWatchFileExcludes()}onDidFilesChanged(v){const s=v.changes.map(h=>({uri:h.uri,type:h.type}));this.onDidChangeFileEmitter.fire(s)}copy(v,s,h){return this.fileServiceProvider.copy(v,s,h)}access(v,s){return this.fileServiceProvider.access(v,s)}getCurrentUserHome(){return this.fileServiceProvider.getCurrentUserHome()}getFileType(v){return this.fileServiceProvider.getFileType(v)}};t.DiskFsProviderClient=E,n.__decorate([(0,r.Autowired)(l.DiskFileServicePath),n.__metadata("design:type",Object)],E.prototype,"fileServiceProvider",void 0),n.__decorate([(0,o.debounce)(100),n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[Array]),n.__metadata("design:returntype",void 0)],E.prototype,"setWatchFileExcludes",null),t.DiskFsProviderClient=E=n.__decorate([(0,r.Injectable)()],E)},96708:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileServiceClientModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(42933),m=e(70671),E=e(2156),p=e(69037),v=e(60476),s=e(23188);let h=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:l.IFileServiceClient,useClass:E.FileServiceClient},{token:l.IBrowserFileSystemRegistry,useClass:E.BrowserFileSystemRegistryImpl},{token:l.IDiskFileProvider,useClass:v.DiskFsProviderClient},{token:l.IShadowFileProvider,useClass:s.ShadowFileSystemProvider},p.FileServiceContribution],this.backServices=[{servicePath:l.DiskFileServicePath,clientToken:l.IDiskFileProvider,protocol:m.DiskFileServiceProtocol}]}};t.FileServiceClientModule=h,t.FileServiceClientModule=h=n.__decorate([(0,r.Injectable)()],h)},23188:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShadowFileSystemProvider=void 0;const n=e(85608),r=e(76003),o=e(41869);let l=class{constructor(){this.capabilities=2048,this.onDidChangeCapabilities=o.Event.None,this.readonly=!0,this.shadowFiles=new Map,this.fileChangeEmitter=new o.Emitter,this.onDidChangeFile=this.fileChangeEmitter.event}unwatch(E){throw new Error("Method not implemented.")}readFileStream(E){throw new Error("Method not implemented.")}watch(E,p){throw new Error("Method not implemented.")}stat(E){return Promise.resolve({uri:E.toString(),lastModification:0})}readDirectory(E){throw new Error("Method not implemented.")}createDirectory(E){throw new Error("Method not implemented.")}readFile(E){return this.shadowFiles.get(E.toString())||o.BinaryBuffer.fromString("no available").buffer}writeFile(E,p,v){this.shadowFiles.set(E.toString(),p)}delete(E,p){throw new Error("Method not implemented.")}rename(E,p,v){throw new Error("Method not implemented.")}copy(E,p,v){throw new Error("Method not implemented.")}exists(E){throw new Error("Method not implemented.")}access(E,p){throw new Error("Method not implemented.")}};t.ShadowFileSystemProvider=l,t.ShadowFileSystemProvider=l=n.__decorate([(0,r.Injectable)()],l)},81952:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSystemWatcher=void 0;const n=e(43718);function r(l,m){return l.filter(E=>!!E.uri.startsWith(m))}class o{constructor(m){this.toDispose=new n.DisposableCollection,this.changeEmitter=new n.Emitter,this.toDispose.push(this.changeEmitter),this.fileServiceClient=m.fileServiceClient,this.watchId=m.watchId,this.uri=m.uri,this.fileServiceClient.onFilesChanged(E=>{const p=r(E,this.uri.toString());p&&p.length>0&&this.changeEmitter.fire(p)})}get onFilesChanged(){return this.changeEmitter.event}dispose(){return Promise.all([this.toDispose.dispose(),this.fileServiceClient.unwatchFileChanges(this.watchId)])}isDisposed(){return this.toDispose.disposed}}t.FileSystemWatcher=o},91813:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EXT_LIST_TEXT=t.EXT_LIST_IMAGE=t.EXT_LIST_VIDEO=void 0,t.getFileTypeByExt=e,t.EXT_LIST_VIDEO=new Set(["mp4","webm","mkv","mov","mts","flv","avi","wmv"]),t.EXT_LIST_IMAGE=new Set(["png","gif","jpg","jpeg","svg","bmp","avif","cr2","cr3","dng","flif","heic","icns","jxl","jpm","jpx","nef","raf","rw2","tif","orf","webp","apng"]),t.EXT_LIST_TEXT=new Set(["xml"]);function e(n){let r="text";return n&&(t.EXT_LIST_IMAGE.has(n)?r="image":t.EXT_LIST_VIDEO.has(n)?r="video":t.EXT_LIST_TEXT.has(n)?r="text":r="binary"),r}},79929:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IBrowserFileSystemRegistry=t.IFileServiceClient=void 0;const n=e(43718);t.IFileServiceClient=n.IFileServiceClient,t.IBrowserFileSystemRegistry=Symbol("IBrowserFileSystemRegistry")},49818:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileSystemError=t.FileOperationError=t.FileSystemProviderError=t.FileSystemProviderErrorCode=t.FileAccess=t.IFileService=t.IShadowFileProvider=t.IDiskFileProvider=t.FileStat=t.FileType=void 0,t.createFileSystemProviderError=v,t.markAsFileSystemProviderError=s,t.containsExtraFileMethod=c,t.notEmpty=g,t.isErrnoException=d,t.handleError=u;const n=e(85608),r=e(43718);var o=e(31036);Object.defineProperty(t,"FileType",{enumerable:!0,get:function(){return o.FileType}}),Object.defineProperty(t,"FileStat",{enumerable:!0,get:function(){return o.FileStat}}),n.__exportStar(e(11854),t),t.IDiskFileProvider=Symbol("IDiskFileProvider"),t.IShadowFileProvider=Symbol("IShadowFileProvider"),t.IFileService=Symbol("IFileService");var l;(function(_){let f;(function(a){a.F_OK=0,a.R_OK=4,a.W_OK=2,a.X_OK=1})(f=_.Constants||(_.Constants={}))})(l||(t.FileAccess=l={}));var m;(function(_){_.FileExists="EntryExists",_.FileNotFound="EntryNotFound",_.FileNotADirectory="EntryNotADirectory",_.FileIsADirectory="EntryIsADirectory",_.FileIsOutOfSync="FileIsOutOfSync",_.FileExceedsMemoryLimit="EntryExceedsMemoryLimit",_.FileTooLarge="EntryTooLarge",_.FileWriteLocked="EntryWriteLocked",_.NoPermissions="NoPermissions",_.Unavailable="Unavailable",_.Unknown="Unknown"})(m||(t.FileSystemProviderErrorCode=m={}));class E extends Error{static declare(f,a){return Object.assign((...b)=>v(a(...b),f),{is:b=>{var y;return(y=b.stack)===null||y===void 0?void 0:y.startsWith(f)}})}constructor(f,a){super(f),this.code=a}is(f){return this.name===f.name}}t.FileSystemProviderError=E;class p extends Error{constructor(f,a,b){super(f),this.fileOperationResult=a,this.options=b}static isFileOperationError(f){return f instanceof Error&&!(0,r.isUndefinedOrNull)(f.fileOperationResult)}}t.FileOperationError=p;function v(_,f){const a=new E(_.toString(),f);return s(a,f),a}function s(_,f){return _.name=f?`${f} (FileSystemError)`:"FileSystemError",_}var h;(function(_){_.FileNotFound=E.declare(m.FileNotFound,(f,a)=>`${a?a+" ":""} '${f}' is not found.`),_.FileExists=E.declare(m.FileExists,(f,a)=>`${a?a+" ":""}'${f}' already exists.`),_.FileNotADirectory=E.declare(m.FileNotADirectory,(f,a)=>`${a?a+" ":""}'${f}' is not a directory.`),_.FileIsADirectory=E.declare(m.FileIsADirectory,(f,a)=>`${a?a+" ":""}'${f}' is a directory.`),_.FileIsOutOfSync=E.declare(m.FileIsOutOfSync,(f,a)=>`${a?a+" ":""}'${f}' is out of sync.`),_.FileExceedsMemoryLimit=E.declare(m.FileExceedsMemoryLimit,(f,a)=>`${a?a+" ":""}'${f}' is exceeds memory limit.`),_.FileTooLarge=E.declare(m.FileTooLarge,(f,a)=>`${a?a+" ":""}'${f}' is too large.`),_.FileWriteLocked=E.declare(m.FileWriteLocked,(f,a)=>`${a?a+" ":""}'${f}' is locked.`),_.FileIsNoPermissions=E.declare(m.NoPermissions,(f,a)=>`${a?a+" ":""}'${f}' is no permissions.`),_.Unavailable=E.declare(m.Unavailable,(f,a)=>`${a?a+" ":""}'${f}' is unavailable.`),_.Unknown=E.declare(m.Unknown,(f,a)=>`${a?a+" ":""}'${f}' is unkonw.`)})(h||(t.FileSystemError=h={}));function c(_,f){return(0,r.hasProperty)(_,f)&&(0,r.isFunction)(_[f])}function g(_){return _!==void 0}function d(_){return _.code!==void 0&&_.errno!==void 0}function u(_){var f,a,b,y,S;if(d(_))switch(_.code){case"EEXIST":throw h.FileExists(r.Uri.file((f=_.path)!==null&&f!==void 0?f:""));case"EPERM":case"EACCESS":throw h.FileIsNoPermissions(r.Uri.file((a=_.path)!==null&&a!==void 0?a:""));case"ENOENT":throw h.FileNotFound(r.Uri.file((b=_.path)!==null&&b!==void 0?b:""));case"ENOTDIR":throw h.FileNotADirectory(r.Uri.file((y=_.path)!==null&&y!==void 0?y:""));case"EISDIR":throw h.FileIsADirectory(r.Uri.file((S=_.path)!==null&&S!==void 0?S:""))}throw _}},42933:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(79929),t),n.__exportStar(e(49818),t),n.__exportStar(e(28217),t),n.__exportStar(e(91813),t),n.__exportStar(e(50295),t)},70671:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DiskFileServiceProtocol=void 0;const n=e(26387),r=e(52890),o=e(50295);t.DiskFileServiceProtocol={name:o.DiskFileServicePath,methods:[{method:"readFile",request:[{name:"uri",type:r.UriComponentsProto}],response:{type:n.Type.binary()}}]}},50295:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileExtServicePath=t.FileWatcherServicePath=t.ShadowFileServicePath=t.DiskFileServicePath=t.FileServicePath=void 0,t.FileServicePath="FileService",t.DiskFileServicePath="DiskFileService",t.ShadowFileServicePath="ShadowFileService",t.FileWatcherServicePath="FileWatcherService",t.FileExtServicePath="FileExtServicePath"},28217:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WatcherProcessManagerProxy=t.WatcherServiceProxy=t.WATCHER_INIT_DATA_KEY=t.SUMI_WATCHER_PROCESS_SOCK_KEY=t.INsfw=void 0;const n=e(86058);var r;(function(o){let l;(function(m){m[m.CREATED=0]="CREATED",m[m.DELETED=1]="DELETED",m[m.MODIFIED=2]="MODIFIED",m[m.RENAMED=3]="RENAMED"})(l=o.actions||(o.actions={}))})(r||(t.INsfw=r={})),t.SUMI_WATCHER_PROCESS_SOCK_KEY="sumi-watcher-process-sock",t.WATCHER_INIT_DATA_KEY="sumi-watcher-init-data",t.WatcherServiceProxy=new n.ProxyIdentifier("WatcherHostServiceImpl"),t.WatcherProcessManagerProxy=new n.ProxyIdentifier("WatcherProcessManagerProxy")},14951:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(42933),t)},57942:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeDialogModel=void 0;const r=e(85608),o=e(76003),l=e(97267),m=e(41869),E=e(26542),p=e(6250),v=e(2812),s=r.__importDefault(e(89200)),h=e(9018);let c=n=class{static createContainer(d,u){return d.createChild([{token:p.IFileDialogTreeService,useValue:u},{token:p.IFileDialogModel,useClass:n}])}static createModel(d,u){return n.createContainer(d,u).get(p.IFileDialogModel)}constructor(){this.selectedDecoration=new l.Decoration(s.default.mod_selected),this.focusedDecoration=new l.Decoration(s.default.mod_focused),this.loadingDecoration=new l.Decoration(s.default.mod_loading),this.cutDecoration=new l.Decoration(s.default.mod_cut),this._selectedFiles=[],this.disposableCollection=new m.DisposableCollection,this.onDidFocusedFileChangeEmitter=new m.Emitter,this.onDidSelectedFileChangeEmitter=new m.Emitter,this.clearFileSelectedDecoration=()=>{this._selectedFiles.forEach(d=>{this.selectedDecoration.removeTarget(d)}),this._selectedFiles=[],this.onDidSelectedFileChangeEmitter.fire([])},this.activeFileDecoration=(d,u=!0)=>{d!==this.treeModel.root&&(this.preContextMenuFocusedFile&&(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile),this.preContextMenuFocusedFile=null),d&&(this.selectedFiles.length>0&&this.selectedFiles.forEach(_=>{this.selectedDecoration.removeTarget(_)}),this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.selectedDecoration.addTarget(d),this.focusedDecoration.addTarget(d),this._focusedFile=d,this._selectedFiles=[d],this.onDidFocusedFileChangeEmitter.fire(d.uri),this.onDidSelectedFileChangeEmitter.fire([d.uri]),u&&this.treeModel.dispatchChange()))},this.selectFileDecoration=(d,u=!0)=>{d!==this.treeModel.root&&(this.preContextMenuFocusedFile&&(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile),this.preContextMenuFocusedFile=null),d&&(this.selectedFiles.length>0&&this.selectedFiles.forEach(_=>{this.selectedDecoration.removeTarget(_)}),this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.selectedDecoration.addTarget(d),this._selectedFiles=[d],this.onDidSelectedFileChangeEmitter.fire([d.uri]),u&&this.treeModel.dispatchChange()))},this.activeFileFocusedDecoration=(d,u=!1)=>{d!==this.treeModel.root&&(this.focusedFile!==d&&(u?(this.preContextMenuFocusedFile?(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile)):this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.preContextMenuFocusedFile=d):this.focusedFile&&(this.preContextMenuFocusedFile=null,this.focusedDecoration.removeTarget(this.focusedFile)),d&&(this.selectedDecoration.addTarget(d),this.focusedDecoration.addTarget(d),this._focusedFile=d,this._selectedFiles.push(d),this.onDidFocusedFileChangeEmitter.fire(d.uri),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(_=>_.uri)))),this.treeModel.dispatchChange())},this.activeFileSelectedDecoration=d=>{this._selectedFiles.indexOf(d)>-1||(this._selectedFiles.push(d),this.selectedDecoration.addTarget(d),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(u=>u.uri)),this.treeModel.dispatchChange())},this.activeFileDecorationByRange=(d,u)=>{for(this.clearFileSelectedDecoration(),this.preContextMenuFocusedFile=null;d<=u;d++){const _=this.treeModel.root.getTreeNodeAtIndex(d);_&&(this._selectedFiles.push(_),this.selectedDecoration.addTarget(_))}this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(_=>_.uri)),this.treeModel.dispatchChange()},this.enactiveFileDecoration=()=>{this.focusedFile&&(this.focusedDecoration.removeTarget(this.focusedFile),this.onDidFocusedFileChangeEmitter.fire(),this.treeModel.dispatchChange()),this._focusedFile=void 0},this.toggleDirectory=async d=>{d.expanded?this.fileTreeHandle.collapseNode(d):this.fileTreeHandle.expandNode(d)},this.handleTreeBlur=()=>{this.enactiveFileDecoration()},this.handleTreeFocus=()=>{},this.handleItemRangeClick=(d,u)=>{if(!this.focusedFile)this.handleItemClick(d,u);else if(this.focusedFile&&this.focusedFile!==d){const _=this.treeModel.root.getIndexAtTreeNode(d),f=this.treeModel.root.getIndexAtTreeNode(this.focusedFile);f>_?this.activeFileDecorationByRange(_,f):f<_&&this.activeFileDecorationByRange(f,_)}},this.handleItemToggleClick=(d,u)=>{u!==l.TreeNodeType.CompositeTreeNode&&u!==l.TreeNodeType.TreeNode||(this.selectedFiles.indexOf(d)>-1?this.focusedFile===d?this.enactiveFileDecoration():this.activeFileFocusedDecoration(d):this.activeFileSelectedDecoration(d))},this.handleItemClick=(d,u)=>{this.clickTimes++,(u===l.TreeNodeType.CompositeTreeNode||u===l.TreeNodeType.TreeNode)&&this.activeFileDecoration(d),u===l.TreeNodeType.CompositeTreeNode&&this.corePreferences["workbench.list.openMode"]==="singleClick"&&this.toggleDirectory(d),this.clickTimer&&clearTimeout(this.clickTimer),this.clickTimer=setTimeout(()=>{this.clickTimes>1&&u!==l.TreeNodeType.TreeNode&&this.corePreferences["workbench.list.openMode"]==="doubleClick"&&this.toggleDirectory(d),this.clickTimes=0},200)},this.getDirectoryList=()=>this.fileTreeDialogService.getDirectoryList(),this._whenReady=this.initTreeModel()}get onDidFocusedFileChange(){return this.onDidFocusedFileChangeEmitter.event}get onDidSelectedFileChange(){return this.onDidSelectedFileChangeEmitter.event}get fileTreeHandle(){return this._fileTreeHandle}get decorations(){return this._decorations}get treeModel(){return this._treeModel}get whenReady(){return this._whenReady}get focusedFile(){return this._focusedFile}get selectedFiles(){return this._selectedFiles}async initTreeModel(){const d=(await this.fileTreeDialogService.resolveChildren())[0];this._treeModel=this.injector.get(v.FileTreeModel,[d]),this.initDecorations(d),this.disposableCollection.push(this._decorations),this.disposableCollection.push(this.labelService.onDidChange(()=>{this.treeModel.dispatchChange()})),this.disposableCollection.push(this.treeModel.root.watcher.on(l.TreeNodeEvent.WillResolveChildren,u=>{this.loadingDecoration.addTarget(u)})),this.disposableCollection.push(this.treeModel.root.watcher.on(l.TreeNodeEvent.DidResolveChildren,u=>{this.loadingDecoration.removeTarget(u)}))}async updateTreeModel(d){const u=await this.fileTreeDialogService.resolveRoot(d);if(u&&u.length>0){const _=u[0];this._treeModel=this.injector.get(v.FileTreeModel,[_]),this.clearFileSelectedDecoration(),this.initDecorations(_)}}initDecorations(d){this._decorations&&this._decorations.dispose(),this._decorations=new l.DecorationsManager(d),this._decorations.addDecoration(this.selectedDecoration),this._decorations.addDecoration(this.focusedDecoration),this._decorations.addDecoration(this.cutDecoration),this._decorations.addDecoration(this.loadingDecoration)}handleTreeHandler(d){this._fileTreeHandle=d}dispose(){this.disposableCollection.dispose()}};t.FileTreeDialogModel=c,c.FILE_TREE_SNAPSHOT_KEY="FILE_TREE_SNAPSHOT",c.DEFAULT_LOCATION_FLUSH_DELAY=500,r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],c.prototype,"injector",void 0),r.__decorate([(0,o.Autowired)(p.IFileDialogTreeService),r.__metadata("design:type",h.FileTreeDialogService)],c.prototype,"fileTreeDialogService",void 0),r.__decorate([(0,o.Autowired)(E.LabelService),r.__metadata("design:type",E.LabelService)],c.prototype,"labelService",void 0),r.__decorate([(0,o.Autowired)(m.CorePreferences),r.__metadata("design:type",Object)],c.prototype,"corePreferences",void 0),t.FileTreeDialogModel=c=n=r.__decorate([(0,o.Injectable)(),r.__metadata("design:paramtypes",[])],c)},69748:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FILE_TREE_BADGE_LIMIT=t.FILE_TREE_NODE_HEIGHT=t.FileTreeDialogNode=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),l=e(97267),m=e(41869),E=e(69959),p=n.__importDefault(e(89200)),v=({item:s,onClick:h,itemType:c,labelService:g,leftPadding:d=8,onTwistierClick:u,decorations:_,defaultLeftPadding:f=8,template:a})=>{const b=c===l.TreeNodeType.RenamePrompt,y=c===l.TreeNodeType.NewPrompt,S=b||y,A=(0,m.useDesignStyles)(p.default.expansion_toggle,"expansion_toggle"),w=(0,m.useDesignStyles)(p.default.file_tree_node,"file_tree_node"),T=K=>{(c===l.TreeNodeType.TreeNode||c===l.TreeNodeType.CompositeTreeNode)&&h(K,s,c)},D=K=>{(c===l.TreeNodeType.TreeNode||c===l.TreeNodeType.CompositeTreeNode)&&(u?u(K,s,c):h(K,s,c))},I=c===l.TreeNodeType.CompositeTreeNode;let O;S?y?O=`${f+(s.parent.depth+1||0)*(d||0)}px`:O=`${f+(s.target.depth||0)*(d||0)}px`:O=I?`${f+(s.depth||0)*(d||0)}px`:`${f+(s.depth||0)*(d||0)+8}px`;const L={height:t.FILE_TREE_NODE_HEIGHT,lineHeight:`${t.FILE_TREE_NODE_HEIGHT}px`,paddingLeft:O},R=(K,U)=>{if(_&&_?.classlist.indexOf(p.default.mod_loading)>-1)return o.default.createElement(l.Loading,null);if(S&&K instanceof l.PromptHandle){let X=!1;if(b?X=K.target.type===l.TreeNodeType.CompositeTreeNode:X=K.type===l.TreeNodeType.CompositeTreeNode,X)return o.default.createElement("div",{className:(0,r.default)(p.default.file_tree_node_segment,A,(0,m.getIcon)("arrow-right"),{[`${p.default.mod_collapsed}`]:y||!(b&&K.target.type===l.TreeNodeType.CompositeTreeNode&&K.target.expanded)})})}else return o.default.createElement("div",{onClick:U,className:(0,r.default)(p.default.file_tree_node_segment,A,(0,m.getIcon)("arrow-right"),{[`${p.default.mod_collapsed}`]:!K.expanded})})},M=K=>{let U,X;S&&K instanceof l.PromptHandle?K instanceof l.RenamePromptHandle?(U=K.target.uri.resolve(K.$.value),X=E.Directory.is(K.target)):(U=K.parent.uri.resolve(K.$.value),X=K.type===l.TreeNodeType.CompositeTreeNode):(U=K.uri,X=K.filestat.isDirectory);const z=g.getIcon(U,{isDirectory:X});return o.default.createElement("div",{className:(0,r.default)(p.default.file_icon,z,{expanded:X&&K.expanded}),style:{height:t.FILE_TREE_NODE_HEIGHT,lineHeight:`${t.FILE_TREE_NODE_HEIGHT}px`}})},k=K=>a?o.default.createElement(a,null):S&&K instanceof l.PromptHandle?o.default.createElement("div",{className:(0,r.default)(p.default.file_tree_node_segment,p.default.file_tree_node_inputbox)},o.default.createElement("div",{className:(0,r.default)("input-box",p.default.file_tree_node_prompt_box)},o.default.createElement(K.ProxiedInput,{wrapperStyle:{height:t.FILE_TREE_NODE_HEIGHT,padding:"0 5px"}}))):o.default.createElement("div",{className:(0,r.default)(p.default.file_tree_node_segment,p.default.file_tree_node_displayname)},K.name),B=()=>o.default.createElement("div",{className:(0,r.default)(p.default.file_tree_node_segment,p.default.file_tree_node_tail)},x()),x=()=>null,N=K=>{if(I)return R(K,D);if(S)return R(K,()=>{})},j=()=>s.tooltip||s.name;return o.default.createElement("div",{key:s.id,onClick:T,title:j(),className:(0,r.default)(w,_?_.classlist:null),style:L,draggable:c===l.TreeNodeType.TreeNode||c===l.TreeNodeType.CompositeTreeNode},o.default.createElement("div",{className:(0,r.default)(p.default.file_tree_node_content)},N(s),M(s),o.default.createElement("div",{className:S?p.default.file_tree_node_prompt_wrap:p.default.file_tree_node_overflow_wrap},k(s)),B()))};t.FileTreeDialogNode=v,t.FILE_TREE_NODE_HEIGHT=22,t.FILE_TREE_BADGE_LIMIT=99},68195:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileDialogContextKey=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(66e3);let m=class{initScopedContext(p){this._contextKeyService=this.globalContextKeyService.createScoped(p),this.fileDialogViewVisibleContext=l.FileDialogViewVisibleContext.bind(this._contextKeyService)}get service(){return this._contextKeyService}};t.FileDialogContextKey=m,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],m.prototype,"globalContextKeyService",void 0),t.FileDialogContextKey=m=n.__decorate([(0,r.Injectable)()],m)},9018:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeDialogService=void 0;const n=e(85608),r=e(76003),o=e(97267),l=e(41869),m=e(26542),E=e(51500),p=e(6250),v=e(68195);let s=class extends o.Tree{constructor(c){super(),this._whenReady=this.resolveWorkspaceRoot(c)}get whenReady(){return this._whenReady}async resolveWorkspaceRoot(c){if(c){const g=new l.URI(c).withScheme(l.Schemes.file),d=await this.fileTreeAPI.resolveFileStat(g);d&&(this.workspaceRoot=d)}}async resolveChildren(c){if(c){if(c.uri){const{children:g}=await this.fileTreeAPI.resolveChildren(this,c.uri.toString(),c);return g}}else{this.workspaceRoot||(this.workspaceRoot=(await this.workspaceService.roots)[0]);const{children:g}=await this.fileTreeAPI.resolveChildren(this,this.workspaceRoot);return this.root=g[0],g}return[]}async resolveRoot(c){let g;/^file:\/\//.test(c)&&(g=new l.URI(c)),g=l.URI.file(c);const d=await this.fileTreeAPI.resolveFileStat(g);if(d){const{children:u}=await this.fileTreeAPI.resolveChildren(this,d);return this.root=u[0],u}}getDirectoryList(){const c=[];if(!this.root)return c;let g=new l.URI(this.workspaceRoot.uri);if(g&&g.parent)for(;g.parent;){const d=g.codeUri.fsPath;if(c.indexOf(d)>=0)break;c.push(d),g=g.parent}else c.push(g.codeUri.fsPath.toString());return c}sortComparator(c,g){return c.constructor===g.constructor?c.name.startsWith(".")&&!g.name.startsWith(".")?1:!c.name.startsWith(".")&&g.name.startsWith(".")?-1:c.name.localeCompare(g.name,"kn",{numeric:!0}):c.type===o.TreeNodeType.CompositeTreeNode?-1:g.type===o.TreeNodeType.CompositeTreeNode?1:0}initContextKey(c){c&&this.fileDialogContextKey.initScopedContext(c)}get contextKey(){return this.fileDialogContextKey}dispose(){super.dispose()}};t.FileTreeDialogService=s,n.__decorate([(0,r.Autowired)(p.IFileTreeAPI),n.__metadata("design:type",Object)],s.prototype,"fileTreeAPI",void 0),n.__decorate([(0,r.Autowired)(E.IWorkspaceService),n.__metadata("design:type",Object)],s.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(m.LabelService),n.__metadata("design:type",m.LabelService)],s.prototype,"labelService",void 0),n.__decorate([(0,r.Autowired)(v.FileDialogContextKey),n.__metadata("design:type",v.FileDialogContextKey)],s.prototype,"fileDialogContextKey",void 0),t.FileTreeDialogService=s=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[String])],s)},51888:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileDialog=t.FILE_TREE_DIALOG_HEIGHT=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),l=e(41869),m=e(68974),E=e(72665),p=e(69748),v=n.__importDefault(e(13294));t.FILE_TREE_DIALOG_HEIGHT=22;const s=({options:h,model:c,isOpenDialog:g,fileService:d})=>{const u=(0,l.useInjectable)(E.IDialogService),_=(0,r.useRef)(null),[f,a]=(0,r.useState)(h.defaultFileName||""),[b,y]=(0,r.useState)(!1),[S,A]=(0,r.useState)(""),[w,T]=(0,r.useState)([]);(0,r.useEffect)(()=>{var G;return c&&(y(!1),O(),(G=d.contextKey.fileDialogViewVisibleContext)===null||G===void 0||G.set(!0)),()=>{c.dispose()}},[c]),(0,r.useEffect)(()=>{h.defaultFileName&&a(h.defaultFileName)},[h]),(0,r.useEffect)(()=>{if(b){const G=c.getDirectoryList();T(G)}},[b]);const D=(0,r.useCallback)(()=>{const G=c.selectedFiles.map(J=>J.uri.path.toString());if(f&&h.showNameInput&&(G?.length===1||h.defaultUri)){const J=G?.length===1?G[0]:h.defaultUri.path.toString();u.hide([l.path.join(J,f)])}else G.length>0?u.hide(G):h.defaultUri?u.hide([h.defaultUri.path.toString()]):c.treeModel&&c.treeModel.root?u.hide([c.treeModel.root.uri.path.toString()]):u.hide([]);y(!1),d.contextKey.fileDialogViewVisibleContext.set(!1)},[b,u,c,f,h]),I=(0,r.useCallback)(()=>{y(!1),u.hide(),d.contextKey.fileDialogViewVisibleContext.set(!1)},[b,u]),O=(0,r.useCallback)(async()=>{await c.whenReady,await c.treeModel.ensureReady,A(c.treeModel.root.uri.codeUri.fsPath),y(!0)},[c,S,b]),L=!g,R=(0,r.useCallback)(G=>{c.handleTreeHandler({...G,getModel:()=>c.treeModel})},[c]),M=(0,r.useCallback)((G,J)=>{G.stopPropagation();const{toggleDirectory:Y}=c;Y(J)},[c]),k=(0,r.useCallback)(G=>B(G)?!1:G.shiftKey,[]),B=(0,r.useCallback)(G=>{const{metaKey:J,ctrlKey:Y}=G;return l.isMacintosh&&J||Y},[]),x=(0,r.useCallback)((G,J,Y)=>{var H;G.stopPropagation();const{handleItemClick:$,handleItemToggleClick:Z,handleItemRangeClick:re}=c;if(!J)return;const ce=k(event),ge=B(event);if(ce&&!L&&h.canSelectMany)re(J,Y);else if(ge&&!L&&h.canSelectMany)Z(J,Y);else if(L)Y===o.TreeNodeType.CompositeTreeNode&&$(J,Y);else if(h.canSelectFiles&&Y===o.TreeNodeType.TreeNode){const Ae=new Set(Object.values((H=h.filters)!==null&&H!==void 0?H:{}).flat().map(te=>`.${te}`));if(Ae.size>0){const te=l.URI.parse(J.filestat.uri).path.ext;Ae.has(te)&&$(J,Y)}else $(J,Y)}else h.canSelectFolders&&Y===o.TreeNodeType.CompositeTreeNode&&$(J,Y)},[c,L,h]),N=(0,r.useCallback)(async G=>{y(!1),A(G),await c.updateTreeModel(G),y(!0)},[c,b,S]),j=(0,r.useCallback)(G=>r.default.createElement(p.FileTreeDialogNode,{item:G.item,itemType:G.itemType,labelService:c.labelService,decorations:c.decorations.getDecorations(G.item),onClick:x,onTwistierClick:M,defaultLeftPadding:8,leftPadding:8}),[c.treeModel]),K=(0,r.useCallback)(()=>{if(b){if(c.treeModel)return r.default.createElement(o.RecycleTree,{height:300,itemHeight:t.FILE_TREE_DIALOG_HEIGHT,onReady:R,model:c.treeModel},j)}else return r.default.createElement(m.Progress,{loading:!0})},[b,c]),U=(0,r.useCallback)(()=>{if(w.length>0)return r.default.createElement(o.Select,{onChange:N,className:v.default.select_control,size:"small",value:S},w.map((G,J)=>r.default.createElement(o.Option,{value:G,key:`${J} - ${G}`},G)))},[w,S]),X=(0,r.useCallback)(G=>{const{key:J}=l.KeyCode.createKeyCode(G),Y=G.shiftKey||G.metaKey||G.altKey||G.ctrlKey;J&&l.Key.ENTER.keyCode===J.keyCode&&!Y&&D()},[D]);(0,r.useEffect)(()=>{var G;return _.current&&(d.initContextKey(_.current),d.contextKey.fileDialogViewVisibleContext.set(!0),(G=_.current)===null||G===void 0||G.addEventListener("keyup",X)),()=>{var J;(J=_.current)===null||J===void 0||J.removeEventListener("keyup",X)}},[]);const z=(0,r.useMemo)(()=>r.default.createElement(r.default.Fragment,null,r.default.createElement("div",{className:v.default.file_dialog_directory},U()),r.default.createElement("div",{className:v.default.file_dialog_content},K())),[U,K]),Q=(0,r.useMemo)(()=>r.default.createElement("div",{className:v.default.file_dialog_buttons},r.default.createElement(o.Button,{onClick:I,type:"secondary",className:v.default.button},(0,l.localize)("dialog.file.close")),r.default.createElement(o.Button,{onClick:D,type:"primary",className:v.default.button,disabled:L&&h.showNameInput&&f.length===0},g&&h.openLabel||(0,l.localize)("dialog.file.ok"))),[I,D,L,g,f,h]);return r.default.createElement("div",{className:v.default.file_dialog_wrapper,ref:_},r.default.createElement("div",{className:v.default.file_dialog_directory_title},g?h.title||(0,l.localize)("dialog.file.openLabel"):h.saveLabel||(0,l.localize)("dialog.file.saveLabel")),z,!g&&h.showNameInput&&r.default.createElement("div",{className:v.default.file_dialog_file_container},r.default.createElement("span",{className:v.default.file_dialog_file_name},(0,l.localize)("dialog.file.name"),": "),r.default.createElement(o.Input,{size:"small",value:f,autoFocus:!0,selection:{start:0,end:f.indexOf(".")||f.length},onChange:G=>a(G.target.value)})),Q)};t.FileDialog=s},89508:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WindowDialogServiceImpl=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(76003),l=e(41869),m=e(37406),E=e(14951),p=e(72665),v=e(57942),s=n.__importDefault(e(13294)),h=e(9018),c=e(51888);let g=class{constructor(){this.idx=1,this._whenReady=this.init()}async init(){this.recentGlobalStorage=await this.storageProvider(l.STORAGE_NAMESPACE.GLOBAL_RECENT_DATA);const u=await this.recentGlobalStorage.get("RECENT_DIALOG_DEFAULT_URI");if(u)this._defaultUri=new l.URI(u);else{const _=await this.fileServiceClient.getCurrentUserHome();this._defaultUri=new l.URI(_.uri)}}get defaultUri(){return this._defaultUri}get whenReady(){return this._whenReady}async updateRecentDefaultUri(u){this.recentGlobalStorage.set("RECENT_DIALOG_DEFAULT_URI",u.toString()),this._defaultUri=u}async showOpenDialog(u={}){this.dialogService.reset(),await this.whenReady;const _={canSelectFiles:!0,canSelectFolders:!1,canSelectMany:!1};if(this.appConfig.isElectronRenderer&&!this.appConfig.isRemote){const f=this.injector.get(m.IElectronMainUIService),a=[];u.canSelectFiles&&a.push("openFile"),u.canSelectFolders&&a.push("openDirectory"),u.canSelectMany&&a.push("multiSelections"),l.isMacintosh&&a.push("treatPackageAsDirectory","createDirectory");const b=u.defaultUri||this.defaultUri,y=await f.showOpenDialog(l.electronEnv.currentWindowId,{defaultPath:b.codeUri.fsPath,title:u.title,buttonLabel:u.openLabel,properties:a});if(y&&y.length>0){const S=y.map(A=>l.URI.file(A));return this.updateRecentDefaultUri(S[0].parent),S}else return}else{u.defaultUri||(u.defaultUri=this.defaultUri);let f;u.defaultUri?f=this.injector.get(h.FileTreeDialogService,[u.defaultUri.toString()]):f=this.injector.get(h.FileTreeDialogService),await f.whenReady;const a=v.FileTreeDialogModel.createModel(this.injector,f),b=await this.dialogService.open({message:r.default.createElement(c.FileDialog,{key:this.idx++,fileService:f,model:a,options:{..._,...u},isOpenDialog:!0}),type:l.MessageType.Empty,buttons:[],closable:!0,props:{className:s.default.file_dialog_wrapper}});if(this.dialogService.reset(),b&&b.length>0){const y=b.map(S=>l.URI.file(S));return this.updateRecentDefaultUri(y[0].parent),y}else return}}async showSaveDialog(u={}){if(await this.whenReady,this.appConfig.isElectronRenderer&&!this.appConfig.isRemote){const _=u.defaultUri||this.defaultUri,a=await this.injector.get(m.IElectronMainUIService).showSaveDialog(l.electronEnv.currentWindowId,{defaultPath:_.resolve(u.defaultFileName||"").codeUri.fsPath,title:u.saveLabel,message:u.saveLabel});if(a){const b=l.URI.file(a);return this.updateRecentDefaultUri(b.parent),b}else return}else{u.defaultUri||(u.defaultUri=this.defaultUri);let _;u.defaultUri?_=this.injector.get(h.FileTreeDialogService,[u.defaultUri.toString()]):_=this.injector.get(h.FileTreeDialogService),await _.whenReady;const f=v.FileTreeDialogModel.createModel(this.injector,_),a=await this.dialogService.open({message:r.default.createElement(c.FileDialog,{key:this.idx++,fileService:_,model:f,options:u,isOpenDialog:!1}),type:l.MessageType.Empty,buttons:[],closable:!0,props:{className:s.default.file_dialog_wrapper}});if(this.dialogService.reset(),a&&a.length>0){const b=l.URI.file(a[0]);return this.updateRecentDefaultUri(b.parent),b}else return}}};t.WindowDialogServiceImpl=g,n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],g.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(p.IDialogService),n.__metadata("design:type",Object)],g.prototype,"dialogService",void 0),n.__decorate([(0,o.Autowired)(E.IFileServiceClient),n.__metadata("design:type",Object)],g.prototype,"fileServiceClient",void 0),n.__decorate([(0,o.Autowired)(l.StorageProvider),n.__metadata("design:type",Function)],g.prototype,"storageProvider",void 0),n.__decorate([(0,o.Autowired)(l.AppConfig),n.__metadata("design:type",Object)],g.prototype,"appConfig",void 0),t.WindowDialogServiceImpl=g=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],g)},88014:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileContextKey=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(16413);let m=class{constructor(){this.explorerResourceIsFolder=l.ExplorerResourceIsFolderContext.bind(this.globalContextKeyService),this.explorerViewletVisibleContext=l.ExplorerViewletVisibleContext.bind(this.globalContextKeyService)}initScopedContext(p){this._contextKeyService=this.globalContextKeyService.createScoped(p),this.explorerFocused=l.ExplorerFocusedContext.bind(this._contextKeyService),this.explorerResourceCut=l.ExplorerResourceCut.bind(this._contextKeyService),this.filesExplorerFocused=l.FilesExplorerFocusedContext.bind(this._contextKeyService),this.filesExplorerInputFocused=l.FilesExplorerInputFocusedContext.bind(this._contextKeyService),this.filesExplorerFilteredContext=l.FilesExplorerFilteredContext.bind(this._contextKeyService),this.explorerCompressedFocusContext=l.ExplorerCompressedFocusContext.bind(this._contextKeyService),this.explorerCompressedFirstFocusContext=l.ExplorerCompressedFirstFocusContext.bind(this._contextKeyService),this.explorerCompressedLastFocusContext=l.ExplorerCompressedLastFocusContext.bind(this._contextKeyService)}get service(){return this._contextKeyService}};t.FileContextKey=m,n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],m.prototype,"globalContextKeyService",void 0),t.FileContextKey=m=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],m)},40439:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(16413),m=e(93899),E=e(68969),p=e(98295),v=e(41893),s=e(54414),h=e(32595),c=e(63067),g=e(58296),d=e(72665),u=e(51500),_=e(6250),f=e(69959),a=e(56384),b=e(57781),y=e(97738),S=e(4446);let A=class{constructor(){this._disposables=new o.DisposableStore,this.isRendered=!1,this.deleteThrottler=new o.Throttler,this.willDeleteUris=[]}initialize(){this.workspaceService.initFileServiceExclude().then(async()=>{await this.fileTreeService.init(),this.fileTreeModelService.initTreeModel()}),this.progressService.registerProgressIndicator(h.EXPLORER_CONTAINER_ID)}async onStart(){this.viewsRegistry.registerViewWelcomeContent(_.RESOURCE_VIEW_ID,{content:(0,o.formatLocalize)("welcome-view.noFolderHelp",o.FILE_COMMANDS.OPEN_FOLDER.id),group:g.ViewContentGroups.Open,order:1}),this.mainLayoutService.collectViewComponent({id:_.RESOURCE_VIEW_ID,name:this.getWorkspaceTitle(),weight:3,priority:9,collapsed:!1,component:a.FileTree},h.EXPLORER_CONTAINER_ID),this._disposables.add(this.workspaceService.onWorkspaceLocationChanged(()=>{const T=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);T&&T.updateViewTitle(_.RESOURCE_VIEW_ID,this.getWorkspaceTitle())}))}onDidStart(){const T=this.injector.get(S.SymlinkDecorationsProvider,[this.fileTreeService]);this.decorationService.registerDecorationsProvider(T)}onDidRender(){this.isRendered=!0;const T=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);T&&(this.fileTreeModelService.whenReady.then(()=>{this.fileTreeModelService.contextKey.explorerViewletVisibleContext.set(T.isActivated())}),T.onActivate(()=>{this.fileTreeModelService.performLocationOnHandleShow(),this.fileTreeModelService.contextKey.explorerViewletVisibleContext.set(!0)}),T.onInActivate(()=>{this.fileTreeModelService.handleTreeBlur(),this.fileTreeModelService.contextKey.explorerViewletVisibleContext.set(!1)}))}getWorkspaceTitle(){let T=(0,o.localize)("file.empty.defaultTitle");const D=this.workspaceService.workspace;return D&&(T=new o.URI(D.uri).displayName,!D.isDirectory&&T.endsWith(`.${this.workspaceService.workspaceSuffixName}`)&&(T=T.slice(0,T.lastIndexOf(".")),T===u.UNTITLED_WORKSPACE))?(0,o.localize)("file.workspace.defaultTip"):T}onReconnect(){this.fileTreeService.reWatch()}revealFile(T){if(T)if(this.isRendered){const D=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);!D||!D.isVisible||D.isCollapsed(_.RESOURCE_VIEW_ID)?this.fileTreeModelService.locationOnShow(T):this.fileTreeModelService.location(T)}else this.fileTreeModelService.locationOnShow(T)}registerMenus(T){T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.NEW_FILE.id,label:(0,o.localize)("file.new")},order:1,group:"0_new"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.NEW_FOLDER.id,label:(0,o.localize)("file.folder.new")},order:2,group:"0_new"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.WORKSPACE_COMMANDS.ADD_WORKSPACE_FOLDER.id,label:(0,o.localize)("workspace.addFolderToWorkspace")},order:1,group:"0_workspace",when:"config.workspace.supportMultiRootWorkspace"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.WORKSPACE_COMMANDS.REMOVE_WORKSPACE_FOLDER.id,label:(0,o.localize)("workspace.removeFolderFromWorkspace")},order:1,group:"0_workspace",when:"config.workspace.supportMultiRootWorkspace"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_RESOURCES.id,label:(0,o.localize)("file.open")},order:1,group:"1_open"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_TO_THE_SIDE.id,label:(0,o.localize)("file.open.side")},order:2,group:"1_open"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_TYPE_WITH.id,label:(0,o.localize)("file.open.type")},order:3,group:"1_open"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_TERMINAL_WITH_PATH.id,label:(0,o.localize)("file.filetree.openTerminalWithPath")},when:"workbench.panel.terminal",order:4,group:"1_open"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.SEARCH_ON_FOLDER.id,label:(0,o.localize)("file.search.folder")},order:1,group:"2_search"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.DELETE_FILE.id,label:(0,o.localize)("file.delete")},order:1,group:"7_modification"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.RENAME_FILE.id,label:(0,o.localize)("file.rename")},order:3,group:"7_modification"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COMPARE_SELECTED.id,label:(0,o.localize)("file.compare")},order:2,group:"3_compare"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_FILE.id,label:(0,o.localize)("file.copy.file")},order:1,group:"5_cutcopypaste"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.CUT_FILE.id,label:(0,o.localize)("file.cut.file")},order:2,group:"5_cutcopypaste"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.PASTE_FILE.id,label:(0,o.localize)("file.paste.file")},order:3,group:"5_cutcopypaste"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_PATH.id,label:(0,o.localize)("file.copy.path")},group:"6_copypath"}),T.registerMenuItem(m.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_RELATIVE_PATH.id,label:(0,o.localize)("file.copy.relativepath")},group:"6_copypath"})}registerCommands(T){const D=()=>{this.fileTreeService.filterMode&&this.fileTreeService.toggleFilterMode()};T.registerCommand(o.FILE_COMMANDS.OPEN_TERMINAL_WITH_PATH,{execute:O=>{let L=O;if(!L)return;const R=this.fileTreeService.getNodeByPathOrUri(L);R&&!R.filestat.isDirectory&&(L=R.uri.parent),this.commandService.executeCommand(o.TERMINAL_COMMANDS.OPEN_WITH_PATH.id,L)}}),T.registerCommand(o.FILE_COMMANDS.SEARCH_ON_FOLDER,{execute:async O=>{var L;let R=O;if(R||(this.fileTreeModelService.focusedFile?R=this.fileTreeModelService.focusedFile.uri:this.fileTreeModelService.selectedFiles.length>0&&(R=(L=this.fileTreeModelService.selectedFiles[0])===null||L===void 0?void 0:L.uri)),!R)return;let M;if(this.fileTreeService.isMultipleWorkspace)for(const k of await this.workspaceService.roots){const B=new o.URI(k.uri);if(B.isEqualOrParent(R)){M=`./${B.relative(R).toString()}`;break}}else if(this.workspaceService.workspace){const k=new o.URI(this.workspaceService.workspace.uri);k.isEqualOrParent(R)&&(M=`./${k.relative(R).toString()}`)}this.commandService.executeCommand(o.SEARCH_COMMANDS.OPEN_SEARCH.id,{includeValue:M+"/"})},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&f.Directory.is(this.fileTreeModelService.contextMenuFile)}),T.registerCommand(o.FILE_COMMANDS.LOCATION,{execute:O=>{O?this.revealFile(O):this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0&&this.revealFile(this.fileTreeModelService.selectedFiles[0].uri)}}),T.registerCommand(o.FILE_COMMANDS.LOCATION_WITH_EDITOR,{execute:()=>{var O,L,R;((L=(O=this.workbenchEditorService.currentEditor)===null||O===void 0?void 0:O.currentUri)===null||L===void 0?void 0:L.scheme)===o.Schemes.file&&this.revealFile((R=this.workbenchEditorService.currentEditor)===null||R===void 0?void 0:R.currentUri)}}),T.registerCommand(o.FILE_COMMANDS.COLLAPSE_ALL,{execute:()=>{const O=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);!O||!O.isVisible||this.fileTreeModelService.collapseAll()}}),T.registerCommand(o.FILE_COMMANDS.REFRESH_ALL,{execute:async()=>{const O=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);!O||!O.isVisible||await this.fileTreeService.refresh()}}),T.registerCommand(o.FILE_COMMANDS.DELETE_FILE,{execute:(O,L)=>{if(D(),L?this.willDeleteUris=this.willDeleteUris.concat(L):this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0?this.willDeleteUris=this.willDeleteUris.concat(this.fileTreeModelService.selectedFiles.map(R=>R.uri)):this.fileTreeModelService.focusedFile&&this.willDeleteUris.push(this.fileTreeModelService.focusedFile.uri),this.willDeleteUris.length!==0)return this.deleteThrottler.queue(this.doDelete.bind(this))},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),T.registerCommand(o.FILE_COMMANDS.RENAME_FILE,{execute:O=>{if(D(),!O)if(this.fileTreeModelService.contextMenuFile)O=this.fileTreeModelService.contextMenuFile.uri;else if(this.fileTreeModelService.focusedFile)O=this.fileTreeModelService.focusedFile.uri;else return;this.fileTreeModelService.renamePrompt(O)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),T.registerCommand(o.FILE_COMMANDS.NEW_FILE,{execute:async O=>{var L;if(D(),O)this.fileTreeModelService.newFilePrompt(O);else if(this.fileTreeService.isCompactMode&&this.fileTreeModelService.activeUri)this.fileTreeModelService.newFilePrompt(this.fileTreeModelService.activeUri);else if(this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0)this.fileTreeModelService.newFilePrompt(this.fileTreeModelService.selectedFiles[0].uri);else{let R;this.fileTreeService.isMultipleWorkspace?R=new o.URI((await this.workspaceService.roots)[0].uri):R=new o.URI((L=this.workspaceService.workspace)===null||L===void 0?void 0:L.uri),this.fileTreeModelService.newFilePrompt(R)}}}),T.registerCommand(o.FILE_COMMANDS.NEW_FOLDER,{execute:async O=>{var L;if(D(),O)this.fileTreeModelService.newDirectoryPrompt(O);else if(this.fileTreeService.isCompactMode&&this.fileTreeModelService.activeUri)this.fileTreeModelService.newDirectoryPrompt(this.fileTreeModelService.activeUri);else if(this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0)this.fileTreeModelService.newDirectoryPrompt(this.fileTreeModelService.selectedFiles[0].uri);else{let R;this.fileTreeService.isMultipleWorkspace?R=new o.URI((await this.workspaceService.roots)[0].uri):R=new o.URI((L=this.workspaceService.workspace)===null||L===void 0?void 0:L.uri),this.fileTreeModelService.newDirectoryPrompt(R)}}}),T.registerCommand(o.FILE_COMMANDS.COMPARE_SELECTED,{execute:(O,L)=>{if(L&&L.length){const R=this.workbenchEditorService.currentEditor;R&&R.currentUri&&this.fileTreeService.compare(L[0],R.currentUri)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!f.Directory.is(this.fileTreeModelService.contextMenuFile)}),T.registerCommand(o.FILE_COMMANDS.OPEN_RESOURCES,{execute:O=>{this.fileTreeService.openAndFixedFile(O)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!f.Directory.is(this.fileTreeModelService.contextMenuFile)}),T.registerCommand(o.FILE_COMMANDS.OPEN_TO_THE_SIDE,{execute:O=>{this.fileTreeService.openToTheSide(O)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!f.Directory.is(this.fileTreeModelService.contextMenuFile)});const I=(O,L)=>{const{availableOpenTypes:R,currentOpenType:M}=this.workbenchEditorService.currentEditorGroup;if(!(R&&O&&M))return{items:[],selectIndex:-1};const k=this.preferenceService.get("workbench.editorAssociations"),B=[],x=(U,X)=>X.type===s.EditorOpenType.code?U.type===s.EditorOpenType.code:X.type===s.EditorOpenType.component&&U.type===s.EditorOpenType.component?U.componentId===X.componentId:!1,N=(U,X)=>(U?U+=(0,o.localize)("file.open.type.detail.and")+X:U=X,U);let j,K;if(k){const U=Object.keys(k).find(X=>(0,o.match)(X,O.path.toString().toLowerCase())||(0,o.match)(X,O.path.base.toLowerCase()));j=U&&k[U]}return R.forEach((U,X)=>{var z;const Q={label:U.title||U.componentId||U.type,detail:U.title,run:G=>L(G,U)};x(M,U)&&(Q.description=N(Q.description,(0,o.localize)("file.open.type.detail.active")),K=X),j&&(!((z=U.componentId)===null||z===void 0)&&z.endsWith(j))&&(Q.description=N(Q.description,(0,o.localize)("file.open.type.detail.default"))),B.push(new o.QuickOpenItem(Q))}),{items:B,selectIndex:K}};T.registerCommand(o.FILE_COMMANDS.OPEN_TYPE_WITH,{execute:O=>{const L=(B,x)=>{var N,j;return B===o.Mode.OPEN?((N=this.workbenchEditorService.currentEditorGroup)===null||N===void 0||N.changeOpenType((j=x.componentId)!==null&&j!==void 0?j:x.type),!0):!1},{items:R,selectIndex:M}=I(O,L);if(R.length===0||typeof M>"u")return;const k=B=>{this.quickOpenService.open({onType:(x,N)=>N(B)},{fuzzyMatchLabel:!0,ignoreFocusOut:!1,placeholder:(0,o.formatLocalize)("file.open.type.placeholder",O.path.base),selectIndex:()=>M})};R.push(new o.QuickOpenItem({label:(0,o.formatLocalize)("file.open.type.preference.default",`*${O.path.ext}`),showBorder:!0,run:B=>{if(B===o.Mode.OPEN){const x=(K,U)=>{var X,z,Q;if(K===o.Mode.OPEN){const G="workbench.editorAssociations",J=this.preferenceService.resolve(G).scope,Y=this.preferenceService.get(G);return this.preferenceService.set(G,{...Y||{},[`*${O.path.ext}`]:(X=U.componentId)!==null&&X!==void 0?X:U.type},J),(z=this.workbenchEditorService.currentEditorGroup)===null||z===void 0||z.changeOpenType((Q=U.componentId)!==null&&Q!==void 0?Q:U.type),!0}return!1},{items:N,selectIndex:j}=I(O,x);if(N.length===0||typeof j>"u")return!0;k(N)}return!1}})),k(R)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!f.Directory.is(this.fileTreeModelService.contextMenuFile)}),T.registerCommand(o.FILE_COMMANDS.COPY_PATH,{execute:async O=>{if(!O)return;let R=O.path.toString();if(O.scheme===s.DIFF_SCHEME){const k=O.getParsedQuery();R=new o.URI(k.modified).path.toString()}let M=decodeURIComponent(R);await this.appService.backendOS===o.OperatingSystem.Windows&&(M=M.slice(1)),await this.clipboardService.writeText(M)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile}),T.registerCommand(o.FILE_COMMANDS.COPY_RELATIVE_PATH,{execute:async O=>{if(!O)return;if(O.scheme===s.DIFF_SCHEME){const R=O.getParsedQuery();O=new o.URI(R.modified).withScheme("file")}let L;if(this.fileTreeService.isMultipleWorkspace)for(const R of await this.workspaceService.roots){if(L=new o.URI(R.uri),L.isEqual(O))return await this.clipboardService.writeText("./");if(L.isEqualOrParent(O))return await this.clipboardService.writeText(decodeURIComponent(L.relative(O).toString()))}else if(this.workspaceService.workspace)return L=new o.URI(this.workspaceService.workspace.uri),L.isEqual(O)?await this.clipboardService.writeText("./"):await this.clipboardService.writeText(decodeURIComponent(L.relative(O).toString()))},isVisible:()=>!!this.fileTreeModelService.contextMenuFile}),T.registerCommand(o.FILE_COMMANDS.COPY_FILE,{execute:(O,L)=>{if(L&&L.length)this.fileTreeModelService.copyFile(L);else{const R=this.fileTreeModelService.selectedFiles.map(M=>M.uri);R&&R.length&&this.fileTreeModelService.copyFile(R)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)||!!this.fileTreeModelService.focusedFile&&!this.fileTreeModelService.focusedFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),T.registerCommand(o.FILE_COMMANDS.SELECT_CURRENT_NODE,{execute:(O,L)=>{if(L&&L.length)this.fileTreeModelService.selectChildNode(L);else{const R=this.fileTreeModelService.selectedFiles.map(M=>M.uri);R&&R.length&&this.fileTreeModelService.selectChildNode(R)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)||!!this.fileTreeModelService.focusedFile&&!this.fileTreeModelService.focusedFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),T.registerCommand(o.FILE_COMMANDS.CUT_FILE,{execute:(O,L)=>{if(L&&L.length)this.fileTreeModelService.cutFile(L);else{const R=this.fileTreeModelService.selectedFiles.map(M=>M.uri);R&&R.length&&this.fileTreeModelService.cutFile(R)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)||!!this.fileTreeModelService.focusedFile&&!this.fileTreeModelService.focusedFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),T.registerCommand(o.FILE_COMMANDS.PASTE_FILE,{execute:O=>{if(D(),O)this.fileTreeModelService.pasteFile(O);else if(this.fileTreeModelService.focusedFile){let L;this.fileTreeModelService.activeUri?L=this.fileTreeModelService.activeUri:L=this.fileTreeModelService.focusedFile.uri,this.fileTreeModelService.pasteFile(L)}},isEnabled:()=>this.fileTreeModelService.pasteStore&&this.fileTreeModelService.pasteStore.type!==_.PasteTypes.NONE||this.appConfig.isElectronRenderer}),T.registerCommand(o.FILE_COMMANDS.VSCODE_OPEN_FOLDER,{execute:(O,L)=>{const R=this.injector.get(o.IWindowService),M={newWindow:!0};return typeof L=="boolean"?M.newWindow=L:M.newWindow=typeof L?.forceNewWindow=="boolean"?L.forceNewWindow:!0,O?R.openWorkspace(O,M):this.commandService.executeCommand(o.FILE_COMMANDS.OPEN_FOLDER.id,M)},isVisible:()=>{const O=this.preferenceService.get("application.supportsOpenFolder");return O??!1}}),T.registerCommand(o.FILE_COMMANDS.OPEN_FOLDER,{execute:O=>{const L=this.injector.get(o.IWindowService);this.appConfig.isElectronRenderer?this.injector.get(o.IElectronNativeDialogService).showOpenDialog({title:(0,o.localize)("workspace.openDirectory"),properties:["openDirectory"]}).then(M=>{M&&M.length>0&&L.openWorkspace(o.URI.file(M[0]),O||{newWindow:!0})}):this.injector.get(d.IWindowDialogService).showOpenDialog({title:(0,o.localize)("workspace.openDirectory"),canSelectFiles:!1,canSelectFolders:!0}).then(M=>{var k;M&&M.length>0&&this.injector.get(u.IWorkspaceService).open(M[0],{preserveWindow:(k=O?.newWindow)!==null&&k!==void 0?k:!1})})},isVisible:()=>{const O=this.preferenceService.get("application.supportsOpenFolder");return O??!1}}),T.registerCommand(o.FILE_COMMANDS.OPEN_WORKSPACE,{execute:O=>{if(!this.preferenceService.get("application.supportsOpenWorkspace"))return;const R=this.injector.get(o.IWindowService);this.appConfig.isElectronRenderer?this.injector.get(o.IElectronNativeDialogService).showOpenDialog({title:(0,o.localize)("workspace.openWorkspace"),properties:["openFile"],filters:[{name:(0,o.localize)("workspace.openWorkspaceTitle"),extensions:[this.workspaceService.workspaceSuffixName]}]}).then(k=>{k&&k.length>0&&R.openWorkspace(o.URI.file(k[0]),O||{newWindow:!0})}):this.injector.get(d.IWindowDialogService).showOpenDialog({title:(0,o.localize)("workspace.openWorkspace"),canSelectFiles:!0,canSelectFolders:!1,canSelectMany:!1,filters:{workspace:[this.workspaceService.workspaceSuffixName]}}).then(k=>{var B;k&&k.length>0&&this.injector.get(u.IWorkspaceService).open(k[0],{preserveWindow:(B=O?.newWindow)!==null&&B!==void 0?B:!1})})},isVisible:()=>{const O=this.preferenceService.get("application.supportsOpenWorkspace");return O??!1}}),T.registerCommand(o.FILE_COMMANDS.REVEAL_IN_EXPLORER,{execute:O=>{var L;let R=O instanceof o.URI?O:O?.uri;const M=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);M&&!M.isVisible&&M.activate(),M&&M.isCollapsed(_.RESOURCE_VIEW_ID)&&M?.setCollapsed(_.RESOURCE_VIEW_ID,!1),!R&&(!((L=this.workbenchEditorService.currentEditor)===null||L===void 0)&&L.currentUri)&&(R=this.workbenchEditorService.currentEditor.currentUri),R&&this.revealFile(o.URI.parse(R.toString()))}}),T.registerCommand(o.FILE_COMMANDS.FOCUS_FILES,{execute:()=>{const O=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);O&&O.activate()}}),T.registerCommand(o.FILE_COMMANDS.OPEN_FILE,{execute:O=>this.windowDialogService.showOpenDialog(O)}),T.registerCommand(o.FILE_COMMANDS.SAVE_FILE,{execute:O=>this.windowDialogService.showSaveDialog(O)}),T.registerCommand(o.FILE_COMMANDS.FILTER_TOGGLE,{execute:()=>this.fileTreeService.toggleFilterMode()}),T.registerCommand(o.FILE_COMMANDS.FILTER_OPEN,{execute:()=>{if(!this.fileTreeService.filterMode)return this.fileTreeService.toggleFilterMode()}}),T.registerCommand(o.FILE_COMMANDS.FILTER_CLOSE,{execute:()=>{this.fileTreeService.filterMode&&this.fileTreeService.toggleFilterMode()}}),T.registerCommand(o.FILE_COMMANDS.NEXT,{execute:()=>{this.fileTreeModelService.moveToNext()}}),T.registerCommand(o.FILE_COMMANDS.PREV,{execute:()=>{this.fileTreeModelService.moveToPrev()}}),T.registerCommand(o.FILE_COMMANDS.COLLAPSE,{execute:()=>{this.fileTreeModelService.collapseCurrentFile()}}),T.registerCommand(o.FILE_COMMANDS.EXPAND,{execute:()=>{this.fileTreeModelService.expandCurrentFile()}}),T.registerCommand(o.FILE_COMMANDS.TOGGLE_OR_OPEN,{execute:()=>{this.fileTreeModelService.toggleOrOpenCurrentFile()}}),T.registerCommand(o.WORKSPACE_COMMANDS.REMOVE_WORKSPACE_FOLDER,{execute:async(O,L)=>{if(D(),!L.length||!this.workspaceService.isMultiRootWorkspaceOpened)return;const R=await this.workspaceService.roots,M=L.filter(k=>R.find(B=>B.uri===k.toString()));M.length>0&&await this.workspaceService.removeRoots(M)},isVisible:()=>this.workspaceService.isMultiRootWorkspaceOpened&&!!this.fileTreeModelService.contextMenuFile&&!!this.workspaceService.tryGetRoots().find(O=>{var L;return O.uri===((L=this.fileTreeModelService.contextMenuFile)===null||L===void 0?void 0:L.uri.toString())})})}registerKeybindings(T){T.registerKeybinding({command:o.FILE_COMMANDS.COPY_FILE.id,keybinding:"ctrlcmd+c",when:`${l.FilesExplorerFocusedContext.raw} && !${l.FilesExplorerInputFocusedContext.raw} && !${l.FilesExplorerFilteredContext.raw}`}),T.registerKeybinding({command:o.FILE_COMMANDS.PASTE_FILE.id,keybinding:"ctrlcmd+v",when:`${l.FilesExplorerFocusedContext.raw} && !${l.FilesExplorerInputFocusedContext.raw} && !${l.FilesExplorerFilteredContext.raw}`}),T.registerKeybinding({command:o.FILE_COMMANDS.CUT_FILE.id,keybinding:"ctrlcmd+x",when:`${l.FilesExplorerFocusedContext.raw} && !${l.FilesExplorerInputFocusedContext.raw} && !${l.FilesExplorerFilteredContext.raw}`}),T.registerKeybinding({command:o.FILE_COMMANDS.SELECT_CURRENT_NODE.id,keybinding:"ctrlcmd+a",when:`${l.FilesExplorerFocusedContext.raw} && !${l.FilesExplorerInputFocusedContext.raw} && !${l.FilesExplorerFilteredContext.raw}`}),T.registerKeybinding({command:o.FILE_COMMANDS.RENAME_FILE.id,keybinding:"enter",when:`${l.FilesExplorerFocusedContext.raw} && !${l.FilesExplorerInputFocusedContext.raw} && !${l.FilesExplorerFilteredContext.raw}`}),T.registerKeybinding({command:o.FILE_COMMANDS.DELETE_FILE.id,keybinding:"ctrlcmd+backspace",when:`${l.FilesExplorerFocusedContext.raw} && !${l.FilesExplorerInputFocusedContext.raw} && !${l.FilesExplorerFilteredContext.raw}`}),T.registerKeybinding({command:o.FILE_COMMANDS.FILTER_OPEN.id,keybinding:"ctrlcmd+f",when:`${l.FilesExplorerFocusedContext.raw} && !${l.FilesExplorerFilteredContext.raw}`}),T.registerKeybinding({command:o.FILE_COMMANDS.FILTER_CLOSE.id,keybinding:"esc",when:`${l.FilesExplorerFocusedContext.raw} && ${l.FilesExplorerFilteredContext.raw}`}),T.registerKeybinding({command:o.FILE_COMMANDS.NEXT.id,keybinding:"down",when:`${l.FilesExplorerFocusedContext.raw} && !${l.FilesExplorerInputFocusedContext.raw} && !${l.FilesExplorerFilteredContext.raw}`}),T.registerKeybinding({command:o.FILE_COMMANDS.PREV.id,keybinding:"up",when:`${l.FilesExplorerFocusedContext.raw} && !${l.FilesExplorerInputFocusedContext.raw} && !${l.FilesExplorerFilteredContext.raw}`}),T.registerKeybinding({command:o.FILE_COMMANDS.EXPAND.id,keybinding:"right",when:`${l.FilesExplorerFocusedContext.raw} && !${l.FilesExplorerInputFocusedContext.raw} && !${l.FilesExplorerFilteredContext.raw}`}),T.registerKeybinding({command:o.FILE_COMMANDS.COLLAPSE.id,keybinding:"left",when:`${l.FilesExplorerFocusedContext.raw} && !${l.FilesExplorerInputFocusedContext.raw} && !${l.FilesExplorerFilteredContext.raw}`}),T.registerKeybinding({command:o.FILE_COMMANDS.TOGGLE_OR_OPEN.id,keybinding:"space",when:`${l.FilesExplorerFocusedContext.raw} && !${l.FilesExplorerInputFocusedContext.raw} && !${l.FilesExplorerFilteredContext.raw}`})}registerToolbarItems(T){T.registerItem({id:o.FILE_COMMANDS.LOCATION_WITH_EDITOR.id,command:o.FILE_COMMANDS.LOCATION_WITH_EDITOR.id,label:(0,o.localize)("file.location"),viewId:_.RESOURCE_VIEW_ID,when:`view == '${_.RESOURCE_VIEW_ID}' && !config.explorer.autoReveal && !${l.FilesExplorerFilteredContext.raw}`,order:0}),T.registerItem({id:o.FILE_COMMANDS.NEW_FILE.id,command:o.FILE_COMMANDS.NEW_FILE.id,label:(0,o.localize)("file.new"),viewId:_.RESOURCE_VIEW_ID,when:`view == '${_.RESOURCE_VIEW_ID}' && !${l.FilesExplorerFilteredContext.raw}`,order:1}),T.registerItem({id:o.FILE_COMMANDS.NEW_FOLDER.id,command:o.FILE_COMMANDS.NEW_FOLDER.id,label:(0,o.localize)("file.folder.new"),viewId:_.RESOURCE_VIEW_ID,when:`view == '${_.RESOURCE_VIEW_ID}' && !${l.FilesExplorerFilteredContext.raw}`,order:2}),T.registerItem({id:o.FILE_COMMANDS.FILTER_TOGGLE.id,command:o.FILE_COMMANDS.FILTER_TOGGLE.id,label:(0,o.localize)("file.filetree.filter"),viewId:_.RESOURCE_VIEW_ID,toggledWhen:`${l.FilesExplorerFilteredContext.raw}`,order:3}),T.registerItem({id:o.FILE_COMMANDS.REFRESH_ALL.id,command:o.FILE_COMMANDS.REFRESH_ALL.id,label:(0,o.localize)("file.refresh"),viewId:_.RESOURCE_VIEW_ID,when:`view == '${_.RESOURCE_VIEW_ID}' && !${l.FilesExplorerFilteredContext.raw}`,order:4}),T.registerItem({id:o.FILE_COMMANDS.COLLAPSE_ALL.id,command:o.FILE_COMMANDS.COLLAPSE_ALL.id,label:(0,o.localize)("file.collapse"),viewId:_.RESOURCE_VIEW_ID,order:5}),T.registerItem({id:o.WORKSPACE_COMMANDS.ADD_WORKSPACE_FOLDER.id,command:o.WORKSPACE_COMMANDS.ADD_WORKSPACE_FOLDER.id,label:(0,o.localize)("workspace.addFolderToWorkspace"),viewId:_.RESOURCE_VIEW_ID,order:0,group:"file_explore_workspace",when:"config.workspace.supportMultiRootWorkspace"})}doDelete(){const T=this.willDeleteUris.slice();return this.willDeleteUris=[],this.fileTreeModelService.deleteFileByUris(T)}dispose(){this._disposables.dispose()}};t.FileTreeContribution=A,n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],A.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(_.IFileTreeService),n.__metadata("design:type",b.FileTreeService)],A.prototype,"fileTreeService",void 0),n.__decorate([(0,r.Autowired)(c.IMainLayoutService),n.__metadata("design:type",Object)],A.prototype,"mainLayoutService",void 0),n.__decorate([(0,r.Autowired)(E.IProgressService),n.__metadata("design:type",Object)],A.prototype,"progressService",void 0),n.__decorate([(0,r.Autowired)(u.IWorkspaceService),n.__metadata("design:type",Object)],A.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(y.FileTreeModelService),n.__metadata("design:type",y.FileTreeModelService)],A.prototype,"fileTreeModelService",void 0),n.__decorate([(0,r.Autowired)(v.IDecorationsService),n.__metadata("design:type",v.IDecorationsService)],A.prototype,"decorationService",void 0),n.__decorate([(0,r.Autowired)(s.WorkbenchEditorService),n.__metadata("design:type",s.WorkbenchEditorService)],A.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(o.CommandService),n.__metadata("design:type",Object)],A.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(d.IWindowDialogService),n.__metadata("design:type",Object)],A.prototype,"windowDialogService",void 0),n.__decorate([(0,r.Autowired)(o.IClipboardService),n.__metadata("design:type",Object)],A.prototype,"clipboardService",void 0),n.__decorate([(0,r.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],A.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(o.QuickOpenService),n.__metadata("design:type",Object)],A.prototype,"quickOpenService",void 0),n.__decorate([(0,r.Autowired)(c.IViewsRegistry),n.__metadata("design:type",Object)],A.prototype,"viewsRegistry",void 0),n.__decorate([(0,r.Autowired)(o.IApplicationService),n.__metadata("design:type",Object)],A.prototype,"appService",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],A.prototype,"appConfig",void 0),t.FileTreeContribution=A=n.__decorate([(0,p.Domain)(m.MenuContribution,o.CommandContribution,o.KeybindingContribution,o.TabBarToolbarContribution,o.ClientAppContribution,c.MainLayoutContribution)],A)},2812:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeModel=void 0;const r=e(85608),o=e(76003),l=e(97267),m=e(41869),E=e(69959),p=e(93239);let v=n=class extends l.TreeModel{constructor(h){super(),this.flushDispatchChangeDelayer=new m.ThrottledDelayer(n.DEFAULT_FLUSH_DELAY),this.init(h)}init(h){this.root=h,this.root.watcher.on(l.TreeNodeEvent.BranchDidUpdate,this.doDispatchChange.bind(this)),this.decorationService.onDidChange(this.doDispatchChange.bind(this))}doDispatchChange(){this.flushDispatchChangeDelayer.isTriggered()||this.flushDispatchChangeDelayer.cancel(),this.flushDispatchChangeDelayer.trigger(async()=>{this.dispatchChange()})}};t.FileTreeModel=v,v.DEFAULT_FLUSH_DELAY=100,r.__decorate([(0,o.Autowired)(p.FileTreeDecorationService),r.__metadata("design:type",p.FileTreeDecorationService)],v.prototype,"decorationService",void 0),t.FileTreeModel=v=n=r.__decorate([(0,o.Injectable)({multiple:!0}),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[E.Directory])],v)},46377:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FILE_TREE_BADGE_LIMIT=t.FILE_TREE_NODE_HEIGHT=t.FileTreeNode=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),l=e(97267),m=e(41869),E=e(69959),p=n.__importDefault(e(89200)),{Path:v}=m.path,s=({item:h,onClick:c,onDoubleClick:g,onContextMenu:d,dndService:u,itemType:_,decorationService:f,labelService:a,leftPadding:b=8,onTwistierClick:y,decorations:S,defaultLeftPadding:A=8,template:w,hasFolderIcons:T,hasFileIcons:D,hidesExplorerArrows:I,hasPrompt:O,iconService:L})=>{const[R,M]=o.default.useState(-1),k=_===l.TreeNodeType.RenamePrompt,B=_===l.TreeNodeType.NewPrompt,x=k||B,N=!x&&h.name.indexOf(v.separator)>=0,j=(0,m.useDesignStyles)(p.default.expansion_toggle,"expansion_toggle"),K=(0,m.useDesignStyles)(p.default.file_tree_node,"file_tree_node"),U=x?null:f.getDecoration(h.uri,E.Directory.is(h)),X=ye=>{(_===l.TreeNodeType.TreeNode||_===l.TreeNodeType.CompositeTreeNode)&&(N&&M(h.name.split(v.separator).length-1),c(ye,h,_))},z=ye=>{(_===l.TreeNodeType.TreeNode||_===l.TreeNodeType.CompositeTreeNode)&&(N&&M(h.name.split(v.separator).length-1),g(ye,h,_))},Q=ye=>{(_===l.TreeNodeType.TreeNode||_===l.TreeNodeType.CompositeTreeNode)&&(y?y(ye,h,_):c(ye,h,_))},G=o.default.useCallback(ye=>{ye.nativeEvent.which!==0&&(_===l.TreeNodeType.TreeNode||_===l.TreeNodeType.CompositeTreeNode)&&d(ye,h,_)},[d,h]),J=o.default.useCallback(ye=>{const{handleDragStart:_e}=u;(_===l.TreeNodeType.TreeNode||_===l.TreeNodeType.CompositeTreeNode)&&_e(ye,h)},[u,h]),Y=o.default.useCallback(ye=>{const{handleDragLeave:_e}=u;(_===l.TreeNodeType.TreeNode||_===l.TreeNodeType.CompositeTreeNode)&&_e(ye,h)},[u,h]),H=o.default.useCallback(ye=>{const{handleDragEnter:_e}=u;(_===l.TreeNodeType.TreeNode||_===l.TreeNodeType.CompositeTreeNode)&&_e(ye,h)},[u,h]),$=o.default.useCallback(ye=>{const{handleDrop:_e}=u;(_===l.TreeNodeType.TreeNode||_===l.TreeNodeType.CompositeTreeNode)&&_e(ye,h)},[u,h]),Z=o.default.useCallback(ye=>{const{handleDragOver:_e}=u;(_===l.TreeNodeType.TreeNode||_===l.TreeNodeType.CompositeTreeNode)&&_e(ye,h)},[u,h]);let re=_===l.TreeNodeType.CompositeTreeNode,ce;x?B?(re=h.type===l.TreeNodeType.CompositeTreeNode,ce=`${A+(h.parent.depth+1||0)*(b||0)+(re?0:T?I?0:20:0)}px`):(re=h.target.type===l.TreeNodeType.CompositeTreeNode,ce=`${A+(h.target.depth||0)*(b||0)+(re?0:T?I?0:20:0)}px`):ce=`${A+(h.depth||0)*(b||0)+(re?0:T?I?0:20:0)}px`;const ge={color:U?U.color:"",height:t.FILE_TREE_NODE_HEIGHT,lineHeight:`${t.FILE_TREE_NODE_HEIGHT}px`,paddingLeft:ce,opacity:O&&!x?".6":"1"},Ae=(ye,_e)=>{if(S&&S?.classlist.indexOf(p.default.mod_loading)>-1)return o.default.createElement(l.Loading,null);if(x&&ye instanceof l.PromptHandle){let Ce=!1;if(k?Ce=ye.target.type===l.TreeNodeType.CompositeTreeNode:Ce=ye.type===l.TreeNodeType.CompositeTreeNode,Ce)return o.default.createElement("div",{className:(0,r.default)(p.default.file_tree_node_segment,j,(0,m.getIcon)("arrow-right"),{[`${p.default.mod_collapsed}`]:B||!(k&&ye.target.type===l.TreeNodeType.CompositeTreeNode&&ye.target.expanded)})})}else return o.default.createElement("div",{onClick:_e,className:(0,r.default)(p.default.file_tree_node_segment,j,(0,m.getIcon)("arrow-right"),{[`${p.default.mod_collapsed}`]:!ye.expanded})})},te=ye=>{let _e,Ce;x&&ye instanceof l.PromptHandle?ye instanceof l.RenamePromptHandle?(_e=ye.target.uri.resolve(ye.$.value),Ce=E.Directory.is(ye.target)):(_e=ye.parent.uri.resolve(ye.$.value),Ce=ye.type===l.TreeNodeType.CompositeTreeNode):(_e=ye.uri,Ce=ye.filestat.isDirectory);const Ee=a.getIcon(_e,{isDirectory:Ce,isOpenedDirectory:Ce&&ye.expanded});return Ce&&!T||!Ce&&!D?null:o.default.createElement("div",{className:(0,r.default)(p.default.file_icon,Ee,{expanded:Ce&&ye.expanded}),style:{height:t.FILE_TREE_NODE_HEIGHT,lineHeight:`${t.FILE_TREE_NODE_HEIGHT}px`}})},Pe=ye=>{if(w)return o.default.createElement(w,null);if(x&&ye instanceof l.PromptHandle)return o.default.createElement("div",{className:(0,r.default)(p.default.file_tree_node_segment,p.default.file_tree_node_inputbox)},o.default.createElement("div",{className:(0,r.default)("input-box",p.default.file_tree_node_prompt_box)},o.default.createElement(ye.ProxiedInput,{wrapperStyle:{height:t.FILE_TREE_NODE_HEIGHT,padding:"0 5px"}})));if(N){const _e=ye.displayName.split(v.separator),Ce=_e.map((Ee,xe)=>{const Ye=_e.slice(0,xe+1).join(v.separator),Ue=We=>{We.stopPropagation(),M(xe);const Ve=h.parent.uri.resolve(_e.slice(0,xe+1).join(v.separator));c(We,h,_,Ve)},Qe=We=>{We.stopPropagation(),M(xe);const Ve=h.parent.uri.resolve(_e.slice(0,xe+1).join(v.separator));d(We,h,_,Ve)},we=We=>{We.stopPropagation(),We.preventDefault(),R!==xe&&(M(xe),u.handleDragOver(We,h))},le=We=>{We.stopPropagation(),We.preventDefault(),M(-1)},Se=We=>{We.stopPropagation(),R!==xe&&M(xe);const Ve=h.parent.uri.resolve(_e.slice(0,xe+1).join(v.separator));u.handleDragStart(We,h,Ve)},Oe=We=>{const Ve=h.parent.uri.resolve(_e.slice(0,xe+1).join(v.separator));u.handleDrop(We,h,Ve)},Fe=(0,r.default)(R===xe&&p.default.active,p.default.compact_name);return o.default.createElement("span",{key:Ye},o.default.createElement("a",{className:Fe,draggable:!0,onContextMenu:Qe,onDragStart:Se,onDragOver:we,onDragLeave:le,onDrop:Oe,onClick:Ue},Ee),xe!==_e.length-1?o.default.createElement("span",{className:p.default.compact_name_separator},v.separator):null)});return o.default.createElement("div",{className:(0,r.default)(p.default.file_tree_node_segment,p.default.file_tree_node_displayname)},Ce)}return o.default.createElement("div",{className:(0,r.default)(p.default.file_tree_node_segment,p.default.file_tree_node_displayname)},a.getName(ye.uri)||ye.displayName)},Te=()=>o.default.createElement("div",{className:(0,r.default)(p.default.file_tree_node_segment,p.default.file_tree_node_tail)},ie()),ie=()=>U?o.default.createElement("div",{className:p.default.file_tree_node_status},(0,m.transformLabelWithCodicon)(U.badge.slice(),{color:"inherit"},L.fromString.bind(L))):null,se=ye=>{if(I)return null;if(re)return Ae(ye,Q);if(x)return Ae(ye,()=>{})},me=()=>{let ye=h.tooltip;return U&&U.badge&&(ye+=` \u2022 ${U.tooltip}`),ye};return o.default.createElement("div",{key:h.id,onClick:X,onDoubleClick:z,onContextMenu:G,onDragStart:J,onDragOver:Z,onDragEnter:H,onDragLeave:Y,onDrop:$,title:me(),className:(0,r.default)(K,S?S.classlist:null),style:ge,draggable:_===l.TreeNodeType.TreeNode||_===l.TreeNodeType.CompositeTreeNode,"data-id":h.id},o.default.createElement("div",{className:(0,r.default)(p.default.file_tree_node_content)},se(h),te(h),o.default.createElement("div",{className:x?p.default.file_tree_node_prompt_wrap:p.default.file_tree_node_overflow_wrap},Pe(h)),Te()))};t.FileTreeNode=s,t.FILE_TREE_NODE_HEIGHT=22,t.FILE_TREE_BADGE_LIMIT=99},56384:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTree=t.FILE_TREE_FILTER_DELAY=t.FILTER_AREA_HEIGHT=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),l=e(97267),m=e(41869),E=e(68974),p=e(24429),v=e(87420),s=e(6250),h=e(46377),c=n.__importDefault(e(2613)),g=e(97738);t.FILTER_AREA_HEIGHT=30,t.FILE_TREE_FILTER_DELAY=500;const d=(0,l.RecycleTreeFilterDecorator)(l.RecycleTree),u=({viewState:f})=>{const[a,b]=(0,o.useState)(!1),[y,S]=(0,o.useState)(!0),[A,w]=(0,o.useState)(!1),[T,D]=(0,o.useState)(!1),[I,O]=(0,o.useState)(),L=(0,o.useRef)(null),R=(0,o.useRef)(new m.DisposableCollection),{height:M}=f,k=(0,m.useInjectable)(s.IFileTreeService),{iconService:B,locationToCurrentFile:x,filterMode:N,indent:j,baseIndent:K}=k,U=(0,m.useInjectable)(g.FileTreeModelService),[X,z]=(0,o.useState)({indent:j,baseIndent:K}),[Q,G]=(0,o.useState)(N),[J,Y]=(0,o.useState)(B.currentTheme||{hasFolderIcons:!0,hasFileIcons:!0,hidesExplorerArrows:!0}),H=(0,o.useCallback)(Ye=>$(Ye)?!1:Ye.shiftKey,[]),$=(0,o.useCallback)(Ye=>{const{metaKey:Ue,ctrlKey:Qe}=Ye;return m.isOSX&&Ue||Qe},[]),Z=(0,o.useCallback)((Ye,Ue,Qe,we)=>{Ye.stopPropagation();const{handleItemClick:le,handleItemToggleClick:Se,handleItemRangeClick:Oe}=U;if(!Ue)return;const Fe=H(Ye),We=$(Ye);Fe?Oe(Ue,Qe):We?Se(Ue,Qe):le(Ue,Qe,we)},[]),re=(0,o.useCallback)((Ye,Ue,Qe)=>{Ye.stopPropagation();const{handleItemDoubleClick:we}=U;Ue&&we(Ue,Qe)},[]),ce=(0,o.useCallback)((Ye,Ue)=>{Ye.stopPropagation();const{toggleDirectory:Qe}=U;Qe(Ue)},[]);(0,o.useEffect)(()=>{a&&U.onFileTreeModelChange(async Ye=>{S(!0),Ye&&await Ye.ensureReady,O(Ye),S(!1)})},[a]),(0,o.useEffect)(()=>{var Ye,Ue,Qe;const we=new m.CancellationTokenSource;return te(we.token),(Ye=R.current)===null||Ye===void 0||Ye.push(B.onThemeChange(le=>{Y(le)})),(Ue=R.current)===null||Ue===void 0||Ue.push(k.onTreeIndentChange(({indent:le,baseIndent:Se})=>{z({indent:le,baseIndent:Se})})),(Qe=R.current)===null||Qe===void 0||Qe.push(k.onFilterModeChange(le=>{G(le)})),()=>{var le;we.cancel(),(le=R.current)===null||le===void 0||le.dispose()}},[]);const ge=(0,o.useCallback)((Ye,Ue)=>{let Qe;if(Ye&&Ue)for(Qe=Ye.parentNode;Qe;){if(Ue===Qe)return!0;Qe=Qe.parentNode}return!1},[]),Ae=(0,o.useCallback)(Ye=>{ge(Ye.relatedTarget,L.current)||!Ye.relatedTarget||(w(!1),U.handleTreeBlur())},[L.current]);(0,o.useEffect)(()=>{Q||(U.fileTreeHandle&&U.fileTreeHandle.clearFilter(),U.selectedFiles.length===1&&U.location(U.selectedFiles[0].uri))},[Q]),(0,o.useEffect)(()=>{const Ye=new m.DisposableCollection;return I&&(Ye.push(U.onDidFocusedFileChange(Ue=>{Ue?Ue.isEqual((I?.root).uri)?A||w(!A):A&&w(!A):Ue||A&&w(!A)})),Ye.push(U.onDidContextMenuFileChange(Ue=>{Ue?Ue.isEqual((I?.root).uri)?A||w(!A):A&&w(!A):Ue||A&&w(!A)}))),()=>{Ye.dispose()}},[I,A]);const te=(0,o.useCallback)(async Ye=>{var Ue;if(await U.whenReady,!Ye.isCancellationRequested){if(U.treeModel){if(await U.treeModel.ensureReady,O(U.treeModel),Ye.isCancellationRequested)return;L.current&&k.initContextKey(L.current)}S(!1),!((Ue=R.current)===null||Ue===void 0)&&Ue.disposed||b(!0)}},[U,R.current]),Pe=(0,o.useCallback)(Ye=>{U.handleTreeHandler({...Ye,getModel:()=>U.treeModel,hasDirectFocus:()=>L.current===document.activeElement})},[L.current,I]),Te=(0,o.useCallback)(()=>{const{handleItemClick:Ye}=U;Ye()},[]),ie=(0,o.useCallback)(()=>{U.handleDblClick()},[]),se=(0,o.useCallback)(()=>{const{handleTreeFocus:Ye}=U;Ye()},[]),me=(0,o.useCallback)(Ye=>{const{handleContextMenu:Ue}=U;Ue(Ye)},[]),ye=(0,o.useCallback)(Ye=>{Ye.stopPropagation(),Ye.preventDefault()},[]),_e=(0,o.useCallback)(Ye=>{Ye.preventDefault(),D(!0)},[]),Ce=(0,o.useCallback)(()=>{D(!1)},[]),Ee=(0,o.useCallback)(Ye=>{const{handleDrop:Ue}=U.dndService;D(!1),Ue(Ye)},[]),xe=(0,o.useCallback)((Ye,Ue,Qe,we)=>{const{handleContextMenu:le}=U;le(Ye,Ue,we)},[]);return o.default.createElement("div",{className:(0,r.default)(c.default.file_tree,T&&c.default.outer_drag_over,A&&c.default.outer_active),tabIndex:-1,ref:L,onClick:Te,onDoubleClick:ie,onFocus:se,onBlur:Ae,onContextMenu:me,draggable:!0,onDragStart:ye,onDragLeave:Ce,onDragOver:_e,onDrop:Ee},o.default.createElement(_,{isLoading:y,isReady:a,height:M,model:I,iconTheme:J,treeIndent:X,filterMode:Q,locationToCurrentFile:x,onTreeReady:Pe,onContextMenu:xe,onItemClick:Z,onItemDoubleClick:re,onTwistierClick:ce}))};t.FileTree=u;const _=(0,o.memo)(({isReady:f,isLoading:a,height:b,model:y,filterMode:S,treeIndent:A,iconTheme:w,onTreeReady:T,onItemClick:D,onItemDoubleClick:I,onContextMenu:O,onTwistierClick:L})=>{const R=(0,m.useInjectable)(s.IFileTreeService),M=(0,m.useInjectable)(v.IIconService),{decorationService:k,labelService:B,locationToCurrentFile:x}=R,N=(0,m.useInjectable)(g.FileTreeModelService),j=(0,o.useCallback)(K=>o.default.createElement(h.FileTreeNode,{item:K.item,itemType:K.itemType,template:K.template,decorationService:k,labelService:B,iconService:M,dndService:N.dndService,decorations:N.decorations.getDecorations(K.item),onClick:D,onDoubleClick:I,onTwistierClick:L,onContextMenu:O,defaultLeftPadding:A.baseIndent,leftPadding:A.indent,hasPrompt:K.hasPrompt,hasFolderIcons:w.hasFolderIcons,hasFileIcons:w.hasFileIcons,hidesExplorerArrows:w.hidesExplorerArrows}),[y,A,w]);return f?a?o.default.createElement(E.Progress,{loading:!0}):y?o.default.createElement(d,{height:b,itemHeight:h.FILE_TREE_NODE_HEIGHT,onReady:T,model:y,filterEnabled:S,filterAfterClear:x,filterAutoFocus:!0,leaveBottomBlank:!0},j):o.default.createElement(p.WelcomeView,{viewId:s.FILE_EXPLORER_WELCOME_ID}):o.default.createElement(E.Progress,{loading:!0})});_.displayName="FileTreeView"},57781:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeService=void 0;const n=e(85608),r=e(76003),o=e(97267),l=e(41869),m=e(18193),E=e(26542),p=e(42933),v=e(52416),s=e(51500),h=e(6250),c=e(69959),g=e(88014),d=e(93239),{Path:u}=l.path;let _=class extends o.Tree{constructor(){super(...arguments),this._fileServiceWatchers=new Map,this._symbolicFiles=new Map,this._changeEventDispatchQueue=new Set,this._readyToWatch=!1,this._watchRootsQueue=[],this.effectedNodes=[],this.onWorkspaceChangeEmitter=new l.Emitter,this.onTreeIndentChangeEmitter=new l.Emitter,this.onFilterModeChangeEmitter=new l.Emitter,this.onNodeRefreshedEmitter=new l.Emitter,this._filterMode=!1,this._refreshable=!0,this.refreshEffectNode=()=>{const a=this.effectedNodes.slice(0);if(this.effectedNodes=[],a.find(y=>c.Directory.isRoot(y)))this.refresh();else for(const y of a)this.refresh(y)},this.flushEventQueue=async()=>{if(!this._changeEventDispatchQueue||this._changeEventDispatchQueue.size===0)return;const a=Array.from(this._changeEventDispatchQueue),b=this.sortPaths(a);(!this.refreshCancelToken||this.refreshCancelToken.token.isCancellationRequested)&&(this.refreshCancelToken=new l.CancellationTokenSource);const y=(0,l.pSeries)(b.map(S=>async()=>{c.Directory.is(S.node)&&await S.node.refresh(this.refreshCancelToken)}));return this._changeEventDispatchQueue.clear(),await y},this.locationToCurrentFile=()=>{this.commandService.executeCommand(l.FILE_COMMANDS.LOCATION.id)}}get onNodeRefreshed(){return this.onNodeRefreshedEmitter.event}get refreshable(){return this._refreshable}get filterMode(){return this._filterMode}get baseIndent(){return this._baseIndent}get indent(){return this._indent}get onWorkspaceChange(){return this.onWorkspaceChangeEmitter.event}get onTreeIndentChange(){return this.onTreeIndentChangeEmitter.event}get onFilterModeChange(){return this.onFilterModeChangeEmitter.event}get isCompactMode(){return this._isCompactMode}get contextKey(){return this.fileContextKey}async init(){this._roots=await this.workspaceService.roots,await this.preferenceService.ready,this._baseIndent=this.preferenceService.getValid("explorer.fileTree.baseIndent",8),this._indent=this.preferenceService.getValid("explorer.fileTree.indent",8),this._isCompactMode=this.preferenceService.getValid("explorer.compactFolders",!0),this.toDispose.push(this.workspaceService.onWorkspaceChanged(a=>{this._roots=a;const b=new l.URI(a[0].uri),y=new c.Directory(this,void 0,b,b.displayName,a[0],this.fileTreeAPI.getReadableTooltip(b));this.root=y,this.onWorkspaceChangeEmitter.fire(y),this.refresh()})),this.toDispose.push(this.workspaceService.onWorkspaceFileExcludeChanged(()=>{this.refresh()})),this.toDispose.push(l.Disposable.create(()=>{var a;(a=this._root)===null||a===void 0||a.dispose(),this._roots=null})),this.toDispose.push(this.corePreferences.onPreferenceChanged(a=>{a.preferenceName==="explorer.fileTree.baseIndent"?(this._baseIndent=a.newValue||8,this.onTreeIndentChangeEmitter.fire({indent:this.indent,baseIndent:this.baseIndent})):a.preferenceName==="explorer.fileTree.indent"?(this._indent=a.newValue||8,this.onTreeIndentChangeEmitter.fire({indent:this.indent,baseIndent:this.baseIndent})):a.preferenceName==="explorer.compactFolders"&&(this._isCompactMode=a.newValue,this.refresh())}))}initContextKey(a){this.fileContextKey.initScopedContext(a)}startWatchFileEvent(){return this._readyToWatch=!0,Promise.all(this._watchRootsQueue.map(a=>this.watchFilesChange(a)))}async resolveChildren(a){var b,y,S,A;let w=[];if(a){if(c.Directory.isRoot(a)&&this.isMultipleWorkspace){const T=await this.workspaceService.roots;for(const D of T){const I=this.fileTreeAPI.toNode(this,D,a,this.workspaceService.getWorkspaceName(new l.URI(D.uri)));this.watchFilesChange(new l.URI(D.uri)),w=w.concat(I),(I.filestat.isSymbolicLink||I.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(I.filestat.uri,I)}return w}if(a.uri){const T=await this.fileTreeAPI.resolveChildren(this,a.uri.toString(),a,this.isCompactMode&&!c.Directory.isRoot(a));w=T.children,w.forEach(I=>{(I.filestat.isSymbolicLink||I.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(I.filestat.uri,I)});const D=T.filestat;if(D&&this.isCompactMode&&!c.Directory.isRoot(a)){const I=new l.URI(D.uri),O=a.parent;if(a&&O){let L=a.name;if(a.filestat.isSymbolicLink){const R=(y=new l.URI(a.filestat.realUri).relative(I))===null||y===void 0?void 0:y.toString();R&&(L=R,L=[a.uri.displayName].concat(L.split(u.separator)).join(u.separator))}else O.filestat.isSymbolicLink?L=(S=new l.URI(O.filestat.realUri).relative(I))===null||S===void 0?void 0:S.toString():L=(A=O.uri.relative(I))===null||A===void 0?void 0:A.toString();L&&L!==a.name&&a.updateMetaData({name:L,uri:I,tooltip:this.fileTreeAPI.getReadableTooltip(I),fileStat:D})}}return w}}else if(this._roots||(this._roots=await this.workspaceService.roots),this.isMultipleWorkspace){const T=new l.URI((b=this.workspaceService.workspace)===null||b===void 0?void 0:b.uri);let D=T.displayName;D=D.slice(0,D.lastIndexOf("."));const I={...this.workspaceService.workspace,isDirectory:!0},O=new c.Directory(this,void 0,T,D,I,this.fileTreeAPI.getReadableTooltip(T));return this.root=O,[O]}else if(this._roots.length>0)return w=await(await this.fileTreeAPI.resolveChildren(this,this._roots[0])).children,w.forEach(T=>{const D=this.workspaceService.getWorkspaceName(T.uri);D&&D!==T.name&&T.updateMetaData({name:D}),(T.filestat.isSymbolicLink||T.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(T.filestat.uri,T)}),this.watchFilesChange(new l.URI(this._roots[0].uri)),this.root=w[0],w;return[]}async watchFilesChange(a){if(!this._readyToWatch){this._watchRootsQueue.push(a);return}const b=await this.fileServiceClient.watchFileChanges(a);this.toDispose.push(b),this.toDispose.push(b.onFilesChanged(y=>{this.onFilesChanged(y)})),this._fileServiceWatchers.set(a.toString(),b)}updateRefreshable(a){var b;a!==this.refreshable&&(this._refreshable=a,this._refreshable?this.doHandleQueueChange():(b=this.refreshCancelToken)===null||b===void 0||b.cancel())}isContentFile(a){return!!a&&"filestat"in a&&!a.filestat.isDirectory}isFileContentChanged(a){return a.type===p.FileChangeType.UPDATED&&this.isContentFile(this.getNodeByPathOrUri(a.uri))}getAffectedChanges(a){const b=[];for(const y of a)this.isFileContentChanged(y)||b.push(y);return b}isRootAffected(a){return this._roots?a.some(b=>b.type>p.FileChangeType.UPDATED&&this._roots&&this._roots.find(y=>b.uri.indexOf(y.uri)>=0)):!1}async onFilesChanged(a){const b=await this.getAffectedNodes(this.getAffectedChanges(a));return b.length>0?this.effectedNodes=this.effectedNodes.concat(b):!(b.length>0)&&this.isRootAffected(a)&&this.effectedNodes.push(this.root),this.refreshEffectNode()}async getFileTreeNodePathByUri(a){var b,y,S,A,w,T;if(!a)return;let D;if(this.isMultipleWorkspace){if(this._roots||(this._roots=await this.workspaceService.roots),D=(A=this._roots.find(I=>new l.URI(I.uri).isEqualOrParent(a)))===null||A===void 0?void 0:A.uri,D){const I=new l.URI(D);if(I.isEqualOrParent(a))return new u(((w=this.root)===null||w===void 0?void 0:w.path)||"/").join(I.displayName).join(((T=I.relative(a))===null||T===void 0?void 0:T.toString())||"").toString()}}else if(D=(b=this.workspaceService.workspace)===null||b===void 0?void 0:b.uri,D){const I=new l.URI(D);if(I.isEqualOrParent(a))return new u(((y=this.root)===null||y===void 0?void 0:y.path)||"").join(((S=I.relative(a))===null||S===void 0?void 0:S.toString())||"").toString()}}async moveNodeByPath(a,b,y,S,A=o.TreeNodeType.TreeNode){const w=new u(a.path).join(y).toString(),T=new u(b.path).join(S).toString();if(w&&T&&T!==w){const D=a.moveNode(w,T);return D&&c.File.is(D)&&(D.updateMetaData({uri:b.uri.resolve(S),fileStat:{...b.filestat,uri:b.uri.resolve(S).toString(),isDirectory:A!==o.TreeNodeType.TreeNode},tooltip:this.fileTreeAPI.getReadableTooltip(b.uri.resolve(S))}),c.Directory.is(D)&&this.updateChildren(D)),D}}async updateChildren(a){const b=a.children;if(!(!b||b.length===0)){for(const y of b)if(c.File.is(y)){const S=a.uri.resolve(y.uri.displayName);y.updateMetaData({uri:S,fileStat:{...y.filestat,uri:S.toString(),isDirectory:!!c.Directory.is(y)},tooltip:this.fileTreeAPI.getReadableTooltip(S)}),c.Directory.is(y)&&this.updateChildren(y)}}}async addNode(a,b,y){let S,A;const w=u.splitPath(b);if(w.length>1){let D=a.uri;for(const I of w)D=D.resolve(I);!this.isCompactMode||c.Directory.isRoot(a)?A=w[0]:y===o.TreeNodeType.CompositeTreeNode?A=b:A=w.slice(0,w.length-1).join(u.separator)}else A=b;S={uri:a.uri.resolve(A).toString(),isDirectory:y===o.TreeNodeType.CompositeTreeNode||w.length>1,isSymbolicLink:!1,lastModification:new Date().getTime()};const T=await this.fileTreeAPI.toNode(this,S,a,A);return T&&a.addNode(T),T}async deleteAffectedNodeByPath(a,b){var y,S;const A=this.getNodeByPathOrUri(a);A&&A.parent&&(this.isCompactMode&&!b?((y=A.parent.children)===null||y===void 0?void 0:y.length)===2?this.refresh((S=A.parent)===null||S===void 0?void 0:S.parent):this.refresh(A.parent):A.parent.removeNode(A.path))}async deleteAffectedNodes(a,b=[]){const y=[];for(const S of a){const A=this.getNodeByPathOrUri(S);A&&c.File.is(A)&&y.push(A)}for(const S of y)!S?.parent||this._changeEventDispatchQueue.has(S?.parent.path)||await this.deleteAffectedNodeByPath(S.path);return b.filter(S=>S.type!==p.FileChangeType.DELETED)}async getAffectedNodes(a){const b=[];for(const y of a){const S=new l.URI(y.uri),A=this.getNodeByPathOrUri(S.parent);A&&b.push(A)}return b}isFileURI(a){return/^file:\/\//.test(a)}getNodeByPathOrUri(a){var b,y,S,A;let w,T;if(typeof a!="string"?(T=a,a=a.toString()):this.isFileURI(a)?T=new l.URI(a):!this.isFileURI(a)&&typeof a=="string"&&(w=a),this.isFileURI(a)&&T){if(this._symbolicFiles.has(T?.toString()))return this._symbolicFiles.get(T.toString());let D;if(this.isMultipleWorkspace?this._roots&&(D=(y=this._roots.find(I=>new l.URI(I.uri).isEqualOrParent(T)))===null||y===void 0?void 0:y.uri):D=(b=this.workspaceService.workspace)===null||b===void 0?void 0:b.uri,this.root&&D){const I=new l.URI(D);if(I.isEqualOrParent(T)){const O=I.relative(T);O&&(w=new u(this.root.path).join(O.toString()).toString())}}}if(w){const D=(S=this.root)===null||S===void 0?void 0:S.getTreeNodeByPath(w);if(!D){let I;const O=w.split(u.separator);for(;O.length>=1;){O.pop();const L=O.join(u.separator);if(I=(A=this.root)===null||A===void 0?void 0:A.getTreeNodeByPath(L),I)break}if(I&&c.Directory.is(I)){for(const L of I.children||[])if(L.path.includes(w))return L}}return D}}sortComparator(a,b){return a.constructor===b.constructor?a.name.localeCompare(b.name,"en",{numeric:!0}):a.type===o.TreeNodeType.CompositeTreeNode?-1:b.type===o.TreeNodeType.CompositeTreeNode?1:0}get contextMenuContextKeyService(){return this.fileContextKey?this.fileContextKey.service:this.contextKeyService}reWatch(){for(const[a,b]of this._fileServiceWatchers)b.dispose(),this.watchFilesChange(new l.URI(a))}get isMultipleWorkspace(){return!!this.workspaceService.workspace&&!this.workspaceService.workspace.isDirectory}getDisplayName(a){return this.workspaceService.getWorkspaceName(a)}async refresh(a=this.root){if(a)return c.Directory.is(a)||c.File.is(a)&&a.parent&&(a=a.parent),this._changeEventDispatchQueue.add(a.path),this.doHandleQueueChange()}async doHandleQueueChange(){if(this.refreshable)try{await this.flushEventQueue()}catch(a){this.logger.error("flush file change event queue error:",a)}finally{this.onNodeRefreshedEmitter.fire()}}sortPaths(a){const y=a.slice().map(A=>({node:this.getNodeByPathOrUri(A),path:A})).filter(A=>A&&!!A.node);a.length>1&&y.sort((A,w)=>{var T,D;const I=((T=A.node)===null||T===void 0?void 0:T.depth)||0,O=((D=w.node)===null||D===void 0?void 0:D.depth)||0;return I-O});const S=[];for(let A=y.length-1;A>=0;A--){const w=y[A];let T=!1;for(let D=0;D<A;D++){const I=y[D];c.Directory.is(I)&&w.node.path.startsWith(I.node.path)&&(T=!0)}T||S.push(w)}return S}openFile(a){const b=this.preferenceService.get("editor.previewMode");this.commandService.executeCommand(l.EDITOR_COMMANDS.OPEN_RESOURCE.id,a,{disableNavigate:!0,preview:b})}openAndFixedFile(a){this.commandService.executeCommand(l.EDITOR_COMMANDS.OPEN_RESOURCE.id,a,{disableNavigate:!0,preview:!1,focus:!0})}openToTheSide(a){this.commandService.executeCommand(l.EDITOR_COMMANDS.OPEN_RESOURCE.id,a,{disableNavigate:!0,split:4})}compare(a,b){this.commandService.executeCommand(l.EDITOR_COMMANDS.COMPARE.id,{original:a,modified:b})}toggleFilterMode(){var a;this._filterMode=!this.filterMode,this.onFilterModeChangeEmitter.fire(this.filterMode),(a=this.fileContextKey)===null||a===void 0||a.filesExplorerFilteredContext.set(this.filterMode),this.filterMode===!1&&this.commandService.executeCommand(l.FILE_COMMANDS.LOCATION.id)}};t.FileTreeService=_,n.__decorate([(0,r.Autowired)(h.IFileTreeAPI),n.__metadata("design:type",Object)],_.prototype,"fileTreeAPI",void 0),n.__decorate([(0,r.Autowired)(l.CommandService),n.__metadata("design:type",Object)],_.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(l.IContextKeyService),n.__metadata("design:type",Object)],_.prototype,"contextKeyService",void 0),n.__decorate([(0,r.Autowired)(s.IWorkspaceService),n.__metadata("design:type",Object)],_.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(m.CorePreferences),n.__metadata("design:type",Object)],_.prototype,"corePreferences",void 0),n.__decorate([(0,r.Autowired)(l.PreferenceService),n.__metadata("design:type",Object)],_.prototype,"preferenceService",void 0),n.__decorate([(0,r.Autowired)(E.LabelService),n.__metadata("design:type",E.LabelService)],_.prototype,"labelService",void 0),n.__decorate([(0,r.Autowired)(d.FileTreeDecorationService),n.__metadata("design:type",d.FileTreeDecorationService)],_.prototype,"decorationService",void 0),n.__decorate([(0,r.Autowired)(p.IFileServiceClient),n.__metadata("design:type",Object)],_.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(v.IIconService),n.__metadata("design:type",Object)],_.prototype,"iconService",void 0),n.__decorate([(0,r.Autowired)(l.ILogger),n.__metadata("design:type",Object)],_.prototype,"logger",void 0),n.__decorate([(0,r.Autowired)(g.FileContextKey),n.__metadata("design:type",g.FileContextKey)],_.prototype,"fileContextKey",void 0),t.FileTreeService=_=n.__decorate([(0,r.Injectable)()],_)},83709:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeNextModule=void 0;const n=e(85608),r=e(41869),o=e(72665),l=e(41103),m=e(6250),E=e(89508),p=e(40439),v=e(57781),s=e(88808),h=e(93239),c=e(97738),g=e(24861);let d=class extends r.BrowserModule{constructor(){super(...arguments),this.providers=[{token:m.IFileTreeAPI,useClass:s.FileTreeAPI},{token:h.FileTreeDecorationService,useClass:h.FileTreeDecorationService},{token:m.IFileTreeService,useClass:v.FileTreeService},{token:c.FileTreeModelService,useClass:c.FileTreeModelService},{token:o.IWindowDialogService,useClass:E.WindowDialogServiceImpl},p.FileTreeContribution]}};t.FileTreeNextModule=d,t.FileTreeNextModule=d=n.__decorate([(0,r.Domain)(g.name),(0,r.ModuleDependencies)([l.WorkspaceModule])],d)},88808:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeAPI=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(43718),m=e(42933),E=e(72665),p=e(26199),v=e(69959);let s=class{constructor(){this.onDidResolveChildrenEmitter=new l.Emitter,this.onDidResolveChildren=this.onDidResolveChildrenEmitter.event}async resolveChildren(c,g,d,u){var _;let f;if(!this.userhomePath){const a=await this.fileServiceClient.getCurrentUserHome();a&&(this.userhomePath=new l.URI(a.uri))}if(typeof g=="string"?f=await this.fileServiceClient.getFileStat(g):f=await this.fileServiceClient.getFileStat(g.uri),f){if(this.onDidResolveChildrenEmitter.fire(f.uri.toString()),((_=f.children)===null||_===void 0?void 0:_.length)===1&&f.children[0].isDirectory&&u)return await this.resolveChildren(c,f.children[0].uri,d,u);{const a={...f,isInSymbolicDirectory:d?.filestat.isSymbolicLink||d?.filestat.isInSymbolicDirectory};return{children:this.toNodes(c,a,d),filestat:a}}}else return{children:[],filestat:null}}async resolveNodeByPath(c,g,d){const u=await this.fileServiceClient.getFileStat(g);if(u)return this.toNode(c,u,d)}async resolveFileStat(c){return await this.fileServiceClient.getFileStat(c.toString())}toNodes(c,g,d){if(d){if(g.children)return g.children.map(u=>this.toNode(c,u,d))}else return[this.toNode(c,g,d)];return[]}toNode(c,g,d,u){var _;const f=new l.URI(g.uri),a=u||f.displayName;let b;return g.isInSymbolicDirectory=(_=d?.filestat.isSymbolicLink)!==null&&_!==void 0?_:d?.filestat.isInSymbolicDirectory,g.isDirectory?b=new v.Directory(c,d,f,a,g,this.getReadableTooltip(f)):b=new v.File(c,d,f,a,g,this.getReadableTooltip(f)),b}async mvFiles(c,g){const d=[];for(const f of c)if(f.url.isEqualOrParent(g))return;const u=c.sort((f,a)=>f.toString().length-a.toString().length),_=[];for(const f of u)_.length>0&&_.find(a=>a.url.isEqualOrParent(f.url))||_.push(f);if(this.corePreferences["explorer.confirmMove"]){const f=(0,l.localize)("file.confirm.move.ok"),a=(0,l.localize)("file.confirm.move.cancel");if(await this.dialogService.warning((0,l.formatLocalize)("file.confirm.move",`[ ${_.map(y=>y.url.displayName).join(",")} ]`,g.displayName),[a,f])!==f)return}for(const f of _){const a=await this.mv(f.url,g.resolve(f.url.displayName),f.isDirectory);a&&d.push(a)}return d}async mv(c,g,d=!1){try{await this.workspaceEditService.apply({edits:[{newResource:g,oldResource:c,options:{isDirectory:d,overwrite:!0}}]})}catch(u){return u.message}}async createFile(c,g){try{await this.workspaceEditService.apply({edits:[{newResource:c,options:{content:g}}]})}catch(d){return d.message}this.commandService.executeCommand(o.EDITOR_COMMANDS.OPEN_RESOURCE.id,c,{disableNavigate:!0,focus:!0})}async createDirectory(c){try{await this.workspaceEditService.apply({edits:[{newResource:c,options:{isDirectory:!0}}]})}catch(g){return g.message}}async delete(c){try{await this.workspaceEditService.apply({edits:[{oldResource:c,options:{}}]});return}catch(g){return g.message}}async copyFile(c,g){let d=1,u;try{u=await this.fileServiceClient.access(g.toString())}catch(_){return _.message}for(;u;){const _=g.displayName.replace(/\Wcopy\W\d+/,""),f=l.path.extname(_),b=`${l.path.basename(_,f)} copy ${d}${f}`;g=g.parent.resolve(b),d++;try{u=await this.fileServiceClient.access(g.toString())}catch{return}}try{return await this.fileServiceClient.copy(c.toString(),g.toString())}catch(_){return _.message}}getReadableTooltip(c){const g=c.toString(),d=this.userhomePath&&this.userhomePath.toString();return this.userhomePath&&this.userhomePath.isEqualOrParent(c)?decodeURIComponent(g.replace(d,"~")):decodeURIComponent(c.withScheme("").toString())}};t.FileTreeAPI=s,n.__decorate([(0,r.Autowired)(m.IFileServiceClient),n.__metadata("design:type",Object)],s.prototype,"fileServiceClient",void 0),n.__decorate([(0,r.Autowired)(p.IWorkspaceEditService),n.__metadata("design:type",Object)],s.prototype,"workspaceEditService",void 0),n.__decorate([(0,r.Autowired)(l.CommandService),n.__metadata("design:type",Object)],s.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(o.CorePreferences),n.__metadata("design:type",Object)],s.prototype,"corePreferences",void 0),n.__decorate([(0,r.Autowired)(E.IDialogService),n.__metadata("design:type",Object)],s.prototype,"dialogService",void 0),t.FileTreeAPI=s=n.__decorate([(0,r.Injectable)()],s)},93239:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeDecorationService=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(41893),m=e(52416);let E=class{constructor(){this.disposeCollection=new o.DisposableCollection,this.onDidChangeEmitter=new o.Emitter,this.cacheDecorations=new Map,this.disposeCollection.pushAll([this.decorationsService.onDidChangeDecorations(v=>{var s,h,c;const g=(h=(s=v._data)===null||s===void 0?void 0:s._iter)===null||h===void 0?void 0:h._value;if(g){const d=new o.URI(g),u=this.getDecoration(d);this.cacheDecorations.has(g)?((c=this.cacheDecorations.get(g))===null||c===void 0?void 0:c.tooltip)!==u?.tooltip&&this.onDidChangeEmitter.fire():(this.cacheDecorations.set(g,u),this.onDidChangeEmitter.fire())}}),this.themeService.onThemeChange(()=>{this.onDidChangeEmitter.fire()})])}get onDidChange(){return this.onDidChangeEmitter.event}getDecoration(v,s=!1){v instanceof o.URI&&(v=o.Uri.parse(v.toString()));const h=this.decorationsService.getDecoration(v,s);return h?{...h,color:this.themeService.getColor({id:h.color})}:{color:"",tooltip:"",badge:""}}dispose(){this.disposeCollection.dispose()}};t.FileTreeDecorationService=E,n.__decorate([(0,r.Autowired)(l.IDecorationsService),n.__metadata("design:type",l.IDecorationsService)],E.prototype,"decorationsService",void 0),n.__decorate([(0,r.Autowired)(m.IThemeService),n.__metadata("design:type",Object)],E.prototype,"themeService",void 0),t.FileTreeDecorationService=E=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],E)},30577:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DragAndDropService=void 0;const r=e(85608),o=e(76003),l=e(97267),m=e(41869),E=e(53622),p=e(14951),v=e(72665),s=e(51500),h=e(6250),c=e(69959),g=r.__importDefault(e(89200)),d=r.__importDefault(e(2613)),u=e(57781),_=e(97738);let f=n=class extends m.WithEventBus{constructor(b){super(),this.model=b,this.toCancelNodeExpansion=new m.DisposableCollection,this.beingDraggedDec=new l.Decoration(g.default.mod_dragging),this.draggedOverDec=new l.Decoration(g.default.mod_dragover),this.beingDraggedNodes=[],this.dragOverTrigger=new m.ThrottledDelayer(n.MS_TILL_DRAGGED_OVER_EXPANDS),this.handleDragStart=(y,S,A)=>{y.stopPropagation();const w=O=>{this.handleDragEnd(O,S)};y.currentTarget.addEventListener("dragend",w,!1);let T=this.model.selectedFiles,D=!1;for(const O of T)O&&O.id===S.id&&(D=!0);D||(T=[S]),this.beingDraggedNodes=T,this.beingDraggedActiveUri=A;const I=T.find(O=>!c.Directory.is(O));if(I&&y.dataTransfer.setData("uri",I.uri.toString()),y.dataTransfer.setData("beingDraggedNodes",JSON.stringify(this.beingDraggedNodes.map(O=>O.uri.toString()))),I){const O=I;O.uri.scheme==="file"&&y.dataTransfer.setData("DownloadURL",`application/octet-stream:${O.displayName}:data:application/octet-stream;base64,${(0,m.encodeBase64)(m.BinaryBuffer.fromString(O.filestat.uri))}`)}if(T.forEach(O=>{this.beingDraggedDec.addTarget(O,l.TargetMatchMode.Self)}),y.dataTransfer){let O;T.length===1?O=A?A.displayName:typeof S.name=="string"?S.name:"":O=String(T.length);const L=document.createElement("div");L.className=d.default.file_tree_drag_image,L.textContent=O,document.body.appendChild(L),y.dataTransfer.setDragImage(L,-10,-10),setTimeout(()=>document.body.removeChild(L),0)}},this.handleDragEnter=(y,S)=>{y.stopPropagation(),y.preventDefault()},this.handleDragLeave=(y,S)=>{y.preventDefault(),y.stopPropagation(),this.toCancelNodeExpansion.dispose(),this.potentialParent&&(this.draggedOverDec.removeTarget(this.potentialParent),this.model.treeModel.dispatchChange())},this.handleDragOver=(y,S)=>{if(y.preventDefault(),y.stopPropagation(),!this.toCancelNodeExpansion.disposed||this.beingDraggedNodes.indexOf(S)>=0)return;this.draggedOverNode=S;const A=c.Directory.is(S)&&S.expanded?S:S.parent;(this.potentialParent!==A||!this.draggedOverDec.hasTarget(A))&&(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=A,this.draggedOverDec.addTarget(this.potentialParent,l.TargetMatchMode.SelfAndChildren),this.model.treeModel.dispatchChange()),this.potentialParent!==S&&c.Directory.is(S)&&(this.dragOverTrigger.trigger(async()=>{S.expanded?(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=S,this.draggedOverDec.addTarget(this.potentialParent,l.TargetMatchMode.SelfAndChildren)):(await S.setExpanded(!0),this.draggedOverNode===S&&(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=S,this.draggedOverDec.addTarget(this.potentialParent,l.TargetMatchMode.SelfAndChildren))),this.model.treeModel.dispatchChange()}),this.toCancelNodeExpansion.push(m.Disposable.create(()=>{this.dragOverTrigger.isTriggered()||this.dragOverTrigger.cancel()})))},this.handleDrop=async(y,S,A)=>{var w,T;this.eventBus.fire(new E.FileTreeDropEvent({event:y.nativeEvent,targetDir:A?A.codeUri.path:S&&S instanceof c.File?(w=S.parent)===null||w===void 0?void 0:w.uri.codeUri.path:S?S.uri.codeUri.path:new m.URI((T=this.workspaceService.workspace)===null||T===void 0?void 0:T.uri).codeUri.path}));try{y.preventDefault(),y.stopPropagation(),y.dataTransfer.dropEffect="copy";let D;const I=!!this.beingDraggedActiveUri;this.fileTreeService.isCompactMode&&A&&!S?.uri.isEqual(A)?D=null:S?D=c.Directory.is(S)?S:S.parent:D=this.root;let O;if(this.beingDraggedActiveUri){const L=this.fileTreeService.getNodeByPathOrUri(this.beingDraggedActiveUri);O=[new c.Directory(this.fileTreeService,L?.parent,this.beingDraggedActiveUri,this.beingDraggedActiveUri.displayName,{uri:this.beingDraggedActiveUri.toString(),isDirectory:!0,lastModification:new Date().getTime()},this.beingDraggedActiveUri.displayName)]}else if(O=this.beingDraggedNodes,!O||O.length===0)try{const L=JSON.parse(y.dataTransfer.getData("beingDraggedNodes"));L&&L.length!==0&&(O=L.map(R=>this.fileTreeService.getNodeByPathOrUri(new m.URI(R))).filter(Boolean),O.length||(O=await Promise.all(L.map(async R=>{const M=new m.URI(R);let k;const B=await this.filesystem.getFileStat(M.toString());return B?.isDirectory?k=new c.Directory(this.fileTreeService,this.root,M,M.displayName,{uri:M.toString(),isDirectory:!0,lastModification:new Date().getTime()},M.displayName):k=new c.File(this.fileTreeService,this.root,M,M.displayName,{uri:M.toString(),isDirectory:!0,lastModification:new Date().getTime()},M.displayName),k}))))}catch{}if(O.length>0){const L=A||D&&D.uri,R=O.filter(M=>M&&M.parent&&(this.beingDraggedActiveUri?!M.parent.uri.isEqual(L):!0));if(R.length>0){const M=await this.fileTreeAPI.mvFiles(R.map(k=>({url:k.uri,isDirectory:k.filestat.isDirectory})),L);if(M&&M.length>0)M.forEach(k=>{this.messageService.error(k)});else if(M){if(D)if(this.fileTreeService.isCompactMode&&I){for(const k of R)this.fileTreeService.refresh(k.parent);this.fileTreeService.refresh(D)}else for(const k of R){const B=D.uri.resolve(k.name);this.fileTreeService.moveNodeByPath(k.parent,D,k.name,k.name,k.type),k.updateMetaData({name:B.displayName,fileStat:{...k.filestat,uri:B.toString()},uri:B,tooltip:this.fileTreeAPI.getReadableTooltip(B)}),c.Directory.is(k)&&this.fileTreeService.refresh(k)}else if(S){if(this.fileTreeService.isCompactMode&&I)for(const k of R)this.fileTreeService.refresh(k.parent);else for(const k of R)this.fileTreeService.deleteAffectedNodeByPath(k.path);this.fileTreeService.refresh(S.parent)}}else return}}S&&this.beingDraggedDec.removeTarget(S),this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.beingDraggedNodes.forEach(L=>{this.beingDraggedDec.removeTarget(L)}),this.beingDraggedNodes=[],this.beingDraggedActiveUri=void 0,this.potentialParent=null,this.model.treeModel.dispatchChange(),this.toCancelNodeExpansion.disposed||this.toCancelNodeExpansion.dispose()}catch(D){this.logger.error(D)}},this.handleDragEnd=(y,S)=>{this.beingDraggedDec.removeTarget(S),this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.beingDraggedNodes.forEach(A=>{this.beingDraggedDec.removeTarget(A)}),this.beingDraggedNodes=[],this.beingDraggedActiveUri=void 0,this.potentialParent=null,this.model.treeModel.dispatchChange(),this.toCancelNodeExpansion.disposed||this.toCancelNodeExpansion.dispose()},this.model.decorations.addDecoration(this.beingDraggedDec),this.model.decorations.addDecoration(this.draggedOverDec)}get root(){return this.model.treeModel.root}};t.DragAndDropService=f,f.MS_TILL_DRAGGED_OVER_EXPANDS=500,r.__decorate([(0,o.Autowired)(h.IFileTreeAPI),r.__metadata("design:type",Object)],f.prototype,"fileTreeAPI",void 0),r.__decorate([(0,o.Autowired)(m.ILogger),r.__metadata("design:type",Object)],f.prototype,"logger",void 0),r.__decorate([(0,o.Autowired)(v.IMessageService),r.__metadata("design:type",Object)],f.prototype,"messageService",void 0),r.__decorate([(0,o.Autowired)(h.IFileTreeService),r.__metadata("design:type",u.FileTreeService)],f.prototype,"fileTreeService",void 0),r.__decorate([(0,o.Autowired)(p.IFileServiceClient),r.__metadata("design:type",Object)],f.prototype,"filesystem",void 0),r.__decorate([(0,o.Autowired)(s.IWorkspaceService),r.__metadata("design:type",Object)],f.prototype,"workspaceService",void 0),t.DragAndDropService=f=n=r.__decorate([(0,o.Injectable)(),r.__param(0,(0,o.Optional)()),r.__metadata("design:paramtypes",[_.FileTreeModelService])],f)},97738:(P,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.FileTreeModelService=void 0;const r=e(85608),o=e(76003),l=e(97267),m=e(41869),E=e(91830),p=e(93899),v=e(26542),s=e(54414),h=e(14951),c=e(63067),g=e(53576),d=e(72665),u=e(6250),_=e(69959),f=e(2812),a=e(46377),b=r.__importDefault(e(89200)),y=e(57781),S=e(30577),{Path:A,isValidBasename:w}=m.path,{coalesce:T}=m.arrays,{trim:D,rtrim:I}=m.strings;let O=n=class{constructor(){this._isDisposed=!1,this._whenReady=new m.Deferred,this.selectedDecoration=new l.Decoration(b.default.mod_selected),this.focusedDecoration=new l.Decoration(b.default.mod_focused),this.contextMenuDecoration=new l.Decoration(b.default.mod_actived),this.loadingDecoration=new l.Decoration(b.default.mod_loading),this.cutDecoration=new l.Decoration(b.default.mod_cut),this._selectedFiles=[],this.disposableCollection=new m.DisposableCollection,this._isMultiSelected=!1,this.refreshedActionDelayer=new m.ThrottledDelayer(n.DEFAULT_REFRESHED_ACTION_DELAY),this.labelChangedDelayer=new m.ThrottledDelayer(n.DEFAULT_LABEL_CHANGED_DELAY),this.locationThrottler=new m.Throttler,this.onDidFocusedFileChangeEmitter=new m.Emitter,this.onDidContextMenuFileChangeEmitter=new m.Emitter,this.onDidSelectedFileChangeEmitter=new m.Emitter,this.onFileTreeModelChangeEmitter=new m.Emitter,this._initTreeModelReady=!1,this.clearFileSelectedDecoration=()=>{this.selectedDecoration.clearAppliedTarget(),this._selectedFiles=[]},this.activeFileDecoration=(R,M=!0)=>{this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),R&&(this.selectedFiles.length>0&&this.selectedDecoration.clearAppliedTarget(),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.selectedDecoration.addTarget(R),this.focusedDecoration.addTarget(R),this.focusedFile=R,this.selectedFiles=[R],M&&this.treeModel.dispatchChange())},this.selectFileDecoration=(R,M=!0)=>{R!==this.treeModel.root&&(this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),R&&(this.selectedFiles.length>0&&this.selectedDecoration.clearAppliedTarget(),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.selectedDecoration.addTarget(R),this._selectedFiles=[R],M&&this.treeModel.dispatchChange()))},this.activateFileActivedDecoration=R=>{this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),this.focusedFile&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this.contextMenuDecoration.addTarget(R),this.contextMenuFile=R,this.treeModel.dispatchChange()},this.activateFileFocusedDecoration=R=>{this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),this.focusedDecoration.addTarget(R),this.focusedFile=R,this.treeModel.dispatchChange()},this.activeFileFocusedDecoration=(R,M=!1)=>{R!==this.treeModel.root&&(this.focusedFile!==R&&(M?(this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.contextMenuFile=R):this.focusedFile&&(this.contextMenuFile=void 0,this.focusedDecoration.clearAppliedTarget()),R&&(this._selectedFiles.indexOf(R)<0&&(this.selectedDecoration.addTarget(R),this._selectedFiles.push(R),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(k=>k.uri))),this.focusedDecoration.addTarget(R),this.focusedFile=R)),this.treeModel.dispatchChange())},this.toggleFileSelectedDecoration=R=>{const M=this._selectedFiles.indexOf(R);M>-1?(this.focusedFile===R&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this._selectedFiles.splice(M,1),this.selectedDecoration.clearAppliedTarget()):(this._selectedFiles.push(R),this.selectedDecoration.addTarget(R),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.focusedFile=R,this.focusedDecoration.addTarget(R)),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(k=>k.uri)),this.treeModel.dispatchChange()},this.activeFileDecorationByRange=(R,M)=>{for(this.clearFileSelectedDecoration(),this.contextMenuFile=void 0;R<=M;R++){const k=this.treeModel.root.getTreeNodeAtIndex(R);k&&(this._selectedFiles.push(k),this.selectedDecoration.addTarget(k))}this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(k=>k.uri)),this.treeModel.dispatchChange()},this.deactivateFileDecoration=()=>{var R;this.focusedFile&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this.contextMenuFile&&this.contextMenuDecoration.removeTarget(this.contextMenuFile),(R=this.treeModel)===null||R===void 0||R.dispatchChange()},this.toggleDirectory=async R=>{R.expanded?this.fileTreeHandle.collapseNode(R):this.fileTreeHandle.expandNode(R)},this.handleDblClick=()=>{this.commandService.executeCommand(m.FILE_COMMANDS.NEW_FILE.id)},this.handleContextMenu=(R,M,k)=>{var B;R.stopPropagation(),R.preventDefault();let x,N;M?(N=M,this._isMultiSelected?this.selectedFiles.indexOf(N)>=0?x=this.selectedFiles:x=[N]:x=[N]):(x=[this.treeModel.root],N=this.treeModel.root),this.activateFileActivedDecoration(N),this.setFileTreeContextKey(N),this.fileTreeService.isCompactMode&&k?(this._activeUri=k,(B=this.contextKey)===null||B===void 0||B.explorerResourceIsFolder.set(!0)):k||(this._activeUri=null);const j=this.contextMenuService.createMenu({id:p.MenuId.ExplorerContext,contextKeyService:this.fileTreeService.contextMenuContextKeyService}),K=j.getMergedMenuNodes();j.dispose(),this.updateExplorerCompressedContextKey(N,k);const{x:U,y:X}=R.nativeEvent;this.ctxMenuRenderer.show({anchor:{x:U,y:X},menuNodes:K,args:k?[k,[k]]:[N.uri,x.map(z=>z.uri)]})},this.handleTreeBlur=()=>{var R,M,k;this._isDisposed||((M=(R=this.contextKey)===null||R===void 0?void 0:R.filesExplorerFocused)===null||M===void 0||M.set(!1),this.deactivateFileDecoration(),(k=this.contextKey)===null||k===void 0||k.explorerResourceIsFolder.set(!1))},this.handleTreeFocus=()=>{var R,M;(M=(R=this.contextKey)===null||R===void 0?void 0:R.filesExplorerFocused)===null||M===void 0||M.set(!0)},this.handleItemRangeClick=(R,M)=>{if(!this.focusedFile)this.handleItemClick(R,M);else if(this.focusedFile&&this.focusedFile!==R){this._isMultiSelected=!0;const k=this.treeModel.root.getIndexAtTreeNode(R),B=this.treeModel.root.getIndexAtTreeNode(this.focusedFile);B>k?this.activeFileDecorationByRange(k,B):B<k&&this.activeFileDecorationByRange(B,k)}},this.handleItemToggleClick=(R,M)=>{this._isMultiSelected=!0,!(M!==l.TreeNodeType.CompositeTreeNode&&M!==l.TreeNodeType.TreeNode)&&this.toggleFileSelectedDecoration(R)},this.handleItemClick=(R,M=this.fileTreeService.isMultipleWorkspace?l.TreeNodeType.TreeNode:l.TreeNodeType.CompositeTreeNode,k)=>{var B,x,N,j;if(this.treeModel&&(R||(R=this.treeModel.root),this.updateExplorerCompressedContextKey(R,k),this._isMultiSelected=!1,(M===l.TreeNodeType.CompositeTreeNode||M===l.TreeNodeType.TreeNode)&&this.activeFileDecoration(R),this.fileTreeService.isCompactMode&&k?(this._activeUri=k,(B=this.contextKey)===null||B===void 0||B.explorerResourceIsFolder.set(!0)):k||(this._activeUri=null,(x=this.contextKey)===null||x===void 0||x.explorerResourceIsFolder.set(M===l.TreeNodeType.CompositeTreeNode)),this.corePreferences["workbench.list.openMode"]==="singleClick")){if(M===l.TreeNodeType.CompositeTreeNode){if((N=this.contextKey)===null||N===void 0||N.explorerResourceIsFolder.set(!0),R===this.treeModel.root)return;this.toggleDirectory(R)}else if(M===l.TreeNodeType.TreeNode){if((j=this.contextKey)===null||j===void 0||j.explorerResourceIsFolder.set(!1),R===this.treeModel.root)return;this.fileTreeService.openFile(R.uri),this.mainlayoutService.bottomExpanded&&this.commandService.executeCommand(g.RETRACT_BOTTOM_PANEL.id)}}},this.handleItemDoubleClick=(R,M)=>{M===l.TreeNodeType.TreeNode?this.fileTreeService.openAndFixedFile(R.uri):this.corePreferences["workbench.list.openMode"]==="doubleClick"&&this.toggleDirectory(R)},this.validateFileName=(R,M)=>{var k;if(M=this.getWellFormedFileName(M),!M||M.length===0||/^\s+$/.test(M))return{message:(0,m.localize)("validate.tree.emptyFileNameError"),type:l.PROMPT_VALIDATE_TYPE.ERROR,value:M};if(M[0]==="/"||M[0]==="\\")return{message:(0,m.localize)("validate.tree.fileNameStartsWithSlashError"),type:l.PROMPT_VALIDATE_TYPE.ERROR,value:M};if(M[0]===" "||M[M.length-1]===" ")return{message:(0,m.localize)("validate.tree.fileNameFollowOrStartWithSpaceWarning"),type:l.PROMPT_VALIDATE_TYPE.WARNING,value:M};let B;if(R.target){const N=R.target;if(M===N.name)return null;B=N.parent}else B=R.parent;return B&&!(R instanceof l.RenamePromptHandle&&R.target.displayName.indexOf(A.separator)>0)&&((k=B.children)===null||k===void 0?void 0:k.find(K=>K.name===M))?{message:(0,m.formatLocalize)("validate.tree.fileNameExistsError",M),type:l.PROMPT_VALIDATE_TYPE.ERROR,value:M}:T(M.split(/[\\/]/)).some(N=>!w(N))?{message:(0,m.formatLocalize)("validate.tree.invalidFileNameError",this.trimLongName(M)),type:l.PROMPT_VALIDATE_TYPE.ERROR,value:M}:null},this.proxyPrompt=R=>{let M=!1;const k=async z=>{const Q=await this.fileTreeService.getNodeByPathOrUri(z);Q&&(_.Directory.is(Q)?this.selectFileDecoration(Q):this.location(Q.uri))},B=async z=>{var Q,G,J;if(this.validateMessage=void 0,R instanceof l.RenamePromptHandle){const Y=R.target,H=R.target.displayName.split(A.separator),$=Y.name.indexOf(A.separator)>0;if($&&this.activeUri&&!R.target.uri.toString().includes(this.activeUri.toString()))return!1;const Z=this.activeUri?H.length-R.target.uri.toString().replace(this.activeUri.toString(),"").split(A.separator).length:-1,re=Z===-1?[]:H.slice(0,Z).concat(z);let ce=Y.uri,ge=Y.parent.uri.resolve(z);if($&&((Q=this.activeUri)===null||Q===void 0?void 0:Q.displayName)===z||!$&&z===Y.name)return!0;R.addAddonAfter("loading_indicator"),$&&re.length>0&&_.Directory.is(Y.parent)&&(ce=Y.parent.uri.resolve(H.slice(0,Z+1).join(A.separator)),ge=Y.parent.uri.resolve(re.concat().join(A.separator)));const Ae=await this.fileTreeAPI.mv(ce,ge,Y.type===l.TreeNodeType.CompositeTreeNode);if(Ae)return this.validateMessage={type:l.PROMPT_VALIDATE_TYPE.ERROR,message:Ae,value:z},this.fileTreeService.updateRefreshable(!0),R.addValidateMessage(this.validateMessage),!1;if(this.fileTreeService.updateRefreshable(!1),R.removeAddonAfter(),!$&&Y.parent){const te=await this.fileTreeService.moveNodeByPath(Y.parent,Y.parent,Y.name,z,Y.type);te&&this.selectFileDecoration(te,!1),this.fileTreeService.updateRefreshable(!0)}else if(_.Directory.is(Y)&&!_.Directory.isRoot(Y)){Y.updateMetaData({name:re.concat(H.slice(Z+1)).join(A.separator),uri:ge,fileStat:{...Y.filestat,uri:ge.toString()},tooltip:this.fileTreeAPI.getReadableTooltip(ge)}),this.treeModel.dispatchChange();let te;_.Directory.is(Y.parent)&&(!((G=Y.parent.children)===null||G===void 0)&&G.find(Pe=>Y.path.indexOf(Pe.path)>=0))?te=this.fileTreeService.refresh(Y.parent):te=this.fileTreeService.refresh(Y),te.then(()=>{k(ge)})}R.removeAddonAfter()}else if(R instanceof l.NewPromptHandle){const Y=R.parent,H=Y.uri.resolve(z);let $;if(R.addAddonAfter("loading_indicator"),this.fileTreeService.updateRefreshable(!0),R.type===l.TreeNodeType.CompositeTreeNode?$=await this.fileTreeAPI.createDirectory(H):$=await this.fileTreeAPI.createFile(H),R.removeAddonAfter(),$)return this.validateMessage={type:l.PROMPT_VALIDATE_TYPE.ERROR,message:$,value:z},this.fileTreeService.updateRefreshable(!1),R.addValidateMessage(this.validateMessage),!1;if(z.includes(A.separator)&&this.fileTreeService.refresh(Y).then(()=>{k(Y.uri.resolve(z))}),this.fileTreeService.isCompactMode)if(R.type===l.TreeNodeType.CompositeTreeNode)if((!Y.children||Y.children.length===0)&&!_.Directory.isRoot(Y)){const re=Y.uri.resolve(z),ce=[Y.name].concat(z).join(A.separator);Y.updateMetaData({name:ce,uri:re,fileStat:{...Y.filestat,uri:re.toString()},tooltip:this.fileTreeAPI.getReadableTooltip(re)}),k(re)}else await this.fileTreeService.addNode(Y,z,R.type),k(Y.uri.resolve(z));else await this.fileTreeService.addNode(Y,z,R.type),k(Y.uri.resolve(z));else await this.fileTreeService.addNode(Y,z,R.type),k(Y.uri.resolve(z))}return(J=this.contextKey)===null||J===void 0||J.filesExplorerInputFocused.set(!1),!0},x=async z=>{var Q,G,J,Y;if(this.validateMessage&&this.validateMessage.type===l.PROMPT_VALIDATE_TYPE.ERROR)return this.validateMessage=void 0,!0;if(M)return!1;if(!z){(Q=this.contextKey)===null||Q===void 0||Q.explorerCompressedFocusContext.set(!1),(G=this.contextKey)===null||G===void 0||G.explorerCompressedFirstFocusContext.set(!1),(J=this.contextKey)===null||J===void 0||J.explorerCompressedLastFocusContext.set(!1),this.fileTreeService.isCompactMode&&R instanceof l.NewPromptHandle&&this.fileTreeService.refresh(R.parent);return}return(Y=this.contextKey)===null||Y===void 0||Y.filesExplorerInputFocused.set(!1),await B(z),!0},N=async z=>{if(M=!0,this.validateMessage&&this.validateMessage.type===l.PROMPT_VALIDATE_TYPE.ERROR)return!1;if(z.trim()===""||this.validateMessage&&this.validateMessage.type!==l.PROMPT_VALIDATE_TYPE.ERROR)return this.validateMessage=void 0,!0;const Q=await B(z);return M=!1,!!Q},j=async()=>{var z;(z=this.contextKey)===null||z===void 0||z.filesExplorerInputFocused.set(!0)},K=()=>{var z;this.fileTreeService.updateRefreshable(!0),(z=this.contextKey)===null||z===void 0||z.filesExplorerInputFocused.set(!1),this.contextMenuFile&&this.selectFileDecoration(this.contextMenuFile,!0)},U=()=>{var z;(z=this.contextKey)===null||z===void 0||z.filesExplorerInputFocused.set(!1),this.fileTreeService.isCompactMode&&R instanceof l.NewPromptHandle&&this.fileTreeService.refresh(R.parent)},X=z=>{const Q=this.validateFileName(R,z);Q?(this.validateMessage=Q,R.addValidateMessage(Q)):!Q&&this.validateMessage&&this.validateMessage.value!==z&&(this.validateMessage=void 0,R.removeValidateMessage())};R.destroyed||(this.fileTreeService.updateRefreshable(!1),R.onChange(X),R.onCommit(N),R.onBlur(x),R.onFocus(j),R.onDestroy(K),R.onCancel(U))},this.copyFile=async R=>{var M;this.pasteStore&&this.pasteStore.type===u.PasteTypes.CUT&&(this._pasteStore.files.forEach(B=>{B&&this.cutDecoration.removeTarget(B)}),(M=this.contextKey)===null||M===void 0||M.explorerResourceCut.set(!1)),this.treeModel.dispatchChange();const k=[];for(const B of R){const x=this.fileTreeService.getNodeByPathOrUri(B);x&&k.push(x)}this._pasteStore={files:k,type:u.PasteTypes.COPY},this.clipboardService.writeResources(R)},this.pasteFile=async R=>{var M,k;let B=!1,x=this.fileTreeService.getNodeByPathOrUri(R.toString());if(!x)return;let N=this.pasteStore,j=!1;if(!N){const K=await this.clipboardService.readResources();if(!K||!K.length)return;N={files:[],type:u.PasteTypes.COPY,crossFiles:K},j=!0}if(N){if(_.Directory.is(x)||(B=!0,x=x.parent),j){const K=(0,m.localize)("file.confirm.paste.ok"),U=(0,m.localize)("file.confirm.paste.cancel");if(await this.dialogService.warning((0,m.formatLocalize)("file.confirm.paste",`[ ${(M=N.crossFiles)===null||M===void 0?void 0:M.map(z=>z.displayName).join(",")} ]`,_.Directory.isRoot(x)?x.uri.displayName:x.displayName),[U,K])!==K)return}if(N.type===u.PasteTypes.CUT){for(const U of N.files)U&&this.cutDecoration.removeTarget(U),x.expanded||await x.setExpanded(!0);const K=await this.fileTreeAPI.mvFiles(N.crossFiles?N.crossFiles.map(U=>{var X;return{url:U,isDirectory:((X=this.fileTreeService.getNodeByPathOrUri(U))===null||X===void 0?void 0:X.filestat.isDirectory)||!1}}):N.files.map(U=>({url:U.uri,isDirectory:U.filestat.isDirectory})),x.uri);K&&K.length>0&&(K.forEach(U=>{this.messageService.error(U)}),this.fileTreeService.refresh()),(k=this.contextKey)===null||k===void 0||k.explorerResourceCut.set(!1),this.treeModel.dispatchChange(),this._pasteStore={files:[],type:u.PasteTypes.NONE,crossFiles:void 0}}else if(N.type===u.PasteTypes.COPY){const K=N.crossFiles?N.crossFiles:N.files.map(U=>U.uri);for(const U of K){x.uri.isEqual(U)&&!B&&(x=x.parent);const X=x.uri.resolve(U.displayName);x.expanded||await x.setExpanded(!0);const z=await this.fileTreeAPI.copyFile(U,X);if(z)if(z.uri){const Q=new m.URI(z.uri),G=await this.filesystem.getFileStat(U.toString());this.fileTreeService.addNode(x,Q.displayName,G?.isDirectory?l.TreeNodeType.CompositeTreeNode:l.TreeNodeType.TreeNode)}else this.messageService.error(`Error when copy file: ${U.toString()}, ${z}`)}}}},this.cutFile=async R=>{var M;R.length>0&&((M=this.contextKey)===null||M===void 0||M.explorerResourceCut.set(!0)),this._pasteStore&&this._pasteStore.type===u.PasteTypes.CUT&&this._pasteStore.files.forEach(B=>{this.cutDecoration.removeTarget(B)});const k=[];for(const B of R){const x=this.fileTreeService.getNodeByPathOrUri(B);x&&k.push(x)}this._pasteStore={files:k,type:u.PasteTypes.CUT};for(const B of k)B&&this.cutDecoration.addTarget(B);this.treeModel.dispatchChange()},this.location=async R=>{if(await this.whenReady,!this.fileTreeService.filterMode)return this._fileToLocation=R,this.locationThrottler.queue(this.doLocation)},this.doLocation=async()=>{if(!this._fileToLocation)return;const R=this._fileToLocation;let M;if(typeof R=="string"?M=R:M=await this.fileTreeService.getFileTreeNodePathByUri(R),M){if(!this.fileTreeHandle)return;const k=await this.fileTreeHandle.ensureVisible(M,"center",!0);k&&this.selectFileDecoration(k)}this._fileToLocation=void 0},this.locationOnShow=R=>{this._nextLocationTarget=R},this.performLocationOnHandleShow=async()=>{this._nextLocationTarget&&(await this.location(this._nextLocationTarget),this._nextLocationTarget=void 0)}}get onDidFocusedFileChange(){return this.onDidFocusedFileChangeEmitter.event}get onDidContextMenuFileChange(){return this.onDidContextMenuFileChangeEmitter.event}get onDidSelectedFileChange(){return this.onDidSelectedFileChangeEmitter.event}get onFileTreeModelChange(){return this.onFileTreeModelChangeEmitter.event}get fileTreeHandle(){return this._fileTreeHandle}get decorations(){return this._decorations}get treeModel(){return this._treeModel}get dndService(){return this._dndService}get whenReady(){return this._whenReady.promise}get focusedFile(){return this._focusedFile}set focusedFile(R){this.onDidFocusedFileChangeEmitter.fire(R?R.uri:void 0),this._focusedFile=R}get contextMenuFile(){return this._contextMenuFile}set contextMenuFile(R){this.onDidContextMenuFileChangeEmitter.fire(R?R.uri:void 0),this._contextMenuFile=R}get selectedFiles(){return this._selectedFiles}set selectedFiles(R){this.onDidSelectedFileChangeEmitter.fire(R?R.map(M=>M.uri):[]),this._selectedFiles=R}get activeUri(){return this._activeUri}get pasteStore(){return this._pasteStore}get explorerStorage(){return this._explorerStorage}get currentRelativeUriContextKey(){return this._currentRelativeUriContextKey||(this._currentRelativeUriContextKey=this.fileTreeService.contextMenuContextKeyService.createKey("filetreeContextRelativeUri","")),this._currentRelativeUriContextKey}get currentContextUriContextKey(){return this._currentContextUriContextKey||(this._currentContextUriContextKey=this.fileTreeService.contextMenuContextKeyService.createKey("filetreeContextUri","")),this._currentContextUriContextKey}get contextMenuResourceContext(){return this._contextMenuResourceContext||(this._contextMenuResourceContext=new E.ResourceContextKey(this.fileTreeService.contextMenuContextKeyService)),this._contextMenuResourceContext}get contextKey(){return this.fileTreeService.contextKey}get initTreeModelReady(){return this._initTreeModelReady}async initTreeModel(){this._initTreeModelReady=!1;const R=(await this.fileTreeService.resolveChildren())[0];if(!R){this._whenReady.resolve();return}this._treeModel=this.injector.get(f.FileTreeModel,[R]),this.initDecorations(R),this._dndService=this.injector.get(S.DragAndDropService,[this]),this.treeStateWatcher=this._treeModel.getTreeStateWatcher(!0),this.disposableCollection.push(this.fileTreeService.onNodeRefreshed(()=>{this.initTreeModelReady&&(this.refreshedActionDelayer.isTriggered()||this.refreshedActionDelayer.cancel(),this.refreshedActionDelayer.trigger(async()=>{if(this.selectedFiles.length===0){const k=this.editorService.currentEditor;k&&k.currentUri&&this.location(k.currentUri)}this.fileTreeService.isCompactMode||(this._activeUri=null)}))})),this.disposableCollection.push(this.fileTreeService.onWorkspaceChange(()=>{this.disposableCollection.dispose(),this.initTreeModel()})),this.disposableCollection.push(this.labelService.onDidChange(async()=>{this.initTreeModelReady&&(this.labelChangedDelayer.isTriggered()||this.labelChangedDelayer.cancel(),this.labelChangedDelayer.trigger(async()=>{this.fileTreeService.refresh()}))})),this.disposableCollection.push(this.treeModel.root.watcher.on(l.TreeNodeEvent.WillResolveChildren,k=>{this.loadingDecoration.addTarget(k),this.treeModel.dispatchChange()})),this.disposableCollection.push(this.treeModel.root.watcher.on(l.TreeNodeEvent.DidResolveChildren,k=>{this.loadingDecoration.clearAppliedTarget(),this.treeModel.dispatchChange()})),this._explorerStorage=await this.storageProvider(m.STORAGE_NAMESPACE.EXPLORER);const M=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY);M&&await this.loadFileTreeSnapshot(M),this.disposableCollection.push(this.treeStateWatcher.onDidChange(()=>{if(!this._initTreeModelReady)return;const k=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),B=this.treeStateWatcher.snapshot();this.explorerStorage.set(n.FILE_TREE_SNAPSHOT_KEY,{...k,...B})})),this.fileTreeService.startWatchFileEvent(),this.onFileTreeModelChangeEmitter.fire(this._treeModel),this._whenReady.resolve(),this._initTreeModelReady=!0}initDecorations(R){this._decorations=new l.DecorationsManager(R),this._decorations.addDecoration(this.selectedDecoration),this._decorations.addDecoration(this.focusedDecoration),this._decorations.addDecoration(this.contextMenuDecoration),this._decorations.addDecoration(this.cutDecoration),this._decorations.addDecoration(this.loadingDecoration)}setFileTreeContextKey(R){var M;this.currentContextUriContextKey.set(R.uri.toString()),this.currentRelativeUriContextKey.set((this.treeModel.root.uri.relative(R.uri)||"").toString()),this.contextMenuResourceContext.set(R.uri),(M=this.contextKey)===null||M===void 0||M.explorerResourceIsFolder.set(R&&R.type===l.TreeNodeType.CompositeTreeNode)}async loadFileTreeSnapshot(R){await this._treeModel.loadTreeState(R)}updateExplorerCompressedContextKey(R,M){var k,B,x,N,j,K,U,X,z,Q,G,J,Y,H,$,Z;if(R&&M){(k=this.contextKey)===null||k===void 0||k.explorerCompressedFocusContext.set(!0);const re=new A(R.name);re.name===M.displayName?((B=this.contextKey)===null||B===void 0||B.explorerCompressedLastFocusContext.set(!0),(x=this.contextKey)===null||x===void 0||x.explorerCompressedFirstFocusContext.set(!1)):re.root&&re.root.name===M.displayName?((N=this.contextKey)===null||N===void 0||N.explorerCompressedLastFocusContext.set(!1),(j=this.contextKey)===null||j===void 0||j.explorerCompressedFirstFocusContext.set(!0)):((K=this.contextKey)===null||K===void 0||K.explorerCompressedLastFocusContext.set(!1),(U=this.contextKey)===null||U===void 0||U.explorerCompressedFirstFocusContext.set(!1))}else R?R.name.indexOf(A.separator)>0?((X=this.contextKey)===null||X===void 0||X.explorerCompressedFocusContext.set(!0),(z=this.contextKey)===null||z===void 0||z.explorerCompressedFirstFocusContext.set(!1),(Q=this.contextKey)===null||Q===void 0||Q.explorerCompressedLastFocusContext.set(!0)):((G=this.contextKey)===null||G===void 0||G.explorerCompressedFocusContext.set(!1),(J=this.contextKey)===null||J===void 0||J.explorerCompressedFirstFocusContext.set(!1),(Y=this.contextKey)===null||Y===void 0||Y.explorerCompressedLastFocusContext.set(!1)):((H=this.contextKey)===null||H===void 0||H.explorerCompressedFocusContext.set(!1),($=this.contextKey)===null||$===void 0||$.explorerCompressedFirstFocusContext.set(!1),(Z=this.contextKey)===null||Z===void 0||Z.explorerCompressedLastFocusContext.set(!1))}handleTreeHandler(R){this._fileTreeHandle=R}toggleOrOpenCurrentFile(){let R;this.focusedFile?R=this.focusedFile:this.contextMenuFile&&(R=this.contextMenuFile),R&&(this.activeFileDecoration(R),_.Directory.is(R)?this.toggleDirectory(R):this.fileTreeService.openFile(R.uri))}moveToNext(){let R;if(this.focusedFile?R=this.focusedFile:this.contextMenuFile&&(R=this.contextMenuFile),!R)return;const k=this.treeModel.root.getIndexAtTreeNode(R)+1,B=this.treeModel.root.getTreeNodeAtIndex(k),x=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),N=(k+1)*a.FILE_TREE_NODE_HEIGHT-(x.scrollPosition||0),{height:j}=this.fileTreeHandle.getCurrentSize();B&&(this.activateFileFocusedDecoration(B),N>j&&this.fileTreeHandle.ensureVisible(B,"end"))}moveToPrev(){let R;if(this.focusedFile?R=this.focusedFile:this.contextMenuFile&&(R=this.contextMenuFile),!R)return;const M=this.treeModel.root.getIndexAtTreeNode(R);if(M===0)return;const k=M-1,B=this.treeModel.root.getTreeNodeAtIndex(k);if(!B)return;const x=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),N=k*a.FILE_TREE_NODE_HEIGHT;this.activateFileFocusedDecoration(B),(x.scrollPosition||0)>N&&this.fileTreeHandle.ensureVisible(B,"start")}async collapseCurrentFile(){let R;this.focusedFile?(R=this.focusedFile,this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0):this.contextMenuFile&&(R=this.contextMenuFile,this.focusedDecoration.removeTarget(this.contextMenuFile),this.contextMenuFile=void 0);const M=this.selectedFiles.indexOf(R);M>=0&&(this.selectedFiles.splice(M,1),this.selectedDecoration.removeTarget(R));let k;if(_.Directory.is(R)&&R.expanded)k=R;else if(R)_.Directory.isRoot(R.parent)?k=R:k=R.parent;else return;this.focusedFile=k,k&&k.expanded&&(await this.fileTreeHandle.collapseNode(k),this.activeFileFocusedDecoration(k,!0))}async expandCurrentFile(){let R;this.focusedFile?(R=this.focusedFile,this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0):this.contextMenuFile&&(R=this.contextMenuFile,this.focusedDecoration.removeTarget(this.contextMenuFile),this.contextMenuFile=void 0);const M=this.selectedFiles.indexOf(R);M>=0&&(this.selectedFiles.splice(M,1),this.selectedDecoration.removeTarget(R)),this.focusedFile=R,_.Directory.is(R)&&(R.expanded||await this.fileTreeHandle.expandNode(R))}async collapseAll(){await this.treeModel.root.collapsedAll();const R=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY);R&&this.explorerStorage.set(n.FILE_TREE_SNAPSHOT_KEY,{...R,expandedDirectories:{atSurface:[],buried:[]}})}async deleteFileByUris(R){var M;if(R.length===0)return;if(this.corePreferences["explorer.confirmDelete"]){const N=(0,m.localize)("file.confirm.delete.ok"),j=(0,m.localize)("file.confirm.delete.cancel"),K=`[ ${R.slice(0,5).map(X=>X.displayName).join(",")}${R.length>5?" ...":""} ]`;if(await this.dialogService.warning((0,m.formatLocalize)("file.confirm.delete",K),[j,N])!==N)return}const k=this.fileTreeService.sortPaths(R);let B;if(this.treeModel.root.branchSize===R.length)B=void 0;else if(this.selectedFiles.length&&!k.find(N=>N.path.toString()===this.selectedFiles[0].uri.toString()))B=this.selectedFiles[0];else{const N=(M=k[k.length-1])===null||M===void 0?void 0:M.node;if(!N)B=void 0;else{let K=this.treeModel.root.getIndexAtTreeNode(N)+1;if(K>=this.treeModel.root.branchSize){const U=k[0].node;K=this.treeModel.root.getIndexAtTreeNode(U)-1}B=this.treeModel.root.getTreeNodeAtIndex(K)}}const x=[];k.forEach(N=>{this.loadingDecoration.addTarget(N.node),x.push(this.deleteFile(N.node,N.path).then(j=>(this.loadingDecoration.removeTarget(N.node),j)))}),this.treeModel.dispatchChange(),await Promise.all(x),B&&this.activeFileDecoration(B)}async deleteFile(R,M){const k=typeof M=="string"?new m.URI(M):M,B=await this.fileTreeAPI.delete(k);return B?(this.messageService.error(B),!1):((N=>{var j,K,U;N.uri.isEqual(k)?this.fileTreeService.deleteAffectedNodeByPath(N.path):this.fileTreeService.refresh(R.parent),this.loadingDecoration.removeTarget(N),(j=this.contextKey)===null||j===void 0||j.explorerCompressedFocusContext.set(!1),(K=this.contextKey)===null||K===void 0||K.explorerCompressedFirstFocusContext.set(!1),(U=this.contextKey)===null||U===void 0||U.explorerCompressedLastFocusContext.set(!1)})(R),!0)}getWellFormedFileName(R){return R&&(R=D(R," "),R=I(R,"."),R=I(R,"/"),R=I(R,"\\"),R)}trimLongName(R){return R&&R.length>255?`${R.substr(0,255)}...`:R}async getPromptTarget(R,M){let k;if(R.isEqual(this.treeModel.root.uri))k=await this.fileTreeService.getNodeByPathOrUri(R);else if(this.focusedFile)k=this.focusedFile;else if(this.contextMenuFile)k=this.contextMenuFile;else if(this.selectedFiles.length>0){const x=this.selectedFiles[this.selectedFiles.length-1];if(this.treeModel.root.isItemVisibleAtSurface(x))k=x;else{const N=await this.fileTreeService.getFileTreeNodePathByUri(R);k=await this.treeModel.root.loadTreeNodeByPath(N)}}else k=await this.fileTreeService.getNodeByPathOrUri(R);k||(k=this.treeModel.root);const B=A.splitPath(k.name);if(_.Directory.isRoot(k))return k;if(k.name!==R.displayName&&B[B.length-1]!==R.displayName&&M){const x=R.relative(k.uri).toString(),N=k.name.replace(`${A.separator}${x}`,""),j=k.parent.uri.resolve(N),K=x.split(A.separator)[0];if(!N)return;if(k.children)for(const U of k.children)this.fileTreeService.deleteAffectedNodeByPath(U.path,!0);k.updateMetaData({name:N?.toString(),uri:j,tooltip:this.fileTreeAPI.getReadableTooltip(j),fileStat:{...k.filestat,uri:j.toString()}}),this.fileTreeService.addNode(k,K,l.TreeNodeType.CompositeTreeNode)}return k}async newFilePrompt(R){const M=await this.getPromptTarget(R,!0);M&&this.proxyPrompt(await this.fileTreeHandle.promptNewTreeNode(M))}async newDirectoryPrompt(R){const M=await this.getPromptTarget(R,!0);M&&this.proxyPrompt(await this.fileTreeHandle.promptNewCompositeTreeNode(M))}async renamePrompt(R){const M=await this.getPromptTarget(R);M&&this.proxyPrompt(await this.fileTreeHandle.promptRename(M,R.displayName))}selectChildNode(R){var M;for(const k of R){const B=this.fileTreeService.getNodeByPathOrUri(k);if(B){const x=_.Directory.isRoot(B)?B.children:(M=B.parent)===null||M===void 0?void 0:M.children;if(x){const N=x[0],j=x[x.length-1],K=this.treeModel.root.getIndexAtTreeNode(N),U=this.treeModel.root.getIndexAtTreeNode(j);this.activeFileDecorationByRange(K,U)}}}}dispose(){this._isDisposed=!0}};t.FileTreeModelService=O,O.FILE_TREE_SNAPSHOT_KEY="FILE_TREE_SNAPSHOT",O.DEFAULT_REFRESHED_ACTION_DELAY=500,O.DEFAULT_LOCATION_FLUSH_DELAY=200,O.DEFAULT_LABEL_CHANGED_DELAY=500,r.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),r.__metadata("design:type",o.Injector)],O.prototype,"injector",void 0),r.__decorate([(0,o.Autowired)(u.IFileTreeService),r.__metadata("design:type",y.FileTreeService)],O.prototype,"fileTreeService",void 0),r.__decorate([(0,o.Autowired)(m.CorePreferences),r.__metadata("design:type",Object)],O.prototype,"corePreferences",void 0),r.__decorate([(0,o.Autowired)(p.ICtxMenuRenderer),r.__metadata("design:type",p.ICtxMenuRenderer)],O.prototype,"ctxMenuRenderer",void 0),r.__decorate([(0,o.Autowired)(p.AbstractContextMenuService),r.__metadata("design:type",p.AbstractContextMenuService)],O.prototype,"contextMenuService",void 0),r.__decorate([(0,o.Autowired)(u.IFileTreeAPI),r.__metadata("design:type",Object)],O.prototype,"fileTreeAPI",void 0),r.__decorate([(0,o.Autowired)(h.IFileServiceClient),r.__metadata("design:type",Object)],O.prototype,"filesystem",void 0),r.__decorate([(0,o.Autowired)(m.StorageProvider),r.__metadata("design:type",Function)],O.prototype,"storageProvider",void 0),r.__decorate([(0,o.Autowired)(d.IDialogService),r.__metadata("design:type",Object)],O.prototype,"dialogService",void 0),r.__decorate([(0,o.Autowired)(v.LabelService),r.__metadata("design:type",v.LabelService)],O.prototype,"labelService",void 0),r.__decorate([(0,o.Autowired)(d.IMessageService),r.__metadata("design:type",Object)],O.prototype,"messageService",void 0),r.__decorate([(0,o.Autowired)(s.WorkbenchEditorService),r.__metadata("design:type",s.WorkbenchEditorService)],O.prototype,"editorService",void 0),r.__decorate([(0,o.Autowired)(m.CommandService),r.__metadata("design:type",Object)],O.prototype,"commandService",void 0),r.__decorate([(0,o.Autowired)(c.IMainLayoutService),r.__metadata("design:type",Object)],O.prototype,"mainlayoutService",void 0),r.__decorate([(0,o.Autowired)(m.IClipboardService),r.__metadata("design:type",Object)],O.prototype,"clipboardService",void 0),t.FileTreeModelService=O=n=r.__decorate([(0,o.Injectable)()],O)},4446:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SymlinkDecorationsProvider=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(57781);let m=class{constructor(p){this.fileTreeService=p,this.label="symbollink",this.onDidChangeEmitter=new o.Emitter}get onDidChange(){return this.onDidChangeEmitter.event}provideDecorations(p){const v=this.fileTreeService.getNodeByPathOrUri(p.toString());if(v&&v.filestat&&v.filestat.isSymbolicLink)return{letter:"\u2937",source:v.filestat.uri,color:"gitDecoration.ignoredResourceForeground",tooltip:(0,o.localize)("file.tooltip.symbolicLink"),weight:-1,bubble:!v.filestat.isDirectory}}};t.SymlinkDecorationsProvider=m,t.SymlinkDecorationsProvider=m=n.__decorate([n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[l.FileTreeService])],m)},69959:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.File=t.Directory=void 0;const n=e(97267),r=e(41869);class o extends n.CompositeTreeNode{static is(E){return n.CompositeTreeNode.is(E)}constructor(E,p,v=new r.URI(""),s="",h={children:[],isDirectory:!0,uri:"",lastModification:0},c){super(E,p,void 0,{name:s}),this.uri=v,this.filestat=h,this.tooltip=c,p||(this.isExpanded=!0)}get displayName(){return this.name}updateName(E){this.name!==E&&(n.TreeNode.removeTreeNode(this.id,this.path),this.name=E,n.TreeNode.setTreeNode(this.id,this.path,this))}updateURI(E){this.uri=E}updateFileStat(E){this.filestat=E}updateToolTip(E){this.tooltip=E}updateMetaData(E){const{fileStat:p,tooltip:v,name:s,uri:h}=E;s&&this.updateName(s),p&&this.updateFileStat(p),h&&this.updateURI(h),v&&this.updateToolTip(v)}}t.Directory=o;class l extends n.TreeNode{static is(E){return n.TreeNode.is(E)}constructor(E,p,v=new r.URI(""),s="",h={children:[],isDirectory:!1,uri:"",lastModification:0},c){super(E,p,void 0,{name:s}),this.uri=v,this.filestat=h,this.tooltip=c}get displayName(){return this.name}updateName(E){this.name!==E&&(n.TreeNode.removeTreeNode(this.id,this.path),this.name=E,n.TreeNode.setTreeNode(this.id,this.path,this))}updateURI(E){this.uri=E}updateFileStat(E){this.filestat=E}updateToolTip(E){this.tooltip=E}updateMetaData(E){const{fileStat:p,tooltip:v,name:s,uri:h}=E;s&&this.updateName(s),p&&this.updateFileStat(p),h&&this.updateURI(h),v&&this.updateToolTip(v)}}t.File=l},6250:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RESOURCE_VIEW_ID=t.IFileDialogTreeService=t.IFileDialogModel=t.PasteTypes=t.FileStatNode=t.FileTreeExpandedStatusUpdateEvent=t.IFileTreeService=t.IFileTreeAPI=t.FILE_EXPLORER_WELCOME_ID=void 0;const n=e(43718);t.FILE_EXPLORER_WELCOME_ID="file-explorer",t.IFileTreeAPI=Symbol("IFileTreeAPI"),t.IFileTreeService=Symbol("IFileTreeService");class r extends n.BasicEvent{}t.FileTreeExpandedStatusUpdateEvent=r;var o;(function(m){function E(s){return!!s&&"filestat"in s}m.is=E;function p(s){return!!s&&"filestat"in s&&!s.fileStat.isDirectory}m.isContentFile=p;function v(s){if(E(s))return s.filestat.uri}m.getUri=v})(o||(t.FileStatNode=o={}));var l;(function(m){m[m.NONE=0]="NONE",m[m.COPY=1]="COPY",m[m.CUT=2]="CUT"})(l||(t.PasteTypes=l={})),t.IFileDialogModel=Symbol("IFileDialogModel"),t.IFileDialogTreeService=Symbol("IFileDialogTreeService"),t.RESOURCE_VIEW_ID="file-explorer"},87518:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(6250),t),n.__exportStar(e(83709),t)},67240:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.browserViews=void 0,t.browserViews={"sumiContributes.contributes":"Declare all contributions of the OpenSumi Extension.","sumiContributes.common.command":'The command to execute. The command must be declared in "contributes.command" (except built-in commands)',"sumiContributes.common.when":"This condition must be true to display this item","sumiContributes.common.group":"The group this item belongs to","sumiContributes.browserViews":"Provide a custom view to the editor","sumiContributes.browserViews.left":"Provide a view in the left activity bar container","sumiContributes.browserViews.right":"Provide a view in the right activity bar container","sumiContributes.browserViews.bottom":"Provides a view in the bottom tab bar container (no icon will be rendered, so a title is required)","sumiContributes.browserViews.location.custom":'Provide a view to the "{0}" container',"sumiContributes.browserViews.view.id":"View id, browser/index needs to export a component with the same name as this id","sumiContributes.browserViews.view.icon":"Icon name, reference: [icon](https://opensumi.github.io/core/)","sumiContributes.browserViews.view.iconPath":"local icon relative path","sumiContributes.browserViews.view.title":"View title (will be displayed when type is bottom)","sumiContributes.browserViews.view.titleComponentId":"The id of the custom view title component, the characteristics are exactly the same as the normal browserView","sumiContributes.browserViews.view.expanded":"Do you need to expand to full screen, which will cover up the editor area","sumiContributes.browserMain":"Declare the extension browser entry (the path to the compiled code file relative to the extension directory)","sumiContributes.nodeMain":"Declare the extension node entry (the path to the compiled code file relative to the extension directory)","sumiContributes.workerMain":"Declare the extension workser entry (the path to the compiled code file relative to the extension directory)","sumiContributes.viewsProxies":'Declare the component id that needs to be bound to the componentProxy call, which is the same as the export name. For example, after declaring ["component"], the xxxx function of the component component of the browser layer can be called at the node layer through **`context.componentProxy.component.xxxx`**',"sumiContributes.toolbar":"Toolbar is located on the right side of the menu bar at the top of the IDE by default, and can also be displayed as a separate column","sumiContributes.toolbar.actions":"Used to describe the elements on the Toolbar, currently only supports `button` and `select`, we call it action, in some cases it needs to be used with the Toolbar API","sumiContributes.toolbar.actions.id":"unique identifier","sumiContributes.toolbar.actions.weight":"Order weight, the larger the value, the higher the ranking","sumiContributes.toolbar.actions.preferredPosition":`Register the position of this action, if strictPosition exists, this option has no effect
|
|
28421
28421
|
rule:
|
|
28422
28422
|
Note: Each location has two groups _head _tail by default, representing the first and last group
|
|
28423
28423
|
1. If a group value is provided, and the group is not _head and _tail
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opensumi/cli-engine",
|
|
3
|
-
"version": "3.6.5-next-
|
|
3
|
+
"version": "3.6.5-next-1736238377.0",
|
|
4
4
|
"description": "Integration engine runtime for opensumi-cli and opensumi extension",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@koa/cors": "^5.0.0",
|
|
28
28
|
"@opensumi/di": "^1.8.0",
|
|
29
|
-
"@opensumi/ide-core-browser": "3.6.5-next-
|
|
30
|
-
"@opensumi/ide-core-common": "3.6.5-next-
|
|
31
|
-
"@opensumi/ide-core-node": "3.6.5-next-
|
|
32
|
-
"@opensumi/ide-express-file-server": "3.6.5-next-
|
|
33
|
-
"@opensumi/ide-extension": "3.6.5-next-
|
|
34
|
-
"@opensumi/ide-i18n": "3.6.5-next-
|
|
35
|
-
"@opensumi/ide-main-layout": "3.6.5-next-
|
|
36
|
-
"@opensumi/ide-startup": "3.6.5-next-
|
|
29
|
+
"@opensumi/ide-core-browser": "3.6.5-next-1736238377.0",
|
|
30
|
+
"@opensumi/ide-core-common": "3.6.5-next-1736238377.0",
|
|
31
|
+
"@opensumi/ide-core-node": "3.6.5-next-1736238377.0",
|
|
32
|
+
"@opensumi/ide-express-file-server": "3.6.5-next-1736238377.0",
|
|
33
|
+
"@opensumi/ide-extension": "3.6.5-next-1736238377.0",
|
|
34
|
+
"@opensumi/ide-i18n": "3.6.5-next-1736238377.0",
|
|
35
|
+
"@opensumi/ide-main-layout": "3.6.5-next-1736238377.0",
|
|
36
|
+
"@opensumi/ide-startup": "3.6.5-next-1736238377.0",
|
|
37
37
|
"chalk": "^4.1.2",
|
|
38
38
|
"ejs": "^3.1.7",
|
|
39
39
|
"ip": "^1.1.8",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"webpack": "^5.90.0",
|
|
73
73
|
"webpack-cli": "^5.1.4"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "1f5c5e9b33f15a90fda8986accd54639db7d9902"
|
|
76
76
|
}
|