getborg 0.0.118 → 0.0.124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{FetchHttpClient-C-jciW95.mjs → FetchHttpClient-DkBX_tvM.mjs} +814 -814
- package/dist/{FileSystem-NX0EtGtm.mjs → FileSystem-B8SvsKCB.mjs} +87 -18
- package/dist/{Mime-C6O17O_3.mjs → Mime-mwjBDTG5.mjs} +945 -945
- package/dist/{NodeHttpIncomingMessage-CylGKvlB.mjs → NodeHttpIncomingMessage-Caou0eJc.mjs} +3 -3
- package/dist/{NodeHttpServer-EarHJJzn.mjs → NodeHttpServer-CiwRW4qX.mjs} +7 -7
- package/dist/{NodePtyAdapter-C6ioPYk6.mjs → NodePtyAdapter-DCy0YCxP.mjs} +2 -2
- package/dist/{NodeServices-C18DO3cx.mjs → NodeServices-KA4IGVlf.mjs} +4 -4
- package/dist/{NodeSqliteClient-CWkKfsSo.mjs → NodeSqliteClient-y7W-gFvl.mjs} +3 -3
- package/dist/{NodeStream-1N7oXzTp.mjs → NodeStream-Cwt3mZYs.mjs} +2 -2
- package/dist/{SqlClient-Cusaqpaw.mjs → SqlClient-D-oF89aw.mjs} +2 -2
- package/dist/bin.mjs +27760 -18891
- package/dist/{borgTelemetryNode-CHLcRFOW.mjs → borgTelemetryNode-BTLPaUwA.mjs} +5 -5
- package/dist/client/.vite/manifest.json +396 -320
- package/dist/client/assets/{ArrowRight-CgvCTAzu.js → ArrowRight-D8u8fAtz.js} +2 -2
- package/dist/client/assets/{ArrowSquareOut-C1CwJQ7R.js → ArrowSquareOut-B_f6YUhV.js} +2 -2
- package/dist/client/assets/{ArrowsClockwise-CBwAQTtQ.js → ArrowsClockwise-DQYZ1Xbo.js} +2 -2
- package/dist/client/assets/{CaretLeft-Bk0n02vc.js → CaretLeft-CfrkuxuJ.js} +2 -2
- package/dist/client/assets/ChatMarkdown-Ch9PipMk.js +249 -0
- package/dist/client/assets/CircleNotch-BcVOnWaH.js +2 -0
- package/dist/client/assets/DesignWorkspace-CrijZIpE.js +3 -0
- package/dist/client/assets/DiffPanel-Bbs-arXF.js +2 -0
- package/dist/client/assets/DiffWorkerPoolProvider-B-AH2sbL.js +10 -0
- package/dist/client/assets/{DocxPreview-DHnzhQMX.js → DocxPreview-HXde7oD1.js} +4 -4
- package/dist/client/assets/FilePreviewPanel-DkspqFyX.js +2237 -0
- package/dist/client/assets/HtmlPreview-pfh_hRgS.js +2 -0
- package/dist/client/assets/{PdfPreview-CjWrZkCM.js → PdfPreview-VSGe6F9I.js} +3 -3
- package/dist/client/assets/PptxPreview-CZZ5e7rI.js +3 -0
- package/dist/client/assets/PreviewPanel-C_WqPJu_.js +2 -0
- package/dist/client/assets/PullRequestCodeTab-DLajHhi9.js +6 -0
- package/dist/client/assets/PullRequestReactions-BJ4eU_08.js +12 -0
- package/dist/client/assets/{RightPanelResizeHandle-DBci-Ee2.js → RightPanelResizeHandle-XlC9gY5e.js} +2 -2
- package/dist/client/assets/VirtualizedFile-qiRlyNDc.js +2 -0
- package/dist/client/assets/XlsxPreview-BPtt3tW-.js +3 -0
- package/dist/client/assets/accountData-BKyjOPQm.js +16 -0
- package/dist/client/assets/assetUrls-33nMWFnF.js +2 -0
- package/dist/client/assets/assets-1BW7ZJgz.js +2 -0
- package/dist/client/assets/{browserHistoryStore-CIr_OQCq.js → browserHistoryStore-CEVJXGfr.js} +3 -3
- package/dist/client/assets/browserRecording-BavNt16V.js +2 -0
- package/dist/client/assets/clientAnalytics-ChPHl8_D.js +1 -0
- package/dist/client/assets/clientPersistenceStorage-CeJLSpQl.js +2 -0
- package/dist/client/assets/combobox-CQHB5X6j.js +2 -0
- package/dist/client/assets/composerMentionDrag-CdTT1rUK.js +2 -0
- package/dist/client/assets/designCanvas.logic-DduGt5E7.js +8 -0
- package/dist/client/assets/{designOpenFileContext-DCJpUleA.js → designOpenFileContext-CMKir5dG.js} +2 -2
- package/dist/client/assets/{diffFileContents-CFjzWK4l.js → diffFileContents-CHRsIT6_.js} +3 -3
- package/dist/client/assets/{empty-tcpR9LH8.js → empty-DUUjhkFh.js} +2 -2
- package/dist/client/assets/entities-BtD3_L53.js +2 -0
- package/dist/client/assets/followUpQueuePersistence-C_pFQCnT.js +1 -0
- package/dist/client/assets/{index-DraeEDbf.js → index-DrITfTBh.js} +3 -3
- package/dist/client/assets/{input-BRLXkmUH.js → input-CyCAHFxI.js} +2 -2
- package/dist/client/assets/{lib-ay4Y8Jpt.js → lib-BRpsbmNP.js} +2 -2
- package/dist/client/assets/main-Bi6AoLeM.js +167 -0
- package/dist/client/assets/main-C0iNAqq8.css +2 -0
- package/dist/client/assets/{pdf-BH4RlEy2.js → pdf-C3xMIdpt.js} +2 -2
- package/dist/client/assets/popover-BXSj56CI.js +2 -0
- package/dist/client/assets/pptxDocument-BnTLF4HV.js +3 -0
- package/dist/client/assets/projectFilesQueryState-Cs5skZOc.js +2 -0
- package/dist/client/assets/queries-BevoHPqY.js +2 -0
- package/dist/client/assets/{scroll-area-j6QV0udq.js → scroll-area-DAaT-DGF.js} +36 -36
- package/dist/client/assets/session-Dmu9Hk5C.js +68 -0
- package/dist/client/assets/spinner-K3N_kbJr.js +2 -0
- package/dist/client/assets/textarea-BT0tVWKM.js +2 -0
- package/dist/client/assets/{toggle-DwBa6pBo.js → toggle-Sui8J_p3.js} +2 -2
- package/dist/client/assets/toggle-group-BDgfPfOF.js +2 -0
- package/dist/client/assets/useSettings-GEQSU1F5.js +5 -0
- package/dist/client/assets/{useWorkspaceMutationRefresh-DLI4brDf.js → useWorkspaceMutationRefresh-ApasU6PB.js} +2 -2
- package/dist/client/assets/utils-ClZ5OxbV.js +30 -0
- package/dist/client/assets/xlsxDocument-SRKfhPKH.js +2 -0
- package/dist/client/index.html +1 -1
- package/dist/service-launcher.mjs +1 -1
- package/package.json +2 -2
- package/dist/client/assets/ChatMarkdown-BhfpBJaq.js +0 -249
- package/dist/client/assets/DesignWorkspace-okkekyBu.js +0 -3
- package/dist/client/assets/DiffPanel-Dn_Or9fx.js +0 -2
- package/dist/client/assets/DiffWorkerPoolProvider-Hp3trMBG.js +0 -10
- package/dist/client/assets/FilePreviewPanel-KOVwBhPe.js +0 -2231
- package/dist/client/assets/HtmlPreview-I3xV5YgS.js +0 -2
- package/dist/client/assets/PptxPreview-D4YsFq_s.js +0 -3
- package/dist/client/assets/PreviewPanel-CKieJ-9L.js +0 -2
- package/dist/client/assets/PullRequestCodeTab-DbUx3FWB.js +0 -6
- package/dist/client/assets/PullRequestReactions-BSI_Qt4L.js +0 -12
- package/dist/client/assets/VirtualizedFile-VSzhLWFM.js +0 -2
- package/dist/client/assets/XlsxPreview-BnnrdNes.js +0 -3
- package/dist/client/assets/accountData-C4ZvicpJ.js +0 -16
- package/dist/client/assets/assetUrls-C2vkiSgX.js +0 -2
- package/dist/client/assets/browserRecording-BmG6q-H4.js +0 -2
- package/dist/client/assets/clientPersistenceStorage-BlYjZvCd.js +0 -2
- package/dist/client/assets/combobox-uXzVxkLc.js +0 -2
- package/dist/client/assets/composerMentionDrag-DTGN7WcV.js +0 -2
- package/dist/client/assets/designCanvas.logic-DtK3Ht6X.js +0 -8
- package/dist/client/assets/entities-Da-AvwsX.js +0 -2
- package/dist/client/assets/main-Bn8Ylf8R.js +0 -161
- package/dist/client/assets/main-YscGsfgO.css +0 -2
- package/dist/client/assets/popover-DTprsoPQ.js +0 -2
- package/dist/client/assets/pptxDocument-ifTk53yH.js +0 -3
- package/dist/client/assets/projectFilesQueryState-CD_JXBj5.js +0 -2
- package/dist/client/assets/queries-D1AwaR_5.js +0 -2
- package/dist/client/assets/session-BaysTZDD.js +0 -67
- package/dist/client/assets/spinner-DHhZaoFg.js +0 -2
- package/dist/client/assets/textarea-BB3euU4O.js +0 -5
- package/dist/client/assets/toggle-group-BU7-0DcW.js +0 -2
- package/dist/client/assets/utils-DgzD4MA_.js +0 -30
- package/dist/client/assets/xlsxDocument-DwhEMpfP.js +0 -2
|
@@ -1,2231 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PdfPreview-CjWrZkCM.js","assets/rolldown-runtime-DAXXjFlN.js","assets/index-DraeEDbf.js","assets/index-DZprGaeP.css","assets/accountData-C4ZvicpJ.js","assets/utils-DgzD4MA_.js","assets/CaretLeft-Bk0n02vc.js","assets/spinner-DHhZaoFg.js","assets/DocxPreview-DHnzhQMX.js","assets/lib-BpnzBIoA.js","assets/documentBytes-CS3KpytE.js","assets/zipGuard-BHHl8sLU.js","assets/lib-CCiVGdun.js","assets/XlsxPreview-BnnrdNes.js","assets/PptxPreview-D4YsFq_s.js","assets/HtmlPreview-I3xV5YgS.js","assets/session-BaysTZDD.js","assets/assetUrls-C2vkiSgX.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{t}from"./index-DraeEDbf.js";import{Ha as n,_ as r,v as i,y as a}from"./accountData-C4ZvicpJ.js";import{B as o,Bo as s,P as c,So as l,dn as u,t as d,wo as f}from"./utils-DgzD4MA_.js";import{Wt as p,Zt as m}from"./session-BaysTZDD.js";import{o as h}from"./designOpenFileContext-DCJpUleA.js";import{Ct as g,Hn as _,L as v,P as y,V as b,c as x,f as S,g as C,ir as ee,l as w,o as T,u as E,x as te}from"./textarea-BB3euU4O.js";import{a as D,l as O,n as k,o as A,r as j,s as M,t as N,u as ne}from"./empty-tcpR9LH8.js";import{An as re,Er as ie,G as ae,H as oe,Hn as se,It as ce,Jn as le,Mn as ue,Mt as de,Nn as fe,Nr as pe,Nt as me,Ot as he,Pn as ge,Pr as _e,St as ve,U as P,V as ye,kn as be,kt as xe,mr as Se,t as Ce,ur as we,vt as Te,yt as F}from"./scroll-area-j6QV0udq.js";import{At as Ee,Bt as De,Jt as Oe,Mt as ke,Nt as Ae,Ot as je,Rt as Me,jt as Ne,n as Pe}from"./ChatMarkdown-BhfpBJaq.js";import{t as Fe}from"./toggle-DwBa6pBo.js";import{G as Ie,J as Le,K as Re,X as ze,Y as Be,Z as Ve,c as He,l as Ue,n as We,o as Ge,q as Ke,t as qe}from"./composerMentionDrag-DTGN7WcV.js";import{D as Je,x as Ye}from"./browserHistoryStore-CIr_OQCq.js";import{n as Xe}from"./useWorkspaceMutationRefresh-DLI4brDf.js";import{i as Ze,n as Qe,r as $e,t as et}from"./fileCommentAnnotations-BgdL_7u9.js";import{i as tt,n as nt,r as rt,t as it}from"./VirtualizedFile-VSzhLWFM.js";import{a as at,o as ot,r as st}from"./assetUrls-C2vkiSgX.js";import{a as ct,c as I,n as L,o as lt,t as ut}from"./projectFilesQueryState-CD_JXBj5.js";import{t as dt}from"./spinner-DHhZaoFg.js";var R=e(a(),1),ft=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M84,224a12,12,0,0,1-12,12H56a20,20,0,0,1-20-20V184a12,12,0,0,1,24,0v28H72A12,12,0,0,1,84,224ZM220,88v48a12,12,0,0,1-24,0V104H148a12,12,0,0,1-12-12V44H120a12,12,0,0,1,0-24h32a12,12,0,0,1,8.49,3.51l56,56A12,12,0,0,1,220,88Zm-60-8h23L160,57ZM80,20H56A20,20,0,0,0,36,40V64a12,12,0,0,0,24,0V44H80a12,12,0,0,0,0-24ZM208,164a12,12,0,0,0-12,12v36h-4a12,12,0,0,0,0,24h8a20,20,0,0,0,20-20V176A12,12,0,0,0,208,164ZM48,156a12,12,0,0,0,12-12V104a12,12,0,0,0-24,0v40A12,12,0,0,0,48,156Zm104,56H112a12,12,0,0,0,0,24h40a12,12,0,0,0,0-24Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M208,88H152V32Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M80,224a8,8,0,0,1-8,8H56a16,16,0,0,1-16-16V184a8,8,0,0,1,16,0v32H72A8,8,0,0,1,80,224ZM216,88v48a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H120a8,8,0,0,1,0-16h32a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-56-8h28.69L160,51.31ZM80,24H56A16,16,0,0,0,40,40V64a8,8,0,0,0,16,0V40H80a8,8,0,0,0,0-16ZM208,168a8,8,0,0,0-8,8v40h-8a8,8,0,0,0,0,16h8a16,16,0,0,0,16-16V176A8,8,0,0,0,208,168ZM48,152a8,8,0,0,0,8-8V104a8,8,0,0,0-16,0v40A8,8,0,0,0,48,152Zm104,64H112a8,8,0,0,0,0,16h40a8,8,0,0,0,0-16Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M80,224a8,8,0,0,1-8,8H56a16,16,0,0,1-16-16V184a8,8,0,0,1,16,0v32H72A8,8,0,0,1,80,224ZM213.66,82.34l-56-56A8,8,0,0,0,152,24H120a8,8,0,0,0,0,16h24V88a8,8,0,0,0,8,8h48v40a8,8,0,0,0,16,0V88A8,8,0,0,0,213.66,82.34ZM80,24H56A16,16,0,0,0,40,40V64a8,8,0,0,0,16,0V40H80a8,8,0,0,0,0-16ZM208,168a8,8,0,0,0-8,8v40h-8a8,8,0,0,0,0,16h8a16,16,0,0,0,16-16V176A8,8,0,0,0,208,168ZM48,152a8,8,0,0,0,8-8V104a8,8,0,0,0-16,0v40A8,8,0,0,0,48,152Zm104,64H112a8,8,0,0,0,0,16h40a8,8,0,0,0,0-16Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M78,224a6,6,0,0,1-6,6H56a14,14,0,0,1-14-14V184a6,6,0,0,1,12,0v32a2,2,0,0,0,2,2H72A6,6,0,0,1,78,224ZM214,88v48a6,6,0,0,1-12,0V94H152a6,6,0,0,1-6-6V38H120a6,6,0,0,1,0-12h32a6,6,0,0,1,4.24,1.76l56,56A6,6,0,0,1,214,88Zm-56-6h35.51L158,46.49ZM80,26H56A14,14,0,0,0,42,40V64a6,6,0,0,0,12,0V40a2,2,0,0,1,2-2H80a6,6,0,0,0,0-12ZM208,170a6,6,0,0,0-6,6v40a2,2,0,0,1-2,2h-8a6,6,0,0,0,0,12h8a14,14,0,0,0,14-14V176A6,6,0,0,0,208,170ZM48,150a6,6,0,0,0,6-6V104a6,6,0,0,0-12,0v40A6,6,0,0,0,48,150Zm104,68H112a6,6,0,0,0,0,12h40a6,6,0,0,0,0-12Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M80,224a8,8,0,0,1-8,8H56a16,16,0,0,1-16-16V184a8,8,0,0,1,16,0v32H72A8,8,0,0,1,80,224ZM216,88v48a8,8,0,0,1-16,0V96H152a8,8,0,0,1-8-8V40H120a8,8,0,0,1,0-16h32a8,8,0,0,1,5.66,2.34l56,56A8,8,0,0,1,216,88Zm-56-8h28.69L160,51.31ZM80,24H56A16,16,0,0,0,40,40V64a8,8,0,0,0,16,0V40H80a8,8,0,0,0,0-16ZM208,168a8,8,0,0,0-8,8v40h-8a8,8,0,0,0,0,16h8a16,16,0,0,0,16-16V176A8,8,0,0,0,208,168ZM48,152a8,8,0,0,0,8-8V104a8,8,0,0,0-16,0v40A8,8,0,0,0,48,152Zm104,64H112a8,8,0,0,0,0,16h40a8,8,0,0,0,0-16Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M76,224a4,4,0,0,1-4,4H56a12,12,0,0,1-12-12V184a4,4,0,0,1,8,0v32a4,4,0,0,0,4,4H72A4,4,0,0,1,76,224ZM212,88v48a4,4,0,0,1-8,0V92H152a4,4,0,0,1-4-4V36H120a4,4,0,0,1,0-8h32a4,4,0,0,1,2.83,1.17l56,56A4,4,0,0,1,212,88Zm-56-4h42.34L156,41.66ZM80,28H56A12,12,0,0,0,44,40V64a4,4,0,0,0,8,0V40a4,4,0,0,1,4-4H80a4,4,0,0,0,0-8ZM208,172a4,4,0,0,0-4,4v40a4,4,0,0,1-4,4h-8a4,4,0,0,0,0,8h8a12,12,0,0,0,12-12V176A4,4,0,0,0,208,172ZM48,148a4,4,0,0,0,4-4V104a4,4,0,0,0-8,0v40A4,4,0,0,0,48,148Zm104,72H112a4,4,0,0,0,0,8h40a4,4,0,0,0,0-8Z`}))]]),pt=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M176,156h32a20,20,0,0,0,20-20V104a20,20,0,0,0-20-20H176a20,20,0,0,0-20,20v4H92V84h4a20,20,0,0,0,20-20V32A20,20,0,0,0,96,12H64A20,20,0,0,0,44,32V64A20,20,0,0,0,64,84h4V192a28,28,0,0,0,28,28h60v4a20,20,0,0,0,20,20h32a20,20,0,0,0,20-20V192a20,20,0,0,0-20-20H176a20,20,0,0,0-20,20v4H96a4,4,0,0,1-4-4V132h64v4A20,20,0,0,0,176,156ZM68,36H92V60H68ZM180,196h24v24H180Zm0-88h24v24H180Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M104,32V64a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V32a8,8,0,0,1,8-8H96A8,8,0,0,1,104,32ZM208,96H176a8,8,0,0,0-8,8v32a8,8,0,0,0,8,8h32a8,8,0,0,0,8-8V104A8,8,0,0,0,208,96Zm0,88H176a8,8,0,0,0-8,8v32a8,8,0,0,0,8,8h32a8,8,0,0,0,8-8V192A8,8,0,0,0,208,184Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M176,152h32a16,16,0,0,0,16-16V104a16,16,0,0,0-16-16H176a16,16,0,0,0-16,16v8H88V80h8a16,16,0,0,0,16-16V32A16,16,0,0,0,96,16H64A16,16,0,0,0,48,32V64A16,16,0,0,0,64,80h8V192a24,24,0,0,0,24,24h64v8a16,16,0,0,0,16,16h32a16,16,0,0,0,16-16V192a16,16,0,0,0-16-16H176a16,16,0,0,0-16,16v8H96a8,8,0,0,1-8-8V128h72v8A16,16,0,0,0,176,152ZM64,32H96V64H64ZM176,192h32v32H176Zm0-88h32v32H176Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M160,136v-8H88v64a8,8,0,0,0,8,8h64v-8a16,16,0,0,1,16-16h32a16,16,0,0,1,16,16v32a16,16,0,0,1-16,16H176a16,16,0,0,1-16-16v-8H96a24,24,0,0,1-24-24V80H64A16,16,0,0,1,48,64V32A16,16,0,0,1,64,16H96a16,16,0,0,1,16,16V64A16,16,0,0,1,96,80H88v32h72v-8a16,16,0,0,1,16-16h32a16,16,0,0,1,16,16v32a16,16,0,0,1-16,16H176A16,16,0,0,1,160,136Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M176,150h32a14,14,0,0,0,14-14V104a14,14,0,0,0-14-14H176a14,14,0,0,0-14,14v10H86V78H96a14,14,0,0,0,14-14V32A14,14,0,0,0,96,18H64A14,14,0,0,0,50,32V64A14,14,0,0,0,64,78H74V192a22,22,0,0,0,22,22h66v10a14,14,0,0,0,14,14h32a14,14,0,0,0,14-14V192a14,14,0,0,0-14-14H176a14,14,0,0,0-14,14v10H96a10,10,0,0,1-10-10V126h76v10A14,14,0,0,0,176,150ZM62,64V32a2,2,0,0,1,2-2H96a2,2,0,0,1,2,2V64a2,2,0,0,1-2,2H64A2,2,0,0,1,62,64ZM174,192a2,2,0,0,1,2-2h32a2,2,0,0,1,2,2v32a2,2,0,0,1-2,2H176a2,2,0,0,1-2-2Zm0-88a2,2,0,0,1,2-2h32a2,2,0,0,1,2,2v32a2,2,0,0,1-2,2H176a2,2,0,0,1-2-2Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M176,152h32a16,16,0,0,0,16-16V104a16,16,0,0,0-16-16H176a16,16,0,0,0-16,16v8H88V80h8a16,16,0,0,0,16-16V32A16,16,0,0,0,96,16H64A16,16,0,0,0,48,32V64A16,16,0,0,0,64,80h8V192a24,24,0,0,0,24,24h64v8a16,16,0,0,0,16,16h32a16,16,0,0,0,16-16V192a16,16,0,0,0-16-16H176a16,16,0,0,0-16,16v8H96a8,8,0,0,1-8-8V128h72v8A16,16,0,0,0,176,152ZM64,32H96V64H64ZM176,192h32v32H176Zm0-88h32v32H176Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M176,148h32a12,12,0,0,0,12-12V104a12,12,0,0,0-12-12H176a12,12,0,0,0-12,12v12H84V76H96a12,12,0,0,0,12-12V32A12,12,0,0,0,96,20H64A12,12,0,0,0,52,32V64A12,12,0,0,0,64,76H76V192a20,20,0,0,0,20,20h68v12a12,12,0,0,0,12,12h32a12,12,0,0,0,12-12V192a12,12,0,0,0-12-12H176a12,12,0,0,0-12,12v12H96a12,12,0,0,1-12-12V124h80v12A12,12,0,0,0,176,148ZM60,64V32a4,4,0,0,1,4-4H96a4,4,0,0,1,4,4V64a4,4,0,0,1-4,4H64A4,4,0,0,1,60,64ZM172,192a4,4,0,0,1,4-4h32a4,4,0,0,1,4,4v32a4,4,0,0,1-4,4H176a4,4,0,0,1-4-4Zm0-88a4,4,0,0,1,4-4h32a4,4,0,0,1,4,4v32a4,4,0,0,1-4,4H176a4,4,0,0,1-4-4Z`}))]]),mt=Object.defineProperty,ht=Object.defineProperties,gt=Object.getOwnPropertyDescriptors,z=Object.getOwnPropertySymbols,_t=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable,vt=(e,t,n)=>t in e?mt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yt=(e,t)=>{for(var n in t||={})_t.call(t,n)&&vt(e,n,t[n]);if(z)for(var n of z(t))B.call(t,n)&&vt(e,n,t[n]);return e},bt=(e,t)=>ht(e,gt(t)),xt=(0,R.forwardRef)((e,t)=>R.createElement(f,bt(yt({ref:t},e),{weights:ft})));xt.displayName=`FileDashed`;var St=Object.defineProperty,Ct=Object.defineProperties,wt=Object.getOwnPropertyDescriptors,Tt=Object.getOwnPropertySymbols,Et=Object.prototype.hasOwnProperty,Dt=Object.prototype.propertyIsEnumerable,Ot=(e,t,n)=>t in e?St(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,kt=(e,t)=>{for(var n in t||={})Et.call(t,n)&&Ot(e,n,t[n]);if(Tt)for(var n of Tt(t))Dt.call(t,n)&&Ot(e,n,t[n]);return e},At=(e,t)=>Ct(e,wt(t)),jt=(0,R.forwardRef)((e,t)=>R.createElement(f,At(kt({ref:t},e),{weights:pt})));jt.displayName=`TreeView`;var Mt=typeof window>`u`?R.useEffect:R.useLayoutEffect;function Nt({file:e,options:t,lineAnnotations:n,selectedLines:r,prerenderedHTML:i,metrics:a,hasGutterRenderUtility:o,hasCustomHeader:s,disableWorkerPool:c,contentEditable:l}){let u=Re(),d=r!==void 0,f=(0,R.useContext)(ae),p=Be(),m=(0,R.useRef)(null),h=de(r=>{if(r!=null){if(m.current!=null)throw Error(`File: An instance should not already exist when a node is created`);u==null?m.current=new nt(Pt({controlledSelection:d,contentEditable:l,hasCustomHeader:s,hasEditor:p!==void 0,hasGutterRenderUtility:o,options:t}),c?void 0:f,!0):m.current=new it(Pt({controlledSelection:d,contentEditable:l,hasCustomHeader:s,hasEditor:p!==void 0,hasGutterRenderUtility:o,options:t}),u,a,c?void 0:f,!0),m.current.hydrate({file:e,fileContainer:r,lineAnnotations:n,prerenderedHTML:i})}else{if(m.current==null)throw Error(`File: A File instance should exist when unmounting`);m.current.cleanUp(),m.current=null}});return Mt(()=>{if(m.current==null)return;let i=Pt({controlledSelection:d,contentEditable:l,hasCustomHeader:s,hasEditor:p!==void 0,hasGutterRenderUtility:o,options:t}),a=!P(m.current.options,i);m.current.setOptions(i),m.current.render({file:e,lineAnnotations:n,forceRender:a}),r!==void 0&&m.current.setSelectedLines(r)}),Mt(()=>{if(l&&m.current!=null){if(p===void 0)throw Error(`File: Editor is not attached`);return p.edit(m.current)}},[l,p]),{ref:h,getHoveredLine:(0,R.useCallback)(()=>m.current?.getHoveredLine(),[])}}function Pt({options:e,controlledSelection:t,contentEditable:n,hasCustomHeader:r,hasEditor:i,hasGutterRenderUtility:a}){let o=n&&i,s=t||a||r;if(!s&&!o)return e;let c={...e};return s&&(c={...c,controlledSelection:t,renderCustomHeader:r?ce:e?.renderCustomHeader,renderGutterUtility:a?ce:e?.renderGutterUtility}),o&&(c={...c,useTokenTransformer:!0}),c}var V=s();function Ft({file:e,lineAnnotations:t,selectedLines:n,options:r,metrics:i,className:a,style:o,renderAnnotation:s,renderCustomHeader:c,renderHeaderPrefix:l,renderHeaderFilenameSuffix:u,renderHeaderMetadata:d,prerenderedHTML:f,renderGutterUtility:p,disableWorkerPool:m=!1,contentEditable:h=!1}){let{ref:g,getHoveredLine:_}=Nt({file:e,options:r,metrics:i,lineAnnotations:t,selectedLines:n,prerenderedHTML:f,hasGutterRenderUtility:p!=null,hasCustomHeader:c!=null,disableWorkerPool:m,contentEditable:h});return(0,V.jsx)(Se,{ref:g,className:a,style:o,children:Ke(rt({file:e,renderAnnotation:s,renderCustomHeader:c,renderHeaderPrefix:l,renderHeaderFilenameSuffix:u,renderHeaderMetadata:d,renderGutterUtility:p,lineAnnotations:t,getHoveredLine:_}),f)})}var It=100,Lt=class{#e=[];#t=[];#n;constructor(e){this.#n=Math.max(1,e?.maxEntries??It)}get canUndo(){return this.#e.length>0}get canRedo(){return this.#t.length>0}clear(){this.#e.length=0,this.#t.length=0}clearRedo(){this.#t.length=0}push(e){this.#e.push(e),this.clearRedo(),this.#e.length>this.#n&&this.#e.shift()}setLastUndoSelectionsAfter(e){let t=this.#e[this.#e.length-1];t!==void 0&&(t.selectionsAfter=e.map(e=>({...e})))}setLastUndoLineAnnotations(e,t){let n=this.#e[this.#e.length-1];n!==void 0&&(n.lineAnnotationsBefore=e.slice(),n.lineAnnotationsAfter=t.slice())}peekUndo(){return this.#e[this.#e.length-1]}replaceLastUndo(e){if(this.#e.length===0){this.push(e);return}this.#e[this.#e.length-1]=e,this.clearRedo()}popUndoToRedo(){let e=this.#e.pop();if(e!==void 0)return this.#t.push(e),e}popRedoToUndo(){let e=this.#t.pop();if(e!==void 0)return this.#e.push(e),e}};function Rt(e,t,n,r,i,a,o,s){let c=[...t].sort((e,t)=>e.start-t.start),l=[];for(let t=0,n=0;t<c.length;t++){let r=c[t],i=e.getTextSlice(r.start,r.end),a=r.start+n;l.push({start:a,end:a+r.text.length,text:i}),n+=r.text.length-(r.end-r.start)}return{forwardEdits:c.map(e=>({...e})),inverseEdits:l,versionBefore:n,versionAfter:r,selectionsBefore:i?.map(e=>({...e})),selectionsAfter:a?.map(e=>({...e})),lineAnnotationsBefore:o?.slice(),lineAnnotationsAfter:s?.slice()}}function zt(e,t){if(e===void 0||e.undoBoundary===!0||t.undoBoundary===!0||e.forwardEdits.length===0||e.forwardEdits.length!==e.inverseEdits.length||e.forwardEdits.length!==t.forwardEdits.length||t.forwardEdits.length!==t.inverseEdits.length)return!1;let n;for(let r=0;r<e.forwardEdits.length;r++){let i=e.forwardEdits[r],a=e.inverseEdits[r],o=t.forwardEdits[r],s=t.inverseEdits[r],c=Ht(o.start,e.forwardEdits),l=i.start<=i.end&&i.text.length>0&&!i.text.includes(`
|
|
3
|
-
`)&&!a.text.includes(`
|
|
4
|
-
`),u=o.start===o.end&&o.text.length>0&&!o.text.includes(`
|
|
5
|
-
`)&&s.text.length===0;if(l&&u){if(o.start!==a.end||(n??=`insert`,n!==`insert`))return!1;continue}let d=i.text.length===0&&i.end>i.start&&a.text.length>0,f=o.text.length===0&&o.end>o.start&&s.text.length>0;if(d&&f){if(c===i.end){if(n??=`delete`,n!==`delete`)return!1;continue}if(c+(o.end-o.start)!==i.start||(n??=`backspace`,n!==`backspace`))return!1;continue}return!1}return n!==void 0}function Bt(e,t){let n=[],r=[];for(let i=0;i<e.forwardEdits.length;i++){let a=e.forwardEdits[i],o=e.inverseEdits[i],s=t.forwardEdits[i],c=t.inverseEdits[i],l=Ht(s.start,e.forwardEdits);if(a.text.length>0){n.push({start:a.start,end:a.end,text:a.text+s.text}),r.push(o.text);continue}if(l===a.end){n.push({start:a.start,end:l+(s.end-s.start),text:``}),r.push(o.text+c.text);continue}n.push({start:Math.min(a.start,l),end:a.end,text:``}),r.push(c.text+o.text)}return{forwardEdits:n,inverseEdits:Vt(n,r),versionBefore:e.versionBefore,versionAfter:t.versionAfter,selectionsBefore:e.selectionsBefore?.slice(),selectionsAfter:t.selectionsAfter?.slice(),lineAnnotationsBefore:e.lineAnnotationsBefore?.slice(),lineAnnotationsAfter:t.lineAnnotationsAfter?.slice()}}function Vt(e,t){let n=[];for(let r=0,i=0;r<e.length;r++){let a=e[r],o=a.start+i;n.push({start:o,end:o+a.text.length,text:t[r]}),i+=a.text.length-(a.end-a.start)}return n}function Ht(e,t){let n=e;for(let e of t){let t=e.end-e.start,r=e.text.length,i=r-t;if(!(n<e.start)){if(n>=e.start+r){n-=i;continue}n=e.start+Math.min(n-e.start,t)}}return n}var Ut=1e5,Wt=10,Gt=13,Kt=`\`~!@#$%^&*()-=+[{]}\\|;:'",.<>/?`,qt=class{source;offset;length;lineOffsetStart;lineOffsetEnd;hasVirtualTrailingCRBreak;firstCharCode;lastCharCode;static Original=0;static Added=1;constructor(e,t,n,r,i,a,o,s){this.source=e,this.offset=t,this.length=n,this.lineOffsetStart=r,this.lineOffsetEnd=i,this.hasVirtualTrailingCRBreak=a,this.firstCharCode=o,this.lastCharCode=s}get lineBreakCount(){return this.lineOffsetEnd-this.lineOffsetStart+ +!!this.hasVirtualTrailingCRBreak}},Jt=class{text;lineOffsets;constructor(e){this.text=e,this.lineOffsets=Te(e)}append(e){let t=this.text.length,n=Te(e);for(let e=1;e<n.length;e++)this.lineOffsets.push(t+n[e]);return this.text+=e,t}},Yt=class{piece;subtreeLength;subtreeLineBreakCount;subtreeFirstCharCode;subtreeLastCharCode;left=null;right=null;parent=null;priority=0;constructor(e,t=e.length,n=e.lineBreakCount,r=e.firstCharCode,i=e.lastCharCode){this.piece=e,this.subtreeLength=t,this.subtreeLineBreakCount=n,this.subtreeFirstCharCode=r,this.subtreeLastCharCode=i}updateSubtreeLength(){this.subtreeLength=(this.left?.subtreeLength??0)+this.piece.length+(this.right?.subtreeLength??0),this.subtreeLineBreakCount=(this.left?.subtreeLineBreakCount??0)+this.piece.lineBreakCount+(this.right?.subtreeLineBreakCount??0)-+!!an(this.left?.subtreeLastCharCode,this.piece.firstCharCode)-!!an(this.piece.lastCharCode,this.right?.subtreeFirstCharCode),this.subtreeFirstCharCode=this.left?.subtreeFirstCharCode??this.piece.firstCharCode,this.subtreeLastCharCode=this.right?.subtreeLastCharCode??this.piece.lastCharCode}},Xt=class{#e;#t=new Jt(``);#n=null;#r=0;#i=0;#a=null;#o=null;#s=2654435769;constructor(e){this.#e=new Jt(e);let t=this.#v(qt.Original,0,e.length);this.#n=t.length>0?this.#x(t):null,this.#r=this.#n?.subtreeLength??0,this.#i=(this.#n?.subtreeLineBreakCount??0)+1}get lineCount(){return this.#i}getText(e){if(e===void 0)return this.#h();let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this.getTextSlice(t,n)}getLineText(e,t=!1){if(this.#a!==null&&this.#a[0]===e&&this.#a[1]===t)return this.#a[2];let n=this.#d(e);if(n===void 0)throw Error(`Line index out of range: ${e}`);let r=this.getTextSlice(n[0],n[1],!t);return this.#a=[e,t,r],this.#o=[e,t,r.length],r}getLineLength(e,t=!1){let n=this.#o,r=this.#a;if(n!==null&&n[0]===e&&n[1]===t)return n[2];if(r!==null&&r[0]===e&&r[1]===t){let n=r[2].length;return this.#o=[e,t,n],n}let i=this.#d(e);if(i===void 0)throw Error(`Line index out of range: ${e}`);let[a,o]=i,s=o-a;if(!t)for(;s>0&&Zt(this.charAt(a+s-1).charCodeAt(0));)s--;return this.#o=[e,t,s],s}getTextSlice(e,t,n=!1){if(e>=t)return``;let r=Qt(e,0,this.#r),i=Qt(t,r,this.#r);if(r>=i)return``;let a=this.#l(r);if(a===void 0)return``;let o=[],[s,c]=a,l=i-r;for(;s!==null&&l>0;){let e=Math.min(s.piece.length-c,l),t=this.#_(s.piece.source),r=s.piece.offset+c,i=r+e;if(n)for(;i>r&&Zt(t.text.charCodeAt(i-1));)i--;o.push(t.text.slice(r,i)),l-=e,c=0,s=this.#u(s)}return o.join(``)}charAt(e){let t=this.#l(e);if(t===void 0)return``;let[n,r]=t;return this.#_(n.piece.source).text.charAt(n.piece.offset+r)}includes(e){if(e.length===0)return!0;let t=$t(e),n=0,r=!1;return this.#g(i=>{for(let a=i.start;a<i.end;a++){let o=i.text.charCodeAt(a);for(;n>0&&o!==e.charCodeAt(n);)n=t[n-1];if(o===e.charCodeAt(n)&&n++,n===e.length)return r=!0,!1}return!0}),r}findNextNonOverlappingSubstring(e,t){if(e.length===0||e.length>this.#r)return;let n=en(t,this.#r),r=n.reduce((e,[,t])=>Math.max(e,t),0),i=$t(e),a=0,o=0,s,c;return this.#g(t=>{for(let l=t.start;l<t.end;l++){let u=t.text.charCodeAt(l);for(;a>0&&u!==e.charCodeAt(a);)a=i[a-1];if(u===e.charCodeAt(a)&&a++,a===e.length){let t=o-e.length+1;if(!tn(n,t,t+e.length)){if(t>=r)return c=t,!1;s??=t}a=i[a-1]}o++}return!0}),c??s}search(e){if(e.text.length===0||this.#r===0||e.text.includes(`
|
|
6
|
-
`)||e.text.includes(`\r`)||e.regex&&(e.text.includes(`\\n`)||e.text.includes(`\\r`)))return[];let t;try{t=dn(e.text,e.regex,e.caseSensitive)}catch{return[]}return this.#c(t,e.wholeWord,Ut)}#c(e,t,n){let r=[],i=this.#r,a=e=>this.charAt(e);for(let o=0;o<this.#i;o++){let s=this.getLineText(o),c=this.offsetAt({line:o,character:0});e.lastIndex=0;let l;for(;(l=e.exec(s))!==null;){let o=l.index,u=l[0];if(u.length===0){e.lastIndex=mn(s,o);continue}let d=c+o;if((!t||ln(d,u.length,i,a))&&(r.push([d,d+u.length]),r.length>=n))return r;o===e.lastIndex&&(e.lastIndex=mn(s,o))}}return r}insert(e,t){if(e.length===0)return;let n=Qt(t,0,this.#r);this.#y(n,n,e)}delete(e,t){if(t<=0||this.#r===0)return;let n=Qt(e,0,this.#r),r=Qt(n+t,n,this.#r);n!==r&&this.#y(n,r,``)}applyEdits(e){if(e.length!==0)for(let t=e.length-1;t>=0;t--){let n=e[t],r=Qt(n.start,0,this.#r),i=Qt(n.end,r,this.#r);this.#y(r,i,n.text)}}positionAt(e){let t=Qt(e,0,this.#r);if(this.#r===0)return{line:0,character:0};let n=this.#f(t);return{line:n,character:t-(n===0?0:this.#p(n-1))}}positionsAt(e){let t=Array.from({length:e.length});if(e.length===0)return t;if(this.#r===0)return t.fill({line:0,character:0});for(let n=0;n<e.length;n++)t[n]=this.positionAt(e[n]);return t}offsetAt(e){if(e.line<0||this.#r===0)return 0;if(e.line>=this.#i)throw Error(`Line index out of range: ${e.line}`);let t=this.#d(e.line);if(t===void 0)throw Error(`Line index out of range: ${e.line}`);let n=Qt(e.character,0,t[1]-t[0]);return t[0]+n}#l(e){if(e<0||e>=this.#r)return;let t=this.#n,n=e;for(;t!==null;){let e=t.left?.subtreeLength??0;if(n<e){t=t.left;continue}if(n-=e,n<t.piece.length)return[t,n];n-=t.piece.length,t=t.right}}#u(e){if(e.right!==null){let t=e.right;for(;t.left!==null;)t=t.left;return t}let t=e;for(;t.parent!==null&&t===t.parent.right;)t=t.parent;return t.parent}#d(e){if(e<0)throw Error(`Line index out of range: ${e}`);if(this.#r===0){if(e===0)return[0,0];throw Error(`Line index out of range: ${e}`)}if(e>=this.#i)throw Error(`Line index out of range: ${e}`);return[e===0?0:this.#p(e-1),e<this.#i-1?this.#p(e):this.#r]}#f(e){let t=this.#n,n=Qt(e,0,this.#r),r=0;for(;t!==null;){let e=t.left?.subtreeLength??0;if(n<e){t=t.left;continue}if(r+=(t.left?.subtreeLineBreakCount??0)-+!!an(t.left?.subtreeLastCharCode,t.piece.firstCharCode),n-=e,n<=t.piece.length){let e=this.#_(t.piece.source),i=Math.min(on(e.lineOffsets,t.piece.offset+n),t.piece.lineOffsetEnd);return r+=i-t.piece.lineOffsetStart,n===t.piece.length&&t.piece.hasVirtualTrailingCRBreak&&r++,n===t.piece.length&&an(t.piece.lastCharCode,this.#u(t)?.piece.firstCharCode)&&r--,r}r+=t.piece.lineBreakCount-+!!an(t.piece.lastCharCode,t.right?.subtreeFirstCharCode),n-=t.piece.length,t=t.right}return this.#i-1}#p(e){let t=this.#n,n=e,r=0,i;for(;t!==null;){let e=(t.left?.subtreeLineBreakCount??0)-+!!an(t.left?.subtreeLastCharCode,t.piece.firstCharCode);if(n<e){i=t.piece.firstCharCode,t=t.left;continue}let a=t.left?.subtreeLength??0;r+=a,n-=e;let o=t.right?.subtreeFirstCharCode??i,s=t.piece.lineBreakCount-+!!an(t.piece.lastCharCode,o);if(n<s)return r+this.#m(t.piece,n);r+=t.piece.length,n-=s,t=t.right}return this.#r}#m(e,t){return t<e.lineOffsetEnd-e.lineOffsetStart?this.#_(e.source).lineOffsets[e.lineOffsetStart+t]-e.offset:e.length}#h(){let e=[];return this.#g(t=>{e.push(t.text.slice(t.start,t.end))}),e.join(``)}#g(e){this.#O(this.#n,t=>{let n=this.#_(t.piece.source);return e({text:n.text,lineOffsets:n.lineOffsets,lineOffsetStart:t.piece.lineOffsetStart,lineOffsetEnd:t.piece.lineOffsetEnd,start:t.piece.offset,end:t.piece.offset+t.piece.length})})}#_(e){return e===qt.Original?this.#e:this.#t}#v(e,t,n){let r=this.#_(e),i=t+n,a=on(r.lineOffsets,t),o=on(r.lineOffsets,i),s=r.text.charCodeAt(i-1);return new qt(e,t,n,a,o,s===Gt&&r.lineOffsets[o-1]!==i,r.text.charCodeAt(t),s)}#y(e,t,n){if(e===t&&n.length===0)return;let[r,i]=this.#w(this.#n,e),[,a]=this.#w(i,t-e),o;if(n.length>0){let e=this.#v(qt.Added,this.#t.append(n),n.length);o=this.#T(this.#E(r,e),a)}else{let[e,t]=this.#D(a);o=e===void 0?r:this.#T(this.#E(r,e),t)}o!==null&&(o.parent=null),this.#n=o,this.#r=o?.subtreeLength??0,this.#i=(o?.subtreeLineBreakCount??0)+1,this.#a=null,this.#o=null}#b(){return this.#s=Math.imul(this.#s,1664525)+1013904223>>>0,this.#s}#x(e){let t=new Yt(e);return t.priority=this.#b(),t}#S(e,t){e.left=t,t!==null&&(t.parent=e)}#C(e,t){e.right=t,t!==null&&(t.parent=e)}#w(e,t){if(e===null)return[null,null];let n=e.left?.subtreeLength??0;if(t<=n){let[n,r]=this.#w(e.left,t);return this.#S(e,r),e.updateSubtreeLength(),[n,e]}let r=e.piece.length;if(t>=n+r){let[i,a]=this.#w(e.right,t-n-r);return this.#C(e,i),e.updateSubtreeLength(),[e,a]}let i=t-n,a=new Yt(this.#v(e.piece.source,e.piece.offset,i)),o=new Yt(this.#v(e.piece.source,e.piece.offset+i,r-i));return a.priority=e.priority,o.priority=e.priority,this.#S(a,e.left),this.#C(o,e.right),a.updateSubtreeLength(),o.updateSubtreeLength(),[a,o]}#T(e,t){return e===null?t:t===null?e:e.priority>=t.priority?(this.#C(e,this.#T(e.right,t)),e.updateSubtreeLength(),e):(this.#S(t,this.#T(e,t.left)),t.updateSubtreeLength(),t)}#E(e,t){if(e===null)return this.#x(t);let n=e;for(;n.right!==null;)n=n.right;if(nn(n.piece,t)){n.piece=rn(n.piece,t);for(let t=n;t!==null&&(t.updateSubtreeLength(),t!==e);)t=t.parent;return e}return this.#T(e,this.#x(t))}#D(e){if(e===null)return[void 0,null];if(e.left===null)return[e.piece,e.right];let[t,n]=this.#D(e.left);return this.#S(e,n),e.updateSubtreeLength(),[t,e]}#O(e,t){return e===null?!0:!this.#O(e.left,t)||t(e)===!1?!1:this.#O(e.right,t)}};function Zt(e){return e===10||e===13}function Qt(e,t,n){return Math.min(Math.max(e,t),n)}function $t(e){let t=Array.from({length:e.length}).fill(0),n=0;for(let r=1;r<e.length;r++){let i=e.charCodeAt(r);for(;n>0&&i!==e.charCodeAt(n);)n=t[n-1];i===e.charCodeAt(n)&&n++,t[r]=n}return t}function en(e,t){let n=[];for(let[r,i]of e){let e=Qt(r,0,t),a=Qt(i,e,t);e<a&&n.push([e,a])}n.sort((e,t)=>e[0]-t[0]);let r=[];for(let e of n){let t=r[r.length-1];if(t!==void 0&&e[0]<=t[1]){t[1]=Math.max(t[1],e[1]);continue}r.push(e)}return r}function tn(e,t,n){let r=0,i=e.length;for(;r<i;){let n=r+Math.floor((i-r)/2);e[n][1]<=t?r=n+1:i=n}let a=e[r];return a!==void 0&&a[0]<n}function nn(e,t){return e.source===t.source&&e.offset+e.length===t.offset&&!an(e.lastCharCode,t.firstCharCode)}function rn(e,t){return new qt(e.source,e.offset,e.length+t.length,e.lineOffsetStart,t.lineOffsetEnd,t.hasVirtualTrailingCRBreak,e.firstCharCode,t.lastCharCode)}function an(e,t){return e===Gt&&t===Wt}function on(e,t){let n=0,r=e.length;for(;n<r;){let i=n+Math.floor((r-n)/2);e[i]<=t?n=i+1:r=i}return n}function sn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function cn(e){if(e<=32||e===127)return!0;let t=String.fromCharCode(e);return Kt.includes(t)}function ln(e,t,n,r){let i=e<=0||cn(un(r,e-1)),a=e+t>=n||cn(un(r,e+t));return i&&a}function un(e,t){let n=e(t);return n.length===0?0:n.charCodeAt(0)}function dn(e,t,n){let r=t?e:sn(e);return new RegExp(r,`g${n?``:`i`}${t?`m`:``}`)}function fn(e,t){return e.replace(/\$([$&]|\d+)/g,(e,n)=>n===`$`?`$`:n===`&`?t[0]??``:t[Number(n)]??``)}function pn(e,t,n,r,i,a){if(!r.regex)return r.replaceText;let o=e(i),s=n(o.line),c=i-t({line:o.line,character:0}),l;try{l=dn(r.text,!0,r.caseSensitive)}catch{return r.replaceText}l.lastIndex=c;let u=l.exec(s);return u===null||u.index!==c||u[0].length!==a-i?r.replaceText:fn(r.replaceText,u)}function mn(e,t){if(t+1<e.length){let n=e.charCodeAt(t),r=e.charCodeAt(t+1);if(n>=55296&&n<=56319&&r>=56320&&r<=57343)return t+2}return t+1}var hn=class e{#e;#t;#n;#r;#i;#a;constructor(e,t,n=`text`,r=0,i=new Lt){this.#e=new URL(e,`file://`).toString(),this.#t=n,this.#n=r,this.#r=new Xt(t),this.#i=i;let a=this.#r.getLineText(0,!0);a.endsWith(`\r
|
|
7
|
-
`)?this.#a=`\r
|
|
8
|
-
`:a.endsWith(`\r`)?this.#a=`\r`:this.#a=`
|
|
9
|
-
`}get uri(){return this.#e}get languageId(){return this.#t}get version(){return this.#n}get lineCount(){return this.#r.lineCount}get eol(){return this.#a}get canUndo(){return this.#i.canUndo}get canRedo(){return this.#i.canRedo}positionAt(e){return this.normalizePosition(this.#r.positionAt(e))}positionsAt(e){let t=this.#r.positionsAt(e);for(let e=0;e<t.length;e++)t[e]=this.normalizePosition(t[e]);return t}offsetAt(e){return this.#r.offsetAt(this.normalizePosition(e))}getText(e){return e===void 0?this.#r.getText():this.#r.getText({start:this.normalizePosition(e.start),end:this.normalizePosition(e.end)})}getLineText(e,t){return this.#r.getLineText(e,t)}normalizeEol(e){return e.replace(/\r\n|\r|\n/g,this.eol)}getLineLength(e,t){return this.#r.getLineLength(e,t)}charAt(e){return typeof e==`number`?this.#r.charAt(e):this.#r.charAt(this.offsetAt(e))}getTextSlice(e,t){return this.#r.getTextSlice(e,t)}findNextNonOverlappingSubstring(e,t){return this.#r.findNextNonOverlappingSubstring(e,t)}search(e){return this.#r.search(e)}applyEdits(e,t=!0,n,r,i=!1){if(e.length!==0)return this.#o(this.#d(this.resolveEdits(e)),t,n,r,i)}resolveEdits(e){return e.map(e=>this.#c(e))}applyResolvedEdits(e,t=!0,n,r,i=!1){if(e.length!==0)return this.#o(this.#d(e.map(e=>this.#l(e))),t,n,r,i)}#o(e,t,n,r,i){let a=Rt(this,e,this.#n,this.#n+1,t?n:void 0,t?r:void 0);t&&i&&(a.undoBoundary=!0);let o=this.#i.peekUndo(),s=this.#f(e);return this.#n++,s.lineDelta===0&&zt(o,a)?this.#i.replaceLastUndo(Bt(o,a)):this.#i.push(a),s}setLastUndoSelectionsAfter(e){this.#i.setLastUndoSelectionsAfter(e)}setLastUndoLineAnnotations(e,t){this.#i.setLastUndoLineAnnotations(e,t)}undo(){let e=this.#i.popUndoToRedo();if(e===void 0)return;let t=this.#f(e.inverseEdits);if(t===void 0)return;this.#n=e.versionBefore;let n=e.selectionsBefore?.slice();return[t,n,e.lineAnnotationsBefore?.slice(),n===void 0?e.inverseEdits.map(e=>({...e})):void 0]}redo(){let e=this.#i.popRedoToUndo();if(e===void 0)return;let t=this.#f(e.forwardEdits);if(t===void 0)return;this.#n=e.versionAfter;let n=e.selectionsAfter?.slice();return[t,n,e.lineAnnotationsAfter?.slice(),n===void 0?e.forwardEdits.map(e=>({...e})):void 0]}normalizePosition(t){let n=e.#s(t.line,this.lineCount-1);return{line:n,character:e.#s(t.character,this.getLineLength(n))}}static#s(e,t){return Number.isNaN(e)?0:Math.max(0,Math.min(Math.floor(e),t))}#c(e){let t=this.offsetAt(e.range.start),n=this.offsetAt(e.range.end);if(t>n){let e=t;t=n,n=e}return this.#l({start:t,end:n,text:e.newText})}#l(e){let{start:t,end:n}=e,r=t===n;return this.#u(t)&&t--,r?n=t:this.#u(n)&&n++,{start:t,end:n,text:e.text}}#u(e){let t=this.#r.charAt(e-1).charCodeAt(0),n=this.#r.charAt(e).charCodeAt(0);return t>=55296&&t<=56319&&n>=56320&&n<=57343}#d(e){let t=[...e].sort((e,t)=>{let n=e.start-t.start;return n===0?e.end-t.end:n});for(let e=0;e<t.length-1;e++)if(t[e].end>t[e+1].start)throw Error(`Overlapping text edits are not supported`);return t}#f(e){let t=this.#r.lineCount,n=this.positionsAt(e.flatMap(e=>[e.start,e.end])),r=this.#p(e,n),i=n[0],a=n[n.length-1],o=a.line===t-1&&a.character===this.#r.getLineLength(a.line);this.#r.applyEdits(e);let s=this.#r.lineCount;return{startLine:r.startLine,startCharacter:i.character,endCharacter:a.character,endLine:Math.min(r.endLine,Math.max(0,s-1)),endedAtDocumentEnd:o,previousLineCount:t,lineCount:s,lineDelta:s-t,changedLineRanges:r.ranges,changedLineChanges:r.changes}}#p(e,t){let n=1/0,r=0,i=0,a=[],o=[],s=this.#r.lineCount-1,c=this.#r.getLineLength(s);for(let l=0;l<e.length;l++){let u=e[l],d=t[l*2],f=t[l*2+1],p=d.line,m=f.line,h=F(u.text),g=p+i,_=g+h,v=h-(m-p);n=Math.min(n,p),r=Math.max(r,_);let y=a[a.length-1];y!==void 0&&g<=y[1]+1?a[a.length-1]=[y[0],Math.max(y[1],_)]:a.push([g,_]),o.push([g,_,v,d.character,f.character,m===s&&f.character===c]),i+=v}return n===1/0?{startLine:0,endLine:0,ranges:[[0,0]],changes:[[0,0,0,0,0,!1]]}:{startLine:n,endLine:r,ranges:a,changes:o}}},gn=void 0,_n=void 0;function vn(){return gn??=/macOS|MacIntel|iPhone|iPad|iPod/i.test(Sn())}function yn(){return _n??=`safari`in window&&`pushNotification`in window.safari||/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function bn({metaKey:e,ctrlKey:t},n=vn()){return n?e&&!t:t&&!e}function xn(e){if(vn()&&e.ctrlKey&&!e.altKey&&!e.metaKey)switch(e.key){case`a`:return`start`;case`e`:return`end`;case`p`:return`up`;case`n`:return`down`;case`f`:return`right`;case`b`:return`left`}if(!e.altKey&&!e.ctrlKey&&!e.metaKey){if(e.key===`ArrowUp`)return`up`;if(e.key===`ArrowDown`)return`down`;if(e.key===`ArrowLeft`)return`left`;if(e.key===`ArrowRight`)return`right`;if(e.key===`Home`)return`start`;if(e.key===`End`)return`end`}if(bn(e)){if(e.key===`ArrowLeft`)return`textStart`;if(e.key===`ArrowRight`)return`end`}}function Sn(){let e=globalThis.navigator;return e?.platform??e?.userAgentData?.platform??`unknown`}var Cn={a:`selectAll`,d:`findNextMatch`};function wn(e,t=vn()){let n=bn(e,t),{shiftKey:r,altKey:i,key:a}=e,o=a.length===1?a.toLowerCase():a;if(t&&e.ctrlKey&&!e.metaKey&&!r&&!i&&(o===`k`||e.code===`KeyK`))return`deleteHardLineForward`;if(!e.metaKey&&!e.ctrlKey&&r&&i&&(o===`a`||e.code===`KeyA`))return`toggleBlockComment`;if(!e.metaKey&&!e.ctrlKey&&r&&i){if(o===`ArrowUp`)return`copyLineUp`;if(o===`ArrowDown`)return`copyLineDown`}if(!e.metaKey&&!e.ctrlKey&&!r&&!i&&o===`Escape`)return`simplifySelection`;if(!e.metaKey&&!r){if(!e.ctrlKey&&i&&o===`ArrowUp`)return`moveLineUp`;if(!e.ctrlKey&&i&&o===`ArrowDown`)return`moveLineDown`;if((t||navigator.platform.includes(`Linux`))&&e.ctrlKey&&i){if(o===`p`||e.code===`KeyP`)return`moveLineUp`;if(o===`n`||e.code===`KeyN`)return`moveLineDown`}}if(n&&(o===`f`||e.code===`KeyF`))return i?`openSearchReplacePanel`:`openSearchPanel`;if(!i){if(!n&&o===`Tab`)return r?`outdent`:`indent`;if(n)return!r&&o===`Enter`?`insertBlankLine`:!r&&(o===`/`||e.code===`Slash`)?`toggleComment`:!r&&o===`[`?`indentLess`:!r&&o===`]`?`indentMore`:o===`z`?r?`redo`:`undo`:!t&&o===`y`?`redo`:o===`Home`||t&&o===`ArrowUp`?r?`expandSelectionDocStart`:`moveCursorToDocStart`:o===`End`||t&&o===`ArrowDown`?r?`expandSelectionDocEnd`:`moveCursorToDocEnd`:Cn[o]}}function Tn(e,t=vn()){if(!e.altKey&&bn(e,t)&&((e.key.length===1?e.key.toLowerCase():e.key)===`g`||e.code===`KeyG`))return e.shiftKey?`previous`:`next`}var En=`::selection {
|
|
10
|
-
background-color: #0000;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
[data-deleted-text-selection] [data-deletions] ::selection, [data-deleted-text-selection] [data-line-type="change-deletion"] ::selection {
|
|
14
|
-
background-color: var(--diffs-editor-selection-bg);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
@keyframes blinking {
|
|
18
|
-
0% {
|
|
19
|
-
opacity: 1;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
50% {
|
|
23
|
-
opacity: 0;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
100% {
|
|
27
|
-
opacity: 1;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
:host, [data-code], [data-content], [data-diff-type="split"][data-overflow="wrap"] {
|
|
32
|
-
position: relative;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
[data-code] {
|
|
36
|
-
container-type: inline-size;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
[data-content] {
|
|
40
|
-
cursor: text;
|
|
41
|
-
caret-color: var(--diffs-bg-caret);
|
|
42
|
-
background-color: #0000;
|
|
43
|
-
outline: none;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
[data-line] {
|
|
47
|
-
cursor: text;
|
|
48
|
-
background-color: #0000;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
[data-line]:after {
|
|
52
|
-
content: "";
|
|
53
|
-
z-index: -20;
|
|
54
|
-
background-color: var(--diffs-line-bg);
|
|
55
|
-
pointer-events: none;
|
|
56
|
-
position: absolute;
|
|
57
|
-
inset: 0;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
[data-line][data-selected-line]:after {
|
|
61
|
-
background-color: var(--diffs-computed-diff-line-bg, var(--diffs-bg));
|
|
62
|
-
background-image: linear-gradient(var(--diffs-editor-line-highlight-bg),
|
|
63
|
-
var(--diffs-editor-line-highlight-bg));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
[data-editor-overlay] {
|
|
67
|
-
display: contents;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
[data-caret], [data-selection-range], [data-match-range], [data-bracket-match-range], [data-marker-range] {
|
|
71
|
-
height: 1lh;
|
|
72
|
-
line-height: var(--diffs-line-height);
|
|
73
|
-
pointer-events: none;
|
|
74
|
-
position: absolute;
|
|
75
|
-
top: 0;
|
|
76
|
-
left: 0;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
[data-caret] {
|
|
80
|
-
background-color: var(--diffs-bg-caret-override, var(--diffs-editor-cursor-fg, light-dark(color-mix(in lab, var(--diffs-fg) 50%, var(--diffs-bg)), color-mix(in lab, var(--diffs-fg) 75%, var(--diffs-bg)))));
|
|
81
|
-
visibility: hidden;
|
|
82
|
-
width: 2px;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
86
|
-
[data-caret] {
|
|
87
|
-
animation: 1.2s .8s infinite blinking;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
[data-selection-range] {
|
|
92
|
-
z-index: -10;
|
|
93
|
-
background-color: var(--diffs-editor-selection-bg);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
[data-selection-corner] {
|
|
97
|
-
background-color: var(--diffs-selection-corner-bg, var(--diffs-bg));
|
|
98
|
-
width: 100%;
|
|
99
|
-
height: 100%;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
[data-match-range] {
|
|
103
|
-
z-index: -10;
|
|
104
|
-
background-color: var(--diffs-editor-match-bg, var(--diffs-editor-selection-bg));
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
[data-match-range]:not([data-focus]) {
|
|
108
|
-
background-color: var(--diffs-editor-match-highlight-bg, light-dark(#ff963288, #ff963266));
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
[data-bracket-match-range] {
|
|
112
|
-
z-index: -9;
|
|
113
|
-
box-sizing: border-box;
|
|
114
|
-
border-bottom: 1px solid
|
|
115
|
-
var(--diffs-editor-bracket-match-border, color-mix(in lab, var(--diffs-fg) 60%, transparent));
|
|
116
|
-
background-color: var(--diffs-editor-bracket-match-bg, color-mix(in lab, var(--diffs-fg) 5%, transparent));
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
[data-rtl] {
|
|
120
|
-
border-top-left-radius: 3px;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
[data-rtr] {
|
|
124
|
-
border-top-right-radius: 3px;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
[data-rbl] {
|
|
128
|
-
border-bottom-left-radius: 3px;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
[data-rbr] {
|
|
132
|
-
border-bottom-right-radius: 3px;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
[data-marker-range] {
|
|
136
|
-
z-index: 1;
|
|
137
|
-
background-color: var(--diffs-marker-bg);
|
|
138
|
-
mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2IiBoZWlnaHQ9IjMiPjxwYXRoIGQ9Im0wIDIuNSBsMiAtMS41IGwxIDAgbDIgMS41IGwxIDAiIHN0cm9rZT0iI2ZmZiIgZmlsbD0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIi8+PC9zdmc+");
|
|
139
|
-
mask-position: 0 100%;
|
|
140
|
-
mask-size: 6px 3px;
|
|
141
|
-
mask-repeat: repeat-x;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
[data-marker-error] {
|
|
145
|
-
--diffs-marker-contrast: #fff;
|
|
146
|
-
--diffs-marker-bg: var(--diffs-editor-error-fg, var(--diffs-deletion-base));
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
[data-marker-warning] {
|
|
150
|
-
--diffs-marker-contrast: #000;
|
|
151
|
-
--diffs-marker-bg: var(--diffs-editor-warning-fg, light-dark(var(--diffs-warning-light), var(--diffs-warning-dark)));
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
[data-marker-info] {
|
|
155
|
-
--diffs-marker-contrast: #fff;
|
|
156
|
-
--diffs-marker-bg: var(--diffs-editor-info-fg, var(--diffs-modified-base));
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
[data-marker-hint] {
|
|
160
|
-
--diffs-marker-contrast: light-dark(#fff, #000);
|
|
161
|
-
--diffs-marker-bg: var(--diffs-editor-hint-fg, var(--diffs-fg-number));
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
@media (width >= 480px) {
|
|
165
|
-
[data-content] {
|
|
166
|
-
caret-color: #0000;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
[data-content]:focus ~ [data-editor-overlay] [data-caret] {
|
|
170
|
-
visibility: visible;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
[data-editor-widget] {
|
|
175
|
-
--diffs-widget-fg: var(--diffs-fg);
|
|
176
|
-
--diffs-widget-bg: color-mix(in lab, var(--diffs-fg) 4%, var(--diffs-bg));
|
|
177
|
-
--diffs-widget-border: color-mix(in lab, var(--diffs-fg) 20%, transparent);
|
|
178
|
-
--diffs-widget-shadow: inset 0 0 0 1px var(--diffs-bg), 0 4px 8px #00000013,
|
|
179
|
-
0 6px 18px #00000013;
|
|
180
|
-
z-index: 100;
|
|
181
|
-
width: fit-content;
|
|
182
|
-
max-width: calc(100% - 24px);
|
|
183
|
-
font: 14px/20px var(--diffs-header-font-fallback);
|
|
184
|
-
border: 1px solid var(--diffs-widget-border);
|
|
185
|
-
background-color: var(--diffs-widget-bg);
|
|
186
|
-
box-shadow: var(--diffs-widget-shadow);
|
|
187
|
-
background-clip: padding-box;
|
|
188
|
-
border-radius: 9px;
|
|
189
|
-
position: absolute;
|
|
190
|
-
top: 0;
|
|
191
|
-
left: 0;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
[data-marker-popup], [data-selection-action-popover] {
|
|
195
|
-
--popover-viewport-left: 0px;
|
|
196
|
-
--popover-viewport-right: 100cqw;
|
|
197
|
-
--popover-min-left: calc(var(--popover-viewport-left) + var(--gutter-width, 0px) + 8px);
|
|
198
|
-
--popover-available-width: max(0px,
|
|
199
|
-
calc(var(--popover-viewport-right) - var(--popover-min-left) - 8px));
|
|
200
|
-
max-width: min(640px, var(--popover-available-width));
|
|
201
|
-
translate: clamp(var(--popover-min-left),
|
|
202
|
-
var(--popover-x, var(--popover-min-left)),
|
|
203
|
-
calc(var(--popover-viewport-right) - 8px - 100%))
|
|
204
|
-
calc(var(--popover-y, 0px) + var(--popover-y-shift, 0px));
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
[data-marker-popup] {
|
|
208
|
-
--diffs-widget-bg: var(--diffs-marker-bg);
|
|
209
|
-
--diffs-widget-shadow: 0 4px 8px #00000026, 0 6px 18px #00000026;
|
|
210
|
-
min-width: min(180px, var(--popover-available-width));
|
|
211
|
-
overflow-wrap: anywhere;
|
|
212
|
-
color: var(--diffs-marker-contrast, contrast-color(#fff, #000));
|
|
213
|
-
white-space: normal;
|
|
214
|
-
pointer-events: auto;
|
|
215
|
-
border: 0;
|
|
216
|
-
padding: 8px 12px;
|
|
217
|
-
|
|
218
|
-
& [data-marker-message] {
|
|
219
|
-
white-space: normal;
|
|
220
|
-
overflow-wrap: anywhere;
|
|
221
|
-
|
|
222
|
-
& code {
|
|
223
|
-
white-space: normal;
|
|
224
|
-
color: inherit;
|
|
225
|
-
background-color: #0000;
|
|
226
|
-
display: inline;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
[data-selection-action-popover] {
|
|
232
|
-
pointer-events: auto;
|
|
233
|
-
flex-wrap: wrap;
|
|
234
|
-
align-items: center;
|
|
235
|
-
gap: 4px;
|
|
236
|
-
width: max-content;
|
|
237
|
-
padding: 4px;
|
|
238
|
-
display: flex;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
[data-search-panel] {
|
|
242
|
-
z-index: 100;
|
|
243
|
-
flex-direction: column;
|
|
244
|
-
justify-content: right;
|
|
245
|
-
width: 100%;
|
|
246
|
-
height: 0;
|
|
247
|
-
display: flex;
|
|
248
|
-
position: sticky;
|
|
249
|
-
top: 16px;
|
|
250
|
-
right: 16px;
|
|
251
|
-
container: search-panel / inline-size;
|
|
252
|
-
|
|
253
|
-
& [data-editor-widget] {
|
|
254
|
-
z-index: 100;
|
|
255
|
-
flex-shrink: 0;
|
|
256
|
-
align-items: stretch;
|
|
257
|
-
gap: 8px;
|
|
258
|
-
min-width: 260px;
|
|
259
|
-
max-width: 100%;
|
|
260
|
-
margin-inline: auto 16px;
|
|
261
|
-
padding: 4px;
|
|
262
|
-
display: flex;
|
|
263
|
-
position: relative;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
& svg {
|
|
267
|
-
fill: currentColor;
|
|
268
|
-
width: 12px;
|
|
269
|
-
height: 12px;
|
|
270
|
-
display: block;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
[data-search-grid] {
|
|
275
|
-
grid-template-columns: auto auto auto;
|
|
276
|
-
grid-template-areas: "find matches nav"
|
|
277
|
-
"replace actions .";
|
|
278
|
-
align-items: center;
|
|
279
|
-
gap: 4px 6px;
|
|
280
|
-
width: 100%;
|
|
281
|
-
display: grid;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
[data-input-box][data-find] {
|
|
285
|
-
grid-area: find;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
[data-search-nav] {
|
|
289
|
-
grid-area: nav;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
[data-input-box][data-replace] {
|
|
293
|
-
grid-area: replace;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
[data-replace-actions] {
|
|
297
|
-
grid-area: actions;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
[data-search-grid][data-mode="find"] {
|
|
301
|
-
grid-template-areas: "find matches nav";
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
[data-search-grid][data-mode="find"] [data-replace-cell] {
|
|
305
|
-
display: none;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
@container search-panel (width < 400px) {
|
|
309
|
-
[data-search-panel] [data-editor-widget] {
|
|
310
|
-
padding: 10px;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
[data-search-grid][data-mode="replace"] {
|
|
314
|
-
grid-template-columns: auto 1fr auto;
|
|
315
|
-
grid-template-areas: "find find find"
|
|
316
|
-
"replace replace replace"
|
|
317
|
-
"nav matches actions";
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
[data-search-grid][data-mode="find"] {
|
|
321
|
-
grid-template-columns: auto 1fr auto;
|
|
322
|
-
grid-template-areas: "find find find"
|
|
323
|
-
"nav matches matches";
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
[data-replace-actions] {
|
|
327
|
-
justify-self: end;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
[data-search-grid] [data-input-box] {
|
|
331
|
-
width: auto;
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
[data-input-box] {
|
|
336
|
-
align-items: center;
|
|
337
|
-
width: 200px;
|
|
338
|
-
display: flex;
|
|
339
|
-
position: relative;
|
|
340
|
-
|
|
341
|
-
& input {
|
|
342
|
-
width: 100%;
|
|
343
|
-
min-width: 0;
|
|
344
|
-
color: var(--diffs-fg);
|
|
345
|
-
background-color: var(--diffs-bg);
|
|
346
|
-
border: 1px solid color-mix(in lab, var(--diffs-fg) 12%, var(--diffs-bg));
|
|
347
|
-
border-radius: 6px;
|
|
348
|
-
outline: none;
|
|
349
|
-
flex-grow: 1;
|
|
350
|
-
padding-inline: 6px;
|
|
351
|
-
font-size: 13px;
|
|
352
|
-
line-height: 24px;
|
|
353
|
-
|
|
354
|
-
&::selection {
|
|
355
|
-
background-color: color-mix(in lab, var(--diffs-fg) 8%, var(--diffs-bg));
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
&:focus-visible {
|
|
359
|
-
outline: 1px solid var(--diffs-modified-base);
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
&[data-find] input {
|
|
364
|
-
padding-inline-end: 72px;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
& [data-search-icon] {
|
|
368
|
-
--diffs-search-icon-size: 20px;
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
[data-search-toggles] {
|
|
373
|
-
align-items: center;
|
|
374
|
-
gap: 1px;
|
|
375
|
-
display: flex;
|
|
376
|
-
position: absolute;
|
|
377
|
-
top: 50%;
|
|
378
|
-
right: 4px;
|
|
379
|
-
transform: translateY(-50%);
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
[data-matches] {
|
|
383
|
-
white-space: nowrap;
|
|
384
|
-
min-width: 50px;
|
|
385
|
-
color: color-mix(in lab, var(--diffs-fg) 50%, var(--diffs-bg));
|
|
386
|
-
flex-shrink: 0;
|
|
387
|
-
grid-area: matches;
|
|
388
|
-
font-size: 12px;
|
|
389
|
-
font-weight: 500;
|
|
390
|
-
line-height: 20px;
|
|
391
|
-
|
|
392
|
-
&[data-no-matches] {
|
|
393
|
-
color: color-mix(in lab, var(--diffs-fg) 35%, var(--diffs-bg));
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
[data-replace-actions], [data-search-nav] {
|
|
398
|
-
align-items: center;
|
|
399
|
-
display: flex;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
[data-search-icon] {
|
|
403
|
-
appearance: none;
|
|
404
|
-
width: var(--diffs-search-icon-size, 24px);
|
|
405
|
-
height: var(--diffs-search-icon-size, 24px);
|
|
406
|
-
color: color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg));
|
|
407
|
-
border-radius: var(--diffs-search-icon-radius, 4px);
|
|
408
|
-
cursor: pointer;
|
|
409
|
-
background: none;
|
|
410
|
-
border: 0;
|
|
411
|
-
flex-shrink: 0;
|
|
412
|
-
justify-content: center;
|
|
413
|
-
align-items: center;
|
|
414
|
-
margin: 0;
|
|
415
|
-
padding: 0;
|
|
416
|
-
transition: background-color .1s ease-in-out, color .1s ease-in-out;
|
|
417
|
-
display: flex;
|
|
418
|
-
|
|
419
|
-
&:disabled {
|
|
420
|
-
opacity: .25;
|
|
421
|
-
cursor: default;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
&:not(:disabled):hover {
|
|
425
|
-
color: var(--diffs-fg);
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
&:focus-visible {
|
|
429
|
-
outline: 1px solid var(--diffs-modified-base);
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
&[aria-pressed="true"] {
|
|
433
|
-
color: var(--diffs-modified-base);
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
[data-search-close] {
|
|
438
|
-
--diffs-search-icon-size: 20px;
|
|
439
|
-
--diffs-search-icon-radius: 50%;
|
|
440
|
-
color: var(--diffs-widget-bg);
|
|
441
|
-
background-color: color-mix(in lab,
|
|
442
|
-
var(--diffs-widget-fg) 50%,
|
|
443
|
-
var(--diffs-bg));
|
|
444
|
-
position: absolute;
|
|
445
|
-
top: 0;
|
|
446
|
-
right: 0;
|
|
447
|
-
transform: translate(50%, -50%);
|
|
448
|
-
|
|
449
|
-
&:not(:disabled):hover {
|
|
450
|
-
opacity: 1;
|
|
451
|
-
color: var(--diffs-widget-bg);
|
|
452
|
-
background-color: var(--diffs-widget-fg);
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
`,Dn=`//`,On=[`/*`,`*/`],kn={sql:{lineComment:`--`},ruby:{lineComment:`#`,blockComment:[`=begin`,`=end`]},rst:{lineComment:`..`},coffeescript:{lineComment:`#`,blockComment:[`###`,`###`]},cmd:{lineComment:`@REM`},julia:{lineComment:`#`,blockComment:[`#=`,`=#`]},yaml:{lineComment:`#`},yml:{lineComment:`#`},markdown:{lineComment:null,blockComment:[`<!--`,`-->`]},zsh:{lineComment:`#`},makefile:{lineComment:`#`},handlebars:{lineComment:null,blockComment:[`{{!--`,`--}}`]},ini:{lineComment:`;`,blockComment:[`;`,` `]},powershell:{lineComment:`#`,blockComment:[`<#`,`#>`]},vb:{lineComment:`'`},xml:{lineComment:null,blockComment:[`<!--`,`-->`]},lua:{lineComment:`--`,blockComment:[`--[[`,`]]`]},html:{lineComment:null,blockComment:[`<!--`,`-->`]},diff:{lineComment:`#`,blockComment:[`#`,` `]},r:{lineComment:`#`},fsharp:{blockComment:[`(*`,`*)`]},pug:{lineComment:`//-`},perl:{lineComment:`#`},tex:{lineComment:`%`},clojure:{lineComment:`;;`},css:{lineComment:null},python:{lineComment:`#`,blockComment:[`"""`,`"""`]},dotenv:{lineComment:`#`},dockerfile:{lineComment:`#`},razor:{lineComment:null,blockComment:[`<!--`,`-->`]},prompt:{lineComment:null,blockComment:[`<!--`,`-->`]}};function An(e,t){let n={...kn[e],...t?.[e]};return{lineComment:n.lineComment===void 0?Dn:n.lineComment,blockComment:n.blockComment??On}}function jn(e,t,n){let r=[],i=new Set;for(let a of t){let t=a.end.line;a.start.line<t&&a.end.character===0&&t--;let o=r.length,s=1/0;for(let o=a.start.line;o<=t;o++){if(i.has(o))continue;i.add(o);let t=e.getLineText(o),a=t.length-t.trimStart().length,c=a===t.length;c||(s=Math.min(s,a)),r.push({line:o,comment:t.slice(a,a+n.length)===n?a:-1,empty:c,indent:a,single:!1})}if(s!==1/0)for(let e=o;e<r.length;e++)r[e].empty||(r[e].indent=s);r.length===o+1&&(r[o].single=!0)}let a=r.some(e=>e.comment<0&&(!e.empty||e.single)),o=[];if(a){for(let e of r){if(e.empty&&!e.single)continue;let t={line:e.line,character:e.indent};o.push({range:{start:t,end:t},newText:n+` `})}return o}for(let t of r){if(t.comment<0)continue;let r=e.getLineText(t.line),i=t.comment,a=i+n.length+ +(r[i+n.length]===` `);o.push({range:{start:{line:t.line,character:i},end:{line:t.line,character:a}},newText:``})}return o}var Mn=50;function Nn(e,t,n,r,i){let a=Math.max(0,r-Mn),o=e.getTextSlice(a,r),s=e.getTextSlice(i,i+Mn),c=o.length-o.trimEnd().length,l=s.length-s.trimStart().length,u=o.length-c;if(o.slice(u-t.length,u)===t&&s.slice(l,l+n.length)===n)return{open:{start:r-c-t.length,end:r-c+ +(c>0),text:``},close:{start:i+l-+(l>0),end:i+l+n.length,text:``},contentStart:r,contentEnd:i};let d=i-r<=Mn*2?e.getTextSlice(r,i):void 0,f=d??e.getTextSlice(r,r+Mn),p=d??e.getTextSlice(i-Mn,i),m=f.length-f.trimStart().length,h=i-(p.length-p.trimEnd().length)-n.length;if(f.slice(m,m+t.length)!==t||e.getTextSlice(h,h+n.length)!==n)return;let g=r+m,_=g+t.length+ +!!/\s/.test(f[t.length+m]??``),v=h-+!!/\s/.test(e.getTextSlice(h-1,h));return{open:{start:g,end:_,text:``},close:{start:v,end:h+n.length,text:``},contentStart:_,contentEnd:v}}function Pn(e,t,n,r){let i=0,a=t.length;for(;i<a;){let n=i+a>>>1;t[n].end<e?i=n+1:a=n}let o=n[i];for(let n=i;n<t.length;n++){let i=t[n];if(e<i.start)break;if(i.start===i.end&&e===i.start){if(r<0)break;o+=i.text.length;continue}if(e>i.end){o+=i.text.length-(i.end-i.start);continue}return e===i.end?i.start+o+i.text.length:i.start+o+(r>0?i.text.length:0)}return e+o}function Fn(e,t,[n,r],i=!1){let a=t.map(t=>{let{start:n,end:r}=t;if(i){let t=r.line;n.line<t&&r.character===0&&t--;let i=e.getLineText(n.line),a=i.length-i.trimStart().length;n={line:n.line,character:a},r={line:t,character:e.getLineLength(t)}}return{from:e.offsetAt(n),to:e.offsetAt(r),direction:t.direction,comment:void 0}});if(i&&a.length>1){a.sort((e,t)=>{let n=e.from-t.from;return n===0?e.to-t.to:n});let e=0;for(let t=1;t<a.length;t++){let n=a[e],r=a[t];r.from<=n.to?n.to=Math.max(n.to,r.to):a[++e]=r}a.length=e+1}for(let t of a)t.comment=Nn(e,n,r,t.from,t.to);let o=a.every(e=>e.comment!==void 0),s=[];for(let e of a){let t=e.comment;if(o&&t!==void 0){s.push(t.open,t.close);continue}if(t===void 0){if(e.from===e.to){s.push({start:e.from,end:e.to,text:n+` `+r});continue}s.push({start:e.from,end:e.from,text:n+` `},{start:e.to,end:e.to,text:` `+r})}}if(s.length===0)return;s.sort((e,t)=>{let n=e.start-t.start;return n===0?e.end-t.end:n});let c=s.map(t=>({range:{start:e.positionAt(t.start),end:e.positionAt(t.end)},newText:t.text}));if(i)return{edits:c,nextSelectionOffsets:[]};let l=a.map(e=>{let t=e.comment;return o&&t!==void 0?{start:t.contentStart,end:t.contentEnd,startAssociation:1,endAssociation:-1}:t===void 0?e.from===e.to?{start:e.from,end:e.to,startAssociation:-1,endAssociation:-1,collapsedInset:n.length+1}:{start:e.from,end:e.to,startAssociation:1,endAssociation:-1}:{start:e.from,end:e.to,startAssociation:1,endAssociation:1}}),u=Array(s.length+1);u[0]=0;for(let e=0;e<s.length;e++){let t=s[e];u[e+1]=u[e]+t.text.length-(t.end-t.start)}return{edits:c,nextSelectionOffsets:l.map((e,t)=>{let n=Pn(e.start,s,u,e.startAssociation)+(e.collapsedInset??0);return[n,e.collapsedInset===void 0?Pn(e.end,s,u,e.endAssociation):n,a[t].direction]})}}function H(e,t,n){let{style:r,dataset:i,children:a,...o}=t??{},s=document.createElement(e);return Object.assign(s,o),r!==void 0&&(typeof r==`string`?s.style.cssText=r:Object.assign(s.style,r)),i!==void 0&&(typeof i==`string`?s.dataset[i]=``:Array.isArray(i)?i.forEach(e=>{s.dataset[e]=``}):Object.assign(s.dataset,i)),a!==void 0&&s.replaceChildren(...a),n!==void 0&&n.appendChild(s),s}function U(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function In(e,t=`line`){let n=e.dataset[t];if(n===void 0)return;let r=parseInt(n,10);if(!Number.isNaN(r))return r}function Ln(e,t){if(e.nodeType===3){let n=e.textContent?.length??0;return Math.max(0,Math.min(t,n))}return e.nodeType===1?Math.max(0,Math.min(t,e.childNodes.length)):0}function Rn(e,t){return Object.assign(e,t)}function zn(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}function Bn(e,t=1e3){return Math.round(e*t)/t}function Vn(e){return e.endsWith(`
|
|
456
|
-
`)||e.endsWith(`\r`)}function Hn(e){if(!(typeof Intl>`u`||typeof Intl.Segmenter!=`function`))return new Intl.Segmenter(void 0,e)}var Un,Wn=!1;function Gn(){return Wn||=(Un=Hn({granularity:`grapheme`}),!0),Un}function Kn(e,t){let n=qn(e);if(n.length===0)return;let r=[],i=!1;for(let a of t){if(a.side===`deletions`||a.lineNumber<=0){r.push(a);continue}let t=a.lineNumber-1,o=e.previousLineCount,s=!1;for(let e of n){let n=Math.max(1,o+e.lineDelta),r=Jn(t,e,n);if(r===void 0){s=!0,t=void 0;break}(r!==t||Xn(t,e))&&(s=!0),t=r,o=n}if(t===void 0){i=!0;continue}let c=t+1;if(s){r.push(c===a.lineNumber?a:{...a,lineNumber:c}),i=!0;continue}r.push(a)}return i?r:void 0}function qn(e){if(e.changedLineChanges!==void 0)return e.changedLineChanges.flatMap(([e,t,n,r=0,i=0,a=!1])=>{if(n===0)return[];let o=Math.max(0,t-e);return[{startLine:e,startCharacter:r,endLine:e+Math.max(0,o-n),deletesEndLine:n<0&&a,insertedLineBreaks:o,lineDelta:n}]});if(e.lineDelta===0)return e.changedLineRanges.flatMap(([e,t])=>{let n=t-e;return n<=0?[]:[{startLine:e,startCharacter:0,endLine:e,deletesEndLine:!1,insertedLineBreaks:n,lineDelta:n}]});let t=Math.max(0,-e.lineDelta),n=e.endedAtDocumentEnd&&e.startLine+t===e.previousLineCount-1;return[{startLine:e.startLine,startCharacter:e.startCharacter,endLine:e.startLine+t,deletesEndLine:n,insertedLineBreaks:Math.max(0,e.lineDelta),lineDelta:e.lineDelta}]}function Jn(e,t,n){if(e<t.startLine)return e;if(e>t.endLine||t.endLine>t.startLine&&e===t.endLine&&!t.deletesEndLine)return e+t.lineDelta;if(t.startLine===t.endLine)return t.startCharacter===0?e+t.insertedLineBreaks:e;if(Yn(e,t))return;let r=Math.min(Math.max(0,e-t.startLine),t.insertedLineBreaks);return Zn(t.startLine+r,n)}function Yn(e,t){return!(t.lineDelta>=0||e<t.startLine||e>t.endLine||e===t.startLine&&t.startCharacter>0||e===t.endLine&&!t.deletesEndLine)}function Xn(e,t){return t.lineDelta===0||e<t.startLine||e>t.endLine?!1:!(t.endLine>t.startLine&&e===t.endLine&&!t.deletesEndLine)}function Zn(e,t){return Math.max(0,Math.min(e,Math.max(0,t-1)))}function Qn(e,t,n){let r=new Map,i=new Map;for(let t of e){let e=t.lineNumber;r.has(e)||r.set(e,[]),i.has(e)||i.set(e,[]),(t.side===`deletions`?i:r).get(e).push(me(t))}let a=t.parentElement?.previousElementSibling,o,s;if(a!=null&&a instanceof HTMLElement&&a.dataset.deletions!==void 0)for(let e of a.children){let t=e,{gutter:n,content:r}=t.dataset;n===void 0?r!==void 0&&(s=t):o=t}$n(t,n),s!==void 0&&$n(s,o);let c=er(r,t,n);if(s===void 0)return;let l=er(i,s,o);requestAnimationFrame(()=>{tr(r,i,c,l)})}function $n(e,t){let n=[];for(let r=1;r<e.childElementCount;r++){let i=e.children[r];i.dataset.lineAnnotation!==void 0&&(n.push(i),t!==void 0&&n.push(t.children[r]))}for(let e of n)e.remove()}function er(e,t,n){let r=new Map;for(let n of t.children){let t=In(n);if(t!==void 0){let i=e.get(t);if(i!==void 0){let e=H(`div`,{dataset:{lineAnnotation:`0,`+(t-1)},children:[H(`div`,{dataset:`annotationContent`,children:i.map(e=>H(`slot`,{name:e}))})]});n.after(e),r.set(t,e)}}}if(n!==void 0)for(let t of n.children){let n=In(t,`columnNumber`);if(n!==void 0&&e.has(n)){let e=H(`div`,{dataset:{gutterBuffer:`annotation`,bufferSize:`1`},style:{gridRow:`span 1`}});t.after(e)}}return r}function tr(e,t,n,r){let i=new Map;for(let[t,n]of e.entries()){let e=r.get(t);if(n.length===0&&e!==void 0){let n=nr(e);n>0&&i.set(t,n)}}for(let[e,r]of t.entries()){let t=n.get(e);if(r.length===0&&t!==void 0){let n=nr(t);n>0&&i.set(e,n)}}rr(e,n,i),rr(t,r,i)}function nr(e){let t=e.firstElementChild;return t instanceof HTMLElement?t.getBoundingClientRect().height:0}function rr(e,t,n){for(let[r,i]of t.entries()){let t=e.get(r),a=n.get(r);t?.length===0&&a!==void 0&&i.style.setProperty(`--diffs-annotation-min-height`,`${a}px`)}}var ir=class{#e;#t;#n;#r;#i;#a;#o=0;#s=0;#c=0;#l=!0;#u;#d=new Map;#f;#p;constructor(e){this.#f=e.hasActivePopover,this.#p=e.updateActivePopover}setViewportElements(e,t){let n=this.#e!==e||this.#t!==t;this.#e=e,n&&(this.#t=t,this.#l=!0,this.#u?.forEach(e=>e()),this.#u=void 0)}cleanUp(){this.#t=void 0,this.#e=void 0,this.#n=void 0,this.#r=void 0,this.#i=void 0,this.#a=void 0,this.#o=0,this.#s=0,this.#c=0,this.#l=!0,this.#u?.forEach(e=>e()),this.#u=void 0,this.#d.clear()}resetPlacement(e=`default`){this.#d.delete(e)}setPlacement(e,t=`default`){this.#d.set(t,e)}choosePlacement(e){let{preferred:t,fallback:n,viewport:r,popoverHeight:i,atDocumentEdge:a,placementKey:o=`default`}=e,s=this.#d.get(o),c;if(r!==void 0&&i>0){let e=(e,t=0)=>e.top>=r.top+t&&e.bottom<=r.bottom-t;c=s===`fallback`&&e(n)&&!e(t,4)||!e(t)&&e(n)?`fallback`:`preferred`}else c=a?`fallback`:`preferred`;return this.#d.set(o,c),c}getPlacementBounds(){let e=this.#g();if(e===void 0)return;let t=this.#_(),n,r;if(t===void 0?(n=0,r=window.innerHeight):(n=t.top,r=t.bottom),n=Math.max(n,e.top),r=Math.min(r,e.bottom),r<=n)return;let i=this.#o,a=this.#s,o=this.#c>0?this.#c:e.width,s=t===void 0?0:t.left,c=t===void 0?window.innerWidth:t.right,l=i,u=i+o,d=Math.max(l,s-e.left+i),f=Math.min(u,c-e.left+i);return{top:n-e.top+a,bottom:r-e.top+a,left:d,right:Math.max(d,f)}}#m(){let e=this.#e;if(e===void 0)return;if(this.#r===e&&(this.#n===void 0||this.#n.isConnected))return this.#n;let t=e.parentElement;for(;t!==null;){let n=getComputedStyle(t).overflowY;if(n===`auto`||n===`scroll`||n===`overlay`)return this.#n=t,this.#r=e,t;t=t.parentElement}this.#n=void 0,this.#r=e}#h(){if(!this.#l)return;this.#v();let e=this.#t;this.#i=e?.getBoundingClientRect(),this.#o=e?.scrollLeft??0,this.#s=e?.scrollTop??0,this.#c=e?.clientWidth??0,this.#a=this.#m()?.getBoundingClientRect(),this.#l=!1}#g(){return this.#h(),this.#i}#_(){return this.#h(),this.#a}#v(){if(this.#u!==void 0)return;let e,t=()=>{this.#l=!0,!(!this.#f()||e!==void 0)&&(e=requestAnimationFrame(()=>{e=void 0,this.#p()}))},n=this.#m(),r=this.#t;this.#u=[U(n===void 0?window:n,`scroll`,t,{passive:!0}),...r===void 0?[]:[U(r,`scroll`,t,{passive:!0})],U(window,`resize`,t,{passive:!0}),()=>{e!==void 0&&(cancelAnimationFrame(e),e=void 0)}]}};function ar(e,{gutterWidth:t,placeAbove:n,viewport:r,x:i,y:a}){if(e.style.setProperty(`--gutter-width`,t+`px`),e.style.setProperty(`--popover-x`,i+`px`),e.style.setProperty(`--popover-y`,a+`px`),e.style.setProperty(`--popover-y-shift`,n?`-100%`:`0px`),r===void 0){e.style.removeProperty(`--popover-viewport-left`),e.style.removeProperty(`--popover-viewport-right`);return}e.style.setProperty(`--popover-viewport-left`,r.left+`px`),e.style.setProperty(`--popover-viewport-right`,r.right+`px`)}var or=new Map([[`'`,`'`],[`"`,`"`],["`","`"],[`{`,`}`],[`[`,`]`],[`<`,`>`],[`(`,`)`]]),sr=new Set([`'`,`"`,"`"]),cr=new Set([`{`,`[`,`(`,`<`]);function lr(e,t=0){let n=pi(e.startContainer,e.startOffset),r=pi(e.endContainer,e.endOffset);if(!(n===null||r===null))return{start:n,end:r,direction:t}}function ur(e,t,n,r){if(e===void 0)return[[],t];let{start:i,end:a}=t,o=[],s={...t},c=i.line!==a.line,l=a.line;i.line<a.line&&a.character===0&&l--;for(let t=i.line;t<=l;t++){let l=e.getLineText(t);if(l===void 0||c&&l.trim().length===0)continue;let u=l.startsWith(` `)?` `:` `.repeat(n),d=0,f=u;if(r){if(l.startsWith(` `))d=1;else if(l.startsWith(` `)){let e=l.length-l.trimStart().length;d=Math.min(u.length,e)}if(d===0)continue;f=``}o.push({range:{start:{line:t,character:0},end:{line:t,character:d}},newText:f});let p=f.length-d;t===i.line&&(s={...s,start:{...i,character:Math.max(0,i.character+p)}}),t===a.line&&(s={...s,end:{...a,character:Math.max(0,a.character+p)}})}return[o,s]}function dr(e,t,n,r={}){let i=e.lineCount;return t.map(t=>{let{line:a,character:o}=n===`up`||n===`left`?t.start:t.end;if(n===`textStart`||n===`start`||n===`end`){let i=Ar(t);a=i.line,o=i.character;let s=mr(e,a,o,r);if(n===`textStart`){let t=e.getLineText(a).slice(s.start,s.end),n=s.start+ui(t);o=o===n?s.start:n}else o=n===`start`?s.start:s.end}else if(n===`up`){let t=fr(e,a,o,-1,r);t===void 0?a>0&&(a=r.resolveRenderableLine==null?a-1:r.resolveRenderableLine(a-1,`up`)??a):(a=t.line,o=t.character)}else if(n===`down`){let t=fr(e,a,o,1,r);if(t!==void 0)a=t.line,o=t.character;else{let e=Math.max(i-1,0);a<e&&(a=r.resolveRenderableLine==null?a+1:Math.min(r.resolveRenderableLine(a+1,`down`)??a,e))}}else if(W(t)){let t=e.getLineLength(a);if(o=Math.min(o,t),n===`left`){if(o>0)o=oi(e,a,o,!1);else if(a>0){let t=r.resolveRenderableLine==null?a-1:r.resolveRenderableLine(a-1,`up`);t!==void 0&&(a=t,o=e.getLineLength(a))}}else if(o<t)o=oi(e,a,o,!0);else if(a<i-1){let e=r.resolveRenderableLine==null?a+1:r.resolveRenderableLine(a+1,`down`);e!==void 0&&(a=Math.min(e,i-1),o=0)}}let s={line:a,character:o};return{start:s,end:s,direction:0}})}function fr(e,t,n,r,i){if(i.getSoftLineOffsets===void 0)return;let a=mr(e,t,n,i),o=a.index+r,s=t,c;if(o>=0&&o<a.count)c=gr(e,s,o,i);else{let a=t+r;if(a<0||a>=e.lineCount)return{line:t,character:n};let o=i.resolveRenderableLine==null?a:i.resolveRenderableLine(a,r<0?`up`:`down`);if(o===void 0)return{line:t,character:n};s=Math.min(o,e.lineCount-1);let l=hr(e,s,i);c=gr(e,s,r<0?l-1:0,i)}let l=Math.max(0,n-a.start),u=c.start+l,d=c.index===c.count-1?u:Math.min(u,c.end),f=e.getLineText(s);return{line:s,character:d>f.length?d:pr(f,d)}}function pr(e,t){if(t<=0||t>=e.length)return t;let n=Gn();if(n!==void 0){for(let r of n.segment(e)){if(t<=r.index)return t;let e=r.index+r.segment.length;if(t<e)return e}return t}let r=0;for(let n of e){if(t<=r)return t;let e=r+n.length;if(t<e)return e;r=e}return t}function mr(e,t,n,r){let i=e.getLineLength(t),a=r.getSoftLineOffsets?.(t);if(a===void 0||a.length<2)return{start:0,end:i,index:0,count:1};for(let i=0;i+1<a.length;i++){let a=gr(e,t,i,r);if(n>=a.start&&n<=a.end)return a}return gr(e,t,n<(a[0]??0)?0:a.length-2,r)}function hr(e,t,n){let r=n.getSoftLineOffsets?.(t);return r===void 0||r.length<2?1:r.length-1}function gr(e,t,n,r){let i=e.getLineLength(t),a=r.getSoftLineOffsets?.(t);if(a===void 0||a.length<2)return{start:0,end:i,index:0,count:1};let o=a.length-1,s=Math.max(0,Math.min(n,o-1)),c=Math.max(0,Math.min(i,a[s]??0));return{start:c,end:Math.max(c,Math.min(i,a[s+1]??i)),index:s,count:o}}function _r(e,t,n,r={}){return t.map(t=>{let i=t.direction===-1?t.start:t.end,[a]=dr(e,[{start:i,end:i,direction:0}],n,r);return Ir(t,a)})}function vr(e,t,n,r,i=2,a=!1){if(t[t.length-1]===void 0)return{nextSelections:[]};let o=[];for(let e of t)o.push(e.start,e.end);let s=o.map(t=>e.offsetAt(t)),c=s[(t.length-1)*2],l=s[(t.length-1)*2+1],u=[],d=!0;for(let e=0;e<t.length;e++){let t={index:e,start:s[e*2],end:s[e*2+1]},n=u[u.length-1];n!==void 0&&(t.start<n.start||t.start===n.start&&t.end<n.end)&&(d=!1),u.push(t)}d||u.sort((e,t)=>{let n=e.start-t.start;if(n!==0)return n;let r=e.end-t.end;return r===0?e.index-t.index:r});let f=fi(e,n,i),p=[],m=Array.from({length:t.length}),h=0,g,_=()=>{if(g===void 0)return;let t=fi(e,{start:g.start,end:g.end,text:f.text},i),n=li(e,t.text,t.start);p.push({start:t.start,end:t.end,text:n});let r=[g.start+h+n.length,g.start+h+n.length];for(let e of g.indices)m[e]=r;h+=n.length-(t.end-t.start),g=void 0};for(let e of u){let t=Math.max(0,e.start+(f.start-c)),n=Math.max(t,e.end+(f.end-l));if(g!==void 0&&t<g.end){g.end=Math.max(g.end,n),g.indices.push(e.index);continue}_(),g={start:t,end:n,indices:[e.index]}}_();let v=e.applyResolvedEdits(p,!0,t,void 0,a),y=di(e,m.map(e=>{if(e===void 0)throw Error(`Missing next selection offsets`);return e}));if(e.setLastUndoSelectionsAfter(y),v!==void 0&&r!==void 0){let t=Kn(v,r);t!==void 0&&e.setLastUndoLineAnnotations(r,t)}return{nextSelections:y,change:v}}function yr(e,t){if(t.length!==e.length+2)return;let n=or.get(t[0]);if(!(n===void 0||t[t.length-1]!==n||t.slice(1,-1)!==e))return 1}function br(e,t,n,r){let i=t.start+n,a=i+r.length;if(t.end-t.start>0){let n=e.getTextSlice(t.start,t.end),a=yr(n,r)??r.indexOf(n);if(a!==-1&&a+n.length<=r.length){let e=i+a;return[e,e+n.length]}}return[a,a]}function xr(e,t,n,r,i=!1,a=`selection`){if(t.length!==n.length)throw Error(`Selection text replacements must match the selection count`);let o=[];for(let e of t)o.push(e.start,e.end);let s=o.map(t=>e.offsetAt(t)),c=[],l=!0;for(let e=0;e<t.length;e++){let t={index:e,start:s[e*2],end:s[e*2+1]},n=c[c.length-1];n!==void 0&&(t.start<n.start||t.start===n.start&&t.end<n.end)&&(l=!1),c.push(t)}l||c.sort((e,t)=>{let n=e.start-t.start;if(n!==0)return n;let r=e.end-t.end;return r===0?e.index-t.index:r});let u=n.every(e=>e===``),d,f=Array.from({length:t.length});if(u){d=[];let e=!1;for(let t of c){if(f[t.index]=[t.end,t.end],t.start>=t.end)continue;e=!0;let n=d[d.length-1];n!==void 0&&t.start<n.end?d[d.length-1]={start:n.start,end:Math.max(n.end,t.end),text:``}:d.push({start:t.start,end:t.end,text:``})}if(!e)return{nextSelections:t};for(let e of c){let t=e.end,n=0,r=t;for(let e of d){if(t<=e.start)break;if(t>=e.end){n-=e.end-e.start;continue}r=e.start+n;break}r===t&&(r+=n),f[e.index]=[r,r]}}else{d=[];let t=0,r=-1;for(let i=0;i<c.length;i++){let o=c[i];if(o.start<r)throw Error(`Overlapping multi-selection edits are not supported`);r=o.end;let s=li(e,n[a===`document`?i:o.index],o.start);d.push({start:o.start,end:o.end,text:s}),f[o.index]=br(e,o,t,s),t+=s.length-(o.end-o.start)}}let p=e.applyResolvedEdits(d,!0,t,void 0,i),m=di(e,f.map(e=>{if(e===void 0)throw Error(`Missing next selection offsets`);return e}));if(e.setLastUndoSelectionsAfter(m),p!==void 0&&r!==void 0){let t=Kn(p,r);t!==void 0&&e.setLastUndoLineAnnotations(r,t)}return{nextSelections:m,change:p}}function Sr(e,t){return e===`never`?!1:e===`brackets`?cr.has(t):e===`quotes`?sr.has(t):!0}function Cr(e,t,n,r){if(n.length!==1||t.length===0)return;let i=or.get(n);if(i===void 0||!Sr(r,n))return;let a=[];for(let r of t){if(W(r))return;a.push(n+e.getText(r)+i)}return a}function wr(e,t,n){let r=[],i=[];for(let n of t){let[t,a]=si(e,n);if(!W(n)){i.push([t,a]);continue}let{line:o,character:s}=n.start,c=t,l=e.getLineText(o),u=l.length,d=c-s,f=ai(l),p;if(s>0&&s<u){let e=ii(l,s,!1,f),t=ii(l,s,!0,f);p={start:d+e,end:d+t,text:l.slice(s,t)+l.slice(e,s)},i.push([d+t,d+t])}else if(s===u&&f.length>=2){let e=f[f.length-1],t=f[f.length-2];p={start:d+t,end:c,text:l.slice(e,u)+l.slice(t,e)},i.push([c,c])}else if(s===0&&o>0&&u>0){let t=o-1,n=e.getLineText(t),r=n.length,a=e.offsetAt({line:t,character:r}),s=r>0?ii(n,r,!1,ai(n)):r,u=ii(l,0,!0,f),d=a-(r-s),m=l.slice(0,u)+e.getTextSlice(a,c)+n.slice(s,r);p={start:d,end:c+u,text:m};let h=d+m.length;i.push([h,h])}else{i.push([t,a]);continue}r.push(p)}if(r.length===0)return{nextSelections:t};r.sort((e,t)=>e.start-t.start);for(let e=1;e<r.length;e++)if(r[e].start<r[e-1].end)throw Error(`Overlapping multi-selection edits are not supported`);let a=e.applyResolvedEdits(r,!0,t),o=di(e,i);if(e.setLastUndoSelectionsAfter(o),a!==void 0&&n!==void 0){let t=Kn(a,n);t!==void 0&&e.setLastUndoLineAnnotations(n,t)}return{nextSelections:o,change:a}}function Tr(e,t,n){let r=t.map(t=>{let n=ci(e,t);return{start:n.start,end:n.end,direction:0}});return xr(e,r,r.map(()=>``),n)}function Er(e,t,n,r){let i=t.map(t=>{if(!W(t))return{start:t.start,end:t.end,direction:0};let r=Ar(t),{line:i,character:a}=r,o=n?.(i,a)??0;if(a>o)return{start:{line:i,character:o},end:{line:i,character:a},direction:0};if(i===0)return{start:r,end:r,direction:0};let s=e.getLineLength(i-1);return{start:{line:i-1,character:s},end:{line:i,character:0},direction:0}});return xr(e,i,i.map(()=>``),r)}function Dr(e,t,n){let r=t.map(t=>{let[n,r]=ri(e,t);return{start:n,end:r,direction:0}});return xr(e,r,r.map(()=>``),n)}function Or(e,t,n){if(!W(t))return[t.start,t.end];let r=Ar(t),{line:i,character:a}=r,o=e.getLineLength(i),s=e.lineCount;if(a=Math.min(a,o),n)return a<o?[{line:i,character:a},{line:i,character:oi(e,i,a,!0)}]:i<s-1?[{line:i,character:o},{line:i+1,character:0}]:[r,r];if(a>0)return[{line:i,character:oi(e,i,a,!1)},{line:i,character:a}];if(i>0){let t=e.getLineLength(i-1);return[{line:i-1,character:t},{line:i,character:0}]}return[r,r]}function kr(e,t,n,r,i=2){let a=t.map(t=>{let[r,a]=Or(e,t,n);if(!n&&W(t)){let t=fi(e,{start:e.offsetAt(r),end:e.offsetAt(a),text:``},i);r=e.positionAt(t.start),a=e.positionAt(t.end)}return{start:r,end:a,direction:0}});return xr(e,a,a.map(()=>``),r)}function W(e){return e.start.line===e.end.line&&e.start.character===e.end.character}function Ar(e){let{start:t,end:n,direction:r}=e;return r===-1?t:n}function jr(e){return e===`context`||e===`context-expanded`||e===`change-addition`}function Mr(e,t){let n=W(e),r=W(t);return n&&r?G(e.start,t.start)===0:n?G(t.start,e.start)<=0&&G(e.start,t.end)<=0:r?G(e.start,t.start)<=0&&G(t.start,e.end)<=0:G(e.start,t.end)<0&&G(t.start,e.end)<0}function G(e,t){return e.line===t.line?e.character-t.character:e.line-t.line}function Nr(e,t,n){let r=t===n?0:t<n?1:-1,i=Math.min(t,n),a=Math.max(t,n);return{start:e.positionAt(i),end:e.positionAt(a),direction:r}}function Pr(e,t){let n=0;for(let r of t){if(e<r.start)break;if(e>=r.end)n+=r.text.length-(r.end-r.start);else return r.start+n+r.text.length}return e+n}function Fr(e,t,n,r){return t.map((t,i)=>{let[a,o]=n[i],s=Pr(a,r),c=Pr(o,r);return Nr(e,t.direction===-1?c:s,t.direction===-1?s:c)})}function Ir(e,t){let n=e.direction===-1?e.end:e.start,r=G(n,t.start),i=G(n,t.end),a=t.end;a=r<=0?t.end:i>=0?t.start:r===0?t.end:t.start;let o=G(n,a);return{start:o<=0?n:a,end:o<=0?a:n,direction:o===0?0:o<0?1:-1}}function Lr(e,t){let n=G(t.start,e.start)<0,r=G(t.end,e.end)>0;return n&&!r?{start:t.start,end:e.end,direction:-1}:r&&!n?{start:e.start,end:t.end,direction:1}:e.direction===-1?{start:t.start,end:e.end,direction:G(t.start,e.end)===0?0:-1}:{start:e.start,end:t.end,direction:G(e.start,t.end)===0?0:1}}function Rr(e,t){return zr(e.map(e=>Lr(e,t)))}function zr(e){if(e.length<=1)return e;let t=e.map((e,t)=>({index:t,selection:e})).sort((e,t)=>{let n=G(e.selection.start,t.selection.start);if(n!==0)return n;let r=G(e.selection.end,t.selection.end);return r===0?e.index-t.index:r}),n=[],r=t[0];for(let e of t.slice(1)){if(Mr(r.selection,e.selection)){let t=e.index>r.index?e:r,n=G(e.selection.start,r.selection.start)<0?e.selection.start:r.selection.start,i=G(e.selection.end,r.selection.end)>0?e.selection.end:r.selection.end,a=t.selection.direction;a===0&&G(n,i)!==0&&(a=G(t.selection.start,n)===0?-1:1),r={index:t.index,selection:{direction:a,end:i,start:n}};continue}n.push(r),r=e}return n.push(r),n.sort((e,t)=>e.index-t.index).map(({selection:e})=>e)}function Br(e){let t=e.map(e=>{let t=e.end.line;return e.end.character===0&&G(e.start,e.end)!==0&&t--,{startLine:e.start.line,endLine:Math.max(e.start.line,t)}}).sort((e,t)=>{let n=e.startLine-t.startLine;return n===0?e.endLine-t.endLine:n}),n=[];for(let e of t){let t=n.at(-1);t!==void 0&&e.startLine<=t.endLine+1?t.endLine=Math.max(t.endLine,e.endLine):n.push({...e})}return n}function Vr(e,t,n,r){let i=e=>{let i=e.line+t;if(i>=n){let e=Math.max(0,n-1);return{line:e,character:r(e)}}return i<0?{line:0,character:0}:{line:i,character:e.character}};return{start:i(e.start),end:i(e.end),direction:e.direction}}function Hr(e,t){if(t.length===0)return;let n=t.map(t=>W(t)?ti(e,t):t),r=n.map(t=>e.getText(t)),i=r[0];if(i.length===0||r.some(e=>e!==i))return;let a=n.map(t=>[e.offsetAt(t.start),e.offsetAt(t.end)]),o=e.findNextNonOverlappingSubstring(i,a);if(o===void 0)return n.some((e,n)=>{let r=t[n];return G(e.start,r.start)!==0||G(e.end,r.end)!==0||e.direction!==r.direction})?n:void 0;let s=Nr(e,o,o+i.length);return[...n,s]}function Ur(e){let t=e.lineCount-1;return{start:{line:0,character:0},end:{line:t,character:e.getLineLength(t)},direction:1}}function Wr(e,t,n){let r=0;if(t){let t=e.lineCount-1;r=n===!0&&t>0&&e.getLineLength(t)===0?t-1:t}let i=t?e.getLineLength(r):0,a={line:r,character:i};return{start:a,end:a,direction:1}}function Gr(e,t){if(W(t)){let n=t.start.line;return{start:e.offsetAt({line:n,character:0}),end:n<e.lineCount-1?e.offsetAt({line:n+1,character:0}):e.offsetAt({line:n,character:e.getLineLength(n)})}}let n=e.offsetAt(t.start),r=e.offsetAt(t.end);return n<=r?{start:n,end:r}:{start:r,end:n}}function Kr(e,t){return t.map(t=>Gr(e,t)).sort((e,t)=>{let n=e.start-t.start;return n===0?e.end-t.end:n})}function qr(e,t){return Kr(e,t).map(({start:t,end:n})=>e.getTextSlice(t,n))}function Jr(e,t){let n=Kr(e,t),r=e.eol,i=``,a=-1;for(let t of n)if(!(t.end<=t.start)){if(t.start<=a){t.end>a&&(i+=e.getTextSlice(a,t.end),a=t.end);continue}i.length>0&&!Vn(i)&&(i+=r),i+=e.getTextSlice(t.start,t.end),a=t.end}return i}function Yr(e,t){if(W(t))return Xr(e,t);let[n,r]=G(t.start,t.end)<=0?[t.start,t.end]:[t.end,t.start];return{start:e.offsetAt(n),end:e.offsetAt(r),text:``}}function Xr(e,t){let n=t.start.line,r=e.offsetAt({line:n,character:0}),i=e.offsetAt({line:n,character:e.getLineLength(n)});return n<e.lineCount-1?{start:r,end:e.offsetAt({line:n+1,character:0}),text:``}:n>0?{start:e.offsetAt({line:n-1,character:e.getLineLength(n-1)}),end:i,text:``}:{start:r,end:i,text:``}}function Zr(e){let t=[];for(let{edit:n}of e){if(n.start>=n.end)continue;let e=t.at(-1);e!==void 0&&n.start<=e.end?t[t.length-1]={start:e.start,end:Math.max(e.end,n.end),text:``}:t.push(n)}return t}function Qr(e,t){let n=Array.from({length:e.length}),r=0,i=0;for(let a of e){for(;r<t.length&&a.edit.start>t[r].end;){let e=t[r];i-=e.end-e.start,r++}let e=t[r];e!==void 0&&a.edit.start>=e.start&&a.edit.start<=e.end?n[a.index]=e.start+i:n[a.index]=a.edit.start+i}return n}function $r(e,t){let n=[...t.map((t,n)=>({index:n,edit:Yr(e,t)}))].sort((e,t)=>{let n=e.edit.start-t.edit.start;if(n!==0)return n;let r=e.edit.end-t.edit.end;return r===0?e.index-t.index:r}),r=Zr(n);return{text:Jr(e,t),edits:r,nextSelectionOffsets:Qr(n,r)}}function ei(e,t){let n=Math.max(0,t),r=mi(e),i=null;for(let e of r){i=e;let t=Si(e);if(n<=t+(e.textContent?.length??0)){let r=hi(e,n<t?0:n-t);if(r!==null)return r}}if(i!==null){let e=hi(i,i.textContent?.length??0);return e===null?[i,0]:e}let a=0,o=null;for(let t of e.childNodes){if(t.nodeType===1&&t.tagName===`BR`)return[t,0];if(t.nodeType!==3)continue;o=t;let e=Ci(o.textContent,o.textContent?.length??0);if(n<=a+e)return[o,Ci(o.textContent,n-a)];a+=e}return o===null?[e,0]:[o,Ci(o.textContent,o.textContent?.length??0)]}function ti(e,t){let{line:n,character:r}=t.start,i=e.getLineText(n),a=ni(i,Math.max(0,Math.min(r,i.length)));return a===void 0?t:{start:{line:n,character:a.start},end:{line:n,character:a.end},direction:1}}function ni(e,t){let n=Hn({granularity:`word`});if(n!==void 0){for(let r of n.segment(e)){if(r.isWordLike!==!0)continue;let e=r.index,n=e+r.segment.length;if(t>=e&&t<=n)return{start:e,end:n}}return}let r=/[\p{Alphabetic}\p{Number}_]+/gu,i;for(;(i=r.exec(e))!==null;){let e=i.index,n=e+i[0].length;if(t>=e&&t<=n)return{start:e,end:n}}}function ri(e,t){if(!W(t))return[t.start,t.end];let n=Ar(t),{line:r,character:i}=n;if(i===0){if(r===0)return[n,n];let t=e.getLineLength(r-1);return[{line:r-1,character:t},{line:r,character:0}]}let a=e.getLineText(r),o=ai(a),s=i,c;for(;s>0;){let e=ii(a,s,!1,o),t=a.slice(e,s),n=/\S/.test(t)?/\p{Alphabetic}|\p{Number}|_/u.test(t)?1:2:0;if(c!==void 0&&n!==c)break;(n!==0||s!==i)&&(c=n),s=e}return[{line:r,character:s},{line:r,character:i}]}function ii(e,t,n,r){if(n){for(let e of r)if(e>t)return e;return e.length}for(let e=r.length-1;e>=0;e--){let n=r[e];if(n<t)return n}return 0}function ai(e){let t=[0],n=Gn();if(n!==void 0){for(let r of n.segment(e))r.index>0&&t.push(r.index);return t}let r=0;for(let n of e)r>0&&t.push(r),r+=n.length;return t}function oi(e,t,n,r){let i=e.getLineLength(t);if(r){if(n>=i)return i;let r=e.offsetAt({line:t,character:0}),a=e.getTextSlice(r+n,r+i),o=Gn();if(o!==void 0){for(let e of o.segment(a))return n+e.segment.length;return i}for(let e of a)return n+e.length;return i}if(n<=0)return 0;let a=e.offsetAt({line:t,character:0}),o=e.getTextSlice(a,a+n),s=0,c=Gn();if(c!==void 0){for(let e of c.segment(o))s=e.index;return s}let l=0;for(let e of o)s=l,l+=e.length;return s}function si(e,t){let n=t.direction===-1;return[e.offsetAt(n?t.end:t.start),e.offsetAt(Ar(t))]}function ci(e,t){if(!W(t))return{start:t.start,end:t.end};let{line:n,character:r}=t.start,i=e.getLineText(n).length;return r<i?{start:{line:n,character:r},end:{line:n,character:i}}:n<e.lineCount-1?{start:{line:n,character:r},end:{line:n+1,character:0}}:{start:{line:n,character:r},end:{line:n,character:r}}}function li(e,t,n){if(t!==`
|
|
457
|
-
`&&t!==`\r`&&t!==`\r
|
|
458
|
-
`)return t;let r=e.positionAt(n).line,i=e.getLineText(r),a=ui(i);return a===0?t:t+i.slice(0,a)}function ui(e){let t=0;for(;t<e.length;t++){let n=e.charCodeAt(t);if(n!==32&&n!==9)break}return t}function di(e,t){let n=[];for(let[e,r]of t)n.push(Math.min(e,r),Math.max(e,r));let r=e.positionsAt(n);return t.map(([e,t],n)=>{let i=e===t?0:e<t?1:-1;return{start:r[n*2],end:r[n*2+1],direction:i}})}function fi(e,t,n){if(t.text!==``||t.start!==t.end-1)return t;let r=e.positionAt(t.end);if(r.character===0)return t;let i=e.getLineText(r.line),a=i.slice(0,r.character);if(/[^ \t]/.test(a)||i[r.character-1]===` `)return t;let o=Math.max(0,r.character-n),s=i.slice(o,r.character);return s.length===n&&/^ +$/.test(s)?{...t,start:t.end-s.length}:t}function pi(e,t){let n=e.nodeType===1?e:e.parentElement;for(;n!==null&&xi(n)===void 0;)n=n.parentElement;if(n===null)return null;let r=xi(n);if(r===void 0)return null;if(e.nodeType===3)return e.parentElement===null?null:yi(e.parentElement)===null?{line:r,character:vi(n,e)+Ci(e.textContent,t)}:{line:r,character:bi(e,t)};if(e.nodeType===1){let i=e;if(i.tagName===`DIV`){let e=0;for(let n=0;n<t;n++)e=bi(i.childNodes[n]);return{line:r,character:e}}if(i.tagName===`BR`)return{line:r,character:0};if(i.tagName===`SPAN`){if(t<i.childNodes.length){let e=i.childNodes[t];if(e?.nodeType===1){let t=Si(e);if(t!==void 0)return{line:r,character:t};let n=yi(e),i=n===null?void 0:Si(n);if(i!==void 0)return{line:r,character:i}}}return{line:r,character:t>0?bi(i.childNodes[t-1]):vi(n,i)}}return{line:r,character:vi(n,i)}}return null}function mi(e){let t=[];for(let n of e.childNodes){if(n.nodeType!==1)continue;let e=n;if(e.tagName===`SPAN`){if(Si(e)!==void 0){t.push(e);continue}for(let n of e.childNodes)n.nodeType===1&&Si(n)!==void 0&&t.push(n)}}return t}function hi(e,t){let n=Math.max(0,t),r=[{container:e,index:0}];for(;r.length>0;){let e=r[r.length-1];if(e.index>=e.container.childNodes.length){r.pop();continue}let t=e.container.childNodes[e.index];if(e.index++,t.nodeType===3){let e=Ci(t.textContent,t.textContent?.length??0);if(n<=e)return[t,n];n-=e}else t.nodeType===1&&r.push({container:t,index:0})}return null}function gi(e,t){let n=0,r=[{container:e,index:0}];for(;r.length>0;){let e=r[r.length-1];if(e.index>=e.container.childNodes.length){r.pop();continue}let i=e.container.childNodes[e.index];if(i===t)return n;e.index++,i.nodeType===3?n+=Ci(i.textContent,i.textContent?.length??0):i.nodeType===1&&r.push({container:i,index:0})}return n}function _i(e,t){let n=t;for(;n!==null;){if(n===e)return!0;n=n.parentElement}return!1}function vi(e,t){if(t.parentElement===e){let n=0,r=Array.prototype.indexOf.call(e.childNodes,t);for(let t=0;t<r;t++)n=bi(e.childNodes[t]);return n}for(let n of mi(e))if(_i(n,t))return Si(n)+(t.nodeType===3?gi(n,t):0);let n=0,r=t.nodeType===1?t:t.parentElement;for(;r!==null&&r.parentElement!==null&&xi(r.parentElement)===void 0;){let e=r.parentElement,t=Array.prototype.indexOf.call(e.childNodes,r);for(let r=0;r<t;r++)n=bi(e.childNodes[r]);r=e}return n}function yi(e){let t=e;for(;t!==null;){if(xi(t)!==void 0)return null;if(Si(t)!==void 0)return t;t=t.parentElement}return null}function bi(e,t){if(e===void 0)return 0;if(e.nodeType===3){let n=e.parentElement;if(n===null)return 0;let r=yi(n);if(r===null)return 0;let i=Si(r);if(i===void 0)return 0;let a=t===void 0?Ci(e.textContent,e.textContent?.length??0):Ci(e.textContent,t);return i+gi(r,e)+a}if(e.nodeType!==1)return 0;let n=e;if(n.tagName!==`SPAN`&&n.tagName!==`BR`)return 0;let r=Si(n);if(r!==void 0)return r+(n.textContent?.length??0);let i=0;for(let e of n.childNodes)i=Math.max(i,bi(e));return i}function xi(e){let{line:t,lineType:n}=e.dataset;if(t!==void 0&&n!==`change-deletion`){let e=parseInt(t,10);if(!Number.isNaN(e))return e-1}}function Si(e){let{char:t}=e.dataset;if(t!==void 0){let e=parseInt(t,10);if(!Number.isNaN(e))return e}}function Ci(e,t){let n=e??``,r=n.search(/[\r\n]/);return Math.min(t,r===-1?n.length:r)}var wi=300,Ti=100,Ei=`marker-popup`,Di=class{#e;#t=[];#n=0;#r;#i;#a;#o;#s;#c;#l;#u=!1;constructor(e){this.#e=e}get markers(){return this.#t}isPopupVisible(){return this.#l!==void 0}updatePopupPosition(){let e=this.#l,t=this.#r;if(e===void 0||t===void 0)return;let n=this.#t[e];if(n===void 0){this.removePopup();return}this.#_(t,n.start.line,n.start.character)}setMarkers(e,t){this.#n=t.lineCount,this.#t=e.map(e=>({...e,start:t.normalizePosition(e.start),end:t.normalizePosition(e.end)})),this.removePopup()}listenHover(e){this.#a?.forEach(e=>e()),this.#a=void 0,this.#t.length!==0&&(this.#a=[U(e,`mouseover`,e=>{if(this.#e.isMouseDown())return;let t=e.composedPath()[0];if(t===void 0)return;let n=this.#d(t);n===void 0?(this.#f(),this.#h()):this.#m(n)}),U(e,`mouseleave`,()=>{this.#f(),this.#h()})])}removePopup(){this.#f(),this.#p(),this.#v()}cleanup(){this.#a?.forEach(e=>e()),this.#a=void 0,this.removePopup(),this.#t=[]}#d(e){let t=e.closest(`[data-line]`);if(t==null)return;let n=In(t);if(n===void 0)return;let r;if(e.tagName===`SPAN`){let t=e.dataset.char;if(t===void 0||(r=parseInt(t,10),Number.isNaN(r)))return}else if(e.tagName===`BR`)r=0;else return;let i={line:n-1,character:r};for(let e=this.#t.length-1;e>=0;e--)if(Mr({start:i,end:i},this.#t[e]))return e}#f(){this.#o!==void 0&&(clearTimeout(this.#o),this.#o=void 0),this.#c=void 0}#p(){this.#s!==void 0&&(clearTimeout(this.#s),this.#s=void 0)}#m(e){if(e===this.#l||e===this.#c){this.#p();return}if(this.#f(),this.#p(),this.#r!==void 0){this.#y(e);return}this.#c=e,this.#o=setTimeout(()=>{this.#o=void 0,this.#c=void 0,this.#y(e)},wi)}#h(){this.#u||(this.#p(),this.#s=setTimeout(()=>{this.#s=void 0,this.#u||this.removePopup()},Ti))}#g(e,t,n,r,i=this.#e.popoverManager.getPlacementBounds()){ar(e,{gutterWidth:this.#e.getGutterWidth(),placeAbove:r,viewport:i,x:t,y:n})}#_(e,t,n){let{getCharX:r,getLineY:i,getLineHeight:a,popoverManager:o}=this.#e,[s,c]=r(t,n),l=a(),u=i(t)+c*l,d=e.offsetHeight,f={top:u+l,bottom:u+l+d},p={top:u-d,bottom:u},m=t>=this.#n-3,h=o.getPlacementBounds(),g=o.choosePlacement({preferred:f,fallback:p,viewport:h,popoverHeight:d,atDocumentEdge:m,placementKey:Ei})===`fallback`;this.#g(e,s,g?u:u+l,g,h)}#v(){this.#i?.forEach(e=>e()),this.#i=void 0,this.#r?.remove(),this.#r=void 0,this.#l=void 0,this.#u=!1,this.#e.popoverManager.resetPlacement(Ei)}#y(e){if(e===this.#l)return;let t=this.#e.getOverlayElement();if(e>=this.#t.length||t==null)return;let{start:n,message:r,severity:i}=this.#t[e],{line:a,character:o}=n,s=this.#r;if(this.#e.popoverManager.resetPlacement(Ei),s!==void 0){ki(s,i);let t=s.firstElementChild;t?.dataset.markerMessage!==void 0&&(typeof r==`string`?t.textContent=r:r instanceof HTMLElement?t.replaceChildren(r):t.innerHTML=r.html),this.#_(s,a,o),this.#l=e;return}this.#r=H(`div`,{dataset:{editorWidget:``,markerPopup:``,[Ai(i)]:``},children:[H(`div`,{dataset:`markerMessage`,...typeof r==`string`?{textContent:r}:r instanceof HTMLElement?{children:[r]}:{innerHTML:r.html}})]},t),this.#_(this.#r,a,o),this.#l=e,this.#i=[U(this.#r,`mouseenter`,()=>{this.#u=!0,this.#p()}),U(this.#r,`mouseleave`,()=>{this.#u=!1,this.#h()})]}},Oi=[`error`,`warning`,`info`,`hint`];function ki(e,t){for(let t of Oi)delete e.dataset[Ai(t)];e.dataset[Ai(t)]=``}function Ai(e){switch(e){case`error`:return`markerError`;case`warning`:return`markerWarning`;case`info`:return`markerInfo`;case`hint`:return`markerHint`}}var ji=new Map([[`(`,`)`],[`[`,`]`],[`{`,`}`]]),Mi=new Map([...ji].map(([e,t])=>[t,e])),Ni=1e3,Pi=5e4;function Fi(e,t,n){let r=Ii(e,t,e.normalizePosition(n));if(r===void 0)return;let i=ji.get(r.char),a=Mi.get(r.char);if(i!==void 0)return Gi(r,zi(e,t,r,i));if(a!==void 0)return Gi(Bi(e,t,r,a),r)}function Ii(e,t,n){let r=Li(n);if(r!==void 0){let n=Ri(e,t,r);if(n!==void 0)return n}return Ri(e,t,n)}function Li(e){if(e.character>0)return{line:e.line,character:e.character-1}}function Ri(e,t,n){let r=e.getLineText(n.line)[n.character];if(!(r===void 0||!ji.has(r)&&!Mi.has(r)||Vi(t,n)))return{...n,char:r}}function zi(e,t,n,r){let i=0,a=0,o=0;for(let s=n.line;s<e.lineCount;s++){if(a>=Ni)return;a++;let c=e.getLineText(s),l=t.getStringCommentRegexpRangesInLine(s),u={index:0},d=s===n.line?n.character:0;for(let e=d;e<c.length;e++){if(o>=Pi)return;if(o++,Ui(l,e,u))continue;let t=c[e];if(t===n.char)i++;else if(t===r&&(i--,i===0))return{line:s,character:e,char:t}}}}function Bi(e,t,n,r){let i=0,a=0,o=0;for(let s=n.line;s>=0;s--){if(a>=Ni)return;a++;let c=e.getLineText(s),l=t.getStringCommentRegexpRangesInLine(s),u={index:l===null?-1:l.length-1},d=s===n.line?n.character:c.length-1;for(let e=d;e>=0;e--){if(o>=Pi)return;if(o++,Wi(l,e,u))continue;let t=c[e];if(t===n.char)i++;else if(t===r&&(i--,i===0))return{line:s,character:e,char:t}}}}function Vi(e,t){return Hi(e.getStringCommentRegexpRangesInLine(t.line),t.character)}function Hi(e,t){if(e===null)return!1;for(let[n,r]of e){if(t<n)return!1;if(t<r)return!0}return!1}function Ui(e,t,n){if(e===null)return!1;for(;n.index<e.length&&t>=e[n.index][1];)n.index++;let r=e[n.index];return r!==void 0&&t>=r[0]}function Wi(e,t,n){if(e===null)return!1;for(;n.index>=0&&t<e[n.index][0];)n.index--;let r=e[n.index];return r!==void 0&&t<r[1]}function Gi(e,t){if(!(e===void 0||t===void 0))return[Ki(e),Ki(t)]}function Ki(e){return{start:{line:e.line,character:e.character},end:{line:e.line,character:e.character+1}}}var qi=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
459
|
-
<symbol id="diffs-editor-icon-close" viewBox="0 0 16 16">
|
|
460
|
-
<path fill="currentColor" d="M3.21967 3.21967C3.51256 2.92678 3.98744 2.92678 4.28033 3.21967L8 6.93934L11.7197 3.21967C12.0126 2.92678 12.4874 2.92678 12.7803 3.21967C13.0732 3.51256 13.0732 3.98744 12.7803 4.28033L9.06066 8L12.7803 11.7197C13.0732 12.0126 13.0732 12.4874 12.7803 12.7803C12.4874 13.0732 12.0126 13.0732 11.7197 12.7803L8 9.06066L4.28033 12.7803C3.98744 13.0732 3.51256 13.0732 3.21967 12.7803C2.92678 12.4874 2.92678 12.0126 3.21967 11.7197L6.93934 8L3.21967 4.28033C2.92678 3.98744 2.92678 3.51256 3.21967 3.21967Z"></path>
|
|
461
|
-
</symbol>
|
|
462
|
-
<symbol id="diffs-editor-icon-arrow-up" viewBox="0 0 16 16">
|
|
463
|
-
<path fill="currentColor" transform="rotate(-90 8 8)" d="M8.46967 2.21967C8.17678 2.51256 8.17678 2.98744 8.46967 3.28033L12.4393 7.25H1.75C1.33579 7.25 1 7.58579 1 8C1 8.41421 1.33579 8.75 1.75 8.75H12.4393L8.46967 12.7197C8.17678 13.0126 8.17678 13.4874 8.46967 13.7803C8.76256 14.0732 9.23744 14.0732 9.53033 13.7803L14.7803 8.53033C15.0732 8.23744 15.0732 7.76256 14.7803 7.46967L9.53033 2.21967C9.23744 1.92678 8.76256 1.92678 8.46967 2.21967Z"></path>
|
|
464
|
-
</symbol>
|
|
465
|
-
<symbol id="diffs-editor-icon-arrow-down" viewBox="0 0 16 16">
|
|
466
|
-
<path fill="currentColor" transform="rotate(90 8 8)" d="M8.46967 2.21967C8.17678 2.51256 8.17678 2.98744 8.46967 3.28033L12.4393 7.25H1.75C1.33579 7.25 1 7.58579 1 8C1 8.41421 1.33579 8.75 1.75 8.75H12.4393L8.46967 12.7197C8.17678 13.0126 8.17678 13.4874 8.46967 13.7803C8.76256 14.0732 9.23744 14.0732 9.53033 13.7803L14.7803 8.53033C15.0732 8.23744 15.0732 7.76256 14.7803 7.46967L9.53033 2.21967C9.23744 1.92678 8.76256 1.92678 8.46967 2.21967Z"></path>
|
|
467
|
-
</symbol>
|
|
468
|
-
<symbol id="diffs-editor-icon-case" viewBox="0 0 16 16">
|
|
469
|
-
<path fill="currentColor" d="M12.2969 12.9969C10.7109 12.9969 9.61719 12.0125 9.61719 10.5047C9.61719 9.06719 10.6172 8.16094 12.5 8.15312H14.6641V7.31719C14.6641 6.23906 14.0391 5.64531 12.9297 5.64531C11.875 5.64531 11.2734 6.18437 11.1953 7.00469H9.92969C10.0156 5.56719 10.9922 4.52031 12.9766 4.52031C14.7266 4.52031 16 5.47344 16 7.2V12.8641H14.7109V11.8406H14.6719C14.2578 12.5047 13.5078 12.9969 12.2969 12.9969ZM12.6562 11.8797C13.8047 11.8797 14.6641 11.1609 14.6641 10.1375V9.18437H12.6016C11.4766 9.18437 10.9922 9.71562 10.9922 10.4578C10.9922 11.4266 11.7969 11.8797 12.6562 11.8797Z"></path>
|
|
470
|
-
<path fill="currentColor" d="M1.42188 12.8641H0L3.79688 2H5.1875L8.98438 12.8641H7.54688L6.46875 9.66094H2.5L1.42188 12.8641ZM4.50781 3.60938H4.46875L2.86719 8.55937H6.10156L4.50781 3.60938Z"></path>
|
|
471
|
-
</symbol>
|
|
472
|
-
<symbol id="diffs-editor-icon-whole-word" viewBox="0 0 16 16">
|
|
473
|
-
<path fill="currentColor" d="M11.4089 9.99449C11.1417 9.99449 10.8961 9.95595 10.6722 9.87887C10.4519 9.80179 10.2605 9.69167 10.098 9.54852C9.93551 9.40537 9.81453 9.23469 9.73508 9.03648H9.67007V9.91191H8.5V2H9.70258V5.01721H9.76758C9.81092 4.86671 9.88314 4.7309 9.98426 4.60977C10.089 4.48497 10.2136 4.37853 10.358 4.29043C10.5025 4.19867 10.6668 4.13076 10.851 4.08672C11.0352 4.039 11.2302 4.01514 11.436 4.01514C11.8802 4.01514 12.2648 4.11792 12.5898 4.32347C12.9149 4.52535 13.164 4.81532 13.3374 5.19339C13.5107 5.57146 13.5974 6.02478 13.5974 6.55334V7.45079C13.5974 7.97568 13.5089 8.429 13.332 8.81074C13.1586 9.1888 12.9076 9.48061 12.579 9.68617C12.2504 9.89172 11.8604 9.99449 11.4089 9.99449ZM11.0785 8.99243C11.353 8.99243 11.5859 8.92636 11.7773 8.79422C11.9723 8.66208 12.1204 8.46937 12.2215 8.2161C12.3226 7.95916 12.3732 7.65267 12.3732 7.29663V6.73503C12.3732 6.37164 12.3208 6.06332 12.2161 5.81005C12.115 5.55311 11.9669 5.35673 11.7719 5.22092C11.5769 5.08511 11.3385 5.01721 11.0568 5.01721C10.7824 5.01721 10.5422 5.08328 10.3364 5.21542C10.1341 5.34389 9.97704 5.52925 9.86509 5.77151C9.75675 6.01009 9.70258 6.2964 9.70258 6.63042V7.47281C9.70258 7.77013 9.76036 8.03441 9.87592 8.26566C9.99509 8.49323 10.1576 8.67125 10.3635 8.79972C10.5729 8.92819 10.8113 8.99243 11.0785 8.99243Z"></path>
|
|
474
|
-
<path fill="currentColor" d="M4.70482 9.99449C4.15229 9.99449 3.70087 9.83482 3.35057 9.51548C3.00388 9.19247 2.83054 8.75935 2.83054 8.2161C2.83054 7.70223 3.00207 7.28745 3.34515 6.97178C3.69184 6.65244 4.19562 6.49277 4.8565 6.49277H6.30284V5.94769C6.30284 5.61367 6.20533 5.36774 6.01032 5.20991C5.81531 5.04841 5.55349 4.96765 5.22485 4.96765C5.00817 4.96765 4.82941 4.99702 4.68857 5.05575C4.54773 5.11081 4.43758 5.18789 4.35813 5.28699C4.27868 5.38243 4.22271 5.49621 4.19021 5.62835H3.04722C3.06527 5.3861 3.12305 5.16586 3.22056 4.96765C3.32168 4.76577 3.46252 4.59326 3.64309 4.4501C3.82727 4.30328 4.05297 4.19133 4.32021 4.11425C4.59106 4.03716 4.90525 3.99862 5.26277 3.99862C5.67086 3.99862 6.04463 4.06286 6.38409 4.19133C6.72356 4.31613 6.99441 4.52168 7.19665 4.80798C7.39888 5.09429 7.5 5.4797 7.5 5.96421V9.9064H6.35701V9.1521H6.30284C6.21978 9.29892 6.10783 9.43657 5.96698 9.56504C5.82614 9.69351 5.65099 9.79812 5.44153 9.87887C5.23569 9.95595 4.99012 9.99449 4.70482 9.99449ZM5.07318 9.04749C5.3043 9.04749 5.51196 8.99977 5.69613 8.90434C5.88031 8.80523 6.02657 8.67309 6.13491 8.50791C6.24686 8.34274 6.30284 8.1537 6.30284 7.94081V7.31314H5.04609C4.69579 7.31314 4.43939 7.39206 4.27688 7.5499C4.11798 7.70773 4.03853 7.90961 4.03853 8.15554C4.03853 8.4602 4.14326 8.68594 4.35272 8.83276C4.56578 8.97591 4.80594 9.04749 5.07318 9.04749Z"></path>
|
|
475
|
-
<path fill="currentColor" d="M2.5 12.5L13.5 12.5C14.3284 12.5 15 11.8284 15 11V9.5C15 9.22386 15.2239 9 15.5 9C15.7761 9 16 9.22386 16 9.5V11C16 12.3807 14.8807 13.5 13.5 13.5L2.5 13.5C1.11929 13.5 -7.56324e-07 12.3807 0 11L6.55675e-08 9.5C3.58362e-07 9.22386 0.223858 9 0.5 9C0.776142 9 1 9.22386 1 9.5L1 11C0.999999 11.8284 1.67157 12.5 2.5 12.5Z"></path>
|
|
476
|
-
</symbol>
|
|
477
|
-
<symbol id="diffs-editor-icon-regex" viewBox="0 0 16 16">
|
|
478
|
-
<path fill="currentColor" d="M8.60788 6.59074C8.78227 6.46701 9.02141 6.60508 9.00146 6.81797L8.77564 9.22666C8.76189 9.37331 8.87726 9.5 9.02455 9.5H9.97548C10.1228 9.5 10.2381 9.37331 10.2244 9.22667L9.99858 6.81801C9.97862 6.60513 10.2178 6.46706 10.3922 6.59079L12.3652 7.99066C12.4853 8.07589 12.6527 8.03932 12.7264 7.91177L13.2018 7.08823C13.2755 6.96068 13.2234 6.79742 13.0896 6.73601L10.8907 5.72723C10.6963 5.63807 10.6963 5.36193 10.8907 5.27277L13.0896 4.264C13.2234 4.20258 13.2755 4.03932 13.2018 3.91177L12.7263 3.08824C12.6527 2.96068 12.4853 2.92411 12.3652 3.00934L10.3922 4.40921C10.2178 4.53294 9.97862 4.39486 9.99858 4.18198L10.2244 1.77334C10.2381 1.62669 10.1228 1.5 9.97548 1.5H9.02455C8.87726 1.5 8.76189 1.62669 8.77564 1.77334L9.00146 4.18203C9.02141 4.39491 8.78227 4.53298 8.60788 4.40926L6.63479 3.00934C6.51466 2.92411 6.34726 2.96068 6.27362 3.08823L5.79815 3.91177C5.72451 4.03932 5.77654 4.20258 5.91041 4.26399L8.10929 5.27277C8.30363 5.36193 8.30363 5.63807 8.10929 5.72723L5.91041 6.73601C5.77653 6.79742 5.7245 6.96068 5.79814 7.08824L6.27361 7.91177C6.34725 8.03932 6.51466 8.07589 6.63478 7.99066L8.60788 6.59074Z"></path>
|
|
479
|
-
<path fill="currentColor" d="M4 11C3.44772 11 3 11.4477 3 12V13C3 13.5523 3.44772 14 4 14H5C5.55228 14 6 13.5523 6 13V12C6 11.4477 5.55228 11 5 11H4Z"></path>
|
|
480
|
-
</symbol>
|
|
481
|
-
<symbol id="diffs-editor-icon-replace" viewBox="0 0 16 16">
|
|
482
|
-
<path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M5.28033 5.71967C5.57322 6.01256 5.57322 6.48744 5.28033 6.78033L3.56066 8.5H11.75C12.7165 8.5 13.5 7.7165 13.5 6.75V2.75C13.5 2.33579 13.8358 2 14.25 2C14.6642 2 15 2.33579 15 2.75V6.75C15 8.54493 13.5449 10 11.75 10H3.56066L5.28033 11.7197C5.57322 12.0126 5.57322 12.4874 5.28033 12.7803C4.98744 13.0732 4.51256 13.0732 4.21967 12.7803L1.21967 9.78033C0.926777 9.48744 0.926777 9.01256 1.21967 8.71967L4.21967 5.71967C4.51256 5.42678 4.98744 5.42678 5.28033 5.71967Z"></path>
|
|
483
|
-
</symbol>
|
|
484
|
-
<symbol id="diffs-editor-icon-replace-all" viewBox="0 0 16 16">
|
|
485
|
-
<path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M10.7197 0.21967C11.0126 -0.0732233 11.4874 -0.0732233 11.7803 0.21967L14.7803 3.21967C15.0732 3.51256 15.0732 3.98744 14.7803 4.28033L11.7803 7.28033C11.4874 7.57322 11.0126 7.57322 10.7197 7.28033C10.4268 6.98744 10.4268 6.51256 10.7197 6.21967L12.4393 4.5H4.25C3.2835 4.5 2.5 5.2835 2.5 6.25V6.875C2.5 7.28921 2.16421 7.625 1.75 7.625C1.33579 7.625 1 7.28921 1 6.875V6.25C1 4.45507 2.45508 3 4.25 3H12.4393L10.7197 1.28033C10.4268 0.987437 10.4268 0.512563 10.7197 0.21967ZM5.28033 8.71967C5.57322 9.01256 5.57322 9.48744 5.28033 9.78033L3.56066 11.5H11.75C12.7165 11.5 13.5 10.7165 13.5 9.75V9.125C13.5 8.71079 13.8358 8.375 14.25 8.375C14.6642 8.375 15 8.71079 15 9.125V9.75C15 11.5449 13.5449 13 11.75 13H3.56066L5.28033 14.7197C5.57322 15.0126 5.57322 15.4874 5.28033 15.7803C4.98744 16.0732 4.51256 16.0732 4.21967 15.7803L1.21967 12.7803C0.926777 12.4874 0.926777 12.0126 1.21967 11.7197L4.21967 8.71967C4.51256 8.42678 4.98744 8.42678 5.28033 8.71967Z"></path>
|
|
486
|
-
</symbol>
|
|
487
|
-
</svg>`,Ji=()=>{let e=document.createElement(`div`);e.innerHTML=qi;let t=e.firstElementChild;if(t===null||!(t instanceof SVGSVGElement))throw Error(`Failed to create sprite element`);return t},Yi=(e,t=16)=>`<svg width="${t}" height="${t}" aria-hidden="true" focusable="false">
|
|
488
|
-
<use href="#diffs-editor-icon-${e}"></use>
|
|
489
|
-
</svg>`,Xi=class{#e;#t;#n;#r;#i;#a;constructor(e){let{textDocument:t,containerElement:n,defaultQuery:r,mode:i=`find`,initialMatch:a,scrollToMatch:o,applyReplace:s,onUpdate:c,onClose:l}=e,u={text:r,replaceText:``,caseSensitive:!1,wholeWord:!1,regex:!1},d={all:[],current:void 0},f=H(`div`,{dataset:{matches:``,noMatches:``},textContent:`No results`}),p=e=>{d.all=u.text===``?[]:t.search(u);let n=d.all.length===0;if(k.disabled=n,A.disabled=n,n){f.textContent=`No results`,f.dataset.noMatches=``,d.current=void 0,c([]);return}if(delete f.dataset.noMatches,e?.syncSelection===!1){m(c(d.all,{syncSelection:!1}));return}m(c(d.all))};this.#n=p;let m=e=>{if(e===void 0)f.textContent=`${d.all.length} results`;else{let[t,n]=e;f.textContent=`${d.all.findIndex(e=>e[0]===t&&e[1]===n)+1} of ${d.all.length}`}d.current=e},h=(e,t)=>{u[e]=t,p()},g=(e=!1,t=!1)=>{let n=d.all,r=n[0];if(n.length>0)if(e){let e=d.current?.[0]??0;r=n.at(-1);for(let t of n)if(t[1]<=e)r=t;else break}else{let e=d.current?.[1]??0;for(let t of n)if(t[0]>=e){r=t;break}}r!==void 0&&(m(r),o(r,t)),d.current=r};this.#i=e=>g(e,!0);let _=(e,n)=>({start:e,end:n,text:pn(e=>t.positionAt(e),e=>t.offsetAt(e),e=>t.getLineText(e),u,e,n)}),v=()=>{if(u.text===``||d.all.length===0)return;let e=d.current;if(e===void 0&&(g(!1,!0),e=d.current,e===void 0))return;let[t,n]=e,r=_(t,n);s([r]),o([t+r.text.length,t+r.text.length],!0),d.current=void 0,p()},y=()=>{u.text===``||d.all.length===0||(s(d.all.map(([e,t])=>_(e,t))),d.current=void 0,p())},b=()=>{this.cleanup(),l()};this.#a=b;let x=e=>H(`button`,{type:`button`,title:e.label,ariaLabel:e.label,dataset:{searchIcon:``,...e.dataset},innerHTML:Yi(e.icon,e.size??16),onclick:e.onClick}),S=(e,t,n)=>{let r=x({icon:e,label:t,size:14,onClick:()=>{let e=!u[n];r.ariaPressed=String(e),h(n,e)}});return r.ariaPressed=String(u[n]),r},C=S(`case`,`Match Case`,`caseSensitive`),ee=S(`whole-word`,`Whole Word`,`wholeWord`),w=S(`regex`,`Regexp`,`regex`),T=H(`input`,{type:`text`,placeholder:`Replace`,dataset:`replace`,value:``,oninput:e=>{u.replaceText=e.target.value},onkeydown:e=>{if(e.isComposing)return;let t=Tn(e);e.key===`Escape`?(e.preventDefault(),b()):e.key===`Enter`?(e.preventDefault(),v()):t!==void 0&&(e.preventDefault(),g(t===`previous`,!0))}});this.#t=H(`input`,{type:`text`,placeholder:`Search`,dataset:`search`,value:r,oninput:e=>{u.text=e.target.value,d.current=void 0,p()},onkeydown:e=>{let t=Tn(e);e.key===`Escape`?(e.preventDefault(),b()):e.key===`Enter`?(e.preventDefault(),g(e.shiftKey,!0)):t===void 0?bn(e)&&(e.key===`f`||e.code===`KeyF`)&&(e.preventDefault(),ne(e.altKey?`replace`:`find`)):(e.preventDefault(),g(t===`previous`,!0))}});let E=H(`div`,{dataset:`searchToggles`,children:[C,ee,w]}),te=H(`div`,{dataset:{inputBox:``,find:``},children:[this.#t,E]}),D=H(`div`,{dataset:{inputBox:``,replace:``,replaceCell:``},children:[T]}),O=H(`div`,{dataset:{replaceActions:``,replaceCell:``},children:[x({icon:`replace`,label:`Replace`,onClick:v}),x({icon:`replace-all`,label:`Replace All`,onClick:y})]}),k=x({icon:`arrow-up`,label:`Previous`,onClick:()=>{g(!0)}}),A=x({icon:`arrow-down`,label:`Next`,onClick:()=>{g()}});k.disabled=!0,A.disabled=!0;let j=H(`div`,{dataset:`searchNav`,children:[k,A]}),M=x({icon:`close`,label:`Close`,onClick:b,dataset:{searchClose:``}}),N=H(`div`,{dataset:{searchGrid:``,mode:i},children:[te,D,O,f,j,M]}),ne=e=>{N.dataset.mode=e,this.#t.focus(),this.#t.select()};this.#r=ne,this.#e=H(`div`,{dataset:`searchPanel`,children:[H(`div`,{dataset:`editorWidget`,children:[N]})]}),d.current=a,n.before(this.#e),requestAnimationFrame(()=>{a===void 0?c([]):p(),this.#t.select()})}focus(){this.#t.focus()}navigate(e){this.#i?.(e)}updateMatches(e){this.#n?.(e)}setMode(e){this.#r?.(e)}close(){this.#a?.()}cleanup(){this.#e.remove()}},Zi=class{#e;#t;#n;constructor(e,t,n){this.#e=H(`div`,{dataset:{editorWidget:``,selectionActionPopover:``},contentEditable:`false`,children:[e]},t),this.#t=this.#e.offsetHeight,this.#n=new ResizeObserver(()=>{let e=this.#e.offsetHeight;e!==this.#t&&(this.#t=e,n())}),this.#n.observe(this.#e)}reposition(e,t,n,r,i){ar(this.#e,{gutterWidth:n,placeAbove:r,viewport:i,x:e,y:t})}get height(){return this.#t}cleanup(){this.#n.disconnect(),this.#e.remove()}};function Qi(e){return{selections:e.selections?.map(e=>({start:{...e.start},end:{...e.end},direction:e.direction})),view:e.view===void 0?void 0:{...e.view}}}function $i(e){return typeof e==`object`?e:e===`indexedDB`?new ia:new ea}var ea=class{#e=new Map;get(e){let t=this.#e.get(e);return t===void 0?void 0:Qi(t)}set(e,t){this.#e.set(e,Qi(t))}},ta=`pierre-diffs-editor-state`,na=1,ra=`states`,ia=class{#e=aa();async get(e){let t=await this.#e;if(t===void 0)return;let n=await oa(t.transaction(ra,`readonly`).objectStore(ra).get(e));return n===void 0?void 0:Qi(n)}async set(e,t){let n=await this.#e;n!==void 0&&await oa(n.transaction(ra,`readwrite`).objectStore(ra).put(Qi(t),e))}};function aa(){try{let e=globalThis.indexedDB;if(e===void 0)return Promise.resolve(void 0);let t=e.open(ta,na);return t.onupgradeneeded=()=>{let e=t.result;e.objectStoreNames.contains(ra)||e.createObjectStore(ra)},oa(t)}catch{return Promise.resolve(void 0)}}function oa(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error)})}var sa=4096,ca=/\p{Mark}/u,la=class{#e;#t;#n;#r=new Map;ch=-1;tabSize=2;lineHeight=20;paddingTop=0;init(e){if(this.#e===e&&this.#t!==void 0&&this.ch!==-1)return;if(this.#e=e,this.#t??=document.createElement(`canvas`).getContext(`2d`)??void 0,this.#t===void 0)throw Error(`Could not get canvas context`);let t=e.parentElement;if(t!==null){let{paddingTop:e}=getComputedStyle(t);e.endsWith(`px`)&&(this.paddingTop=parseFloat(e.slice(0,-2)))}let{fontSize:n,fontFamily:r,tabSize:i,lineHeight:a}=getComputedStyle(e);a.endsWith(`px`)?this.lineHeight=parseFloat(a.slice(0,-2)):n.endsWith(`px`)&&(this.lineHeight=Bn(parseFloat(n.slice(0,-2))*parseFloat(a)));let o=n+` `+r;(this.#n!==o||this.ch===-1)&&(this.#n=o,this.#t.font=o,this.ch=this.canvasMeasureTextWidth(`0`),this.clearTextWidthCache());let s=parseInt(i,10);Number.isNaN(s)||(this.tabSize=s)}remeasureCharacterWidth(){if(this.#t===void 0||this.#n===void 0)return!1;this.#t.font=this.#n;let e=this.canvasMeasureTextWidth(`0`),t=e!==this.ch;t&&(this.ch=e);let n=this.#a();return t||n}measureTextWidth(e){if(!e.includes(` `))return this.#i(e);if(this.#t===void 0)throw Error(`Metrics not initialized`);let t=pa(e,this.tabSize);if(t!==-1)return t*this.ch;let n=0,r=0,i=this.tabSize*this.ch;for(let t=0;t<e.length;t++)if(e.charCodeAt(t)===9){if(t>r&&(n+=this.#i(e.slice(r,t))),i>0){let e=n%i;n+=e===0?i:i-e}r=t+1}return r<e.length&&(n+=this.#i(e.slice(r))),Bn(n)}#i(e){return ua(e)?this.domMeasureTextWidth(e):this.canvasMeasureTextWidth(e)}canvasMeasureTextWidth(e){if(this.#t===void 0)throw Error(`Metrics not initialized`);return Bn(this.#t.measureText(e).width)}domMeasureTextWidth(e){if(this.#e===void 0)throw Error(`Metrics not initialized`);let t=e+`|`+this.#n,n=this.#r.get(t);if(n!==void 0)return n;let r=H(`span`,{style:{position:`absolute`,top:`0`,left:`0`,visibility:`hidden`,pointerEvents:`none`,whiteSpace:`pre`,font:`inherit`},textContent:e},this.#e),i;try{i=Bn(r.getBoundingClientRect().width)}finally{r.remove()}if(this.#r.size>=sa){let e=this.#r.keys().next().value;e!==void 0&&this.#r.delete(e)}return this.#r.set(t,i),i}clearTextWidthCache(){this.#a()}#a(){let e=this.#r.size>0;return this.#r.clear(),e}};function ua(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n>=55296&&n<=57343||n===8205||n===65038||n===65039||n>127&&ca.test(e.charAt(t)))return!0}return!1}function da(e,t){let n=Math.max(0,Math.min(t,e.length));if(n===0||n===e.length||!ua(e))return n;let r=Gn();if(r!==void 0){for(let t of r.segment(e)){let e=t.index,r=e+t.segment.length;if(n>e&&n<r)return r;if(n<=e)break}return n}let i=0;for(let t of e){let e=i+t.length;if(n>i&&n<e)return e;if(n<=i)break;i=e}return n}function fa(e){if(!ua(e))return;let t=[0],n=Gn();if(n!==void 0){for(let r of n.segment(e))t.push(r.index+r.segment.length);return t}let r=0;for(let n of e)r+=n.length,t.push(r);return t}function pa(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(i>127)return-1;n+=i===9?t-n%t:1}return n}var ma=500,ha=class{#e;#t;#n;#r=`dark`;#i=``;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=!1;#h=[xe];#g=[];#_=-1;#v=!0;#y=!1;#b=0;#x;#S=0;#C=new Map;#w=!1;#T=zn(async e=>{if(this.#m)return;let{startingLine:t=0,totalLines:n=1/0}=e??{},r=Math.min(n===1/0?1/0:t+n,this.#o.lineCount);if(this.#t===void 0&&!va(this.#o.languageId)){if(await this.#e.loadLanguage(this.#o.languageId),this.#m)return;this.#t=this.#e.getLanguage(this.#o.languageId)}this.#A(),this.#B(r)},500);#E=({data:e})=>{if(typeof e!=`object`||!e)return;let{type:t,jobId:n}=e;t===`tokenize`&&typeof n==`number`&&n===this.#b&&this.#V(n)};get themeType(){return this.#r}getStringCommentRegexpRangesInLine(e){if(!this.#d||e<0||e>=this.#o.lineCount||(this.#j(),this.#t===void 0))return null;if(!this.#C.has(e)){this.#B(e);let t=this.#h[e]??xe,n=this.#I(e,t);this.#h[e+1]=n.state}return this.#C.get(e)??null}constructor({codeOptions:e,highlighter:t,textDocument:n,matchBrackets:r,setStyle:i,onDeferTokenize:a,onThemeChange:o,__debug:s}){let{themeType:c=`system`,theme:l=we,tokenizeMaxLineLength:u=1e3}=e;this.#n=window.matchMedia(`(prefers-color-scheme: dark)`);let d;if(d=c===`system`?this.#O():c,typeof l!=`string`&&c===`system`){let e=new MutationObserver(e=>{for(let{type:t,attributeName:n}of e)if(t===`attributes`&&n!==null&&(n===`class`||n.startsWith(`data-`))){let e=this.#O();this.#D(l[e],e);break}});e.observe(document.documentElement,{attributes:!0}),e.observe(document.body,{attributes:!0}),this.#p=[U(this.#n,`change`,()=>{let e=this.#O();this.#D(l[e],e)}),()=>e.disconnect()]}this.#e=t,this.#o=n,this.#s=u,this.#c=i,this.#l=a,this.#u=o,this.#d=r!==!1,this.#f=s??!1,this.#j(),this.#a=[],this.#k(typeof l==`string`?l:l[d],d)}#D(e,t){this.#k(e,t),this.stopBackgroundTokenize(),this.#h=[xe],this.#g=[],this.#t!==void 0&&this.#o.lineCount>0&&this.#F(0),this.#u?.()}#O(){try{if(typeof document<`u`&&typeof getComputedStyle==`function`&&document.body!=null)return getComputedStyle(document.body).colorScheme===`dark`?`dark`:`light`}catch{}return this.#n.matches?`dark`:`light`}syncTheme(e){let{themeType:t=`system`,theme:n=we}=e,r=t===`system`?this.#O():t,i=typeof n==`string`?n:n[r];r===this.#r&&i===this.#i||this.#D(i,r)}#k(e,t){let{theme:n,colorMap:r}=this.#e.setTheme(e),{colors:i={}}=this.#e.getTheme(e),a=i[`editor.selectionBackground`],o=i[`editor.lineHighlightBackground`],s=i[`editorCursor.foreground`],c=i[`editor.findMatchBackground`],l=i[`editor.findMatchHighlightBackground`],u=i[`editorBracketMatch.background`],d=i[`editorBracketMatch.border`],f=i[`editorHint.foreground`],p=i[`editorInfo.foreground`],m=i[`editorWarning.foreground`],h=i[`editorError.foreground`];this.#c(`:host {
|
|
490
|
-
--diffs-editor-selection-bg: ${a??`var(--diffs-line-bg)`};
|
|
491
|
-
--diffs-editor-line-highlight-bg: ${o??`var(--diffs-line-bg)`};
|
|
492
|
-
--diffs-editor-match-bg: ${c??`initial`};
|
|
493
|
-
--diffs-editor-match-highlight-bg: ${l??`initial`};
|
|
494
|
-
--diffs-editor-bracket-match-bg: ${u??`initial`};
|
|
495
|
-
--diffs-editor-bracket-match-border: ${d??`initial`};
|
|
496
|
-
--diffs-editor-cursor-fg: ${s??`initial`};
|
|
497
|
-
--diffs-editor-hint-fg: ${f??`initial`};
|
|
498
|
-
--diffs-editor-info-fg: ${p??`initial`};
|
|
499
|
-
--diffs-editor-warning-fg: ${m??`initial`};
|
|
500
|
-
--diffs-editor-error-fg: ${h??`initial`};
|
|
501
|
-
}`),this.#i=e,this.#r=t??n.type,this.#a=r}#A(){if(this.#i===``)return;let{colorMap:e}=this.#e.setTheme(this.#i);this.#a=e}cleanUp(){this.#m=!0,this.stopBackgroundTokenize(),this.#N(),this.#p?.forEach(e=>e()),this.#p=void 0}tokenize(e,t){if(this.#j(),this.#A(),this.#t===void 0&&!va(this.#o.languageId))throw Error(`Grammar for language "${this.#o.languageId}" not loaded`);if(this.#d)for(let t of this.#C.keys())t>=e.startLine&&this.#C.delete(t);let{lineCount:n}=this.#o,{startingLine:r=0,totalLines:i=1/0}=t??{},a=i===1/0?n:Math.min(r+i,n),o=e.startLine,s=Math.max(r,o),c=t!==void 0&&i!==1/0&&e.lineDelta>0&&o<a&&e.endLine>=a,l=e.lineDelta===0,u=l||t===void 0||o>=s,d=e.changedLineRanges??[[o,e.endLine]];this.#g=[];let f=-1;if(o<s)for(let[e,t]of d)e<s&&(f=Math.max(f,Math.min(t,s-1)));let p=f>=o&&(l||e.lineDelta<0);l?this.#B(o):(this.#R(e),(t===void 0||o>=s)&&this.#B(s));let m=0,h=d[m][1],g,_=0,v=l?d[m][0]:s,y=!1,b=new Map,x=p?new Map:void 0;if(x!==void 0&&!l){let e=Math.min(f+1,s,a);if(e>o){this.#B(e);let t=o,n=this.#h[t]??xe;for(;t<e;t++){let e=this.#I(t,n);n=e.state,x.set(t,e.resolvedTokens)}this.#h[e]=n}}let S=this.#h[v]??xe;for(;v<a;){let e=l?this.#h[v+1]:void 0;u&&(this.#h[v]=S);let{resolvedTokens:t,state:n}=this.#I(v,S);if(S=n,v>=s?b.set(v,t):x?.set(v,t),u&&(this.#h[v+1]=S),y=v>=h&&l&&e!==void 0&&S.equals(e),y){m++;let e=d[m];if(e===void 0)break;if(e[0]>=a){g=e[0],_=m;break}this.#h[e[0]]===void 0?(h=e[1],v++):(v=e[0],S=this.#h[v]??S,h=e[1]),y=!1;continue}v++}if(u&&(v<a?this.#h[v+1]=S:this.#h[v]=S),x!==void 0&&x.size>0&&this.#l(x,this.#r),g!==void 0)this.#F(g,d,_);else if(!y&&v<n){let e=c&&o>=s?a:o<s&&!l?o:v;this.#F(e,d,m)}return b}prebuildStateStack(e){this.#j(),this.#T(e)}stopBackgroundTokenize(){this.#v||(this.#v=!0,this.#y=!1,this.#_=-1,this.#x=void 0,this.#S=0,this.#g=[],this.#N())}pauseBackgroundTokenize(){this.#v||this.#y||(this.#f&&console.log(`[diffs/editor] background tokenization paused`,{jobId:this.#b}),this.#y=!0)}resumeBackgroundTokenize(){this.#v||!this.#y||this.#t===void 0||this.#_<0||(this.#f&&console.log(`[diffs/editor] background tokenization resumed`,{jobId:this.#b}),this.#y=!1,this.#P(this.#b))}#j(){this.#t===void 0&&!va(this.#o.languageId)&&this.#e.getLoadedLanguages().includes(this.#o.languageId)&&(this.#t=this.#e.getLanguage(this.#o.languageId))}#M(){this.#w||=(globalThis.addEventListener(`message`,this.#E),!0)}#N(){this.#w&&=(globalThis.removeEventListener(`message`,this.#E),!1)}#P(e){globalThis.postMessage({type:`tokenize`,jobId:e})}#F(e,t,n=0){if(va(this.#o.languageId))return;let r=++this.#b;this.#f&&console.log(`[diffs/editor] background tokenization scheduled`,{jobId:r,startLine:e,changedLineRanges:t,changedRangeIndex:n}),this.#v=!1,this.#y=!1,this.#_=e,this.#x=t,this.#S=n,this.#M(),this.#P(r)}#I(e,t){let n=this.#o.getLineText(e);if(n.length>this.#s)return console.warn(`[diffs] Line(${e}) too long to tokenize: ${n.length}`),this.#L(e,null),{resolvedTokens:[[0,``,n]],state:t};if(this.#t===void 0||n===``||n.trim()===``)return this.#L(e,null),{resolvedTokens:[[0,``,n]],state:t};let r=ga(this.#t,this.#a,n,t,ma,this.#d);return this.#L(e,r.bracketIgnoredRanges),{resolvedTokens:r.resolvedTokens,state:r.ruleStack}}#L(e,t){this.#d&&this.#C.set(e,t)}#R(e){let t=e.changedLineChanges??[[e.startLine,e.endLine,e.lineDelta]],n=this.#h.slice();for(let[e,r,i]of t){if(i===0)continue;let t=r-e,a=e+(t-i)+1,o=e+t+1,s=n.length;if(i>0)for(let e=s-1;e>=a;e--){let t=e+i;e in n?n[t]=n[e]:Reflect.deleteProperty(n,t)}else{for(let e=a;e<s;e++){let t=e+i;e in n?n[t]=n[e]:Reflect.deleteProperty(n,t)}n.length=Math.max(Math.min(s,e+1),s+i)}for(let t=e+1;t<o;t++)Reflect.deleteProperty(n,t)}this.#h.length=Math.min(this.#h.length,e.startLine+1),n.length=Math.min(n.length,this.#o.lineCount+1);for(let t=0;t<=e.startLine;t++)Reflect.deleteProperty(n,t);this.#g=n}#z(e){return this.#g[e]??this.#h[e]}#B(e){let t=Math.min(Math.max(0,e),this.#o.lineCount);if(this.#h.length>t||this.#t===void 0)return;let n=this.#h.length-1,r=this.#h[n]??xe;for(;n<t;n++){this.#h[n]=r;let e=this.#o.getLineText(n);if(e.length<=this.#s&&e!==``&&e.trim()!==``){let t=ga(this.#t,this.#a,e,r,ma,this.#d);this.#L(n,t.bracketIgnoredRanges),r=t.ruleStack}else this.#L(n,null)}this.#h[n]=r}#V(e){if(this.#v||this.#y||this.#t===void 0||e!==this.#b)return;this.#A();let t=performance.now(),n=new Map,r=this.#o.lineCount,i=this.#x,a=this.#_,o=this.#h[a]??xe,s=!1,c=this.#S,l=i?.[c]?.[1];for(;a<r;){this.#h[a]=o;let e=l===void 0?void 0:this.#z(a+1),r=this.#o.getLineText(a);if(r.length>this.#s)console.warn(`[diffs] Line(${a}) too long to tokenize: ${r.length}`),n.set(a,[[0,``,r]]),this.#L(a,null);else if(r===``||r.trim()===``)n.set(a,[[0,``,r]]),this.#L(a,null);else{let e=ga(this.#t,this.#a,r,o,ma,this.#d);n.set(a,e.resolvedTokens),this.#L(a,e.bracketIgnoredRanges),o=e.ruleStack}if(this.#h[a+1]=o,s=l!==void 0&&a>=l&&e!==void 0&&o.equals(e),a++,s){c++;let e=i?.[c];if(e===void 0)break;if(l=e[1],this.#h[e[0]]===void 0)s=!1;else{a=e[0],o=this.#h[a]??o,s=!1;continue}}if(performance.now()-t>1)break}if(this.#l(n,this.#r),!(this.#v||this.#y||e!==this.#b)){if(s||a>=r){this.stopBackgroundTokenize();return}this.#_=a,this.#S=c,this.#P(e)}}};function ga(e,t,n,r,i,a=!0){let o=e.tokenizeLine2(n,r,i);o.stoppedEarly&&console.warn(`[diffs] Time limit reached when tokenizing line: ${n.substring(0,100)}`);let s=o.tokens,c=s.length/2,l=[],u=[];for(let e=0;e<c;e++){let r=s[2*e],i=e+1<c?s[2*e+2]:n.length;if(r===i)continue;let o=s[2*e+1],d=he.getForeground(o),f=n.slice(r,i);l.push([r,t[d],f]),a&&he.getTokenType(o)>0&&u.push([r,i])}return{ruleStack:o.ruleStack,resolvedTokens:l,bracketIgnoredRanges:u}}function _a(e){return e.map(([e,t,n])=>e===0&&t===``?n===``?H(`br`):n:H(`span`,{dataset:{char:e.toString()},style:`color:${t};`,textContent:n}))}function va(e){return e===`text`||e===`ansi`}function ya(e){let t=e.getSelection?.();if(t==null||t.rangeCount===0)return;let n=t.getRangeAt(0);return{collapsed:n.collapsed,startContainer:n.startContainer,startOffset:n.startOffset,endContainer:n.endContainer,endOffset:n.endOffset}}function ba(e){if(typeof e.cacheKey!=`string`||e.cacheKey.length===0)throw Error(`Editor persistState requires a non-empty file.cacheKey for "${e.name}". Provide a unique, stable cacheKey for every editable file.`);return e.cacheKey}function xa(e){return typeof e==`object`&&!!e&&`then`in e&&typeof e.then==`function`}var Sa=2,Ca=`selection-action`,wa=`application/vnd.pierre.diffs-selections+json`,Ta=class{#e;#t=new la;#n;#r;#i=new Map;#a;#o;#s=new Map;#c;#l=0;#u=!1;#d;#f;#p;#m;#h;#g;#_;#v=new Map;#y=new Map;#b=new Map;#x;#S;#C;#w;#T;#E;#D;#O;#k;#A;#j;#M;#N;#P;#F;#I;#L;#R;#z;#B;#V;#H=!1;#U=!1;#W=!1;#G=!1;#K=!1;#q=!1;#J=!1;#Y;#X=``;#Z;#Q;#$;#ee;#te;#ne;#re=!1;#ie=!1;#ae=!1;#oe=!1;#se;#ce=(e,t)=>{if(this.#N?.updateRenderCache(e,t,!1,!1),this.#L!==void 0&&this.#L.totalLines!==1/0){let{startingLine:t,totalLines:n}=this.#L,r=Math.min(t+n,this.#I?.lineCount??0);for(let[n,i]of e)if(n>=t&&n<r){let e=this.#Tt(n);e!==void 0&&e.replaceChildren(..._a(i))}}};constructor(e={}){this.#e=e}setOptions(e){let t=this.#e.persistStateStorage??`inMemory`,n={...this.#e,...e};if(n.persistState===!0&&this.#N?.type===`file`){let e=this.#N.__getCurrentFile?.()??this.#P;e!==void 0&&ba(e)}this.#e=n,this.#e.persistState!==!0&&(this.#i.clear(),this.#l++,this.#u=!1),(this.#e.persistStateStorage??`inMemory`)!==t&&(this.#l++,this.#a=void 0,this.#o=void 0,this.#s.clear())}edit(e){if(this.#e.persistState===!0&&e.type===`file`){let t=e.__getCurrentFile?.();t!==void 0&&ba(t)}let{useTokenTransformer:t,...n}=e.options;return t!==!0&&(e.setOptions({...n,useTokenTransformer:!0}),e.rerender()),this.#N=e,this.#Te(),this.#m=e.attachEditor(this),()=>this.cleanUp()}applyEdits(e,t=!0){let n=this.#I;if(n==null)throw Error(`Editor is not attached`);let r=this.#W,i=this.#$,a=i?.map(e=>[n.offsetAt(e.start),n.offsetAt(e.end)]),o=i===void 0?void 0:n.resolveEdits(e).sort((e,t)=>e.start-t.start),s=n.applyEdits(e,t,i);if(s===void 0)return;let c;i!==void 0&&a!==void 0&&o!==void 0&&(c=Fr(n,i,a,o),t&&n.setLastUndoSelectionsAfter(c)),this.#St(s,c,this.#Ct(s),{skipFocus:!r})}get canUndo(){return this.#I?.canUndo??!1}get canRedo(){return this.#I?.canRedo??!1}undo(){this.#je(`undo`)}redo(){this.#je(`redo`)}getFile(){let e=this.#P,t=this.#I;if(e===void 0||t===void 0)return;let n={...e};return Object.defineProperty(n,"contents",{enumerable:!0,get:()=>t.getText()}),n}getText(){return this.#I?.getText()??``}getState(){let e=this.#N?.getScrollContainer?.();return{selections:this.#$,view:e===void 0?void 0:{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}}setState({selections:e,view:t}){if(this.#N===void 0||this.#I===void 0)throw Error(`Editor is not attached`);if(this.#nt(e??[]),t!==void 0){let e=this.#N.getScrollContainer?.();e!==void 0&&e.scrollTo({left:t.scrollLeft,top:t.scrollTop,behavior:`instant`});return}this.#Ue()}setSelections(e){let t=this.#I;if(t===void 0)throw Error(`Text document is not initialized`);let n=e.map(e=>{let n=t.normalizePosition(e.start),r=t.normalizePosition(e.end),i=e.direction===`none`?0:e.direction===`backward`?-1:1;return G(n,r)>0&&([n,r]=[r,n],i!==0&&(i=i===1?-1:1)),{direction:i,start:n,end:r}});this.#nt(n);let r=n.at(-1);r!==void 0&&this.#ve(Ar(r).line),this.#Ue()}setMarkers(e){let t=this.#I;if(t===void 0)throw Error(`Text document is not initialized`);if(e.length===0){this.#z?.cleanup(),this.#z=void 0,this.#nt(this.#$??[]);return}this.#z??=new Di({popoverManager:this.#Se(),getLineHeight:()=>this.#t.lineHeight,getOverlayElement:()=>this.#k,getGutterWidth:()=>this.#Et(),getCharX:(e,t)=>this.#kt(e,t),getLineY:e=>this.#Ot(e),isMouseDown:()=>this.#q||this.#K}),this.#z.setMarkers(e,t),this.#O!==void 0&&this.#z.listenHover(this.#O),this.#nt(this.#$??[])}focus(e){let t=e?.preventScroll??!1,n=this.#$?.at(-1);if(n!==void 0){let e=n.direction===-1?n.end:n.start;this.#Ve(e,t)}else this.#Ve(void 0,t)}blur(){this.#O?.blur()}cleanUp(e=!1){let t=this.#le;this.#l++,this.#fe(),this.#u=t,ye(this.#Oe),this.#n?.cleanUp(),this.#n=void 0,e||(this.#I=void 0,this.#P=void 0),this.#f?.forEach(e=>e()),this.#f=void 0,this.#d?.forEach(e=>e()),this.#d=void 0,this.#p?.forEach(e=>e()),this.#p=void 0,this.#m?.(e),this.#m=void 0,this.#g=void 0,this.#_=void 0,this.#v.clear(),this.#y.clear(),this.#b.clear(),this.#x=void 0,this.#S?.remove(),this.#S=void 0,this.#C?.remove(),this.#C=void 0,this.#w?.remove(),this.#w=void 0,this.#T?.remove(),this.#T=void 0,this.#E=void 0,this.#r?.cleanUp(),this.#r=void 0,this.#D=void 0,this.#O?.removeAttribute(`contentEditable`),this.#O=void 0,this.#W=!1,this.#k?.remove(),this.#k=void 0,this.#M?.disconnect(),this.#M=void 0,this.#oe=!1,this.#se!==void 0&&(cancelAnimationFrame(this.#se),this.#se=void 0),this.#we()}__prepareFile(e){if(this.#e.persistState!==!0)return e;let t=ba(e),n=this.#P,r=e.lang??ve(e.name);n!==void 0&&(ba(n)!==t||n.name!==e.name||this.#I?.languageId!==r)&&(this.#l++,this.#fe());let i=this.#ue(e,t);return i===void 0||i.getText()===e.contents?e:{...e,contents:i.getText()}}__postponeBgTokenizeToNextFrame(){let e=this.#n;e!==void 0&&(e.pauseBackgroundTokenize(),requestAnimationFrame(()=>{e.resumeBackgroundTokenize()}))}__syncRenderView=(e,t,n,r,i)=>{let a=t.shadowRoot;if(a==null){console.error(`[editor] Could not find the shadow root.`);return}let o,s,c;for(let e of a.querySelectorAll(`[data-code]`))if(e.dataset.deletions===void 0){o=e;for(let t of e.children){let e=t,{gutter:n,content:r}=e.dataset;n===void 0?r!==void 0&&(c=e):s=e}break}if(o===void 0||c===void 0)return;this.#Se().setViewportElements(t,o),this.#E!==t&&(this.#E=t,this.#S!==void 0&&t.appendChild(this.#S),this.#C!==void 0&&a.appendChild(this.#C),this.#w!==void 0&&a.appendChild(this.#w),this.#T!==void 0&&a.prepend(this.#T));let l=this.#I===void 0||this.#P===void 0||this.#P.name!==n.name||this.#P.lang!==n.lang||this.#P.cacheKey!==n.cacheKey,u=this.#le?ba(n):void 0,d;if(l){let e=``;e=`contents`in n?n.contents:n.additionLines.join(``);let t=new Lt({maxEntries:this.#e.historyMaxEntries}),{name:r,lang:i,cacheKey:a}=n,o=i??ve(n.name),s=(u===void 0?void 0:this.#ue(n,u))??new hn(n.name,e,o,0,t);this.#P={name:r,lang:i,cacheKey:a},this.#I=s,u!==void 0&&(this.#i.set(u,s),d={cacheKey:u,textDocument:s}),this.#n?.cleanUp(),this.#n=void 0,this.#we(),this.#$=this.#Q,requestAnimationFrame(()=>{this.#e.onAttach?.(this,this.#N)}),this.#I!==void 0&&this.#e.__debug===!0&&console.log(`[diffs/editor] text document rebuilt from`,n.name)}d===void 0&&this.#u&&u!==void 0&&this.#I!==void 0&&(d={cacheKey:u,textDocument:this.#I});let f=this.#I;if(this.#n==null&&f!=null&&(this.#n=new ha({highlighter:e,textDocument:f,codeOptions:this.#N?.options??{},matchBrackets:this.#e.matchBrackets,onDeferTokenize:this.#ce,onThemeChange:()=>this.#tt(),setStyle:e=>{this.#w.textContent=e},__debug:this.#e.__debug})),this.#O!==c&&(this.#D=s,this.#O=Rn(c,{contentEditable:`true`,role:`textbox`,ariaMultiLine:`true`,autocapitalize:`off`,writingSuggestions:`off`,autocorrect:!1,spellcheck:!1,translate:!1}),this.#k!==void 0&&c.after(this.#k),this.#t.init(c),this.#Re(),this.#De(c,s),this.#O!==void 0&&this.#e.__debug===!0&&console.log(`[diffs/editor] full re-render triggered !!!`)),c.ariaLabel!==n.name&&(c.ariaLabel=n.name),r!==void 0&&r.length>0||this.#be)for(let e of this.#O.children){let t=e,{lineAnnotation:n,lineType:r,separator:i}=t.dataset;(n!==void 0||i!==void 0||r===`change-deletion`)&&t.setAttribute(`contenteditable`,`false`)}if(this.#Ce(),this.#n?.syncTheme(this.#N?.options??{}),this.#F=r,this.#L=i,this.#R=i?.totalLines,this.#n?.prebuildStateStack(i),this.#z?.removePopup(),(this.#$!==void 0||this.#ee!==void 0||this.#z!==void 0)&&this.#nt(this.#$??[]),this.#Q!==void 0&&this.#j!==void 0?(this.#Q=void 0,this.#Ue(!1,`center`)):this.#te===void 0?this.#$!==void 0&&this.#$.length>0&&!this.#ae&&this.focus({preventScroll:!0}):this.#Ge(this.#te,this.#ne,this.#ie),this.#ae&&this.#B?.focus(),this.#e.__debug===!0&&i!==void 0){let{startingLine:e,totalLines:t}=i;console.log(`[diffs/editor] render file:`,n.name,`RenderRange:`,e+`-`+(e+t),`of`,this.#I?.lineCount,`lines`)}d!==void 0&&(this.#u=!1,this.#he(d.cacheKey,d.textDocument))};get#le(){return this.#e.persistState===!0&&this.#N?.type===`file`}#ue(e,t){let n=this.#i.get(t),r=e.lang??ve(e.name);return n?.languageId===r?n:void 0}#de(){let e=this.#e.persistStateStorage??`inMemory`;return(this.#a===void 0||this.#o!==e)&&(this.#a=$i(e),this.#o=e),this.#a}#fe(){let e=this.#P,t=this.#I;if(!this.#le||e===void 0||t===void 0)return;let n=ba(e);this.#i.set(n,t);let r;try{r=this.#de()}catch{return}let i=Qi(this.getState()),a=this.#c;if(a?.cacheKey===n&&a.textDocument===t){if(this.#c=void 0,t.version===a.documentVersion&&this.#$===a.selections&&i.view?.scrollLeft===a.view?.scrollLeft&&i.view?.scrollTop===a.view?.scrollTop)return;this.#pe(r,n,i,a.completion);return}this.#pe(r,n,i)}#pe(e,t,n,r){let i=this.#s.get(t);if(r!==void 0||i!==void 0){let a=r??Promise.resolve();i!==void 0&&(a=a.then(()=>i)),this.#me(t,a.then(()=>e.set(t,n)));return}let a;try{a=e.set(t,n)}catch{return}xa(a)&&this.#me(t,a)}#me(e,t){let n=t.catch(()=>{});this.#s.set(e,n),n.finally(()=>{this.#s.get(e)===n&&this.#s.delete(e)})}#he(e,t){let n=++this.#l,r=t.version,i=this.#$,a=this.getState().view,o=o=>{let s=this.getState().view;o===void 0||n!==this.#l||this.#I!==t||t.version!==r||this.#$!==i||s?.scrollLeft!==a?.scrollLeft||s?.scrollTop!==a?.scrollTop||this.#P===void 0||ba(this.#P)!==e||this.setState(Qi(o))},s=()=>{let t;try{t=this.#de().get(e)}catch{return}if(xa(t))return t.then(o).catch(()=>{});try{o(t)}catch{}},c=this.#s.get(e),l=c===void 0?s():c.then(s);if(xa(l)){let n={cacheKey:e,textDocument:t,documentVersion:r,selections:i,view:a,completion:l.catch(()=>{})};this.#c=n,n.completion.finally(()=>{this.#c===n&&(this.#c=void 0)})}}#ge(e){return this.#N?.isLineRenderable?.(e+1)??!0}get#_e(){let e=this.#N;if(e?.getNearestRenderableLine!=null)return(t,n)=>{let r=e.getNearestRenderableLine(t+1,n);return r==null?void 0:r-1}}#ve(e){this.#ge(e)||this.#N?.revealLine?.(e+1)}get#ye(){return this.#N?.options.diffStyle??`split`}get#be(){return this.#N?.type===`file-diff`}get#xe(){return this.#N?.options.overflow===`wrap`}#Se(){return this.#r??=new ir({hasActivePopover:()=>this.#V!==void 0||this.#z?.isPopupVisible()===!0,updateActivePopover:()=>{this.#ct(),this.#z?.updatePopupPosition()}})}#Ce(){this.#v.clear(),this.#y.clear(),this.#b.clear(),this.#x=void 0}#we(){this.#et(null),this.#g=void 0,this.#_=void 0,this.#H=!1,this.#A?.forEach(e=>e.remove()),this.#A=void 0,this.#$=void 0,this.#Z=void 0,this.#te=void 0,this.#z?.cleanup(),this.#z=void 0,this.#B?.cleanup(),this.#B=void 0,this.#V?.cleanup(),this.#V=void 0}#Te(){this.#S=H(`style`,{dataset:`editorGlobalCss`,textContent:`
|
|
502
|
-
[data-annotation-slot] {
|
|
503
|
-
user-select: none;
|
|
504
|
-
-webkit-user-select: none;
|
|
505
|
-
}
|
|
506
|
-
`}),this.#C=H(`style`,{dataset:`editorCss`,textContent:En}),this.#w=H(`style`,{dataset:`editorThemeCss`}),this.#T=Ji(),this.#k=H(`div`,{dataset:`editorOverlay`}),this.#f=[U(document,`selectionchange`,()=>{let e=this.#E?.shadowRoot;if(this.#H||this.#U||e==null||!this.#W||this.#$!==void 0&&this.#$.length>1&&!this.#q)return;let t=document.getSelection();if(t==null)return;let n=typeof t.getComposedRanges==`function`?t.getComposedRanges({shadowRoots:[e]})?.[0]:ya(e);if(n===void 0||!this.#jt(n))return;let r=lr(n,0);if(r!==void 0){if(this.#q&&this.#J&&this.#$!==void 0&&this.#$.length>0){let e=this.#$.at(-1);this.#nt([Lr(e,r)]);return}if(this.#q)this.#Y===void 0?this.#Y=r:r=Ir(this.#Y,r);else if(this.#Y!==void 0)r.direction=Ir(this.#Y,r).direction;else if(this.#$!==void 0&&this.#$.length===1){let e=this.#$[0];G(e.start,r.start)===0&&G(e.end,r.end)===0&&(r.direction=e.direction)}this.#Z===void 0?this.#nt([r]):this.#nt([...this.#Z.filter(e=>!Mr(e,r)),r])}},{passive:!0}),U(document,`pointerup`,e=>{e.pointerType===`mouse`&&(this.#p?.forEach(e=>e()),this.#p=void 0,this.#K&&(this.#K=!1,this.#Ve()),this.#H=!1,this.#q=!1,this.#J=!1,this.#Y=void 0,this.#Z=void 0,this.#e.enabledSelectionAction===!0&&this.#$!==void 0&&this.#$.length>0&&!W(this.#$.at(-1))&&this.#nt(this.#$))},{passive:!0}),U(document,`keydown`,e=>{e.key===`Shift`&&(this.#Y=this.#$?.at(-1))},{passive:!0}),U(document,`keyup`,e=>{e.key===`Shift`&&(this.#Y=void 0)},{passive:!0})]}#Ee(e){this.#p?.forEach(e=>e()),this.#p=e}#De(e,t){let{onFocus:n,onBlur:r}=this.#e,i=t=>{let n=t.composedPath()[0];return n!==void 0&&(n===e||e.contains(n))};this.#d?.forEach(e=>e()),this.#d=[U(e,`focus`,()=>{this.#W=!0,n?.(),!this.#q&&!this.#H&&this.#$!==void 0&&this.#$.length>0&&this.#He(this.#$.at(-1))},{passive:!0}),U(e,`blur`,()=>{this.#W=!1,r?.()},{passive:!0}),U(e,`pointerdown`,t=>{if(this.#U=!1,t.pointerType===`mouse`){if(this.#qe(t)){this.#$e(!0),this.#$!==void 0&&this.#nt([]);return}if(this.#$e(!1),this.#z?.removePopup(),yn()&&this.#F!==void 0&&this.#F.length>0){let t=[...e.querySelectorAll(`[data-line-annotation]`)].map(e=>[U(e,`mouseenter`,()=>{this.#H=!0}),U(e,`mouseleave`,()=>{this.#H=!1})]).flat();this.#Ee(t)}if(this.#q=!0,this.#Y=void 0,t.button===0&&bn(t)&&(this.#Z=this.#$?.map(e=>({...e}))),t.shiftKey){let e=this.#$?.at(-1);if(e!==void 0){let t=e.direction===-1?e.end:e.start;this.#He({start:t,end:t,direction:0})}this.#J=!0}}},{passive:!0}),U(e,`keydown`,e=>{if(e.key===`Escape`){e.preventDefault(),this.#B?.close(),this.#B=void 0,this.#ae=!1,this.#V?.cleanup(),this.#V=void 0,this.#je(`simplifySelection`);return}if(!i(e))return;this.#U=!1;let t=xn(e),n=this.#I;if(this.#$!==void 0&&this.#$.length>0&&t!==void 0&&n!==void 0){let r={getSoftLineOffsets:this.#xe?e=>this.#At(e):void 0,resolveRenderableLine:this.#_e};e.shiftKey?this.#nt(_r(n,this.#$,t,r)):this.#nt(dr(n,this.#$,t,r)),this.#Ue(),e.preventDefault();return}if((e.key.length===1?e.key.toLowerCase():e.key)===`v`&&bn(e)){if(e.repeat&&this.#be){e.preventDefault();return}if(this.#e.clipboard!==void 0){e.preventDefault(),oe(this.#Oe);return}}if(this.#B!==void 0){let t=Tn(e);if(t!==void 0){e.preventDefault(),this.#B.navigate(t===`previous`);return}}let r=wn(e);r!==void 0&&(e.preventDefault(),this.#je(r))}),U(e,`copy`,e=>{i(e)&&(e.preventDefault(),this.#Ze()?e.clipboardData?.setData(`text`,this.#Qe()):this.#pt(e.clipboardData,this.#dt(),this.#ft()))}),U(e,`cut`,e=>{if(i(e))if(e.preventDefault(),this.#Ze())e.clipboardData?.setData(`text`,this.#Qe());else{let t=this.#ft();this.#pt(e.clipboardData,this.#mt(),t)}}),U(e,`paste`,e=>{if(!i(e))return;e.preventDefault();let t=e.clipboardData,n=this.#I;if(t===null||n===void 0)return;let r=t.getData(`text`),a=this.#$?.length??0;if(a>1){let e=t.getData(wa);if(e!==void 0)try{let t=JSON.parse(e);Array.isArray(t)&&t.length===a&&(r=t)}catch{}}this.#gt(Array.isArray(r)?r.map(e=>n.normalizeEol(e)):n.normalizeEol(r),void 0,!0,`document`)}),U(e,`beforeinput`,e=>{i(e)&&e.inputType!==`insertCompositionText`&&(e.preventDefault(),this.#Be(e.inputType,e.data))}),U(e,`drop`,e=>{i(e)&&e.preventDefault()}),U(e,`compositionstart`,e=>{i(e)&&(this.#G=!0,this.#H=!0)},{passive:!0}),U(e,`compositionend`,e=>{if(!i(e))return;this.#H=!1;let t=this.#G;this.#G=!1,(e.data!==``||!t)&&this.#Be(`insertText`,e.data)},{passive:!0})];let a=this.#E?.shadowRoot?.querySelector(`[data-deletions]`);if(a!=null&&this.#d.push(U(a,`pointerdown`,e=>{let t=e.composedPath()[0],n=t instanceof HTMLElement?t.closest(`[data-column-number]`):null;n instanceof HTMLElement&&this.#Xe(n,a,e.pointerType===`mouse`)||(this.#$e(!0),this.#$!==void 0&&this.#nt([]))},{passive:!0})),t!==void 0){let e=(e,t=!1)=>{let n=e;return n?.dataset.lineNumberContent===void 0?t&&n?.tagName===`SPAN`&&(n=n.closest(`[data-line]`)):n=n.parentElement??void 0,n},n=e=>{if(e===void 0)return;let t=e.dataset.lineType,n=In(e)??In(e,`columnNumber`);if(!(n===void 0||t===void 0||!jr(t)))return n-1};this.#d.push(U(t,`pointerdown`,t=>{if(this.#N?.options.enableLineSelection===!0)return;let r=e(t.composedPath()[0]);if(r?.dataset.lineType===`change-deletion`){let e=r.closest(`[data-code]`);e!=null&&this.#Xe(r,e,t.pointerType===`mouse`);return}if(t.pointerType!==`mouse`)return;let i=this.#I,a=n(r);if(a===void 0||i===void 0)return;this.#z?.removePopup();let o=this.#Ke(a,a,i);this.#K=!0,this.#Y=o,this.#nt([o]),this.#He(o),this.#Ve(),this.#Ee([U(document,`mousemove`,t=>{if(!this.#K)return;let r=this.#I,i=n(e(t.composedPath()[0],!0));if(i===void 0||r===void 0)return;let a=this.#Y?.start.line??i,o=this.#Ke(a,i,r);this.#Y??=o,this.#nt([o]),this.#Ve(o.direction===-1?o.start:o.end)},{passive:!0})])},{passive:!0}))}this.#z?.listenHover(e),this.#M?.disconnect(),this.#M=new ResizeObserver(this.#Le),this.#M.observe(e),this.#M.observe(e.parentElement),this.#ke(e)}#Oe=async()=>{let e=this.#e.clipboard;if(e!==void 0){let t=await e.readText(),n=this.#$?.length??0;if(n>1){let r=await e.readText(wa);try{let e=JSON.parse(r);Array.isArray(e)&&e.length===n&&(t=e)}catch{}}let r=this.#I;r!==void 0&&this.#gt(Array.isArray(t)?t.map(e=>r.normalizeEol(e)):r.normalizeEol(t),void 0,!0,`document`)}};#ke(e){this.#be&&this.#ye===`split`&&this.#xe&&(this.#h={top:e.offsetTop,left:e.offsetLeft-this.#Et()},this.#e.__debug===!0&&console.log(`[diffs/editor] content offset:`,this.#h))}get#Ae(){if(this.#be&&this.#ye===`split`&&this.#xe)return this.#h}#je(e){let t=this.#I;if(t!==void 0)switch(e){case`openSearchPanel`:this.#lt(`find`);break;case`openSearchReplacePanel`:this.#lt(`replace`);break;case`findNextMatch`:{let e=this.#$;if(e===void 0)break;if(e.some(W)){let n=e.map(e=>W(e)?ti(t,e):e);this.#nt(n),this.focus()}else{let n=Hr(t,e);if(n!==void 0){this.#nt(n);let e=n.at(-1);e!==void 0&&this.#ve(Ar(e).line),this.#Ue()}}break}case`moveLineUp`:case`moveLineDown`:this.#Ie(e===`moveLineUp`?-1:1);break;case`copyLineUp`:case`copyLineDown`:this.#Pe(e===`copyLineUp`?-1:1);break;case`simplifySelection`:{let e=this.#$,t=e?.at(-1);if(e===void 0||t===void 0)break;if(e.length>1)this.#nt([t]),this.#Ve(Ar(t));else if(!W(t)){let e=Ar(t);this.#nt([{start:e,end:e,direction:0}]),this.#Ve(e)}break}case`insertBlankLine`:this.#Fe();break;case`deleteHardLineForward`:this.#bt();break;case`toggleComment`:case`toggleBlockComment`:{let n=this.#$;if(n===void 0)break;let{lineComment:r,blockComment:i}=An(t.languageId,this.#e.languageCommentConfig);if(e===`toggleComment`&&r!==null){this.#Ne(jn(t,n,r));break}let a=e===`toggleComment`,o=Fn(t,n,i,a);o!==void 0&&this.#Ne(o.edits,a?void 0:e=>o.nextSelectionOffsets.map(([t,n,r])=>({start:e.positionAt(t),end:e.positionAt(n),direction:r})));break}case`indent`:case`outdent`:case`indentLess`:case`indentMore`:if(this.#$!==void 0){let n=[],r=[],i=new Set,a=[];for(let o of this.#$){let s=o.start.line,c=e===`outdent`||e===`indentLess`,l=e===`indentLess`||e===`indentMore`;if(s!==o.end.line||c||l){let e=ur(t,o,this.#t.tabSize,c);for(let t of e[0]){let e=t.range.start.line;i.has(e)||(i.add(e),n.push(t))}r.push(e[1])}else{let e=t.charAt({line:s,character:0})===` `?` `:` `.repeat(this.#t.tabSize);n.push({range:o,newText:e}),a.push({line:s,startCharacter:o.start.character,addedLength:e.length-(o.end.character-o.start.character),selectionIndex:r.length});let i={line:o.start.line,character:o.start.character+e.length};r.push({start:i,end:i,direction:0})}}for(let e of a){let t=0;for(let n of a)n.line===e.line&&n.startCharacter<e.startCharacter&&(t+=n.addedLength);if(t!==0){let n=r[e.selectionIndex],i={line:e.line,character:n.start.character+t};r[e.selectionIndex]={start:i,end:i,direction:0}}}let o=t.applyEdits(n,!0,this.#$,r);o!==void 0&&this.#St(o,r)}break;case`selectAll`:{let e=Ur(t);this.#nt([e]),this.focus();let n=this.#wt();n!==void 0&&(this.#U=!0,this.#He({start:{line:n.first,character:0},end:{line:n.last,character:t.getLineLength(n.last)},direction:1}));break}case`moveCursorToDocStart`:case`moveCursorToDocEnd`:{let n=Wr(t,e===`moveCursorToDocEnd`,this.#be);this.#nt([n]),this.#ve(Ar(n).line),this.#Ue()}break;case`expandSelectionDocStart`:case`expandSelectionDocEnd`:{let n=e===`expandSelectionDocEnd`,r=this.#$;if(r!==void 0){let e=Wr(t,n,this.#be);this.#nt(Rr(r,e)),this.#ve(Ar(e).line),this.#Ue()}}break;case`undo`:case`redo`:this.#Me(e);break}}#Me(e){let t=this.#I;if(t===void 0||e===`undo`&&!t.canUndo||e===`redo`&&!t.canRedo)return;let n=this.#$,r=n?.map(e=>[t.offsetAt(e.start),t.offsetAt(e.end)]),i=e===`undo`?t.undo():t.redo();if(i===void 0)return;let[a,o,s,c]=i,l=o??(n!==void 0&&r!==void 0&&c!==void 0?Fr(t,n,r,c):void 0);this.#St(a,l,s)}#Ne(e,t){let n=this.#I,r=this.#$;if(n===void 0||r===void 0)return;let i=t===void 0,a=i?r.map(e=>[n.offsetAt(e.start),n.offsetAt(e.end)]):void 0,o=i?e.map(e=>{let t=n.offsetAt(e.range.start),r=n.offsetAt(e.range.end);return{start:Math.min(t,r),end:Math.max(t,r),text:e.newText}}).sort((e,t)=>{let n=e.start-t.start;return n===0?e.end-t.end:n}):void 0,s=n.applyEdits(e,!0,r,void 0,!0);if(s===void 0)return;let c=i?Fr(n,r,a,o):t(n);n.setLastUndoSelectionsAfter(c),this.#St(s,c,this.#Ct(s))}#Pe(e){let t=this.#I,n=this.#$;if(t===void 0||n===void 0)return;let r=Br(n);if(r.length===0)return;let i=[],a=0,o=[];for(let n of r){i.push(a);let r=n.endLine-n.startLine+1;a+=r;let s=t.getText({start:{line:n.startLine,character:0},end:{line:n.endLine,character:t.getLineLength(n.endLine)}});if(e>0){let e={line:n.startLine,character:0};o.push({range:{start:e,end:e},newText:s+t.eol})}else if(n.endLine<t.lineCount-1){let e={line:n.endLine+1,character:0};o.push({range:{start:e,end:e},newText:s+t.eol})}else{let e={line:n.endLine,character:t.getLineLength(n.endLine)};o.push({range:{start:e,end:e},newText:t.eol+s})}}let s=n.map(t=>{let n=t.start.line,a=0,o=r.length-1;for(;a<=o;){let e=a+o>>>1,t=r[e];if(n<t.startLine)o=e-1;else if(n>t.endLine)a=e+1;else{a=e;break}}let s=Math.max(0,a<=o?a:o),c=r[s],l=i[s]+(e>0?c.endLine-c.startLine+1:0);return{start:{...t.start,line:t.start.line+l},end:{...t.end,line:t.end.line+l},direction:t.direction}});this.#Ne(o,()=>s)}#Fe(){let e=this.#I,t=this.#$;if(e===void 0||t===void 0)return;let n=t.map(e=>Ar(e).line),r=Array.from(new Set(n)).sort((e,t)=>e-t),i=new Map,a=new Map,o=[];for(let t=0;t<r.length;t++){let n=r[t],s=e.getLineText(n),c=/^\s*/.exec(s)?.[0]??``;i.set(n,t),a.set(n,c);let l={line:n,character:e.getLineLength(n)};o.push({range:{start:l,end:l},newText:e.eol+c})}let s=t.map((e,t)=>{let r=n[t],o={line:r+1+i.get(r),character:a.get(r).length};return{start:o,end:o,direction:0}});this.#Ne(o,()=>s)}#Ie(e){let t=this.#I,n=this.#$;if(t===void 0||n===void 0)return;let r=Br(n);if(r.length===0||e<0&&r[0].startLine===0||e>0&&r.at(-1).endLine>=t.lineCount-1)return;let i=t.lineCount,a=e=>e<i-1?{line:e+1,character:0}:{line:e,character:t.getLineLength(e)},o=(e,n)=>{let r=e.map(e=>t.getLineText(e)).join(t.eol);return n?r+t.eol:r},s=[];if(e<0)for(let e of r){let t=e.startLine-1,n=[];for(let t=e.startLine;t<=e.endLine;t++)n.push(t);s.push({range:{start:{line:t,character:0},end:a(e.endLine)},newText:o([...n,t],e.endLine<i-1)})}else for(let e=r.length-1;e>=0;e--){let t=r[e],n=t.endLine+1,c=[];for(let e=t.startLine;e<=t.endLine;e++)c.push(e);s.push({range:{start:{line:t.startLine,character:0},end:a(n)},newText:o([n,...c],n<i-1)})}let c=r.at(-1),l=e>0&&c.endLine===i-2?t.getLineLength(c.endLine):t.getLineLength(i-1),u=n.map(n=>Vr(n,e,i,e=>e===i-1?l:t.getLineLength(e))),d=t.applyEdits(s,!0,n,u,!0);d!==void 0&&this.#St(d,u)}#Le=()=>{let e=this.#F?.length??0,t=this.#g,n=this.#_;this.#g=void 0,this.#_=void 0;let r=this.#Et()!==t,i=this.#Dt()!==n;!r&&!i||(this.#b.clear(),this.#x=void 0,this.#t.clearTextWidthCache(),i&&(this.#xe||e>0)&&(this.#v.clear(),this.#y.clear()),(this.#$!==void 0||this.#ee!==void 0||this.#z!==void 0)&&(this.#nt(this.#$??[]),this.#$!==void 0&&this.focus()),this.#z?.removePopup(),this.#ke(this.#O))};#Re(){if(this.#oe)return;let e=document.fonts;e!==void 0&&(this.#oe=!0,e.ready.then(()=>{this.#O===void 0||!this.#t.remeasureCharacterWidth()||(this.#g=void 0,this.#_=void 0,this.#Ce(),(this.#$!==void 0||this.#ee!==void 0||this.#z!==void 0)&&this.#nt(this.#$??[]),this.#z?.removePopup())}))}#ze(e,t,n=this.#L,r){let i=this.#n,a=this.#N,o=this.#I,s=this.#D,c=this.#O;if(i===void 0||a===void 0||o===void 0||c===void 0)return;i.stopBackgroundTokenize();let l=performance.now(),u=i.tokenize(e,n),d=performance.now();if(u.size>0){let e=c.children,t=new Set;for(let e of u.keys())this.#ge(e)&&t.add(e);for(let n=0;n<e.length;n++){let r=e[n];if(r!==void 0){let e=In(r),n=r.dataset.lineType;if(e===void 0||n===`change-deletion`)continue;let i=e-1;if(t.has(i)){let e=u.get(i);if(r.replaceChildren(..._a(e)),t.delete(i),t.size===0)break}}}if(t.size>0){let n=0;for(let t=e.length-1;t>=0;t--){let r=e[t],i=In(r);if(i!==void 0&&r.dataset.lineType!==`change-deletion`){n=i;break}}for(let e of t){if(e<n)continue;let t=u.get(e),r=String(e+1);H(`div`,{dataset:{line:r,lineType:`context`,lineIndex:e.toString()},children:_a(t)},c),s!==void 0&&H(`div`,{dataset:{lineType:`context`,columnNumber:r,lineIndex:e.toString()},children:[H(`span`,{dataset:{lineNumberContent:``},textContent:r})]},s)}}}if(e.lineDelta<0)for(let t of[c.children,s?.children??[]])for(let n=t.length-1;n>=0;n--){let r=t[n],i=In(r)??In(r,`columnNumber`),a=r.dataset.lineType;if(!(i===void 0||a===`change-deletion`)){if(i-1<e.lineCount)break;r.remove()}}let f=e.lineDelta!==0;if(f){let e=c.children.length;for(let t of c.children){let{bufferSize:n}=t.dataset;n!==void 0&&(e+=parseInt(n)-1)}c.style.gridRow=`span `+e,s!==void 0&&(s.style.gridRow=`span `+e)}a.updateRenderCache(u,i.themeType,!f,f),a.file!==void 0&&(a.file.contents=o.getText()),f&&a.applyDocumentChange(o,t,r),this.#be&&(this.#ye===`unified`||f)&&this.#Ce(),t!==void 0&&(this.#F=t,Qn(t,c,s)),this.#e.__debug===!0&&console.log(`[diffs/editor] re-render in: ${Bn(performance.now()-d)}ms,`,`tokenize in: ${Bn(d-l)}ms (${u.size} dirty lines)`)}#Be(e,t){switch(e){case`insertText`:{let e=t??``,n=this.#I,r=this.#$,i=n!==void 0&&r!==void 0?Cr(n,r,e,this.#e.autoSurround):void 0;this.#gt(i??e);break}case`insertCompositionText`:break;case`insertLineBreak`:case`insertParagraph`:this.#gt(this.#I?.eol??`
|
|
507
|
-
`);break;case`deleteContentBackward`:this.#_t();break;case`deleteContentForward`:this.#_t(!0);break;case`deleteSoftLineBackward`:case`deleteHardLineBackward`:this.#vt();break;case`deleteWordBackward`:this.#yt();break;case`insertTranspose`:this.#xt();break;default:console.warn(`[diffs] Unknown input type: ${e}`,t);break}}#Ve(e,t=!0){this.#W=!0,e===void 0?this.#O?.focus({preventScroll:t}):(this.#H=!0,this.#He({start:e,end:e,direction:0}),requestAnimationFrame(()=>{this.#O?.focus({preventScroll:t}),requestAnimationFrame(()=>{this.#H=!1})}))}#He(e){let t=window.getSelection();if(t===null)return;let{start:n,end:r,direction:i}=e;G(n,r)>0&&([n,r]=[r,n]);let a=this.#Tt(n.line),o=this.#Tt(r.line);if(a===void 0||o===void 0)return;let[s,c]=ei(a,n.character),[l,u]=ei(o,r.character);i===-1&&([s,c,l,u]=[l,u,s,c]);try{t.setBaseAndExtent(s,Ln(s,c),l,Ln(l,u))}catch(e){console.error(`[diffs/editor] failed to update window selection:`,e)}}#Ue(e=!1,t=`nearest`){let n=this.#$?.at(-1);if(n===void 0)return;let r=this.#j;if(r!==void 0)r.scrollIntoView({block:t,inline:`nearest`}),e||this.#Ve(n.direction===-1?n.end:n.start);else{let t=Ar(n);this.#Ge(t.line,t.character,e)}}#We(){let e=this.#B===void 0?0:48,t=this.#Et()+this.#t.ch;return`${e}px ${this.#t.ch}px 0 ${t}px`}#Ge(e,t=0,n=!1){this.__postponeBgTokenizeToNextFrame();let r=H(`div`,{style:{position:`absolute`,left:`0`,width:`2px`,height:this.#t.lineHeight+`px`,scrollMargin:this.#We()}});if(this.#Tt(e)!==void 0){let[i,a]=this.#kt(e,t),o=this.#Ot(e)+a*this.#t.lineHeight;r.style.top=o+`px`,r.style.left=i+`px`,this.#k?.appendChild(r),r.scrollIntoView({block:`center`,inline:`nearest`}),n||this.#Ve({line:e,character:t}),this.#te=void 0,this.#ne=void 0,this.#re=!1,this.#ie=!1}else{let i=this.#N?.getLinePosition?.(e+1);if(i!==void 0)r.style.top=i.top+`px`,this.#E?.shadowRoot?.appendChild(r),r.scrollIntoView({block:`center`,inline:`nearest`}),i.height>0&&this.#ge(e)?(this.#te=e,this.#ne=t,this.#ie=n):(this.#te=void 0,this.#ne=void 0,this.#ie=!1);else{let i=0;if(this.#te===e&&this.#O!==void 0)for(let t=this.#O.childElementCount-1;t>=0;t--){let n=this.#O.children[t],r=n.dataset.lineType,a=In(n);if(r!==void 0&&jr(r)&&a!==void 0){i=(e-(a-1))*this.#t.lineHeight;break}}let a=((this.#F??[]).filter(t=>t.lineNumber<e).length+e)*this.#t.lineHeight+i;r.style.top=a+`px`,this.#E?.shadowRoot?.appendChild(r),r.scrollIntoView({block:`center`,inline:`nearest`}),this.#te===e&&(i===0||this.#re)||!this.#ge(e)?(this.#te=void 0,this.#ne=void 0,this.#re=!1,this.#ie=!1):(this.#te=e,this.#ne=t,this.#re=i!==0,this.#ie=n)}}r.remove()}#Ke(e,t,n){let r=e=>({line:e,character:0}),i=e=>({line:e,character:n.getLineText(e).length});return t<e?{start:r(t),end:i(e),direction:-1}:{start:r(e),end:i(t),direction:1}}#qe(e){let t=e.composedPath()[0];return t instanceof HTMLElement&&t.closest(`[data-line]`)?.getAttribute(`data-line-type`)===`change-deletion`}#Je(e,t,n){let r=[...n.querySelectorAll(`[data-content] > [data-line]`)],i=r.indexOf(e),a=r.indexOf(t),[o,s]=a<i?[t,e]:[e,t],c=window.getSelection();if(c!==null){let e=document.createRange();e.setStart(o,0),e.setEnd(s,s.childNodes.length),c.removeAllRanges(),c.addRange(e)}this.#$e(!0),this.#nt([]),[...n.querySelectorAll(`[data-gutter] > [data-column-number]`)][a]?.setAttribute(`data-selected-line`,`single`);let l=Math.min(i,a),u=Math.max(i,a);this.#X=l<0?``:r.slice(l,u+1).filter(e=>e.getAttribute(`data-line-type`)===`change-deletion`).map(e=>e.textContent??``).join(`
|
|
508
|
-
`)}#Ye(e,t){let n=e.parentElement;if(n==null||t==null)return;let r=[...n.children].indexOf(e),i=t.children[r];return i instanceof HTMLElement?i:void 0}#Xe(e,t,n){let r=t.querySelector(`[data-content]`),i=this.#Ye(e,r);return i===void 0?!1:(this.#Je(i,i,t),n&&this.#Ee([U(document,`mousemove`,e=>{let n=e.composedPath()[0],a=n instanceof HTMLElement?n.closest(`[data-column-number]`):null;if(a instanceof HTMLElement&&t.contains(a)){let e=this.#Ye(a,r);e!==void 0&&this.#Je(i,e,t)}},{passive:!0})]),!0)}#Ze(){return this.#E?.shadowRoot?.querySelector(`pre`)?.hasAttribute(`data-deleted-text-selection`)??!1}#Qe(){return this.#X===``?window.getSelection()?.toString()??``:this.#X}#$e(e){let t=this.#E?.shadowRoot?.querySelector(`pre`);if(t!=null)if(e){t.setAttribute(`data-deleted-text-selection`,``);for(let e of t.querySelectorAll(`[data-selected-line]`))e.removeAttribute(`data-selected-line`);this.#X=``}else t.removeAttribute(`data-deleted-text-selection`),this.#X=``}#et(e,t=!1){if(this.#N?.options.controlledSelection!==!0)try{this.#N?.setSelectedLines(e,{notify:!1,activeLineSide:`additions`,lineNumberOnly:t})}catch{}}#tt(){this.#se===void 0&&(this.#se=requestAnimationFrame(()=>{this.#se=void 0,(this.#$!==void 0||this.#ee!==void 0||this.#z!==void 0)&&this.#nt(this.#$??[])}))}#nt(e){if(this.__postponeBgTokenizeToNextFrame(),this.#j=void 0,this.#et(null),e.length===0&&this.#ee===void 0&&this.#z===void 0){this.#$=void 0,this.#A?.forEach(e=>e.remove()),this.#A?.clear(),this.#V?.cleanup(),this.#V=void 0;return}let t=document.createDocumentFragment(),n={fragment:t,elements:new Map};if(e.length>0){let t=zr(e),r=t.at(-1);this.#$=t;let i=t.some(e=>!W(e)),a=Ar(r).line+1;this.#et({start:a,end:a},i);for(let e of t)W(e)||this.#rt(n,`selection`,e),this.#st(n,e,e===r);let o=this.#e.matchBrackets!==!1&&this.#I!==void 0&&this.#n!==void 0&&W(r)?Fi(this.#I,this.#n,r.start):void 0;if(o!==void 0)for(let e of o)this.#rt(n,`bracketMatch`,e)}let r=this.#I;if(this.#ee!==void 0&&r!==void 0){let e=this.#$?.at(-1),t=e===void 0?-1:r.offsetAt(e.start),i=e===void 0?-1:r.offsetAt(e.end);for(let[e,a]of this.#ee){let o={start:r.positionAt(e),end:r.positionAt(a)},s=t===e&&i===a;this.#rt(n,`match`,o,s?`focus`:void 0)}}if(this.#z!==void 0&&r!==void 0)for(let e of this.#z.markers)this.#rt(n,`marker`,e,Ai(e.severity));this.#k?.appendChild(t),this.#A?.forEach(e=>e.remove()),this.#A?.clear(),this.#A=n.elements,this.#ct()}#rt(e,t,n,r){if(this.#I===void 0)return;let{start:i,end:a}=n;for(let n=i.line;n<=a.line;n++){if(!this.#Mt(n))continue;let o=n===a.line,s=n===i.line?i.character:0,c=o?a.character:this.#I.getLineLength(n);if(this.#xe){let i=this.#Dt(),a=this.#I.getLineText(n);if(2*this.#t.ch+this.#t.measureTextWidth(a)>i){this.#it(e,n,a,s,c,o,t,r);continue}}let l=0,u=0,d=0;l=s===0?this.#Et()+this.#t.ch+(this.#Ae?.left??0):this.#kt(n,s)[0],!o&&t===`selection`&&(d=this.#t.ch),u=s===c?d:this.#kt(n,c)[0]-l+d,this.#ot(e,t,n,0,l,u,r)}}#it(e,t,n,r,i,a,o,s){let c=this.#At(t),l=c.length-1,u=this.#Et()+this.#t.ch+(this.#Ae?.left??0);for(let d=0;d<l;d++){let f=c[d],p=c[d+1],m=Math.max(r,f),h=Math.min(i,p);if(m>h)continue;let g=this.#at(n,f,m),_=u+g,v=0;!a&&d===l-1&&o===`selection`&&(v=this.#t.ch);let y=m===h?v:this.#at(n,f,h)-g+v;this.#ot(e,o,t,d,_,y,s)}}#at(e,t,n){if(n<=t)return 0;let r=e.slice(t,n),i=pa(r,this.#t.tabSize);return i===-1?this.#t.measureTextWidth(r):i*this.#t.ch}#ot(e,t,n,r,i,a,o){if(a===0)return;let{ch:s,lineHeight:c}=this.#t,l=this.#Ot(n)+r*c,u=`${t}-${n}/${r}-${i}-${a} ${o??``}`,d=this.#A,f=(this.#e.roundedSelection??!0)&&t===`selection`,p=(n,r,i,a)=>{let o=this.#Ot(n)+r*c,l=this.#Tt(n),u=`initial`;this.#be&&l?.dataset.lineType===`change-addition`&&(u=getComputedStyle(l).getPropertyValue(`--diffs-line-bg`));let f=`width:${s}px;transform:translateX(${i}px) translateY(${o}px);--diffs-selection-corner-bg:${u}`,p={selectionCorner:``,[a]:``},m=`${t}-block-${n}/${r}-${i}-1ch`,h=m+`-`+a;if(a===`rbl`){let t=m+`-rtl`,n=e.elements.get(t);n!==void 0&&(n.remove(),e.elements.delete(t),h+=`-rtl`,p.rtl=``)}let g=e.elements.get(h);g===void 0&&(d?.has(h)===!0?(g=d.get(h),g.style.cssText=f,d.delete(h)):g=H(`div`,{dataset:`selectionRange`,style:{cssText:f},children:[H(`div`,{dataset:p})]},e.fragment),e.elements.set(h,g))},m=t=>{let o=i+a,c=t.dataset,l=e.previousSelectionRange;if((l===void 0||l.line!==n||l.wrapLine!==r)&&(e.previousSelectionRange={element:t,line:n,wrapLine:r,left:i,width:a}),l===void 0||o<=l.left)[`rtl`,`rtr`,`rbl`,`rbr`].forEach(e=>{c[e]=``});else{let e=l.line,t=l.wrapLine,a=l.left,u=l.element.dataset,d=a+l.width;a>i&&p(e,t,a-s,`rbr`),delete u.rbl,delete c.rtl,delete c.rtr,o>=d&&delete u.rbr,o>d&&(p(e,t,d,`rbl`),c.rtr=``),o<d&&p(n,r,o,`rtl`),i<a&&(c.rtl=``),c.rbl=``,c.rbr=``}},h=e.elements.get(u);if(h!==void 0){f&&m(h);return}d?.has(u)===!0?(h=d.get(u),d.delete(u)):h=H(`div`,{dataset:o?[t+`Range`,o]:t+`Range`},e.fragment),h.style.width=`${a}px`,h.style.transform=`translateX(${i}px) translateY(${l}px)`,f&&m(h),e.elements.set(u,h)}#st(e,t,n){let{line:r,character:i}=Ar(t);if(!this.#Mt(r))return;let[a,o]=this.#kt(r,i),s=`caret-`+r+`/`+o+`:`+i;if(e.elements.has(s))return;let c=H(`div`,{dataset:`caret`,style:{transform:`translateX(${a-1}px) translateY(${this.#Ot(r)+o*this.#t.lineHeight}px)`}},e.fragment);e.elements.set(s,c),n&&(c.style.scrollMargin=this.#We(),this.#j=c)}#ct(){let e=this.#$?.at(-1),t=this.#k,n=this.#I,r=this.#e.renderSelectionAction,i=()=>{this.#V?.cleanup(),this.#V=void 0};if(this.#e.enabledSelectionAction!==!0||r===void 0||e===void 0||W(e)||this.#q||t===void 0||n===void 0){i();return}let a=Ar(e);if(!this.#Mt(a.line)){i();return}if(this.#V===void 0){let a=()=>this.#$?.at(-1)??e,o=r({textDocument:n,get selection(){return a()},applyEdits:e=>this.applyEdits(e),getSelectionText:()=>this.#I?.getText(a())??``,replaceSelectionText:e=>{this.#gt(e,[a()])},close:()=>{i(),this.#Ue()}});this.#V=new Zi(o,t,()=>this.#ct()),this.#Se().resetPlacement(Ca)}let o=this.#t.lineHeight,s=e.direction===-1,c={placeAbove:s,anchor:a},l=s?{placeAbove:!1,anchor:e.end}:{placeAbove:!0,anchor:e.start},u=this.#V.height,d=e=>{let[t,n]=this.#kt(e.anchor.line,e.anchor.character),r=this.#Ot(e.anchor.line)+n*o,i=e.placeAbove?r:r+o,a=e.placeAbove?i-u:i;return{top:a,bottom:a+u,left:t,anchorTop:i}},f=d(c),p=d(l),m=n.lineCount,h=s?a.line<3:a.line>=m-3,g=this.#Mt(l.anchor.line),_=this.#Se(),v=_.getPlacementBounds(),y=g&&_.choosePlacement({preferred:f,fallback:p,viewport:v,popoverHeight:u,atDocumentEdge:h,placementKey:Ca})===`fallback`;g||_.setPlacement(`preferred`,Ca);let{placeAbove:b}=y?l:c,{left:x,anchorTop:S}=y?p:f;this.#V.reposition(x,S,this.#Et(),b,v)}#lt(e){if(this.#B!==void 0){this.#B.setMode(e);return}this.#ut(e)}#ut(e){this.#B?.cleanup();let t=this.#I,n=this.#E?.shadowRoot?.querySelector(`pre`),r=this.#$;if(t===void 0||n==null)return;let i=``,a;if(r!==void 0&&r.length>0){let e=r.at(-1);if(W(e)){e=ti(t,e),this.#nt([...r.slice(0,-1),e]);let n=t.getText(e);n!==``&&!n.includes(`
|
|
509
|
-
`)&&(i=n,a=[t.offsetAt(e.start),t.offsetAt(e.end)])}}let o=([e,n],r)=>{let i=Nr(t,e,n);this.#nt([i]),this.#ve(Ar(i).line),this.#Ue(!0),this.#ae=r},s=new Xi({textDocument:t,containerElement:n,defaultQuery:i,mode:e,initialMatch:a,scrollToMatch:o,applyReplace:e=>{if(e.length===0)return;let n=t.applyEdits(e.map(e=>({range:{start:t.positionAt(e.start),end:t.positionAt(e.end)},newText:e.text})),!0,this.#$);n!==void 0&&this.#St(n,void 0,this.#Ct(n),{skipSearchRefresh:!0})},onUpdate:(e,n)=>{if(e.length===0){this.#ee=void 0,this.#nt(this.#$??[]);return}if(this.#ee=e,n?.syncSelection===!1){this.#nt(this.#$??[]);let n=this.#$?.at(-1);if(n!==void 0){let r=t.offsetAt(n.start),i=t.offsetAt(n.end);for(let t of e)if(t[0]===r&&t[1]===i)return t}return}let r=this.#$?.at(-1),i=0,a;r!==void 0&&(i=t.offsetAt(r.start));for(let t of e)if(t[0]>=i){a=t;break}return a===void 0?this.#nt(this.#$??[]):o(a,!0),a},onClose:()=>{this.#B=void 0,this.#ae=!1,this.#ee=void 0,this.#nt(this.#$??[])}});this.#B=s,this.#ae=!1}#dt(){let e=this.#I,t=this.#$;return e===void 0||t===void 0?``:Jr(e,t)}#ft(){let e=this.#I,t=this.#$;return e===void 0||t===void 0?[]:qr(e,t)}#pt(e,t,n){e!==null&&(e.setData(`text`,t),n.length>1&&e.setData(wa,JSON.stringify(n)))}#mt(){let e=this.#I,t=this.#$;if(e===void 0||t===void 0||t.length===0)return``;if(t.some(e=>W(e))){let n=$r(e,t);return this.#ht(n.edits,n.nextSelectionOffsets),n.text}let n=Jr(e,t);return this.#gt(``,void 0,!0),n}#ht(e,t){let n=this.#I,r=this.#$;if(n===void 0||r===void 0||e.length===0)return;let i=n.applyResolvedEdits(e,!0,r,void 0,!0);if(i===void 0)return;let a=t.map(e=>{let t=n.positionAt(e);return{start:t,end:t,direction:0}});n.setLastUndoSelectionsAfter(a),this.#St(i,a,this.#Ct(i))}#gt(e,t=this.#$,n=!1,r=`selection`){if(t===void 0)return;let i=this.#I,a=t.at(-1);if(i===void 0||a===void 0)return;let{nextSelections:o,change:s}=Array.isArray(e)&&e.length===t.length?xr(i,t,e,this.#F,n,r):vr(i,t,{start:i.offsetAt(a.start),end:i.offsetAt(a.end),text:Array.isArray(e)?e.join(i.eol):e},this.#F,void 0,n);s!==void 0&&this.#St(s,o,this.#Ct(s))}#_t(e=!1){let t=this.#$,n=this.#I;if(t===void 0||n===void 0)return;let{nextSelections:r,change:i}=kr(n,t,e,this.#F,this.#t.tabSize);i!==void 0&&this.#St(i,r,this.#Ct(i))}#vt(){let e=this.#$,t=this.#I;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=Er(t,e,this.#xe?(e,t)=>{let n=this.#At(e);for(let e=0;e+1<n.length;e++){let r=n[e],i=n[e+1];if(t>=r&&t<=i)return r}return 0}:void 0,this.#F);r!==void 0&&this.#St(r,n,this.#Ct(r))}#yt(){let e=this.#$,t=this.#I;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=Dr(t,e,this.#F);r!==void 0&&this.#St(r,n,this.#Ct(r))}#bt(){let e=this.#$,t=this.#I;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=Tr(t,e,this.#F);r!==void 0&&this.#St(r,n,this.#Ct(r))}#xt(){let e=this.#$,t=this.#I;if(e===void 0||t===void 0)return;let{nextSelections:n,change:r}=wr(t,e,this.#F);r!==void 0&&this.#St(r,n,this.#Ct(r))}#St(e,t,n,r){let i=this.getFile(),a=this.#e.onChange;if(i!==void 0&&a!==void 0&&a(i,n??this.#F),e.lineDelta!==0||this.#xe)for(let t of this.#v.keys())t>=e.startLine&&this.#v.delete(t);if(this.#xe)for(let t of this.#y.keys())t>=e.startLine&&this.#y.delete(t);this.#x=void 0;let o=this.#L,s;if(o!==void 0&&t!==void 0&&t.length>0){let n=t.at(-1),r=o.startingLine+o.totalLines;if(n.end.line>=r){let t=n.end.line-o.startingLine+1,i=this.#R===void 0||this.#R===1/0?1/0:this.#R*Sa;e.startLine<=r&&t<=i&&this.#ge(n.end.line)?(n.end.line>r&&(s=!0),o={...o,totalLines:t},this.#L=o):s=!0}}if(this.#ze(e,n,o,s),r?.skipSearchRefresh!==!0&&this.#B!==void 0&&this.#ee!==void 0&&this.#B.updateMatches({syncSelection:!1}),t!==void 0&&(this.#nt(t),r?.skipFocus!==!0)){let e=t.at(-1);if(e!==void 0&&this.#ve(Ar(e).line),this.#j!==void 0)requestAnimationFrame(()=>{this.#j?.scrollIntoView({block:`nearest`,inline:`nearest`})});else if(t.length>0){let e=Ar(t.at(-1));this.#Ge(e.line,e.character)}this.focus({preventScroll:!0})}}#Ct(e){if(this.#F!==void 0){let t=Kn(e,this.#F);if(t!==void 0)return this.#I?.setLastUndoLineAnnotations(this.#F,t),t}}#wt(){let e=this.#O;if(e===void 0)return;let t,n;for(let r of e.children){let e=r,i=e.dataset.lineType,a=In(e);if(a===void 0||i===void 0||!jr(i))continue;let o=a-1;(t===void 0||o<t)&&(t=o),(n===void 0||o>n)&&(n=o)}return t===void 0||n===void 0?void 0:{first:t,last:n}}#Tt(e){let t=this.#b.get(e);if(t!==void 0)return t??void 0;let n=this.#O;if(n!==void 0){if(this.#L!==void 0){let{startingLine:r}=this.#L,{children:i}=n;for(let n=e-r;n<=i.length;n++){let r=i[n];if(r===void 0)break;let a=In(r),o=r.dataset.lineType;if(a!==void 0&&a===e+1&&o!==void 0&&jr(o)){t=r;break}}}return t??=n.querySelector(`[data-line="${e+1}"]`+(this.#ye===`unified`?`:not([data-line-type="change-deletion"])`:``)),t!==void 0&&this.#b.set(e,t),t??void 0}}#Et(){if(this.#D===void 0)return 0;if(this.#g===void 0){let e=this.#O?.parentElement?.style.getPropertyValue(`--diffs-column-number-width`);e!==void 0&&e.length>2&&e.endsWith(`px`)?this.#g=parseInt(e.slice(0,-2),10):this.#g=this.#D.offsetWidth}return this.#g}#Dt(){if(this.#O===void 0)return 0;if(this.#_===void 0){let e=this.#O.parentElement?.style.getPropertyValue(`--diffs-column-content-width`);e!==void 0&&e.length>2&&e.endsWith(`px`)?this.#_=parseFloat(e.slice(0,-2)):this.#_=this.#O.offsetWidth}return this.#_}#Ot(e){let t=this.#v.get(e);if(t!==void 0)return t;let n=this.#Tt(e);if(n===void 0)return-1;let r=n.offsetTop+this.#t.paddingTop;return r+=this.#Ae?.top??0,this.#v.set(e,r),r}#kt(e,t){if(this.#x!==void 0&&this.#x[0]===e&&this.#x[1]===t)return[this.#x[2],this.#x[3]];let n=this.#I?.getLineText(e),r=this.#Et()+this.#t.ch;if(n===void 0||n.length===0||t<=0)return[r+(this.#Ae?.left??0),0];let i=da(n,Math.min(t,n.length)),a=n.slice(0,i),o=pa(a,this.#t.tabSize),s=0,c=0;if(s=o===-1?r+this.#t.measureTextWidth(a):r+o*this.#t.ch,this.#xe){let t=this.#Dt();if(2*this.#t.ch+this.#t.measureTextWidth(n)>t){let t=this.#At(e);for(let e=0;e+1<t.length;e++){let a=t[e];if(i<=t[e+1]){c=e;let t=n.slice(a,i),o=pa(t,this.#t.tabSize);s=o===-1?r+this.#t.measureTextWidth(t):r+o*this.#t.ch;break}}}s+=this.#Ae?.left??0}return this.#x===void 0?this.#x=[e,t,s,c]:(this.#x[0]=e,this.#x[1]=t,this.#x[2]=s,this.#x[3]=c),[s,c]}#At(e){let t=this.#y.get(e);if(t!==void 0)return t;let n=this.#I?.getLineText(e);if(n===void 0||n.length===0){let t=new Uint32Array([0]);return this.#y.set(e,t),t}let r=H(`div`,{style:{position:`absolute`,top:`0`,left:`0`,width:`100%`,boxSizing:`border-box`,visibility:`hidden`,pointerEvents:`none`,whiteSpace:`pre-wrap`,wordBreak:`break-word`,font:`inherit`,paddingInline:`1ch`,tabSize:this.#t.tabSize.toString()},textContent:n},this.#O),i=r.firstChild,a=document.createRange(),o=[];try{let t=fa(n),s=r.getBoundingClientRect().left+this.#t.ch,c=0,l=-1/0;for(let e=0,r=0;e<n.length;){let n=t===void 0?e+1:t[r+1];a.setStart(i,e),a.setEnd(i,n);let{left:u,top:d}=a.getBoundingClientRect();if(d>l){let t=yn()&&o.length>0&&u-s>this.#t.ch/2;o.push(t?c:e),l=d}c=e,e=n,r++}let u=new Uint32Array(o.length+1);for(let e=0;e<o.length;e++)u[e]=o[e];return u[o.length]=n.length,this.#y.set(e,u),u}finally{r.remove()}}#jt({startContainer:e,endContainer:t}){let n=this.#O;return n===void 0?!1:n.contains(e)&&n.contains(t)}#Mt(e){let t=this.#I?.lineCount??0;return e<0||e>=t?!1:this.#Tt(e)!==void 0}},Ea=`file-tree-container`,Da=`data-file-tree-style`,Oa=`data-file-tree-unsafe-css`,ka=`data-file-tree-scrollbar-measure`,Aa=`data-file-tree-scrollbar-gutter-measured`,ja=`--trees-scrollbar-gutter-measured`,Ma=`header`,Na=`context-menu`,Pa=`context-menu-trigger`,Fa=typeof window>`u`?R.useEffect:R.useLayoutEffect;function Ia(e,t,n){let r=e==null?null:(0,V.jsx)(`div`,{slot:Ma,children:e}),i=t!=null&&n!=null?(0,V.jsx)(`div`,{slot:Na,children:t(n.item,n.context)}):null;return r==null&&i==null?null:(0,V.jsxs)(V.Fragment,{children:[r,i]})}function La(e,t){return typeof window>`u`&&t!=null?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t.shadowHtml}}),e]}):(0,V.jsx)(V.Fragment,{children:e})}function Ra(e){let t=e.shadowRoot;return t?.querySelector(`[data-file-tree-id]`)instanceof HTMLElement||t?.querySelector(`[data-file-tree-id]`)instanceof SVGElement?!0:e.querySelector(`template[shadowrootmode="open"]`)instanceof HTMLTemplateElement}function za(e,t,n,r,i){let a={...e??{}};if(t!=null&&delete a.header,n){let t=e?.contextMenu,n=t?.onClose,o=t?.onOpen;a.contextMenu={...t??{},enabled:!0,onClose:()=>{n?.(),r()},onOpen:(e,t)=>{i(e,t),o?.(e,t)}},delete a.contextMenu.render}return a.header!=null||a.contextMenu!=null?a:void 0}function Ba({header:e,id:t,model:n,preloadedData:r,renderContextMenu:i,...a}){let[o,s]=(0,R.useState)(null),[c,l]=(0,R.useState)(null),u=(0,R.useRef)(n.getComposition()),d=(0,R.useRef)(n);d.current!==n&&(d.current=n,u.current=n.getComposition());let f=i!=null,p=(0,R.useCallback)(()=>{s(null)},[]),m=(0,R.useCallback)((e,t)=>{s({context:t,item:e})},[]),h=u.current,g=(0,R.useMemo)(()=>za(h,e,f,p,m),[h,p,m,f,e]),_=(0,R.useCallback)(e=>{l(e)},[]);(0,R.useEffect)(()=>{f||s(null)},[f]),Fa(()=>{n.setComposition(g)},[g,n]),Fa(()=>{if(c!=null)return r!=null&&Ra(c)?n.hydrate({fileTreeContainer:c}):n.render({fileTreeContainer:c}),()=>{n.unmount(),n.setComposition(h)}},[h,c,n,r]);let v=La(Ia(e,i,o),r),y=t??r?.id,b={"--trees-item-height":`${String(n.getItemHeight())}px`,"--trees-density-override":n.getDensityFactor(),...a.style};return(0,V.jsx)(Ea,{...a,id:y,ref:_,style:b,suppressHydrationWarning:r!=null,children:v})}var Va={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function Ha(e,t){if(typeof e==`number`)return{itemHeight:t??Va.default.itemHeight,factor:e};let n=Va[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var Ua=Va.default.itemHeight,Wa=`@layer base, theme, unsafe;
|
|
510
|
-
|
|
511
|
-
@layer base {
|
|
512
|
-
:host {
|
|
513
|
-
/*
|
|
514
|
-
CSS variables use a fallback stack to ensure user and theme colors slot
|
|
515
|
-
in with ease. User colors take precedence over theme colors, which take
|
|
516
|
-
precedence over defaults.
|
|
517
|
-
|
|
518
|
-
Fallback order:
|
|
519
|
-
|
|
520
|
-
1. --trees-*-override (explicit)
|
|
521
|
-
2. --trees-theme-* (e.g. Shiki/VS Code tokens)
|
|
522
|
-
3. defaults
|
|
523
|
-
|
|
524
|
-
Theme variable names mirror Shiki/VS Code theme file JSON tokens.
|
|
525
|
-
|
|
526
|
-
// Available CSS Color Overrides
|
|
527
|
-
--trees-fg-override
|
|
528
|
-
--trees-fg-muted-override
|
|
529
|
-
--trees-bg-override
|
|
530
|
-
--trees-bg-muted-override
|
|
531
|
-
--trees-accent-override
|
|
532
|
-
--trees-border-color-override
|
|
533
|
-
|
|
534
|
-
--trees-focus-ring-color-override
|
|
535
|
-
--trees-focus-ring-width-override
|
|
536
|
-
--trees-focus-ring-offset-override
|
|
537
|
-
|
|
538
|
-
--trees-search-fg-override
|
|
539
|
-
--trees-search-font-weight-override
|
|
540
|
-
--trees-search-bg-override
|
|
541
|
-
|
|
542
|
-
--trees-selected-fg-override
|
|
543
|
-
--trees-selected-bg-override
|
|
544
|
-
--trees-selected-focused-border-color-override
|
|
545
|
-
|
|
546
|
-
// Git Status Color Overrides
|
|
547
|
-
--trees-status-added-override
|
|
548
|
-
--trees-status-ignored-override
|
|
549
|
-
--trees-status-modified-override
|
|
550
|
-
--trees-status-renamed-override
|
|
551
|
-
--trees-status-untracked-override
|
|
552
|
-
--trees-status-deleted-override
|
|
553
|
-
--trees-git-added-color-override
|
|
554
|
-
--trees-git-ignored-color-override
|
|
555
|
-
--trees-git-modified-color-override
|
|
556
|
-
--trees-git-renamed-color-override
|
|
557
|
-
--trees-git-untracked-color-override
|
|
558
|
-
--trees-git-deleted-color-override
|
|
559
|
-
|
|
560
|
-
// Built-in File Icon Color Overrides
|
|
561
|
-
--trees-file-icon-color
|
|
562
|
-
--trees-file-icon-color-astro
|
|
563
|
-
--trees-file-icon-color-babel
|
|
564
|
-
--trees-file-icon-color-bash
|
|
565
|
-
--trees-file-icon-color-biome
|
|
566
|
-
--trees-file-icon-color-bootstrap
|
|
567
|
-
--trees-file-icon-color-browserslist
|
|
568
|
-
--trees-file-icon-color-bun
|
|
569
|
-
--trees-file-icon-color-c
|
|
570
|
-
--trees-file-icon-color-cpp
|
|
571
|
-
--trees-file-icon-color-claude
|
|
572
|
-
--trees-file-icon-color-css
|
|
573
|
-
--trees-file-icon-color-database
|
|
574
|
-
--trees-file-icon-color-default
|
|
575
|
-
--trees-file-icon-color-docker
|
|
576
|
-
--trees-file-icon-color-eslint
|
|
577
|
-
--trees-file-icon-color-git
|
|
578
|
-
--trees-file-icon-color-go
|
|
579
|
-
--trees-file-icon-color-graphql
|
|
580
|
-
--trees-file-icon-color-html
|
|
581
|
-
--trees-file-icon-color-image
|
|
582
|
-
--trees-file-icon-color-javascript
|
|
583
|
-
--trees-file-icon-color-json
|
|
584
|
-
--trees-file-icon-color-markdown
|
|
585
|
-
--trees-file-icon-color-mcp
|
|
586
|
-
--trees-file-icon-color-npm
|
|
587
|
-
--trees-file-icon-color-oxc
|
|
588
|
-
--trees-file-icon-color-postcss
|
|
589
|
-
--trees-file-icon-color-prettier
|
|
590
|
-
--trees-file-icon-color-python
|
|
591
|
-
--trees-file-icon-color-react
|
|
592
|
-
--trees-file-icon-color-ruby
|
|
593
|
-
--trees-file-icon-color-rust
|
|
594
|
-
--trees-file-icon-color-sass
|
|
595
|
-
--trees-file-icon-color-svg
|
|
596
|
-
--trees-file-icon-color-svelte
|
|
597
|
-
--trees-file-icon-color-svgo
|
|
598
|
-
--trees-file-icon-color-swift
|
|
599
|
-
--trees-file-icon-color-table
|
|
600
|
-
--trees-file-icon-color-text
|
|
601
|
-
--trees-file-icon-color-tailwind
|
|
602
|
-
--trees-file-icon-color-terraform
|
|
603
|
-
--trees-file-icon-color-typescript
|
|
604
|
-
--trees-file-icon-color-vite
|
|
605
|
-
--trees-file-icon-color-vscode
|
|
606
|
-
--trees-file-icon-color-vue
|
|
607
|
-
--trees-file-icon-color-wasm
|
|
608
|
-
--trees-file-icon-color-webpack
|
|
609
|
-
--trees-file-icon-color-yml
|
|
610
|
-
--trees-file-icon-color-zig
|
|
611
|
-
--trees-file-icon-color-zip
|
|
612
|
-
|
|
613
|
-
// Density
|
|
614
|
-
//
|
|
615
|
-
// A unitless scale factor for padding, gaps, and indentation. Usually
|
|
616
|
-
// set via \`density\` on useFileTree. Individual overrides take precedence.
|
|
617
|
-
//
|
|
618
|
-
// Compact: 0.8
|
|
619
|
-
// Default: 1
|
|
620
|
-
// Relaxed: 1.2
|
|
621
|
-
//
|
|
622
|
-
--trees-density-override
|
|
623
|
-
|
|
624
|
-
// Available CSS Layout Overrides
|
|
625
|
-
--trees-gap-override
|
|
626
|
-
--trees-border-radius-override
|
|
627
|
-
--trees-font-family-override
|
|
628
|
-
--trees-font-size-override
|
|
629
|
-
--trees-font-weight-regular-override
|
|
630
|
-
--trees-font-weight-semibold-override
|
|
631
|
-
--trees-level-gap-override
|
|
632
|
-
--trees-item-padding-x-override
|
|
633
|
-
--trees-item-margin-x-override
|
|
634
|
-
--trees-item-row-gap-override
|
|
635
|
-
--trees-icon-width-override
|
|
636
|
-
--trees-icon-nudge-override
|
|
637
|
-
--trees-scrollbar-gutter-override
|
|
638
|
-
--trees-padding-inline-override
|
|
639
|
-
*/
|
|
640
|
-
|
|
641
|
-
--trees-accent: var(--trees-accent-override, #009fff);
|
|
642
|
-
--trees-fg: var(
|
|
643
|
-
--trees-fg-override,
|
|
644
|
-
var(--trees-theme-sidebar-fg, light-dark(#6c6c71, #adadb1))
|
|
645
|
-
);
|
|
646
|
-
--trees-fg-muted: var(
|
|
647
|
-
--trees-fg-muted-override,
|
|
648
|
-
var(--trees-theme-sidebar-header-fg, light-dark(#84848a, #84848a))
|
|
649
|
-
);
|
|
650
|
-
--trees-bg: var(
|
|
651
|
-
--trees-bg-override,
|
|
652
|
-
var(--trees-theme-sidebar-bg, light-dark(#f8f8f8, #141415))
|
|
653
|
-
);
|
|
654
|
-
/* var(--trees-theme-list-hover-bg, light-dark(#dfebff59, #19283c59)) */
|
|
655
|
-
--trees-bg-muted: var(
|
|
656
|
-
--trees-bg-muted-override,
|
|
657
|
-
var(
|
|
658
|
-
--trees-theme-list-hover-bg,
|
|
659
|
-
light-dark(
|
|
660
|
-
color-mix(
|
|
661
|
-
in lab,
|
|
662
|
-
var(--trees-accent) var(--trees-bg-alpha-light, 8%),
|
|
663
|
-
var(--trees-bg)
|
|
664
|
-
),
|
|
665
|
-
color-mix(
|
|
666
|
-
in lab,
|
|
667
|
-
var(--trees-accent) var(--trees-bg-alpha-dark, 10%),
|
|
668
|
-
var(--trees-bg)
|
|
669
|
-
)
|
|
670
|
-
)
|
|
671
|
-
)
|
|
672
|
-
);
|
|
673
|
-
--trees-input-bg: var(
|
|
674
|
-
--trees-input-bg-override,
|
|
675
|
-
light-dark(#f8f8f8, #070707)
|
|
676
|
-
);
|
|
677
|
-
|
|
678
|
-
--trees-added-light: #16a994;
|
|
679
|
-
--trees-added-dark: #00cab1;
|
|
680
|
-
--trees-ignored-light: #adadb1;
|
|
681
|
-
--trees-ignored-dark: #4a4a4e;
|
|
682
|
-
--trees-modified-light: #1ca1c7;
|
|
683
|
-
--trees-modified-dark: #08c0ef;
|
|
684
|
-
--trees-renamed-light: #d5a910;
|
|
685
|
-
--trees-renamed-dark: #ffd452;
|
|
686
|
-
--trees-untracked-light: #16a994;
|
|
687
|
-
--trees-untracked-dark: #00cab1;
|
|
688
|
-
--trees-deleted-light: #ff2e3f;
|
|
689
|
-
--trees-deleted-dark: #ff6762;
|
|
690
|
-
|
|
691
|
-
--trees-border-color: var(
|
|
692
|
-
--trees-border-color-override,
|
|
693
|
-
var(--trees-theme-sidebar-border, light-dark(#eeeeef, #070707))
|
|
694
|
-
);
|
|
695
|
-
--trees-indent-guide-bg: var(
|
|
696
|
-
--trees-indent-guide-bg-override,
|
|
697
|
-
color-mix(in lab, var(--trees-fg-muted) 25%, transparent)
|
|
698
|
-
);
|
|
699
|
-
--trees-density: var(--trees-density-override, 1);
|
|
700
|
-
--trees-border-radius: var(
|
|
701
|
-
--trees-border-radius-override,
|
|
702
|
-
calc(6px * var(--trees-density))
|
|
703
|
-
);
|
|
704
|
-
|
|
705
|
-
--trees-font-family: var(--trees-font-family-override, system-ui);
|
|
706
|
-
--trees-font-size: var(--trees-font-size-override, 13px);
|
|
707
|
-
--trees-font-weight-regular: var(--trees-font-weight-regular-override, 400);
|
|
708
|
-
--trees-font-weight-semibold: var(
|
|
709
|
-
--trees-font-weight-semibold-override,
|
|
710
|
-
600
|
|
711
|
-
);
|
|
712
|
-
|
|
713
|
-
--trees-focus-ring-color: var(
|
|
714
|
-
--trees-focus-ring-color-override,
|
|
715
|
-
var(--trees-theme-focus-ring, var(--trees-accent))
|
|
716
|
-
);
|
|
717
|
-
--trees-focus-ring-width: var(--trees-focus-ring-width-override, 1px);
|
|
718
|
-
--trees-focus-ring-offset: var(--trees-focus-ring-offset-override, -1px);
|
|
719
|
-
|
|
720
|
-
--trees-search-fg: var(
|
|
721
|
-
--trees-search-fg-override,
|
|
722
|
-
var(--trees-theme-input-fg, var(--trees-fg))
|
|
723
|
-
);
|
|
724
|
-
--trees-search-font-weight: var(--trees-search-font-weight-override, 600);
|
|
725
|
-
--trees-search-bg: var(
|
|
726
|
-
--trees-search-bg-override,
|
|
727
|
-
var(--trees-theme-input-bg, var(--trees-input-bg))
|
|
728
|
-
);
|
|
729
|
-
|
|
730
|
-
--trees-scrollbar-thumb: var(
|
|
731
|
-
--trees-scrollbar-thumb-override,
|
|
732
|
-
var(
|
|
733
|
-
--trees-theme-scrollbar-thumb,
|
|
734
|
-
color-mix(in lab, var(--trees-fg) 25%, var(--trees-bg))
|
|
735
|
-
)
|
|
736
|
-
);
|
|
737
|
-
|
|
738
|
-
--trees-selected-fg: var(
|
|
739
|
-
--trees-selected-fg-override,
|
|
740
|
-
var(--trees-theme-list-active-selection-fg, var(--trees-fg))
|
|
741
|
-
);
|
|
742
|
-
--trees-selected-bg: var(
|
|
743
|
-
--trees-selected-bg-override,
|
|
744
|
-
var(
|
|
745
|
-
--trees-theme-list-active-selection-bg,
|
|
746
|
-
light-dark(
|
|
747
|
-
color-mix(in lab, var(--trees-accent) 12%, var(--trees-bg)),
|
|
748
|
-
color-mix(in lab, var(--trees-accent) 15%, var(--trees-bg))
|
|
749
|
-
)
|
|
750
|
-
)
|
|
751
|
-
);
|
|
752
|
-
--trees-selected-focused-border-color: var(
|
|
753
|
-
--trees-selected-focused-border-color-override,
|
|
754
|
-
var(--trees-theme-focus-ring, var(--trees-accent))
|
|
755
|
-
);
|
|
756
|
-
|
|
757
|
-
/* Git status (e.g. from Shiki theme gitDecoration.*) */
|
|
758
|
-
--trees-status-added: var(
|
|
759
|
-
--trees-status-added-override,
|
|
760
|
-
var(
|
|
761
|
-
--trees-theme-git-added-fg,
|
|
762
|
-
light-dark(var(--trees-added-light), var(--trees-added-dark))
|
|
763
|
-
)
|
|
764
|
-
);
|
|
765
|
-
--trees-status-ignored: var(
|
|
766
|
-
--trees-status-ignored-override,
|
|
767
|
-
var(
|
|
768
|
-
--trees-theme-git-ignored-fg,
|
|
769
|
-
light-dark(var(--trees-ignored-light), var(--trees-ignored-dark))
|
|
770
|
-
)
|
|
771
|
-
);
|
|
772
|
-
--trees-status-modified: var(
|
|
773
|
-
--trees-status-modified-override,
|
|
774
|
-
var(
|
|
775
|
-
--trees-theme-git-modified-fg,
|
|
776
|
-
light-dark(var(--trees-modified-light), var(--trees-modified-dark))
|
|
777
|
-
)
|
|
778
|
-
);
|
|
779
|
-
--trees-status-renamed: var(
|
|
780
|
-
--trees-status-renamed-override,
|
|
781
|
-
var(
|
|
782
|
-
--trees-theme-git-renamed-fg,
|
|
783
|
-
light-dark(var(--trees-renamed-light), var(--trees-renamed-dark))
|
|
784
|
-
)
|
|
785
|
-
);
|
|
786
|
-
--trees-status-untracked: var(
|
|
787
|
-
--trees-status-untracked-override,
|
|
788
|
-
var(
|
|
789
|
-
--trees-theme-git-untracked-fg,
|
|
790
|
-
light-dark(var(--trees-untracked-light), var(--trees-untracked-dark))
|
|
791
|
-
)
|
|
792
|
-
);
|
|
793
|
-
--trees-status-deleted: var(
|
|
794
|
-
--trees-status-deleted-override,
|
|
795
|
-
var(
|
|
796
|
-
--trees-theme-git-deleted-fg,
|
|
797
|
-
light-dark(var(--trees-deleted-light), var(--trees-deleted-dark))
|
|
798
|
-
)
|
|
799
|
-
);
|
|
800
|
-
--trees-git-modified-color: var(
|
|
801
|
-
--trees-git-modified-color-override,
|
|
802
|
-
var(--trees-status-modified)
|
|
803
|
-
);
|
|
804
|
-
--trees-git-added-color: var(
|
|
805
|
-
--trees-git-added-color-override,
|
|
806
|
-
var(--trees-status-added)
|
|
807
|
-
);
|
|
808
|
-
--trees-git-ignored-color: var(
|
|
809
|
-
--trees-git-ignored-color-override,
|
|
810
|
-
var(--trees-status-ignored)
|
|
811
|
-
);
|
|
812
|
-
--trees-git-deleted-color: var(
|
|
813
|
-
--trees-git-deleted-color-override,
|
|
814
|
-
var(--trees-status-deleted)
|
|
815
|
-
);
|
|
816
|
-
--trees-git-renamed-color: var(
|
|
817
|
-
--trees-git-renamed-color-override,
|
|
818
|
-
var(--trees-status-renamed)
|
|
819
|
-
);
|
|
820
|
-
--trees-git-untracked-color: var(
|
|
821
|
-
--trees-git-untracked-color-override,
|
|
822
|
-
var(--trees-status-untracked)
|
|
823
|
-
);
|
|
824
|
-
|
|
825
|
-
--trees-icon-gray: light-dark(#84848a, #adadb1);
|
|
826
|
-
--trees-icon-red: light-dark(#d52c36, #ff6762);
|
|
827
|
-
--trees-icon-vermilion: light-dark(#ff8c5b, #d5512f);
|
|
828
|
-
--trees-icon-orange: light-dark(#d47628, #ffa359);
|
|
829
|
-
--trees-icon-yellow: light-dark(#d5a910, #ffd452);
|
|
830
|
-
--trees-icon-green: light-dark(#199f43, #5ecc71);
|
|
831
|
-
--trees-icon-teal: light-dark(#17a5af, #64d1db);
|
|
832
|
-
--trees-icon-cyan: light-dark(#1ca1c7, #68cdf2);
|
|
833
|
-
--trees-icon-blue: light-dark(#1a85d4, #69b1ff);
|
|
834
|
-
--trees-icon-indigo: light-dark(#693acf, #9d6afb);
|
|
835
|
-
--trees-icon-purple: light-dark(#a631be, #d568ea);
|
|
836
|
-
--trees-icon-pink: light-dark(#d32a61, #ff678d);
|
|
837
|
-
--trees-icon-mauve: light-dark(#594c5b, #79697b);
|
|
838
|
-
|
|
839
|
-
--trees-file-icon-color-default: var(
|
|
840
|
-
--trees-file-icon-color,
|
|
841
|
-
var(--trees-icon-gray)
|
|
842
|
-
);
|
|
843
|
-
--trees-file-icon-color-astro: var(
|
|
844
|
-
--trees-file-icon-color,
|
|
845
|
-
var(--trees-icon-purple)
|
|
846
|
-
);
|
|
847
|
-
--trees-file-icon-color-babel: var(
|
|
848
|
-
--trees-file-icon-color,
|
|
849
|
-
var(--trees-icon-yellow)
|
|
850
|
-
);
|
|
851
|
-
--trees-file-icon-color-bash: var(
|
|
852
|
-
--trees-file-icon-color,
|
|
853
|
-
var(--trees-icon-green)
|
|
854
|
-
);
|
|
855
|
-
--trees-file-icon-color-biome: var(
|
|
856
|
-
--trees-file-icon-color,
|
|
857
|
-
var(--trees-icon-blue)
|
|
858
|
-
);
|
|
859
|
-
--trees-file-icon-color-bootstrap: var(
|
|
860
|
-
--trees-file-icon-color,
|
|
861
|
-
var(--trees-icon-indigo)
|
|
862
|
-
);
|
|
863
|
-
--trees-file-icon-color-browserslist: var(
|
|
864
|
-
--trees-file-icon-color,
|
|
865
|
-
var(--trees-icon-yellow)
|
|
866
|
-
);
|
|
867
|
-
--trees-file-icon-color-bun: var(
|
|
868
|
-
--trees-file-icon-color,
|
|
869
|
-
var(--trees-icon-mauve)
|
|
870
|
-
);
|
|
871
|
-
--trees-file-icon-color-c: var(
|
|
872
|
-
--trees-file-icon-color,
|
|
873
|
-
var(--trees-icon-blue)
|
|
874
|
-
);
|
|
875
|
-
--trees-file-icon-color-cpp: var(
|
|
876
|
-
--trees-file-icon-color,
|
|
877
|
-
var(--trees-icon-blue)
|
|
878
|
-
);
|
|
879
|
-
--trees-file-icon-color-claude: var(
|
|
880
|
-
--trees-file-icon-color,
|
|
881
|
-
var(--trees-icon-orange)
|
|
882
|
-
);
|
|
883
|
-
--trees-file-icon-color-css: var(
|
|
884
|
-
--trees-file-icon-color,
|
|
885
|
-
var(--trees-icon-indigo)
|
|
886
|
-
);
|
|
887
|
-
--trees-file-icon-color-database: var(
|
|
888
|
-
--trees-file-icon-color,
|
|
889
|
-
var(--trees-icon-purple)
|
|
890
|
-
);
|
|
891
|
-
--trees-file-icon-color-docker: var(
|
|
892
|
-
--trees-file-icon-color,
|
|
893
|
-
var(--trees-icon-blue)
|
|
894
|
-
);
|
|
895
|
-
--trees-file-icon-color-eslint: var(
|
|
896
|
-
--trees-file-icon-color,
|
|
897
|
-
var(--trees-icon-indigo)
|
|
898
|
-
);
|
|
899
|
-
--trees-file-icon-color-git: var(
|
|
900
|
-
--trees-file-icon-vermilion,
|
|
901
|
-
var(--trees-icon-vermilion)
|
|
902
|
-
);
|
|
903
|
-
--trees-file-icon-color-go: var(
|
|
904
|
-
--trees-file-icon-color,
|
|
905
|
-
var(--trees-icon-cyan)
|
|
906
|
-
);
|
|
907
|
-
--trees-file-icon-color-graphql: var(
|
|
908
|
-
--trees-file-icon-color,
|
|
909
|
-
var(--trees-icon-pink)
|
|
910
|
-
);
|
|
911
|
-
--trees-file-icon-color-html: var(
|
|
912
|
-
--trees-file-icon-color,
|
|
913
|
-
var(--trees-icon-orange)
|
|
914
|
-
);
|
|
915
|
-
--trees-file-icon-color-image: var(
|
|
916
|
-
--trees-file-icon-color,
|
|
917
|
-
var(--trees-icon-pink)
|
|
918
|
-
);
|
|
919
|
-
--trees-file-icon-color-javascript: var(
|
|
920
|
-
--trees-file-icon-color,
|
|
921
|
-
var(--trees-icon-yellow)
|
|
922
|
-
);
|
|
923
|
-
--trees-file-icon-color-json: var(
|
|
924
|
-
--trees-file-icon-color,
|
|
925
|
-
var(--trees-icon-orange)
|
|
926
|
-
);
|
|
927
|
-
--trees-file-icon-color-markdown: var(
|
|
928
|
-
--trees-file-icon-color,
|
|
929
|
-
var(--trees-icon-green)
|
|
930
|
-
);
|
|
931
|
-
--trees-file-icon-color-mcp: var(
|
|
932
|
-
--trees-file-icon-color,
|
|
933
|
-
var(--trees-icon-teal)
|
|
934
|
-
);
|
|
935
|
-
--trees-file-icon-color-npm: var(
|
|
936
|
-
--trees-file-icon-color,
|
|
937
|
-
var(--trees-icon-red)
|
|
938
|
-
);
|
|
939
|
-
--trees-file-icon-color-oxc: var(
|
|
940
|
-
--trees-file-icon-cyan,
|
|
941
|
-
var(--trees-icon-cyan)
|
|
942
|
-
);
|
|
943
|
-
--trees-file-icon-color-postcss: var(
|
|
944
|
-
--trees-file-icon-color,
|
|
945
|
-
var(--trees-icon-red)
|
|
946
|
-
);
|
|
947
|
-
--trees-file-icon-color-prettier: var(
|
|
948
|
-
--trees-file-icon-color,
|
|
949
|
-
var(--trees-icon-teal)
|
|
950
|
-
);
|
|
951
|
-
--trees-file-icon-color-python: var(
|
|
952
|
-
--trees-file-icon-color,
|
|
953
|
-
var(--trees-icon-blue)
|
|
954
|
-
);
|
|
955
|
-
--trees-file-icon-color-react: var(
|
|
956
|
-
--trees-file-icon-color,
|
|
957
|
-
var(--trees-icon-cyan)
|
|
958
|
-
);
|
|
959
|
-
--trees-file-icon-color-ruby: var(
|
|
960
|
-
--trees-file-icon-color,
|
|
961
|
-
var(--trees-icon-red)
|
|
962
|
-
);
|
|
963
|
-
--trees-file-icon-color-rust: var(
|
|
964
|
-
--trees-file-icon-color,
|
|
965
|
-
var(--trees-icon-orange)
|
|
966
|
-
);
|
|
967
|
-
--trees-file-icon-color-sass: var(
|
|
968
|
-
--trees-file-icon-color,
|
|
969
|
-
var(--trees-icon-pink)
|
|
970
|
-
);
|
|
971
|
-
--trees-file-icon-color-svg: var(
|
|
972
|
-
--trees-file-icon-color,
|
|
973
|
-
var(--trees-icon-orange)
|
|
974
|
-
);
|
|
975
|
-
--trees-file-icon-color-svelte: var(
|
|
976
|
-
--trees-file-icon-color,
|
|
977
|
-
var(--trees-icon-red)
|
|
978
|
-
);
|
|
979
|
-
--trees-file-icon-color-svgo: var(
|
|
980
|
-
--trees-file-icon-color,
|
|
981
|
-
var(--trees-icon-green)
|
|
982
|
-
);
|
|
983
|
-
--trees-file-icon-color-swift: var(
|
|
984
|
-
--trees-file-icon-color,
|
|
985
|
-
var(--trees-icon-orange)
|
|
986
|
-
);
|
|
987
|
-
--trees-file-icon-color-table: var(
|
|
988
|
-
--trees-file-icon-color,
|
|
989
|
-
var(--trees-icon-teal)
|
|
990
|
-
);
|
|
991
|
-
--trees-file-icon-color-text: var(
|
|
992
|
-
--trees-file-icon-color,
|
|
993
|
-
var(--trees-icon-gray)
|
|
994
|
-
);
|
|
995
|
-
--trees-file-icon-color-tailwind: var(
|
|
996
|
-
--trees-file-icon-color,
|
|
997
|
-
var(--trees-icon-cyan)
|
|
998
|
-
);
|
|
999
|
-
--trees-file-icon-color-terraform: var(
|
|
1000
|
-
--trees-file-icon-color,
|
|
1001
|
-
var(--trees-icon-indigo)
|
|
1002
|
-
);
|
|
1003
|
-
--trees-file-icon-color-typescript: var(
|
|
1004
|
-
--trees-file-icon-color,
|
|
1005
|
-
var(--trees-icon-blue)
|
|
1006
|
-
);
|
|
1007
|
-
--trees-file-icon-color-vite: var(
|
|
1008
|
-
--trees-file-icon-color,
|
|
1009
|
-
var(--trees-icon-purple)
|
|
1010
|
-
);
|
|
1011
|
-
--trees-file-icon-color-vscode: var(
|
|
1012
|
-
--trees-file-icon-color,
|
|
1013
|
-
var(--trees-icon-blue)
|
|
1014
|
-
);
|
|
1015
|
-
--trees-file-icon-color-vue: var(
|
|
1016
|
-
--trees-file-icon-color,
|
|
1017
|
-
var(--trees-icon-green)
|
|
1018
|
-
);
|
|
1019
|
-
--trees-file-icon-color-wasm: var(
|
|
1020
|
-
--trees-file-icon-color,
|
|
1021
|
-
var(--trees-icon-indigo)
|
|
1022
|
-
);
|
|
1023
|
-
--trees-file-icon-color-webpack: var(
|
|
1024
|
-
--trees-file-icon-color,
|
|
1025
|
-
var(--trees-icon-blue)
|
|
1026
|
-
);
|
|
1027
|
-
--trees-file-icon-color-yml: var(
|
|
1028
|
-
--trees-file-icon-color,
|
|
1029
|
-
var(--trees-icon-red)
|
|
1030
|
-
);
|
|
1031
|
-
--trees-file-icon-color-zig: var(
|
|
1032
|
-
--trees-file-icon-color,
|
|
1033
|
-
var(--trees-icon-orange)
|
|
1034
|
-
);
|
|
1035
|
-
--trees-file-icon-color-zip: var(
|
|
1036
|
-
--trees-file-icon-color,
|
|
1037
|
-
var(--trees-icon-orange)
|
|
1038
|
-
);
|
|
1039
|
-
|
|
1040
|
-
--trees-level-gap: var(
|
|
1041
|
-
--trees-level-gap-override,
|
|
1042
|
-
calc(8px * var(--trees-density))
|
|
1043
|
-
);
|
|
1044
|
-
--trees-item-padding-x: var(
|
|
1045
|
-
--trees-item-padding-x-override,
|
|
1046
|
-
calc(8px * var(--trees-density))
|
|
1047
|
-
);
|
|
1048
|
-
--trees-item-margin-x: var(
|
|
1049
|
-
--trees-item-margin-x-override,
|
|
1050
|
-
calc(2px * var(--trees-density))
|
|
1051
|
-
);
|
|
1052
|
-
--trees-item-row-gap: var(
|
|
1053
|
-
--trees-item-row-gap-override,
|
|
1054
|
-
calc(6px * var(--trees-density))
|
|
1055
|
-
);
|
|
1056
|
-
--trees-icon-width: var(--trees-icon-width-override, 16px);
|
|
1057
|
-
--trees-icon-nudge: var(
|
|
1058
|
-
--trees-icon-nudge-override,
|
|
1059
|
-
calc(1px * var(--trees-density))
|
|
1060
|
-
);
|
|
1061
|
-
--trees-row-height: var(--trees-item-height, 30px);
|
|
1062
|
-
--trees-git-lane-width: var(--trees-git-lane-width-override, 12px);
|
|
1063
|
-
--trees-action-lane-width: var(
|
|
1064
|
-
--trees-action-lane-width-override,
|
|
1065
|
-
calc(var(--trees-icon-width) + 2px)
|
|
1066
|
-
);
|
|
1067
|
-
/* Keep the floating trigger aligned with the row's action lane. Going in
|
|
1068
|
-
from the root's right edge: the scroll container reserves
|
|
1069
|
-
\`--trees-padding-inline\` of effective inset on each side (its asymmetric
|
|
1070
|
-
padding formula cancels the scrollbar gutter on the right), the row
|
|
1071
|
-
sits inside that inset, and its trailing \`--trees-item-padding-x\` is the
|
|
1072
|
-
action lane itself. The trigger's own focus-ring margin then trims one
|
|
1073
|
-
pixel back so the button's visible right edge lines up with the lane. */
|
|
1074
|
-
--trees-context-menu-trigger-inline-offset: calc(
|
|
1075
|
-
var(--trees-padding-inline) + var(--trees-item-padding-x) -
|
|
1076
|
-
var(--trees-focus-ring-width)
|
|
1077
|
-
);
|
|
1078
|
-
|
|
1079
|
-
--trees-scrollbar-gutter: var(--trees-scrollbar-gutter-override, 6px);
|
|
1080
|
-
--trees-padding-inline: var(--trees-padding-inline-override, 16px);
|
|
1081
|
-
|
|
1082
|
-
color-scheme: light dark;
|
|
1083
|
-
display: flex;
|
|
1084
|
-
flex-direction: column;
|
|
1085
|
-
font-size: var(--trees-font-size);
|
|
1086
|
-
color: var(--trees-fg);
|
|
1087
|
-
background-color: var(--trees-bg);
|
|
1088
|
-
--truncate-marker-background-color: var(--trees-bg);
|
|
1089
|
-
--truncate-marker-background-overlay-color: transparent;
|
|
1090
|
-
font-family: var(--trees-font-family);
|
|
1091
|
-
font-weight: var(--trees-font-weight-regular);
|
|
1092
|
-
}
|
|
1093
|
-
|
|
1094
|
-
:host([data-file-tree-virtualized='true']) {
|
|
1095
|
-
height: 100%;
|
|
1096
|
-
overflow: hidden;
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
|
-
[data-file-tree-virtualized-wrapper='true'] {
|
|
1100
|
-
height: 100%;
|
|
1101
|
-
overflow: hidden;
|
|
1102
|
-
display: flex;
|
|
1103
|
-
flex-direction: column;
|
|
1104
|
-
}
|
|
1105
|
-
|
|
1106
|
-
[data-file-tree-virtualized-root='true'] {
|
|
1107
|
-
height: 100%;
|
|
1108
|
-
display: flex;
|
|
1109
|
-
flex-direction: column;
|
|
1110
|
-
overflow: hidden;
|
|
1111
|
-
}
|
|
1112
|
-
|
|
1113
|
-
[data-file-tree-virtualized-scroll='true'],
|
|
1114
|
-
[data-file-tree-scrollbar-measure='true'] {
|
|
1115
|
-
--trees-scrollbar-thumb-current: transparent;
|
|
1116
|
-
overflow-y: auto;
|
|
1117
|
-
scrollbar-gutter: stable;
|
|
1118
|
-
|
|
1119
|
-
&:hover {
|
|
1120
|
-
--trees-scrollbar-thumb-current: var(--trees-scrollbar-thumb);
|
|
1121
|
-
}
|
|
1122
|
-
|
|
1123
|
-
&::-webkit-scrollbar {
|
|
1124
|
-
width: var(--trees-scrollbar-gutter);
|
|
1125
|
-
height: var(--trees-scrollbar-gutter);
|
|
1126
|
-
}
|
|
1127
|
-
|
|
1128
|
-
&::-webkit-scrollbar-track {
|
|
1129
|
-
background: transparent;
|
|
1130
|
-
}
|
|
1131
|
-
|
|
1132
|
-
&::-webkit-scrollbar-thumb {
|
|
1133
|
-
background-color: var(--trees-scrollbar-thumb-current);
|
|
1134
|
-
border: 1px solid transparent;
|
|
1135
|
-
background-clip: content-box;
|
|
1136
|
-
border-radius: calc(var(--trees-scrollbar-gutter) / 2);
|
|
1137
|
-
}
|
|
1138
|
-
|
|
1139
|
-
&::-webkit-scrollbar-corner {
|
|
1140
|
-
background-color: transparent;
|
|
1141
|
-
}
|
|
1142
|
-
}
|
|
1143
|
-
|
|
1144
|
-
/* These are styles for a temporarily generated element to measure the size
|
|
1145
|
-
* of the scrollbar. It's intended to be somewhat similar in scrollbar style
|
|
1146
|
-
* scope to the scrollable tree so \`--trees-scrollbar-gutter-measured\` is an
|
|
1147
|
-
* accurate reflection of the size the scrollbar gutter takes up. */
|
|
1148
|
-
[data-file-tree-scrollbar-measure='true'] {
|
|
1149
|
-
position: absolute;
|
|
1150
|
-
top: 0;
|
|
1151
|
-
left: 0;
|
|
1152
|
-
visibility: hidden;
|
|
1153
|
-
pointer-events: none;
|
|
1154
|
-
width: 100px;
|
|
1155
|
-
height: 100px;
|
|
1156
|
-
}
|
|
1157
|
-
|
|
1158
|
-
@supports (-moz-appearance: none) {
|
|
1159
|
-
[data-file-tree-virtualized-scroll='true'],
|
|
1160
|
-
[data-file-tree-scrollbar-measure='true'] {
|
|
1161
|
-
scrollbar-width: thin;
|
|
1162
|
-
scrollbar-color: var(--trees-scrollbar-thumb-current) transparent;
|
|
1163
|
-
}
|
|
1164
|
-
}
|
|
1165
|
-
|
|
1166
|
-
[data-file-tree-virtualized-scroll='true'] {
|
|
1167
|
-
position: relative;
|
|
1168
|
-
overflow-y: auto;
|
|
1169
|
-
flex: 1 1 0;
|
|
1170
|
-
min-height: 0;
|
|
1171
|
-
padding-inline: max(
|
|
1172
|
-
calc(var(--trees-padding-inline) - var(--trees-item-margin-x)),
|
|
1173
|
-
0px
|
|
1174
|
-
)
|
|
1175
|
-
/* NOTE(amadeus): We can assume that all Webkit based browser gutters
|
|
1176
|
-
* will align to the value of '--trees-scrollbar-gutter', however if not, then
|
|
1177
|
-
* \`--trees-scrollbar-gutter-measured\` should correct it. Mostly we are
|
|
1178
|
-
* hoping to avoid SSR alignment jumps if possible. In non-SSR'd environments
|
|
1179
|
-
* \`--trees-scrollbar-gutter-measured\` should always be immediately available.
|
|
1180
|
-
*/
|
|
1181
|
-
max(
|
|
1182
|
-
calc(
|
|
1183
|
-
var(--trees-padding-inline) - var(--trees-item-margin-x) -
|
|
1184
|
-
var(
|
|
1185
|
-
--trees-scrollbar-gutter-measured,
|
|
1186
|
-
var(--trees-scrollbar-gutter)
|
|
1187
|
-
)
|
|
1188
|
-
),
|
|
1189
|
-
0px
|
|
1190
|
-
);
|
|
1191
|
-
}
|
|
1192
|
-
|
|
1193
|
-
@supports (-moz-appearance: none) {
|
|
1194
|
-
[data-file-tree-virtualized-scroll='true'] {
|
|
1195
|
-
padding-inline: max(
|
|
1196
|
-
calc(var(--trees-padding-inline) - var(--trees-item-margin-x)),
|
|
1197
|
-
0px
|
|
1198
|
-
)
|
|
1199
|
-
/* NOTE(amadeus): However on Firefox it can vary a little bit, but most
|
|
1200
|
-
* likely the majority of cases will default to a 0px width scrollbar lets
|
|
1201
|
-
* inherit that first to avoid SSR jumps. In non-SSR'd environments
|
|
1202
|
-
* \`--trees-scrollbar-gutter-measured\` should always be immediately available.
|
|
1203
|
-
*/
|
|
1204
|
-
max(
|
|
1205
|
-
calc(
|
|
1206
|
-
var(--trees-padding-inline) - var(--trees-item-margin-x) -
|
|
1207
|
-
var(--trees-scrollbar-gutter-measured, 0px)
|
|
1208
|
-
),
|
|
1209
|
-
0px
|
|
1210
|
-
);
|
|
1211
|
-
}
|
|
1212
|
-
}
|
|
1213
|
-
|
|
1214
|
-
[data-file-tree-sticky-overlay='true'] {
|
|
1215
|
-
position: sticky;
|
|
1216
|
-
top: 0;
|
|
1217
|
-
height: 0;
|
|
1218
|
-
z-index: 4;
|
|
1219
|
-
overflow: visible;
|
|
1220
|
-
pointer-events: none;
|
|
1221
|
-
}
|
|
1222
|
-
|
|
1223
|
-
/* The overlay DOM is kept populated even at scrollTop=0 so the browser has
|
|
1224
|
-
* the rendered rows on hand the moment scrolling begins — otherwise the
|
|
1225
|
-
* compositor paints a scrolled frame before React can mount the overlay,
|
|
1226
|
-
* and the topmost sticky folder jumps up by a couple of pixels before it
|
|
1227
|
-
* "snaps" into its pinned position. We hide it via CSS whenever the scroll
|
|
1228
|
-
* is at the top and no scroll is in progress, so the preview doesn't leak
|
|
1229
|
-
* through at rest. \`data-overlay-reveal\` is stamped on the root only when
|
|
1230
|
-
* the user initiates a scroll while already at the top — exactly the case
|
|
1231
|
-
* where we need the pre-mounted overlay to be visible through the first
|
|
1232
|
-
* compositor frame. It is deliberately distinct from the general
|
|
1233
|
-
* \`data-is-scrolling\` flag so a scroll that ends at the top (e.g. ArrowUp
|
|
1234
|
-
* navigation) re-hides the overlay the instant the scroll lands, rather
|
|
1235
|
-
* than waiting for the hover-suppression timer to elapse. */
|
|
1236
|
-
[data-file-tree-virtualized-root='true'][data-scroll-at-top='true']:not(
|
|
1237
|
-
[data-overlay-reveal]
|
|
1238
|
-
)
|
|
1239
|
-
[data-file-tree-sticky-overlay='true'] {
|
|
1240
|
-
visibility: hidden;
|
|
1241
|
-
}
|
|
1242
|
-
|
|
1243
|
-
[data-file-tree-sticky-overlay-content='true'] {
|
|
1244
|
-
background-color: var(--trees-bg);
|
|
1245
|
-
position: relative;
|
|
1246
|
-
pointer-events: none;
|
|
1247
|
-
}
|
|
1248
|
-
|
|
1249
|
-
[data-file-tree-virtualized-list='true'] {
|
|
1250
|
-
background-color: var(--trees-bg);
|
|
1251
|
-
position: relative;
|
|
1252
|
-
min-height: 100%;
|
|
1253
|
-
width: 100%;
|
|
1254
|
-
overflow-anchor: none;
|
|
1255
|
-
|
|
1256
|
-
&[data-is-scrolling] {
|
|
1257
|
-
pointer-events: none;
|
|
1258
|
-
}
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
|
-
[data-file-tree-virtualized-sticky-offset='true'] {
|
|
1262
|
-
contain: layout size;
|
|
1263
|
-
}
|
|
1264
|
-
|
|
1265
|
-
[data-file-tree-virtualized-sticky='true'] {
|
|
1266
|
-
position: sticky;
|
|
1267
|
-
top: 0;
|
|
1268
|
-
width: 100%;
|
|
1269
|
-
display: flex;
|
|
1270
|
-
flex-direction: column;
|
|
1271
|
-
isolation: isolate;
|
|
1272
|
-
/* Promote to its own compositor layer so text inside the window is
|
|
1273
|
-
* rasterized once and GPU-translated during scroll. Without this, the
|
|
1274
|
-
* browser re-paints the window (and its text) at every scroll frame,
|
|
1275
|
-
* which produces visible 1px shake / character tearing. */
|
|
1276
|
-
will-change: transform;
|
|
1277
|
-
}
|
|
1278
|
-
|
|
1279
|
-
[data-file-tree-search-container] {
|
|
1280
|
-
display: flex;
|
|
1281
|
-
padding: 0;
|
|
1282
|
-
padding-inline: var(--trees-padding-inline);
|
|
1283
|
-
margin-bottom: var(--trees-item-row-gap);
|
|
1284
|
-
}
|
|
1285
|
-
|
|
1286
|
-
[data-file-tree-search-input] {
|
|
1287
|
-
--trees-focus-ring-width: 2px;
|
|
1288
|
-
font-family: var(--trees-font-family);
|
|
1289
|
-
font-size: var(--trees-font-size);
|
|
1290
|
-
flex: 1;
|
|
1291
|
-
height: var(--trees-row-height);
|
|
1292
|
-
/* 1px breathing room so the focus-visible outline isn't clipped when the
|
|
1293
|
-
* input sits flush against the top of the scroll container. */
|
|
1294
|
-
margin-block: 1px;
|
|
1295
|
-
padding-inline: var(--trees-item-padding-x);
|
|
1296
|
-
line-height: var(--trees-row-height);
|
|
1297
|
-
color: var(--trees-search-fg);
|
|
1298
|
-
background-color: var(--trees-search-bg);
|
|
1299
|
-
border: 1px solid var(--trees-border-color);
|
|
1300
|
-
border-radius: var(--trees-border-radius);
|
|
1301
|
-
outline: none;
|
|
1302
|
-
|
|
1303
|
-
&::placeholder {
|
|
1304
|
-
color: color-mix(
|
|
1305
|
-
in lab,
|
|
1306
|
-
var(--trees-search-fg) 65%,
|
|
1307
|
-
var(--trees-search-bg)
|
|
1308
|
-
);
|
|
1309
|
-
}
|
|
1310
|
-
|
|
1311
|
-
&:focus-visible,
|
|
1312
|
-
&[data-file-tree-search-input-fake-focus='true'] {
|
|
1313
|
-
outline: var(--trees-focus-ring-width) solid var(--trees-focus-ring-color);
|
|
1314
|
-
outline-offset: var(--trees-focus-ring-offset);
|
|
1315
|
-
}
|
|
1316
|
-
}
|
|
1317
|
-
|
|
1318
|
-
/* The wrapper for the tree items */
|
|
1319
|
-
[role='tree'] {
|
|
1320
|
-
position: relative;
|
|
1321
|
-
display: flex;
|
|
1322
|
-
flex-direction: column;
|
|
1323
|
-
gap: var(--trees-gap-override, 0);
|
|
1324
|
-
}
|
|
1325
|
-
|
|
1326
|
-
/* LIST ITEM */
|
|
1327
|
-
[data-type='item'] {
|
|
1328
|
-
color: inherit;
|
|
1329
|
-
font-family: var(--trees-font-family);
|
|
1330
|
-
font-size: var(--trees-font-size);
|
|
1331
|
-
text-align: start;
|
|
1332
|
-
outline: none;
|
|
1333
|
-
background-color: var(--trees-bg);
|
|
1334
|
-
border: none;
|
|
1335
|
-
position: relative;
|
|
1336
|
-
|
|
1337
|
-
padding: 0 var(--trees-item-padding-x);
|
|
1338
|
-
margin: 0 var(--trees-item-margin-x);
|
|
1339
|
-
cursor: pointer;
|
|
1340
|
-
-webkit-user-select: none;
|
|
1341
|
-
user-select: none;
|
|
1342
|
-
-webkit-touch-callout: none;
|
|
1343
|
-
touch-action: manipulation;
|
|
1344
|
-
display: flex;
|
|
1345
|
-
flex: 0 0 var(--trees-row-height);
|
|
1346
|
-
align-items: center;
|
|
1347
|
-
height: var(--trees-row-height);
|
|
1348
|
-
line-height: var(--trees-row-height);
|
|
1349
|
-
gap: var(--trees-item-row-gap);
|
|
1350
|
-
border-radius: var(--trees-border-radius);
|
|
1351
|
-
/* Row states may be translucent, so markers paint the tree background first
|
|
1352
|
-
* and then the state color on top to avoid compositing the same alpha twice. */
|
|
1353
|
-
--truncate-marker-background-color: var(--trees-bg);
|
|
1354
|
-
--truncate-marker-background-overlay-color: transparent;
|
|
1355
|
-
--truncate-marker-block-inset: 0px;
|
|
1356
|
-
|
|
1357
|
-
&:hover,
|
|
1358
|
-
&[data-item-context-hover='true'] {
|
|
1359
|
-
background-color: var(--trees-bg-muted);
|
|
1360
|
-
--truncate-marker-background-overlay-color: var(--trees-bg-muted);
|
|
1361
|
-
}
|
|
1362
|
-
|
|
1363
|
-
&[data-item-focused='true'],
|
|
1364
|
-
&:focus-visible {
|
|
1365
|
-
z-index: 2;
|
|
1366
|
-
|
|
1367
|
-
/* Flattened segment markers sit high enough to cover the row outline unless
|
|
1368
|
-
* their painted background is inset by the focus ring width. */
|
|
1369
|
-
[data-item-flattened-subitems] {
|
|
1370
|
-
--truncate-marker-block-inset: var(--trees-focus-ring-width);
|
|
1371
|
-
}
|
|
1372
|
-
|
|
1373
|
-
&::before {
|
|
1374
|
-
position: absolute;
|
|
1375
|
-
inset: 0;
|
|
1376
|
-
content: '';
|
|
1377
|
-
display: block;
|
|
1378
|
-
border-radius: var(--trees-border-radius);
|
|
1379
|
-
outline: var(--trees-focus-ring-width) solid
|
|
1380
|
-
var(--trees-focus-ring-color);
|
|
1381
|
-
outline-offset: var(--trees-focus-ring-offset);
|
|
1382
|
-
pointer-events: none;
|
|
1383
|
-
}
|
|
1384
|
-
|
|
1385
|
-
&[data-item-selected='true']::before {
|
|
1386
|
-
outline-color: var(--trees-selected-focused-border-color);
|
|
1387
|
-
}
|
|
1388
|
-
}
|
|
1389
|
-
|
|
1390
|
-
&[data-item-selected='true'] {
|
|
1391
|
-
color: var(--trees-selected-fg);
|
|
1392
|
-
background-color: var(--trees-selected-bg);
|
|
1393
|
-
--truncate-marker-background-overlay-color: var(--trees-selected-bg);
|
|
1394
|
-
z-index: 3;
|
|
1395
|
-
|
|
1396
|
-
[data-item-section='icon'] {
|
|
1397
|
-
color: var(--trees-selected-fg);
|
|
1398
|
-
}
|
|
1399
|
-
}
|
|
1400
|
-
|
|
1401
|
-
&[data-item-search-match='true'] {
|
|
1402
|
-
font-weight: var(--trees-search-font-weight);
|
|
1403
|
-
}
|
|
1404
|
-
}
|
|
1405
|
-
|
|
1406
|
-
[data-type='item'][data-file-tree-sticky-row='true'] {
|
|
1407
|
-
pointer-events: auto;
|
|
1408
|
-
}
|
|
1409
|
-
|
|
1410
|
-
/* Sticky rows opt back into pointer events because the overlay wrapper is
|
|
1411
|
-
* inert. During scroll, put them back under the same hover suppression as
|
|
1412
|
-
* the virtualized list so translucent hover states and menu triggers do not
|
|
1413
|
-
* paint over rows moving beneath the sticky stack. */
|
|
1414
|
-
[data-file-tree-virtualized-root='true'][data-is-scrolling]
|
|
1415
|
-
[data-type='item'][data-file-tree-sticky-row='true'] {
|
|
1416
|
-
pointer-events: none;
|
|
1417
|
-
}
|
|
1418
|
-
|
|
1419
|
-
[data-file-tree-virtualized-root='true'][data-is-scrolling]
|
|
1420
|
-
[data-type='item'][data-file-tree-sticky-row='true']:hover:not(
|
|
1421
|
-
[data-item-selected='true']
|
|
1422
|
-
),
|
|
1423
|
-
[data-file-tree-virtualized-root='true'][data-is-scrolling]
|
|
1424
|
-
[data-type='item'][data-file-tree-sticky-row='true'][data-item-context-hover='true']:not(
|
|
1425
|
-
[data-item-selected='true']
|
|
1426
|
-
) {
|
|
1427
|
-
background-color: var(--trees-bg);
|
|
1428
|
-
--truncate-marker-background-overlay-color: transparent;
|
|
1429
|
-
}
|
|
1430
|
-
|
|
1431
|
-
[data-item-selected='true']:has(+ [data-item-selected='true']) {
|
|
1432
|
-
border-bottom-left-radius: 0;
|
|
1433
|
-
border-bottom-right-radius: 0;
|
|
1434
|
-
}
|
|
1435
|
-
|
|
1436
|
-
[data-item-selected='true'] + [data-item-selected='true'] {
|
|
1437
|
-
border-top-left-radius: 0;
|
|
1438
|
-
border-top-right-radius: 0;
|
|
1439
|
-
}
|
|
1440
|
-
|
|
1441
|
-
/* Flattened Directory Parts */
|
|
1442
|
-
[data-item-flattened-subitems] {
|
|
1443
|
-
display: inline-flex;
|
|
1444
|
-
align-items: center;
|
|
1445
|
-
gap: 2px;
|
|
1446
|
-
}
|
|
1447
|
-
[data-item-flattened-subitem]:hover,
|
|
1448
|
-
[data-item-flattened-subitem-drag-target='true'] {
|
|
1449
|
-
text-decoration: underline;
|
|
1450
|
-
}
|
|
1451
|
-
|
|
1452
|
-
/* Icon for each item */
|
|
1453
|
-
[data-item-section='icon'] {
|
|
1454
|
-
flex-shrink: 0;
|
|
1455
|
-
display: flex;
|
|
1456
|
-
align-items: center;
|
|
1457
|
-
justify-content: center;
|
|
1458
|
-
color: var(--trees-fg-muted);
|
|
1459
|
-
fill: currentColor;
|
|
1460
|
-
width: var(--trees-icon-width);
|
|
1461
|
-
}
|
|
1462
|
-
|
|
1463
|
-
:where([data-item-section='icon'] > [data-icon-token]) {
|
|
1464
|
-
color: var(--trees-fg-muted);
|
|
1465
|
-
}
|
|
1466
|
-
|
|
1467
|
-
[data-file-tree-colored-icons='true'] {
|
|
1468
|
-
[data-icon-token='astro'] {
|
|
1469
|
-
color: var(--trees-file-icon-color-astro);
|
|
1470
|
-
}
|
|
1471
|
-
[data-icon-token='babel'] {
|
|
1472
|
-
color: var(--trees-file-icon-color-babel);
|
|
1473
|
-
}
|
|
1474
|
-
[data-icon-token='bash'] {
|
|
1475
|
-
color: var(--trees-file-icon-color-bash);
|
|
1476
|
-
}
|
|
1477
|
-
[data-icon-token='biome'] {
|
|
1478
|
-
color: var(--trees-file-icon-color-biome);
|
|
1479
|
-
}
|
|
1480
|
-
[data-icon-token='bootstrap'] {
|
|
1481
|
-
color: var(--trees-file-icon-color-bootstrap);
|
|
1482
|
-
}
|
|
1483
|
-
[data-icon-token='browserslist'] {
|
|
1484
|
-
color: var(--trees-file-icon-color-browserslist);
|
|
1485
|
-
}
|
|
1486
|
-
[data-icon-token='bun'] {
|
|
1487
|
-
color: var(--trees-file-icon-color-bun);
|
|
1488
|
-
}
|
|
1489
|
-
[data-icon-token='c'] {
|
|
1490
|
-
color: var(--trees-file-icon-color-c);
|
|
1491
|
-
}
|
|
1492
|
-
[data-icon-token='cpp'] {
|
|
1493
|
-
color: var(--trees-file-icon-color-cpp);
|
|
1494
|
-
}
|
|
1495
|
-
[data-icon-token='claude'] {
|
|
1496
|
-
color: var(--trees-file-icon-color-claude);
|
|
1497
|
-
}
|
|
1498
|
-
[data-icon-token='css'] {
|
|
1499
|
-
color: var(--trees-file-icon-color-css);
|
|
1500
|
-
}
|
|
1501
|
-
[data-icon-token='database'] {
|
|
1502
|
-
color: var(--trees-file-icon-color-database);
|
|
1503
|
-
}
|
|
1504
|
-
[data-icon-token='default'] {
|
|
1505
|
-
color: var(--trees-file-icon-color-default);
|
|
1506
|
-
}
|
|
1507
|
-
[data-icon-token='docker'] {
|
|
1508
|
-
color: var(--trees-file-icon-color-docker);
|
|
1509
|
-
}
|
|
1510
|
-
[data-icon-token='eslint'] {
|
|
1511
|
-
color: var(--trees-file-icon-color-eslint);
|
|
1512
|
-
}
|
|
1513
|
-
[data-icon-token='git'] {
|
|
1514
|
-
color: var(--trees-file-icon-color-git);
|
|
1515
|
-
}
|
|
1516
|
-
[data-icon-token='go'] {
|
|
1517
|
-
color: var(--trees-file-icon-color-go);
|
|
1518
|
-
}
|
|
1519
|
-
[data-icon-token='graphql'] {
|
|
1520
|
-
color: var(--trees-file-icon-color-graphql);
|
|
1521
|
-
}
|
|
1522
|
-
[data-icon-token='html'] {
|
|
1523
|
-
color: var(--trees-file-icon-color-html);
|
|
1524
|
-
}
|
|
1525
|
-
[data-icon-token='image'] {
|
|
1526
|
-
color: var(--trees-file-icon-color-image);
|
|
1527
|
-
}
|
|
1528
|
-
[data-icon-token='javascript'] {
|
|
1529
|
-
color: var(--trees-file-icon-color-javascript);
|
|
1530
|
-
}
|
|
1531
|
-
[data-icon-token='json'] {
|
|
1532
|
-
color: var(--trees-file-icon-color-json);
|
|
1533
|
-
}
|
|
1534
|
-
[data-icon-token='markdown'] {
|
|
1535
|
-
color: var(--trees-file-icon-color-markdown);
|
|
1536
|
-
}
|
|
1537
|
-
[data-icon-token='mcp'] {
|
|
1538
|
-
color: var(--trees-file-icon-color-mcp);
|
|
1539
|
-
}
|
|
1540
|
-
[data-icon-token='npm'] {
|
|
1541
|
-
color: var(--trees-file-icon-color-npm);
|
|
1542
|
-
}
|
|
1543
|
-
[data-icon-token='oxc'] {
|
|
1544
|
-
color: var(--trees-file-icon-color-oxc);
|
|
1545
|
-
}
|
|
1546
|
-
[data-icon-token='postcss'] {
|
|
1547
|
-
color: var(--trees-file-icon-color-postcss);
|
|
1548
|
-
}
|
|
1549
|
-
[data-icon-token='prettier'] {
|
|
1550
|
-
color: var(--trees-file-icon-color-prettier);
|
|
1551
|
-
}
|
|
1552
|
-
[data-icon-token='python'] {
|
|
1553
|
-
color: var(--trees-file-icon-color-python);
|
|
1554
|
-
}
|
|
1555
|
-
[data-icon-token='react'] {
|
|
1556
|
-
color: var(--trees-file-icon-color-react);
|
|
1557
|
-
}
|
|
1558
|
-
[data-icon-token='ruby'] {
|
|
1559
|
-
color: var(--trees-file-icon-color-ruby);
|
|
1560
|
-
}
|
|
1561
|
-
[data-icon-token='rust'] {
|
|
1562
|
-
color: var(--trees-file-icon-color-rust);
|
|
1563
|
-
}
|
|
1564
|
-
[data-icon-token='sass'] {
|
|
1565
|
-
color: var(--trees-file-icon-color-sass);
|
|
1566
|
-
}
|
|
1567
|
-
[data-icon-token='svg'] {
|
|
1568
|
-
color: var(--trees-file-icon-color-svg);
|
|
1569
|
-
}
|
|
1570
|
-
[data-icon-token='svelte'] {
|
|
1571
|
-
color: var(--trees-file-icon-color-svelte);
|
|
1572
|
-
}
|
|
1573
|
-
[data-icon-token='svgo'] {
|
|
1574
|
-
color: var(--trees-file-icon-color-svgo);
|
|
1575
|
-
}
|
|
1576
|
-
[data-icon-token='swift'] {
|
|
1577
|
-
color: var(--trees-file-icon-color-swift);
|
|
1578
|
-
}
|
|
1579
|
-
[data-icon-token='table'] {
|
|
1580
|
-
color: var(--trees-file-icon-color-table);
|
|
1581
|
-
}
|
|
1582
|
-
[data-icon-token='text'] {
|
|
1583
|
-
color: var(--trees-file-icon-color-text);
|
|
1584
|
-
}
|
|
1585
|
-
[data-icon-token='tailwind'] {
|
|
1586
|
-
color: var(--trees-file-icon-color-tailwind);
|
|
1587
|
-
}
|
|
1588
|
-
[data-icon-token='terraform'] {
|
|
1589
|
-
color: var(--trees-file-icon-color-terraform);
|
|
1590
|
-
}
|
|
1591
|
-
[data-icon-token='typescript'] {
|
|
1592
|
-
color: var(--trees-file-icon-color-typescript);
|
|
1593
|
-
}
|
|
1594
|
-
[data-icon-token='vite'] {
|
|
1595
|
-
color: var(--trees-file-icon-color-vite);
|
|
1596
|
-
}
|
|
1597
|
-
[data-icon-token='vscode'] {
|
|
1598
|
-
color: var(--trees-file-icon-color-vscode);
|
|
1599
|
-
}
|
|
1600
|
-
[data-icon-token='vue'] {
|
|
1601
|
-
color: var(--trees-file-icon-color-vue);
|
|
1602
|
-
}
|
|
1603
|
-
[data-icon-token='wasm'] {
|
|
1604
|
-
color: var(--trees-file-icon-color-wasm);
|
|
1605
|
-
}
|
|
1606
|
-
[data-icon-token='webpack'] {
|
|
1607
|
-
color: var(--trees-file-icon-color-webpack);
|
|
1608
|
-
}
|
|
1609
|
-
[data-icon-token='yml'] {
|
|
1610
|
-
color: var(--trees-file-icon-color-yml);
|
|
1611
|
-
}
|
|
1612
|
-
[data-icon-token='zig'] {
|
|
1613
|
-
color: var(--trees-file-icon-color-zig);
|
|
1614
|
-
}
|
|
1615
|
-
[data-icon-token='zip'] {
|
|
1616
|
-
color: var(--trees-file-icon-color-zip);
|
|
1617
|
-
}
|
|
1618
|
-
}
|
|
1619
|
-
|
|
1620
|
-
/* Chevron rotation and visual alignment */
|
|
1621
|
-
/* Chevron pointing down */
|
|
1622
|
-
[data-icon-name='file-tree-icon-chevron'] {
|
|
1623
|
-
&[data-align-capitals='false'] {
|
|
1624
|
-
transform: translate(0, var(--trees-icon-nudge));
|
|
1625
|
-
}
|
|
1626
|
-
&[data-align-capitals='true'] {
|
|
1627
|
-
transform: translate(0, 0);
|
|
1628
|
-
}
|
|
1629
|
-
}
|
|
1630
|
-
|
|
1631
|
-
[data-item-section='content'] {
|
|
1632
|
-
flex: 0 1 auto;
|
|
1633
|
-
text-align: start;
|
|
1634
|
-
min-width: 0;
|
|
1635
|
-
max-width: 100%;
|
|
1636
|
-
overflow: hidden;
|
|
1637
|
-
text-overflow: ellipsis;
|
|
1638
|
-
/* Breaks middle truncate component to also set this */
|
|
1639
|
-
/* white-space: nowrap; */
|
|
1640
|
-
}
|
|
1641
|
-
|
|
1642
|
-
[data-item-section='decoration'] {
|
|
1643
|
-
flex: 1 1 0;
|
|
1644
|
-
min-width: 0;
|
|
1645
|
-
display: flex;
|
|
1646
|
-
justify-content: flex-end;
|
|
1647
|
-
text-align: end;
|
|
1648
|
-
overflow: hidden;
|
|
1649
|
-
color: var(--trees-fg-muted);
|
|
1650
|
-
}
|
|
1651
|
-
|
|
1652
|
-
[data-item-section='decoration'] > span {
|
|
1653
|
-
min-width: 0;
|
|
1654
|
-
max-width: 100%;
|
|
1655
|
-
display: inline-flex;
|
|
1656
|
-
align-items: center;
|
|
1657
|
-
justify-content: flex-end;
|
|
1658
|
-
overflow: hidden;
|
|
1659
|
-
text-overflow: ellipsis;
|
|
1660
|
-
white-space: nowrap;
|
|
1661
|
-
}
|
|
1662
|
-
|
|
1663
|
-
[data-item-section='git'],
|
|
1664
|
-
[data-item-section='action'] {
|
|
1665
|
-
flex: 0 0 auto;
|
|
1666
|
-
display: flex;
|
|
1667
|
-
align-items: center;
|
|
1668
|
-
justify-content: center;
|
|
1669
|
-
}
|
|
1670
|
-
|
|
1671
|
-
[data-item-section='git'] {
|
|
1672
|
-
width: var(--trees-git-lane-width);
|
|
1673
|
-
}
|
|
1674
|
-
|
|
1675
|
-
[data-item-section='action'] {
|
|
1676
|
-
width: var(--trees-action-lane-width);
|
|
1677
|
-
color: var(--trees-fg-muted);
|
|
1678
|
-
fill: currentColor;
|
|
1679
|
-
pointer-events: none;
|
|
1680
|
-
}
|
|
1681
|
-
|
|
1682
|
-
[data-item-section='git'] > span,
|
|
1683
|
-
[data-item-section='action'] > span {
|
|
1684
|
-
width: 100%;
|
|
1685
|
-
display: inline-flex;
|
|
1686
|
-
align-items: center;
|
|
1687
|
-
justify-content: center;
|
|
1688
|
-
}
|
|
1689
|
-
|
|
1690
|
-
[data-item-action-affordance='decorative'] {
|
|
1691
|
-
opacity: 0.85;
|
|
1692
|
-
}
|
|
1693
|
-
|
|
1694
|
-
[data-item-rename-input] {
|
|
1695
|
-
appearance: none;
|
|
1696
|
-
width: 100%;
|
|
1697
|
-
min-width: 0;
|
|
1698
|
-
height: calc(var(--trees-row-height) - 4px);
|
|
1699
|
-
font-family: inherit;
|
|
1700
|
-
font-size: inherit;
|
|
1701
|
-
/* line-height: calc(var(--trees-row-height) - 8px); */
|
|
1702
|
-
color: inherit;
|
|
1703
|
-
background-color: transparent;
|
|
1704
|
-
border: 0;
|
|
1705
|
-
padding-inline: 6px;
|
|
1706
|
-
outline: none;
|
|
1707
|
-
box-sizing: border-box;
|
|
1708
|
-
}
|
|
1709
|
-
|
|
1710
|
-
[data-item-section='content']:has([data-item-rename-input])
|
|
1711
|
-
~ [data-item-section='action'],
|
|
1712
|
-
[data-item-section='content']:has([data-item-rename-input])
|
|
1713
|
-
~ [data-item-section='decoration'] {
|
|
1714
|
-
display: none;
|
|
1715
|
-
}
|
|
1716
|
-
|
|
1717
|
-
/* Chevron pointing right */
|
|
1718
|
-
[aria-expanded='false'][data-item-type='folder']
|
|
1719
|
-
> [data-item-section='icon']
|
|
1720
|
-
> [data-icon-name='file-tree-icon-chevron'] {
|
|
1721
|
-
&[data-align-capitals='true'] {
|
|
1722
|
-
transform: rotate(-90deg)
|
|
1723
|
-
translate(
|
|
1724
|
-
calc(var(--trees-icon-nudge) / 2),
|
|
1725
|
-
calc(var(--trees-icon-nudge) / 2)
|
|
1726
|
-
);
|
|
1727
|
-
}
|
|
1728
|
-
&[data-align-capitals='false'] {
|
|
1729
|
-
transform: rotate(-90deg)
|
|
1730
|
-
translate(
|
|
1731
|
-
calc(var(--trees-icon-nudge) / 2 * -1),
|
|
1732
|
-
calc(var(--trees-icon-nudge) / 2)
|
|
1733
|
-
);
|
|
1734
|
-
}
|
|
1735
|
-
}
|
|
1736
|
-
|
|
1737
|
-
/* LIST IDENTATION */
|
|
1738
|
-
/* Spacing container */
|
|
1739
|
-
[data-item-section='spacing'] {
|
|
1740
|
-
display: flex;
|
|
1741
|
-
flex-direction: row;
|
|
1742
|
-
align-items: center;
|
|
1743
|
-
justify-content: center;
|
|
1744
|
-
height: var(--trees-row-height);
|
|
1745
|
-
padding-left: calc(calc(var(--trees-icon-width) / 2) - 0.5px);
|
|
1746
|
-
|
|
1747
|
-
&:empty {
|
|
1748
|
-
padding-left: 0;
|
|
1749
|
-
}
|
|
1750
|
-
}
|
|
1751
|
-
|
|
1752
|
-
/* Spacing per level */
|
|
1753
|
-
[data-item-section='spacing-item'] {
|
|
1754
|
-
transform: translateX(-0.25px);
|
|
1755
|
-
display: inline-block;
|
|
1756
|
-
border-left: 1px solid var(--trees-indent-guide-bg);
|
|
1757
|
-
height: 100%;
|
|
1758
|
-
margin-right: calc(var(--trees-level-gap) - 1px);
|
|
1759
|
-
opacity: 0;
|
|
1760
|
-
transition: opacity 150ms ease;
|
|
1761
|
-
|
|
1762
|
-
& + & {
|
|
1763
|
-
margin-left: calc(
|
|
1764
|
-
var(--trees-item-row-gap) + calc(var(--trees-icon-width) / 2) - 0.5px
|
|
1765
|
-
);
|
|
1766
|
-
}
|
|
1767
|
-
}
|
|
1768
|
-
|
|
1769
|
-
:host(:hover) [data-item-section='spacing-item'] {
|
|
1770
|
-
opacity: 0.75;
|
|
1771
|
-
}
|
|
1772
|
-
|
|
1773
|
-
/* Git status indicator */
|
|
1774
|
-
|
|
1775
|
-
/* This is a folder that contains a git change */
|
|
1776
|
-
[data-item-contains-git-change='true'] > [data-item-section='git'] {
|
|
1777
|
-
color: var(--trees-git-modified-color);
|
|
1778
|
-
opacity: 0.5;
|
|
1779
|
-
fill: currentColor;
|
|
1780
|
-
}
|
|
1781
|
-
|
|
1782
|
-
/* These are files that have a git change */
|
|
1783
|
-
[data-item-git-status] {
|
|
1784
|
-
&
|
|
1785
|
-
> :where([data-item-section='icon'])
|
|
1786
|
-
> :where(:not([data-icon-name='file-tree-icon-chevron'])) {
|
|
1787
|
-
color: var(--trees-item-git-status-color);
|
|
1788
|
-
}
|
|
1789
|
-
& > [data-item-section='content'] {
|
|
1790
|
-
color: var(--trees-item-git-status-color);
|
|
1791
|
-
}
|
|
1792
|
-
& > [data-item-section='git'] {
|
|
1793
|
-
color: var(--trees-item-git-status-color);
|
|
1794
|
-
font-weight: var(--trees-font-weight-semibold);
|
|
1795
|
-
}
|
|
1796
|
-
}
|
|
1797
|
-
|
|
1798
|
-
[data-item-git-status='added'] {
|
|
1799
|
-
--trees-item-git-status-color: var(--trees-git-added-color);
|
|
1800
|
-
}
|
|
1801
|
-
|
|
1802
|
-
[data-item-git-status='deleted'] {
|
|
1803
|
-
--trees-item-git-status-color: var(--trees-git-deleted-color);
|
|
1804
|
-
}
|
|
1805
|
-
|
|
1806
|
-
[data-item-git-status='ignored'] {
|
|
1807
|
-
--trees-item-git-status-color: var(--trees-git-ignored-color);
|
|
1808
|
-
|
|
1809
|
-
& > [data-item-section='icon'] {
|
|
1810
|
-
opacity: 0.5;
|
|
1811
|
-
}
|
|
1812
|
-
}
|
|
1813
|
-
|
|
1814
|
-
[data-item-section='git'] [data-icon-name='file-tree-icon-dot'] {
|
|
1815
|
-
/* this is a nudge to align the dot with the likely lowercase text. it's slightly
|
|
1816
|
-
generalizable, but other fonts are gonna need other nudges i assume */
|
|
1817
|
-
transform: translateY(calc(0.65ex - 50%));
|
|
1818
|
-
}
|
|
1819
|
-
|
|
1820
|
-
[data-item-git-status='modified'] {
|
|
1821
|
-
--trees-item-git-status-color: var(--trees-git-modified-color);
|
|
1822
|
-
}
|
|
1823
|
-
|
|
1824
|
-
[data-item-git-status='renamed'] {
|
|
1825
|
-
--trees-item-git-status-color: var(--trees-git-renamed-color);
|
|
1826
|
-
}
|
|
1827
|
-
|
|
1828
|
-
[data-item-git-status='untracked'] {
|
|
1829
|
-
--trees-item-git-status-color: var(--trees-git-untracked-color);
|
|
1830
|
-
}
|
|
1831
|
-
|
|
1832
|
-
/* Drag and drop */
|
|
1833
|
-
[data-item-drag-target='true'] {
|
|
1834
|
-
background-color: var(--trees-selected-bg);
|
|
1835
|
-
}
|
|
1836
|
-
|
|
1837
|
-
[data-item-dragging='true'] {
|
|
1838
|
-
opacity: 0.5;
|
|
1839
|
-
}
|
|
1840
|
-
|
|
1841
|
-
/* Lock icon for locked paths (sibling of content) */
|
|
1842
|
-
[data-item-section='lock'] {
|
|
1843
|
-
flex: 0 0 auto;
|
|
1844
|
-
margin-left: auto;
|
|
1845
|
-
display: flex;
|
|
1846
|
-
align-items: center;
|
|
1847
|
-
color: var(--trees-fg-muted);
|
|
1848
|
-
}
|
|
1849
|
-
[data-item-section='lock'] svg {
|
|
1850
|
-
display: block;
|
|
1851
|
-
}
|
|
1852
|
-
|
|
1853
|
-
[data-type='header-slot'] {
|
|
1854
|
-
display: block;
|
|
1855
|
-
flex: 0 0 auto;
|
|
1856
|
-
}
|
|
1857
|
-
|
|
1858
|
-
[data-type='context-menu-wash'] {
|
|
1859
|
-
position: absolute;
|
|
1860
|
-
inset: 0;
|
|
1861
|
-
z-index: 3;
|
|
1862
|
-
background-color: transparent;
|
|
1863
|
-
touch-action: none;
|
|
1864
|
-
}
|
|
1865
|
-
|
|
1866
|
-
[data-type='context-menu-anchor'] {
|
|
1867
|
-
position: absolute;
|
|
1868
|
-
top: 0;
|
|
1869
|
-
right: var(--trees-context-menu-trigger-inline-offset);
|
|
1870
|
-
z-index: 4;
|
|
1871
|
-
display: none;
|
|
1872
|
-
align-items: center;
|
|
1873
|
-
|
|
1874
|
-
&[data-visible='true'] {
|
|
1875
|
-
display: flex;
|
|
1876
|
-
}
|
|
1877
|
-
}
|
|
1878
|
-
|
|
1879
|
-
/* Hide the floating trigger while the scroll container is actively moving.
|
|
1880
|
-
* The anchor is positioned against the root, not the scroll content, so its
|
|
1881
|
-
* \`top\` follows the row via a React state update — one frame behind the
|
|
1882
|
-
* compositor. That delay is visible as the trigger hovering over the wrong
|
|
1883
|
-
* row during the first frame of a scroll. The \`data-is-scrolling\` flag on
|
|
1884
|
-
* the root is flipped synchronously on \`wheel\`/\`touchmove\`/\`keydown\` before
|
|
1885
|
-
* the compositor commits the next paint, so this selector hides the anchor
|
|
1886
|
-
* in the same frame the scroll begins. */
|
|
1887
|
-
[data-file-tree-virtualized-root='true'][data-is-scrolling]
|
|
1888
|
-
[data-type='context-menu-anchor'] {
|
|
1889
|
-
display: none;
|
|
1890
|
-
}
|
|
1891
|
-
|
|
1892
|
-
[data-type='context-menu-anchor'] > slot[name='context-menu'] {
|
|
1893
|
-
display: block;
|
|
1894
|
-
width: 0;
|
|
1895
|
-
min-width: 0;
|
|
1896
|
-
flex: 0 0 0;
|
|
1897
|
-
overflow: visible;
|
|
1898
|
-
}
|
|
1899
|
-
|
|
1900
|
-
/* Single floating context menu trigger */
|
|
1901
|
-
[data-type='context-menu-trigger'] {
|
|
1902
|
-
all: unset;
|
|
1903
|
-
align-items: center;
|
|
1904
|
-
justify-content: center;
|
|
1905
|
-
width: var(--trees-action-lane-width);
|
|
1906
|
-
color: var(--trees-fg-muted);
|
|
1907
|
-
fill: currentColor;
|
|
1908
|
-
cursor: pointer;
|
|
1909
|
-
font-family: var(--trees-font-family);
|
|
1910
|
-
font-size: var(--trees-font-size);
|
|
1911
|
-
border-top-right-radius: var(--trees-border-radius);
|
|
1912
|
-
border-bottom-right-radius: var(--trees-border-radius);
|
|
1913
|
-
margin: var(--trees-focus-ring-width);
|
|
1914
|
-
height: calc(var(--trees-row-height) - var(--trees-focus-ring-width) * 2);
|
|
1915
|
-
border-width: 0;
|
|
1916
|
-
transition: color 120ms ease;
|
|
1917
|
-
|
|
1918
|
-
display: flex;
|
|
1919
|
-
}
|
|
1920
|
-
|
|
1921
|
-
[data-type='context-menu-trigger']:hover,
|
|
1922
|
-
[data-type='context-menu-trigger'][aria-expanded='true'] {
|
|
1923
|
-
color: var(--trees-fg);
|
|
1924
|
-
}
|
|
1925
|
-
|
|
1926
|
-
/** @pierre/truncate css here, manually copy pasted for now */
|
|
1927
|
-
[data-truncate-container] {
|
|
1928
|
-
/* CUSTOM TO TREES, TO SUPPORT THE OUTLINE */
|
|
1929
|
-
margin-top: -1px;
|
|
1930
|
-
margin-bottom: -1px;
|
|
1931
|
-
|
|
1932
|
-
/* Width of the fade from default marker to text */
|
|
1933
|
-
--truncate-internal-marker-fade-width: var(
|
|
1934
|
-
--truncate-marker-fade-width,
|
|
1935
|
-
2px
|
|
1936
|
-
);
|
|
1937
|
-
/* Width of the solid color between the fade from the default marker to the text */
|
|
1938
|
-
--truncate-internal-marker-gap: var(--truncate-marker-gap, 0px);
|
|
1939
|
-
/* Opacity of the marker 'color' property, not of the element itself */
|
|
1940
|
-
--truncate-internal-marker-opacity: var(--truncate-marker-opacity, 50%);
|
|
1941
|
-
/* Opacity of the marker 'color' property specifically for the middle truncate, not opacity of the element itself */
|
|
1942
|
-
--truncate-internal-middle-marker-opacity: var(
|
|
1943
|
-
--truncate-middle-marker-opacity,
|
|
1944
|
-
80%
|
|
1945
|
-
);
|
|
1946
|
-
/* Background color of the default marker */
|
|
1947
|
-
--truncate-internal-marker-background-color: var(
|
|
1948
|
-
--truncate-marker-background-color,
|
|
1949
|
-
light-dark(white, black)
|
|
1950
|
-
);
|
|
1951
|
-
--truncate-internal-marker-background-overlay-color: var(
|
|
1952
|
-
--truncate-marker-background-overlay-color,
|
|
1953
|
-
transparent
|
|
1954
|
-
);
|
|
1955
|
-
--truncate-internal-marker-block-inset: var(
|
|
1956
|
-
--truncate-marker-block-inset,
|
|
1957
|
-
0px
|
|
1958
|
-
);
|
|
1959
|
-
/* Duration of the fade out animation for the marker */
|
|
1960
|
-
--truncate-internal-marker-fade-out-duration: var(
|
|
1961
|
-
--truncate-marker-fade-out-duration,
|
|
1962
|
-
0ms
|
|
1963
|
-
);
|
|
1964
|
-
/* Duration of the fade in animation for the marker */
|
|
1965
|
-
--truncate-internal-marker-fade-in-duration: var(
|
|
1966
|
-
--truncate-marker-fade-in-duration,
|
|
1967
|
-
100ms
|
|
1968
|
-
);
|
|
1969
|
-
|
|
1970
|
-
/* FADE Variant specifics */
|
|
1971
|
-
--truncate-internal-fade-marker-color: var(
|
|
1972
|
-
--truncate-fade-marker-color,
|
|
1973
|
-
#000
|
|
1974
|
-
);
|
|
1975
|
-
--truncate-internal-fade-marker-width: var(
|
|
1976
|
-
--truncate-fade-marker-width,
|
|
1977
|
-
0.2lh
|
|
1978
|
-
);
|
|
1979
|
-
|
|
1980
|
-
/*
|
|
1981
|
-
In some special cases people might be adding spacing in other ways
|
|
1982
|
-
that would benefit from being able to override this, however the container
|
|
1983
|
-
query below can't use this and would need to be redeclared with the overridden
|
|
1984
|
-
value. It's a bad time, but better than nothing.
|
|
1985
|
-
*/
|
|
1986
|
-
--truncate-internal-single-line-height: 1lh;
|
|
1987
|
-
|
|
1988
|
-
height: var(--truncate-internal-single-line-height);
|
|
1989
|
-
min-width: 0;
|
|
1990
|
-
overflow: hidden;
|
|
1991
|
-
}
|
|
1992
|
-
|
|
1993
|
-
[data-truncate-marker] {
|
|
1994
|
-
display: flex;
|
|
1995
|
-
position: absolute;
|
|
1996
|
-
height: var(--truncate-internal-single-line-height);
|
|
1997
|
-
padding-block: var(--truncate-internal-marker-block-inset);
|
|
1998
|
-
box-sizing: border-box;
|
|
1999
|
-
align-items: center;
|
|
2000
|
-
background-clip: content-box;
|
|
2001
|
-
z-index: 2;
|
|
2002
|
-
color: color-mix(
|
|
2003
|
-
in srgb,
|
|
2004
|
-
currentColor var(--truncate-internal-marker-opacity),
|
|
2005
|
-
transparent
|
|
2006
|
-
);
|
|
2007
|
-
|
|
2008
|
-
/* Core trick for hiding the marker until overflow occurs */
|
|
2009
|
-
opacity: 0;
|
|
2010
|
-
transition: opacity var(--truncate-internal-marker-fade-out-duration)
|
|
2011
|
-
ease-in-out;
|
|
2012
|
-
}
|
|
2013
|
-
|
|
2014
|
-
@container measure (height > 1lh) {
|
|
2015
|
-
[data-truncate-marker] {
|
|
2016
|
-
opacity: 1;
|
|
2017
|
-
transition: opacity var(--truncate-internal-marker-fade-in-duration)
|
|
2018
|
-
ease-in-out;
|
|
2019
|
-
}
|
|
2020
|
-
}
|
|
2021
|
-
|
|
2022
|
-
[data-truncate-grid] {
|
|
2023
|
-
display: grid;
|
|
2024
|
-
position: relative;
|
|
2025
|
-
}
|
|
2026
|
-
|
|
2027
|
-
[data-truncate-content='visible'] {
|
|
2028
|
-
white-space: nowrap;
|
|
2029
|
-
}
|
|
2030
|
-
|
|
2031
|
-
[data-truncate-content='overflow'] {
|
|
2032
|
-
opacity: 0;
|
|
2033
|
-
pointer-events: none;
|
|
2034
|
-
-webkit-user-select: none;
|
|
2035
|
-
user-select: none;
|
|
2036
|
-
word-break: break-all;
|
|
2037
|
-
margin-top: calc(-1 * var(--truncate-internal-single-line-height));
|
|
2038
|
-
}
|
|
2039
|
-
|
|
2040
|
-
[data-truncate-marker-cell] {
|
|
2041
|
-
container: measure / size;
|
|
2042
|
-
overflow: visible;
|
|
2043
|
-
-webkit-user-select: none;
|
|
2044
|
-
user-select: none;
|
|
2045
|
-
pointer-events: none;
|
|
2046
|
-
}
|
|
2047
|
-
|
|
2048
|
-
[data-truncate-container='truncate'] {
|
|
2049
|
-
& [data-truncate-grid] {
|
|
2050
|
-
grid-template-columns: minmax(0, max-content) 0;
|
|
2051
|
-
}
|
|
2052
|
-
& [data-truncate-marker] {
|
|
2053
|
-
right: 0;
|
|
2054
|
-
}
|
|
2055
|
-
& [data-truncate-fade] {
|
|
2056
|
-
margin-right: calc(-2 * var(--truncate-internal-fade-marker-width));
|
|
2057
|
-
}
|
|
2058
|
-
}
|
|
2059
|
-
|
|
2060
|
-
[data-truncate-container='fruncate'] {
|
|
2061
|
-
& [data-truncate-grid] {
|
|
2062
|
-
grid-template-columns: 0 minmax(0, max-content) auto;
|
|
2063
|
-
}
|
|
2064
|
-
& [data-truncate-content] {
|
|
2065
|
-
direction: rtl;
|
|
2066
|
-
}
|
|
2067
|
-
& [data-truncate-content] > span {
|
|
2068
|
-
unicode-bidi: plaintext;
|
|
2069
|
-
}
|
|
2070
|
-
& [data-truncate-fade] {
|
|
2071
|
-
margin-left: calc(-2 * var(--truncate-internal-fade-marker-width));
|
|
2072
|
-
}
|
|
2073
|
-
}
|
|
2074
|
-
|
|
2075
|
-
[data-truncate-variant='default'] {
|
|
2076
|
-
& [data-truncate-marker] {
|
|
2077
|
-
background-color: var(--truncate-internal-marker-background-color);
|
|
2078
|
-
background-image: linear-gradient(
|
|
2079
|
-
var(--truncate-internal-marker-background-overlay-color),
|
|
2080
|
-
var(--truncate-internal-marker-background-overlay-color)
|
|
2081
|
-
);
|
|
2082
|
-
}
|
|
2083
|
-
& [data-truncate-marker]::after,
|
|
2084
|
-
& [data-truncate-marker]::before {
|
|
2085
|
-
content: '';
|
|
2086
|
-
position: absolute;
|
|
2087
|
-
width: calc(
|
|
2088
|
-
var(--truncate-internal-marker-fade-width) +
|
|
2089
|
-
var(--truncate-internal-marker-gap)
|
|
2090
|
-
);
|
|
2091
|
-
inset-block-start: var(--truncate-internal-marker-block-inset);
|
|
2092
|
-
height: max(
|
|
2093
|
-
0px,
|
|
2094
|
-
calc(
|
|
2095
|
-
var(--truncate-internal-single-line-height) -
|
|
2096
|
-
var(--truncate-internal-marker-block-inset) * 2
|
|
2097
|
-
)
|
|
2098
|
-
);
|
|
2099
|
-
background-color: var(--truncate-internal-marker-background-color);
|
|
2100
|
-
background-image: linear-gradient(
|
|
2101
|
-
var(--truncate-internal-marker-background-overlay-color),
|
|
2102
|
-
var(--truncate-internal-marker-background-overlay-color)
|
|
2103
|
-
);
|
|
2104
|
-
mask-image: linear-gradient(
|
|
2105
|
-
var(--truncate-internal-fade-dir),
|
|
2106
|
-
#000 0%,
|
|
2107
|
-
#000 var(--truncate-internal-marker-gap),
|
|
2108
|
-
transparent 100%
|
|
2109
|
-
);
|
|
2110
|
-
}
|
|
2111
|
-
& [data-truncate-marker]::after {
|
|
2112
|
-
--truncate-internal-fade-dir: to right;
|
|
2113
|
-
right: calc(
|
|
2114
|
-
-1 *
|
|
2115
|
-
(
|
|
2116
|
-
var(--truncate-internal-marker-fade-width) +
|
|
2117
|
-
var(--truncate-internal-marker-gap)
|
|
2118
|
-
)
|
|
2119
|
-
);
|
|
2120
|
-
}
|
|
2121
|
-
& [data-truncate-marker]::before {
|
|
2122
|
-
--truncate-internal-fade-dir: to left;
|
|
2123
|
-
left: calc(
|
|
2124
|
-
-1 *
|
|
2125
|
-
(
|
|
2126
|
-
var(--truncate-internal-marker-fade-width) +
|
|
2127
|
-
var(--truncate-internal-marker-gap)
|
|
2128
|
-
)
|
|
2129
|
-
);
|
|
2130
|
-
}
|
|
2131
|
-
}
|
|
2132
|
-
|
|
2133
|
-
[data-truncate-variant='fade'] {
|
|
2134
|
-
& [data-truncate-marker] {
|
|
2135
|
-
background: transparent;
|
|
2136
|
-
}
|
|
2137
|
-
}
|
|
2138
|
-
|
|
2139
|
-
[data-truncate-fade] {
|
|
2140
|
-
box-shadow:
|
|
2141
|
-
0 0 calc(var(--truncate-internal-fade-marker-width) / 2)
|
|
2142
|
-
var(--truncate-internal-fade-marker-color),
|
|
2143
|
-
0 0 var(--truncate-internal-fade-marker-width)
|
|
2144
|
-
var(--truncate-internal-fade-marker-color);
|
|
2145
|
-
width: calc(var(--truncate-internal-fade-marker-width) * 2);
|
|
2146
|
-
height: calc(
|
|
2147
|
-
var(--truncate-internal-single-line-height) -
|
|
2148
|
-
(var(--truncate-internal-fade-marker-width) * 2)
|
|
2149
|
-
);
|
|
2150
|
-
margin: var(--truncate-internal-fade-marker-width) 0;
|
|
2151
|
-
}
|
|
2152
|
-
|
|
2153
|
-
[data-truncate-group-container='middle'] {
|
|
2154
|
-
& [data-truncate-container] {
|
|
2155
|
-
--truncate-marker-opacity: var(--truncate-internal-middle-marker-opacity);
|
|
2156
|
-
}
|
|
2157
|
-
|
|
2158
|
-
display: flex;
|
|
2159
|
-
min-width: 0;
|
|
2160
|
-
|
|
2161
|
-
& > div {
|
|
2162
|
-
min-width: 0;
|
|
2163
|
-
}
|
|
2164
|
-
|
|
2165
|
-
& > div[data-truncate-segment-priority='1'] {
|
|
2166
|
-
flex: 0 1 max-content;
|
|
2167
|
-
}
|
|
2168
|
-
& > div[data-truncate-segment-priority='2'] {
|
|
2169
|
-
flex: 0 999999 max-content;
|
|
2170
|
-
}
|
|
2171
|
-
}
|
|
2172
|
-
}
|
|
2173
|
-
`,Ga=`@layer base, unsafe;`;function Ka(e){return`${Ga}
|
|
2174
|
-
@layer base {
|
|
2175
|
-
${e}
|
|
2176
|
-
}`}function qa(e){return`${Ga}
|
|
2177
|
-
@layer unsafe {
|
|
2178
|
-
${e}
|
|
2179
|
-
}`}var Ja=new WeakMap;function Ya(e){let t=Ja.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(ka,`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(),Ja.set(e,i),i}function Xa(e,t){if(!e.isConnected)return;let n=Ya(t);if(n==null)return;let r=t.querySelector(`style[${Aa}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(Aa,``),t.appendChild(i)),i.textContent=`:host { ${ja}: ${n}px; }`}var Za;function Qa(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){Za??(Za=new CSSStyleSheet,Za.replaceSync(Ka(Wa)));let t=!1;try{e.adoptedStyleSheets=[Za],t=!0}catch{}if(t){e.querySelector(`style[${Da}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(Da,``),t.textContent=Ka(Wa),e.prepend(t)}}function $a(e,t){eo(e,t),Qa(t),Xa(e,t)}function eo(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`});$a(this,e)}}if(customElements.define(Ea,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(Ea)))e instanceof HTMLElement&&$a(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var to=5,no=1<<to,ro=no*4;function io(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function ao(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function oo(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 so(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 co(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function lo(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 uo(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,ho(e,t)}function fo(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=so(e).get(t);if(i===void 0)return;let a=i>>to;e.childVisibleChunkSums[a]+=r}function po(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=go(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=no}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 mo(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>to;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<to}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 ho(e,t){if(t.childIds.length<ro){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/no),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>>to]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function go(e,t,n,r){let i=Math.min(t.childIds.length,n+no),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 _o=7,vo=3,yo=1<<vo,bo=4;function xo(e,t,n=0){return e<<bo|n<<vo|t}function So(e){return e.depthAndFlags>>>bo}function Co(e){return(e.depthAndFlags&yo)>>vo}function K(e){return(e.depthAndFlags&yo)!==0}function wo(e){return e.depthAndFlags&_o}function To(e,t){return(wo(e)&t)!==0}function Eo(e,t){e.depthAndFlags|=t}function Do(e,t){e.depthAndFlags=xo(t,wo(e),Co(e))}var Oo=Symbol(`benchmarkInstrumentation`);function ko(e,t){return t==null||Object.defineProperty(e,Oo,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function Ao(e){return e==null?null:e[Oo]??null}function q(e,t,n){return e==null?n():e.measurePhase(t,n)}function jo(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function Mo(e){return e>=48&&e<=57}function No(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!Mo(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&&Mo(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 Po(e){let t=e.toLowerCase();return{lowerValue:t,tokens:No(t)}}function Fo(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 Io(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=Fo(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function Lo(e,t,n){let r=Io(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function Ro(e,t){return Lo(e,t,Po)}function zo(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function Bo(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=zo(e,r);return a===zo(t,r)?Ro(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 Vo(e,t){return Bo(e,t)}function Ho(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=Po(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=zo(e,n);return o===zo(t,n)?Lo(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 Uo(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=Po(r);return e.sortKeyById[t]=i,i}function Wo(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function Go(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 Ko(e){let{hasTrailingSlash:t,segments:n}=Go(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function qo(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=Go(e);return{requiresDirectory:t,segments:n}}var Jo=``;function Yo(){let e=new Map;return e.set(Jo,0),{idByValue:e,valueById:[Jo],sortKeyById:[Po(Jo)]}}function Xo(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 Zo(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var Qo=Symbol(`pathStorePreparedInputKind`);function $o(e,t){return e[Qo]=t,e}function es(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function ts(e,t,n){return n==="default"?Vo(e,t):n(es(e),es(t))}function ns(){return{depthAndFlags:xo(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function rs(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 is(e){return e.isDirectory?e.segments.length:e.segments.length-1}function as(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 os(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function ss(e,t={}){return ps(e,t).map(e=>e.path)}function cs(e,t={}){let n=ps(e,t);return $o({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function ls(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 $o({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function us(e){let t=e,n=t.preparedPaths;if(t[Qo]===`prepared`&&n!=null)return n;if(!as(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function ds(e){let t=e;return t[Qo]===`presorted`&&t.presortedPaths!=null||os(t.presortedPaths)?t.presortedPaths:null}function fs(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function ps(e,t={}){let n=Wo(t),r=Ao(t);jo(r,`workload.inputFiles`,e.length);let i=q(r,`store.preparePathEntries.parse`,()=>e.map(e=>Ko(e)));return q(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>ts(e,t,n.sort))),i}var ms=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[ns()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=Yo();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=Ao(e),this.options=Wo(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,io())}appendPaths(e){return q(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>Ko(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,q(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return q(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:xo(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:xo(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d}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:xo(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=Ko(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:xo(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:xo(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=Ko(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(q(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||q(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"?Ho(this.lastPreparedPath,e,this.segmentSortKeyCache):ts(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=is(e),i=n==null?0:is(n),a=n==null?0:rs(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=Xo(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:xo(So(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),co(i,s),s}createFileChildUnchecked(e,t){let n=Xo(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:xo(So(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),co(r,a),a}getOrCreateDirectoryChild(e,t){let n=Xo(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&&!K(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:xo(So(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),co(r,a),this.directories.set(a,io()),a}createDirectoryChild(e,t){let n=Xo(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:xo(So(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),co(r,a),this.directories.set(a,io()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!K(n))throw Error(`Path is not a directory: "${t}"`);if(To(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,ao());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(K(a)){let t=ao();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;K(n)&&this.directories.set(t,io());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),co(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!K(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 uo(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function hs(e,t=`closed`,n=null){let r=_s(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 gs(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function _s(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 vs(e,t){return To(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion===`closed`?!1:So(t)<=e.defaultExpansion}function ys(e,t,n=e.snapshot.nodes[t]){return n==null||!K(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:vs(e,n)}function bs(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!K(r))return;let i=vs(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 xs(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 Ss(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function Cs(e,t){let n=xs(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 ws(e,t){let n=xs(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function Ts(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 Es(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function Ds(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 Os(e,t){e.directoryLoadInfoById.delete(t)}function ks(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 As(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function js(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function Ms(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function Ns(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function Ps(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function Fs(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Is(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 Ls(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 Rs(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 zs(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 Bs(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 Vs(e,t,n){return{...n,visibleCountDelta:Qs(e)-t}}function Hs(e,t){let n=Qs(e),r=gs();e.transactionStack.push(r);try{t()}catch(t){throw Gs(e,r,!1),t}Gs(e,r,!0,Qs(e)-n)}function Us(e,t){let n=e.instrumentation;if(n==null){Ws(e,t);return}q(n,`store.events.record`,()=>Ws(e,t))}function Ws(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){Xs(e,t);return}n.events.push(t),Ys(n,t)}function Gs(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?Js(i,t):q(n,`store.events.batch.merge`,()=>Js(i,t));return}let a=Ks(t,r),o=e.instrumentation;if(o==null){Xs(e,a);return}q(o,`store.events.batch.commit`,()=>Xs(e,a))}function Ks(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 qs(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function Js(e,t){for(let n of t.events)e.events.push(n);qs(e,t)}function Ys(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function Xs(e,t){let n=e.instrumentation;if(n==null){Zs(e,t);return}q(n,`store.events.emit`,()=>Zs(e,t))}function Zs(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function Qs(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function $s(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!K(n)||To(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||!K(a)?null:i}function ec(e,t){let n=t;for(;;){let t=$s(e,n);if(t==null)return n;n=t}}function tc(e,t){let n=[t],r=t;for(;;){let t=$s(e,r);if(t==null)return n;n.push(t),r=t}}function nc(e,t){let n=t==null?e.snapshot.rootId:dc(e,t);return n==null?[]:pc(e,n)}function rc(e,t){let n=Ko(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=Oc(e,Dc(e,r)),{createdNodeIds:a,directoryId:o}=mc(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=X(e,o);if(To(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=gc(e,o,n.basename),s.add(c);cc(e,o);let l=Oc(e,o);return As({affectedAncestorIds:uc(e,c),affectedNodeIds:[...s],path:t,projectionChanged:kc(i,l)})}function ic(e,t,n){let r=dc(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=X(e,r);if(To(i,2))throw Error(`The root node cannot be removed`);if(K(i)&&Y(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=Oc(e,a),s=Tc(e,r);yc(e,a,r,i.nameId),Ec(e,a),cc(e,a);let c=Oc(e,a);return js({affectedAncestorIds:uc(e,a),affectedNodeIds:s,path:t,projectionChanged:kc(o,c),recursive:n.recursive===!0})}function ac(e,t,n,r){let i=dc(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=X(e,i);if(To(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=Cc(e,i,n),c=Oc(e,a.parentId),l=Oc(e,s.parentId),u=Zo(e.snapshot.segmentTable,a.nameId),d=Xo(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(K(a)&&Nc(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=oo(e.snapshot.nodes,Y(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&wc(e,p,o,Co(a))===`skip`)return null;let m=a.parentId;yc(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),Mc(e,i),vc(e,s.parentId,i),Ec(e,m),e.pathCacheVersion++,cc(e,m),s.parentId!==m&&cc(e,s.parentId);let h=Oc(e,m),g=Oc(e,s.parentId);return Ms({affectedAncestorIds:[...new Set([...uc(e,m),...uc(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:Ac([c,l],[h,g]),to:J(e,i)})}function oc(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function sc(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function J(e,t){let n=X(e,t),r=oc(e,t);if(r!=null)return r;if(To(n,2))return sc(e,t,``);let i=J(e,n.parentId),a=Zo(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return sc(e,t,K(n)?`${o}/`:o)}function cc(e,t){let n=e.instrumentation;if(n==null){Fc(e,t);return}q(n,`store.recomputeCountsUpwardFrom`,()=>Fc(e,t))}function lc(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||!K(o)){Pc(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){Pc(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function uc(e,t){let n=[],r=t;for(;r!=null;){let t=X(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function dc(e,t){if(t.length===0)return e.snapshot.rootId;let n=qo(t);return fc(e,n.segments,n.requiresDirectory)}function fc(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=Y(e,r),a=oo(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=X(e,r);return n&&!K(i)?null:r}function Y(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 X(e,t){let n=e.snapshot.nodes[t];if(n===void 0||To(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function pc(e,t){let n=e.snapshot.nodes[t];if(n===void 0||To(n,4))return[];if(!K(n))return[J(e,t)];if(Y(e,t).childIds.length===0)return To(n,1)&&!To(n,2)?[J(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||To(n,4)){i.pop();continue}if(!K(n)){r.push(J(e,t.nodeId)),i.pop();continue}let a=Y(e,t.nodeId);if(a.childIds.length===0){To(n,1)&&!To(n,2)&&r.push(J(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 mc(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=Xo(e.snapshot.segmentTable,i),a=Y(e,r),o=oo(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!K(X(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=hc(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function hc(e,t,n){let r=X(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:xo(So(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,io()),vc(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function gc(e,t,n){let r=Xo(e.snapshot.segmentTable,n),i=Y(e,t);if(oo(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${Lc(e,t,n)}"`);let a=X(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:xo(So(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),vc(e,t,o),e.activeNodeCount++,o}function _c(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}bc(e,n,o)<0?i=a:r=a+1}return r}function vc(e,t,n){let r=Y(e,t),i=X(e,n);oo(e.snapshot.nodes,r).set(i.nameId,n),fo(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=_c(e,r,n);r.childIds.splice(a,0,n),lo(r,a),ho(e.snapshot.nodes,r)}function yc(e,t,n,r){let i=Y(e,t),a=so(i),o=a.get(n)??-1;oo(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&fo(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),lo(i,o),ho(e.snapshot.nodes,i))}function bc(e,t,n){let r=e.snapshot.options.sort;return r==="default"?xc(e,t,n):r(Sc(e,t),Sc(e,n))}function xc(e,t,n){let r=X(e,t),i=X(e,n),a=K(r);if(a!==K(i))return a?-1:1;let o=Io(Uo(e.snapshot.segmentTable,r.nameId),Uo(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=Zo(e.snapshot.segmentTable,r.nameId),c=Zo(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function Sc(e,t){let n=X(e,t),r=J(e,t),i=K(n),a=i?r.slice(0,-1):r;return{basename:Zo(e.snapshot.segmentTable,n.nameId),depth:So(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function Cc(e,t,n){let r=X(e,t),i=dc(e,n);if(i!=null){let t=X(e,i);if(K(t))return{basename:Zo(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=qo(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=qo(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:fc(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function wc(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${J(e,t)}"`);let i=X(e,t);if(Co(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(K(i)&&Y(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return Tc(e,t),yc(e,a,t,o),Ec(e,a),cc(e,a),`handled`}function Tc(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=X(e,t.nodeId);if(t.visitedChildren||!K(i)){K(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),Os(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=Y(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 Ec(e,t){let n=t;for(;n!=null;){let t=X(e,n);if(!K(t)||To(t,2)||Y(e,n).childIds.length>0)return;Eo(t,1),n=t.parentId===n?null:t.parentId}}function Dc(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=oo(e.snapshot.nodes,Y(e,n)).get(t);if(i==null||!K(X(e,i)))break;n=i}return n}function Oc(e,t){let n=jc(e,t);if(n==null)return null;let r=ec(e,n),i=X(e,r),a=n===r?null:tc(e,n).map(t=>J(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:Y(e,r).childIds.length>0,path:J(e,r),terminalKind:Co(i)})}function kc(e,t){return Ac([e],[t])}function Ac(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 jc(e,t){let n=t;for(;n!=null;){let t=X(e,n);if(!K(t)||To(t,2))return null;if(!ys(e,n,t))return n;n=t.parentId}return null}function Mc(e,t){let n=X(e,t);if(Do(n,(t===e.snapshot.rootId?-1:So(X(e,n.parentId)))+1),!K(n))return;let r=Y(e,t);for(let t of r.childIds)Mc(e,t)}function Nc(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=X(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function Pc(e,t,n=X(e,t),r=!1){let i=e.instrumentation;if(i==null){Ic(e,t,n,r);return}q(i,`store.recomputeNodeCounts`,()=>Ic(e,t,n,r))}function Fc(e,t){let n=t;for(;n!=null;){let t=X(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(Pc(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&fo(Y(e,s),n,a,o),n=s}}function Ic(e,t,n,r){if(!K(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=Y(e,t);if(r){let t=e.instrumentation;t==null?uo(e.snapshot.nodes,i):q(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>uo(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,To(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=$s(e,t)==null?ys(e,t,n)?1+o:1:o}function Lc(e,t,n){let r=J(e,t);return r.length===0?n:`${r}${n}`}function Rc(e){return e!=null&&!To(e,4)}function zc(e,t){let n=e.snapshot.nodes[t];return!Rc(n)||!K(n)||To(n,2)?null:n}function Bc(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&Rc(e.snapshot.nodes[n])&&(t+=1);return t}function Vc(e){return Math.max(0,e.valueById.length-1)}function Hc(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:Bc(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:Vc(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function Uc(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 Wc(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)zc(e,n)!=null&&t.push(J(e,n));for(let t of e.expandedDirectoryIds)zc(e,t)!=null&&n.push(J(e,t));return{collapsedPaths:t,expandedPaths:n}}function Gc(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)zc(e,n)==null||Ss(e,n)===`loaded`||t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:J(e,n)});return t}function Kc(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=dc(e,n);t!=null&&bs(e,t,!0,X(e,t))}for(let n of t.collapsedPaths){let t=dc(e,n);t!=null&&bs(e,t,!1,X(e,t))}}function qc(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=dc(e,n.path);t!=null&&zc(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function Jc(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function Yc(e){let t=e.snapshot.segmentTable,n=Yo();for(let r of e.snapshot.nodes)if(Rc(r)){if(To(r,2)){r.nameId=0;continue}r.nameId=Xo(n,Zo(t,r.nameId))}e.snapshot.segmentTable=n}function Xc(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!Rc(r)||!K(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return Rc(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[X(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),uo(e.snapshot.nodes,n)}}function Zc(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(Rc(n))break;--t}e.snapshot.nodes.length=t+1}function Qc(e){let t=Wc(e),n=Gc(e);q(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>Jc(e)),q(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>Yc(e)),q(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>Xc(e)),q(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>Zc(e)),q(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>Kc(e,t)),q(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>qc(e,n)),q(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>lc(e,e.snapshot.rootId))}function $c(e){let t=Wc(e),n=Gc(e),r=q(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>nc(e)),i=ko({...e.snapshot.options},e.instrumentation),a=q(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new ms(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,q(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>Kc(e,t)),q(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>qc(e,n)),q(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>lc(e,e.snapshot.rootId))}function el(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function tl(e,t){let n=Hc(e);t===`stable`?q(e.instrumentation,`store.cleanup.stable`,()=>Qc(e)):q(e.instrumentation,`store.cleanup.aggressive`,()=>$c(e));let r=Hc(e);return Uc(t,t===`stable`,n,r)}var nl=64;function rl(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 il(e){return X(e,e.snapshot.rootId).visibleSubtreeCount}function al(e,t,n,r){let i=X(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function ol(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:Tl(e,t.cursor),setSize:t.setSize,subtreeEndIndex:al(e,t.cursor,t.index,n)}}function sl(e,t,n,r,i,a){let o=Y(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=po(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return cl(e,u,l,r+c,i+1,s,o.childIds.length,a)}function cl(e,t,n,r,i,a,o,s){if(!K(X(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=yl(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=X(e,c.terminalNodeId);if(!K(l)||!ys(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return sl(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function ll(e,t){let n=il(e);if(t<0||t>=n)return null;let r=sl(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>J(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=ol(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:Tl(e,r.cursor),setSize:r.setSize,subtreeEndIndex:al(e,r.cursor,r.index,n)}}function ul(e,t,n){let r=e.instrumentation,i=il(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 wl(e,o+1);let t=[],n=gl(e,a);for(let r=a;r<=o&&n!=null;r++){let r=Tl(e,n);t.push(r),n=xl(e,n)}return t}let s=[],c=0,l=0,u=q(r,`store.getVisibleSlice.selectFirstRow`,()=>gl(e,a));for(let t=a;t<=o&&u!=null;t++){let t=q(r,`store.getVisibleSlice.materializeRow`,()=>Tl(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=q(r,`store.getVisibleSlice.advanceCursor`,()=>xl(e,u))}return jo(r,`workload.visibleRowsRead`,s.length),jo(r,`workload.flattenedRowsRead`,c),jo(r,`workload.flattenedSegmentsRead`,l),s}function dl(e,t=il(e)){let n=e.instrumentation;return n==null?Cl(e,t):q(n,`store.getVisibleTreeProjection`,()=>Cl(e,t))}function fl(e){return Sl(dl(e))}function pl(e,t){let n=dc(e,t);if(n==null||n===e.snapshot.rootId||K(X(e,n))&&ec(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=X(e,i).parentId,n=Y(e,t),s=so(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=mo(a,n,s),t!==o){let n=X(e,t),a=$s(e,t);if(!ys(e,t,n)&&a!==i)return null;ec(e,t)===t&&(r+=1)}i=t}return r}function ml(e,t){let n=dc(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=X(e,n);if(!K(r))throw Error(`Path is not a directory: "${t}"`);return ys(e,n,r)?null:(bs(e,n,!0,r),cc(e,n),Ns({affectedAncestorIds:uc(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function hl(e,t){let n=dc(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=X(e,n);if(!K(r))throw Error(`Path is not a directory: "${t}"`);return ys(e,n,r)?(bs(e,n,!1,r),cc(e,n),Ps({affectedAncestorIds:uc(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function gl(e,t){return t<0||t>=il(e)?null:_l(e,e.snapshot.rootId,t,-1)}function _l(e,t,n,r){let i=Y(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?po(e.snapshot.nodes,i,n):q(a,`store.getVisibleSlice.selectChildIndex`,()=>po(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return vl(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function vl(e,t,n,r){if(!K(X(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=yl(e,t,r);if(n===0)return i;let a=X(e,i.terminalNodeId);if(!K(a)||!ys(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return _l(e,i.terminalNodeId,n-1,i.visibleDepth)}function yl(e,t,n){return K(X(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:ec(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:q(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>ec(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function bl(e,t){let n=X(e,t);if(!K(n))return!0;let r=n.parentId;return r===e.snapshot.rootId?!0:$s(e,r)!==t}function xl(e,t){let n=X(e,t.terminalNodeId);if(K(n)){let r=Y(e,t.terminalNodeId);if(ys(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:vl(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=X(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=Y(e,n),o=so(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 vl(e,s,0,i);bl(e,r)&&i--,r=n}}function Sl(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 Cl(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(nl);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=rl(o,y);let x,S=_;if(K(v))S=f?ec(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:J(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&&K(C)&&ys(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 wl(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(!K(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:J(e,f)};continue}let h=l?ec(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=Tl(e,g);let _=i[h];_!=null&&K(_)&&ys(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function Tl(e,t){let n=X(e,t.terminalNodeId),r=K(n)?El(e,t):null,i=J(e,t.terminalNodeId),a=Zo(e.snapshot.segmentTable,n.nameId),o=K(n)&&Y(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?tc(e,t.headNodeId).map(n=>{let r=X(e,n);return{isTerminal:n===t.terminalNodeId,name:Zo(e.snapshot.segmentTable,r.nameId),nodeId:n,path:J(e,n)}}):q(c,`store.getVisibleSlice.flatten.collectSegments`,()=>tc(e,t.headNodeId).map(n=>{let r=X(e,n);return{isTerminal:n===t.terminalNodeId,name:Zo(e.snapshot.segmentTable,r.nameId),nodeId:n,path:J(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:K(n)&&ys(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:K(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function El(e,t){if(t.headNodeId===t.terminalNodeId)return Ss(e,t.terminalNodeId);let n=tc(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=Ss(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}function Dl(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||!K(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&&ho(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&K(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,ho(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function Ol(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var kl=class e{#e;constructor(e={}){let t=Ao(e),n=q(t,`store.builder.create`,()=>new ms(e));if(e.preparedInput!=null){let t=ds(e.preparedInput);t==null?n.appendPreparedPaths(us(e.preparedInput),!1):n.appendPresortedPaths(t,fs(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(q(t,`store.preparePathEntries`,()=>ps(r,e)))}let r=q(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=q(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=q(t,`store.state.create`,()=>hs(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:q(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||Ol(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&q(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?q(t,`store.state.initializeOpenVisibleCounts`,()=>Dl(this.#e)):q(t,`store.state.recomputeCounts`,()=>lc(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return ss(e,t)}static prepareInput(e,t={}){return cs(e,t)}static preparePresortedInput(e){return ls(e)}list(e){return q(this.#e.instrumentation,`store.list`,()=>nc(this.#e,e))}add(e){q(this.#e.instrumentation,`store.add`,()=>{let t=il(this.#e);Us(this.#e,Vs(this.#e,t,rc(this.#e,e)))})}remove(e,t={}){q(this.#e.instrumentation,`store.remove`,()=>{let n=il(this.#e);Us(this.#e,Vs(this.#e,n,ic(this.#e,e,t)))})}move(e,t,n={}){q(this.#e.instrumentation,`store.move`,()=>{let r=il(this.#e),i=ac(this.#e,e,t,n);i!=null&&Us(this.#e,Vs(this.#e,r,i))})}batch(e){Hs(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});break}})}getVisibleCount(){return q(this.#e.instrumentation,`store.getVisibleCount`,()=>il(this.#e))}getVisibleSlice(e,t){return q(this.#e.instrumentation,`store.getVisibleSlice`,()=>ul(this.#e,e,t))}getVisibleRowContext(e){return q(this.#e.instrumentation,`store.getVisibleRowContext`,()=>ll(this.#e,e))}getVisibleTreeProjection(){return fl(this.#e)}getVisibleTreeProjectionData(e){return dl(this.#e,e)}getVisibleIndex(e){return q(this.#e.instrumentation,`store.getVisibleIndex`,()=>pl(this.#e,e))}getPathInfo(e){return q(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=dc(this.#e,e);if(t==null)return null;let n=X(this.#e,t);return{depth:So(n),kind:K(n)?`directory`:`file`,path:J(this.#e,t)}})}isExpanded(e){return q(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=X(this.#e,t);return ys(this.#e,t,n)})}expand(e){q(this.#e.instrumentation,`store.expand`,()=>{let t=il(this.#e),n=ml(this.#e,e);n!=null&&Us(this.#e,Vs(this.#e,t,n))})}collapse(e){q(this.#e.instrumentation,`store.collapse`,()=>{let t=il(this.#e),n=hl(this.#e,e);n!=null&&Us(this.#e,Vs(this.#e,t,n))})}on(e,t){return ks(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return Ss(this.#e,t)}markDirectoryUnloaded(e){q(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(Y(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=il(this.#e);ws(this.#e,t),Us(this.#e,Vs(this.#e,n,Fs({affectedAncestorIds:uc(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return q(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=il(this.#e),r=Cs(this.#e,t);return Us(this.#e,Vs(this.#e,n,Is({affectedAncestorIds:uc(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return q(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||Ss(this.#e,n)!==`loading`||!Es(this.#e,n,e.attemptId))return!1;let r=J(this.#e,n);this.validateChildPatch(r,t);let i=il(this.#e),a=[];for(let e of t.operations){Al(r,e);let t=il(this.#e);switch(e.type){case`add`:a.push(Vs(this.#e,t,rc(this.#e,e.path)));break;case`remove`:a.push(Vs(this.#e,t,ic(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=ac(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(Vs(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return Us(this.#e,Vs(this.#e,i,Ls({affectedAncestorIds:uc(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:J(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return q(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=il(this.#e),r=Ts(this.#e,t,e.attemptId);return Us(this.#e,Vs(this.#e,n,Rs({affectedAncestorIds:uc(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:J(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return q(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=il(this.#e),i=Ds(this.#e,n,e.attemptId,t);return Us(this.#e,Vs(this.#e,r,zs({affectedAncestorIds:uc(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:J(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return q(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(el(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=il(this.#e),n=tl(this.#e,e.mode??`stable`);return Us(this.#e,Vs(this.#e,t,Bs({...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=Y(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??Po(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=Io(Uo(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(!K(X(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=X(this.#e,n);ys(this.#e,n,i)||(bs(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=X(this.#e,e);if(!ys(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=dc(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!K(X(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!K(X(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=X(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=X(this.#e,e),r=$s(this.#e,e);if(!ys(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 Al(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}"`);break}}var jl=e=>e.startsWith(`f::`)?e.slice(3):e;function Ml(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function Nl(e,t){return e===``?t:`${e}/${t}`}function Pl({files:e,path:t,isFolder:n,nextBasename:r}){let i=jl(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}=Ml(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=Nl(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 Fl(e){return e.endsWith(`/`)}function Il(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 Ll(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 Rl(e,t){return t.includes(e)?Ll(t):[e]}function zl(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 Bl(e,t){return{draggedPaths:e,target:t}}function Vl(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(Fl(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function Hl(e,t){return t.kind===`root`||t.directoryPath==null?Il(e):t.directoryPath}function Ul(e,t){let n=e.map(e=>{let n=Hl(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 Wl(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 Gl(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(!Wl(kl.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 Kl(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function ql(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 Jl(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function Yl(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 Jl(e,t.path)?n?e:null:e;case`move`:return ql(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=Yl(r,e,n),r==null)return null;return r}}}function Xl(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function Zl(e){switch(e.operation){case`add`:return{...Xl(e),operation:`add`,path:e.path};case`remove`:return{...Xl(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...Xl(e),from:e.from,operation:`move`,to:e.to}}}function Ql(e){return{...Xl(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>Zl(e)),operation:`batch`}}function $l(e){switch(e.operation){case`add`:case`remove`:case`move`:return Zl(e);case`batch`:return Ql(e);default:return null}}function eu(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function tu(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 nu(e){return tu(e).at(-1)??null}function ru(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function iu(e){return e.endsWith(`/`)}var au=e=>e.toLowerCase();function ou(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function su(e){return e.endsWith(`/`)?e.slice(0,-1):e}function cu(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var lu=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},uu=Symbol(`FILE_TREE_RENAME_VIEW`),du=512,fu=512;function pu(e){return e===`top`||e===`center`?e:`nearest`}function mu(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=tu(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 hu(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:mu(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var gu=class{#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=0;#z=null;#B=new Set;#V=0;#H;#U=0;#W=!1;#G=0;#K;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=Gl({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=nu(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:pu(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<=fu){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=Rl(t,n);return this.#r.canDrag?.(r)===!1?!1:(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=Bl(t.draggedPaths,n);(Vl(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}zl(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=Bl(e.draggedPaths,t);if(Vl(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=Ul(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=iu(r),a=su(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of tu(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=ou(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}[uu](){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}}#q(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,iu(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,iu(e)?{recursive:!0}:void 0);return}let t=iu(e),n=Pl({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:su(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(cu(n.sourcePath,t),cu(n.destinationPath,t))}#Y(e){this.#T==null||this.#E===e||(this.#E=e,this.#De())}resetPaths(e,t={}){let n=this.#H.list().length,r=this.#G,i=Gl({paths:e,preparedInput:t.preparedInput},`resetPaths`,this.#e.sort),a=this.#le(i.paths,i.preparedInput,t.initialExpandedPaths),o=this.#c,s=this.#T,c=this.getSelectedPaths(),l=this.#z;this.#K?.(),this.#H=a,this.#d.clear(),this.#he();let u=c.map(e=>a.getPathInfo(e)?.path??null).filter(e=>e!=null),d=!eu(this.#B,u);this.#B=new Set(u),d&&(this.#V+=1),this.#z=l==null?null:a.getPathInfo(l)?.path??null,this.#T=s==null?null:a.getPathInfo(s)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(o,o!=null||u.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:i.paths.length,pathCountBefore:n,projectionChanged:!0,usedPreparedInput:t.preparedInput!=null,visibleCountDelta:this.#G-r})}#X(e){this.#Ie();let t=nu(e),n=ru(e,t),r=null,i=null;for(let e of this.#be()){if(nu(e)!==t)continue;let a=ru(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=tu(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=!eu(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 kl({...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 tu(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(au),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(au),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 tu(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:lu(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 tu(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 tu(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=hu(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,du)),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=Yl(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=Yl(this.#c,e,!0),r=[...this.#B].map(t=>Yl(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=Yl(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return eu(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&&Kl(e)&&(this.#i=null);let t=Kl(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=$l(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},_u=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 vu(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 yu(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 bu(e,t){return t?`${e}/`:e}function xu(e,t=null){let n=_u(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set;for(let t of e??[]){let e=vu(t.path);if(e==null)continue;let n=bu(e.path,e.isDirectory);r.set(n,t.status),t.status===`ignored`&&e.isDirectory?a.add(n):e.isDirectory&&a.delete(n);for(let t of yu(e.path))i.add(t)}return{directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}var Z,Su,Cu,wu,Tu,Eu,Du,Ou,ku,Au,ju={},Mu=[],Nu=Array.isArray,Pu=Mu.slice,Fu=Object.assign;function Iu(e){e&&e.parentNode&&e.remove()}function Lu(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?Pu.call(arguments,2):n),Ru(e,o,r,i,null)}function Ru(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??++Su,__i:-1,__u:0};return i==null&&Z.vnode!=null&&Z.vnode(a),a}function zu(e){return e.children}function Bu(e,t){this.props=e,this.context=t,this.__g=0}function Vu(e,t){if(t==null)return e.__?Vu(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`?Vu(e):null}function Hu(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 Hu(e)}}function Uu(e){(8&e.__g||!(e.__g|=8)||!Cu.push(e)||Tu++)&&wu==Z.debounceRendering||((wu=Z.debounceRendering)||queueMicrotask)(Wu)}function Wu(){for(var e,t,n,r,i,a,o,s,c=1;Cu.length;)Cu.length>c&&Cu.sort(Eu),e=Cu.shift(),c=Cu.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=Fu({},r)).__v=r.__v+1,Z.vnode&&Z.vnode(n),Qu(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??Vu(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,ed(a,n,o),n.__e!=i&&Hu(n)));Tu=0}function Gu(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||Mu,b=t.length;for(c=Ku(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?ju:y[m.__i]||ju,m.__i=f,_=Qu(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&rd(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=qu(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function Ku(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?Ru(null,o,null,null,null):Nu(o)?Ru(zu,{children:o},null,null,null):o.constructor==null&&o.__b>0?Ru(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=Ju(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=Vu(s)),id(s,s));return r}function qu(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=qu(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=Vu(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Ju(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function Yu(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function Xu(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||Yu(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||Yu(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(Du,`$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=Ou,e.addEventListener(t,a?Au:ku,a)):e.removeEventListener(t,a?Au:ku,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 Zu(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=Ou++;else if(t.u<n.l)return;return n(Z.event?Z.event(t):t)}}}function Qu(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,ee,w,T,E,te,D,O,k,A=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=Z.__b)&&d(t);n:if(typeof A==`function`)try{if(v=t.props,y=`prototype`in A&&A.prototype.render,b=(d=A.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 A(v,x):(t.__c=f=new Bu(v,x),f.constructor=A,f.render=ad),b&&b.sub(f),f.props=v,f.state||={},f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&A.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=Fu({},f.__s)),Fu(f.__s,A.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&A.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&A.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=Z.__r,ee=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),w=0;w<f._sb.length;w++)f.__h.push(f._sb[w]);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&&++ee<25);f.state=f.__s,f.getChildContext!=null&&(r=Fu({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),T=d,d!=null&&d.type===zu&&d.key==null&&(T=td(d.props.children)),s=Gu(e,Nu(T)?T:[T],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(E=0,te=!1,t.__u|=c?160:128,t.__c.__z=[],D=0;D<a.length;D++)(O=a[D])==null||te||(O.nodeType==8&&O.data==`$s`?(E>0&&t.__c.__z.push(O),E++,a[D]=null):O.nodeType==8&&O.data==`/$s`?(--E>0&&t.__c.__z.push(O),te=E===0,s=a[D],a[D]=null):E>0&&(t.__c.__z.push(O),a[D]=null));if(!te){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(k=a.length;k--;)Iu(a[k]);$u(t)}else t.__e=n.__e,t.__k=n.__k,e.then||$u(t);Z.__e(e,t,n)}else s=t.__e=nd(n.__e,t,n,r,i,a,o,c,l,u);return(d=Z.diffed)&&d(t),128&t.__u?void 0:s}function $u(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach($u)}function ed(e,t,n){for(var r=0;r<n.length;r++)rd(n[r],n[++r],n[++r]);Z.__c&&Z.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){Z.__e(e,t.__v)}})}function td(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:Nu(e)?e.map(td):Fu({},e)}function nd(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&&=(Z.__m&&Z.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=Pu.call(e.childNodes),v=n.props||ju,!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;Xu(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&&!_||Xu(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=``),Gu(b==`template`?e.content:e,Nu(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&Vu(n,0),s,c,l),a!=null)for(u=a.length;u--;)Iu(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||Xu(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&Xu(e,u,g,v[u],i))}return e}function rd(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){Z.__e(e,n)}}function id(e,t,n){var r,i;if(Z.unmount&&Z.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||rd(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Z.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&id(r[i],t,n||typeof e.type!=`function`);n||Iu(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function ad(e,t,n){return this.constructor(e,n)}function od(e,t){var n,r,i,a;t==document&&(t=document.documentElement),Z.__&&Z.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=Lu(zu,null,[e]),i=[],a=[],Qu(t,e,r||ju,ju,t.namespaceURI,r?null:t.firstChild?Pu.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),ed(i,e,a)}function sd(e,t){e.__u|=32,od(e,t)}Z={__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 Tu=0,e}},Su=0,Bu.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Fu({},this.state);typeof e==`function`&&(e=e(Fu({},n),this.props)),e&&Fu(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Uu(this))},Bu.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),Uu(this))},Bu.prototype.render=zu,Cu=[],Tu=0,Eu=function(e,t){return e.__v.__b-t.__v.__b},Du=/(PointerCapture)$|Capture$/i,Ou=0,ku=Zu(!1),Au=Zu(!0);var cd=0;Array.isArray;function Q(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:--cd,__i:-1,__u:0,__source:i,__self:a};return Z.vnode&&Z.vnode(l),l}var ld=16,ud=16,dd={};function fd({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}=dd[e]??{width:ld,height:ud},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return Q(`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:Q(`use`,{href:c})})}var pd=e=>{if(e.length<2)return[e,``];let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]},md=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},hd=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)]},gd=(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)]},_d=(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)]},vd=(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 yd({children:e,marker:t,variant:n=`default`}){"use no memo";return Q(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:Q(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?Q(`span`,{"data-truncate-fade":!0}):t})})}function bd(e){"use no memo";let{mode:t,children:n}=e;return Q(`div`,{children:[Q(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?Q(`span`,{children:n}):n}),Q(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?Q(`span`,{children:n}):n})]})}function xd({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=Q(bd,{mode:t,children:e},`content`),o=Q(yd,{marker:n,mode:t,variant:r},`marker`),s=Q(`div`,{"data-truncate-fill":!0},`fill`);return Q(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:Q(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function Sd({children:e,...t}){"use no memo";return Q(xd,{mode:`truncate`,...t,children:e})}function Cd({children:e,...t}){"use no memo";return Q(xd,{mode:`fruncate`,...t,children:e})}function wd({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=Q(Sd,{...s,children:t[0]}),l=Q(Cd,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return Q(`div`,{className:a,style:o});if(e.length<i)return Q(n===`end`?Cd:Sd,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=pd:r===`extension`?t=md:r===`leaf-path`&&(t=hd);else if(typeof r==`number`)t=gd,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=_d:e===`first`&&(t=vd)}else typeof r==`function`&&(t=r);t??=pd;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=Q(Sd,{...s,..._,children:f}),l=Q(Cd,{...s,...v,children:p})}return Q(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[Q(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),Q(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var Td={endIndex:-1,startIndex:-1};function Ed(e,t,n){return Math.min(Math.max(e,t),n)}function Dd(e,t){return e<0||t<e?Td:{endIndex:t,startIndex:e}}function Od(e){return e.startIndex<0||e.endIndex<e.startIndex}function kd(e,t){return Od(e)?0:(e.endIndex-e.startIndex+1)*t}function Ad(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function jd(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function Md(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 Nd(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 Pd(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 Fd(e,t,n){if(e.length===0||t<=0)return[];let r=Pd(e),i=Md(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=Nd(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 Id(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=Ed(t.scrollTop,0,o),c=t.stickyRows??Fd(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=Ad(s,n,t.itemHeight),m=Ad(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?Td:Dd(m,jd(u+d,n,t.itemHeight)),y=g+1,b=Od(v)?Td:Dd(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=kd(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:Od(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var Ld={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},Rd={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},zd=`Contains git status items`;function Bd(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 Vd(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return Bd({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 Hd(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 Ud(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 Wd(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 Gd(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function Kd(e,t){return e!=null&&e>0?e:t}function qd(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 Jd(e,t,n,r,i=0){let a=Bd({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a==null?!1:(e.scrollTop=a,!0)}function Yd(e,t,n,r,i,a,o=0){let s=Vd({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s==null?!1:(e.scrollTop=s,!0)}function Xd(e,t,n,r,i,a){let o=Hd({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o==null?!1:(e.scrollTop=o,!0)}function Zd(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function Qd(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function $d({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return Q(`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 ef(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 tf(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 nf,rf,af,of,sf=Object.is,cf=0,lf=[],uf=Z,df=uf.__b,ff=uf.__r,pf=uf.diffed,mf=uf.__c,hf=uf.unmount,gf=uf.__;function _f(e,t){uf.__h&&uf.__h(rf,e,cf||t),cf=0;var n=rf.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function vf(e){return cf=1,yf(Af,e)}function yf(e,t,n){var r=_f(nf++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Af(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);sf(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=rf,!rf.__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,sf(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};rf.__f=!0;var a=rf.shouldComponentUpdate,o=rf.componentWillUpdate;rf.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)},rf.shouldComponentUpdate=i}return r.__N||r.__}function bf(e,t){var n=_f(nf++,3);!uf.__s&&kf(n.__H,t)&&(n.__=e,n.u=t,rf.__H.__h.push(n))}function xf(e,t){var n=_f(nf++,4);!uf.__s&&kf(n.__H,t)&&(n.__=e,n.u=t,rf.__h.push(n))}function $(e){return cf=5,Sf(function(){return{current:e}},[])}function Sf(e,t){var n=_f(nf++,7);return kf(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Cf(e,t){return cf=8,Sf(function(){return e},t)}function wf(){for(var e;e=lf.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Df),e.__H.__h.forEach(Of),e.__H.__h=[]}catch(t){e.__H.__h=[],uf.__e(t,e.__v)}}uf.__b=function(e){rf=null,df&&df(e)},uf.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),gf&&gf(e,t)},uf.__r=function(e){ff&&ff(e),nf=0;var t=(rf=e.__c).__H;t&&(af===rf?(t.__h=[],rf.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(Df),t.__h.forEach(Of),t.__h=[],nf=0)),af=rf},uf.diffed=function(e){pf&&pf(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(lf.push(t)!==1&&of===uf.requestAnimationFrame||((of=uf.requestAnimationFrame)||Ef)(wf)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),af=rf=null},uf.__c=function(e,t){t.some(function(e){try{e.__h.forEach(Df),e.__h=e.__h.filter(function(e){return!e.__||Of(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],uf.__e(n,e.__v)}}),mf&&mf(e,t)},uf.unmount=function(e){hf&&hf(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{Df(e)}catch(e){t=e}}),n.__H=void 0,t&&uf.__e(t,n.__v))};var Tf=typeof requestAnimationFrame==`function`;function Ef(e){var t,n=function(){clearTimeout(r),Tf&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Tf&&(t=requestAnimationFrame(n))}function Df(e){var t=rf,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),rf=t}function Of(e){var t=rf;e.__c=e.__(),rf=t}function kf(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!sf(t,e[n])})}function Af(e,t){return typeof t==`function`?t(e):t}function jf(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:Q(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return Q(zu,{children:[Q(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:Q(Sd,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function Mf(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function Nf(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function Pf(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 Ff({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=Id(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:Pf(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?Pf(u,1,t,o):i&&r<=0&&c.length>0?Fd(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 If=400,Lf=10,Rf=40,zf=18;function Bf(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))?Vf(e,t,n):a instanceof HTMLElement?a:null}function Vf(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 Hf(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 Uf(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 Wf(){return navigator.vendor!==`Apple Computer, Inc.`}function Gf(e,t){let n=e-t.top;if(n<Rf)return-Math.ceil((Rf-Math.max(0,n))/Rf*zf);let r=t.bottom-e;return r<Rf?Math.ceil((Rf-Math.max(0,r))/Rf*zf):0}function Kf(e,t){if(e!=null){let t=Ld[e];return t==null?null:{text:t,title:Rd[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:zd}:null}function qf(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 Jf(e){return e!=null&&`toggle`in e}function Yf(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function Xf(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function Zf(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function Qf(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function $f(e,t){return t&&Qf(e)||(e.ctrlKey||e.metaKey)&&Yf(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var ep=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function tp(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 np(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 rp(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function ip(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function ap(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function op(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 sp(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 cp(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 lp(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=cp(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 up(e,t){return{kind:e.kind,name:Nf(e),path:t}}function dp(e){return e==null?void 0:`${e}__tree`}function fp(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function pp(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function mp(e,t){if(e==null)return null;if(`text`in e)return Q(`span`,{title:e.title,children:e.text});let n=typeof e.icon==`string`?pp(e.icon)?t(e.icon):{name:e.icon}:pp(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return Q(`span`,{title:e.title,children:Q(fd,{...n})})}function hp(e){e!=null&&Ud(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function gp(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=Mf(e);return Q(zu,{children:[e.depth>0?Q(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>Q(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,Q(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?Q(fd,{...t(`file-tree-icon-chevron`)}):Q(fd,{...t(`file-tree-icon-file`,u)})}),Q(`div`,{"data-item-section":`content`,children:e.isFlattened?jf(e,c,a):c??Q(wd,{minimumLength:5,split:`extension`,children:e.name})}),i?Q(`div`,{"data-item-section":`decoration`,children:r==null?null:mp(r,t)}):null,s?Q(`div`,{"data-item-section":`git`,children:mp(o,t)}):null,n?Q(`div`,{"data-item-section":`action`,children:l?Q(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:Q(fd,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function _p(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:ee,contextMenuButtonVisibility:w,contextMenuRightClickEnabled:T,registerRenameInput:E,registerButton:te,resolveIcon:D,renderDecorationForRow:O,openContextMenuForRow:k,onRowClick:A,onKeyDown:j}=e,M=Mf(t),{isParked:N=!1,mode:ne=`flow`,style:re}=r,ie=ne===`sticky`,ae=_?.get(M)??null??qf(t.ancestorPaths,v,y),oe=t.kind===`directory`&&(b?.has(M)??!1),se=O(t,M),ce=Kf(ae,oe),le=S&&ee,ue=se!=null||x||le,de=le&&w===`always`,fe=a.getPath()===M,pe=fe?a.getValue():``,me=ie||!fe?null:Q($d,{ref:E,ariaLabel:`Rename ${Nf(t)}`,isFlattened:t.isFlattened,value:pe,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),he=gp(t,D,{actionLaneEnabled:le,customDecoration:se,decorationLaneEnabled:ue,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:ce,gitLaneActive:x,renameInput:me,showDecorativeActionAffordance:de}),ge={...ef({ariaLabel:Nf(t),domId:t.isFocused?fp(h,M,N):void 0,extraStyle:re,features:{actionLaneEnabled:le,contextMenuButtonVisibility:le?w:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:N,itemHeight:g,mode:ne,row:t,state:{containsGitChange:oe,effectiveGitStatus:ae,isContextHovered:s===M,isDragTarget:l?.kind===`directory`&&l.directoryPath===M,isDragging:c?.has(M)===!0,isFocusRinged:t.isFocused&&o===M},targetPath:M}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),T&&(i.focusMountedPathFromInput(M),k(t,M,{anchorRect:rp(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:ie?void 0:()=>{i.focusMountedPathFromInput(M)},onKeyDown:ie?void 0:j,ref:e=>{te(M,e)}};return!ie&&fe?Q(`div`,{...ge,children:he}):Q(`button`,{...ge,type:`button`,draggable:u&&!N,onDragEnd:u&&!N?p:void 0,onDragStart:u&&!N?e=>{f(e,t,M)}:void 0,onMouseDown:e=>{if(ie){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!N?e=>{m(e,t,M)}:void 0,onClick:e=>{A(e,t,M,ne)},children:he})}function vp(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(Mf(e))).map((n,r)=>_p(e,n,t.start+r))}function yp({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=Ua,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 _=$(null),v=$(null),y=$(!1),b=$(null),x=$(null),S=$(null),C=$(null),ee=$(null),w=$(new Map),T=$(new Map),E=$(()=>{}),te=$(null),D=$(0),O=$(!1),k=$(null);k.current!==t&&(O.current=!1,k.current=t);let A=$(!1),j=$(null),M=$(null),N=$(!1),ne=$(null),re=$(null),ie=$(null),ae=$(null),oe=$(null),se=$(null),ce=$(null),le=$(null),ue=$(!1),de=$(null),fe=$(null),pe=$(null),me=$(null),he=Sf(()=>new Map,[]),[,ge]=vf(0),[_e,ve]=vf(null),[P,ye]=vf(null),[be,xe]=vf(null),[Se,Ce]=vf(null),[we,Te]=vf(0),[F,De]=vf(null),Oe=$(F);Oe.current=F;let ke=$(null),Ae=$(null),je=$(null),Me=$(null),Ne=$(null),Pe=$(!1),Fe=()=>{Ae.current=null,je.current=null,Me.current=null},Ie=(e,t)=>{Ae.current=e,je.current=null,Me.current=t==null?null:{path:e,scrollTop:t}},Le=(e,t)=>{Ae.current=null,je.current={path:e,viewportOffset:t},Me.current=null},Re=$(d===`retain`&&t.isSearchOpen()),[ze,Be]=vf(p);bf(()=>{p||Be(!1)},[p]);let Ve=$(!1),He=Cf(()=>{Ve.current=!0,Be(e=>e&&!1)},[]),[Ue,We]=vf(()=>Ff({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[Ge,Ke]=vf(!1);bf(()=>{Ke(!0)},[]);let qe=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Je=e?.contextMenu?.triggerMode??(qe?`right-click`:`both`),Ye=Je===`both`||Je===`button`,Xe=e?.contextMenu?.buttonVisibility??`when-needed`,Ze=Je===`both`||Je===`right-click`;xf(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;Ne.current=t,ye(t),Ce(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(Pe.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let Qe=Cf((e,t)=>{ap(w.current,e,t)},[]),$e=Cf((e,t)=>{ap(T.current,e,t)},[]),et=Cf(e=>{x.current=e},[]),tt=Cf(e=>op(e,T.current,w.current),[]),nt=n!=null||r!=null||i!=null,{resolveIcon:rt}=Sf(()=>Ee(a),[a]),it=t[uu](),at=it.getPath(),ot=at!=null,st=t.isSearchOpen(),ct=t.getSearchValue(),I=t.getFocusedPath(),L=t.getFocusedIndex(),lt=t.getScrollRequest(),ut=t.isDragAndDropEnabled(),dt=t.getDragSession(),R=Sf(()=>dt==null?null:new Set(dt.draggedPaths),[dt]),ft=dt?.target??null,pt=dt?.primaryPath??null,mt=dp(o),{overlayHeight:ht,overlayRows:gt,snapshot:z,visibleRows:_t}=Ue,B=z.physical.viewportHeight,vt=Sf(()=>({end:z.window.endIndex,start:z.window.startIndex}),[z.window.endIndex,z.window.startIndex]),yt=gt,bt=z.sticky.rows,xt=z.physical.totalHeight,St=z.sticky.height,Ct=Sf(()=>new Set(bt.map(e=>Mf(e.row))),[bt]),wt=L>=0&&L>=vt.start&&L<=vt.end,Tt=Cf((e,t)=>u?.({item:up(e,t),row:e})??null,[u]),Et=Cf(e=>Ud(e==null?null:w.current.get(e)??null)?!0:Ud(S.current),[]),Dt=Cf(e=>{Et(t.focusNearestPath(e))},[t,Et]),Ot=$(Dt);Ot.current=Dt;let kt=$(!0),At=$(()=>{}),jt=Cf((t=!0)=>{let n=Oe.current;n!=null&&(kt.current=kt.current&&t,De(null),e?.contextMenu?.onClose?.(),kt.current&&Dt(n.path))},[e?.contextMenu,Dt]);At.current=jt;let Mt=Cf(e=>{let t=e==null?null:ip(S.current,e);xe(e=>e===t?e:t)},[]),Nt=Cf((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=tt(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;Ie(n,e?.scrollTop??null),A.current=!0,ve(e=>e===n?e:n)}i.focus(),Mt(a),kt.current=!0,De({anchorRect:r?.anchorRect??null,item:up(e,n),path:n,source:r?.source??`keyboard`})},[t,tt,Mt]),Pt=Cf(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=Gd(e,B);ne.current=L<0||e==null?null:Math.max(0,Math.min(L*s-e.scrollTop,Math.max(0,t-s))),N.current=!0}t.startRenaming(e)!==!1&&(Ce(`focus`),ge(e=>e+1))}},[t,L,s,l,B]),V=Cf((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=Gd(i,B),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:Ff({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return A.current=!0,Xd(i,a,s,l,u,d),E.current(),ke.current=n?e:null,!0},[t,s,c,B,h]),Ft=()=>y.current===!0||me.current!=null||ue.current===!0,It=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),Lt=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Rt=()=>{ae.current!=null&&(clearTimeout(ae.current),ae.current=null),ie.current=null},zt=()=>{se.current?.remove(),se.current=null},Bt=()=>{Lt(re.current),re.current=null,oe.current=null},Vt=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},Ht=()=>{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),zt(),Rt(),Bt(),ce.current=null},Ut=(e,n)=>{let r=S.current?.getRootNode(),i=Hf(Bf(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Wt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Rt();return}let r=t.getItem(e.directoryPath),i=Jf(r)?r:null;if(i==null||i.isExpanded()){Rt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;ie.current!==a&&(Rt(),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))},Gt=()=>{re.current=null;let e=oe.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=Gf(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,E.current()),Wt(Ut(e.clientX,e.clientY)),re.current=It(Gt)},Kt=(e,t)=>{oe.current={clientX:e,clientY:t},re.current??=It(Gt)},qt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(Ht(),zt(),Rt(),Bt(),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),Wf())){let t=Uf(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Vt(t),se.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Jt=()=>{zt(),Rt(),Bt(),ce.current=null,t.cancelDrag()},Yt=(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<=Lf*Lf||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=Uf(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`}),Vt(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)`),Wt(Ut(t.clientX,t.clientY)),Kt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&Ut(n.clientX,n.clientY),t.completeDrag(),Ht()},u=()=>{t.cancelDrag(),Ht()};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)},If)},Xt=e=>{if(F!=null){if(e.key===`Escape`){jt(),e.preventDefault(),e.stopPropagation();return}ep.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(it.isActive()){if(e.key===`Escape`)it.cancel();else if(e.key===`Enter`)it.commit();else return;Ce(`focus`),ge(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Pt(I??void 0),e.preventDefault(),e.stopPropagation();return}if(st){if(e.key===`Escape`)N.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=Gd(n,B);ne.current=L<0||n==null?null:Math.max(0,Math.min(L*s-n.scrollTop,Math.max(0,r-s))),N.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;Ce(`focus`),ge(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&Xf(e)){t.openSearch(e.key),ge(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=qe&&Qf(e),r=$f(e,qe),i=r&&S.current!=null?Wd(S.current):null,a=r?new Set(sp(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==I&&a.has(o)){let e=C.current;Ie(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=Jf(p)?p:null,h=u!=null&&(Ct.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=op(u,T.current,w.current);e==null||n==null?y=!1:Nt(e,u)}else if((e.ctrlKey||e.metaKey)&&Yf(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;Ce(`focus`);let b=t.getFocusedPath(),x=b!=null&&(Ct.has(b)||a.has(b)),ee=g&&b!==u,E=n&&c&&o===u&&b===u;if((h||E)&&b!=null&&(ee&&x||E))Ie(b,v?.scrollTop??null),A.current=!0,ve(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(Le(b,lp(S.current,v,i,u,s,St,B)),A.current=!0,ve(e=>e===b?e:b)):Fe()}ge(e=>e+1),e.preventDefault(),e.stopPropagation()};xf(()=>{if(!(!f||!st)){if(Re.current){Re.current=!1;return}Ud(ee.current)}},[st,f]),xf(()=>{let e=x.current;switch(Qd({hasRenderedInput:e!=null,previousRenamingPath:M.current,renamingPath:at})){case`reset`:M.current=null;return;case`reveal-canonical`:at!=null&&V(at,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(ke.current=null,M.current=at,Ud(e),e.select());return}},[vt.end,vt.start,at,V,Ct]),xf(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=Wd(e)?.dataset.itemPath??null;ve(e=>e===t?e:t)},i=()=>{n(),A.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,Wd(e)!=null){r();return}A.current=!1,ve(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),A.current=!1,ve(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;ve(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),xf(()=>{let e=S.current;e!=null&&(z.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[z.physical.scrollTop]),xf(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;te.current=Gd(n,g);let a=()=>{let e=t.getVisibleCount(),r=Kd(te.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),We(Ff({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!O.current){O.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=Kd(te.current,g),i=t.getVisibleRows(e,e)[0]??null;Jd(n,e,s,r,h&&i!=null?Math.max(0,Math.min(i.ancestorPaths.length*s,Math.max(0,r-s))):0)}}E.current=a;let o=!1,l=t.subscribe(()=>{o?ge(e=>e+1):o=!0,a()}),u=()=>{Pe.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,Te(e=>e+1),e=null},50))},d=null,f=()=>{i!=null&&delete i.dataset.overlayReveal,d!=null&&(clearTimeout(d),d=null)},p=()=>{i==null||Pe.current===!0||n.scrollTop>0||(i.dataset.overlayReveal=`true`,d!=null&&clearTimeout(d),d=setTimeout(()=>{f()},200))},m=()=>{if(a(),n.scrollTop>0&&f(),Oe.current!=null&&y.current&&At.current(),Pe.current===!0){y.current=!1;return}ye(e=>e==null?e:null),u()},_=()=>{u(),p()},v=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),x=e=>{v.has(e.key)&&_()};n.addEventListener(`scroll`,m,{passive:!0}),n.addEventListener(`wheel`,_,{passive:!0}),n.addEventListener(`touchmove`,_,{passive:!0}),n.addEventListener(`keydown`,x);let ee=typeof ResizeObserver<`u`?new ResizeObserver(e=>{te.current=(e[0]==null?null:qd(e[0]))??Gd(n,g),a()}):null;return ee?.observe(n),()=>{E.current=()=>{},l(),n.removeEventListener(`scroll`,m),n.removeEventListener(`wheel`,_),n.removeEventListener(`touchmove`,_),n.removeEventListener(`keydown`,x),e!=null&&clearTimeout(e),d!=null&&clearTimeout(d),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,te.current=null,ee?.disconnect()}},[t,g,s,c,h]),xf(()=>{qe||F==null||jt(!1)},[jt,qe,F]);let Zt=Sf(()=>F==null?null:`${F.path}::${F.source}`,[F]);xf(()=>{if(Zt==null){m?.clearSlotContent(Na);return}let t=Oe.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??np(n.getBoundingClientRect()),close:e=>{At.current(e?.restoreFocus??!0)},restoreFocus:()=>{kt.current&&Ot.current(Oe.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(Na,i),e?.contextMenu?.onOpen?.(t.item,r),hp(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&hp(i)}),()=>{m?.clearSlotContent(Na)}},[Zt,e?.contextMenu,m]),xf(()=>{F!=null&&t.getItem(F.path)==null&&jt()},[jt,F,t]),xf(()=>{if(F==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(tp(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&jt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),jt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[jt,F]),xf(()=>{let e=C.current,n=S.current;if(e==null||n==null){j.current=I;return}let r=I==null?null:w.current.get(I)??null,i=Wd(n),a=i?.dataset.itemPath??null,o=ot&&x.current===i,c=f&&ee.current===i,l=N.current&&!st,u=ne.current??0,d=ke.current,p=Ae.current,m=je.current,g=Me.current,_=i!=null,v=A.current||_,y=j.current!==I,b=p!=null&&p===I&&I!=null,T=!1,te=!1;if(lt!=null&<.id!==D.current){D.current=lt.id;let n=lt.visibleIndex,r=t.getVisibleRows(n,n)[0]??null;if(r!=null){let t=h?Math.max(0,Math.min(r.ancestorPaths.length*s,Math.max(0,B-s))):St;T=!0,te=Yd(e,n,s,B,xt,lt.offset,t)}t.clearScrollRequest(lt.id)}let O=!T&&l&&Xd(e,L,s,B,xt,u),k=!T&&d!=null&&d===I&&Xd(e,L,s,B,xt,St),M=!T&&m!=null&&m.path===I&&Xd(e,L,s,B,xt,m.viewportOffset),re=!T&&g!=null&&g.path===I&&e.scrollTop!==g.scrollTop;if(re&&(e.scrollTop=g.scrollTop),(re||te||k||M||O||v&&y&&d!==I&&!b&&Jd(e,L,s,B,St))&&E.current(),T){j.current=I;return}if(!v){j.current=I;return}if(o){j.current=I;return}if(c&&!l){j.current=I;return}if(r==null){l&&L>=0&&(Xd(e,L,s,B,xt,u),E.current()),j.current=I;return}(y||l||d===I||p===I||m?.path===I||g?.path===I||a==null||a!==I)&&(Ud(r),d===I&&(ke.current=null),p===I&&(Ae.current=null),m?.path===I&&(je.current=null),g?.path===I&&(Me.current=null),N.current=!1,ne.current=null),j.current=I},[t,L,I,wt,s,ot,st,vt,B,f,lt,h,St,xt,_t]);let Qt=L>=0&&L>=z.visible.startIndex&&L<=z.visible.endIndex,$t=I!=null&&yt.some(e=>Mf(e.row)===I),en=Qt||$t,tn=Ye&&A.current===!0&&en?I:null,nn=Se===`pointer`?P:null,rn=F?.path??Ne.current??nn??tn??P,an=F?.source===`right-click`;xf(()=>{y.current&&F==null||Mt(tt(rn))},[F,tt,vt,B,we,yt,rn,Mt,_t]);let on=Cf(e=>{if(y.current||tp(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&&Ce(e=>e===`pointer`?e:`pointer`),ye(e=>e===i?e:i)},[]),sn=Cf(()=>{ye(null)},[]);xf(()=>{if(!ut)return;let e=()=>{Ht(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),Ht(),t.cancelDrag()}},[t,ut]);let cn=e=>{if(!ut||t.getDragSession()==null||ue.current)return;let n=Hf(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Wt(t.getDragSession()?.target??null),Kt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},ln=e=>{if(!ut||t.getDragSession()==null||ue.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Rt(),Bt(),t.setDragTarget(null))},un=e=>{!ut||t.getDragSession()==null||ue.current||(e.preventDefault(),Ut(e.clientX,e.clientY),t.completeDrag(),zt(),Rt(),Bt(),ce.current=null)},dn=z.window.height,fn=z.window.offsetTop,pn=Math.min(0,B-dn),mn=Math.min(0,B-dn-St),hn=_e===I||N.current,gn=I!=null&&hn&&!wt&&L>=0?_t[L]??t.getVisibleRows(L,L)[0]??null:null,_n=gn==null?null:Zd(L,s,vt,dn),vn=ce.current,yn=pt!=null&&vn!=null&&vn.path===pt&&vn.index>=vt.start&&vn.index<=vt.end,bn=pt!=null&&vn!=null&&vn.path===pt&&!yn&&vn.path!==gn?.path?vn:null,xn=bn==null?null:Zd(bn.index,s,vt,dn),Sn=Zf((L>=0?_t[L]??t.getVisibleRows(L,L)[0]??null:null)?.ancestorPaths.at(-1)??null),Cn=st&&I!=null?fp(o,I,!wt):void 0,wn=F?.path??(st?I:_e),Tn=F?.path??P,En=tt(rn),Dn=qe&&Ye&&!an&&!ot&&En!=null&&be!=null&&rn!=null,On=qe&&(Dn||F!=null),kn=F?.anchorRect,An=kn==null&&En!=null&&be!=null&&(F!=null||Dn)?be:null,jn=kn==null?An==null?void 0:{top:`${An}px`}:{left:`${kn.left}px`,position:`fixed`,right:`auto`,top:`${kn.top}px`},Mn=an?{opacity:`0`}:void 0,Nn=Cf((e,n,r,i)=>{let a=tf({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:st,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c);break}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=z.visible.startIndex&&n.index<=z.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(A.current=!0,ve(e=>e===c?e:c),Ce(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&V(c,{targetOffset:`sticky-parents`})},[t,st,z.visible.endIndex,z.visible.startIndex,V]),Pn=()=>{if(y.current||!Ye||rn==null||En==null)return;let e=t.getItem(rn);e!=null&&(Mt(En),kt.current=!0,De({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:En.getAttribute(`aria-label`)??rn,path:e.getPath()},path:e.getPath(),source:`button`}))},Fn={contextHoverPath:Tn,contextMenuButtonTriggerEnabled:Ye,contextMenuButtonVisibility:Xe,contextMenuEnabled:qe,contextMenuRightClickEnabled:Ze,contextMenuTriggerMode:Je,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:ut,draggedPathSet:R,dragTarget:ft,gitLaneActive:nt,gitStatusByPath:n,handleRowDragEnd:Jt,handleRowDragStart:qt,handleRowTouchStart:Yt,ignoredGitDirectories:r,ignoredInheritanceCache:he,instanceId:o,itemHeight:s,onKeyDown:Xt,onRowClick:Nn,openContextMenuForRow:Nt,registerButton:Qe,registerRenameInput:et,renameView:it,renderDecorationForRow:Tt,resolveIcon:rt,shouldSuppressContextMenu:Ft,visualFocusPath:wn},H={...Fn,registerButton:$e};return Q(`div`,{ref:S,id:mt,"data-file-tree-context-menu-button-visibility":qe&&Ye?Xe:void 0,"data-file-tree-context-menu-trigger-mode":qe?Je:void 0,"data-file-tree-has-context-menu-action-lane":qe&&Ye?`true`:void 0,"data-file-tree-has-git-lane":nt?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:ut?ln:void 0,onDragOver:ut?cn:void 0,onDrop:ut?un:void 0,onKeyDown:Xt,onPointerLeave:qe?sn:void 0,onPointerOver:qe?on:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[Q(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:Sn}}),Q(`slot`,{name:Ma,"data-type":`header-slot`}),f?Q(`div`,{"data-file-tree-search-container":!0,"data-open":st?`true`:`false`,children:Q(`input`,{ref:ee,"aria-activedescendant":Cn,"aria-controls":mt,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":ze?`true`:void 0,value:ct,onBlur:()=>{d===`retain`&&!Ve.current||t.closeSearch()},onFocus:He,onPointerDown:He,onInput:e=>{He();let n=e.currentTarget;t.setSearch(n.value)}})}):null,Q(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&Ge&&yt.length>0?Q(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:Q(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${ht}px`},children:yt.map((e,t)=>_p(H,e.row,`sticky:${Mf(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${yt.length-t}`}}))})}):null,Q(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${xt}px`},children:[Q(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${fn}px`}}),Q(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${dn}px`,top:`${pn}px`,bottom:`${mn}px`},children:[vp(Fn,vt,Ct),gn!=null&&_n!=null?_p(Fn,gn,`parked:${gn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:pt===gn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${_n}px`}}):null,bn!=null&&xn!=null?_p(Fn,bn,`parked-drag:${bn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${xn}px`}}):null]})]})]}),qe?Q(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":On?`true`:`false`,style:jn,children:[Q(`button`,{ref:v,type:`button`,"data-type":Pa,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":F==null?`false`:`true`,"data-visible":Dn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),F!=null){jt();return}Pn()},tabIndex:-1,style:Mn,children:Q(fd,{...rt(`file-tree-icon-ellipsis`)})}),F==null?null:Q(`slot`,{name:Na})]}):null,F==null?null:Q(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),jt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),jt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var bp={hydrateRoot:(e,t)=>{sd(Lu(yp,t),e)},renderRoot:(e,t)=>{od(Lu(yp,t),e)},unmountRoot:e=>{od(null,e)}};function xp(e,t){bp.renderRoot(e,t)}function Sp(e,t){bp.hydrateRoot(e,t)}function Cp(e){bp.unmountRoot(e)}var wp=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)}}},Tp=`__c`,Ep=`__k`,Dp=`__d`,Op=`__s`,kp=/[\s\n\\/='"\0<>]/,Ap=/^(xlink|xmlns|xml)([A-Z])/,jp=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,Mp=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,Np=new Set([`draggable`,`spellcheck`]);function Pp(e){e.__g===void 0?e[Dp]=!0:e.__g|=8}function Fp(e){e.__g===void 0?e[Dp]=!1:e.__g&=-9}function Ip(e){return e.__g===void 0?!0===e[Dp]:!!(8&e.__g)}var Lp=/["&<]/;function Rp(e){if(e.length===0||!1===Lp.test(e))return e;for(var t=0,n=0,r=``,i=``;n<e.length;n++){switch(e.charCodeAt(n)){case 34:i=`"`;break;case 38:i=`&`;break;case 60:i=`<`;break;default:continue}n!==t&&(r+=e.slice(t,n)),r+=i,t=n+1}return n!==t&&(r+=e.slice(t,n)),r}var zp={},Bp=new Set(`animation-iteration-count.border-image-outset.border-image-slice.border-image-width.box-flex.box-flex-group.box-ordinal-group.column-count.fill-opacity.flex.flex-grow.flex-negative.flex-order.flex-positive.flex-shrink.flood-opacity.font-weight.grid-column.grid-row.line-clamp.line-height.opacity.order.orphans.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.widows.z-index.zoom`.split(`.`)),Vp=/[A-Z]/g;function Hp(e){var t=``;for(var n in e){var r=e[n];if(r!=null&&r!==``){var i=n[0]==`-`?n:zp[n]||(zp[n]=n.replace(Vp,`-$&`).toLowerCase()),a=`;`;typeof r!=`number`||i.startsWith(`--`)||Bp.has(i)||(a=`px;`),t=t+i+`:`+r+a}}return t||void 0}function Up(){this.__d=!0}function Wp(e,t){return{__v:e,context:t,props:e.props,setState:Up,forceUpdate:Up,__d:!0,__h:[]}}function Gp(e,t,n){if(!e.s){if(n instanceof Kp){if(!n.s)return void(n.o=Gp.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(Gp.bind(null,e,t),Gp.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}var Kp=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{Gp(r,1,a(this.v))}catch(e){Gp(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?Gp(r,1,t?t(i):i):n?Gp(r,1,n(i)):Gp(r,2,i)}catch(e){Gp(r,2,e)}},r},e}(),qp,Jp,Yp,Xp,Zp={},Qp=Array.isArray,$p=Object.assign,em=``,tm=`<!--$s-->`,nm=`<!--/$s-->`;function rm(e,t){var n,r=e.type,i=!0;return e[Tp]?(i=!1,(n=e[Tp]).state=n[Op]):n=new r(e.props,t),e[Tp]=n,n.__v=e,n.props=e.props,n.context=t,Pp(n),n.state??=Zp,n[Op]??(n[Op]=n.state),r.getDerivedStateFromProps?n.state=$p({},n.state,r.getDerivedStateFromProps(n.props,n.state)):i&&n.componentWillMount?(n.componentWillMount(),n.state=n[Op]===n.state?n.state:n[Op]):!i&&n.componentWillUpdate&&n.componentWillUpdate(),Yp&&Yp(e),n.render(n.props,n.state,t)}function im(e,t,n,r,i,a,o){if(e==null||!0===e||!1===e||e===em)return em;var s=typeof e;if(s!=`object`)return s==`function`?em:s==`string`?Rp(e):e+em;if(Qp(e)){var c,l=em;i[Ep]=e;for(var u=e.length,d=0;d<u;d++){var f=e[d];if(f!=null&&typeof f!=`boolean`){var p,m=im(f,t,n,r,i,a,o);typeof m==`string`?l+=m:(c||=Array(u),l&&c.push(l),l=em,Qp(m)?(p=c).push.apply(p,m):c.push(m))}}return c?(l&&c.push(l),c):l}if(e.constructor!==void 0)return em;e.__=i,qp&&qp(e);var h=e.type,g=e.props;if(typeof h==`function`){var _,v,y,b=t;if(h===zu){if(`tpl`in g){for(var x=em,S=0;S<g.tpl.length;S++)if(x+=g.tpl[S],g.exprs&&S<g.exprs.length){var C=g.exprs[S];if(C==null)continue;typeof C!=`object`||C.constructor!==void 0&&!Qp(C)?x+=C:x+=im(C,t,n,r,e,a,o)}return x}if(`UNSTABLE_comment`in g)return`<!--`+Rp(g.UNSTABLE_comment)+`-->`;v=g.children}else{if((_=h.contextType)!=null){var ee=t[_.__c];b=ee?ee.props.value:_.__}var w=h.prototype&&typeof h.prototype.render==`function`;if(w)v=rm(e,b),y=e[Tp];else{e[Tp]=y=Wp(e,b);for(var T=0;Ip(y)&&T++<25;){Fp(y),Yp&&Yp(e);try{v=h.call(y,g,b)}catch(t){throw a&&t&&typeof t.then==`function`&&(e._suspended=!0),t}}Pp(y)}if(y.getChildContext!=null&&(t=$p({},t,y.getChildContext())),w&&Z.errorBoundaries&&(h.getDerivedStateFromError||y.componentDidCatch)){v=v!=null&&v.type===zu&&v.key==null&&v.props.tpl==null?v.props.children:v;try{return im(v,t,n,r,e,a,!1)}catch(i){return h.getDerivedStateFromError&&(y[Op]=h.getDerivedStateFromError(i)),y.componentDidCatch&&y.componentDidCatch(i,Zp),Ip(y)?(v=rm(e,t),(y=e[Tp]).getChildContext!=null&&(t=$p({},t,y.getChildContext())),im(v=v!=null&&v.type===zu&&v.key==null&&v.props.tpl==null?v.props.children:v,t,n,r,e,a,o)):em}finally{Jp&&Jp(e),Xp&&Xp(e)}}}v=v!=null&&v.type===zu&&v.key==null&&v.props.tpl==null?v.props.children:v;try{var E=im(v,t,n,r,e,a,o);return Jp&&Jp(e),Z.unmount&&Z.unmount(e),e._suspended?typeof E==`string`?tm+E+nm:Qp(E)?(E.unshift(tm),E.push(nm),E):E.then(function(e){return tm+e+nm}):E}catch(i){if(!a&&o&&o.onError){var te=function i(s){return o.onError(s,e,function(e,s){try{return im(e,t,n,r,s,a,o)}catch(e){return i(e)}})}(i);if(te!==void 0)return te;var D=Z.__e;return D&&D(i,e),em}if(!a||!i||typeof i.then!=`function`)throw i;return i.then(function i(){try{var s=im(v,t,n,r,e,a,o);return e._suspended?tm+s+nm:s}catch(e){if(!e||typeof e.then!=`function`)throw e;return e.then(i)}})}}var O,k=`<`+h,A=em;for(var j in g){var M=g[j];if(typeof(M=om(M)?M.value:M)!=`function`||j===`class`||j===`className`){switch(j){case`children`:O=M;continue;case`key`:case`ref`:case`__self`:case`__source`:continue;case`htmlFor`:if(`for`in g)continue;j=`for`;break;case`className`:if(`class`in g)continue;j=`class`;break;case`defaultChecked`:j=`checked`;break;case`defaultSelected`:j=`selected`;break;case`defaultValue`:case`value`:switch(j=`value`,h){case`textarea`:O=M;continue;case`select`:r=M;continue;case`option`:r!=M||`selected`in g||(k+=` selected`)}break;case`dangerouslySetInnerHTML`:A=M&&M.__html;continue;case`style`:typeof M==`object`&&(M=Hp(M));break;case`acceptCharset`:j=`accept-charset`;break;case`httpEquiv`:j=`http-equiv`;break;default:if(Ap.test(j))j=j.replace(Ap,`$1:$2`).toLowerCase();else{if(kp.test(j))continue;j[4]!==`-`&&!Np.has(j)||M==null?n?Mp.test(j)&&(j=j===`panose1`?`panose-1`:j.replace(/([A-Z])/g,`-$1`).toLowerCase()):jp.test(j)&&(j=j.toLowerCase()):M+=em}}M!=null&&!1!==M&&(k=!0===M||M===em?k+` `+j:k+` `+j+`="`+(typeof M==`string`?Rp(M):M+em)+`"`)}}if(kp.test(h))throw Error(h+` is not a valid HTML tag name in `+k+`>`);if(A||(typeof O==`string`?A=Rp(O):O!=null&&!1!==O&&!0!==O&&(A=im(O,t,h===`svg`||h!==`foreignObject`&&n,r,e,a,o))),Jp&&Jp(e),Xp&&Xp(e),!A&&am.has(h))return k+`/>`;var N=`</`+h+`>`,ne=k+`>`;return Qp(A)?[ne].concat(A,[N]):typeof A==`string`?ne+A+N:[ne,A,N]}var am=new Set([`area`,`base`,`br`,`col`,`command`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function om(e){return typeof e==`object`&&!!e&&typeof e.peek==`function`&&`value`in e}var sm=0;function cm(e){return e!=null&&e.length>0?e:(sm+=1,`pst_ft_${sm}`)}function lm({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??Ua)}function um(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 dm(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 fm(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var pm=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new wp;#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=cm(a),this.#p=xu(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=Ha(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new gu({...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&&(Cp(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){this.#t.resetPaths(e,t)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),xp(t.wrapper,this.#w()))}setGitStatus(e){this.#p=xu(e,this.#p);let t=this.#T();t!=null&&xp(t.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),xp(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),Sp(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),xp(r,this.#w())}#C(){return{initialViewportHeight:lm({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(Ma,e());return}this.#l.setSlotHtml(Ma,this.#e?.header?.html??null)}#k(e){let t=fm(e).find(e=>dm(e)),n=um(ke(Ne(this.#m).set));n!=null&&(t!=null&&t.outerHTML===n.outerHTML||(t==null?e.prepend(n):t.replaceWith(n)))}#A(e){let t=fm(e),n=t.find(e=>dm(e)),r=t.filter(e=>e!==n),i=Ne(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=um(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=Ne(this.#m);t.colored&&Ae(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${Oa}]`);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(Oa,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=qa(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 $a(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)}};function mm(e){let[t]=(0,R.useState)(()=>new pm(e)),n=(0,R.useRef)({timeout:null,model:t});return(0,R.useEffect)(()=>{let{current:e}=n;return e.timeout!=null&&(clearTimeout(e.timeout),e.timeout=null),()=>{e.timeout=setTimeout(()=>e.model.cleanUp(),1)}},[]),{model:t}}function hm(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!Object.is(e[n],t[n]))return!1;return!0}function gm(e,t,n){return Object.is(e,t)||n?.(e,t)===!0}function _m(e,t,n){let r=(0,R.useRef)({hasValue:!1,model:null,selector:null,value:void 0}),i=(0,R.useCallback)(t=>e.subscribe(t),[e]),a=(0,R.useCallback)(()=>{let i=r.current,a=t(e);if(i.model!==e||i.selector!==t||!i.hasValue)return i.hasValue=!0,i.model=e,i.selector=t,i.value=a,a;let o=i.value;return gm(o,a,n)?o:(i.value=a,a)},[n,e,t]);return(0,R.useSyncExternalStore)(i,a,a)}function vm(e,t){return e.isOpen===t.isOpen&&e.value===t.value&&hm(e.matchingPaths,t.matchingPaths)}function ym(e){let t=_m(e,e=>({isOpen:e.isSearchOpen(),matchingPaths:e.getSearchMatchingPaths(),value:e.getSearchValue()}),vm);return(0,R.useMemo)(()=>({...t,close:()=>{e.closeSearch()},focusNextMatch:()=>{e.focusNextSearchMatch()},focusPreviousMatch:()=>{e.focusPreviousSearchMatch()},open:t=>{e.openSearch(t)},setValue:t=>{e.setSearch(t)}}),[e,t])}var bm=i(),xm=e=>{if(typeof e!=`object`||!e)return null;let t=e;return typeof t.getAttribute==`function`?t.getAttribute(`data-item-path`):null};function Sm(e){let t=[],n=[];return{isDragInProgress:()=>n.length>0,handleSelectionChange(e){t=e},handleDragStart(e){if(e.dataTransfer===null)return;let r=null;for(let t of e.composedPath())if(r=xm(t),r!==null)break;if(r===null)return;let i=t.includes(r)?t:[r],a=i.map(e=>We(e)).filter(e=>e!==null);a.length!==0&&(n=i,e.dataTransfer.setData(qe,a.join(` `)))},handleDragEnd(){if(n.length!==0){for(let t of n)e.deselect(t);n=[]}}}}function Cm(e){return typeof e!=`object`||!e||!(`isDirectory`in e)||typeof e.isDirectory!=`function`||!e.isDirectory()||!(`isExpanded`in e)||typeof e.isExpanded!=`function`||!(`expand`in e)||typeof e.expand!=`function`||!(`collapse`in e)||typeof e.collapse!=`function`?null:e}function wm(e,t){return t.length>0&&t.every(t=>{let n=Cm(e.getItem(t));return n!==null&&n.isExpanded()})}function Tm(e,t,n){for(let r of t){let t=Cm(e.getItem(r));t===null||t.isExpanded()===n||(n?t.expand():t.collapse())}}var Em=`
|
|
2180
|
-
:host {
|
|
2181
|
-
--trees-bg-override: transparent;
|
|
2182
|
-
--trees-selected-bg-override: color-mix(in srgb, currentColor 12%, transparent);
|
|
2183
|
-
--trees-hover-bg-override: color-mix(in srgb, currentColor 7%, transparent);
|
|
2184
|
-
--trees-border-color-override: color-mix(in srgb, currentColor 14%, transparent);
|
|
2185
|
-
--trees-font-family-override: var(--font-sans);
|
|
2186
|
-
--trees-font-size-override: 12px;
|
|
2187
|
-
}
|
|
2188
|
-
button[data-type='item'] { border-radius: 5px; }
|
|
2189
|
-
`;function Dm(e){return e.kind===`directory`?`${e.path}/`:e.path}function Om(e){let t=(0,bm.c)(14),n;t[0]===e.onRefresh?n=t[1]:(n=(0,V.jsx)(u,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":`Refresh workspace files`,onClick:e.onRefresh}),t[0]=e.onRefresh,t[1]=n);let r=e.isPending&&`animate-spin`,i;t[2]===r?i=t[3]:(i=d(r),t[2]=r,t[3]=i);let a;t[4]===i?a=t[5]:(a=(0,V.jsx)(ne,{className:i}),t[4]=i,t[5]=a);let o;t[6]!==n||t[7]!==a?(o=(0,V.jsx)(S,{render:n,children:a}),t[6]=n,t[7]=a,t[8]=o):o=t[8];let s=e.isPending?`Refreshing…`:`Refresh files`,c;t[9]===s?c=t[10]:(c=(0,V.jsx)(E,{children:s}),t[9]=s,t[10]=c);let l;return t[11]!==o||t[12]!==c?(l=(0,V.jsxs)(w,{children:[o,c]}),t[11]=o,t[12]=c,t[13]=l):l=t[13],l}function km(e){let t=(0,bm.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):(n=t=>e.onValueChange(t.target.value),r=t=>{t.key===`Escape`&&(e.onClose(),t.currentTarget.blur())},t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==e.ariaLabel||t[4]!==e.name||t[5]!==e.value||t[6]!==n||t[7]!==r?(i=(0,V.jsx)(M,{variant:`ghost`,className:`h-7 min-w-0 flex-1`,children:(0,V.jsx)(O,{type:`search`,name:e.name,size:`sm`,value:e.value,"aria-label":e.ariaLabel,placeholder:`Search files`,spellCheck:!1,onChange:n,onKeyDown:r})}),t[3]=e.ariaLabel,t[4]=e.name,t[5]=e.value,t[6]=n,t[7]=r,t[8]=i):i=t[8],i}function Am({environmentId:e,cwd:t,projectName:n,selectedPath:r,selectedPathRevealId:i,onOpenFile:a,onRefreshSelectedFile:o,workspaceMutationId:s}){let{resolvedTheme:c}=g(),l=Ge(),d=lt(e,t),f=d.data?.entries??[],p=(0,R.useMemo)(()=>new Map(f.map(e=>[e.path,e.kind])),[f]),m=(0,R.useRef)(p),h=(0,R.useMemo)(()=>f.map(Dm),[f]),_=(0,R.useMemo)(()=>f.filter(e=>e.kind===`directory`).map(Dm),[f]),v=(0,R.useRef)([]),y=(0,R.useRef)(!1),x=(0,R.useRef)(null),ee=(0,R.useRef)(null),te=(0,R.useRef)(null);(0,R.useEffect)(()=>{let e=e=>{te.current={x:e.clientX,y:e.clientY,at:e.timeStamp}};return document.addEventListener(`contextmenu`,e,!0),()=>document.removeEventListener(`contextmenu`,e,!0)},[]);let D=async(e,t)=>{let n=b();if(!n){t.close();return}let r=e.path.replace(/\/$/,``),i=He(r),a=te.current,o=a!==null&&performance.now()-a.at<1e3,s=t.anchorElement.getBoundingClientRect(),c=o?{x:a.x,y:a.y}:{x:s.left,y:s.bottom};try{let e=await n.contextMenu.show([{id:`copy-mention`,label:`Copy mention`},{id:`add-to-chat`,label:`Add to chat`}],c);if(e===`copy-mention`){try{await C(i),T.add({type:`success`,title:`Mention copied`,description:r})}catch(e){T.add({type:`error`,title:`Failed to copy mention`,description:e instanceof Error?e.message:`An error occurred.`})}return}if(e===`add-to-chat`){let e=l?.current;if(!e){T.add({type:`error`,title:`Unable to add to chat`,description:`Open a chat for this project and try again.`});return}e.insertTextAtEnd(`${i} `,{ensureLeadingBoundary:!0})||T.add({type:`error`,title:`Unable to add to chat`,description:`The chat isn't ready to accept input right now.`})}}finally{t.close()}},O=(0,R.useRef)(D);(0,R.useEffect)(()=>{O.current=D});let k=(0,R.useRef)(null),A=(0,R.useMemo)(()=>Sm({deselect:e=>k.current?.getItem(e)?.deselect()}),[]),{model:j}=mm({composition:{contextMenu:{triggerMode:`right-click`,onOpen:(e,t)=>{O.current(e,t)}}},dragAndDrop:{canDrop:()=>!1},density:`compact`,fileTreeSearchMode:`hide-non-matches`,flattenEmptyDirectories:!0,initialExpansion:1,icons:je,onSelectionChange:e=>{if(A.handleSelectionChange(e),y.current||A.isDragInProgress())return;let t=e.at(-1)?.replace(/\/$/,``);t&&m.current.get(t)===`file`&&(x.current=t,a(t))},paths:[],search:!1,unsafeCSS:Em}),M=ym(j),N=_m(j,e=>wm(e,_)),ne=()=>{Tm(j,_,!N)},re=e=>{if(e.trim().length===0){M.close();return}M.setValue(e)},ie=()=>{d.refresh(),o?.()};Xe({mutationId:s,refresh:d.refresh,resourceKey:`files:${e}:${t}`}),(0,R.useEffect)(()=>{v.current!==h&&(m.current=p,v.current=h,j.resetPaths(h))},[p,j,h]),(0,R.useEffect)(()=>{if(!r){ee.current=null;return}let e={path:r,revealId:i},t=ee.current;if(t?.path===e.path&&t.revealId===e.revealId||p.get(r)!==`file`)return;let n=j.getItem(r);if(!n)return;if(j.getSelectedPaths().some(e=>e.replace(/\/$/,``)===r)&&x.current===r){x.current=null,ee.current=e;return}x.current=null,ee.current=e,y.current=!0,j.closeSearch();for(let e of j.getSelectedPaths())j.getItem(e)?.deselect();let a=r.split(`/`),o=``;for(let e of a.slice(0,-1)){o=o?`${o}/${e}`:e;let t=j.getItem(`${o}/`)??j.getItem(o);t&&`expand`in t&&t.expand()}n.select(),j.scrollToPath(r,{focus:!0,offset:`center`}),queueMicrotask(()=>{y.current=!1})},[p,j,r,i,h]);let ae=(0,R.useRef)(null);return(0,R.useEffect)(()=>{k.current=j},[j]),(0,R.useEffect)(()=>{let e=ae.current;if(e===null)return;let t=e=>A.handleDragStart(e),n=()=>A.handleDragEnd();return e.addEventListener(`dragstart`,t,!0),e.addEventListener(`dragend`,n),()=>{e.removeEventListener(`dragstart`,t,!0),e.removeEventListener(`dragend`,n)}},[A]),(0,V.jsxs)(`div`,{ref:ae,className:`flex min-h-0 flex-1 flex-col bg-background`,"data-file-browser-panel":`${e}:${t}`,children:[(0,V.jsxs)(`div`,{className:`flex h-10 min-h-10 shrink-0 items-center gap-1 border-b border-border/60 bg-background px-2 in-data-[preview-panel-mode=inline]:mb-1 in-data-[preview-panel-mode=inline]:h-9 in-data-[preview-panel-mode=inline]:min-h-9 in-data-[preview-panel-mode=inline]:border-b-transparent`,"data-surface-subheader":!0,children:[(0,V.jsx)(Om,{isPending:d.isPending,onRefresh:ie}),(0,V.jsx)(km,{name:`project-files-search`,ariaLabel:`Search ${n} files`,value:M.value,onValueChange:re,onClose:M.close}),_.length>0?(0,V.jsxs)(w,{children:[(0,V.jsx)(S,{render:(0,V.jsx)(u,{type:`button`,size:`icon-xs`,variant:`ghost`,"aria-label":N?`Collapse all folders`:`Expand all folders`,onClick:ne}),children:N?(0,V.jsx)(_e,{className:`size-3.5`}):(0,V.jsx)(pe,{className:`size-3.5`})}),(0,V.jsx)(E,{children:N?`Collapse all folders`:`Expand all folders`})]}):null]}),d.error&&d.data===null?(0,V.jsx)(`div`,{className:`p-4 text-xs leading-relaxed text-destructive`,children:d.error}):(0,V.jsx)(Ba,{model:j,"aria-label":`${n} files`,className:`min-h-0 flex-1 overflow-hidden`,style:{colorScheme:c,"--trees-fg-override":`var(--contrast-foreground)`}})]})}function jm(e){let t=(0,bm.c)(14),n;t[0]===e.relativePath?n=t[1]:(n=e.relativePath.lastIndexOf(`/`),t[0]=e.relativePath,t[1]=n);let r;t[2]===e.relativePath?r=t[3]:(r=e.relativePath.lastIndexOf(`\\`),t[2]=e.relativePath,t[3]=r);let i=Math.max(n,r),a;t[4]!==i||t[5]!==e.cwd||t[6]!==e.relativePath?(a=i>=0?ie(e.relativePath.slice(0,i),e.cwd):e.cwd,t[4]=i,t[5]=e.cwd,t[6]=e.relativePath,t[7]=a):a=t[7];let o=a,s;return t[8]!==o||t[9]!==e.cwd||t[10]!==e.onTaskListChange||t[11]!==e.text||t[12]!==e.threadRef?(s=(0,V.jsx)(Pe,{text:e.text,cwd:e.cwd,imageBaseDir:o,threadRef:e.threadRef,className:`mx-auto max-w-4xl px-6 py-5`,onTaskListChange:e.onTaskListChange}),t[8]=o,t[9]=e.cwd,t[10]=e.onTaskListChange,t[11]=e.text,t[12]=e.threadRef,t[13]=s):s=t[13],s}function Mm({root:e,editor:t,onDismiss:n}){n(),t.setSelections([]);let r=e.querySelector(`diffs-container`)?.shadowRoot?.activeElement;r instanceof HTMLElement&&r.blur()}function Nm(e){return e.querySelector(`diffs-container`)?.shadowRoot?.activeElement?.hasAttribute(`data-content`)===!0}function Pm({root:e,editor:t,isBlocked:n,onDismiss:r}){let i=i=>{n()||i.composedPath().includes(e)||Mm({root:e,editor:t,onDismiss:r})},a=i=>{i.key!==`Escape`||n()||!Nm(e)||(i.preventDefault(),i.stopImmediatePropagation(),Mm({root:e,editor:t,onDismiss:r}))};return document.addEventListener(`pointerdown`,i,!0),document.addEventListener(`keydown`,a,!0),()=>{document.removeEventListener(`pointerdown`,i,!0),document.removeEventListener(`keydown`,a,!0)}}function Fm(e){let t=e.renderedLine===void 0?e.fileTop+e.estimatedLine.top:e.scrollTop+e.renderedLine.top-e.viewportTop,n=e.renderedLine?.height??e.estimatedLine.height,r=Math.max(0,t-Math.max(0,(e.viewportHeight-n)/2));return Math.min(r,Math.max(0,e.scrollHeight-e.viewportHeight))}function Im(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return`${e.length}:${(t>>>0).toString(36)}`}function Lm(e,t,n){return`${e}:${t}:${Im(n)}`}function Rm(e,t,n,r,i){return i?.contents===r&&i.cacheKey?i.cacheKey:`editor:${e}:${Lm(t,n,r)}`}function zm(e,t){let n=t.split(`/`).filter(Boolean);return[{label:e,path:``,kind:`project`},...n.map((e,t)=>({label:e,path:n.slice(0,t+1).join(`/`),kind:t===n.length-1?`file`:`directory`}))]}function Bm(e){let t=(0,bm.c)(13),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,V.jsx)(D,{variant:`icon`,children:(0,V.jsx)(xt,{})}),r=(0,V.jsx)(A,{children:`Can't preview this file`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;t[2]===e.fileName?i=t[3]:(i=(0,V.jsxs)(j,{children:[e.fileName,` isn't a text file, so it can't be shown here.`]}),t[2]=e.fileName,t[3]=i);let a;t[4]!==e.absolutePath||t[5]!==e.environmentId||t[6]!==e.fileName||t[7]!==e.projectId||t[8]!==e.threadRef?(a=e.absolutePath===null?null:(0,V.jsx)(k,{children:(0,V.jsx)(Vm,{projectId:e.projectId,absolutePath:e.absolutePath,environmentId:e.environmentId,fileName:e.fileName,threadRef:e.threadRef})}),t[4]=e.absolutePath,t[5]=e.environmentId,t[6]=e.fileName,t[7]=e.projectId,t[8]=e.threadRef,t[9]=a):a=t[9];let o;return t[10]!==i||t[11]!==a?(o=(0,V.jsxs)(N,{children:[n,r,i,a]}),t[10]=i,t[11]=a,t[12]=o):o=t[12],o}function Vm(e){let t=(0,bm.c)(13),n;t[0]!==e.absolutePath||t[1]!==e.projectId||t[2]!==e.threadRef?(n=e.projectId?{_tag:`project-file`,projectId:e.projectId,path:e.absolutePath}:{_tag:`workspace-file`,threadId:e.threadRef.threadId,path:e.absolutePath},t[0]=e.absolutePath,t[1]=e.projectId,t[2]=e.threadRef,t[3]=n):n=t[3];let r=st(e.environmentId,n);if(r._tag===`Failure`){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`This file can't be downloaded from here.`}),t[4]=e):e=t[4],e}let i=r._tag!==`Success`,a;t[5]!==r._tag||t[6]!==r.url||t[7]!==e.fileName?(a=()=>{if(r._tag!==`Success`)return;let t=document.createElement(`a`);t.href=r.url,t.download=e.fileName,t.click()},t[5]=r._tag,t[6]=r.url,t[7]=e.fileName,t[8]=a):a=t[8];let o;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,V.jsx)(h,{}),t[9]=o):o=t[9];let s;return t[10]!==i||t[11]!==a?(s=(0,V.jsxs)(u,{disabled:i,onClick:a,size:`sm`,variant:`outline`,children:[o,`Download`]}),t[10]=i,t[11]=a,t[12]=s):s=t[12],s}function Hm(e,t,n){return t<0||e[t]!==`[`||!/[ xX]/.test(e[t+1]??``)||e[t+2]!==`]`?e:`${e.slice(0,t+1)}${n?`x`:` `}${e.slice(t+2)}`}var Um=class{options;timer=null;latestContents=``;latestRevision=0;confirmedRevision=0;lastChangeAt=0;saving=!1;disposed=!1;constructor(e){this.options=e}change(e){this.disposed||(this.latestContents=e,this.latestRevision+=1,this.lastChangeAt=Date.now(),this.options.onPendingChange(!0),this.schedule(this.options.debounceMs))}dispose(){this.disposed=!0,this.clearTimer(),this.latestRevision>0&&this.persistLatest()}schedule(e){this.clearTimer(),this.timer=setTimeout(()=>{this.timer=null,this.persistLatest()},e)}clearTimer(){this.timer!==null&&(clearTimeout(this.timer),this.timer=null)}async persistLatest(){if(this.saving||this.latestRevision===this.confirmedRevision)return;this.saving=!0;let e=this.latestContents,t=this.latestRevision,n=(await this.options.persist(e))._tag===`Success`;if(n&&(this.confirmedRevision=t,this.options.onConfirmed(e)),this.saving=!1,t===this.latestRevision){n&&this.options.onPendingChange(!1);return}let r=Math.max(0,this.options.debounceMs-(Date.now()-this.lastChangeAt));this.disposed?this.persistLatest():this.schedule(r)}},Wm=(0,R.lazy)(()=>t(()=>import(`./PdfPreview-CjWrZkCM.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),Gm=(0,R.lazy)(()=>t(()=>import(`./DocxPreview-DHnzhQMX.js`),__vite__mapDeps([8,1,2,3,4,5,9,7,10,11,12]))),Km=(0,R.lazy)(()=>t(()=>import(`./XlsxPreview-BnnrdNes.js`),__vite__mapDeps([13,1,2,3,4,5,7,10,11]))),qm=(0,R.lazy)(()=>t(()=>import(`./PptxPreview-D4YsFq_s.js`),__vite__mapDeps([14,1,2,3,4,5,6,7,10,11]))),Jm=(0,R.lazy)(()=>t(()=>import(`./HtmlPreview-I3xV5YgS.js`),__vite__mapDeps([15,4,1,5,16,17,7])));function Ym(e){let t=(0,bm.c)(13),n;t[0]!==e.absolutePath||t[1]!==e.projectId||t[2]!==e.threadRef?(n=e.projectId?{_tag:`project-file`,projectId:e.projectId,path:e.absolutePath}:{_tag:`workspace-file`,threadId:e.threadRef.threadId,path:e.absolutePath},t[0]=e.absolutePath,t[1]=e.projectId,t[2]=e.threadRef,t[3]=n):n=t[3];let r=st(e.environmentId,n),i;t[4]===e.fileName?i=t[5]:(i=Xm(e.fileName),t[4]=e.fileName,t[5]=i);let a=i;if(a===null)return null;if(r._tag===`Failure`){let e;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center px-6 text-center text-xs leading-relaxed text-destructive`,children:`Unable to load this document.`}),t[6]=e):e=t[6],e}if(r._tag!==`Success`){let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-muted-foreground`,children:(0,V.jsx)(dt,{className:`size-5`})}),t[7]=e):e=t[7],e}let o=a,s;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,V.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-muted-foreground`,children:(0,V.jsx)(dt,{className:`size-5`})}),t[8]=s):s=t[8];let c;return t[9]!==o||t[10]!==r.url||t[11]!==e.fileName?(c=(0,V.jsx)(R.Suspense,{fallback:s,children:(0,V.jsx)(o,{fileName:e.fileName,url:r.url})}),t[9]=o,t[10]=r.url,t[11]=e.fileName,t[12]=c):c=t[12],c}function Xm(e){let t=e.toLowerCase();return t.endsWith(`.pdf`)?Wm:t.endsWith(`.docx`)?Gm:t.endsWith(`.xlsx`)?Km:t.endsWith(`.pptx`)?qm:null}var Zm=`borgcode.fileExplorerOpen`,Qm=`borgcode.renderMarkdown`,$m=`borgcode.renderHtml`,eh=500,th=`data-file-link-reveal`,nh=`
|
|
2190
|
-
${se}
|
|
2191
|
-
|
|
2192
|
-
diffs-container {
|
|
2193
|
-
--diffs-bg: var(--code-background, var(--background)) !important;
|
|
2194
|
-
--diffs-light-bg: var(--code-background, var(--background)) !important;
|
|
2195
|
-
--diffs-dark-bg: var(--code-background, var(--background)) !important;
|
|
2196
|
-
background-color: var(--code-background, var(--background)) !important;
|
|
2197
|
-
color: var(--code-foreground, var(--foreground)) !important;
|
|
2198
|
-
}
|
|
2199
|
-
|
|
2200
|
-
[${th}][data-line] {
|
|
2201
|
-
background-color: light-dark(
|
|
2202
|
-
color-mix(
|
|
2203
|
-
in lab,
|
|
2204
|
-
var(--diffs-computed-diff-line-bg) 82%,
|
|
2205
|
-
var(--diffs-bg-selection-override, var(--diffs-selection-base))
|
|
2206
|
-
),
|
|
2207
|
-
color-mix(
|
|
2208
|
-
in lab,
|
|
2209
|
-
var(--diffs-computed-diff-line-bg) 75%,
|
|
2210
|
-
var(--diffs-bg-selection-override, var(--diffs-selection-base))
|
|
2211
|
-
)
|
|
2212
|
-
) !important;
|
|
2213
|
-
}
|
|
2214
|
-
|
|
2215
|
-
[${th}][data-column-number] {
|
|
2216
|
-
background-color: light-dark(
|
|
2217
|
-
color-mix(
|
|
2218
|
-
in lab,
|
|
2219
|
-
var(--diffs-computed-diff-line-bg) 75%,
|
|
2220
|
-
var(--diffs-bg-selection-number-override, var(--diffs-selection-base))
|
|
2221
|
-
),
|
|
2222
|
-
color-mix(
|
|
2223
|
-
in lab,
|
|
2224
|
-
var(--diffs-computed-diff-line-bg) 60%,
|
|
2225
|
-
var(--diffs-bg-selection-number-override, var(--diffs-selection-base))
|
|
2226
|
-
)
|
|
2227
|
-
) !important;
|
|
2228
|
-
color: var(--diffs-selection-number-fg) !important;
|
|
2229
|
-
}
|
|
2230
|
-
`;function rh(e){let t=(0,bm.c)(13),n;t[0]!==e.absolutePath||t[1]!==e.projectId||t[2]!==e.threadRef?(n=e.projectId?{_tag:`project-file`,projectId:e.projectId,path:e.absolutePath}:{_tag:`workspace-file`,threadId:e.threadRef.threadId,path:e.absolutePath},t[0]=e.absolutePath,t[1]=e.projectId,t[2]=e.threadRef,t[3]=n):n=t[3];let r=st(e.environmentId,n),[i,a]=(0,R.useState)(null),o;t[4]!==r._tag||t[5]!==r.url||t[6]!==e.workspaceMutationId?(o=e.workspaceMutationId===null?``:`${r._tag===`Success`&&r.url.includes(`?`)?`&`:`?`}workspace-revision=${encodeURIComponent(e.workspaceMutationId)}`,t[4]=r._tag,t[5]=r.url,t[6]=e.workspaceMutationId,t[7]=o):o=t[7];let s=o,c=r._tag===`Success`?`${r.url}${s}`:null;if(r._tag===`Failure`||c!==null&&i===c){let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,V.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center px-6 text-center text-xs leading-relaxed text-destructive`,children:`Unable to load workspace image.`}),t[8]=e):e=t[8],e}let l;return t[9]!==r._tag||t[10]!==c||t[11]!==e.alt?(l=r._tag===`Success`&&c!==null?(0,V.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto p-4`,children:(0,V.jsx)(`img`,{className:`max-h-full max-w-full object-contain`,src:c,alt:e.alt,onError:()=>a(c)})}):(0,V.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-muted-foreground`,children:(0,V.jsx)(dt,{className:`size-5`})}),t[9]=r._tag,t[10]=c,t[11]=e.alt,t[12]=l):l=t[12],l}function ih(e,t){let n=1;for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);r===10?n+=1:r===13&&(n+=1,e.charCodeAt(t+1)===10&&(t+=1))}return Math.min(Math.max(1,t),n)}function ah(e,t){let n=e.shadowRoot??e;for(let e of n.querySelectorAll(`[${th}]`))e.removeAttribute(th);t!==null&&(n.querySelector(`[data-line="${t}"]`)?.setAttribute(th,``),n.querySelector(`[data-column-number="${t}"]`)?.setAttribute(th,``))}var oh=30,sh=20,ch=2;function lh(e,t,n){let r=(0,bm.c)(5),[i]=(0,R.useState)(uh),a;return r[0]!==e||r[1]!==t||r[2]!==n||r[3]!==i?(a=(r,a,o)=>{if(e===null)return;let s=i.get(e),c=s??{frameId:null,cancelGuard:null,handledRequestId:null,latestRequestId:null};s||i.set(e,c);let l=()=>{c.frameId!==null&&(cancelAnimationFrame(c.frameId),c.frameId=null),c.cancelGuard?.()};if(o===`unmount`){l();return}let u=a.file?.contents;if(ah(r,t===null||u===void 0?null:ih(u,t)),!(a instanceof it))return;if(c.latestRequestId!==n&&(l(),c.latestRequestId=n,c.handledRequestId=null),t===null){r.style.minHeight=``;return}let d=r.closest(`.file-preview-virtualizer`);if(!d||(r.style.minHeight=`${Math.ceil(Math.max(a.height,d.clientHeight))}px`,c.handledRequestId===n||c.frameId!==null))return;let f=e=>{let t=a.getLinePosition(e);if(!t)return null;let n=d.getBoundingClientRect(),i=d.scrollTop+r.getBoundingClientRect().top-n.top,o=(r.shadowRoot??r).querySelector(`[data-line="${e}"]`)?.getBoundingClientRect();return Fm({scrollTop:d.scrollTop,scrollHeight:d.scrollHeight,viewportTop:n.top,viewportHeight:d.clientHeight,fileTop:i,estimatedLine:t,...o&&o.height>0?{renderedLine:{top:o.top,height:o.height}}:{}})},p=e=>{let t=sh,n=null,r=()=>{n!==null&&(cancelAnimationFrame(n),n=null),d.removeEventListener(`wheel`,r),d.removeEventListener(`touchstart`,r),d.removeEventListener(`pointerdown`,r,!0),window.removeEventListener(`keydown`,r,!0),c.cancelGuard===r&&(c.cancelGuard=null)};d.addEventListener(`wheel`,r,{passive:!0}),d.addEventListener(`touchstart`,r,{passive:!0}),d.addEventListener(`pointerdown`,r,{passive:!0,capture:!0}),window.addEventListener(`keydown`,r,!0);let i=()=>{if(n=null,--t,t<=0||!d.isConnected){r();return}let a=f(e);a!==null&&Math.abs(d.scrollTop-a)>ch&&(d.scrollTop=a),n=requestAnimationFrame(i)};n=requestAnimationFrame(i),c.cancelGuard=r},m=e=>{c.frameId=requestAnimationFrame(()=>{if(c.frameId=null,c.latestRequestId!==n||!r.isConnected)return;let i=a.file?.contents,o=i===void 0?null:ih(i,t),s=o===null?null:f(o);if(o===null||s===null){e<oh&&m(e+1);return}ah(r,o),d.scrollTop=s,c.handledRequestId=n,p(o)})};m(0)},r[0]=e,r[1]=t,r[2]=n,r[3]=i,r[4]=a):a=r[4],a}function uh(){return new Map}function dh(e){let t=(0,bm.c)(19),{environmentId:n,cwd:r,relativePath:i,onPendingChange:a}=e,o=ee(_.writeFile),s;t[0]!==a||t[1]!==i?(s=e=>a(i,e),t[0]=a,t[1]=i,t[2]=s):s=t[2];let c;t[3]!==r||t[4]!==n||t[5]!==i||t[6]!==o?(c=e=>o({environmentId:n,input:{cwd:r,relativePath:i,contents:e}}),t[3]=r,t[4]=n,t[5]=i,t[6]=o,t[7]=c):c=t[7];let l;t[8]!==r||t[9]!==n||t[10]!==i?(l=e=>{ut(n,r,i,e)},t[8]=r,t[9]=n,t[10]=i,t[11]=l):l=t[11];let u;t[12]!==s||t[13]!==c||t[14]!==l?(u=new Um({debounceMs:eh,onPendingChange:s,persist:c,onConfirmed:l}),t[12]=s,t[13]=c,t[14]=l,t[15]=u):u=t[15];let d=u,f,p;return t[16]===d?(f=t[17],p=t[18]):(f=()=>()=>d.dispose(),p=[d],t[16]=d,t[17]=f,t[18]=p),(0,R.useEffect)(f,p),d}function fh(e){let t=(0,bm.c)(76),{environmentId:n,cwd:r,relativePath:i,composerDraftTarget:a,contents:s,resolvedTheme:l,revealRequestId:u,wordWrap:d,onPostRender:f,onPendingChange:p}=e,m=c(yh),h=c(vh),g;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=[],t[0]=g):g=t[0];let[_,v]=(0,R.useState)(g),[y,b]=(0,R.useState)(null),x=y?.revealRequestId===u?y.range:null,S;t[1]===u?S=t[2]:(S=e=>{b({revealRequestId:u,range:e})},t[1]=u,t[2]=S);let C=S,ee=(0,R.useRef)(null),w=(0,R.useRef)(null),T;t[3]!==r||t[4]!==n||t[5]!==p||t[6]!==i?(T={environmentId:n,cwd:r,relativePath:i,onPendingChange:p},t[3]=r,t[4]=n,t[5]=p,t[6]=i,t[7]=T):T=t[7];let E=dh(T),te;t[8]!==m||t[9]!==a||t[10]!==r||t[11]!==n||t[12]!==i||t[13]!==E?(te=new Ta({persistState:!0,persistStateStorage:`inMemory`,onChange:(e,t)=>{if(ct(n,r,i,e.contents),E.change(e.contents),t){let n=Ze(t);v(n);for(let t of n)for(let n of t.metadata.entries)n.kind===`comment`&&m(a,o({id:n.id,filePath:i,startLine:n.startLine,endLine:n.endLine,text:n.text,contents:e.contents}))}}}),t[8]=m,t[9]=a,t[10]=r,t[11]=n,t[12]=i,t[13]=E,t[14]=te):te=t[14];let D=te,O,k;t[15]===D?(O=t[16],k=t[17]):(O=()=>()=>{D.cleanUp()},k=[D],t[15]=D,t[16]=O,t[17]=k),(0,R.useEffect)(O,k);let A;t[18]!==a||t[19]!==h||t[20]!==C?(A=e=>{C(null),h(a,e),v(t=>t.flatMap(t=>{let n=t.metadata.entries.filter(t=>t.id!==e);return n.length>0?[{...t,metadata:{entries:n}}]:[]}))},t[18]=a,t[19]=h,t[20]=C,t[21]=A):A=t[21];let j=A,M;t[22]!==m||t[23]!==a||t[24]!==s||t[25]!==_||t[26]!==i||t[27]!==C?(M=(e,t)=>{C(null);let n=_.flatMap(_h).find(t=>t.id===e);n&&m(a,o({id:n.id,filePath:i,startLine:n.startLine,endLine:n.endLine,text:t,contents:s})),v(n=>n.map(n=>({...n,metadata:{entries:n.metadata.entries.map(n=>n.id===e?{...n,kind:`comment`,text:t}:n)}})))},t[22]=m,t[23]=a,t[24]=s,t[25]=_,t[26]=i,t[27]=C,t[28]=M):M=t[28];let N=M,ne;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(ne=e=>{let{startLine:t,endLine:n}=$e(e),r={id:Qe(),kind:`draft`,startLine:t,endLine:n,text:``};v(e=>{let t=e.flatMap(hh),i=t.findIndex(e=>e.lineNumber===n);return i<0?[...t,{lineNumber:n,metadata:{entries:[r]}}]:t.map((e,t)=>t===i?{...e,metadata:{entries:[...e.metadata.entries,r]}}:e)})},t[29]=ne):ne=t[29];let re=ne,ie;t[30]===_?ie=t[31]:(ie=_.some(ph),t[30]=_,t[31]=ie);let ae=ie,oe,se;t[32]!==D||t[33]!==ae||t[34]!==C?(oe=()=>{let e=ee.current;if(e)return Pm({root:e,editor:D,isBlocked:()=>ae,onDismiss:()=>C(null)})},se=[D,ae,C],t[32]=D,t[33]=ae,t[34]=C,t[35]=oe,t[36]=se):(oe=t[35],se=t[36]),(0,R.useEffect)(oe,se);let ce;t[37]===C?ce=t[38]:(ce=e=>{C(e),e&&re(e)},t[37]=C,t[38]=ce);let ue=ce,de;t[39]!==f||t[40]!==x?(de=(e,t,n)=>{f(e,t,n),w.current!==null&&(cancelAnimationFrame(w.current),w.current=null),n!==`unmount`&&(w.current=requestAnimationFrame(()=>{w.current=null,e.isConnected&&t.setSelectedLines(x,{notify:!1})}))},t[39]=f,t[40]=x,t[41]=de):de=t[41];let fe=de,pe;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(pe={overscrollSize:600,intersectionObserverMargin:1200},t[42]=pe):pe=t[42];let me;t[43]!==s||t[44]!==r||t[45]!==D||t[46]!==n||t[47]!==i?(me=Rm(n,r,i,s,D.getFile()),t[43]=s,t[44]=r,t[45]=D,t[46]=n,t[47]=i,t[48]=me):me=t[48];let he;t[49]!==s||t[50]!==i||t[51]!==me?(he={name:i,contents:s,cacheKey:me},t[49]=s,t[50]=i,t[51]=me,t[52]=he):he=t[52];let ge=!ae,_e=!ae,ve=d?`wrap`:`scroll`,P;t[53]===l?P=t[54]:(P=le(l),t[53]=l,t[54]=P);let ye;t[55]!==ue||t[56]!==fe||t[57]!==l||t[58]!==C||t[59]!==ge||t[60]!==_e||t[61]!==ve||t[62]!==P?(ye={disableFileHeader:!0,enableGutterUtility:ge,enableLineSelection:_e,onGutterUtilityClick:C,onLineSelectionChange:C,onLineSelectionEnd:ue,overflow:ve,theme:P,themeType:l,unsafeCSS:nh,onPostRender:fe},t[55]=ue,t[56]=fe,t[57]=l,t[58]=C,t[59]=ge,t[60]=_e,t[61]=ve,t[62]=P,t[63]=ye):ye=t[63];let be;t[64]!==j||t[65]!==N?(be=e=>(0,V.jsx)(`div`,{className:`py-1`,children:e.metadata.entries.map(e=>(0,V.jsx)(tt,{kind:e.kind,rangeLabel:et(e.startLine,e.endLine),text:e.text,onCancel:()=>j(e.id),onComment:t=>N(e.id,t),onDelete:()=>j(e.id)},e.id))}),t[64]=j,t[65]=N,t[66]=be):be=t[66];let xe;t[67]!==_||t[68]!==x||t[69]!==he||t[70]!==ye||t[71]!==be?(xe=(0,V.jsx)(`div`,{ref:ee,className:`flex min-h-0 flex-1`,children:(0,V.jsx)(Ie,{className:`file-preview-virtualizer min-h-0 flex-1 overflow-auto`,config:pe,children:(0,V.jsx)(Ft,{file:he,options:ye,selectedLines:x,lineAnnotations:_,renderAnnotation:be,className:`min-h-full`,contentEditable:!0})})}),t[67]=_,t[68]=x,t[69]=he,t[70]=ye,t[71]=be,t[72]=xe):xe=t[72];let Se;return t[73]!==D||t[74]!==xe?(Se=(0,V.jsx)(Le,{editor:D,children:xe}),t[73]=D,t[74]=xe,t[75]=Se):Se=t[75],Se}function ph(e){return e.metadata.entries.some(mh)}function mh(e){return e.kind===`draft`}function hh(e){let t=e.metadata.entries.filter(gh);return t.length>0?[{...e,metadata:{entries:t}}]:[]}function gh(e){return e.kind!==`draft`}function _h(e){return e.metadata.entries}function vh(e){return e.removeReviewComment}function yh(e){return e.addReviewComment}function bh(e){let t=(0,bm.c)(17),{environmentId:n,cwd:r,relativePath:i,contents:a,threadRef:o,onPendingChange:s}=e,c;t[0]!==r||t[1]!==n||t[2]!==s||t[3]!==i?(c={environmentId:n,cwd:r,relativePath:i,onPendingChange:s},t[0]=r,t[1]=n,t[2]=s,t[3]=i,t[4]=c):c=t[4];let l=dh(c),u;t[5]!==a||t[6]!==r||t[7]!==n||t[8]!==i||t[9]!==l?(u=e=>{let{markerOffset:t,checked:o}=e,s=L(n,r,i)?.contents??a,c=Hm(s,t,o);c!==s&&(ct(n,r,i,c),l.change(c))},t[5]=a,t[6]=r,t[7]=n,t[8]=i,t[9]=l,t[10]=u):u=t[10];let d;return t[11]!==a||t[12]!==r||t[13]!==i||t[14]!==u||t[15]!==o?(d=(0,V.jsx)(Ce,{className:`min-h-0 flex-1`,children:(0,V.jsx)(jm,{text:a,cwd:r,relativePath:i,threadRef:o,onTaskListChange:u})}),t[11]=a,t[12]=r,t[13]=i,t[14]=u,t[15]=o,t[16]=d):d=t[16],d}function xh(e){let t=(0,bm.c)(104),{environmentId:i,projectId:a,cwd:o,projectName:s,relativePath:c,threadRef:u,composerDraftTarget:f,keybindings:h,availableEditors:_,revealLine:b,revealRequestId:C,onOpenFile:D,onPendingChange:O,selectedFilePending:k,workspaceMutationId:A}=e,{resolvedTheme:j}=g(),M=te(Ch),N=v(),ne=Me(i),ae=y(i),oe;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(oe={reportFailure:!1},t[0]=oe):oe=t[0];let se=at(ot.createUrl,oe),ce;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(ce={reportFailure:!1},t[1]=ce):ce=t[1];let de=ee(Ye.open,ce),pe;t[2]===c?pe=t[3]:(pe=c===null?null:ge(c),t[2]=c,t[3]=pe);let me=pe,he=me===`image`,_e;t[4]!==me||t[5]!==c?(_e=me===`document`||c!==null&&ue(c),t[4]=me,t[5]=c,t[6]=_e):_e=t[6];let ve=_e,P=I(i,o,c,!he&&!ve),[ye,xe]=r(Zm,!1,n),[Se,we]=r(Qm,!0,n),[Te,F]=r($m,!0,n),[Ee,ke]=(0,R.useState)(null),Ae=(0,R.useRef)(null),je=me===`markdown`,Ne;t[7]===c?Ne=t[8]:(Ne=c!==null&&re(c),t[7]=c,t[8]=Ne);let Pe=Ne,Le=b===null||Ee?.path===c&&Ee.requestId===C,Re=je&&Se&&Le,Be=Pe&&Te&&Le,He=Re||Be,We=Pe?He?`Show HTML source`:`Show rendered page`:He?`Show markdown source`:`Show rendered markdown`,Ge;t[9]===c?Ge=t[10]:(Ge=c!==null&&Je()&&be(c),t[9]=c,t[10]=Ge);let Ke=Ge,qe;t[11]!==o||t[12]!==c?(qe=c?ie(c,o):null,t[11]=o,t[12]=c,t[13]=qe):qe=t[13];let Ze=qe,Qe;t[14]!==s||t[15]!==c?(Qe=c?zm(s,c):[],t[14]=s,t[15]=c,t[16]=Qe):Qe=t[16];let $e=Qe,et=lh(c,b,C),tt=c!==null&&!he&&!ve&&!k,nt=`file:${i}:${o}:${c??``}`,rt;t[17]!==P.refresh||t[18]!==nt||t[19]!==tt||t[20]!==A?(rt={enabled:tt,mutationId:A,refresh:P.refresh,resourceKey:nt},t[17]=P.refresh,t[18]=nt,t[19]=tt,t[20]=A,t[21]=rt):rt=t[21],Xe(rt);let it;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(it=()=>{(Ae.current?.querySelector(`[data-current-file-crumb='true']`))?.scrollIntoView({block:`nearest`,inline:`end`})},t[22]=it):it=t[22];let st;t[23]===c?st=t[24]:(st=[c],t[23]=c,t[24]=st),(0,R.useEffect)(it,st);let ct;t[25]===xe?ct=t[26]:(ct=()=>xe(Sh),t[25]=xe,t[26]=ct);let L=ct,lt;t[27]!==Ze||t[28]!==se||t[29]!==ae||t[30]!==de||t[31]!==u?(lt=()=>{!Ze||!ae||(async()=>{let e=await De({threadRef:u,filePath:Ze,httpBaseUrl:ae,createAssetUrl:se,openPreview:de});if(e._tag===`Success`||p(e))return;let t=m(e);T.add(x({type:`error`,title:`Unable to open file in browser`,description:t instanceof Error?t.message:`An error occurred.`}))})()},t[27]=Ze,t[28]=se,t[29]=ae,t[30]=de,t[31]=u,t[32]=lt):lt=t[32];let ut=lt,ft;t[33]!==Ze||t[34]!==_||t[35]!==$e||t[36]!==Ke||t[37]!==i||t[38]!==ye||t[39]!==ut||t[40]!==Pe||t[41]!==je||t[42]!==He||t[43]!==h||t[44]!==N||t[45]!==s||t[46]!==c||t[47]!==ne||t[48]!==We||t[49]!==C||t[50]!==F||t[51]!==we||t[52]!==L?(ft=c?(0,V.jsxs)(`div`,{className:`flex h-10 min-h-10 shrink-0 items-center gap-2 border-b border-border/60 bg-background px-3 in-data-[preview-panel-mode=inline]:mb-3 in-data-[preview-panel-mode=inline]:h-7 in-data-[preview-panel-mode=inline]:min-h-7 in-data-[preview-panel-mode=inline]:border-b-transparent`,"data-surface-subheader":!0,children:[(0,V.jsx)(Ce,{ref:Ae,hideScrollbars:!0,scrollFade:!0,className:`min-w-0 flex-1 rounded-none`,"data-file-breadcrumbs":!0,children:(0,V.jsx)(`div`,{className:`flex h-full w-max min-w-full items-center text-xs`,children:$e.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex min-w-0 shrink-0 items-center`,"data-current-file-crumb":e.kind===`file`,children:[t>0?(0,V.jsx)(l,{className:`mx-1 size-3.5 shrink-0 text-muted-foreground/60`}):null,(0,V.jsxs)(w,{children:[(0,V.jsx)(S,{render:(0,V.jsx)(`span`,{className:d(`max-w-40 truncate`,e.kind===`file`?`font-medium text-foreground`:`text-muted-foreground`)}),children:e.label}),(0,V.jsx)(E,{side:`top`,className:`max-w-80`,children:e.path||s})]})]},e.path||`project`))})}),Ze&&(i===N||ne.mode!==`local-exec`)?(0,V.jsx)(Ue,{environmentId:i,keybindings:h,availableEditors:_,openInCwd:Ze,compact:!0,enableShortcut:!1}):null,je||Pe?(0,V.jsxs)(w,{children:[(0,V.jsx)(S,{render:(0,V.jsx)(Fe,{className:`shrink-0`,pressed:He,onPressedChange:e=>{Pe?F(e):we(e),ke(e&&c!==null?{path:c,requestId:C}:null)},"aria-label":We,variant:`ghost`,size:`sm`,children:He?(0,V.jsx)(Ve,{className:`size-3.5`}):(0,V.jsx)(Oe,{className:`size-3.5`})})}),(0,V.jsx)(E,{children:We})]}):null,Ke?(0,V.jsxs)(w,{children:[(0,V.jsx)(S,{render:(0,V.jsx)(Fe,{className:`shrink-0`,pressed:!1,onPressedChange:ut,"aria-label":`Open file in preview browser`,variant:`ghost`,size:`sm`,children:(0,V.jsx)(ze,{className:`size-3.5`})})}),(0,V.jsx)(E,{children:`Open file in preview browser`})]}):null,(0,V.jsxs)(w,{children:[(0,V.jsx)(S,{render:(0,V.jsx)(Fe,{className:`shrink-0`,pressed:ye,onPressedChange:L,"aria-label":ye?`Hide file explorer`:`Show file explorer`,variant:`ghost`,size:`sm`,children:(0,V.jsx)(jt,{className:`size-3.5`})})}),(0,V.jsx)(E,{children:ye?`Hide file explorer`:`Show file explorer`})]})]}):null,t[33]=Ze,t[34]=_,t[35]=$e,t[36]=Ke,t[37]=i,t[38]=ye,t[39]=ut,t[40]=Pe,t[41]=je,t[42]=He,t[43]=h,t[44]=N,t[45]=s,t[46]=c,t[47]=ne,t[48]=We,t[49]=C,t[50]=F,t[51]=we,t[52]=L,t[53]=ft):ft=t[53];let pt;t[54]!==P.data||t[55]!==c?(pt=c&&P.data?.truncated?(0,V.jsxs)(`div`,{className:`shrink-0 border-b border-warning/20 bg-warning-surface px-3 py-1.5 text-[11px] text-warning-foreground`,children:[`Preview limited to the first 1 MB of a `,P.data.byteLength.toLocaleString(),` byte file.`]}):null,t[54]=P.data,t[55]=c,t[56]=pt):pt=t[56];let mt=c?`flex`:`hidden`,ht;t[57]===mt?ht=t[58]:(ht=d(`min-w-0 flex-1 flex-col overflow-hidden`,mt),t[57]=mt,t[58]=ht);let gt;t[59]!==Ze||t[60]!==f||t[61]!==o||t[62]!==i||t[63]!==P.data||t[64]!==P.error||t[65]!==P.failure||t[66]!==Pe||t[67]!==he||t[68]!==je||t[69]!==ve||t[70]!==et||t[71]!==O||t[72]!==a||t[73]!==c||t[74]!==Be||t[75]!==Re||t[76]!==j||t[77]!==C||t[78]!==u||t[79]!==M||t[80]!==A?(gt=c&&he&&Ze?(0,V.jsx)(rh,{projectId:typeof f==`string`?a:void 0,environmentId:i,threadRef:u,absolutePath:Ze,alt:c,workspaceMutationId:A},Ze):c&&ve&&Ze?(0,V.jsx)(Ym,{projectId:typeof f==`string`?a:void 0,absolutePath:Ze,environmentId:i,fileName:c.split(`/`).pop()??c,threadRef:u},Ze):c&&P.failure===`binary_file`&&P.data===null?(0,V.jsx)(Bm,{projectId:typeof f==`string`?a:void 0,absolutePath:fe(c)?Ze:null,environmentId:i,fileName:c.split(`/`).pop()??c,threadRef:u}):c&&P.error&&P.data===null?(0,V.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center px-6 text-center text-xs leading-relaxed text-destructive`,children:P.error}):c&&P.data===null?(0,V.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-muted-foreground`,children:(0,V.jsx)(dt,{className:`size-5`})}):c&&P.data?Pe&&Be?(0,V.jsx)(R.Suspense,{fallback:(0,V.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-muted-foreground`,children:(0,V.jsx)(dt,{className:`size-5`})}),children:(0,V.jsx)(Jm,{threadRef:u,projectId:typeof f==`string`?a:void 0,filePath:c,version:Lm(o,c,P.data.contents),fileName:c.split(`/`).pop()??c})}):je&&Re?(0,V.jsx)(bh,{environmentId:i,cwd:o,relativePath:c,threadRef:u,contents:P.data.contents,onPendingChange:O}):P.data.truncated?(0,V.jsx)(Ie,{className:`file-preview-virtualizer min-h-0 flex-1 overflow-auto`,config:{overscrollSize:600,intersectionObserverMargin:1200},children:(0,V.jsx)(Ft,{file:{name:c,contents:P.data.contents,cacheKey:Lm(o,c,P.data.contents)},options:{disableFileHeader:!0,overflow:M?`wrap`:`scroll`,theme:le(j),themeType:j,unsafeCSS:nh,onPostRender:et},className:`min-h-full`})},`${c}:${j}:${P.data.byteLength}`):(0,V.jsx)(fh,{environmentId:i,cwd:o,relativePath:c,composerDraftTarget:f,contents:P.data.contents,resolvedTheme:j,revealRequestId:C,wordWrap:M,onPostRender:et,onPendingChange:O},`${c}:${j}`):null,t[59]=Ze,t[60]=f,t[61]=o,t[62]=i,t[63]=P.data,t[64]=P.error,t[65]=P.failure,t[66]=Pe,t[67]=he,t[68]=je,t[69]=ve,t[70]=et,t[71]=O,t[72]=a,t[73]=c,t[74]=Be,t[75]=Re,t[76]=j,t[77]=C,t[78]=u,t[79]=M,t[80]=A,t[81]=gt):gt=t[81];let z;t[82]!==ht||t[83]!==gt?(z=(0,V.jsx)(`div`,{className:ht,children:gt}),t[82]=ht,t[83]=gt,t[84]=z):z=t[84];let _t;t[85]!==o||t[86]!==i||t[87]!==ye||t[88]!==P.refresh||t[89]!==he||t[90]!==ve||t[91]!==D||t[92]!==s||t[93]!==c||t[94]!==C||t[95]!==A?(_t=ye||c===null?(0,V.jsx)(`aside`,{className:d(`flex min-h-0 shrink-0 bg-background`,c?`w-[min(22rem,46%)] min-w-64 border-l border-border/60`:`min-w-0 flex-1`),children:(0,V.jsx)(Am,{environmentId:i,cwd:o,projectName:s,selectedPath:c,selectedPathRevealId:C,onOpenFile:D,workspaceMutationId:A,...c&&!he&&!ve?{onRefreshSelectedFile:P.refresh}:{}},`${i}:${o}`)}):null,t[85]=o,t[86]=i,t[87]=ye,t[88]=P.refresh,t[89]=he,t[90]=ve,t[91]=D,t[92]=s,t[93]=c,t[94]=C,t[95]=A,t[96]=_t):_t=t[96];let B;t[97]!==z||t[98]!==_t?(B=(0,V.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[z,_t]}),t[97]=z,t[98]=_t,t[99]=B):B=t[99];let vt;return t[100]!==ft||t[101]!==pt||t[102]!==B?(vt=(0,V.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden bg-background`,children:[ft,pt,B]}),t[100]=ft,t[101]=pt,t[102]=B,t[103]=vt):vt=t[103],vt}function Sh(e){return!e}function Ch(e){return e.wordWrap}export{xh as default};
|
|
2231
|
-
//# sourceMappingURL=FilePreviewPanel-KOVwBhPe.js.map
|