@kabmo-labs/kabmo 0.58.0 → 0.59.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.
Files changed (431) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +520 -489
  3. package/dist/client/static/js/{Body-karkrzkc.js → Body-jqq4654r.js} +3 -3
  4. package/dist/client/static/js/{CsvGrid-j03knmbe.js → CsvGrid-avw0taqb.js} +2 -2
  5. package/dist/client/static/js/{DocxView-e8408vzs.js → DocxView-d221vr6g.js} +3 -3
  6. package/dist/client/static/js/{DrawioView-fj4mfzch.js → DrawioView-gjsy7p01.js} +2 -2
  7. package/dist/client/static/js/{HtmlPreview-9g8xwzgw.js → HtmlPreview-949393v1.js} +1 -1
  8. package/dist/client/static/js/ImageView-pan9pqtm.js +1 -0
  9. package/dist/client/static/js/LayoutWrapper-p0qmghgt.js +2 -0
  10. package/dist/client/static/js/MergeDiffView-swt467g7.js +1 -0
  11. package/dist/client/static/js/Modal-4spmcn44.js +60 -0
  12. package/dist/client/static/js/{PdfView-8jtdx5hd.js → PdfView-dzj2s6rj.js} +1 -1
  13. package/dist/client/static/js/SessionsView-b6szjdg5.js +1 -0
  14. package/dist/client/static/js/{SheetView-hwx8s864.js → SheetView-jpc178g5.js} +11 -11
  15. package/dist/client/static/js/{SvgPreview-ete36nzv.js → SvgPreview-94fap32p.js} +1 -1
  16. package/dist/client/static/js/{abnfDiagram-O67JEVCF-7nsqzz6z.js → abnfDiagram-O67JEVCF-a6eyfzrj.js} +1 -1
  17. package/dist/client/static/js/architecture-7GRP2DOG-bwn1drdz.js +1 -0
  18. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-xvpkfq2f.js → architectureDiagram-NJMV4G6O-pgmyfncy.js} +3 -3
  19. package/dist/client/static/js/{astro-rsrqgjjx.js → astro-ryr2ajmg.js} +1 -1
  20. package/dist/client/static/js/bash-zknkkwkw.js +1 -0
  21. package/dist/client/static/js/{blockDiagram-BEXU5L5S-0saahcs6.js → blockDiagram-BEXU5L5S-rf51jyb2.js} +6 -6
  22. package/dist/client/static/js/c-0w02jkxb.js +1 -0
  23. package/dist/client/static/js/{c4Diagram-YGBWAQC7-ktpqnb4a.js → c4Diagram-YGBWAQC7-0faj48jp.js} +2 -2
  24. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-x67cz3ms.js → classDiagram-v2-NBCMYWYE-bvzsws8x.js} +6 -6
  25. package/dist/client/static/js/{cose-bilkent-JH36ORCC-9wzmhkz8.js → cose-bilkent-JH36ORCC-j1amnd3m.js} +1 -1
  26. package/dist/client/static/js/cpp-p5b4vean.js +1 -0
  27. package/dist/client/static/js/css-9jzbvdyz.js +1 -0
  28. package/dist/client/static/js/css-sn00sq6v.js +1 -0
  29. package/dist/client/static/js/cynefin-OW5HDTMX-jbc50ks8.js +1 -0
  30. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-dmmgmv99.js → cynefinDiagram-VND7K2PF-f73w6zzz.js} +2 -2
  31. package/dist/client/static/js/{dagre-6A5THRUB-ygkkms1t.js → dagre-6A5THRUB-a5vgvjsg.js} +2 -2
  32. package/dist/client/static/js/{diagram-22UHCM2B-qxj0pqb4.js → diagram-22UHCM2B-6y9efamp.js} +12 -12
  33. package/dist/client/static/js/{diagram-3UASUU5V-77k8w5dt.js → diagram-3UASUU5V-2mycy7xm.js} +2 -2
  34. package/dist/client/static/js/{diagram-ATOU4E4O-m0h86vf4.js → diagram-ATOU4E4O-10zgjb66.js} +3 -3
  35. package/dist/client/static/js/{diagram-CDSNMT55-5v28kaeg.js → diagram-CDSNMT55-bewa52yf.js} +4 -4
  36. package/dist/client/static/js/{diagram-MLGK6HIB-zgcg9gaz.js → diagram-MLGK6HIB-mh3b7gd3.js} +1 -1
  37. package/dist/client/static/js/{diagram-MPIPVDR6-10c9s6e6.js → diagram-MPIPVDR6-gvdrbdm5.js} +2 -2
  38. package/dist/client/static/js/{dockerfile-dr9sdsqp.js → dockerfile-6bn19kg0.js} +1 -1
  39. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-mz4022dz.js → ebnfDiagram-ZINNZB2B-2prre93c.js} +1 -1
  40. package/dist/client/static/js/{elixir-3dy25ex8.js → elixir-fyxw6d70.js} +1 -1
  41. package/dist/client/static/js/{elk-276RUBZZ-ccerbsag.js → elk-276RUBZZ-9t6t9kc6.js} +2 -2
  42. package/dist/client/static/js/{erDiagram-OPXOYQCR-a8vjyrrw.js → erDiagram-OPXOYQCR-etcggr5n.js} +6 -6
  43. package/dist/client/static/js/{erlang-v7344938.js → erlang-97ayje6m.js} +1 -1
  44. package/dist/client/static/js/eventmodeling-NTZA5JFV-b37ey01t.js +1 -0
  45. package/dist/client/static/js/flowDiagram-KWPJA3E3-7c2ncsw7.js +1 -0
  46. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-sz1g29fp.js → ganttDiagram-FUAMR5RP-cdc4mwhs.js} +3 -3
  47. package/dist/client/static/js/gitGraph-4MIJSDKK-mvqq7tcs.js +1 -0
  48. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-efqk42q0.js → gitGraphDiagram-X574FWY7-55d0fa7x.js} +8 -8
  49. package/dist/client/static/js/graphql-xzykn0ba.js +1 -0
  50. package/dist/client/static/js/html-2zc3shky.js +1 -0
  51. package/dist/client/static/js/{index-mpyd7qxj.js → index-10vzyga1.js} +2 -2
  52. package/dist/client/static/js/{index-2f6psebk.js → index-27gwghmp.js} +2 -2
  53. package/dist/client/static/js/{index-t71k3b28.js → index-2f6afhze.js} +2 -2
  54. package/dist/client/static/js/{index-tnxp90ac.js → index-3akjcs82.js} +1 -1
  55. package/dist/client/static/js/{index-fhtnvqgf.js → index-3j2he86h.js} +2 -2
  56. package/dist/client/static/js/index-461ga40v.js +2 -0
  57. package/dist/client/static/js/{index-9qf2h9jb.js → index-51rbgeh9.js} +12 -12
  58. package/dist/client/static/js/{index-zh550byg.js → index-537m8a3x.js} +2 -2
  59. package/dist/client/static/js/{index-tdg7hz80.js → index-58z2hatp.js} +2 -2
  60. package/dist/client/static/js/{index-4tbdws4r.js → index-5e4e18tg.js} +2 -2
  61. package/dist/client/static/js/{index-xfyxmaj1.js → index-60cxxnpk.js} +62 -62
  62. package/dist/client/static/js/{index-th61y26d.js → index-69mnn71v.js} +2 -2
  63. package/dist/client/static/js/{index-8aqjj2x2.js → index-6bsez5n6.js} +1 -1
  64. package/dist/client/static/js/{index-gaa39w5q.js → index-8tzt0dek.js} +2 -2
  65. package/dist/client/static/js/{index-vb5a3g01.js → index-8z9aqgf3.js} +4 -4
  66. package/dist/client/static/js/{index-ewryzs4g.js → index-92h38pwg.js} +2 -2
  67. package/dist/client/static/js/{index-7ma44af3.js → index-9rvjegmy.js} +3 -3
  68. package/dist/client/static/js/{index-q0k1am0g.js → index-a3bpmw2r.js} +2 -2
  69. package/dist/client/static/js/{index-j863hg0d.js → index-a5ecn5yx.js} +6 -6
  70. package/dist/client/static/js/{index-6ey6y9em.js → index-ax8gaayq.js} +2 -2
  71. package/dist/client/static/js/{index-e42ys2q3.js → index-c253x7vt.js} +7 -7
  72. package/dist/client/static/js/{index-y0f3wbc3.js → index-d9sfavx1.js} +2 -2
  73. package/dist/client/static/js/{index-5tp3emtg.js → index-db6s66jr.js} +2 -2
  74. package/dist/client/static/js/index-eggbcdwx.js +481 -0
  75. package/dist/client/static/js/{index-ts8rhd06.js → index-f13ern5e.js} +1 -1
  76. package/dist/client/static/js/{index-ver116ed.js → index-f6t91mpp.js} +1 -1
  77. package/dist/client/static/js/{index-tc07gd33.js → index-fr91ghwb.js} +2 -2
  78. package/dist/client/static/js/{index-tq3t3qm4.js → index-fsa18ns9.js} +2 -2
  79. package/dist/client/static/js/{index-k56patms.js → index-fyt8m8ah.js} +2 -2
  80. package/dist/client/static/js/{index-gw4c5n3a.js → index-gcad7b6g.js} +2 -2
  81. package/dist/client/static/js/{index-rxt8sf9a.js → index-h1xbx74w.js} +2 -2
  82. package/dist/client/static/js/{index-q5q8a3qn.js → index-j1ksa4x2.js} +2 -2
  83. package/dist/client/static/js/{index-sxag9ptg.js → index-jct0jryd.js} +2 -2
  84. package/dist/client/static/js/{index-r1wrke3j.js → index-jpvng27a.js} +1 -1
  85. package/dist/client/static/js/{index-w5j1wgcz.js → index-me0b6wkw.js} +1 -1
  86. package/dist/client/static/js/{index-6x0kn8pb.js → index-mhrkjbjq.js} +2 -2
  87. package/dist/client/static/js/{index-nzq51nbb.js → index-mngpcca7.js} +5 -5
  88. package/dist/client/static/js/index-mttx9327.css +1 -0
  89. package/dist/client/static/js/{index-ssepzdaz.js → index-mx5y9vt9.js} +7 -7
  90. package/dist/client/static/js/{index-3ymw778n.js → index-ndqtff48.js} +2 -2
  91. package/dist/client/static/js/{index-wnk9k57k.js → index-nf4hq5tg.js} +55 -55
  92. package/dist/client/static/js/{index-f31c6jg8.js → index-njhrm5qa.js} +10 -10
  93. package/dist/client/static/js/index-nnwcbp2d.js +2 -0
  94. package/dist/client/static/js/{index-3p732mvs.js → index-np2rfq06.js} +2 -2
  95. package/dist/client/static/js/{index-kc5yt2cd.js → index-nwbr15b3.js} +2 -2
  96. package/dist/client/static/js/{index-2a0b9ya2.js → index-pa70qj4p.js} +1 -1
  97. package/dist/client/static/js/index-pe5f2gmn.js +1 -0
  98. package/dist/client/static/js/{index-qbqm3c91.js → index-pgy7ree5.js} +5 -5
  99. package/dist/client/static/js/index-pzwf6hwe.js +4 -0
  100. package/dist/client/static/js/{index-jnxmvxb8.js → index-q3k8r0ms.js} +11 -11
  101. package/dist/client/static/js/{index-qkcmspxq.js → index-rw84kefb.js} +2 -2
  102. package/dist/client/static/js/{index-gqsnyh8k.js → index-s9ts6qbj.js} +2 -2
  103. package/dist/client/static/js/{index-dqf0srrp.js → index-sg65xdey.js} +2 -2
  104. package/dist/client/static/js/{index-mkp3gwag.js → index-skvfxcd8.js} +1 -1
  105. package/dist/client/static/js/{index-6qqsy78z.js → index-sx2yz2wx.js} +1 -1
  106. package/dist/client/static/js/{index-6ac860yz.js → index-trq7bdvk.js} +2 -2
  107. package/dist/client/static/js/{index-v8xhgfeq.js → index-vs2y8gxr.js} +2 -2
  108. package/dist/client/static/js/index-wwyjzhgs.js +2 -0
  109. package/dist/client/static/js/{index-7s4dge1z.js → index-xe447cw3.js} +1 -1
  110. package/dist/client/static/js/index-y09de44h.js +2 -0
  111. package/dist/client/static/js/{index-jxsha63v.js → index-y4cx8cqf.js} +2 -2
  112. package/dist/client/static/js/{index-bkwax812.js → index-yg38s8t3.js} +1 -1
  113. package/dist/client/static/js/{index-dz18nn65.js → index-yh7gngsh.js} +2 -2
  114. package/dist/client/static/js/{index-3m1dksmy.js → index-yrwm437g.js} +2 -2
  115. package/dist/client/static/js/{index-7ynf3s2w.js → index-z82nd2bd.js} +2 -2
  116. package/dist/client/static/js/info-A6RAGUB7-zkv4crz7.js +1 -0
  117. package/dist/client/static/js/{infoDiagram-VRGFBTTK-rykcacj5.js → infoDiagram-VRGFBTTK-9xph6cr5.js} +2 -2
  118. package/dist/client/static/js/ini-62r3vxaf.js +1 -0
  119. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-rj752kd8.js → ishikawaDiagram-OU5B5YK6-3gshs3v8.js} +2 -2
  120. package/dist/client/static/js/java-kacycary.js +1 -0
  121. package/dist/client/static/js/javascript-zc1qnyyp.js +1 -0
  122. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-mtetwn6f.js → journeyDiagram-ZHPQQLJL-fa8x56mf.js} +3 -3
  123. package/dist/client/static/js/json-yrwpn6bd.js +1 -0
  124. package/dist/client/static/js/jsx-b40ag8q1.js +1 -0
  125. package/dist/client/static/js/{julia-mxe3pnz3.js → julia-agc5kfvg.js} +1 -1
  126. package/dist/client/static/js/{kanban-definition-PNTS6WVX-4h5pw5mm.js → kanban-definition-PNTS6WVX-fybp2hh4.js} +5 -5
  127. package/dist/client/static/js/lua-bk961f37.js +1 -0
  128. package/dist/client/static/js/markdown-b7rgzgd6.js +1 -0
  129. package/dist/client/static/js/mermaid.core-jjh5ggp0.js +12 -0
  130. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-67s4xy7h.js → mindmap-definition-NLK3R4M7-gtfbg619.js} +5 -5
  131. package/dist/client/static/js/one-dark-pro-vht9rv39.js +1 -0
  132. package/dist/client/static/js/one-light-arxc5whh.js +1 -0
  133. package/dist/client/static/js/packet-AYTQ26CC-dgpge627.js +1 -0
  134. package/dist/client/static/js/{pegDiagram-GJSIUBJH-qykb6ssk.js → pegDiagram-GJSIUBJH-1a51sbqv.js} +1 -1
  135. package/dist/client/static/js/{perl-a8eeaqkn.js → perl-v5vbtzgf.js} +1 -1
  136. package/dist/client/static/js/{php-6gq92zt8.js → php-83qwy98t.js} +1 -1
  137. package/dist/client/static/js/pie-WAS4IAKB-b8pgsqrd.js +1 -0
  138. package/dist/client/static/js/{pieDiagram-5QR66LMP-mymrrvck.js → pieDiagram-5QR66LMP-zd9svyyn.js} +3 -3
  139. package/dist/client/static/js/properties-k8gbzggp.js +1 -0
  140. package/dist/client/static/js/python-343tspad.js +1 -0
  141. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-6f8ahd40.js → quadrantDiagram-O4NWA36T-5gtw2m6s.js} +3 -3
  142. package/dist/client/static/js/r-ycdwmv8g.js +1 -0
  143. package/dist/client/static/js/radar-RG4KPBEZ-fmfe5y27.js +1 -0
  144. package/dist/client/static/js/railroad-74A4TZTK-b5tks4ce.js +1 -0
  145. package/dist/client/static/js/railroad-abnf-HS5TGJTU-0sf4m0ze.js +1 -0
  146. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-pjfy3pt7.js +1 -0
  147. package/dist/client/static/js/railroad-peg-WCYAUIDC-nr8ngt42.js +1 -0
  148. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-c3habpvw.js → railroadDiagram-XR7U4H2S-3ccwpfzz.js} +1 -1
  149. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-nysqy6te.js → requirementDiagram-PLB6GJNP-sasndrrp.js} +4 -4
  150. package/dist/client/static/js/{ruby-mc826p2e.js → ruby-994n5j6e.js} +1 -1
  151. package/dist/client/static/js/{rust-m4f4vpvn.js → rust-n9z2c9m3.js} +1 -1
  152. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-s5dtfp3z.js → sankeyDiagram-IPEJSGJF-2ahb4sda.js} +3 -3
  153. package/dist/client/static/js/{sass-8bq5r2tz.js → sass-p6g7qdv2.js} +1 -1
  154. package/dist/client/static/js/{scss-9wz47c6t.js → scss-4j4t3r6y.js} +1 -1
  155. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-bb3yp049.js → sequenceDiagram-PO4LG4MO-bfj90kz1.js} +7 -7
  156. package/dist/client/static/js/{sizeCapture-INFHLROL-0m2msee7.js → sizeCapture-INFHLROL-5tygxmtc.js} +1 -1
  157. package/dist/client/static/js/sql-kwpd5w07.js +1 -0
  158. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-cd0qgj6t.js → stateDiagram-v2-GCMORJYK-533xw76e.js} +3 -3
  159. package/dist/client/static/js/{svelte-5vrwkc13.js → svelte-bek3h1sz.js} +1 -1
  160. package/dist/client/static/js/{swimlanes-2SLR337P-rpb01f7p.js → swimlanes-2SLR337P-gd3d04pk.js} +1 -1
  161. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-xxmvdyg4.js +8 -0
  162. package/dist/client/static/js/{timeline-definition-EJHVYXUP-tqw2e6y1.js → timeline-definition-EJHVYXUP-fvqvgqvg.js} +3 -3
  163. package/dist/client/static/js/treeView-Q6P3EWNA-23r9fa68.js +1 -0
  164. package/dist/client/static/js/treemap-WGGIJYW6-mxxzdrj6.js +1 -0
  165. package/dist/client/static/js/tsx-gjxfjnbk.js +1 -0
  166. package/dist/client/static/js/typescript-4dchbnya.js +1 -0
  167. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-dhf4d5xg.js → usecaseDiagram-POWQR4AR-tm1f0m4x.js} +25 -25
  168. package/dist/client/static/js/{vennDiagram-UO4OBE2U-ztkk79dv.js → vennDiagram-UO4OBE2U-2vdvv1hd.js} +4 -4
  169. package/dist/client/static/js/{vue-gmjnxjm3.js → vue-y44m889c.js} +1 -1
  170. package/dist/client/static/js/wardley-WFR3VGLG-cbqtax1x.js +1 -0
  171. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-ahre5tmv.js → wardleyDiagram-VNRHLVJA-7avcjznx.js} +4 -4
  172. package/dist/client/static/js/xml-xs6qz3ya.js +1 -0
  173. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-vak2c50n.js → xychartDiagram-PMCCYNJV-g39y526n.js} +4 -4
  174. package/dist/client/static/js/yaml-174nk5bn.js +1 -0
  175. package/package.json +7 -7
  176. package/src/client/borders.css +15 -3
  177. package/src/client/components/common/ComposerTextarea.test.tsx +13 -1
  178. package/src/client/components/common/ComposerTextarea.tsx +8 -2
  179. package/src/client/components/common/MarkdownRenderer.tsx +11 -2
  180. package/src/client/components/common/anchored-menu/index.tsx +11 -4
  181. package/src/client/components/common/harness-glyph/harness-glyph.test.ts +0 -4
  182. package/src/client/components/common/harness-glyph/index.tsx +4 -5
  183. package/src/client/components/common/markdown-inline-file.test.tsx +90 -15
  184. package/src/client/components/common/session-actions-menu/index.test.tsx +45 -0
  185. package/src/client/components/common/session-actions-menu/index.tsx +6 -1
  186. package/src/client/components/common/session-row/TrailingSlot.tsx +6 -2
  187. package/src/client/components/common/session-row/index.tsx +32 -16
  188. package/src/client/components/common/session-row/session-row.test.tsx +56 -18
  189. package/src/client/components/layout/desktop-layout/RightColumn.tsx +4 -1
  190. package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +28 -35
  191. package/src/client/components/layout/desktop-layout/index.tsx +5 -3
  192. package/src/client/components/layout/desktop-layout/resizer/index.tsx +13 -3
  193. package/src/client/components/layout/desktop-layout/resizer/panel.test.ts +41 -0
  194. package/src/client/components/layout/session-sidebar/CategoryHeader.tsx +21 -1
  195. package/src/client/components/layout/session-sidebar/CategoryHeader.worktree.test.tsx +1 -0
  196. package/src/client/components/layout/session-sidebar/CategoryItem.tsx +8 -2
  197. package/src/client/components/layout/session-sidebar/ClassicView.tsx +2 -0
  198. package/src/client/components/layout/session-sidebar/SessionList.tsx +4 -0
  199. package/src/client/components/layout/session-sidebar/SessionsView.tsx +22 -1
  200. package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +46 -8
  201. package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +9 -3
  202. package/src/client/components/layout/session-sidebar/modern/index.tsx +2 -0
  203. package/src/client/components/layout/session-sidebar/modern/workspace-header.test.tsx +36 -0
  204. package/src/client/components/layout/session-sidebar/search-results.test.tsx +29 -16
  205. package/src/client/components/layout/session-sidebar/session-list-states.test.tsx +1 -0
  206. package/src/client/components/layout/session-sidebar/variant-props.ts +2 -0
  207. package/src/client/components/mobile/LayoutWrapper.tsx +9 -0
  208. package/src/client/components/mobile/SessionSidebar.tsx +4 -0
  209. package/src/client/components/mobile/left-drawer-nav.test.tsx +1 -1
  210. package/src/client/components/mobile/mobile-session-sidebar/Body.tsx +4 -0
  211. package/src/client/components/mobile/mobile-session-sidebar/ClassicDrawer.tsx +3 -0
  212. package/src/client/components/mobile/mobile-session-sidebar/Item.test.tsx +85 -0
  213. package/src/client/components/mobile/mobile-session-sidebar/Item.tsx +30 -14
  214. package/src/client/components/mobile/mobile-session-sidebar/List.tsx +4 -0
  215. package/src/client/components/settings/apply-side-effects.test.ts +31 -0
  216. package/src/client/components/settings/apply-side-effects.ts +7 -0
  217. package/src/client/components/settings/categories/appearance-settings/BorderStyleSection.tsx +3 -2
  218. package/src/client/components/settings/categories/appearance-settings/SidebarStyleSection.test.tsx +95 -0
  219. package/src/client/components/settings/categories/appearance-settings/SidebarStyleSection.tsx +35 -0
  220. package/src/client/components/workspace/chat-timeline/ChatOverlays.tsx +1 -0
  221. package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +1 -0
  222. package/src/client/components/workspace/chat-timeline/MessageItem.gutter.test.ts +26 -0
  223. package/src/client/components/workspace/chat-timeline/MessageItem.tsx +6 -3
  224. package/src/client/components/workspace/chat-timeline/NewChatModal.tsx +5 -0
  225. package/src/client/components/workspace/chat-timeline/OrchestrationNotice.tsx +81 -162
  226. package/src/client/components/workspace/chat-timeline/SystemNotice.tsx +7 -3
  227. package/src/client/components/workspace/chat-timeline/ThinkingSection.test.tsx +17 -0
  228. package/src/client/components/workspace/chat-timeline/ThinkingSection.tsx +21 -7
  229. package/src/client/components/workspace/chat-timeline/ToolCallingSection.tsx +1 -0
  230. package/src/client/components/workspace/chat-timeline/UserTurn.test.tsx +24 -6
  231. package/src/client/components/workspace/chat-timeline/UserTurn.tsx +17 -4
  232. package/src/client/components/workspace/chat-timeline/block-chrome.test.tsx +16 -0
  233. package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.test.ts +104 -11
  234. package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +120 -43
  235. package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.tsx +28 -21
  236. package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.wait.test.tsx +48 -0
  237. package/src/client/components/workspace/chat-timeline/chat-input/ComposerRows.tsx +47 -22
  238. package/src/client/components/workspace/chat-timeline/chat-input/GoalBanner.test.ts +24 -0
  239. package/src/client/components/workspace/chat-timeline/chat-input/GoalBanner.tsx +44 -18
  240. package/src/client/components/workspace/chat-timeline/chat-input/GoalSurfaces.tsx +2 -1
  241. package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.test.ts +35 -0
  242. package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.tsx +33 -12
  243. package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.test.tsx +26 -2
  244. package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.tsx +67 -37
  245. package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.test.ts +86 -1
  246. package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +90 -135
  247. package/src/client/components/workspace/chat-timeline/chat-input/VoiceButton.tsx +58 -0
  248. package/src/client/components/workspace/chat-timeline/chat-input/access-capability.test.tsx +151 -0
  249. package/src/client/components/workspace/chat-timeline/chat-input/action-base.ts +42 -0
  250. package/src/client/components/workspace/chat-timeline/chat-input/index.tsx +1 -0
  251. package/src/client/components/workspace/chat-timeline/chat-input/mode-icons.test.ts +108 -0
  252. package/src/client/components/workspace/chat-timeline/chat-input/mode-icons.tsx +122 -0
  253. package/src/client/components/workspace/chat-timeline/chat-input/modes-props.ts +5 -0
  254. package/src/client/components/workspace/chat-timeline/chat-input/narrow.test.tsx +78 -20
  255. package/src/client/components/workspace/chat-timeline/chat-input/styles/index.tsx +11 -5
  256. package/src/client/components/workspace/chat-timeline/chat-input/styles.test.tsx +19 -0
  257. package/src/client/components/workspace/chat-timeline/composer-dock-frame.test.tsx +9 -0
  258. package/src/client/components/workspace/chat-timeline/fork-preview.test.tsx +1 -1
  259. package/src/client/components/workspace/chat-timeline/index.tsx +1 -1
  260. package/src/client/components/workspace/chat-timeline/target-picker/ParentSessionPicker.test.tsx +21 -5
  261. package/src/client/components/workspace/chat-timeline/target-picker/ParentSessionPicker.tsx +100 -71
  262. package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.test.tsx +9 -9
  263. package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.tsx +83 -66
  264. package/src/client/components/workspace/chat-timeline/target-picker/WorktreePicker.test.tsx +3 -3
  265. package/src/client/components/workspace/chat-timeline/target-picker/WorktreePicker.tsx +36 -15
  266. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OptionRow.test.tsx +125 -0
  267. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OptionRow.tsx +84 -27
  268. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Mcp.test.tsx +18 -0
  269. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Mcp.tsx +14 -5
  270. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ArtifactChip.tsx +7 -3
  271. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolRowActions.tsx +10 -2
  272. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Card.tsx +2 -2
  273. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Compact.tsx +11 -6
  274. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Minimal.tsx +2 -2
  275. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Trace.tsx +2 -2
  276. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.test.tsx +5 -3
  277. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.tsx +19 -12
  278. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/parity.test.tsx +50 -2
  279. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/props.ts +2 -0
  280. package/src/client/components/workspace/model-dropdown/HarnessTabs.tsx +31 -10
  281. package/src/client/components/workspace/model-dropdown/Header.tsx +13 -5
  282. package/src/client/components/workspace/model-dropdown/Panel.tsx +18 -0
  283. package/src/client/components/workspace/model-dropdown/ThinkingLevels.tsx +51 -0
  284. package/src/client/components/workspace/model-dropdown/Trigger.tsx +99 -0
  285. package/src/client/components/workspace/model-dropdown/bands.ts +51 -0
  286. package/src/client/components/workspace/model-dropdown/harness-tabs.test.tsx +21 -5
  287. package/src/client/components/workspace/model-dropdown/index.tsx +20 -47
  288. package/src/client/components/workspace/model-dropdown/thinking-levels.test.tsx +108 -0
  289. package/src/client/components/workspace/model-dropdown/trigger.test.ts +54 -8
  290. package/src/client/hooks/chat/composer/attachments.test.ts +12 -0
  291. package/src/client/hooks/chat/composer/attachments.ts +16 -4
  292. package/src/client/hooks/chat/composer/pipeline.test.ts +14 -0
  293. package/src/client/hooks/chat/composer/pipeline.ts +15 -6
  294. package/src/client/hooks/chat/omp/session-list.activity.test.ts +20 -0
  295. package/src/client/hooks/chat/omp/session-merges.ts +18 -6
  296. package/src/client/hooks/chat/omp/session-sidebar-controller.ts +4 -0
  297. package/src/client/hooks/chat/timeline/access-ladder-wiring.test.ts +111 -0
  298. package/src/client/hooks/chat/timeline/access-ladder.test.ts +66 -0
  299. package/src/client/hooks/chat/timeline/access-ladder.ts +72 -0
  300. package/src/client/hooks/chat/timeline/access-mode.ts +11 -1
  301. package/src/client/hooks/chat/timeline/index.ts +4 -5
  302. package/src/client/hooks/chat/timeline/modes-contract.ts +10 -1
  303. package/src/client/hooks/chat/timeline/modes.ts +10 -2
  304. package/src/client/hooks/chat/timeline/scope.test.ts +17 -0
  305. package/src/client/hooks/chat/timeline/scope.ts +6 -1
  306. package/src/client/hooks/chat/timeline/send-refusal.test.ts +19 -0
  307. package/src/client/hooks/chat/timeline/send-steer.test.ts +17 -0
  308. package/src/client/hooks/chat/timeline/send.ts +17 -0
  309. package/src/client/hooks/editor/quick-open.ts +41 -0
  310. package/src/client/hooks/ui/border-style.test.ts +13 -0
  311. package/src/client/hooks/ui/markdown-render.ts +11 -6
  312. package/src/client/hooks/ui/open-inline-file.test.ts +16 -0
  313. package/src/client/hooks/ui/open-inline-file.ts +4 -2
  314. package/src/client/hooks/ui/show-more.ts +11 -1
  315. package/src/client/hooks/ui/ui-feedback.test.ts +11 -0
  316. package/src/client/hooks/ui/verified-inline-files.test.tsx +143 -0
  317. package/src/client/hooks/ui/verified-inline-files.ts +165 -0
  318. package/src/client/hooks/workspace/mobile-workspace-panels.test.tsx +116 -0
  319. package/src/client/hooks/workspace/mobile-workspace-panels.ts +73 -0
  320. package/src/client/hooks/workspace/panel-resize.test.ts +127 -0
  321. package/src/client/hooks/workspace/panel-resize.ts +81 -0
  322. package/src/client/hooks/workspace/session-list-limit.test.ts +80 -0
  323. package/src/client/hooks/workspace/session-list-limit.ts +69 -0
  324. package/src/client/hooks/workspace/session-pin.ts +58 -0
  325. package/src/client/hooks/workspace/workspace-panels-mode.test.tsx +87 -0
  326. package/src/client/hooks/workspace/workspace-panels-mode.ts +76 -0
  327. package/src/client/lib/router/branch-params.test.ts +17 -1
  328. package/src/client/lib/router/branch-params.ts +18 -0
  329. package/src/client/lib/ui/pressed.ts +15 -0
  330. package/src/client/tailwind.css +30 -10
  331. package/src/server/lib/connect/cloudflared.lifecycle.test.ts +25 -9
  332. package/src/server/lib/db/schema.test.ts +1 -1
  333. package/src/server/lib/db/schema.ts +17 -0
  334. package/src/server/lib/harness/activity.server.test.ts +81 -0
  335. package/src/server/lib/harness/activity.server.ts +55 -0
  336. package/src/server/lib/harness/spawn.server.ts +9 -0
  337. package/src/server/lib/omp/session/delete.server.ts +4 -2
  338. package/src/server/lib/omp/session/sidebar-activity.server.test.ts +24 -2
  339. package/src/server/lib/omp/session/sidebar-data.canonical.test.ts +14 -0
  340. package/src/server/lib/realtime/topics/session-data.server.ts +6 -5
  341. package/src/server/lib/realtime/topics/session-data.test.ts +35 -0
  342. package/src/server/lib/sessions/last-opened.server.test.ts +17 -0
  343. package/src/server/lib/sessions/last-opened.server.ts +18 -1
  344. package/src/server/routes/sessions/index.ts +3 -2
  345. package/src/server/routes/sessions/routes.test.ts +29 -46
  346. package/src/server/routes/sessions/session.ts +40 -62
  347. package/src/server/routes/sessions/state.test.ts +89 -0
  348. package/src/server/routes/sessions/state.ts +86 -0
  349. package/src/shared/lib/chat/attachment-budget.test.ts +74 -0
  350. package/src/shared/lib/chat/attachment-budget.ts +111 -0
  351. package/src/shared/lib/chat/attachments.test.ts +0 -17
  352. package/src/shared/lib/chat/attachments.ts +0 -53
  353. package/src/shared/lib/chat/orchestration/outcome-markdown.test.ts +57 -0
  354. package/src/shared/lib/chat/orchestration/outcome-markdown.ts +74 -0
  355. package/src/shared/lib/chat/timeline/block-chrome.test.ts +35 -0
  356. package/src/shared/lib/chat/timeline/block-chrome.ts +21 -0
  357. package/src/shared/lib/markdown/degenerate-emphasis.test.ts +64 -0
  358. package/src/shared/lib/markdown/degenerate-emphasis.ts +90 -0
  359. package/src/shared/lib/markdown/inline-file.test.ts +79 -22
  360. package/src/shared/lib/markdown/inline-file.ts +57 -25
  361. package/src/shared/lib/markdown/marked.ts +5 -1
  362. package/src/shared/lib/settings/defaults.ts +2 -0
  363. package/src/shared/lib/theme/border-style.ts +1 -1
  364. package/src/shared/lib/workspace/active-project.test.ts +17 -1
  365. package/src/shared/lib/workspace/active-project.ts +9 -0
  366. package/src/shared/lib/workspace/project-settings-delete.test.ts +97 -0
  367. package/src/shared/lib/workspace/project-settings.test.ts +2 -34
  368. package/src/shared/lib/workspace/project-settings.ts +6 -0
  369. package/src/shared/lib/workspace/session-list-limit.test.ts +31 -0
  370. package/src/shared/lib/workspace/session-list-limit.ts +32 -0
  371. package/src/shared/lib/workspace/sidebar-sort.test.ts +21 -0
  372. package/src/shared/lib/workspace/workspace-panel-widths.ts +1 -1
  373. package/src/shared/lib/workspace/workspace-session.test.ts +34 -0
  374. package/src/shared/lib/workspace/workspace-session.ts +40 -0
  375. package/src/shared/types/settings/state.ts +10 -0
  376. package/dist/client/static/js/ImageView-sz4fzz9k.js +0 -1
  377. package/dist/client/static/js/LayoutWrapper-q6q4h04a.js +0 -2
  378. package/dist/client/static/js/MergeDiffView-b8f013ws.js +0 -1
  379. package/dist/client/static/js/Modal-ahecatp5.js +0 -60
  380. package/dist/client/static/js/SessionsView-jwp8xvw5.js +0 -1
  381. package/dist/client/static/js/architecture-7GRP2DOG-dc7zys46.js +0 -1
  382. package/dist/client/static/js/bash-n5d0esqg.js +0 -1
  383. package/dist/client/static/js/c-pk766wx0.js +0 -1
  384. package/dist/client/static/js/cpp-3pt91jvm.js +0 -1
  385. package/dist/client/static/js/css-9gak6bze.js +0 -1
  386. package/dist/client/static/js/css-sp1cgdbr.js +0 -1
  387. package/dist/client/static/js/cynefin-OW5HDTMX-9fx59e89.js +0 -1
  388. package/dist/client/static/js/eventmodeling-NTZA5JFV-61d2ee91.js +0 -1
  389. package/dist/client/static/js/flowDiagram-KWPJA3E3-104ywb7w.js +0 -1
  390. package/dist/client/static/js/gitGraph-4MIJSDKK-zkb30q0t.js +0 -1
  391. package/dist/client/static/js/graphql-2ntm7jyh.js +0 -1
  392. package/dist/client/static/js/html-mt2yb43b.js +0 -1
  393. package/dist/client/static/js/index-6h46r2de.js +0 -1
  394. package/dist/client/static/js/index-f44k9k8d.css +0 -1
  395. package/dist/client/static/js/index-k1576e2m.js +0 -2
  396. package/dist/client/static/js/index-k4qshngy.js +0 -4
  397. package/dist/client/static/js/index-rr79n77k.js +0 -470
  398. package/dist/client/static/js/index-vf01q99d.js +0 -2
  399. package/dist/client/static/js/index-x7h04xzf.js +0 -2
  400. package/dist/client/static/js/index-xygk0v3e.js +0 -2
  401. package/dist/client/static/js/info-A6RAGUB7-xxvyt8p8.js +0 -1
  402. package/dist/client/static/js/ini-bdk46a3d.js +0 -1
  403. package/dist/client/static/js/java-3g3925cf.js +0 -1
  404. package/dist/client/static/js/javascript-0mqgcvps.js +0 -1
  405. package/dist/client/static/js/json-hdyzmffz.js +0 -1
  406. package/dist/client/static/js/jsx-y8r9mrdq.js +0 -1
  407. package/dist/client/static/js/lua-wf5k6p3r.js +0 -1
  408. package/dist/client/static/js/markdown-9bf16dx7.js +0 -1
  409. package/dist/client/static/js/mermaid.core-bs542jma.js +0 -12
  410. package/dist/client/static/js/one-dark-pro-541ed4b7.js +0 -1
  411. package/dist/client/static/js/one-light-nr79mykt.js +0 -1
  412. package/dist/client/static/js/packet-AYTQ26CC-cm8jeesg.js +0 -1
  413. package/dist/client/static/js/pie-WAS4IAKB-8b9xgcxv.js +0 -1
  414. package/dist/client/static/js/properties-xk4dn00p.js +0 -1
  415. package/dist/client/static/js/python-7sgz05n4.js +0 -1
  416. package/dist/client/static/js/r-w4qxm0pv.js +0 -1
  417. package/dist/client/static/js/radar-RG4KPBEZ-fxr2x2mf.js +0 -1
  418. package/dist/client/static/js/railroad-74A4TZTK-5qd45xk1.js +0 -1
  419. package/dist/client/static/js/railroad-abnf-HS5TGJTU-6fa00vpk.js +0 -1
  420. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-pcbtg7tj.js +0 -1
  421. package/dist/client/static/js/railroad-peg-WCYAUIDC-r0fdhdtp.js +0 -1
  422. package/dist/client/static/js/sql-sd00wgem.js +0 -1
  423. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-zx36y2c8.js +0 -8
  424. package/dist/client/static/js/treeView-Q6P3EWNA-9sn2h4ea.js +0 -1
  425. package/dist/client/static/js/treemap-WGGIJYW6-9fzms0pq.js +0 -1
  426. package/dist/client/static/js/tsx-h5yzg80q.js +0 -1
  427. package/dist/client/static/js/typescript-qy1sbhea.js +0 -1
  428. package/dist/client/static/js/wardley-WFR3VGLG-vy6rp5gp.js +0 -1
  429. package/dist/client/static/js/xml-mrk4xakv.js +0 -1
  430. package/dist/client/static/js/yaml-xaza6dra.js +0 -1
  431. package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +0 -67
