@dylanpiercey/work 0.0.178 → 0.0.180
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +819 -615
- package/dist/public/assets/_9Dw0rpRB.js +1 -0
- package/dist/public/assets/{_DLuGH9wP.js → _B-oTUisw.js} +66 -66
- package/dist/public/assets/_B-oTUisw.js.br +0 -0
- package/dist/public/assets/_BJMBesC8.js +1 -0
- package/dist/public/assets/_BaB2KTgs.js +1 -0
- package/dist/public/assets/_BafWVR1Z.js +1 -0
- package/dist/public/assets/_BdyS62ck.js +1 -0
- package/dist/public/assets/_CAiITnSL.js +1 -0
- package/dist/public/assets/{_D8fFV5Ym.js → _CWOQeVjT.js} +1 -1
- package/dist/public/assets/_CWOQeVjT.js.br +0 -0
- package/dist/public/assets/_ChYNFrbw.js +1 -0
- package/dist/public/assets/_CoVBMgR8.js +1 -0
- package/dist/public/assets/_Cwrxarqf.js +1 -0
- package/dist/public/assets/{_s72b-JB_.js → _D1_IgqEt.js} +5 -5
- package/dist/public/assets/_D1_IgqEt.js.br +0 -0
- package/dist/public/assets/_DLAN1x2w.js +1 -0
- package/dist/public/assets/_DTpscZKE.js +1 -0
- package/dist/public/assets/_Ddm9l-a6.js +1 -0
- package/dist/public/assets/_Dkh2Hw3W.js +1 -0
- package/dist/public/assets/_DnVYWVdu.js +1 -0
- package/dist/public/assets/_DxXAXTdz.js +1 -0
- package/dist/public/assets/_VR1nKvIB.js +1 -0
- package/dist/public/assets/_gKHSDI0E.js +1 -0
- package/dist/public/assets/_qaArnTZN.js +1 -0
- package/dist/public/assets/_sJ4x-tl2.js +1 -0
- package/dist/public/assets/_yTfgsrNO.js +1 -0
- package/dist/public/assets/_zFEdMvq1.js +1 -0
- package/dist/public/assets/{app-page-mpLi5gUf.css → app-page-ujOO9O9j.css} +1 -1
- package/dist/public/assets/app-page-ujOO9O9j.css.br +0 -0
- package/dist/public/assets/{icon-arrow-down-DSmBsYc0.css → icon-arrow-down-CnC9B8zr.css} +1 -1
- package/dist/public/assets/icon-arrow-down-CnC9B8zr.css.br +0 -0
- package/dist/public/assets/new-OkHtBkzU.js +1 -0
- package/dist/public/assets/review-view-BYC11tmH.css +1 -0
- package/dist/public/assets/review-view-BYC11tmH.css.br +0 -0
- package/dist/public/assets/review-view-X_RUf4F7.js +2 -0
- package/dist/public/assets/settings-OkHtBkzU.js +1 -0
- package/dist/public/assets/w-OkHtBkzU.js +1 -0
- package/dist/public/assets/w._-Bl7_ITGh.js +1 -0
- package/dist/public/assets/w._-OkHtBkzU.js +1 -0
- package/lib/preview/media.d.mts +10 -0
- package/lib/preview/media.mjs +41 -0
- package/lib/review/markdown.mjs +14 -6
- package/package.json +1 -1
- package/dist/public/assets/_B6o8FkwV.js +0 -1
- package/dist/public/assets/_BDGElzVm.js +0 -1
- package/dist/public/assets/_BDeylpEs.js +0 -1
- package/dist/public/assets/_BEEyk_EB.js +0 -1
- package/dist/public/assets/_BWDbM5E_.js +0 -1
- package/dist/public/assets/_C8jIJ1Pj.js +0 -1
- package/dist/public/assets/_CFdGarWX.js +0 -1
- package/dist/public/assets/_CFfZ3sMn.js +0 -1
- package/dist/public/assets/_CIfRmO5F.js +0 -1
- package/dist/public/assets/_CV1Q2C2m.js +0 -1
- package/dist/public/assets/_CZgExeYN.js +0 -1
- package/dist/public/assets/_D8fFV5Ym.js.br +0 -0
- package/dist/public/assets/_D8vUoiS4.js +0 -1
- package/dist/public/assets/_DFta0PoX.js +0 -1
- package/dist/public/assets/_DHMJGzjE.js +0 -1
- package/dist/public/assets/_DLuGH9wP.js.br +0 -0
- package/dist/public/assets/_DVNDyccF.js +0 -1
- package/dist/public/assets/_DxjeG8P_.js +0 -1
- package/dist/public/assets/_E4p2FxoI.js +0 -1
- package/dist/public/assets/_GnbYDeRV.js +0 -1
- package/dist/public/assets/_OGDCaCq3.js +0 -1
- package/dist/public/assets/_RIV-3qh5.js +0 -1
- package/dist/public/assets/_ibANXg_A.js +0 -1
- package/dist/public/assets/_s72b-JB_.js.br +0 -0
- package/dist/public/assets/app-page-mpLi5gUf.css.br +0 -0
- package/dist/public/assets/icon-arrow-down-DSmBsYc0.css.br +0 -0
- package/dist/public/assets/new-CkY2AXTw.js +0 -1
- package/dist/public/assets/review-view-BrfjQmXA.css +0 -1
- package/dist/public/assets/review-view-BrfjQmXA.css.br +0 -0
- package/dist/public/assets/review-view-DtiHctEJ.js +0 -2
- package/dist/public/assets/settings-CkY2AXTw.js +0 -1
- package/dist/public/assets/w-CkY2AXTw.js +0 -1
- package/dist/public/assets/w._-CkY2AXTw.js +0 -1
- package/dist/public/assets/w._-Csr1ikwd.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_CENbzEJT.js","assets/_hePW80VL.js","assets/_uvCtJ6zz.js","assets/_CWH6qxYM.js","assets/_CQTDE9K4.js","assets/_CZEx699l.js","assets/_CMC6b9HF.js","assets/_zy6yt2JI.js","assets/_cXHJ5Aqj.js","assets/_DW3nSckX.js","assets/_C3EMIoXk.js","assets/_B2LkwyUu.js","assets/_mQm0jPVv.js","assets/_BXeXVLqQ.js","assets/_ClmBPtsj.js","assets/_BV5QcD1t.js","assets/_BNeDY6c6.js","assets/_D0OygaZT.js","assets/_YkIvmgMd.js","assets/_bTVj8UrX.js","assets/_DinKA_hx.js","assets/_BAfg1_wL.js","assets/_gzcpVVnB.js","assets/_rMYAdrnY.js","assets/_CmFrqHJw.js","assets/_CNTJHRw3.js","assets/_5AJ_AKid.js","assets/_C7Qx5vsK.js","assets/_BMLL4cWB.js","assets/_C3vzIjs1.js","assets/_hfRJcieK.js","assets/_BhpLuC-Z.js","assets/_eEx3xZw1.js","assets/_B7sBnSVB.js","assets/_CwSTGRiH.js","assets/_DPs98hXw.js","assets/_fT1Q2AHj.js","assets/_DWc1bOg5.js","assets/_CfwcpHky.js","assets/_BWxWv3Q4.js","assets/_D9Uq_kAm.js","assets/_BaHq4SXp.js","assets/_BYOwaDjH.js","assets/_CQJs3lWb.js","assets/_CYNrtFtB.js","assets/_DmIc4jLQ.js","assets/_DbYA3moe.js","assets/_CBce3t8t.js","assets/_DYvRD3hg.js","assets/_Dl-2e7rI.js","assets/_woXpYk--.js","assets/_CVzjJEu4.js","assets/_BE-5_Vob.js","assets/_BkmuJnv4.js","assets/_CQtYx0Hw.js","assets/_EnzWFNCd.js","assets/_CptijnhY.js","assets/_DK7gU5UW.js","assets/_Dx-8-gkx.js","assets/_DekxQCZG.js","assets/_C8oCnwJJ.js","assets/_BLsa44WM.js","assets/_owCQ3_5m.js","assets/_IvbGWrWX.js","assets/_BfqywnWV.js","assets/_5cJqJSYA.js","assets/_CRzKmxW8.js","assets/_BZiRiFuW.js","assets/_DendWUyw.js","assets/_0gdzfuwb.js","assets/_D0ODP8pF.js","assets/_DVTAwKKz.js","assets/_DSC0z2WY.js","assets/_DWQbgPoS.js","assets/_DJMQeKeT.js","assets/_Ceg68iFQ.js","assets/_BY9Zpo-y.js","assets/_K81ipFoO.js","assets/_DqKBuwfJ.js","assets/_oqKa8noW.js","assets/_CnvKMtbv.js","assets/_IyjqRm3v.js","assets/_rLFTqkRN.js","assets/_CacY0gHj.js","assets/_B5eOa1yu.js","assets/_Dixweg8N.js","assets/_D1A_Heim.js","assets/_O90oeIOV.js","assets/_DxPa6R8r.js","assets/_DOwzaHZ0.js","assets/_B3gFvitq.js","assets/_Cfkwpbl8.js","assets/_BiFt_7mu.js","assets/_CMLA9XwU.js","assets/_BI6nDtQe.js","assets/_CaR0Cm4R.js","assets/_BCq3eWBs.js","assets/_C2c05-aV.js","assets/_D0TvPGyZ.js","assets/_Bj61d0ZC.js","assets/_I6bkQ0U8.js","assets/_DB-OQ-9y.js","assets/_Cvrh5tZx.js","assets/_BIPSG49u.js","assets/_CAjFT4sV.js","assets/_L8AbGenz.js","assets/_ByJddavk.js","assets/_B7sulDMZ.js","assets/_BKkKlZgz.js","assets/_Dtdv7oY4.js","assets/_BPanIK56.js","assets/_BmhN3Nyl.js","assets/_BE-cBzrM.js","assets/_C8OhMxob.js","assets/_qdxAdBWQ.js","assets/_Ci_nEsc7.js","assets/_CYpm1nAK.js","assets/_BNLmms1o.js","assets/_CCSX75yM.js","assets/_CyEgAFGc.js","assets/_Dh5ihWbf.js","assets/_B2gwz-sJ.js","assets/_C6F_DycA.js","assets/_Un2ZJKHi.js","assets/_COoyuGi7.js","assets/_B6D30XZt.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as e,r as t,t as n}from"./_hePW80VL.js";import{A as r,B as i,E as a,F as o,G as s,H as c,I as l,L as u,M as d,N as f,O as p,P as m,R as h,T as g,V as _,W as v,_ as y,a as b,b as x,c as S,d as C,f as w,i as T,l as E,n as D,r as O,t as k,u as A,v as j,y as M,z as N}from"./_4WrdbxBF.js";import{$ as P,$t as ee,A as te,At as ne,B as re,Bt as ie,C as ae,Ct as oe,D as se,Dt as ce,E as le,Et as ue,F as de,G as fe,Gt as pe,H as me,I as he,J as ge,Jt as _e,K as ve,L as ye,Lt as be,M as xe,N as Se,Nt as Ce,O as we,Ot as Te,P as Ee,Q as F,Qt as De,R as Oe,S as ke,Sn as Ae,St as je,T as Me,Tt as Ne,U as Pe,V as Fe,W as Ie,X as Le,Y as Re,Z as ze,_t as Be,a as Ve,b as He,bt as Ue,c as We,cn as Ge,ct as Ke,d as qe,dn as Je,dt as Ye,en as Xe,et as Ze,f as Qe,ft as $e,gt as et,h as tt,ht as nt,i as rt,it,j as at,k as ot,kt as st,ln as ct,m as I,mt as L,n as lt,nn as ut,nt as dt,o as ft,p as pt,pt as mt,q as ht,qt as gt,r as _t,rn as vt,rt as yt,s as bt,sn as xt,st as St,t as Ct,tn as wt,tt as Tt,u as Et,un as Dt,ut as Ot,v as kt,vt as At,w as jt,wn as Mt,wt as Nt,x as Pt,xt as Ft,y as It,yt as Lt,z as Rt,zt}from"./_D8fFV5Ym.js";var Bt=`diffs-container`,Vt=(()=>{try{return!1}catch{return!1}})(),Ht=/(?=^From [a-f0-9]+ .+$)/m,Ut=/(?=^diff --git)/gm,Wt=/(?<=\n)/,Gt=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Kt=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,qt=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,Jt=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Yt=`header-prefix`,Xt=`header-filename-suffix`,Zt=`header-metadata`,Qt=`header-custom`,R={dark:`pierre-dark`,light:`pierre-light`},$t=`data-theme-css`,en=`data-unsafe-css`,tn=`data-diffs-scrollbar-measure`,nn=`data-diffs-code-view-header`,rn=`data-diffs-code-view-footer`,an=`--diffs-scrollbar-gutter-measured`,on=1e5,sn={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},cn={...sn,hunkLineCount:1},ln={paddingTop:8,paddingBottom:8,gap:8},un={omega:.015,positionEpsilon:.5,velocityEpsilon:.05},dn=Object.freeze({fromStart:0,fromEnd:0}),fn={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},pn={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},mn=new Set,hn=null;function gn(e){mn.add(e),hn??=requestAnimationFrame(vn)}function _n(e){mn.delete(e)&&mn.size===0&&hn!=null&&(cancelAnimationFrame(hn),hn=null)}function vn(e){let t=new Set(mn);mn.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}hn=mn.size>0?requestAnimationFrame(vn):null}function yn(e,t,n){if(e===t||e==null||t==null)return e===t;let r=new Set(n),i=Object.keys(e),a=new Set(Object.keys(t));for(let n of i)if(a.delete(n),!r.has(n)&&(!(n in t)||e[n]!==t[n]))return!1;for(let e of Array.from(a))if(!r.has(e))return!1;return!0}function bn(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function xn(e,t){let n=e?.theme??R,r=t?.theme??R,i=Sn(e),a=Sn(t);return bn(n,r)&&yn(e,t,[`theme`,`parseDiffOptions`])&&yn(i,a)}function Sn(e){if(e!=null&&`parseDiffOptions`in e)return e.parseDiffOptions}function Cn(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function wn({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:r=!1,fitPerfectlyOverscroll:i=0,overscrollSize:a}){let o=n+a*2,s=r?n+i*2:o;if(t=Math.max(t,s),o>=t||r){let n=Math.max(e-i,0),r=Math.min(e+s,t);return{top:n,bottom:Math.max(r,n)}}let c=e+n/2-o/2,l=c+o;return c<0&&(c=0),l>t&&(l=t),c=Math.floor(Math.max(c,0)),{top:c,bottom:Math.ceil(Math.max(Math.min(l,t),c))}}function Tn(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function En(e){return{type:`text`,value:e}}function z({tagName:e,children:t=[],properties:n={}}){return{type:`element`,tagName:e,properties:n,children:t}}function Dn({name:e,width:t=16,height:n=16,properties:r}){return z({tagName:`svg`,properties:{width:t,height:n,viewBox:`0 0 16 16`,...r},children:[z({tagName:`use`,properties:{href:`#${e.replace(/^#/,``)}`}})]})}function On(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t;t=`children`in t?t.children[0]:null}}function kn(e){return z({tagName:`div`,properties:{"data-gutter":``},children:e})}function An(e,t,n,r={}){return z({tagName:`div`,properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t==null?void 0:[z({tagName:`span`,properties:{"data-line-number-content":``},children:[En(`${t}`)]})]})}function jn(e,t,n){return z({tagName:`div`,properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t===`annotation`?void 0:e,style:t===`annotation`?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function Mn(){return z({tagName:`button`,properties:{"data-utility-button":``,type:`button`},children:[Dn({name:`diffs-icon-plus`,properties:{"data-icon":``}})]})}function Nn(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function Pn(e){for(let t of e)if(t instanceof HTMLElement&&(t.hasAttribute(`data-utility-button`)||t.hasAttribute(`data-gutter-utility-slot`)||t.getAttribute(`slot`)===`gutter-utility-slot`||t.getAttribute(`name`)===`gutter-utility-slot`))return!0;return!1}var Fn=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],In=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};In.prototype.normal={},In.prototype.property={},In.prototype.space=void 0;function Ln(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new In(n,r,t)}function Rn(e){return e.toLowerCase()}var zn=class{constructor(e,t){this.attribute=t,this.property=e}};zn.prototype.attribute=``,zn.prototype.booleanish=!1,zn.prototype.boolean=!1,zn.prototype.commaOrSpaceSeparated=!1,zn.prototype.commaSeparated=!1,zn.prototype.defined=!1,zn.prototype.mustUseProperty=!1,zn.prototype.number=!1,zn.prototype.overloadedBoolean=!1,zn.prototype.property=``,zn.prototype.spaceSeparated=!1,zn.prototype.space=void 0;var Bn=e({boolean:()=>B,booleanish:()=>Hn,commaOrSpaceSeparated:()=>Gn,commaSeparated:()=>Wn,number:()=>V,overloadedBoolean:()=>Un,spaceSeparated:()=>H}),Vn=0,B=Kn(),Hn=Kn(),Un=Kn(),V=Kn(),H=Kn(),Wn=Kn(),Gn=Kn();function Kn(){return 2**++Vn}var qn=Object.keys(Bn),Jn=class extends zn{constructor(e,t,n,r){let i=-1;if(super(e,t),Yn(this,`space`,r),typeof n==`number`)for(;++i<qn.length;){let e=qn[i];Yn(this,qn[i],(n&Bn[e])===Bn[e])}}};Jn.prototype.defined=!0;function Yn(e,t,n){n&&(e[t]=n)}function Xn(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Jn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Rn(r)]=r,n[Rn(a.attribute)]=r}return new In(t,n,e.space)}var Zn=Xn({properties:{ariaActiveDescendant:null,ariaAtomic:Hn,ariaAutoComplete:null,ariaBusy:Hn,ariaChecked:Hn,ariaColCount:V,ariaColIndex:V,ariaColSpan:V,ariaControls:H,ariaCurrent:null,ariaDescribedBy:H,ariaDetails:null,ariaDisabled:Hn,ariaDropEffect:H,ariaErrorMessage:null,ariaExpanded:Hn,ariaFlowTo:H,ariaGrabbed:Hn,ariaHasPopup:null,ariaHidden:Hn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:H,ariaLevel:V,ariaLive:null,ariaModal:Hn,ariaMultiLine:Hn,ariaMultiSelectable:Hn,ariaOrientation:null,ariaOwns:H,ariaPlaceholder:null,ariaPosInSet:V,ariaPressed:Hn,ariaReadOnly:Hn,ariaRelevant:null,ariaRequired:Hn,ariaRoleDescription:H,ariaRowCount:V,ariaRowIndex:V,ariaRowSpan:V,ariaSelected:Hn,ariaSetSize:V,ariaSort:null,ariaValueMax:V,ariaValueMin:V,ariaValueNow:V,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Qn(e,t){return t in e?e[t]:t}function $n(e,t){return Qn(e,t.toLowerCase())}var er=Xn({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Wn,acceptCharset:H,accessKey:H,action:null,allow:null,allowFullScreen:B,allowPaymentRequest:B,allowUserMedia:B,alpha:B,alt:null,as:null,async:B,autoCapitalize:null,autoComplete:H,autoFocus:B,autoPlay:B,blocking:H,capture:null,charSet:null,checked:B,cite:null,className:H,closedBy:null,colorSpace:null,cols:V,colSpan:V,command:null,commandFor:null,content:null,contentEditable:Hn,controls:B,controlsList:H,coords:V|Wn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:B,defer:B,dir:null,dirName:null,disabled:B,download:Un,draggable:Hn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:B,formTarget:null,headers:H,height:V,hidden:Un,high:V,href:null,hrefLang:null,htmlFor:H,httpEquiv:H,id:null,imageSizes:null,imageSrcSet:null,inert:B,inputMode:null,integrity:null,is:null,isMap:B,itemId:null,itemProp:H,itemRef:H,itemScope:B,itemType:H,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:B,low:V,manifest:null,max:null,maxLength:V,media:null,method:null,min:null,minLength:V,multiple:B,muted:B,name:null,nonce:null,noModule:B,noValidate:B,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:B,optimum:V,pattern:null,ping:H,placeholder:null,playsInline:B,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:B,referrerPolicy:null,rel:H,required:B,reversed:B,rows:V,rowSpan:V,sandbox:H,scope:null,scoped:B,seamless:B,selected:B,shadowRootClonable:B,shadowRootCustomElementRegistry:B,shadowRootDelegatesFocus:B,shadowRootMode:null,shadowRootSerializable:B,shape:null,size:V,sizes:null,slot:null,span:V,spellCheck:Hn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:V,step:null,style:null,tabIndex:V,target:null,title:null,translate:null,type:null,typeMustMatch:B,useMap:null,value:Hn,width:V,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:H,axis:null,background:null,bgColor:null,border:V,borderColor:null,bottomMargin:V,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:B,declare:B,event:null,face:null,frame:null,frameBorder:null,hSpace:V,leftMargin:V,link:null,longDesc:null,lowSrc:null,marginHeight:V,marginWidth:V,noResize:B,noHref:B,noShade:B,noWrap:B,object:null,profile:null,prompt:null,rev:null,rightMargin:V,rules:null,scheme:null,scrolling:Hn,standby:null,summary:null,text:null,topMargin:V,valueType:null,version:null,vAlign:null,vLink:null,vSpace:V,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:B,disablePictureInPicture:B,disableRemotePlayback:B,exportParts:Wn,part:H,prefix:null,property:null,results:V,security:null,unselectable:null},space:`html`,transform:$n}),tr=Xn({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Gn,accentHeight:V,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:V,amplitude:V,arabicForm:null,ascent:V,attributeName:null,attributeType:null,azimuth:V,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:V,by:null,calcMode:null,capHeight:V,className:H,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:V,diffuseConstant:V,direction:null,display:null,dur:null,divisor:V,dominantBaseline:null,download:B,dx:null,dy:null,edgeMode:null,editable:null,elevation:V,enableBackground:null,end:null,event:null,exponent:V,externalResourcesRequired:null,fill:null,fillOpacity:V,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Wn,g2:Wn,glyphName:Wn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:V,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:V,horizOriginX:V,horizOriginY:V,id:null,ideographic:V,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:V,k:V,k1:V,k2:V,k3:V,k4:V,kernelMatrix:Gn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:V,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:V,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:V,overlineThickness:V,paintOrder:null,panose1:null,path:null,pathLength:V,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:H,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:V,pointsAtY:V,pointsAtZ:V,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Gn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Gn,rev:Gn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Gn,requiredFeatures:Gn,requiredFonts:Gn,requiredFormats:Gn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:V,specularExponent:V,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:V,strikethroughThickness:V,string:null,stroke:null,strokeDashArray:Gn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:V,strokeOpacity:V,strokeWidth:null,style:null,surfaceScale:V,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Gn,tabIndex:V,tableValues:null,target:null,targetX:V,targetY:V,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Gn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:V,underlineThickness:V,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:V,values:null,vAlphabetic:V,vMathematical:V,vectorEffect:null,vHanging:V,vIdeographic:V,version:null,vertAdvY:V,vertOriginX:V,vertOriginY:V,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:V,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Qn}),nr=Xn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),rr=Xn({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:$n}),ir=Xn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),ar=/[A-Z]/g,or=/-[a-z]/g,sr=/^data[-\w.:]+$/i;function cr(e,t){let n=Rn(t),r=t,i=zn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&sr.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(or,ur);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!or.test(e)){let n=e.replace(ar,lr);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Jn}return new i(r,t)}function lr(e){return`-`+e.toLowerCase()}function ur(e){return e.charAt(1).toUpperCase()}var dr=Ln([Zn,er,nr,rr,ir],`html`),fr=Ln([Zn,tr,nr,rr,ir],`svg`),pr={}.hasOwnProperty;function mr(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&pr.call(t,e)){let n=String(t[e]);i=pr.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var hr=/["&'<>`]/g,gr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,_r=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,vr=/[|\\{}()[\]^$+*?.]/g,yr=new WeakMap;function br(e,t){if(e=e.replace(t.subset?xr(t.subset):hr,r),t.subset||t.escapeOnly)return e;return e.replace(gr,n).replace(_r,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function xr(e){let t=yr.get(e);return t||(t=Sr(e),yr.set(e,t)),t}function Sr(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(vr,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var Cr=/[\dA-Fa-f]/;function wr(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!Cr.test(String.fromCharCode(t))?r:r+`;`}var Tr=/\d/;function Er(e,t,n){let r=`&#`+String(e);return n&&t&&!Tr.test(String.fromCharCode(t))?r:r+`;`}var Dr=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),Or={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},kr=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],Ar={}.hasOwnProperty,jr={},Mr;for(Mr in Or)Ar.call(Or,Mr)&&(jr[Or[Mr]]=Mr);var Nr=/[^\dA-Za-z]/;function Pr(e,t,n,r){let i=String.fromCharCode(e);if(Ar.call(jr,i)){let e=jr[i],a=`&`+e;return n&&Dr.includes(e)&&!kr.includes(e)&&(!r||t&&t!==61&&Nr.test(String.fromCharCode(t)))?a:a+`;`}return``}function Fr(e,t,n){let r=wr(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Pr(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=Er(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function Ir(e,t){return br(e,Object.assign({format:Fr},t))}var Lr=/^>|^->|<!--|-->|--!>|<!-$/g,Rr=[`>`],zr=[`<`,`>`];function Br(e,t,n,r){return r.settings.bogusComments?`<?`+Ir(e.value,Object.assign({},r.settings.characterReferences,{subset:Rr}))+`>`:`<!--`+e.value.replace(Lr,i)+`-->`;function i(e){return Ir(e,Object.assign({},r.settings.characterReferences,{subset:zr}))}}function Vr(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function Hr(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Ur(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function Wr(e){return e.join(` `).trim()}var Gr=/[ \t\n\f\r]/g;function Kr(e){return typeof e==`object`?e.type===`text`&&qr(e.value):qr(e)}function qr(e){return e.replace(Gr,``)===``}var Jr=Zr(1),Yr=Zr(-1),Xr=[];function Zr(e){return t;function t(t,n,r){let i=t?t.children:Xr,a=(n||0)+e,o=i[a];if(!r)for(;o&&Kr(o);)a+=e,o=i[a];return o}}var Qr={}.hasOwnProperty;function $r(e){return t;function t(t,n,r){return Qr.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var ei=$r({body:ri,caption:ti,colgroup:ti,dd:si,dt:oi,head:ti,html:ni,li:ai,optgroup:li,option:ui,p:ii,rp:ci,rt:ci,tbody:fi,td:hi,tfoot:pi,th:hi,thead:di,tr:mi});function ti(e,t,n){let r=Jr(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&Kr(r.value.charAt(0)))}function ni(e,t,n){let r=Jr(n,t);return!r||r.type!==`comment`}function ri(e,t,n){let r=Jr(n,t);return!r||r.type!==`comment`}function ii(e,t,n){let r=Jr(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function ai(e,t,n){let r=Jr(n,t);return!r||r.type===`element`&&r.tagName===`li`}function oi(e,t,n){let r=Jr(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function si(e,t,n){let r=Jr(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function ci(e,t,n){let r=Jr(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function li(e,t,n){let r=Jr(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function ui(e,t,n){let r=Jr(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function di(e,t,n){let r=Jr(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function fi(e,t,n){let r=Jr(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function pi(e,t,n){return!Jr(n,t)}function mi(e,t,n){let r=Jr(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function hi(e,t,n){let r=Jr(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var gi=$r({body:yi,colgroup:bi,head:vi,html:_i,tbody:xi});function _i(e){let t=Jr(e,-1);return!t||t.type!==`comment`}function vi(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function yi(e){let t=Jr(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&Kr(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function bi(e,t,n){let r=Yr(n,t),i=Jr(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&ei(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function xi(e,t,n){let r=Yr(n,t),i=Jr(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&ei(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var Si={name:[[`
|
|
2
|
+
import{n as e,r as t,t as n}from"./_hePW80VL.js";import{A as r,B as i,E as a,F as o,G as s,H as c,I as l,L as u,M as d,N as f,O as p,P as m,R as h,T as g,V as _,W as v,_ as y,a as b,b as x,c as S,d as C,f as w,i as T,l as E,n as D,r as O,t as k,u as A,v as j,y as M,z as N}from"./_4WrdbxBF.js";import{$ as P,$t as ee,A as te,At as ne,B as re,Bt as ie,C as ae,Ct as oe,D as se,Dt as ce,E as le,Et as ue,F as de,G as fe,Gt as pe,H as me,I as he,J as ge,Jt as _e,K as ve,L as ye,Lt as be,M as xe,N as Se,Nt as Ce,O as we,Ot as Te,P as Ee,Q as F,Qt as De,R as Oe,S as ke,Sn as Ae,St as je,T as Me,Tt as Ne,U as Pe,V as Fe,W as Ie,X as Le,Y as Re,Z as ze,_t as Be,a as Ve,b as He,bt as Ue,c as We,cn as Ge,ct as Ke,d as qe,dn as Je,dt as Ye,en as Xe,et as Ze,f as Qe,ft as $e,gt as et,h as tt,ht as nt,i as rt,it,j as at,k as ot,kt as st,ln as ct,m as I,mt as L,n as lt,nn as ut,nt as dt,o as ft,p as pt,pt as mt,q as ht,qt as gt,r as _t,rn as vt,rt as yt,s as bt,sn as xt,st as St,t as Ct,tn as wt,tt as Tt,u as Et,un as Dt,ut as Ot,v as kt,vt as At,w as jt,wn as Mt,wt as Nt,x as Pt,xt as Ft,y as It,yt as Lt,z as Rt,zt}from"./_CWOQeVjT.js";var Bt=`diffs-container`,Vt=(()=>{try{return!1}catch{return!1}})(),Ht=/(?=^From [a-f0-9]+ .+$)/m,Ut=/(?=^diff --git)/gm,Wt=/(?<=\n)/,Gt=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Kt=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,qt=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,Jt=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Yt=`header-prefix`,Xt=`header-filename-suffix`,Zt=`header-metadata`,Qt=`header-custom`,R={dark:`pierre-dark`,light:`pierre-light`},$t=`data-theme-css`,en=`data-unsafe-css`,tn=`data-diffs-scrollbar-measure`,nn=`data-diffs-code-view-header`,rn=`data-diffs-code-view-footer`,an=`--diffs-scrollbar-gutter-measured`,on=1e5,sn={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},cn={...sn,hunkLineCount:1},ln={paddingTop:8,paddingBottom:8,gap:8},un={omega:.015,positionEpsilon:.5,velocityEpsilon:.05},dn=Object.freeze({fromStart:0,fromEnd:0}),fn={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},pn={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},mn=new Set,hn=null;function gn(e){mn.add(e),hn??=requestAnimationFrame(vn)}function _n(e){mn.delete(e)&&mn.size===0&&hn!=null&&(cancelAnimationFrame(hn),hn=null)}function vn(e){let t=new Set(mn);mn.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}hn=mn.size>0?requestAnimationFrame(vn):null}function yn(e,t,n){if(e===t||e==null||t==null)return e===t;let r=new Set(n),i=Object.keys(e),a=new Set(Object.keys(t));for(let n of i)if(a.delete(n),!r.has(n)&&(!(n in t)||e[n]!==t[n]))return!1;for(let e of Array.from(a))if(!r.has(e))return!1;return!0}function bn(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function xn(e,t){let n=e?.theme??R,r=t?.theme??R,i=Sn(e),a=Sn(t);return bn(n,r)&&yn(e,t,[`theme`,`parseDiffOptions`])&&yn(i,a)}function Sn(e){if(e!=null&&`parseDiffOptions`in e)return e.parseDiffOptions}function Cn(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function wn({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:r=!1,fitPerfectlyOverscroll:i=0,overscrollSize:a}){let o=n+a*2,s=r?n+i*2:o;if(t=Math.max(t,s),o>=t||r){let n=Math.max(e-i,0),r=Math.min(e+s,t);return{top:n,bottom:Math.max(r,n)}}let c=e+n/2-o/2,l=c+o;return c<0&&(c=0),l>t&&(l=t),c=Math.floor(Math.max(c,0)),{top:c,bottom:Math.ceil(Math.max(Math.min(l,t),c))}}function Tn(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function En(e){return{type:`text`,value:e}}function z({tagName:e,children:t=[],properties:n={}}){return{type:`element`,tagName:e,properties:n,children:t}}function Dn({name:e,width:t=16,height:n=16,properties:r}){return z({tagName:`svg`,properties:{width:t,height:n,viewBox:`0 0 16 16`,...r},children:[z({tagName:`use`,properties:{href:`#${e.replace(/^#/,``)}`}})]})}function On(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t;t=`children`in t?t.children[0]:null}}function kn(e){return z({tagName:`div`,properties:{"data-gutter":``},children:e})}function An(e,t,n,r={}){return z({tagName:`div`,properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t==null?void 0:[z({tagName:`span`,properties:{"data-line-number-content":``},children:[En(`${t}`)]})]})}function jn(e,t,n){return z({tagName:`div`,properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t===`annotation`?void 0:e,style:t===`annotation`?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function Mn(){return z({tagName:`button`,properties:{"data-utility-button":``,type:`button`},children:[Dn({name:`diffs-icon-plus`,properties:{"data-icon":``}})]})}function Nn(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function Pn(e){for(let t of e)if(t instanceof HTMLElement&&(t.hasAttribute(`data-utility-button`)||t.hasAttribute(`data-gutter-utility-slot`)||t.getAttribute(`slot`)===`gutter-utility-slot`||t.getAttribute(`name`)===`gutter-utility-slot`))return!0;return!1}var Fn=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],In=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};In.prototype.normal={},In.prototype.property={},In.prototype.space=void 0;function Ln(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new In(n,r,t)}function Rn(e){return e.toLowerCase()}var zn=class{constructor(e,t){this.attribute=t,this.property=e}};zn.prototype.attribute=``,zn.prototype.booleanish=!1,zn.prototype.boolean=!1,zn.prototype.commaOrSpaceSeparated=!1,zn.prototype.commaSeparated=!1,zn.prototype.defined=!1,zn.prototype.mustUseProperty=!1,zn.prototype.number=!1,zn.prototype.overloadedBoolean=!1,zn.prototype.property=``,zn.prototype.spaceSeparated=!1,zn.prototype.space=void 0;var Bn=e({boolean:()=>B,booleanish:()=>Hn,commaOrSpaceSeparated:()=>Gn,commaSeparated:()=>Wn,number:()=>V,overloadedBoolean:()=>Un,spaceSeparated:()=>H}),Vn=0,B=Kn(),Hn=Kn(),Un=Kn(),V=Kn(),H=Kn(),Wn=Kn(),Gn=Kn();function Kn(){return 2**++Vn}var qn=Object.keys(Bn),Jn=class extends zn{constructor(e,t,n,r){let i=-1;if(super(e,t),Yn(this,`space`,r),typeof n==`number`)for(;++i<qn.length;){let e=qn[i];Yn(this,qn[i],(n&Bn[e])===Bn[e])}}};Jn.prototype.defined=!0;function Yn(e,t,n){n&&(e[t]=n)}function Xn(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Jn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Rn(r)]=r,n[Rn(a.attribute)]=r}return new In(t,n,e.space)}var Zn=Xn({properties:{ariaActiveDescendant:null,ariaAtomic:Hn,ariaAutoComplete:null,ariaBusy:Hn,ariaChecked:Hn,ariaColCount:V,ariaColIndex:V,ariaColSpan:V,ariaControls:H,ariaCurrent:null,ariaDescribedBy:H,ariaDetails:null,ariaDisabled:Hn,ariaDropEffect:H,ariaErrorMessage:null,ariaExpanded:Hn,ariaFlowTo:H,ariaGrabbed:Hn,ariaHasPopup:null,ariaHidden:Hn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:H,ariaLevel:V,ariaLive:null,ariaModal:Hn,ariaMultiLine:Hn,ariaMultiSelectable:Hn,ariaOrientation:null,ariaOwns:H,ariaPlaceholder:null,ariaPosInSet:V,ariaPressed:Hn,ariaReadOnly:Hn,ariaRelevant:null,ariaRequired:Hn,ariaRoleDescription:H,ariaRowCount:V,ariaRowIndex:V,ariaRowSpan:V,ariaSelected:Hn,ariaSetSize:V,ariaSort:null,ariaValueMax:V,ariaValueMin:V,ariaValueNow:V,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Qn(e,t){return t in e?e[t]:t}function $n(e,t){return Qn(e,t.toLowerCase())}var er=Xn({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Wn,acceptCharset:H,accessKey:H,action:null,allow:null,allowFullScreen:B,allowPaymentRequest:B,allowUserMedia:B,alpha:B,alt:null,as:null,async:B,autoCapitalize:null,autoComplete:H,autoFocus:B,autoPlay:B,blocking:H,capture:null,charSet:null,checked:B,cite:null,className:H,closedBy:null,colorSpace:null,cols:V,colSpan:V,command:null,commandFor:null,content:null,contentEditable:Hn,controls:B,controlsList:H,coords:V|Wn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:B,defer:B,dir:null,dirName:null,disabled:B,download:Un,draggable:Hn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:B,formTarget:null,headers:H,height:V,hidden:Un,high:V,href:null,hrefLang:null,htmlFor:H,httpEquiv:H,id:null,imageSizes:null,imageSrcSet:null,inert:B,inputMode:null,integrity:null,is:null,isMap:B,itemId:null,itemProp:H,itemRef:H,itemScope:B,itemType:H,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:B,low:V,manifest:null,max:null,maxLength:V,media:null,method:null,min:null,minLength:V,multiple:B,muted:B,name:null,nonce:null,noModule:B,noValidate:B,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:B,optimum:V,pattern:null,ping:H,placeholder:null,playsInline:B,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:B,referrerPolicy:null,rel:H,required:B,reversed:B,rows:V,rowSpan:V,sandbox:H,scope:null,scoped:B,seamless:B,selected:B,shadowRootClonable:B,shadowRootCustomElementRegistry:B,shadowRootDelegatesFocus:B,shadowRootMode:null,shadowRootSerializable:B,shape:null,size:V,sizes:null,slot:null,span:V,spellCheck:Hn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:V,step:null,style:null,tabIndex:V,target:null,title:null,translate:null,type:null,typeMustMatch:B,useMap:null,value:Hn,width:V,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:H,axis:null,background:null,bgColor:null,border:V,borderColor:null,bottomMargin:V,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:B,declare:B,event:null,face:null,frame:null,frameBorder:null,hSpace:V,leftMargin:V,link:null,longDesc:null,lowSrc:null,marginHeight:V,marginWidth:V,noResize:B,noHref:B,noShade:B,noWrap:B,object:null,profile:null,prompt:null,rev:null,rightMargin:V,rules:null,scheme:null,scrolling:Hn,standby:null,summary:null,text:null,topMargin:V,valueType:null,version:null,vAlign:null,vLink:null,vSpace:V,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:B,disablePictureInPicture:B,disableRemotePlayback:B,exportParts:Wn,part:H,prefix:null,property:null,results:V,security:null,unselectable:null},space:`html`,transform:$n}),tr=Xn({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Gn,accentHeight:V,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:V,amplitude:V,arabicForm:null,ascent:V,attributeName:null,attributeType:null,azimuth:V,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:V,by:null,calcMode:null,capHeight:V,className:H,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:V,diffuseConstant:V,direction:null,display:null,dur:null,divisor:V,dominantBaseline:null,download:B,dx:null,dy:null,edgeMode:null,editable:null,elevation:V,enableBackground:null,end:null,event:null,exponent:V,externalResourcesRequired:null,fill:null,fillOpacity:V,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Wn,g2:Wn,glyphName:Wn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:V,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:V,horizOriginX:V,horizOriginY:V,id:null,ideographic:V,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:V,k:V,k1:V,k2:V,k3:V,k4:V,kernelMatrix:Gn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:V,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:V,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:V,overlineThickness:V,paintOrder:null,panose1:null,path:null,pathLength:V,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:H,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:V,pointsAtY:V,pointsAtZ:V,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Gn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Gn,rev:Gn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Gn,requiredFeatures:Gn,requiredFonts:Gn,requiredFormats:Gn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:V,specularExponent:V,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:V,strikethroughThickness:V,string:null,stroke:null,strokeDashArray:Gn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:V,strokeOpacity:V,strokeWidth:null,style:null,surfaceScale:V,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Gn,tabIndex:V,tableValues:null,target:null,targetX:V,targetY:V,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Gn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:V,underlineThickness:V,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:V,values:null,vAlphabetic:V,vMathematical:V,vectorEffect:null,vHanging:V,vIdeographic:V,version:null,vertAdvY:V,vertOriginX:V,vertOriginY:V,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:V,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Qn}),nr=Xn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),rr=Xn({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:$n}),ir=Xn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),ar=/[A-Z]/g,or=/-[a-z]/g,sr=/^data[-\w.:]+$/i;function cr(e,t){let n=Rn(t),r=t,i=zn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&sr.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(or,ur);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!or.test(e)){let n=e.replace(ar,lr);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Jn}return new i(r,t)}function lr(e){return`-`+e.toLowerCase()}function ur(e){return e.charAt(1).toUpperCase()}var dr=Ln([Zn,er,nr,rr,ir],`html`),fr=Ln([Zn,tr,nr,rr,ir],`svg`),pr={}.hasOwnProperty;function mr(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&pr.call(t,e)){let n=String(t[e]);i=pr.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var hr=/["&'<>`]/g,gr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,_r=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,vr=/[|\\{}()[\]^$+*?.]/g,yr=new WeakMap;function br(e,t){if(e=e.replace(t.subset?xr(t.subset):hr,r),t.subset||t.escapeOnly)return e;return e.replace(gr,n).replace(_r,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function xr(e){let t=yr.get(e);return t||(t=Sr(e),yr.set(e,t)),t}function Sr(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(vr,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var Cr=/[\dA-Fa-f]/;function wr(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!Cr.test(String.fromCharCode(t))?r:r+`;`}var Tr=/\d/;function Er(e,t,n){let r=`&#`+String(e);return n&&t&&!Tr.test(String.fromCharCode(t))?r:r+`;`}var Dr=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),Or={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},kr=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],Ar={}.hasOwnProperty,jr={},Mr;for(Mr in Or)Ar.call(Or,Mr)&&(jr[Or[Mr]]=Mr);var Nr=/[^\dA-Za-z]/;function Pr(e,t,n,r){let i=String.fromCharCode(e);if(Ar.call(jr,i)){let e=jr[i],a=`&`+e;return n&&Dr.includes(e)&&!kr.includes(e)&&(!r||t&&t!==61&&Nr.test(String.fromCharCode(t)))?a:a+`;`}return``}function Fr(e,t,n){let r=wr(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Pr(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=Er(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function Ir(e,t){return br(e,Object.assign({format:Fr},t))}var Lr=/^>|^->|<!--|-->|--!>|<!-$/g,Rr=[`>`],zr=[`<`,`>`];function Br(e,t,n,r){return r.settings.bogusComments?`<?`+Ir(e.value,Object.assign({},r.settings.characterReferences,{subset:Rr}))+`>`:`<!--`+e.value.replace(Lr,i)+`-->`;function i(e){return Ir(e,Object.assign({},r.settings.characterReferences,{subset:zr}))}}function Vr(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function Hr(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Ur(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function Wr(e){return e.join(` `).trim()}var Gr=/[ \t\n\f\r]/g;function Kr(e){return typeof e==`object`?e.type===`text`&&qr(e.value):qr(e)}function qr(e){return e.replace(Gr,``)===``}var Jr=Zr(1),Yr=Zr(-1),Xr=[];function Zr(e){return t;function t(t,n,r){let i=t?t.children:Xr,a=(n||0)+e,o=i[a];if(!r)for(;o&&Kr(o);)a+=e,o=i[a];return o}}var Qr={}.hasOwnProperty;function $r(e){return t;function t(t,n,r){return Qr.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var ei=$r({body:ri,caption:ti,colgroup:ti,dd:si,dt:oi,head:ti,html:ni,li:ai,optgroup:li,option:ui,p:ii,rp:ci,rt:ci,tbody:fi,td:hi,tfoot:pi,th:hi,thead:di,tr:mi});function ti(e,t,n){let r=Jr(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&Kr(r.value.charAt(0)))}function ni(e,t,n){let r=Jr(n,t);return!r||r.type!==`comment`}function ri(e,t,n){let r=Jr(n,t);return!r||r.type!==`comment`}function ii(e,t,n){let r=Jr(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function ai(e,t,n){let r=Jr(n,t);return!r||r.type===`element`&&r.tagName===`li`}function oi(e,t,n){let r=Jr(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function si(e,t,n){let r=Jr(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function ci(e,t,n){let r=Jr(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function li(e,t,n){let r=Jr(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function ui(e,t,n){let r=Jr(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function di(e,t,n){let r=Jr(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function fi(e,t,n){let r=Jr(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function pi(e,t,n){return!Jr(n,t)}function mi(e,t,n){let r=Jr(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function hi(e,t,n){let r=Jr(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var gi=$r({body:yi,colgroup:bi,head:vi,html:_i,tbody:xi});function _i(e){let t=Jr(e,-1);return!t||t.type!==`comment`}function vi(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function yi(e){let t=Jr(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&Kr(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function bi(e,t,n){let r=Yr(n,t),i=Jr(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&ei(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function xi(e,t,n){let r=Yr(n,t),i=Jr(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&ei(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var Si={name:[[`
|
|
3
3
|
\f\r &/=>`.split(``),`
|
|
4
4
|
\f\r "&'/=>\``.split(``)],[`\0
|
|
5
5
|
\f\r "&'/<=>`.split(``),`\0
|
|
@@ -1526,10 +1526,10 @@ diff --git`)}function m_(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.star
|
|
|
1526
1526
|
`),n.noEOFCRDeletions=i!=null&&i!==``&&!i.endsWith(`
|
|
1527
1527
|
`)}function Yv(e,t){let n=e.additionLineIndex,r=e.deletionLineIndex;e.hunkContent=t.hunkContent.map(e=>Xv(e,n,r)),e.additionLineIndex=n+t.additionLineIndex,e.additionStart+=t.additionLineIndex,e.additionCount=t.additionCount,e.additionLines=t.additionLines,t.deletionLineIndex>=0&&(e.deletionLineIndex=r+t.deletionLineIndex,e.deletionStart+=t.deletionLineIndex),e.deletionCount=t.deletionCount,e.deletionLines=t.deletionLines,e.noEOFCRAdditions=t.noEOFCRAdditions,e.noEOFCRDeletions=t.noEOFCRDeletions,Zv(e)}function Xv(e,t,n){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+n}}function Zv(e){let t=0,n=0;for(let r of e.hunkContent)r.type===`context`?(t+=r.lines,n+=r.lines):(t+=Math.max(r.additions,r.deletions),n+=r.additions+r.deletions);e.splitLineCount=t,e.unifiedLineCount=n}function Qv(e){let t=0,n=0,r=0;for(let i of e.hunks)i.collapsedBefore=Math.max(yg(i.additionStart,i.additionCount)-r,0),i.splitLineStart=t+i.collapsedBefore,i.unifiedLineStart=n+i.collapsedBefore,Zv(i),t+=i.collapsedBefore+i.splitLineCount,n+=i.collapsedBefore+i.unifiedLineCount,r=bg(i.additionStart,i.additionCount);if(e.hunks.length>0){let r=e.hunks[e.hunks.length-1],i=Math.max(e.additionLines.length-bg(r.additionStart,r.additionCount),0);t+=i,n+=i}e.splitLineCount=t,e.unifiedLineCount=n}var $v=new WeakMap;function ey(e){return e.length>1&&e[e.length-1]===``?e.slice(0,-1):e}function ty(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;let i=e.length,a=t.length;for(;i>r&&a>r&&e[i-1]===t[a-1];)i--,a--;if(r!==i||r!==a)return{start:r,deletionEnd:i,additionEnd:a}}function ny(e,t){let n=e.hunks,r=e.additionLines,i=ey(r),a=i===r?e:{...e,additionLines:i},o=fy(n,dy(a,t),e.deletionLines.length),s=hy(a,o);if(e.additionLines=i,e.hunks=s,e.editSessionDirty=!0,Ty(e),Hv(e,r),vy(n,e.hunks))return{regions:o.map(e=>e.previousSpan)}}function ry(e,t,n,r){let i=Array.from(new Set(t)).filter(t=>t>=0&&t<e.additionLines.length).sort((e,t)=>e-t);if(i.length===0)return;let{hunks:a}=e,o,s=0;for(let t of i){for(;s<a.length;){let e=a[s];if(t<xy(e)+e.additionCount)break;s++}let r=a[s],i=r==null?void 0:xy(r);if(i==null||t<i||o!=null&&o!==s)return ny(e,n);o=s}if(o!=null){if(iy(e,i,o,r,n)){e.editSessionDirty=!0;return}return ny(e,n)}}function iy(e,t,n,r,i){if(r==null||i?.ignoreWhitespace===!0||i?.stripTrailingCr===!0)return!1;let a=ay(e),o=e.hunks[n];if(o.hunkContent.some(oy))return!1;for(let n of t){let t=r.get(n),i=e.additionLines[n];if(t==null||i==null||a.has(t)||a.has(i))return!1;let s=!1;for(let e of o.hunkContent)if(e.type===`change`&&e.additions===e.deletions&&n>=e.additionLineIndex&&n<e.additionLineIndex+e.additions){s=!0;break}if(!s)return!1}return!0}function ay(e){let t=$v.get(e);if(t?.lines===e.deletionLines)return t.set;let n=new Set(e.deletionLines);return $v.set(e,{lines:e.deletionLines,set:n}),n}function oy(e){return e?.type===`change`&&(e.additions===0||e.deletions===0)}function sy(e,t){let n=new Map,{regions:r}=t;for(let t=0;t<=r.length;t++){let i=r[t-1],a=r[t],o=t===0?e.get(0):i==null?void 0:e.get(i.lastIndex+1),s=a==null?void 0:e.get(a.firstIndex),c=o?.fromStart??0,l=s?.fromEnd??0;(c>0||l>0)&&n.set(t,{fromStart:c,fromEnd:l})}return n}function cy(e,t,n){let r=[];if(e.isPartial)return r;for(let[i,a]of e.hunks.entries()){let o=uv({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:t,hunkIndex:i,collapsedContextThreshold:n});if(o.rangeSize<=n)continue;let s=Sy(a),c=s-o.rangeSize;o.fromStart>0&&r.push([c,c+o.fromStart]),o.fromEnd>0&&r.push([s-o.fromEnd,s])}let i=pv({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`captureExpansionAnchors`});if(i!=null&&i.fromStart>0&&i.rangeSize>n){let t=e.hunks[e.hunks.length-1],n=Sy(t)+t.deletionCount;r.push([n,n+i.fromStart])}return r}function ly(e,t){let n=new Map;if(t.length===0)return n;let r=(e,r,i)=>{if(i<=r)return;let a=0,o=0;for(let[e,n]of t)n<=r||e>=i||(e<=r&&(a=Math.max(a,Math.min(n,i)-r)),n>=i&&(o=Math.max(o,i-Math.max(e,r))));(a>0||o>0)&&n.set(e,{fromStart:a,fromEnd:o})};for(let[t,n]of e.hunks.entries()){let e=Sy(n);r(t,e-Math.max(n.collapsedBefore,0),e)}let i=e.hunks[e.hunks.length-1];return i!=null&&!e.isPartial&&e.deletionLines.length>0&&r(e.hunks.length,Sy(i)+i.deletionCount,e.deletionLines.length),n}function uy(e,t){return e.editSessionDirty===!0&&(delete e.editSessionDirty,Object.assign(e,e.additionLines.length<=1&&e.additionLines.join(``)===``?Pv(e,t):Bv(e,t)),!0)}function dy(e,t){if(ty(e.deletionLines,e.additionLines)==null)return[];let n=Z_({name:e.prevName??e.name,contents:e.deletionLines.join(``)},{name:e.name,contents:e.additionLines.join(``),lang:e.lang},t),r=[],i=0,a=0;for(let e of n.hunks){let t=e.additionCount>0?e.additionLineIndex-i:e.deletionLineIndex-a;i+=t,a+=t;for(let t of e.hunkContent){if(t.type===`context`){i+=t.lines,a+=t.lines;continue}let e=Xv(t,0,0);e.additions===0&&(e.additionLineIndex=i),e.deletions===0&&(e.deletionLineIndex=a),r.push(e),i+=e.additions,a+=e.deletions}}return r}function fy(e,t,n){let r=e.map((e,t)=>{let n=Sy(e);return{deletionStart:n,deletionEnd:n+e.deletionCount,blocks:[],previousSpan:{firstIndex:t,lastIndex:t}}}),i=[],a=0;for(let e of t){let t=e.deletionLineIndex,o=t+e.deletions;for(;a<r.length&&r[a].deletionEnd<t;)i.push(r[a]),a++;let s=i.length>0&&py(t,o,i[i.length-1])?i.pop():void 0;for(;a<r.length&&r[a].deletionStart<=o;)s=my(s,r[a]),a++;if(s==null){let c=t,l=o;if((e.deletions===0||e.additions===0)&&n>e.deletions){let e=i[i.length-1]?.deletionEnd??0,s=r[a]?.deletionStart??n;t>e?c--:o<s&&l++}s={deletionStart:c,deletionEnd:l,blocks:[],previousSpan:void 0}}s.deletionStart=Math.min(s.deletionStart,t),s.deletionEnd=Math.max(s.deletionEnd,o),s.blocks.push(e),i.push(s)}for(;a<r.length;)i.push(r[a]),a++;return i}function py(e,t,n){return e<=n.deletionEnd&&t>=n.deletionStart}function my(e,t){return e==null?t:(e.deletionStart=Math.min(e.deletionStart,t.deletionStart),e.deletionEnd=Math.max(e.deletionEnd,t.deletionEnd),e.blocks.push(...t.blocks),t.previousSpan!=null&&(e.previousSpan??={...t.previousSpan},e.previousSpan.firstIndex=Math.min(e.previousSpan.firstIndex,t.previousSpan.firstIndex),e.previousSpan.lastIndex=Math.max(e.previousSpan.lastIndex,t.previousSpan.lastIndex)),e)}function hy(e,t){let n=[],r=0,i=0;for(let a of t){let t=a.deletionStart-r;if(t<0)throw Error(`buildRegionHunks: overlapping old-side regions`);r+=t,i+=t;let o=i,s=[];for(let e of a.blocks){let t=e.deletionLineIndex-r,n=e.additionLineIndex-i;if(t<0||t!==n)throw Error(`buildRegionHunks: canonical block context mismatch`);_y(s,t,i,r),r+=t,i+=n,s.push({...e}),r+=e.deletions,i+=e.additions}let c=a.deletionEnd-r;if(c<0)throw Error(`buildRegionHunks: block exceeds its old-side region`);_y(s,c,i,r),r+=c,i+=c,n.push(gy(e,{additionStart:o,additionEnd:i,deletionStart:a.deletionStart,deletionEnd:a.deletionEnd},s))}if(e.deletionLines.length-r!==e.additionLines.length-i)throw Error(`buildRegionHunks: trailing context mismatch`);return n}function gy(e,t,n){let r=t.additionEnd-t.additionStart,i=t.deletionEnd-t.deletionStart,a=0,o=0;for(let e of n)e.type===`change`&&(a+=e.additions,o+=e.deletions);let s={collapsedBefore:0,additionStart:Cy(t.additionStart,r),additionCount:r,additionLines:a,additionLineIndex:wy(t.additionStart,r),deletionStart:Cy(t.deletionStart,i),deletionCount:i,deletionLines:o,deletionLineIndex:wy(t.deletionStart,i),hunkContent:n,hunkSpecs:`@@ -${Cy(t.deletionStart,i)},${i} +${Cy(t.additionStart,r)},${r} @@`,splitLineStart:0,splitLineCount:0,unifiedLineStart:0,unifiedLineCount:0,noEOFCRAdditions:!1,noEOFCRDeletions:!1};return Zv(s),s}function _y(e,t,n,r){t>0&&e.push({type:`context`,lines:t,additionLineIndex:n,deletionLineIndex:r})}function vy(e,t){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(Sy(r)!==Sy(i)||r.deletionCount!==i.deletionCount||xy(r)!==xy(i)||r.additionCount!==i.additionCount||r.splitLineCount!==i.splitLineCount||!yy(r,i))return!0}return!1}function yy(e,t){let n=by(e),r=by(t);for(;;){let e=n.next(),t=r.next();if(e.done===!0||t.done===!0)return e.done===t.done;if(e.value[0]!==t.value[0]||e.value[1]!==t.value[1])return!1}}function*by(e){for(let t of e.hunkContent){if(t.type===`context`){for(let e=0;e<t.lines;e++)yield[t.deletionLineIndex+e,t.additionLineIndex+e];continue}let e=Math.max(t.deletions,t.additions);for(let n=0;n<e;n++)yield[n<t.deletions?t.deletionLineIndex+n:void 0,n<t.additions?t.additionLineIndex+n:void 0]}}function xy(e){return yg(e.additionStart,e.additionCount)}function Sy(e){return yg(e.deletionStart,e.deletionCount)}function Cy(e,t){return t===0?e:e+1}function wy(e,t){return t===0?e-1:e}function Ty(e){Qv(e);for(let t=0;t<e.hunks.length;t++)Jv(e,t)}function Ey(e){let t=e.lang??mm(e.name),n=e.lang??(e.prevName==null?`text`:mm(e.prevName));return t===`text`&&n===`text`}var Dy=-1,Oy=class{options;annotationSlotName;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++Dy}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang=`text`;renderCache;pendingHighlightResult;pendingStructuralRows;editSessionActive=!1;constructor(e={theme:R},t=vm,n,r){this.options=e,this.annotationSlotName=t,this.onRenderUpdate=n,this.workerManager=r,r?.isWorkingPool()!==!0&&(this.highlighter=em(e.theme??R)?Zp():void 0)}cleanUp(){this.recycle(),this.expandedHunks.clear(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.clearRenderCache(),this.additionAnnotations={},this.deletionAnnotations={},this.workerManager?.cleanUpTasks(this),this.endEditSession()}beginEditSession(e,t){let{editSessionActive:n,renderCache:r}=this;this.editSessionActive=!0,n||(this.pendingHighlightResult=void 0),e!=null&&(this.diff=e);let i=e??this.diffCache;if(i!=null&&!i.isPartial&&i.additionLines.length===0){Object.assign(i,zv(i,this.options.parseDiffOptions)),this.markEditSessionPass(i),this.clearRenderCache();return}if(e==null||r==null||n&&r.diff===e)return;let{options:a}=this.getRenderOptions(e),o=r.diff===e,s=t!=null&&hg(r.diff,t),{result:c}=r;if(!r.highlighted||c==null||!ev(r.options,a)||!o&&!s){this.clearRenderCache();return}o||(this.renderCache={diff:e,options:a,highlighted:!0,result:{...c,code:{...c.code,additionLines:[...c.code.additionLines]}},renderRange:r.renderRange})}endEditSession(){this.editSessionActive=!1,this.pendingHighlightResult=void 0}editorRenderReady(){return this.renderCache?.options.useTokenTransformer===!0&&this.renderCache.highlighted&&this.renderCache.result!=null}refreshHighlightedResult(){let{diff:e,renderCache:t,workerManager:n}=this;return e==null||t==null||!hg(t.diff,e)||Ey(e)||By(e,this.getTokenizeMaxLength())?Promise.resolve():!this.editSessionActive&&n?.isWorkingPool()===!0&&e.cacheKey!=null?(n.evictDiffFromCache(e.cacheKey),n.primeDiffHighlightCache(e).then(()=>{this.applyRefreshedResult(e,n.getDiffResultCache(e))}).catch(e=>this.onHighlightError(e))):this.asyncHighlight(e).then(t=>this.applyRefreshedResult(e,t)).catch(e=>this.onHighlightError(e))}applyRefreshedResult(e,t){let{diff:n,renderCache:r}=this;if(t==null||n==null||r==null||!hg(n,e)||!hg(r.diff,e)||this.editSessionActive)return;let{options:i}=this.getRenderOptions(n);ev(i,t.options)&&(this.pendingHighlightResult={diff:n,options:t.options,highlighted:!0,result:t.result},this.onRenderUpdate?.())}get diffCache(){return this.renderCache?.diff??this.diff}clearRenderCache(){this.renderCache=void 0,this.pendingHighlightResult=void 0,this.pendingStructuralRows=void 0}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){let r={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t===`up`||t===`both`)&&(r.fromStart+=n),(t===`down`||t===`both`)&&(r.fromEnd+=n),this.renderCache?.highlighted!==!0&&this.clearRenderCache(),this.expandedHunks.set(e,r)}getExpandedHunk(e){return this.expandedHunks.get(e)??dn}getExpandedHunksMap(){return this.expandedHunks}setExpandedHunksMap(e){this.expandedHunks=e}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(let t of e){let e=(()=>{switch(t.side){case`deletions`:return this.deletionAnnotations;case`additions`:return this.additionAnnotations}})(),n=e[t.lineNumber]??[];e[t.lineNumber]=n,n.push(t)}}updateRenderCache(e,t,n=!1){this.pendingStructuralRows=void 0;let{renderCache:r}=this;if(r==null)return!1;let{result:i,diff:a}=r;if(i==null)return!1;if(a.isPartial)throw Error(`Could not update render cache for partial diff`);let o=i.code.additionLines,s=this.pendingStructuralRows=n?new Map:void 0,c=[],l=new Map;for(let[t,n]of e){let e=o[t]?.properties??{},r=n.map(e=>e[2]).join(``),i=t<a.additionLines.length,u=i?a.additionLines[t]??``:``,d=Ng(u);s==null&&i&&(a.additionLines[t]=uh(u,r),d!==r&&(c.push(t),l.set(t,u)));let f={type:`element`,tagName:`div`,properties:{"data-line":e[`data-line`]??t+1,"data-line-index":e[`data-line-index`]??t,"data-line-type":e[`data-line-type`]??`context`},children:n.map(([e,t,n])=>e===0&&t===``?n===``?{type:`element`,tagName:`br`,properties:{},children:[]}:{type:`text`,value:n}:{type:`element`,tagName:`span`,properties:{"data-char":e,style:`color:${t};`},children:[{type:`text`,value:n}]})};s==null?o[t]=f:s.set(t,f)}let u=!1;if(c.length>0){if(this.editSessionActive){if(a.additionLines.length<=1&&a.additionLines.join(``)===``)this.applyRecomputePreservingSessionType(a,zv(a,this.options.parseDiffOptions)),u=!0;else if(Lv(a,a.additionLines))this.applyRecomputePreservingSessionType(a,Rv(a,a.additionLines,this.options.parseDiffOptions)),u=!0;else{let e=ry(a,c,this.options.parseDiffOptions,l);this.applyExpansionRemap(e),u=e!=null}}else Object.assign(a,Uv(a,c,this.options.parseDiffOptions))}return i.baseThemeType=t,r.isDirty=!0,u}applyExpansionRemap(e){e!=null&&(this.expandedHunks=sy(this.expandedHunks,e))}applyDocumentChange(e){let{pendingStructuralRows:t,renderCache:n}=this;if(this.pendingStructuralRows=void 0,n==null)return;let{diff:r,result:i}=n;if(i==null)return;if(r.isPartial)throw Error(`Could not apply document change for partial diff`);let{additionLines:a}=r;if(r.additionLines=zy(e),i.code.additionLines=Ly(a,r.additionLines,i.code.additionLines,e),r.additionLines.length<=1&&r.additionLines.join(``)===``?(this.applyRecomputePreservingSessionType(r,zv(r,this.options.parseDiffOptions)),i.code.additionLines[0]=Ry(0,e.getLineText(0))):this.editSessionActive?this.applySessionDocumentChange(r):Object.assign(r,Bv(r,this.options.parseDiffOptions)),t!=null)for(let[e,n]of t)e<i.code.additionLines.length&&(i.code.additionLines[e]=n);n.isDirty=!0}applySessionDocumentChange(e){let{parseDiffOptions:t}=this.options,n=e.additionLines;if(Lv(e,n)){this.applyRecomputePreservingSessionType(e,Rv(e,n,t));return}this.applyExpansionRemap(ny(e,t))}applyRecomputePreservingSessionType(e,t){let n=this.editSessionActive?e.type:void 0;Object.assign(e,t),n!=null&&(e.type=n),this.markEditSessionPass(e)}markEditSessionPass(e){this.editSessionActive&&(e.editSessionDirty=!0)}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e,contentProperties:{"data-line-type":e}}}getSplitLineDecoration({side:e,type:t}){let n=t===`change`?e===`deletions`?`change-deletion`:`change-addition`:t;return{gutterLineType:n,contentProperties:{"data-line-type":n}}}createAnnotationElement=e=>im(e);getOptionsWithDefaults(){let{diffIndicators:e=`bars`,diffStyle:t=`split`,disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:i=!1,disableVirtualizationBuffers:a=!1,collapsed:o=!1,expandUnchanged:s=!1,collapsedContextThreshold:c=1,expansionLineCount:l=100,hunkSeparators:u=`line-info`,lineDiffType:d=`word-alt`,maxLineDiffLength:f=1e3,overflow:p=`scroll`,stickyHeader:m=!1,theme:h=R,headerRenderMode:g=`default`,tokenizeMaxLineLength:_=1e3,tokenizeMaxLength:v=on,useTokenTransformer:y=!1,useCSSClasses:b=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:r,disableLineNumbers:i,disableVirtualizationBuffers:a,collapsed:o,expandUnchanged:s,collapsedContextThreshold:c,expansionLineCount:l,hunkSeparators:u,lineDiffType:d,maxLineDiffLength:f,overflow:p,stickyHeader:m,theme:this.workerManager?.getDiffRenderOptions().theme??h,headerRenderMode:g,tokenizeMaxLineLength:_,tokenizeMaxLength:v,useTokenTransformer:y,useCSSClasses:b}}async initializeHighlighter(){return this.highlighter=await Xp(_m(this.computedLang,{theme:this.getLocalHighlightTheme(),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter})),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;let{options:t}=this.getRenderOptions(e),n=By(e,this.getTokenizeMaxLength()),r=this.workerManager?.getDiffResultCache(e);r!=null&&!ev(t,r.options)&&(r=void 0),this.renderCache??={diff:e,hydrated:!0,highlighted:!n&&!Ey(e),options:t,result:n?void 0:r?.result,renderRange:void 0},!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter??(this.computedLang=e.lang??mm(e.name),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??R}getEffectiveCodeOptions(){let e=this.workerManager?.isWorkingPool()===!0?this.workerManager.getDiffRenderOptions():void 0;return{theme:this.getLocalHighlightTheme(),tokenizeMaxLineLength:e?.tokenizeMaxLineLength??this.options.tokenizeMaxLineLength}}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0){let e=this.workerManager.getDiffRenderOptions();return this.editSessionActive&&e.useTokenTransformer!==!0?{...e,useTokenTransformer:!0}:e}let{theme:e,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}=this.getOptionsWithDefaults();return{theme:e,useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}})();this.getOptionsWithDefaults();let{renderCache:n}=this;return n?.result==null||!hg(e,n.diff)||!ev(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}getDiffForNextRender(e){let{options:t}=this.getRenderOptions(e);if(this.getReadyRenderResult(e,t)!=null||this.renderCache==null)return e;if(hg(this.renderCache.diff,e))return this.renderCache.diff;let n=!(e.additionLines.length>0||e.deletionLines.length>0)||Ey(e)||By(e,this.getTokenizeMaxLength());return this.canRenderDiff(e,t,n)?e:this.renderCache.diff}canRenderDiff(e,t,n){let{renderCache:r}=this;return r==null||hg(r.diff,e)?!0:n?r.result==null&&r.hydrated!==!0||this.workerManager?.isWorkingPool()===!0||this.highlighter!=null&&em(t.theme):r.result==null&&r.hydrated!==!0?!0:!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?!r.highlighted:this.highlighter!=null&&em(t.theme)}renderDiff(e=this.diff,t=fn){if(this.diff=e,e==null){this.pendingHighlightResult=void 0;return}let{expandUnchanged:n,collapsedContextThreshold:r}=this.getOptionsWithDefaults(),{options:i,forceHighlight:a}=this.getRenderOptions(e),o=this.getReadyRenderResult(e,i);this.pendingHighlightResult=void 0,o!=null&&(this.renderCache={...o,diff:e,renderRange:void 0},a=!1),this.renderCache??={diff:e,highlighted:!1,options:i,result:void 0,renderRange:void 0};let s=e.additionLines.length>0||e.deletionLines.length>0,c=!s||Ey(e)||By(e,this.getTokenizeMaxLength()),l=this.canRenderDiff(e,i,c),u=!hg(e,this.renderCache.diff),d=!rm(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){let o=this.renderCache.result==null&&this.renderCache.highlighted&&!c&&!u&&ym(t);l&&!o&&(c||this.renderCache.result==null||!this.renderCache.highlighted&&(u||d))&&(this.renderCache.diff=e,this.renderCache.options=i,this.renderCache.highlighted=!1,(this.renderCache.result==null||u||d||a)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,ym(t)||n?!0:this.expandedHunks,r)),this.renderCache.renderRange=t),!c&&s&&(!this.renderCache.highlighted||a)&&this.workerManager.highlightDiffAST(this,e)}else{this.computedLang=e.lang??mm(e.name);let t=this.highlighter!=null&&em(i.theme),n=this.highlighter!=null&&va(this.computedLang),r=!c&&n;if(l&&this.highlighter!=null&&t&&(a||c||!this.renderCache.highlighted&&r||this.renderCache.result==null)){let{result:t,options:i}=this.renderDiffWithHighlighter(e,this.highlighter,c||!n);this.renderCache={diff:e,options:i,highlighted:r,result:t,renderRange:void 0}}(!t||!c&&!n)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.applyHighlightResult(e,t,n,!c)})}return this.renderCache.result==null?void 0:this.processDiffResult(this.renderCache.diff,t,this.renderCache.result)}async asyncRender(e,t=fn){this.diff=e;let{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){let{diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o}=this.getOptionsWithDefaults();return lm({type:`diff`,diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){let t=By(e,this.getTokenizeMaxLength());this.computedLang=t?`text`:e.lang??mm(e.name);let n=this.highlighter!=null&&em(this.getLocalHighlightTheme()),r=t||this.highlighter!=null&&va(this.computedLang);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e),{collapsedContextThreshold:i}=this.getOptionsWithDefaults(),a=Av(e,t,r,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:i});if(this.editSessionActive&&e.additionLines.length===1&&e.additionLines[0]===``&&a.code.additionLines[0]==null){let t;if(Sv({diff:e,diffStyle:`both`,expandedHunks:n?!0:void 0,collapsedContextThreshold:i,callback:({additionLine:e})=>{if(e?.lineIndex===0)return t=e,!0}}),t==null)throw Error(`DiffHunksRenderer: missing empty addition line`);a.code.additionLines[0]=Ry(0,``,t.unifiedLineIndex,t.splitLineIndex)}return{result:a,options:r}}onHighlightSuccess(e,t,n,r=!0){this.editSessionActive||this.applyHighlightResult(e,t,n,r)}applyHighlightResult(e,t,n,r=!0){let{diff:i,renderCache:a}=this;i==null||a==null||!hg(i,e)||!ev(n,this.getRenderOptions(i).options)||(a.result==null||!a.highlighted||!ev(a.options,n)||!hg(a.diff,i))&&(this.pendingHighlightResult={diff:i,options:n,highlighted:r,result:t},this.onRenderUpdate?.())}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;let n=this.workerManager?.getDiffResultCache(e);if(!(n==null||!ev(t,n.options)))return n}getReadyRenderResult(e,t){let{pendingHighlightResult:n}=this;if(n!=null&&hg(n.diff,e)&&ev(n.options,t))return n;let r=this.getMatchingWorkerResultCache(e,t);if(!(r==null||this.hasHighlightedRenderCache(e,t)))return{diff:e,highlighted:!0,...r}}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&hg(e,n.diff)&&ev(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){let{diffStyle:a,disableFileHeader:o,expandUnchanged:s,expansionLineCount:c,collapsedContextThreshold:l,hunkSeparators:u}=this.getOptionsWithDefaults(),d=this.renderCache?.isDirty??!1,f=a===`unified`,p=Vy(e,this.options.loadDiffFiles!=null),m=!e.isPartial||p,h=[],g=[],_=[],v=[],{additionLines:y,deletionLines:b}=n,x={rowCount:0,hunkSeparators:u,additionsContentAST:h,deletionsContentAST:g,unifiedContentAST:_,unifiedGutterAST:kn(),deletionsGutterAST:kn(),additionsGutterAST:kn(),expansionLineCount:c,hunkData:v,incrementRowCount(e=1){x.rowCount+=e},pushToGutter(e,t){switch(e){case`unified`:x.unifiedGutterAST.children.push(t);break;case`deletions`:x.deletionsGutterAST.children.push(t);break;case`additions`:x.additionsGutterAST.children.push(t)}}},S=fv({fileDiff:e,errorPrefix:`DiffHunksRenderer.processDiffResult`}),C={size:0,side:void 0,increment(){this.size+=1},flush(){if(a!==`unified`){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side===`additions`?(x.pushToGutter(`additions`,jn(void 0,`buffer`,this.size)),h?.push(tv(this.size))):(x.pushToGutter(`deletions`,jn(void 0,`buffer`,this.size)),g?.push(tv(this.size))),this.size=0,this.side=void 0}}},w=(e,t,n,r,i)=>{x.pushToGutter(e,An(t,n,r,i))};function T(e){C.flush(),a===`unified`?Py(`unified`,e,x):(Py(`deletions`,e,x),Py(`additions`,e,x))}this.pushFileLevelAnnotations(e,a,t,x),Sv({diff:e,diffStyle:a,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:s?!0:this.expandedHunks,collapsedContextThreshold:l,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,additionLine:o,deletionLine:s,type:c})=>{let l=s==null?o.splitLineIndex:s.splitLineIndex,f=o==null?s.unifiedLineIndex:o.unifiedLineIndex;a===`split`&&c!==`change`&&C.flush(),r>0&&T({hunkIndex:t,collapsedLines:r,rangeSize:Math.max(n?.collapsedBefore??0,0),hunkSpecs:n?.hunkSpecs,isFirstHunk:t===0,isLastHunk:!1,isExpandable:m});let h=a===`unified`?f:l,g={type:c,hunkIndex:t,lineIndex:h,unifiedLineIndex:f,splitLineIndex:l,deletionLine:s,additionLine:o};if(a===`unified`){let n=this.getUnifiedInjectedRowsForLine?.(g);n?.before!=null&&jy(n.before,x);let r=s==null?void 0:b[s.lineIndex],i=o==null?void 0:y[o.lineIndex];if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let a=c===`change`?o==null?`change-deletion`:`change-addition`:c,u=this.getUnifiedLineDecoration({type:c,lineType:a,additionLineIndex:o?.lineIndex,deletionLineIndex:s?.lineIndex});w(`unified`,u.gutterLineType,o==null?s.lineNumber:o.lineNumber,`${f},${l}`,u.gutterProperties),i==null?r!=null&&(r=Fy(r,u.contentProperties,d&&s!=null?{"data-line":s.lineNumber,"data-line-index":`${f},${l}`}:void 0)):i=Fy(i,u.contentProperties,d&&o!=null?{"data-line":o.lineNumber,"data-line-index":`${f},${l}`}:void 0),Ny({diffStyle:`unified`,type:c,deletionLine:r,additionLine:i,unifiedSpan:this.getAnnotations(`unified`,s?.lineNumber,o?.lineNumber,t,h),createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&jy(n.after,x)}else{let n=this.getSplitInjectedRowsForLine?.(g);n?.before!=null&&My(n.before,x,C);let r=s==null?void 0:b[s.lineIndex],i=o==null?void 0:y[o.lineIndex],a=this.getSplitLineDecoration({side:`deletions`,type:c,lineIndex:s?.lineIndex}),u=this.getSplitLineDecoration({side:`additions`,type:c,lineIndex:o?.lineIndex});if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let f=(()=>{if(c===`change`){if(i==null)return`additions`;if(r==null)return`deletions`}})();f==null?c===`change`&&C.flush():(C.side!=null&&C.side!==f&&C.flush(),C.side=f,C.increment());let p=this.getAnnotations(`split`,s?.lineNumber,o?.lineNumber,t,h);if(p!=null&&C.size>0&&C.flush(),s!=null){let e=Fy(r,a.contentProperties,d?{"data-line":s.lineNumber,"data-line-index":`${s.unifiedLineIndex},${l}`}:void 0);w(`deletions`,a.gutterLineType,s.lineNumber,`${s.unifiedLineIndex},${l}`,a.gutterProperties),e!=null&&(r=e)}if(o!=null){let e=Fy(i,u.contentProperties,d?{"data-line":o.lineNumber,"data-line-index":`${o.unifiedLineIndex},${l}`}:void 0);w(`additions`,u.gutterLineType,o.lineNumber,`${o.unifiedLineIndex},${l}`,u.gutterProperties),e!=null&&(i=e)}Ny({diffStyle:`split`,type:c,additionLine:i,deletionLine:r,...p,createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&My(n.after,x,C)}let _=a===`split`&&n!=null&&l===n.splitLineStart+n.splitLineCount-1,v=t===e.hunks.length-1&&n!=null&&(a===`split`?l===n.splitLineStart+n.splitLineCount-1:f===n.unifiedLineStart+n.unifiedLineCount-1),E=_?n.noEOFCRDeletions:!1,D=_?n.noEOFCRAdditions:!1,O=(s?.noEOFCR??!1)||E,k=(o?.noEOFCR??!1)||D;if(k||O){if(a===`split`&&C.flush(),O){let e=c===`context`||c===`context-expanded`?c:`change-deletion`;a===`unified`?(x.unifiedContentAST.push(nv(e)),x.pushToGutter(`unified`,jn(e,`metadata`,1))):(x.deletionsContentAST.push(nv(e)),x.pushToGutter(`deletions`,jn(e,`metadata`,1)),k||(x.pushToGutter(`additions`,jn(void 0,`buffer`,1)),x.additionsContentAST.push(tv(1))))}if(k){let e=c===`context`||c===`context-expanded`?c:`change-addition`;a===`unified`?(x.unifiedContentAST.push(nv(e)),x.pushToGutter(`unified`,jn(e,`metadata`,1))):(x.additionsContentAST.push(nv(e)),x.pushToGutter(`additions`,jn(e,`metadata`,1)),O||(x.pushToGutter(`deletions`,jn(void 0,`buffer`,1)),x.deletionsContentAST.push(tv(1))))}x.incrementRowCount(1)}u!==`simple`&&u!==`metadata`&&(i>0||v&&p)&&T({hunkIndex:c===`context-expanded`?t:t+1,collapsedLines:v&&p?`unknown`:i,rangeSize:S,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:m}),x.incrementRowCount(1)}}),a===`split`&&C.flush();let E=Math.max(ov(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),D=t.bufferBefore>0||t.bufferAfter>0,O=!f&&e.type!==`deleted`,k=!f&&e.type!==`new`,A=x.rowCount>0||D;h=O&&A?h:void 0,g=k&&A?g:void 0,_=f&&A?_:void 0;let j=this.createPreElement(g!=null&&h!=null,E);return{fileDiff:e,unifiedGutterAST:f&&A?x.unifiedGutterAST.children:void 0,unifiedContentAST:_,deletionsGutterAST:k&&A?x.deletionsGutterAST.children:void 0,deletionsContentAST:g,additionsGutterAST:O&&A?x.additionsGutterAST.children:void 0,additionsContentAST:h,hunkData:v,preNode:j,themeStyles:r,baseThemeType:i,headerElement:o?void 0:this.renderHeader(e),totalLines:E,rowCount:x.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:``}}renderCodeAST(e,t){let n=e===`unified`?t.unifiedGutterAST:e===`deletions`?t.deletionsGutterAST:t.additionsGutterAST,r=e===`unified`?t.unifiedContentAST:e===`deletions`?t.deletionsContentAST:t.additionsContentAST;if(n==null||r==null)return;let i=kn(n);return i.properties.style=`grid-row: span ${t.rowCount}`,[i,dh(r,t.rowCount)]}renderFullAST(e,t=[]){let n=this.getOptionsWithDefaults().hunkSeparators===`line-info`,r=this.renderCodeAST(`unified`,e);if(r!=null)return t.push(z({tagName:`code`,children:r,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-unified":``}})),{...e.preNode,children:t};let i=this.renderCodeAST(`deletions`,e);i!=null&&t.push(z({tagName:`code`,children:i,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-deletions":``}}));let a=this.renderCodeAST(`additions`,e);return a!=null&&t.push(z({tagName:`code`,children:a,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-additions":``}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return Ii(this.renderFullAST(e,t))}renderPartialHTML(e,t){return Ii(t==null?e:z({tagName:`code`,children:e,properties:{"data-code":``,"data-container-size":this.getOptionsWithDefaults().hunkSeparators===`line-info`?``:void 0,[`data-${t}`]:``}}))}pushFileLevelAnnotations(e,t,n,r){if(!lh(n))return;let i=e.type===`new`?[]:this.getAnnotationNames(ch(this.deletionAnnotations)),a=e.type===`deleted`?[]:this.getAnnotationNames(ch(this.additionAnnotations));if(i.length===0&&a.length===0)return;let{createAnnotationElement:o}=this;if(t===`unified`){Ny({diffStyle:t,type:`context`,unifiedSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i.concat(a)},createAnnotationElement:o,context:r});return}Ny({diffStyle:t,type:`context`,deletionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i},additionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:a},createAnnotationElement:o,context:r})}getAnnotations(e,t,n,r,i){let a={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(t!=null)for(let e of this.deletionAnnotations[t]??[])a.annotations.push(this.annotationSlotName(e));let o={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(n!=null)for(let t of this.additionAnnotations[n]??[])(e===`unified`?a:o).annotations.push(this.annotationSlotName(t));if(e===`unified`)return a.annotations.length>0?a:void 0;if(o.annotations.length!==0||a.annotations.length!==0)return{deletionSpan:a,additionSpan:o}}getAnnotationNames(e){return e?.map(e=>this.annotationSlotName(e))??[]}renderHeader(e){let{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return om({fileOrDiff:e,mode:t,stickyHeader:n})}},ky=new Intl.PluralRules(`en-US`);function Ay(e){return`${e} unmodified line${ky.select(e)===`one`?``:`s`}`}function jy(e,t){for(let n of e)t.unifiedContentAST.push(n.content),t.pushToGutter(`unified`,n.gutter),t.incrementRowCount(1)}function My(e,t,n){for(let{deletion:r,addition:i}of e){if(r==null&&i==null)continue;let e=r!=null&&i!=null?void 0:r==null?`deletions`:`additions`;(e==null||n.side!==e)&&n.flush(),r!=null&&(t.deletionsContentAST.push(r.content),t.pushToGutter(`deletions`,r.gutter)),i!=null&&(t.additionsContentAST.push(i.content),t.pushToGutter(`additions`,i.gutter)),e!=null&&(n.side=e,n.increment()),t.incrementRowCount(1)}}function Ny({diffStyle:e,type:t,deletionLine:n,additionLine:r,unifiedSpan:i,deletionSpan:a,additionSpan:o,createAnnotationElement:s,context:c}){let l=!1;if(e===`unified`){if(r==null?n!=null&&c.unifiedContentAST.push(n):c.unifiedContentAST.push(r),i!=null){let e=t===`change`?n==null?`change-addition`:`change-deletion`:t;c.unifiedContentAST.push(s(i)),c.pushToGutter(`unified`,jn(e,`annotation`,1)),l=!0}}else if(e===`split`){if(n!=null&&c.deletionsContentAST.push(n),r!=null&&c.additionsContentAST.push(r),a!=null){let e=t===`change`?n==null?`context`:`change-deletion`:t;c.deletionsContentAST.push(s(a)),c.pushToGutter(`deletions`,jn(e,`annotation`,1)),l=!0}if(o!=null){let e=t===`change`?r==null?`context`:`change-addition`:t;c.additionsContentAST.push(s(o)),c.pushToGutter(`additions`,jn(e,`annotation`,1)),l=!0}}l&&c.incrementRowCount(1)}function Py(e,{hunkIndex:t,collapsedLines:n,rangeSize:r,hunkSpecs:i,isFirstHunk:a,isLastHunk:o,isExpandable:s},c){if(typeof n==`number`&&n<=0)return;let l=e===`unified`?c.unifiedContentAST:e===`deletions`?c.deletionsContentAST:c.additionsContentAST;if(c.hunkSeparators===`metadata`){i!=null&&(c.pushToGutter(e,iv({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),l.push(iv({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1));return}if(c.hunkSeparators===`simple`){t>0&&(c.pushToGutter(e,iv({type:`simple`,isFirstHunk:a,isLastHunk:!1})),l.push(iv({type:`simple`,isFirstHunk:a,isLastHunk:!1})),e!==`additions`&&c.incrementRowCount(1));return}let u=av(e,t),d=r>c.expansionLineCount,f=s?t:void 0,p=typeof n==`number`?Ay(n):`More unchanged context may be available`;c.pushToGutter(e,iv({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),l.push(iv({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1),c.hunkData.push({slotName:u,hunkIndex:t,lines:typeof n==`number`?n:0,lineCountKnown:typeof n==`number`,type:e,expandable:s?{up:!a,down:!o,chunked:d}:void 0})}function Fy(e,t,n){return e==null||e.type!==`element`||t==null&&n==null?e:{...e,properties:{...e.properties,...t,...n}}}function Iy(e){return e.length>0&&e[e.length-1]===``?e.length-1:e.length}function Ly(e,t,n,r){let i=Iy(e),a=Iy(t),o=Math.min(i,a),s=0;for(;s<o&&e[s]===t[s];)s++;let c=0;for(;c<o-s&&e[i-1-c]===t[a-1-c];)c++;let l=Array(t.length);for(let e=0;e<s;e++)l[e]=n[e];for(let e=0;e<c;e++)l[a-1-e]=n[i-1-e];i<e.length&&a<t.length&&(l[t.length-1]=n[e.length-1]);for(let e=s;e<t.length;e++)l[e]??=Ry(e,r.getLineText(e));return l}function Ry(e,t,n=e,r=e){return{type:`element`,tagName:`div`,properties:{"data-line":e+1,"data-line-index":`${n},${r}`,"data-line-type":`context`},children:[{type:`element`,tagName:`span`,properties:{"data-char":0},children:[{type:`text`,value:t}]}]}}function zy(e){let t=[];for(let n=0;n<e.lineCount;n++)t.push(e.getLineText(n,!0));return t}function By(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function Vy(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function Hy(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function Uy(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.lineCountKnown===t.lineCountKnown&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}async function Wy(e,t=300){let n;try{await Promise.race([e(),new Promise(e=>{n=setTimeout(e,t)})])}finally{n!=null&&clearTimeout(n)}}function Gy({oldFile:e,newFile:t},n){if(e!==void 0||t!==void 0){if(e===void 0||t===void 0)throw Error(`${n}: Pass null for an intentionally missing oldFile or newFile side`);if(e===null){if(t===null)throw Error(`${n}: You must pass oldFile, newFile, or both`);return{oldFile:e,newFile:t}}return{oldFile:e,newFile:t}}}function Ky(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:Wh(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators==`function`?`custom`:e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,loadDiffFiles:e?.loadDiffFiles,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}function qy(e){return e.isPartial&&(e.type===`change`||e.type===`rename-changed`||e.type===`rename-pure`)}function Jy(e){let t={...e};return delete t.cacheKey,t}function Yy(e,t){if(e.isPartial||t.isPartial)throw Error(`FileDiff.shouldResetEditorForExternalDiff: diffs must be fully hydrated`);let n=e.lang??mm(e.name),r=t.lang??mm(t.name),i=e.type!==`new`,a=t.type!==`new`;return e.name!==t.name||n!==r||i!==a||e.deletionLines.length!==t.deletionLines.length||e.deletionLines.some((e,n)=>e!==t.deletionLines[n])}function Xy(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function Zy(e,t){let{oldFile:n}=e;return n==null?t.type===`new`:t.type!==`new`&&n.name===(t.prevName??t.name)&&Xy(n.lines,t.deletionLines)}var Qy=-1,$y=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++Qy}`;type=`file-diff`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerFilenameSuffix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;editSessionDiff;editSessionAnnotations;outgoingSessionDiff;renderedDiff;renderRange;pendingFiles;appliedPreAttributes;headerCache={lastRenderedHTML:void 0,html:void 0,fileDiff:void 0};lastRowCount;mounted=!1;enabled=!0;editor;refreshViewTimeout;lineStateRefreshPending=!1;deferredSelectedLines;deferredEditorActiveLine;constructor(e={theme:R},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new oa,this.scrollSyncManager=new $_,this.interactionManager=new zi(`diff`,Bi(e,typeof e.hunkSeparators==`function`||(e.hunkSeparators??`line-info`)===`line-info`||e.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getHunksRendererOptions(e){return Ky(e)}createHunksRenderer(e){return new Oy(this.getHunksRendererOptions(e),this.getAnnotationSlotName,this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t=`additions`)=>this.getLineIndexForDiff(this.getDiffForLineIndex(),e,t);getDiffForLineIndex(){return this.getRenderedDiff()}getLineIndexForDiff(e,t,n){if(e==null)return;let r=e.hunks.at(-1),i,a;hunkIterator:for(let o of e.hunks){let e=n===`deletions`?o.deletionStart:o.additionStart,s=n===`deletions`?o.deletionCount:o.additionCount,c=yg(e,s)+1,l=o.splitLineStart,u=o.unifiedLineStart;if(t<c){let e=c-t;i=Math.max(u-e,0),a=Math.max(l-e,0);break hunkIterator}if(t>=c+s){if(o===r){let e=t-(c+s);i=u+o.unifiedLineCount+e,a=l+o.splitLineCount+e;break hunkIterator}continue}for(let e of o.hunkContent)if(e.type===`context`){if(t<c+e.lines){let e=t-c;a=l+e,i=u+e;break hunkIterator}c+=e.lines,l+=e.lines,u+=e.lines}else{let r=n===`deletions`?e.deletions:e.additions;if(t<c+r){let r=t-c;i=u+(n===`additions`?e.deletions:0)+r,a=l+r;break hunkIterator}c+=r,l+=Math.max(e.deletions,e.additions),u+=e.deletions+e.additions}break hunkIterator}if(i!=null&&a!=null)return[i,a]}setOptions(e){e!=null&&(this.options=e,this.clearReusableHeader(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(Bi(this.options,typeof this.options.hunkSeparators==`function`||(this.options.hunkSeparators??`line-info`)===`line-info`||this.options.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType!==t&&(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!bn(this.appliedThemeCSS.theme,this.options.theme??R)}getHoveredLine=()=>this.interactionManager.getHoveredLine();getAnnotationSlotName=e=>Uh(this.editSessionAnnotations,e,vm);getLatestAnnotations(){return this.editSessionAnnotations?.current??this.lineAnnotations}isNewAnnotations(e){let{editSessionAnnotations:t,lineAnnotations:n}=this;return e===n?!1:t==null||e!==t.provided&&e!==t.current}setLineAnnotations(e){let{editSessionAnnotations:t}=this;if(t==null){this.lineAnnotations=e;return}this.isNewAnnotations(e)&&(this.lineAnnotations=e,Hh(t,e,vm))}syncEditSessionAnnotationsFromEditor(e){let{editSessionAnnotations:t}=this;return t==null||e===t.current?!1:(t.current=e,this.hunksRenderer.setLineAnnotations(e),this.renderAnnotations(),!0)}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators==`function`)}setSelectedLines(e,t){this.lineStateRefreshPending?this.deferredSelectedLines=[e,t]:this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.lineStateRefreshPending?this.deferredEditorActiveLine=[e,t]:this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??`additions`})}flushDeferredLineState(){let{deferredEditorActiveLine:e,deferredSelectedLines:t}=this;this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,e!=null&&this.setEditorActiveLine(...e),t!=null&&this.interactionManager.setSelection(...t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{diffStyle:e=`split`,overflow:t=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:t===`wrap`,columnVariables:this.shouldApplyColumnVariables(t)?`apply`:`measure`}),t===`scroll`&&e===`split`?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}shouldApplyColumnVariables(e){return typeof this.options.hunkSeparators==`function`||e===`scroll`&&(this.getLatestAnnotations().length>0||this.pre?.hasAttribute(`data-has-merge-conflict`)===!0)}getCodeScrollLeft(){return Math.max(this.codeUnified?.scrollLeft??0,this.codeDeletions?.scrollLeft??0,this.codeAdditions?.scrollLeft??0)}setCodeScrollLeft(e){this.codeUnified!=null&&(this.codeUnified.scrollLeft=e),this.codeAdditions!=null&&(this.codeAdditions.scrollLeft=e),this.codeDeletions!=null&&(this.codeDeletions.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.hunksRenderer.getEffectiveCodeOptions()}}cleanUp(e=!1){let{editor:t}=this;_n(this.handleEditSessionRender),this.emitPostRender(!0),t?.cleanUp(e?`recycle`:`discard`),e||(this.editor=void 0),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,e||(this.pendingFiles=void 0),this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,this.headerCache.lastRenderedHTML=void 0,e||this.clearReusableHeader(),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.editSessionDiff=void 0,this.editSessionAnnotations=void 0,this.outgoingSessionDiff=void 0,this.renderedDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate({fileContainer:e,prerenderedHTML:t,preventEmit:n=!1,lineAnnotations:r,fileDiff:i,...a}){if(!this.enabled)throw Error(`FileDiff.hydrate: attempting to call hydrate after cleaned up`);if(this.fileContainer!=null)throw Error(`FileDiff.hydrate: hydrate can only be called before the instance has rendered or hydrated`);let o=Gy(a,`FileDiff.hydrate`),s=o?.oldFile,c=o?.newFile;this.hydrateElements(e,t);let l=this.editor!=null;l||ib(this.pre,nb({fileDiff:i,oldFile:s,newFile:c}),this.options.collapsed)||ab(this.headerElement,rb({fileDiff:i,oldFile:s,newFile:c}),this.options.disableFileHeader)?this.render({...a,fileContainer:e,lineAnnotations:r,fileDiff:i,forceRender:l||a.forceRender,preventEmit:!0}):this.hydrationSetup({fileDiff:i,lineAnnotations:r,...o}),n||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),Rh(e,t);for(let t of e.shadowRoot?.children??[]){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t;for(let e of t.children)!(e instanceof HTMLElement)||e.tagName.toLowerCase()!==`code`||(`deletions`in e.dataset&&(this.codeDeletions=e),`additions`in e.dataset&&(this.codeAdditions=e),`unified`in e.dataset&&(this.codeUnified=e));continue}if(`diffsHeader`in t.dataset){this.headerElement=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:r}){this.lineAnnotations=r??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!==void 0&&n!==void 0?Z_(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderedDiff=this.fileDiff,this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.loadFilesIfNecessary(),this.rerender()};loadFilesIfNecessary(){let{fileDiff:e,options:{loadDiffFiles:t}}=this;if(e==null||t==null||!qy(e)||this.pendingFiles?.fileDiff===e)return;let n=this.loadFilesForDiff(e,t),r=this.pendingFiles={fileDiff:e,promise:n};r.promise=n.finally(()=>{this.pendingFiles===r&&(this.pendingFiles=void 0)})}async loadFilesForDiff(e,t){try{let n=await t(e);if(!this.enabled||this.fileDiff!==e)return;await this.handleFilesLoaded(e,n)}catch(e){if(this.options.disableErrorHandling===!0)throw e;console.error(e)}}async handleFilesLoaded(e,t){if(!(this.fileDiff!==e||!e.isPartial)){if(wg(`merge`,e,t),this.setHydratedState(t),this.startHydratedEditSession(e)){this.rerender();return}await Wy(()=>this.primeHighlightCache(e)),!(!this.enabled||this.fileDiff!==e)&&this.rerender()}}startHydratedEditSession(e){if(e.isPartial)throw Error(`FileDiff.startHydratedEditSession: diffs cannot be partial for editing`);if(this.fileDiff!==e)return!1;let{editor:t}=this;return this.outgoingSessionDiff==null?t==null||this.editSessionDiff!=null?!1:(this.installEditSession(e,t.__getDocumentContents(eb(e)),t.__getDocumentSessionState()),!0):(this.installEditSession(e),!0)}updateExternalDiff(e,t){if(hg(this.fileDiff,e))return!1;let n=this.outgoingSessionDiff??this.editSessionDiff;return this.fileDiff=e,this.outgoingSessionDiff=void 0,n==null?this.editor!=null&&(e.isPartial?this.loadFilesIfNecessary():this.installEditSession(e,this.editor.__getDocumentContents(eb(e)),this.editor.__getDocumentSessionState())):(this.outgoingSessionDiff=n,e.isPartial?this.loadFilesIfNecessary():this.installEditSession(e)),this.editSessionAnnotations!=null&&t!=null&&(this.lineAnnotations=t,this.editSessionAnnotations=Vh(t,vm,this.editSessionAnnotations)),!0}installEditSession(e,t,n){let r=e.additionLines.join(``),i=t==null?void 0:Cg(t.contents),a=n!=null&&Zy(n,e);if(n!=null&&!a)throw Error(`FileDiff: retained session cannot resume against a different old file`);if(t!=null&&t.contents!==r&&!a)throw Error(`FileDiff: retained edits are missing their diff session state`);let o=t==null||t.name===e.name&&t.lang===e.lang&&t.contents===r,s=Jy(e);t!=null&&i!=null&&!o&&(s.name=t.name,s.lang=t.lang),a&&n!=null&&i!=null&&(s.additionLines=i,s.type=n.type,s.hunks=n.hunks,s.editSessionDirty=!0,Qv(s)),this.editSessionDiff=s,this.hunksRenderer.beginEditSession(s,o&&!a?e:void 0)}setHydratedState(e){this.deletionFile=e.oldFile,this.additionFile=e.newFile,this.workerManager?.cleanUpTasks(this.hunksRenderer),this.hunksRenderer.clearRenderCache()}render({fileDiff:e,deferManagers:t=!1,forceRender:n=!1,preventEmit:r=!1,lineAnnotations:i,fileContainer:a,containerWrapper:o,renderRange:s,...c}){if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);let l=Gy(c,`FileDiff.render`),u=l?.oldFile,d=l?.newFile;this.editor?.__postponeBgTokenizeToNextFrame();let{collapsed:f=!1,themeType:p=`system`,expandUnchanged:m=!1}=this.options,h=f?void 0:s,g=this.hasThemeChanged(),_=l!=null,v=_&&(!tb(u,this.deletionFile)||!tb(d,this.additionFile)),y=e!=null&&!hg(e,this.fileDiff),b=i!=null&&(i.length>0||this.getLatestAnnotations().length>0)&&this.isNewAnnotations(i);if(!f&&rm(h,this.renderRange)&&!n&&!b&&!g&&(e!=null&&!y||e==null&&!v))return this.applyCachedThemeState(p);let x;e==null&&_&&(v||this.fileDiff==null)&&(x=Z_(l.oldFile,l.newFile,this.options.parseDiffOptions));let{renderRange:S}=this;this.renderRange=h,_?(this.deletionFile=u,this.additionFile=d):e!=null&&(this.deletionFile=void 0,this.additionFile=void 0),e!=null&&y?this.updateExternalDiff(e,i):x!=null&&(y=!0,this.updateExternalDiff(x,i)),y&&this.clearReusableHeader(),i!=null&&this.setLineAnnotations(i);let C=this.getLatestDiff();if(C==null)return!1;C.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(uy(C,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),m&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.getLatestAnnotations());let{disableErrorHandling:w=!1,disableFileHeader:T=!1}=this.options;if(T&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.headerCache.lastRenderedHTML=void 0),this.clearHeaderSlots()),a=this.getOrCreateFileContainer(a,o),this.applyCachedThemeState(p),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(C,pn);e!=null&&this.applyThemeState(a,e.themeStyles,p,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,a,e.fileDiff),this.renderSeparators([]),this.renderedDiff=e?.fileDiff??C,this.injectUnsafeCSS()}catch(e){if(w)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(a);if(!(this.canPartiallyRender(n,b,v||y||g||!hg(this.renderedDiff,C))&&this.applyPartialRender({fileDiff:C,previousRenderRange:S,renderRange:h}))){let t=this.hunksRenderer.renderDiff(C,h);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.isWorkingPool()&&this.workerManager.initialize().catch(()=>{}).then(()=>this.rerender()),!1;this.applyThemeState(a,t.themeStyles,p,t.baseThemeType),t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,a,t.fileDiff),t.additionsContentAST!=null||t.deletionsContentAST!=null||t.unifiedContentAST!=null?this.applyHunksToDOM(e,t):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData),this.renderedDiff=t.fileDiff}this.applyBuffers(e,h),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,t||this.flushManagers(),this.editor!=null&&this.syncRenderViewToEditor()}catch(e){if(w)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}getLatestDiff(e=this.fileDiff){return this.editSessionDiff??e}getRenderedDiff(){return this.renderedDiff}syncRenderViewToEditor(){let{editor:e,fileContainer:t}=this,n=this.getLatestAnnotations(),r=this.computeEditorRenderRange(this.renderRange),i=this.getLatestDiff();e==null||t==null||i==null||i.isPartial||this.hunksRenderer.initializeHighlighter().then(a=>{if(!this.enabled||this.editor!==e||this.fileContainer!==t||this.getLatestDiff()!==i)return;let{outgoingSessionDiff:o,fileDiff:s}=this,c=o!=null&&s!=null&&o!==i,l=c?Yy(o,s):!1;c&&(this.outgoingSessionDiff=void 0),e.__syncRenderView({highlighter:a,fileContainer:t,fileDiff:i,lineAnnotations:n,renderRange:r,externalDocument:c,resetHistory:l})})}computeEditorRenderRange(e){let t=this.getLatestDiff();if(e==null||t==null||ym(e))return e;let{diffStyle:n=`split`,expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a,o;return Sv({diff:t,diffStyle:n,startingLine:e.startingLine,totalLines:e.totalLines,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({additionLine:e})=>{e!=null&&(a??=e.lineNumber,o=e.lineNumber)}}),a==null||o==null?{...e,startingLine:0,totalLines:0}:{...e,startingLine:a-1,totalLines:o-a+1}}emitEditChange(e){let{lineAnnotations:t}=e;t!=null&&this.syncEditSessionAnnotationsFromEditor(t);let{onEditChange:n}=this.options;n?.(e)}__captureDocumentSessionState(e=!0){let{outgoingSessionDiff:t,fileDiff:n,editSessionDiff:r}=this;if(t!=null&&n!=null){if(!n.isPartial&&Yy(t,n))return;r=t}if(!(r==null||r.isPartial))return{diffSession:{oldFile:r.type===`new`?null:{name:r.prevName??r.name,lines:e?[...r.deletionLines]:r.deletionLines},type:r.type,hunks:e?_g(r.hunks):r.hunks},hasChanges:r.editSessionDirty===!0}}__attachEditor(e){if(this.type!==`file-diff`)throw Error(`FileDiff.__attachEditor: cannot attach an editor to a "${this.type}" diff`);if(this.editor!=null)throw Error(`FileDiff.__attachEditor: an editor is already attached`);let t=()=>{this.editor=void 0,this.finishEditSession()};try{return this.resumeEditorRendering(e),t}catch(e){throw t(),e}}__resumeEditor(e){if(this.editor!==e)throw Error(`FileDiff.__resumeEditor: editor association changed`);this.resumeEditorRendering(e)}resumeEditorRendering(e){this.editSessionAnnotations??=Vh(this.lineAnnotations,vm);let{fileDiff:t,outgoingSessionDiff:n}=this;n!=null&&t!=null&&!t.isPartial&&this.editSessionDiff===n&&this.installEditSession(t);let r=this.editSessionDiff==null&&t!=null&&!t.isPartial?t:void 0;if(r==null?this.hunksRenderer.beginEditSession(this.editSessionDiff):this.installEditSession(r,e.__getDocumentContents(eb(r)),e.__getDocumentSessionState()),this.editor=e,this.fileDiff?.isPartial===!0&&this.loadFilesIfNecessary(),this.hunksRenderer.editorRenderReady()){let{editSessionDiff:e}=this;e!=null&&this.hunksRenderer.diffCache===e&&(this.renderedDiff=e),this.syncRenderViewToEditor()}else this.rerender()}finishEditSession(){this.hunksRenderer.endEditSession(),this.finalizeEditSessionHunks()}__completeEditSession(e,t){this.settleEditSession(t===`install`,e)}settleEditSession(e,t){let{editSessionDiff:n,editSessionAnnotations:r,fileDiff:i,lineAnnotations:a}=this;if(n==null||i==null)return;if(this.editor!=null)throw Error(`FileDiff.__completeEditSession: detach the editor before completing the session`);this.hunksRenderer.endEditSession(),this.finalizeEditSessionHunks();let o=r?.current,s,c=null,l=null,u=!1,d;if(t==null)throw Error(`FileDiff.__completeEditSession: editor is required for completion`);let f=vg(n),p={name:f.name,contents:f.additionLines.join(``)};f.lang!=null&&(p.lang=f.lang);let m={fileDiff:f,editor:t,originalFileDiff:i,oldFile:f.type===`new`?null:{name:f.prevName??f.name,contents:f.deletionLines.join(``)},newFile:p,lineAnnotations:o,originalLineAnnotations:a};Object.freeze(m);try{if(t.__emitEditComplete(m),this.options.onEditComplete?.(m)===`accept`){if(f.cacheKey!=null&&f.cacheKey===i.cacheKey)throw Error(`FileDiff.__completeEditSession: an accepted diff must not reuse the replaced diff cacheKey`);s=f,c=m.oldFile,l=m.newFile}}catch(e){u=!0,d=e}if(e&&s!=null&&(this.fileDiff=s,this.additionFile!=null&&(this.deletionFile=c,this.additionFile=l),o!=null&&(this.lineAnnotations=o)),this.editSessionDiff=void 0,this.editSessionAnnotations=void 0,this.outgoingSessionDiff=void 0,e&&this.fileContainer!=null&&this.rerender(),u)throw d}finalizeEditSessionHunks(){let e=this.getLatestDiff();if(e==null||e.editSessionDirty!==!0)return!1;let{collapsedContextThreshold:t=1}=this.options,n=cy(e,this.hunksRenderer.getExpandedHunksMap(),t);return uy(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(ly(e,n)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(e,t){let{editSessionDiff:n}=this;if(n==null)throw Error(`FileDiff.applyDocumentChange: requires an active edit session`);this.detachAdditionLines(),this.hunksRenderer.beginEditSession(n),this.hunksRenderer.applyDocumentChange(e),t!=null&&this.syncEditSessionAnnotationsFromEditor(t),this.rerender(),this.interactionManager.setSelectionDirty()}updateRenderCache(e,t,n={}){let{editSessionDiff:r}=this;if(r==null)throw Error(`FileDiff.updateRenderCache: requires an active edit session`);this.detachAdditionLines(),this.hunksRenderer.beginEditSession(r);let{shouldRefreshDiffsView:i,lineCountChangeInFlight:a}=n;if(this.hunksRenderer.updateRenderCache(e,t,a)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}i===!0&&(this.refreshViewTimeout!=null&&clearTimeout(this.refreshViewTimeout),this.lineStateRefreshPending=!0,this.refreshViewTimeout=setTimeout(()=>{this.refreshViewTimeout=void 0,this.options.diffStyle===`split`?this.refreshSplitDiffView():this.refreshUnifiedDiffView(),this.flushDeferredLineState()},150))}detachAdditionLines(){let{editSessionDiff:e,fileDiff:t}=this;e!=null&&(e.additionLines===t?.additionLines||e.additionLines===e.deletionLines)&&(e.additionLines=[...e.additionLines])}isLineRenderable(e){let t=this.getRenderedDiff();if(t==null)return!0;let{expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options;return mv({fileDiff:t,lineNumber:e,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r})}getNearestRenderableLine(e,t){let n=this.getRenderedDiff();if(n==null)return e;let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options;return hv({fileDiff:n,lineNumber:e,direction:t,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i})}revealLine(e){let t=this.getRenderedDiff(),{expandUnchanged:n=!1,collapsedContextThreshold:r=1,expansionLineCount:i=100}=this.options;if(t==null||t.isPartial||n)return!1;let a=this.hunksRenderer.getExpandedHunksMap();for(let[n,o]of t.hunks.entries()){let[s,c]=lv(o);if(e<s){let c=uv({isPartial:t.isPartial,rangeSize:o.collapsedBefore,expandedHunks:a,hunkIndex:n,collapsedContextThreshold:r}),l=s-c.rangeSize;if(c.renderAll||e<l+c.fromStart||e>=s-c.fromEnd)return!1;let u=e-(l+c.fromStart)+1,d=s-c.fromEnd-e;return u<=d?this.expandHunk(n,`up`,u+i):this.expandHunk(n,`down`,d+i),!0}if(e<c)return!1}let o=pv({fileDiff:t,hunkIndex:t.hunks.length-1,expandedHunks:a,collapsedContextThreshold:r,errorPrefix:`FileDiff.revealLine`});if(o==null||o.renderAll)return!1;let s=t.hunks[t.hunks.length-1],[,c]=lv(s);return e<c+o.fromStart||e>=c+o.rangeSize?!1:(this.expandHunk(t.hunks.length,`up`,e-(c+o.fromStart)+1+i),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){gn(this.handleEditSessionRender)}handleEditSessionRender=()=>{this.rerender(),this.flushDeferredLineState()};removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty(`height`,`${e}px`),!0}async primeHighlightCache(e=this.fileDiff){let{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||Ey(e))return;let n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||await t.primeDiffHighlightCache(e).catch(e=>{console.error(e)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.headerCache.lastRenderedHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!=`function`){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let r of e){let e=r.slotName,i=this.separatorCache.get(e);if(i==null||!Uy(r,i.hunkData)){i?.element.remove();let n=document.createElement(`div`);n.style.display=`contents`,n.slot=r.slotName;let a=t(r,this);a!=null&&n.appendChild(a),this.fileContainer.appendChild(n),i={element:n,hunkData:r},this.separatorCache.set(e,i)}n.delete(e)}for(let[e,{element:t}]of n.entries())this.separatorCache.delete(e),t.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options,n=this.getLatestAnnotations();if(t!=null&&n.length>0)for(let[r,i]of n.entries()){let n=this.getAnnotationSlotName(i),a=`${r}-${n}`,o=this.annotationCache.get(a);if(o==null||!Hy(i,o.annotation)){o?.element.remove();let e=t(i);if(e==null)continue;o={element:Sh(n),annotation:i},o.element.appendChild(e),this.fileContainer.appendChild(o.element),this.annotationCache.set(a,o)}e.delete(a)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=Ch();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return n!=null&&i&&this.editor?.__captureFocusForDOMReplacement(),i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.headerCache.lastRenderedHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),i&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t!=null)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:Bh(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):Bh(e)&&e.hasAttribute(`data-unsafe-css`)&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});if(this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=_h;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return this.pre==null?(this.pre=document.createElement(`pre`),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(this.editor?.__captureFocusForDOMReplacement(),t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(let t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute(`data-unified`)?this.codeUnified=t:t.hasAttribute(`data-deletions`)?this.codeDeletions=t:t.hasAttribute(`data-additions`)&&(this.codeAdditions=t))}applyHeaderToDOM(e,t,n){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{headerCache:{fileDiff:r,html:i,lastRenderedHTML:a},editSessionDiff:o}=this,s=(n!==o&&hg(r,n)?i:void 0)??Ii(e);if(this.headerCache.html=s,this.headerCache.fileDiff=n,s!==a){let e=document.createElement(`div`);e.innerHTML=s;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.headerCache.lastRenderedHTML=s}if(this.isContainerManaged)return;let{renderCustomHeader:c,renderHeaderPrefix:l,renderHeaderFilenameSuffix:u,renderHeaderMetadata:d}=this.options;if(c!=null){let e=c(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,Qt,e),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}let f=l?.(n)??void 0,p=u?.(n)??void 0,m=d?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,Yt,f),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,Xt,p),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,Zt,m),this.headerCustom?.remove(),this.headerCustom=void 0}clearReusableHeader(){this.headerCache.html=void 0,this.headerCache.fileDiff=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}(this.unsafeCSSStyle?.parentNode!==t||this.appliedUnsafeCSS!==e)&&(this.unsafeCSSStyle??=wh(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=jh(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.options.theme??R,s=typeof o==`string`?o:{...o},c=Dh(i);if(this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a&&this.appliedThemeCSS.scrollbarGutter===c){this.appliedThemeCSS.theme=s;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===i){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c};return}this.themeCSSStyle=qh({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:Mh(t,a,c)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c}}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;e!=null&&this.themeCSSStyle!=null&&(this.themeCSSStyle.textContent=Nh(this.themeCSSStyle.textContent??``,Dh(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&Xh()}applyHunksToDOM(e,t){this.shouldGuardRebuildScroll()?Kh(e,()=>this.replaceCodeColumns(e,t)):this.replaceCodeColumns(e,t)}applyCodeColumnsInPlace(e,t,n){let r=this.getColumnPair(e);if(r==null)return!1;let i=ob(t[0]),a=ob(t[1]);return i==null||a==null?!1:(r.gutter.innerHTML=Ii(i),r.content.innerHTML=Ii(a),n!==this.lastRowCount&&(r.gutter.style.setProperty(`grid-row`,`span ${n}`),r.content.style.setProperty(`grid-row`,`span ${n}`)),!0)}replaceCodeColumns(e,t){let{overflow:n=`scroll`}=this.options,r=(this.options.hunkSeparators??`line-info`)===`line-info`,i=n===`wrap`?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let a=!1,o=[],s=this.hunksRenderer.renderCodeAST(`unified`,t),c=this.hunksRenderer.renderCodeAST(`deletions`,t),l=this.hunksRenderer.renderCodeAST(`additions`,t);this.editor?.__captureFocusForDOMReplacement(),s==null?c!=null||l!=null?(c==null?(this.codeDeletions?.remove(),this.codeDeletions=void 0):(a=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=Lh({code:this.codeDeletions,columnType:`deletions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeDeletions,c,t.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(c)),o.push(this.codeDeletions)),l==null?(this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=a||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=Lh({code:this.codeAdditions,columnType:`additions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeAdditions,l,t.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(l)),o.push(this.codeAdditions))):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=Lh({code:this.codeUnified,columnType:`unified`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeUnified,s,t.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s)),o.push(this.codeUnified)),o.length===0?e.textContent=``:a&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({fileDiff:e,previousRenderRange:t,renderRange:n}){let{pre:r,codeUnified:i,codeAdditions:a,codeDeletions:o,options:{diffStyle:s=`split`}}=this;if(r==null||t==null||n==null||!Number.isFinite(t.totalLines)||!Number.isFinite(n.totalLines)||this.lastRowCount==null)return!1;let c=this.getCodeColumns(s,i,o,a);if(c==null)return!1;let l=t.startingLine,u=n.startingLine,d=l+t.totalLines,f=u+n.totalLines,p=Math.max(l,u),m=Math.min(d,f);if(m<=p)return!1;let h=Math.max(0,p-l),g=Math.max(0,d-m),_=this.trimColumns({columns:c,trimStart:h,trimEnd:g,previousStart:l,overlapStart:p,overlapEnd:m,diffStyle:s});if(_<0)throw Error(`FileDiff.applyPartialRender: failed to trim to overlap`);if(this.lastRowCount<_)throw Error(`FileDiff.applyPartialRender: trimmed beyond DOM row count`);let v=this.lastRowCount-_,y=(t,n)=>{if(!(n<=0))return this.hunksRenderer.renderDiff(e,{startingLine:t,totalLines:n,bufferBefore:0,bufferAfter:0})},b=y(u,Math.max(p-u,0));if(b==null&&u<p)return!1;let x=y(m,Math.max(f-m,0));if(x==null&&f>m)return!1;let S=(e,t)=>{if(e!=null){if(s===`unified`&&!Array.isArray(c))this.insertPartialHTML(s,c,e,t);else if(s===`split`&&Array.isArray(c))this.insertPartialHTML(s,c,e,t);else throw Error(`FileDiff.applyPartialRender.applyChunk: invalid chunk application`);v+=e.rowCount,this.renderedDiff=e.fileDiff}};return this.cleanupErrorWrapper(),S(b,`afterbegin`),S(x,`beforeend`),this.lastRowCount!==v&&(this.applyRowSpan(s,c,v),this.lastRowCount=v),!0}insertPartialHTML(e,t,n,r){if(e===`unified`&&!Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`unified`,n);this.renderPartialColumn(t,e,r)}else if(e===`split`&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`deletions`,n),i=this.hunksRenderer.renderCodeAST(`additions`,n);this.renderPartialColumn(t[0],e,r),this.renderPartialColumn(t[1],i,r)}else throw Error(`FileDiff.insertPartialHTML: Invalid argument composition`)}refreshSplitDiffView(){let e=this.getLatestDiff();if(this.options.diffStyle!==`split`||e==null)return;let t=this.hunksRenderer.renderDiff(e,this.renderRange);if(t==null)return;let n=this.getCodeColumns(`split`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(n))return;let r=(e,n)=>{if(n==null)return;let r=this.hunksRenderer.renderCodeAST(e,t),i=ob(r?.[0]),a=ob(r?.[1]);for(let[e,t]of[[n.gutter,i],[n.content,a]])if(t!=null&&e.childElementCount===t.length)for(let n=0;n<t.length;n++){let r=e.children[n],i=t[n].properties[`data-line-type`];i!=null&&r.dataset.lineType!==i&&(r.dataset.lineType=i)}};r(`deletions`,n[0]),r(`additions`,n[1]),this.renderedDiff=t.fileDiff}refreshUnifiedDiffView(){let e=this.getLatestDiff();if(this.options.diffStyle!==`unified`||e==null)return;let t=this.hunksRenderer.renderDiff(e,this.renderRange);if(t==null)return;let n=this.getCodeColumns(`unified`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(n==null||Array.isArray(n))return;let r=this.hunksRenderer.renderCodeAST(`unified`,t),i=ob(r?.[0]),a=ob(r?.[1]),o=()=>{for(let[e,t]of[[n.gutter,i],[n.content,a]])t!=null&&(e.innerHTML=Ii(t));t.rowCount!==this.lastRowCount&&(this.applyRowSpan(`unified`,n,t.rowCount),this.lastRowCount=t.rowCount),this.renderedDiff=t.fileDiff};this.shouldGuardRebuildScroll()?Kh(this.pre,o):o(),this.renderSeparators(t.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=ob(t[0]),i=ob(t[1]);if(r==null||i==null)throw Error(`FileDiff.insertPartialHTML: Unexpected AST structure`);let a=i.at(0);n===`beforeend`&&a?.type===`element`&&typeof a.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(a.properties[`data-buffer-size`],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let o=i.at(-1);n===`afterbegin`&&o?.type===`element`&&typeof o.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(o.properties[`data-buffer-size`],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,a){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let o=this.getBufferSize(t.dataset);o!=null&&(a?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(n,o+e))}applyRowSpan(e,t,n){let r=e=>{e!=null&&(e.gutter.style.setProperty(`grid-row`,`span ${n}`),e.content.style.setProperty(`grid-row`,`span ${n}`))};if(e===`unified`&&!Array.isArray(t))r(t);else if(e===`split`&&Array.isArray(t))r(t[0]),r(t[1]);else throw Error(`dun fuuuuked up`)}trimColumnRows(e,t,n){let r=0,i=0,a=0,o=!1,s=n>=0;if(e==null)return 0;let c=Array.from(e.content.children),l=Array.from(e.gutter.children);if(c.length!==l.length)throw Error(`FileDiff.trimColumnRows: columns do not match`);for(;a<c.length&&!(t<=0&&!s&&!o);){let e=l[a],u=c[a];if(a++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: invalid row elements`);if(o&&(o=!1,e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset||e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset)){e.remove(),u.remove(),i++;continue}if(`lineIndex`in e.dataset&&`lineIndex`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&(t--,t===0&&(o=!0)),i++),r++;continue}if(`separator`in e.dataset&&`separator`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`buffer`&&`contentBuffer`in u.dataset){let a=this.getBufferSize(u.dataset);if(a==null)throw Error(`FileDiff.trimColumnRows: invalid element`);if(t>0){let n=Math.min(t,a),r=a-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=a),t-=n,t===0&&r===0&&(o=!0)}else if(s){let t=r,o=r+a-1;if(n<=t)e.remove(),u.remove(),i+=a;else if(n<=o){let t=o-n+1,r=a-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=a;continue}throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: unknown row elements`)}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:a,trimStart:o}){let s=Math.max(0,r-i),c=n-i;if(c<0)throw Error(`FileDiff.trimColumns: overlap ends before previous`);let l=o>0,u=a>0;if(!l&&!u)return 0;let d=l?s:0,f=u?c:-1;if(t===`unified`&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t===`split`&&Array.isArray(e)){let t=this.trimColumnRows(e[0],d,f),n=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&t!==n)throw Error(`FileDiff.trimColumns: split columns out of sync`);return e[0]==null?n:t}throw console.error({diffStyle:t,columns:e}),Error(`FileDiff.trimColumns: Invalid columns for diffType`)}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??``,10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty(`grid-row`,`span ${t}`),e.style.setProperty(`min-height`,`calc(${t} * 1lh)`)}getColumnPair(e){if(e==null)return;let t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}getCodeColumns(e,t,n,r){if(e===`unified`)return this.getColumnPair(t);{let e=this.getColumnPair(n),t=this.getColumnPair(r);return e!=null||t!=null?[e,t]:void 0}}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.bufferAfter}px`),this.bufferAfter.style.setProperty(`contain`,`strict`)):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:r},i){let{diffIndicators:a=`bars`,disableBackground:o=!1,disableLineNumbers:s=!1,overflow:c=`scroll`,diffStyle:l=`split`}=this.options,u={type:`diff`,diffIndicators:a,disableBackground:o,disableLineNumbers:s,overflow:c,split:l!==`unified`&&t!=null&&n!=null,totalLines:r,customProperties:i};yh(u,this.appliedPreAttributes)||(zh(e,u),this.appliedPreAttributes=u)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.textContent=``,n.appendChild(this.errorWrapper);let r=document.createElement(`div`);r.dataset.errorMessage=``,r.innerText=e.message,this.errorWrapper.appendChild(r);let i=document.createElement(`pre`);i.dataset.errorStack=``,i.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function eb(e){return{name:e.name,lang:e.lang,contents:e.additionLines.join(``)}}function tb(e,t){return e==null||t==null?e==null&&t==null:gg(e,t)}function nb({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function rb({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function ib(e,t,n=!1){return!n&&e==null&&t}function ab(e,t,n=!1){return e==null&&t&&!n}function ob(e){if(e!=null&&e.type===`element`)return e.children??[]}function sb({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:r,expandUnchanged:i,expandedHunks:a,collapsedContextThreshold:o,canHydratePartialDiff:s}){let c=ag(t,n),l=c,u=i?!0:a,d=e.hunks.length-1;for(let n=0;n<e.hunks.length;n++){let i=e.hunks[n];if(i==null)throw Error(`computeEstimatedDiffHeights: invalid hunk index`);let a=uv({isPartial:e.isPartial,rangeSize:i.collapsedBefore,expandedHunks:u,hunkIndex:n,collapsedContextThreshold:o}),f=(a.fromStart+a.fromEnd)*t.lineHeight;if(c+=f,l+=f,a.collapsedLines>0){let e=bv({type:r,metrics:t,hunkIndex:n,hunkSpecs:i.hunkSpecs})?.totalHeight??0;c+=e,l+=e}c+=i.splitLineCount*t.lineHeight,l+=i.unifiedLineCount*t.lineHeight;let p=cb(i);c+=p.split*t.lineHeight,l+=p.unified*t.lineHeight;let m=n===d?pv({fileDiff:e,hunkIndex:n,expandedHunks:u,collapsedContextThreshold:o,errorPrefix:`computeEstimatedDiffHeights`}):void 0;if(m!=null){let e=(m.fromStart+m.fromEnd)*t.lineHeight;if(c+=e,l+=e,m.collapsedLines>0){let e=xv({type:r,metrics:t})?.totalHeight??0;c+=e,l+=e}}else if(n===d&&e.isPartial&&s){let e=xv({type:r,metrics:t})?.totalHeight??0;c+=e,l+=e}}if(e.hunks.length>0){let e=sg(t);c+=e,l+=e}return{splitHeight:c,unifiedHeight:l}}function cb(e){if(!e.noEOFCRAdditions&&!e.noEOFCRDeletions)return{split:0,unified:0};let t=e.hunkContent.at(-1);if(t==null)return{split:0,unified:0};if(t.type===`context`){let e=+(t.lines>0);return{split:e,unified:e}}return lb(e,t)}function lb(e,t){let n=(t.deletions>0&&e.noEOFCRDeletions?1:0)+(t.additions>0&&e.noEOFCRAdditions?1:0),r=t.deletions>0&&e.noEOFCRDeletions,i=t.additions>0&&e.noEOFCRAdditions;return{split:r||i?1:0,unified:n}}var ub=3e3,db=new Map,fb=-1,pb=class extends $y{__id=`little-virtualized-file-diff:${++fb}`;renderType=`virtualized`;top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0,fileAnnotationHeight:0,ghostTextRows:db,ghostTextRowsByIndex:new Map};isVisible=!1;isSetup=!1;virtualizer;layoutDirty=!0;forceRenderOverride;currentCollapsed;pendingHydratedDiff;pendingExpansions;pendingRender;constructor(e,t,n,r,i=!1){super(e,r,i),this.virtualizer=t,this.metrics=ig(n)}setMetrics(e,t=!1){let n=ig(e);!t&&yn(this.metrics,n)||(this.metrics=n,this.resetLayoutCache({includeEstimatedHeights:!0}))}setLineAnnotations(e){this.syncLineAnnotations(e)&&this.resetLayoutCache({includeEstimatedHeights:!1})}syncLineAnnotations(e){return e==null||!this.isNewAnnotations(e)||e.length===0&&this.getLatestAnnotations().length===0?!1:(super.setLineAnnotations(e),!0)}syncEditSessionAnnotationsFromEditor(e){return super.syncEditSessionAnnotationsFromEditor(e)?(this.resetLayoutCache({includeEstimatedHeights:!1}),!0):!1}setFileAnnotationHeight(e){let t=this.cache.fileAnnotationHeight;return e!==t&&(this.cache.fileAnnotationHeight=e,this.cache.measuredHeightDeltaTotal+=e-t,!0)}hasFileAnnotations(e){let t=this.getLatestAnnotations();return sh(t)?t.some(t=>t.lineNumber===0?e.type===`new`?t.side===`additions`:e.type!==`deleted`||t.side===`deletions`:!1):!1}getLineHeight(e,t=!1){return this.getEstimatedLineHeight(t)+(this.cache.heightDeltas.get(e)??0)}getEstimatedLineHeight(e=!1){let t=e?2:1;return this.metrics.lineHeight*t}setOptions(e){if(this.isAdvancedMode())throw Error(`VirtualizedFileDiff.setOptions cannot be used inside CodeView. Update CodeView options instead.`);if(e==null)return;let{options:t}=this,n=!xn(t,e),r=n&&xb(t,e);super.setOptions(e),r&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:Sb(t,e)}),n&&(this.forceRenderOverride=!0),n&&this.isSimpleMode()&&this.virtualizer.instanceChanged(this,r)}setThemeType(e){if(this.isAdvancedMode())throw Error(`VirtualizedFileDiff.setThemeType cannot be used inside CodeView. Update CodeView options instead.`);super.setThemeType(e)}resetLayoutCache({forceSimpleRecompute:e=!1,includeEstimatedHeights:t=!1,resetRenderRange:n=!0}={}){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heightDeltas.clear(),this.cache.measuredHeightDeltaTotal=0,this.cache.ghostTextRows=db,this.cache.ghostTextRowsByIndex.size>0&&this.cache.ghostTextRowsByIndex.clear(),this.invalidateDerivedLayoutCache(t,n),e&&this.isSimpleMode()&&this.computeApproximateSize()}invalidateDerivedLayoutCache(e,t=!0){this.layoutDirty=!0,this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.cache.totalLines!==0&&(this.cache.totalLines=0),e&&(this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0),this.renderRange!=null&&t&&(this.renderRange=void 0)}applyGhostTextRows(e,t){let{cache:{heightDeltas:n,ghostTextRows:r,ghostTextRowsByIndex:i},metrics:{lineHeight:a}}=this;if(r===t)return!1;let o=this.getDiffStyle(),s=new Map;for(let[n,r]of t){let t=this.getLineIndexForDiff(e,n+1,`additions`);t!=null&&s.set(o===`split`?t[1]:t[0],r)}let c=!1;for(let e of new Set([...i.keys(),...s.keys()])){let t=((s.get(e)??0)-(i.get(e)??0))*a;if(t===0)continue;let r=(n.get(e)??0)+t;r===0?n.delete(e):n.set(e,r),this.cache.measuredHeightDeltaTotal+=t,c=!0}return this.cache.ghostTextRows=t,this.cache.ghostTextRowsByIndex=s,c}reconcileHeights(){let e=!1,{options:{overflow:t=`scroll`},cache:{ghostTextRowsByIndex:n},metrics:{lineHeight:r}}=this,i=this.getRenderedDiff();if(this.fileContainer==null||i==null)return this.height!==0&&(e=!0),this.height=0,e;this.top=this.getVirtualizedTop(),e=this.applyGhostTextRows(i,this.editor?.__getGhostTextRows()??db);let a=this.getLatestAnnotations();if(t===`scroll`&&a.length===0&&!this.isResizeDebuggingEnabled())return e&&this.computeApproximateSize(!0),e;let o=this.getDiffStyle(),s=o===`split`?[this.codeDeletions,this.codeAdditions]:[this.codeUnified],c=this.hasFileAnnotations(i);if(this.renderRange!=null&&c&&lh(this.renderRange)){let t=mb(s)??0;this.setFileAnnotationHeight(t)&&(e=!0)}else!c&&this.setFileAnnotationHeight(0)&&(e=!0);for(let t of s){if(t==null)continue;let i=t.children[1];if(!(i instanceof HTMLElement))continue;let a=o===`split`&&t===this.codeDeletions;for(let t of i.children){if(!(t instanceof HTMLElement))continue;let i=t.dataset.lineIndex;if(i==null)continue;let s=Eb(i,o),c=n.get(s)??0;if(a&&c>0)continue;let l=t.getBoundingClientRect().height+c*r,u=!1;t.nextElementSibling instanceof HTMLElement&&(`lineAnnotation`in t.nextElementSibling.dataset||`noNewline`in t.nextElementSibling.dataset)&&(`noNewline`in t.nextElementSibling.dataset&&(u=!0),l+=t.nextElementSibling.getBoundingClientRect().height);let d=this.getEstimatedLineHeight(u),f=this.cache.heightDeltas.get(s)??0,p=l-d;p!==f&&(e=!0,this.cache.measuredHeightDeltaTotal+=p-f,p===0?this.cache.heightDeltas.delete(s):this.cache.heightDeltas.set(s,p))}}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer!=null&&(e&&(this.top=this.getVirtualizedTop()),this.render());flushManagers(){super.flushManagers(),this.lineStateRefreshPending&&this.flushDeferredLineState()}updateCodeViewLayout(e,t,n,r){let i=!1,a=!1,{pendingExpansions:o,pendingHydratedDiff:s,options:{collapsed:c=!1}}=this;if(s!=null&&(this.pendingHydratedDiff=void 0,s.expectedDiff===e&&(Object.assign(e,s.nextDiff),this.setHydratedState(s.files),this.startHydratedEditSession(e),this.forceRenderOverride=!0,i=!0,a=!0)),o!=null){this.pendingExpansions=void 0;for(let{hunkIndex:e,direction:t,expansionLineCountOverride:n}of o)this.hunksRenderer.expandHunk(e,t,n),this.forceRenderOverride=!0,a=!0}let l=this.updateExternalDiff(e,r),{pendingRenderDiff:u,layoutDiffChanged:d,renderedDiffChanged:f,annotationsChanged:p}=this.updatePendingRender(e,r);return!this.forceRenderOverride&&(l||f||p)&&(this.forceRenderOverride=!0),(n?.resetDiffLayoutCache===!0||d||p)&&(i=!0),(d||n?.resetDiffLayoutCache===!0&&n.includeEstimatedDiffHeights)&&(a=!0),n?.metrics!=null&&(this.metrics=ig(n.metrics),i=!0,a=!0),this.currentCollapsed!==c&&(this.currentCollapsed=c,i=!0),i?this.resetLayoutCache({includeEstimatedHeights:a}):a&&this.invalidateDerivedLayoutCache(!0),this.top=t,this.computeApproximateSize(!1,u),this.height}getLinePosition(e,t=`additions`){let n=this.getLayoutDiff();if(n==null||e<1)return;let r=this.getLineIndexForDiff(n,e,t);if(r==null)return;let{disableFileHeader:i=!1,expandUnchanged:a=!1,collapsed:o=!1,collapsedContextThreshold:s=1}=this.options,c=this.getDiffStyle(),l=this.getHunkSeparatorType(),u=c===`split`?r[1]:r[0];this.approximateLayoutCheckpoints(n);let d=ag(this.metrics,i),f=this.getLayoutCheckpointBeforeLineIndex(u),p=f?.top??d+this.cache.fileAnnotationHeight;if(o)return{top:d,height:0};let m;return Sv({diff:n,diffStyle:c,startingLine:f?.renderedLineIndex??0,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s,callback:({hunkIndex:e,hunk:t,collapsedBefore:n,collapsedAfter:r,deletionLine:i,additionLine:a})=>{let o=c===`split`?a?.splitLineIndex??i?.splitLineIndex:a?.unifiedLineIndex??i?.unifiedLineIndex;if(o==null)throw Error(`VirtualizedFileDiff.getLinePosition: missing line index data`);if(n>0){let r=bv({type:l,metrics:this.metrics,hunkIndex:e,hunkSpecs:t?.hunkSpecs});if(r!=null){if(p+=r.gapBefore,u>=o-n&&u<o)return m={top:p,height:r.height},!0;p+=r.height+r.gapAfter}}let s=this.getLineHeight(o,(a?.noEOFCR??!1)||(i?.noEOFCR??!1));if(o===u)return m={top:p,height:s},!0;if(p+=s,r>0){let e=xv({type:l,metrics:this.metrics});if(e!=null){if(u>o&&u<=o+r)return m={top:p+e.gapBefore,height:e.height},!0;p+=e.totalHeight}}return!1}}),m}getEditorViewport(){return this.virtualizer.type===`simple`?this.virtualizer.getRoot():this.virtualizer.getContainerElement()}getNumericScrollAnchor(e){let t=this.getLayoutDiff();if(t==null)return;let{disableFileHeader:n=!1,expandUnchanged:r=!1,collapsed:i=!1,collapsedContextThreshold:a=1}=this.options;if(i)return;let o=this.getDiffStyle(),s=this.getHunkSeparatorType();this.approximateLayoutCheckpoints(t);let c=this.getLayoutCheckpointBeforeTop(e),l=c?.top??ag(this.metrics,n)+this.cache.fileAnnotationHeight,u;return Sv({diff:t,diffStyle:o,startingLine:c?.renderedLineIndex??0,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:a,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,deletionLine:a,additionLine:c})=>{let d=o===`split`?c?.splitLineIndex??a?.splitLineIndex:c?.unifiedLineIndex??a?.unifiedLineIndex;if(d==null)throw Error(`VirtualizedFileDiff.getNumericScrollAnchor: missing line index data`);if(r>0){let e=bv({type:s,metrics:this.metrics,hunkIndex:t,hunkSpecs:n?.hunkSpecs});e!=null&&(l+=e.totalHeight)}if(l>=e&&(a==null?c!=null&&(u={lineNumber:c.lineNumber,side:`additions`,top:l}):u={lineNumber:a.lineNumber,side:`deletions`,top:l},u!=null))return!0;let f=this.getLineHeight(d,(c?.noEOFCR??!1)||(a?.noEOFCR??!1));if(l+=f,i>0){let e=xv({type:s,metrics:this.metrics});e!=null&&(l+=e.totalHeight)}return!1}}),u}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){let t=this.getLayoutDiff();if(this.top==null||t==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};let n=e==null?this.renderRange:this.computeRenderRangeFromWindow(t,this.top,e);if(n==null)return;let{bufferBefore:r,bufferAfter:i,totalLines:a}=n,o=0;if(a===0){let t=e??this.virtualizer.getWindowSpecs();this.top<t.top&&(o=i)}return{topOffset:this.top+r+o,height:this.height-(r+i)}}cleanUp(e=!1){let t=this.cache.ghostTextRows.size>0;t&&(this.layoutDirty=!0);let n=e&&this.isAdvancedMode()&&this.fileContainer!=null&&(t||!hg(this.getRenderedDiff(),this.getLatestDiff()));this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||(this.resetLayoutCache({includeEstimatedHeights:!0}),this.pendingExpansions=void 0,this.pendingHydratedDiff=void 0),this.pendingRender=void 0,this.isSetup=!1,super.cleanUp(e),n&&this.virtualizer.instanceChanged(this,!0)}expandHunk=(e,t,n)=>{this.fileDiff!=null&&(this.isAdvancedMode()?(this.pendingExpansions??=[],this.pendingExpansions.push({hunkIndex:e,direction:t,expansionLineCountOverride:n})):(this.hunksRenderer.expandHunk(e,t,n),this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()),this.loadFilesIfNecessary(),this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))};async handleFilesLoaded(e,t){if(!(this.fileDiff!==e||!e.isPartial)){if(this.isAdvancedMode()){let n=wg(`clone`,e,t);if(await Wy(()=>this.primeHighlightCache(n)),!this.enabled||this.fileDiff!==e)return;this.pendingHydratedDiff={expectedDiff:e,nextDiff:n,files:t}}else{if(wg(`merge`,e,t),this.setHydratedState(t),!this.startHydratedEditSession(e)&&(await Wy(()=>this.primeHighlightCache(e)),!this.enabled||this.fileDiff!==e))return;this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}}loadFilesIfNecessary(){if(this.pendingHydratedDiff!=null){if(this.pendingHydratedDiff.expectedDiff===this.fileDiff)return;this.pendingHydratedDiff=void 0}super.loadFilesIfNecessary()}isLineRenderable(e){if(super.isLineRenderable(e))return!0;let{pendingExpansions:t}=this,n=this.getRenderedDiff();if(t==null||t.length===0||n==null)return!1;let{expansionLineCount:r=100,collapsedContextThreshold:i=1}=this.options,a=new Map(this.hunksRenderer.getExpandedHunksMap());for(let e of t){let t={...a.get(e.hunkIndex)??{fromStart:0,fromEnd:0}},n=e.expansionLineCountOverride??r;(e.direction===`up`||e.direction===`both`)&&(t.fromStart+=n),(e.direction===`down`||e.direction===`both`)&&(t.fromEnd+=n),a.set(e.hunkIndex,t)}return mv({fileDiff:n,lineNumber:e,expandedHunks:a,collapsedContextThreshold:i})}invalidateEditSessionLayout(){this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1}),this.isSimpleMode()||this.computeApproximateSize(!0),this.getSimpleVirtualizer()?.requestHeightReconcile(this)}escalateEditSessionRender(){this.invalidateEditSessionLayout(),!(!this.enabled||this.fileDiff==null)&&(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))}shouldSelfHealEditSession(){return!this.isAdvancedMode()&&super.shouldSelfHealEditSession()}setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){if(!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null)return;let e=this.getLatestDiff(),t=e==null?void 0:this.hunksRenderer.getDiffForNextRender(e);this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!hg(this.getRenderedDiff(),t))}syncGhostTextRows(){let e=this.getAdvancedVirtualizer();e==null?this.getSimpleVirtualizer()?.requestHeightReconcile(this):(e.capturePendingLayoutAnchor(),this.layoutDirty=!0,e.instanceChanged(this,!0))}applyDocumentChange(e,t,n=!1){let{renderRange:r}=this;this.getAdvancedVirtualizer()?.capturePendingLayoutAnchor(),super.applyDocumentChange(e,t),this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1});let i=this.getRenderedDiff();if(!this.isSimpleMode())this.computeApproximateSize(!0);else if(n&&r!=null&&i!=null){let e=this.virtualizer.getWindowSpecs(),t=this.computeRenderRangeFromWindow(i,this.top??0,e);t.bufferAfter!==r.bufferAfter&&this.updateBuffers(t)}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}computeApproximateSize(e=!1,t=this.getLayoutDiff()){let n=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!n)return;let r=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,t==null){this.layoutDirty=!1;return}this.applyGhostTextRows(t,this.editor?.__getGhostTextRows()??db);let{disableFileHeader:i=!1,collapsed:a=!1}=this.options,o=ag(this.metrics,i);if(this.height+=o,a){this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight(t)+this.cache.measuredHeightDeltaTotal,n&&!r&&this.validateComputedHeight(t),this.layoutDirty=!1}getLayoutDiff(){return this.pendingRender?.diff??this.getRenderedDiff()}getActiveEstimatedHeight(e=this.getLayoutDiff()){this.ensureEstimatedDiffHeights(e);let t=this.getDiffStyle()===`split`?this.cache.estimatedSplitHeight:this.cache.estimatedUnifiedHeight;if(t==null)throw Error(`VirtualizedFileDiff.getActiveEstimatedHeight: missing estimated height`);return t}ensureEstimatedDiffHeights(e=this.getLayoutDiff()){if(e==null){this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0;return}if(this.cache.estimatedSplitHeight!=null&&this.cache.estimatedUnifiedHeight!=null)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options,{splitHeight:i,unifiedHeight:a}=sb({fileDiff:e,metrics:this.metrics,disableFileHeader:t,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:n,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r,canHydratePartialDiff:Cb(e,this.options.loadDiffFiles!=null)});this.cache.estimatedSplitHeight=i,this.cache.estimatedUnifiedHeight=a}validateComputedHeight(e=this.getLayoutDiff()){if(this.fileContainer==null||e==null)return;let t=this.fileContainer.getBoundingClientRect();t.height===this.height?console.log(`VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT`):console.log(`VirtualizedFileDiff.computeApproximateSize: computed height doesnt match`,{name:e.name,elementHeight:t.height,computedHeight:this.height})}render({fileContainer:e,fileDiff:t,forceRender:n=!1,lineAnnotations:r,...i}={}){let a=Gy(i,`VirtualizedFileDiff.render`),o=a!=null,s=a?.oldFile,c=a?.newFile,l=o&&(!Tb(s,this.deletionFile)||!Tb(c,this.additionFile)),u=t??this.fileDiff;t==null&&o&&(l||this.fileDiff==null)&&(u=Z_(a.oldFile,a.newFile,this.options.parseDiffOptions));let{forceRenderOverride:d,isSetup:f}=this;this.forceRenderOverride=void 0;let p=u!=null&&!hg(this.fileDiff,u),m=p||l;if(e=this.getOrCreateFileContainer(e),u==null)return console.error(`VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data`),!1;p&&this.updateExternalDiff(u,r);let{pendingRenderDiff:h,layoutDiffChanged:g,renderedDiffChanged:_,annotationsChanged:v}=this.pendingRender!=null&&hg(this.pendingRender.latestDiff,this.getLatestDiff(u)??u)?{pendingRenderDiff:this.pendingRender.diff,layoutDiffChanged:!1,renderedDiffChanged:!1,annotationsChanged:!1}:this.updatePendingRender(u,r);if((v||g)&&this.resetLayoutCache({includeEstimatedHeights:g}),f)this.top??=this.getVirtualizedTop(),g&&(this.getSimpleVirtualizer()?.markDOMDirty(),this.computeApproximateSize(!1,h));else{this.computeApproximateSize(!1,h);let t=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(t==null)throw Error(`VirtualizedFileDiff.render: simple virtualizer is not available`);t.connect(e,this),this.isVisible=t.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode()&&(!m||!f))return a!=null&&(this.deletionFile=s,this.additionFile=c),p&&this.clearReusableHeader(),this.pendingRender=void 0,this.renderPlaceholder(this.height);let y=this.virtualizer.getWindowSpecs(),b=this.top??0,x=this.computeRenderRangeFromWindow(h,b,y),S=super.render({fileDiff:u,fileContainer:e,renderRange:x,lineAnnotations:r,forceRender:(d??n)||v||_||p,...a,...i});if(S){if(this.getRenderedDiff()!==h)throw Error(`VirtualizedFileDiff.render: rendered a different diff than its prepared layout`);this.pendingRender=void 0}return this.isSimpleMode()&&S&&this.getSimpleVirtualizer()?.requestHeightReconcile(this),S}updatePendingRender(e,t){let n=this.getLatestDiff(e)??e,r=this.getRenderedDiff(),{pendingRender:i}=this,a=i?.diff??r,o=this.hunksRenderer.getDiffForNextRender(n);return this.pendingRender={latestDiff:n,diff:o},{pendingRenderDiff:o,annotationsChanged:this.syncLineAnnotations(t),layoutDiffChanged:!hg(a,o),renderedDiffChanged:!hg(r,o)}}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}shouldGuardRebuildScroll(){return!1}isSimpleMode(){return this.virtualizer.type===`simple`}isAdvancedMode(){return this.virtualizer.type===`advanced`}getVirtualizedTop(){return this.virtualizer.type===`advanced`?this.virtualizer.getLocalTopForInstance(this):this.fileContainer==null?0:this.virtualizer.getOffsetInScrollContainer(this.fileContainer)}getSimpleVirtualizer(){return this.virtualizer.type===`simple`?this.virtualizer:void 0}getAdvancedVirtualizer(){return this.virtualizer.type===`advanced`?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}getDiffStyle(){return this.options.diffStyle??`split`}getHunkSeparatorType(){return wb(this.options.hunkSeparators)}approximateLayoutCheckpoints(e){if(!this.layoutDirty&&this.cache.checkpoints.length>0||e.hunks.length===0||this.options.collapsed===!0)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options,i=e.hunks.length-1,a=Cb(e,this.options.loadDiffFiles!=null),o=this.getDiffStyle(),s=this.getHunkSeparatorType(),c=n?!0:this.hunksRenderer.getExpandedHunksMap(),l=hb(this.cache.heightDeltas),u=ag(this.metrics,t)+this.cache.fileAnnotationHeight,d=0,f=({rowCount:e,startLineIndex:t,preSeparatorHeight:n=0,postSeparatorHeight:r=0,metadataOffsets:i=[]})=>{if(e<=0)return;let a=d,o=d+e,s=vb(a);for(;s<o;){let e=s-a,r=u+(e>0?n:0)+e*this.metrics.lineHeight+yb(i,e)*this.metrics.lineHeight+gb(l,t,t+e);this.cache.checkpoints.push({renderedLineIndex:s,lineIndex:t+e,top:r}),s+=ub}u+=n+e*this.metrics.lineHeight+i.length*this.metrics.lineHeight+gb(l,t,t+e)+r,d=o};for(let t=0;t<e.hunks.length;t++){let n=e.hunks[t];if(n==null)throw Error(`VirtualizedFileDiff.approximateLayoutCheckpoints: invalid hunk index`);let l=uv({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:c,hunkIndex:t,collapsedContextThreshold:r}),u=l.collapsedLines>0?bv({type:s,metrics:this.metrics,hunkIndex:t,hunkSpecs:n.hunkSpecs})?.totalHeight??0:0;f({rowCount:l.fromStart,startLineIndex:(o===`split`?n.splitLineStart:n.unifiedLineStart)-l.rangeSize});let d=u;f({rowCount:l.fromEnd,startLineIndex:(o===`split`?n.splitLineStart:n.unifiedLineStart)-l.fromEnd,preSeparatorHeight:d}),l.fromEnd>0&&(d=0);let p=t===i?pv({fileDiff:e,hunkIndex:t,expandedHunks:c,collapsedContextThreshold:r,errorPrefix:`VirtualizedFileDiff`}):void 0,m=p!=null&&p.collapsedLines>0||t===i&&a?xv({type:s,metrics:this.metrics})?.totalHeight??0:0,h=p==null?0:p.fromStart+p.fromEnd,g=o===`split`?n.splitLineCount:n.unifiedLineCount,_=o===`split`?n.splitLineStart:n.unifiedLineStart;f({rowCount:g,startLineIndex:_,preSeparatorHeight:d,postSeparatorHeight:h===0?m:0,metadataOffsets:bb({diffStyle:o,hunk:n,rowCount:g})}),p!=null&&h>0&&f({rowCount:h,startLineIndex:_+g,postSeparatorHeight:m})}this.cache.totalLines=d}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,r;for(;t<=n;){let i=t+n>>1,a=this.cache.checkpoints[i];if(a==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);a.lineIndex<=e?(r=a,t=i+1):n=i-1}return r}getLayoutCheckpointBeforeTop(e,t){let n=0,r=this.cache.checkpoints.length-1,i=-1;for(;n<=r;){let t=n+r>>1,a=this.cache.checkpoints[t];if(a==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);a.top<=e?(i=t,n=t+1):r=t-1}if(t==null)return i>=0?this.cache.checkpoints[i]:void 0;for(let e=i;e>=0;e--){let n=this.cache.checkpoints[e];if(n==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);if(n.renderedLineIndex%t===0)return n}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(let r of e.hunks)n+=t===`split`?r.splitLineCount:r.unifiedLineCount;return n}let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a=r?!0:this.hunksRenderer.getExpandedHunksMap();for(let[r,o]of e.hunks.entries()){let s=t===`split`?o.splitLineCount:o.unifiedLineCount;n+=s;let c=Math.max(o.collapsedBefore,0),{fromStart:l,fromEnd:u,renderAll:d}=uv({isPartial:e.isPartial,rangeSize:c,expandedHunks:a,hunkIndex:r,collapsedContextThreshold:i});c>0&&(n+=d?c:l+u)}let o=pv({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:a,collapsedContextThreshold:i,errorPrefix:`VirtualizedFileDiff`});return o!=null&&(n+=o.fromStart+o.fromEnd),n}getLayoutLineCount(e,t){let n=this.getExpandedLineCount(e,t),r=t===`split`?e.splitLineCount:e.unifiedLineCount;return Math.max(n,r,e.additionLines.length,e.deletionLines.length,this.cache.totalLines)}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){let{disableFileHeader:i=!1,expandUnchanged:a=!1,collapsedContextThreshold:o=1}=this.options,{hunkLineCount:s,lineHeight:c}=this.metrics,l=this.getDiffStyle(),u=this.getHunkSeparatorType(),d=Cb(e,this.options.loadDiffFiles!=null),f=this.height,p=this.getLayoutLineCount(e,l),m=ag(this.metrics,i),h=e.hunks.length>0?sg(this.metrics):0,{fileAnnotationHeight:g}=this.cache,_=m+g,v=Math.max(0,f-m-g-h),y=this.hasFileAnnotations(e),b=t+m,x=g>0&&y&&b<r&&b+g>n;if(t<n-f||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-m-h};if(p<=s||e.hunks.length===0)return{startingLine:0,totalLines:s,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(e),p=this.getLayoutLineCount(e,l);let S=Math.ceil(Math.max(r-n,0)/c),C=Math.ceil(S/s)*s+s,w=C/s,T=w,E=[],D=(n+r)/2,O=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-C*c*2),s),k=t+(O?.top??_),A=O?.renderedLineIndex??0,j,M,N;if(Sv({diff:e,diffStyle:l,startingLine:O?.renderedLineIndex??0,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:i,hunk:a,collapsedBefore:o,collapsedAfter:c,deletionLine:f,additionLine:p})=>{let m=p==null?f.splitLineIndex:p.splitLineIndex,h=p==null?f.unifiedLineIndex:p.unifiedLineIndex,g=(p?.noEOFCR??!1)||(f?.noEOFCR??!1),v=i===e.hunks.length-1&&a!=null&&(l===`split`?m===a.splitLineStart+a.splitLineCount-1:h===a.unifiedLineStart+a.unifiedLineCount-1),y=(o>0?bv({type:u,metrics:this.metrics,hunkIndex:i,hunkSpecs:a?.hunkSpecs}):void 0)?.totalHeight??0;k+=y;let b=A%s===0,x=Math.floor(A/s);if(b&&(E[x]=k-(t+_+y),N!=null)){if(N<=0)return!0;N--}let S=this.getLineHeight(l===`split`?m:h,g);if(k>n-S&&k<r&&(j??=x),M==null&&k+S>D&&(M=x),N==null&&k>=r&&b&&(N=T),A++,k+=S,c>0||v&&d){let e=xv({type:u,metrics:this.metrics});e!=null&&(k<r&&k+e.totalHeight>n&&(j??=x),M==null&&k+e.totalHeight>D&&(M=x),k+=e.totalHeight)}return!1}}),j==null){if(x)j=0,M=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-m-h}}M??=j;let P=Math.round(M-w/2),ee=Math.max(0,Math.ceil(p/s)-w),te=Math.max(0,Math.min(P,ee)),ne=te*s,re=P<0?C+P*s:C,ie=E[te]??0,ae=ne===0?0:g+ie,oe=te+re/s,se=oe<E.length?v-E[oe]:v-(k-t-_);return{startingLine:ne,totalLines:re,bufferBefore:ae,bufferAfter:Math.max(0,se)}}};function mb(e){let t;for(let n of e){if(n==null)continue;let e=n.children[1];if(e instanceof HTMLElement)for(let n of e.children)n instanceof HTMLElement&&n.dataset.lineAnnotation===oh&&(t=Math.max(t??0,n.getBoundingClientRect().height))}return t}function hb(e){let t=Array.from(e).sort((e,t)=>e[0]-t[0]),n=[],r=[0],i=0;for(let[e,a]of t)n.push(e),i+=a,r.push(i);return{lineIndexes:n,prefixTotals:r}}function gb({lineIndexes:e,prefixTotals:t},n,r){if(n>=r||e.length===0)return 0;let i=_b(e,n);return(t[_b(e,r)]??0)-(t[i]??0)}function _b(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>1,a=e[i];if(a==null)throw Error(`VirtualizedFileDiff: invalid prefix index`);a<t?n=i+1:r=i}return n}function vb(e){return Math.ceil(e/ub)*ub}function yb(e,t){let n=0;for(let r of e)r<t&&n++;return n}function bb({diffStyle:e,hunk:t,rowCount:n}){if(n<=0||!t.noEOFCRAdditions&&!t.noEOFCRDeletions)return[];let r=t.hunkContent.at(-1);if(r==null)return[];if(r.type===`context`)return[n-1];let i=Math.max(r.deletions,r.additions),a=r.deletions+r.additions;if(e===`split`)return i>0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[n-1]:[];let o=[],s=n-a;return r.deletions>0&&t.noEOFCRDeletions&&o.push(s+r.deletions-1),r.additions>0&&t.noEOFCRAdditions&&o.push(n-1),o}function xb(e,t){return(e.diffStyle??`split`)!==(t.diffStyle??`split`)||(e.overflow??`scroll`)!==(t.overflow??`scroll`)||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.diffIndicators??`bars`)!==(t.diffIndicators??`bars`)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)||e.unsafeCSS!==t.unsafeCSS}function Sb(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function Cb(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function wb(e){return typeof e==`function`?`custom`:e??`line-info`}function Tb(e,t){return e==null||t==null?e==null&&t==null:gg(e,t)}function Eb(e,t){let[n,r]=e.split(`,`).map(Number);return t===`split`?r:n}function Db(e,t){return e==null||t==null?e===t:e.header!==t.header||e.footer!==t.footer?!1:Ob(e.items,t.items)}function Ob(e,t){if(e==null||t==null)return e===t;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r==null||i==null||r.id!==i.id||r.type!==i.type||r.element!==i.element||r.instance!==i.instance||r.version!==i.version)return!1}return!0}function kb(e,t,n){let r=document.createElement(`div`);return r.style.display=`flow-root`,e===`header`?(r.setAttribute(nn,``),t.before(r)):(r.setAttribute(rn,``),t.after(r)),n?.observe(r),r}function Ab(e){let t=window.devicePixelRatio??1;return Math.round(e*t)/t}var jb=`theme.disableLineNumbers.overflow.themeType.disableFileHeader.disableVirtualizationBuffers.preferredHighlighter.useCSSClasses.useTokenTransformer.tokenizeMaxLineLength.tokenizeMaxLength.unsafeCSS.diffStyle.diffIndicators.disableBackground.expandUnchanged.loadDiffFiles.collapsedContextThreshold.lineDiffType.maxLineDiffLength.expansionLineCount.lineHoverHighlight.enableTokenInteractionsOnWhitespace.enableGutterUtility.__debugPointerEvents.enableLineSelection.controlledSelection.disableErrorHandling`.split(`.`),Mb=[`theme`,`disableLineNumbers`,`overflow`,`themeType`,`disableFileHeader`,`disableVirtualizationBuffers`,`preferredHighlighter`,`useCSSClasses`,`useTokenTransformer`,`tokenizeMaxLineLength`,`tokenizeMaxLength`,`unsafeCSS`,`lineHoverHighlight`,`enableTokenInteractionsOnWhitespace`,`enableGutterUtility`,`__debugPointerEvents`,`enableLineSelection`,`controlledSelection`,`disableErrorHandling`],Nb=[`renderCustomHeader`,`renderHeaderPrefix`,`renderHeaderFilenameSuffix`,`renderHeaderMetadata`,`renderAnnotation`,`renderGutterUtility`,`onPostRender`,`onGutterUtilityClick`,`onLineClick`,`onLineNumberClick`,`onLineEnter`,`onLineLeave`,`onTokenClick`,`onTokenEnter`,`onTokenLeave`],Pb=[`onLineSelected`,`onLineSelectionStart`,`onLineSelectionChange`,`onLineSelectionEnd`],Fb=Symbol(`CodeView.itemOptionsState`);function Ib(e,t){Object.defineProperty(e,Fb,{configurable:!1,enumerable:!1,value:t})}function Lb(e){return e[Fb]}function Rb(e,t,n){Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get(){return n(this)}})}var zb=120,Bb=1,Vb=`--diffs-overflow-override`,Hb=12e6,Ub=1e6,Wb=2e6,Gb=1e7,Kb=11e6;function qb(e){if(e==null)throw Error(`CodeView: createEditor is required for items with edit: true`)}var Jb=(()=>{let{navigator:e}=globalThis,t=e.userAgent,n=/iP(?:hone|ad|od)/.test(t),r=e.platform===`MacIntel`&&e.maxTouchPoints>1;return(n||r)&&/AppleWebKit/.test(t)&&/Safari/.test(t)&&!/(CriOS|FxiOS|EdgiOS|OPiOS)/.test(t)})(),Yb=class e{static __STOP=!1;static __lastScrollPosition=0;type=`advanced`;config={overscrollSize:200,intersectionObserverMargin:0,resizeDebugging:!1};items=[];idToItem=new Map;selectedLines=null;itemEditors=new Map;attachedEditors=new Set;instanceToItem=new Map;layoutDirtyIndex;pendingLayoutReset;renderOptionsRevision=0;slotCoordinator;slotSnapshot;scrollListeners=new Set;scrollHeight=0;containerHeight=-1;scrollTop=0;scrollPageOffset=0;scrollDirty=!0;scrollInteractionFixTimer;pointerEventsDisabled=!1;codeOverflowFix=!1;height=0;heightDirty=!0;windowSpecs={top:0,bottom:0};renderState={scrollTop:-1,firstIndex:-1,lastIndex:-1,stickyHeight:0,stickyTop:-1,stickyBottom:-1};itemMetricsCache=cn;fileOptionsPrototype;diffOptionsPrototype;pendingScrollTarget;pendingLayoutAnchor;shouldFixContainerFocus=!1;scrollAnimation;root;resizeObserver;container=document.createElement(`div`);stickyContainer=document.createElement(`div`);stickyOffset=document.createElement(`div`);header={element:void 0,render:void 0,height:0};footer={element:void 0,render:void 0,height:0};elementPool=[];elementPoolVersion=0;elementPoolTracker=new WeakMap;pendingElementPool=[];options;workerManager;isReadySubscription;isContainerManaged;constructor(e={theme:R},t,n=!1){this.options=e,this.computeMetricsCache(e.itemMetrics),this.fileOptionsPrototype=this.createFileOptionsPrototype(),this.diffOptionsPrototype=this.createDiffOptionsPrototype(),this.workerManager=t,this.isContainerManaged=n,this.stickyOffset.style.contain=`layout size`,this.stickyContainer.style.position=`sticky`,this.stickyContainer.style.width=`100%`,this.stickyContainer.style.contain=`layout style inline-size`,this.stickyContainer.style.isolation=`isolate`,this.stickyContainer.style.display=`flex`,this.stickyContainer.style.flexDirection=`column`}getLayout(){return this.options.layout??ln}getItemTopOffset(){return this.getLayout().paddingTop+this.header.height}computeMetricsCache(e){return this.itemMetricsCache={hunkLineCount:e?.hunkLineCount??cn.hunkLineCount,lineHeight:e?.lineHeight??cn.lineHeight,diffHeaderHeight:e?.diffHeaderHeight??cn.diffHeaderHeight,hunkSeparatorHeight:e?.hunkSeparatorHeight,spacing:e?.spacing??cn.spacing,paddingTop:e?.paddingTop,paddingBottom:e?.paddingBottom},this.itemMetricsCache}getSmoothScrollSettings(){return this.options.smoothScrollSettings??un}shouldDisablePointerEvents(){return this.options.pointerEventsOnScroll!==!0}shouldValidateItemHeights(){return Vt&&this.options.__devOnlyValidateItemHeights===!0}validateRenderedItemHeight(e){if(!this.shouldValidateItemHeights()||e.element==null)return;let t=e.instance.getAdvancedStickySpecs();if(t==null)return;let n=t.height,r=e.element.getBoundingClientRect().height;n!==r&&console.error(`CodeView: reconciled item height does not match DOM height`,{id:e.item.id,type:e.type,index:e.index,version:e.version,expectedHeight:n,actualHeight:r,delta:r-n,stickyTopOffset:t.topOffset,virtualizedHeight:e.instance.getVirtualizedHeight(),top:e.top,scrollTop:this.getScrollTop(),windowSpecs:{...this.windowSpecs},element:e.element,instance:e.instance})}validateStickyContainerHeight(){if(!this.shouldValidateItemHeights())return;let{firstIndex:e,lastIndex:t,stickyHeight:n,stickyTop:r,stickyBottom:i}=this.renderState;if(e===-1||t===-1)return;let a=this.stickyContainer.getBoundingClientRect().height;Math.abs(a-n)<Bb||console.error(`CodeView: sticky container height does not match computed layout`,{computedStickyHeight:n,actualStickyHeight:a,delta:a-n,stickyTop:r,stickyBottom:i,firstIndex:e,lastIndex:t,firstStickySpecs:this.items[e]?.instance.getAdvancedStickySpecs(),lastStickySpecs:this.items[t]?.instance.getAdvancedStickySpecs(),scrollTop:this.getScrollTop(),scrollPageOffset:this.scrollPageOffset,windowSpecs:{...this.windowSpecs},stickyContainer:this.stickyContainer})}clearScrollInteractionTimer(){this.scrollInteractionFixTimer!=null&&(clearTimeout(this.scrollInteractionFixTimer),this.scrollInteractionFixTimer=void 0)}suspendScrollInteractions(){this.clearScrollInteractionTimer(),this.shouldDisablePointerEvents()&&!this.pointerEventsDisabled&&(this.stickyContainer.style.pointerEvents=`none`,this.pointerEventsDisabled=!0),Jb&&!this.codeOverflowFix&&(this.stickyContainer.style.setProperty(Vb,`hidden`),this.codeOverflowFix=!0),this.scrollInteractionFixTimer=setTimeout(this.restoreScrollInteractions,zb)}restoreScrollInteractions=()=>{this.clearScrollInteractionTimer(),this.pointerEventsDisabled&&=(this.stickyContainer.style.removeProperty(`pointer-events`),!1),this.codeOverflowFix&&=(this.stickyContainer.style.setProperty(Vb,`auto`),!1)};syncLayout(){let{gap:e,paddingBottom:t,paddingTop:n}=this.getLayout();this.stickyContainer.style.gap=`${e}px`,this.container?.style.setProperty(`margin-top`,`${n}px`),this.container?.style.setProperty(`margin-bottom`,`${t}px`)}reconcileHeaderFooterHosts(){let e=this.reconcileHost(`header`),t=this.reconcileHost(`footer`);return e||t}reconcileHost(e){let{root:t,container:n}=this;if(t==null||n==null)return!1;let r=e===`header`?this.header:this.footer,i=e===`header`?this.options.renderCodeViewHeader:this.options.renderCodeViewFooter;if(i==null)return r.element!=null&&(this.resizeObserver?.unobserve(r.element),r.element.remove(),r.element=void 0,r.render=void 0,this.setHostHeight(r,0),!1);if(r.element!=null&&i===r.render)return!1;let a=r.element??kb(e,n,this.resizeObserver);r.element=a;let o=i();return o==null?!this.isContainerManaged&&a.children.length>0&&(a.textContent=``):a.replaceChildren(o),r.render=i,!0}setHostHeight(e,t){e.height!==t&&(e.height=t,this.scrollDirty=!0)}measureMountedHosts(){this.header.element!=null&&this.setHostHeight(this.header,this.header.element.getBoundingClientRect().height),this.footer.element!=null&&this.setHostHeight(this.footer,this.footer.element.getBoundingClientRect().height)}setup(t){if(this.root!=null)throw Error(`CodeView.setup: already setup`);this.workerManager?.subscribeToThemeChanges(this),this.root=t,this.root.style.overflowAnchor=`none`,this.root.hasAttribute(`tabindex`)||(this.root.tabIndex=-1),this.container??=document.createElement(`div`),this.container.style.contain=`layout style`,this.syncLayout(),this.container.appendChild(this.stickyOffset),this.container.appendChild(this.stickyContainer),this.root.appendChild(this.container),this.scrollDirty=!0,this.heightDirty=!0,this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.stickyContainer),this.root.addEventListener(`scroll`,this.handleScroll,{passive:!0}),this.root.addEventListener(`wheel`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`touchstart`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`pointerdown`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`keydown`,this.clearPendingScroll,{passive:!0}),this.resizeObserver.observe(this.root),this.render(!0),window.__INSTANCE=this,window.__TOGGLE=()=>{e.__STOP?(e.__STOP=!1,this.scrollTo({type:`position`,position:e.__lastScrollPosition,behavior:`instant`})):(e.__lastScrollPosition=this.getScrollTop(),e.__STOP=!0)}}reset(){_n(this.computeRenderRangeAndEmit),this.clearReadySubscription(),this.restoreScrollInteractions(),this.cleanAllRenderedItems();let e=[...this.itemEditors.values()].map(e=>{let t=this.idToItem.get(e.state.id);return t!=null&&(e.state.removedItem=t.item),{record:e,instance:t?.instance}});this.itemEditors.clear(),this.attachedEditors.clear(),this.selectedLines=null,this.items.length=0,this.idToItem.clear(),this.instanceToItem.clear();let t=!1,n;for(let{record:r,instance:i}of e)try{r.editor.cleanUp(`discard`),i?.cleanUp()}catch(e){t||(t=!0,n=e)}if(this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,this.stickyContainer.textContent=``,this.stickyOffset.style.height=``,this.container?.style.removeProperty(`height`),this.containerHeight=-1,this.windowSpecs={top:0,bottom:0},this.pendingLayoutAnchor=void 0,this.shouldFixContainerFocus=!1,this.height=0,this.scrollTop=0,this.scrollPageOffset=0,this.scrollHeight=0,this.scrollDirty=!0,this.heightDirty=!0,this.resetRenderState(),this.isContainerManaged||this.flushSlotCoordinator(),t)throw n}cleanUp(){let e=!1,t;try{this.reset()}catch(n){e=!0,t=n}if(this.clearElementPool(),this.restoreScrollInteractions(),this.workerManager?.unsubscribeToThemeChanges(this),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.root?.removeEventListener(`scroll`,this.handleScroll),this.root?.removeEventListener(`wheel`,this.clearPendingScroll),this.root?.removeEventListener(`touchstart`,this.clearPendingScroll),this.root?.removeEventListener(`pointerdown`,this.clearPendingScroll),this.root?.removeEventListener(`keydown`,this.clearPendingScroll),this.root?.style.removeProperty(`overflow-anchor`),this.container?.remove(),this.stickyOffset.remove(),this.stickyContainer.remove(),this.stickyContainer.textContent=``,this.header.element?.remove(),this.header.element=void 0,this.header.render=void 0,this.header.height=0,this.footer.element?.remove(),this.footer.element=void 0,this.footer.render=void 0,this.footer.height=0,this.root=void 0,this.container=void 0,e)throw t}cleanAllRenderedItems(){if(this.renderState.firstIndex!==-1)for(let e=this.renderState.firstIndex;e<=this.renderState.lastIndex;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.cleanAllRenderedItems: Item does not exist at index: ${e}`);this.releaseRenderedItem(t)}}primeScrollTarget(e){e.type!==`position`&&this.idToItem.get(e.id)?.instance.primeHighlightCache()}getElementPoolLimit(){let e=this.getHeight()+this.config.overscrollSize*2,{diffHeaderHeight:t}=this.itemMetricsCache;return Math.max(8,Math.ceil(e/Math.max(t,10))+1)*(this.isContainerManaged?2:1)}acquireElement(){this.promotePendingPooledElements();let e=this.elementPool.pop();for(;e!=null&&!this.isElementPoolGenerationCurrent(e);)e=this.elementPool.pop();return e??=document.createElement(Bt),this.markElementPoolGenerationCurrent(e),e}releaseRenderedItem(e){let{element:t}=e;t!=null&&this.renderedItemOwnsFocus(t)&&(this.shouldFixContainerFocus=!0),e.instance.cleanUp(!0),this.attachedEditors.delete(e.item.id),e.element=void 0,t!=null&&(t.remove(),this.cleanElement(t),this.queueElementForPool(t))}renderedItemOwnsFocus(e){let{activeElement:t}=document;return t===e||e.contains(t)||e.shadowRoot?.activeElement!=null}fixContainerFocus(){this.shouldFixContainerFocus&&(this.shouldFixContainerFocus=!1,this.root?.focus({preventScroll:!0}))}cleanElement(e){let{shadowRoot:t}=e;if(t!=null)for(let e of Array.from(t.children))ex(e)||e.remove();this.isContainerManaged||e.replaceChildren()}queueElementForPool(e){let t=this.getElementPoolLimit();!this.isElementPoolGenerationCurrent(e)||this.getElementPoolSize()>=t||(this.isElementClean(e)?this.elementPool.push(e):this.pendingElementPool.push(e))}promotePendingPooledElements(){if(this.pendingElementPool.length===0)return;let{pendingElementPool:e}=this;this.pendingElementPool=[];let t=this.getElementPoolLimit();for(let n of e)this.isElementPoolGenerationCurrent(n)&&this.isElementClean(n)&&this.elementPool.length<t?this.elementPool.push(n):this.isElementPoolGenerationCurrent(n)&&this.getElementPoolSize()<t&&this.pendingElementPool.push(n)}isElementClean(e){return e.childNodes.length===0}getElementPoolSize(){return this.elementPool.length+this.pendingElementPool.length}clearElementPool(){this.elementPool.length=0,this.pendingElementPool.length=0}invalidateElementPool(){this.elementPoolVersion++,this.clearElementPool()}markElementPoolGenerationCurrent(e){this.elementPoolTracker.set(e,this.elementPoolVersion)}isElementPoolGenerationCurrent(e){return this.elementPoolTracker.get(e)===this.elementPoolVersion}resolveEffectiveScrollBehavior(e,t){return Tn()?`instant`:e.behavior===`smooth-auto`?Math.abs(t-this.getScrollTop())<=this.getHeight()*10?`smooth`:`instant`:e.behavior??`instant`}scrollTo(e){if(this.root==null)return;let t=this.normalizeScrollTarget(e);if(t==null)return;let n=this.resolveScrollTargetTop(t);n!=null&&(this.primeScrollTarget(t),this.resolveEffectiveScrollBehavior(t,n)===`smooth`?this.scrollAnimation??={position:this.getScrollTop(),velocity:0,lastTimestamp:performance.now()}:this.scrollAnimation=void 0,this.suspendScrollInteractions(),this.pendingLayoutAnchor=void 0,this.pendingScrollTarget=t,this.render())}setSelectedLines(e,t){this.applySelectedLines(e,t)}getSelectedLines(){return this.selectedLines}clearSelectedLines(e){this.applySelectedLines(null,e)}getItem(e){return this.idToItem.get(e)?.item}getEditor(e){return this.itemEditors.get(e)?.editor}updateItem(e){let t=this.idToItem.get(e.id);return t==null?(console.error(`CodeView.updateItem: unknown item id "${e.id}"`),!1):this.syncItemRecord(t,e)?(this.markItemLayoutDirty(t),this.scrollDirty=!0,this.render(),this.syncItemEditors(),this.syncSelection(),!0):!1}updateItemId(e,t){if(e===t)return!0;let n=this.idToItem.get(e);if(n==null)return console.error(`CodeView.updateItemId: unknown item id "${e}"`),!1;if(this.idToItem.has(t))return console.error(`CodeView.updateItemId: duplicate item id "${t}"`),!1;this.idToItem.delete(e),n.item.id=t,this.idToItem.set(t,n),this.updateItemOptionsId(n.instance.options,t),this.selectedLines?.id===e&&(this.selectedLines={...this.selectedLines,id:t},this.options.onSelectedLinesChange?.(this.selectedLines));let r=this.itemEditors.get(e);return r!=null&&(this.itemEditors.delete(e),this.itemEditors.set(t,r),this.attachedEditors.delete(e)&&this.attachedEditors.add(t)),this.renamePendingScrollTarget(e,t),this.renamePendingLayoutAnchor(e,t),this.render(),!0}addItem(e){this.addItems([e])}addItems(e){this.appendItemsInternal(e),this.syncItemEditors(),this.syncSelection()}removeItem(e){let t=this.idToItem.get(e);if(t==null)return console.error(`CodeView.removeItem: unknown item id "${e}"`),!1;let n=[];for(let e of this.items)e!==t&&n.push(e.item);return this.setItems(n),!0}setItems(e){let t;this.items.length===0?this.appendItemsInternal(e):this.tryAppendItems(e)||(t=this.reconcileItems(e)),this.syncItemEditors(t),this.syncSelection()}appendItemsInternal(e,t=!0){if(e.length===0)return;let n=this.getLayout(),r=this.items.length===0?0:this.scrollHeight+n.gap,i=r;for(let t=0;t<e.length;t++){let i=e[t];if(i==null)throw Error(`CodeView.appendItemsInternal: missing input item`);if(this.idToItem.has(i.id))throw Error(`CodeView.addItem: duplicate id "${i.id}"`);let a=this.createItem(i,this.items.length,r);this.items.push(a),this.idToItem.set(a.item.id,a),this.instanceToItem.set(a.instance,a),a.height=Xb(a),r+=a.height+n.gap}this.scrollHeight=r-n.gap,this.scrollDirty=!0,t&&(this.canSkipRenderForAppend(i)?this.syncContainerHeight():this.render())}canSkipRenderForAppend(e){return this.container!=null&&this.renderState.firstIndex!==-1&&this.pendingScrollTarget==null&&this.scrollAnimation==null&&this.layoutDirtyIndex==null&&e>this.windowSpecs.bottom}onThemeChange(){this.invalidateElementPool()}setOptions(e){if(e==null)return;this.capturePendingLayoutAnchor();let{options:t}=this,n=this.getLayout(),{itemMetricsCache:r}=this;Zb(t,e)&&this.invalidateElementPool(),this.options=e;let i=this.computeMetricsCache(e.itemMetrics),a=!yn(r,i),o=!yn(n,this.getLayout());o&&this.syncLayout();let s=a||Qb(t,e);if(s){let n=this.pendingLayoutReset;this.pendingLayoutReset={metrics:a?i:n?.metrics,resetFileLayoutCache:!0,resetDiffLayoutCache:!0,includeEstimatedDiffHeights:n?.includeEstimatedDiffHeights===!0||a||$b(t,e)}}(o||s)&&(this.markLayoutDirtyFromIndex(0),this.scrollDirty=!0),xn(t,e)||this.renderOptionsRevision++,this.syncItemEditors();let c=t.renderCodeViewHeader!==e.renderCodeViewHeader||t.renderCodeViewFooter!==e.renderCodeViewFooter;!this.isContainerManaged&&(this.items.length>0||c)&&this.render()}capturePendingLayoutAnchor(e=this.idToItem){this.root!=null&&this.items.length!==0&&this.pendingScrollTarget==null&&(this.pendingLayoutAnchor=this.getScrollAnchor(this.getScrollTop(),e))}render(t=!1){e.__STOP||(t?(_n(this.computeRenderRangeAndEmit),this.computeRenderRangeAndEmit()):gn(this.computeRenderRangeAndEmit))}isReady(){let{workerManager:e}=this;return e==null||e.isInitialized()||e.getStats().workersFailed?(this.clearReadySubscription(),!0):(this.isReadySubscription??=e.subscribeToStatChanges(e=>{e.managerState!==`initialized`&&!e.workersFailed||(this.clearReadySubscription(),this.render(!0))}),e.getStats().managerState===`waiting`&&e.initialize().catch(()=>{}),!1)}clearReadySubscription(){this.isReadySubscription!=null&&(this.isReadySubscription(),this.isReadySubscription=void 0)}instanceChanged(e,t){let n=this.instanceToItem.get(e);if(n==null)throw Error(`CodeView.instanceChanged: An instance has changed that is not registered`);t&&this.markItemLayoutDirty(n),this.render()}getWindowSpecs(){return this.windowSpecs}getContainerElement(){return this.root}getHeaderElement(){return this.header.element}getFooterElement(){return this.footer.element}getRenderedItems(){let{firstIndex:e,lastIndex:t}=this.renderState;if(e===-1||t===-1||t<e)return[];let n=[];for(let r=e;r<=t;r++){let e=this.items[r];e?.element!=null&&(e.type===`diff`?n.push({id:e.item.id,type:`diff`,item:e.item,version:e.version,element:e.element,instance:e.instance}):n.push({id:e.item.id,type:`file`,item:e.item,version:e.version,element:e.element,instance:e.instance}))}return n}setSlotCoordinator(e){return e!==this.slotCoordinator&&(this.slotCoordinator=e,this.slotSnapshot=void 0,!0)}getSlotSnapshot(e){return this.buildSlotSnapshot(e)}buildSlotSnapshot(e){let t=ox(this.getRenderedItems(),e),{element:n}=this.header,{element:r}=this.footer;if(t!=null||n!=null||r!=null)return{items:t,header:n,footer:r}}subscribeToScroll(e){return this.scrollListeners.add(e),()=>{this.scrollListeners.delete(e)}}getLocalTopForInstance(e){let t=this.instanceToItem.get(e);if(t==null)throw Error(`CodeView.getLocalTopForInstance: unknown virtualized instance`);return t.top}getTopForItem(e){let t=this.idToItem.get(e);if(t!=null)return t.top+this.getItemTopOffset()}createItem(e,t,n){let{itemMetricsCache:r}=this;if(e.type===`diff`){let i=new pb(this.createDiffOptions(e.id),this,r,this.workerManager,this.isContainerManaged);return{type:`diff`,item:e,version:e.version,index:t,top:n,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:i}}let i=new pg(this.createFileOptions(e.id),this,r,this.workerManager,this.isContainerManaged);return{type:`file`,item:e,version:e.version,index:t,top:n,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:i}}applySelectedLines(e,t){let{selectedLines:n}=this;e==null&&n==null||e!=null&&n?.id===e.id&&Cn(n.range,e.range)||(n!=null&&n.id!==e?.id&&this.idToItem.get(n.id)?.instance.setSelectedLines(null,{notify:!1}),this.selectedLines=e,this.idToItem.get(e?.id??``)?.instance.setSelectedLines(e?.range??null,t))}syncSelection(){if(this.selectedLines==null)return;let e=this.idToItem.get(this.selectedLines.id);if(e==null){this.selectedLines=null,this.options.onSelectedLinesChange?.(null);return}e.instance.setSelectedLines(this.selectedLines.range,{notify:!1})}isItemInEditMode(e){return e.item.edit===!0&&e.item.collapsed!==!0}attachItemEditor(e){let{id:t}=e.item,{createEditor:n}=this.options;if(e.element==null||this.attachedEditors.has(t)||!this.isItemInEditMode(e))return;let r=this.itemEditors.get(t),i;try{if(r==null){qb(n);let r=Lb(e.instance.options);if(r==null)throw Error(`CodeView.attachItemEditor: instance options are missing their state`);let a=e=>{let t=this.idToItem.get(r.id);t!=null&&this.options.onItemEditChange?.(e,t.item)},o=this.options.getEditStateKey?.(e.item);if(e.type===`diff`){let s=n(`file-diff`,{onChange:a},o);i=s,this.itemEditors.set(t,{editor:s,state:r,dispose:s.edit(e.instance)})}else{let s=n(`file`,{onChange:a},o);i=s,this.itemEditors.set(t,{editor:s,state:r,dispose:s.edit(e.instance)})}}else r.dispose=(e.type,r.editor.edit(e.instance));this.attachedEditors.add(t)}catch(t){throw i?.cleanUp(),this.releaseRenderedItem(e),t}}syncItemEditors(e){if(this.itemEditors.size===0)return;let t=[];for(let[n,r]of this.itemEditors){let i=this.idToItem.get(n),a=e?.get(n);if(a==null&&i!=null){let{edit:e=!1,collapsed:t=!1}=i.item;if(e){t&&this.attachedEditors.delete(n)&&r.editor.cleanUp(`recycle`);continue}}else a!=null&&(r.state.removedItem=a.item);this.itemEditors.delete(n),this.attachedEditors.delete(n),t.push(r)}if(t.length===0)return;let n=!1,r;for(let e of t){try{e.dispose()}catch(e){n||(n=!0,r=e)}let t=this.idToItem.get(e.state.id);t!=null&&this.markItemLayoutDirty(t)}if(this.render(),n)throw r}requireItemFromState(e){let t=this.idToItem.get(e.id)?.item??e.removedItem;if(t==null)throw Error(`CodeView.onItemEditComplete: unknown item "${e.id}"`);return t}completeFileItemEdit(e,t){let n=this.requireItemFromState(e);if(n.type!==`file`)throw Error(`CodeView.onItemEditComplete: item "${e.id}" is not a file item`);let r={...n,file:t.file,annotations:t.lineAnnotations,edit:!1,version:(n.version??0)+1};return(this.options.onItemEditComplete?.(t,n,r)??`reject`)===`reject`?`reject`:(this.idToItem.has(n.id)&&this.updateItem(r),`accept`)}completeDiffItemEdit(e,t){let n=this.requireItemFromState(e);if(n.type!==`diff`)throw Error(`CodeView.onItemEditComplete: item "${e.id}" is not a diff item`);let r={...n,fileDiff:t.fileDiff,annotations:t.lineAnnotations,edit:!1,version:(n.version??0)+1};return(this.options.onItemEditComplete?.(t,n,r)??`reject`)===`reject`?`reject`:(this.idToItem.has(n.id)&&this.updateItem(r),`accept`)}renamePendingScrollTarget(e,t){let{pendingScrollTarget:n}=this;n!=null&&n.type!==`position`&&n.id===e&&(this.pendingScrollTarget={...n,id:t})}renamePendingLayoutAnchor(e,t){this.pendingLayoutAnchor?.id===e&&(this.pendingLayoutAnchor.id=t)}createFileOptionsPrototype(){let e={};for(let t of Mb)Rb(e,t,()=>this.options[t]);Rb(e,`stickyHeader`,()=>this.options.stickyHeaders),Rb(e,`collapsed`,e=>{let t=Lb(e);if(t!=null)return this.getItemOptions(t,`file`)?.item.collapsed}),Rb(e,`onEditComplete`,e=>{if(this.options.onItemEditComplete==null)return;let t=Lb(e);if(t!=null)return e=>this.completeFileItemEdit(t,e)});for(let t of Nb)this.defineItemSharedCallback(e,`file`,t);for(let t of Pb)this.defineItemSelectionCallback(e,`file`,t);return e}createDiffOptionsPrototype(){let e={};for(let t of jb)Rb(e,t,()=>this.options[t]);Rb(e,`stickyHeader`,()=>this.options.stickyHeaders),Rb(e,`hunkSeparators`,()=>this.options.hunkSeparators),Rb(e,`collapsed`,e=>{let t=Lb(e);if(t!=null)return this.getItemOptions(t,`diff`)?.item.collapsed}),Rb(e,`onEditComplete`,e=>{if(this.options.onItemEditComplete==null)return;let t=Lb(e);if(t!=null)return e=>this.completeDiffItemEdit(t,e)});for(let t of Nb)this.defineItemSharedCallback(e,`diff`,t);for(let t of Pb)this.defineItemSelectionCallback(e,`diff`,t);return e}createFileOptions(e){let t=Object.create(this.fileOptionsPrototype);return Ib(t,{id:e}),t}createDiffOptions(e){let t=Object.create(this.diffOptionsPrototype);return Ib(t,{id:e}),t}updateItemOptionsId(e,t){let n=Lb(e);if(n==null)throw Error(`CodeView.updateItemOptionsId: No valid state`);n.id=t}getItemOptions(e,t){let n=this.idToItem.get(e.id);if(n!=null&&n.type===t)return n}defineItemSharedCallback(e,t,n){Rb(e,n,e=>{if(this.options[n]==null)return;let r=Lb(e);if(r==null)return;let i=r.callbackCache??={},a=i[n];return a??(a=((...e)=>{let i=this.getItemOptions(r,t);if(i==null)return;let a=this.options[n];return a?.(...e,i)}),i[n]=a),a})}defineItemSelectionCallback(e,t,n){Rb(e,n,e=>{let r=Lb(e);if(r==null)return;let i=r.callbackCache??={},a=i[n];return a??(a=(e=>{let i=this.getItemOptions(r,t);if(i==null)return;let a=e==null?null:{id:i.item.id,range:e};this.options.controlledSelection!==!0&&(e!=null||this.selectedLines?.id===i.item.id)&&this.applySelectedLines(a,{notify:!1}),this.options.onSelectedLinesChange?.(a);let o=this.options[n];return o?.(e,i)}),i[n]=a),a})}markLayoutDirtyFromIndex(e){this.layoutDirtyIndex=Math.min(this.layoutDirtyIndex??e,e)}markItemLayoutDirty(e){if(this.items[e.index]!==e)throw Error(`CodeView.markItemLayoutDirty: unknown item id "${e.item.id}"`);this.markLayoutDirtyFromIndex(e.index)}tryAppendItems(e){if(e.length<=this.items.length)return!1;for(let t=0;t<this.items.length;t++){let n=this.items[t];if(n==null)throw Error(`CodeView.tryAppendItems: missing existing item`);let r=e[t];if(r==null||n.item.id!==r.id||n.type!==r.type)return!1}for(let t=0;t<this.items.length;t++){let n=this.items[t];if(n==null)throw Error(`CodeView.tryAppendItems: missing existing item`);let r=e[t];if(r==null)throw Error(`CodeView.tryAppendItems: append candidate missing prefix item`);this.syncItemRecord(n,r)&&this.markLayoutDirtyFromIndex(t)}return this.appendItemsInternal(e.slice(this.items.length),!1),this.scrollDirty=!0,this.render(),!0}reconcileItems(e){let{items:t,idToItem:n}=this,r=new Set(t),i=[],a=new Map,o=new Map,s=new Map,c;for(let s=0;s<e.length;s++){let l=e[s];if(l==null)throw Error(`CodeView.reconcileItems: missing input item`);if(a.has(l.id))throw Error(`CodeView.setItems: duplicate id "${l.id}"`);let u=n.get(l.id),d=u!=null&&u.type===l.type?u:this.createItem(l,s,0);d.index=s,u!=null&&u.type===l.type?(r.delete(u),this.syncItemRecord(d,l)&&(c=Math.min(c??s,s))):c=Math.min(c??s,s),t[s]!==d&&(c=Math.min(c??s,s)),i.push(d),a.set(l.id,d),o.set(d.instance,d)}if(c==null){if(r.size===0)return;c=Math.max(i.length-1,0)}this.capturePendingLayoutAnchor(a);for(let e=0;e<t.length;e++){let n=t[e];if(n==null||!r.has(n))continue;s.set(n.item.id,n),this.releaseRenderedItem(n);let a=Math.max(i.length-1,0);c=Math.min(c??a,a)}return this.items=i,this.idToItem=a,this.instanceToItem=o,this.renderState.firstIndex>=i.length?this.resetRenderState():this.renderState.lastIndex>=i.length&&(this.renderState.lastIndex=i.length-1),this.markLayoutDirtyFromIndex(c),this.scrollDirty=!0,this.render(),s.size>0?s:void 0}syncItemRecord(e,t){if(e.type!==t.type)throw Error(`CodeView.syncItemRecord: type mismatch for id "${t.id}"`);return e.version!==t.version&&(e.item=t,e.version=t.version,e.renderedOptionsRevision=-1,!0)}getMaxScrollTopForHeight(e){let{paddingBottom:t,paddingTop:n}=this.getLayout();return Math.max(n+this.header.height+e+this.footer.height+t-this.getHeight(),0)}getMaxScrollTop(){return this.getMaxScrollTopForHeight(this.getScrollHeight())}shouldRebaseScroll(){return this.getMaxScrollTop()>Kb}getPagedScrollHeight(){return this.shouldRebaseScroll()?Math.min(this.getScrollHeight(),Hb):this.getScrollHeight()}getMaxPagedScrollTop(){return this.getMaxScrollTopForHeight(this.getPagedScrollHeight())}clampPagedScrollTop(e){let t=this.getMaxPagedScrollTop();return Math.max(0,Math.min(e,t))}clampScrollTop(e){let t=this.getMaxScrollTop();return Math.max(0,Math.min(e,t))}getMaxScrollPageOffset(){return Math.max(this.getMaxScrollTop()-this.getMaxPagedScrollTop(),0)}clampScrollPageOffset(e){let t=this.getMaxScrollPageOffset();return Math.max(0,Math.min(e,t))}resolveScrollPageWindow(e,t){let n=Ab(this.clampPagedScrollTop(t)),r=this.clampScrollPageOffset(e-n);return n=Ab(this.clampPagedScrollTop(e-r)),r=this.clampScrollPageOffset(e-n),{pagedScrollTop:n,scrollPageOffset:r}}resolvePagedScrollPosition(e){if(!this.shouldRebaseScroll())return{pagedScrollTop:this.clampPagedScrollTop(e),scrollPageOffset:0};let t=this.clampScrollPageOffset(this.scrollPageOffset),n=e-t,r=this.getMaxPagedScrollTop(),i=this.getMaxScrollPageOffset(),a=n>Kb&&t<i,o=n<Ub&&t>0;return n<0||n>r||a||o?this.resolveScrollPageWindow(e,o?Math.min(Gb,r):Wb):{pagedScrollTop:Ab(this.clampPagedScrollTop(n)),scrollPageOffset:t}}needsScrollPageUpdate(e){let t=Ab(this.clampScrollTop(e)),{scrollPageOffset:n}=this.resolvePagedScrollPosition(t);return n!==this.scrollPageOffset}getPagedLayoutTop(e){return this.shouldRebaseScroll()?Math.max(e-this.scrollPageOffset,0):e}getStickyHeaderOffset(){return this.options.stickyHeaders===!0&&this.options.disableFileHeader!==!0?this.itemMetricsCache.diffHeaderHeight:0}getScrollTargetRect(e){let t=this.idToItem.get(e.id);if(t==null){console.warn(`CodeView.scrollTo: unknown item id "${e.id}"`);return}if(e.type===`item`)return{top:t.top,height:t.height};if(e.type===`range`){let n=this.getRangeScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve range ${tx(e.range)} for item "${e.id}"`);return}return{top:t.top+n.top,height:n.height}}let n=this.getLineScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve line ${e.lineNumber} for item "${e.id}"`);return}return{top:t.top+n.top,height:n.height}}normalizeScrollTarget(e){if(e.type===`position`||e.align!==`nearest`)return e;let t=this.getScrollTargetRect(e);if(t==null)return;let n=e.offset??0,r=this.getItemTopOffset()+t.top,i=r+t.height,a=this.getScrollTop(),o=a+(e.type===`line`||e.type===`range`?this.getStickyHeaderOffset():0),s=a+this.getHeight();if(!(r-n<=o&&i+n>=s)){if(r-n<o)return{...e,align:`start`};if(i+n>s)return{...e,align:`end`}}}resolveScrollTargetTop(e){if(e.type===`position`){let t=this.clampScrollTop(e.position);return t===e.position?this.clampScrollTop(e.position-this.getStickyHeaderOffset()):t}let t=this.idToItem.get(e.id);if(t==null){console.warn(`CodeView.scrollTo: unknown item id "${e.id}"`);return}if(e.type===`item`)return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top,t.height,e.align,e.offset));if(e.type===`range`){let n=this.getRangeScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve range ${tx(e.range)} for item "${e.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top+n.top,n.height,e.align,e.offset,this.getStickyHeaderOffset()))}let n=this.getLineScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve line ${e.lineNumber} for item "${e.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top+n.top,n.height,e.align,e.offset,this.getStickyHeaderOffset()))}resolveAlignedScrollPosition(e,t,n,r=0,i=0){e+=this.getItemTopOffset();let a=this.getHeight();return n===`center`&&t+r<a?e-(a-t)/2+r:n===`end`?e-(a-t)+r:e-i-r}getLineScrollPosition(e,t){return e.type===`diff`?e.instance.getLinePosition(t.lineNumber,t.side):e.instance.getLinePosition(t.lineNumber)}getRangeScrollPosition(e,t){let{range:n}=t,r=this.getLineScrollPosition(e,{type:`line`,id:t.id,lineNumber:n.start,side:n.side}),i=this.getLineScrollPosition(e,{type:`line`,id:t.id,lineNumber:n.end,side:n.endSide??n.side});if(r==null||i==null)return;let a=r.top,o=a+r.height,s=i.top,c=s+i.height,l=Math.min(a,s);return{top:l,height:Math.max(o,c)-l}}computeTargetScrollTopForFrame(e,t){if(this.pendingScrollTarget==null)return e;let n=this.resolveScrollTargetTop(this.pendingScrollTarget);if(n==null)return e;let{scrollAnimation:r}=this;return r==null?n:this.computeSpringStep(r,n,t).position}computeSpringStep(e,t,n){let r=Math.max(0,n-e.lastTimestamp),{omega:i}=this.getSmoothScrollSettings(),a=Math.exp(-i*r),o=e.position-t,s=e.velocity+i*o;return{position:t+(o+s*r)*a,velocity:(s*(1-i*r)-i*o)*a}}advanceScrollAnimation(e,t){if(this.pendingScrollTarget==null)return;let n=this.resolveScrollTargetTop(this.pendingScrollTarget);if(n==null){this.pendingScrollTarget=void 0,this.scrollAnimation=void 0;return}let r=this.scrollAnimation;if(r==null)return n;r.position+=t;let{position:i,velocity:a}=this.computeSpringStep(r,n,e);r.lastTimestamp=e,r.position=i,r.velocity=a;let{positionEpsilon:o,velocityEpsilon:s}=this.getSmoothScrollSettings();return Math.abs(n-i)<=o&&Math.abs(a)<=s?(r.position=n,r.velocity=0,this.scrollAnimation=void 0,n):r.position}computeRenderRangeAndEmit=(t=performance.now())=>{if(e.__STOP||this.container==null||!this.isReady())return;let n=this.getHeight(),r=this.getScrollTop(),i=r,a=this.pendingLayoutAnchor!=null,o=this.getScrollAnchor(i);if(this.layoutDirtyIndex!=null&&(this.recomputeLayout(this.layoutDirtyIndex,this.pendingLayoutReset),this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,a=!0),a&&o!=null){let e=this.resolveAnchoredScrollTop(o);if(e!=null){let t=e-i;i=e,this.scrollAnimation!=null&&(this.scrollAnimation.position+=t)}}a&&(i=this.clampScrollTop(i),this.syncContainerHeight());let s=this.computeTargetScrollTopForFrame(i,t),c=!a&&(this.renderState.scrollTop===-1||Math.abs(s-this.renderState.scrollTop)>n+this.config.overscrollSize*2);c&&(o=void 0),this.windowSpecs=wn({scrollTop:s-this.header.height,height:n,scrollHeight:this.getScrollHeight(),fitPerfectly:c,fitPerfectlyOverscroll:this.getFitPerfectlyOverscroll(),overscrollSize:this.config.overscrollSize});let l=r;(this.pendingScrollTarget!=null&&s!==l||this.needsScrollPageUpdate(s))&&(this.applyScrollFix(s,l,this.windowSpecs),l=s);let{top:u,bottom:d}=this.windowSpecs,{firstIndex:f,lastIndex:p}=this.renderState;if(f>=0)for(let e=f;e<=p;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.computeRenderRangeAndEmit: No item at index: ${e}`);t.top>u-t.height&&t.top<=d||this.releaseRenderedItem(t)}let m=this.reconcileHeaderFooterHosts(),h,g=new Set,_=this.findFirstVisibleIndex(u),v=this.findLastVisibleIndex(d);for(let e=_;e<=v;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.computeRenderRangeAndEmit: missing item`);let{instance:n}=t;t.element==null?(t.element=this.acquireElement(),ix(this.stickyContainer,t.element,h),n.virtualizedSetup(),rx(t,t.element)&&(t.renderedOptionsRevision=this.renderOptionsRevision,g.add(t)),h=t.element):(ix(this.stickyContainer,t.element,h),rx(t,void 0,t.renderedOptionsRevision!==this.renderOptionsRevision)&&(t.renderedOptionsRevision=this.renderOptionsRevision,g.add(t)),h=t.element),t.item.edit===!0&&this.attachItemEditor(t)}this.renderState.firstIndex=_<=v?_:-1,this.renderState.lastIndex=v,this.flushSlotCoordinator(),this.flushManagers(g),m&&this.measureMountedHosts(),this.reconcileRenderedItems(g),this.syncContainerHeight(),this.updateStickyPositioning();let y=o==null?void 0:this.resolveAnchoredScrollTop(o);o===this.pendingLayoutAnchor&&(this.pendingLayoutAnchor=void 0);let b=y==null?0:y-i,x=s,S=!1;if(this.pendingScrollTarget!=null){let e=this.advanceScrollAnimation(t,b);e==null?x=i:(x=e,S=!0)}else x=y??s;x!==l&&(this.applyScrollFix(x,l,this.windowSpecs),l=x),S&&this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),this.renderState.scrollTop=Ab(l),this.updateStickyPositioning(),this.validateStickyContainerHeight(),this.fixContainerFocus(),(c||this.scrollAnimation!=null)&&this.render()};flushManagers(e){for(let t of e)t.instance.flushManagers()}syncContainerHeight(){let e=this.getPagedScrollHeight();this.container!=null&&this.containerHeight!==e&&(this.container.style.height=`${e}px`,this.containerHeight=e)}getStickyBounds(e){let{firstIndex:t,lastIndex:n}=e==null?this.renderState:{firstIndex:this.findFirstVisibleIndex(e.top),lastIndex:this.findLastVisibleIndex(e.bottom)};if(t===-1||n===-1||t>n)return;let r=this.items[t]?.instance.getAdvancedStickySpecs(e),i=this.items[n]?.instance.getAdvancedStickySpecs(e);if(r!=null&&i!=null)return{stickyTop:this.getPagedLayoutTop(Math.max(r.topOffset,0)),stickyBottom:this.getPagedLayoutTop(i.topOffset+i.height)}}applyStickyPositioning({stickyTop:e,stickyBottom:t}){let n=this.getHeight(),{itemMetricsCache:r}=this,i=t-e;this.renderState.stickyHeight=i,this.renderState.stickyTop=e,this.renderState.stickyBottom=t,this.stickyOffset.style.height=`${e}px`;let a=(Math.random()*r.lineHeight>>0)*-1,o=-Math.max(i+a,0)+n;this.stickyContainer.style.top=`${o}px`,this.stickyContainer.style.bottom=`${o+r.diffHeaderHeight}px`}syncPagedScrollScaffolding(e){this.syncContainerHeight();let t=this.getStickyBounds(e);if(t==null){this.stickyOffset.style.height=`${this.getPagedLayoutTop(e.top)}px`;return}this.applyStickyPositioning(t)}reconcileRenderedItems(e){let{firstIndex:t,lastIndex:n}=this.renderState;if(t===-1)return;let r=-1,i=!1;for(let a=t;a<this.items.length&&!(!i&&a>n);a++){let t=this.items[a];if(t==null)throw Error(`CodeView.reconcileRenderedItems: Invalid item`);r===-1?r=t.top:t.top!==r&&(t.top=r,t.instance.syncVirtualizedTop(),i=!0),(e==null?a<=n:e.has(t))&&(t.instance.reconcileHeights()&&(i=!0,t.height=t.instance.getVirtualizedHeight()),this.validateRenderedItemHeight(t)),r+=t.instance.getVirtualizedHeight(),a<this.items.length-1&&(r+=this.getLayout().gap)}i&&r!=null&&(this.scrollDirty=!0,this.scrollHeight=r)}updateStickyPositioning(){let e=this.getStickyBounds();if(e==null){this.renderState.firstIndex===-1&&(this.stickyOffset.style.height=``);return}let{stickyTop:t,stickyBottom:n}=e;(n-t!==this.renderState.stickyHeight||t!==this.renderState.stickyTop||n!==this.renderState.stickyBottom)&&this.applyStickyPositioning(e)}handleScroll=()=>{e.__STOP||(this.suspendScrollInteractions(),this.scrollDirty=!0,this.notifyScroll(),this.render())};clearPendingScroll=()=>{this.pendingScrollTarget=void 0,this.pendingLayoutAnchor=void 0,this.scrollAnimation=void 0};handleResize=e=>{let t=!1;for(let n of e)if(n.target===this.stickyContainer){let e=n.borderBoxSize[0].blockSize;if(Math.abs(e-this.renderState.stickyHeight)>=Bb){let e=this.getScrollTop(),n=this.getScrollAnchor(e);this.reconcileRenderedItems(),this.updateStickyPositioning();let r=n==null?void 0:this.resolveAnchoredScrollTop(n);if(r!=null){let t=r-e;this.applyScrollFix(r,e,this.windowSpecs),this.scrollAnimation!=null&&(this.scrollAnimation.position+=t)}this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),t=!0}}else if(n.target===this.header.element||n.target===this.footer.element){let e=n.target===this.header.element?this.header:this.footer,r=n.borderBoxSize[0].blockSize;if(r!==e.height){let n=this.getScrollTop(),i=this.getScrollAnchor(n);this.setHostHeight(e,r);let a=i==null?void 0:this.resolveAnchoredScrollTop(i);if(a!=null){let e=a-n;this.applyScrollFix(a,n,this.windowSpecs),this.scrollAnimation!=null&&(this.scrollAnimation.position+=e)}this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),t=!0}}else this.scrollDirty=!0,this.heightDirty=!0,t=!0;t&&this.render(!0)};getScrollAnchorViewportTop(e,t){return e<t?t+this.getStickyHeaderOffset():t}getScrollAnchor(e,t=this.idToItem){let n,{pendingLayoutAnchor:r}=this;if(r!=null){let e=this.idToItem.get(r.id);if(e!=null&&t.get(r.id)===e)return r;e!=null&&(n=e)}if(e<=0)return;let{firstIndex:i,lastIndex:a,stickyTop:o,stickyBottom:s}=this.renderState;if(i===-1||a===-1)return;let c=this.getHeight();if(o!==-1&&s!==-1){for(let r=i;r<=a;r++){let i=this.items[r];if(i==null)continue;let a=this.getItemTopOffset()+i.top;if(a+i.height<=e)continue;if(a>=e+c)break;if(t.get(i.item.id)!==i){n??=i;continue}if(a>=e)return{type:`item`,id:i.item.id,viewportOffset:a-e};let o=this.getScrollAnchorViewportTop(a,e)-a,s=i.instance.getNumericScrollAnchor(o);if(s!=null){let t=a+s.top;return{type:`line`,id:i.item.id,lineNumber:s.lineNumber,side:s.side,viewportOffset:t-e}}}if(n!=null)for(let e=n.index+1;e<this.items.length;e++){let n=this.items[e];if(n!=null&&t.get(n.item.id)===n)return{type:`item`,id:n.item.id,viewportOffset:0}}}}resolveAnchoredScrollTop(e){let t=this.idToItem.get(e.id);if(t==null)return;let n=this.getItemTopOffset();if(e.type===`item`){let r=n+t.top;return this.clampScrollTop(r-e.viewportOffset)}let r=t.type===`diff`?t.instance.getLinePosition(e.lineNumber,e.side):t.instance.getLinePosition(e.lineNumber);if(r==null)return;let i=n+t.top+r.top;return this.clampScrollTop(i-e.viewportOffset)}applyScrollFix(e,t,n){if(this.root==null)return;let r=Ab(this.clampScrollTop(e)),i=Ab(t),{scrollPageOffset:a}=this,o=Ab(this.clampPagedScrollTop(i-a)),{pagedScrollTop:s,scrollPageOffset:c}=this.resolvePagedScrollPosition(r),l=s,u=a!==c;r===this.renderState.scrollTop&&r===i&&l===o&&!u||(this.suspendScrollInteractions(),(l!==o||u)&&(this.scrollPageOffset=c,this.syncPagedScrollScaffolding(n)),l!==o&&this.root.scrollTo({top:l,behavior:`instant`}),this.renderState.scrollTop=r,this.scrollTop=r,this.scrollDirty=!1)}isPendingTargetSettled(e){let t=this.resolveScrollTargetTop(e);return t==null||Ab(this.getScrollTop())===Ab(t)}getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let e=this.root?.scrollTop??0;return this.scrollTop=this.clampScrollTop(e+this.scrollPageOffset),this.scrollTop}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root?.getBoundingClientRect().height??0,this.height):this.height}getScrollHeight(){return this.scrollHeight}flushSlotCoordinator(){if(this.slotCoordinator==null)return;let e=this.buildSlotSnapshot(this.slotCoordinator);Db(this.slotSnapshot,e)||(this.slotSnapshot=e,this.slotCoordinator.onSnapshotChange(e))}notifyScroll(){if(this.scrollListeners.size===0)return;let e=this.getScrollTop();for(let t of this.scrollListeners)t(e,this)}findFirstVisibleIndex(e){let t=0,n=this.items.length-1,r=this.items.length;for(;t<=n;){let i=t+n>>1,a=this.items[i];if(a==null)throw Error(`CodeView.findFirstVisibleIndex: invalid item index`);a.top+a.height>e?(r=i,n=i-1):t=i+1}return r}findLastVisibleIndex(e){let t=0,n=this.items.length-1,r=-1;for(;t<=n;){let i=t+n>>1,a=this.items[i];if(a==null)throw Error(`CodeView.findLastVisibleIndex: invalid item index`);a.top<=e?(r=i,t=i+1):n=i-1}return r}recomputeLayout(e=0,t){if(this.items.length===0){this.scrollHeight=0;return}let n=this.getLayout(),r=0;if(e>0){let t=this.items[e-1];if(t==null)throw Error(`CodeView.recomputeLayout: invalid dirty index`);r=t.top+t.height+n.gap}for(let i=e;i<this.items.length;i++){let e=this.items[i];if(e==null)throw Error(`CodeView.recomputeLayout: invalid item index`);e.top=r,e.height=e.type===`diff`?e.instance.updateCodeViewLayout(e.item.fileDiff,r,t,e.item.annotations??[]):e.instance.updateCodeViewLayout(e.item.file,r,t,e.item.annotations??[]),r+=e.height,i<this.items.length-1&&(r+=n.gap)}r!==this.scrollHeight&&(this.scrollDirty=!0),this.scrollHeight=r}resetRenderState(){this.renderState.scrollTop=-1,this.renderState.firstIndex=-1,this.renderState.lastIndex=-1,this.renderState.stickyHeight=0,this.renderState.stickyTop=-1,this.renderState.stickyBottom=-1}getFitPerfectlyOverscroll(){return this.getLayout().gap+this.itemMetricsCache.diffHeaderHeight}};function Xb(e){return e.instance.cleanUp(!0),e.type===`diff`?e.instance.updateCodeViewLayout(e.item.fileDiff,e.top,void 0,e.item.annotations??[]):e.instance.updateCodeViewLayout(e.item.file,e.top,void 0,e.item.annotations??[])}function Zb(e,t){return!bn(e.theme??R,t.theme??R)||(e.themeType??`system`)!==(t.themeType??`system`)||e.unsafeCSS!==t.unsafeCSS}function Qb(e,t){return(e.overflow??`scroll`)!==(t.overflow??`scroll`)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||e.unsafeCSS!==t.unsafeCSS||(e.diffStyle??`split`)!==(t.diffStyle??`split`)||(e.diffIndicators??`bars`)!==(t.diffIndicators??`bars`)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function $b(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function ex(e){return e instanceof SVGElement||Bh(e)&&(e.hasAttribute(`data-core-css`)||e.hasAttribute(`data-theme-css`)||e.hasAttribute(`data-unsafe-css`))}function tx(e){let t=nx(e.start,e.side),n=nx(e.end,e.endSide??e.side);return t===n?t:`${t}-${n}`}function nx(e,t){return t==null?`${e}`:`${t===`deletions`?`D`:`A`}${e}`}function rx(e,t,n=!1){return e.type===`diff`?e.instance.render({deferManagers:!0,fileContainer:t,fileDiff:e.item.fileDiff,forceRender:n,lineAnnotations:e.item.annotations??[]}):e.instance.render({deferManagers:!0,fileContainer:t,file:e.item.file,forceRender:n,lineAnnotations:e.item.annotations??[]})}function ix(e,t,n){if(n==null){e.firstChild!==t&&e.prepend(t);return}n.nextSibling!==t&&n.after(t)}function ax(e){return(e.annotations?.length??0)>0}function ox(e,{hasHeaderRenderers:t,hasAnnotationRenderer:n,hasGutterRenderer:r}){if(e.length===0)return;if(t||r)return e;if(!n)return;let i=[];for(let t of e)ax(t.item)&&i.push(t);return i.length>0?i:void 0}function sx(e){let t=[];for(let n of e){let e=ma.get(n);if(e==null)throw Error(`getResolvedLanguages: ${n} is not resolved. Please resolve languages before calling getResolvedLanguages`);t.push(e)}return t}function cx(e){for(let t of Array.isArray(e)?e:[e])if(!ma.has(t))return!1;return!0}async function lx(e){let t=[],n=[];for(let r of e){if(r===`text`||r===`ansi`)continue;let e=dp(r)??up(r);`then`in e?n.push(e):t.push(e)}return n.length>0&&await Promise.all(n).then(e=>{for(let n of e){if(n==null)throw Error(`resolvedLanguages: unable to resolve language`);t.push(n)}}),t}function ux(e){return Cp.getResolvedThemes(e)}async function dx(e){for(let t of e)Gp(t);let t=await Cp.resolveThemes(e);for(let n=0;n<e.length;n++)Kp(e[n],t[n]);return t}function fx(e){return e.map(e=>{let t=e.pr?String(e.pr.number):`-`,n=e.pr&&(e.pr.headRefOid||e.head)||``,r=e.localHead||e.head||``;return`${e.worktree}#${t}:${n}:L${r}`}).sort().join(`\0`)}function px(e){return e.repos.flatMap(e=>{let t=e.localHead||``,n=e.prs.filter(e=>e.state===`OPEN`||e.state===void 0);return n.length?n.map(n=>`${e.worktree}#${n.number}:${n.headRefOid||``}:L${t}`):[`${e.worktree}#-::L${t}`]}).sort().join(`\0`)}var mx=new WeakMap;function hx(e,t){if(mx.has(e))return mx.get(e);let n=null;if(e.patch)try{n=Qg(e.patch,`${t}#${gx(e.patch)}`)[0]?.files[0]??null}catch{n=null}return mx.set(e,n),n}function gx(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return`${(t>>>0).toString(36)}${e.length.toString(36)}`}var _x=new WeakMap;function vx(e,t){let n=_x.get(e);if(!n){n={additions:new Map,deletions:new Map};for(let t of e.hunks){let r=t.additionStart,i=t.deletionStart,a=t.additionLineIndex,o=t.deletionLineIndex;for(let s of t.hunkContent)if(s.type===`context`)for(let t=0;t<s.lines;t++)n.additions.set(r++,e.additionLines[a++]??``),n.deletions.set(i++,e.deletionLines[o++]??``);else{for(let t=0;t<s.deletions;t++)n.deletions.set(i++,e.deletionLines[o++]??``);for(let t=0;t<s.additions;t++)n.additions.set(r++,e.additionLines[a++]??``)}}_x.set(e,n)}return n[t]}function yx(e,t,n){let r=vx(e,t);if(!r.size)return!0;let i=n.split(`
|
|
1528
1528
|
`),a=e=>e.replace(/\r?\n$/,``).replace(/\r$/,``);for(let[e,t]of r){let n=i[e-1];if(n===void 0||a(n)!==a(t))return!1}return!0}var bx=3;function xx(e,t,n,r){let i=vx(e,t),a=t===`deletions`?`-`:`+`,o=[];for(let e=Math.max(1,n-bx);e<=r+bx;e++){let t=i.get(e);if(t==null)continue;let s=e>=n&&e<=r?a:` `;o.push(`${s}${String(e).padStart(4)} | ${t}`)}return o.join(`
|
|
1529
|
-
`)}var Sx=t(n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):r((n||=self).lru_map=n.lru_map||{})})(e,function(e){let t=Symbol(`newer`),n=Symbol(`older`);class r{constructor(e,t){typeof e!=`number`&&(t=e,e=0),this.size=0,this.limit=e,this.oldest=this.newest=void 0,this._keymap=new Map,t&&(this.assign(t),e<1&&(this.limit=this.size))}_markEntryAsUsed(e){e!==this.newest&&(e[t]&&(e===this.oldest&&(this.oldest=e[t]),e[t][n]=e[n]),e[n]&&(e[n][t]=e[t]),e[t]=void 0,e[n]=this.newest,this.newest&&(this.newest[t]=e),this.newest=e)}assign(e){let r,a=this.limit||Number.MAX_VALUE;this._keymap.clear();let o=e[Symbol.iterator]();for(let e=o.next();!e.done;e=o.next()){let o=new i(e.value[0],e.value[1]);if(this._keymap.set(o.key,o),r?(r[t]=o,o[n]=r):this.oldest=o,r=o,a--==0)throw Error(`overflow`)}this.newest=r,this.size=this._keymap.size}get(e){var t=this._keymap.get(e);return t?(this._markEntryAsUsed(t),t.value):void 0}set(e,r){var a=this._keymap.get(e);return a?(a.value=r,this._markEntryAsUsed(a),this):(this._keymap.set(e,a=new i(e,r)),this.newest?(this.newest[t]=a,a[n]=this.newest):this.oldest=a,this.newest=a,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var e=this.oldest;if(e)return this.oldest[t]?(this.oldest=this.oldest[t],this.oldest[n]=void 0):(this.oldest=void 0,this.newest=void 0),e[t]=e[n]=void 0,this._keymap.delete(e.key),--this.size,[e.key,e.value]}find(e){let t=this._keymap.get(e);return t?t.value:void 0}has(e){return this._keymap.has(e)}delete(e){var r=this._keymap.get(e);return r?(this._keymap.delete(r.key),r[t]&&r[n]?(r[n][t]=r[t],r[t][n]=r[n]):r[t]?(r[t][n]=void 0,this.oldest=r[t]):r[n]?(r[n][t]=void 0,this.newest=r[n]):this.oldest=this.newest=void 0,this.size--,r.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new o(this.oldest)}values(){return new s(this.oldest)}entries(){return this}[Symbol.iterator](){return new a(this.oldest)}forEach(e,n){typeof n!=`object`&&(n=this);let r=this.oldest;for(;r;)e.call(n,r.value,r.key,this),r=r[t]}toJSON(){for(var e=Array(this.size),n=0,r=this.oldest;r;)e[n++]={key:r.key,value:r.value},r=r[t];return e}toString(){for(var e=``,n=this.oldest;n;)e+=String(n.key)+`:`+n.value,n=n[t],n&&(e+=` < `);return e}}e.LRUMap=r;function i(e,r){this.key=e,this.value=r,this[t]=void 0,this[n]=void 0}function a(e){this.entry=e}a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:[e.key,e.value]}):{done:!0,value:void 0}};function o(e){this.entry=e}o.prototype[Symbol.iterator]=function(){return this},o.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:e.key}):{done:!0,value:void 0}};function s(e){this.entry=e}s.prototype[Symbol.iterator]=function(){return this},s.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:e.value}):{done:!0,value:void 0}}})}))(),1),Cx=Symbol(`IGNORE_RESPONSE`),wx=1e4,Tx=class extends Error{constructor(){super(`WorkerPoolManager: operation canceled because the pool terminated`)}},Ex=class extends Error{constructor(){super(`WorkerPoolManager: operation canceled before the task completed`)}},Dx=class{options;highlighter;preferredHighlighter;renderOptions;renderOptionsRequestVersion=0;renderOptionsVersion=0;initialized=!1;workers=[];queuedTasks=[];queuedTaskByInstance=new Map;taskByHighlightKey=new Map;activeTaskById=new Map;activeRequestByInstance=new Map;nextRequestId=0;themeSubscribers=new Set;workersFailed=!1;statSubscribers=new Set;fileCache;diffCache;_queuedBroadcast;lifecycleGeneration=0;constructor(e,{langs:t,theme:n=R,useTokenTransformer:r=!1,lineDiffType:i=`word-alt`,maxLineDiffLength:a=1e3,tokenizeMaxLineLength:o=1e3,preferredHighlighter:s=`shiki-js`}){this.options=e,this.preferredHighlighter=s,this.renderOptions={theme:n,useTokenTransformer:r,lineDiffType:i,maxLineDiffLength:a,tokenizeMaxLineLength:o},this.fileCache=new Sx.default.LRUMap(e.totalASTLRUCacheSize??100),this.diffCache=new Sx.default.LRUMap(e.totalASTLRUCacheSize??100),this.queueInitialization(t)}isWorkingPool(){return!this.workersFailed}getFileResultCache(e){return e.cacheKey==null?void 0:this.fileCache.get(e.cacheKey)}getDiffResultCache(e){return e.cacheKey==null?void 0:this.diffCache.get(e.cacheKey)}inspectCaches(){let{fileCache:e,diffCache:t}=this;return{fileCache:e,diffCache:t}}evictFileFromCache(e){try{return this.fileCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}evictDiffFromCache(e){try{return this.diffCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}async setRenderOptions({theme:e=this.renderOptions.theme??R,useTokenTransformer:t=this.renderOptions.useTokenTransformer??!1,lineDiffType:n=this.renderOptions.lineDiffType??`word-alt`,maxLineDiffLength:r=this.renderOptions.maxLineDiffLength??1e3,tokenizeMaxLineLength:i=this.renderOptions.tokenizeMaxLineLength??1e3}){let{lifecycleGeneration:a}=this,o=++this.renderOptionsRequestVersion,s=()=>this.isCurrentLifecycle(a)&&this.renderOptionsRequestVersion===o;try{let a={theme:e,useTokenTransformer:t,lineDiffType:n,maxLineDiffLength:r,tokenizeMaxLineLength:i};if(this.isInitialized()||await this.initialize(),!s()||ev(a,this.renderOptions))return;let o=$p(e),c=[];if(bn(a.theme,this.renderOptions.theme)||(c=tm(o)?ux(o):await dx(o)),!s())return;if(this.highlighter!=null)wp(c,this.highlighter);else{let e=await Xp({themes:o,langs:[`text`],preferredHighlighter:this.preferredHighlighter});if(!s())return;this.highlighter=e}let l=this.setRenderOptionsOnWorkers(a,c);this.renderOptions=a,this.renderOptionsVersion++,this.diffCache.clear(),this.fileCache.clear(),this.invalidateRenderTasks();for(let e of this.themeSubscribers)e.onThemeChange();await l}catch(e){if(e instanceof Tx||!s())return;throw e}}getPreferredHighlighter(){return this.preferredHighlighter}getFileRenderOptions(){let{tokenizeMaxLineLength:e,theme:t,useTokenTransformer:n}=this.renderOptions;return{theme:t,useTokenTransformer:n,tokenizeMaxLineLength:e}}getDiffRenderOptions(){return{...this.renderOptions}}async setRenderOptionsOnWorkers(e,t){if(this.workersFailed)return;this.isInitialized()||await this.initialize();let n=[];for(let r of this.workers){if(!r.initialized)throw console.log({managedWorker:r}),Error(`setRenderOptionsOnWorkers: Somehow we have an uninitialized worker`);n.push(new Promise((n,i)=>{let a=this.generateRequestId(),o={type:`set-render-options`,id:a,request:{type:`set-render-options`,id:a,renderOptions:e,resolvedThemes:t},resolve:n,reject:i,requestStart:Date.now()};this.activeTaskById.set(a,o),r.pendingSetupRequestId=a,r.worker.postMessage(o.request)}))}await Promise.all(n)}subscribeToThemeChanges(e){return this.themeSubscribers.add(e),this.queueBroadcastStateChanges(),()=>{this.unsubscribeToThemeChanges(e),this.queueBroadcastStateChanges()}}unsubscribeToThemeChanges(e){this.themeSubscribers.delete(e),this.queueBroadcastStateChanges()}subscribeToStatChanges(e){return this.statSubscribers.add(e),e(this.getStats()),()=>{this.statSubscribers.delete(e)}}queueBroadcastStateChanges(){this._queuedBroadcast??=requestAnimationFrame(this._broadcastStateChanges)}_broadcastStateChanges=()=>{this._queuedBroadcast!=null&&(cancelAnimationFrame(this._queuedBroadcast),this._queuedBroadcast=void 0);let e=this.getStats();for(let t of this.statSubscribers)t(e)};cleanUpTasks(e){this.detachInstanceFromQueuedTasks(e);let t=this.activeRequestByInstance.get(e);if(t!=null){let n=this.activeTaskById.get(t);Ax(n)?(this.detachInstanceFromRenderTask(n,e),!n.primeCache&&n.instances.size===0&&this.removeActiveTask(n)):this.activeTaskById.delete(t)}this.activeRequestByInstance.delete(e),this.queueBroadcastStateChanges()}isInitialized(){return this.initialized===!0}async initialize(e=[]){if(this.initialized!==!0){if(this.initialized===!1){let{lifecycleGeneration:t}=this;this.initialized=new Promise((n,r)=>{(async()=>{try{let r=$p(this.renderOptions.theme),i=[];if(i=tm(r)?ux(r):await dx(r),!this.isCurrentLifecycle(t)){n();return}let a=[];if(a=cx(e)?sx(e):await lx(e),!this.isCurrentLifecycle(t)){n();return}let[o]=await Promise.all([Xp({themes:r,langs:[`text`,...e],preferredHighlighter:this.preferredHighlighter}),this.initializeWorkers(i,a)]);if(!this.isCurrentLifecycle(t)){this.terminateWorkers(),n();return}this.highlighter=o,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),this.queueBroadcastStateChanges(),n()}catch(e){if(e instanceof Tx||!this.isCurrentLifecycle(t)){n();return}this.initialized=!1,this.workersFailed=!0,this.cancelActiveWorkerTasks(),this.terminateWorkers(),this.activeTaskById.clear();for(let t of this.queuedTasks)this.rejectRenderTaskCallbacks(t,Mx(e));this.queueBroadcastStateChanges(),r(e)}})()}),this.queueBroadcastStateChanges()}else return this.initialized}}async initializeWorkers(e,t){this.workersFailed=!1;let n=[],r=hm(),i=r>0?gm():void 0;this.workers.length>0&&this.terminateWorkers();for(let a=0;a<(this.options.poolSize??8);a++){let a=this.options.workerFactory(),o={worker:a,requestId:void 0,pendingSetupRequestId:void 0,initialized:!1,langs:new Set([`text`,...t.map(({name:e})=>e)]),customExtensionsVersion:0};a.addEventListener(`message`,e=>{this.handleWorkerMessage(o,e.data)}),a.addEventListener(`error`,e=>this.handleWorkerError(o,e)),this.workers.push(o),n.push(new Promise((n,a)=>{let s=this.generateRequestId(),c={type:`initialize`,id:s,request:{type:`initialize`,id:s,renderOptions:this.renderOptions,preferredHighlighter:this.preferredHighlighter,resolvedThemes:e,resolvedLanguages:t,customExtensionsVersion:i==null?void 0:r,customExtensionMap:i},resolve(){o.initialized=!0,n()},reject:a,requestStart:Date.now()};o.pendingSetupRequestId=s,this.activeTaskById.set(s,c),this.executeTask(o,c)}))}let a=this.options.workerInitializationTimeout??wx,o;try{await Promise.race([Promise.all(n),new Promise((e,t)=>{o=setTimeout(()=>{t(Error(`WorkerPoolManager: worker initialization timed out after ${a}ms`))},a)})])}finally{o!=null&&clearTimeout(o)}}handleWorkerError(e,t){console.error(`Worker error:`,t,e);let{pendingSetupRequestId:n}=e;if(n==null)return;let r=this.activeTaskById.get(n);r?.type===`initialize`&&(r.reject(Mx(t)),this.cleanWorkerAndTask(e,r))}drainQueue=()=>{if(this._queuedDrain=void 0,this.initialized===!0&&this.queuedTasks.length!==0){for(let e=0;e<this.queuedTasks.length;){let t=this.queuedTasks[e];if(this.hasActiveRequest(t)){e++;continue}let n=kx(t),r=this.getAvailableWorker(n);if(r==null)break;this.queuedTasks.splice(e,1),this.assignWorkerToTask(t,r),this.resolveLanguagesAndExecuteTask(r,t,n)}this.queueBroadcastStateChanges()}};highlightFileAST(e,t){let n=this.getFileResultCache(t);fh(t)||n!=null&&nm(n.options,this.getFileRenderOptions())||this.hasMatchingFileInstanceTask(e,t)||this.submitTask(e,{type:`file`,file:t})}primeFileHighlightCache(e){if(!this.isWorkingPool())return Promise.reject(Error(`WorkerPoolManager.primeFileHighlightCache: worker pool is not working`));let t=this.getOrCreateFileHighlightCacheTask(e);return t==null?Promise.resolve():this.createRenderTaskCallbacks(t)}getOrCreateFileHighlightCacheTask(e){if(e.cacheKey==null){console.warn(`WorkerPoolManager.primeFileHighlightCache: priming highlight cache requires file.cacheKey; skipping "${e.name}".`);return}let t=this.getFileResultCache(e),n=this.getFileHighlightKey(e);if(n==null||fh(e)||t!=null&&nm(t.options,this.getFileRenderOptions()))return;let r=this.getTaskByHighlightKey(n);if(r!=null)return r.primeCache=!0,r.type===`file`?r:void 0;{let t=this.submitCacheTask({type:`file`,file:e},n);return t.type===`file`?t:void 0}}getPlainFileAST(e,t,n,r){if(this.highlighter==null){this.queueInitialization();return}return nh(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,lines:r})}highlightDiffAST(e,t){let n=this.getDiffResultCache(t);Ey(t)||n!=null&&ev(n.options,this.getDiffRenderOptions())||this.hasMatchingDiffInstanceTask(e,t)||this.submitTask(e,{type:`diff`,diff:t})}primeDiffHighlightCache(e){if(!this.isWorkingPool())return Promise.reject(Error(`WorkerPoolManager.primeDiffHighlightCache: worker pool is not working`));let t=this.getOrCreateDiffHighlightCacheTask(e);return t==null?Promise.resolve():this.createRenderTaskCallbacks(t)}getOrCreateDiffHighlightCacheTask(e){if(e.cacheKey==null){console.warn(`WorkerPoolManager.primeDiffHighlightCache: priming highlight cache requires diff.cacheKey; skipping "${e.prevName??e.name}" -> "${e.name}".`);return}let t=this.getDiffResultCache(e),n=this.getDiffHighlightKey(e);if(n==null||Ey(e)||t!=null&&ev(t.options,this.getDiffRenderOptions()))return;let r=this.getTaskByHighlightKey(n);if(r!=null)return r.primeCache=!0,r.type===`diff`?r:void 0;{let t=this.submitCacheTask({type:`diff`,diff:e},n);return t.type===`diff`?t:void 0}}getPlainDiffAST(e,t,n,r,i){return this.highlighter==null?void 0:Av(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,expandedHunks:r,collapsedContextThreshold:i})}terminate(){this.lifecycleGeneration++,this.cancelActiveWorkerTasks(),this.terminateWorkers();let e=new Tx;for(let t of this.queuedTasks)this.rejectRenderTaskCallbacks(t,e);this.fileCache.clear(),this.diffCache.clear(),this.activeRequestByInstance.clear(),this.queuedTasks.length=0,this.queuedTaskByInstance.clear(),this.taskByHighlightKey.clear(),this.activeTaskById.clear(),this.highlighter=void 0,this.initialized=!1,this.workersFailed=!1,this.queueBroadcastStateChanges()}isCurrentLifecycle(e){return this.lifecycleGeneration===e}queueInitialization(e){this.initialize(e).catch(e=>{console.error(e)})}cancelActiveWorkerTasks(){let e=new Tx;for(let t of this.activeTaskById.values())`reject`in t?t.reject(e):Ax(t)&&this.rejectRenderTaskCallbacks(t,e)}terminateWorkers(){for(let e of this.workers)e.worker.terminate();this.workers.length=0}getStats(){return{managerState:this.initialized===!1?`waiting`:this.initialized===!0?`initialized`:`initializing`,totalWorkers:this.workers.length,workersFailed:this.workersFailed,busyWorkers:this.workers.filter(e=>e.requestId!=null||e.pendingSetupRequestId!=null).length,queuedTasks:this.queuedTasks.length,activeTasks:this.activeTaskById.size,themeSubscribers:this.themeSubscribers.size,fileCacheSize:this.fileCache.size,diffCacheSize:this.diffCache.size}}submitTask(e,t){this.initialized===!1&&this.queueInitialization();let n=this.getHighlightKeyForRequest(t),r=n==null?void 0:this.getTaskByHighlightKey(n);if(r!=null){this.detachInstanceFromQueuedTasks(e,r),this.addInstanceToTask(r,e),this.queueBroadcastStateChanges();return}this.detachInstanceFromQueuedTasks(e);let i=this.generateRequestId(),a=Date.now(),{renderOptionsVersion:o}=this,s=(()=>{switch(t.type){case`file`:return{type:`file`,id:i,request:{...t,id:i},instances:new Set([e]),primeCache:!1,highlightKey:n,callbacks:new Set,renderOptionsVersion:o,requestStart:a};case`diff`:return{type:`diff`,id:i,request:{...t,id:i},instances:new Set([e]),primeCache:!1,highlightKey:n,callbacks:new Set,renderOptionsVersion:o,requestStart:a}}})();this.enqueueRenderTask(s,e)}submitCacheTask(e,t){this.initialized===!1&&this.queueInitialization();let n=this.generateRequestId(),r=Date.now(),{renderOptionsVersion:i}=this,a=(()=>{switch(e.type){case`file`:return{type:`file`,id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,callbacks:new Set,renderOptionsVersion:i,requestStart:r};case`diff`:return{type:`diff`,id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,callbacks:new Set,renderOptionsVersion:i,requestStart:r}}})();return this.enqueueRenderTask(a),a}enqueueRenderTask(e,t){this.queuedTasks.push(e),t!=null&&this.queuedTaskByInstance.set(t,e),e.highlightKey!=null&&this.taskByHighlightKey.set(e.highlightKey,e),this.queueDrain()}async resolveLanguagesAndExecuteTask(e,t,n){try{let r=n.filter(t=>!e.langs.has(t));if(r.length>0&&(cx(r)?t.request.resolvedLanguages=sx(r):t.request.resolvedLanguages=await lx(r)),!this.activeTaskById.has(t.id)){e.requestId===t.id&&(this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain());return}this.executeTask(e,t)}catch(n){this.rejectRenderTaskCallbacks(t,Mx(n)),this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}}handleWorkerMessage(e,t){let n=this.activeTaskById.get(t.id);try{if(n==null)throw Cx;if(t.type===`error`){let e=Error(t.error);if(t.stack&&(e.stack=t.stack),`reject`in n)n.reject(e);else if(Ax(n))this.notifyHighlightError(n,e),this.rejectRenderTaskCallbacks(n,e);else throw Error(`handleWorkerMessage: unknown task type`);throw e}switch(t.requestType){case`initialize`:if(n.type!==`initialize`)throw Error(`handleWorkerMessage: task/response dont match`);this.syncCustomExtensionVersion(e,n.request),n.resolve();break;case`set-render-options`:if(n.type!==`set-render-options`)throw Error(`handleWorkerMessage: task/response dont match`);n.resolve();break;case`file`:{if(n.type!==`file`)throw Error(`handleWorkerMessage: task/response dont match`);let{result:r,options:i}=t;if(!this.isCurrentRenderTask(n)||!nm(i,this.getFileRenderOptions()))throw Cx;let{request:a}=n;this.syncCustomExtensionVersion(e,a),n.cacheKeyAtDispatch!=null&&this.fileCache.set(n.cacheKeyAtDispatch,{result:r,options:i}),this.resolveRenderTaskCallbacks(n),this.notifyFileInstances(n,r,i);break}case`diff`:{if(n.type!==`diff`)throw Error(`handleWorkerMessage: task/response dont match`);let{result:r,options:i}=t;if(!this.isCurrentRenderTask(n)||!ev(i,this.getDiffRenderOptions()))throw Cx;let{request:a}=n;this.syncCustomExtensionVersion(e,a),n.cacheKeyAtDispatch!=null&&this.diffCache.set(n.cacheKeyAtDispatch,{result:r,options:i}),this.resolveRenderTaskCallbacks(n),this.notifyDiffInstances(n,r,i);break}}}catch(e){e!==Cx&&console.error(e,n,t)}this.cleanWorkerAndTask(e,n,t.id),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}_queuedDrain;queueDrain(){this._queuedDrain??(this._queuedDrain=Promise.resolve().then(this.drainQueue),this.queueBroadcastStateChanges())}assignWorkerToTask(e,t){t.requestId=e.id,Ax(e)&&(this.clearQueuedInstanceRequests(e),this.trackInstanceRequests(e)),this.activeTaskById.set(e.id,e)}cleanWorkerAndTask(e,t,n=t?.id){e.requestId===n&&(e.requestId=void 0),e.pendingSetupRequestId===n&&(e.pendingSetupRequestId=void 0),t!=null&&(Ax(t)&&(this.rejectRenderTaskCallbacks(t,new Ex),this.clearInstanceRequests(t),this.clearHighlightKey(t)),this.activeTaskById.delete(t.id))}executeTask(e,t){Ox(t.request)&&this.maybeAttachCustomExtensions(e,t.request),this.activeTaskById.has(t.id)||this.assignWorkerToTask(t,e);for(let n of kx(t))e.langs.add(n);try{t.type===`file`?t.cacheKeyAtDispatch=t.request.file.cacheKey:t.type===`diff`&&(t.cacheKeyAtDispatch=t.request.diff.cacheKey),e.worker.postMessage(t.request)}catch(n){console.error(`Failed to post message to worker:`,n),Ax(t)?(this.notifyHighlightError(t,n),this.rejectRenderTaskCallbacks(t,Mx(n))):`reject`in t&&t.reject(n),this.cleanWorkerAndTask(e,t),this.queuedTasks.length>0&&this.queueDrain()}this.queueBroadcastStateChanges()}maybeAttachCustomExtensions(e,t){if(t.customExtensionsVersion!=null)return;let n=hm();e.customExtensionsVersion>=n||(t.customExtensionsVersion=n,t.customExtensionMap=gm())}syncCustomExtensionVersion(e,t){t.customExtensionsVersion!=null&&(e.customExtensionsVersion=t.customExtensionsVersion)}getAvailableWorker(e){let t;for(let n of this.workers){if(n.requestId!=null||n.pendingSetupRequestId!=null||!n.initialized)continue;if(t=n,e.length===0)break;let r=!0;for(let t of e)if(!n.langs.has(t)){r=!1;break}if(r)break}return t}getFileHighlightKey(e){if(e.cacheKey!=null)return`file:${e.cacheKey}:${this.renderOptionsVersion}`}getDiffHighlightKey(e){if(e.cacheKey!=null)return`diff:${e.cacheKey}:${this.renderOptionsVersion}`}getHighlightKeyForRequest(e){switch(e.type){case`file`:return this.getFileHighlightKey(e.file);case`diff`:return this.getDiffHighlightKey(e.diff)}}hasActiveRequest(e){for(let t of jx(e))if(this.activeRequestByInstance.has(t))return!0;return!1}addInstanceToTask(e,t){e.type,e.instances.add(t),this.activeTaskById.has(e.id)?this.activeRequestByInstance.set(t,e.id):this.queuedTaskByInstance.set(t,e)}detachInstanceFromQueuedTasks(e,t){let n=this.queuedTaskByInstance.get(e);n!=null&&n!==t&&(this.queuedTaskByInstance.delete(e),this.detachInstanceFromRenderTask(n,e),!n.primeCache&&n.instances.size===0&&this.removeQueuedTask(n))}detachInstanceFromRenderTask(e,t){e.type,e.instances.delete(t)}removeQueuedTask(e){let t=this.queuedTasks.indexOf(e);t!==-1&&this.queuedTasks.splice(t,1),this.rejectRenderTaskCallbacks(e,new Ex),this.clearQueuedInstanceRequests(e),this.clearHighlightKey(e)}removeActiveTask(e){this.rejectRenderTaskCallbacks(e,new Ex),this.clearInstanceRequests(e),this.clearHighlightKey(e),this.activeTaskById.delete(e.id)}createRenderTaskCallbacks(e){return new Promise((t,n)=>{e.callbacks.add({resolve:t,reject:n})})}resolveRenderTaskCallbacks(e){for(let t of e.callbacks)t.resolve();e.callbacks.clear()}rejectRenderTaskCallbacks(e,t){for(let n of e.callbacks)n.reject(t);e.callbacks.clear()}invalidateRenderTasks(){for(let e=this.queuedTasks.length-1;e>=0;e--){let t=this.queuedTasks[e];t.renderOptionsVersion!==this.renderOptionsVersion&&this.removeQueuedTask(t)}for(let e of Array.from(this.activeTaskById.values()))Ax(e)&&e.renderOptionsVersion!==this.renderOptionsVersion&&this.removeActiveTask(e)}clearQueuedInstanceRequests(e){for(let t of jx(e))this.queuedTaskByInstance.get(t)===e&&this.queuedTaskByInstance.delete(t)}clearHighlightKey(e){e.highlightKey!=null&&this.taskByHighlightKey.get(e.highlightKey)===e&&this.taskByHighlightKey.delete(e.highlightKey)}trackInstanceRequests(e){for(let t of jx(e))this.activeRequestByInstance.set(t,e.id)}clearInstanceRequests(e){for(let t of jx(e))this.activeRequestByInstance.get(t)===e.id&&this.activeRequestByInstance.delete(t)}notifyFileInstances(e,t,n){for(let r of e.instances)this.activeRequestByInstance.get(r)===e.id&&r.onHighlightSuccess(e.request.file,t,n)}notifyDiffInstances(e,t,n){for(let r of e.instances)this.activeRequestByInstance.get(r)===e.id&&r.onHighlightSuccess(e.request.diff,t,n)}notifyHighlightError(e,t){for(let n of jx(e))this.activeRequestByInstance.get(n)===e.id&&n.onHighlightError(t)}hasMatchingFileInstanceTask(e,t){for(let n of this.iterateRenderTasks())if(n.type===`file`&&this.isCurrentRenderTask(n)&&n.instances.has(e)&&gg(t,n.request.file))return!0;return!1}hasMatchingDiffInstanceTask(e,t){for(let n of this.iterateRenderTasks())if(n.type===`diff`&&this.isCurrentRenderTask(n)&&n.instances.has(e)&&hg(n.request.diff,t))return!0;return!1}getTaskByHighlightKey(e){let t=this.taskByHighlightKey.get(e);return t!=null&&this.isCurrentRenderTask(t)?t:void 0}isCurrentRenderTask(e){return e.renderOptionsVersion===this.renderOptionsVersion}*iterateRenderTasks(){for(let e of this.queuedTasks)yield e;for(let e of this.activeTaskById.values())Ax(e)&&(yield e)}generateRequestId(){return`req_${++this.nextRequestId}`}};function Ox(e){return e.type===`initialize`||e.type===`file`||e.type===`diff`}function kx(e){let t=new Set;if(e.type===`initialize`||e.type===`set-render-options`)return[];switch(e.type){case`file`:t.add(e.request.file.lang??mm(e.request.file.name));break;case`diff`:t.add(e.request.diff.lang??mm(e.request.diff.name)),t.add(e.request.diff.lang??mm(e.request.diff.prevName??`-`))}return t.delete(`text`),Array.from(t)}function Ax(e){return e?.type===`file`||e?.type===`diff`}function jx(e){return e.instances}function Mx(e){if(e instanceof Error)return e;if(typeof e==`object`&&e){if(`error`in e&&e.error instanceof Error)return e.error;if(`message`in e&&typeof e.message==`string`)return Error(e.message)}return Error(String(e))}var Nx;function Px({poolOptions:e,highlighterOptions:t}){return Nx??=new Dx(e,t),Nx}var Fx=`/assets/worker-C0KwUb8K.js`,Ix;function Lx(){return Ix??=Px({poolOptions:{workerFactory:()=>new Worker(Fx,{type:`module`}),poolSize:Math.min(2,navigator.hardwareConcurrency||2)},highlighterOptions:{theme:{dark:`pierre-dark`,light:`pierre-light`}}})}function Rx(e){let t=[],n=[];for(let r of e.trim().split(/\s+/).filter(Boolean)){let e=r.startsWith(`!`),i=e?r.slice(1):r;i&&(e?n:t).push(zx(i))}return e=>!n.some(t=>t(e))&&t.every(t=>t(e))}function zx(e){if(!/[*?]/.test(e))return t=>tt(e,t);let t=``;for(let n=0;n<e.length;n++){let r=e[n];r===`*`?e[n+1]===`*`?(t+=`.*`,n++):t+=`[^/]*`:t+=r===`?`?`[^/]`:r.replace(/[.+^${}()|[\]\\]/,`\\$&`)}try{let e=new RegExp(t,`i`);return t=>e.test(t)}catch{return t=>tt(e,t)}}function Bx(e,t){let n=null,r=()=>{if(!n||t.aborted)return;let i=e().closest(`[data-diff-main]`);if(i){let t=i.getBoundingClientRect(),r=0;if(n.y>=t.bottom-110?r=Math.max(4,Math.min(20,(n.y-(t.bottom-110))/3)):n.y<=t.top+110&&(r=-Math.max(4,Math.min(20,(t.top+110-n.y)/3))),r){i.scrollTop+=r;let a=e().getBoundingClientRect(),o=Math.max(t.top+12,a.top+48),s=Math.min(t.bottom-12,a.bottom-48),c=Math.max(o,Math.min(n.y,s));document.dispatchEvent(new PointerEvent(`pointermove`,{clientX:n.x,clientY:c,pointerId:n.pointerId,pointerType:`touch`,bubbles:!0,composed:!0}))}}requestAnimationFrame(r)};e().addEventListener(`pointerdown`,e=>{e.pointerType!==`mouse`&&e.composedPath().some(e=>e instanceof HTMLElement&&e.hasAttribute?.(`data-column-number`))&&(n={pointerId:e.pointerId,x:e.clientX,y:e.clientY},requestAnimationFrame(r))},{capture:!0,signal:t}),document.addEventListener(`pointermove`,e=>{n&&e.pointerId===n.pointerId&&e.isTrusted&&(n.x=e.clientX,n.y=e.clientY)},{capture:!0,passive:!0,signal:t});for(let e of[`pointerup`,`pointercancel`])document.addEventListener(e,e=>{n&&e.pointerId===n.pointerId&&(n=null)},{capture:!0,signal:t})}function Vx(e){if(e.length<=1)return null;let t=document.createElement(`select`);t.setAttribute(`aria-label`,`Send to session`),t.className=`_iz`;for(let n of e){let e=document.createElement(`option`);e.value=n.id,e.textContent=n.title||n.agent,t.append(e)}return t}var Hx=(e,t)=>e?.value||t[0]?.id||null;function Ux(e,t,n){for(let r of e)r.disabled=t,n&&r.dataset.role===`send`&&(r.textContent=t?`Sending…`:n)}function Wx(e,t){let n=document.createElement(`button`);return n.type=`button`,n.textContent=e,n.className=t,n}function Gx(e,t,n,r){if(!t){e.className=`_q ${r?be:``} _r`,e.textContent=`Send`;let t=n[0];return t&&(e.title=`Send to ${t.title||t.agent}`),e}let i=document.createElement(`span`);return i.className=`_ix ${r?`_i5`:``}`,e.className=`_r _iy`,e.textContent=`Send to`,i.append(e,t),i}function Kx(e,t,n){e.onkeydown=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),t()),e.key===`Escape`&&(e.preventDefault(),n())}}function qx(e,t,n){let r=document.createElement(`div`);r.className=`_i1`;let i=document.createElement(`div`),a=document.createElement(`div`);a.className=`_i4`;let o=()=>{i.replaceChildren(),a.replaceChildren();let r=document.createElement(`p`);r.className=`_i2`,r.textContent=e.text;let o=Wx(`Remove`,`_q ${be}`);o.onclick=()=>n.onDelete(e.id);let c=Wx(`Edit`,`_q ${be}`);c.hidden=!n.onEdit,c.onclick=()=>s();let l=t.sessions(),u=l.length>0&&!!n.onSend,d=Wx(`Send`,``);d.dataset.role=`send`,d.hidden=!u;let f=u?Vx(l):null,p=f?`Send to`:`Send`;if(d.onclick=()=>{(async()=>{let t=Hx(f,l);if(!(!t||d.disabled)){Ux([o,c,d],!0,p);try{await n.onSend?.(e.id,t)}finally{Ux([o,c,d],!1,p)}}})()},a.append(c,o),u&&a.append(Gx(d,f,l,!0)),n.drifted){let e=document.createElement(`span`);e.className=`_N ${pe.warn} _i6`,e.textContent=`changed since`,e.title=`The file changed here after this comment was written; the agent gets the lines as they were.`,a.append(e)}i.append(r)},s=()=>{i.replaceChildren(),a.replaceChildren();let t=document.createElement(`textarea`);t.value=e.text,t.rows=3,t.className=`_Y _i3`;let r=Wx(`Save`,`_q _r`),s=Wx(`Cancel`,`_q`),c=()=>{let i=t.value.trim();if(!i||i===e.text){o();return}(async()=>{Ux([r,s],!0);try{await n.onEdit?.(e.id,i),e.text=i,o()}catch{Ux([r,s],!1)}})()};r.onclick=c,s.onclick=()=>o(),Kx(t,c,o),a.append(r,s),i.append(t),setTimeout(()=>{t.focus({preventScroll:!0}),t.setSelectionRange(t.value.length,t.value.length)},0)};return o(),r.append(i,a),r}function Jx(e,t){let n=document.createElement(`div`);n.className=`_i1`;let r=document.createElement(`textarea`);r.placeholder=`Add a comment…`,r.rows=3,r.className=`_Y _i3`;let i=Wx(`Add`,`_q`),a=Wx(`Send`,``);a.dataset.role=`send`;let o=Wx(`Cancel`,`_q`),s=e.sessions(),c=s.length>0&&!!t.onSend;a.hidden=!c;let l=c?Vx(s):null,u=c?Gx(a,l,s,!1):a,d=a.textContent,f=()=>{r.value.trim()&&t.onSave(r.value)},p=()=>{(async()=>{let e=r.value.trim(),n=Hx(l,s);if(!(!e||!n||a.disabled)){Ux([i,a,o],!0,d);try{await t.onSend?.(e,n)}finally{Ux([i,a,o],!1,d)}}})()};i.onclick=f,a.onclick=p,o.onclick=()=>t.onCancel(),Kx(r,c?p:f,()=>t.onCancel());let m=document.createElement(`div`);m.className=`_i4`,m.append(i),c&&m.append(u),m.append(o),n.append(r,m),r.addEventListener(`focus`,()=>{let t=window.visualViewport;if(!t)return;let i=()=>e.reveal(n,!0);t.addEventListener(`resize`,i),r.addEventListener(`blur`,()=>t.removeEventListener(`resize`,i),{once:!0})});let h=(e=0)=>{if(!r.isConnected||!r.getClientRects().length){e<120&&requestAnimationFrame(()=>h(e+1));return}r.focus({preventScroll:!0})};return setTimeout(h,0),n}function Yx(e,t){let n=new Map;for(let t of e)n.set(t.worktree,[...n.get(t.worktree)||[],t]);let r=[`Review feedback:`],i=0;for(let[e,a]of n){let n=(t||[]).find(t=>t.worktree===e);r.push(``),r.push(Xx(e,n,a));for(let e of a){i++;let t=e.side===`deletions`?`Old`:`New`,n=e.line_start===e.line_end?`line ${e.line_start}`:`lines ${e.line_start}-${e.line_end}`;r.push(``),r.push(`${i}. **${e.path}** (${t} ${n})`);let a=e.snippet;if(a!=null){let e=Qx(a);r.push(``),r.push($x(`${e}diff\n${a}\n${e}`))}r.push(``),r.push($x(e.text))}}return r.join(`
|
|
1530
|
-
`)}function
|
|
1529
|
+
`)}var Sx=t(n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):r((n||=self).lru_map=n.lru_map||{})})(e,function(e){let t=Symbol(`newer`),n=Symbol(`older`);class r{constructor(e,t){typeof e!=`number`&&(t=e,e=0),this.size=0,this.limit=e,this.oldest=this.newest=void 0,this._keymap=new Map,t&&(this.assign(t),e<1&&(this.limit=this.size))}_markEntryAsUsed(e){e!==this.newest&&(e[t]&&(e===this.oldest&&(this.oldest=e[t]),e[t][n]=e[n]),e[n]&&(e[n][t]=e[t]),e[t]=void 0,e[n]=this.newest,this.newest&&(this.newest[t]=e),this.newest=e)}assign(e){let r,a=this.limit||Number.MAX_VALUE;this._keymap.clear();let o=e[Symbol.iterator]();for(let e=o.next();!e.done;e=o.next()){let o=new i(e.value[0],e.value[1]);if(this._keymap.set(o.key,o),r?(r[t]=o,o[n]=r):this.oldest=o,r=o,a--==0)throw Error(`overflow`)}this.newest=r,this.size=this._keymap.size}get(e){var t=this._keymap.get(e);return t?(this._markEntryAsUsed(t),t.value):void 0}set(e,r){var a=this._keymap.get(e);return a?(a.value=r,this._markEntryAsUsed(a),this):(this._keymap.set(e,a=new i(e,r)),this.newest?(this.newest[t]=a,a[n]=this.newest):this.oldest=a,this.newest=a,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var e=this.oldest;if(e)return this.oldest[t]?(this.oldest=this.oldest[t],this.oldest[n]=void 0):(this.oldest=void 0,this.newest=void 0),e[t]=e[n]=void 0,this._keymap.delete(e.key),--this.size,[e.key,e.value]}find(e){let t=this._keymap.get(e);return t?t.value:void 0}has(e){return this._keymap.has(e)}delete(e){var r=this._keymap.get(e);return r?(this._keymap.delete(r.key),r[t]&&r[n]?(r[n][t]=r[t],r[t][n]=r[n]):r[t]?(r[t][n]=void 0,this.oldest=r[t]):r[n]?(r[n][t]=void 0,this.newest=r[n]):this.oldest=this.newest=void 0,this.size--,r.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new o(this.oldest)}values(){return new s(this.oldest)}entries(){return this}[Symbol.iterator](){return new a(this.oldest)}forEach(e,n){typeof n!=`object`&&(n=this);let r=this.oldest;for(;r;)e.call(n,r.value,r.key,this),r=r[t]}toJSON(){for(var e=Array(this.size),n=0,r=this.oldest;r;)e[n++]={key:r.key,value:r.value},r=r[t];return e}toString(){for(var e=``,n=this.oldest;n;)e+=String(n.key)+`:`+n.value,n=n[t],n&&(e+=` < `);return e}}e.LRUMap=r;function i(e,r){this.key=e,this.value=r,this[t]=void 0,this[n]=void 0}function a(e){this.entry=e}a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:[e.key,e.value]}):{done:!0,value:void 0}};function o(e){this.entry=e}o.prototype[Symbol.iterator]=function(){return this},o.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:e.key}):{done:!0,value:void 0}};function s(e){this.entry=e}s.prototype[Symbol.iterator]=function(){return this},s.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:e.value}):{done:!0,value:void 0}}})}))(),1),Cx=Symbol(`IGNORE_RESPONSE`),wx=1e4,Tx=class extends Error{constructor(){super(`WorkerPoolManager: operation canceled because the pool terminated`)}},Ex=class extends Error{constructor(){super(`WorkerPoolManager: operation canceled before the task completed`)}},Dx=class{options;highlighter;preferredHighlighter;renderOptions;renderOptionsRequestVersion=0;renderOptionsVersion=0;initialized=!1;workers=[];queuedTasks=[];queuedTaskByInstance=new Map;taskByHighlightKey=new Map;activeTaskById=new Map;activeRequestByInstance=new Map;nextRequestId=0;themeSubscribers=new Set;workersFailed=!1;statSubscribers=new Set;fileCache;diffCache;_queuedBroadcast;lifecycleGeneration=0;constructor(e,{langs:t,theme:n=R,useTokenTransformer:r=!1,lineDiffType:i=`word-alt`,maxLineDiffLength:a=1e3,tokenizeMaxLineLength:o=1e3,preferredHighlighter:s=`shiki-js`}){this.options=e,this.preferredHighlighter=s,this.renderOptions={theme:n,useTokenTransformer:r,lineDiffType:i,maxLineDiffLength:a,tokenizeMaxLineLength:o},this.fileCache=new Sx.default.LRUMap(e.totalASTLRUCacheSize??100),this.diffCache=new Sx.default.LRUMap(e.totalASTLRUCacheSize??100),this.queueInitialization(t)}isWorkingPool(){return!this.workersFailed}getFileResultCache(e){return e.cacheKey==null?void 0:this.fileCache.get(e.cacheKey)}getDiffResultCache(e){return e.cacheKey==null?void 0:this.diffCache.get(e.cacheKey)}inspectCaches(){let{fileCache:e,diffCache:t}=this;return{fileCache:e,diffCache:t}}evictFileFromCache(e){try{return this.fileCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}evictDiffFromCache(e){try{return this.diffCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}async setRenderOptions({theme:e=this.renderOptions.theme??R,useTokenTransformer:t=this.renderOptions.useTokenTransformer??!1,lineDiffType:n=this.renderOptions.lineDiffType??`word-alt`,maxLineDiffLength:r=this.renderOptions.maxLineDiffLength??1e3,tokenizeMaxLineLength:i=this.renderOptions.tokenizeMaxLineLength??1e3}){let{lifecycleGeneration:a}=this,o=++this.renderOptionsRequestVersion,s=()=>this.isCurrentLifecycle(a)&&this.renderOptionsRequestVersion===o;try{let a={theme:e,useTokenTransformer:t,lineDiffType:n,maxLineDiffLength:r,tokenizeMaxLineLength:i};if(this.isInitialized()||await this.initialize(),!s()||ev(a,this.renderOptions))return;let o=$p(e),c=[];if(bn(a.theme,this.renderOptions.theme)||(c=tm(o)?ux(o):await dx(o)),!s())return;if(this.highlighter!=null)wp(c,this.highlighter);else{let e=await Xp({themes:o,langs:[`text`],preferredHighlighter:this.preferredHighlighter});if(!s())return;this.highlighter=e}let l=this.setRenderOptionsOnWorkers(a,c);this.renderOptions=a,this.renderOptionsVersion++,this.diffCache.clear(),this.fileCache.clear(),this.invalidateRenderTasks();for(let e of this.themeSubscribers)e.onThemeChange();await l}catch(e){if(e instanceof Tx||!s())return;throw e}}getPreferredHighlighter(){return this.preferredHighlighter}getFileRenderOptions(){let{tokenizeMaxLineLength:e,theme:t,useTokenTransformer:n}=this.renderOptions;return{theme:t,useTokenTransformer:n,tokenizeMaxLineLength:e}}getDiffRenderOptions(){return{...this.renderOptions}}async setRenderOptionsOnWorkers(e,t){if(this.workersFailed)return;this.isInitialized()||await this.initialize();let n=[];for(let r of this.workers){if(!r.initialized)throw console.log({managedWorker:r}),Error(`setRenderOptionsOnWorkers: Somehow we have an uninitialized worker`);n.push(new Promise((n,i)=>{let a=this.generateRequestId(),o={type:`set-render-options`,id:a,request:{type:`set-render-options`,id:a,renderOptions:e,resolvedThemes:t},resolve:n,reject:i,requestStart:Date.now()};this.activeTaskById.set(a,o),r.pendingSetupRequestId=a,r.worker.postMessage(o.request)}))}await Promise.all(n)}subscribeToThemeChanges(e){return this.themeSubscribers.add(e),this.queueBroadcastStateChanges(),()=>{this.unsubscribeToThemeChanges(e),this.queueBroadcastStateChanges()}}unsubscribeToThemeChanges(e){this.themeSubscribers.delete(e),this.queueBroadcastStateChanges()}subscribeToStatChanges(e){return this.statSubscribers.add(e),e(this.getStats()),()=>{this.statSubscribers.delete(e)}}queueBroadcastStateChanges(){this._queuedBroadcast??=requestAnimationFrame(this._broadcastStateChanges)}_broadcastStateChanges=()=>{this._queuedBroadcast!=null&&(cancelAnimationFrame(this._queuedBroadcast),this._queuedBroadcast=void 0);let e=this.getStats();for(let t of this.statSubscribers)t(e)};cleanUpTasks(e){this.detachInstanceFromQueuedTasks(e);let t=this.activeRequestByInstance.get(e);if(t!=null){let n=this.activeTaskById.get(t);Ax(n)?(this.detachInstanceFromRenderTask(n,e),!n.primeCache&&n.instances.size===0&&this.removeActiveTask(n)):this.activeTaskById.delete(t)}this.activeRequestByInstance.delete(e),this.queueBroadcastStateChanges()}isInitialized(){return this.initialized===!0}async initialize(e=[]){if(this.initialized!==!0){if(this.initialized===!1){let{lifecycleGeneration:t}=this;this.initialized=new Promise((n,r)=>{(async()=>{try{let r=$p(this.renderOptions.theme),i=[];if(i=tm(r)?ux(r):await dx(r),!this.isCurrentLifecycle(t)){n();return}let a=[];if(a=cx(e)?sx(e):await lx(e),!this.isCurrentLifecycle(t)){n();return}let[o]=await Promise.all([Xp({themes:r,langs:[`text`,...e],preferredHighlighter:this.preferredHighlighter}),this.initializeWorkers(i,a)]);if(!this.isCurrentLifecycle(t)){this.terminateWorkers(),n();return}this.highlighter=o,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),this.queueBroadcastStateChanges(),n()}catch(e){if(e instanceof Tx||!this.isCurrentLifecycle(t)){n();return}this.initialized=!1,this.workersFailed=!0,this.cancelActiveWorkerTasks(),this.terminateWorkers(),this.activeTaskById.clear();for(let t of this.queuedTasks)this.rejectRenderTaskCallbacks(t,Mx(e));this.queueBroadcastStateChanges(),r(e)}})()}),this.queueBroadcastStateChanges()}else return this.initialized}}async initializeWorkers(e,t){this.workersFailed=!1;let n=[],r=hm(),i=r>0?gm():void 0;this.workers.length>0&&this.terminateWorkers();for(let a=0;a<(this.options.poolSize??8);a++){let a=this.options.workerFactory(),o={worker:a,requestId:void 0,pendingSetupRequestId:void 0,initialized:!1,langs:new Set([`text`,...t.map(({name:e})=>e)]),customExtensionsVersion:0};a.addEventListener(`message`,e=>{this.handleWorkerMessage(o,e.data)}),a.addEventListener(`error`,e=>this.handleWorkerError(o,e)),this.workers.push(o),n.push(new Promise((n,a)=>{let s=this.generateRequestId(),c={type:`initialize`,id:s,request:{type:`initialize`,id:s,renderOptions:this.renderOptions,preferredHighlighter:this.preferredHighlighter,resolvedThemes:e,resolvedLanguages:t,customExtensionsVersion:i==null?void 0:r,customExtensionMap:i},resolve(){o.initialized=!0,n()},reject:a,requestStart:Date.now()};o.pendingSetupRequestId=s,this.activeTaskById.set(s,c),this.executeTask(o,c)}))}let a=this.options.workerInitializationTimeout??wx,o;try{await Promise.race([Promise.all(n),new Promise((e,t)=>{o=setTimeout(()=>{t(Error(`WorkerPoolManager: worker initialization timed out after ${a}ms`))},a)})])}finally{o!=null&&clearTimeout(o)}}handleWorkerError(e,t){console.error(`Worker error:`,t,e);let{pendingSetupRequestId:n}=e;if(n==null)return;let r=this.activeTaskById.get(n);r?.type===`initialize`&&(r.reject(Mx(t)),this.cleanWorkerAndTask(e,r))}drainQueue=()=>{if(this._queuedDrain=void 0,this.initialized===!0&&this.queuedTasks.length!==0){for(let e=0;e<this.queuedTasks.length;){let t=this.queuedTasks[e];if(this.hasActiveRequest(t)){e++;continue}let n=kx(t),r=this.getAvailableWorker(n);if(r==null)break;this.queuedTasks.splice(e,1),this.assignWorkerToTask(t,r),this.resolveLanguagesAndExecuteTask(r,t,n)}this.queueBroadcastStateChanges()}};highlightFileAST(e,t){let n=this.getFileResultCache(t);fh(t)||n!=null&&nm(n.options,this.getFileRenderOptions())||this.hasMatchingFileInstanceTask(e,t)||this.submitTask(e,{type:`file`,file:t})}primeFileHighlightCache(e){if(!this.isWorkingPool())return Promise.reject(Error(`WorkerPoolManager.primeFileHighlightCache: worker pool is not working`));let t=this.getOrCreateFileHighlightCacheTask(e);return t==null?Promise.resolve():this.createRenderTaskCallbacks(t)}getOrCreateFileHighlightCacheTask(e){if(e.cacheKey==null){console.warn(`WorkerPoolManager.primeFileHighlightCache: priming highlight cache requires file.cacheKey; skipping "${e.name}".`);return}let t=this.getFileResultCache(e),n=this.getFileHighlightKey(e);if(n==null||fh(e)||t!=null&&nm(t.options,this.getFileRenderOptions()))return;let r=this.getTaskByHighlightKey(n);if(r!=null)return r.primeCache=!0,r.type===`file`?r:void 0;{let t=this.submitCacheTask({type:`file`,file:e},n);return t.type===`file`?t:void 0}}getPlainFileAST(e,t,n,r){if(this.highlighter==null){this.queueInitialization();return}return nh(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,lines:r})}highlightDiffAST(e,t){let n=this.getDiffResultCache(t);Ey(t)||n!=null&&ev(n.options,this.getDiffRenderOptions())||this.hasMatchingDiffInstanceTask(e,t)||this.submitTask(e,{type:`diff`,diff:t})}primeDiffHighlightCache(e){if(!this.isWorkingPool())return Promise.reject(Error(`WorkerPoolManager.primeDiffHighlightCache: worker pool is not working`));let t=this.getOrCreateDiffHighlightCacheTask(e);return t==null?Promise.resolve():this.createRenderTaskCallbacks(t)}getOrCreateDiffHighlightCacheTask(e){if(e.cacheKey==null){console.warn(`WorkerPoolManager.primeDiffHighlightCache: priming highlight cache requires diff.cacheKey; skipping "${e.prevName??e.name}" -> "${e.name}".`);return}let t=this.getDiffResultCache(e),n=this.getDiffHighlightKey(e);if(n==null||Ey(e)||t!=null&&ev(t.options,this.getDiffRenderOptions()))return;let r=this.getTaskByHighlightKey(n);if(r!=null)return r.primeCache=!0,r.type===`diff`?r:void 0;{let t=this.submitCacheTask({type:`diff`,diff:e},n);return t.type===`diff`?t:void 0}}getPlainDiffAST(e,t,n,r,i){return this.highlighter==null?void 0:Av(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,expandedHunks:r,collapsedContextThreshold:i})}terminate(){this.lifecycleGeneration++,this.cancelActiveWorkerTasks(),this.terminateWorkers();let e=new Tx;for(let t of this.queuedTasks)this.rejectRenderTaskCallbacks(t,e);this.fileCache.clear(),this.diffCache.clear(),this.activeRequestByInstance.clear(),this.queuedTasks.length=0,this.queuedTaskByInstance.clear(),this.taskByHighlightKey.clear(),this.activeTaskById.clear(),this.highlighter=void 0,this.initialized=!1,this.workersFailed=!1,this.queueBroadcastStateChanges()}isCurrentLifecycle(e){return this.lifecycleGeneration===e}queueInitialization(e){this.initialize(e).catch(e=>{console.error(e)})}cancelActiveWorkerTasks(){let e=new Tx;for(let t of this.activeTaskById.values())`reject`in t?t.reject(e):Ax(t)&&this.rejectRenderTaskCallbacks(t,e)}terminateWorkers(){for(let e of this.workers)e.worker.terminate();this.workers.length=0}getStats(){return{managerState:this.initialized===!1?`waiting`:this.initialized===!0?`initialized`:`initializing`,totalWorkers:this.workers.length,workersFailed:this.workersFailed,busyWorkers:this.workers.filter(e=>e.requestId!=null||e.pendingSetupRequestId!=null).length,queuedTasks:this.queuedTasks.length,activeTasks:this.activeTaskById.size,themeSubscribers:this.themeSubscribers.size,fileCacheSize:this.fileCache.size,diffCacheSize:this.diffCache.size}}submitTask(e,t){this.initialized===!1&&this.queueInitialization();let n=this.getHighlightKeyForRequest(t),r=n==null?void 0:this.getTaskByHighlightKey(n);if(r!=null){this.detachInstanceFromQueuedTasks(e,r),this.addInstanceToTask(r,e),this.queueBroadcastStateChanges();return}this.detachInstanceFromQueuedTasks(e);let i=this.generateRequestId(),a=Date.now(),{renderOptionsVersion:o}=this,s=(()=>{switch(t.type){case`file`:return{type:`file`,id:i,request:{...t,id:i},instances:new Set([e]),primeCache:!1,highlightKey:n,callbacks:new Set,renderOptionsVersion:o,requestStart:a};case`diff`:return{type:`diff`,id:i,request:{...t,id:i},instances:new Set([e]),primeCache:!1,highlightKey:n,callbacks:new Set,renderOptionsVersion:o,requestStart:a}}})();this.enqueueRenderTask(s,e)}submitCacheTask(e,t){this.initialized===!1&&this.queueInitialization();let n=this.generateRequestId(),r=Date.now(),{renderOptionsVersion:i}=this,a=(()=>{switch(e.type){case`file`:return{type:`file`,id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,callbacks:new Set,renderOptionsVersion:i,requestStart:r};case`diff`:return{type:`diff`,id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,callbacks:new Set,renderOptionsVersion:i,requestStart:r}}})();return this.enqueueRenderTask(a),a}enqueueRenderTask(e,t){this.queuedTasks.push(e),t!=null&&this.queuedTaskByInstance.set(t,e),e.highlightKey!=null&&this.taskByHighlightKey.set(e.highlightKey,e),this.queueDrain()}async resolveLanguagesAndExecuteTask(e,t,n){try{let r=n.filter(t=>!e.langs.has(t));if(r.length>0&&(cx(r)?t.request.resolvedLanguages=sx(r):t.request.resolvedLanguages=await lx(r)),!this.activeTaskById.has(t.id)){e.requestId===t.id&&(this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain());return}this.executeTask(e,t)}catch(n){this.rejectRenderTaskCallbacks(t,Mx(n)),this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}}handleWorkerMessage(e,t){let n=this.activeTaskById.get(t.id);try{if(n==null)throw Cx;if(t.type===`error`){let e=Error(t.error);if(t.stack&&(e.stack=t.stack),`reject`in n)n.reject(e);else if(Ax(n))this.notifyHighlightError(n,e),this.rejectRenderTaskCallbacks(n,e);else throw Error(`handleWorkerMessage: unknown task type`);throw e}switch(t.requestType){case`initialize`:if(n.type!==`initialize`)throw Error(`handleWorkerMessage: task/response dont match`);this.syncCustomExtensionVersion(e,n.request),n.resolve();break;case`set-render-options`:if(n.type!==`set-render-options`)throw Error(`handleWorkerMessage: task/response dont match`);n.resolve();break;case`file`:{if(n.type!==`file`)throw Error(`handleWorkerMessage: task/response dont match`);let{result:r,options:i}=t;if(!this.isCurrentRenderTask(n)||!nm(i,this.getFileRenderOptions()))throw Cx;let{request:a}=n;this.syncCustomExtensionVersion(e,a),n.cacheKeyAtDispatch!=null&&this.fileCache.set(n.cacheKeyAtDispatch,{result:r,options:i}),this.resolveRenderTaskCallbacks(n),this.notifyFileInstances(n,r,i);break}case`diff`:{if(n.type!==`diff`)throw Error(`handleWorkerMessage: task/response dont match`);let{result:r,options:i}=t;if(!this.isCurrentRenderTask(n)||!ev(i,this.getDiffRenderOptions()))throw Cx;let{request:a}=n;this.syncCustomExtensionVersion(e,a),n.cacheKeyAtDispatch!=null&&this.diffCache.set(n.cacheKeyAtDispatch,{result:r,options:i}),this.resolveRenderTaskCallbacks(n),this.notifyDiffInstances(n,r,i);break}}}catch(e){e!==Cx&&console.error(e,n,t)}this.cleanWorkerAndTask(e,n,t.id),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}_queuedDrain;queueDrain(){this._queuedDrain??(this._queuedDrain=Promise.resolve().then(this.drainQueue),this.queueBroadcastStateChanges())}assignWorkerToTask(e,t){t.requestId=e.id,Ax(e)&&(this.clearQueuedInstanceRequests(e),this.trackInstanceRequests(e)),this.activeTaskById.set(e.id,e)}cleanWorkerAndTask(e,t,n=t?.id){e.requestId===n&&(e.requestId=void 0),e.pendingSetupRequestId===n&&(e.pendingSetupRequestId=void 0),t!=null&&(Ax(t)&&(this.rejectRenderTaskCallbacks(t,new Ex),this.clearInstanceRequests(t),this.clearHighlightKey(t)),this.activeTaskById.delete(t.id))}executeTask(e,t){Ox(t.request)&&this.maybeAttachCustomExtensions(e,t.request),this.activeTaskById.has(t.id)||this.assignWorkerToTask(t,e);for(let n of kx(t))e.langs.add(n);try{t.type===`file`?t.cacheKeyAtDispatch=t.request.file.cacheKey:t.type===`diff`&&(t.cacheKeyAtDispatch=t.request.diff.cacheKey),e.worker.postMessage(t.request)}catch(n){console.error(`Failed to post message to worker:`,n),Ax(t)?(this.notifyHighlightError(t,n),this.rejectRenderTaskCallbacks(t,Mx(n))):`reject`in t&&t.reject(n),this.cleanWorkerAndTask(e,t),this.queuedTasks.length>0&&this.queueDrain()}this.queueBroadcastStateChanges()}maybeAttachCustomExtensions(e,t){if(t.customExtensionsVersion!=null)return;let n=hm();e.customExtensionsVersion>=n||(t.customExtensionsVersion=n,t.customExtensionMap=gm())}syncCustomExtensionVersion(e,t){t.customExtensionsVersion!=null&&(e.customExtensionsVersion=t.customExtensionsVersion)}getAvailableWorker(e){let t;for(let n of this.workers){if(n.requestId!=null||n.pendingSetupRequestId!=null||!n.initialized)continue;if(t=n,e.length===0)break;let r=!0;for(let t of e)if(!n.langs.has(t)){r=!1;break}if(r)break}return t}getFileHighlightKey(e){if(e.cacheKey!=null)return`file:${e.cacheKey}:${this.renderOptionsVersion}`}getDiffHighlightKey(e){if(e.cacheKey!=null)return`diff:${e.cacheKey}:${this.renderOptionsVersion}`}getHighlightKeyForRequest(e){switch(e.type){case`file`:return this.getFileHighlightKey(e.file);case`diff`:return this.getDiffHighlightKey(e.diff)}}hasActiveRequest(e){for(let t of jx(e))if(this.activeRequestByInstance.has(t))return!0;return!1}addInstanceToTask(e,t){e.type,e.instances.add(t),this.activeTaskById.has(e.id)?this.activeRequestByInstance.set(t,e.id):this.queuedTaskByInstance.set(t,e)}detachInstanceFromQueuedTasks(e,t){let n=this.queuedTaskByInstance.get(e);n!=null&&n!==t&&(this.queuedTaskByInstance.delete(e),this.detachInstanceFromRenderTask(n,e),!n.primeCache&&n.instances.size===0&&this.removeQueuedTask(n))}detachInstanceFromRenderTask(e,t){e.type,e.instances.delete(t)}removeQueuedTask(e){let t=this.queuedTasks.indexOf(e);t!==-1&&this.queuedTasks.splice(t,1),this.rejectRenderTaskCallbacks(e,new Ex),this.clearQueuedInstanceRequests(e),this.clearHighlightKey(e)}removeActiveTask(e){this.rejectRenderTaskCallbacks(e,new Ex),this.clearInstanceRequests(e),this.clearHighlightKey(e),this.activeTaskById.delete(e.id)}createRenderTaskCallbacks(e){return new Promise((t,n)=>{e.callbacks.add({resolve:t,reject:n})})}resolveRenderTaskCallbacks(e){for(let t of e.callbacks)t.resolve();e.callbacks.clear()}rejectRenderTaskCallbacks(e,t){for(let n of e.callbacks)n.reject(t);e.callbacks.clear()}invalidateRenderTasks(){for(let e=this.queuedTasks.length-1;e>=0;e--){let t=this.queuedTasks[e];t.renderOptionsVersion!==this.renderOptionsVersion&&this.removeQueuedTask(t)}for(let e of Array.from(this.activeTaskById.values()))Ax(e)&&e.renderOptionsVersion!==this.renderOptionsVersion&&this.removeActiveTask(e)}clearQueuedInstanceRequests(e){for(let t of jx(e))this.queuedTaskByInstance.get(t)===e&&this.queuedTaskByInstance.delete(t)}clearHighlightKey(e){e.highlightKey!=null&&this.taskByHighlightKey.get(e.highlightKey)===e&&this.taskByHighlightKey.delete(e.highlightKey)}trackInstanceRequests(e){for(let t of jx(e))this.activeRequestByInstance.set(t,e.id)}clearInstanceRequests(e){for(let t of jx(e))this.activeRequestByInstance.get(t)===e.id&&this.activeRequestByInstance.delete(t)}notifyFileInstances(e,t,n){for(let r of e.instances)this.activeRequestByInstance.get(r)===e.id&&r.onHighlightSuccess(e.request.file,t,n)}notifyDiffInstances(e,t,n){for(let r of e.instances)this.activeRequestByInstance.get(r)===e.id&&r.onHighlightSuccess(e.request.diff,t,n)}notifyHighlightError(e,t){for(let n of jx(e))this.activeRequestByInstance.get(n)===e.id&&n.onHighlightError(t)}hasMatchingFileInstanceTask(e,t){for(let n of this.iterateRenderTasks())if(n.type===`file`&&this.isCurrentRenderTask(n)&&n.instances.has(e)&&gg(t,n.request.file))return!0;return!1}hasMatchingDiffInstanceTask(e,t){for(let n of this.iterateRenderTasks())if(n.type===`diff`&&this.isCurrentRenderTask(n)&&n.instances.has(e)&&hg(n.request.diff,t))return!0;return!1}getTaskByHighlightKey(e){let t=this.taskByHighlightKey.get(e);return t!=null&&this.isCurrentRenderTask(t)?t:void 0}isCurrentRenderTask(e){return e.renderOptionsVersion===this.renderOptionsVersion}*iterateRenderTasks(){for(let e of this.queuedTasks)yield e;for(let e of this.activeTaskById.values())Ax(e)&&(yield e)}generateRequestId(){return`req_${++this.nextRequestId}`}};function Ox(e){return e.type===`initialize`||e.type===`file`||e.type===`diff`}function kx(e){let t=new Set;if(e.type===`initialize`||e.type===`set-render-options`)return[];switch(e.type){case`file`:t.add(e.request.file.lang??mm(e.request.file.name));break;case`diff`:t.add(e.request.diff.lang??mm(e.request.diff.name)),t.add(e.request.diff.lang??mm(e.request.diff.prevName??`-`))}return t.delete(`text`),Array.from(t)}function Ax(e){return e?.type===`file`||e?.type===`diff`}function jx(e){return e.instances}function Mx(e){if(e instanceof Error)return e;if(typeof e==`object`&&e){if(`error`in e&&e.error instanceof Error)return e.error;if(`message`in e&&typeof e.message==`string`)return Error(e.message)}return Error(String(e))}var Nx;function Px({poolOptions:e,highlighterOptions:t}){return Nx??=new Dx(e,t),Nx}var Fx=`/assets/worker-C0KwUb8K.js`,Ix;function Lx(){return Ix??=Px({poolOptions:{workerFactory:()=>new Worker(Fx,{type:`module`}),poolSize:Math.min(2,navigator.hardwareConcurrency||2)},highlighterOptions:{theme:{dark:`pierre-dark`,light:`pierre-light`}}})}function Rx(e){let t=[],n=[];for(let r of e.trim().split(/\s+/).filter(Boolean)){let e=r.startsWith(`!`),i=e?r.slice(1):r;i&&(e?n:t).push(zx(i))}return e=>!n.some(t=>t(e))&&t.every(t=>t(e))}function zx(e){if(!/[*?]/.test(e))return t=>tt(e,t);let t=``;for(let n=0;n<e.length;n++){let r=e[n];r===`*`?e[n+1]===`*`?(t+=`.*`,n++):t+=`[^/]*`:t+=r===`?`?`[^/]`:r.replace(/[.+^${}()|[\]\\]/,`\\$&`)}try{let e=new RegExp(t,`i`);return t=>e.test(t)}catch{return t=>tt(e,t)}}function Bx(e,t){let n=null,r=()=>{if(!n||t.aborted)return;let i=e().closest(`[data-diff-main]`);if(i){let t=i.getBoundingClientRect(),r=0;if(n.y>=t.bottom-110?r=Math.max(4,Math.min(20,(n.y-(t.bottom-110))/3)):n.y<=t.top+110&&(r=-Math.max(4,Math.min(20,(t.top+110-n.y)/3))),r){i.scrollTop+=r;let a=e().getBoundingClientRect(),o=Math.max(t.top+12,a.top+48),s=Math.min(t.bottom-12,a.bottom-48),c=Math.max(o,Math.min(n.y,s));document.dispatchEvent(new PointerEvent(`pointermove`,{clientX:n.x,clientY:c,pointerId:n.pointerId,pointerType:`touch`,bubbles:!0,composed:!0}))}}requestAnimationFrame(r)};e().addEventListener(`pointerdown`,e=>{e.pointerType!==`mouse`&&e.composedPath().some(e=>e instanceof HTMLElement&&e.hasAttribute?.(`data-column-number`))&&(n={pointerId:e.pointerId,x:e.clientX,y:e.clientY},requestAnimationFrame(r))},{capture:!0,signal:t}),document.addEventListener(`pointermove`,e=>{n&&e.pointerId===n.pointerId&&e.isTrusted&&(n.x=e.clientX,n.y=e.clientY)},{capture:!0,passive:!0,signal:t});for(let e of[`pointerup`,`pointercancel`])document.addEventListener(e,e=>{n&&e.pointerId===n.pointerId&&(n=null)},{capture:!0,signal:t})}var Vx={apng:`image/apng`,avif:`image/avif`,bmp:`image/bmp`,gif:`image/gif`,ico:`image/x-icon`,jpeg:`image/jpeg`,jpg:`image/jpeg`,png:`image/png`,svg:`image/svg+xml`,webp:`image/webp`,pdf:`application/pdf`};function Hx(e){let t=e.lastIndexOf(`.`),n=Vx[t<0?``:e.slice(t+1).toLowerCase()];return n?{kind:n===`application/pdf`?`pdf`:`image`,type:n}:null}function Ux(e){if(e.length<=1)return null;let t=document.createElement(`select`);t.setAttribute(`aria-label`,`Send to session`),t.className=`_iY`;for(let n of e){let e=document.createElement(`option`);e.value=n.id,e.textContent=n.title||n.agent,t.append(e)}return t}var Wx=(e,t)=>e?.value||t[0]?.id||null;function Gx(e,t,n){for(let r of e)r.disabled=t,n&&r.dataset.role===`send`&&(r.textContent=t?`Sending…`:n)}function Kx(e,t){let n=document.createElement(`button`);return n.type=`button`,n.textContent=e,n.className=t,n}function qx(e,t,n,r){if(!t){e.className=`_q ${r?be:``} _r`,e.textContent=`Send`;let t=n[0];return t&&(e.title=`Send to ${t.title||t.agent}`),e}let i=document.createElement(`span`);return i.className=`_iW ${r?`_ij`:``}`,e.className=`_r _iX`,e.textContent=`Send to`,i.append(e,t),i}function Jx(e,t,n){e.onkeydown=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),t()),e.key===`Escape`&&(e.preventDefault(),n())}}function Yx(e,t,n){let r=document.createElement(`div`);r.className=`_if`;let i=document.createElement(`div`),a=document.createElement(`div`);a.className=`_ii`;let o=()=>{i.replaceChildren(),a.replaceChildren();let r=document.createElement(`p`);r.className=`_ig`,r.textContent=e.text;let o=Kx(`Remove`,`_q ${be}`);o.onclick=()=>n.onDelete(e.id);let c=Kx(`Edit`,`_q ${be}`);c.hidden=!n.onEdit,c.onclick=()=>s();let l=t.sessions(),u=l.length>0&&!!n.onSend,d=Kx(`Send`,``);d.dataset.role=`send`,d.hidden=!u;let f=u?Ux(l):null,p=f?`Send to`:`Send`;if(d.onclick=()=>{(async()=>{let t=Wx(f,l);if(!(!t||d.disabled)){Gx([o,c,d],!0,p);try{await n.onSend?.(e.id,t)}finally{Gx([o,c,d],!1,p)}}})()},a.append(c,o),u&&a.append(qx(d,f,l,!0)),n.drifted){let e=document.createElement(`span`);e.className=`_N ${pe.warn} _ik`,e.textContent=`changed since`,e.title=`The file changed here after this comment was written; the agent gets the lines as they were.`,a.append(e)}i.append(r)},s=()=>{i.replaceChildren(),a.replaceChildren();let t=document.createElement(`textarea`);t.value=e.text,t.rows=3,t.className=`_Y _ih`;let r=Kx(`Save`,`_q _r`),s=Kx(`Cancel`,`_q`),c=()=>{let i=t.value.trim();if(!i||i===e.text){o();return}(async()=>{Gx([r,s],!0);try{await n.onEdit?.(e.id,i),e.text=i,o()}catch{Gx([r,s],!1)}})()};r.onclick=c,s.onclick=()=>o(),Jx(t,c,o),a.append(r,s),i.append(t),setTimeout(()=>{t.focus({preventScroll:!0}),t.setSelectionRange(t.value.length,t.value.length)},0)};return o(),r.append(i,a),r}function Xx(e,t){let n=document.createElement(`div`);n.className=`_if`;let r=document.createElement(`textarea`);r.placeholder=`Add a comment…`,r.rows=3,r.className=`_Y _ih`;let i=Kx(`Add`,`_q`),a=Kx(`Send`,``);a.dataset.role=`send`;let o=Kx(`Cancel`,`_q`),s=e.sessions(),c=s.length>0&&!!t.onSend;a.hidden=!c;let l=c?Ux(s):null,u=c?qx(a,l,s,!1):a,d=a.textContent,f=()=>{r.value.trim()&&t.onSave(r.value)},p=()=>{(async()=>{let e=r.value.trim(),n=Wx(l,s);if(!(!e||!n||a.disabled)){Gx([i,a,o],!0,d);try{await t.onSend?.(e,n)}finally{Gx([i,a,o],!1,d)}}})()};i.onclick=f,a.onclick=p,o.onclick=()=>t.onCancel(),Jx(r,c?p:f,()=>t.onCancel());let m=document.createElement(`div`);m.className=`_ii`,m.append(i),c&&m.append(u),m.append(o),n.append(r,m),r.addEventListener(`focus`,()=>{let t=window.visualViewport;if(!t)return;let i=()=>e.reveal(n,!0);t.addEventListener(`resize`,i),r.addEventListener(`blur`,()=>t.removeEventListener(`resize`,i),{once:!0})});let h=(e=0)=>{if(!r.isConnected||!r.getClientRects().length){e<120&&requestAnimationFrame(()=>h(e+1));return}r.focus({preventScroll:!0})};return setTimeout(h,0),n}function Zx(e,t){let n=document.createElement(e);return t&&(n.className=t),n}function Qx(e,t,n){let r=Zx(`div`,`_ie`),i=Zx(`span`,`_W`);i.textContent=n;let a=Zx(`a`,`_K`);return a.href=e,a.target=`_blank`,a.rel=`noreferrer`,a.textContent=`Open in a new tab`,r.append(i,a),r}function $x(e,t,n){let r=Zx(`div`,`_ib`),i=Zx(`span`,`_W`);i.textContent=n;let a=Zx(`img`,`_ic`);return a.alt=`${n}: ${t}`,a.loading=`lazy`,a.decoding=`async`,a.onload=()=>{i.textContent=`${n} · ${a.naturalWidth} × ${a.naturalHeight}`},a.onerror=()=>{r.replaceChildren(Qx(e,t,`This browser can't display this image.`))},a.src=e,r.append(a),{frame:r,meta:i}}function eS(e,t,n){let r=Zx(`span`,`_W`);if(r.textContent=n,!navigator.pdfViewerEnabled){let n=Zx(`div`,`_ib`);return n.append(Qx(e,t,`This browser can't display PDFs inline.`)),{frame:n,meta:r}}let i=Zx(`iframe`,`_id`);return i.src=e,i.title=`${n}: ${t}`,i.loading=`lazy`,{frame:i,meta:r}}function tS(e){let t=Zx(`div`,`_h_`);for(let n of e.sides){let r=Zx(`div`,`_ia`),{frame:i,meta:a}=e.kind===`pdf`?eS(n.src,e.name,n.label):$x(n.src,e.name,n.label);r.append(a,i),t.append(r)}return t}function nS(e,t){let n=new Map;for(let t of e)n.set(t.worktree,[...n.get(t.worktree)||[],t]);let r=[`Review feedback:`],i=0;for(let[e,a]of n){let n=(t||[]).find(t=>t.worktree===e);r.push(``),r.push(iS(e,n,a));for(let e of a){i++;let t=e.line_end===0?`whole file`:rS(e);r.push(``),r.push(`${i}. **${e.path}** (${t})`);let n=e.snippet;if(n!=null){let e=oS(n);r.push(``),r.push(sS(`${e}diff\n${n}\n${e}`))}r.push(``),r.push(sS(e.text))}}return r.join(`
|
|
1530
|
+
`)}function rS(e){let t=e.side===`deletions`?`Old`:`New`;return e.line_start===e.line_end?`${t} line ${e.line_start}`:`${t} lines ${e.line_start}-${e.line_end}`}function iS(e,t,n){if(t?.head){let n=aS(t.head),r=t.baseSha?aS(t.baseSha):``,i=t.pr?.headRefName||t.branch||`HEAD`;return`${e}/${t.pr?` #${t.pr.number}`:``}: \`${i}\` ${n}${t.base?` vs \`${t.base}\` ${r}`:``}`}let r=[...new Set(n.map(e=>e.head).filter(Boolean))];return r.length?`${e}/: ${r.map(e=>aS(e)).join(`, `)}`:`${e}/`}function aS(e,t=12){return e.slice(0,t)}function oS(e){let t=3,n=/`+/g,r;for(;r=n.exec(e);)t=Math.max(t,r[0].length+1);return"`".repeat(t)}function sS(e){return e.split(`
|
|
1531
1531
|
`).map(e=>e&&` ${e}`).join(`
|
|
1532
|
-
`)}function eS(e){let t=e.replace(/^origin\//,``);return tS(t.includes(`/`)?t.slice(t.lastIndexOf(`/`)+1):t)}function tS(e){return e.replace(/-[a-z0-9]{1,6}$/i,``)||e}function nS(e,t){if(!t)return``;let n=e.replace(/^origin\//,``),r=t.replace(/^origin\//,``);return n.startsWith(`${r}-`)?n.slice(r.length+1):``}function rS(e){let t=tS(e);if(t.length<=20)return t;let n=t.split(`-`);return n.length>1?n[n.length-1]:t}function iS(e,t,n=``,r=``){let i=(e||`base`).replace(/^origin\//,``),a=(t||`HEAD`).replace(/^origin\//,``),o=(n||``).replace(/^origin\//,``),s=!!o&&(a===o||a.startsWith(`${o}-`));return{base:i,head:s?r||eS(o):rS(a),topic:s?nS(a,o):``,title:a===i?i:`${a} vs ${i}`}}function aS(e,t=``,n=``){let r=e.replace(/^origin\//,``);if(!r||r===`HEAD`)return r||`HEAD`;let i=t.replace(/^origin\//,``);if(i&&(r===i||r.startsWith(`${i}-`))){let e=n||eS(i),t=nS(r,i);return t?`${e} [${t}]`:e}return rS(r)}var oS=`search-mark`,sS=`mark.${oS}`,cS=`mark.${oS}{display:inline;background:#ffd24a;color:#1a1408;-webkit-text-fill-color:#1a1408;border-radius:3px;padding:0 2px}mark.${oS} *,mark.${oS} *::before,mark.${oS} *::after{color:inherit!important;-webkit-text-fill-color:inherit!important;background:transparent!important}mark.${oS}.active{background:#ffb000;box-shadow:0 0 0 1px #c98400}`,lS={query:``,hit:null,keys:null},uS=new Map,dS=new WeakMap,fS=(e,t)=>t?`${e}\n${t.line}\n${t.side||``}`:e;function pS(e,t,n){lS.query=e,lS.hit=t,lS.keys=n?new Set(n):null;for(let[e,t]of uS)vS(e,t,!1);t&&mS(t)}function mS(e,t=0){requestAnimationFrame(()=>{requestAnimationFrame(()=>{let n=!1;for(let[r,i]of uS)if(i===e.key&&(n=!0,_S(r,e)||t>=40))return;t>=40||(!n||t<12)&&setTimeout(()=>mS(e,t+1),n?32:48)})})}function hS(e,t,n){let r=e.getBoundingClientRect(),i=t.getBoundingClientRect();if(i.height===0&&i.width===0)return!1;if(n===`y`){let t=i.top-r.top+e.scrollTop-(r.height/2-i.height/2);return e.scrollTo({top:Math.max(0,t)}),!0}if(e.scrollWidth<=e.clientWidth+1)return!0;let a=Math.min(24,r.width/8);if(i.left>=r.left+a&&i.right<=r.right-a)return!0;let o=i.left-r.left+e.scrollLeft-(r.width/2-i.width/2),s=Math.max(0,e.scrollWidth-e.clientWidth);return e.scrollTo({left:Math.max(0,Math.min(o,s))}),!0}function gS(e,t){let n=t.parentElement,r=e;for(;r&&r!==n;){if(r instanceof HTMLElement&&r.scrollWidth>r.clientWidth+1){let e=getComputedStyle(r).overflowX;if(e===`auto`||e===`scroll`)return r}let e=r.getRootNode(),t=r.parentElement??(e instanceof ShadowRoot?e.host:null);if(t===r)break;r=t}return null}function _S(e,t){let n=e.querySelector(`diffs-container`)?.shadowRoot;if(!n)return!1;let r=n.querySelector(`mark.search-mark.active`)??(()=>{if(t.line<1)return null;let e=[...n.querySelectorAll(`[data-line="${t.line}"]`)],r=t.side||`additions`;return e.find(e=>SS(e)===r)??e[0]??null})();if(!r)return!1;let i=e.closest(`[data-diff-main]`);if(i){if(!hS(i,r,`y`))return!1}else r.scrollIntoView({block:`center`,inline:`nearest`});let a=gS(r,e);return a&&hS(a,r,`x`),!0}function vS(e,t,n=!0){let r=t&&lS.hit?.key===t?lS.hit:null,i=lS.query.trim(),a=!!i&&!!lS.keys&&!!t&&!lS.keys.has(t),o=a?``:fS(i,r);!n&&dS.get(e)===o||(dS.set(e,o),DS(e,a?``:i,r),r&&mS(r))}function yS(e,t){return uS.set(e,t),vS(e,t),()=>{uS.delete(e),dS.delete(e)}}function bS(e){vS(e,uS.get(e))}function xS(e){let t=e.querySelectorAll(sS);if(!t.length)return;let n=new Set;for(let e of[...t])e.parentElement&&n.add(e.parentElement),e.replaceWith(...e.childNodes);for(let e of n)e.normalize()}function SS(e){let t=e.closest(`[data-code]`);return t?.hasAttribute(`data-deletions`)?`deletions`:t?.hasAttribute(`data-additions`)?`additions`:(e.getAttribute(`data-line-type`)||``).includes(`deletion`)?`deletions`:`additions`}function CS(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=[];for(let e=t.nextNode();e;e=t.nextNode())e.parentElement?.closest(sS)||n.push(e);return n}function wS(e,t,n){let r=0;for(let i=0;i<e.length;i++){let a=t[i].length;if(n<=r+a)return{node:e[i],offset:Math.min(a,Math.max(0,n-r))};r+=a}let i=e.at(-1);return i?{node:i,offset:t.at(-1)?.length??0}:null}function TS(e,t,n,r,i){let a=wS(e,t,n),o=wS(e,t,r);if(!a||!o)return;let s=document.createRange();s.setStart(a.node,a.offset),s.setEnd(o.node,o.offset);let c=document.createElement(`mark`);c.className=i;try{c.append(s.extractContents()),s.insertNode(c)}catch{}}function ES(e,t,n,r){let i=CS(e);if(!i.length)return;let a=i.map(e=>e.textContent??``),o=a.join(``),s=n?o:o.toLowerCase(),c=[];for(let e=s.indexOf(t);e!==-1;e=s.indexOf(t,e+t.length))c.push([e,e+t.length]);if(!c.length)return;let l=SS(e),u=Number(e.getAttribute(`data-line`)),d=r&&r.line===u&&(r.side||`additions`)===l?`${oS} active`:oS;for(let e=c.length-1;e>=0;e--)TS(i,a,c[e][0],c[e][1],d)}function DS(e,t,n){let r=[e],i=e.shadowRoot??e.querySelector(`diffs-container`)?.shadowRoot;i&&r.push(i);let a=t.trim(),o=/[A-Z]/.test(a),s=a&&!o?a.toLowerCase():a;for(let e of r)if(xS(e),s)for(let t of e.querySelectorAll(`[data-code] [data-line]`)){let e=t.textContent||``;(o?e:e.toLowerCase()).includes(s)&&ES(t,s,o,n)}}var OS=`_go _4 _l`,kS=`_gu _ej`,AS=st,jS=(e=>`/${e}&`)(ne);function MS(e){ce(e.a,`M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 13.8214 2.48697 15.5291 3.33782 17L2.5 21.5L7 20.6622C8.47087 21.513 10.1786 22 12 22Z`)}var NS=(e,t)=>Te(e.a,t),PS=(e,t)=>ue(e.a,t),FS=(e=>`<div role=group><span>${e}<span aria-hidden=true> </span></span><button type=button aria-label="Copy comments as markdown"></button><!></div>`)(AS),IS=(e=>` D D/${e}& D m b%l`)(jS),LS=(e,t)=>T(e.a,`value`,t),RS=h(7,e=>c(e.b,e.f||e.g)),zS=M(5,RS),BS=M(6,RS),VS=(e,t)=>{LS(e,t[0]?.id),zS(e,t[0]?.title),BS(e,t[0]?.agent)},HS=e=>{He(e.a),It(e.a,14),kt(e.a)},US=e=>{Fe(e.a),re(e.a,14),Rt(e.a)},WS=j(26,e=>{T(e.b,`disabled`,e._._.o),T(e.c,`disabled`,e._._.o)},e=>e._._),GS=_(`k2`,e=>{u(e.b,`click`,function(){let t=e.c;typeof t.showPicker==`function`?t.showPicker():t.focus()}),C(e,`c`)}),KS=e=>{WS(e),JS(e),YS(e),b(e.a,`_iu`),b(e.b,[`_ip`,`_iq`,`_iv`]),b(e.c,`_iw`),GS(e)},qS=a(2,`<option> </option>`,` D `,0,VS),JS=j(27,e=>qS(e,[e._._.q,`id`]),e=>e._._),YS=j(29,e=>A(e,`c`,e._._.v,LC(e)),e=>e._._),XS=j(26,e=>c(e.a,e._._.o?`Sending…`:`Send`),e=>e._._),ZS=XS,QS=h(4,e=>c(e.b,e._._.o?`Sending…`:`Send to ${e._._.w||e._._.x}`),2),$S=j(26,e=>{c(e.d,e._._.o?`Sending…`:`Send`),QS(e)},e=>e._._),eC=e=>{$S(e),tC(e),nC(e),b(e.a,[`_it`,`_is`]),b(e.c,`_ir`)},tC=j(30,QS,e=>e._._),nC=j(31,QS,e=>e._._),rC=f(6,0,e=>T(e.a,`disabled`,e._.o)),iC=_(`k3`,e=>u(e.a,`click`,function(){e._.z()})),aC=e=>{rC._(e),cC._(e),uC._(e),dC._(e),b(e.a,[`_ip`,`_iq`]),iC(e)},oC=d(0,`<span> </span><span> </span>`,` D l D `,eC,` `,` `,ZS),sC=d(1,`<span><button type=button aria-label="Choose session to send to"></button><select aria-label="Send comments to session" tabindex=-1></select></span>`,` D b `,KS),cC=f(6,0,e=>{oC(e,e._.s>1?0:1),sC(e,e._.s>1?0:1)}),lC=h(2,e=>T(e.a,`title`,`Send comments to ${e._.w||e._.x}`)),uC=f(6,0,lC),dC=f(6,0,lC),fC=d(5,me,(e=>`/${e}&`)(Pe),US,Pt,(e=>`/${e}&`)(ke),HS),pC=m(13,e=>{T(e.f,`title`,e.n?`Copied`:`Copy comments as markdown`),fC(e,+!e.n)}),mC=M(25),hC=h(20,e=>mC(e,RC(e)),2),gC=y($S,XS,WS),_C=m(14,e=>{hC(e),rC(e),gC(e)}),vC=d(6,`<button type=button></button><!><!>`,` b%`,aC),yC=M(19,e=>{OC(e,e.t?.id),AC(e,e.t?.title),MC(e,e.t?.agent),vC(e,+!e.t),hC(e)}),bC=h(17,e=>yC(e,e.q.find(t=>t.id===e.p)??e.q[0]??null)),xC=m(15,bC),SC=_(`k4`,e=>u(e.f,`click`,function(){(async()=>{await e.m()&&(pC(e,!0),setTimeout(()=>{pC(e,!1)},1500))})()}));function CC(e){b(e.a,`_il`),b(e.b,`_im`),MS(e.c),NS(e.c,18),PS(e.c,`_in`),b(e.d,`_io`),b(e.f,`_ip`),pC(e,!1),_C(e,!1),xC(e,null),SC(e)}var wC=y(JS),TC=M(16,e=>{EC(e,e.q.length),bC(e),wC(e)}),EC=M(18,cC),DC=(e,t)=>TC(e,t||[]),OC=M(21,y(YS)),kC=y(tC),AC=M(22,e=>{uC(e),kC(e)}),jC=y(nC),MC=M(23,e=>{dC(e),jC(e)}),NC=(e,t)=>{T(e.a,`aria-label`,t),T(e.b,`title`,t)},PC=(e,t)=>{c(e.e,t>99?`99+`:t),NC(e,`${t} comment${t===1?``:`s`}`)},FC=M(11,hC),IC=M(12),LC=e=>function(t){xC(e._._,t)},RC=e=>()=>{(async()=>{if(!(!e.t||e.o)){_C(e,!0);try{await e.l(e.t?.id)}finally{_C(e,!1)}}})()};N(`k0`,LC),N(`k1`,RC);var zC=st,BC=(e=>`/${e}&`)(ne);function VC(e){ce(e.a,`M2 11V4.6C2 4.26863 2.26863 4 2.6 4H8.77805C8.92127 4 9.05977 4.05124 9.16852 4.14445L12.3315 6.85555C12.4402 6.94876 12.5787 7 12.722 7H21.4C21.7314 7 22 7.26863 22 7.6V11M2 11V19.4C2 19.7314 2.26863 20 2.6 20H21.4C21.7314 20 22 19.7314 22 19.4V11M2 11H22`)}var HC=(e,t)=>Te(e.a,t),UC=(e,t)=>ue(e.a,t),WC=40,GC;function KC(e){return e.length>=200?null:[...new Set(e.map(e=>e.key))]}function qC(e,t){let n=t.trim();if(!n)return[];if(GC&&GC.files===e&&GC.query===n)return GC.hits;let r=XC(e,n);return GC={files:e,query:n,hits:r},r}var JC=new WeakMap;function YC(e){let t=JC.get(e);if(!t){let n={additions:new Set,deletions:new Set};if(e.fileDiff){let n=vx(e.fileDiff,`additions`),r=vx(e.fileDiff,`deletions`),i=e=>{let t=[];for(let[n,r]of e)t[n-1]=r;return t};t={visible:{additions:new Set(n.keys()),deletions:new Set(r.keys())},newLines:i(n),oldLines:i(r)}}else t={visible:n,newLines:null,oldLines:null};JC.set(e,t)}return t}function XC(e,t){let n=/[A-Z]/.test(t),r=n?t:t.toLowerCase(),i=!/[^\x00-\x7f]/.test(r),a=[];for(let t of e){if(a.length>=200)break;let e=a.length;if(i&&!(n?t.patch??``:(t.patch??``).toLowerCase()).includes(r)){ZC(t.path,r,n)&&a.push({key:t.key,path:t.path,repo:t.repo,line:0,side:null,preview:t.path});continue}let{visible:o,newLines:s,oldLines:c}=YC(t),l=new Set;QC(t,s,`additions`,r,n,l,a,o.additions),QC(t,c,`deletions`,r,n,l,a,o.deletions),a.length===e&&ZC(t.path,r,n)&&a.push({key:t.key,path:t.path,repo:t.repo,line:0,side:null,preview:t.path})}return a}function ZC(e,t,n){let r=n?e:e.toLowerCase();if(!r.includes(t))return!1;let i=e.lastIndexOf(`/`),a=i>=0?e.slice(i+1):e,o=a.lastIndexOf(`.`);if(o<=0)return!0;let s=a.slice(o+1);if(!(n?s:s.toLowerCase()).includes(t))return!0;let c=e.length-s.length;for(let e=r.indexOf(t);e!==-1;e=r.indexOf(t,e+1))if(e<c)return!0;return!1}function QC(e,t,n,r,i,a,o,s){if(!t||o.length>=200||!s.size)return;let c=0;for(let l=0;l<t.length;l++){if(o.length>=200||c>=WC)return;let u=l+1;if(!s.has(u))continue;let d=t[l];if(d==null)continue;let f=(i?d:d.toLowerCase()).indexOf(r);f<0||n===`deletions`&&a.has(d)||(n===`additions`&&a.add(d),c++,o.push({key:e.key,path:e.path,repo:e.repo,line:u,side:n,preview:$C(d,f,r.length)}))}}function $C(e,t,n){let r=Math.max(0,t-36),i=Math.min(e.length,t+n+36);return(r>0?`…`:``)+e.slice(r,i)+(i<e.length?`…`:``)}var ew=((e,t,n,r)=>`<div><span aria-hidden=true>${e}</span><input type=search enterkeyhint=search autocomplete=off placeholder="Find in review" aria-label="Find in review"><span> </span><button type=button title="Previous match">${t}</button><button type=button title="Next match">${n}</button><button type=button title="Close find">${r}</button></div>`)(ht,xe,rt,Nt),tw=((e,t,n,r)=>` D D/${e}&l b D l D/${t}&l D/${n}&l D/${r}&m`)(ge,Se,Ve,Ne),nw=_(`j8`,e=>e.ah=!!e.a1),rw=h(44,nw),iw=_(`j7`,e=>l(e,{onMount:function(){let t=new AbortController;return document.addEventListener(`keydown`,t=>{if(!e.ah)return;if(t.key===`Escape`){if(document.querySelector(`dialog[open]`)||t.target instanceof HTMLTextAreaElement)return;if(e.y){(e.a4||``).trim()&&(t.preventDefault(),e.as(``));return}t.preventDefault(),e.av();return}let n=t.metaKey||t.ctrlKey;(t.key===`F3`||n&&t.key.toLowerCase()===`g`)&&(t.preventDefault(),e.au(t.shiftKey?-1:1))},{signal:t.signal}),e.an=e.z,e.ao=!!e.a1,e.a1&&!e.y&&e.aw(),{abort:t}},onUpdate:function(){if(e.z!==e.an&&(e.an=e.z,e.a1&&e.aw()),e.a1&&!e.ao)e.ao=!0,e.y||e.aw();else if(!e.a1&&e.ao){e.ao=!1;let t=e.d;t&&document.activeElement===t&&t.blur(),e.al&&=(clearTimeout(e.al),0),pS(``,null),Sw(e,{query:``,hit:null,keys:[]})}},onDestroy:function(){e.al&&clearTimeout(e.al),this.abort.abort(),pS(``,null),Sw(e,{query:``,hit:null,keys:[]})}})),aw=h(59,iw,11),ow=h(29,e=>b(e.a,[`_eo`,e.a0&&`_ex`,!e.a1&&`_en`])),sw=h(41,e=>c(e.f,e.a1&&(e.a4||``).trim()?e.ab?`${e.ae+1}/${e.ab}`:`0/0`:``),3),cw=h(38,e=>{T(e.g,`disabled`,!e.ab||!e.a1),T(e.i,`disabled`,!e.ab||!e.a1)}),lw=o(27,e=>{T(e.a,`aria-hidden`,e.a1?`false`:`true`),T(e.d,`tabindex`,e.a1?0:-1),T(e.g,`tabindex`,e.a1?0:-1),T(e.i,`tabindex`,e.a1?0:-1),T(e.k,`tabindex`,e.a1?0:-1),rw(e),aw(e),ow(e),sw(e),cw(e)}),uw=h(16,e=>lw(e,e.o,e.p)),dw=M(14,uw),fw=M(15,uw),pw=(e,t)=>Rw(e,t?.length),mw=h(32,e=>pw(e,qC(e.x,e.a4||``))),hw=M(56,aw),gw=h(53,e=>hw(e,Yw(e)),4),_w=h(55,e=>S(e,`d`,e.a4||``,Xw(e))),vw=o(30,e=>{mw(e),gw(e),aw(e),_w(e),sw(e)}),yw=h(19,e=>vw(e,e.r,e.s)),bw=M(17,yw),xw=M(18,yw),Sw=o(33),Cw=h(22,e=>Sw(e,e.u,e.v)),ww=M(20,Cw),Tw=M(21,Cw),Ew=M(40,e=>{gw(e),sw(e)}),Dw=h(39,e=>Ew(e,e.ab?Math.min(e.a9,e.ab-1):-1)),Ow=M(54,e=>{aw(e),_w(e)}),kw=h(52,e=>Ow(e,Zw(e)),3),Aw=M(51,e=>{kw(e),gw(e)}),jw=h(45,e=>Aw(e,Qw(e)),2),Mw=m(35,e=>{Dw(e),jw(e)}),Nw=(e,t)=>Hw(e,t.open),Pw=(e,t)=>{Uw(e,t.timer),Ww(e,t.tick),Gw(e,t.wasOpen)},Fw=M(58,e=>{i(e,e.aw),aw(e)}),Iw=_(`j6`,e=>{E(e,`d`),u(e.d,`keydown`,function(t){if(e.a1){if(t.key===`Escape`){t.preventDefault(),e.y?e.as(``):e.av();return}t.key===`Enter`&&(t.preventDefault(),e.au(t.shiftKey?-1:1))}}),u(e.g,`mousedown`,function(e){e.preventDefault()}),u(e.g,`click`,function(){e.au(-1)}),u(e.i,`mousedown`,function(e){e.preventDefault()}),u(e.i,`click`,function(){e.au(1)}),u(e.k,`mousedown`,function(e){e.preventDefault()}),u(e.k,`click`,function(){e.av()})});function Lw(e){b(e.b,`_ep`),ve(e.c),fe(e.c,13),Ie(e.c),b(e.e,`_es`),at(e.h),te(e.h,14),ot(e.h),_t(e.j),lt(e.j,14),Ct(e.j),oe(e.l),je(e.l,14),Ft(e.l),Mw(e,0),Nw(e,{open:!1}),Pw(e,{timer:0,tick:0,wasOpen:!1}),Fw(e,$w(e)),Iw(e)}var Rw=M(37,e=>{Dw(e),sw(e),cw(e)}),zw=M(23,e=>{mw(e),jw(e),kw(e)}),Bw=M(57,aw),Vw=h(48,e=>Bw(e,eT(e))),Hw=M(43,e=>{jw(e),kw(e),gw(e),Vw(e),rw(e),aw(e)}),Uw=M(47,e=>{kw(e),gw(e),Vw(e),aw(e)}),Ww=M(49,aw),Gw=M(50,aw),Kw=M(24,e=>{T(e.k,`hidden`,e.y),aw(e)}),qw=M(25,aw),Jw=M(26,e=>{b(e.d,[bt,e.a0&&`_ez`]),b(e.g,[ft,e.a0&&`_eA`]),b(e.i,[ft,e.a0&&`_eA`]),b(e.k,[ft,e.a0&&`_eA`]),ow(e)}),Yw=e=>t=>{e.ah&&(e.al&&=(clearTimeout(e.al),0),e.ap(e.a4||``,(e.ae<0?0:e.ae)+t))},Xw=e=>function(t){e.as(t)},Zw=e=>t=>{if(!e.ah)return;vw(e,t),Mw(e,0);let n=qC(e.x,t);pS(t,n[0]??null,KC(n)??void 0),e.al&&clearTimeout(e.al),e.al=setTimeout(()=>{e.al=0,e.ap(t,0)},80)},Qw=e=>(t,n)=>{if(!e.ah)return;let r=qC(e.x,t),i=[...new Set(r.map(e=>e.key))];if(!r.length){Mw(e,0),pS(t,null,i),Sw(e,{query:t,hit:null,keys:i});return}Mw(e,(n%r.length+r.length)%r.length);let a=r[e.a9];pS(t,a,KC(r)??void 0),Sw(e,{query:t,hit:a,keys:i})},$w=e=>()=>{let t=e.d;t&&(t.focus(),t.select(),document.activeElement!==t&&setTimeout(()=>{t.focus(),t.select()},0))},eT=e=>()=>{e.d?.blur(),lw(e,!1),e.ah=!1,e.al&&=(clearTimeout(e.al),0),pS(``,null),Sw(e,{query:``,hit:null,keys:[]})};N(`j4`,Yw),N(`j1`,Xw),N(`j3`,Zw),N(`j2`,Qw),N(`j0`,$w),N(`j5`,eT);var tT=`_jz _y`,nT=`_jK _x`,rT=`<div><!><!><!><!><!><!><span><span><!> file<!></span><!><!><!></span></div>`,iT=` D%b%b%b%b%b%b E%c%l%b%b%m`,aT=j(82,e=>c(e.b,e._._.ar),e=>e._._),oT=e=>{aT(e),b(e.a,[`_N`,pe.accent,`_jQ`])},sT=h(2,e=>T(e.a,`title`,`${e._.a6?`#${e._.a6.number}`:e._.aa} is already in ${e._.a8}; showing the working tree only`),2),cT=f(5,0,sT),lT=e=>{cT._(e),uT._(e),dT._(e),b(e.a,[`_N`,`_jR`])},uT=f(5,0,e=>{c(e.b,e._.a8),sT(e)}),dT=f(5,0,sT),fT=f(3,0,e=>c(e.b,Zx(e._.ak,7))),pT=e=>{fT._(e),b(e.a,[`_N`,`_jR`])},mT=h(7,e=>T(e.a,`title`,`${e._.as} · ${e._.ah.slice(0,7)}…${e._.ai.slice(0,7)}`),2),hT=f(2,0,mT),gT=e=>{hT._(e),_T._(e),yT._(e),bT._(e),xT._(e),ST._(e),b(e.a,`_jM`),b(e.b,[`_N`,`_jN`]),b(e.d,[`_P`,`_jP`]),b(e.e,[`_N`,`_jO`])},_T=f(2,0,mT),vT=d(6,`<span> </span>`,` D `,oT),yT=f(2,0,e=>vT(e,+!e._.ar)),bT=f(2,0,mT),xT=f(2,0,e=>c(e.c,e._.at)),ST=f(2,0,e=>c(e.f,e._.au)),CT=f(1,1,e=>c(e.b,Ce(e._.aj))),wT=e=>{CT._(e),b(e.a,[nT,`_jL`])},TT=h(4,e=>T(e.a,`title`,`${e._.ag}: ${e._.a9} ${e._.ah} vs ${e._.a8} ${e._.ai}`),4),ET=f(1,0,TT),DT=e=>{ET._(e),OT._(e),kT._(e),AT._(e),jT._(e),MT._(e),NT._(e),b(e.a,[`_u`,`_v`]),b(e.c,nT)},OT=f(1,0,TT),kT=f(1,0,e=>c(e.b,e._.ae)),AT=f(1,0,e=>T(e.a,`href`,`${e._.af}/files`)),jT=f(1,0,e=>{c(e.d,e._.ag),TT(e)}),MT=f(1,0,TT),NT=f(1,0,TT),PT=f(12,0,e=>c(e.b,e._.a1)),FT=_(`x2`,e=>u(e.a,`click`,function(){e._.a4()})),IT=e=>{PT._(e),LT._(e),FT(e)},LT=f(12,0,e=>{b(e.a,[`_jJ`,{_jI:e._.a2}]),T(e.a,`aria-pressed`,e._.a2?`true`:`false`),T(e.a,`title`,e._.a2?`Show every file`:`Show only files changed since your last visit`)}),RT=f(11,0,e=>c(e.b,e._.z)),zT=_(`x1`,e=>u(e.a,`click`,function(){e._.a0()})),BT=e=>{RT._(e),b(e.a,`_jJ`),zT(e)},VT=f(10,0,e=>c(e.b,e._.w)),HT=e=>{VT._(e),UT._(e),b(e.a,`_jG`),b(e.c,`_jH`)},UT=f(10,0,e=>c(e.d,e._.x)),WT=h(3,e=>c(e.b,aS(e._.aa,e._.q,e._.r)),2),GT=f(6,0,WT),KT=e=>{GT._(e),qT._(e),YT._(e),XT._(e),ZT._(e),QT._(e),b(e.a,[`_N`,`_jR`])},qT=f(6,0,WT),JT=h(4,e=>T(e.a,`title`,`This view is ${Zx(e._.ah)} (${e._.a9}); checked out is ${Zx(e._.ap)} (${e._.aa})`),3),YT=f(6,0,JT),XT=f(6,0,e=>{JT(e),WT(e)}),ZT=f(6,0,JT),QT=f(6,0,e=>{c(e.c,Zx(e._.ap,7)),JT(e)}),$T=f(4,0,e=>T(e.a,`disabled`,e._.s)),eE=_(`x0`,e=>u(e.a,`click`,function(){e._.t()})),tE=e=>{$T._(e),rE._(e),iE._(e),aE._(e),b(e.a,[`_N`,pe.warn,`_jR`]),eE(e)},nE=h(3,e=>T(e.a,`title`,`origin/${e._.a9} ${e._.ah} · GitHub ${e._.am}. Reload to re-ask GitHub`),2),rE=f(4,0,nE),iE=f(4,0,e=>{c(e.b,Zx(e._.ah,7)),nE(e)}),aE=f(4,0,e=>{c(e.c,Zx(e._.am,7)),nE(e)}),oE=(e,t)=>{cE(e,t?.pr),_E(e,t?.base),vE(e,t?.branch),SE(e,t?.default_branch),CE(e,t?.worktree),wE(e,t?.head),TE(e,t?.baseSha),EE(e,t?.full_name),OE(e,t?.rev),AE(e,t?.githubDrift),NE(e,t?.contained),PE(e,t?.localHead)},sE=d(1,`<a target=_blank rel=noopener>#<!></a><span> </span>`,` Db%l D `,DT,`<span> </span>`,` D `,wT),cE=M(32,e=>{dE(e,e.a6?.baseRefName),fE(e,e.a6?.headRefName),pE(e,e.a6?.number),mE(e,e.a6?.url),hE(e,e.a6?.title),gE(e,e.a6?.headRefOid),sE(e,+!e.a6),cT(e)}),lE=(e,t)=>{HE(e,t?.topic),UE(e,t?.title),WE(e,t?.base),GE(e,t?.head)},uE=h(37,e=>lE(e,iS(e.a7||e.a8,e.a9||e.aa,e.q,e.r)),5),dE=M(33,uE),fE=M(35,e=>{uE(e),rE(e),YT(e),OT(e)}),pE=M(40,kT),mE=M(41,AT),hE=M(42,jT),gE=M(48,aE),_E=M(34,e=>{uE(e),ET(e),uT(e)}),vE=M(36,e=>{uE(e),XT(e),dT(e)}),yE=d(2,`<span><span> </span><span aria-hidden=true>vs</span><span> </span><!></span>`,` D D l b D l%`,gT),bE=(e,t)=>yE(e,+!t),xE=h(59,e=>bE(e,!!e.ar||!!e.q&&e.aw!==e.q||!!e.ac&&e.av!==e.ac),4),SE=M(38,xE),CE=M(39),wE=M(43,e=>{iE(e),ZT(e),MT(e),hT(e)}),TE=M(44,e=>{NT(e),_T(e)}),EE=M(45,CT),DE=d(3,`<span title="One commit against its parent">commit <!></span>`,` Db%`,pT),OE=M(46,e=>{DE(e,+!e.ak),fT(e)}),kE=d(4,`<button type=button>behind GitHub <!> → <!></button>`,` Db%c%`,tE),AE=(e,t)=>kE(e,+!t),jE=d(5,`<span>already in <!></span>`,` Db%`,lT),ME=h(50,e=>jE(e,e.an&&e.u?0:1)),NE=M(49,ME),PE=M(51,QT),FE=M(57,xE),IE=e=>{FE(e,(e.a7||e.a8).replace(/^origin\//,``))},LE=M(58,xE),RE=e=>{LE(e,(e.a9||e.aa).replace(/^origin\//,``))},zE=e=>{T(e.a,`data-pr`,e.a6?`${e.ad}/${e.a6.number}`:void 0)},BE=M(15,e=>{oE(e,e.p),IE(e),RE(e),zE(e)}),VE=y(aT),HE=M(53,e=>{xE(e),yT(e),VE(e)}),UE=M(54,bT),WE=M(55,xT),GE=M(56,ST),KE=M(16,e=>{uE(e),xE(e),GT(e)}),qE=M(17,e=>{uE(e),qT(e)});function JE(e){b(e.a,`_jE`),b(e.h,`_jF`)}var YE=M(20,e=>{c(e.i,e.u),c(e.j,e.u===1?``:`s`),ME(e)}),XE=d(6,`<span>local <!><!></span>`,` Db%b%`,KT),ZE=(e,t)=>XE(e,+!t),QE=d(10,`<span>+<!></span><span>−<!></span>`,` Db%l Db%`,HT),$E=h(24,e=>QE(e,e.w||e.x?0:1)),eD=M(22,e=>{$E(e),VT(e)}),tD=M(23,e=>{$E(e),UT(e)}),nD=d(11,`<button type=button title="Filtered out of the list — show every file"><!> hidden</button>`,` D%`,BT),rD=M(25,e=>{nD(e,+!e.z),RT(e)}),iD=d(12,`<button type=button><!> new</button>`,` D%`,IT),aD=h(29,e=>iD(e,e.a1||e.a2?0:1)),oD=M(27,e=>{aD(e),PT(e)}),sD=M(28,e=>{aD(e),LT(e)}),cD=M(18,$T),lD=M(19),uD=M(26),dD=M(30),fD=`<!><!><!>`,pD=f(1,0,e=>c(e.b,e._.e)),mD=e=>{pD._(e),b(e.a,[tT,`_jv`])},hD=f(6,0,e=>c(e.b,e._.r)),gD=e=>{hD._(e),b(e.a,[`_u`,`_v`,`_jA`])},_D=j(34,e=>sD(e.c,e._._.k),e=>e._._),vD=e=>{_D(e),yD(e),bD(e),xD(e),SD(e),wD(e),TD(e),ED(e),OD(e),AD(e),jD(e),MD(e),ND(e),PD(e),ID(e),b(e.a,`_jB`),JE(e.c)},yD=j(35,e=>dD(e.c,e._._.l),e=>e._._),bD=j(36,e=>uD(e.c,e._._.m),e=>e._._),xD=j(37,e=>KE(e.c,e._._.n),e=>e._._),SD=j(38,e=>qE(e.c,e._._.o),e=>e._._),CD=h(9,e=>ZE(e.c,e._._.p.has(e.i))),wD=j(39,CD,e=>e._._),TD=j(40,e=>lD(e.c,e._._.q),e=>e._._),ED=j(41,e=>cD(e.c,e._._.r),e=>e._._),DD=(e,t)=>{BE(e.c,t),LD(e,t?.worktree),RD(e,t?.files?.length),zD(e,t?.id)},OD=j(43,e=>DD(e,e._._.t),e=>e._._),kD=h(7,e=>YE(e.c,e._._.v||e.g)),AD=j(45,kD,e=>e._._),jD=j(46,e=>eD(e.c,e._._.w),e=>e._._),MD=j(47,e=>tD(e.c,e._._.x),e=>e._._),ND=j(48,e=>oD(e.c,e._._.y),e=>e._._),PD=j(49,e=>rD(e.c,e._._.z),e=>e._._),FD=d(1,`<span> </span>`,` D `,mD),ID=j(50,e=>FD(e,+!!e._._.a0),e=>e._._),LD=M(4,pD),RD=M(6,kD),zD=M(8,CD),BD=h(20,e=>b(e.a,[`_ju`,{_js:e.s,_jt:e.t}])),VD=M(19,e=>{T(e.b,`title`,e.t?`Show this section's files`:`Hide this section's files`),T(e.b,`aria-expanded`,e.t?`false`:`true`),BD(e)}),HD=h(12,e=>VD(e,e._._._.h.has(e.l))),UD=j(33,HD,e=>e._._._),WD=e=>{UD(e),qD(e),b(e.b,`_jx`),b(e.c,`_jy`),b(e.d,`_jw`),b(e.e,tT)},GD=M(18,e=>{T(e.a,`aria-selected`,e.s?`true`:`false`),BD(e)}),KD=h(13,e=>GD(e,e._._._.u===e.l)),qD=j(44,KD,e=>e._._._),JD=(e,t)=>{XD(e,t?.id),$D(e,t?.pr),tO(e,t?.worktree)},YD=_(`y1`,e=>{u(e.b,`click`,function(){e._._._.i(e.l)}),u(e.d,`click`,function(){e._._._.j(e.l)})}),XD=M(11,e=>{KD(e),HD(e),YD(e)}),ZD=d(6,`<span>#<!></span>`,` Db%`,gD),QD=h(16,e=>T(e.a,`data-pr`,e.o?`${e.p}/${e.o.number}`:void 0)),$D=M(14,e=>{eO(e,e.o?.number),ZD(e,+!e.o),QD(e)}),eO=M(17,hD),tO=M(15,e=>{c(e.f,e.p),QD(e)}),nO=JD,rO=a(0,`<div role=tab><button type=button><span>▾</span></button><button type=button title="Scroll to this section"><span> </span><!></button></div>`,` D D l D D l%`,WD,(e,t)=>nO(e,t[0]?.repo)),iO=j(31,e=>rO(e,[e._._.d,e=>e.repo.id]),e=>e._._),aO=_(`y3`,e=>u(e.a,`scroll`,function(){e._._.a4(e.a)})),oO=e=>{iO(e),lO(e),dO(e),fO(e),pO(e),aO(e)},sO=_(`y2`,e=>l(e,{count:e._._.g,onMount:function(){e._._.a4(e.a);let t=new ResizeObserver(()=>e._._.a4(e.a));return t.observe(e.a),{ro:t}},onUpdate:function(){e._._.a4(e.a)},onDestroy:function(){this.ro.disconnect()}})),cO=h(1,sO),lO=j(32,cO,e=>e._._),uO=h(2,e=>b(e.a,[`_jr`,{_jq:e._._.a2,_jp:e._._.a3}])),dO=j(51,uO,e=>e._._),fO=j(52,uO,e=>e._._),pO=j(53,cO,e=>e._._),mO=d(2,(e=>`<div><!>${e}</div>`)(rT),(e=>` D%b/${e}&l`)(iT),vD),hO=f(0,0,e=>mO(e,+!e._.s)),gO=e=>{hO._(e),vO._(e)},_O=d(1,`<div role=tablist></div>`,` `,oO),vO=f(0,0,e=>{b(e.a,[`_jo`,{_jn:e._.a0}]),_O(e,+!e._.a0)}),yO=M(18,e=>{xO(e,e.s?.repo),CO(e,e.s?.files),wO(e,e.s?.additions),TO(e,e.s?.deletions),EO(e,e.s?.fresh),DO(e,e.s?.hidden),hO(e)}),bO=y(OD),xO=M(19,e=>{SO(e,e.t?.id),bO(e)}),SO=M(20,y(qD)),CO=M(21,y(AD)),wO=M(22,y(jD)),TO=M(23,y(MD)),EO=M(24,y(ND)),DO=M(25,y(PD)),OO=h(5,e=>yO(e,e.d.find(t=>t.repo.id===e.e)||e.d[0])),kO=y(iO),AO=M(3,e=>{IO(e,e.d?.length),OO(e),kO(e)}),jO=M(4,OO),MO=y(ID),NO=M(26,e=>{vO(e),MO(e)}),PO=d(0,`<div><!><!></div>`,` D%b%`,gO),FO=y(lO),IO=M(6,e=>{NO(e,e.g>1),PO(e,+!e.g),FO(e)}),LO=M(30,y(pO)),RO=e=>{LO(e,ek(e))},zO=m(27,e=>{BO(e,e.a1?.end),VO(e,e.a1?.start),RO(e)}),BO=M(28,y(dO)),VO=M(29,y(fO));function HO(e){zO(e,{start:!1,end:!1})}var UO=M(7,y(UD)),WO=M(8),GO=M(9),KO=M(10,y(_D)),qO=M(11,y(yD)),JO=M(12,y(bD)),YO=M(13,y(xD)),XO=M(14,y(SD)),ZO=M(15,y(wD)),QO=M(16,y(TD)),$O=M(17,y(ED)),ek=e=>t=>{let n=t.scrollWidth-t.clientWidth-t.scrollLeft>1,r=t.scrollLeft>1;(n!==e.a2||r!==e.a3)&&zO(e,{start:r,end:n})};N(`y0`,ek);var tk=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
1532
|
+
`)}function cS(e){let t=e.replace(/^origin\//,``);return lS(t.includes(`/`)?t.slice(t.lastIndexOf(`/`)+1):t)}function lS(e){return e.replace(/-[a-z0-9]{1,6}$/i,``)||e}function uS(e,t){if(!t)return``;let n=e.replace(/^origin\//,``),r=t.replace(/^origin\//,``);return n.startsWith(`${r}-`)?n.slice(r.length+1):``}function dS(e){let t=lS(e);if(t.length<=20)return t;let n=t.split(`-`);return n.length>1?n[n.length-1]:t}function fS(e,t,n=``,r=``){let i=(e||`base`).replace(/^origin\//,``),a=(t||`HEAD`).replace(/^origin\//,``),o=(n||``).replace(/^origin\//,``),s=!!o&&(a===o||a.startsWith(`${o}-`));return{base:i,head:s?r||cS(o):dS(a),topic:s?uS(a,o):``,title:a===i?i:`${a} vs ${i}`}}function pS(e,t=``,n=``){let r=e.replace(/^origin\//,``);if(!r||r===`HEAD`)return r||`HEAD`;let i=t.replace(/^origin\//,``);if(i&&(r===i||r.startsWith(`${i}-`))){let e=n||cS(i),t=uS(r,i);return t?`${e} [${t}]`:e}return dS(r)}var mS=`search-mark`,hS=`mark.${mS}`,gS=`mark.${mS}{display:inline;background:#ffd24a;color:#1a1408;-webkit-text-fill-color:#1a1408;border-radius:3px;padding:0 2px}mark.${mS} *,mark.${mS} *::before,mark.${mS} *::after{color:inherit!important;-webkit-text-fill-color:inherit!important;background:transparent!important}mark.${mS}.active{background:#ffb000;box-shadow:0 0 0 1px #c98400}`,_S={query:``,hit:null,keys:null},vS=new Map,yS=new WeakMap,bS=(e,t)=>t?`${e}\n${t.line}\n${t.side||``}`:e;function xS(e,t,n){_S.query=e,_S.hit=t,_S.keys=n?new Set(n):null;for(let[e,t]of vS)ES(e,t,!1);t&&SS(t)}function SS(e,t=0){requestAnimationFrame(()=>{requestAnimationFrame(()=>{let n=!1;for(let[r,i]of vS)if(i===e.key&&(n=!0,TS(r,e)||t>=40))return;t>=40||(!n||t<12)&&setTimeout(()=>SS(e,t+1),n?32:48)})})}function CS(e,t,n){let r=e.getBoundingClientRect(),i=t.getBoundingClientRect();if(i.height===0&&i.width===0)return!1;if(n===`y`){let t=i.top-r.top+e.scrollTop-(r.height/2-i.height/2);return e.scrollTo({top:Math.max(0,t)}),!0}if(e.scrollWidth<=e.clientWidth+1)return!0;let a=Math.min(24,r.width/8);if(i.left>=r.left+a&&i.right<=r.right-a)return!0;let o=i.left-r.left+e.scrollLeft-(r.width/2-i.width/2),s=Math.max(0,e.scrollWidth-e.clientWidth);return e.scrollTo({left:Math.max(0,Math.min(o,s))}),!0}function wS(e,t){let n=t.parentElement,r=e;for(;r&&r!==n;){if(r instanceof HTMLElement&&r.scrollWidth>r.clientWidth+1){let e=getComputedStyle(r).overflowX;if(e===`auto`||e===`scroll`)return r}let e=r.getRootNode(),t=r.parentElement??(e instanceof ShadowRoot?e.host:null);if(t===r)break;r=t}return null}function TS(e,t){let n=e.querySelector(`diffs-container`)?.shadowRoot;if(!n)return!1;let r=n.querySelector(`mark.search-mark.active`)??(()=>{if(t.line<1)return null;let e=[...n.querySelectorAll(`[data-line="${t.line}"]`)],r=t.side||`additions`;return e.find(e=>AS(e)===r)??e[0]??null})();if(!r)return!1;let i=e.closest(`[data-diff-main]`);if(i){if(!CS(i,r,`y`))return!1}else r.scrollIntoView({block:`center`,inline:`nearest`});let a=wS(r,e);return a&&CS(a,r,`x`),!0}function ES(e,t,n=!0){let r=t&&_S.hit?.key===t?_S.hit:null,i=_S.query.trim(),a=!!i&&!!_S.keys&&!!t&&!_S.keys.has(t),o=a?``:bS(i,r);!n&&yS.get(e)===o||(yS.set(e,o),FS(e,a?``:i,r),r&&SS(r))}function DS(e,t){return vS.set(e,t),ES(e,t),()=>{vS.delete(e),yS.delete(e)}}function OS(e){ES(e,vS.get(e))}function kS(e){let t=e.querySelectorAll(hS);if(!t.length)return;let n=new Set;for(let e of[...t])e.parentElement&&n.add(e.parentElement),e.replaceWith(...e.childNodes);for(let e of n)e.normalize()}function AS(e){let t=e.closest(`[data-code]`);return t?.hasAttribute(`data-deletions`)?`deletions`:t?.hasAttribute(`data-additions`)?`additions`:(e.getAttribute(`data-line-type`)||``).includes(`deletion`)?`deletions`:`additions`}function jS(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=[];for(let e=t.nextNode();e;e=t.nextNode())e.parentElement?.closest(hS)||n.push(e);return n}function MS(e,t,n){let r=0;for(let i=0;i<e.length;i++){let a=t[i].length;if(n<=r+a)return{node:e[i],offset:Math.min(a,Math.max(0,n-r))};r+=a}let i=e.at(-1);return i?{node:i,offset:t.at(-1)?.length??0}:null}function NS(e,t,n,r,i){let a=MS(e,t,n),o=MS(e,t,r);if(!a||!o)return;let s=document.createRange();s.setStart(a.node,a.offset),s.setEnd(o.node,o.offset);let c=document.createElement(`mark`);c.className=i;try{c.append(s.extractContents()),s.insertNode(c)}catch{}}function PS(e,t,n,r){let i=jS(e);if(!i.length)return;let a=i.map(e=>e.textContent??``),o=a.join(``),s=n?o:o.toLowerCase(),c=[];for(let e=s.indexOf(t);e!==-1;e=s.indexOf(t,e+t.length))c.push([e,e+t.length]);if(!c.length)return;let l=AS(e),u=Number(e.getAttribute(`data-line`)),d=r&&r.line===u&&(r.side||`additions`)===l?`${mS} active`:mS;for(let e=c.length-1;e>=0;e--)NS(i,a,c[e][0],c[e][1],d)}function FS(e,t,n){let r=[e],i=e.shadowRoot??e.querySelector(`diffs-container`)?.shadowRoot;i&&r.push(i);let a=t.trim(),o=/[A-Z]/.test(a),s=a&&!o?a.toLowerCase():a;for(let e of r)if(kS(e),s)for(let t of e.querySelectorAll(`[data-code] [data-line]`)){let e=t.textContent||``;(o?e:e.toLowerCase()).includes(s)&&PS(t,s,o,n)}}var IS=`_g3 _4 _l`,LS=`_g9 _ej`,RS=`_hC _u`,zS=st,BS=(e=>`/${e}&`)(ne);function VS(e){ce(e.a,`M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 13.8214 2.48697 15.5291 3.33782 17L2.5 21.5L7 20.6622C8.47087 21.513 10.1786 22 12 22Z`)}var HS=(e,t)=>Te(e.a,t),US=(e,t)=>ue(e.a,t),WS=(e=>`<div role=group><span>${e}<span aria-hidden=true> </span></span><button type=button aria-label="Copy comments as markdown"></button><!></div>`)(zS),GS=(e=>` D D/${e}& D m b%l`)(BS),KS=(e,t)=>T(e.a,`value`,t),qS=h(7,e=>c(e.b,e.f||e.g)),JS=M(5,qS),YS=M(6,qS),XS=(e,t)=>{KS(e,t[0]?.id),JS(e,t[0]?.title),YS(e,t[0]?.agent)},ZS=e=>{He(e.a),It(e.a,14),kt(e.a)},QS=e=>{Fe(e.a),re(e.a,14),Rt(e.a)},$S=j(26,e=>{T(e.b,`disabled`,e._._.o),T(e.c,`disabled`,e._._.o)},e=>e._._),eC=_(`k2`,e=>{u(e.b,`click`,function(){let t=e.c;typeof t.showPicker==`function`?t.showPicker():t.focus()}),C(e,`c`)}),tC=e=>{$S(e),rC(e),iC(e),b(e.a,`_iT`),b(e.b,[`_iO`,`_iP`,`_iU`]),b(e.c,`_iV`),eC(e)},nC=a(2,`<option> </option>`,` D `,0,XS),rC=j(27,e=>nC(e,[e._._.q,`id`]),e=>e._._),iC=j(29,e=>A(e,`c`,e._._.v,KC(e)),e=>e._._),aC=j(26,e=>c(e.a,e._._.o?`Sending…`:`Send`),e=>e._._),oC=aC,sC=h(4,e=>c(e.b,e._._.o?`Sending…`:`Send to ${e._._.w||e._._.x}`),2),cC=j(26,e=>{c(e.d,e._._.o?`Sending…`:`Send`),sC(e)},e=>e._._),lC=e=>{cC(e),uC(e),dC(e),b(e.a,[`_iS`,`_iR`]),b(e.c,`_iQ`)},uC=j(30,sC,e=>e._._),dC=j(31,sC,e=>e._._),fC=f(6,0,e=>T(e.a,`disabled`,e._.o)),pC=_(`k3`,e=>u(e.a,`click`,function(){e._.z()})),mC=e=>{fC._(e),_C._(e),yC._(e),bC._(e),b(e.a,[`_iO`,`_iP`]),pC(e)},hC=d(0,`<span> </span><span> </span>`,` D l D `,lC,` `,` `,oC),gC=d(1,`<span><button type=button aria-label="Choose session to send to"></button><select aria-label="Send comments to session" tabindex=-1></select></span>`,` D b `,tC),_C=f(6,0,e=>{hC(e,e._.s>1?0:1),gC(e,e._.s>1?0:1)}),vC=h(2,e=>T(e.a,`title`,`Send comments to ${e._.w||e._.x}`)),yC=f(6,0,vC),bC=f(6,0,vC),xC=d(5,me,(e=>`/${e}&`)(Pe),QS,Pt,(e=>`/${e}&`)(ke),ZS),SC=m(13,e=>{T(e.f,`title`,e.n?`Copied`:`Copy comments as markdown`),xC(e,+!e.n)}),CC=M(25),wC=h(20,e=>CC(e,qC(e)),2),TC=y(cC,aC,$S),EC=m(14,e=>{wC(e),fC(e),TC(e)}),DC=d(6,`<button type=button></button><!><!>`,` b%`,mC),OC=M(19,e=>{LC(e,e.t?.id),zC(e,e.t?.title),VC(e,e.t?.agent),DC(e,+!e.t),wC(e)}),kC=h(17,e=>OC(e,e.q.find(t=>t.id===e.p)??e.q[0]??null)),AC=m(15,kC),jC=_(`k4`,e=>u(e.f,`click`,function(){(async()=>{await e.m()&&(SC(e,!0),setTimeout(()=>{SC(e,!1)},1500))})()}));function MC(e){b(e.a,`_iK`),b(e.b,`_iL`),VS(e.c),HS(e.c,18),US(e.c,`_iM`),b(e.d,`_iN`),b(e.f,`_iO`),SC(e,!1),EC(e,!1),AC(e,null),jC(e)}var NC=y(rC),PC=M(16,e=>{FC(e,e.q.length),kC(e),NC(e)}),FC=M(18,_C),IC=(e,t)=>PC(e,t||[]),LC=M(21,y(iC)),RC=y(uC),zC=M(22,e=>{yC(e),RC(e)}),BC=y(dC),VC=M(23,e=>{bC(e),BC(e)}),HC=(e,t)=>{T(e.a,`aria-label`,t),T(e.b,`title`,t)},UC=(e,t)=>{c(e.e,t>99?`99+`:t),HC(e,`${t} comment${t===1?``:`s`}`)},WC=M(11,wC),GC=M(12),KC=e=>function(t){AC(e._._,t)},qC=e=>()=>{(async()=>{if(!(!e.t||e.o)){EC(e,!0);try{await e.l(e.t?.id)}finally{EC(e,!1)}}})()};N(`k0`,KC),N(`k1`,qC);var JC=st,YC=(e=>`/${e}&`)(ne);function XC(e){ce(e.a,`M2 11V4.6C2 4.26863 2.26863 4 2.6 4H8.77805C8.92127 4 9.05977 4.05124 9.16852 4.14445L12.3315 6.85555C12.4402 6.94876 12.5787 7 12.722 7H21.4C21.7314 7 22 7.26863 22 7.6V11M2 11V19.4C2 19.7314 2.26863 20 2.6 20H21.4C21.7314 20 22 19.7314 22 19.4V11M2 11H22`)}var ZC=(e,t)=>Te(e.a,t),QC=(e,t)=>ue(e.a,t),$C=40,ew;function tw(e){return e.length>=200?null:[...new Set(e.map(e=>e.key))]}function nw(e,t){let n=t.trim();if(!n)return[];if(ew&&ew.files===e&&ew.query===n)return ew.hits;let r=aw(e,n);return ew={files:e,query:n,hits:r},r}var rw=new WeakMap;function iw(e){let t=rw.get(e);if(!t){let n={additions:new Set,deletions:new Set};if(e.fileDiff){let n=vx(e.fileDiff,`additions`),r=vx(e.fileDiff,`deletions`),i=e=>{let t=[];for(let[n,r]of e)t[n-1]=r;return t};t={visible:{additions:new Set(n.keys()),deletions:new Set(r.keys())},newLines:i(n),oldLines:i(r)}}else t={visible:n,newLines:null,oldLines:null};rw.set(e,t)}return t}function aw(e,t){let n=/[A-Z]/.test(t),r=n?t:t.toLowerCase(),i=!/[^\x00-\x7f]/.test(r),a=[];for(let t of e){if(a.length>=200)break;let e=a.length;if(i&&!(n?t.patch??``:(t.patch??``).toLowerCase()).includes(r)){ow(t.path,r,n)&&a.push({key:t.key,path:t.path,repo:t.repo,line:0,side:null,preview:t.path});continue}let{visible:o,newLines:s,oldLines:c}=iw(t),l=new Set;sw(t,s,`additions`,r,n,l,a,o.additions),sw(t,c,`deletions`,r,n,l,a,o.deletions),a.length===e&&ow(t.path,r,n)&&a.push({key:t.key,path:t.path,repo:t.repo,line:0,side:null,preview:t.path})}return a}function ow(e,t,n){let r=n?e:e.toLowerCase();if(!r.includes(t))return!1;let i=e.lastIndexOf(`/`),a=i>=0?e.slice(i+1):e,o=a.lastIndexOf(`.`);if(o<=0)return!0;let s=a.slice(o+1);if(!(n?s:s.toLowerCase()).includes(t))return!0;let c=e.length-s.length;for(let e=r.indexOf(t);e!==-1;e=r.indexOf(t,e+1))if(e<c)return!0;return!1}function sw(e,t,n,r,i,a,o,s){if(!t||o.length>=200||!s.size)return;let c=0;for(let l=0;l<t.length;l++){if(o.length>=200||c>=$C)return;let u=l+1;if(!s.has(u))continue;let d=t[l];if(d==null)continue;let f=(i?d:d.toLowerCase()).indexOf(r);f<0||n===`deletions`&&a.has(d)||(n===`additions`&&a.add(d),c++,o.push({key:e.key,path:e.path,repo:e.repo,line:u,side:n,preview:cw(d,f,r.length)}))}}function cw(e,t,n){let r=Math.max(0,t-36),i=Math.min(e.length,t+n+36);return(r>0?`…`:``)+e.slice(r,i)+(i<e.length?`…`:``)}var lw=((e,t,n,r)=>`<div><span aria-hidden=true>${e}</span><input type=search enterkeyhint=search autocomplete=off placeholder="Find in review" aria-label="Find in review"><span> </span><button type=button title="Previous match">${t}</button><button type=button title="Next match">${n}</button><button type=button title="Close find">${r}</button></div>`)(ht,xe,rt,Nt),uw=((e,t,n,r)=>` D D/${e}&l b D l D/${t}&l D/${n}&l D/${r}&m`)(ge,Se,Ve,Ne),dw=_(`j8`,e=>e.ah=!!e.a1),fw=h(44,dw),pw=_(`j7`,e=>l(e,{onMount:function(){let t=new AbortController;return document.addEventListener(`keydown`,t=>{if(!e.ah)return;if(t.key===`Escape`){if(document.querySelector(`dialog[open]`)||t.target instanceof HTMLTextAreaElement)return;if(e.y){(e.a4||``).trim()&&(t.preventDefault(),e.as(``));return}t.preventDefault(),e.av();return}let n=t.metaKey||t.ctrlKey;(t.key===`F3`||n&&t.key.toLowerCase()===`g`)&&(t.preventDefault(),e.au(t.shiftKey?-1:1))},{signal:t.signal}),e.an=e.z,e.ao=!!e.a1,e.a1&&!e.y&&e.aw(),{abort:t}},onUpdate:function(){if(e.z!==e.an&&(e.an=e.z,e.a1&&e.aw()),e.a1&&!e.ao)e.ao=!0,e.y||e.aw();else if(!e.a1&&e.ao){e.ao=!1;let t=e.d;t&&document.activeElement===t&&t.blur(),e.al&&=(clearTimeout(e.al),0),xS(``,null),jw(e,{query:``,hit:null,keys:[]})}},onDestroy:function(){e.al&&clearTimeout(e.al),this.abort.abort(),xS(``,null),jw(e,{query:``,hit:null,keys:[]})}})),mw=h(59,pw,11),hw=h(29,e=>b(e.a,[`_eC`,e.a0&&`_eL`,!e.a1&&`_eB`])),gw=h(41,e=>c(e.f,e.a1&&(e.a4||``).trim()?e.ab?`${e.ae+1}/${e.ab}`:`0/0`:``),3),_w=h(38,e=>{T(e.g,`disabled`,!e.ab||!e.a1),T(e.i,`disabled`,!e.ab||!e.a1)}),vw=o(27,e=>{T(e.a,`aria-hidden`,e.a1?`false`:`true`),T(e.d,`tabindex`,e.a1?0:-1),T(e.g,`tabindex`,e.a1?0:-1),T(e.i,`tabindex`,e.a1?0:-1),T(e.k,`tabindex`,e.a1?0:-1),fw(e),mw(e),hw(e),gw(e),_w(e)}),yw=h(16,e=>vw(e,e.o,e.p)),bw=M(14,yw),xw=M(15,yw),Sw=(e,t)=>qw(e,t?.length),Cw=h(32,e=>Sw(e,nw(e.x,e.a4||``))),ww=M(56,mw),Tw=h(53,e=>ww(e,iT(e)),4),Ew=h(55,e=>S(e,`d`,e.a4||``,aT(e))),Dw=o(30,e=>{Cw(e),Tw(e),mw(e),Ew(e),gw(e)}),Ow=h(19,e=>Dw(e,e.r,e.s)),kw=M(17,Ow),Aw=M(18,Ow),jw=o(33),Mw=h(22,e=>jw(e,e.u,e.v)),Nw=M(20,Mw),Pw=M(21,Mw),Fw=M(40,e=>{Tw(e),gw(e)}),Iw=h(39,e=>Fw(e,e.ab?Math.min(e.a9,e.ab-1):-1)),Lw=M(54,e=>{mw(e),Ew(e)}),Rw=h(52,e=>Lw(e,oT(e)),3),zw=M(51,e=>{Rw(e),Tw(e)}),Bw=h(45,e=>zw(e,sT(e)),2),Vw=m(35,e=>{Iw(e),Bw(e)}),Hw=(e,t)=>Zw(e,t.open),Uw=(e,t)=>{Qw(e,t.timer),$w(e,t.tick),eT(e,t.wasOpen)},Ww=M(58,e=>{i(e,e.aw),mw(e)}),Gw=_(`j6`,e=>{E(e,`d`),u(e.d,`keydown`,function(t){if(e.a1){if(t.key===`Escape`){t.preventDefault(),e.y?e.as(``):e.av();return}t.key===`Enter`&&(t.preventDefault(),e.au(t.shiftKey?-1:1))}}),u(e.g,`mousedown`,function(e){e.preventDefault()}),u(e.g,`click`,function(){e.au(-1)}),u(e.i,`mousedown`,function(e){e.preventDefault()}),u(e.i,`click`,function(){e.au(1)}),u(e.k,`mousedown`,function(e){e.preventDefault()}),u(e.k,`click`,function(){e.av()})});function Kw(e){b(e.b,`_eD`),ve(e.c),fe(e.c,13),Ie(e.c),b(e.e,`_eG`),at(e.h),te(e.h,14),ot(e.h),_t(e.j),lt(e.j,14),Ct(e.j),oe(e.l),je(e.l,14),Ft(e.l),Vw(e,0),Hw(e,{open:!1}),Uw(e,{timer:0,tick:0,wasOpen:!1}),Ww(e,cT(e)),Gw(e)}var qw=M(37,e=>{Iw(e),gw(e),_w(e)}),Jw=M(23,e=>{Cw(e),Bw(e),Rw(e)}),Yw=M(57,mw),Xw=h(48,e=>Yw(e,lT(e))),Zw=M(43,e=>{Bw(e),Rw(e),Tw(e),Xw(e),fw(e),mw(e)}),Qw=M(47,e=>{Rw(e),Tw(e),Xw(e),mw(e)}),$w=M(49,mw),eT=M(50,mw),tT=M(24,e=>{T(e.k,`hidden`,e.y),mw(e)}),nT=M(25,mw),rT=M(26,e=>{b(e.d,[bt,e.a0&&`_eN`]),b(e.g,[ft,e.a0&&`_eO`]),b(e.i,[ft,e.a0&&`_eO`]),b(e.k,[ft,e.a0&&`_eO`]),hw(e)}),iT=e=>t=>{e.ah&&(e.al&&=(clearTimeout(e.al),0),e.ap(e.a4||``,(e.ae<0?0:e.ae)+t))},aT=e=>function(t){e.as(t)},oT=e=>t=>{if(!e.ah)return;Dw(e,t),Vw(e,0);let n=nw(e.x,t);xS(t,n[0]??null,tw(n)??void 0),e.al&&clearTimeout(e.al),e.al=setTimeout(()=>{e.al=0,e.ap(t,0)},80)},sT=e=>(t,n)=>{if(!e.ah)return;let r=nw(e.x,t),i=[...new Set(r.map(e=>e.key))];if(!r.length){Vw(e,0),xS(t,null,i),jw(e,{query:t,hit:null,keys:i});return}Vw(e,(n%r.length+r.length)%r.length);let a=r[e.a9];xS(t,a,tw(r)??void 0),jw(e,{query:t,hit:a,keys:i})},cT=e=>()=>{let t=e.d;t&&(t.focus(),t.select(),document.activeElement!==t&&setTimeout(()=>{t.focus(),t.select()},0))},lT=e=>()=>{e.d?.blur(),vw(e,!1),e.ah=!1,e.al&&=(clearTimeout(e.al),0),xS(``,null),jw(e,{query:``,hit:null,keys:[]})};N(`j4`,iT),N(`j1`,aT),N(`j3`,oT),N(`j2`,sT),N(`j0`,cT),N(`j5`,lT);var uT=`_jG _y`,dT=`_jR _x`,fT=`<div><!><!><!><!><!><!><span><span><!> file<!></span><!><!><!></span></div>`,pT=` D%b%b%b%b%b%b E%c%l%b%b%m`,mT=j(82,e=>c(e.b,e._._.ar),e=>e._._),hT=e=>{mT(e),b(e.a,[`_N`,pe.accent,`_jX`])},gT=h(2,e=>T(e.a,`title`,`${e._.a6?`#${e._.a6.number}`:e._.aa} is already in ${e._.a8}; showing the working tree only`),2),_T=f(5,0,gT),vT=e=>{_T._(e),yT._(e),bT._(e),b(e.a,[`_N`,`_jY`])},yT=f(5,0,e=>{c(e.b,e._.a8),gT(e)}),bT=f(5,0,gT),xT=f(3,0,e=>c(e.b,aS(e._.ak,7))),ST=e=>{xT._(e),b(e.a,[`_N`,`_jY`])},CT=h(7,e=>T(e.a,`title`,`${e._.as} · ${e._.ah.slice(0,7)}…${e._.ai.slice(0,7)}`),2),wT=f(2,0,CT),TT=e=>{wT._(e),ET._(e),OT._(e),kT._(e),AT._(e),jT._(e),b(e.a,`_jT`),b(e.b,[`_N`,`_jU`]),b(e.d,[`_P`,`_jW`]),b(e.e,[`_N`,`_jV`])},ET=f(2,0,CT),DT=d(6,`<span> </span>`,` D `,hT),OT=f(2,0,e=>DT(e,+!e._.ar)),kT=f(2,0,CT),AT=f(2,0,e=>c(e.c,e._.at)),jT=f(2,0,e=>c(e.f,e._.au)),MT=f(1,1,e=>c(e.b,Ce(e._.aj))),NT=e=>{MT._(e),b(e.a,[dT,`_jS`])},PT=h(4,e=>T(e.a,`title`,`${e._.ag}: ${e._.a9} ${e._.ah} vs ${e._.a8} ${e._.ai}`),4),FT=f(1,0,PT),IT=e=>{FT._(e),LT._(e),RT._(e),zT._(e),BT._(e),VT._(e),HT._(e),b(e.a,[`_u`,`_v`]),b(e.c,dT)},LT=f(1,0,PT),RT=f(1,0,e=>c(e.b,e._.ae)),zT=f(1,0,e=>T(e.a,`href`,`${e._.af}/files`)),BT=f(1,0,e=>{c(e.d,e._.ag),PT(e)}),VT=f(1,0,PT),HT=f(1,0,PT),UT=f(12,0,e=>c(e.b,e._.a1)),WT=_(`x2`,e=>u(e.a,`click`,function(){e._.a4()})),GT=e=>{UT._(e),KT._(e),WT(e)},KT=f(12,0,e=>{b(e.a,[`_jQ`,{_jP:e._.a2}]),T(e.a,`aria-pressed`,e._.a2?`true`:`false`),T(e.a,`title`,e._.a2?`Show every file`:`Show only files changed since your last visit`)}),qT=f(11,0,e=>c(e.b,e._.z)),JT=_(`x1`,e=>u(e.a,`click`,function(){e._.a0()})),YT=e=>{qT._(e),b(e.a,`_jQ`),JT(e)},XT=f(10,0,e=>c(e.b,e._.w)),ZT=e=>{XT._(e),QT._(e),b(e.a,`_jN`),b(e.c,`_jO`)},QT=f(10,0,e=>c(e.d,e._.x)),$T=h(3,e=>c(e.b,pS(e._.aa,e._.q,e._.r)),2),eE=f(6,0,$T),tE=e=>{eE._(e),nE._(e),iE._(e),aE._(e),oE._(e),sE._(e),b(e.a,[`_N`,`_jY`])},nE=f(6,0,$T),rE=h(4,e=>T(e.a,`title`,`This view is ${aS(e._.ah)} (${e._.a9}); checked out is ${aS(e._.ap)} (${e._.aa})`),3),iE=f(6,0,rE),aE=f(6,0,e=>{rE(e),$T(e)}),oE=f(6,0,rE),sE=f(6,0,e=>{c(e.c,aS(e._.ap,7)),rE(e)}),cE=f(4,0,e=>T(e.a,`disabled`,e._.s)),lE=_(`x0`,e=>u(e.a,`click`,function(){e._.t()})),uE=e=>{cE._(e),fE._(e),pE._(e),mE._(e),b(e.a,[`_N`,pe.warn,`_jY`]),lE(e)},dE=h(3,e=>T(e.a,`title`,`origin/${e._.a9} ${e._.ah} · GitHub ${e._.am}. Reload to re-ask GitHub`),2),fE=f(4,0,dE),pE=f(4,0,e=>{c(e.b,aS(e._.ah,7)),dE(e)}),mE=f(4,0,e=>{c(e.c,aS(e._.am,7)),dE(e)}),hE=(e,t)=>{_E(e,t?.pr),EE(e,t?.base),DE(e,t?.branch),jE(e,t?.default_branch),ME(e,t?.worktree),NE(e,t?.head),PE(e,t?.baseSha),FE(e,t?.full_name),LE(e,t?.rev),zE(e,t?.githubDrift),HE(e,t?.contained),UE(e,t?.localHead)},gE=d(1,`<a target=_blank rel=noopener>#<!></a><span> </span>`,` Db%l D `,IT,`<span> </span>`,` D `,NT),_E=M(32,e=>{bE(e,e.a6?.baseRefName),xE(e,e.a6?.headRefName),SE(e,e.a6?.number),CE(e,e.a6?.url),wE(e,e.a6?.title),TE(e,e.a6?.headRefOid),gE(e,+!e.a6),_T(e)}),vE=(e,t)=>{ZE(e,t?.topic),QE(e,t?.title),$E(e,t?.base),eD(e,t?.head)},yE=h(37,e=>vE(e,fS(e.a7||e.a8,e.a9||e.aa,e.q,e.r)),5),bE=M(33,yE),xE=M(35,e=>{yE(e),fE(e),iE(e),LT(e)}),SE=M(40,RT),CE=M(41,zT),wE=M(42,BT),TE=M(48,mE),EE=M(34,e=>{yE(e),FT(e),yT(e)}),DE=M(36,e=>{yE(e),aE(e),bT(e)}),OE=d(2,`<span><span> </span><span aria-hidden=true>vs</span><span> </span><!></span>`,` D D l b D l%`,TT),kE=(e,t)=>OE(e,+!t),AE=h(59,e=>kE(e,!!e.ar||!!e.q&&e.aw!==e.q||!!e.ac&&e.av!==e.ac),4),jE=M(38,AE),ME=M(39),NE=M(43,e=>{pE(e),oE(e),VT(e),wT(e)}),PE=M(44,e=>{HT(e),ET(e)}),FE=M(45,MT),IE=d(3,`<span title="One commit against its parent">commit <!></span>`,` Db%`,ST),LE=M(46,e=>{IE(e,+!e.ak),xT(e)}),RE=d(4,`<button type=button>behind GitHub <!> → <!></button>`,` Db%c%`,uE),zE=(e,t)=>RE(e,+!t),BE=d(5,`<span>already in <!></span>`,` Db%`,vT),VE=h(50,e=>BE(e,e.an&&e.u?0:1)),HE=M(49,VE),UE=M(51,sE),WE=M(57,AE),GE=e=>{WE(e,(e.a7||e.a8).replace(/^origin\//,``))},KE=M(58,AE),qE=e=>{KE(e,(e.a9||e.aa).replace(/^origin\//,``))},JE=e=>{T(e.a,`data-pr`,e.a6?`${e.ad}/${e.a6.number}`:void 0)},YE=M(15,e=>{hE(e,e.p),GE(e),qE(e),JE(e)}),XE=y(mT),ZE=M(53,e=>{AE(e),OT(e),XE(e)}),QE=M(54,kT),$E=M(55,AT),eD=M(56,jT),tD=M(16,e=>{yE(e),AE(e),eE(e)}),nD=M(17,e=>{yE(e),nE(e)});function rD(e){b(e.a,`_jL`),b(e.h,`_jM`)}var iD=M(20,e=>{c(e.i,e.u),c(e.j,e.u===1?``:`s`),VE(e)}),aD=d(6,`<span>local <!><!></span>`,` Db%b%`,tE),oD=(e,t)=>aD(e,+!t),sD=d(10,`<span>+<!></span><span>−<!></span>`,` Db%l Db%`,ZT),cD=h(24,e=>sD(e,e.w||e.x?0:1)),lD=M(22,e=>{cD(e),XT(e)}),uD=M(23,e=>{cD(e),QT(e)}),dD=d(11,`<button type=button title="Filtered out of the list — show every file"><!> hidden</button>`,` D%`,YT),fD=M(25,e=>{dD(e,+!e.z),qT(e)}),pD=d(12,`<button type=button><!> new</button>`,` D%`,GT),mD=h(29,e=>pD(e,e.a1||e.a2?0:1)),hD=M(27,e=>{mD(e),UT(e)}),gD=M(28,e=>{mD(e),KT(e)}),_D=M(18,cE),vD=M(19),yD=M(26),bD=M(30),xD=`<!><!><!>`,SD=f(1,0,e=>c(e.b,e._.e)),CD=e=>{SD._(e),b(e.a,[uT,`_jC`])},wD=f(6,0,e=>c(e.b,e._.r)),TD=e=>{wD._(e),b(e.a,[`_u`,`_v`,`_jH`])},ED=j(34,e=>gD(e.c,e._._.k),e=>e._._),DD=e=>{ED(e),OD(e),kD(e),AD(e),jD(e),ND(e),PD(e),FD(e),LD(e),zD(e),BD(e),VD(e),HD(e),UD(e),GD(e),b(e.a,`_jI`),rD(e.c)},OD=j(35,e=>bD(e.c,e._._.l),e=>e._._),kD=j(36,e=>yD(e.c,e._._.m),e=>e._._),AD=j(37,e=>tD(e.c,e._._.n),e=>e._._),jD=j(38,e=>nD(e.c,e._._.o),e=>e._._),MD=h(9,e=>oD(e.c,e._._.p.has(e.i))),ND=j(39,MD,e=>e._._),PD=j(40,e=>vD(e.c,e._._.q),e=>e._._),FD=j(41,e=>_D(e.c,e._._.r),e=>e._._),ID=(e,t)=>{YE(e.c,t),KD(e,t?.worktree),qD(e,t?.files?.length),JD(e,t?.id)},LD=j(43,e=>ID(e,e._._.t),e=>e._._),RD=h(7,e=>iD(e.c,e._._.v||e.g)),zD=j(45,RD,e=>e._._),BD=j(46,e=>lD(e.c,e._._.w),e=>e._._),VD=j(47,e=>uD(e.c,e._._.x),e=>e._._),HD=j(48,e=>hD(e.c,e._._.y),e=>e._._),UD=j(49,e=>fD(e.c,e._._.z),e=>e._._),WD=d(1,`<span> </span>`,` D `,CD),GD=j(50,e=>WD(e,+!!e._._.a0),e=>e._._),KD=M(4,SD),qD=M(6,RD),JD=M(8,MD),YD=h(20,e=>b(e.a,[`_jB`,{_jz:e.s,_jA:e.t}])),XD=M(19,e=>{T(e.b,`title`,e.t?`Show this section's files`:`Hide this section's files`),T(e.b,`aria-expanded`,e.t?`false`:`true`),YD(e)}),ZD=h(12,e=>XD(e,e._._._.h.has(e.l))),QD=j(33,ZD,e=>e._._._),$D=e=>{QD(e),nO(e),b(e.b,`_jE`),b(e.c,`_jF`),b(e.d,`_jD`),b(e.e,uT)},eO=M(18,e=>{T(e.a,`aria-selected`,e.s?`true`:`false`),YD(e)}),tO=h(13,e=>eO(e,e._._._.u===e.l)),nO=j(44,tO,e=>e._._._),rO=(e,t)=>{aO(e,t?.id),cO(e,t?.pr),uO(e,t?.worktree)},iO=_(`y1`,e=>{u(e.b,`click`,function(){e._._._.i(e.l)}),u(e.d,`click`,function(){e._._._.j(e.l)})}),aO=M(11,e=>{tO(e),ZD(e),iO(e)}),oO=d(6,`<span>#<!></span>`,` Db%`,TD),sO=h(16,e=>T(e.a,`data-pr`,e.o?`${e.p}/${e.o.number}`:void 0)),cO=M(14,e=>{lO(e,e.o?.number),oO(e,+!e.o),sO(e)}),lO=M(17,wD),uO=M(15,e=>{c(e.f,e.p),sO(e)}),dO=rO,fO=a(0,`<div role=tab><button type=button><span>▾</span></button><button type=button title="Scroll to this section"><span> </span><!></button></div>`,` D D l D D l%`,$D,(e,t)=>dO(e,t[0]?.repo)),pO=j(31,e=>fO(e,[e._._.d,e=>e.repo.id]),e=>e._._),mO=_(`y3`,e=>u(e.a,`scroll`,function(){e._._.a4(e.a)})),hO=e=>{pO(e),vO(e),bO(e),xO(e),SO(e),mO(e)},gO=_(`y2`,e=>l(e,{count:e._._.g,onMount:function(){e._._.a4(e.a);let t=new ResizeObserver(()=>e._._.a4(e.a));return t.observe(e.a),{ro:t}},onUpdate:function(){e._._.a4(e.a)},onDestroy:function(){this.ro.disconnect()}})),_O=h(1,gO),vO=j(32,_O,e=>e._._),yO=h(2,e=>b(e.a,[`_jy`,{_jx:e._._.a2,_jw:e._._.a3}])),bO=j(51,yO,e=>e._._),xO=j(52,yO,e=>e._._),SO=j(53,_O,e=>e._._),CO=d(2,(e=>`<div><!>${e}</div>`)(fT),(e=>` D%b/${e}&l`)(pT),DD),wO=f(0,0,e=>CO(e,+!e._.s)),TO=e=>{wO._(e),DO._(e)},EO=d(1,`<div role=tablist></div>`,` `,hO),DO=f(0,0,e=>{b(e.a,[`_jv`,{_ju:e._.a0}]),EO(e,+!e._.a0)}),OO=M(18,e=>{AO(e,e.s?.repo),MO(e,e.s?.files),NO(e,e.s?.additions),PO(e,e.s?.deletions),FO(e,e.s?.fresh),IO(e,e.s?.hidden),wO(e)}),kO=y(LD),AO=M(19,e=>{jO(e,e.t?.id),kO(e)}),jO=M(20,y(nO)),MO=M(21,y(zD)),NO=M(22,y(BD)),PO=M(23,y(VD)),FO=M(24,y(HD)),IO=M(25,y(UD)),LO=h(5,e=>OO(e,e.d.find(t=>t.repo.id===e.e)||e.d[0])),RO=y(pO),zO=M(3,e=>{GO(e,e.d?.length),LO(e),RO(e)}),BO=M(4,LO),VO=y(GD),HO=M(26,e=>{DO(e),VO(e)}),UO=d(0,`<div><!><!></div>`,` D%b%`,TO),WO=y(vO),GO=M(6,e=>{HO(e,e.g>1),UO(e,+!e.g),WO(e)}),KO=M(30,y(SO)),qO=e=>{KO(e,lk(e))},JO=m(27,e=>{YO(e,e.a1?.end),XO(e,e.a1?.start),qO(e)}),YO=M(28,y(bO)),XO=M(29,y(xO));function ZO(e){JO(e,{start:!1,end:!1})}var QO=M(7,y(QD)),$O=M(8),ek=M(9),tk=M(10,y(ED)),nk=M(11,y(OD)),rk=M(12,y(kD)),ik=M(13,y(AD)),ak=M(14,y(jD)),ok=M(15,y(ND)),sk=M(16,y(PD)),ck=M(17,y(FD)),lk=e=>t=>{let n=t.scrollWidth-t.clientWidth-t.scrollLeft>1,r=t.scrollLeft>1;(n!==e.a2||r!==e.a3)&&JO(e,{start:r,end:n})};N(`y0`,lk);var uk=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
1533
1533
|
<symbol id="file-tree-icon-chevron" viewBox="0 0 16 16">
|
|
1534
1534
|
<path d="M12.4697 5.46973C12.7626 5.17684 13.2374 5.17684 13.5303 5.46973C13.8232 5.76262 13.8232 6.23738 13.5303 6.53028L8.53028 11.5303C8.23738 11.8232 7.76262 11.8232 7.46973 11.5303L2.46973 6.53028C2.17684 6.23738 2.17684 5.76262 2.46973 5.46973C2.76262 5.17684 3.23738 5.17684 3.53028 5.46973L8 9.93946L12.4697 5.46973Z" fill="currentcolor"/>
|
|
1535
1535
|
</symbol>
|
|
@@ -1546,72 +1546,72 @@ diff --git`)}function m_(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.star
|
|
|
1546
1546
|
<symbol id="file-tree-icon-ellipsis" viewBox="0 0 16 16">
|
|
1547
1547
|
<path d="M5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M9.5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M14 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0" />
|
|
1548
1548
|
</symbol>
|
|
1549
|
-
</svg>`,
|
|
1549
|
+
</svg>`,dk=`<symbol id="file-tree-builtin-astro" viewBox="0 0 16 16">
|
|
1550
1550
|
<path fill="currentColor" d="M6.08 13.92c-.63-.57-.81-1.79-.55-2.67.45.56 1.08.73 1.73.83 1 .15 1.99.1 2.92-.37l.32-.19q.13.38.08.78a2.1 2.1 0 0 1-.9 1.5q-.3.24-.61.43c-.64.44-.81.95-.57 1.69l.02.08a1.7 1.7 0 0 1-.74-.64 2 2 0 0 1-.3-.98q0-.27-.02-.52-.07-.61-.61-.62a.7.7 0 0 0-.75.6z" class="bg" opacity=".6"/>
|
|
1551
1551
|
<path fill="currentColor" d="M2.5 11.1s1.86-.9 3.72-.9l1.4-4.39c.05-.21.2-.36.38-.36s.33.15.38.36l1.4 4.38c2.2 0 3.72.92 3.72.92l-3.16-8.69q-.13-.4-.45-.42H6.11q-.3.02-.45.42z" class="fg"/>
|
|
1552
|
-
</symbol>`,
|
|
1552
|
+
</symbol>`,fk=`<symbol id="file-tree-builtin-babel" viewBox="0 0 16 16">
|
|
1553
1553
|
<path fill="currentColor" fill-rule="evenodd" d="M9.49.5q1.92.05 2.66.54 1.27.6 1.35 1.52v.23a4 4 0 0 1-.53 1.9l-1.38 1.24q-.74.38-.72.63c.77.82 1.33 1.29.85 2.42q-.47 1.1-2.04 2.28c-.5.32-1.88 1.35-2.96 1.86-1.64.77-3.1 1.4-4.65 1.89-.51.16-1.5.16-1.5.16L.5 15A76 76 0 0 0 5.76 3.49q-.1-.08-.1-.2.1 0 .32-.35l-.03-.09q-1.17.39-2.38 1.3l-.13.03q0-.1-.21-.16-.46.31-.82.7l-.13-.19.16-.06-.03-.16-.34.29L2 4.5q.36-.48.72-.54l.04-.1V3.8q.16 0 .15-.06l.13-.06a6 6 0 0 0 1.13-.9v-.03H4.1l-.12.07q0-.1-.1-.1l-.15.07-.04-.1q.93-.52 1.63-1.05Q7.89.65 9.5.5M8.46 7.83l-.32.04c-1.31.54-2.31.82-2.91.88a71 71 0 0 0-2.2 4.54h.07q.58-.04 3.04-1.42.13 0 1.66-1.05L9.18 9.7v.03q.45-.2.81-1.3v-.2q-.5-.46-1.53-.4m.28-5.75c-.5.1-.75.19-.72.38l-1.16 2.6q-.17.1-.34.95-.3.48-.25.77v.1l.22.05A15 15 0 0 1 8.86 6c1.1-.71 2.12-1.38 2.8-2.54q.24-.33.21-.54-.02-.33-.4-.54c-.54 0-1.07-.34-1.63-.28l-.94-.03z" clip-rule="evenodd"/>
|
|
1554
|
-
</symbol>`,
|
|
1554
|
+
</symbol>`,pk=`<symbol id="file-tree-builtin-bash" viewBox="0 0 16 16">
|
|
1555
1555
|
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
1556
1556
|
<path fill="currentColor" d="M11.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zM7 6.75C7 6.42 6.64 6 6 6s-1 .42-1 .75q-.01.25.22.41.26.21.89.35.74.14 1.28.53c.37.29.61.7.61 1.21 0 .87-.68 1.5-1.5 1.7v.55a.5.5 0 0 1-1 0v-.56c-.82-.18-1.5-.82-1.5-1.69a.5.5 0 0 1 1 0c0 .33.36.75 1 .75s1-.42 1-.75q.01-.25-.22-.41a2 2 0 0 0-.89-.35q-.74-.14-1.28-.53A1.5 1.5 0 0 1 4 6.75c0-.87.68-1.5 1.5-1.7V4.5a.5.5 0 0 1 1 0v.56c.82.18 1.5.82 1.5 1.69a.5.5 0 0 1-1 0" class="fg-stroke"/>
|
|
1557
|
-
</symbol>`,
|
|
1557
|
+
</symbol>`,mk=`<symbol id="file-tree-builtin-biome" viewBox="0 0 16 16">
|
|
1558
1558
|
<path fill="currentColor" d="M8 2 4.88 7.35a7 7 0 0 1 3.7-.13l1.04.25-.99 4.16-1.05-.25a2.7 2.7 0 0 0-3.07 1.45l-.98-.47a4 4 0 0 1 1.07-1.31 3.8 3.8 0 0 1 3.23-.71l.5-2.08a6 6 0 0 0-5.07 1.12A5.9 5.9 0 0 0 1 14h14z"/>
|
|
1559
|
-
</symbol>`,
|
|
1559
|
+
</symbol>`,hk=`<symbol id="file-tree-builtin-bootstrap" viewBox="0 0 16 16">
|
|
1560
1560
|
<path fill="currentColor" fill-rule="evenodd" d="M11.72 1.5A2.5 2.5 0 0 1 14.2 4q.02 1.08.3 2.09c.22.73.56 1.24 1.08 1.45.22.08.4.27.4.5s-.18.43-.4.51q-.76.34-1.08 1.45c-.2.65-.27 1.32-.3 2a2.5 2.5 0 0 1-2.48 2.5H4.25A2.6 2.6 0 0 1 1.7 12c-.04-.85-.1-1.68-.22-2.04C1.26 9.23.92 8.7.4 8.5.18 8.42 0 8.23 0 8s.18-.42.4-.5q.77-.35 1.09-1.46c.1-.36.17-1.19.2-2.04a2.6 2.6 0 0 1 2.56-2.5z" class="bg" clip-rule="evenodd" opacity=".2"/>
|
|
1561
1561
|
<path fill="currentColor" fill-rule="evenodd" d="M8.47 4.54c1.23 0 2.04.68 2.04 1.73 0 .73-.55 1.39-1.24 1.5v.04c.94.1 1.58.77 1.58 1.7 0 1.2-.9 1.95-2.37 1.95H5.97a.3.3 0 0 1-.2-.08.3.3 0 0 1-.08-.2V4.82a.3.3 0 0 1 .08-.2.3.3 0 0 1 .2-.08zm-1.7 6.04h1.49q1.47-.01 1.49-1.15Q9.74 8.31 8.2 8.3H6.77zm0-5.16v2.06h1.21c.93 0 1.45-.38 1.45-1.06 0-.65-.44-1-1.22-1z" class="fg" clip-rule="evenodd"/>
|
|
1562
|
-
</symbol>`,
|
|
1562
|
+
</symbol>`,gk=`<symbol id="file-tree-builtin-browserslist" viewBox="0 0 16 16">
|
|
1563
1563
|
<path fill="currentColor" d="M8.88 6.96c0 3.82 3.72 4.7 5.7 3.74-.23.9-1.04 1.67-2.35 1.93-.02.4.42 1.28.82 1.63-.9.35-1.94-.12-2.51-.48a5 5 0 0 0-.32 1.87c-.68 0-1.57-1-1.8-1.37-.3.18-.85 1.15-.96 1.72a2.4 2.4 0 0 1-.81-.86 2.4 2.4 0 0 1-.3-1.15c-.38.27-1.48.95-1.99 1.18-.25-.58-.15-1.3 0-2.06-.21.12-1.8.27-2.43.12.32-.36.75-1.19.94-1.57A4.5 4.5 0 0 1 .44 10.6c.48-.22.97-.53 1.49-1.06C1.26 9.17.24 8.64 0 7.7a6 6 0 0 0 1.79-.32C1.28 7.08.44 6.15.6 5.01c.42.21 1.3.37 1.73.3a3.4 3.4 0 0 1-.25-2.75 5 5 0 0 0 1.48 1c-.08-.8.3-2.31.8-2.71.2.46.73 1.21 1.08 1.4.09-.61.87-2.06 1.57-2.25 0 .5.27 1.4.5 1.67.51-.54 2.25-1.44 3.64-1.13-.43.45-.75.61-.86.98 1.05 0 2.78.34 4.27 1.93-2.34-.89-5.69.56-5.69 3.5" class="bg" opacity=".5"/>
|
|
1564
1564
|
<path fill="currentColor" d="M11.21 3.59a4.1 4.1 0 0 0 2.47 2.89c.24-.22.61-.38.95-.19.76.44.2 1.26-.34 1.66l-.07.06a13 13 0 0 1-4.49 1.61l-.3-.43a10.5 10.5 0 0 0 4.13-1.31 1 1 0 0 0 .23-.25.5.5 0 0 0-.21-.69l-.15-.06a4.5 4.5 0 0 1-1.77-1.31 4.5 4.5 0 0 1-.88-1.77q.2-.12.43-.21"/>
|
|
1565
1565
|
<path fill="currentColor" d="M10.36 5.18a.4.4 0 0 0-.03.38c.09.2.3.3.46.23s.24-.3.15-.5l-.01-.02q.23.13.34.39a.83.83 0 0 1-.43 1.08.8.8 0 0 1-1.08-.43.83.83 0 0 1 .6-1.13"/>
|
|
1566
|
-
</symbol>`,
|
|
1566
|
+
</symbol>`,_k=`<symbol id="file-tree-builtin-bun" viewBox="0 0 16 16">
|
|
1567
1567
|
<path fill="currentColor" d="M8 14c3.87 0 7-2.46 7-5.49 0-1.88-1.2-3.53-3.04-4.52q-1.1-.61-1.84-1.07C9.2 2.35 8.64 2 8 2s-1.36.45-2.31 1.03A29 29 0 0 1 4.04 4C2.2 4.98 1 6.63 1 8.51 1 11.54 4.13 14 8 14M7.18 3.88q.3-.66.3-1.37c0-.08.11-.1.13-.01.38 1.57-.53 2.35-1.2 2.61-.08.03-.12-.07-.06-.12a3 3 0 0 0 .83-1.12m1.2-.05a3 3 0 0 0-.45-1.3V2.5c-.04-.07.05-.15.1-.1 1.15 1.2.77 2.3.33 2.87-.05.05-.13 0-.11-.08q.21-.67.13-1.37m1.04-.32a3 3 0 0 0-.94-1.02v-.01c-.06-.05-.01-.16.07-.12 1.51.61 1.61 1.8 1.43 2.5l-.03.03a.07.07 0 0 1-.1-.06 3 3 0 0 0-.43-1.32m-2.97.32c-.36.3-.74.43-1.2.56q-.11 0-.1-.1a3.5 3.5 0 0 0 1.76-1.57s.09-.07.1.04c0 .18-.2.76-.56 1.07m2.89 6.36q-.13.52-.55.88a1.3 1.3 0 0 1-.75.35 1.3 1.3 0 0 1-.77-.35 1.7 1.7 0 0 1-.54-.88.13.13 0 0 1 .15-.15h2.31a.14.14 0 0 1 .15.15M6.15 8.95a1.1 1.1 0 0 1-1.39-.14A1.1 1.1 0 0 1 5.12 7a1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1-.17 1.69m4.96 0a1.1 1.1 0 0 1-1.4-.14 1.1 1.1 0 0 1 .37-1.8 1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1 .24 1.2 1 1 0 0 1-.41.5"/>
|
|
1568
|
-
</symbol>`,
|
|
1568
|
+
</symbol>`,vk=`<symbol id="file-tree-builtin-c" viewBox="0 0 16 16">
|
|
1569
1569
|
<path fill="currentColor" fill-rule="evenodd" d="M8 1q.084 0 .166.021.098.023.186.075c1.055.624 4.22 2.486 5.277 3.11.085.05.15.112.209.192h-.002l.028.037a.5.5 0 0 1 .103.21q.031.102.033.21v6.29a.71.71 0 0 1-.347.616l-5.307 3.144a.68.68 0 0 1-.693 0l-5.307-3.144A.72.72 0 0 1 2 11.145V4.832a.71.71 0 0 1 .346-.612l5.288-3.126A.7.7 0 0 1 7.992 1zm2.901 4.349a3.75 3.75 0 1 0 0 5.302l-1.06-1.06a2.25 2.25 0 1 1 0-3.182z" clip-rule="evenodd"/>
|
|
1570
|
-
</symbol>`,
|
|
1570
|
+
</symbol>`,yk=`<symbol id="file-tree-builtin-claude" viewBox="0 0 16 16">
|
|
1571
1571
|
<path fill="currentColor" d="M3.75 10.31 6.5 8.77l.04-.14-.04-.07h-.14l-.46-.03-1.57-.04-1.38-.07-1.33-.07-.34-.07L1 7.86l.03-.21.28-.18.4.03.89.07 1.33.08.97.06 1.43.16h.22l.03-.1-.07-.05-.06-.06-1.39-.92-1.48-.98-.79-.57-.42-.28-.2-.28-.1-.6.39-.41.52.04.12.03.52.4 1.12.86L6.2 6.04l.2.17.09-.06.01-.04-.1-.15-.76-1.46-.85-1.46-.37-.6-.1-.36a1 1 0 0 1-.06-.42l.42-.59.25-.07.6.08.22.2.36.84.58 1.3.9 1.77.29.53.14.47.04.14h.1v-.07l.07-1 .14-1.22.14-1.57.04-.45.23-.53.42-.28.36.15.28.41-.04.25-.16 1.08-.36 1.7-.21 1.14h.12l.14-.15.58-.76.97-1.2.42-.5.5-.51.32-.25h.6l.44.66-.2.68-.61.79-.52.65-.74 1-.45.8.04.05h.1l1.68-.36.9-.16 1.06-.18.5.23.05.22-.2.48-1.15.28-1.34.28-2 .46-.04.01.03.04.9.09.4.03h.94l1.77.14.46.28.27.37-.04.28-.72.37-.95-.23-2.24-.53-.76-.18h-.11v.06l.64.63L12 10.86l1.48 1.35.07.34-.18.28-.2-.03-1.29-.98-.5-.42-1.12-.95h-.07v.1l.25.38 1.37 2.05.07.63-.1.2-.36.14-.38-.08-.8-1.12-.85-1.26-.66-1.15-.07.05-.4 4.23-.19.21-.42.17-.35-.28-.2-.42.2-.87.23-1.12.18-.9.17-1.1.1-.36v-.03h-.1l-.84 1.16-1.27 1.72-1 1.07-.24.1-.42-.22.04-.39.22-.32 1.4-1.8.84-1.1.57-.64-.02-.07h-.04l-3.7 2.4-.66.09-.28-.28.03-.42.14-.14 1.12-.77z"/>
|
|
1572
|
-
</symbol>`,
|
|
1572
|
+
</symbol>`,bk=`<symbol id="file-tree-builtin-cpp" viewBox="0 0 16 16">
|
|
1573
1573
|
<path fill="currentColor" fill-rule="evenodd" d="M8 1q.084 0 .166.021.098.023.186.075c1.055.624 4.22 2.486 5.277 3.11.085.05.15.112.209.192h-.002l.028.037a.5.5 0 0 1 .103.21q.031.102.033.21v6.29a.71.71 0 0 1-.347.616l-5.307 3.144a.68.68 0 0 1-.693 0l-5.307-3.144A.72.72 0 0 1 2 11.145V4.832a.71.71 0 0 1 .346-.612l5.288-3.126A.7.7 0 0 1 7.992 1zm2.901 4.349a3.75 3.75 0 1 0 0 5.302l-1.06-1.06a2.25 2.25 0 1 1 0-3.182z" clip-rule="evenodd"/>
|
|
1574
|
-
</symbol>`,
|
|
1574
|
+
</symbol>`,xk=`<symbol id="file-tree-builtin-css" viewBox="0 0 16 16">
|
|
1575
1575
|
<path fill="currentColor" d="M8 15c-5.76 0-7-1.24-7-7V2a1 1 0 0 1 1-1h6c5.77 0 7 1.24 7 7s-1.24 7-7 7" class="vector" opacity=".2"/>
|
|
1576
1576
|
<path fill="currentColor" d="M10.1 9.19h.73c.03.49.22.6 1 .6.76 0 .93-.12.93-.68 0-.52-.17-.67-.94-.85-1.38-.3-1.68-.56-1.68-1.47 0-1.05.3-1.29 1.67-1.29 1.29 0 1.57.2 1.6 1.13h-.74c-.01-.34-.17-.42-.85-.42-.77 0-.94.1-.94.58 0 .42.17.55.96.73 1.36.3 1.66.58 1.66 1.59 0 1.14-.31 1.39-1.73 1.39-1.39 0-1.69-.24-1.67-1.31m-3.9 0h.74c.03.49.21.6.99.6.76 0 .93-.12.93-.68 0-.52-.17-.67-.93-.85-1.39-.3-1.69-.56-1.69-1.47 0-1.05.3-1.29 1.67-1.29 1.3 0 1.58.2 1.6 1.13h-.73c-.02-.34-.18-.42-.85-.42-.78 0-.95.1-.95.58 0 .42.17.55.96.73 1.37.3 1.67.58 1.67 1.59 0 1.14-.32 1.39-1.74 1.39-1.38 0-1.68-.24-1.66-1.31m-1.22 0h.75c-.09 1.07-.37 1.31-1.56 1.31-1.37 0-1.68-.45-1.68-2.5 0-1.96.36-2.5 1.68-2.5 1.16 0 1.44.25 1.52 1.35h-.76c-.08-.52-.22-.64-.76-.64-.74 0-.9.33-.9 1.78 0 1.47.16 1.8.9 1.8.58 0 .74-.11.8-.6"/>
|
|
1577
|
-
</symbol>`,
|
|
1577
|
+
</symbol>`,Sk=`<symbol id="file-tree-builtin-database" viewBox="0 0 16 16">
|
|
1578
1578
|
<path fill="currentColor" d="M14.953 9.733a12.4 12.4 0 0 1-.244 1.936c-.207.933-.532 1.58-.996 2.044s-1.11.789-2.044.996C10.73 14.918 9.533 15 8 15s-2.73-.082-3.669-.291c-.933-.207-1.58-.532-2.044-.996s-.789-1.11-.996-2.044c-.122-.547-.2-1.182-.244-1.92q.23.364.532.667c.64.639 1.482 1.031 2.533 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265a4 4 0 0 0 .541-.683"/>
|
|
1579
1579
|
<path fill="currentColor" d="M14.93 5.924c-.046.663-.118 1.24-.23 1.743-.207.932-.532 1.579-.995 2.042s-1.11.789-2.042.996c-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997s-.789-1.11-.996-2.042a12 12 0 0 1-.227-1.683l.016-.188a4 4 0 0 0 .5.62c.638.639 1.48 1.031 2.532 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265.192-.192.357-.404.506-.633z"/>
|
|
1580
1580
|
<path fill="currentColor" d="M8 1c1.533 0 2.73.082 3.669.291.933.207 1.58.533 2.044.996.403.404.904.944.91 1.695.004.764-.509 1.318-.918 1.727-.463.463-1.11.789-2.042.996-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997-.406-.406-.915-.953-.915-1.71 0-.758.509-1.305.915-1.712.464-.463 1.11-.789 2.044-.996C5.27 1.082 6.467 1 8 1"/>
|
|
1581
|
-
</symbol>`,
|
|
1581
|
+
</symbol>`,Ck=`<symbol id="file-tree-builtin-default" viewBox="0 0 16 16">
|
|
1582
1582
|
<path fill="currentColor" d="M8 1v3a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1z" class="bg" opacity=".4"/>
|
|
1583
1583
|
<path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
|
|
1584
|
-
</symbol>`,
|
|
1584
|
+
</symbol>`,wk=`<symbol id="file-tree-builtin-docker" viewBox="0 0 16 16">
|
|
1585
1585
|
<path fill="currentColor" d="M15.85 6.54c-.05-.04-.45-.36-1.31-.36q-.34 0-.68.06a2.7 2.7 0 0 0-1.14-1.79l-.23-.14-.15.23a3 3 0 0 0-.4 1q-.24 1.01.26 1.84c-.4.24-1.03.3-1.17.3H.5a.5.5 0 0 0-.5.52q-.01 1.46.46 2.83.55 1.5 1.6 2.18c.79.5 2.08.79 3.54.79q.96 0 1.94-.18a8 8 0 0 0 2.55-.97 7 7 0 0 0 1.73-1.5 10 10 0 0 0 1.7-3.06h.15a2.4 2.4 0 0 0 1.8-.7 2 2 0 0 0 .47-.74l.06-.2z"/>
|
|
1586
1586
|
<path fill="currentColor" d="M1.48 7.36h1.4a.14.14 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H1.48a.13.13 0 0 0-.13.14v1.32q.02.13.13.13m1.94 0h1.41a.14.14 0 0 0 .13-.13V5.91q-.01-.12-.13-.14h-1.4a.13.13 0 0 0-.13.14v1.32q0 .13.12.13m1.98 0h1.4q.13 0 .14-.13V5.91a.13.13 0 0 0-.14-.14H5.4q-.1.01-.12.14v1.32q0 .13.12.13m1.95 0h1.42q.1 0 .12-.13V5.91q0-.12-.12-.14H7.35q-.1.01-.12.14v1.32q.01.13.12.13M3.42 5.5h1.41c.07 0 .13-.08.13-.15V4.03a.13.13 0 0 0-.13-.14h-1.4q-.12 0-.13.14v1.31q0 .13.12.15m1.98 0h1.4c.08 0 .14-.08.14-.15V4.03q0-.13-.14-.14H5.4q-.1 0-.12.14v1.31q0 .13.12.15m1.95 0h1.42c.06 0 .12-.08.12-.15V4.03q-.01-.13-.12-.14H7.35q-.1 0-.12.14v1.31q.01.13.12.15m0-1.9h1.42q.1-.02.12-.14v-1.3Q8.88 2 8.77 2H7.35q-.1 0-.12.14v1.3q.01.13.12.14m1.97 3.78h1.4a.13.13 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H9.32q-.1.01-.12.14v1.32q.01.13.12.13" opacity=".5"/>
|
|
1587
|
-
</symbol>`,
|
|
1587
|
+
</symbol>`,Tk=`<symbol id="file-tree-builtin-eslint" viewBox="0 0 16 16">
|
|
1588
1588
|
<path fill="currentColor" d="M11.16 6.1 8.12 4.35a.3.3 0 0 0-.24 0L4.84 6.1a.3.3 0 0 0-.12.2v3.5q0 .14.12.22l3.04 1.74q.12.08.24 0l3.04-1.74a.2.2 0 0 0 .13-.22V6.3a.3.3 0 0 0-.13-.2" opacity=".5"/>
|
|
1589
1589
|
<path fill="currentColor" d="m.1 7.69 3.63-6.3A.8.8 0 0 1 4.37 1h7.26c.26 0 .5.17.64.4l3.63 6.27a.8.8 0 0 1 0 .75l-3.63 6.24a.7.7 0 0 1-.64.34H4.37a.7.7 0 0 1-.64-.34L.1 8.41a.7.7 0 0 1 0-.72m3 3.02q.01.15.14.23l4.63 2.66q.13.06.26 0l4.63-2.66a.3.3 0 0 0 .14-.23V5.4a.3.3 0 0 0-.14-.23L8.13 2.52a.3.3 0 0 0-.26 0L3.24 5.17a.3.3 0 0 0-.14.23z"/>
|
|
1590
|
-
</symbol>`,
|
|
1590
|
+
</symbol>`,Ek=`<symbol id="file-tree-builtin-font" viewBox="0 0 16 16">
|
|
1591
1591
|
<path fill="currentColor" d="M12.3 13c-1.59 0-2.68-.99-2.68-2.5 0-1.43 1-2.34 2.88-2.35h2.16v-.83c0-1.08-.62-1.68-1.73-1.68-1.05 0-1.66.54-1.73 1.36H9.93c.09-1.43 1.06-2.48 3.05-2.48 1.75 0 3.02.95 3.02 2.68v5.66h-1.29v-1.02h-.04c-.41.66-1.16 1.16-2.37 1.16m.36-1.12c1.14 0 2-.72 2-1.74v-.96H12.6c-1.12 0-1.6.54-1.6 1.28 0 .97.8 1.42 1.66 1.42m-11.24.98H0L3.8 2h1.39l3.8 10.86H7.54l-1.08-3.2H2.5zm3.09-9.25h-.04l-1.6 4.95H6.1z"/>
|
|
1592
|
-
</symbol>`,
|
|
1592
|
+
</symbol>`,Dk=`<symbol id="file-tree-builtin-git" viewBox="0 0 16 16">
|
|
1593
1593
|
<path fill="currentColor" d="M14.74 7.38 8.62 1.26a.9.9 0 0 0-1.27 0L6.08 2.53l1.61 1.61a1.07 1.07 0 0 1 1.36 1.37l1.55 1.55a1.07 1.07 0 0 1 1.1 1.77 1.07 1.07 0 0 1-1.74-1.16L8.5 6.22v3.8a1.07 1.07 0 1 1-.89-.02V6.15a1.07 1.07 0 0 1-.58-1.4l-1.58-1.6-4.2 4.2a.9.9 0 0 0 0 1.27l6.12 6.12a.9.9 0 0 0 1.27 0l6.09-6.09a.9.9 0 0 0 0-1.27"/>
|
|
1594
|
-
</symbol>`,
|
|
1594
|
+
</symbol>`,Ok=`<symbol id="file-tree-builtin-go" viewBox="0 0 16 16">
|
|
1595
1595
|
<path fill="currentColor" fill-rule="evenodd" d="M4.41 4.57A3.2 3.2 0 0 1 6.87 5q.74.49 1.08 1.29.08.12-.1.16l-1.55.4c-.14.03-.15.04-.27-.1a1 1 0 0 0-.44-.34 1.6 1.6 0 0 0-1.68.14q-.95.61-.94 1.73c0 .73.52 1.33 1.25 1.43q.95.1 1.58-.6l.25-.34h-1.8c-.19 0-.24-.12-.17-.27.12-.28.34-.76.47-1a.3.3 0 0 1 .24-.14h2.98a4 4 0 0 1 .64-1.19 4 4 0 0 1 2.6-1.52 3.5 3.5 0 0 1 2.64.46q1.13.73 1.31 2.04a3.5 3.5 0 0 1-1.06 3.09q-.93.92-2.23 1.17l-.74.08a3.5 3.5 0 0 1-2.27-.8 3 3 0 0 1-.93-1.42 4 4 0 0 1-.39.61 4 4 0 0 1-2.64 1.56 3.3 3.3 0 0 1-2.5-.6 3 3 0 0 1-1.18-2.03 3.5 3.5 0 0 1 .8-2.67 4 4 0 0 1 2.6-1.58M13.1 7.5a1.53 1.53 0 0 0-1.9-1.21q-1.3.3-1.62 1.59a1.5 1.5 0 0 0 .85 1.72q.77.33 1.52-.05a2 2 0 0 0 1.18-1.74q0-.17-.03-.3" clip-rule="evenodd"/>
|
|
1596
|
-
</symbol>`,
|
|
1596
|
+
</symbol>`,kk=`<symbol id="file-tree-builtin-graphql" viewBox="0 0 16 16">
|
|
1597
1597
|
<path fill="currentColor" fill-rule="evenodd" d="M8 1a1.25 1.25 0 0 1 1.18 1.65l2.8 1.61q.33-.25.77-.26a1.25 1.25 0 0 1 .48 2.4v3.2a1.25 1.25 0 1 1-1.25 2.13l-2.8 1.62A1.25 1.25 0 0 1 8 15a1.25 1.25 0 0 1-1.18-1.65l-2.8-1.62q-.33.26-.77.27a1.25 1.25 0 0 1-.48-2.4V6.4a1.25 1.25 0 1 1 1.25-2.14l2.8-1.61A1.25 1.25 0 0 1 8 1M4.44 11.14l-.06.13 2.75 1.58a1.25 1.25 0 0 1 1.74 0l2.74-1.58-.05-.13zm3.89-7.68a1.3 1.3 0 0 1-.66 0L4.03 9.77q.37.3.45.78h7.04q.08-.48.45-.78zM4.38 4.73a1.24 1.24 0 0 1-1.02 1.76v3.02l.13.01 3.67-6.35-.03-.02zm4.46-1.56 3.67 6.35.13-.01V6.49a1.25 1.25 0 0 1-1.03-1.76L8.87 3.15z" clip-rule="evenodd"/>
|
|
1598
|
-
</symbol>`,
|
|
1598
|
+
</symbol>`,Ak=`<symbol id="file-tree-builtin-html" viewBox="0 0 16 16">
|
|
1599
1599
|
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
1600
1600
|
<path fill="currentColor" d="M10.48 3.76a.5.5 0 0 1 .4.58L10.6 5.8h1.14a.5.5 0 0 1 0 1h-1.32L10 9.2h1.08a.5.5 0 0 1 0 1H9.8l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H6.4l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H4.25a.5.5 0 0 1 0-1h1.32L6 6.8H4.93a.5.5 0 0 1 0-1H6.2l.3-1.64a.5.5 0 1 1 .98.18L7.2 5.8h2.4l.3-1.64a.5.5 0 0 1 .58-.4M6.58 9.2h2.4l.44-2.4h-2.4z" class="fg"/>
|
|
1601
|
-
</symbol>`,
|
|
1601
|
+
</symbol>`,jk=`<symbol id="file-tree-builtin-image" viewBox="0 0 16 16">
|
|
1602
1602
|
<path fill="currentColor" d="M12.5 2A2.5 2.5 0 0 1 15 4.5v4.67l-4.05-3.54-4.08 4.08-3-2L1 10.6V4.5A2.5 2.5 0 0 1 3.5 2z" opacity=".3"/>
|
|
1603
1603
|
<path fill="currentColor" d="M15 10.5v1a2.5 2.5 0 0 1-2.5 2.5h-9a2.5 2.5 0 0 1-2.46-2.04L4 9l3 2 4-4zm-7-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"/>
|
|
1604
|
-
</symbol>`,
|
|
1604
|
+
</symbol>`,Mk=`<symbol id="file-tree-builtin-javascript" viewBox="0 0 16 16">
|
|
1605
1605
|
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
1606
1606
|
<path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66M3.5 9.5h.98c0 .76.15.92.85.92.77 0 .94-.18.94-1.02V5.1h1v4.34c0 1.54-.35 1.87-1.92 1.87-1.55 0-1.89-.32-1.86-1.8"/>
|
|
1607
|
-
</symbol>`,
|
|
1607
|
+
</symbol>`,Nk=`<symbol id="file-tree-builtin-json" viewBox="0 0 16 16">
|
|
1608
1608
|
<path fill="currentColor" d="M13.25 11.5V9.75a.5.5 0 0 1 .36-.48l.55-.15a1.16 1.16 0 0 0 0-2.24l-.55-.15a.5.5 0 0 1-.36-.48V4.5a2.5 2.5 0 0 0-2.5-2.5h-.25a.5.5 0 0 0 0 1h.25a1.5 1.5 0 0 1 1.5 1.5v1.75a1.5 1.5 0 0 0 1.09 1.44l.54.15a.16.16 0 0 1 0 .32l-.54.15a1.5 1.5 0 0 0-1.09 1.44v1.75a1.5 1.5 0 0 1-1.5 1.5h-.25a.5.5 0 0 0 0 1h.25a2.5 2.5 0 0 0 2.5-2.5m-10.5 0V9.75a.5.5 0 0 0-.36-.48l-.55-.15a1.16 1.16 0 0 1 0-2.24l.55-.15a.5.5 0 0 0 .36-.48V4.5A2.5 2.5 0 0 1 5.25 2h.25a.5.5 0 0 1 0 1h-.25a1.5 1.5 0 0 0-1.5 1.5v1.75a1.5 1.5 0 0 1-1.09 1.44l-.54.15a.16.16 0 0 0 0 .32l.54.15a1.5 1.5 0 0 1 1.09 1.45v1.74a1.5 1.5 0 0 0 1.5 1.5h.25a.5.5 0 0 1 0 1h-.25a2.5 2.5 0 0 1-2.5-2.5"/>
|
|
1609
|
-
</symbol>`,
|
|
1609
|
+
</symbol>`,Pk=`<symbol id="file-tree-builtin-markdown" viewBox="0 0 16 16">
|
|
1610
1610
|
<path fill="currentColor" d="M1 12V4h2l2 2.5L7 4h2v8H7V7.5l-2 2-2-2V12zm9-3 3 3.5L16 9h-2V4h-2v5z"/>
|
|
1611
|
-
</symbol>`,
|
|
1611
|
+
</symbol>`,Fk=`<symbol id="file-tree-builtin-mcp" viewBox="0 0 16 16">
|
|
1612
1612
|
<path fill="currentColor" d="M9.26-.04a3 3 0 0 1 2 .82 2.8 2.8 0 0 1 .8 2.35 2.9 2.9 0 0 1 2.41.8l.03.02a2.74 2.74 0 0 1 0 3.94l-5.8 5.69-.04.06-.02.07q0 .04.02.07.01.04.04.06l1.2 1.17a.55.55 0 0 1 0 .79.6.6 0 0 1-.81 0l-1.2-1.17a1.3 1.3 0 0 1 0-1.84L13.7 7.1a1.65 1.65 0 0 0 .37-1.82 2 2 0 0 0-.37-.54l-.03-.03a1.73 1.73 0 0 0-2.4 0L6.47 9.4l-.07.06a.58.58 0 0 1-.92-.18.6.6 0 0 1 .12-.6l4.85-4.76a1.65 1.65 0 0 0 0-2.36 1.73 1.73 0 0 0-2.4 0l-6.43 6.3a.6.6 0 0 1-.8 0 .55.55 0 0 1 0-.8L7.25.79a3 3 0 0 1 2-.82"/>
|
|
1613
1613
|
<path fill="currentColor" d="M9.26 2.19a.6.6 0 0 1 .52.34.6.6 0 0 1 0 .43l-.12.18L4.9 7.79a1.65 1.65 0 0 0 0 2.36 1.73 1.73 0 0 0 2.4 0l4.75-4.66a.58.58 0 0 1 .93.18.6.6 0 0 1-.12.61l-4.75 4.66a2.9 2.9 0 0 1-4.01 0 2.75 2.75 0 0 1-.62-3.04A3 3 0 0 1 4.1 7l4.74-4.65a.6.6 0 0 1 .4-.16"/>
|
|
1614
|
-
</symbol>`,
|
|
1614
|
+
</symbol>`,Ik=`<symbol id="file-tree-builtin-nextjs" viewBox="0 0 16 16">
|
|
1615
1615
|
<defs>
|
|
1616
1616
|
<linearGradient id="a" x1="4.522" x2="14" y1="3.943" y2="16" gradientUnits="userSpaceOnUse">
|
|
1617
1617
|
<stop stop-color="currentColor"/>
|
|
@@ -1621,82 +1621,82 @@ diff --git`)}function m_(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.star
|
|
|
1621
1621
|
<path fill="currentColor" d="M3 2h1.522v9.09H3z"/>
|
|
1622
1622
|
<path fill="url(#a)" d="M4.903 2 15 15.075q-.565.5-1.195.925L4.522 3.943z"/>
|
|
1623
1623
|
<path fill="currentColor" d="M12.172 2h-1.508v9.094h1.508z"/>
|
|
1624
|
-
</symbol>`,
|
|
1624
|
+
</symbol>`,Lk=`<symbol id="file-tree-builtin-npm" viewBox="0 0 16 16">
|
|
1625
1625
|
<path fill="currentColor" d="M2 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z" class="vector" opacity=".2"/>
|
|
1626
1626
|
<path fill="currentColor" d="M10.5 13H13V3H3v10h5V5.5h2.5z"/>
|
|
1627
|
-
</symbol>`,
|
|
1627
|
+
</symbol>`,Rk=`<symbol id="file-tree-builtin-oxc" viewBox="0 0 16 16">
|
|
1628
1628
|
<path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .5.5V3h3.5a.5.5 0 0 1 .38.83L10.5 7.69v1.44q.41.04.95-.16a4 4 0 0 0 .72-.35l.04-.03h.01a.5.5 0 0 1 .67.1l2 2.5a.5.5 0 0 1 0 .62c-.76.96-3.14 2.69-6.89 2.69s-6.13-1.73-6.89-2.69a.5.5 0 0 1 0-.62l2-2.5a.5.5 0 0 1 .67-.1l.05.03.16.09q.22.13.56.26.54.2.95.16V7.69L2.12 3.83A.5.5 0 0 1 2.5 3H6V1.5a.5.5 0 0 1 .5-.5zM7 3.5a.5.5 0 0 1-.5.5H3.6l2.78 3.17a.5.5 0 0 1 .12.33v2a.5.5 0 0 1-.28.45c-.7.35-1.5.15-2.02-.05a5 5 0 0 1-.58-.26l-1.46 1.84c.82.78 2.8 2.02 5.84 2.02s5.02-1.24 5.84-2.02l-1.46-1.83a5 5 0 0 1-.58.26c-.52.2-1.33.39-2.02.04a.5.5 0 0 1-.28-.45v-2a.5.5 0 0 1 .12-.33L12.4 4H9.5a.5.5 0 0 1-.5-.5V2H7z"/>
|
|
1629
|
-
</symbol>`,
|
|
1629
|
+
</symbol>`,zk=`<symbol id="file-tree-builtin-postcss" viewBox="0 0 16 16">
|
|
1630
1630
|
<path fill="currentColor" d="M14.5 8a6.5 6.5 0 0 0-5.9-6.47l5.42 8.93A7 7 0 0 0 14.5 8M2.88 12A6.5 6.5 0 0 0 8 14.5c2.08 0 3.93-.98 5.12-2.5zm8.62-1h1.68L11.5 8.24zm-1-.55a4 4 0 0 1-.7.55h.7zM8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M5.5 11h.7a4 4 0 0 1-.7-.55zm-2.68 0H4.5V8.24zm3.76-6.2A4 4 0 0 1 8 4.5q.76 0 1.42.3L8 2.46zM1.5 8q0 1.31.48 2.46L7.4 1.53A6.5 6.5 0 0 0 1.5 8m14 0a7.5 7.5 0 0 1-.99 3.72l-.01.03-.02.03A7.5 7.5 0 0 1 8 15.5a7.5 7.5 0 0 1-6.5-3.75l-.01-.03A7.5 7.5 0 1 1 15.5 8"/>
|
|
1631
|
-
</symbol>`,
|
|
1631
|
+
</symbol>`,Bk=`<symbol id="file-tree-builtin-prettier" viewBox="0 0 16 16">
|
|
1632
1632
|
<path fill="currentColor" d="M6 12v1H4.93v-1zm1-2v1H2v-1zm6-4v1h-3V6zm-1-4v1H9V2z"/>
|
|
1633
1633
|
<path fill="currentColor" d="M11.5 10v1H8v-1zM5 6v1H2V6zm5-2v1H9V4z" opacity=".8"/>
|
|
1634
1634
|
<path fill="currentColor" d="M6 14v1H2v-1zm-.5-6v1H2V8zM13 4v1h-3V4zM4.93 2v1H2V2z" opacity=".6"/>
|
|
1635
1635
|
<path fill="currentColor" d="M4.93 12v1H2v-1zM13 8v1H9V8zM5.5 4v1H2V4zM9 2v1H4.93V2z" opacity=".4"/>
|
|
1636
|
-
</symbol>`,
|
|
1636
|
+
</symbol>`,Vk=`<symbol id="file-tree-builtin-python" viewBox="0 0 16 16">
|
|
1637
1637
|
<path fill="currentColor" d="M8.33 8.4H10c1.16 0 1.9-.73 1.9-1.86V5.08q0-.24.25-.24h.74c.75 0 1.33.32 1.66.97q.4.73.41 1.46c.09.9.09 1.78-.24 2.67-.25.73-.75 1.3-1.58 1.46h-4.8c-.08 0-.25 0-.25.08v.4s.17.09.25.09h2.82q.34-.02.33.32v1.06c0 .56-.25.97-.75 1.13-.41.16-.83.33-1.24.4a7 7 0 0 1-2.98-.07 3 3 0 0 1-1.16-.49c-.33-.32-.58-.65-.5-1.14v-2.91c0-1.13.67-1.78 1.82-1.78q.89-.1 1.66-.08m2.32 4.86a.65.65 0 0 0-.66-.65c-.34 0-.67.33-.67.65s.33.57.67.65a.65.65 0 0 0 .66-.65" class="bg" opacity=".8"/>
|
|
1638
1638
|
<path fill="currentColor" d="M7.67 7.6H6c-1.16 0-1.9.73-1.9 1.86v1.46q0 .24-.25.24h-.74c-.75 0-1.33-.32-1.66-.97a3 3 0 0 1-.41-1.46 6 6 0 0 1 .24-2.67c.25-.73.75-1.3 1.58-1.46h4.8c.08 0 .25 0 .25-.08v-.4s-.17-.09-.25-.09H4.85c-.24 0-.33-.08-.33-.32V2.65c0-.56.25-.97.75-1.13.41-.16.83-.33 1.24-.4a7 7 0 0 1 2.98.07c.41.09.83.25 1.16.49.33.32.58.65.5 1.13v2.92c0 1.14-.67 1.78-1.82 1.78-.58.08-1.16.08-1.66.08M5.35 2.73c0 .33.25.65.66.65.33 0 .66-.32.66-.65 0-.32-.33-.56-.66-.64a.65.65 0 0 0-.66.64" class="fg"/>
|
|
1639
|
-
</symbol>`,
|
|
1639
|
+
</symbol>`,Hk=`<symbol id="file-tree-builtin-react" viewBox="0 0 16 16">
|
|
1640
1640
|
<path fill="currentColor" d="M8 6.65c.73 0 1.31.6 1.31 1.35S8.73 9.35 8 9.35 6.69 8.75 6.69 8 7.27 6.65 8 6.65"/>
|
|
1641
1641
|
<path fill="currentColor" fill-rule="evenodd" d="M8 2.55c1.3-.99 2.59-1.34 3.5-.8.92.55 1.27 1.87 1.08 3.53C14.06 5.94 15 6.9 15 8s-.94 2.06-2.42 2.72c.19 1.65-.16 2.98-1.08 3.52-.91.55-2.2.2-3.5-.8-1.3 1-2.58 1.35-3.5.8-.91-.54-1.27-1.87-1.08-3.52C1.94 10.06 1 9.1 1 8s.94-2.06 2.42-2.72c-.19-1.66.17-2.98 1.08-3.52s2.2-.2 3.5.8M4.26 11.2c-.08 1.34.28 2.03.68 2.26s1.15.22 2.25-.52l.11-.09a12 12 0 0 1-1.24-1.39 11 11 0 0 1-1.8-.41zm7.47-.15q-.83.27-1.79.41-.6.8-1.24 1.4l.11.08c1.1.74 1.86.76 2.25.52.4-.23.76-.92.68-2.26zm-3.04.54a14 14 0 0 1-1.38 0q.34.38.69.7.35-.32.7-.7M8 5.29q-.76 0-1.47.1A13 13 0 0 0 5.07 8a14 14 0 0 0 1.46 2.62 13 13 0 0 0 2.94 0A13 13 0 0 0 10.93 8a14 14 0 0 0-1.46-2.62A13 13 0 0 0 8 5.3M4.64 9.18q-.15.5-.25.96.44.16.94.27a15 15 0 0 1-.7-1.23m6.73 0a15 15 0 0 1-.7 1.23q.5-.11.95-.27a10 10 0 0 0-.25-.96M3.44 6.26C2.27 6.86 1.87 7.53 1.87 8s.4 1.14 1.57 1.74l.13.07q.18-.88.55-1.81a12 12 0 0 1-.55-1.8q-.07.02-.13.06m8.99-.07A12 12 0 0 1 11.88 8q.36.94.55 1.8l.13-.06c1.17-.6 1.56-1.27 1.56-1.74s-.39-1.14-1.56-1.74zm-7.1-.6q-.5.11-.94.27.1.46.25.96a15 15 0 0 1 .69-1.23m5.34 0a15 15 0 0 1 .7 1.23q.14-.5.24-.96-.44-.15-.94-.27M7.18 3.06c-1.09-.74-1.85-.76-2.24-.52s-.76.92-.69 2.26l.01.15a11 11 0 0 1 1.8-.41q.6-.8 1.24-1.4zm3.88-.52c-.4-.24-1.15-.22-2.25.52l-.12.08q.65.6 1.25 1.4.96.15 1.8.41v-.14c.08-1.35-.28-2.04-.68-2.27M8 3.7a10 10 0 0 0-.7.7 14 14 0 0 1 1.4 0 10 10 0 0 0-.7-.7" clip-rule="evenodd"/>
|
|
1642
|
-
</symbol>`,
|
|
1642
|
+
</symbol>`,Uk=`<symbol id="file-tree-builtin-ruby" viewBox="0 0 16 16">
|
|
1643
1643
|
<path fill="currentColor" fill-rule="evenodd" d="M11.04 2c.48 0 .92.23 1.18.6l2.54 3.65c.37.52.3 1.23-.15 1.69l-5.58 5.64a1.47 1.47 0 0 1-2.06 0L1.39 7.94a1.3 1.3 0 0 1-.15-1.7l2.54-3.63q.2-.3.5-.45.33-.16.68-.16zm.84 2.17a.5.5 0 0 0-.7-.05L8 6.84 4.83 4.12a.5.5 0 0 0-.65.76L6.65 7H3.5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1H9.35l2.48-2.12a.5.5 0 0 0 .05-.7" clip-rule="evenodd"/>
|
|
1644
|
-
</symbol>`,
|
|
1644
|
+
</symbol>`,Wk=`<symbol id="file-tree-builtin-rust" viewBox="0 0 16 16">
|
|
1645
1645
|
<path fill="currentColor" fill-rule="evenodd" d="M8 .8a.2.2 0 0 1 .18.1l.38.6.16.02.5-.53.01-.01a.2.2 0 0 1 .33.08l.25.68.16.05.59-.43h.02a.2.2 0 0 1 .3.14l.12.71.15.08.65-.3a.2.2 0 0 1 .2.02.2.2 0 0 1 .1.18l-.03.72.12.1.71-.16a.2.2 0 0 1 .25.25l-.17.7q.06.06.1.13l.73-.03A.2.2 0 0 1 14 4a.2.2 0 0 1 .02.2l-.3.66.08.14.71.12a.2.2 0 0 1 .14.32l-.43.59.05.16.68.25a.2.2 0 0 1 .07.35l-.53.49.01.16.62.38a.2.2 0 0 1 0 .36l-.62.38-.01.16.53.5a.2.2 0 0 1-.07.34l-.68.25-.05.16.43.59a.2.2 0 0 1-.14.32l-.72.12-.07.15.3.65a.2.2 0 0 1-.02.2.2.2 0 0 1-.18.1l-.72-.03-.1.13.16.7a.2.2 0 0 1-.25.25l-.7-.17-.13.1.03.73a.2.2 0 0 1-.1.18.2.2 0 0 1-.2.02l-.66-.3-.14.08-.12.71a.2.2 0 0 1-.32.14l-.59-.43-.16.05-.25.68a.2.2 0 0 1-.34.07l-.5-.53-.16.01-.38.62a.2.2 0 0 1-.36 0l-.38-.62-.16-.01-.5.53a.2.2 0 0 1-.34-.07l-.25-.68-.16-.05-.59.43a.2.2 0 0 1-.32-.14L5 13.78l-.15-.07-.65.3a.2.2 0 0 1-.2-.02.2.2 0 0 1-.1-.18l.03-.72-.13-.1-.7.16a.2.2 0 0 1-.25-.25l.17-.7-.1-.13-.73.03a.2.2 0 0 1-.2-.3l.3-.66-.08-.14-.71-.12a.2.2 0 0 1-.14-.32l.43-.59-.05-.16-.68-.25A.2.2 0 0 1 1 9.22l.53-.5-.02-.16-.6-.38A.2.2 0 0 1 .8 8a.2.2 0 0 1 .1-.18l.6-.38.02-.16-.53-.5a.2.2 0 0 1 .07-.34l.68-.25.05-.16-.43-.59a.2.2 0 0 1 .14-.32L2.2 5l.08-.15L2 4.2a.2.2 0 0 1 .2-.3l.72.03.1-.13-.16-.7a.2.2 0 0 1 .25-.25l.7.16.13-.1-.03-.72A.2.2 0 0 1 4 2a.2.2 0 0 1 .2-.02l.65.3L5 2.2l.12-.71v-.03a.2.2 0 0 1 .32-.1l.59.41.16-.04.25-.68.01-.02A.2.2 0 0 1 6.8.99l.49.53.16-.02.38-.61.02-.02A.2.2 0 0 1 8 .79M6.8 9.45h1.26l.06.01q.03.01.03.05v1.52q0 .07-.09.06h-4.5A5.4 5.4 0 0 0 8 13.42a5.4 5.4 0 0 0 4.45-2.33h-2.42c-.36 0-.68-.5-.77-.75-.08-.22-.2-.91-.25-1.12-.15-.61-.59-.71-.78-.73H6.8zM8 2.58a5.4 5.4 0 0 0-4.07 1.85h5.74l.17.02c.23.03.6.12.96.35.34.23.83.68.83 1.4 0 .66-.55 1.16-1.08 1.5.42.33.7.53.86 1.44.04.17.34.32.62.29.29-.03.62-.16.62-.75v-.24q0-.1.07-.1h.68A5.43 5.43 0 0 0 8 2.59M2.96 6.03a5.4 5.4 0 0 0-.19 3.37h1.66V6.03zM6.8 7.06h1.66c.35 0 .77-.12.77-.47 0-.42-.55-.53-.65-.53H6.8z" clip-rule="evenodd"/>
|
|
1646
|
-
</symbol>`,
|
|
1646
|
+
</symbol>`,Gk=`<symbol id="file-tree-builtin-sass" viewBox="0 0 16 16">
|
|
1647
1647
|
<path fill="currentColor" fill-rule="evenodd" d="M8.08 1.44c2.41-.91 4.96-.37 5.35 1.27.39 1.62-.92 3.56-2.6 4.25a5 5 0 0 1-3.26.35c-.58-.2-.92-.62-1-.85-.03-.09-.09-.24 0-.3.05-.03.08-.02.22.15s.7.6 1.75.48c2.78-.34 4.45-2.64 3.92-3.88-.37-.87-2.5-1.26-5.18.16C4.03 4.81 3.85 6.24 3.82 6.8c-.08 1.5 1.73 2.28 2.7 3.4q.04.03.07.08c.3-.12.7-.19 1.35-.2 1.58-.03 2.47 1.08 2.43 2.08-.03.78-.7 1.1-.82 1.13-.1.01-.14.02-.15-.06q-.03-.06.13-.15c.16-.09.42-.3.48-.72.05-.43-.24-1.44-1.76-1.63a3 3 0 0 0-1.33.08c.27.62.32 1.87-.29 2.83-.63 1-1.8 1.61-2.93 1.27-.37-.1-.93-.92-.45-2.05.46-1.07 2.4-2.12 2.66-2.26-.9-.83-3.08-1.95-3.4-3.65-.08-.49.13-1.65 1.46-2.98a12 12 0 0 1 4.11-2.52m-1.88 9.7c-.01.01-.9.47-1.52 1.17-.59.66-.75 1.48-.43 1.69.3.18 1-.04 1.51-.62a3 3 0 0 0 .5-.9q.2-.64.02-1.39z" clip-rule="evenodd"/>
|
|
1648
|
-
</symbol>`,
|
|
1648
|
+
</symbol>`,Kk=`<symbol id="file-tree-builtin-stylelint" viewBox="0 0 16 16">
|
|
1649
1649
|
<path fill="currentColor" d="M4 3v3.5l1.5-1L7 15 .5 6l1-1.5L0 3l2.5-2h1zm12 0-1.5 1.5 1 1.5L9 15l1.5-9.5 1.5 1V3l.5-2h1zm-8 8.5a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1"/>
|
|
1650
1650
|
<path fill="currentColor" d="M6.5 2.5V4l-2 1.5v-4zm5 3L9.5 4V2.5l2-1zM9 4H7V2.5h2z"/>
|
|
1651
|
-
</symbol>`,
|
|
1651
|
+
</symbol>`,qk=`<symbol id="file-tree-builtin-svelte" viewBox="0 0 16 16">
|
|
1652
1652
|
<path fill="currentColor" d="m3.98 3.7 3.36-2.08a4.5 4.5 0 0 1 5.9 1.23 4 4 0 0 1 .7 3.02q-.16.75-.58 1.4c.42.77.56 1.66.4 2.52a3.7 3.7 0 0 1-1.57 2.4l-.17.1-3.36 2.09a4.5 4.5 0 0 1-5.9-1.23 4 4 0 0 1-.66-1.44 4 4 0 0 1-.04-1.58 4 4 0 0 1 .58-1.4 4 4 0 0 1-.4-2.52 3.7 3.7 0 0 1 1.57-2.4zl3.36-2.08zm7.87 0a2.7 2.7 0 0 0-1.26-.95 2.7 2.7 0 0 0-1.6-.07 3 3 0 0 0-.52.2l-.16.09-3.36 2.08a2 2 0 0 0-.69.64 2 2 0 0 0-.36.86 2.3 2.3 0 0 0 .42 1.81A2.7 2.7 0 0 0 7.18 9.4q.28-.06.53-.2l.16-.09 1.28-.79.2-.09a.8.8 0 0 1 .87.31.7.7 0 0 1 .13.55.7.7 0 0 1-.24.4l-.08.05-3.36 2.08-.2.09a1 1 0 0 1-.49-.02 1 1 0 0 1-.38-.3 1 1 0 0 1-.13-.37v-.1l.01-.13-.13-.03a4 4 0 0 1-1.1-.5l-.2-.14-.18-.12-.07.18-.08.3a2.3 2.3 0 0 0 .43 1.82q.45.64 1.19.93.73.28 1.51.14l.16-.04q.27-.07.52-.2l.16-.09 3.36-2.08q.4-.25.69-.64.27-.4.36-.86a2.3 2.3 0 0 0-.42-1.82 2.7 2.7 0 0 0-1.27-.95 2.7 2.7 0 0 0-1.6-.08q-.27.07-.52.2l-.16.1-1.28.79-.2.09a1 1 0 0 1-.49-.03 1 1 0 0 1-.38-.29.7.7 0 0 1-.13-.54.7.7 0 0 1 .24-.4l.08-.06L9.33 4.4l.2-.1a.8.8 0 0 1 .87.32 1 1 0 0 1 .13.38v.22l.11.04q.6.18 1.12.5l.2.14.17.12.06-.19.08-.3a2.3 2.3 0 0 0-.42-1.81z"/>
|
|
1653
|
-
</symbol>`,
|
|
1653
|
+
</symbol>`,Jk=`<symbol id="file-tree-builtin-svg" viewBox="0 0 16 16">
|
|
1654
1654
|
<path fill="currentColor" d="M5 7a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2z"/>
|
|
1655
1655
|
<path fill="currentColor" d="M6 1a5 5 0 0 1 4.58 3H7a3 3 0 0 0-3 3v3.58A5 5 0 0 1 6 1" opacity=".5"/>
|
|
1656
|
-
</symbol>`,
|
|
1656
|
+
</symbol>`,Yk=`<symbol id="file-tree-builtin-svgo" viewBox="0 0 16 16">
|
|
1657
1657
|
<path fill="currentColor" d="M9.43 4.8A.6.6 0 1 1 9.19 6l-.56.96a1.2 1.2 0 0 1 .32 1.58l.7.53a.89.89 0 1 1-.17.22l-.7-.52a1.2 1.2 0 0 1-1.4.25l-.56.87a.75.75 0 1 1-.57-.2 1 1 0 0 1 .32.05l.56-.87a1.2 1.2 0 0 1-.4-1.24l-1.2-.47a.56.56 0 1 1 .1-.28v.02l1.2.47a1.2 1.2 0 0 1 1.56-.55l.56-.97a.6.6 0 0 1-.15-.64.6.6 0 0 1 .63-.4"/>
|
|
1658
1658
|
<path fill="currentColor" fill-rule="evenodd" d="M9.17 1q.16.63.27 1.26a6 6 0 0 1 1.61.67q.52-.38 1.08-.71l1.65 1.64q-.32.56-.68 1.05.48.78.72 1.67.6.09 1.18.25v2.32q-.55.15-1.11.24a6 6 0 0 1-.7 1.82q.31.44.59.91l-1.65 1.65-.85-.55a6 6 0 0 1-1.9.83q-.08.47-.2.95H6.84q-.12-.46-.2-.93a6 6 0 0 1-1.96-.81q-.39.27-.8.51l-1.65-1.65q.25-.43.53-.84a6 6 0 0 1-.75-1.9L1 9.16V6.83q.54-.14 1.09-.24a6 6 0 0 1 .77-1.74q-.33-.47-.63-.98l1.65-1.65q.54.32 1.03.68a6 6 0 0 1 1.66-.66q.1-.61.26-1.24zM7.96 3.73a4 4 0 0 0-1.74.36 4.5 4.5 0 0 0-2.3 2.3 4.4 4.4 0 0 0-.1 3.29l.03.06a4.4 4.4 0 0 0 2.4 2.47 4.4 4.4 0 0 0 3.48-.02l.03-.02a4.4 4.4 0 0 0 2.3-2.42l.06-.14a4.4 4.4 0 0 0-.2-3.4 4.4 4.4 0 0 0-2.13-2.07L9.47 4a4 4 0 0 0-1.51-.27" clip-rule="evenodd"/>
|
|
1659
|
-
</symbol>`,
|
|
1659
|
+
</symbol>`,Xk=`<symbol id="file-tree-builtin-swift" viewBox="0 0 16 16">
|
|
1660
1660
|
<path fill="currentColor" d="M9.63 1c6.15 4.35 4.16 9.15 4.16 9.15s1.75 2.05 1.04 3.85c0 0-.72-1.26-1.93-1.26-1.17 0-1.85 1.26-4.2 1.26C3.47 14 1 9.46 1 9.46c4.71 3.22 7.93.94 7.93.94C6.8 9.12 2.29 3 2.29 3c3.93 3.47 5.63 4.39 5.63 4.39-1.01-.87-3.86-5.13-3.86-5.13C6.34 4.66 10.86 8 10.86 8c1.28-3.7-1.23-7-1.23-7"/>
|
|
1661
|
-
</symbol>`,
|
|
1661
|
+
</symbol>`,Zk=`<symbol id="file-tree-builtin-table" viewBox="0 0 16 16">
|
|
1662
1662
|
<path fill="currentColor" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" opacity=".4"/>
|
|
1663
1663
|
<path fill="currentColor" d="M11.5 8a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5zM5 12h2.5v-1H5zm3.5 0H11v-1H8.5zM5 10h2.5V9H5zm3.5 0H11V9H8.5zm1-9a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
|
|
1664
|
-
</symbol>`,
|
|
1664
|
+
</symbol>`,Qk=`<symbol id="file-tree-builtin-tailwind" viewBox="0 0 16 16">
|
|
1665
1665
|
<path fill="currentColor" fill-rule="evenodd" d="M8 4Q5.2 4 4.5 6.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C8.98 7.23 9.77 8 11.5 8q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C10.52 4.77 9.73 4 8 4M4.5 8Q1.7 8 1 10.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C5.48 11.23 6.26 12 8 12q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C7.02 8.77 6.24 8 4.5 8" clip-rule="evenodd"/>
|
|
1666
|
-
</symbol
|
|
1666
|
+
</symbol>`,$k=`<symbol id="file-tree-builtin-terraform" viewBox="0 0 16 16">
|
|
1667
1667
|
<path fill="currentColor" d="M1 0v5.05l4.35 2.53V2.53zm9.18 5.34L5.83 2.82v5.05l4.35 2.53zm.47 5.06V5.34L15 2.82v5.05zm-.48 5.6-4.35-2.53V8.42l4.35 2.53z"/>
|
|
1668
|
-
</symbol>`,
|
|
1668
|
+
</symbol>`,eA=`<symbol id="file-tree-builtin-text" viewBox="0 0 16 16">
|
|
1669
1669
|
<path fill="currentColor" fill-rule="evenodd" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" clip-rule="evenodd" opacity=".4"/>
|
|
1670
1670
|
<path fill="currentColor" d="M8.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zm2-2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1zm-1-8a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z"/>
|
|
1671
|
-
</symbol>`,
|
|
1671
|
+
</symbol>`,tA=`<symbol id="file-tree-builtin-typescript" viewBox="0 0 16 16">
|
|
1672
1672
|
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
1673
1673
|
<path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66m-3 1.57V5.99H3.5v-.9h4.21v.9H6.1v5.22z"/>
|
|
1674
|
-
</symbol>`,
|
|
1674
|
+
</symbol>`,nA=`<symbol id="file-tree-builtin-vite" viewBox="0 0 16 16">
|
|
1675
1675
|
<path fill="currentColor" d="M8.57 14.87c-.18.26-.55.11-.55-.22v-3.18l-.05-.27-.13-.22-.2-.15-.24-.06H4.29c-.26 0-.4-.32-.26-.55L6.08 7c.3-.46 0-1.1-.5-1.1H1.8c-.25 0-.4-.32-.25-.56l2.65-4.2A.3.3 0 0 1 4.46 1h7.9c.26 0 .4.32.26.55l-2.05 3.23c-.29.46 0 1.1.5 1.1h3.12c.26 0 .4.34.24.57z"/>
|
|
1676
|
-
</symbol>`,
|
|
1676
|
+
</symbol>`,rA=`<symbol id="file-tree-builtin-vscode" viewBox="0 0 16 16">
|
|
1677
1677
|
<path fill="currentColor" d="m5.11 9.68-2.4 1.84a.6.6 0 0 1-.75-.04l-.77-.7a.6.6 0 0 1 0-.87L3.28 8zm5.52-8.42a.51.51 0 0 1 .87.36V4.8L7.32 8 5.1 6.32z" opacity=".75"/>
|
|
1678
1678
|
<path fill="currentColor" d="M11.1 14.99h.03zM1.96 4.52a.6.6 0 0 1 .75-.04l8.8 6.71v3.19a.51.51 0 0 1-.88.36L1.19 6.1a.6.6 0 0 1 0-.87z" opacity=".65"/>
|
|
1679
1679
|
<path fill="currentColor" d="M11.62 14.91a.9.9 0 0 1-1-.17.51.51 0 0 0 .88-.36V1.62a.51.51 0 0 0-.87-.36.9.9 0 0 1 1-.17l2.87 1.39a.9.9 0 0 1 .5.8v9.44a.9.9 0 0 1-.5.8z"/>
|
|
1680
|
-
</symbol>`,
|
|
1680
|
+
</symbol>`,iA=`<symbol id="file-tree-builtin-vue" viewBox="0 0 16 16">
|
|
1681
1681
|
<path fill="currentColor" d="M9.62 2.25 8 5.02 6.38 2.25H1l7 12 7-12z" opacity=".5"/>
|
|
1682
1682
|
<path fill="currentColor" d="M9.54 2.25 8 4.95l-1.54-2.7H4l4 7 4-7z"/>
|
|
1683
|
-
</symbol>`,
|
|
1683
|
+
</symbol>`,aA=`<symbol id="file-tree-builtin-wasm" viewBox="0 0 16 16">
|
|
1684
1684
|
<path fill="currentColor" d="M13 1a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h3a2 2 0 1 0 4 0z" class="subtract" opacity=".2"/>
|
|
1685
1685
|
<path fill="currentColor" d="M4.64 11.4h.02l.8-3.4h.91l.73 3.45L7.88 8h.96l-1.25 5h-.97L5.9 9.6 5.1 13h-1L3 8h.98z"/>
|
|
1686
1686
|
<path fill="currentColor" fill-rule="evenodd" d="M13 13h-1.02l-.33-1.11H9.9L9.64 13h-.97l1.26-5h1.54zm-2.49-3.77-.42 1.84h1.32l-.49-1.84z" clip-rule="evenodd"/>
|
|
1687
|
-
</symbol>`,
|
|
1687
|
+
</symbol>`,oA=`<symbol id="file-tree-builtin-webpack" viewBox="0 0 16 16">
|
|
1688
1688
|
<path fill="currentColor" d="M14.1 11.79 8.26 15v-2.5l3.64-1.94zm.4-.35V4.73l-2.14 1.2v4.3zm-12.6.35L7.74 15v-2.5L4.1 10.56zm-.4-.35V4.73l2.14 1.2v4.3zm.25-7.15 6-3.29v2.42L3.9 5.47l-.03.01zm12.5 0L8.25 1v2.42l3.85 2.05.03.01z" class="bg" opacity=".4"/>
|
|
1689
1689
|
<path fill="currentColor" d="m7.74 11.93-3.59-1.92v-3.8l3.6 2.02zm.52 0 3.59-1.92v-3.8l-3.6 2.02zM4.4 5.77 8 3.85l3.6 1.93L8 7.8z" class="fg"/>
|
|
1690
|
-
</symbol>`,
|
|
1690
|
+
</symbol>`,sA=`<symbol id="file-tree-builtin-yml" viewBox="0 0 16 16">
|
|
1691
1691
|
<path fill="currentColor" d="M7.5 2A1.5 1.5 0 0 1 9 3.5v3A1.5 1.5 0 0 1 7.5 8h-2v2A1.5 1.5 0 0 0 7 11.5v-1A1.5 1.5 0 0 1 8.5 9h5a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-5A1.5 1.5 0 0 1 7 13.5v-1A2.5 2.5 0 0 1 4.5 10V8h-2A1.5 1.5 0 0 1 1 6.5v-3A1.5 1.5 0 0 1 2.5 2zm1 8a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5zm-6-7a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5z"/>
|
|
1692
|
-
</symbol
|
|
1692
|
+
</symbol>`,cA=`<symbol id="file-tree-builtin-zig" viewBox="0 0 16 16">
|
|
1693
1693
|
<path fill="currentColor" d="m14.73 1.5-7.29 8.82h4.17l-1.73 2.04H5.76L1.27 14.5l7.3-8.91H4.39l1.73-2.05h4.12z"/>
|
|
1694
1694
|
<path fill="currentColor" d="M5.21 3.54 3.56 5.6h-.55v4.73h.83L2.1 12.36H1V3.54zm9.79 0v8.82h-4.3l1.74-2.04h.55V5.68h-.83l1.74-2.14z"/>
|
|
1695
|
-
</symbol>`,
|
|
1695
|
+
</symbol>`,lA=[pk,vk,bk,xk,Sk,Ck,Ek,Dk,Ok,Ak,jk,Mk,Nk,Pk,Fk,Vk,Uk,Wk,Xk,Zk,eA,tA,`<symbol id="file-tree-builtin-zip" viewBox="0 0 16 16">
|
|
1696
1696
|
<path fill="currentColor" d="M4.585 2a2 2 0 0 1 1.028.285l1.788 1.072a1 1 0 0 0 .514.143H12A2 2 0 0 1 13.935 5H0V4a2 2 0 0 1 2-2z" class="bg" opacity=".5"/>
|
|
1697
1697
|
<path fill="currentColor" fill-rule="evenodd" d="M14 12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-1.25h1v-1H0V6h14zM9.9 8.25c-.883 0-1.9.5-1.9.5H7v1h1v1s1.017.5 1.9.5c.884 0 1.6-.672 1.6-1.5s-.716-1.5-1.6-1.5M2 9.75v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1zm-5-1v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1z" class="fg" clip-rule="evenodd"/>
|
|
1698
|
-
</symbol>`],
|
|
1699
|
-
`)}\n</svg>`)}var rA=nA(tk,eA),iA={minimal:tk,standard:rA,complete:nA(rA,tA)},aA={".babelrc":`babel`,".babelrc.json":`babel`,".bash_profile":`bash`,".bashrc":`bash`,".browserslistrc":`browserslist`,".dockerignore":`docker`,".eslintignore":`eslint`,".eslintrc":`eslint`,".eslintrc.cjs":`eslint`,".eslintrc.js":`eslint`,".eslintrc.json":`eslint`,".eslintrc.yaml":`eslint`,".eslintrc.yml":`eslint`,".gitattributes":`git`,".gitignore":`git`,".gitkeep":`git`,".gitmodules":`git`,".oxlintrc.json":`oxc`,".postcssrc":`postcss`,".postcssrc.json":`postcss`,".postcssrc.yaml":`postcss`,".postcssrc.yml":`postcss`,".prettierignore":`prettier`,".prettierrc":`prettier`,".prettierrc.cjs":`prettier`,".prettierrc.js":`prettier`,".prettierrc.json":`prettier`,".prettierrc.mjs":`prettier`,".prettierrc.toml":`prettier`,".prettierrc.yaml":`prettier`,".prettierrc.yml":`prettier`,".stylelintignore":`stylelint`,".stylelintrc":`stylelint`,".stylelintrc.cjs":`stylelint`,".stylelintrc.js":`stylelint`,".stylelintrc.json":`stylelint`,".stylelintrc.mjs":`stylelint`,".stylelintrc.yaml":`stylelint`,".stylelintrc.yml":`stylelint`,".terraform.lock.hcl":`terraform`,".zprofile":`bash`,".zshenv":`bash`,".zshrc":`bash`,"babel.config.cjs":`babel`,"babel.config.js":`babel`,"babel.config.json":`babel`,"babel.config.mjs":`babel`,"biome.json":`biome`,"biome.jsonc":`biome`,"bootstrap.bundle.js":`bootstrap`,"bootstrap.bundle.min.js":`bootstrap`,"bootstrap.css":`bootstrap`,"bootstrap.js":`bootstrap`,"bootstrap.min.css":`bootstrap`,"bootstrap.min.js":`bootstrap`,"bun.lock":`bun`,"bun.lockb":`bun`,"bunfig.toml":`bun`,"claude.md":`claude`,"compose.yaml":`docker`,"compose.yml":`docker`,"docker-compose.override.yml":`docker`,"docker-compose.yaml":`docker`,"docker-compose.yml":`docker`,dockerfile:`docker`,"eslint.config.cjs":`eslint`,"eslint.config.js":`eslint`,"eslint.config.mjs":`eslint`,"eslint.config.mts":`eslint`,"eslint.config.ts":`eslint`,gemfile:`ruby`,"next.config.js":`nextjs`,"next.config.mjs":`nextjs`,"next.config.mts":`nextjs`,"next.config.ts":`nextjs`,"postcss.config.cjs":`postcss`,"postcss.config.js":`postcss`,"postcss.config.mjs":`postcss`,"postcss.config.ts":`postcss`,"prettier.config.cjs":`prettier`,"prettier.config.js":`prettier`,"prettier.config.mjs":`prettier`,rakefile:`ruby`,"readme.md":`markdown`,"stylelint.config.cjs":`stylelint`,"stylelint.config.js":`stylelint`,"stylelint.config.mjs":`stylelint`,"svgo.config.cjs":`svgo`,"svgo.config.js":`svgo`,"svgo.config.mjs":`svgo`,"svgo.config.ts":`svgo`,"tailwind.config.cjs":`tailwind`,"tailwind.config.js":`tailwind`,"tailwind.config.mjs":`tailwind`,"tailwind.config.ts":`tailwind`,"vite.config.js":`vite`,"vite.config.mjs":`vite`,"vite.config.mts":`vite`,"vite.config.ts":`vite`,"webpack.config.babel.js":`webpack`,"webpack.config.cjs":`webpack`,"webpack.config.js":`webpack`,"webpack.config.mjs":`webpack`,"webpack.config.ts":`webpack`},oA={"7z":`zip`,astro:`astro`,AUTHORS:`text`,avif:`image`,bash:`bash`,bmp:`image`,bz2:`zip`,c:`c`,cc:`cpp`,cfg:`text`,CHANGELOG:`text`,cjs:`javascript`,"code-workspace":`vscode`,conf:`text`,CONTRIBUTORS:`text`,cpp:`cpp`,csh:`bash`,css:`css`,csv:`table`,cts:`typescript`,cxx:`cpp`,db:`database`,editorconfig:`text`,env:`text`,"env.development":`text`,"env.local":`text`,"env.production":`text`,eot:`font`,erb:`ruby`,fish:`bash`,gemspec:`ruby`,gif:`image`,go:`go`,gql:`graphql`,graphql:`graphql`,gz:`zip`,h:`c`,hh:`cpp`,hpp:`cpp`,htm:`html`,html:`html`,hxx:`cpp`,icns:`image`,ico:`image`,ini:`text`,inl:`cpp`,jar:`zip`,jpeg:`image`,jpg:`image`,js:`javascript`,json:`json`,json5:`json`,jsonc:`json`,jsonl:`json`,jsx:`javascript`,ksh:`bash`,less:`css`,LICENSE:`text`,log:`text`,markdown:`markdown`,mcp:`mcp`,md:`markdown`,mdx:`markdown`,"mdx.tsx":`markdown`,mjs:`javascript`,mm:`cpp`,mts:`typescript`,ods:`table`,otf:`font`,png:`image`,postcss:`css`,py:`python`,pyi:`python`,pyw:`python`,pyx:`python`,rake:`ruby`,rar:`zip`,rb:`ruby`,rs:`rust`,rst:`text`,rtf:`text`,sass:`css`,scss:`css`,sh:`bash`,sql:`database`,sqlite:`database`,sqlite3:`database`,styl:`css`,svelte:`svelte`,svg:`svg`,swift:`swift`,tar:`zip`,tf:`terraform`,tfstate:`terraform`,tfvars:`terraform`,tgz:`zip`,tif:`image`,tiff:`image`,ts:`typescript`,tsv:`table`,tsx:`typescript`,ttf:`font`,txt:`text`,vue:`vue`,war:`zip`,wasm:`wasm`,wast:`wasm`,wat:`wasm`,webp:`image`,woff:`font`,woff2:`font`,xhtml:`html`,xls:`table`,xlsx:`table`,xz:`zip`,yaml:`yml`,yml:`yml`,zig:`zig`,zip:`zip`,zsh:`bash`},sA={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},cA=new Set([`bash`,`c`,`cpp`,`css`,`database`,`default`,`font`,`git`,`go`,`html`,`image`,`javascript`,`json`,`markdown`,`mcp`,`python`,`ruby`,`rust`,`swift`,`table`,`text`,`typescript`,`zip`]),lA=new Set([`complete`]);function uA(e){return iA[e===`none`?`minimal`:e]}function dA(e){return`file-tree-builtin-${e}`}function fA(e){return e!==`none`&&lA.has(e)}function pA(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=aA[t.toLowerCase()];if(i!=null&&(r||cA.has(i)))return i;for(let e of n){if(r){let t=sA[e];if(t!=null)return t}let t=oA[e];if(t!=null&&(r||cA.has(t)))return t}return`default`}var mA=`file-tree-container`,hA=`data-file-tree-style`,gA=`data-file-tree-unsafe-css`,_A=`data-file-tree-scrollbar-measure`,vA=`data-file-tree-scrollbar-gutter-measured`,yA=`--trees-scrollbar-gutter-measured`,bA=`header`,xA=`context-menu`,SA=`context-menu-trigger`;function CA(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function wA(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(CA(e)?`none`:`complete`),colored:e.colored??!0}}var TA=e=>e.trim().toLowerCase(),EA=e=>e.split(`/`).at(-1)??e,DA=e=>{let t=e.toLowerCase().split(`.`),n=[];for(let e=1;e<t.length;e+=1)n.push(t.slice(e).join(`.`));return n};function OA(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function kA(e){let t=wA(e),n=t.remap,r=new Map;for(let[e,n]of Object.entries(t.byFileName??{}))r.set(e.toLowerCase(),n);let i=new Map;for(let[e,n]of Object.entries(t.byFileExtension??{}))i.set(TA(e),n);let a=Object.entries(t.byFileNameContains??{}).map(([e,t])=>[e.toLowerCase(),t]);return{resolveIcon:(e,o)=>{if(e===`file-tree-icon-file`&&o!=null){let s=EA(o),c=s.toLowerCase(),l=r.get(c);if(l!=null)return OA(l,e);for(let[t,n]of a)if(c.includes(t))return OA(n,e);let u=DA(s);for(let t of u){let n=i.get(t);if(n!=null)return OA(n,e)}let d=pA(t.set,s,u);if(d!=null&&t.set!==`none`){if(d==="default"){let t=n?.[e];if(t!=null)return OA(t,e)}return{name:dA(d),remappedFrom:e,token:d}}}let s=n?.[e];return s==null?{name:e}:OA(s,e)}}}var AA=5,jA=32,MA=128;function NA(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function PA(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function FA(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;let n=new Map;for(let r of t.childIds){let t=e[r];t!=null&&n.set(t.nameId,r)}return t.childIdByNameId=n,n}function IA(e){if(e.childPositionById!=null)return e.childPositionById;let t=new Map;for(let n=0;n<e.childIds.length;n++){let r=e.childIds[n];r!=null&&t.set(r,n)}return e.childPositionById=t,t}function LA(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function RA(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){let t=e.childIds[n];t!=null&&e.childPositionById.set(t,n)}}function zA(e,t){let n=0,r=0;for(let i of t.childIds){let t=e[i];t!=null&&(n+=t.subtreeNodeCount,r+=t.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=r,UA(e,t)}function BA(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=IA(e).get(t);if(i===void 0)return;let a=i>>AA;e.childVisibleChunkSums[a]+=r}function VA(e,t,n){let r=t.childVisibleChunkSums;if(r!=null){let i=n,a=0;for(let o of r){if(i<o){let r=WA(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=jA}throw Error(`Visible child index ${String(n)} is out of range`)}let i=n;for(let r=0;r<t.childIds.length;r++){let a=t.childIds[r];if(a==null)continue;let o=e[a];if(o!=null){if(i<o.visibleSubtreeCount)return{childIndex:r,childVisibleIndex:n-i,localVisibleIndex:i};i-=o.visibleSubtreeCount}}throw Error(`Visible child index ${String(n)} is out of range`)}function HA(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>AA;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<AA}for(let i=a;i<n;i+=1){let n=t.childIds[i];if(n==null)continue;let a=e[n];a!=null&&(r+=a.visibleSubtreeCount)}return r}function UA(e,t){if(t.childIds.length<MA){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/jA),r=new Int32Array(n);for(let n=0;n<t.childIds.length;n++){let i=t.childIds[n];if(i==null)continue;let a=e[i];a!=null&&(r[n>>AA]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function WA(e,t,n,r){let i=Math.min(t.childIds.length,n+jA),a=r;for(let r=n;r<i;r++){let n=t.childIds[r];if(n==null)continue;let i=e[n];if(i!=null){if(a<i.visibleSubtreeCount)return{childIndex:r,localVisibleIndex:a};a-=i.visibleSubtreeCount}}throw Error(`Visible child index ${String(r)} is out of range`)}var GA=7,KA=3,qA=8,JA=4;function YA(e,t,n=0){return e<<JA|n<<KA|t}function XA(e){return e.depthAndFlags>>>JA}function ZA(e){return(e.depthAndFlags&qA)>>KA}function G(e){return(e.depthAndFlags&qA)!==0}function QA(e){return e.depthAndFlags&GA}function $A(e,t){return(QA(e)&t)!==0}function ej(e,t){e.depthAndFlags|=t}function tj(e,t){e.depthAndFlags=YA(t,QA(e),ZA(e))}var nj=Symbol(`benchmarkInstrumentation`);function rj(e,t){return t==null||Object.defineProperty(e,nj,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function ij(e){return e==null?null:e[nj]??null}function K(e,t,n){return e==null?n():e.measurePhase(t,n)}function aj(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function oj(e){return e>=48&&e<=57}function sj(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!oj(e.charCodeAt(r));)r+=1;if(r>=e.length)break;r>n&&t.push(e.slice(n,r));let i=0;for(;r<e.length&&oj(e.charCodeAt(r));)i=i*10+(e.charCodeAt(r)-48),r+=1;t.push(i),n=r}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function cj(e){let t=e.toLowerCase();return{lowerValue:t,tokens:sj(t)}}function lj(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===i)continue;if(typeof n==`number`&&typeof i==`number`)return n<i?-1:1;let a=String(n),o=String(i);if(a!==o)return a<o?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function uj(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]==`string`&&typeof t.tokens[0]==`string`)return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;let n=lj(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function dj(e,t,n){let r=uj(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function fj(e,t){return dj(e,t,cj)}function pj(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function mj(e,t){let n=Math.min(e.segments.length,t.segments.length);for(let r=0;r<n;r++){let n=e.segments[r],i=t.segments[r];if(n===i)continue;let a=pj(e,r);return a===pj(t,r)?fj(n,i):a===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function hj(e,t){return mj(e,t)}function gj(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=cj(e);return n.set(e,r),r},i=Math.min(e.segments.length,t.segments.length);for(let n=0;n<i;n++){let i=e.segments[n],a=t.segments[n];if(i===a)continue;let o=pj(e,n);return o===pj(t,n)?dj(i,a,r):o===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function _j(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=cj(r);return e.sortKeyById[t]=i,i}function vj(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function yj(e){let t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,r=[],i=0;for(let t=0;t<n;t++)e.charCodeAt(t)===47&&(r.push(e.slice(i,t)),i=t+1);return r.push(e.slice(i,n)),{hasTrailingSlash:t,segments:r}}function bj(e){let{hasTrailingSlash:t,segments:n}=yj(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function xj(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=yj(e);return{requiresDirectory:t,segments:n}}function Sj(){let e=new Map;return e.set(``,0),{idByValue:e,valueById:[``],sortKeyById:[cj(``)]}}function Cj(e,t){let n=e.idByValue.get(t);if(n!==void 0)return n;let r=e.valueById.length;return e.idByValue.set(t,r),e.valueById.push(t),r}function wj(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var Tj=Symbol(`pathStorePreparedInputKind`);function Ej(e,t){return e[Tj]=t,e}function Dj(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function Oj(e,t,n){return n==="default"?hj(e,t):n(Dj(e),Dj(t))}function kj(){return{depthAndFlags:YA(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function Aj(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function jj(e){return e.isDirectory?e.segments.length:e.segments.length-1}function Mj(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e&&typeof e.path==`string`&&Array.isArray(e.segments)&&typeof e.basename==`string`&&typeof e.isDirectory==`boolean`)}function Nj(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function Pj(e,t={}){return Bj(e,t).map(e=>e.path)}function Fj(e,t={}){let n=Bj(e,t);return Ej({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function Ij(e){let t=e.length,n=!1;for(let r=0;r<t;r+=1){let t=e[r];if(t.length>0&&t.charCodeAt(t.length-1)===47){n=!0;break}}return Ej({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function Lj(e){let t=e,n=t.preparedPaths;if(t[Tj]===`prepared`&&n!=null)return n;if(!Mj(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function Rj(e){let t=e;return t[Tj]===`presorted`&&t.presortedPaths!=null||Nj(t.presortedPaths)?t.presortedPaths:null}function zj(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function Bj(e,t={}){let n=vj(t),r=ij(t);aj(r,`workload.inputFiles`,e.length);let i=K(r,`store.preparePathEntries.parse`,()=>e.map(e=>bj(e)));return K(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>Oj(e,t,n.sort))),i}var Vj=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[kj()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=Sj();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=ij(e),this.options=vj(e);let t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{let e=new Set,n=t.length;for(let r=0;r<n;r+=1){let n=t[r],i=n.length;e.add(i>0&&n.charCodeAt(i-1)===47?n.slice(0,i-1):n)}this.initialExpandedPathSet=e,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,NA())}appendPaths(e){return K(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>bj(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,K(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return K(this.instrumentation,`store.builder.appendPresortedPaths`,()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,r=0,i=this.nodes,a=this.segmentTable,o=a.idByValue,s=a.valueById,c=this.directoryStack,l=0,u=``,d=0;for(let t of e){if(n===t)throw Error(`Duplicate path: "${t}"`);let e=t.length>0&&t.charCodeAt(t.length-1)===47,a=e?t.length-1:t.length,f=0,p=0;if(n!=null){if(u.length>0&&t.length>u.length&&t.startsWith(u))f=d,p=u.length;else{let r=Math.min(a,n.length),i=!0;for(let e=0;e<r;e++){let r=t.charCodeAt(e);if(r!==n.charCodeAt(e)){i=!1;break}r===47&&(f++,p=e+1)}i&&e&&r===a&&n.length>a&&n.charCodeAt(a)===47&&(f++,p=a+1)}}l=f,r=f;let m=p,h=t.indexOf(`/`,m);for(;h>=0&&h<a;){let e=c[l];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);r++;let n=t.slice(m,h),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n));let u=i.length;i.push({depthAndFlags:YA(r,0,1),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(t.slice(0,h)),l++,c[l]=u,m=h+1,h=t.indexOf(`/`,m)}if(e){if(m<a){let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory parent for "${t}"`);r++;let n=t.slice(m,a),u=o.get(n);u===void 0&&(u=s.length,o.set(n,u),s.push(n));let d=i.length;i.push({depthAndFlags:YA(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d,m=a+1}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:YA(r+1,0),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1})}m!==u.length&&(u=t.substring(0,m),d=r),n=t}c.length=l+1,n!=null&&(this.lastPreparedPath=bj(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0,r=this.nodes,i=this.segmentTable,a=i.idByValue,o=i.valueById,s=this.directoryStack,c=0,l=``,u=0;for(let i of e){if(t===i)throw Error(`Duplicate path: "${i}"`);let e=i.length,d=0,f=0;if(t!=null){if(l.length>0&&i.length>l.length&&i.startsWith(l))d=u,f=l.length;else{let n=Math.min(e,t.length);for(let e=0;e<n;e++){let n=i.charCodeAt(e);if(n!==t.charCodeAt(e))break;n===47&&(d++,f=e+1)}}}c=d,n=d;let p=f,m=i.indexOf(`/`,p);for(;m>=0;){let e=s[c];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);n++;let t=i.slice(p,m),l=a.get(t);l===void 0&&(l=o.length,a.set(t,l),o.push(t));let u=r.length;r.push({depthAndFlags:YA(n,0,1),nameId:l,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(i.slice(0,m)),this.presortedDirectoryNodeIds.push(u),c++,s[c]=u,p=m+1,m=i.indexOf(`/`,p)}let h=s[c];if(h===void 0)throw Error(`Unable to resolve file parent for "${i}"`);let g=i.slice(p),_=a.get(g);_===void 0&&(_=o.length,a.set(g,_),o.push(g)),r.push({depthAndFlags:YA(n+1,0),nameId:_,parentId:h,subtreeNodeCount:1,visibleSubtreeCount:1}),p!==l.length&&(l=i.substring(0,p),u=n),t=i}s.length=c+1,t!=null&&(this.lastPreparedPath=bj(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(K(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||K(this.instrumentation,`store.builder.computeSubtreeCounts`,()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&=(this.buildDirectoryIndexes(),!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort==="default"?gj(this.lastPreparedPath,e,this.segmentSortKeyCache):Oj(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=jj(e),i=n==null?0:jj(n),a=n==null?0:Aj(n.segments,e.segments),o=Math.min(a,r,i);this.directoryStack.length=o+1;for(let n=o;n<r;n++){let r=this.directoryStack[this.directoryStack.length-1];if(r===void 0)throw Error(`Directory stack underflow while building the path store`);let i=t?this.getOrCreateDirectoryChild(r,e.segments[n]):this.createDirectoryChild(r,e.segments[n]);this.directoryStack.push(i)}if(e.isDirectory){let t=this.directoryStack[this.directoryStack.length-1];if(t===void 0)throw Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(t,e.path),this.lastPreparedPath=e;return}let s=this.directoryStack[this.directoryStack.length-1];if(s===void 0)throw Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(s,e.basename,e.path):this.createFileChildUnchecked(s,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){!this.createdDirectoriesAllExpanded||this.initialExpandedPathSet==null||(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){let r=Cj(this.segmentTable,t),i=this.getDirectoryIndex(e),a=i.childIdByNameId;if(a!=null&&a.get(r)!==void 0)throw Error(`Path collides with an existing entry: "${n}"`);let o=this.nodes[e];if(o===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let s=this.nodes.length;return this.nodes.push({depthAndFlags:YA(XA(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),LA(i,s),s}createFileChildUnchecked(e,t){let n=Cj(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:YA(XA(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),LA(r,a),a}getOrCreateDirectoryChild(e,t){let n=Cj(this.segmentTable,t),r=this.getDirectoryIndex(e);if(r.childIdByNameId!=null){let e=r.childIdByNameId.get(n);if(e!==void 0){let n=this.nodes[e];if(n!=null&&!G(n))throw Error(`Path collides with an existing file while creating directory "${t}"`);return e}}let i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:YA(XA(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),LA(r,a),this.directories.set(a,NA()),a}createDirectoryChild(e,t){let n=Cj(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:YA(XA(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),LA(r,a),this.directories.set(a,NA()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!G(n))throw Error(`Path is not a directory: "${t}"`);if($A(n,1))throw Error(`Duplicate path: "${t}"`);ej(n,1)}getDirectoryIndex(e){let t=this.directories.get(e);if(t!==void 0)return t;throw Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){let t=this.nodes,n=this.directories;n.set(0,PA());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(G(a)){let t=PA();n.set(e,t),r=e,i=t}let o;a.parentId===r?o=i:(o=n.get(a.parentId),r=a.parentId,i=o??null),o?.childIds.push(e)}if(!e)for(let e=t.length-1;e>=1;e--){let n=t[e];if(n==null)continue;let r=t[n.parentId];r!=null&&(r.subtreeNodeCount+=n.subtreeNodeCount,r.visibleSubtreeCount+=n.visibleSubtreeCount)}}buildDirectoryIndexes(){let e=this.nodes;for(let t=1;t<e.length;t++){let n=e[t];if(n==null)continue;G(n)&&this.directories.set(t,NA());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),LA(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!G(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;let n=this.getDirectoryIndex(e),r=1;for(let e of n.childIds)r+=this.computeSubtreeCounts(e);return zA(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function Hj(e,t=`closed`,n=null){let r=Wj(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:r,directoriesOpenByDefault:r===`open`,hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:``,version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function Uj(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function Wj(e){if(typeof e!=`number`)return e;if(!Number.isInteger(e)||e<0)throw Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function Gj(e,t){return $A(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion!==`closed`&&XA(t)<=e.defaultExpansion}function Kj(e,t,n=e.snapshot.nodes[t]){return n==null||!G(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:Gj(e,n)}function qj(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!G(r))return;let i=Gj(e,r);if(n){if(i){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(i){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function Jj(e,t){let n=e.directoryLoadInfoById.get(t);if(n!=null)return n;let r={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:`loaded`};return e.directoryLoadInfoById.set(t,r),r}function Yj(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function Xj(e,t){let n=Jj(e,t);if(n.state===`loading`&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};let r=n.nextAttemptId;return n.activeAttemptId=r,n.errorMessage=null,n.nextAttemptId+=1,n.state=`loading`,{attemptId:r,nodeId:t,reused:!1}}function Zj(e,t){let n=Jj(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function Qj(e,t,n){let r=e.directoryLoadInfoById.get(t);return r==null||r.activeAttemptId!==n?!1:(r.activeAttemptId=null,r.errorMessage=null,r.state=`loaded`,!0)}function $j(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function eM(e,t,n,r){let i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=r??null,i.state=`error`,!0)}function tM(e,t){e.directoryLoadInfoById.delete(t)}function nM(e,t,n){let r=n,i=e.listeners.get(t);return i==null?e.listeners.set(t,new Set([r])):i.add(r),()=>{let n=e.listeners.get(t);n!=null&&(n.delete(r),n.size===0&&e.listeners.delete(t))}}function rM(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function iM(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function aM(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function oM(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function sM(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function cM(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function lM(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`begin-child-load`,path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function uM(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(e=>e.canonicalChanged),childEvents:e.childEvents,operation:`apply-child-patch`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function dM(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`complete-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function fM(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:`fail-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function pM(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:`cleanup`,projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function mM(e,t,n){return{...n,visibleCountDelta:TM(e)-t}}function hM(e,t){let n=TM(e),r=Uj();e.transactionStack.push(r);try{t()}catch(t){throw vM(e,r,!1),t}vM(e,r,!0,TM(e)-n)}function gM(e,t){let n=e.instrumentation;if(n==null){_M(e,t);return}K(n,`store.events.record`,()=>_M(e,t))}function _M(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){CM(e,t);return}n.events.push(t),SM(n,t)}function vM(e,t,n,r=null){if(e.transactionStack.pop()!==t)throw Error(`Transaction stack underflow`);if(!n)return;let i=e.transactionStack[e.transactionStack.length-1]??null;if(i!=null){let n=e.instrumentation;n==null?xM(i,t):K(n,`store.events.batch.merge`,()=>xM(i,t));return}let a=yM(t,r),o=e.instrumentation;if(o==null){CM(e,a);return}K(o,`store.events.batch.commit`,()=>CM(e,a))}function yM(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(e=>e.canonicalChanged),events:[...e.events],operation:`batch`,projectionChanged:e.events.some(e=>e.projectionChanged),visibleCountDelta:t}}function bM(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function xM(e,t){for(let n of t.events)e.events.push(n);bM(e,t)}function SM(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function CM(e,t){let n=e.instrumentation;if(n==null){wM(e,t);return}K(n,`store.events.emit`,()=>wM(e,t))}function wM(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function TM(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function EM(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!G(n)||$A(n,2))return null;let r=e.snapshot.directories.get(t);if(r==null||r.childIds.length!==1)return null;let i=r.childIds[0];if(i==null)return null;let a=e.snapshot.nodes[i];return a==null||!G(a)?null:i}function DM(e,t){let n=t;for(;;){let t=EM(e,n);if(t==null)return n;n=t}}function OM(e,t){let n=[t],r=t;for(;;){let t=EM(e,r);if(t==null)return n;n.push(t),r=t}}function kM(e,t){let n=t==null?e.snapshot.rootId:RM(e,t);return n==null?[]:BM(e,n)}function AM(e,t){let n=bj(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=tN(e,eN(e,r)),{createdNodeIds:a,directoryId:o}=VM(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=Y(e,o);if($A(n,1))throw Error(`Path already exists: "${t}"`);ej(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=UM(e,o,n.basename),s.add(c);FM(e,o);let l=tN(e,o);return rM({affectedAncestorIds:LM(e,c),affectedNodeIds:[...s],path:t,projectionChanged:nN(i,l)})}function jM(e,t,n){let r=RM(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=Y(e,r);if($A(i,2))throw Error(`The root node cannot be removed`);if(G(i)&&J(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=tN(e,a),s=QM(e,r);KM(e,a,r,i.nameId),$M(e,a),FM(e,a);let c=tN(e,a);return iM({affectedAncestorIds:LM(e,a),affectedNodeIds:s,path:t,projectionChanged:nN(o,c),recursive:n.recursive===!0})}function MM(e,t,n,r){let i=RM(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=Y(e,i);if($A(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=XM(e,i,n),c=tN(e,a.parentId),l=tN(e,s.parentId),u=wj(e.snapshot.segmentTable,a.nameId),d=Cj(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(G(a)&&oN(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=FA(e.snapshot.nodes,J(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&ZM(e,p,o,ZA(a))===`skip`)return null;let m=a.parentId;KM(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),aN(e,i),GM(e,s.parentId,i),$M(e,m),e.pathCacheVersion++,FM(e,m),s.parentId!==m&&FM(e,s.parentId);let h=tN(e,m),g=tN(e,s.parentId);return aM({affectedAncestorIds:[...new Set([...LM(e,m),...LM(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:rN([c,l],[h,g]),to:q(e,i)})}function NM(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function PM(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function q(e,t){let n=Y(e,t),r=NM(e,t);if(r!=null)return r;if($A(n,2))return PM(e,t,``);let i=q(e,n.parentId),a=wj(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return PM(e,t,G(n)?`${o}/`:o)}function FM(e,t){let n=e.instrumentation;if(n==null){cN(e,t);return}K(n,`store.recomputeCountsUpwardFrom`,()=>cN(e,t))}function IM(e,t){let n=[[t,0]],{nodes:r,directories:i}=e.snapshot;for(;n.length>0;){let t=n[n.length-1],a=t[0],o=r[a];if(o==null||!G(o)){sN(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){sN(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function LM(e,t){let n=[],r=t;for(;r!=null;){let t=Y(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function RM(e,t){if(t.length===0)return e.snapshot.rootId;let n=xj(t);return zM(e,n.segments,n.requiresDirectory)}function zM(e,t,n){let r=e.snapshot.rootId;for(let n of t){let t=e.snapshot.segmentTable.idByValue.get(n);if(t===void 0)return null;let i=J(e,r),a=FA(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=Y(e,r);return n&&!G(i)?null:r}function J(e,t){let n=e.snapshot.directories.get(t);if(n===void 0)throw Error(`Unknown directory child index for node ${String(t)}`);return n}function Y(e,t){let n=e.snapshot.nodes[t];if(n===void 0||$A(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function BM(e,t){let n=e.snapshot.nodes[t];if(n===void 0||$A(n,4))return[];if(!G(n))return[q(e,t)];if(J(e,t).childIds.length===0)return $A(n,1)&&!$A(n,2)?[q(e,t)]:[];let r=[],i=[{childIndex:0,nodeId:t}];for(;i.length>0;){let t=i[i.length-1];if(t==null)break;let n=e.snapshot.nodes[t.nodeId];if(n===void 0||$A(n,4)){i.pop();continue}if(!G(n)){r.push(q(e,t.nodeId)),i.pop();continue}let a=J(e,t.nodeId);if(a.childIds.length===0){$A(n,1)&&!$A(n,2)&&r.push(q(e,t.nodeId)),i.pop();continue}let o=a.childIds[t.childIndex];if(o==null){i.pop();continue}t.childIndex++,i.push({childIndex:0,nodeId:o})}return r}function VM(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=Cj(e.snapshot.segmentTable,i),a=J(e,r),o=FA(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!G(Y(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=HM(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function HM(e,t,n){let r=Y(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:YA(XA(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,NA()),GM(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function UM(e,t,n){let r=Cj(e.snapshot.segmentTable,n),i=J(e,t);if(FA(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${uN(e,t,n)}"`);let a=Y(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:YA(XA(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),GM(e,t,o),e.activeNodeCount++,o}function WM(e,t,n){let r=0,i=t.childIds.length;for(;r<i;){let a=r+i>>>1,o=t.childIds[a];if(o==null){i=a;continue}qM(e,n,o)<0?i=a:r=a+1}return r}function GM(e,t,n){let r=J(e,t),i=Y(e,n);FA(e.snapshot.nodes,r).set(i.nameId,n),BA(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=WM(e,r,n);r.childIds.splice(a,0,n),RA(r,a),UA(e.snapshot.nodes,r)}function KM(e,t,n,r){let i=J(e,t),a=IA(i),o=a.get(n)??-1;FA(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&BA(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),RA(i,o),UA(e.snapshot.nodes,i))}function qM(e,t,n){let r=e.snapshot.options.sort;return r==="default"?JM(e,t,n):r(YM(e,t),YM(e,n))}function JM(e,t,n){let r=Y(e,t),i=Y(e,n),a=G(r);if(a!==G(i))return a?-1:1;let o=uj(_j(e.snapshot.segmentTable,r.nameId),_j(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=wj(e.snapshot.segmentTable,r.nameId),c=wj(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function YM(e,t){let n=Y(e,t),r=q(e,t),i=G(n),a=i?r.slice(0,-1):r;return{basename:wj(e.snapshot.segmentTable,n.nameId),depth:XA(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function XM(e,t,n){let r=Y(e,t),i=RM(e,n);if(i!=null){let t=Y(e,i);if(G(t))return{basename:wj(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=xj(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=xj(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:zM(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function ZM(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${q(e,t)}"`);let i=Y(e,t);if(ZA(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(G(i)&&J(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return QM(e,t),KM(e,a,t,o),$M(e,a),FM(e,a),`handled`}function QM(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=Y(e,t.nodeId);if(t.visitedChildren||!G(i)){G(i)&&e.snapshot.directories.delete(t.nodeId),ej(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),tM(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=J(e,t.nodeId);for(let e=a.childIds.length-1;e>=0;e--){let t=a.childIds[e];t!=null&&r.push({nodeId:t,visitedChildren:!1})}}return n}function $M(e,t){let n=t;for(;n!=null;){let t=Y(e,n);if(!G(t)||$A(t,2)||J(e,n).childIds.length>0)return;ej(t,1),n=t.parentId===n?null:t.parentId}}function eN(e,t){let n=e.snapshot.rootId;for(let r of t){let t=e.snapshot.segmentTable.idByValue.get(r);if(t==null)break;let i=FA(e.snapshot.nodes,J(e,n)).get(t);if(i==null||!G(Y(e,i)))break;n=i}return n}function tN(e,t){let n=iN(e,t);if(n==null)return null;let r=DM(e,n),i=Y(e,r),a=n===r?null:OM(e,n).map(t=>q(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:J(e,r).childIds.length>0,path:q(e,r),terminalKind:ZA(i)})}function nN(e,t){return rN([e],[t])}function rN(e,t){for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(r==null||i==null||r!==i)return!0}return!1}function iN(e,t){let n=t;for(;n!=null;){let t=Y(e,n);if(!G(t)||$A(t,2))return null;if(!Kj(e,n,t))return n;n=t.parentId}return null}function aN(e,t){let n=Y(e,t);if(tj(n,(t===e.snapshot.rootId?-1:XA(Y(e,n.parentId)))+1),!G(n))return;let r=J(e,t);for(let t of r.childIds)aN(e,t)}function oN(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=Y(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function sN(e,t,n=Y(e,t),r=!1){let i=e.instrumentation;if(i==null){lN(e,t,n,r);return}K(i,`store.recomputeNodeCounts`,()=>lN(e,t,n,r))}function cN(e,t){let n=t;for(;n!=null;){let t=Y(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(sN(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&BA(J(e,s),n,a,o),n=s}}function lN(e,t,n,r){if(!G(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=J(e,t);if(r){let t=e.instrumentation;t==null?zA(e.snapshot.nodes,i):K(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>zA(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,$A(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=EM(e,t)==null?Kj(e,t,n)?1+o:1:o}function uN(e,t,n){let r=q(e,t);return r.length===0?n:`${r}${n}`}function dN(e){return e!=null&&!$A(e,4)}function fN(e,t){let n=e.snapshot.nodes[t];return!dN(n)||!G(n)||$A(n,2)?null:n}function pN(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&dN(e.snapshot.nodes[n])&&(t+=1);return t}function mN(e){return Math.max(0,e.valueById.length-1)}function hN(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:pN(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:mN(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function gN(e,t,n,r){return{activeNodeCountAfter:r.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:r.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:r.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-r.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-r.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-r.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-r.segmentCount,segmentCountAfter:r.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:r.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function _N(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)fN(e,n)!=null&&t.push(q(e,n));for(let t of e.expandedDirectoryIds)fN(e,t)!=null&&n.push(q(e,t));return{collapsedPaths:t,expandedPaths:n}}function vN(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)fN(e,n)!=null&&Yj(e,n)!==`loaded`&&t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:q(e,n)});return t}function yN(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=RM(e,n);t!=null&&qj(e,t,!0,Y(e,t))}for(let n of t.collapsedPaths){let t=RM(e,n);t!=null&&qj(e,t,!1,Y(e,t))}}function bN(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=RM(e,n.path);t!=null&&fN(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function xN(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function SN(e){let t=e.snapshot.segmentTable,n=Sj();for(let r of e.snapshot.nodes)if(dN(r)){if($A(r,2)){r.nameId=0;continue}r.nameId=Cj(n,wj(t,r.nameId))}e.snapshot.segmentTable=n}function CN(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!dN(r)||!G(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return dN(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[Y(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),zA(e.snapshot.nodes,n)}}function wN(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(dN(n))break;--t}e.snapshot.nodes.length=t+1}function TN(e){let t=_N(e),n=vN(e);K(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>xN(e)),K(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>SN(e)),K(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>CN(e)),K(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>wN(e)),K(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>yN(e,t)),K(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>bN(e,n)),K(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>IM(e,e.snapshot.rootId))}function EN(e){let t=_N(e),n=vN(e),r=K(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>kM(e)),i=rj({...e.snapshot.options},e.instrumentation),a=K(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new Vj(i);return e.appendPaths(r),e.finish()});e.snapshot=a,e.activeNodeCount=a.nodes.length-1,e.pathCacheByNodeId=new Map([[a.rootId,{path:``,version:0}]]),e.pathCacheVersion=0,K(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>yN(e,t)),K(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>bN(e,n)),K(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>IM(e,e.snapshot.rootId))}function DN(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function ON(e,t){let n=hN(e);t===`stable`?K(e.instrumentation,`store.cleanup.stable`,()=>TN(e)):K(e.instrumentation,`store.cleanup.aggressive`,()=>EN(e));let r=hN(e);return gN(t,t===`stable`,n,r)}var kN=64;function AN(e,t){let n=t+2;if(n<=e.length)return e;let r=e.length;for(;r<n;)r*=2;let i=new Int32Array(r);return i.fill(-1),i.set(e),i}function jN(e){return Y(e,e.snapshot.rootId).visibleSubtreeCount}function MN(e,t,n,r){let i=Y(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function NN(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:QN(e,t.cursor),setSize:t.setSize,subtreeEndIndex:MN(e,t.cursor,t.index,n)}}function PN(e,t,n,r,i,a){let o=J(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=VA(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return FN(e,u,l,r+c,i+1,s,o.childIds.length,a)}function FN(e,t,n,r,i,a,o,s){if(!G(Y(e,t))){if(n===0)return{ancestors:s,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:i},index:r,posInSet:a,setSize:o};throw Error(`Visible index ${String(n)} is out of range for file`)}let c=KN(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=Y(e,c.terminalNodeId);if(!G(l)||!Kj(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return PN(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function IN(e,t){let n=jN(e);if(t<0||t>=n)return null;let r=PN(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>q(e,t.cursor.terminalNodeId)),a=null;return{ancestorPaths:i,get ancestorRows(){if(a!=null)return a;let t=[],i=[];for(let a of r.ancestors){let r=NN(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:QN(e,r.cursor),setSize:r.setSize,subtreeEndIndex:MN(e,r.cursor,r.index,n)}}function LN(e,t,n){let r=e.instrumentation,i=jN(e);if(i<=0||n<t)return[];let a=Math.max(0,Math.min(t,i-1)),o=Math.max(a,Math.min(n,i-1));if(r==null){if(a===0)return ZN(e,o+1);let t=[],n=UN(e,a);for(let r=a;r<=o&&n!=null;r++){let r=QN(e,n);t.push(r),n=JN(e,n)}return t}let s=[],c=0,l=0,u=K(r,`store.getVisibleSlice.selectFirstRow`,()=>UN(e,a));for(let t=a;t<=o&&u!=null;t++){let t=K(r,`store.getVisibleSlice.materializeRow`,()=>QN(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=K(r,`store.getVisibleSlice.advanceCursor`,()=>JN(e,u))}return aj(r,`workload.visibleRowsRead`,s.length),aj(r,`workload.flattenedRowsRead`,c),aj(r,`workload.flattenedSegmentsRead`,l),s}function RN(e,t=jN(e)){let n=e.instrumentation;return n==null?XN(e,t):K(n,`store.getVisibleTreeProjection`,()=>XN(e,t))}function zN(e){return YN(RN(e))}function BN(e,t){let n=RM(e,t);if(n==null||n===e.snapshot.rootId||G(Y(e,n))&&DM(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=Y(e,i).parentId,n=J(e,t),s=IA(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=HA(a,n,s),t!==o){let n=Y(e,t),a=EM(e,t);if(!Kj(e,t,n)&&a!==i)return null;DM(e,t)===t&&(r+=1)}i=t}return r}function VN(e,t){let n=RM(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=Y(e,n);if(!G(r))throw Error(`Path is not a directory: "${t}"`);return Kj(e,n,r)?null:(qj(e,n,!0,r),FM(e,n),oM({affectedAncestorIds:LM(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function HN(e,t){let n=RM(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=Y(e,n);if(!G(r))throw Error(`Path is not a directory: "${t}"`);return Kj(e,n,r)?(qj(e,n,!1,r),FM(e,n),sM({affectedAncestorIds:LM(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function UN(e,t){return t<0||t>=jN(e)?null:WN(e,e.snapshot.rootId,t,-1)}function WN(e,t,n,r){let i=J(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?VA(e.snapshot.nodes,i,n):K(a,`store.getVisibleSlice.selectChildIndex`,()=>VA(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return GN(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function GN(e,t,n,r){if(!G(Y(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:r};throw Error(`Visible index ${String(n)} is out of range for file`)}let i=KN(e,t,r);if(n===0)return i;let a=Y(e,i.terminalNodeId);if(!G(a)||!Kj(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return WN(e,i.terminalNodeId,n-1,i.visibleDepth)}function KN(e,t,n){return G(Y(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:DM(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:K(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>DM(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function qN(e,t){let n=Y(e,t);if(!G(n))return!0;let r=n.parentId;return r===e.snapshot.rootId||EM(e,r)!==t}function JN(e,t){let n=Y(e,t.terminalNodeId);if(G(n)){let r=J(e,t.terminalNodeId);if(Kj(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:GN(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=Y(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=J(e,n),o=IA(a).get(r)??-1;if(o<0)throw Error(`Child ${String(r)} was not found in its parent index`);let s=a.childIds[o+1]??null;if(s!=null)return GN(e,s,0,i);qN(e,r)&&i--,r=n}}function YN(e){let t=e.paths.length,n=Array(t);for(let r=0;r<t;r+=1){let t=e.getParentIndex(r);n[r]={index:r,parentPath:t>=0?e.paths[t]??null:null,path:e.paths[r]??``,posInSet:e.posInSetByIndex[r]??0,setSize:e.setSizeByIndex[r]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function XN(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(kN);o.fill(-1);let s=0,{nodes:c,directories:l,segmentTable:u}=e.snapshot,d=[[l.get(e.snapshot.rootId),0,-1,``]],f=e.snapshot.options.flattenEmptyDirectories,p=e.pathCacheByNodeId,m=e.pathCacheVersion,h=u.valueById;for(;d.length>0&&s<t;){let t=d[d.length-1],u=t[0];if(t[1]>=u.childIds.length){d.pop();continue}let g=t[1],_=u.childIds[t[1]++],v=c[_],y=t[2]+1,b=t[3];o=AN(o,y);let x,S=_;if(G(v))S=f?DM(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:q(e,S);else{let e=p.get(_);x=e!=null&&e.version===m?e.path:`${b}${h[v.nameId]}`}r[s]=o[y],n[s]=x,i[s]=g,a[s]=u.childIds.length,o[y+1]=s,s+=1;let C=c[S];C!=null&&G(C)&&Kj(e,S,C)&&d.push([l.get(S),0,y,x])}s<t&&(n.length=s);let g=r.subarray(0,s),_=i.subarray(0,s),v=a.subarray(0,s),y=null;return{getParentIndex(e){return e<0||e>=s?-1:g[e]??-1},paths:n,posInSetByIndex:_,setSizeByIndex:v,get visibleIndexByPath(){if(y==null){y=new Map;for(let e=0;e<s;e+=1)y.set(n[e]??``,e)}return y}}}function ZN(e,t){let n=Array(t),r=0,{nodes:i,directories:a,segmentTable:o}=e.snapshot,s=[[a.get(e.snapshot.rootId),0,-1]],c=o.valueById,l=e.snapshot.options.flattenEmptyDirectories,u=e.pathCacheByNodeId,d=e.pathCacheVersion;for(;s.length>0&&r<t;){let t=s[s.length-1],o=t[0];if(t[1]>=o.childIds.length){s.pop();continue}let f=o.childIds[t[1]++],p=i[f],m=t[2]+1;if(!G(p)){let t=u.get(f);n[r++]={depth:m,flattenedSegments:void 0,hasChildren:!1,id:f,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:`file`,loadState:void 0,name:c[p.nameId],path:t!=null&&t.version===d?t.path:q(e,f)};continue}let h=l?DM(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=QN(e,g);let _=i[h];_!=null&&G(_)&&Kj(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function QN(e,t){let n=Y(e,t.terminalNodeId),r=G(n)?$N(e,t):null,i=q(e,t.terminalNodeId),a=wj(e.snapshot.segmentTable,n.nameId),o=G(n)&&J(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?OM(e,t.headNodeId).map(n=>{let r=Y(e,n);return{isTerminal:n===t.terminalNodeId,name:wj(e.snapshot.segmentTable,r.nameId),nodeId:n,path:q(e,n)}}):K(c,`store.getVisibleSlice.flatten.collectSegments`,()=>OM(e,t.headNodeId).map(n=>{let r=Y(e,n);return{isTerminal:n===t.terminalNodeId,name:wj(e.snapshot.segmentTable,r.nameId),nodeId:n,path:q(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:G(n)&&Kj(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:G(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function $N(e,t){if(t.headNodeId===t.terminalNodeId)return Yj(e,t.terminalNodeId);let n=OM(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=Yj(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}var eP=8;function tP(e){let{nodes:t,directories:n,rootId:r,options:i}=e,a=t.length,o=new Int32Array(a),s=new Int32Array(a),c=new Int32Array(a),l=new Int32Array(a),u=new Int32Array(a),d=new Int32Array(a),f=new Int32Array(a);for(let e=0;e<a;e+=1){let n=t[e];n!=null&&(o[e]=n.parentId,s[e]=n.nameId,c[e]=n.depthAndFlags,l[e]=n.subtreeNodeCount,u[e]=n.visibleSubtreeCount)}let p=0;for(let e of n.values())p+=e.childIds.length;let m=new Int32Array(p),h=0;for(let[e,t]of n){let n=t.childIds;d[e]=h,f[e]=n.length;for(let e=0;e<n.length;e+=1)m[h]=n[e],h+=1}return{nodeCount:a,rootId:r,flattenEmptyDirectories:i.flattenEmptyDirectories===!0,parentId:o,nameId:s,depthAndFlags:c,subtreeNodeCount:l,visibleSubtreeCount:u,childStart:d,childCount:f,childIdsFlat:m}}function nP(e){let{nodeCount:t,rootId:n,flattenEmptyDirectories:r,depthAndFlags:i,subtreeNodeCount:a,visibleSubtreeCount:o,childStart:s,childCount:c,childIdsFlat:l}=e;for(let e=t-1;e>=1;--e){if((i[e]&eP)===0)continue;let t=s[e],n=c[e],u=0,d=0;for(let e=0;e<n;e+=1){let n=l[t+e];u+=a[n],d+=o[n]}a[e]=1+u;let f;f=r&&n===1?(i[l[t]]&eP)===0?1+d:d:1+d,o[e]=f}let u=s[n],d=c[n],f=0,p=0;for(let e=0;e<d;e+=1){let t=l[u+e];f+=a[t],p+=o[t]}a[n]=1+f,o[n]=p}function rP(e){let{directories:t,nodes:n,options:r,rootId:i,presortedDirectoryNodeIds:a}=e.snapshot,o=r.flattenEmptyDirectories===!0,s=e=>{let r=n[e];if(r==null||!G(r))return;let i=t.get(e);if(i==null)throw Error(`Unknown directory child index for node ${String(e)}`);let a=i.childIds,s=a.length,c=0,l=0;for(let e=0;e<s;e++){let t=a[e];if(t==null)continue;let r=n[t];c+=r.subtreeNodeCount,l+=r.visibleSubtreeCount}i.totalChildSubtreeNodeCount=c,i.totalChildVisibleSubtreeCount=l,s>=128&&UA(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&G(e)?l:1+l}else u=1+l;r.visibleSubtreeCount=u};if(a!=null)for(let e=a.length-1;e>=0;e--)s(a[e]);else for(let e=n.length-1;e>=1;e--)s(e);let c=n[i],l=t.get(i);if(c==null||l==null)return;let u=l.childIds,d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t==null)continue;let r=n[t];d+=r.subtreeNodeCount,f+=r.visibleSubtreeCount}l.totalChildSubtreeNodeCount=d,l.totalChildVisibleSubtreeCount=f,UA(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function iP(e){let{directories:t,nodes:n,rootId:r}=e.snapshot,i=tP(e.snapshot);nP(i);let a=i.subtreeNodeCount,o=i.visibleSubtreeCount;for(let e=0;e<n.length;e+=1){let t=n[e];t!=null&&(t.subtreeNodeCount=a[e],t.visibleSubtreeCount=o[e])}for(let[e,i]of t){let t=i.childIds,a=t.length,o=0,s=0;for(let e=0;e<a;e++){let r=t[e];if(r==null)continue;let i=n[r];o+=i.subtreeNodeCount,s+=i.visibleSubtreeCount}i.totalChildSubtreeNodeCount=o,i.totalChildVisibleSubtreeCount=s,(e===r||a>=128)&&UA(n,i)}}function aP(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var oP=class e{#e;constructor(e={}){let t=ij(e),n=K(t,`store.builder.create`,()=>new Vj(e));if(e.preparedInput!=null){let t=Rj(e.preparedInput);t==null?n.appendPreparedPaths(Lj(e.preparedInput),!1):n.appendPresortedPaths(t,zj(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(K(t,`store.preparePathEntries`,()=>Bj(r,e)))}let r=K(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=K(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=K(t,`store.state.create`,()=>Hj(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:K(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||aP(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&K(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?e.useSoaCountSweep===!0?K(t,`store.state.initializeOpenVisibleCountsViaSoa`,()=>iP(this.#e)):K(t,`store.state.initializeOpenVisibleCounts`,()=>rP(this.#e)):K(t,`store.state.recomputeCounts`,()=>IM(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return Pj(e,t)}static prepareInput(e,t={}){return Fj(e,t)}static preparePresortedInput(e){return Ij(e)}list(e){return K(this.#e.instrumentation,`store.list`,()=>kM(this.#e,e))}add(e){K(this.#e.instrumentation,`store.add`,()=>{let t=jN(this.#e);gM(this.#e,mM(this.#e,t,AM(this.#e,e)))})}remove(e,t={}){K(this.#e.instrumentation,`store.remove`,()=>{let n=jN(this.#e);gM(this.#e,mM(this.#e,n,jM(this.#e,e,t)))})}move(e,t,n={}){K(this.#e.instrumentation,`store.move`,()=>{let r=jN(this.#e),i=MM(this.#e,e,t,n);i!=null&&gM(this.#e,mM(this.#e,r,i))})}batch(e){hM(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision})}})}getVisibleCount(){return K(this.#e.instrumentation,`store.getVisibleCount`,()=>jN(this.#e))}getVisibleSlice(e,t){return K(this.#e.instrumentation,`store.getVisibleSlice`,()=>LN(this.#e,e,t))}getVisibleRowContext(e){return K(this.#e.instrumentation,`store.getVisibleRowContext`,()=>IN(this.#e,e))}getVisibleTreeProjection(){return zN(this.#e)}getVisibleTreeProjectionData(e){return RN(this.#e,e)}getVisibleIndex(e){return K(this.#e.instrumentation,`store.getVisibleIndex`,()=>BN(this.#e,e))}getPathInfo(e){return K(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=RM(this.#e,e);if(t==null)return null;let n=Y(this.#e,t);return{depth:XA(n),kind:G(n)?`directory`:`file`,path:q(this.#e,t)}})}isExpanded(e){return K(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=Y(this.#e,t);return Kj(this.#e,t,n)})}expand(e){K(this.#e.instrumentation,`store.expand`,()=>{let t=jN(this.#e),n=VN(this.#e,e);n!=null&&gM(this.#e,mM(this.#e,t,n))})}collapse(e){K(this.#e.instrumentation,`store.collapse`,()=>{let t=jN(this.#e),n=HN(this.#e,e);n!=null&&gM(this.#e,mM(this.#e,t,n))})}on(e,t){return nM(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return Yj(this.#e,t)}markDirectoryUnloaded(e){K(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(J(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=jN(this.#e);Zj(this.#e,t),gM(this.#e,mM(this.#e,n,cM({affectedAncestorIds:LM(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return K(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=jN(this.#e),r=Xj(this.#e,t);return gM(this.#e,mM(this.#e,n,lM({affectedAncestorIds:LM(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return K(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||Yj(this.#e,n)!==`loading`||!$j(this.#e,n,e.attemptId))return!1;let r=q(this.#e,n);this.validateChildPatch(r,t);let i=jN(this.#e),a=[];for(let e of t.operations){sP(r,e);let t=jN(this.#e);switch(e.type){case`add`:a.push(mM(this.#e,t,AM(this.#e,e.path)));break;case`remove`:a.push(mM(this.#e,t,jM(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=MM(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(mM(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return gM(this.#e,mM(this.#e,i,uM({affectedAncestorIds:LM(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:q(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return K(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=jN(this.#e),r=Qj(this.#e,t,e.attemptId);return gM(this.#e,mM(this.#e,n,dM({affectedAncestorIds:LM(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:q(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return K(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=jN(this.#e),i=eM(this.#e,n,e.attemptId,t);return gM(this.#e,mM(this.#e,r,fM({affectedAncestorIds:LM(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:q(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return K(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(DN(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=jN(this.#e),n=ON(this.#e,e.mode??`stable`);return gM(this.#e,mM(this.#e,t,pM({...n,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:n.idsPreserved===!1}))),n})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(e){if(e==null||e.length===0)return 0;let t=0,n=[],r=[],i=0,a=null,o=this.#e.snapshot.segmentTable,s=o.valueById,c=this.#e.snapshot.nodes,l=new Map;for(let u of e){a!=null&&u<a&&(a=null,i=0,n.length=0,r.length=0);let e=u.length>0&&u.charCodeAt(u.length-1)===47?u.length-1:u.length;if(e===0){a=u,i=e,n.length=0,r.length=0;continue}let d=0,f=0;if(a!=null){let t=Math.min(e,i),n=!0;for(let e=0;e<t;e+=1){let t=u.charCodeAt(e);if(t!==a.charCodeAt(e)){n=!1;break}t===47&&(d+=1,f=e+1)}n&&(t===i&&e>t&&u.charCodeAt(t)===47?(d+=1,f=t+1):t===e&&i>t&&a.charCodeAt(t)===47&&(d+=1,f=e+1)),d=Math.min(d,r.length)}let p=d===0?this.#e.snapshot.rootId:r[d-1]??this.#e.snapshot.rootId,m=d,h=!0,g=f;for(;g<=e;){let t=u.indexOf(`/`,g),i=t===-1||t>e?e:t,a=u.slice(g,i),f=J(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??cj(a);l.set(a,b);let x=(e,t)=>{for(v=e;v<t;v+=1){let e=f[v],t=c[e],n=s[t.nameId];if(n===a)return y=e,!0;let r=uj(_j(o,t.nameId),b);if(r>0||r===0&&n>a)return!1}return!1};if(!x(_,f.length)&&_>0&&x(0,_),y===void 0){h=!1;break}if(!G(Y(this.#e,y))){h=!1;break}if(n[m]=v,r[m]=y,p=y,m+=1,i===e)break;g=i+1}if(a=u,i=e,n.length=m,r.length=m,!h){a=null,i=0,n.length=0,r.length=0;continue}for(let e=d;e<m;e+=1){let n=r[e];if(n==null)continue;let i=Y(this.#e,n);Kj(this.#e,n,i)||(qj(this.#e,n,!0,i),t+=1)}}return t}hasAllDirectoriesExpanded(){for(let e of this.#e.snapshot.directories.keys()){if(e===this.#e.snapshot.rootId)continue;let t=Y(this.#e,e);if(!Kj(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=RM(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!G(Y(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!G(Y(this.#e,e)))throw Error(`Node is not a directory: ${String(e)}`);return e}catch{return null}}isDirectoryProjectionVisible(e){let t=e;for(;t!==this.#e.snapshot.rootId;){let e=Y(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=Y(this.#e,e),r=EM(this.#e,e);if(!Kj(this.#e,e,n)&&r!==t)return!1}t=e}return!0}validateChildPatch(t,n){new e({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function sP(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`)}}var cP={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function lP(e,t){if(typeof e==`number`)return{itemHeight:t??cP.default.itemHeight,factor:e};let n=cP[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var uP=cP.default.itemHeight,dP=`@layer base {
|
|
1698
|
+
</symbol>`],uA=[dk,fk,mk,hk,gk,_k,yk,wk,Tk,kk,Ik,Lk,Rk,zk,Bk,Hk,Gk,Kk,qk,Jk,Yk,Qk,$k,nA,rA,iA,aA,oA,sA,cA];function dA(e,t){return t.length===0?e:e.replace(`</svg>`,`\n ${t.join(`
|
|
1699
|
+
`)}\n</svg>`)}var fA=dA(uk,lA),pA={minimal:uk,standard:fA,complete:dA(fA,uA)},mA={".babelrc":`babel`,".babelrc.json":`babel`,".bash_profile":`bash`,".bashrc":`bash`,".browserslistrc":`browserslist`,".dockerignore":`docker`,".eslintignore":`eslint`,".eslintrc":`eslint`,".eslintrc.cjs":`eslint`,".eslintrc.js":`eslint`,".eslintrc.json":`eslint`,".eslintrc.yaml":`eslint`,".eslintrc.yml":`eslint`,".gitattributes":`git`,".gitignore":`git`,".gitkeep":`git`,".gitmodules":`git`,".oxlintrc.json":`oxc`,".postcssrc":`postcss`,".postcssrc.json":`postcss`,".postcssrc.yaml":`postcss`,".postcssrc.yml":`postcss`,".prettierignore":`prettier`,".prettierrc":`prettier`,".prettierrc.cjs":`prettier`,".prettierrc.js":`prettier`,".prettierrc.json":`prettier`,".prettierrc.mjs":`prettier`,".prettierrc.toml":`prettier`,".prettierrc.yaml":`prettier`,".prettierrc.yml":`prettier`,".stylelintignore":`stylelint`,".stylelintrc":`stylelint`,".stylelintrc.cjs":`stylelint`,".stylelintrc.js":`stylelint`,".stylelintrc.json":`stylelint`,".stylelintrc.mjs":`stylelint`,".stylelintrc.yaml":`stylelint`,".stylelintrc.yml":`stylelint`,".terraform.lock.hcl":`terraform`,".zprofile":`bash`,".zshenv":`bash`,".zshrc":`bash`,"babel.config.cjs":`babel`,"babel.config.js":`babel`,"babel.config.json":`babel`,"babel.config.mjs":`babel`,"biome.json":`biome`,"biome.jsonc":`biome`,"bootstrap.bundle.js":`bootstrap`,"bootstrap.bundle.min.js":`bootstrap`,"bootstrap.css":`bootstrap`,"bootstrap.js":`bootstrap`,"bootstrap.min.css":`bootstrap`,"bootstrap.min.js":`bootstrap`,"bun.lock":`bun`,"bun.lockb":`bun`,"bunfig.toml":`bun`,"claude.md":`claude`,"compose.yaml":`docker`,"compose.yml":`docker`,"docker-compose.override.yml":`docker`,"docker-compose.yaml":`docker`,"docker-compose.yml":`docker`,dockerfile:`docker`,"eslint.config.cjs":`eslint`,"eslint.config.js":`eslint`,"eslint.config.mjs":`eslint`,"eslint.config.mts":`eslint`,"eslint.config.ts":`eslint`,gemfile:`ruby`,"next.config.js":`nextjs`,"next.config.mjs":`nextjs`,"next.config.mts":`nextjs`,"next.config.ts":`nextjs`,"postcss.config.cjs":`postcss`,"postcss.config.js":`postcss`,"postcss.config.mjs":`postcss`,"postcss.config.ts":`postcss`,"prettier.config.cjs":`prettier`,"prettier.config.js":`prettier`,"prettier.config.mjs":`prettier`,rakefile:`ruby`,"readme.md":`markdown`,"stylelint.config.cjs":`stylelint`,"stylelint.config.js":`stylelint`,"stylelint.config.mjs":`stylelint`,"svgo.config.cjs":`svgo`,"svgo.config.js":`svgo`,"svgo.config.mjs":`svgo`,"svgo.config.ts":`svgo`,"tailwind.config.cjs":`tailwind`,"tailwind.config.js":`tailwind`,"tailwind.config.mjs":`tailwind`,"tailwind.config.ts":`tailwind`,"vite.config.js":`vite`,"vite.config.mjs":`vite`,"vite.config.mts":`vite`,"vite.config.ts":`vite`,"webpack.config.babel.js":`webpack`,"webpack.config.cjs":`webpack`,"webpack.config.js":`webpack`,"webpack.config.mjs":`webpack`,"webpack.config.ts":`webpack`},hA={"7z":`zip`,astro:`astro`,AUTHORS:`text`,avif:`image`,bash:`bash`,bmp:`image`,bz2:`zip`,c:`c`,cc:`cpp`,cfg:`text`,CHANGELOG:`text`,cjs:`javascript`,"code-workspace":`vscode`,conf:`text`,CONTRIBUTORS:`text`,cpp:`cpp`,csh:`bash`,css:`css`,csv:`table`,cts:`typescript`,cxx:`cpp`,db:`database`,editorconfig:`text`,env:`text`,"env.development":`text`,"env.local":`text`,"env.production":`text`,eot:`font`,erb:`ruby`,fish:`bash`,gemspec:`ruby`,gif:`image`,go:`go`,gql:`graphql`,graphql:`graphql`,gz:`zip`,h:`c`,hh:`cpp`,hpp:`cpp`,htm:`html`,html:`html`,hxx:`cpp`,icns:`image`,ico:`image`,ini:`text`,inl:`cpp`,jar:`zip`,jpeg:`image`,jpg:`image`,js:`javascript`,json:`json`,json5:`json`,jsonc:`json`,jsonl:`json`,jsx:`javascript`,ksh:`bash`,less:`css`,LICENSE:`text`,log:`text`,markdown:`markdown`,mcp:`mcp`,md:`markdown`,mdx:`markdown`,"mdx.tsx":`markdown`,mjs:`javascript`,mm:`cpp`,mts:`typescript`,ods:`table`,otf:`font`,png:`image`,postcss:`css`,py:`python`,pyi:`python`,pyw:`python`,pyx:`python`,rake:`ruby`,rar:`zip`,rb:`ruby`,rs:`rust`,rst:`text`,rtf:`text`,sass:`css`,scss:`css`,sh:`bash`,sql:`database`,sqlite:`database`,sqlite3:`database`,styl:`css`,svelte:`svelte`,svg:`svg`,swift:`swift`,tar:`zip`,tf:`terraform`,tfstate:`terraform`,tfvars:`terraform`,tgz:`zip`,tif:`image`,tiff:`image`,ts:`typescript`,tsv:`table`,tsx:`typescript`,ttf:`font`,txt:`text`,vue:`vue`,war:`zip`,wasm:`wasm`,wast:`wasm`,wat:`wasm`,webp:`image`,woff:`font`,woff2:`font`,xhtml:`html`,xls:`table`,xlsx:`table`,xz:`zip`,yaml:`yml`,yml:`yml`,zig:`zig`,zip:`zip`,zsh:`bash`},gA={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},_A=new Set([`bash`,`c`,`cpp`,`css`,`database`,`default`,`font`,`git`,`go`,`html`,`image`,`javascript`,`json`,`markdown`,`mcp`,`python`,`ruby`,`rust`,`swift`,`table`,`text`,`typescript`,`zip`]),vA=new Set([`complete`]);function yA(e){return pA[e===`none`?`minimal`:e]}function bA(e){return`file-tree-builtin-${e}`}function xA(e){return e!==`none`&&vA.has(e)}function SA(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=mA[t.toLowerCase()];if(i!=null&&(r||_A.has(i)))return i;for(let e of n){if(r){let t=gA[e];if(t!=null)return t}let t=hA[e];if(t!=null&&(r||_A.has(t)))return t}return`default`}var CA=`file-tree-container`,wA=`data-file-tree-style`,TA=`data-file-tree-unsafe-css`,EA=`data-file-tree-scrollbar-measure`,DA=`data-file-tree-scrollbar-gutter-measured`,OA=`--trees-scrollbar-gutter-measured`,kA=`header`,AA=`context-menu`,jA=`context-menu-trigger`;function MA(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function NA(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(MA(e)?`none`:`complete`),colored:e.colored??!0}}var PA=e=>e.trim().toLowerCase(),FA=e=>e.split(`/`).at(-1)??e,IA=e=>{let t=e.toLowerCase().split(`.`),n=[];for(let e=1;e<t.length;e+=1)n.push(t.slice(e).join(`.`));return n};function LA(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function RA(e){let t=NA(e),n=t.remap,r=new Map;for(let[e,n]of Object.entries(t.byFileName??{}))r.set(e.toLowerCase(),n);let i=new Map;for(let[e,n]of Object.entries(t.byFileExtension??{}))i.set(PA(e),n);let a=Object.entries(t.byFileNameContains??{}).map(([e,t])=>[e.toLowerCase(),t]);return{resolveIcon:(e,o)=>{if(e===`file-tree-icon-file`&&o!=null){let s=FA(o),c=s.toLowerCase(),l=r.get(c);if(l!=null)return LA(l,e);for(let[t,n]of a)if(c.includes(t))return LA(n,e);let u=IA(s);for(let t of u){let n=i.get(t);if(n!=null)return LA(n,e)}let d=SA(t.set,s,u);if(d!=null&&t.set!==`none`){if(d==="default"){let t=n?.[e];if(t!=null)return LA(t,e)}return{name:bA(d),remappedFrom:e,token:d}}}let s=n?.[e];return s==null?{name:e}:LA(s,e)}}}var zA=5,BA=32,VA=128;function HA(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function UA(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function WA(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;let n=new Map;for(let r of t.childIds){let t=e[r];t!=null&&n.set(t.nameId,r)}return t.childIdByNameId=n,n}function GA(e){if(e.childPositionById!=null)return e.childPositionById;let t=new Map;for(let n=0;n<e.childIds.length;n++){let r=e.childIds[n];r!=null&&t.set(r,n)}return e.childPositionById=t,t}function KA(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function qA(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){let t=e.childIds[n];t!=null&&e.childPositionById.set(t,n)}}function JA(e,t){let n=0,r=0;for(let i of t.childIds){let t=e[i];t!=null&&(n+=t.subtreeNodeCount,r+=t.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=r,QA(e,t)}function YA(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=GA(e).get(t);if(i===void 0)return;let a=i>>zA;e.childVisibleChunkSums[a]+=r}function XA(e,t,n){let r=t.childVisibleChunkSums;if(r!=null){let i=n,a=0;for(let o of r){if(i<o){let r=$A(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=BA}throw Error(`Visible child index ${String(n)} is out of range`)}let i=n;for(let r=0;r<t.childIds.length;r++){let a=t.childIds[r];if(a==null)continue;let o=e[a];if(o!=null){if(i<o.visibleSubtreeCount)return{childIndex:r,childVisibleIndex:n-i,localVisibleIndex:i};i-=o.visibleSubtreeCount}}throw Error(`Visible child index ${String(n)} is out of range`)}function ZA(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>zA;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<zA}for(let i=a;i<n;i+=1){let n=t.childIds[i];if(n==null)continue;let a=e[n];a!=null&&(r+=a.visibleSubtreeCount)}return r}function QA(e,t){if(t.childIds.length<VA){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/BA),r=new Int32Array(n);for(let n=0;n<t.childIds.length;n++){let i=t.childIds[n];if(i==null)continue;let a=e[i];a!=null&&(r[n>>zA]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function $A(e,t,n,r){let i=Math.min(t.childIds.length,n+BA),a=r;for(let r=n;r<i;r++){let n=t.childIds[r];if(n==null)continue;let i=e[n];if(i!=null){if(a<i.visibleSubtreeCount)return{childIndex:r,localVisibleIndex:a};a-=i.visibleSubtreeCount}}throw Error(`Visible child index ${String(r)} is out of range`)}var ej=7,tj=3,nj=8,rj=4;function ij(e,t,n=0){return e<<rj|n<<tj|t}function aj(e){return e.depthAndFlags>>>rj}function oj(e){return(e.depthAndFlags&nj)>>tj}function G(e){return(e.depthAndFlags&nj)!==0}function sj(e){return e.depthAndFlags&ej}function cj(e,t){return(sj(e)&t)!==0}function lj(e,t){e.depthAndFlags|=t}function uj(e,t){e.depthAndFlags=ij(t,sj(e),oj(e))}var dj=Symbol(`benchmarkInstrumentation`);function fj(e,t){return t==null||Object.defineProperty(e,dj,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function pj(e){return e==null?null:e[dj]??null}function K(e,t,n){return e==null?n():e.measurePhase(t,n)}function mj(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function hj(e){return e>=48&&e<=57}function gj(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!hj(e.charCodeAt(r));)r+=1;if(r>=e.length)break;r>n&&t.push(e.slice(n,r));let i=0;for(;r<e.length&&hj(e.charCodeAt(r));)i=i*10+(e.charCodeAt(r)-48),r+=1;t.push(i),n=r}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function _j(e){let t=e.toLowerCase();return{lowerValue:t,tokens:gj(t)}}function vj(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===i)continue;if(typeof n==`number`&&typeof i==`number`)return n<i?-1:1;let a=String(n),o=String(i);if(a!==o)return a<o?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function yj(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]==`string`&&typeof t.tokens[0]==`string`)return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;let n=vj(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function bj(e,t,n){let r=yj(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function xj(e,t){return bj(e,t,_j)}function Sj(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function Cj(e,t){let n=Math.min(e.segments.length,t.segments.length);for(let r=0;r<n;r++){let n=e.segments[r],i=t.segments[r];if(n===i)continue;let a=Sj(e,r);return a===Sj(t,r)?xj(n,i):a===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function wj(e,t){return Cj(e,t)}function Tj(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=_j(e);return n.set(e,r),r},i=Math.min(e.segments.length,t.segments.length);for(let n=0;n<i;n++){let i=e.segments[n],a=t.segments[n];if(i===a)continue;let o=Sj(e,n);return o===Sj(t,n)?bj(i,a,r):o===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function Ej(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=_j(r);return e.sortKeyById[t]=i,i}function Dj(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function Oj(e){let t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,r=[],i=0;for(let t=0;t<n;t++)e.charCodeAt(t)===47&&(r.push(e.slice(i,t)),i=t+1);return r.push(e.slice(i,n)),{hasTrailingSlash:t,segments:r}}function kj(e){let{hasTrailingSlash:t,segments:n}=Oj(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function Aj(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=Oj(e);return{requiresDirectory:t,segments:n}}function jj(){let e=new Map;return e.set(``,0),{idByValue:e,valueById:[``],sortKeyById:[_j(``)]}}function Mj(e,t){let n=e.idByValue.get(t);if(n!==void 0)return n;let r=e.valueById.length;return e.idByValue.set(t,r),e.valueById.push(t),r}function Nj(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var Pj=Symbol(`pathStorePreparedInputKind`);function Fj(e,t){return e[Pj]=t,e}function Ij(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function Lj(e,t,n){return n==="default"?wj(e,t):n(Ij(e),Ij(t))}function Rj(){return{depthAndFlags:ij(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function zj(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function Bj(e){return e.isDirectory?e.segments.length:e.segments.length-1}function Vj(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e&&typeof e.path==`string`&&Array.isArray(e.segments)&&typeof e.basename==`string`&&typeof e.isDirectory==`boolean`)}function Hj(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function Uj(e,t={}){return Yj(e,t).map(e=>e.path)}function Wj(e,t={}){let n=Yj(e,t);return Fj({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function Gj(e){let t=e.length,n=!1;for(let r=0;r<t;r+=1){let t=e[r];if(t.length>0&&t.charCodeAt(t.length-1)===47){n=!0;break}}return Fj({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function Kj(e){let t=e,n=t.preparedPaths;if(t[Pj]===`prepared`&&n!=null)return n;if(!Vj(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function qj(e){let t=e;return t[Pj]===`presorted`&&t.presortedPaths!=null||Hj(t.presortedPaths)?t.presortedPaths:null}function Jj(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function Yj(e,t={}){let n=Dj(t),r=pj(t);mj(r,`workload.inputFiles`,e.length);let i=K(r,`store.preparePathEntries.parse`,()=>e.map(e=>kj(e)));return K(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>Lj(e,t,n.sort))),i}var Xj=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[Rj()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=jj();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=pj(e),this.options=Dj(e);let t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{let e=new Set,n=t.length;for(let r=0;r<n;r+=1){let n=t[r],i=n.length;e.add(i>0&&n.charCodeAt(i-1)===47?n.slice(0,i-1):n)}this.initialExpandedPathSet=e,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,HA())}appendPaths(e){return K(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>kj(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,K(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return K(this.instrumentation,`store.builder.appendPresortedPaths`,()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,r=0,i=this.nodes,a=this.segmentTable,o=a.idByValue,s=a.valueById,c=this.directoryStack,l=0,u=``,d=0;for(let t of e){if(n===t)throw Error(`Duplicate path: "${t}"`);let e=t.length>0&&t.charCodeAt(t.length-1)===47,a=e?t.length-1:t.length,f=0,p=0;if(n!=null){if(u.length>0&&t.length>u.length&&t.startsWith(u))f=d,p=u.length;else{let r=Math.min(a,n.length),i=!0;for(let e=0;e<r;e++){let r=t.charCodeAt(e);if(r!==n.charCodeAt(e)){i=!1;break}r===47&&(f++,p=e+1)}i&&e&&r===a&&n.length>a&&n.charCodeAt(a)===47&&(f++,p=a+1)}}l=f,r=f;let m=p,h=t.indexOf(`/`,m);for(;h>=0&&h<a;){let e=c[l];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);r++;let n=t.slice(m,h),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n));let u=i.length;i.push({depthAndFlags:ij(r,0,1),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(t.slice(0,h)),l++,c[l]=u,m=h+1,h=t.indexOf(`/`,m)}if(e){if(m<a){let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory parent for "${t}"`);r++;let n=t.slice(m,a),u=o.get(n);u===void 0&&(u=s.length,o.set(n,u),s.push(n));let d=i.length;i.push({depthAndFlags:ij(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d,m=a+1}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:ij(r+1,0),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1})}m!==u.length&&(u=t.substring(0,m),d=r),n=t}c.length=l+1,n!=null&&(this.lastPreparedPath=kj(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0,r=this.nodes,i=this.segmentTable,a=i.idByValue,o=i.valueById,s=this.directoryStack,c=0,l=``,u=0;for(let i of e){if(t===i)throw Error(`Duplicate path: "${i}"`);let e=i.length,d=0,f=0;if(t!=null){if(l.length>0&&i.length>l.length&&i.startsWith(l))d=u,f=l.length;else{let n=Math.min(e,t.length);for(let e=0;e<n;e++){let n=i.charCodeAt(e);if(n!==t.charCodeAt(e))break;n===47&&(d++,f=e+1)}}}c=d,n=d;let p=f,m=i.indexOf(`/`,p);for(;m>=0;){let e=s[c];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);n++;let t=i.slice(p,m),l=a.get(t);l===void 0&&(l=o.length,a.set(t,l),o.push(t));let u=r.length;r.push({depthAndFlags:ij(n,0,1),nameId:l,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(i.slice(0,m)),this.presortedDirectoryNodeIds.push(u),c++,s[c]=u,p=m+1,m=i.indexOf(`/`,p)}let h=s[c];if(h===void 0)throw Error(`Unable to resolve file parent for "${i}"`);let g=i.slice(p),_=a.get(g);_===void 0&&(_=o.length,a.set(g,_),o.push(g)),r.push({depthAndFlags:ij(n+1,0),nameId:_,parentId:h,subtreeNodeCount:1,visibleSubtreeCount:1}),p!==l.length&&(l=i.substring(0,p),u=n),t=i}s.length=c+1,t!=null&&(this.lastPreparedPath=kj(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(K(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||K(this.instrumentation,`store.builder.computeSubtreeCounts`,()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&=(this.buildDirectoryIndexes(),!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort==="default"?Tj(this.lastPreparedPath,e,this.segmentSortKeyCache):Lj(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=Bj(e),i=n==null?0:Bj(n),a=n==null?0:zj(n.segments,e.segments),o=Math.min(a,r,i);this.directoryStack.length=o+1;for(let n=o;n<r;n++){let r=this.directoryStack[this.directoryStack.length-1];if(r===void 0)throw Error(`Directory stack underflow while building the path store`);let i=t?this.getOrCreateDirectoryChild(r,e.segments[n]):this.createDirectoryChild(r,e.segments[n]);this.directoryStack.push(i)}if(e.isDirectory){let t=this.directoryStack[this.directoryStack.length-1];if(t===void 0)throw Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(t,e.path),this.lastPreparedPath=e;return}let s=this.directoryStack[this.directoryStack.length-1];if(s===void 0)throw Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(s,e.basename,e.path):this.createFileChildUnchecked(s,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){!this.createdDirectoriesAllExpanded||this.initialExpandedPathSet==null||(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){let r=Mj(this.segmentTable,t),i=this.getDirectoryIndex(e),a=i.childIdByNameId;if(a!=null&&a.get(r)!==void 0)throw Error(`Path collides with an existing entry: "${n}"`);let o=this.nodes[e];if(o===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let s=this.nodes.length;return this.nodes.push({depthAndFlags:ij(aj(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),KA(i,s),s}createFileChildUnchecked(e,t){let n=Mj(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:ij(aj(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),KA(r,a),a}getOrCreateDirectoryChild(e,t){let n=Mj(this.segmentTable,t),r=this.getDirectoryIndex(e);if(r.childIdByNameId!=null){let e=r.childIdByNameId.get(n);if(e!==void 0){let n=this.nodes[e];if(n!=null&&!G(n))throw Error(`Path collides with an existing file while creating directory "${t}"`);return e}}let i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:ij(aj(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),KA(r,a),this.directories.set(a,HA()),a}createDirectoryChild(e,t){let n=Mj(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:ij(aj(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),KA(r,a),this.directories.set(a,HA()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!G(n))throw Error(`Path is not a directory: "${t}"`);if(cj(n,1))throw Error(`Duplicate path: "${t}"`);lj(n,1)}getDirectoryIndex(e){let t=this.directories.get(e);if(t!==void 0)return t;throw Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){let t=this.nodes,n=this.directories;n.set(0,UA());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(G(a)){let t=UA();n.set(e,t),r=e,i=t}let o;a.parentId===r?o=i:(o=n.get(a.parentId),r=a.parentId,i=o??null),o?.childIds.push(e)}if(!e)for(let e=t.length-1;e>=1;e--){let n=t[e];if(n==null)continue;let r=t[n.parentId];r!=null&&(r.subtreeNodeCount+=n.subtreeNodeCount,r.visibleSubtreeCount+=n.visibleSubtreeCount)}}buildDirectoryIndexes(){let e=this.nodes;for(let t=1;t<e.length;t++){let n=e[t];if(n==null)continue;G(n)&&this.directories.set(t,HA());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),KA(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!G(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;let n=this.getDirectoryIndex(e),r=1;for(let e of n.childIds)r+=this.computeSubtreeCounts(e);return JA(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function Zj(e,t=`closed`,n=null){let r=$j(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:r,directoriesOpenByDefault:r===`open`,hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:``,version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function Qj(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function $j(e){if(typeof e!=`number`)return e;if(!Number.isInteger(e)||e<0)throw Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function eM(e,t){return cj(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion!==`closed`&&aj(t)<=e.defaultExpansion}function tM(e,t,n=e.snapshot.nodes[t]){return n==null||!G(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:eM(e,n)}function nM(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!G(r))return;let i=eM(e,r);if(n){if(i){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(i){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function rM(e,t){let n=e.directoryLoadInfoById.get(t);if(n!=null)return n;let r={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:`loaded`};return e.directoryLoadInfoById.set(t,r),r}function iM(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function aM(e,t){let n=rM(e,t);if(n.state===`loading`&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};let r=n.nextAttemptId;return n.activeAttemptId=r,n.errorMessage=null,n.nextAttemptId+=1,n.state=`loading`,{attemptId:r,nodeId:t,reused:!1}}function oM(e,t){let n=rM(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function sM(e,t,n){let r=e.directoryLoadInfoById.get(t);return r==null||r.activeAttemptId!==n?!1:(r.activeAttemptId=null,r.errorMessage=null,r.state=`loaded`,!0)}function cM(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function lM(e,t,n,r){let i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=r??null,i.state=`error`,!0)}function uM(e,t){e.directoryLoadInfoById.delete(t)}function dM(e,t,n){let r=n,i=e.listeners.get(t);return i==null?e.listeners.set(t,new Set([r])):i.add(r),()=>{let n=e.listeners.get(t);n!=null&&(n.delete(r),n.size===0&&e.listeners.delete(t))}}function fM(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function pM(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function mM(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function hM(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function gM(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function _M(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function vM(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`begin-child-load`,path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function yM(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(e=>e.canonicalChanged),childEvents:e.childEvents,operation:`apply-child-patch`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function bM(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`complete-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function xM(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:`fail-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function SM(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:`cleanup`,projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function CM(e,t,n){return{...n,visibleCountDelta:PM(e)-t}}function wM(e,t){let n=PM(e),r=Qj();e.transactionStack.push(r);try{t()}catch(t){throw DM(e,r,!1),t}DM(e,r,!0,PM(e)-n)}function TM(e,t){let n=e.instrumentation;if(n==null){EM(e,t);return}K(n,`store.events.record`,()=>EM(e,t))}function EM(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){MM(e,t);return}n.events.push(t),jM(n,t)}function DM(e,t,n,r=null){if(e.transactionStack.pop()!==t)throw Error(`Transaction stack underflow`);if(!n)return;let i=e.transactionStack[e.transactionStack.length-1]??null;if(i!=null){let n=e.instrumentation;n==null?AM(i,t):K(n,`store.events.batch.merge`,()=>AM(i,t));return}let a=OM(t,r),o=e.instrumentation;if(o==null){MM(e,a);return}K(o,`store.events.batch.commit`,()=>MM(e,a))}function OM(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(e=>e.canonicalChanged),events:[...e.events],operation:`batch`,projectionChanged:e.events.some(e=>e.projectionChanged),visibleCountDelta:t}}function kM(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function AM(e,t){for(let n of t.events)e.events.push(n);kM(e,t)}function jM(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function MM(e,t){let n=e.instrumentation;if(n==null){NM(e,t);return}K(n,`store.events.emit`,()=>NM(e,t))}function NM(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function PM(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function FM(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!G(n)||cj(n,2))return null;let r=e.snapshot.directories.get(t);if(r==null||r.childIds.length!==1)return null;let i=r.childIds[0];if(i==null)return null;let a=e.snapshot.nodes[i];return a==null||!G(a)?null:i}function IM(e,t){let n=t;for(;;){let t=FM(e,n);if(t==null)return n;n=t}}function LM(e,t){let n=[t],r=t;for(;;){let t=FM(e,r);if(t==null)return n;n.push(t),r=t}}function RM(e,t){let n=t==null?e.snapshot.rootId:qM(e,t);return n==null?[]:YM(e,n)}function zM(e,t){let n=kj(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=uN(e,lN(e,r)),{createdNodeIds:a,directoryId:o}=XM(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=Y(e,o);if(cj(n,1))throw Error(`Path already exists: "${t}"`);lj(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=QM(e,o,n.basename),s.add(c);WM(e,o);let l=uN(e,o);return fM({affectedAncestorIds:KM(e,c),affectedNodeIds:[...s],path:t,projectionChanged:dN(i,l)})}function BM(e,t,n){let r=qM(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=Y(e,r);if(cj(i,2))throw Error(`The root node cannot be removed`);if(G(i)&&J(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=uN(e,a),s=sN(e,r);tN(e,a,r,i.nameId),cN(e,a),WM(e,a);let c=uN(e,a);return pM({affectedAncestorIds:KM(e,a),affectedNodeIds:s,path:t,projectionChanged:dN(o,c),recursive:n.recursive===!0})}function VM(e,t,n,r){let i=qM(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=Y(e,i);if(cj(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=aN(e,i,n),c=uN(e,a.parentId),l=uN(e,s.parentId),u=Nj(e.snapshot.segmentTable,a.nameId),d=Mj(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(G(a)&&hN(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=WA(e.snapshot.nodes,J(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&oN(e,p,o,oj(a))===`skip`)return null;let m=a.parentId;tN(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),mN(e,i),eN(e,s.parentId,i),cN(e,m),e.pathCacheVersion++,WM(e,m),s.parentId!==m&&WM(e,s.parentId);let h=uN(e,m),g=uN(e,s.parentId);return mM({affectedAncestorIds:[...new Set([...KM(e,m),...KM(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:fN([c,l],[h,g]),to:q(e,i)})}function HM(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function UM(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function q(e,t){let n=Y(e,t),r=HM(e,t);if(r!=null)return r;if(cj(n,2))return UM(e,t,``);let i=q(e,n.parentId),a=Nj(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return UM(e,t,G(n)?`${o}/`:o)}function WM(e,t){let n=e.instrumentation;if(n==null){_N(e,t);return}K(n,`store.recomputeCountsUpwardFrom`,()=>_N(e,t))}function GM(e,t){let n=[[t,0]],{nodes:r,directories:i}=e.snapshot;for(;n.length>0;){let t=n[n.length-1],a=t[0],o=r[a];if(o==null||!G(o)){gN(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){gN(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function KM(e,t){let n=[],r=t;for(;r!=null;){let t=Y(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function qM(e,t){if(t.length===0)return e.snapshot.rootId;let n=Aj(t);return JM(e,n.segments,n.requiresDirectory)}function JM(e,t,n){let r=e.snapshot.rootId;for(let n of t){let t=e.snapshot.segmentTable.idByValue.get(n);if(t===void 0)return null;let i=J(e,r),a=WA(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=Y(e,r);return n&&!G(i)?null:r}function J(e,t){let n=e.snapshot.directories.get(t);if(n===void 0)throw Error(`Unknown directory child index for node ${String(t)}`);return n}function Y(e,t){let n=e.snapshot.nodes[t];if(n===void 0||cj(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function YM(e,t){let n=e.snapshot.nodes[t];if(n===void 0||cj(n,4))return[];if(!G(n))return[q(e,t)];if(J(e,t).childIds.length===0)return cj(n,1)&&!cj(n,2)?[q(e,t)]:[];let r=[],i=[{childIndex:0,nodeId:t}];for(;i.length>0;){let t=i[i.length-1];if(t==null)break;let n=e.snapshot.nodes[t.nodeId];if(n===void 0||cj(n,4)){i.pop();continue}if(!G(n)){r.push(q(e,t.nodeId)),i.pop();continue}let a=J(e,t.nodeId);if(a.childIds.length===0){cj(n,1)&&!cj(n,2)&&r.push(q(e,t.nodeId)),i.pop();continue}let o=a.childIds[t.childIndex];if(o==null){i.pop();continue}t.childIndex++,i.push({childIndex:0,nodeId:o})}return r}function XM(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=Mj(e.snapshot.segmentTable,i),a=J(e,r),o=WA(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!G(Y(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=ZM(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function ZM(e,t,n){let r=Y(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:ij(aj(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,HA()),eN(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function QM(e,t,n){let r=Mj(e.snapshot.segmentTable,n),i=J(e,t);if(WA(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${yN(e,t,n)}"`);let a=Y(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:ij(aj(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),eN(e,t,o),e.activeNodeCount++,o}function $M(e,t,n){let r=0,i=t.childIds.length;for(;r<i;){let a=r+i>>>1,o=t.childIds[a];if(o==null){i=a;continue}nN(e,n,o)<0?i=a:r=a+1}return r}function eN(e,t,n){let r=J(e,t),i=Y(e,n);WA(e.snapshot.nodes,r).set(i.nameId,n),YA(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=$M(e,r,n);r.childIds.splice(a,0,n),qA(r,a),QA(e.snapshot.nodes,r)}function tN(e,t,n,r){let i=J(e,t),a=GA(i),o=a.get(n)??-1;WA(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&YA(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),qA(i,o),QA(e.snapshot.nodes,i))}function nN(e,t,n){let r=e.snapshot.options.sort;return r==="default"?rN(e,t,n):r(iN(e,t),iN(e,n))}function rN(e,t,n){let r=Y(e,t),i=Y(e,n),a=G(r);if(a!==G(i))return a?-1:1;let o=yj(Ej(e.snapshot.segmentTable,r.nameId),Ej(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=Nj(e.snapshot.segmentTable,r.nameId),c=Nj(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function iN(e,t){let n=Y(e,t),r=q(e,t),i=G(n),a=i?r.slice(0,-1):r;return{basename:Nj(e.snapshot.segmentTable,n.nameId),depth:aj(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function aN(e,t,n){let r=Y(e,t),i=qM(e,n);if(i!=null){let t=Y(e,i);if(G(t))return{basename:Nj(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=Aj(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=Aj(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:JM(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function oN(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${q(e,t)}"`);let i=Y(e,t);if(oj(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(G(i)&&J(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return sN(e,t),tN(e,a,t,o),cN(e,a),WM(e,a),`handled`}function sN(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=Y(e,t.nodeId);if(t.visitedChildren||!G(i)){G(i)&&e.snapshot.directories.delete(t.nodeId),lj(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),uM(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=J(e,t.nodeId);for(let e=a.childIds.length-1;e>=0;e--){let t=a.childIds[e];t!=null&&r.push({nodeId:t,visitedChildren:!1})}}return n}function cN(e,t){let n=t;for(;n!=null;){let t=Y(e,n);if(!G(t)||cj(t,2)||J(e,n).childIds.length>0)return;lj(t,1),n=t.parentId===n?null:t.parentId}}function lN(e,t){let n=e.snapshot.rootId;for(let r of t){let t=e.snapshot.segmentTable.idByValue.get(r);if(t==null)break;let i=WA(e.snapshot.nodes,J(e,n)).get(t);if(i==null||!G(Y(e,i)))break;n=i}return n}function uN(e,t){let n=pN(e,t);if(n==null)return null;let r=IM(e,n),i=Y(e,r),a=n===r?null:LM(e,n).map(t=>q(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:J(e,r).childIds.length>0,path:q(e,r),terminalKind:oj(i)})}function dN(e,t){return fN([e],[t])}function fN(e,t){for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(r==null||i==null||r!==i)return!0}return!1}function pN(e,t){let n=t;for(;n!=null;){let t=Y(e,n);if(!G(t)||cj(t,2))return null;if(!tM(e,n,t))return n;n=t.parentId}return null}function mN(e,t){let n=Y(e,t);if(uj(n,(t===e.snapshot.rootId?-1:aj(Y(e,n.parentId)))+1),!G(n))return;let r=J(e,t);for(let t of r.childIds)mN(e,t)}function hN(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=Y(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function gN(e,t,n=Y(e,t),r=!1){let i=e.instrumentation;if(i==null){vN(e,t,n,r);return}K(i,`store.recomputeNodeCounts`,()=>vN(e,t,n,r))}function _N(e,t){let n=t;for(;n!=null;){let t=Y(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(gN(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&YA(J(e,s),n,a,o),n=s}}function vN(e,t,n,r){if(!G(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=J(e,t);if(r){let t=e.instrumentation;t==null?JA(e.snapshot.nodes,i):K(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>JA(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,cj(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=FM(e,t)==null?tM(e,t,n)?1+o:1:o}function yN(e,t,n){let r=q(e,t);return r.length===0?n:`${r}${n}`}function bN(e){return e!=null&&!cj(e,4)}function xN(e,t){let n=e.snapshot.nodes[t];return!bN(n)||!G(n)||cj(n,2)?null:n}function SN(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&bN(e.snapshot.nodes[n])&&(t+=1);return t}function CN(e){return Math.max(0,e.valueById.length-1)}function wN(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:SN(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:CN(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function TN(e,t,n,r){return{activeNodeCountAfter:r.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:r.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:r.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-r.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-r.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-r.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-r.segmentCount,segmentCountAfter:r.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:r.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function EN(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)xN(e,n)!=null&&t.push(q(e,n));for(let t of e.expandedDirectoryIds)xN(e,t)!=null&&n.push(q(e,t));return{collapsedPaths:t,expandedPaths:n}}function DN(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)xN(e,n)!=null&&iM(e,n)!==`loaded`&&t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:q(e,n)});return t}function ON(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=qM(e,n);t!=null&&nM(e,t,!0,Y(e,t))}for(let n of t.collapsedPaths){let t=qM(e,n);t!=null&&nM(e,t,!1,Y(e,t))}}function kN(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=qM(e,n.path);t!=null&&xN(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function AN(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function jN(e){let t=e.snapshot.segmentTable,n=jj();for(let r of e.snapshot.nodes)if(bN(r)){if(cj(r,2)){r.nameId=0;continue}r.nameId=Mj(n,Nj(t,r.nameId))}e.snapshot.segmentTable=n}function MN(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!bN(r)||!G(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return bN(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[Y(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),JA(e.snapshot.nodes,n)}}function NN(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(bN(n))break;--t}e.snapshot.nodes.length=t+1}function PN(e){let t=EN(e),n=DN(e);K(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>AN(e)),K(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>jN(e)),K(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>MN(e)),K(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>NN(e)),K(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>ON(e,t)),K(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>kN(e,n)),K(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>GM(e,e.snapshot.rootId))}function FN(e){let t=EN(e),n=DN(e),r=K(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>RM(e)),i=fj({...e.snapshot.options},e.instrumentation),a=K(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new Xj(i);return e.appendPaths(r),e.finish()});e.snapshot=a,e.activeNodeCount=a.nodes.length-1,e.pathCacheByNodeId=new Map([[a.rootId,{path:``,version:0}]]),e.pathCacheVersion=0,K(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>ON(e,t)),K(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>kN(e,n)),K(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>GM(e,e.snapshot.rootId))}function IN(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function LN(e,t){let n=wN(e);t===`stable`?K(e.instrumentation,`store.cleanup.stable`,()=>PN(e)):K(e.instrumentation,`store.cleanup.aggressive`,()=>FN(e));let r=wN(e);return TN(t,t===`stable`,n,r)}var RN=64;function zN(e,t){let n=t+2;if(n<=e.length)return e;let r=e.length;for(;r<n;)r*=2;let i=new Int32Array(r);return i.fill(-1),i.set(e),i}function BN(e){return Y(e,e.snapshot.rootId).visibleSubtreeCount}function VN(e,t,n,r){let i=Y(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function HN(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:sP(e,t.cursor),setSize:t.setSize,subtreeEndIndex:VN(e,t.cursor,t.index,n)}}function UN(e,t,n,r,i,a){let o=J(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=XA(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return WN(e,u,l,r+c,i+1,s,o.childIds.length,a)}function WN(e,t,n,r,i,a,o,s){if(!G(Y(e,t))){if(n===0)return{ancestors:s,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:i},index:r,posInSet:a,setSize:o};throw Error(`Visible index ${String(n)} is out of range for file`)}let c=tP(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=Y(e,c.terminalNodeId);if(!G(l)||!tM(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return UN(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function GN(e,t){let n=BN(e);if(t<0||t>=n)return null;let r=UN(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>q(e,t.cursor.terminalNodeId)),a=null;return{ancestorPaths:i,get ancestorRows(){if(a!=null)return a;let t=[],i=[];for(let a of r.ancestors){let r=HN(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:sP(e,r.cursor),setSize:r.setSize,subtreeEndIndex:VN(e,r.cursor,r.index,n)}}function KN(e,t,n){let r=e.instrumentation,i=BN(e);if(i<=0||n<t)return[];let a=Math.max(0,Math.min(t,i-1)),o=Math.max(a,Math.min(n,i-1));if(r==null){if(a===0)return oP(e,o+1);let t=[],n=QN(e,a);for(let r=a;r<=o&&n!=null;r++){let r=sP(e,n);t.push(r),n=rP(e,n)}return t}let s=[],c=0,l=0,u=K(r,`store.getVisibleSlice.selectFirstRow`,()=>QN(e,a));for(let t=a;t<=o&&u!=null;t++){let t=K(r,`store.getVisibleSlice.materializeRow`,()=>sP(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=K(r,`store.getVisibleSlice.advanceCursor`,()=>rP(e,u))}return mj(r,`workload.visibleRowsRead`,s.length),mj(r,`workload.flattenedRowsRead`,c),mj(r,`workload.flattenedSegmentsRead`,l),s}function qN(e,t=BN(e)){let n=e.instrumentation;return n==null?aP(e,t):K(n,`store.getVisibleTreeProjection`,()=>aP(e,t))}function JN(e){return iP(qN(e))}function YN(e,t){let n=qM(e,t);if(n==null||n===e.snapshot.rootId||G(Y(e,n))&&IM(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=Y(e,i).parentId,n=J(e,t),s=GA(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=ZA(a,n,s),t!==o){let n=Y(e,t),a=FM(e,t);if(!tM(e,t,n)&&a!==i)return null;IM(e,t)===t&&(r+=1)}i=t}return r}function XN(e,t){let n=qM(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=Y(e,n);if(!G(r))throw Error(`Path is not a directory: "${t}"`);return tM(e,n,r)?null:(nM(e,n,!0,r),WM(e,n),hM({affectedAncestorIds:KM(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function ZN(e,t){let n=qM(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=Y(e,n);if(!G(r))throw Error(`Path is not a directory: "${t}"`);return tM(e,n,r)?(nM(e,n,!1,r),WM(e,n),gM({affectedAncestorIds:KM(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function QN(e,t){return t<0||t>=BN(e)?null:$N(e,e.snapshot.rootId,t,-1)}function $N(e,t,n,r){let i=J(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?XA(e.snapshot.nodes,i,n):K(a,`store.getVisibleSlice.selectChildIndex`,()=>XA(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return eP(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function eP(e,t,n,r){if(!G(Y(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:r};throw Error(`Visible index ${String(n)} is out of range for file`)}let i=tP(e,t,r);if(n===0)return i;let a=Y(e,i.terminalNodeId);if(!G(a)||!tM(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return $N(e,i.terminalNodeId,n-1,i.visibleDepth)}function tP(e,t,n){return G(Y(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:IM(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:K(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>IM(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function nP(e,t){let n=Y(e,t);if(!G(n))return!0;let r=n.parentId;return r===e.snapshot.rootId||FM(e,r)!==t}function rP(e,t){let n=Y(e,t.terminalNodeId);if(G(n)){let r=J(e,t.terminalNodeId);if(tM(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:eP(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=Y(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=J(e,n),o=GA(a).get(r)??-1;if(o<0)throw Error(`Child ${String(r)} was not found in its parent index`);let s=a.childIds[o+1]??null;if(s!=null)return eP(e,s,0,i);nP(e,r)&&i--,r=n}}function iP(e){let t=e.paths.length,n=Array(t);for(let r=0;r<t;r+=1){let t=e.getParentIndex(r);n[r]={index:r,parentPath:t>=0?e.paths[t]??null:null,path:e.paths[r]??``,posInSet:e.posInSetByIndex[r]??0,setSize:e.setSizeByIndex[r]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function aP(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(RN);o.fill(-1);let s=0,{nodes:c,directories:l,segmentTable:u}=e.snapshot,d=[[l.get(e.snapshot.rootId),0,-1,``]],f=e.snapshot.options.flattenEmptyDirectories,p=e.pathCacheByNodeId,m=e.pathCacheVersion,h=u.valueById;for(;d.length>0&&s<t;){let t=d[d.length-1],u=t[0];if(t[1]>=u.childIds.length){d.pop();continue}let g=t[1],_=u.childIds[t[1]++],v=c[_],y=t[2]+1,b=t[3];o=zN(o,y);let x,S=_;if(G(v))S=f?IM(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:q(e,S);else{let e=p.get(_);x=e!=null&&e.version===m?e.path:`${b}${h[v.nameId]}`}r[s]=o[y],n[s]=x,i[s]=g,a[s]=u.childIds.length,o[y+1]=s,s+=1;let C=c[S];C!=null&&G(C)&&tM(e,S,C)&&d.push([l.get(S),0,y,x])}s<t&&(n.length=s);let g=r.subarray(0,s),_=i.subarray(0,s),v=a.subarray(0,s),y=null;return{getParentIndex(e){return e<0||e>=s?-1:g[e]??-1},paths:n,posInSetByIndex:_,setSizeByIndex:v,get visibleIndexByPath(){if(y==null){y=new Map;for(let e=0;e<s;e+=1)y.set(n[e]??``,e)}return y}}}function oP(e,t){let n=Array(t),r=0,{nodes:i,directories:a,segmentTable:o}=e.snapshot,s=[[a.get(e.snapshot.rootId),0,-1]],c=o.valueById,l=e.snapshot.options.flattenEmptyDirectories,u=e.pathCacheByNodeId,d=e.pathCacheVersion;for(;s.length>0&&r<t;){let t=s[s.length-1],o=t[0];if(t[1]>=o.childIds.length){s.pop();continue}let f=o.childIds[t[1]++],p=i[f],m=t[2]+1;if(!G(p)){let t=u.get(f);n[r++]={depth:m,flattenedSegments:void 0,hasChildren:!1,id:f,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:`file`,loadState:void 0,name:c[p.nameId],path:t!=null&&t.version===d?t.path:q(e,f)};continue}let h=l?IM(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=sP(e,g);let _=i[h];_!=null&&G(_)&&tM(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function sP(e,t){let n=Y(e,t.terminalNodeId),r=G(n)?cP(e,t):null,i=q(e,t.terminalNodeId),a=Nj(e.snapshot.segmentTable,n.nameId),o=G(n)&&J(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?LM(e,t.headNodeId).map(n=>{let r=Y(e,n);return{isTerminal:n===t.terminalNodeId,name:Nj(e.snapshot.segmentTable,r.nameId),nodeId:n,path:q(e,n)}}):K(c,`store.getVisibleSlice.flatten.collectSegments`,()=>LM(e,t.headNodeId).map(n=>{let r=Y(e,n);return{isTerminal:n===t.terminalNodeId,name:Nj(e.snapshot.segmentTable,r.nameId),nodeId:n,path:q(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:G(n)&&tM(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:G(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function cP(e,t){if(t.headNodeId===t.terminalNodeId)return iM(e,t.terminalNodeId);let n=LM(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=iM(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}var lP=8;function uP(e){let{nodes:t,directories:n,rootId:r,options:i}=e,a=t.length,o=new Int32Array(a),s=new Int32Array(a),c=new Int32Array(a),l=new Int32Array(a),u=new Int32Array(a),d=new Int32Array(a),f=new Int32Array(a);for(let e=0;e<a;e+=1){let n=t[e];n!=null&&(o[e]=n.parentId,s[e]=n.nameId,c[e]=n.depthAndFlags,l[e]=n.subtreeNodeCount,u[e]=n.visibleSubtreeCount)}let p=0;for(let e of n.values())p+=e.childIds.length;let m=new Int32Array(p),h=0;for(let[e,t]of n){let n=t.childIds;d[e]=h,f[e]=n.length;for(let e=0;e<n.length;e+=1)m[h]=n[e],h+=1}return{nodeCount:a,rootId:r,flattenEmptyDirectories:i.flattenEmptyDirectories===!0,parentId:o,nameId:s,depthAndFlags:c,subtreeNodeCount:l,visibleSubtreeCount:u,childStart:d,childCount:f,childIdsFlat:m}}function dP(e){let{nodeCount:t,rootId:n,flattenEmptyDirectories:r,depthAndFlags:i,subtreeNodeCount:a,visibleSubtreeCount:o,childStart:s,childCount:c,childIdsFlat:l}=e;for(let e=t-1;e>=1;--e){if((i[e]&lP)===0)continue;let t=s[e],n=c[e],u=0,d=0;for(let e=0;e<n;e+=1){let n=l[t+e];u+=a[n],d+=o[n]}a[e]=1+u;let f;f=r&&n===1?(i[l[t]]&lP)===0?1+d:d:1+d,o[e]=f}let u=s[n],d=c[n],f=0,p=0;for(let e=0;e<d;e+=1){let t=l[u+e];f+=a[t],p+=o[t]}a[n]=1+f,o[n]=p}function fP(e){let{directories:t,nodes:n,options:r,rootId:i,presortedDirectoryNodeIds:a}=e.snapshot,o=r.flattenEmptyDirectories===!0,s=e=>{let r=n[e];if(r==null||!G(r))return;let i=t.get(e);if(i==null)throw Error(`Unknown directory child index for node ${String(e)}`);let a=i.childIds,s=a.length,c=0,l=0;for(let e=0;e<s;e++){let t=a[e];if(t==null)continue;let r=n[t];c+=r.subtreeNodeCount,l+=r.visibleSubtreeCount}i.totalChildSubtreeNodeCount=c,i.totalChildVisibleSubtreeCount=l,s>=128&&QA(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&G(e)?l:1+l}else u=1+l;r.visibleSubtreeCount=u};if(a!=null)for(let e=a.length-1;e>=0;e--)s(a[e]);else for(let e=n.length-1;e>=1;e--)s(e);let c=n[i],l=t.get(i);if(c==null||l==null)return;let u=l.childIds,d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t==null)continue;let r=n[t];d+=r.subtreeNodeCount,f+=r.visibleSubtreeCount}l.totalChildSubtreeNodeCount=d,l.totalChildVisibleSubtreeCount=f,QA(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function pP(e){let{directories:t,nodes:n,rootId:r}=e.snapshot,i=uP(e.snapshot);dP(i);let a=i.subtreeNodeCount,o=i.visibleSubtreeCount;for(let e=0;e<n.length;e+=1){let t=n[e];t!=null&&(t.subtreeNodeCount=a[e],t.visibleSubtreeCount=o[e])}for(let[e,i]of t){let t=i.childIds,a=t.length,o=0,s=0;for(let e=0;e<a;e++){let r=t[e];if(r==null)continue;let i=n[r];o+=i.subtreeNodeCount,s+=i.visibleSubtreeCount}i.totalChildSubtreeNodeCount=o,i.totalChildVisibleSubtreeCount=s,(e===r||a>=128)&&QA(n,i)}}function mP(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var hP=class e{#e;constructor(e={}){let t=pj(e),n=K(t,`store.builder.create`,()=>new Xj(e));if(e.preparedInput!=null){let t=qj(e.preparedInput);t==null?n.appendPreparedPaths(Kj(e.preparedInput),!1):n.appendPresortedPaths(t,Jj(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(K(t,`store.preparePathEntries`,()=>Yj(r,e)))}let r=K(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=K(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=K(t,`store.state.create`,()=>Zj(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:K(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||mP(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&K(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?e.useSoaCountSweep===!0?K(t,`store.state.initializeOpenVisibleCountsViaSoa`,()=>pP(this.#e)):K(t,`store.state.initializeOpenVisibleCounts`,()=>fP(this.#e)):K(t,`store.state.recomputeCounts`,()=>GM(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return Uj(e,t)}static prepareInput(e,t={}){return Wj(e,t)}static preparePresortedInput(e){return Gj(e)}list(e){return K(this.#e.instrumentation,`store.list`,()=>RM(this.#e,e))}add(e){K(this.#e.instrumentation,`store.add`,()=>{let t=BN(this.#e);TM(this.#e,CM(this.#e,t,zM(this.#e,e)))})}remove(e,t={}){K(this.#e.instrumentation,`store.remove`,()=>{let n=BN(this.#e);TM(this.#e,CM(this.#e,n,BM(this.#e,e,t)))})}move(e,t,n={}){K(this.#e.instrumentation,`store.move`,()=>{let r=BN(this.#e),i=VM(this.#e,e,t,n);i!=null&&TM(this.#e,CM(this.#e,r,i))})}batch(e){wM(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision})}})}getVisibleCount(){return K(this.#e.instrumentation,`store.getVisibleCount`,()=>BN(this.#e))}getVisibleSlice(e,t){return K(this.#e.instrumentation,`store.getVisibleSlice`,()=>KN(this.#e,e,t))}getVisibleRowContext(e){return K(this.#e.instrumentation,`store.getVisibleRowContext`,()=>GN(this.#e,e))}getVisibleTreeProjection(){return JN(this.#e)}getVisibleTreeProjectionData(e){return qN(this.#e,e)}getVisibleIndex(e){return K(this.#e.instrumentation,`store.getVisibleIndex`,()=>YN(this.#e,e))}getPathInfo(e){return K(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=qM(this.#e,e);if(t==null)return null;let n=Y(this.#e,t);return{depth:aj(n),kind:G(n)?`directory`:`file`,path:q(this.#e,t)}})}isExpanded(e){return K(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=Y(this.#e,t);return tM(this.#e,t,n)})}expand(e){K(this.#e.instrumentation,`store.expand`,()=>{let t=BN(this.#e),n=XN(this.#e,e);n!=null&&TM(this.#e,CM(this.#e,t,n))})}collapse(e){K(this.#e.instrumentation,`store.collapse`,()=>{let t=BN(this.#e),n=ZN(this.#e,e);n!=null&&TM(this.#e,CM(this.#e,t,n))})}on(e,t){return dM(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return iM(this.#e,t)}markDirectoryUnloaded(e){K(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(J(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=BN(this.#e);oM(this.#e,t),TM(this.#e,CM(this.#e,n,_M({affectedAncestorIds:KM(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return K(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=BN(this.#e),r=aM(this.#e,t);return TM(this.#e,CM(this.#e,n,vM({affectedAncestorIds:KM(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return K(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||iM(this.#e,n)!==`loading`||!cM(this.#e,n,e.attemptId))return!1;let r=q(this.#e,n);this.validateChildPatch(r,t);let i=BN(this.#e),a=[];for(let e of t.operations){gP(r,e);let t=BN(this.#e);switch(e.type){case`add`:a.push(CM(this.#e,t,zM(this.#e,e.path)));break;case`remove`:a.push(CM(this.#e,t,BM(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=VM(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(CM(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return TM(this.#e,CM(this.#e,i,yM({affectedAncestorIds:KM(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:q(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return K(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=BN(this.#e),r=sM(this.#e,t,e.attemptId);return TM(this.#e,CM(this.#e,n,bM({affectedAncestorIds:KM(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:q(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return K(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=BN(this.#e),i=lM(this.#e,n,e.attemptId,t);return TM(this.#e,CM(this.#e,r,xM({affectedAncestorIds:KM(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:q(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return K(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(IN(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=BN(this.#e),n=LN(this.#e,e.mode??`stable`);return TM(this.#e,CM(this.#e,t,SM({...n,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:n.idsPreserved===!1}))),n})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(e){if(e==null||e.length===0)return 0;let t=0,n=[],r=[],i=0,a=null,o=this.#e.snapshot.segmentTable,s=o.valueById,c=this.#e.snapshot.nodes,l=new Map;for(let u of e){a!=null&&u<a&&(a=null,i=0,n.length=0,r.length=0);let e=u.length>0&&u.charCodeAt(u.length-1)===47?u.length-1:u.length;if(e===0){a=u,i=e,n.length=0,r.length=0;continue}let d=0,f=0;if(a!=null){let t=Math.min(e,i),n=!0;for(let e=0;e<t;e+=1){let t=u.charCodeAt(e);if(t!==a.charCodeAt(e)){n=!1;break}t===47&&(d+=1,f=e+1)}n&&(t===i&&e>t&&u.charCodeAt(t)===47?(d+=1,f=t+1):t===e&&i>t&&a.charCodeAt(t)===47&&(d+=1,f=e+1)),d=Math.min(d,r.length)}let p=d===0?this.#e.snapshot.rootId:r[d-1]??this.#e.snapshot.rootId,m=d,h=!0,g=f;for(;g<=e;){let t=u.indexOf(`/`,g),i=t===-1||t>e?e:t,a=u.slice(g,i),f=J(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??_j(a);l.set(a,b);let x=(e,t)=>{for(v=e;v<t;v+=1){let e=f[v],t=c[e],n=s[t.nameId];if(n===a)return y=e,!0;let r=yj(Ej(o,t.nameId),b);if(r>0||r===0&&n>a)return!1}return!1};if(!x(_,f.length)&&_>0&&x(0,_),y===void 0){h=!1;break}if(!G(Y(this.#e,y))){h=!1;break}if(n[m]=v,r[m]=y,p=y,m+=1,i===e)break;g=i+1}if(a=u,i=e,n.length=m,r.length=m,!h){a=null,i=0,n.length=0,r.length=0;continue}for(let e=d;e<m;e+=1){let n=r[e];if(n==null)continue;let i=Y(this.#e,n);tM(this.#e,n,i)||(nM(this.#e,n,!0,i),t+=1)}}return t}hasAllDirectoriesExpanded(){for(let e of this.#e.snapshot.directories.keys()){if(e===this.#e.snapshot.rootId)continue;let t=Y(this.#e,e);if(!tM(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=qM(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!G(Y(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!G(Y(this.#e,e)))throw Error(`Node is not a directory: ${String(e)}`);return e}catch{return null}}isDirectoryProjectionVisible(e){let t=e;for(;t!==this.#e.snapshot.rootId;){let e=Y(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=Y(this.#e,e),r=FM(this.#e,e);if(!tM(this.#e,e,n)&&r!==t)return!1}t=e}return!0}validateChildPatch(t,n){new e({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function gP(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`)}}var _P={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function vP(e,t){if(typeof e==`number`)return{itemHeight:t??_P.default.itemHeight,factor:e};let n=_P[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var yP=_P.default.itemHeight,bP=`@layer base {
|
|
1700
1700
|
:host {
|
|
1701
1701
|
--trees-accent: var(--trees-accent-override, #009fff);
|
|
1702
1702
|
--trees-fg: var(--trees-fg-override, var(--trees-theme-sidebar-fg, light-dark(#6c6c71, #adadb1)));
|
|
@@ -2788,15 +2788,15 @@ diff --git`)}function m_(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.star
|
|
|
2788
2788
|
}
|
|
2789
2789
|
|
|
2790
2790
|
@layer theme, unsafe;
|
|
2791
|
-
`,
|
|
2791
|
+
`,xP=`@layer base, unsafe;`;function SP(e){return`${xP}
|
|
2792
2792
|
@layer base {
|
|
2793
2793
|
${e}
|
|
2794
|
-
}`}function
|
|
2794
|
+
}`}function CP(e){return`${xP}
|
|
2795
2795
|
@layer unsafe {
|
|
2796
2796
|
${e}
|
|
2797
|
-
}`}var hP=new WeakMap;function gP(e){let t=hP.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(_A,`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(),hP.set(e,i),i}function _P(e,t){if(!e.isConnected)return;let n=gP(t);if(n==null)return;let r=t.querySelector(`style[${vA}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(vA,``),t.appendChild(i)),i.textContent=`:host { ${yA}: ${n}px; }`}var vP;function yP(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){vP??(vP=new CSSStyleSheet,vP.replaceSync(pP(dP)));let t=!1;try{e.adoptedStyleSheets=[vP],t=!0}catch{}if(t){e.querySelector(`style[${hA}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(hA,``),t.textContent=pP(dP),e.prepend(t)}}function bP(e,t){xP(e,t),yP(t),_P(e,t)}function xP(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`});bP(this,e)}}if(customElements.define(mA,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(mA)))e instanceof HTMLElement&&bP(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var SP=e=>e.startsWith(`f::`)?e.slice(3):e;function CP(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function wP(e,t){return e===``?t:`${e}/${t}`}function TP({files:e,path:t,isFolder:n,nextBasename:r}){let i=SP(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}=CP(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=wP(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 EP(e){return e.endsWith(`/`)}function DP(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 OP(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 kP(e,t){return t.includes(e)?OP(t):[e]}function AP(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 jP(e,t){return{draggedPaths:e,target:t}}function MP(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(EP(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function NP(e,t){return t.kind===`root`||t.directoryPath==null?DP(e):t.directoryPath}function PP(e,t){let n=e.map(e=>{let n=NP(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 FP(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 IP(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(!FP(oP.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 LP(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function RP(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 zP(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function BP(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 zP(e,t.path)?n?e:null:e;case`move`:return RP(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=BP(r,e,n),r==null)return null;return r}}}function VP(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function HP(e){switch(e.operation){case`add`:return{...VP(e),operation:`add`,path:e.path};case`remove`:return{...VP(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...VP(e),from:e.from,operation:`move`,to:e.to}}}function UP(e){return{...VP(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>HP(e)),operation:`batch`}}function WP(e){switch(e.operation){case`add`:case`remove`:case`move`:return HP(e);case`batch`:return UP(e);default:return null}}function GP(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function KP(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 qP(e){return KP(e).at(-1)??null}function JP(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function YP(e){return e.endsWith(`/`)}var XP=e=>e.toLowerCase();function ZP(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function QP(e){return e.endsWith(`/`)?e.slice(0,-1):e}function $P(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var eF=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},tF=Symbol(`FILE_TREE_RENAME_VIEW`),nF=512,rF=512;function iF(e){return e===`top`||e===`center`?e:`nearest`}function aF(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=KP(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 oF(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:aF(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var sF=class e{static{Object.defineProperty(e.prototype,tF,{configurable:!0,value(){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}},writable:!0})}#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=IP({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=qP(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:iF(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<=rF){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=kP(t,n);return this.#r.canDrag?.(r)!==!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=jP(t.draggedPaths,n);(MP(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}AP(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=jP(e.draggedPaths,t);if(MP(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=PP(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=YP(r),a=QP(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of KP(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=ZP(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}#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,YP(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,YP(e)?{recursive:!0}:void 0);return}let t=YP(e),n=TP({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:QP(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($P(n.sourcePath,t),$P(n.destinationPath,t))}#Y(e){this.#T!=null&&this.#E!==e&&(this.#E=e,this.#De())}resetPaths(e,t={}){let n=!Array.isArray(e),r=n?void 0:e,i=n?e:t,a=this.#H.list().length,o=this.#G,s=IP({paths:r,preparedInput:i.preparedInput},`resetPaths`,this.#e.sort),c=this.#le(s.paths,s.preparedInput,i.initialExpandedPaths),l=this.#c,u=this.#T,d=this.getSelectedPaths(),f=this.#z;this.#K?.(),this.#H=c,this.#d.clear(),this.#he();let p=d.map(e=>c.getPathInfo(e)?.path??null).filter(e=>e!=null),m=!GP(this.#B,p);this.#B=new Set(p),m&&(this.#V+=1),this.#z=f==null?null:c.getPathInfo(f)?.path??null,this.#T=u==null?null:c.getPathInfo(u)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(l,l!=null||p.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:s.paths.length,pathCountBefore:a,projectionChanged:!0,usedPreparedInput:i.preparedInput!=null,visibleCountDelta:this.#G-o})}#X(e){this.#Ie();let t=qP(e),n=JP(e,t),r=null,i=null;for(let e of this.#be()){if(qP(e)!==t)continue;let a=JP(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=KP(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=!GP(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 oP({...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 KP(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(XP),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(XP),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 KP(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:eF(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 KP(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 KP(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=oF(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,nF)),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=BP(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=BP(this.#c,e,!0),r=[...this.#B].map(t=>BP(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=BP(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return GP(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&&LP(e)&&(this.#i=null);let t=LP(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=WP(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},cF=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 lF(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 uF(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=[],r=0;for(;;){let e=t.indexOf(`/`,r);if(e===-1)break;n.push(t.slice(0,e+1)),r=e+1}return n}function dF(e,t){return t?`${e}/`:e}function fF(e,t=null){let n=cF(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,o=new Map;for(let t of e??[]){let e=mF(t);e!=null&&_F({canonicalPath:e.canonicalPath,changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,isDirectory:e.isDirectory,status:t.status,statusByPath:r})}return r.size===0?null:{changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}function pF(e,t){let n=t?.remove??[],r=t?.set??[];if(n.length===0&&r.length===0)return e;let i=new Map(e?.statusByPath),a=new Set(e?.directoriesWithChanges),o=new Set(e?.ignoredDirectoryPaths),s=new Map(e?.changeCountByDirectoryPath),c=!1;for(let e of n){let t=hF(e);t!=null&&(c=gF({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,statusByPath:i})||c)}for(let e of r){let t=mF(e);t!=null&&(c=_F({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,isDirectory:t.isDirectory,status:e.status,statusByPath:i})||c)}return c?i.size===0?null:{changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,signature:bF(i),statusByPath:i}:e}function mF(e){return hF(e.path)}function hF(e){let t=lF(e);if(t!=null)return{canonicalPath:dF(t.path,t.isDirectory),isDirectory:t.isDirectory}}function gF({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,statusByPath:i}){let a=i.get(e);return a!=null&&(i.delete(e),a===`ignored`&&e.endsWith(`/`)&&r.delete(e),yF(t,n,e),!0)}function _F({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,isDirectory:i,status:a,statusByPath:o}){let s=o.get(e);return s!==a&&(s??vF(t,n,e),o.set(e,a),a===`ignored`&&i?r.add(e):i&&r.delete(e),!0)}function vF(e,t,n){for(let r of uF(n))e.set(r,(e.get(r)??0)+1),t.add(r)}function yF(e,t,n){for(let r of uF(n)){let n=(e.get(r)??0)-1;n>0?e.set(r,n):(e.delete(r),t.delete(r))}}function bF(e){let t=`${e.size}`;for(let[n,r]of e)t+=`\0${n}\0${r}`;return t}var X,xF,SF,CF,wF,TF,EF,DF,OF,kF,AF={},jF=[],MF=Array.isArray,NF=jF.slice,PF=Object.assign;function FF(e){e&&e.parentNode&&e.remove()}function IF(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?NF.call(arguments,2):n),LF(e,o,r,i,null)}function LF(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??++xF,__i:-1,__u:0};return i==null&&X.vnode!=null&&X.vnode(a),a}function RF(e){return e.children}function zF(e,t){this.props=e,this.context=t,this.__g=0}function BF(e,t){if(t==null)return e.__?BF(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`?BF(e):null}function VF(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 VF(e)}}function HF(e){(8&e.__g||!(e.__g|=8)||!SF.push(e)||wF++)&&CF==X.debounceRendering||((CF=X.debounceRendering)||queueMicrotask)(UF)}function UF(){for(var e,t,n,r,i,a,o,s,c=1;SF.length;)SF.length>c&&SF.sort(TF),e=SF.shift(),c=SF.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=PF({},r)).__v=r.__v+1,X.vnode&&X.vnode(n),ZF(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??BF(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,$F(a,n,o),n.__e!=i&&VF(n)));wF=0}function WF(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||jF,b=t.length;for(c=GF(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?AF:y[m.__i]||AF,m.__i=f,_=ZF(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&nI(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=KF(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function GF(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?LF(null,o,null,null,null):MF(o)?LF(RF,{children:o},null,null,null):o.constructor==null&&o.__b>0?LF(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=qF(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=BF(s)),rI(s,s));return r}function KF(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=KF(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=BF(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function qF(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);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 JF(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function YF(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||JF(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||JF(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(EF,`$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=DF,e.addEventListener(t,a?kF:OF,a)):e.removeEventListener(t,a?kF:OF,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 XF(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=DF++;else if(t.u<n.l)return;return n(X.event?X.event(t):t)}}}function ZF(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=X.__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 zF(v,x),f.constructor=M,f.render=iI),b&&b.sub(f),f.props=v,f.state||(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=PF({},f.__s)),PF(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=X.__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=PF({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===RF&&d.key==null&&(E=eI(d.props.children)),s=WF(e,MF(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--;)FF(a[j]);QF(t)}}else t.__e=n.__e,t.__k=n.__k,e.then||QF(t);X.__e(e,t,n)}else s=t.__e=tI(n.__e,t,n,r,i,a,o,c,l,u);return(d=X.diffed)&&d(t),128&t.__u?void 0:s}function QF(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(QF)}function $F(e,t,n){for(var r=0;r<n.length;r++)nI(n[r],n[++r],n[++r]);X.__c&&X.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){X.__e(e,t.__v)}})}function eI(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:MF(e)?e.map(eI):PF({},e)}function tI(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&&=(X.__m&&X.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=NF.call(e.childNodes),v=n.props||AF,!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;YF(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&&!_||YF(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=``),WF(b==`template`?e.content:e,MF(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&BF(n,0),s,c,l),a!=null)for(u=a.length;u--;)FF(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||YF(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&YF(e,u,g,v[u],i))}return e}function nI(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){X.__e(e,n)}}function rI(e,t,n){var r,i;if(X.unmount&&X.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||nI(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){X.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&rI(r[i],t,n||typeof e.type!=`function`);n||FF(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function iI(e,t,n){return this.constructor(e,n)}function aI(e,t){var n,r,i,a;t==document&&(t=document.documentElement),X.__&&X.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=IF(RF,null,[e]),i=[],a=[],ZF(t,e,r||AF,AF,t.namespaceURI,r?null:t.firstChild?NF.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),$F(i,e,a)}function oI(e,t){e.__u|=32,aI(e,t)}X={__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 wF=0,e}},xF=0,zF.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=PF({},this.state);typeof e==`function`&&(e=e(PF({},n),this.props)),e&&PF(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),HF(this))},zF.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),HF(this))},zF.prototype.render=RF,SF=[],wF=0,TF=function(e,t){return e.__v.__b-t.__v.__b},EF=/(PointerCapture)$|Capture$/i,DF=0,OF=XF(!1),kF=XF(!0);var sI=0;Array.isArray;function Z(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:--sI,__i:-1,__u:0,__source:i,__self:a};return X.vnode&&X.vnode(l),l}var cI=16,lI=16,uI={};function dI({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}=uI[e]??{width:cI,height:lI},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return Z(`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:Z(`use`,{href:c})})}var fI=e=>e!==void 0&&/\s/.test(e),pI=(e,t)=>{let n=t=>fI(e[t-1])||fI(e[t]);if(!n(t))return t;for(let r=1;r<e.length;r++){let i=t-r;if(i>0&&!n(i))return i;let a=t+r;if(a<e.length&&!n(a))return a}return t},mI=e=>pI(e,Math.ceil(e.length/2)),hI=e=>{if(e.length<2)return[e,``];let t=mI(e);return[e.slice(0,t),e.slice(t)]},gI=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:mI(e);return[e.slice(0,r),e.slice(r)]},_I=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)]},vI=(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)]},yI=(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)]},bI=(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 xI({children:e,marker:t,variant:n=`default`}){"use no memo";return Z(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:Z(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?Z(`span`,{"data-truncate-fade":!0}):t})})}function SI(e){"use no memo";let{mode:t,children:n}=e;return Z(`div`,{children:[Z(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?Z(`span`,{children:n}):n}),Z(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?Z(`span`,{children:n}):n})]})}function CI({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=Z(SI,{mode:t,children:e},`content`),o=Z(xI,{marker:n,mode:t,variant:r},`marker`),s=Z(`div`,{"data-truncate-fill":!0},`fill`);return Z(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:Z(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function wI({children:e,...t}){"use no memo";return Z(CI,{mode:`truncate`,...t,children:e})}function TI({children:e,...t}){"use no memo";return Z(CI,{mode:`fruncate`,...t,children:e})}function EI({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=Z(wI,{...s,children:t[0]}),l=Z(TI,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return Z(`div`,{className:a,style:o});if(e.length<i)return Z(n===`end`?TI:wI,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=hI:r===`extension`?t=gI:r===`leaf-path`&&(t=_I);else if(typeof r==`number`)t=vI,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=yI:e===`first`&&(t=bI)}else typeof r==`function`&&(t=r);t??=hI;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=Z(wI,{...s,..._,children:f}),l=Z(TI,{...s,...v,children:p})}return Z(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[Z(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),Z(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var DI={endIndex:-1,startIndex:-1};function OI(e,t,n){return Math.min(Math.max(e,t),n)}function kI(e,t){return e<0||t<e?DI:{endIndex:t,startIndex:e}}function AI(e){return e.startIndex<0||e.endIndex<e.startIndex}function jI(e,t){return AI(e)?0:(e.endIndex-e.startIndex+1)*t}function MI(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function NI(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function PI(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 FI(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 II(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 LI(e,t,n){if(e.length===0||t<=0)return[];let r=II(e),i=PI(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=FI(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 RI(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=OI(t.scrollTop,0,o),c=t.stickyRows??LI(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=MI(s,n,t.itemHeight),m=MI(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?DI:kI(m,NI(u+d,n,t.itemHeight)),y=g+1,b=AI(v)?DI:kI(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=jI(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:AI(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var zI={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},BI={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},VI=`Contains git status items`;function HI(e){return e.current?!0:(e.current=!0,!1)}function UI(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 WI(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return UI({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 GI(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 KI(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 qI(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 JI(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function YI(e,t){return e!=null&&e>0?e:t}function XI(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 ZI(e,t,n,r,i=0){let a=UI({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a!=null&&(e.scrollTop=a,!0)}function QI(e,t,n,r,i,a,o=0){let s=WI({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s!=null&&(e.scrollTop=s,!0)}function $I(e,t,n,r,i,a){let o=GI({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o!=null&&(e.scrollTop=o,!0)}function eL(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function tL(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function nL({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return Z(`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 rL(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 iL(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 aL,oL,sL,cL,lL=Object.is,uL=0,dL=[],fL=X,pL=fL.__b,mL=fL.__r,hL=fL.diffed,gL=fL.__c,_L=fL.unmount,vL=fL.__;function yL(e,t){fL.__h&&fL.__h(oL,e,uL||t),uL=0;var n=oL.__H||(oL.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function bL(e){return uL=1,xL(ML,e)}function xL(e,t,n){var r=yL(aL++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):ML(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);lL(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=oL,!oL.__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,lL(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};oL.__f=!0;var a=oL.shouldComponentUpdate,o=oL.componentWillUpdate;oL.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)},oL.shouldComponentUpdate=i}return r.__N||r.__}function SL(e,t){var n=yL(aL++,3);!fL.__s&&jL(n.__H,t)&&(n.__=e,n.u=t,oL.__H.__h.push(n))}function CL(e,t){var n=yL(aL++,4);!fL.__s&&jL(n.__H,t)&&(n.__=e,n.u=t,oL.__h.push(n))}function Q(e){return uL=5,wL(function(){return{current:e}},[])}function wL(e,t){var n=yL(aL++,7);return jL(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function TL(e,t){return uL=8,wL(function(){return e},t)}function EL(){for(var e;e=dL.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(kL),e.__H.__h.forEach(AL),e.__H.__h=[]}catch(t){e.__H.__h=[],fL.__e(t,e.__v)}}fL.__b=function(e){oL=null,pL&&pL(e)},fL.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),vL&&vL(e,t)},fL.__r=function(e){mL&&mL(e),aL=0;var t=(oL=e.__c).__H;t&&(sL===oL?(t.__h=[],oL.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(kL),t.__h.forEach(AL),t.__h=[],aL=0)),sL=oL},fL.diffed=function(e){hL&&hL(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(dL.push(t)!==1&&cL===fL.requestAnimationFrame||((cL=fL.requestAnimationFrame)||OL)(EL)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),sL=oL=null},fL.__c=function(e,t){t.some(function(e){try{e.__h.forEach(kL),e.__h=e.__h.filter(function(e){return!e.__||AL(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],fL.__e(n,e.__v)}}),gL&&gL(e,t)},fL.unmount=function(e){_L&&_L(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{kL(e)}catch(e){t=e}}),n.__H=void 0,t&&fL.__e(t,n.__v))};var DL=typeof requestAnimationFrame==`function`;function OL(e){var t,n=function(){clearTimeout(r),DL&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);DL&&(t=requestAnimationFrame(n))}function kL(e){var t=oL,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),oL=t}function AL(e){var t=oL;e.__c=e.__(),oL=t}function jL(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!lL(t,e[n])})}function ML(e,t){return typeof t==`function`?t(e):t}function NL(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:Z(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return Z(RF,{children:[Z(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:Z(wI,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function PL(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function FL(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function IL(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 LL({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=RI(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:IL(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?IL(u,1,t,o):i&&r<=0&&c.length>0?LI(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 RL=400,zL=40,BL=18;function VL(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))?HL(e,t,n):a instanceof HTMLElement?a:null}function HL(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 UL(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return 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 WL(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 GL(){return navigator.vendor!==`Apple Computer, Inc.`}function KL(e,t){let n=e-t.top;if(n<zL)return-Math.ceil((zL-Math.max(0,n))/zL*BL);let r=t.bottom-e;return r<zL?Math.ceil((zL-Math.max(0,r))/zL*BL):0}function qL(e,t){if(e!=null){let t=zI[e];return t==null?null:{text:t,title:BI[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:VI}:null}function JL(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 YL(e){return e!=null&&`toggle`in e}function XL(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function ZL(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function QL(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function $L(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function eR(e,t){return t&&$L(e)||(e.ctrlKey||e.metaKey)&&XL(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var tR=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function nR(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 rR(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 iR(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function aR(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function oR(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function sR(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 cR(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 lR(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 uR(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=lR(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 dR(e,t){return{kind:e.kind,name:FL(e),path:t}}function fR(e){return e==null?void 0:`${e}__tree`}function pR(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function mR(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function hR(e,t){if(e==null)return null;if(`text`in e)return e.parts==null?Z(`span`,{title:e.title,children:e.text}):Z(`span`,{title:e.title,children:e.parts.map((e,t)=>Z(`span`,{style:{color:e.color},children:e.text},t))});let n=typeof e.icon==`string`?mR(e.icon)?t(e.icon):{name:e.icon}:mR(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return Z(`span`,{title:e.title,children:Z(dI,{...n})})}function gR(e){e!=null&&KI(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function _R(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=PL(e);return Z(RF,{children:[e.depth>0?Z(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>Z(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,Z(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?Z(dI,{...t(`file-tree-icon-chevron`)}):Z(dI,{...t(`file-tree-icon-file`,u)})}),Z(`div`,{"data-item-section":`content`,children:e.isFlattened?NL(e,c,a):c??Z(EI,{minimumLength:5,split:`extension`,children:e.name})}),i?Z(`div`,{"data-item-section":`decoration`,children:r==null?null:hR(r,t)}):null,s?Z(`div`,{"data-item-section":`git`,children:hR(o,t)}):null,n?Z(`div`,{"data-item-section":`action`,children:l?Z(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:Z(dI,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function vR(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=PL(t),{isParked:ee=!1,mode:te=`flow`,style:ne}=r,re=te===`sticky`,ie=_?.get(P)??null??JL(t.ancestorPaths,v,y),ae=t.kind===`directory`&&(b?.has(P)??!1),oe=A(t,P),se=qL(ie,ae),ce=S&&w,le=oe!=null||x||ce,ue=ce&&T===`always`,de=a.getPath()===P,fe=de?a.getValue():``,pe=re||!de?null:Z(nL,{ref:D,ariaLabel:`Rename ${FL(t)}`,isFlattened:t.isFlattened,value:fe,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),me=_R(t,k,{actionLaneEnabled:ce,customDecoration:oe,decorationLaneEnabled:le,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:se,gitLaneActive:x,renameInput:pe,showDecorativeActionAffordance:ue}),he={...rL({ariaLabel:FL(t),domId:t.isFocused?pR(h,P,ee):void 0,extraStyle:ne,features:{actionLaneEnabled:ce,contextMenuButtonVisibility:ce?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:ee,itemHeight:g,mode:te,row:t,state:{containsGitChange:ae,effectiveGitStatus:ie,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:iR(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:re?void 0:()=>{i.focusMountedPathFromInput(P)},onKeyDown:re?void 0:N,ref:e=>{O(P,e)}};return!re&&de?Z(`div`,{...he,children:me}):Z(`button`,{...he,type:`button`,draggable:u&&!ee,onDragEnd:u&&!ee?p:void 0,onDragStart:u&&!ee?e=>{f(e,t,P)}:void 0,onMouseDown:e=>{if(re){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!ee?e=>{m(e,t,P)}:void 0,onClick:e=>{M(e,t,P,te)},children:me})}function yR(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(PL(e))).map((n,r)=>vR(e,n,t.start+r))}function bR({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=uP,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 _=Q(null),v=Q(null),y=Q(!1),b=Q(null),x=Q(null),S=Q(null),C=Q(null),w=Q(null),T=Q(new Map),E=Q(new Map),D=Q(()=>{}),O=Q(null),k=Q(0),A=Q(!1),j=Q(null);j.current!==t&&(A.current=!1,j.current=t);let M=Q(!1),N=Q(null),P=Q(null),ee=Q(!1),te=Q(null),ne=Q(null),re=Q(null),ie=Q(null),ae=Q(null),oe=Q(null),se=Q(null),ce=Q(null),le=Q(!1),ue=Q(null),de=Q(null),fe=Q(null),pe=Q(null),me=wL(()=>new Map,[]),[,he]=bL(0),ge=Q(!1),[_e,ve]=bL(null),[ye,be]=bL(null),[xe,Se]=bL(null),[Ce,we]=bL(null),[Te,Ee]=bL(0),[F,De]=bL(null),Oe=Q(F);Oe.current=F;let ke=Q(null),Ae=Q(null),je=Q(null),Me=Q(null),Ne=Q(null),Pe=Q(!1),Fe=()=>{Ae.current=null,je.current=null,Me.current=null},Ie=(e,t)=>{Ae.current=e,je.current=null,Me.current=t==null?null:{path:e,scrollTop:t}},Le=(e,t)=>{Ae.current=null,je.current={path:e,viewportOffset:t},Me.current=null},Re=Q(d===`retain`&&t.isSearchOpen()),[ze,Be]=bL(p);SL(()=>{p||Be(!1)},[p]);let Ve=Q(!1),He=TL(()=>{Ve.current=!0,Be(e=>e&&!1)},[]),[Ue,We]=bL(()=>LL({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[Ge,Ke]=bL(!1);SL(()=>{Ke(!0)},[]);let qe=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Je=e?.contextMenu?.triggerMode??(qe?`right-click`:`both`),Ye=Je===`both`||Je===`button`,Xe=e?.contextMenu?.buttonVisibility??`when-needed`,Ze=Je===`both`||Je===`right-click`;CL(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;Ne.current=t,be(t),we(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(Pe.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 Qe=TL((e,t)=>{oR(T.current,e,t)},[]),$e=TL((e,t)=>{oR(E.current,e,t)},[]),et=TL(e=>{x.current=e},[]),tt=TL(e=>sR(e,E.current,T.current),[]),nt=n!=null||r!=null||i!=null,{resolveIcon:rt}=wL(()=>kA(a),[a]),it=t[tF](),at=it.getPath(),ot=at!=null,st=t.isSearchOpen(),ct=t.getSearchValue(),I=t.getFocusedPath(),L=t.getFocusedIndex(),lt=t.getScrollRequest(),ut=t.isDragAndDropEnabled(),dt=t.getDragSession(),ft=wL(()=>dt==null?null:new Set(dt.draggedPaths),[dt]),pt=dt?.target??null,mt=dt?.primaryPath??null,ht=fR(o),{overlayHeight:gt,overlayRows:_t,snapshot:vt,visibleRows:yt}=Ue,bt=vt.physical.viewportHeight,xt=wL(()=>({end:vt.window.endIndex,start:vt.window.startIndex}),[vt.window.endIndex,vt.window.startIndex]),St=_t,Ct=vt.sticky.rows,wt=vt.physical.totalHeight,Tt=vt.sticky.height,Et=wL(()=>new Set(Ct.map(e=>PL(e.row))),[Ct]),Dt=L>=0&&L>=xt.start&&L<=xt.end,Ot=TL((e,t)=>u?.({item:dR(e,t),row:e})??null,[u]),kt=TL(e=>KI(e==null?null:T.current.get(e)??null)?!0:KI(S.current),[]),At=TL(e=>{kt(t.focusNearestPath(e))},[t,kt]),jt=Q(At);jt.current=At;let Mt=Q(!0),Nt=Q(()=>{}),Pt=TL((t=!0)=>{let n=Oe.current;n!=null&&(Mt.current=Mt.current&&t,De(null),e?.contextMenu?.onClose?.(),Mt.current&&At(n.path))},[e?.contextMenu,At]);Nt.current=Pt;let Ft=TL(e=>{let t=e==null?null:aR(S.current,e);Se(e=>e===t?e:t)},[]),It=TL((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=tt(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;Ie(n,e?.scrollTop??null),M.current=!0,ve(e=>e===n?e:n)}i.focus(),Ft(a),Mt.current=!0,De({anchorRect:r?.anchorRect??null,item:dR(e,n),path:n,source:r?.source??`keyboard`})},[t,tt,Ft]),Lt=TL(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=JI(e,bt);te.current=L<0||e==null?null:Math.max(0,Math.min(L*s-e.scrollTop,Math.max(0,t-s))),ee.current=!0}t.startRenaming(e)!==!1&&(we(`focus`),he(e=>e+1))}},[t,L,s,l,bt]),Rt=TL((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=JI(i,bt),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:LL({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return M.current=!0,$I(i,a,s,l,u,d),D.current(),ke.current=n?e:null,!0},[t,s,c,bt,h]),zt=()=>y.current===!0||pe.current!=null||le.current===!0,Bt=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),Vt=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Ht=()=>{ie.current!=null&&(clearTimeout(ie.current),ie.current=null),re.current=null},Ut=()=>{oe.current?.remove(),oe.current=null},Wt=()=>{Vt(ne.current),ne.current=null,ae.current=null},Gt=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},Kt=()=>{ce.current?.(),ce.current=null,pe.current!=null&&(clearTimeout(pe.current),pe.current=null),le.current=!1,ue.current=null,fe.current=null,de.current!=null&&(de.current.setAttribute(`draggable`,`true`),de.current.style.removeProperty(`touch-action`),de.current=null),Ut(),Ht(),Wt(),se.current=null},qt=(e,n)=>{let r=S.current?.getRootNode(),i=UL(VL(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Jt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Ht();return}let r=t.getItem(e.directoryPath),i=YL(r)?r:null;if(i==null||i.isExpanded()){Ht();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;re.current!==a&&(Ht(),re.current=a,ie.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind===`directory`&&n.directoryPath===e.directoryPath&&n.flattenedSegmentPath===e.flattenedSegmentPath&&i.expand()},n))},Yt=()=>{ne.current=null;let e=ae.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=KL(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()),Jt(qt(e.clientX,e.clientY)),ne.current=Bt(Yt)},Xt=(e,t)=>{ae.current={clientX:e,clientY:t},ne.current??=Bt(Yt)},Zt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(Kt(),Ut(),Ht(),Wt(),t.startDrag(r)===!1){e.preventDefault();return}if(se.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),GL())){let t=WL(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Gt(t),oe.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Qt=()=>{Ut(),Ht(),Wt(),se.current=null,t.cancelDrag()},R=(e,n,r)=>{if(pe.current!=null||le.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;fe.current={clientX:i.clientX,clientY:i.clientY},de.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!le.current;pe.current!=null&&(clearTimeout(pe.current),pe.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),ce.current===o&&(ce.current=null),t&&(a.setAttribute(`draggable`,`true`),de.current===a&&(de.current=null),fe.current=null)},s=e=>{let t=e.touches[0],n=fe.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=100||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),ce.current=o,pe.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),de.current===a&&(de.current=null),fe.current=null;return}le.current=!0,de.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),se.current=n;let e=a.getBoundingClientRect(),s=WL(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`}),Gt(s),oe.current=s,ue.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=ue.current;n!=null&&oe.current!=null&&(oe.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Jt(qt(t.clientX,t.clientY)),Xt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&qt(n.clientX,n.clientY),t.completeDrag(),Kt()},u=()=>{t.cancelDrag(),Kt()};ce.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)},RL)},$t=e=>{if(F!=null){if(e.key===`Escape`){Pt(),e.preventDefault(),e.stopPropagation();return}tR.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(it.isActive()){if(e.isComposing||e.keyCode===229)return;if(e.key===`Escape`)it.cancel();else if(e.key===`Enter`)it.commit();else return;we(`focus`),he(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Lt(I??void 0),e.preventDefault(),e.stopPropagation();return}if(st){if(e.key===`Escape`)ee.current=!1,te.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=JI(n,bt);te.current=L<0||n==null?null:Math.max(0,Math.min(L*s-n.scrollTop,Math.max(0,r-s))),ee.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;we(`focus`),he(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&ZL(e)){t.openSearch(e.key),he(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=qe&&$L(e),r=eR(e,qe),i=r&&S.current!=null?qI(S.current):null,a=r?new Set(cR(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==I&&a.has(o)){let e=C.current;Ie(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=YL(p)?p:null,h=u!=null&&(Et.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=sR(u,E.current,T.current);e==null||n==null?y=!1:It(e,u)}else if((e.ctrlKey||e.metaKey)&&XL(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;we(`focus`);let b=t.getFocusedPath(),x=b!=null&&(Et.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))Ie(b,v?.scrollTop??null),M.current=!0,ve(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(Le(b,uR(S.current,v,i,u,s,Tt,bt)),M.current=!0,ve(e=>e===b?e:b)):Fe()}he(e=>e+1),e.preventDefault(),e.stopPropagation()};CL(()=>{if(!(!f||!st)){if(Re.current){Re.current=!1;return}KI(w.current)}},[st,f]),CL(()=>{let e=x.current;switch(tL({hasRenderedInput:e!=null,previousRenamingPath:P.current,renamingPath:at})){case`reset`:P.current=null;return;case`reveal-canonical`:at!=null&&Rt(at,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(ke.current=null,P.current=at,KI(e),e.select());return}},[xt.end,xt.start,at,Rt,Et]),CL(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=qI(e)?.dataset.itemPath??null;ve(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,qI(e)!=null){r();return}M.current=!1,ve(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),M.current=!1,ve(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;ve(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),CL(()=>{let e=S.current;e!=null&&(vt.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[vt.physical.scrollTop]),CL(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=JI(n,g);let a=()=>{let e=t.getVisibleCount(),r=YI(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),We(LL({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=YI(O.current,g),i=t.getVisibleRows(e,e)[0]??null;ZI(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=t.subscribe(()=>{HI(ge)&&he(e=>e+1),a()}),l=()=>{Pe.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,Ee(e=>e+1),e=null},50))},u=null,d=()=>{i!=null&&delete i.dataset.overlayReveal,u!=null&&(clearTimeout(u),u=null)},f=()=>{i!=null&&Pe.current!==!0&&(n.scrollTop>0||(i.dataset.overlayReveal=`true`,u!=null&&clearTimeout(u),u=setTimeout(()=>{d()},200)))},p=()=>{if(a(),n.scrollTop>0&&d(),Oe.current!=null&&y.current&&Nt.current(),Pe.current===!0){y.current=!1;return}be(e=>e==null?e:null),l()},m=()=>{l(),f()},_=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),v=e=>{_.has(e.key)&&m()};n.addEventListener(`scroll`,p,{passive:!0}),n.addEventListener(`wheel`,m,{passive:!0}),n.addEventListener(`touchmove`,m,{passive:!0}),n.addEventListener(`keydown`,v);let x=typeof ResizeObserver<`u`?new ResizeObserver(e=>{O.current=(e[0]==null?null:XI(e[0]))??JI(n,g),a()}):null;return x?.observe(n),()=>{D.current=()=>{},o(),n.removeEventListener(`scroll`,p),n.removeEventListener(`wheel`,m),n.removeEventListener(`touchmove`,m),n.removeEventListener(`keydown`,v),e!=null&&clearTimeout(e),u!=null&&clearTimeout(u),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,O.current=null,x?.disconnect()}},[t,g,s,c,h]),CL(()=>{qe||F==null||Pt(!1)},[Pt,qe,F]);let en=wL(()=>F==null?null:`${F.path}::${F.source}`,[F]);CL(()=>{if(en==null){m?.clearSlotContent(xA);return}let t=Oe.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??rR(n.getBoundingClientRect()),close:e=>{Nt.current(e?.restoreFocus??!0)},restoreFocus:()=>{Mt.current&&jt.current(Oe.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(xA,i),e?.contextMenu?.onOpen?.(t.item,r),gR(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&gR(i)}),()=>{m?.clearSlotContent(xA)}},[en,e?.contextMenu,m]),CL(()=>{F!=null&&t.getItem(F.path)==null&&Pt()},[Pt,F,t]),CL(()=>{if(F==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(nR(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&Pt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Pt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[Pt,F]),CL(()=>{let e=C.current,n=S.current;if(e==null||n==null){N.current=I;return}let r=I==null?null:T.current.get(I)??null,i=qI(n),a=i?.dataset.itemPath??null,o=ot&&x.current===i,c=f&&w.current===i,l=ee.current&&!st,u=te.current??0,d=ke.current,p=Ae.current,m=je.current,g=Me.current,_=i!=null,v=M.current||_,y=N.current!==I,b=p!=null&&p===I&&I!=null,E=!1,O=!1;if(lt!=null&<.id!==k.current){k.current=lt.id;let n=lt.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,bt-s))):Tt;E=!0,O=QI(e,n,s,bt,wt,lt.offset,t)}t.clearScrollRequest(lt.id)}let A=!E&&l&&$I(e,L,s,bt,wt,u),j=!E&&d!=null&&d===I&&$I(e,L,s,bt,wt,Tt),P=!E&&m!=null&&m.path===I&&$I(e,L,s,bt,wt,m.viewportOffset),ne=!E&&g!=null&&g.path===I&&e.scrollTop!==g.scrollTop;if(ne&&(e.scrollTop=g.scrollTop),(ne||O||j||P||A||v&&y&&d!==I&&!b&&ZI(e,L,s,bt,Tt))&&D.current(),E){N.current=I;return}if(!v){N.current=I;return}if(o){N.current=I;return}if(c&&!l){N.current=I;return}if(r==null){l&&L>=0&&($I(e,L,s,bt,wt,u),D.current()),N.current=I;return}(y||l||d===I||p===I||m?.path===I||g?.path===I||a==null||a!==I)&&(KI(r),d===I&&(ke.current=null),p===I&&(Ae.current=null),m?.path===I&&(je.current=null),g?.path===I&&(Me.current=null),ee.current=!1,te.current=null),N.current=I},[t,L,I,Dt,s,ot,st,xt,bt,f,lt,h,Tt,wt,yt]);let tn=L>=0&&L>=vt.visible.startIndex&&L<=vt.visible.endIndex,nn=I!=null&&St.some(e=>PL(e.row)===I),rn=tn||nn,an=Ye&&M.current===!0&&rn?I:null,on=Ce===`pointer`?ye:null,sn=F?.path??Ne.current??on??an??ye,cn=F?.source===`right-click`;CL(()=>{y.current&&F==null||Ft(tt(sn))},[F,tt,xt,bt,Te,St,sn,Ft,yt]);let ln=TL(e=>{if(y.current||nR(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&&we(e=>e===`pointer`?e:`pointer`),be(e=>e===i?e:i)},[]),un=TL(()=>{be(null)},[]);CL(()=>{if(!ut)return;let e=()=>{Kt(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),Kt(),t.cancelDrag()}},[t,ut]);let dn=e=>{if(!ut||t.getDragSession()==null||le.current)return;let n=UL(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Jt(t.getDragSession()?.target??null),Xt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},fn=e=>{if(!ut||t.getDragSession()==null||le.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Ht(),Wt(),t.setDragTarget(null))},pn=e=>{!ut||t.getDragSession()==null||le.current||(e.preventDefault(),qt(e.clientX,e.clientY),t.completeDrag(),Ut(),Ht(),Wt(),se.current=null)},mn=vt.window.height,hn=vt.window.offsetTop,gn=Math.min(0,bt-mn),_n=Math.min(0,bt-mn-Tt),vn=_e===I||ee.current,yn=I!=null&&vn&&!Dt&&L>=0?yt[L]??t.getVisibleRows(L,L)[0]??null:null,bn=yn==null?null:eL(L,s,xt,mn),xn=se.current,Sn=mt!=null&&xn!=null&&xn.path===mt&&xn.index>=xt.start&&xn.index<=xt.end,Cn=mt!=null&&xn!=null&&xn.path===mt&&!Sn&&xn.path!==yn?.path?xn:null,wn=Cn==null?null:eL(Cn.index,s,xt,mn),Tn=QL((L>=0?yt[L]??t.getVisibleRows(L,L)[0]??null:null)?.ancestorPaths.at(-1)??null),En=st&&I!=null?pR(o,I,!Dt):void 0,z=F?.path??(st?I:_e),Dn=F?.path??ye,On=tt(sn),kn=qe&&Ye&&!cn&&!ot&&On!=null&&xe!=null&&sn!=null,An=qe&&(kn||F!=null),jn=F?.anchorRect,Mn=jn==null&&On!=null&&xe!=null&&(F!=null||kn)?xe:null,Nn=jn==null?Mn==null?void 0:{top:`${Mn}px`}:{left:`${jn.left}px`,position:`fixed`,right:`auto`,top:`${jn.top}px`},Pn=cn?{opacity:`0`}:void 0,Fn=TL((e,n,r,i)=>{let a=iL({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:st,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)}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=vt.visible.startIndex&&n.index<=vt.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(M.current=!0,ve(e=>e===c?e:c),we(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&Rt(c,{targetOffset:`sticky-parents`})},[t,st,vt.visible.endIndex,vt.visible.startIndex,Rt]),In=()=>{if(y.current||!Ye||sn==null||On==null)return;let e=t.getItem(sn);e!=null&&(Ft(On),Mt.current=!0,De({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:On.getAttribute(`aria-label`)??sn,path:e.getPath()},path:e.getPath(),source:`button`}))},Ln={contextHoverPath:Dn,contextMenuButtonTriggerEnabled:Ye,contextMenuButtonVisibility:Xe,contextMenuEnabled:qe,contextMenuRightClickEnabled:Ze,contextMenuTriggerMode:Je,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:ut,draggedPathSet:ft,dragTarget:pt,gitLaneActive:nt,gitStatusByPath:n,handleRowDragEnd:Qt,handleRowDragStart:Zt,handleRowTouchStart:R,ignoredGitDirectories:r,ignoredInheritanceCache:me,instanceId:o,itemHeight:s,onKeyDown:$t,onRowClick:Fn,openContextMenuForRow:It,registerButton:Qe,registerRenameInput:et,renameView:it,renderDecorationForRow:Ot,resolveIcon:rt,shouldSuppressContextMenu:zt,visualFocusPath:z},Rn={...Ln,registerButton:$e};return Z(`div`,{ref:S,id:ht,"data-file-tree-context-menu-button-visibility":qe&&Ye?Xe:void 0,"data-file-tree-context-menu-trigger-mode":qe?Je:void 0,"data-file-tree-has-context-menu-action-lane":qe&&Ye?`true`:void 0,"data-file-tree-has-git-lane":nt?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:ut?fn:void 0,onDragOver:ut?dn:void 0,onDrop:ut?pn:void 0,onKeyDown:$t,onPointerLeave:qe?un:void 0,onPointerOver:qe?ln:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[Z(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:Tn}}),Z(`slot`,{name:bA,"data-type":`header-slot`}),f?Z(`div`,{"data-file-tree-search-container":!0,"data-open":st?`true`:`false`,children:Z(`input`,{ref:w,"aria-activedescendant":En,"aria-controls":ht,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":ze?`true`:void 0,value:ct,onBlur:()=>{d===`retain`&&!Ve.current||t.closeSearch()},onFocus:He,onPointerDown:He,onInput:e=>{He();let n=e.currentTarget;t.setSearch(n.value)}})}):null,Z(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&Ge&&St.length>0?Z(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:Z(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${gt}px`},children:St.map((e,t)=>vR(Rn,e.row,`sticky:${PL(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${St.length-t}`}}))})}):null,Z(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${wt}px`},children:[Z(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${hn}px`}}),Z(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${mn}px`,top:`${gn}px`,bottom:`${_n}px`},children:[yR(Ln,xt,Et),yn!=null&&bn!=null?vR(Ln,yn,`parked:${yn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:mt===yn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${bn}px`}}):null,Cn!=null&&wn!=null?vR(Ln,Cn,`parked-drag:${Cn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${wn}px`}}):null]})]})]}),qe?Z(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":An?`true`:`false`,style:Nn,children:[Z(`button`,{ref:v,type:`button`,"data-type":SA,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":F==null?`false`:`true`,"data-visible":kn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),F!=null){Pt();return}In()},tabIndex:-1,style:Pn,children:Z(dI,{...rt(`file-tree-icon-ellipsis`)})}),F==null?null:Z(`slot`,{name:xA})]}):null,F==null?null:Z(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),Pt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),Pt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var xR={hydrateRoot:(e,t)=>{oI(IF(bR,t),e)},renderRoot:(e,t)=>{aI(IF(bR,t),e)},unmountRoot:e=>{aI(null,e)}};function SR(e,t){xR.renderRoot(e,t)}function CR(e,t){xR.hydrateRoot(e,t)}function wR(e){xR.unmountRoot(e)}var TR=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)}}};function ER(e,t,n){if(!e.s){if(n instanceof DR){if(!n.s)return void(n.o=ER.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(ER.bind(null,e,t),ER.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}var DR=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{ER(r,1,a(this.v))}catch(e){ER(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?ER(r,1,t?t(i):i):n?ER(r,1,n(i)):ER(r,2,i)}catch(e){ER(r,2,e)}},r},e}();Array.isArray;var OR=0;function kR(e){return e!=null&&e.length>0?e:(OR+=1,`pst_ft_${OR}`)}function AR({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??uP)}function jR(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 MR(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 NR(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var PR=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new TR;#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=kR(a),this.#p=fF(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=lP(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new sF({...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&&(wR(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()}getFocusedIndex(){return this.#t.getFocusedIndex()}getVisibleCount(){return this.#t.getVisibleCount()}getVisibleRows(e,t){return this.#t.getVisibleRows(e,t)}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)}focusFirstItem(){this.#t.focusFirstItem()}focusLastItem(){this.#t.focusLastItem()}focusNextItem(){this.#t.focusNextItem()}focusPreviousItem(){this.#t.focusPreviousItem()}focusParentItem(){this.#t.focusParentItem()}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)}applyGitStatusPatch(e){let t=pF(this.#p,e);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&SR(n.wrapper,this.#w())}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){Array.isArray(e)?this.#t.resetPaths(e,t):this.#t.resetPaths(e)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),SR(t.wrapper,this.#w()))}setGitStatus(e){let t=fF(e,this.#p);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&SR(n.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),SR(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),CR(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),SR(r,this.#w())}#C(){return{initialViewportHeight:AR({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(bA,e());return}this.#l.setSlotHtml(bA,this.#e?.header?.html??null)}#k(e){let t=NR(e).find(e=>MR(e)),n=jR(uA(wA(this.#m).set));n!=null&&(t==null||t.outerHTML!==n.outerHTML)&&(t==null?e.prepend(n):t.replaceWith(n))}#A(e){let t=NR(e),n=t.find(e=>MR(e)),r=t.filter(e=>e!==n),i=wA(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=jR(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=wA(this.#m);t.colored&&fA(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${gA}]`);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(gA,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=mP(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 bP(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)}},FR=`_jD _n`,IR=`<div><input type=search placeholder="Filter files…" aria-label="Filter files"></div>`,LR=` D l`,RR=h(18,e=>S(e,`b`,e.l,ez(e))),zR=M(11,RR),BR=h(10,e=>zR(e,(e.j??e.h)||``)),VR=M(17,RR),HR=h(16,e=>VR(e,tz(e))),UR=M(15,HR),WR=h(14,e=>UR(e,nz(e)),2),GR=o(7,e=>{BR(e),WR(e)}),KR=h(6,e=>GR(e,e.e,e.f)),qR=M(4,KR),JR=M(5,KR),YR=m(9,e=>{BR(e),WR(e)}),XR=(e,t)=>$R(e,t.timer),ZR=_(`l3`,e=>{E(e,`b`),u(e.b,`keydown`,function(t){t.key===`Enter`&&e.p(),t.key===`Escape`&&e.l&&(t.preventDefault(),e.r(``))})});function QR(e){b(e.a,`_jC`),b(e.b,FR),YR(e,null),XR(e,{timer:0}),ZR(e)}var $R=M(13,e=>{WR(e),HR(e)}),ez=e=>function(t){e.r(t)},tz=e=>t=>{if(e.n&&clearTimeout(e.n),!t){e.n=0,YR(e,null),GR(e,``);return}YR(e,t),e.n=setTimeout(e.p,150)},nz=e=>()=>{e.n&&=(clearTimeout(e.n),0);let t=e.j===null?e.h||``:e.j;YR(e,null),GR(e,t)};N(`l0`,ez),N(`l2`,tz),N(`l1`,nz);var rz=(e=>`<div><div title="Drag to resize"></div><div>${e}</div><div></div></div>`)(IR),iz=(e=>` D b D/${e}&l l`)(LR),az={A:`added`,D:`deleted`,M:`modified`,R:`renamed`},oz=h(7,e=>{T(e.a,`aria-expanded`,e._._.t.has(e._.f)?`false`:`true`),b(e.b,[`_iH`,{_iI:!e._._.t.has(e._.f)}])}),sz=j(29,oz,e=>e._._),cz=_(`z4`,e=>u(e.a,`click`,function(){let t=new Set(e._._.t);t.delete(e._.f)||t.add(e._.f),kz(e._._,t)})),lz=e=>{sz(e),uz._(e),dz._(e),fz._(e),b(e.a,`_iG`),he(e.c),de(e.c,12),Ee(e.c),b(e.d,`_iJ`),b(e.f,`_iK`),cz(e)},uz=f(1,0,oz),dz=f(1,0,e=>{T(e.a,`title`,e._.h),c(e.e,e._.h)}),fz=f(1,0,e=>c(e.g,e._.j)),pz=d(1,(e=>`<button type=button><span aria-hidden=true>${e}</span><span> </span><span> </span></button>`)(ye),(e=>` D D/${e}&l D l D m`)(Oe),lz),mz=g(4,e=>{b(e.a,[`_iF`,{_iE:e._.m===1}]),b(e.c,[`_iM`,{_iL:e._.m===1}]),pz(e,e._.m>1?0:1)}),hz=e=>{mz._(e),_z._(e)},gz=h(6,e=>T(e.c,`hidden`,e._.t.has(e.f))),_z=g(4,gz),vz=M(5,e=>{T(e.a,`data-section`,e.f),T(e.c,`data-tree`,e.f),gz(e),uz(e)}),yz=(e,t)=>{vz(e,t[0]?.id),bz(e,t[0]?.label),xz(e,t[0]?.files?.length)},bz=M(7,dz),xz=M(9,fz),Sz=_(`z5`,e=>l(e,{filter:e.q,sections:e.l,commentCounts:e.n,newKeys:e.o,onMount:function(){let t=(e,t)=>`${e.worktree}/${t}`,n=e=>e.files.map(e=>({path:e.path,status:az[e.status]??`modified`})),r=e=>e.files.map(e=>`${e.path}:${e.status}`).join(`
|
|
2798
|
-
`),i=(e,t)=>[...e].map(([e,t])=>`${e}=${t}`).sort().join(`,`)+`|`+[...t].sort().join(`,`),a=new Map,o=t=>e.a.querySelector(`[data-tree="${CSS.escape(t)}"]`),s=i=>{let s=o(i.id);if(!s)return;let c=new
|
|
2797
|
+
}`}var wP=new WeakMap;function TP(e){let t=wP.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(EA,`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(),wP.set(e,i),i}function EP(e,t){if(!e.isConnected)return;let n=TP(t);if(n==null)return;let r=t.querySelector(`style[${DA}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(DA,``),t.appendChild(i)),i.textContent=`:host { ${OA}: ${n}px; }`}var DP;function OP(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){DP??(DP=new CSSStyleSheet,DP.replaceSync(SP(bP)));let t=!1;try{e.adoptedStyleSheets=[DP],t=!0}catch{}if(t){e.querySelector(`style[${wA}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(wA,``),t.textContent=SP(bP),e.prepend(t)}}function kP(e,t){AP(e,t),OP(t),EP(e,t)}function AP(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`});kP(this,e)}}if(customElements.define(CA,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(CA)))e instanceof HTMLElement&&kP(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var jP=e=>e.startsWith(`f::`)?e.slice(3):e;function MP(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function NP(e,t){return e===``?t:`${e}/${t}`}function PP({files:e,path:t,isFolder:n,nextBasename:r}){let i=jP(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}=MP(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=NP(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 FP(e){return e.endsWith(`/`)}function IP(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 LP(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 RP(e,t){return t.includes(e)?LP(t):[e]}function zP(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 BP(e,t){return{draggedPaths:e,target:t}}function VP(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(FP(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function HP(e,t){return t.kind===`root`||t.directoryPath==null?IP(e):t.directoryPath}function UP(e,t){let n=e.map(e=>{let n=HP(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 WP(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 GP(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(!WP(hP.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 KP(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function qP(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 JP(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function YP(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 JP(e,t.path)?n?e:null:e;case`move`:return qP(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=YP(r,e,n),r==null)return null;return r}}}function XP(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function ZP(e){switch(e.operation){case`add`:return{...XP(e),operation:`add`,path:e.path};case`remove`:return{...XP(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...XP(e),from:e.from,operation:`move`,to:e.to}}}function QP(e){return{...XP(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>ZP(e)),operation:`batch`}}function $P(e){switch(e.operation){case`add`:case`remove`:case`move`:return ZP(e);case`batch`:return QP(e);default:return null}}function eF(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function tF(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 nF(e){return tF(e).at(-1)??null}function rF(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function iF(e){return e.endsWith(`/`)}var aF=e=>e.toLowerCase();function oF(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function sF(e){return e.endsWith(`/`)?e.slice(0,-1):e}function cF(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var lF=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},uF=Symbol(`FILE_TREE_RENAME_VIEW`),dF=512,fF=512;function pF(e){return e===`top`||e===`center`?e:`nearest`}function mF(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=tF(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 hF(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:mF(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var gF=class e{static{Object.defineProperty(e.prototype,uF,{configurable:!0,value(){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}},writable:!0})}#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=GP({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=nF(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:pF(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<=fF){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=RP(t,n);return this.#r.canDrag?.(r)!==!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=BP(t.draggedPaths,n);(VP(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}zP(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=BP(e.draggedPaths,t);if(VP(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=UP(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=iF(r),a=sF(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of tF(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=oF(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}#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,iF(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,iF(e)?{recursive:!0}:void 0);return}let t=iF(e),n=PP({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:sF(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(cF(n.sourcePath,t),cF(n.destinationPath,t))}#Y(e){this.#T!=null&&this.#E!==e&&(this.#E=e,this.#De())}resetPaths(e,t={}){let n=!Array.isArray(e),r=n?void 0:e,i=n?e:t,a=this.#H.list().length,o=this.#G,s=GP({paths:r,preparedInput:i.preparedInput},`resetPaths`,this.#e.sort),c=this.#le(s.paths,s.preparedInput,i.initialExpandedPaths),l=this.#c,u=this.#T,d=this.getSelectedPaths(),f=this.#z;this.#K?.(),this.#H=c,this.#d.clear(),this.#he();let p=d.map(e=>c.getPathInfo(e)?.path??null).filter(e=>e!=null),m=!eF(this.#B,p);this.#B=new Set(p),m&&(this.#V+=1),this.#z=f==null?null:c.getPathInfo(f)?.path??null,this.#T=u==null?null:c.getPathInfo(u)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(l,l!=null||p.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:s.paths.length,pathCountBefore:a,projectionChanged:!0,usedPreparedInput:i.preparedInput!=null,visibleCountDelta:this.#G-o})}#X(e){this.#Ie();let t=nF(e),n=rF(e,t),r=null,i=null;for(let e of this.#be()){if(nF(e)!==t)continue;let a=rF(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=tF(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=!eF(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 hP({...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 tF(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(aF),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(aF),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 tF(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:lF(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 tF(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 tF(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=hF(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,dF)),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=YP(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=YP(this.#c,e,!0),r=[...this.#B].map(t=>YP(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=YP(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return eF(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&&KP(e)&&(this.#i=null);let t=KP(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=$P(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},_F=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 vF(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 yF(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=[],r=0;for(;;){let e=t.indexOf(`/`,r);if(e===-1)break;n.push(t.slice(0,e+1)),r=e+1}return n}function bF(e,t){return t?`${e}/`:e}function xF(e,t=null){let n=_F(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,o=new Map;for(let t of e??[]){let e=CF(t);e!=null&&EF({canonicalPath:e.canonicalPath,changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,isDirectory:e.isDirectory,status:t.status,statusByPath:r})}return r.size===0?null:{changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}function SF(e,t){let n=t?.remove??[],r=t?.set??[];if(n.length===0&&r.length===0)return e;let i=new Map(e?.statusByPath),a=new Set(e?.directoriesWithChanges),o=new Set(e?.ignoredDirectoryPaths),s=new Map(e?.changeCountByDirectoryPath),c=!1;for(let e of n){let t=wF(e);t!=null&&(c=TF({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,statusByPath:i})||c)}for(let e of r){let t=CF(e);t!=null&&(c=EF({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,isDirectory:t.isDirectory,status:e.status,statusByPath:i})||c)}return c?i.size===0?null:{changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,signature:kF(i),statusByPath:i}:e}function CF(e){return wF(e.path)}function wF(e){let t=vF(e);if(t!=null)return{canonicalPath:bF(t.path,t.isDirectory),isDirectory:t.isDirectory}}function TF({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,statusByPath:i}){let a=i.get(e);return a!=null&&(i.delete(e),a===`ignored`&&e.endsWith(`/`)&&r.delete(e),OF(t,n,e),!0)}function EF({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,isDirectory:i,status:a,statusByPath:o}){let s=o.get(e);return s!==a&&(s??DF(t,n,e),o.set(e,a),a===`ignored`&&i?r.add(e):i&&r.delete(e),!0)}function DF(e,t,n){for(let r of yF(n))e.set(r,(e.get(r)??0)+1),t.add(r)}function OF(e,t,n){for(let r of yF(n)){let n=(e.get(r)??0)-1;n>0?e.set(r,n):(e.delete(r),t.delete(r))}}function kF(e){let t=`${e.size}`;for(let[n,r]of e)t+=`\0${n}\0${r}`;return t}var X,AF,jF,MF,NF,PF,FF,IF,LF,RF,zF={},BF=[],VF=Array.isArray,HF=BF.slice,UF=Object.assign;function WF(e){e&&e.parentNode&&e.remove()}function GF(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?HF.call(arguments,2):n),KF(e,o,r,i,null)}function KF(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??++AF,__i:-1,__u:0};return i==null&&X.vnode!=null&&X.vnode(a),a}function qF(e){return e.children}function JF(e,t){this.props=e,this.context=t,this.__g=0}function YF(e,t){if(t==null)return e.__?YF(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`?YF(e):null}function XF(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 XF(e)}}function ZF(e){(8&e.__g||!(e.__g|=8)||!jF.push(e)||NF++)&&MF==X.debounceRendering||((MF=X.debounceRendering)||queueMicrotask)(QF)}function QF(){for(var e,t,n,r,i,a,o,s,c=1;jF.length;)jF.length>c&&jF.sort(PF),e=jF.shift(),c=jF.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=UF({},r)).__v=r.__v+1,X.vnode&&X.vnode(n),oI(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??YF(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,cI(a,n,o),n.__e!=i&&XF(n)));NF=0}function $F(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||BF,b=t.length;for(c=eI(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?zF:y[m.__i]||zF,m.__i=f,_=oI(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&dI(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=tI(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function eI(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?KF(null,o,null,null,null):VF(o)?KF(qF,{children:o},null,null,null):o.constructor==null&&o.__b>0?KF(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=nI(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=YF(s)),fI(s,s));return r}function tI(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=tI(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=YF(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function nI(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);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 rI(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function iI(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||rI(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||rI(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(FF,`$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=IF,e.addEventListener(t,a?RF:LF,a)):e.removeEventListener(t,a?RF:LF,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 aI(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=IF++;else if(t.u<n.l)return;return n(X.event?X.event(t):t)}}}function oI(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=X.__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 JF(v,x),f.constructor=M,f.render=pI),b&&b.sub(f),f.props=v,f.state||(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=UF({},f.__s)),UF(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=X.__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=UF({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===qF&&d.key==null&&(E=lI(d.props.children)),s=$F(e,VF(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--;)WF(a[j]);sI(t)}}else t.__e=n.__e,t.__k=n.__k,e.then||sI(t);X.__e(e,t,n)}else s=t.__e=uI(n.__e,t,n,r,i,a,o,c,l,u);return(d=X.diffed)&&d(t),128&t.__u?void 0:s}function sI(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(sI)}function cI(e,t,n){for(var r=0;r<n.length;r++)dI(n[r],n[++r],n[++r]);X.__c&&X.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){X.__e(e,t.__v)}})}function lI(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:VF(e)?e.map(lI):UF({},e)}function uI(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&&=(X.__m&&X.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=HF.call(e.childNodes),v=n.props||zF,!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;iI(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&&!_||iI(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=``),$F(b==`template`?e.content:e,VF(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&YF(n,0),s,c,l),a!=null)for(u=a.length;u--;)WF(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||iI(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&iI(e,u,g,v[u],i))}return e}function dI(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){X.__e(e,n)}}function fI(e,t,n){var r,i;if(X.unmount&&X.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||dI(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){X.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&fI(r[i],t,n||typeof e.type!=`function`);n||WF(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function pI(e,t,n){return this.constructor(e,n)}function mI(e,t){var n,r,i,a;t==document&&(t=document.documentElement),X.__&&X.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=GF(qF,null,[e]),i=[],a=[],oI(t,e,r||zF,zF,t.namespaceURI,r?null:t.firstChild?HF.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),cI(i,e,a)}function hI(e,t){e.__u|=32,mI(e,t)}X={__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 NF=0,e}},AF=0,JF.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=UF({},this.state);typeof e==`function`&&(e=e(UF({},n),this.props)),e&&UF(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),ZF(this))},JF.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),ZF(this))},JF.prototype.render=qF,jF=[],NF=0,PF=function(e,t){return e.__v.__b-t.__v.__b},FF=/(PointerCapture)$|Capture$/i,IF=0,LF=aI(!1),RF=aI(!0);var gI=0;Array.isArray;function Z(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:--gI,__i:-1,__u:0,__source:i,__self:a};return X.vnode&&X.vnode(l),l}var _I=16,vI=16,yI={};function bI({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}=yI[e]??{width:_I,height:vI},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return Z(`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:Z(`use`,{href:c})})}var xI=e=>e!==void 0&&/\s/.test(e),SI=(e,t)=>{let n=t=>xI(e[t-1])||xI(e[t]);if(!n(t))return t;for(let r=1;r<e.length;r++){let i=t-r;if(i>0&&!n(i))return i;let a=t+r;if(a<e.length&&!n(a))return a}return t},CI=e=>SI(e,Math.ceil(e.length/2)),wI=e=>{if(e.length<2)return[e,``];let t=CI(e);return[e.slice(0,t),e.slice(t)]},TI=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:CI(e);return[e.slice(0,r),e.slice(r)]},EI=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)]},DI=(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)]},OI=(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)]},kI=(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 AI({children:e,marker:t,variant:n=`default`}){"use no memo";return Z(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:Z(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?Z(`span`,{"data-truncate-fade":!0}):t})})}function jI(e){"use no memo";let{mode:t,children:n}=e;return Z(`div`,{children:[Z(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?Z(`span`,{children:n}):n}),Z(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?Z(`span`,{children:n}):n})]})}function MI({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=Z(jI,{mode:t,children:e},`content`),o=Z(AI,{marker:n,mode:t,variant:r},`marker`),s=Z(`div`,{"data-truncate-fill":!0},`fill`);return Z(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:Z(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function NI({children:e,...t}){"use no memo";return Z(MI,{mode:`truncate`,...t,children:e})}function PI({children:e,...t}){"use no memo";return Z(MI,{mode:`fruncate`,...t,children:e})}function FI({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=Z(NI,{...s,children:t[0]}),l=Z(PI,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return Z(`div`,{className:a,style:o});if(e.length<i)return Z(n===`end`?PI:NI,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=wI:r===`extension`?t=TI:r===`leaf-path`&&(t=EI);else if(typeof r==`number`)t=DI,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=OI:e===`first`&&(t=kI)}else typeof r==`function`&&(t=r);t??=wI;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=Z(NI,{...s,..._,children:f}),l=Z(PI,{...s,...v,children:p})}return Z(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[Z(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),Z(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var II={endIndex:-1,startIndex:-1};function LI(e,t,n){return Math.min(Math.max(e,t),n)}function RI(e,t){return e<0||t<e?II:{endIndex:t,startIndex:e}}function zI(e){return e.startIndex<0||e.endIndex<e.startIndex}function BI(e,t){return zI(e)?0:(e.endIndex-e.startIndex+1)*t}function VI(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function HI(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function UI(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 WI(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 GI(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 KI(e,t,n){if(e.length===0||t<=0)return[];let r=GI(e),i=UI(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=WI(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 qI(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=LI(t.scrollTop,0,o),c=t.stickyRows??KI(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=VI(s,n,t.itemHeight),m=VI(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?II:RI(m,HI(u+d,n,t.itemHeight)),y=g+1,b=zI(v)?II:RI(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=BI(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:zI(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var JI={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},YI={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},XI=`Contains git status items`;function ZI(e){return e.current?!0:(e.current=!0,!1)}function QI(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 $I(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return QI({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 eL(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 tL(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 nL(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 rL(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function iL(e,t){return e!=null&&e>0?e:t}function aL(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 oL(e,t,n,r,i=0){let a=QI({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a!=null&&(e.scrollTop=a,!0)}function sL(e,t,n,r,i,a,o=0){let s=$I({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s!=null&&(e.scrollTop=s,!0)}function cL(e,t,n,r,i,a){let o=eL({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o!=null&&(e.scrollTop=o,!0)}function lL(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function uL(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function dL({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return Z(`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 fL(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 pL(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 mL,hL,gL,_L,vL=Object.is,yL=0,bL=[],xL=X,SL=xL.__b,CL=xL.__r,wL=xL.diffed,TL=xL.__c,EL=xL.unmount,DL=xL.__;function OL(e,t){xL.__h&&xL.__h(hL,e,yL||t),yL=0;var n=hL.__H||(hL.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function kL(e){return yL=1,AL(VL,e)}function AL(e,t,n){var r=OL(mL++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):VL(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);vL(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=hL,!hL.__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,vL(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};hL.__f=!0;var a=hL.shouldComponentUpdate,o=hL.componentWillUpdate;hL.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)},hL.shouldComponentUpdate=i}return r.__N||r.__}function jL(e,t){var n=OL(mL++,3);!xL.__s&&BL(n.__H,t)&&(n.__=e,n.u=t,hL.__H.__h.push(n))}function ML(e,t){var n=OL(mL++,4);!xL.__s&&BL(n.__H,t)&&(n.__=e,n.u=t,hL.__h.push(n))}function Q(e){return yL=5,NL(function(){return{current:e}},[])}function NL(e,t){var n=OL(mL++,7);return BL(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function PL(e,t){return yL=8,NL(function(){return e},t)}function FL(){for(var e;e=bL.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(RL),e.__H.__h.forEach(zL),e.__H.__h=[]}catch(t){e.__H.__h=[],xL.__e(t,e.__v)}}xL.__b=function(e){hL=null,SL&&SL(e)},xL.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),DL&&DL(e,t)},xL.__r=function(e){CL&&CL(e),mL=0;var t=(hL=e.__c).__H;t&&(gL===hL?(t.__h=[],hL.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(RL),t.__h.forEach(zL),t.__h=[],mL=0)),gL=hL},xL.diffed=function(e){wL&&wL(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(bL.push(t)!==1&&_L===xL.requestAnimationFrame||((_L=xL.requestAnimationFrame)||LL)(FL)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),gL=hL=null},xL.__c=function(e,t){t.some(function(e){try{e.__h.forEach(RL),e.__h=e.__h.filter(function(e){return!e.__||zL(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],xL.__e(n,e.__v)}}),TL&&TL(e,t)},xL.unmount=function(e){EL&&EL(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{RL(e)}catch(e){t=e}}),n.__H=void 0,t&&xL.__e(t,n.__v))};var IL=typeof requestAnimationFrame==`function`;function LL(e){var t,n=function(){clearTimeout(r),IL&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);IL&&(t=requestAnimationFrame(n))}function RL(e){var t=hL,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),hL=t}function zL(e){var t=hL;e.__c=e.__(),hL=t}function BL(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!vL(t,e[n])})}function VL(e,t){return typeof t==`function`?t(e):t}function HL(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:Z(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return Z(qF,{children:[Z(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:Z(NI,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function UL(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function WL(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function GL(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 KL({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=qI(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:GL(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?GL(u,1,t,o):i&&r<=0&&c.length>0?KI(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 qL=400,JL=40,YL=18;function XL(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))?ZL(e,t,n):a instanceof HTMLElement?a:null}function ZL(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 QL(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return 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 $L(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 eR(){return navigator.vendor!==`Apple Computer, Inc.`}function tR(e,t){let n=e-t.top;if(n<JL)return-Math.ceil((JL-Math.max(0,n))/JL*YL);let r=t.bottom-e;return r<JL?Math.ceil((JL-Math.max(0,r))/JL*YL):0}function nR(e,t){if(e!=null){let t=JI[e];return t==null?null:{text:t,title:YI[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:XI}:null}function rR(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 iR(e){return e!=null&&`toggle`in e}function aR(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function oR(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function sR(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function cR(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function lR(e,t){return t&&cR(e)||(e.ctrlKey||e.metaKey)&&aR(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var uR=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function dR(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 fR(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 pR(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function mR(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function hR(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function gR(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 _R(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 vR(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 yR(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=vR(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 bR(e,t){return{kind:e.kind,name:WL(e),path:t}}function xR(e){return e==null?void 0:`${e}__tree`}function SR(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function CR(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function wR(e,t){if(e==null)return null;if(`text`in e)return e.parts==null?Z(`span`,{title:e.title,children:e.text}):Z(`span`,{title:e.title,children:e.parts.map((e,t)=>Z(`span`,{style:{color:e.color},children:e.text},t))});let n=typeof e.icon==`string`?CR(e.icon)?t(e.icon):{name:e.icon}:CR(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return Z(`span`,{title:e.title,children:Z(bI,{...n})})}function TR(e){e!=null&&tL(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function ER(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=UL(e);return Z(qF,{children:[e.depth>0?Z(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>Z(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,Z(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?Z(bI,{...t(`file-tree-icon-chevron`)}):Z(bI,{...t(`file-tree-icon-file`,u)})}),Z(`div`,{"data-item-section":`content`,children:e.isFlattened?HL(e,c,a):c??Z(FI,{minimumLength:5,split:`extension`,children:e.name})}),i?Z(`div`,{"data-item-section":`decoration`,children:r==null?null:wR(r,t)}):null,s?Z(`div`,{"data-item-section":`git`,children:wR(o,t)}):null,n?Z(`div`,{"data-item-section":`action`,children:l?Z(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:Z(bI,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function DR(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=UL(t),{isParked:ee=!1,mode:te=`flow`,style:ne}=r,re=te===`sticky`,ie=_?.get(P)??null??rR(t.ancestorPaths,v,y),ae=t.kind===`directory`&&(b?.has(P)??!1),oe=A(t,P),se=nR(ie,ae),ce=S&&w,le=oe!=null||x||ce,ue=ce&&T===`always`,de=a.getPath()===P,fe=de?a.getValue():``,pe=re||!de?null:Z(dL,{ref:D,ariaLabel:`Rename ${WL(t)}`,isFlattened:t.isFlattened,value:fe,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),me=ER(t,k,{actionLaneEnabled:ce,customDecoration:oe,decorationLaneEnabled:le,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:se,gitLaneActive:x,renameInput:pe,showDecorativeActionAffordance:ue}),he={...fL({ariaLabel:WL(t),domId:t.isFocused?SR(h,P,ee):void 0,extraStyle:ne,features:{actionLaneEnabled:ce,contextMenuButtonVisibility:ce?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:ee,itemHeight:g,mode:te,row:t,state:{containsGitChange:ae,effectiveGitStatus:ie,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:pR(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:re?void 0:()=>{i.focusMountedPathFromInput(P)},onKeyDown:re?void 0:N,ref:e=>{O(P,e)}};return!re&&de?Z(`div`,{...he,children:me}):Z(`button`,{...he,type:`button`,draggable:u&&!ee,onDragEnd:u&&!ee?p:void 0,onDragStart:u&&!ee?e=>{f(e,t,P)}:void 0,onMouseDown:e=>{if(re){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!ee?e=>{m(e,t,P)}:void 0,onClick:e=>{M(e,t,P,te)},children:me})}function OR(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(UL(e))).map((n,r)=>DR(e,n,t.start+r))}function kR({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=yP,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 _=Q(null),v=Q(null),y=Q(!1),b=Q(null),x=Q(null),S=Q(null),C=Q(null),w=Q(null),T=Q(new Map),E=Q(new Map),D=Q(()=>{}),O=Q(null),k=Q(0),A=Q(!1),j=Q(null);j.current!==t&&(A.current=!1,j.current=t);let M=Q(!1),N=Q(null),P=Q(null),ee=Q(!1),te=Q(null),ne=Q(null),re=Q(null),ie=Q(null),ae=Q(null),oe=Q(null),se=Q(null),ce=Q(null),le=Q(!1),ue=Q(null),de=Q(null),fe=Q(null),pe=Q(null),me=NL(()=>new Map,[]),[,he]=kL(0),ge=Q(!1),[_e,ve]=kL(null),[ye,be]=kL(null),[xe,Se]=kL(null),[Ce,we]=kL(null),[Te,Ee]=kL(0),[F,De]=kL(null),Oe=Q(F);Oe.current=F;let ke=Q(null),Ae=Q(null),je=Q(null),Me=Q(null),Ne=Q(null),Pe=Q(!1),Fe=()=>{Ae.current=null,je.current=null,Me.current=null},Ie=(e,t)=>{Ae.current=e,je.current=null,Me.current=t==null?null:{path:e,scrollTop:t}},Le=(e,t)=>{Ae.current=null,je.current={path:e,viewportOffset:t},Me.current=null},Re=Q(d===`retain`&&t.isSearchOpen()),[ze,Be]=kL(p);jL(()=>{p||Be(!1)},[p]);let Ve=Q(!1),He=PL(()=>{Ve.current=!0,Be(e=>e&&!1)},[]),[Ue,We]=kL(()=>KL({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[Ge,Ke]=kL(!1);jL(()=>{Ke(!0)},[]);let qe=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Je=e?.contextMenu?.triggerMode??(qe?`right-click`:`both`),Ye=Je===`both`||Je===`button`,Xe=e?.contextMenu?.buttonVisibility??`when-needed`,Ze=Je===`both`||Je===`right-click`;ML(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;Ne.current=t,be(t),we(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(Pe.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 Qe=PL((e,t)=>{hR(T.current,e,t)},[]),$e=PL((e,t)=>{hR(E.current,e,t)},[]),et=PL(e=>{x.current=e},[]),tt=PL(e=>gR(e,E.current,T.current),[]),nt=n!=null||r!=null||i!=null,{resolveIcon:rt}=NL(()=>RA(a),[a]),it=t[uF](),at=it.getPath(),ot=at!=null,st=t.isSearchOpen(),ct=t.getSearchValue(),I=t.getFocusedPath(),L=t.getFocusedIndex(),lt=t.getScrollRequest(),ut=t.isDragAndDropEnabled(),dt=t.getDragSession(),ft=NL(()=>dt==null?null:new Set(dt.draggedPaths),[dt]),pt=dt?.target??null,mt=dt?.primaryPath??null,ht=xR(o),{overlayHeight:gt,overlayRows:_t,snapshot:vt,visibleRows:yt}=Ue,bt=vt.physical.viewportHeight,xt=NL(()=>({end:vt.window.endIndex,start:vt.window.startIndex}),[vt.window.endIndex,vt.window.startIndex]),St=_t,Ct=vt.sticky.rows,wt=vt.physical.totalHeight,Tt=vt.sticky.height,Et=NL(()=>new Set(Ct.map(e=>UL(e.row))),[Ct]),Dt=L>=0&&L>=xt.start&&L<=xt.end,Ot=PL((e,t)=>u?.({item:bR(e,t),row:e})??null,[u]),kt=PL(e=>tL(e==null?null:T.current.get(e)??null)?!0:tL(S.current),[]),At=PL(e=>{kt(t.focusNearestPath(e))},[t,kt]),jt=Q(At);jt.current=At;let Mt=Q(!0),Nt=Q(()=>{}),Pt=PL((t=!0)=>{let n=Oe.current;n!=null&&(Mt.current=Mt.current&&t,De(null),e?.contextMenu?.onClose?.(),Mt.current&&At(n.path))},[e?.contextMenu,At]);Nt.current=Pt;let Ft=PL(e=>{let t=e==null?null:mR(S.current,e);Se(e=>e===t?e:t)},[]),It=PL((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=tt(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;Ie(n,e?.scrollTop??null),M.current=!0,ve(e=>e===n?e:n)}i.focus(),Ft(a),Mt.current=!0,De({anchorRect:r?.anchorRect??null,item:bR(e,n),path:n,source:r?.source??`keyboard`})},[t,tt,Ft]),Lt=PL(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=rL(e,bt);te.current=L<0||e==null?null:Math.max(0,Math.min(L*s-e.scrollTop,Math.max(0,t-s))),ee.current=!0}t.startRenaming(e)!==!1&&(we(`focus`),he(e=>e+1))}},[t,L,s,l,bt]),Rt=PL((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=rL(i,bt),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:KL({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return M.current=!0,cL(i,a,s,l,u,d),D.current(),ke.current=n?e:null,!0},[t,s,c,bt,h]),zt=()=>y.current===!0||pe.current!=null||le.current===!0,Bt=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),Vt=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Ht=()=>{ie.current!=null&&(clearTimeout(ie.current),ie.current=null),re.current=null},Ut=()=>{oe.current?.remove(),oe.current=null},Wt=()=>{Vt(ne.current),ne.current=null,ae.current=null},Gt=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},Kt=()=>{ce.current?.(),ce.current=null,pe.current!=null&&(clearTimeout(pe.current),pe.current=null),le.current=!1,ue.current=null,fe.current=null,de.current!=null&&(de.current.setAttribute(`draggable`,`true`),de.current.style.removeProperty(`touch-action`),de.current=null),Ut(),Ht(),Wt(),se.current=null},qt=(e,n)=>{let r=S.current?.getRootNode(),i=QL(XL(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Jt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Ht();return}let r=t.getItem(e.directoryPath),i=iR(r)?r:null;if(i==null||i.isExpanded()){Ht();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;re.current!==a&&(Ht(),re.current=a,ie.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind===`directory`&&n.directoryPath===e.directoryPath&&n.flattenedSegmentPath===e.flattenedSegmentPath&&i.expand()},n))},Yt=()=>{ne.current=null;let e=ae.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=tR(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()),Jt(qt(e.clientX,e.clientY)),ne.current=Bt(Yt)},Xt=(e,t)=>{ae.current={clientX:e,clientY:t},ne.current??=Bt(Yt)},Zt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(Kt(),Ut(),Ht(),Wt(),t.startDrag(r)===!1){e.preventDefault();return}if(se.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),eR())){let t=$L(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Gt(t),oe.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Qt=()=>{Ut(),Ht(),Wt(),se.current=null,t.cancelDrag()},R=(e,n,r)=>{if(pe.current!=null||le.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;fe.current={clientX:i.clientX,clientY:i.clientY},de.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!le.current;pe.current!=null&&(clearTimeout(pe.current),pe.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),ce.current===o&&(ce.current=null),t&&(a.setAttribute(`draggable`,`true`),de.current===a&&(de.current=null),fe.current=null)},s=e=>{let t=e.touches[0],n=fe.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=100||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),ce.current=o,pe.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),de.current===a&&(de.current=null),fe.current=null;return}le.current=!0,de.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),se.current=n;let e=a.getBoundingClientRect(),s=$L(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`}),Gt(s),oe.current=s,ue.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=ue.current;n!=null&&oe.current!=null&&(oe.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Jt(qt(t.clientX,t.clientY)),Xt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&qt(n.clientX,n.clientY),t.completeDrag(),Kt()},u=()=>{t.cancelDrag(),Kt()};ce.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)},qL)},$t=e=>{if(F!=null){if(e.key===`Escape`){Pt(),e.preventDefault(),e.stopPropagation();return}uR.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(it.isActive()){if(e.isComposing||e.keyCode===229)return;if(e.key===`Escape`)it.cancel();else if(e.key===`Enter`)it.commit();else return;we(`focus`),he(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Lt(I??void 0),e.preventDefault(),e.stopPropagation();return}if(st){if(e.key===`Escape`)ee.current=!1,te.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=rL(n,bt);te.current=L<0||n==null?null:Math.max(0,Math.min(L*s-n.scrollTop,Math.max(0,r-s))),ee.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;we(`focus`),he(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&oR(e)){t.openSearch(e.key),he(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=qe&&cR(e),r=lR(e,qe),i=r&&S.current!=null?nL(S.current):null,a=r?new Set(_R(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==I&&a.has(o)){let e=C.current;Ie(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=iR(p)?p:null,h=u!=null&&(Et.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=gR(u,E.current,T.current);e==null||n==null?y=!1:It(e,u)}else if((e.ctrlKey||e.metaKey)&&aR(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;we(`focus`);let b=t.getFocusedPath(),x=b!=null&&(Et.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))Ie(b,v?.scrollTop??null),M.current=!0,ve(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(Le(b,yR(S.current,v,i,u,s,Tt,bt)),M.current=!0,ve(e=>e===b?e:b)):Fe()}he(e=>e+1),e.preventDefault(),e.stopPropagation()};ML(()=>{if(!(!f||!st)){if(Re.current){Re.current=!1;return}tL(w.current)}},[st,f]),ML(()=>{let e=x.current;switch(uL({hasRenderedInput:e!=null,previousRenamingPath:P.current,renamingPath:at})){case`reset`:P.current=null;return;case`reveal-canonical`:at!=null&&Rt(at,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(ke.current=null,P.current=at,tL(e),e.select());return}},[xt.end,xt.start,at,Rt,Et]),ML(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=nL(e)?.dataset.itemPath??null;ve(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,nL(e)!=null){r();return}M.current=!1,ve(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),M.current=!1,ve(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;ve(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),ML(()=>{let e=S.current;e!=null&&(vt.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[vt.physical.scrollTop]),ML(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=rL(n,g);let a=()=>{let e=t.getVisibleCount(),r=iL(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),We(KL({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=iL(O.current,g),i=t.getVisibleRows(e,e)[0]??null;oL(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=t.subscribe(()=>{ZI(ge)&&he(e=>e+1),a()}),l=()=>{Pe.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,Ee(e=>e+1),e=null},50))},u=null,d=()=>{i!=null&&delete i.dataset.overlayReveal,u!=null&&(clearTimeout(u),u=null)},f=()=>{i!=null&&Pe.current!==!0&&(n.scrollTop>0||(i.dataset.overlayReveal=`true`,u!=null&&clearTimeout(u),u=setTimeout(()=>{d()},200)))},p=()=>{if(a(),n.scrollTop>0&&d(),Oe.current!=null&&y.current&&Nt.current(),Pe.current===!0){y.current=!1;return}be(e=>e==null?e:null),l()},m=()=>{l(),f()},_=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),v=e=>{_.has(e.key)&&m()};n.addEventListener(`scroll`,p,{passive:!0}),n.addEventListener(`wheel`,m,{passive:!0}),n.addEventListener(`touchmove`,m,{passive:!0}),n.addEventListener(`keydown`,v);let x=typeof ResizeObserver<`u`?new ResizeObserver(e=>{O.current=(e[0]==null?null:aL(e[0]))??rL(n,g),a()}):null;return x?.observe(n),()=>{D.current=()=>{},o(),n.removeEventListener(`scroll`,p),n.removeEventListener(`wheel`,m),n.removeEventListener(`touchmove`,m),n.removeEventListener(`keydown`,v),e!=null&&clearTimeout(e),u!=null&&clearTimeout(u),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,O.current=null,x?.disconnect()}},[t,g,s,c,h]),ML(()=>{qe||F==null||Pt(!1)},[Pt,qe,F]);let en=NL(()=>F==null?null:`${F.path}::${F.source}`,[F]);ML(()=>{if(en==null){m?.clearSlotContent(AA);return}let t=Oe.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??fR(n.getBoundingClientRect()),close:e=>{Nt.current(e?.restoreFocus??!0)},restoreFocus:()=>{Mt.current&&jt.current(Oe.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(AA,i),e?.contextMenu?.onOpen?.(t.item,r),TR(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&TR(i)}),()=>{m?.clearSlotContent(AA)}},[en,e?.contextMenu,m]),ML(()=>{F!=null&&t.getItem(F.path)==null&&Pt()},[Pt,F,t]),ML(()=>{if(F==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(dR(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&Pt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Pt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[Pt,F]),ML(()=>{let e=C.current,n=S.current;if(e==null||n==null){N.current=I;return}let r=I==null?null:T.current.get(I)??null,i=nL(n),a=i?.dataset.itemPath??null,o=ot&&x.current===i,c=f&&w.current===i,l=ee.current&&!st,u=te.current??0,d=ke.current,p=Ae.current,m=je.current,g=Me.current,_=i!=null,v=M.current||_,y=N.current!==I,b=p!=null&&p===I&&I!=null,E=!1,O=!1;if(lt!=null&<.id!==k.current){k.current=lt.id;let n=lt.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,bt-s))):Tt;E=!0,O=sL(e,n,s,bt,wt,lt.offset,t)}t.clearScrollRequest(lt.id)}let A=!E&&l&&cL(e,L,s,bt,wt,u),j=!E&&d!=null&&d===I&&cL(e,L,s,bt,wt,Tt),P=!E&&m!=null&&m.path===I&&cL(e,L,s,bt,wt,m.viewportOffset),ne=!E&&g!=null&&g.path===I&&e.scrollTop!==g.scrollTop;if(ne&&(e.scrollTop=g.scrollTop),(ne||O||j||P||A||v&&y&&d!==I&&!b&&oL(e,L,s,bt,Tt))&&D.current(),E){N.current=I;return}if(!v){N.current=I;return}if(o){N.current=I;return}if(c&&!l){N.current=I;return}if(r==null){l&&L>=0&&(cL(e,L,s,bt,wt,u),D.current()),N.current=I;return}(y||l||d===I||p===I||m?.path===I||g?.path===I||a==null||a!==I)&&(tL(r),d===I&&(ke.current=null),p===I&&(Ae.current=null),m?.path===I&&(je.current=null),g?.path===I&&(Me.current=null),ee.current=!1,te.current=null),N.current=I},[t,L,I,Dt,s,ot,st,xt,bt,f,lt,h,Tt,wt,yt]);let tn=L>=0&&L>=vt.visible.startIndex&&L<=vt.visible.endIndex,nn=I!=null&&St.some(e=>UL(e.row)===I),rn=tn||nn,an=Ye&&M.current===!0&&rn?I:null,on=Ce===`pointer`?ye:null,sn=F?.path??Ne.current??on??an??ye,cn=F?.source===`right-click`;ML(()=>{y.current&&F==null||Ft(tt(sn))},[F,tt,xt,bt,Te,St,sn,Ft,yt]);let ln=PL(e=>{if(y.current||dR(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&&we(e=>e===`pointer`?e:`pointer`),be(e=>e===i?e:i)},[]),un=PL(()=>{be(null)},[]);ML(()=>{if(!ut)return;let e=()=>{Kt(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),Kt(),t.cancelDrag()}},[t,ut]);let dn=e=>{if(!ut||t.getDragSession()==null||le.current)return;let n=QL(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Jt(t.getDragSession()?.target??null),Xt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},fn=e=>{if(!ut||t.getDragSession()==null||le.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Ht(),Wt(),t.setDragTarget(null))},pn=e=>{!ut||t.getDragSession()==null||le.current||(e.preventDefault(),qt(e.clientX,e.clientY),t.completeDrag(),Ut(),Ht(),Wt(),se.current=null)},mn=vt.window.height,hn=vt.window.offsetTop,gn=Math.min(0,bt-mn),_n=Math.min(0,bt-mn-Tt),vn=_e===I||ee.current,yn=I!=null&&vn&&!Dt&&L>=0?yt[L]??t.getVisibleRows(L,L)[0]??null:null,bn=yn==null?null:lL(L,s,xt,mn),xn=se.current,Sn=mt!=null&&xn!=null&&xn.path===mt&&xn.index>=xt.start&&xn.index<=xt.end,Cn=mt!=null&&xn!=null&&xn.path===mt&&!Sn&&xn.path!==yn?.path?xn:null,wn=Cn==null?null:lL(Cn.index,s,xt,mn),Tn=sR((L>=0?yt[L]??t.getVisibleRows(L,L)[0]??null:null)?.ancestorPaths.at(-1)??null),En=st&&I!=null?SR(o,I,!Dt):void 0,z=F?.path??(st?I:_e),Dn=F?.path??ye,On=tt(sn),kn=qe&&Ye&&!cn&&!ot&&On!=null&&xe!=null&&sn!=null,An=qe&&(kn||F!=null),jn=F?.anchorRect,Mn=jn==null&&On!=null&&xe!=null&&(F!=null||kn)?xe:null,Nn=jn==null?Mn==null?void 0:{top:`${Mn}px`}:{left:`${jn.left}px`,position:`fixed`,right:`auto`,top:`${jn.top}px`},Pn=cn?{opacity:`0`}:void 0,Fn=PL((e,n,r,i)=>{let a=pL({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:st,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)}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=vt.visible.startIndex&&n.index<=vt.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(M.current=!0,ve(e=>e===c?e:c),we(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&Rt(c,{targetOffset:`sticky-parents`})},[t,st,vt.visible.endIndex,vt.visible.startIndex,Rt]),In=()=>{if(y.current||!Ye||sn==null||On==null)return;let e=t.getItem(sn);e!=null&&(Ft(On),Mt.current=!0,De({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:On.getAttribute(`aria-label`)??sn,path:e.getPath()},path:e.getPath(),source:`button`}))},Ln={contextHoverPath:Dn,contextMenuButtonTriggerEnabled:Ye,contextMenuButtonVisibility:Xe,contextMenuEnabled:qe,contextMenuRightClickEnabled:Ze,contextMenuTriggerMode:Je,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:ut,draggedPathSet:ft,dragTarget:pt,gitLaneActive:nt,gitStatusByPath:n,handleRowDragEnd:Qt,handleRowDragStart:Zt,handleRowTouchStart:R,ignoredGitDirectories:r,ignoredInheritanceCache:me,instanceId:o,itemHeight:s,onKeyDown:$t,onRowClick:Fn,openContextMenuForRow:It,registerButton:Qe,registerRenameInput:et,renameView:it,renderDecorationForRow:Ot,resolveIcon:rt,shouldSuppressContextMenu:zt,visualFocusPath:z},Rn={...Ln,registerButton:$e};return Z(`div`,{ref:S,id:ht,"data-file-tree-context-menu-button-visibility":qe&&Ye?Xe:void 0,"data-file-tree-context-menu-trigger-mode":qe?Je:void 0,"data-file-tree-has-context-menu-action-lane":qe&&Ye?`true`:void 0,"data-file-tree-has-git-lane":nt?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:ut?fn:void 0,onDragOver:ut?dn:void 0,onDrop:ut?pn:void 0,onKeyDown:$t,onPointerLeave:qe?un:void 0,onPointerOver:qe?ln:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[Z(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:Tn}}),Z(`slot`,{name:kA,"data-type":`header-slot`}),f?Z(`div`,{"data-file-tree-search-container":!0,"data-open":st?`true`:`false`,children:Z(`input`,{ref:w,"aria-activedescendant":En,"aria-controls":ht,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":ze?`true`:void 0,value:ct,onBlur:()=>{d===`retain`&&!Ve.current||t.closeSearch()},onFocus:He,onPointerDown:He,onInput:e=>{He();let n=e.currentTarget;t.setSearch(n.value)}})}):null,Z(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&Ge&&St.length>0?Z(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:Z(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${gt}px`},children:St.map((e,t)=>DR(Rn,e.row,`sticky:${UL(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${St.length-t}`}}))})}):null,Z(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${wt}px`},children:[Z(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${hn}px`}}),Z(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${mn}px`,top:`${gn}px`,bottom:`${_n}px`},children:[OR(Ln,xt,Et),yn!=null&&bn!=null?DR(Ln,yn,`parked:${yn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:mt===yn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${bn}px`}}):null,Cn!=null&&wn!=null?DR(Ln,Cn,`parked-drag:${Cn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${wn}px`}}):null]})]})]}),qe?Z(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":An?`true`:`false`,style:Nn,children:[Z(`button`,{ref:v,type:`button`,"data-type":jA,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":F==null?`false`:`true`,"data-visible":kn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),F!=null){Pt();return}In()},tabIndex:-1,style:Pn,children:Z(bI,{...rt(`file-tree-icon-ellipsis`)})}),F==null?null:Z(`slot`,{name:AA})]}):null,F==null?null:Z(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),Pt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),Pt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var AR={hydrateRoot:(e,t)=>{hI(GF(kR,t),e)},renderRoot:(e,t)=>{mI(GF(kR,t),e)},unmountRoot:e=>{mI(null,e)}};function jR(e,t){AR.renderRoot(e,t)}function MR(e,t){AR.hydrateRoot(e,t)}function NR(e){AR.unmountRoot(e)}var PR=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)}}};function FR(e,t,n){if(!e.s){if(n instanceof IR){if(!n.s)return void(n.o=FR.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(FR.bind(null,e,t),FR.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}var IR=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{FR(r,1,a(this.v))}catch(e){FR(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?FR(r,1,t?t(i):i):n?FR(r,1,n(i)):FR(r,2,i)}catch(e){FR(r,2,e)}},r},e}();Array.isArray;var LR=0;function RR(e){return e!=null&&e.length>0?e:(LR+=1,`pst_ft_${LR}`)}function zR({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??yP)}function BR(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 VR(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 HR(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var UR=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new PR;#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=RR(a),this.#p=xF(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=vP(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new gF({...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&&(NR(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()}getFocusedIndex(){return this.#t.getFocusedIndex()}getVisibleCount(){return this.#t.getVisibleCount()}getVisibleRows(e,t){return this.#t.getVisibleRows(e,t)}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)}focusFirstItem(){this.#t.focusFirstItem()}focusLastItem(){this.#t.focusLastItem()}focusNextItem(){this.#t.focusNextItem()}focusPreviousItem(){this.#t.focusPreviousItem()}focusParentItem(){this.#t.focusParentItem()}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)}applyGitStatusPatch(e){let t=SF(this.#p,e);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&jR(n.wrapper,this.#w())}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){Array.isArray(e)?this.#t.resetPaths(e,t):this.#t.resetPaths(e)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),jR(t.wrapper,this.#w()))}setGitStatus(e){let t=xF(e,this.#p);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&jR(n.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),jR(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),MR(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),jR(r,this.#w())}#C(){return{initialViewportHeight:zR({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(kA,e());return}this.#l.setSlotHtml(kA,this.#e?.header?.html??null)}#k(e){let t=HR(e).find(e=>VR(e)),n=BR(yA(NA(this.#m).set));n!=null&&(t==null||t.outerHTML!==n.outerHTML)&&(t==null?e.prepend(n):t.replaceWith(n))}#A(e){let t=HR(e),n=t.find(e=>VR(e)),r=t.filter(e=>e!==n),i=NA(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=BR(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=NA(this.#m);t.colored&&xA(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${TA}]`);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(TA,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=CP(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 kP(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)}},WR=`_jK _n`,GR=`<div><input type=search placeholder="Filter files…" aria-label="Filter files"></div>`,KR=` D l`,qR=h(18,e=>S(e,`b`,e.l,lz(e))),JR=M(11,qR),YR=h(10,e=>JR(e,(e.j??e.h)||``)),XR=M(17,qR),ZR=h(16,e=>XR(e,uz(e))),QR=M(15,ZR),$R=h(14,e=>QR(e,dz(e)),2),ez=o(7,e=>{YR(e),$R(e)}),tz=h(6,e=>ez(e,e.e,e.f)),nz=M(4,tz),rz=M(5,tz),iz=m(9,e=>{YR(e),$R(e)}),az=(e,t)=>cz(e,t.timer),oz=_(`l3`,e=>{E(e,`b`),u(e.b,`keydown`,function(t){t.key===`Enter`&&e.p(),t.key===`Escape`&&e.l&&(t.preventDefault(),e.r(``))})});function sz(e){b(e.a,`_jJ`),b(e.b,WR),iz(e,null),az(e,{timer:0}),oz(e)}var cz=M(13,e=>{$R(e),ZR(e)}),lz=e=>function(t){e.r(t)},uz=e=>t=>{if(e.n&&clearTimeout(e.n),!t){e.n=0,iz(e,null),ez(e,``);return}iz(e,t),e.n=setTimeout(e.p,150)},dz=e=>()=>{e.n&&=(clearTimeout(e.n),0);let t=e.j===null?e.h||``:e.j;iz(e,null),ez(e,t)};N(`l0`,lz),N(`l2`,uz),N(`l1`,dz);var fz=(e=>`<div><div title="Drag to resize"></div><div>${e}</div><div></div></div>`)(GR),pz=(e=>` D b D/${e}&l l`)(KR),mz={A:`added`,D:`deleted`,M:`modified`,R:`renamed`},hz=h(7,e=>{T(e.a,`aria-expanded`,e._._.t.has(e._.f)?`false`:`true`),b(e.b,[`_i6`,{_i7:!e._._.t.has(e._.f)}])}),gz=j(29,hz,e=>e._._),_z=_(`z4`,e=>u(e.a,`click`,function(){let t=new Set(e._._.t);t.delete(e._.f)||t.add(e._.f),Iz(e._._,t)})),vz=e=>{gz(e),yz._(e),bz._(e),xz._(e),b(e.a,`_i5`),he(e.c),de(e.c,12),Ee(e.c),b(e.d,`_i8`),b(e.f,`_i9`),_z(e)},yz=f(1,0,hz),bz=f(1,0,e=>{T(e.a,`title`,e._.h),c(e.e,e._.h)}),xz=f(1,0,e=>c(e.g,e._.j)),Sz=d(1,(e=>`<button type=button><span aria-hidden=true>${e}</span><span> </span><span> </span></button>`)(ye),(e=>` D D/${e}&l D l D m`)(Oe),vz),Cz=g(4,e=>{b(e.a,[`_i4`,{_i3:e._.m===1}]),b(e.c,[`_ja`,{_i_:e._.m===1}]),Sz(e,e._.m>1?0:1)}),wz=e=>{Cz._(e),Ez._(e)},Tz=h(6,e=>T(e.c,`hidden`,e._.t.has(e.f))),Ez=g(4,Tz),Dz=M(5,e=>{T(e.a,`data-section`,e.f),T(e.c,`data-tree`,e.f),Tz(e),yz(e)}),Oz=(e,t)=>{Dz(e,t[0]?.id),kz(e,t[0]?.label),Az(e,t[0]?.files?.length)},kz=M(7,bz),Az=M(9,xz),jz=o(17,e=>nz(e.d,e.r)),Mz=h(9,e=>jz(e,e.h,e.i)),Nz=M(7,Mz),Pz=M(8,Mz),Fz=y(gz),Iz=m(19,e=>{Ez(e),Fz(e)}),Lz=M(27),Rz=h(24,e=>Lz(e,nB(e))),zz=m(20,e=>{w(e.a,e.u==null?void 0:`--tree-w:${e.u}px`),Rz(e)}),Bz=m(21,e=>b(e.b,[`_jc`,{_jb:e.v}])),Vz=(e,t)=>Kz(e,t.id),Hz=_(`z6`,e=>{u(e.b,`pointerdown`,function(t){e.z(t)}),u(e.b,`pointermove`,function(t){e.a0(t)}),u(e.b,`pointerup`,function(t){e.a1(t)}),u(e.b,`pointercancel`,function(t){e.a1(t)})});function Uz(e){b(e.c,`_i1`),sz(e.d),rz(e.d,rB(e)),b(e.e,`_i2`),Iz(e,new Set),zz(e,vt()),Bz(e,!1),Vz(e,{id:-1}),Hz(e)}var Wz=M(25),Gz=M(26),Kz=M(23,e=>{Wz(e,iB(e)),Gz(e,aB(e)),Rz(e)}),qz=(e,t)=>b(e.a,[`_i0`,{_iZ:t===!1}]),Jz=a(4,`<div><!><div></div></div>`,` D%b `,wz,Oz),Yz=_(`z5`,e=>l(e,{sections:e.l,commentCounts:e.n,newKeys:e.o,onMount:function(){let t=(e,t)=>`${e.id}/${t}`,n=e=>e.files.map(e=>({path:e.path,status:mz[e.status]??`modified`})),r=e=>e.files.map(e=>`${e.path}:${e.status}`).join(`
|
|
2798
|
+
`),i=(e,t)=>[...e].map(([e,t])=>`${e}=${t}`).sort().join(`,`)+`|`+[...t].sort().join(`,`),a=new Map,o=t=>e.a.querySelector(`[data-tree="${CSS.escape(t)}"]`),s=i=>{let s=o(i.id);if(!s)return;let c=new UR({paths:i.files.map(e=>e.path),gitStatus:n(i),initialExpansion:`open`,flattenEmptyDirectories:!0,search:!1,onSelectionChange(n){if(n.length===1){let r=t(i,n[0]);queueMicrotask(()=>e.p(r))}},renderRowDecoration({row:n}){if(n.kind!==`file`)return null;let r=t(i,n.path),a=e.n.has(r),o=e.o.has(r);if(!a&&!o)return null;let s=[];return o&&s.push({text:`●`,color:`var(--accent)`}),a&&s.push({text:`${o?` `:``}✎ ${e.n.get(r)??``}`.trimEnd(),color:`var(--dim)`}),{text:s.map(e=>e.text).join(``),parts:s,title:[o&&`Changed since your last visit`,a&&`Has review comments`].filter(Boolean).join(` · `)}}});c.render({containerWrapper:s});let l=()=>{if(e.l.length===1){s.style.flexBasis=``;return}let t=c.getVisibleCount()*c.getItemHeight();s.style.flexBasis=`${t}px`};l();let u=c.subscribe(l);a.set(i.id,{tree:c,sig:r(i),unsub:u})};for(let t of e.l)s(t);return{trees:a,build:s,sig:r,gitStatus:n,marks:i,shownMarks:i(e.n,e.o)}},onUpdate:function(){let e=this.marks(this.commentCounts,this.newKeys),t=e!==this.shownMarks;this.shownMarks=e;let n=new Set(this.sections.map(e=>e.id));for(let[e,t]of this.trees)n.has(e)||(t.unsub(),t.tree.cleanUp(),this.trees.delete(e));for(let e of this.sections){let n=this.trees.get(e.id);if(!n){this.build(e);continue}let r=this.sig(e);r===n.sig?t&&n.tree.setGitStatus(this.gitStatus(e)):(n.sig=r,n.tree.resetPaths(e.files.map(e=>e.path)),n.tree.setGitStatus(this.gitStatus(e)))}},onDestroy:function(){for(let e of this.trees.values())e.unsub(),e.tree.cleanUp()}})),Xz=h(16,Yz,3),Zz=M(11,e=>{tB(e,e.l?.length),Jz(e,[e.l,`id`]),Xz(e)}),Qz=M(13,Xz),$z=M(14,Xz),eB=M(15,Xz),tB=M(12,Cz),nB=e=>t=>{t.pointerId===e.x&&(e.x=-1,Bz(e,!1),e.u!=null&&Je(e.u))},rB=e=>t=>{jz(e,t)},iB=e=>t=>{(t.pointerType!==`mouse`||t.button===0)&&(t.preventDefault(),e.x=t.pointerId,Bz(e,!0),e.b.setPointerCapture(t.pointerId))},aB=e=>t=>{if(t.pointerId!==e.x)return;let n=window.innerWidth-t.clientX;zz(e,Math.min(640,Math.max(200,n)))};N(`z2`,nB),N(`z3`,rB),N(`z0`,iB),N(`z1`,aB);var oB=`_jo _ba`,sB=`<!><!><!>`,cB=e=>b(e.a,`_jr`),lB=e=>{VS(e.a),HS(e.a,12),US(e.a,`_jt`)},uB=e=>b(e.a,[`_A`,`_js`]),dB=f(1,0,e=>{T(e.a,`title`,e._.f),c(e.b,e._.f)}),fB=e=>{dB._(e),b(e.a,oB)},pB=d(6,zS,(e=>`/${e}&`)(BS),lB),mB=h(11,e=>pB(e,+!e._._._._.w.has(e.k))),hB=j(29,mB,e=>e._._._._),gB=_(`i2`,e=>u(e.a,`click`,function(){JB(e._._._._,!1)})),_B=e=>{hB(e),bB(e),SB(e),b(e.a,[`_jn`,`_y`]),b(e.b,`__`),b(e.d,`_jp`),gB(e)},vB=d(5,`<span title="Changed since your last visit"></span>`,` `,uB),yB=h(12,e=>vB(e,+!e._._._._.x.has(e.k))),bB=j(30,yB,e=>e._._._._),xB=h(13,e=>T(e.a,`href`,e._._._._.z(e.k))),SB=j(32,xB,e=>e._._._._),CB=M(10,e=>{xB(e),yB(e),mB(e)}),wB=(e,t)=>{T(e.b,`data-status`,t),c(e.c,t)},TB=(e,t)=>c(e.e,t),EB=(e,t)=>{CB(e,(t?.[0]).file?.key),wB(e,(t?.[0]).file?.status),TB(e,(t?.[0]).name)},DB=e=>b(e.a,`_jm`),OB=d(1,`<div><bdi><!>/</bdi></div>`,` E%`,fB),kB=M(5,e=>{OB(e,+!e.f),dB(e)}),AB=a(2,`<a><span> </span><span><bdi> </bdi></span><!><!></a>`,` D D l E m%b%`,_B,EB),jB=(e,t)=>AB(e,[t,e=>e.file.key]),MB=(e,t)=>{kB(e,(t?.[0]).dir),jB(e,(t?.[0]).files)},NB=e=>{b(e.a,`_jk`),b(e.b,`_jl`)},PB=(e,t)=>c(e.c,t),FB=a(3,`<div><!><!></div>`,` D%b%`,DB,MB),IB=(e,t)=>FB(e,[t,`dir`]),LB=(e,t)=>{PB(e,t[0]?.repo),IB(e,t[0]?.dirs)},RB=d(13,`<p>No files match.</p>`,` `,cB),zB=h(14,e=>c(e.g,e._.n===e._.y?``:` / ${e._.y}`)),BB=f(0,0,e=>{c(e.f,e._.n),RB(e,+!!e._.n),zB(e)}),VB=_(`i3`,e=>{u(e.a,`click`,function(){JB(e._,!1)}),u(e.h,`click`,function(){JB(e._,!1)})}),HB=e=>{BB._(e),UB._(e),WB._(e),KB._(e),b(e.a,`_jf`),b(e.b,`_jg`),b(e.c,`_jh`),b(e.d,`_je`),b(e.e,`_ji`),b(e.h,[zt,`_jd`]),oe(e.i),je(e.i,16),Ft(e.i),b(e.j,`_jq`),sz(e.k),rz(e.k,gV(e)),b(e.l,`_jj`),VB(e)},UB=f(0,0,e=>nz(e.k,e._.u)),WB=f(0,0,zB),GB=a(12,`<div><div> </div><!></div>`,` D D l%`,NB,LB),KB=f(0,0,e=>GB(e,[e._.a0,`repo`])),qB=d(0,((e,t)=>`<div></div><div role=dialog aria-label="Jump to file"><div><strong>Files</strong><span><!><!></span><button type=button title=Close aria-label=Close>${e}</button></div><div>${t}</div><div><!><!></div></div>`)(Nt,GR),((e,t)=>` b D D b D%b%l D/${e}&m D/${t}&l D%b%m`)(Ne,KR),HB),JB=o(18,e=>qB(e,+!e.s)),YB=h(5,e=>JB(e,e.d,e.e)),XB=M(3,YB),ZB=M(4,YB),QB=o(20,UB),$B=h(8,e=>QB(e,e.g,e.h)),eV=M(6,$B),tV=M(7,$B),nV=M(22,y(hB)),rV=(e,t)=>nV(e,t||new Set),iV=M(23,y(bB)),aV=(e,t)=>iV(e,t||new Set),oV=M(24,WB),sV=h(14,e=>oV(e,e.l??e.n)),cV=M(11,sV),lV=M(13,e=>{sV(e),BB(e)}),uV=M(25,y(SB)),dV=h(17,e=>uV(e,_V(e))),fV=M(15,dV),pV=M(16,dV),mV=M(26,KB),hV=(e,t)=>{lV(e,t?.length),mV(e,(()=>{let e=[],n=new Map;for(let r of t){let t=r.key.slice(0,r.key.indexOf(`/`)).replace(`#`,` #`),i=r.label.slice(r.label.indexOf(`/`)+1),a=i.lastIndexOf(`/`),o=a<0?``:i.slice(0,a),s=a<0?i:i.slice(a+1),c=n.get(t);c||(n.set(t,c=new Map),e.push({repo:t,dirs:[]}));let l=c.get(o);l||(c.set(o,l={dir:o,files:[]}),e[e.length-1].dirs.push(l)),l.files.push({file:r,name:s})}return e})())},gV=e=>t=>{QB(e._,t)},_V=e=>t=>De({workspaceId:e.p,view:`diff`,scope:e.q??null,file:t});N(`i1`,gV),N(`i0`,_V);var vV=((e,t,n,r,i,a)=>`<div><div><div><div><div><!><h1>Review</h1><!></div><div><!><button title="Refresh diff">${e}</button><!><span><button aria-label=Compare>${t}</button><select aria-label=Compare tabindex=-1><option value=committed>Committed</option><option value=working>Working tree</option><option value=dirty>Uncommitted</option><!></select></span> <div>${n}</div><!></div><!>${r}</div><div><!><!><!><!></div></div><div data-diff-main></div></div>${i}${a}</div>`)(yt,pt,lw,xD,fz,sB),yV=((e,t,n,r,i,a)=>` D D D D D%b b%l D%b D/${e}&l%b D D/${t}&l Dd%mb D0${n}&l%l%b/${r}&l D%b%b%b%m l/${i}&/${a}&l`)(it,I,uw,`b%c`,pz,`b%c`);function bV(e){return e.split(`
|
|
2799
2799
|
`).filter(e=>e[0]===`+`||e[0]===`-`).join(`
|
|
2800
|
-
`)}var fV=p(0,`<div><div></div><div></div></div>`,` D b `,e=>{b(e.a,`_gE`),b(e.b,[`_gD`,`_gF`]),b(e.c,[`_gD`,`_gG`])}),pV=e=>{b(e.a,`_gC`),fV(e,[2,0,1])},mV=e=>{b(e.a,`_gH`),b(e.b,[`_gD`,`_gI`]),b(e.c,[`_gD`,`_gJ`])},hV=(e,t)=>T(e.a,`value`,`rev:${t}`),gV=(e,t)=>c(e.b,t),_V=a(0,`<option> </option>`,` D `,0,(e,t)=>{hV(e,t[0]?.sha),gV(e,t[0]?.label)}),vV=f(17,0,e=>_V(e,[e._.dd,`sha`])),yV=vV,bV=f(21,0,e=>T(e.a,`hidden`,e._.bb)),xV=_(`A43`,e=>u(e.a,`click`,function(){e._.e8()})),SV=e=>{bV._(e),b(e.a,[ie,`_gv`,`_gn`]),ve(e.b),fe(e.b,14),Ie(e.b),xV(e)},CV=f(12,0,e=>{T(e.a,`title`,`Jump to file (${e._.d4})`),T(e.a,`aria-label`,`Jump to file (${e._.d4} files)`),c(e.e,e._.d4>99?`99+`:e._.d4)}),wV=_(`A41`,e=>u(e.a,`click`,function(){RU(e._,!0)})),TV=e=>{CV._(e),b(e.a,[ie,`_gn`,`_gK`]),b(e.b,`_gL`),VC(e.c),HC(e.c,20),UC(e.c,`_gM`),b(e.d,`_gN`),wV(e)},EV=f(9,0,e=>{b(e.a,[OS,`_gn`,{_gm:e._.b9}]),T(e.a,`title`,e._.b9?`Hide file tree`:`Show file tree`)}),DV=_(`A40`,e=>u(e.a,`click`,function(){LU(e._,!e._.b9),Dt(e._.b9)})),OV=e=>{EV._(e),le(e.b),Me(e.b,14),jt(e.b),DV(e)},kV=h(2,e=>c(e.b,e._.b8?`This commit is not in any of these repos.`:e._.co.some(e=>e.unborn)?`No commits yet.`:e._.b7===`dirty`?`Nothing uncommitted.`:e._.co.some(e=>e.pr)?`No file changes on these PRs.`:`No changes vs base.`),2),AV=f(28,0,kV),jV=e=>{AV._(e),MV._(e),NV._(e),b(e.a,`_cp`)},MV=f(28,0,kV),NV=f(28,0,kV),PV=j(194,e=>c(e.b,e._._.b7===`committed`?``:`, showing uncommitted changes only`),e=>e._._),FV=e=>{PV(e),IV(e)},IV=j(5,e=>c(e.a,e._.e)),LV=x(`A45`,`<!><!>.`,`%b%`,FV),RV=e=>{Be(e.a),Ye(e.a,LV(e)),L(e.a,`warn`),nt(e.a,`inline`),Ot(e.a),mt(e.a),et(e.a),$e(e.a,{})},zV=(e,t)=>Lt(e.a,`${t}: base not found`),BV=(e,t)=>{zV(e,t[0]?.worktree),VV(e,t[0]?.base)},VV=M(4,y(IV)),HV=h(2,e=>c(e.b,e._.bi.trim()?`No matches in review.`:e._.b6&&!e._.b3?`Nothing changed since your last visit.`:`No files match "${e._.b3}".`),2),UV=f(28,1,HV),WV=e=>{UV._(e),GV._(e),KV._(e),b(e.a,`_cp`)},GV=f(28,1,HV),KV=f(28,1,HV),qV=j(191,e=>c(e.a,e._._.b0),e=>e._._),JV=x(`A44`,` `,` `,qV),YV=e=>{Be(e.a),Ye(e.a,JV(e)),et(e.a,pG(e)),Ot(e.a),mt(e.a),L(e.a),nt(e.a),Lt(e.a),$e(e.a,{})},XV=f(7,0,e=>DC(e.b,e._.ar)),ZV=e=>{XV._(e),QV._(e),$V._(e),eH._(e),b(e.a,`_gt`),CC(e.b)},QV=f(7,0,e=>PC(e.b,e._.ay)),$V=f(7,0,e=>IC(e.b,e._.e4)),eH=f(7,0,e=>FC(e.b,e._.e5)),tH=f(5,0,e=>T(e.a,`href`,`/w/${e._.a8}`)),nH=e=>{tH._(e),b(e.a,[ie,`_gs`]),ze(e.b),Le(e.b,14),Re(e.b)},rH=r(`A39`,181),iH=(e,t)=>ZO(e.x,t),aH=_(`A46`,e=>l(e,{active:e.ak,load:e.ca,findOpen:e.bb,shownFiles:e.d2,commentsByFile:e.d6,draft:e.az,sessions:e.ar,collapsedFiles:e.bm,repos:e.au,onMount:function(){let t=new AbortController,n=()=>e.ar||[],r=(t,n=!0)=>{let r=e.a3,i=t.getBoundingClientRect();if(!i.height)return;let a=r.getBoundingClientRect(),o=getComputedStyle(t),s=i.top-(parseFloat(o.scrollMarginTop)||0),c=i.bottom+(parseFloat(o.scrollMarginBottom)||0),l=0;s<a.top?l=s-a.top:c>a.bottom&&(l=c-a.bottom),l&&r.scrollTo({top:Math.max(0,r.scrollTop+l),behavior:n?`smooth`:`auto`})},i=new WeakMap,a=async(t,n,r)=>{if(!r)return``;let i=new URLSearchParams({worktree:t,path:n,rev:r});return(await Mt(`/api/workspaces/${e.a8}/diff/contents?${i}`)).contents},o={viewer:null},s={key:null,top:null},c=new Map,l,u={draft:!0},d,f=(e,t,n)=>{let r=[];for(let e of t){let t=c.get(e.id);(!t||t.comment.text!==e.text)&&(t={comment:e}),c.set(e.id,t),r.push({side:e.side,lineNumber:e.line_end,metadata:t})}return n&&n.key===e&&(l!==n&&(l=n,u={draft:!0},d=void 0),r.push({side:n.side===`deletions`?`deletions`:`additions`,lineNumber:n.end,metadata:u})),r},p=(e,t,n)=>e.map(e=>`${e.id}:${e.text.length}`).join(`,`)+(t&&t.key===n?`|d${t.side}${t.start}-${t.end}`:``),m=(t,n)=>{if(!t)return;let r=t.endSide!=null&&t.endSide!==t.side;AU(e,{key:n,side:t.side||`additions`,start:Math.min(t.start,r?t.start:t.end),end:Math.max(t.start,r?t.start:t.end)})},h={theme:{dark:`pierre-dark`,light:`pierre-light`},themeType:St(),diffStyle:gt()?`unified`:`split`,stickyHeaders:!0,itemMetrics:{diffHeaderHeight:44},enableLineSelection:!0,layout:{paddingTop:0,paddingBottom:24,gap:12},unsafeCSS:` @media (pointer: coarse) { pre[data-diff] { touch-action: pan-x pan-y; } [data-column-number], [data-gutter-utility-slot] { touch-action: none !important; } }`+cS,async loadDiffFiles(t){let n=i.get(t),r=(e.au||[]).find(e=>e.id===n?.repo);if(!n||!r)throw Error(`unknown file`);let[o,s]=await Promise.all([t.type===`new`?Promise.resolve(``):a(n.worktree,t.prevName||n.path,r.oldRev),t.type===`deleted`?Promise.resolve(``):a(n.worktree,n.path,r.newRev)]);if(o==null||s==null)throw NU(e,`${n.path} is too large to expand.`),Error(`diff contents unavailable`);if(t.type!==`new`&&!yx(t,`deletions`,o)||t.type!==`deleted`&&!yx(t,`additions`,s))throw NU(e,`${n.path} has changed since this diff was taken — refresh to expand it.`),Error(`diff contents out of date`);return{oldFile:{name:t.prevName||t.name,contents:o},newFile:{name:t.name,contents:s}}},renderCustomHeader(t,n){let r=n.item,i=e.dr(r.id),a=document.createElement(`div`);a.className=`_gQ${r.collapsed?` _gR`:``}`,a.title=r.id;let c=document.createElement(`span`);c.className=`_gS`,c.textContent=`▾`;let l=document.createElement(`span`);l.className=`__`;let u=i?.status||(r.type===`diff`?r.fileDiff.type[0].toUpperCase():`M`);l.dataset.status=u,l.textContent=u;let d=document.createElement(`span`);d.className=`_gT`;let f=document.createElement(`bdi`);if(f.textContent=r.id,d.append(f),a.append(c,l,d),i?.changedSince){let e=document.createElement(`span`);e.className=`_A _gX`,e.title=`Changed since your last visit`,a.append(e)}let p=e.d6.get(r.id)?.length||0;if(p){let e=document.createElement(`span`);e.className=`_u`,e.textContent=`✎ ${p}`,a.append(e)}if(i&&(i.additions||i.deletions)){let e=document.createElement(`span`);e.className=`_gU`;let t=document.createElement(`span`);t.className=`_gV`,t.textContent=`+${i.additions||0}`;let n=document.createElement(`span`);n.className=`_gW`,n.textContent=`−${i.deletions||0}`,e.append(t,n),a.append(e)}return a.onclick=()=>{s.key=r.id,s.top=o.viewer?.getTopForItem(r.id)??null;let t=new Set(e.bm);t.delete(r.id)||t.add(r.id),GU(e,t)},a},renderAnnotation(t,i){let a=t.metadata||{},o=i.item.id;if(a.draft)return d??=Jx({sessions:n,reveal:r},{onSave:t=>e.dt(o,t),onSend:(t,n)=>e.e7(o,t,n),onCancel:()=>{AU(e,null)}});let s=a.comment;if(!s)return;let c=i.item.type===`diff`?i.item.fileDiff:null,l=s.snippet!=null&&!!c&&dV(xx(c,s.side,s.line_start,s.line_end))!==dV(s.snippet);return qx(s,{sessions:n,reveal:r},{onDelete:t=>e.dw(t),onEdit:(t,n)=>e.dx(t,n),onSend:(t,n)=>e.e6(t,n),drifted:l})},onLineSelectionEnd(e,t){m(e,t.item.id)},onPostRender(e,t,n,r){let i=e;if(n===`unmount`){g.get(i)?.(),g.delete(i);return}g.has(i)?bS(i):g.set(i,yS(i,r.item.id))}},g=new Map,_=new Yb(h,Lx());o.viewer=_,_.setup(e.a3);let v=Ke(e=>{h.themeType=e,_.setOptions({...h})});_e()&&Bx(()=>e.a3,t.signal),e.bu.scrollToItem=t=>{y.recs.has(t)&&(e.c2=null,_.scrollTo({type:`item`,id:t,align:`start`,behavior:`instant`}))},e.bu.scrollToLine=(e,t,n)=>_.scrollTo({type:`line`,id:e,lineNumber:t,side:n||`additions`,align:`center`,behavior:`instant`}),e.bu.clearSelection=()=>_.clearSelectedLines();let y={abort:t,viewer:_,unregTheme:v,unsubScroll:_.subscribeToScroll(t=>{e.by||=requestAnimationFrame(()=>{e.by=0;let n=null;for(let r of _.getRenderedItems()){let i=_.getTopForItem(r.id);i==null||i>t+1||(!n||i>(_.getTopForItem(n.key)??-1))&&(n={scope:e.b7,key:r.id,off:Math.round(t-i)})}t>0&&(e.bw=n);let r=n?.key??_.getRenderedItems()[0]?.id,i=r&&e.dr(r)?.repo;i&&i!==e.bn&&KU(e,i)})}),hostUnregs:g,loaded:!1,wasActive:!1,lastNonce:e.as||0,lastFileNonce:e.at||0,recs:new Map,order:``,revealedDraft:null,dockedOpen:!1,start:()=>{this.active&&!y.loaded&&(y.loaded=!0,this.load())},pin:t=>{let n=e.a3,r=Date.now(),i=!1,a=()=>{i=!0};for(let e of[`wheel`,`touchstart`,`keydown`])n.addEventListener(e,a,{once:!0,passive:!0});let o=()=>{if(i||!y.recs.has(t.key))return;let e=y.viewer.getTopForItem(t.key);if(e!=null){let n=e+t.off;Math.abs(y.viewer.getScrollTop()-n)>1&&y.viewer.scrollTo({type:`position`,position:n,behavior:`instant`})}Date.now()-r<1500&&requestAnimationFrame(o)};o()},sync:()=>{let t=[],n=new Set,r=!1;for(let e of this.shownFiles){n.add(e.key);let a=y.recs.get(e.key),o=a&&a.patch===e.patch&&a.status===e.status?a.fileDiff:hx(e,e.key),s=this.commentsByFile.get(e.key)||[],c=p(s,this.draft,e.key),l=this.collapsedFiles.has(e.key);o&&i.set(o,{worktree:e.key.slice(0,e.key.indexOf(`/`)),path:e.path,repo:e.repo});let u={name:e.path,contents:e.binary?`(binary file)`:e.tooLarge?`(file too large to display)`:`(file could not be read)`},d=a;!d||d.item.type===`diff`!=!!o?(d={item:o?{id:e.key,type:`diff`,fileDiff:o,annotations:f(e.key,s,this.draft),collapsed:l,version:(d?.item.version??0)+1}:{id:e.key,type:`file`,file:u,collapsed:l,version:(d?.item.version??0)+1},fileDiff:o,annSig:c,collapsed:l,patch:e.patch,status:e.status},y.recs.set(e.key,d),r=!0):(d.fileDiff!==o||d.annSig!==c||d.collapsed!==l)&&(d.item.type===`diff`&&o?(d.item.fileDiff=o,d.item.annotations=f(e.key,s,this.draft)):d.item.type===`file`&&(d.item.file=u),d.item.collapsed=l,d.item.version=(d.item.version??0)+1,d.fileDiff=o,d.annSig=c,d.collapsed=l,d.patch=e.patch,d.status=e.status,r||y.viewer.updateItem(d.item)),t.push(d.item)}for(let e of[...y.recs.keys()])n.has(e)||y.recs.delete(e);let a=t.map(e=>e.id).join(`
|
|
2801
|
-
`);if((r||a!==
|
|
2802
|
-
`)),2),yH=M(154,e=>{AO(e.x,e.dk),vH(e)}),bH=h(153,e=>yH(e,e.cq.filter(e=>e.files.length||e.pr).map(t=>{let n=e.di(t);return{repo:t,files:n.files,additions:n.additions,deletions:n.deletions,fresh:n.fresh,hidden:t.files.length-n.files}}))),xH=M(152,bH),SH=(e,t)=>Hz(e.a4,t),CH=h(137,e=>SH(e,e.cq.map(t=>({id:t.id,label:t.worktree,worktree:t.worktree,files:e.d2.filter(e=>e.repo===t.id)})).filter(e=>e.files.length))),wH=M(136,e=>{oV(e.a5,e.d2),XW(e,e.d2?.length),CH(e),$(e)}),TH=h(133,e=>wH(e,e.cy.filter(t=>!e.bo.has(t.repo)))),EH=M(132,e=>{YW(e,e.cy?.length),xH(e,vG(e)),TH(e)}),DH=h(131,e=>EH(e,e.cw?e.cv.filter(t=>e.cw.has(t.key)||t.key===e.bl):e.cv),2),OH=M(129,e=>{hH(e,e.cv.map(e=>({...e,fileDiff:hx(e,e.key)}))),DH(e)}),kH=h(126,e=>OH(e,(()=>{let t=Rx(e.b3);return e.cr.filter(n=>t(n.key)&&(!e.b6||n.changedSince))})()),2),AH=M(125,e=>{JW(e,e.cr?.length),fH(e,new Set(e.cr.filter(e=>e.changedSince).map(e=>e.key))),mH(e,new Map(e.cr.map(e=>[e.key,e]))),kH(e)}),jH=M(124,e=>{AH(e,e.cq.flatMap(e=>e.files.map(t=>({...t,repo:e.id,key:`${e.worktree}/${t.path}`})))),CH(e),bH(e)}),MH=M(150,gH),NH=h(148,e=>MH(e,e.b8?e.dd.find(t=>t.sha===e.b8)?.label??Zx(e.b8,7):{committed:`Committed`,working:`Working tree`,dirty:`Uncommitted`}[e.b7]),2),PH=M(147,e=>{QW(e,e.dd?.length),NH(e),vV(e)}),FH=h(123,e=>{jH(e,e.b8?e.co.filter(e=>e.rev):e.co),PH(e,(()=>{let t=new Set,n=[];for(let r of e.co)for(let e of r.commits||[])t.has(e.sha)||(t.add(e.sha),n.push({sha:e.sha,label:`${r.worktree}#${Zx(e.sha,7)} ${e.subject}`}));return e.b8&&!t.has(e.b8)&&n.unshift({sha:e.b8,label:Zx(e.b8,7)}),n})())}),IH=M(122,e=>{iH(e,new Set(e.co.filter(e=>!!e.pr&&!!e.localHead&&(e.localHead!==e.head||e.branch!==e.pr.headRefName)).map(e=>e.id))),uH(e,gG(e)),dH(e,[e.co.filter(e=>e.baseMissing),`id`]),FH(e),NV(e)}),LH=M(104,$),RH=h(95,e=>LH(e,yG(e)),2),zH=M(113,e=>{QO(e.x,e.cf),$(e)}),BH=h(109,e=>zH(e,bG(e))),VH=M(114,$),HH=h(112,e=>VH(e,xG(e)),4),UH=h(120,e=>A(e,`q`,e.b8?`rev:${e.b8}`:e.b7,SG(e)),2),WH=M(119,UH),GH=h(118,e=>WH(e,t=>{if(t.startsWith(`rev:`)){e.cj(t.slice(4));return}let n=t;if(e.b8&&(gW(e,null),e.am?.(null),n===e.b7)){e.ca(e.b7);return}e.ci(n)}),5),KH=M(116,e=>{GH(e),$(e)}),qH=h(110,e=>KH(e,CG(e)),2),JH=M(117,e=>{GH(e),$(e)}),YH=h(111,e=>JH(e,wG(e)),3),XH=M(108,e=>{BH(e),HH(e),qH(e),YH(e),GH(e),$(e)}),ZH=h(107,e=>XH(e,TG(e)),10),QH=M(105,e=>{Gz(e.a4,EG(e)),ZH(e),$(e)}),$H=h(102,e=>QH(e,DG(e)),5),eU=M(106,e=>{ZH(e),$(e)}),tU=h(99,e=>eU(e,OG(e)),2),nU=M(121,$),rU=h(57,e=>nU(e,kG(e))),iU=d(9,(e=>`<button>${e}</button>`)(se),(e=>` D/${e}&l`)(we),OV),aU=d(12,(e=>`<button><span aria-hidden=true>${e}<span> </span></span></button>`)(zC),(e=>` D D/${e}& D n`)(BC),TV),oU=d(21,(e=>`<button title="Find in review (⌘/Ctrl+F)" aria-label="Find in review">${e}</button>`)(ht),(e=>` D/${e}&l`)(ge),SV),sU=h(146,e=>oU(e,e.db&&!e.bd?0:1)),cU=M(145,e=>{iU(e,+!e.db),aU(e,+!e.db),sU(e)}),lU=h(128,e=>cU(e,!e.au||e.ct>0)),uU=M(174,$V),dU=M(175,eH),fU=M(176,$),pU=h(172,e=>{uU(e,AG(e)),dU(e,jG(e)),fU(e,MG(e))}),mU=M(171,e=>{pU(e),lH(e)}),hU=h(170,e=>mU(e,NG(e)),4),gU=d(22,`<div aria-hidden=true><div></div><div></div></div>`,` D b `,mV),_U=d(27,`<div aria-hidden=true></div>`,` `,pV),vU=h(64,e=>{gU(e,!e.au&&e.b1?0:1),_U(e,!e.au&&e.b1?0:1)}),yU=d(28,`<p> </p>`,` D `,jV,`<p> </p>`,` D `,WV),bU=h(135,e=>yU(e,e.au&&!e.ct?0:e.au&&!e.d0&&!e.bk?1:2),3),xU=m(56,e=>{IH(e,e.au||[]),RH(e),$H(e),tU(e),rU(e),lU(e),hU(e),vU(e),bU(e),$(e)}),SU=(e,t)=>JB(e.a5,t),CU=(e,t)=>Uz(e.a4,t),wU=M(140,e=>{SU(e,new Set(e.d6.keys())),CU(e,new Map([...e.d6].map(([e,t])=>[e,t.length]))),$(e)}),TU=M(166,$),EU=h(165,e=>TU(e,PG(e))),DU=M(167,$),OU=h(59,e=>DU(e,FG(e))),kU=m(58,e=>{oW(e,e.aw?.length),wU(e,(()=>{let t=new Map;for(let n of e.aw){let e=`${n.worktree}/${n.path}`;t.set(e,[...t.get(e)||[],n])}return t})()),sH(e),EU(e),OU(e),hU(e),pU(e)}),AU=m(61,e=>{sH(e),lH(e),$(e)}),jU=d(25,At,(e=>`/${e}&`)(Ue),YV),MU=y(qV),NU=m(62,e=>{jU(e,+!e.b0),MU(e)}),PU=m(63,e=>{T(e.k,`disabled`,e.b1),Ze(e.l,e.b1&&`_F`),T(e.o,`disabled`,e.b1),T(e.q,`disabled`,e.b1),$O(e.x,e.b1),HH(e),vU(e),$(e)}),FU=(e,t)=>{Dz(e.a4,t),KB(e.a5,t)},IU=m(68,e=>{KO(e.x,e.b6),ZH(e),kH(e),GV(e)}),LU=m(71,e=>{Bz(e.a4,e.b9),EV(e)}),RU=m(72,e=>VB(e.a5,e.ba)),zU=_(`A50`,e=>{e.bd&&!e.bb&&vW(e,!0)}),BU=h(76,zU),VU=M(75,e=>{Kw(e.t,e.bd),Jw(e.t,!e.bd),BU(e),sU(e)}),HU=M(130,DH),UU=e=>{HU(e,e.bi.trim()?new Set(e.bj):null)},WU=m(79,e=>{kW(e,e.bh?.query),AW(e,e.bh?.keys),jW(e,e.bh?.hit),UU(e)}),GU=m(84,$),KU=m(85,e=>{jO(e.x,e.bn),$(e)}),qU=m(86,e=>{UO(e.x,e.bo),$H(e),TH(e)}),JU=(e,t)=>{NW(e,t.sig),PW(e,t.timer)},YU=(e,t)=>FW(e,t.seq),XU=(e,t)=>Tw(e.t,function(e){t(e)}),ZU=M(92,e=>{XU(e,t=>{if(WU(e,t),!t.hit)return;let n=t.hit;setTimeout(()=>{n.line<1?e.bu.scrollToItem(n.key):e.bu.scrollToLine(n.key,n.line,n.side)},0)}),$H(e),tU(e),$(e)}),QU=(e,t)=>{IW(e,t.anchor),LW(e,t.raf)},$U=(e,t)=>{BW(e,t.pos),VW(e,t.jump)},eW=M(158,e=>{sH(e),lH(e)}),tW=(e,t)=>tG(e,t.busy),nW=(e,t)=>{cG(e,t.home),lG(e,t.raf)},rW=_(`A48`,e=>{u(e.k,`click`,function(){e.cf()}),u(e.o,`click`,function(){let t=e.q;typeof t.showPicker==`function`?t.showPicker():t.focus()}),C(e,`q`)});function iW(e){v(e,19,aG),b(e.a,`_gl`),b(e.b,`_gq`),b(e.c,`_gZ`),b(e.d,`_gr`),b(e.e,`_gy`),b(e.g,kS),b(e.i,[`_gp`,`_gY`]),b(e.k,[ie,`_gn`]),dt(e.l),Tt(e.l,14),b(e.n,`_gz`),Qe(e.p),qe(e.p,14),Et(e.p),b(e.q,`_gA`),Lw(e.t),fw(e.t,GG(e)),bw(e.t),xw(e.t),ww(e.t),HO(e.x),GO(e.x,WG(e)),qO(e.x,UG(e)),JO(e.x,HG(e)),b(e.y,`_gO`),b(e.a3,`_gP`),Iz(e.a4),e.a5,HB(e.a5,VG(e)),i(e,rH(e)),xU(e,null),kU(e,[]),AU(e,null),NU(e,null),PU(e,!1),FU(e,IG(e)),IU(e,!1),LU(e,ut()),RU(e,!1),VU(e,!gt()),WU(e,{query:``,hit:null,keys:[]}),GU(e,new Set),KU(e,null),qU(e,new Set),JU(e,{sig:``,timer:0}),YU(e,{seq:0}),ZU(e,{scrollToItem:zG,scrollToLine:RG,clearSelection:LG}),QU(e,{anchor:null,raf:0}),$U(e,{pos:null,jump:null}),eW(e,BG),tW(e,{busy:0}),nW(e,{home:null,raf:0}),rW(e)}var aW=d(7,(e=>`<span>${e}</span>`)(FS),(e=>` D/${e}&l`)(IS),ZV),oW=M(60,e=>{aW(e,+!e.ay),QV(e)}),sW=_(`A47`,e=>{e.b3!==ee(e.a8)&&xt(e.a8,e.b3)}),cW=h(66,sW),lW=m(65,e=>{Ez(e.a4,e.b3),GB(e.a5,e.b3),kH(e),cW(e),UV(e)}),uW=M(115,$),dW=M(164,e=>{EU(e),hU(e)}),fW=M(34,e=>{rV(e.a5,e.a8),lW(e,ee(e.a8)),uW(e,KG(e)),dW(e,qG(e)),RH(e),ZH(e),rU(e),sH(e),OU(e),lH(e),cW(e),$(e),tH(e)}),pW=y(PV),mW=m(69,e=>{iV(e.a5,e.b7),ZH(e),BH(e),HH(e),qH(e),YH(e),GH(e),NH(e),UH(e),$(e),pW(e),AV(e)}),hW=M(35,e=>{mW(e,e.a9??wt()),$(e)}),gW=m(70,e=>{b(e.o,[ie,`_gn`,{_gm:!!e.b8}]),ZH(e),YH(e),GH(e),FH(e),NH(e),UH(e),$(e),MV(e)}),_W=M(36,e=>{gW(e,e.aa??null),$(e)}),vW=o(73,e=>{b(e.s,[`_gx`,{_gw:!e.bb}]),dw(e.t,e.bb),BU(e),$(e),bV(e)}),yW=h(39,e=>vW(e,e.ab,e.ac)),bW=M(37,yW),xW=M(38,yW),SW=_(`A49`,e=>{e.ak&&window.addEventListener(`keydown`,t=>{!(t.metaKey||t.ctrlKey)||t.altKey||t.shiftKey||t.key.toLowerCase()===`f`&&(t.target instanceof HTMLTextAreaElement||(t.preventDefault(),e.e8()))},{capture:!0,signal:D(e,0)})}),CW=h(179,e=>{O(e,0),SW(e)}),wW=M(178,CW),TW=o(77,e=>{qw(e.t,e.bf),wW(e,JG(e))}),EW=h(42,e=>TW(e,e.ae,e.af)),DW=M(40,EW),OW=M(41,EW),kW=M(80,KV),AW=M(81),jW=M(82,e=>{MW(e,e.bk?.key),bU(e)}),MW=M(83,DH),NW=M(88,e=>{ZH(e),$(e)}),PW=M(89,e=>{HH(e),$(e)}),FW=M(91,ZH),IW=M(94,e=>{RH(e),$(e)}),LW=M(96,$),RW=M(103,ZH),zW=h(101,e=>WO(e.x,XG(e))),BW=M(98,e=>{RW(e,YG(e)),$H(e),tU(e),zW(e),$(e)}),VW=M(100,e=>{$H(e),zW(e),$(e)}),HW=M(43,$H),UW=M(44,e=>{ZH(e),$(e)}),WW=M(45,e=>{ZH(e),$(e)}),GW=M(46,e=>{HH(e),CW(e),$(e)}),KW=M(47,qH),qW=M(48,e=>{YH(e),GH(e)}),JW=M(127,e=>{$B(e.a5,e.ct),lU(e),bU(e)}),YW=M(134,bU),XW=M(138,CV),ZW=d(17,`<optgroup label=Commits></optgroup>`,` `,yV),QW=(e,t)=>ZW(e,+!t),$W=M(49,e=>{YO(e.x,e.an||``),vH(e)}),eG=M(50,e=>{XO(e.x,e.ao||``),vH(e)}),tG=M(169,hU),nG=M(51,hU),rG=d(5,(e=>`<a title="Back to terminal (⌘/Ctrl+Shift+D)">${e}</a>`)(F),(e=>` D/${e}&l`)(P),nH),iG=(e,t)=>rG(e,+!t),aG=s(`A42`,M(181)),oG=M(186,$),sG=h(185,e=>oG(e,ZG(e))),cG=M(183,sG),lG=M(184,sG),uG=M(53,e=>{$(e),XV(e)}),dG=M(54,$),fG=M(55,$),pG=e=>function(){NU(e._,null)},mG=e=>async(t,n)=>{let r=e.az,i=e.dr(t);if(AU(e,null),!(!r||!i))try{let t=await Mt(`/api/workspaces/${e.a8}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`comment`,worktree:e.do(i.repo),path:i.path,side:r.side,line_start:r.start,line_end:r.end,text:n.trim(),...e.dp(i,r)})});kU(e,e.aw.concat(t))}catch(t){NU(e,String(t.message||t))}},hG=e=>(t,n,r)=>{let i=e.az,a=e.dr(t),o=n.trim();if(!i||!a||!o)return Promise.resolve(!1);let s={id:-1,workspace_id:e.a8,worktree:e.do(a.repo),path:a.path,side:i.side===`deletions`?`deletions`:`additions`,line_start:i.start,line_end:i.end,text:o,created_at:``,...e.dp(a,i)};return e.e1([s],{session:r},[])},gG=e=>(t,n)=>{let r=e.co.find(e=>e.id===t.repo),i=hx(t,t.key),a=n.side===`deletions`?`deletions`:`additions`;return{head:r?.head,snippet:i?xx(i,a,n.start,n.end):void 0}},_G=e=>t=>e.dq.get(t),vG=e=>t=>{let n=0,r=0,i=0,a=0;for(let a of e.cy)a.repo===t.id&&(i++,n+=a.additions||0,r+=a.deletions||0);for(let e of t.files)e.changedSince&&a++;return{additions:n,deletions:r,files:i,fresh:a}},yG=e=>()=>{e.au&&Ge(e.a8,e.bw)},bG=e=>()=>e.ca(e.b7,!0),xG=e=>()=>{e.br&&clearTimeout(e.br),e.br=setTimeout(()=>{e.br=0,e.ak&&!e.b1&&e.ca(e.b7,!0)},400)},SG=e=>function(t){e.cl(t)},CG=e=>(t,n=!0)=>{t!==e.b7&&(mW(e,t),n&&ct(t),e.al?.(t),e.ca(t))},wG=e=>t=>{t!==e.b8&&(gW(e,t),e.am?.(t),e.ca(e.b7))},TG=e=>async(t=e.b7,n=!1)=>{let r=++e.bt;PU(e,!0),NU(e,null);try{let i=new URLSearchParams;t!==`committed`&&i.set(`scope`,t),n&&i.set(`refresh`,`1`),e.b8&&i.set(`rev`,e.b8);let a=await Mt(`/api/workspaces/${e.a8}/diff?${i}`);if(r!==e.bt)return;let o=a.sections,s=a;if(xU(e,o),e.b6&&!o.some(e=>e.files.some(e=>e.changedSince))&&IU(e,!1),kU(e,s.comments||[]),e.bq=fx(o),e.ai&&e.c8(e.ai),e.aj)e.c7(e.aj);else if(!e.ai&&!n&&e.bt===1){let n=Xe(e.a8);n&&n.scope===t&&e.c5(n)}}catch(t){if(r!==e.bt)return;NU(e,String(t.message||t))}finally{r===e.bt&&PU(e,!1)}},EG=e=>function(t){e.c7(t)},DG=e=>t=>{let n=t.slice(0,t.indexOf(`/`)),r=[...e.bo].find(t=>(e.au||[]).find(e=>e.id===t)?.worktree===n);if(r){let t=new Set(e.bo);t.delete(r),qU(e,t)}e.c0=null,e.c2=t,e.ah?.(t),e.bu.scrollToItem(t)},OG=e=>t=>{let n=(e.au||[]).find(e=>e.pr&&`${e.worktree}/${e.pr.number}`===t),r=n?.files[0];n&&r&&(e.c0=null,e.bu.scrollToItem(`${n.worktree}/${r.path}`))},kG=e=>()=>{if(!e.au)return;let t={},n={};for(let r of e.au){t[r.id]=r.head;for(let e of r.files)e.hash&&(n[`${r.worktree}/${e.path}`]=e.hash)}fetch(`/api/workspaces/${e.a8}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`seen`,heads:t,dirty:n}),keepalive:!0}).catch(()=>{})},AG=e=>()=>e.e1(e.aw,{clipboard:!0},`all`),jG=e=>t=>e.e1(e.aw,{session:t},`all`),MG=e=>(t,n)=>{let r=e.aw.find(e=>e.id===t);return r?e.e1([r],{session:n},[t]):Promise.resolve(!1)},NG=e=>async(t,n,r)=>{if(!t.length)return!0;e.dz++;try{let i=Yx(t,e.au);if(`clipboard`in n){if(!await ae(i))return NU(e,`Copy failed: the clipboard needs HTTPS in this browser.`),!1}else await Mt(`/api/sessions/${n.session}/send`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({text:`Please address this review feedback, then summarize what you changed.\n\n${i}`,...We()||{}})}),e.ap?.(n.session);if(AU(e,null),r===`all`)kU(e,[]);else{let t=new Set(r);kU(e,e.aw.filter(e=>!t.has(e.id)))}return(r===`all`||r.length)&&await e.du(r).catch(()=>{}),!0}catch(t){return NU(e,String(t.message||t)),!1}finally{e.dz--}},PG=e=>async t=>{kU(e,e.aw.filter(e=>e.id!==t)),await e.du([t]).catch(()=>{})},FG=e=>async(t,n)=>{let r=e.aw.find(e=>e.id===t);if(!r)return;let i=n.trim();if(!(!i||i===r.text)){kU(e,e.aw.map(e=>e.id===t?{...e,text:i}:e));try{await Mt(`/api/workspaces/${e.a8}/review/${t}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({text:i})})}catch(n){throw kU(e,e.aw.map(e=>e.id===t?r:e)),NU(e,String(n.message||n)),n}}},IG=e=>t=>{lW(e,t)};function LG(){}function RG(e,t,n){}function zG(e){}function BG(e){return e.includes(`#`)?e.split(`#`)[0]:e}var VG=e=>t=>{RU(e,t)},HG=e=>function(){lW(e,``),IU(e,!1),WU(e,{query:``,hit:null,keys:[]})},UG=e=>function(){IU(e,!e.b6)},WG=e=>function(t){KU(e,t);let n=e.d2.find(e=>e.repo===t);n&&e.c7(n.key)},GG=e=>t=>{vW(e,t)},KG=e=>async()=>{try{kU(e,(await Mt(`/api/workspaces/${e.a8}/review`)).comments||[])}catch{}},qG=e=>t=>t===`all`?fetch(`/api/workspaces/${e.a8}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`clear`})}):Promise.all(t.map(t=>fetch(`/api/workspaces/${e.a8}/review/${t}`,{method:`DELETE`}))),JG=e=>()=>{vW(e,!0),TW(e,+e.bf+1),rH(e)()},YG=e=>t=>{e.c0=t},XG=e=>function(t){let n=new Set(e.bo),r=!n.delete(t);r&&n.add(t);let i=e.cy.filter(e=>!n.has(e.repo)),a=i.findIndex(e=>e.repo===t),o=e.cy.findIndex(e=>e.repo===t),s=r?e.cy.slice(Math.max(o,0)).find(e=>!n.has(e.repo))??i[i.length-1]:i[a];qU(e,n),KU(e,t),s&&(e.c0=null,e.c2=s.key)},ZG=e=>t=>{if(!gt())return;let n=e.s;if(e.ed??=n.parentElement,cancelAnimationFrame(e.ee),!t){e.ed&&n.parentElement!==e.ed&&e.ed.append(n);return}let r=0,i=()=>{let t=document.getElementById(`review-find-host`);t?n.parentElement!==t&&(t.append(n),requestAnimationFrame(()=>setTimeout(rH(e),0))):r++<20&&(e.ee=requestAnimationFrame(i))};i()};N(`A35`,pG),N(`A20`,mG),N(`A28`,hG),N(`A18`,gG),N(`A19`,_G),N(`A16`,vG),N(`A6`,yG),N(`A10`,bG),N(`A11`,xG),N(`A0`,SG),N(`A13`,CG),N(`A14`,wG),N(`A9`,TG),N(`A36`,EG),N(`A7`,DG),N(`A8`,OG),N(`A15`,kG),N(`A25`,AG),N(`A26`,jG),N(`A27`,MG),N(`A24`,NG),N(`A22`,PG),N(`A23`,FG),N(`A1`,IG),N(`A4`,LG),N(`A3`,RG),N(`A2`,zG),N(`A17`,BG),N(`A37`,VG),N(`A34`,HG),N(`A33`,UG),N(`A31`,WG),N(`A30`,GG),N(`A12`,KG),N(`A21`,qG),N(`A29`,JG),N(`A5`,YG),N(`A32`,XG),N(`A38`,ZG);export{GW as $input_active,bW as $input_findOpen,xW as $input_findOpenChange,DW as $input_findTick,OW as $input_findTickChange,WW as $input_focusFile,fG as $input_focusFileNonce,dG as $input_focusNonce,UW as $input_focusPr,iG as $input_onExit,HW as $input_onFileChange,qW as $input_onRevChange,KW as $input_onScopeChange,nG as $input_onSent,_W as $input_rev,hW as $input_scope,uG as $input_sessions,$W as $input_workspaceBranch,fW as $input_workspaceId,eG as $input_workspaceName,iW as $setup,lV as $template,uV as $walks};
|
|
2800
|
+
`)}var xV=p(0,`<div><div></div><div></div></div>`,` D b `,e=>{b(e.a,`_hi`),b(e.b,[`_hh`,`_hj`]),b(e.c,[`_hh`,`_hk`])}),SV=e=>{b(e.a,`_hg`),xV(e,[2,0,1])},CV=e=>{b(e.a,`_hl`),b(e.b,[`_hh`,`_hm`]),b(e.c,[`_hh`,`_hn`])},wV=(e,t)=>T(e.a,`value`,`rev:${t}`),TV=(e,t)=>c(e.b,t),EV=a(0,`<option> </option>`,` D `,0,(e,t)=>{wV(e,t[0]?.sha),TV(e,t[0]?.label)}),DV=f(17,0,e=>EV(e,[e._.de,`sha`])),OV=DV,kV=f(21,0,e=>T(e.a,`hidden`,e._.bb)),AV=_(`A43`,e=>u(e.a,`click`,function(){e._.e9()})),jV=e=>{kV._(e),b(e.a,[ie,`_g_`,`_g2`]),ve(e.b),fe(e.b,14),Ie(e.b),AV(e)},MV=f(12,0,e=>{T(e.a,`title`,`Jump to file (${e._.d4})`),T(e.a,`aria-label`,`Jump to file (${e._.d4} files)`),c(e.e,e._.d4>99?`99+`:e._.d4)}),NV=_(`A41`,e=>u(e.a,`click`,function(){KU(e._,!0)})),PV=e=>{MV._(e),b(e.a,[ie,`_g2`,`_ho`]),b(e.b,`_hp`),XC(e.c),ZC(e.c,20),QC(e.c,`_hq`),b(e.d,`_hr`),NV(e)},FV=f(9,0,e=>{b(e.a,[IS,`_g2`,{_g1:e._.b9}]),T(e.a,`title`,e._.b9?`Hide file tree`:`Show file tree`)}),IV=_(`A40`,e=>u(e.a,`click`,function(){GU(e._,!e._.b9),Dt(e._.b9)})),LV=e=>{FV._(e),le(e.b),Me(e.b,14),jt(e.b),IV(e)},RV=h(2,e=>c(e.b,e._.b8?`This commit is not in any of these repos.`:e._.co.some(e=>e.unborn)?`No commits yet.`:e._.b7===`dirty`?`Nothing uncommitted.`:e._.co.some(e=>e.pr)?`No file changes on these PRs.`:`No changes vs base.`),2),zV=f(28,0,RV),BV=e=>{zV._(e),VV._(e),HV._(e),b(e.a,`_cj`)},VV=f(28,0,RV),HV=f(28,0,RV),UV=j(195,e=>c(e.b,e._._.b7===`committed`?``:`, showing uncommitted changes only`),e=>e._._),WV=e=>{UV(e),GV(e)},GV=j(5,e=>c(e.a,e._.e)),KV=x(`A45`,`<!><!>.`,`%b%`,WV),qV=e=>{Be(e.a),Ye(e.a,KV(e)),L(e.a,`warn`),nt(e.a,`inline`),Ot(e.a),mt(e.a),et(e.a),$e(e.a,{})},JV=(e,t)=>Lt(e.a,`${t}: base not found`),YV=(e,t)=>{JV(e,t[0]?.worktree),XV(e,t[0]?.base)},XV=M(4,y(GV)),ZV=h(2,e=>c(e.b,e._.bi.trim()?`No matches in review.`:e._.b6&&!e._.b3?`Nothing changed since your last visit.`:`No files match "${e._.b3}".`),2),QV=f(28,1,ZV),$V=e=>{QV._(e),eH._(e),tH._(e),b(e.a,`_cj`)},eH=f(28,1,ZV),tH=f(28,1,ZV),nH=j(192,e=>c(e.a,e._._.b0),e=>e._._),rH=x(`A44`,` `,` `,nH),iH=e=>{Be(e.a),Ye(e.a,rH(e)),et(e.a,CG(e)),Ot(e.a),mt(e.a),L(e.a),nt(e.a),Lt(e.a),$e(e.a,{})},aH=f(7,0,e=>IC(e.b,e._.ar)),oH=e=>{aH._(e),sH._(e),cH._(e),lH._(e),b(e.a,`_g8`),MC(e.b)},sH=f(7,0,e=>UC(e.b,e._.ay)),cH=f(7,0,e=>GC(e.b,e._.e5)),lH=f(7,0,e=>WC(e.b,e._.e6)),uH=f(5,0,e=>T(e.a,`href`,`/w/${e._.a8}`)),dH=e=>{uH._(e),b(e.a,[ie,`_g7`]),ze(e.b),Le(e.b,14),Re(e.b)},fH=r(`A39`,182),pH=(e,t)=>ok(e.x,t),mH=_(`A46`,e=>l(e,{active:e.ak,load:e.ca,findOpen:e.bb,shownFiles:e.d2,commentsByFile:e.d6,draft:e.az,sessions:e.ar,collapsedFiles:e.bm,repos:e.au,onMount:function(){let t=new AbortController,n=()=>e.ar||[],r=(t,n=!0)=>{let r=e.a3,i=t.getBoundingClientRect();if(!i.height)return;let a=r.getBoundingClientRect(),o=getComputedStyle(t),s=i.top-(parseFloat(o.scrollMarginTop)||0),c=i.bottom+(parseFloat(o.scrollMarginBottom)||0),l=0;s<a.top?l=s-a.top:c>a.bottom&&(l=c-a.bottom),l&&r.scrollTo({top:Math.max(0,r.scrollTop+l),behavior:n?`smooth`:`auto`})},i=new WeakMap,a=async(t,n,r)=>{if(!r)return``;let i=new URLSearchParams({worktree:t,path:n,rev:r});return(await Mt(`/api/workspaces/${e.a8}/diff/contents?${i}`)).contents},o={viewer:null},s={key:null,top:null},c=new Map,l,u={draft:!0},d,f=e=>{let t=c.get(e.id);return(!t||t.comment.text!==e.text)&&(t={comment:e}),c.set(e.id,t),t},p=e=>(l!==e&&(l=e,u={draft:!0},d=void 0),u),m=(e,t,n)=>{let r=[];for(let e of t)r.push({side:e.side,lineNumber:e.line_end,metadata:f(e)});return n&&n.key===e&&r.push({side:n.side===`deletions`?`deletions`:`additions`,lineNumber:n.end,metadata:p(n)}),r},h=(e,t,n,r)=>{let i=r?[r]:[];for(let e of t)i.push({lineNumber:0,metadata:f(e)});return n&&n.key===e&&i.push({lineNumber:0,metadata:p(n)}),i.length?i:void 0},g=(e,t,n)=>e.map(e=>`${e.id}:${e.text.length}`).join(`,`)+(t&&t.key===n?`|d${t.side}${t.start}-${t.end}`:``),_=new Map,v=new WeakMap,y=(t,n,r,i)=>{let a=new URLSearchParams({worktree:t,path:n,rev:r});return i&&a.set(`v`,i),`/api/workspaces/${e.a8}/diff/blob?${a}`},b=(t,n)=>{let r=t.binary?Hx(t.path)?.kind:void 0;if(!r||!n)return;let i=e.dp(t.repo),a=t.status===`A`,o=t.status===`D`,s=[];if(!a&&n.oldRev&&s.push({label:o?`Deleted`:`Before`,src:y(i,t.oldPath||t.path,n.oldRev)}),!o&&n.newRev&&s.push({label:a?`Added`:`After`,src:y(i,t.path,n.newRev,t.hash)}),!s.length)return;let c=s.map(e=>e.src).join(` `),l=_.get(t.key);return(!l||l.sig!==c)&&(l={sig:c,meta:{preview:{kind:r,name:t.path,sides:s}}},_.set(t.key,l)),{lineNumber:0,metadata:l.meta}},x=t=>{RU(e,{key:t,side:`additions`,start:0,end:0})},S=(t,n)=>{if(!t)return;let r=t.endSide!=null&&t.endSide!==t.side;RU(e,{key:n,side:t.side||`additions`,start:Math.min(t.start,r?t.start:t.end),end:Math.max(t.start,r?t.start:t.end)})},C={theme:{dark:`pierre-dark`,light:`pierre-light`},themeType:St(),diffStyle:gt()?`unified`:`split`,stickyHeaders:!0,itemMetrics:{diffHeaderHeight:44},enableLineSelection:!0,layout:{paddingTop:0,paddingBottom:24,gap:12},unsafeCSS:` @media (pointer: coarse) { pre[data-diff] { touch-action: pan-x pan-y; } [data-column-number], [data-gutter-utility-slot] { touch-action: none !important; } }`+gS,async loadDiffFiles(t){let n=i.get(t),r=(e.au||[]).find(e=>e.id===n?.repo);if(!n||!r)throw Error(`unknown file`);let[o,s]=await Promise.all([t.type===`new`?Promise.resolve(``):a(n.worktree,t.prevName||n.path,r.oldRev),t.type===`deleted`?Promise.resolve(``):a(n.worktree,n.path,r.newRev)]);if(o==null||s==null)throw VU(e,`${n.path} is too large to expand.`),Error(`diff contents unavailable`);if(t.type!==`new`&&!yx(t,`deletions`,o)||t.type!==`deleted`&&!yx(t,`additions`,s))throw VU(e,`${n.path} has changed since this diff was taken — refresh to expand it.`),Error(`diff contents out of date`);return{oldFile:{name:t.prevName||t.name,contents:o},newFile:{name:t.name,contents:s}}},renderCustomHeader(t,n){let r=n.item,i=e.ds(r.id),a=document.createElement(`div`);a.className=`_hu${r.collapsed?` _hv`:``}`;let c=i?.label??r.id;a.title=c;let l=document.createElement(`span`);l.className=`_hw`,l.textContent=`▾`;let u=document.createElement(`span`);u.className=`__`;let d=i?.status||(r.type===`diff`?r.fileDiff.type[0].toUpperCase():`M`);u.dataset.status=d,u.textContent=d;let f=document.createElement(`span`);f.className=`_hx`;let p=document.createElement(`bdi`);if(p.textContent=c,f.append(p),a.append(l,u,f),i?.changedSince){let e=document.createElement(`span`);e.className=`_A _hB`,e.title=`Changed since your last visit`,a.append(e)}let m=i&&e.d6.get(i.label)?.length||0;if(r.type===`file`){let t=document.createElement(`button`);t.type=`button`,t.className=RS,t.textContent=m?`✎ ${m}`:`✎`,t.title=m?`${m} comment${m>1?`s`:``} — add another`:`Comment on this file`,t.setAttribute(`aria-label`,`Comment on this file`),t.onclick=t=>{t.stopPropagation();let n=new Set(e.bm);n.delete(r.id)&&$U(e,n),x(r.id)},a.append(t)}else if(m){let e=document.createElement(`span`);e.className=`_u`,e.textContent=`✎ ${m}`,a.append(e)}if(i&&(i.additions||i.deletions)){let e=document.createElement(`span`);e.className=`_hy`;let t=document.createElement(`span`);t.className=`_hz`,t.textContent=`+${i.additions||0}`;let n=document.createElement(`span`);n.className=`_hA`,n.textContent=`−${i.deletions||0}`,e.append(t,n),a.append(e)}return a.onclick=()=>{s.key=r.id,s.top=o.viewer?.getTopForItem(r.id)??null;let t=new Set(e.bm);t.delete(r.id)||t.add(r.id),$U(e,t)},a},renderAnnotation(t,i){let a=t.metadata||{},o=i.item.id;if(a.preview){let e=v.get(a);return e||v.set(a,e=tS(a.preview)),e}if(a.draft)return d??=Xx({sessions:n,reveal:r},{onSave:t=>e.du(o,t),onSend:(t,n)=>e.e8(o,t,n),onCancel:()=>{RU(e,null)}});let s=a.comment;if(!s)return;let c=i.item.type===`diff`?i.item.fileDiff:null,l=s.snippet!=null&&!!c&&bV(xx(c,s.side,s.line_start,s.line_end))!==bV(s.snippet);return Yx(s,{sessions:n,reveal:r},{onDelete:t=>e.dx(t),onEdit:(t,n)=>e.dy(t,n),onSend:(t,n)=>e.e7(t,n),drifted:l})},onLineSelectionEnd(e,t){t.item.type===`file`?x(t.item.id):S(e,t.item.id)},onPostRender(e,t,n,r){let i=e;if(n===`unmount`){w.get(i)?.(),w.delete(i);return}w.has(i)?OS(i):w.set(i,DS(i,r.item.id))}},w=new Map,T=new Yb(C,Lx());o.viewer=T,T.setup(e.a3);let E=Ke(e=>{C.themeType=e,T.setOptions({...C})});_e()&&Bx(()=>e.a3,t.signal),e.bu.scrollToItem=t=>{D.recs.has(t)&&(e.c2=null,T.scrollTo({type:`item`,id:t,align:`start`,behavior:`instant`}))},e.bu.scrollToLine=(e,t,n)=>T.scrollTo({type:`line`,id:e,lineNumber:t,side:n||`additions`,align:`center`,behavior:`instant`}),e.bu.clearSelection=()=>T.clearSelectedLines();let D={abort:t,viewer:T,unregTheme:E,unsubScroll:T.subscribeToScroll(t=>{e.by||=requestAnimationFrame(()=>{e.by=0;let n=null;for(let r of T.getRenderedItems()){let i=T.getTopForItem(r.id);i==null||i>t+1||(!n||i>(T.getTopForItem(n.key)??-1))&&(n={scope:e.b7,key:r.id,off:Math.round(t-i)})}t>0&&(e.bw=n);let r=n?.key??T.getRenderedItems()[0]?.id,i=r&&e.ds(r)?.repo;i&&i!==e.bn&&eW(e,i)})}),hostUnregs:w,loaded:!1,wasActive:!1,lastNonce:e.as||0,lastFileNonce:e.at||0,recs:new Map,order:``,revealedDraft:null,dockedOpen:!1,start:()=>{this.active&&!D.loaded&&(D.loaded=!0,this.load())},pin:t=>{let n=e.a3,r=Date.now(),i=!1,a=()=>{i=!0};for(let e of[`wheel`,`touchstart`,`keydown`])n.addEventListener(e,a,{once:!0,passive:!0});let o=()=>{if(i||!D.recs.has(t.key))return;let e=D.viewer.getTopForItem(t.key);if(e!=null){let n=e+t.off;Math.abs(D.viewer.getScrollTop()-n)>1&&D.viewer.scrollTo({type:`position`,position:n,behavior:`instant`})}Date.now()-r<1500&&requestAnimationFrame(o)};o()},sync:()=>{let t=[],n=new Set,r=!1;for(let a of this.shownFiles){n.add(a.key);let o=D.recs.get(a.key),s=o&&o.patch===a.patch&&o.status===a.status?o.fileDiff:hx(a,a.key),c=this.commentsByFile.get(a.label)||[],l=s?void 0:b(a,(this.repos||[]).find(e=>e.id===a.repo)),u=g(c,this.draft,a.key)+(l?`|p${_.get(a.key).sig}`:``),d=s?void 0:h(a.key,c,this.draft,l),f=this.collapsedFiles.has(a.key);s&&i.set(s,{worktree:e.dp(a.repo),path:a.path,repo:a.repo});let p={name:a.path,contents:l?` `:a.binary?`(binary file)`:a.tooLarge?`(file too large to display)`:`(file could not be read)`},v=o;!v||v.item.type===`diff`!=!!s?(v={item:s?{id:a.key,type:`diff`,fileDiff:s,annotations:m(a.key,c,this.draft),collapsed:f,version:(v?.item.version??0)+1}:{id:a.key,type:`file`,file:p,annotations:d,collapsed:f,version:(v?.item.version??0)+1},fileDiff:s,annSig:u,collapsed:f,patch:a.patch,status:a.status},D.recs.set(a.key,v),r=!0):(v.fileDiff!==s||v.annSig!==u||v.collapsed!==f)&&(v.item.type===`diff`&&s?(v.item.fileDiff=s,v.item.annotations=m(a.key,c,this.draft)):v.item.type===`file`&&(v.item.file.contents!==p.contents&&(v.item.file=p),v.item.annotations=d),v.item.collapsed=f,v.item.version=(v.item.version??0)+1,v.fileDiff=s,v.annSig=u,v.collapsed=f,v.patch=a.patch,v.status=a.status,r||D.viewer.updateItem(v.item)),t.push(v.item)}for(let e of[...D.recs.keys()])n.has(e)||D.recs.delete(e);let a=t.map(e=>e.id).join(`
|
|
2801
|
+
`);if((r||a!==D.order)&&(D.order=a,D.viewer.setItems(t)),s.key){let{key:e,top:t}=s;s.key=null,t!=null&&t<D.viewer.getScrollTop()&&D.viewer.scrollTo({type:`item`,id:e,align:`start`,behavior:`instant`})}let o=this.draft;o&&o!==D.revealedDraft&&D.recs.has(o.key)&&(D.revealedDraft=o,D.viewer.scrollTo({type:`line`,id:o.key,lineNumber:o.end,side:o.side===`deletions`?`deletions`:`additions`,align:`nearest`,offset:180,behavior:`smooth-auto`}));let c=e.c0;c&&D.recs.has(c.key)&&(e.c0=null,D.pin(c)),e.c2&&D.recs.has(e.c2)&&e.bu.scrollToItem(e.c2)}};return D.wasActive=!!this.active,this.findOpen&&(D.dockedOpen=!0,e.eh(!0)),Ae().addEventListener(`review.changed`,t=>{D.loaded&&t.data?.workspaceId===e.a8&&e.ch()},{signal:t.signal}),Ae().addEventListener(`status.changed`,t=>{if(!this.active||!D.loaded||e.b1)return;let n=t.data,r=n&&n[e.a8];if(!r)return;let i=px(r);!i||!e.bq||i===e.bq||e.cg()},{signal:t.signal}),window.addEventListener(`pagehide`,()=>{this.active&&D.loaded&&(e.cn(),e.c6())},{signal:t.signal}),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`&&this.active&&D.loaded&&e.c6()},{signal:t.signal}),D.start(),D},onUpdate:function(){this.start(),this.active&&this.loaded&&!this.wasActive&&e.cf(),!this.active&&this.loaded&&this.wasActive&&(e.cn(),e.c6()),this.wasActive=!!this.active,!!this.findOpen!==this.dockedOpen&&(this.dockedOpen=!!this.findOpen,e.eh(this.dockedOpen));let t=e.as||0;this.loaded&&e.ai&&t!==this.lastNonce&&e.c8(e.ai),this.lastNonce=t;let n=e.at||0;this.loaded&&e.aj&&n!==this.lastFileNonce?(e.c7(e.aj),this.lastFileNonce=n):this.loaded&&(this.lastFileNonce=n),e.a9&&e.a9!==e.b7&&e.ci(e.a9,!1),e.aa!==void 0&&(e.aa??null)!==e.b8&&e.cj(e.aa??null),this.draft||this.viewer.clearSelectedLines(),this.sync()},onDestroy:function(){e.br&&clearTimeout(e.br),this.loaded&&(e.cn(),e.c6()),this.abort.abort(),this.unsubScroll(),this.unregTheme();for(let e of this.hostUnregs.values())e();this.viewer.cleanUp()}})),$=h(188,mH,43),hH=M(164,$),gH=h(163,e=>hH(e,wG(e)),5),_H=M(178,$),vH=h(174,e=>_H(e,TG(e)),5),yH=M(160,e=>{gH(e),vH(e)}),bH=a(26,At,(e=>`/${e}&`)(Ue),qV,YV),xH=(e,t)=>{$z(e.a4,t),aV(e.a5,t)},SH=M(162,e=>{gH(e),vH(e),$(e)}),CH=M(161,e=>SH(e,DG(e))),wH=(e,t)=>Jw(e.t,t),TH=h(158,e=>T(e.o,`title`,`${e.dh}\n${e.dn}`)),EH=M(157,TH),DH=h(156,e=>EH(e,e.dl.map(({repo:t})=>{let n=fS(t.pr?.baseRefName||t.base,t.pr?.headRefName||t.branch,e.an||``,e.ao||``);return`${t.worktree}: ${n.title}`}).join(`
|
|
2802
|
+
`)),2),OH=M(155,e=>{zO(e.x,e.dl),DH(e)}),kH=h(154,e=>OH(e,e.cq.filter(e=>e.files.length||e.pr).map(t=>{let n=e.dj(t);return{repo:t,files:n.files,additions:n.additions,deletions:n.deletions,fresh:n.fresh,hidden:t.files.length-n.files}}))),AH=M(153,kH),jH=(e,t)=>Zz(e.a4,t),MH=h(137,e=>jH(e,(()=>{let t=new Map;for(let n of e.cq)t.set(n.worktree,(t.get(n.worktree)||0)+1);return e.cq.map(n=>({id:n.id,label:n.pr&&(t.get(n.worktree)||0)>1?`${n.worktree} #${n.pr.number}`:n.worktree,files:e.d2.filter(e=>e.repo===n.id)})).filter(e=>e.files.length)})())),NH=M(136,e=>{hV(e.a5,e.d2),oG(e,e.d2?.length),MH(e),$(e)}),PH=h(133,e=>NH(e,e.cy.filter(t=>!e.bo.has(t.repo)))),FH=M(132,e=>{aG(e,e.cy?.length),AH(e,OG(e)),PH(e)}),IH=h(131,e=>FH(e,e.cw?e.cv.filter(t=>e.cw.has(t.key)||t.key===e.bl):e.cv),2),LH=M(129,e=>{wH(e,e.cv.map(e=>({...e,fileDiff:hx(e,e.key)}))),IH(e)}),RH=h(126,e=>LH(e,(()=>{let t=Rx(e.b3);return e.cr.filter(n=>t(n.label)&&(!e.b6||n.changedSince))})()),2),zH=(e,t)=>rV(e.a5,t),BH=(e,t)=>{Qz(e.a4,t),zH(e,new Set(t.keys()))},VH=h(141,e=>BH(e,new Map(e.cr.flatMap(t=>{let n=e.d6.get(t.label)?.length;return n?[[t.key,n]]:[]})))),HH=M(125,e=>{iG(e,e.cr?.length),xH(e,new Set(e.cr.filter(e=>e.changedSince).map(e=>e.key))),CH(e,new Map(e.cr.map(e=>[e.key,e]))),RH(e),VH(e)}),UH=M(124,e=>{HH(e,e.cq.flatMap(e=>e.files.map(t=>({...t,repo:e.id,key:`${e.id}/${t.path}`,label:`${e.worktree}/${t.path}`})))),MH(e),kH(e)}),WH=M(151,TH),GH=h(149,e=>WH(e,e.b8?e.de.find(t=>t.sha===e.b8)?.label??aS(e.b8,7):{committed:`Committed`,working:`Working tree`,dirty:`Uncommitted`}[e.b7]),2),KH=M(148,e=>{cG(e,e.de?.length),GH(e),DV(e)}),qH=h(123,e=>{UH(e,e.b8?e.co.filter(e=>e.rev):e.co),KH(e,(()=>{let t=new Set,n=[];for(let r of e.co)for(let e of r.commits||[])t.has(e.sha)||(t.add(e.sha),n.push({sha:e.sha,label:`${r.worktree}#${aS(e.sha,7)} ${e.subject}`}));return e.b8&&!t.has(e.b8)&&n.unshift({sha:e.b8,label:aS(e.b8,7)}),n})())}),JH=M(122,e=>{pH(e,new Set(e.co.filter(e=>!!e.pr&&!!e.localHead&&(e.localHead!==e.head||e.branch!==e.pr.headRefName)).map(e=>e.id))),yH(e,EG(e)),bH(e,[e.co.filter(e=>e.baseMissing),`id`]),qH(e),HV(e)}),YH=M(104,$),XH=h(95,e=>YH(e,kG(e)),2),ZH=M(113,e=>{sk(e.x,e.cf),$(e)}),QH=h(109,e=>ZH(e,AG(e))),$H=M(114,$),eU=h(112,e=>$H(e,jG(e)),4),tU=h(120,e=>A(e,`q`,e.b8?`rev:${e.b8}`:e.b7,MG(e)),2),nU=M(119,tU),rU=h(118,e=>nU(e,t=>{if(t.startsWith(`rev:`)){e.cj(t.slice(4));return}let n=t;if(e.b8&&(EW(e,null),e.am?.(null),n===e.b7)){e.ca(e.b7);return}e.ci(n)}),5),iU=M(116,e=>{rU(e),$(e)}),aU=h(110,e=>iU(e,NG(e)),2),oU=M(117,e=>{rU(e),$(e)}),sU=h(111,e=>oU(e,PG(e)),3),cU=M(108,e=>{QH(e),eU(e),aU(e),sU(e),rU(e),$(e)}),lU=h(107,e=>cU(e,FG(e)),10),uU=M(106,e=>{lU(e),$(e)}),dU=h(99,e=>uU(e,IG(e)),2),fU=M(121,$),pU=h(57,e=>fU(e,LG(e))),mU=d(9,(e=>`<button>${e}</button>`)(se),(e=>` D/${e}&l`)(we),LV),hU=d(12,(e=>`<button><span aria-hidden=true>${e}<span> </span></span></button>`)(JC),(e=>` D D/${e}& D n`)(YC),PV),gU=d(21,(e=>`<button title="Find in review (⌘/Ctrl+F)" aria-label="Find in review">${e}</button>`)(ht),(e=>` D/${e}&l`)(ge),jV),_U=h(147,e=>gU(e,e.dc&&!e.bd?0:1)),vU=M(146,e=>{mU(e,+!e.dc),hU(e,+!e.dc),_U(e)}),yU=h(128,e=>vU(e,!e.au||e.ct>0)),bU=M(175,cH),xU=M(176,lH),SU=M(177,$),CU=h(173,e=>{bU(e,RG(e)),xU(e,zG(e)),SU(e,BG(e))}),wU=M(172,e=>{CU(e),vH(e)}),TU=h(171,e=>wU(e,VG(e)),4),EU=d(22,`<div aria-hidden=true><div></div><div></div></div>`,` D b `,CV),DU=d(27,`<div aria-hidden=true></div>`,` `,SV),OU=h(64,e=>{EU(e,!e.au&&e.b1?0:1),DU(e,!e.au&&e.b1?0:1)}),kU=d(28,`<p> </p>`,` D `,BV,`<p> </p>`,` D `,$V),AU=h(135,e=>kU(e,e.au&&!e.ct?0:e.au&&!e.d0&&!e.bk?1:2),3),jU=m(56,e=>{JH(e,e.au||[]),XH(e),dU(e),pU(e),yU(e),TU(e),OU(e),AU(e),$(e)}),MU=M(140,e=>{VH(e),$(e)}),NU=M(167,$),PU=h(166,e=>NU(e,HG(e))),FU=M(168,$),IU=h(59,e=>FU(e,UG(e))),LU=m(58,e=>{gW(e,e.aw?.length),MU(e,(()=>{let t=new Map;for(let n of e.aw){let e=`${n.worktree}/${n.path}`;t.set(e,[...t.get(e)||[],n])}return t})()),gH(e),PU(e),IU(e),TU(e),CU(e)}),RU=m(61,e=>{gH(e),vH(e),$(e)}),zU=d(25,At,(e=>`/${e}&`)(Ue),iH),BU=y(nH),VU=m(62,e=>{zU(e,+!e.b0),BU(e)}),HU=m(63,e=>{T(e.k,`disabled`,e.b1),Ze(e.l,e.b1&&`_F`),T(e.o,`disabled`,e.b1),T(e.q,`disabled`,e.b1),ck(e.x,e.b1),eU(e),OU(e),$(e)}),UU=(e,t)=>{Pz(e.a4,t),tV(e.a5,t)},WU=m(68,e=>{tk(e.x,e.b6),lU(e),RH(e),eH(e)}),GU=m(71,e=>{qz(e.a4,e.b9),FV(e)}),KU=m(72,e=>XB(e.a5,e.ba)),qU=_(`A50`,e=>{e.bd&&!e.bb&&OW(e,!0)}),JU=h(76,qU),YU=M(75,e=>{tT(e.t,e.bd),rT(e.t,!e.bd),JU(e),_U(e)}),XU=M(130,IH),ZU=e=>{XU(e,e.bi.trim()?new Set(e.bj):null)},QU=m(79,e=>{zW(e,e.bh?.query),BW(e,e.bh?.keys),VW(e,e.bh?.hit),ZU(e)}),$U=m(84,$),eW=m(85,e=>{BO(e.x,e.bn),$(e)}),tW=M(105,e=>{eB(e.a4,GG(e)),lU(e),$(e)}),nW=h(102,e=>tW(e,KG(e)),4),rW=m(86,e=>{QO(e.x,e.bo),nW(e),PH(e)}),iW=(e,t)=>{UW(e,t.sig),WW(e,t.timer)},aW=(e,t)=>GW(e,t.seq),oW=(e,t)=>Pw(e.t,function(e){t(e)}),sW=M(92,e=>{oW(e,t=>{if(QU(e,t),!t.hit)return;let n=t.hit;setTimeout(()=>{n.line<1?e.bu.scrollToItem(n.key):e.bu.scrollToLine(n.key,n.line,n.side)},0)}),nW(e),dU(e),$(e)}),cW=(e,t)=>{KW(e,t.anchor),qW(e,t.raf)},lW=(e,t)=>{XW(e,t.pos),ZW(e,t.jump)},uW=M(159,e=>{gH(e),vH(e),$(e)}),dW=(e,t)=>dG(e,t.busy),fW=(e,t)=>{vG(e,t.home),yG(e,t.raf)},pW=_(`A48`,e=>{u(e.k,`click`,function(){e.cf()}),u(e.o,`click`,function(){let t=e.q;typeof t.showPicker==`function`?t.showPicker():t.focus()}),C(e,`q`)});function mW(e){v(e,19,hG),b(e.a,`_g0`),b(e.b,`_g5`),b(e.c,`_hE`),b(e.d,`_g6`),b(e.e,`_hc`),b(e.g,LS),b(e.i,[`_g4`,`_hD`]),b(e.k,[ie,`_g2`]),dt(e.l),Tt(e.l,14),b(e.n,`_hd`),Qe(e.p),qe(e.p,14),Et(e.p),b(e.q,`_he`),Kw(e.t),xw(e.t,tK(e)),kw(e.t),Aw(e.t),Nw(e.t),ZO(e.x),ek(e.x,eK(e)),nk(e.x,$G(e)),rk(e.x,QG(e)),b(e.y,`_hs`),b(e.a3,`_ht`),Uz(e.a4),e.a5,ZB(e.a5,ZG(e)),i(e,fH(e)),jU(e,null),LU(e,[]),RU(e,null),VU(e,null),HU(e,!1),UU(e,WG(e)),WU(e,!1),GU(e,ut()),KU(e,!1),YU(e,!gt()),QU(e,{query:``,hit:null,keys:[]}),$U(e,new Set),eW(e,null),rW(e,new Set),iW(e,{sig:``,timer:0}),aW(e,{seq:0}),sW(e,{scrollToItem:YG,scrollToLine:JG,clearSelection:qG}),cW(e,{anchor:null,raf:0}),lW(e,{pos:null,jump:null}),uW(e,XG),dW(e,{busy:0}),fW(e,{home:null,raf:0}),pW(e)}var hW=d(7,(e=>`<span>${e}</span>`)(WS),(e=>` D/${e}&l`)(GS),oH),gW=M(60,e=>{hW(e,+!e.ay),sH(e)}),_W=_(`A47`,e=>{e.b3!==ee(e.a8)&&xt(e.a8,e.b3)}),vW=h(66,_W),yW=m(65,e=>{Nz(e.a4,e.b3),eV(e.a5,e.b3),RH(e),vW(e),QV(e)}),bW=M(115,$),xW=M(165,e=>{PU(e),TU(e)}),SW=M(34,e=>{fV(e.a5,e.a8),yW(e,ee(e.a8)),bW(e,nK(e)),xW(e,rK(e)),XH(e),lU(e),pU(e),gH(e),IU(e),vH(e),vW(e),$(e),uH(e)}),CW=y(UV),wW=m(69,e=>{pV(e.a5,e.b7),lU(e),QH(e),eU(e),aU(e),sU(e),rU(e),GH(e),tU(e),$(e),CW(e),zV(e)}),TW=M(35,e=>{wW(e,e.a9??wt()),$(e)}),EW=m(70,e=>{b(e.o,[ie,`_g2`,{_g1:!!e.b8}]),lU(e),sU(e),rU(e),qH(e),GH(e),tU(e),$(e),VV(e)}),DW=M(36,e=>{EW(e,e.aa??null),$(e)}),OW=o(73,e=>{b(e.s,[`_hb`,{_ha:!e.bb}]),bw(e.t,e.bb),JU(e),$(e),kV(e)}),kW=h(39,e=>OW(e,e.ab,e.ac)),AW=M(37,kW),jW=M(38,kW),MW=_(`A49`,e=>{e.ak&&window.addEventListener(`keydown`,t=>{!(t.metaKey||t.ctrlKey)||t.altKey||t.shiftKey||t.key.toLowerCase()===`f`&&(t.target instanceof HTMLTextAreaElement||(t.preventDefault(),e.e9()))},{capture:!0,signal:D(e,0)})}),NW=h(180,e=>{O(e,0),MW(e)}),PW=M(179,NW),FW=o(77,e=>{nT(e.t,e.bf),PW(e,iK(e))}),IW=h(42,e=>FW(e,e.ae,e.af)),LW=M(40,IW),RW=M(41,IW),zW=M(80,tH),BW=M(81),VW=M(82,e=>{HW(e,e.bk?.key),AU(e)}),HW=M(83,IH),UW=M(88,e=>{lU(e),$(e)}),WW=M(89,e=>{eU(e),$(e)}),GW=M(91,lU),KW=M(94,e=>{XH(e),$(e)}),qW=M(96,$),JW=M(103,lU),YW=h(101,e=>$O(e.x,oK(e))),XW=M(98,e=>{JW(e,aK(e)),nW(e),dU(e),YW(e),$(e)}),ZW=M(100,e=>{nW(e),YW(e),$(e)}),QW=M(43,nW),$W=M(44,e=>{lU(e),$(e)}),eG=M(45,e=>{lU(e),$(e)}),tG=M(46,e=>{eU(e),NW(e),$(e)}),nG=M(47,aU),rG=M(48,e=>{sU(e),rU(e)}),iG=M(127,e=>{cV(e.a5,e.ct),yU(e),AU(e)}),aG=M(134,AU),oG=M(138,MV),sG=d(17,`<optgroup label=Commits></optgroup>`,` `,OV),cG=(e,t)=>sG(e,+!t),lG=M(49,e=>{ik(e.x,e.an||``),DH(e)}),uG=M(50,e=>{ak(e.x,e.ao||``),DH(e)}),dG=M(170,TU),fG=M(51,TU),pG=d(5,(e=>`<a title="Back to terminal (⌘/Ctrl+Shift+D)">${e}</a>`)(F),(e=>` D/${e}&l`)(P),dH),mG=(e,t)=>pG(e,+!t),hG=s(`A42`,M(182)),gG=M(187,$),_G=h(186,e=>gG(e,sK(e))),vG=M(184,_G),yG=M(185,_G),bG=M(53,e=>{$(e),aH(e)}),xG=M(54,$),SG=M(55,$),CG=e=>function(){VU(e._,null)},wG=e=>async(t,n)=>{let r=e.az,i=e.ds(t);if(RU(e,null),!(!r||!i))try{let t=await Mt(`/api/workspaces/${e.a8}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`comment`,worktree:e.dp(i.repo),path:i.path,side:r.side,line_start:r.start,line_end:r.end,text:n.trim(),...e.dq(i,r)})});LU(e,e.aw.some(e=>e.id===t.id)?e.aw:e.aw.concat(t))}catch(t){VU(e,String(t.message||t))}},TG=e=>(t,n,r)=>{let i=e.az,a=e.ds(t),o=n.trim();if(!i||!a||!o)return Promise.resolve(!1);let s={id:-1,workspace_id:e.a8,worktree:e.dp(a.repo),path:a.path,side:i.side===`deletions`?`deletions`:`additions`,line_start:i.start,line_end:i.end,text:o,created_at:``,...e.dq(a,i)};return e.e2([s],{session:r},[])},EG=e=>(t,n)=>{let r=e.co.find(e=>e.id===t.repo),i=hx(t,t.key),a=n.side===`deletions`?`deletions`:`additions`;return{head:r?.head,snippet:i?xx(i,a,n.start,n.end):void 0}},DG=e=>t=>e.dr.get(t),OG=e=>t=>{let n=0,r=0,i=0,a=0;for(let a of e.cy)a.repo===t.id&&(i++,n+=a.additions||0,r+=a.deletions||0);for(let e of t.files)e.changedSince&&a++;return{additions:n,deletions:r,files:i,fresh:a}},kG=e=>()=>{e.au&&Ge(e.a8,e.bw)},AG=e=>()=>e.ca(e.b7,!0),jG=e=>()=>{e.br&&clearTimeout(e.br),e.br=setTimeout(()=>{e.br=0,e.ak&&!e.b1&&e.ca(e.b7,!0)},400)},MG=e=>function(t){e.cl(t)},NG=e=>(t,n=!0)=>{t!==e.b7&&(wW(e,t),n&&ct(t),e.al?.(t),e.ca(t))},PG=e=>t=>{t!==e.b8&&(EW(e,t),e.am?.(t),e.ca(e.b7))},FG=e=>async(t=e.b7,n=!1)=>{let r=++e.bt;HU(e,!0),VU(e,null);try{let i=new URLSearchParams;t!==`committed`&&i.set(`scope`,t),n&&i.set(`refresh`,`1`),e.b8&&i.set(`rev`,e.b8);let a=await Mt(`/api/workspaces/${e.a8}/diff?${i}`);if(r!==e.bt)return;let o=a.sections,s=a;if(jU(e,o),e.b6&&!o.some(e=>e.files.some(e=>e.changedSince))&&WU(e,!1),LU(e,s.comments||[]),e.bq=fx(o),e.ai&&e.c8(e.ai),e.aj)e.c7(e.aj);else if(!e.ai&&!n&&e.bt===1){let n=Xe(e.a8);n&&n.scope===t&&e.c5(n)}}catch(t){if(r!==e.bt)return;VU(e,String(t.message||t))}finally{r===e.bt&&HU(e,!1)}},IG=e=>t=>{let n=(e.au||[]).find(e=>e.pr&&`${e.worktree}/${e.pr.number}`===t),r=n?.files[0];n&&r&&(e.c0=null,e.bu.scrollToItem(`${n.id}/${r.path}`))},LG=e=>()=>{if(!e.au)return;let t={},n={};for(let r of e.au){t[r.id]=r.head;for(let e of r.files)e.hash&&(n[`${r.worktree}/${e.path}`]=e.hash)}fetch(`/api/workspaces/${e.a8}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`seen`,heads:t,dirty:n}),keepalive:!0}).catch(()=>{})},RG=e=>()=>e.e2(e.aw,{clipboard:!0},`all`),zG=e=>t=>e.e2(e.aw,{session:t},`all`),BG=e=>(t,n)=>{let r=e.aw.find(e=>e.id===t);return r?e.e2([r],{session:n},[t]):Promise.resolve(!1)},VG=e=>async(t,n,r)=>{if(!t.length)return!0;e.e0++;try{let i=nS(t,e.au);if(`clipboard`in n){if(!await ae(i))return VU(e,`Copy failed: the clipboard needs HTTPS in this browser.`),!1}else await Mt(`/api/sessions/${n.session}/send`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({text:`Please address this review feedback, then summarize what you changed.\n\n${i}`,...We()||{}})}),e.ap?.(n.session);if(RU(e,null),r===`all`)LU(e,[]);else{let t=new Set(r);LU(e,e.aw.filter(e=>!t.has(e.id)))}return(r===`all`||r.length)&&await e.dv(r).catch(()=>{}),!0}catch(t){return VU(e,String(t.message||t)),!1}finally{e.e0--}},HG=e=>async t=>{LU(e,e.aw.filter(e=>e.id!==t)),await e.dv([t]).catch(()=>{})},UG=e=>async(t,n)=>{let r=e.aw.find(e=>e.id===t);if(!r)return;let i=n.trim();if(!(!i||i===r.text)){LU(e,e.aw.map(e=>e.id===t?{...e,text:i}:e));try{await Mt(`/api/workspaces/${e.a8}/review/${t}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({text:i})})}catch(n){throw LU(e,e.aw.map(e=>e.id===t?r:e)),VU(e,String(n.message||n)),n}}},WG=e=>t=>{yW(e,t)},GG=e=>function(t){e.c7(t)},KG=e=>t=>{let n=t.slice(0,t.indexOf(`/`));if(e.bo.has(n)){let t=new Set(e.bo);t.delete(n),rW(e,t)}e.c0=null,e.c2=t,e.ah?.(t),e.bu.scrollToItem(t)};function qG(){}function JG(e,t,n){}function YG(e){}function XG(e){return e.includes(`#`)?e.split(`#`)[0]:e}var ZG=e=>t=>{KU(e,t)},QG=e=>function(){yW(e,``),WU(e,!1),QU(e,{query:``,hit:null,keys:[]})},$G=e=>function(){WU(e,!e.b6)},eK=e=>function(t){eW(e,t);let n=e.d2.find(e=>e.repo===t);n&&e.c7(n.key)},tK=e=>t=>{OW(e,t)},nK=e=>async()=>{try{LU(e,(await Mt(`/api/workspaces/${e.a8}/review`)).comments||[])}catch{}},rK=e=>t=>t===`all`?fetch(`/api/workspaces/${e.a8}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`clear`})}):Promise.all(t.map(t=>fetch(`/api/workspaces/${e.a8}/review/${t}`,{method:`DELETE`}))),iK=e=>()=>{OW(e,!0),FW(e,+e.bf+1),fH(e)()},aK=e=>t=>{e.c0=t},oK=e=>function(t){let n=new Set(e.bo),r=!n.delete(t);r&&n.add(t);let i=e.cy.filter(e=>!n.has(e.repo)),a=i.findIndex(e=>e.repo===t),o=e.cy.findIndex(e=>e.repo===t),s=r?e.cy.slice(Math.max(o,0)).find(e=>!n.has(e.repo))??i[i.length-1]:i[a];rW(e,n),eW(e,t),s&&(e.c0=null,e.c2=s.key)},sK=e=>t=>{if(!gt())return;let n=e.s;if(e.ee??=n.parentElement,cancelAnimationFrame(e.ef),!t){e.ee&&n.parentElement!==e.ee&&e.ee.append(n);return}let r=0,i=()=>{let t=document.getElementById(`review-find-host`);t?n.parentElement!==t&&(t.append(n),requestAnimationFrame(()=>setTimeout(fH(e),0))):r++<20&&(e.ef=requestAnimationFrame(i))};i()};N(`A35`,CG),N(`A20`,wG),N(`A28`,TG),N(`A18`,EG),N(`A19`,DG),N(`A16`,OG),N(`A6`,kG),N(`A10`,AG),N(`A11`,jG),N(`A0`,MG),N(`A13`,NG),N(`A14`,PG),N(`A9`,FG),N(`A8`,IG),N(`A15`,LG),N(`A25`,RG),N(`A26`,zG),N(`A27`,BG),N(`A24`,VG),N(`A22`,HG),N(`A23`,UG),N(`A1`,WG),N(`A36`,GG),N(`A7`,KG),N(`A4`,qG),N(`A3`,JG),N(`A2`,YG),N(`A17`,XG),N(`A37`,ZG),N(`A34`,QG),N(`A33`,$G),N(`A31`,eK),N(`A30`,tK),N(`A12`,nK),N(`A21`,rK),N(`A29`,iK),N(`A5`,aK),N(`A32`,oK),N(`A38`,sK);export{tG as $input_active,AW as $input_findOpen,jW as $input_findOpenChange,LW as $input_findTick,RW as $input_findTickChange,eG as $input_focusFile,SG as $input_focusFileNonce,xG as $input_focusNonce,$W as $input_focusPr,mG as $input_onExit,QW as $input_onFileChange,rG as $input_onRevChange,nG as $input_onScopeChange,fG as $input_onSent,DW as $input_rev,TW as $input_scope,bG as $input_sessions,lG as $input_workspaceBranch,SW as $input_workspaceId,uG as $input_workspaceName,mW as $setup,vV as $template,yV as $walks};
|