@inkeep/open-knowledge 0.17.1-beta.0 → 0.17.1-beta.1

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.
@@ -1863,7 +1863,7 @@ Error generating stack: `+e.message+`
1863
1863
  }`}function Bz(e){return`${Rz}
1864
1864
  @layer unsafe {
1865
1865
  ${e}
1866
- }`}var Vz=new WeakMap;function Hz(e){let t=Vz.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(FF,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),Vz.set(e,i),i}function Uz(e,t){if(!e.isConnected)return;let n=Hz(t);if(n==null)return;let r=t.querySelector(`style[${IF}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(IF,``),t.appendChild(i)),i.textContent=`:host { ${LF}: ${n}px; }`}var Wz;function Gz(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){Wz??(Wz=new CSSStyleSheet,Wz.replaceSync(zz(Lz)));let t=!1;try{e.adoptedStyleSheets=[Wz],t=!0}catch{}if(t){e.querySelector(`style[${NF}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(NF,``),t.textContent=zz(Lz),e.prepend(t)}}function Kz(e,t){qz(e,t),Gz(t),Uz(e,t)}function qz(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});Kz(this,e)}}if(customElements.define(MF,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(MF)))e instanceof HTMLElement&&Kz(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var Jz=e=>e.startsWith(`f::`)?e.slice(3):e;function Yz(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function Xz(e,t){return e===``?t:`${e}/${t}`}function Zz({files:e,path:t,isFolder:n,nextBasename:r}){let i=Jz(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=Yz(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=Xz(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function Qz(e){return e.endsWith(`/`)}function $z(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function eB(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function tB(e,t){return t.includes(e)?eB(t):[e]}function nB(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function rB(e,t){return{draggedPaths:e,target:t}}function iB(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(Qz(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function aB(e,t){return t.kind===`root`||t.directoryPath==null?$z(e):t.directoryPath}function oB(e,t){let n=e.map(e=>{let n=aB(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}function sB(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function cB(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!sB(Mz.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function lB(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function uB(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function dB(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function fB(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return dB(e,t.path)?n?e:null:e;case`move`:return uB(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=fB(r,e,n),r==null)return null;return r}}}function pB(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function mB(e){switch(e.operation){case`add`:return{...pB(e),operation:`add`,path:e.path};case`remove`:return{...pB(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...pB(e),from:e.from,operation:`move`,to:e.to}}}function hB(e){return{...pB(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>mB(e)),operation:`batch`}}function gB(e){switch(e.operation){case`add`:case`remove`:case`move`:return mB(e);case`batch`:return hB(e);default:return null}}function _B(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function vB(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function yB(e){return vB(e).at(-1)??null}function bB(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function xB(e){return e.endsWith(`/`)}var SB=e=>e.toLowerCase();function CB(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function wB(e){return e.endsWith(`/`)?e.slice(0,-1):e}function TB(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var EB=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},DB=Symbol(`FILE_TREE_RENAME_VIEW`),OB=512,kB=512;function AB(e){return e===`top`||e===`center`?e:`nearest`}function jB(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=vB(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function MB(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:jB(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var NB=class{#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=0;#z=null;#B=new Set;#V=0;#H;#U=0;#W=!1;#G=0;#K;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=cB({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#H=this.#le(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ne(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#B=new Set(d),this.#z=f,this.#V=1),this.#je(f,!1),r!=null&&this.#Te(r,!1),this.#K=this.#Re()}destroy(){this.#K?.(),this.#K=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#he()}focusFirstItem(){this.#be().length>0&&this.#Fe(0)}focusLastItem(){this.#G<=0||(this.#Ie(),this.#Fe(this.#G-1))}focusNextItem(){this.#Ae(1)}focusParentItem(){if(this.#c==null)return;let e=yB(this.#c);if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t)}focusPath(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;this.#Ie();let n=this.#Z(t);n>=0&&this.#Fe(n)}scrollToPath(e,t){let n=this.#H.getPathInfo(e)?.path??null;if(n==null)return;this.#Ie();let r=this.#xe(n);r<0||this.#Me(r)!=null&&(t?.focus!==!1&&this.#Fe(r,!1),this.#L={id:this.#R+=1,offset:AB(t?.offset),visibleIndex:r},this.#De())}focusMountedPathFromInput(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;let n=this.#Z(t);n>=0&&this.#Fe(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Z(t);return n>=0?(this.#Fe(n),this.#be()[n]??t):null}focusPreviousItem(){this.#Ae(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#Q(this.#c)}getFocusedPath(){return this.#c}getScrollRequest(){return this.#L}clearScrollRequest(e){this.#L?.id===e&&(this.#L=null)}resolveNearestVisiblePath(e){let t=this.#be();if(this.#G===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#H.getPathInfo(e)?.path??e,r=this.#Z(n);return r>=0?t[r]??n:this.#X(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#B]}getSelectionVersion(){return this.#V}getVisibleCount(){return this.#G}getVisibleRows(e,t){if(t<e||this.#G===0)return[];let n=Math.max(0,e),r=Math.min(this.#G-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=kB){let e=[];for(let t=n;t<=r;t+=1){let n=this.#H.getVisibleRowContext(t);if(n==null)break;e.push(this.#ee(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ie(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#Se(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];if(r!=null&&r===a+1){a=r;continue}if(i>=0&&this.#H.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null){i=-1,a=-1;continue}i=r,a=r}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#Se(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#$(o,i,a,{ancestorPaths:this.#re(a),path:s})})}return this.#H.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#$(e,r,r,{ancestorPaths:this.#re(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#G===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#G;r+=1){let i=e+r*t,a=Math.min(this.#G-1,Math.floor(i/t)),o=this.#te(a,r)??(a>0?this.#te(a-1,r):void 0);if(o==null)break;n.push({row:this.#ee(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#H.getPathInfo(e);return t==null?null:this.#Q(t.path,t)}resolveMountedDirectoryPathFromInput(e){let t=this.#H.getPathInfo(e);return t?.kind===`directory`?t.path:null}toggleMountedDirectoryFromInput(e){let t=this.resolveMountedDirectoryPathFromInput(e);t!=null&&this.#ze(t)}selectAllVisiblePaths(){this.#Ie();let e=[...this.#be()];this.#ae(e,this.#c??this.#z)}selectOnlyPath(e){let t=this.#Ne(e);t!=null&&this.#ae([t],t)}selectOnlyMountedPathFromInput(e){this.#ae([e],e)}selectPath(e){let t=this.#Ne(e);t==null||this.#B.has(t)||this.#ae([...this.#B,t])}deselectPath(e){let t=this.#Ne(e);t==null||!this.#B.has(t)||this.#ae([...this.#B].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.#ae([...this.#B].filter(e=>e!==t),t);return}this.#ae([...this.#B,t],t)}}selectPathRange(e,t){let n=this.#Ne(e);if(n==null)return;this.#Ie();let r=this.#z,i=r==null?-1:this.#Ce(r),a=this.#Ce(n);if(i===-1||a===-1){let e=t?[...this.#B,n]:[n];this.#ae(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#be().slice(o,s+1),l=t?[...this.#B,...c]:c;this.#ae(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#G-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ie();let r=this.#be(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#B);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#ae([...o],this.#z??i,!1),this.#Fe(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ne(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=tB(t,n);return this.#r.canDrag?.(r)===!1?!1:(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=rB(t.draggedPaths,n);(iB(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}nB(t.target,n)||(this.#i={...t,target:n},this.#De())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#De())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#De(),!1;let n=rB(e.draggedPaths,t);if(iB(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=oB(e.draggedPaths,t);if(r==null)return this.#De(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#H.move(e.from,e.to,{collision:e.collision})}else this.#ce(r.operations),this.#H.batch(r.operations)}catch(e){return this.#De(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#H.add(e)}remove(e,t={}){this.#H.remove(e,t)}move(e,t,n={}){this.#H.move(e,t,n)}batch(e){this.#H.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Te(e,!0)}openSearch(e=``){this.#Te(e,!0)}closeSearch(){this.#Te(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#we(1)}focusPreviousSearchMatch(){this.#we(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#H.getPathInfo(e);if(n==null)return!1;let r=n.path,i=xB(r),a=wB(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of vB(r))this.#H.isExpanded(e)||this.#H.expand(e);return this.#ae([r],r,!1),this.#M!=null&&(this.#Te(null,!1),this.#y?.(this.#M)),this.#Pe(r),this.#T=r,this.#E=CB(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}[DB](){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}}#q(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,xB(e)?{recursive:!0}:void 0);return}this.#Pe(e),this.#De()}#J(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,xB(e)?{recursive:!0}:void 0);return}let t=xB(e),n=Zz({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:wB(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#Pe(e),this.#v?.(n.error),this.#De();return}if(n.sourcePath===n.destinationPath){this.#Pe(e),this.#De();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(TB(n.sourcePath,t),TB(n.destinationPath,t))}#Y(e){this.#T==null||this.#E===e||(this.#E=e,this.#De())}resetPaths(e,t={}){let n=this.#H.list().length,r=this.#G,i=cB({paths:e,preparedInput:t.preparedInput},`resetPaths`,this.#e.sort),a=this.#le(i.paths,i.preparedInput,t.initialExpandedPaths),o=this.#c,s=this.#T,c=this.getSelectedPaths(),l=this.#z;this.#K?.(),this.#H=a,this.#d.clear(),this.#he();let u=c.map(e=>a.getPathInfo(e)?.path??null).filter(e=>e!=null),d=!_B(this.#B,u);this.#B=new Set(u),d&&(this.#V+=1),this.#z=l==null?null:a.getPathInfo(l)?.path??null,this.#T=s==null?null:a.getPathInfo(s)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(o,o!=null||u.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:i.paths.length,pathCountBefore:n,projectionChanged:!0,usedPreparedInput:t.preparedInput!=null,visibleCountDelta:this.#G-r})}#X(e){this.#Ie();let t=yB(e),n=bB(e,t),r=null,i=null;for(let e of this.#be()){if(yB(e)!==t)continue;let a=bB(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Z(e){let t=this.#Ce(e);if(t!==-1)return t;let n=vB(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#Ce(t);if(r!==-1)return r}return this.#be().length>0?0:-1}#Q(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#H.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#oe(r.path):this.#se(r.path);return this.#d.set(r.path,i),i}#$(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#B.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#ee(e){return this.#$(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#te(e,t){let n=this.#H.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ne(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ne(n),n];return this.#a.set(e,r),r}#re(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ne(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ie(e){this.#H.collapse(e)}#ae(e,t=this.#z,n=!0){let r=[...new Set(e)],i=!_B(this.#B,r),a=this.#z!==t;!i&&!a||(this.#B=new Set(r),this.#z=t,i&&(this.#V+=1),n&&this.#De())}#oe(e){return{collapse:()=>{this.#ie(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#ke(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#H.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#ze(e)}}}#se(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#ce(e){let t=this.#H.list();this.#le(t).batch(e)}#le(e,t,n){return new Mz({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ue(){return this.#h??=this.#H.list(),this.#h}#de(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ue()){e.add(t);for(let n of vB(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(SB),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(SB),this.#p}#he(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#ge(){return this.#pe().filter(e=>this.#H.isExpanded(e))}#_e(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#B)for(let n of vB(e))t.add(n);this.#ve(t)}#ve(e){this.#W=!0;try{for(let t of this.#pe()){let n=e.has(t),r=this.#H.isExpanded(t);n&&!r?this.#H.expand(t):!n&&r&&this.#H.collapse(t)}}finally{this.#W=!1}}#ye(){if(this.#M==null||this.#M.length===0){this.#k=[],this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#G=n.length}#be(){return this.#I??this.#b}#xe(e){return this.#I==null?this.#H.getVisibleIndex(e)??-1:this.#P?.get(e)??-1}#Se(e){return this.#F?.[e]??e}#Ce(e){return this.#P?.get(e)??this.#H.getVisibleIndex(e)??-1}#we(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Te(e,t){let n=e==null?null:EB(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#ge()),this.#M=n,n==null)this.#_e(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else if(n.length===0)this.#_e(!1),this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else{let e=this.#Ee();this.#je(e,!0)}t&&(this.#y?.(this.#M),this.#De())}}#Ee(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ue(),n=this.#fe(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#pe(),s=this.#me();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of vB(e))l.add(t),c?.add(t)}return this.#ve(l),a??this.#c}#De(){for(let e of this.#t)e()}#Oe(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#ke(e){for(let t of vB(e))this.#H.isExpanded(t)||this.#H.expand(t);this.#H.isExpanded(e)||this.#H.expand(e)}#Ae(e){let t=this.#G;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ie(),this.#Fe(r))}#je(e,t=!0){let n=this.#H.getVisibleCount();this.#U=n;let r=MB(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,OB)),e,t?e=>this.#H.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#ye(),this.#s=e==null?this.#be().length>0?0:-1:this.#Z(e),this.#c=this.#s<0?null:this.#Me(this.#s)}#Me(e){return this.#be()[e]??(this.#F==null?this.#H.getVisibleRowContext(e)?.row.path??null:null)}#Ne(e){return this.#H.getPathInfo(e)?.path??null}#Pe(e){if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t,!1)}#Fe(e,t=!0){let n=this.#Me(e);n!=null&&(this.#s===e&&this.#c===n||(this.#s=e,this.#c=n,t&&this.#De()))}#Ie(){this.#l||this.#je(this.#c,!0)}#Le(e){let t=fB(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=fB(this.#c,e,!0),r=[...this.#B].map(t=>fB(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=fB(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return _B(this.#B,o)||(this.#B=new Set(o),this.#V+=1),this.#z=a,n}#Re(){return this.#H.on(`*`,e=>{if(this.#W)return;e.canonicalChanged&&(this.#d.clear(),this.#he()),this.#i!=null&&lB(e)&&(this.#i=null);let t=lB(e)?this.#Le(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ee():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#je(n,r),this.#De();let i=gB(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},PB=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function FB(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1){if(!(e[t]===`/`||t===e.length)){r===-1&&(r=t);continue}r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1)}return n===``?null:{isDirectory:t,path:n}}function IB(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function LB(e,t){return t?`${e}/`:e}function RB(e,t=null){let n=PB(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set;for(let t of e??[]){let e=FB(t.path);if(e==null)continue;let n=LB(e.path,e.isDirectory);r.set(n,t.status),t.status===`ignored`&&e.isDirectory?a.add(n):e.isDirectory&&a.delete(n);for(let t of IB(e.path))i.add(t)}return{directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}var zB,BB,VB,HB,UB,WB,GB,KB,qB,JB,YB={},XB=[],ZB=Array.isArray,QB=XB.slice,$B=Object.assign;function eV(e){e&&e.parentNode&&e.remove()}function tV(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?QB.call(arguments,2):n),nV(e,o,r,i,null)}function nV(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++BB,__i:-1,__u:0};return i==null&&zB.vnode!=null&&zB.vnode(a),a}function rV(e){return e.children}function iV(e,t){this.props=e,this.context=t,this.__g=0}function aV(e,t){if(t==null)return e.__?aV(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?aV(e):null}function oV(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return oV(e)}}function sV(e){(8&e.__g||!(e.__g|=8)||!VB.push(e)||UB++)&&HB==zB.debounceRendering||((HB=zB.debounceRendering)||queueMicrotask)(cV)}function cV(){for(var e,t,n,r,i,a,o,s,c=1;VB.length;)VB.length>c&&VB.sort(WB),e=VB.shift(),c=VB.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=$B({},r)).__v=r.__v+1,zB.vnode&&zB.vnode(n),gV(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??aV(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,vV(a,n,o),n.__e!=i&&oV(n)));UB=0}function lV(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||XB,b=t.length;for(c=uV(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?YB:y[m.__i]||YB,m.__i=f,_=gV(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&xV(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=dV(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function uV(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?nV(null,o,null,null,null):ZB(o)?nV(rV,{children:o},null,null,null):o.constructor==null&&o.__b>0?nV(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=fV(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=aV(s)),SV(s,s));return r}function dV(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=dV(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=aV(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function fV(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function pV(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function mV(e,t,n,r,i){var a;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||pV(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||pV(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(GB,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=KB,e.addEventListener(t,a?JB:qB,a)):e.removeEventListener(t,a?JB:qB,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function hV(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=KB++;else if(t.u<n.l)return;return n(zB.event?zB.event(t):t)}}}function gV(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=zB.__b)&&d(t);n:if(typeof M==`function`)try{if(v=t.props,y=`prototype`in M&&M.prototype.render,b=(d=M.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new M(v,x):(t.__c=f=new iV(v,x),f.constructor=M,f.render=CV),b&&b.sub(f),f.props=v,f.state||={},f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&M.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=$B({},f.__s)),$B(f.__s,M.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&M.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&M.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=zB.__r,w=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),T=0;T<f._sb.length;T++)f.__h.push(f._sb[T]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++w<25);f.state=f.__s,f.getChildContext!=null&&(r=$B({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===rV&&d.key==null&&(E=yV(d.props.children)),s=lV(e,ZB(E)?E:[E],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null)if(e.then){for(D=0,O=!1,t.__u|=c?160:128,t.__c.__z=[],k=0;k<a.length;k++)(A=a[k])==null||O||(A.nodeType==8&&A.data==`$s`?(D>0&&t.__c.__z.push(A),D++,a[k]=null):A.nodeType==8&&A.data==`/$s`?(--D>0&&t.__c.__z.push(A),O=D===0,s=a[k],a[k]=null):D>0&&(t.__c.__z.push(A),a[k]=null));if(!O){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(j=a.length;j--;)eV(a[j]);_V(t)}else t.__e=n.__e,t.__k=n.__k,e.then||_V(t);zB.__e(e,t,n)}else s=t.__e=bV(n.__e,t,n,r,i,a,o,c,l,u);return(d=zB.diffed)&&d(t),128&t.__u?void 0:s}function _V(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(_V)}function vV(e,t,n){for(var r=0;r<n.length;r++)xV(n[r],n[++r],n[++r]);zB.__c&&zB.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){zB.__e(e,t.__v)}})}function yV(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:ZB(e)?e.map(yV):$B({},e)}function bV(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(zB.__m&&zB.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=QB.call(e.childNodes),v=n.props||YB,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;mV(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||mV(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),lV(b==`template`?e.content:e,ZB(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&aV(n,0),s,c,l),a!=null)for(u=a.length;u--;)eV(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||mV(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&mV(e,u,g,v[u],i))}return e}function xV(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){zB.__e(e,n)}}function SV(e,t,n){var r,i;if(zB.unmount&&zB.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||xV(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){zB.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&SV(r[i],t,n||typeof e.type!=`function`);n||eV(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function CV(e,t,n){return this.constructor(e,n)}function wV(e,t){var n,r,i,a;t==document&&(t=document.documentElement),zB.__&&zB.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=tV(rV,null,[e]),i=[],a=[],gV(t,e,r||YB,YB,t.namespaceURI,r?null:t.firstChild?QB.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),vV(i,e,a)}function TV(e,t){e.__u|=32,wV(e,t)}zB={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw UB=0,e}},BB=0,iV.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=$B({},this.state);typeof e==`function`&&(e=e($B({},n),this.props)),e&&$B(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),sV(this))},iV.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),sV(this))},iV.prototype.render=rV,VB=[],UB=0,WB=function(e,t){return e.__v.__b-t.__v.__b},GB=/(PointerCapture)$|Capture$/i,KB=0,qB=hV(!1),JB=hV(!0);var EV=0;Array.isArray;function DV(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--EV,__i:-1,__u:0,__source:i,__self:a};return zB.vnode&&zB.vnode(l),l}var OV=16,kV=16,AV={};function jV({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=AV[e]??{width:OV,height:kV},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return DV(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`},viewBox:m,width:f,height:p,children:DV(`use`,{href:c})})}var MV=e=>{if(e.length<2)return[e,``];let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]},NV=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},PV=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},FV=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},IV=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},LV=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function RV({children:e,marker:t,variant:n=`default`}){"use no memo";return DV(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:DV(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?DV(`span`,{"data-truncate-fade":!0}):t})})}function zV(e){"use no memo";let{mode:t,children:n}=e;return DV(`div`,{children:[DV(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?DV(`span`,{children:n}):n}),DV(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?DV(`span`,{children:n}):n})]})}function BV({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=DV(zV,{mode:t,children:e},`content`),o=DV(RV,{marker:n,mode:t,variant:r},`marker`),s=DV(`div`,{"data-truncate-fill":!0},`fill`);return DV(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:DV(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function VV({children:e,...t}){"use no memo";return DV(BV,{mode:`truncate`,...t,children:e})}function HV({children:e,...t}){"use no memo";return DV(BV,{mode:`fruncate`,...t,children:e})}function UV({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=DV(VV,{...s,children:t[0]}),l=DV(HV,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return DV(`div`,{className:a,style:o});if(e.length<i)return DV(n===`end`?HV:VV,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=MV:r===`extension`?t=NV:r===`leaf-path`&&(t=PV);else if(typeof r==`number`)t=FV,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=IV:e===`first`&&(t=LV)}else typeof r==`function`&&(t=r);t??=MV;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=DV(VV,{...s,..._,children:f}),l=DV(HV,{...s,...v,children:p})}return DV(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[DV(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),DV(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var WV={endIndex:-1,startIndex:-1};function GV(e,t,n){return Math.min(Math.max(e,t),n)}function KV(e,t){return e<0||t<e?WV:{endIndex:t,startIndex:e}}function qV(e){return e.startIndex<0||e.endIndex<e.startIndex}function JV(e,t){return qV(e)?0:(e.endIndex-e.startIndex+1)*t}function YV(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function XV(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function ZV(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);if(i==null){t.set(r,[n]);return}i.push(n)}),t}function QV(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;if(o<=t){i=a,n=a+1;continue}r=a-1}return i}function $V(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function eH(e,t,n){if(e.length===0||t<=0)return[];let r=$V(e),i=ZV(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=QV(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function tH(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=GV(t.scrollTop,0,o),c=t.stickyRows??eH(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=YV(s,n,t.itemHeight),m=YV(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?WV:KV(m,XV(u+d,n,t.itemHeight)),y=g+1,b=qV(v)?WV:KV(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=JV(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:qV(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var nH={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},rH={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},iH=`Contains git status items`;function aH(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function oH(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return aH({currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:a,viewportHeight:s});if(n<0)return null;let c=Math.max(0,a),l=n*r,u=Math.max(0,s-c),d=i===`center`?c+Math.max(0,(u-r)/2):c,f=Math.max(0,o-s),p=Math.max(0,Math.min(l-d,f));return p===t?null:p}function sH(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}function cH(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function lH(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function uH(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function dH(e,t){return e!=null&&e>0?e:t}function fH(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function pH(e,t,n,r,i=0){let a=aH({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a==null?!1:(e.scrollTop=a,!0)}function mH(e,t,n,r,i,a,o=0){let s=oH({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s==null?!1:(e.scrollTop=s,!0)}function hH(e,t,n,r,i,a){let o=sH({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o==null?!1:(e.scrollTop=o,!0)}function gH(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function _H(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function vH({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return DV(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function yH(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function bH(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}var xH,SH,CH,wH,TH=Object.is,EH=0,DH=[],OH=zB,kH=OH.__b,AH=OH.__r,jH=OH.diffed,MH=OH.__c,NH=OH.unmount,PH=OH.__;function FH(e,t){OH.__h&&OH.__h(SH,e,EH||t),EH=0;var n=SH.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function IH(e){return EH=1,LH(YH,e)}function LH(e,t,n){var r=FH(xH++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):YH(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);TH(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=SH,!SH.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,TH(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};SH.__f=!0;var a=SH.shouldComponentUpdate,o=SH.componentWillUpdate;SH.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},SH.shouldComponentUpdate=i}return r.__N||r.__}function RH(e,t){var n=FH(xH++,3);!OH.__s&&JH(n.__H,t)&&(n.__=e,n.u=t,SH.__H.__h.push(n))}function zH(e,t){var n=FH(xH++,4);!OH.__s&&JH(n.__H,t)&&(n.__=e,n.u=t,SH.__h.push(n))}function BH(e){return EH=5,VH(function(){return{current:e}},[])}function VH(e,t){var n=FH(xH++,7);return JH(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function HH(e,t){return EH=8,VH(function(){return e},t)}function UH(){for(var e;e=DH.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(KH),e.__H.__h.forEach(qH),e.__H.__h=[]}catch(t){e.__H.__h=[],OH.__e(t,e.__v)}}OH.__b=function(e){SH=null,kH&&kH(e)},OH.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),PH&&PH(e,t)},OH.__r=function(e){AH&&AH(e),xH=0;var t=(SH=e.__c).__H;t&&(CH===SH?(t.__h=[],SH.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(KH),t.__h.forEach(qH),t.__h=[],xH=0)),CH=SH},OH.diffed=function(e){jH&&jH(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(DH.push(t)!==1&&wH===OH.requestAnimationFrame||((wH=OH.requestAnimationFrame)||GH)(UH)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),CH=SH=null},OH.__c=function(e,t){t.some(function(e){try{e.__h.forEach(KH),e.__h=e.__h.filter(function(e){return!e.__||qH(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],OH.__e(n,e.__v)}}),MH&&MH(e,t)},OH.unmount=function(e){NH&&NH(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{KH(e)}catch(e){t=e}}),n.__H=void 0,t&&OH.__e(t,n.__v))};var WH=typeof requestAnimationFrame==`function`;function GH(e){var t,n=function(){clearTimeout(r),WH&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);WH&&(t=requestAnimationFrame(n))}function KH(e){var t=SH,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),SH=t}function qH(e){var t=SH;e.__c=e.__(),SH=t}function JH(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!TH(t,e[n])})}function YH(e,t){return typeof t==`function`?t(e):t}function XH(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:DV(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return DV(rV,{children:[DV(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:DV(VV,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function ZH(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function QH(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function $H(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function eU({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=tH(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:$H(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?$H(u,1,t,o):i&&r<=0&&c.length>0?eH(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var tU=400,nU=10,rU=40,iU=18;function aU(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?oU(e,t,n):a instanceof HTMLElement?a:null}function oU(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function sU(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return e?.closest?.(`[data-file-tree-virtualized-scroll]`)instanceof HTMLElement?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:null,kind:`root`}:null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function cU(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function lU(){return navigator.vendor!==`Apple Computer, Inc.`}function uU(e,t){let n=e-t.top;if(n<rU)return-Math.ceil((rU-Math.max(0,n))/rU*iU);let r=t.bottom-e;return r<rU?Math.ceil((rU-Math.max(0,r))/rU*iU):0}function dU(e,t){if(e!=null){let t=nH[e];return t==null?null:{text:t,title:rH[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:iH}:null}function fU(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function pU(e){return e!=null&&`toggle`in e}function mU(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function hU(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function gU(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function _U(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function vU(e,t){return t&&_U(e)||(e.ctrlKey||e.metaKey)&&mU(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var yU=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function bU(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function xU(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function SU(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function CU(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function wU(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function TU(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function EU(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function DU(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function OU(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=DU(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function kU(e,t){return{kind:e.kind,name:QH(e),path:t}}function AU(e){return e==null?void 0:`${e}__tree`}function jU(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function MU(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function NU(e,t){if(e==null)return null;if(`text`in e)return DV(`span`,{title:e.title,children:e.text});let n=typeof e.icon==`string`?MU(e.icon)?t(e.icon):{name:e.icon}:MU(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return DV(`span`,{title:e.title,children:DV(jV,{...n})})}function PU(e){e!=null&&cH(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function FU(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=ZH(e);return DV(rV,{children:[e.depth>0?DV(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>DV(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,DV(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?DV(jV,{...t(`file-tree-icon-chevron`)}):DV(jV,{...t(`file-tree-icon-file`,u)})}),DV(`div`,{"data-item-section":`content`,children:e.isFlattened?XH(e,c,a):c??DV(UV,{minimumLength:5,split:`extension`,children:e.name})}),i?DV(`div`,{"data-item-section":`decoration`,children:r==null?null:NU(r,t)}):null,s?DV(`div`,{"data-item-section":`git`,children:NU(o,t)}):null,n?DV(`div`,{"data-item-section":`action`,children:l?DV(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:DV(jV,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function IU(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:w,contextMenuButtonVisibility:T,contextMenuRightClickEnabled:E,registerRenameInput:D,registerButton:O,resolveIcon:k,renderDecorationForRow:A,openContextMenuForRow:j,onRowClick:M,onKeyDown:N}=e,P=ZH(t),{isParked:F=!1,mode:I=`flow`,style:L}=r,R=I===`sticky`,z=_?.get(P)??null??fU(t.ancestorPaths,v,y),B=t.kind===`directory`&&(b?.has(P)??!1),V=A(t,P),H=dU(z,B),U=S&&w,W=V!=null||x||U,G=U&&T===`always`,K=a.getPath()===P,q=K?a.getValue():``,J=R||!K?null:DV(vH,{ref:D,ariaLabel:`Rename ${QH(t)}`,isFlattened:t.isFlattened,value:q,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),Y=FU(t,k,{actionLaneEnabled:U,customDecoration:V,decorationLaneEnabled:W,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:H,gitLaneActive:x,renameInput:J,showDecorativeActionAffordance:G}),ee={...yH({ariaLabel:QH(t),domId:t.isFocused?jU(h,P,F):void 0,extraStyle:L,features:{actionLaneEnabled:U,contextMenuButtonVisibility:U?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:F,itemHeight:g,mode:I,row:t,state:{containsGitChange:B,effectiveGitStatus:z,isContextHovered:s===P,isDragTarget:l?.kind===`directory`&&l.directoryPath===P,isDragging:c?.has(P)===!0,isFocusRinged:t.isFocused&&o===P},targetPath:P}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),E&&(i.focusMountedPathFromInput(P),j(t,P,{anchorRect:SU(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:R?void 0:()=>{i.focusMountedPathFromInput(P)},onKeyDown:R?void 0:N,ref:e=>{O(P,e)}};return!R&&K?DV(`div`,{...ee,children:Y}):DV(`button`,{...ee,type:`button`,draggable:u&&!F,onDragEnd:u&&!F?p:void 0,onDragStart:u&&!F?e=>{f(e,t,P)}:void 0,onMouseDown:e=>{if(R){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!F?e=>{m(e,t,P)}:void 0,onClick:e=>{M(e,t,P,I)},children:Y})}function LU(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(ZH(e))).map((n,r)=>IU(e,n,t.start+r))}function RU({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=Iz,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=BH(null),v=BH(null),y=BH(!1),b=BH(null),x=BH(null),S=BH(null),C=BH(null),w=BH(null),T=BH(new Map),E=BH(new Map),D=BH(()=>{}),O=BH(null),k=BH(0),A=BH(!1),j=BH(null);j.current!==t&&(A.current=!1,j.current=t);let M=BH(!1),N=BH(null),P=BH(null),F=BH(!1),I=BH(null),L=BH(null),R=BH(null),z=BH(null),B=BH(null),V=BH(null),H=BH(null),U=BH(null),W=BH(!1),G=BH(null),K=BH(null),q=BH(null),J=BH(null),Y=VH(()=>new Map,[]),[,ee]=IH(0),[te,X]=IH(null),[ne,re]=IH(null),[ie,ae]=IH(null),[oe,se]=IH(null),[ce,le]=IH(0),[ue,de]=IH(null),fe=BH(ue);fe.current=ue;let pe=BH(null),me=BH(null),he=BH(null),ge=BH(null),_e=BH(null),ve=BH(!1),ye=()=>{me.current=null,he.current=null,ge.current=null},be=(e,t)=>{me.current=e,he.current=null,ge.current=t==null?null:{path:e,scrollTop:t}},xe=(e,t)=>{me.current=null,he.current={path:e,viewportOffset:t},ge.current=null},Se=BH(d===`retain`&&t.isSearchOpen()),[Ce,we]=IH(p);RH(()=>{p||we(!1)},[p]);let Te=BH(!1),Ee=HH(()=>{Te.current=!0,we(e=>e&&!1)},[]),[De,Oe]=IH(()=>eU({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[ke,Ae]=IH(!1);RH(()=>{Ae(!0)},[]);let je=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Me=e?.contextMenu?.triggerMode??(je?`right-click`:`both`),Ne=Me===`both`||Me===`button`,Pe=e?.contextMenu?.buttonVisibility??`when-needed`,Fe=Me===`both`||Me===`right-click`;zH(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;_e.current=t,re(t),se(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(ve.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let Ie=HH((e,t)=>{wU(T.current,e,t)},[]),Le=HH((e,t)=>{wU(E.current,e,t)},[]),Re=HH(e=>{x.current=e},[]),ze=HH(e=>TU(e,E.current,T.current),[]),Be=n!=null||r!=null||i!=null,{resolveIcon:Ve}=VH(()=>qF(a),[a]),He=t[DB](),Ue=He.getPath(),We=Ue!=null,Ge=t.isSearchOpen(),Ke=t.getSearchValue(),qe=t.getFocusedPath(),Je=t.getFocusedIndex(),Ye=t.getScrollRequest(),Xe=t.isDragAndDropEnabled(),Ze=t.getDragSession(),Qe=VH(()=>Ze==null?null:new Set(Ze.draggedPaths),[Ze]),$e=Ze?.target??null,et=Ze?.primaryPath??null,tt=AU(o),{overlayHeight:nt,overlayRows:rt,snapshot:it,visibleRows:at}=De,ot=it.physical.viewportHeight,st=VH(()=>({end:it.window.endIndex,start:it.window.startIndex}),[it.window.endIndex,it.window.startIndex]),ct=rt,lt=it.sticky.rows,ut=it.physical.totalHeight,dt=it.sticky.height,ft=VH(()=>new Set(lt.map(e=>ZH(e.row))),[lt]),pt=Je>=0&&Je>=st.start&&Je<=st.end,mt=HH((e,t)=>u?.({item:kU(e,t),row:e})??null,[u]),ht=HH(e=>cH(e==null?null:T.current.get(e)??null)?!0:cH(S.current),[]),gt=HH(e=>{ht(t.focusNearestPath(e))},[t,ht]),_t=BH(gt);_t.current=gt;let vt=BH(!0),yt=BH(()=>{}),bt=HH((t=!0)=>{let n=fe.current;n!=null&&(vt.current=vt.current&&t,de(null),e?.contextMenu?.onClose?.(),vt.current&&gt(n.path))},[e?.contextMenu,gt]);yt.current=bt;let xt=HH(e=>{let t=e==null?null:CU(S.current,e);ae(e=>e===t?e:t)},[]),St=HH((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=ze(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;be(n,e?.scrollTop??null),M.current=!0,X(e=>e===n?e:n)}i.focus(),xt(a),vt.current=!0,de({anchorRect:r?.anchorRect??null,item:kU(e,n),path:n,source:r?.source??`keyboard`})},[t,ze,xt]),Ct=HH(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=uH(e,ot);I.current=Je<0||e==null?null:Math.max(0,Math.min(Je*s-e.scrollTop,Math.max(0,t-s))),F.current=!0}t.startRenaming(e)!==!1&&(se(`focus`),ee(e=>e+1))}},[t,Je,s,l,ot]),wt=HH((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=uH(i,ot),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:eU({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return M.current=!0,hH(i,a,s,l,u,d),D.current(),pe.current=n?e:null,!0},[t,s,c,ot,h]),Tt=()=>y.current===!0||J.current!=null||W.current===!0,Et=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),Dt=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Ot=()=>{z.current!=null&&(clearTimeout(z.current),z.current=null),R.current=null},kt=()=>{V.current?.remove(),V.current=null},At=()=>{Dt(L.current),L.current=null,B.current=null},jt=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},Mt=()=>{U.current?.(),U.current=null,J.current!=null&&(clearTimeout(J.current),J.current=null),W.current=!1,G.current=null,q.current=null,K.current!=null&&(K.current.setAttribute(`draggable`,`true`),K.current.style.removeProperty(`touch-action`),K.current=null),kt(),Ot(),At(),H.current=null},Nt=(e,n)=>{let r=S.current?.getRootNode(),i=sU(aU(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Pt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Ot();return}let r=t.getItem(e.directoryPath),i=pU(r)?r:null;if(i==null||i.isExpanded()){Ot();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;R.current!==a&&(Ot(),R.current=a,z.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind!==`directory`||n.directoryPath!==e.directoryPath||n.flattenedSegmentPath!==e.flattenedSegmentPath||i.expand()},n))},Ft=()=>{L.current=null;let e=B.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=uU(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,D.current()),Pt(Nt(e.clientX,e.clientY)),L.current=Et(Ft)},It=(e,t)=>{B.current={clientX:e,clientY:t},L.current??=Et(Ft)},Lt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(Mt(),kt(),Ot(),At(),t.startDrag(r)===!1){e.preventDefault();return}if(H.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),lU())){let t=cU(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),jt(t),V.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Rt=()=>{kt(),Ot(),At(),H.current=null,t.cancelDrag()},zt=(e,n,r)=>{if(J.current!=null||W.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;q.current={clientX:i.clientX,clientY:i.clientY},K.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!W.current;J.current!=null&&(clearTimeout(J.current),J.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),U.current===o&&(U.current=null),t&&(a.setAttribute(`draggable`,`true`),K.current===a&&(K.current=null),q.current=null)},s=e=>{let t=e.touches[0],n=q.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=nU*nU||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),U.current=o,J.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),K.current===a&&(K.current=null),q.current=null;return}W.current=!0,K.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),H.current=n;let e=a.getBoundingClientRect(),s=cU(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),jt(s),V.current=s,G.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=G.current;n!=null&&V.current!=null&&(V.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Pt(Nt(t.clientX,t.clientY)),It(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&Nt(n.clientX,n.clientY),t.completeDrag(),Mt()},u=()=>{t.cancelDrag(),Mt()};U.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},tU)},Bt=e=>{if(ue!=null){if(e.key===`Escape`){bt(),e.preventDefault(),e.stopPropagation();return}yU.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(He.isActive()){if(e.key===`Escape`)He.cancel();else if(e.key===`Enter`)He.commit();else return;se(`focus`),ee(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Ct(qe??void 0),e.preventDefault(),e.stopPropagation();return}if(Ge){if(e.key===`Escape`)F.current=!1,I.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=uH(n,ot);I.current=Je<0||n==null?null:Math.max(0,Math.min(Je*s-n.scrollTop,Math.max(0,r-s))),F.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;se(`focus`),ee(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&hU(e)){t.openSearch(e.key),ee(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=je&&_U(e),r=vU(e,je),i=r&&S.current!=null?lH(S.current):null,a=r?new Set(EU(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==qe&&a.has(o)){let e=C.current;be(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=pU(p)?p:null,h=u!=null&&(ft.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=TU(u,E.current,T.current);e==null||n==null?y=!1:St(e,u)}else if((e.ctrlKey||e.metaKey)&&mU(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;se(`focus`);let b=t.getFocusedPath(),x=b!=null&&(ft.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))be(b,v?.scrollTop??null),M.current=!0,X(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(xe(b,OU(S.current,v,i,u,s,dt,ot)),M.current=!0,X(e=>e===b?e:b)):ye()}ee(e=>e+1),e.preventDefault(),e.stopPropagation()};zH(()=>{if(!(!f||!Ge)){if(Se.current){Se.current=!1;return}cH(w.current)}},[Ge,f]),zH(()=>{let e=x.current;switch(_H({hasRenderedInput:e!=null,previousRenamingPath:P.current,renamingPath:Ue})){case`reset`:P.current=null;return;case`reveal-canonical`:Ue!=null&&wt(Ue,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(pe.current=null,P.current=Ue,cH(e),e.select());return}},[st.end,st.start,Ue,wt,ft]),zH(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=lH(e)?.dataset.itemPath??null;X(e=>e===t?e:t)},i=()=>{n(),M.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,lH(e)!=null){r();return}M.current=!1,X(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),M.current=!1,X(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;X(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),zH(()=>{let e=S.current;e!=null&&(it.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[it.physical.scrollTop]),zH(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=uH(n,g);let a=()=>{let e=t.getVisibleCount(),r=dH(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Oe(eU({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!A.current){A.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=dH(O.current,g),i=t.getVisibleRows(e,e)[0]??null;pH(n,e,s,r,h&&i!=null?Math.max(0,Math.min(i.ancestorPaths.length*s,Math.max(0,r-s))):0)}}D.current=a;let o=!1,l=t.subscribe(()=>{o?ee(e=>e+1):o=!0,a()}),u=()=>{ve.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,le(e=>e+1),e=null},50))},d=null,f=()=>{i!=null&&delete i.dataset.overlayReveal,d!=null&&(clearTimeout(d),d=null)},p=()=>{i==null||ve.current===!0||n.scrollTop>0||(i.dataset.overlayReveal=`true`,d!=null&&clearTimeout(d),d=setTimeout(()=>{f()},200))},m=()=>{if(a(),n.scrollTop>0&&f(),fe.current!=null&&y.current&&yt.current(),ve.current===!0){y.current=!1;return}re(e=>e==null?e:null),u()},_=()=>{u(),p()},v=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),x=e=>{v.has(e.key)&&_()};n.addEventListener(`scroll`,m,{passive:!0}),n.addEventListener(`wheel`,_,{passive:!0}),n.addEventListener(`touchmove`,_,{passive:!0}),n.addEventListener(`keydown`,x);let w=typeof ResizeObserver<`u`?new ResizeObserver(e=>{O.current=(e[0]==null?null:fH(e[0]))??uH(n,g),a()}):null;return w?.observe(n),()=>{D.current=()=>{},l(),n.removeEventListener(`scroll`,m),n.removeEventListener(`wheel`,_),n.removeEventListener(`touchmove`,_),n.removeEventListener(`keydown`,x),e!=null&&clearTimeout(e),d!=null&&clearTimeout(d),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,O.current=null,w?.disconnect()}},[t,g,s,c,h]),zH(()=>{je||ue==null||bt(!1)},[bt,je,ue]);let Vt=VH(()=>ue==null?null:`${ue.path}::${ue.source}`,[ue]);zH(()=>{if(Vt==null){m?.clearSlotContent(zF);return}let t=fe.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??xU(n.getBoundingClientRect()),close:e=>{yt.current(e?.restoreFocus??!0)},restoreFocus:()=>{vt.current&&_t.current(fe.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(zF,i),e?.contextMenu?.onOpen?.(t.item,r),PU(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&PU(i)}),()=>{m?.clearSlotContent(zF)}},[Vt,e?.contextMenu,m]),zH(()=>{ue!=null&&t.getItem(ue.path)==null&&bt()},[bt,ue,t]),zH(()=>{if(ue==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(bU(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&bt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),bt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[bt,ue]),zH(()=>{let e=C.current,n=S.current;if(e==null||n==null){N.current=qe;return}let r=qe==null?null:T.current.get(qe)??null,i=lH(n),a=i?.dataset.itemPath??null,o=We&&x.current===i,c=f&&w.current===i,l=F.current&&!Ge,u=I.current??0,d=pe.current,p=me.current,m=he.current,g=ge.current,_=i!=null,v=M.current||_,y=N.current!==qe,b=p!=null&&p===qe&&qe!=null,E=!1,O=!1;if(Ye!=null&&Ye.id!==k.current){k.current=Ye.id;let n=Ye.visibleIndex,r=t.getVisibleRows(n,n)[0]??null;if(r!=null){let t=h?Math.max(0,Math.min(r.ancestorPaths.length*s,Math.max(0,ot-s))):dt;E=!0,O=mH(e,n,s,ot,ut,Ye.offset,t)}t.clearScrollRequest(Ye.id)}let A=!E&&l&&hH(e,Je,s,ot,ut,u),j=!E&&d!=null&&d===qe&&hH(e,Je,s,ot,ut,dt),P=!E&&m!=null&&m.path===qe&&hH(e,Je,s,ot,ut,m.viewportOffset),L=!E&&g!=null&&g.path===qe&&e.scrollTop!==g.scrollTop;if(L&&(e.scrollTop=g.scrollTop),(L||O||j||P||A||v&&y&&d!==qe&&!b&&pH(e,Je,s,ot,dt))&&D.current(),E){N.current=qe;return}if(!v){N.current=qe;return}if(o){N.current=qe;return}if(c&&!l){N.current=qe;return}if(r==null){l&&Je>=0&&(hH(e,Je,s,ot,ut,u),D.current()),N.current=qe;return}(y||l||d===qe||p===qe||m?.path===qe||g?.path===qe||a==null||a!==qe)&&(cH(r),d===qe&&(pe.current=null),p===qe&&(me.current=null),m?.path===qe&&(he.current=null),g?.path===qe&&(ge.current=null),F.current=!1,I.current=null),N.current=qe},[t,Je,qe,pt,s,We,Ge,st,ot,f,Ye,h,dt,ut,at]);let Ht=Je>=0&&Je>=it.visible.startIndex&&Je<=it.visible.endIndex,Ut=qe!=null&&ct.some(e=>ZH(e.row)===qe),Wt=Ht||Ut,Gt=Ne&&M.current===!0&&Wt?qe:null,Kt=oe===`pointer`?ne:null,qt=ue?.path??_e.current??Kt??Gt??ne,Jt=ue?.source===`right-click`;zH(()=>{y.current&&ue==null||xt(ze(qt))},[ue,ze,st,ot,ce,ct,qt,xt,at]);let Yt=HH(e=>{if(y.current||bU(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&se(e=>e===`pointer`?e:`pointer`),re(e=>e===i?e:i)},[]),Xt=HH(()=>{re(null)},[]);zH(()=>{if(!Xe)return;let e=()=>{Mt(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),Mt(),t.cancelDrag()}},[t,Xe]);let Zt=e=>{if(!Xe||t.getDragSession()==null||W.current)return;let n=sU(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Pt(t.getDragSession()?.target??null),It(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},Qt=e=>{if(!Xe||t.getDragSession()==null||W.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Ot(),At(),t.setDragTarget(null))},$t=e=>{!Xe||t.getDragSession()==null||W.current||(e.preventDefault(),Nt(e.clientX,e.clientY),t.completeDrag(),kt(),Ot(),At(),H.current=null)},en=it.window.height,tn=it.window.offsetTop,nn=Math.min(0,ot-en),rn=Math.min(0,ot-en-dt),an=te===qe||F.current,on=qe!=null&&an&&!pt&&Je>=0?at[Je]??t.getVisibleRows(Je,Je)[0]??null:null,sn=on==null?null:gH(Je,s,st,en),cn=H.current,ln=et!=null&&cn!=null&&cn.path===et&&cn.index>=st.start&&cn.index<=st.end,un=et!=null&&cn!=null&&cn.path===et&&!ln&&cn.path!==on?.path?cn:null,dn=un==null?null:gH(un.index,s,st,en),fn=gU((Je>=0?at[Je]??t.getVisibleRows(Je,Je)[0]??null:null)?.ancestorPaths.at(-1)??null),pn=Ge&&qe!=null?jU(o,qe,!pt):void 0,mn=ue?.path??(Ge?qe:te),hn=ue?.path??ne,gn=ze(qt),_n=je&&Ne&&!Jt&&!We&&gn!=null&&ie!=null&&qt!=null,vn=je&&(_n||ue!=null),yn=ue?.anchorRect,bn=yn==null&&gn!=null&&ie!=null&&(ue!=null||_n)?ie:null,xn=yn==null?bn==null?void 0:{top:`${bn}px`}:{left:`${yn.left}px`,position:`fixed`,right:`auto`,top:`${yn.top}px`},Sn=Jt?{opacity:`0`}:void 0,Cn=HH((e,n,r,i)=>{let a=bH({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:Ge,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c);break}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=it.visible.startIndex&&n.index<=it.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(M.current=!0,X(e=>e===c?e:c),se(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&wt(c,{targetOffset:`sticky-parents`})},[t,Ge,it.visible.endIndex,it.visible.startIndex,wt]),wn=()=>{if(y.current||!Ne||qt==null||gn==null)return;let e=t.getItem(qt);e!=null&&(xt(gn),vt.current=!0,de({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:gn.getAttribute(`aria-label`)??qt,path:e.getPath()},path:e.getPath(),source:`button`}))},Tn={contextHoverPath:hn,contextMenuButtonTriggerEnabled:Ne,contextMenuButtonVisibility:Pe,contextMenuEnabled:je,contextMenuRightClickEnabled:Fe,contextMenuTriggerMode:Me,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:Xe,draggedPathSet:Qe,dragTarget:$e,gitLaneActive:Be,gitStatusByPath:n,handleRowDragEnd:Rt,handleRowDragStart:Lt,handleRowTouchStart:zt,ignoredGitDirectories:r,ignoredInheritanceCache:Y,instanceId:o,itemHeight:s,onKeyDown:Bt,onRowClick:Cn,openContextMenuForRow:St,registerButton:Ie,registerRenameInput:Re,renameView:He,renderDecorationForRow:mt,resolveIcon:Ve,shouldSuppressContextMenu:Tt,visualFocusPath:mn},En={...Tn,registerButton:Le};return DV(`div`,{ref:S,id:tt,"data-file-tree-context-menu-button-visibility":je&&Ne?Pe:void 0,"data-file-tree-context-menu-trigger-mode":je?Me:void 0,"data-file-tree-has-context-menu-action-lane":je&&Ne?`true`:void 0,"data-file-tree-has-git-lane":Be?`true`:void 0,"data-file-tree-virtualized-root":`true`,"data-file-tree-root-drag-target":$e?.kind===`root`?`true`:void 0,onDragLeave:Xe?Qt:void 0,onDragOver:Xe?Zt:void 0,onDrop:Xe?$t:void 0,onKeyDown:Bt,onPointerLeave:je?Xt:void 0,onPointerOver:je?Yt:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[DV(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:fn}}),DV(`slot`,{name:RF,"data-type":`header-slot`}),f?DV(`div`,{"data-file-tree-search-container":!0,"data-open":Ge?`true`:`false`,children:DV(`input`,{ref:w,"aria-activedescendant":pn,"aria-controls":tt,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Ce?`true`:void 0,value:Ke,onBlur:()=>{d===`retain`&&!Te.current||t.closeSearch()},onFocus:Ee,onPointerDown:Ee,onInput:e=>{Ee();let n=e.currentTarget;t.setSearch(n.value)}})}):null,DV(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&ke&&ct.length>0?DV(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:DV(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${nt}px`},children:ct.map((e,t)=>IU(En,e.row,`sticky:${ZH(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${ct.length-t}`}}))})}):null,DV(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${ut}px`},children:[DV(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${tn}px`}}),DV(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${en}px`,top:`${nn}px`,bottom:`${rn}px`},children:[LU(Tn,st,ft),on!=null&&sn!=null?IU(Tn,on,`parked:${on.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:et===on.path?`none`:void 0,position:`absolute`,right:`0`,top:`${sn}px`}}):null,un!=null&&dn!=null?IU(Tn,un,`parked-drag:${un.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${dn}px`}}):null]})]})]}),je?DV(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":vn?`true`:`false`,style:xn,children:[DV(`button`,{ref:v,type:`button`,"data-type":BF,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":ue==null?`false`:`true`,"data-visible":_n?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),ue!=null){bt();return}wn()},tabIndex:-1,style:Sn,children:DV(jV,{...Ve(`file-tree-icon-ellipsis`)})}),ue==null?null:DV(`slot`,{name:zF})]}):null,ue==null?null:DV(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),bt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),bt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var zU={hydrateRoot:(e,t)=>{TV(tV(RU,t),e)},renderRoot:(e,t)=>{wV(tV(RU,t),e)},unmountRoot:e=>{wV(null,e)}};function BU(e,t){zU.renderRoot(e,t)}function VU(e,t){zU.hydrateRoot(e,t)}function HU(e){zU.unmountRoot(e)}var UU=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#r(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#r(e,t)}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}},WU=`__c`,GU=`__k`,KU=`__d`,qU=`__s`,JU=/[\s\n\\/='"\0<>]/,YU=/^(xlink|xmlns|xml)([A-Z])/,XU=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,ZU=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,QU=new Set([`draggable`,`spellcheck`]);function $U(e){e.__g===void 0?e[KU]=!0:e.__g|=8}function eW(e){e.__g===void 0?e[KU]=!1:e.__g&=-9}function tW(e){return e.__g===void 0?!0===e[KU]:!!(8&e.__g)}var nW=/["&<]/;function rW(e){if(e.length===0||!1===nW.test(e))return e;for(var t=0,n=0,r=``,i=``;n<e.length;n++){switch(e.charCodeAt(n)){case 34:i=`&quot;`;break;case 38:i=`&amp;`;break;case 60:i=`&lt;`;break;default:continue}n!==t&&(r+=e.slice(t,n)),r+=i,t=n+1}return n!==t&&(r+=e.slice(t,n)),r}var iW={},aW=new Set(`animation-iteration-count.border-image-outset.border-image-slice.border-image-width.box-flex.box-flex-group.box-ordinal-group.column-count.fill-opacity.flex.flex-grow.flex-negative.flex-order.flex-positive.flex-shrink.flood-opacity.font-weight.grid-column.grid-row.line-clamp.line-height.opacity.order.orphans.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.widows.z-index.zoom`.split(`.`)),oW=/[A-Z]/g;function sW(e){var t=``;for(var n in e){var r=e[n];if(r!=null&&r!==``){var i=n[0]==`-`?n:iW[n]||(iW[n]=n.replace(oW,`-$&`).toLowerCase()),a=`;`;typeof r!=`number`||i.startsWith(`--`)||aW.has(i)||(a=`px;`),t=t+i+`:`+r+a}}return t||void 0}function cW(){this.__d=!0}function lW(e,t){return{__v:e,context:t,props:e.props,setState:cW,forceUpdate:cW,__d:!0,__h:[]}}function uW(e,t,n){if(!e.s){if(n instanceof dW){if(!n.s)return void(n.o=uW.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(uW.bind(null,e,t),uW.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}var dW=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var a=1&i?t:n;if(a){try{uW(r,1,a(this.v))}catch(e){uW(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?uW(r,1,t?t(i):i):n?uW(r,1,n(i)):uW(r,2,i)}catch(e){uW(r,2,e)}},r},e}(),fW,pW,mW,hW,gW={},_W=Array.isArray,vW=Object.assign,yW=``,bW=`<!--$s-->`,xW=`<!--/$s-->`;function SW(e,t){var n,r=e.type,i=!0;return e[WU]?(i=!1,(n=e[WU]).state=n[qU]):n=new r(e.props,t),e[WU]=n,n.__v=e,n.props=e.props,n.context=t,$U(n),n.state??=gW,n[qU]??(n[qU]=n.state),r.getDerivedStateFromProps?n.state=vW({},n.state,r.getDerivedStateFromProps(n.props,n.state)):i&&n.componentWillMount?(n.componentWillMount(),n.state=n[qU]===n.state?n.state:n[qU]):!i&&n.componentWillUpdate&&n.componentWillUpdate(),mW&&mW(e),n.render(n.props,n.state,t)}function CW(e,t,n,r,i,a,o){if(e==null||!0===e||!1===e||e===yW)return yW;var s=typeof e;if(s!=`object`)return s==`function`?yW:s==`string`?rW(e):e+yW;if(_W(e)){var c,l=yW;i[GU]=e;for(var u=e.length,d=0;d<u;d++){var f=e[d];if(f!=null&&typeof f!=`boolean`){var p,m=CW(f,t,n,r,i,a,o);typeof m==`string`?l+=m:(c||=Array(u),l&&c.push(l),l=yW,_W(m)?(p=c).push.apply(p,m):c.push(m))}}return c?(l&&c.push(l),c):l}if(e.constructor!==void 0)return yW;e.__=i,fW&&fW(e);var h=e.type,g=e.props;if(typeof h==`function`){var _,v,y,b=t;if(h===rV){if(`tpl`in g){for(var x=yW,S=0;S<g.tpl.length;S++)if(x+=g.tpl[S],g.exprs&&S<g.exprs.length){var C=g.exprs[S];if(C==null)continue;typeof C!=`object`||C.constructor!==void 0&&!_W(C)?x+=C:x+=CW(C,t,n,r,e,a,o)}return x}if(`UNSTABLE_comment`in g)return`<!--`+rW(g.UNSTABLE_comment)+`-->`;v=g.children}else{if((_=h.contextType)!=null){var w=t[_.__c];b=w?w.props.value:_.__}var T=h.prototype&&typeof h.prototype.render==`function`;if(T)v=SW(e,b),y=e[WU];else{e[WU]=y=lW(e,b);for(var E=0;tW(y)&&E++<25;){eW(y),mW&&mW(e);try{v=h.call(y,g,b)}catch(t){throw a&&t&&typeof t.then==`function`&&(e._suspended=!0),t}}$U(y)}if(y.getChildContext!=null&&(t=vW({},t,y.getChildContext())),T&&zB.errorBoundaries&&(h.getDerivedStateFromError||y.componentDidCatch)){v=v!=null&&v.type===rV&&v.key==null&&v.props.tpl==null?v.props.children:v;try{return CW(v,t,n,r,e,a,!1)}catch(i){return h.getDerivedStateFromError&&(y[qU]=h.getDerivedStateFromError(i)),y.componentDidCatch&&y.componentDidCatch(i,gW),tW(y)?(v=SW(e,t),(y=e[WU]).getChildContext!=null&&(t=vW({},t,y.getChildContext())),CW(v=v!=null&&v.type===rV&&v.key==null&&v.props.tpl==null?v.props.children:v,t,n,r,e,a,o)):yW}finally{pW&&pW(e),hW&&hW(e)}}}v=v!=null&&v.type===rV&&v.key==null&&v.props.tpl==null?v.props.children:v;try{var D=CW(v,t,n,r,e,a,o);return pW&&pW(e),zB.unmount&&zB.unmount(e),e._suspended?typeof D==`string`?bW+D+xW:_W(D)?(D.unshift(bW),D.push(xW),D):D.then(function(e){return bW+e+xW}):D}catch(i){if(!a&&o&&o.onError){var O=function i(s){return o.onError(s,e,function(e,s){try{return CW(e,t,n,r,s,a,o)}catch(e){return i(e)}})}(i);if(O!==void 0)return O;var k=zB.__e;return k&&k(i,e),yW}if(!a||!i||typeof i.then!=`function`)throw i;return i.then(function i(){try{var s=CW(v,t,n,r,e,a,o);return e._suspended?bW+s+xW:s}catch(e){if(!e||typeof e.then!=`function`)throw e;return e.then(i)}})}}var A,j=`<`+h,M=yW;for(var N in g){var P=g[N];if(typeof(P=TW(P)?P.value:P)!=`function`||N===`class`||N===`className`){switch(N){case`children`:A=P;continue;case`key`:case`ref`:case`__self`:case`__source`:continue;case`htmlFor`:if(`for`in g)continue;N=`for`;break;case`className`:if(`class`in g)continue;N=`class`;break;case`defaultChecked`:N=`checked`;break;case`defaultSelected`:N=`selected`;break;case`defaultValue`:case`value`:switch(N=`value`,h){case`textarea`:A=P;continue;case`select`:r=P;continue;case`option`:r!=P||`selected`in g||(j+=` selected`)}break;case`dangerouslySetInnerHTML`:M=P&&P.__html;continue;case`style`:typeof P==`object`&&(P=sW(P));break;case`acceptCharset`:N=`accept-charset`;break;case`httpEquiv`:N=`http-equiv`;break;default:if(YU.test(N))N=N.replace(YU,`$1:$2`).toLowerCase();else{if(JU.test(N))continue;N[4]!==`-`&&!QU.has(N)||P==null?n?ZU.test(N)&&(N=N===`panose1`?`panose-1`:N.replace(/([A-Z])/g,`-$1`).toLowerCase()):XU.test(N)&&(N=N.toLowerCase()):P+=yW}}P!=null&&!1!==P&&(j=!0===P||P===yW?j+` `+N:j+` `+N+`="`+(typeof P==`string`?rW(P):P+yW)+`"`)}}if(JU.test(h))throw Error(h+` is not a valid HTML tag name in `+j+`>`);if(M||(typeof A==`string`?M=rW(A):A!=null&&!1!==A&&!0!==A&&(M=CW(A,t,h===`svg`||h!==`foreignObject`&&n,r,e,a,o))),pW&&pW(e),hW&&hW(e),!M&&wW.has(h))return j+`/>`;var F=`</`+h+`>`,I=j+`>`;return _W(M)?[I].concat(M,[F]):typeof M==`string`?I+M+F:[I,M,F]}var wW=new Set([`area`,`base`,`br`,`col`,`command`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function TW(e){return typeof e==`object`&&!!e&&typeof e.peek==`function`&&`value`in e}var EW=0;function DW(e){return e!=null&&e.length>0?e:(EW+=1,`pst_ft_${EW}`)}function OW({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??Iz)}function kW(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function AW(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function jW(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var MW=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new UU;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=DW(a),this.#p=RB(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=Fz(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new NB({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(HU(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){this.#t.resetPaths(e,t)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),BU(t.wrapper,this.#w()))}setGitStatus(e){this.#p=RB(e,this.#p);let t=this.#T();t!=null&&BU(t.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),BU(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),VU(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),BU(r,this.#w())}#C(){return{initialViewportHeight:OW({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;if(e!=null){this.#l.setSlotContent(RF,e());return}this.#l.setSlotHtml(RF,this.#e?.header?.html??null)}#k(e){let t=jW(e).find(e=>AW(e)),n=kW(OF(HF(this.#m).set));n!=null&&(t!=null&&t.outerHTML===n.outerHTML||(t==null?e.prepend(n):t.replaceWith(n)))}#A(e){let t=jW(e),n=t.find(e=>AW(e)),r=t.filter(e=>e!==n),i=HF(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=kW(i);if(a==null){for(let e of r)e.remove();return}if(!(r.length===1&&r[0].outerHTML===a.outerHTML)){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=HF(this.#m);t.colored&&AF(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${PF}]`);if(this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``){this.#g?.remove(),this.#g=void 0,this.#_=void 0;return}this.#g?.parentNode===e&&this.#_===this.#h||(this.#g??=document.createElement(`style`),this.#g.setAttribute(PF,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=Bz(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return Kz(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}},NW=typeof window>`u`?Q.useEffect:Q.useLayoutEffect;function PW(e,t,n){let r=e==null?null:(0,Z.jsx)(`div`,{slot:RF,children:e}),i=t!=null&&n!=null?(0,Z.jsx)(`div`,{slot:zF,children:t(n.item,n.context)}):null;return r==null&&i==null?null:(0,Z.jsxs)(Z.Fragment,{children:[r,i]})}function FW(e,t){return typeof window>`u`&&t!=null?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t.shadowHtml}}),e]}):(0,Z.jsx)(Z.Fragment,{children:e})}function IW(e){let t=e.shadowRoot;return t?.querySelector(`[data-file-tree-id]`)instanceof HTMLElement||t?.querySelector(`[data-file-tree-id]`)instanceof SVGElement?!0:e.querySelector(`template[shadowrootmode="open"]`)instanceof HTMLTemplateElement}function LW(e,t,n,r,i){let a={...e??{}};if(t!=null&&delete a.header,n){let t=e?.contextMenu,n=t?.onClose,o=t?.onOpen;a.contextMenu={...t??{},enabled:!0,onClose:()=>{n?.(),r()},onOpen:(e,t)=>{i(e,t),o?.(e,t)}},delete a.contextMenu.render}return a.header!=null||a.contextMenu!=null?a:void 0}function RW({header:e,id:t,model:n,preloadedData:r,renderContextMenu:i,...a}){let[o,s]=(0,Q.useState)(null),[c,l]=(0,Q.useState)(null),u=(0,Q.useRef)(n.getComposition()),d=(0,Q.useRef)(n);d.current!==n&&(d.current=n,u.current=n.getComposition());let f=i!=null,p=(0,Q.useCallback)(()=>{s(null)},[]),m=(0,Q.useCallback)((e,t)=>{s({context:t,item:e})},[]),h=u.current,g=(0,Q.useMemo)(()=>LW(h,e,f,p,m),[h,p,m,f,e]),_=(0,Q.useCallback)(e=>{l(e)},[]);(0,Q.useEffect)(()=>{f||s(null)},[f]),NW(()=>{n.setComposition(g)},[g,n]),NW(()=>{if(c!=null)return r!=null&&IW(c)?n.hydrate({fileTreeContainer:c}):n.render({fileTreeContainer:c}),()=>{n.unmount(),n.setComposition(h)}},[h,c,n,r]);let v=FW(PW(e,i,o),r),y=t??r?.id,b={"--trees-item-height":`${String(n.getItemHeight())}px`,"--trees-density-override":n.getDensityFactor(),...a.style};return(0,Z.jsx)(MF,{...a,id:y,ref:_,style:b,suppressHydrationWarning:r!=null,children:v})}function zW(e){let[t]=(0,Q.useState)(()=>new MW(e)),n=(0,Q.useRef)({timeout:null,model:t});return(0,Q.useEffect)(()=>{let{current:e}=n;return e.timeout!=null&&(clearTimeout(e.timeout),e.timeout=null),()=>{e.timeout=setTimeout(()=>e.model.cleanUp(),1)}},[]),{model:t}}var BW={density:`compact`,flattenEmptyDirectories:!1},VW={"--trees-level-gap-override":`4px`,"--trees-item-row-gap-override":`4px`,"--trees-icon-width-override":`14px`,"--trees-item-height":`26px`,"--trees-indent-guide-bg-override":`color-mix(in oklab, var(--trees-fg-muted) 30%, transparent)`},HW=`
1866
+ }`}var Vz=new WeakMap;function Hz(e){let t=Vz.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(FF,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),Vz.set(e,i),i}function Uz(e,t){if(!e.isConnected)return;let n=Hz(t);if(n==null)return;let r=t.querySelector(`style[${IF}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(IF,``),t.appendChild(i)),i.textContent=`:host { ${LF}: ${n}px; }`}var Wz;function Gz(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){Wz??(Wz=new CSSStyleSheet,Wz.replaceSync(zz(Lz)));let t=!1;try{e.adoptedStyleSheets=[Wz],t=!0}catch{}if(t){e.querySelector(`style[${NF}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(NF,``),t.textContent=zz(Lz),e.prepend(t)}}function Kz(e,t){qz(e,t),Gz(t),Uz(e,t)}function qz(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});Kz(this,e)}}if(customElements.define(MF,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(MF)))e instanceof HTMLElement&&Kz(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var Jz=e=>e.startsWith(`f::`)?e.slice(3):e;function Yz(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function Xz(e,t){return e===``?t:`${e}/${t}`}function Zz({files:e,path:t,isFolder:n,nextBasename:r}){let i=Jz(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=Yz(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=Xz(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function Qz(e){return e.endsWith(`/`)}function $z(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function eB(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function tB(e,t){return t.includes(e)?eB(t):[e]}function nB(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function rB(e,t){return{draggedPaths:e,target:t}}function iB(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(Qz(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function aB(e,t){return t.kind===`root`||t.directoryPath==null?$z(e):t.directoryPath}function oB(e,t){let n=e.map(e=>{let n=aB(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}function sB(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function cB(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!sB(Mz.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function lB(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function uB(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function dB(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function fB(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return dB(e,t.path)?n?e:null:e;case`move`:return uB(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=fB(r,e,n),r==null)return null;return r}}}function pB(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function mB(e){switch(e.operation){case`add`:return{...pB(e),operation:`add`,path:e.path};case`remove`:return{...pB(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...pB(e),from:e.from,operation:`move`,to:e.to}}}function hB(e){return{...pB(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>mB(e)),operation:`batch`}}function gB(e){switch(e.operation){case`add`:case`remove`:case`move`:return mB(e);case`batch`:return hB(e);default:return null}}function _B(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function vB(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function yB(e){return vB(e).at(-1)??null}function bB(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function xB(e){return e.endsWith(`/`)}var SB=e=>e.toLowerCase();function CB(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function wB(e){return e.endsWith(`/`)?e.slice(0,-1):e}function TB(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var EB=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},DB=Symbol(`FILE_TREE_RENAME_VIEW`),OB=512,kB=512;function AB(e){return e===`top`||e===`center`?e:`nearest`}function jB(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=vB(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function MB(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:jB(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var NB=class{#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=0;#z=null;#B=new Set;#V=0;#H;#U=0;#W=!1;#G=0;#K;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=cB({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#H=this.#le(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ne(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#B=new Set(d),this.#z=f,this.#V=1),this.#je(f,!1),r!=null&&this.#Te(r,!1),this.#K=this.#Re()}destroy(){this.#K?.(),this.#K=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#he()}focusFirstItem(){this.#be().length>0&&this.#Fe(0)}focusLastItem(){this.#G<=0||(this.#Ie(),this.#Fe(this.#G-1))}focusNextItem(){this.#Ae(1)}focusParentItem(){if(this.#c==null)return;let e=yB(this.#c);if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t)}focusPath(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;this.#Ie();let n=this.#Z(t);n>=0&&this.#Fe(n)}scrollToPath(e,t){let n=this.#H.getPathInfo(e)?.path??null;if(n==null)return;this.#Ie();let r=this.#xe(n);r<0||this.#Me(r)!=null&&(t?.focus!==!1&&this.#Fe(r,!1),this.#L={id:this.#R+=1,offset:AB(t?.offset),visibleIndex:r},this.#De())}focusMountedPathFromInput(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;let n=this.#Z(t);n>=0&&this.#Fe(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Z(t);return n>=0?(this.#Fe(n),this.#be()[n]??t):null}focusPreviousItem(){this.#Ae(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#Q(this.#c)}getFocusedPath(){return this.#c}getScrollRequest(){return this.#L}clearScrollRequest(e){this.#L?.id===e&&(this.#L=null)}resolveNearestVisiblePath(e){let t=this.#be();if(this.#G===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#H.getPathInfo(e)?.path??e,r=this.#Z(n);return r>=0?t[r]??n:this.#X(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#B]}getSelectionVersion(){return this.#V}getVisibleCount(){return this.#G}getVisibleRows(e,t){if(t<e||this.#G===0)return[];let n=Math.max(0,e),r=Math.min(this.#G-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=kB){let e=[];for(let t=n;t<=r;t+=1){let n=this.#H.getVisibleRowContext(t);if(n==null)break;e.push(this.#ee(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ie(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#Se(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];if(r!=null&&r===a+1){a=r;continue}if(i>=0&&this.#H.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null){i=-1,a=-1;continue}i=r,a=r}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#Se(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#$(o,i,a,{ancestorPaths:this.#re(a),path:s})})}return this.#H.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#$(e,r,r,{ancestorPaths:this.#re(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#G===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#G;r+=1){let i=e+r*t,a=Math.min(this.#G-1,Math.floor(i/t)),o=this.#te(a,r)??(a>0?this.#te(a-1,r):void 0);if(o==null)break;n.push({row:this.#ee(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#H.getPathInfo(e);return t==null?null:this.#Q(t.path,t)}resolveMountedDirectoryPathFromInput(e){let t=this.#H.getPathInfo(e);return t?.kind===`directory`?t.path:null}toggleMountedDirectoryFromInput(e){let t=this.resolveMountedDirectoryPathFromInput(e);t!=null&&this.#ze(t)}selectAllVisiblePaths(){this.#Ie();let e=[...this.#be()];this.#ae(e,this.#c??this.#z)}selectOnlyPath(e){let t=this.#Ne(e);t!=null&&this.#ae([t],t)}selectOnlyMountedPathFromInput(e){this.#ae([e],e)}selectPath(e){let t=this.#Ne(e);t==null||this.#B.has(t)||this.#ae([...this.#B,t])}deselectPath(e){let t=this.#Ne(e);t==null||!this.#B.has(t)||this.#ae([...this.#B].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.#ae([...this.#B].filter(e=>e!==t),t);return}this.#ae([...this.#B,t],t)}}selectPathRange(e,t){let n=this.#Ne(e);if(n==null)return;this.#Ie();let r=this.#z,i=r==null?-1:this.#Ce(r),a=this.#Ce(n);if(i===-1||a===-1){let e=t?[...this.#B,n]:[n];this.#ae(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#be().slice(o,s+1),l=t?[...this.#B,...c]:c;this.#ae(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#G-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ie();let r=this.#be(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#B);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#ae([...o],this.#z??i,!1),this.#Fe(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ne(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=tB(t,n);return this.#r.canDrag?.(r)===!1?!1:(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=rB(t.draggedPaths,n);(iB(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}nB(t.target,n)||(this.#i={...t,target:n},this.#De())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#De())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#De(),!1;let n=rB(e.draggedPaths,t);if(iB(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=oB(e.draggedPaths,t);if(r==null)return this.#De(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#H.move(e.from,e.to,{collision:e.collision})}else this.#ce(r.operations),this.#H.batch(r.operations)}catch(e){return this.#De(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#H.add(e)}remove(e,t={}){this.#H.remove(e,t)}move(e,t,n={}){this.#H.move(e,t,n)}batch(e){this.#H.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Te(e,!0)}openSearch(e=``){this.#Te(e,!0)}closeSearch(){this.#Te(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#we(1)}focusPreviousSearchMatch(){this.#we(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#H.getPathInfo(e);if(n==null)return!1;let r=n.path,i=xB(r),a=wB(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of vB(r))this.#H.isExpanded(e)||this.#H.expand(e);return this.#ae([r],r,!1),this.#M!=null&&(this.#Te(null,!1),this.#y?.(this.#M)),this.#Pe(r),this.#T=r,this.#E=CB(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}[DB](){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}}#q(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,xB(e)?{recursive:!0}:void 0);return}this.#Pe(e),this.#De()}#J(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,xB(e)?{recursive:!0}:void 0);return}let t=xB(e),n=Zz({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:wB(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#Pe(e),this.#v?.(n.error),this.#De();return}if(n.sourcePath===n.destinationPath){this.#Pe(e),this.#De();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(TB(n.sourcePath,t),TB(n.destinationPath,t))}#Y(e){this.#T==null||this.#E===e||(this.#E=e,this.#De())}resetPaths(e,t={}){let n=this.#H.list().length,r=this.#G,i=cB({paths:e,preparedInput:t.preparedInput},`resetPaths`,this.#e.sort),a=this.#le(i.paths,i.preparedInput,t.initialExpandedPaths),o=this.#c,s=this.#T,c=this.getSelectedPaths(),l=this.#z;this.#K?.(),this.#H=a,this.#d.clear(),this.#he();let u=c.map(e=>a.getPathInfo(e)?.path??null).filter(e=>e!=null),d=!_B(this.#B,u);this.#B=new Set(u),d&&(this.#V+=1),this.#z=l==null?null:a.getPathInfo(l)?.path??null,this.#T=s==null?null:a.getPathInfo(s)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(o,o!=null||u.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:i.paths.length,pathCountBefore:n,projectionChanged:!0,usedPreparedInput:t.preparedInput!=null,visibleCountDelta:this.#G-r})}#X(e){this.#Ie();let t=yB(e),n=bB(e,t),r=null,i=null;for(let e of this.#be()){if(yB(e)!==t)continue;let a=bB(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Z(e){let t=this.#Ce(e);if(t!==-1)return t;let n=vB(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#Ce(t);if(r!==-1)return r}return this.#be().length>0?0:-1}#Q(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#H.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#oe(r.path):this.#se(r.path);return this.#d.set(r.path,i),i}#$(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#B.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#ee(e){return this.#$(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#te(e,t){let n=this.#H.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ne(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ne(n),n];return this.#a.set(e,r),r}#re(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ne(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ie(e){this.#H.collapse(e)}#ae(e,t=this.#z,n=!0){let r=[...new Set(e)],i=!_B(this.#B,r),a=this.#z!==t;!i&&!a||(this.#B=new Set(r),this.#z=t,i&&(this.#V+=1),n&&this.#De())}#oe(e){return{collapse:()=>{this.#ie(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#ke(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#H.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#ze(e)}}}#se(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#ce(e){let t=this.#H.list();this.#le(t).batch(e)}#le(e,t,n){return new Mz({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ue(){return this.#h??=this.#H.list(),this.#h}#de(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ue()){e.add(t);for(let n of vB(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(SB),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(SB),this.#p}#he(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#ge(){return this.#pe().filter(e=>this.#H.isExpanded(e))}#_e(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#B)for(let n of vB(e))t.add(n);this.#ve(t)}#ve(e){this.#W=!0;try{for(let t of this.#pe()){let n=e.has(t),r=this.#H.isExpanded(t);n&&!r?this.#H.expand(t):!n&&r&&this.#H.collapse(t)}}finally{this.#W=!1}}#ye(){if(this.#M==null||this.#M.length===0){this.#k=[],this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#G=n.length}#be(){return this.#I??this.#b}#xe(e){return this.#I==null?this.#H.getVisibleIndex(e)??-1:this.#P?.get(e)??-1}#Se(e){return this.#F?.[e]??e}#Ce(e){return this.#P?.get(e)??this.#H.getVisibleIndex(e)??-1}#we(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Te(e,t){let n=e==null?null:EB(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#ge()),this.#M=n,n==null)this.#_e(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else if(n.length===0)this.#_e(!1),this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else{let e=this.#Ee();this.#je(e,!0)}t&&(this.#y?.(this.#M),this.#De())}}#Ee(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ue(),n=this.#fe(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#pe(),s=this.#me();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of vB(e))l.add(t),c?.add(t)}return this.#ve(l),a??this.#c}#De(){for(let e of this.#t)e()}#Oe(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#ke(e){for(let t of vB(e))this.#H.isExpanded(t)||this.#H.expand(t);this.#H.isExpanded(e)||this.#H.expand(e)}#Ae(e){let t=this.#G;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ie(),this.#Fe(r))}#je(e,t=!0){let n=this.#H.getVisibleCount();this.#U=n;let r=MB(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,OB)),e,t?e=>this.#H.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#ye(),this.#s=e==null?this.#be().length>0?0:-1:this.#Z(e),this.#c=this.#s<0?null:this.#Me(this.#s)}#Me(e){return this.#be()[e]??(this.#F==null?this.#H.getVisibleRowContext(e)?.row.path??null:null)}#Ne(e){return this.#H.getPathInfo(e)?.path??null}#Pe(e){if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t,!1)}#Fe(e,t=!0){let n=this.#Me(e);n!=null&&(this.#s===e&&this.#c===n||(this.#s=e,this.#c=n,t&&this.#De()))}#Ie(){this.#l||this.#je(this.#c,!0)}#Le(e){let t=fB(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=fB(this.#c,e,!0),r=[...this.#B].map(t=>fB(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=fB(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return _B(this.#B,o)||(this.#B=new Set(o),this.#V+=1),this.#z=a,n}#Re(){return this.#H.on(`*`,e=>{if(this.#W)return;e.canonicalChanged&&(this.#d.clear(),this.#he()),this.#i!=null&&lB(e)&&(this.#i=null);let t=lB(e)?this.#Le(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ee():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#je(n,r),this.#De();let i=gB(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},PB=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function FB(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1){if(!(e[t]===`/`||t===e.length)){r===-1&&(r=t);continue}r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1)}return n===``?null:{isDirectory:t,path:n}}function IB(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function LB(e,t){return t?`${e}/`:e}function RB(e,t=null){let n=PB(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set;for(let t of e??[]){let e=FB(t.path);if(e==null)continue;let n=LB(e.path,e.isDirectory);r.set(n,t.status),t.status===`ignored`&&e.isDirectory?a.add(n):e.isDirectory&&a.delete(n);for(let t of IB(e.path))i.add(t)}return{directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}var zB,BB,VB,HB,UB,WB,GB,KB,qB,JB,YB={},XB=[],ZB=Array.isArray,QB=XB.slice,$B=Object.assign;function eV(e){e&&e.parentNode&&e.remove()}function tV(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?QB.call(arguments,2):n),nV(e,o,r,i,null)}function nV(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++BB,__i:-1,__u:0};return i==null&&zB.vnode!=null&&zB.vnode(a),a}function rV(e){return e.children}function iV(e,t){this.props=e,this.context=t,this.__g=0}function aV(e,t){if(t==null)return e.__?aV(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?aV(e):null}function oV(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return oV(e)}}function sV(e){(8&e.__g||!(e.__g|=8)||!VB.push(e)||UB++)&&HB==zB.debounceRendering||((HB=zB.debounceRendering)||queueMicrotask)(cV)}function cV(){for(var e,t,n,r,i,a,o,s,c=1;VB.length;)VB.length>c&&VB.sort(WB),e=VB.shift(),c=VB.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=$B({},r)).__v=r.__v+1,zB.vnode&&zB.vnode(n),gV(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??aV(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,vV(a,n,o),n.__e!=i&&oV(n)));UB=0}function lV(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||XB,b=t.length;for(c=uV(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?YB:y[m.__i]||YB,m.__i=f,_=gV(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&xV(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=dV(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function uV(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?nV(null,o,null,null,null):ZB(o)?nV(rV,{children:o},null,null,null):o.constructor==null&&o.__b>0?nV(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=fV(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=aV(s)),SV(s,s));return r}function dV(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=dV(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=aV(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function fV(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function pV(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function mV(e,t,n,r,i){var a;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||pV(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||pV(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(GB,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=KB,e.addEventListener(t,a?JB:qB,a)):e.removeEventListener(t,a?JB:qB,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function hV(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=KB++;else if(t.u<n.l)return;return n(zB.event?zB.event(t):t)}}}function gV(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=zB.__b)&&d(t);n:if(typeof M==`function`)try{if(v=t.props,y=`prototype`in M&&M.prototype.render,b=(d=M.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new M(v,x):(t.__c=f=new iV(v,x),f.constructor=M,f.render=CV),b&&b.sub(f),f.props=v,f.state||={},f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&M.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=$B({},f.__s)),$B(f.__s,M.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&M.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&M.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=zB.__r,w=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),T=0;T<f._sb.length;T++)f.__h.push(f._sb[T]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++w<25);f.state=f.__s,f.getChildContext!=null&&(r=$B({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===rV&&d.key==null&&(E=yV(d.props.children)),s=lV(e,ZB(E)?E:[E],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null)if(e.then){for(D=0,O=!1,t.__u|=c?160:128,t.__c.__z=[],k=0;k<a.length;k++)(A=a[k])==null||O||(A.nodeType==8&&A.data==`$s`?(D>0&&t.__c.__z.push(A),D++,a[k]=null):A.nodeType==8&&A.data==`/$s`?(--D>0&&t.__c.__z.push(A),O=D===0,s=a[k],a[k]=null):D>0&&(t.__c.__z.push(A),a[k]=null));if(!O){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(j=a.length;j--;)eV(a[j]);_V(t)}else t.__e=n.__e,t.__k=n.__k,e.then||_V(t);zB.__e(e,t,n)}else s=t.__e=bV(n.__e,t,n,r,i,a,o,c,l,u);return(d=zB.diffed)&&d(t),128&t.__u?void 0:s}function _V(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(_V)}function vV(e,t,n){for(var r=0;r<n.length;r++)xV(n[r],n[++r],n[++r]);zB.__c&&zB.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){zB.__e(e,t.__v)}})}function yV(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:ZB(e)?e.map(yV):$B({},e)}function bV(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(zB.__m&&zB.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=QB.call(e.childNodes),v=n.props||YB,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;mV(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||mV(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),lV(b==`template`?e.content:e,ZB(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&aV(n,0),s,c,l),a!=null)for(u=a.length;u--;)eV(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||mV(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&mV(e,u,g,v[u],i))}return e}function xV(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){zB.__e(e,n)}}function SV(e,t,n){var r,i;if(zB.unmount&&zB.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||xV(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){zB.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&SV(r[i],t,n||typeof e.type!=`function`);n||eV(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function CV(e,t,n){return this.constructor(e,n)}function wV(e,t){var n,r,i,a;t==document&&(t=document.documentElement),zB.__&&zB.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=tV(rV,null,[e]),i=[],a=[],gV(t,e,r||YB,YB,t.namespaceURI,r?null:t.firstChild?QB.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),vV(i,e,a)}function TV(e,t){e.__u|=32,wV(e,t)}zB={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw UB=0,e}},BB=0,iV.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=$B({},this.state);typeof e==`function`&&(e=e($B({},n),this.props)),e&&$B(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),sV(this))},iV.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),sV(this))},iV.prototype.render=rV,VB=[],UB=0,WB=function(e,t){return e.__v.__b-t.__v.__b},GB=/(PointerCapture)$|Capture$/i,KB=0,qB=hV(!1),JB=hV(!0);var EV=0;Array.isArray;function DV(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--EV,__i:-1,__u:0,__source:i,__self:a};return zB.vnode&&zB.vnode(l),l}var OV=16,kV=16,AV={};function jV({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=AV[e]??{width:OV,height:kV},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return DV(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`},viewBox:m,width:f,height:p,children:DV(`use`,{href:c})})}var MV=e=>{if(e.length<2)return[e,``];let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]},NV=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},PV=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},FV=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},IV=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},LV=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function RV({children:e,marker:t,variant:n=`default`}){"use no memo";return DV(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:DV(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?DV(`span`,{"data-truncate-fade":!0}):t})})}function zV(e){"use no memo";let{mode:t,children:n}=e;return DV(`div`,{children:[DV(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?DV(`span`,{children:n}):n}),DV(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?DV(`span`,{children:n}):n})]})}function BV({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=DV(zV,{mode:t,children:e},`content`),o=DV(RV,{marker:n,mode:t,variant:r},`marker`),s=DV(`div`,{"data-truncate-fill":!0},`fill`);return DV(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:DV(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function VV({children:e,...t}){"use no memo";return DV(BV,{mode:`truncate`,...t,children:e})}function HV({children:e,...t}){"use no memo";return DV(BV,{mode:`fruncate`,...t,children:e})}function UV({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=DV(VV,{...s,children:t[0]}),l=DV(HV,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return DV(`div`,{className:a,style:o});if(e.length<i)return DV(n===`end`?HV:VV,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=MV:r===`extension`?t=NV:r===`leaf-path`&&(t=PV);else if(typeof r==`number`)t=FV,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=IV:e===`first`&&(t=LV)}else typeof r==`function`&&(t=r);t??=MV;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=DV(VV,{...s,..._,children:f}),l=DV(HV,{...s,...v,children:p})}return DV(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[DV(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),DV(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var WV={endIndex:-1,startIndex:-1};function GV(e,t,n){return Math.min(Math.max(e,t),n)}function KV(e,t){return e<0||t<e?WV:{endIndex:t,startIndex:e}}function qV(e){return e.startIndex<0||e.endIndex<e.startIndex}function JV(e,t){return qV(e)?0:(e.endIndex-e.startIndex+1)*t}function YV(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function XV(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function ZV(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);if(i==null){t.set(r,[n]);return}i.push(n)}),t}function QV(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;if(o<=t){i=a,n=a+1;continue}r=a-1}return i}function $V(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function eH(e,t,n){if(e.length===0||t<=0)return[];let r=$V(e),i=ZV(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=QV(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function tH(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=GV(t.scrollTop,0,o),c=t.stickyRows??eH(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=YV(s,n,t.itemHeight),m=YV(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?WV:KV(m,XV(u+d,n,t.itemHeight)),y=g+1,b=qV(v)?WV:KV(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=JV(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:qV(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var nH={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},rH={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},iH=`Contains git status items`;function aH(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function oH(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return aH({currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:a,viewportHeight:s});if(n<0)return null;let c=Math.max(0,a),l=n*r,u=Math.max(0,s-c),d=i===`center`?c+Math.max(0,(u-r)/2):c,f=Math.max(0,o-s),p=Math.max(0,Math.min(l-d,f));return p===t?null:p}function sH(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}function cH(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function lH(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function uH(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function dH(e,t){return e!=null&&e>0?e:t}function fH(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function pH(e,t,n,r,i=0){let a=aH({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a==null?!1:(e.scrollTop=a,!0)}function mH(e,t,n,r,i,a,o=0){let s=oH({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s==null?!1:(e.scrollTop=s,!0)}function hH(e,t,n,r,i,a){let o=sH({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o==null?!1:(e.scrollTop=o,!0)}function gH(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function _H(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function vH({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return DV(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function yH(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function bH(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}var xH,SH,CH,wH,TH=Object.is,EH=0,DH=[],OH=zB,kH=OH.__b,AH=OH.__r,jH=OH.diffed,MH=OH.__c,NH=OH.unmount,PH=OH.__;function FH(e,t){OH.__h&&OH.__h(SH,e,EH||t),EH=0;var n=SH.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function IH(e){return EH=1,LH(YH,e)}function LH(e,t,n){var r=FH(xH++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):YH(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);TH(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=SH,!SH.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,TH(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};SH.__f=!0;var a=SH.shouldComponentUpdate,o=SH.componentWillUpdate;SH.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},SH.shouldComponentUpdate=i}return r.__N||r.__}function RH(e,t){var n=FH(xH++,3);!OH.__s&&JH(n.__H,t)&&(n.__=e,n.u=t,SH.__H.__h.push(n))}function zH(e,t){var n=FH(xH++,4);!OH.__s&&JH(n.__H,t)&&(n.__=e,n.u=t,SH.__h.push(n))}function BH(e){return EH=5,VH(function(){return{current:e}},[])}function VH(e,t){var n=FH(xH++,7);return JH(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function HH(e,t){return EH=8,VH(function(){return e},t)}function UH(){for(var e;e=DH.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(KH),e.__H.__h.forEach(qH),e.__H.__h=[]}catch(t){e.__H.__h=[],OH.__e(t,e.__v)}}OH.__b=function(e){SH=null,kH&&kH(e)},OH.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),PH&&PH(e,t)},OH.__r=function(e){AH&&AH(e),xH=0;var t=(SH=e.__c).__H;t&&(CH===SH?(t.__h=[],SH.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(KH),t.__h.forEach(qH),t.__h=[],xH=0)),CH=SH},OH.diffed=function(e){jH&&jH(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(DH.push(t)!==1&&wH===OH.requestAnimationFrame||((wH=OH.requestAnimationFrame)||GH)(UH)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),CH=SH=null},OH.__c=function(e,t){t.some(function(e){try{e.__h.forEach(KH),e.__h=e.__h.filter(function(e){return!e.__||qH(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],OH.__e(n,e.__v)}}),MH&&MH(e,t)},OH.unmount=function(e){NH&&NH(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{KH(e)}catch(e){t=e}}),n.__H=void 0,t&&OH.__e(t,n.__v))};var WH=typeof requestAnimationFrame==`function`;function GH(e){var t,n=function(){clearTimeout(r),WH&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);WH&&(t=requestAnimationFrame(n))}function KH(e){var t=SH,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),SH=t}function qH(e){var t=SH;e.__c=e.__(),SH=t}function JH(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!TH(t,e[n])})}function YH(e,t){return typeof t==`function`?t(e):t}function XH(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:DV(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return DV(rV,{children:[DV(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:DV(VV,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function ZH(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function QH(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function $H(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function eU({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=tH(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:$H(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?$H(u,1,t,o):i&&r<=0&&c.length>0?eH(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var tU=400,nU=10,rU=40,iU=18;function aU(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?oU(e,t,n):a instanceof HTMLElement?a:null}function oU(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function sU(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return e?.closest?.(`[data-file-tree-virtualized-scroll]`)instanceof HTMLElement?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:null,kind:`root`}:null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function cU(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function lU(){return navigator.vendor!==`Apple Computer, Inc.`}function uU(e,t){let n=e-t.top;if(n<rU)return-Math.ceil((rU-Math.max(0,n))/rU*iU);let r=t.bottom-e;return r<rU?Math.ceil((rU-Math.max(0,r))/rU*iU):0}function dU(e,t){if(e!=null){let t=nH[e];return t==null?null:{text:t,title:rH[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:iH}:null}function fU(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function pU(e){return e!=null&&`toggle`in e}function mU(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function hU(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function gU(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function _U(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function vU(e,t){return t&&_U(e)||(e.ctrlKey||e.metaKey)&&mU(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var yU=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function bU(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function xU(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function SU(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function CU(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function wU(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function TU(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function EU(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function DU(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function OU(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=DU(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function kU(e,t){return{kind:e.kind,name:QH(e),path:t}}function AU(e){return e==null?void 0:`${e}__tree`}function jU(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function MU(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function NU(e,t){if(e==null)return null;if(`text`in e)return DV(`span`,{title:e.title,children:e.text});let n=typeof e.icon==`string`?MU(e.icon)?t(e.icon):{name:e.icon}:MU(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return DV(`span`,{title:e.title,children:DV(jV,{...n})})}function PU(e){e!=null&&cH(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function FU(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=ZH(e);return DV(rV,{children:[e.depth>0?DV(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>DV(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,DV(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?DV(jV,{...t(`file-tree-icon-chevron`)}):DV(jV,{...t(`file-tree-icon-file`,u)})}),DV(`div`,{"data-item-section":`content`,children:e.isFlattened?XH(e,c,a):c??DV(UV,{minimumLength:5,split:`extension`,children:e.name})}),i?DV(`div`,{"data-item-section":`decoration`,children:r==null?null:NU(r,t)}):null,s?DV(`div`,{"data-item-section":`git`,children:NU(o,t)}):null,n?DV(`div`,{"data-item-section":`action`,children:l?DV(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:DV(jV,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function IU(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:w,contextMenuButtonVisibility:T,contextMenuRightClickEnabled:E,registerRenameInput:D,registerButton:O,resolveIcon:k,renderDecorationForRow:A,openContextMenuForRow:j,onRowClick:M,onKeyDown:N}=e,P=ZH(t),{isParked:F=!1,mode:I=`flow`,style:L}=r,R=I===`sticky`,z=_?.get(P)??null??fU(t.ancestorPaths,v,y),B=t.kind===`directory`&&(b?.has(P)??!1),V=A(t,P),H=dU(z,B),U=S&&w,W=V!=null||x||U,G=U&&T===`always`,K=a.getPath()===P,q=K?a.getValue():``,J=R||!K?null:DV(vH,{ref:D,ariaLabel:`Rename ${QH(t)}`,isFlattened:t.isFlattened,value:q,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),Y=FU(t,k,{actionLaneEnabled:U,customDecoration:V,decorationLaneEnabled:W,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:H,gitLaneActive:x,renameInput:J,showDecorativeActionAffordance:G}),ee={...yH({ariaLabel:QH(t),domId:t.isFocused?jU(h,P,F):void 0,extraStyle:L,features:{actionLaneEnabled:U,contextMenuButtonVisibility:U?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:F,itemHeight:g,mode:I,row:t,state:{containsGitChange:B,effectiveGitStatus:z,isContextHovered:s===P,isDragTarget:l?.kind===`directory`&&l.directoryPath===P,isDragging:c?.has(P)===!0,isFocusRinged:t.isFocused&&o===P},targetPath:P}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),E&&(i.focusMountedPathFromInput(P),j(t,P,{anchorRect:SU(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:R?void 0:()=>{i.focusMountedPathFromInput(P)},onKeyDown:R?void 0:N,ref:e=>{O(P,e)}};return!R&&K?DV(`div`,{...ee,children:Y}):DV(`button`,{...ee,type:`button`,draggable:u&&!F,onDragEnd:u&&!F?p:void 0,onDragStart:u&&!F?e=>{f(e,t,P)}:void 0,onMouseDown:e=>{if(R){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!F?e=>{m(e,t,P)}:void 0,onClick:e=>{M(e,t,P,I)},children:Y})}function LU(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(ZH(e))).map((n,r)=>IU(e,n,t.start+r))}function RU({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=Iz,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=BH(null),v=BH(null),y=BH(!1),b=BH(null),x=BH(null),S=BH(null),C=BH(null),w=BH(null),T=BH(new Map),E=BH(new Map),D=BH(()=>{}),O=BH(null),k=BH(0),A=BH(!1),j=BH(null);j.current!==t&&(A.current=!1,j.current=t);let M=BH(!1),N=BH(null),P=BH(null),F=BH(!1),I=BH(null),L=BH(null),R=BH(null),z=BH(null),B=BH(null),V=BH(null),H=BH(null),U=BH(null),W=BH(!1),G=BH(null),K=BH(null),q=BH(null),J=BH(null),Y=VH(()=>new Map,[]),[,ee]=IH(0),[te,X]=IH(null),[ne,re]=IH(null),[ie,ae]=IH(null),[oe,se]=IH(null),[ce,le]=IH(0),[ue,de]=IH(null),fe=BH(ue);fe.current=ue;let pe=BH(null),me=BH(null),he=BH(null),ge=BH(null),_e=BH(null),ve=BH(!1),ye=()=>{me.current=null,he.current=null,ge.current=null},be=(e,t)=>{me.current=e,he.current=null,ge.current=t==null?null:{path:e,scrollTop:t}},xe=(e,t)=>{me.current=null,he.current={path:e,viewportOffset:t},ge.current=null},Se=BH(d===`retain`&&t.isSearchOpen()),[Ce,we]=IH(p);RH(()=>{p||we(!1)},[p]);let Te=BH(!1),Ee=HH(()=>{Te.current=!0,we(e=>e&&!1)},[]),[De,Oe]=IH(()=>eU({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[ke,Ae]=IH(!1);RH(()=>{Ae(!0)},[]);let je=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Me=e?.contextMenu?.triggerMode??(je?`right-click`:`both`),Ne=Me===`both`||Me===`button`,Pe=e?.contextMenu?.buttonVisibility??`when-needed`,Fe=Me===`both`||Me===`right-click`;zH(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;_e.current=t,re(t),se(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(ve.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let Ie=HH((e,t)=>{wU(T.current,e,t)},[]),Le=HH((e,t)=>{wU(E.current,e,t)},[]),Re=HH(e=>{x.current=e},[]),ze=HH(e=>TU(e,E.current,T.current),[]),Be=n!=null||r!=null||i!=null,{resolveIcon:Ve}=VH(()=>qF(a),[a]),He=t[DB](),Ue=He.getPath(),We=Ue!=null,Ge=t.isSearchOpen(),Ke=t.getSearchValue(),qe=t.getFocusedPath(),Je=t.getFocusedIndex(),Ye=t.getScrollRequest(),Xe=t.isDragAndDropEnabled(),Ze=t.getDragSession(),Qe=VH(()=>Ze==null?null:new Set(Ze.draggedPaths),[Ze]),$e=Ze?.target??null,et=Ze?.primaryPath??null,tt=AU(o),{overlayHeight:nt,overlayRows:rt,snapshot:it,visibleRows:at}=De,ot=it.physical.viewportHeight,st=VH(()=>({end:it.window.endIndex,start:it.window.startIndex}),[it.window.endIndex,it.window.startIndex]),ct=rt,lt=it.sticky.rows,ut=it.physical.totalHeight,dt=it.sticky.height,ft=VH(()=>new Set(lt.map(e=>ZH(e.row))),[lt]),pt=Je>=0&&Je>=st.start&&Je<=st.end,mt=HH((e,t)=>u?.({item:kU(e,t),row:e})??null,[u]),ht=HH(e=>cH(e==null?null:T.current.get(e)??null)?!0:cH(S.current),[]),gt=HH(e=>{ht(t.focusNearestPath(e))},[t,ht]),_t=BH(gt);_t.current=gt;let vt=BH(!0),yt=BH(()=>{}),bt=HH((t=!0)=>{let n=fe.current;n!=null&&(vt.current=vt.current&&t,de(null),e?.contextMenu?.onClose?.(),vt.current&&gt(n.path))},[e?.contextMenu,gt]);yt.current=bt;let xt=HH(e=>{let t=e==null?null:CU(S.current,e);ae(e=>e===t?e:t)},[]),St=HH((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=ze(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;be(n,e?.scrollTop??null),M.current=!0,X(e=>e===n?e:n)}i.focus(),xt(a),vt.current=!0,de({anchorRect:r?.anchorRect??null,item:kU(e,n),path:n,source:r?.source??`keyboard`})},[t,ze,xt]),Ct=HH(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=uH(e,ot);I.current=Je<0||e==null?null:Math.max(0,Math.min(Je*s-e.scrollTop,Math.max(0,t-s))),F.current=!0}t.startRenaming(e)!==!1&&(se(`focus`),ee(e=>e+1))}},[t,Je,s,l,ot]),wt=HH((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=uH(i,ot),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:eU({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return M.current=!0,hH(i,a,s,l,u,d),D.current(),pe.current=n?e:null,!0},[t,s,c,ot,h]),Tt=()=>y.current===!0||J.current!=null||W.current===!0,Et=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),Dt=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Ot=()=>{z.current!=null&&(clearTimeout(z.current),z.current=null),R.current=null},kt=()=>{V.current?.remove(),V.current=null},At=()=>{Dt(L.current),L.current=null,B.current=null},jt=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},Mt=()=>{U.current?.(),U.current=null,J.current!=null&&(clearTimeout(J.current),J.current=null),W.current=!1,G.current=null,q.current=null,K.current!=null&&(K.current.setAttribute(`draggable`,`true`),K.current.style.removeProperty(`touch-action`),K.current=null),kt(),Ot(),At(),H.current=null},Nt=(e,n)=>{let r=S.current?.getRootNode(),i=sU(aU(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Pt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Ot();return}let r=t.getItem(e.directoryPath),i=pU(r)?r:null;if(i==null||i.isExpanded()){Ot();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;R.current!==a&&(Ot(),R.current=a,z.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind!==`directory`||n.directoryPath!==e.directoryPath||n.flattenedSegmentPath!==e.flattenedSegmentPath||i.expand()},n))},Ft=()=>{L.current=null;let e=B.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=uU(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,D.current()),Pt(Nt(e.clientX,e.clientY)),L.current=Et(Ft)},It=(e,t)=>{B.current={clientX:e,clientY:t},L.current??=Et(Ft)},Lt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(Mt(),kt(),Ot(),At(),t.startDrag(r)===!1){e.preventDefault();return}if(H.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),lU())){let t=cU(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),jt(t),V.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Rt=()=>{kt(),Ot(),At(),H.current=null,t.cancelDrag()},zt=(e,n,r)=>{if(J.current!=null||W.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;q.current={clientX:i.clientX,clientY:i.clientY},K.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!W.current;J.current!=null&&(clearTimeout(J.current),J.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),U.current===o&&(U.current=null),t&&(a.setAttribute(`draggable`,`true`),K.current===a&&(K.current=null),q.current=null)},s=e=>{let t=e.touches[0],n=q.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=nU*nU||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),U.current=o,J.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),K.current===a&&(K.current=null),q.current=null;return}W.current=!0,K.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),H.current=n;let e=a.getBoundingClientRect(),s=cU(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),jt(s),V.current=s,G.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=G.current;n!=null&&V.current!=null&&(V.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Pt(Nt(t.clientX,t.clientY)),It(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&Nt(n.clientX,n.clientY),t.completeDrag(),Mt()},u=()=>{t.cancelDrag(),Mt()};U.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},tU)},Bt=e=>{if(ue!=null){if(e.key===`Escape`){bt(),e.preventDefault(),e.stopPropagation();return}yU.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(He.isActive()){if(e.key===`Escape`)He.cancel();else if(e.key===`Enter`)He.commit();else return;se(`focus`),ee(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Ct(qe??void 0),e.preventDefault(),e.stopPropagation();return}if(Ge){if(e.key===`Escape`)F.current=!1,I.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=uH(n,ot);I.current=Je<0||n==null?null:Math.max(0,Math.min(Je*s-n.scrollTop,Math.max(0,r-s))),F.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;se(`focus`),ee(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&hU(e)){t.openSearch(e.key),ee(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=je&&_U(e),r=vU(e,je),i=r&&S.current!=null?lH(S.current):null,a=r?new Set(EU(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==qe&&a.has(o)){let e=C.current;be(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=pU(p)?p:null,h=u!=null&&(ft.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=TU(u,E.current,T.current);e==null||n==null?y=!1:St(e,u)}else if((e.ctrlKey||e.metaKey)&&mU(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;se(`focus`);let b=t.getFocusedPath(),x=b!=null&&(ft.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))be(b,v?.scrollTop??null),M.current=!0,X(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(xe(b,OU(S.current,v,i,u,s,dt,ot)),M.current=!0,X(e=>e===b?e:b)):ye()}ee(e=>e+1),e.preventDefault(),e.stopPropagation()};zH(()=>{if(!(!f||!Ge)){if(Se.current){Se.current=!1;return}cH(w.current)}},[Ge,f]),zH(()=>{let e=x.current;switch(_H({hasRenderedInput:e!=null,previousRenamingPath:P.current,renamingPath:Ue})){case`reset`:P.current=null;return;case`reveal-canonical`:Ue!=null&&wt(Ue,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(pe.current=null,P.current=Ue,cH(e),e.select());return}},[st.end,st.start,Ue,wt,ft]),zH(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=lH(e)?.dataset.itemPath??null;X(e=>e===t?e:t)},i=()=>{n(),M.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,lH(e)!=null){r();return}M.current=!1,X(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),M.current=!1,X(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;X(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),zH(()=>{let e=S.current;e!=null&&(it.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[it.physical.scrollTop]),zH(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=uH(n,g);let a=()=>{let e=t.getVisibleCount(),r=dH(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Oe(eU({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!A.current){A.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=dH(O.current,g),i=t.getVisibleRows(e,e)[0]??null;pH(n,e,s,r,h&&i!=null?Math.max(0,Math.min(i.ancestorPaths.length*s,Math.max(0,r-s))):0)}}D.current=a;let o=!1,l=t.subscribe(()=>{o?ee(e=>e+1):o=!0,a()}),u=()=>{ve.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,le(e=>e+1),e=null},50))},d=null,f=()=>{i!=null&&delete i.dataset.overlayReveal,d!=null&&(clearTimeout(d),d=null)},p=()=>{i==null||ve.current===!0||n.scrollTop>0||(i.dataset.overlayReveal=`true`,d!=null&&clearTimeout(d),d=setTimeout(()=>{f()},200))},m=()=>{if(a(),n.scrollTop>0&&f(),fe.current!=null&&y.current&&yt.current(),ve.current===!0){y.current=!1;return}re(e=>e==null?e:null),u()},_=()=>{u(),p()},v=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),x=e=>{v.has(e.key)&&_()};n.addEventListener(`scroll`,m,{passive:!0}),n.addEventListener(`wheel`,_,{passive:!0}),n.addEventListener(`touchmove`,_,{passive:!0}),n.addEventListener(`keydown`,x);let w=typeof ResizeObserver<`u`?new ResizeObserver(e=>{O.current=(e[0]==null?null:fH(e[0]))??uH(n,g),a()}):null;return w?.observe(n),()=>{D.current=()=>{},l(),n.removeEventListener(`scroll`,m),n.removeEventListener(`wheel`,_),n.removeEventListener(`touchmove`,_),n.removeEventListener(`keydown`,x),e!=null&&clearTimeout(e),d!=null&&clearTimeout(d),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,O.current=null,w?.disconnect()}},[t,g,s,c,h]),zH(()=>{je||ue==null||bt(!1)},[bt,je,ue]);let Vt=VH(()=>ue==null?null:`${ue.path}::${ue.source}`,[ue]);zH(()=>{if(Vt==null){m?.clearSlotContent(zF);return}let t=fe.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??xU(n.getBoundingClientRect()),close:e=>{yt.current(e?.restoreFocus??!0)},restoreFocus:()=>{vt.current&&_t.current(fe.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(zF,i),e?.contextMenu?.onOpen?.(t.item,r),PU(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&PU(i)}),()=>{m?.clearSlotContent(zF)}},[Vt,e?.contextMenu,m]),zH(()=>{ue!=null&&t.getItem(ue.path)==null&&bt()},[bt,ue,t]),zH(()=>{if(ue==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(bU(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&bt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),bt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[bt,ue]),zH(()=>{let e=C.current,n=S.current;if(e==null||n==null){N.current=qe;return}let r=qe==null?null:T.current.get(qe)??null,i=lH(n),a=i?.dataset.itemPath??null,o=We&&x.current===i,c=f&&w.current===i,l=F.current&&!Ge,u=I.current??0,d=pe.current,p=me.current,m=he.current,g=ge.current,_=i!=null,v=M.current||_,y=N.current!==qe,b=p!=null&&p===qe&&qe!=null,E=!1,O=!1;if(Ye!=null&&Ye.id!==k.current){k.current=Ye.id;let n=Ye.visibleIndex,r=t.getVisibleRows(n,n)[0]??null;if(r!=null){let t=h?Math.max(0,Math.min(r.ancestorPaths.length*s,Math.max(0,ot-s))):dt;E=!0,O=mH(e,n,s,ot,ut,Ye.offset,t)}t.clearScrollRequest(Ye.id)}let A=!E&&l&&hH(e,Je,s,ot,ut,u),j=!E&&d!=null&&d===qe&&hH(e,Je,s,ot,ut,dt),P=!E&&m!=null&&m.path===qe&&hH(e,Je,s,ot,ut,m.viewportOffset),L=!E&&g!=null&&g.path===qe&&e.scrollTop!==g.scrollTop;if(L&&(e.scrollTop=g.scrollTop),(L||O||j||P||A||v&&y&&d!==qe&&!b&&pH(e,Je,s,ot,dt))&&D.current(),E){N.current=qe;return}if(!v){N.current=qe;return}if(o){N.current=qe;return}if(c&&!l){N.current=qe;return}if(r==null){l&&Je>=0&&(hH(e,Je,s,ot,ut,u),D.current()),N.current=qe;return}(y||l||d===qe||p===qe||m?.path===qe||g?.path===qe||a==null||a!==qe)&&(cH(r),d===qe&&(pe.current=null),p===qe&&(me.current=null),m?.path===qe&&(he.current=null),g?.path===qe&&(ge.current=null),F.current=!1,I.current=null),N.current=qe},[t,Je,qe,pt,s,We,Ge,st,ot,f,Ye,h,dt,ut,at]);let Ht=Je>=0&&Je>=it.visible.startIndex&&Je<=it.visible.endIndex,Ut=qe!=null&&ct.some(e=>ZH(e.row)===qe),Wt=Ht||Ut,Gt=Ne&&M.current===!0&&Wt?qe:null,Kt=oe===`pointer`?ne:null,qt=ue?.path??_e.current??Kt??Gt??ne,Jt=ue?.source===`right-click`;zH(()=>{y.current&&ue==null||xt(ze(qt))},[ue,ze,st,ot,ce,ct,qt,xt,at]);let Yt=HH(e=>{if(y.current||bU(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&se(e=>e===`pointer`?e:`pointer`),re(e=>e===i?e:i)},[]),Xt=HH(()=>{re(null)},[]);zH(()=>{if(!Xe)return;let e=()=>{Mt(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),Mt(),t.cancelDrag()}},[t,Xe]);let Zt=e=>{if(!Xe||t.getDragSession()==null||W.current)return;let n=sU(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Pt(t.getDragSession()?.target??null),It(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},Qt=e=>{if(!Xe||t.getDragSession()==null||W.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Ot(),At(),t.setDragTarget(null))},$t=e=>{!Xe||t.getDragSession()==null||W.current||(e.preventDefault(),Nt(e.clientX,e.clientY),t.completeDrag(),kt(),Ot(),At(),H.current=null)},en=it.window.height,tn=it.window.offsetTop,nn=Math.min(0,ot-en),rn=Math.min(0,ot-en-dt),an=te===qe||F.current,on=qe!=null&&an&&!pt&&Je>=0?at[Je]??t.getVisibleRows(Je,Je)[0]??null:null,sn=on==null?null:gH(Je,s,st,en),cn=H.current,ln=et!=null&&cn!=null&&cn.path===et&&cn.index>=st.start&&cn.index<=st.end,un=et!=null&&cn!=null&&cn.path===et&&!ln&&cn.path!==on?.path?cn:null,dn=un==null?null:gH(un.index,s,st,en),fn=gU((Je>=0?at[Je]??t.getVisibleRows(Je,Je)[0]??null:null)?.ancestorPaths.at(-1)??null),pn=Ge&&qe!=null?jU(o,qe,!pt):void 0,mn=ue?.path??(Ge?qe:te),hn=ue?.path??ne,gn=ze(qt),_n=je&&Ne&&!Jt&&!We&&gn!=null&&ie!=null&&qt!=null,vn=je&&(_n||ue!=null),yn=ue?.anchorRect,bn=yn==null&&gn!=null&&ie!=null&&(ue!=null||_n)?ie:null,xn=yn==null?bn==null?void 0:{top:`${bn}px`}:{left:`${yn.left}px`,position:`fixed`,right:`auto`,top:`${yn.top}px`},Sn=Jt?{opacity:`0`}:void 0,Cn=HH((e,n,r,i)=>{let a=bH({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:Ge,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c);break}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=it.visible.startIndex&&n.index<=it.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(M.current=!0,X(e=>e===c?e:c),se(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&wt(c,{targetOffset:`sticky-parents`})},[t,Ge,it.visible.endIndex,it.visible.startIndex,wt]),wn=()=>{if(y.current||!Ne||qt==null||gn==null)return;let e=t.getItem(qt);e!=null&&(xt(gn),vt.current=!0,de({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:gn.getAttribute(`aria-label`)??qt,path:e.getPath()},path:e.getPath(),source:`button`}))},Tn={contextHoverPath:hn,contextMenuButtonTriggerEnabled:Ne,contextMenuButtonVisibility:Pe,contextMenuEnabled:je,contextMenuRightClickEnabled:Fe,contextMenuTriggerMode:Me,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:Xe,draggedPathSet:Qe,dragTarget:$e,gitLaneActive:Be,gitStatusByPath:n,handleRowDragEnd:Rt,handleRowDragStart:Lt,handleRowTouchStart:zt,ignoredGitDirectories:r,ignoredInheritanceCache:Y,instanceId:o,itemHeight:s,onKeyDown:Bt,onRowClick:Cn,openContextMenuForRow:St,registerButton:Ie,registerRenameInput:Re,renameView:He,renderDecorationForRow:mt,resolveIcon:Ve,shouldSuppressContextMenu:Tt,visualFocusPath:mn},En={...Tn,registerButton:Le};return DV(`div`,{ref:S,id:tt,"data-file-tree-context-menu-button-visibility":je&&Ne?Pe:void 0,"data-file-tree-context-menu-trigger-mode":je?Me:void 0,"data-file-tree-has-context-menu-action-lane":je&&Ne?`true`:void 0,"data-file-tree-has-git-lane":Be?`true`:void 0,"data-file-tree-virtualized-root":`true`,"data-file-tree-root-drag-target":$e?.kind===`root`?`true`:void 0,onDragLeave:Xe?Qt:void 0,onDragOver:Xe?Zt:void 0,onDrop:Xe?$t:void 0,onKeyDown:Bt,onPointerLeave:je?Xt:void 0,onPointerOver:je?Yt:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[DV(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:fn}}),DV(`slot`,{name:RF,"data-type":`header-slot`}),f?DV(`div`,{"data-file-tree-search-container":!0,"data-open":Ge?`true`:`false`,children:DV(`input`,{ref:w,"aria-activedescendant":pn,"aria-controls":tt,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Ce?`true`:void 0,value:Ke,onBlur:()=>{d===`retain`&&!Te.current||t.closeSearch()},onFocus:Ee,onPointerDown:Ee,onInput:e=>{Ee();let n=e.currentTarget;t.setSearch(n.value)}})}):null,DV(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&ke&&ct.length>0?DV(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:DV(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${nt}px`},children:ct.map((e,t)=>IU(En,e.row,`sticky:${ZH(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${ct.length-t}`}}))})}):null,DV(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${ut}px`},children:[DV(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${tn}px`}}),DV(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${en}px`,top:`${nn}px`,bottom:`${rn}px`},children:[LU(Tn,st,ft),on!=null&&sn!=null?IU(Tn,on,`parked:${on.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:et===on.path?`none`:void 0,position:`absolute`,right:`0`,top:`${sn}px`}}):null,un!=null&&dn!=null?IU(Tn,un,`parked-drag:${un.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${dn}px`}}):null]})]})]}),je?DV(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":vn?`true`:`false`,style:xn,children:[DV(`button`,{ref:v,type:`button`,"data-type":BF,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":ue==null?`false`:`true`,"data-visible":_n?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),ue!=null){bt();return}wn()},tabIndex:-1,style:Sn,children:DV(jV,{...Ve(`file-tree-icon-ellipsis`)})}),ue==null?null:DV(`slot`,{name:zF})]}):null,ue==null?null:DV(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),bt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),bt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var zU={hydrateRoot:(e,t)=>{TV(tV(RU,t),e)},renderRoot:(e,t)=>{wV(tV(RU,t),e)},unmountRoot:e=>{wV(null,e)}};function BU(e,t){zU.renderRoot(e,t)}function VU(e,t){zU.hydrateRoot(e,t)}function HU(e){zU.unmountRoot(e)}var UU=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#r(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#r(e,t)}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}},WU=`__c`,GU=`__k`,KU=`__d`,qU=`__s`,JU=/[\s\n\\/='"\0<>]/,YU=/^(xlink|xmlns|xml)([A-Z])/,XU=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,ZU=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,QU=new Set([`draggable`,`spellcheck`]);function $U(e){e.__g===void 0?e[KU]=!0:e.__g|=8}function eW(e){e.__g===void 0?e[KU]=!1:e.__g&=-9}function tW(e){return e.__g===void 0?!0===e[KU]:!!(8&e.__g)}var nW=/["&<]/;function rW(e){if(e.length===0||!1===nW.test(e))return e;for(var t=0,n=0,r=``,i=``;n<e.length;n++){switch(e.charCodeAt(n)){case 34:i=`&quot;`;break;case 38:i=`&amp;`;break;case 60:i=`&lt;`;break;default:continue}n!==t&&(r+=e.slice(t,n)),r+=i,t=n+1}return n!==t&&(r+=e.slice(t,n)),r}var iW={},aW=new Set(`animation-iteration-count.border-image-outset.border-image-slice.border-image-width.box-flex.box-flex-group.box-ordinal-group.column-count.fill-opacity.flex.flex-grow.flex-negative.flex-order.flex-positive.flex-shrink.flood-opacity.font-weight.grid-column.grid-row.line-clamp.line-height.opacity.order.orphans.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.widows.z-index.zoom`.split(`.`)),oW=/[A-Z]/g;function sW(e){var t=``;for(var n in e){var r=e[n];if(r!=null&&r!==``){var i=n[0]==`-`?n:iW[n]||(iW[n]=n.replace(oW,`-$&`).toLowerCase()),a=`;`;typeof r!=`number`||i.startsWith(`--`)||aW.has(i)||(a=`px;`),t=t+i+`:`+r+a}}return t||void 0}function cW(){this.__d=!0}function lW(e,t){return{__v:e,context:t,props:e.props,setState:cW,forceUpdate:cW,__d:!0,__h:[]}}function uW(e,t,n){if(!e.s){if(n instanceof dW){if(!n.s)return void(n.o=uW.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(uW.bind(null,e,t),uW.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}var dW=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var a=1&i?t:n;if(a){try{uW(r,1,a(this.v))}catch(e){uW(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?uW(r,1,t?t(i):i):n?uW(r,1,n(i)):uW(r,2,i)}catch(e){uW(r,2,e)}},r},e}(),fW,pW,mW,hW,gW={},_W=Array.isArray,vW=Object.assign,yW=``,bW=`<!--$s-->`,xW=`<!--/$s-->`;function SW(e,t){var n,r=e.type,i=!0;return e[WU]?(i=!1,(n=e[WU]).state=n[qU]):n=new r(e.props,t),e[WU]=n,n.__v=e,n.props=e.props,n.context=t,$U(n),n.state??=gW,n[qU]??(n[qU]=n.state),r.getDerivedStateFromProps?n.state=vW({},n.state,r.getDerivedStateFromProps(n.props,n.state)):i&&n.componentWillMount?(n.componentWillMount(),n.state=n[qU]===n.state?n.state:n[qU]):!i&&n.componentWillUpdate&&n.componentWillUpdate(),mW&&mW(e),n.render(n.props,n.state,t)}function CW(e,t,n,r,i,a,o){if(e==null||!0===e||!1===e||e===yW)return yW;var s=typeof e;if(s!=`object`)return s==`function`?yW:s==`string`?rW(e):e+yW;if(_W(e)){var c,l=yW;i[GU]=e;for(var u=e.length,d=0;d<u;d++){var f=e[d];if(f!=null&&typeof f!=`boolean`){var p,m=CW(f,t,n,r,i,a,o);typeof m==`string`?l+=m:(c||=Array(u),l&&c.push(l),l=yW,_W(m)?(p=c).push.apply(p,m):c.push(m))}}return c?(l&&c.push(l),c):l}if(e.constructor!==void 0)return yW;e.__=i,fW&&fW(e);var h=e.type,g=e.props;if(typeof h==`function`){var _,v,y,b=t;if(h===rV){if(`tpl`in g){for(var x=yW,S=0;S<g.tpl.length;S++)if(x+=g.tpl[S],g.exprs&&S<g.exprs.length){var C=g.exprs[S];if(C==null)continue;typeof C!=`object`||C.constructor!==void 0&&!_W(C)?x+=C:x+=CW(C,t,n,r,e,a,o)}return x}if(`UNSTABLE_comment`in g)return`<!--`+rW(g.UNSTABLE_comment)+`-->`;v=g.children}else{if((_=h.contextType)!=null){var w=t[_.__c];b=w?w.props.value:_.__}var T=h.prototype&&typeof h.prototype.render==`function`;if(T)v=SW(e,b),y=e[WU];else{e[WU]=y=lW(e,b);for(var E=0;tW(y)&&E++<25;){eW(y),mW&&mW(e);try{v=h.call(y,g,b)}catch(t){throw a&&t&&typeof t.then==`function`&&(e._suspended=!0),t}}$U(y)}if(y.getChildContext!=null&&(t=vW({},t,y.getChildContext())),T&&zB.errorBoundaries&&(h.getDerivedStateFromError||y.componentDidCatch)){v=v!=null&&v.type===rV&&v.key==null&&v.props.tpl==null?v.props.children:v;try{return CW(v,t,n,r,e,a,!1)}catch(i){return h.getDerivedStateFromError&&(y[qU]=h.getDerivedStateFromError(i)),y.componentDidCatch&&y.componentDidCatch(i,gW),tW(y)?(v=SW(e,t),(y=e[WU]).getChildContext!=null&&(t=vW({},t,y.getChildContext())),CW(v=v!=null&&v.type===rV&&v.key==null&&v.props.tpl==null?v.props.children:v,t,n,r,e,a,o)):yW}finally{pW&&pW(e),hW&&hW(e)}}}v=v!=null&&v.type===rV&&v.key==null&&v.props.tpl==null?v.props.children:v;try{var D=CW(v,t,n,r,e,a,o);return pW&&pW(e),zB.unmount&&zB.unmount(e),e._suspended?typeof D==`string`?bW+D+xW:_W(D)?(D.unshift(bW),D.push(xW),D):D.then(function(e){return bW+e+xW}):D}catch(i){if(!a&&o&&o.onError){var O=function i(s){return o.onError(s,e,function(e,s){try{return CW(e,t,n,r,s,a,o)}catch(e){return i(e)}})}(i);if(O!==void 0)return O;var k=zB.__e;return k&&k(i,e),yW}if(!a||!i||typeof i.then!=`function`)throw i;return i.then(function i(){try{var s=CW(v,t,n,r,e,a,o);return e._suspended?bW+s+xW:s}catch(e){if(!e||typeof e.then!=`function`)throw e;return e.then(i)}})}}var A,j=`<`+h,M=yW;for(var N in g){var P=g[N];if(typeof(P=TW(P)?P.value:P)!=`function`||N===`class`||N===`className`){switch(N){case`children`:A=P;continue;case`key`:case`ref`:case`__self`:case`__source`:continue;case`htmlFor`:if(`for`in g)continue;N=`for`;break;case`className`:if(`class`in g)continue;N=`class`;break;case`defaultChecked`:N=`checked`;break;case`defaultSelected`:N=`selected`;break;case`defaultValue`:case`value`:switch(N=`value`,h){case`textarea`:A=P;continue;case`select`:r=P;continue;case`option`:r!=P||`selected`in g||(j+=` selected`)}break;case`dangerouslySetInnerHTML`:M=P&&P.__html;continue;case`style`:typeof P==`object`&&(P=sW(P));break;case`acceptCharset`:N=`accept-charset`;break;case`httpEquiv`:N=`http-equiv`;break;default:if(YU.test(N))N=N.replace(YU,`$1:$2`).toLowerCase();else{if(JU.test(N))continue;N[4]!==`-`&&!QU.has(N)||P==null?n?ZU.test(N)&&(N=N===`panose1`?`panose-1`:N.replace(/([A-Z])/g,`-$1`).toLowerCase()):XU.test(N)&&(N=N.toLowerCase()):P+=yW}}P!=null&&!1!==P&&(j=!0===P||P===yW?j+` `+N:j+` `+N+`="`+(typeof P==`string`?rW(P):P+yW)+`"`)}}if(JU.test(h))throw Error(h+` is not a valid HTML tag name in `+j+`>`);if(M||(typeof A==`string`?M=rW(A):A!=null&&!1!==A&&!0!==A&&(M=CW(A,t,h===`svg`||h!==`foreignObject`&&n,r,e,a,o))),pW&&pW(e),hW&&hW(e),!M&&wW.has(h))return j+`/>`;var F=`</`+h+`>`,I=j+`>`;return _W(M)?[I].concat(M,[F]):typeof M==`string`?I+M+F:[I,M,F]}var wW=new Set([`area`,`base`,`br`,`col`,`command`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function TW(e){return typeof e==`object`&&!!e&&typeof e.peek==`function`&&`value`in e}var EW=0;function DW(e){return e!=null&&e.length>0?e:(EW+=1,`pst_ft_${EW}`)}function OW({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??Iz)}function kW(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function AW(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function jW(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var MW=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new UU;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=DW(a),this.#p=RB(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=Fz(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new NB({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(HU(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){this.#t.resetPaths(e,t)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),BU(t.wrapper,this.#w()))}setGitStatus(e){this.#p=RB(e,this.#p);let t=this.#T();t!=null&&BU(t.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),BU(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),VU(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),BU(r,this.#w())}#C(){return{initialViewportHeight:OW({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;if(e!=null){this.#l.setSlotContent(RF,e());return}this.#l.setSlotHtml(RF,this.#e?.header?.html??null)}#k(e){let t=jW(e).find(e=>AW(e)),n=kW(OF(HF(this.#m).set));n!=null&&(t!=null&&t.outerHTML===n.outerHTML||(t==null?e.prepend(n):t.replaceWith(n)))}#A(e){let t=jW(e),n=t.find(e=>AW(e)),r=t.filter(e=>e!==n),i=HF(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=kW(i);if(a==null){for(let e of r)e.remove();return}if(!(r.length===1&&r[0].outerHTML===a.outerHTML)){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=HF(this.#m);t.colored&&AF(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${PF}]`);if(this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``){this.#g?.remove(),this.#g=void 0,this.#_=void 0;return}this.#g?.parentNode===e&&this.#_===this.#h||(this.#g??=document.createElement(`style`),this.#g.setAttribute(PF,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=Bz(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return Kz(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}},NW=typeof window>`u`?Q.useEffect:Q.useLayoutEffect;function PW(e,t,n){let r=e==null?null:(0,Z.jsx)(`div`,{slot:RF,children:e}),i=t!=null&&n!=null?(0,Z.jsx)(`div`,{slot:zF,children:t(n.item,n.context)}):null;return r==null&&i==null?null:(0,Z.jsxs)(Z.Fragment,{children:[r,i]})}function FW(e,t){return typeof window>`u`&&t!=null?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t.shadowHtml}}),e]}):(0,Z.jsx)(Z.Fragment,{children:e})}function IW(e){let t=e.shadowRoot;return t?.querySelector(`[data-file-tree-id]`)instanceof HTMLElement||t?.querySelector(`[data-file-tree-id]`)instanceof SVGElement?!0:e.querySelector(`template[shadowrootmode="open"]`)instanceof HTMLTemplateElement}function LW(e,t,n,r,i){let a={...e??{}};if(t!=null&&delete a.header,n){let t=e?.contextMenu,n=t?.onClose,o=t?.onOpen;a.contextMenu={...t??{},enabled:!0,onClose:()=>{n?.(),r()},onOpen:(e,t)=>{i(e,t),o?.(e,t)}},delete a.contextMenu.render}return a.header!=null||a.contextMenu!=null?a:void 0}function RW({header:e,id:t,model:n,preloadedData:r,renderContextMenu:i,...a}){let[o,s]=(0,Q.useState)(null),[c,l]=(0,Q.useState)(null),u=(0,Q.useRef)(n.getComposition()),d=(0,Q.useRef)(n);d.current!==n&&(d.current=n,u.current=n.getComposition());let f=i!=null,p=(0,Q.useCallback)(()=>{s(null)},[]),m=(0,Q.useCallback)((e,t)=>{s({context:t,item:e})},[]),h=u.current,g=(0,Q.useMemo)(()=>LW(h,e,f,p,m),[h,p,m,f,e]),_=(0,Q.useCallback)(e=>{l(e)},[]);(0,Q.useEffect)(()=>{f||s(null)},[f]),NW(()=>{n.setComposition(g)},[g,n]),NW(()=>{if(c!=null)return r!=null&&IW(c)?n.hydrate({fileTreeContainer:c}):n.render({fileTreeContainer:c}),()=>{n.unmount(),n.setComposition(h)}},[h,c,n,r]);let v=FW(PW(e,i,o),r),y=t??r?.id,b={"--trees-item-height":`${String(n.getItemHeight())}px`,"--trees-density-override":n.getDensityFactor(),...a.style};return(0,Z.jsx)(MF,{...a,id:y,ref:_,style:b,suppressHydrationWarning:r!=null,children:v})}function zW(e){let[t]=(0,Q.useState)(()=>new MW(e)),n=(0,Q.useRef)({timeout:null,model:t});return(0,Q.useEffect)(()=>{let{current:e}=n;return e.timeout!=null&&(clearTimeout(e.timeout),e.timeout=null),()=>{e.timeout=setTimeout(()=>e.model.cleanUp(),1)}},[]),{model:t}}var BW={density:`compact`,itemHeight:26,flattenEmptyDirectories:!1},VW={"--trees-level-gap-override":`4px`,"--trees-item-row-gap-override":`4px`,"--trees-icon-width-override":`14px`,"--trees-item-height":`${BW.itemHeight}px`,"--trees-indent-guide-bg-override":`color-mix(in oklab, var(--trees-fg-muted) 30%, transparent)`},HW=`
1867
1867
  [data-item-section='spacing-item'] {
1868
1868
  opacity: 0.5;
1869
1869
  }
@@ -48,7 +48,7 @@
48
48
  -->
49
49
  <script>(() => { let t = 'system'; try { const r = localStorage.getItem('ok-theme-v1'); if (r === 'light' || r === 'dark' || r === 'system') t = r; } catch {} let dark = t === 'dark'; if (t === 'system') { try { dark = window.matchMedia('(prefers-color-scheme: dark)').matches; } catch {} } if (dark) document.documentElement.classList.add('dark'); if (window.okDesktop) document.documentElement.classList.add('electron-mode'); })();</script>
50
50
  <style>html { background-color: #fafafa } html.dark { background-color: #171717 }</style>
51
- <script type="module" crossorigin src="./assets/index-BCi-zfC-.js"></script>
51
+ <script type="module" crossorigin src="./assets/index-BLv-umMW.js"></script>
52
52
  <link rel="modulepreload" crossorigin href="./assets/chunk-CFjPhJqf.js">
53
53
  <link rel="modulepreload" crossorigin href="./assets/preload-helper-2ej06EnG.js">
54
54
  <link rel="modulepreload" crossorigin href="./assets/w3c-keyname-nBRha8PK.js">
@@ -1,2 +1,2 @@
1
- import{h as e,n as t}from"./init-_B_rQl4n.mjs";import{t as n}from"./is-object-Cg453afR.mjs";import{existsSync as r,readFileSync as i}from"node:fs";import{join as a}from"node:path";const o=[[`@inkeep/open-knowledge`,`ui`],[`-y`,`@inkeep/open-knowledge`,`ui`],t];function s(e){if(e.runtimeExecutable===`/bin/sh`&&Array.isArray(e.runtimeArgs)){let t=e.runtimeArgs[2];if(typeof t==`string`){if(t.includes(`# ok-ui-v1`))return`canonical`;if(/# ok-ui-v\d+/.test(t))return`legacy-bare`}return`preserved`}if(e.runtimeExecutable===`npx`&&Array.isArray(e.runtimeArgs)){for(let t of o)if(c(e.runtimeArgs,t))return`legacy-bare`}return`preserved`}function c(e,t){if(e.length!==t.length)return!1;for(let n=0;n<t.length;n++)if(e[n]!==t[n])return!1;return!0}function l(t){let o=t.logger??u,c=a(t.projectDir,`.claude`,`launch.json`);if(t.reclaimDisableEnv===`1`)return o({event:`launch-json-repair-skipped`,reason:`reclaim-disabled`}),{outcome:{configPath:c,outcome:`skipped-reclaim-disabled`},repairedCount:0};if(!r(c))return{outcome:{configPath:c,outcome:`no-file`},repairedCount:0};let l;try{let e=i(c,`utf-8`).trim();l=e?JSON.parse(e):{}}catch(e){let t=e instanceof Error?e.message:String(e);return o({event:`launch-json-repair-read-failed`,configPath:c,error:t}),{outcome:{configPath:c,outcome:`read-failed`,error:t},repairedCount:0}}if(!n(l)){let e=`launch.json root is not an object`;return o({event:`launch-json-repair-read-failed`,configPath:c,error:e}),{outcome:{configPath:c,outcome:`read-failed`,error:e},repairedCount:0}}let d=l.configurations;if(!Array.isArray(d))return{outcome:{configPath:c,outcome:`no-entry`},repairedCount:0};let f=d.find(e=>n(e)&&e.name===`open-knowledge-ui`);if(!f)return{outcome:{configPath:c,outcome:`no-entry`},repairedCount:0};let p=s(f);if(p===`canonical`)return{outcome:{configPath:c,outcome:`canonical`},repairedCount:0};if(p===`preserved`)return{outcome:{configPath:c,outcome:`preserved`},repairedCount:0};let m=e(t.projectDir,{mode:`published`});if(m.action===`failed`){let e=m.error??`unknown write failure`;return o({event:`launch-json-repair-write-failed`,configPath:c,error:e}),{outcome:{configPath:c,outcome:`write-failed`,error:e},repairedCount:0}}return o({event:`launch-json-repair-applied`,configPath:c}),{outcome:{configPath:c,outcome:`repaired`},repairedCount:1}}function u(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{l as repairLaunchJson};
2
- //# sourceMappingURL=repair-launch-json-DByxKFwf.mjs.map
1
+ import{h as e,n as t}from"./init-C0ivSgZ8.mjs";import{t as n}from"./is-object-Cg453afR.mjs";import{existsSync as r,readFileSync as i}from"node:fs";import{join as a}from"node:path";const o=[[`@inkeep/open-knowledge`,`ui`],[`-y`,`@inkeep/open-knowledge`,`ui`],t];function s(e){if(e.runtimeExecutable===`/bin/sh`&&Array.isArray(e.runtimeArgs)){let t=e.runtimeArgs[2];if(typeof t==`string`){if(t.includes(`# ok-ui-v1`))return`canonical`;if(/# ok-ui-v\d+/.test(t))return`legacy-bare`}return`preserved`}if(e.runtimeExecutable===`npx`&&Array.isArray(e.runtimeArgs)){for(let t of o)if(c(e.runtimeArgs,t))return`legacy-bare`}return`preserved`}function c(e,t){if(e.length!==t.length)return!1;for(let n=0;n<t.length;n++)if(e[n]!==t[n])return!1;return!0}function l(t){let o=t.logger??u,c=a(t.projectDir,`.claude`,`launch.json`);if(t.reclaimDisableEnv===`1`)return o({event:`launch-json-repair-skipped`,reason:`reclaim-disabled`}),{outcome:{configPath:c,outcome:`skipped-reclaim-disabled`},repairedCount:0};if(!r(c))return{outcome:{configPath:c,outcome:`no-file`},repairedCount:0};let l;try{let e=i(c,`utf-8`).trim();l=e?JSON.parse(e):{}}catch(e){let t=e instanceof Error?e.message:String(e);return o({event:`launch-json-repair-read-failed`,configPath:c,error:t}),{outcome:{configPath:c,outcome:`read-failed`,error:t},repairedCount:0}}if(!n(l)){let e=`launch.json root is not an object`;return o({event:`launch-json-repair-read-failed`,configPath:c,error:e}),{outcome:{configPath:c,outcome:`read-failed`,error:e},repairedCount:0}}let d=l.configurations;if(!Array.isArray(d))return{outcome:{configPath:c,outcome:`no-entry`},repairedCount:0};let f=d.find(e=>n(e)&&e.name===`open-knowledge-ui`);if(!f)return{outcome:{configPath:c,outcome:`no-entry`},repairedCount:0};let p=s(f);if(p===`canonical`)return{outcome:{configPath:c,outcome:`canonical`},repairedCount:0};if(p===`preserved`)return{outcome:{configPath:c,outcome:`preserved`},repairedCount:0};let m=e(t.projectDir,{mode:`published`});if(m.action===`failed`){let e=m.error??`unknown write failure`;return o({event:`launch-json-repair-write-failed`,configPath:c,error:e}),{outcome:{configPath:c,outcome:`write-failed`,error:e},repairedCount:0}}return o({event:`launch-json-repair-applied`,configPath:c}),{outcome:{configPath:c,outcome:`repaired`},repairedCount:1}}function u(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{l as repairLaunchJson};
2
+ //# sourceMappingURL=repair-launch-json-Ce3TeUe3.mjs.map
@@ -1,2 +1,2 @@
1
- import{d as e,g as t}from"./init-_B_rQl4n.mjs";import{c as n,o as r,r as i}from"./write-project-skill-DVFdi_YZ.mjs";import{t as a}from"./mcp-migrate-event-D0NrGjvc.mjs";import{homedir as o}from"node:os";function s(e){let t=e.logger??u,n=e.home??o(),a=[];if(e.reclaimDisableEnv===`1`)return t({event:`mcp-config-repair-skipped`,reason:`reclaim-disabled`}),{outcomes:a,repairedCount:0};for(let o of i){let i=r[o],s=c(()=>i.configPath(``,n));if(s!==null&&a.push(l({scope:`user`,editorId:o,target:i,home:n,cwd:``,configPath:s,configPathOverride:void 0,logger:t})),i.projectConfigPath){let n=i.projectConfigPath,r=c(()=>n(e.projectDir));r!==null&&a.push(l({scope:`project`,editorId:o,target:i,home:void 0,cwd:e.projectDir,configPath:r,configPathOverride:r,logger:t}))}}return{outcomes:a,repairedCount:a.filter(e=>e.outcome===`repaired`).length}}function c(e){try{return e()}catch{return null}}function l(r){let i={scope:r.scope,editorId:r.editorId,configPath:r.configPath},o=e(r.target,r.cwd,r.home,r.configPathOverride);if(o===null)return{...i,outcome:`no-entry`};if(n(o))return{...i,outcome:`canonical`};r.logger(a({scope:r.scope,surface:`cli-repair`,editorId:r.editorId,configPath:r.configPath,priorEntry:o}));let s=t(r.target,r.cwd,{mode:`published`,skipAvailabilityCheck:!0},r.home,r.configPathOverride);if(s.action===`failed`){let e=s.error??`unknown write failure`;return r.logger({event:`mcp-config-repair-write-failed`,scope:r.scope,editorId:r.editorId,configPath:r.configPath,error:e}),{...i,outcome:`write-failed`,error:e}}return{...i,outcome:`repaired`}}function u(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{s as repairMcpConfigs};
2
- //# sourceMappingURL=repair-mcp-configs-CT_NDRrH.mjs.map
1
+ import{d as e,g as t}from"./init-C0ivSgZ8.mjs";import{c as n,o as r,r as i}from"./write-project-skill-DVFdi_YZ.mjs";import{t as a}from"./mcp-migrate-event-D0NrGjvc.mjs";import{homedir as o}from"node:os";function s(e){let t=e.logger??u,n=e.home??o(),a=[];if(e.reclaimDisableEnv===`1`)return t({event:`mcp-config-repair-skipped`,reason:`reclaim-disabled`}),{outcomes:a,repairedCount:0};for(let o of i){let i=r[o],s=c(()=>i.configPath(``,n));if(s!==null&&a.push(l({scope:`user`,editorId:o,target:i,home:n,cwd:``,configPath:s,configPathOverride:void 0,logger:t})),i.projectConfigPath){let n=i.projectConfigPath,r=c(()=>n(e.projectDir));r!==null&&a.push(l({scope:`project`,editorId:o,target:i,home:void 0,cwd:e.projectDir,configPath:r,configPathOverride:r,logger:t}))}}return{outcomes:a,repairedCount:a.filter(e=>e.outcome===`repaired`).length}}function c(e){try{return e()}catch{return null}}function l(r){let i={scope:r.scope,editorId:r.editorId,configPath:r.configPath},o=e(r.target,r.cwd,r.home,r.configPathOverride);if(o===null)return{...i,outcome:`no-entry`};if(n(o))return{...i,outcome:`canonical`};r.logger(a({scope:r.scope,surface:`cli-repair`,editorId:r.editorId,configPath:r.configPath,priorEntry:o}));let s=t(r.target,r.cwd,{mode:`published`,skipAvailabilityCheck:!0},r.home,r.configPathOverride);if(s.action===`failed`){let e=s.error??`unknown write failure`;return r.logger({event:`mcp-config-repair-write-failed`,scope:r.scope,editorId:r.editorId,configPath:r.configPath,error:e}),{...i,outcome:`write-failed`,error:e}}return{...i,outcome:`repaired`}}function u(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{s as repairMcpConfigs};
2
+ //# sourceMappingURL=repair-mcp-configs-CuapyiV-.mjs.map