@kabmo-labs/kabmo 0.43.1 → 0.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +337 -337
- package/dist/client/static/js/{CsvGrid-g67pk2zy.js → CsvGrid-1t2q46rg.js} +2 -2
- package/dist/client/static/js/{DocxView-pyh6p2kb.js → DocxView-301hxnwk.js} +4 -4
- package/dist/client/static/js/{DrawioView-g48r6y2m.js → DrawioView-47bwea5t.js} +2 -2
- package/dist/client/static/js/ImageView-68zdx5ex.js +1 -0
- package/dist/client/static/js/LayoutWrapper-vw54s8ra.js +2 -0
- package/dist/client/static/js/{Modal-edw446r8.js → Modal-fb9b4gq6.js} +18 -18
- package/dist/client/static/js/{PdfView-6z3cgj37.js → PdfView-m64ksepp.js} +1 -1
- package/dist/client/static/js/SessionsView-zyjwhpzm.js +1 -0
- package/dist/client/static/js/{SheetView-64076z1j.js → SheetView-e88sqprx.js} +13 -13
- package/dist/client/static/js/{SvgPreview-dmpgavgd.js → SvgPreview-hs9a713t.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-nfz5z1vw.js → abnfDiagram-O67JEVCF-fnr5kyqk.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-mq93vqx9.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-jra2jyzw.js → architectureDiagram-NJMV4G6O-7v003363.js} +11 -11
- package/dist/client/static/js/{astro-dpfdhc5e.js → astro-t9vjc0mc.js} +1 -1
- package/dist/client/static/js/bash-fjzhxy10.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-3szktxam.js → blockDiagram-BEXU5L5S-k4mwbw3d.js} +5 -5
- package/dist/client/static/js/c-y1y6v00q.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-xe9vbppt.js → c4Diagram-YGBWAQC7-688zq6f4.js} +6 -6
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-egzhj1xn.js → classDiagram-v2-NBCMYWYE-h0s16pxr.js} +5 -5
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-dfrk1wnr.js → cose-bilkent-JH36ORCC-qb2t8qq5.js} +1 -1
- package/dist/client/static/js/cpp-9f6zkdd4.js +1 -0
- package/dist/client/static/js/css-g85rwzty.js +1 -0
- package/dist/client/static/js/css-y4y3qtsb.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-qyg5rjr5.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-xefpcmpg.js → cynefinDiagram-VND7K2PF-syhtcr7b.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-vtzjnrt9.js → dagre-6A5THRUB-7wgbx6cm.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-4vvn790v.js → diagram-22UHCM2B-951cmp5h.js} +21 -21
- package/dist/client/static/js/{diagram-3UASUU5V-tmht3bew.js → diagram-3UASUU5V-mvdbqt7b.js} +2 -2
- package/dist/client/static/js/{diagram-ATOU4E4O-p5wa5ztx.js → diagram-ATOU4E4O-hkvdtgdm.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-8myesjfc.js → diagram-CDSNMT55-bkkz35ca.js} +4 -4
- package/dist/client/static/js/{diagram-MLGK6HIB-9t3x2d5f.js → diagram-MLGK6HIB-z6pcrkc3.js} +2 -2
- package/dist/client/static/js/{diagram-MPIPVDR6-8ahgnmhy.js → diagram-MPIPVDR6-mkwf8j4m.js} +1 -1
- package/dist/client/static/js/{dockerfile-x8aa0543.js → dockerfile-7gd570bm.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-5semw111.js → ebnfDiagram-ZINNZB2B-trym26ts.js} +1 -1
- package/dist/client/static/js/{elixir-5ewfhvfh.js → elixir-z77c7tfn.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-jmhs58ww.js → elk-276RUBZZ-gkhz67v6.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-31wvbpdr.js → erDiagram-OPXOYQCR-gkyr5cqs.js} +7 -7
- package/dist/client/static/js/{erlang-jqqa3ehb.js → erlang-6vrvh2m6.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-15yz245z.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-n1sapfye.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-c2dycjrf.js → ganttDiagram-FUAMR5RP-1qpme6ks.js} +4 -4
- package/dist/client/static/js/gitGraph-4MIJSDKK-xtjwv160.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-y4k4pdd8.js → gitGraphDiagram-X574FWY7-wbg3kqak.js} +10 -10
- package/dist/client/static/js/graphql-amk52c95.js +1 -0
- package/dist/client/static/js/html-2y935m7r.js +1 -0
- package/dist/client/static/js/index-07yh7qx0.js +1 -0
- package/dist/client/static/js/{index-6fpd55cq.js → index-1923aj4g.js} +2 -2
- package/dist/client/static/js/{index-s00j9042.js → index-19ffgf9a.js} +1 -1
- package/dist/client/static/js/index-204ae4vs.js +2 -0
- package/dist/client/static/js/{index-cqnpsw2m.js → index-22whvfdw.js} +2 -2
- package/dist/client/static/js/{index-2cbnjc32.js → index-232nsp2c.js} +2 -2
- package/dist/client/static/js/{index-aar68x31.js → index-31hntzse.js} +5 -5
- package/dist/client/static/js/{index-2b46dzw8.js → index-3w845q50.js} +4 -4
- package/dist/client/static/js/{index-gmnmnfm0.js → index-4y4hshcx.js} +2 -2
- package/dist/client/static/js/index-53ysgsd2.js +1 -0
- package/dist/client/static/js/{index-m94f4ngb.js → index-62ng8tkj.js} +3 -3
- package/dist/client/static/js/{index-nt7nhchn.js → index-6ah5sj5y.js} +1 -1
- package/dist/client/static/js/{index-kc5znr75.js → index-6gyk52ff.js} +2 -2
- package/dist/client/static/js/{index-m9s9rg5k.js → index-6s4mrdew.js} +2 -2
- package/dist/client/static/js/index-6t21c6jt.js +2 -0
- package/dist/client/static/js/{index-7dp90ad1.js → index-83pwa9c0.js} +2 -2
- package/dist/client/static/js/{index-pt8440xh.js → index-8trggh1z.js} +15 -15
- package/dist/client/static/js/{index-ys0xpw3q.js → index-92n96mgd.js} +2 -2
- package/dist/client/static/js/index-ad4x44d6.js +9 -0
- package/dist/client/static/js/{index-s78n0dtv.js → index-as1wptfa.js} +2 -2
- package/dist/client/static/js/{index-j17h4z6f.js → index-barbpakv.js} +2 -2
- package/dist/client/static/js/index-bjqz7swa.js +1 -0
- package/dist/client/static/js/{index-yvgbr7ek.js → index-c3v62nvt.js} +2 -2
- package/dist/client/static/js/{index-f77c3ag0.js → index-cq98p2rb.js} +200 -200
- package/dist/client/static/js/{index-3588r3wg.js → index-czedkbmb.js} +2 -2
- package/dist/client/static/js/{index-sesghshh.js → index-dmv2zasz.js} +2 -2
- package/dist/client/static/js/{index-ycks7gyg.js → index-e6rm5xzj.js} +2 -2
- package/dist/client/static/js/{index-48pb18zj.js → index-ehacfgwm.js} +2 -2
- package/dist/client/static/js/{index-q81rxwh7.js → index-fbpc1wx6.js} +41 -41
- package/dist/client/static/js/{index-qhytrsyb.js → index-fj4k07zt.js} +2 -2
- package/dist/client/static/js/{index-jz93j0at.js → index-gtkhz0hj.js} +2 -2
- package/dist/client/static/js/{index-181p91hf.js → index-hfsvwfgw.js} +2 -2
- package/dist/client/static/js/{index-sk9ej289.js → index-jaqjvk22.js} +2 -2
- package/dist/client/static/js/{index-e7yf273s.js → index-jbkkwa2q.js} +2 -2
- package/dist/client/static/js/{index-38v0781h.js → index-ks23y2cd.js} +2 -2
- package/dist/client/static/js/{index-f7djda1g.js → index-kwpaz891.js} +2 -2
- package/dist/client/static/js/{index-0c6vpk89.js → index-n0matkz9.js} +2 -2
- package/dist/client/static/js/index-n6fbd265.js +1 -0
- package/dist/client/static/js/{index-cjhvtzdd.js → index-nqjd3hh5.js} +2 -2
- package/dist/client/static/js/{index-ynaxep06.js → index-nr8s5xm9.js} +2 -2
- package/dist/client/static/js/index-nvevymac.js +2 -0
- package/dist/client/static/js/index-pxm44qfd.js +1 -0
- package/dist/client/static/js/{index-fg965t62.js → index-pysqpc5n.js} +2 -2
- package/dist/client/static/js/index-qf9x7yet.js +1 -0
- package/dist/client/static/js/{index-s7rfbydk.js → index-qkjx6521.js} +4 -4
- package/dist/client/static/js/index-qm92sf9w.js +12 -0
- package/dist/client/static/js/{index-fjnkzk12.js → index-qsw5edtk.js} +5 -5
- package/dist/client/static/js/index-rpzxrr2d.js +1 -0
- package/dist/client/static/js/index-s8bktzpg.js +1 -0
- package/dist/client/static/js/index-sc7r305t.css +1 -0
- package/dist/client/static/js/{index-efra065v.js → index-svmzgtcx.js} +2 -2
- package/dist/client/static/js/{index-vyw4tbn8.js → index-tr2pkfs6.js} +2 -2
- package/dist/client/static/js/{index-bvjct7sp.js → index-tzdm1y3z.js} +2 -2
- package/dist/client/static/js/{index-cgzw43bc.js → index-v5npdwy2.js} +65 -65
- package/dist/client/static/js/{index-dkwhs38j.js → index-v7bcgh77.js} +2 -2
- package/dist/client/static/js/index-wytdbvax.js +3 -0
- package/dist/client/static/js/{index-n9scbxy5.js → index-yfjvx4yf.js} +2 -2
- package/dist/client/static/js/info-A6RAGUB7-e31s2xvj.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-z3pqx7w8.js → infoDiagram-VRGFBTTK-yebngg8c.js} +1 -1
- package/dist/client/static/js/ini-kemnmt16.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-f5v6z8yr.js → ishikawaDiagram-OU5B5YK6-kh4nqj6q.js} +3 -3
- package/dist/client/static/js/java-caqpfm88.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-js1yxatk.js → journeyDiagram-ZHPQQLJL-4khnf8x1.js} +5 -5
- package/dist/client/static/js/json-qn73s8xb.js +1 -0
- package/dist/client/static/js/jsx-bvterpm5.js +1 -0
- package/dist/client/static/js/{julia-0h9krgsd.js → julia-svwxx41e.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-m0a6069c.js → kanban-definition-PNTS6WVX-snmq3wq4.js} +4 -4
- package/dist/client/static/js/lua-1hcfm8ya.js +1 -0
- package/dist/client/static/js/markdown-n6na4ykv.js +1 -0
- package/dist/client/static/js/{mermaid.core-6xvbnm63.js → mermaid.core-yctw30sk.js} +7 -7
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-a9f9yzc0.js → mindmap-definition-NLK3R4M7-atfv66wq.js} +3 -3
- package/dist/client/static/js/one-dark-pro-c1vnxka7.js +1 -0
- package/dist/client/static/js/one-light-mbxx52p5.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-mtzmsrk4.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-4v4pf1h1.js → pegDiagram-GJSIUBJH-hpbtxjht.js} +1 -1
- package/dist/client/static/js/{perl-rptyx23q.js → perl-mr0ds2ex.js} +1 -1
- package/dist/client/static/js/{php-sagvq3wz.js → php-5h3wt6tv.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-85nwadmj.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-a54yrmfm.js → pieDiagram-5QR66LMP-9zrtkdr2.js} +2 -2
- package/dist/client/static/js/properties-nxcks67c.js +1 -0
- package/dist/client/static/js/python-58p0gqn0.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-1twhvnp2.js → quadrantDiagram-O4NWA36T-xq970vx1.js} +6 -6
- package/dist/client/static/js/r-eyn8en0g.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-ae3jdajx.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-3m0s7cse.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-pz22c3eb.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-cgqgqq15.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-ts0nmcxb.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-83tqfdcy.js → railroadDiagram-XR7U4H2S-1g9jchbk.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-73e3pzw6.js → requirementDiagram-PLB6GJNP-ntt088y4.js} +4 -4
- package/dist/client/static/js/{ruby-9qyx7knh.js → ruby-nn836rtq.js} +1 -1
- package/dist/client/static/js/{rust-jds4e4r7.js → rust-eygk56y5.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-1bzwj6sb.js → sankeyDiagram-IPEJSGJF-95k8c5v6.js} +5 -5
- package/dist/client/static/js/{sass-07rteya0.js → sass-c2bk03e4.js} +1 -1
- package/dist/client/static/js/{scss-e2dndbfa.js → scss-qycakpjn.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-yh3h988k.js → sequenceDiagram-PO4LG4MO-qfvxrwfa.js} +19 -19
- package/dist/client/static/js/{sizeCapture-INFHLROL-1n121yp6.js → sizeCapture-INFHLROL-0m7dc5nd.js} +1 -1
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-0tdrzn06.js → stateDiagram-v2-GCMORJYK-femwcn7n.js} +5 -5
- package/dist/client/static/js/{svelte-w365cpwa.js → svelte-bfy1rq5g.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-77n1ttdw.js → swimlanes-2SLR337P-5n1qq48r.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-n85hawg8.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-b6r0k3e8.js → timeline-definition-EJHVYXUP-vdsj18be.js} +7 -7
- package/dist/client/static/js/treeView-Q6P3EWNA-fvpt3hm8.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-4z9s24je.js +1 -0
- package/dist/client/static/js/tsx-fnzxsv25.js +1 -0
- package/dist/client/static/js/typescript-0ppbqrb6.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-efq58m3m.js → usecaseDiagram-POWQR4AR-psjbrprk.js} +43 -43
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-ad4gvd5r.js → vennDiagram-UO4OBE2U-4yn9kac9.js} +7 -7
- package/dist/client/static/js/{vue-d6cesny1.js → vue-0fwtgwj4.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-73mrhkmy.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-v89tys2p.js → wardleyDiagram-VNRHLVJA-js0tbpca.js} +3 -3
- package/dist/client/static/js/xml-v1ytr8qz.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-xtgzmknw.js → xychartDiagram-PMCCYNJV-svr38ygh.js} +5 -5
- package/dist/client/static/js/yaml-txrqz62t.js +1 -0
- package/marketplace/plugins/stats/package.json +2 -2
- package/marketplace/plugins/stats/src/proc/identity.ts +4 -3
- package/package.json +2 -2
- package/src/client/App.tsx +1 -1
- package/src/client/borders.css +143 -0
- package/src/client/components/common/context-usage-button/Ring.tsx +34 -9
- package/src/client/components/common/context-usage-button/index.test.tsx +19 -2
- package/src/client/components/common/context-usage-button/index.tsx +4 -4
- package/src/client/components/common/header-controls/index.test.tsx +26 -59
- package/src/client/components/common/header-controls/index.tsx +41 -52
- package/src/client/components/common/header-controls/phone-row.test.tsx +265 -0
- package/src/client/components/common/header-controls/plugin-entry.test.tsx +25 -3
- package/src/client/components/common/header-controls/shell-chrome.test.tsx +2 -2
- package/src/client/components/layout/LeftDock.tsx +7 -0
- package/src/client/components/layout/desktop-layout/DesktopOverlays.tsx +51 -0
- package/src/client/components/layout/desktop-layout/LeftColumn.tsx +117 -15
- package/src/client/components/layout/desktop-layout/RightColumn.tsx +257 -0
- package/src/client/components/layout/desktop-layout/TopNavbar.tsx +23 -24
- package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +50 -78
- package/src/client/components/layout/desktop-layout/index.tsx +73 -73
- package/src/client/components/layout/session-sidebar/Footer.test.tsx +20 -0
- package/src/client/components/layout/session-sidebar/Footer.tsx +24 -2
- package/src/client/components/layout/session-sidebar/Header.test.ts +10 -0
- package/src/client/components/layout/session-sidebar/Header.tsx +2 -2
- package/src/client/components/mobile/mobile-main-view/Header.test.tsx +2 -3
- package/src/client/components/mobile/mobile-main-view/Header.tsx +12 -10
- package/src/client/components/settings/Modal.tsx +14 -9
- package/src/client/components/settings/ProjectSelectorDropdown.tsx +18 -6
- package/src/client/components/settings/SettingsSidebarList.tsx +2 -1
- package/src/client/components/settings/Sidebar.tsx +6 -4
- package/src/client/components/settings/apply-side-effects.test.ts +17 -0
- package/src/client/components/settings/apply-side-effects.ts +26 -5
- package/src/client/components/settings/band-height.test.tsx +122 -0
- package/src/client/components/settings/categories/AppearanceSettings.test.tsx +144 -0
- package/src/client/components/settings/categories/AppearanceSettings.tsx +81 -39
- package/src/client/components/settings/categories/ChatSettings.tsx +9 -15
- package/src/client/components/settings/categories/UsageSettings.tsx +2 -1
- package/src/client/components/settings/categories/appearance-settings/BorderStyleSection.test.tsx +101 -0
- package/src/client/components/settings/categories/appearance-settings/BorderStyleSection.tsx +134 -0
- package/src/client/components/settings/categories/appearance-settings/EditorBlameSection.tsx +2 -2
- package/src/client/components/settings/categories/appearance-settings/EditorFontSection.tsx +5 -5
- package/src/client/components/settings/categories/appearance-settings/EditorIndentSection.tsx +2 -2
- package/src/client/components/settings/categories/appearance-settings/EditorThemeSection.tsx +6 -6
- package/src/client/components/settings/categories/appearance-settings/EditorTypingSection.tsx +2 -2
- package/src/client/components/settings/categories/appearance-settings/IconStyleSection.tsx +2 -2
- package/src/client/components/settings/categories/appearance-settings/PanelNavSection.tsx +167 -0
- package/src/client/components/settings/categories/appearance-settings/SidebarStyleSection.tsx +2 -2
- package/src/client/components/settings/categories/appearance-settings/SurfaceStyleSection.tsx +2 -2
- package/src/client/components/settings/categories/appearance-settings/ThemeSection.tsx +42 -0
- package/src/client/components/settings/categories/appearance-settings/TrayIconSection.tsx +2 -2
- package/src/client/components/settings/categories/appearance-settings/groups.test.ts +47 -0
- package/src/client/components/settings/categories/appearance-settings/groups.ts +95 -0
- package/src/client/components/settings/categories/chat-settings/LayoutSection.tsx +31 -14
- package/src/client/components/settings/categories/mcp-settings/SidebarList.tsx +2 -1
- package/src/client/components/settings/categories/project-settings/SidebarList.tsx +2 -1
- package/src/client/components/settings/categories/provider-settings/SidebarList.tsx +2 -1
- package/src/client/components/settings/categories/usage-settings/SidebarList.tsx +2 -1
- package/src/client/components/settings/master-detail/GroupDetail.tsx +38 -0
- package/src/client/components/settings/{categories/chat-settings/SidebarList.tsx → master-detail/GroupSidebar.tsx} +35 -12
- package/src/client/components/settings/master-detail/index.tsx +3 -1
- package/src/client/components/settings/pane-header.ts +25 -0
- package/src/client/components/workspace/browser-toolbar/index.test.tsx +39 -1
- package/src/client/components/workspace/browser-toolbar/index.tsx +53 -17
- package/src/client/components/workspace/chat-timeline/ColumnResizeHandle.tsx +107 -0
- package/src/client/components/workspace/chat-timeline/ComposerDockFrame.tsx +9 -3
- package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +35 -26
- package/src/client/components/workspace/chat-timeline/TimelineBody.tsx +6 -0
- package/src/client/components/workspace/chat-timeline/column-resize.test.tsx +292 -0
- package/src/client/components/workspace/chat-timeline/composer-dock-frame.test.tsx +5 -3
- package/src/client/components/workspace/context-panel/index.tsx +10 -4
- package/src/client/components/workspace/editor/EditorHideButton.tsx +41 -0
- package/src/client/components/workspace/editor/EmptyEditor.tsx +11 -2
- package/src/client/components/workspace/editor/PluginColumn.tsx +11 -1
- package/src/client/components/workspace/editor/Tabs.tsx +8 -0
- package/src/client/components/workspace/editor/editor-hide-button.test.ts +144 -0
- package/src/client/components/workspace/editor/index.tsx +8 -2
- package/src/client/components/workspace/editor/props.ts +9 -0
- package/src/client/components/workspace/file-explorer/RowLabel.test.tsx +90 -0
- package/src/client/components/workspace/file-explorer/RowLabel.tsx +1 -4
- package/src/client/components/workspace/git-panel/commit-modal/CommitRow.test.ts +52 -46
- package/src/client/components/workspace/git-panel/commit-modal/CommitRow.tsx +41 -21
- package/src/client/components/workspace/git-panel/commit-modal/GraphCanvas.tsx +6 -5
- package/src/client/components/workspace/git-panel/commit-modal/index.tsx +19 -22
- package/src/client/components/workspace/panel-header/title-policy.test.tsx +62 -0
- package/src/client/components/workspace/panel-header/title-policy.tsx +83 -0
- package/src/client/components/workspace/panel-tabs/Home.density.test.tsx +122 -0
- package/src/client/components/workspace/panel-tabs/Home.test.tsx +137 -0
- package/src/client/components/workspace/panel-tabs/Home.tsx +106 -0
- package/src/client/components/workspace/panel-tabs/TabStrip.test.tsx +221 -0
- package/src/client/components/workspace/panel-tabs/TabStrip.tsx +315 -0
- package/src/client/components/workspace/panel-tabs/index.tsx +97 -0
- package/src/client/components/workspace/panels/builtin.tsx +9 -0
- package/src/client/components/workspace/plan-panel/index.tsx +7 -2
- package/src/client/components/workspace/repo-picker/Modal.tsx +1 -1
- package/src/client/components/workspace/repo-picker/index.test.tsx +32 -8
- package/src/client/components/workspace/repo-picker/index.tsx +2 -2
- package/src/client/components/workspace/search-panel/Body.tsx +7 -1
- package/src/client/components/workspace/search-panel/index.tsx +2 -1
- package/src/client/components/workspace/terminal-panel/Header.tsx +10 -3
- package/src/client/components/workspace/terminal-panel/index.tsx +4 -1
- package/src/client/components/workspace/todo-panel/index.tsx +6 -1
- package/src/client/components/workspace/usage-panel/index.tsx +7 -2
- package/src/client/components/workspace/user-browser-panel/AddressBar.tsx +43 -4
- package/src/client/components/workspace/user-browser-panel/Frame.tsx +101 -45
- package/src/client/components/workspace/user-browser-panel/TabStrip.tsx +107 -0
- package/src/client/components/workspace/user-browser-panel/index.tsx +31 -6
- package/src/client/glass.test.ts +1 -1
- package/src/client/hooks/browser/use-annotate.ts +6 -5
- package/src/client/hooks/browser/use-user-browser.test.tsx +279 -0
- package/src/client/hooks/browser/use-user-browser.ts +190 -44
- package/src/client/hooks/chat/timeline/column-drag.ts +171 -0
- package/src/client/hooks/chat/timeline/width-mode.test.ts +112 -11
- package/src/client/hooks/chat/timeline/width-mode.ts +91 -18
- package/src/client/hooks/ui/border-style.test.ts +172 -0
- package/src/client/hooks/ui/border-style.ts +60 -0
- package/src/client/hooks/ui/navbar-controls.test.ts +27 -1
- package/src/client/hooks/ui/navbar-controls.ts +95 -20
- package/src/client/hooks/ui/style-attributes.test.ts +2 -0
- package/src/client/hooks/workspace/active-project.ts +46 -0
- package/src/client/hooks/workspace/commit-expansion.test.ts +135 -0
- package/src/client/hooks/workspace/commit-expansion.ts +56 -0
- package/src/client/hooks/workspace/panel-nav.test.ts +102 -0
- package/src/client/hooks/workspace/panel-nav.ts +95 -0
- package/src/client/hooks/workspace/panel-tabs.session.test.tsx +235 -0
- package/src/client/hooks/workspace/panel-tabs.ts +194 -0
- package/src/client/hooks/workspace/right-open-request.ts +53 -0
- package/src/client/hooks/workspace/right-side.test.ts +204 -0
- package/src/client/hooks/workspace/right-side.ts +142 -0
- package/src/client/main.tsx +9 -4
- package/src/client/tailwind.css +6 -0
- package/src/server/lib/assets/shell-attributes.server.ts +26 -10
- package/src/server/lib/assets/shell-attributes.test.ts +26 -0
- package/src/server/lib/harness/acp/background-replay.test.ts +16 -1
- package/src/server/lib/harness/acp/background-replay.ts +6 -1
- package/src/server/lib/harness/acp/background-work.ts +44 -31
- package/src/server/lib/harness/acp/session-turns.ts +4 -3
- package/src/server/lib/harness/acp/session-wiring.test.ts +53 -0
- package/src/server/lib/harness/acp/session-wiring.ts +11 -2
- package/src/server/lib/harness/session-lease.server.ts +3 -2
- package/src/server/lib/omp/session/lease-probe.server.test.ts +82 -0
- package/src/server/lib/omp/session/lease-probe.server.ts +180 -0
- package/src/server/lib/omp/session/ownership.server.test.ts +17 -6
- package/src/server/lib/omp/session/ownership.server.ts +7 -5
- package/src/server/plugins/ssr.ts +6 -3
- package/src/shared/lib/browser/user-tabs.test.ts +165 -0
- package/src/shared/lib/browser/user-tabs.ts +172 -0
- package/src/shared/lib/chat/timeline/width-mode.test.ts +34 -2
- package/src/shared/lib/chat/timeline/width-mode.ts +71 -22
- package/src/shared/lib/commands/catalog.ts +2 -2
- package/src/shared/lib/fs/git-status.test.ts +23 -0
- package/src/shared/lib/fs/git-status.ts +15 -0
- package/src/shared/lib/icons/tint-hues.generated.ts +20 -20
- package/src/shared/lib/settings/defaults.ts +7 -1
- package/src/shared/lib/theme/border-style.test.ts +83 -0
- package/src/shared/lib/theme/border-style.ts +122 -0
- package/src/shared/lib/workspace/keymap.ts +2 -1
- package/src/shared/lib/workspace/panel-nav.test.ts +162 -0
- package/src/shared/lib/workspace/panel-nav.ts +105 -0
- package/src/shared/lib/workspace/panel-tabs-close.test.ts +154 -0
- package/src/shared/lib/workspace/panel-tabs.ts +105 -0
- package/src/shared/lib/workspace/session-state/cache.ts +22 -0
- package/src/shared/lib/workspace/session-state/merge.ts +6 -0
- package/src/shared/lib/workspace/session-state/store.ts +23 -0
- package/src/shared/types/settings/state.ts +50 -3
- package/src/test-support/header-controls-harness.ts +22 -0
- package/src/test-support/peer-harness.ts +2 -2
- package/dist/client/static/js/ImageView-rnzf5tve.js +0 -1
- package/dist/client/static/js/LayoutWrapper-rekrgth6.js +0 -2
- package/dist/client/static/js/SessionsView-e84tjbcr.js +0 -1
- package/dist/client/static/js/architecture-7GRP2DOG-7j23x20s.js +0 -1
- package/dist/client/static/js/bash-vv2ysp0a.js +0 -1
- package/dist/client/static/js/c-8jf64j6h.js +0 -1
- package/dist/client/static/js/cpp-vh94zee0.js +0 -1
- package/dist/client/static/js/css-a13jmmnc.js +0 -1
- package/dist/client/static/js/css-p57h1fme.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-me5xnx6a.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-5zbvjj84.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-36ygrbvm.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-tjhkv71w.js +0 -1
- package/dist/client/static/js/graphql-kesh8gk0.js +0 -1
- package/dist/client/static/js/html-sxpfydga.js +0 -1
- package/dist/client/static/js/index-0q2qfcjn.js +0 -1
- package/dist/client/static/js/index-48gh56ka.js +0 -3
- package/dist/client/static/js/index-4rv388z7.js +0 -2
- package/dist/client/static/js/index-52xmdeh2.js +0 -1
- package/dist/client/static/js/index-8kqepehd.js +0 -12
- package/dist/client/static/js/index-cje5gg45.js +0 -1
- package/dist/client/static/js/index-fbcg8y95.js +0 -1
- package/dist/client/static/js/index-g3shdymf.js +0 -1
- package/dist/client/static/js/index-h5n1btqy.js +0 -1
- package/dist/client/static/js/index-m1n4v0z7.js +0 -9
- package/dist/client/static/js/index-rn8w29pv.js +0 -2
- package/dist/client/static/js/index-sg6sz3g8.js +0 -1
- package/dist/client/static/js/index-vcrh95gf.css +0 -1
- package/dist/client/static/js/index-w5rw8f7w.js +0 -1
- package/dist/client/static/js/index-x6v37h3j.js +0 -1
- package/dist/client/static/js/info-A6RAGUB7-m6qz24p8.js +0 -1
- package/dist/client/static/js/ini-1x0ad976.js +0 -1
- package/dist/client/static/js/java-3944nq02.js +0 -1
- package/dist/client/static/js/json-g5ggnd94.js +0 -1
- package/dist/client/static/js/jsx-f6p72qpc.js +0 -1
- package/dist/client/static/js/lua-edn2b3wn.js +0 -1
- package/dist/client/static/js/markdown-9dhg1fax.js +0 -1
- package/dist/client/static/js/one-dark-pro-hteqzfb0.js +0 -1
- package/dist/client/static/js/one-light-dapnh0rs.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-ng6wq5xj.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-rf6jhxf6.js +0 -1
- package/dist/client/static/js/properties-fcmj08pv.js +0 -1
- package/dist/client/static/js/python-532d8ezm.js +0 -1
- package/dist/client/static/js/r-ptmdxs2a.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-ygp6hxq4.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-rxgnrb2g.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-xkv52a2p.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-bvcktbqh.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-9c3v7jsq.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-akjqm31r.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-fb58a7z1.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-ej4qhksx.js +0 -1
- package/dist/client/static/js/tsx-zfy727zs.js +0 -1
- package/dist/client/static/js/typescript-683kkkaw.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-mkp0kanv.js +0 -1
- package/dist/client/static/js/xml-6ct32gys.js +0 -1
- package/dist/client/static/js/yaml-1d5m3bfj.js +0 -1
- package/src/server/lib/omp/session/lease-flock.server.ts +0 -117
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d,n,o,i,u,a,le,e,s,f,B,se,va,re,ce,b,Qp,Ee,_,At,Ha,ot,me,it,pA,pi}from"./index-cq98p2rb.js";var ae={name:"chevrons-up-down",size:24,node:[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]},F=s(ae);function O(l,r,c=1e6){return{sessionId:l,sessionTitle:r,modelId:"",modelName:"",timestamp:"",contextUsed:0,contextLimit:c,contextPercent:0,messagesCount:0,userCount:0,assistantCount:0,totalCost:0,costFormatted:"$0.00",cacheHitAverage:0,costBreakdown:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0},lastMessage:{input:0,output:0,reasoning:0,cacheRead:0,cacheWrite:0,cacheHitPercent:0},distribution:{userTokens:0,userPercent:0,assistantTokens:0,assistantPercent:0,toolTokens:0,toolPercent:0,otherTokens:0,otherPercent:100},rawMessages:[]}}function J({used:l,limit:r,percent:c}){let h=l.toLocaleString(),x=r.toLocaleString(),m=Math.min(100,Math.max(0,c));return e("div",{className:"bg-canvas border border-ink/10 rounded-xl p-4 transition-all",children:[e("div",{className:"flex items-center justify-between text-xs mb-2",children:[e("span",{className:"font-semibold text-ink/80",children:"Context"}),e("span",{className:"font-mono text-ink/70 text-[11px]",children:[h," / ",x]})]}),e("div",{className:"w-full h-1.5 bg-ink/10 rounded-full overflow-hidden mb-2",children:e("div",{className:"h-full bg-ink/70 rounded-full transition-all duration-500 ease-out",style:{width:`${m}%`}})}),e("div",{className:"text-[11px] font-mono text-ink/50 text-left",children:[m.toFixed(1),"% used"]})]})}function T(l){return l<0.01?"$0.01":`$${l.toFixed(6).replace(/0+$/,"").replace(/\.$/,"")}`}function Z({open:l,onClose:r,breakdown:c,costFormatted:h}){let x=i(null);if(me(x,r),!l)return null;let m=c?[{label:"Total Cost",value:T(c.total),strong:!0},{label:"Input (cache miss)",value:T(c.input)},{label:"Output",value:T(c.output)},{label:"Cache Read (cache hit)",value:T(c.cacheRead)},{label:"Cache Write",value:T(c.cacheWrite)}]:[{label:"Total Cost",value:h??"$0.01",strong:!0}];return e("div",{ref:x,className:"glass-popover absolute top-full right-0 mt-1.5 z-50 w-64 bg-paper border border-ink/10 rounded-lg shadow-lg p-3",role:"dialog","aria-modal":"false",children:[e("div",{className:"flex items-center justify-between mb-2.5",children:[e("span",{className:"text-xs font-semibold text-ink tracking-tight",children:"Cost Breakdown"}),e("button",{type:"button",onClick:r,className:"p-1 rounded hover:bg-ink/5 text-ink/60 hover:text-ink transition-colors","aria-label":"Close cost breakdown",children:e(b,{size:14})})]}),e("div",{className:"space-y-1.5",children:m.map((t)=>e("div",{className:"flex items-center justify-between text-[11px] font-mono border-b border-ink/5 last:border-0 pb-1.5 last:pb-0",children:[e("span",{className:"text-ink/60",children:t.label}),e("span",{className:`${t.strong?"font-semibold text-ink":"text-ink/80"}`,children:t.value})]},t.label))})]})}function V({messagesCount:l,userCount:r,assistantCount:c,costFormatted:h,cacheHitAverage:x,costBreakdown:m}){let[t,v]=n(!1);return e(d,{children:[e("div",{className:"mb-1.5",children:e("span",{className:"text-xs font-semibold text-ink/80",children:"Session Stats"})}),e("div",{className:"flex gap-2 flex-wrap",children:[e(it,{variant:"compact",label:"Messages",value:l}),e(it,{variant:"compact",label:"User",value:r}),e(it,{variant:"compact",label:"Assistant",value:c}),e(it,{variant:"compact",label:"Cache Hit",value:x!==void 0?`${x.toFixed(1)}%`:"–"}),e("div",{className:"relative bg-canvas border border-ink/10 rounded-lg px-2.5 py-1.5 flex flex-col gap-0.5 flex-1 min-w-0",children:[e("span",{className:"text-[10px] font-medium text-ink/50 flex items-center gap-1",children:["Cost",e("button",{type:"button",onClick:()=>v(!0),className:"p-0.5 rounded text-ink/40 hover:text-ink hover:bg-ink/5 transition-colors","aria-label":"Show cost breakdown",title:"Cost breakdown",children:e(ce,{size:11})})]}),e("span",{className:"text-xs font-semibold font-mono text-ink truncate",children:h}),e(Z,{open:t,onClose:()=>v(!1),breakdown:m,costFormatted:h})]})]})]})}function z({input:l,output:r,reasoning:c,cacheRead:h,cacheWrite:x,cacheHitPercent:m}){return e(d,{children:[e("div",{className:"mb-1.5",children:e("span",{className:"text-xs font-semibold text-ink/80",children:"Last Assistant Message"})}),e("div",{className:"flex gap-2 flex-wrap",children:[e(it,{variant:"compact",label:"In",value:l.toLocaleString()}),e(it,{variant:"compact",label:"Out",value:r.toLocaleString()}),e(it,{variant:"compact",label:"Reason",value:c.toLocaleString()}),e(it,{variant:"compact",label:"Cache",value:`${h.toLocaleString()}/${x.toLocaleString()}`}),e(it,{variant:"compact",label:"Hit",value:`${m.toFixed(1)}%`})]})]})}function Q({userPercent:l,assistantPercent:r,toolPercent:c,otherPercent:h}){return e("div",{className:"space-y-2.5",children:[e("div",{className:"w-full h-1.5 rounded-full overflow-hidden flex bg-ink/10",children:[e("div",{className:"h-full bg-emerald-500 transition-all duration-300",style:{width:`${l}%`},title:`User: ${l}%`}),e("div",{className:"h-full bg-sky-500 transition-all duration-300",style:{width:`${r}%`},title:`Assistant: ${r}%`}),e("div",{className:"h-full bg-amber-500 transition-all duration-300",style:{width:`${c}%`},title:`Tool Calls: ${c}%`}),e("div",{className:"h-full bg-slate-400 transition-all duration-300",style:{width:`${h}%`},title:`Other: ${h}%`})]}),e("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-[11px] text-ink/70",children:[e("div",{className:"flex items-center space-x-1.5",children:[e("span",{className:"w-2 h-2 rounded-full bg-emerald-500 flex-shrink-0"}),e("span",{children:["User ",l,"%"]})]}),e("div",{className:"flex items-center space-x-1.5",children:[e("span",{className:"w-2 h-2 rounded-full bg-sky-500 flex-shrink-0"}),e("span",{children:["Assistant ",r,"%"]})]}),e("div",{className:"flex items-center space-x-1.5",children:[e("span",{className:"w-2 h-2 rounded-full bg-amber-500 flex-shrink-0"}),e("span",{children:["Tool Calls ",c,"%"]})]}),e("div",{className:"flex items-center space-x-1.5",children:[e("span",{className:"w-2 h-2 rounded-full bg-slate-400 flex-shrink-0"}),e("span",{children:["Other ",h,"%"]})]})]})]})}function G({data:l}){pi();let[r,c]=n(!1),h=i(null),x=i(null),m=JSON.stringify(l,null,2),t=pA(m),v=a((C)=>{let g=x.current;if(!g)return;g.scrollLeft=C.currentTarget.scrollLeft,g.scrollTop=C.currentTarget.scrollTop},[]),y=a(async(C)=>{C.stopPropagation();try{await navigator.clipboard.writeText(m)}catch{let g=document.createElement("textarea");g.value=m,g.style.position="fixed",g.style.opacity="0",document.body.appendChild(g),g.select(),document.execCommand("copy"),document.body.removeChild(g)}c(!0),setTimeout(()=>c(!1),2000)},[m]);return e("div",{className:"relative my-1.5 rounded-lg bg-paper/80 border border-ink/10 overflow-hidden",children:[e("div",{className:"flex items-center justify-between px-2.5 py-1.5 bg-ink/[0.04] border-b border-ink/10",children:[e("span",{className:"text-[10px] font-mono text-ink/50 select-none",children:[Object.keys(l).length," keys · ",m.length," chars"]}),e("button",{type:"button",onClick:y,className:"flex items-center space-x-1 px-2 py-1 rounded bg-canvas hover:bg-paper text-ink/70 hover:text-ink border border-ink/10 text-[10px] transition-colors shadow-xs",title:"Copy Pretty JSON",children:r?e(d,{children:[e(f,{size:11,className:"text-success"}),e("span",{className:"text-success font-sans font-medium",children:"Copied"})]}):e(d,{children:[e(re,{size:11}),e("span",{className:"font-sans",children:"Copy JSON"})]})})]}),e("div",{className:"relative",children:[e("pre",{ref:x,"aria-hidden":!0,className:"absolute inset-0 p-2.5 m-0 font-mono text-[11px] leading-5 overflow-x-auto overflow-y-auto whitespace-pre pointer-events-none",dangerouslySetInnerHTML:{__html:t}}),e("pre",{ref:h,onScroll:v,className:"relative p-2.5 m-0 font-mono text-[11px] leading-5 overflow-x-auto overflow-y-auto whitespace-pre select-text selection:bg-ink selection:text-canvas",children:e("code",{className:"text-transparent",children:m})})]})]})}var D=["bg-emerald-500","bg-sky-500","bg-amber-500","bg-violet-500","bg-rose-500","bg-teal-500","bg-indigo-500","bg-fuchsia-500","bg-lime-500","bg-cyan-500","bg-orange-500","bg-pink-500","bg-yellow-500","bg-purple-500","bg-red-500","bg-blue-500","bg-green-500","bg-cyan-600","bg-violet-600","bg-amber-600"],L=20;function K(l){let r=0;for(let c=0;c<l.length;c++)r=r*31+l.charCodeAt(c)|0;return Math.abs(r)}function q(l){let r=l.indexOf("/"),c=r>0?l.slice(0,r):l,h=r>0?l.slice(r+1):"";return h?`${c} · ${h}`:c}function Y(l,r){if(r<=7)return Array.from({length:r},(t,v)=>v+1);let c=new Set([1,r,l,l-1,l+1]);if(l<=3)[2,3,4].forEach((t)=>c.add(t));if(l>=r-2)[r-3,r-2,r-1].forEach((t)=>c.add(t));let h=[...c].filter((t)=>t>=1&&t<=r).sort((t,v)=>t-v),x=[],m=0;for(let t of h){if(t-m>1)x.push("…");x.push(t),m=t}return x}function X({sessionId:l,refreshKey:r=0}){let[c,h]=_("context.rawExpandedIds",{}),[x,m]=_("context.rawFilterRole","all"),[t,v]=n(1),[y,C]=n([]),[g,I]=n(0),[W,S]=n(!1),w=i(0),E=i(!1),j=a((p)=>{if(typeof window>"u")return;let k=++w.current;if(!p?.silent)S(!0);let P=new URLSearchParams({page:String(t),pageSize:String(L),role:x});if(l)P.set("sessionId",l);fetch(`/api/telemetry/raw-messages?${P.toString()}`).then((N)=>N.ok?N.json():null).then((N)=>{if(E.current||k!==w.current)return;C(N&&Array.isArray(N.items)?N.items:[]),I(N&&Number.isFinite(N.filteredTotal)?N.filteredTotal:0)}).catch(()=>{if(E.current||k!==w.current)return;C([]),I(0)}).finally(()=>{if(!p?.silent&&k===w.current)S(!1)})},[l,t,x]);o(()=>(E.current=!1,j(),()=>{E.current=!0}),[j,r]);let R=Math.max(1,Math.ceil(g/L)),M=Math.min(t,R),U=(p)=>v(Math.min(Math.max(1,p),R)),ee=(p)=>{h((k)=>({...k,[p]:!k[p]}))},te=()=>{if(y.every((k)=>c[k.id]))h({});else{let k={};y.forEach((P)=>{k[P.id]=!0}),h(k)}},H=u(()=>{let p=[];for(let k of y){let P=k.info.modelID;if(!P||p.includes(P))continue;p.push(P)}return p},[y]),A=(p)=>p?D[K(p)%D.length]:"bg-ink/20";return e("div",{className:"space-y-3",children:[H.length>0&&e("div",{children:[e("div",{className:"mb-1.5",children:e("span",{className:"text-xs font-semibold text-ink/80",children:"Legend"})}),e("div",{className:"bg-canvas border border-ink/10 rounded-xl px-3 py-2",children:e("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[10px] font-mono text-ink/60",children:H.map((p)=>e("span",{className:"flex items-center gap-1.5",children:[e("span",{className:`w-2 h-2 rounded-full ${A(p)}`}),e("span",{children:q(p)})]},p))})})]}),e("div",{className:"flex items-center justify-between",children:[e("div",{className:"flex items-center space-x-2",children:[e("span",{className:"text-xs font-semibold text-ink/80",children:"Raw Messages"}),e("span",{className:"text-[10px] font-mono text-ink/50 bg-ink/5 px-1.5 py-0.5 rounded-full border border-ink/10",children:g})]}),e("div",{className:"flex items-center space-x-1",children:[e("div",{className:"flex items-center bg-canvas border border-ink/10 rounded-lg p-0.5 text-[10px]",children:[e("button",{type:"button",onClick:()=>{m("all"),v(1)},className:`px-1.5 py-0.5 rounded ${x==="all"?"bg-ink text-canvas font-medium":"text-ink/60 hover:text-ink"}`,children:"All"}),e("button",{type:"button",onClick:()=>{m("assistant"),v(1)},className:`px-1.5 py-0.5 rounded ${x==="assistant"?"bg-ink text-canvas font-medium":"text-ink/60 hover:text-ink"}`,children:"AI"}),e("button",{type:"button",onClick:()=>{m("user"),v(1)},className:`px-1.5 py-0.5 rounded ${x==="user"?"bg-ink text-canvas font-medium":"text-ink/60 hover:text-ink"}`,children:"User"})]}),e("button",{type:"button",onClick:te,className:"p-1 rounded text-ink/60 hover:text-ink hover:bg-ink/5 transition-colors text-[10px] flex items-center",title:"Expand / Collapse All",children:e(F,{size:14})})]})]}),e("div",{className:"space-y-1.5",children:!W&&y.length===0?e("div",{className:"p-4 text-center text-xs text-ink/40 italic bg-canvas rounded-xl border border-ink/10",children:"No raw messages recorded yet."}):y.map((p)=>{let k=Boolean(c[p.id]);return e("div",{className:`bg-canvas border border-ink/10 rounded-xl overflow-hidden transition-all duration-200 ${W?"opacity-50":""}`,children:[e("button",{type:"button",onClick:()=>ee(p.id),className:"w-full text-left px-3.5 py-2.5 flex items-center justify-between hover:bg-ink/5 transition-colors cursor-pointer",children:[e("div",{className:"flex items-center space-x-2 min-w-0 flex-1 mr-2",children:[e("span",{className:"text-ink/40 flex-shrink-0",children:k?e(B,{size:14}):e(se,{size:14})}),e("span",{className:"text-xs font-mono text-ink/90 truncate",children:p.badgeLabel})]}),e("div",{className:"flex items-center space-x-3 text-[11px] font-mono text-ink/50 flex-shrink-0",children:[p.tokenSummary&&e("span",{className:"text-ink/60",children:p.tokenSummary}),e("span",{className:"flex items-center gap-1.5",children:[e("span",{className:`w-2 h-2 rounded-full ${A(p.info.modelID)}`}),e("span",{children:p.timestamp})]})]})]}),k&&e("div",{className:"px-3.5 pb-3 pt-1 border-t border-ink/5 bg-canvas/60",children:e(G,{data:p.rawPayload})})]},p.id)})}),R>1&&e("div",{className:"flex items-center justify-between pt-1",children:[e("span",{className:"text-[10px] font-mono text-ink/50",children:[(M-1)*L+1,"–",Math.min(M*L,g)," of ",g]}),e("div",{className:"flex items-center gap-0.5",children:[e("button",{type:"button",disabled:M<=1,onClick:()=>U(M-1),className:"p-1 rounded text-ink/60 hover:text-ink hover:bg-ink/5 disabled:opacity-30 disabled:hover:bg-transparent transition-colors",title:"Previous page",children:e(va,{size:14})}),Y(M,R).map((p,k)=>p==="…"?e("span",{className:"px-1 text-[10px] font-mono text-ink/40 select-none",children:"…"},`gap-${k}`):e("button",{type:"button",onClick:()=>U(p),className:`min-w-[22px] h-[22px] px-1 rounded text-[10px] font-mono transition-colors ${p===M?"bg-ink text-canvas font-medium":"text-ink/60 hover:text-ink hover:bg-ink/5"}`,children:p},p)),e("button",{type:"button",disabled:M>=R,onClick:()=>U(M+1),className:"p-1 rounded text-ink/60 hover:text-ink hover:bg-ink/5 disabled:opacity-30 disabled:hover:bg-transparent transition-colors",title:"Next page",children:e(se,{size:14})})]})]})]})}function mt({className:l="",enabled:r=!0,refreshKey:c=0,tabsMode:h=!1}){let[x]=le(),m=x.get("sessionId"),[t,v]=n(()=>O(m||"default","Session not started")),y=i(!1),C=a(()=>{if(typeof window>"u")return;let S=m?`?sessionId=${encodeURIComponent(m)}`:"";fetch(`/api/telemetry/context${S}`).then((w)=>w.ok?w.json():null).then((w)=>{if(!y.current&&w&&w.telemetry)v(w.telemetry)}).catch((w)=>{if(!y.current)console.warn("Failed to fetch context telemetry:",w)})},[m]);o(()=>{if(y.current=!1,!r)return;return C(),()=>{y.current=!0}},[r,c,C]);let g=Ee(m?Qp(m):null,{enabled:r}),[I,W]=n(0);if(o(()=>{if(g.data)v(g.data),W((S)=>S+1)},[g.data]),!r)return e("div",{className:`flex flex-col h-full bg-paper items-center justify-center text-ink/40 ${l}`,children:e("span",{className:"text-xs font-mono text-muted",children:"No session selected"})});if(t.messagesCount===0)return e("div",{className:`flex flex-col h-full bg-paper items-center justify-center text-ink/40 ${l}`,children:e("span",{className:"text-xs font-mono",children:"Session not started"})});return e("div",{className:`flex flex-col h-full bg-paper text-ink overflow-hidden select-none ${l}`,children:[e(At,{left:e(d,{children:[e(Ha,{id:"context",tabsMode:h,children:e("h2",{className:"text-xs font-medium text-ink tracking-tight truncate",children:t.sessionTitle})}),e("span",{className:"text-[11px] text-ink/50 truncate font-mono",children:t.timestamp})]}),right:e(ot,{label:"Refresh context telemetry",onClick:()=>{g.refresh(),C()},busy:g.refreshing,disabled:!r})}),e("div",{className:"flex-1 scrollbar-overlay-container p-4 space-y-4",children:[e(J,{used:t.contextUsed,limit:t.contextLimit,percent:t.contextPercent}),e(V,{messagesCount:t.messagesCount,userCount:t.userCount,assistantCount:t.assistantCount,costFormatted:t.costFormatted,cacheHitAverage:t.cacheHitAverage,costBreakdown:t.costBreakdown}),e(z,{input:t.lastMessage.input,output:t.lastMessage.output,reasoning:t.lastMessage.reasoning,cacheRead:t.lastMessage.cacheRead,cacheWrite:t.lastMessage.cacheWrite,cacheHitPercent:t.lastMessage.cacheHitPercent}),e(Q,{userPercent:t.distribution.userPercent,assistantPercent:t.distribution.assistantPercent,toolPercent:t.distribution.toolPercent,otherPercent:t.distribution.otherPercent}),e(X,{sessionId:m,refreshKey:c+I})]})]})}export{mt as ContextPanel};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e=Object.freeze(JSON.parse('{"displayName":"Shell","name":"shellscript","patterns":[{"include":"#initial_context"}],"repository":{"alias_statement":{"begin":"[\\\\t ]*+(alias)[\\\\t ]*+((?:((?<!\\\\w)-\\\\w+)\\\\b[\\\\t ]*+)*)[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))","beginCaptures":{"1":{"name":"storage.type.alias.shell"},"2":{"patterns":[{"match":"(?<!\\\\w)-\\\\w+\\\\b","name":"string.unquoted.argument.shell constant.other.option.shell"}]},"3":{"name":"string.unquoted.argument.shell constant.other.option.shell"},"4":{"name":"variable.other.assignment.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"variable.other.assignment.shell"},"7":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"8":{"name":"punctuation.definition.array.access.shell"},"9":{"name":"keyword.operator.assignment.shell"},"10":{"name":"keyword.operator.assignment.compound.shell"},"11":{"name":"keyword.operator.assignment.compound.shell"}},"end":"(?=[\\\\t ]|$)|(?:(?:(?:(;)|(&&))|(\\\\|\\\\|))|(&))","endCaptures":{"1":{"name":"punctuation.terminator.statement.semicolon.shell"},"2":{"name":"punctuation.separator.statement.and.shell"},"3":{"name":"punctuation.separator.statement.or.shell"},"4":{"name":"punctuation.separator.statement.background.shell"}},"name":"meta.expression.assignment.alias.shell","patterns":[{"include":"#normal_context"}]},"argument":{"begin":"[\\\\t ]++(?![\\\\n#\\\\&(\\\\[|]|$|;)","beginCaptures":{},"end":"(?=[\\\\t \\\\&;|]|$|[\\\\n)`])","endCaptures":{},"name":"meta.argument.shell","patterns":[{"include":"#argument_context"},{"include":"#line_continuation"}]},"argument_context":{"patterns":[{"captures":{"1":{"name":"string.unquoted.argument.shell","patterns":[{"match":"\\\\*","name":"variable.language.special.wildcard.shell"},{"include":"#variable"},{"include":"#numeric_literal"},{"captures":{"1":{"name":"constant.language.$1.shell"}},"match":"(?<!\\\\w)\\\\b(true|false)\\\\b(?!\\\\w)"}]}},"match":"[\\\\t ]*+([^\\\\t\\\\n \\"$\\\\&-);<>\\\\\\\\`|]+(?!>))"},{"include":"#normal_context"}]},"arithmetic_double":{"patterns":[{"begin":"\\\\(\\\\(","beginCaptures":{"0":{"name":"punctuation.section.arithmetic.double.shell"}},"end":"\\\\)\\\\s*\\\\)","endCaptures":{"0":{"name":"punctuation.section.arithmetic.double.shell"}},"name":"meta.arithmetic.shell","patterns":[{"include":"#math"},{"include":"#string"}]}]},"arithmetic_no_dollar":{"patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.arithmetic.single.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.arithmetic.single.shell"}},"name":"meta.arithmetic.shell","patterns":[{"include":"#math"},{"include":"#string"}]}]},"array_access_inline":{"captures":{"1":{"name":"punctuation.section.array.shell"},"2":{"patterns":[{"include":"#special_expansion"},{"include":"#string"},{"include":"#variable"}]},"3":{"name":"punctuation.section.array.shell"}},"match":"(\\\\[)([^]\\\\[]+)(])"},"array_value":{"begin":"[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))[\\\\t ]*+(\\\\()","beginCaptures":{"1":{"name":"variable.other.assignment.shell"},"2":{"name":"punctuation.definition.array.access.shell"},"3":{"name":"variable.other.assignment.shell"},"4":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"keyword.operator.assignment.shell"},"7":{"name":"keyword.operator.assignment.compound.shell"},"8":{"name":"keyword.operator.assignment.compound.shell"},"9":{"name":"punctuation.definition.array.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.array.shell"}},"patterns":[{"include":"#comment"},{"captures":{"1":{"name":"variable.other.assignment.array.shell entity.other.attribute-name.shell"},"2":{"name":"keyword.operator.assignment.shell punctuation.definition.assignment.shell"}},"match":"((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(=)"},{"captures":{"1":{"name":"punctuation.definition.bracket.named-array.shell"},"2":{"name":"string.unquoted.shell entity.other.attribute-name.bracket.shell"},"3":{"name":"punctuation.definition.bracket.named-array.shell"},"4":{"name":"punctuation.definition.assignment.shell"}},"match":"(\\\\[)(.+?)(])(=)"},{"include":"#normal_context"},{"include":"#simple_unquoted"}]},"assignment_statement":{"patterns":[{"include":"#array_value"},{"include":"#modified_assignment_statement"},{"include":"#normal_assignment_statement"}]},"basic_command_name":{"captures":{"1":{"name":"storage.modifier.$1.shell"},"2":{"name":"entity.name.function.call.shell entity.name.command.shell","patterns":[{"match":"(?<!\\\\w)(?:continue|return|break)(?!\\\\w)","name":"keyword.control.$0.shell"},{"match":"(?<!\\\\w)(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|[.:])(?!/)(?!\\\\w)(?!-)","name":"support.function.builtin.shell"},{"include":"#variable"}]}},"match":"(?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;])(?!nocorrect |nocorrect\\\\t|nocorrect$|readonly |readonly\\\\t|readonly$|function |function\\\\t|function$|foreach |foreach\\\\t|foreach$|coproc |coproc\\\\t|coproc$|logout |logout\\\\t|logout$|export |export\\\\t|export$|select |select\\\\t|select$|repeat |repeat\\\\t|repeat$|pushd |pushd\\\\t|pushd$|until |until\\\\t|until$|while |while\\\\t|while$|local |local\\\\t|local$|case |case\\\\t|case$|done |done\\\\t|done$|elif |elif\\\\t|elif$|else |else\\\\t|else$|esac |esac\\\\t|esac$|popd |popd\\\\t|popd$|then |then\\\\t|then$|time |time\\\\t|time$|for |for\\\\t|for$|end |end\\\\t|end$|fi |fi\\\\t|fi$|do |do\\\\t|do$|in |in\\\\t|in$|if |if\\\\t|if$)(?:((?<=^|[\\\\t \\\\&;])(?:readonly|declare|typeset|export|local)(?=[\\\\t \\\\&;]|$))|((?![\\"\']|\\\\\\\\\\\\n?$)[^\\\\t\\\\n\\\\r !\\"\'<>]+?))(?:(?=[\\\\t ])|(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\))","name":"meta.statement.command.name.basic.shell"},"block_comment":{"begin":"\\\\s*+(/\\\\*)","beginCaptures":{"1":{"name":"punctuation.definition.comment.begin.shell"}},"end":"\\\\*/","endCaptures":{"0":{"name":"punctuation.definition.comment.end.shell"}},"name":"comment.block.shell"},"boolean":{"match":"\\\\b(?:true|false)\\\\b","name":"constant.language.$0.shell"},"case_statement":{"begin":"\\\\b(case)\\\\b[\\\\t ]*+(.+?)[\\\\t ]*+\\\\b(in)\\\\b","beginCaptures":{"1":{"name":"keyword.control.case.shell"},"2":{"patterns":[{"include":"#initial_context"}]},"3":{"name":"keyword.control.in.shell"}},"end":"\\\\besac\\\\b","endCaptures":{"0":{"name":"keyword.control.esac.shell"}},"name":"meta.case.shell","patterns":[{"include":"#comment"},{"captures":{"1":{"name":"keyword.operator.pattern.case.default.shell"}},"match":"[\\\\t ]*+(\\\\* *\\\\))"},{"begin":"(?<!\\\\))(?![\\\\t ]*+(?:esac\\\\b|$))","beginCaptures":{},"end":"(?=\\\\besac\\\\b)|(\\\\))","endCaptures":{"1":{"name":"keyword.operator.pattern.case.shell"}},"name":"meta.case.entry.pattern.shell","patterns":[{"include":"#case_statement_context"}]},{"begin":"(?<=\\\\))","beginCaptures":{},"end":"(;;)|(?=\\\\besac\\\\b)","endCaptures":{"1":{"name":"punctuation.terminator.statement.case.shell"}},"name":"meta.case.entry.body.shell","patterns":[{"include":"#typical_statements"},{"include":"#initial_context"}]}]},"case_statement_context":{"patterns":[{"match":"\\\\*","name":"variable.language.special.quantifier.star.shell keyword.operator.quantifier.star.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell"},{"match":"\\\\+","name":"variable.language.special.quantifier.plus.shell keyword.operator.quantifier.plus.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell"},{"match":"\\\\?","name":"variable.language.special.quantifier.question.shell keyword.operator.quantifier.question.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell"},{"match":"@","name":"variable.language.special.at.shell keyword.operator.at.shell punctuation.definition.regex.at.shell"},{"match":"\\\\|","name":"keyword.operator.orvariable.language.special.or.shell keyword.operator.alternation.ruby.shell punctuation.definition.regex.alternation.shell punctuation.separator.regex.alternation.shell"},{"match":"\\\\\\\\.","name":"constant.character.escape.shell"},{"match":"(?<=\\\\tin| in|[\\\\t ]|;;)\\\\(","name":"keyword.operator.pattern.case.shell"},{"begin":"(?<=\\\\S)(\\\\()","beginCaptures":{"1":{"name":"punctuation.definition.group.shell punctuation.definition.regex.group.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.definition.regex.group.shell"}},"name":"meta.parenthese.shell","patterns":[{"include":"#case_statement_context"}]},{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.character-class.shell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.character-class.shell"}},"name":"string.regexp.character-class.shell","patterns":[{"match":"\\\\\\\\.","name":"constant.character.escape.shell"}]},{"include":"#string"},{"match":"[^\\\\t\\\\n )*?@\\\\[|]","name":"string.unquoted.pattern.shell string.regexp.unquoted.shell"}]},"command_name_range":{"begin":"\\\\G","beginCaptures":{},"end":"(?=[\\\\t \\\\&;|]|$|[\\\\n)`])|(?=<)","endCaptures":{},"name":"meta.statement.command.name.shell","patterns":[{"match":"(?<!\\\\w)(?:continue|return|break)(?!\\\\w)","name":"entity.name.function.call.shell entity.name.command.shell keyword.control.$0.shell"},{"match":"(?<!\\\\w)(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|[.:])(?!/)(?!\\\\w)(?!-)","name":"entity.name.function.call.shell entity.name.command.shell support.function.builtin.shell"},{"include":"#variable"},{"captures":{"1":{"name":"entity.name.function.call.shell entity.name.command.shell"}},"match":"(?<!\\\\w)(?<=\\\\G|[\\"\')}])([^\\\\t\\\\n\\\\r \\"\\\\&\');->`{|]+)"},{"begin":"(?:\\\\G|(?<![\\\\t\\\\n #\\\\&;{|]))(\\\\$?)((\\")|(\'))","beginCaptures":{"1":{"name":"meta.statement.command.name.quoted.shell punctuation.definition.string.shell entity.name.function.call.shell entity.name.command.shell"},"2":{},"3":{"name":"meta.statement.command.name.quoted.shell string.quoted.double.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell"},"4":{"name":"meta.statement.command.name.quoted.shell string.quoted.single.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell"}},"end":"(?<!\\\\G)(?<=\\\\2)","endCaptures":{},"patterns":[{"include":"#continuation_of_single_quoted_command_name"},{"include":"#continuation_of_double_quoted_command_name"}]},{"include":"#line_continuation"},{"include":"#simple_unquoted"}]},"command_statement":{"begin":"[\\\\t ]*+(?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;])(?!nocorrect |nocorrect\\\\t|nocorrect$|readonly |readonly\\\\t|readonly$|function |function\\\\t|function$|foreach |foreach\\\\t|foreach$|coproc |coproc\\\\t|coproc$|logout |logout\\\\t|logout$|export |export\\\\t|export$|select |select\\\\t|select$|repeat |repeat\\\\t|repeat$|pushd |pushd\\\\t|pushd$|until |until\\\\t|until$|while |while\\\\t|while$|local |local\\\\t|local$|case |case\\\\t|case$|done |done\\\\t|done$|elif |elif\\\\t|elif$|else |else\\\\t|else$|esac |esac\\\\t|esac$|popd |popd\\\\t|popd$|then |then\\\\t|then$|time |time\\\\t|time$|for |for\\\\t|for$|end |end\\\\t|end$|fi |fi\\\\t|fi$|do |do\\\\t|do$|in |in\\\\t|in$|if |if\\\\t|if$)(?!\\\\\\\\\\\\n?$)","beginCaptures":{},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.command.shell","patterns":[{"include":"#command_name_range"},{"include":"#line_continuation"},{"include":"#option"},{"include":"#argument"},{"include":"#string"},{"include":"#heredoc"}]},"comment":{"captures":{"1":{"name":"comment.line.number-sign.shell meta.shebang.shell"},"2":{"name":"punctuation.definition.comment.shebang.shell"},"3":{"name":"comment.line.number-sign.shell"},"4":{"name":"punctuation.definition.comment.shell"}},"match":"(?:^|[\\\\t ]++)(?:((#!).*)|((#).*))"},"comments":{"patterns":[{"include":"#block_comment"},{"include":"#line_comment"}]},"compound-command":{"patterns":[{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"name":"meta.scope.logical-expression.shell","patterns":[{"include":"#logical-expression"},{"include":"#initial_context"}]},{"begin":"(?<=\\\\s|^)\\\\{(?=\\\\s|$)","beginCaptures":{"0":{"name":"punctuation.definition.group.shell"}},"end":"(?<=^|;)\\\\s*(})","endCaptures":{"1":{"name":"punctuation.definition.group.shell"}},"name":"meta.scope.group.shell","patterns":[{"include":"#initial_context"}]}]},"continuation_of_double_quoted_command_name":{"begin":"\\\\G(?<=\\")","beginCaptures":{},"contentName":"meta.statement.command.name.continuation string.quoted.double entity.name.function.call entity.name.command","end":"\\"","endCaptures":{"0":{"name":"string.quoted.double.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell"}},"patterns":[{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\`]","name":"constant.character.escape.shell"},{"include":"#variable"},{"include":"#interpolation"}]},"continuation_of_single_quoted_command_name":{"begin":"\\\\G(?<=\')","beginCaptures":{},"contentName":"meta.statement.command.name.continuation string.quoted.single entity.name.function.call entity.name.command","end":"\'","endCaptures":{"0":{"name":"string.quoted.single.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell"}}},"custom_command_names":{"patterns":[]},"custom_commands":{"patterns":[]},"double_quote_context":{"patterns":[{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\`]","name":"constant.character.escape.shell"},{"include":"#variable"},{"include":"#interpolation"}]},"double_quote_escape_char":{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\`]","name":"constant.character.escape.shell"},"floating_keyword":{"patterns":[{"match":"(?<=^|[\\\\t \\\\&;])(?:then|elif|else|done|end|do|if|fi)(?=[\\\\t \\\\&;]|$)","name":"keyword.control.$0.shell"}]},"for_statement":{"patterns":[{"begin":"\\\\b(for)\\\\b[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))[\\\\t ]*+\\\\b(in)\\\\b","beginCaptures":{"1":{"name":"keyword.control.for.shell"},"2":{"name":"variable.other.for.shell"},"3":{"name":"keyword.control.in.shell"}},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.for.in.shell","patterns":[{"include":"#string"},{"include":"#simple_unquoted"},{"include":"#normal_context"}]},{"begin":"\\\\b(for)\\\\b","beginCaptures":{"1":{"name":"keyword.control.for.shell"}},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.for.shell","patterns":[{"include":"#arithmetic_double"},{"include":"#normal_context"}]}]},"function_definition":{"applyEndPatternLast":1,"begin":"[\\\\t ]*+(?:\\\\b(function)\\\\b[\\\\t ]*+([^\\\\t\\\\n\\\\r \\"\'()=]+)(?:(\\\\()[\\\\t ]*+(\\\\)))?|([^\\\\t\\\\n\\\\r \\"\'()=]+)[\\\\t ]*+(\\\\()[\\\\t ]*+(\\\\)))","beginCaptures":{"1":{"name":"storage.type.function.shell"},"2":{"name":"entity.name.function.shell"},"3":{"name":"punctuation.definition.arguments.shell"},"4":{"name":"punctuation.definition.arguments.shell"},"5":{"name":"entity.name.function.shell"},"6":{"name":"punctuation.definition.arguments.shell"},"7":{"name":"punctuation.definition.arguments.shell"}},"end":"(?<=[)}])","endCaptures":{},"name":"meta.function.shell","patterns":[{"match":"\\\\G[\\\\t\\\\n ]"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"name":"meta.function.body.shell","patterns":[{"include":"#initial_context"}]},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"name":"meta.function.body.shell","patterns":[{"include":"#initial_context"}]},{"include":"#initial_context"}]},"heredoc":{"patterns":[{"begin":"((?<!<)<<-)[\\\\t ]*+([\\"\'])[\\\\t ]*+([^\\"\']+?)(?=[\\"\\\\&\';<\\\\s])(\\\\2)(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.quote.shell"},"3":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"4":{"name":"punctuation.definition.string.heredoc.quote.shell"},"5":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.quoted.heredoc.indent.$3","end":"^\\\\t*\\\\3(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.$0.shell"}},"patterns":[]},{"begin":"((?<!<)<<(?!<))[\\\\t ]*+([\\"\'])[\\\\t ]*+([^\\"\']+?)(?=[\\"\\\\&\';<\\\\s])(\\\\2)(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.quote.shell"},"3":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"4":{"name":"punctuation.definition.string.heredoc.quote.shell"},"5":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.quoted.heredoc.no-indent.$3","end":"^\\\\3(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.delimiter.shell"}},"patterns":[]},{"begin":"((?<!<)<<-)[\\\\t ]*+([^\\\\t \\"\']+)(?=[\\"\\\\&\';<\\\\s])(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"3":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.unquoted.heredoc.indent.$2","end":"^\\\\t*\\\\2(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.delimiter.shell"}},"patterns":[{"include":"#double_quote_escape_char"},{"include":"#variable"},{"include":"#interpolation"}]},{"begin":"((?<!<)<<(?!<))[\\\\t ]*+([^\\\\t \\"\']+)(?=[\\"\\\\&\';<\\\\s])(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"3":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.unquoted.heredoc.no-indent.$2","end":"^\\\\2(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.delimiter.shell"}},"patterns":[{"include":"#double_quote_escape_char"},{"include":"#variable"},{"include":"#interpolation"}]}]},"herestring":{"patterns":[{"begin":"(<<<)\\\\s*((\'))","beginCaptures":{"1":{"name":"keyword.operator.herestring.shell"},"2":{"name":"string.quoted.single.shell"},"3":{"name":"punctuation.definition.string.begin.shell"}},"contentName":"string.quoted.single.shell","end":"(\')","endCaptures":{"0":{"name":"string.quoted.single.shell"},"1":{"name":"punctuation.definition.string.end.shell"}},"name":"meta.herestring.shell"},{"begin":"(<<<)\\\\s*((\\"))","beginCaptures":{"1":{"name":"keyword.operator.herestring.shell"},"2":{"name":"string.quoted.double.shell"},"3":{"name":"punctuation.definition.string.begin.shell"}},"contentName":"string.quoted.double.shell","end":"(\\")","endCaptures":{"0":{"name":"string.quoted.double.shell"},"1":{"name":"punctuation.definition.string.end.shell"}},"name":"meta.herestring.shell","patterns":[{"include":"#double_quote_context"}]},{"captures":{"1":{"name":"keyword.operator.herestring.shell"},"2":{"name":"string.unquoted.herestring.shell","patterns":[{"include":"#initial_context"}]}},"match":"(<<<)\\\\s*(([^)\\\\\\\\\\\\s]|\\\\\\\\.)+)","name":"meta.herestring.shell"}]},"initial_context":{"patterns":[{"include":"#comment"},{"include":"#pipeline"},{"include":"#normal_statement_seperator"},{"include":"#logical_expression_double"},{"include":"#logical_expression_single"},{"include":"#assignment_statement"},{"include":"#case_statement"},{"include":"#for_statement"},{"include":"#loop"},{"include":"#function_definition"},{"include":"#line_continuation"},{"include":"#arithmetic_double"},{"include":"#misc_ranges"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#redirection"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#alias_statement"},{"include":"#normal_statement"},{"include":"#string"},{"include":"#support"}]},"inline_comment":{"captures":{"1":{"name":"comment.block.shell punctuation.definition.comment.begin.shell"},"2":{"name":"comment.block.shell"},"3":{"patterns":[{"match":"\\\\*/","name":"comment.block.shell punctuation.definition.comment.end.shell"},{"match":"\\\\*","name":"comment.block.shell"}]}},"match":"(/\\\\*)((?:[^*]|\\\\*++[^/])*+(\\\\*++/))"},"interpolation":{"patterns":[{"include":"#arithmetic_dollar"},{"include":"#subshell_dollar"},{"begin":"`","beginCaptures":{"0":{"name":"punctuation.definition.evaluation.backticks.shell"}},"end":"`","endCaptures":{"0":{"name":"punctuation.definition.evaluation.backticks.shell"}},"name":"string.interpolated.backtick.shell","patterns":[{"match":"\\\\\\\\[$\\\\\\\\`]","name":"constant.character.escape.shell"},{"begin":"(?<=\\\\W)(?=#)(?!#\\\\{)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.shell"}},"end":"(?!\\\\G)","patterns":[{"begin":"#","beginCaptures":{"0":{"name":"punctuation.definition.comment.shell"}},"end":"(?=`)","name":"comment.line.number-sign.shell"}]},{"include":"#initial_context"}]}]},"keyword":{"patterns":[{"match":"(?<=^|[\\\\&;\\\\s])(then|else|elif|fi|for|in|do|done|select|continue|esac|while|until|return)(?=[\\\\&;\\\\s]|$)","name":"keyword.control.shell"},{"match":"(?<=^|[\\\\&;\\\\s])(?:export|declare|typeset|local|readonly)(?=[\\\\&;\\\\s]|$)","name":"storage.modifier.shell"}]},"line_comment":{"begin":"\\\\s*+(//)","beginCaptures":{"1":{"name":"punctuation.definition.comment.shell"}},"end":"(?<=\\\\n)(?<!\\\\\\\\\\\\n)","endCaptures":{},"name":"comment.line.double-slash.shell","patterns":[{"include":"#line_continuation_character"}]},"line_continuation":{"match":"\\\\\\\\(?=\\\\n)","name":"constant.character.escape.line-continuation.shell"},"logical-expression":{"patterns":[{"include":"#arithmetic_no_dollar"},{"match":"=[=~]?|!=?|[<>]|&&|\\\\|\\\\|","name":"keyword.operator.logical.shell"},{"match":"(?<!\\\\S)-(nt|ot|ef|eq|ne|l[et]|g[et]|[GLNOSa-hknopr-uwxz])\\\\b","name":"keyword.operator.logical.shell"}]},"logical_expression_context":{"patterns":[{"include":"#regex_comparison"},{"include":"#arithmetic_no_dollar"},{"include":"#logical-expression"},{"include":"#logical_expression_single"},{"include":"#logical_expression_double"},{"include":"#comment"},{"include":"#boolean"},{"include":"#redirect_number"},{"include":"#numeric_literal"},{"include":"#pipeline"},{"include":"#normal_statement_seperator"},{"include":"#string"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#support"}]},"logical_expression_double":{"begin":"\\\\[\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"end":"]]","endCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"name":"meta.scope.logical-expression.shell","patterns":[{"include":"#logical_expression_context"}]},"logical_expression_single":{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"name":"meta.scope.logical-expression.shell","patterns":[{"include":"#logical_expression_context"}]},"loop":{"patterns":[{"begin":"(?<=^|[\\\\&;\\\\s])(for)\\\\s+(.+?)\\\\s+(in)(?=[\\\\&;\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.control.shell"},"2":{"name":"variable.other.loop.shell","patterns":[{"include":"#string"}]},"3":{"name":"keyword.control.shell"}},"end":"(?<=^|[\\\\&;\\\\s])done(?=[\\\\&;\\\\s]|$|\\\\))","endCaptures":{"0":{"name":"keyword.control.shell"}},"name":"meta.scope.for-in-loop.shell","patterns":[{"include":"#initial_context"}]},{"begin":"(?<=^|[\\\\&;\\\\s])(while|until)(?=[\\\\&;\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.control.shell"}},"end":"(?<=^|[\\\\&;\\\\s])done(?=[\\\\&;\\\\s]|$|\\\\))","endCaptures":{"0":{"name":"keyword.control.shell"}},"name":"meta.scope.while-loop.shell","patterns":[{"include":"#initial_context"}]},{"begin":"(?<=^|[\\\\&;\\\\s])(select)\\\\s+((?:[^\\\\\\\\\\\\s]|\\\\\\\\.)+)(?=[\\\\&;\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.control.shell"},"2":{"name":"variable.other.loop.shell"}},"end":"(?<=^|[\\\\&;\\\\s])(done)(?=[\\\\&;\\\\s]|$|\\\\))","endCaptures":{"1":{"name":"keyword.control.shell"}},"name":"meta.scope.select-block.shell","patterns":[{"include":"#initial_context"}]},{"begin":"(?<=^|[\\\\&;\\\\s])if(?=[\\\\&;\\\\s]|$)","beginCaptures":{"0":{"name":"keyword.control.if.shell"}},"end":"(?<=^|[\\\\&;\\\\s])fi(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"keyword.control.fi.shell"}},"name":"meta.scope.if-block.shell","patterns":[{"include":"#initial_context"}]}]},"math":{"patterns":[{"include":"#variable"},{"match":"\\\\+{1,2}|-{1,2}|[!~]|\\\\*{1,2}|[%/]|<[<=]?|>[=>]?|==|!=|^|\\\\|{1,2}|&{1,2}|[,:=?]|[-%\\\\&*+/^|]=|<<=|>>=","name":"keyword.operator.arithmetic.shell"},{"match":"0[Xx]\\\\h+","name":"constant.numeric.hex.shell"},{"match":";","name":"punctuation.separator.semicolon.range"},{"match":"0\\\\d+","name":"constant.numeric.octal.shell"},{"match":"\\\\d{1,2}#[0-9@-Z_a-z]+","name":"constant.numeric.other.shell"},{"match":"\\\\d+","name":"constant.numeric.integer.shell"},{"match":"(?<!\\\\w)[0-9A-Z_a-z]+(?!\\\\w)","name":"variable.other.normal.shell"}]},"math_operators":{"patterns":[{"match":"\\\\+{1,2}|-{1,2}|[!~]|\\\\*{1,2}|[%/]|<[<=]?|>[=>]?|==|!=|^|\\\\|{1,2}|&{1,2}|[,:=?]|[-%\\\\&*+/^|]=|<<=|>>=","name":"keyword.operator.arithmetic.shell"},{"match":"0[Xx]\\\\h+","name":"constant.numeric.hex.shell"},{"match":"0\\\\d+","name":"constant.numeric.octal.shell"},{"match":"\\\\d{1,2}#[0-9@-Z_a-z]+","name":"constant.numeric.other.shell"},{"match":"\\\\d+","name":"constant.numeric.integer.shell"}]},"misc_ranges":{"patterns":[{"include":"#logical_expression_single"},{"include":"#logical_expression_double"},{"include":"#subshell_dollar"},{"begin":"(?<![^\\\\t ])(\\\\{)(?![$\\\\w])","beginCaptures":{"1":{"name":"punctuation.definition.group.shell"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.group.shell"}},"name":"meta.scope.group.shell","patterns":[{"include":"#initial_context"}]}]},"modified_assignment_statement":{"begin":"(?<=^|[\\\\t \\\\&;])(?:readonly|declare|typeset|export|local)(?=[\\\\t \\\\&;]|$)","beginCaptures":{"0":{"name":"storage.modifier.$0.shell"}},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.shell meta.expression.assignment.modified.shell","patterns":[{"match":"(?<!\\\\w)-\\\\w+\\\\b","name":"string.unquoted.argument.shell constant.other.option.shell"},{"include":"#array_value"},{"captures":{"1":{"name":"variable.other.assignment.shell"},"2":{"name":"punctuation.definition.array.access.shell"},"3":{"name":"variable.other.assignment.shell"},"4":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"keyword.operator.assignment.shell"},"7":{"name":"keyword.operator.assignment.compound.shell"},"8":{"name":"keyword.operator.assignment.compound.shell"},"9":{"name":"constant.numeric.shell constant.numeric.hex.shell"},"10":{"name":"constant.numeric.shell constant.numeric.octal.shell"},"11":{"name":"constant.numeric.shell constant.numeric.other.shell"},"12":{"name":"constant.numeric.shell constant.numeric.decimal.shell"},"13":{"name":"constant.numeric.shell constant.numeric.version.shell"},"14":{"name":"constant.numeric.shell constant.numeric.integer.shell"}},"match":"((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))?(?:(?<=[\\\\t =]|^|[(\\\\[{])(?:(?:(?:(?:(?:(0[Xx]\\\\h+)|(0\\\\d+))|(\\\\d{1,2}#[0-9@-Z_a-z]+))|(-?\\\\d+\\\\.\\\\d+))|(-?\\\\d+(?:\\\\.\\\\d+)+))|(-?\\\\d+))(?=[\\\\t ]|$|[);}]))?"},{"include":"#normal_context"}]},"modifiers":{"match":"(?<=^|[\\\\t \\\\&;])(?:readonly|declare|typeset|export|local)(?=[\\\\t \\\\&;]|$)","name":"storage.modifier.$0.shell"},"normal_assignment_statement":{"begin":"[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))","beginCaptures":{"1":{"name":"variable.other.assignment.shell"},"2":{"name":"punctuation.definition.array.access.shell"},"3":{"name":"variable.other.assignment.shell"},"4":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"keyword.operator.assignment.shell"},"7":{"name":"keyword.operator.assignment.compound.shell"},"8":{"name":"keyword.operator.assignment.compound.shell"}},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.expression.assignment.shell","patterns":[{"include":"#comment"},{"include":"#string"},{"include":"#normal_assignment_statement"},{"begin":"(?<=[\\\\t ])(?![\\\\t ]|\\\\w+=)","beginCaptures":{},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.command.env.shell","patterns":[{"include":"#command_name_range"},{"include":"#line_continuation"},{"include":"#option"},{"include":"#argument"},{"include":"#string"}]},{"include":"#simple_unquoted"},{"include":"#normal_context"}]},"normal_context":{"patterns":[{"include":"#comment"},{"include":"#pipeline"},{"include":"#normal_statement_seperator"},{"include":"#misc_ranges"},{"include":"#boolean"},{"include":"#redirect_number"},{"include":"#numeric_literal"},{"include":"#string"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#redirection"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#support"},{"include":"#parenthese"}]},"normal_statement":{"begin":"(?!^[\\\\t ]*+$)(?:(?<=(?:^until| until|\\\\tuntil|^while| while|\\\\twhile|^elif| elif|\\\\telif|^else| else|\\\\telse|^then| then|\\\\tthen|^do| do|\\\\tdo|^if| if|\\\\tif) )|(?<=^|[!\\\\&(;`{|]))[\\\\t ]*+(?!nocorrect\\\\W|nocorrect\\\\$|function\\\\W|function\\\\$|foreach\\\\W|foreach\\\\$|repeat\\\\W|repeat\\\\$|logout\\\\W|logout\\\\$|coproc\\\\W|coproc\\\\$|select\\\\W|select\\\\$|while\\\\W|while\\\\$|pushd\\\\W|pushd\\\\$|until\\\\W|until\\\\$|case\\\\W|case\\\\$|done\\\\W|done\\\\$|elif\\\\W|elif\\\\$|else\\\\W|else\\\\$|esac\\\\W|esac\\\\$|popd\\\\W|popd\\\\$|then\\\\W|then\\\\$|time\\\\W|time\\\\$|for\\\\W|for\\\\$|end\\\\W|end\\\\$|fi\\\\W|fi\\\\$|do\\\\W|do\\\\$|in\\\\W|in\\\\$|if\\\\W|if\\\\$)","beginCaptures":{},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.shell","patterns":[{"include":"#typical_statements"}]},"normal_statement_seperator":{"captures":{"1":{"name":"punctuation.terminator.statement.semicolon.shell"},"2":{"name":"punctuation.separator.statement.and.shell"},"3":{"name":"punctuation.separator.statement.or.shell"},"4":{"name":"punctuation.separator.statement.background.shell"}},"match":"(?:(?:(;)|(&&))|(\\\\|\\\\|))|(&)"},"numeric_literal":{"captures":{"1":{"name":"constant.numeric.shell constant.numeric.hex.shell"},"2":{"name":"constant.numeric.shell constant.numeric.octal.shell"},"3":{"name":"constant.numeric.shell constant.numeric.other.shell"},"4":{"name":"constant.numeric.shell constant.numeric.decimal.shell"},"5":{"name":"constant.numeric.shell constant.numeric.version.shell"},"6":{"name":"constant.numeric.shell constant.numeric.integer.shell"}},"match":"(?<=[\\\\t =]|^|[(\\\\[{])(?:(?:(?:(?:(?:(0[Xx]\\\\h+)|(0\\\\d+))|(\\\\d{1,2}#[0-9@-Z_a-z]+))|(-?\\\\d+\\\\.\\\\d+))|(-?\\\\d+(?:\\\\.\\\\d+)+))|(-?\\\\d+))(?=[\\\\t ]|$|[);}])"},"option":{"begin":"[\\\\t ]++(-)((?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;]))","beginCaptures":{"1":{"name":"string.unquoted.argument.shell constant.other.option.dash.shell"},"2":{"name":"string.unquoted.argument.shell constant.other.option.shell"}},"contentName":"string.unquoted.argument constant.other.option","end":"(?=[\\\\t ])|(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"patterns":[{"include":"#option_context"}]},"option_context":{"patterns":[{"include":"#misc_ranges"},{"include":"#string"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#redirection"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#support"}]},"parenthese":{"patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.parenthese.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.parenthese.shell"}},"name":"meta.parenthese.group.shell","patterns":[{"include":"#initial_context"}]}]},"pathname":{"patterns":[{"match":"(?<=[:=\\\\s]|^)~","name":"keyword.operator.tilde.shell"},{"match":"[*?]","name":"keyword.operator.glob.shell"},{"begin":"([!*+?@])(\\\\()","beginCaptures":{"1":{"name":"keyword.operator.extglob.shell"},"2":{"name":"punctuation.definition.extglob.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.extglob.shell"}},"name":"meta.structure.extglob.shell","patterns":[{"include":"#initial_context"}]}]},"pipeline":{"patterns":[{"match":"(?<=^|[\\\\&;\\\\s])(time)(?=[\\\\&;\\\\s]|$)","name":"keyword.other.shell"},{"match":"[!|]","name":"keyword.operator.pipe.shell"}]},"redirect_fix":{"captures":{"1":{"name":"keyword.operator.redirect.shell"},"2":{"name":"string.unquoted.argument.shell"}},"match":"(>>?)[\\\\t ]*+([^\\\\t\\\\n \\"$\\\\&-);<>\\\\\\\\`|]+)"},"redirect_number":{"captures":{"1":{"name":"keyword.operator.redirect.stdout.shell"},"2":{"name":"keyword.operator.redirect.stderr.shell"},"3":{"name":"keyword.operator.redirect.$3.shell"}},"match":"(?<=[\\\\t ])(?:(1)|(2)|(\\\\d+))(?=>)"},"redirection":{"patterns":[{"begin":"[<>]\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.interpolated.process-substitution.shell","patterns":[{"include":"#initial_context"}]},{"match":"(?<![<>])(&>|\\\\d*>&\\\\d*|\\\\d*(>>|[<>])|\\\\d*<&|\\\\d*<>)(?![<>])","name":"keyword.operator.redirect.shell"}]},"regex_comparison":{"match":"=~","name":"keyword.operator.logical.regex.shell"},"regexp":{"patterns":[{"match":".+"}]},"simple_options":{"captures":{"0":{"patterns":[{"captures":{"1":{"name":"string.unquoted.argument.shell constant.other.option.dash.shell"},"2":{"name":"string.unquoted.argument.shell constant.other.option.shell"}},"match":"[\\\\t ]++(-)(\\\\w+)"}]}},"match":"(?:[\\\\t ]++-\\\\w+)*"},"simple_unquoted":{"match":"[^\\\\t\\\\n \\"$\\\\&-);<>\\\\\\\\`|]","name":"string.unquoted.shell"},"special_expansion":{"match":"!|:[-=?]?|[*@]|##?|%%|[%/]","name":"keyword.operator.expansion.shell"},"start_of_command":{"match":"[\\\\t ]*+(?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;])(?!nocorrect |nocorrect\\\\t|nocorrect$|readonly |readonly\\\\t|readonly$|function |function\\\\t|function$|foreach |foreach\\\\t|foreach$|coproc |coproc\\\\t|coproc$|logout |logout\\\\t|logout$|export |export\\\\t|export$|select |select\\\\t|select$|repeat |repeat\\\\t|repeat$|pushd |pushd\\\\t|pushd$|until |until\\\\t|until$|while |while\\\\t|while$|local |local\\\\t|local$|case |case\\\\t|case$|done |done\\\\t|done$|elif |elif\\\\t|elif$|else |else\\\\t|else$|esac |esac\\\\t|esac$|popd |popd\\\\t|popd$|then |then\\\\t|then$|time |time\\\\t|time$|for |for\\\\t|for$|end |end\\\\t|end$|fi |fi\\\\t|fi$|do |do\\\\t|do$|in |in\\\\t|in$|if |if\\\\t|if$)(?!\\\\\\\\\\\\n?$)"},"string":{"patterns":[{"match":"\\\\\\\\.","name":"constant.character.escape.shell"},{"begin":"\'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"\'","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.quoted.single.shell"},{"begin":"\\\\$?\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.quoted.double.shell","patterns":[{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\`]","name":"constant.character.escape.shell"},{"include":"#variable"},{"include":"#interpolation"}]},{"begin":"\\\\$\'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"\'","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.quoted.single.dollar.shell","patterns":[{"match":"\\\\\\\\[\'\\\\\\\\abefnrtv]","name":"constant.character.escape.ansi-c.shell"},{"match":"\\\\\\\\[0-9]{3}\\"","name":"constant.character.escape.octal.shell"},{"match":"\\\\\\\\x\\\\h{2}\\"","name":"constant.character.escape.hex.shell"},{"match":"\\\\\\\\c.\\"","name":"constant.character.escape.control-char.shell"}]}]},"subshell_dollar":{"patterns":[{"begin":"\\\\$\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.subshell.single.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.subshell.single.shell"}},"name":"meta.scope.subshell","patterns":[{"include":"#parenthese"},{"include":"#initial_context"}]}]},"support":{"patterns":[{"match":"(?<=^|[\\\\&;\\\\s])[.:](?=[\\\\&;\\\\s]|$)","name":"support.function.builtin.shell"}]},"typical_statements":{"patterns":[{"include":"#assignment_statement"},{"include":"#case_statement"},{"include":"#for_statement"},{"include":"#while_statement"},{"include":"#function_definition"},{"include":"#command_statement"},{"include":"#line_continuation"},{"include":"#arithmetic_double"},{"include":"#normal_context"}]},"variable":{"patterns":[{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.parameter.positional.all.shell"},"2":{"name":"variable.parameter.positional.all.shell"}},"match":"(\\\\$)(@(?!\\\\w))"},{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.parameter.positional.shell"},"2":{"name":"variable.parameter.positional.shell"}},"match":"(\\\\$)([0-9](?!\\\\w))"},{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.language.special.shell"},"2":{"name":"variable.language.special.shell"}},"match":"(\\\\$)([-!#$*0?_](?!\\\\w))"},{"begin":"(\\\\$)(\\\\{)[\\\\t ]*+(?=\\\\d)","beginCaptures":{"1":{"name":"punctuation.definition.variable.shell variable.parameter.positional.shell"},"2":{"name":"punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell variable.parameter.positional.shell"}},"contentName":"meta.parameter-expansion","end":"}","endCaptures":{"0":{"name":"punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell variable.parameter.positional.shell"}},"patterns":[{"include":"#special_expansion"},{"include":"#array_access_inline"},{"match":"[0-9]+","name":"variable.parameter.positional.shell"},{"match":"(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)","name":"variable.other.normal.shell"},{"include":"#variable"},{"include":"#string"}]},{"begin":"(\\\\$)(\\\\{)","beginCaptures":{"1":{"name":"punctuation.definition.variable.shell"},"2":{"name":"punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell"}},"contentName":"meta.parameter-expansion","end":"}","endCaptures":{"0":{"name":"punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell"}},"patterns":[{"include":"#special_expansion"},{"include":"#array_access_inline"},{"match":"(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)","name":"variable.other.normal.shell"},{"include":"#variable"},{"include":"#string"}]},{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.other.normal.shell"},"2":{"name":"variable.other.normal.shell"}},"match":"(\\\\$)(\\\\w+(?!\\\\w))"}]},"while_statement":{"patterns":[{"begin":"\\\\b(while)\\\\b","beginCaptures":{"1":{"name":"keyword.control.while.shell"}},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.while.shell","patterns":[{"include":"#line_continuation"},{"include":"#math_operators"},{"include":"#option"},{"include":"#simple_unquoted"},{"include":"#normal_context"},{"include":"#string"}]}]}},"scopeName":"source.shell","aliases":["bash","sh","shell","zsh"]}')),Tp=[e];
|
|
2
|
-
export{
|
|
1
|
+
var e=Object.freeze(JSON.parse('{"displayName":"Shell","name":"shellscript","patterns":[{"include":"#initial_context"}],"repository":{"alias_statement":{"begin":"[\\\\t ]*+(alias)[\\\\t ]*+((?:((?<!\\\\w)-\\\\w+)\\\\b[\\\\t ]*+)*)[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))","beginCaptures":{"1":{"name":"storage.type.alias.shell"},"2":{"patterns":[{"match":"(?<!\\\\w)-\\\\w+\\\\b","name":"string.unquoted.argument.shell constant.other.option.shell"}]},"3":{"name":"string.unquoted.argument.shell constant.other.option.shell"},"4":{"name":"variable.other.assignment.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"variable.other.assignment.shell"},"7":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"8":{"name":"punctuation.definition.array.access.shell"},"9":{"name":"keyword.operator.assignment.shell"},"10":{"name":"keyword.operator.assignment.compound.shell"},"11":{"name":"keyword.operator.assignment.compound.shell"}},"end":"(?=[\\\\t ]|$)|(?:(?:(?:(;)|(&&))|(\\\\|\\\\|))|(&))","endCaptures":{"1":{"name":"punctuation.terminator.statement.semicolon.shell"},"2":{"name":"punctuation.separator.statement.and.shell"},"3":{"name":"punctuation.separator.statement.or.shell"},"4":{"name":"punctuation.separator.statement.background.shell"}},"name":"meta.expression.assignment.alias.shell","patterns":[{"include":"#normal_context"}]},"argument":{"begin":"[\\\\t ]++(?![\\\\n#\\\\&(\\\\[|]|$|;)","beginCaptures":{},"end":"(?=[\\\\t \\\\&;|]|$|[\\\\n)`])","endCaptures":{},"name":"meta.argument.shell","patterns":[{"include":"#argument_context"},{"include":"#line_continuation"}]},"argument_context":{"patterns":[{"captures":{"1":{"name":"string.unquoted.argument.shell","patterns":[{"match":"\\\\*","name":"variable.language.special.wildcard.shell"},{"include":"#variable"},{"include":"#numeric_literal"},{"captures":{"1":{"name":"constant.language.$1.shell"}},"match":"(?<!\\\\w)\\\\b(true|false)\\\\b(?!\\\\w)"}]}},"match":"[\\\\t ]*+([^\\\\t\\\\n \\"$\\\\&-);<>\\\\\\\\`|]+(?!>))"},{"include":"#normal_context"}]},"arithmetic_double":{"patterns":[{"begin":"\\\\(\\\\(","beginCaptures":{"0":{"name":"punctuation.section.arithmetic.double.shell"}},"end":"\\\\)\\\\s*\\\\)","endCaptures":{"0":{"name":"punctuation.section.arithmetic.double.shell"}},"name":"meta.arithmetic.shell","patterns":[{"include":"#math"},{"include":"#string"}]}]},"arithmetic_no_dollar":{"patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.arithmetic.single.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.arithmetic.single.shell"}},"name":"meta.arithmetic.shell","patterns":[{"include":"#math"},{"include":"#string"}]}]},"array_access_inline":{"captures":{"1":{"name":"punctuation.section.array.shell"},"2":{"patterns":[{"include":"#special_expansion"},{"include":"#string"},{"include":"#variable"}]},"3":{"name":"punctuation.section.array.shell"}},"match":"(\\\\[)([^]\\\\[]+)(])"},"array_value":{"begin":"[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))[\\\\t ]*+(\\\\()","beginCaptures":{"1":{"name":"variable.other.assignment.shell"},"2":{"name":"punctuation.definition.array.access.shell"},"3":{"name":"variable.other.assignment.shell"},"4":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"keyword.operator.assignment.shell"},"7":{"name":"keyword.operator.assignment.compound.shell"},"8":{"name":"keyword.operator.assignment.compound.shell"},"9":{"name":"punctuation.definition.array.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.array.shell"}},"patterns":[{"include":"#comment"},{"captures":{"1":{"name":"variable.other.assignment.array.shell entity.other.attribute-name.shell"},"2":{"name":"keyword.operator.assignment.shell punctuation.definition.assignment.shell"}},"match":"((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(=)"},{"captures":{"1":{"name":"punctuation.definition.bracket.named-array.shell"},"2":{"name":"string.unquoted.shell entity.other.attribute-name.bracket.shell"},"3":{"name":"punctuation.definition.bracket.named-array.shell"},"4":{"name":"punctuation.definition.assignment.shell"}},"match":"(\\\\[)(.+?)(])(=)"},{"include":"#normal_context"},{"include":"#simple_unquoted"}]},"assignment_statement":{"patterns":[{"include":"#array_value"},{"include":"#modified_assignment_statement"},{"include":"#normal_assignment_statement"}]},"basic_command_name":{"captures":{"1":{"name":"storage.modifier.$1.shell"},"2":{"name":"entity.name.function.call.shell entity.name.command.shell","patterns":[{"match":"(?<!\\\\w)(?:continue|return|break)(?!\\\\w)","name":"keyword.control.$0.shell"},{"match":"(?<!\\\\w)(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|[.:])(?!/)(?!\\\\w)(?!-)","name":"support.function.builtin.shell"},{"include":"#variable"}]}},"match":"(?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;])(?!nocorrect |nocorrect\\\\t|nocorrect$|readonly |readonly\\\\t|readonly$|function |function\\\\t|function$|foreach |foreach\\\\t|foreach$|coproc |coproc\\\\t|coproc$|logout |logout\\\\t|logout$|export |export\\\\t|export$|select |select\\\\t|select$|repeat |repeat\\\\t|repeat$|pushd |pushd\\\\t|pushd$|until |until\\\\t|until$|while |while\\\\t|while$|local |local\\\\t|local$|case |case\\\\t|case$|done |done\\\\t|done$|elif |elif\\\\t|elif$|else |else\\\\t|else$|esac |esac\\\\t|esac$|popd |popd\\\\t|popd$|then |then\\\\t|then$|time |time\\\\t|time$|for |for\\\\t|for$|end |end\\\\t|end$|fi |fi\\\\t|fi$|do |do\\\\t|do$|in |in\\\\t|in$|if |if\\\\t|if$)(?:((?<=^|[\\\\t \\\\&;])(?:readonly|declare|typeset|export|local)(?=[\\\\t \\\\&;]|$))|((?![\\"\']|\\\\\\\\\\\\n?$)[^\\\\t\\\\n\\\\r !\\"\'<>]+?))(?:(?=[\\\\t ])|(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\))","name":"meta.statement.command.name.basic.shell"},"block_comment":{"begin":"\\\\s*+(/\\\\*)","beginCaptures":{"1":{"name":"punctuation.definition.comment.begin.shell"}},"end":"\\\\*/","endCaptures":{"0":{"name":"punctuation.definition.comment.end.shell"}},"name":"comment.block.shell"},"boolean":{"match":"\\\\b(?:true|false)\\\\b","name":"constant.language.$0.shell"},"case_statement":{"begin":"\\\\b(case)\\\\b[\\\\t ]*+(.+?)[\\\\t ]*+\\\\b(in)\\\\b","beginCaptures":{"1":{"name":"keyword.control.case.shell"},"2":{"patterns":[{"include":"#initial_context"}]},"3":{"name":"keyword.control.in.shell"}},"end":"\\\\besac\\\\b","endCaptures":{"0":{"name":"keyword.control.esac.shell"}},"name":"meta.case.shell","patterns":[{"include":"#comment"},{"captures":{"1":{"name":"keyword.operator.pattern.case.default.shell"}},"match":"[\\\\t ]*+(\\\\* *\\\\))"},{"begin":"(?<!\\\\))(?![\\\\t ]*+(?:esac\\\\b|$))","beginCaptures":{},"end":"(?=\\\\besac\\\\b)|(\\\\))","endCaptures":{"1":{"name":"keyword.operator.pattern.case.shell"}},"name":"meta.case.entry.pattern.shell","patterns":[{"include":"#case_statement_context"}]},{"begin":"(?<=\\\\))","beginCaptures":{},"end":"(;;)|(?=\\\\besac\\\\b)","endCaptures":{"1":{"name":"punctuation.terminator.statement.case.shell"}},"name":"meta.case.entry.body.shell","patterns":[{"include":"#typical_statements"},{"include":"#initial_context"}]}]},"case_statement_context":{"patterns":[{"match":"\\\\*","name":"variable.language.special.quantifier.star.shell keyword.operator.quantifier.star.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell"},{"match":"\\\\+","name":"variable.language.special.quantifier.plus.shell keyword.operator.quantifier.plus.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell"},{"match":"\\\\?","name":"variable.language.special.quantifier.question.shell keyword.operator.quantifier.question.shell punctuation.definition.arbitrary-repetition.shell punctuation.definition.regex.arbitrary-repetition.shell"},{"match":"@","name":"variable.language.special.at.shell keyword.operator.at.shell punctuation.definition.regex.at.shell"},{"match":"\\\\|","name":"keyword.operator.orvariable.language.special.or.shell keyword.operator.alternation.ruby.shell punctuation.definition.regex.alternation.shell punctuation.separator.regex.alternation.shell"},{"match":"\\\\\\\\.","name":"constant.character.escape.shell"},{"match":"(?<=\\\\tin| in|[\\\\t ]|;;)\\\\(","name":"keyword.operator.pattern.case.shell"},{"begin":"(?<=\\\\S)(\\\\()","beginCaptures":{"1":{"name":"punctuation.definition.group.shell punctuation.definition.regex.group.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.definition.regex.group.shell"}},"name":"meta.parenthese.shell","patterns":[{"include":"#case_statement_context"}]},{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.character-class.shell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.character-class.shell"}},"name":"string.regexp.character-class.shell","patterns":[{"match":"\\\\\\\\.","name":"constant.character.escape.shell"}]},{"include":"#string"},{"match":"[^\\\\t\\\\n )*?@\\\\[|]","name":"string.unquoted.pattern.shell string.regexp.unquoted.shell"}]},"command_name_range":{"begin":"\\\\G","beginCaptures":{},"end":"(?=[\\\\t \\\\&;|]|$|[\\\\n)`])|(?=<)","endCaptures":{},"name":"meta.statement.command.name.shell","patterns":[{"match":"(?<!\\\\w)(?:continue|return|break)(?!\\\\w)","name":"entity.name.function.call.shell entity.name.command.shell keyword.control.$0.shell"},{"match":"(?<!\\\\w)(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|[.:])(?!/)(?!\\\\w)(?!-)","name":"entity.name.function.call.shell entity.name.command.shell support.function.builtin.shell"},{"include":"#variable"},{"captures":{"1":{"name":"entity.name.function.call.shell entity.name.command.shell"}},"match":"(?<!\\\\w)(?<=\\\\G|[\\"\')}])([^\\\\t\\\\n\\\\r \\"\\\\&\');->`{|]+)"},{"begin":"(?:\\\\G|(?<![\\\\t\\\\n #\\\\&;{|]))(\\\\$?)((\\")|(\'))","beginCaptures":{"1":{"name":"meta.statement.command.name.quoted.shell punctuation.definition.string.shell entity.name.function.call.shell entity.name.command.shell"},"2":{},"3":{"name":"meta.statement.command.name.quoted.shell string.quoted.double.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell"},"4":{"name":"meta.statement.command.name.quoted.shell string.quoted.single.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell"}},"end":"(?<!\\\\G)(?<=\\\\2)","endCaptures":{},"patterns":[{"include":"#continuation_of_single_quoted_command_name"},{"include":"#continuation_of_double_quoted_command_name"}]},{"include":"#line_continuation"},{"include":"#simple_unquoted"}]},"command_statement":{"begin":"[\\\\t ]*+(?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;])(?!nocorrect |nocorrect\\\\t|nocorrect$|readonly |readonly\\\\t|readonly$|function |function\\\\t|function$|foreach |foreach\\\\t|foreach$|coproc |coproc\\\\t|coproc$|logout |logout\\\\t|logout$|export |export\\\\t|export$|select |select\\\\t|select$|repeat |repeat\\\\t|repeat$|pushd |pushd\\\\t|pushd$|until |until\\\\t|until$|while |while\\\\t|while$|local |local\\\\t|local$|case |case\\\\t|case$|done |done\\\\t|done$|elif |elif\\\\t|elif$|else |else\\\\t|else$|esac |esac\\\\t|esac$|popd |popd\\\\t|popd$|then |then\\\\t|then$|time |time\\\\t|time$|for |for\\\\t|for$|end |end\\\\t|end$|fi |fi\\\\t|fi$|do |do\\\\t|do$|in |in\\\\t|in$|if |if\\\\t|if$)(?!\\\\\\\\\\\\n?$)","beginCaptures":{},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.command.shell","patterns":[{"include":"#command_name_range"},{"include":"#line_continuation"},{"include":"#option"},{"include":"#argument"},{"include":"#string"},{"include":"#heredoc"}]},"comment":{"captures":{"1":{"name":"comment.line.number-sign.shell meta.shebang.shell"},"2":{"name":"punctuation.definition.comment.shebang.shell"},"3":{"name":"comment.line.number-sign.shell"},"4":{"name":"punctuation.definition.comment.shell"}},"match":"(?:^|[\\\\t ]++)(?:((#!).*)|((#).*))"},"comments":{"patterns":[{"include":"#block_comment"},{"include":"#line_comment"}]},"compound-command":{"patterns":[{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"name":"meta.scope.logical-expression.shell","patterns":[{"include":"#logical-expression"},{"include":"#initial_context"}]},{"begin":"(?<=\\\\s|^)\\\\{(?=\\\\s|$)","beginCaptures":{"0":{"name":"punctuation.definition.group.shell"}},"end":"(?<=^|;)\\\\s*(})","endCaptures":{"1":{"name":"punctuation.definition.group.shell"}},"name":"meta.scope.group.shell","patterns":[{"include":"#initial_context"}]}]},"continuation_of_double_quoted_command_name":{"begin":"\\\\G(?<=\\")","beginCaptures":{},"contentName":"meta.statement.command.name.continuation string.quoted.double entity.name.function.call entity.name.command","end":"\\"","endCaptures":{"0":{"name":"string.quoted.double.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell"}},"patterns":[{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\`]","name":"constant.character.escape.shell"},{"include":"#variable"},{"include":"#interpolation"}]},"continuation_of_single_quoted_command_name":{"begin":"\\\\G(?<=\')","beginCaptures":{},"contentName":"meta.statement.command.name.continuation string.quoted.single entity.name.function.call entity.name.command","end":"\'","endCaptures":{"0":{"name":"string.quoted.single.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell"}}},"custom_command_names":{"patterns":[]},"custom_commands":{"patterns":[]},"double_quote_context":{"patterns":[{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\`]","name":"constant.character.escape.shell"},{"include":"#variable"},{"include":"#interpolation"}]},"double_quote_escape_char":{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\`]","name":"constant.character.escape.shell"},"floating_keyword":{"patterns":[{"match":"(?<=^|[\\\\t \\\\&;])(?:then|elif|else|done|end|do|if|fi)(?=[\\\\t \\\\&;]|$)","name":"keyword.control.$0.shell"}]},"for_statement":{"patterns":[{"begin":"\\\\b(for)\\\\b[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))[\\\\t ]*+\\\\b(in)\\\\b","beginCaptures":{"1":{"name":"keyword.control.for.shell"},"2":{"name":"variable.other.for.shell"},"3":{"name":"keyword.control.in.shell"}},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.for.in.shell","patterns":[{"include":"#string"},{"include":"#simple_unquoted"},{"include":"#normal_context"}]},{"begin":"\\\\b(for)\\\\b","beginCaptures":{"1":{"name":"keyword.control.for.shell"}},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.for.shell","patterns":[{"include":"#arithmetic_double"},{"include":"#normal_context"}]}]},"function_definition":{"applyEndPatternLast":1,"begin":"[\\\\t ]*+(?:\\\\b(function)\\\\b[\\\\t ]*+([^\\\\t\\\\n\\\\r \\"\'()=]+)(?:(\\\\()[\\\\t ]*+(\\\\)))?|([^\\\\t\\\\n\\\\r \\"\'()=]+)[\\\\t ]*+(\\\\()[\\\\t ]*+(\\\\)))","beginCaptures":{"1":{"name":"storage.type.function.shell"},"2":{"name":"entity.name.function.shell"},"3":{"name":"punctuation.definition.arguments.shell"},"4":{"name":"punctuation.definition.arguments.shell"},"5":{"name":"entity.name.function.shell"},"6":{"name":"punctuation.definition.arguments.shell"},"7":{"name":"punctuation.definition.arguments.shell"}},"end":"(?<=[)}])","endCaptures":{},"name":"meta.function.shell","patterns":[{"match":"\\\\G[\\\\t\\\\n ]"},{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"name":"meta.function.body.shell","patterns":[{"include":"#initial_context"}]},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},"name":"meta.function.body.shell","patterns":[{"include":"#initial_context"}]},{"include":"#initial_context"}]},"heredoc":{"patterns":[{"begin":"((?<!<)<<-)[\\\\t ]*+([\\"\'])[\\\\t ]*+([^\\"\']+?)(?=[\\"\\\\&\';<\\\\s])(\\\\2)(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.quote.shell"},"3":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"4":{"name":"punctuation.definition.string.heredoc.quote.shell"},"5":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.quoted.heredoc.indent.$3","end":"^\\\\t*\\\\3(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.$0.shell"}},"patterns":[]},{"begin":"((?<!<)<<(?!<))[\\\\t ]*+([\\"\'])[\\\\t ]*+([^\\"\']+?)(?=[\\"\\\\&\';<\\\\s])(\\\\2)(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.quote.shell"},"3":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"4":{"name":"punctuation.definition.string.heredoc.quote.shell"},"5":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.quoted.heredoc.no-indent.$3","end":"^\\\\3(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.delimiter.shell"}},"patterns":[]},{"begin":"((?<!<)<<-)[\\\\t ]*+([^\\\\t \\"\']+)(?=[\\"\\\\&\';<\\\\s])(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"3":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.unquoted.heredoc.indent.$2","end":"^\\\\t*\\\\2(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.delimiter.shell"}},"patterns":[{"include":"#double_quote_escape_char"},{"include":"#variable"},{"include":"#interpolation"}]},{"begin":"((?<!<)<<(?!<))[\\\\t ]*+([^\\\\t \\"\']+)(?=[\\"\\\\&\';<\\\\s])(.*)","beginCaptures":{"1":{"name":"keyword.operator.heredoc.shell"},"2":{"name":"punctuation.definition.string.heredoc.delimiter.shell"},"3":{"patterns":[{"include":"#redirect_fix"},{"include":"#typical_statements"}]}},"contentName":"string.unquoted.heredoc.no-indent.$2","end":"^\\\\2(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"punctuation.definition.string.heredoc.delimiter.shell"}},"patterns":[{"include":"#double_quote_escape_char"},{"include":"#variable"},{"include":"#interpolation"}]}]},"herestring":{"patterns":[{"begin":"(<<<)\\\\s*((\'))","beginCaptures":{"1":{"name":"keyword.operator.herestring.shell"},"2":{"name":"string.quoted.single.shell"},"3":{"name":"punctuation.definition.string.begin.shell"}},"contentName":"string.quoted.single.shell","end":"(\')","endCaptures":{"0":{"name":"string.quoted.single.shell"},"1":{"name":"punctuation.definition.string.end.shell"}},"name":"meta.herestring.shell"},{"begin":"(<<<)\\\\s*((\\"))","beginCaptures":{"1":{"name":"keyword.operator.herestring.shell"},"2":{"name":"string.quoted.double.shell"},"3":{"name":"punctuation.definition.string.begin.shell"}},"contentName":"string.quoted.double.shell","end":"(\\")","endCaptures":{"0":{"name":"string.quoted.double.shell"},"1":{"name":"punctuation.definition.string.end.shell"}},"name":"meta.herestring.shell","patterns":[{"include":"#double_quote_context"}]},{"captures":{"1":{"name":"keyword.operator.herestring.shell"},"2":{"name":"string.unquoted.herestring.shell","patterns":[{"include":"#initial_context"}]}},"match":"(<<<)\\\\s*(([^)\\\\\\\\\\\\s]|\\\\\\\\.)+)","name":"meta.herestring.shell"}]},"initial_context":{"patterns":[{"include":"#comment"},{"include":"#pipeline"},{"include":"#normal_statement_seperator"},{"include":"#logical_expression_double"},{"include":"#logical_expression_single"},{"include":"#assignment_statement"},{"include":"#case_statement"},{"include":"#for_statement"},{"include":"#loop"},{"include":"#function_definition"},{"include":"#line_continuation"},{"include":"#arithmetic_double"},{"include":"#misc_ranges"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#redirection"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#alias_statement"},{"include":"#normal_statement"},{"include":"#string"},{"include":"#support"}]},"inline_comment":{"captures":{"1":{"name":"comment.block.shell punctuation.definition.comment.begin.shell"},"2":{"name":"comment.block.shell"},"3":{"patterns":[{"match":"\\\\*/","name":"comment.block.shell punctuation.definition.comment.end.shell"},{"match":"\\\\*","name":"comment.block.shell"}]}},"match":"(/\\\\*)((?:[^*]|\\\\*++[^/])*+(\\\\*++/))"},"interpolation":{"patterns":[{"include":"#arithmetic_dollar"},{"include":"#subshell_dollar"},{"begin":"`","beginCaptures":{"0":{"name":"punctuation.definition.evaluation.backticks.shell"}},"end":"`","endCaptures":{"0":{"name":"punctuation.definition.evaluation.backticks.shell"}},"name":"string.interpolated.backtick.shell","patterns":[{"match":"\\\\\\\\[$\\\\\\\\`]","name":"constant.character.escape.shell"},{"begin":"(?<=\\\\W)(?=#)(?!#\\\\{)","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.shell"}},"end":"(?!\\\\G)","patterns":[{"begin":"#","beginCaptures":{"0":{"name":"punctuation.definition.comment.shell"}},"end":"(?=`)","name":"comment.line.number-sign.shell"}]},{"include":"#initial_context"}]}]},"keyword":{"patterns":[{"match":"(?<=^|[\\\\&;\\\\s])(then|else|elif|fi|for|in|do|done|select|continue|esac|while|until|return)(?=[\\\\&;\\\\s]|$)","name":"keyword.control.shell"},{"match":"(?<=^|[\\\\&;\\\\s])(?:export|declare|typeset|local|readonly)(?=[\\\\&;\\\\s]|$)","name":"storage.modifier.shell"}]},"line_comment":{"begin":"\\\\s*+(//)","beginCaptures":{"1":{"name":"punctuation.definition.comment.shell"}},"end":"(?<=\\\\n)(?<!\\\\\\\\\\\\n)","endCaptures":{},"name":"comment.line.double-slash.shell","patterns":[{"include":"#line_continuation_character"}]},"line_continuation":{"match":"\\\\\\\\(?=\\\\n)","name":"constant.character.escape.line-continuation.shell"},"logical-expression":{"patterns":[{"include":"#arithmetic_no_dollar"},{"match":"=[=~]?|!=?|[<>]|&&|\\\\|\\\\|","name":"keyword.operator.logical.shell"},{"match":"(?<!\\\\S)-(nt|ot|ef|eq|ne|l[et]|g[et]|[GLNOSa-hknopr-uwxz])\\\\b","name":"keyword.operator.logical.shell"}]},"logical_expression_context":{"patterns":[{"include":"#regex_comparison"},{"include":"#arithmetic_no_dollar"},{"include":"#logical-expression"},{"include":"#logical_expression_single"},{"include":"#logical_expression_double"},{"include":"#comment"},{"include":"#boolean"},{"include":"#redirect_number"},{"include":"#numeric_literal"},{"include":"#pipeline"},{"include":"#normal_statement_seperator"},{"include":"#string"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#support"}]},"logical_expression_double":{"begin":"\\\\[\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"end":"]]","endCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"name":"meta.scope.logical-expression.shell","patterns":[{"include":"#logical_expression_context"}]},"logical_expression_single":{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.definition.logical-expression.shell"}},"name":"meta.scope.logical-expression.shell","patterns":[{"include":"#logical_expression_context"}]},"loop":{"patterns":[{"begin":"(?<=^|[\\\\&;\\\\s])(for)\\\\s+(.+?)\\\\s+(in)(?=[\\\\&;\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.control.shell"},"2":{"name":"variable.other.loop.shell","patterns":[{"include":"#string"}]},"3":{"name":"keyword.control.shell"}},"end":"(?<=^|[\\\\&;\\\\s])done(?=[\\\\&;\\\\s]|$|\\\\))","endCaptures":{"0":{"name":"keyword.control.shell"}},"name":"meta.scope.for-in-loop.shell","patterns":[{"include":"#initial_context"}]},{"begin":"(?<=^|[\\\\&;\\\\s])(while|until)(?=[\\\\&;\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.control.shell"}},"end":"(?<=^|[\\\\&;\\\\s])done(?=[\\\\&;\\\\s]|$|\\\\))","endCaptures":{"0":{"name":"keyword.control.shell"}},"name":"meta.scope.while-loop.shell","patterns":[{"include":"#initial_context"}]},{"begin":"(?<=^|[\\\\&;\\\\s])(select)\\\\s+((?:[^\\\\\\\\\\\\s]|\\\\\\\\.)+)(?=[\\\\&;\\\\s]|$)","beginCaptures":{"1":{"name":"keyword.control.shell"},"2":{"name":"variable.other.loop.shell"}},"end":"(?<=^|[\\\\&;\\\\s])(done)(?=[\\\\&;\\\\s]|$|\\\\))","endCaptures":{"1":{"name":"keyword.control.shell"}},"name":"meta.scope.select-block.shell","patterns":[{"include":"#initial_context"}]},{"begin":"(?<=^|[\\\\&;\\\\s])if(?=[\\\\&;\\\\s]|$)","beginCaptures":{"0":{"name":"keyword.control.if.shell"}},"end":"(?<=^|[\\\\&;\\\\s])fi(?=[\\\\&;\\\\s]|$)","endCaptures":{"0":{"name":"keyword.control.fi.shell"}},"name":"meta.scope.if-block.shell","patterns":[{"include":"#initial_context"}]}]},"math":{"patterns":[{"include":"#variable"},{"match":"\\\\+{1,2}|-{1,2}|[!~]|\\\\*{1,2}|[%/]|<[<=]?|>[=>]?|==|!=|^|\\\\|{1,2}|&{1,2}|[,:=?]|[-%\\\\&*+/^|]=|<<=|>>=","name":"keyword.operator.arithmetic.shell"},{"match":"0[Xx]\\\\h+","name":"constant.numeric.hex.shell"},{"match":";","name":"punctuation.separator.semicolon.range"},{"match":"0\\\\d+","name":"constant.numeric.octal.shell"},{"match":"\\\\d{1,2}#[0-9@-Z_a-z]+","name":"constant.numeric.other.shell"},{"match":"\\\\d+","name":"constant.numeric.integer.shell"},{"match":"(?<!\\\\w)[0-9A-Z_a-z]+(?!\\\\w)","name":"variable.other.normal.shell"}]},"math_operators":{"patterns":[{"match":"\\\\+{1,2}|-{1,2}|[!~]|\\\\*{1,2}|[%/]|<[<=]?|>[=>]?|==|!=|^|\\\\|{1,2}|&{1,2}|[,:=?]|[-%\\\\&*+/^|]=|<<=|>>=","name":"keyword.operator.arithmetic.shell"},{"match":"0[Xx]\\\\h+","name":"constant.numeric.hex.shell"},{"match":"0\\\\d+","name":"constant.numeric.octal.shell"},{"match":"\\\\d{1,2}#[0-9@-Z_a-z]+","name":"constant.numeric.other.shell"},{"match":"\\\\d+","name":"constant.numeric.integer.shell"}]},"misc_ranges":{"patterns":[{"include":"#logical_expression_single"},{"include":"#logical_expression_double"},{"include":"#subshell_dollar"},{"begin":"(?<![^\\\\t ])(\\\\{)(?![$\\\\w])","beginCaptures":{"1":{"name":"punctuation.definition.group.shell"}},"end":"}","endCaptures":{"0":{"name":"punctuation.definition.group.shell"}},"name":"meta.scope.group.shell","patterns":[{"include":"#initial_context"}]}]},"modified_assignment_statement":{"begin":"(?<=^|[\\\\t \\\\&;])(?:readonly|declare|typeset|export|local)(?=[\\\\t \\\\&;]|$)","beginCaptures":{"0":{"name":"storage.modifier.$0.shell"}},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.shell meta.expression.assignment.modified.shell","patterns":[{"match":"(?<!\\\\w)-\\\\w+\\\\b","name":"string.unquoted.argument.shell constant.other.option.shell"},{"include":"#array_value"},{"captures":{"1":{"name":"variable.other.assignment.shell"},"2":{"name":"punctuation.definition.array.access.shell"},"3":{"name":"variable.other.assignment.shell"},"4":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"keyword.operator.assignment.shell"},"7":{"name":"keyword.operator.assignment.compound.shell"},"8":{"name":"keyword.operator.assignment.compound.shell"},"9":{"name":"constant.numeric.shell constant.numeric.hex.shell"},"10":{"name":"constant.numeric.shell constant.numeric.octal.shell"},"11":{"name":"constant.numeric.shell constant.numeric.other.shell"},"12":{"name":"constant.numeric.shell constant.numeric.decimal.shell"},"13":{"name":"constant.numeric.shell constant.numeric.version.shell"},"14":{"name":"constant.numeric.shell constant.numeric.integer.shell"}},"match":"((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))?(?:(?<=[\\\\t =]|^|[(\\\\[{])(?:(?:(?:(?:(?:(0[Xx]\\\\h+)|(0\\\\d+))|(\\\\d{1,2}#[0-9@-Z_a-z]+))|(-?\\\\d+\\\\.\\\\d+))|(-?\\\\d+(?:\\\\.\\\\d+)+))|(-?\\\\d+))(?=[\\\\t ]|$|[);}]))?"},{"include":"#normal_context"}]},"modifiers":{"match":"(?<=^|[\\\\t \\\\&;])(?:readonly|declare|typeset|export|local)(?=[\\\\t \\\\&;]|$)","name":"storage.modifier.$0.shell"},"normal_assignment_statement":{"begin":"[\\\\t ]*+((?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w))(?:(\\\\[)((?:(?:\\\\$?(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)|@)|\\\\*)|(-?\\\\d+))(]))?(?:(?:(=)|(\\\\+=))|(-=))","beginCaptures":{"1":{"name":"variable.other.assignment.shell"},"2":{"name":"punctuation.definition.array.access.shell"},"3":{"name":"variable.other.assignment.shell"},"4":{"name":"constant.numeric.shell constant.numeric.integer.shell"},"5":{"name":"punctuation.definition.array.access.shell"},"6":{"name":"keyword.operator.assignment.shell"},"7":{"name":"keyword.operator.assignment.compound.shell"},"8":{"name":"keyword.operator.assignment.compound.shell"}},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.expression.assignment.shell","patterns":[{"include":"#comment"},{"include":"#string"},{"include":"#normal_assignment_statement"},{"begin":"(?<=[\\\\t ])(?![\\\\t ]|\\\\w+=)","beginCaptures":{},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.command.env.shell","patterns":[{"include":"#command_name_range"},{"include":"#line_continuation"},{"include":"#option"},{"include":"#argument"},{"include":"#string"}]},{"include":"#simple_unquoted"},{"include":"#normal_context"}]},"normal_context":{"patterns":[{"include":"#comment"},{"include":"#pipeline"},{"include":"#normal_statement_seperator"},{"include":"#misc_ranges"},{"include":"#boolean"},{"include":"#redirect_number"},{"include":"#numeric_literal"},{"include":"#string"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#redirection"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#support"},{"include":"#parenthese"}]},"normal_statement":{"begin":"(?!^[\\\\t ]*+$)(?:(?<=(?:^until| until|\\\\tuntil|^while| while|\\\\twhile|^elif| elif|\\\\telif|^else| else|\\\\telse|^then| then|\\\\tthen|^do| do|\\\\tdo|^if| if|\\\\tif) )|(?<=^|[!\\\\&(;`{|]))[\\\\t ]*+(?!nocorrect\\\\W|nocorrect\\\\$|function\\\\W|function\\\\$|foreach\\\\W|foreach\\\\$|repeat\\\\W|repeat\\\\$|logout\\\\W|logout\\\\$|coproc\\\\W|coproc\\\\$|select\\\\W|select\\\\$|while\\\\W|while\\\\$|pushd\\\\W|pushd\\\\$|until\\\\W|until\\\\$|case\\\\W|case\\\\$|done\\\\W|done\\\\$|elif\\\\W|elif\\\\$|else\\\\W|else\\\\$|esac\\\\W|esac\\\\$|popd\\\\W|popd\\\\$|then\\\\W|then\\\\$|time\\\\W|time\\\\$|for\\\\W|for\\\\$|end\\\\W|end\\\\$|fi\\\\W|fi\\\\$|do\\\\W|do\\\\$|in\\\\W|in\\\\$|if\\\\W|if\\\\$)","beginCaptures":{},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.statement.shell","patterns":[{"include":"#typical_statements"}]},"normal_statement_seperator":{"captures":{"1":{"name":"punctuation.terminator.statement.semicolon.shell"},"2":{"name":"punctuation.separator.statement.and.shell"},"3":{"name":"punctuation.separator.statement.or.shell"},"4":{"name":"punctuation.separator.statement.background.shell"}},"match":"(?:(?:(;)|(&&))|(\\\\|\\\\|))|(&)"},"numeric_literal":{"captures":{"1":{"name":"constant.numeric.shell constant.numeric.hex.shell"},"2":{"name":"constant.numeric.shell constant.numeric.octal.shell"},"3":{"name":"constant.numeric.shell constant.numeric.other.shell"},"4":{"name":"constant.numeric.shell constant.numeric.decimal.shell"},"5":{"name":"constant.numeric.shell constant.numeric.version.shell"},"6":{"name":"constant.numeric.shell constant.numeric.integer.shell"}},"match":"(?<=[\\\\t =]|^|[(\\\\[{])(?:(?:(?:(?:(?:(0[Xx]\\\\h+)|(0\\\\d+))|(\\\\d{1,2}#[0-9@-Z_a-z]+))|(-?\\\\d+\\\\.\\\\d+))|(-?\\\\d+(?:\\\\.\\\\d+)+))|(-?\\\\d+))(?=[\\\\t ]|$|[);}])"},"option":{"begin":"[\\\\t ]++(-)((?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;]))","beginCaptures":{"1":{"name":"string.unquoted.argument.shell constant.other.option.dash.shell"},"2":{"name":"string.unquoted.argument.shell constant.other.option.shell"}},"contentName":"string.unquoted.argument constant.other.option","end":"(?=[\\\\t ])|(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"patterns":[{"include":"#option_context"}]},"option_context":{"patterns":[{"include":"#misc_ranges"},{"include":"#string"},{"include":"#variable"},{"include":"#interpolation"},{"include":"#heredoc"},{"include":"#herestring"},{"include":"#redirection"},{"include":"#pathname"},{"include":"#floating_keyword"},{"include":"#support"}]},"parenthese":{"patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.parenthese.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.parenthese.shell"}},"name":"meta.parenthese.group.shell","patterns":[{"include":"#initial_context"}]}]},"pathname":{"patterns":[{"match":"(?<=[:=\\\\s]|^)~","name":"keyword.operator.tilde.shell"},{"match":"[*?]","name":"keyword.operator.glob.shell"},{"begin":"([!*+?@])(\\\\()","beginCaptures":{"1":{"name":"keyword.operator.extglob.shell"},"2":{"name":"punctuation.definition.extglob.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.extglob.shell"}},"name":"meta.structure.extglob.shell","patterns":[{"include":"#initial_context"}]}]},"pipeline":{"patterns":[{"match":"(?<=^|[\\\\&;\\\\s])(time)(?=[\\\\&;\\\\s]|$)","name":"keyword.other.shell"},{"match":"[!|]","name":"keyword.operator.pipe.shell"}]},"redirect_fix":{"captures":{"1":{"name":"keyword.operator.redirect.shell"},"2":{"name":"string.unquoted.argument.shell"}},"match":"(>>?)[\\\\t ]*+([^\\\\t\\\\n \\"$\\\\&-);<>\\\\\\\\`|]+)"},"redirect_number":{"captures":{"1":{"name":"keyword.operator.redirect.stdout.shell"},"2":{"name":"keyword.operator.redirect.stderr.shell"},"3":{"name":"keyword.operator.redirect.$3.shell"}},"match":"(?<=[\\\\t ])(?:(1)|(2)|(\\\\d+))(?=>)"},"redirection":{"patterns":[{"begin":"[<>]\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.interpolated.process-substitution.shell","patterns":[{"include":"#initial_context"}]},{"match":"(?<![<>])(&>|\\\\d*>&\\\\d*|\\\\d*(>>|[<>])|\\\\d*<&|\\\\d*<>)(?![<>])","name":"keyword.operator.redirect.shell"}]},"regex_comparison":{"match":"=~","name":"keyword.operator.logical.regex.shell"},"regexp":{"patterns":[{"match":".+"}]},"simple_options":{"captures":{"0":{"patterns":[{"captures":{"1":{"name":"string.unquoted.argument.shell constant.other.option.dash.shell"},"2":{"name":"string.unquoted.argument.shell constant.other.option.shell"}},"match":"[\\\\t ]++(-)(\\\\w+)"}]}},"match":"(?:[\\\\t ]++-\\\\w+)*"},"simple_unquoted":{"match":"[^\\\\t\\\\n \\"$\\\\&-);<>\\\\\\\\`|]","name":"string.unquoted.shell"},"special_expansion":{"match":"!|:[-=?]?|[*@]|##?|%%|[%/]","name":"keyword.operator.expansion.shell"},"start_of_command":{"match":"[\\\\t ]*+(?![\\\\n!#\\\\&()<>\\\\[{|]|$|[\\\\t ;])(?!nocorrect |nocorrect\\\\t|nocorrect$|readonly |readonly\\\\t|readonly$|function |function\\\\t|function$|foreach |foreach\\\\t|foreach$|coproc |coproc\\\\t|coproc$|logout |logout\\\\t|logout$|export |export\\\\t|export$|select |select\\\\t|select$|repeat |repeat\\\\t|repeat$|pushd |pushd\\\\t|pushd$|until |until\\\\t|until$|while |while\\\\t|while$|local |local\\\\t|local$|case |case\\\\t|case$|done |done\\\\t|done$|elif |elif\\\\t|elif$|else |else\\\\t|else$|esac |esac\\\\t|esac$|popd |popd\\\\t|popd$|then |then\\\\t|then$|time |time\\\\t|time$|for |for\\\\t|for$|end |end\\\\t|end$|fi |fi\\\\t|fi$|do |do\\\\t|do$|in |in\\\\t|in$|if |if\\\\t|if$)(?!\\\\\\\\\\\\n?$)"},"string":{"patterns":[{"match":"\\\\\\\\.","name":"constant.character.escape.shell"},{"begin":"\'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"\'","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.quoted.single.shell"},{"begin":"\\\\$?\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.quoted.double.shell","patterns":[{"match":"\\\\\\\\[\\\\n\\"$\\\\\\\\`]","name":"constant.character.escape.shell"},{"include":"#variable"},{"include":"#interpolation"}]},{"begin":"\\\\$\'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.shell"}},"end":"\'","endCaptures":{"0":{"name":"punctuation.definition.string.end.shell"}},"name":"string.quoted.single.dollar.shell","patterns":[{"match":"\\\\\\\\[\'\\\\\\\\abefnrtv]","name":"constant.character.escape.ansi-c.shell"},{"match":"\\\\\\\\[0-9]{3}\\"","name":"constant.character.escape.octal.shell"},{"match":"\\\\\\\\x\\\\h{2}\\"","name":"constant.character.escape.hex.shell"},{"match":"\\\\\\\\c.\\"","name":"constant.character.escape.control-char.shell"}]}]},"subshell_dollar":{"patterns":[{"begin":"\\\\$\\\\(","beginCaptures":{"0":{"name":"punctuation.definition.subshell.single.shell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.definition.subshell.single.shell"}},"name":"meta.scope.subshell","patterns":[{"include":"#parenthese"},{"include":"#initial_context"}]}]},"support":{"patterns":[{"match":"(?<=^|[\\\\&;\\\\s])[.:](?=[\\\\&;\\\\s]|$)","name":"support.function.builtin.shell"}]},"typical_statements":{"patterns":[{"include":"#assignment_statement"},{"include":"#case_statement"},{"include":"#for_statement"},{"include":"#while_statement"},{"include":"#function_definition"},{"include":"#command_statement"},{"include":"#line_continuation"},{"include":"#arithmetic_double"},{"include":"#normal_context"}]},"variable":{"patterns":[{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.parameter.positional.all.shell"},"2":{"name":"variable.parameter.positional.all.shell"}},"match":"(\\\\$)(@(?!\\\\w))"},{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.parameter.positional.shell"},"2":{"name":"variable.parameter.positional.shell"}},"match":"(\\\\$)([0-9](?!\\\\w))"},{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.language.special.shell"},"2":{"name":"variable.language.special.shell"}},"match":"(\\\\$)([-!#$*0?_](?!\\\\w))"},{"begin":"(\\\\$)(\\\\{)[\\\\t ]*+(?=\\\\d)","beginCaptures":{"1":{"name":"punctuation.definition.variable.shell variable.parameter.positional.shell"},"2":{"name":"punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell variable.parameter.positional.shell"}},"contentName":"meta.parameter-expansion","end":"}","endCaptures":{"0":{"name":"punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell variable.parameter.positional.shell"}},"patterns":[{"include":"#special_expansion"},{"include":"#array_access_inline"},{"match":"[0-9]+","name":"variable.parameter.positional.shell"},{"match":"(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)","name":"variable.other.normal.shell"},{"include":"#variable"},{"include":"#string"}]},{"begin":"(\\\\$)(\\\\{)","beginCaptures":{"1":{"name":"punctuation.definition.variable.shell"},"2":{"name":"punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell"}},"contentName":"meta.parameter-expansion","end":"}","endCaptures":{"0":{"name":"punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell"}},"patterns":[{"include":"#special_expansion"},{"include":"#array_access_inline"},{"match":"(?<!\\\\w)[-0-9A-Z_a-z]+(?!\\\\w)","name":"variable.other.normal.shell"},{"include":"#variable"},{"include":"#string"}]},{"captures":{"1":{"name":"punctuation.definition.variable.shell variable.other.normal.shell"},"2":{"name":"variable.other.normal.shell"}},"match":"(\\\\$)(\\\\w+(?!\\\\w))"}]},"while_statement":{"patterns":[{"begin":"\\\\b(while)\\\\b","beginCaptures":{"1":{"name":"keyword.control.while.shell"}},"end":"(?=[\\\\n\\\\&);`{|}]|[\\\\t ]*#|])(?<!\\\\\\\\)","endCaptures":{},"name":"meta.while.shell","patterns":[{"include":"#line_continuation"},{"include":"#math_operators"},{"include":"#option"},{"include":"#simple_unquoted"},{"include":"#normal_context"},{"include":"#string"}]}]}},"scopeName":"source.shell","aliases":["bash","sh","shell","zsh"]}')),Np=[e];
|
|
2
|
+
export{Np};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d,n,o,i,u,a,vr,Ue,oe,e,s,Ln,F,nt,B,se,yo,re,Ce,He,oi,ln,ii,Kr,D,U,b,Jn,x,rA,Ee,Hs,_,mr,fr,At,ot,me,xt,Hu,st,lt,fA,gA,Xi,es,Wu,qe,ns}from"./index-cq98p2rb.js";import{Ou,$u,Xo,zu,Uu}from"./index-62ng8tkj.js";import{yr}from"./index-czedkbmb.js";var Qt={name:"pen",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],aliases:["edit-2"]},Ve=s(Qt);var Yt={name:"copy-plus",size:24,node:[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]},Xe=s(Yt);var Jt={name:"package-open",size:24,node:[["path",{d:"M12 22v-9",key:"x3hkom"}],["path",{d:"M15.17 2.21a1.67 1.67 0 0 1 1.63 0L21 4.57a1.93 1.93 0 0 1 0 3.36L8.82 14.79a1.655 1.655 0 0 1-1.64 0L3 12.43a1.93 1.93 0 0 1 0-3.36z",key:"2ntwy6"}],["path",{d:"M20 13v3.87a2.06 2.06 0 0 1-1.11 1.83l-6 3.08a1.93 1.93 0 0 1-1.78 0l-6-3.08A2.06 2.06 0 0 1 4 16.87V13",key:"1pmm1c"}],["path",{d:"M21 12.43a1.93 1.93 0 0 0 0-3.36L8.83 2.2a1.64 1.64 0 0 0-1.63 0L3 4.57a1.93 1.93 0 0 0 0 3.36l12.18 6.86a1.636 1.636 0 0 0 1.63 0z",key:"12ttoo"}]]},Be=s(Jt);var Zt={name:"scissors",size:24,node:[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]},Se=s(Zt);function Qe({rootPath:t,activeRepo:r,repos:l,reposScanning:c,onRefreshRepos:p,onSelectRepo:f,searchQuery:v,onSearchChange:h,onRefresh:y,refreshing:g}){return e("div",{className:"border-b border-ink/10",children:[e(At,{className:"border-b-0",left:e(yr,{rootPath:t,activeRepo:r,onSelectRepo:f,repos:l,scanning:c,onRefreshRepos:p}),right:e(ot,{label:"Refresh",onClick:y,busy:g})}),e("div",{className:"px-3 pb-3",children:e("div",{className:"relative",children:[e(U,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-ink/40"}),e("input",{type:"text",placeholder:"Search files...",value:v,onChange:(m)=>h(m.currentTarget.value),className:"w-full bg-canvas border border-ink/20 rounded pl-8 pr-3 py-1.5 text-xs focus:outline-none focus:border-ink transition-colors text-ink placeholder-ink/40"})]})})]})}function Ye({name:t,path:r,isFolder:l,isOpen:c,ignored:p,selected:f,gitStatus:v,folderStatus:h}){let y=f?"text-ink font-semibold":v?v.colorClass:h?h.colorClass:p?"text-ink/40":"";return e(d,{children:[l?c?e(B,{size:12,className:"flex-shrink-0 text-ink/40"}):e(se,{size:12,className:"flex-shrink-0 text-ink/40"}):e("span",{className:"w-3 flex-shrink-0"}),e(st,{name:t,isFolder:l,isOpen:c,size:12,className:`flex-shrink-0${p?" opacity-40":""}`}),e("span",{className:`truncate min-w-0 flex-1 ${y}`,title:p?`${r} — git-ignored`:void 0,children:t}),v&&e("span",{className:`font-mono text-[10px] font-bold px-1 rounded flex-shrink-0 ${v.colorClass}`,title:`Git: ${v.label}`,children:v.charStatus}),h&&e("span",{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 ${h.dotClass}`,title:`${h.count} changed file${h.count>1?"s":""}`})]})}var en=28,tn=9,nn=8;function rn(t){let{isFolder:r,hasGitStatus:l,pasteLabel:c,busy:p,chainLabel:f,foldable:v,selectionCount:h,isArchive:y}=t,g=[],m=h>1,C=h===1?"":` ${h} items`;if(m)return g.push({kind:"item",id:"cut",label:`Cut${C}`,icon:e(Se,{size:13,className:"text-ink/60"}),disabled:p}),g.push({kind:"item",id:"copy",label:`Copy${C}`,icon:e(re,{size:13,className:"text-ink/60"}),disabled:p}),g.push({kind:"separator"}),g.push({kind:"item",id:"compress",label:`Compress${C} to…`,icon:e(nt,{size:13,className:"text-ink/60"}),disabled:p}),g.push({kind:"separator"}),g.push({kind:"item",id:"delete",label:`Delete${C}`,icon:e(F,{size:13,className:"text-error"}),tone:"text-error"}),g;if(r){if(g.push({kind:"item",id:"new_file",label:"New File",icon:e(oi,{size:13,className:"text-ink/60"})}),g.push({kind:"item",id:"new_folder",label:"New Folder",icon:e(ln,{size:13,className:"text-ink/60"})}),f)g.push({kind:"item",id:"unfold",label:"Unfold Folders",icon:e(B,{size:13,className:"text-ink/60"})});if(v)g.push({kind:"item",id:"fold",label:"Fold Folders",icon:e(se,{size:13,className:"text-ink/60"})});g.push({kind:"separator"})}else{if(g.push({kind:"item",id:"view",label:"View",icon:e(He,{size:13,className:"text-ink/60"})}),y)g.push({kind:"item",id:"extract",label:"Extract…",icon:e(Be,{size:13,className:"text-ink/60"}),disabled:p});if(l)g.push({kind:"item",id:"diff",label:"Open in Diff Panel",icon:e(ii,{size:13,className:"text-warning"}),tone:"font-medium"});g.push({kind:"separator"})}if(g.push({kind:"item",id:"cut",label:"Cut",icon:e(Se,{size:13,className:"text-ink/60"}),disabled:p}),g.push({kind:"item",id:"copy",label:"Copy",icon:e(re,{size:13,className:"text-ink/60"}),disabled:p}),g.push({kind:"item",id:"compress",label:"Compress to…",icon:e(nt,{size:13,className:"text-ink/60"}),disabled:p}),g.push({kind:"item",id:"duplicate",label:"Duplicate",icon:e(Xe,{size:13,className:"text-ink/60"}),disabled:p}),c)g.push({kind:"item",id:"paste",label:c,icon:e(yo,{size:13,className:"text-ink/60"}),disabled:p});return g.push({kind:"separator"}),g.push({kind:"item",id:"explorer",label:"Go to Explorer",icon:e(Ce,{size:13,className:"text-ink/60"})}),g.push({kind:"item",id:"copy_path",label:"Copy Path",icon:e(re,{size:13,className:"text-ink/60"})}),g.push({kind:"item",id:"copy_relative",label:"Copy Relative Path",icon:e(re,{size:13,className:"text-ink/60"})}),g.push({kind:"separator"}),g.push({kind:"item",id:"history",label:"Show Git History",icon:e(Ln,{size:13,className:"text-ink/60"})}),g.push({kind:"separator"}),g.push({kind:"item",id:"rename",label:"Rename",icon:e(Ve,{size:13,className:"text-ink/60"})}),g.push({kind:"item",id:"delete",label:"Delete",icon:e(F,{size:13,className:"text-error"}),tone:"text-error"}),g}function on(t){let r=t.filter((c)=>c.kind==="item").length,l=t.length-r;return r*en+l*tn+nn}function Je({x:t,y:r,isFolder:l,hasGitStatus:c,pasteLabel:p,chainLabel:f,foldable:v,busy:h,selectionCount:y,isArchive:g,onAction:m,menuRef:C}){let w=rn({isFolder:l,hasGitStatus:c,pasteLabel:p,busy:h,chainLabel:f,foldable:v,selectionCount:y,isArchive:g}),A=on(w),N=typeof window<"u"?Math.max(10,Math.min(t,window.innerWidth-210-12)):t,E=typeof window<"u"?Math.max(10,Math.min(r,window.innerHeight-A-12)):r;return oe(e("div",{className:"fixed inset-0 z-50 bg-ink/20",onClick:()=>m("close"),onContextMenu:(S)=>{S.preventDefault(),m("close")},children:e("div",{ref:C,className:"glass-popover fixed z-50 bg-paper border border-ink/15 shadow-2xl rounded-lg py-1 min-w-[185px] text-xs text-ink font-sans",style:{top:E,left:N},onClick:(S)=>S.stopPropagation(),children:w.map((S,R)=>S.kind==="separator"?e("div",{className:"my-1 border-t border-ink/10"},`sep-${R}`):e("button",{type:"button",disabled:S.disabled,onClick:()=>m(S.id),className:`w-full text-left px-3 py-1.5 flex items-center space-x-2 transition-colors ${S.disabled?"opacity-40 cursor-default":"hover:bg-ink/5"} ${S.tone??""}`,children:[S.icon,e("span",{children:S.label})]},S.id))})}),document.body)}function Fe({folderPath:t,kind:r,value:l,error:c,isLoading:p,onChange:f,onCancel:v,onSubmit:h}){let y=r==="folder"?"Folder":"File";return oe(e("div",{className:"fixed inset-0 modal-scrim z-[100] flex items-center justify-center p-4 backdrop-blur-sm",children:e("form",{onSubmit:h,className:"glass-overlay bg-paper rounded shadow-xl p-4 w-full max-w-sm border border-ink/10 font-sans",children:[e("h3",{className:"font-semibold text-ink mb-3 text-sm",children:["New ",y]}),e("div",{className:"flex items-center gap-1 mb-1 text-xs font-mono text-ink/50 min-w-0",children:e("span",{className:"truncate",title:t,children:[t||".","/"]})}),e("input",{autoFocus:!0,type:"text",value:l,onChange:(g)=>f(g.currentTarget.value),placeholder:r==="folder"?"folder name or nested/path":"file name or nested/path","aria-label":`New ${y.toLowerCase()} name`,className:`w-full bg-paper border rounded px-2 py-1.5 text-xs font-mono focus:outline-none mb-1 ${c?"border-error":"border-ink/20 focus:border-ink"}`}),e("p",{className:"text-[10px] text-ink/40 mb-2",children:["Nested paths create the folders they need — ",e("span",{className:"font-mono",children:"lib/parse.ts"}),"."]}),c&&e("p",{className:"text-[11px] text-error mb-2",children:c}),e("div",{className:"flex justify-end space-x-2 mt-2",children:[e("button",{type:"button",onClick:v,className:"px-3 py-1.5 text-xs text-ink hover:bg-ink/5 rounded transition-colors",disabled:p,children:"Cancel"}),e("button",{type:"submit",className:"px-3 py-1.5 text-xs bg-ink text-canvas rounded hover:bg-ink/90 transition-colors flex items-center",disabled:p||!l.trim(),children:p?"Creating...":"Create"})]})]})}),document.body)}function Ze({fileName:t,displayName:r,isFolder:l,count:c=1,isLoading:p,onCancel:f,onConfirm:v}){let h=c>1;return oe(e("div",{className:"fixed inset-0 modal-scrim z-[100] flex items-center justify-center p-4 backdrop-blur-sm",children:e("div",{className:"glass-overlay bg-paper rounded shadow-xl p-4 w-full max-w-sm border border-ink/10 font-sans",children:[e("h3",{className:"font-semibold text-ink mb-2 text-sm",children:["Delete ",h?`${c} Items`:l?"Folder":"File"]}),e("p",{className:"text-xs text-ink/70 mb-4",children:["Are you sure you want to delete ",h?e(d,{children:["the ",c," selected entries"]}):e("span",{className:"font-mono bg-canvas px-1 rounded",children:t}),"? This action cannot be undone."]}),r&&r!==t&&e("p",{className:"text-[11px] text-ink/50 mb-4",children:["The row is ",e("span",{className:"font-mono",children:r}),"; this deletes"," ",e("span",{className:"font-mono",children:t})," only."]}),e("div",{className:"flex justify-end space-x-2",children:[e("button",{onClick:f,className:"px-3 py-1.5 text-xs text-ink hover:bg-ink/5 rounded transition-colors",disabled:p,children:"Cancel"}),e("button",{onClick:v,className:"px-3 py-1.5 text-xs bg-error text-white rounded hover:bg-error/90 transition-colors flex items-center",disabled:p,children:p?"Deleting...":"Delete"})]})]})}),document.body)}function et({isFolder:t,renameValue:r,originalPath:l,displayName:c,error:p,isLoading:f,onChange:v,onCancel:h,onSubmit:y}){return oe(e("div",{className:"fixed inset-0 modal-scrim z-[100] flex items-center justify-center p-4 backdrop-blur-sm",children:e("form",{onSubmit:y,className:"glass-overlay bg-paper rounded shadow-xl p-4 w-full max-w-sm border border-ink/10 font-sans",children:[e("h3",{className:"font-semibold text-ink mb-3 text-sm",children:["Rename ",t?"Folder":"File"]}),e("input",{autoFocus:!0,type:"text",value:r,onChange:(g)=>v(g.currentTarget.value),"aria-label":`Rename ${t?"folder":"file"} path`,className:`w-full bg-paper border rounded px-2 py-1.5 text-xs font-mono focus:outline-none mb-1 ${p?"border-error":"border-ink/20 focus:border-ink"}`}),e("p",{className:"text-[10px] text-ink/40 mb-2",children:["Paths are relative to the tree — ",e("span",{className:"font-mono",children:"lib/deep/name.ts"})," moves it too."]}),c&&e("p",{className:"text-[11px] text-ink/50 mb-2",children:["The row is ",e("span",{className:"font-mono",children:c}),"; this renames"," ",e("span",{className:"font-mono",children:l}),". Use"," ",e("span",{className:"font-mono",children:"Unfold Folders"})," to rename a folder inside the chain."]}),p&&e("p",{className:"text-[11px] text-error mb-2",children:p}),e("div",{className:"flex justify-end space-x-2",children:[e("button",{type:"button",onClick:h,className:"px-3 py-1.5 text-xs text-ink hover:bg-ink/5 rounded transition-colors",disabled:f,children:"Cancel"}),e("button",{type:"submit",className:"px-3 py-1.5 text-xs bg-ink text-canvas rounded hover:bg-ink/90 transition-colors flex items-center",disabled:f||!r.trim()||r===l,children:f?"Renaming...":"Rename"})]})]})}),document.body)}function tt({filePath:t,fetcherState:r,fetcherData:l,onClose:c}){let p=l?.type==="history"?l.data:void 0;return oe(e("div",{className:"fixed inset-0 modal-scrim z-[100] flex items-center justify-center p-4 backdrop-blur-sm",children:e("div",{className:"glass-overlay bg-paper rounded-lg shadow-xl w-full max-w-4xl border border-ink/10 flex flex-col max-h-[85vh]",children:[e("div",{className:"flex items-center justify-between p-4 border-b border-ink/10",children:[e("h3",{className:"text-sm font-semibold text-ink flex items-center space-x-2",children:[e(Ln,{size:16,className:"text-ink/60"}),e("span",{children:["Git History: ",e("span",{className:"font-mono font-normal opacity-80",children:t})]})]}),e("button",{onClick:c,className:"p-1 hover:bg-ink/5 rounded text-ink/60 transition-colors",children:e(b,{size:14})})]}),e("div",{className:"flex-1 scrollbar-overlay-container p-2",children:r==="idle"?p?p.length>0?e("table",{className:"w-full text-left border-collapse text-[11px]",children:[e("thead",{className:"bg-canvas sticky top-0 z-10 border-b border-ink/10",children:e("tr",{children:[e("th",{className:"px-3 py-2 font-semibold text-ink/70 rounded-tl",children:"Description"}),e("th",{className:"px-3 py-2 font-semibold text-ink/70 w-32",children:"Date"}),e("th",{className:"px-3 py-2 font-semibold text-ink/70 w-32",children:"Author"}),e("th",{className:"px-3 py-2 font-semibold text-ink/70 w-24 text-right rounded-tr",children:"Commit"})]})}),e("tbody",{className:"divide-y divide-ink/5",children:p.map((f,v)=>e("tr",{className:"hover:bg-ink/[0.03] transition-colors group",children:[e("td",{className:"px-3 py-2 text-ink",children:f.message?e("span",{className:"font-medium text-ink/90 group-hover:text-ink",children:f.message}):null}),e("td",{className:"px-3 py-2 text-ink/60 whitespace-nowrap font-mono text-[10.5px]",children:f.time}),e("td",{className:"px-3 py-2 text-ink/70 whitespace-nowrap truncate max-w-[120px]",children:f.author}),e("td",{className:"px-3 py-2 text-right",children:f.hash?e("span",{className:"font-mono text-ink/50 group-hover:text-ink font-semibold transition-colors bg-canvas px-1.5 py-0.5 rounded border border-ink/10",children:f.hash}):null})]},v))})]}):e("div",{className:"p-8 text-center text-ink/40 font-mono text-xs",children:"No commit history found for this file."}):l?.error?e("div",{className:"p-8 text-center text-error font-mono text-xs",children:l.error}):e("div",{className:"p-8 text-center text-ink/40 font-mono text-xs",children:"Loading history..."}):e("div",{className:"p-8 text-center text-ink/40 font-mono text-xs flex items-center justify-center space-x-2",children:[e(D,{size:14,className:"animate-spin"}),e("span",{children:"Loading history..."})]})})]})}),document.body)}function rt({actions:t,file:r,isFolder:l,chainLabel:c}){let p=t.selectionCount;return e(d,{children:[t.showCreateModal&&e(Fe,{folderPath:r.path,kind:t.createKind,value:t.createName,error:t.createError,isLoading:t.busy,onChange:t.setCreateName,onCancel:t.closeCreate,onSubmit:t.submitCreate}),t.showDeleteModal&&e(Ze,{fileName:r.path,displayName:p>1?void 0:c,isFolder:l,count:p,isLoading:t.busy,onCancel:t.closeDelete,onConfirm:t.submitDelete}),t.showRenameModal&&e(et,{isFolder:l,renameValue:t.renameValue,originalPath:r.path,displayName:l?c:void 0,error:t.renameError,isLoading:t.busy,onChange:t.setRenameValue,onCancel:t.closeRename,onSubmit:t.submitRename}),t.showHistoryModal&&e(tt,{filePath:r.path,fetcherState:t.fetcherState,fetcherData:t.fetcherData,onClose:t.closeHistory})]})}function Te(t){let r=t.map(sn);return r.some((l,c)=>l!==t[c])?r:t}function sn(t){if(t.type!=="folder"||!Array.isArray(t.children))return t;let r=Te(t.children),l=r===t.children?t:{...t,children:r};while(Array.isArray(l.children)&&l.children.length===1){let c=l.children[0];if(c.type!=="folder")break;l={...l,name:`${l.name}/${c.name}`,path:c.path,children:c.children,ignored:c.ignored??l.ignored}}return l}function Ae(t){return t.type==="folder"&&t.name.includes("/")}function Me(t,r){let l=r.split("/"),c=t.split("/");if(l.length<2||l.length>c.length||l.some((f)=>!f))return null;let p=c.slice(0,c.length-l.length);return l.map((f,v)=>[...p,...l.slice(0,v+1)].join("/"))}function it(t,r){let l=new Map;if(r.size===0)return{nodes:t,roots:l};let c=!1,p=(v)=>v.flatMap((h)=>{if(h.type!=="folder")return[h];let y=Array.isArray(h.children)?p(h.children):h.children,g=y===h.children?h:{...h,children:y},m=r.has(h.path)?Me(h.path,h.name):null;if(!m)return[g];c=!0,l.set(m[0],h.path);let C={...g,name:m[m.length-1].split("/").pop()};for(let k=m.length-1;k>0;k-=1){let w=m[k-1];C={name:w.split("/").pop(),path:w,type:"folder",ignored:g.ignored,children:[C]}}return[C]}),f=p(t);return{nodes:c?f:t,roots:l}}function at(t,r){let l=new Set,c=(v)=>{for(let h of v){if(h.type!=="folder")continue;if(l.add(h.path),Array.isArray(h.children))c(h.children)}};c(t);let p=r.split("/").slice(0,-1),f=[];for(let v=0;v<p.length;v+=1){let h=p.slice(0,v+1).join("/");if(l.has(h))f.push(h)}return f}function Ne({folderPath:t,rootPath:r,repo:l,onCreated:c,onOpenCreated:p}){let f=lt(),[v,h]=n(!1),[y,g]=n("file"),[m,C]=n(""),[k,w]=n(null),A=i(null);return o(()=>{if(f.state!=="idle"||!f.data)return;let N=f.data;if(A.current===N)return;if(A.current=N,N.success&&N.path){let E=N.kind==="folder"?"folder":"file";h(!1),C(""),w(null);let S=N.path.split("/").pop()||N.path;if(c({path:N.path,name:S,kind:E}),E==="file")p?.({path:N.path,name:S})}else w(N.error||`Could not create the ${y}`)},[f.state,f.data]),{open:v,kind:y,name:m,setName:C,error:k,busy:f.state!=="idle",openDialog:(N="file")=>{g(N),C(""),w(null),h(!0)},closeDialog:()=>h(!1),submit:(N)=>{N.preventDefault();let E=m.trim();if(!E)return;w(null);let S=new FormData;if(S.append("actionType","create"),S.append("path",t),S.append("name",E),y==="folder")S.append("kind","folder");if(l&&l!==".")S.append("repo",l);if(r)S.append("root",r);f.submit(S,{method:"post",action:"/api/fs/action"})}}}function we(t){if(!t)return null;if(t.entries.length===1)return t.entries[0].name;return`${t.entries.length} items`}function ct(t,r){return`${t??""}\x00${r}`}function Le(t,r){if(r==="folder")return t;let l=t.lastIndexOf("/");return l===-1?".":t.slice(0,l)}function dt(t){let r=t.lastIndexOf("/");return r===-1?".":t.slice(0,r)}function pt(t,r){if(t.path===""||t.path===".")return"The workspace root cannot be moved or copied";if(t.kind==="folder"&&(r===t.path||r.startsWith(`${t.path}/`)))return"Cannot paste a folder into itself";return null}function ut(t,r){let l=pt(t,r);if(l)return l;if(r===dt(t.path))return"Already in this folder";return null}function ft(t,r,l){if(!t||t.entries.length===0)return"Nothing to paste";if(t.scope!==r)return"The clipboard holds an entry from another workspace";if(t.mode==="cut"&&t.entries.some((c)=>l===dt(c.path)))return"Already in this folder";for(let c of t.entries){let p=pt(c,l);if(p)return p}return null}function mt(t){if(typeof t!=="object"||t===null)return null;let r=t;if(typeof r.scope!=="string")return null;if(r.mode!=="copy"&&r.mode!=="cut")return null;let l=Array.isArray(r.entries)?r.entries:typeof r.path==="string"?[{path:r.path,name:r.name,kind:r.kind}]:[],c=[];for(let p of l){let f=an(p);if(!f)return null;c.push(f)}if(c.length===0)return null;return{scope:r.scope,entries:c,mode:r.mode}}function an(t){if(typeof t!=="object"||t===null)return null;let r=t;if(typeof r.path!=="string"||typeof r.name!=="string")return null;if(r.kind!=="file"&&r.kind!=="folder")return null;let l=r.path.split("/");if(r.path===""||r.path.startsWith("/")||l.some((c)=>c===""||c==="."||c===".."))return null;return{path:r.path,name:r.name,kind:r.kind}}var $e=[{id:"zip",label:"ZIP",extension:"zip"},{id:"7z",label:"7Z",extension:"7z"},{id:"rar",label:"RAR",extension:"rar"},{id:"tar",label:"TAR",extension:"tar"},{id:"tar.gz",label:"TAR.GZ",extension:"tar.gz"}],ht=[[".tar.gz","tar.gz"],[".tar.bz2","tar.bz2"],[".tar.xz","tar.xz"],[".tgz","tar.gz"],[".tbz2","tar.bz2"],[".txz","tar.xz"],[".tar","tar"],[".zip","zip"],[".7z","7z"],[".rar","rar"],[".gz","gz"],[".bz2","bz2"],[".xz","xz"]];function ze(t){let r=t.toLowerCase();for(let[l,c]of ht)if(r.endsWith(l))return c;return null}function gt(t){return ze(t)!==null}function cn(t){return $e.find((r)=>r.id===t)}function dn(t){return cn(t)?.extension??"zip"}function bt(t){let r=t.toLowerCase();for(let[l]of ht)if(r.endsWith(l))return t.slice(0,-l.length);return t}function vt(t){let r=t.lastIndexOf("/");return r===-1?".":t.slice(0,r)||"."}function yt(t){let r=t.lastIndexOf("/");return r===-1?t:t.slice(r+1)}function kt(t){if(t.length===0)return".";let r=t.map((c)=>vt(c).split("/").filter((p)=>p!==".")),l=r[0]??[];for(let c of r.slice(1)){let p=0;while(p<l.length&&p<c.length&&l[p]===c[p])p+=1;l=l.slice(0,p)}return l.length===0?".":l.join("/")}function De(t,r){let l=dn(r);if(t.length===1){let f=t[0],v=bt(f.name),h=v.lastIndexOf(".");return`${(f.kind==="folder"?f.name:h>0?v.slice(0,h):v)||"archive"}.${l}`}let c=kt(t.map((f)=>f.path)),p=yt(c);return`${p==="."||p===""?"archive":p}.${l}`}function Ct(t){return kt(t.map((r)=>r.path))}function Ft(t){let r=vt(t),l=bt(yt(t));if(!l)return r;return r==="."?l:`${r}/${l}`}function Nt(t){return t.toUpperCase()}function wt({file:t,diff:r,onOpenFile:l,onActionComplete:c,onCreated:p,onRenamed:f,onUnfold:v,onFold:h,clipboard:y,isFolder:g,selection:m,selected:C,archive:k}){let w=lt(),[A,N]=n(null),E=i(null),[S,R]=n(!1),[T,P]=n(!1),[j,ee]=n(!1),[te,ae]=n(t.path),[I,O]=n(null),{repo:L,rootPath:H}=t,G=Ne({folderPath:t.path,rootPath:H,repo:L,onCreated:(M)=>p?p(M):c(),onOpenCreated:(M)=>l?.({...M,root:H,repo:L||"."})}),ne=i(null);o(()=>{if(w.state!=="idle"||!w.data)return;let M=w.data;if(ne.current===M)return;if(ne.current=M,M.success&&!M.type)if(R(!1),P(!1),O(null),M.previousPath&&M.path&&f)f(M.previousPath,M.path);else c();else if(!M.success&&M.error&&S)O(M.error)},[w.state,w.data]);let q=(M)=>{if(L&&L!==".")M.append("repo",L);if(H)M.append("root",H);w.submit(M,{method:"post",action:"/api/fs/action"})},X=()=>{l?.({path:t.path,name:t.name,root:H,repo:L||"."})},J={path:t.path,name:t.name,kind:g?"folder":"file"},ie=C&&m.length>1?m:[J],he=gt(t.name),Q=y.clip&&!y.refusalFor(J)?`Paste ${we(y.clip)??"item"}`:null,ue=(M)=>{if(N(null),O(null),M==="view")X();else if(M==="diff")window.dispatchEvent(new CustomEvent("omp:open-diff",{detail:{file:t.path,staged:r?.staged,status:r?.status||"M",repo:L||".",root:H}}));else if(M==="explorer"){let K=new FormData;K.append("actionType","open_explorer"),K.append("path",t.path),q(K)}else if(M==="copy_path")xt(Hu(t.basePath,t.path));else if(M==="copy_relative")xt(t.path);else if(M==="history"){ee(!0);let K=new FormData;K.append("actionType","git_history"),K.append("path",t.path),q(K)}else if(M==="rename")ae(t.path),R(!0);else if(M==="unfold")v?.();else if(M==="fold")h?.();else if(M==="new_file")G.openDialog("file");else if(M==="new_folder")G.openDialog("folder");else if(M==="delete")P(!0);else if(M==="cut")y.cut(ie);else if(M==="copy")y.copy(ie);else if(M==="compress")k.openCompress(ie);else if(M==="extract")k.openExtract(J);else if(M==="duplicate")y.duplicate(J);else if(M==="paste")y.paste(J)},le=(M)=>{M.preventDefault(),O(null);let K=new FormData;K.append("actionType","rename"),K.append("path",t.path),K.append("newPath",te),q(K)},xe=()=>{let M=new FormData;if(M.append("actionType","delete"),ie.length>1)M.append("paths",JSON.stringify(ie.map((K)=>K.path)));else M.append("path",t.path);q(M)};return{contextMenu:A,contextMenuRef:E,openContextMenu:(M,K)=>N({x:M,y:K}),closeContextMenu:()=>N(null),showRenameModal:S,showDeleteModal:T,showHistoryModal:j,showCreateModal:G.open,createKind:G.kind,createError:G.error,createName:G.name,setCreateName:G.setName,renameValue:te,setRenameValue:ae,renameError:I,busy:w.state!=="idle"||G.busy||y.busy||k.busy,pasteLabel:Q,selectionCount:ie.length,isArchive:he,chainLabel:v!==void 0,foldable:h!==void 0,fetcherState:w.state,fetcherData:w.data,handleAction:ue,submitCreate:G.submit,submitRename:le,submitDelete:xe,closeCreate:G.closeDialog,closeDelete:()=>P(!1),closeRename:()=>R(!1),closeHistory:()=>ee(!1)}}function Dt({target:t,dragging:r,clipboard:l,onDragStart:c,onDragEnd:p,onDropOn:f,onHoverAccept:v}){let h=r?.path===t.path,y=Boolean(r)&&!h&&l.moveRefusalFor(r,t)===null,[g,m]=n(!1);return o(()=>{if(!r)m(!1)},[r]),{isDragging:h,acceptsDrop:y,isDropHovered:g&&y,onDragStart:(k)=>{if(k.dataTransfer?.setData("text/plain",t.path),k.dataTransfer)k.dataTransfer.effectAllowed="move";c(t)},onDragEnd:p,onDragOver:(k)=>{if(!r)return;if(k.stopPropagation(),m(y),!y)return;if(k.preventDefault(),k.dataTransfer)k.dataTransfer.dropEffect="move";v?.(t)},onDragLeave:()=>m(!1),onDrop:(k)=>{if(!r)return;if(k.stopPropagation(),!y)return;k.preventDefault(),f(t)}}}function pn(t,r,l){if(r||l)return!1;return!Array.isArray(t.children)}function Oe({file:t,rootPath:r,basePath:l,repo:c,onLoadChildren:p,onOpenFile:f,onActionComplete:v,onCreated:h,onRenamed:y,expandedPaths:g,onToggleFolder:m,gitFileMap:C,gitFolderMap:k,clipboard:w,archive:A,selection:N,selectionTargets:E,dragging:S,onDragStart:R,onDragEnd:T,onDropOn:P,onUnfold:j,onFold:ee,foldRoots:te,touch:ae=!1}){let I=t.type==="folder",[O,L]=n(!1),[H,G]=n(!1),[ne,q]=n(!1),[X,J]=n(!1),ie=Array.isArray(t.children)?t.children:[],he=(t.path||"").replace(/^\/+/,""),Q=!I?C?.get(he)||C?.get(t.path):void 0,ue=Q?Jn(Q.status,Q.staged):null,le=I?k?.get(he)||k?.get(t.path):null,xe=Boolean(ue),M=t.ignored===!0,K=g?g.has(t.path):O,ce=t.forceExpanded!==void 0?t.forceExpanded:K;o(()=>{J(!0)},[]),o(()=>{if(I&&g)L(g.has(t.path))},[g,t.path,I]),o(()=>{if(I&&ce&&pn(t,H,ne)&&p)q(!0),G(!0),Promise.resolve(p(t.path)).finally(()=>G(!1))},[I,ce,t.children,t.path,p,H,ne]);let ye={path:t.path,name:t.name,kind:I?"folder":"file"},be=N.selected.has(t.path),W=wt({file:{path:t.path,name:t.name,basePath:l,rootPath:r,repo:c},selection:E,selected:be,archive:A,diff:{staged:Q?.staged||(Q?.status?Q.status[0]!==" "&&Q.status[0]!=="?":!1),status:ue?.charStatus},onOpenFile:f,onActionComplete:v,onCreated:h,onRenamed:y,onUnfold:j&&Ae({type:I?"folder":"file",name:t.name})?()=>j(ye):void 0,onFold:ee&&te?.has(t.path)?()=>ee(te.get(t.path)):void 0,clipboard:w,isFolder:I});me(W.contextMenuRef,W.closeContextMenu);let Y=Ou({enabled:ae,onLongPress:(V,ge)=>W.openContextMenu(V,ge)}),ke=(V)=>{if(V.stopPropagation(),Y.consume())return;let ge=N.gestureOf(V);if(ge!=="plain"){N.applyGesture(ge,t.path);return}if(N.applyGesture("plain",t.path),I){let pe=!ce;if(L(pe),t.forceExpanded!==void 0)t.forceExpanded=void 0;if(m?.(t.path,pe),!pe)q(!1)}else if(f)f({...t,root:r,repo:c||"."})},ve=(V)=>{V.preventDefault(),V.stopPropagation(),N.ensureForContext(t.path),W.openContextMenu(V.clientX,V.clientY)},de=Dt({target:ye,dragging:S,clipboard:w,onDragStart:R,onDragEnd:T,onDropOn:P,onHoverAccept:j});return e("div",{children:[e("div",{className:`flex items-center space-x-1.5 py-1 px-2 cursor-pointer rounded group select-none ${de.isDragging?"opacity-40":""} ${de.isDropHovered?"bg-info/10 ring-1 ring-info/40 ring-inset":be?"bg-ink/[0.08] ring-1 ring-ink/20 ring-inset":"hover:bg-ink/5"}`,draggable:!ae,onClick:ke,onContextMenu:ve,onDragStart:de.onDragStart,onDragEnd:de.onDragEnd,onDragOver:de.onDragOver,onDragLeave:de.onDragLeave,onDrop:de.onDrop,onTouchStart:Y.onTouchStart,onTouchMove:Y.onTouchMove,onTouchEnd:Y.onTouchEnd,onTouchCancel:Y.onTouchCancel,children:e(Ye,{name:t.name,path:t.path,isFolder:I,isOpen:ce,ignored:M,selected:be,gitStatus:ue,folderStatus:le})}),ce&&H&&e("div",{className:"ml-3 border-l border-ink/10 pl-3 py-0.5 text-[10px] text-ink/30",children:"Loading…"}),ce&&!H&&ie.length>0&&e("div",{className:"ml-3 border-l border-ink/10 pl-1",children:ie.map((V)=>e(Oe,{file:V,rootPath:r,basePath:l,repo:c,onLoadChildren:p,onOpenFile:f,onActionComplete:v,onCreated:h,onRenamed:y,expandedPaths:g,onToggleFolder:m,gitFileMap:C,gitFolderMap:k,clipboard:w,archive:A,selection:N,selectionTargets:E,dragging:S,onDragStart:R,onDragEnd:T,onDropOn:P,onUnfold:j,onFold:ee,foldRoots:te,touch:ae},V.path))}),X&&W.contextMenu&&e(Je,{x:W.contextMenu.x,y:W.contextMenu.y,isFolder:I,hasGitStatus:xe,pasteLabel:W.pasteLabel,chainLabel:W.chainLabel,foldable:W.foldable,busy:W.busy,selectionCount:W.selectionCount,isArchive:W.isArchive,onAction:W.handleAction}),X&&e(rt,{actions:W,file:t,isFolder:I,chainLabel:Ae({type:I?"folder":"file",name:t.name})?t.name:void 0})]})}function Rt({x:t,y:r,pasteLabel:l,busy:c,onAction:p,menuRef:f}){let h=l?104:76,y=typeof window<"u"?Math.max(10,Math.min(t,window.innerWidth-190-12)):t,g=typeof window<"u"?Math.max(10,Math.min(r,window.innerHeight-h-12)):r;return oe(e("div",{className:"fixed inset-0 z-50 bg-ink/20",onClick:()=>p("close"),onContextMenu:(m)=>{m.preventDefault(),p("close")},children:e("div",{ref:f,className:"glass-popover fixed z-50 bg-paper border border-ink/15 shadow-2xl rounded-lg py-1 min-w-[185px] text-xs text-ink font-sans",style:{top:g,left:y},onClick:(m)=>m.stopPropagation(),children:[e("button",{type:"button",onClick:()=>p("new_file"),className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 flex items-center space-x-2 transition-colors",children:[e(oi,{size:13,className:"text-ink/60"}),e("span",{children:"New File"})]}),e("button",{type:"button",onClick:()=>p("new_folder"),className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 flex items-center space-x-2 transition-colors",children:[e(ln,{size:13,className:"text-ink/60"}),e("span",{children:"New Folder"})]}),l&&e("button",{type:"button",disabled:c,onClick:()=>p("paste"),className:`w-full text-left px-3 py-1.5 flex items-center space-x-2 transition-colors ${c?"opacity-40 cursor-default":"hover:bg-ink/5"}`,children:[e(yo,{size:13,className:"text-ink/60"}),e("span",{children:l})]})]})}),document.body)}function St({menu:t,menuRef:r,pasteLabel:l,busy:c,onAction:p,create:f}){return e(d,{children:[t&&e(Rt,{x:t.x,y:t.y,menuRef:r,pasteLabel:l,busy:c,onAction:p}),f.open&&e(Fe,{folderPath:".",kind:f.kind,value:f.name,error:f.error,isLoading:f.busy,onChange:f.setName,onCancel:f.closeDialog,onSubmit:f.submit})]})}function Tt({title:t,subject:r,error:l,busy:c,submitLabel:p,busyLabel:f,onSubmit:v,onCancel:h,children:y}){return oe(e("div",{className:"fixed inset-0 modal-scrim z-[100] flex items-center justify-center p-4 backdrop-blur-sm",children:e("form",{onSubmit:v,className:"glass-overlay bg-paper rounded shadow-xl p-4 w-full max-w-sm border border-ink/10 font-sans",children:[e("h3",{className:"font-semibold text-ink mb-1 text-sm",children:t}),e("p",{className:"text-[11px] text-ink/50 mb-3 break-words",children:r}),y,l&&e("p",{className:"text-[11px] text-error mb-2",children:l}),e("div",{className:"flex justify-end space-x-2 mt-3",children:[e("button",{type:"button",onClick:h,className:"px-3 py-1.5 text-xs text-ink hover:bg-ink/5 rounded transition-colors",disabled:c,children:"Cancel"}),e("button",{type:"submit",className:"px-3 py-1.5 text-xs bg-ink text-canvas rounded hover:bg-ink/90 transition-colors flex items-center",disabled:c,children:c?f:p})]})]})}),document.body)}function un({entries:t,format:r,name:l,destination:c,formats:p,error:f,busy:v,onFormatChange:h,onNameChange:y,onDestinationChange:g,onCancel:m,onSubmit:C}){let k=t.slice(0,4).map((A)=>A.name).join(", "),w=t.length>4?` +${t.length-4} more`:"";return e(Tt,{title:`Compress ${t.length===1?t[0].name:`${t.length} items`}`,subject:`${k}${w}`,error:f,busy:v,submitLabel:"Compress",busyLabel:"Compressing...",onCancel:m,onSubmit:(A)=>{A.preventDefault(),C()},children:[e("label",{className:"block text-[10px] uppercase tracking-wide text-ink/40 mb-1",htmlFor:"archive-format",children:"Format"}),e("select",{id:"archive-format",value:r,onChange:(A)=>h(A.currentTarget.value),className:"w-full bg-paper border border-ink/20 rounded px-2 py-1.5 text-xs font-mono focus:outline-none focus:border-ink mb-3",children:p.map((A)=>e("option",{value:A.id,disabled:!A.available,children:[A.label,A.available?"":` — ${A.tool} not installed`]},A.id))}),e("label",{className:"block text-[10px] uppercase tracking-wide text-ink/40 mb-1",htmlFor:"archive-name",children:"Archive name"}),e("input",{id:"archive-name",autoFocus:!0,type:"text",value:l,onChange:(A)=>y(A.currentTarget.value),"aria-label":"Archive name",className:`w-full bg-paper border rounded px-2 py-1.5 text-xs font-mono focus:outline-none mb-3 ${f?"border-error":"border-ink/20 focus:border-ink"}`}),e("label",{className:"block text-[10px] uppercase tracking-wide text-ink/40 mb-1",htmlFor:"archive-destination",children:"Destination folder"}),e("input",{id:"archive-destination",type:"text",value:c,onChange:(A)=>g(A.currentTarget.value),"aria-label":"Archive destination",className:"w-full bg-paper border border-ink/20 rounded px-2 py-1.5 text-xs font-mono focus:outline-none focus:border-ink"})]})}function fn({archive:t,kindLabel:r,destination:l,error:c,busy:p,onDestinationChange:f,onCancel:v,onSubmit:h}){return e(Tt,{title:`Extract ${t.name}`,subject:`${r} archive · extracts into a folder`,error:c,busy:p,submitLabel:"Extract",busyLabel:"Extracting...",onCancel:v,onSubmit:(y)=>{y.preventDefault(),h()},children:[e("label",{className:"block text-[10px] uppercase tracking-wide text-ink/40 mb-1",htmlFor:"extract-destination",children:"Extract to folder"}),e("input",{id:"extract-destination",autoFocus:!0,type:"text",value:l,onChange:(y)=>f(y.currentTarget.value),"aria-label":"Extract destination",className:`w-full bg-paper border rounded px-2 py-1.5 text-xs font-mono focus:outline-none ${c?"border-error":"border-ink/20 focus:border-ink"}`})]})}function Et({archive:t}){if(t.compress)return e(un,{entries:t.compress.entries,format:t.compress.format,name:t.compress.name,destination:t.compress.destination,formats:t.formats,error:t.error,busy:t.busy,onFormatChange:t.setFormat,onNameChange:t.setName,onDestinationChange:t.setCompressDestination,onCancel:t.cancel,onSubmit:t.submitCompress});if(t.extract)return e(fn,{archive:t.extract.archive,kindLabel:Nt(ze(t.extract.archive.name)??"zip"),destination:t.extract.destination,error:t.error,busy:t.busy,onDestinationChange:t.setExtractDestination,onCancel:t.cancel,onSubmit:t.submitExtract});return null}function Mt(){let[t,r]=_("files.outlineExpanded",!1),l=vr(),c=Ue(gA,fA),{symbols:p,total:f,truncated:v,notice:h}=Uu({content:c.content,language:c.language,state:c.state,note:c.note,path:c.path});if(c.state==="diff")return null;let y=c.preview,g=(m,C)=>{if(!c.path)return;if(y){let k=Wu(p,C);if(k)es({path:c.path,...k});return}Xi({path:c.path,line:m.line,column:m.column,length:m.name.length})};return e("div",{className:"border-t border-ink/10 bg-canvas/30 flex-shrink-0",children:[e("div",{className:"flex items-center hover:bg-ink/5 transition-colors",children:e("button",{type:"button",onClick:()=>r(!t),"aria-expanded":t,"aria-controls":l,"aria-label":"Outline",title:t?"Hide outline":"Show outline",className:"flex flex-1 min-w-0 items-center space-x-1 py-1.5 pl-3 pr-2 text-left font-semibold text-xs text-ink transition-colors cursor-pointer",children:[e("span",{className:"w-3 text-center font-mono","aria-hidden":"true",children:t?"▾":"▸"}),e(Kr,{size:12}),e("span",{children:"Outline"}),f>0&&e("span",{className:"font-normal ml-1 border border-ink/20 rounded-full px-1.5 text-[10px] text-ink/50",children:v?`${p.length}/${f.toLocaleString()}`:f})]})}),e("div",{className:"section-reveal","data-expanded":t,id:l,inert:!t,children:e("div",{children:e("div",{className:"px-2 pb-2",children:p.length===0?e("div",{className:"px-1 text-[10px] text-ink/40 italic py-1",children:h}):e("div",{className:"max-h-48 overflow-y-auto scrollbar-overlay-container flex flex-col",children:[p.map((m,C)=>e("button",{type:"button",onClick:()=>g(m,C),"aria-label":y?`${Xo(m.kind)} ${m.name}`:`${Xo(m.kind)} ${m.name}, line ${m.line}`,title:y?`Jump to ${Xo(m.kind).toLowerCase()}`:`${Xo(m.kind)} · line ${m.line}`,className:"flex w-full min-w-0 items-center gap-1.5 rounded px-1 py-0.5 text-left transition-colors hover:bg-ink/5 active:bg-ink/10",style:{paddingLeft:`${4+m.depth*12}px`},children:[e($u,{kind:m.kind}),e("span",{className:"min-w-0 flex-1 truncate text-[11px] font-mono text-ink/80",children:m.name}),!y&&e("span",{className:"flex-shrink-0 font-mono text-[10px] text-ink/35",children:m.line})]},`${m.line}:${m.kind}:${m.name}`)),v&&e("div",{className:"px-1 py-1 text-[10px] italic text-ink/40",children:zu(f)})]})})})})]})}function Pe(t,r){return Te(t.map((l)=>mn(l,r)))}function mn(t,r){if(t.type!=="folder")return t;let l=r[t.path];if(!l)return t;return{...t,children:Pe(l,r)}}function hn(t){let r=t.lastIndexOf("/");return r===-1?".":t.slice(0,r)}function $t(t){let r=t.lastIndexOf("/");return r===-1?t:t.slice(r+1)}function Lt(t){return[...t].sort((r,l)=>{if(r.type!==l.type)return r.type==="folder"?-1:1;return r.name.localeCompare(l.name)})}function Ie(t,r,l){let c=l.path.split("/"),p=c.slice(0,-1).join("/"),f=[...t],v={...r},h=f,y=null;for(let g=0;g<c.length-1;){let m=c.slice(0,g+1).join("/"),C=h.find((E)=>E.type==="folder"&&E.path===m),k=C?null:h.find((E)=>E.type==="folder"&&E.path.startsWith(`${m}/`)&&(p===E.path||p.startsWith(`${E.path}/`))),w=C??k,A=w?v[w.path]??w.children:null;if(w&&!Array.isArray(A))return{nodes:t,cache:r};if(!w){let E=gn(h,v,m);if(E){h=E;let S=h.find((T)=>T.path===m),R=Array.isArray(S?.children)?[...S.children]:[];v[m]=R,h=R,y=m,g+=1;continue}}let N=Array.isArray(A)?[...A]:[];if(w){v[w.path]=N,h=N,y=w.path,g=w.path.split("/").length;continue}h.push({name:c[g],path:m,type:"folder",ignored:!1}),v[m]=N,h=N,y=m,g+=1}if(h.push(l),y!==null)v[y]=Lt(h);return f=Lt(f),{nodes:f,cache:v}}function gn(t,r,l){let c=t.findIndex((y)=>y.type==="folder"&&y.path.startsWith(`${l}/`));if(c===-1)return null;let p=t[c],f=p.path.slice(l.length+1).split("/"),v=r[p.path]??p.children;if(Array.isArray(v))r[p.path]=v;let h={name:f[f.length-1],path:p.path,type:"folder",ignored:p.ignored,...Array.isArray(v)?{children:v}:{}};for(let y=f.length-2;y>=0;y-=1)h={name:f[y],path:`${l}/${f.slice(0,y+1).join("/")}`,type:"folder",ignored:!1,children:[h]};return t[c]={name:$t(l),path:l,type:"folder",ignored:!1,children:[h]},t}function zt(t,r,l){let c=t.find((m)=>m.path===l);if(c)return{entry:c,nodes:t.filter((m)=>m.path!==l),cache:r};let p=hn(l),f=r[p],v=f?.find((m)=>m.path===l);if(f&&v)return{entry:v,nodes:t,cache:{...r,[p]:f.filter((m)=>m.path!==l)}};let y=Object.keys(r).filter((m)=>l.startsWith(`${m}/`)&&r[m].some((C)=>C.path===l)).sort((m,C)=>C.length-m.length)[0];if(!y)return{entry:null,nodes:t,cache:r};let g=r[y];return{entry:g.find((m)=>m.path===l),nodes:t,cache:{...r,[y]:g.filter((m)=>m.path!==l)}}}function Ot(t,r,l){let c=!1,p=t.map((f)=>{let v=f.path===r||f.path.startsWith(`${r}/`),h=Array.isArray(f.children)?Ot(f.children,r,l):void 0;if(!v&&h===f.children)return f;c=!0;let y=v?f.path===r?l:`${l}${f.path.slice(r.length)}`:f.path,g=v?{...f,path:y,name:$t(y)}:{...f};if(h!==void 0)g.children=h;return g});return c?p:t}function Pt(t,r,l){let c={};for(let[p,f]of Object.entries(t)){let v=p===r?l:p.startsWith(`${r}/`)?`${l}${p.slice(r.length)}`:p;c[v]=v===p?f:Ot(f,r,l)}return c}function It(t,r,l){let c=new Set;for(let p of t)if(p===r)c.add(l);else if(p.startsWith(`${r}/`))c.add(`${l}${p.slice(r.length)}`);else c.add(p);return c}function Ht(t){if(!x(t))return{status:"missing"};if(typeof t.root!=="string"||t.root==="")return{status:"missing"};return{status:"ok",files:Array.isArray(t.files)?t.files.filter((r)=>x(r)):[],root:t.root}}async function Ge(t){try{return Ht(await(await fetch(t)).json())}catch{return{status:"failed"}}}function Gt({enabled:t,rootPath:r,activeRepo:l,expandedPaths:c,onExpansionPruned:p}){let f=`${r??""}\x00${l}`,[v,h]=n({scope:"",files:[],root:""}),[y,g]=n(!1),m=i({}),C=i([]),k=i(f);k.current=f;let w=i(""),A=i(""),N=i(c);N.current=c;let E=(O)=>{let L=new URLSearchParams;if(r)L.set("root",r);if(l&&l!==".")L.set("repo",l);if(O)L.set("path",O);return L.set("t",String(Date.now())),`/api/fs/dir?${L.toString()}`},S=(O,L)=>{w.current=O,A.current=L;let H=Pe(C.current,m.current);return h({scope:O,files:H,root:L}),H},R=async(O)=>{let L=[...N.current];if(L.length===0)return;let H=await Promise.all(L.map(async(X)=>({path:X,read:await Ge(E(X))})));if(k.current!==O)return;let G=[];for(let{path:X,read:J}of H)if(J.status==="ok")m.current[X]=J.files;else if(J.status==="missing")G.push(X);if(G.length===0)return;let ne=new Set(G);for(let X of G)delete m.current[X];let q=new Set([...N.current].filter((X)=>!ne.has(X)));N.current=q,p(q)},T=async()=>{if(!t)return;let O=k.current;g(!0);try{let L=await Ge(E());if(k.current!==O)return;if(L.status!=="ok")return;if(w.current!==O)m.current={};if(C.current=L.files,S(O,L.root),await R(O),k.current!==O)return;S(O,L.root)}finally{if(k.current===O)g(!1)}},P=async(O)=>{let L=k.current,H=await Ge(E(O));if(k.current!==L||H.status!=="ok")return;if(m.current[O]=H.files,w.current===L)S(L,A.current)},j=(O)=>{let L=Ht(O);if(L.status!=="ok")return;let H=k.current;if(w.current!==H)m.current={};C.current=L.files,S(H,L.root),R(H).then(()=>{if(k.current===H)S(H,L.root)})},ee=()=>{m.current={},C.current=[],w.current="",A.current="",h({scope:"",files:[],root:""})},te=(O)=>{let L=k.current;if(w.current!==L)return null;let H={name:O.path.slice(O.path.lastIndexOf("/")+1),path:O.path,type:O.kind,ignored:!1},G=Ie(C.current,m.current,H);if(G.nodes===C.current)return null;return C.current=G.nodes,m.current=G.cache,S(L,A.current)},ae=(O,L)=>{let H=k.current;if(w.current!==H)return null;let G=zt(C.current,m.current,O);if(!G.entry)return null;m.current=Pt(G.cache,O,L);let ne={...G.entry,path:L,name:L.slice(L.lastIndexOf("/")+1)},q=Ie(G.nodes,m.current,ne);return C.current=q.nodes,m.current=q.cache,S(H,A.current)},I=v.scope===f;return{scope:f,files:I?v.files:[],root:I?v.root:"",isLoading:y,reload:T,loadChildren:P,adoptRoot:j,insertEntry:te,moveEntry:ae,reset:ee}}function Kt({rootPath:t,repo:r,onComplete:l,onError:c}){let p=lt(),[f,v]=_("files.clipboard",null),h=mt(f),y=ct(t,r),g=i(!1),m=i(null);o(()=>{if(p.state!=="idle"||!p.data)return;let N=p.data;if(m.current===N)return;m.current=N;let E=g.current;if(g.current=!1,N.success){if(E)v(null);if(N.failures?.length)c(`${N.failures.length} item(s) could not be moved: ${N.failures[0].error}`);l()}else c(N.error||"The transfer did not complete")},[p.state,p.data]);let C=a((N,E)=>{g.current=E;let S=new FormData;for(let[R,T]of Object.entries(N))S.append(R,T);if(r&&r!==".")S.append("repo",r);if(t)S.append("root",t);p.submit(S,{method:"post",action:"/api/fs/action"})},[p,r,t]),k=a((N)=>ft(h,y,Le(N.path,N.kind)),[h,y]),w=a((N,E)=>ut(N,Le(E.path,E.kind)),[]),A=a((N,E,S,R)=>{let T=new FormData;T.append("actionType","paste"),T.append("mode",S),T.append("targetPath",E.path),T.append("targetKind",E.kind);for(let P of N)T.append("sourcePath",P.path);if(r&&r!==".")T.append("repo",r);if(t)T.append("root",t);g.current=R,p.submit(T,{method:"post",action:"/api/fs/action"})},[p,r,t]);return{clip:h,busy:p.state!=="idle",refusalFor:k,moveRefusalFor:w,copy:(N)=>{if(N.length===0)return;v({scope:y,entries:N.map(({path:E,name:S,kind:R})=>({path:E,name:S,kind:R})),mode:"copy"})},cut:(N)=>{if(N.length===0)return;v({scope:y,entries:N.map(({path:E,name:S,kind:R})=>({path:E,name:S,kind:R})),mode:"cut"})},duplicate:(N)=>{C({actionType:"duplicate",path:N.path},!1)},move:(N,E)=>{let S=w(N,E);if(S){c(S);return}A([N],E,"cut",Boolean(h?.mode==="cut"&&h.entries.some((R)=>R.path===N.path)))},paste:(N)=>{if(!h)return;let E=k(N);if(E){c(E);return}A(h.entries.map(({path:S,name:R,kind:T})=>({path:S,name:R,kind:T})),N,h.mode,h.mode==="cut")}}}var bn=$e.map((t)=>({...t,available:!0,tool:t.id}));function jt({rootPath:t,repo:r,onComplete:l}){let c=lt(),[p,f]=n(bn),[v,h]=n(null),[y,g]=n(null),[m,C]=n(null),k=i(null),w=i(null);o(()=>{let R=!1;return(async()=>{try{let P=await(await fetch("/api/fs/archive")).json();if(!R&&Array.isArray(P.formats)&&P.formats.length>0)f(P.formats)}catch{}})(),()=>{R=!0}},[]),o(()=>{if(c.state!=="idle"||!c.data)return;let R=c.data;if(w.current===R)return;w.current=R;let T=k.current;if(k.current=null,R.success){if(C(null),T==="compress")h(null);if(T==="extract")g(null);l()}else if(T)C(R.error||"The archive request failed")},[c.state,c.data]);let A=a((R)=>{let T=new FormData;for(let[P,j]of Object.entries(R))T.append(P,j);if(r&&r!==".")T.append("repo",r);if(t)T.append("root",t);c.submit(T,{method:"post",action:"/api/fs/action"})},[c,r,t]),N=a((R)=>{if(R.length===0)return;let T=p.find((P)=>P.id==="zip"&&P.available)?.id??p.find((P)=>P.available)?.id??"zip";C(null),g(null),h({entries:R.map(({path:P,name:j,kind:ee})=>({path:P,name:j,kind:ee})),format:T,name:De(R,T),destination:Ct(R)})},[p]),E=a((R)=>{C(null),h(null),g({archive:R,destination:Ft(R.path)})},[]),S=a((R)=>{h((T)=>{if(!T)return T;let P=De(T.entries,T.format),j=T.name===P?De(T.entries,R):T.name;return{...T,format:R,name:j}})},[]);return{formats:p,compress:v,extract:y,error:m,busy:c.state!=="idle",openCompress:N,openExtract:E,setFormat:S,setName:(R)=>h((T)=>T&&{...T,name:R}),setCompressDestination:(R)=>h((T)=>T&&{...T,destination:R}),setExtractDestination:(R)=>g((T)=>T&&{...T,destination:R}),cancel:()=>{h(null),g(null),C(null)},submitCompress:()=>{let R=v;if(!R)return;k.current="compress",C(null),A({actionType:"compress",format:R.format,name:R.name.trim(),destination:R.destination.trim()||".",paths:JSON.stringify(R.entries.map((T)=>T.path))})},submitExtract:()=>{let R=y;if(!R)return;k.current="extract",C(null),A({actionType:"extract",path:R.archive.path,destination:R.destination.trim()||"."})}}}function xn(t){if(t.shiftKey)return"range";if(t.metaKey||t.ctrlKey)return"toggle";return"plain"}function vn(t,r,l){if(!r)return[l];let c=t.indexOf(r),p=t.indexOf(l);if(c===-1||p===-1)return[l];let f=Math.min(c,p),v=Math.max(c,p);return t.slice(f,v+1)}function _t(t){let[r,l]=n(()=>new Set),[c,p]=n(null),f=a((g,m)=>{if(g==="range"){l(new Set(vn(t,c,m)));return}if(p(m),g==="toggle"){l((C)=>{let k=new Set(C);if(k.has(m))k.delete(m);else k.add(m);return k});return}l(new Set([m]))},[c,t]),v=a((g)=>{l((m)=>{if(m.has(g))return m;return new Set([g])}),p(g)},[]),h=a(()=>{l(new Set),p(null)},[]),y=a(xn,[]);return u(()=>({selected:r,count:r.size,anchor:c,gestureOf:y,applyGesture:f,ensureForContext:v,clear:h}),[r,c,y,f,v,h])}function Ke(t,r,l=0,c=[]){for(let p of t)if(c.push({path:p.path,name:p.name,kind:p.type==="folder"?"folder":"file",depth:l}),p.type==="folder"&&r(p)&&Array.isArray(p.children))Ke(p.children,r,l+1,c);return c}function Wt({listing:t,setExpandedPaths:r,setStoredExpandedPaths:l,reload:c,onMoved:p}){let f=a((y,g)=>{let m=at(g,y);if(m.length===0)return;r((C)=>{if(m.every((w)=>C.has(w)))return C;let k=new Set(C);for(let w of m)k.add(w);return l(Array.from(k)),k})},[r,l]),v=a((y)=>{let g=t.insertEntry(y);if(!g){c();return}f(y.path,g)},[t,c,f]),h=a((y,g)=>{p?.(y,g),r((C)=>{let k=It(C,y,g);return l(Array.from(k)),k});let m=t.moveEntry(y,g);if(!m){c();return}f(g,m)},[t,c,f,r,l,p]);return{insertCreated:v,moveRenamed:h}}var yn=new Set;function Ut({scope:t,setExpandedPaths:r,setStoredExpandedPaths:l}){let[c,p]=n({scope:t,chains:new Map}),f=a((y)=>{let g=Me(y.path,y.name);if(!g)return;p((C)=>{let k=C.scope===t?C.chains:new Map;if(k.get(y.path)?.length===g.length)return C;let A=new Map(k);return A.set(y.path,g),{scope:t,chains:A}});let m=g.slice(0,-1);r((C)=>{if(m.every((w)=>C.has(w)))return C;let k=new Set(C);for(let w of m)k.add(w);return l(Array.from(k)),k})},[t,r,l]),v=a((y)=>{let g=c.scope===t?c.chains.get(y):void 0;if(!g)return;let m=g.slice(0,-1);p((C)=>{if(C.scope!==t)return C;let k=new Map(C.chains);return k.delete(y),{scope:t,chains:k}}),r((C)=>{if(!m.some((w)=>C.has(w)))return C;let k=new Set(C);for(let w of m)k.delete(w);return l(Array.from(k)),k})},[t,c,r,l]),h=a((y,g)=>{let m=c.scope===t?c.chains:null;if(!m)return;let C=new Map,k=[],w=!1;for(let[A,N]of m){if(N.findIndex((T,P)=>T===y&&P>0&&P<N.length-1)!==-1){w=!0;continue}let S=N.map((T)=>T===y?g:T.startsWith(`${y}/`)?`${g}${T.slice(y.length)}`:T),R=S[S.length-1];if(R!==A||S.some((T,P)=>T!==N[P]))w=!0;C.set(R,S),k.push(...S.slice(0,-1))}if(!w)return;p({scope:t,chains:C}),r((A)=>{if(k.every((E)=>A.has(E)))return A;let N=new Set(A);for(let E of k)N.add(E);return l(Array.from(N)),N})},[t,c,r,l]);return{unfolded:c.scope===t&&c.chains.size>0?new Set(c.chains.keys()):yn,unfold:f,fold:v,rekey:h}}function Vt(t,r){let l=r.trim().toLowerCase();if(!l)return t;let c=(p)=>{let f=p.name.toLowerCase().includes(l);if(p.type==="folder"){let v=(p.children||[]).map(c).filter((h)=>h!==null);if(f||v.length>0)return{...p,children:f&&v.length===0?p.children:v,forceExpanded:!0};return null}return f?p:null};return t.map(c).filter((p)=>p!==null)}function Xt({dragging:t,clipboard:r,target:l}){let c=Boolean(t)&&r.moveRefusalFor(t,l)===null,[p,f]=n(!1);return o(()=>{if(!t)f(!1)},[t]),{accepts:c,highlighted:p&&c,onDragEnter:()=>{if(t)f(!0)},onDragLeave:(v)=>{if(!v.currentTarget.contains(v.relatedTarget))f(!1)},onDragOver:(v)=>{if(!c)return;if(v.preventDefault(),v.dataTransfer)v.dataTransfer.dropEffect="move"},onDrop:(v)=>{if(!c)return;v.preventDefault(),f(!1),r.move(t,l)}}}function ni({className:t="",enabled:r=!0,active:l=!0,rootPath:c,onOpenFile:p,refreshKey:f=0,onRefresh:v}){let[h,y]=_("files.searchQuery",""),[g,m,C]=_("files.expandedPaths",[]),[k,w]=n(()=>new Set(g)),{activeRepo:A,setActiveRepo:N}=mr(c),{repos:E,scanning:S,rescan:R}=fr(c,r),{fileMap:T,folderMap:P,refreshGitStatus:j}=Hs(c,A,r),[ee,te]=n(null),ae=i(null);o(()=>{if(!C)return;w((z)=>{let Z=new Set(g);if(z.size===Z.size&&Array.from(Z).every((fe)=>z.has(fe)))return z;return Z})},[C,g]);let I=Gt({enabled:r,rootPath:c,activeRepo:A,expandedPaths:k,onExpansionPruned:(z)=>{w(z),m(Array.from(z))}});o(()=>{if(!C||!l)return;I.reload()},[f,c,r,A,C,l]);let O=r&&C?rA(I.scope):null,L=Ee(O);o(()=>{if(L.data)I.adoptRoot(L.data)},[L.data]);let H=(z)=>(j(),I.loadChildren(z)),G=(z,Z)=>{let fe=new Set(k);if(Z)fe.add(z);else fe.delete(z);w(fe),m(Array.from(fe))},{unfolded:ne,unfold:q,fold:X,rekey:J}=Ut({scope:I.scope,setExpandedPaths:w,setStoredExpandedPaths:m}),ie=I.files,he=it(ie,ne),Q=Vt(he.nodes,h),ue=Ke(Q,(z)=>z.forceExpanded!==void 0?z.forceExpanded:k.has(z.path)),le=_t(ue.map((z)=>z.path)),xe=ue.filter((z)=>le.selected.has(z.path)).map(({path:z,name:Z,kind:fe})=>({path:z,name:Z,kind:fe})),M=(z)=>{if(z===A)return;I.reset(),w(new Set),m([]),le.clear(),N(z)},K=()=>{if(j(),v)v();else I.reload()},{insertCreated:ce,moveRenamed:ye}=Wt({listing:I,setExpandedPaths:w,setStoredExpandedPaths:m,reload:K,onMoved:(z,Z)=>J(z,Z)}),be=ns(),{pushToast:W}=qe(),Y=Kt({rootPath:c,repo:A,onComplete:K,onError:(z)=>W(z,"error")}),ke=jt({rootPath:c,repo:A,onComplete:K}),ve={path:".",name:".",kind:"folder"},de=Y.clip&&!Y.refusalFor(ve)?`Paste ${we(Y.clip)??"item"}`:null,[V,ge]=n(null),pe=Xt({dragging:V,clipboard:Y,target:ve}),Re=Ne({folderPath:".",rootPath:c,repo:A,onCreated:ce,onOpenCreated:(z)=>p?.({...z,root:c,repo:A})}),[je,qt]=n(!1);o(()=>qt(!0),[]);let{count:_e,clear:We}=le;if(o(()=>{if(!l)return;let z=(Z)=>{if(Z.key==="Escape"&&_e>0)We()};return window.addEventListener("keydown",z),()=>window.removeEventListener("keydown",z)},[l,_e,We]),!r)return e("div",{className:`flex flex-col h-full bg-paper items-center justify-center text-ink/40 ${t}`,children:e("span",{className:"text-xs font-mono text-muted",children:"No session selected"})});let Bt=I.isLoading||L.refreshing;return e("div",{className:`flex flex-col h-full bg-paper ${t}`,children:[e(Qe,{rootPath:c,activeRepo:A,repos:E,reposScanning:S,onRefreshRepos:R,onSelectRepo:M,searchQuery:h,onSearchChange:y,onRefresh:K,refreshing:Bt}),e("div",{className:`flex-1 scrollbar-overlay-container p-2 font-mono text-[11px] text-ink/80 ${be?"file-tree-touch":""} ${pe.highlighted?"bg-info/[0.06]":""}`,onContextMenu:(z)=>{z.preventDefault(),te({x:z.clientX,y:z.clientY})},onDragEnter:pe.onDragEnter,onDragLeave:pe.onDragLeave,onDragOver:pe.onDragOver,onDrop:pe.onDrop,children:I.isLoading&&Q.length===0?e("div",{className:"p-4 text-center text-ink/40",children:"Loading files..."}):Q.length===0?e("div",{className:"p-4 text-center text-ink/40",children:"No files found"}):Q.map((z)=>e(Oe,{file:z,rootPath:c,basePath:I.root,repo:A,onLoadChildren:H,onOpenFile:p,onActionComplete:K,onCreated:ce,onRenamed:ye,expandedPaths:k,onToggleFolder:G,gitFileMap:T,gitFolderMap:P,clipboard:Y,archive:ke,selection:le,selectionTargets:xe,dragging:V,onDragStart:ge,onDragEnd:()=>ge(null),onDropOn:(Z)=>{if(!V)return;Y.move(V,Z)},onUnfold:q,onFold:X,foldRoots:he.roots,touch:be},z.path))}),e(Mt,{}),je&&e(St,{menu:ee,menuRef:ae,pasteLabel:de,busy:Y.busy,create:Re,onAction:(z)=>{if(te(null),z==="new_file")Re.openDialog("file");if(z==="new_folder")Re.openDialog("folder");if(z==="paste")Y.paste(ve)}}),je&&e(Et,{archive:ke})]})}export{ni as FileExplorer};
|