@opensumi/cli-engine 3.6.1-next-1733810441.0 → 3.6.1-next-1733818657.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
|
@@ -28221,7 +28221,7 @@ Tokenizing line: ${R}`);for(let U=0;U<B.tokens.length;U++){const V=B.tokens[U];F
|
|
|
28221
28221
|
|
|
28222
28222
|
`),this}appendMarkdown(u){return this.value+=u,this}appendCodeblock(u,h){return this.value+="\n```",this.value+=u,this.value+=`
|
|
28223
28223
|
`,this.value+=h,this.value+="\n```\n",this}}e.MarkdownString=b;function g(E){return E instanceof b?!0:E&&typeof E=="object"?typeof E.value=="string"&&(typeof E.isTrusted=="boolean"||E.isTrusted===void 0)&&(typeof E.supportThemeIcons=="boolean"||E.supportThemeIcons===void 0):!1}function v(E){const u=[],h=E.split("|").map(r=>r.trim());E=h[0];const c=h[1];if(c){const r=/height=(\d+)/.exec(c),l=/width=(\d+)/.exec(c),a=r?r[1]:"",d=l?l[1]:"",p=isFinite(parseInt(d,10)),m=isFinite(parseInt(a,10));p&&u.push(`width="${d}"`),m&&u.push(`height="${a}"`)}return{href:E,dimensions:u}}},53886:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=t(85608);n.__exportStar(t(84811),e),n.__exportStar(t(38677),e),n.__exportStar(t(32112),e),n.__exportStar(t(58063),e),n.__exportStar(t(3484),e),n.__exportStar(t(84569),e),n.__exportStar(t(92771),e),n.__exportStar(t(87330),e)},32112:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},58063:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},3484:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},92771:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},51418:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},73294:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},50288:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},37846:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.knownProtocols=void 0;const n=t(11431),s=t(46147);e.knownProtocols=new Map,e.knownProtocols.set(s.ExtHostAPIIdentifier.ExtHostDocuments,n.ExtensionDocumentProtocol)},35250:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ObjectIdentifier=void 0;var t;(function(n){n.name="$ident";function s(f,b){return Object.defineProperty(f,n.name,{value:b,enumerable:!0}),f}n.mixin=s;function o(f){return f[n.name]}n.of=o})(t||(e.ObjectIdentifier=t={}))},16363:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},70858:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isLittleEndian=b,e.encodeSemanticTokensDto=g,e.decodeSemanticTokensDto=E;function t(u){for(let h=0,c=u.length;h<c;h+=4){const r=u[h+0],l=u[h+1],a=u[h+2],d=u[h+3];u[h+0]=d,u[h+1]=a,u[h+2]=l,u[h+3]=r}}function n(u){const h=new Uint8Array(u.buffer,u.byteOffset,u.length*4);return b()||t(h),h}function s(u){const h=u;if(b()||t(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,f=!1;function b(){if(!f){f=!0;const u=new Uint8Array(2);u[0]=1,u[1]=2,o=new Uint16Array(u.buffer)[0]===513}return o}function g(u){const h=new Uint32Array(v(u));let c=0;if(h[c++]=u.id,u.type==="full")h[c++]=1,h[c++]=u.data.length,h.set(u.data,c),c+=u.data.length;else{h[c++]=2,h[c++]=u.deltas.length;for(const r of u.deltas)h[c++]=r.start,h[c++]=r.deleteCount,r.data?(h[c++]=r.data.length,h.set(r.data,c),c+=r.data.length):h[c++]=0}return n(h)}function v(u){let h=0;if(h+=2,u.type==="full")h+=1+u.data.length;else{h+=1,h+=3*u.deltas.length;for(const c of u.deltas)c.data&&(h+=c.data.length)}return h}function E(u){const h=s(u);let c=0;const r=h[c++];if(h[c++]===1){const p=h[c++],m=h.subarray(c,c+p);return c+=p,{id:r,type:"full",data:m}}const a=h[c++],d=[];for(let p=0;p<a;p++){const m=h[c++],_=h[c++],y=h[c++];let S;y>0&&(S=h.subarray(c,c+y),c+=y),d[p]={start:m,deleteCount:_,data:S}}return{id:r,type:"delta",deltas:d}}},29490:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},89225:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.startsWith=t,e.endsWith=n,e.isLowerAsciiLetter=s,e.isUpperAsciiLetter=o,e.equalsIgnoreCase=b,e.escapeRegExpCharacters=v,e.startsWithIgnoreCase=E;function t(u,h){if(u.length<h.length)return!1;if(u===h)return!0;for(let c=0;c<h.length;c++)if(u[c]!==h[c])return!1;return!0}function n(u,h){const c=u.length-h.length;return c>0?u.indexOf(h,c)===c:c===0?u===h:!1}function s(u){return u>=97&&u<=122}function o(u){return u>=65&&u<=90}function f(u){return s(u)||o(u)}function b(u,h){const c=u?u.length:0,r=h?h.length:0;return c!==r?!1:g(u,h)}function g(u,h,c=u.length){if(typeof u!="string"||typeof h!="string")return!1;for(let r=0;r<c;r++){const l=u.charCodeAt(r),a=h.charCodeAt(r);if(l!==a){if(f(l)&&f(a)){const d=Math.abs(l-a);if(d!==0&&d!==32)return!1}else if(String.fromCharCode(l).toLowerCase()!==String.fromCharCode(a).toLowerCase())return!1}}return!0}function v(u){return u.replace(/[-\\{}*+?|^$.[\]()#]/g,"\\$&")}function E(u,h){const c=h.length;return h.length>u.length?!1:g(u,h,c)}},54741:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TaskFilterDTO=void 0;var t;(function(n){function s(f){return f}n.from=s;function o(f){if(f)return Object.assign(Object.create(null),f)}n.to=o})(t||(e.TaskFilterDTO=t={}))},25535:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},54056:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TestItemRootImpl=e.TestItemImpl=e.MixedTestItemController=e.InvalidTestItemError=e.DuplicateTestItemError=e.diffTestItems=e.getPrivateApiFor=e.createPrivateApiFor=void 0;const t=new WeakMap,n=(d,p)=>{const m={controllerId:p};return t.set(d,m),m};e.createPrivateApiFor=n;const s=d=>t.get(d);e.getPrivateApiFor=s;const o=(d,p,m,_)=>{let y=m;return{enumerable:!0,configurable:!1,get(){return y},set(S){var A;if(!_(y,S)){const T=y;y=S,(A=d.listener)===null||A===void 0||A.call(d,{op:3,key:p,value:S,previous:T})}}}},f=(d,p)=>d===p,b={range:(d,p)=>d===p?!0:!d||!p?!1:d.isEqual(p),label:f,description:f,sortText:f,busy:f,error:f,canResolveChildren:f,tags:(d,p)=>!(d.length!==p.length||d.some(m=>!p.find(_=>m.id===_.id)))},g=Object.keys(b),v=(d,p)=>({range:o(d,"range",void 0,b.range),label:o(d,"label",p,b.label),description:o(d,"description",void 0,b.description),sortText:o(d,"sortText",void 0,b.sortText),canResolveChildren:o(d,"canResolveChildren",!1,b.canResolveChildren),busy:o(d,"busy",!1,b.busy),error:o(d,"error",void 0,b.error),tags:o(d,"tags",[],b.tags)}),E=(d,p)=>{const m=new Map;for(const _ of g){const y=b[_];y(d[_],p[_])||m.set(_,p[_])}return m};e.diffTestItems=E;class u extends Error{constructor(p){super(`Attempted to insert a duplicate test item ID ${p}`)}}e.DuplicateTestItemError=u;class h extends Error{constructor(p){super(`TestItem with ID "${p}" is invalid. Make sure to create it from the createTestItem method.`)}}e.InvalidTestItemError=h;class c extends Error{constructor(p,m,_){super(`TestItem with ID "${p}" is from controller "${m}" and cannot be added as a child of an item from controller "${_}".`)}}e.MixedTestItemController=c;const r=d=>{const p=(0,e.getPrivateApiFor)(d);let m=new Map;return{get size(){return m.size},forEach(_,y){for(const S of m.values())_.call(y,S,this)},replace(_){var y;const S=new Map,A=new Set(m.keys()),T={op:4,ops:[]};for(const D of _){if(!(D instanceof l))throw new h(D.id);const w=(0,e.getPrivateApiFor)(D).controllerId;if(w!==p.controllerId)throw new c(D.id,w,p.controllerId);if(S.has(D.id))throw new u(D.id);S.set(D.id,D),A.delete(D.id),T.ops.push({op:0,item:D})}for(const D of A.keys())T.ops.push({op:1,id:D});(y=p.listener)===null||y===void 0||y.call(p,T),m=S},add(_){var y;if(!(_ instanceof l))throw new h(_.id);m.set(_.id,_),(y=p.listener)===null||y===void 0||y.call(p,{op:0,item:_})},delete(_){var y;m.delete(_)&&((y=p.listener)===null||y===void 0||y.call(p,{op:1,id:_}))},get(_){return m.get(_)},toJSON(){return Array.from(m.values())},[Symbol.iterator](){return m.values()}}};class l{constructor(p,m,_,y){if(m.includes("\0"))throw new Error(`Test IDs may not include the ${JSON.stringify(m)} symbol`);const S=(0,e.createPrivateApiFor)(this,p);Object.defineProperties(this,{id:{value:m,enumerable:!0,writable:!1},uri:{value:y,enumerable:!0,writable:!1},parent:{enumerable:!1,get(){return S.parent instanceof a?void 0:S.parent}},children:{value:r(this),enumerable:!0,writable:!1},...v(S,_)})}invalidateResults(){var p,m;(m=(p=(0,e.getPrivateApiFor)(this)).listener)===null||m===void 0||m.call(p,{op:2})}}e.TestItemImpl=l;class a extends l{constructor(p,m){super(p,p,m,void 0)}}e.TestItemRootImpl=a},82086:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4809:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},86162:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TreeviewsService=e.ITreeViewsService=e.TreeViewSelection=e.TreeViewItem=void 0;class t{}e.TreeViewItem=t;var n;(function(o){function f(b){return!!b&&typeof b=="object"&&"treeViewId"in b&&"treeItemId"in b}o.is=f})(n||(e.TreeViewSelection=n={})),e.ITreeViewsService=Symbol("ITreeViewsService");class s{constructor(){this._dragOperations=new Map,this._renderedElements=new Map}removeDragOperationTransfer(f){if(f&&this._dragOperations.has(f)){const b=this._dragOperations.get(f);return this._dragOperations.delete(f),b}}addDragOperationTransfer(f,b){this._dragOperations.set(f,b)}getRenderedTreeElement(f){if(this._renderedElements.has(f))return this._renderedElements.get(f)}addRenderedTreeItemElement(f,b){this._renderedElements.set(f,b)}removeRenderedTreeItemElement(f){this._renderedElements.has(f)&&this._renderedElements.delete(f)}}e.TreeviewsService=s},64945:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},43710:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isObject=o,e.mixin=f,e.illegalArgument=b,e.isLocationArray=g,e.isDefinitionLinkArray=v,e.reviveRegExp=E,e.reviveIndentationRule=u,e.reviveOnEnterRule=h,e.reviveOnEnterRules=c,e.serializeEnterRules=r,e.serializeRegExp=l,e.serializeIndentation=a,e.serializeAutoClosingPairs=d;const s=t(85608).__importStar(t(51328));function o(p){return typeof p=="object"&&p!==null&&!Array.isArray(p)&&!(p instanceof RegExp)&&!(p instanceof Date)}function f(p,m,_=!0){return o(p)?(o(m)&&Object.keys(m).forEach(y=>{y in p?_&&(o(p[y])&&o(m[y])?f(p[y],m[y],_):p[y]=m[y]):p[y]=m[y]}),p):m}function b(p){return p?new Error(`Illegal argument: ${p}`):new Error("Illegal argument")}function g(p){return Array.isArray(p)&&p.length>0&&p[0]instanceof s.Location}function v(p){return Array.isArray(p)&&p.length>0&&p[0].hasOwnProperty("targetUri")&&p[0].hasOwnProperty("targetRange")}function E(p){if(!(typeof p>"u"||p===null))return new RegExp(p.pattern,p.flags)}function u(p){if(!(typeof p>"u"||p===null))return{increaseIndentPattern:E(p.increaseIndentPattern),decreaseIndentPattern:E(p.decreaseIndentPattern),indentNextLinePattern:E(p.indentNextLinePattern),unIndentedLinePattern:E(p.unIndentedLinePattern)}}function h(p){return{beforeText:E(p.beforeText),afterText:E(p.afterText),action:p.action,previousLineText:E(p.previousLineText)}}function c(p){if(!(typeof p>"u"||p===null))return p.map(h)}function r(p){if(!(typeof p>"u"||p===null))return p.map(m=>({action:m.action,beforeText:l(m.beforeText),afterText:l(m.afterText),previousLineText:l(m.previousLineText)}))}function l(p){if(!(typeof p>"u"||p===null))return{pattern:p.source,flags:(p.global?"g":"")+(p.ignoreCase?"i":"")+(p.multiline?"m":"")}}function a(p){if(!(typeof p>"u"||p===null))return{increaseIndentPattern:l(p.increaseIndentPattern),decreaseIndentPattern:l(p.decreaseIndentPattern),indentNextLinePattern:l(p.indentNextLinePattern),unIndentedLinePattern:l(p.unIndentedLinePattern)}}function d(p){if(p)return p.map(m=>({open:m.open,close:m.close,notIn:m.notIn?m.notIn.map(_=>s.SyntaxTokenType.toString(_)):void 0}))}},96833:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},98116:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebviewViewResolverRegistrationRemovalEvent=e.WebviewViewResolverRegistrationEvent=void 0;const n=t(43718);class s extends n.BasicEvent{}e.WebviewViewResolverRegistrationEvent=s;class o extends n.BasicEvent{}e.WebviewViewResolverRegistrationRemovalEvent=o},55467:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},92622:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationTarget=void 0,e.reviveWorkspaceEditDto=o;const n=t(43718);var s;(function(f){f[f.Global=1]="Global",f[f.Workspace=2]="Workspace",f[f.WorkspaceFolder=3]="WorkspaceFolder"})(s||(e.ConfigurationTarget=s={}));function o(f){if(f&&f.edits)for(const b of f.edits)if(typeof b.resource=="object")b.resource=n.URI.from(b.resource),b.options={openDirtyInEditor:!0},b.textEdit=b.textEdit,b.versionId=b.versionId;else{const g=b;g.newResource=b.newResource?n.URI.from(b.newResource):void 0,g.oldResource=b.oldResource?n.URI.from(b.oldResource):void 0,g.options={...g.options,showInEditor:!1}}return f}},57646:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BinaryEditorComponent=void 0;const s=t(85608).__importDefault(t(14041)),o=t(76003),f=t(41869),b=t(37406),g=t(57517),v=t(88819),E=u=>{const h=u.resource.uri.codeUri.fsPath,c=(0,f.useInjectable)(o.INJECTOR_TOKEN),r=(0,f.useInjectable)(f.AppConfig),l=(0,f.useInjectable)(g.WorkbenchEditorService),a=(0,f.useInjectable)(f.IEventBus),d=()=>{const m=l.currentResource;m&&(m.metadata={...m.metadata,skipPreventBinary:!0},a.fire(new g.ResourceOpenTypeChangedEvent(m.uri)))},p=[{label:(0,f.localize)("editor.file.prevent.stillOpen"),onClick:()=>d()}];return r.isElectronRenderer&&p.push({label:(0,f.localize)("editor.openExternal"),onClick:()=>c.get(b.IElectronMainUIService).openPath(h)}),s.default.createElement(v.PreventComponent,{description:(0,f.localize)("editor.cannotOpenBinary"),actions:p})};e.BinaryEditorComponent=E},60387:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WalkThroughSnippetSchemeDocumentProvider=e.VscodeSchemeDocumentProvider=e.FileSchemeDocumentProvider=void 0;const n=t(85608),s=t(76003),o=t(41869),f=t(96405),b=t(68692),g=t(14951),v=t(80449);let E=class extends b.BaseFileSystemEditorDocumentProvider{handlesUri(r){return r.scheme===o.Schemes.file?20:-1}handlesScheme(){return!1}provideEncoding(r){return super.provideEncoding(r)}preferLanguageForUri(r){if(["settings.json"].includes(r.path.base))return"jsonc"}async saveDocumentModel(r,l,a,d,p,m=!1,_=`
|
|
28224
|
-
`,y){const S=this.hashCalculateService.calculate(a);return l.length>v.FILE_SAVE_BY_CHANGE_THRESHOLD?await this.fileSchemeDocClient.saveByChange(r.toString(),{baseMd5:S,changes:d,eol:_},p,m,y):await this.fileSchemeDocClient.saveByContent(r.toString(),{baseMd5:S,content:l},p,m,y)}async provideEditorDocumentModelContentMd5(r,l){return this.fileSchemeDocClient.getMd5(r.toString(),l)}};e.FileSchemeDocumentProvider=E,n.__decorate([(0,s.Autowired)(g.IFileServiceClient),n.__metadata("design:type",Object)],E.prototype,"fileServiceClient",void 0),n.__decorate([(0,s.Autowired)(v.IFileSchemeDocClient),n.__metadata("design:type",Object)],E.prototype,"fileSchemeDocClient",void 0),n.__decorate([(0,s.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],E.prototype,"preferenceService",void 0),n.__decorate([(0,s.Autowired)(f.IHashCalculateService),n.__metadata("design:type",Object)],E.prototype,"hashCalculateService",void 0),e.FileSchemeDocumentProvider=E=n.__decorate([(0,s.Injectable)()],E);let u=class{constructor(){this._onDidChangeContent=new o.Emitter,this.onDidChangeContent=this._onDidChangeContent.event,this.listeners={}}isReadonly(r){return!0}handlesScheme(r){return r==="vscode"}async provideEditorDocumentModelContent(r,l){return this.getSchemaContent(r)}getSchemaContent(r){const l=r.toString(),a=this.jsonRegistry.getSchemaContributions().schemas[l];if(a){const d=JSON.stringify(a);if(!this.listeners[l]){const p=o.Disposable.create(()=>{this.jsonRegistry.onDidChangeSchema(m=>{m===l&&this._onDidChangeContent.fire(r)})});this.listeners[l]=p}return d}return"{}"}onDidDisposeModel(r){r.toString()&&(this.listeners[r.toString()].dispose(),delete this.listeners[r.toString()])}};e.VscodeSchemeDocumentProvider=u,n.__decorate([(0,s.Autowired)(o.ISchemaStore),n.__metadata("design:type",Object)],u.prototype,"schemaStore",void 0),n.__decorate([(0,s.Autowired)(o.IJSONSchemaRegistry),n.__metadata("design:type",Object)],u.prototype,"jsonRegistry",void 0),e.VscodeSchemeDocumentProvider=u=n.__decorate([(0,s.Injectable)()],u);let h=class{constructor(){this.documentContentMaps=new Map,this._onDidChangeContent=new o.Emitter,this.onDidChangeContent=this._onDidChangeContent.event}handlesScheme(r){return r===o.Schemes.walkThroughSnippet}provideEditorDocumentModelContent(r,l){return this.documentContentMaps.has(r.toString())||this.documentContentMaps.set(r.toString(),""),this.documentContentMaps.get(r.toString())}isReadonly(){return!1}preferLanguageForUri(){return"plaintext"}};e.WalkThroughSnippetSchemeDocumentProvider=h,e.WalkThroughSnippetSchemeDocumentProvider=h=n.__decorate([(0,s.Injectable)()],h)},41352:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileSchemeDocClientService=void 0;const n=t(85608),s=t(76003),o=t(80449);let f=class{saveByChange(g,v,E,u,h){return this.fileDocBackendService.$saveByChange(g,v,E,u,h)}saveByContent(g,v,E,u,h){return this.fileDocBackendService.$saveByContent(g,v,E,u,h)}getMd5(g,v){return this.fileDocBackendService.$getMd5(g,v)}};e.FileSchemeDocClientService=f,n.__decorate([(0,s.Autowired)(o.FileSchemeDocNodeServicePath),n.__metadata("design:type",Object)],f.prototype,"fileDocBackendService",void 0),e.FileSchemeDocClientService=f=n.__decorate([(0,s.Injectable)()],f)},17276:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileSystemEditorComponentContribution=e.FileSystemEditorResourceContribution=void 0;const n=t(85608),s=t(76003),o=t(41869),f=t(26542),b=t(57517),g=t(17878),v=t(42933),E=t(57646),u=t(60387),h=t(88819),c=t(99025),r="video-preview",l="image-preview",a="external-file",d="large-file-prevent";let p=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)}};e.FileSystemEditorResourceContribution=p,n.__decorate([(0,s.Autowired)(),n.__metadata("design:type",u.FileSchemeDocumentProvider)],p.prototype,"fileSchemeDocumentProvider",void 0),n.__decorate([(0,s.Autowired)(),n.__metadata("design:type",u.VscodeSchemeDocumentProvider)],p.prototype,"vscodeSchemeDocumentProvider",void 0),n.__decorate([(0,s.Autowired)(),n.__metadata("design:type",u.WalkThroughSnippetSchemeDocumentProvider)],p.prototype,"walkThroughSnippetSchemeDocumentProvider",void 0),n.__decorate([(0,s.Autowired)(),n.__metadata("design:type",g.UntitledSchemeResourceProvider)],p.prototype,"untitledResourceProvider",void 0),n.__decorate([(0,s.Autowired)(),n.__metadata("design:type",g.UntitledSchemeDocumentProvider)],p.prototype,"untitledSchemeDocumentProvider",void 0),e.FileSystemEditorResourceContribution=p=n.__decorate([(0,o.Domain)(b.BrowserEditorContribution)],p);let m=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:l,scheme:o.Schemes.file}),y.registerEditorComponent({component:c.VideoPreview,uid:r,scheme:o.Schemes.file}),y.registerEditorComponent({component:E.BinaryEditorComponent,uid:a,scheme:o.Schemes.file}),y.registerEditorComponent({component:h.LargeFilePrevent,uid:d,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:b.EditorOpenType.component,componentId:a})}),y.registerEditorComponentResolver(S=>S===o.Schemes.file||this.fileServiceClient.handlesScheme(S)?10:-1,async(S,A)=>{const T=await this.getFileType(S.uri.toString());switch(T){case"image":{A.push({type:b.EditorOpenType.component,componentId:l});break}case"video":{A.push({type:b.EditorOpenType.component,componentId:r});break}case"binary":case"text":{const{metadata:D,uri:w}=S,I=D||{};if(T==="binary"&&!I.skipPreventBinary)break;const R=await this.fileServiceClient.getFileStat(w.toString());await this.preference.ready;const M=this.preference.getValid("editor.largeFile",4*1024*1024*1024);R&&(R.size||0)>M&&!I.skipPreventTooLarge?A.push({type:b.EditorOpenType.component,componentId:d}):A.push({type:b.EditorOpenType.code,title:(0,o.localize)("editorOpenType.code")});break}}}),y.registerEditorComponentResolver(o.Schemes.untitled,(S,A,T)=>{T([{type:b.EditorOpenType.code,priority:"default"}])})}async getFileType(y){return this.cachedFileType.has(y)||((0,f.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"}}};e.FileSystemEditorComponentContribution=m,n.__decorate([(0,s.Autowired)(v.IFileServiceClient),n.__metadata("design:type",Object)],m.prototype,"fileServiceClient",void 0),n.__decorate([(0,s.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],m.prototype,"preference",void 0),e.FileSystemEditorComponentContribution=m=n.__decorate([(0,o.Domain)(b.BrowserEditorContribution),n.__metadata("design:paramtypes",[])],m)},52568:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileSchemeModule=void 0;const n=t(85608),s=t(76003),o=t(41869),f=t(80449),b=t(41352),g=t(17276);let v=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[g.FileSystemEditorResourceContribution,g.FileSystemEditorComponentContribution,{token:f.IFileSchemeDocClient,useClass:b.FileSchemeDocClientService}],this.backServices=[{servicePath:f.FileSchemeDocNodeServicePath}]}};e.FileSchemeModule=v,e.FileSchemeModule=v=n.__decorate([(0,s.Injectable)()],v)},88819:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LargeFilePrevent=e.PreventComponent=void 0;const n=t(85608),s=n.__importDefault(t(53373)),o=n.__importDefault(t(14041)),f=t(41869),b=t(81878),g=t(54414),v=t(82196),E=n.__importDefault(t(19996)),u=c=>o.default.createElement("div",{className:E.default["error-page"]},o.default.createElement("div",{className:(0,s.default)(E.default.icon,(0,f.getExternalIcon)("warning"))}),o.default.createElement("div",{className:E.default.description},c.description),o.default.createElement("div",{className:E.default["actions-wrapper"]},c.actions.map((r,l)=>o.default.createElement(b.Button,{key:l,onClick:()=>r.onClick(),className:E.default["action-button"]},r.label))));e.PreventComponent=u;const h=()=>{const c=(0,f.useInjectable)(g.WorkbenchEditorService),r=(0,f.useInjectable)(f.IEventBus),l=()=>{const a=c.currentResource;a&&(a.metadata={...a.metadata,skipPreventTooLarge:!0},r.fire(new v.ResourceOpenTypeChangedEvent(a.uri)))};return o.default.createElement(e.PreventComponent,{description:(0,f.localize)("editor.largeFile.prevent"),actions:[{label:(0,f.localize)("editor.file.prevent.stillOpen"),onClick:()=>l()}]})};e.LargeFilePrevent=h},99025:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ImagePreview=e.VideoPreview=void 0;const n=t(85608),s=n.__importDefault(t(14041)),o=t(41869),f=t(40827),b=n.__importDefault(t(19996)),g=u=>{const h=(0,o.useInjectable)(f.StaticResourceService);return{src:s.default.useMemo(()=>h.resolveStaticResource(u.uri).toString(),[u])}},v=u=>{const{src:h}=g(u.resource);return s.default.createElement("div",{className:b.default.kt_video_preview},s.default.createElement("video",{autoPlay:!0,controls:!0,className:b.default.kt_video,src:h}))};e.VideoPreview=v;const E=u=>{const h=s.default.useRef(),c=s.default.useRef(),{src:r}=g(u.resource);return s.default.useEffect(()=>{const l=new o.Disposable;return h.current&&(h.current.src=r),()=>{l.dispose()}},[u.resource]),s.default.createElement("div",{className:b.default.kt_image_preview},s.default.createElement("div",{ref:c},s.default.createElement("img",{ref:l=>l&&(h.current=l)})))};e.ImagePreview=E},80449:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChangeType=e.FileSchemeDocNodeServicePath=e.IFileSchemeDocNodeService=e.IFileSchemeDocClient=e.FILE_SAVE_BY_CHANGE_THRESHOLD=e.FILE_ON_DISK_SCHEME=void 0,e.FILE_ON_DISK_SCHEME="fileOnDisk",e.FILE_SAVE_BY_CHANGE_THRESHOLD=1e5,e.IFileSchemeDocClient=Symbol("IFileSchemeDocClient"),e.IFileSchemeDocNodeService=Symbol("FileSchemeDocNodeService"),e.FileSchemeDocNodeServicePath="FileSchemeDocNodeService";var t;(function(n){n[n.ADDED=1]="ADDED",n[n.REMOVED=2]="REMOVED"})(t||(e.ChangeType=t={}))},15625:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IFileSearchService=e.FileSearchServicePath=void 0,e.FileSearchServicePath="FileSearchServicePath",e.IFileSearchService=Symbol("FileSearchService")},84660:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),t(85608).__exportStar(t(15625),e)},2156:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileServiceClient=e.BrowserFileSystemRegistryImpl=void 0;const n=t(85608),s=t(32852),o=t(76003),f=t(41869),b=t(43718),g=t(37406),v=t(8170),E=t(41682),u=t(42933),h=t(81952);let c=class{constructor(){this.providers=new Map}registerFileSystemProvider(a){const d=a.scheme;return this.providers.set(d,a),{dispose:()=>{this.providers.delete(d)}}}};e.BrowserFileSystemRegistryImpl=c,e.BrowserFileSystemRegistryImpl=c=n.__decorate([(0,o.Injectable)()],c);let r=class{get clientId(){return this.applicationService.clientId}constructor(){this.watcherWithSchemaMap=new Map,this.watcherDisposerMap=new Map,this.onFileChangedEmitter=new f.Emitter,this.onFileProviderChangedEmitter=new f.Emitter,this._onFilesChanged=new f.Emitter,this.onFilesChanged=this._onFilesChanged.event,this._onFileProviderChanged=new f.Emitter,this.onFileProviderChanged=this._onFileProviderChanged.event,this._onDidChangeFileSystemProviderRegistrations=new f.Emitter,this.onDidChangeFileSystemProviderRegistrations=this._onDidChangeFileSystemProviderRegistrations.event,this._onWillActivateFileSystemProvider=new f.Emitter,this.onWillActivateFileSystemProvider=this._onWillActivateFileSystemProvider.event,this._onDidChangeFileSystemProviderCapabilities=new f.Emitter,this.onDidChangeFileSystemProviderCapabilities=this._onDidChangeFileSystemProviderCapabilities.event,this.filesExcludesMatcherList=[],this.watcherId=0,this.toDisposable=new f.DisposableCollection,this.watchFileExcludes=[],this.watchFileExcludesMatcherList=[],this.filesExcludes=[],this.workspaceRoots=[],this._providerChanged=new Set,this.fsProviders=new Map,this.userHomeDeferred=new f.Deferred,this.options={encoding:"utf8",overwrite:!1,recursive:!0,moveToTrash:!0},this.uriWatcherMap=new Map,this.toDisposable.push(this.onDidChangeFileSystemProviderRegistrations(a=>{a.added&&a.scheme===b.Schemes.file&&this.doGetCurrentUserHome()}))}async initialize(){const a=await this.getProvider(b.Schemes.file);a.initialize&&await a.initialize(this.clientId)}async doGetCurrentUserHome(){const d=(await this.getProvider(b.Schemes.file)).getCurrentUserHome();this.userHomeDeferred.resolve(d)}handlesScheme(a){return this.registry.providers.has(a)||this.fsProviders.has(a)}dispose(){return this.toDisposable.dispose()}async resolveContent(a,d){const p=this.convertUri(a),_=await(await this.getProvider(p.scheme)).readFile(p.codeUri),y=_.data||_;return{content:f.BinaryBuffer.wrap(Uint8Array.from(y)).toString(d?.encoding)}}async readFile(a){const d=this.convertUri(a),m=await(await this.getProvider(d.scheme)).readFile(d.codeUri),_=m.data||m;return{content:f.BinaryBuffer.wrap(Uint8Array.from(_))}}async readFileStream(a){const d=this.convertUri(a);return await(await this.getProvider(d.scheme)).readFileStream(d.codeUri)}async getFileStat(a,d=!0){const p=this.convertUri(a),m=await this.getProvider(p.scheme);try{const _=await m.stat(p.codeUri);if(!_)throw u.FileSystemError.FileNotFound(p.codeUri.toString(),"File not found.");return this.filterStat(_,d)}catch(_){if(u.FileSystemError.FileNotFound.is(_))return}}async setContent(a,d,p){const m=this.convertUri(a.uri),_=await this.getProvider(m.scheme),y=await _.stat(m.codeUri);if(!y)throw u.FileSystemError.FileNotFound(a.uri,"File not found.");if(y.isDirectory)throw u.FileSystemError.FileIsADirectory(a.uri,"Cannot set the content.");if(!await this.isInSync(a,y))throw this.createOutOfSyncError(a);return await _.writeFile(m.codeUri,typeof d=="string"?f.BinaryBuffer.fromString(d).buffer:d,{create:!1,overwrite:!0,encoding:p?.encoding}),await _.stat(m.codeUri)}async updateContent(a,d,p){const m=this.convertUri(a.uri),_=await this.getProvider(m.scheme),y=await _.stat(m.codeUri);if(!y)throw u.FileSystemError.FileNotFound(a.uri,"File not found.");if(y.isDirectory)throw u.FileSystemError.FileIsADirectory(a.uri,"Cannot set the content.");if(!this.checkInSync(a,y))throw this.createOutOfSyncError(a);if(d.length===0)return y;const S=await _.readFile(m.codeUri),A=this.applyContentChanges(f.BinaryBuffer.wrap(S).toString(p?.encoding),d);await _.writeFile(m.codeUri,f.BinaryBuffer.fromString(A).buffer,{create:!1,overwrite:!0,encoding:p?.encoding});const T=await _.stat(m.codeUri);if(!T)throw u.FileSystemError.FileNotFound(m.codeUri.toString(),"File not found.");return T}async createFile(a,d){const p=this.convertUri(a),m=await this.getProvider(p.scheme),_=f.BinaryBuffer.fromString(d?.content||"").buffer;let y=await m.writeFile(p.codeUri,_,{create:!0,overwrite:d&&d.overwrite||!1,encoding:d?.encoding});return y=y||await m.stat(p.codeUri),y}async createFolder(a){const d=this.convertUri(a),p=await this.getProvider(d.scheme),m=await p.createDirectory(d.codeUri);return m||await p.stat(d.codeUri)}async move(a,d,p){const m=this.convertUri(a),_=this.convertUri(d),y=await this.getProvider(m.scheme),S=await y.rename(m.codeUri,_.codeUri,{overwrite:!!(p&&p.overwrite)});return S||await y.stat(_.codeUri)}async copy(a,d,p){const m=this.convertUri(a),_=this.convertUri(d),y=await this.getProvider(m.scheme),S=await this.doGetOverwrite(p);if(!(0,u.containsExtraFileMethod)(y,"copy"))throw this.getErrorProvideNotSupport(m.scheme,"copy");const A=await y.copy(m.codeUri,_.codeUri,{overwrite:!!S});return A||await y.stat(_.codeUri)}async getFsPath(a){if(a.startsWith("file:/"))return f.FileUri.fsPath(a)}fireFilesChange(a){const d=a.changes.map(p=>({uri:p.uri,type:p.type}));this._onFilesChanged.fire(d),this.eventBus.fire(new f.FilesChangeEvent(d))}async watchFileChanges(a,d){const m=(this.appConfig.unRecursiveDirectories||[]).some(I=>a.path.toString().startsWith(I)),_=this.convertUri(a.toString()),y=this.uriWatcherMap.get(_.toString());if(y)if(y.isDisposed())this.uriWatcherMap.delete(_.toString());else return y;const S=this.watcherId++,A=await this.getProvider(_.scheme),T=this.watcherWithSchemaMap.get(_.scheme)||[],D=await A.watch(_.codeUri,{excludes:d,recursive:!m});this.watcherDisposerMap.set(S,{dispose:async()=>{const I=this.uriWatcherMap.get(_.toString());await Promise.all([A.unwatch&&A.unwatch(D),I&&I.dispose()]),this.uriWatcherMap.delete(_.toString())}}),T.push(S),this.watcherWithSchemaMap.set(_.scheme,T);const w=new h.FileSystemWatcher({fileServiceClient:this,watchId:S,uri:a});return this.uriWatcherMap.set(_.toString(),w),w}async setWatchFileExcludes(a){return await(await this.getProvider(b.Schemes.file)).setWatchFileExcludes(a)}async getWatchFileExcludes(){return await(await this.getProvider(b.Schemes.file)).getWatchFileExcludes()}async setFilesExcludes(a,d){this.filesExcludes=a,this.filesExcludesMatcherList=[],d&&this.setWorkspaceRoots(d),this.updateExcludeMatcher()}async setWorkspaceRoots(a){this.workspaceRoots=a,this.updateExcludeMatcher()}async unwatchFileChanges(a){const d=this.watcherDisposerMap.get(a);if(!(!d||!d.dispose))return this.watcherDisposerMap.delete(a),d.dispose()}async delete(a,d){if(this.appConfig.isElectronRenderer&&d?.moveToTrash!==!1){const _=new f.URI(a);if(_.scheme===b.Schemes.file)return this.injector.get(g.IElectronMainUIService).moveToTrash(_.codeUri.fsPath)}const p=this.convertUri(a),m=await this.getProvider(p.scheme);await m.stat(p.codeUri),await m.delete(p.codeUri,{recursive:!0,moveToTrash:await this.doGetMoveToTrash(d)})}async getEncoding(a){return"utf8"}listCapabilities(){return E.Iterable.map(this.fsProviders,([a,d])=>({scheme:a,capabilities:d.capabilities}))}registerProvider(a,d){if(this.fsProviders.has(a))throw new Error(`The file system provider for \`${a}\` already registered`);const p=[];this.fsProviders.set(a,d),this._onDidChangeFileSystemProviderRegistrations.fire({added:!0,scheme:a,provider:d}),p.push({dispose:()=>{this._onDidChangeFileSystemProviderRegistrations.fire({added:!1,scheme:a,provider:d}),this.fsProviders.delete(a),this._providerChanged.add(a)}}),d.onDidChangeFile&&p.push(d.onDidChangeFile(_=>this.fireFilesChange({changes:_}))),this.toDisposable.push(d.onDidChangeCapabilities(()=>this._onDidChangeFileSystemProviderCapabilities.fire({provider:d,scheme:a}))),p.push({dispose:async()=>{const _=[];(this.watcherWithSchemaMap.get(a)||[]).forEach(y=>_.push(this.unwatchFileChanges(y))),await Promise.all(_)}}),this._providerChanged.add(a),this.onFileProviderChangedEmitter.fire(Array.from(this._providerChanged)),this.toDisposable.pushAll(p);const m=new f.DisposableCollection;return m.pushAll(p),this._onFileProviderChanged.fire(Array.from(this._providerChanged)),m}async access(a,d=u.FileAccess.Constants.F_OK){const p=this.convertUri(a),m=await this.getProvider(p.scheme);if(!(0,u.containsExtraFileMethod)(m,"access"))throw this.getErrorProvideNotSupport(p.scheme,"access");return await m.access(p.codeUri,d)}async getFileType(a){const d=this.convertUri(a),p=await this.getProvider(d.scheme);if(!(0,u.containsExtraFileMethod)(p,"getFileType"))throw this.getErrorProvideNotSupport(d.scheme,"getFileType");return await p.getFileType(a)}async getCurrentUserHome(){return this.userHomeDeferred.promise}getErrorProvideNotSupport(a,d){return`Scheme ${a} not support this function: ${d}.`}convertUri(a){const d=new f.URI(a);if(!d.scheme)throw new Error(`Unsupported convert Uri with non-scheme Uri: ${a}`);return d}updateExcludeMatcher(){this.filesExcludes.forEach(a=>{this.workspaceRoots.length>0?this.workspaceRoots.forEach(d=>{const m=new f.URI(d).resolve(a).path.toString();this.filesExcludesMatcherList.push((0,f.parseGlob)(m))}):this.filesExcludesMatcherList.push((0,f.parseGlob)(a))})}async shouldWaitProvider(a){const d=await this._onWillActivateFileSystemProvider.fireAndAwait({scheme:a}),{result:p}=d[0];if(p&&p.includes(a)){const m=await f.Event.toPromise(f.Event.filter(this.onFileProviderChanged,_=>_.includes(a)));if(!(0,b.isUndefined)(m))return!0}return!1}async getProvider(a){this._providerChanged.has(a)&&(await this.eventBus.fireAndAwait(new f.ExtensionActivateEvent({topic:"onFileSystem",data:a}),{timeout:3e3}),this._providerChanged.delete(a));const d=this.fsProviders.get(a);if(!d)throw new Error(`Not find ${a} provider.`);return d}async isReadonly(a){try{const d=new f.URI(a);return!!(await(await this.getProvider(d.scheme)).stat(this.convertUri(a).codeUri)).readonly}catch{return!1}}isExclude(a){const d=new f.URI(a);return this.filesExcludesMatcherList.some(p=>p(d.path.toString()))}filterStat(a,d=!0){if(a&&!this.isExclude(a.uri))return a.children&&d&&(a.children=this.filterStatChildren(a.children)),a}filterStatChildren(a){const d=[];return a.forEach(p=>{if(this.isExclude(p.uri))return!1;const m=this.filterStat(p);m&&d.push(m)}),d}applyContentChanges(a,d){let p=s.TextDocument.create("","",1,a);for(const m of d){let _=m.text;if(m.range){const y=p.offsetAt(m.range.start),S=p.offsetAt(m.range.end);_=p.getText().substr(0,y)+m.text+p.getText().substr(S)}p=s.TextDocument.create(p.uri,p.languageId,p.version,_)}return p.getText()}async isInSync(a,d){return!!this.checkInSync(a,d)}checkInSync(a,d){return d.lastModification===a.lastModification&&d.size===a.size}createOutOfSyncError(a){return u.FileSystemError.FileIsOutOfSync(a.uri)}async doGetEncoding(a){return a&&typeof a.encoding<"u"?a.encoding:this.options.encoding}async doGetOverwrite(a){return a&&typeof a.overwrite<"u"?a.overwrite:this.options.overwrite}async doGetRecursive(a){return a&&typeof a.recursive<"u"?a.recursive:this.options.recursive}async doGetMoveToTrash(a){return a&&typeof a.moveToTrash<"u"?a.moveToTrash:this.options.moveToTrash}};e.FileServiceClient=r,n.__decorate([(0,o.Autowired)(u.IBrowserFileSystemRegistry),n.__metadata("design:type",c)],r.prototype,"registry",void 0),n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],r.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(b.IEventBus),n.__metadata("design:type",Object)],r.prototype,"eventBus",void 0),n.__decorate([(0,o.Autowired)(f.AppConfig),n.__metadata("design:type",Object)],r.prototype,"appConfig",void 0),n.__decorate([(0,o.Autowired)(v.IApplicationService),n.__metadata("design:type",Object)],r.prototype,"applicationService",void 0),e.FileServiceClient=r=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],r)},69037:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileServiceContribution=void 0;const n=t(85608),s=t(76003),o=t(41869),f=t(42933),b=t(2156);let g=class{constructor(){this._disposables=new o.DisposableStore,this._disposables.add(this.fileSystem.registerProvider(o.Schemes.file,this.diskFileServiceProvider))}async initialize(){const E=this.contributionProvider.getContributions();await Promise.all(E.map(async u=>{u.registerProvider&&await u.registerProvider(this.fileSystem)})),await Promise.all(E.map(async u=>{u.onFileServiceReady&&await u.onFileServiceReady()})),this.fileSystem.initialize&&await this.fileSystem.initialize()}dispose(){this._disposables.dispose()}};e.FileServiceContribution=g,n.__decorate([(0,s.Autowired)(f.IFileServiceClient),n.__metadata("design:type",b.FileServiceClient)],g.prototype,"fileSystem",void 0),n.__decorate([(0,s.Autowired)(f.IDiskFileProvider),n.__metadata("design:type",Object)],g.prototype,"diskFileServiceProvider",void 0),n.__decorate([(0,s.Autowired)(o.FsProviderContribution),n.__metadata("design:type",Object)],g.prototype,"contributionProvider",void 0),e.FileServiceContribution=g=n.__decorate([(0,o.Domain)(o.ClientAppContribution),n.__metadata("design:paramtypes",[])],g)},60476:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DiskFsProviderClient=e.CoreFileServiceProviderClient=void 0;const n=t(85608),s=t(76003),o=t(43718),f=t(42933);class b{constructor(){this.onDidChangeFileEmitter=new o.Emitter,this.onDidChangeFile=this.onDidChangeFileEmitter.event}watch(E,u){return this.fileServiceProvider.watch(E,u)}unwatch(E){return this.fileServiceProvider.unwatch&&this.fileServiceProvider.unwatch(E)}async stat(E){return await this.fileServiceProvider.stat(E)}readDirectory(E){return this.fileServiceProvider.readDirectory(E)}createDirectory(E){return this.fileServiceProvider.createDirectory(E)}async readFile(E,u){return u&&(0,o.getDebugLogger)("fileService.fsProvider").warn("encoding option for fsProvider.readFile is deprecated"),await this.fileServiceProvider.readFile(E)}readFileStream(E){if(this.fileServiceProvider.readFileStream)return this.fileServiceProvider.readFileStream(E);throw new Error("readFileStream not supported")}writeFile(E,u,h){return this.fileServiceProvider.writeFile(E,Array.from(u),h)}delete(E,u){return this.fileServiceProvider.delete(E,u)}rename(E,u,h){return this.fileServiceProvider.rename(E,u,h)}}e.CoreFileServiceProviderClient=b,n.__decorate([(0,s.Autowired)(s.INJECTOR_TOKEN),n.__metadata("design:type",s.Injector)],b.prototype,"injector",void 0);let g=class extends b{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(E){var u,h;if(!((u=this.fileServiceProvider)===null||u===void 0)&&u.initialize)try{await((h=this.fileServiceProvider)===null||h===void 0?void 0:h.initialize(E))}catch{}}setWatchFileExcludes(E){return this.fileServiceProvider.setWatchFileExcludes(E)}getWatchFileExcludes(){return this.fileServiceProvider.getWatchFileExcludes()}onDidFilesChanged(E){const u=E.changes.map(h=>({uri:h.uri,type:h.type}));this.onDidChangeFileEmitter.fire(u)}copy(E,u,h){return this.fileServiceProvider.copy(E,u,h)}access(E,u){return this.fileServiceProvider.access(E,u)}getCurrentUserHome(){return this.fileServiceProvider.getCurrentUserHome()}getFileType(E){return this.fileServiceProvider.getFileType(E)}};e.DiskFsProviderClient=g,n.__decorate([(0,s.Autowired)(f.DiskFileServicePath),n.__metadata("design:type",Object)],g.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)],g.prototype,"setWatchFileExcludes",null),e.DiskFsProviderClient=g=n.__decorate([(0,s.Injectable)()],g)},96708:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileServiceClientModule=void 0;const n=t(85608),s=t(76003),o=t(41869),f=t(42933),b=t(70671),g=t(2156),v=t(69037),E=t(60476),u=t(23188);let h=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:f.IFileServiceClient,useClass:g.FileServiceClient},{token:f.IBrowserFileSystemRegistry,useClass:g.BrowserFileSystemRegistryImpl},{token:f.IDiskFileProvider,useClass:E.DiskFsProviderClient},{token:f.IShadowFileProvider,useClass:u.ShadowFileSystemProvider},v.FileServiceContribution],this.backServices=[{servicePath:f.DiskFileServicePath,clientToken:f.IDiskFileProvider,protocol:b.DiskFileServiceProtocol}]}};e.FileServiceClientModule=h,e.FileServiceClientModule=h=n.__decorate([(0,s.Injectable)()],h)},23188:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShadowFileSystemProvider=void 0;const n=t(85608),s=t(76003),o=t(41869);let f=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(g){throw new Error("Method not implemented.")}readFileStream(g){throw new Error("Method not implemented.")}watch(g,v){throw new Error("Method not implemented.")}stat(g){return Promise.resolve({uri:g.toString(),lastModification:0})}readDirectory(g){throw new Error("Method not implemented.")}createDirectory(g){throw new Error("Method not implemented.")}readFile(g){return this.shadowFiles.get(g.toString())||o.BinaryBuffer.fromString("no available").buffer}writeFile(g,v,E){this.shadowFiles.set(g.toString(),v)}delete(g,v){throw new Error("Method not implemented.")}rename(g,v,E){throw new Error("Method not implemented.")}copy(g,v,E){throw new Error("Method not implemented.")}exists(g){throw new Error("Method not implemented.")}access(g,v){throw new Error("Method not implemented.")}};e.ShadowFileSystemProvider=f,e.ShadowFileSystemProvider=f=n.__decorate([(0,s.Injectable)()],f)},81952:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileSystemWatcher=void 0;const n=t(43718);function s(f,b){return f.filter(g=>!!g.uri.startsWith(b))}class o{constructor(b){this.toDispose=new n.DisposableCollection,this.changeEmitter=new n.Emitter,this.toDispose.push(this.changeEmitter),this.fileServiceClient=b.fileServiceClient,this.watchId=b.watchId,this.uri=b.uri,this.fileServiceClient.onFilesChanged(g=>{const v=s(g,this.uri.toString());v&&v.length>0&&this.changeEmitter.fire(v)})}get onFilesChanged(){return this.changeEmitter.event}dispose(){return Promise.all([this.toDispose.dispose(),this.fileServiceClient.unwatchFileChanges(this.watchId)])}isDisposed(){return this.toDispose.disposed}}e.FileSystemWatcher=o},91813:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EXT_LIST_TEXT=e.EXT_LIST_IMAGE=e.EXT_LIST_VIDEO=void 0,e.getFileTypeByExt=t,e.EXT_LIST_VIDEO=new Set(["mp4","webm","mkv","mov","mts","flv","avi","wmv"]),e.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"]),e.EXT_LIST_TEXT=new Set(["xml"]);function t(n){let s="text";return n&&(e.EXT_LIST_IMAGE.has(n)?s="image":e.EXT_LIST_VIDEO.has(n)?s="video":e.EXT_LIST_TEXT.has(n)?s="text":s="binary"),s}},79929:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IBrowserFileSystemRegistry=e.IFileServiceClient=void 0;const n=t(43718);e.IFileServiceClient=n.IFileServiceClient,e.IBrowserFileSystemRegistry=Symbol("IBrowserFileSystemRegistry")},49818:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileSystemError=e.FileOperationError=e.FileSystemProviderError=e.FileSystemProviderErrorCode=e.FileAccess=e.IFileService=e.IShadowFileProvider=e.IDiskFileProvider=e.FileStat=e.FileType=void 0,e.createFileSystemProviderError=E,e.markAsFileSystemProviderError=u,e.containsExtraFileMethod=c,e.notEmpty=r,e.isErrnoException=l,e.handleError=a;const n=t(85608),s=t(43718);var o=t(31036);Object.defineProperty(e,"FileType",{enumerable:!0,get:function(){return o.FileType}}),Object.defineProperty(e,"FileStat",{enumerable:!0,get:function(){return o.FileStat}}),n.__exportStar(t(11854),e),e.IDiskFileProvider=Symbol("IDiskFileProvider"),e.IShadowFileProvider=Symbol("IShadowFileProvider"),e.IFileService=Symbol("IFileService");var f;(function(d){let p;(function(m){m.F_OK=0,m.R_OK=4,m.W_OK=2,m.X_OK=1})(p=d.Constants||(d.Constants={}))})(f||(e.FileAccess=f={}));var b;(function(d){d.FileExists="EntryExists",d.FileNotFound="EntryNotFound",d.FileNotADirectory="EntryNotADirectory",d.FileIsADirectory="EntryIsADirectory",d.FileIsOutOfSync="FileIsOutOfSync",d.FileExceedsMemoryLimit="EntryExceedsMemoryLimit",d.FileTooLarge="EntryTooLarge",d.FileWriteLocked="EntryWriteLocked",d.NoPermissions="NoPermissions",d.Unavailable="Unavailable",d.Unknown="Unknown"})(b||(e.FileSystemProviderErrorCode=b={}));class g extends Error{static declare(p,m){return Object.assign((..._)=>E(m(..._),p),{is:_=>{var y;return(y=_.stack)===null||y===void 0?void 0:y.startsWith(p)}})}constructor(p,m){super(p),this.code=m}is(p){return this.name===p.name}}e.FileSystemProviderError=g;class v extends Error{constructor(p,m,_){super(p),this.fileOperationResult=m,this.options=_}static isFileOperationError(p){return p instanceof Error&&!(0,s.isUndefinedOrNull)(p.fileOperationResult)}}e.FileOperationError=v;function E(d,p){const m=new g(d.toString(),p);return u(m,p),m}function u(d,p){return d.name=p?`${p} (FileSystemError)`:"FileSystemError",d}var h;(function(d){d.FileNotFound=g.declare(b.FileNotFound,(p,m)=>`${m?m+" ":""} '${p}' is not found.`),d.FileExists=g.declare(b.FileExists,(p,m)=>`${m?m+" ":""}'${p}' already exists.`),d.FileNotADirectory=g.declare(b.FileNotADirectory,(p,m)=>`${m?m+" ":""}'${p}' is not a directory.`),d.FileIsADirectory=g.declare(b.FileIsADirectory,(p,m)=>`${m?m+" ":""}'${p}' is a directory.`),d.FileIsOutOfSync=g.declare(b.FileIsOutOfSync,(p,m)=>`${m?m+" ":""}'${p}' is out of sync.`),d.FileExceedsMemoryLimit=g.declare(b.FileExceedsMemoryLimit,(p,m)=>`${m?m+" ":""}'${p}' is exceeds memory limit.`),d.FileTooLarge=g.declare(b.FileTooLarge,(p,m)=>`${m?m+" ":""}'${p}' is too large.`),d.FileWriteLocked=g.declare(b.FileWriteLocked,(p,m)=>`${m?m+" ":""}'${p}' is locked.`),d.FileIsNoPermissions=g.declare(b.NoPermissions,(p,m)=>`${m?m+" ":""}'${p}' is no permissions.`),d.Unavailable=g.declare(b.Unavailable,(p,m)=>`${m?m+" ":""}'${p}' is unavailable.`),d.Unknown=g.declare(b.Unknown,(p,m)=>`${m?m+" ":""}'${p}' is unkonw.`)})(h||(e.FileSystemError=h={}));function c(d,p){return(0,s.hasProperty)(d,p)&&(0,s.isFunction)(d[p])}function r(d){return d!==void 0}function l(d){return d.code!==void 0&&d.errno!==void 0}function a(d){var p,m,_,y,S;if(l(d))switch(d.code){case"EEXIST":throw h.FileExists(s.Uri.file((p=d.path)!==null&&p!==void 0?p:""));case"EPERM":case"EACCESS":throw h.FileIsNoPermissions(s.Uri.file((m=d.path)!==null&&m!==void 0?m:""));case"ENOENT":throw h.FileNotFound(s.Uri.file((_=d.path)!==null&&_!==void 0?_:""));case"ENOTDIR":throw h.FileNotADirectory(s.Uri.file((y=d.path)!==null&&y!==void 0?y:""));case"EISDIR":throw h.FileIsADirectory(s.Uri.file((S=d.path)!==null&&S!==void 0?S:""))}throw d}},42933:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=t(85608);n.__exportStar(t(79929),e),n.__exportStar(t(49818),e),n.__exportStar(t(28217),e),n.__exportStar(t(91813),e),n.__exportStar(t(50295),e)},70671:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DiskFileServiceProtocol=void 0;const n=t(26387),s=t(52890),o=t(50295);e.DiskFileServiceProtocol={name:o.DiskFileServicePath,methods:[{method:"readFile",request:[{name:"uri",type:s.UriComponentsProto}],response:{type:n.Type.binary()}}]}},50295:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileExtServicePath=e.FileWatcherServicePath=e.ShadowFileServicePath=e.DiskFileServicePath=e.FileServicePath=void 0,e.FileServicePath="FileService",e.DiskFileServicePath="DiskFileService",e.ShadowFileServicePath="ShadowFileService",e.FileWatcherServicePath="FileWatcherService",e.FileExtServicePath="FileExtServicePath"},28217:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WatcherProcessManagerProxy=e.WatcherServiceProxy=e.WATCHER_INIT_DATA_KEY=e.KT_WATCHER_PROCESS_SOCK_KEY=e.INsfw=void 0;const n=t(86058);var s;(function(o){let f;(function(b){b[b.CREATED=0]="CREATED",b[b.DELETED=1]="DELETED",b[b.MODIFIED=2]="MODIFIED",b[b.RENAMED=3]="RENAMED"})(f=o.actions||(o.actions={}))})(s||(e.INsfw=s={})),e.KT_WATCHER_PROCESS_SOCK_KEY="kt-watcher-process-sock",e.WATCHER_INIT_DATA_KEY="kt-watcher-init-data",e.WatcherServiceProxy=new n.ProxyIdentifier("WatcherHostServiceImpl"),e.WatcherProcessManagerProxy=new n.ProxyIdentifier("WatcherProcessManagerProxy")},14951:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),t(85608).__exportStar(t(42933),e)},57942:(x,e,t)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeDialogModel=void 0;const s=t(85608),o=t(76003),f=t(97267),b=t(41869),g=t(26542),v=t(6250),E=t(2812),u=s.__importDefault(t(89200)),h=t(9018);let c=n=class{static createContainer(l,a){return l.createChild([{token:v.IFileDialogTreeService,useValue:a},{token:v.IFileDialogModel,useClass:n}])}static createModel(l,a){return n.createContainer(l,a).get(v.IFileDialogModel)}constructor(){this.selectedDecoration=new f.Decoration(u.default.mod_selected),this.focusedDecoration=new f.Decoration(u.default.mod_focused),this.loadingDecoration=new f.Decoration(u.default.mod_loading),this.cutDecoration=new f.Decoration(u.default.mod_cut),this._selectedFiles=[],this.disposableCollection=new b.DisposableCollection,this.onDidFocusedFileChangeEmitter=new b.Emitter,this.onDidSelectedFileChangeEmitter=new b.Emitter,this.clearFileSelectedDecoration=()=>{this._selectedFiles.forEach(l=>{this.selectedDecoration.removeTarget(l)}),this._selectedFiles=[],this.onDidSelectedFileChangeEmitter.fire([])},this.activeFileDecoration=(l,a=!0)=>{l!==this.treeModel.root&&(this.preContextMenuFocusedFile&&(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile),this.preContextMenuFocusedFile=null),l&&(this.selectedFiles.length>0&&this.selectedFiles.forEach(d=>{this.selectedDecoration.removeTarget(d)}),this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.selectedDecoration.addTarget(l),this.focusedDecoration.addTarget(l),this._focusedFile=l,this._selectedFiles=[l],this.onDidFocusedFileChangeEmitter.fire(l.uri),this.onDidSelectedFileChangeEmitter.fire([l.uri]),a&&this.treeModel.dispatchChange()))},this.selectFileDecoration=(l,a=!0)=>{l!==this.treeModel.root&&(this.preContextMenuFocusedFile&&(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile),this.preContextMenuFocusedFile=null),l&&(this.selectedFiles.length>0&&this.selectedFiles.forEach(d=>{this.selectedDecoration.removeTarget(d)}),this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.selectedDecoration.addTarget(l),this._selectedFiles=[l],this.onDidSelectedFileChangeEmitter.fire([l.uri]),a&&this.treeModel.dispatchChange()))},this.activeFileFocusedDecoration=(l,a=!1)=>{l!==this.treeModel.root&&(this.focusedFile!==l&&(a?(this.preContextMenuFocusedFile?(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile)):this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.preContextMenuFocusedFile=l):this.focusedFile&&(this.preContextMenuFocusedFile=null,this.focusedDecoration.removeTarget(this.focusedFile)),l&&(this.selectedDecoration.addTarget(l),this.focusedDecoration.addTarget(l),this._focusedFile=l,this._selectedFiles.push(l),this.onDidFocusedFileChangeEmitter.fire(l.uri),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(d=>d.uri)))),this.treeModel.dispatchChange())},this.activeFileSelectedDecoration=l=>{this._selectedFiles.indexOf(l)>-1||(this._selectedFiles.push(l),this.selectedDecoration.addTarget(l),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(a=>a.uri)),this.treeModel.dispatchChange())},this.activeFileDecorationByRange=(l,a)=>{for(this.clearFileSelectedDecoration(),this.preContextMenuFocusedFile=null;l<=a;l++){const d=this.treeModel.root.getTreeNodeAtIndex(l);d&&(this._selectedFiles.push(d),this.selectedDecoration.addTarget(d))}this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(d=>d.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 l=>{l.expanded?this.fileTreeHandle.collapseNode(l):this.fileTreeHandle.expandNode(l)},this.handleTreeBlur=()=>{this.enactiveFileDecoration()},this.handleTreeFocus=()=>{},this.handleItemRangeClick=(l,a)=>{if(!this.focusedFile)this.handleItemClick(l,a);else if(this.focusedFile&&this.focusedFile!==l){const d=this.treeModel.root.getIndexAtTreeNode(l),p=this.treeModel.root.getIndexAtTreeNode(this.focusedFile);p>d?this.activeFileDecorationByRange(d,p):p<d&&this.activeFileDecorationByRange(p,d)}},this.handleItemToggleClick=(l,a)=>{a!==f.TreeNodeType.CompositeTreeNode&&a!==f.TreeNodeType.TreeNode||(this.selectedFiles.indexOf(l)>-1?this.focusedFile===l?this.enactiveFileDecoration():this.activeFileFocusedDecoration(l):this.activeFileSelectedDecoration(l))},this.handleItemClick=(l,a)=>{this.clickTimes++,(a===f.TreeNodeType.CompositeTreeNode||a===f.TreeNodeType.TreeNode)&&this.activeFileDecoration(l),a===f.TreeNodeType.CompositeTreeNode&&this.corePreferences["workbench.list.openMode"]==="singleClick"&&this.toggleDirectory(l),this.clickTimer&&clearTimeout(this.clickTimer),this.clickTimer=setTimeout(()=>{this.clickTimes>1&&a!==f.TreeNodeType.TreeNode&&this.corePreferences["workbench.list.openMode"]==="doubleClick"&&this.toggleDirectory(l),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 l=(await this.fileTreeDialogService.resolveChildren())[0];this._treeModel=this.injector.get(E.FileTreeModel,[l]),this.initDecorations(l),this.disposableCollection.push(this._decorations),this.disposableCollection.push(this.labelService.onDidChange(()=>{this.treeModel.dispatchChange()})),this.disposableCollection.push(this.treeModel.root.watcher.on(f.TreeNodeEvent.WillResolveChildren,a=>{this.loadingDecoration.addTarget(a)})),this.disposableCollection.push(this.treeModel.root.watcher.on(f.TreeNodeEvent.DidResolveChildren,a=>{this.loadingDecoration.removeTarget(a)}))}async updateTreeModel(l){const a=await this.fileTreeDialogService.resolveRoot(l);if(a&&a.length>0){const d=a[0];this._treeModel=this.injector.get(E.FileTreeModel,[d]),this.clearFileSelectedDecoration(),this.initDecorations(d)}}initDecorations(l){this._decorations&&this._decorations.dispose(),this._decorations=new f.DecorationsManager(l),this._decorations.addDecoration(this.selectedDecoration),this._decorations.addDecoration(this.focusedDecoration),this._decorations.addDecoration(this.cutDecoration),this._decorations.addDecoration(this.loadingDecoration)}handleTreeHandler(l){this._fileTreeHandle=l}dispose(){this.disposableCollection.dispose()}};e.FileTreeDialogModel=c,c.FILE_TREE_SNAPSHOT_KEY="FILE_TREE_SNAPSHOT",c.DEFAULT_LOCATION_FLUSH_DELAY=500,s.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),s.__metadata("design:type",o.Injector)],c.prototype,"injector",void 0),s.__decorate([(0,o.Autowired)(v.IFileDialogTreeService),s.__metadata("design:type",h.FileTreeDialogService)],c.prototype,"fileTreeDialogService",void 0),s.__decorate([(0,o.Autowired)(g.LabelService),s.__metadata("design:type",g.LabelService)],c.prototype,"labelService",void 0),s.__decorate([(0,o.Autowired)(b.CorePreferences),s.__metadata("design:type",Object)],c.prototype,"corePreferences",void 0),e.FileTreeDialogModel=c=n=s.__decorate([(0,o.Injectable)(),s.__metadata("design:paramtypes",[])],c)},69748:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FILE_TREE_BADGE_LIMIT=e.FILE_TREE_NODE_HEIGHT=e.FileTreeDialogNode=void 0;const n=t(85608),s=n.__importDefault(t(53373)),o=n.__importDefault(t(14041)),f=t(97267),b=t(41869),g=t(69959),v=n.__importDefault(t(89200)),E=({item:u,onClick:h,itemType:c,labelService:r,leftPadding:l=8,onTwistierClick:a,decorations:d,defaultLeftPadding:p=8,template:m})=>{const _=c===f.TreeNodeType.RenamePrompt,y=c===f.TreeNodeType.NewPrompt,S=_||y,A=(0,b.useDesignStyles)(v.default.expansion_toggle,"expansion_toggle"),T=(0,b.useDesignStyles)(v.default.file_tree_node,"file_tree_node"),D=U=>{(c===f.TreeNodeType.TreeNode||c===f.TreeNodeType.CompositeTreeNode)&&h(U,u,c)},w=U=>{(c===f.TreeNodeType.TreeNode||c===f.TreeNodeType.CompositeTreeNode)&&(a?a(U,u,c):h(U,u,c))},I=c===f.TreeNodeType.CompositeTreeNode;let R;S?y?R=`${p+(u.parent.depth+1||0)*(l||0)}px`:R=`${p+(u.target.depth||0)*(l||0)}px`:R=I?`${p+(u.depth||0)*(l||0)}px`:`${p+(u.depth||0)*(l||0)+8}px`;const M={height:e.FILE_TREE_NODE_HEIGHT,lineHeight:`${e.FILE_TREE_NODE_HEIGHT}px`,paddingLeft:R},O=(U,V)=>{if(d&&d?.classlist.indexOf(v.default.mod_loading)>-1)return o.default.createElement(f.Loading,null);if(S&&U instanceof f.PromptHandle){let H=!1;if(_?H=U.target.type===f.TreeNodeType.CompositeTreeNode:H=U.type===f.TreeNodeType.CompositeTreeNode,H)return o.default.createElement("div",{className:(0,s.default)(v.default.file_tree_node_segment,A,(0,b.getIcon)("arrow-right"),{[`${v.default.mod_collapsed}`]:y||!(_&&U.target.type===f.TreeNodeType.CompositeTreeNode&&U.target.expanded)})})}else return o.default.createElement("div",{onClick:V,className:(0,s.default)(v.default.file_tree_node_segment,A,(0,b.getIcon)("arrow-right"),{[`${v.default.mod_collapsed}`]:!U.expanded})})},P=U=>{let V,H;S&&U instanceof f.PromptHandle?U instanceof f.RenamePromptHandle?(V=U.target.uri.resolve(U.$.value),H=g.Directory.is(U.target)):(V=U.parent.uri.resolve(U.$.value),H=U.type===f.TreeNodeType.CompositeTreeNode):(V=U.uri,H=U.filestat.isDirectory);const G=r.getIcon(V,{isDirectory:H});return o.default.createElement("div",{className:(0,s.default)(v.default.file_icon,G,{expanded:H&&U.expanded}),style:{height:e.FILE_TREE_NODE_HEIGHT,lineHeight:`${e.FILE_TREE_NODE_HEIGHT}px`}})},L=U=>m?o.default.createElement(m,null):S&&U instanceof f.PromptHandle?o.default.createElement("div",{className:(0,s.default)(v.default.file_tree_node_segment,v.default.file_tree_node_inputbox)},o.default.createElement("div",{className:(0,s.default)("input-box",v.default.file_tree_node_prompt_box)},o.default.createElement(U.ProxiedInput,{wrapperStyle:{height:e.FILE_TREE_NODE_HEIGHT,padding:"0 5px"}}))):o.default.createElement("div",{className:(0,s.default)(v.default.file_tree_node_segment,v.default.file_tree_node_displayname)},U.name),N=()=>o.default.createElement("div",{className:(0,s.default)(v.default.file_tree_node_segment,v.default.file_tree_node_tail)},k()),k=()=>null,B=U=>{if(I)return O(U,w);if(S)return O(U,()=>{})},F=()=>u.tooltip||u.name;return o.default.createElement("div",{key:u.id,onClick:D,title:F(),className:(0,s.default)(T,d?d.classlist:null),style:M,draggable:c===f.TreeNodeType.TreeNode||c===f.TreeNodeType.CompositeTreeNode},o.default.createElement("div",{className:(0,s.default)(v.default.file_tree_node_content)},B(u),P(u),o.default.createElement("div",{className:S?v.default.file_tree_node_prompt_wrap:v.default.file_tree_node_overflow_wrap},L(u)),N()))};e.FileTreeDialogNode=E,e.FILE_TREE_NODE_HEIGHT=22,e.FILE_TREE_BADGE_LIMIT=99},68195:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileDialogContextKey=void 0;const n=t(85608),s=t(76003),o=t(41869),f=t(66e3);let b=class{initScopedContext(v){this._contextKeyService=this.globalContextKeyService.createScoped(v),this.fileDialogViewVisibleContext=f.FileDialogViewVisibleContext.bind(this._contextKeyService)}get service(){return this._contextKeyService}};e.FileDialogContextKey=b,n.__decorate([(0,s.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],b.prototype,"globalContextKeyService",void 0),e.FileDialogContextKey=b=n.__decorate([(0,s.Injectable)()],b)},9018:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeDialogService=void 0;const n=t(85608),s=t(76003),o=t(97267),f=t(41869),b=t(26542),g=t(51500),v=t(6250),E=t(68195);let u=class extends o.Tree{constructor(c){super(),this._whenReady=this.resolveWorkspaceRoot(c)}get whenReady(){return this._whenReady}async resolveWorkspaceRoot(c){if(c){const r=new f.URI(c).withScheme(f.Schemes.file),l=await this.fileTreeAPI.resolveFileStat(r);l&&(this.workspaceRoot=l)}}async resolveChildren(c){if(c){if(c.uri){const{children:r}=await this.fileTreeAPI.resolveChildren(this,c.uri.toString(),c);return r}}else{this.workspaceRoot||(this.workspaceRoot=(await this.workspaceService.roots)[0]);const{children:r}=await this.fileTreeAPI.resolveChildren(this,this.workspaceRoot);return this.root=r[0],r}return[]}async resolveRoot(c){let r;/^file:\/\//.test(c)&&(r=new f.URI(c)),r=f.URI.file(c);const l=await this.fileTreeAPI.resolveFileStat(r);if(l){const{children:a}=await this.fileTreeAPI.resolveChildren(this,l);return this.root=a[0],a}}getDirectoryList(){const c=[];if(!this.root)return c;let r=new f.URI(this.workspaceRoot.uri);if(r&&r.parent)for(;r.parent;){const l=r.codeUri.fsPath;if(c.indexOf(l)>=0)break;c.push(l),r=r.parent}else c.push(r.codeUri.fsPath.toString());return c}sortComparator(c,r){return c.constructor===r.constructor?c.name.startsWith(".")&&!r.name.startsWith(".")?1:!c.name.startsWith(".")&&r.name.startsWith(".")?-1:c.name.localeCompare(r.name,"kn",{numeric:!0}):c.type===o.TreeNodeType.CompositeTreeNode?-1:r.type===o.TreeNodeType.CompositeTreeNode?1:0}initContextKey(c){c&&this.fileDialogContextKey.initScopedContext(c)}get contextKey(){return this.fileDialogContextKey}dispose(){super.dispose()}};e.FileTreeDialogService=u,n.__decorate([(0,s.Autowired)(v.IFileTreeAPI),n.__metadata("design:type",Object)],u.prototype,"fileTreeAPI",void 0),n.__decorate([(0,s.Autowired)(g.IWorkspaceService),n.__metadata("design:type",Object)],u.prototype,"workspaceService",void 0),n.__decorate([(0,s.Autowired)(b.LabelService),n.__metadata("design:type",b.LabelService)],u.prototype,"labelService",void 0),n.__decorate([(0,s.Autowired)(E.FileDialogContextKey),n.__metadata("design:type",E.FileDialogContextKey)],u.prototype,"fileDialogContextKey",void 0),e.FileTreeDialogService=u=n.__decorate([(0,s.Injectable)({multiple:!0}),n.__param(0,(0,s.Optional)()),n.__metadata("design:paramtypes",[String])],u)},51888:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileDialog=e.FILE_TREE_DIALOG_HEIGHT=void 0;const n=t(85608),s=n.__importStar(t(14041)),o=t(97267),f=t(41869),b=t(68974),g=t(72665),v=t(69748),E=n.__importDefault(t(13294));e.FILE_TREE_DIALOG_HEIGHT=22;const u=({options:h,model:c,isOpenDialog:r,fileService:l})=>{const a=(0,f.useInjectable)(g.IDialogService),d=(0,s.useRef)(null),[p,m]=(0,s.useState)(h.defaultFileName||""),[_,y]=(0,s.useState)(!1),[S,A]=(0,s.useState)(""),[T,D]=(0,s.useState)([]);(0,s.useEffect)(()=>{var z;return c&&(y(!1),R(),(z=l.contextKey.fileDialogViewVisibleContext)===null||z===void 0||z.set(!0)),()=>{c.dispose()}},[c]),(0,s.useEffect)(()=>{h.defaultFileName&&m(h.defaultFileName)},[h]),(0,s.useEffect)(()=>{if(_){const z=c.getDirectoryList();D(z)}},[_]);const w=(0,s.useCallback)(()=>{const z=c.selectedFiles.map(j=>j.uri.path.toString());if(p&&h.showNameInput&&(z?.length===1||h.defaultUri)){const j=z?.length===1?z[0]:h.defaultUri.path.toString();a.hide([f.path.join(j,p)])}else z.length>0?a.hide(z):h.defaultUri?a.hide([h.defaultUri.path.toString()]):c.treeModel&&c.treeModel.root?a.hide([c.treeModel.root.uri.path.toString()]):a.hide([]);y(!1),l.contextKey.fileDialogViewVisibleContext.set(!1)},[_,a,c,p,h]),I=(0,s.useCallback)(()=>{y(!1),a.hide(),l.contextKey.fileDialogViewVisibleContext.set(!1)},[_,a]),R=(0,s.useCallback)(async()=>{await c.whenReady,await c.treeModel.ensureReady,A(c.treeModel.root.uri.codeUri.fsPath),y(!0)},[c,S,_]),M=!r,O=(0,s.useCallback)(z=>{c.handleTreeHandler({...z,getModel:()=>c.treeModel})},[c]),P=(0,s.useCallback)((z,j)=>{z.stopPropagation();const{toggleDirectory:W}=c;W(j)},[c]),L=(0,s.useCallback)(z=>N(z)?!1:z.shiftKey,[]),N=(0,s.useCallback)(z=>{const{metaKey:j,ctrlKey:W}=z;return f.isMacintosh&&j||W},[]),k=(0,s.useCallback)((z,j,W)=>{var $;z.stopPropagation();const{handleItemClick:Y,handleItemToggleClick:Q,handleItemRangeClick:te}=c;if(!j)return;const re=L(event),ae=N(event);if(re&&!M&&h.canSelectMany)te(j,W);else if(ae&&!M&&h.canSelectMany)Q(j,W);else if(M)W===o.TreeNodeType.CompositeTreeNode&&Y(j,W);else if(h.canSelectFiles&&W===o.TreeNodeType.TreeNode){const ce=new Set(Object.values(($=h.filters)!==null&&$!==void 0?$:{}).flat().map(q=>`.${q}`));if(ce.size>0){const q=f.URI.parse(j.filestat.uri).path.ext;ce.has(q)&&Y(j,W)}else Y(j,W)}else h.canSelectFolders&&W===o.TreeNodeType.CompositeTreeNode&&Y(j,W)},[c,M,h]),B=(0,s.useCallback)(async z=>{y(!1),A(z),await c.updateTreeModel(z),y(!0)},[c,_,S]),F=(0,s.useCallback)(z=>s.default.createElement(v.FileTreeDialogNode,{item:z.item,itemType:z.itemType,labelService:c.labelService,decorations:c.decorations.getDecorations(z.item),onClick:k,onTwistierClick:P,defaultLeftPadding:8,leftPadding:8}),[c.treeModel]),U=(0,s.useCallback)(()=>{if(_){if(c.treeModel)return s.default.createElement(o.RecycleTree,{height:300,itemHeight:e.FILE_TREE_DIALOG_HEIGHT,onReady:O,model:c.treeModel},F)}else return s.default.createElement(b.Progress,{loading:!0})},[_,c]),V=(0,s.useCallback)(()=>{if(T.length>0)return s.default.createElement(o.Select,{onChange:B,className:E.default.select_control,size:"small",value:S},T.map((z,j)=>s.default.createElement(o.Option,{value:z,key:`${j} - ${z}`},z)))},[T,S]),H=(0,s.useCallback)(z=>{const{key:j}=f.KeyCode.createKeyCode(z),W=z.shiftKey||z.metaKey||z.altKey||z.ctrlKey;j&&f.Key.ENTER.keyCode===j.keyCode&&!W&&w()},[w]);(0,s.useEffect)(()=>{var z;return d.current&&(l.initContextKey(d.current),l.contextKey.fileDialogViewVisibleContext.set(!0),(z=d.current)===null||z===void 0||z.addEventListener("keyup",H)),()=>{var j;(j=d.current)===null||j===void 0||j.removeEventListener("keyup",H)}},[]);const G=(0,s.useMemo)(()=>s.default.createElement(s.default.Fragment,null,s.default.createElement("div",{className:E.default.file_dialog_directory},V()),s.default.createElement("div",{className:E.default.file_dialog_content},U())),[V,U]),K=(0,s.useMemo)(()=>s.default.createElement("div",{className:E.default.file_dialog_buttons},s.default.createElement(o.Button,{onClick:I,type:"secondary",className:E.default.button},(0,f.localize)("dialog.file.close")),s.default.createElement(o.Button,{onClick:w,type:"primary",className:E.default.button,disabled:M&&h.showNameInput&&p.length===0},r&&h.openLabel||(0,f.localize)("dialog.file.ok"))),[I,w,M,r,p,h]);return s.default.createElement("div",{className:E.default.file_dialog_wrapper,ref:d},s.default.createElement("div",{className:E.default.file_dialog_directory_title},r?h.title||(0,f.localize)("dialog.file.openLabel"):h.saveLabel||(0,f.localize)("dialog.file.saveLabel")),G,!r&&h.showNameInput&&s.default.createElement("div",{className:E.default.file_dialog_file_container},s.default.createElement("span",{className:E.default.file_dialog_file_name},(0,f.localize)("dialog.file.name"),": "),s.default.createElement(o.Input,{size:"small",value:p,autoFocus:!0,selection:{start:0,end:p.indexOf(".")||p.length},onChange:z=>m(z.target.value)})),K)};e.FileDialog=u},89508:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WindowDialogServiceImpl=void 0;const n=t(85608),s=n.__importDefault(t(14041)),o=t(76003),f=t(41869),b=t(37406),g=t(14951),v=t(72665),E=t(57942),u=n.__importDefault(t(13294)),h=t(9018),c=t(51888);let r=class{constructor(){this.idx=1,this._whenReady=this.init()}async init(){this.recentGlobalStorage=await this.storageProvider(f.STORAGE_NAMESPACE.GLOBAL_RECENT_DATA);const a=await this.recentGlobalStorage.get("RECENT_DIALOG_DEFAULT_URI");if(a)this._defaultUri=new f.URI(a);else{const d=await this.fileServiceClient.getCurrentUserHome();this._defaultUri=new f.URI(d.uri)}}get defaultUri(){return this._defaultUri}get whenReady(){return this._whenReady}async updateRecentDefaultUri(a){this.recentGlobalStorage.set("RECENT_DIALOG_DEFAULT_URI",a.toString()),this._defaultUri=a}async showOpenDialog(a={}){this.dialogService.reset(),await this.whenReady;const d={canSelectFiles:!0,canSelectFolders:!1,canSelectMany:!1};if(this.appConfig.isElectronRenderer&&!this.appConfig.isRemote){const p=this.injector.get(b.IElectronMainUIService),m=[];a.canSelectFiles&&m.push("openFile"),a.canSelectFolders&&m.push("openDirectory"),a.canSelectMany&&m.push("multiSelections"),f.isMacintosh&&m.push("treatPackageAsDirectory","createDirectory");const _=a.defaultUri||this.defaultUri,y=await p.showOpenDialog(f.electronEnv.currentWindowId,{defaultPath:_.codeUri.fsPath,title:a.title,buttonLabel:a.openLabel,properties:m});if(y&&y.length>0){const S=y.map(A=>f.URI.file(A));return this.updateRecentDefaultUri(S[0].parent),S}else return}else{a.defaultUri||(a.defaultUri=this.defaultUri);let p;a.defaultUri?p=this.injector.get(h.FileTreeDialogService,[a.defaultUri.toString()]):p=this.injector.get(h.FileTreeDialogService),await p.whenReady;const m=E.FileTreeDialogModel.createModel(this.injector,p),_=await this.dialogService.open({message:s.default.createElement(c.FileDialog,{key:this.idx++,fileService:p,model:m,options:{...d,...a},isOpenDialog:!0}),type:f.MessageType.Empty,buttons:[],closable:!0,props:{className:u.default.file_dialog_wrapper}});if(this.dialogService.reset(),_&&_.length>0){const y=_.map(S=>f.URI.file(S));return this.updateRecentDefaultUri(y[0].parent),y}else return}}async showSaveDialog(a={}){if(await this.whenReady,this.appConfig.isElectronRenderer&&!this.appConfig.isRemote){const d=a.defaultUri||this.defaultUri,m=await this.injector.get(b.IElectronMainUIService).showSaveDialog(f.electronEnv.currentWindowId,{defaultPath:d.resolve(a.defaultFileName||"").codeUri.fsPath,title:a.saveLabel,message:a.saveLabel});if(m){const _=f.URI.file(m);return this.updateRecentDefaultUri(_.parent),_}else return}else{a.defaultUri||(a.defaultUri=this.defaultUri);let d;a.defaultUri?d=this.injector.get(h.FileTreeDialogService,[a.defaultUri.toString()]):d=this.injector.get(h.FileTreeDialogService),await d.whenReady;const p=E.FileTreeDialogModel.createModel(this.injector,d),m=await this.dialogService.open({message:s.default.createElement(c.FileDialog,{key:this.idx++,fileService:d,model:p,options:a,isOpenDialog:!1}),type:f.MessageType.Empty,buttons:[],closable:!0,props:{className:u.default.file_dialog_wrapper}});if(this.dialogService.reset(),m&&m.length>0){const _=f.URI.file(m[0]);return this.updateRecentDefaultUri(_.parent),_}else return}}};e.WindowDialogServiceImpl=r,n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],r.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(v.IDialogService),n.__metadata("design:type",Object)],r.prototype,"dialogService",void 0),n.__decorate([(0,o.Autowired)(g.IFileServiceClient),n.__metadata("design:type",Object)],r.prototype,"fileServiceClient",void 0),n.__decorate([(0,o.Autowired)(f.StorageProvider),n.__metadata("design:type",Function)],r.prototype,"storageProvider",void 0),n.__decorate([(0,o.Autowired)(f.AppConfig),n.__metadata("design:type",Object)],r.prototype,"appConfig",void 0),e.WindowDialogServiceImpl=r=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],r)},88014:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileContextKey=void 0;const n=t(85608),s=t(76003),o=t(41869),f=t(16413);let b=class{constructor(){this.explorerResourceIsFolder=f.ExplorerResourceIsFolderContext.bind(this.globalContextKeyService),this.explorerViewletVisibleContext=f.ExplorerViewletVisibleContext.bind(this.globalContextKeyService)}initScopedContext(v){this._contextKeyService=this.globalContextKeyService.createScoped(v),this.explorerFocused=f.ExplorerFocusedContext.bind(this._contextKeyService),this.explorerResourceCut=f.ExplorerResourceCut.bind(this._contextKeyService),this.filesExplorerFocused=f.FilesExplorerFocusedContext.bind(this._contextKeyService),this.filesExplorerInputFocused=f.FilesExplorerInputFocusedContext.bind(this._contextKeyService),this.filesExplorerFilteredContext=f.FilesExplorerFilteredContext.bind(this._contextKeyService),this.explorerCompressedFocusContext=f.ExplorerCompressedFocusContext.bind(this._contextKeyService),this.explorerCompressedFirstFocusContext=f.ExplorerCompressedFirstFocusContext.bind(this._contextKeyService),this.explorerCompressedLastFocusContext=f.ExplorerCompressedLastFocusContext.bind(this._contextKeyService)}get service(){return this._contextKeyService}};e.FileContextKey=b,n.__decorate([(0,s.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],b.prototype,"globalContextKeyService",void 0),e.FileContextKey=b=n.__decorate([(0,s.Injectable)(),n.__metadata("design:paramtypes",[])],b)},40439:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeContribution=void 0;const n=t(85608),s=t(76003),o=t(41869),f=t(16413),b=t(93899),g=t(68969),v=t(98295),E=t(41893),u=t(54414),h=t(32595),c=t(63067),r=t(58296),l=t(72665),a=t(51500),d=t(6250),p=t(69959),m=t(56384),_=t(57781),y=t(97738),S=t(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(d.RESOURCE_VIEW_ID,{content:(0,o.formatLocalize)("welcome-view.noFolderHelp",o.FILE_COMMANDS.OPEN_FOLDER.id),group:r.ViewContentGroups.Open,order:1}),this.mainLayoutService.collectViewComponent({id:d.RESOURCE_VIEW_ID,name:this.getWorkspaceTitle(),weight:3,priority:9,collapsed:!1,component:m.FileTree},h.EXPLORER_CONTAINER_ID),this._disposables.add(this.workspaceService.onWorkspaceLocationChanged(()=>{const D=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);D&&D.updateViewTitle(d.RESOURCE_VIEW_ID,this.getWorkspaceTitle())}))}onDidStart(){const D=this.injector.get(S.SymlinkDecorationsProvider,[this.fileTreeService]);this.decorationService.registerDecorationsProvider(D)}onDidRender(){this.isRendered=!0;const D=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);D&&(this.fileTreeModelService.whenReady.then(()=>{this.fileTreeModelService.contextKey.explorerViewletVisibleContext.set(D.isActivated())}),D.onActivate(()=>{this.fileTreeModelService.performLocationOnHandleShow(),this.fileTreeModelService.contextKey.explorerViewletVisibleContext.set(!0)}),D.onInActivate(()=>{this.fileTreeModelService.handleTreeBlur(),this.fileTreeModelService.contextKey.explorerViewletVisibleContext.set(!1)}))}getWorkspaceTitle(){let D=(0,o.localize)("file.empty.defaultTitle");const w=this.workspaceService.workspace;return w&&(D=new o.URI(w.uri).displayName,!w.isDirectory&&D.endsWith(`.${this.workspaceService.workspaceSuffixName}`)&&(D=D.slice(0,D.lastIndexOf(".")),D===a.UNTITLED_WORKSPACE))?(0,o.localize)("file.workspace.defaultTip"):D}onReconnect(){this.fileTreeService.reWatch()}revealFile(D){if(D)if(this.isRendered){const w=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);!w||!w.isVisible||w.isCollapsed(d.RESOURCE_VIEW_ID)?this.fileTreeModelService.locationOnShow(D):this.fileTreeModelService.location(D)}else this.fileTreeModelService.locationOnShow(D)}registerMenus(D){D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.NEW_FILE.id,label:(0,o.localize)("file.new")},order:1,group:"0_new"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.NEW_FOLDER.id,label:(0,o.localize)("file.folder.new")},order:2,group:"0_new"}),D.registerMenuItem(b.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"}),D.registerMenuItem(b.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"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_RESOURCES.id,label:(0,o.localize)("file.open")},order:1,group:"1_open"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_TO_THE_SIDE.id,label:(0,o.localize)("file.open.side")},order:2,group:"1_open"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_TYPE_WITH.id,label:(0,o.localize)("file.open.type")},order:3,group:"1_open"}),D.registerMenuItem(b.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"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.SEARCH_ON_FOLDER.id,label:(0,o.localize)("file.search.folder")},order:1,group:"2_search"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.DELETE_FILE.id,label:(0,o.localize)("file.delete")},order:1,group:"7_modification"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.RENAME_FILE.id,label:(0,o.localize)("file.rename")},order:3,group:"7_modification"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COMPARE_SELECTED.id,label:(0,o.localize)("file.compare")},order:2,group:"3_compare"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_FILE.id,label:(0,o.localize)("file.copy.file")},order:1,group:"5_cutcopypaste"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.CUT_FILE.id,label:(0,o.localize)("file.cut.file")},order:2,group:"5_cutcopypaste"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.PASTE_FILE.id,label:(0,o.localize)("file.paste.file")},order:3,group:"5_cutcopypaste"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_PATH.id,label:(0,o.localize)("file.copy.path")},group:"6_copypath"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_RELATIVE_PATH.id,label:(0,o.localize)("file.copy.relativepath")},group:"6_copypath"})}registerCommands(D){const w=()=>{this.fileTreeService.filterMode&&this.fileTreeService.toggleFilterMode()};D.registerCommand(o.FILE_COMMANDS.OPEN_TERMINAL_WITH_PATH,{execute:R=>{let M=R;if(!M)return;const O=this.fileTreeService.getNodeByPathOrUri(M);O&&!O.filestat.isDirectory&&(M=O.uri.parent),this.commandService.executeCommand(o.TERMINAL_COMMANDS.OPEN_WITH_PATH.id,M)}}),D.registerCommand(o.FILE_COMMANDS.SEARCH_ON_FOLDER,{execute:async R=>{var M;let O=R;if(O||(this.fileTreeModelService.focusedFile?O=this.fileTreeModelService.focusedFile.uri:this.fileTreeModelService.selectedFiles.length>0&&(O=(M=this.fileTreeModelService.selectedFiles[0])===null||M===void 0?void 0:M.uri)),!O)return;let P;if(this.fileTreeService.isMultipleWorkspace)for(const L of await this.workspaceService.roots){const N=new o.URI(L.uri);if(N.isEqualOrParent(O)){P=`./${N.relative(O).toString()}`;break}}else if(this.workspaceService.workspace){const L=new o.URI(this.workspaceService.workspace.uri);L.isEqualOrParent(O)&&(P=`./${L.relative(O).toString()}`)}this.commandService.executeCommand(o.SEARCH_COMMANDS.OPEN_SEARCH.id,{includeValue:P+"/"})},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&p.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.LOCATION,{execute:R=>{R?this.revealFile(R):this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0&&this.revealFile(this.fileTreeModelService.selectedFiles[0].uri)}}),D.registerCommand(o.FILE_COMMANDS.LOCATION_WITH_EDITOR,{execute:()=>{var R,M,O;((M=(R=this.workbenchEditorService.currentEditor)===null||R===void 0?void 0:R.currentUri)===null||M===void 0?void 0:M.scheme)===o.Schemes.file&&this.revealFile((O=this.workbenchEditorService.currentEditor)===null||O===void 0?void 0:O.currentUri)}}),D.registerCommand(o.FILE_COMMANDS.COLLAPSE_ALL,{execute:()=>{const R=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);!R||!R.isVisible||this.fileTreeModelService.collapseAll()}}),D.registerCommand(o.FILE_COMMANDS.REFRESH_ALL,{execute:async()=>{const R=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);!R||!R.isVisible||await this.fileTreeService.refresh()}}),D.registerCommand(o.FILE_COMMANDS.DELETE_FILE,{execute:(R,M)=>{if(w(),M?this.willDeleteUris=this.willDeleteUris.concat(M):this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0?this.willDeleteUris=this.willDeleteUris.concat(this.fileTreeModelService.selectedFiles.map(O=>O.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)}),D.registerCommand(o.FILE_COMMANDS.RENAME_FILE,{execute:R=>{if(w(),!R)if(this.fileTreeModelService.contextMenuFile)R=this.fileTreeModelService.contextMenuFile.uri;else if(this.fileTreeModelService.focusedFile)R=this.fileTreeModelService.focusedFile.uri;else return;this.fileTreeModelService.renamePrompt(R)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),D.registerCommand(o.FILE_COMMANDS.NEW_FILE,{execute:async R=>{var M;if(w(),R)this.fileTreeModelService.newFilePrompt(R);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 O;this.fileTreeService.isMultipleWorkspace?O=new o.URI((await this.workspaceService.roots)[0].uri):O=new o.URI((M=this.workspaceService.workspace)===null||M===void 0?void 0:M.uri),this.fileTreeModelService.newFilePrompt(O)}}}),D.registerCommand(o.FILE_COMMANDS.NEW_FOLDER,{execute:async R=>{var M;if(w(),R)this.fileTreeModelService.newDirectoryPrompt(R);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 O;this.fileTreeService.isMultipleWorkspace?O=new o.URI((await this.workspaceService.roots)[0].uri):O=new o.URI((M=this.workspaceService.workspace)===null||M===void 0?void 0:M.uri),this.fileTreeModelService.newDirectoryPrompt(O)}}}),D.registerCommand(o.FILE_COMMANDS.COMPARE_SELECTED,{execute:(R,M)=>{if(M&&M.length){const O=this.workbenchEditorService.currentEditor;O&&O.currentUri&&this.fileTreeService.compare(M[0],O.currentUri)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!p.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.OPEN_RESOURCES,{execute:R=>{this.fileTreeService.openAndFixedFile(R)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!p.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.OPEN_TO_THE_SIDE,{execute:R=>{this.fileTreeService.openToTheSide(R)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!p.Directory.is(this.fileTreeModelService.contextMenuFile)});const I=(R,M)=>{const{availableOpenTypes:O,currentOpenType:P}=this.workbenchEditorService.currentEditorGroup;if(!(O&&R&&P))return{items:[],selectIndex:-1};const L=this.preferenceService.get("workbench.editorAssociations"),N=[],k=(V,H)=>H.type===u.EditorOpenType.code?V.type===u.EditorOpenType.code:H.type===u.EditorOpenType.component&&V.type===u.EditorOpenType.component?V.componentId===H.componentId:!1,B=(V,H)=>(V?V+=(0,o.localize)("file.open.type.detail.and")+H:V=H,V);let F,U;if(L){const V=Object.keys(L).find(H=>(0,o.match)(H,R.path.toString().toLowerCase())||(0,o.match)(H,R.path.base.toLowerCase()));F=V&&L[V]}return O.forEach((V,H)=>{var G;const K={label:V.title||V.componentId||V.type,detail:V.title,run:z=>M(z,V)};k(P,V)&&(K.description=B(K.description,(0,o.localize)("file.open.type.detail.active")),U=H),F&&(!((G=V.componentId)===null||G===void 0)&&G.endsWith(F))&&(K.description=B(K.description,(0,o.localize)("file.open.type.detail.default"))),N.push(new o.QuickOpenItem(K))}),{items:N,selectIndex:U}};D.registerCommand(o.FILE_COMMANDS.OPEN_TYPE_WITH,{execute:R=>{const M=(N,k)=>{var B,F;return N===o.Mode.OPEN?((B=this.workbenchEditorService.currentEditorGroup)===null||B===void 0||B.changeOpenType((F=k.componentId)!==null&&F!==void 0?F:k.type),!0):!1},{items:O,selectIndex:P}=I(R,M);if(O.length===0||typeof P>"u")return;const L=N=>{this.quickOpenService.open({onType:(k,B)=>B(N)},{fuzzyMatchLabel:!0,ignoreFocusOut:!1,placeholder:(0,o.formatLocalize)("file.open.type.placeholder",R.path.base),selectIndex:()=>P})};O.push(new o.QuickOpenItem({label:(0,o.formatLocalize)("file.open.type.preference.default",`*${R.path.ext}`),showBorder:!0,run:N=>{if(N===o.Mode.OPEN){const k=(U,V)=>{var H,G,K;if(U===o.Mode.OPEN){const z="workbench.editorAssociations",j=this.preferenceService.resolve(z).scope,W=this.preferenceService.get(z);return this.preferenceService.set(z,{...W||{},[`*${R.path.ext}`]:(H=V.componentId)!==null&&H!==void 0?H:V.type},j),(G=this.workbenchEditorService.currentEditorGroup)===null||G===void 0||G.changeOpenType((K=V.componentId)!==null&&K!==void 0?K:V.type),!0}return!1},{items:B,selectIndex:F}=I(R,k);if(B.length===0||typeof F>"u")return!0;L(B)}return!1}})),L(O)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!p.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.COPY_PATH,{execute:async R=>{if(!R)return;let O=R.path.toString();if(R.scheme===u.DIFF_SCHEME){const L=R.getParsedQuery();O=new o.URI(L.modified).path.toString()}let P=decodeURIComponent(O);await this.appService.backendOS===o.OperatingSystem.Windows&&(P=P.slice(1)),await this.clipboardService.writeText(P)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile}),D.registerCommand(o.FILE_COMMANDS.COPY_RELATIVE_PATH,{execute:async R=>{if(!R)return;if(R.scheme===u.DIFF_SCHEME){const O=R.getParsedQuery();R=new o.URI(O.modified).withScheme("file")}let M;if(this.fileTreeService.isMultipleWorkspace)for(const O of await this.workspaceService.roots){if(M=new o.URI(O.uri),M.isEqual(R))return await this.clipboardService.writeText("./");if(M.isEqualOrParent(R))return await this.clipboardService.writeText(decodeURIComponent(M.relative(R).toString()))}else if(this.workspaceService.workspace)return M=new o.URI(this.workspaceService.workspace.uri),M.isEqual(R)?await this.clipboardService.writeText("./"):await this.clipboardService.writeText(decodeURIComponent(M.relative(R).toString()))},isVisible:()=>!!this.fileTreeModelService.contextMenuFile}),D.registerCommand(o.FILE_COMMANDS.COPY_FILE,{execute:(R,M)=>{if(M&&M.length)this.fileTreeModelService.copyFile(M);else{const O=this.fileTreeModelService.selectedFiles.map(P=>P.uri);O&&O.length&&this.fileTreeModelService.copyFile(O)}},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)}),D.registerCommand(o.FILE_COMMANDS.SELECT_CURRENT_NODE,{execute:(R,M)=>{if(M&&M.length)this.fileTreeModelService.selectChildNode(M);else{const O=this.fileTreeModelService.selectedFiles.map(P=>P.uri);O&&O.length&&this.fileTreeModelService.selectChildNode(O)}},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)}),D.registerCommand(o.FILE_COMMANDS.CUT_FILE,{execute:(R,M)=>{if(M&&M.length)this.fileTreeModelService.cutFile(M);else{const O=this.fileTreeModelService.selectedFiles.map(P=>P.uri);O&&O.length&&this.fileTreeModelService.cutFile(O)}},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)}),D.registerCommand(o.FILE_COMMANDS.PASTE_FILE,{execute:R=>{if(w(),R)this.fileTreeModelService.pasteFile(R);else if(this.fileTreeModelService.focusedFile){let M;this.fileTreeModelService.activeUri?M=this.fileTreeModelService.activeUri:M=this.fileTreeModelService.focusedFile.uri,this.fileTreeModelService.pasteFile(M)}},isEnabled:()=>this.fileTreeModelService.pasteStore&&this.fileTreeModelService.pasteStore.type!==d.PasteTypes.NONE||this.appConfig.isElectronRenderer}),D.registerCommand(o.FILE_COMMANDS.VSCODE_OPEN_FOLDER,{execute:(R,M)=>{const O=this.injector.get(o.IWindowService),P={newWindow:!0};return typeof M=="boolean"?P.newWindow=M:P.newWindow=typeof M?.forceNewWindow=="boolean"?M.forceNewWindow:!0,R?O.openWorkspace(R,P):this.commandService.executeCommand(o.FILE_COMMANDS.OPEN_FOLDER.id,P)},isVisible:()=>{const R=this.preferenceService.get("application.supportsOpenFolder");return R??!1}}),D.registerCommand(o.FILE_COMMANDS.OPEN_FOLDER,{execute:R=>{const M=this.injector.get(o.IWindowService);this.appConfig.isElectronRenderer?this.injector.get(o.IElectronNativeDialogService).showOpenDialog({title:(0,o.localize)("workspace.openDirectory"),properties:["openDirectory"]}).then(P=>{P&&P.length>0&&M.openWorkspace(o.URI.file(P[0]),R||{newWindow:!0})}):this.injector.get(l.IWindowDialogService).showOpenDialog({title:(0,o.localize)("workspace.openDirectory"),canSelectFiles:!1,canSelectFolders:!0}).then(P=>{var L;P&&P.length>0&&this.injector.get(a.IWorkspaceService).open(P[0],{preserveWindow:(L=R?.newWindow)!==null&&L!==void 0?L:!1})})},isVisible:()=>{const R=this.preferenceService.get("application.supportsOpenFolder");return R??!1}}),D.registerCommand(o.FILE_COMMANDS.OPEN_WORKSPACE,{execute:R=>{if(!this.preferenceService.get("application.supportsOpenWorkspace"))return;const O=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(L=>{L&&L.length>0&&O.openWorkspace(o.URI.file(L[0]),R||{newWindow:!0})}):this.injector.get(l.IWindowDialogService).showOpenDialog({title:(0,o.localize)("workspace.openWorkspace"),canSelectFiles:!0,canSelectFolders:!1,canSelectMany:!1,filters:{workspace:[this.workspaceService.workspaceSuffixName]}}).then(L=>{var N;L&&L.length>0&&this.injector.get(a.IWorkspaceService).open(L[0],{preserveWindow:(N=R?.newWindow)!==null&&N!==void 0?N:!1})})},isVisible:()=>{const R=this.preferenceService.get("application.supportsOpenWorkspace");return R??!1}}),D.registerCommand(o.FILE_COMMANDS.REVEAL_IN_EXPLORER,{execute:R=>{var M;let O=R instanceof o.URI?R:R?.uri;const P=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);P&&!P.isVisible&&P.activate(),P&&P.isCollapsed(d.RESOURCE_VIEW_ID)&&P?.setCollapsed(d.RESOURCE_VIEW_ID,!1),!O&&(!((M=this.workbenchEditorService.currentEditor)===null||M===void 0)&&M.currentUri)&&(O=this.workbenchEditorService.currentEditor.currentUri),O&&this.revealFile(o.URI.parse(O.toString()))}}),D.registerCommand(o.FILE_COMMANDS.FOCUS_FILES,{execute:()=>{const R=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);R&&R.activate()}}),D.registerCommand(o.FILE_COMMANDS.OPEN_FILE,{execute:R=>this.windowDialogService.showOpenDialog(R)}),D.registerCommand(o.FILE_COMMANDS.SAVE_FILE,{execute:R=>this.windowDialogService.showSaveDialog(R)}),D.registerCommand(o.FILE_COMMANDS.FILTER_TOGGLE,{execute:()=>this.fileTreeService.toggleFilterMode()}),D.registerCommand(o.FILE_COMMANDS.FILTER_OPEN,{execute:()=>{if(!this.fileTreeService.filterMode)return this.fileTreeService.toggleFilterMode()}}),D.registerCommand(o.FILE_COMMANDS.FILTER_CLOSE,{execute:()=>{this.fileTreeService.filterMode&&this.fileTreeService.toggleFilterMode()}}),D.registerCommand(o.FILE_COMMANDS.NEXT,{execute:()=>{this.fileTreeModelService.moveToNext()}}),D.registerCommand(o.FILE_COMMANDS.PREV,{execute:()=>{this.fileTreeModelService.moveToPrev()}}),D.registerCommand(o.FILE_COMMANDS.COLLAPSE,{execute:()=>{this.fileTreeModelService.collapseCurrentFile()}}),D.registerCommand(o.FILE_COMMANDS.EXPAND,{execute:()=>{this.fileTreeModelService.expandCurrentFile()}}),D.registerCommand(o.FILE_COMMANDS.TOGGLE_OR_OPEN,{execute:()=>{this.fileTreeModelService.toggleOrOpenCurrentFile()}}),D.registerCommand(o.WORKSPACE_COMMANDS.REMOVE_WORKSPACE_FOLDER,{execute:async(R,M)=>{if(w(),!M.length||!this.workspaceService.isMultiRootWorkspaceOpened)return;const O=await this.workspaceService.roots,P=M.filter(L=>O.find(N=>N.uri===L.toString()));P.length>0&&await this.workspaceService.removeRoots(P)},isVisible:()=>this.workspaceService.isMultiRootWorkspaceOpened&&!!this.fileTreeModelService.contextMenuFile&&!!this.workspaceService.tryGetRoots().find(R=>{var M;return R.uri===((M=this.fileTreeModelService.contextMenuFile)===null||M===void 0?void 0:M.uri.toString())})})}registerKeybindings(D){D.registerKeybinding({command:o.FILE_COMMANDS.COPY_FILE.id,keybinding:"ctrlcmd+c",when:`${f.FilesExplorerFocusedContext.raw} && !${f.FilesExplorerInputFocusedContext.raw} && !${f.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.PASTE_FILE.id,keybinding:"ctrlcmd+v",when:`${f.FilesExplorerFocusedContext.raw} && !${f.FilesExplorerInputFocusedContext.raw} && !${f.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.CUT_FILE.id,keybinding:"ctrlcmd+x",when:`${f.FilesExplorerFocusedContext.raw} && !${f.FilesExplorerInputFocusedContext.raw} && !${f.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.SELECT_CURRENT_NODE.id,keybinding:"ctrlcmd+a",when:`${f.FilesExplorerFocusedContext.raw} && !${f.FilesExplorerInputFocusedContext.raw} && !${f.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.RENAME_FILE.id,keybinding:"enter",when:`${f.FilesExplorerFocusedContext.raw} && !${f.FilesExplorerInputFocusedContext.raw} && !${f.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.DELETE_FILE.id,keybinding:"ctrlcmd+backspace",when:`${f.FilesExplorerFocusedContext.raw} && !${f.FilesExplorerInputFocusedContext.raw} && !${f.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.FILTER_OPEN.id,keybinding:"ctrlcmd+f",when:`${f.FilesExplorerFocusedContext.raw} && !${f.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.FILTER_CLOSE.id,keybinding:"esc",when:`${f.FilesExplorerFocusedContext.raw} && ${f.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.NEXT.id,keybinding:"down",when:`${f.FilesExplorerFocusedContext.raw} && !${f.FilesExplorerInputFocusedContext.raw} && !${f.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.PREV.id,keybinding:"up",when:`${f.FilesExplorerFocusedContext.raw} && !${f.FilesExplorerInputFocusedContext.raw} && !${f.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.EXPAND.id,keybinding:"right",when:`${f.FilesExplorerFocusedContext.raw} && !${f.FilesExplorerInputFocusedContext.raw} && !${f.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.COLLAPSE.id,keybinding:"left",when:`${f.FilesExplorerFocusedContext.raw} && !${f.FilesExplorerInputFocusedContext.raw} && !${f.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.TOGGLE_OR_OPEN.id,keybinding:"space",when:`${f.FilesExplorerFocusedContext.raw} && !${f.FilesExplorerInputFocusedContext.raw} && !${f.FilesExplorerFilteredContext.raw}`})}registerToolbarItems(D){D.registerItem({id:o.FILE_COMMANDS.LOCATION_WITH_EDITOR.id,command:o.FILE_COMMANDS.LOCATION_WITH_EDITOR.id,label:(0,o.localize)("file.location"),viewId:d.RESOURCE_VIEW_ID,when:`view == '${d.RESOURCE_VIEW_ID}' && !config.explorer.autoReveal && !${f.FilesExplorerFilteredContext.raw}`,order:0}),D.registerItem({id:o.FILE_COMMANDS.NEW_FILE.id,command:o.FILE_COMMANDS.NEW_FILE.id,label:(0,o.localize)("file.new"),viewId:d.RESOURCE_VIEW_ID,when:`view == '${d.RESOURCE_VIEW_ID}' && !${f.FilesExplorerFilteredContext.raw}`,order:1}),D.registerItem({id:o.FILE_COMMANDS.NEW_FOLDER.id,command:o.FILE_COMMANDS.NEW_FOLDER.id,label:(0,o.localize)("file.folder.new"),viewId:d.RESOURCE_VIEW_ID,when:`view == '${d.RESOURCE_VIEW_ID}' && !${f.FilesExplorerFilteredContext.raw}`,order:2}),D.registerItem({id:o.FILE_COMMANDS.FILTER_TOGGLE.id,command:o.FILE_COMMANDS.FILTER_TOGGLE.id,label:(0,o.localize)("file.filetree.filter"),viewId:d.RESOURCE_VIEW_ID,toggledWhen:`${f.FilesExplorerFilteredContext.raw}`,order:3}),D.registerItem({id:o.FILE_COMMANDS.REFRESH_ALL.id,command:o.FILE_COMMANDS.REFRESH_ALL.id,label:(0,o.localize)("file.refresh"),viewId:d.RESOURCE_VIEW_ID,when:`view == '${d.RESOURCE_VIEW_ID}' && !${f.FilesExplorerFilteredContext.raw}`,order:4}),D.registerItem({id:o.FILE_COMMANDS.COLLAPSE_ALL.id,command:o.FILE_COMMANDS.COLLAPSE_ALL.id,label:(0,o.localize)("file.collapse"),viewId:d.RESOURCE_VIEW_ID,order:5}),D.registerItem({id:o.WORKSPACE_COMMANDS.ADD_WORKSPACE_FOLDER.id,command:o.WORKSPACE_COMMANDS.ADD_WORKSPACE_FOLDER.id,label:(0,o.localize)("workspace.addFolderToWorkspace"),viewId:d.RESOURCE_VIEW_ID,order:0,group:"file_explore_workspace",when:"config.workspace.supportMultiRootWorkspace"})}doDelete(){const D=this.willDeleteUris.slice();return this.willDeleteUris=[],this.fileTreeModelService.deleteFileByUris(D)}dispose(){this._disposables.dispose()}};e.FileTreeContribution=A,n.__decorate([(0,s.Autowired)(s.INJECTOR_TOKEN),n.__metadata("design:type",s.Injector)],A.prototype,"injector",void 0),n.__decorate([(0,s.Autowired)(d.IFileTreeService),n.__metadata("design:type",_.FileTreeService)],A.prototype,"fileTreeService",void 0),n.__decorate([(0,s.Autowired)(c.IMainLayoutService),n.__metadata("design:type",Object)],A.prototype,"mainLayoutService",void 0),n.__decorate([(0,s.Autowired)(g.IProgressService),n.__metadata("design:type",Object)],A.prototype,"progressService",void 0),n.__decorate([(0,s.Autowired)(a.IWorkspaceService),n.__metadata("design:type",Object)],A.prototype,"workspaceService",void 0),n.__decorate([(0,s.Autowired)(y.FileTreeModelService),n.__metadata("design:type",y.FileTreeModelService)],A.prototype,"fileTreeModelService",void 0),n.__decorate([(0,s.Autowired)(E.IDecorationsService),n.__metadata("design:type",E.IDecorationsService)],A.prototype,"decorationService",void 0),n.__decorate([(0,s.Autowired)(u.WorkbenchEditorService),n.__metadata("design:type",u.WorkbenchEditorService)],A.prototype,"workbenchEditorService",void 0),n.__decorate([(0,s.Autowired)(o.CommandService),n.__metadata("design:type",Object)],A.prototype,"commandService",void 0),n.__decorate([(0,s.Autowired)(l.IWindowDialogService),n.__metadata("design:type",Object)],A.prototype,"windowDialogService",void 0),n.__decorate([(0,s.Autowired)(o.IClipboardService),n.__metadata("design:type",Object)],A.prototype,"clipboardService",void 0),n.__decorate([(0,s.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],A.prototype,"preferenceService",void 0),n.__decorate([(0,s.Autowired)(o.QuickOpenService),n.__metadata("design:type",Object)],A.prototype,"quickOpenService",void 0),n.__decorate([(0,s.Autowired)(c.IViewsRegistry),n.__metadata("design:type",Object)],A.prototype,"viewsRegistry",void 0),n.__decorate([(0,s.Autowired)(o.IApplicationService),n.__metadata("design:type",Object)],A.prototype,"appService",void 0),n.__decorate([(0,s.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],A.prototype,"appConfig",void 0),e.FileTreeContribution=A=n.__decorate([(0,v.Domain)(b.MenuContribution,o.CommandContribution,o.KeybindingContribution,o.TabBarToolbarContribution,o.ClientAppContribution,c.MainLayoutContribution)],A)},2812:(x,e,t)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeModel=void 0;const s=t(85608),o=t(76003),f=t(97267),b=t(41869),g=t(69959),v=t(93239);let E=n=class extends f.TreeModel{constructor(h){super(),this.flushDispatchChangeDelayer=new b.ThrottledDelayer(n.DEFAULT_FLUSH_DELAY),this.init(h)}init(h){this.root=h,this.root.watcher.on(f.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()})}};e.FileTreeModel=E,E.DEFAULT_FLUSH_DELAY=100,s.__decorate([(0,o.Autowired)(v.FileTreeDecorationService),s.__metadata("design:type",v.FileTreeDecorationService)],E.prototype,"decorationService",void 0),e.FileTreeModel=E=n=s.__decorate([(0,o.Injectable)({multiple:!0}),s.__param(0,(0,o.Optional)()),s.__metadata("design:paramtypes",[g.Directory])],E)},46377:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FILE_TREE_BADGE_LIMIT=e.FILE_TREE_NODE_HEIGHT=e.FileTreeNode=void 0;const n=t(85608),s=n.__importDefault(t(53373)),o=n.__importDefault(t(14041)),f=t(97267),b=t(41869),g=t(69959),v=n.__importDefault(t(89200)),{Path:E}=b.path,u=({item:h,onClick:c,onDoubleClick:r,onContextMenu:l,dndService:a,itemType:d,decorationService:p,labelService:m,leftPadding:_=8,onTwistierClick:y,decorations:S,defaultLeftPadding:A=8,template:T,hasFolderIcons:D,hasFileIcons:w,hidesExplorerArrows:I,hasPrompt:R,iconService:M})=>{const[O,P]=o.default.useState(-1),L=d===f.TreeNodeType.RenamePrompt,N=d===f.TreeNodeType.NewPrompt,k=L||N,B=!k&&h.name.indexOf(E.separator)>=0,F=(0,b.useDesignStyles)(v.default.expansion_toggle,"expansion_toggle"),U=(0,b.useDesignStyles)(v.default.file_tree_node,"file_tree_node"),V=k?null:p.getDecoration(h.uri,g.Directory.is(h)),H=ge=>{(d===f.TreeNodeType.TreeNode||d===f.TreeNodeType.CompositeTreeNode)&&(B&&P(h.name.split(E.separator).length-1),c(ge,h,d))},G=ge=>{(d===f.TreeNodeType.TreeNode||d===f.TreeNodeType.CompositeTreeNode)&&(B&&P(h.name.split(E.separator).length-1),r(ge,h,d))},K=ge=>{(d===f.TreeNodeType.TreeNode||d===f.TreeNodeType.CompositeTreeNode)&&(y?y(ge,h,d):c(ge,h,d))},z=o.default.useCallback(ge=>{ge.nativeEvent.which!==0&&(d===f.TreeNodeType.TreeNode||d===f.TreeNodeType.CompositeTreeNode)&&l(ge,h,d)},[l,h]),j=o.default.useCallback(ge=>{const{handleDragStart:ee}=a;(d===f.TreeNodeType.TreeNode||d===f.TreeNodeType.CompositeTreeNode)&&ee(ge,h)},[a,h]),W=o.default.useCallback(ge=>{const{handleDragLeave:ee}=a;(d===f.TreeNodeType.TreeNode||d===f.TreeNodeType.CompositeTreeNode)&&ee(ge,h)},[a,h]),$=o.default.useCallback(ge=>{const{handleDragEnter:ee}=a;(d===f.TreeNodeType.TreeNode||d===f.TreeNodeType.CompositeTreeNode)&&ee(ge,h)},[a,h]),Y=o.default.useCallback(ge=>{const{handleDrop:ee}=a;(d===f.TreeNodeType.TreeNode||d===f.TreeNodeType.CompositeTreeNode)&&ee(ge,h)},[a,h]),Q=o.default.useCallback(ge=>{const{handleDragOver:ee}=a;(d===f.TreeNodeType.TreeNode||d===f.TreeNodeType.CompositeTreeNode)&&ee(ge,h)},[a,h]);let te=d===f.TreeNodeType.CompositeTreeNode,re;k?N?(te=h.type===f.TreeNodeType.CompositeTreeNode,re=`${A+(h.parent.depth+1||0)*(_||0)+(te?0:D?I?0:20:0)}px`):(te=h.target.type===f.TreeNodeType.CompositeTreeNode,re=`${A+(h.target.depth||0)*(_||0)+(te?0:D?I?0:20:0)}px`):re=`${A+(h.depth||0)*(_||0)+(te?0:D?I?0:20:0)}px`;const ae={color:V?V.color:"",height:e.FILE_TREE_NODE_HEIGHT,lineHeight:`${e.FILE_TREE_NODE_HEIGHT}px`,paddingLeft:re,opacity:R&&!k?".6":"1"},ce=(ge,ee)=>{if(S&&S?.classlist.indexOf(v.default.mod_loading)>-1)return o.default.createElement(f.Loading,null);if(k&&ge instanceof f.PromptHandle){let X=!1;if(L?X=ge.target.type===f.TreeNodeType.CompositeTreeNode:X=ge.type===f.TreeNodeType.CompositeTreeNode,X)return o.default.createElement("div",{className:(0,s.default)(v.default.file_tree_node_segment,F,(0,b.getIcon)("arrow-right"),{[`${v.default.mod_collapsed}`]:N||!(L&&ge.target.type===f.TreeNodeType.CompositeTreeNode&&ge.target.expanded)})})}else return o.default.createElement("div",{onClick:ee,className:(0,s.default)(v.default.file_tree_node_segment,F,(0,b.getIcon)("arrow-right"),{[`${v.default.mod_collapsed}`]:!ge.expanded})})},q=ge=>{let ee,X;k&&ge instanceof f.PromptHandle?ge instanceof f.RenamePromptHandle?(ee=ge.target.uri.resolve(ge.$.value),X=g.Directory.is(ge.target)):(ee=ge.parent.uri.resolve(ge.$.value),X=ge.type===f.TreeNodeType.CompositeTreeNode):(ee=ge.uri,X=ge.filestat.isDirectory);const ie=m.getIcon(ee,{isDirectory:X,isOpenedDirectory:X&&ge.expanded});return X&&!D||!X&&!w?null:o.default.createElement("div",{className:(0,s.default)(v.default.file_icon,ie,{expanded:X&&ge.expanded}),style:{height:e.FILE_TREE_NODE_HEIGHT,lineHeight:`${e.FILE_TREE_NODE_HEIGHT}px`}})},_e=ge=>{if(T)return o.default.createElement(T,null);if(k&&ge instanceof f.PromptHandle)return o.default.createElement("div",{className:(0,s.default)(v.default.file_tree_node_segment,v.default.file_tree_node_inputbox)},o.default.createElement("div",{className:(0,s.default)("input-box",v.default.file_tree_node_prompt_box)},o.default.createElement(ge.ProxiedInput,{wrapperStyle:{height:e.FILE_TREE_NODE_HEIGHT,padding:"0 5px"}})));if(B){const ee=ge.displayName.split(E.separator),X=ee.map((ie,se)=>{const he=ee.slice(0,se+1).join(E.separator),ue=Ae=>{Ae.stopPropagation(),P(se);const Ie=h.parent.uri.resolve(ee.slice(0,se+1).join(E.separator));c(Ae,h,d,Ie)},ve=Ae=>{Ae.stopPropagation(),P(se);const Ie=h.parent.uri.resolve(ee.slice(0,se+1).join(E.separator));l(Ae,h,d,Ie)},ne=Ae=>{Ae.stopPropagation(),Ae.preventDefault(),O!==se&&(P(se),a.handleDragOver(Ae,h))},fe=Ae=>{Ae.stopPropagation(),Ae.preventDefault(),P(-1)},Ce=Ae=>{Ae.stopPropagation(),O!==se&&P(se);const Ie=h.parent.uri.resolve(ee.slice(0,se+1).join(E.separator));a.handleDragStart(Ae,h,Ie)},be=Ae=>{Ae.stopPropagation();const Ie=h.parent.uri.resolve(ee.slice(0,se+1).join(E.separator));a.handleDrop(Ae,h,Ie)},Se=(0,s.default)(O===se&&v.default.active,v.default.compact_name);return o.default.createElement("span",{key:he},o.default.createElement("a",{className:Se,draggable:!0,onContextMenu:ve,onDragStart:Ce,onDragOver:ne,onDragLeave:fe,onDrop:be,onClick:ue},ie),se!==ee.length-1?o.default.createElement("span",{className:v.default.compact_name_separator},E.separator):null)});return o.default.createElement("div",{className:(0,s.default)(v.default.file_tree_node_segment,v.default.file_tree_node_displayname)},X)}return o.default.createElement("div",{className:(0,s.default)(v.default.file_tree_node_segment,v.default.file_tree_node_displayname)},m.getName(ge.uri)||ge.displayName)},pe=()=>o.default.createElement("div",{className:(0,s.default)(v.default.file_tree_node_segment,v.default.file_tree_node_tail)},Z()),Z=()=>V?o.default.createElement("div",{className:v.default.file_tree_node_status},(0,b.transformLabelWithCodicon)(V.badge.slice(),{color:"inherit"},M.fromString.bind(M))):null,le=ge=>{if(I)return null;if(te)return ce(ge,K);if(k)return ce(ge,()=>{})},oe=()=>{let ge=h.tooltip;return V&&V.badge&&(ge+=` \u2022 ${V.tooltip}`),ge};return o.default.createElement("div",{key:h.id,onClick:H,onDoubleClick:G,onContextMenu:z,onDragStart:j,onDragOver:Q,onDragEnter:$,onDragLeave:W,onDrop:Y,title:oe(),className:(0,s.default)(U,S?S.classlist:null),style:ae,draggable:d===f.TreeNodeType.TreeNode||d===f.TreeNodeType.CompositeTreeNode,"data-id":h.id},o.default.createElement("div",{className:(0,s.default)(v.default.file_tree_node_content)},le(h),q(h),o.default.createElement("div",{className:k?v.default.file_tree_node_prompt_wrap:v.default.file_tree_node_overflow_wrap},_e(h)),pe()))};e.FileTreeNode=u,e.FILE_TREE_NODE_HEIGHT=22,e.FILE_TREE_BADGE_LIMIT=99},56384:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTree=e.FILE_TREE_FILTER_DELAY=e.FILTER_AREA_HEIGHT=void 0;const n=t(85608),s=n.__importDefault(t(53373)),o=n.__importStar(t(14041)),f=t(97267),b=t(41869),g=t(68974),v=t(24429),E=t(87420),u=t(6250),h=t(46377),c=n.__importDefault(t(2613)),r=t(97738);e.FILTER_AREA_HEIGHT=30,e.FILE_TREE_FILTER_DELAY=500;const l=(0,f.RecycleTreeFilterDecorator)(f.RecycleTree),a=({viewState:p})=>{const[m,_]=(0,o.useState)(!1),[y,S]=(0,o.useState)(!0),[A,T]=(0,o.useState)(!1),[D,w]=(0,o.useState)(!1),[I,R]=(0,o.useState)(),M=(0,o.useRef)(null),O=(0,o.useRef)(new b.DisposableCollection),{height:P}=p,L=(0,b.useInjectable)(u.IFileTreeService),{iconService:N,locationToCurrentFile:k,filterMode:B,indent:F,baseIndent:U}=L,V=(0,b.useInjectable)(r.FileTreeModelService),[H,G]=(0,o.useState)({indent:F,baseIndent:U}),[K,z]=(0,o.useState)(B),[j,W]=(0,o.useState)(N.currentTheme||{hasFolderIcons:!0,hasFileIcons:!0,hidesExplorerArrows:!0}),$=(0,o.useCallback)(he=>Y(he)?!1:he.shiftKey,[]),Y=(0,o.useCallback)(he=>{const{metaKey:ue,ctrlKey:ve}=he;return b.isOSX&&ue||ve},[]),Q=(0,o.useCallback)((he,ue,ve,ne)=>{he.stopPropagation();const{handleItemClick:fe,handleItemToggleClick:Ce,handleItemRangeClick:be}=V;if(!ue)return;const Se=$(he),Ae=Y(he);Se?be(ue,ve):Ae?Ce(ue,ve):fe(ue,ve,ne)},[]),te=(0,o.useCallback)((he,ue,ve)=>{he.stopPropagation();const{handleItemDoubleClick:ne}=V;ue&&ne(ue,ve)},[]),re=(0,o.useCallback)((he,ue)=>{he.stopPropagation();const{toggleDirectory:ve}=V;ve(ue)},[]);(0,o.useEffect)(()=>{m&&V.onFileTreeModelChange(async he=>{S(!0),he&&await he.ensureReady,R(he),S(!1)})},[m]),(0,o.useEffect)(()=>{var he,ue,ve;const ne=new b.CancellationTokenSource;return q(ne.token),(he=O.current)===null||he===void 0||he.push(N.onThemeChange(fe=>{W(fe)})),(ue=O.current)===null||ue===void 0||ue.push(L.onTreeIndentChange(({indent:fe,baseIndent:Ce})=>{G({indent:fe,baseIndent:Ce})})),(ve=O.current)===null||ve===void 0||ve.push(L.onFilterModeChange(fe=>{z(fe)})),()=>{var fe;ne.cancel(),(fe=O.current)===null||fe===void 0||fe.dispose()}},[]);const ae=(0,o.useCallback)((he,ue)=>{let ve;if(he&&ue)for(ve=he.parentNode;ve;){if(ue===ve)return!0;ve=ve.parentNode}return!1},[]),ce=(0,o.useCallback)(he=>{ae(he.relatedTarget,M.current)||!he.relatedTarget||(T(!1),V.handleTreeBlur())},[M.current]);(0,o.useEffect)(()=>{K||(V.fileTreeHandle&&V.fileTreeHandle.clearFilter(),V.selectedFiles.length===1&&V.location(V.selectedFiles[0].uri))},[K]),(0,o.useEffect)(()=>{const he=new b.DisposableCollection;return I&&(he.push(V.onDidFocusedFileChange(ue=>{ue?ue.isEqual((I?.root).uri)?A||T(!A):A&&T(!A):ue||A&&T(!A)})),he.push(V.onDidContextMenuFileChange(ue=>{ue?ue.isEqual((I?.root).uri)?A||T(!A):A&&T(!A):ue||A&&T(!A)}))),()=>{he.dispose()}},[I,A]);const q=(0,o.useCallback)(async he=>{var ue;if(await V.whenReady,!he.isCancellationRequested){if(V.treeModel){if(await V.treeModel.ensureReady,R(V.treeModel),he.isCancellationRequested)return;M.current&&L.initContextKey(M.current)}S(!1),!((ue=O.current)===null||ue===void 0)&&ue.disposed||_(!0)}},[V,O.current]),_e=(0,o.useCallback)(he=>{V.handleTreeHandler({...he,getModel:()=>V.treeModel,hasDirectFocus:()=>M.current===document.activeElement})},[M.current,I]),pe=(0,o.useCallback)(()=>{const{handleItemClick:he}=V;he()},[]),Z=(0,o.useCallback)(()=>{V.handleDblClick()},[]),le=(0,o.useCallback)(()=>{const{handleTreeFocus:he}=V;he()},[]),oe=(0,o.useCallback)(he=>{const{handleContextMenu:ue}=V;ue(he)},[]),ge=(0,o.useCallback)(he=>{he.stopPropagation(),he.preventDefault()},[]),ee=(0,o.useCallback)(he=>{he.preventDefault(),w(!0)},[]),X=(0,o.useCallback)(()=>{w(!1)},[]),ie=(0,o.useCallback)(he=>{const{handleDrop:ue}=V.dndService;w(!1),ue(he)},[]),se=(0,o.useCallback)((he,ue,ve,ne)=>{const{handleContextMenu:fe}=V;fe(he,ue,ne)},[]);return o.default.createElement("div",{className:(0,s.default)(c.default.file_tree,D&&c.default.outer_drag_over,A&&c.default.outer_active),tabIndex:-1,ref:M,onClick:pe,onDoubleClick:Z,onFocus:le,onBlur:ce,onContextMenu:oe,draggable:!0,onDragStart:ge,onDragLeave:X,onDragOver:ee,onDrop:ie},o.default.createElement(d,{isLoading:y,isReady:m,height:P,model:I,iconTheme:j,treeIndent:H,filterMode:K,locationToCurrentFile:k,onTreeReady:_e,onContextMenu:se,onItemClick:Q,onItemDoubleClick:te,onTwistierClick:re}))};e.FileTree=a;const d=(0,o.memo)(({isReady:p,isLoading:m,height:_,model:y,filterMode:S,treeIndent:A,iconTheme:T,onTreeReady:D,onItemClick:w,onItemDoubleClick:I,onContextMenu:R,onTwistierClick:M})=>{const O=(0,b.useInjectable)(u.IFileTreeService),P=(0,b.useInjectable)(E.IIconService),{decorationService:L,labelService:N,locationToCurrentFile:k}=O,B=(0,b.useInjectable)(r.FileTreeModelService),F=(0,o.useCallback)(U=>o.default.createElement(h.FileTreeNode,{item:U.item,itemType:U.itemType,template:U.template,decorationService:L,labelService:N,iconService:P,dndService:B.dndService,decorations:B.decorations.getDecorations(U.item),onClick:w,onDoubleClick:I,onTwistierClick:M,onContextMenu:R,defaultLeftPadding:A.baseIndent,leftPadding:A.indent,hasPrompt:U.hasPrompt,hasFolderIcons:T.hasFolderIcons,hasFileIcons:T.hasFileIcons,hidesExplorerArrows:T.hidesExplorerArrows}),[y,A,T]);return p?m?o.default.createElement(g.Progress,{loading:!0}):y?o.default.createElement(l,{height:_,itemHeight:h.FILE_TREE_NODE_HEIGHT,onReady:D,model:y,filterEnabled:S,filterAfterClear:k,filterAutoFocus:!0,leaveBottomBlank:!0},F):o.default.createElement(v.WelcomeView,{viewId:u.FILE_EXPLORER_WELCOME_ID}):o.default.createElement(g.Progress,{loading:!0})});d.displayName="FileTreeView"},57781:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeService=void 0;const n=t(85608),s=t(76003),o=t(97267),f=t(41869),b=t(18193),g=t(26542),v=t(42933),E=t(52416),u=t(51500),h=t(6250),c=t(69959),r=t(88014),l=t(93239),{Path:a}=f.path;let d=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 f.Emitter,this.onTreeIndentChangeEmitter=new f.Emitter,this.onFilterModeChangeEmitter=new f.Emitter,this.onNodeRefreshedEmitter=new f.Emitter,this._filterMode=!1,this._refreshable=!0,this.refreshEffectNode=()=>{const m=this.effectedNodes.slice(0);if(this.effectedNodes=[],m.find(y=>c.Directory.isRoot(y)))this.refresh();else for(const y of m)this.refresh(y)},this.flushEventQueue=async()=>{if(!this._changeEventDispatchQueue||this._changeEventDispatchQueue.size===0)return;const m=Array.from(this._changeEventDispatchQueue),_=this.sortPaths(m);(!this.refreshCancelToken||this.refreshCancelToken.token.isCancellationRequested)&&(this.refreshCancelToken=new f.CancellationTokenSource);const y=(0,f.pSeries)(_.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(f.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(m=>{this._roots=m;const _=new f.URI(m[0].uri),y=new c.Directory(this,void 0,_,_.displayName,m[0],this.fileTreeAPI.getReadableTooltip(_));this.root=y,this.onWorkspaceChangeEmitter.fire(y),this.refresh()})),this.toDispose.push(this.workspaceService.onWorkspaceFileExcludeChanged(()=>{this.refresh()})),this.toDispose.push(f.Disposable.create(()=>{var m;(m=this._root)===null||m===void 0||m.dispose(),this._roots=null})),this.toDispose.push(this.corePreferences.onPreferenceChanged(m=>{m.preferenceName==="explorer.fileTree.baseIndent"?(this._baseIndent=m.newValue||8,this.onTreeIndentChangeEmitter.fire({indent:this.indent,baseIndent:this.baseIndent})):m.preferenceName==="explorer.fileTree.indent"?(this._indent=m.newValue||8,this.onTreeIndentChangeEmitter.fire({indent:this.indent,baseIndent:this.baseIndent})):m.preferenceName==="explorer.compactFolders"&&(this._isCompactMode=m.newValue,this.refresh())}))}initContextKey(m){this.fileContextKey.initScopedContext(m)}startWatchFileEvent(){return this._readyToWatch=!0,Promise.all(this._watchRootsQueue.map(m=>this.watchFilesChange(m)))}async resolveChildren(m){var _,y,S,A;let T=[];if(m){if(c.Directory.isRoot(m)&&this.isMultipleWorkspace){const D=await this.workspaceService.roots;for(const w of D){const I=this.fileTreeAPI.toNode(this,w,m,this.workspaceService.getWorkspaceName(new f.URI(w.uri)));this.watchFilesChange(new f.URI(w.uri)),T=T.concat(I),(I.filestat.isSymbolicLink||I.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(I.filestat.uri,I)}return T}if(m.uri){const D=await this.fileTreeAPI.resolveChildren(this,m.uri.toString(),m,this.isCompactMode&&!c.Directory.isRoot(m));T=D.children,T.forEach(I=>{(I.filestat.isSymbolicLink||I.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(I.filestat.uri,I)});const w=D.filestat;if(w&&this.isCompactMode&&!c.Directory.isRoot(m)){const I=new f.URI(w.uri),R=m.parent;if(m&&R){let M=m.name;if(m.filestat.isSymbolicLink){const O=(y=new f.URI(m.filestat.realUri).relative(I))===null||y===void 0?void 0:y.toString();O&&(M=O,M=[m.uri.displayName].concat(M.split(a.separator)).join(a.separator))}else R.filestat.isSymbolicLink?M=(S=new f.URI(R.filestat.realUri).relative(I))===null||S===void 0?void 0:S.toString():M=(A=R.uri.relative(I))===null||A===void 0?void 0:A.toString();M&&M!==m.name&&m.updateMetaData({name:M,uri:I,tooltip:this.fileTreeAPI.getReadableTooltip(I),fileStat:w})}}return T}}else if(this._roots||(this._roots=await this.workspaceService.roots),this.isMultipleWorkspace){const D=new f.URI((_=this.workspaceService.workspace)===null||_===void 0?void 0:_.uri);let w=D.displayName;w=w.slice(0,w.lastIndexOf("."));const I={...this.workspaceService.workspace,isDirectory:!0},R=new c.Directory(this,void 0,D,w,I,this.fileTreeAPI.getReadableTooltip(D));return this.root=R,[R]}else if(this._roots.length>0)return T=await(await this.fileTreeAPI.resolveChildren(this,this._roots[0])).children,T.forEach(D=>{const w=this.workspaceService.getWorkspaceName(D.uri);w&&w!==D.name&&D.updateMetaData({name:w}),(D.filestat.isSymbolicLink||D.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(D.filestat.uri,D)}),this.watchFilesChange(new f.URI(this._roots[0].uri)),this.root=T[0],T;return[]}async watchFilesChange(m){if(!this._readyToWatch){this._watchRootsQueue.push(m);return}const _=await this.fileServiceClient.watchFileChanges(m);this.toDispose.push(_),this.toDispose.push(_.onFilesChanged(y=>{this.onFilesChanged(y)})),this._fileServiceWatchers.set(m.toString(),_)}updateRefreshable(m){var _;m!==this.refreshable&&(this._refreshable=m,this._refreshable?this.doHandleQueueChange():(_=this.refreshCancelToken)===null||_===void 0||_.cancel())}isContentFile(m){return!!m&&"filestat"in m&&!m.filestat.isDirectory}isFileContentChanged(m){return m.type===v.FileChangeType.UPDATED&&this.isContentFile(this.getNodeByPathOrUri(m.uri))}getAffectedChanges(m){const _=[];for(const y of m)this.isFileContentChanged(y)||_.push(y);return _}isRootAffected(m){return this._roots?m.some(_=>_.type>v.FileChangeType.UPDATED&&this._roots&&this._roots.find(y=>_.uri.indexOf(y.uri)>=0)):!1}async onFilesChanged(m){const _=await this.getAffectedNodes(this.getAffectedChanges(m));return _.length>0?this.effectedNodes=this.effectedNodes.concat(_):!(_.length>0)&&this.isRootAffected(m)&&this.effectedNodes.push(this.root),this.refreshEffectNode()}async getFileTreeNodePathByUri(m){var _,y,S,A,T,D;if(!m)return;let w;if(this.isMultipleWorkspace){if(this._roots||(this._roots=await this.workspaceService.roots),w=(A=this._roots.find(I=>new f.URI(I.uri).isEqualOrParent(m)))===null||A===void 0?void 0:A.uri,w){const I=new f.URI(w);if(I.isEqualOrParent(m))return new a(((T=this.root)===null||T===void 0?void 0:T.path)||"/").join(I.displayName).join(((D=I.relative(m))===null||D===void 0?void 0:D.toString())||"").toString()}}else if(w=(_=this.workspaceService.workspace)===null||_===void 0?void 0:_.uri,w){const I=new f.URI(w);if(I.isEqualOrParent(m))return new a(((y=this.root)===null||y===void 0?void 0:y.path)||"").join(((S=I.relative(m))===null||S===void 0?void 0:S.toString())||"").toString()}}async moveNodeByPath(m,_,y,S,A=o.TreeNodeType.TreeNode){const T=new a(m.path).join(y).toString(),D=new a(_.path).join(S).toString();if(T&&D&&D!==T){const w=m.moveNode(T,D);return w&&c.File.is(w)&&(w.updateMetaData({uri:_.uri.resolve(S),fileStat:{..._.filestat,uri:_.uri.resolve(S).toString(),isDirectory:A!==o.TreeNodeType.TreeNode},tooltip:this.fileTreeAPI.getReadableTooltip(_.uri.resolve(S))}),c.Directory.is(w)&&this.updateChildren(w)),w}}async updateChildren(m){const _=m.children;if(!(!_||_.length===0)){for(const y of _)if(c.File.is(y)){const S=m.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(m,_,y){let S,A;const T=a.splitPath(_);if(T.length>1){let w=m.uri;for(const I of T)w=w.resolve(I);!this.isCompactMode||c.Directory.isRoot(m)?A=T[0]:y===o.TreeNodeType.CompositeTreeNode?A=_:A=T.slice(0,T.length-1).join(a.separator)}else A=_;S={uri:m.uri.resolve(A).toString(),isDirectory:y===o.TreeNodeType.CompositeTreeNode||T.length>1,isSymbolicLink:!1,lastModification:new Date().getTime()};const D=await this.fileTreeAPI.toNode(this,S,m,A);return D&&m.addNode(D),D}async deleteAffectedNodeByPath(m,_){var y,S;const A=this.getNodeByPathOrUri(m);A&&A.parent&&(this.isCompactMode&&!_?((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(m,_=[]){const y=[];for(const S of m){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 _.filter(S=>S.type!==v.FileChangeType.DELETED)}async getAffectedNodes(m){const _=[];for(const y of m){const S=new f.URI(y.uri),A=this.getNodeByPathOrUri(S.parent);A&&_.push(A)}return _}isFileURI(m){return/^file:\/\//.test(m)}getNodeByPathOrUri(m){var _,y,S,A;let T,D;if(typeof m!="string"?(D=m,m=m.toString()):this.isFileURI(m)?D=new f.URI(m):!this.isFileURI(m)&&typeof m=="string"&&(T=m),this.isFileURI(m)&&D){if(this._symbolicFiles.has(D?.toString()))return this._symbolicFiles.get(D.toString());let w;if(this.isMultipleWorkspace?this._roots&&(w=(y=this._roots.find(I=>new f.URI(I.uri).isEqualOrParent(D)))===null||y===void 0?void 0:y.uri):w=(_=this.workspaceService.workspace)===null||_===void 0?void 0:_.uri,this.root&&w){const I=new f.URI(w);if(I.isEqualOrParent(D)){const R=I.relative(D);R&&(T=new a(this.root.path).join(R.toString()).toString())}}}if(T){const w=(S=this.root)===null||S===void 0?void 0:S.getTreeNodeByPath(T);if(!w){let I;const R=T.split(a.separator);for(;R.length>=1;){R.pop();const M=R.join(a.separator);if(I=(A=this.root)===null||A===void 0?void 0:A.getTreeNodeByPath(M),I)break}if(I&&c.Directory.is(I)){for(const M of I.children||[])if(M.path.includes(T))return M}}return w}}sortComparator(m,_){return m.constructor===_.constructor?m.name.localeCompare(_.name,"en",{numeric:!0}):m.type===o.TreeNodeType.CompositeTreeNode?-1:_.type===o.TreeNodeType.CompositeTreeNode?1:0}get contextMenuContextKeyService(){return this.fileContextKey?this.fileContextKey.service:this.contextKeyService}reWatch(){for(const[m,_]of this._fileServiceWatchers)_.dispose(),this.watchFilesChange(new f.URI(m))}get isMultipleWorkspace(){return!!this.workspaceService.workspace&&!this.workspaceService.workspace.isDirectory}getDisplayName(m){return this.workspaceService.getWorkspaceName(m)}async refresh(m=this.root){if(m)return c.Directory.is(m)||c.File.is(m)&&m.parent&&(m=m.parent),this._changeEventDispatchQueue.add(m.path),this.doHandleQueueChange()}async doHandleQueueChange(){if(this.refreshable)try{await this.flushEventQueue()}catch(m){this.logger.error("flush file change event queue error:",m)}finally{this.onNodeRefreshedEmitter.fire()}}sortPaths(m){const y=m.slice().map(A=>({node:this.getNodeByPathOrUri(A),path:A})).filter(A=>A&&!!A.node);m.length>1&&y.sort((A,T)=>{var D,w;const I=((D=A.node)===null||D===void 0?void 0:D.depth)||0,R=((w=T.node)===null||w===void 0?void 0:w.depth)||0;return I-R});const S=[];for(let A=y.length-1;A>=0;A--){const T=y[A];let D=!1;for(let w=0;w<A;w++){const I=y[w];c.Directory.is(I)&&T.node.path.startsWith(I.node.path)&&(D=!0)}D||S.push(T)}return S}openFile(m){const _=this.preferenceService.get("editor.previewMode");this.commandService.executeCommand(f.EDITOR_COMMANDS.OPEN_RESOURCE.id,m,{disableNavigate:!0,preview:_})}openAndFixedFile(m){this.commandService.executeCommand(f.EDITOR_COMMANDS.OPEN_RESOURCE.id,m,{disableNavigate:!0,preview:!1,focus:!0})}openToTheSide(m){this.commandService.executeCommand(f.EDITOR_COMMANDS.OPEN_RESOURCE.id,m,{disableNavigate:!0,split:4})}compare(m,_){this.commandService.executeCommand(f.EDITOR_COMMANDS.COMPARE.id,{original:m,modified:_})}toggleFilterMode(){var m;this._filterMode=!this.filterMode,this.onFilterModeChangeEmitter.fire(this.filterMode),(m=this.fileContextKey)===null||m===void 0||m.filesExplorerFilteredContext.set(this.filterMode),this.filterMode===!1&&this.commandService.executeCommand(f.FILE_COMMANDS.LOCATION.id)}};e.FileTreeService=d,n.__decorate([(0,s.Autowired)(h.IFileTreeAPI),n.__metadata("design:type",Object)],d.prototype,"fileTreeAPI",void 0),n.__decorate([(0,s.Autowired)(f.CommandService),n.__metadata("design:type",Object)],d.prototype,"commandService",void 0),n.__decorate([(0,s.Autowired)(f.IContextKeyService),n.__metadata("design:type",Object)],d.prototype,"contextKeyService",void 0),n.__decorate([(0,s.Autowired)(u.IWorkspaceService),n.__metadata("design:type",Object)],d.prototype,"workspaceService",void 0),n.__decorate([(0,s.Autowired)(b.CorePreferences),n.__metadata("design:type",Object)],d.prototype,"corePreferences",void 0),n.__decorate([(0,s.Autowired)(f.PreferenceService),n.__metadata("design:type",Object)],d.prototype,"preferenceService",void 0),n.__decorate([(0,s.Autowired)(g.LabelService),n.__metadata("design:type",g.LabelService)],d.prototype,"labelService",void 0),n.__decorate([(0,s.Autowired)(l.FileTreeDecorationService),n.__metadata("design:type",l.FileTreeDecorationService)],d.prototype,"decorationService",void 0),n.__decorate([(0,s.Autowired)(v.IFileServiceClient),n.__metadata("design:type",Object)],d.prototype,"fileServiceClient",void 0),n.__decorate([(0,s.Autowired)(E.IIconService),n.__metadata("design:type",Object)],d.prototype,"iconService",void 0),n.__decorate([(0,s.Autowired)(f.ILogger),n.__metadata("design:type",Object)],d.prototype,"logger",void 0),n.__decorate([(0,s.Autowired)(r.FileContextKey),n.__metadata("design:type",r.FileContextKey)],d.prototype,"fileContextKey",void 0),e.FileTreeService=d=n.__decorate([(0,s.Injectable)()],d)},83709:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeNextModule=void 0;const n=t(85608),s=t(41869),o=t(72665),f=t(41103),b=t(6250),g=t(89508),v=t(40439),E=t(57781),u=t(88808),h=t(93239),c=t(97738),r=t(24861);let l=class extends s.BrowserModule{constructor(){super(...arguments),this.providers=[{token:b.IFileTreeAPI,useClass:u.FileTreeAPI},{token:h.FileTreeDecorationService,useClass:h.FileTreeDecorationService},{token:b.IFileTreeService,useClass:E.FileTreeService},{token:c.FileTreeModelService,useClass:c.FileTreeModelService},{token:o.IWindowDialogService,useClass:g.WindowDialogServiceImpl},v.FileTreeContribution]}};e.FileTreeNextModule=l,e.FileTreeNextModule=l=n.__decorate([(0,s.Domain)(r.name),(0,s.ModuleDependencies)([f.WorkspaceModule])],l)},88808:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeAPI=void 0;const n=t(85608),s=t(76003),o=t(41869),f=t(43718),b=t(42933),g=t(72665),v=t(26199),E=t(69959);let u=class{constructor(){this.cacheFileStat=new Map}async resolveChildren(c,r,l,a){var d;let p;if(!this.userhomePath){const m=await this.fileServiceClient.getCurrentUserHome();m&&(this.userhomePath=new f.URI(m.uri))}if(typeof r=="string"?p=await this.fileServiceClient.getFileStat(r):p=await this.fileServiceClient.getFileStat(r.uri),p){if(((d=p.children)===null||d===void 0?void 0:d.length)===1&&p.children[0].isDirectory&&a)return await this.resolveChildren(c,p.children[0].uri,l,a);{const m={...p,isInSymbolicDirectory:l?.filestat.isSymbolicLink||l?.filestat.isInSymbolicDirectory};return{children:this.toNodes(c,m,l),filestat:m}}}else return{children:[],filestat:null}}async resolveNodeByPath(c,r,l){const a=await this.fileServiceClient.getFileStat(r);if(a)return this.toNode(c,a,l)}async resolveFileStat(c){return await this.fileServiceClient.getFileStat(c.toString())}toNodes(c,r,l){if(l){if(r.children)return r.children.map(a=>this.toNode(c,a,l))}else return[this.toNode(c,r,l)];return[]}toNode(c,r,l,a){var d;const p=new f.URI(r.uri),m=a||p.displayName;let _;return r.isInSymbolicDirectory=(d=l?.filestat.isSymbolicLink)!==null&&d!==void 0?d:l?.filestat.isInSymbolicDirectory,r.isDirectory?_=new E.Directory(c,l,p,m,r,this.getReadableTooltip(p)):_=new E.File(c,l,p,m,r,this.getReadableTooltip(p)),_}async mvFiles(c,r){const l=[];for(const p of c)if(p.url.isEqualOrParent(r))return;const a=c.sort((p,m)=>p.toString().length-m.toString().length),d=[];for(const p of a)d.length>0&&d.find(m=>m.url.isEqualOrParent(p.url))||d.push(p);if(this.corePreferences["explorer.confirmMove"]){const p=(0,f.localize)("file.confirm.move.ok"),m=(0,f.localize)("file.confirm.move.cancel");if(await this.dialogService.warning((0,f.formatLocalize)("file.confirm.move",`[ ${d.map(y=>y.url.displayName).join(",")} ]`,r.displayName),[m,p])!==p)return}for(const p of d){const m=await this.mv(p.url,r.resolve(p.url.displayName),p.isDirectory);m&&l.push(m)}return l}async mv(c,r,l=!1){try{await this.workspaceEditService.apply({edits:[{newResource:r,oldResource:c,options:{isDirectory:l,overwrite:!0}}]})}catch(a){return a.message}}async createFile(c,r){try{await this.workspaceEditService.apply({edits:[{newResource:c,options:{content:r}}]})}catch(l){return l.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(r){return r.message}}async delete(c){try{await this.workspaceEditService.apply({edits:[{oldResource:c,options:{}}]});return}catch(r){return r.message}}async copyFile(c,r){let l=1,a;try{a=await this.fileServiceClient.access(r.toString())}catch(d){return d.message}for(;a;){const d=r.displayName.replace(/\Wcopy\W\d+/,""),p=f.path.extname(d),_=`${f.path.basename(d,p)} copy ${l}${p}`;r=r.parent.resolve(_),l++;try{a=await this.fileServiceClient.access(r.toString())}catch{return}}try{return await this.fileServiceClient.copy(c.toString(),r.toString())}catch(d){return d.message}}getReadableTooltip(c){const r=c.toString(),l=this.userhomePath&&this.userhomePath.toString();return this.userhomePath&&this.userhomePath.isEqualOrParent(c)?decodeURIComponent(r.replace(l,"~")):decodeURIComponent(c.withScheme("").toString())}};e.FileTreeAPI=u,n.__decorate([(0,s.Autowired)(b.IFileServiceClient),n.__metadata("design:type",Object)],u.prototype,"fileServiceClient",void 0),n.__decorate([(0,s.Autowired)(v.IWorkspaceEditService),n.__metadata("design:type",Object)],u.prototype,"workspaceEditService",void 0),n.__decorate([(0,s.Autowired)(f.CommandService),n.__metadata("design:type",Object)],u.prototype,"commandService",void 0),n.__decorate([(0,s.Autowired)(o.CorePreferences),n.__metadata("design:type",Object)],u.prototype,"corePreferences",void 0),n.__decorate([(0,s.Autowired)(g.IDialogService),n.__metadata("design:type",Object)],u.prototype,"dialogService",void 0),e.FileTreeAPI=u=n.__decorate([(0,s.Injectable)()],u)},93239:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeDecorationService=void 0;const n=t(85608),s=t(76003),o=t(41869),f=t(41893),b=t(52416);let g=class{constructor(){this.disposeCollection=new o.DisposableCollection,this.onDidChangeEmitter=new o.Emitter,this.cacheDecorations=new Map,this.disposeCollection.pushAll([this.decorationsService.onDidChangeDecorations(E=>{var u,h,c;const r=(h=(u=E._data)===null||u===void 0?void 0:u._iter)===null||h===void 0?void 0:h._value;if(r){const l=new o.URI(r),a=this.getDecoration(l);this.cacheDecorations.has(r)?((c=this.cacheDecorations.get(r))===null||c===void 0?void 0:c.tooltip)!==a?.tooltip&&this.onDidChangeEmitter.fire():(this.cacheDecorations.set(r,a),this.onDidChangeEmitter.fire())}}),this.themeService.onThemeChange(()=>{this.onDidChangeEmitter.fire()})])}get onDidChange(){return this.onDidChangeEmitter.event}getDecoration(E,u=!1){E instanceof o.URI&&(E=o.Uri.parse(E.toString()));const h=this.decorationsService.getDecoration(E,u);return h?{...h,color:this.themeService.getColor({id:h.color})}:{color:"",tooltip:"",badge:""}}dispose(){this.disposeCollection.dispose()}};e.FileTreeDecorationService=g,n.__decorate([(0,s.Autowired)(f.IDecorationsService),n.__metadata("design:type",f.IDecorationsService)],g.prototype,"decorationsService",void 0),n.__decorate([(0,s.Autowired)(b.IThemeService),n.__metadata("design:type",Object)],g.prototype,"themeService",void 0),e.FileTreeDecorationService=g=n.__decorate([(0,s.Injectable)(),n.__metadata("design:paramtypes",[])],g)},30577:(x,e,t)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.DragAndDropService=void 0;const s=t(85608),o=t(76003),f=t(97267),b=t(41869),g=t(53622),v=t(14951),E=t(72665),u=t(6250),h=t(69959),c=s.__importDefault(t(89200)),r=s.__importDefault(t(2613)),l=t(57781),a=t(97738);let d=n=class extends b.WithEventBus{constructor(m){super(),this.model=m,this.toCancelNodeExpansion=new b.DisposableCollection,this.beingDraggedDec=new f.Decoration(c.default.mod_dragging),this.draggedOverDec=new f.Decoration(c.default.mod_dragover),this.beingDraggedNodes=[],this.dragOverTrigger=new b.ThrottledDelayer(n.MS_TILL_DRAGGED_OVER_EXPANDS),this.handleDragStart=(_,y,S)=>{_.stopPropagation();const A=I=>{this.handleDragEnd(I,y)};_.currentTarget.addEventListener("dragend",A,!1);let T=this.model.selectedFiles,D=!1;for(const I of T)I&&I.id===y.id&&(D=!0);D||(T=[y]),this.beingDraggedNodes=T,this.beingDraggedActiveUri=S;const w=T.find(I=>!h.Directory.is(I));if(w&&_.dataTransfer.setData("uri",w.uri.toString()),_.dataTransfer.setData("beingDraggedNodes",JSON.stringify(this.beingDraggedNodes.map(I=>I.uri.toString()))),w){const I=w;I.uri.scheme==="file"&&_.dataTransfer.setData("DownloadURL",`application/octet-stream:${I.displayName}:data:application/octet-stream;base64,${(0,b.encodeBase64)(b.BinaryBuffer.fromString(I.filestat.uri))}`)}if(T.forEach(I=>{this.beingDraggedDec.addTarget(I,f.TargetMatchMode.Self)}),_.dataTransfer){let I;T.length===1?I=S?S.displayName:typeof y.name=="string"?y.name:"":I=String(T.length);const R=document.createElement("div");R.className=r.default.file_tree_drag_image,R.textContent=I,document.body.appendChild(R),_.dataTransfer.setDragImage(R,-10,-10),setTimeout(()=>document.body.removeChild(R),0)}},this.handleDragEnter=(_,y)=>{_.stopPropagation(),_.preventDefault()},this.handleDragLeave=(_,y)=>{_.preventDefault(),_.stopPropagation(),this.toCancelNodeExpansion.dispose(),this.potentialParent&&(this.draggedOverDec.removeTarget(this.potentialParent),this.model.treeModel.dispatchChange())},this.handleDragOver=(_,y)=>{if(_.preventDefault(),_.stopPropagation(),!this.toCancelNodeExpansion.disposed||this.beingDraggedNodes.indexOf(y)>=0)return;this.draggedOverNode=y;const S=h.Directory.is(y)&&y.expanded?y:y.parent;(this.potentialParent!==S||!this.draggedOverDec.hasTarget(S))&&(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=S,this.draggedOverDec.addTarget(this.potentialParent,f.TargetMatchMode.SelfAndChildren),this.model.treeModel.dispatchChange()),this.potentialParent!==y&&h.Directory.is(y)&&(this.dragOverTrigger.trigger(async()=>{y.expanded?(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=y,this.draggedOverDec.addTarget(this.potentialParent,f.TargetMatchMode.SelfAndChildren)):(await y.setExpanded(!0),this.draggedOverNode===y&&(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=y,this.draggedOverDec.addTarget(this.potentialParent,f.TargetMatchMode.SelfAndChildren))),this.model.treeModel.dispatchChange()}),this.toCancelNodeExpansion.push(b.Disposable.create(()=>{this.dragOverTrigger.isTriggered()||this.dragOverTrigger.cancel()})))},this.handleDrop=async(_,y,S)=>{var A;this.eventBus.fire(new g.FileTreeDropEvent({event:_.nativeEvent,targetDir:S?S.codeUri.path:y&&y instanceof h.File?(A=y.parent)===null||A===void 0?void 0:A.uri.codeUri.path:y?.uri.codeUri.path}));try{_.preventDefault(),_.stopPropagation(),_.dataTransfer.dropEffect="copy";let T;const D=!!this.beingDraggedActiveUri;this.fileTreeService.isCompactMode&&S&&!y?.uri.isEqual(S)?T=null:y?T=h.Directory.is(y)?y:y.parent:T=this.root;let w;if(this.beingDraggedActiveUri){const I=this.fileTreeService.getNodeByPathOrUri(this.beingDraggedActiveUri);w=[new h.Directory(this.fileTreeService,I?.parent,this.beingDraggedActiveUri,this.beingDraggedActiveUri.displayName,{uri:this.beingDraggedActiveUri.toString(),isDirectory:!0,lastModification:new Date().getTime()},this.beingDraggedActiveUri.displayName)]}else if(w=this.beingDraggedNodes,!w||w.length===0)try{const I=JSON.parse(_.dataTransfer.getData("beingDraggedNodes"));I&&I.length!==0&&(w=I.map(R=>this.fileTreeService.getNodeByPathOrUri(new b.URI(R))).filter(Boolean),w.length||(w=await Promise.all(I.map(async R=>{const M=new b.URI(R);let O;const P=await this.filesystem.getFileStat(M.toString());return P?.isDirectory?O=new h.Directory(this.fileTreeService,this.root,M,M.displayName,{uri:M.toString(),isDirectory:!0,lastModification:new Date().getTime()},M.displayName):O=new h.File(this.fileTreeService,this.root,M,M.displayName,{uri:M.toString(),isDirectory:!0,lastModification:new Date().getTime()},M.displayName),O}))))}catch{}if(w.length>0){const I=S||T&&T.uri,R=w.filter(M=>M&&M.parent&&(this.beingDraggedActiveUri?!M.parent.uri.isEqual(I):!0));if(R.length>0){const M=await this.fileTreeAPI.mvFiles(R.map(O=>({url:O.uri,isDirectory:O.filestat.isDirectory})),I);if(M&&M.length>0)M.forEach(O=>{this.messageService.error(O)});else if(M){if(T)if(this.fileTreeService.isCompactMode&&D){for(const O of R)this.fileTreeService.refresh(O.parent);this.fileTreeService.refresh(T)}else for(const O of R){const P=T.uri.resolve(O.name);this.fileTreeService.moveNodeByPath(O.parent,T,O.name,O.name,O.type),O.updateMetaData({name:P.displayName,fileStat:{...O.filestat,uri:P.toString()},uri:P,tooltip:this.fileTreeAPI.getReadableTooltip(P)}),h.Directory.is(O)&&this.fileTreeService.refresh(O)}else if(y){if(this.fileTreeService.isCompactMode&&D)for(const O of R)this.fileTreeService.refresh(O.parent);else for(const O of R)this.fileTreeService.deleteAffectedNodeByPath(O.path);this.fileTreeService.refresh(y.parent)}}else return}}y&&this.beingDraggedDec.removeTarget(y),this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.beingDraggedNodes.forEach(I=>{this.beingDraggedDec.removeTarget(I)}),this.beingDraggedNodes=[],this.beingDraggedActiveUri=void 0,this.potentialParent=null,this.model.treeModel.dispatchChange(),this.toCancelNodeExpansion.disposed||this.toCancelNodeExpansion.dispose()}catch(T){this.logger.error(T)}},this.handleDragEnd=(_,y)=>{this.beingDraggedDec.removeTarget(y),this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.beingDraggedNodes.forEach(S=>{this.beingDraggedDec.removeTarget(S)}),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}};e.DragAndDropService=d,d.MS_TILL_DRAGGED_OVER_EXPANDS=500,s.__decorate([(0,o.Autowired)(u.IFileTreeAPI),s.__metadata("design:type",Object)],d.prototype,"fileTreeAPI",void 0),s.__decorate([(0,o.Autowired)(b.ILogger),s.__metadata("design:type",Object)],d.prototype,"logger",void 0),s.__decorate([(0,o.Autowired)(E.IMessageService),s.__metadata("design:type",Object)],d.prototype,"messageService",void 0),s.__decorate([(0,o.Autowired)(u.IFileTreeService),s.__metadata("design:type",l.FileTreeService)],d.prototype,"fileTreeService",void 0),s.__decorate([(0,o.Autowired)(v.IFileServiceClient),s.__metadata("design:type",Object)],d.prototype,"filesystem",void 0),e.DragAndDropService=d=n=s.__decorate([(0,o.Injectable)(),s.__param(0,(0,o.Optional)()),s.__metadata("design:paramtypes",[a.FileTreeModelService])],d)},97738:(x,e,t)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeModelService=void 0;const s=t(85608),o=t(76003),f=t(97267),b=t(41869),g=t(91830),v=t(93899),E=t(26542),u=t(54414),h=t(14951),c=t(63067),r=t(53576),l=t(72665),a=t(6250),d=t(69959),p=t(2812),m=t(46377),_=s.__importDefault(t(89200)),y=t(57781),S=t(30577),{Path:A,isValidBasename:T}=b.path,{coalesce:D}=b.arrays,{trim:w,rtrim:I}=b.strings;let R=n=class{constructor(){this._isDisposed=!1,this._whenReady=new b.Deferred,this.selectedDecoration=new f.Decoration(_.default.mod_selected),this.focusedDecoration=new f.Decoration(_.default.mod_focused),this.contextMenuDecoration=new f.Decoration(_.default.mod_actived),this.loadingDecoration=new f.Decoration(_.default.mod_loading),this.cutDecoration=new f.Decoration(_.default.mod_cut),this._selectedFiles=[],this.disposableCollection=new b.DisposableCollection,this._isMultiSelected=!1,this.refreshedActionDelayer=new b.ThrottledDelayer(n.DEFAULT_REFRESHED_ACTION_DELAY),this.labelChangedDelayer=new b.ThrottledDelayer(n.DEFAULT_LABEL_CHANGED_DELAY),this.locationThrottler=new b.Throttler,this.onDidFocusedFileChangeEmitter=new b.Emitter,this.onDidContextMenuFileChangeEmitter=new b.Emitter,this.onDidSelectedFileChangeEmitter=new b.Emitter,this.onFileTreeModelChangeEmitter=new b.Emitter,this._initTreeModelReady=!1,this.clearFileSelectedDecoration=()=>{this.selectedDecoration.clearAppliedTarget(),this._selectedFiles=[]},this.activeFileDecoration=(O,P=!0)=>{this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),O&&(this.selectedFiles.length>0&&this.selectedDecoration.clearAppliedTarget(),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.selectedDecoration.addTarget(O),this.focusedDecoration.addTarget(O),this.focusedFile=O,this.selectedFiles=[O],P&&this.treeModel.dispatchChange())},this.selectFileDecoration=(O,P=!0)=>{O!==this.treeModel.root&&(this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),O&&(this.selectedFiles.length>0&&this.selectedDecoration.clearAppliedTarget(),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.selectedDecoration.addTarget(O),this._selectedFiles=[O],P&&this.treeModel.dispatchChange()))},this.activateFileActivedDecoration=O=>{this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),this.focusedFile&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this.contextMenuDecoration.addTarget(O),this.contextMenuFile=O,this.treeModel.dispatchChange()},this.activateFileFocusedDecoration=O=>{this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),this.focusedDecoration.addTarget(O),this.focusedFile=O,this.treeModel.dispatchChange()},this.activeFileFocusedDecoration=(O,P=!1)=>{O!==this.treeModel.root&&(this.focusedFile!==O&&(P?(this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.contextMenuFile=O):this.focusedFile&&(this.contextMenuFile=void 0,this.focusedDecoration.clearAppliedTarget()),O&&(this._selectedFiles.indexOf(O)<0&&(this.selectedDecoration.addTarget(O),this._selectedFiles.push(O),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(L=>L.uri))),this.focusedDecoration.addTarget(O),this.focusedFile=O)),this.treeModel.dispatchChange())},this.toggleFileSelectedDecoration=O=>{const P=this._selectedFiles.indexOf(O);P>-1?(this.focusedFile===O&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this._selectedFiles.splice(P,1),this.selectedDecoration.clearAppliedTarget()):(this._selectedFiles.push(O),this.selectedDecoration.addTarget(O),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.focusedFile=O,this.focusedDecoration.addTarget(O)),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(L=>L.uri)),this.treeModel.dispatchChange()},this.activeFileDecorationByRange=(O,P)=>{for(this.clearFileSelectedDecoration(),this.contextMenuFile=void 0;O<=P;O++){const L=this.treeModel.root.getTreeNodeAtIndex(O);L&&(this._selectedFiles.push(L),this.selectedDecoration.addTarget(L))}this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(L=>L.uri)),this.treeModel.dispatchChange()},this.deactivateFileDecoration=()=>{var O;this.focusedFile&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this.contextMenuFile&&this.contextMenuDecoration.removeTarget(this.contextMenuFile),(O=this.treeModel)===null||O===void 0||O.dispatchChange()},this.toggleDirectory=async O=>{O.expanded?this.fileTreeHandle.collapseNode(O):this.fileTreeHandle.expandNode(O)},this.handleDblClick=()=>{this.commandService.executeCommand(b.FILE_COMMANDS.NEW_FILE.id)},this.handleContextMenu=(O,P,L)=>{var N;O.stopPropagation(),O.preventDefault();let k,B;P?(B=P,this._isMultiSelected?this.selectedFiles.indexOf(B)>=0?k=this.selectedFiles:k=[B]:k=[B]):(k=[this.treeModel.root],B=this.treeModel.root),this.activateFileActivedDecoration(B),this.setFileTreeContextKey(B),this.fileTreeService.isCompactMode&&L?(this._activeUri=L,(N=this.contextKey)===null||N===void 0||N.explorerResourceIsFolder.set(!0)):L||(this._activeUri=null);const F=this.contextMenuService.createMenu({id:v.MenuId.ExplorerContext,contextKeyService:this.fileTreeService.contextMenuContextKeyService}),U=F.getMergedMenuNodes();F.dispose(),this.updateExplorerCompressedContextKey(B,L);const{x:V,y:H}=O.nativeEvent;this.ctxMenuRenderer.show({anchor:{x:V,y:H},menuNodes:U,args:L?[L,[L]]:[B.uri,k.map(G=>G.uri)]})},this.handleTreeBlur=()=>{var O,P,L;this._isDisposed||((P=(O=this.contextKey)===null||O===void 0?void 0:O.filesExplorerFocused)===null||P===void 0||P.set(!1),this.deactivateFileDecoration(),(L=this.contextKey)===null||L===void 0||L.explorerResourceIsFolder.set(!1))},this.handleTreeFocus=()=>{var O,P;(P=(O=this.contextKey)===null||O===void 0?void 0:O.filesExplorerFocused)===null||P===void 0||P.set(!0)},this.handleItemRangeClick=(O,P)=>{if(!this.focusedFile)this.handleItemClick(O,P);else if(this.focusedFile&&this.focusedFile!==O){this._isMultiSelected=!0;const L=this.treeModel.root.getIndexAtTreeNode(O),N=this.treeModel.root.getIndexAtTreeNode(this.focusedFile);N>L?this.activeFileDecorationByRange(L,N):N<L&&this.activeFileDecorationByRange(N,L)}},this.handleItemToggleClick=(O,P)=>{this._isMultiSelected=!0,!(P!==f.TreeNodeType.CompositeTreeNode&&P!==f.TreeNodeType.TreeNode)&&this.toggleFileSelectedDecoration(O)},this.handleItemClick=(O,P=this.fileTreeService.isMultipleWorkspace?f.TreeNodeType.TreeNode:f.TreeNodeType.CompositeTreeNode,L)=>{var N,k,B,F;if(this.treeModel&&(O||(O=this.treeModel.root),this.updateExplorerCompressedContextKey(O,L),this._isMultiSelected=!1,(P===f.TreeNodeType.CompositeTreeNode||P===f.TreeNodeType.TreeNode)&&this.activeFileDecoration(O),this.fileTreeService.isCompactMode&&L?(this._activeUri=L,(N=this.contextKey)===null||N===void 0||N.explorerResourceIsFolder.set(!0)):L||(this._activeUri=null,(k=this.contextKey)===null||k===void 0||k.explorerResourceIsFolder.set(P===f.TreeNodeType.CompositeTreeNode)),this.corePreferences["workbench.list.openMode"]==="singleClick")){if(P===f.TreeNodeType.CompositeTreeNode){if((B=this.contextKey)===null||B===void 0||B.explorerResourceIsFolder.set(!0),O===this.treeModel.root)return;this.toggleDirectory(O)}else if(P===f.TreeNodeType.TreeNode){if((F=this.contextKey)===null||F===void 0||F.explorerResourceIsFolder.set(!1),O===this.treeModel.root)return;this.fileTreeService.openFile(O.uri),this.mainlayoutService.bottomExpanded&&this.commandService.executeCommand(r.RETRACT_BOTTOM_PANEL.id)}}},this.handleItemDoubleClick=(O,P)=>{P===f.TreeNodeType.TreeNode?this.fileTreeService.openAndFixedFile(O.uri):this.corePreferences["workbench.list.openMode"]==="doubleClick"&&this.toggleDirectory(O)},this.validateFileName=(O,P)=>{var L;if(P=this.getWellFormedFileName(P),!P||P.length===0||/^\s+$/.test(P))return{message:(0,b.localize)("validate.tree.emptyFileNameError"),type:f.PROMPT_VALIDATE_TYPE.ERROR,value:P};if(P[0]==="/"||P[0]==="\\")return{message:(0,b.localize)("validate.tree.fileNameStartsWithSlashError"),type:f.PROMPT_VALIDATE_TYPE.ERROR,value:P};if(P[0]===" "||P[P.length-1]===" ")return{message:(0,b.localize)("validate.tree.fileNameFollowOrStartWithSpaceWarning"),type:f.PROMPT_VALIDATE_TYPE.WARNING,value:P};let N;if(O.target){const B=O.target;if(P===B.name)return null;N=B.parent}else N=O.parent;return N&&!(O instanceof f.RenamePromptHandle&&O.target.displayName.indexOf(A.separator)>0)&&((L=N.children)===null||L===void 0?void 0:L.find(U=>U.name===P))?{message:(0,b.formatLocalize)("validate.tree.fileNameExistsError",P),type:f.PROMPT_VALIDATE_TYPE.ERROR,value:P}:D(P.split(/[\\/]/)).some(B=>!T(B))?{message:(0,b.formatLocalize)("validate.tree.invalidFileNameError",this.trimLongName(P)),type:f.PROMPT_VALIDATE_TYPE.ERROR,value:P}:null},this.proxyPrompt=O=>{let P=!1;const L=async G=>{const K=await this.fileTreeService.getNodeByPathOrUri(G);K&&(d.Directory.is(K)?this.selectFileDecoration(K):this.location(K.uri))},N=async G=>{var K,z,j;if(this.validateMessage=void 0,O instanceof f.RenamePromptHandle){const W=O.target,$=O.target.displayName.split(A.separator),Y=W.name.indexOf(A.separator)>0;if(Y&&this.activeUri&&!O.target.uri.toString().includes(this.activeUri.toString()))return!1;const Q=this.activeUri?$.length-O.target.uri.toString().replace(this.activeUri.toString(),"").split(A.separator).length:-1,te=Q===-1?[]:$.slice(0,Q).concat(G);let re=W.uri,ae=W.parent.uri.resolve(G);if(Y&&((K=this.activeUri)===null||K===void 0?void 0:K.displayName)===G||!Y&&G===W.name)return!0;O.addAddonAfter("loading_indicator"),Y&&te.length>0&&d.Directory.is(W.parent)&&(re=W.parent.uri.resolve($.slice(0,Q+1).join(A.separator)),ae=W.parent.uri.resolve(te.concat().join(A.separator)));const ce=await this.fileTreeAPI.mv(re,ae,W.type===f.TreeNodeType.CompositeTreeNode);if(ce)return this.validateMessage={type:f.PROMPT_VALIDATE_TYPE.ERROR,message:ce,value:G},this.fileTreeService.updateRefreshable(!0),O.addValidateMessage(this.validateMessage),!1;if(this.fileTreeService.updateRefreshable(!1),O.removeAddonAfter(),!Y&&W.parent){const q=await this.fileTreeService.moveNodeByPath(W.parent,W.parent,W.name,G,W.type);q&&this.selectFileDecoration(q,!1),this.fileTreeService.updateRefreshable(!0)}else if(d.Directory.is(W)&&!d.Directory.isRoot(W)){W.updateMetaData({name:te.concat($.slice(Q+1)).join(A.separator),uri:ae,fileStat:{...W.filestat,uri:ae.toString()},tooltip:this.fileTreeAPI.getReadableTooltip(ae)}),this.treeModel.dispatchChange();let q;d.Directory.is(W.parent)&&(!((z=W.parent.children)===null||z===void 0)&&z.find(_e=>W.path.indexOf(_e.path)>=0))?q=this.fileTreeService.refresh(W.parent):q=this.fileTreeService.refresh(W),q.then(()=>{L(ae)})}O.removeAddonAfter()}else if(O instanceof f.NewPromptHandle){const W=O.parent,$=W.uri.resolve(G);let Y;if(O.addAddonAfter("loading_indicator"),this.fileTreeService.updateRefreshable(!0),O.type===f.TreeNodeType.CompositeTreeNode?Y=await this.fileTreeAPI.createDirectory($):Y=await this.fileTreeAPI.createFile($),O.removeAddonAfter(),Y)return this.validateMessage={type:f.PROMPT_VALIDATE_TYPE.ERROR,message:Y,value:G},this.fileTreeService.updateRefreshable(!1),O.addValidateMessage(this.validateMessage),!1;if(G.includes(A.separator)&&this.fileTreeService.refresh(W).then(()=>{L(W.uri.resolve(G))}),this.fileTreeService.isCompactMode)if(O.type===f.TreeNodeType.CompositeTreeNode)if((!W.children||W.children.length===0)&&!d.Directory.isRoot(W)){const te=W.uri.resolve(G),re=[W.name].concat(G).join(A.separator);W.updateMetaData({name:re,uri:te,fileStat:{...W.filestat,uri:te.toString()},tooltip:this.fileTreeAPI.getReadableTooltip(te)}),L(te)}else await this.fileTreeService.addNode(W,G,O.type),L(W.uri.resolve(G));else await this.fileTreeService.addNode(W,G,O.type),L(W.uri.resolve(G));else await this.fileTreeService.addNode(W,G,O.type),L(W.uri.resolve(G))}return(j=this.contextKey)===null||j===void 0||j.filesExplorerInputFocused.set(!1),!0},k=async G=>{var K,z,j,W;if(this.validateMessage&&this.validateMessage.type===f.PROMPT_VALIDATE_TYPE.ERROR)return this.validateMessage=void 0,!0;if(P)return!1;if(!G){(K=this.contextKey)===null||K===void 0||K.explorerCompressedFocusContext.set(!1),(z=this.contextKey)===null||z===void 0||z.explorerCompressedFirstFocusContext.set(!1),(j=this.contextKey)===null||j===void 0||j.explorerCompressedLastFocusContext.set(!1),this.fileTreeService.isCompactMode&&O instanceof f.NewPromptHandle&&this.fileTreeService.refresh(O.parent);return}return(W=this.contextKey)===null||W===void 0||W.filesExplorerInputFocused.set(!1),await N(G),!0},B=async G=>{if(P=!0,this.validateMessage&&this.validateMessage.type===f.PROMPT_VALIDATE_TYPE.ERROR)return!1;if(G.trim()===""||this.validateMessage&&this.validateMessage.type!==f.PROMPT_VALIDATE_TYPE.ERROR)return this.validateMessage=void 0,!0;const K=await N(G);return P=!1,!!K},F=async()=>{var G;(G=this.contextKey)===null||G===void 0||G.filesExplorerInputFocused.set(!0)},U=()=>{var G;this.fileTreeService.updateRefreshable(!0),(G=this.contextKey)===null||G===void 0||G.filesExplorerInputFocused.set(!1),this.contextMenuFile&&this.selectFileDecoration(this.contextMenuFile,!0)},V=()=>{var G;(G=this.contextKey)===null||G===void 0||G.filesExplorerInputFocused.set(!1),this.fileTreeService.isCompactMode&&O instanceof f.NewPromptHandle&&this.fileTreeService.refresh(O.parent)},H=G=>{const K=this.validateFileName(O,G);K?(this.validateMessage=K,O.addValidateMessage(K)):!K&&this.validateMessage&&this.validateMessage.value!==G&&(this.validateMessage=void 0,O.removeValidateMessage())};O.destroyed||(this.fileTreeService.updateRefreshable(!1),O.onChange(H),O.onCommit(B),O.onBlur(k),O.onFocus(F),O.onDestroy(U),O.onCancel(V))},this.copyFile=async O=>{var P;this.pasteStore&&this.pasteStore.type===a.PasteTypes.CUT&&(this._pasteStore.files.forEach(N=>{N&&this.cutDecoration.removeTarget(N)}),(P=this.contextKey)===null||P===void 0||P.explorerResourceCut.set(!1)),this.treeModel.dispatchChange();const L=[];for(const N of O){const k=this.fileTreeService.getNodeByPathOrUri(N);k&&L.push(k)}this._pasteStore={files:L,type:a.PasteTypes.COPY},this.clipboardService.writeResources(O)},this.pasteFile=async O=>{var P,L;let N=!1,k=this.fileTreeService.getNodeByPathOrUri(O.toString());if(!k)return;let B=this.pasteStore,F=!1;if(!B){const U=await this.clipboardService.readResources();if(!U||!U.length)return;B={files:[],type:a.PasteTypes.COPY,crossFiles:U},F=!0}if(B){if(d.Directory.is(k)||(N=!0,k=k.parent),F){const U=(0,b.localize)("file.confirm.paste.ok"),V=(0,b.localize)("file.confirm.paste.cancel");if(await this.dialogService.warning((0,b.formatLocalize)("file.confirm.paste",`[ ${(P=B.crossFiles)===null||P===void 0?void 0:P.map(G=>G.displayName).join(",")} ]`,d.Directory.isRoot(k)?k.uri.displayName:k.displayName),[V,U])!==U)return}if(B.type===a.PasteTypes.CUT){for(const V of B.files)V&&this.cutDecoration.removeTarget(V),k.expanded||await k.setExpanded(!0);const U=await this.fileTreeAPI.mvFiles(B.crossFiles?B.crossFiles.map(V=>{var H;return{url:V,isDirectory:((H=this.fileTreeService.getNodeByPathOrUri(V))===null||H===void 0?void 0:H.filestat.isDirectory)||!1}}):B.files.map(V=>({url:V.uri,isDirectory:V.filestat.isDirectory})),k.uri);U&&U.length>0&&(U.forEach(V=>{this.messageService.error(V)}),this.fileTreeService.refresh()),(L=this.contextKey)===null||L===void 0||L.explorerResourceCut.set(!1),this.treeModel.dispatchChange(),this._pasteStore={files:[],type:a.PasteTypes.NONE,crossFiles:void 0}}else if(B.type===a.PasteTypes.COPY){const U=B.crossFiles?B.crossFiles:B.files.map(V=>V.uri);for(const V of U){k.uri.isEqual(V)&&!N&&(k=k.parent);const H=k.uri.resolve(V.displayName);k.expanded||await k.setExpanded(!0);const G=await this.fileTreeAPI.copyFile(V,H);if(G)if(G.uri){const K=new b.URI(G.uri),z=await this.filesystem.getFileStat(V.toString());this.fileTreeService.addNode(k,K.displayName,z?.isDirectory?f.TreeNodeType.CompositeTreeNode:f.TreeNodeType.TreeNode)}else this.messageService.error(`Error when copy file: ${V.toString()}, ${G}`)}}}},this.cutFile=async O=>{var P;O.length>0&&((P=this.contextKey)===null||P===void 0||P.explorerResourceCut.set(!0)),this._pasteStore&&this._pasteStore.type===a.PasteTypes.CUT&&this._pasteStore.files.forEach(N=>{this.cutDecoration.removeTarget(N)});const L=[];for(const N of O){const k=this.fileTreeService.getNodeByPathOrUri(N);k&&L.push(k)}this._pasteStore={files:L,type:a.PasteTypes.CUT};for(const N of L)N&&this.cutDecoration.addTarget(N);this.treeModel.dispatchChange()},this.location=async O=>{if(await this.whenReady,!this.fileTreeService.filterMode)return this._fileToLocation=O,this.locationThrottler.queue(this.doLocation)},this.doLocation=async()=>{if(!this._fileToLocation)return;const O=this._fileToLocation;let P;if(typeof O=="string"?P=O:P=await this.fileTreeService.getFileTreeNodePathByUri(O),P){if(!this.fileTreeHandle)return;const L=await this.fileTreeHandle.ensureVisible(P,"center",!0);L&&this.selectFileDecoration(L)}this._fileToLocation=void 0},this.locationOnShow=O=>{this._nextLocationTarget=O},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(O){this.onDidFocusedFileChangeEmitter.fire(O?O.uri:void 0),this._focusedFile=O}get contextMenuFile(){return this._contextMenuFile}set contextMenuFile(O){this.onDidContextMenuFileChangeEmitter.fire(O?O.uri:void 0),this._contextMenuFile=O}get selectedFiles(){return this._selectedFiles}set selectedFiles(O){this.onDidSelectedFileChangeEmitter.fire(O?O.map(P=>P.uri):[]),this._selectedFiles=O}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 g.ResourceContextKey(this.fileTreeService.contextMenuContextKeyService)),this._contextMenuResourceContext}get contextKey(){return this.fileTreeService.contextKey}get initTreeModelReady(){return this._initTreeModelReady}async initTreeModel(){this._initTreeModelReady=!1;const O=(await this.fileTreeService.resolveChildren())[0];if(!O){this._whenReady.resolve();return}this._treeModel=this.injector.get(p.FileTreeModel,[O]),this.initDecorations(O),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 L=this.editorService.currentEditor;L&&L.currentUri&&this.location(L.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(f.TreeNodeEvent.WillResolveChildren,L=>{this.loadingDecoration.addTarget(L),this.treeModel.dispatchChange()})),this.disposableCollection.push(this.treeModel.root.watcher.on(f.TreeNodeEvent.DidResolveChildren,L=>{this.loadingDecoration.clearAppliedTarget(),this.treeModel.dispatchChange()})),this._explorerStorage=await this.storageProvider(b.STORAGE_NAMESPACE.EXPLORER);const P=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY);P&&await this.loadFileTreeSnapshot(P),this.disposableCollection.push(this.treeStateWatcher.onDidChange(()=>{if(!this._initTreeModelReady)return;const L=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),N=this.treeStateWatcher.snapshot();this.explorerStorage.set(n.FILE_TREE_SNAPSHOT_KEY,{...L,...N})})),this.fileTreeService.startWatchFileEvent(),this.onFileTreeModelChangeEmitter.fire(this._treeModel),this._whenReady.resolve(),this._initTreeModelReady=!0}initDecorations(O){this._decorations=new f.DecorationsManager(O),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(O){var P;this.currentContextUriContextKey.set(O.uri.toString()),this.currentRelativeUriContextKey.set((this.treeModel.root.uri.relative(O.uri)||"").toString()),this.contextMenuResourceContext.set(O.uri),(P=this.contextKey)===null||P===void 0||P.explorerResourceIsFolder.set(O&&O.type===f.TreeNodeType.CompositeTreeNode)}async loadFileTreeSnapshot(O){await this._treeModel.loadTreeState(O)}updateExplorerCompressedContextKey(O,P){var L,N,k,B,F,U,V,H,G,K,z,j,W,$,Y,Q;if(O&&P){(L=this.contextKey)===null||L===void 0||L.explorerCompressedFocusContext.set(!0);const te=new A(O.name);te.name===P.displayName?((N=this.contextKey)===null||N===void 0||N.explorerCompressedLastFocusContext.set(!0),(k=this.contextKey)===null||k===void 0||k.explorerCompressedFirstFocusContext.set(!1)):te.root&&te.root.name===P.displayName?((B=this.contextKey)===null||B===void 0||B.explorerCompressedLastFocusContext.set(!1),(F=this.contextKey)===null||F===void 0||F.explorerCompressedFirstFocusContext.set(!0)):((U=this.contextKey)===null||U===void 0||U.explorerCompressedLastFocusContext.set(!1),(V=this.contextKey)===null||V===void 0||V.explorerCompressedFirstFocusContext.set(!1))}else O?O.name.indexOf(A.separator)>0?((H=this.contextKey)===null||H===void 0||H.explorerCompressedFocusContext.set(!0),(G=this.contextKey)===null||G===void 0||G.explorerCompressedFirstFocusContext.set(!1),(K=this.contextKey)===null||K===void 0||K.explorerCompressedLastFocusContext.set(!0)):((z=this.contextKey)===null||z===void 0||z.explorerCompressedFocusContext.set(!1),(j=this.contextKey)===null||j===void 0||j.explorerCompressedFirstFocusContext.set(!1),(W=this.contextKey)===null||W===void 0||W.explorerCompressedLastFocusContext.set(!1)):(($=this.contextKey)===null||$===void 0||$.explorerCompressedFocusContext.set(!1),(Y=this.contextKey)===null||Y===void 0||Y.explorerCompressedFirstFocusContext.set(!1),(Q=this.contextKey)===null||Q===void 0||Q.explorerCompressedLastFocusContext.set(!1))}handleTreeHandler(O){this._fileTreeHandle=O}toggleOrOpenCurrentFile(){let O;this.focusedFile?O=this.focusedFile:this.contextMenuFile&&(O=this.contextMenuFile),O&&(this.activeFileDecoration(O),d.Directory.is(O)?this.toggleDirectory(O):this.fileTreeService.openFile(O.uri))}moveToNext(){let O;if(this.focusedFile?O=this.focusedFile:this.contextMenuFile&&(O=this.contextMenuFile),!O)return;const L=this.treeModel.root.getIndexAtTreeNode(O)+1,N=this.treeModel.root.getTreeNodeAtIndex(L),k=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),B=(L+1)*m.FILE_TREE_NODE_HEIGHT-(k.scrollPosition||0),{height:F}=this.fileTreeHandle.getCurrentSize();N&&(this.activateFileFocusedDecoration(N),B>F&&this.fileTreeHandle.ensureVisible(N,"end"))}moveToPrev(){let O;if(this.focusedFile?O=this.focusedFile:this.contextMenuFile&&(O=this.contextMenuFile),!O)return;const P=this.treeModel.root.getIndexAtTreeNode(O);if(P===0)return;const L=P-1,N=this.treeModel.root.getTreeNodeAtIndex(L);if(!N)return;const k=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),B=L*m.FILE_TREE_NODE_HEIGHT;this.activateFileFocusedDecoration(N),(k.scrollPosition||0)>B&&this.fileTreeHandle.ensureVisible(N,"start")}async collapseCurrentFile(){let O;this.focusedFile?(O=this.focusedFile,this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0):this.contextMenuFile&&(O=this.contextMenuFile,this.focusedDecoration.removeTarget(this.contextMenuFile),this.contextMenuFile=void 0);const P=this.selectedFiles.indexOf(O);P>=0&&(this.selectedFiles.splice(P,1),this.selectedDecoration.removeTarget(O));let L;if(d.Directory.is(O)&&O.expanded)L=O;else if(O)d.Directory.isRoot(O.parent)?L=O:L=O.parent;else return;this.focusedFile=L,L&&L.expanded&&(await this.fileTreeHandle.collapseNode(L),this.activeFileFocusedDecoration(L,!0))}async expandCurrentFile(){let O;this.focusedFile?(O=this.focusedFile,this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0):this.contextMenuFile&&(O=this.contextMenuFile,this.focusedDecoration.removeTarget(this.contextMenuFile),this.contextMenuFile=void 0);const P=this.selectedFiles.indexOf(O);P>=0&&(this.selectedFiles.splice(P,1),this.selectedDecoration.removeTarget(O)),this.focusedFile=O,d.Directory.is(O)&&(O.expanded||await this.fileTreeHandle.expandNode(O))}async collapseAll(){await this.treeModel.root.collapsedAll();const O=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY);O&&this.explorerStorage.set(n.FILE_TREE_SNAPSHOT_KEY,{...O,expandedDirectories:{atSurface:[],buried:[]}})}async deleteFileByUris(O){var P;if(O.length===0)return;if(this.corePreferences["explorer.confirmDelete"]){const B=(0,b.localize)("file.confirm.delete.ok"),F=(0,b.localize)("file.confirm.delete.cancel"),U=`[ ${O.slice(0,5).map(H=>H.displayName).join(",")}${O.length>5?" ...":""} ]`;if(await this.dialogService.warning((0,b.formatLocalize)("file.confirm.delete",U),[F,B])!==B)return}const L=this.fileTreeService.sortPaths(O);let N;if(this.treeModel.root.branchSize===O.length)N=void 0;else if(this.selectedFiles.length&&!L.find(B=>B.path.toString()===this.selectedFiles[0].uri.toString()))N=this.selectedFiles[0];else{const B=(P=L[L.length-1])===null||P===void 0?void 0:P.node;if(!B)N=void 0;else{let U=this.treeModel.root.getIndexAtTreeNode(B)+1;if(U>=this.treeModel.root.branchSize){const V=L[0].node;U=this.treeModel.root.getIndexAtTreeNode(V)-1}N=this.treeModel.root.getTreeNodeAtIndex(U)}}const k=[];L.forEach(B=>{this.loadingDecoration.addTarget(B.node),k.push(this.deleteFile(B.node,B.path).then(F=>(this.loadingDecoration.removeTarget(B.node),F)))}),this.treeModel.dispatchChange(),await Promise.all(k),N&&this.activeFileDecoration(N)}async deleteFile(O,P){const L=typeof P=="string"?new b.URI(P):P,N=await this.fileTreeAPI.delete(L);return N?(this.messageService.error(N),!1):((B=>{var F,U,V;B.uri.isEqual(L)?this.fileTreeService.deleteAffectedNodeByPath(B.path):this.fileTreeService.refresh(O.parent),this.loadingDecoration.removeTarget(B),(F=this.contextKey)===null||F===void 0||F.explorerCompressedFocusContext.set(!1),(U=this.contextKey)===null||U===void 0||U.explorerCompressedFirstFocusContext.set(!1),(V=this.contextKey)===null||V===void 0||V.explorerCompressedLastFocusContext.set(!1)})(O),!0)}getWellFormedFileName(O){return O&&(O=w(O," "),O=I(O,"."),O=I(O,"/"),O=I(O,"\\"),O)}trimLongName(O){return O&&O.length>255?`${O.substr(0,255)}...`:O}async getPromptTarget(O,P){let L;if(O.isEqual(this.treeModel.root.uri))L=await this.fileTreeService.getNodeByPathOrUri(O);else if(this.focusedFile)L=this.focusedFile;else if(this.contextMenuFile)L=this.contextMenuFile;else if(this.selectedFiles.length>0){const k=this.selectedFiles[this.selectedFiles.length-1];if(this.treeModel.root.isItemVisibleAtSurface(k))L=k;else{const B=await this.fileTreeService.getFileTreeNodePathByUri(O);L=await this.treeModel.root.loadTreeNodeByPath(B)}}else L=await this.fileTreeService.getNodeByPathOrUri(O);L||(L=this.treeModel.root);const N=A.splitPath(L.name);if(d.Directory.isRoot(L))return L;if(L.name!==O.displayName&&N[N.length-1]!==O.displayName&&P){const k=O.relative(L.uri).toString(),B=L.name.replace(`${A.separator}${k}`,""),F=L.parent.uri.resolve(B),U=k.split(A.separator)[0];if(!B)return;if(L.children)for(const V of L.children)this.fileTreeService.deleteAffectedNodeByPath(V.path,!0);L.updateMetaData({name:B?.toString(),uri:F,tooltip:this.fileTreeAPI.getReadableTooltip(F),fileStat:{...L.filestat,uri:F.toString()}}),this.fileTreeService.addNode(L,U,f.TreeNodeType.CompositeTreeNode)}return L}async newFilePrompt(O){const P=await this.getPromptTarget(O,!0);P&&this.proxyPrompt(await this.fileTreeHandle.promptNewTreeNode(P))}async newDirectoryPrompt(O){const P=await this.getPromptTarget(O,!0);P&&this.proxyPrompt(await this.fileTreeHandle.promptNewCompositeTreeNode(P))}async renamePrompt(O){const P=await this.getPromptTarget(O);P&&this.proxyPrompt(await this.fileTreeHandle.promptRename(P,O.displayName))}selectChildNode(O){var P;for(const L of O){const N=this.fileTreeService.getNodeByPathOrUri(L);if(N){const k=d.Directory.isRoot(N)?N.children:(P=N.parent)===null||P===void 0?void 0:P.children;if(k){const B=k[0],F=k[k.length-1],U=this.treeModel.root.getIndexAtTreeNode(B),V=this.treeModel.root.getIndexAtTreeNode(F);this.activeFileDecorationByRange(U,V)}}}}dispose(){this._isDisposed=!0}};e.FileTreeModelService=R,R.FILE_TREE_SNAPSHOT_KEY="FILE_TREE_SNAPSHOT",R.DEFAULT_REFRESHED_ACTION_DELAY=500,R.DEFAULT_LOCATION_FLUSH_DELAY=200,R.DEFAULT_LABEL_CHANGED_DELAY=500,s.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),s.__metadata("design:type",o.Injector)],R.prototype,"injector",void 0),s.__decorate([(0,o.Autowired)(a.IFileTreeService),s.__metadata("design:type",y.FileTreeService)],R.prototype,"fileTreeService",void 0),s.__decorate([(0,o.Autowired)(b.CorePreferences),s.__metadata("design:type",Object)],R.prototype,"corePreferences",void 0),s.__decorate([(0,o.Autowired)(v.ICtxMenuRenderer),s.__metadata("design:type",v.ICtxMenuRenderer)],R.prototype,"ctxMenuRenderer",void 0),s.__decorate([(0,o.Autowired)(v.AbstractContextMenuService),s.__metadata("design:type",v.AbstractContextMenuService)],R.prototype,"contextMenuService",void 0),s.__decorate([(0,o.Autowired)(a.IFileTreeAPI),s.__metadata("design:type",Object)],R.prototype,"fileTreeAPI",void 0),s.__decorate([(0,o.Autowired)(h.IFileServiceClient),s.__metadata("design:type",Object)],R.prototype,"filesystem",void 0),s.__decorate([(0,o.Autowired)(b.StorageProvider),s.__metadata("design:type",Function)],R.prototype,"storageProvider",void 0),s.__decorate([(0,o.Autowired)(l.IDialogService),s.__metadata("design:type",Object)],R.prototype,"dialogService",void 0),s.__decorate([(0,o.Autowired)(E.LabelService),s.__metadata("design:type",E.LabelService)],R.prototype,"labelService",void 0),s.__decorate([(0,o.Autowired)(l.IMessageService),s.__metadata("design:type",Object)],R.prototype,"messageService",void 0),s.__decorate([(0,o.Autowired)(u.WorkbenchEditorService),s.__metadata("design:type",u.WorkbenchEditorService)],R.prototype,"editorService",void 0),s.__decorate([(0,o.Autowired)(b.CommandService),s.__metadata("design:type",Object)],R.prototype,"commandService",void 0),s.__decorate([(0,o.Autowired)(c.IMainLayoutService),s.__metadata("design:type",Object)],R.prototype,"mainlayoutService",void 0),s.__decorate([(0,o.Autowired)(b.IClipboardService),s.__metadata("design:type",Object)],R.prototype,"clipboardService",void 0),e.FileTreeModelService=R=n=s.__decorate([(0,o.Injectable)()],R)},4446:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SymlinkDecorationsProvider=void 0;const n=t(85608),s=t(76003),o=t(41869),f=t(57781);let b=class{constructor(v){this.fileTreeService=v,this.label="symbollink",this.onDidChangeEmitter=new o.Emitter}get onDidChange(){return this.onDidChangeEmitter.event}provideDecorations(v){const E=this.fileTreeService.getNodeByPathOrUri(v.toString());if(E&&E.filestat&&E.filestat.isSymbolicLink)return{letter:"\u2937",source:E.filestat.uri,color:"gitDecoration.ignoredResourceForeground",tooltip:(0,o.localize)("file.tooltip.symbolicLink"),weight:-1,bubble:!E.filestat.isDirectory}}};e.SymlinkDecorationsProvider=b,e.SymlinkDecorationsProvider=b=n.__decorate([n.__param(0,(0,s.Optional)()),n.__metadata("design:paramtypes",[f.FileTreeService])],b)},69959:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.File=e.Directory=void 0;const n=t(97267),s=t(41869);class o extends n.CompositeTreeNode{static is(g){return n.CompositeTreeNode.is(g)}constructor(g,v,E=new s.URI(""),u="",h={children:[],isDirectory:!0,uri:"",lastModification:0},c){super(g,v,void 0,{name:u}),this.uri=E,this.filestat=h,this.tooltip=c,v||(this.isExpanded=!0)}get displayName(){return this.name}updateName(g){this.name!==g&&(n.TreeNode.removeTreeNode(this.id,this.path),this.name=g,n.TreeNode.setTreeNode(this.id,this.path,this))}updateURI(g){this.uri=g}updateFileStat(g){this.filestat=g}updateToolTip(g){this.tooltip=g}updateMetaData(g){const{fileStat:v,tooltip:E,name:u,uri:h}=g;u&&this.updateName(u),v&&this.updateFileStat(v),h&&this.updateURI(h),E&&this.updateToolTip(E)}}e.Directory=o;class f extends n.TreeNode{static is(g){return n.TreeNode.is(g)}constructor(g,v,E=new s.URI(""),u="",h={children:[],isDirectory:!1,uri:"",lastModification:0},c){super(g,v,void 0,{name:u}),this.uri=E,this.filestat=h,this.tooltip=c}get displayName(){return this.name}updateName(g){this.name!==g&&(n.TreeNode.removeTreeNode(this.id,this.path),this.name=g,n.TreeNode.setTreeNode(this.id,this.path,this))}updateURI(g){this.uri=g}updateFileStat(g){this.filestat=g}updateToolTip(g){this.tooltip=g}updateMetaData(g){const{fileStat:v,tooltip:E,name:u,uri:h}=g;u&&this.updateName(u),v&&this.updateFileStat(v),h&&this.updateURI(h),E&&this.updateToolTip(E)}}e.File=f},6250:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RESOURCE_VIEW_ID=e.IFileDialogTreeService=e.IFileDialogModel=e.PasteTypes=e.FileStatNode=e.FileTreeExpandedStatusUpdateEvent=e.IFileTreeService=e.IFileTreeAPI=e.FILE_EXPLORER_WELCOME_ID=void 0;const n=t(43718);e.FILE_EXPLORER_WELCOME_ID="file-explorer",e.IFileTreeAPI=Symbol("IFileTreeAPI"),e.IFileTreeService=Symbol("IFileTreeService");class s extends n.BasicEvent{}e.FileTreeExpandedStatusUpdateEvent=s;var o;(function(b){function g(u){return!!u&&"filestat"in u}b.is=g;function v(u){return!!u&&"filestat"in u&&!u.fileStat.isDirectory}b.isContentFile=v;function E(u){if(g(u))return u.filestat.uri}b.getUri=E})(o||(e.FileStatNode=o={}));var f;(function(b){b[b.NONE=0]="NONE",b[b.COPY=1]="COPY",b[b.CUT=2]="CUT"})(f||(e.PasteTypes=f={})),e.IFileDialogModel=Symbol("IFileDialogModel"),e.IFileDialogTreeService=Symbol("IFileDialogTreeService"),e.RESOURCE_VIEW_ID="file-explorer"},87518:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=t(85608);n.__exportStar(t(6250),e),n.__exportStar(t(83709),e)},67240:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.browserViews=void 0,e.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
|
|
28224
|
+
`,y){const S=this.hashCalculateService.calculate(a);return l.length>v.FILE_SAVE_BY_CHANGE_THRESHOLD?await this.fileSchemeDocClient.saveByChange(r.toString(),{baseMd5:S,changes:d,eol:_},p,m,y):await this.fileSchemeDocClient.saveByContent(r.toString(),{baseMd5:S,content:l},p,m,y)}async provideEditorDocumentModelContentMd5(r,l){return this.fileSchemeDocClient.getMd5(r.toString(),l)}};e.FileSchemeDocumentProvider=E,n.__decorate([(0,s.Autowired)(g.IFileServiceClient),n.__metadata("design:type",Object)],E.prototype,"fileServiceClient",void 0),n.__decorate([(0,s.Autowired)(v.IFileSchemeDocClient),n.__metadata("design:type",Object)],E.prototype,"fileSchemeDocClient",void 0),n.__decorate([(0,s.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],E.prototype,"preferenceService",void 0),n.__decorate([(0,s.Autowired)(f.IHashCalculateService),n.__metadata("design:type",Object)],E.prototype,"hashCalculateService",void 0),e.FileSchemeDocumentProvider=E=n.__decorate([(0,s.Injectable)()],E);let u=class{constructor(){this._onDidChangeContent=new o.Emitter,this.onDidChangeContent=this._onDidChangeContent.event,this.listeners={}}isReadonly(r){return!0}handlesScheme(r){return r==="vscode"}async provideEditorDocumentModelContent(r,l){return this.getSchemaContent(r)}getSchemaContent(r){const l=r.toString(),a=this.jsonRegistry.getSchemaContributions().schemas[l];if(a){const d=JSON.stringify(a);if(!this.listeners[l]){const p=o.Disposable.create(()=>{this.jsonRegistry.onDidChangeSchema(m=>{m===l&&this._onDidChangeContent.fire(r)})});this.listeners[l]=p}return d}return"{}"}onDidDisposeModel(r){r.toString()&&(this.listeners[r.toString()].dispose(),delete this.listeners[r.toString()])}};e.VscodeSchemeDocumentProvider=u,n.__decorate([(0,s.Autowired)(o.ISchemaStore),n.__metadata("design:type",Object)],u.prototype,"schemaStore",void 0),n.__decorate([(0,s.Autowired)(o.IJSONSchemaRegistry),n.__metadata("design:type",Object)],u.prototype,"jsonRegistry",void 0),e.VscodeSchemeDocumentProvider=u=n.__decorate([(0,s.Injectable)()],u);let h=class{constructor(){this.documentContentMaps=new Map,this._onDidChangeContent=new o.Emitter,this.onDidChangeContent=this._onDidChangeContent.event}handlesScheme(r){return r===o.Schemes.walkThroughSnippet}provideEditorDocumentModelContent(r,l){return this.documentContentMaps.has(r.toString())||this.documentContentMaps.set(r.toString(),""),this.documentContentMaps.get(r.toString())}isReadonly(){return!1}preferLanguageForUri(){return"plaintext"}};e.WalkThroughSnippetSchemeDocumentProvider=h,e.WalkThroughSnippetSchemeDocumentProvider=h=n.__decorate([(0,s.Injectable)()],h)},41352:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileSchemeDocClientService=void 0;const n=t(85608),s=t(76003),o=t(80449);let f=class{saveByChange(g,v,E,u,h){return this.fileDocBackendService.$saveByChange(g,v,E,u,h)}saveByContent(g,v,E,u,h){return this.fileDocBackendService.$saveByContent(g,v,E,u,h)}getMd5(g,v){return this.fileDocBackendService.$getMd5(g,v)}};e.FileSchemeDocClientService=f,n.__decorate([(0,s.Autowired)(o.FileSchemeDocNodeServicePath),n.__metadata("design:type",Object)],f.prototype,"fileDocBackendService",void 0),e.FileSchemeDocClientService=f=n.__decorate([(0,s.Injectable)()],f)},17276:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileSystemEditorComponentContribution=e.FileSystemEditorResourceContribution=void 0;const n=t(85608),s=t(76003),o=t(41869),f=t(26542),b=t(57517),g=t(17878),v=t(42933),E=t(57646),u=t(60387),h=t(88819),c=t(99025),r="video-preview",l="image-preview",a="external-file",d="large-file-prevent";let p=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)}};e.FileSystemEditorResourceContribution=p,n.__decorate([(0,s.Autowired)(),n.__metadata("design:type",u.FileSchemeDocumentProvider)],p.prototype,"fileSchemeDocumentProvider",void 0),n.__decorate([(0,s.Autowired)(),n.__metadata("design:type",u.VscodeSchemeDocumentProvider)],p.prototype,"vscodeSchemeDocumentProvider",void 0),n.__decorate([(0,s.Autowired)(),n.__metadata("design:type",u.WalkThroughSnippetSchemeDocumentProvider)],p.prototype,"walkThroughSnippetSchemeDocumentProvider",void 0),n.__decorate([(0,s.Autowired)(),n.__metadata("design:type",g.UntitledSchemeResourceProvider)],p.prototype,"untitledResourceProvider",void 0),n.__decorate([(0,s.Autowired)(),n.__metadata("design:type",g.UntitledSchemeDocumentProvider)],p.prototype,"untitledSchemeDocumentProvider",void 0),e.FileSystemEditorResourceContribution=p=n.__decorate([(0,o.Domain)(b.BrowserEditorContribution)],p);let m=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:l,scheme:o.Schemes.file}),y.registerEditorComponent({component:c.VideoPreview,uid:r,scheme:o.Schemes.file}),y.registerEditorComponent({component:E.BinaryEditorComponent,uid:a,scheme:o.Schemes.file}),y.registerEditorComponent({component:h.LargeFilePrevent,uid:d,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:b.EditorOpenType.component,componentId:a})}),y.registerEditorComponentResolver(S=>S===o.Schemes.file||this.fileServiceClient.handlesScheme(S)?10:-1,async(S,A)=>{const T=await this.getFileType(S.uri.toString());switch(T){case"image":{A.push({type:b.EditorOpenType.component,componentId:l});break}case"video":{A.push({type:b.EditorOpenType.component,componentId:r});break}case"binary":case"text":{const{metadata:D,uri:w}=S,I=D||{};if(T==="binary"&&!I.skipPreventBinary)break;const R=await this.fileServiceClient.getFileStat(w.toString());await this.preference.ready;const M=this.preference.getValid("editor.largeFile",4*1024*1024*1024);R&&(R.size||0)>M&&!I.skipPreventTooLarge?A.push({type:b.EditorOpenType.component,componentId:d}):A.push({type:b.EditorOpenType.code,title:(0,o.localize)("editorOpenType.code")});break}}}),y.registerEditorComponentResolver(o.Schemes.untitled,(S,A,T)=>{T([{type:b.EditorOpenType.code,priority:"default"}])})}async getFileType(y){return this.cachedFileType.has(y)||((0,f.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"}}};e.FileSystemEditorComponentContribution=m,n.__decorate([(0,s.Autowired)(v.IFileServiceClient),n.__metadata("design:type",Object)],m.prototype,"fileServiceClient",void 0),n.__decorate([(0,s.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],m.prototype,"preference",void 0),e.FileSystemEditorComponentContribution=m=n.__decorate([(0,o.Domain)(b.BrowserEditorContribution),n.__metadata("design:paramtypes",[])],m)},52568:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileSchemeModule=void 0;const n=t(85608),s=t(76003),o=t(41869),f=t(80449),b=t(41352),g=t(17276);let v=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[g.FileSystemEditorResourceContribution,g.FileSystemEditorComponentContribution,{token:f.IFileSchemeDocClient,useClass:b.FileSchemeDocClientService}],this.backServices=[{servicePath:f.FileSchemeDocNodeServicePath}]}};e.FileSchemeModule=v,e.FileSchemeModule=v=n.__decorate([(0,s.Injectable)()],v)},88819:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LargeFilePrevent=e.PreventComponent=void 0;const n=t(85608),s=n.__importDefault(t(53373)),o=n.__importDefault(t(14041)),f=t(41869),b=t(81878),g=t(54414),v=t(82196),E=n.__importDefault(t(19996)),u=c=>o.default.createElement("div",{className:E.default["error-page"]},o.default.createElement("div",{className:(0,s.default)(E.default.icon,(0,f.getExternalIcon)("warning"))}),o.default.createElement("div",{className:E.default.description},c.description),o.default.createElement("div",{className:E.default["actions-wrapper"]},c.actions.map((r,l)=>o.default.createElement(b.Button,{key:l,onClick:()=>r.onClick(),className:E.default["action-button"]},r.label))));e.PreventComponent=u;const h=()=>{const c=(0,f.useInjectable)(g.WorkbenchEditorService),r=(0,f.useInjectable)(f.IEventBus),l=()=>{const a=c.currentResource;a&&(a.metadata={...a.metadata,skipPreventTooLarge:!0},r.fire(new v.ResourceOpenTypeChangedEvent(a.uri)))};return o.default.createElement(e.PreventComponent,{description:(0,f.localize)("editor.largeFile.prevent"),actions:[{label:(0,f.localize)("editor.file.prevent.stillOpen"),onClick:()=>l()}]})};e.LargeFilePrevent=h},99025:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ImagePreview=e.VideoPreview=void 0;const n=t(85608),s=n.__importDefault(t(14041)),o=t(41869),f=t(40827),b=n.__importDefault(t(19996)),g=u=>{const h=(0,o.useInjectable)(f.StaticResourceService);return{src:s.default.useMemo(()=>h.resolveStaticResource(u.uri).toString(),[u])}},v=u=>{const{src:h}=g(u.resource);return s.default.createElement("div",{className:b.default.kt_video_preview},s.default.createElement("video",{autoPlay:!0,controls:!0,className:b.default.kt_video,src:h}))};e.VideoPreview=v;const E=u=>{const h=s.default.useRef(),c=s.default.useRef(),{src:r}=g(u.resource);return s.default.useEffect(()=>{const l=new o.Disposable;return h.current&&(h.current.src=r),()=>{l.dispose()}},[u.resource]),s.default.createElement("div",{className:b.default.kt_image_preview},s.default.createElement("div",{ref:c},s.default.createElement("img",{ref:l=>l&&(h.current=l)})))};e.ImagePreview=E},80449:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChangeType=e.FileSchemeDocNodeServicePath=e.IFileSchemeDocNodeService=e.IFileSchemeDocClient=e.FILE_SAVE_BY_CHANGE_THRESHOLD=e.FILE_ON_DISK_SCHEME=void 0,e.FILE_ON_DISK_SCHEME="fileOnDisk",e.FILE_SAVE_BY_CHANGE_THRESHOLD=1e5,e.IFileSchemeDocClient=Symbol("IFileSchemeDocClient"),e.IFileSchemeDocNodeService=Symbol("FileSchemeDocNodeService"),e.FileSchemeDocNodeServicePath="FileSchemeDocNodeService";var t;(function(n){n[n.ADDED=1]="ADDED",n[n.REMOVED=2]="REMOVED"})(t||(e.ChangeType=t={}))},15625:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IFileSearchService=e.FileSearchServicePath=void 0,e.FileSearchServicePath="FileSearchServicePath",e.IFileSearchService=Symbol("FileSearchService")},84660:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),t(85608).__exportStar(t(15625),e)},2156:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileServiceClient=e.BrowserFileSystemRegistryImpl=void 0;const n=t(85608),s=t(32852),o=t(76003),f=t(41869),b=t(43718),g=t(37406),v=t(8170),E=t(41682),u=t(42933),h=t(81952);let c=class{constructor(){this.providers=new Map}registerFileSystemProvider(a){const d=a.scheme;return this.providers.set(d,a),{dispose:()=>{this.providers.delete(d)}}}};e.BrowserFileSystemRegistryImpl=c,e.BrowserFileSystemRegistryImpl=c=n.__decorate([(0,o.Injectable)()],c);let r=class{get clientId(){return this.applicationService.clientId}constructor(){this.watcherWithSchemaMap=new Map,this.watcherDisposerMap=new Map,this.onFileChangedEmitter=new f.Emitter,this.onFileProviderChangedEmitter=new f.Emitter,this._onFilesChanged=new f.Emitter,this.onFilesChanged=this._onFilesChanged.event,this._onFileProviderChanged=new f.Emitter,this.onFileProviderChanged=this._onFileProviderChanged.event,this._onDidChangeFileSystemProviderRegistrations=new f.Emitter,this.onDidChangeFileSystemProviderRegistrations=this._onDidChangeFileSystemProviderRegistrations.event,this._onWillActivateFileSystemProvider=new f.Emitter,this.onWillActivateFileSystemProvider=this._onWillActivateFileSystemProvider.event,this._onDidChangeFileSystemProviderCapabilities=new f.Emitter,this.onDidChangeFileSystemProviderCapabilities=this._onDidChangeFileSystemProviderCapabilities.event,this.filesExcludesMatcherList=[],this.watcherId=0,this.toDisposable=new f.DisposableCollection,this.watchFileExcludes=[],this.watchFileExcludesMatcherList=[],this.filesExcludes=[],this.workspaceRoots=[],this._providerChanged=new Set,this.fsProviders=new Map,this.userHomeDeferred=new f.Deferred,this.options={encoding:"utf8",overwrite:!1,recursive:!0,moveToTrash:!0},this.uriWatcherMap=new Map,this.toDisposable.push(this.onDidChangeFileSystemProviderRegistrations(a=>{a.added&&a.scheme===b.Schemes.file&&this.doGetCurrentUserHome()}))}async initialize(){const a=await this.getProvider(b.Schemes.file);a.initialize&&await a.initialize(this.clientId)}async doGetCurrentUserHome(){const d=(await this.getProvider(b.Schemes.file)).getCurrentUserHome();this.userHomeDeferred.resolve(d)}handlesScheme(a){return this.registry.providers.has(a)||this.fsProviders.has(a)}dispose(){return this.toDisposable.dispose()}async resolveContent(a,d){const p=this.convertUri(a),_=await(await this.getProvider(p.scheme)).readFile(p.codeUri),y=_.data||_;return{content:f.BinaryBuffer.wrap(Uint8Array.from(y)).toString(d?.encoding)}}async readFile(a){const d=this.convertUri(a),m=await(await this.getProvider(d.scheme)).readFile(d.codeUri),_=m.data||m;return{content:f.BinaryBuffer.wrap(Uint8Array.from(_))}}async readFileStream(a){const d=this.convertUri(a);return await(await this.getProvider(d.scheme)).readFileStream(d.codeUri)}async getFileStat(a,d=!0){const p=this.convertUri(a),m=await this.getProvider(p.scheme);try{const _=await m.stat(p.codeUri);if(!_)throw u.FileSystemError.FileNotFound(p.codeUri.toString(),"File not found.");return this.filterStat(_,d)}catch(_){if(u.FileSystemError.FileNotFound.is(_))return}}async setContent(a,d,p){const m=this.convertUri(a.uri),_=await this.getProvider(m.scheme),y=await _.stat(m.codeUri);if(!y)throw u.FileSystemError.FileNotFound(a.uri,"File not found.");if(y.isDirectory)throw u.FileSystemError.FileIsADirectory(a.uri,"Cannot set the content.");if(!await this.isInSync(a,y))throw this.createOutOfSyncError(a);return await _.writeFile(m.codeUri,typeof d=="string"?f.BinaryBuffer.fromString(d).buffer:d,{create:!1,overwrite:!0,encoding:p?.encoding}),await _.stat(m.codeUri)}async updateContent(a,d,p){const m=this.convertUri(a.uri),_=await this.getProvider(m.scheme),y=await _.stat(m.codeUri);if(!y)throw u.FileSystemError.FileNotFound(a.uri,"File not found.");if(y.isDirectory)throw u.FileSystemError.FileIsADirectory(a.uri,"Cannot set the content.");if(!this.checkInSync(a,y))throw this.createOutOfSyncError(a);if(d.length===0)return y;const S=await _.readFile(m.codeUri),A=this.applyContentChanges(f.BinaryBuffer.wrap(S).toString(p?.encoding),d);await _.writeFile(m.codeUri,f.BinaryBuffer.fromString(A).buffer,{create:!1,overwrite:!0,encoding:p?.encoding});const T=await _.stat(m.codeUri);if(!T)throw u.FileSystemError.FileNotFound(m.codeUri.toString(),"File not found.");return T}async createFile(a,d){const p=this.convertUri(a),m=await this.getProvider(p.scheme),_=f.BinaryBuffer.fromString(d?.content||"").buffer;let y=await m.writeFile(p.codeUri,_,{create:!0,overwrite:d&&d.overwrite||!1,encoding:d?.encoding});return y=y||await m.stat(p.codeUri),y}async createFolder(a){const d=this.convertUri(a),p=await this.getProvider(d.scheme),m=await p.createDirectory(d.codeUri);return m||await p.stat(d.codeUri)}async move(a,d,p){const m=this.convertUri(a),_=this.convertUri(d),y=await this.getProvider(m.scheme),S=await y.rename(m.codeUri,_.codeUri,{overwrite:!!(p&&p.overwrite)});return S||await y.stat(_.codeUri)}async copy(a,d,p){const m=this.convertUri(a),_=this.convertUri(d),y=await this.getProvider(m.scheme),S=await this.doGetOverwrite(p);if(!(0,u.containsExtraFileMethod)(y,"copy"))throw this.getErrorProvideNotSupport(m.scheme,"copy");const A=await y.copy(m.codeUri,_.codeUri,{overwrite:!!S});return A||await y.stat(_.codeUri)}async getFsPath(a){if(a.startsWith("file:/"))return f.FileUri.fsPath(a)}fireFilesChange(a){const d=a.changes.map(p=>({uri:p.uri,type:p.type}));this._onFilesChanged.fire(d),this.eventBus.fire(new f.FilesChangeEvent(d))}async watchFileChanges(a,d){const m=(this.appConfig.unRecursiveDirectories||[]).some(I=>a.path.toString().startsWith(I)),_=this.convertUri(a.toString()),y=this.uriWatcherMap.get(_.toString());if(y)if(y.isDisposed())this.uriWatcherMap.delete(_.toString());else return y;const S=this.watcherId++,A=await this.getProvider(_.scheme),T=this.watcherWithSchemaMap.get(_.scheme)||[],D=await A.watch(_.codeUri,{excludes:d,recursive:!m});this.watcherDisposerMap.set(S,{dispose:async()=>{const I=this.uriWatcherMap.get(_.toString());await Promise.all([A.unwatch&&A.unwatch(D),I&&I.dispose()]),this.uriWatcherMap.delete(_.toString())}}),T.push(S),this.watcherWithSchemaMap.set(_.scheme,T);const w=new h.FileSystemWatcher({fileServiceClient:this,watchId:S,uri:a});return this.uriWatcherMap.set(_.toString(),w),w}async setWatchFileExcludes(a){return await(await this.getProvider(b.Schemes.file)).setWatchFileExcludes(a)}async getWatchFileExcludes(){return await(await this.getProvider(b.Schemes.file)).getWatchFileExcludes()}async setFilesExcludes(a,d){this.filesExcludes=a,this.filesExcludesMatcherList=[],d&&this.setWorkspaceRoots(d),this.updateExcludeMatcher()}async setWorkspaceRoots(a){this.workspaceRoots=a,this.updateExcludeMatcher()}async unwatchFileChanges(a){const d=this.watcherDisposerMap.get(a);if(!(!d||!d.dispose))return this.watcherDisposerMap.delete(a),d.dispose()}async delete(a,d){if(this.appConfig.isElectronRenderer&&d?.moveToTrash!==!1){const _=new f.URI(a);if(_.scheme===b.Schemes.file)return this.injector.get(g.IElectronMainUIService).moveToTrash(_.codeUri.fsPath)}const p=this.convertUri(a),m=await this.getProvider(p.scheme);await m.stat(p.codeUri),await m.delete(p.codeUri,{recursive:!0,moveToTrash:await this.doGetMoveToTrash(d)})}async getEncoding(a){return"utf8"}listCapabilities(){return E.Iterable.map(this.fsProviders,([a,d])=>({scheme:a,capabilities:d.capabilities}))}registerProvider(a,d){if(this.fsProviders.has(a))throw new Error(`The file system provider for \`${a}\` already registered`);const p=[];this.fsProviders.set(a,d),this._onDidChangeFileSystemProviderRegistrations.fire({added:!0,scheme:a,provider:d}),p.push({dispose:()=>{this._onDidChangeFileSystemProviderRegistrations.fire({added:!1,scheme:a,provider:d}),this.fsProviders.delete(a),this._providerChanged.add(a)}}),d.onDidChangeFile&&p.push(d.onDidChangeFile(_=>this.fireFilesChange({changes:_}))),this.toDisposable.push(d.onDidChangeCapabilities(()=>this._onDidChangeFileSystemProviderCapabilities.fire({provider:d,scheme:a}))),p.push({dispose:async()=>{const _=[];(this.watcherWithSchemaMap.get(a)||[]).forEach(y=>_.push(this.unwatchFileChanges(y))),await Promise.all(_)}}),this._providerChanged.add(a),this.onFileProviderChangedEmitter.fire(Array.from(this._providerChanged)),this.toDisposable.pushAll(p);const m=new f.DisposableCollection;return m.pushAll(p),this._onFileProviderChanged.fire(Array.from(this._providerChanged)),m}async access(a,d=u.FileAccess.Constants.F_OK){const p=this.convertUri(a),m=await this.getProvider(p.scheme);if(!(0,u.containsExtraFileMethod)(m,"access"))throw this.getErrorProvideNotSupport(p.scheme,"access");return await m.access(p.codeUri,d)}async getFileType(a){const d=this.convertUri(a),p=await this.getProvider(d.scheme);if(!(0,u.containsExtraFileMethod)(p,"getFileType"))throw this.getErrorProvideNotSupport(d.scheme,"getFileType");return await p.getFileType(a)}async getCurrentUserHome(){return this.userHomeDeferred.promise}getErrorProvideNotSupport(a,d){return`Scheme ${a} not support this function: ${d}.`}convertUri(a){const d=new f.URI(a);if(!d.scheme)throw new Error(`Unsupported convert Uri with non-scheme Uri: ${a}`);return d}updateExcludeMatcher(){this.filesExcludes.forEach(a=>{this.workspaceRoots.length>0?this.workspaceRoots.forEach(d=>{const m=new f.URI(d).resolve(a).path.toString();this.filesExcludesMatcherList.push((0,f.parseGlob)(m))}):this.filesExcludesMatcherList.push((0,f.parseGlob)(a))})}async shouldWaitProvider(a){const d=await this._onWillActivateFileSystemProvider.fireAndAwait({scheme:a}),{result:p}=d[0];if(p&&p.includes(a)){const m=await f.Event.toPromise(f.Event.filter(this.onFileProviderChanged,_=>_.includes(a)));if(!(0,b.isUndefined)(m))return!0}return!1}async getProvider(a){this._providerChanged.has(a)&&(await this.eventBus.fireAndAwait(new f.ExtensionActivateEvent({topic:"onFileSystem",data:a}),{timeout:3e3}),this._providerChanged.delete(a));const d=this.fsProviders.get(a);if(!d)throw new Error(`Not find ${a} provider.`);return d}async isReadonly(a){try{const d=new f.URI(a);return!!(await(await this.getProvider(d.scheme)).stat(this.convertUri(a).codeUri)).readonly}catch{return!1}}isExclude(a){const d=new f.URI(a);return this.filesExcludesMatcherList.some(p=>p(d.path.toString()))}filterStat(a,d=!0){if(a&&!this.isExclude(a.uri))return a.children&&d&&(a.children=this.filterStatChildren(a.children)),a}filterStatChildren(a){const d=[];return a.forEach(p=>{if(this.isExclude(p.uri))return!1;const m=this.filterStat(p);m&&d.push(m)}),d}applyContentChanges(a,d){let p=s.TextDocument.create("","",1,a);for(const m of d){let _=m.text;if(m.range){const y=p.offsetAt(m.range.start),S=p.offsetAt(m.range.end);_=p.getText().substr(0,y)+m.text+p.getText().substr(S)}p=s.TextDocument.create(p.uri,p.languageId,p.version,_)}return p.getText()}async isInSync(a,d){return!!this.checkInSync(a,d)}checkInSync(a,d){return d.lastModification===a.lastModification&&d.size===a.size}createOutOfSyncError(a){return u.FileSystemError.FileIsOutOfSync(a.uri)}async doGetEncoding(a){return a&&typeof a.encoding<"u"?a.encoding:this.options.encoding}async doGetOverwrite(a){return a&&typeof a.overwrite<"u"?a.overwrite:this.options.overwrite}async doGetRecursive(a){return a&&typeof a.recursive<"u"?a.recursive:this.options.recursive}async doGetMoveToTrash(a){return a&&typeof a.moveToTrash<"u"?a.moveToTrash:this.options.moveToTrash}};e.FileServiceClient=r,n.__decorate([(0,o.Autowired)(u.IBrowserFileSystemRegistry),n.__metadata("design:type",c)],r.prototype,"registry",void 0),n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],r.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(b.IEventBus),n.__metadata("design:type",Object)],r.prototype,"eventBus",void 0),n.__decorate([(0,o.Autowired)(f.AppConfig),n.__metadata("design:type",Object)],r.prototype,"appConfig",void 0),n.__decorate([(0,o.Autowired)(v.IApplicationService),n.__metadata("design:type",Object)],r.prototype,"applicationService",void 0),e.FileServiceClient=r=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],r)},69037:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileServiceContribution=void 0;const n=t(85608),s=t(76003),o=t(41869),f=t(42933),b=t(2156);let g=class{constructor(){this._disposables=new o.DisposableStore,this._disposables.add(this.fileSystem.registerProvider(o.Schemes.file,this.diskFileServiceProvider))}async initialize(){const E=this.contributionProvider.getContributions();await Promise.all(E.map(async u=>{u.registerProvider&&await u.registerProvider(this.fileSystem)})),await Promise.all(E.map(async u=>{u.onFileServiceReady&&await u.onFileServiceReady()})),this.fileSystem.initialize&&await this.fileSystem.initialize()}dispose(){this._disposables.dispose()}};e.FileServiceContribution=g,n.__decorate([(0,s.Autowired)(f.IFileServiceClient),n.__metadata("design:type",b.FileServiceClient)],g.prototype,"fileSystem",void 0),n.__decorate([(0,s.Autowired)(f.IDiskFileProvider),n.__metadata("design:type",Object)],g.prototype,"diskFileServiceProvider",void 0),n.__decorate([(0,s.Autowired)(o.FsProviderContribution),n.__metadata("design:type",Object)],g.prototype,"contributionProvider",void 0),e.FileServiceContribution=g=n.__decorate([(0,o.Domain)(o.ClientAppContribution),n.__metadata("design:paramtypes",[])],g)},60476:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DiskFsProviderClient=e.CoreFileServiceProviderClient=void 0;const n=t(85608),s=t(76003),o=t(43718),f=t(42933);class b{constructor(){this.onDidChangeFileEmitter=new o.Emitter,this.onDidChangeFile=this.onDidChangeFileEmitter.event}watch(E,u){return this.fileServiceProvider.watch(E,u)}unwatch(E){return this.fileServiceProvider.unwatch&&this.fileServiceProvider.unwatch(E)}async stat(E){return await this.fileServiceProvider.stat(E)}readDirectory(E){return this.fileServiceProvider.readDirectory(E)}createDirectory(E){return this.fileServiceProvider.createDirectory(E)}async readFile(E,u){return u&&(0,o.getDebugLogger)("fileService.fsProvider").warn("encoding option for fsProvider.readFile is deprecated"),await this.fileServiceProvider.readFile(E)}readFileStream(E){if(this.fileServiceProvider.readFileStream)return this.fileServiceProvider.readFileStream(E);throw new Error("readFileStream not supported")}writeFile(E,u,h){return this.fileServiceProvider.writeFile(E,Array.from(u),h)}delete(E,u){return this.fileServiceProvider.delete(E,u)}rename(E,u,h){return this.fileServiceProvider.rename(E,u,h)}}e.CoreFileServiceProviderClient=b,n.__decorate([(0,s.Autowired)(s.INJECTOR_TOKEN),n.__metadata("design:type",s.Injector)],b.prototype,"injector",void 0);let g=class extends b{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(E){var u,h;if(!((u=this.fileServiceProvider)===null||u===void 0)&&u.initialize)try{await((h=this.fileServiceProvider)===null||h===void 0?void 0:h.initialize(E))}catch(c){(0,o.getDebugLogger)("fileService.fsProvider").error("initialize error",c)}}setWatchFileExcludes(E){return this.fileServiceProvider.setWatchFileExcludes(E)}getWatchFileExcludes(){return this.fileServiceProvider.getWatchFileExcludes()}onDidFilesChanged(E){const u=E.changes.map(h=>({uri:h.uri,type:h.type}));this.onDidChangeFileEmitter.fire(u)}copy(E,u,h){return this.fileServiceProvider.copy(E,u,h)}access(E,u){return this.fileServiceProvider.access(E,u)}getCurrentUserHome(){return this.fileServiceProvider.getCurrentUserHome()}getFileType(E){return this.fileServiceProvider.getFileType(E)}};e.DiskFsProviderClient=g,n.__decorate([(0,s.Autowired)(f.DiskFileServicePath),n.__metadata("design:type",Object)],g.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)],g.prototype,"setWatchFileExcludes",null),e.DiskFsProviderClient=g=n.__decorate([(0,s.Injectable)()],g)},96708:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileServiceClientModule=void 0;const n=t(85608),s=t(76003),o=t(41869),f=t(42933),b=t(70671),g=t(2156),v=t(69037),E=t(60476),u=t(23188);let h=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:f.IFileServiceClient,useClass:g.FileServiceClient},{token:f.IBrowserFileSystemRegistry,useClass:g.BrowserFileSystemRegistryImpl},{token:f.IDiskFileProvider,useClass:E.DiskFsProviderClient},{token:f.IShadowFileProvider,useClass:u.ShadowFileSystemProvider},v.FileServiceContribution],this.backServices=[{servicePath:f.DiskFileServicePath,clientToken:f.IDiskFileProvider,protocol:b.DiskFileServiceProtocol}]}};e.FileServiceClientModule=h,e.FileServiceClientModule=h=n.__decorate([(0,s.Injectable)()],h)},23188:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ShadowFileSystemProvider=void 0;const n=t(85608),s=t(76003),o=t(41869);let f=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(g){throw new Error("Method not implemented.")}readFileStream(g){throw new Error("Method not implemented.")}watch(g,v){throw new Error("Method not implemented.")}stat(g){return Promise.resolve({uri:g.toString(),lastModification:0})}readDirectory(g){throw new Error("Method not implemented.")}createDirectory(g){throw new Error("Method not implemented.")}readFile(g){return this.shadowFiles.get(g.toString())||o.BinaryBuffer.fromString("no available").buffer}writeFile(g,v,E){this.shadowFiles.set(g.toString(),v)}delete(g,v){throw new Error("Method not implemented.")}rename(g,v,E){throw new Error("Method not implemented.")}copy(g,v,E){throw new Error("Method not implemented.")}exists(g){throw new Error("Method not implemented.")}access(g,v){throw new Error("Method not implemented.")}};e.ShadowFileSystemProvider=f,e.ShadowFileSystemProvider=f=n.__decorate([(0,s.Injectable)()],f)},81952:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileSystemWatcher=void 0;const n=t(43718);function s(f,b){return f.filter(g=>!!g.uri.startsWith(b))}class o{constructor(b){this.toDispose=new n.DisposableCollection,this.changeEmitter=new n.Emitter,this.toDispose.push(this.changeEmitter),this.fileServiceClient=b.fileServiceClient,this.watchId=b.watchId,this.uri=b.uri,this.fileServiceClient.onFilesChanged(g=>{const v=s(g,this.uri.toString());v&&v.length>0&&this.changeEmitter.fire(v)})}get onFilesChanged(){return this.changeEmitter.event}dispose(){return Promise.all([this.toDispose.dispose(),this.fileServiceClient.unwatchFileChanges(this.watchId)])}isDisposed(){return this.toDispose.disposed}}e.FileSystemWatcher=o},91813:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EXT_LIST_TEXT=e.EXT_LIST_IMAGE=e.EXT_LIST_VIDEO=void 0,e.getFileTypeByExt=t,e.EXT_LIST_VIDEO=new Set(["mp4","webm","mkv","mov","mts","flv","avi","wmv"]),e.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"]),e.EXT_LIST_TEXT=new Set(["xml"]);function t(n){let s="text";return n&&(e.EXT_LIST_IMAGE.has(n)?s="image":e.EXT_LIST_VIDEO.has(n)?s="video":e.EXT_LIST_TEXT.has(n)?s="text":s="binary"),s}},79929:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IBrowserFileSystemRegistry=e.IFileServiceClient=void 0;const n=t(43718);e.IFileServiceClient=n.IFileServiceClient,e.IBrowserFileSystemRegistry=Symbol("IBrowserFileSystemRegistry")},49818:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileSystemError=e.FileOperationError=e.FileSystemProviderError=e.FileSystemProviderErrorCode=e.FileAccess=e.IFileService=e.IShadowFileProvider=e.IDiskFileProvider=e.FileStat=e.FileType=void 0,e.createFileSystemProviderError=E,e.markAsFileSystemProviderError=u,e.containsExtraFileMethod=c,e.notEmpty=r,e.isErrnoException=l,e.handleError=a;const n=t(85608),s=t(43718);var o=t(31036);Object.defineProperty(e,"FileType",{enumerable:!0,get:function(){return o.FileType}}),Object.defineProperty(e,"FileStat",{enumerable:!0,get:function(){return o.FileStat}}),n.__exportStar(t(11854),e),e.IDiskFileProvider=Symbol("IDiskFileProvider"),e.IShadowFileProvider=Symbol("IShadowFileProvider"),e.IFileService=Symbol("IFileService");var f;(function(d){let p;(function(m){m.F_OK=0,m.R_OK=4,m.W_OK=2,m.X_OK=1})(p=d.Constants||(d.Constants={}))})(f||(e.FileAccess=f={}));var b;(function(d){d.FileExists="EntryExists",d.FileNotFound="EntryNotFound",d.FileNotADirectory="EntryNotADirectory",d.FileIsADirectory="EntryIsADirectory",d.FileIsOutOfSync="FileIsOutOfSync",d.FileExceedsMemoryLimit="EntryExceedsMemoryLimit",d.FileTooLarge="EntryTooLarge",d.FileWriteLocked="EntryWriteLocked",d.NoPermissions="NoPermissions",d.Unavailable="Unavailable",d.Unknown="Unknown"})(b||(e.FileSystemProviderErrorCode=b={}));class g extends Error{static declare(p,m){return Object.assign((..._)=>E(m(..._),p),{is:_=>{var y;return(y=_.stack)===null||y===void 0?void 0:y.startsWith(p)}})}constructor(p,m){super(p),this.code=m}is(p){return this.name===p.name}}e.FileSystemProviderError=g;class v extends Error{constructor(p,m,_){super(p),this.fileOperationResult=m,this.options=_}static isFileOperationError(p){return p instanceof Error&&!(0,s.isUndefinedOrNull)(p.fileOperationResult)}}e.FileOperationError=v;function E(d,p){const m=new g(d.toString(),p);return u(m,p),m}function u(d,p){return d.name=p?`${p} (FileSystemError)`:"FileSystemError",d}var h;(function(d){d.FileNotFound=g.declare(b.FileNotFound,(p,m)=>`${m?m+" ":""} '${p}' is not found.`),d.FileExists=g.declare(b.FileExists,(p,m)=>`${m?m+" ":""}'${p}' already exists.`),d.FileNotADirectory=g.declare(b.FileNotADirectory,(p,m)=>`${m?m+" ":""}'${p}' is not a directory.`),d.FileIsADirectory=g.declare(b.FileIsADirectory,(p,m)=>`${m?m+" ":""}'${p}' is a directory.`),d.FileIsOutOfSync=g.declare(b.FileIsOutOfSync,(p,m)=>`${m?m+" ":""}'${p}' is out of sync.`),d.FileExceedsMemoryLimit=g.declare(b.FileExceedsMemoryLimit,(p,m)=>`${m?m+" ":""}'${p}' is exceeds memory limit.`),d.FileTooLarge=g.declare(b.FileTooLarge,(p,m)=>`${m?m+" ":""}'${p}' is too large.`),d.FileWriteLocked=g.declare(b.FileWriteLocked,(p,m)=>`${m?m+" ":""}'${p}' is locked.`),d.FileIsNoPermissions=g.declare(b.NoPermissions,(p,m)=>`${m?m+" ":""}'${p}' is no permissions.`),d.Unavailable=g.declare(b.Unavailable,(p,m)=>`${m?m+" ":""}'${p}' is unavailable.`),d.Unknown=g.declare(b.Unknown,(p,m)=>`${m?m+" ":""}'${p}' is unkonw.`)})(h||(e.FileSystemError=h={}));function c(d,p){return(0,s.hasProperty)(d,p)&&(0,s.isFunction)(d[p])}function r(d){return d!==void 0}function l(d){return d.code!==void 0&&d.errno!==void 0}function a(d){var p,m,_,y,S;if(l(d))switch(d.code){case"EEXIST":throw h.FileExists(s.Uri.file((p=d.path)!==null&&p!==void 0?p:""));case"EPERM":case"EACCESS":throw h.FileIsNoPermissions(s.Uri.file((m=d.path)!==null&&m!==void 0?m:""));case"ENOENT":throw h.FileNotFound(s.Uri.file((_=d.path)!==null&&_!==void 0?_:""));case"ENOTDIR":throw h.FileNotADirectory(s.Uri.file((y=d.path)!==null&&y!==void 0?y:""));case"EISDIR":throw h.FileIsADirectory(s.Uri.file((S=d.path)!==null&&S!==void 0?S:""))}throw d}},42933:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=t(85608);n.__exportStar(t(79929),e),n.__exportStar(t(49818),e),n.__exportStar(t(28217),e),n.__exportStar(t(91813),e),n.__exportStar(t(50295),e)},70671:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DiskFileServiceProtocol=void 0;const n=t(26387),s=t(52890),o=t(50295);e.DiskFileServiceProtocol={name:o.DiskFileServicePath,methods:[{method:"readFile",request:[{name:"uri",type:s.UriComponentsProto}],response:{type:n.Type.binary()}}]}},50295:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileExtServicePath=e.FileWatcherServicePath=e.ShadowFileServicePath=e.DiskFileServicePath=e.FileServicePath=void 0,e.FileServicePath="FileService",e.DiskFileServicePath="DiskFileService",e.ShadowFileServicePath="ShadowFileService",e.FileWatcherServicePath="FileWatcherService",e.FileExtServicePath="FileExtServicePath"},28217:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WatcherProcessManagerProxy=e.WatcherServiceProxy=e.WATCHER_INIT_DATA_KEY=e.KT_WATCHER_PROCESS_SOCK_KEY=e.INsfw=void 0;const n=t(86058);var s;(function(o){let f;(function(b){b[b.CREATED=0]="CREATED",b[b.DELETED=1]="DELETED",b[b.MODIFIED=2]="MODIFIED",b[b.RENAMED=3]="RENAMED"})(f=o.actions||(o.actions={}))})(s||(e.INsfw=s={})),e.KT_WATCHER_PROCESS_SOCK_KEY="kt-watcher-process-sock",e.WATCHER_INIT_DATA_KEY="kt-watcher-init-data",e.WatcherServiceProxy=new n.ProxyIdentifier("WatcherHostServiceImpl"),e.WatcherProcessManagerProxy=new n.ProxyIdentifier("WatcherProcessManagerProxy")},14951:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),t(85608).__exportStar(t(42933),e)},57942:(x,e,t)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeDialogModel=void 0;const s=t(85608),o=t(76003),f=t(97267),b=t(41869),g=t(26542),v=t(6250),E=t(2812),u=s.__importDefault(t(89200)),h=t(9018);let c=n=class{static createContainer(l,a){return l.createChild([{token:v.IFileDialogTreeService,useValue:a},{token:v.IFileDialogModel,useClass:n}])}static createModel(l,a){return n.createContainer(l,a).get(v.IFileDialogModel)}constructor(){this.selectedDecoration=new f.Decoration(u.default.mod_selected),this.focusedDecoration=new f.Decoration(u.default.mod_focused),this.loadingDecoration=new f.Decoration(u.default.mod_loading),this.cutDecoration=new f.Decoration(u.default.mod_cut),this._selectedFiles=[],this.disposableCollection=new b.DisposableCollection,this.onDidFocusedFileChangeEmitter=new b.Emitter,this.onDidSelectedFileChangeEmitter=new b.Emitter,this.clearFileSelectedDecoration=()=>{this._selectedFiles.forEach(l=>{this.selectedDecoration.removeTarget(l)}),this._selectedFiles=[],this.onDidSelectedFileChangeEmitter.fire([])},this.activeFileDecoration=(l,a=!0)=>{l!==this.treeModel.root&&(this.preContextMenuFocusedFile&&(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile),this.preContextMenuFocusedFile=null),l&&(this.selectedFiles.length>0&&this.selectedFiles.forEach(d=>{this.selectedDecoration.removeTarget(d)}),this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.selectedDecoration.addTarget(l),this.focusedDecoration.addTarget(l),this._focusedFile=l,this._selectedFiles=[l],this.onDidFocusedFileChangeEmitter.fire(l.uri),this.onDidSelectedFileChangeEmitter.fire([l.uri]),a&&this.treeModel.dispatchChange()))},this.selectFileDecoration=(l,a=!0)=>{l!==this.treeModel.root&&(this.preContextMenuFocusedFile&&(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile),this.preContextMenuFocusedFile=null),l&&(this.selectedFiles.length>0&&this.selectedFiles.forEach(d=>{this.selectedDecoration.removeTarget(d)}),this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.selectedDecoration.addTarget(l),this._selectedFiles=[l],this.onDidSelectedFileChangeEmitter.fire([l.uri]),a&&this.treeModel.dispatchChange()))},this.activeFileFocusedDecoration=(l,a=!1)=>{l!==this.treeModel.root&&(this.focusedFile!==l&&(a?(this.preContextMenuFocusedFile?(this.focusedDecoration.removeTarget(this.preContextMenuFocusedFile),this.selectedDecoration.removeTarget(this.preContextMenuFocusedFile)):this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.preContextMenuFocusedFile=l):this.focusedFile&&(this.preContextMenuFocusedFile=null,this.focusedDecoration.removeTarget(this.focusedFile)),l&&(this.selectedDecoration.addTarget(l),this.focusedDecoration.addTarget(l),this._focusedFile=l,this._selectedFiles.push(l),this.onDidFocusedFileChangeEmitter.fire(l.uri),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(d=>d.uri)))),this.treeModel.dispatchChange())},this.activeFileSelectedDecoration=l=>{this._selectedFiles.indexOf(l)>-1||(this._selectedFiles.push(l),this.selectedDecoration.addTarget(l),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(a=>a.uri)),this.treeModel.dispatchChange())},this.activeFileDecorationByRange=(l,a)=>{for(this.clearFileSelectedDecoration(),this.preContextMenuFocusedFile=null;l<=a;l++){const d=this.treeModel.root.getTreeNodeAtIndex(l);d&&(this._selectedFiles.push(d),this.selectedDecoration.addTarget(d))}this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(d=>d.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 l=>{l.expanded?this.fileTreeHandle.collapseNode(l):this.fileTreeHandle.expandNode(l)},this.handleTreeBlur=()=>{this.enactiveFileDecoration()},this.handleTreeFocus=()=>{},this.handleItemRangeClick=(l,a)=>{if(!this.focusedFile)this.handleItemClick(l,a);else if(this.focusedFile&&this.focusedFile!==l){const d=this.treeModel.root.getIndexAtTreeNode(l),p=this.treeModel.root.getIndexAtTreeNode(this.focusedFile);p>d?this.activeFileDecorationByRange(d,p):p<d&&this.activeFileDecorationByRange(p,d)}},this.handleItemToggleClick=(l,a)=>{a!==f.TreeNodeType.CompositeTreeNode&&a!==f.TreeNodeType.TreeNode||(this.selectedFiles.indexOf(l)>-1?this.focusedFile===l?this.enactiveFileDecoration():this.activeFileFocusedDecoration(l):this.activeFileSelectedDecoration(l))},this.handleItemClick=(l,a)=>{this.clickTimes++,(a===f.TreeNodeType.CompositeTreeNode||a===f.TreeNodeType.TreeNode)&&this.activeFileDecoration(l),a===f.TreeNodeType.CompositeTreeNode&&this.corePreferences["workbench.list.openMode"]==="singleClick"&&this.toggleDirectory(l),this.clickTimer&&clearTimeout(this.clickTimer),this.clickTimer=setTimeout(()=>{this.clickTimes>1&&a!==f.TreeNodeType.TreeNode&&this.corePreferences["workbench.list.openMode"]==="doubleClick"&&this.toggleDirectory(l),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 l=(await this.fileTreeDialogService.resolveChildren())[0];this._treeModel=this.injector.get(E.FileTreeModel,[l]),this.initDecorations(l),this.disposableCollection.push(this._decorations),this.disposableCollection.push(this.labelService.onDidChange(()=>{this.treeModel.dispatchChange()})),this.disposableCollection.push(this.treeModel.root.watcher.on(f.TreeNodeEvent.WillResolveChildren,a=>{this.loadingDecoration.addTarget(a)})),this.disposableCollection.push(this.treeModel.root.watcher.on(f.TreeNodeEvent.DidResolveChildren,a=>{this.loadingDecoration.removeTarget(a)}))}async updateTreeModel(l){const a=await this.fileTreeDialogService.resolveRoot(l);if(a&&a.length>0){const d=a[0];this._treeModel=this.injector.get(E.FileTreeModel,[d]),this.clearFileSelectedDecoration(),this.initDecorations(d)}}initDecorations(l){this._decorations&&this._decorations.dispose(),this._decorations=new f.DecorationsManager(l),this._decorations.addDecoration(this.selectedDecoration),this._decorations.addDecoration(this.focusedDecoration),this._decorations.addDecoration(this.cutDecoration),this._decorations.addDecoration(this.loadingDecoration)}handleTreeHandler(l){this._fileTreeHandle=l}dispose(){this.disposableCollection.dispose()}};e.FileTreeDialogModel=c,c.FILE_TREE_SNAPSHOT_KEY="FILE_TREE_SNAPSHOT",c.DEFAULT_LOCATION_FLUSH_DELAY=500,s.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),s.__metadata("design:type",o.Injector)],c.prototype,"injector",void 0),s.__decorate([(0,o.Autowired)(v.IFileDialogTreeService),s.__metadata("design:type",h.FileTreeDialogService)],c.prototype,"fileTreeDialogService",void 0),s.__decorate([(0,o.Autowired)(g.LabelService),s.__metadata("design:type",g.LabelService)],c.prototype,"labelService",void 0),s.__decorate([(0,o.Autowired)(b.CorePreferences),s.__metadata("design:type",Object)],c.prototype,"corePreferences",void 0),e.FileTreeDialogModel=c=n=s.__decorate([(0,o.Injectable)(),s.__metadata("design:paramtypes",[])],c)},69748:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FILE_TREE_BADGE_LIMIT=e.FILE_TREE_NODE_HEIGHT=e.FileTreeDialogNode=void 0;const n=t(85608),s=n.__importDefault(t(53373)),o=n.__importDefault(t(14041)),f=t(97267),b=t(41869),g=t(69959),v=n.__importDefault(t(89200)),E=({item:u,onClick:h,itemType:c,labelService:r,leftPadding:l=8,onTwistierClick:a,decorations:d,defaultLeftPadding:p=8,template:m})=>{const _=c===f.TreeNodeType.RenamePrompt,y=c===f.TreeNodeType.NewPrompt,S=_||y,A=(0,b.useDesignStyles)(v.default.expansion_toggle,"expansion_toggle"),T=(0,b.useDesignStyles)(v.default.file_tree_node,"file_tree_node"),D=U=>{(c===f.TreeNodeType.TreeNode||c===f.TreeNodeType.CompositeTreeNode)&&h(U,u,c)},w=U=>{(c===f.TreeNodeType.TreeNode||c===f.TreeNodeType.CompositeTreeNode)&&(a?a(U,u,c):h(U,u,c))},I=c===f.TreeNodeType.CompositeTreeNode;let R;S?y?R=`${p+(u.parent.depth+1||0)*(l||0)}px`:R=`${p+(u.target.depth||0)*(l||0)}px`:R=I?`${p+(u.depth||0)*(l||0)}px`:`${p+(u.depth||0)*(l||0)+8}px`;const M={height:e.FILE_TREE_NODE_HEIGHT,lineHeight:`${e.FILE_TREE_NODE_HEIGHT}px`,paddingLeft:R},O=(U,V)=>{if(d&&d?.classlist.indexOf(v.default.mod_loading)>-1)return o.default.createElement(f.Loading,null);if(S&&U instanceof f.PromptHandle){let H=!1;if(_?H=U.target.type===f.TreeNodeType.CompositeTreeNode:H=U.type===f.TreeNodeType.CompositeTreeNode,H)return o.default.createElement("div",{className:(0,s.default)(v.default.file_tree_node_segment,A,(0,b.getIcon)("arrow-right"),{[`${v.default.mod_collapsed}`]:y||!(_&&U.target.type===f.TreeNodeType.CompositeTreeNode&&U.target.expanded)})})}else return o.default.createElement("div",{onClick:V,className:(0,s.default)(v.default.file_tree_node_segment,A,(0,b.getIcon)("arrow-right"),{[`${v.default.mod_collapsed}`]:!U.expanded})})},P=U=>{let V,H;S&&U instanceof f.PromptHandle?U instanceof f.RenamePromptHandle?(V=U.target.uri.resolve(U.$.value),H=g.Directory.is(U.target)):(V=U.parent.uri.resolve(U.$.value),H=U.type===f.TreeNodeType.CompositeTreeNode):(V=U.uri,H=U.filestat.isDirectory);const G=r.getIcon(V,{isDirectory:H});return o.default.createElement("div",{className:(0,s.default)(v.default.file_icon,G,{expanded:H&&U.expanded}),style:{height:e.FILE_TREE_NODE_HEIGHT,lineHeight:`${e.FILE_TREE_NODE_HEIGHT}px`}})},L=U=>m?o.default.createElement(m,null):S&&U instanceof f.PromptHandle?o.default.createElement("div",{className:(0,s.default)(v.default.file_tree_node_segment,v.default.file_tree_node_inputbox)},o.default.createElement("div",{className:(0,s.default)("input-box",v.default.file_tree_node_prompt_box)},o.default.createElement(U.ProxiedInput,{wrapperStyle:{height:e.FILE_TREE_NODE_HEIGHT,padding:"0 5px"}}))):o.default.createElement("div",{className:(0,s.default)(v.default.file_tree_node_segment,v.default.file_tree_node_displayname)},U.name),N=()=>o.default.createElement("div",{className:(0,s.default)(v.default.file_tree_node_segment,v.default.file_tree_node_tail)},k()),k=()=>null,B=U=>{if(I)return O(U,w);if(S)return O(U,()=>{})},F=()=>u.tooltip||u.name;return o.default.createElement("div",{key:u.id,onClick:D,title:F(),className:(0,s.default)(T,d?d.classlist:null),style:M,draggable:c===f.TreeNodeType.TreeNode||c===f.TreeNodeType.CompositeTreeNode},o.default.createElement("div",{className:(0,s.default)(v.default.file_tree_node_content)},B(u),P(u),o.default.createElement("div",{className:S?v.default.file_tree_node_prompt_wrap:v.default.file_tree_node_overflow_wrap},L(u)),N()))};e.FileTreeDialogNode=E,e.FILE_TREE_NODE_HEIGHT=22,e.FILE_TREE_BADGE_LIMIT=99},68195:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileDialogContextKey=void 0;const n=t(85608),s=t(76003),o=t(41869),f=t(66e3);let b=class{initScopedContext(v){this._contextKeyService=this.globalContextKeyService.createScoped(v),this.fileDialogViewVisibleContext=f.FileDialogViewVisibleContext.bind(this._contextKeyService)}get service(){return this._contextKeyService}};e.FileDialogContextKey=b,n.__decorate([(0,s.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],b.prototype,"globalContextKeyService",void 0),e.FileDialogContextKey=b=n.__decorate([(0,s.Injectable)()],b)},9018:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeDialogService=void 0;const n=t(85608),s=t(76003),o=t(97267),f=t(41869),b=t(26542),g=t(51500),v=t(6250),E=t(68195);let u=class extends o.Tree{constructor(c){super(),this._whenReady=this.resolveWorkspaceRoot(c)}get whenReady(){return this._whenReady}async resolveWorkspaceRoot(c){if(c){const r=new f.URI(c).withScheme(f.Schemes.file),l=await this.fileTreeAPI.resolveFileStat(r);l&&(this.workspaceRoot=l)}}async resolveChildren(c){if(c){if(c.uri){const{children:r}=await this.fileTreeAPI.resolveChildren(this,c.uri.toString(),c);return r}}else{this.workspaceRoot||(this.workspaceRoot=(await this.workspaceService.roots)[0]);const{children:r}=await this.fileTreeAPI.resolveChildren(this,this.workspaceRoot);return this.root=r[0],r}return[]}async resolveRoot(c){let r;/^file:\/\//.test(c)&&(r=new f.URI(c)),r=f.URI.file(c);const l=await this.fileTreeAPI.resolveFileStat(r);if(l){const{children:a}=await this.fileTreeAPI.resolveChildren(this,l);return this.root=a[0],a}}getDirectoryList(){const c=[];if(!this.root)return c;let r=new f.URI(this.workspaceRoot.uri);if(r&&r.parent)for(;r.parent;){const l=r.codeUri.fsPath;if(c.indexOf(l)>=0)break;c.push(l),r=r.parent}else c.push(r.codeUri.fsPath.toString());return c}sortComparator(c,r){return c.constructor===r.constructor?c.name.startsWith(".")&&!r.name.startsWith(".")?1:!c.name.startsWith(".")&&r.name.startsWith(".")?-1:c.name.localeCompare(r.name,"kn",{numeric:!0}):c.type===o.TreeNodeType.CompositeTreeNode?-1:r.type===o.TreeNodeType.CompositeTreeNode?1:0}initContextKey(c){c&&this.fileDialogContextKey.initScopedContext(c)}get contextKey(){return this.fileDialogContextKey}dispose(){super.dispose()}};e.FileTreeDialogService=u,n.__decorate([(0,s.Autowired)(v.IFileTreeAPI),n.__metadata("design:type",Object)],u.prototype,"fileTreeAPI",void 0),n.__decorate([(0,s.Autowired)(g.IWorkspaceService),n.__metadata("design:type",Object)],u.prototype,"workspaceService",void 0),n.__decorate([(0,s.Autowired)(b.LabelService),n.__metadata("design:type",b.LabelService)],u.prototype,"labelService",void 0),n.__decorate([(0,s.Autowired)(E.FileDialogContextKey),n.__metadata("design:type",E.FileDialogContextKey)],u.prototype,"fileDialogContextKey",void 0),e.FileTreeDialogService=u=n.__decorate([(0,s.Injectable)({multiple:!0}),n.__param(0,(0,s.Optional)()),n.__metadata("design:paramtypes",[String])],u)},51888:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileDialog=e.FILE_TREE_DIALOG_HEIGHT=void 0;const n=t(85608),s=n.__importStar(t(14041)),o=t(97267),f=t(41869),b=t(68974),g=t(72665),v=t(69748),E=n.__importDefault(t(13294));e.FILE_TREE_DIALOG_HEIGHT=22;const u=({options:h,model:c,isOpenDialog:r,fileService:l})=>{const a=(0,f.useInjectable)(g.IDialogService),d=(0,s.useRef)(null),[p,m]=(0,s.useState)(h.defaultFileName||""),[_,y]=(0,s.useState)(!1),[S,A]=(0,s.useState)(""),[T,D]=(0,s.useState)([]);(0,s.useEffect)(()=>{var z;return c&&(y(!1),R(),(z=l.contextKey.fileDialogViewVisibleContext)===null||z===void 0||z.set(!0)),()=>{c.dispose()}},[c]),(0,s.useEffect)(()=>{h.defaultFileName&&m(h.defaultFileName)},[h]),(0,s.useEffect)(()=>{if(_){const z=c.getDirectoryList();D(z)}},[_]);const w=(0,s.useCallback)(()=>{const z=c.selectedFiles.map(j=>j.uri.path.toString());if(p&&h.showNameInput&&(z?.length===1||h.defaultUri)){const j=z?.length===1?z[0]:h.defaultUri.path.toString();a.hide([f.path.join(j,p)])}else z.length>0?a.hide(z):h.defaultUri?a.hide([h.defaultUri.path.toString()]):c.treeModel&&c.treeModel.root?a.hide([c.treeModel.root.uri.path.toString()]):a.hide([]);y(!1),l.contextKey.fileDialogViewVisibleContext.set(!1)},[_,a,c,p,h]),I=(0,s.useCallback)(()=>{y(!1),a.hide(),l.contextKey.fileDialogViewVisibleContext.set(!1)},[_,a]),R=(0,s.useCallback)(async()=>{await c.whenReady,await c.treeModel.ensureReady,A(c.treeModel.root.uri.codeUri.fsPath),y(!0)},[c,S,_]),M=!r,O=(0,s.useCallback)(z=>{c.handleTreeHandler({...z,getModel:()=>c.treeModel})},[c]),P=(0,s.useCallback)((z,j)=>{z.stopPropagation();const{toggleDirectory:W}=c;W(j)},[c]),L=(0,s.useCallback)(z=>N(z)?!1:z.shiftKey,[]),N=(0,s.useCallback)(z=>{const{metaKey:j,ctrlKey:W}=z;return f.isMacintosh&&j||W},[]),k=(0,s.useCallback)((z,j,W)=>{var $;z.stopPropagation();const{handleItemClick:Y,handleItemToggleClick:Q,handleItemRangeClick:te}=c;if(!j)return;const re=L(event),ae=N(event);if(re&&!M&&h.canSelectMany)te(j,W);else if(ae&&!M&&h.canSelectMany)Q(j,W);else if(M)W===o.TreeNodeType.CompositeTreeNode&&Y(j,W);else if(h.canSelectFiles&&W===o.TreeNodeType.TreeNode){const ce=new Set(Object.values(($=h.filters)!==null&&$!==void 0?$:{}).flat().map(q=>`.${q}`));if(ce.size>0){const q=f.URI.parse(j.filestat.uri).path.ext;ce.has(q)&&Y(j,W)}else Y(j,W)}else h.canSelectFolders&&W===o.TreeNodeType.CompositeTreeNode&&Y(j,W)},[c,M,h]),B=(0,s.useCallback)(async z=>{y(!1),A(z),await c.updateTreeModel(z),y(!0)},[c,_,S]),F=(0,s.useCallback)(z=>s.default.createElement(v.FileTreeDialogNode,{item:z.item,itemType:z.itemType,labelService:c.labelService,decorations:c.decorations.getDecorations(z.item),onClick:k,onTwistierClick:P,defaultLeftPadding:8,leftPadding:8}),[c.treeModel]),U=(0,s.useCallback)(()=>{if(_){if(c.treeModel)return s.default.createElement(o.RecycleTree,{height:300,itemHeight:e.FILE_TREE_DIALOG_HEIGHT,onReady:O,model:c.treeModel},F)}else return s.default.createElement(b.Progress,{loading:!0})},[_,c]),V=(0,s.useCallback)(()=>{if(T.length>0)return s.default.createElement(o.Select,{onChange:B,className:E.default.select_control,size:"small",value:S},T.map((z,j)=>s.default.createElement(o.Option,{value:z,key:`${j} - ${z}`},z)))},[T,S]),H=(0,s.useCallback)(z=>{const{key:j}=f.KeyCode.createKeyCode(z),W=z.shiftKey||z.metaKey||z.altKey||z.ctrlKey;j&&f.Key.ENTER.keyCode===j.keyCode&&!W&&w()},[w]);(0,s.useEffect)(()=>{var z;return d.current&&(l.initContextKey(d.current),l.contextKey.fileDialogViewVisibleContext.set(!0),(z=d.current)===null||z===void 0||z.addEventListener("keyup",H)),()=>{var j;(j=d.current)===null||j===void 0||j.removeEventListener("keyup",H)}},[]);const G=(0,s.useMemo)(()=>s.default.createElement(s.default.Fragment,null,s.default.createElement("div",{className:E.default.file_dialog_directory},V()),s.default.createElement("div",{className:E.default.file_dialog_content},U())),[V,U]),K=(0,s.useMemo)(()=>s.default.createElement("div",{className:E.default.file_dialog_buttons},s.default.createElement(o.Button,{onClick:I,type:"secondary",className:E.default.button},(0,f.localize)("dialog.file.close")),s.default.createElement(o.Button,{onClick:w,type:"primary",className:E.default.button,disabled:M&&h.showNameInput&&p.length===0},r&&h.openLabel||(0,f.localize)("dialog.file.ok"))),[I,w,M,r,p,h]);return s.default.createElement("div",{className:E.default.file_dialog_wrapper,ref:d},s.default.createElement("div",{className:E.default.file_dialog_directory_title},r?h.title||(0,f.localize)("dialog.file.openLabel"):h.saveLabel||(0,f.localize)("dialog.file.saveLabel")),G,!r&&h.showNameInput&&s.default.createElement("div",{className:E.default.file_dialog_file_container},s.default.createElement("span",{className:E.default.file_dialog_file_name},(0,f.localize)("dialog.file.name"),": "),s.default.createElement(o.Input,{size:"small",value:p,autoFocus:!0,selection:{start:0,end:p.indexOf(".")||p.length},onChange:z=>m(z.target.value)})),K)};e.FileDialog=u},89508:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WindowDialogServiceImpl=void 0;const n=t(85608),s=n.__importDefault(t(14041)),o=t(76003),f=t(41869),b=t(37406),g=t(14951),v=t(72665),E=t(57942),u=n.__importDefault(t(13294)),h=t(9018),c=t(51888);let r=class{constructor(){this.idx=1,this._whenReady=this.init()}async init(){this.recentGlobalStorage=await this.storageProvider(f.STORAGE_NAMESPACE.GLOBAL_RECENT_DATA);const a=await this.recentGlobalStorage.get("RECENT_DIALOG_DEFAULT_URI");if(a)this._defaultUri=new f.URI(a);else{const d=await this.fileServiceClient.getCurrentUserHome();this._defaultUri=new f.URI(d.uri)}}get defaultUri(){return this._defaultUri}get whenReady(){return this._whenReady}async updateRecentDefaultUri(a){this.recentGlobalStorage.set("RECENT_DIALOG_DEFAULT_URI",a.toString()),this._defaultUri=a}async showOpenDialog(a={}){this.dialogService.reset(),await this.whenReady;const d={canSelectFiles:!0,canSelectFolders:!1,canSelectMany:!1};if(this.appConfig.isElectronRenderer&&!this.appConfig.isRemote){const p=this.injector.get(b.IElectronMainUIService),m=[];a.canSelectFiles&&m.push("openFile"),a.canSelectFolders&&m.push("openDirectory"),a.canSelectMany&&m.push("multiSelections"),f.isMacintosh&&m.push("treatPackageAsDirectory","createDirectory");const _=a.defaultUri||this.defaultUri,y=await p.showOpenDialog(f.electronEnv.currentWindowId,{defaultPath:_.codeUri.fsPath,title:a.title,buttonLabel:a.openLabel,properties:m});if(y&&y.length>0){const S=y.map(A=>f.URI.file(A));return this.updateRecentDefaultUri(S[0].parent),S}else return}else{a.defaultUri||(a.defaultUri=this.defaultUri);let p;a.defaultUri?p=this.injector.get(h.FileTreeDialogService,[a.defaultUri.toString()]):p=this.injector.get(h.FileTreeDialogService),await p.whenReady;const m=E.FileTreeDialogModel.createModel(this.injector,p),_=await this.dialogService.open({message:s.default.createElement(c.FileDialog,{key:this.idx++,fileService:p,model:m,options:{...d,...a},isOpenDialog:!0}),type:f.MessageType.Empty,buttons:[],closable:!0,props:{className:u.default.file_dialog_wrapper}});if(this.dialogService.reset(),_&&_.length>0){const y=_.map(S=>f.URI.file(S));return this.updateRecentDefaultUri(y[0].parent),y}else return}}async showSaveDialog(a={}){if(await this.whenReady,this.appConfig.isElectronRenderer&&!this.appConfig.isRemote){const d=a.defaultUri||this.defaultUri,m=await this.injector.get(b.IElectronMainUIService).showSaveDialog(f.electronEnv.currentWindowId,{defaultPath:d.resolve(a.defaultFileName||"").codeUri.fsPath,title:a.saveLabel,message:a.saveLabel});if(m){const _=f.URI.file(m);return this.updateRecentDefaultUri(_.parent),_}else return}else{a.defaultUri||(a.defaultUri=this.defaultUri);let d;a.defaultUri?d=this.injector.get(h.FileTreeDialogService,[a.defaultUri.toString()]):d=this.injector.get(h.FileTreeDialogService),await d.whenReady;const p=E.FileTreeDialogModel.createModel(this.injector,d),m=await this.dialogService.open({message:s.default.createElement(c.FileDialog,{key:this.idx++,fileService:d,model:p,options:a,isOpenDialog:!1}),type:f.MessageType.Empty,buttons:[],closable:!0,props:{className:u.default.file_dialog_wrapper}});if(this.dialogService.reset(),m&&m.length>0){const _=f.URI.file(m[0]);return this.updateRecentDefaultUri(_.parent),_}else return}}};e.WindowDialogServiceImpl=r,n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],r.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(v.IDialogService),n.__metadata("design:type",Object)],r.prototype,"dialogService",void 0),n.__decorate([(0,o.Autowired)(g.IFileServiceClient),n.__metadata("design:type",Object)],r.prototype,"fileServiceClient",void 0),n.__decorate([(0,o.Autowired)(f.StorageProvider),n.__metadata("design:type",Function)],r.prototype,"storageProvider",void 0),n.__decorate([(0,o.Autowired)(f.AppConfig),n.__metadata("design:type",Object)],r.prototype,"appConfig",void 0),e.WindowDialogServiceImpl=r=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],r)},88014:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileContextKey=void 0;const n=t(85608),s=t(76003),o=t(41869),f=t(16413);let b=class{constructor(){this.explorerResourceIsFolder=f.ExplorerResourceIsFolderContext.bind(this.globalContextKeyService),this.explorerViewletVisibleContext=f.ExplorerViewletVisibleContext.bind(this.globalContextKeyService)}initScopedContext(v){this._contextKeyService=this.globalContextKeyService.createScoped(v),this.explorerFocused=f.ExplorerFocusedContext.bind(this._contextKeyService),this.explorerResourceCut=f.ExplorerResourceCut.bind(this._contextKeyService),this.filesExplorerFocused=f.FilesExplorerFocusedContext.bind(this._contextKeyService),this.filesExplorerInputFocused=f.FilesExplorerInputFocusedContext.bind(this._contextKeyService),this.filesExplorerFilteredContext=f.FilesExplorerFilteredContext.bind(this._contextKeyService),this.explorerCompressedFocusContext=f.ExplorerCompressedFocusContext.bind(this._contextKeyService),this.explorerCompressedFirstFocusContext=f.ExplorerCompressedFirstFocusContext.bind(this._contextKeyService),this.explorerCompressedLastFocusContext=f.ExplorerCompressedLastFocusContext.bind(this._contextKeyService)}get service(){return this._contextKeyService}};e.FileContextKey=b,n.__decorate([(0,s.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],b.prototype,"globalContextKeyService",void 0),e.FileContextKey=b=n.__decorate([(0,s.Injectable)(),n.__metadata("design:paramtypes",[])],b)},40439:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeContribution=void 0;const n=t(85608),s=t(76003),o=t(41869),f=t(16413),b=t(93899),g=t(68969),v=t(98295),E=t(41893),u=t(54414),h=t(32595),c=t(63067),r=t(58296),l=t(72665),a=t(51500),d=t(6250),p=t(69959),m=t(56384),_=t(57781),y=t(97738),S=t(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(d.RESOURCE_VIEW_ID,{content:(0,o.formatLocalize)("welcome-view.noFolderHelp",o.FILE_COMMANDS.OPEN_FOLDER.id),group:r.ViewContentGroups.Open,order:1}),this.mainLayoutService.collectViewComponent({id:d.RESOURCE_VIEW_ID,name:this.getWorkspaceTitle(),weight:3,priority:9,collapsed:!1,component:m.FileTree},h.EXPLORER_CONTAINER_ID),this._disposables.add(this.workspaceService.onWorkspaceLocationChanged(()=>{const D=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);D&&D.updateViewTitle(d.RESOURCE_VIEW_ID,this.getWorkspaceTitle())}))}onDidStart(){const D=this.injector.get(S.SymlinkDecorationsProvider,[this.fileTreeService]);this.decorationService.registerDecorationsProvider(D)}onDidRender(){this.isRendered=!0;const D=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);D&&(this.fileTreeModelService.whenReady.then(()=>{this.fileTreeModelService.contextKey.explorerViewletVisibleContext.set(D.isActivated())}),D.onActivate(()=>{this.fileTreeModelService.performLocationOnHandleShow(),this.fileTreeModelService.contextKey.explorerViewletVisibleContext.set(!0)}),D.onInActivate(()=>{this.fileTreeModelService.handleTreeBlur(),this.fileTreeModelService.contextKey.explorerViewletVisibleContext.set(!1)}))}getWorkspaceTitle(){let D=(0,o.localize)("file.empty.defaultTitle");const w=this.workspaceService.workspace;return w&&(D=new o.URI(w.uri).displayName,!w.isDirectory&&D.endsWith(`.${this.workspaceService.workspaceSuffixName}`)&&(D=D.slice(0,D.lastIndexOf(".")),D===a.UNTITLED_WORKSPACE))?(0,o.localize)("file.workspace.defaultTip"):D}onReconnect(){this.fileTreeService.reWatch()}revealFile(D){if(D)if(this.isRendered){const w=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);!w||!w.isVisible||w.isCollapsed(d.RESOURCE_VIEW_ID)?this.fileTreeModelService.locationOnShow(D):this.fileTreeModelService.location(D)}else this.fileTreeModelService.locationOnShow(D)}registerMenus(D){D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.NEW_FILE.id,label:(0,o.localize)("file.new")},order:1,group:"0_new"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.NEW_FOLDER.id,label:(0,o.localize)("file.folder.new")},order:2,group:"0_new"}),D.registerMenuItem(b.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"}),D.registerMenuItem(b.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"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_RESOURCES.id,label:(0,o.localize)("file.open")},order:1,group:"1_open"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_TO_THE_SIDE.id,label:(0,o.localize)("file.open.side")},order:2,group:"1_open"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.OPEN_TYPE_WITH.id,label:(0,o.localize)("file.open.type")},order:3,group:"1_open"}),D.registerMenuItem(b.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"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.SEARCH_ON_FOLDER.id,label:(0,o.localize)("file.search.folder")},order:1,group:"2_search"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.DELETE_FILE.id,label:(0,o.localize)("file.delete")},order:1,group:"7_modification"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.RENAME_FILE.id,label:(0,o.localize)("file.rename")},order:3,group:"7_modification"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COMPARE_SELECTED.id,label:(0,o.localize)("file.compare")},order:2,group:"3_compare"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_FILE.id,label:(0,o.localize)("file.copy.file")},order:1,group:"5_cutcopypaste"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.CUT_FILE.id,label:(0,o.localize)("file.cut.file")},order:2,group:"5_cutcopypaste"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.PASTE_FILE.id,label:(0,o.localize)("file.paste.file")},order:3,group:"5_cutcopypaste"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_PATH.id,label:(0,o.localize)("file.copy.path")},group:"6_copypath"}),D.registerMenuItem(b.MenuId.ExplorerContext,{command:{id:o.FILE_COMMANDS.COPY_RELATIVE_PATH.id,label:(0,o.localize)("file.copy.relativepath")},group:"6_copypath"})}registerCommands(D){const w=()=>{this.fileTreeService.filterMode&&this.fileTreeService.toggleFilterMode()};D.registerCommand(o.FILE_COMMANDS.OPEN_TERMINAL_WITH_PATH,{execute:R=>{let M=R;if(!M)return;const O=this.fileTreeService.getNodeByPathOrUri(M);O&&!O.filestat.isDirectory&&(M=O.uri.parent),this.commandService.executeCommand(o.TERMINAL_COMMANDS.OPEN_WITH_PATH.id,M)}}),D.registerCommand(o.FILE_COMMANDS.SEARCH_ON_FOLDER,{execute:async R=>{var M;let O=R;if(O||(this.fileTreeModelService.focusedFile?O=this.fileTreeModelService.focusedFile.uri:this.fileTreeModelService.selectedFiles.length>0&&(O=(M=this.fileTreeModelService.selectedFiles[0])===null||M===void 0?void 0:M.uri)),!O)return;let P;if(this.fileTreeService.isMultipleWorkspace)for(const L of await this.workspaceService.roots){const N=new o.URI(L.uri);if(N.isEqualOrParent(O)){P=`./${N.relative(O).toString()}`;break}}else if(this.workspaceService.workspace){const L=new o.URI(this.workspaceService.workspace.uri);L.isEqualOrParent(O)&&(P=`./${L.relative(O).toString()}`)}this.commandService.executeCommand(o.SEARCH_COMMANDS.OPEN_SEARCH.id,{includeValue:P+"/"})},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&p.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.LOCATION,{execute:R=>{R?this.revealFile(R):this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0&&this.revealFile(this.fileTreeModelService.selectedFiles[0].uri)}}),D.registerCommand(o.FILE_COMMANDS.LOCATION_WITH_EDITOR,{execute:()=>{var R,M,O;((M=(R=this.workbenchEditorService.currentEditor)===null||R===void 0?void 0:R.currentUri)===null||M===void 0?void 0:M.scheme)===o.Schemes.file&&this.revealFile((O=this.workbenchEditorService.currentEditor)===null||O===void 0?void 0:O.currentUri)}}),D.registerCommand(o.FILE_COMMANDS.COLLAPSE_ALL,{execute:()=>{const R=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);!R||!R.isVisible||this.fileTreeModelService.collapseAll()}}),D.registerCommand(o.FILE_COMMANDS.REFRESH_ALL,{execute:async()=>{const R=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);!R||!R.isVisible||await this.fileTreeService.refresh()}}),D.registerCommand(o.FILE_COMMANDS.DELETE_FILE,{execute:(R,M)=>{if(w(),M?this.willDeleteUris=this.willDeleteUris.concat(M):this.fileTreeModelService.selectedFiles&&this.fileTreeModelService.selectedFiles.length>0?this.willDeleteUris=this.willDeleteUris.concat(this.fileTreeModelService.selectedFiles.map(O=>O.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)}),D.registerCommand(o.FILE_COMMANDS.RENAME_FILE,{execute:R=>{if(w(),!R)if(this.fileTreeModelService.contextMenuFile)R=this.fileTreeModelService.contextMenuFile.uri;else if(this.fileTreeModelService.focusedFile)R=this.fileTreeModelService.focusedFile.uri;else return;this.fileTreeModelService.renamePrompt(R)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!this.fileTreeModelService.contextMenuFile.uri.isEqual(this.fileTreeModelService.treeModel.root.uri)}),D.registerCommand(o.FILE_COMMANDS.NEW_FILE,{execute:async R=>{var M;if(w(),R)this.fileTreeModelService.newFilePrompt(R);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 O;this.fileTreeService.isMultipleWorkspace?O=new o.URI((await this.workspaceService.roots)[0].uri):O=new o.URI((M=this.workspaceService.workspace)===null||M===void 0?void 0:M.uri),this.fileTreeModelService.newFilePrompt(O)}}}),D.registerCommand(o.FILE_COMMANDS.NEW_FOLDER,{execute:async R=>{var M;if(w(),R)this.fileTreeModelService.newDirectoryPrompt(R);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 O;this.fileTreeService.isMultipleWorkspace?O=new o.URI((await this.workspaceService.roots)[0].uri):O=new o.URI((M=this.workspaceService.workspace)===null||M===void 0?void 0:M.uri),this.fileTreeModelService.newDirectoryPrompt(O)}}}),D.registerCommand(o.FILE_COMMANDS.COMPARE_SELECTED,{execute:(R,M)=>{if(M&&M.length){const O=this.workbenchEditorService.currentEditor;O&&O.currentUri&&this.fileTreeService.compare(M[0],O.currentUri)}},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!p.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.OPEN_RESOURCES,{execute:R=>{this.fileTreeService.openAndFixedFile(R)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!p.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.OPEN_TO_THE_SIDE,{execute:R=>{this.fileTreeService.openToTheSide(R)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!p.Directory.is(this.fileTreeModelService.contextMenuFile)});const I=(R,M)=>{const{availableOpenTypes:O,currentOpenType:P}=this.workbenchEditorService.currentEditorGroup;if(!(O&&R&&P))return{items:[],selectIndex:-1};const L=this.preferenceService.get("workbench.editorAssociations"),N=[],k=(V,H)=>H.type===u.EditorOpenType.code?V.type===u.EditorOpenType.code:H.type===u.EditorOpenType.component&&V.type===u.EditorOpenType.component?V.componentId===H.componentId:!1,B=(V,H)=>(V?V+=(0,o.localize)("file.open.type.detail.and")+H:V=H,V);let F,U;if(L){const V=Object.keys(L).find(H=>(0,o.match)(H,R.path.toString().toLowerCase())||(0,o.match)(H,R.path.base.toLowerCase()));F=V&&L[V]}return O.forEach((V,H)=>{var G;const K={label:V.title||V.componentId||V.type,detail:V.title,run:z=>M(z,V)};k(P,V)&&(K.description=B(K.description,(0,o.localize)("file.open.type.detail.active")),U=H),F&&(!((G=V.componentId)===null||G===void 0)&&G.endsWith(F))&&(K.description=B(K.description,(0,o.localize)("file.open.type.detail.default"))),N.push(new o.QuickOpenItem(K))}),{items:N,selectIndex:U}};D.registerCommand(o.FILE_COMMANDS.OPEN_TYPE_WITH,{execute:R=>{const M=(N,k)=>{var B,F;return N===o.Mode.OPEN?((B=this.workbenchEditorService.currentEditorGroup)===null||B===void 0||B.changeOpenType((F=k.componentId)!==null&&F!==void 0?F:k.type),!0):!1},{items:O,selectIndex:P}=I(R,M);if(O.length===0||typeof P>"u")return;const L=N=>{this.quickOpenService.open({onType:(k,B)=>B(N)},{fuzzyMatchLabel:!0,ignoreFocusOut:!1,placeholder:(0,o.formatLocalize)("file.open.type.placeholder",R.path.base),selectIndex:()=>P})};O.push(new o.QuickOpenItem({label:(0,o.formatLocalize)("file.open.type.preference.default",`*${R.path.ext}`),showBorder:!0,run:N=>{if(N===o.Mode.OPEN){const k=(U,V)=>{var H,G,K;if(U===o.Mode.OPEN){const z="workbench.editorAssociations",j=this.preferenceService.resolve(z).scope,W=this.preferenceService.get(z);return this.preferenceService.set(z,{...W||{},[`*${R.path.ext}`]:(H=V.componentId)!==null&&H!==void 0?H:V.type},j),(G=this.workbenchEditorService.currentEditorGroup)===null||G===void 0||G.changeOpenType((K=V.componentId)!==null&&K!==void 0?K:V.type),!0}return!1},{items:B,selectIndex:F}=I(R,k);if(B.length===0||typeof F>"u")return!0;L(B)}return!1}})),L(O)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile&&!p.Directory.is(this.fileTreeModelService.contextMenuFile)}),D.registerCommand(o.FILE_COMMANDS.COPY_PATH,{execute:async R=>{if(!R)return;let O=R.path.toString();if(R.scheme===u.DIFF_SCHEME){const L=R.getParsedQuery();O=new o.URI(L.modified).path.toString()}let P=decodeURIComponent(O);await this.appService.backendOS===o.OperatingSystem.Windows&&(P=P.slice(1)),await this.clipboardService.writeText(P)},isVisible:()=>!!this.fileTreeModelService.contextMenuFile}),D.registerCommand(o.FILE_COMMANDS.COPY_RELATIVE_PATH,{execute:async R=>{if(!R)return;if(R.scheme===u.DIFF_SCHEME){const O=R.getParsedQuery();R=new o.URI(O.modified).withScheme("file")}let M;if(this.fileTreeService.isMultipleWorkspace)for(const O of await this.workspaceService.roots){if(M=new o.URI(O.uri),M.isEqual(R))return await this.clipboardService.writeText("./");if(M.isEqualOrParent(R))return await this.clipboardService.writeText(decodeURIComponent(M.relative(R).toString()))}else if(this.workspaceService.workspace)return M=new o.URI(this.workspaceService.workspace.uri),M.isEqual(R)?await this.clipboardService.writeText("./"):await this.clipboardService.writeText(decodeURIComponent(M.relative(R).toString()))},isVisible:()=>!!this.fileTreeModelService.contextMenuFile}),D.registerCommand(o.FILE_COMMANDS.COPY_FILE,{execute:(R,M)=>{if(M&&M.length)this.fileTreeModelService.copyFile(M);else{const O=this.fileTreeModelService.selectedFiles.map(P=>P.uri);O&&O.length&&this.fileTreeModelService.copyFile(O)}},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)}),D.registerCommand(o.FILE_COMMANDS.SELECT_CURRENT_NODE,{execute:(R,M)=>{if(M&&M.length)this.fileTreeModelService.selectChildNode(M);else{const O=this.fileTreeModelService.selectedFiles.map(P=>P.uri);O&&O.length&&this.fileTreeModelService.selectChildNode(O)}},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)}),D.registerCommand(o.FILE_COMMANDS.CUT_FILE,{execute:(R,M)=>{if(M&&M.length)this.fileTreeModelService.cutFile(M);else{const O=this.fileTreeModelService.selectedFiles.map(P=>P.uri);O&&O.length&&this.fileTreeModelService.cutFile(O)}},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)}),D.registerCommand(o.FILE_COMMANDS.PASTE_FILE,{execute:R=>{if(w(),R)this.fileTreeModelService.pasteFile(R);else if(this.fileTreeModelService.focusedFile){let M;this.fileTreeModelService.activeUri?M=this.fileTreeModelService.activeUri:M=this.fileTreeModelService.focusedFile.uri,this.fileTreeModelService.pasteFile(M)}},isEnabled:()=>this.fileTreeModelService.pasteStore&&this.fileTreeModelService.pasteStore.type!==d.PasteTypes.NONE||this.appConfig.isElectronRenderer}),D.registerCommand(o.FILE_COMMANDS.VSCODE_OPEN_FOLDER,{execute:(R,M)=>{const O=this.injector.get(o.IWindowService),P={newWindow:!0};return typeof M=="boolean"?P.newWindow=M:P.newWindow=typeof M?.forceNewWindow=="boolean"?M.forceNewWindow:!0,R?O.openWorkspace(R,P):this.commandService.executeCommand(o.FILE_COMMANDS.OPEN_FOLDER.id,P)},isVisible:()=>{const R=this.preferenceService.get("application.supportsOpenFolder");return R??!1}}),D.registerCommand(o.FILE_COMMANDS.OPEN_FOLDER,{execute:R=>{const M=this.injector.get(o.IWindowService);this.appConfig.isElectronRenderer?this.injector.get(o.IElectronNativeDialogService).showOpenDialog({title:(0,o.localize)("workspace.openDirectory"),properties:["openDirectory"]}).then(P=>{P&&P.length>0&&M.openWorkspace(o.URI.file(P[0]),R||{newWindow:!0})}):this.injector.get(l.IWindowDialogService).showOpenDialog({title:(0,o.localize)("workspace.openDirectory"),canSelectFiles:!1,canSelectFolders:!0}).then(P=>{var L;P&&P.length>0&&this.injector.get(a.IWorkspaceService).open(P[0],{preserveWindow:(L=R?.newWindow)!==null&&L!==void 0?L:!1})})},isVisible:()=>{const R=this.preferenceService.get("application.supportsOpenFolder");return R??!1}}),D.registerCommand(o.FILE_COMMANDS.OPEN_WORKSPACE,{execute:R=>{if(!this.preferenceService.get("application.supportsOpenWorkspace"))return;const O=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(L=>{L&&L.length>0&&O.openWorkspace(o.URI.file(L[0]),R||{newWindow:!0})}):this.injector.get(l.IWindowDialogService).showOpenDialog({title:(0,o.localize)("workspace.openWorkspace"),canSelectFiles:!0,canSelectFolders:!1,canSelectMany:!1,filters:{workspace:[this.workspaceService.workspaceSuffixName]}}).then(L=>{var N;L&&L.length>0&&this.injector.get(a.IWorkspaceService).open(L[0],{preserveWindow:(N=R?.newWindow)!==null&&N!==void 0?N:!1})})},isVisible:()=>{const R=this.preferenceService.get("application.supportsOpenWorkspace");return R??!1}}),D.registerCommand(o.FILE_COMMANDS.REVEAL_IN_EXPLORER,{execute:R=>{var M;let O=R instanceof o.URI?R:R?.uri;const P=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);P&&!P.isVisible&&P.activate(),P&&P.isCollapsed(d.RESOURCE_VIEW_ID)&&P?.setCollapsed(d.RESOURCE_VIEW_ID,!1),!O&&(!((M=this.workbenchEditorService.currentEditor)===null||M===void 0)&&M.currentUri)&&(O=this.workbenchEditorService.currentEditor.currentUri),O&&this.revealFile(o.URI.parse(O.toString()))}}),D.registerCommand(o.FILE_COMMANDS.FOCUS_FILES,{execute:()=>{const R=this.mainLayoutService.getTabbarHandler(h.EXPLORER_CONTAINER_ID);R&&R.activate()}}),D.registerCommand(o.FILE_COMMANDS.OPEN_FILE,{execute:R=>this.windowDialogService.showOpenDialog(R)}),D.registerCommand(o.FILE_COMMANDS.SAVE_FILE,{execute:R=>this.windowDialogService.showSaveDialog(R)}),D.registerCommand(o.FILE_COMMANDS.FILTER_TOGGLE,{execute:()=>this.fileTreeService.toggleFilterMode()}),D.registerCommand(o.FILE_COMMANDS.FILTER_OPEN,{execute:()=>{if(!this.fileTreeService.filterMode)return this.fileTreeService.toggleFilterMode()}}),D.registerCommand(o.FILE_COMMANDS.FILTER_CLOSE,{execute:()=>{this.fileTreeService.filterMode&&this.fileTreeService.toggleFilterMode()}}),D.registerCommand(o.FILE_COMMANDS.NEXT,{execute:()=>{this.fileTreeModelService.moveToNext()}}),D.registerCommand(o.FILE_COMMANDS.PREV,{execute:()=>{this.fileTreeModelService.moveToPrev()}}),D.registerCommand(o.FILE_COMMANDS.COLLAPSE,{execute:()=>{this.fileTreeModelService.collapseCurrentFile()}}),D.registerCommand(o.FILE_COMMANDS.EXPAND,{execute:()=>{this.fileTreeModelService.expandCurrentFile()}}),D.registerCommand(o.FILE_COMMANDS.TOGGLE_OR_OPEN,{execute:()=>{this.fileTreeModelService.toggleOrOpenCurrentFile()}}),D.registerCommand(o.WORKSPACE_COMMANDS.REMOVE_WORKSPACE_FOLDER,{execute:async(R,M)=>{if(w(),!M.length||!this.workspaceService.isMultiRootWorkspaceOpened)return;const O=await this.workspaceService.roots,P=M.filter(L=>O.find(N=>N.uri===L.toString()));P.length>0&&await this.workspaceService.removeRoots(P)},isVisible:()=>this.workspaceService.isMultiRootWorkspaceOpened&&!!this.fileTreeModelService.contextMenuFile&&!!this.workspaceService.tryGetRoots().find(R=>{var M;return R.uri===((M=this.fileTreeModelService.contextMenuFile)===null||M===void 0?void 0:M.uri.toString())})})}registerKeybindings(D){D.registerKeybinding({command:o.FILE_COMMANDS.COPY_FILE.id,keybinding:"ctrlcmd+c",when:`${f.FilesExplorerFocusedContext.raw} && !${f.FilesExplorerInputFocusedContext.raw} && !${f.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.PASTE_FILE.id,keybinding:"ctrlcmd+v",when:`${f.FilesExplorerFocusedContext.raw} && !${f.FilesExplorerInputFocusedContext.raw} && !${f.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.CUT_FILE.id,keybinding:"ctrlcmd+x",when:`${f.FilesExplorerFocusedContext.raw} && !${f.FilesExplorerInputFocusedContext.raw} && !${f.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.SELECT_CURRENT_NODE.id,keybinding:"ctrlcmd+a",when:`${f.FilesExplorerFocusedContext.raw} && !${f.FilesExplorerInputFocusedContext.raw} && !${f.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.RENAME_FILE.id,keybinding:"enter",when:`${f.FilesExplorerFocusedContext.raw} && !${f.FilesExplorerInputFocusedContext.raw} && !${f.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.DELETE_FILE.id,keybinding:"ctrlcmd+backspace",when:`${f.FilesExplorerFocusedContext.raw} && !${f.FilesExplorerInputFocusedContext.raw} && !${f.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.FILTER_OPEN.id,keybinding:"ctrlcmd+f",when:`${f.FilesExplorerFocusedContext.raw} && !${f.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.FILTER_CLOSE.id,keybinding:"esc",when:`${f.FilesExplorerFocusedContext.raw} && ${f.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.NEXT.id,keybinding:"down",when:`${f.FilesExplorerFocusedContext.raw} && !${f.FilesExplorerInputFocusedContext.raw} && !${f.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.PREV.id,keybinding:"up",when:`${f.FilesExplorerFocusedContext.raw} && !${f.FilesExplorerInputFocusedContext.raw} && !${f.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.EXPAND.id,keybinding:"right",when:`${f.FilesExplorerFocusedContext.raw} && !${f.FilesExplorerInputFocusedContext.raw} && !${f.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.COLLAPSE.id,keybinding:"left",when:`${f.FilesExplorerFocusedContext.raw} && !${f.FilesExplorerInputFocusedContext.raw} && !${f.FilesExplorerFilteredContext.raw}`}),D.registerKeybinding({command:o.FILE_COMMANDS.TOGGLE_OR_OPEN.id,keybinding:"space",when:`${f.FilesExplorerFocusedContext.raw} && !${f.FilesExplorerInputFocusedContext.raw} && !${f.FilesExplorerFilteredContext.raw}`})}registerToolbarItems(D){D.registerItem({id:o.FILE_COMMANDS.LOCATION_WITH_EDITOR.id,command:o.FILE_COMMANDS.LOCATION_WITH_EDITOR.id,label:(0,o.localize)("file.location"),viewId:d.RESOURCE_VIEW_ID,when:`view == '${d.RESOURCE_VIEW_ID}' && !config.explorer.autoReveal && !${f.FilesExplorerFilteredContext.raw}`,order:0}),D.registerItem({id:o.FILE_COMMANDS.NEW_FILE.id,command:o.FILE_COMMANDS.NEW_FILE.id,label:(0,o.localize)("file.new"),viewId:d.RESOURCE_VIEW_ID,when:`view == '${d.RESOURCE_VIEW_ID}' && !${f.FilesExplorerFilteredContext.raw}`,order:1}),D.registerItem({id:o.FILE_COMMANDS.NEW_FOLDER.id,command:o.FILE_COMMANDS.NEW_FOLDER.id,label:(0,o.localize)("file.folder.new"),viewId:d.RESOURCE_VIEW_ID,when:`view == '${d.RESOURCE_VIEW_ID}' && !${f.FilesExplorerFilteredContext.raw}`,order:2}),D.registerItem({id:o.FILE_COMMANDS.FILTER_TOGGLE.id,command:o.FILE_COMMANDS.FILTER_TOGGLE.id,label:(0,o.localize)("file.filetree.filter"),viewId:d.RESOURCE_VIEW_ID,toggledWhen:`${f.FilesExplorerFilteredContext.raw}`,order:3}),D.registerItem({id:o.FILE_COMMANDS.REFRESH_ALL.id,command:o.FILE_COMMANDS.REFRESH_ALL.id,label:(0,o.localize)("file.refresh"),viewId:d.RESOURCE_VIEW_ID,when:`view == '${d.RESOURCE_VIEW_ID}' && !${f.FilesExplorerFilteredContext.raw}`,order:4}),D.registerItem({id:o.FILE_COMMANDS.COLLAPSE_ALL.id,command:o.FILE_COMMANDS.COLLAPSE_ALL.id,label:(0,o.localize)("file.collapse"),viewId:d.RESOURCE_VIEW_ID,order:5}),D.registerItem({id:o.WORKSPACE_COMMANDS.ADD_WORKSPACE_FOLDER.id,command:o.WORKSPACE_COMMANDS.ADD_WORKSPACE_FOLDER.id,label:(0,o.localize)("workspace.addFolderToWorkspace"),viewId:d.RESOURCE_VIEW_ID,order:0,group:"file_explore_workspace",when:"config.workspace.supportMultiRootWorkspace"})}doDelete(){const D=this.willDeleteUris.slice();return this.willDeleteUris=[],this.fileTreeModelService.deleteFileByUris(D)}dispose(){this._disposables.dispose()}};e.FileTreeContribution=A,n.__decorate([(0,s.Autowired)(s.INJECTOR_TOKEN),n.__metadata("design:type",s.Injector)],A.prototype,"injector",void 0),n.__decorate([(0,s.Autowired)(d.IFileTreeService),n.__metadata("design:type",_.FileTreeService)],A.prototype,"fileTreeService",void 0),n.__decorate([(0,s.Autowired)(c.IMainLayoutService),n.__metadata("design:type",Object)],A.prototype,"mainLayoutService",void 0),n.__decorate([(0,s.Autowired)(g.IProgressService),n.__metadata("design:type",Object)],A.prototype,"progressService",void 0),n.__decorate([(0,s.Autowired)(a.IWorkspaceService),n.__metadata("design:type",Object)],A.prototype,"workspaceService",void 0),n.__decorate([(0,s.Autowired)(y.FileTreeModelService),n.__metadata("design:type",y.FileTreeModelService)],A.prototype,"fileTreeModelService",void 0),n.__decorate([(0,s.Autowired)(E.IDecorationsService),n.__metadata("design:type",E.IDecorationsService)],A.prototype,"decorationService",void 0),n.__decorate([(0,s.Autowired)(u.WorkbenchEditorService),n.__metadata("design:type",u.WorkbenchEditorService)],A.prototype,"workbenchEditorService",void 0),n.__decorate([(0,s.Autowired)(o.CommandService),n.__metadata("design:type",Object)],A.prototype,"commandService",void 0),n.__decorate([(0,s.Autowired)(l.IWindowDialogService),n.__metadata("design:type",Object)],A.prototype,"windowDialogService",void 0),n.__decorate([(0,s.Autowired)(o.IClipboardService),n.__metadata("design:type",Object)],A.prototype,"clipboardService",void 0),n.__decorate([(0,s.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],A.prototype,"preferenceService",void 0),n.__decorate([(0,s.Autowired)(o.QuickOpenService),n.__metadata("design:type",Object)],A.prototype,"quickOpenService",void 0),n.__decorate([(0,s.Autowired)(c.IViewsRegistry),n.__metadata("design:type",Object)],A.prototype,"viewsRegistry",void 0),n.__decorate([(0,s.Autowired)(o.IApplicationService),n.__metadata("design:type",Object)],A.prototype,"appService",void 0),n.__decorate([(0,s.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],A.prototype,"appConfig",void 0),e.FileTreeContribution=A=n.__decorate([(0,v.Domain)(b.MenuContribution,o.CommandContribution,o.KeybindingContribution,o.TabBarToolbarContribution,o.ClientAppContribution,c.MainLayoutContribution)],A)},2812:(x,e,t)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeModel=void 0;const s=t(85608),o=t(76003),f=t(97267),b=t(41869),g=t(69959),v=t(93239);let E=n=class extends f.TreeModel{constructor(h){super(),this.flushDispatchChangeDelayer=new b.ThrottledDelayer(n.DEFAULT_FLUSH_DELAY),this.init(h)}init(h){this.root=h,this.root.watcher.on(f.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()})}};e.FileTreeModel=E,E.DEFAULT_FLUSH_DELAY=100,s.__decorate([(0,o.Autowired)(v.FileTreeDecorationService),s.__metadata("design:type",v.FileTreeDecorationService)],E.prototype,"decorationService",void 0),e.FileTreeModel=E=n=s.__decorate([(0,o.Injectable)({multiple:!0}),s.__param(0,(0,o.Optional)()),s.__metadata("design:paramtypes",[g.Directory])],E)},46377:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FILE_TREE_BADGE_LIMIT=e.FILE_TREE_NODE_HEIGHT=e.FileTreeNode=void 0;const n=t(85608),s=n.__importDefault(t(53373)),o=n.__importDefault(t(14041)),f=t(97267),b=t(41869),g=t(69959),v=n.__importDefault(t(89200)),{Path:E}=b.path,u=({item:h,onClick:c,onDoubleClick:r,onContextMenu:l,dndService:a,itemType:d,decorationService:p,labelService:m,leftPadding:_=8,onTwistierClick:y,decorations:S,defaultLeftPadding:A=8,template:T,hasFolderIcons:D,hasFileIcons:w,hidesExplorerArrows:I,hasPrompt:R,iconService:M})=>{const[O,P]=o.default.useState(-1),L=d===f.TreeNodeType.RenamePrompt,N=d===f.TreeNodeType.NewPrompt,k=L||N,B=!k&&h.name.indexOf(E.separator)>=0,F=(0,b.useDesignStyles)(v.default.expansion_toggle,"expansion_toggle"),U=(0,b.useDesignStyles)(v.default.file_tree_node,"file_tree_node"),V=k?null:p.getDecoration(h.uri,g.Directory.is(h)),H=ge=>{(d===f.TreeNodeType.TreeNode||d===f.TreeNodeType.CompositeTreeNode)&&(B&&P(h.name.split(E.separator).length-1),c(ge,h,d))},G=ge=>{(d===f.TreeNodeType.TreeNode||d===f.TreeNodeType.CompositeTreeNode)&&(B&&P(h.name.split(E.separator).length-1),r(ge,h,d))},K=ge=>{(d===f.TreeNodeType.TreeNode||d===f.TreeNodeType.CompositeTreeNode)&&(y?y(ge,h,d):c(ge,h,d))},z=o.default.useCallback(ge=>{ge.nativeEvent.which!==0&&(d===f.TreeNodeType.TreeNode||d===f.TreeNodeType.CompositeTreeNode)&&l(ge,h,d)},[l,h]),j=o.default.useCallback(ge=>{const{handleDragStart:ee}=a;(d===f.TreeNodeType.TreeNode||d===f.TreeNodeType.CompositeTreeNode)&&ee(ge,h)},[a,h]),W=o.default.useCallback(ge=>{const{handleDragLeave:ee}=a;(d===f.TreeNodeType.TreeNode||d===f.TreeNodeType.CompositeTreeNode)&&ee(ge,h)},[a,h]),$=o.default.useCallback(ge=>{const{handleDragEnter:ee}=a;(d===f.TreeNodeType.TreeNode||d===f.TreeNodeType.CompositeTreeNode)&&ee(ge,h)},[a,h]),Y=o.default.useCallback(ge=>{const{handleDrop:ee}=a;(d===f.TreeNodeType.TreeNode||d===f.TreeNodeType.CompositeTreeNode)&&ee(ge,h)},[a,h]),Q=o.default.useCallback(ge=>{const{handleDragOver:ee}=a;(d===f.TreeNodeType.TreeNode||d===f.TreeNodeType.CompositeTreeNode)&&ee(ge,h)},[a,h]);let te=d===f.TreeNodeType.CompositeTreeNode,re;k?N?(te=h.type===f.TreeNodeType.CompositeTreeNode,re=`${A+(h.parent.depth+1||0)*(_||0)+(te?0:D?I?0:20:0)}px`):(te=h.target.type===f.TreeNodeType.CompositeTreeNode,re=`${A+(h.target.depth||0)*(_||0)+(te?0:D?I?0:20:0)}px`):re=`${A+(h.depth||0)*(_||0)+(te?0:D?I?0:20:0)}px`;const ae={color:V?V.color:"",height:e.FILE_TREE_NODE_HEIGHT,lineHeight:`${e.FILE_TREE_NODE_HEIGHT}px`,paddingLeft:re,opacity:R&&!k?".6":"1"},ce=(ge,ee)=>{if(S&&S?.classlist.indexOf(v.default.mod_loading)>-1)return o.default.createElement(f.Loading,null);if(k&&ge instanceof f.PromptHandle){let X=!1;if(L?X=ge.target.type===f.TreeNodeType.CompositeTreeNode:X=ge.type===f.TreeNodeType.CompositeTreeNode,X)return o.default.createElement("div",{className:(0,s.default)(v.default.file_tree_node_segment,F,(0,b.getIcon)("arrow-right"),{[`${v.default.mod_collapsed}`]:N||!(L&&ge.target.type===f.TreeNodeType.CompositeTreeNode&&ge.target.expanded)})})}else return o.default.createElement("div",{onClick:ee,className:(0,s.default)(v.default.file_tree_node_segment,F,(0,b.getIcon)("arrow-right"),{[`${v.default.mod_collapsed}`]:!ge.expanded})})},q=ge=>{let ee,X;k&&ge instanceof f.PromptHandle?ge instanceof f.RenamePromptHandle?(ee=ge.target.uri.resolve(ge.$.value),X=g.Directory.is(ge.target)):(ee=ge.parent.uri.resolve(ge.$.value),X=ge.type===f.TreeNodeType.CompositeTreeNode):(ee=ge.uri,X=ge.filestat.isDirectory);const ie=m.getIcon(ee,{isDirectory:X,isOpenedDirectory:X&&ge.expanded});return X&&!D||!X&&!w?null:o.default.createElement("div",{className:(0,s.default)(v.default.file_icon,ie,{expanded:X&&ge.expanded}),style:{height:e.FILE_TREE_NODE_HEIGHT,lineHeight:`${e.FILE_TREE_NODE_HEIGHT}px`}})},_e=ge=>{if(T)return o.default.createElement(T,null);if(k&&ge instanceof f.PromptHandle)return o.default.createElement("div",{className:(0,s.default)(v.default.file_tree_node_segment,v.default.file_tree_node_inputbox)},o.default.createElement("div",{className:(0,s.default)("input-box",v.default.file_tree_node_prompt_box)},o.default.createElement(ge.ProxiedInput,{wrapperStyle:{height:e.FILE_TREE_NODE_HEIGHT,padding:"0 5px"}})));if(B){const ee=ge.displayName.split(E.separator),X=ee.map((ie,se)=>{const he=ee.slice(0,se+1).join(E.separator),ue=Ae=>{Ae.stopPropagation(),P(se);const Ie=h.parent.uri.resolve(ee.slice(0,se+1).join(E.separator));c(Ae,h,d,Ie)},ve=Ae=>{Ae.stopPropagation(),P(se);const Ie=h.parent.uri.resolve(ee.slice(0,se+1).join(E.separator));l(Ae,h,d,Ie)},ne=Ae=>{Ae.stopPropagation(),Ae.preventDefault(),O!==se&&(P(se),a.handleDragOver(Ae,h))},fe=Ae=>{Ae.stopPropagation(),Ae.preventDefault(),P(-1)},Ce=Ae=>{Ae.stopPropagation(),O!==se&&P(se);const Ie=h.parent.uri.resolve(ee.slice(0,se+1).join(E.separator));a.handleDragStart(Ae,h,Ie)},be=Ae=>{Ae.stopPropagation();const Ie=h.parent.uri.resolve(ee.slice(0,se+1).join(E.separator));a.handleDrop(Ae,h,Ie)},Se=(0,s.default)(O===se&&v.default.active,v.default.compact_name);return o.default.createElement("span",{key:he},o.default.createElement("a",{className:Se,draggable:!0,onContextMenu:ve,onDragStart:Ce,onDragOver:ne,onDragLeave:fe,onDrop:be,onClick:ue},ie),se!==ee.length-1?o.default.createElement("span",{className:v.default.compact_name_separator},E.separator):null)});return o.default.createElement("div",{className:(0,s.default)(v.default.file_tree_node_segment,v.default.file_tree_node_displayname)},X)}return o.default.createElement("div",{className:(0,s.default)(v.default.file_tree_node_segment,v.default.file_tree_node_displayname)},m.getName(ge.uri)||ge.displayName)},pe=()=>o.default.createElement("div",{className:(0,s.default)(v.default.file_tree_node_segment,v.default.file_tree_node_tail)},Z()),Z=()=>V?o.default.createElement("div",{className:v.default.file_tree_node_status},(0,b.transformLabelWithCodicon)(V.badge.slice(),{color:"inherit"},M.fromString.bind(M))):null,le=ge=>{if(I)return null;if(te)return ce(ge,K);if(k)return ce(ge,()=>{})},oe=()=>{let ge=h.tooltip;return V&&V.badge&&(ge+=` \u2022 ${V.tooltip}`),ge};return o.default.createElement("div",{key:h.id,onClick:H,onDoubleClick:G,onContextMenu:z,onDragStart:j,onDragOver:Q,onDragEnter:$,onDragLeave:W,onDrop:Y,title:oe(),className:(0,s.default)(U,S?S.classlist:null),style:ae,draggable:d===f.TreeNodeType.TreeNode||d===f.TreeNodeType.CompositeTreeNode,"data-id":h.id},o.default.createElement("div",{className:(0,s.default)(v.default.file_tree_node_content)},le(h),q(h),o.default.createElement("div",{className:k?v.default.file_tree_node_prompt_wrap:v.default.file_tree_node_overflow_wrap},_e(h)),pe()))};e.FileTreeNode=u,e.FILE_TREE_NODE_HEIGHT=22,e.FILE_TREE_BADGE_LIMIT=99},56384:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTree=e.FILE_TREE_FILTER_DELAY=e.FILTER_AREA_HEIGHT=void 0;const n=t(85608),s=n.__importDefault(t(53373)),o=n.__importStar(t(14041)),f=t(97267),b=t(41869),g=t(68974),v=t(24429),E=t(87420),u=t(6250),h=t(46377),c=n.__importDefault(t(2613)),r=t(97738);e.FILTER_AREA_HEIGHT=30,e.FILE_TREE_FILTER_DELAY=500;const l=(0,f.RecycleTreeFilterDecorator)(f.RecycleTree),a=({viewState:p})=>{const[m,_]=(0,o.useState)(!1),[y,S]=(0,o.useState)(!0),[A,T]=(0,o.useState)(!1),[D,w]=(0,o.useState)(!1),[I,R]=(0,o.useState)(),M=(0,o.useRef)(null),O=(0,o.useRef)(new b.DisposableCollection),{height:P}=p,L=(0,b.useInjectable)(u.IFileTreeService),{iconService:N,locationToCurrentFile:k,filterMode:B,indent:F,baseIndent:U}=L,V=(0,b.useInjectable)(r.FileTreeModelService),[H,G]=(0,o.useState)({indent:F,baseIndent:U}),[K,z]=(0,o.useState)(B),[j,W]=(0,o.useState)(N.currentTheme||{hasFolderIcons:!0,hasFileIcons:!0,hidesExplorerArrows:!0}),$=(0,o.useCallback)(he=>Y(he)?!1:he.shiftKey,[]),Y=(0,o.useCallback)(he=>{const{metaKey:ue,ctrlKey:ve}=he;return b.isOSX&&ue||ve},[]),Q=(0,o.useCallback)((he,ue,ve,ne)=>{he.stopPropagation();const{handleItemClick:fe,handleItemToggleClick:Ce,handleItemRangeClick:be}=V;if(!ue)return;const Se=$(he),Ae=Y(he);Se?be(ue,ve):Ae?Ce(ue,ve):fe(ue,ve,ne)},[]),te=(0,o.useCallback)((he,ue,ve)=>{he.stopPropagation();const{handleItemDoubleClick:ne}=V;ue&&ne(ue,ve)},[]),re=(0,o.useCallback)((he,ue)=>{he.stopPropagation();const{toggleDirectory:ve}=V;ve(ue)},[]);(0,o.useEffect)(()=>{m&&V.onFileTreeModelChange(async he=>{S(!0),he&&await he.ensureReady,R(he),S(!1)})},[m]),(0,o.useEffect)(()=>{var he,ue,ve;const ne=new b.CancellationTokenSource;return q(ne.token),(he=O.current)===null||he===void 0||he.push(N.onThemeChange(fe=>{W(fe)})),(ue=O.current)===null||ue===void 0||ue.push(L.onTreeIndentChange(({indent:fe,baseIndent:Ce})=>{G({indent:fe,baseIndent:Ce})})),(ve=O.current)===null||ve===void 0||ve.push(L.onFilterModeChange(fe=>{z(fe)})),()=>{var fe;ne.cancel(),(fe=O.current)===null||fe===void 0||fe.dispose()}},[]);const ae=(0,o.useCallback)((he,ue)=>{let ve;if(he&&ue)for(ve=he.parentNode;ve;){if(ue===ve)return!0;ve=ve.parentNode}return!1},[]),ce=(0,o.useCallback)(he=>{ae(he.relatedTarget,M.current)||!he.relatedTarget||(T(!1),V.handleTreeBlur())},[M.current]);(0,o.useEffect)(()=>{K||(V.fileTreeHandle&&V.fileTreeHandle.clearFilter(),V.selectedFiles.length===1&&V.location(V.selectedFiles[0].uri))},[K]),(0,o.useEffect)(()=>{const he=new b.DisposableCollection;return I&&(he.push(V.onDidFocusedFileChange(ue=>{ue?ue.isEqual((I?.root).uri)?A||T(!A):A&&T(!A):ue||A&&T(!A)})),he.push(V.onDidContextMenuFileChange(ue=>{ue?ue.isEqual((I?.root).uri)?A||T(!A):A&&T(!A):ue||A&&T(!A)}))),()=>{he.dispose()}},[I,A]);const q=(0,o.useCallback)(async he=>{var ue;if(await V.whenReady,!he.isCancellationRequested){if(V.treeModel){if(await V.treeModel.ensureReady,R(V.treeModel),he.isCancellationRequested)return;M.current&&L.initContextKey(M.current)}S(!1),!((ue=O.current)===null||ue===void 0)&&ue.disposed||_(!0)}},[V,O.current]),_e=(0,o.useCallback)(he=>{V.handleTreeHandler({...he,getModel:()=>V.treeModel,hasDirectFocus:()=>M.current===document.activeElement})},[M.current,I]),pe=(0,o.useCallback)(()=>{const{handleItemClick:he}=V;he()},[]),Z=(0,o.useCallback)(()=>{V.handleDblClick()},[]),le=(0,o.useCallback)(()=>{const{handleTreeFocus:he}=V;he()},[]),oe=(0,o.useCallback)(he=>{const{handleContextMenu:ue}=V;ue(he)},[]),ge=(0,o.useCallback)(he=>{he.stopPropagation(),he.preventDefault()},[]),ee=(0,o.useCallback)(he=>{he.preventDefault(),w(!0)},[]),X=(0,o.useCallback)(()=>{w(!1)},[]),ie=(0,o.useCallback)(he=>{const{handleDrop:ue}=V.dndService;w(!1),ue(he)},[]),se=(0,o.useCallback)((he,ue,ve,ne)=>{const{handleContextMenu:fe}=V;fe(he,ue,ne)},[]);return o.default.createElement("div",{className:(0,s.default)(c.default.file_tree,D&&c.default.outer_drag_over,A&&c.default.outer_active),tabIndex:-1,ref:M,onClick:pe,onDoubleClick:Z,onFocus:le,onBlur:ce,onContextMenu:oe,draggable:!0,onDragStart:ge,onDragLeave:X,onDragOver:ee,onDrop:ie},o.default.createElement(d,{isLoading:y,isReady:m,height:P,model:I,iconTheme:j,treeIndent:H,filterMode:K,locationToCurrentFile:k,onTreeReady:_e,onContextMenu:se,onItemClick:Q,onItemDoubleClick:te,onTwistierClick:re}))};e.FileTree=a;const d=(0,o.memo)(({isReady:p,isLoading:m,height:_,model:y,filterMode:S,treeIndent:A,iconTheme:T,onTreeReady:D,onItemClick:w,onItemDoubleClick:I,onContextMenu:R,onTwistierClick:M})=>{const O=(0,b.useInjectable)(u.IFileTreeService),P=(0,b.useInjectable)(E.IIconService),{decorationService:L,labelService:N,locationToCurrentFile:k}=O,B=(0,b.useInjectable)(r.FileTreeModelService),F=(0,o.useCallback)(U=>o.default.createElement(h.FileTreeNode,{item:U.item,itemType:U.itemType,template:U.template,decorationService:L,labelService:N,iconService:P,dndService:B.dndService,decorations:B.decorations.getDecorations(U.item),onClick:w,onDoubleClick:I,onTwistierClick:M,onContextMenu:R,defaultLeftPadding:A.baseIndent,leftPadding:A.indent,hasPrompt:U.hasPrompt,hasFolderIcons:T.hasFolderIcons,hasFileIcons:T.hasFileIcons,hidesExplorerArrows:T.hidesExplorerArrows}),[y,A,T]);return p?m?o.default.createElement(g.Progress,{loading:!0}):y?o.default.createElement(l,{height:_,itemHeight:h.FILE_TREE_NODE_HEIGHT,onReady:D,model:y,filterEnabled:S,filterAfterClear:k,filterAutoFocus:!0,leaveBottomBlank:!0},F):o.default.createElement(v.WelcomeView,{viewId:u.FILE_EXPLORER_WELCOME_ID}):o.default.createElement(g.Progress,{loading:!0})});d.displayName="FileTreeView"},57781:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeService=void 0;const n=t(85608),s=t(76003),o=t(97267),f=t(41869),b=t(18193),g=t(26542),v=t(42933),E=t(52416),u=t(51500),h=t(6250),c=t(69959),r=t(88014),l=t(93239),{Path:a}=f.path;let d=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 f.Emitter,this.onTreeIndentChangeEmitter=new f.Emitter,this.onFilterModeChangeEmitter=new f.Emitter,this.onNodeRefreshedEmitter=new f.Emitter,this._filterMode=!1,this._refreshable=!0,this.refreshEffectNode=()=>{const m=this.effectedNodes.slice(0);if(this.effectedNodes=[],m.find(y=>c.Directory.isRoot(y)))this.refresh();else for(const y of m)this.refresh(y)},this.flushEventQueue=async()=>{if(!this._changeEventDispatchQueue||this._changeEventDispatchQueue.size===0)return;const m=Array.from(this._changeEventDispatchQueue),_=this.sortPaths(m);(!this.refreshCancelToken||this.refreshCancelToken.token.isCancellationRequested)&&(this.refreshCancelToken=new f.CancellationTokenSource);const y=(0,f.pSeries)(_.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(f.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(m=>{this._roots=m;const _=new f.URI(m[0].uri),y=new c.Directory(this,void 0,_,_.displayName,m[0],this.fileTreeAPI.getReadableTooltip(_));this.root=y,this.onWorkspaceChangeEmitter.fire(y),this.refresh()})),this.toDispose.push(this.workspaceService.onWorkspaceFileExcludeChanged(()=>{this.refresh()})),this.toDispose.push(f.Disposable.create(()=>{var m;(m=this._root)===null||m===void 0||m.dispose(),this._roots=null})),this.toDispose.push(this.corePreferences.onPreferenceChanged(m=>{m.preferenceName==="explorer.fileTree.baseIndent"?(this._baseIndent=m.newValue||8,this.onTreeIndentChangeEmitter.fire({indent:this.indent,baseIndent:this.baseIndent})):m.preferenceName==="explorer.fileTree.indent"?(this._indent=m.newValue||8,this.onTreeIndentChangeEmitter.fire({indent:this.indent,baseIndent:this.baseIndent})):m.preferenceName==="explorer.compactFolders"&&(this._isCompactMode=m.newValue,this.refresh())}))}initContextKey(m){this.fileContextKey.initScopedContext(m)}startWatchFileEvent(){return this._readyToWatch=!0,Promise.all(this._watchRootsQueue.map(m=>this.watchFilesChange(m)))}async resolveChildren(m){var _,y,S,A;let T=[];if(m){if(c.Directory.isRoot(m)&&this.isMultipleWorkspace){const D=await this.workspaceService.roots;for(const w of D){const I=this.fileTreeAPI.toNode(this,w,m,this.workspaceService.getWorkspaceName(new f.URI(w.uri)));this.watchFilesChange(new f.URI(w.uri)),T=T.concat(I),(I.filestat.isSymbolicLink||I.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(I.filestat.uri,I)}return T}if(m.uri){const D=await this.fileTreeAPI.resolveChildren(this,m.uri.toString(),m,this.isCompactMode&&!c.Directory.isRoot(m));T=D.children,T.forEach(I=>{(I.filestat.isSymbolicLink||I.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(I.filestat.uri,I)});const w=D.filestat;if(w&&this.isCompactMode&&!c.Directory.isRoot(m)){const I=new f.URI(w.uri),R=m.parent;if(m&&R){let M=m.name;if(m.filestat.isSymbolicLink){const O=(y=new f.URI(m.filestat.realUri).relative(I))===null||y===void 0?void 0:y.toString();O&&(M=O,M=[m.uri.displayName].concat(M.split(a.separator)).join(a.separator))}else R.filestat.isSymbolicLink?M=(S=new f.URI(R.filestat.realUri).relative(I))===null||S===void 0?void 0:S.toString():M=(A=R.uri.relative(I))===null||A===void 0?void 0:A.toString();M&&M!==m.name&&m.updateMetaData({name:M,uri:I,tooltip:this.fileTreeAPI.getReadableTooltip(I),fileStat:w})}}return T}}else if(this._roots||(this._roots=await this.workspaceService.roots),this.isMultipleWorkspace){const D=new f.URI((_=this.workspaceService.workspace)===null||_===void 0?void 0:_.uri);let w=D.displayName;w=w.slice(0,w.lastIndexOf("."));const I={...this.workspaceService.workspace,isDirectory:!0},R=new c.Directory(this,void 0,D,w,I,this.fileTreeAPI.getReadableTooltip(D));return this.root=R,[R]}else if(this._roots.length>0)return T=await(await this.fileTreeAPI.resolveChildren(this,this._roots[0])).children,T.forEach(D=>{const w=this.workspaceService.getWorkspaceName(D.uri);w&&w!==D.name&&D.updateMetaData({name:w}),(D.filestat.isSymbolicLink||D.filestat.isInSymbolicDirectory)&&this._symbolicFiles.set(D.filestat.uri,D)}),this.watchFilesChange(new f.URI(this._roots[0].uri)),this.root=T[0],T;return[]}async watchFilesChange(m){if(!this._readyToWatch){this._watchRootsQueue.push(m);return}const _=await this.fileServiceClient.watchFileChanges(m);this.toDispose.push(_),this.toDispose.push(_.onFilesChanged(y=>{this.onFilesChanged(y)})),this._fileServiceWatchers.set(m.toString(),_)}updateRefreshable(m){var _;m!==this.refreshable&&(this._refreshable=m,this._refreshable?this.doHandleQueueChange():(_=this.refreshCancelToken)===null||_===void 0||_.cancel())}isContentFile(m){return!!m&&"filestat"in m&&!m.filestat.isDirectory}isFileContentChanged(m){return m.type===v.FileChangeType.UPDATED&&this.isContentFile(this.getNodeByPathOrUri(m.uri))}getAffectedChanges(m){const _=[];for(const y of m)this.isFileContentChanged(y)||_.push(y);return _}isRootAffected(m){return this._roots?m.some(_=>_.type>v.FileChangeType.UPDATED&&this._roots&&this._roots.find(y=>_.uri.indexOf(y.uri)>=0)):!1}async onFilesChanged(m){const _=await this.getAffectedNodes(this.getAffectedChanges(m));return _.length>0?this.effectedNodes=this.effectedNodes.concat(_):!(_.length>0)&&this.isRootAffected(m)&&this.effectedNodes.push(this.root),this.refreshEffectNode()}async getFileTreeNodePathByUri(m){var _,y,S,A,T,D;if(!m)return;let w;if(this.isMultipleWorkspace){if(this._roots||(this._roots=await this.workspaceService.roots),w=(A=this._roots.find(I=>new f.URI(I.uri).isEqualOrParent(m)))===null||A===void 0?void 0:A.uri,w){const I=new f.URI(w);if(I.isEqualOrParent(m))return new a(((T=this.root)===null||T===void 0?void 0:T.path)||"/").join(I.displayName).join(((D=I.relative(m))===null||D===void 0?void 0:D.toString())||"").toString()}}else if(w=(_=this.workspaceService.workspace)===null||_===void 0?void 0:_.uri,w){const I=new f.URI(w);if(I.isEqualOrParent(m))return new a(((y=this.root)===null||y===void 0?void 0:y.path)||"").join(((S=I.relative(m))===null||S===void 0?void 0:S.toString())||"").toString()}}async moveNodeByPath(m,_,y,S,A=o.TreeNodeType.TreeNode){const T=new a(m.path).join(y).toString(),D=new a(_.path).join(S).toString();if(T&&D&&D!==T){const w=m.moveNode(T,D);return w&&c.File.is(w)&&(w.updateMetaData({uri:_.uri.resolve(S),fileStat:{..._.filestat,uri:_.uri.resolve(S).toString(),isDirectory:A!==o.TreeNodeType.TreeNode},tooltip:this.fileTreeAPI.getReadableTooltip(_.uri.resolve(S))}),c.Directory.is(w)&&this.updateChildren(w)),w}}async updateChildren(m){const _=m.children;if(!(!_||_.length===0)){for(const y of _)if(c.File.is(y)){const S=m.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(m,_,y){let S,A;const T=a.splitPath(_);if(T.length>1){let w=m.uri;for(const I of T)w=w.resolve(I);!this.isCompactMode||c.Directory.isRoot(m)?A=T[0]:y===o.TreeNodeType.CompositeTreeNode?A=_:A=T.slice(0,T.length-1).join(a.separator)}else A=_;S={uri:m.uri.resolve(A).toString(),isDirectory:y===o.TreeNodeType.CompositeTreeNode||T.length>1,isSymbolicLink:!1,lastModification:new Date().getTime()};const D=await this.fileTreeAPI.toNode(this,S,m,A);return D&&m.addNode(D),D}async deleteAffectedNodeByPath(m,_){var y,S;const A=this.getNodeByPathOrUri(m);A&&A.parent&&(this.isCompactMode&&!_?((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(m,_=[]){const y=[];for(const S of m){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 _.filter(S=>S.type!==v.FileChangeType.DELETED)}async getAffectedNodes(m){const _=[];for(const y of m){const S=new f.URI(y.uri),A=this.getNodeByPathOrUri(S.parent);A&&_.push(A)}return _}isFileURI(m){return/^file:\/\//.test(m)}getNodeByPathOrUri(m){var _,y,S,A;let T,D;if(typeof m!="string"?(D=m,m=m.toString()):this.isFileURI(m)?D=new f.URI(m):!this.isFileURI(m)&&typeof m=="string"&&(T=m),this.isFileURI(m)&&D){if(this._symbolicFiles.has(D?.toString()))return this._symbolicFiles.get(D.toString());let w;if(this.isMultipleWorkspace?this._roots&&(w=(y=this._roots.find(I=>new f.URI(I.uri).isEqualOrParent(D)))===null||y===void 0?void 0:y.uri):w=(_=this.workspaceService.workspace)===null||_===void 0?void 0:_.uri,this.root&&w){const I=new f.URI(w);if(I.isEqualOrParent(D)){const R=I.relative(D);R&&(T=new a(this.root.path).join(R.toString()).toString())}}}if(T){const w=(S=this.root)===null||S===void 0?void 0:S.getTreeNodeByPath(T);if(!w){let I;const R=T.split(a.separator);for(;R.length>=1;){R.pop();const M=R.join(a.separator);if(I=(A=this.root)===null||A===void 0?void 0:A.getTreeNodeByPath(M),I)break}if(I&&c.Directory.is(I)){for(const M of I.children||[])if(M.path.includes(T))return M}}return w}}sortComparator(m,_){return m.constructor===_.constructor?m.name.localeCompare(_.name,"en",{numeric:!0}):m.type===o.TreeNodeType.CompositeTreeNode?-1:_.type===o.TreeNodeType.CompositeTreeNode?1:0}get contextMenuContextKeyService(){return this.fileContextKey?this.fileContextKey.service:this.contextKeyService}reWatch(){for(const[m,_]of this._fileServiceWatchers)_.dispose(),this.watchFilesChange(new f.URI(m))}get isMultipleWorkspace(){return!!this.workspaceService.workspace&&!this.workspaceService.workspace.isDirectory}getDisplayName(m){return this.workspaceService.getWorkspaceName(m)}async refresh(m=this.root){if(m)return c.Directory.is(m)||c.File.is(m)&&m.parent&&(m=m.parent),this._changeEventDispatchQueue.add(m.path),this.doHandleQueueChange()}async doHandleQueueChange(){if(this.refreshable)try{await this.flushEventQueue()}catch(m){this.logger.error("flush file change event queue error:",m)}finally{this.onNodeRefreshedEmitter.fire()}}sortPaths(m){const y=m.slice().map(A=>({node:this.getNodeByPathOrUri(A),path:A})).filter(A=>A&&!!A.node);m.length>1&&y.sort((A,T)=>{var D,w;const I=((D=A.node)===null||D===void 0?void 0:D.depth)||0,R=((w=T.node)===null||w===void 0?void 0:w.depth)||0;return I-R});const S=[];for(let A=y.length-1;A>=0;A--){const T=y[A];let D=!1;for(let w=0;w<A;w++){const I=y[w];c.Directory.is(I)&&T.node.path.startsWith(I.node.path)&&(D=!0)}D||S.push(T)}return S}openFile(m){const _=this.preferenceService.get("editor.previewMode");this.commandService.executeCommand(f.EDITOR_COMMANDS.OPEN_RESOURCE.id,m,{disableNavigate:!0,preview:_})}openAndFixedFile(m){this.commandService.executeCommand(f.EDITOR_COMMANDS.OPEN_RESOURCE.id,m,{disableNavigate:!0,preview:!1,focus:!0})}openToTheSide(m){this.commandService.executeCommand(f.EDITOR_COMMANDS.OPEN_RESOURCE.id,m,{disableNavigate:!0,split:4})}compare(m,_){this.commandService.executeCommand(f.EDITOR_COMMANDS.COMPARE.id,{original:m,modified:_})}toggleFilterMode(){var m;this._filterMode=!this.filterMode,this.onFilterModeChangeEmitter.fire(this.filterMode),(m=this.fileContextKey)===null||m===void 0||m.filesExplorerFilteredContext.set(this.filterMode),this.filterMode===!1&&this.commandService.executeCommand(f.FILE_COMMANDS.LOCATION.id)}};e.FileTreeService=d,n.__decorate([(0,s.Autowired)(h.IFileTreeAPI),n.__metadata("design:type",Object)],d.prototype,"fileTreeAPI",void 0),n.__decorate([(0,s.Autowired)(f.CommandService),n.__metadata("design:type",Object)],d.prototype,"commandService",void 0),n.__decorate([(0,s.Autowired)(f.IContextKeyService),n.__metadata("design:type",Object)],d.prototype,"contextKeyService",void 0),n.__decorate([(0,s.Autowired)(u.IWorkspaceService),n.__metadata("design:type",Object)],d.prototype,"workspaceService",void 0),n.__decorate([(0,s.Autowired)(b.CorePreferences),n.__metadata("design:type",Object)],d.prototype,"corePreferences",void 0),n.__decorate([(0,s.Autowired)(f.PreferenceService),n.__metadata("design:type",Object)],d.prototype,"preferenceService",void 0),n.__decorate([(0,s.Autowired)(g.LabelService),n.__metadata("design:type",g.LabelService)],d.prototype,"labelService",void 0),n.__decorate([(0,s.Autowired)(l.FileTreeDecorationService),n.__metadata("design:type",l.FileTreeDecorationService)],d.prototype,"decorationService",void 0),n.__decorate([(0,s.Autowired)(v.IFileServiceClient),n.__metadata("design:type",Object)],d.prototype,"fileServiceClient",void 0),n.__decorate([(0,s.Autowired)(E.IIconService),n.__metadata("design:type",Object)],d.prototype,"iconService",void 0),n.__decorate([(0,s.Autowired)(f.ILogger),n.__metadata("design:type",Object)],d.prototype,"logger",void 0),n.__decorate([(0,s.Autowired)(r.FileContextKey),n.__metadata("design:type",r.FileContextKey)],d.prototype,"fileContextKey",void 0),e.FileTreeService=d=n.__decorate([(0,s.Injectable)()],d)},83709:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeNextModule=void 0;const n=t(85608),s=t(41869),o=t(72665),f=t(41103),b=t(6250),g=t(89508),v=t(40439),E=t(57781),u=t(88808),h=t(93239),c=t(97738),r=t(24861);let l=class extends s.BrowserModule{constructor(){super(...arguments),this.providers=[{token:b.IFileTreeAPI,useClass:u.FileTreeAPI},{token:h.FileTreeDecorationService,useClass:h.FileTreeDecorationService},{token:b.IFileTreeService,useClass:E.FileTreeService},{token:c.FileTreeModelService,useClass:c.FileTreeModelService},{token:o.IWindowDialogService,useClass:g.WindowDialogServiceImpl},v.FileTreeContribution]}};e.FileTreeNextModule=l,e.FileTreeNextModule=l=n.__decorate([(0,s.Domain)(r.name),(0,s.ModuleDependencies)([f.WorkspaceModule])],l)},88808:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeAPI=void 0;const n=t(85608),s=t(76003),o=t(41869),f=t(43718),b=t(42933),g=t(72665),v=t(26199),E=t(69959);let u=class{constructor(){this.cacheFileStat=new Map}async resolveChildren(c,r,l,a){var d;let p;if(!this.userhomePath){const m=await this.fileServiceClient.getCurrentUserHome();m&&(this.userhomePath=new f.URI(m.uri))}if(typeof r=="string"?p=await this.fileServiceClient.getFileStat(r):p=await this.fileServiceClient.getFileStat(r.uri),p){if(((d=p.children)===null||d===void 0?void 0:d.length)===1&&p.children[0].isDirectory&&a)return await this.resolveChildren(c,p.children[0].uri,l,a);{const m={...p,isInSymbolicDirectory:l?.filestat.isSymbolicLink||l?.filestat.isInSymbolicDirectory};return{children:this.toNodes(c,m,l),filestat:m}}}else return{children:[],filestat:null}}async resolveNodeByPath(c,r,l){const a=await this.fileServiceClient.getFileStat(r);if(a)return this.toNode(c,a,l)}async resolveFileStat(c){return await this.fileServiceClient.getFileStat(c.toString())}toNodes(c,r,l){if(l){if(r.children)return r.children.map(a=>this.toNode(c,a,l))}else return[this.toNode(c,r,l)];return[]}toNode(c,r,l,a){var d;const p=new f.URI(r.uri),m=a||p.displayName;let _;return r.isInSymbolicDirectory=(d=l?.filestat.isSymbolicLink)!==null&&d!==void 0?d:l?.filestat.isInSymbolicDirectory,r.isDirectory?_=new E.Directory(c,l,p,m,r,this.getReadableTooltip(p)):_=new E.File(c,l,p,m,r,this.getReadableTooltip(p)),_}async mvFiles(c,r){const l=[];for(const p of c)if(p.url.isEqualOrParent(r))return;const a=c.sort((p,m)=>p.toString().length-m.toString().length),d=[];for(const p of a)d.length>0&&d.find(m=>m.url.isEqualOrParent(p.url))||d.push(p);if(this.corePreferences["explorer.confirmMove"]){const p=(0,f.localize)("file.confirm.move.ok"),m=(0,f.localize)("file.confirm.move.cancel");if(await this.dialogService.warning((0,f.formatLocalize)("file.confirm.move",`[ ${d.map(y=>y.url.displayName).join(",")} ]`,r.displayName),[m,p])!==p)return}for(const p of d){const m=await this.mv(p.url,r.resolve(p.url.displayName),p.isDirectory);m&&l.push(m)}return l}async mv(c,r,l=!1){try{await this.workspaceEditService.apply({edits:[{newResource:r,oldResource:c,options:{isDirectory:l,overwrite:!0}}]})}catch(a){return a.message}}async createFile(c,r){try{await this.workspaceEditService.apply({edits:[{newResource:c,options:{content:r}}]})}catch(l){return l.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(r){return r.message}}async delete(c){try{await this.workspaceEditService.apply({edits:[{oldResource:c,options:{}}]});return}catch(r){return r.message}}async copyFile(c,r){let l=1,a;try{a=await this.fileServiceClient.access(r.toString())}catch(d){return d.message}for(;a;){const d=r.displayName.replace(/\Wcopy\W\d+/,""),p=f.path.extname(d),_=`${f.path.basename(d,p)} copy ${l}${p}`;r=r.parent.resolve(_),l++;try{a=await this.fileServiceClient.access(r.toString())}catch{return}}try{return await this.fileServiceClient.copy(c.toString(),r.toString())}catch(d){return d.message}}getReadableTooltip(c){const r=c.toString(),l=this.userhomePath&&this.userhomePath.toString();return this.userhomePath&&this.userhomePath.isEqualOrParent(c)?decodeURIComponent(r.replace(l,"~")):decodeURIComponent(c.withScheme("").toString())}};e.FileTreeAPI=u,n.__decorate([(0,s.Autowired)(b.IFileServiceClient),n.__metadata("design:type",Object)],u.prototype,"fileServiceClient",void 0),n.__decorate([(0,s.Autowired)(v.IWorkspaceEditService),n.__metadata("design:type",Object)],u.prototype,"workspaceEditService",void 0),n.__decorate([(0,s.Autowired)(f.CommandService),n.__metadata("design:type",Object)],u.prototype,"commandService",void 0),n.__decorate([(0,s.Autowired)(o.CorePreferences),n.__metadata("design:type",Object)],u.prototype,"corePreferences",void 0),n.__decorate([(0,s.Autowired)(g.IDialogService),n.__metadata("design:type",Object)],u.prototype,"dialogService",void 0),e.FileTreeAPI=u=n.__decorate([(0,s.Injectable)()],u)},93239:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeDecorationService=void 0;const n=t(85608),s=t(76003),o=t(41869),f=t(41893),b=t(52416);let g=class{constructor(){this.disposeCollection=new o.DisposableCollection,this.onDidChangeEmitter=new o.Emitter,this.cacheDecorations=new Map,this.disposeCollection.pushAll([this.decorationsService.onDidChangeDecorations(E=>{var u,h,c;const r=(h=(u=E._data)===null||u===void 0?void 0:u._iter)===null||h===void 0?void 0:h._value;if(r){const l=new o.URI(r),a=this.getDecoration(l);this.cacheDecorations.has(r)?((c=this.cacheDecorations.get(r))===null||c===void 0?void 0:c.tooltip)!==a?.tooltip&&this.onDidChangeEmitter.fire():(this.cacheDecorations.set(r,a),this.onDidChangeEmitter.fire())}}),this.themeService.onThemeChange(()=>{this.onDidChangeEmitter.fire()})])}get onDidChange(){return this.onDidChangeEmitter.event}getDecoration(E,u=!1){E instanceof o.URI&&(E=o.Uri.parse(E.toString()));const h=this.decorationsService.getDecoration(E,u);return h?{...h,color:this.themeService.getColor({id:h.color})}:{color:"",tooltip:"",badge:""}}dispose(){this.disposeCollection.dispose()}};e.FileTreeDecorationService=g,n.__decorate([(0,s.Autowired)(f.IDecorationsService),n.__metadata("design:type",f.IDecorationsService)],g.prototype,"decorationsService",void 0),n.__decorate([(0,s.Autowired)(b.IThemeService),n.__metadata("design:type",Object)],g.prototype,"themeService",void 0),e.FileTreeDecorationService=g=n.__decorate([(0,s.Injectable)(),n.__metadata("design:paramtypes",[])],g)},30577:(x,e,t)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.DragAndDropService=void 0;const s=t(85608),o=t(76003),f=t(97267),b=t(41869),g=t(53622),v=t(14951),E=t(72665),u=t(6250),h=t(69959),c=s.__importDefault(t(89200)),r=s.__importDefault(t(2613)),l=t(57781),a=t(97738);let d=n=class extends b.WithEventBus{constructor(m){super(),this.model=m,this.toCancelNodeExpansion=new b.DisposableCollection,this.beingDraggedDec=new f.Decoration(c.default.mod_dragging),this.draggedOverDec=new f.Decoration(c.default.mod_dragover),this.beingDraggedNodes=[],this.dragOverTrigger=new b.ThrottledDelayer(n.MS_TILL_DRAGGED_OVER_EXPANDS),this.handleDragStart=(_,y,S)=>{_.stopPropagation();const A=I=>{this.handleDragEnd(I,y)};_.currentTarget.addEventListener("dragend",A,!1);let T=this.model.selectedFiles,D=!1;for(const I of T)I&&I.id===y.id&&(D=!0);D||(T=[y]),this.beingDraggedNodes=T,this.beingDraggedActiveUri=S;const w=T.find(I=>!h.Directory.is(I));if(w&&_.dataTransfer.setData("uri",w.uri.toString()),_.dataTransfer.setData("beingDraggedNodes",JSON.stringify(this.beingDraggedNodes.map(I=>I.uri.toString()))),w){const I=w;I.uri.scheme==="file"&&_.dataTransfer.setData("DownloadURL",`application/octet-stream:${I.displayName}:data:application/octet-stream;base64,${(0,b.encodeBase64)(b.BinaryBuffer.fromString(I.filestat.uri))}`)}if(T.forEach(I=>{this.beingDraggedDec.addTarget(I,f.TargetMatchMode.Self)}),_.dataTransfer){let I;T.length===1?I=S?S.displayName:typeof y.name=="string"?y.name:"":I=String(T.length);const R=document.createElement("div");R.className=r.default.file_tree_drag_image,R.textContent=I,document.body.appendChild(R),_.dataTransfer.setDragImage(R,-10,-10),setTimeout(()=>document.body.removeChild(R),0)}},this.handleDragEnter=(_,y)=>{_.stopPropagation(),_.preventDefault()},this.handleDragLeave=(_,y)=>{_.preventDefault(),_.stopPropagation(),this.toCancelNodeExpansion.dispose(),this.potentialParent&&(this.draggedOverDec.removeTarget(this.potentialParent),this.model.treeModel.dispatchChange())},this.handleDragOver=(_,y)=>{if(_.preventDefault(),_.stopPropagation(),!this.toCancelNodeExpansion.disposed||this.beingDraggedNodes.indexOf(y)>=0)return;this.draggedOverNode=y;const S=h.Directory.is(y)&&y.expanded?y:y.parent;(this.potentialParent!==S||!this.draggedOverDec.hasTarget(S))&&(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=S,this.draggedOverDec.addTarget(this.potentialParent,f.TargetMatchMode.SelfAndChildren),this.model.treeModel.dispatchChange()),this.potentialParent!==y&&h.Directory.is(y)&&(this.dragOverTrigger.trigger(async()=>{y.expanded?(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=y,this.draggedOverDec.addTarget(this.potentialParent,f.TargetMatchMode.SelfAndChildren)):(await y.setExpanded(!0),this.draggedOverNode===y&&(this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.potentialParent=y,this.draggedOverDec.addTarget(this.potentialParent,f.TargetMatchMode.SelfAndChildren))),this.model.treeModel.dispatchChange()}),this.toCancelNodeExpansion.push(b.Disposable.create(()=>{this.dragOverTrigger.isTriggered()||this.dragOverTrigger.cancel()})))},this.handleDrop=async(_,y,S)=>{var A;this.eventBus.fire(new g.FileTreeDropEvent({event:_.nativeEvent,targetDir:S?S.codeUri.path:y&&y instanceof h.File?(A=y.parent)===null||A===void 0?void 0:A.uri.codeUri.path:y?.uri.codeUri.path}));try{_.preventDefault(),_.stopPropagation(),_.dataTransfer.dropEffect="copy";let T;const D=!!this.beingDraggedActiveUri;this.fileTreeService.isCompactMode&&S&&!y?.uri.isEqual(S)?T=null:y?T=h.Directory.is(y)?y:y.parent:T=this.root;let w;if(this.beingDraggedActiveUri){const I=this.fileTreeService.getNodeByPathOrUri(this.beingDraggedActiveUri);w=[new h.Directory(this.fileTreeService,I?.parent,this.beingDraggedActiveUri,this.beingDraggedActiveUri.displayName,{uri:this.beingDraggedActiveUri.toString(),isDirectory:!0,lastModification:new Date().getTime()},this.beingDraggedActiveUri.displayName)]}else if(w=this.beingDraggedNodes,!w||w.length===0)try{const I=JSON.parse(_.dataTransfer.getData("beingDraggedNodes"));I&&I.length!==0&&(w=I.map(R=>this.fileTreeService.getNodeByPathOrUri(new b.URI(R))).filter(Boolean),w.length||(w=await Promise.all(I.map(async R=>{const M=new b.URI(R);let O;const P=await this.filesystem.getFileStat(M.toString());return P?.isDirectory?O=new h.Directory(this.fileTreeService,this.root,M,M.displayName,{uri:M.toString(),isDirectory:!0,lastModification:new Date().getTime()},M.displayName):O=new h.File(this.fileTreeService,this.root,M,M.displayName,{uri:M.toString(),isDirectory:!0,lastModification:new Date().getTime()},M.displayName),O}))))}catch{}if(w.length>0){const I=S||T&&T.uri,R=w.filter(M=>M&&M.parent&&(this.beingDraggedActiveUri?!M.parent.uri.isEqual(I):!0));if(R.length>0){const M=await this.fileTreeAPI.mvFiles(R.map(O=>({url:O.uri,isDirectory:O.filestat.isDirectory})),I);if(M&&M.length>0)M.forEach(O=>{this.messageService.error(O)});else if(M){if(T)if(this.fileTreeService.isCompactMode&&D){for(const O of R)this.fileTreeService.refresh(O.parent);this.fileTreeService.refresh(T)}else for(const O of R){const P=T.uri.resolve(O.name);this.fileTreeService.moveNodeByPath(O.parent,T,O.name,O.name,O.type),O.updateMetaData({name:P.displayName,fileStat:{...O.filestat,uri:P.toString()},uri:P,tooltip:this.fileTreeAPI.getReadableTooltip(P)}),h.Directory.is(O)&&this.fileTreeService.refresh(O)}else if(y){if(this.fileTreeService.isCompactMode&&D)for(const O of R)this.fileTreeService.refresh(O.parent);else for(const O of R)this.fileTreeService.deleteAffectedNodeByPath(O.path);this.fileTreeService.refresh(y.parent)}}else return}}y&&this.beingDraggedDec.removeTarget(y),this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.beingDraggedNodes.forEach(I=>{this.beingDraggedDec.removeTarget(I)}),this.beingDraggedNodes=[],this.beingDraggedActiveUri=void 0,this.potentialParent=null,this.model.treeModel.dispatchChange(),this.toCancelNodeExpansion.disposed||this.toCancelNodeExpansion.dispose()}catch(T){this.logger.error(T)}},this.handleDragEnd=(_,y)=>{this.beingDraggedDec.removeTarget(y),this.potentialParent&&this.draggedOverDec.removeTarget(this.potentialParent),this.beingDraggedNodes.forEach(S=>{this.beingDraggedDec.removeTarget(S)}),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}};e.DragAndDropService=d,d.MS_TILL_DRAGGED_OVER_EXPANDS=500,s.__decorate([(0,o.Autowired)(u.IFileTreeAPI),s.__metadata("design:type",Object)],d.prototype,"fileTreeAPI",void 0),s.__decorate([(0,o.Autowired)(b.ILogger),s.__metadata("design:type",Object)],d.prototype,"logger",void 0),s.__decorate([(0,o.Autowired)(E.IMessageService),s.__metadata("design:type",Object)],d.prototype,"messageService",void 0),s.__decorate([(0,o.Autowired)(u.IFileTreeService),s.__metadata("design:type",l.FileTreeService)],d.prototype,"fileTreeService",void 0),s.__decorate([(0,o.Autowired)(v.IFileServiceClient),s.__metadata("design:type",Object)],d.prototype,"filesystem",void 0),e.DragAndDropService=d=n=s.__decorate([(0,o.Injectable)(),s.__param(0,(0,o.Optional)()),s.__metadata("design:paramtypes",[a.FileTreeModelService])],d)},97738:(x,e,t)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.FileTreeModelService=void 0;const s=t(85608),o=t(76003),f=t(97267),b=t(41869),g=t(91830),v=t(93899),E=t(26542),u=t(54414),h=t(14951),c=t(63067),r=t(53576),l=t(72665),a=t(6250),d=t(69959),p=t(2812),m=t(46377),_=s.__importDefault(t(89200)),y=t(57781),S=t(30577),{Path:A,isValidBasename:T}=b.path,{coalesce:D}=b.arrays,{trim:w,rtrim:I}=b.strings;let R=n=class{constructor(){this._isDisposed=!1,this._whenReady=new b.Deferred,this.selectedDecoration=new f.Decoration(_.default.mod_selected),this.focusedDecoration=new f.Decoration(_.default.mod_focused),this.contextMenuDecoration=new f.Decoration(_.default.mod_actived),this.loadingDecoration=new f.Decoration(_.default.mod_loading),this.cutDecoration=new f.Decoration(_.default.mod_cut),this._selectedFiles=[],this.disposableCollection=new b.DisposableCollection,this._isMultiSelected=!1,this.refreshedActionDelayer=new b.ThrottledDelayer(n.DEFAULT_REFRESHED_ACTION_DELAY),this.labelChangedDelayer=new b.ThrottledDelayer(n.DEFAULT_LABEL_CHANGED_DELAY),this.locationThrottler=new b.Throttler,this.onDidFocusedFileChangeEmitter=new b.Emitter,this.onDidContextMenuFileChangeEmitter=new b.Emitter,this.onDidSelectedFileChangeEmitter=new b.Emitter,this.onFileTreeModelChangeEmitter=new b.Emitter,this._initTreeModelReady=!1,this.clearFileSelectedDecoration=()=>{this.selectedDecoration.clearAppliedTarget(),this._selectedFiles=[]},this.activeFileDecoration=(O,P=!0)=>{this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),O&&(this.selectedFiles.length>0&&this.selectedDecoration.clearAppliedTarget(),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.selectedDecoration.addTarget(O),this.focusedDecoration.addTarget(O),this.focusedFile=O,this.selectedFiles=[O],P&&this.treeModel.dispatchChange())},this.selectFileDecoration=(O,P=!0)=>{O!==this.treeModel.root&&(this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),O&&(this.selectedFiles.length>0&&this.selectedDecoration.clearAppliedTarget(),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.selectedDecoration.addTarget(O),this._selectedFiles=[O],P&&this.treeModel.dispatchChange()))},this.activateFileActivedDecoration=O=>{this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),this.focusedFile&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this.contextMenuDecoration.addTarget(O),this.contextMenuFile=O,this.treeModel.dispatchChange()},this.activateFileFocusedDecoration=O=>{this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.contextMenuFile&&(this.contextMenuDecoration.clearAppliedTarget(),this.contextMenuFile=void 0),this.focusedDecoration.addTarget(O),this.focusedFile=O,this.treeModel.dispatchChange()},this.activeFileFocusedDecoration=(O,P=!1)=>{O!==this.treeModel.root&&(this.focusedFile!==O&&(P?(this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.contextMenuFile=O):this.focusedFile&&(this.contextMenuFile=void 0,this.focusedDecoration.clearAppliedTarget()),O&&(this._selectedFiles.indexOf(O)<0&&(this.selectedDecoration.addTarget(O),this._selectedFiles.push(O),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(L=>L.uri))),this.focusedDecoration.addTarget(O),this.focusedFile=O)),this.treeModel.dispatchChange())},this.toggleFileSelectedDecoration=O=>{const P=this._selectedFiles.indexOf(O);P>-1?(this.focusedFile===O&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this._selectedFiles.splice(P,1),this.selectedDecoration.clearAppliedTarget()):(this._selectedFiles.push(O),this.selectedDecoration.addTarget(O),this.focusedFile&&this.focusedDecoration.clearAppliedTarget(),this.focusedFile=O,this.focusedDecoration.addTarget(O)),this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(L=>L.uri)),this.treeModel.dispatchChange()},this.activeFileDecorationByRange=(O,P)=>{for(this.clearFileSelectedDecoration(),this.contextMenuFile=void 0;O<=P;O++){const L=this.treeModel.root.getTreeNodeAtIndex(O);L&&(this._selectedFiles.push(L),this.selectedDecoration.addTarget(L))}this.onDidSelectedFileChangeEmitter.fire(this._selectedFiles.map(L=>L.uri)),this.treeModel.dispatchChange()},this.deactivateFileDecoration=()=>{var O;this.focusedFile&&(this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0),this.contextMenuFile&&this.contextMenuDecoration.removeTarget(this.contextMenuFile),(O=this.treeModel)===null||O===void 0||O.dispatchChange()},this.toggleDirectory=async O=>{O.expanded?this.fileTreeHandle.collapseNode(O):this.fileTreeHandle.expandNode(O)},this.handleDblClick=()=>{this.commandService.executeCommand(b.FILE_COMMANDS.NEW_FILE.id)},this.handleContextMenu=(O,P,L)=>{var N;O.stopPropagation(),O.preventDefault();let k,B;P?(B=P,this._isMultiSelected?this.selectedFiles.indexOf(B)>=0?k=this.selectedFiles:k=[B]:k=[B]):(k=[this.treeModel.root],B=this.treeModel.root),this.activateFileActivedDecoration(B),this.setFileTreeContextKey(B),this.fileTreeService.isCompactMode&&L?(this._activeUri=L,(N=this.contextKey)===null||N===void 0||N.explorerResourceIsFolder.set(!0)):L||(this._activeUri=null);const F=this.contextMenuService.createMenu({id:v.MenuId.ExplorerContext,contextKeyService:this.fileTreeService.contextMenuContextKeyService}),U=F.getMergedMenuNodes();F.dispose(),this.updateExplorerCompressedContextKey(B,L);const{x:V,y:H}=O.nativeEvent;this.ctxMenuRenderer.show({anchor:{x:V,y:H},menuNodes:U,args:L?[L,[L]]:[B.uri,k.map(G=>G.uri)]})},this.handleTreeBlur=()=>{var O,P,L;this._isDisposed||((P=(O=this.contextKey)===null||O===void 0?void 0:O.filesExplorerFocused)===null||P===void 0||P.set(!1),this.deactivateFileDecoration(),(L=this.contextKey)===null||L===void 0||L.explorerResourceIsFolder.set(!1))},this.handleTreeFocus=()=>{var O,P;(P=(O=this.contextKey)===null||O===void 0?void 0:O.filesExplorerFocused)===null||P===void 0||P.set(!0)},this.handleItemRangeClick=(O,P)=>{if(!this.focusedFile)this.handleItemClick(O,P);else if(this.focusedFile&&this.focusedFile!==O){this._isMultiSelected=!0;const L=this.treeModel.root.getIndexAtTreeNode(O),N=this.treeModel.root.getIndexAtTreeNode(this.focusedFile);N>L?this.activeFileDecorationByRange(L,N):N<L&&this.activeFileDecorationByRange(N,L)}},this.handleItemToggleClick=(O,P)=>{this._isMultiSelected=!0,!(P!==f.TreeNodeType.CompositeTreeNode&&P!==f.TreeNodeType.TreeNode)&&this.toggleFileSelectedDecoration(O)},this.handleItemClick=(O,P=this.fileTreeService.isMultipleWorkspace?f.TreeNodeType.TreeNode:f.TreeNodeType.CompositeTreeNode,L)=>{var N,k,B,F;if(this.treeModel&&(O||(O=this.treeModel.root),this.updateExplorerCompressedContextKey(O,L),this._isMultiSelected=!1,(P===f.TreeNodeType.CompositeTreeNode||P===f.TreeNodeType.TreeNode)&&this.activeFileDecoration(O),this.fileTreeService.isCompactMode&&L?(this._activeUri=L,(N=this.contextKey)===null||N===void 0||N.explorerResourceIsFolder.set(!0)):L||(this._activeUri=null,(k=this.contextKey)===null||k===void 0||k.explorerResourceIsFolder.set(P===f.TreeNodeType.CompositeTreeNode)),this.corePreferences["workbench.list.openMode"]==="singleClick")){if(P===f.TreeNodeType.CompositeTreeNode){if((B=this.contextKey)===null||B===void 0||B.explorerResourceIsFolder.set(!0),O===this.treeModel.root)return;this.toggleDirectory(O)}else if(P===f.TreeNodeType.TreeNode){if((F=this.contextKey)===null||F===void 0||F.explorerResourceIsFolder.set(!1),O===this.treeModel.root)return;this.fileTreeService.openFile(O.uri),this.mainlayoutService.bottomExpanded&&this.commandService.executeCommand(r.RETRACT_BOTTOM_PANEL.id)}}},this.handleItemDoubleClick=(O,P)=>{P===f.TreeNodeType.TreeNode?this.fileTreeService.openAndFixedFile(O.uri):this.corePreferences["workbench.list.openMode"]==="doubleClick"&&this.toggleDirectory(O)},this.validateFileName=(O,P)=>{var L;if(P=this.getWellFormedFileName(P),!P||P.length===0||/^\s+$/.test(P))return{message:(0,b.localize)("validate.tree.emptyFileNameError"),type:f.PROMPT_VALIDATE_TYPE.ERROR,value:P};if(P[0]==="/"||P[0]==="\\")return{message:(0,b.localize)("validate.tree.fileNameStartsWithSlashError"),type:f.PROMPT_VALIDATE_TYPE.ERROR,value:P};if(P[0]===" "||P[P.length-1]===" ")return{message:(0,b.localize)("validate.tree.fileNameFollowOrStartWithSpaceWarning"),type:f.PROMPT_VALIDATE_TYPE.WARNING,value:P};let N;if(O.target){const B=O.target;if(P===B.name)return null;N=B.parent}else N=O.parent;return N&&!(O instanceof f.RenamePromptHandle&&O.target.displayName.indexOf(A.separator)>0)&&((L=N.children)===null||L===void 0?void 0:L.find(U=>U.name===P))?{message:(0,b.formatLocalize)("validate.tree.fileNameExistsError",P),type:f.PROMPT_VALIDATE_TYPE.ERROR,value:P}:D(P.split(/[\\/]/)).some(B=>!T(B))?{message:(0,b.formatLocalize)("validate.tree.invalidFileNameError",this.trimLongName(P)),type:f.PROMPT_VALIDATE_TYPE.ERROR,value:P}:null},this.proxyPrompt=O=>{let P=!1;const L=async G=>{const K=await this.fileTreeService.getNodeByPathOrUri(G);K&&(d.Directory.is(K)?this.selectFileDecoration(K):this.location(K.uri))},N=async G=>{var K,z,j;if(this.validateMessage=void 0,O instanceof f.RenamePromptHandle){const W=O.target,$=O.target.displayName.split(A.separator),Y=W.name.indexOf(A.separator)>0;if(Y&&this.activeUri&&!O.target.uri.toString().includes(this.activeUri.toString()))return!1;const Q=this.activeUri?$.length-O.target.uri.toString().replace(this.activeUri.toString(),"").split(A.separator).length:-1,te=Q===-1?[]:$.slice(0,Q).concat(G);let re=W.uri,ae=W.parent.uri.resolve(G);if(Y&&((K=this.activeUri)===null||K===void 0?void 0:K.displayName)===G||!Y&&G===W.name)return!0;O.addAddonAfter("loading_indicator"),Y&&te.length>0&&d.Directory.is(W.parent)&&(re=W.parent.uri.resolve($.slice(0,Q+1).join(A.separator)),ae=W.parent.uri.resolve(te.concat().join(A.separator)));const ce=await this.fileTreeAPI.mv(re,ae,W.type===f.TreeNodeType.CompositeTreeNode);if(ce)return this.validateMessage={type:f.PROMPT_VALIDATE_TYPE.ERROR,message:ce,value:G},this.fileTreeService.updateRefreshable(!0),O.addValidateMessage(this.validateMessage),!1;if(this.fileTreeService.updateRefreshable(!1),O.removeAddonAfter(),!Y&&W.parent){const q=await this.fileTreeService.moveNodeByPath(W.parent,W.parent,W.name,G,W.type);q&&this.selectFileDecoration(q,!1),this.fileTreeService.updateRefreshable(!0)}else if(d.Directory.is(W)&&!d.Directory.isRoot(W)){W.updateMetaData({name:te.concat($.slice(Q+1)).join(A.separator),uri:ae,fileStat:{...W.filestat,uri:ae.toString()},tooltip:this.fileTreeAPI.getReadableTooltip(ae)}),this.treeModel.dispatchChange();let q;d.Directory.is(W.parent)&&(!((z=W.parent.children)===null||z===void 0)&&z.find(_e=>W.path.indexOf(_e.path)>=0))?q=this.fileTreeService.refresh(W.parent):q=this.fileTreeService.refresh(W),q.then(()=>{L(ae)})}O.removeAddonAfter()}else if(O instanceof f.NewPromptHandle){const W=O.parent,$=W.uri.resolve(G);let Y;if(O.addAddonAfter("loading_indicator"),this.fileTreeService.updateRefreshable(!0),O.type===f.TreeNodeType.CompositeTreeNode?Y=await this.fileTreeAPI.createDirectory($):Y=await this.fileTreeAPI.createFile($),O.removeAddonAfter(),Y)return this.validateMessage={type:f.PROMPT_VALIDATE_TYPE.ERROR,message:Y,value:G},this.fileTreeService.updateRefreshable(!1),O.addValidateMessage(this.validateMessage),!1;if(G.includes(A.separator)&&this.fileTreeService.refresh(W).then(()=>{L(W.uri.resolve(G))}),this.fileTreeService.isCompactMode)if(O.type===f.TreeNodeType.CompositeTreeNode)if((!W.children||W.children.length===0)&&!d.Directory.isRoot(W)){const te=W.uri.resolve(G),re=[W.name].concat(G).join(A.separator);W.updateMetaData({name:re,uri:te,fileStat:{...W.filestat,uri:te.toString()},tooltip:this.fileTreeAPI.getReadableTooltip(te)}),L(te)}else await this.fileTreeService.addNode(W,G,O.type),L(W.uri.resolve(G));else await this.fileTreeService.addNode(W,G,O.type),L(W.uri.resolve(G));else await this.fileTreeService.addNode(W,G,O.type),L(W.uri.resolve(G))}return(j=this.contextKey)===null||j===void 0||j.filesExplorerInputFocused.set(!1),!0},k=async G=>{var K,z,j,W;if(this.validateMessage&&this.validateMessage.type===f.PROMPT_VALIDATE_TYPE.ERROR)return this.validateMessage=void 0,!0;if(P)return!1;if(!G){(K=this.contextKey)===null||K===void 0||K.explorerCompressedFocusContext.set(!1),(z=this.contextKey)===null||z===void 0||z.explorerCompressedFirstFocusContext.set(!1),(j=this.contextKey)===null||j===void 0||j.explorerCompressedLastFocusContext.set(!1),this.fileTreeService.isCompactMode&&O instanceof f.NewPromptHandle&&this.fileTreeService.refresh(O.parent);return}return(W=this.contextKey)===null||W===void 0||W.filesExplorerInputFocused.set(!1),await N(G),!0},B=async G=>{if(P=!0,this.validateMessage&&this.validateMessage.type===f.PROMPT_VALIDATE_TYPE.ERROR)return!1;if(G.trim()===""||this.validateMessage&&this.validateMessage.type!==f.PROMPT_VALIDATE_TYPE.ERROR)return this.validateMessage=void 0,!0;const K=await N(G);return P=!1,!!K},F=async()=>{var G;(G=this.contextKey)===null||G===void 0||G.filesExplorerInputFocused.set(!0)},U=()=>{var G;this.fileTreeService.updateRefreshable(!0),(G=this.contextKey)===null||G===void 0||G.filesExplorerInputFocused.set(!1),this.contextMenuFile&&this.selectFileDecoration(this.contextMenuFile,!0)},V=()=>{var G;(G=this.contextKey)===null||G===void 0||G.filesExplorerInputFocused.set(!1),this.fileTreeService.isCompactMode&&O instanceof f.NewPromptHandle&&this.fileTreeService.refresh(O.parent)},H=G=>{const K=this.validateFileName(O,G);K?(this.validateMessage=K,O.addValidateMessage(K)):!K&&this.validateMessage&&this.validateMessage.value!==G&&(this.validateMessage=void 0,O.removeValidateMessage())};O.destroyed||(this.fileTreeService.updateRefreshable(!1),O.onChange(H),O.onCommit(B),O.onBlur(k),O.onFocus(F),O.onDestroy(U),O.onCancel(V))},this.copyFile=async O=>{var P;this.pasteStore&&this.pasteStore.type===a.PasteTypes.CUT&&(this._pasteStore.files.forEach(N=>{N&&this.cutDecoration.removeTarget(N)}),(P=this.contextKey)===null||P===void 0||P.explorerResourceCut.set(!1)),this.treeModel.dispatchChange();const L=[];for(const N of O){const k=this.fileTreeService.getNodeByPathOrUri(N);k&&L.push(k)}this._pasteStore={files:L,type:a.PasteTypes.COPY},this.clipboardService.writeResources(O)},this.pasteFile=async O=>{var P,L;let N=!1,k=this.fileTreeService.getNodeByPathOrUri(O.toString());if(!k)return;let B=this.pasteStore,F=!1;if(!B){const U=await this.clipboardService.readResources();if(!U||!U.length)return;B={files:[],type:a.PasteTypes.COPY,crossFiles:U},F=!0}if(B){if(d.Directory.is(k)||(N=!0,k=k.parent),F){const U=(0,b.localize)("file.confirm.paste.ok"),V=(0,b.localize)("file.confirm.paste.cancel");if(await this.dialogService.warning((0,b.formatLocalize)("file.confirm.paste",`[ ${(P=B.crossFiles)===null||P===void 0?void 0:P.map(G=>G.displayName).join(",")} ]`,d.Directory.isRoot(k)?k.uri.displayName:k.displayName),[V,U])!==U)return}if(B.type===a.PasteTypes.CUT){for(const V of B.files)V&&this.cutDecoration.removeTarget(V),k.expanded||await k.setExpanded(!0);const U=await this.fileTreeAPI.mvFiles(B.crossFiles?B.crossFiles.map(V=>{var H;return{url:V,isDirectory:((H=this.fileTreeService.getNodeByPathOrUri(V))===null||H===void 0?void 0:H.filestat.isDirectory)||!1}}):B.files.map(V=>({url:V.uri,isDirectory:V.filestat.isDirectory})),k.uri);U&&U.length>0&&(U.forEach(V=>{this.messageService.error(V)}),this.fileTreeService.refresh()),(L=this.contextKey)===null||L===void 0||L.explorerResourceCut.set(!1),this.treeModel.dispatchChange(),this._pasteStore={files:[],type:a.PasteTypes.NONE,crossFiles:void 0}}else if(B.type===a.PasteTypes.COPY){const U=B.crossFiles?B.crossFiles:B.files.map(V=>V.uri);for(const V of U){k.uri.isEqual(V)&&!N&&(k=k.parent);const H=k.uri.resolve(V.displayName);k.expanded||await k.setExpanded(!0);const G=await this.fileTreeAPI.copyFile(V,H);if(G)if(G.uri){const K=new b.URI(G.uri),z=await this.filesystem.getFileStat(V.toString());this.fileTreeService.addNode(k,K.displayName,z?.isDirectory?f.TreeNodeType.CompositeTreeNode:f.TreeNodeType.TreeNode)}else this.messageService.error(`Error when copy file: ${V.toString()}, ${G}`)}}}},this.cutFile=async O=>{var P;O.length>0&&((P=this.contextKey)===null||P===void 0||P.explorerResourceCut.set(!0)),this._pasteStore&&this._pasteStore.type===a.PasteTypes.CUT&&this._pasteStore.files.forEach(N=>{this.cutDecoration.removeTarget(N)});const L=[];for(const N of O){const k=this.fileTreeService.getNodeByPathOrUri(N);k&&L.push(k)}this._pasteStore={files:L,type:a.PasteTypes.CUT};for(const N of L)N&&this.cutDecoration.addTarget(N);this.treeModel.dispatchChange()},this.location=async O=>{if(await this.whenReady,!this.fileTreeService.filterMode)return this._fileToLocation=O,this.locationThrottler.queue(this.doLocation)},this.doLocation=async()=>{if(!this._fileToLocation)return;const O=this._fileToLocation;let P;if(typeof O=="string"?P=O:P=await this.fileTreeService.getFileTreeNodePathByUri(O),P){if(!this.fileTreeHandle)return;const L=await this.fileTreeHandle.ensureVisible(P,"center",!0);L&&this.selectFileDecoration(L)}this._fileToLocation=void 0},this.locationOnShow=O=>{this._nextLocationTarget=O},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(O){this.onDidFocusedFileChangeEmitter.fire(O?O.uri:void 0),this._focusedFile=O}get contextMenuFile(){return this._contextMenuFile}set contextMenuFile(O){this.onDidContextMenuFileChangeEmitter.fire(O?O.uri:void 0),this._contextMenuFile=O}get selectedFiles(){return this._selectedFiles}set selectedFiles(O){this.onDidSelectedFileChangeEmitter.fire(O?O.map(P=>P.uri):[]),this._selectedFiles=O}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 g.ResourceContextKey(this.fileTreeService.contextMenuContextKeyService)),this._contextMenuResourceContext}get contextKey(){return this.fileTreeService.contextKey}get initTreeModelReady(){return this._initTreeModelReady}async initTreeModel(){this._initTreeModelReady=!1;const O=(await this.fileTreeService.resolveChildren())[0];if(!O){this._whenReady.resolve();return}this._treeModel=this.injector.get(p.FileTreeModel,[O]),this.initDecorations(O),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 L=this.editorService.currentEditor;L&&L.currentUri&&this.location(L.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(f.TreeNodeEvent.WillResolveChildren,L=>{this.loadingDecoration.addTarget(L),this.treeModel.dispatchChange()})),this.disposableCollection.push(this.treeModel.root.watcher.on(f.TreeNodeEvent.DidResolveChildren,L=>{this.loadingDecoration.clearAppliedTarget(),this.treeModel.dispatchChange()})),this._explorerStorage=await this.storageProvider(b.STORAGE_NAMESPACE.EXPLORER);const P=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY);P&&await this.loadFileTreeSnapshot(P),this.disposableCollection.push(this.treeStateWatcher.onDidChange(()=>{if(!this._initTreeModelReady)return;const L=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),N=this.treeStateWatcher.snapshot();this.explorerStorage.set(n.FILE_TREE_SNAPSHOT_KEY,{...L,...N})})),this.fileTreeService.startWatchFileEvent(),this.onFileTreeModelChangeEmitter.fire(this._treeModel),this._whenReady.resolve(),this._initTreeModelReady=!0}initDecorations(O){this._decorations=new f.DecorationsManager(O),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(O){var P;this.currentContextUriContextKey.set(O.uri.toString()),this.currentRelativeUriContextKey.set((this.treeModel.root.uri.relative(O.uri)||"").toString()),this.contextMenuResourceContext.set(O.uri),(P=this.contextKey)===null||P===void 0||P.explorerResourceIsFolder.set(O&&O.type===f.TreeNodeType.CompositeTreeNode)}async loadFileTreeSnapshot(O){await this._treeModel.loadTreeState(O)}updateExplorerCompressedContextKey(O,P){var L,N,k,B,F,U,V,H,G,K,z,j,W,$,Y,Q;if(O&&P){(L=this.contextKey)===null||L===void 0||L.explorerCompressedFocusContext.set(!0);const te=new A(O.name);te.name===P.displayName?((N=this.contextKey)===null||N===void 0||N.explorerCompressedLastFocusContext.set(!0),(k=this.contextKey)===null||k===void 0||k.explorerCompressedFirstFocusContext.set(!1)):te.root&&te.root.name===P.displayName?((B=this.contextKey)===null||B===void 0||B.explorerCompressedLastFocusContext.set(!1),(F=this.contextKey)===null||F===void 0||F.explorerCompressedFirstFocusContext.set(!0)):((U=this.contextKey)===null||U===void 0||U.explorerCompressedLastFocusContext.set(!1),(V=this.contextKey)===null||V===void 0||V.explorerCompressedFirstFocusContext.set(!1))}else O?O.name.indexOf(A.separator)>0?((H=this.contextKey)===null||H===void 0||H.explorerCompressedFocusContext.set(!0),(G=this.contextKey)===null||G===void 0||G.explorerCompressedFirstFocusContext.set(!1),(K=this.contextKey)===null||K===void 0||K.explorerCompressedLastFocusContext.set(!0)):((z=this.contextKey)===null||z===void 0||z.explorerCompressedFocusContext.set(!1),(j=this.contextKey)===null||j===void 0||j.explorerCompressedFirstFocusContext.set(!1),(W=this.contextKey)===null||W===void 0||W.explorerCompressedLastFocusContext.set(!1)):(($=this.contextKey)===null||$===void 0||$.explorerCompressedFocusContext.set(!1),(Y=this.contextKey)===null||Y===void 0||Y.explorerCompressedFirstFocusContext.set(!1),(Q=this.contextKey)===null||Q===void 0||Q.explorerCompressedLastFocusContext.set(!1))}handleTreeHandler(O){this._fileTreeHandle=O}toggleOrOpenCurrentFile(){let O;this.focusedFile?O=this.focusedFile:this.contextMenuFile&&(O=this.contextMenuFile),O&&(this.activeFileDecoration(O),d.Directory.is(O)?this.toggleDirectory(O):this.fileTreeService.openFile(O.uri))}moveToNext(){let O;if(this.focusedFile?O=this.focusedFile:this.contextMenuFile&&(O=this.contextMenuFile),!O)return;const L=this.treeModel.root.getIndexAtTreeNode(O)+1,N=this.treeModel.root.getTreeNodeAtIndex(L),k=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),B=(L+1)*m.FILE_TREE_NODE_HEIGHT-(k.scrollPosition||0),{height:F}=this.fileTreeHandle.getCurrentSize();N&&(this.activateFileFocusedDecoration(N),B>F&&this.fileTreeHandle.ensureVisible(N,"end"))}moveToPrev(){let O;if(this.focusedFile?O=this.focusedFile:this.contextMenuFile&&(O=this.contextMenuFile),!O)return;const P=this.treeModel.root.getIndexAtTreeNode(O);if(P===0)return;const L=P-1,N=this.treeModel.root.getTreeNodeAtIndex(L);if(!N)return;const k=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY),B=L*m.FILE_TREE_NODE_HEIGHT;this.activateFileFocusedDecoration(N),(k.scrollPosition||0)>B&&this.fileTreeHandle.ensureVisible(N,"start")}async collapseCurrentFile(){let O;this.focusedFile?(O=this.focusedFile,this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0):this.contextMenuFile&&(O=this.contextMenuFile,this.focusedDecoration.removeTarget(this.contextMenuFile),this.contextMenuFile=void 0);const P=this.selectedFiles.indexOf(O);P>=0&&(this.selectedFiles.splice(P,1),this.selectedDecoration.removeTarget(O));let L;if(d.Directory.is(O)&&O.expanded)L=O;else if(O)d.Directory.isRoot(O.parent)?L=O:L=O.parent;else return;this.focusedFile=L,L&&L.expanded&&(await this.fileTreeHandle.collapseNode(L),this.activeFileFocusedDecoration(L,!0))}async expandCurrentFile(){let O;this.focusedFile?(O=this.focusedFile,this.focusedDecoration.clearAppliedTarget(),this.focusedFile=void 0):this.contextMenuFile&&(O=this.contextMenuFile,this.focusedDecoration.removeTarget(this.contextMenuFile),this.contextMenuFile=void 0);const P=this.selectedFiles.indexOf(O);P>=0&&(this.selectedFiles.splice(P,1),this.selectedDecoration.removeTarget(O)),this.focusedFile=O,d.Directory.is(O)&&(O.expanded||await this.fileTreeHandle.expandNode(O))}async collapseAll(){await this.treeModel.root.collapsedAll();const O=this.explorerStorage.get(n.FILE_TREE_SNAPSHOT_KEY);O&&this.explorerStorage.set(n.FILE_TREE_SNAPSHOT_KEY,{...O,expandedDirectories:{atSurface:[],buried:[]}})}async deleteFileByUris(O){var P;if(O.length===0)return;if(this.corePreferences["explorer.confirmDelete"]){const B=(0,b.localize)("file.confirm.delete.ok"),F=(0,b.localize)("file.confirm.delete.cancel"),U=`[ ${O.slice(0,5).map(H=>H.displayName).join(",")}${O.length>5?" ...":""} ]`;if(await this.dialogService.warning((0,b.formatLocalize)("file.confirm.delete",U),[F,B])!==B)return}const L=this.fileTreeService.sortPaths(O);let N;if(this.treeModel.root.branchSize===O.length)N=void 0;else if(this.selectedFiles.length&&!L.find(B=>B.path.toString()===this.selectedFiles[0].uri.toString()))N=this.selectedFiles[0];else{const B=(P=L[L.length-1])===null||P===void 0?void 0:P.node;if(!B)N=void 0;else{let U=this.treeModel.root.getIndexAtTreeNode(B)+1;if(U>=this.treeModel.root.branchSize){const V=L[0].node;U=this.treeModel.root.getIndexAtTreeNode(V)-1}N=this.treeModel.root.getTreeNodeAtIndex(U)}}const k=[];L.forEach(B=>{this.loadingDecoration.addTarget(B.node),k.push(this.deleteFile(B.node,B.path).then(F=>(this.loadingDecoration.removeTarget(B.node),F)))}),this.treeModel.dispatchChange(),await Promise.all(k),N&&this.activeFileDecoration(N)}async deleteFile(O,P){const L=typeof P=="string"?new b.URI(P):P,N=await this.fileTreeAPI.delete(L);return N?(this.messageService.error(N),!1):((B=>{var F,U,V;B.uri.isEqual(L)?this.fileTreeService.deleteAffectedNodeByPath(B.path):this.fileTreeService.refresh(O.parent),this.loadingDecoration.removeTarget(B),(F=this.contextKey)===null||F===void 0||F.explorerCompressedFocusContext.set(!1),(U=this.contextKey)===null||U===void 0||U.explorerCompressedFirstFocusContext.set(!1),(V=this.contextKey)===null||V===void 0||V.explorerCompressedLastFocusContext.set(!1)})(O),!0)}getWellFormedFileName(O){return O&&(O=w(O," "),O=I(O,"."),O=I(O,"/"),O=I(O,"\\"),O)}trimLongName(O){return O&&O.length>255?`${O.substr(0,255)}...`:O}async getPromptTarget(O,P){let L;if(O.isEqual(this.treeModel.root.uri))L=await this.fileTreeService.getNodeByPathOrUri(O);else if(this.focusedFile)L=this.focusedFile;else if(this.contextMenuFile)L=this.contextMenuFile;else if(this.selectedFiles.length>0){const k=this.selectedFiles[this.selectedFiles.length-1];if(this.treeModel.root.isItemVisibleAtSurface(k))L=k;else{const B=await this.fileTreeService.getFileTreeNodePathByUri(O);L=await this.treeModel.root.loadTreeNodeByPath(B)}}else L=await this.fileTreeService.getNodeByPathOrUri(O);L||(L=this.treeModel.root);const N=A.splitPath(L.name);if(d.Directory.isRoot(L))return L;if(L.name!==O.displayName&&N[N.length-1]!==O.displayName&&P){const k=O.relative(L.uri).toString(),B=L.name.replace(`${A.separator}${k}`,""),F=L.parent.uri.resolve(B),U=k.split(A.separator)[0];if(!B)return;if(L.children)for(const V of L.children)this.fileTreeService.deleteAffectedNodeByPath(V.path,!0);L.updateMetaData({name:B?.toString(),uri:F,tooltip:this.fileTreeAPI.getReadableTooltip(F),fileStat:{...L.filestat,uri:F.toString()}}),this.fileTreeService.addNode(L,U,f.TreeNodeType.CompositeTreeNode)}return L}async newFilePrompt(O){const P=await this.getPromptTarget(O,!0);P&&this.proxyPrompt(await this.fileTreeHandle.promptNewTreeNode(P))}async newDirectoryPrompt(O){const P=await this.getPromptTarget(O,!0);P&&this.proxyPrompt(await this.fileTreeHandle.promptNewCompositeTreeNode(P))}async renamePrompt(O){const P=await this.getPromptTarget(O);P&&this.proxyPrompt(await this.fileTreeHandle.promptRename(P,O.displayName))}selectChildNode(O){var P;for(const L of O){const N=this.fileTreeService.getNodeByPathOrUri(L);if(N){const k=d.Directory.isRoot(N)?N.children:(P=N.parent)===null||P===void 0?void 0:P.children;if(k){const B=k[0],F=k[k.length-1],U=this.treeModel.root.getIndexAtTreeNode(B),V=this.treeModel.root.getIndexAtTreeNode(F);this.activeFileDecorationByRange(U,V)}}}}dispose(){this._isDisposed=!0}};e.FileTreeModelService=R,R.FILE_TREE_SNAPSHOT_KEY="FILE_TREE_SNAPSHOT",R.DEFAULT_REFRESHED_ACTION_DELAY=500,R.DEFAULT_LOCATION_FLUSH_DELAY=200,R.DEFAULT_LABEL_CHANGED_DELAY=500,s.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),s.__metadata("design:type",o.Injector)],R.prototype,"injector",void 0),s.__decorate([(0,o.Autowired)(a.IFileTreeService),s.__metadata("design:type",y.FileTreeService)],R.prototype,"fileTreeService",void 0),s.__decorate([(0,o.Autowired)(b.CorePreferences),s.__metadata("design:type",Object)],R.prototype,"corePreferences",void 0),s.__decorate([(0,o.Autowired)(v.ICtxMenuRenderer),s.__metadata("design:type",v.ICtxMenuRenderer)],R.prototype,"ctxMenuRenderer",void 0),s.__decorate([(0,o.Autowired)(v.AbstractContextMenuService),s.__metadata("design:type",v.AbstractContextMenuService)],R.prototype,"contextMenuService",void 0),s.__decorate([(0,o.Autowired)(a.IFileTreeAPI),s.__metadata("design:type",Object)],R.prototype,"fileTreeAPI",void 0),s.__decorate([(0,o.Autowired)(h.IFileServiceClient),s.__metadata("design:type",Object)],R.prototype,"filesystem",void 0),s.__decorate([(0,o.Autowired)(b.StorageProvider),s.__metadata("design:type",Function)],R.prototype,"storageProvider",void 0),s.__decorate([(0,o.Autowired)(l.IDialogService),s.__metadata("design:type",Object)],R.prototype,"dialogService",void 0),s.__decorate([(0,o.Autowired)(E.LabelService),s.__metadata("design:type",E.LabelService)],R.prototype,"labelService",void 0),s.__decorate([(0,o.Autowired)(l.IMessageService),s.__metadata("design:type",Object)],R.prototype,"messageService",void 0),s.__decorate([(0,o.Autowired)(u.WorkbenchEditorService),s.__metadata("design:type",u.WorkbenchEditorService)],R.prototype,"editorService",void 0),s.__decorate([(0,o.Autowired)(b.CommandService),s.__metadata("design:type",Object)],R.prototype,"commandService",void 0),s.__decorate([(0,o.Autowired)(c.IMainLayoutService),s.__metadata("design:type",Object)],R.prototype,"mainlayoutService",void 0),s.__decorate([(0,o.Autowired)(b.IClipboardService),s.__metadata("design:type",Object)],R.prototype,"clipboardService",void 0),e.FileTreeModelService=R=n=s.__decorate([(0,o.Injectable)()],R)},4446:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SymlinkDecorationsProvider=void 0;const n=t(85608),s=t(76003),o=t(41869),f=t(57781);let b=class{constructor(v){this.fileTreeService=v,this.label="symbollink",this.onDidChangeEmitter=new o.Emitter}get onDidChange(){return this.onDidChangeEmitter.event}provideDecorations(v){const E=this.fileTreeService.getNodeByPathOrUri(v.toString());if(E&&E.filestat&&E.filestat.isSymbolicLink)return{letter:"\u2937",source:E.filestat.uri,color:"gitDecoration.ignoredResourceForeground",tooltip:(0,o.localize)("file.tooltip.symbolicLink"),weight:-1,bubble:!E.filestat.isDirectory}}};e.SymlinkDecorationsProvider=b,e.SymlinkDecorationsProvider=b=n.__decorate([n.__param(0,(0,s.Optional)()),n.__metadata("design:paramtypes",[f.FileTreeService])],b)},69959:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.File=e.Directory=void 0;const n=t(97267),s=t(41869);class o extends n.CompositeTreeNode{static is(g){return n.CompositeTreeNode.is(g)}constructor(g,v,E=new s.URI(""),u="",h={children:[],isDirectory:!0,uri:"",lastModification:0},c){super(g,v,void 0,{name:u}),this.uri=E,this.filestat=h,this.tooltip=c,v||(this.isExpanded=!0)}get displayName(){return this.name}updateName(g){this.name!==g&&(n.TreeNode.removeTreeNode(this.id,this.path),this.name=g,n.TreeNode.setTreeNode(this.id,this.path,this))}updateURI(g){this.uri=g}updateFileStat(g){this.filestat=g}updateToolTip(g){this.tooltip=g}updateMetaData(g){const{fileStat:v,tooltip:E,name:u,uri:h}=g;u&&this.updateName(u),v&&this.updateFileStat(v),h&&this.updateURI(h),E&&this.updateToolTip(E)}}e.Directory=o;class f extends n.TreeNode{static is(g){return n.TreeNode.is(g)}constructor(g,v,E=new s.URI(""),u="",h={children:[],isDirectory:!1,uri:"",lastModification:0},c){super(g,v,void 0,{name:u}),this.uri=E,this.filestat=h,this.tooltip=c}get displayName(){return this.name}updateName(g){this.name!==g&&(n.TreeNode.removeTreeNode(this.id,this.path),this.name=g,n.TreeNode.setTreeNode(this.id,this.path,this))}updateURI(g){this.uri=g}updateFileStat(g){this.filestat=g}updateToolTip(g){this.tooltip=g}updateMetaData(g){const{fileStat:v,tooltip:E,name:u,uri:h}=g;u&&this.updateName(u),v&&this.updateFileStat(v),h&&this.updateURI(h),E&&this.updateToolTip(E)}}e.File=f},6250:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RESOURCE_VIEW_ID=e.IFileDialogTreeService=e.IFileDialogModel=e.PasteTypes=e.FileStatNode=e.FileTreeExpandedStatusUpdateEvent=e.IFileTreeService=e.IFileTreeAPI=e.FILE_EXPLORER_WELCOME_ID=void 0;const n=t(43718);e.FILE_EXPLORER_WELCOME_ID="file-explorer",e.IFileTreeAPI=Symbol("IFileTreeAPI"),e.IFileTreeService=Symbol("IFileTreeService");class s extends n.BasicEvent{}e.FileTreeExpandedStatusUpdateEvent=s;var o;(function(b){function g(u){return!!u&&"filestat"in u}b.is=g;function v(u){return!!u&&"filestat"in u&&!u.fileStat.isDirectory}b.isContentFile=v;function E(u){if(g(u))return u.filestat.uri}b.getUri=E})(o||(e.FileStatNode=o={}));var f;(function(b){b[b.NONE=0]="NONE",b[b.COPY=1]="COPY",b[b.CUT=2]="CUT"})(f||(e.PasteTypes=f={})),e.IFileDialogModel=Symbol("IFileDialogModel"),e.IFileDialogTreeService=Symbol("IFileDialogTreeService"),e.RESOURCE_VIEW_ID="file-explorer"},87518:(x,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=t(85608);n.__exportStar(t(6250),e),n.__exportStar(t(83709),e)},67240:(x,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.browserViews=void 0,e.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
|
|
28225
28225
|
rule:
|
|
28226
28226
|
Note: Each location has two groups _head _tail by default, representing the first and last group
|
|
28227
28227
|
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.1-next-
|
|
3
|
+
"version": "3.6.1-next-1733818657.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.1-next-
|
|
30
|
-
"@opensumi/ide-core-common": "3.6.1-next-
|
|
31
|
-
"@opensumi/ide-core-node": "3.6.1-next-
|
|
32
|
-
"@opensumi/ide-express-file-server": "3.6.1-next-
|
|
33
|
-
"@opensumi/ide-extension": "3.6.1-next-
|
|
34
|
-
"@opensumi/ide-i18n": "3.6.1-next-
|
|
35
|
-
"@opensumi/ide-main-layout": "3.6.1-next-
|
|
36
|
-
"@opensumi/ide-startup": "3.6.1-next-
|
|
29
|
+
"@opensumi/ide-core-browser": "3.6.1-next-1733818657.0",
|
|
30
|
+
"@opensumi/ide-core-common": "3.6.1-next-1733818657.0",
|
|
31
|
+
"@opensumi/ide-core-node": "3.6.1-next-1733818657.0",
|
|
32
|
+
"@opensumi/ide-express-file-server": "3.6.1-next-1733818657.0",
|
|
33
|
+
"@opensumi/ide-extension": "3.6.1-next-1733818657.0",
|
|
34
|
+
"@opensumi/ide-i18n": "3.6.1-next-1733818657.0",
|
|
35
|
+
"@opensumi/ide-main-layout": "3.6.1-next-1733818657.0",
|
|
36
|
+
"@opensumi/ide-startup": "3.6.1-next-1733818657.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": "7b2733f9abbc565c6900bd1d7240c9dc41698e57"
|
|
76
76
|
}
|