@@ -1,10 +1,10 @@
1
- import{n,o,i,u,a,ze,e,ao,I,S,T,tt,cr,wl,_i,Si,$h,Gh,jh,Oo,Hh,qh,gt,Ld,Jh,Zh,Lt,Pa,qd,Ol,Zd,ug}from"./index-rr79n77k.js";import{ke,Nn,Hl,Ir,x,P,ln,Qn,D,ye,_}from"./index-jnxmvxb8.js";function We(t){let r=t.split("/").pop()??"",s=r.lastIndexOf(".");return s>0&&s<r.length-1?r.slice(s).toLowerCase():""}function QA(t){let r=Lt("fileOpener"),s=Lt("sourceCodeRenderer"),l=Pa(),c=t.extension??We(t.path),d=r.find((h)=>h.registration.matches({path:t.path,extension:c}));if(d)return{kind:"opener",pluginId:d.pluginId,Component:d.registration.component,props:{...l,path:t.path,extension:c}};let f=s.find((h)=>h.registration.extensions.includes(c));if(f)return{kind:"source",pluginId:f.pluginId,Component:f.registration.component,props:{...l,path:t.path,content:t.content,language:t.language}};return null}function RA(t){let r=Lt("diffRenderer"),s=Pa(),l=We(t.path),c=r.find((d)=>{let f=d.registration.extensions;return f===void 0||f.includes(l)});if(!c)return null;return{pluginId:c.pluginId,Component:c.registration.component,props:{...s,path:t.path,diff:t.diff}}}function LA({view:t}){if(t.kind==="opener"){let s=t.Component;return e(tt,{pluginId:t.pluginId,children:e(s,{...t.props})})}let r=t.Component;return e(tt,{pluginId:t.pluginId,children:e(r,{...t.props})})}var Tt={docx:!0},Ct={xls:!0,xlsx:!0,xlsm:!0},Dt={csv:!0,tsv:!0},It={md:!0,markdown:!0,mdx:!0},Ot={html:!0,htm:!0},Pt={drawio:!0,dio:!0},Ms={image:!0,pdf:!0,docx:!0,spreadsheet:!0,code:void 0,markdown:void 0,html:void 0,svg:void 0,csv:void 0,drawio:void 0},Eu={markdown:!0,html:!0,svg:!0,csv:!0,drawio:!0,code:void 0,image:void 0,pdf:void 0,docx:void 0,spreadsheet:void 0},Nt={markdown:!0,svg:!0,csv:!0,drawio:!0,html:void 0,code:void 0,image:void 0,pdf:void 0,docx:void 0,spreadsheet:void 0};function Bu(t){return Nt[t]===!0}var ti={code:"Text",markdown:"Markdown",html:"HTML",svg:"SVG",csv:"CSV",image:"Image",pdf:"PDF",docx:"Document",spreadsheet:"Spreadsheet",drawio:"Diagram"};function Fs(t){let r=_i(t);if(!r)return"code";if(r==="svg")return"svg";if(Pt[r])return"drawio";if(It[r])return"markdown";if(Ot[r])return"html";if(Si(t))return"image";if(r==="pdf")return"pdf";if(Tt[r])return"docx";if(Ct[r])return"spreadsheet";if(Dt[r])return"csv";return"code"}var Wt={id:"",url:null,loadBytes:null,mimeType:null};async function Le(t){let r=await t.json().catch(()=>null);return typeof r?.error==="string"&&r.error?r.error:`Could not read the file (HTTP ${t.status}).`}function Ae(t){let r=$h(t.path);if(t.rawUrl){let c=t.rawUrl;return{id:c,url:c,mimeType:r,loadBytes:async()=>{let d=await fetch(c);if(!d.ok)throw Error(await Le(d));return d.arrayBuffer()}}}let s=ug(t.handleId);if(s){let{bytes:c}=s;return{id:t.handleId,url:null,mimeType:s.mimeType??r,loadBytes:async()=>c.slice().buffer}}let l=Ol(t.handleId);if(l)return{id:t.handleId,url:null,mimeType:r,loadBytes:async()=>(await l.getFile()).arrayBuffer()};return Wt}function Be(t,r){let s=t?Fs(t.path??""):"code",l=Ms[s]===!0,c=Boolean(t?.path)&&!t?.handleId,d=c&&t?.content===void 0&&Si(t?.path)?t.path:null,f=d!==null,h=t&&!f&&l&&c&&t.content===void 0?wl({path:t.path,root:t.root,repo:t.repo}):null,p=Ae({path:t?.path,handleId:t?.handleId,rawUrl:d?`${wl({path:d,root:t?.root,repo:t?.repo})}&v=${r}`:h});return{viewerKind:s,isBinaryViewer:l,isImage:f,imageUrl:f?p.url:null,byteSource:p}}function Ke(t){let r=t.indexOf(`
1
+ import{n,o,i,u,a,He,e,io,B,S,T,ot,ur,Dl,Ni,Qi,Zh,t0,n0,Uo,r0,a0,yt,zd,c0,u0,Pt,za,Xd,Wl,op,bg}from"./index-eggbcdwx.js";import{ke,Dn,Xl,Sr,x,P,ln,Nn,N,ye,_}from"./index-q3k8r0ms.js";function We(t){let r=t.split("/").pop()??"",s=r.lastIndexOf(".");return s>0&&s<r.length-1?r.slice(s).toLowerCase():""}function GA(t){let r=Pt("fileOpener"),s=Pt("sourceCodeRenderer"),l=za(),c=t.extension??We(t.path),d=r.find((h)=>h.registration.matches({path:t.path,extension:c}));if(d)return{kind:"opener",pluginId:d.pluginId,Component:d.registration.component,props:{...l,path:t.path,extension:c}};let f=s.find((h)=>h.registration.extensions.includes(c));if(f)return{kind:"source",pluginId:f.pluginId,Component:f.registration.component,props:{...l,path:t.path,content:t.content,language:t.language}};return null}function jA(t){let r=Pt("diffRenderer"),s=za(),l=We(t.path),c=r.find((d)=>{let f=d.registration.extensions;return f===void 0||f.includes(l)});if(!c)return null;return{pluginId:c.pluginId,Component:c.registration.component,props:{...s,path:t.path,diff:t.diff}}}function HA({view:t}){if(t.kind==="opener"){let s=t.Component;return e(ot,{pluginId:t.pluginId,children:e(s,{...t.props})})}let r=t.Component;return e(ot,{pluginId:t.pluginId,children:e(r,{...t.props})})}var Tt={docx:!0},Ct={xls:!0,xlsx:!0,xlsm:!0},Lt={csv:!0,tsv:!0},Dt={md:!0,markdown:!0,mdx:!0},It={html:!0,htm:!0},Ot={drawio:!0,dio:!0},zs={image:!0,pdf:!0,docx:!0,spreadsheet:!0,code:void 0,markdown:void 0,html:void 0,svg:void 0,csv:void 0,drawio:void 0},Du={markdown:!0,html:!0,svg:!0,csv:!0,drawio:!0,code:void 0,image:void 0,pdf:void 0,docx:void 0,spreadsheet:void 0},Nt={markdown:!0,svg:!0,csv:!0,drawio:!0,html:void 0,code:void 0,image:void 0,pdf:void 0,docx:void 0,spreadsheet:void 0};function Nu(t){return Nt[t]===!0}var oi={code:"Text",markdown:"Markdown",html:"HTML",svg:"SVG",csv:"CSV",image:"Image",pdf:"PDF",docx:"Document",spreadsheet:"Spreadsheet",drawio:"Diagram"};function Us(t){let r=Ni(t);if(!r)return"code";if(r==="svg")return"svg";if(Ot[r])return"drawio";if(Dt[r])return"markdown";if(It[r])return"html";if(Qi(t))return"image";if(r==="pdf")return"pdf";if(Tt[r])return"docx";if(Ct[r])return"spreadsheet";if(Lt[r])return"csv";return"code"}var Wt={id:"",url:null,loadBytes:null,mimeType:null};async function Le(t){let r=await t.json().catch(()=>null);return typeof r?.error==="string"&&r.error?r.error:`Could not read the file (HTTP ${t.status}).`}function Ae(t){let r=Zh(t.path);if(t.rawUrl){let c=t.rawUrl;return{id:c,url:c,mimeType:r,loadBytes:async()=>{let d=await fetch(c);if(!d.ok)throw Error(await Le(d));return d.arrayBuffer()}}}let s=bg(t.handleId);if(s){let{bytes:c}=s;return{id:t.handleId,url:null,mimeType:s.mimeType??r,loadBytes:async()=>c.slice().buffer}}let l=Wl(t.handleId);if(l)return{id:t.handleId,url:null,mimeType:r,loadBytes:async()=>(await l.getFile()).arrayBuffer()};return Wt}function Be(t,r){let s=t?Us(t.path??""):"code",l=zs[s]===!0,c=Boolean(t?.path)&&!t?.handleId,d=c&&t?.content===void 0&&Qi(t?.path)?t.path:null,f=d!==null,h=t&&!f&&l&&c&&t.content===void 0?Dl({path:t.path,root:t.root,repo:t.repo}):null,p=Ae({path:t?.path,handleId:t?.handleId,rawUrl:d?`${Dl({path:d,root:t?.root,repo:t?.repo})}&v=${r}`:h});return{viewerKind:s,isBinaryViewer:l,isImage:f,imageUrl:f?p.url:null,byteSource:p}}function Ke(t){let r=t.indexOf(`
2
2
  `);return r>0&&t[r-1]==="\r"?"crlf":"lf"}function me(t){return t.includes("\r")?t.replace(/\r\n?/g,`
3
3
  `):t}function Ue(t,r){let s=me(t);return r==="crlf"?s.replace(/\n/g,`\r
4
- `):s}function qe(t){return String(t.id??t.path??t.name)}function Ve({target:t,key:r,isBinaryViewer:s,revision:l,loadedRef:c,contentsRef:d,baselinesRef:f,pendingRef:h,readingRef:p,remember:g}){let[v,k]=n(!1),[w,m]=n(!1),[R,y]=n(null),[E,F]=n(null);return o(()=>{if(m(!1),!t)return;let b=qe(t);if(c.current.has(b))return;if(c.current.add(b),s){y(null),F(null),k(!1);return}if(t.content!==void 0){g(b,t.content,null,null),y(null),F(null);return}if(!t.path){y("No file path supplied for this attachment."),F(null);return}let W=d.current[b]===void 0,U=!1;if(W)k(!0);y(null),F(null);let N=new URLSearchParams({path:t.path});if(t.root)N.set("root",t.root);if(t.repo&&t.repo!==".")N.set("repo",t.repo);return p.current+=1,m(!0),fetch(`/api/fs/read?${N.toString()}`).then(async(B)=>{let O=await B.json().catch(()=>null);if(!B.ok||!O||typeof O.content!=="string"){let C=Error(O?.error||`HTTP ${B.status}`);if(O?.kind)C.kind=O.kind;else if(B.status===415)C.kind="binary";throw C}return{text:O.content,mtimeMs:typeof O.mtimeMs==="number"?O.mtimeMs:null,hash:typeof O.hash==="string"?O.hash:null}}).then(({text:B,mtimeMs:O,hash:C})=>{if(U)return;let A=d.current[b];if(A!==void 0&&A!==f.current[b])return;let X=h.current;if(X&&qe(X.file)===b)return;g(b,B,O,C)}).catch((B)=>{if(U)return;if(!W)return;g(b,"",null,null);let O=B instanceof Error?B.message:"Failed to read file",C=B?.kind;F(C?O:null),y(O)}).finally(()=>{if(p.current-=1,!U)k(!1),m(!1)}),()=>{U=!0}},[r,t,g,l,s,c,d,f,h,p]),{isLoading:v,isReading:w&&!v,loadError:R,unsupported:E}}async function _e(t,r){let s=await fetch(t);if(!s.ok)throw Error(`HTTP ${s.status}`);qd(await s.blob(),r)}async function $e(t){let r=await fetch(t);if(!r.ok)throw Error(`HTTP ${r.status}`);let s=await r.blob();if(typeof ClipboardItem>"u"||!navigator.clipboard?.write)throw Error("Image clipboard unavailable");await navigator.clipboard.write([new ClipboardItem({[s.type]:s})])}function He({target:t,content:r,downloadContent:s,imageUrl:l,downloadMimeType:c,byteSource:d,byteViewer:f=!1}){let[h,p]=n(!1),g=a(()=>{p(!0),window.setTimeout(()=>p(!1),1500)},[]),v=a(()=>{if(!t)return;if(l){$e(l).then(g).catch(()=>{});return}if(f)return;if(!navigator.clipboard)return;navigator.clipboard.writeText(r).then(g).catch(()=>{})},[t,r,l,f,g]),k=a(()=>{if(!t)return;if(l){_e(l,t.name).catch(()=>{});return}if(f){let w=d?.loadBytes;if(!w)return;let m=d?.mimeType;w().then((R)=>qd(m?new Blob([R],{type:m}):new Blob([R]),t.name)).catch(()=>{});return}qd(new Blob([s],{type:c}),t.name)},[t,s,c,l,f,d]);return{copied:h,copy:v,download:k}}async function je(t){let r=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(t));return Array.from(new Uint8Array(r),(s)=>s.toString(16).padStart(2,"0")).join("")}async function Xe(t,r,s,l){if(t.handleId){let d=s==="crlf"?r.replace(/\n/g,`\r
5
- `):r,f=await Zd(t.handleId,d,{interactive:l.interactive});if(f==="written")return{status:"written",written:{mtimeMs:null,hash:await je(d)}};if(f==="needs-permission")return{status:"needs-permission"};return{status:"failed"}}if(!t.path)return{status:"failed"};let c=new FormData;if(c.append("actionType","save"),c.append("path",t.path),c.append("content",r),c.append("eol",s),t.root)c.append("root",t.root);if(t.repo&&t.repo!==".")c.append("repo",t.repo);if(typeof l.baseMtimeMs==="number")c.append("baseMtime",String(l.baseMtimeMs));try{let d=await fetch("/api/fs/action",{method:"POST",body:c}),f=await d.json().catch(()=>null);if(d.status===409)return{status:"conflict",diskMtimeMs:typeof f?.mtimeMs==="number"?f.mtimeMs:null};if(d.ok&&f?.success)return{status:"written",written:{mtimeMs:typeof f.mtimeMs==="number"?f.mtimeMs:null,hash:typeof f.hash==="string"?f.hash:null}};return{status:"failed"}}catch{return{status:"failed"}}}function le(t,r){let s={},l=!1;for(let[c,d]of Object.entries(t))if(r.has(c))s[c]=d;else l=!0;return l?s:t}function xe(t){return String(t.id??t.path??t.name)}function Ge({target:t,isBinaryViewer:r,loadError:s,missing:l,contentsRef:c,lineEndingsRef:d,mtimesRef:f,pendingRef:h,flushOnUnmount:p,onSaveStart:g,onSaved:v,onSaveFailed:k,onNeedsPermission:w,onConflict:m}){let[R,y]=n(!1),E=i(l);E.current=l;let F=t?xe(t):"",b=a(async(C,A,X={})=>{if(!C.path&&!C.handleId)return;if(C.handleId&&!Ol(C.handleId))return;if(E.current&&!X.allowMissing)return;g();let q=xe(C),z=X.allowMissing?null:f.current[q]??null,j=await Xe(C,A,d.current[q]??"lf",{interactive:X.interactive===!0,baseMtimeMs:z});if(j.status==="written")v(q,A,j.written);else if(j.status==="needs-permission")w();else if(j.status==="conflict")m(q,j.diskMtimeMs);else k()},[d,f,m,w,k,g,v]),W=i(b);W.current=b;let U=a((C)=>{if(!t||r)return;if(!t.path)return;if(E.current)return;if(h.current)window.clearTimeout(h.current.timer);let A=window.setTimeout(()=>{h.current=null,W.current(t,C)},800);h.current={timer:A,file:t,content:C}},[t,r,h]),N=a(()=>{if(!t||r)return;if(s)return;if(t.handleId&&!Ol(t.handleId))return;let C=c.current[xe(t)];if(C===void 0)return;if(h.current)window.clearTimeout(h.current.timer),h.current=null;if(E.current){y(!0);return}W.current(t,C,{interactive:!0})},[t,c,r,s,h]),B=a(()=>{if(y(!1),!t||r||s)return;let C=c.current[xe(t)];if(C===void 0)return;W.current(t,C,{allowMissing:!0,interactive:!0})},[t,c,r,s]),O=a(()=>y(!1),[]);return o(()=>{if(!p)return;return()=>{let C=h.current;if(!C)return;if(window.clearTimeout(C.timer),h.current=null,E.current)return;W.current(C.file,C.content)}},[p,h]),o(()=>{if(!l)y(!1)},[l,F]),{onChange:U,saveNow:N,saveMissingConfirm:R,confirmSaveMissing:B,cancelSaveMissing:O}}function Qe({key:t,saveNow:r,mtimesRef:s,setMtimes:l,contentsRef:c,setContents:d,setBaselines:f,loadedRef:h,bumpRevision:p}){let[g,v]=n({}),k=a((F)=>{v((b)=>{if(b[F]===void 0)return b;let W={...b};return delete W[F],W})},[]),w=a((F,b)=>{v((W)=>({...W,[F]:{diskMtimeMs:b}}))},[]),m=a((F,b)=>{s.current={...s.current,[F]:b},l(s.current)},[s,l]),R=a((F)=>{if(!t)return;m(t,F),k(t)},[t,m,k]),y=a(()=>{if(!t)return;k(t),f((F)=>{let b={...F};return delete b[t],b}),d((F)=>{let b={...F};return delete b[t],b}),h.current.delete(t),p()},[t,k,f,d,h,p]),E=a(()=>{if(!t)return;let F=c.current[t],b=g[t]?.diskMtimeMs??null;if(k(t),F===void 0)return;if(b!==null)m(t,b);r()},[t,g,k,m,c,r]);return{conflict:g[t]??null,report:w,reload:y,keepMine:E,adopt:R,clear:k}}var At=3000;async function Bt(t,r,s){let l=new URLSearchParams({path:t});if(r)l.set("root",r);if(s&&s!==".")l.set("repo",s);try{let c=await fetch(`/api/fs/digest?${l.toString()}`),d=await c.json().catch(()=>null);if(!c.ok||!d||typeof d.exists!=="boolean")return"unknown";if(d.exists===!1)return"gone";if(typeof d.hash!=="string"||typeof d.mtimeMs!=="number")return"unknown";return{hash:d.hash,mtimeMs:d.mtimeMs}}catch{return"unknown"}}function Ye({path:t,root:r=null,repo:s=null,baseHash:l,revision:c,onUnchanged:d,onChanged:f}){let h=i(d);h.current=d;let p=i(f);p.current=f,o(()=>{if(!t||l===null)return;let g=!1,v=!1,k=null,w=async()=>{if(g||v||document.hidden)return;v=!0;try{let E=await Bt(t,r,s);if(g||E==="unknown"||E==="gone")return;if(E.hash===l){h.current(E.mtimeMs);return}if(k===E.hash)return;k=E.hash,p.current(E)}finally{v=!1}},m=window.setInterval(()=>void w(),At);w();let R=()=>void w(),y=()=>{if(!document.hidden)w()};return window.addEventListener("focus",R),document.addEventListener("visibilitychange",y),()=>{g=!0,window.clearInterval(m),window.removeEventListener("focus",R),document.removeEventListener("visibilitychange",y)}},[t,r,s,l,c])}function G(t){return String(t.id??t.path??t.name)}function Ul(t){if(!t.path)return!1;if(t.content!==void 0)return!1;if(t.handleId||t.deviceFile)return!1;return!t.isDiff}function De(t){return`${t.root??""}\x00${t.repo??"."}\x00${t.path??""}`}async function Kt(t){let r=new URLSearchParams({path:t.path??""});if(t.root)r.set("root",t.root);if(t.repo&&t.repo!==".")r.set("repo",t.repo);try{let s=await fetch(`/api/fs/exists?${r.toString()}`),l=await s.json().catch(()=>null);if(!s.ok||!l||typeof l.exists!=="boolean")return!0;return l.exists}catch{return!0}}function Iu(t,r){let[s,l]=n(()=>new Set),[c,d]=n(0),f=t.map((g)=>`${g.id}\x01${De(g)}`).join(`
6
- `),h=i(t);h.current=t;let p=i(new Set);return o(()=>{let g=!1;return(async()=>{let v=new Map;for(let y of h.current)if(Ul(y))v.set(De(y),y);let k=await Promise.all([...v.entries()].map(async([y,E])=>({key:y,exists:await Kt(E)})));if(g)return;let w=new Set;for(let{key:y,exists:E}of k)if(!E)w.add(y);let m=new Set;for(let y of h.current)if(Ul(y)&&w.has(De(y)))m.add(y.id);let R=p.current;if(R.size===m.size&&[...m].every((y)=>R.has(y)))return;p.current=m,l(m)})(),()=>{g=!0}},[f,r,c]),o(()=>{let g=()=>d((v)=>v+1);return window.addEventListener("focus",g),document.addEventListener("visibilitychange",g),()=>{window.removeEventListener("focus",g),document.removeEventListener("visibilitychange",g)}},[]),s}function Je({key:t,target:r,baseHash:s,revision:l,hashesRef:c,mtimesRef:d,contentsRef:f,baselinesRef:h,pendingRef:p,readingRef:g,loadedRef:v,bumpRevision:k,adoptDiskMtime:w,clearConflict:m,reloadDiscardingEdits:R,discardPendingWrite:y}){let[E,F]=n(null),b=i(null);o(()=>{F(null),b.current=null},[t]);let W=a((O)=>{if(!t)return;if(d.current[t]!==O)w(O);F(null),b.current=null},[t,d,w]),U=a((O)=>{if(!t)return;if(c.current[t]===O.hash){F(null);return}if(b.current===O.hash)return;if(E?.hash===O.hash)return;let C=f.current[t],A=p.current;if(C!==void 0&&C!==h.current[t]||A!==null&&G(A.file)===t){F(O);return}if(g.current>0)return;v.current.delete(t),k()},[t,c,f,h,p,g,v,k,E]);Ye({path:r&&Ul({...r,id:t})?r.path??null:null,root:r?.root??null,repo:r?.repo??null,baseHash:s,revision:l,onUnchanged:W,onChanged:U});let N=a(()=>{if(!r)return;let O=G(r),C=f.current[O];if(C!==void 0&&C!==h.current[O]){y(O),R();return}m(O),v.current.delete(O),k()},[r,f,h,y,R,m,v,k]),B=a(()=>{if(!E)return;b.current=E.hash,w(E.mtimeMs),F(null)},[E,w]);return{diskChange:E,reloadFromDisk:N,keepMineAgainstDisk:B}}function Ze({target:t,loadedRef:r,bumpRevision:s,setContents:l,setBaselines:c,setLineEndings:d,setMtimes:f,setHashes:h}){let p=a((w,m,R,y)=>{let E=Ke(m),F=me(m);l((b)=>({...b,[w]:F})),c((b)=>({...b,[w]:F})),d((b)=>({...b,[w]:E})),f((b)=>({...b,[w]:R})),h((b)=>({...b,[w]:y}))},[l,c,d,f,h]),g=a(()=>{r.current.clear(),s()},[r,s]),v=a((w)=>{let m=new Set(w.map(String));for(let R of Array.from(r.current))if(!m.has(R))r.current.delete(R);l((R)=>le(R,m)),c((R)=>le(R,m)),d((R)=>le(R,m)),f((R)=>le(R,m)),h((R)=>le(R,m))},[r,l,d,f,h]),k=a((w)=>{if(!t)return;d((m)=>({...m,[G(t)]:w}))},[t,d]);return{remember:p,reset:g,retain:v,setEol:k}}function et({target:t,key:r,textDirty:s,contents:l,baselines:c,retain:d}){let[f,h]=n(()=>new Set),p=s||f.has(r),g=u(()=>{let w=new Set(f);for(let[m,R]of Object.entries(l)){let y=c[m];if(y!==void 0&&R!==y)w.add(m)}return w},[l,c,f]),v=a((w)=>{if(!t)return;let m=G(t);h((R)=>{if(R.has(m)===w)return R;let y=new Set(R);if(w)y.add(m);else y.delete(m);return y})},[t]),k=a((w)=>{d(w);let m=new Set(w.map(String));h((R)=>{let y=!1,E=new Set;for(let F of R)if(m.has(F))E.add(F);else y=!0;return y?E:R})},[d]);return{isDirty:p,dirtyKeys:g,setBinaryDirty:v,retain:k}}function _u(t,r={}){let{flushOnUnmount:s=!1,reportSaveError:l=!1,downloadMimeType:c="text/plain",onFileSaved:d,missing:f=!1}=r,[h,p]=n({}),[g,v]=n({}),[k,w]=n({}),[m,R]=n({}),[y,E]=n({}),[F,b]=n("idle"),[W,U]=n(0),N=t?G(t):"",B=t?h[N]??(t.content!==void 0?me(t.content):""):"",O=B!==(g[N]??B),{viewerKind:C,isBinaryViewer:A,isImage:X,imageUrl:q,byteSource:z}=Be(t,W),j=i(new Set),Q=i(null),ie=i(0),K=i(h);K.current=h;let de=i(g);de.current=g;let J=i(k);J.current=k;let Z=i(m);Z.current=m;let ve=i(y);ve.current=y;let{remember:Me,reset:oe,retain:ne,setEol:Fe}=Ze({target:t,loadedRef:j,bumpRevision:()=>U((H)=>H+1),setContents:p,setBaselines:v,setLineEndings:w,setMtimes:R,setHashes:E}),{isDirty:Ee,dirtyKeys:fe,setBinaryDirty:he,retain:Te}=et({target:t,key:N,textDirty:O,contents:h,baselines:g,retain:ne}),{isLoading:M,isReading:L,loadError:V,unsupported:ee}=Ve({target:t,key:N,isBinaryViewer:A,revision:W,loadedRef:j,contentsRef:K,baselinesRef:de,pendingRef:Q,readingRef:ie,remember:Me}),te=Ge({target:t,isBinaryViewer:A,loadError:V,missing:f,contentsRef:K,lineEndingsRef:J,mtimesRef:Z,pendingRef:Q,flushOnUnmount:s,onSaveStart:()=>b("saving"),onSaved:(H,Y,se)=>{if(b("saved"),v((pe)=>({...pe,[H]:Y})),se.mtimeMs!==null)R((pe)=>({...pe,[H]:se.mtimeMs}));if(se.hash!==null)E((pe)=>({...pe,[H]:se.hash}));d?.()},onSaveFailed:()=>b(l?"error":"idle"),onNeedsPermission:()=>b("needs-permission"),onConflict:(H,Y)=>{b("idle"),re.report(H,Y)}}),Ce=i(te);Ce.current=te;let re=Qe({key:N,saveNow:()=>Ce.current.saveNow(),mtimesRef:Z,setMtimes:R,contentsRef:K,setContents:p,setBaselines:v,loadedRef:j,bumpRevision:()=>U((H)=>H+1)}),Ne=a((H)=>{let Y=Q.current;if(!Y||G(Y.file)!==H)return;window.clearTimeout(Y.timer),Q.current=null},[]),{diskChange:St,reloadFromDisk:wt,keepMineAgainstDisk:Rt}=Je({key:N,target:t,baseHash:y[N]??null,revision:W,hashesRef:ve,mtimesRef:Z,contentsRef:K,baselinesRef:de,pendingRef:Q,readingRef:ie,loadedRef:j,bumpRevision:()=>U((H)=>H+1),adoptDiskMtime:re.adopt,clearConflict:re.clear,reloadDiscardingEdits:re.reload,discardPendingWrite:Ne});o(()=>{if(F!=="saved")return;let H=window.setTimeout(()=>b("idle"),1500);return()=>window.clearTimeout(H)},[F]),o(()=>{b("idle")},[N]);let Mt=a((H)=>{if(!t||A)return;let Y=G(t);p((se)=>({...se,[Y]:H})),Ce.current.onChange(H)},[t,A]),{copied:kt,copy:Ft,download:Et}=He({target:t,content:B,downloadContent:t?Ue(B,k[N]??"lf"):B,imageUrl:q,downloadMimeType:c,byteSource:z,byteViewer:A});return{content:B,onChange:Mt,isLoading:M,isReading:L,loaded:t?A||t.content!==void 0||h[N]!==void 0:!1,loadError:V,unsupported:ee,saveStatus:F,copied:kt,isDirty:Ee,setBinaryDirty:he,eol:k[N]??"lf",setEol:Fe,baseMtimeMs:m[N]??null,dirtyKeys:fe,language:t?gt(t.name):"javascript",isImage:X,imageUrl:q,viewerKind:C,byteSource:z,isBinaryViewer:A,revision:W,handleMissing:Boolean(t?.handleId)&&!t?.deviceFile&&Ol(t?.handleId)===null,deviceBacked:Boolean(t?.deviceFile),deviceMissing:Boolean(t?.deviceFile)&&ug(t?.handleId)===null,saveNow:te.saveNow,copy:Ft,download:Et,reset:oe,retain:Te,saveMissingConfirm:te.saveMissingConfirm,confirmSaveMissing:te.confirmSaveMissing,cancelSaveMissing:te.cancelSaveMissing,conflict:re.conflict,resolveConflictByReload:()=>{if(N)Ne(N);re.reload()},resolveConflictByKeepingMine:re.keepMine,reloadFromDisk:wt,diskChange:St,keepMineAgainstDisk:Rt}}var Ut=20;function nt(){let[t,r]=T("editor.findHistory",[]),s=a((l)=>{let c=l.trim();if(!c)return;r((d)=>[c,...d.filter((f)=>f!==c)].slice(0,Ut))},[r]);return{entries:t,remember:s}}function rt(){let[t,r]=n(null),s=a((c)=>{let d=c();if(!d||d.start===d.end)return r(null),!1;return r(d),!0},[]),l=a(()=>r(null),[]);return{range:t,arm:s,disarm:l}}var it=typeof String.prototype.normalize=="function"?(t)=>t.normalize("NFKD"):(t)=>t;class ce{constructor(t,r,s=0,l=t.length,c,d){this.test=d,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(s,l),this.bufferStart=s,this.normalize=c?(f)=>c(it(f)):it,this.query=this.normalize(r)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Nn(this.buffer,this.bufferPos)}next(){while(this.matches.length)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let r=Hl(t),s=this.bufferStart+this.bufferPos;this.bufferPos+=Ir(t);let l=this.normalize(r);if(l.length)for(let c=0,d=s,f=!0;;c++){let h=l.charCodeAt(c),p=this.match(h,d,f,this.bufferPos+this.bufferStart,c==l.length-1);if(p)return this.value=p,this;if(c==l.length-1)break;if(f&&c<r.length&&r.charCodeAt(c)==h)d++;else f=!1}}}match(t,r,s,l,c){let d=null;for(let f=0;f<this.matches.length;){let h=this.matches[f],p=!1;if(this.query.charCodeAt(h.index)==t)if(h.index==this.query.length-1)d={from:h.from,to:l,precise:c&&h.precise};else h.index++,p=!0;if(p)f++;else this.matches.splice(f,1)}if(this.query.charCodeAt(0)==t)if(this.query.length==1)d={from:r,to:l,precise:s&&c};else this.matches.push({from:r,index:1,precise:s});if(d&&this.test&&!this.test(d.from,d.to,this.buffer,this.bufferStart))d=null;return d}}if(typeof Symbol<"u")ce.prototype[Symbol.iterator]=function(){return this};var st={from:-1,to:-1,match:/.*/.exec(""),precise:!0},lt="gm"+(/x/.unicode==null?"":"u");class Se{constructor(t,r,s,l=0,c=t.length){if(this.text=t,this.to=c,this.curLine="",this.done=!1,this.value=st,/\\[sWDnr]|\n|\r|\[\^/.test(r))return new Oe(t,r,s,l,c);this.re=new RegExp(r,lt+((s===null||s===void 0?void 0:s.ignoreCase)?"i":"")),this.test=s===null||s===void 0?void 0:s.test,this.iter=t.iter();let d=t.lineAt(l);this.curLineStart=d.from,this.matchPos=be(t,l),this.getLine(this.curLineStart)}getLine(t){if(this.iter.next(t),this.iter.lineBreak)this.curLine="";else{if(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to)this.curLine=this.curLine.slice(0,this.to-this.curLineStart);this.iter.next()}}nextLine(){if(this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to)this.curLine="";else this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let r=this.matchPos<=this.to&&this.re.exec(this.curLine);if(r){let s=this.curLineStart+r.index,l=s+r[0].length;if(this.matchPos=be(this.text,l+(s==l?1:0)),s==this.curLineStart+this.curLine.length)this.nextLine();if((s<l||s>this.value.to)&&(!this.test||this.test(s,l,r)))return this.value={from:s,to:l,precise:!0,match:r},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),t=0;else return this.done=!0,this}}}var Ie=new WeakMap;class ae{constructor(t,r){this.from=t,this.text=r}get to(){return this.from+this.text.length}static get(t,r,s){let l=Ie.get(t);if(!l||l.from>=s||l.to<=r){let f=new ae(r,t.sliceString(r,s));return Ie.set(t,f),f}if(l.from==r&&l.to==s)return l;let{text:c,from:d}=l;if(d>r)c=t.sliceString(r,d)+c,d=r;if(l.to<s)c+=t.sliceString(l.to,s);return Ie.set(t,new ae(d,c)),new ae(r,c.slice(r-d,s-d))}}class Oe{constructor(t,r,s,l,c){this.text=t,this.to=c,this.done=!1,this.value=st,this.matchPos=be(t,l),this.re=new RegExp(r,lt+((s===null||s===void 0?void 0:s.ignoreCase)?"i":"")),this.test=s===null||s===void 0?void 0:s.test,this.flat=ae.get(t,l,this.chunkEnd(l+5000))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,r=this.re.exec(this.flat.text);if(r&&!r[0]&&r.index==t)this.re.lastIndex=t+1,r=this.re.exec(this.flat.text);if(r){let s=this.flat.from+r.index,l=s+r[0].length;if((this.flat.to>=this.to||r.index+r[0].length<=this.flat.text.length-10)&&(!this.test||this.test(s,l,r)))return this.value={from:s,to:l,precise:!0,match:r},this.matchPos=be(this.text,l+(s==l?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=ae.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}if(typeof Symbol<"u")Se.prototype[Symbol.iterator]=Oe.prototype[Symbol.iterator]=function(){return this};function be(t,r){if(r>=t.length)return r;let s=t.lineAt(r),l;while(r<s.to&&(l=s.text.charCodeAt(r-s.from))>=56320&&l<57344)r++;return r}var qt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},at=P.define({combine(t){return Qn(t,qt,{highlightWordAroundCursor:(r,s)=>r||s,minSelectionLength:Math.min,maxMatches:Math.min})}});function MA(t){let r=[jt,Ht];if(t)r.push(at.of(t));return r}var Vt=D.mark({class:"cm-selectionMatch"}),_t=D.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function ot(t,r,s,l){return(s==0||t(r.sliceDoc(s-1,s))!=ln.Word)&&(l==r.doc.length||t(r.sliceDoc(l,l+1))!=ln.Word)}function $t(t,r,s,l){return t(r.sliceDoc(s,s+1))==ln.Word&&t(r.sliceDoc(l-1,l))==ln.Word}var Ht=ye.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){if(t.selectionSet||t.docChanged||t.viewportChanged)this.decorations=this.getDeco(t.view)}getDeco(t){let r=t.state.facet(at),{state:s}=t,l=s.selection;if(l.ranges.length>1)return D.none;let c=l.main,d,f=null;if(c.empty){if(!r.highlightWordAroundCursor)return D.none;let p=s.wordAt(c.head);if(!p)return D.none;f=s.charCategorizer(c.head),d=s.sliceDoc(p.from,p.to)}else{let p=c.to-c.from;if(p<r.minSelectionLength||p>200)return D.none;if(r.wholeWords){if(d=s.sliceDoc(c.from,c.to),f=s.charCategorizer(c.head),!(ot(f,s,c.from,c.to)&&$t(f,s,c.from,c.to)))return D.none}else if(d=s.sliceDoc(c.from,c.to),!d)return D.none}let h=[];for(let p of t.visibleRanges){let g=new ce(s.doc,d,p.from,p.to);while(!g.next().done){let{from:v,to:k}=g.value;if(!f||ot(f,s,v,k)){if(c.empty&&v<=c.from&&k>=c.to)h.push(_t.range(v,k));else if(v>=c.to||k<=c.from)h.push(Vt.range(v,k));if(h.length>r.maxMatches)return D.none}}}return D.set(h)}},{decorations:(t)=>t.decorations}),jt=_.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),zt=({state:t,dispatch:r})=>{let{selection:s}=t,l=x.create(s.ranges.map((c)=>t.wordAt(c.head)||x.cursor(c.head)),s.mainIndex);if(l.eq(s))return!1;return r(t.update({selection:l})),!0};function Xt(t,r){let{main:s,ranges:l}=t.selection,c=t.wordAt(s.head),d=c&&c.from==s.from&&c.to==s.to;for(let f=!1,h=new ce(t.doc,r,l[l.length-1].to);;)if(h.next(),h.done){if(f)return null;h=new ce(t.doc,r,0,Math.max(0,l[l.length-1].from-1)),f=!0}else{if(f&&l.some((p)=>p.from==h.value.from))continue;if(d){let p=t.wordAt(h.value.from);if(!p||p.from!=h.value.from||p.to!=h.value.to)continue}return h.value}}var FA=({state:t,dispatch:r})=>{let{ranges:s}=t.selection;if(s.some((d)=>d.from===d.to))return zt({state:t,dispatch:r});let l=t.sliceDoc(s[0].from,s[0].to);if(t.selection.ranges.some((d)=>t.sliceDoc(d.from,d.to)!=l))return!1;let c=Xt(t,l);if(!c)return!1;return r(t.update({selection:t.selection.addRange(x.range(c.from,c.to),!1),effects:_.scrollIntoView(c.to)})),!0};var PA=({state:t,dispatch:r})=>{let s=t.selection;if(s.ranges.length>1||s.main.empty)return!1;let{from:l,to:c}=s.main,d=[],f=0;for(let h=new ce(t.doc,t.sliceDoc(l,c));!h.next().done;){if(d.length>1000)return!1;if(h.value.from==l)f=d.length;d.push(x.range(h.value.from,h.value.to))}return r(t.update({selection:x.create(d,f),userEvent:"select.search.matches"})),!0};var ct=5000,Pe={matchCase:!1,wholeWord:!1,isRegex:!1,inSelection:!1},ut="gm"+("unicode"in RegExp.prototype?"u":"");function Re(t,r){if(!t)return null;let s=r.isRegex?t:t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l=r.wholeWord?`\\b(?:${s})\\b`:s;try{return new RegExp(l,r.matchCase?ut:`${ut}i`)}catch{return null}}var dt=null,we=null;function Gt(t){if(dt===t&&we)return we;return we=ke.of(t.split(`
4
+ `):s}function qe(t){return String(t.id??t.path??t.name)}function Ve({target:t,key:r,isBinaryViewer:s,revision:l,loadedRef:c,contentsRef:d,baselinesRef:f,pendingRef:h,readingRef:p,remember:g}){let[v,k]=n(!1),[w,m]=n(!1),[R,y]=n(null),[E,F]=n(null);return o(()=>{if(m(!1),!t)return;let b=qe(t);if(c.current.has(b))return;if(c.current.add(b),s){y(null),F(null),k(!1);return}if(t.content!==void 0){g(b,t.content,null,null),y(null),F(null);return}if(!t.path){y("No file path supplied for this attachment."),F(null);return}let O=d.current[b]===void 0,U=!1;if(O)k(!0);y(null),F(null);let I=new URLSearchParams({path:t.path});if(t.root)I.set("root",t.root);if(t.repo&&t.repo!==".")I.set("repo",t.repo);return p.current+=1,m(!0),fetch(`/api/fs/read?${I.toString()}`).then(async(A)=>{let D=await A.json().catch(()=>null);if(!A.ok||!D||typeof D.content!=="string"){let C=Error(D?.error||`HTTP ${A.status}`);if(D?.kind)C.kind=D.kind;else if(A.status===415)C.kind="binary";throw C}return{text:D.content,mtimeMs:typeof D.mtimeMs==="number"?D.mtimeMs:null,hash:typeof D.hash==="string"?D.hash:null}}).then(({text:A,mtimeMs:D,hash:C})=>{if(U)return;let W=d.current[b];if(W!==void 0&&W!==f.current[b])return;let X=h.current;if(X&&qe(X.file)===b)return;g(b,A,D,C)}).catch((A)=>{if(U)return;if(!O)return;g(b,"",null,null);let D=A instanceof Error?A.message:"Failed to read file",C=A?.kind;F(C?D:null),y(D)}).finally(()=>{if(p.current-=1,!U)k(!1),m(!1)}),()=>{U=!0}},[r,t,g,l,s,c,d,f,h,p]),{isLoading:v,isReading:w&&!v,loadError:R,unsupported:E}}async function _e(t,r){let s=await fetch(t);if(!s.ok)throw Error(`HTTP ${s.status}`);Xd(await s.blob(),r)}async function $e(t){let r=await fetch(t);if(!r.ok)throw Error(`HTTP ${r.status}`);let s=await r.blob();if(typeof ClipboardItem>"u"||!navigator.clipboard?.write)throw Error("Image clipboard unavailable");await navigator.clipboard.write([new ClipboardItem({[s.type]:s})])}function je({target:t,content:r,downloadContent:s,imageUrl:l,downloadMimeType:c,byteSource:d,byteViewer:f=!1}){let[h,p]=n(!1),g=a(()=>{p(!0),window.setTimeout(()=>p(!1),1500)},[]),v=a(()=>{if(!t)return;if(l){$e(l).then(g).catch(()=>{});return}if(f)return;if(!navigator.clipboard)return;navigator.clipboard.writeText(r).then(g).catch(()=>{})},[t,r,l,f,g]),k=a(()=>{if(!t)return;if(l){_e(l,t.name).catch(()=>{});return}if(f){let w=d?.loadBytes;if(!w)return;let m=d?.mimeType;w().then((R)=>Xd(m?new Blob([R],{type:m}):new Blob([R]),t.name)).catch(()=>{});return}Xd(new Blob([s],{type:c}),t.name)},[t,s,c,l,f,d]);return{copied:h,copy:v,download:k}}async function ze(t){let r=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(t));return Array.from(new Uint8Array(r),(s)=>s.toString(16).padStart(2,"0")).join("")}async function Xe(t,r,s,l){if(t.handleId){let d=s==="crlf"?r.replace(/\n/g,`\r
5
+ `):r,f=await op(t.handleId,d,{interactive:l.interactive});if(f==="written")return{status:"written",written:{mtimeMs:null,hash:await ze(d)}};if(f==="needs-permission")return{status:"needs-permission"};return{status:"failed"}}if(!t.path)return{status:"failed"};let c=new FormData;if(c.append("actionType","save"),c.append("path",t.path),c.append("content",r),c.append("eol",s),t.root)c.append("root",t.root);if(t.repo&&t.repo!==".")c.append("repo",t.repo);if(typeof l.baseMtimeMs==="number")c.append("baseMtime",String(l.baseMtimeMs));try{let d=await fetch("/api/fs/action",{method:"POST",body:c}),f=await d.json().catch(()=>null);if(d.status===409)return{status:"conflict",diskMtimeMs:typeof f?.mtimeMs==="number"?f.mtimeMs:null};if(d.ok&&f?.success)return{status:"written",written:{mtimeMs:typeof f.mtimeMs==="number"?f.mtimeMs:null,hash:typeof f.hash==="string"?f.hash:null}};return{status:"failed"}}catch{return{status:"failed"}}}function le(t,r){let s={},l=!1;for(let[c,d]of Object.entries(t))if(r.has(c))s[c]=d;else l=!0;return l?s:t}function xe(t){return String(t.id??t.path??t.name)}function Ge({target:t,isBinaryViewer:r,loadError:s,missing:l,contentsRef:c,lineEndingsRef:d,mtimesRef:f,pendingRef:h,flushOnUnmount:p,onSaveStart:g,onSaved:v,onSaveFailed:k,onNeedsPermission:w,onConflict:m}){let[R,y]=n(!1),E=i(l);E.current=l;let F=t?xe(t):"",b=a(async(C,W,X={})=>{if(!C.path&&!C.handleId)return;if(C.handleId&&!Wl(C.handleId))return;if(E.current&&!X.allowMissing)return;g();let q=xe(C),z=X.allowMissing?null:f.current[q]??null,j=await Xe(C,W,d.current[q]??"lf",{interactive:X.interactive===!0,baseMtimeMs:z});if(j.status==="written")v(q,W,j.written);else if(j.status==="needs-permission")w();else if(j.status==="conflict")m(q,j.diskMtimeMs);else k()},[d,f,m,w,k,g,v]),O=i(b);O.current=b;let U=a((C)=>{if(!t||r)return;if(!t.path)return;if(E.current)return;if(h.current)window.clearTimeout(h.current.timer);let W=window.setTimeout(()=>{h.current=null,O.current(t,C)},800);h.current={timer:W,file:t,content:C}},[t,r,h]),I=a(()=>{if(!t||r)return;if(s)return;if(t.handleId&&!Wl(t.handleId))return;let C=c.current[xe(t)];if(C===void 0)return;if(h.current)window.clearTimeout(h.current.timer),h.current=null;if(E.current){y(!0);return}O.current(t,C,{interactive:!0})},[t,c,r,s,h]),A=a(()=>{if(y(!1),!t||r||s)return;let C=c.current[xe(t)];if(C===void 0)return;O.current(t,C,{allowMissing:!0,interactive:!0})},[t,c,r,s]),D=a(()=>y(!1),[]);return o(()=>{if(!p)return;return()=>{let C=h.current;if(!C)return;if(window.clearTimeout(C.timer),h.current=null,E.current)return;O.current(C.file,C.content)}},[p,h]),o(()=>{if(!l)y(!1)},[l,F]),{onChange:U,saveNow:I,saveMissingConfirm:R,confirmSaveMissing:A,cancelSaveMissing:D}}function Qe({key:t,saveNow:r,mtimesRef:s,setMtimes:l,contentsRef:c,setContents:d,setBaselines:f,loadedRef:h,bumpRevision:p}){let[g,v]=n({}),k=a((F)=>{v((b)=>{if(b[F]===void 0)return b;let O={...b};return delete O[F],O})},[]),w=a((F,b)=>{v((O)=>({...O,[F]:{diskMtimeMs:b}}))},[]),m=a((F,b)=>{s.current={...s.current,[F]:b},l(s.current)},[s,l]),R=a((F)=>{if(!t)return;m(t,F),k(t)},[t,m,k]),y=a(()=>{if(!t)return;k(t),f((F)=>{let b={...F};return delete b[t],b}),d((F)=>{let b={...F};return delete b[t],b}),h.current.delete(t),p()},[t,k,f,d,h,p]),E=a(()=>{if(!t)return;let F=c.current[t],b=g[t]?.diskMtimeMs??null;if(k(t),F===void 0)return;if(b!==null)m(t,b);r()},[t,g,k,m,c,r]);return{conflict:g[t]??null,report:w,reload:y,keepMine:E,adopt:R,clear:k}}var At=3000;async function Bt(t,r,s){let l=new URLSearchParams({path:t});if(r)l.set("root",r);if(s&&s!==".")l.set("repo",s);try{let c=await fetch(`/api/fs/digest?${l.toString()}`),d=await c.json().catch(()=>null);if(!c.ok||!d||typeof d.exists!=="boolean")return"unknown";if(d.exists===!1)return"gone";if(typeof d.hash!=="string"||typeof d.mtimeMs!=="number")return"unknown";return{hash:d.hash,mtimeMs:d.mtimeMs}}catch{return"unknown"}}function Ye({path:t,root:r=null,repo:s=null,baseHash:l,revision:c,onUnchanged:d,onChanged:f}){let h=i(d);h.current=d;let p=i(f);p.current=f,o(()=>{if(!t||l===null)return;let g=!1,v=!1,k=null,w=async()=>{if(g||v||document.hidden)return;v=!0;try{let E=await Bt(t,r,s);if(g||E==="unknown"||E==="gone")return;if(E.hash===l){h.current(E.mtimeMs);return}if(k===E.hash)return;k=E.hash,p.current(E)}finally{v=!1}},m=window.setInterval(()=>void w(),At);w();let R=()=>void w(),y=()=>{if(!document.hidden)w()};return window.addEventListener("focus",R),document.addEventListener("visibilitychange",y),()=>{g=!0,window.clearInterval(m),window.removeEventListener("focus",R),document.removeEventListener("visibilitychange",y)}},[t,r,s,l,c])}function G(t){return String(t.id??t.path??t.name)}function Yl(t){if(!t.path)return!1;if(t.content!==void 0)return!1;if(t.handleId||t.deviceFile)return!1;return!t.isDiff}function De(t){return`${t.root??""}\x00${t.repo??"."}\x00${t.path??""}`}async function Kt(t){let r=new URLSearchParams({path:t.path??""});if(t.root)r.set("root",t.root);if(t.repo&&t.repo!==".")r.set("repo",t.repo);try{let s=await fetch(`/api/fs/exists?${r.toString()}`),l=await s.json().catch(()=>null);if(!s.ok||!l||typeof l.exists!=="boolean")return!0;return l.exists}catch{return!0}}function Qu(t,r){let[s,l]=n(()=>new Set),[c,d]=n(0),f=t.map((g)=>`${g.id}\x01${De(g)}`).join(`
6
+ `),h=i(t);h.current=t;let p=i(new Set);return o(()=>{let g=!1;return(async()=>{let v=new Map;for(let y of h.current)if(Yl(y))v.set(De(y),y);let k=await Promise.all([...v.entries()].map(async([y,E])=>({key:y,exists:await Kt(E)})));if(g)return;let w=new Set;for(let{key:y,exists:E}of k)if(!E)w.add(y);let m=new Set;for(let y of h.current)if(Yl(y)&&w.has(De(y)))m.add(y.id);let R=p.current;if(R.size===m.size&&[...m].every((y)=>R.has(y)))return;p.current=m,l(m)})(),()=>{g=!0}},[f,r,c]),o(()=>{let g=()=>d((v)=>v+1);return window.addEventListener("focus",g),document.addEventListener("visibilitychange",g),()=>{window.removeEventListener("focus",g),document.removeEventListener("visibilitychange",g)}},[]),s}function Je({key:t,target:r,baseHash:s,revision:l,hashesRef:c,mtimesRef:d,contentsRef:f,baselinesRef:h,pendingRef:p,readingRef:g,loadedRef:v,bumpRevision:k,adoptDiskMtime:w,clearConflict:m,reloadDiscardingEdits:R,discardPendingWrite:y}){let[E,F]=n(null),b=i(null);o(()=>{F(null),b.current=null},[t]);let O=a((D)=>{if(!t)return;if(d.current[t]!==D)w(D);F(null),b.current=null},[t,d,w]),U=a((D)=>{if(!t)return;if(c.current[t]===D.hash){F(null);return}if(b.current===D.hash)return;if(E?.hash===D.hash)return;let C=f.current[t],W=p.current;if(C!==void 0&&C!==h.current[t]||W!==null&&G(W.file)===t){F(D);return}if(g.current>0)return;v.current.delete(t),k()},[t,c,f,h,p,g,v,k,E]);Ye({path:r&&Yl({...r,id:t})?r.path??null:null,root:r?.root??null,repo:r?.repo??null,baseHash:s,revision:l,onUnchanged:O,onChanged:U});let I=a(()=>{if(!r)return;let D=G(r),C=f.current[D];if(C!==void 0&&C!==h.current[D]){y(D),R();return}m(D),v.current.delete(D),k()},[r,f,h,y,R,m,v,k]),A=a(()=>{if(!E)return;b.current=E.hash,w(E.mtimeMs),F(null)},[E,w]);return{diskChange:E,reloadFromDisk:I,keepMineAgainstDisk:A}}function Ze({target:t,loadedRef:r,bumpRevision:s,setContents:l,setBaselines:c,setLineEndings:d,setMtimes:f,setHashes:h}){let p=a((w,m,R,y)=>{let E=Ke(m),F=me(m);l((b)=>({...b,[w]:F})),c((b)=>({...b,[w]:F})),d((b)=>({...b,[w]:E})),f((b)=>({...b,[w]:R})),h((b)=>({...b,[w]:y}))},[l,c,d,f,h]),g=a(()=>{r.current.clear(),s()},[r,s]),v=a((w)=>{let m=new Set(w.map(String));for(let R of Array.from(r.current))if(!m.has(R))r.current.delete(R);l((R)=>le(R,m)),c((R)=>le(R,m)),d((R)=>le(R,m)),f((R)=>le(R,m)),h((R)=>le(R,m))},[r,l,d,f,h]),k=a((w)=>{if(!t)return;d((m)=>({...m,[G(t)]:w}))},[t,d]);return{remember:p,reset:g,retain:v,setEol:k}}function et({target:t,key:r,textDirty:s,contents:l,baselines:c,retain:d}){let[f,h]=n(()=>new Set),p=s||f.has(r),g=u(()=>{let w=new Set(f);for(let[m,R]of Object.entries(l)){let y=c[m];if(y!==void 0&&R!==y)w.add(m)}return w},[l,c,f]),v=a((w)=>{if(!t)return;let m=G(t);h((R)=>{if(R.has(m)===w)return R;let y=new Set(R);if(w)y.add(m);else y.delete(m);return y})},[t]),k=a((w)=>{d(w);let m=new Set(w.map(String));h((R)=>{let y=!1,E=new Set;for(let F of R)if(m.has(F))E.add(F);else y=!0;return y?E:R})},[d]);return{isDirty:p,dirtyKeys:g,setBinaryDirty:v,retain:k}}function Ru(t,r={}){let{flushOnUnmount:s=!1,reportSaveError:l=!1,downloadMimeType:c="text/plain",onFileSaved:d,missing:f=!1}=r,[h,p]=n({}),[g,v]=n({}),[k,w]=n({}),[m,R]=n({}),[y,E]=n({}),[F,b]=n("idle"),[O,U]=n(0),I=t?G(t):"",A=t?h[I]??(t.content!==void 0?me(t.content):""):"",D=A!==(g[I]??A),{viewerKind:C,isBinaryViewer:W,isImage:X,imageUrl:q,byteSource:z}=Be(t,O),j=i(new Set),Q=i(null),ie=i(0),K=i(h);K.current=h;let de=i(g);de.current=g;let J=i(k);J.current=k;let Z=i(m);Z.current=m;let ve=i(y);ve.current=y;let{remember:Me,reset:oe,retain:ne,setEol:Fe}=Ze({target:t,loadedRef:j,bumpRevision:()=>U((H)=>H+1),setContents:p,setBaselines:v,setLineEndings:w,setMtimes:R,setHashes:E}),{isDirty:Ee,dirtyKeys:fe,setBinaryDirty:he,retain:Te}=et({target:t,key:I,textDirty:D,contents:h,baselines:g,retain:ne}),{isLoading:M,isReading:L,loadError:V,unsupported:ee}=Ve({target:t,key:I,isBinaryViewer:W,revision:O,loadedRef:j,contentsRef:K,baselinesRef:de,pendingRef:Q,readingRef:ie,remember:Me}),te=Ge({target:t,isBinaryViewer:W,loadError:V,missing:f,contentsRef:K,lineEndingsRef:J,mtimesRef:Z,pendingRef:Q,flushOnUnmount:s,onSaveStart:()=>b("saving"),onSaved:(H,Y,se)=>{if(b("saved"),v((pe)=>({...pe,[H]:Y})),se.mtimeMs!==null)R((pe)=>({...pe,[H]:se.mtimeMs}));if(se.hash!==null)E((pe)=>({...pe,[H]:se.hash}));d?.()},onSaveFailed:()=>b(l?"error":"idle"),onNeedsPermission:()=>b("needs-permission"),onConflict:(H,Y)=>{b("idle"),re.report(H,Y)}}),Ce=i(te);Ce.current=te;let re=Qe({key:I,saveNow:()=>Ce.current.saveNow(),mtimesRef:Z,setMtimes:R,contentsRef:K,setContents:p,setBaselines:v,loadedRef:j,bumpRevision:()=>U((H)=>H+1)}),Ne=a((H)=>{let Y=Q.current;if(!Y||G(Y.file)!==H)return;window.clearTimeout(Y.timer),Q.current=null},[]),{diskChange:St,reloadFromDisk:wt,keepMineAgainstDisk:Rt}=Je({key:I,target:t,baseHash:y[I]??null,revision:O,hashesRef:ve,mtimesRef:Z,contentsRef:K,baselinesRef:de,pendingRef:Q,readingRef:ie,loadedRef:j,bumpRevision:()=>U((H)=>H+1),adoptDiskMtime:re.adopt,clearConflict:re.clear,reloadDiscardingEdits:re.reload,discardPendingWrite:Ne});o(()=>{if(F!=="saved")return;let H=window.setTimeout(()=>b("idle"),1500);return()=>window.clearTimeout(H)},[F]),o(()=>{b("idle")},[I]);let Mt=a((H)=>{if(!t||W)return;let Y=G(t);p((se)=>({...se,[Y]:H})),Ce.current.onChange(H)},[t,W]),{copied:kt,copy:Ft,download:Et}=je({target:t,content:A,downloadContent:t?Ue(A,k[I]??"lf"):A,imageUrl:q,downloadMimeType:c,byteSource:z,byteViewer:W});return{content:A,onChange:Mt,isLoading:M,isReading:L,loaded:t?W||t.content!==void 0||h[I]!==void 0:!1,loadError:V,unsupported:ee,saveStatus:F,copied:kt,isDirty:Ee,setBinaryDirty:he,eol:k[I]??"lf",setEol:Fe,baseMtimeMs:m[I]??null,dirtyKeys:fe,language:t?yt(t.name):"javascript",isImage:X,imageUrl:q,viewerKind:C,byteSource:z,isBinaryViewer:W,revision:O,handleMissing:Boolean(t?.handleId)&&!t?.deviceFile&&Wl(t?.handleId)===null,deviceBacked:Boolean(t?.deviceFile),deviceMissing:Boolean(t?.deviceFile)&&bg(t?.handleId)===null,saveNow:te.saveNow,copy:Ft,download:Et,reset:oe,retain:Te,saveMissingConfirm:te.saveMissingConfirm,confirmSaveMissing:te.confirmSaveMissing,cancelSaveMissing:te.cancelSaveMissing,conflict:re.conflict,resolveConflictByReload:()=>{if(I)Ne(I);re.reload()},resolveConflictByKeepingMine:re.keepMine,reloadFromDisk:wt,diskChange:St,keepMineAgainstDisk:Rt}}var Ut=20;function tt(){let[t,r]=T("editor.findHistory",[]),s=a((l)=>{let c=l.trim();if(!c)return;r((d)=>[c,...d.filter((f)=>f!==c)].slice(0,Ut))},[r]);return{entries:t,remember:s}}function nt(){let[t,r]=n(null),s=a((c)=>{let d=c();if(!d||d.start===d.end)return r(null),!1;return r(d),!0},[]),l=a(()=>r(null),[]);return{range:t,arm:s,disarm:l}}var rt=typeof String.prototype.normalize=="function"?(t)=>t.normalize("NFKD"):(t)=>t;class ce{constructor(t,r,s=0,l=t.length,c,d){this.test=d,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(s,l),this.bufferStart=s,this.normalize=c?(f)=>c(rt(f)):rt,this.query=this.normalize(r)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Dn(this.buffer,this.bufferPos)}next(){while(this.matches.length)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let r=Xl(t),s=this.bufferStart+this.bufferPos;this.bufferPos+=Sr(t);let l=this.normalize(r);if(l.length)for(let c=0,d=s,f=!0;;c++){let h=l.charCodeAt(c),p=this.match(h,d,f,this.bufferPos+this.bufferStart,c==l.length-1);if(p)return this.value=p,this;if(c==l.length-1)break;if(f&&c<r.length&&r.charCodeAt(c)==h)d++;else f=!1}}}match(t,r,s,l,c){let d=null;for(let f=0;f<this.matches.length;){let h=this.matches[f],p=!1;if(this.query.charCodeAt(h.index)==t)if(h.index==this.query.length-1)d={from:h.from,to:l,precise:c&&h.precise};else h.index++,p=!0;if(p)f++;else this.matches.splice(f,1)}if(this.query.charCodeAt(0)==t)if(this.query.length==1)d={from:r,to:l,precise:s&&c};else this.matches.push({from:r,index:1,precise:s});if(d&&this.test&&!this.test(d.from,d.to,this.buffer,this.bufferStart))d=null;return d}}if(typeof Symbol<"u")ce.prototype[Symbol.iterator]=function(){return this};var st={from:-1,to:-1,match:/.*/.exec(""),precise:!0},lt="gm"+(/x/.unicode==null?"":"u");class Se{constructor(t,r,s,l=0,c=t.length){if(this.text=t,this.to=c,this.curLine="",this.done=!1,this.value=st,/\\[sWDnr]|\n|\r|\[\^/.test(r))return new Oe(t,r,s,l,c);this.re=new RegExp(r,lt+((s===null||s===void 0?void 0:s.ignoreCase)?"i":"")),this.test=s===null||s===void 0?void 0:s.test,this.iter=t.iter();let d=t.lineAt(l);this.curLineStart=d.from,this.matchPos=be(t,l),this.getLine(this.curLineStart)}getLine(t){if(this.iter.next(t),this.iter.lineBreak)this.curLine="";else{if(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to)this.curLine=this.curLine.slice(0,this.to-this.curLineStart);this.iter.next()}}nextLine(){if(this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to)this.curLine="";else this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let r=this.matchPos<=this.to&&this.re.exec(this.curLine);if(r){let s=this.curLineStart+r.index,l=s+r[0].length;if(this.matchPos=be(this.text,l+(s==l?1:0)),s==this.curLineStart+this.curLine.length)this.nextLine();if((s<l||s>this.value.to)&&(!this.test||this.test(s,l,r)))return this.value={from:s,to:l,precise:!0,match:r},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),t=0;else return this.done=!0,this}}}var Ie=new WeakMap;class ae{constructor(t,r){this.from=t,this.text=r}get to(){return this.from+this.text.length}static get(t,r,s){let l=Ie.get(t);if(!l||l.from>=s||l.to<=r){let f=new ae(r,t.sliceString(r,s));return Ie.set(t,f),f}if(l.from==r&&l.to==s)return l;let{text:c,from:d}=l;if(d>r)c=t.sliceString(r,d)+c,d=r;if(l.to<s)c+=t.sliceString(l.to,s);return Ie.set(t,new ae(d,c)),new ae(r,c.slice(r-d,s-d))}}class Oe{constructor(t,r,s,l,c){this.text=t,this.to=c,this.done=!1,this.value=st,this.matchPos=be(t,l),this.re=new RegExp(r,lt+((s===null||s===void 0?void 0:s.ignoreCase)?"i":"")),this.test=s===null||s===void 0?void 0:s.test,this.flat=ae.get(t,l,this.chunkEnd(l+5000))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,r=this.re.exec(this.flat.text);if(r&&!r[0]&&r.index==t)this.re.lastIndex=t+1,r=this.re.exec(this.flat.text);if(r){let s=this.flat.from+r.index,l=s+r[0].length;if((this.flat.to>=this.to||r.index+r[0].length<=this.flat.text.length-10)&&(!this.test||this.test(s,l,r)))return this.value={from:s,to:l,precise:!0,match:r},this.matchPos=be(this.text,l+(s==l?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=ae.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}if(typeof Symbol<"u")Se.prototype[Symbol.iterator]=Oe.prototype[Symbol.iterator]=function(){return this};function be(t,r){if(r>=t.length)return r;let s=t.lineAt(r),l;while(r<s.to&&(l=s.text.charCodeAt(r-s.from))>=56320&&l<57344)r++;return r}var qt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},at=P.define({combine(t){return Nn(t,qt,{highlightWordAroundCursor:(r,s)=>r||s,minSelectionLength:Math.min,maxMatches:Math.min})}});function qA(t){let r=[jt,Ht];if(t)r.push(at.of(t));return r}var Vt=N.mark({class:"cm-selectionMatch"}),_t=N.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function it(t,r,s,l){return(s==0||t(r.sliceDoc(s-1,s))!=ln.Word)&&(l==r.doc.length||t(r.sliceDoc(l,l+1))!=ln.Word)}function $t(t,r,s,l){return t(r.sliceDoc(s,s+1))==ln.Word&&t(r.sliceDoc(l-1,l))==ln.Word}var Ht=ye.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){if(t.selectionSet||t.docChanged||t.viewportChanged)this.decorations=this.getDeco(t.view)}getDeco(t){let r=t.state.facet(at),{state:s}=t,l=s.selection;if(l.ranges.length>1)return N.none;let c=l.main,d,f=null;if(c.empty){if(!r.highlightWordAroundCursor)return N.none;let p=s.wordAt(c.head);if(!p)return N.none;f=s.charCategorizer(c.head),d=s.sliceDoc(p.from,p.to)}else{let p=c.to-c.from;if(p<r.minSelectionLength||p>200)return N.none;if(r.wholeWords){if(d=s.sliceDoc(c.from,c.to),f=s.charCategorizer(c.head),!(it(f,s,c.from,c.to)&&$t(f,s,c.from,c.to)))return N.none}else if(d=s.sliceDoc(c.from,c.to),!d)return N.none}let h=[];for(let p of t.visibleRanges){let g=new ce(s.doc,d,p.from,p.to);while(!g.next().done){let{from:v,to:k}=g.value;if(!f||it(f,s,v,k)){if(c.empty&&v<=c.from&&k>=c.to)h.push(_t.range(v,k));else if(v>=c.to||k<=c.from)h.push(Vt.range(v,k));if(h.length>r.maxMatches)return N.none}}}return N.set(h)}},{decorations:(t)=>t.decorations}),jt=_.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),zt=({state:t,dispatch:r})=>{let{selection:s}=t,l=x.create(s.ranges.map((c)=>t.wordAt(c.head)||x.cursor(c.head)),s.mainIndex);if(l.eq(s))return!1;return r(t.update({selection:l})),!0};function Xt(t,r){let{main:s,ranges:l}=t.selection,c=t.wordAt(s.head),d=c&&c.from==s.from&&c.to==s.to;for(let f=!1,h=new ce(t.doc,r,l[l.length-1].to);;)if(h.next(),h.done){if(f)return null;h=new ce(t.doc,r,0,Math.max(0,l[l.length-1].from-1)),f=!0}else{if(f&&l.some((p)=>p.from==h.value.from))continue;if(d){let p=t.wordAt(h.value.from);if(!p||p.from!=h.value.from||p.to!=h.value.to)continue}return h.value}}var WA=({state:t,dispatch:r})=>{let{ranges:s}=t.selection;if(s.some((d)=>d.from===d.to))return zt({state:t,dispatch:r});let l=t.sliceDoc(s[0].from,s[0].to);if(t.selection.ranges.some((d)=>t.sliceDoc(d.from,d.to)!=l))return!1;let c=Xt(t,l);if(!c)return!1;return r(t.update({selection:t.selection.addRange(x.range(c.from,c.to),!1),effects:_.scrollIntoView(c.to)})),!0};var KA=({state:t,dispatch:r})=>{let s=t.selection;if(s.ranges.length>1||s.main.empty)return!1;let{from:l,to:c}=s.main,d=[],f=0;for(let h=new ce(t.doc,t.sliceDoc(l,c));!h.next().done;){if(d.length>1000)return!1;if(h.value.from==l)f=d.length;d.push(x.range(h.value.from,h.value.to))}return r(t.update({selection:x.create(d,f),userEvent:"select.search.matches"})),!0};var ct=5000,Pe={matchCase:!1,wholeWord:!1,isRegex:!1,inSelection:!1},ut="gm"+("unicode"in RegExp.prototype?"u":"");function Re(t,r){if(!t)return null;let s=r.isRegex?t:t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l=r.wholeWord?`\\b(?:${s})\\b`:s;try{return new RegExp(l,r.matchCase?ut:`${ut}i`)}catch{return null}}var dt=null,we=null;function Gt(t){if(dt===t&&we)return we;return we=ke.of(t.split(`
7
7
  `)),dt=t,we}function ge(t,r,s,l){if(!r)return{matches:[],truncated:!1,invalid:!1};let c=Re(r,s);if(!c)return{matches:[],truncated:!1,invalid:!0};let d=[],f;try{f=new Se(Gt(t),c.source,{ignoreCase:!s.matchCase})}catch{return{matches:[],truncated:!1,invalid:!0}}let h=s.inSelection&&l?l:null;while(d.length<ct&&!f.next().done){let{from:p,to:g}=f.value;if(p===g)continue;if(h&&(p<h.start||g>h.end))continue;d.push({start:p,end:g})}return{matches:d,truncated:d.length>=ct,invalid:!1}}function ue(t,r){if(t.length===0)return-1;for(let s=0;s<t.length;s++)if(t[s].end>r)return s;return 0}function ft(t,r,s){if(r<=0)return-1;if(t<0)return s===1?0:r-1;return(t+s+r)%r}function Qt(t){return{full:t[0],numbered:[void 0,...t.slice(1)],named:t.groups}}var Yt=/\$(\$|&|\d{1,2}|<[^>]*>)/g;function ht(t,r){if(!t.includes("$"))return t;return t.replace(Yt,(s,l)=>{if(l==="$")return"$";if(l==="&")return r.full;if(l.startsWith("<"))return r.named?.[l.slice(1,-1)]??"";if(l.length===2){let c=r.numbered[Number(l)];if(c!==void 0)return c;let d=r.numbered[Number(l[0])];return d===void 0?"":d+l[1]}return r.numbered[Number(l)]??""})}function Jt(t,r,s,l,c){let d=Re(s,c);if(!d)return null;d.lastIndex=r.start;let f=d.exec(t);if(!f||f.index!==r.start)return null;let h=c.isRegex?ht(l,Qt(f)):l;return{found:f[0],inserted:h,start:f.index,end:f.index+f[0].length}}function pt(t,r,s,l,c){let d=Jt(t,r,s,l,c);if(!d)return null;return{text:t.slice(0,d.start)+d.inserted+t.slice(d.end),caret:d.start+d.inserted.length}}function mt(t,r,s,l){let c=Re(r,l);if(!c)return null;if(!l.isRegex)return t.replace(c,()=>s);return t.replace(c,(...d)=>{if(String(d[0]).length===0)return"";let f=d[d.length-1],h=typeof f==="object"&&f!==null,p=d.slice(1,d.length-(h?3:2));return ht(s,{full:String(d[0]),numbered:[void 0,...p],named:h?f:void 0})})}function Zt(t,r){if(!r||r.start===r.end)return null;let s=t.slice(r.start,r.end);if(!s||s.includes(`
8
- `)||s.length>200)return null;return s}function Su({text:t,documentKey:r,readSelection:s,select:l,reveal:c,applyDocument:d,toggleWordWrap:f}){let[h,p]=T("editor.findQuery",""),[g,v]=T("editor.findReplace",""),[k,w]=T("editor.findOptions",Pe),m=u(()=>({...Pe,...k}),[k]),R=rt(),y=nt(),[E,F]=n(!1),[b,W]=n(!1),[U,N]=n(-1),[B,O]=n(0),[C,A]=n(0),X=i(!1);X.current=E;let q=u(()=>ge(t,h,m,m.inSelection?R.range:null),[t,h,m,R.range]),z=i(0),j=i(!0),Q=i(c);Q.current=c;let ie=i(l);ie.current=l;let K=a((M)=>{z.current=M,j.current=!0},[]);o(()=>{K(0),A((M)=>M+1)},[r,K]),o(()=>{let M=q.matches;if(j.current){j.current=!1;let L=ue(M,z.current);if(N(L),L>=0)ie.current(M[L].start,M[L].end,!1),Q.current(M[L].start);return}N((L)=>{if(M.length===0)return-1;if(L<0)return ue(M,z.current);return Math.min(L,M.length-1)})},[q,C]);let de=a((M)=>{p(M),K(z.current)},[p,K]),J=a(()=>{if(O((V)=>V+1),X.current)return;let M=s(),L=Zt(t,M);if(L)p(L);K(M?M.start:0),F(!0),A((V)=>V+1)},[t,s,K,p]),Z=a(()=>{W(!0),J()},[J]),ve=a(()=>W((M)=>!M),[]),Me=a(()=>{y.remember(h),F(!1),W(!1);let M=q.matches[U];if(M)l(M.start,M.end,!0)},[q.matches,U,l]),oe=a((M)=>{let L=q.matches;if(L.length===0)return;let V=ft(U,L.length,M);N(V),z.current=L[V].end,l(L[V].start,L[V].end,!1),c(L[V].start)},[q.matches,U,l,c]),ne=a((M)=>{let L={...m,[M]:!m[M]};if(M==="inSelection"&&!R.arm(s)){w({...m,inSelection:!1});return}if(M==="inSelection"&&!L.inSelection)R.disarm();w(L),K(z.current)},[m,w,K,s,R]),Fe=a((M)=>{p(M),y.remember(M),K(z.current),A((L)=>L+1)},[y,K]),Ee=a((M)=>{let L=cr(t,Math.max(0,M.line-1)),{matches:V}=ge(t,M.query,M.options),ee=ue(V,L);if(p(M.query),w(M.options),K(ee>=0?V[ee].start:L),A((te)=>te+1),ee>=0)ie.current(V[ee].start,V[ee].end,!0),Q.current(V[ee].start)},[t,p,w,K]),fe=a(()=>{let M=q.matches[U];if(!M)return;let L=pt(t,M,h,g,m);if(!L)return;d(L.text,L.caret,L.caret),K(L.caret)},[q.matches,U,t,h,g,m,d,K]),he=a(()=>{let M=mt(t,h,g,m);if(M===null||M===t)return;let L=Math.min(z.current,M.length);d(M,L,L),K(L)},[t,h,g,m,d,K]),Te=a((M)=>{switch(M){case"find":J();return;case"replace":Z();return;case"nextMatch":oe(1);return;case"previousMatch":oe(-1);return;case"replaceOne":fe();return;case"replaceAll":he();return;case"toggleCaseSensitive":ne("matchCase");return;case"toggleWholeWord":ne("wholeWord");return;case"toggleRegex":ne("isRegex");return;case"toggleWordWrap":f?.();return;default:return}},[J,Z,oe,fe,he,ne,f]);return{open:E,replaceOpen:b,query:h,replacement:g,options:m,matches:q.matches,truncated:q.truncated,invalid:q.invalid,currentIndex:U,setQuery:de,setReplacement:v,openFind:J,openReplace:Z,toggleReplace:ve,focusRequest:B,close:Me,runCommand:Te,revealMatch:Ee,toggleOption:ne,selectionRange:m.inSelection?R.range:null,history:y.entries,useHistoryEntry:Fe,step:oe,replaceCurrent:fe,replaceAll:he}}function Tu(t,r,s){let l=ze(Zh,Jh),[c,d]=n(null);return o(()=>{if(!l||!t||l.path!==t||!s)return;d({request:l,path:t}),Ld(null)},[l,t,s]),u(()=>{if(!c||c.path!==t)return null;let{matches:f}=ge(r,c.request.query,c.request.options),h=cr(r,Math.max(0,c.request.line-1));return{request:c.request,matches:f,currentIndex:ue(f,h)}},[c,t,r])}function vt(t){let r=i({});o(()=>{if(!t)return;Gh(r.current,en(t))}),o(()=>{let s=r.current;return()=>jh(s)},[])}function en(t){let{file:r}=t;if(!r)return{path:null,name:null,content:"",language:"text",state:"idle",note:null,preview:!1};let s={path:r.path,name:r.name,content:t.content,language:t.language,preview:t.preview&&t.viewerKind==="markdown"};if(r.isDiff)return{...s,content:"",state:"diff",note:null,preview:!1};if(t.loadError)return{...s,state:"error",note:t.loadError,preview:!1};if(t.isBinaryViewer)return{...s,content:"",state:"not-a-document",note:`${ti[t.viewerKind]} files have no text outline.`,preview:!1};if(t.isLoading||!t.loaded)return{...s,state:"loading",note:null,preview:!1};return{...s,state:"ready",note:null}}function xt(t,r,s){let l=ze(qh,Hh);return u(()=>{if(!l||!t||l.path!==t||!s)return null;let c=cr(r,Math.max(0,l.line-1)),d=r.indexOf(`
9
- `,c),f=(d===-1?r.length:d)-c,h=Math.min(f,Math.max(0,(l.column??1)-1)),p=l.length===void 0?h:Math.min(f,h+l.length);return{path:t,offset:c,selectionStart:c+h,selectionEnd:c+p,request:l}},[l,t,s,r])}function yt({path:t,content:r,ready:s,surfaceRef:l,isPreview:c,exitPreview:d}){let f=xt(t,r,s),h=i(null),p=i(null);o(()=>{if(p.current!==null){let v=l.current;if(c||!v)return;let k=p.current;p.current=null,bt(v,k);return}if(!f||h.current===f.request)return;if(c){h.current=f.request,p.current={start:f.selectionStart,end:f.selectionEnd,offset:f.offset},d();return}let g=l.current;if(!g)return;h.current=f.request,bt(g,{start:f.selectionStart,end:f.selectionEnd,offset:f.offset})})}function bt(t,r){t.select(r.start,r.end,!0),t.revealOffset(r.offset),Oo(null)}function Du({file:t,editor:r,surfaceRef:s,isPreview:l,exitPreview:c,publish:d=!0}){vt(d?{file:t,content:r.content,language:r.language,loaded:r.loaded,isLoading:r.isLoading,loadError:r.loadError,viewerKind:r.viewerKind,isBinaryViewer:r.isBinaryViewer,preview:l}:null),yt({path:t?.path??null,content:r.content,ready:r.loaded&&!r.loadError,surfaceRef:s,isPreview:l,exitPreview:c})}function Nu({fileName:t,onReload:r,onKeepMine:s}){return e("div",{className:"flex items-start gap-2 px-3 py-2 border-b border-info/30 bg-info/10 text-[11px] text-ink flex-shrink-0",role:"status","data-external-change-strip":"",children:[e(S,{size:13,className:"text-info-text flex-shrink-0 mt-0.5"}),e("div",{className:"min-w-0 flex-1",children:[e("div",{className:"font-medium",children:[e("span",{className:"font-mono",children:t})," changed on disk."]}),e("div",{className:"text-ink/60 mt-0.5",children:"Reload takes the disk copy and discards your edits. Keep mine writes yours over it."})]}),e("div",{className:"flex items-center gap-1 flex-shrink-0",children:[e("button",{type:"button",onClick:r,className:"px-2 py-1 rounded border border-ink/20 hover:bg-ink/5 transition-colors cursor-pointer",title:"Take the file from disk",children:"Reload"}),e("button",{type:"button",onClick:s,className:"px-2 py-1 rounded border border-info/50 text-info-text hover:bg-info/10 transition-colors cursor-pointer",title:"Keep my buffer; the next save writes it",children:"Keep mine"})]})]})}function tn(t){if(t===null)return null;let r=new Date(t);if(Number.isNaN(r.getTime()))return null;return r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Qu({diskMtimeMs:t,fileName:r,onReload:s,onKeepMine:l}){let c=tn(t);return e("div",{className:"flex items-start gap-2 px-3 py-2 border-b border-warning/30 bg-warning/10 text-[11px] text-ink flex-shrink-0",role:"alert","data-conflict-strip":"",children:[e(I,{size:13,className:"text-warning-text flex-shrink-0 mt-0.5"}),e("div",{className:"min-w-0 flex-1",children:[e("div",{className:"font-medium",children:[e("span",{className:"font-mono",children:r})," changed on disk",c?e("span",{className:"text-ink/60",children:[" at ",c]}):null,"."]}),e("div",{className:"text-ink/60 mt-0.5",children:"Your save was refused so nothing was overwritten."})]}),e("div",{className:"flex items-center gap-1 flex-shrink-0",children:[e("button",{type:"button",onClick:s,className:"px-2 py-1 rounded border border-ink/20 hover:bg-ink/5 transition-colors cursor-pointer",title:"Discard my changes and take the file from disk",children:"Reload"}),e("button",{type:"button",onClick:l,className:"px-2 py-1 rounded border border-warning/50 text-warning-text hover:bg-warning/10 transition-colors cursor-pointer",title:"Write my buffer over the file on disk",children:"Keep mine"})]})]})}function Ru({fileName:t,filePath:r,onClose:s,onConfirm:l}){return o(()=>{let c=(d)=>{if(d.key!=="Escape")return;d.preventDefault(),s()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[s]),e("div",{className:"fixed inset-0 z-50 flex items-center justify-center modal-scrim animate-in fade-in duration-200 modal-safe",onClick:s,role:"dialog","aria-modal":"true","aria-label":"Save deleted file",children:e("div",{className:"glass-overlay bg-paper border border-ink/20 rounded-xl shadow-xl w-[min(94vw,440px)] overflow-hidden",onClick:(c)=>c.stopPropagation(),children:[e("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-ink/10",children:[e(ao,{size:16,className:"text-error-text shrink-0"}),e("h2",{className:"text-[13px] font-semibold text-ink",children:"This file was deleted"})]}),e("div",{className:"px-4 py-4 space-y-3",children:[e("div",{className:"rounded-lg border border-ink/10 bg-canvas/50 px-3 py-2",children:[e("div",{className:"text-[12px] font-mono text-error-text line-through truncate",children:t}),e("div",{className:"text-[11px] font-mono text-ink/50 break-all mt-0.5",children:r})]}),e("p",{className:"text-[11.5px] leading-relaxed text-ink/60",children:"It was removed from disk while this tab was open. Saving recreates it with the buffer's current contents — anything written to that path since the deletion is lost."})]}),e("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-ink/10",children:[e("button",{type:"button",onClick:s,className:"px-3 py-1.5 rounded border border-ink/20 text-ink/70 hover:bg-ink/5 hover:text-ink transition-colors cursor-pointer text-xs",children:"Cancel"}),e("button",{type:"button",autoFocus:!0,onClick:l,className:"px-3 py-1.5 rounded bg-error text-canvas hover:bg-error/90 transition-colors cursor-pointer text-xs font-medium",children:"Save anyway"})]})]})})}function Lu(t){let[r,s]=T("editor.reviewMode",{});return{active:r[t]===!0,toggle:()=>s((l)=>({...l,[t]:l[t]!==!0}))}}function Mu(t,r=0){let s=Boolean(t.url)&&!t.url?.startsWith("blob:"),[l,c]=n({url:s?null:t.url,loading:s||!t.url,error:null}),d=i(t);return d.current=t,o(()=>{let f=d.current;if(f.url){let v=f.url;if(v.startsWith("blob:")){c({url:v,loading:!1,error:null});return}let k=!1;return c({url:null,loading:!0,error:null}),fetch(v,{headers:{Range:"bytes=0-0"}}).then(async(w)=>{if(k)return;if(w.ok){c({url:v,loading:!1,error:null});return}c({url:null,loading:!1,error:await Le(w)})}).catch(()=>{if(!k)c({url:v,loading:!1,error:null})}),()=>{k=!0}}let h=f.loadBytes;if(!h){c({url:null,loading:!1,error:"This file cannot be read from here."});return}let p=!1,g=null;return c({url:null,loading:!0,error:null}),h().then((v)=>{if(p)return;g=URL.createObjectURL(f.mimeType?new Blob([v],{type:f.mimeType}):new Blob([v])),c({url:g,loading:!1,error:null})}).catch((v)=>{if(p)return;c({url:null,loading:!1,error:v instanceof Error?v.message:"Could not read this file."})}),()=>{if(p=!0,g)URL.revokeObjectURL(g)}},[t.id,r]),l}
10
- export{QA,RA,LA,Ms,Eu,Bu,ti,Fs,Ul,Iu,_u,MA,FA,PA,Su,Tu,Du,Nu,Qu,Ru,Lu,Mu};
8
+ `)||s.length>200)return null;return s}function Lu({text:t,documentKey:r,readSelection:s,select:l,reveal:c,applyDocument:d,toggleWordWrap:f}){let[h,p]=T("editor.findQuery",""),[g,v]=T("editor.findReplace",""),[k,w]=T("editor.findOptions",Pe),m=u(()=>({...Pe,...k}),[k]),R=nt(),y=tt(),[E,F]=n(!1),[b,O]=n(!1),[U,I]=n(-1),[A,D]=n(0),[C,W]=n(0),X=i(!1);X.current=E;let q=u(()=>ge(t,h,m,m.inSelection?R.range:null),[t,h,m,R.range]),z=i(0),j=i(!0),Q=i(c);Q.current=c;let ie=i(l);ie.current=l;let K=a((M)=>{z.current=M,j.current=!0},[]);o(()=>{K(0),W((M)=>M+1)},[r,K]),o(()=>{let M=q.matches;if(j.current){j.current=!1;let L=ue(M,z.current);if(I(L),L>=0)ie.current(M[L].start,M[L].end,!1),Q.current(M[L].start);return}I((L)=>{if(M.length===0)return-1;if(L<0)return ue(M,z.current);return Math.min(L,M.length-1)})},[q,C]);let de=a((M)=>{p(M),K(z.current)},[p,K]),J=a(()=>{if(D((V)=>V+1),X.current)return;let M=s(),L=Zt(t,M);if(L)p(L);K(M?M.start:0),F(!0),W((V)=>V+1)},[t,s,K,p]),Z=a(()=>{O(!0),J()},[J]),ve=a(()=>O((M)=>!M),[]),Me=a(()=>{y.remember(h),F(!1),O(!1);let M=q.matches[U];if(M)l(M.start,M.end,!0)},[q.matches,U,l]),oe=a((M)=>{let L=q.matches;if(L.length===0)return;let V=ft(U,L.length,M);I(V),z.current=L[V].end,l(L[V].start,L[V].end,!1),c(L[V].start)},[q.matches,U,l,c]),ne=a((M)=>{let L={...m,[M]:!m[M]};if(M==="inSelection"&&!R.arm(s)){w({...m,inSelection:!1});return}if(M==="inSelection"&&!L.inSelection)R.disarm();w(L),K(z.current)},[m,w,K,s,R]),Fe=a((M)=>{p(M),y.remember(M),K(z.current),W((L)=>L+1)},[y,K]),Ee=a((M)=>{let L=ur(t,Math.max(0,M.line-1)),{matches:V}=ge(t,M.query,M.options),ee=ue(V,L);if(p(M.query),w(M.options),K(ee>=0?V[ee].start:L),W((te)=>te+1),ee>=0)ie.current(V[ee].start,V[ee].end,!0),Q.current(V[ee].start)},[t,p,w,K]),fe=a(()=>{let M=q.matches[U];if(!M)return;let L=pt(t,M,h,g,m);if(!L)return;d(L.text,L.caret,L.caret),K(L.caret)},[q.matches,U,t,h,g,m,d,K]),he=a(()=>{let M=mt(t,h,g,m);if(M===null||M===t)return;let L=Math.min(z.current,M.length);d(M,L,L),K(L)},[t,h,g,m,d,K]),Te=a((M)=>{switch(M){case"find":J();return;case"replace":Z();return;case"nextMatch":oe(1);return;case"previousMatch":oe(-1);return;case"replaceOne":fe();return;case"replaceAll":he();return;case"toggleCaseSensitive":ne("matchCase");return;case"toggleWholeWord":ne("wholeWord");return;case"toggleRegex":ne("isRegex");return;case"toggleWordWrap":f?.();return;default:return}},[J,Z,oe,fe,he,ne,f]);return{open:E,replaceOpen:b,query:h,replacement:g,options:m,matches:q.matches,truncated:q.truncated,invalid:q.invalid,currentIndex:U,setQuery:de,setReplacement:v,openFind:J,openReplace:Z,toggleReplace:ve,focusRequest:A,close:Me,runCommand:Te,revealMatch:Ee,toggleOption:ne,selectionRange:m.inSelection?R.range:null,history:y.entries,useHistoryEntry:Fe,step:oe,replaceCurrent:fe,replaceAll:he}}function Mu(t,r,s){let l=He(u0,c0),[c,d]=n(null);return o(()=>{if(!l||!t||l.path!==t||!s)return;d({request:l,path:t}),zd(null)},[l,t,s]),u(()=>{if(!c||c.path!==t)return null;let{matches:f}=ge(r,c.request.query,c.request.options),h=ur(r,Math.max(0,c.request.line-1));return{request:c.request,matches:f,currentIndex:ue(f,h)}},[c,t,r])}function gt(t){let r=i({});o(()=>{if(!t)return;t0(r.current,en(t))}),o(()=>{let s=r.current;return()=>n0(s)},[])}function en(t){let{file:r}=t;if(!r)return{path:null,name:null,content:"",language:"text",state:"idle",note:null,preview:!1};let s={path:r.path,name:r.name,content:t.content,language:t.language,preview:t.preview&&t.viewerKind==="markdown"};if(r.isDiff)return{...s,content:"",state:"diff",note:null,preview:!1};if(t.loadError)return{...s,state:"error",note:t.loadError,preview:!1};if(t.isBinaryViewer)return{...s,content:"",state:"not-a-document",note:`${oi[t.viewerKind]} files have no text outline.`,preview:!1};if(t.isLoading||!t.loaded)return{...s,state:"loading",note:null,preview:!1};return{...s,state:"ready",note:null}}function vt(t,r,s){let l=He(a0,r0);return u(()=>{if(!l||!t||l.path!==t||!s)return null;let c=ur(r,Math.max(0,l.line-1)),d=r.indexOf(`
9
+ `,c),f=(d===-1?r.length:d)-c,h=Math.min(f,Math.max(0,(l.column??1)-1)),p=l.length===void 0?h:Math.min(f,h+l.length);return{path:t,offset:c,selectionStart:c+h,selectionEnd:c+p,request:l}},[l,t,s,r])}function bt({path:t,content:r,ready:s,surfaceRef:l,isPreview:c,exitPreview:d}){let f=vt(t,r,s),h=i(null),p=i(null);o(()=>{if(p.current!==null){let v=l.current;if(c||!v)return;let k=p.current;p.current=null,xt(v,k);return}if(!f||h.current===f.request)return;if(c){h.current=f.request,p.current={start:f.selectionStart,end:f.selectionEnd,offset:f.offset},d();return}let g=l.current;if(!g)return;h.current=f.request,xt(g,{start:f.selectionStart,end:f.selectionEnd,offset:f.offset})})}function xt(t,r){t.select(r.start,r.end,!0),t.revealOffset(r.offset),Uo(null)}function Fu({file:t,editor:r,surfaceRef:s,isPreview:l,exitPreview:c,publish:d=!0}){gt(d?{file:t,content:r.content,language:r.language,loaded:r.loaded,isLoading:r.isLoading,loadError:r.loadError,viewerKind:r.viewerKind,isBinaryViewer:r.isBinaryViewer,preview:l}:null),bt({path:t?.path??null,content:r.content,ready:r.loaded&&!r.loadError,surfaceRef:s,isPreview:l,exitPreview:c})}function Pu({fileName:t,onReload:r,onKeepMine:s}){return e("div",{className:"flex items-start gap-2 px-3 py-2 border-b border-info/30 bg-info/10 text-[11px] text-ink flex-shrink-0",role:"status","data-external-change-strip":"",children:[e(S,{size:13,className:"text-info-text flex-shrink-0 mt-0.5"}),e("div",{className:"min-w-0 flex-1",children:[e("div",{className:"font-medium",children:[e("span",{className:"font-mono",children:t})," changed on disk."]}),e("div",{className:"text-ink/60 mt-0.5",children:"Reload takes the disk copy and discards your edits. Keep mine writes yours over it."})]}),e("div",{className:"flex items-center gap-1 flex-shrink-0",children:[e("button",{type:"button",onClick:r,className:"px-2 py-1 rounded border border-ink/20 hover:bg-ink/5 transition-colors cursor-pointer",title:"Take the file from disk",children:"Reload"}),e("button",{type:"button",onClick:s,className:"px-2 py-1 rounded border border-info/50 text-info-text hover:bg-info/10 transition-colors cursor-pointer",title:"Keep my buffer; the next save writes it",children:"Keep mine"})]})]})}function tn(t){if(t===null)return null;let r=new Date(t);if(Number.isNaN(r.getTime()))return null;return r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Ou({diskMtimeMs:t,fileName:r,onReload:s,onKeepMine:l}){let c=tn(t);return e("div",{className:"flex items-start gap-2 px-3 py-2 border-b border-warning/30 bg-warning/10 text-[11px] text-ink flex-shrink-0",role:"alert","data-conflict-strip":"",children:[e(B,{size:13,className:"text-warning-text flex-shrink-0 mt-0.5"}),e("div",{className:"min-w-0 flex-1",children:[e("div",{className:"font-medium",children:[e("span",{className:"font-mono",children:r})," changed on disk",c?e("span",{className:"text-ink/60",children:[" at ",c]}):null,"."]}),e("div",{className:"text-ink/60 mt-0.5",children:"Your save was refused so nothing was overwritten."})]}),e("div",{className:"flex items-center gap-1 flex-shrink-0",children:[e("button",{type:"button",onClick:s,className:"px-2 py-1 rounded border border-ink/20 hover:bg-ink/5 transition-colors cursor-pointer",title:"Discard my changes and take the file from disk",children:"Reload"}),e("button",{type:"button",onClick:l,className:"px-2 py-1 rounded border border-warning/50 text-warning-text hover:bg-warning/10 transition-colors cursor-pointer",title:"Write my buffer over the file on disk",children:"Keep mine"})]})]})}function $u({fileName:t,filePath:r,onClose:s,onConfirm:l}){return o(()=>{let c=(d)=>{if(d.key!=="Escape")return;d.preventDefault(),s()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[s]),e("div",{className:"fixed inset-0 z-50 flex items-center justify-center modal-scrim animate-in fade-in duration-200 modal-safe",onClick:s,role:"dialog","aria-modal":"true","aria-label":"Save deleted file",children:e("div",{className:"glass-overlay bg-paper border border-ink/20 rounded-xl shadow-xl w-[min(94vw,440px)] overflow-hidden",onClick:(c)=>c.stopPropagation(),children:[e("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-ink/10",children:[e(io,{size:16,className:"text-error-text shrink-0"}),e("h2",{className:"text-[13px] font-semibold text-ink",children:"This file was deleted"})]}),e("div",{className:"px-4 py-4 space-y-3",children:[e("div",{className:"rounded-lg border border-ink/10 bg-canvas/50 px-3 py-2",children:[e("div",{className:"text-[12px] font-mono text-error-text line-through truncate",children:t}),e("div",{className:"text-[11px] font-mono text-ink/50 break-all mt-0.5",children:r})]}),e("p",{className:"text-[11.5px] leading-relaxed text-ink/60",children:"It was removed from disk while this tab was open. Saving recreates it with the buffer's current contents — anything written to that path since the deletion is lost."})]}),e("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-ink/10",children:[e("button",{type:"button",onClick:s,className:"px-3 py-1.5 rounded border border-ink/20 text-ink/70 hover:bg-ink/5 hover:text-ink transition-colors cursor-pointer text-xs",children:"Cancel"}),e("button",{type:"button",autoFocus:!0,onClick:l,className:"px-3 py-1.5 rounded bg-error text-canvas hover:bg-error/90 transition-colors cursor-pointer text-xs font-medium",children:"Save anyway"})]})]})})}function zu(t){let[r,s]=T("editor.reviewMode",{});return{active:r[t]===!0,toggle:()=>s((l)=>({...l,[t]:l[t]!==!0}))}}function Uu(t,r=0){let s=Boolean(t.url)&&!t.url?.startsWith("blob:"),[l,c]=n({url:s?null:t.url,loading:s||!t.url,error:null}),d=i(t);return d.current=t,o(()=>{let f=d.current;if(f.url){let v=f.url;if(v.startsWith("blob:")){c({url:v,loading:!1,error:null});return}let k=!1;return c({url:null,loading:!0,error:null}),fetch(v,{headers:{Range:"bytes=0-0"}}).then(async(w)=>{if(k)return;if(w.ok){c({url:v,loading:!1,error:null});return}c({url:null,loading:!1,error:await Le(w)})}).catch(()=>{if(!k)c({url:v,loading:!1,error:null})}),()=>{k=!0}}let h=f.loadBytes;if(!h){c({url:null,loading:!1,error:"This file cannot be read from here."});return}let p=!1,g=null;return c({url:null,loading:!0,error:null}),h().then((v)=>{if(p)return;g=URL.createObjectURL(f.mimeType?new Blob([v],{type:f.mimeType}):new Blob([v])),c({url:g,loading:!1,error:null})}).catch((v)=>{if(p)return;c({url:null,loading:!1,error:v instanceof Error?v.message:"Could not read this file."})}),()=>{if(p=!0,g)URL.revokeObjectURL(g)}},[t.id,r]),l}
10
+ export{GA,jA,HA,zs,Du,Nu,oi,Us,Yl,Qu,Ru,qA,WA,KA,Lu,Mu,Fu,Pu,Ou,$u,zu,Uu};
@@ -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"]}')),Sm=[e];
2
- export{Sm};
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"]}')),Mm=[e];
2
+ export{Mm};