@dylanpiercey/work 0.0.171 → 0.0.172

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.
Files changed (76) hide show
  1. package/dist/index.mjs +1135 -932
  2. package/dist/public/assets/_0b9AaNN-.js +1 -0
  3. package/dist/public/assets/_2EzGNO5F.js +1 -0
  4. package/dist/public/assets/_BVHAcToH.js +1 -0
  5. package/dist/public/assets/_BZc_ui7n.js +1 -0
  6. package/dist/public/assets/_Bwjv-2iV.js +1 -0
  7. package/dist/public/assets/_C3-re_UC.js +1 -0
  8. package/dist/public/assets/_C7R1lv1V.js +1 -0
  9. package/dist/public/assets/_CLzwhfzy.js +1 -0
  10. package/dist/public/assets/_Ci28NbFq.js +1 -0
  11. package/dist/public/assets/_Copf6Tzh.js +1 -0
  12. package/dist/public/assets/_CouHh4Pw.js +1 -0
  13. package/dist/public/assets/_DAFAqGpW.js +1 -0
  14. package/dist/public/assets/{_xrGv6Zps.js → _DBbja6xF.js} +1 -1
  15. package/dist/public/assets/_DBbja6xF.js.br +0 -0
  16. package/dist/public/assets/_DDjvr374.js +1 -0
  17. package/dist/public/assets/_DSe9HAN-.js +1 -0
  18. package/dist/public/assets/_D_-Exjqh.js +1 -0
  19. package/dist/public/assets/_DaE9nHz4.js +1 -0
  20. package/dist/public/assets/{_Br10NZ6d.js → _DaM16tbY.js} +5 -5
  21. package/dist/public/assets/_DaM16tbY.js.br +0 -0
  22. package/dist/public/assets/_DeH0loZu.js +1 -0
  23. package/dist/public/assets/{_CjiKSTp-.js → _DrPh1YYO.js} +64 -64
  24. package/dist/public/assets/_DrPh1YYO.js.br +0 -0
  25. package/dist/public/assets/_Hxo4L0bN.js +1 -0
  26. package/dist/public/assets/_K1xBXqer.js +1 -0
  27. package/dist/public/assets/_T1l7t4TQ.js +1 -0
  28. package/dist/public/assets/_jwZUUFkV.js +1 -0
  29. package/dist/public/assets/app-page-CkAL3lQR.css +1 -0
  30. package/dist/public/assets/app-page-CkAL3lQR.css.br +0 -0
  31. package/dist/public/assets/{icon-arrow-down-TOdaaJnn.css → icon-arrow-down-D2thnWCA.css} +1 -1
  32. package/dist/public/assets/icon-arrow-down-D2thnWCA.css.br +0 -0
  33. package/dist/public/assets/new-J2Xsk9fP.js +1 -0
  34. package/dist/public/assets/review-view-BVFq2WLB.css +1 -0
  35. package/dist/public/assets/review-view-BVFq2WLB.css.br +0 -0
  36. package/dist/public/assets/review-view-D-42NSpI.js +2 -0
  37. package/dist/public/assets/settings-J2Xsk9fP.js +1 -0
  38. package/dist/public/assets/w-J2Xsk9fP.js +1 -0
  39. package/dist/public/assets/w._-J2Xsk9fP.js +1 -0
  40. package/dist/public/assets/w._-RF3fHU9s.js +1 -0
  41. package/package.json +1 -1
  42. package/dist/public/assets/_3EfwUy0W.js +0 -1
  43. package/dist/public/assets/_7P6VyxcT.js +0 -1
  44. package/dist/public/assets/_BcCge-9R.js +0 -1
  45. package/dist/public/assets/_Br10NZ6d.js.br +0 -0
  46. package/dist/public/assets/_C16yshan.js +0 -1
  47. package/dist/public/assets/_C6S6mCpC.js +0 -1
  48. package/dist/public/assets/_CNFkFicO.js +0 -1
  49. package/dist/public/assets/_COycfK9m.js +0 -1
  50. package/dist/public/assets/_CSE9m5gn.js +0 -1
  51. package/dist/public/assets/_CbHpH_g1.js +0 -1
  52. package/dist/public/assets/_CfJhsMDh.js +0 -1
  53. package/dist/public/assets/_CjiKSTp-.js.br +0 -0
  54. package/dist/public/assets/_D9RRMMV-.js +0 -1
  55. package/dist/public/assets/_DB6kFCHN.js +0 -1
  56. package/dist/public/assets/_DCTXnTag.js +0 -1
  57. package/dist/public/assets/_DMA5bFpc.js +0 -1
  58. package/dist/public/assets/_DNoMUOBv.js +0 -1
  59. package/dist/public/assets/_DQDWADEU.js +0 -1
  60. package/dist/public/assets/_DjA0VSzF.js +0 -1
  61. package/dist/public/assets/_DuT2R6Xf.js +0 -1
  62. package/dist/public/assets/_JbyKR-1U.js +0 -1
  63. package/dist/public/assets/_Wi-YzA_N.js +0 -1
  64. package/dist/public/assets/_mmeIKJus.js +0 -1
  65. package/dist/public/assets/_xrGv6Zps.js.br +0 -0
  66. package/dist/public/assets/app-page-CB4NzxkK.css +0 -1
  67. package/dist/public/assets/app-page-CB4NzxkK.css.br +0 -0
  68. package/dist/public/assets/icon-arrow-down-TOdaaJnn.css.br +0 -0
  69. package/dist/public/assets/new-DV5OtPht.js +0 -1
  70. package/dist/public/assets/review-view-BmRsB-40.css +0 -1
  71. package/dist/public/assets/review-view-BmRsB-40.css.br +0 -0
  72. package/dist/public/assets/review-view-Dz0lNaF0.js +0 -2
  73. package/dist/public/assets/settings-DV5OtPht.js +0 -1
  74. package/dist/public/assets/w-DV5OtPht.js +0 -1
  75. package/dist/public/assets/w._-DV5OtPht.js +0 -1
  76. package/dist/public/assets/w._-RJq7Wy4Z.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{B as r,E as i,F as a,I as o,L as s,M as c,N as l,P as u,R as d,T as f,U as p,V as m,W as h,_ as g,a as _,b as v,c as y,d as b,f as x,i as S,j as C,k as w,l as T,n as E,r as D,t as O,u as k,v as A,y as j,z as M}from"./_tmN7XIcz.js";import{$ as ee,A as N,At as te,B as ne,Bt as re,C as ie,D as ae,E as oe,F as se,H as ce,Ht as le,I as ue,Jt as de,K as fe,Kt as pe,L as me,Lt as he,M as ge,Mt as _e,N as ve,Nt as ye,O as be,P as xe,Q as Se,R as Ce,Rt as we,S as Te,St as Ee,T as De,Tt as P,U as Oe,V as ke,Vt as Ae,X as je,Xt as Me,Y as Ne,Yt as Pe,Z as Fe,_ as Ie,a as Le,at as Re,b as ze,c as Be,ct as Ve,dt as He,et as Ue,ft as We,g as Ge,h as Ke,ht as qe,i as Je,it as Ye,j as Xe,k as Ze,ln as Qe,lt as $e,m as et,mt as tt,n as nt,nt as rt,o as it,ot as at,p as ot,pt as st,q as ct,qt as lt,r as F,rt as I,s as ut,sn as dt,st as ft,t as pt,tt as mt,u as ht,ut as gt,v as _t,vt,w as yt,wt as bt,x as xt,y as St,z as Ct,zt as wt}from"./_xrGv6Zps.js";var Tt=`diffs-container`,Et=(()=>{try{return!1}catch{return!1}})(),Dt=/(?=^From [a-f0-9]+ .+$)/m,Ot=/(?=^diff --git)/gm,kt=/(?<=\n)/,At=/^(---|\+\+\+)\s+([^\t\r\n]+)/,jt=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,Mt=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,Nt=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Pt=`header-prefix`,Ft=`header-filename-suffix`,It=`header-metadata`,Lt=`header-custom`,L={dark:`pierre-dark`,light:`pierre-light`},Rt=`data-theme-css`,zt=`data-unsafe-css`,Bt=`data-diffs-scrollbar-measure`,Vt=`data-diffs-code-view-header`,Ht=`data-diffs-code-view-footer`,Ut=`--diffs-scrollbar-gutter-measured`,Wt=1e5,Gt={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},Kt={...Gt,hunkLineCount:1},qt={paddingTop:8,paddingBottom:8,gap:8},Jt={omega:.015,positionEpsilon:.5,velocityEpsilon:.05},Yt=Object.freeze({fromStart:0,fromEnd:0}),Xt={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},Zt={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},Qt=new Set,$t=null;function en(e){Qt.add(e),$t??=requestAnimationFrame(nn)}function tn(e){Qt.delete(e)&&Qt.size===0&&$t!=null&&(cancelAnimationFrame($t),$t=null)}function nn(e){let t=new Set(Qt);Qt.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}$t=Qt.size>0?requestAnimationFrame(nn):null}function rn(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 an(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function on(e,t){let n=e?.theme??L,r=t?.theme??L,i=sn(e),a=sn(t);return an(n,r)&&rn(e,t,[`theme`,`parseDiffOptions`])&&rn(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 ln({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 un(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function dn(e){return{type:`text`,value:e}}function R({tagName:e,children:t=[],properties:n={}}){return{type:`element`,tagName:e,properties:n,children:t}}function fn({name:e,width:t=16,height:n=16,properties:r}){return R({tagName:`svg`,properties:{width:t,height:n,viewBox:`0 0 16 16`,...r},children:[R({tagName:`use`,properties:{href:`#${e.replace(/^#/,``)}`}})]})}function pn(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 mn(e){return R({tagName:`div`,properties:{"data-gutter":``},children:e})}function hn(e,t,n,r={}){return R({tagName:`div`,properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t==null?void 0:[R({tagName:`span`,properties:{"data-line-number-content":``},children:[dn(`${t}`)]})]})}function gn(e,t,n){return R({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 _n(){return R({tagName:`button`,properties:{"data-utility-button":``,type:`button`},children:[fn({name:`diffs-icon-plus`,properties:{"data-icon":``}})]})}function vn(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function yn(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 bn=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],xn=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};xn.prototype.normal={},xn.prototype.property={},xn.prototype.space=void 0;function Sn(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new xn(n,r,t)}function Cn(e){return e.toLowerCase()}var wn=class{constructor(e,t){this.attribute=t,this.property=e}};wn.prototype.attribute=``,wn.prototype.booleanish=!1,wn.prototype.boolean=!1,wn.prototype.commaOrSpaceSeparated=!1,wn.prototype.commaSeparated=!1,wn.prototype.defined=!1,wn.prototype.mustUseProperty=!1,wn.prototype.number=!1,wn.prototype.overloadedBoolean=!1,wn.prototype.property=``,wn.prototype.spaceSeparated=!1,wn.prototype.space=void 0;var Tn=e({boolean:()=>z,booleanish:()=>Dn,commaOrSpaceSeparated:()=>An,commaSeparated:()=>kn,number:()=>B,overloadedBoolean:()=>On,spaceSeparated:()=>V}),En=0,z=jn(),Dn=jn(),On=jn(),B=jn(),V=jn(),kn=jn(),An=jn();function jn(){return 2**++En}var Mn=Object.keys(Tn),Nn=class extends wn{constructor(e,t,n,r){let i=-1;if(super(e,t),Pn(this,`space`,r),typeof n==`number`)for(;++i<Mn.length;){let e=Mn[i];Pn(this,Mn[i],(n&Tn[e])===Tn[e])}}};Nn.prototype.defined=!0;function Pn(e,t,n){n&&(e[t]=n)}function Fn(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Nn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Cn(r)]=r,n[Cn(a.attribute)]=r}return new xn(t,n,e.space)}var In=Fn({properties:{ariaActiveDescendant:null,ariaAtomic:Dn,ariaAutoComplete:null,ariaBusy:Dn,ariaChecked:Dn,ariaColCount:B,ariaColIndex:B,ariaColSpan:B,ariaControls:V,ariaCurrent:null,ariaDescribedBy:V,ariaDetails:null,ariaDisabled:Dn,ariaDropEffect:V,ariaErrorMessage:null,ariaExpanded:Dn,ariaFlowTo:V,ariaGrabbed:Dn,ariaHasPopup:null,ariaHidden:Dn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:V,ariaLevel:B,ariaLive:null,ariaModal:Dn,ariaMultiLine:Dn,ariaMultiSelectable:Dn,ariaOrientation:null,ariaOwns:V,ariaPlaceholder:null,ariaPosInSet:B,ariaPressed:Dn,ariaReadOnly:Dn,ariaRelevant:null,ariaRequired:Dn,ariaRoleDescription:V,ariaRowCount:B,ariaRowIndex:B,ariaRowSpan:B,ariaSelected:Dn,ariaSetSize:B,ariaSort:null,ariaValueMax:B,ariaValueMin:B,ariaValueNow:B,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Ln(e,t){return t in e?e[t]:t}function Rn(e,t){return Ln(e,t.toLowerCase())}var zn=Fn({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:kn,acceptCharset:V,accessKey:V,action:null,allow:null,allowFullScreen:z,allowPaymentRequest:z,allowUserMedia:z,alpha:z,alt:null,as:null,async:z,autoCapitalize:null,autoComplete:V,autoFocus:z,autoPlay:z,blocking:V,capture:null,charSet:null,checked:z,cite:null,className:V,closedBy:null,colorSpace:null,cols:B,colSpan:B,command:null,commandFor:null,content:null,contentEditable:Dn,controls:z,controlsList:V,coords:B|kn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:z,defer:z,dir:null,dirName:null,disabled:z,download:On,draggable:Dn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:z,formTarget:null,headers:V,height:B,hidden:On,high:B,href:null,hrefLang:null,htmlFor:V,httpEquiv:V,id:null,imageSizes:null,imageSrcSet:null,inert:z,inputMode:null,integrity:null,is:null,isMap:z,itemId:null,itemProp:V,itemRef:V,itemScope:z,itemType:V,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:z,low:B,manifest:null,max:null,maxLength:B,media:null,method:null,min:null,minLength:B,multiple:z,muted:z,name:null,nonce:null,noModule:z,noValidate:z,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:z,optimum:B,pattern:null,ping:V,placeholder:null,playsInline:z,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:z,referrerPolicy:null,rel:V,required:z,reversed:z,rows:B,rowSpan:B,sandbox:V,scope:null,scoped:z,seamless:z,selected:z,shadowRootClonable:z,shadowRootCustomElementRegistry:z,shadowRootDelegatesFocus:z,shadowRootMode:null,shadowRootSerializable:z,shape:null,size:B,sizes:null,slot:null,span:B,spellCheck:Dn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:B,step:null,style:null,tabIndex:B,target:null,title:null,translate:null,type:null,typeMustMatch:z,useMap:null,value:Dn,width:B,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:V,axis:null,background:null,bgColor:null,border:B,borderColor:null,bottomMargin:B,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:z,declare:z,event:null,face:null,frame:null,frameBorder:null,hSpace:B,leftMargin:B,link:null,longDesc:null,lowSrc:null,marginHeight:B,marginWidth:B,noResize:z,noHref:z,noShade:z,noWrap:z,object:null,profile:null,prompt:null,rev:null,rightMargin:B,rules:null,scheme:null,scrolling:Dn,standby:null,summary:null,text:null,topMargin:B,valueType:null,version:null,vAlign:null,vLink:null,vSpace:B,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:z,disablePictureInPicture:z,disableRemotePlayback:z,exportParts:kn,part:V,prefix:null,property:null,results:B,security:null,unselectable:null},space:`html`,transform:Rn}),Bn=Fn({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:An,accentHeight:B,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:B,amplitude:B,arabicForm:null,ascent:B,attributeName:null,attributeType:null,azimuth:B,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:B,by:null,calcMode:null,capHeight:B,className:V,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:B,diffuseConstant:B,direction:null,display:null,dur:null,divisor:B,dominantBaseline:null,download:z,dx:null,dy:null,edgeMode:null,editable:null,elevation:B,enableBackground:null,end:null,event:null,exponent:B,externalResourcesRequired:null,fill:null,fillOpacity:B,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:kn,g2:kn,glyphName:kn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:B,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:B,horizOriginX:B,horizOriginY:B,id:null,ideographic:B,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:B,k:B,k1:B,k2:B,k3:B,k4:B,kernelMatrix:An,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:B,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:B,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:B,overlineThickness:B,paintOrder:null,panose1:null,path:null,pathLength:B,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:V,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:B,pointsAtY:B,pointsAtZ:B,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:An,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:An,rev:An,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:An,requiredFeatures:An,requiredFonts:An,requiredFormats:An,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:B,specularExponent:B,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:B,strikethroughThickness:B,string:null,stroke:null,strokeDashArray:An,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:B,strokeOpacity:B,strokeWidth:null,style:null,surfaceScale:B,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:An,tabIndex:B,tableValues:null,target:null,targetX:B,targetY:B,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:An,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:B,underlineThickness:B,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:B,values:null,vAlphabetic:B,vMathematical:B,vectorEffect:null,vHanging:B,vIdeographic:B,version:null,vertAdvY:B,vertOriginX:B,vertOriginY:B,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:B,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Ln}),Vn=Fn({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()}}),Hn=Fn({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Rn}),Un=Fn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Wn=/[A-Z]/g,Gn=/-[a-z]/g,Kn=/^data[-\w.:]+$/i;function qn(e,t){let n=Cn(t),r=t,i=wn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Kn.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Gn,Yn);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Gn.test(e)){let n=e.replace(Wn,Jn);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Nn}return new i(r,t)}function Jn(e){return`-`+e.toLowerCase()}function Yn(e){return e.charAt(1).toUpperCase()}var Xn=Sn([In,zn,Vn,Hn,Un],`html`),Zn=Sn([In,Bn,Vn,Hn,Un],`svg`),Qn={}.hasOwnProperty;function $n(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&Qn.call(t,e)){let n=String(t[e]);i=Qn.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 er=/["&'<>`]/g,tr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,nr=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,rr=/[|\\{}()[\]^$+*?.]/g,ir=new WeakMap;function ar(e,t){if(e=e.replace(t.subset?or(t.subset):er,r),t.subset||t.escapeOnly)return e;return e.replace(tr,n).replace(nr,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 or(e){let t=ir.get(e);return t||(t=sr(e),ir.set(e,t)),t}function sr(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(rr,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var cr=/[\dA-Fa-f]/;function lr(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!cr.test(String.fromCharCode(t))?r:r+`;`}var ur=/\d/;function dr(e,t,n){let r=`&#`+String(e);return n&&t&&!ur.test(String.fromCharCode(t))?r:r+`;`}var fr=`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(`.`),pr={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:`€`},mr=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],hr={}.hasOwnProperty,gr={},_r;for(_r in pr)hr.call(pr,_r)&&(gr[pr[_r]]=_r);var vr=/[^\dA-Za-z]/;function yr(e,t,n,r){let i=String.fromCharCode(e);if(hr.call(gr,i)){let e=gr[i],a=`&`+e;return n&&fr.includes(e)&&!mr.includes(e)&&(!r||t&&t!==61&&vr.test(String.fromCharCode(t)))?a:a+`;`}return``}function br(e,t,n){let r=lr(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=yr(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=dr(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function xr(e,t){return ar(e,Object.assign({format:br},t))}var Sr=/^>|^->|<!--|-->|--!>|<!-$/g,Cr=[`>`],wr=[`<`,`>`];function Tr(e,t,n,r){return r.settings.bogusComments?`<?`+xr(e.value,Object.assign({},r.settings.characterReferences,{subset:Cr}))+`>`:`<!--`+e.value.replace(Sr,i)+`-->`;function i(e){return xr(e,Object.assign({},r.settings.characterReferences,{subset:wr}))}}function Er(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function Dr(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 Or(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function kr(e){return e.join(` `).trim()}var Ar=/[ \t\n\f\r]/g;function jr(e){return typeof e==`object`?e.type===`text`&&Mr(e.value):Mr(e)}function Mr(e){return e.replace(Ar,``)===``}var Nr=Ir(1),Pr=Ir(-1),Fr=[];function Ir(e){return t;function t(t,n,r){let i=t?t.children:Fr,a=(n||0)+e,o=i[a];if(!r)for(;o&&jr(o);)a+=e,o=i[a];return o}}var Lr={}.hasOwnProperty;function Rr(e){return t;function t(t,n,r){return Lr.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var zr=Rr({body:Hr,caption:Br,colgroup:Br,dd:Kr,dt:Gr,head:Br,html:Vr,li:Wr,optgroup:Jr,option:Yr,p:Ur,rp:qr,rt:qr,tbody:Zr,td:ei,tfoot:Qr,th:ei,thead:Xr,tr:$r});function Br(e,t,n){let r=Nr(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&jr(r.value.charAt(0)))}function Vr(e,t,n){let r=Nr(n,t);return!r||r.type!==`comment`}function Hr(e,t,n){let r=Nr(n,t);return!r||r.type!==`comment`}function Ur(e,t,n){let r=Nr(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 Wr(e,t,n){let r=Nr(n,t);return!r||r.type===`element`&&r.tagName===`li`}function Gr(e,t,n){let r=Nr(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function Kr(e,t,n){let r=Nr(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function qr(e,t,n){let r=Nr(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function Jr(e,t,n){let r=Nr(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function Yr(e,t,n){let r=Nr(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function Xr(e,t,n){let r=Nr(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function Zr(e,t,n){let r=Nr(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function Qr(e,t,n){return!Nr(n,t)}function $r(e,t,n){let r=Nr(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function ei(e,t,n){let r=Nr(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var ti=Rr({body:ii,colgroup:ai,head:ri,html:ni,tbody:oi});function ni(e){let t=Nr(e,-1);return!t||t.type!==`comment`}function ri(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 ii(e){let t=Nr(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&jr(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function ai(e,t,n){let r=Pr(n,t),i=Nr(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&zr(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function oi(e,t,n){let r=Pr(n,t),i=Nr(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&zr(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{B as r,E as i,F as a,I as o,L as s,M as c,N as l,P as u,R as d,T as f,U as p,V as m,W as h,_ as g,a as _,b as v,c as y,d as b,f as x,i as S,j as C,k as w,l as T,n as E,r as D,t as O,u as k,v as A,y as j,z as M}from"./_tmN7XIcz.js";import{$ as ee,A as N,At as te,B as ne,Bt as re,C as ie,D as ae,E as oe,F as se,H as ce,Ht as le,I as ue,Jt as de,K as fe,Kt as pe,L as me,Lt as he,M as ge,Mt as _e,N as ve,Nt as ye,O as be,P as xe,Q as Se,R as Ce,Rt as we,S as Te,St as Ee,T as De,Tt as P,U as Oe,V as ke,Vt as Ae,X as je,Xt as Me,Y as Ne,Yt as Pe,Z as Fe,_ as Ie,a as Le,at as Re,b as ze,c as Be,ct as Ve,dt as He,et as Ue,ft as We,g as Ge,h as Ke,ht as qe,i as Je,it as Ye,j as Xe,k as Ze,ln as Qe,lt as $e,m as et,mt as tt,n as nt,nt as rt,o as it,ot as at,p as ot,pt as st,q as ct,qt as lt,r as F,rt as I,s as ut,sn as dt,st as ft,t as pt,tt as mt,u as ht,ut as gt,v as _t,vt,w as yt,wt as bt,x as xt,y as St,z as Ct,zt as wt}from"./_DBbja6xF.js";var Tt=`diffs-container`,Et=(()=>{try{return!1}catch{return!1}})(),Dt=/(?=^From [a-f0-9]+ .+$)/m,Ot=/(?=^diff --git)/gm,kt=/(?<=\n)/,At=/^(---|\+\+\+)\s+([^\t\r\n]+)/,jt=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,Mt=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,Nt=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Pt=`header-prefix`,Ft=`header-filename-suffix`,It=`header-metadata`,Lt=`header-custom`,L={dark:`pierre-dark`,light:`pierre-light`},Rt=`data-theme-css`,zt=`data-unsafe-css`,Bt=`data-diffs-scrollbar-measure`,Vt=`data-diffs-code-view-header`,Ht=`data-diffs-code-view-footer`,Ut=`--diffs-scrollbar-gutter-measured`,Wt=1e5,Gt={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},Kt={...Gt,hunkLineCount:1},qt={paddingTop:8,paddingBottom:8,gap:8},Jt={omega:.015,positionEpsilon:.5,velocityEpsilon:.05},Yt=Object.freeze({fromStart:0,fromEnd:0}),Xt={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},Zt={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},Qt=new Set,$t=null;function en(e){Qt.add(e),$t??=requestAnimationFrame(nn)}function tn(e){Qt.delete(e)&&Qt.size===0&&$t!=null&&(cancelAnimationFrame($t),$t=null)}function nn(e){let t=new Set(Qt);Qt.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}$t=Qt.size>0?requestAnimationFrame(nn):null}function rn(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 an(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function on(e,t){let n=e?.theme??L,r=t?.theme??L,i=sn(e),a=sn(t);return an(n,r)&&rn(e,t,[`theme`,`parseDiffOptions`])&&rn(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 ln({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 un(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function dn(e){return{type:`text`,value:e}}function R({tagName:e,children:t=[],properties:n={}}){return{type:`element`,tagName:e,properties:n,children:t}}function fn({name:e,width:t=16,height:n=16,properties:r}){return R({tagName:`svg`,properties:{width:t,height:n,viewBox:`0 0 16 16`,...r},children:[R({tagName:`use`,properties:{href:`#${e.replace(/^#/,``)}`}})]})}function pn(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 mn(e){return R({tagName:`div`,properties:{"data-gutter":``},children:e})}function hn(e,t,n,r={}){return R({tagName:`div`,properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t==null?void 0:[R({tagName:`span`,properties:{"data-line-number-content":``},children:[dn(`${t}`)]})]})}function gn(e,t,n){return R({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 _n(){return R({tagName:`button`,properties:{"data-utility-button":``,type:`button`},children:[fn({name:`diffs-icon-plus`,properties:{"data-icon":``}})]})}function vn(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function yn(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 bn=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],xn=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};xn.prototype.normal={},xn.prototype.property={},xn.prototype.space=void 0;function Sn(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new xn(n,r,t)}function Cn(e){return e.toLowerCase()}var wn=class{constructor(e,t){this.attribute=t,this.property=e}};wn.prototype.attribute=``,wn.prototype.booleanish=!1,wn.prototype.boolean=!1,wn.prototype.commaOrSpaceSeparated=!1,wn.prototype.commaSeparated=!1,wn.prototype.defined=!1,wn.prototype.mustUseProperty=!1,wn.prototype.number=!1,wn.prototype.overloadedBoolean=!1,wn.prototype.property=``,wn.prototype.spaceSeparated=!1,wn.prototype.space=void 0;var Tn=e({boolean:()=>z,booleanish:()=>Dn,commaOrSpaceSeparated:()=>An,commaSeparated:()=>kn,number:()=>B,overloadedBoolean:()=>On,spaceSeparated:()=>V}),En=0,z=jn(),Dn=jn(),On=jn(),B=jn(),V=jn(),kn=jn(),An=jn();function jn(){return 2**++En}var Mn=Object.keys(Tn),Nn=class extends wn{constructor(e,t,n,r){let i=-1;if(super(e,t),Pn(this,`space`,r),typeof n==`number`)for(;++i<Mn.length;){let e=Mn[i];Pn(this,Mn[i],(n&Tn[e])===Tn[e])}}};Nn.prototype.defined=!0;function Pn(e,t,n){n&&(e[t]=n)}function Fn(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Nn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Cn(r)]=r,n[Cn(a.attribute)]=r}return new xn(t,n,e.space)}var In=Fn({properties:{ariaActiveDescendant:null,ariaAtomic:Dn,ariaAutoComplete:null,ariaBusy:Dn,ariaChecked:Dn,ariaColCount:B,ariaColIndex:B,ariaColSpan:B,ariaControls:V,ariaCurrent:null,ariaDescribedBy:V,ariaDetails:null,ariaDisabled:Dn,ariaDropEffect:V,ariaErrorMessage:null,ariaExpanded:Dn,ariaFlowTo:V,ariaGrabbed:Dn,ariaHasPopup:null,ariaHidden:Dn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:V,ariaLevel:B,ariaLive:null,ariaModal:Dn,ariaMultiLine:Dn,ariaMultiSelectable:Dn,ariaOrientation:null,ariaOwns:V,ariaPlaceholder:null,ariaPosInSet:B,ariaPressed:Dn,ariaReadOnly:Dn,ariaRelevant:null,ariaRequired:Dn,ariaRoleDescription:V,ariaRowCount:B,ariaRowIndex:B,ariaRowSpan:B,ariaSelected:Dn,ariaSetSize:B,ariaSort:null,ariaValueMax:B,ariaValueMin:B,ariaValueNow:B,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Ln(e,t){return t in e?e[t]:t}function Rn(e,t){return Ln(e,t.toLowerCase())}var zn=Fn({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:kn,acceptCharset:V,accessKey:V,action:null,allow:null,allowFullScreen:z,allowPaymentRequest:z,allowUserMedia:z,alpha:z,alt:null,as:null,async:z,autoCapitalize:null,autoComplete:V,autoFocus:z,autoPlay:z,blocking:V,capture:null,charSet:null,checked:z,cite:null,className:V,closedBy:null,colorSpace:null,cols:B,colSpan:B,command:null,commandFor:null,content:null,contentEditable:Dn,controls:z,controlsList:V,coords:B|kn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:z,defer:z,dir:null,dirName:null,disabled:z,download:On,draggable:Dn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:z,formTarget:null,headers:V,height:B,hidden:On,high:B,href:null,hrefLang:null,htmlFor:V,httpEquiv:V,id:null,imageSizes:null,imageSrcSet:null,inert:z,inputMode:null,integrity:null,is:null,isMap:z,itemId:null,itemProp:V,itemRef:V,itemScope:z,itemType:V,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:z,low:B,manifest:null,max:null,maxLength:B,media:null,method:null,min:null,minLength:B,multiple:z,muted:z,name:null,nonce:null,noModule:z,noValidate:z,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:z,optimum:B,pattern:null,ping:V,placeholder:null,playsInline:z,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:z,referrerPolicy:null,rel:V,required:z,reversed:z,rows:B,rowSpan:B,sandbox:V,scope:null,scoped:z,seamless:z,selected:z,shadowRootClonable:z,shadowRootCustomElementRegistry:z,shadowRootDelegatesFocus:z,shadowRootMode:null,shadowRootSerializable:z,shape:null,size:B,sizes:null,slot:null,span:B,spellCheck:Dn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:B,step:null,style:null,tabIndex:B,target:null,title:null,translate:null,type:null,typeMustMatch:z,useMap:null,value:Dn,width:B,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:V,axis:null,background:null,bgColor:null,border:B,borderColor:null,bottomMargin:B,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:z,declare:z,event:null,face:null,frame:null,frameBorder:null,hSpace:B,leftMargin:B,link:null,longDesc:null,lowSrc:null,marginHeight:B,marginWidth:B,noResize:z,noHref:z,noShade:z,noWrap:z,object:null,profile:null,prompt:null,rev:null,rightMargin:B,rules:null,scheme:null,scrolling:Dn,standby:null,summary:null,text:null,topMargin:B,valueType:null,version:null,vAlign:null,vLink:null,vSpace:B,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:z,disablePictureInPicture:z,disableRemotePlayback:z,exportParts:kn,part:V,prefix:null,property:null,results:B,security:null,unselectable:null},space:`html`,transform:Rn}),Bn=Fn({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:An,accentHeight:B,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:B,amplitude:B,arabicForm:null,ascent:B,attributeName:null,attributeType:null,azimuth:B,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:B,by:null,calcMode:null,capHeight:B,className:V,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:B,diffuseConstant:B,direction:null,display:null,dur:null,divisor:B,dominantBaseline:null,download:z,dx:null,dy:null,edgeMode:null,editable:null,elevation:B,enableBackground:null,end:null,event:null,exponent:B,externalResourcesRequired:null,fill:null,fillOpacity:B,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:kn,g2:kn,glyphName:kn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:B,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:B,horizOriginX:B,horizOriginY:B,id:null,ideographic:B,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:B,k:B,k1:B,k2:B,k3:B,k4:B,kernelMatrix:An,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:B,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:B,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:B,overlineThickness:B,paintOrder:null,panose1:null,path:null,pathLength:B,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:V,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:B,pointsAtY:B,pointsAtZ:B,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:An,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:An,rev:An,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:An,requiredFeatures:An,requiredFonts:An,requiredFormats:An,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:B,specularExponent:B,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:B,strikethroughThickness:B,string:null,stroke:null,strokeDashArray:An,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:B,strokeOpacity:B,strokeWidth:null,style:null,surfaceScale:B,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:An,tabIndex:B,tableValues:null,target:null,targetX:B,targetY:B,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:An,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:B,underlineThickness:B,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:B,values:null,vAlphabetic:B,vMathematical:B,vectorEffect:null,vHanging:B,vIdeographic:B,version:null,vertAdvY:B,vertOriginX:B,vertOriginY:B,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:B,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Ln}),Vn=Fn({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()}}),Hn=Fn({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Rn}),Un=Fn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Wn=/[A-Z]/g,Gn=/-[a-z]/g,Kn=/^data[-\w.:]+$/i;function qn(e,t){let n=Cn(t),r=t,i=wn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Kn.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Gn,Yn);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Gn.test(e)){let n=e.replace(Wn,Jn);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Nn}return new i(r,t)}function Jn(e){return`-`+e.toLowerCase()}function Yn(e){return e.charAt(1).toUpperCase()}var Xn=Sn([In,zn,Vn,Hn,Un],`html`),Zn=Sn([In,Bn,Vn,Hn,Un],`svg`),Qn={}.hasOwnProperty;function $n(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&Qn.call(t,e)){let n=String(t[e]);i=Qn.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 er=/["&'<>`]/g,tr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,nr=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,rr=/[|\\{}()[\]^$+*?.]/g,ir=new WeakMap;function ar(e,t){if(e=e.replace(t.subset?or(t.subset):er,r),t.subset||t.escapeOnly)return e;return e.replace(tr,n).replace(nr,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 or(e){let t=ir.get(e);return t||(t=sr(e),ir.set(e,t)),t}function sr(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(rr,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var cr=/[\dA-Fa-f]/;function lr(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!cr.test(String.fromCharCode(t))?r:r+`;`}var ur=/\d/;function dr(e,t,n){let r=`&#`+String(e);return n&&t&&!ur.test(String.fromCharCode(t))?r:r+`;`}var fr=`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(`.`),pr={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:`€`},mr=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],hr={}.hasOwnProperty,gr={},_r;for(_r in pr)hr.call(pr,_r)&&(gr[pr[_r]]=_r);var vr=/[^\dA-Za-z]/;function yr(e,t,n,r){let i=String.fromCharCode(e);if(hr.call(gr,i)){let e=gr[i],a=`&`+e;return n&&fr.includes(e)&&!mr.includes(e)&&(!r||t&&t!==61&&vr.test(String.fromCharCode(t)))?a:a+`;`}return``}function br(e,t,n){let r=lr(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=yr(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=dr(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function xr(e,t){return ar(e,Object.assign({format:br},t))}var Sr=/^>|^->|<!--|-->|--!>|<!-$/g,Cr=[`>`],wr=[`<`,`>`];function Tr(e,t,n,r){return r.settings.bogusComments?`<?`+xr(e.value,Object.assign({},r.settings.characterReferences,{subset:Cr}))+`>`:`<!--`+e.value.replace(Sr,i)+`-->`;function i(e){return xr(e,Object.assign({},r.settings.characterReferences,{subset:wr}))}}function Er(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function Dr(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 Or(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function kr(e){return e.join(` `).trim()}var Ar=/[ \t\n\f\r]/g;function jr(e){return typeof e==`object`?e.type===`text`&&Mr(e.value):Mr(e)}function Mr(e){return e.replace(Ar,``)===``}var Nr=Ir(1),Pr=Ir(-1),Fr=[];function Ir(e){return t;function t(t,n,r){let i=t?t.children:Fr,a=(n||0)+e,o=i[a];if(!r)for(;o&&jr(o);)a+=e,o=i[a];return o}}var Lr={}.hasOwnProperty;function Rr(e){return t;function t(t,n,r){return Lr.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var zr=Rr({body:Hr,caption:Br,colgroup:Br,dd:Kr,dt:Gr,head:Br,html:Vr,li:Wr,optgroup:Jr,option:Yr,p:Ur,rp:qr,rt:qr,tbody:Zr,td:ei,tfoot:Qr,th:ei,thead:Xr,tr:$r});function Br(e,t,n){let r=Nr(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&jr(r.value.charAt(0)))}function Vr(e,t,n){let r=Nr(n,t);return!r||r.type!==`comment`}function Hr(e,t,n){let r=Nr(n,t);return!r||r.type!==`comment`}function Ur(e,t,n){let r=Nr(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 Wr(e,t,n){let r=Nr(n,t);return!r||r.type===`element`&&r.tagName===`li`}function Gr(e,t,n){let r=Nr(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function Kr(e,t,n){let r=Nr(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function qr(e,t,n){let r=Nr(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function Jr(e,t,n){let r=Nr(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function Yr(e,t,n){let r=Nr(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function Xr(e,t,n){let r=Nr(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function Zr(e,t,n){let r=Nr(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function Qr(e,t,n){return!Nr(n,t)}function $r(e,t,n){let r=Nr(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function ei(e,t,n){let r=Nr(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var ti=Rr({body:ii,colgroup:ai,head:ri,html:ni,tbody:oi});function ni(e){let t=Nr(e,-1);return!t||t.type!==`comment`}function ri(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 ii(e){let t=Nr(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&jr(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function ai(e,t,n){let r=Pr(n,t),i=Nr(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&zr(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function oi(e,t,n){let r=Pr(n,t),i=Nr(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&zr(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
@@ -1525,10 +1525,10 @@ diff --git`)}function Qg(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.star
1525
1525
  `);return t?n.pop():n.push(n.pop().slice(0,-1)),n}var P_=`/dev/null`;function F_(e,t,n,r=!1){if(e===null&&t===null)throw Error(`parseDiffFromFile: You must pass oldFile, newFile, or both`);let i=e??I_(),a=t??I_(),o=Pg(M_(i.name,a.name,i.contents,a.contents,i.header,a.header,n),{cacheKey:(()=>{let n=e?.cacheKey,r=t?.cacheKey;return n!=null&&r!=null?og(`diff`,n,r):void 0})(),oldFile:i,newFile:a,throwOnError:r});if(o==null)throw Error(`parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?`);e===null?(o.type=`new`,o.prevName=void 0):t===null&&(o.type=`deleted`,o.prevName=void 0);let s=t?.lang??(t===null?e?.lang:void 0);return s!=null&&(o.lang=s),o}function I_(){return{name:P_,contents:``}}var L_=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&=(this.codeDeletions?.removeEventListener(`scroll`,this.handleDeletionsScroll),this.codeAdditions?.removeEventListener(`scroll`,this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,!1)}setup(e,t,n){if(t==null||n==null)for(let r of e.children??[])r instanceof HTMLElement&&(`deletions`in r.dataset?t=r:`additions`in r.dataset&&(n=r));if(n==null||t==null){this.cleanUp();return}this.codeDeletions!==t&&(this.codeDeletions?.removeEventListener(`scroll`,this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener(`scroll`,this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==n&&(this.codeAdditions?.removeEventListener(`scroll`,this.handleAdditionsScroll),this.codeAdditions=n,n.addEventListener(`scroll`,this.handleAdditionsScroll,{passive:!0})),this.enabled=!0}handleDeletionsScroll=()=>{this.isAdditionsScrolling||(this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft}))};handleAdditionsScroll=()=>{this.isDeletionsScrolling||(this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft}))}};function R_(e,t){return an(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function z_(e){return R({tagName:`div`,properties:{"data-content-buffer":``,"data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function B_(e){return R({tagName:`div`,children:[R({tagName:`span`,children:[dn(`No newline at end of file`)]})],properties:{"data-no-newline":``,"data-line-type":e,"data-column-content":``}})}function V_(e){return R({tagName:`div`,children:[fn({name:e===`both`?`diffs-icon-expand-all`:`diffs-icon-expand`,properties:{"data-icon":``}})],properties:{role:`button`,"data-expand-button":``,"data-expand-both":e===`both`?``:void 0,"data-expand-up":e===`up`?``:void 0,"data-expand-down":e===`down`?``:void 0}})}function H_({type:e,content:t,expandIndex:n,chunked:r=!1,slotName:i,isFirstHunk:a,isLastHunk:o}){let s=0,c=[];if(e===`metadata`&&t!=null&&c.push(R({tagName:`div`,children:[dn(t)],properties:{"data-separator-wrapper":``}})),(e===`line-info`||e===`line-info-basic`)&&t!=null){let e=[];n!=null&&(r?(a||(e.push(V_(`up`)),s++),o||(e.push(V_(`down`)),s++)):(e.push(V_(!a&&!o?`both`:a?`down`:`up`)),s++)),e.push(R({tagName:`div`,children:[R({tagName:`span`,children:[dn(t)],properties:{"data-unmodified-lines":``}})],properties:{"data-separator-content":``}})),r&&n!=null&&e.push(R({tagName:`div`,children:[dn(`Expand all`)],properties:{role:`button`,"data-expand-button":``,"data-expand-all-button":``}})),c.push(R({tagName:`div`,children:e,properties:{"data-separator-wrapper":``,"data-separator-multi-button":s>1?``:void 0}}))}return e===`custom`&&i!=null&&c.push(R({tagName:`slot`,properties:{name:i}})),R({tagName:`div`,children:c,properties:{"data-separator":c.length===0?`simple`:e,"data-expand-index":n,"data-separator-first":a?``:void 0,"data-separator-last":o?``:void 0}})}function U_(e,t){return`hunk-separator-${e}-${t}`}function W_(e){let t=e.at(-1);return t==null?0:Math.max(ig(t.additionStart,t.additionCount),ig(t.deletionStart,t.deletionCount))}function G_({line:e,spanStart:t,spanLength:n}){return{start:{line:e,character:t},end:{line:e,character:t+n},properties:{"data-diff-span":``},alwaysWrap:!0}}function K_({item:e,arr:t,enableJoin:n,isNeutral:r=!1,isLastItem:i=!1}){let a=t[t.length-1];if(a==null||i||!n){t.push([+!r,e.value]);return}let o=a[0]===0;if(r===o||r&&e.value.length===1&&!o){a[1]+=e.value;return}t.push([+!r,e.value])}function q_(e){return[rg(e.additionStart,e.additionCount)+1,ig(e.additionStart,e.additionCount)+1]}function J_({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:r,collapsedContextThreshold:i}){let a=Math.max(t,0);if(a===0||e)return{fromStart:0,fromEnd:0,rangeSize:a,collapsedLines:a,renderAll:!1};if(n===!0||a<=i)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(r),s=Math.min(Math.max(o?.fromStart??0,0),a),c=Math.min(Math.max(o?.fromEnd??0,0),a),l=s+c,u=l>=a;return{fromStart:u?a:s,fromEnd:u?0:c,rangeSize:a,collapsedLines:Math.max(a-l,0),renderAll:u}}function Y_(e){let t=e.hunks[e.hunks.length-1];if(t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return!1;let n=e.additionLines.length-ig(t.additionStart,t.additionCount),r=e.deletionLines.length-ig(t.deletionStart,t.deletionCount);return n<=0&&r<=0?!1:n!==r}function X_({fileDiff:e,errorPrefix:t}){let n=e.hunks[e.hunks.length-1];if(n==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;let r=e.additionLines.length-ig(n.additionStart,n.additionCount),i=e.deletionLines.length-ig(n.deletionStart,n.deletionCount);if(r<=0&&i<=0)return 0;if(r!==i)throw Error(`${t}: trailing context mismatch (additions=${r}, deletions=${i}) for ${e.name}`);return Math.min(r,i)}function Z_({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:i}){if(t!==e.hunks.length-1)return;let a=X_({fileDiff:e,errorPrefix:i});if(a<=0)return;if(n===!0||a<=r)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(e.hunks.length),s=Math.min(Math.max(o?.fromStart??0,0),a);return{fromStart:s,fromEnd:0,rangeSize:a,collapsedLines:a-s,renderAll:s>=a}}function Q_({fileDiff:e,lineNumber:t,expandedHunks:n,collapsedContextThreshold:r}){if(n===!0||e.isPartial)return!0;for(let[i,a]of e.hunks.entries()){let[o,s]=q_(a);if(t<o){let s=J_({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:n,hunkIndex:i,collapsedContextThreshold:r}),c=o-s.rangeSize;return s.renderAll||t<c+s.fromStart||t>=o-s.fromEnd}if(t<s)return!0}let i=Z_({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:`isAdditionLineRenderable`});if(i==null||i.renderAll)return!0;let a=e.hunks[e.hunks.length-1],[,o]=q_(a);return t<o+i.fromStart||t>=o+i.rangeSize}function $_({fileDiff:e,lineNumber:t,direction:n,expandedHunks:r,collapsedContextThreshold:i}){if(r===!0||e.isPartial)return t;let a=[],o=1;for(let[t,n]of e.hunks.entries()){let[s,c]=q_(n),l=J_({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:r,hunkIndex:t,collapsedContextThreshold:i}),u=s-l.rangeSize;l.renderAll?a.push([u,s]):(l.fromStart>0&&a.push([u,u+l.fromStart]),l.fromEnd>0&&a.push([s-l.fromEnd,s])),a.push([s,c]),o=c}let s=Z_({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:r,collapsedContextThreshold:i,errorPrefix:`getNearestRenderableAdditionLine`});if(s!=null){let e=o;o=e+s.rangeSize,s.renderAll?a.push([e,o]):s.fromStart>0&&a.push([e,e+s.fromStart])}if(t>=o)return t;if(n===`down`){for(let[e,n]of a)if(n>t)return Math.max(e,t);return}for(let e=a.length-1;e>=0;e--){let[n,r]=a[e];if(n<=t)return Math.min(r-1,t)}}function ev({type:e,metrics:t}){return t.hunkSeparatorHeight??qh(e)}function tv({type:e,metrics:t}){return e===`simple`||e===`metadata`||e===`line-info-basic`?0:t.spacing}function nv({type:e,hunkIndex:t,hunkSpecs:n}){switch(e){case`simple`:return t>0;case`metadata`:return n!=null;case`line-info`:case`line-info-basic`:case`custom`:return!0}}function rv(e){return e!==`simple`&&e!==`metadata`}function iv({type:e,metrics:t,hunkIndex:n,hunkSpecs:r}){if(!nv({type:e,hunkIndex:n,hunkSpecs:r}))return;let i=ev({type:e,metrics:t}),a=tv({type:e,metrics:t}),o=n>0?a:0,s=a;return{height:i,gapBefore:o,gapAfter:s,totalHeight:o+i+s}}function av({type:e,metrics:t}){if(!rv(e))return;let n=ev({type:e,metrics:t}),r=tv({type:e,metrics:t});return{height:n,gapBefore:r,gapAfter:0,totalHeight:r+n}}function ov({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:i,collapsedContextThreshold:a=1,callback:o}){let s=sv({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:a}),c={viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:s.splitCount,unifiedCount:s.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!c.isWindowedHighlight)return!1;let e=c.unifiedCount>=n+r,i=c.splitCount>=n+r;return t===`unified`?e:(t===`split`||e)&&i},shouldSkip(e,r){if(!c.isWindowedHighlight)return!1;let i=e>0&&c.unifiedCount+e<=n,a=r>0&&c.splitCount+r<=n;return t===`unified`?i:(t===`split`||i)&&a},incrementCounts(e,n){(t===`unified`||t===`both`)&&(c.unifiedCount+=e),(t===`split`||t===`both`)&&(c.splitCount+=n)},isInWindow(e,n){if(!c.isWindowedHighlight)return!0;let r=c.isInUnifiedWindow(e),i=c.isInSplitWindow(n);return t===`unified`?r:t===`split`?i:r||i},isInUnifiedWindow(e){return!c.isWindowedHighlight||c.unifiedCount>=n-e&&c.unifiedCount<n+r},isInSplitWindow(e){return!c.isWindowedHighlight||c.splitCount>=n-e&&c.splitCount<n+r},emit(e,n=!1){return n||(t===`unified`?c.incrementCounts(1,0):t===`split`?c.incrementCounts(0,1):c.incrementCounts(1,1)),o(e)??!1}};hunkIterator:for(let n=s.hunkIndex;n<e.hunks.length;n++){let r=e.hunks[n];if(r==null)throw Error(`iterateOverDiff: invalid hunk index`);if(c.shouldBreak())break;let o=rg(r.deletionStart,r.deletionCount),s=rg(r.additionStart,r.additionCount),l=!e.isPartial&&r.deletionCount===0?o:r.deletionLineIndex,u=!e.isPartial&&r.additionCount===0?s:r.additionLineIndex,d=J_({isPartial:e.isPartial,rangeSize:r.collapsedBefore,expandedHunks:i,hunkIndex:n,collapsedContextThreshold:a}),f=n===c.finalHunkIndex?Z_({fileDiff:e,hunkIndex:n,expandedHunks:i,collapsedContextThreshold:a,errorPrefix:`iterateOverDiff`}):void 0,p=d.fromStart+d.fromEnd;function m(e,n){return f==null||f.collapsedLines<=0||f.fromStart+f.fromEnd>0?0:t===`unified`?e===r.unifiedLineStart+r.unifiedLineCount-1?f.collapsedLines:0:n===r.splitLineStart+r.splitLineCount-1?f.collapsedLines:0}let h=d.collapsedLines===0;function g(){return h?0:(h=!0,d.collapsedLines)}if(c.shouldSkip(p,p))c.incrementCounts(p,p),g();else{let e=r.unifiedLineStart-d.rangeSize,i=r.splitLineStart-d.rangeSize,a=l-d.rangeSize,f=u-d.rangeSize,p=o+1-d.rangeSize,m=s+1-d.rangeSize;if(uv(c,d.fromStart,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:0,collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:p+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:f+t,lineNumber:m+t,noEOFCR:!1}}))||(e=r.unifiedLineStart-d.fromEnd,i=r.splitLineStart-d.fromEnd,a=l-d.fromEnd,f=u-d.fromEnd,p=o+1-d.fromEnd,m=s+1-d.fromEnd,uv(c,d.fromEnd,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:p+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:f+t,lineNumber:m+t,noEOFCR:!1}}),()=>{g()})))break hunkIterator}let _=r.unifiedLineStart,v=r.splitLineStart,y=l,b=u,x=o+1,S=s+1,C=r.hunkContent.at(-1);for(let e of r.hunkContent){if(c.shouldBreak())break hunkIterator;let i=e===C;if(e.type===`context`){if(c.shouldSkip(e.lines,e.lines))c.incrementCounts(e.lines,e.lines),g();else if(uv(c,e.lines,t,t=>{let a=i&&t===e.lines-1,o=_+t,s=v+t;return c.emit({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:m(o,s),type:`context`,deletionLine:{lineNumber:x+t,lineIndex:y+t,noEOFCR:a&&r.noEOFCRDeletions,unifiedLineIndex:o,splitLineIndex:s},additionLine:{unifiedLineIndex:o,splitLineIndex:s,lineIndex:b+t,lineNumber:S+t,noEOFCR:a&&r.noEOFCRAdditions}})},()=>{g()}))break hunkIterator;_+=e.lines,v+=e.lines,y+=e.lines,b+=e.lines,x+=e.lines,S+=e.lines}else{let a=Math.max(e.deletions,e.additions),o=e.deletions+e.additions;if(!c.shouldSkip(o,a)){let s=dv(c,e,t);(s[0]?.[0]??0)>0&&g();for(let[l,u]of s)for(let s=l;s<u;s++){let l=m(_+s,t===`unified`?v+(s<e.deletions?s:s-e.deletions):v+s);if(c.emit(fv({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:l,diffStyle:t,index:s,unifiedLineIndex:_,splitLineIndex:v,additionLineIndex:b,deletionLineIndex:y,additionLineNumber:S,deletionLineNumber:x,content:e,isLastContent:i,unifiedCount:o,splitCount:a}),!0))break hunkIterator}}g(),c.incrementCounts(o,a),_+=o,v+=a,y+=e.deletions,b+=e.additions,x+=e.deletions,S+=e.additions}}if(f!=null){let{collapsedLines:n,fromStart:r,fromEnd:i}=f,a=r+i;if(uv(c,a,t,t=>{let r=t===a-1;return c.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:r?n:0,type:`context-expanded`,deletionLine:{lineNumber:x+t,lineIndex:y+t,noEOFCR:!1,unifiedLineIndex:_+t,splitLineIndex:v+t},additionLine:{unifiedLineIndex:_+t,splitLineIndex:v+t,lineIndex:b+t,lineNumber:S+t,noEOFCR:!1}})},void 0,()=>c.shouldBreak()))break hunkIterator}}}function sv({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:i}){if(n<=0||t===`both`)return{hunkIndex:0,splitCount:0,unifiedCount:0};let a=cv({diff:e,expandedHunks:r,collapsedContextThreshold:i}),o=0,s=e.hunks.length-1,c=e.hunks.length;for(;o<=s;){let e=o+s>>1,r=a[e+1];if(r==null)throw Error(`iterateOverDiff: invalid hunk prefix index`);(t===`unified`?r.unifiedCount:r.splitCount)>n?(c=e,s=e-1):o=e+1}if(c>=e.hunks.length){let t=a[e.hunks.length];if(t==null)throw Error(`iterateOverDiff: invalid terminal hunk prefix index`);return{hunkIndex:e.hunks.length,splitCount:t.splitCount,unifiedCount:t.unifiedCount}}let l=a[c];if(l==null)throw Error(`iterateOverDiff: invalid selected hunk prefix index`);return{hunkIndex:c,splitCount:l.splitCount,unifiedCount:l.unifiedCount}}function cv({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let r=0,i=0,a=e.hunks.length-1,o=[{splitCount:0,unifiedCount:0}];for(let s=0;s<e.hunks.length;s++){let c=e.hunks[s];if(c==null)throw Error(`iterateOverDiff: invalid hunk summary index`);let l=J_({isPartial:e.isPartial,rangeSize:c.collapsedBefore,expandedHunks:t,hunkIndex:s,collapsedContextThreshold:n}),u=l.fromStart+l.fromEnd;r+=u+c.splitLineCount,i+=u+c.unifiedLineCount;let d=s===a?Z_({fileDiff:e,hunkIndex:s,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`iterateOverDiff`}):void 0;if(d!=null){let e=d.fromStart+d.fromEnd;r+=e,i+=e}o.push({splitCount:r,unifiedCount:i})}return o}function lv(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];let r=[];function i(n){let i=Math.max(0,e.viewportStart-n),a=Math.min(t,e.viewportEnd-n);a>i&&r.push([i,a])}if(n!==`split`&&i(e.unifiedCount),n!==`unified`&&i(e.splitCount),r.length===0)return[0,0];let a=r[0][0],o=r[0][1];for(let e=1;e<r.length;e++){let t=r[e];a=Math.min(a,t[0]),o=Math.max(o,t[1])}return[a,o]}function uv(e,t,n,r,i,a){let[o,s]=lv(e,t,n);o>0&&(e.incrementCounts(o,o),i?.());let c=o;for(;c<t;){if(a?.()===!0)return!0;if(c>=s){e.incrementCounts(t-c,t-c);break}if(e.isInWindow(0,0)){if(r(c)===!0)return!0}else e.incrementCounts(1,1);c++}return!1}function dv(e,t,n){if(!e.isWindowedHighlight)return[[0,n===`unified`?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];let r=n!==`split`,i=n!==`unified`,a=n===`unified`?`unified`:`split`,o=[];function s(t,n){if(t+n<=e.viewportStart||t>=e.viewportEnd)return;let r=Math.max(0,e.viewportStart-t),i=Math.min(n,e.viewportEnd-t);return i>r?[r,i]:void 0}function c(e,n){return a===`split`?e:n===`additions`?[e[0]+t.deletions,e[1]+t.deletions]:e}function l(e,t){if(e==null)return;let[n,r]=c(e,t);r>n&&o.push([n,r])}if(r&&(l(s(e.unifiedCount,t.deletions),`deletions`),l(s(e.unifiedCount+t.deletions,t.additions),`additions`)),i&&(l(s(e.splitCount,t.deletions),`deletions`),l(s(e.splitCount,t.additions),`additions`)),o.length===0)return o;o.sort((e,t)=>e[0]-t[0]);let u=[o[0]];for(let[e,t]of o.slice(1)){let n=u[u.length-1];e<=n[1]?n[1]=Math.max(n[1],t):u.push([e,t])}return u}function fv({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,diffStyle:i,index:a,unifiedLineIndex:o,splitLineIndex:s,additionLineIndex:c,deletionLineIndex:l,additionLineNumber:u,deletionLineNumber:d,content:f,isLastContent:p,unifiedCount:m,splitCount:h}){let g=a<f.deletions?o+a:void 0,_=i===`unified`?a>=f.deletions?o+a:void 0:a<f.additions?o+f.deletions+a:void 0,v=i===`unified`?s+(a<f.deletions?a:a-f.deletions):s+a,y=a<f.deletions?l+a:void 0,b=a<f.deletions?d+a:void 0,x=i===`unified`?a>=f.deletions?c+(a-f.deletions):void 0:a<f.additions?c+a:void 0,S=i===`unified`?a>=f.deletions?u+(a-f.deletions):void 0:a<f.additions?u+a:void 0,C=i===`unified`?p&&a===f.deletions-1&&t.noEOFCRDeletions:p&&a===h-1&&t.noEOFCRDeletions,w=i===`unified`?p&&a===m-1&&t.noEOFCRAdditions:p&&a===h-1&&t.noEOFCRAdditions,T=y!=null&&b!=null&&g!=null?{lineNumber:b,lineIndex:y,noEOFCR:C,unifiedLineIndex:g,splitLineIndex:v}:void 0,E=x!=null&&S!=null&&_!=null?{unifiedLineIndex:_,splitLineIndex:v,lineIndex:x,lineNumber:S,noEOFCR:w}:void 0;if(T==null&&E!=null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:void 0,additionLine:E};if(T!=null&&E==null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:T,additionLine:void 0};if(T==null||E==null)throw Error(`iterateOverDiff: missing change line data`);return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:T,additionLine:E}}var pv={forcePlainText:!1};function mv(e,t,n,{forcePlainText:r,startingLine:i,totalLines:a,expandedHunks:o,collapsedContextThreshold:s=1}=pv){r?(i??=0,a??=1/0):(i=0,a=1/0);let c=i>0||a<1/0,l=typeof n.theme==`string`?t.getTheme(n.theme).type:void 0,u=Am({theme:n.theme,highlighter:t}),d=r&&!c&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?`none`:n.lineDiffType,f={deletionLines:[],additionLines:[]},{maxLineDiffLength:p}=n,m=!r&&!e.isPartial,h=r?o:void 0,g=new Map;function _(e){let t=m?0:e,n=g.get(t)??gv();return g.set(t,n),n}function v(e,t,n,r){if(c){let e=n.at(-1);(e==null||e.targetIndex+e.count!==t)&&(e={targetIndex:t,originalOffset:r.length,count:0},n.push(e)),e.count++}r.push(e)}ov({diff:e,diffStyle:`both`,startingLine:i,totalLines:a,expandedHunks:!c||h,collapsedContextThreshold:s,callback:({hunkIndex:t,additionLine:n,deletionLine:r,type:i})=>{let a=_(t),o=n==null?r.splitLineIndex:n.splitLineIndex;i===`change`&&n!=null&&r!=null&&hv({additionLine:e.additionLines[n.lineIndex],deletionLine:e.deletionLines[r.lineIndex],deletionLineIndex:a.deletionContent.length,additionLineIndex:a.additionContent.length,deletionDecorations:a.deletionDecorations,additionDecorations:a.additionDecorations,lineDiffType:d,maxLineDiffLength:p}),r!=null&&(v(e.deletionLines[r.lineIndex],r.lineIndex,a.deletionSegments,a.deletionContent),a.deletionInfo.push({type:i===`change`?`change-deletion`:i,lineNumber:r.lineNumber,altLineNumber:i===`change`?void 0:n.lineNumber??void 0,lineIndex:`${r.unifiedLineIndex},${o}`})),n!=null&&(v(e.additionLines[n.lineIndex],n.lineIndex,a.additionSegments,a.additionContent),a.additionInfo.push({type:i===`change`?`change-addition`:i,lineNumber:n.lineNumber,altLineNumber:i===`change`?void 0:r.lineNumber??void 0,lineIndex:`${n.unifiedLineIndex},${o}`}))}});for(let i of g.values()){if(i.deletionContent.length===0&&i.additionContent.length===0)continue;let a={name:e.prevName??e.name,contents:i.deletionContent.value},o={name:e.name,contents:i.additionContent.value},{deletionLines:s,additionLines:c}=_v({deletionFile:a,deletionInfo:i.deletionInfo,deletionDecorations:i.deletionDecorations,additionFile:o,additionInfo:i.additionInfo,additionDecorations:i.additionDecorations,highlighter:t,options:n,languageOverride:r?`text`:e.lang});if(m){f.deletionLines=s,f.additionLines=c;continue}if(i.deletionSegments.length>0)for(let e of i.deletionSegments)for(let t=0;t<e.count;t++)f.deletionLines[e.targetIndex+t]=s[e.originalOffset+t];else zm(f.deletionLines,s);if(i.additionSegments.length>0)for(let e of i.additionSegments)for(let t=0;t<e.count;t++)f.additionLines[e.targetIndex+t]=c[e.originalOffset+t];else zm(f.additionLines,c)}return{code:f,themeStyles:u,baseThemeType:l}}function hv({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:r,deletionDecorations:i,additionDecorations:a,lineDiffType:o,maxLineDiffLength:s}){if(e==null||t==null||o===`none`||(e=_g(e),t=_g(t),e.length>s||t.length>s))return;let c=o===`char`?o_(e,t):C_(e,t),l=[],u=[],d=o===`word-alt`,f=c.at(-1);for(let e of c){let t=e===f;!e.added&&!e.removed?(K_({item:e,arr:l,enableJoin:d,isNeutral:!0,isLastItem:t}),K_({item:e,arr:u,enableJoin:d,isNeutral:!0,isLastItem:t})):e.removed?K_({item:e,arr:l,enableJoin:d,isLastItem:t}):K_({item:e,arr:u,enableJoin:d,isLastItem:t})}let p=0;for(let e of l)e[0]===1&&i.push(G_({line:n,spanStart:p,spanLength:e[1].length})),p+=e[1].length;p=0;for(let e of u)e[0]===1&&a.push(G_({line:r,spanStart:p,spanLength:e[1].length})),p+=e[1].length}function gv(){return{deletionContent:{push(e){this.value+=e,this.length++},value:``,length:0},additionContent:{push(e){this.value+=e,this.length++},value:``,length:0},deletionInfo:[],additionInfo:[],deletionDecorations:[],additionDecorations:[],deletionSegments:[],additionSegments:[]}}function _v({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:r,highlighter:i,deletionDecorations:a,additionDecorations:o,languageOverride:s,options:{theme:c,...l}}){let u=s??$p(e.name),d=s??$p(t.name),{state:f,transformers:p}=mm(l.useTokenTransformer),m=typeof c==`string`?{...l,lang:`text`,theme:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:_m(`token`),tokenizeTimeLimit:0}:{...l,lang:`text`,themes:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:_m(`token`),tokenizeTimeLimit:0};return{deletionLines:e.contents===``?[]:(m.lang=u,f.lineInfo=n,m.decorations=a,Mm(i.codeToHast(_g(e.contents),m))),additionLines:t.contents===``?[]:(m.lang=d,m.decorations=o,f.lineInfo=r,Mm(i.codeToHast(_g(t.contents),m)))}}function vv(e,t){let n=F_({name:e.prevName??e.name,contents:e.deletionLines.join(``)},{name:e.name,contents:e.additionLines.join(``),lang:e.lang},t);return{hunks:n.hunks,splitLineCount:n.splitLineCount,unifiedLineCount:n.unifiedLineCount,additionLines:n.additionLines,deletionLines:n.deletionLines,type:n.type}}function yv(e,t){let n=Math.max(e,1),r=Array.from({length:n},(e,t)=>`${` `.repeat(t+1)}\n`).join(``);return r===t&&(r=Array.from({length:n},(e,t)=>`\u0000${` `.repeat(t)}\n`).join(``)),r}function bv(e){for(let t of e)if(t.trim().length>0)return!1;return!0}function xv(e,t){return t.length>0&&t.length<e.deletionLines.length&&bv(t)}function Sv(e,t,n){let r=e.deletionLines.join(``),i=yv(t.length,r),a=F_({name:e.prevName??e.name,contents:r},{name:e.name,contents:i,lang:e.lang},n);return{hunks:a.hunks,splitLineCount:a.splitLineCount,unifiedLineCount:a.unifiedLineCount,additionLines:t,deletionLines:a.deletionLines,type:a.type}}function Cv(e,t){return Sv(e,[``],t)}function wv(e,t){if(e.additionLines.length===0)return Cv(e,t);if(xv(e,e.additionLines))return Sv(e,e.additionLines,t);let n=e.additionLines,r=vv(e,t);return Ev(r,n),r}function Tv(e){return e.length>1&&e.at(-1)===``}function Ev(e,t){if(!Tv(t))return;let n=t.length-e.additionLines.length;if(n<=0)return;let r=e.additionLines.length,i=e.hunks.at(-1);if(i!=null&&ig(i.additionStart,i.additionCount)===r){for(let a of i.hunkContent)if(a.type===`change`&&a.additions<a.deletions&&a.additionLineIndex+a.additions===r){e.additionLines=t,a.additions+=n,i.additionCount+=n,i.additionLines+=n,Iv(e);return}}}function Dv(e,t,n){if(e.isPartial||e.deletionLines.length!==e.additionLines.length)return Ov(e,vv(e,n));let r=Array.from(t);if(r.length===0)return Ov(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type});for(let t of r){let r=e.additionLines[t],i=e.deletionLines[t];if(r==null||i==null||_g(r)===_g(i))return Ov(e,vv(e,n))}let i=kv(e,r);if(i.size===0)return Ov(e,vv(e,n));for(let t of i)if(!jv(e,t,n))return Ov(e,vv(e,n));return Iv(e),Y_(e)?Ov(e,vv(e,n)):Ov(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type})}function Ov(e,t){return Object.assign(e,t),t}function kv(e,t){let n=new Set;for(let r of t){let t=Av(e,r);if(t==null)return new Set;n.add(t)}return n}function Av(e,t){for(let[n,r]of e.hunks.entries()){let e=r.additionLineIndex+r.additionCount;if(t>=r.additionLineIndex&&t<e)return n}}function jv(e,t,n){let r=e.hunks[t];if(r==null)return!1;let i=e.deletionLines.slice(r.deletionLineIndex,r.deletionLineIndex+r.deletionCount),a=e.additionLines.slice(r.additionLineIndex,r.additionLineIndex+r.additionCount),o=F_({name:e.prevName??e.name,contents:i.join(``)},{name:e.name,contents:a.join(``),lang:e.lang},{...n,context:0}),s=o.hunks[0];return s==null||o.hunks.length!==1?!1:(Nv(r,s),Mv(e,t),!0)}function Mv(e,t){let n=e.hunks[t];if(n==null)return;if(t!==e.hunks.length-1){n.noEOFCRAdditions=!1,n.noEOFCRDeletions=!1;return}let r=e.additionLines.at(-1),i=e.deletionLines.at(-1);n.noEOFCRAdditions=r!=null&&r!==``&&!r.endsWith(`
1526
1526
  `),n.noEOFCRDeletions=i!=null&&i!==``&&!i.endsWith(`
1527
1527
  `)}function Nv(e,t){let n=e.additionLineIndex,r=e.deletionLineIndex;e.hunkContent=t.hunkContent.map(e=>Pv(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,Fv(e)}function Pv(e,t,n){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+n}}function Fv(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 Iv(e){let t=0,n=0,r=0;for(let i of e.hunks)i.collapsedBefore=Math.max(rg(i.additionStart,i.additionCount)-r,0),i.splitLineStart=t+i.collapsedBefore,i.unifiedLineStart=n+i.collapsedBefore,Fv(i),t+=i.collapsedBefore+i.splitLineCount,n+=i.collapsedBefore+i.unifiedLineCount,r=ig(i.additionStart,i.additionCount);if(e.hunks.length>0){let r=e.hunks[e.hunks.length-1],i=Math.max(e.additionLines.length-ig(r.additionStart,r.additionCount),0);t+=i,n+=i}e.splitLineCount=t,e.unifiedLineCount=n}var Lv=new WeakMap;function Rv(e){return e.length>1&&e[e.length-1]===``?e.slice(0,-1):e}function zv(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 Bv(e,t){let n=e.hunks,r=e.additionLines,i=Rv(r),a=i===r?e:{...e,additionLines:i},o=Xv(n,Yv(a,t),e.deletionLines.length),s=$v(a,o);if(e.additionLines=i,e.hunks=s,e.editSessionDirty=!0,ly(e),Ev(e,r),ny(n,e.hunks))return{regions:o.map(e=>e.previousSpan)}}function Vv(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<ay(e)+e.additionCount)break;s++}let r=a[s],i=r==null?void 0:ay(r);if(i==null||t<i||o!=null&&o!==s)return Bv(e,n);o=s}if(o!=null){if(Hv(e,i,o,r,n)){e.editSessionDirty=!0;return}return Bv(e,n)}}function Hv(e,t,n,r,i){if(r==null||i?.ignoreWhitespace===!0||i?.stripTrailingCr===!0)return!1;let a=Uv(e),o=e.hunks[n];if(o.hunkContent.some(Wv))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 Uv(e){let t=Lv.get(e);if(t?.lines===e.deletionLines)return t.set;let n=new Set(e.deletionLines);return Lv.set(e,{lines:e.deletionLines,set:n}),n}function Wv(e){return e?.type===`change`&&(e.additions===0||e.deletions===0)}function Gv(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 Kv(e,t,n){let r=[];if(e.isPartial)return r;for(let[i,a]of e.hunks.entries()){let o=J_({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:t,hunkIndex:i,collapsedContextThreshold:n});if(o.rangeSize<=n)continue;let s=oy(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=Z_({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=oy(t)+t.deletionCount;r.push([n,n+i.fromStart])}return r}function qv(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=oy(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,oy(i)+i.deletionCount,e.deletionLines.length),n}function Jv(e,t){return e.editSessionDirty===!0&&(delete e.editSessionDirty,Object.assign(e,e.additionLines.length<=1&&e.additionLines.join(``)===``?vv(e,t):wv(e,t)),!0)}function Yv(e,t){if(zv(e.deletionLines,e.additionLines)==null)return[];let n=F_({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=Pv(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 Xv(e,t,n){let r=e.map((e,t)=>{let n=oy(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&&Zv(t,o,i[i.length-1])?i.pop():void 0;for(;a<r.length&&r[a].deletionStart<=o;)s=Qv(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 Zv(e,t,n){return e<=n.deletionEnd&&t>=n.deletionStart}function Qv(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 $v(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`);ty(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`);ty(s,c,i,r),r+=c,i+=c,n.push(ey(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 ey(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:sy(t.additionStart,r),additionCount:r,additionLines:a,additionLineIndex:cy(t.additionStart,r),deletionStart:sy(t.deletionStart,i),deletionCount:i,deletionLines:o,deletionLineIndex:cy(t.deletionStart,i),hunkContent:n,hunkSpecs:`@@ -${sy(t.deletionStart,i)},${i} +${sy(t.additionStart,r)},${r} @@`,splitLineStart:0,splitLineCount:0,unifiedLineStart:0,unifiedLineCount:0,noEOFCRAdditions:!1,noEOFCRDeletions:!1};return Fv(s),s}function ty(e,t,n,r){t>0&&e.push({type:`context`,lines:t,additionLineIndex:n,deletionLineIndex:r})}function ny(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(oy(r)!==oy(i)||r.deletionCount!==i.deletionCount||ay(r)!==ay(i)||r.additionCount!==i.additionCount||r.splitLineCount!==i.splitLineCount||!ry(r,i))return!0}return!1}function ry(e,t){let n=iy(e),r=iy(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*iy(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 ay(e){return rg(e.additionStart,e.additionCount)}function oy(e){return rg(e.deletionStart,e.deletionCount)}function sy(e,t){return t===0?e:e+1}function cy(e,t){return t===0?e-1:e}function ly(e){Iv(e);for(let t=0;t<e.hunks.length;t++)Mv(e,t)}function uy(e){let t=e.lang??$p(e.name),n=e.lang??(e.prevName==null?`text`:$p(e.prevName));return t===`text`&&n===`text`}var dy=-1,fy=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:L},t=rm,n,r){this.options=e,this.annotationSlotName=t,this.onRenderUpdate=n,this.workerManager=r,r?.isWorkingPool()!==!0&&(this.highlighter=zp(e.theme??L)?Ip():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,Cv(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&&W(r.diff,t),{result:c}=r;if(!r.highlighted||c==null||!R_(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||!W(t.diff,e)||uy(e)||wy(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||!W(n,e)||!W(r.diff,e)||this.editSessionActive)return;let{options:i}=this.getRenderOptions(n);R_(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)??Yt}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=_g(u);s==null&&i&&(a.additionLines[t]=Ym(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,Cv(a,this.options.parseDiffOptions)),u=!0;else if(xv(a,a.additionLines))this.applyRecomputePreservingSessionType(a,Sv(a,a.additionLines,this.options.parseDiffOptions)),u=!0;else{let e=Vv(a,c,this.options.parseDiffOptions,l);this.applyExpansionRemap(e),u=e!=null}}else Object.assign(a,Dv(a,c,this.options.parseDiffOptions))}return i.baseThemeType=t,r.isDirty=!0,u}applyExpansionRemap(e){e!=null&&(this.expandedHunks=Gv(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=Cy(e),i.code.additionLines=xy(a,r.additionLines,i.code.additionLines,e),r.additionLines.length<=1&&r.additionLines.join(``)===``?(this.applyRecomputePreservingSessionType(r,Cv(r,this.options.parseDiffOptions)),i.code.additionLines[0]=Sy(0,e.getLineText(0))):this.editSessionActive?this.applySessionDocumentChange(r):Object.assign(r,wv(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(xv(e,n)){this.applyRecomputePreservingSessionType(e,Sv(e,n,t));return}this.applyExpansionRemap(Bv(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=>Up(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=L,headerRenderMode:g=`default`,tokenizeMaxLineLength:_=1e3,tokenizeMaxLength:v=Wt,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 Fp(nm(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=wy(e,this.getTokenizeMaxLength()),r=this.workerManager?.getDiffResultCache(e);r!=null&&!R_(t,r.options)&&(r=void 0),this.renderCache??={diff:e,hydrated:!0,highlighted:!n&&!uy(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??$p(e.name),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??L}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||!W(e,n.diff)||!R_(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(W(this.renderCache.diff,e))return this.renderCache.diff;let n=!(e.additionLines.length>0||e.deletionLines.length>0)||uy(e)||wy(e,this.getTokenizeMaxLength());return this.canRenderDiff(e,t,n)?e:this.renderCache.diff}canRenderDiff(e,t,n){let{renderCache:r}=this;return r==null||W(r.diff,e)?!0:n?r.result==null&&r.hydrated!==!0||this.workerManager?.isWorkingPool()===!0||this.highlighter!=null&&zp(t.theme):r.result==null&&r.hydrated!==!0?!0:!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?!r.highlighted:this.highlighter!=null&&zp(t.theme)}renderDiff(e=this.diff,t=Xt){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||uy(e)||wy(e,this.getTokenizeMaxLength()),l=this.canRenderDiff(e,i,c),u=!W(e,this.renderCache.diff),d=!Hp(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){let o=this.renderCache.result==null&&this.renderCache.highlighted&&!c&&!u&&im(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,im(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??$p(e.name);let t=this.highlighter!=null&&zp(i.theme),n=this.highlighter!=null&&ra(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=Xt){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 Jp({type:`diff`,diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){let t=wy(e,this.getTokenizeMaxLength());this.computedLang=t?`text`:e.lang??$p(e.name);let n=this.highlighter!=null&&zp(this.getLocalHighlightTheme()),r=t||this.highlighter!=null&&ra(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=mv(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(ov({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]=Sy(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||!W(i,e)||!R_(n,this.getRenderOptions(i).options)||(a.result==null||!a.highlighted||!R_(a.options,n)||!W(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||!R_(t,n.options)))return n}getReadyRenderResult(e,t){let{pendingHighlightResult:n}=this;if(n!=null&&W(n.diff,e)&&R_(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&&W(e,n.diff)&&R_(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=Ty(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:mn(),deletionsGutterAST:mn(),additionsGutterAST:mn(),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=X_({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`,gn(void 0,`buffer`,this.size)),h?.push(z_(this.size))):(x.pushToGutter(`deletions`,gn(void 0,`buffer`,this.size)),g?.push(z_(this.size))),this.size=0,this.side=void 0}}},w=(e,t,n,r,i)=>{x.pushToGutter(e,hn(t,n,r,i))};function T(e){C.flush(),a===`unified`?vy(`unified`,e,x):(vy(`deletions`,e,x),vy(`additions`,e,x))}this.pushFileLevelAnnotations(e,a,t,x),ov({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&&hy(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=yy(r,u.contentProperties,d&&s!=null?{"data-line":s.lineNumber,"data-line-index":`${f},${l}`}:void 0)):i=yy(i,u.contentProperties,d&&o!=null?{"data-line":o.lineNumber,"data-line-index":`${f},${l}`}:void 0),_y({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&&hy(n.after,x)}else{let n=this.getSplitInjectedRowsForLine?.(g);n?.before!=null&&gy(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=yy(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=yy(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)}_y({diffStyle:`split`,type:c,additionLine:i,deletionLine:r,...p,createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&gy(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(B_(e)),x.pushToGutter(`unified`,gn(e,`metadata`,1))):(x.deletionsContentAST.push(B_(e)),x.pushToGutter(`deletions`,gn(e,`metadata`,1)),k||(x.pushToGutter(`additions`,gn(void 0,`buffer`,1)),x.additionsContentAST.push(z_(1))))}if(k){let e=c===`context`||c===`context-expanded`?c:`change-addition`;a===`unified`?(x.unifiedContentAST.push(B_(e)),x.pushToGutter(`unified`,gn(e,`metadata`,1))):(x.additionsContentAST.push(B_(e)),x.pushToGutter(`additions`,gn(e,`metadata`,1)),O||(x.pushToGutter(`deletions`,gn(void 0,`buffer`,1)),x.deletionsContentAST.push(z_(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(W_(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=mn(n);return i.properties.style=`grid-row: span ${t.rowCount}`,[i,Xm(r,t.rowCount)]}renderFullAST(e,t=[]){let n=this.getOptionsWithDefaults().hunkSeparators===`line-info`,r=this.renderCodeAST(`unified`,e);if(r!=null)return t.push(R({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(R({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(R({tagName:`code`,children:a,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-additions":``}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return xi(this.renderFullAST(e,t))}renderPartialHTML(e,t){return xi(t==null?e:R({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(!Jm(n))return;let i=e.type===`new`?[]:this.getAnnotationNames(qm(this.deletionAnnotations)),a=e.type===`deleted`?[]:this.getAnnotationNames(qm(this.additionAnnotations));if(i.length===0&&a.length===0)return;let{createAnnotationElement:o}=this;if(t===`unified`){_y({diffStyle:t,type:`context`,unifiedSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i.concat(a)},createAnnotationElement:o,context:r});return}_y({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 Gp({fileOrDiff:e,mode:t,stickyHeader:n})}},py=new Intl.PluralRules(`en-US`);function my(e){return`${e} unmodified line${py.select(e)===`one`?``:`s`}`}function hy(e,t){for(let n of e)t.unifiedContentAST.push(n.content),t.pushToGutter(`unified`,n.gutter),t.incrementRowCount(1)}function gy(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 _y({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`,gn(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`,gn(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`,gn(e,`annotation`,1)),l=!0}}l&&c.incrementRowCount(1)}function vy(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,H_({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),l.push(H_({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1));return}if(c.hunkSeparators===`simple`){t>0&&(c.pushToGutter(e,H_({type:`simple`,isFirstHunk:a,isLastHunk:!1})),l.push(H_({type:`simple`,isFirstHunk:a,isLastHunk:!1})),e!==`additions`&&c.incrementRowCount(1));return}let u=U_(e,t),d=r>c.expansionLineCount,f=s?t:void 0,p=typeof n==`number`?my(n):`More unchanged context may be available`;c.pushToGutter(e,H_({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),l.push(H_({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 yy(e,t,n){return e==null||e.type!==`element`||t==null&&n==null?e:{...e,properties:{...e.properties,...t,...n}}}function by(e){return e.length>0&&e[e.length-1]===``?e.length-1:e.length}function xy(e,t,n,r){let i=by(e),a=by(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]??=Sy(e,r.getLineText(e));return l}function Sy(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 Cy(e){let t=[];for(let n=0;n<e.lineCount;n++)t.push(e.getLineText(n,!0));return t}function wy(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function Ty(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function Ey(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function Dy(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 Oy(e,t=300){let n;try{await Promise.race([e(),new Promise(e=>{n=setTimeout(e,t)})])}finally{n!=null&&clearTimeout(n)}}function ky({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 Ay(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:kh(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 jy(e){return e.isPartial&&(e.type===`change`||e.type===`rename-changed`||e.type===`rename-pure`)}function My(e){let t={...e};return delete t.cacheKey,t}function Ny(e,t){if(e.isPartial||t.isPartial)throw Error(`FileDiff.shouldResetEditorForExternalDiff: diffs must be fully hydrated`);let n=e.lang??$p(e.name),r=t.lang??$p(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 Py(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function Fy(e,t){let{oldFile:n}=e;return n==null?t.type===`new`:t.type!==`new`&&n.name===(t.prevName??t.name)&&Py(n.lines,t.deletionLines)}var Iy=-1,Ly=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++Iy}`;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:L},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new Gi,this.scrollSyncManager=new L_,this.interactionManager=new wi(`diff`,Ti(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 Ay(e)}createHunksRenderer(e){return new fy(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=rg(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(Ti(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&&!an(this.appliedThemeCSS.theme,this.options.theme??L)}getHoveredLine=()=>this.interactionManager.getHoveredLine();getAnnotationSlotName=e=>Oh(this.editSessionAnnotations,e,rm);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,Dh(t,e,rm))}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;tn(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=ky(a,`FileDiff.hydrate`),s=o?.oldFile,c=o?.newFile;this.hydrateElements(e,t);let l=this.editor!=null;l||Hy(this.pre,By({fileDiff:i,oldFile:s,newFile:c}),this.options.collapsed)||Uy(this.headerElement,Vy({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),Ch(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?F_(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||!jy(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(cg(`merge`,e,t),this.setHydratedState(t),this.startHydratedEditSession(e)){this.rerender();return}await Oy(()=>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(Ry(e)),t.__getDocumentSessionState()),!0):(this.installEditSession(e),!0)}updateExternalDiff(e,t){if(W(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(Ry(e)),this.editor.__getDocumentSessionState())):(this.outgoingSessionDiff=n,e.isPartial?this.loadFilesIfNecessary():this.installEditSession(e)),this.editSessionAnnotations!=null&&t!=null&&(this.lineAnnotations=t,this.editSessionAnnotations=Eh(t,rm,this.editSessionAnnotations)),!0}installEditSession(e,t,n){let r=e.additionLines.join(``),i=t==null?void 0:sg(t.contents),a=n!=null&&Fy(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=My(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,Iv(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=ky(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=_&&(!zy(u,this.deletionFile)||!zy(d,this.additionFile)),y=e!=null&&!W(e,this.fileDiff),b=i!=null&&(i.length>0||this.getLatestAnnotations().length>0)&&this.isNewAnnotations(i);if(!f&&Hp(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=F_(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()&&(Jv(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,Zt);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||!W(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?Ny(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||im(e))return e;let{diffStyle:n=`split`,expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a,o;return ov({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&&Ny(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?tg(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??=Eh(this.lineAnnotations,rm);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(Ry(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=ng(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=Kv(e,this.hunksRenderer.getExpandedHunksMap(),t);return Jv(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(qv(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 Q_({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 $_({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]=q_(o);if(e<s){let c=J_({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=Z_({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]=q_(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(){en(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||uy(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||!Dy(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||!Ey(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:Th(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):Th(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=nh;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&&W(r,n)?i:void 0)??xi(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,Lt,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,Pt,f),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,Ft,p),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,It,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??=lh(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=gh(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.options.theme??L,s=typeof o==`string`?o:{...o},c=fh(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=Mh({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:_h(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=vh(this.themeCSSStyle.textContent??``,fh(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&Fh()}applyHunksToDOM(e,t){this.shouldGuardRebuildScroll()?jh(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=Wy(t[0]),a=Wy(t[1]);return i==null||a==null?!1:(r.gutter.innerHTML=xi(i),r.content.innerHTML=xi(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=Sh({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=Sh({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=Sh({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=Wy(r?.[0]),a=Wy(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=Wy(r?.[0]),a=Wy(r?.[1]),o=()=>{for(let[e,t]of[[n.gutter,i],[n.content,a]])t!=null&&(e.innerHTML=xi(t));t.rowCount!==this.lastRowCount&&(this.applyRowSpan(`unified`,n,t.rowCount),this.lastRowCount=t.rowCount),this.renderedDiff=t.fileDiff};this.shouldGuardRebuildScroll()?jh(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=Wy(t[0]),i=Wy(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};ih(u,this.appliedPreAttributes)||(wh(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 Ry(e){return{name:e.name,lang:e.lang,contents:e.additionLines.join(``)}}function zy(e,t){return e==null||t==null?e==null&&t==null:eg(e,t)}function By({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function Vy({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function Hy(e,t,n=!1){return!n&&e==null&&t}function Uy(e,t,n=!1){return e==null&&t&&!n}function Wy(e){if(e!=null&&e.type===`element`)return e.children??[]}function Gy({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:r,expandUnchanged:i,expandedHunks:a,collapsedContextThreshold:o,canHydratePartialDiff:s}){let c=Wh(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=J_({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=iv({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=Ky(i);c+=p.split*t.lineHeight,l+=p.unified*t.lineHeight;let m=n===d?Z_({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=av({type:r,metrics:t})?.totalHeight??0;c+=e,l+=e}}else if(n===d&&e.isPartial&&s){let e=av({type:r,metrics:t})?.totalHeight??0;c+=e,l+=e}}if(e.hunks.length>0){let e=Kh(t);c+=e,l+=e}return{splitHeight:c,unifiedHeight:l}}function Ky(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 qy(e,t)}function qy(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 Jy=3e3,Yy=new Map,Xy=-1,Zy=class extends Ly{__id=`little-virtualized-file-diff:${++Xy}`;renderType=`virtualized`;top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0,fileAnnotationHeight:0,ghostTextRows:Yy,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=Uh(n)}setMetrics(e,t=!1){let n=Uh(e);!t&&rn(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 Km(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=!on(t,e),r=n&&ab(t,e);super.setOptions(e),r&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:ob(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=Yy,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()??Yy);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&&Jm(this.renderRange)){let t=Qy(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=ub(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=Uh(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=Wh(this.metrics,i),f=this.getLayoutCheckpointBeforeLineIndex(u),p=f?.top??d+this.cache.fileAnnotationHeight;if(o)return{top:d,height:0};let m;return ov({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=iv({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=av({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??Wh(this.metrics,n)+this.cache.fileAnnotationHeight,u;return ov({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=iv({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=av({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||!W(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=cg(`clone`,e,t);if(await Oy(()=>this.primeHighlightCache(n)),!this.enabled||this.fileDiff!==e)return;this.pendingHydratedDiff={expectedDiff:e,nextDiff:n,files:t}}else{if(cg(`merge`,e,t),this.setHydratedState(t),!this.startHydratedEditSession(e)&&(await Oy(()=>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 Q_({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,!W(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()??Yy);let{disableFileHeader:i=!1,collapsed:a=!1}=this.options,o=Wh(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}=Gy({fileDiff:e,metrics:this.metrics,disableFileHeader:t,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:n,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r,canHydratePartialDiff:sb(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=ky(i,`VirtualizedFileDiff.render`),o=a!=null,s=a?.oldFile,c=a?.newFile,l=o&&(!lb(s,this.deletionFile)||!lb(c,this.additionFile)),u=t??this.fileDiff;t==null&&o&&(l||this.fileDiff==null)&&(u=F_(a.oldFile,a.newFile,this.options.parseDiffOptions));let{forceRenderOverride:d,isSetup:f}=this;this.forceRenderOverride=void 0;let p=u!=null&&!W(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&&W(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:!W(a,o),renderedDiffChanged:!W(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 cb(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=sb(e,this.options.loadDiffFiles!=null),o=this.getDiffStyle(),s=this.getHunkSeparatorType(),c=n?!0:this.hunksRenderer.getExpandedHunksMap(),l=$y(this.cache.heightDeltas),u=Wh(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=nb(a);for(;s<o;){let e=s-a,r=u+(e>0?n:0)+e*this.metrics.lineHeight+rb(i,e)*this.metrics.lineHeight+eb(l,t,t+e);this.cache.checkpoints.push({renderedLineIndex:s,lineIndex:t+e,top:r}),s+=Jy}u+=n+e*this.metrics.lineHeight+i.length*this.metrics.lineHeight+eb(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=J_({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:c,hunkIndex:t,collapsedContextThreshold:r}),u=l.collapsedLines>0?iv({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?Z_({fileDiff:e,hunkIndex:t,expandedHunks:c,collapsedContextThreshold:r,errorPrefix:`VirtualizedFileDiff`}):void 0,m=p!=null&&p.collapsedLines>0||t===i&&a?av({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:ib({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}=J_({isPartial:e.isPartial,rangeSize:c,expandedHunks:a,hunkIndex:r,collapsedContextThreshold:i});c>0&&(n+=d?c:l+u)}let o=Z_({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=sb(e,this.options.loadDiffFiles!=null),f=this.height,p=this.getLayoutLineCount(e,l),m=Wh(this.metrics,i),h=e.hunks.length>0?Kh(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,ee;if(ov({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?iv({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),ee!=null)){if(ee<=0)return!0;ee--}let S=this.getLineHeight(l===`split`?m:h,g);if(k>n-S&&k<r&&(j??=x),M==null&&k+S>D&&(M=x),ee==null&&k>=r&&b&&(ee=T),A++,k+=S,c>0||v&&d){let e=av({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 N=Math.round(M-w/2),te=Math.max(0,Math.ceil(p/s)-w),ne=Math.max(0,Math.min(N,te)),re=ne*s,ie=N<0?C+N*s:C,ae=E[ne]??0,oe=re===0?0:g+ae,se=ne+ie/s,ce=se<E.length?v-E[se]:v-(k-t-_);return{startingLine:re,totalLines:ie,bufferBefore:oe,bufferAfter:Math.max(0,ce)}}};function Qy(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===Gm&&(t=Math.max(t??0,n.getBoundingClientRect().height))}return t}function $y(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 eb({lineIndexes:e,prefixTotals:t},n,r){if(n>=r||e.length===0)return 0;let i=tb(e,n);return(t[tb(e,r)]??0)-(t[i]??0)}function tb(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 nb(e){return Math.ceil(e/Jy)*Jy}function rb(e,t){let n=0;for(let r of e)r<t&&n++;return n}function ib({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 ab(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 ob(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 sb(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function cb(e){return typeof e==`function`?`custom`:e??`line-info`}function lb(e,t){return e==null||t==null?e==null&&t==null:eg(e,t)}function ub(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:fb(e.items,t.items)}function fb(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 pb(e,t,n){let r=document.createElement(`div`);return r.style.display=`flow-root`,e===`header`?(r.setAttribute(Vt,``),t.before(r)):(r.setAttribute(Ht,``),t.after(r)),n?.observe(r),r}function mb(e){let t=window.devicePixelRatio??1;return Math.round(e*t)/t}var hb=`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(`.`),gb=[`theme`,`disableLineNumbers`,`overflow`,`themeType`,`disableFileHeader`,`disableVirtualizationBuffers`,`preferredHighlighter`,`useCSSClasses`,`useTokenTransformer`,`tokenizeMaxLineLength`,`tokenizeMaxLength`,`unsafeCSS`,`lineHoverHighlight`,`enableTokenInteractionsOnWhitespace`,`enableGutterUtility`,`__debugPointerEvents`,`enableLineSelection`,`controlledSelection`,`disableErrorHandling`],_b=[`renderCustomHeader`,`renderHeaderPrefix`,`renderHeaderFilenameSuffix`,`renderHeaderMetadata`,`renderAnnotation`,`renderGutterUtility`,`onPostRender`,`onGutterUtilityClick`,`onLineClick`,`onLineNumberClick`,`onLineEnter`,`onLineLeave`,`onTokenClick`,`onTokenEnter`,`onTokenLeave`],vb=[`onLineSelected`,`onLineSelectionStart`,`onLineSelectionChange`,`onLineSelectionEnd`],yb=Symbol(`CodeView.itemOptionsState`);function bb(e,t){Object.defineProperty(e,yb,{configurable:!1,enumerable:!1,value:t})}function xb(e){return e[yb]}function Sb(e,t,n){Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get(){return n(this)}})}var Cb=120,wb=1,Tb=`--diffs-overflow-override`,Eb=12e6,Db=1e6,Ob=2e6,kb=1e7,Ab=11e6;function jb(e){if(e==null)throw Error(`CodeView: createEditor is required for items with edit: true`)}var Mb=(()=>{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)})(),Nb=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=Kt;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:L},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??qt}getItemTopOffset(){return this.getLayout().paddingTop+this.header.height}computeMetricsCache(e){return this.itemMetricsCache={hunkLineCount:e?.hunkLineCount??Kt.hunkLineCount,lineHeight:e?.lineHeight??Kt.lineHeight,diffHeaderHeight:e?.diffHeaderHeight??Kt.diffHeaderHeight,hunkSeparatorHeight:e?.hunkSeparatorHeight,spacing:e?.spacing??Kt.spacing,paddingTop:e?.paddingTop,paddingBottom:e?.paddingBottom},this.itemMetricsCache}getSmoothScrollSettings(){return this.options.smoothScrollSettings??Jt}shouldDisablePointerEvents(){return this.options.pointerEventsOnScroll!==!0}shouldValidateItemHeights(){return Et&&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)<wb||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),Mb&&!this.codeOverflowFix&&(this.stickyContainer.style.setProperty(Tb,`hidden`),this.codeOverflowFix=!0),this.scrollInteractionFixTimer=setTimeout(this.restoreScrollInteractions,Cb)}restoreScrollInteractions=()=>{this.clearScrollInteractionTimer(),this.pointerEventsDisabled&&=(this.stickyContainer.style.removeProperty(`pointer-events`),!1),this.codeOverflowFix&&=(this.stickyContainer.style.setProperty(Tb,`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??pb(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(){tn(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(Tt),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))Rb(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 un()?`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=Pb(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;Fb(t,e)&&this.invalidateElementPool(),this.options=e;let i=this.computeMetricsCache(e.itemMetrics),a=!rn(r,i),o=!rn(n,this.getLayout());o&&this.syncLayout();let s=a||Ib(t,e);if(s){let n=this.pendingLayoutReset;this.pendingLayoutReset={metrics:a?i:n?.metrics,resetFileLayoutCache:!0,resetDiffLayoutCache:!0,includeEstimatedDiffHeights:n?.includeEstimatedDiffHeights===!0||a||Lb(t,e)}}(o||s)&&(this.markLayoutDirtyFromIndex(0),this.scrollDirty=!0),on(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?(tn(this.computeRenderRangeAndEmit),this.computeRenderRangeAndEmit()):en(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=Wb(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 Zy(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 Qh(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){jb(n);let r=xb(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 gb)Sb(e,t,()=>this.options[t]);Sb(e,`stickyHeader`,()=>this.options.stickyHeaders),Sb(e,`collapsed`,e=>{let t=xb(e);if(t!=null)return this.getItemOptions(t,`file`)?.item.collapsed}),Sb(e,`onEditComplete`,e=>{if(this.options.onItemEditComplete==null)return;let t=xb(e);if(t!=null)return e=>this.completeFileItemEdit(t,e)});for(let t of _b)this.defineItemSharedCallback(e,`file`,t);for(let t of vb)this.defineItemSelectionCallback(e,`file`,t);return e}createDiffOptionsPrototype(){let e={};for(let t of hb)Sb(e,t,()=>this.options[t]);Sb(e,`stickyHeader`,()=>this.options.stickyHeaders),Sb(e,`hunkSeparators`,()=>this.options.hunkSeparators),Sb(e,`collapsed`,e=>{let t=xb(e);if(t!=null)return this.getItemOptions(t,`diff`)?.item.collapsed}),Sb(e,`onEditComplete`,e=>{if(this.options.onItemEditComplete==null)return;let t=xb(e);if(t!=null)return e=>this.completeDiffItemEdit(t,e)});for(let t of _b)this.defineItemSharedCallback(e,`diff`,t);for(let t of vb)this.defineItemSelectionCallback(e,`diff`,t);return e}createFileOptions(e){let t=Object.create(this.fileOptionsPrototype);return bb(t,{id:e}),t}createDiffOptions(e){let t=Object.create(this.diffOptionsPrototype);return bb(t,{id:e}),t}updateItemOptionsId(e,t){let n=xb(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){Sb(e,n,e=>{if(this.options[n]==null)return;let r=xb(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){Sb(e,n,e=>{let r=xb(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()>Ab}getPagedScrollHeight(){return this.shouldRebaseScroll()?Math.min(this.getScrollHeight(),Eb):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=mb(this.clampPagedScrollTop(t)),r=this.clampScrollPageOffset(e-n);return n=mb(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>Ab&&t<i,o=n<Db&&t>0;return n<0||n>r||a||o?this.resolveScrollPageWindow(e,o?Math.min(kb,r):Ob):{pagedScrollTop:mb(this.clampPagedScrollTop(n)),scrollPageOffset:t}}needsScrollPageUpdate(e){let t=mb(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 ${zb(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 ${zb(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=ln({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(),Hb(this.stickyContainer,t.element,h),n.virtualizedSetup(),Vb(t,t.element)&&(t.renderedOptionsRevision=this.renderOptionsRevision,g.add(t)),h=t.element):(Hb(this.stickyContainer,t.element,h),Vb(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=mb(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)>=wb){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=mb(this.clampScrollTop(e)),i=mb(t),{scrollPageOffset:a}=this,o=mb(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||mb(this.getScrollTop())===mb(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 Pb(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 Fb(e,t){return!an(e.theme??L,t.theme??L)||(e.themeType??`system`)!==(t.themeType??`system`)||e.unsafeCSS!==t.unsafeCSS}function Ib(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 Lb(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 Rb(e){return e instanceof SVGElement||Th(e)&&(e.hasAttribute(`data-core-css`)||e.hasAttribute(`data-theme-css`)||e.hasAttribute(`data-unsafe-css`))}function zb(e){let t=Bb(e.start,e.side),n=Bb(e.end,e.endSide??e.side);return t===n?t:`${t}-${n}`}function Bb(e,t){return t==null?`${e}`:`${t===`deletions`?`D`:`A`}${e}`}function Vb(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 Hb(e,t,n){if(n==null){e.firstChild!==t&&e.prepend(t);return}n.nextSibling!==t&&n.after(t)}function Ub(e){return(e.annotations?.length??0)>0}function Wb(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)Ub(t.item)&&i.push(t);return i.length>0?i:void 0}function Gb(e){let t=[];for(let n of e){let e=$i.get(n);if(e==null)throw Error(`getResolvedLanguages: ${n} is not resolved. Please resolve languages before calling getResolvedLanguages`);t.push(e)}return t}function Kb(e){for(let t of Array.isArray(e)?e:[e])if(!$i.has(t))return!1;return!0}async function qb(e){let t=[],n=[];for(let r of e){if(r===`text`||r===`ansi`)continue;let e=Xf(r)??Yf(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 Jb(e){return cp.getResolvedThemes(e)}async function Yb(e){for(let t of e)Ap(t);let t=await cp.resolveThemes(e);for(let n=0;n<e.length;n++)jp(e[n],t[n]);return t}function Xb(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 Zb(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 Qb=new WeakMap;function $b(e,t){if(Qb.has(e))return Qb.get(e);let n=null;if(e.patch)try{n=Ig(e.patch,t)[0]?.files[0]??null}catch{n=null}return Qb.set(e,n),n}var ex=new WeakMap;function tx(e,t){let n=ex.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++]??``)}}ex.set(e,n)}return n[t]}var nx=3;function rx(e,t,n,r){let i=tx(e,t),a=t===`deletions`?`-`:`+`,o=[];for(let e=Math.max(1,n-nx);e<=r+nx;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(`
1528
- `)}var ix=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),ax=Symbol(`IGNORE_RESPONSE`),ox=1e4,sx=class extends Error{constructor(){super(`WorkerPoolManager: operation canceled because the pool terminated`)}},cx=class extends Error{constructor(){super(`WorkerPoolManager: operation canceled before the task completed`)}},lx=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=L,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 ix.default.LRUMap(e.totalASTLRUCacheSize??100),this.diffCache=new ix.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??L,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()||R_(a,this.renderOptions))return;let o=Rp(e),c=[];if(an(a.theme,this.renderOptions.theme)||(c=Bp(o)?Jb(o):await Yb(o)),!s())return;if(this.highlighter!=null)lp(c,this.highlighter);else{let e=await Fp({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 sx||!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);fx(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=Rp(this.renderOptions.theme),i=[];if(i=Bp(r)?Jb(r):await Yb(r),!this.isCurrentLifecycle(t)){n();return}let a=[];if(a=Kb(e)?Gb(e):await qb(e),!this.isCurrentLifecycle(t)){n();return}let[o]=await Promise.all([Fp({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 sx||!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=em(),i=r>0?tm():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??ox,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=dx(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);Zm(t)||n!=null&&Vp(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||Zm(e)||t!=null&&Vp(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 Vm(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,lines:r})}highlightDiffAST(e,t){let n=this.getDiffResultCache(t);uy(t)||n!=null&&R_(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||uy(e)||t!=null&&R_(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:mv(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 sx;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 sx;for(let t of this.activeTaskById.values())`reject`in t?t.reject(e):fx(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&&(Kb(r)?t.request.resolvedLanguages=Gb(r):t.request.resolvedLanguages=await qb(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 ax;if(t.type===`error`){let e=Error(t.error);if(t.stack&&(e.stack=t.stack),`reject`in n)n.reject(e);else if(fx(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)||!Vp(i,this.getFileRenderOptions()))throw ax;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)||!R_(i,this.getDiffRenderOptions()))throw ax;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!==ax&&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,fx(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&&(fx(t)&&(this.rejectRenderTaskCallbacks(t,new cx),this.clearInstanceRequests(t),this.clearHighlightKey(t)),this.activeTaskById.delete(t.id))}executeTask(e,t){ux(t.request)&&this.maybeAttachCustomExtensions(e,t.request),this.activeTaskById.has(t.id)||this.assignWorkerToTask(t,e);for(let n of dx(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),fx(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=em();e.customExtensionsVersion>=n||(t.customExtensionsVersion=n,t.customExtensionMap=tm())}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 px(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 cx),this.clearQueuedInstanceRequests(e),this.clearHighlightKey(e)}removeActiveTask(e){this.rejectRenderTaskCallbacks(e,new cx),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()))fx(e)&&e.renderOptionsVersion!==this.renderOptionsVersion&&this.removeActiveTask(e)}clearQueuedInstanceRequests(e){for(let t of px(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 px(e))this.activeRequestByInstance.set(t,e.id)}clearInstanceRequests(e){for(let t of px(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 px(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)&&eg(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)&&W(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())fx(e)&&(yield e)}generateRequestId(){return`req_${++this.nextRequestId}`}};function ux(e){return e.type===`initialize`||e.type===`file`||e.type===`diff`}function dx(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??$p(e.request.file.name));break;case`diff`:t.add(e.request.diff.lang??$p(e.request.diff.name)),t.add(e.request.diff.lang??$p(e.request.diff.prevName??`-`))}return t.delete(`text`),Array.from(t)}function fx(e){return e?.type===`file`||e?.type===`diff`}function px(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 hx;function gx({poolOptions:e,highlighterOptions:t}){return hx??=new lx(e,t),hx}var _x=`/assets/worker-C0KwUb8K.js`,vx;function yx(){return vx??=gx({poolOptions:{workerFactory:()=>new Worker(_x,{type:`module`}),poolSize:Math.min(2,navigator.hardwareConcurrency||2)},highlighterOptions:{theme:{dark:`pierre-dark`,light:`pierre-light`}}})}function bx(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(xx(i))}return e=>!n.some(t=>t(e))&&t.every(t=>t(e))}function xx(e){if(!/[*?]/.test(e))return t=>ht(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=>ht(e,t)}}function Sx(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 Cx(e){if(e.length<=1)return null;let t=document.createElement(`select`);t.setAttribute(`aria-label`,`Send to session`),t.className=`_hT`;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 Tx(e,t,n){for(let r of e)r.disabled=t,n&&r.dataset.role===`send`&&(r.textContent=t?`Sending…`:n)}function Ex(e,t){let n=document.createElement(`button`);return n.type=`button`,n.textContent=e,n.className=t,n}function Dx(e,t,n,r){if(!t){e.className=`_q ${r?Ee:``} _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=`_hR ${r?`_iT`:``}`,e.className=`_r _hS`,e.textContent=`Send to`,i.append(e,t),i}function Ox(e,t,n){e.onkeydown=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),t()),e.key===`Escape`&&(e.preventDefault(),n())}}function kx(e,t,n){let r=document.createElement(`div`);r.className=`_iP`;let i=document.createElement(`div`),a=document.createElement(`div`);a.className=`_iS`;let o=()=>{i.replaceChildren(),a.replaceChildren();let r=document.createElement(`p`);r.className=`_iQ`,r.textContent=e.text;let o=Ex(`Remove`,`_q ${Ee}`);o.onclick=()=>n.onDelete(e.id);let c=Ex(`Edit`,`_q ${Ee}`);c.hidden=!n.onEdit,c.onclick=()=>s();let l=t.sessions(),u=l.length>0&&!!n.onSend,d=Ex(`Send`,``);d.dataset.role=`send`,d.hidden=!u;let f=u?Cx(l):null,p=f?`Send to`:`Send`;if(d.onclick=()=>{(async()=>{let t=wx(f,l);if(!(!t||d.disabled)){Tx([o,c,d],!0,p);try{await n.onSend?.(e.id,t)}finally{Tx([o,c,d],!1,p)}}})()},a.append(c,o),u&&a.append(Dx(d,f,l,!0)),n.drifted){let e=document.createElement(`span`);e.className=`_N ${te.warn} _iU`,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 _iR`;let r=Ex(`Save`,`_q _r`),s=Ex(`Cancel`,`_q`),c=()=>{let i=t.value.trim();if(!i||i===e.text){o();return}(async()=>{Tx([r,s],!0);try{await n.onEdit?.(e.id,i),e.text=i,o()}catch{Tx([r,s],!1)}})()};r.onclick=c,s.onclick=()=>o(),Ox(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 Ax(e,t){let n=document.createElement(`div`);n.className=`_iP`;let r=document.createElement(`textarea`);r.placeholder=`Add a comment…`,r.rows=3,r.className=`_Y _iR`;let i=Ex(`Add`,`_q`),a=Ex(`Send`,``);a.dataset.role=`send`;let o=Ex(`Cancel`,`_q`),s=e.sessions(),c=s.length>0&&!!t.onSend;a.hidden=!c;let l=c?Cx(s):null,u=c?Dx(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)){Tx([i,a,o],!0,d);try{await t.onSend?.(e,n)}finally{Tx([i,a,o],!1,d)}}})()};i.onclick=f,a.onclick=p,o.onclick=()=>t.onCancel(),Ox(r,c?p:f,()=>t.onCancel());let m=document.createElement(`div`);m.className=`_iS`,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 jx(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(Mx(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=Px(a);r.push(``),r.push(Fx(`${e}diff\n${a}\n${e}`))}r.push(``),r.push(Fx(e.text))}}return r.join(`
1528
+ `)}var ix=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),ax=Symbol(`IGNORE_RESPONSE`),ox=1e4,sx=class extends Error{constructor(){super(`WorkerPoolManager: operation canceled because the pool terminated`)}},cx=class extends Error{constructor(){super(`WorkerPoolManager: operation canceled before the task completed`)}},lx=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=L,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 ix.default.LRUMap(e.totalASTLRUCacheSize??100),this.diffCache=new ix.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??L,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()||R_(a,this.renderOptions))return;let o=Rp(e),c=[];if(an(a.theme,this.renderOptions.theme)||(c=Bp(o)?Jb(o):await Yb(o)),!s())return;if(this.highlighter!=null)lp(c,this.highlighter);else{let e=await Fp({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 sx||!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);fx(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=Rp(this.renderOptions.theme),i=[];if(i=Bp(r)?Jb(r):await Yb(r),!this.isCurrentLifecycle(t)){n();return}let a=[];if(a=Kb(e)?Gb(e):await qb(e),!this.isCurrentLifecycle(t)){n();return}let[o]=await Promise.all([Fp({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 sx||!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=em(),i=r>0?tm():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??ox,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=dx(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);Zm(t)||n!=null&&Vp(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||Zm(e)||t!=null&&Vp(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 Vm(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,lines:r})}highlightDiffAST(e,t){let n=this.getDiffResultCache(t);uy(t)||n!=null&&R_(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||uy(e)||t!=null&&R_(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:mv(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 sx;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 sx;for(let t of this.activeTaskById.values())`reject`in t?t.reject(e):fx(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&&(Kb(r)?t.request.resolvedLanguages=Gb(r):t.request.resolvedLanguages=await qb(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 ax;if(t.type===`error`){let e=Error(t.error);if(t.stack&&(e.stack=t.stack),`reject`in n)n.reject(e);else if(fx(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)||!Vp(i,this.getFileRenderOptions()))throw ax;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)||!R_(i,this.getDiffRenderOptions()))throw ax;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!==ax&&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,fx(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&&(fx(t)&&(this.rejectRenderTaskCallbacks(t,new cx),this.clearInstanceRequests(t),this.clearHighlightKey(t)),this.activeTaskById.delete(t.id))}executeTask(e,t){ux(t.request)&&this.maybeAttachCustomExtensions(e,t.request),this.activeTaskById.has(t.id)||this.assignWorkerToTask(t,e);for(let n of dx(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),fx(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=em();e.customExtensionsVersion>=n||(t.customExtensionsVersion=n,t.customExtensionMap=tm())}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 px(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 cx),this.clearQueuedInstanceRequests(e),this.clearHighlightKey(e)}removeActiveTask(e){this.rejectRenderTaskCallbacks(e,new cx),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()))fx(e)&&e.renderOptionsVersion!==this.renderOptionsVersion&&this.removeActiveTask(e)}clearQueuedInstanceRequests(e){for(let t of px(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 px(e))this.activeRequestByInstance.set(t,e.id)}clearInstanceRequests(e){for(let t of px(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 px(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)&&eg(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)&&W(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())fx(e)&&(yield e)}generateRequestId(){return`req_${++this.nextRequestId}`}};function ux(e){return e.type===`initialize`||e.type===`file`||e.type===`diff`}function dx(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??$p(e.request.file.name));break;case`diff`:t.add(e.request.diff.lang??$p(e.request.diff.name)),t.add(e.request.diff.lang??$p(e.request.diff.prevName??`-`))}return t.delete(`text`),Array.from(t)}function fx(e){return e?.type===`file`||e?.type===`diff`}function px(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 hx;function gx({poolOptions:e,highlighterOptions:t}){return hx??=new lx(e,t),hx}var _x=`/assets/worker-C0KwUb8K.js`,vx;function yx(){return vx??=gx({poolOptions:{workerFactory:()=>new Worker(_x,{type:`module`}),poolSize:Math.min(2,navigator.hardwareConcurrency||2)},highlighterOptions:{theme:{dark:`pierre-dark`,light:`pierre-light`}}})}function bx(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(xx(i))}return e=>!n.some(t=>t(e))&&t.every(t=>t(e))}function xx(e){if(!/[*?]/.test(e))return t=>ht(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=>ht(e,t)}}function Sx(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 Cx(e){if(e.length<=1)return null;let t=document.createElement(`select`);t.setAttribute(`aria-label`,`Send to session`),t.className=`_iA`;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 Tx(e,t,n){for(let r of e)r.disabled=t,n&&r.dataset.role===`send`&&(r.textContent=t?`Sending…`:n)}function Ex(e,t){let n=document.createElement(`button`);return n.type=`button`,n.textContent=e,n.className=t,n}function Dx(e,t,n,r){if(!t){e.className=`_q ${r?Ee:``} _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=`_iy ${r?`_i7`:``}`,e.className=`_r _iz`,e.textContent=`Send to`,i.append(e,t),i}function Ox(e,t,n){e.onkeydown=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),t()),e.key===`Escape`&&(e.preventDefault(),n())}}function kx(e,t,n){let r=document.createElement(`div`);r.className=`_i3`;let i=document.createElement(`div`),a=document.createElement(`div`);a.className=`_i6`;let o=()=>{i.replaceChildren(),a.replaceChildren();let r=document.createElement(`p`);r.className=`_i4`,r.textContent=e.text;let o=Ex(`Remove`,`_q ${Ee}`);o.onclick=()=>n.onDelete(e.id);let c=Ex(`Edit`,`_q ${Ee}`);c.hidden=!n.onEdit,c.onclick=()=>s();let l=t.sessions(),u=l.length>0&&!!n.onSend,d=Ex(`Send`,``);d.dataset.role=`send`,d.hidden=!u;let f=u?Cx(l):null,p=f?`Send to`:`Send`;if(d.onclick=()=>{(async()=>{let t=wx(f,l);if(!(!t||d.disabled)){Tx([o,c,d],!0,p);try{await n.onSend?.(e.id,t)}finally{Tx([o,c,d],!1,p)}}})()},a.append(c,o),u&&a.append(Dx(d,f,l,!0)),n.drifted){let e=document.createElement(`span`);e.className=`_N ${te.warn} _i8`,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 _i5`;let r=Ex(`Save`,`_q _r`),s=Ex(`Cancel`,`_q`),c=()=>{let i=t.value.trim();if(!i||i===e.text){o();return}(async()=>{Tx([r,s],!0);try{await n.onEdit?.(e.id,i),e.text=i,o()}catch{Tx([r,s],!1)}})()};r.onclick=c,s.onclick=()=>o(),Ox(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 Ax(e,t){let n=document.createElement(`div`);n.className=`_i3`;let r=document.createElement(`textarea`);r.placeholder=`Add a comment…`,r.rows=3,r.className=`_Y _i5`;let i=Ex(`Add`,`_q`),a=Ex(`Send`,``);a.dataset.role=`send`;let o=Ex(`Cancel`,`_q`),s=e.sessions(),c=s.length>0&&!!t.onSend;a.hidden=!c;let l=c?Cx(s):null,u=c?Dx(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)){Tx([i,a,o],!0,d);try{await t.onSend?.(e,n)}finally{Tx([i,a,o],!1,d)}}})()};i.onclick=f,a.onclick=p,o.onclick=()=>t.onCancel(),Ox(r,c?p:f,()=>t.onCancel());let m=document.createElement(`div`);m.className=`_i6`,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 jx(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(Mx(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=Px(a);r.push(``),r.push(Fx(`${e}diff\n${a}\n${e}`))}r.push(``),r.push(Fx(e.text))}}return r.join(`
1529
1529
  `)}function Mx(e,t,n){if(t?.head){let n=Nx(t.head),r=t.baseSha?Nx(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=>Nx(e)).join(`, `)}`:`${e}/`}function Nx(e,t=12){return e.slice(0,t)}function Px(e){let t=3,n=/`+/g,r;for(;r=n.exec(e);)t=Math.max(t,r[0].length+1);return"`".repeat(t)}function Fx(e){return e.split(`
1530
1530
  `).map(e=>e&&` ${e}`).join(`
1531
- `)}var Ix=`search-mark`,Lx=`mark.${Ix}`,Rx=`mark.${Ix}{display:inline;background:#ffd24a;color:#1a1408;-webkit-text-fill-color:#1a1408;border-radius:3px;padding:0 2px}mark.${Ix} *,mark.${Ix} *::before,mark.${Ix} *::after{color:inherit!important;-webkit-text-fill-color:inherit!important;background:transparent!important}mark.${Ix}.active{background:#ffb000;box-shadow:0 0 0 1px #c98400}`,zx={query:``,hit:null,keys:null},Bx=new Map,Vx=new WeakMap,Hx=(e,t)=>t?`${e}\n${t.line}\n${t.side||``}`:e;function Ux(e,t,n){zx.query=e,zx.hit=t,zx.keys=n?new Set(n):null;for(let[e,t]of Bx)Jx(e,t,!1);t&&Wx(t)}function Wx(e,t=0){requestAnimationFrame(()=>{requestAnimationFrame(()=>{let n=!1;for(let[r,i]of Bx)if(i===e.key&&(n=!0,qx(r,e)||t>=40))return;t>=40||(!n||t<12)&&setTimeout(()=>Wx(e,t+1),n?32:48)})})}function Gx(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 Kx(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 qx(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=>Qx(e)===r)??e[0]??null})();if(!r)return!1;let i=e.closest(`[data-diff-main]`);if(i){if(!Gx(i,r,`y`))return!1}else r.scrollIntoView({block:`center`,inline:`nearest`});let a=Kx(r,e);return a&&Gx(a,r,`x`),!0}function Jx(e,t,n=!0){let r=t&&zx.hit?.key===t?zx.hit:null,i=zx.query.trim(),a=!!i&&!!zx.keys&&!!t&&!zx.keys.has(t),o=a?``:Hx(i,r);!n&&Vx.get(e)===o||(Vx.set(e,o),rS(e,a?``:i,r),r&&Wx(r))}function Yx(e,t){return Bx.set(e,t),Jx(e,t),()=>{Bx.delete(e),Vx.delete(e)}}function Xx(e){Jx(e,Bx.get(e))}function Zx(e){let t=e.querySelectorAll(Lx);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 Qx(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 $x(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=[];for(let e=t.nextNode();e;e=t.nextNode())e.parentElement?.closest(Lx)||n.push(e);return n}function eS(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=eS(e,t,n),o=eS(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 nS(e,t,n,r){let i=$x(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=Qx(e),u=Number(e.getAttribute(`data-line`)),d=r&&r.line===u&&(r.side||`additions`)===l?`${Ix} active`:Ix;for(let e=c.length-1;e>=0;e--)tS(i,a,c[e][0],c[e][1],d)}function rS(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(Zx(e),s)for(let t of e.querySelectorAll(`[data-code] [data-line]`)){let e=t.textContent||``;(o?e:e.toLowerCase()).includes(s)&&nS(t,s,o,n)}}var iS=`_go _4 _l`,aS=`_gv _cx`,oS=`<span><button type=button title="Copy comments as markdown"> </button><!></span>`,sS=` D D l%l`,cS=(e,t)=>S(e.a,`value`,t),lS=s(7,e=>m(e.b,e.f||e.g)),uS=j(5,lS),dS=j(6,lS),fS=(e,t)=>{cS(e,t[0]?.id),uS(e,t[0]?.title),dS(e,t[0]?.agent)},pS=c(3,1,e=>{S(e.b,`disabled`,e._.k),m(e.c,e._.k?`Sending…`:`Send to`),S(e.d,`disabled`,e._.k)}),mS=r(`k2`,e=>{o(e.b,`click`,function(){(async()=>{if(!(!e._.s||e._.k)){ES(e._,!0);try{await e._.i(e._.s)}finally{ES(e._,!1)}}})()}),b(e,`d`)}),hS=e=>{pS._(e),gS._(e),vS._(e),_(e.a,`_hR`),_(e.b,[`_r`,`_hS`]),_(e.d,`_hT`),mS(e)},gS=c(3,1,e=>k(e,`d`,e._.l,BS(e))),_S=i(3,`<option> </option>`,` D `,0,fS),vS=c(3,1,e=>_S(e,[e._.m,`id`])),yS=s(2,e=>m(e.b,e._.k?`Sending…`:`Send to ${e._.q||e._.r}`),2),bS=c(3,0,e=>{S(e.a,`disabled`,e._.k),yS(e)}),xS=r(`k1`,e=>o(e.a,`click`,function(){(async()=>{if(!(!e._.s||e._.k)){ES(e._,!0);try{await e._.i(e._.s)}finally{ES(e._,!1)}}})()})),SS=e=>{bS._(e),CS._(e),wS._(e),_(e.a,[`_q`,`_r`]),xS(e)},CS=c(3,0,yS),wS=c(3,0,yS),TS=l(9,e=>m(e.c,e.j?`Copied`:`Copy`)),ES=l(10,e=>{bS(e),pS(e)}),DS=j(18),OS=s(13,e=>DS(e,e.m.some(t=>t.id===e.l)?e.l:e.m[0]?.id??null)),kS=l(11,e=>{OS(e),gS(e)}),AS=r(`k3`,e=>o(e.b,`click`,function(){(async()=>{await e.h()&&(TS(e,!0),setTimeout(()=>{TS(e,!1)},1500))})()}));function jS(e){_(e.a,`_hQ`),_(e.b,`_q`),TS(e,!1),ES(e,!1),kS(e,null),AS(e)}var MS=j(12,e=>{NS(e,e.m[0]?.title),PS(e,e.m[0]?.agent),IS(e,e.m.length),OS(e),vS(e)}),NS=j(16,CS),PS=j(17,wS),FS=C(3,`<button type=button> </button>`,` D `,SS,`<span><button type=button> </button><select aria-label="Send comments to session"></select></span>`,` D D l `,hS),IS=(e,t)=>FS(e,t===1?0:t?1:2),LS=(e,t)=>MS(e,t||[]),RS=j(7),zS=j(8),BS=e=>t=>{kS(e._,t)};d(`k0`,BS);var VS=40,HS;function US(e){return e.length>=200?null:[...new Set(e.map(e=>e.key))]}function WS(e,t){let n=t.trim();if(!n)return[];if(HS&&HS.files===e&&HS.query===n)return HS.hits;let r=qS(e,n);return HS={files:e,query:n,hits:r},r}var GS=new WeakMap;function KS(e){let t=GS.get(e);if(!t){let n={additions:new Set,deletions:new Set};if(e.fileDiff){let n=tx(e.fileDiff,`additions`),r=tx(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};GS.set(e,t)}return t}function qS(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)){JS(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}=KS(t),l=new Set;YS(t,s,`additions`,r,n,l,a,o.additions),YS(t,c,`deletions`,r,n,l,a,o.deletions),a.length===e&&JS(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 JS(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 YS(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>=VS)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:XS(d,f,r.length)}))}}function XS(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 ZS=((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>`)(ge,Te,Je,$e),QS=((e,t,n,r)=>` D D/${e}&l b D l D/${t}&l D/${n}&l D/${r}&m`)(ve,ie,Le,gt),$S=r(`j8`,e=>e.ah=!!e.a1),eC=s(44,$S),tC=r(`j7`,e=>a(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),Ux(``,null),yC(e,{query:``,hit:null,keys:[]})}},onDestroy:function(){e.al&&clearTimeout(e.al),this.abort.abort(),Ux(``,null),yC(e,{query:``,hit:null,keys:[]})}})),nC=s(59,tC,11),rC=s(29,e=>_(e.a,[`_eo`,e.a0&&`_ex`,!e.a1&&`_en`])),iC=s(41,e=>m(e.f,e.a1&&(e.a4||``).trim()?e.ab?`${e.ae+1}/${e.ab}`:`0/0`:``),3),aC=s(38,e=>{S(e.g,`disabled`,!e.ab||!e.a1),S(e.i,`disabled`,!e.ab||!e.a1)}),oC=u(27,e=>{S(e.a,`aria-hidden`,e.a1?`false`:`true`),S(e.d,`tabindex`,e.a1?0:-1),S(e.g,`tabindex`,e.a1?0:-1),S(e.i,`tabindex`,e.a1?0:-1),S(e.k,`tabindex`,e.a1?0:-1),eC(e),nC(e),rC(e),iC(e),aC(e)}),sC=s(16,e=>oC(e,e.o,e.p)),cC=j(14,sC),lC=j(15,sC),uC=(e,t)=>FC(e,t?.length),dC=s(32,e=>uC(e,WS(e.x,e.a4||``))),fC=j(56,nC),pC=s(53,e=>fC(e,KC(e)),4),mC=s(55,e=>y(e,`d`,e.a4||``,qC(e))),hC=u(30,e=>{dC(e),pC(e),nC(e),mC(e),iC(e)}),gC=s(19,e=>hC(e,e.r,e.s)),_C=j(17,gC),vC=j(18,gC),yC=u(33),bC=s(22,e=>yC(e,e.u,e.v)),xC=j(20,bC),SC=j(21,bC),CC=j(40,e=>{pC(e),iC(e)}),wC=s(39,e=>CC(e,e.ab?Math.min(e.a9,e.ab-1):-1)),TC=j(54,e=>{nC(e),mC(e)}),EC=s(52,e=>TC(e,JC(e)),3),DC=j(51,e=>{EC(e),pC(e)}),OC=s(45,e=>DC(e,YC(e)),2),kC=l(35,e=>{wC(e),OC(e)}),AC=(e,t)=>zC(e,t.open),jC=(e,t)=>{BC(e,t.timer),VC(e,t.tick),HC(e,t.wasOpen)},MC=j(58,e=>{M(e,e.aw),nC(e)}),NC=r(`j6`,e=>{T(e,`d`),o(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))}}),o(e.g,`mousedown`,function(e){e.preventDefault()}),o(e.g,`click`,function(){e.au(-1)}),o(e.i,`mousedown`,function(e){e.preventDefault()}),o(e.i,`click`,function(){e.au(1)}),o(e.k,`mousedown`,function(e){e.preventDefault()}),o(e.k,`click`,function(){e.av()})});function PC(e){_(e.b,`_ep`),Xe(e.c),N(e.c,13),Ze(e.c),_(e.e,`_es`),xt(e.h),ze(e.h,14),St(e.h),F(e.j),nt(e.j,14),pt(e.j),Ve(e.l),ft(e.l,14),at(e.l),kC(e,0),AC(e,{open:!1}),jC(e,{timer:0,tick:0,wasOpen:!1}),MC(e,XC(e)),NC(e)}var FC=j(37,e=>{wC(e),iC(e),aC(e)}),IC=j(23,e=>{dC(e),OC(e),EC(e)}),LC=j(57,nC),RC=s(48,e=>LC(e,ZC(e))),zC=j(43,e=>{OC(e),EC(e),pC(e),RC(e),eC(e),nC(e)}),BC=j(47,e=>{EC(e),pC(e),RC(e),nC(e)}),VC=j(49,nC),HC=j(50,nC),UC=j(24,e=>{S(e.k,`hidden`,e.y),nC(e)}),WC=j(25,nC),GC=j(26,e=>{_(e.d,[ut,e.a0&&`_ez`]),_(e.g,[it,e.a0&&`_eA`]),_(e.i,[it,e.a0&&`_eA`]),_(e.k,[it,e.a0&&`_eA`]),rC(e)}),KC=e=>t=>{e.ah&&(e.al&&=(clearTimeout(e.al),0),e.ap(e.a4||``,(e.ae<0?0:e.ae)+t))},qC=e=>function(t){e.as(t)},JC=e=>t=>{if(!e.ah)return;hC(e,t),kC(e,0);let n=WS(e.x,t);Ux(t,n[0]??null,US(n)??void 0),e.al&&clearTimeout(e.al),e.al=setTimeout(()=>{e.al=0,e.ap(t,0)},80)},YC=e=>(t,n)=>{if(!e.ah)return;let r=WS(e.x,t),i=[...new Set(r.map(e=>e.key))];if(!r.length){kC(e,0),Ux(t,null,i),yC(e,{query:t,hit:null,keys:i});return}kC(e,(n%r.length+r.length)%r.length);let a=r[e.a9];Ux(t,a,US(r)??void 0),yC(e,{query:t,hit:a,keys:i})},XC=e=>()=>{let t=e.d;t&&(t.focus(),t.select(),document.activeElement!==t&&setTimeout(()=>{t.focus(),t.select()},0))},ZC=e=>()=>{e.d?.blur(),oC(e,!1),e.ah=!1,e.al&&=(clearTimeout(e.al),0),Ux(``,null),yC(e,{query:``,hit:null,keys:[]})};d(`j4`,KC),d(`j1`,qC),d(`j3`,JC),d(`j2`,YC),d(`j0`,XC),d(`j5`,ZC);function QC(e){let t=e.replace(/^origin\//,``);return $C(t.includes(`/`)?t.slice(t.lastIndexOf(`/`)+1):t)}function $C(e){return e.replace(/-[a-z0-9]{1,6}$/i,``)||e}function ew(e,t){if(!t)return``;let n=e.replace(/^origin\//,``),r=t.replace(/^origin\//,``);return n.startsWith(`${r}-`)?n.slice(r.length+1):``}function tw(e){let t=$C(e);if(t.length<=20)return t;let n=t.split(`-`);return n.length>1?n[n.length-1]:t}function nw(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||QC(o):tw(a),topic:s?ew(a,o):``,title:a===i?i:`${a} vs ${i}`}}function rw(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||QC(i),t=ew(r,i);return t?`${e} [${t}]`:e}return tw(r)}var iw=`_jd _y`,aw=`_jj _x`,ow=`<div><button type=button title="Scroll to this section"><span> </span></button><!><span><span> </span><span aria-hidden=true>vs</span><span> </span><!></span><!><!><!><!><span><span><!> file<!></span><!><!><!></span></div>`,sw=` D D D m%b D D l b D l%l%b%b%b%b E%c%l%b%b%m`,cw=c(11,0,e=>m(e.b,e._.b4)),lw=e=>{cw._(e),_(e.a,[`_N`,te.accent,`_jp`])},uw=s(2,e=>S(e.a,`title`,`${e._.ag?`#${e._.ag.number}`:e._.ak} is already in ${e._.ai}; showing the working tree only`),2),dw=c(14,0,uw),fw=e=>{dw._(e),pw._(e),mw._(e),_(e.a,[`_N`,`_jq`])},pw=c(14,0,e=>{m(e.b,e._.ai),uw(e)}),mw=c(14,0,uw),hw=c(12,0,e=>m(e.b,Nx(e._.at,7))),gw=e=>{hw._(e),_(e.a,[`_N`,`_jq`])},_w=c(4,1,e=>m(e.b,vt(e._.as))),vw=e=>{_w._(e),_(e.a,[aw,`_jk`])},yw=s(4,e=>S(e.a,`title`,`${e._.ap}: ${e._.aj} ${e._.aq} vs ${e._.ai} ${e._.ar}`),4),bw=c(4,0,yw),xw=e=>{bw._(e),Sw._(e),Cw._(e),ww._(e),Tw._(e),Ew._(e),Dw._(e),_(e.a,[`_u`,`_v`]),_(e.c,aw)},Sw=c(4,0,yw),Cw=c(4,0,e=>m(e.b,e._.an)),ww=c(4,0,e=>S(e.a,`href`,`${e._.ao}/files`)),Tw=c(4,0,e=>{m(e.d,e._.ap),yw(e)}),Ew=c(4,0,yw),Dw=c(4,0,yw),Ow=c(21,0,e=>m(e.b,e._.ab)),kw=r(`x2`,e=>o(e.a,`click`,function(){e._.ae()})),Aw=e=>{Ow._(e),jw._(e),kw(e)},jw=c(21,0,e=>{_(e.a,[`_ji`,{_jh:e._.ac}]),S(e.a,`aria-pressed`,e._.ac?`true`:`false`),S(e.a,`title`,e._.ac?`Show every file`:`Show only files changed since your last visit`)}),Mw=c(20,0,e=>m(e.b,e._.a9)),Nw=r(`x1`,e=>o(e.a,`click`,function(){e._.aa()})),Pw=e=>{Mw._(e),_(e.a,`_ji`),Nw(e)},Fw=c(19,0,e=>m(e.b,e._.a6)),Iw=e=>{Fw._(e),Lw._(e),_(e.a,`_jf`),_(e.c,`_jg`)},Lw=c(19,0,e=>m(e.d,e._.a7)),Rw=s(3,e=>m(e.b,rw(e._.ak,e._.z,e._.a0)),2),zw=c(15,0,Rw),Bw=e=>{zw._(e),Vw._(e),Uw._(e),Ww._(e),Gw._(e),Kw._(e),_(e.a,[`_N`,`_jq`])},Vw=c(15,0,Rw),Hw=s(4,e=>S(e.a,`title`,`This view is ${Nx(e._.aq)} (${e._.aj}); checked out is ${Nx(e._.ay)} (${e._.ak})`),3),Uw=c(15,0,Hw),Ww=c(15,0,e=>{Hw(e),Rw(e)}),Gw=c(15,0,Hw),Kw=c(15,0,e=>{m(e.c,Nx(e._.ay,7)),Hw(e)}),qw=c(13,0,e=>S(e.a,`disabled`,e._.a2)),Jw=r(`x0`,e=>o(e.a,`click`,function(){e._.a3()})),Yw=e=>{qw._(e),Zw._(e),Qw._(e),$w._(e),_(e.a,[`_N`,te.warn,`_jq`]),Jw(e)},Xw=s(3,e=>S(e.a,`title`,`origin/${e._.aj} ${e._.aq} · GitHub ${e._.av}. Reload to re-ask GitHub`),2),Zw=c(13,0,Xw),Qw=c(13,0,e=>{m(e.b,Nx(e._.aq,7)),Xw(e)}),$w=c(13,0,e=>{m(e.c,Nx(e._.av,7)),Xw(e)}),eT=(e,t)=>{nT(e,t?.pr),dT(e,t?.base),fT(e,t?.branch),pT(e,t?.worktree),hT(e,t?.head),gT(e,t?.baseSha),_T(e,t?.full_name),yT(e,t?.rev),xT(e,t?.githubDrift),wT(e,t?.contained),TT(e,t?.localHead)},tT=C(4,`<a target=_blank rel=noopener>#<!></a><span> </span>`,` Db%l D `,xw,`<span> </span>`,` D `,vw),nT=j(42,e=>{aT(e,e.ag?.baseRefName),oT(e,e.ag?.headRefName),sT(e,e.ag?.number),cT(e,e.ag?.url),lT(e,e.ag?.title),uT(e,e.ag?.headRefOid),tT(e,+!e.ag),dw(e)}),rT=(e,t)=>{OT(e,t?.title),kT(e,t?.base),AT(e,t?.head),MT(e,t?.topic)},iT=s(47,e=>rT(e,nw(e.ah||e.ai,e.aj||e.ak,e.z,e.a0)),5),aT=j(43,iT),oT=j(45,e=>{iT(e),Zw(e),Uw(e),Sw(e)}),sT=j(49,Cw),cT=j(50,ww),lT=j(51,Tw),uT=j(57,$w),dT=j(44,e=>{iT(e),bw(e),pw(e)}),fT=j(46,e=>{iT(e),Ww(e),mw(e)}),pT=j(48,e=>m(e.d,e.am)),mT=s(63,e=>S(e.f,`title`,`${e.b0} · ${e.aq.slice(0,7)}…${e.ar.slice(0,7)}`),2),hT=j(52,e=>{mT(e),Qw(e),Gw(e),Ew(e)}),gT=j(53,e=>{mT(e),Dw(e)}),_T=j(54,_w),vT=C(12,`<span title="One commit against its parent">commit <!></span>`,` Db%`,gw),yT=j(55,e=>{vT(e,+!e.at),hw(e)}),bT=C(13,`<button type=button>behind GitHub <!> → <!></button>`,` Db%c%`,Yw),xT=(e,t)=>bT(e,+!t),ST=C(14,`<span>already in <!></span>`,` Db%`,fw),CT=s(59,e=>ST(e,e.aw&&e.a4?0:1)),wT=j(58,CT),TT=j(60,Kw),ET=e=>{S(e.a,`data-pr`,e.ag?`${e.am}/${e.ag.number}`:void 0)},DT=j(24,e=>{eT(e,e.y),ET(e)}),OT=j(62,mT),kT=(e,t)=>m(e.h,t),AT=(e,t)=>m(e.k,t),jT=C(11,`<span> </span>`,` D `,lw),MT=j(66,e=>{jT(e,+!e.b4),cw(e)}),NT=j(25,e=>{iT(e),zw(e)}),PT=j(26,e=>{iT(e),Vw(e)}),FT=r(`x3`,e=>o(e.b,`click`,function(){e.a1()}));function IT(e){_(e.a,`_jb`),_(e.b,`_jc`),_(e.c,iw),_(e.f,`_jl`),_(e.g,[`_N`,`_jm`]),_(e.i,[`_P`,`_jo`]),_(e.j,[`_N`,`_jn`]),_(e.q,`_je`),FT(e)}var LT=j(30,e=>{m(e.r,e.a4),m(e.s,e.a4===1?``:`s`),CT(e)}),RT=C(15,`<span>local <!><!></span>`,` Db%b%`,Bw),zT=(e,t)=>RT(e,+!t),BT=C(19,`<span>+<!></span><span>−<!></span>`,` Db%l Db%`,Iw),VT=s(34,e=>BT(e,e.a6||e.a7?0:1)),HT=j(32,e=>{VT(e),Fw(e)}),UT=j(33,e=>{VT(e),Lw(e)}),WT=C(20,`<button type=button title="Filtered out of the list — show every file"><!> hidden</button>`,` D%`,Pw),GT=j(35,e=>{WT(e,+!e.a9),Mw(e)}),KT=C(21,`<button type=button><!> new</button>`,` D%`,Aw),qT=s(39,e=>KT(e,e.ab||e.ac?0:1)),JT=j(37,e=>{qT(e),Ow(e)}),YT=j(38,e=>{qT(e),jw(e)}),XT=j(27),ZT=j(28,qw),QT=j(29),$T=j(36),eE=j(40),tE=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
1531
+ `)}var Ix=`search-mark`,Lx=`mark.${Ix}`,Rx=`mark.${Ix}{display:inline;background:#ffd24a;color:#1a1408;-webkit-text-fill-color:#1a1408;border-radius:3px;padding:0 2px}mark.${Ix} *,mark.${Ix} *::before,mark.${Ix} *::after{color:inherit!important;-webkit-text-fill-color:inherit!important;background:transparent!important}mark.${Ix}.active{background:#ffb000;box-shadow:0 0 0 1px #c98400}`,zx={query:``,hit:null,keys:null},Bx=new Map,Vx=new WeakMap,Hx=(e,t)=>t?`${e}\n${t.line}\n${t.side||``}`:e;function Ux(e,t,n){zx.query=e,zx.hit=t,zx.keys=n?new Set(n):null;for(let[e,t]of Bx)Jx(e,t,!1);t&&Wx(t)}function Wx(e,t=0){requestAnimationFrame(()=>{requestAnimationFrame(()=>{let n=!1;for(let[r,i]of Bx)if(i===e.key&&(n=!0,qx(r,e)||t>=40))return;t>=40||(!n||t<12)&&setTimeout(()=>Wx(e,t+1),n?32:48)})})}function Gx(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 Kx(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 qx(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=>Qx(e)===r)??e[0]??null})();if(!r)return!1;let i=e.closest(`[data-diff-main]`);if(i){if(!Gx(i,r,`y`))return!1}else r.scrollIntoView({block:`center`,inline:`nearest`});let a=Kx(r,e);return a&&Gx(a,r,`x`),!0}function Jx(e,t,n=!0){let r=t&&zx.hit?.key===t?zx.hit:null,i=zx.query.trim(),a=!!i&&!!zx.keys&&!!t&&!zx.keys.has(t),o=a?``:Hx(i,r);!n&&Vx.get(e)===o||(Vx.set(e,o),rS(e,a?``:i,r),r&&Wx(r))}function Yx(e,t){return Bx.set(e,t),Jx(e,t),()=>{Bx.delete(e),Vx.delete(e)}}function Xx(e){Jx(e,Bx.get(e))}function Zx(e){let t=e.querySelectorAll(Lx);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 Qx(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 $x(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=[];for(let e=t.nextNode();e;e=t.nextNode())e.parentElement?.closest(Lx)||n.push(e);return n}function eS(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=eS(e,t,n),o=eS(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 nS(e,t,n,r){let i=$x(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=Qx(e),u=Number(e.getAttribute(`data-line`)),d=r&&r.line===u&&(r.side||`additions`)===l?`${Ix} active`:Ix;for(let e=c.length-1;e>=0;e--)tS(i,a,c[e][0],c[e][1],d)}function rS(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(Zx(e),s)for(let t of e.querySelectorAll(`[data-code] [data-line]`)){let e=t.textContent||``;(o?e:e.toLowerCase()).includes(s)&&nS(t,s,o,n)}}var iS=`_go _4 _l`,aS=`_gv _ej`,oS=`<span><button type=button title="Copy comments as markdown"> </button><!></span>`,sS=` D D l%l`,cS=(e,t)=>S(e.a,`value`,t),lS=s(7,e=>m(e.b,e.f||e.g)),uS=j(5,lS),dS=j(6,lS),fS=(e,t)=>{cS(e,t[0]?.id),uS(e,t[0]?.title),dS(e,t[0]?.agent)},pS=c(3,1,e=>{S(e.b,`disabled`,e._.k),m(e.c,e._.k?`Sending…`:`Send to`),S(e.d,`disabled`,e._.k)}),mS=r(`k2`,e=>{o(e.b,`click`,function(){(async()=>{if(!(!e._.s||e._.k)){ES(e._,!0);try{await e._.i(e._.s)}finally{ES(e._,!1)}}})()}),b(e,`d`)}),hS=e=>{pS._(e),gS._(e),vS._(e),_(e.a,`_iy`),_(e.b,[`_r`,`_iz`]),_(e.d,`_iA`),mS(e)},gS=c(3,1,e=>k(e,`d`,e._.l,BS(e))),_S=i(3,`<option> </option>`,` D `,0,fS),vS=c(3,1,e=>_S(e,[e._.m,`id`])),yS=s(2,e=>m(e.b,e._.k?`Sending…`:`Send to ${e._.q||e._.r}`),2),bS=c(3,0,e=>{S(e.a,`disabled`,e._.k),yS(e)}),xS=r(`k1`,e=>o(e.a,`click`,function(){(async()=>{if(!(!e._.s||e._.k)){ES(e._,!0);try{await e._.i(e._.s)}finally{ES(e._,!1)}}})()})),SS=e=>{bS._(e),CS._(e),wS._(e),_(e.a,[`_q`,`_r`]),xS(e)},CS=c(3,0,yS),wS=c(3,0,yS),TS=l(9,e=>m(e.c,e.j?`Copied`:`Copy`)),ES=l(10,e=>{bS(e),pS(e)}),DS=j(18),OS=s(13,e=>DS(e,e.m.some(t=>t.id===e.l)?e.l:e.m[0]?.id??null)),kS=l(11,e=>{OS(e),gS(e)}),AS=r(`k3`,e=>o(e.b,`click`,function(){(async()=>{await e.h()&&(TS(e,!0),setTimeout(()=>{TS(e,!1)},1500))})()}));function jS(e){_(e.a,`_ix`),_(e.b,`_q`),TS(e,!1),ES(e,!1),kS(e,null),AS(e)}var MS=j(12,e=>{NS(e,e.m[0]?.title),PS(e,e.m[0]?.agent),IS(e,e.m.length),OS(e),vS(e)}),NS=j(16,CS),PS=j(17,wS),FS=C(3,`<button type=button> </button>`,` D `,SS,`<span><button type=button> </button><select aria-label="Send comments to session"></select></span>`,` D D l `,hS),IS=(e,t)=>FS(e,t===1?0:t?1:2),LS=(e,t)=>MS(e,t||[]),RS=j(7),zS=j(8),BS=e=>t=>{kS(e._,t)};d(`k0`,BS);var VS=40,HS;function US(e){return e.length>=200?null:[...new Set(e.map(e=>e.key))]}function WS(e,t){let n=t.trim();if(!n)return[];if(HS&&HS.files===e&&HS.query===n)return HS.hits;let r=qS(e,n);return HS={files:e,query:n,hits:r},r}var GS=new WeakMap;function KS(e){let t=GS.get(e);if(!t){let n={additions:new Set,deletions:new Set};if(e.fileDiff){let n=tx(e.fileDiff,`additions`),r=tx(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};GS.set(e,t)}return t}function qS(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)){JS(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}=KS(t),l=new Set;YS(t,s,`additions`,r,n,l,a,o.additions),YS(t,c,`deletions`,r,n,l,a,o.deletions),a.length===e&&JS(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 JS(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 YS(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>=VS)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:XS(d,f,r.length)}))}}function XS(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 ZS=((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>`)(ge,Te,Je,$e),QS=((e,t,n,r)=>` D D/${e}&l b D l D/${t}&l D/${n}&l D/${r}&m`)(ve,ie,Le,gt),$S=r(`j8`,e=>e.ah=!!e.a1),eC=s(44,$S),tC=r(`j7`,e=>a(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),Ux(``,null),yC(e,{query:``,hit:null,keys:[]})}},onDestroy:function(){e.al&&clearTimeout(e.al),this.abort.abort(),Ux(``,null),yC(e,{query:``,hit:null,keys:[]})}})),nC=s(59,tC,11),rC=s(29,e=>_(e.a,[`_ez`,e.a0&&`_eI`,!e.a1&&`_ey`])),iC=s(41,e=>m(e.f,e.a1&&(e.a4||``).trim()?e.ab?`${e.ae+1}/${e.ab}`:`0/0`:``),3),aC=s(38,e=>{S(e.g,`disabled`,!e.ab||!e.a1),S(e.i,`disabled`,!e.ab||!e.a1)}),oC=u(27,e=>{S(e.a,`aria-hidden`,e.a1?`false`:`true`),S(e.d,`tabindex`,e.a1?0:-1),S(e.g,`tabindex`,e.a1?0:-1),S(e.i,`tabindex`,e.a1?0:-1),S(e.k,`tabindex`,e.a1?0:-1),eC(e),nC(e),rC(e),iC(e),aC(e)}),sC=s(16,e=>oC(e,e.o,e.p)),cC=j(14,sC),lC=j(15,sC),uC=(e,t)=>FC(e,t?.length),dC=s(32,e=>uC(e,WS(e.x,e.a4||``))),fC=j(56,nC),pC=s(53,e=>fC(e,KC(e)),4),mC=s(55,e=>y(e,`d`,e.a4||``,qC(e))),hC=u(30,e=>{dC(e),pC(e),nC(e),mC(e),iC(e)}),gC=s(19,e=>hC(e,e.r,e.s)),_C=j(17,gC),vC=j(18,gC),yC=u(33),bC=s(22,e=>yC(e,e.u,e.v)),xC=j(20,bC),SC=j(21,bC),CC=j(40,e=>{pC(e),iC(e)}),wC=s(39,e=>CC(e,e.ab?Math.min(e.a9,e.ab-1):-1)),TC=j(54,e=>{nC(e),mC(e)}),EC=s(52,e=>TC(e,JC(e)),3),DC=j(51,e=>{EC(e),pC(e)}),OC=s(45,e=>DC(e,YC(e)),2),kC=l(35,e=>{wC(e),OC(e)}),AC=(e,t)=>zC(e,t.open),jC=(e,t)=>{BC(e,t.timer),VC(e,t.tick),HC(e,t.wasOpen)},MC=j(58,e=>{M(e,e.aw),nC(e)}),NC=r(`j6`,e=>{T(e,`d`),o(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))}}),o(e.g,`mousedown`,function(e){e.preventDefault()}),o(e.g,`click`,function(){e.au(-1)}),o(e.i,`mousedown`,function(e){e.preventDefault()}),o(e.i,`click`,function(){e.au(1)}),o(e.k,`mousedown`,function(e){e.preventDefault()}),o(e.k,`click`,function(){e.av()})});function PC(e){_(e.b,`_eA`),Xe(e.c),N(e.c,13),Ze(e.c),_(e.e,`_eD`),xt(e.h),ze(e.h,14),St(e.h),F(e.j),nt(e.j,14),pt(e.j),Ve(e.l),ft(e.l,14),at(e.l),kC(e,0),AC(e,{open:!1}),jC(e,{timer:0,tick:0,wasOpen:!1}),MC(e,XC(e)),NC(e)}var FC=j(37,e=>{wC(e),iC(e),aC(e)}),IC=j(23,e=>{dC(e),OC(e),EC(e)}),LC=j(57,nC),RC=s(48,e=>LC(e,ZC(e))),zC=j(43,e=>{OC(e),EC(e),pC(e),RC(e),eC(e),nC(e)}),BC=j(47,e=>{EC(e),pC(e),RC(e),nC(e)}),VC=j(49,nC),HC=j(50,nC),UC=j(24,e=>{S(e.k,`hidden`,e.y),nC(e)}),WC=j(25,nC),GC=j(26,e=>{_(e.d,[ut,e.a0&&`_eK`]),_(e.g,[it,e.a0&&`_eL`]),_(e.i,[it,e.a0&&`_eL`]),_(e.k,[it,e.a0&&`_eL`]),rC(e)}),KC=e=>t=>{e.ah&&(e.al&&=(clearTimeout(e.al),0),e.ap(e.a4||``,(e.ae<0?0:e.ae)+t))},qC=e=>function(t){e.as(t)},JC=e=>t=>{if(!e.ah)return;hC(e,t),kC(e,0);let n=WS(e.x,t);Ux(t,n[0]??null,US(n)??void 0),e.al&&clearTimeout(e.al),e.al=setTimeout(()=>{e.al=0,e.ap(t,0)},80)},YC=e=>(t,n)=>{if(!e.ah)return;let r=WS(e.x,t),i=[...new Set(r.map(e=>e.key))];if(!r.length){kC(e,0),Ux(t,null,i),yC(e,{query:t,hit:null,keys:i});return}kC(e,(n%r.length+r.length)%r.length);let a=r[e.a9];Ux(t,a,US(r)??void 0),yC(e,{query:t,hit:a,keys:i})},XC=e=>()=>{let t=e.d;t&&(t.focus(),t.select(),document.activeElement!==t&&setTimeout(()=>{t.focus(),t.select()},0))},ZC=e=>()=>{e.d?.blur(),oC(e,!1),e.ah=!1,e.al&&=(clearTimeout(e.al),0),Ux(``,null),yC(e,{query:``,hit:null,keys:[]})};d(`j4`,KC),d(`j1`,qC),d(`j3`,JC),d(`j2`,YC),d(`j0`,XC),d(`j5`,ZC);var QC=`_iN _y`;function $C(e){let t=e.replace(/^origin\//,``);return ew(t.includes(`/`)?t.slice(t.lastIndexOf(`/`)+1):t)}function ew(e){return e.replace(/-[a-z0-9]{1,6}$/i,``)||e}function tw(e,t){if(!t)return``;let n=e.replace(/^origin\//,``),r=t.replace(/^origin\//,``);return n.startsWith(`${r}-`)?n.slice(r.length+1):``}function nw(e){let t=ew(e);if(t.length<=20)return t;let n=t.split(`-`);return n.length>1?n[n.length-1]:t}function rw(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||$C(o):nw(a),topic:s?tw(a,o):``,title:a===i?i:`${a} vs ${i}`}}function iw(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||$C(i),t=tw(r,i);return t?`${e} [${t}]`:e}return nw(r)}var aw=`_jx _x`,ow=`<div><!><span><span> </span><span aria-hidden=true>vs</span><span> </span><!></span><!><!><!><!><span><span><!> file<!></span><!><!><!></span></div>`,sw=` D%b D D l b D l%l%b%b%b%b E%c%l%b%b%m`,cw=c(8,0,e=>m(e.b,e._.b0)),lw=e=>{cw._(e),_(e.a,[`_N`,te.accent,`_jD`])},uw=s(2,e=>S(e.a,`title`,`${e._.ac?`#${e._.ac.number}`:e._.ag} is already in ${e._.ae}; showing the working tree only`),2),dw=c(11,0,uw),fw=e=>{dw._(e),pw._(e),mw._(e),_(e.a,[`_N`,`_jE`])},pw=c(11,0,e=>{m(e.b,e._.ae),uw(e)}),mw=c(11,0,uw),hw=c(9,0,e=>m(e.b,Nx(e._.ap,7))),gw=e=>{hw._(e),_(e.a,[`_N`,`_jE`])},_w=c(1,1,e=>m(e.b,vt(e._.ao))),vw=e=>{_w._(e),_(e.a,[aw,`_jy`])},yw=s(4,e=>S(e.a,`title`,`${e._.al}: ${e._.af} ${e._.am} vs ${e._.ae} ${e._.an}`),4),bw=c(1,0,yw),xw=e=>{bw._(e),Sw._(e),Cw._(e),ww._(e),Tw._(e),Ew._(e),Dw._(e),_(e.a,[`_u`,`_v`]),_(e.c,aw)},Sw=c(1,0,yw),Cw=c(1,0,e=>m(e.b,e._.aj)),ww=c(1,0,e=>S(e.a,`href`,`${e._.ak}/files`)),Tw=c(1,0,e=>{m(e.d,e._.al),yw(e)}),Ew=c(1,0,yw),Dw=c(1,0,yw),Ow=c(18,0,e=>m(e.b,e._.a7)),kw=r(`x2`,e=>o(e.a,`click`,function(){e._.aa()})),Aw=e=>{Ow._(e),jw._(e),kw(e)},jw=c(18,0,e=>{_(e.a,[`_jw`,{_jv:e._.a8}]),S(e.a,`aria-pressed`,e._.a8?`true`:`false`),S(e.a,`title`,e._.a8?`Show every file`:`Show only files changed since your last visit`)}),Mw=c(17,0,e=>m(e.b,e._.a5)),Nw=r(`x1`,e=>o(e.a,`click`,function(){e._.a6()})),Pw=e=>{Mw._(e),_(e.a,`_jw`),Nw(e)},Fw=c(16,0,e=>m(e.b,e._.a2)),Iw=e=>{Fw._(e),Lw._(e),_(e.a,`_jt`),_(e.c,`_ju`)},Lw=c(16,0,e=>m(e.d,e._.a3)),Rw=s(3,e=>m(e.b,iw(e._.ag,e._.w,e._.x)),2),zw=c(12,0,Rw),Bw=e=>{zw._(e),Vw._(e),Uw._(e),Ww._(e),Gw._(e),Kw._(e),_(e.a,[`_N`,`_jE`])},Vw=c(12,0,Rw),Hw=s(4,e=>S(e.a,`title`,`This view is ${Nx(e._.am)} (${e._.af}); checked out is ${Nx(e._.au)} (${e._.ag})`),3),Uw=c(12,0,Hw),Ww=c(12,0,e=>{Hw(e),Rw(e)}),Gw=c(12,0,Hw),Kw=c(12,0,e=>{m(e.c,Nx(e._.au,7)),Hw(e)}),qw=c(10,0,e=>S(e.a,`disabled`,e._.y)),Jw=r(`x0`,e=>o(e.a,`click`,function(){e._.z()})),Yw=e=>{qw._(e),Zw._(e),Qw._(e),$w._(e),_(e.a,[`_N`,te.warn,`_jE`]),Jw(e)},Xw=s(3,e=>S(e.a,`title`,`origin/${e._.af} ${e._.am} · GitHub ${e._.ar}. Reload to re-ask GitHub`),2),Zw=c(10,0,Xw),Qw=c(10,0,e=>{m(e.b,Nx(e._.am,7)),Xw(e)}),$w=c(10,0,e=>{m(e.c,Nx(e._.ar,7)),Xw(e)}),eT=(e,t)=>{nT(e,t?.pr),dT(e,t?.base),fT(e,t?.branch),pT(e,t?.worktree),hT(e,t?.head),gT(e,t?.baseSha),_T(e,t?.full_name),yT(e,t?.rev),xT(e,t?.githubDrift),wT(e,t?.contained),TT(e,t?.localHead)},tT=C(1,`<a target=_blank rel=noopener>#<!></a><span> </span>`,` Db%l D `,xw,`<span> </span>`,` D `,vw),nT=j(38,e=>{aT(e,e.ac?.baseRefName),oT(e,e.ac?.headRefName),sT(e,e.ac?.number),cT(e,e.ac?.url),lT(e,e.ac?.title),uT(e,e.ac?.headRefOid),tT(e,+!e.ac),dw(e)}),rT=(e,t)=>{OT(e,t?.title),kT(e,t?.base),AT(e,t?.head),MT(e,t?.topic)},iT=s(43,e=>rT(e,rw(e.ad||e.ae,e.af||e.ag,e.w,e.x)),5),aT=j(39,iT),oT=j(41,e=>{iT(e),Zw(e),Uw(e),Sw(e)}),sT=j(45,Cw),cT=j(46,ww),lT=j(47,Tw),uT=j(53,$w),dT=j(40,e=>{iT(e),bw(e),pw(e)}),fT=j(42,e=>{iT(e),Ww(e),mw(e)}),pT=j(44),mT=s(59,e=>S(e.c,`title`,`${e.aw} · ${e.am.slice(0,7)}…${e.an.slice(0,7)}`),2),hT=j(48,e=>{mT(e),Qw(e),Gw(e),Ew(e)}),gT=j(49,e=>{mT(e),Dw(e)}),_T=j(50,_w),vT=C(9,`<span title="One commit against its parent">commit <!></span>`,` Db%`,gw),yT=j(51,e=>{vT(e,+!e.ap),hw(e)}),bT=C(10,`<button type=button>behind GitHub <!> → <!></button>`,` Db%c%`,Yw),xT=(e,t)=>bT(e,+!t),ST=C(11,`<span>already in <!></span>`,` Db%`,fw),CT=s(55,e=>ST(e,e.as&&e.a0?0:1)),wT=j(54,CT),TT=j(56,Kw),ET=e=>{S(e.a,`data-pr`,e.ac?`${e.ai}/${e.ac.number}`:void 0)},DT=j(21,e=>{eT(e,e.v),ET(e)}),OT=j(58,mT),kT=(e,t)=>m(e.e,t),AT=(e,t)=>m(e.h,t),jT=C(8,`<span> </span>`,` D `,lw),MT=j(62,e=>{jT(e,+!e.b0),cw(e)}),NT=j(22,e=>{iT(e),zw(e)}),PT=j(23,e=>{iT(e),Vw(e)});function FT(e){_(e.a,`_jr`),_(e.c,`_jz`),_(e.d,[`_N`,`_jA`]),_(e.f,[`_P`,`_jC`]),_(e.g,[`_N`,`_jB`]),_(e.n,`_js`)}var IT=j(26,e=>{m(e.o,e.a0),m(e.p,e.a0===1?``:`s`),CT(e)}),LT=C(12,`<span>local <!><!></span>`,` Db%b%`,Bw),RT=(e,t)=>LT(e,+!t),zT=C(16,`<span>+<!></span><span>−<!></span>`,` Db%l Db%`,Iw),BT=s(30,e=>zT(e,e.a2||e.a3?0:1)),VT=j(28,e=>{BT(e),Fw(e)}),HT=j(29,e=>{BT(e),Lw(e)}),UT=C(17,`<button type=button title="Filtered out of the list — show every file"><!> hidden</button>`,` D%`,Pw),WT=j(31,e=>{UT(e,+!e.a5),Mw(e)}),GT=C(18,`<button type=button><!> new</button>`,` D%`,Aw),KT=s(35,e=>GT(e,e.a7||e.a8?0:1)),qT=j(33,e=>{KT(e),Ow(e)}),JT=j(34,e=>{KT(e),jw(e)}),YT=j(24,qw),XT=j(25),ZT=j(32),QT=j(36),$T=`<!><!><!>`,eE=c(1,0,e=>m(e.b,e._.e)),tE=e=>{eE._(e),_(e.a,[QC,`_iJ`])},nE=c(6,0,e=>m(e.b,e._.r)),rE=e=>{nE._(e),_(e.a,[`_u`,`_v`,`_iO`])},iE=A(34,e=>JT(e.c,e._._.k),e=>e._._),aE=e=>{iE(e),oE(e),sE(e),cE(e),lE(e),dE(e),fE(e),pE(e),hE(e),_E(e),vE(e),yE(e),bE(e),xE(e),CE(e),_(e.a,`_iP`),FT(e.c)},oE=A(35,e=>QT(e.c,e._._.l),e=>e._._),sE=A(36,e=>ZT(e.c,e._._.m),e=>e._._),cE=A(37,e=>NT(e.c,e._._.n),e=>e._._),lE=A(38,e=>PT(e.c,e._._.o),e=>e._._),uE=s(9,e=>RT(e.c,e._._.p.has(e.i))),dE=A(39,uE,e=>e._._),fE=A(40,e=>XT(e.c,e._._.q),e=>e._._),pE=A(41,e=>YT(e.c,e._._.r),e=>e._._),mE=(e,t)=>{DT(e.c,t),wE(e,t?.worktree),TE(e,t?.files?.length),EE(e,t?.id)},hE=A(43,e=>mE(e,e._._.t),e=>e._._),gE=s(7,e=>IT(e.c,e._._.v||e.g)),_E=A(45,gE,e=>e._._),vE=A(46,e=>VT(e.c,e._._.w),e=>e._._),yE=A(47,e=>HT(e.c,e._._.x),e=>e._._),bE=A(48,e=>qT(e.c,e._._.y),e=>e._._),xE=A(49,e=>WT(e.c,e._._.z),e=>e._._),SE=C(1,`<span> </span>`,` D `,tE),CE=A(50,e=>SE(e,+!!e._._.a0),e=>e._._),wE=j(4,eE),TE=j(6,gE),EE=j(8,uE),DE=s(20,e=>_(e.a,[`_iI`,{_iG:e.s,_iH:e.t}])),OE=j(19,e=>{S(e.b,`title`,e.t?`Show this section's files`:`Hide this section's files`),S(e.b,`aria-expanded`,e.t?`false`:`true`),DE(e)}),kE=s(12,e=>OE(e,e._._._.h.has(e.l))),AE=A(33,kE,e=>e._._._),jE=e=>{AE(e),PE(e),_(e.b,`_iL`),_(e.c,`_iM`),_(e.d,`_iK`),_(e.e,QC)},ME=j(18,e=>{S(e.a,`aria-selected`,e.s?`true`:`false`),DE(e)}),NE=s(13,e=>ME(e,e._._._.u===e.l)),PE=A(44,NE,e=>e._._._),FE=(e,t)=>{LE(e,t?.id),BE(e,t?.pr),HE(e,t?.worktree)},IE=r(`y1`,e=>{o(e.b,`click`,function(){e._._._.i(e.l)}),o(e.d,`click`,function(){e._._._.j(e.l)})}),LE=j(11,e=>{NE(e),kE(e),IE(e)}),RE=C(6,`<span>#<!></span>`,` Db%`,rE),zE=s(16,e=>S(e.a,`data-pr`,e.o?`${e.p}/${e.o.number}`:void 0)),BE=j(14,e=>{VE(e,e.o?.number),RE(e,+!e.o),zE(e)}),VE=j(17,nE),HE=j(15,e=>{m(e.f,e.p),zE(e)}),UE=FE,WE=i(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%`,jE,(e,t)=>UE(e,t[0]?.repo)),GE=A(31,e=>WE(e,[e._._.d,e=>e.repo.id]),e=>e._._),KE=r(`y3`,e=>o(e.a,`scroll`,function(){e._._.a4(e.a)})),qE=e=>{GE(e),XE(e),QE(e),$E(e),eD(e),KE(e)},JE=r(`y2`,e=>a(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()}})),YE=s(1,JE),XE=A(32,YE,e=>e._._),ZE=s(2,e=>_(e.a,[`_iF`,{_iE:e._._.a2,_iD:e._._.a3}])),QE=A(51,ZE,e=>e._._),$E=A(52,ZE,e=>e._._),eD=A(53,YE,e=>e._._),tD=C(2,(e=>`<div><!>${e}</div>`)(ow),(e=>` D%b/${e}&l`)(sw),aE),nD=c(0,0,e=>tD(e,+!e._.s)),rD=e=>{nD._(e),aD._(e)},iD=C(1,`<div role=tablist></div>`,` `,qE),aD=c(0,0,e=>{_(e.a,[`_iC`,{_iB:e._.a0}]),iD(e,+!e._.a0)}),oD=j(18,e=>{cD(e,e.s?.repo),uD(e,e.s?.files),dD(e,e.s?.additions),fD(e,e.s?.deletions),pD(e,e.s?.fresh),mD(e,e.s?.hidden),nD(e)}),sD=g(hE),cD=j(19,e=>{lD(e,e.t?.id),sD(e)}),lD=j(20,g(PE)),uD=j(21,g(_E)),dD=j(22,g(vE)),fD=j(23,g(yE)),pD=j(24,g(bE)),mD=j(25,g(xE)),hD=s(5,e=>oD(e,e.d.find(t=>t.repo.id===e.e)||e.d[0])),gD=g(GE),_D=j(3,e=>{CD(e,e.d?.length),hD(e),gD(e)}),vD=j(4,hD),yD=g(CE),bD=j(26,e=>{aD(e),yD(e)}),xD=C(0,`<div><!><!></div>`,` D%b%`,rD),SD=g(XE),CD=j(6,e=>{bD(e,e.g>1),xD(e,+!e.g),SD(e)}),wD=j(30,g(eD)),TD=e=>{wD(e,VD(e))},ED=l(27,e=>{DD(e,e.a1?.end),OD(e,e.a1?.start),TD(e)}),DD=j(28,g(QE)),OD=j(29,g($E));function kD(e){ED(e,{start:!1,end:!1})}var AD=j(7,g(AE)),jD=j(8),MD=j(9),ND=j(10,g(iE)),PD=j(11,g(oE)),FD=j(12,g(sE)),ID=j(13,g(cE)),LD=j(14,g(lE)),RD=j(15,g(dE)),zD=j(16,g(fE)),BD=j(17,g(pE)),VD=e=>t=>{let n=t.scrollWidth-t.clientWidth-t.scrollLeft>1,r=t.scrollLeft>1;(n!==e.a2||r!==e.a3)&&ED(e,{start:r,end:n})};d(`y0`,VD);var HD=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
1532
1532
  <symbol id="file-tree-icon-chevron" viewBox="0 0 16 16">
1533
1533
  <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"/>
1534
1534
  </symbol>
@@ -1545,72 +1545,72 @@ diff --git`)}function Qg(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.star
1545
1545
  <symbol id="file-tree-icon-ellipsis" viewBox="0 0 16 16">
1546
1546
  <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" />
1547
1547
  </symbol>
1548
- </svg>`,nE=`<symbol id="file-tree-builtin-astro" viewBox="0 0 16 16">
1548
+ </svg>`,UD=`<symbol id="file-tree-builtin-astro" viewBox="0 0 16 16">
1549
1549
  <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"/>
1550
1550
  <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"/>
1551
- </symbol>`,rE=`<symbol id="file-tree-builtin-babel" viewBox="0 0 16 16">
1551
+ </symbol>`,WD=`<symbol id="file-tree-builtin-babel" viewBox="0 0 16 16">
1552
1552
  <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"/>
1553
- </symbol>`,iE=`<symbol id="file-tree-builtin-bash" viewBox="0 0 16 16">
1553
+ </symbol>`,GD=`<symbol id="file-tree-builtin-bash" viewBox="0 0 16 16">
1554
1554
  <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"/>
1555
1555
  <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"/>
1556
- </symbol>`,aE=`<symbol id="file-tree-builtin-biome" viewBox="0 0 16 16">
1556
+ </symbol>`,KD=`<symbol id="file-tree-builtin-biome" viewBox="0 0 16 16">
1557
1557
  <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"/>
1558
- </symbol>`,oE=`<symbol id="file-tree-builtin-bootstrap" viewBox="0 0 16 16">
1558
+ </symbol>`,qD=`<symbol id="file-tree-builtin-bootstrap" viewBox="0 0 16 16">
1559
1559
  <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"/>
1560
1560
  <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"/>
1561
- </symbol>`,sE=`<symbol id="file-tree-builtin-browserslist" viewBox="0 0 16 16">
1561
+ </symbol>`,JD=`<symbol id="file-tree-builtin-browserslist" viewBox="0 0 16 16">
1562
1562
  <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"/>
1563
1563
  <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"/>
1564
1564
  <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"/>
1565
- </symbol>`,cE=`<symbol id="file-tree-builtin-bun" viewBox="0 0 16 16">
1565
+ </symbol>`,YD=`<symbol id="file-tree-builtin-bun" viewBox="0 0 16 16">
1566
1566
  <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"/>
1567
- </symbol>`,lE=`<symbol id="file-tree-builtin-c" viewBox="0 0 16 16">
1567
+ </symbol>`,XD=`<symbol id="file-tree-builtin-c" viewBox="0 0 16 16">
1568
1568
  <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"/>
1569
- </symbol>`,uE=`<symbol id="file-tree-builtin-claude" viewBox="0 0 16 16">
1569
+ </symbol>`,ZD=`<symbol id="file-tree-builtin-claude" viewBox="0 0 16 16">
1570
1570
  <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"/>
1571
- </symbol>`,dE=`<symbol id="file-tree-builtin-cpp" viewBox="0 0 16 16">
1571
+ </symbol>`,QD=`<symbol id="file-tree-builtin-cpp" viewBox="0 0 16 16">
1572
1572
  <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"/>
1573
- </symbol>`,fE=`<symbol id="file-tree-builtin-css" viewBox="0 0 16 16">
1573
+ </symbol>`,$D=`<symbol id="file-tree-builtin-css" viewBox="0 0 16 16">
1574
1574
  <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"/>
1575
1575
  <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"/>
1576
- </symbol>`,pE=`<symbol id="file-tree-builtin-database" viewBox="0 0 16 16">
1576
+ </symbol>`,eO=`<symbol id="file-tree-builtin-database" viewBox="0 0 16 16">
1577
1577
  <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"/>
1578
1578
  <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"/>
1579
1579
  <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"/>
1580
- </symbol>`,mE=`<symbol id="file-tree-builtin-default" viewBox="0 0 16 16">
1580
+ </symbol>`,tO=`<symbol id="file-tree-builtin-default" viewBox="0 0 16 16">
1581
1581
  <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"/>
1582
1582
  <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"/>
1583
- </symbol>`,hE=`<symbol id="file-tree-builtin-docker" viewBox="0 0 16 16">
1583
+ </symbol>`,nO=`<symbol id="file-tree-builtin-docker" viewBox="0 0 16 16">
1584
1584
  <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"/>
1585
1585
  <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"/>
1586
- </symbol>`,gE=`<symbol id="file-tree-builtin-eslint" viewBox="0 0 16 16">
1586
+ </symbol>`,rO=`<symbol id="file-tree-builtin-eslint" viewBox="0 0 16 16">
1587
1587
  <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"/>
1588
1588
  <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"/>
1589
- </symbol>`,_E=`<symbol id="file-tree-builtin-font" viewBox="0 0 16 16">
1589
+ </symbol>`,iO=`<symbol id="file-tree-builtin-font" viewBox="0 0 16 16">
1590
1590
  <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"/>
1591
- </symbol>`,vE=`<symbol id="file-tree-builtin-git" viewBox="0 0 16 16">
1591
+ </symbol>`,aO=`<symbol id="file-tree-builtin-git" viewBox="0 0 16 16">
1592
1592
  <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"/>
1593
- </symbol>`,yE=`<symbol id="file-tree-builtin-go" viewBox="0 0 16 16">
1593
+ </symbol>`,oO=`<symbol id="file-tree-builtin-go" viewBox="0 0 16 16">
1594
1594
  <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"/>
1595
- </symbol>`,bE=`<symbol id="file-tree-builtin-graphql" viewBox="0 0 16 16">
1595
+ </symbol>`,sO=`<symbol id="file-tree-builtin-graphql" viewBox="0 0 16 16">
1596
1596
  <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"/>
1597
- </symbol>`,xE=`<symbol id="file-tree-builtin-html" viewBox="0 0 16 16">
1597
+ </symbol>`,cO=`<symbol id="file-tree-builtin-html" viewBox="0 0 16 16">
1598
1598
  <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"/>
1599
1599
  <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"/>
1600
- </symbol>`,SE=`<symbol id="file-tree-builtin-image" viewBox="0 0 16 16">
1600
+ </symbol>`,lO=`<symbol id="file-tree-builtin-image" viewBox="0 0 16 16">
1601
1601
  <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"/>
1602
1602
  <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"/>
1603
- </symbol>`,CE=`<symbol id="file-tree-builtin-javascript" viewBox="0 0 16 16">
1603
+ </symbol>`,uO=`<symbol id="file-tree-builtin-javascript" viewBox="0 0 16 16">
1604
1604
  <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"/>
1605
1605
  <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"/>
1606
- </symbol>`,wE=`<symbol id="file-tree-builtin-json" viewBox="0 0 16 16">
1606
+ </symbol>`,dO=`<symbol id="file-tree-builtin-json" viewBox="0 0 16 16">
1607
1607
  <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"/>
1608
- </symbol>`,TE=`<symbol id="file-tree-builtin-markdown" viewBox="0 0 16 16">
1608
+ </symbol>`,fO=`<symbol id="file-tree-builtin-markdown" viewBox="0 0 16 16">
1609
1609
  <path fill="currentColor" d="M1 12V4h2l2 2.5L7 4h2v8H7V7.5l-2 2-2-2V12zm9-3 3 3.5L16 9h-2V4h-2v5z"/>
1610
- </symbol>`,EE=`<symbol id="file-tree-builtin-mcp" viewBox="0 0 16 16">
1610
+ </symbol>`,pO=`<symbol id="file-tree-builtin-mcp" viewBox="0 0 16 16">
1611
1611
  <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"/>
1612
1612
  <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"/>
1613
- </symbol>`,DE=`<symbol id="file-tree-builtin-nextjs" viewBox="0 0 16 16">
1613
+ </symbol>`,mO=`<symbol id="file-tree-builtin-nextjs" viewBox="0 0 16 16">
1614
1614
  <defs>
1615
1615
  <linearGradient id="a" x1="4.522" x2="14" y1="3.943" y2="16" gradientUnits="userSpaceOnUse">
1616
1616
  <stop stop-color="currentColor"/>
@@ -1620,82 +1620,82 @@ diff --git`)}function Qg(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.star
1620
1620
  <path fill="currentColor" d="M3 2h1.522v9.09H3z"/>
1621
1621
  <path fill="url(#a)" d="M4.903 2 15 15.075q-.565.5-1.195.925L4.522 3.943z"/>
1622
1622
  <path fill="currentColor" d="M12.172 2h-1.508v9.094h1.508z"/>
1623
- </symbol>`,OE=`<symbol id="file-tree-builtin-npm" viewBox="0 0 16 16">
1623
+ </symbol>`,hO=`<symbol id="file-tree-builtin-npm" viewBox="0 0 16 16">
1624
1624
  <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"/>
1625
1625
  <path fill="currentColor" d="M10.5 13H13V3H3v10h5V5.5h2.5z"/>
1626
- </symbol>`,kE=`<symbol id="file-tree-builtin-oxc" viewBox="0 0 16 16">
1626
+ </symbol>`,gO=`<symbol id="file-tree-builtin-oxc" viewBox="0 0 16 16">
1627
1627
  <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"/>
1628
- </symbol>`,AE=`<symbol id="file-tree-builtin-postcss" viewBox="0 0 16 16">
1628
+ </symbol>`,_O=`<symbol id="file-tree-builtin-postcss" viewBox="0 0 16 16">
1629
1629
  <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"/>
1630
- </symbol>`,jE=`<symbol id="file-tree-builtin-prettier" viewBox="0 0 16 16">
1630
+ </symbol>`,vO=`<symbol id="file-tree-builtin-prettier" viewBox="0 0 16 16">
1631
1631
  <path fill="currentColor" d="M6 12v1H4.93v-1zm1-2v1H2v-1zm6-4v1h-3V6zm-1-4v1H9V2z"/>
1632
1632
  <path fill="currentColor" d="M11.5 10v1H8v-1zM5 6v1H2V6zm5-2v1H9V4z" opacity=".8"/>
1633
1633
  <path fill="currentColor" d="M6 14v1H2v-1zm-.5-6v1H2V8zM13 4v1h-3V4zM4.93 2v1H2V2z" opacity=".6"/>
1634
1634
  <path fill="currentColor" d="M4.93 12v1H2v-1zM13 8v1H9V8zM5.5 4v1H2V4zM9 2v1H4.93V2z" opacity=".4"/>
1635
- </symbol>`,ME=`<symbol id="file-tree-builtin-python" viewBox="0 0 16 16">
1635
+ </symbol>`,yO=`<symbol id="file-tree-builtin-python" viewBox="0 0 16 16">
1636
1636
  <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"/>
1637
1637
  <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"/>
1638
- </symbol>`,NE=`<symbol id="file-tree-builtin-react" viewBox="0 0 16 16">
1638
+ </symbol>`,bO=`<symbol id="file-tree-builtin-react" viewBox="0 0 16 16">
1639
1639
  <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"/>
1640
1640
  <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"/>
1641
- </symbol>`,PE=`<symbol id="file-tree-builtin-ruby" viewBox="0 0 16 16">
1641
+ </symbol>`,xO=`<symbol id="file-tree-builtin-ruby" viewBox="0 0 16 16">
1642
1642
  <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"/>
1643
- </symbol>`,FE=`<symbol id="file-tree-builtin-rust" viewBox="0 0 16 16">
1643
+ </symbol>`,SO=`<symbol id="file-tree-builtin-rust" viewBox="0 0 16 16">
1644
1644
  <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"/>
1645
- </symbol>`,IE=`<symbol id="file-tree-builtin-sass" viewBox="0 0 16 16">
1645
+ </symbol>`,CO=`<symbol id="file-tree-builtin-sass" viewBox="0 0 16 16">
1646
1646
  <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"/>
1647
- </symbol>`,LE=`<symbol id="file-tree-builtin-stylelint" viewBox="0 0 16 16">
1647
+ </symbol>`,wO=`<symbol id="file-tree-builtin-stylelint" viewBox="0 0 16 16">
1648
1648
  <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"/>
1649
1649
  <path fill="currentColor" d="M6.5 2.5V4l-2 1.5v-4zm5 3L9.5 4V2.5l2-1zM9 4H7V2.5h2z"/>
1650
- </symbol>`,RE=`<symbol id="file-tree-builtin-svelte" viewBox="0 0 16 16">
1650
+ </symbol>`,TO=`<symbol id="file-tree-builtin-svelte" viewBox="0 0 16 16">
1651
1651
  <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"/>
1652
- </symbol>`,zE=`<symbol id="file-tree-builtin-svg" viewBox="0 0 16 16">
1652
+ </symbol>`,EO=`<symbol id="file-tree-builtin-svg" viewBox="0 0 16 16">
1653
1653
  <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"/>
1654
1654
  <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"/>
1655
- </symbol>`,BE=`<symbol id="file-tree-builtin-svgo" viewBox="0 0 16 16">
1655
+ </symbol>`,DO=`<symbol id="file-tree-builtin-svgo" viewBox="0 0 16 16">
1656
1656
  <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"/>
1657
1657
  <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"/>
1658
- </symbol>`,VE=`<symbol id="file-tree-builtin-swift" viewBox="0 0 16 16">
1658
+ </symbol>`,OO=`<symbol id="file-tree-builtin-swift" viewBox="0 0 16 16">
1659
1659
  <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"/>
1660
- </symbol>`,HE=`<symbol id="file-tree-builtin-table" viewBox="0 0 16 16">
1660
+ </symbol>`,kO=`<symbol id="file-tree-builtin-table" viewBox="0 0 16 16">
1661
1661
  <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"/>
1662
1662
  <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"/>
1663
- </symbol>`,UE=`<symbol id="file-tree-builtin-tailwind" viewBox="0 0 16 16">
1663
+ </symbol>`,AO=`<symbol id="file-tree-builtin-tailwind" viewBox="0 0 16 16">
1664
1664
  <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"/>
1665
- </symbol>`,WE=`<symbol id="file-tree-builtin-terraform" viewBox="0 0 16 16">
1665
+ </symbol>`,jO=`<symbol id="file-tree-builtin-terraform" viewBox="0 0 16 16">
1666
1666
  <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"/>
1667
- </symbol>`,GE=`<symbol id="file-tree-builtin-text" viewBox="0 0 16 16">
1667
+ </symbol>`,MO=`<symbol id="file-tree-builtin-text" viewBox="0 0 16 16">
1668
1668
  <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"/>
1669
1669
  <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"/>
1670
- </symbol>`,KE=`<symbol id="file-tree-builtin-typescript" viewBox="0 0 16 16">
1670
+ </symbol>`,NO=`<symbol id="file-tree-builtin-typescript" viewBox="0 0 16 16">
1671
1671
  <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"/>
1672
1672
  <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"/>
1673
- </symbol>`,qE=`<symbol id="file-tree-builtin-vite" viewBox="0 0 16 16">
1673
+ </symbol>`,PO=`<symbol id="file-tree-builtin-vite" viewBox="0 0 16 16">
1674
1674
  <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"/>
1675
- </symbol>`,JE=`<symbol id="file-tree-builtin-vscode" viewBox="0 0 16 16">
1675
+ </symbol>`,FO=`<symbol id="file-tree-builtin-vscode" viewBox="0 0 16 16">
1676
1676
  <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"/>
1677
1677
  <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"/>
1678
1678
  <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"/>
1679
- </symbol>`,YE=`<symbol id="file-tree-builtin-vue" viewBox="0 0 16 16">
1679
+ </symbol>`,IO=`<symbol id="file-tree-builtin-vue" viewBox="0 0 16 16">
1680
1680
  <path fill="currentColor" d="M9.62 2.25 8 5.02 6.38 2.25H1l7 12 7-12z" opacity=".5"/>
1681
1681
  <path fill="currentColor" d="M9.54 2.25 8 4.95l-1.54-2.7H4l4 7 4-7z"/>
1682
- </symbol>`,XE=`<symbol id="file-tree-builtin-wasm" viewBox="0 0 16 16">
1682
+ </symbol>`,LO=`<symbol id="file-tree-builtin-wasm" viewBox="0 0 16 16">
1683
1683
  <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"/>
1684
1684
  <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"/>
1685
1685
  <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"/>
1686
- </symbol>`,ZE=`<symbol id="file-tree-builtin-webpack" viewBox="0 0 16 16">
1686
+ </symbol>`,RO=`<symbol id="file-tree-builtin-webpack" viewBox="0 0 16 16">
1687
1687
  <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"/>
1688
1688
  <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"/>
1689
- </symbol>`,QE=`<symbol id="file-tree-builtin-yml" viewBox="0 0 16 16">
1689
+ </symbol>`,zO=`<symbol id="file-tree-builtin-yml" viewBox="0 0 16 16">
1690
1690
  <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"/>
1691
- </symbol>`,$E=`<symbol id="file-tree-builtin-zig" viewBox="0 0 16 16">
1691
+ </symbol>`,BO=`<symbol id="file-tree-builtin-zig" viewBox="0 0 16 16">
1692
1692
  <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"/>
1693
1693
  <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"/>
1694
- </symbol>`,eD=[iE,lE,dE,fE,pE,mE,_E,vE,yE,xE,SE,CE,wE,TE,EE,ME,PE,FE,VE,HE,GE,KE,`<symbol id="file-tree-builtin-zip" viewBox="0 0 16 16">
1694
+ </symbol>`,VO=[GD,XD,QD,$D,eO,tO,iO,aO,oO,cO,lO,uO,dO,fO,pO,yO,xO,SO,OO,kO,MO,NO,`<symbol id="file-tree-builtin-zip" viewBox="0 0 16 16">
1695
1695
  <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"/>
1696
1696
  <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"/>
1697
- </symbol>`],tD=[nE,rE,aE,oE,sE,cE,uE,hE,gE,bE,DE,OE,kE,AE,jE,NE,IE,LE,RE,zE,BE,UE,WE,qE,JE,YE,XE,ZE,QE,$E];function nD(e,t){return t.length===0?e:e.replace(`</svg>`,`\n ${t.join(`
1698
- `)}\n</svg>`)}var rD=nD(tE,eD),iD={minimal:tE,standard:rD,complete:nD(rD,tD)},aD={".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`},oD={"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`},sD={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},cD=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`]),lD=new Set([`complete`]);function uD(e){return iD[e===`none`?`minimal`:e]}function dD(e){return`file-tree-builtin-${e}`}function fD(e){return e!==`none`&&lD.has(e)}function pD(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=aD[t.toLowerCase()];if(i!=null&&(r||cD.has(i)))return i;for(let e of n){if(r){let t=sD[e];if(t!=null)return t}let t=oD[e];if(t!=null&&(r||cD.has(t)))return t}return`default`}var mD=`file-tree-container`,hD=`data-file-tree-style`,gD=`data-file-tree-unsafe-css`,_D=`data-file-tree-scrollbar-measure`,vD=`data-file-tree-scrollbar-gutter-measured`,yD=`--trees-scrollbar-gutter-measured`,bD=`header`,xD=`context-menu`,SD=`context-menu-trigger`;function CD(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function wD(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(CD(e)?`none`:`complete`),colored:e.colored??!0}}var TD=e=>e.trim().toLowerCase(),ED=e=>e.split(`/`).at(-1)??e,DD=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 OD(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function kD(e){let t=wD(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(TD(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=ED(o),c=s.toLowerCase(),l=r.get(c);if(l!=null)return OD(l,e);for(let[t,n]of a)if(c.includes(t))return OD(n,e);let u=DD(s);for(let t of u){let n=i.get(t);if(n!=null)return OD(n,e)}let d=pD(t.set,s,u);if(d!=null&&t.set!==`none`){if(d==="default"){let t=n?.[e];if(t!=null)return OD(t,e)}return{name:dD(d),remappedFrom:e,token:d}}}let s=n?.[e];return s==null?{name:e}:OD(s,e)}}}var AD=5,jD=32,MD=128;function ND(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function PD(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function FD(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 ID(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 LD(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function RD(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 zD(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,UD(e,t)}function BD(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=ID(e).get(t);if(i===void 0)return;let a=i>>AD;e.childVisibleChunkSums[a]+=r}function VD(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=WD(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=jD}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 HD(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>AD;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<AD}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 UD(e,t){if(t.childIds.length<MD){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/jD),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>>AD]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function WD(e,t,n,r){let i=Math.min(t.childIds.length,n+jD),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 GD=7,KD=3,qD=8,JD=4;function YD(e,t,n=0){return e<<JD|n<<KD|t}function XD(e){return e.depthAndFlags>>>JD}function ZD(e){return(e.depthAndFlags&qD)>>KD}function G(e){return(e.depthAndFlags&qD)!==0}function QD(e){return e.depthAndFlags&GD}function $D(e,t){return(QD(e)&t)!==0}function eO(e,t){e.depthAndFlags|=t}function tO(e,t){e.depthAndFlags=YD(t,QD(e),ZD(e))}var nO=Symbol(`benchmarkInstrumentation`);function rO(e,t){return t==null||Object.defineProperty(e,nO,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function iO(e){return e==null?null:e[nO]??null}function K(e,t,n){return e==null?n():e.measurePhase(t,n)}function aO(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function oO(e){return e>=48&&e<=57}function sO(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!oO(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&&oO(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 cO(e){let t=e.toLowerCase();return{lowerValue:t,tokens:sO(t)}}function lO(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 uO(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=lO(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function dO(e,t,n){let r=uO(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function fO(e,t){return dO(e,t,cO)}function pO(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function mO(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=pO(e,r);return a===pO(t,r)?fO(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 hO(e,t){return mO(e,t)}function gO(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=cO(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=pO(e,n);return o===pO(t,n)?dO(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 _O(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=cO(r);return e.sortKeyById[t]=i,i}function vO(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function yO(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 bO(e){let{hasTrailingSlash:t,segments:n}=yO(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function xO(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=yO(e);return{requiresDirectory:t,segments:n}}function SO(){let e=new Map;return e.set(``,0),{idByValue:e,valueById:[``],sortKeyById:[cO(``)]}}function CO(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 wO(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var TO=Symbol(`pathStorePreparedInputKind`);function EO(e,t){return e[TO]=t,e}function DO(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function OO(e,t,n){return n==="default"?hO(e,t):n(DO(e),DO(t))}function kO(){return{depthAndFlags:YD(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function AO(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 jO(e){return e.isDirectory?e.segments.length:e.segments.length-1}function MO(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 NO(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function PO(e,t={}){return BO(e,t).map(e=>e.path)}function FO(e,t={}){let n=BO(e,t);return EO({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function IO(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 EO({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function LO(e){let t=e,n=t.preparedPaths;if(t[TO]===`prepared`&&n!=null)return n;if(!MO(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function RO(e){let t=e;return t[TO]===`presorted`&&t.presortedPaths!=null||NO(t.presortedPaths)?t.presortedPaths:null}function zO(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function BO(e,t={}){let n=vO(t),r=iO(t);aO(r,`workload.inputFiles`,e.length);let i=K(r,`store.preparePathEntries.parse`,()=>e.map(e=>bO(e)));return K(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>OO(e,t,n.sort))),i}var VO=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[kO()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=SO();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=iO(e),this.options=vO(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,ND())}appendPaths(e){return K(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>bO(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:YD(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:YD(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:YD(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=bO(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:YD(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:YD(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=bO(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"?gO(this.lastPreparedPath,e,this.segmentSortKeyCache):OO(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=jO(e),i=n==null?0:jO(n),a=n==null?0:AO(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=CO(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:YD(XD(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),LD(i,s),s}createFileChildUnchecked(e,t){let n=CO(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:YD(XD(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),LD(r,a),a}getOrCreateDirectoryChild(e,t){let n=CO(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:YD(XD(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),LD(r,a),this.directories.set(a,ND()),a}createDirectoryChild(e,t){let n=CO(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:YD(XD(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),LD(r,a),this.directories.set(a,ND()),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($D(n,1))throw Error(`Duplicate path: "${t}"`);eO(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,PD());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=PD();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,ND());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),LD(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 zD(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function HO(e,t=`closed`,n=null){let r=WO(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 UO(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function WO(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 GO(e,t){return $D(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion!==`closed`&&XD(t)<=e.defaultExpansion}function KO(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:GO(e,n)}function qO(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!G(r))return;let i=GO(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 JO(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 YO(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function XO(e,t){let n=JO(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 ZO(e,t){let n=JO(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function QO(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 $O(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function ek(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 tk(e,t){e.directoryLoadInfoById.delete(t)}function nk(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 rk(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function ik(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function ak(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function ok(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function sk(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function ck(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function lk(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 uk(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 dk(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 fk(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 pk(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 mk(e,t,n){return{...n,visibleCountDelta:Tk(e)-t}}function hk(e,t){let n=Tk(e),r=UO();e.transactionStack.push(r);try{t()}catch(t){throw vk(e,r,!1),t}vk(e,r,!0,Tk(e)-n)}function gk(e,t){let n=e.instrumentation;if(n==null){_k(e,t);return}K(n,`store.events.record`,()=>_k(e,t))}function _k(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){Ck(e,t);return}n.events.push(t),Sk(n,t)}function vk(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?xk(i,t):K(n,`store.events.batch.merge`,()=>xk(i,t));return}let a=yk(t,r),o=e.instrumentation;if(o==null){Ck(e,a);return}K(o,`store.events.batch.commit`,()=>Ck(e,a))}function yk(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 bk(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function xk(e,t){for(let n of t.events)e.events.push(n);bk(e,t)}function Sk(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function Ck(e,t){let n=e.instrumentation;if(n==null){wk(e,t);return}K(n,`store.events.emit`,()=>wk(e,t))}function wk(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function Tk(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function Ek(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!G(n)||$D(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 Dk(e,t){let n=t;for(;;){let t=Ek(e,n);if(t==null)return n;n=t}}function Ok(e,t){let n=[t],r=t;for(;;){let t=Ek(e,r);if(t==null)return n;n.push(t),r=t}}function kk(e,t){let n=t==null?e.snapshot.rootId:Rk(e,t);return n==null?[]:Bk(e,n)}function Ak(e,t){let n=bO(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=tA(e,eA(e,r)),{createdNodeIds:a,directoryId:o}=Vk(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=Y(e,o);if($D(n,1))throw Error(`Path already exists: "${t}"`);eO(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=Uk(e,o,n.basename),s.add(c);Fk(e,o);let l=tA(e,o);return rk({affectedAncestorIds:Lk(e,c),affectedNodeIds:[...s],path:t,projectionChanged:nA(i,l)})}function jk(e,t,n){let r=Rk(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=Y(e,r);if($D(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=tA(e,a),s=Qk(e,r);Kk(e,a,r,i.nameId),$k(e,a),Fk(e,a);let c=tA(e,a);return ik({affectedAncestorIds:Lk(e,a),affectedNodeIds:s,path:t,projectionChanged:nA(o,c),recursive:n.recursive===!0})}function Mk(e,t,n,r){let i=Rk(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=Y(e,i);if($D(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=Xk(e,i,n),c=tA(e,a.parentId),l=tA(e,s.parentId),u=wO(e.snapshot.segmentTable,a.nameId),d=CO(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(G(a)&&oA(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=FD(e.snapshot.nodes,J(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&Zk(e,p,o,ZD(a))===`skip`)return null;let m=a.parentId;Kk(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),aA(e,i),Gk(e,s.parentId,i),$k(e,m),e.pathCacheVersion++,Fk(e,m),s.parentId!==m&&Fk(e,s.parentId);let h=tA(e,m),g=tA(e,s.parentId);return ak({affectedAncestorIds:[...new Set([...Lk(e,m),...Lk(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:rA([c,l],[h,g]),to:q(e,i)})}function Nk(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function Pk(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function q(e,t){let n=Y(e,t),r=Nk(e,t);if(r!=null)return r;if($D(n,2))return Pk(e,t,``);let i=q(e,n.parentId),a=wO(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return Pk(e,t,G(n)?`${o}/`:o)}function Fk(e,t){let n=e.instrumentation;if(n==null){cA(e,t);return}K(n,`store.recomputeCountsUpwardFrom`,()=>cA(e,t))}function Ik(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)){sA(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){sA(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function Lk(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 Rk(e,t){if(t.length===0)return e.snapshot.rootId;let n=xO(t);return zk(e,n.segments,n.requiresDirectory)}function zk(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=FD(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||$D(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function Bk(e,t){let n=e.snapshot.nodes[t];if(n===void 0||$D(n,4))return[];if(!G(n))return[q(e,t)];if(J(e,t).childIds.length===0)return $D(n,1)&&!$D(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||$D(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){$D(n,1)&&!$D(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 Vk(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=CO(e.snapshot.segmentTable,i),a=J(e,r),o=FD(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=Hk(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function Hk(e,t,n){let r=Y(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:YD(XD(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,ND()),Gk(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function Uk(e,t,n){let r=CO(e.snapshot.segmentTable,n),i=J(e,t);if(FD(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${uA(e,t,n)}"`);let a=Y(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:YD(XD(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),Gk(e,t,o),e.activeNodeCount++,o}function Wk(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}qk(e,n,o)<0?i=a:r=a+1}return r}function Gk(e,t,n){let r=J(e,t),i=Y(e,n);FD(e.snapshot.nodes,r).set(i.nameId,n),BD(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=Wk(e,r,n);r.childIds.splice(a,0,n),RD(r,a),UD(e.snapshot.nodes,r)}function Kk(e,t,n,r){let i=J(e,t),a=ID(i),o=a.get(n)??-1;FD(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&BD(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),RD(i,o),UD(e.snapshot.nodes,i))}function qk(e,t,n){let r=e.snapshot.options.sort;return r==="default"?Jk(e,t,n):r(Yk(e,t),Yk(e,n))}function Jk(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=uO(_O(e.snapshot.segmentTable,r.nameId),_O(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=wO(e.snapshot.segmentTable,r.nameId),c=wO(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function Yk(e,t){let n=Y(e,t),r=q(e,t),i=G(n),a=i?r.slice(0,-1):r;return{basename:wO(e.snapshot.segmentTable,n.nameId),depth:XD(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function Xk(e,t,n){let r=Y(e,t),i=Rk(e,n);if(i!=null){let t=Y(e,i);if(G(t))return{basename:wO(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=xO(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=xO(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:zk(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function Zk(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(ZD(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 Qk(e,t),Kk(e,a,t,o),$k(e,a),Fk(e,a),`handled`}function Qk(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),eO(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),tk(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 $k(e,t){let n=t;for(;n!=null;){let t=Y(e,n);if(!G(t)||$D(t,2)||J(e,n).childIds.length>0)return;eO(t,1),n=t.parentId===n?null:t.parentId}}function eA(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=FD(e.snapshot.nodes,J(e,n)).get(t);if(i==null||!G(Y(e,i)))break;n=i}return n}function tA(e,t){let n=iA(e,t);if(n==null)return null;let r=Dk(e,n),i=Y(e,r),a=n===r?null:Ok(e,n).map(t=>q(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:J(e,r).childIds.length>0,path:q(e,r),terminalKind:ZD(i)})}function nA(e,t){return rA([e],[t])}function rA(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 iA(e,t){let n=t;for(;n!=null;){let t=Y(e,n);if(!G(t)||$D(t,2))return null;if(!KO(e,n,t))return n;n=t.parentId}return null}function aA(e,t){let n=Y(e,t);if(tO(n,(t===e.snapshot.rootId?-1:XD(Y(e,n.parentId)))+1),!G(n))return;let r=J(e,t);for(let t of r.childIds)aA(e,t)}function oA(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 sA(e,t,n=Y(e,t),r=!1){let i=e.instrumentation;if(i==null){lA(e,t,n,r);return}K(i,`store.recomputeNodeCounts`,()=>lA(e,t,n,r))}function cA(e,t){let n=t;for(;n!=null;){let t=Y(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(sA(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&BD(J(e,s),n,a,o),n=s}}function lA(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?zD(e.snapshot.nodes,i):K(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>zD(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,$D(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=Ek(e,t)==null?KO(e,t,n)?1+o:1:o}function uA(e,t,n){let r=q(e,t);return r.length===0?n:`${r}${n}`}function dA(e){return e!=null&&!$D(e,4)}function fA(e,t){let n=e.snapshot.nodes[t];return!dA(n)||!G(n)||$D(n,2)?null:n}function pA(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&dA(e.snapshot.nodes[n])&&(t+=1);return t}function mA(e){return Math.max(0,e.valueById.length-1)}function hA(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:pA(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:mA(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function gA(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 _A(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)fA(e,n)!=null&&t.push(q(e,n));for(let t of e.expandedDirectoryIds)fA(e,t)!=null&&n.push(q(e,t));return{collapsedPaths:t,expandedPaths:n}}function vA(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)fA(e,n)!=null&&YO(e,n)!==`loaded`&&t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:q(e,n)});return t}function yA(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=Rk(e,n);t!=null&&qO(e,t,!0,Y(e,t))}for(let n of t.collapsedPaths){let t=Rk(e,n);t!=null&&qO(e,t,!1,Y(e,t))}}function bA(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=Rk(e,n.path);t!=null&&fA(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function xA(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function SA(e){let t=e.snapshot.segmentTable,n=SO();for(let r of e.snapshot.nodes)if(dA(r)){if($D(r,2)){r.nameId=0;continue}r.nameId=CO(n,wO(t,r.nameId))}e.snapshot.segmentTable=n}function CA(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!dA(r)||!G(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return dA(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])),zD(e.snapshot.nodes,n)}}function wA(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(dA(n))break;--t}e.snapshot.nodes.length=t+1}function TA(e){let t=_A(e),n=vA(e);K(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>xA(e)),K(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>SA(e)),K(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>CA(e)),K(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>wA(e)),K(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>yA(e,t)),K(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>bA(e,n)),K(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>Ik(e,e.snapshot.rootId))}function EA(e){let t=_A(e),n=vA(e),r=K(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>kk(e)),i=rO({...e.snapshot.options},e.instrumentation),a=K(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new VO(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`,()=>yA(e,t)),K(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>bA(e,n)),K(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>Ik(e,e.snapshot.rootId))}function DA(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function OA(e,t){let n=hA(e);t===`stable`?K(e.instrumentation,`store.cleanup.stable`,()=>TA(e)):K(e.instrumentation,`store.cleanup.aggressive`,()=>EA(e));let r=hA(e);return gA(t,t===`stable`,n,r)}var kA=64;function AA(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 jA(e){return Y(e,e.snapshot.rootId).visibleSubtreeCount}function MA(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 NA(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:QA(e,t.cursor),setSize:t.setSize,subtreeEndIndex:MA(e,t.cursor,t.index,n)}}function PA(e,t,n,r,i,a){let o=J(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=VD(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return FA(e,u,l,r+c,i+1,s,o.childIds.length,a)}function FA(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=KA(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)||!KO(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return PA(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function IA(e,t){let n=jA(e);if(t<0||t>=n)return null;let r=PA(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=NA(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:QA(e,r.cursor),setSize:r.setSize,subtreeEndIndex:MA(e,r.cursor,r.index,n)}}function LA(e,t,n){let r=e.instrumentation,i=jA(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 ZA(e,o+1);let t=[],n=UA(e,a);for(let r=a;r<=o&&n!=null;r++){let r=QA(e,n);t.push(r),n=JA(e,n)}return t}let s=[],c=0,l=0,u=K(r,`store.getVisibleSlice.selectFirstRow`,()=>UA(e,a));for(let t=a;t<=o&&u!=null;t++){let t=K(r,`store.getVisibleSlice.materializeRow`,()=>QA(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=K(r,`store.getVisibleSlice.advanceCursor`,()=>JA(e,u))}return aO(r,`workload.visibleRowsRead`,s.length),aO(r,`workload.flattenedRowsRead`,c),aO(r,`workload.flattenedSegmentsRead`,l),s}function RA(e,t=jA(e)){let n=e.instrumentation;return n==null?XA(e,t):K(n,`store.getVisibleTreeProjection`,()=>XA(e,t))}function zA(e){return YA(RA(e))}function BA(e,t){let n=Rk(e,t);if(n==null||n===e.snapshot.rootId||G(Y(e,n))&&Dk(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=ID(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=HD(a,n,s),t!==o){let n=Y(e,t),a=Ek(e,t);if(!KO(e,t,n)&&a!==i)return null;Dk(e,t)===t&&(r+=1)}i=t}return r}function VA(e,t){let n=Rk(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 KO(e,n,r)?null:(qO(e,n,!0,r),Fk(e,n),ok({affectedAncestorIds:Lk(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function HA(e,t){let n=Rk(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 KO(e,n,r)?(qO(e,n,!1,r),Fk(e,n),sk({affectedAncestorIds:Lk(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function UA(e,t){return t<0||t>=jA(e)?null:WA(e,e.snapshot.rootId,t,-1)}function WA(e,t,n,r){let i=J(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?VD(e.snapshot.nodes,i,n):K(a,`store.getVisibleSlice.selectChildIndex`,()=>VD(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return GA(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function GA(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=KA(e,t,r);if(n===0)return i;let a=Y(e,i.terminalNodeId);if(!G(a)||!KO(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return WA(e,i.terminalNodeId,n-1,i.visibleDepth)}function KA(e,t,n){return G(Y(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:Dk(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:K(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>Dk(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function qA(e,t){let n=Y(e,t);if(!G(n))return!0;let r=n.parentId;return r===e.snapshot.rootId||Ek(e,r)!==t}function JA(e,t){let n=Y(e,t.terminalNodeId);if(G(n)){let r=J(e,t.terminalNodeId);if(KO(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:GA(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=ID(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 GA(e,s,0,i);qA(e,r)&&i--,r=n}}function YA(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 XA(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(kA);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=AA(o,y);let x,S=_;if(G(v))S=f?Dk(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)&&KO(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 ZA(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?Dk(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=QA(e,g);let _=i[h];_!=null&&G(_)&&KO(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function QA(e,t){let n=Y(e,t.terminalNodeId),r=G(n)?$A(e,t):null,i=q(e,t.terminalNodeId),a=wO(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?Ok(e,t.headNodeId).map(n=>{let r=Y(e,n);return{isTerminal:n===t.terminalNodeId,name:wO(e.snapshot.segmentTable,r.nameId),nodeId:n,path:q(e,n)}}):K(c,`store.getVisibleSlice.flatten.collectSegments`,()=>Ok(e,t.headNodeId).map(n=>{let r=Y(e,n);return{isTerminal:n===t.terminalNodeId,name:wO(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)&&KO(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 $A(e,t){if(t.headNodeId===t.terminalNodeId)return YO(e,t.terminalNodeId);let n=Ok(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=YO(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}var ej=8;function tj(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 nj(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]&ej)===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]]&ej)===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 rj(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&&UD(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,UD(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function ij(e){let{directories:t,nodes:n,rootId:r}=e.snapshot,i=tj(e.snapshot);nj(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)&&UD(n,i)}}function aj(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var oj=class e{#e;constructor(e={}){let t=iO(e),n=K(t,`store.builder.create`,()=>new VO(e));if(e.preparedInput!=null){let t=RO(e.preparedInput);t==null?n.appendPreparedPaths(LO(e.preparedInput),!1):n.appendPresortedPaths(t,zO(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(K(t,`store.preparePathEntries`,()=>BO(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`,()=>HO(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||aj(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`,()=>ij(this.#e)):K(t,`store.state.initializeOpenVisibleCounts`,()=>rj(this.#e)):K(t,`store.state.recomputeCounts`,()=>Ik(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return PO(e,t)}static prepareInput(e,t={}){return FO(e,t)}static preparePresortedInput(e){return IO(e)}list(e){return K(this.#e.instrumentation,`store.list`,()=>kk(this.#e,e))}add(e){K(this.#e.instrumentation,`store.add`,()=>{let t=jA(this.#e);gk(this.#e,mk(this.#e,t,Ak(this.#e,e)))})}remove(e,t={}){K(this.#e.instrumentation,`store.remove`,()=>{let n=jA(this.#e);gk(this.#e,mk(this.#e,n,jk(this.#e,e,t)))})}move(e,t,n={}){K(this.#e.instrumentation,`store.move`,()=>{let r=jA(this.#e),i=Mk(this.#e,e,t,n);i!=null&&gk(this.#e,mk(this.#e,r,i))})}batch(e){hk(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`,()=>jA(this.#e))}getVisibleSlice(e,t){return K(this.#e.instrumentation,`store.getVisibleSlice`,()=>LA(this.#e,e,t))}getVisibleRowContext(e){return K(this.#e.instrumentation,`store.getVisibleRowContext`,()=>IA(this.#e,e))}getVisibleTreeProjection(){return zA(this.#e)}getVisibleTreeProjectionData(e){return RA(this.#e,e)}getVisibleIndex(e){return K(this.#e.instrumentation,`store.getVisibleIndex`,()=>BA(this.#e,e))}getPathInfo(e){return K(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=Rk(this.#e,e);if(t==null)return null;let n=Y(this.#e,t);return{depth:XD(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 KO(this.#e,t,n)})}expand(e){K(this.#e.instrumentation,`store.expand`,()=>{let t=jA(this.#e),n=VA(this.#e,e);n!=null&&gk(this.#e,mk(this.#e,t,n))})}collapse(e){K(this.#e.instrumentation,`store.collapse`,()=>{let t=jA(this.#e),n=HA(this.#e,e);n!=null&&gk(this.#e,mk(this.#e,t,n))})}on(e,t){return nk(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return YO(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=jA(this.#e);ZO(this.#e,t),gk(this.#e,mk(this.#e,n,ck({affectedAncestorIds:Lk(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=jA(this.#e),r=XO(this.#e,t);return gk(this.#e,mk(this.#e,n,lk({affectedAncestorIds:Lk(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||YO(this.#e,n)!==`loading`||!$O(this.#e,n,e.attemptId))return!1;let r=q(this.#e,n);this.validateChildPatch(r,t);let i=jA(this.#e),a=[];for(let e of t.operations){sj(r,e);let t=jA(this.#e);switch(e.type){case`add`:a.push(mk(this.#e,t,Ak(this.#e,e.path)));break;case`remove`:a.push(mk(this.#e,t,jk(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=Mk(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(mk(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return gk(this.#e,mk(this.#e,i,uk({affectedAncestorIds:Lk(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=jA(this.#e),r=QO(this.#e,t,e.attemptId);return gk(this.#e,mk(this.#e,n,dk({affectedAncestorIds:Lk(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=jA(this.#e),i=ek(this.#e,n,e.attemptId,t);return gk(this.#e,mk(this.#e,r,fk({affectedAncestorIds:Lk(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(DA(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=jA(this.#e),n=OA(this.#e,e.mode??`stable`);return gk(this.#e,mk(this.#e,t,pk({...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)??cO(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=uO(_O(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);KO(this.#e,n,i)||(qO(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(!KO(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=Rk(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=Ek(this.#e,e);if(!KO(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 sj(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 cj={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function lj(e,t){if(typeof e==`number`)return{itemHeight:t??cj.default.itemHeight,factor:e};let n=cj[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var uj=cj.default.itemHeight,dj=`@layer base {
1697
+ </symbol>`],HO=[UD,WD,KD,qD,JD,YD,ZD,nO,rO,sO,mO,hO,gO,_O,vO,bO,CO,wO,TO,EO,DO,AO,jO,PO,FO,IO,LO,RO,zO,BO];function UO(e,t){return t.length===0?e:e.replace(`</svg>`,`\n ${t.join(`
1698
+ `)}\n</svg>`)}var WO=UO(HD,VO),GO={minimal:HD,standard:WO,complete:UO(WO,HO)},KO={".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`},qO={"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`},JO={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},YO=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`]),XO=new Set([`complete`]);function ZO(e){return GO[e===`none`?`minimal`:e]}function QO(e){return`file-tree-builtin-${e}`}function $O(e){return e!==`none`&&XO.has(e)}function ek(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=KO[t.toLowerCase()];if(i!=null&&(r||YO.has(i)))return i;for(let e of n){if(r){let t=JO[e];if(t!=null)return t}let t=qO[e];if(t!=null&&(r||YO.has(t)))return t}return`default`}var tk=`file-tree-container`,nk=`data-file-tree-style`,rk=`data-file-tree-unsafe-css`,ik=`data-file-tree-scrollbar-measure`,ak=`data-file-tree-scrollbar-gutter-measured`,ok=`--trees-scrollbar-gutter-measured`,sk=`header`,ck=`context-menu`,lk=`context-menu-trigger`;function uk(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function dk(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(uk(e)?`none`:`complete`),colored:e.colored??!0}}var fk=e=>e.trim().toLowerCase(),pk=e=>e.split(`/`).at(-1)??e,mk=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 hk(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function gk(e){let t=dk(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(fk(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=pk(o),c=s.toLowerCase(),l=r.get(c);if(l!=null)return hk(l,e);for(let[t,n]of a)if(c.includes(t))return hk(n,e);let u=mk(s);for(let t of u){let n=i.get(t);if(n!=null)return hk(n,e)}let d=ek(t.set,s,u);if(d!=null&&t.set!==`none`){if(d==="default"){let t=n?.[e];if(t!=null)return hk(t,e)}return{name:QO(d),remappedFrom:e,token:d}}}let s=n?.[e];return s==null?{name:e}:hk(s,e)}}}var _k=5,vk=32,yk=128;function bk(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function xk(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function Sk(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 Ck(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 wk(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function Tk(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 Ek(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,Ak(e,t)}function Dk(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=Ck(e).get(t);if(i===void 0)return;let a=i>>_k;e.childVisibleChunkSums[a]+=r}function Ok(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=jk(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=vk}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 kk(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>_k;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<_k}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 Ak(e,t){if(t.childIds.length<yk){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/vk),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>>_k]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function jk(e,t,n,r){let i=Math.min(t.childIds.length,n+vk),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 Mk=7,Nk=3,Pk=8,Fk=4;function Ik(e,t,n=0){return e<<Fk|n<<Nk|t}function Lk(e){return e.depthAndFlags>>>Fk}function Rk(e){return(e.depthAndFlags&Pk)>>Nk}function G(e){return(e.depthAndFlags&Pk)!==0}function zk(e){return e.depthAndFlags&Mk}function Bk(e,t){return(zk(e)&t)!==0}function Vk(e,t){e.depthAndFlags|=t}function Hk(e,t){e.depthAndFlags=Ik(t,zk(e),Rk(e))}var Uk=Symbol(`benchmarkInstrumentation`);function Wk(e,t){return t==null||Object.defineProperty(e,Uk,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function Gk(e){return e==null?null:e[Uk]??null}function K(e,t,n){return e==null?n():e.measurePhase(t,n)}function Kk(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function qk(e){return e>=48&&e<=57}function Jk(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!qk(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&&qk(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 Yk(e){let t=e.toLowerCase();return{lowerValue:t,tokens:Jk(t)}}function Xk(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 Zk(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=Xk(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function Qk(e,t,n){let r=Zk(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function $k(e,t){return Qk(e,t,Yk)}function eA(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function tA(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=eA(e,r);return a===eA(t,r)?$k(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 nA(e,t){return tA(e,t)}function rA(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=Yk(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=eA(e,n);return o===eA(t,n)?Qk(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 iA(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=Yk(r);return e.sortKeyById[t]=i,i}function aA(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function oA(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 sA(e){let{hasTrailingSlash:t,segments:n}=oA(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function cA(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=oA(e);return{requiresDirectory:t,segments:n}}function lA(){let e=new Map;return e.set(``,0),{idByValue:e,valueById:[``],sortKeyById:[Yk(``)]}}function uA(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 dA(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var fA=Symbol(`pathStorePreparedInputKind`);function pA(e,t){return e[fA]=t,e}function mA(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function hA(e,t,n){return n==="default"?nA(e,t):n(mA(e),mA(t))}function gA(){return{depthAndFlags:Ik(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function _A(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 vA(e){return e.isDirectory?e.segments.length:e.segments.length-1}function yA(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 bA(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function xA(e,t={}){return DA(e,t).map(e=>e.path)}function SA(e,t={}){let n=DA(e,t);return pA({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function CA(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 pA({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function wA(e){let t=e,n=t.preparedPaths;if(t[fA]===`prepared`&&n!=null)return n;if(!yA(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function TA(e){let t=e;return t[fA]===`presorted`&&t.presortedPaths!=null||bA(t.presortedPaths)?t.presortedPaths:null}function EA(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function DA(e,t={}){let n=aA(t),r=Gk(t);Kk(r,`workload.inputFiles`,e.length);let i=K(r,`store.preparePathEntries.parse`,()=>e.map(e=>sA(e)));return K(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>hA(e,t,n.sort))),i}var OA=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[gA()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=lA();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=Gk(e),this.options=aA(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,bk())}appendPaths(e){return K(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>sA(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:Ik(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:Ik(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:Ik(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=sA(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:Ik(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:Ik(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=sA(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"?rA(this.lastPreparedPath,e,this.segmentSortKeyCache):hA(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=vA(e),i=n==null?0:vA(n),a=n==null?0:_A(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=uA(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:Ik(Lk(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),wk(i,s),s}createFileChildUnchecked(e,t){let n=uA(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:Ik(Lk(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),wk(r,a),a}getOrCreateDirectoryChild(e,t){let n=uA(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:Ik(Lk(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),wk(r,a),this.directories.set(a,bk()),a}createDirectoryChild(e,t){let n=uA(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:Ik(Lk(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),wk(r,a),this.directories.set(a,bk()),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(Bk(n,1))throw Error(`Duplicate path: "${t}"`);Vk(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,xk());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=xk();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,bk());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),wk(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 Ek(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function kA(e,t=`closed`,n=null){let r=jA(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 AA(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function jA(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 MA(e,t){return Bk(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion!==`closed`&&Lk(t)<=e.defaultExpansion}function NA(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:MA(e,n)}function PA(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!G(r))return;let i=MA(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 FA(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 IA(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function LA(e,t){let n=FA(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 RA(e,t){let n=FA(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function zA(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 BA(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function VA(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 HA(e,t){e.directoryLoadInfoById.delete(t)}function UA(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 WA(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function GA(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function KA(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function qA(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function JA(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function YA(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function XA(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 ZA(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 QA(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 $A(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 ej(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 tj(e,t,n){return{...n,visibleCountDelta:fj(e)-t}}function nj(e,t){let n=fj(e),r=AA();e.transactionStack.push(r);try{t()}catch(t){throw aj(e,r,!1),t}aj(e,r,!0,fj(e)-n)}function rj(e,t){let n=e.instrumentation;if(n==null){ij(e,t);return}K(n,`store.events.record`,()=>ij(e,t))}function ij(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){uj(e,t);return}n.events.push(t),lj(n,t)}function aj(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?cj(i,t):K(n,`store.events.batch.merge`,()=>cj(i,t));return}let a=oj(t,r),o=e.instrumentation;if(o==null){uj(e,a);return}K(o,`store.events.batch.commit`,()=>uj(e,a))}function oj(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 sj(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function cj(e,t){for(let n of t.events)e.events.push(n);sj(e,t)}function lj(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function uj(e,t){let n=e.instrumentation;if(n==null){dj(e,t);return}K(n,`store.events.emit`,()=>dj(e,t))}function dj(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function fj(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function pj(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!G(n)||Bk(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 mj(e,t){let n=t;for(;;){let t=pj(e,n);if(t==null)return n;n=t}}function hj(e,t){let n=[t],r=t;for(;;){let t=pj(e,r);if(t==null)return n;n.push(t),r=t}}function gj(e,t){let n=t==null?e.snapshot.rootId:Tj(e,t);return n==null?[]:Dj(e,n)}function _j(e,t){let n=sA(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=Hj(e,Vj(e,r)),{createdNodeIds:a,directoryId:o}=Oj(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=Y(e,o);if(Bk(n,1))throw Error(`Path already exists: "${t}"`);Vk(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=Aj(e,o,n.basename),s.add(c);Sj(e,o);let l=Hj(e,o);return WA({affectedAncestorIds:wj(e,c),affectedNodeIds:[...s],path:t,projectionChanged:Uj(i,l)})}function vj(e,t,n){let r=Tj(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=Y(e,r);if(Bk(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=Hj(e,a),s=zj(e,r);Nj(e,a,r,i.nameId),Bj(e,a),Sj(e,a);let c=Hj(e,a);return GA({affectedAncestorIds:wj(e,a),affectedNodeIds:s,path:t,projectionChanged:Uj(o,c),recursive:n.recursive===!0})}function yj(e,t,n,r){let i=Tj(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=Y(e,i);if(Bk(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=Lj(e,i,n),c=Hj(e,a.parentId),l=Hj(e,s.parentId),u=dA(e.snapshot.segmentTable,a.nameId),d=uA(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(G(a)&&qj(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=Sk(e.snapshot.nodes,J(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&Rj(e,p,o,Rk(a))===`skip`)return null;let m=a.parentId;Nj(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),Kj(e,i),Mj(e,s.parentId,i),Bj(e,m),e.pathCacheVersion++,Sj(e,m),s.parentId!==m&&Sj(e,s.parentId);let h=Hj(e,m),g=Hj(e,s.parentId);return KA({affectedAncestorIds:[...new Set([...wj(e,m),...wj(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:Wj([c,l],[h,g]),to:q(e,i)})}function bj(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function xj(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function q(e,t){let n=Y(e,t),r=bj(e,t);if(r!=null)return r;if(Bk(n,2))return xj(e,t,``);let i=q(e,n.parentId),a=dA(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return xj(e,t,G(n)?`${o}/`:o)}function Sj(e,t){let n=e.instrumentation;if(n==null){Yj(e,t);return}K(n,`store.recomputeCountsUpwardFrom`,()=>Yj(e,t))}function Cj(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)){Jj(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){Jj(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function wj(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 Tj(e,t){if(t.length===0)return e.snapshot.rootId;let n=cA(t);return Ej(e,n.segments,n.requiresDirectory)}function Ej(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=Sk(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||Bk(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function Dj(e,t){let n=e.snapshot.nodes[t];if(n===void 0||Bk(n,4))return[];if(!G(n))return[q(e,t)];if(J(e,t).childIds.length===0)return Bk(n,1)&&!Bk(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||Bk(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){Bk(n,1)&&!Bk(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 Oj(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=uA(e.snapshot.segmentTable,i),a=J(e,r),o=Sk(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=kj(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function kj(e,t,n){let r=Y(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:Ik(Lk(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,bk()),Mj(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function Aj(e,t,n){let r=uA(e.snapshot.segmentTable,n),i=J(e,t);if(Sk(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${Zj(e,t,n)}"`);let a=Y(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:Ik(Lk(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),Mj(e,t,o),e.activeNodeCount++,o}function jj(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}Pj(e,n,o)<0?i=a:r=a+1}return r}function Mj(e,t,n){let r=J(e,t),i=Y(e,n);Sk(e.snapshot.nodes,r).set(i.nameId,n),Dk(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=jj(e,r,n);r.childIds.splice(a,0,n),Tk(r,a),Ak(e.snapshot.nodes,r)}function Nj(e,t,n,r){let i=J(e,t),a=Ck(i),o=a.get(n)??-1;Sk(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&Dk(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),Tk(i,o),Ak(e.snapshot.nodes,i))}function Pj(e,t,n){let r=e.snapshot.options.sort;return r==="default"?Fj(e,t,n):r(Ij(e,t),Ij(e,n))}function Fj(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=Zk(iA(e.snapshot.segmentTable,r.nameId),iA(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=dA(e.snapshot.segmentTable,r.nameId),c=dA(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function Ij(e,t){let n=Y(e,t),r=q(e,t),i=G(n),a=i?r.slice(0,-1):r;return{basename:dA(e.snapshot.segmentTable,n.nameId),depth:Lk(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function Lj(e,t,n){let r=Y(e,t),i=Tj(e,n);if(i!=null){let t=Y(e,i);if(G(t))return{basename:dA(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=cA(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=cA(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:Ej(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function Rj(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(Rk(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 zj(e,t),Nj(e,a,t,o),Bj(e,a),Sj(e,a),`handled`}function zj(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),Vk(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),HA(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 Bj(e,t){let n=t;for(;n!=null;){let t=Y(e,n);if(!G(t)||Bk(t,2)||J(e,n).childIds.length>0)return;Vk(t,1),n=t.parentId===n?null:t.parentId}}function Vj(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=Sk(e.snapshot.nodes,J(e,n)).get(t);if(i==null||!G(Y(e,i)))break;n=i}return n}function Hj(e,t){let n=Gj(e,t);if(n==null)return null;let r=mj(e,n),i=Y(e,r),a=n===r?null:hj(e,n).map(t=>q(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:J(e,r).childIds.length>0,path:q(e,r),terminalKind:Rk(i)})}function Uj(e,t){return Wj([e],[t])}function Wj(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 Gj(e,t){let n=t;for(;n!=null;){let t=Y(e,n);if(!G(t)||Bk(t,2))return null;if(!NA(e,n,t))return n;n=t.parentId}return null}function Kj(e,t){let n=Y(e,t);if(Hk(n,(t===e.snapshot.rootId?-1:Lk(Y(e,n.parentId)))+1),!G(n))return;let r=J(e,t);for(let t of r.childIds)Kj(e,t)}function qj(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 Jj(e,t,n=Y(e,t),r=!1){let i=e.instrumentation;if(i==null){Xj(e,t,n,r);return}K(i,`store.recomputeNodeCounts`,()=>Xj(e,t,n,r))}function Yj(e,t){let n=t;for(;n!=null;){let t=Y(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(Jj(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&Dk(J(e,s),n,a,o),n=s}}function Xj(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?Ek(e.snapshot.nodes,i):K(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>Ek(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,Bk(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=pj(e,t)==null?NA(e,t,n)?1+o:1:o}function Zj(e,t,n){let r=q(e,t);return r.length===0?n:`${r}${n}`}function Qj(e){return e!=null&&!Bk(e,4)}function $j(e,t){let n=e.snapshot.nodes[t];return!Qj(n)||!G(n)||Bk(n,2)?null:n}function eM(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&Qj(e.snapshot.nodes[n])&&(t+=1);return t}function tM(e){return Math.max(0,e.valueById.length-1)}function nM(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:eM(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:tM(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function rM(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 iM(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)$j(e,n)!=null&&t.push(q(e,n));for(let t of e.expandedDirectoryIds)$j(e,t)!=null&&n.push(q(e,t));return{collapsedPaths:t,expandedPaths:n}}function aM(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)$j(e,n)!=null&&IA(e,n)!==`loaded`&&t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:q(e,n)});return t}function oM(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=Tj(e,n);t!=null&&PA(e,t,!0,Y(e,t))}for(let n of t.collapsedPaths){let t=Tj(e,n);t!=null&&PA(e,t,!1,Y(e,t))}}function sM(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=Tj(e,n.path);t!=null&&$j(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function cM(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function lM(e){let t=e.snapshot.segmentTable,n=lA();for(let r of e.snapshot.nodes)if(Qj(r)){if(Bk(r,2)){r.nameId=0;continue}r.nameId=uA(n,dA(t,r.nameId))}e.snapshot.segmentTable=n}function uM(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!Qj(r)||!G(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return Qj(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])),Ek(e.snapshot.nodes,n)}}function dM(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(Qj(n))break;--t}e.snapshot.nodes.length=t+1}function fM(e){let t=iM(e),n=aM(e);K(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>cM(e)),K(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>lM(e)),K(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>uM(e)),K(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>dM(e)),K(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>oM(e,t)),K(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>sM(e,n)),K(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>Cj(e,e.snapshot.rootId))}function pM(e){let t=iM(e),n=aM(e),r=K(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>gj(e)),i=Wk({...e.snapshot.options},e.instrumentation),a=K(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new OA(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`,()=>oM(e,t)),K(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>sM(e,n)),K(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>Cj(e,e.snapshot.rootId))}function mM(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function hM(e,t){let n=nM(e);t===`stable`?K(e.instrumentation,`store.cleanup.stable`,()=>fM(e)):K(e.instrumentation,`store.cleanup.aggressive`,()=>pM(e));let r=nM(e);return rM(t,t===`stable`,n,r)}var gM=64;function _M(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 vM(e){return Y(e,e.snapshot.rootId).visibleSubtreeCount}function yM(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 bM(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:zM(e,t.cursor),setSize:t.setSize,subtreeEndIndex:yM(e,t.cursor,t.index,n)}}function xM(e,t,n,r,i,a){let o=J(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=Ok(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return SM(e,u,l,r+c,i+1,s,o.childIds.length,a)}function SM(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=NM(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)||!NA(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return xM(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function CM(e,t){let n=vM(e);if(t<0||t>=n)return null;let r=xM(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=bM(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:zM(e,r.cursor),setSize:r.setSize,subtreeEndIndex:yM(e,r.cursor,r.index,n)}}function wM(e,t,n){let r=e.instrumentation,i=vM(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 RM(e,o+1);let t=[],n=AM(e,a);for(let r=a;r<=o&&n!=null;r++){let r=zM(e,n);t.push(r),n=FM(e,n)}return t}let s=[],c=0,l=0,u=K(r,`store.getVisibleSlice.selectFirstRow`,()=>AM(e,a));for(let t=a;t<=o&&u!=null;t++){let t=K(r,`store.getVisibleSlice.materializeRow`,()=>zM(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=K(r,`store.getVisibleSlice.advanceCursor`,()=>FM(e,u))}return Kk(r,`workload.visibleRowsRead`,s.length),Kk(r,`workload.flattenedRowsRead`,c),Kk(r,`workload.flattenedSegmentsRead`,l),s}function TM(e,t=vM(e)){let n=e.instrumentation;return n==null?LM(e,t):K(n,`store.getVisibleTreeProjection`,()=>LM(e,t))}function EM(e){return IM(TM(e))}function DM(e,t){let n=Tj(e,t);if(n==null||n===e.snapshot.rootId||G(Y(e,n))&&mj(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=Ck(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=kk(a,n,s),t!==o){let n=Y(e,t),a=pj(e,t);if(!NA(e,t,n)&&a!==i)return null;mj(e,t)===t&&(r+=1)}i=t}return r}function OM(e,t){let n=Tj(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 NA(e,n,r)?null:(PA(e,n,!0,r),Sj(e,n),qA({affectedAncestorIds:wj(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function kM(e,t){let n=Tj(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 NA(e,n,r)?(PA(e,n,!1,r),Sj(e,n),JA({affectedAncestorIds:wj(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function AM(e,t){return t<0||t>=vM(e)?null:jM(e,e.snapshot.rootId,t,-1)}function jM(e,t,n,r){let i=J(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?Ok(e.snapshot.nodes,i,n):K(a,`store.getVisibleSlice.selectChildIndex`,()=>Ok(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return MM(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function MM(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=NM(e,t,r);if(n===0)return i;let a=Y(e,i.terminalNodeId);if(!G(a)||!NA(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return jM(e,i.terminalNodeId,n-1,i.visibleDepth)}function NM(e,t,n){return G(Y(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:mj(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:K(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>mj(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function PM(e,t){let n=Y(e,t);if(!G(n))return!0;let r=n.parentId;return r===e.snapshot.rootId||pj(e,r)!==t}function FM(e,t){let n=Y(e,t.terminalNodeId);if(G(n)){let r=J(e,t.terminalNodeId);if(NA(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:MM(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=Ck(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 MM(e,s,0,i);PM(e,r)&&i--,r=n}}function IM(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 LM(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(gM);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=_M(o,y);let x,S=_;if(G(v))S=f?mj(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)&&NA(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 RM(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?mj(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=zM(e,g);let _=i[h];_!=null&&G(_)&&NA(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function zM(e,t){let n=Y(e,t.terminalNodeId),r=G(n)?BM(e,t):null,i=q(e,t.terminalNodeId),a=dA(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?hj(e,t.headNodeId).map(n=>{let r=Y(e,n);return{isTerminal:n===t.terminalNodeId,name:dA(e.snapshot.segmentTable,r.nameId),nodeId:n,path:q(e,n)}}):K(c,`store.getVisibleSlice.flatten.collectSegments`,()=>hj(e,t.headNodeId).map(n=>{let r=Y(e,n);return{isTerminal:n===t.terminalNodeId,name:dA(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)&&NA(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 BM(e,t){if(t.headNodeId===t.terminalNodeId)return IA(e,t.terminalNodeId);let n=hj(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=IA(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}var VM=8;function HM(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 UM(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]&VM)===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]]&VM)===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 WM(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&&Ak(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,Ak(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function GM(e){let{directories:t,nodes:n,rootId:r}=e.snapshot,i=HM(e.snapshot);UM(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)&&Ak(n,i)}}function KM(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var qM=class e{#e;constructor(e={}){let t=Gk(e),n=K(t,`store.builder.create`,()=>new OA(e));if(e.preparedInput!=null){let t=TA(e.preparedInput);t==null?n.appendPreparedPaths(wA(e.preparedInput),!1):n.appendPresortedPaths(t,EA(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(K(t,`store.preparePathEntries`,()=>DA(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`,()=>kA(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||KM(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`,()=>GM(this.#e)):K(t,`store.state.initializeOpenVisibleCounts`,()=>WM(this.#e)):K(t,`store.state.recomputeCounts`,()=>Cj(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return xA(e,t)}static prepareInput(e,t={}){return SA(e,t)}static preparePresortedInput(e){return CA(e)}list(e){return K(this.#e.instrumentation,`store.list`,()=>gj(this.#e,e))}add(e){K(this.#e.instrumentation,`store.add`,()=>{let t=vM(this.#e);rj(this.#e,tj(this.#e,t,_j(this.#e,e)))})}remove(e,t={}){K(this.#e.instrumentation,`store.remove`,()=>{let n=vM(this.#e);rj(this.#e,tj(this.#e,n,vj(this.#e,e,t)))})}move(e,t,n={}){K(this.#e.instrumentation,`store.move`,()=>{let r=vM(this.#e),i=yj(this.#e,e,t,n);i!=null&&rj(this.#e,tj(this.#e,r,i))})}batch(e){nj(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`,()=>vM(this.#e))}getVisibleSlice(e,t){return K(this.#e.instrumentation,`store.getVisibleSlice`,()=>wM(this.#e,e,t))}getVisibleRowContext(e){return K(this.#e.instrumentation,`store.getVisibleRowContext`,()=>CM(this.#e,e))}getVisibleTreeProjection(){return EM(this.#e)}getVisibleTreeProjectionData(e){return TM(this.#e,e)}getVisibleIndex(e){return K(this.#e.instrumentation,`store.getVisibleIndex`,()=>DM(this.#e,e))}getPathInfo(e){return K(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=Tj(this.#e,e);if(t==null)return null;let n=Y(this.#e,t);return{depth:Lk(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 NA(this.#e,t,n)})}expand(e){K(this.#e.instrumentation,`store.expand`,()=>{let t=vM(this.#e),n=OM(this.#e,e);n!=null&&rj(this.#e,tj(this.#e,t,n))})}collapse(e){K(this.#e.instrumentation,`store.collapse`,()=>{let t=vM(this.#e),n=kM(this.#e,e);n!=null&&rj(this.#e,tj(this.#e,t,n))})}on(e,t){return UA(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return IA(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=vM(this.#e);RA(this.#e,t),rj(this.#e,tj(this.#e,n,YA({affectedAncestorIds:wj(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=vM(this.#e),r=LA(this.#e,t);return rj(this.#e,tj(this.#e,n,XA({affectedAncestorIds:wj(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||IA(this.#e,n)!==`loading`||!BA(this.#e,n,e.attemptId))return!1;let r=q(this.#e,n);this.validateChildPatch(r,t);let i=vM(this.#e),a=[];for(let e of t.operations){JM(r,e);let t=vM(this.#e);switch(e.type){case`add`:a.push(tj(this.#e,t,_j(this.#e,e.path)));break;case`remove`:a.push(tj(this.#e,t,vj(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=yj(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(tj(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return rj(this.#e,tj(this.#e,i,ZA({affectedAncestorIds:wj(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=vM(this.#e),r=zA(this.#e,t,e.attemptId);return rj(this.#e,tj(this.#e,n,QA({affectedAncestorIds:wj(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=vM(this.#e),i=VA(this.#e,n,e.attemptId,t);return rj(this.#e,tj(this.#e,r,$A({affectedAncestorIds:wj(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(mM(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=vM(this.#e),n=hM(this.#e,e.mode??`stable`);return rj(this.#e,tj(this.#e,t,ej({...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)??Yk(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=Zk(iA(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);NA(this.#e,n,i)||(PA(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(!NA(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=Tj(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=pj(this.#e,e);if(!NA(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 JM(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 YM={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function XM(e,t){if(typeof e==`number`)return{itemHeight:t??YM.default.itemHeight,factor:e};let n=YM[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var ZM=YM.default.itemHeight,QM=`@layer base {
1699
1699
  :host {
1700
1700
  --trees-accent: var(--trees-accent-override, #009fff);
1701
1701
  --trees-fg: var(--trees-fg-override, var(--trees-theme-sidebar-fg, light-dark(#6c6c71, #adadb1)));
@@ -2787,14 +2787,14 @@ diff --git`)}function Qg(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.star
2787
2787
  }
2788
2788
 
2789
2789
  @layer theme, unsafe;
2790
- `,fj=`@layer base, unsafe;`;function pj(e){return`${fj}
2790
+ `,$M=`@layer base, unsafe;`;function eN(e){return`${$M}
2791
2791
  @layer base {
2792
2792
  ${e}
2793
- }`}function mj(e){return`${fj}
2793
+ }`}function tN(e){return`${$M}
2794
2794
  @layer unsafe {
2795
2795
  ${e}
2796
- }`}var hj=new WeakMap;function gj(e){let t=hj.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(_D,`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(),hj.set(e,i),i}function _j(e,t){if(!e.isConnected)return;let n=gj(t);if(n==null)return;let r=t.querySelector(`style[${vD}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(vD,``),t.appendChild(i)),i.textContent=`:host { ${yD}: ${n}px; }`}var vj;function yj(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){vj??(vj=new CSSStyleSheet,vj.replaceSync(pj(dj)));let t=!1;try{e.adoptedStyleSheets=[vj],t=!0}catch{}if(t){e.querySelector(`style[${hD}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(hD,``),t.textContent=pj(dj),e.prepend(t)}}function bj(e,t){xj(e,t),yj(t),_j(e,t)}function xj(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`});bj(this,e)}}if(customElements.define(mD,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(mD)))e instanceof HTMLElement&&bj(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var Sj=e=>e.startsWith(`f::`)?e.slice(3):e;function Cj(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function wj(e,t){return e===``?t:`${e}/${t}`}function Tj({files:e,path:t,isFolder:n,nextBasename:r}){let i=Sj(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}=Cj(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=wj(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 Ej(e){return e.endsWith(`/`)}function Dj(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 Oj(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 kj(e,t){return t.includes(e)?Oj(t):[e]}function Aj(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 jj(e,t){return{draggedPaths:e,target:t}}function Mj(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(Ej(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function Nj(e,t){return t.kind===`root`||t.directoryPath==null?Dj(e):t.directoryPath}function Pj(e,t){let n=e.map(e=>{let n=Nj(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 Fj(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 Ij(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(!Fj(oj.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 Lj(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function Rj(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 zj(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function Bj(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 zj(e,t.path)?n?e:null:e;case`move`:return Rj(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=Bj(r,e,n),r==null)return null;return r}}}function Vj(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function Hj(e){switch(e.operation){case`add`:return{...Vj(e),operation:`add`,path:e.path};case`remove`:return{...Vj(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...Vj(e),from:e.from,operation:`move`,to:e.to}}}function Uj(e){return{...Vj(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>Hj(e)),operation:`batch`}}function Wj(e){switch(e.operation){case`add`:case`remove`:case`move`:return Hj(e);case`batch`:return Uj(e);default:return null}}function Gj(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function Kj(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 qj(e){return Kj(e).at(-1)??null}function Jj(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function Yj(e){return e.endsWith(`/`)}var Xj=e=>e.toLowerCase();function Zj(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function Qj(e){return e.endsWith(`/`)?e.slice(0,-1):e}function $j(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var eM=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},tM=Symbol(`FILE_TREE_RENAME_VIEW`),nM=512,rM=512;function iM(e){return e===`top`||e===`center`?e:`nearest`}function aM(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=Kj(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 oM(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:aM(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var sM=class e{static{Object.defineProperty(e.prototype,tM,{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=Ij({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=qj(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:iM(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<=rM){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=kj(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=jj(t.draggedPaths,n);(Mj(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}Aj(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=jj(e.draggedPaths,t);if(Mj(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=Pj(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=Yj(r),a=Qj(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of Kj(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=Zj(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,Yj(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,Yj(e)?{recursive:!0}:void 0);return}let t=Yj(e),n=Tj({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:Qj(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($j(n.sourcePath,t),$j(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=Ij({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=!Gj(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=qj(e),n=Jj(e,t),r=null,i=null;for(let e of this.#be()){if(qj(e)!==t)continue;let a=Jj(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=Kj(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=!Gj(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 oj({...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 Kj(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(Xj),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(Xj),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 Kj(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:eM(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 Kj(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 Kj(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=oM(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,nM)),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=Bj(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=Bj(this.#c,e,!0),r=[...this.#B].map(t=>Bj(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=Bj(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return Gj(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&&Lj(e)&&(this.#i=null);let t=Lj(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=Wj(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},cM=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 lM(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 uM(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 dM(e,t){return t?`${e}/`:e}function fM(e,t=null){let n=cM(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=mM(t);e!=null&&_M({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 pM(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=hM(e);t!=null&&(c=gM({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,statusByPath:i})||c)}for(let e of r){let t=mM(e);t!=null&&(c=_M({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:bM(i),statusByPath:i}:e}function mM(e){return hM(e.path)}function hM(e){let t=lM(e);if(t!=null)return{canonicalPath:dM(t.path,t.isDirectory),isDirectory:t.isDirectory}}function gM({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),yM(t,n,e),!0)}function _M({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,isDirectory:i,status:a,statusByPath:o}){let s=o.get(e);return s!==a&&(s??vM(t,n,e),o.set(e,a),a===`ignored`&&i?r.add(e):i&&r.delete(e),!0)}function vM(e,t,n){for(let r of uM(n))e.set(r,(e.get(r)??0)+1),t.add(r)}function yM(e,t,n){for(let r of uM(n)){let n=(e.get(r)??0)-1;n>0?e.set(r,n):(e.delete(r),t.delete(r))}}function bM(e){let t=`${e.size}`;for(let[n,r]of e)t+=`\0${n}\0${r}`;return t}var X,xM,SM,CM,wM,TM,EM,DM,OM,kM,AM={},jM=[],MM=Array.isArray,NM=jM.slice,PM=Object.assign;function FM(e){e&&e.parentNode&&e.remove()}function IM(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?NM.call(arguments,2):n),LM(e,o,r,i,null)}function LM(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??++xM,__i:-1,__u:0};return i==null&&X.vnode!=null&&X.vnode(a),a}function RM(e){return e.children}function zM(e,t){this.props=e,this.context=t,this.__g=0}function BM(e,t){if(t==null)return e.__?BM(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`?BM(e):null}function VM(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 VM(e)}}function HM(e){(8&e.__g||!(e.__g|=8)||!SM.push(e)||wM++)&&CM==X.debounceRendering||((CM=X.debounceRendering)||queueMicrotask)(UM)}function UM(){for(var e,t,n,r,i,a,o,s,c=1;SM.length;)SM.length>c&&SM.sort(TM),e=SM.shift(),c=SM.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=PM({},r)).__v=r.__v+1,X.vnode&&X.vnode(n),ZM(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??BM(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,$M(a,n,o),n.__e!=i&&VM(n)));wM=0}function WM(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||jM,b=t.length;for(c=GM(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?AM:y[m.__i]||AM,m.__i=f,_=ZM(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&nN(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=KM(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function GM(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?LM(null,o,null,null,null):MM(o)?LM(RM,{children:o},null,null,null):o.constructor==null&&o.__b>0?LM(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=qM(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=BM(s)),rN(s,s));return r}function KM(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=KM(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=BM(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function qM(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 JM(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function YM(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||JM(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||JM(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(EM,`$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=DM,e.addEventListener(t,a?kM:OM,a)):e.removeEventListener(t,a?kM:OM,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 XM(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=DM++;else if(t.u<n.l)return;return n(X.event?X.event(t):t)}}}function ZM(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 zM(v,x),f.constructor=M,f.render=iN),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=PM({},f.__s)),PM(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=PM({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===RM&&d.key==null&&(E=eN(d.props.children)),s=WM(e,MM(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--;)FM(a[j]);QM(t)}}else t.__e=n.__e,t.__k=n.__k,e.then||QM(t);X.__e(e,t,n)}else s=t.__e=tN(n.__e,t,n,r,i,a,o,c,l,u);return(d=X.diffed)&&d(t),128&t.__u?void 0:s}function QM(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(QM)}function $M(e,t,n){for(var r=0;r<n.length;r++)nN(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 eN(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:MM(e)?e.map(eN):PM({},e)}function tN(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&&=NM.call(e.childNodes),v=n.props||AM,!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;YM(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&&!_||YM(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=``),WM(b==`template`?e.content:e,MM(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&BM(n,0),s,c,l),a!=null)for(u=a.length;u--;)FM(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||YM(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&YM(e,u,g,v[u],i))}return e}function nN(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 rN(e,t,n){var r,i;if(X.unmount&&X.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||nN(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]&&rN(r[i],t,n||typeof e.type!=`function`);n||FM(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function iN(e,t,n){return this.constructor(e,n)}function aN(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=IM(RM,null,[e]),i=[],a=[],ZM(t,e,r||AM,AM,t.namespaceURI,r?null:t.firstChild?NM.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),$M(i,e,a)}function oN(e,t){e.__u|=32,aN(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 wM=0,e}},xM=0,zM.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=PM({},this.state);typeof e==`function`&&(e=e(PM({},n),this.props)),e&&PM(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),HM(this))},zM.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),HM(this))},zM.prototype.render=RM,SM=[],wM=0,TM=function(e,t){return e.__v.__b-t.__v.__b},EM=/(PointerCapture)$|Capture$/i,DM=0,OM=XM(!1),kM=XM(!0);var sN=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:--sN,__i:-1,__u:0,__source:i,__self:a};return X.vnode&&X.vnode(l),l}var cN=16,lN=16,uN={};function dN({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}=uN[e]??{width:cN,height:lN},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 fN=e=>e!==void 0&&/\s/.test(e),pN=(e,t)=>{let n=t=>fN(e[t-1])||fN(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},mN=e=>pN(e,Math.ceil(e.length/2)),hN=e=>{if(e.length<2)return[e,``];let t=mN(e);return[e.slice(0,t),e.slice(t)]},gN=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:mN(e);return[e.slice(0,r),e.slice(r)]},_N=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)]},vN=(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)]},yN=(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)]},bN=(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 xN({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 SN(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 CN({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=Z(SN,{mode:t,children:e},`content`),o=Z(xN,{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 wN({children:e,...t}){"use no memo";return Z(CN,{mode:`truncate`,...t,children:e})}function TN({children:e,...t}){"use no memo";return Z(CN,{mode:`fruncate`,...t,children:e})}function EN({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(wN,{...s,children:t[0]}),l=Z(TN,{...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`?TN:wN,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=hN:r===`extension`?t=gN:r===`leaf-path`&&(t=_N);else if(typeof r==`number`)t=vN,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=yN:e===`first`&&(t=bN)}else typeof r==`function`&&(t=r);t??=hN;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(wN,{...s,..._,children:f}),l=Z(TN,{...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 DN={endIndex:-1,startIndex:-1};function ON(e,t,n){return Math.min(Math.max(e,t),n)}function kN(e,t){return e<0||t<e?DN:{endIndex:t,startIndex:e}}function AN(e){return e.startIndex<0||e.endIndex<e.startIndex}function jN(e,t){return AN(e)?0:(e.endIndex-e.startIndex+1)*t}function MN(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function NN(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function PN(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 FN(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 IN(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 LN(e,t,n){if(e.length===0||t<=0)return[];let r=IN(e),i=PN(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=FN(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 RN(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=ON(t.scrollTop,0,o),c=t.stickyRows??LN(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=MN(s,n,t.itemHeight),m=MN(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?DN:kN(m,NN(u+d,n,t.itemHeight)),y=g+1,b=AN(v)?DN:kN(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=jN(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:AN(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var zN={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},BN={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},VN=`Contains git status items`;function HN(e){return e.current?!0:(e.current=!0,!1)}function UN(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 WN(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return UN({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 GN(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 KN(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 qN(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 JN(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function YN(e,t){return e!=null&&e>0?e:t}function XN(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 ZN(e,t,n,r,i=0){let a=UN({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a!=null&&(e.scrollTop=a,!0)}function QN(e,t,n,r,i,a,o=0){let s=WN({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s!=null&&(e.scrollTop=s,!0)}function $N(e,t,n,r,i,a){let o=GN({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o!=null&&(e.scrollTop=o,!0)}function eP(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function tP(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function nP({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 rP(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 iP(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 aP,oP,sP,cP,lP=Object.is,uP=0,dP=[],fP=X,pP=fP.__b,mP=fP.__r,hP=fP.diffed,gP=fP.__c,_P=fP.unmount,vP=fP.__;function yP(e,t){fP.__h&&fP.__h(oP,e,uP||t),uP=0;var n=oP.__H||(oP.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function bP(e){return uP=1,xP(MP,e)}function xP(e,t,n){var r=yP(aP++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):MP(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);lP(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=oP,!oP.__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,lP(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};oP.__f=!0;var a=oP.shouldComponentUpdate,o=oP.componentWillUpdate;oP.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)},oP.shouldComponentUpdate=i}return r.__N||r.__}function SP(e,t){var n=yP(aP++,3);!fP.__s&&jP(n.__H,t)&&(n.__=e,n.u=t,oP.__H.__h.push(n))}function CP(e,t){var n=yP(aP++,4);!fP.__s&&jP(n.__H,t)&&(n.__=e,n.u=t,oP.__h.push(n))}function Q(e){return uP=5,wP(function(){return{current:e}},[])}function wP(e,t){var n=yP(aP++,7);return jP(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function TP(e,t){return uP=8,wP(function(){return e},t)}function EP(){for(var e;e=dP.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(kP),e.__H.__h.forEach(AP),e.__H.__h=[]}catch(t){e.__H.__h=[],fP.__e(t,e.__v)}}fP.__b=function(e){oP=null,pP&&pP(e)},fP.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),vP&&vP(e,t)},fP.__r=function(e){mP&&mP(e),aP=0;var t=(oP=e.__c).__H;t&&(sP===oP?(t.__h=[],oP.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(kP),t.__h.forEach(AP),t.__h=[],aP=0)),sP=oP},fP.diffed=function(e){hP&&hP(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(dP.push(t)!==1&&cP===fP.requestAnimationFrame||((cP=fP.requestAnimationFrame)||OP)(EP)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),sP=oP=null},fP.__c=function(e,t){t.some(function(e){try{e.__h.forEach(kP),e.__h=e.__h.filter(function(e){return!e.__||AP(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],fP.__e(n,e.__v)}}),gP&&gP(e,t)},fP.unmount=function(e){_P&&_P(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{kP(e)}catch(e){t=e}}),n.__H=void 0,t&&fP.__e(t,n.__v))};var DP=typeof requestAnimationFrame==`function`;function OP(e){var t,n=function(){clearTimeout(r),DP&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);DP&&(t=requestAnimationFrame(n))}function kP(e){var t=oP,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),oP=t}function AP(e){var t=oP;e.__c=e.__(),oP=t}function jP(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!lP(t,e[n])})}function MP(e,t){return typeof t==`function`?t(e):t}function NP(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(RM,{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(wN,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function PP(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function FP(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function IP(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 LP({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=RN(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:IP(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?IP(u,1,t,o):i&&r<=0&&c.length>0?LN(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 RP=400,zP=40,BP=18;function VP(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))?HP(e,t,n):a instanceof HTMLElement?a:null}function HP(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 UP(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 WP(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 GP(){return navigator.vendor!==`Apple Computer, Inc.`}function KP(e,t){let n=e-t.top;if(n<zP)return-Math.ceil((zP-Math.max(0,n))/zP*BP);let r=t.bottom-e;return r<zP?Math.ceil((zP-Math.max(0,r))/zP*BP):0}function qP(e,t){if(e!=null){let t=zN[e];return t==null?null:{text:t,title:BN[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:VN}:null}function JP(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 YP(e){return e!=null&&`toggle`in e}function XP(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function ZP(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function QP(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function $P(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function eF(e,t){return t&&$P(e)||(e.ctrlKey||e.metaKey)&&XP(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var tF=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function nF(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 rF(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 iF(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function aF(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function oF(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function sF(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 cF(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 lF(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 uF(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=lF(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 dF(e,t){return{kind:e.kind,name:FP(e),path:t}}function fF(e){return e==null?void 0:`${e}__tree`}function pF(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function mF(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function hF(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`?mF(e.icon)?t(e.icon):{name:e.icon}:mF(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(dN,{...n})})}function gF(e){e!=null&&KN(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function _F(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=PP(e);return Z(RM,{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(dN,{...t(`file-tree-icon-chevron`)}):Z(dN,{...t(`file-tree-icon-file`,u)})}),Z(`div`,{"data-item-section":`content`,children:e.isFlattened?NP(e,c,a):c??Z(EN,{minimumLength:5,split:`extension`,children:e.name})}),i?Z(`div`,{"data-item-section":`decoration`,children:r==null?null:hF(r,t)}):null,s?Z(`div`,{"data-item-section":`git`,children:hF(o,t)}):null,n?Z(`div`,{"data-item-section":`action`,children:l?Z(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:Z(dN,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function vF(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:ee}=e,N=PP(t),{isParked:te=!1,mode:ne=`flow`,style:re}=r,ie=ne===`sticky`,ae=_?.get(N)??null??JP(t.ancestorPaths,v,y),oe=t.kind===`directory`&&(b?.has(N)??!1),se=A(t,N),ce=qP(ae,oe),le=S&&w,ue=se!=null||x||le,de=le&&T===`always`,fe=a.getPath()===N,pe=fe?a.getValue():``,me=ie||!fe?null:Z(nP,{ref:D,ariaLabel:`Rename ${FP(t)}`,isFlattened:t.isFlattened,value:pe,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),he=_F(t,k,{actionLaneEnabled:le,customDecoration:se,decorationLaneEnabled:ue,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:ce,gitLaneActive:x,renameInput:me,showDecorativeActionAffordance:de}),ge={...rP({ariaLabel:FP(t),domId:t.isFocused?pF(h,N,te):void 0,extraStyle:re,features:{actionLaneEnabled:le,contextMenuButtonVisibility:le?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:te,itemHeight:g,mode:ne,row:t,state:{containsGitChange:oe,effectiveGitStatus:ae,isContextHovered:s===N,isDragTarget:l?.kind===`directory`&&l.directoryPath===N,isDragging:c?.has(N)===!0,isFocusRinged:t.isFocused&&o===N},targetPath:N}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),E&&(i.focusMountedPathFromInput(N),j(t,N,{anchorRect:iF(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:ie?void 0:()=>{i.focusMountedPathFromInput(N)},onKeyDown:ie?void 0:ee,ref:e=>{O(N,e)}};return!ie&&fe?Z(`div`,{...ge,children:he}):Z(`button`,{...ge,type:`button`,draggable:u&&!te,onDragEnd:u&&!te?p:void 0,onDragStart:u&&!te?e=>{f(e,t,N)}:void 0,onMouseDown:e=>{if(ie){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!te?e=>{m(e,t,N)}:void 0,onClick:e=>{M(e,t,N,ne)},children:he})}function yF(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(PP(e))).map((n,r)=>vF(e,n,t.start+r))}function bF({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=uj,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),ee=Q(null),N=Q(null),te=Q(!1),ne=Q(null),re=Q(null),ie=Q(null),ae=Q(null),oe=Q(null),se=Q(null),ce=Q(null),le=Q(null),ue=Q(!1),de=Q(null),fe=Q(null),pe=Q(null),me=Q(null),he=wP(()=>new Map,[]),[,ge]=bP(0),_e=Q(!1),[ve,ye]=bP(null),[be,xe]=bP(null),[Se,Ce]=bP(null),[we,Te]=bP(null),[Ee,De]=bP(0),[P,Oe]=bP(null),ke=Q(P);ke.current=P;let Ae=Q(null),je=Q(null),Me=Q(null),Ne=Q(null),Pe=Q(null),Fe=Q(!1),Ie=()=>{je.current=null,Me.current=null,Ne.current=null},Le=(e,t)=>{je.current=e,Me.current=null,Ne.current=t==null?null:{path:e,scrollTop:t}},Re=(e,t)=>{je.current=null,Me.current={path:e,viewportOffset:t},Ne.current=null},ze=Q(d===`retain`&&t.isSearchOpen()),[Be,Ve]=bP(p);SP(()=>{p||Ve(!1)},[p]);let He=Q(!1),Ue=TP(()=>{He.current=!0,Ve(e=>e&&!1)},[]),[We,Ge]=bP(()=>LP({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[Ke,qe]=bP(!1);SP(()=>{qe(!0)},[]);let Je=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Ye=e?.contextMenu?.triggerMode??(Je?`right-click`:`both`),Xe=Ye===`both`||Ye===`button`,Ze=e?.contextMenu?.buttonVisibility??`when-needed`,Qe=Ye===`both`||Ye===`right-click`;CP(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;Pe.current=t,xe(t),Te(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(Fe.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 $e=TP((e,t)=>{oF(T.current,e,t)},[]),et=TP((e,t)=>{oF(E.current,e,t)},[]),tt=TP(e=>{x.current=e},[]),nt=TP(e=>sF(e,E.current,T.current),[]),rt=n!=null||r!=null||i!=null,{resolveIcon:it}=wP(()=>kD(a),[a]),at=t[tM](),ot=at.getPath(),st=ot!=null,ct=t.isSearchOpen(),lt=t.getSearchValue(),F=t.getFocusedPath(),I=t.getFocusedIndex(),ut=t.getScrollRequest(),dt=t.isDragAndDropEnabled(),ft=t.getDragSession(),pt=wP(()=>ft==null?null:new Set(ft.draggedPaths),[ft]),mt=ft?.target??null,ht=ft?.primaryPath??null,gt=fF(o),{overlayHeight:_t,overlayRows:vt,snapshot:yt,visibleRows:bt}=We,xt=yt.physical.viewportHeight,St=wP(()=>({end:yt.window.endIndex,start:yt.window.startIndex}),[yt.window.endIndex,yt.window.startIndex]),Ct=vt,wt=yt.sticky.rows,Tt=yt.physical.totalHeight,Et=yt.sticky.height,Dt=wP(()=>new Set(wt.map(e=>PP(e.row))),[wt]),Ot=I>=0&&I>=St.start&&I<=St.end,kt=TP((e,t)=>u?.({item:dF(e,t),row:e})??null,[u]),At=TP(e=>KN(e==null?null:T.current.get(e)??null)?!0:KN(S.current),[]),jt=TP(e=>{At(t.focusNearestPath(e))},[t,At]),Mt=Q(jt);Mt.current=jt;let Nt=Q(!0),Pt=Q(()=>{}),Ft=TP((t=!0)=>{let n=ke.current;n!=null&&(Nt.current=Nt.current&&t,Oe(null),e?.contextMenu?.onClose?.(),Nt.current&&jt(n.path))},[e?.contextMenu,jt]);Pt.current=Ft;let It=TP(e=>{let t=e==null?null:aF(S.current,e);Ce(e=>e===t?e:t)},[]),Lt=TP((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=nt(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;Le(n,e?.scrollTop??null),M.current=!0,ye(e=>e===n?e:n)}i.focus(),It(a),Nt.current=!0,Oe({anchorRect:r?.anchorRect??null,item:dF(e,n),path:n,source:r?.source??`keyboard`})},[t,nt,It]),L=TP(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=JN(e,xt);ne.current=I<0||e==null?null:Math.max(0,Math.min(I*s-e.scrollTop,Math.max(0,t-s))),te.current=!0}t.startRenaming(e)!==!1&&(Te(`focus`),ge(e=>e+1))}},[t,I,s,l,xt]),Rt=TP((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=JN(i,xt),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:LP({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return M.current=!0,$N(i,a,s,l,u,d),D.current(),Ae.current=n?e:null,!0},[t,s,c,xt,h]),zt=()=>y.current===!0||me.current!=null||ue.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=()=>{ae.current!=null&&(clearTimeout(ae.current),ae.current=null),ie.current=null},Ut=()=>{se.current?.remove(),se.current=null},Wt=()=>{Vt(re.current),re.current=null,oe.current=null},Gt=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},Kt=()=>{le.current?.(),le.current=null,me.current!=null&&(clearTimeout(me.current),me.current=null),ue.current=!1,de.current=null,pe.current=null,fe.current!=null&&(fe.current.setAttribute(`draggable`,`true`),fe.current.style.removeProperty(`touch-action`),fe.current=null),Ut(),Ht(),Wt(),ce.current=null},qt=(e,n)=>{let r=S.current?.getRootNode(),i=UP(VP(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=YP(r)?r:null;if(i==null||i.isExpanded()){Ht();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;ie.current!==a&&(Ht(),ie.current=a,ae.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind===`directory`&&n.directoryPath===e.directoryPath&&n.flattenedSegmentPath===e.flattenedSegmentPath&&i.expand()},n))},Yt=()=>{re.current=null;let e=oe.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=KP(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)),re.current=Bt(Yt)},Xt=(e,t)=>{oe.current={clientX:e,clientY:t},re.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(ce.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),GP())){let t=WP(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),se.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Qt=()=>{Ut(),Ht(),Wt(),ce.current=null,t.cancelDrag()},$t=(e,n,r)=>{if(me.current!=null||ue.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;pe.current={clientX:i.clientX,clientY:i.clientY},fe.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!ue.current;me.current!=null&&(clearTimeout(me.current),me.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),le.current===o&&(le.current=null),t&&(a.setAttribute(`draggable`,`true`),fe.current===a&&(fe.current=null),pe.current=null)},s=e=>{let t=e.touches[0],n=pe.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),le.current=o,me.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),fe.current===a&&(fe.current=null),pe.current=null;return}ue.current=!0,fe.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),ce.current=n;let e=a.getBoundingClientRect(),s=WP(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),se.current=s,de.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=de.current;n!=null&&se.current!=null&&(se.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()};le.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)},RP)},en=e=>{if(P!=null){if(e.key===`Escape`){Ft(),e.preventDefault(),e.stopPropagation();return}tF.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(at.isActive()){if(e.isComposing||e.keyCode===229)return;if(e.key===`Escape`)at.cancel();else if(e.key===`Enter`)at.commit();else return;Te(`focus`),ge(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){L(F??void 0),e.preventDefault(),e.stopPropagation();return}if(ct){if(e.key===`Escape`)te.current=!1,ne.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=JN(n,xt);ne.current=I<0||n==null?null:Math.max(0,Math.min(I*s-n.scrollTop,Math.max(0,r-s))),te.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;Te(`focus`),ge(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&ZP(e)){t.openSearch(e.key),ge(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=Je&&$P(e),r=eF(e,Je),i=r&&S.current!=null?qN(S.current):null,a=r?new Set(cF(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==F&&a.has(o)){let e=C.current;Le(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=YP(p)?p:null,h=u!=null&&(Dt.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=sF(u,E.current,T.current);e==null||n==null?y=!1:Lt(e,u)}else if((e.ctrlKey||e.metaKey)&&XP(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;Te(`focus`);let b=t.getFocusedPath(),x=b!=null&&(Dt.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))Le(b,v?.scrollTop??null),M.current=!0,ye(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(Re(b,uF(S.current,v,i,u,s,Et,xt)),M.current=!0,ye(e=>e===b?e:b)):Ie()}ge(e=>e+1),e.preventDefault(),e.stopPropagation()};CP(()=>{if(!(!f||!ct)){if(ze.current){ze.current=!1;return}KN(w.current)}},[ct,f]),CP(()=>{let e=x.current;switch(tP({hasRenderedInput:e!=null,previousRenamingPath:N.current,renamingPath:ot})){case`reset`:N.current=null;return;case`reveal-canonical`:ot!=null&&Rt(ot,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(Ae.current=null,N.current=ot,KN(e),e.select());return}},[St.end,St.start,ot,Rt,Dt]),CP(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=qN(e)?.dataset.itemPath??null;ye(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,qN(e)!=null){r();return}M.current=!1,ye(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),M.current=!1,ye(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;ye(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),CP(()=>{let e=S.current;e!=null&&(yt.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[yt.physical.scrollTop]),CP(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=JN(n,g);let a=()=>{let e=t.getVisibleCount(),r=YN(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Ge(LP({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=YN(O.current,g),i=t.getVisibleRows(e,e)[0]??null;ZN(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(()=>{HN(_e)&&ge(e=>e+1),a()}),l=()=>{Fe.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,De(e=>e+1),e=null},50))},u=null,d=()=>{i!=null&&delete i.dataset.overlayReveal,u!=null&&(clearTimeout(u),u=null)},f=()=>{i!=null&&Fe.current!==!0&&(n.scrollTop>0||(i.dataset.overlayReveal=`true`,u!=null&&clearTimeout(u),u=setTimeout(()=>{d()},200)))},p=()=>{if(a(),n.scrollTop>0&&d(),ke.current!=null&&y.current&&Pt.current(),Fe.current===!0){y.current=!1;return}xe(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:XN(e[0]))??JN(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]),CP(()=>{Je||P==null||Ft(!1)},[Ft,Je,P]);let tn=wP(()=>P==null?null:`${P.path}::${P.source}`,[P]);CP(()=>{if(tn==null){m?.clearSlotContent(xD);return}let t=ke.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??rF(n.getBoundingClientRect()),close:e=>{Pt.current(e?.restoreFocus??!0)},restoreFocus:()=>{Nt.current&&Mt.current(ke.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(xD,i),e?.contextMenu?.onOpen?.(t.item,r),gF(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&gF(i)}),()=>{m?.clearSlotContent(xD)}},[tn,e?.contextMenu,m]),CP(()=>{P!=null&&t.getItem(P.path)==null&&Ft()},[Ft,P,t]),CP(()=>{if(P==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(nF(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&Ft())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Ft())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[Ft,P]),CP(()=>{let e=C.current,n=S.current;if(e==null||n==null){ee.current=F;return}let r=F==null?null:T.current.get(F)??null,i=qN(n),a=i?.dataset.itemPath??null,o=st&&x.current===i,c=f&&w.current===i,l=te.current&&!ct,u=ne.current??0,d=Ae.current,p=je.current,m=Me.current,g=Ne.current,_=i!=null,v=M.current||_,y=ee.current!==F,b=p!=null&&p===F&&F!=null,E=!1,O=!1;if(ut!=null&&ut.id!==k.current){k.current=ut.id;let n=ut.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,xt-s))):Et;E=!0,O=QN(e,n,s,xt,Tt,ut.offset,t)}t.clearScrollRequest(ut.id)}let A=!E&&l&&$N(e,I,s,xt,Tt,u),j=!E&&d!=null&&d===F&&$N(e,I,s,xt,Tt,Et),N=!E&&m!=null&&m.path===F&&$N(e,I,s,xt,Tt,m.viewportOffset),re=!E&&g!=null&&g.path===F&&e.scrollTop!==g.scrollTop;if(re&&(e.scrollTop=g.scrollTop),(re||O||j||N||A||v&&y&&d!==F&&!b&&ZN(e,I,s,xt,Et))&&D.current(),E){ee.current=F;return}if(!v){ee.current=F;return}if(o){ee.current=F;return}if(c&&!l){ee.current=F;return}if(r==null){l&&I>=0&&($N(e,I,s,xt,Tt,u),D.current()),ee.current=F;return}(y||l||d===F||p===F||m?.path===F||g?.path===F||a==null||a!==F)&&(KN(r),d===F&&(Ae.current=null),p===F&&(je.current=null),m?.path===F&&(Me.current=null),g?.path===F&&(Ne.current=null),te.current=!1,ne.current=null),ee.current=F},[t,I,F,Ot,s,st,ct,St,xt,f,ut,h,Et,Tt,bt]);let nn=I>=0&&I>=yt.visible.startIndex&&I<=yt.visible.endIndex,rn=F!=null&&Ct.some(e=>PP(e.row)===F),an=nn||rn,on=Xe&&M.current===!0&&an?F:null,sn=we===`pointer`?be:null,cn=P?.path??Pe.current??sn??on??be,ln=P?.source===`right-click`;CP(()=>{y.current&&P==null||It(nt(cn))},[P,nt,St,xt,Ee,Ct,cn,It,bt]);let un=TP(e=>{if(y.current||nF(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&&Te(e=>e===`pointer`?e:`pointer`),xe(e=>e===i?e:i)},[]),dn=TP(()=>{xe(null)},[]);CP(()=>{if(!dt)return;let e=()=>{Kt(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),Kt(),t.cancelDrag()}},[t,dt]);let R=e=>{if(!dt||t.getDragSession()==null||ue.current)return;let n=UP(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(!dt||t.getDragSession()==null||ue.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Ht(),Wt(),t.setDragTarget(null))},pn=e=>{!dt||t.getDragSession()==null||ue.current||(e.preventDefault(),qt(e.clientX,e.clientY),t.completeDrag(),Ut(),Ht(),Wt(),ce.current=null)},mn=yt.window.height,hn=yt.window.offsetTop,gn=Math.min(0,xt-mn),_n=Math.min(0,xt-mn-Et),vn=ve===F||te.current,yn=F!=null&&vn&&!Ot&&I>=0?bt[I]??t.getVisibleRows(I,I)[0]??null:null,bn=yn==null?null:eP(I,s,St,mn),xn=ce.current,Sn=ht!=null&&xn!=null&&xn.path===ht&&xn.index>=St.start&&xn.index<=St.end,Cn=ht!=null&&xn!=null&&xn.path===ht&&!Sn&&xn.path!==yn?.path?xn:null,wn=Cn==null?null:eP(Cn.index,s,St,mn),Tn=QP((I>=0?bt[I]??t.getVisibleRows(I,I)[0]??null:null)?.ancestorPaths.at(-1)??null),En=ct&&F!=null?pF(o,F,!Ot):void 0,z=P?.path??(ct?F:ve),Dn=P?.path??be,On=nt(cn),B=Je&&Xe&&!ln&&!st&&On!=null&&Se!=null&&cn!=null,V=Je&&(B||P!=null),kn=P?.anchorRect,An=kn==null&&On!=null&&Se!=null&&(P!=null||B)?Se:null,jn=kn==null?An==null?void 0:{top:`${An}px`}:{left:`${kn.left}px`,position:`fixed`,right:`auto`,top:`${kn.top}px`},Mn=ln?{opacity:`0`}:void 0,Nn=TP((e,n,r,i)=>{let a=iP({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:ct,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>=yt.visible.startIndex&&n.index<=yt.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(M.current=!0,ye(e=>e===c?e:c),Te(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&Rt(c,{targetOffset:`sticky-parents`})},[t,ct,yt.visible.endIndex,yt.visible.startIndex,Rt]),Pn=()=>{if(y.current||!Xe||cn==null||On==null)return;let e=t.getItem(cn);e!=null&&(It(On),Nt.current=!0,Oe({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:On.getAttribute(`aria-label`)??cn,path:e.getPath()},path:e.getPath(),source:`button`}))},Fn={contextHoverPath:Dn,contextMenuButtonTriggerEnabled:Xe,contextMenuButtonVisibility:Ze,contextMenuEnabled:Je,contextMenuRightClickEnabled:Qe,contextMenuTriggerMode:Ye,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:dt,draggedPathSet:pt,dragTarget:mt,gitLaneActive:rt,gitStatusByPath:n,handleRowDragEnd:Qt,handleRowDragStart:Zt,handleRowTouchStart:$t,ignoredGitDirectories:r,ignoredInheritanceCache:he,instanceId:o,itemHeight:s,onKeyDown:en,onRowClick:Nn,openContextMenuForRow:Lt,registerButton:$e,registerRenameInput:tt,renameView:at,renderDecorationForRow:kt,resolveIcon:it,shouldSuppressContextMenu:zt,visualFocusPath:z},In={...Fn,registerButton:et};return Z(`div`,{ref:S,id:gt,"data-file-tree-context-menu-button-visibility":Je&&Xe?Ze:void 0,"data-file-tree-context-menu-trigger-mode":Je?Ye:void 0,"data-file-tree-has-context-menu-action-lane":Je&&Xe?`true`:void 0,"data-file-tree-has-git-lane":rt?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:dt?fn:void 0,onDragOver:dt?R:void 0,onDrop:dt?pn:void 0,onKeyDown:en,onPointerLeave:Je?dn:void 0,onPointerOver:Je?un: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:bD,"data-type":`header-slot`}),f?Z(`div`,{"data-file-tree-search-container":!0,"data-open":ct?`true`:`false`,children:Z(`input`,{ref:w,"aria-activedescendant":En,"aria-controls":gt,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Be?`true`:void 0,value:lt,onBlur:()=>{d===`retain`&&!He.current||t.closeSearch()},onFocus:Ue,onPointerDown:Ue,onInput:e=>{Ue();let n=e.currentTarget;t.setSearch(n.value)}})}):null,Z(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&Ke&&Ct.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:`${_t}px`},children:Ct.map((e,t)=>vF(In,e.row,`sticky:${PP(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${Ct.length-t}`}}))})}):null,Z(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${Tt}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:[yF(Fn,St,Dt),yn!=null&&bn!=null?vF(Fn,yn,`parked:${yn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:ht===yn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${bn}px`}}):null,Cn!=null&&wn!=null?vF(Fn,Cn,`parked-drag:${Cn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${wn}px`}}):null]})]})]}),Je?Z(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":V?`true`:`false`,style:jn,children:[Z(`button`,{ref:v,type:`button`,"data-type":SD,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":P==null?`false`:`true`,"data-visible":B?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),P!=null){Ft();return}Pn()},tabIndex:-1,style:Mn,children:Z(dN,{...it(`file-tree-icon-ellipsis`)})}),P==null?null:Z(`slot`,{name:xD})]}):null,P==null?null:Z(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),Ft()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),Ft()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var xF={hydrateRoot:(e,t)=>{oN(IM(bF,t),e)},renderRoot:(e,t)=>{aN(IM(bF,t),e)},unmountRoot:e=>{aN(null,e)}};function SF(e,t){xF.renderRoot(e,t)}function CF(e,t){xF.hydrateRoot(e,t)}function wF(e){xF.unmountRoot(e)}var TF=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 EF(e,t,n){if(!e.s){if(n instanceof DF){if(!n.s)return void(n.o=EF.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(EF.bind(null,e,t),EF.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}var DF=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{EF(r,1,a(this.v))}catch(e){EF(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?EF(r,1,t?t(i):i):n?EF(r,1,n(i)):EF(r,2,i)}catch(e){EF(r,2,e)}},r},e}();Array.isArray;var OF=0;function kF(e){return e!=null&&e.length>0?e:(OF+=1,`pst_ft_${OF}`)}function AF({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??uj)}function jF(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 MF(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 NF(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var PF=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new TF;#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=kF(a),this.#p=fM(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=lj(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new sM({...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&&(wF(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=pM(this.#p,e);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&SF(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(),SF(t.wrapper,this.#w()))}setGitStatus(e){let t=fM(e,this.#p);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&SF(n.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),SF(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),CF(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),SF(r,this.#w())}#C(){return{initialViewportHeight:AF({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(bD,e());return}this.#l.setSlotHtml(bD,this.#e?.header?.html??null)}#k(e){let t=NF(e).find(e=>MF(e)),n=jF(uD(wD(this.#m).set));n!=null&&(t==null||t.outerHTML!==n.outerHTML)&&(t==null?e.prepend(n):t.replaceWith(n))}#A(e){let t=NF(e),n=t.find(e=>MF(e)),r=t.filter(e=>e!==n),i=wD(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=jF(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=wD(this.#m);t.colored&&fD(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${gD}]`);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(gD,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=mj(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 bj(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)}},FF=`_js _n`,IF=`<div><input type=search placeholder="Filter files…" aria-label="Filter files"></div>`,LF=` D l`,RF=s(18,e=>y(e,`b`,e.l,eI(e))),zF=j(11,RF),BF=s(10,e=>zF(e,(e.j??e.h)||``)),VF=j(17,RF),HF=s(16,e=>VF(e,tI(e))),UF=j(15,HF),WF=s(14,e=>UF(e,nI(e)),2),GF=u(7,e=>{BF(e),WF(e)}),KF=s(6,e=>GF(e,e.e,e.f)),qF=j(4,KF),JF=j(5,KF),YF=l(9,e=>{BF(e),WF(e)}),XF=(e,t)=>$F(e,t.timer),ZF=r(`l3`,e=>{T(e,`b`),o(e.b,`keydown`,function(t){t.key===`Enter`&&e.p(),t.key===`Escape`&&e.l&&(t.preventDefault(),e.r(``))})});function QF(e){_(e.a,`_jr`),_(e.b,FF),YF(e,null),XF(e,{timer:0}),ZF(e)}var $F=j(13,e=>{WF(e),HF(e)}),eI=e=>function(t){e.r(t)},tI=e=>t=>{if(e.n&&clearTimeout(e.n),!t){e.n=0,YF(e,null),GF(e,``);return}YF(e,t),e.n=setTimeout(e.p,150)},nI=e=>()=>{e.n&&=(clearTimeout(e.n),0);let t=e.j===null?e.h||``:e.j;YF(e,null),GF(e,t)};d(`l0`,eI),d(`l2`,tI),d(`l1`,nI);var rI=(e=>`<div><div title="Drag to resize"></div><div>${e}</div><div></div></div>`)(IF),iI=(e=>` D b D/${e}&l l`)(LF),aI={A:`added`,D:`deleted`,M:`modified`,R:`renamed`},oI=s(7,e=>{S(e.a,`aria-expanded`,e._._.t.has(e._.f)?`false`:`true`),_(e.b,[`_iH`,{_iI:!e._._.t.has(e._.f)}])}),sI=A(29,oI,e=>e._._),cI=r(`y4`,e=>o(e.a,`click`,function(){let t=new Set(e._._.t);t.delete(e._.f)||t.add(e._.f),kI(e._._,t)})),lI=e=>{sI(e),uI._(e),dI._(e),fI._(e),_(e.a,`_iG`),oe(e.c),De(e.c,12),yt(e.c),_(e.d,`_iJ`),_(e.f,`_iK`),cI(e)},uI=c(1,0,oI),dI=c(1,0,e=>{S(e.a,`title`,e._.h),m(e.e,e._.h)}),fI=c(1,0,e=>m(e.g,e._.j)),pI=C(1,(e=>`<button type=button><span aria-hidden=true>${e}</span><span> </span><span> </span></button>`)(ae),(e=>` D D/${e}&l D l D m`)(be),lI),mI=f(4,e=>{_(e.a,[`_iF`,{_iE:e._.m===1}]),_(e.c,[`_iM`,{_iL:e._.m===1}]),pI(e,e._.m>1?0:1)}),hI=e=>{mI._(e),_I._(e)},gI=s(6,e=>S(e.c,`hidden`,e._.t.has(e.f))),_I=f(4,gI),vI=j(5,e=>{S(e.a,`data-section`,e.f),S(e.c,`data-tree`,e.f),gI(e),uI(e)}),yI=(e,t)=>{vI(e,t[0]?.id),bI(e,t[0]?.label),xI(e,t[0]?.files?.length)},bI=j(7,dI),xI=j(9,fI),SI=r(`y5`,e=>a(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:aI[e.status]??`modified`})),r=e=>e.files.map(e=>`${e.path}:${e.status}`).join(`
2797
- `),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 PF({paths:i.files.map(e=>e.path),gitStatus:n(i),initialExpansion:`open`,flattenEmptyDirectories:!0,search:!1,fileTreeSearchMode:`hide-non-matches`,initialSearchQuery:e.q||null,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),shownFilter:e.q||``}},onUpdate:function(){let e=(this.filter||``)!==this.shownFilter;this.shownFilter=this.filter||``;let t=this.marks(this.commentCounts,this.newKeys),n=t!==this.shownMarks;this.shownMarks=t;let r=new Set(this.sections.map(e=>e.id));for(let[e,t]of this.trees)r.has(e)||(t.unsub(),t.tree.cleanUp(),this.trees.delete(e));for(let t of this.sections){let r=this.trees.get(t.id);if(!r){this.build(t);continue}e&&r.tree.setSearch(this.shownFilter||null);let i=this.sig(t);i===r.sig?n&&r.tree.setGitStatus(this.gitStatus(t)):(r.sig=i,r.tree.resetPaths(t.files.map(e=>e.path)),r.tree.setGitStatus(this.gitStatus(t)))}},onDestroy:function(){for(let e of this.trees.values())e.unsub(),e.tree.cleanUp()}})),CI=s(18,SI,4),wI=u(16,e=>{qF(e.d,e.q),CI(e)}),TI=s(9,e=>wI(e,e.h,e.i)),EI=j(7,TI),DI=j(8,TI),OI=g(sI),kI=l(19,e=>{_I(e),OI(e)}),AI=j(27),jI=s(24,e=>AI(e,qI(e))),MI=l(20,e=>{x(e.a,e.u==null?void 0:`--tree-w:${e.u}px`),jI(e)}),NI=l(21,e=>_(e.b,[`_iO`,{_iN:e.v}])),PI=(e,t)=>zI(e,t.id),FI=r(`y6`,e=>{o(e.b,`pointerdown`,function(t){e.z(t)}),o(e.b,`pointermove`,function(t){e.a0(t)}),o(e.b,`pointerup`,function(t){e.a1(t)}),o(e.b,`pointercancel`,function(t){e.a1(t)})});function II(e){_(e.c,`_iC`),QF(e.d),JF(e.d,JI(e)),_(e.e,`_iD`),kI(e,new Set),MI(e,le()),NI(e,!1),PI(e,{id:-1}),FI(e)}var LI=j(25),RI=j(26),zI=j(23,e=>{LI(e,YI(e)),RI(e,XI(e)),jI(e)}),BI=(e,t)=>_(e.a,[`_iB`,{_iA:t===!1}]),VI=i(4,`<div><!><div></div></div>`,` D%b `,hI,yI),HI=j(11,e=>{KI(e,e.l?.length),VI(e,[e.l,`id`]),CI(e)}),UI=j(13,CI),WI=j(14,CI),GI=j(15,CI),KI=j(12,mI),qI=e=>t=>{t.pointerId===e.x&&(e.x=-1,NI(e,!1),e.u!=null&&Me(e.u))},JI=e=>t=>{wI(e,t)},YI=e=>t=>{(t.pointerType!==`mouse`||t.button===0)&&(t.preventDefault(),e.x=t.pointerId,NI(e,!0),e.b.setPointerCapture(t.pointerId))},XI=e=>t=>{if(t.pointerId!==e.x)return;let n=window.innerWidth-t.clientX;MI(e,Math.min(640,Math.max(200,n)))};d(`y2`,qI),d(`y3`,JI),d(`y0`,YI),d(`y1`,XI);var ZI=`_i6 _ba`,QI=tt,$I=(e=>`/${e}&`)(qe);function eL(e){We(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 tL=(e,t)=>st(e.a,t),nL=(e,t)=>He(e.a,t),rL=`<!><!><!>`,iL=e=>_(e.a,`_i9`),aL=e=>{eL(e.a),tL(e.a,12),nL(e.a,`_ja`)},oL=e=>_(e.a,[`_A`,`_i_`]),sL=c(1,0,e=>{S(e.a,`title`,e._.f),m(e.b,e._.f)}),cL=e=>{sL._(e),_(e.a,ZI)},lL=C(6,QI,(e=>`/${e}&`)($I),aL),uL=s(11,e=>lL(e,+!e._._._._.w.has(e.k))),dL=A(29,uL,e=>e._._._._),fL=r(`i2`,e=>o(e.a,`click`,function(){WL(e._._._._,!1)})),pL=e=>{dL(e),gL(e),vL(e),_(e.a,[`_i5`,`_y`]),_(e.b,`__`),_(e.d,`_i7`),fL(e)},mL=C(5,`<span title="Changed since your last visit"></span>`,` `,oL),hL=s(12,e=>mL(e,+!e._._._._.x.has(e.k))),gL=A(30,hL,e=>e._._._._),_L=s(13,e=>S(e.a,`href`,e._._._._.z(e.k))),vL=A(32,_L,e=>e._._._._),yL=j(10,e=>{_L(e),hL(e),uL(e)}),bL=(e,t)=>{S(e.b,`data-status`,t),m(e.c,t)},xL=(e,t)=>m(e.e,t),SL=(e,t)=>{yL(e,(t?.[0]).file?.key),bL(e,(t?.[0]).file?.status),xL(e,(t?.[0]).name)},CL=e=>_(e.a,`_i4`),wL=C(1,`<div><bdi><!>/</bdi></div>`,` E%`,cL),TL=j(5,e=>{wL(e,+!e.f),sL(e)}),EL=i(2,`<a><span> </span><span><bdi> </bdi></span><!><!></a>`,` D D l E m%b%`,pL,SL),DL=(e,t)=>EL(e,[t,e=>e.file.key]),OL=(e,t)=>{TL(e,(t?.[0]).dir),DL(e,(t?.[0]).files)},kL=e=>{_(e.a,`_i2`),_(e.b,`_i3`)},AL=(e,t)=>m(e.c,t),jL=i(3,`<div><!><!></div>`,` D%b%`,CL,OL),ML=(e,t)=>jL(e,[t,`dir`]),NL=(e,t)=>{AL(e,t[0]?.repo),ML(e,t[0]?.dirs)},PL=C(13,`<p>No files match.</p>`,` `,iL),FL=s(14,e=>m(e.g,e._.n===e._.y?``:` / ${e._.y}`)),IL=c(0,0,e=>{m(e.f,e._.n),PL(e,+!!e._.n),FL(e)}),LL=r(`i3`,e=>{o(e.a,`click`,function(){WL(e._,!1)}),o(e.h,`click`,function(){WL(e._,!1)})}),RL=e=>{IL._(e),zL._(e),BL._(e),HL._(e),_(e.a,`_iX`),_(e.b,`_iY`),_(e.c,`_iZ`),_(e.d,`_iW`),_(e.e,`_i0`),_(e.h,[bt,`_iV`]),Ve(e.i),ft(e.i,16),at(e.i),_(e.j,`_i8`),QF(e.k),JF(e.k,fR(e)),_(e.l,`_i1`),LL(e)},zL=c(0,0,e=>qF(e.k,e._.u)),BL=c(0,0,FL),VL=i(12,`<div><div> </div><!></div>`,` D D l%`,kL,NL),HL=c(0,0,e=>VL(e,[e._.a0,`repo`])),UL=C(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>`)($e,IF),((e,t)=>` b D D b D%b%l D/${e}&m D/${t}&l D%b%m`)(gt,LF),RL),WL=u(18,e=>UL(e,+!e.s)),GL=s(5,e=>WL(e,e.d,e.e)),KL=j(3,GL),qL=j(4,GL),JL=u(20,zL),YL=s(8,e=>JL(e,e.g,e.h)),XL=j(6,YL),ZL=j(7,YL),QL=j(22,g(dL)),$L=(e,t)=>QL(e,t||new Set),eR=j(23,g(gL)),tR=(e,t)=>eR(e,t||new Set),nR=j(24,BL),rR=s(14,e=>nR(e,e.l??e.n)),iR=j(11,rR),aR=j(13,e=>{rR(e),IL(e)}),oR=j(25,g(vL)),sR=s(17,e=>oR(e,pR(e))),cR=j(15,sR),lR=j(16,sR),uR=j(26,HL),dR=(e,t)=>{aR(e,t?.length),uR(e,(()=>{let e=[],n=new Map;for(let r of t){let t=r.key.indexOf(`/`),i=r.key.slice(0,t),a=r.key.slice(t+1),o=a.lastIndexOf(`/`),s=o<0?``:a.slice(0,o),c=o<0?a:a.slice(o+1),l=n.get(i);l||(n.set(i,l=new Map),e.push({repo:i,dirs:[]}));let u=l.get(s);u||(l.set(s,u={dir:s,files:[]}),e[e.length-1].dirs.push(u)),u.files.push({file:r,name:c})}return e})())},fR=e=>t=>{JL(e._,t)},pR=e=>t=>he({workspaceId:e.p,view:`diff`,scope:e.q??null,file:t});d(`i1`,fR),d(`i0`,pR);var mR=((e,t,n,r)=>`<div><div><div><div><div><!><h1>Review</h1><!></div><div><!><button title="Refresh diff">${e}</button><!><span><select aria-label=Compare><option value=committed>Committed</option><option value=working>Working tree</option><option value=dirty>Uncommitted</option><!></select></span> <div>${t}</div><!></div></div><div><!><!><!><!></div><!></div><div data-diff-main></div></div>${n}${r}</div>`)(ce,ZS,rI,rL),hR=((e,t,n,r)=>` D D D D D%b b%l D%b D/${e}&l%b D Dd%mb D0${t}&l%m D%b%b%b%l%l l/${n}&/${r}&l`)(Oe,QS,iI,`b%c`);function gR(e){return e.split(`
2796
+ }`}var nN=new WeakMap;function rN(e){let t=nN.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(ik,`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(),nN.set(e,i),i}function iN(e,t){if(!e.isConnected)return;let n=rN(t);if(n==null)return;let r=t.querySelector(`style[${ak}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(ak,``),t.appendChild(i)),i.textContent=`:host { ${ok}: ${n}px; }`}var aN;function oN(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){aN??(aN=new CSSStyleSheet,aN.replaceSync(eN(QM)));let t=!1;try{e.adoptedStyleSheets=[aN],t=!0}catch{}if(t){e.querySelector(`style[${nk}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(nk,``),t.textContent=eN(QM),e.prepend(t)}}function sN(e,t){cN(e,t),oN(t),iN(e,t)}function cN(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`});sN(this,e)}}if(customElements.define(tk,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(tk)))e instanceof HTMLElement&&sN(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var lN=e=>e.startsWith(`f::`)?e.slice(3):e;function uN(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function dN(e,t){return e===``?t:`${e}/${t}`}function fN({files:e,path:t,isFolder:n,nextBasename:r}){let i=lN(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}=uN(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=dN(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 pN(e){return e.endsWith(`/`)}function mN(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 hN(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 gN(e,t){return t.includes(e)?hN(t):[e]}function _N(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 vN(e,t){return{draggedPaths:e,target:t}}function yN(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(pN(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function bN(e,t){return t.kind===`root`||t.directoryPath==null?mN(e):t.directoryPath}function xN(e,t){let n=e.map(e=>{let n=bN(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 SN(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 CN(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(!SN(qM.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 wN(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function TN(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 EN(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function DN(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 EN(e,t.path)?n?e:null:e;case`move`:return TN(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=DN(r,e,n),r==null)return null;return r}}}function ON(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function kN(e){switch(e.operation){case`add`:return{...ON(e),operation:`add`,path:e.path};case`remove`:return{...ON(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...ON(e),from:e.from,operation:`move`,to:e.to}}}function AN(e){return{...ON(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>kN(e)),operation:`batch`}}function jN(e){switch(e.operation){case`add`:case`remove`:case`move`:return kN(e);case`batch`:return AN(e);default:return null}}function MN(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function NN(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 PN(e){return NN(e).at(-1)??null}function FN(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function IN(e){return e.endsWith(`/`)}var LN=e=>e.toLowerCase();function RN(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function zN(e){return e.endsWith(`/`)?e.slice(0,-1):e}function BN(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var VN=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},HN=Symbol(`FILE_TREE_RENAME_VIEW`),UN=512,WN=512;function GN(e){return e===`top`||e===`center`?e:`nearest`}function KN(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=NN(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 qN(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:KN(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var JN=class e{static{Object.defineProperty(e.prototype,HN,{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=CN({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=PN(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:GN(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<=WN){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=gN(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=vN(t.draggedPaths,n);(yN(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}_N(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=vN(e.draggedPaths,t);if(yN(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=xN(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=IN(r),a=zN(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of NN(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=RN(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,IN(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,IN(e)?{recursive:!0}:void 0);return}let t=IN(e),n=fN({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:zN(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(BN(n.sourcePath,t),BN(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=CN({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=!MN(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=PN(e),n=FN(e,t),r=null,i=null;for(let e of this.#be()){if(PN(e)!==t)continue;let a=FN(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=NN(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=!MN(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 qM({...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 NN(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(LN),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(LN),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 NN(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:VN(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 NN(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 NN(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=qN(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,UN)),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=DN(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=DN(this.#c,e,!0),r=[...this.#B].map(t=>DN(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=DN(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return MN(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&&wN(e)&&(this.#i=null);let t=wN(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=jN(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},YN=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 XN(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 ZN(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 QN(e,t){return t?`${e}/`:e}function $N(e,t=null){let n=YN(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=tP(t);e!=null&&iP({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 eP(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=nP(e);t!=null&&(c=rP({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,statusByPath:i})||c)}for(let e of r){let t=tP(e);t!=null&&(c=iP({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:sP(i),statusByPath:i}:e}function tP(e){return nP(e.path)}function nP(e){let t=XN(e);if(t!=null)return{canonicalPath:QN(t.path,t.isDirectory),isDirectory:t.isDirectory}}function rP({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),oP(t,n,e),!0)}function iP({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,isDirectory:i,status:a,statusByPath:o}){let s=o.get(e);return s!==a&&(s??aP(t,n,e),o.set(e,a),a===`ignored`&&i?r.add(e):i&&r.delete(e),!0)}function aP(e,t,n){for(let r of ZN(n))e.set(r,(e.get(r)??0)+1),t.add(r)}function oP(e,t,n){for(let r of ZN(n)){let n=(e.get(r)??0)-1;n>0?e.set(r,n):(e.delete(r),t.delete(r))}}function sP(e){let t=`${e.size}`;for(let[n,r]of e)t+=`\0${n}\0${r}`;return t}var X,cP,lP,uP,dP,fP,pP,mP,hP,gP,_P={},vP=[],yP=Array.isArray,bP=vP.slice,xP=Object.assign;function SP(e){e&&e.parentNode&&e.remove()}function CP(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?bP.call(arguments,2):n),wP(e,o,r,i,null)}function wP(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??++cP,__i:-1,__u:0};return i==null&&X.vnode!=null&&X.vnode(a),a}function TP(e){return e.children}function EP(e,t){this.props=e,this.context=t,this.__g=0}function DP(e,t){if(t==null)return e.__?DP(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`?DP(e):null}function OP(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 OP(e)}}function kP(e){(8&e.__g||!(e.__g|=8)||!lP.push(e)||dP++)&&uP==X.debounceRendering||((uP=X.debounceRendering)||queueMicrotask)(AP)}function AP(){for(var e,t,n,r,i,a,o,s,c=1;lP.length;)lP.length>c&&lP.sort(fP),e=lP.shift(),c=lP.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=xP({},r)).__v=r.__v+1,X.vnode&&X.vnode(n),RP(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??DP(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,BP(a,n,o),n.__e!=i&&OP(n)));dP=0}function jP(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||vP,b=t.length;for(c=MP(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?_P:y[m.__i]||_P,m.__i=f,_=RP(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&UP(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=NP(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function MP(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?wP(null,o,null,null,null):yP(o)?wP(TP,{children:o},null,null,null):o.constructor==null&&o.__b>0?wP(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=PP(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=DP(s)),WP(s,s));return r}function NP(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=NP(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=DP(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function PP(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 FP(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function IP(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||FP(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||FP(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(pP,`$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=mP,e.addEventListener(t,a?gP:hP,a)):e.removeEventListener(t,a?gP:hP,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 LP(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=mP++;else if(t.u<n.l)return;return n(X.event?X.event(t):t)}}}function RP(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 EP(v,x),f.constructor=M,f.render=GP),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=xP({},f.__s)),xP(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=xP({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===TP&&d.key==null&&(E=VP(d.props.children)),s=jP(e,yP(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--;)SP(a[j]);zP(t)}}else t.__e=n.__e,t.__k=n.__k,e.then||zP(t);X.__e(e,t,n)}else s=t.__e=HP(n.__e,t,n,r,i,a,o,c,l,u);return(d=X.diffed)&&d(t),128&t.__u?void 0:s}function zP(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(zP)}function BP(e,t,n){for(var r=0;r<n.length;r++)UP(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 VP(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:yP(e)?e.map(VP):xP({},e)}function HP(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&&=bP.call(e.childNodes),v=n.props||_P,!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;IP(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&&!_||IP(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=``),jP(b==`template`?e.content:e,yP(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&DP(n,0),s,c,l),a!=null)for(u=a.length;u--;)SP(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||IP(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&IP(e,u,g,v[u],i))}return e}function UP(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 WP(e,t,n){var r,i;if(X.unmount&&X.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||UP(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]&&WP(r[i],t,n||typeof e.type!=`function`);n||SP(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function GP(e,t,n){return this.constructor(e,n)}function KP(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=CP(TP,null,[e]),i=[],a=[],RP(t,e,r||_P,_P,t.namespaceURI,r?null:t.firstChild?bP.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),BP(i,e,a)}function qP(e,t){e.__u|=32,KP(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 dP=0,e}},cP=0,EP.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=xP({},this.state);typeof e==`function`&&(e=e(xP({},n),this.props)),e&&xP(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),kP(this))},EP.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),kP(this))},EP.prototype.render=TP,lP=[],dP=0,fP=function(e,t){return e.__v.__b-t.__v.__b},pP=/(PointerCapture)$|Capture$/i,mP=0,hP=LP(!1),gP=LP(!0);var JP=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:--JP,__i:-1,__u:0,__source:i,__self:a};return X.vnode&&X.vnode(l),l}var YP=16,XP=16,ZP={};function QP({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}=ZP[e]??{width:YP,height:XP},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 $P=e=>e!==void 0&&/\s/.test(e),eF=(e,t)=>{let n=t=>$P(e[t-1])||$P(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},tF=e=>eF(e,Math.ceil(e.length/2)),nF=e=>{if(e.length<2)return[e,``];let t=tF(e);return[e.slice(0,t),e.slice(t)]},rF=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:tF(e);return[e.slice(0,r),e.slice(r)]},iF=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)]},aF=(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)]},oF=(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)]},sF=(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 cF({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 lF(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 uF({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=Z(lF,{mode:t,children:e},`content`),o=Z(cF,{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 dF({children:e,...t}){"use no memo";return Z(uF,{mode:`truncate`,...t,children:e})}function fF({children:e,...t}){"use no memo";return Z(uF,{mode:`fruncate`,...t,children:e})}function pF({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(dF,{...s,children:t[0]}),l=Z(fF,{...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`?fF:dF,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=nF:r===`extension`?t=rF:r===`leaf-path`&&(t=iF);else if(typeof r==`number`)t=aF,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=oF:e===`first`&&(t=sF)}else typeof r==`function`&&(t=r);t??=nF;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(dF,{...s,..._,children:f}),l=Z(fF,{...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 mF={endIndex:-1,startIndex:-1};function hF(e,t,n){return Math.min(Math.max(e,t),n)}function gF(e,t){return e<0||t<e?mF:{endIndex:t,startIndex:e}}function _F(e){return e.startIndex<0||e.endIndex<e.startIndex}function vF(e,t){return _F(e)?0:(e.endIndex-e.startIndex+1)*t}function yF(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function bF(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function xF(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 SF(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 CF(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 wF(e,t,n){if(e.length===0||t<=0)return[];let r=CF(e),i=xF(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=SF(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 TF(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=hF(t.scrollTop,0,o),c=t.stickyRows??wF(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=yF(s,n,t.itemHeight),m=yF(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?mF:gF(m,bF(u+d,n,t.itemHeight)),y=g+1,b=_F(v)?mF:gF(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=vF(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:_F(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var EF={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},DF={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},OF=`Contains git status items`;function kF(e){return e.current?!0:(e.current=!0,!1)}function AF(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 jF(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return AF({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 MF(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 NF(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 PF(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 FF(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function IF(e,t){return e!=null&&e>0?e:t}function LF(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 RF(e,t,n,r,i=0){let a=AF({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a!=null&&(e.scrollTop=a,!0)}function zF(e,t,n,r,i,a,o=0){let s=jF({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s!=null&&(e.scrollTop=s,!0)}function BF(e,t,n,r,i,a){let o=MF({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o!=null&&(e.scrollTop=o,!0)}function VF(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function HF(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function UF({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 WF(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 GF(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 KF,qF,JF,YF,XF=Object.is,ZF=0,QF=[],$F=X,eI=$F.__b,tI=$F.__r,nI=$F.diffed,rI=$F.__c,iI=$F.unmount,aI=$F.__;function oI(e,t){$F.__h&&$F.__h(qF,e,ZF||t),ZF=0;var n=qF.__H||(qF.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function sI(e){return ZF=1,cI(yI,e)}function cI(e,t,n){var r=oI(KF++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):yI(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);XF(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=qF,!qF.__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,XF(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};qF.__f=!0;var a=qF.shouldComponentUpdate,o=qF.componentWillUpdate;qF.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)},qF.shouldComponentUpdate=i}return r.__N||r.__}function lI(e,t){var n=oI(KF++,3);!$F.__s&&vI(n.__H,t)&&(n.__=e,n.u=t,qF.__H.__h.push(n))}function uI(e,t){var n=oI(KF++,4);!$F.__s&&vI(n.__H,t)&&(n.__=e,n.u=t,qF.__h.push(n))}function Q(e){return ZF=5,dI(function(){return{current:e}},[])}function dI(e,t){var n=oI(KF++,7);return vI(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function fI(e,t){return ZF=8,dI(function(){return e},t)}function pI(){for(var e;e=QF.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(gI),e.__H.__h.forEach(_I),e.__H.__h=[]}catch(t){e.__H.__h=[],$F.__e(t,e.__v)}}$F.__b=function(e){qF=null,eI&&eI(e)},$F.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),aI&&aI(e,t)},$F.__r=function(e){tI&&tI(e),KF=0;var t=(qF=e.__c).__H;t&&(JF===qF?(t.__h=[],qF.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(gI),t.__h.forEach(_I),t.__h=[],KF=0)),JF=qF},$F.diffed=function(e){nI&&nI(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(QF.push(t)!==1&&YF===$F.requestAnimationFrame||((YF=$F.requestAnimationFrame)||hI)(pI)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),JF=qF=null},$F.__c=function(e,t){t.some(function(e){try{e.__h.forEach(gI),e.__h=e.__h.filter(function(e){return!e.__||_I(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],$F.__e(n,e.__v)}}),rI&&rI(e,t)},$F.unmount=function(e){iI&&iI(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{gI(e)}catch(e){t=e}}),n.__H=void 0,t&&$F.__e(t,n.__v))};var mI=typeof requestAnimationFrame==`function`;function hI(e){var t,n=function(){clearTimeout(r),mI&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);mI&&(t=requestAnimationFrame(n))}function gI(e){var t=qF,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),qF=t}function _I(e){var t=qF;e.__c=e.__(),qF=t}function vI(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!XF(t,e[n])})}function yI(e,t){return typeof t==`function`?t(e):t}function bI(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(TP,{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(dF,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function xI(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function SI(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function CI(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 wI({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=TF(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:CI(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?CI(u,1,t,o):i&&r<=0&&c.length>0?wF(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 TI=400,EI=40,DI=18;function OI(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))?kI(e,t,n):a instanceof HTMLElement?a:null}function kI(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 AI(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 jI(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 MI(){return navigator.vendor!==`Apple Computer, Inc.`}function NI(e,t){let n=e-t.top;if(n<EI)return-Math.ceil((EI-Math.max(0,n))/EI*DI);let r=t.bottom-e;return r<EI?Math.ceil((EI-Math.max(0,r))/EI*DI):0}function PI(e,t){if(e!=null){let t=EF[e];return t==null?null:{text:t,title:DF[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:OF}:null}function FI(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 II(e){return e!=null&&`toggle`in e}function LI(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function RI(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function zI(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function BI(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function VI(e,t){return t&&BI(e)||(e.ctrlKey||e.metaKey)&&LI(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var HI=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function UI(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 WI(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 GI(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function KI(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function qI(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function JI(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 YI(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 XI(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 ZI(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=XI(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 QI(e,t){return{kind:e.kind,name:SI(e),path:t}}function $I(e){return e==null?void 0:`${e}__tree`}function eL(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function tL(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function nL(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`?tL(e.icon)?t(e.icon):{name:e.icon}:tL(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(QP,{...n})})}function rL(e){e!=null&&NF(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function iL(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=xI(e);return Z(TP,{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(QP,{...t(`file-tree-icon-chevron`)}):Z(QP,{...t(`file-tree-icon-file`,u)})}),Z(`div`,{"data-item-section":`content`,children:e.isFlattened?bI(e,c,a):c??Z(pF,{minimumLength:5,split:`extension`,children:e.name})}),i?Z(`div`,{"data-item-section":`decoration`,children:r==null?null:nL(r,t)}):null,s?Z(`div`,{"data-item-section":`git`,children:nL(o,t)}):null,n?Z(`div`,{"data-item-section":`action`,children:l?Z(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:Z(QP,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function aL(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:ee}=e,N=xI(t),{isParked:te=!1,mode:ne=`flow`,style:re}=r,ie=ne===`sticky`,ae=_?.get(N)??null??FI(t.ancestorPaths,v,y),oe=t.kind===`directory`&&(b?.has(N)??!1),se=A(t,N),ce=PI(ae,oe),le=S&&w,ue=se!=null||x||le,de=le&&T===`always`,fe=a.getPath()===N,pe=fe?a.getValue():``,me=ie||!fe?null:Z(UF,{ref:D,ariaLabel:`Rename ${SI(t)}`,isFlattened:t.isFlattened,value:pe,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),he=iL(t,k,{actionLaneEnabled:le,customDecoration:se,decorationLaneEnabled:ue,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:ce,gitLaneActive:x,renameInput:me,showDecorativeActionAffordance:de}),ge={...WF({ariaLabel:SI(t),domId:t.isFocused?eL(h,N,te):void 0,extraStyle:re,features:{actionLaneEnabled:le,contextMenuButtonVisibility:le?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:te,itemHeight:g,mode:ne,row:t,state:{containsGitChange:oe,effectiveGitStatus:ae,isContextHovered:s===N,isDragTarget:l?.kind===`directory`&&l.directoryPath===N,isDragging:c?.has(N)===!0,isFocusRinged:t.isFocused&&o===N},targetPath:N}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),E&&(i.focusMountedPathFromInput(N),j(t,N,{anchorRect:GI(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:ie?void 0:()=>{i.focusMountedPathFromInput(N)},onKeyDown:ie?void 0:ee,ref:e=>{O(N,e)}};return!ie&&fe?Z(`div`,{...ge,children:he}):Z(`button`,{...ge,type:`button`,draggable:u&&!te,onDragEnd:u&&!te?p:void 0,onDragStart:u&&!te?e=>{f(e,t,N)}:void 0,onMouseDown:e=>{if(ie){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!te?e=>{m(e,t,N)}:void 0,onClick:e=>{M(e,t,N,ne)},children:he})}function oL(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(xI(e))).map((n,r)=>aL(e,n,t.start+r))}function sL({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=ZM,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),ee=Q(null),N=Q(null),te=Q(!1),ne=Q(null),re=Q(null),ie=Q(null),ae=Q(null),oe=Q(null),se=Q(null),ce=Q(null),le=Q(null),ue=Q(!1),de=Q(null),fe=Q(null),pe=Q(null),me=Q(null),he=dI(()=>new Map,[]),[,ge]=sI(0),_e=Q(!1),[ve,ye]=sI(null),[be,xe]=sI(null),[Se,Ce]=sI(null),[we,Te]=sI(null),[Ee,De]=sI(0),[P,Oe]=sI(null),ke=Q(P);ke.current=P;let Ae=Q(null),je=Q(null),Me=Q(null),Ne=Q(null),Pe=Q(null),Fe=Q(!1),Ie=()=>{je.current=null,Me.current=null,Ne.current=null},Le=(e,t)=>{je.current=e,Me.current=null,Ne.current=t==null?null:{path:e,scrollTop:t}},Re=(e,t)=>{je.current=null,Me.current={path:e,viewportOffset:t},Ne.current=null},ze=Q(d===`retain`&&t.isSearchOpen()),[Be,Ve]=sI(p);lI(()=>{p||Ve(!1)},[p]);let He=Q(!1),Ue=fI(()=>{He.current=!0,Ve(e=>e&&!1)},[]),[We,Ge]=sI(()=>wI({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[Ke,qe]=sI(!1);lI(()=>{qe(!0)},[]);let Je=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Ye=e?.contextMenu?.triggerMode??(Je?`right-click`:`both`),Xe=Ye===`both`||Ye===`button`,Ze=e?.contextMenu?.buttonVisibility??`when-needed`,Qe=Ye===`both`||Ye===`right-click`;uI(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;Pe.current=t,xe(t),Te(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(Fe.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 $e=fI((e,t)=>{qI(T.current,e,t)},[]),et=fI((e,t)=>{qI(E.current,e,t)},[]),tt=fI(e=>{x.current=e},[]),nt=fI(e=>JI(e,E.current,T.current),[]),rt=n!=null||r!=null||i!=null,{resolveIcon:it}=dI(()=>gk(a),[a]),at=t[HN](),ot=at.getPath(),st=ot!=null,ct=t.isSearchOpen(),lt=t.getSearchValue(),F=t.getFocusedPath(),I=t.getFocusedIndex(),ut=t.getScrollRequest(),dt=t.isDragAndDropEnabled(),ft=t.getDragSession(),pt=dI(()=>ft==null?null:new Set(ft.draggedPaths),[ft]),mt=ft?.target??null,ht=ft?.primaryPath??null,gt=$I(o),{overlayHeight:_t,overlayRows:vt,snapshot:yt,visibleRows:bt}=We,xt=yt.physical.viewportHeight,St=dI(()=>({end:yt.window.endIndex,start:yt.window.startIndex}),[yt.window.endIndex,yt.window.startIndex]),Ct=vt,wt=yt.sticky.rows,Tt=yt.physical.totalHeight,Et=yt.sticky.height,Dt=dI(()=>new Set(wt.map(e=>xI(e.row))),[wt]),Ot=I>=0&&I>=St.start&&I<=St.end,kt=fI((e,t)=>u?.({item:QI(e,t),row:e})??null,[u]),At=fI(e=>NF(e==null?null:T.current.get(e)??null)?!0:NF(S.current),[]),jt=fI(e=>{At(t.focusNearestPath(e))},[t,At]),Mt=Q(jt);Mt.current=jt;let Nt=Q(!0),Pt=Q(()=>{}),Ft=fI((t=!0)=>{let n=ke.current;n!=null&&(Nt.current=Nt.current&&t,Oe(null),e?.contextMenu?.onClose?.(),Nt.current&&jt(n.path))},[e?.contextMenu,jt]);Pt.current=Ft;let It=fI(e=>{let t=e==null?null:KI(S.current,e);Ce(e=>e===t?e:t)},[]),Lt=fI((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=nt(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;Le(n,e?.scrollTop??null),M.current=!0,ye(e=>e===n?e:n)}i.focus(),It(a),Nt.current=!0,Oe({anchorRect:r?.anchorRect??null,item:QI(e,n),path:n,source:r?.source??`keyboard`})},[t,nt,It]),L=fI(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=FF(e,xt);ne.current=I<0||e==null?null:Math.max(0,Math.min(I*s-e.scrollTop,Math.max(0,t-s))),te.current=!0}t.startRenaming(e)!==!1&&(Te(`focus`),ge(e=>e+1))}},[t,I,s,l,xt]),Rt=fI((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=FF(i,xt),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:wI({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return M.current=!0,BF(i,a,s,l,u,d),D.current(),Ae.current=n?e:null,!0},[t,s,c,xt,h]),zt=()=>y.current===!0||me.current!=null||ue.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=()=>{ae.current!=null&&(clearTimeout(ae.current),ae.current=null),ie.current=null},Ut=()=>{se.current?.remove(),se.current=null},Wt=()=>{Vt(re.current),re.current=null,oe.current=null},Gt=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},Kt=()=>{le.current?.(),le.current=null,me.current!=null&&(clearTimeout(me.current),me.current=null),ue.current=!1,de.current=null,pe.current=null,fe.current!=null&&(fe.current.setAttribute(`draggable`,`true`),fe.current.style.removeProperty(`touch-action`),fe.current=null),Ut(),Ht(),Wt(),ce.current=null},qt=(e,n)=>{let r=S.current?.getRootNode(),i=AI(OI(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=II(r)?r:null;if(i==null||i.isExpanded()){Ht();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;ie.current!==a&&(Ht(),ie.current=a,ae.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind===`directory`&&n.directoryPath===e.directoryPath&&n.flattenedSegmentPath===e.flattenedSegmentPath&&i.expand()},n))},Yt=()=>{re.current=null;let e=oe.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=NI(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)),re.current=Bt(Yt)},Xt=(e,t)=>{oe.current={clientX:e,clientY:t},re.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(ce.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),MI())){let t=jI(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),se.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Qt=()=>{Ut(),Ht(),Wt(),ce.current=null,t.cancelDrag()},$t=(e,n,r)=>{if(me.current!=null||ue.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;pe.current={clientX:i.clientX,clientY:i.clientY},fe.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!ue.current;me.current!=null&&(clearTimeout(me.current),me.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),le.current===o&&(le.current=null),t&&(a.setAttribute(`draggable`,`true`),fe.current===a&&(fe.current=null),pe.current=null)},s=e=>{let t=e.touches[0],n=pe.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),le.current=o,me.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),fe.current===a&&(fe.current=null),pe.current=null;return}ue.current=!0,fe.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),ce.current=n;let e=a.getBoundingClientRect(),s=jI(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),se.current=s,de.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=de.current;n!=null&&se.current!=null&&(se.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()};le.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)},TI)},en=e=>{if(P!=null){if(e.key===`Escape`){Ft(),e.preventDefault(),e.stopPropagation();return}HI.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(at.isActive()){if(e.isComposing||e.keyCode===229)return;if(e.key===`Escape`)at.cancel();else if(e.key===`Enter`)at.commit();else return;Te(`focus`),ge(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){L(F??void 0),e.preventDefault(),e.stopPropagation();return}if(ct){if(e.key===`Escape`)te.current=!1,ne.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=FF(n,xt);ne.current=I<0||n==null?null:Math.max(0,Math.min(I*s-n.scrollTop,Math.max(0,r-s))),te.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;Te(`focus`),ge(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&RI(e)){t.openSearch(e.key),ge(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=Je&&BI(e),r=VI(e,Je),i=r&&S.current!=null?PF(S.current):null,a=r?new Set(YI(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==F&&a.has(o)){let e=C.current;Le(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=II(p)?p:null,h=u!=null&&(Dt.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=JI(u,E.current,T.current);e==null||n==null?y=!1:Lt(e,u)}else if((e.ctrlKey||e.metaKey)&&LI(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;Te(`focus`);let b=t.getFocusedPath(),x=b!=null&&(Dt.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))Le(b,v?.scrollTop??null),M.current=!0,ye(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(Re(b,ZI(S.current,v,i,u,s,Et,xt)),M.current=!0,ye(e=>e===b?e:b)):Ie()}ge(e=>e+1),e.preventDefault(),e.stopPropagation()};uI(()=>{if(!(!f||!ct)){if(ze.current){ze.current=!1;return}NF(w.current)}},[ct,f]),uI(()=>{let e=x.current;switch(HF({hasRenderedInput:e!=null,previousRenamingPath:N.current,renamingPath:ot})){case`reset`:N.current=null;return;case`reveal-canonical`:ot!=null&&Rt(ot,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(Ae.current=null,N.current=ot,NF(e),e.select());return}},[St.end,St.start,ot,Rt,Dt]),uI(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=PF(e)?.dataset.itemPath??null;ye(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,PF(e)!=null){r();return}M.current=!1,ye(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),M.current=!1,ye(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;ye(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),uI(()=>{let e=S.current;e!=null&&(yt.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[yt.physical.scrollTop]),uI(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=FF(n,g);let a=()=>{let e=t.getVisibleCount(),r=IF(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Ge(wI({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=IF(O.current,g),i=t.getVisibleRows(e,e)[0]??null;RF(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(()=>{kF(_e)&&ge(e=>e+1),a()}),l=()=>{Fe.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,De(e=>e+1),e=null},50))},u=null,d=()=>{i!=null&&delete i.dataset.overlayReveal,u!=null&&(clearTimeout(u),u=null)},f=()=>{i!=null&&Fe.current!==!0&&(n.scrollTop>0||(i.dataset.overlayReveal=`true`,u!=null&&clearTimeout(u),u=setTimeout(()=>{d()},200)))},p=()=>{if(a(),n.scrollTop>0&&d(),ke.current!=null&&y.current&&Pt.current(),Fe.current===!0){y.current=!1;return}xe(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:LF(e[0]))??FF(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]),uI(()=>{Je||P==null||Ft(!1)},[Ft,Je,P]);let tn=dI(()=>P==null?null:`${P.path}::${P.source}`,[P]);uI(()=>{if(tn==null){m?.clearSlotContent(ck);return}let t=ke.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??WI(n.getBoundingClientRect()),close:e=>{Pt.current(e?.restoreFocus??!0)},restoreFocus:()=>{Nt.current&&Mt.current(ke.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(ck,i),e?.contextMenu?.onOpen?.(t.item,r),rL(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&rL(i)}),()=>{m?.clearSlotContent(ck)}},[tn,e?.contextMenu,m]),uI(()=>{P!=null&&t.getItem(P.path)==null&&Ft()},[Ft,P,t]),uI(()=>{if(P==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(UI(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&Ft())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Ft())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[Ft,P]),uI(()=>{let e=C.current,n=S.current;if(e==null||n==null){ee.current=F;return}let r=F==null?null:T.current.get(F)??null,i=PF(n),a=i?.dataset.itemPath??null,o=st&&x.current===i,c=f&&w.current===i,l=te.current&&!ct,u=ne.current??0,d=Ae.current,p=je.current,m=Me.current,g=Ne.current,_=i!=null,v=M.current||_,y=ee.current!==F,b=p!=null&&p===F&&F!=null,E=!1,O=!1;if(ut!=null&&ut.id!==k.current){k.current=ut.id;let n=ut.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,xt-s))):Et;E=!0,O=zF(e,n,s,xt,Tt,ut.offset,t)}t.clearScrollRequest(ut.id)}let A=!E&&l&&BF(e,I,s,xt,Tt,u),j=!E&&d!=null&&d===F&&BF(e,I,s,xt,Tt,Et),N=!E&&m!=null&&m.path===F&&BF(e,I,s,xt,Tt,m.viewportOffset),re=!E&&g!=null&&g.path===F&&e.scrollTop!==g.scrollTop;if(re&&(e.scrollTop=g.scrollTop),(re||O||j||N||A||v&&y&&d!==F&&!b&&RF(e,I,s,xt,Et))&&D.current(),E){ee.current=F;return}if(!v){ee.current=F;return}if(o){ee.current=F;return}if(c&&!l){ee.current=F;return}if(r==null){l&&I>=0&&(BF(e,I,s,xt,Tt,u),D.current()),ee.current=F;return}(y||l||d===F||p===F||m?.path===F||g?.path===F||a==null||a!==F)&&(NF(r),d===F&&(Ae.current=null),p===F&&(je.current=null),m?.path===F&&(Me.current=null),g?.path===F&&(Ne.current=null),te.current=!1,ne.current=null),ee.current=F},[t,I,F,Ot,s,st,ct,St,xt,f,ut,h,Et,Tt,bt]);let nn=I>=0&&I>=yt.visible.startIndex&&I<=yt.visible.endIndex,rn=F!=null&&Ct.some(e=>xI(e.row)===F),an=nn||rn,on=Xe&&M.current===!0&&an?F:null,sn=we===`pointer`?be:null,cn=P?.path??Pe.current??sn??on??be,ln=P?.source===`right-click`;uI(()=>{y.current&&P==null||It(nt(cn))},[P,nt,St,xt,Ee,Ct,cn,It,bt]);let un=fI(e=>{if(y.current||UI(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&&Te(e=>e===`pointer`?e:`pointer`),xe(e=>e===i?e:i)},[]),dn=fI(()=>{xe(null)},[]);uI(()=>{if(!dt)return;let e=()=>{Kt(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),Kt(),t.cancelDrag()}},[t,dt]);let R=e=>{if(!dt||t.getDragSession()==null||ue.current)return;let n=AI(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(!dt||t.getDragSession()==null||ue.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Ht(),Wt(),t.setDragTarget(null))},pn=e=>{!dt||t.getDragSession()==null||ue.current||(e.preventDefault(),qt(e.clientX,e.clientY),t.completeDrag(),Ut(),Ht(),Wt(),ce.current=null)},mn=yt.window.height,hn=yt.window.offsetTop,gn=Math.min(0,xt-mn),_n=Math.min(0,xt-mn-Et),vn=ve===F||te.current,yn=F!=null&&vn&&!Ot&&I>=0?bt[I]??t.getVisibleRows(I,I)[0]??null:null,bn=yn==null?null:VF(I,s,St,mn),xn=ce.current,Sn=ht!=null&&xn!=null&&xn.path===ht&&xn.index>=St.start&&xn.index<=St.end,Cn=ht!=null&&xn!=null&&xn.path===ht&&!Sn&&xn.path!==yn?.path?xn:null,wn=Cn==null?null:VF(Cn.index,s,St,mn),Tn=zI((I>=0?bt[I]??t.getVisibleRows(I,I)[0]??null:null)?.ancestorPaths.at(-1)??null),En=ct&&F!=null?eL(o,F,!Ot):void 0,z=P?.path??(ct?F:ve),Dn=P?.path??be,On=nt(cn),B=Je&&Xe&&!ln&&!st&&On!=null&&Se!=null&&cn!=null,V=Je&&(B||P!=null),kn=P?.anchorRect,An=kn==null&&On!=null&&Se!=null&&(P!=null||B)?Se:null,jn=kn==null?An==null?void 0:{top:`${An}px`}:{left:`${kn.left}px`,position:`fixed`,right:`auto`,top:`${kn.top}px`},Mn=ln?{opacity:`0`}:void 0,Nn=fI((e,n,r,i)=>{let a=GF({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:ct,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>=yt.visible.startIndex&&n.index<=yt.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(M.current=!0,ye(e=>e===c?e:c),Te(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&Rt(c,{targetOffset:`sticky-parents`})},[t,ct,yt.visible.endIndex,yt.visible.startIndex,Rt]),Pn=()=>{if(y.current||!Xe||cn==null||On==null)return;let e=t.getItem(cn);e!=null&&(It(On),Nt.current=!0,Oe({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:On.getAttribute(`aria-label`)??cn,path:e.getPath()},path:e.getPath(),source:`button`}))},Fn={contextHoverPath:Dn,contextMenuButtonTriggerEnabled:Xe,contextMenuButtonVisibility:Ze,contextMenuEnabled:Je,contextMenuRightClickEnabled:Qe,contextMenuTriggerMode:Ye,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:dt,draggedPathSet:pt,dragTarget:mt,gitLaneActive:rt,gitStatusByPath:n,handleRowDragEnd:Qt,handleRowDragStart:Zt,handleRowTouchStart:$t,ignoredGitDirectories:r,ignoredInheritanceCache:he,instanceId:o,itemHeight:s,onKeyDown:en,onRowClick:Nn,openContextMenuForRow:Lt,registerButton:$e,registerRenameInput:tt,renameView:at,renderDecorationForRow:kt,resolveIcon:it,shouldSuppressContextMenu:zt,visualFocusPath:z},In={...Fn,registerButton:et};return Z(`div`,{ref:S,id:gt,"data-file-tree-context-menu-button-visibility":Je&&Xe?Ze:void 0,"data-file-tree-context-menu-trigger-mode":Je?Ye:void 0,"data-file-tree-has-context-menu-action-lane":Je&&Xe?`true`:void 0,"data-file-tree-has-git-lane":rt?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:dt?fn:void 0,onDragOver:dt?R:void 0,onDrop:dt?pn:void 0,onKeyDown:en,onPointerLeave:Je?dn:void 0,onPointerOver:Je?un: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:sk,"data-type":`header-slot`}),f?Z(`div`,{"data-file-tree-search-container":!0,"data-open":ct?`true`:`false`,children:Z(`input`,{ref:w,"aria-activedescendant":En,"aria-controls":gt,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Be?`true`:void 0,value:lt,onBlur:()=>{d===`retain`&&!He.current||t.closeSearch()},onFocus:Ue,onPointerDown:Ue,onInput:e=>{Ue();let n=e.currentTarget;t.setSearch(n.value)}})}):null,Z(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&Ke&&Ct.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:`${_t}px`},children:Ct.map((e,t)=>aL(In,e.row,`sticky:${xI(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${Ct.length-t}`}}))})}):null,Z(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${Tt}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:[oL(Fn,St,Dt),yn!=null&&bn!=null?aL(Fn,yn,`parked:${yn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:ht===yn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${bn}px`}}):null,Cn!=null&&wn!=null?aL(Fn,Cn,`parked-drag:${Cn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${wn}px`}}):null]})]})]}),Je?Z(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":V?`true`:`false`,style:jn,children:[Z(`button`,{ref:v,type:`button`,"data-type":lk,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":P==null?`false`:`true`,"data-visible":B?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),P!=null){Ft();return}Pn()},tabIndex:-1,style:Mn,children:Z(QP,{...it(`file-tree-icon-ellipsis`)})}),P==null?null:Z(`slot`,{name:ck})]}):null,P==null?null:Z(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),Ft()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),Ft()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var cL={hydrateRoot:(e,t)=>{qP(CP(sL,t),e)},renderRoot:(e,t)=>{KP(CP(sL,t),e)},unmountRoot:e=>{KP(null,e)}};function lL(e,t){cL.renderRoot(e,t)}function uL(e,t){cL.hydrateRoot(e,t)}function dL(e){cL.unmountRoot(e)}var fL=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 pL(e,t,n){if(!e.s){if(n instanceof mL){if(!n.s)return void(n.o=pL.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(pL.bind(null,e,t),pL.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}var mL=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{pL(r,1,a(this.v))}catch(e){pL(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?pL(r,1,t?t(i):i):n?pL(r,1,n(i)):pL(r,2,i)}catch(e){pL(r,2,e)}},r},e}();Array.isArray;var hL=0;function gL(e){return e!=null&&e.length>0?e:(hL+=1,`pst_ft_${hL}`)}function _L({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??ZM)}function vL(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 yL(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 bL(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var xL=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new fL;#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=gL(a),this.#p=$N(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=XM(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new JN({...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&&(dL(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=eP(this.#p,e);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&lL(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(),lL(t.wrapper,this.#w()))}setGitStatus(e){let t=$N(e,this.#p);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&lL(n.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),lL(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),uL(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),lL(r,this.#w())}#C(){return{initialViewportHeight:_L({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(sk,e());return}this.#l.setSlotHtml(sk,this.#e?.header?.html??null)}#k(e){let t=bL(e).find(e=>yL(e)),n=vL(ZO(dk(this.#m).set));n!=null&&(t==null||t.outerHTML!==n.outerHTML)&&(t==null?e.prepend(n):t.replaceWith(n))}#A(e){let t=bL(e),n=t.find(e=>yL(e)),r=t.filter(e=>e!==n),i=dk(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=vL(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=dk(this.#m);t.colored&&$O(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${rk}]`);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(rk,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=tN(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 sN(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)}},SL=`_jq _n`,CL=`<div><input type=search placeholder="Filter files…" aria-label="Filter files"></div>`,wL=` D l`,TL=s(18,e=>y(e,`b`,e.l,VL(e))),EL=j(11,TL),DL=s(10,e=>EL(e,(e.j??e.h)||``)),OL=j(17,TL),kL=s(16,e=>OL(e,HL(e))),AL=j(15,kL),jL=s(14,e=>AL(e,UL(e)),2),ML=u(7,e=>{DL(e),jL(e)}),NL=s(6,e=>ML(e,e.e,e.f)),PL=j(4,NL),FL=j(5,NL),IL=l(9,e=>{DL(e),jL(e)}),LL=(e,t)=>BL(e,t.timer),RL=r(`l3`,e=>{T(e,`b`),o(e.b,`keydown`,function(t){t.key===`Enter`&&e.p(),t.key===`Escape`&&e.l&&(t.preventDefault(),e.r(``))})});function zL(e){_(e.a,`_jp`),_(e.b,SL),IL(e,null),LL(e,{timer:0}),RL(e)}var BL=j(13,e=>{jL(e),kL(e)}),VL=e=>function(t){e.r(t)},HL=e=>t=>{if(e.n&&clearTimeout(e.n),!t){e.n=0,IL(e,null),ML(e,``);return}IL(e,t),e.n=setTimeout(e.p,150)},UL=e=>()=>{e.n&&=(clearTimeout(e.n),0);let t=e.j===null?e.h||``:e.j;IL(e,null),ML(e,t)};d(`l0`,VL),d(`l2`,HL),d(`l1`,UL);var WL=(e=>`<div><div title="Drag to resize"></div><div>${e}</div><div></div></div>`)(CL),GL=(e=>` D b D/${e}&l l`)(wL),KL={A:`added`,D:`deleted`,M:`modified`,R:`renamed`},qL=s(7,e=>{S(e.a,`aria-expanded`,e._._.t.has(e._.f)?`false`:`true`),_(e.b,[`_ip`,{_iq:!e._._.t.has(e._.f)}])}),JL=A(29,qL,e=>e._._),YL=r(`z4`,e=>o(e.a,`click`,function(){let t=new Set(e._._.t);t.delete(e._.f)||t.add(e._.f),gR(e._._,t)})),XL=e=>{JL(e),ZL._(e),QL._(e),$L._(e),_(e.a,`_io`),oe(e.c),De(e.c,12),yt(e.c),_(e.d,`_ir`),_(e.f,`_is`),YL(e)},ZL=c(1,0,qL),QL=c(1,0,e=>{S(e.a,`title`,e._.h),m(e.e,e._.h)}),$L=c(1,0,e=>m(e.g,e._.j)),eR=C(1,(e=>`<button type=button><span aria-hidden=true>${e}</span><span> </span><span> </span></button>`)(ae),(e=>` D D/${e}&l D l D m`)(be),XL),tR=f(4,e=>{_(e.a,[`_in`,{_im:e._.m===1}]),_(e.c,[`_iu`,{_it:e._.m===1}]),eR(e,e._.m>1?0:1)}),nR=e=>{tR._(e),iR._(e)},rR=s(6,e=>S(e.c,`hidden`,e._.t.has(e.f))),iR=f(4,rR),aR=j(5,e=>{S(e.a,`data-section`,e.f),S(e.c,`data-tree`,e.f),rR(e),ZL(e)}),oR=(e,t)=>{aR(e,t[0]?.id),sR(e,t[0]?.label),cR(e,t[0]?.files?.length)},sR=j(7,QL),cR=j(9,$L),lR=r(`z5`,e=>a(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:KL[e.status]??`modified`})),r=e=>e.files.map(e=>`${e.path}:${e.status}`).join(`
2797
+ `),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 xL({paths:i.files.map(e=>e.path),gitStatus:n(i),initialExpansion:`open`,flattenEmptyDirectories:!0,search:!1,fileTreeSearchMode:`hide-non-matches`,initialSearchQuery:e.q||null,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),shownFilter:e.q||``}},onUpdate:function(){let e=(this.filter||``)!==this.shownFilter;this.shownFilter=this.filter||``;let t=this.marks(this.commentCounts,this.newKeys),n=t!==this.shownMarks;this.shownMarks=t;let r=new Set(this.sections.map(e=>e.id));for(let[e,t]of this.trees)r.has(e)||(t.unsub(),t.tree.cleanUp(),this.trees.delete(e));for(let t of this.sections){let r=this.trees.get(t.id);if(!r){this.build(t);continue}e&&r.tree.setSearch(this.shownFilter||null);let i=this.sig(t);i===r.sig?n&&r.tree.setGitStatus(this.gitStatus(t)):(r.sig=i,r.tree.resetPaths(t.files.map(e=>e.path)),r.tree.setGitStatus(this.gitStatus(t)))}},onDestroy:function(){for(let e of this.trees.values())e.unsub(),e.tree.cleanUp()}})),uR=s(18,lR,4),dR=u(16,e=>{PL(e.d,e.q),uR(e)}),fR=s(9,e=>dR(e,e.h,e.i)),pR=j(7,fR),mR=j(8,fR),hR=g(JL),gR=l(19,e=>{iR(e),hR(e)}),_R=j(27),vR=s(24,e=>_R(e,PR(e))),yR=l(20,e=>{x(e.a,e.u==null?void 0:`--tree-w:${e.u}px`),vR(e)}),bR=l(21,e=>_(e.b,[`_iw`,{_iv:e.v}])),xR=(e,t)=>ER(e,t.id),SR=r(`z6`,e=>{o(e.b,`pointerdown`,function(t){e.z(t)}),o(e.b,`pointermove`,function(t){e.a0(t)}),o(e.b,`pointerup`,function(t){e.a1(t)}),o(e.b,`pointercancel`,function(t){e.a1(t)})});function CR(e){_(e.c,`_ik`),zL(e.d),FL(e.d,FR(e)),_(e.e,`_il`),gR(e,new Set),yR(e,le()),bR(e,!1),xR(e,{id:-1}),SR(e)}var wR=j(25),TR=j(26),ER=j(23,e=>{wR(e,IR(e)),TR(e,LR(e)),vR(e)}),DR=(e,t)=>_(e.a,[`_ij`,{_ii:t===!1}]),OR=i(4,`<div><!><div></div></div>`,` D%b `,nR,oR),kR=j(11,e=>{NR(e,e.l?.length),OR(e,[e.l,`id`]),uR(e)}),AR=j(13,uR),jR=j(14,uR),MR=j(15,uR),NR=j(12,tR),PR=e=>t=>{t.pointerId===e.x&&(e.x=-1,bR(e,!1),e.u!=null&&Me(e.u))},FR=e=>t=>{dR(e,t)},IR=e=>t=>{(t.pointerType!==`mouse`||t.button===0)&&(t.preventDefault(),e.x=t.pointerId,bR(e,!0),e.b.setPointerCapture(t.pointerId))},LR=e=>t=>{if(t.pointerId!==e.x)return;let n=window.innerWidth-t.clientX;yR(e,Math.min(640,Math.max(200,n)))};d(`z2`,PR),d(`z3`,FR),d(`z0`,IR),d(`z1`,LR);var RR=`_jj _ba`,zR=tt,BR=(e=>`/${e}&`)(qe);function VR(e){We(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 HR=(e,t)=>st(e.a,t),UR=(e,t)=>He(e.a,t),WR=`<!><!><!>`,GR=e=>_(e.a,`_jm`),KR=e=>{VR(e.a),HR(e.a,12),UR(e.a,`_jo`)},qR=e=>_(e.a,[`_A`,`_jn`]),JR=c(1,0,e=>{S(e.a,`title`,e._.f),m(e.b,e._.f)}),YR=e=>{JR._(e),_(e.a,RR)},XR=C(6,zR,(e=>`/${e}&`)(BR),KR),ZR=s(11,e=>XR(e,+!e._._._._.w.has(e.k))),QR=A(29,ZR,e=>e._._._._),$R=r(`i2`,e=>o(e.a,`click`,function(){jz(e._._._._,!1)})),ez=e=>{QR(e),rz(e),az(e),_(e.a,[`_ji`,`_y`]),_(e.b,`__`),_(e.d,`_jk`),$R(e)},tz=C(5,`<span title="Changed since your last visit"></span>`,` `,qR),nz=s(12,e=>tz(e,+!e._._._._.x.has(e.k))),rz=A(30,nz,e=>e._._._._),iz=s(13,e=>S(e.a,`href`,e._._._._.z(e.k))),az=A(32,iz,e=>e._._._._),oz=j(10,e=>{iz(e),nz(e),ZR(e)}),sz=(e,t)=>{S(e.b,`data-status`,t),m(e.c,t)},cz=(e,t)=>m(e.e,t),lz=(e,t)=>{oz(e,(t?.[0]).file?.key),sz(e,(t?.[0]).file?.status),cz(e,(t?.[0]).name)},uz=e=>_(e.a,`_jh`),dz=C(1,`<div><bdi><!>/</bdi></div>`,` E%`,YR),fz=j(5,e=>{dz(e,+!e.f),JR(e)}),pz=i(2,`<a><span> </span><span><bdi> </bdi></span><!><!></a>`,` D D l E m%b%`,ez,lz),mz=(e,t)=>pz(e,[t,e=>e.file.key]),hz=(e,t)=>{fz(e,(t?.[0]).dir),mz(e,(t?.[0]).files)},gz=e=>{_(e.a,`_jf`),_(e.b,`_jg`)},_z=(e,t)=>m(e.c,t),vz=i(3,`<div><!><!></div>`,` D%b%`,uz,hz),yz=(e,t)=>vz(e,[t,`dir`]),bz=(e,t)=>{_z(e,t[0]?.repo),yz(e,t[0]?.dirs)},xz=C(13,`<p>No files match.</p>`,` `,GR),Sz=s(14,e=>m(e.g,e._.n===e._.y?``:` / ${e._.y}`)),Cz=c(0,0,e=>{m(e.f,e._.n),xz(e,+!!e._.n),Sz(e)}),wz=r(`i3`,e=>{o(e.a,`click`,function(){jz(e._,!1)}),o(e.h,`click`,function(){jz(e._,!1)})}),Tz=e=>{Cz._(e),Ez._(e),Dz._(e),kz._(e),_(e.a,`_ja`),_(e.b,`_jb`),_(e.c,`_jc`),_(e.d,`_i_`),_(e.e,`_jd`),_(e.h,[bt,`_i9`]),Ve(e.i),ft(e.i,16),at(e.i),_(e.j,`_jl`),zL(e.k),FL(e.k,$z(e)),_(e.l,`_je`),wz(e)},Ez=c(0,0,e=>PL(e.k,e._.u)),Dz=c(0,0,Sz),Oz=i(12,`<div><div> </div><!></div>`,` D D l%`,gz,bz),kz=c(0,0,e=>Oz(e,[e._.a0,`repo`])),Az=C(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>`)($e,CL),((e,t)=>` b D D b D%b%l D/${e}&m D/${t}&l D%b%m`)(gt,wL),Tz),jz=u(18,e=>Az(e,+!e.s)),Mz=s(5,e=>jz(e,e.d,e.e)),Nz=j(3,Mz),Pz=j(4,Mz),Fz=u(20,Ez),Iz=s(8,e=>Fz(e,e.g,e.h)),Lz=j(6,Iz),Rz=j(7,Iz),zz=j(22,g(QR)),Bz=(e,t)=>zz(e,t||new Set),Vz=j(23,g(rz)),Hz=(e,t)=>Vz(e,t||new Set),Uz=j(24,Dz),Wz=s(14,e=>Uz(e,e.l??e.n)),Gz=j(11,Wz),Kz=j(13,e=>{Wz(e),Cz(e)}),qz=j(25,g(az)),Jz=s(17,e=>qz(e,eB(e))),Yz=j(15,Jz),Xz=j(16,Jz),Zz=j(26,kz),Qz=(e,t)=>{Kz(e,t?.length),Zz(e,(()=>{let e=[],n=new Map;for(let r of t){let t=r.key.indexOf(`/`),i=r.key.slice(0,t),a=r.key.slice(t+1),o=a.lastIndexOf(`/`),s=o<0?``:a.slice(0,o),c=o<0?a:a.slice(o+1),l=n.get(i);l||(n.set(i,l=new Map),e.push({repo:i,dirs:[]}));let u=l.get(s);u||(l.set(s,u={dir:s,files:[]}),e[e.length-1].dirs.push(u)),u.files.push({file:r,name:c})}return e})())},$z=e=>t=>{Fz(e._,t)},eB=e=>t=>he({workspaceId:e.p,view:`diff`,scope:e.q??null,file:t});d(`i1`,$z),d(`i0`,eB);var tB=((e,t,n,r,i)=>`<div><div><div><div><div><!><h1>Review</h1><!></div><div><!><button title="Refresh diff">${e}</button><!><span><select aria-label=Compare><option value=committed>Committed</option><option value=working>Working tree</option><option value=dirty>Uncommitted</option><!></select></span> <div>${t}</div><!></div>${n}</div><div><!><!><!><!></div></div><div data-diff-main></div></div>${r}${i}</div>`)(ce,ZS,$T,WL,WR),nB=((e,t,n,r,i)=>` D D D D D%b b%l D%b D/${e}&l%b D Dd%mb D0${t}&l%l/${n}&l D%b%b%b%m l/${r}&/${i}&l`)(Oe,QS,`b%c`,GL,`b%c`);function rB(e){return e.split(`
2798
2798
  `).filter(e=>e[0]===`+`||e[0]===`-`).join(`
2799
- `)}var _R=e=>{_(e.a,`_gE`),_(e.b,[`_gF`,`_gG`]),_(e.c,[`_gF`,`_gH`]),_(e.d,[`_gF`,`_gI`])},vR=(e,t)=>S(e.a,`value`,`rev:${t}`),yR=(e,t)=>m(e.b,t),bR=i(0,`<option> </option>`,` D `,0,(e,t)=>{vR(e,t[0]?.sha),yR(e,t[0]?.label)}),xR=c(15,0,e=>bR(e,[e._.d5,`sha`])),SR=xR,CR=c(19,0,e=>S(e.a,`hidden`,e._.b8)),wR=r(`z42`,e=>o(e.a,`click`,function(){e._.ds()})),TR=e=>{CR._(e),_(e.a,[P,`_gw`,`_gn`]),Xe(e.b),N(e.b,14),Ze(e.b),wR(e)},ER=c(12,0,e=>m(e.b,e._.cv)),DR=r(`z40`,e=>o(e.a,`click`,function(){dV(e._,!0)})),OR=e=>{ER._(e),_(e.a,[`_q`,`_gJ`]),DR(e)},kR=c(9,0,e=>{_(e.a,[iS,`_gn`,{_gm:e._.b6}]),S(e.a,`title`,e._.b6?`Hide file tree`:`Show file tree`)}),AR=r(`z39`,e=>o(e.a,`click`,function(){uV(e._,!e._.b6),Pe(e._.b6)})),jR=e=>{kR._(e),Ge(e.b),Ke(e.b,14),et(e.b),AR(e)},MR=s(2,e=>m(e.b,e._.b5?`This commit is not in any of these repos.`:e._.ci.some(e=>e.unborn)?`No commits yet.`:e._.b4===`dirty`?`Nothing uncommitted.`:e._.ci.some(e=>e.pr)?`No file changes on these PRs.`:`No changes vs base.`),2),NR=c(24,0,MR),PR=e=>{NR._(e),FR._(e),IR._(e),_(e.a,`_cp`)},FR=c(24,0,MR),IR=c(24,0,MR),LR=A(181,e=>m(e.b,e._._.b4===`committed`?``:`, showing uncommitted changes only`),e=>e._._),RR=e=>{LR(e),zR(e)},zR=A(5,e=>m(e.a,e._.e)),BR=v(`z44`,`<!><!>.`,`%b%`,RR),VR=e=>{rt(e.a),je(e.a,BR(e)),ee(e.a,`warn`),Ue(e.a,`inline`),Ne(e.a),Se(e.a),mt(e.a),Fe(e.a,{})},HR=(e,t)=>Ye(e.a,`${t}: base not found`),UR=(e,t)=>{HR(e,t[0]?.worktree),WR(e,t[0]?.base)},WR=j(4,g(zR)),GR=s(2,e=>m(e.b,e._.bf.trim()?`No matches in review.`:e._.b3&&!e._.b0?`Nothing changed since your last visit.`:`No files match "${e._.b0}".`),2),KR=c(24,1,GR),qR=e=>{KR._(e),JR._(e),YR._(e),_(e.a,`_cp`)},JR=c(24,1,GR),YR=c(24,1,GR),XR=A(177,e=>m(e.a,e._._.ax),e=>e._._),ZR=v(`z43`,` `,` `,XR),QR=e=>{rt(e.a),je(e.a,ZR(e)),mt(e.a,BH(e)),Ne(e.a),Se(e.a),ee(e.a),Ue(e.a),Ye(e.a),Fe(e.a,{})},$R=A(174,e=>NT(e.a,e._._._.an||``),e=>e._._._),ez=e=>{$R(e),tz(e),nz(e),rz(e),iz(e),oz(e),sz._(e),lz._(e),uz._(e),dz._(e),fz._(e),pz._(e),mz._(e),IT(e.a),eE(e.a,UH(e)),$T(e.a,HH(e)),XT(e.a,VH(e))},tz=A(175,e=>PT(e.a,e._._._.ao||``),e=>e._._._),nz=A(178,e=>ZT(e.a,e._._._.ay),e=>e._._._),rz=A(180,e=>YT(e.a,e._._._.b3),e=>e._._._),iz=A(186,e=>QT(e.a,e._._._.c9),e=>e._._._),az=s(1,e=>zT(e.a,e._._._.d2.has(e._.i))),oz=A(190,az,e=>e._._._),sz=c(0,0,e=>DT(e.a,e._.c)),cz=s(2,e=>{LT(e.a,e._.k||e._.f),GT(e.a,e._.f-e._.k)}),lz=c(0,0,cz),uz=c(0,0,az),dz=c(0,0,cz),fz=c(0,0,e=>HT(e.a,e._.l)),pz=c(0,0,e=>UT(e.a,e._.m)),mz=c(0,0,e=>JT(e.a,e._.n)),hz=(e,t)=>{yz(e,t?.files),bz(e,t?.additions),xz(e,t?.deletions),Sz(e,t?.fresh)},gz=s(3,e=>hz(e,e._._.d8(e.c))),_z=A(192,gz,e=>e._._),vz=_z,yz=j(10,dz),bz=j(11,fz),xz=j(12,pz),Sz=j(13,mz),Cz=j(2,e=>{Ez(e,e.c?.files?.length),Dz(e,e.c?.pr),kz(e,e.c?.id),gz(e),sz(e)}),wz=C(0,ow,(e=>`/${e}&`)(sw),ez),Tz=s(7,e=>wz(e,e.f||e.g?0:1)),Ez=j(5,e=>{Tz(e),lz(e)}),Dz=j(6,Tz),Oz=(e,t)=>Cz(e,t[0]),kz=j(8,uz),Az=i(0,`<!><!><!>`,`b%`,vz,Oz),jz=c(25,0,e=>Az(e,[e._.ck,`id`])),Mz=e=>{jz._(e),_(e.a,`_gK`)},Nz=c(7,0,e=>LS(e.e,e._.am)),Pz=e=>{Nz._(e),Fz._(e),Iz._(e),Lz._(e),_(e.a,`_gu`),_(e.d,`_gt`),jS(e.e)},Fz=c(7,0,e=>{m(e.b,e._.av),m(e.c,e._.av===1?``:`s`)}),Iz=c(7,0,e=>RS(e.e,e._.do)),Lz=c(7,0,e=>zS(e.e,e._.dp)),Rz=c(5,0,e=>S(e.a,`href`,`/w/${e._.a5}`)),zz=e=>{Rz._(e),_(e.a,[P,`_gs`]),ue(e.b),se(e.b,14),xe(e.b)},Bz=w(`z38`,165),Vz=j(136,g(oz)),Hz=r(`z45`,e=>a(e,{active:e.ah,load:e.c4,findOpen:e.b8,shownFiles:e.ct,commentsByFile:e.cy,draft:e.aw,sessions:e.am,collapsedFiles:e.bj,repos:e.ar,onMount:function(){let t=new AbortController,n=()=>e.am||[],r=(t,n=!0)=>{let r=e.a0,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 Qe(`/api/workspaces/${e.a5}/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;tV(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:fe(),diffStyle:_e()?`unified`:`split`,stickyHeaders:!0,itemMetrics:{diffHeaderHeight:44},..._e()&&{renderCodeViewHeader:()=>e.c},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; } }`+Rx,async loadDiffFiles(t){let n=i.get(t),r=(e.ar||[]).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)]);return{oldFile:{name:t.prevName||t.name,contents:o},newFile:{name:t.name,contents:s}}},renderCustomHeader(t,n){let r=n.item,i=e.db(r.id),a=document.createElement(`div`);a.className=`_gN${r.collapsed?` _gO`:``}`,a.title=r.id;let c=document.createElement(`span`);c.className=`_gP`,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=`_gQ`;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 _gU`,e.title=`Changed since your last visit`,a.append(e)}let p=e.cy.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=`_gR`;let t=document.createElement(`span`);t.className=`_gS`,t.textContent=`+${i.additions||0}`;let n=document.createElement(`span`);n.className=`_gT`,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.bj);t.delete(r.id)||t.add(r.id),vV(e,t)},a},renderAnnotation(t,i){let a=t.metadata||{},o=i.item.id;if(a.draft)return d??=Ax({sessions:n,reveal:r},{onSave:t=>e.dd(o,t),onSend:(t,n)=>e.dr(o,t,n),onCancel:()=>{tV(e,null)}});let s=a.comment;if(!s)return;let c=i.item.type===`diff`?i.item.fileDiff:null,l=s.snippet!=null&&!!c&&gR(rx(c,s.side,s.line_start,s.line_end))!==gR(s.snippet);return kx(s,{sessions:n,reveal:r},{onDelete:t=>e.dg(t),onEdit:(t,n)=>e.dh(t,n),onSend:(t,n)=>e.dq(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)?Xx(i):g.set(i,Yx(i,r.item.id))}},g=new Map,_=new Nb(h,yx());o.viewer=_,_.setup(e.a0);let v=ct(e=>{h.themeType=e,_.setOptions({...h})});ye()&&Sx(()=>e.a0,t.signal),e.bp.scrollToItem=t=>{y.recs.has(t)&&(e.bx=null,_.scrollTo({type:`item`,id:t,align:`start`,behavior:`instant`}))},e.bp.scrollToLine=(e,t,n)=>_.scrollTo({type:`line`,id:e,lineNumber:t,side:n||`additions`,align:`center`,behavior:`instant`}),e.bp.clearSelection=()=>_.clearSelectedLines();let y={abort:t,viewer:_,unregTheme:v,unsubScroll:_.subscribeToScroll(t=>{e.bt||=requestAnimationFrame(()=>{e.bt=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.b4,key:r.id,off:Math.round(t-i)})}t>0&&(e.br=n)})}),hostUnregs:g,loaded:!1,wasActive:!1,lastNonce:e.ap||0,lastFileNonce:e.aq||0,recs:new Map,order:``,revealedDraft:null,dockedOpen:!1,start:()=>{this.active&&!y.loaded&&(y.loaded=!0,this.load())},pin:t=>{let n=e.a0,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:$b(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(`
2800
- `);if((r||a!==y.order)&&(y.order=a,y.viewer.setItems(t)),s.key){let{key:e,top:t}=s;s.key=null,t!=null&&t<y.viewer.getScrollTop()&&y.viewer.scrollTo({type:`item`,id:e,align:`start`,behavior:`instant`})}let o=this.draft;o&&o!==y.revealedDraft&&y.recs.has(o.key)&&(y.revealedDraft=o,y.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.bv;c&&y.recs.has(c.key)&&(e.bv=null,y.pin(c)),e.bx&&y.recs.has(e.bx)&&e.bp.scrollToItem(e.bx)}};return y.wasActive=!!this.active,this.findOpen&&(y.dockedOpen=!0,e.e0(!0)),dt().addEventListener(`review.changed`,t=>{y.loaded&&t.data?.workspaceId===e.a5&&e.cb()},{signal:t.signal}),dt().addEventListener(`status.changed`,t=>{if(!this.active||!y.loaded||e.ay)return;let n=t.data,r=n&&n[e.a5];if(!r)return;let i=Zb(r);!i||!e.bl||i===e.bl||e.ca()},{signal:t.signal}),window.addEventListener(`pagehide`,()=>{this.active&&y.loaded&&(e.ch(),e.c0())},{signal:t.signal}),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`&&this.active&&y.loaded&&e.c0()},{signal:t.signal}),y.start(),y},onUpdate:function(){this.start(),this.active&&this.loaded&&!this.wasActive&&e.c9(),!this.active&&this.loaded&&this.wasActive&&(e.ch(),e.c0()),this.wasActive=!!this.active,!!this.findOpen!==this.dockedOpen&&(this.dockedOpen=!!this.findOpen,e.e0(this.dockedOpen));let t=e.ap||0;this.loaded&&e.af&&t!==this.lastNonce&&e.c2(e.af),this.lastNonce=t;let n=e.aq||0;this.loaded&&e.ag&&n!==this.lastFileNonce?(e.c1(e.ag),this.lastFileNonce=n):this.loaded&&(this.lastFileNonce=n),e.a6&&e.a6!==e.b4&&e.cc(e.a6,!1),e.a7!==void 0&&(e.a7??null)!==e.b5&&e.cd(e.a7??null),this.draft||this.viewer.clearSelectedLines(),this.sync()},onDestroy:function(){e.bm&&clearTimeout(e.bm),this.loaded&&(e.ch(),e.c0()),this.abort.abort(),this.unsubScroll(),this.unregTheme();for(let e of this.hostUnregs.values())e();this.viewer.cleanUp()}})),$=s(171,Hz,41),Uz=j(147,$),Wz=s(146,e=>Uz(e,WH(e)),5),Gz=j(161,$),Kz=s(157,e=>Gz(e,GH(e)),5),qz=j(144,e=>{Wz(e),Kz(e)}),Jz=i(22,I,(e=>`/${e}&`)(Re),VR,UR),Yz=(e,t)=>{WI(e.a1,t),tR(e.a2,t)},Xz=j(145,e=>{Wz(e),Kz(e),$(e)}),Zz=(e,t)=>IC(e.r,t),Qz=j(142,g(_z)),$z=(e,t)=>HI(e.a1,t),eB=s(128,e=>$z(e,e.ck.map(t=>({id:t.id,label:t.worktree,worktree:t.worktree,files:e.ct.filter(e=>e.repo===t.id)})).filter(e=>e.files.length))),tB=j(127,e=>{dR(e.a2,e.ct),CH(e,e.ct?.length),Qz(e,JH(e)),eB(e),$(e)}),nB=s(126,e=>tB(e,e.cr?e.cq.filter(t=>e.cr.has(t.key)||t.key===e.bi):e.cq),2),rB=j(124,e=>{Zz(e,e.cq.map(e=>({...e,fileDiff:$b(e,e.key)}))),nB(e)}),iB=s(121,e=>rB(e,(()=>{let t=bx(e.b0);return e.cm.filter(n=>t(n.key)&&(!e.b3||n.changedSince))})()),2),aB=j(120,e=>{SH(e,e.cm?.length),Yz(e,new Set(e.cm.filter(e=>e.changedSince).map(e=>e.key))),Xz(e,qH(e)),iB(e)}),oB=j(118,e=>{xH(e,e.ck?.length),aB(e,e.ck.flatMap(e=>e.files.map(t=>({...t,repo:e.id,key:`${e.worktree}/${t.path}`})))),eB(e),jz(e)}),sB=j(139,e=>{TH(e,e.d5?.length),xR(e)}),cB=s(117,e=>{oB(e,e.b5?e.ci.filter(e=>e.rev):e.ci),sB(e,(()=>{let t=new Set,n=[];for(let r of e.ci)for(let e of r.commits||[])t.has(e.sha)||(t.add(e.sha),n.push({sha:e.sha,label:`${r.worktree}#${Nx(e.sha,7)} ${e.subject}`}));return e.b5&&!t.has(e.b5)&&n.unshift({sha:e.b5,label:Nx(e.b5,7)}),n})())}),lB=j(116,e=>{Vz(e,new Set(e.ci.filter(e=>!!e.pr&&!!e.localHead&&(e.localHead!==e.head||e.branch!==e.pr.headRefName)).map(e=>e.id))),qz(e,KH(e)),Jz(e,[e.ci.filter(e=>e.baseMissing),`id`]),cB(e),IR(e)}),uB=j(98,$),dB=s(90,e=>uB(e,YH(e)),2),fB=g(iz),pB=j(107,e=>{$(e),fB(e)}),mB=s(103,e=>pB(e,XH(e))),hB=j(108,$),gB=s(106,e=>hB(e,ZH(e)),4),_B=s(114,e=>k(e,`o`,e.b5?`rev:${e.b5}`:e.b4,QH(e)),2),vB=j(113,_B),yB=s(112,e=>vB(e,t=>{if(t.startsWith(`rev:`)){e.cd(t.slice(4));return}let n=t;if(e.b5&&(UV(e,null),e.aj?.(null),n===e.b4)){e.c4(e.b4);return}e.cc(n)}),5),bB=j(110,e=>{yB(e),$(e)}),xB=s(104,e=>bB(e,$H(e)),2),SB=j(111,e=>{yB(e),$(e)}),CB=s(105,e=>SB(e,eU(e)),3),wB=j(102,e=>{mB(e),gB(e),xB(e),CB(e),yB(e),$(e)}),TB=s(101,e=>wB(e,tU(e)),10),EB=j(100,e=>{TB(e),$(e)}),DB=s(94,e=>EB(e,nU(e)),2),OB=j(115,$),kB=s(54,e=>OB(e,rU(e))),AB=C(9,(e=>`<button>${e}</button>`)(Ie),(e=>` D/${e}&l`)(_t),jR),jB=C(12,`<button title="Jump to file">Files (<!>)</button>`,` Db%`,OR),MB=C(19,(e=>`<button title="Find in review (⌘/Ctrl+F)" aria-label="Find in review">${e}</button>`)(ge),(e=>` D/${e}&l`)(ve),TR),NB=s(138,e=>MB(e,e.d3&&!e.ba?0:1)),PB=j(137,e=>{AB(e,+!e.d3),jB(e,+!e.d3),NB(e)}),FB=s(123,e=>PB(e,!e.ar||e.co>0)),IB=j(158,Iz),LB=j(159,Lz),RB=j(160,$),zB=s(156,e=>{IB(e,iU(e)),LB(e,aU(e)),RB(e,oU(e))}),BB=j(155,e=>{zB(e),Kz(e)}),VB=s(154,e=>BB(e,sU(e)),4),HB=C(23,`<div aria-hidden=true><div></div><div></div><div></div></div>`,` D b b `,_R),UB=s(61,e=>HB(e,!e.ar&&e.ay?0:1)),WB=C(24,`<p> </p>`,` D `,PR,`<p> </p>`,` D `,qR),GB=s(130,e=>WB(e,e.ar&&!e.co?0:e.ar&&!e.cv&&!e.bh?1:2),3),KB=l(53,e=>{lB(e,e.ar||[]),dB(e),DB(e),kB(e),FB(e),VB(e),UB(e),GB(e),$(e)}),qB=(e,t)=>$L(e.a2,t),JB=(e,t)=>UI(e.a1,t),YB=j(132,e=>{qB(e,new Set(e.cy.keys())),JB(e,new Map([...e.cy].map(([e,t])=>[e,t.length]))),$(e)}),XB=j(150,$),ZB=s(149,e=>XB(e,cU(e))),QB=j(151,$),$B=s(56,e=>QB(e,lU(e))),eV=l(55,e=>{NV(e,e.at?.length),YB(e,(()=>{let t=new Map;for(let n of e.at){let e=`${n.worktree}/${n.path}`;t.set(e,[...t.get(e)||[],n])}return t})()),Wz(e),ZB(e),$B(e),VB(e),zB(e)}),tV=l(58,e=>{Wz(e),Kz(e),$(e)}),nV=C(21,I,(e=>`/${e}&`)(Re),QR),rV=g(XR),iV=l(59,e=>{nV(e,+!e.ax),rV(e)}),aV=g(nz),oV=l(60,e=>{S(e.k,`disabled`,e.ay),Ct(e.l,e.ay&&`_F`),S(e.o,`disabled`,e.ay),gB(e),UB(e),$(e),aV(e)}),sV=(e,t)=>{DI(e.a1,t),ZL(e.a2,t)},cV=g(rz),lV=l(65,e=>{TB(e),iB(e),cV(e),JR(e)}),uV=l(68,e=>{BI(e.a1,e.b6),kR(e)}),dV=l(69,e=>KL(e.a2,e.b7)),fV=r(`z49`,e=>{e.ba&&!e.b8&&GV(e,!0)}),pV=s(73,fV),mV=j(72,e=>{UC(e.r,e.ba),GC(e.r,!e.ba),pV(e),NB(e)}),hV=j(125,nB),gV=e=>{hV(e,e.bf.trim()?new Set(e.bg):null)},_V=l(76,e=>{nH(e,e.be?.query),rH(e,e.be?.keys),iH(e,e.be?.hit),gV(e)}),vV=l(81,$),yV=(e,t)=>{oH(e,t.sig),sH(e,t.timer)},bV=(e,t)=>cH(e,t.seq),xV=(e,t)=>SC(e.r,function(e){t(e)}),SV=j(99,e=>{GI(e.a1,dU(e)),TB(e),$(e)}),CV=s(96,e=>SV(e,fU(e)),3),wV=j(87,e=>{xV(e,t=>{if(_V(e,t),!t.hit)return;let n=t.hit;setTimeout(()=>{n.line<1?e.bp.scrollToItem(n.key):e.bp.scrollToLine(n.key,n.line,n.side)},0)}),CV(e),DB(e),$(e)}),TV=(e,t)=>{lH(e,t.anchor),uH(e,t.raf)},EV=(e,t)=>{fH(e,t.pos),pH(e,t.jump)},DV=j(143,e=>{Wz(e),Kz(e)}),OV=(e,t)=>EH(e,t.busy),kV=(e,t)=>{NH(e,t.home),PH(e,t.raf)},AV=r(`z47`,e=>{o(e.k,`click`,function(){e.c9()}),b(e,`o`)});function jV(e){p(e,17,AH),_(e.a,`_gl`),_(e.b,`_gq`),_(e.c,`_gY`),_(e.d,`_gr`),_(e.g,aS),_(e.i,[`_gp`,`_gV`]),_(e.k,[P,`_gn`]),ke(e.l),ne(e.l,14),_(e.n,[`_o`,`_gB`,`_gW`]),_(e.o,[`_p`,`_gC`,`_gX`]),PC(e.r),lC(e.r,vU(e)),_C(e.r),vC(e.r),xC(e.r),_(e.u,`_gL`),_(e.a0,`_gM`),II(e.a1),e.a2,qL(e.a2,_U(e)),M(e,Bz(e)),KB(e,null),eV(e,[]),tV(e,null),iV(e,null),oV(e,!1),sV(e,uU(e)),lV(e,!1),uV(e,Ae()),dV(e,!1),mV(e,!_e()),_V(e,{query:``,hit:null,keys:[]}),vV(e,new Set),yV(e,{sig:``,timer:0}),bV(e,{seq:0}),wV(e,{scrollToItem:hU,scrollToLine:mU,clearSelection:pU}),TV(e,{anchor:null,raf:0}),EV(e,{pos:null,jump:null}),DV(e,gU),OV(e,{busy:0}),kV(e,{home:null,raf:0}),AV(e)}var MV=C(7,(e=>`<span><!> comment<!></span><span>${e}</span>`)(oS),(e=>` D%c%l D/${e}&l`)(sS),Pz),NV=j(57,e=>{_(e.e,[`_gA`,{_gz:!e.av}]),MV(e,+!e.av),Fz(e)}),PV=r(`z46`,e=>{e.b0!==we(e.a5)&&pe(e.a5,e.b0)}),FV=s(63,PV),IV=l(62,e=>{EI(e.a1,e.b0),XL(e.a2,e.b0),iB(e),FV(e),KR(e)}),LV=j(109,$),RV=j(148,e=>{ZB(e),VB(e)}),zV=j(31,e=>{cR(e.a2,e.a5),IV(e,we(e.a5)),LV(e,yU(e)),RV(e,bU(e)),dB(e),TB(e),kB(e),Wz(e),$B(e),Kz(e),FV(e),$(e),Rz(e)}),BV=g(LR),VV=l(66,e=>{lR(e.a2,e.b4),TB(e),mB(e),gB(e),xB(e),CB(e),yB(e),_B(e),$(e),BV(e),NR(e)}),HV=j(32,e=>{VV(e,e.a6??re()),$(e)}),UV=l(67,e=>{TB(e),CB(e),yB(e),cB(e),_B(e),$(e),FR(e)}),WV=j(33,e=>{UV(e,e.a7??null),$(e)}),GV=u(70,e=>{_(e.q,[`_gy`,{_gx:!e.b8}]),cC(e.r,e.b8),pV(e),$(e),CR(e)}),KV=s(36,e=>GV(e,e.a8,e.a9)),qV=j(34,KV),JV=j(35,KV),YV=r(`z48`,e=>{e.ah&&window.addEventListener(`keydown`,t=>{!(t.metaKey||t.ctrlKey)||t.altKey||t.shiftKey||t.key.toLowerCase()===`f`&&(t.target instanceof HTMLTextAreaElement||(t.preventDefault(),e.ds()))},{capture:!0,signal:E(e,0)})}),XV=s(163,e=>{D(e,0),YV(e)}),ZV=j(162,XV),QV=u(74,e=>{WC(e.r,e.bc),ZV(e,xU(e))}),$V=s(39,e=>QV(e,e.ab,e.ac)),eH=j(37,$V),tH=j(38,$V),nH=j(77,YR),rH=j(78),iH=j(79,e=>{aH(e,e.bh?.key),GB(e)}),aH=j(80,nB),oH=j(83,e=>{TB(e),$(e)}),sH=j(84,e=>{gB(e),$(e)}),cH=j(86,TB),lH=j(89,e=>{dB(e),$(e)}),uH=j(91,$),dH=j(97,TB),fH=j(93,e=>{dH(e,SU(e)),CV(e),DB(e),$(e)}),pH=j(95,e=>{CV(e),$(e)}),mH=j(40,CV),hH=j(41,e=>{TB(e),$(e)}),gH=j(42,e=>{TB(e),$(e)}),_H=j(43,e=>{gB(e),XV(e),$(e)}),vH=j(44,xB),yH=j(45,e=>{CB(e),yB(e)}),bH=C(25,`<div></div>`,` `,Mz),xH=(e,t)=>bH(e,+!t),SH=j(122,e=>{iR(e.a2,e.co),FB(e),GB(e)}),CH=j(129,e=>{GB(e),ER(e)}),wH=C(15,`<optgroup label=Commits></optgroup>`,` `,SR),TH=(e,t)=>wH(e,+!t),EH=j(153,VB),DH=j(46,VB),OH=C(5,(e=>`<a title="Back to terminal (⌘/Ctrl+Shift+D)">${e}</a>`)(me),(e=>` D/${e}&l`)(Ce),zz),kH=(e,t)=>OH(e,+!t),AH=h(`z41`,j(165)),jH=j(170,$),MH=s(169,e=>jH(e,CU(e))),NH=j(167,MH),PH=j(168,MH),FH=j(48,e=>{$(e),Nz(e)}),IH=j(51,$),LH=j(52,$),RH=j(49,g($R)),zH=j(50,g(tz)),BH=e=>function(){iV(e._,null)},VH=e=>function(){let t=e._._._.ct.find(t=>t.repo===e._.i);t&&e._._._.c1(t.key)},HH=e=>function(){IV(e._._._,``),lV(e._._._,!1),_V(e._._._,{query:``,hit:null,keys:[]})},UH=e=>function(){lV(e._._._,!e._._._.b3)},WH=e=>async(t,n)=>{let r=e.aw,i=e.db(t);if(tV(e,null),!(!r||!i))try{let t=await Qe(`/api/workspaces/${e.a5}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`comment`,worktree:e.d9(i.repo),path:i.path,side:r.side,line_start:r.start,line_end:r.end,text:n.trim(),...e.da(i,r)})});eV(e,e.at.concat(t))}catch(t){iV(e,String(t.message||t))}},GH=e=>(t,n,r)=>{let i=e.aw,a=e.db(t),o=n.trim();if(!i||!a||!o)return Promise.resolve(!1);let s={id:-1,workspace_id:e.a5,worktree:e.d9(a.repo),path:a.path,side:i.side===`deletions`?`deletions`:`additions`,line_start:i.start,line_end:i.end,text:o,created_at:``,...e.da(a,i)};return e.dl([s],{session:r},[])},KH=e=>(t,n)=>{let r=e.ci.find(e=>e.id===t.repo),i=$b(t,t.key),a=n.side===`deletions`?`deletions`:`additions`;return{head:r?.head,snippet:i?rx(i,a,n.start,n.end):void 0}},qH=e=>t=>e.cm.find(e=>e.key===t),JH=e=>t=>{let n=0,r=0,i=0,a=0;for(let a of e.ct)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}},YH=e=>()=>{e.ar&&lt(e.a5,e.br)},XH=e=>()=>e.c4(e.b4,!0),ZH=e=>()=>{e.bm&&clearTimeout(e.bm),e.bm=setTimeout(()=>{e.bm=0,e.ah&&!e.ay&&e.c4(e.b4,!0)},400)},QH=e=>function(t){e.cf(t)},$H=e=>(t,n=!0)=>{t!==e.b4&&(VV(e,t),n&&de(t),e.ai?.(t),e.c4(t))},eU=e=>t=>{t!==e.b5&&(UV(e,t),e.aj?.(t),e.c4(e.b4))},tU=e=>async(t=e.b4,n=!1)=>{let r=++e.bo;oV(e,!0),iV(e,null);try{let i=new URLSearchParams;t!==`committed`&&i.set(`scope`,t),n&&i.set(`refresh`,`1`),e.b5&&i.set(`rev`,e.b5);let a=await Qe(`/api/workspaces/${e.a5}/diff?${i}`);if(r!==e.bo)return;let o=a.sections,s=a;if(KB(e,o),e.b3&&!o.some(e=>e.files.some(e=>e.changedSince))&&lV(e,!1),eV(e,s.comments||[]),e.bl=Xb(o),e.af&&e.c2(e.af),e.ag)e.c1(e.ag);else if(!e.af&&!n&&e.bo===1){let n=wt(e.a5);n&&n.scope===t&&e.bz(n)}}catch(t){if(r!==e.bo)return;iV(e,String(t.message||t))}finally{r===e.bo&&oV(e,!1)}},nU=e=>t=>{let n=(e.ar||[]).find(e=>e.pr&&`${e.worktree}/${e.pr.number}`===t),r=n?.files[0];n&&r&&(e.bv=null,e.bp.scrollToItem(`${n.worktree}/${r.path}`))},rU=e=>()=>{if(!e.ar)return;let t={},n={};for(let r of e.ar){t[r.id]=r.head;for(let e of r.files)e.hash&&(n[`${r.worktree}/${e.path}`]=e.hash)}fetch(`/api/workspaces/${e.a5}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`seen`,heads:t,dirty:n}),keepalive:!0}).catch(()=>{})},iU=e=>()=>e.dl(e.at,{clipboard:!0},`all`),aU=e=>t=>e.dl(e.at,{session:t},`all`),oU=e=>(t,n)=>{let r=e.at.find(e=>e.id===t);return r?e.dl([r],{session:n},[t]):Promise.resolve(!1)},sU=e=>async(t,n,r)=>{if(!t.length)return!0;e.dj++;try{let i=jx(t,e.ar);if(`clipboard`in n){if(!await ot(i))return iV(e,`Copy failed: the clipboard needs HTTPS in this browser.`),!1}else await Qe(`/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}`,...Be()||{}})}),e.ak?.(n.session);if(tV(e,null),r===`all`)eV(e,[]);else{let t=new Set(r);eV(e,e.at.filter(e=>!t.has(e.id)))}return(r===`all`||r.length)&&await e.de(r).catch(()=>{}),!0}catch(t){return iV(e,String(t.message||t)),!1}finally{e.dj--}},cU=e=>async t=>{eV(e,e.at.filter(e=>e.id!==t)),await e.de([t]).catch(()=>{})},lU=e=>async(t,n)=>{let r=e.at.find(e=>e.id===t);if(!r)return;let i=n.trim();if(!(!i||i===r.text)){eV(e,e.at.map(e=>e.id===t?{...e,text:i}:e));try{await Qe(`/api/workspaces/${e.a5}/review/${t}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({text:i})})}catch(n){throw eV(e,e.at.map(e=>e.id===t?r:e)),iV(e,String(n.message||n)),n}}},uU=e=>t=>{IV(e,t)},dU=e=>function(t){e.c1(t)},fU=e=>t=>{e.bv=null,e.bx=t,e.ae?.(t),e.bp.scrollToItem(t)};function pU(){}function mU(e,t,n){}function hU(e){}function gU(e){return e.includes(`#`)?e.split(`#`)[0]:e}var _U=e=>t=>{dV(e,t)},vU=e=>t=>{GV(e,t)},yU=e=>async()=>{try{eV(e,(await Qe(`/api/workspaces/${e.a5}/review`)).comments||[])}catch{}},bU=e=>t=>t===`all`?fetch(`/api/workspaces/${e.a5}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`clear`})}):Promise.all(t.map(t=>fetch(`/api/workspaces/${e.a5}/review/${t}`,{method:`DELETE`}))),xU=e=>()=>{GV(e,!0),QV(e,+e.bc+1),Bz(e)()},SU=e=>t=>{e.bv=t},CU=e=>t=>{if(!_e())return;let n=e.q;if(e.dx??=n.parentElement,cancelAnimationFrame(e.dy),!t){e.dx&&n.parentElement!==e.dx&&e.dx.append(n);return}let r=0,i=()=>{let t=document.getElementById(`review-find-host`);t?n.parentElement!==t&&(t.append(n),requestAnimationFrame(()=>setTimeout(Bz(e),0))):r++<20&&(e.dy=requestAnimationFrame(i))};i()};d(`z31`,BH),d(`z34`,VH),d(`z33`,HH),d(`z32`,UH),d(`z20`,WH),d(`z28`,GH),d(`z18`,KH),d(`z19`,qH),d(`z16`,JH),d(`z6`,YH),d(`z10`,XH),d(`z11`,ZH),d(`z0`,QH),d(`z13`,$H),d(`z14`,eU),d(`z9`,tU),d(`z8`,nU),d(`z15`,rU),d(`z25`,iU),d(`z26`,aU),d(`z27`,oU),d(`z24`,sU),d(`z22`,cU),d(`z23`,lU),d(`z1`,uU),d(`z35`,dU),d(`z7`,fU),d(`z4`,pU),d(`z3`,mU),d(`z2`,hU),d(`z17`,gU),d(`z36`,_U),d(`z30`,vU),d(`z12`,yU),d(`z21`,bU),d(`z29`,xU),d(`z5`,SU),d(`z37`,CU);export{_H as $input_active,qV as $input_findOpen,JV as $input_findOpenChange,eH as $input_findTick,tH as $input_findTickChange,gH as $input_focusFile,LH as $input_focusFileNonce,IH as $input_focusNonce,hH as $input_focusPr,kH as $input_onExit,mH as $input_onFileChange,yH as $input_onRevChange,vH as $input_onScopeChange,DH as $input_onSent,WV as $input_rev,HV as $input_scope,FH as $input_sessions,RH as $input_workspaceBranch,zV as $input_workspaceId,zH as $input_workspaceName,jV as $setup,mR as $template,hR as $walks};
2799
+ `)}var iB=e=>{_(e.a,`_gE`),_(e.b,[`_gF`,`_gG`]),_(e.c,[`_gF`,`_gH`]),_(e.d,[`_gF`,`_gI`])},aB=(e,t)=>S(e.a,`value`,`rev:${t}`),oB=(e,t)=>m(e.b,t),sB=i(0,`<option> </option>`,` D `,0,(e,t)=>{aB(e,t[0]?.sha),oB(e,t[0]?.label)}),cB=c(15,0,e=>sB(e,[e._.da,`sha`])),lB=cB,uB=c(19,0,e=>S(e.a,`hidden`,e._.b8)),dB=r(`A43`,e=>o(e.a,`click`,function(){e._.e0()})),fB=e=>{uB._(e),_(e.a,[P,`_gw`,`_gn`]),Xe(e.b),N(e.b,14),Ze(e.b),dB(e)},pB=c(12,0,e=>m(e.b,e._.d1)),mB=r(`A41`,e=>o(e.a,`click`,function(){SH(e._,!0)})),hB=e=>{pB._(e),_(e.a,[`_q`,`_gJ`]),mB(e)},gB=c(9,0,e=>{_(e.a,[iS,`_gn`,{_gm:e._.b6}]),S(e.a,`title`,e._.b6?`Hide file tree`:`Show file tree`)}),_B=r(`A40`,e=>o(e.a,`click`,function(){xH(e._,!e._.b6),Pe(e._.b6)})),vB=e=>{gB._(e),Ge(e.b),Ke(e.b,14),et(e.b),_B(e)},yB=s(2,e=>m(e.b,e._.b5?`This commit is not in any of these repos.`:e._.cl.some(e=>e.unborn)?`No commits yet.`:e._.b4===`dirty`?`Nothing uncommitted.`:e._.cl.some(e=>e.pr)?`No file changes on these PRs.`:`No changes vs base.`),2),bB=c(25,0,yB),xB=e=>{bB._(e),SB._(e),CB._(e),_(e.a,`_cp`)},SB=c(25,0,yB),CB=c(25,0,yB),wB=A(186,e=>m(e.b,e._._.b4===`committed`?``:`, showing uncommitted changes only`),e=>e._._),TB=e=>{wB(e),EB(e)},EB=A(5,e=>m(e.a,e._.e)),DB=v(`A45`,`<!><!>.`,`%b%`,TB),OB=e=>{rt(e.a),je(e.a,DB(e)),ee(e.a,`warn`),Ue(e.a,`inline`),Ne(e.a),Se(e.a),mt(e.a),Fe(e.a,{})},kB=(e,t)=>Ye(e.a,`${t}: base not found`),AB=(e,t)=>{kB(e,t[0]?.worktree),jB(e,t[0]?.base)},jB=j(4,g(EB)),MB=s(2,e=>m(e.b,e._.bf.trim()?`No matches in review.`:e._.b3&&!e._.b0?`Nothing changed since your last visit.`:`No files match "${e._.b0}".`),2),NB=c(25,1,MB),PB=e=>{NB._(e),FB._(e),IB._(e),_(e.a,`_cp`)},FB=c(25,1,MB),IB=c(25,1,MB),LB=A(183,e=>m(e.a,e._._.ax),e=>e._._),RB=v(`A44`,` `,` `,LB),zB=e=>{rt(e.a),je(e.a,RB(e)),mt(e.a,ZU(e)),Ne(e.a),Se(e.a),ee(e.a),Ue(e.a),Ye(e.a),Fe(e.a,{})},BB=c(7,0,e=>LS(e.e,e._.am)),VB=e=>{BB._(e),HB._(e),UB._(e),WB._(e),_(e.a,`_gu`),_(e.d,`_gt`),jS(e.e)},HB=c(7,0,e=>{m(e.b,e._.av),m(e.c,e._.av===1?``:`s`)}),UB=c(7,0,e=>RS(e.e,e._.dw)),WB=c(7,0,e=>zS(e.e,e._.dx)),GB=c(5,0,e=>S(e.a,`href`,`/w/${e._.a5}`)),KB=e=>{GB._(e),_(e.a,[P,`_gs`]),ue(e.b),se(e.b,14),xe(e.b)},qB=w(`A39`,173),JB=(e,t)=>RD(e.u,t),YB=r(`A46`,e=>a(e,{active:e.ah,load:e.c7,findOpen:e.b8,shownFiles:e.cz,commentsByFile:e.d3,draft:e.aw,sessions:e.am,collapsedFiles:e.bj,repos:e.ar,onMount:function(){let t=new AbortController,n=()=>e.am||[],r=(t,n=!0)=>{let r=e.a0,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 Qe(`/api/workspaces/${e.a5}/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;mH(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:fe(),diffStyle:_e()?`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; } }`+Rx,async loadDiffFiles(t){let n=i.get(t),r=(e.ar||[]).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)]);return{oldFile:{name:t.prevName||t.name,contents:o},newFile:{name:t.name,contents:s}}},renderCustomHeader(t,n){let r=n.item,i=e.dj(r.id),a=document.createElement(`div`);a.className=`_gM${r.collapsed?` _gN`:``}`,a.title=r.id;let c=document.createElement(`span`);c.className=`_gO`,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=`_gP`;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 _gT`,e.title=`Changed since your last visit`,a.append(e)}let p=e.d3.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=`_gQ`;let t=document.createElement(`span`);t.className=`_gR`,t.textContent=`+${i.additions||0}`;let n=document.createElement(`span`);n.className=`_gS`,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.bj);t.delete(r.id)||t.add(r.id),kH(e,t)},a},renderAnnotation(t,i){let a=t.metadata||{},o=i.item.id;if(a.draft)return d??=Ax({sessions:n,reveal:r},{onSave:t=>e.dl(o,t),onSend:(t,n)=>e.dz(o,t,n),onCancel:()=>{mH(e,null)}});let s=a.comment;if(!s)return;let c=i.item.type===`diff`?i.item.fileDiff:null,l=s.snippet!=null&&!!c&&rB(rx(c,s.side,s.line_start,s.line_end))!==rB(s.snippet);return kx(s,{sessions:n,reveal:r},{onDelete:t=>e.do(t),onEdit:(t,n)=>e.dp(t,n),onSend:(t,n)=>e.dy(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)?Xx(i):g.set(i,Yx(i,r.item.id))}},g=new Map,_=new Nb(h,yx());o.viewer=_,_.setup(e.a0);let v=ct(e=>{h.themeType=e,_.setOptions({...h})});ye()&&Sx(()=>e.a0,t.signal),e.br.scrollToItem=t=>{y.recs.has(t)&&(e.bz=null,_.scrollTo({type:`item`,id:t,align:`start`,behavior:`instant`}))},e.br.scrollToLine=(e,t,n)=>_.scrollTo({type:`line`,id:e,lineNumber:t,side:n||`additions`,align:`center`,behavior:`instant`}),e.br.clearSelection=()=>_.clearSelectedLines();let y={abort:t,viewer:_,unregTheme:v,unsubScroll:_.subscribeToScroll(t=>{e.bv||=requestAnimationFrame(()=>{e.bv=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.b4,key:r.id,off:Math.round(t-i)})}t>0&&(e.bt=n);let r=n?.key??_.getRenderedItems()[0]?.id,i=r&&e.dj(r)?.repo;i&&i!==e.bk&&AH(e,i)})}),hostUnregs:g,loaded:!1,wasActive:!1,lastNonce:e.ap||0,lastFileNonce:e.aq||0,recs:new Map,order:``,revealedDraft:null,dockedOpen:!1,start:()=>{this.active&&!y.loaded&&(y.loaded=!0,this.load())},pin:t=>{let n=e.a0,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:$b(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(`
2800
+ `);if((r||a!==y.order)&&(y.order=a,y.viewer.setItems(t)),s.key){let{key:e,top:t}=s;s.key=null,t!=null&&t<y.viewer.getScrollTop()&&y.viewer.scrollTo({type:`item`,id:e,align:`start`,behavior:`instant`})}let o=this.draft;o&&o!==y.revealedDraft&&y.recs.has(o.key)&&(y.revealedDraft=o,y.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.bx;c&&y.recs.has(c.key)&&(e.bx=null,y.pin(c)),e.bz&&y.recs.has(e.bz)&&e.br.scrollToItem(e.bz)}};return y.wasActive=!!this.active,this.findOpen&&(y.dockedOpen=!0,e.e8(!0)),dt().addEventListener(`review.changed`,t=>{y.loaded&&t.data?.workspaceId===e.a5&&e.ce()},{signal:t.signal}),dt().addEventListener(`status.changed`,t=>{if(!this.active||!y.loaded||e.ay)return;let n=t.data,r=n&&n[e.a5];if(!r)return;let i=Zb(r);!i||!e.bn||i===e.bn||e.cd()},{signal:t.signal}),window.addEventListener(`pagehide`,()=>{this.active&&y.loaded&&(e.ck(),e.c3())},{signal:t.signal}),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`hidden`&&this.active&&y.loaded&&e.c3()},{signal:t.signal}),y.start(),y},onUpdate:function(){this.start(),this.active&&this.loaded&&!this.wasActive&&e.cc(),!this.active&&this.loaded&&this.wasActive&&(e.ck(),e.c3()),this.wasActive=!!this.active,!!this.findOpen!==this.dockedOpen&&(this.dockedOpen=!!this.findOpen,e.e8(this.dockedOpen));let t=e.ap||0;this.loaded&&e.af&&t!==this.lastNonce&&e.c5(e.af),this.lastNonce=t;let n=e.aq||0;this.loaded&&e.ag&&n!==this.lastFileNonce?(e.c4(e.ag),this.lastFileNonce=n):this.loaded&&(this.lastFileNonce=n),e.a6&&e.a6!==e.b4&&e.cf(e.a6,!1),e.a7!==void 0&&(e.a7??null)!==e.b5&&e.cg(e.a7??null),this.draft||this.viewer.clearSelectedLines(),this.sync()},onDestroy:function(){e.bo&&clearTimeout(e.bo),this.loaded&&(e.ck(),e.c3()),this.abort.abort(),this.unsubScroll(),this.unregTheme();for(let e of this.hostUnregs.values())e();this.viewer.cleanUp()}})),$=s(179,YB,42),XB=j(155,$),ZB=s(154,e=>XB(e,QU(e)),5),QB=j(169,$),$B=s(165,e=>QB(e,$U(e)),5),eV=j(151,e=>{ZB(e),$B(e)}),tV=i(23,I,(e=>`/${e}&`)(Re),OB,AB),nV=(e,t)=>{jR(e.a1,t),Hz(e.a2,t)},rV=j(153,e=>{ZB(e),$B(e),$(e)}),iV=j(152,e=>rV(e,tW(e))),aV=(e,t)=>IC(e.r,t),oV=(e,t)=>_D(e.u,t),sV=s(148,e=>oV(e,e.cn.filter(e=>e.files.length||e.pr).map(t=>{let n=e.dd(t);return{repo:t,files:n.files,additions:n.additions,deletions:n.deletions,fresh:n.fresh,hidden:t.files.length-n.files}}))),cV=j(147,sV),lV=(e,t)=>kR(e.a1,t),uV=s(134,e=>lV(e,e.cn.map(t=>({id:t.id,label:t.worktree,worktree:t.worktree,files:e.cz.filter(e=>e.repo===t.id)})).filter(e=>e.files.length))),dV=j(133,e=>{Qz(e.a2,e.cz),PU(e,e.cz?.length),uV(e),$(e)}),fV=s(130,e=>dV(e,e.cv.filter(t=>!e.bl.has(t.repo)))),pV=j(129,e=>{NU(e,e.cv?.length),cV(e,nW(e)),fV(e)}),mV=s(128,e=>pV(e,e.ct?e.cs.filter(t=>e.ct.has(t.key)||t.key===e.bi):e.cs),2),hV=j(126,e=>{aV(e,e.cs.map(e=>({...e,fileDiff:$b(e,e.key)}))),mV(e)}),gV=s(123,e=>hV(e,(()=>{let t=bx(e.b0);return e.co.filter(n=>t(n.key)&&(!e.b3||n.changedSince))})()),2),_V=j(122,e=>{MU(e,e.co?.length),nV(e,new Set(e.co.filter(e=>e.changedSince).map(e=>e.key))),iV(e,new Map(e.co.map(e=>[e.key,e]))),gV(e)}),vV=j(121,e=>{_V(e,e.cn.flatMap(e=>e.files.map(t=>({...t,repo:e.id,key:`${e.worktree}/${t.path}`})))),uV(e),sV(e)}),yV=j(144,e=>{IU(e,e.da?.length),cB(e)}),bV=s(120,e=>{vV(e,e.b5?e.cl.filter(e=>e.rev):e.cl),yV(e,(()=>{let t=new Set,n=[];for(let r of e.cl)for(let e of r.commits||[])t.has(e.sha)||(t.add(e.sha),n.push({sha:e.sha,label:`${r.worktree}#${Nx(e.sha,7)} ${e.subject}`}));return e.b5&&!t.has(e.b5)&&n.unshift({sha:e.b5,label:Nx(e.b5,7)}),n})())}),xV=j(119,e=>{JB(e,new Set(e.cl.filter(e=>!!e.pr&&!!e.localHead&&(e.localHead!==e.head||e.branch!==e.pr.headRefName)).map(e=>e.id))),eV(e,eW(e)),tV(e,[e.cl.filter(e=>e.baseMissing),`id`]),bV(e),CB(e)}),SV=j(101,$),CV=s(92,e=>SV(e,rW(e)),2),wV=j(110,e=>{zD(e.u,e.cc),$(e)}),TV=s(106,e=>wV(e,iW(e))),EV=j(111,$),DV=s(109,e=>EV(e,aW(e)),4),OV=s(117,e=>k(e,`o`,e.b5?`rev:${e.b5}`:e.b4,oW(e)),2),kV=j(116,OV),AV=s(115,e=>kV(e,t=>{if(t.startsWith(`rev:`)){e.cg(t.slice(4));return}let n=t;if(e.b5&&(eU(e,null),e.aj?.(null),n===e.b4)){e.c7(e.b4);return}e.cf(n)}),5),jV=j(113,e=>{AV(e),$(e)}),MV=s(107,e=>jV(e,sW(e)),2),NV=j(114,e=>{AV(e),$(e)}),PV=s(108,e=>NV(e,cW(e)),3),FV=j(105,e=>{TV(e),DV(e),MV(e),PV(e),AV(e),$(e)}),IV=s(104,e=>FV(e,lW(e)),10),LV=j(102,e=>{MR(e.a1,uW(e)),IV(e),$(e)}),RV=s(99,e=>LV(e,dW(e)),5),zV=j(103,e=>{IV(e),$(e)}),BV=s(96,e=>zV(e,fW(e)),2),VV=j(118,$),HV=s(54,e=>VV(e,pW(e))),UV=C(9,(e=>`<button>${e}</button>`)(Ie),(e=>` D/${e}&l`)(_t),vB),WV=C(12,`<button title="Jump to file">Files (<!>)</button>`,` Db%`,hB),GV=C(19,(e=>`<button title="Find in review (⌘/Ctrl+F)" aria-label="Find in review">${e}</button>`)(ge),(e=>` D/${e}&l`)(ve),fB),KV=s(143,e=>GV(e,e.d8&&!e.ba?0:1)),qV=j(142,e=>{UV(e,+!e.d8),WV(e,+!e.d8),KV(e)}),JV=s(125,e=>qV(e,!e.ar||e.cq>0)),YV=j(166,UB),XV=j(167,WB),ZV=j(168,$),QV=s(164,e=>{YV(e,mW(e)),XV(e,hW(e)),ZV(e,gW(e))}),$V=j(163,e=>{QV(e),$B(e)}),eH=s(162,e=>$V(e,_W(e)),4),tH=C(24,`<div aria-hidden=true><div></div><div></div><div></div></div>`,` D b b `,iB),nH=s(61,e=>tH(e,!e.ar&&e.ay?0:1)),rH=C(25,`<p> </p>`,` D `,xB,`<p> </p>`,` D `,PB),iH=s(132,e=>rH(e,e.ar&&!e.cq?0:e.ar&&!e.cx&&!e.bh?1:2),3),aH=l(53,e=>{xV(e,e.ar||[]),CV(e),RV(e),BV(e),HV(e),JV(e),eH(e),nH(e),iH(e),$(e)}),oH=(e,t)=>Bz(e.a2,t),sH=(e,t)=>AR(e.a1,t),cH=j(137,e=>{oH(e,new Set(e.d3.keys())),sH(e,new Map([...e.d3].map(([e,t])=>[e,t.length]))),$(e)}),lH=j(158,$),uH=s(157,e=>lH(e,vW(e))),dH=j(159,$),fH=s(56,e=>dH(e,yW(e))),pH=l(55,e=>{WH(e,e.at?.length),cH(e,(()=>{let t=new Map;for(let n of e.at){let e=`${n.worktree}/${n.path}`;t.set(e,[...t.get(e)||[],n])}return t})()),ZB(e),uH(e),fH(e),eH(e),QV(e)}),mH=l(58,e=>{ZB(e),$B(e),$(e)}),hH=C(22,I,(e=>`/${e}&`)(Re),zB),gH=g(LB),_H=l(59,e=>{hH(e,+!e.ax),gH(e)}),vH=l(60,e=>{S(e.k,`disabled`,e.ay),Ct(e.l,e.ay&&`_F`),S(e.o,`disabled`,e.ay),BD(e.u,e.ay),DV(e),nH(e),$(e)}),yH=(e,t)=>{mR(e.a1,t),Rz(e.a2,t)},bH=l(65,e=>{ND(e.u,e.b3),IV(e),gV(e),FB(e)}),xH=l(68,e=>{DR(e.a1,e.b6),gB(e)}),SH=l(69,e=>Nz(e.a2,e.b7)),CH=r(`A50`,e=>{e.ba&&!e.b8&&nU(e,!0)}),wH=s(73,CH),TH=j(72,e=>{UC(e.r,e.ba),GC(e.r,!e.ba),wH(e),KV(e)}),EH=j(127,mV),DH=e=>{EH(e,e.bf.trim()?new Set(e.bg):null)},OH=l(76,e=>{pU(e,e.be?.query),mU(e,e.be?.keys),hU(e,e.be?.hit),DH(e)}),kH=l(81,$),AH=l(82,e=>{vD(e.u,e.bk),$(e)}),jH=l(83,e=>{AD(e.u,e.bl),RV(e),fV(e)}),MH=(e,t)=>{_U(e,t.sig),vU(e,t.timer)},NH=(e,t)=>yU(e,t.seq),PH=(e,t)=>SC(e.r,function(e){t(e)}),FH=j(89,e=>{PH(e,t=>{if(OH(e,t),!t.hit)return;let n=t.hit;setTimeout(()=>{n.line<1?e.br.scrollToItem(n.key):e.br.scrollToLine(n.key,n.line,n.side)},0)}),RV(e),BV(e),$(e)}),IH=(e,t)=>{bU(e,t.anchor),xU(e,t.raf)},LH=(e,t)=>{wU(e,t.pos),TU(e,t.jump)},RH=j(150,e=>{ZB(e),$B(e)}),zH=(e,t)=>LU(e,t.busy),BH=(e,t)=>{KU(e,t.home),qU(e,t.raf)},VH=r(`A48`,e=>{o(e.k,`click`,function(){e.cc()}),b(e,`o`)});function HH(e){p(e,17,VU),_(e.a,`_gl`),_(e.b,`_gq`),_(e.c,`_gX`),_(e.d,`_gr`),_(e.g,aS),_(e.i,[`_gp`,`_gU`]),_(e.k,[P,`_gn`]),ke(e.l),ne(e.l,14),_(e.n,[`_o`,`_gB`,`_gV`]),_(e.o,[`_p`,`_gC`,`_gW`]),PC(e.r),lC(e.r,kW(e)),_C(e.r),vC(e.r),xC(e.r),kD(e.u),MD(e.u,OW(e)),PD(e.u,DW(e)),FD(e.u,EW(e)),_(e.v,`_gK`),_(e.a0,`_gL`),CR(e.a1),e.a2,Pz(e.a2,TW(e)),M(e,qB(e)),aH(e,null),pH(e,[]),mH(e,null),_H(e,null),vH(e,!1),yH(e,bW(e)),bH(e,!1),xH(e,Ae()),SH(e,!1),TH(e,!_e()),OH(e,{query:``,hit:null,keys:[]}),kH(e,new Set),AH(e,null),jH(e,new Set),MH(e,{sig:``,timer:0}),NH(e,{seq:0}),FH(e,{scrollToItem:CW,scrollToLine:SW,clearSelection:xW}),IH(e,{anchor:null,raf:0}),LH(e,{pos:null,jump:null}),RH(e,wW),zH(e,{busy:0}),BH(e,{home:null,raf:0}),VH(e)}var UH=C(7,(e=>`<span><!> comment<!></span><span>${e}</span>`)(oS),(e=>` D%c%l D/${e}&l`)(sS),VB),WH=j(57,e=>{_(e.e,[`_gA`,{_gz:!e.av}]),UH(e,+!e.av),HB(e)}),GH=r(`A47`,e=>{e.b0!==we(e.a5)&&pe(e.a5,e.b0)}),KH=s(63,GH),qH=l(62,e=>{pR(e.a1,e.b0),Lz(e.a2,e.b0),gV(e),KH(e),NB(e)}),JH=j(112,$),YH=j(156,e=>{uH(e),eH(e)}),XH=j(31,e=>{Yz(e.a2,e.a5),qH(e,we(e.a5)),JH(e,AW(e)),YH(e,jW(e)),CV(e),IV(e),HV(e),ZB(e),fH(e),$B(e),KH(e),$(e),GB(e)}),ZH=g(wB),QH=l(66,e=>{Xz(e.a2,e.b4),IV(e),TV(e),DV(e),MV(e),PV(e),AV(e),OV(e),$(e),ZH(e),bB(e)}),$H=j(32,e=>{QH(e,e.a6??re()),$(e)}),eU=l(67,e=>{IV(e),PV(e),AV(e),bV(e),OV(e),$(e),SB(e)}),tU=j(33,e=>{eU(e,e.a7??null),$(e)}),nU=u(70,e=>{_(e.q,[`_gy`,{_gx:!e.b8}]),cC(e.r,e.b8),wH(e),$(e),uB(e)}),rU=s(36,e=>nU(e,e.a8,e.a9)),iU=j(34,rU),aU=j(35,rU),oU=r(`A49`,e=>{e.ah&&window.addEventListener(`keydown`,t=>{!(t.metaKey||t.ctrlKey)||t.altKey||t.shiftKey||t.key.toLowerCase()===`f`&&(t.target instanceof HTMLTextAreaElement||(t.preventDefault(),e.e0()))},{capture:!0,signal:E(e,0)})}),sU=s(171,e=>{D(e,0),oU(e)}),cU=j(170,sU),lU=u(74,e=>{WC(e.r,e.bc),cU(e,MW(e))}),uU=s(39,e=>lU(e,e.ab,e.ac)),dU=j(37,uU),fU=j(38,uU),pU=j(77,IB),mU=j(78),hU=j(79,e=>{gU(e,e.bh?.key),iH(e)}),gU=j(80,mV),_U=j(85,e=>{IV(e),$(e)}),vU=j(86,e=>{DV(e),$(e)}),yU=j(88,IV),bU=j(91,e=>{CV(e),$(e)}),xU=j(93,$),SU=j(100,IV),CU=s(98,e=>jD(e.u,PW(e))),wU=j(95,e=>{SU(e,NW(e)),RV(e),BV(e),CU(e),$(e)}),TU=j(97,e=>{RV(e),CU(e),$(e)}),EU=j(40,RV),DU=j(41,e=>{IV(e),$(e)}),OU=j(42,e=>{IV(e),$(e)}),kU=j(43,e=>{DV(e),sU(e),$(e)}),AU=j(44,MV),jU=j(45,e=>{PV(e),AV(e)}),MU=j(124,e=>{Gz(e.a2,e.cq),JV(e),iH(e)}),NU=j(131,iH),PU=j(135,pB),FU=C(15,`<optgroup label=Commits></optgroup>`,` `,lB),IU=(e,t)=>FU(e,+!t),LU=j(161,eH),RU=j(46,eH),zU=C(5,(e=>`<a title="Back to terminal (⌘/Ctrl+Shift+D)">${e}</a>`)(me),(e=>` D/${e}&l`)(Ce),KB),BU=(e,t)=>zU(e,+!t),VU=h(`A42`,j(173)),HU=(e,t)=>ID(e.u,t||``),UU=(e,t)=>LD(e.u,t||``),WU=j(178,$),GU=s(177,e=>WU(e,FW(e))),KU=j(175,GU),qU=j(176,GU),JU=j(48,e=>{$(e),BB(e)}),YU=j(51,$),XU=j(52,$),ZU=e=>function(){_H(e._,null)},QU=e=>async(t,n)=>{let r=e.aw,i=e.dj(t);if(mH(e,null),!(!r||!i))try{let t=await Qe(`/api/workspaces/${e.a5}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`comment`,worktree:e.dg(i.repo),path:i.path,side:r.side,line_start:r.start,line_end:r.end,text:n.trim(),...e.dh(i,r)})});pH(e,e.at.concat(t))}catch(t){_H(e,String(t.message||t))}},$U=e=>(t,n,r)=>{let i=e.aw,a=e.dj(t),o=n.trim();if(!i||!a||!o)return Promise.resolve(!1);let s={id:-1,workspace_id:e.a5,worktree:e.dg(a.repo),path:a.path,side:i.side===`deletions`?`deletions`:`additions`,line_start:i.start,line_end:i.end,text:o,created_at:``,...e.dh(a,i)};return e.dt([s],{session:r},[])},eW=e=>(t,n)=>{let r=e.cl.find(e=>e.id===t.repo),i=$b(t,t.key),a=n.side===`deletions`?`deletions`:`additions`;return{head:r?.head,snippet:i?rx(i,a,n.start,n.end):void 0}},tW=e=>t=>e.di.get(t),nW=e=>t=>{let n=0,r=0,i=0,a=0;for(let a of e.cv)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}},rW=e=>()=>{e.ar&&lt(e.a5,e.bt)},iW=e=>()=>e.c7(e.b4,!0),aW=e=>()=>{e.bo&&clearTimeout(e.bo),e.bo=setTimeout(()=>{e.bo=0,e.ah&&!e.ay&&e.c7(e.b4,!0)},400)},oW=e=>function(t){e.ci(t)},sW=e=>(t,n=!0)=>{t!==e.b4&&(QH(e,t),n&&de(t),e.ai?.(t),e.c7(t))},cW=e=>t=>{t!==e.b5&&(eU(e,t),e.aj?.(t),e.c7(e.b4))},lW=e=>async(t=e.b4,n=!1)=>{let r=++e.bq;vH(e,!0),_H(e,null);try{let i=new URLSearchParams;t!==`committed`&&i.set(`scope`,t),n&&i.set(`refresh`,`1`),e.b5&&i.set(`rev`,e.b5);let a=await Qe(`/api/workspaces/${e.a5}/diff?${i}`);if(r!==e.bq)return;let o=a.sections,s=a;if(aH(e,o),e.b3&&!o.some(e=>e.files.some(e=>e.changedSince))&&bH(e,!1),pH(e,s.comments||[]),e.bn=Xb(o),e.af&&e.c5(e.af),e.ag)e.c4(e.ag);else if(!e.af&&!n&&e.bq===1){let n=wt(e.a5);n&&n.scope===t&&e.c2(n)}}catch(t){if(r!==e.bq)return;_H(e,String(t.message||t))}finally{r===e.bq&&vH(e,!1)}},uW=e=>function(t){e.c4(t)},dW=e=>t=>{let n=t.slice(0,t.indexOf(`/`)),r=[...e.bl].find(t=>(e.ar||[]).find(e=>e.id===t)?.worktree===n);if(r){let t=new Set(e.bl);t.delete(r),jH(e,t)}e.bx=null,e.bz=t,e.ae?.(t),e.br.scrollToItem(t)},fW=e=>t=>{let n=(e.ar||[]).find(e=>e.pr&&`${e.worktree}/${e.pr.number}`===t),r=n?.files[0];n&&r&&(e.bx=null,e.br.scrollToItem(`${n.worktree}/${r.path}`))},pW=e=>()=>{if(!e.ar)return;let t={},n={};for(let r of e.ar){t[r.id]=r.head;for(let e of r.files)e.hash&&(n[`${r.worktree}/${e.path}`]=e.hash)}fetch(`/api/workspaces/${e.a5}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`seen`,heads:t,dirty:n}),keepalive:!0}).catch(()=>{})},mW=e=>()=>e.dt(e.at,{clipboard:!0},`all`),hW=e=>t=>e.dt(e.at,{session:t},`all`),gW=e=>(t,n)=>{let r=e.at.find(e=>e.id===t);return r?e.dt([r],{session:n},[t]):Promise.resolve(!1)},_W=e=>async(t,n,r)=>{if(!t.length)return!0;e.dr++;try{let i=jx(t,e.ar);if(`clipboard`in n){if(!await ot(i))return _H(e,`Copy failed: the clipboard needs HTTPS in this browser.`),!1}else await Qe(`/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}`,...Be()||{}})}),e.ak?.(n.session);if(mH(e,null),r===`all`)pH(e,[]);else{let t=new Set(r);pH(e,e.at.filter(e=>!t.has(e.id)))}return(r===`all`||r.length)&&await e.dm(r).catch(()=>{}),!0}catch(t){return _H(e,String(t.message||t)),!1}finally{e.dr--}},vW=e=>async t=>{pH(e,e.at.filter(e=>e.id!==t)),await e.dm([t]).catch(()=>{})},yW=e=>async(t,n)=>{let r=e.at.find(e=>e.id===t);if(!r)return;let i=n.trim();if(!(!i||i===r.text)){pH(e,e.at.map(e=>e.id===t?{...e,text:i}:e));try{await Qe(`/api/workspaces/${e.a5}/review/${t}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({text:i})})}catch(n){throw pH(e,e.at.map(e=>e.id===t?r:e)),_H(e,String(n.message||n)),n}}},bW=e=>t=>{qH(e,t)};function xW(){}function SW(e,t,n){}function CW(e){}function wW(e){return e.includes(`#`)?e.split(`#`)[0]:e}var TW=e=>t=>{SH(e,t)},EW=e=>function(){qH(e,``),bH(e,!1),OH(e,{query:``,hit:null,keys:[]})},DW=e=>function(){bH(e,!e.b3)},OW=e=>function(t){AH(e,t);let n=e.cz.find(e=>e.repo===t);n&&e.c4(n.key)},kW=e=>t=>{nU(e,t)},AW=e=>async()=>{try{pH(e,(await Qe(`/api/workspaces/${e.a5}/review`)).comments||[])}catch{}},jW=e=>t=>t===`all`?fetch(`/api/workspaces/${e.a5}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`clear`})}):Promise.all(t.map(t=>fetch(`/api/workspaces/${e.a5}/review/${t}`,{method:`DELETE`}))),MW=e=>()=>{nU(e,!0),lU(e,+e.bc+1),qB(e)()},NW=e=>t=>{e.bx=t},PW=e=>function(t){let n=new Set(e.bl),r=!n.delete(t);r&&n.add(t);let i=e.cv.filter(e=>!n.has(e.repo)),a=i.findIndex(e=>e.repo===t),o=e.cv.findIndex(e=>e.repo===t),s=r?e.cv.slice(Math.max(o,0)).find(e=>!n.has(e.repo))??i[i.length-1]:i[a];jH(e,n),AH(e,t),s&&(e.bx=null,e.bz=s.key)},FW=e=>t=>{if(!_e())return;let n=e.q;if(e.e5??=n.parentElement,cancelAnimationFrame(e.e6),!t){e.e5&&n.parentElement!==e.e5&&e.e5.append(n);return}let r=0,i=()=>{let t=document.getElementById(`review-find-host`);t?n.parentElement!==t&&(t.append(n),requestAnimationFrame(()=>setTimeout(qB(e),0))):r++<20&&(e.e6=requestAnimationFrame(i))};i()};d(`A35`,ZU),d(`A20`,QU),d(`A28`,$U),d(`A18`,eW),d(`A19`,tW),d(`A16`,nW),d(`A6`,rW),d(`A10`,iW),d(`A11`,aW),d(`A0`,oW),d(`A13`,sW),d(`A14`,cW),d(`A9`,lW),d(`A36`,uW),d(`A7`,dW),d(`A8`,fW),d(`A15`,pW),d(`A25`,mW),d(`A26`,hW),d(`A27`,gW),d(`A24`,_W),d(`A22`,vW),d(`A23`,yW),d(`A1`,bW),d(`A4`,xW),d(`A3`,SW),d(`A2`,CW),d(`A17`,wW),d(`A37`,TW),d(`A34`,EW),d(`A33`,DW),d(`A31`,OW),d(`A30`,kW),d(`A12`,AW),d(`A21`,jW),d(`A29`,MW),d(`A5`,NW),d(`A32`,PW),d(`A38`,FW);export{kU as $input_active,iU as $input_findOpen,aU as $input_findOpenChange,dU as $input_findTick,fU as $input_findTickChange,OU as $input_focusFile,XU as $input_focusFileNonce,YU as $input_focusNonce,DU as $input_focusPr,BU as $input_onExit,EU as $input_onFileChange,jU as $input_onRevChange,AU as $input_onScopeChange,RU as $input_onSent,tU as $input_rev,$H as $input_scope,JU as $input_sessions,HU as $input_workspaceBranch,XH as $input_workspaceId,UU as $input_workspaceName,HH as $setup,tB as $template,nB as $walks};