@kabmo-labs/kabmo 0.33.0 → 0.35.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 (272) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +785 -624
  3. package/dist/client/static/js/{CsvGrid-fncjbg6j.js → CsvGrid-0amzgtd7.js} +2 -2
  4. package/dist/client/static/js/{DocxView-c9v2vr3r.js → DocxView-bxjhzxe9.js} +5 -5
  5. package/dist/client/static/js/{DrawioView-vxjksm12.js → DrawioView-7s1yqsf4.js} +2 -2
  6. package/dist/client/static/js/{ImageView-a3g5k226.js → ImageView-ycfbn66h.js} +1 -1
  7. package/dist/client/static/js/{LayoutWrapper-hnjfwsjh.js → LayoutWrapper-tw1q1x0g.js} +2 -2
  8. package/dist/client/static/js/Modal-wqjactyd.js +38 -0
  9. package/dist/client/static/js/{PdfView-ksaes53y.js → PdfView-x6dmtwvr.js} +1 -1
  10. package/dist/client/static/js/{SessionsView-30vcr95v.js → SessionsView-t85wq0me.js} +1 -1
  11. package/dist/client/static/js/{SheetView-vc484scg.js → SheetView-n52nvz8s.js} +25 -25
  12. package/dist/client/static/js/{SvgPreview-tph89jet.js → SvgPreview-59z7syme.js} +1 -1
  13. package/dist/client/static/js/{abnfDiagram-O67JEVCF-xbar278c.js → abnfDiagram-O67JEVCF-91gnt049.js} +1 -1
  14. package/dist/client/static/js/architecture-7GRP2DOG-bajpnvy7.js +1 -0
  15. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-s171n2z6.js → architectureDiagram-NJMV4G6O-5b9qtff2.js} +4 -4
  16. package/dist/client/static/js/{astro-80bs6hvg.js → astro-31cbyw7b.js} +1 -1
  17. package/dist/client/static/js/bash-0h36tk0k.js +1 -0
  18. package/dist/client/static/js/{blockDiagram-BEXU5L5S-gzx6rv9n.js → blockDiagram-BEXU5L5S-6f23fjkn.js} +3 -3
  19. package/dist/client/static/js/{c4Diagram-YGBWAQC7-7f00skch.js → c4Diagram-YGBWAQC7-76t6d3am.js} +5 -5
  20. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-j79v95nc.js → classDiagram-v2-NBCMYWYE-f9tb19xm.js} +3 -3
  21. package/dist/client/static/js/{cose-bilkent-JH36ORCC-5fkn7ee5.js → cose-bilkent-JH36ORCC-t6nwrbwj.js} +1 -1
  22. package/dist/client/static/js/cpp-4wp9sy20.js +1 -0
  23. package/dist/client/static/js/css-c9nsbkh6.js +1 -0
  24. package/dist/client/static/js/cynefin-OW5HDTMX-8q9e90m8.js +1 -0
  25. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-cfs1yvrd.js → cynefinDiagram-VND7K2PF-69gc244j.js} +1 -1
  26. package/dist/client/static/js/{dagre-6A5THRUB-44bgc48p.js → dagre-6A5THRUB-54bry3ey.js} +2 -2
  27. package/dist/client/static/js/{diagram-22UHCM2B-a4g4x83k.js → diagram-22UHCM2B-gfkebye6.js} +11 -11
  28. package/dist/client/static/js/{diagram-3UASUU5V-gm4rg5na.js → diagram-3UASUU5V-a1mr319f.js} +1 -1
  29. package/dist/client/static/js/{diagram-ATOU4E4O-a95y41vk.js → diagram-ATOU4E4O-tkyk0qbe.js} +3 -3
  30. package/dist/client/static/js/{diagram-CDSNMT55-t3j93mmc.js → diagram-CDSNMT55-np0hc9m2.js} +4 -4
  31. package/dist/client/static/js/{diagram-MLGK6HIB-c2wdez02.js → diagram-MLGK6HIB-nh06fshp.js} +2 -2
  32. package/dist/client/static/js/{diagram-MPIPVDR6-gya9jhs5.js → diagram-MPIPVDR6-27q2veks.js} +2 -2
  33. package/dist/client/static/js/{dockerfile-a7q6174s.js → dockerfile-4rtt6c0f.js} +1 -1
  34. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-jjhkza6t.js → ebnfDiagram-ZINNZB2B-x9p9jqe8.js} +1 -1
  35. package/dist/client/static/js/{elk-276RUBZZ-f7re45mw.js → elk-276RUBZZ-fw7waks3.js} +1 -1
  36. package/dist/client/static/js/{erDiagram-OPXOYQCR-tpm9g5te.js → erDiagram-OPXOYQCR-fdfgzr5d.js} +5 -5
  37. package/dist/client/static/js/{erlang-qt876zrq.js → erlang-trjm07as.js} +1 -1
  38. package/dist/client/static/js/eventmodeling-NTZA5JFV-kn4hsm3p.js +1 -0
  39. package/dist/client/static/js/flowDiagram-KWPJA3E3-ah8cvps1.js +1 -0
  40. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-fz43n12d.js → ganttDiagram-FUAMR5RP-2avbqgdr.js} +3 -3
  41. package/dist/client/static/js/gitGraph-4MIJSDKK-hvavh16n.js +1 -0
  42. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-f61hgbn6.js → gitGraphDiagram-X574FWY7-9jmc0a3g.js} +12 -12
  43. package/dist/client/static/js/graphql-hbkmxsty.js +1 -0
  44. package/dist/client/static/js/{index-8239j2v1.js → index-0v34a7wf.js} +1 -1
  45. package/dist/client/static/js/{index-vtbbfwx0.js → index-1wjp16f0.js} +2 -2
  46. package/dist/client/static/js/index-2mx9ej4k.css +1 -0
  47. package/dist/client/static/js/{index-q2w6s8n7.js → index-2v1nmxwr.js} +6 -6
  48. package/dist/client/static/js/{index-apvkd37e.js → index-3ecsp1rx.js} +3 -3
  49. package/dist/client/static/js/{index-1y9r4frb.js → index-43qpbxjv.js} +2 -2
  50. package/dist/client/static/js/{index-w0fwb80e.js → index-4vybd9e7.js} +1 -1
  51. package/dist/client/static/js/{index-ahv9y42z.js → index-6f6cmcbq.js} +2 -2
  52. package/dist/client/static/js/{index-9fjt5anh.js → index-7ct7qrsp.js} +2 -2
  53. package/dist/client/static/js/{index-ajs3jj6j.js → index-7q02xnvq.js} +1 -1
  54. package/dist/client/static/js/{index-rytaa8ca.js → index-7smwzkvq.js} +2 -2
  55. package/dist/client/static/js/{index-rg8jpbsw.js → index-8acv5b77.js} +2 -2
  56. package/dist/client/static/js/{index-gs6f0qwa.js → index-8f9x7ev8.js} +2 -2
  57. package/dist/client/static/js/{index-7y6rpsrp.js → index-8mwragbj.js} +2 -2
  58. package/dist/client/static/js/{index-gcs49f3p.js → index-8x9ecxb0.js} +1 -1
  59. package/dist/client/static/js/{index-3rcjx70v.js → index-9ketbkh6.js} +1 -1
  60. package/dist/client/static/js/{index-ypx3qmhq.js → index-a628fg4m.js} +2 -2
  61. package/dist/client/static/js/{index-e4p4cd3r.js → index-a8ffattk.js} +2 -2
  62. package/dist/client/static/js/{index-js7t1vb1.js → index-b8s3xraa.js} +6 -6
  63. package/dist/client/static/js/index-btr2w8cq.js +12 -0
  64. package/dist/client/static/js/index-dfzrpy54.js +2 -0
  65. package/dist/client/static/js/{index-pxv2nw9w.js → index-ee2p07eg.js} +1 -1
  66. package/dist/client/static/js/{index-03h3bkcf.js → index-ek2e773p.js} +1 -1
  67. package/dist/client/static/js/{index-1xqs14fr.js → index-fvc0x6nx.js} +3 -3
  68. package/dist/client/static/js/{index-3zc1b0dv.js → index-jc1yagmk.js} +2 -2
  69. package/dist/client/static/js/{index-d495kfm0.js → index-jmxqefe3.js} +1 -1
  70. package/dist/client/static/js/{index-2x5f66t6.js → index-k7q01ye4.js} +2 -2
  71. package/dist/client/static/js/{index-5tgq7aqx.js → index-kdkfyrja.js} +2 -2
  72. package/dist/client/static/js/{index-m73za75e.js → index-mc4nefs7.js} +3 -3
  73. package/dist/client/static/js/{index-trm9x02n.js → index-nb8tp4mj.js} +30 -30
  74. package/dist/client/static/js/{index-zt75xpq0.js → index-ncrenheb.js} +206 -206
  75. package/dist/client/static/js/{index-qsm2z36d.js → index-p16scjt7.js} +2 -2
  76. package/dist/client/static/js/{index-sdtye3jy.js → index-pc6eg8h2.js} +2 -2
  77. package/dist/client/static/js/{index-zvfvqvn9.js → index-pnt0vc59.js} +2 -2
  78. package/dist/client/static/js/{index-pbe4yed4.js → index-py2k8std.js} +2 -2
  79. package/dist/client/static/js/{index-dbe6afkf.js → index-pzbssnsc.js} +2 -2
  80. package/dist/client/static/js/{index-qckv9nte.js → index-qqz6bcdd.js} +2 -2
  81. package/dist/client/static/js/{index-xj9649ac.js → index-ray2czf6.js} +7 -7
  82. package/dist/client/static/js/{index-0tf0arsp.js → index-rbgemjsp.js} +3 -3
  83. package/dist/client/static/js/{index-vw4brsdx.js → index-rkn0bxxt.js} +1 -1
  84. package/dist/client/static/js/{index-76zb4m0n.js → index-rv89xpaf.js} +2 -2
  85. package/dist/client/static/js/index-sbd5e816.js +1 -0
  86. package/dist/client/static/js/{index-eyzeya95.js → index-sdby39w4.js} +5 -5
  87. package/dist/client/static/js/{index-0n5wwe60.js → index-t6c0pd43.js} +2 -2
  88. package/dist/client/static/js/{index-km2zb6wk.js → index-tp7yb3bv.js} +2 -2
  89. package/dist/client/static/js/{index-vw5k8csz.js → index-vnw3hbeg.js} +56 -56
  90. package/dist/client/static/js/{index-354mqqra.js → index-vq6wts05.js} +2 -2
  91. package/dist/client/static/js/{index-14vndmcr.js → index-w5373tg1.js} +2 -2
  92. package/dist/client/static/js/{index-0e40xskg.js → index-w7tpgt46.js} +1 -1
  93. package/dist/client/static/js/{index-djmg1d7h.js → index-whbtxmwh.js} +2 -2
  94. package/dist/client/static/js/{index-2svnq5gg.js → index-xs1m0bpt.js} +1 -1
  95. package/dist/client/static/js/{index-9y3gjdj7.js → index-xxtsm2rb.js} +2 -2
  96. package/dist/client/static/js/{index-hf52f59k.js → index-y3ms153k.js} +2 -2
  97. package/dist/client/static/js/{index-1a0zkj8h.js → index-yq39qbs1.js} +2 -2
  98. package/dist/client/static/js/{index-j0r5hj0j.js → index-zh2jj56s.js} +2 -2
  99. package/dist/client/static/js/info-A6RAGUB7-fmjz8qwg.js +1 -0
  100. package/dist/client/static/js/{infoDiagram-VRGFBTTK-1qj804sn.js → infoDiagram-VRGFBTTK-g2dky5xg.js} +2 -2
  101. package/dist/client/static/js/ini-72yrpvd4.js +1 -0
  102. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-4j4qsnzw.js → ishikawaDiagram-OU5B5YK6-exrcjwp1.js} +6 -6
  103. package/dist/client/static/js/java-ab5tb2ra.js +1 -0
  104. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-j0brnfft.js → journeyDiagram-ZHPQQLJL-pn752qa5.js} +4 -4
  105. package/dist/client/static/js/jsx-25zj9j3k.js +1 -0
  106. package/dist/client/static/js/{julia-4ghmfy3e.js → julia-evn99h2m.js} +1 -1
  107. package/dist/client/static/js/{kanban-definition-PNTS6WVX-qqc22br0.js → kanban-definition-PNTS6WVX-v8nvr373.js} +5 -5
  108. package/dist/client/static/js/lua-j5w0c9wm.js +1 -0
  109. package/dist/client/static/js/markdown-j6hn4377.js +1 -0
  110. package/dist/client/static/js/{mermaid.core-vv3wbe65.js → mermaid.core-egzv89zv.js} +6 -6
  111. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-y5b2z8zp.js → mindmap-definition-NLK3R4M7-t9njmv2w.js} +8 -8
  112. package/dist/client/static/js/one-dark-pro-bm3r4js7.js +1 -0
  113. package/dist/client/static/js/one-light-e07dt7sy.js +1 -0
  114. package/dist/client/static/js/packet-AYTQ26CC-cwr6n1cm.js +1 -0
  115. package/dist/client/static/js/{pegDiagram-GJSIUBJH-0be07mqs.js → pegDiagram-GJSIUBJH-zhycy2b7.js} +1 -1
  116. package/dist/client/static/js/{perl-sd00t4b4.js → perl-506fy8m8.js} +1 -1
  117. package/dist/client/static/js/{php-2zfyqa61.js → php-axtsvxck.js} +1 -1
  118. package/dist/client/static/js/pie-WAS4IAKB-h1ebfzgt.js +1 -0
  119. package/dist/client/static/js/{pieDiagram-5QR66LMP-544w86jk.js → pieDiagram-5QR66LMP-sgctvma2.js} +2 -2
  120. package/dist/client/static/js/properties-q8njes42.js +1 -0
  121. package/dist/client/static/js/python-vqxc7181.js +1 -0
  122. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-p09e7z5s.js → quadrantDiagram-O4NWA36T-kzzhdcph.js} +5 -5
  123. package/dist/client/static/js/r-0k5eej8m.js +1 -0
  124. package/dist/client/static/js/radar-RG4KPBEZ-k7p1m364.js +1 -0
  125. package/dist/client/static/js/railroad-74A4TZTK-d08dw3t0.js +1 -0
  126. package/dist/client/static/js/railroad-abnf-HS5TGJTU-txnjycgk.js +1 -0
  127. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-p0r3cv6w.js +1 -0
  128. package/dist/client/static/js/railroad-peg-WCYAUIDC-sryk900a.js +1 -0
  129. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-de830ed2.js → railroadDiagram-XR7U4H2S-nzjffwxm.js} +1 -1
  130. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-b47d74p1.js → requirementDiagram-PLB6GJNP-tz4xxn4d.js} +2 -2
  131. package/dist/client/static/js/{ruby-v9qaqhby.js → ruby-qp7zfk2m.js} +1 -1
  132. package/dist/client/static/js/{rust-fkt0qyrs.js → rust-fz913fvw.js} +1 -1
  133. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-6ezc2fpj.js → sankeyDiagram-IPEJSGJF-2wcb0xr6.js} +4 -4
  134. package/dist/client/static/js/{sass-9bxped7y.js → sass-gnk9vsyp.js} +1 -1
  135. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-by5zqj6w.js → sequenceDiagram-PO4LG4MO-vqgebfns.js} +18 -18
  136. package/dist/client/static/js/{sizeCapture-INFHLROL-q85r06j6.js → sizeCapture-INFHLROL-xc314tes.js} +1 -1
  137. package/dist/client/static/js/sql-0e9mnrda.js +1 -0
  138. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-ep5pyexs.js → stateDiagram-v2-GCMORJYK-8bd9b1h8.js} +3 -3
  139. package/dist/client/static/js/{svelte-mwtx07d9.js → svelte-brpgzrtv.js} +1 -1
  140. package/dist/client/static/js/{swimlanes-2SLR337P-95fcqkh8.js → swimlanes-2SLR337P-t6hbdzcw.js} +1 -1
  141. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-c1czc7kv.js +8 -0
  142. package/dist/client/static/js/{timeline-definition-EJHVYXUP-461e615g.js → timeline-definition-EJHVYXUP-2txxasx5.js} +4 -4
  143. package/dist/client/static/js/treeView-Q6P3EWNA-77kj68p1.js +1 -0
  144. package/dist/client/static/js/treemap-WGGIJYW6-rw94xc82.js +1 -0
  145. package/dist/client/static/js/tsx-yd5wt250.js +1 -0
  146. package/dist/client/static/js/typescript-v7z7crfe.js +1 -0
  147. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-ftqfnvhg.js → usecaseDiagram-POWQR4AR-3x353hn4.js} +17 -17
  148. package/dist/client/static/js/{vennDiagram-UO4OBE2U-7t96h6ez.js → vennDiagram-UO4OBE2U-cerpss8e.js} +7 -7
  149. package/dist/client/static/js/{vue-j8vb9d7r.js → vue-apnkw9qy.js} +1 -1
  150. package/dist/client/static/js/wardley-WFR3VGLG-18xe4fhz.js +1 -0
  151. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-0de8w8c6.js → wardleyDiagram-VNRHLVJA-cx6jfsbf.js} +4 -4
  152. package/dist/client/static/js/xml-94fhzrfs.js +1 -0
  153. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-dez9phkf.js → xychartDiagram-PMCCYNJV-tgn23xj1.js} +5 -5
  154. package/dist/client/static/js/yaml-s8af9rnw.js +1 -0
  155. package/package.json +4 -1
  156. package/src/client/components/auth/login-screen/index.tsx +1 -0
  157. package/src/client/components/common/MarkdownRenderer.tsx +9 -12
  158. package/src/client/components/settings/Modal.tsx +14 -84
  159. package/src/client/components/settings/Sidebar.tsx +3 -1
  160. package/src/client/components/settings/categories/ConnectSettings.tsx +105 -0
  161. package/src/client/components/settings/categories/connect-settings/DeviceTable.tsx +145 -0
  162. package/src/client/components/settings/categories/connect-settings/PairDialog.test.tsx +159 -0
  163. package/src/client/components/settings/categories/connect-settings/PairDialog.tsx +189 -0
  164. package/src/client/components/settings/categories/connect-settings/QrCode.tsx +56 -0
  165. package/src/client/components/settings/categories/connect-settings/ServerCard.tsx +94 -0
  166. package/src/client/components/settings/categories/connect-settings/TunnelRow.tsx +127 -0
  167. package/src/client/components/settings/categories/connect-settings/qr-image.ts +76 -0
  168. package/src/client/components/settings/category-content.tsx +116 -0
  169. package/src/client/components/workspace/chat-timeline/ChangedFilesSummary.test.tsx +120 -0
  170. package/src/client/components/workspace/chat-timeline/ChangedFilesSummary.tsx +56 -20
  171. package/src/client/components/workspace/chat-timeline/RunFooter.tsx +1 -0
  172. package/src/client/components/workspace/git-panel/init-state.test.ts +5 -0
  173. package/src/client/hooks/chat/composer/speech-to-text.ts +24 -17
  174. package/src/client/hooks/chat/timeline/change-stats.ts +57 -0
  175. package/src/client/hooks/connect/use-connect-status.ts +116 -0
  176. package/src/client/hooks/connect/use-pairing.ts +100 -0
  177. package/src/client/hooks/editor/file-actions.ts +3 -11
  178. package/src/client/hooks/editor/font.test.ts +2 -1
  179. package/src/client/hooks/editor/use-file-transfer.ts +2 -1
  180. package/src/client/hooks/ui/clipboard.ts +26 -0
  181. package/src/client/lib/browser/download.ts +22 -0
  182. package/src/client/tailwind.css +5 -0
  183. package/src/server/index.ts +2 -0
  184. package/src/server/lib/assets/font-css.server.test.ts +19 -0
  185. package/src/server/lib/auth/client-address.test.ts +58 -0
  186. package/src/server/lib/auth/client-address.ts +37 -3
  187. package/src/server/lib/auth/guard.ts +31 -4
  188. package/src/server/lib/auth/rate-limit.test.ts +25 -8
  189. package/src/server/lib/auth/rate-limit.ts +8 -5
  190. package/src/server/lib/connect/cloudflared.lifecycle.test.ts +88 -0
  191. package/src/server/lib/connect/cloudflared.server.test.ts +65 -0
  192. package/src/server/lib/connect/cloudflared.server.ts +206 -0
  193. package/src/server/lib/connect/devices.server.ts +192 -0
  194. package/src/server/lib/connect/identity.server.ts +81 -0
  195. package/src/server/lib/connect/pairing.server.test.ts +56 -0
  196. package/src/server/lib/connect/pairing.server.ts +113 -0
  197. package/src/server/lib/connect/qr.roundtrip.test.ts +106 -0
  198. package/src/server/lib/connect/qr.server.ts +36 -0
  199. package/src/server/lib/connect/run.server.ts +101 -0
  200. package/src/server/lib/connect/status.server.ts +177 -0
  201. package/src/server/lib/connect/tailscale.server.test.ts +117 -0
  202. package/src/server/lib/connect/tailscale.server.ts +172 -0
  203. package/src/server/lib/db/schema.ts +4 -0
  204. package/src/server/lib/omp/session/changes.test.ts +64 -1
  205. package/src/server/lib/omp/session/changes.ts +94 -1
  206. package/src/server/routes/connect/devices.ts +56 -0
  207. package/src/server/routes/connect/index.ts +15 -0
  208. package/src/server/routes/connect/pair-page.ts +177 -0
  209. package/src/server/routes/connect/pair.ts +158 -0
  210. package/src/server/routes/connect/status.ts +19 -0
  211. package/src/server/routes/connect/tunnels.ts +76 -0
  212. package/src/server/routes/health/probe.ts +5 -0
  213. package/src/server/routes/index.ts +2 -0
  214. package/src/server/routes/sessions/changes.test.ts +12 -3
  215. package/src/server/routes/sessions/changes.ts +27 -3
  216. package/src/server/routes/sessions/index.ts +2 -1
  217. package/src/shared/lib/connect/payload.test.ts +144 -0
  218. package/src/shared/lib/connect/payload.ts +229 -0
  219. package/src/shared/lib/connect/tier.test.ts +73 -0
  220. package/src/shared/lib/connect/tier.ts +105 -0
  221. package/src/shared/lib/connect/types.ts +99 -0
  222. package/src/shared/lib/dictation/capture-failure.test.ts +46 -0
  223. package/src/shared/lib/dictation/capture-failure.ts +36 -0
  224. package/src/shared/lib/markdown/fira-code-fonts.css +65 -6
  225. package/src/shared/lib/markdown/marked.ts +7 -4
  226. package/src/shared/lib/markdown/mermaid-actions.test.ts +78 -0
  227. package/src/shared/lib/markdown/mermaid-actions.ts +45 -0
  228. package/src/shared/lib/markdown/mermaid.ts +41 -7
  229. package/src/shared/lib/settings/sections.ts +6 -1
  230. package/src/shared/types/session-changes.ts +6 -0
  231. package/src/shared/types/settings/state.ts +2 -0
  232. package/dist/client/static/js/Modal-qtftcp2t.js +0 -38
  233. package/dist/client/static/js/architecture-7GRP2DOG-tavtgb8a.js +0 -1
  234. package/dist/client/static/js/bash-b3rwyg5p.js +0 -1
  235. package/dist/client/static/js/cpp-y0t6mynx.js +0 -1
  236. package/dist/client/static/js/css-6vj0d308.js +0 -1
  237. package/dist/client/static/js/cynefin-OW5HDTMX-cdh3n2z2.js +0 -1
  238. package/dist/client/static/js/eventmodeling-NTZA5JFV-as97tpyp.js +0 -1
  239. package/dist/client/static/js/flowDiagram-KWPJA3E3-ggm06d12.js +0 -1
  240. package/dist/client/static/js/gitGraph-4MIJSDKK-eqz7p9ng.js +0 -1
  241. package/dist/client/static/js/graphql-n43pd5fs.js +0 -1
  242. package/dist/client/static/js/index-at6bhjyf.js +0 -1
  243. package/dist/client/static/js/index-bkye8mz4.js +0 -2
  244. package/dist/client/static/js/index-e94a1en0.css +0 -1
  245. package/dist/client/static/js/index-sffjtm5w.js +0 -12
  246. package/dist/client/static/js/info-A6RAGUB7-4pkzh1qx.js +0 -1
  247. package/dist/client/static/js/ini-j5dyq6gm.js +0 -1
  248. package/dist/client/static/js/java-g4dgwbfd.js +0 -1
  249. package/dist/client/static/js/jsx-7t5ecz9s.js +0 -1
  250. package/dist/client/static/js/lua-1g6w30de.js +0 -1
  251. package/dist/client/static/js/markdown-afx21x8c.js +0 -1
  252. package/dist/client/static/js/one-dark-pro-hm3f56n1.js +0 -1
  253. package/dist/client/static/js/one-light-xrz49rct.js +0 -1
  254. package/dist/client/static/js/packet-AYTQ26CC-yg71sp88.js +0 -1
  255. package/dist/client/static/js/pie-WAS4IAKB-89wd6np0.js +0 -1
  256. package/dist/client/static/js/properties-thd83wey.js +0 -1
  257. package/dist/client/static/js/python-264ns4xw.js +0 -1
  258. package/dist/client/static/js/r-qw82kkv9.js +0 -1
  259. package/dist/client/static/js/radar-RG4KPBEZ-avn0b8r9.js +0 -1
  260. package/dist/client/static/js/railroad-74A4TZTK-de27xv5w.js +0 -1
  261. package/dist/client/static/js/railroad-abnf-HS5TGJTU-rg4zzj7x.js +0 -1
  262. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-d84fhj8v.js +0 -1
  263. package/dist/client/static/js/railroad-peg-WCYAUIDC-dvf8xrmc.js +0 -1
  264. package/dist/client/static/js/sql-g8wcshpc.js +0 -1
  265. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-xs2en5dv.js +0 -8
  266. package/dist/client/static/js/treeView-Q6P3EWNA-mham0bh6.js +0 -1
  267. package/dist/client/static/js/treemap-WGGIJYW6-mxrxax86.js +0 -1
  268. package/dist/client/static/js/tsx-nm94hed6.js +0 -1
  269. package/dist/client/static/js/typescript-0s2t05jj.js +0 -1
  270. package/dist/client/static/js/wardley-WFR3VGLG-8vrvh9p3.js +0 -1
  271. package/dist/client/static/js/xml-dz51p1m3.js +0 -1
  272. package/dist/client/static/js/yaml-2cfkd30t.js +0 -1
@@ -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"]}')),mp=[e];
2
- export{mp};
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"]}')),fp=[e];
2
+ export{fp};
@@ -1 +1 @@
1
- import{d,n,i,V,o,u,a,Ht,e,S,ir,or,Ee,Ro,f,Mo,Po,Oo,F,zo,y,le,eo,Fs,rt,at,dt,Nu,ql}from"./index-zt75xpq0.js";import{fr}from"./index-qsm2z36d.js";var fe=2000,_=new Map;function me(s){if(s.length===0)return"";let r="";for(let t of s)r+=`${t.start}-${t.end},`;return r}function Z(s,r,t){let h=eo(r),c=`${r}\x00${me(t)}\x00${s}`;if(h){let m=_.get(c);if(m!==void 0)return _.delete(c),_.set(c,m),m}let l=Fs(s,r,{marks:t});if(!h)return l;if(_.set(c,l),_.size>fe){let m=_.keys().next();if(!m.done)_.delete(m.value)}return l}function ee(s,r,t){let h=[],c=0;for(let l of r){if(l.start<c||l.end<=l.start||l.end>s.length)continue;if(l.start>c)h.push({text:s.slice(c,l.start),kind:"plain"});if(h.push({text:s.slice(l.start,l.end),kind:"removed"}),t)h.push({text:t,kind:"inserted"});c=l.end}if(c<s.length)h.push({text:s.slice(c),kind:"plain"});return h}function ge({file:s,result:r,replacement:t,showReplacePreview:h,onOpen:c}){let l=r.ranges??[],m=h&&t.length>0;return e("button",{type:"button",onClick:()=>c(r),className:"flex w-full items-start gap-2 rounded px-1 py-0.5 text-left hover:bg-ink/5 cursor-pointer",title:`Open ${s}:${r.line}`,children:[e("span",{className:"w-6 flex-shrink-0 text-right font-mono text-ink/40",children:r.line}),m?e("span",{className:"min-w-0 truncate font-mono text-ink",children:ee(r.content,l,t).map((k,p)=>k.kind==="plain"?e("span",{children:k.text},p):k.kind==="removed"?e("del",{className:"search-replace-old",children:k.text},p):e("ins",{className:"search-replace-new",children:k.text},p))}):e("span",{className:"min-w-0 truncate font-mono text-ink",dangerouslySetInnerHTML:{__html:Z(r.content,dt(s),l)}})]})}var te=Ht(ge);var Y={header:4,hit:4,group:16},re={headerBox:16,hitBox:20},ne=5000;function se(s){let r=[],t=null;for(let h of s){if(!t||t.file!==h.file)t={file:h.file,results:[]},r.push(t);t.results.push(h)}return r}function oe(s){let r=[];for(let t of s){r.push({kind:"group",file:t.file,count:t.results.length});for(let h=0;h<t.results.length;h++)r.push({kind:"hit",file:t.file,result:t.results[h],last:h===t.results.length-1})}return r}function xe(s,r){if(s.kind==="group")return r.headerBox+Y.header;return r.hitBox+(s.last?Y.group:Y.hit)}function ie(s,r){let t=Array(s.length),h=Array(s.length),c=0;for(let l=0;l<s.length;l++){let m=xe(s[l],r);t[l]=c,h[l]=m,c+=m}return{offsets:t,heights:h,total:c}}function ae(s,r,t,h,c=240){if(s.length===0)return{start:0,end:0};let l=Math.max(0,t),m=l-c,k=l+h+c,p=0,b=s.length-1;while(p<b){let x=p+b>>1;if(s[x]+r[x]>m)b=x;else p=x+1}let w=p;p=w,b=s.length;while(p<b){let x=p+b>>1;if(s[x]>=k)b=x;else p=x+1}return{start:w,end:p}}var be=8,Se=8;function ce({groups:s,replacement:r,showReplacePreview:t,onOpen:h,onReplaceFile:c,replaceBusy:l}){let m=o(null),k=o(null),p=u(()=>oe(s),[s]),[b,w]=n(re),x=u(()=>ie(p,b),[p,b]),[M,E]=n(()=>({start:0,end:Math.min(p.length,60)})),A=a((g)=>{m.current=g},[]),v=a(()=>{let g=m.current;if(!g)return;let N=ae(x.offsets,x.heights,g.scrollTop,g.clientHeight);E((I)=>I.start===N.start&&I.end===N.end?I:N)},[x]),R=a(()=>{v()},[v]);V(()=>{let g=k.current;if(!g)return;let N=g.querySelector("[data-search-header] > div")?.offsetHeight??0,I=g.querySelector("[data-search-hit] > button")?.offsetHeight??0;if(N>0&&N!==b.headerBox)w((C)=>({...C,headerBox:N}));if(I>0&&I!==b.hitBox)w((C)=>({...C,hitBox:I}))},[M,b,p]),V(()=>{v()},[v]),V(()=>{let g=m.current;if(!g||typeof ResizeObserver>"u")return;let N=new ResizeObserver(()=>v());return N.observe(g),()=>N.disconnect()},[v]);let W=p.length===0?0:Math.min(M.start,p.length-1),L=Math.min(M.end,p.length),z=p.slice(W,L),O=L<p.length?x.total-x.offsets[L]:0;return e("div",{ref:A,onScroll:R,className:"flex-1 scrollbar-overlay-container px-3 text-xs",style:{overflowAnchor:"none"},children:[e("div",{style:{height:be+(x.offsets[W]??0)},"aria-hidden":"true"}),e("div",{ref:k,children:z.map((g,N)=>{let I=W+N,C=x.heights[I];if(g.kind==="group")return e("div",{"data-search-header":"",style:{height:C},children:e("div",{className:"font-semibold text-ink/80 flex items-center justify-between group",children:[e("div",{className:"flex items-center min-w-0",children:[e(rt,{name:g.file,size:12,className:"mr-1.5 flex-shrink-0"}),e("span",{className:"truncate",children:g.file}),e("span",{className:"ml-2 bg-ink/10 text-[10px] px-1.5 py-0.5 rounded-full flex-shrink-0",children:g.count})]}),e("button",{onClick:()=>c(g.file),disabled:l,className:"touch-visible opacity-0 group-hover:opacity-100 p-1 text-ink/40 hover:text-ink rounded hover:bg-ink/5 disabled:opacity-50 flex-shrink-0",title:"Replace in this file",children:e(Oo,{size:12})})]})},`group:${g.file}`);return e("div",{"data-search-hit":"",style:{height:C},children:e(te,{file:g.file,result:g.result,replacement:r,showReplacePreview:t,onOpen:h})},`hit:${g.file}:${g.result.line}:${I}`)})}),e("div",{style:{height:Se+O},"aria-hidden":"true"})]})}function ue({className:s,query:r,setQuery:t,replaceQuery:h,setReplaceQuery:c,matchCase:l,setMatchCase:m,wholeWord:k,setWholeWord:p,useRegex:b,setUseRegex:w,includeFiles:x,setIncludeFiles:M,showIncludeField:E,setShowIncludeField:A,showMenu:v,setShowMenu:R,menuRef:W,rootPath:L,activeRepo:z,setActiveRepo:O,repos:g,reposScanning:N,rescanRepos:I,results:C,isSearching:U,truncated:H,error:P,onOpenFile:q,handleReplace:G,replaceBusy:J}){let Q=u(()=>se(C),[C]),B=o(null),X=o(null),D=a(()=>{t(""),B.current?.focus()},[t]),j=a(()=>{c(""),X.current?.focus()},[c]),K=u(()=>({matchCase:l,wholeWord:k,isRegex:b,inSelection:!1}),[l,k,b]),de=a((T)=>{Nu({path:T.file,line:Number(T.line),query:r,options:K}),q?.({path:T.file,name:T.file.split("/").pop()||T.file,root:L,repo:z})},[r,K,L,z,q]),pe=a((T)=>G(T),[G]);return e("div",{className:`flex flex-col h-full bg-paper ${s}`,children:[e("div",{className:"p-3 border-b border-ink/10 flex items-center justify-between",children:[e("div",{className:"flex items-center space-x-2 min-w-0",children:[e("h2",{className:"text-xs font-semibold text-ink uppercase tracking-wider",children:"Search"}),e(fr,{rootPath:L,activeRepo:z,onSelectRepo:O,repos:g,scanning:N,onRefreshRepos:I})]}),e("div",{className:"relative",ref:W,children:[e("button",{onClick:()=>R(!v),className:`p-1 rounded hover:bg-ink/5 transition-colors ${v||E?"text-ink":"text-ink/40"}`,title:"Search Options",children:e(Ee,{size:14})}),v&&e("div",{className:"glass-popover absolute right-0 top-full mt-1 w-48 bg-paper border border-ink/10 rounded shadow-lg z-10 py-1",children:e("button",{onClick:()=>{if(A(!E),E)M("");R(!1)},className:"w-full px-3 py-1.5 text-left text-xs text-ink hover:bg-ink/5 flex items-center justify-between",children:[e("span",{children:"Files to include"}),E&&e(f,{size:12,className:"text-ink/60"})]})})]})]}),e("div",{className:"p-3 flex flex-col gap-2.5 border-b border-ink/10",children:[e("div",{className:"relative",children:e("div",{className:"flex items-center border border-ink/20 rounded bg-paper focus-within:border-ink/40 focus-within:ring-1 focus-within:ring-ink/10 transition-all",children:[e(F,{size:14,className:"ml-2 text-ink/40 flex-shrink-0"}),e("input",{ref:B,type:"text",placeholder:"Search",value:r,onChange:(T)=>t(T.currentTarget.value),className:"w-full bg-transparent border-none text-xs px-2 py-1.5 focus:outline-none text-ink placeholder-ink/35 min-w-0"}),r&&e("button",{type:"button",onClick:D,title:"Clear search","aria-label":"Clear search",className:"p-1 mr-0.5 rounded text-ink/40 hover:text-ink hover:bg-ink/5 flex-shrink-0",children:e(y,{size:12})}),e("div",{className:"flex items-center space-x-0.5 pr-1 text-ink/40 flex-shrink-0",children:[e("button",{onClick:()=>m(!l),className:`p-1 rounded hover:text-ink ${l?"bg-ink/10 text-ink":"hover:bg-ink/5"}`,title:"Match Case",children:e(Ro,{size:14})}),e("button",{onClick:()=>p(!k),className:`p-1 rounded hover:text-ink ${k?"bg-ink/10 text-ink":"hover:bg-ink/5"}`,title:"Match Whole Word",children:e(zo,{size:14})}),e("button",{onClick:()=>w(!b),className:`p-1 rounded hover:text-ink ${b?"bg-ink/10 text-ink":"hover:bg-ink/5"}`,title:"Use Regular Expression",children:e(Mo,{size:14})})]})]})}),e("div",{className:"relative flex items-center space-x-1",children:[e("div",{className:"flex flex-1 min-w-0 items-center border border-ink/20 rounded bg-paper focus-within:border-ink/40 focus-within:ring-1 focus-within:ring-ink/10 transition-all",children:[e("input",{ref:X,type:"text",placeholder:"Replace",value:h,onChange:(T)=>c(T.currentTarget.value),className:"flex-1 min-w-0 bg-transparent border-none text-xs px-2 py-1.5 focus:outline-none text-ink placeholder-ink/35"}),h&&e("button",{type:"button",onClick:j,title:"Clear replace","aria-label":"Clear replace",className:"p-1 mr-0.5 rounded text-ink/40 hover:text-ink hover:bg-ink/5 flex-shrink-0",children:e(y,{size:12})})]}),e("button",{onClick:()=>G(),disabled:C.length===0||J,className:"p-1.5 rounded border border-ink/20 text-ink/60 hover:text-ink hover:bg-ink/5 disabled:opacity-50 disabled:cursor-not-allowed bg-paper",title:"Replace All",children:e(Po,{size:14})})]}),E&&e("div",{className:"relative",children:e("input",{type:"text",value:x,onChange:(T)=>M(T.currentTarget.value),placeholder:"Files to include (e.g. *.js, src/*)",className:"w-full bg-paper border border-ink/20 rounded text-xs px-2 py-1.5 focus:outline-none focus:border-ink/40 focus:ring-1 focus:ring-ink/10 transition-all text-ink placeholder-ink/40"})})]}),P&&C.length===0?e("div",{className:"flex-1 px-3 py-3",role:"alert",children:e("div",{className:"rounded border border-error/30 bg-error/5 px-2.5 py-2",children:[e("div",{className:"text-[11px] font-semibold text-error",children:"Search failed"}),e("div",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-[10.5px] text-ink/70",children:P}),b&&e("div",{className:"mt-1 text-[10.5px] text-ink/50",children:["Regex is on — escape metacharacters such as ",e("code",{className:"font-mono",children:"( ) [ ] * ? +"})," or turn it off to search literally."]})]})}):U&&C.length===0?e("div",{className:"flex-1 text-ink/40 italic text-center py-4",children:"Searching..."}):r.trim().length<=2?e("div",{className:"flex-1 text-ink/40 italic text-center py-4",children:"Type at least 3 characters to search."}):C.length===0?e("div",{className:"flex-1 text-ink/40 italic text-center py-4",children:"No results found."}):e(d,{children:[P&&e("div",{className:"px-3 pt-2 text-[10.5px] text-error",role:"alert",children:["Search failed: ",e("span",{className:"font-mono",children:P})]}),U&&e("div",{className:"px-3 pt-2 text-ink/40 italic",children:"Searching…"}),H&&e("div",{className:"px-3 pt-2 text-ink/50 italic",children:["Showing the first ",ne," matches — refine the query to see the rest."]}),e(ce,{groups:Q,replacement:h,showReplacePreview:h.length>0,onOpen:de,onReplaceFile:pe,replaceBusy:J})]})]})}function he(s){let[r,t]=n({scope:s,results:[],truncated:!1,error:null}),[h,c]=n(!1),l=o(null),m=o(!0),k=o(s);k.current=s,i(()=>(m.current=!0,()=>{m.current=!1,l.current?.abort(),l.current=null}),[]);let p=a(async(b)=>{l.current?.abort();let w=new AbortController;l.current=w;let x=k.current;t({scope:x,results:[],truncated:!1,error:null}),c(!0);try{let M=await fetch("/api/fs/search",{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:new URLSearchParams(b),signal:w.signal});await ql(M,(E,A)=>{if(k.current!==x)return;if(E==="done"){let v=!1;try{v=JSON.parse(A)?.truncated===!0}catch{}t((R)=>R.scope===x?{...R,truncated:v}:R);return}if(E==="error"){let v="Search failed";try{v=JSON.parse(A)?.error||v}catch{}t((R)=>R.scope===x?{...R,error:v}:R);return}if(E!=="matches")return;try{let v=JSON.parse(A);if(Array.isArray(v))t((R)=>R.scope===x?{...R,results:[...R.results,...v]}:R)}catch{}},w.signal)}catch{}finally{if(m.current&&l.current===w)l.current=null,c(!1)}},[]);return{results:r.scope===s?r.results:[],isSearching:h&&r.scope===s,truncated:r.scope===s&&r.truncated,error:r.scope===s?r.error:null,start:p}}function st({className:s="",enabled:r=!0,rootPath:t,onOpenFile:h}){let[c,l]=S("search.query",""),[m,k]=S("search.replaceQuery",""),[p,b]=S("search.matchCase",!1),[w,x]=S("search.wholeWord",!1),[M,E]=S("search.useRegex",!1),[A,v]=S("search.includeFiles",""),[R,W]=n(!1),[L,z]=S("search.showIncludeField",!1),{activeRepo:O,setActiveRepo:g}=ir(t),{repos:N,scanning:I,rescan:C}=or(t,r),U=o(null),H=at(),{results:P,isSearching:q,truncated:G,error:J,start:Q}=he(`${t??""}\x00${O}`);le(U,()=>W(!1));let B=a(()=>{if(!r)return;if(c.trim().length>2)return Q({q:c,matchCase:String(p),wholeWord:String(w),useRegex:String(M),includeFiles:L?A:"",...t?{root:t}:{},...O!=="."?{repo:O}:{}})},[r,c,p,w,M,L,A,t,O,Q]);i(()=>{let D=setTimeout(()=>{B()},300);return()=>clearTimeout(D)},[B]);let X=a((D)=>{if(!c)return;let j=D?[D]:Array.from(new Set(P.map((K)=>K.file)));if(j.length===0)return;H.submit({q:c,replaceWith:m,matchCase:String(p),wholeWord:String(w),useRegex:String(M),files:JSON.stringify(j),...t?{root:t}:{},...O!=="."?{repo:O}:{}},{method:"POST",action:"/api/fs/replace"})},[c,m,p,w,M,P,t,O,H]);if(i(()=>{if(H.state==="idle"&&H.data?.success)B()},[H.state,H.data,B]),!r)return e("div",{className:`flex flex-col h-full bg-paper items-center justify-center text-ink/40 ${s}`,children:e("span",{className:"text-xs font-mono text-muted",children:"No session selected"})});return e(ue,{className:s,query:c,setQuery:l,replaceQuery:m,setReplaceQuery:k,matchCase:p,setMatchCase:b,wholeWord:w,setWholeWord:x,useRegex:M,setUseRegex:E,includeFiles:A,setIncludeFiles:v,showIncludeField:L,setShowIncludeField:z,showMenu:R,setShowMenu:W,menuRef:U,rootPath:t,activeRepo:O,setActiveRepo:g,repos:N,reposScanning:I,rescanRepos:C,results:P,isSearching:q,truncated:G,error:J,onOpenFile:h,handleReplace:X,replaceBusy:H.state!=="idle"})}export{st as SearchPanel};
1
+ import{d,n,i,V,o,u,a,Ht,e,S,ir,or,Be,Fo,f,Po,Oo,$o,F,Uo,b,ce,eo,Ls,rt,at,dt,Ru,Hl}from"./index-ncrenheb.js";import{fr}from"./index-p16scjt7.js";var fe=2000,_=new Map;function me(s){if(s.length===0)return"";let r="";for(let t of s)r+=`${t.start}-${t.end},`;return r}function Z(s,r,t){let h=eo(r),c=`${r}\x00${me(t)}\x00${s}`;if(h){let m=_.get(c);if(m!==void 0)return _.delete(c),_.set(c,m),m}let l=Ls(s,r,{marks:t});if(!h)return l;if(_.set(c,l),_.size>fe){let m=_.keys().next();if(!m.done)_.delete(m.value)}return l}function ee(s,r,t){let h=[],c=0;for(let l of r){if(l.start<c||l.end<=l.start||l.end>s.length)continue;if(l.start>c)h.push({text:s.slice(c,l.start),kind:"plain"});if(h.push({text:s.slice(l.start,l.end),kind:"removed"}),t)h.push({text:t,kind:"inserted"});c=l.end}if(c<s.length)h.push({text:s.slice(c),kind:"plain"});return h}function ge({file:s,result:r,replacement:t,showReplacePreview:h,onOpen:c}){let l=r.ranges??[],m=h&&t.length>0;return e("button",{type:"button",onClick:()=>c(r),className:"flex w-full items-start gap-2 rounded px-1 py-0.5 text-left hover:bg-ink/5 cursor-pointer",title:`Open ${s}:${r.line}`,children:[e("span",{className:"w-6 flex-shrink-0 text-right font-mono text-ink/40",children:r.line}),m?e("span",{className:"min-w-0 truncate font-mono text-ink",children:ee(r.content,l,t).map((R,p)=>R.kind==="plain"?e("span",{children:R.text},p):R.kind==="removed"?e("del",{className:"search-replace-old",children:R.text},p):e("ins",{className:"search-replace-new",children:R.text},p))}):e("span",{className:"min-w-0 truncate font-mono text-ink",dangerouslySetInnerHTML:{__html:Z(r.content,dt(s),l)}})]})}var te=Ht(ge);var Y={header:4,hit:4,group:16},re={headerBox:16,hitBox:20},ne=5000;function se(s){let r=[],t=null;for(let h of s){if(!t||t.file!==h.file)t={file:h.file,results:[]},r.push(t);t.results.push(h)}return r}function oe(s){let r=[];for(let t of s){r.push({kind:"group",file:t.file,count:t.results.length});for(let h=0;h<t.results.length;h++)r.push({kind:"hit",file:t.file,result:t.results[h],last:h===t.results.length-1})}return r}function xe(s,r){if(s.kind==="group")return r.headerBox+Y.header;return r.hitBox+(s.last?Y.group:Y.hit)}function ie(s,r){let t=Array(s.length),h=Array(s.length),c=0;for(let l=0;l<s.length;l++){let m=xe(s[l],r);t[l]=c,h[l]=m,c+=m}return{offsets:t,heights:h,total:c}}function ae(s,r,t,h,c=240){if(s.length===0)return{start:0,end:0};let l=Math.max(0,t),m=l-c,R=l+h+c,p=0,v=s.length-1;while(p<v){let x=p+v>>1;if(s[x]+r[x]>m)v=x;else p=x+1}let w=p;p=w,v=s.length;while(p<v){let x=p+v>>1;if(s[x]>=R)v=x;else p=x+1}return{start:w,end:p}}var be=8,Se=8;function le({groups:s,replacement:r,showReplacePreview:t,onOpen:h,onReplaceFile:c,replaceBusy:l}){let m=o(null),R=o(null),p=u(()=>oe(s),[s]),[v,w]=n(re),x=u(()=>ie(p,v),[p,v]),[M,E]=n(()=>({start:0,end:Math.min(p.length,60)})),A=a((g)=>{m.current=g},[]),k=a(()=>{let g=m.current;if(!g)return;let N=ae(x.offsets,x.heights,g.scrollTop,g.clientHeight);E((I)=>I.start===N.start&&I.end===N.end?I:N)},[x]),y=a(()=>{k()},[k]);V(()=>{let g=R.current;if(!g)return;let N=g.querySelector("[data-search-header] > div")?.offsetHeight??0,I=g.querySelector("[data-search-hit] > button")?.offsetHeight??0;if(N>0&&N!==v.headerBox)w((C)=>({...C,headerBox:N}));if(I>0&&I!==v.hitBox)w((C)=>({...C,hitBox:I}))},[M,v,p]),V(()=>{k()},[k]),V(()=>{let g=m.current;if(!g||typeof ResizeObserver>"u")return;let N=new ResizeObserver(()=>k());return N.observe(g),()=>N.disconnect()},[k]);let W=p.length===0?0:Math.min(M.start,p.length-1),L=Math.min(M.end,p.length),z=p.slice(W,L),O=L<p.length?x.total-x.offsets[L]:0;return e("div",{ref:A,onScroll:y,className:"flex-1 scrollbar-overlay-container px-3 text-xs",style:{overflowAnchor:"none"},children:[e("div",{style:{height:be+(x.offsets[W]??0)},"aria-hidden":"true"}),e("div",{ref:R,children:z.map((g,N)=>{let I=W+N,C=x.heights[I];if(g.kind==="group")return e("div",{"data-search-header":"",style:{height:C},children:e("div",{className:"font-semibold text-ink/80 flex items-center justify-between group",children:[e("div",{className:"flex items-center min-w-0",children:[e(rt,{name:g.file,size:12,className:"mr-1.5 flex-shrink-0"}),e("span",{className:"truncate",children:g.file}),e("span",{className:"ml-2 bg-ink/10 text-[10px] px-1.5 py-0.5 rounded-full flex-shrink-0",children:g.count})]}),e("button",{onClick:()=>c(g.file),disabled:l,className:"touch-visible opacity-0 group-hover:opacity-100 p-1 text-ink/40 hover:text-ink rounded hover:bg-ink/5 disabled:opacity-50 flex-shrink-0",title:"Replace in this file",children:e($o,{size:12})})]})},`group:${g.file}`);return e("div",{"data-search-hit":"",style:{height:C},children:e(te,{file:g.file,result:g.result,replacement:r,showReplacePreview:t,onOpen:h})},`hit:${g.file}:${g.result.line}:${I}`)})}),e("div",{style:{height:Se+O},"aria-hidden":"true"})]})}function ue({className:s,query:r,setQuery:t,replaceQuery:h,setReplaceQuery:c,matchCase:l,setMatchCase:m,wholeWord:R,setWholeWord:p,useRegex:v,setUseRegex:w,includeFiles:x,setIncludeFiles:M,showIncludeField:E,setShowIncludeField:A,showMenu:k,setShowMenu:y,menuRef:W,rootPath:L,activeRepo:z,setActiveRepo:O,repos:g,reposScanning:N,rescanRepos:I,results:C,isSearching:U,truncated:H,error:P,onOpenFile:q,handleReplace:G,replaceBusy:J}){let Q=u(()=>se(C),[C]),B=o(null),X=o(null),D=a(()=>{t(""),B.current?.focus()},[t]),j=a(()=>{c(""),X.current?.focus()},[c]),K=u(()=>({matchCase:l,wholeWord:R,isRegex:v,inSelection:!1}),[l,R,v]),de=a((T)=>{Ru({path:T.file,line:Number(T.line),query:r,options:K}),q?.({path:T.file,name:T.file.split("/").pop()||T.file,root:L,repo:z})},[r,K,L,z,q]),pe=a((T)=>G(T),[G]);return e("div",{className:`flex flex-col h-full bg-paper ${s}`,children:[e("div",{className:"p-3 border-b border-ink/10 flex items-center justify-between",children:[e("div",{className:"flex items-center space-x-2 min-w-0",children:[e("h2",{className:"text-xs font-semibold text-ink uppercase tracking-wider",children:"Search"}),e(fr,{rootPath:L,activeRepo:z,onSelectRepo:O,repos:g,scanning:N,onRefreshRepos:I})]}),e("div",{className:"relative",ref:W,children:[e("button",{onClick:()=>y(!k),className:`p-1 rounded hover:bg-ink/5 transition-colors ${k||E?"text-ink":"text-ink/40"}`,title:"Search Options",children:e(Be,{size:14})}),k&&e("div",{className:"glass-popover absolute right-0 top-full mt-1 w-48 bg-paper border border-ink/10 rounded shadow-lg z-10 py-1",children:e("button",{onClick:()=>{if(A(!E),E)M("");y(!1)},className:"w-full px-3 py-1.5 text-left text-xs text-ink hover:bg-ink/5 flex items-center justify-between",children:[e("span",{children:"Files to include"}),E&&e(f,{size:12,className:"text-ink/60"})]})})]})]}),e("div",{className:"p-3 flex flex-col gap-2.5 border-b border-ink/10",children:[e("div",{className:"relative",children:e("div",{className:"flex items-center border border-ink/20 rounded bg-paper focus-within:border-ink/40 focus-within:ring-1 focus-within:ring-ink/10 transition-all",children:[e(F,{size:14,className:"ml-2 text-ink/40 flex-shrink-0"}),e("input",{ref:B,type:"text",placeholder:"Search",value:r,onChange:(T)=>t(T.currentTarget.value),className:"w-full bg-transparent border-none text-xs px-2 py-1.5 focus:outline-none text-ink placeholder-ink/35 min-w-0"}),r&&e("button",{type:"button",onClick:D,title:"Clear search","aria-label":"Clear search",className:"p-1 mr-0.5 rounded text-ink/40 hover:text-ink hover:bg-ink/5 flex-shrink-0",children:e(b,{size:12})}),e("div",{className:"flex items-center space-x-0.5 pr-1 text-ink/40 flex-shrink-0",children:[e("button",{onClick:()=>m(!l),className:`p-1 rounded hover:text-ink ${l?"bg-ink/10 text-ink":"hover:bg-ink/5"}`,title:"Match Case",children:e(Fo,{size:14})}),e("button",{onClick:()=>p(!R),className:`p-1 rounded hover:text-ink ${R?"bg-ink/10 text-ink":"hover:bg-ink/5"}`,title:"Match Whole Word",children:e(Uo,{size:14})}),e("button",{onClick:()=>w(!v),className:`p-1 rounded hover:text-ink ${v?"bg-ink/10 text-ink":"hover:bg-ink/5"}`,title:"Use Regular Expression",children:e(Po,{size:14})})]})]})}),e("div",{className:"relative flex items-center space-x-1",children:[e("div",{className:"flex flex-1 min-w-0 items-center border border-ink/20 rounded bg-paper focus-within:border-ink/40 focus-within:ring-1 focus-within:ring-ink/10 transition-all",children:[e("input",{ref:X,type:"text",placeholder:"Replace",value:h,onChange:(T)=>c(T.currentTarget.value),className:"flex-1 min-w-0 bg-transparent border-none text-xs px-2 py-1.5 focus:outline-none text-ink placeholder-ink/35"}),h&&e("button",{type:"button",onClick:j,title:"Clear replace","aria-label":"Clear replace",className:"p-1 mr-0.5 rounded text-ink/40 hover:text-ink hover:bg-ink/5 flex-shrink-0",children:e(b,{size:12})})]}),e("button",{onClick:()=>G(),disabled:C.length===0||J,className:"p-1.5 rounded border border-ink/20 text-ink/60 hover:text-ink hover:bg-ink/5 disabled:opacity-50 disabled:cursor-not-allowed bg-paper",title:"Replace All",children:e(Oo,{size:14})})]}),E&&e("div",{className:"relative",children:e("input",{type:"text",value:x,onChange:(T)=>M(T.currentTarget.value),placeholder:"Files to include (e.g. *.js, src/*)",className:"w-full bg-paper border border-ink/20 rounded text-xs px-2 py-1.5 focus:outline-none focus:border-ink/40 focus:ring-1 focus:ring-ink/10 transition-all text-ink placeholder-ink/40"})})]}),P&&C.length===0?e("div",{className:"flex-1 px-3 py-3",role:"alert",children:e("div",{className:"rounded border border-error/30 bg-error/5 px-2.5 py-2",children:[e("div",{className:"text-[11px] font-semibold text-error",children:"Search failed"}),e("div",{className:"mt-1 whitespace-pre-wrap break-words font-mono text-[10.5px] text-ink/70",children:P}),v&&e("div",{className:"mt-1 text-[10.5px] text-ink/50",children:["Regex is on — escape metacharacters such as ",e("code",{className:"font-mono",children:"( ) [ ] * ? +"})," or turn it off to search literally."]})]})}):U&&C.length===0?e("div",{className:"flex-1 text-ink/40 italic text-center py-4",children:"Searching..."}):r.trim().length<=2?e("div",{className:"flex-1 text-ink/40 italic text-center py-4",children:"Type at least 3 characters to search."}):C.length===0?e("div",{className:"flex-1 text-ink/40 italic text-center py-4",children:"No results found."}):e(d,{children:[P&&e("div",{className:"px-3 pt-2 text-[10.5px] text-error",role:"alert",children:["Search failed: ",e("span",{className:"font-mono",children:P})]}),U&&e("div",{className:"px-3 pt-2 text-ink/40 italic",children:"Searching…"}),H&&e("div",{className:"px-3 pt-2 text-ink/50 italic",children:["Showing the first ",ne," matches — refine the query to see the rest."]}),e(le,{groups:Q,replacement:h,showReplacePreview:h.length>0,onOpen:de,onReplaceFile:pe,replaceBusy:J})]})]})}function he(s){let[r,t]=n({scope:s,results:[],truncated:!1,error:null}),[h,c]=n(!1),l=o(null),m=o(!0),R=o(s);R.current=s,i(()=>(m.current=!0,()=>{m.current=!1,l.current?.abort(),l.current=null}),[]);let p=a(async(v)=>{l.current?.abort();let w=new AbortController;l.current=w;let x=R.current;t({scope:x,results:[],truncated:!1,error:null}),c(!0);try{let M=await fetch("/api/fs/search",{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:new URLSearchParams(v),signal:w.signal});await Hl(M,(E,A)=>{if(R.current!==x)return;if(E==="done"){let k=!1;try{k=JSON.parse(A)?.truncated===!0}catch{}t((y)=>y.scope===x?{...y,truncated:k}:y);return}if(E==="error"){let k="Search failed";try{k=JSON.parse(A)?.error||k}catch{}t((y)=>y.scope===x?{...y,error:k}:y);return}if(E!=="matches")return;try{let k=JSON.parse(A);if(Array.isArray(k))t((y)=>y.scope===x?{...y,results:[...y.results,...k]}:y)}catch{}},w.signal)}catch{}finally{if(m.current&&l.current===w)l.current=null,c(!1)}},[]);return{results:r.scope===s?r.results:[],isSearching:h&&r.scope===s,truncated:r.scope===s&&r.truncated,error:r.scope===s?r.error:null,start:p}}function st({className:s="",enabled:r=!0,rootPath:t,onOpenFile:h}){let[c,l]=S("search.query",""),[m,R]=S("search.replaceQuery",""),[p,v]=S("search.matchCase",!1),[w,x]=S("search.wholeWord",!1),[M,E]=S("search.useRegex",!1),[A,k]=S("search.includeFiles",""),[y,W]=n(!1),[L,z]=S("search.showIncludeField",!1),{activeRepo:O,setActiveRepo:g}=ir(t),{repos:N,scanning:I,rescan:C}=or(t,r),U=o(null),H=at(),{results:P,isSearching:q,truncated:G,error:J,start:Q}=he(`${t??""}\x00${O}`);ce(U,()=>W(!1));let B=a(()=>{if(!r)return;if(c.trim().length>2)return Q({q:c,matchCase:String(p),wholeWord:String(w),useRegex:String(M),includeFiles:L?A:"",...t?{root:t}:{},...O!=="."?{repo:O}:{}})},[r,c,p,w,M,L,A,t,O,Q]);i(()=>{let D=setTimeout(()=>{B()},300);return()=>clearTimeout(D)},[B]);let X=a((D)=>{if(!c)return;let j=D?[D]:Array.from(new Set(P.map((K)=>K.file)));if(j.length===0)return;H.submit({q:c,replaceWith:m,matchCase:String(p),wholeWord:String(w),useRegex:String(M),files:JSON.stringify(j),...t?{root:t}:{},...O!=="."?{repo:O}:{}},{method:"POST",action:"/api/fs/replace"})},[c,m,p,w,M,P,t,O,H]);if(i(()=>{if(H.state==="idle"&&H.data?.success)B()},[H.state,H.data,B]),!r)return e("div",{className:`flex flex-col h-full bg-paper items-center justify-center text-ink/40 ${s}`,children:e("span",{className:"text-xs font-mono text-muted",children:"No session selected"})});return e(ue,{className:s,query:c,setQuery:l,replaceQuery:m,setReplaceQuery:R,matchCase:p,setMatchCase:v,wholeWord:w,setWholeWord:x,useRegex:M,setUseRegex:E,includeFiles:A,setIncludeFiles:k,showIncludeField:L,setShowIncludeField:z,showMenu:y,setShowMenu:W,menuRef:U,rootPath:t,activeRepo:O,setActiveRepo:g,repos:N,reposScanning:I,rescanRepos:C,results:P,isSearching:q,truncated:G,error:J,onOpenFile:h,handleReplace:X,replaceBusy:H.state!=="idle"})}export{st as SearchPanel};
@@ -1,2 +1,2 @@
1
- var e=Object.freeze(JSON.parse(`{"displayName":"R","fileTypes":["R","r","Rprofile"],"foldingStartMarker":"\\\\{\\\\s*(?:#|$)","foldingStopMarker":"^\\\\s*}","name":"r","patterns":[{"include":"#roxygen-example"},{"include":"#basic"}],"repository":{"basic":{"patterns":[{"include":"#roxygen"},{"include":"#comment"},{"include":"#expression"}]},"basic-roxygen-example":{"patterns":[{"match":"^\\\\s*#+'","name":"comment.line"},{"include":"#comment"},{"include":"#expression"}]},"brackets":{"patterns":[{"begin":"\\\\{","end":"}","name":"meta.bracket","patterns":[{"include":"#basic"}]},{"begin":"\\\\[","end":"]","name":"meta.bracket","patterns":[{"captures":{"1":{"name":"variable.parameter"}},"match":"([.\\\\w]+)\\\\s*(?==[^=])"},{"include":"#basic"}]},{"begin":"\\\\(","end":"\\\\)","name":"meta.bracket","patterns":[{"captures":{"1":{"name":"variable.parameter"}},"match":"([.\\\\w]+)\\\\s*(?==[^=])"},{"include":"#basic"}]}]},"comment":{"match":"#.*","name":"comment.line"},"escape-code":{"match":"\\\\\\\\[\\"'\\\\\\\\\`abefnrtv]","name":"constant.character.escape"},"escape-hex":{"match":"\\\\\\\\x\\\\h+","name":"constant.numeric"},"escape-invalid":{"match":"\\\\\\\\.","name":"invalid"},"escape-octal":{"match":"\\\\\\\\\\\\d{1,3}","name":"constant.character.escape"},"escape-unicode":{"match":"\\\\\\\\[Uu](?:\\\\h+|\\\\{\\\\h+})","name":"constant.character.escape"},"escapes":{"patterns":[{"include":"#escape-code"},{"include":"#escape-hex"},{"include":"#escape-octal"},{"include":"#escape-unicode"},{"include":"#escape-invalid"}]},"expression":{"patterns":[{"include":"#brackets"},{"include":"#raw-strings"},{"include":"#strings"},{"include":"#function-definition"},{"include":"#keywords"},{"include":"#namespace-call"},{"include":"#function-call"},{"include":"#identifiers"},{"include":"#numbers"},{"include":"#operators"}]},"function-call":{"captures":{"0":{"name":"meta.function-call"},"1":{"name":"entity.name.function"}},"match":"([.\\\\w]+)(?=\\\\()"},"function-definition":{"begin":"(function)\\\\s*(\\\\()","beginCaptures":{"1":{"name":"keyword.other"},"2":{"name":"meta.bracket"}},"end":"(\\\\))","endCaptures":{"1":{"name":"meta.bracket"}},"name":"meta.function.definition","patterns":[{"begin":"([.\\\\w]+)","beginCaptures":{"1":{"name":"variable.parameter"}},"end":"(?=[),])","patterns":[{"include":"#basic"}]},{"include":"#basic"}]},"identifier-quoted":{"begin":"\`","end":"\`","name":"variable.object","patterns":[{"match":"\\\\\\\\\`"}]},"identifier-syntactic":{"match":"[.\\\\p{L}\\\\p{Nl}][.\\\\p{L}\\\\p{Nl}\\\\p{Mn}\\\\p{Mc}\\\\d\\\\p{Pc}]*","name":"variable.object"},"identifiers":{"patterns":[{"include":"#identifier-syntactic"},{"include":"#identifier-quoted"}]},"keywords":{"patterns":[{"include":"#keywords-control"},{"include":"#keywords-builtin"},{"include":"#keywords-constant"}]},"keywords-builtin":{"match":"(?:setGroupGeneric|setRefClass|setGeneric|NextMethod|setMethod|UseMethod|tryCatch|setClass|warning|require|library|R6Class|return|switch|attach|detach|source|stop|try)(?=\\\\()","name":"keyword.other"},"keywords-constant":{"match":"(?:NA_character_|NA_integer_|NA_complex_|NA_real_|TRUE|FALSE|NULL|Inf|NaN|NA)\\\\b","name":"constant.language"},"keywords-control":{"match":"(?:\\\\\\\\|function|if|else|in|break|next|repeat|for|while)\\\\b","name":"keyword"},"latex":{"patterns":[{"match":"\\\\\\\\\\\\w+","name":"keyword.other"}]},"markdown":{"patterns":[{"begin":"(\`{3,})\\\\s*(.*)","beginCaptures":{"1":{"name":"comment.line"},"2":{"name":"entity.name.section"}},"end":"(\\\\1)","endCaptures":{"1":{"name":"comment.line"}},"patterns":[{"match":"^\\\\s*#+'","name":"comment.line"}]},{"captures":{"1":{"name":"meta.bracket"},"2":{"name":"variable.object"},"3":{"name":"keyword.operator"},"4":{"name":"entity.name.function"},"5":{"name":"meta.bracket"},"6":{"name":"meta.bracket"}},"match":"(\\\\[)(?:(\\\\w+)(:{2,3}))?(\\\\w+)(\\\\(\\\\))?(])"},{"match":"(\\\\s+|^)(__.+?__)\\\\b","name":"markdown.bold"},{"match":"(\\\\s+|^)(_(?=[^_])(?:\\\\\\\\.|[^\\\\\\\\_])*?_)\\\\b","name":"markdown.italic"},{"match":"(\\\\*\\\\*.+?\\\\*\\\\*)","name":"markdown.bold"},{"match":"(\\\\*(?=[^*\\\\s])(?:\\\\\\\\.|[^*\\\\\\\\])*?\\\\*)","name":"markdown.italic"},{"match":"(\`(?:[^\\\\\\\\\`]|\\\\\\\\.)*\`)","name":"markup.quote"},{"match":"(<)([^>]*)(>)","name":"markup.underline.link"}]},"namespace-call":{"captures":{"1":{"name":"entity.name.namespace.r"},"2":{"name":"keyword.operator"}},"match":"(?<![.0-9A-Z_a-z])([.A-Z_a-z][.0-9A-Z_a-z]*)(:::?)"},"numbers":{"patterns":[{"match":"0[Xx]\\\\h+(?:p[-+]?\\\\d+)?[Li]?","name":"constant.numeric"},{"match":"(?:\\\\d+(?:\\\\.\\\\d*)?|\\\\.\\\\d+)(?:[Ee][-+]?\\\\d*)?[Li]?","name":"constant.numeric"}]},"operators":{"match":"%.*?%|:::?|:=|\\\\|>|=>|%%|>=|<=|==|!=|<<-|->>?|<-|\\\\|\\\\||&&|[-+=]|\\\\*\\\\*?|[!$\\\\&,/:<>?@^|~]","name":"keyword.operator"},"qqstring":{"begin":"\\"","end":"\\"","name":"string.quoted.double","patterns":[{"include":"#escapes"}]},"qstring":{"begin":"'","end":"'","name":"string.quoted.single","patterns":[{"include":"#escapes"}]},"raw-strings":{"name":"string.quoted.other","patterns":[{"begin":"[Rr]\\"(-*)\\\\{","end":"}\\\\1\\"","name":"string.quoted.other"},{"begin":"[Rr]'(-*)\\\\{","end":"}\\\\1'","name":"string.quoted.other"},{"begin":"[Rr]\\"(-*)\\\\[","end":"]\\\\1\\"","name":"string.quoted.other"},{"begin":"[Rr]'(-*)\\\\[","end":"]\\\\1'","name":"string.quoted.other"},{"begin":"[Rr]\\"(-*)\\\\(","end":"\\\\)\\\\1\\"","name":"string.quoted.other"},{"begin":"[Rr]'(-*)\\\\(","end":"\\\\)\\\\1'","name":"string.quoted.other"}]},"roxygen":{"begin":"^(\\\\s*#+')","beginCaptures":{"1":{"name":"comment.line.roxygen"}},"end":"$","patterns":[{"include":"#markdown"},{"include":"#roxygen-tokens"},{"include":"#latex"},{"match":".","name":"comment.line"}]},"roxygen-example":{"begin":"^(\\\\s*#+')\\\\s*(?:(@examples)\\\\s*|(@examplesIf)\\\\s+(.*))$","beginCaptures":{"1":{"name":"comment.line"},"2":{"name":"keyword.other"},"3":{"name":"keyword.other"},"4":{"patterns":[{"include":"#expression"}]}},"end":"^(?:\\\\s*(?=#+'\\\\s*@)|\\\\s*(?!#+'))","patterns":[{"match":"^\\\\s*#+'","name":"comment.line"},{"match":"[]()\\\\[{}]","name":"meta.bracket"},{"include":"#latex"},{"include":"#roxygen-tokens"},{"include":"#basic-roxygen-example"}]},"roxygen-tokens":{"patterns":[{"match":"@@","name":"constant.character.escape"},{"begin":"(@(?:param|field|slot))\\\\s*","beginCaptures":{"1":{"name":"keyword.other"}},"end":"\\\\s|$","patterns":[{"match":"([.\\\\w]+)","name":"variable.parameter"},{"match":",","name":"keyword.operator"}]},{"match":"@(?!@)\\\\w*","name":"keyword.other"}]},"strings":{"patterns":[{"include":"#qstring"},{"include":"#qqstring"}]}},"scopeName":"source.r"}`)),_f=[e];
2
- export{_f};
1
+ var e=Object.freeze(JSON.parse(`{"displayName":"R","fileTypes":["R","r","Rprofile"],"foldingStartMarker":"\\\\{\\\\s*(?:#|$)","foldingStopMarker":"^\\\\s*}","name":"r","patterns":[{"include":"#roxygen-example"},{"include":"#basic"}],"repository":{"basic":{"patterns":[{"include":"#roxygen"},{"include":"#comment"},{"include":"#expression"}]},"basic-roxygen-example":{"patterns":[{"match":"^\\\\s*#+'","name":"comment.line"},{"include":"#comment"},{"include":"#expression"}]},"brackets":{"patterns":[{"begin":"\\\\{","end":"}","name":"meta.bracket","patterns":[{"include":"#basic"}]},{"begin":"\\\\[","end":"]","name":"meta.bracket","patterns":[{"captures":{"1":{"name":"variable.parameter"}},"match":"([.\\\\w]+)\\\\s*(?==[^=])"},{"include":"#basic"}]},{"begin":"\\\\(","end":"\\\\)","name":"meta.bracket","patterns":[{"captures":{"1":{"name":"variable.parameter"}},"match":"([.\\\\w]+)\\\\s*(?==[^=])"},{"include":"#basic"}]}]},"comment":{"match":"#.*","name":"comment.line"},"escape-code":{"match":"\\\\\\\\[\\"'\\\\\\\\\`abefnrtv]","name":"constant.character.escape"},"escape-hex":{"match":"\\\\\\\\x\\\\h+","name":"constant.numeric"},"escape-invalid":{"match":"\\\\\\\\.","name":"invalid"},"escape-octal":{"match":"\\\\\\\\\\\\d{1,3}","name":"constant.character.escape"},"escape-unicode":{"match":"\\\\\\\\[Uu](?:\\\\h+|\\\\{\\\\h+})","name":"constant.character.escape"},"escapes":{"patterns":[{"include":"#escape-code"},{"include":"#escape-hex"},{"include":"#escape-octal"},{"include":"#escape-unicode"},{"include":"#escape-invalid"}]},"expression":{"patterns":[{"include":"#brackets"},{"include":"#raw-strings"},{"include":"#strings"},{"include":"#function-definition"},{"include":"#keywords"},{"include":"#namespace-call"},{"include":"#function-call"},{"include":"#identifiers"},{"include":"#numbers"},{"include":"#operators"}]},"function-call":{"captures":{"0":{"name":"meta.function-call"},"1":{"name":"entity.name.function"}},"match":"([.\\\\w]+)(?=\\\\()"},"function-definition":{"begin":"(function)\\\\s*(\\\\()","beginCaptures":{"1":{"name":"keyword.other"},"2":{"name":"meta.bracket"}},"end":"(\\\\))","endCaptures":{"1":{"name":"meta.bracket"}},"name":"meta.function.definition","patterns":[{"begin":"([.\\\\w]+)","beginCaptures":{"1":{"name":"variable.parameter"}},"end":"(?=[),])","patterns":[{"include":"#basic"}]},{"include":"#basic"}]},"identifier-quoted":{"begin":"\`","end":"\`","name":"variable.object","patterns":[{"match":"\\\\\\\\\`"}]},"identifier-syntactic":{"match":"[.\\\\p{L}\\\\p{Nl}][.\\\\p{L}\\\\p{Nl}\\\\p{Mn}\\\\p{Mc}\\\\d\\\\p{Pc}]*","name":"variable.object"},"identifiers":{"patterns":[{"include":"#identifier-syntactic"},{"include":"#identifier-quoted"}]},"keywords":{"patterns":[{"include":"#keywords-control"},{"include":"#keywords-builtin"},{"include":"#keywords-constant"}]},"keywords-builtin":{"match":"(?:setGroupGeneric|setRefClass|setGeneric|NextMethod|setMethod|UseMethod|tryCatch|setClass|warning|require|library|R6Class|return|switch|attach|detach|source|stop|try)(?=\\\\()","name":"keyword.other"},"keywords-constant":{"match":"(?:NA_character_|NA_integer_|NA_complex_|NA_real_|TRUE|FALSE|NULL|Inf|NaN|NA)\\\\b","name":"constant.language"},"keywords-control":{"match":"(?:\\\\\\\\|function|if|else|in|break|next|repeat|for|while)\\\\b","name":"keyword"},"latex":{"patterns":[{"match":"\\\\\\\\\\\\w+","name":"keyword.other"}]},"markdown":{"patterns":[{"begin":"(\`{3,})\\\\s*(.*)","beginCaptures":{"1":{"name":"comment.line"},"2":{"name":"entity.name.section"}},"end":"(\\\\1)","endCaptures":{"1":{"name":"comment.line"}},"patterns":[{"match":"^\\\\s*#+'","name":"comment.line"}]},{"captures":{"1":{"name":"meta.bracket"},"2":{"name":"variable.object"},"3":{"name":"keyword.operator"},"4":{"name":"entity.name.function"},"5":{"name":"meta.bracket"},"6":{"name":"meta.bracket"}},"match":"(\\\\[)(?:(\\\\w+)(:{2,3}))?(\\\\w+)(\\\\(\\\\))?(])"},{"match":"(\\\\s+|^)(__.+?__)\\\\b","name":"markdown.bold"},{"match":"(\\\\s+|^)(_(?=[^_])(?:\\\\\\\\.|[^\\\\\\\\_])*?_)\\\\b","name":"markdown.italic"},{"match":"(\\\\*\\\\*.+?\\\\*\\\\*)","name":"markdown.bold"},{"match":"(\\\\*(?=[^*\\\\s])(?:\\\\\\\\.|[^*\\\\\\\\])*?\\\\*)","name":"markdown.italic"},{"match":"(\`(?:[^\\\\\\\\\`]|\\\\\\\\.)*\`)","name":"markup.quote"},{"match":"(<)([^>]*)(>)","name":"markup.underline.link"}]},"namespace-call":{"captures":{"1":{"name":"entity.name.namespace.r"},"2":{"name":"keyword.operator"}},"match":"(?<![.0-9A-Z_a-z])([.A-Z_a-z][.0-9A-Z_a-z]*)(:::?)"},"numbers":{"patterns":[{"match":"0[Xx]\\\\h+(?:p[-+]?\\\\d+)?[Li]?","name":"constant.numeric"},{"match":"(?:\\\\d+(?:\\\\.\\\\d*)?|\\\\.\\\\d+)(?:[Ee][-+]?\\\\d*)?[Li]?","name":"constant.numeric"}]},"operators":{"match":"%.*?%|:::?|:=|\\\\|>|=>|%%|>=|<=|==|!=|<<-|->>?|<-|\\\\|\\\\||&&|[-+=]|\\\\*\\\\*?|[!$\\\\&,/:<>?@^|~]","name":"keyword.operator"},"qqstring":{"begin":"\\"","end":"\\"","name":"string.quoted.double","patterns":[{"include":"#escapes"}]},"qstring":{"begin":"'","end":"'","name":"string.quoted.single","patterns":[{"include":"#escapes"}]},"raw-strings":{"name":"string.quoted.other","patterns":[{"begin":"[Rr]\\"(-*)\\\\{","end":"}\\\\1\\"","name":"string.quoted.other"},{"begin":"[Rr]'(-*)\\\\{","end":"}\\\\1'","name":"string.quoted.other"},{"begin":"[Rr]\\"(-*)\\\\[","end":"]\\\\1\\"","name":"string.quoted.other"},{"begin":"[Rr]'(-*)\\\\[","end":"]\\\\1'","name":"string.quoted.other"},{"begin":"[Rr]\\"(-*)\\\\(","end":"\\\\)\\\\1\\"","name":"string.quoted.other"},{"begin":"[Rr]'(-*)\\\\(","end":"\\\\)\\\\1'","name":"string.quoted.other"}]},"roxygen":{"begin":"^(\\\\s*#+')","beginCaptures":{"1":{"name":"comment.line.roxygen"}},"end":"$","patterns":[{"include":"#markdown"},{"include":"#roxygen-tokens"},{"include":"#latex"},{"match":".","name":"comment.line"}]},"roxygen-example":{"begin":"^(\\\\s*#+')\\\\s*(?:(@examples)\\\\s*|(@examplesIf)\\\\s+(.*))$","beginCaptures":{"1":{"name":"comment.line"},"2":{"name":"keyword.other"},"3":{"name":"keyword.other"},"4":{"patterns":[{"include":"#expression"}]}},"end":"^(?:\\\\s*(?=#+'\\\\s*@)|\\\\s*(?!#+'))","patterns":[{"match":"^\\\\s*#+'","name":"comment.line"},{"match":"[]()\\\\[{}]","name":"meta.bracket"},{"include":"#latex"},{"include":"#roxygen-tokens"},{"include":"#basic-roxygen-example"}]},"roxygen-tokens":{"patterns":[{"match":"@@","name":"constant.character.escape"},{"begin":"(@(?:param|field|slot))\\\\s*","beginCaptures":{"1":{"name":"keyword.other"}},"end":"\\\\s|$","patterns":[{"match":"([.\\\\w]+)","name":"variable.parameter"},{"match":",","name":"keyword.operator"}]},{"match":"@(?!@)\\\\w*","name":"keyword.other"}]},"strings":{"patterns":[{"include":"#qstring"},{"include":"#qqstring"}]}},"scopeName":"source.r"}`)),Tf=[e];
2
+ export{Tf};
@@ -1,2 +1,2 @@
1
- import{n,i,V,o,de,e,s,Ee}from"./index-zt75xpq0.js";var _={name:"zoom-in",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]},_a=s(_);var M={name:"zoom-out",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]},Sa=s(M);function O({widths:r,pinned:a,available:c}){if(!(c>0)||r.length===0)return r.map(()=>!0);if(r.reduce((d,u)=>d+u,0)+4*(r.length-1)<=c)return r.map(()=>!0);let m=r.map(()=>!1),v=0,f=0;r.forEach((d,u)=>{if(!a[u])return;v+=d+(f>0?4:0),f+=1,m[u]=!0});let t=c-v-30-4;return r.forEach((d,u)=>{if(a[u])return;let x=d+(f>0?4:0);if(x>t)return;t-=x,f+=1,m[u]=!0}),m}function R(r){return r.some((a)=>!a)}function fo({clusters:r,className:a="",available:c}){let b=o(null),[m,v]=n(null),[f,t]=n(0),[d,u]=n(0),x=c??f,y=r.map((l)=>`${l.id}:${l.pinned?1:0}`).join("|"),h=m?.signature===y,g=h?m.widths:[],k=r.map((l)=>l.pinned===!0),w=c===0?r.map(()=>!1):g.length>0?O({widths:g,pinned:k,available:x}):r.map(()=>!0);V(()=>{let l=b.current;if(!l)return;if(!h){let p=[...l.querySelectorAll("[data-toolbar-cluster]")];if(p.length===r.length){let T=p.map((E)=>E.getBoundingClientRect().width);if(T.some((E)=>E>0))v({signature:y,widths:T})}}if(c===void 0)t(l.clientWidth)},[c,h,y,r.length,d]),i(()=>{let l=b.current;if(!l||typeof ResizeObserver>"u")return;let p=new ResizeObserver(()=>{t(l.clientWidth),u((T)=>T+1)});return p.observe(l),()=>p.disconnect()},[]);let L=r.filter((l,p)=>!w[p]).flatMap((l)=>l.actions);return e("div",{ref:b,style:c===void 0?void 0:{maxWidth:`${c}px`},className:`flex ${c===void 0?"flex-1":"flex-none"} min-w-0 flex-nowrap items-center justify-end gap-x-1 overflow-hidden ${a}`,children:[r.map((l,p)=>w[p]?e("div",{"data-toolbar-cluster":"",className:"flex items-center flex-shrink-0",children:l.children},l.id):null),R(w)&&e(A,{actions:L})]})}function A({actions:r}){let[a,c]=n(!1),[b,m]=n(null),v=o(null),f=o(null);return i(()=>{if(!a)return;let t=(d)=>{let u=d.target;if(v.current?.contains(u)||f.current?.contains(u))return;c(!1)};return document.addEventListener("mousedown",t),document.addEventListener("touchstart",t),()=>{document.removeEventListener("mousedown",t),document.removeEventListener("touchstart",t)}},[a]),i(()=>{if(!a)return;let t=(d)=>{if(d.key==="Escape")c(!1)};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[a]),V(()=>{if(!a)return;let t=v.current?.firstElementChild,d=f.current;if(!t||!d)return;let u=t.getBoundingClientRect(),{width:x,height:y}=d.getBoundingClientRect(),h=8,g=u.bottom+4,k=g+y+h<=window.innerHeight?g:Math.max(h,u.top-y-4),w=Math.max(h,Math.min(u.right-x,window.innerWidth-x-h));m({top:k,left:w})},[a,r.length]),e("div",{className:"relative flex-shrink-0",ref:v,children:[e("button",{type:"button",title:"More actions","aria-label":"More actions","aria-haspopup":"menu","aria-expanded":a,onClick:()=>{m(null),c(!a)},className:`flex items-center justify-center p-1.5 rounded transition-colors cursor-pointer ${a?"bg-ink/10 text-ink":"text-ink/50 hover:text-ink hover:bg-ink/5"}`,children:e(Ee,{size:14})}),a&&de(e("div",{ref:f,role:"menu",style:{top:b?.top??0,left:b?.left??0,visibility:b?"visible":"hidden"},className:"glass-popover fixed z-[80] w-52 bg-paper border border-ink/15 rounded-lg shadow-lg py-1 text-xs",children:r.map((t)=>e("button",{type:"button",role:"menuitem",disabled:t.disabled,"aria-pressed":t.active,onClick:()=>{c(!1),t.onSelect()},className:`w-full text-left flex items-center gap-2 px-3 py-1.5 transition-colors disabled:cursor-default disabled:opacity-40 ${t.active?"bg-ink/5 text-ink font-medium":"text-ink/75 hover:bg-ink/5 hover:text-ink"}`,children:[e(t.icon,{size:13,className:"flex-shrink-0"}),e("span",{className:"truncate",children:t.label})]},t.label))}),document.body)]})}
2
- export{_a,Sa,fo};
1
+ import{n,i,V,o,se,e,s,Be}from"./index-ncrenheb.js";var _={name:"zoom-in",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]},_a=s(_);var M={name:"zoom-out",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]},Sa=s(M);function O({widths:r,pinned:a,available:c}){if(!(c>0)||r.length===0)return r.map(()=>!0);if(r.reduce((d,u)=>d+u,0)+4*(r.length-1)<=c)return r.map(()=>!0);let m=r.map(()=>!1),v=0,f=0;r.forEach((d,u)=>{if(!a[u])return;v+=d+(f>0?4:0),f+=1,m[u]=!0});let t=c-v-30-4;return r.forEach((d,u)=>{if(a[u])return;let x=d+(f>0?4:0);if(x>t)return;t-=x,f+=1,m[u]=!0}),m}function R(r){return r.some((a)=>!a)}function Ao({clusters:r,className:a="",available:c}){let b=o(null),[m,v]=n(null),[f,t]=n(0),[d,u]=n(0),x=c??f,y=r.map((l)=>`${l.id}:${l.pinned?1:0}`).join("|"),h=m?.signature===y,g=h?m.widths:[],k=r.map((l)=>l.pinned===!0),w=c===0?r.map(()=>!1):g.length>0?O({widths:g,pinned:k,available:x}):r.map(()=>!0);V(()=>{let l=b.current;if(!l)return;if(!h){let p=[...l.querySelectorAll("[data-toolbar-cluster]")];if(p.length===r.length){let T=p.map((E)=>E.getBoundingClientRect().width);if(T.some((E)=>E>0))v({signature:y,widths:T})}}if(c===void 0)t(l.clientWidth)},[c,h,y,r.length,d]),i(()=>{let l=b.current;if(!l||typeof ResizeObserver>"u")return;let p=new ResizeObserver(()=>{t(l.clientWidth),u((T)=>T+1)});return p.observe(l),()=>p.disconnect()},[]);let L=r.filter((l,p)=>!w[p]).flatMap((l)=>l.actions);return e("div",{ref:b,style:c===void 0?void 0:{maxWidth:`${c}px`},className:`flex ${c===void 0?"flex-1":"flex-none"} min-w-0 flex-nowrap items-center justify-end gap-x-1 overflow-hidden ${a}`,children:[r.map((l,p)=>w[p]?e("div",{"data-toolbar-cluster":"",className:"flex items-center flex-shrink-0",children:l.children},l.id):null),R(w)&&e(A,{actions:L})]})}function A({actions:r}){let[a,c]=n(!1),[b,m]=n(null),v=o(null),f=o(null);return i(()=>{if(!a)return;let t=(d)=>{let u=d.target;if(v.current?.contains(u)||f.current?.contains(u))return;c(!1)};return document.addEventListener("mousedown",t),document.addEventListener("touchstart",t),()=>{document.removeEventListener("mousedown",t),document.removeEventListener("touchstart",t)}},[a]),i(()=>{if(!a)return;let t=(d)=>{if(d.key==="Escape")c(!1)};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[a]),V(()=>{if(!a)return;let t=v.current?.firstElementChild,d=f.current;if(!t||!d)return;let u=t.getBoundingClientRect(),{width:x,height:y}=d.getBoundingClientRect(),h=8,g=u.bottom+4,k=g+y+h<=window.innerHeight?g:Math.max(h,u.top-y-4),w=Math.max(h,Math.min(u.right-x,window.innerWidth-x-h));m({top:k,left:w})},[a,r.length]),e("div",{className:"relative flex-shrink-0",ref:v,children:[e("button",{type:"button",title:"More actions","aria-label":"More actions","aria-haspopup":"menu","aria-expanded":a,onClick:()=>{m(null),c(!a)},className:`flex items-center justify-center p-1.5 rounded transition-colors cursor-pointer ${a?"bg-ink/10 text-ink":"text-ink/50 hover:text-ink hover:bg-ink/5"}`,children:e(Be,{size:14})}),a&&se(e("div",{ref:f,role:"menu",style:{top:b?.top??0,left:b?.left??0,visibility:b?"visible":"hidden"},className:"glass-popover fixed z-[80] w-52 bg-paper border border-ink/15 rounded-lg shadow-lg py-1 text-xs",children:r.map((t)=>e("button",{type:"button",role:"menuitem",disabled:t.disabled,"aria-pressed":t.active,onClick:()=>{c(!1),t.onSelect()},className:`w-full text-left flex items-center gap-2 px-3 py-1.5 transition-colors disabled:cursor-default disabled:opacity-40 ${t.active?"bg-ink/5 text-ink font-medium":"text-ink/75 hover:bg-ink/5 hover:text-ink"}`,children:[e(t.icon,{size:13,className:"flex-shrink-0"}),e("span",{className:"truncate",children:t.label})]},t.label))}),document.body)]})}
2
+ export{_a,Sa,Ao};
@@ -1 +1 @@
1
- import{d,n,i,o,a,e,S,m,U,Vt,pa,De,C,Dn,y,og,Fp,Ru,sg,Wl}from"./index-zt75xpq0.js";import{cu}from"./index-e4p4cd3r.js";import"./index-9fjt5anh.js";var de={idle:"Kosong",loading:"Memuat",ready:"Siap"},V="p-1 rounded hover:bg-ink/5 disabled:opacity-25 disabled:hover:bg-transparent text-ink/70 hover:text-ink cursor-pointer disabled:cursor-not-allowed transition-colors";function K({url:t,input:s,loading:r,error:l,canGoBack:p,canGoForward:f,viewportMode:h,zoomLevel:c,onInputChange:b,onSubmit:A,onBack:M,onForward:T,onReload:w,onOpenExternal:E,onIncludeInChat:I,onChangeViewport:R,onZoomIn:N,onZoomOut:L,onResetZoom:u,onSetZoom:g,annotate:k}){let x=o(void 0);i(()=>{if(x.current===t)return;if(x.current=t,t)b(t)},[t,b]);let B=!t?"idle":r?"loading":"ready",O=B==="ready"?"bg-success animate-pulse":B==="loading"?"bg-ink/40 animate-pulse":"bg-ink/25",D=e("div",{className:"flex items-center bg-canvas border border-ink/10 rounded-md p-0.5 space-x-0.5 flex-shrink-0",children:[e("button",{type:"button",onClick:M,disabled:!p,"aria-label":"Back",title:"Back",className:V,children:e(Vt,{size:12})}),e("button",{type:"button",onClick:T,disabled:!f,"aria-label":"Maju",title:"Maju",className:V,children:e(pa,{size:12})}),e("button",{type:"button",onClick:w,disabled:!t,"aria-label":"Reload",title:"Reload",className:V,children:e(C,{size:12,className:r?"animate-spin":void 0})})]});return e(cu,{url:t,statusDotClass:O,statusLabel:de[B],viewportMode:h,zoomLevel:c,onChangeViewport:R,onZoomIn:N,onZoomOut:L,onResetZoom:u,onSetZoom:g,annotate:k,onIncludeInChat:I,onOpenExternal:E,openExternalLabel:"Buka di tab baru",openExternalTitle:"Buka di tab baru (untuk situs yang menolak iframe)",children:e("div",{className:"flex items-center flex-1 min-w-0 space-x-1.5",children:[D,e("form",{className:`flex-1 min-w-0 flex items-center bg-canvas border rounded-md px-2 py-0.5 space-x-1 focus-within:border-ink/40 ${l?"border-error":"border-ink/15"}`,onSubmit:(v)=>{v.preventDefault(),A(s)},children:[e(De,{size:12,className:"text-ink/40 flex-shrink-0"}),e("input",{type:"text",value:s,onChange:(v)=>b(v.currentTarget.value),placeholder:"Type an address (e.g. localhost:5173) and press Enter…","aria-label":"Browser address","aria-invalid":l!==void 0&&l!==null,title:l??void 0,spellcheck:!1,autoComplete:"off",className:`w-full min-w-0 bg-transparent outline-none font-mono text-[11px] placeholder:text-ink/35 ${l?"text-error":"text-ink/90"}`})]})]})})}var Z={"desktop-16-9":"w-full max-w-[1280px] aspect-video max-h-full border border-ink/20 rounded-lg shadow-md overflow-hidden my-auto",laptop:"w-[1024px] max-w-full h-[768px] max-h-full border border-ink/20 rounded-lg shadow-md overflow-hidden my-auto",tablet:"w-[768px] max-w-full h-[1024px] max-h-full border border-ink/20 rounded-lg shadow-md overflow-hidden my-auto",mobile:"w-[375px] max-w-full h-[667px] max-h-full border border-ink/20 rounded-xl shadow-md overflow-hidden my-auto","mobile-lg":"w-[414px] max-w-full h-[896px] max-h-full border border-ink/20 rounded-xl shadow-md overflow-hidden my-auto",responsive:"w-full h-full border-0"};var ce="clipboard-read; clipboard-write; fullscreen";function X({url:t,frameKey:s,loading:r,viewportMode:l,zoomLevel:p,onLoad:f,active:h=!0,overlay:c,onFrame:b}){if(!h)return null;if(!t)return e("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center select-none",children:[e("div",{className:"w-12 h-12 rounded-xl bg-ink/5 border border-ink/10 flex items-center justify-center text-ink/40 mb-3",children:e(De,{size:22})}),e("h3",{className:"text-sm font-semibold text-ink mb-1",children:"Browser Anda"}),e("p",{className:"text-xs text-ink/60 max-w-sm",children:"Type an address above and press Enter. The page loads inside this panel."}),e("p",{className:"text-[11px] text-ink/45 max-w-sm mt-2",children:"Sebagian situs (Google, GitHub) menolak ditampilkan dalam iframe — pakai tombol buka di tab baru."})]});return e("div",{className:"flex-1 min-h-0 relative flex items-center justify-center p-2 overflow-auto bg-canvas/60",children:[r?e("div",{className:"absolute inset-0 z-10 flex items-center justify-center pointer-events-none",children:e("div",{className:"flex items-center space-x-2 px-3 py-1.5 rounded-md bg-paper border border-ink/15",children:[e(m,{size:13,className:"animate-spin text-ink/50"}),e("span",{className:"text-[11px] font-mono text-ink/60",children:"Memuat…"})]})}):null,e("div",{className:`relative flex flex-col bg-white ${Z[l]} transition-all duration-200`,style:{zoom:p!==100?`${p}%`:void 0,transformOrigin:"top center"},children:[e("iframe",{ref:(A)=>b?.(A),src:t,title:"Browser pengguna",onLoad:f,referrerPolicy:"no-referrer",allow:ce,className:"w-full h-full bg-white border-0",style:c?{pointerEvents:"none"}:void 0},s),c]})]})}var W="w-full min-w-0 bg-canvas border border-ink/15 rounded px-2 py-1 text-[11px] font-mono text-ink placeholder:text-ink/35 focus:outline-none focus:border-ink/40";function ue(t){if(!t||t.ok)return null;if(t.reason==="cross-origin")return"This page is cross-origin, so its elements cannot be read. Name the part and add a note instead.";if(t.reason==="no-frame")return"The page has not loaded, so its elements cannot be read yet.";return"There is no element at this point (empty space). Name the part instead."}function Y({shape:t,index:s,readability:r,onLabel:l,onNote:p}){let f=ue(r),h=t.element;return e("div",{className:"flex items-start gap-1.5 min-w-0",children:[e("span",{className:"text-[11px] font-mono text-ink/45 pt-1 flex-shrink-0",children:[Ru[t.tool]," #",s]}),e("div",{className:"flex-1 min-w-0 space-y-1",children:[e("div",{className:"flex items-center gap-1 flex-wrap",children:[e("span",{className:"text-[10px] uppercase font-mono text-ink/40",children:"bagian"}),sg.map((c)=>{let b=t.label===c;return e("button",{type:"button",onClick:()=>l(b?"":c),"aria-pressed":b,className:`px-1.5 py-0.5 rounded-full border text-[10px] font-mono transition-colors cursor-pointer ${b?"bg-ink text-canvas border-ink":"bg-canvas text-ink/65 border-ink/15 hover:border-ink/40"}`,children:c},c)}),e("input",{value:t.label,onInput:(c)=>l(c.currentTarget.value),placeholder:"or type your own…","aria-label":"Name of the marked part",spellcheck:!1,className:`${W} flex-1 min-w-[110px]`})]}),e("textarea",{value:t.note,onInput:(c)=>p(c.currentTarget.value),placeholder:"What is wrong with this part? (e.g. the Pay button looks disabled)",rows:2,"aria-label":"Annotation note",className:`${W} resize-y`}),h?e("p",{className:"text-[10px] font-mono text-ink/45 truncate",title:h.path,children:["elemen: ",h.path,h.state?` · ${h.state}`:""]}):null,f?e("p",{className:"text-[10px] text-ink/40",children:f}):null]})]})}var me=["box","pin","arrow"],pe="px-2 py-1 rounded text-[11px] font-mono border transition-colors cursor-pointer",F="flex items-center gap-1 px-2 py-1 rounded text-[11px] border border-ink/15 hover:border-ink/40 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed";function j({tool:t,shapes:s,selectedId:r,readability:l,onTool:p,onLabel:f,onNote:h,onRemove:c,onReset:b,onCancel:A,onSend:M}){let T=s.find((E)=>E.id===r)??null,w=s.length>0;return e("div",{className:"flex-shrink-0 border-b border-ink/10 bg-paper px-2.5 py-1.5 space-y-1.5 select-none",children:[e("div",{className:"flex items-center gap-1.5",children:[e("span",{className:"text-[10px] uppercase font-mono text-ink/50 mr-1",children:"Anotasi"}),me.map((E)=>e("button",{type:"button",onClick:()=>p(E),"aria-pressed":t===E,className:`${pe} ${t===E?"bg-ink text-canvas border-ink":"bg-canvas text-ink/70 border-ink/15 hover:border-ink/40"}`,children:Ru[E]},E)),e("span",{className:"text-[11px] font-mono text-ink/45 ml-1",children:s.length>0?`${s.length} mark${s.length===1?"":"s"}`:"drag on the page to mark a part"}),e("div",{className:"flex-1"}),e("button",{type:"button",onClick:b,disabled:!w,className:F,title:"Clear all marks",children:[e(U,{size:12})," Bersihkan"]}),e("button",{type:"button",onClick:M,disabled:!w,className:F,title:"Kirim anotasi ke draft chat",children:[e(Dn,{size:12})," Kirim ke chat"]}),e("button",{type:"button",onClick:A,className:F,title:"Tutup mode anotasi",children:e(y,{size:12})})]}),T?e("div",{className:"flex items-start gap-1.5",children:[e("div",{className:"flex-1 min-w-0",children:e(Y,{shape:T,index:s.indexOf(T)+1,readability:l,onLabel:(E)=>f(T.id,E),onNote:(E)=>h(T.id,E)})}),e("button",{type:"button",onClick:()=>c(T.id),className:F,title:"Remove this mark",children:e(U,{size:12})})]}):e("p",{className:"text-[11px] text-ink/45",children:"This page cannot be screenshotted, so what gets sent is the area, the part name and your note."})]})}var q=0;function J(){return q+=1,`annot-${Date.now().toString(36)}-${q}`}function Q(t){let[s,r]=n(!1),[l,p]=n("box"),[f,h]=n([]),[c,b]=n(null);i(()=>{h([]),b(null)},[t]);let A=a(()=>{r((N)=>!N),b(null)},[]),M=a(()=>{b(null),r(!1)},[]),T=a((N)=>{h((L)=>[...L,N]),b(N.id)},[]),w=a((N,L)=>{h((u)=>u.map((g)=>g.id===N?{...g,note:L}:g))},[]),E=a((N,L)=>{h((u)=>u.map((g)=>g.id===N?{...g,label:L}:g))},[]),I=a((N)=>{h((L)=>L.filter((u)=>u.id!==N)),b((L)=>L===N?null:L)},[]),R=a(()=>{h([]),b(null)},[]);return{active:s,tool:l,shapes:f,selectedId:c,setTool:p,toggle:A,close:M,add:T,setNote:w,setLabel:E,select:b,remove:I,reset:R}}var fe=4,_="var(--theme-error)";function ee({shapes:t,tool:s,selectedId:r,onMeasure:l,onAdd:p,onSelect:f}){let h=o(null),c=o(null),[b,A]=n(null),[M,T]=n({width:0,height:0});i(()=>{let u=h.current;if(!u)return;let g=()=>{let x=u.getBoundingClientRect();if(x.width<=0||x.height<=0)return;T((B)=>B.width===x.width&&B.height===x.height?B:{width:x.width,height:x.height}),l({width:x.width,height:x.height})};if(g(),typeof ResizeObserver!=="function")return;let k=new ResizeObserver(g);return k.observe(u),()=>k.disconnect()},[l]);let w=(u)=>{let g=h.current;if(!g)return null;let k=g.getBoundingClientRect(),x={x:u.clientX-k.left,y:u.clientY-k.top};return{normalized:og(k,x),px:x.x,py:x.y}},E=(u)=>{if(u.button!==0)return;let g=w(u);if(!g)return;u.preventDefault(),f(null),u.currentTarget.setPointerCapture?.(u.pointerId);let k={id:J(),tool:s,start:g.normalized,end:g.normalized,label:"",note:""};c.current=k,A(k)},I=(u)=>{let g=c.current;if(!g)return;let k=w(u);if(!k)return;let x={...g,end:k.normalized};c.current=x,A(x)},R=(u)=>{let g=c.current;if(!g)return;let k=w(u),x=k?{...g,end:k.normalized}:g;if(c.current=null,A(null),u.currentTarget.releasePointerCapture?.(u.pointerId),x.tool!=="pin"){let B=h.current?.getBoundingClientRect();if((B?Math.hypot((x.end.x-x.start.x)*B.width,(x.end.y-x.start.y)*B.height):0)<fe)return}p(x)},N=()=>{c.current=null,A(null)},L=b?[...t,b]:t;return e("div",{ref:h,className:"absolute inset-0 cursor-crosshair touch-none",onPointerDown:E,onPointerMove:I,onPointerUp:R,onPointerCancel:N,children:e("svg",{className:"absolute inset-0 w-full h-full",viewBox:`0 0 ${Math.max(1,M.width)} ${Math.max(1,M.height)}`,preserveAspectRatio:"none","aria-label":"Page annotation area",children:L.map((u,g)=>e(he,{shape:u,index:g+1,box:M,selected:u.id===r,onSelect:()=>f(u.id)},u.id))})})}function he({shape:t,index:s,box:r,selected:l,onSelect:p}){let f={x:t.start.x*r.width,y:t.start.y*r.height},h={x:t.end.x*r.width,y:t.end.y*r.height},c=Fp(t),b=l?3:2,A=String(s);return e("g",{onPointerDown:(T)=>{T.stopPropagation(),T.preventDefault(),p()},className:"cursor-pointer",children:[t.tool==="box"&&e("rect",{x:c.x*r.width,y:c.y*r.height,width:Math.max(1,c.width*r.width),height:Math.max(1,c.height*r.height),fill:_,fillOpacity:l?0.16:0.1,stroke:_,strokeWidth:b,vectorEffect:"non-scaling-stroke",rx:3}),t.tool==="arrow"&&e(d,{children:[e("line",{x1:f.x,y1:f.y,x2:h.x,y2:h.y,stroke:_,strokeWidth:b,vectorEffect:"non-scaling-stroke"}),e("circle",{cx:h.x,cy:h.y,r:4,fill:_})]}),t.tool==="pin"&&e("circle",{cx:f.x,cy:f.y,r:7,fill:_,fillOpacity:l?0.5:0.3,stroke:_,strokeWidth:b}),e("circle",{cx:f.x,cy:f.y,r:9,fill:_}),e("text",{x:f.x,y:f.y,textAnchor:"middle",dominantBaseline:"central",fontSize:11,fontWeight:700,fill:"var(--theme-paper)",children:A})]})}function te(t){let s=t.trim();if(!s)return s;let r=/^[a-z][a-z0-9+.-]*:/i.test(s)?s:`https://${s}`,l=new URL(r);if(l.protocol!=="http:"&&l.protocol!=="https:")throw Error("Only http and https URLs are allowed");return l.toString()}var ge="userBrowser.history",be="userBrowser.historyIndex",xe="userBrowser.inputUrl";function ne(){let[t,s]=S(ge,[]),[r,l]=S(be,-1),[p,f]=S(xe,""),[h,c]=n(0),[b,A]=n(!1),[M,T]=n(void 0),w=r>=0&&r<t.length?t[r]??"":"",E=a((u)=>{let g=u.trim();if(!g)return;let k;try{k=te(g)}catch(O){T(O instanceof Error?O.message:"Alamat tidak valid");return}T(void 0),A(!0);let B=[...t.slice(0,r+1),k];s(B),l(B.length-1),f(k),c((O)=>O+1)},[t,r,s,l,f]),I=a(()=>{if(r<=0)return;A(!0),l(r-1)},[r,l]),R=a(()=>{if(r>=t.length-1)return;A(!0),l(r+1)},[t.length,r,l]),N=a(()=>{if(!w)return;A(!0),c((u)=>u+1)},[w]),L=a(()=>{A(!1)},[]);return{url:w,input:p,setInput:f,frameKey:h,loading:b,error:M,canGoBack:r>0,canGoForward:r>=0&&r<t.length-1,submit:E,goBack:I,goForward:R,reload:N,markLoaded:L}}function we(t){if(!t)return"no-frame";try{return t.contentDocument?"readable":"cross-origin"}catch{return"cross-origin"}}function H(t){let s=t.replace(/\s+/g," ").trim();return s.length>60?`${s.slice(0,59)}…`:s}function ve(t){let s=t.tagName.toLowerCase();if(t.id)return`${s}#${t.id}`;for(let l of["data-testid","data-test","aria-label"]){let p=t.getAttribute(l);if(p)return`${s}[${l}="${H(p)}"]`}let r=t.getAttribute("role");if(r)return`${s}[role="${r}"]`;return s}function ye(t){let s=[],r=t;while(r&&s.length<4){if(r.tagName.toLowerCase()==="html")break;s.unshift(ve(r)),r=r.parentElement}return s.join(" > ")}function ke(t){let s=[];if(t.disabled)s.push("nonaktif");if(t instanceof HTMLSelectElement||t.tagName.toLowerCase()==="select"){let r=t,p=r.selectedOptions?.[0]?.textContent?.trim()||r.value;if(p)s.push(`nilai "${H(p)}"`);let f=r.options?.length??0;if(f>0)s.push(`${f} opsi`)}else if(t.tagName.toLowerCase()==="input"){let r=t;if(r.type)s.push(`tipe ${r.type}`);if(r.type!=="password"&&r.placeholder)s.push(`placeholder "${H(r.placeholder)}"`)}return s.length>0?s.join(", "):void 0}function Ae(t){let s={path:ye(t),tag:t.tagName.toLowerCase()},r=t.getAttribute("role");if(r)s.role=r;let l=H(t.innerText??t.textContent??"");if(l)s.text=l;let p=ke(t);if(p)s.state=p;return s}function oe(t,s){let r=we(t);if(r!=="readable")return{ok:!1,reason:r};let{contentWindow:l,contentDocument:p}=t;if(!l||!p)return{ok:!1,reason:"cross-origin"};try{let f=Math.min(Math.max(s.x,0),1)*l.innerWidth,h=Math.min(Math.max(s.y,0),1)*l.innerHeight,c=p.elementFromPoint(f,h);if(!c||c===p.documentElement||c===p.body)return{ok:!1,reason:"no-element"};return{ok:!0,element:Ae(c)}}catch{return{ok:!1,reason:"cross-origin"}}}function mt({className:t="",active:s=!0}){let[r,l]=S("userBrowser.viewportMode","responsive"),[p,f]=S("userBrowser.zoomLevel",100),[h,c]=n(null),[b,A]=n(null),[M,T]=n(null),{url:w,input:E,setInput:I,frameKey:R,loading:N,error:L,canGoBack:u,canGoForward:g,submit:k,goBack:x,goForward:B,reload:O,markLoaded:D}=ne(),v=Q(R),re=a(()=>{if(!w)return;window.open(w,"_blank","noopener,noreferrer")},[w]),ae=a(()=>{if(!w)return;Wl({url:w})},[w]),ie=a((P)=>{c((z)=>z&&z.width===P.width&&z.height===P.height?z:P)},[]),se=a((P)=>{let z=oe(b,P.start);T(z),v.add(z.ok?{...P,element:z.element}:P)},[v,b]),le=a(()=>{if(!w||v.shapes.length===0)return;let P=p/100;Wl({url:w,annotations:v.shapes,panel:{width:(h?.width??0)/P,height:(h?.height??0)/P,viewportMode:r,zoom:p}}),v.close()},[w,v,h,r,p]),G=v.active&&Boolean(w);return e("div",{className:`flex flex-col h-full w-full bg-paper text-ink overflow-hidden ${t}`,children:[e(K,{url:w,input:E,loading:N,error:L,canGoBack:u,canGoForward:g,viewportMode:r,zoomLevel:p,onInputChange:I,onSubmit:k,onBack:x,onForward:B,onReload:O,onOpenExternal:re,onIncludeInChat:ae,onChangeViewport:l,onZoomIn:()=>f((P)=>Math.min(200,P+10)),onZoomOut:()=>f((P)=>Math.max(50,P-10)),onResetZoom:()=>f(100),onSetZoom:f,annotate:{active:G,count:v.shapes.length,onToggle:v.toggle}}),G&&e(j,{tool:v.tool,shapes:v.shapes,selectedId:v.selectedId,readability:M,onTool:v.setTool,onLabel:v.setLabel,onNote:v.setNote,onRemove:v.remove,onReset:v.reset,onCancel:v.close,onSend:le}),e(X,{url:w,frameKey:R,loading:N,viewportMode:r,zoomLevel:p,onLoad:D,onFrame:A,active:s,overlay:G?e(ee,{shapes:v.shapes,tool:v.tool,selectedId:v.selectedId,onMeasure:ie,onAdd:se,onSelect:v.select}):null})]})}export{mt as UserBrowserPanel};
1
+ import{d,n,i,o,a,e,S,m,M,Vt,ma,De,C,Dn,b,lg,Mp,Fu,cg,Kl}from"./index-ncrenheb.js";import{uu}from"./index-a8ffattk.js";import"./index-7ct7qrsp.js";var de={idle:"Kosong",loading:"Memuat",ready:"Siap"},V="p-1 rounded hover:bg-ink/5 disabled:opacity-25 disabled:hover:bg-transparent text-ink/70 hover:text-ink cursor-pointer disabled:cursor-not-allowed transition-colors";function K({url:t,input:s,loading:r,error:l,canGoBack:p,canGoForward:f,viewportMode:h,zoomLevel:c,onInputChange:x,onSubmit:A,onBack:P,onForward:T,onReload:v,onOpenExternal:E,onIncludeInChat:O,onChangeViewport:I,onZoomIn:N,onZoomOut:L,onResetZoom:u,onSetZoom:g,annotate:k}){let w=o(void 0);i(()=>{if(w.current===t)return;if(w.current=t,t)x(t)},[t,x]);let B=!t?"idle":r?"loading":"ready",z=B==="ready"?"bg-success animate-pulse":B==="loading"?"bg-ink/40 animate-pulse":"bg-ink/25",D=e("div",{className:"flex items-center bg-canvas border border-ink/10 rounded-md p-0.5 space-x-0.5 flex-shrink-0",children:[e("button",{type:"button",onClick:P,disabled:!p,"aria-label":"Back",title:"Back",className:V,children:e(Vt,{size:12})}),e("button",{type:"button",onClick:T,disabled:!f,"aria-label":"Maju",title:"Maju",className:V,children:e(ma,{size:12})}),e("button",{type:"button",onClick:v,disabled:!t,"aria-label":"Reload",title:"Reload",className:V,children:e(C,{size:12,className:r?"animate-spin":void 0})})]});return e(uu,{url:t,statusDotClass:z,statusLabel:de[B],viewportMode:h,zoomLevel:c,onChangeViewport:I,onZoomIn:N,onZoomOut:L,onResetZoom:u,onSetZoom:g,annotate:k,onIncludeInChat:O,onOpenExternal:E,openExternalLabel:"Buka di tab baru",openExternalTitle:"Buka di tab baru (untuk situs yang menolak iframe)",children:e("div",{className:"flex items-center flex-1 min-w-0 space-x-1.5",children:[D,e("form",{className:`flex-1 min-w-0 flex items-center bg-canvas border rounded-md px-2 py-0.5 space-x-1 focus-within:border-ink/40 ${l?"border-error":"border-ink/15"}`,onSubmit:(y)=>{y.preventDefault(),A(s)},children:[e(De,{size:12,className:"text-ink/40 flex-shrink-0"}),e("input",{type:"text",value:s,onChange:(y)=>x(y.currentTarget.value),placeholder:"Type an address (e.g. localhost:5173) and press Enter…","aria-label":"Browser address","aria-invalid":l!==void 0&&l!==null,title:l??void 0,spellcheck:!1,autoComplete:"off",className:`w-full min-w-0 bg-transparent outline-none font-mono text-[11px] placeholder:text-ink/35 ${l?"text-error":"text-ink/90"}`})]})]})})}var Z={"desktop-16-9":"w-full max-w-[1280px] aspect-video max-h-full border border-ink/20 rounded-lg shadow-md overflow-hidden my-auto",laptop:"w-[1024px] max-w-full h-[768px] max-h-full border border-ink/20 rounded-lg shadow-md overflow-hidden my-auto",tablet:"w-[768px] max-w-full h-[1024px] max-h-full border border-ink/20 rounded-lg shadow-md overflow-hidden my-auto",mobile:"w-[375px] max-w-full h-[667px] max-h-full border border-ink/20 rounded-xl shadow-md overflow-hidden my-auto","mobile-lg":"w-[414px] max-w-full h-[896px] max-h-full border border-ink/20 rounded-xl shadow-md overflow-hidden my-auto",responsive:"w-full h-full border-0"};var ce="clipboard-read; clipboard-write; fullscreen";function X({url:t,frameKey:s,loading:r,viewportMode:l,zoomLevel:p,onLoad:f,active:h=!0,overlay:c,onFrame:x}){if(!h)return null;if(!t)return e("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center select-none",children:[e("div",{className:"w-12 h-12 rounded-xl bg-ink/5 border border-ink/10 flex items-center justify-center text-ink/40 mb-3",children:e(De,{size:22})}),e("h3",{className:"text-sm font-semibold text-ink mb-1",children:"Browser Anda"}),e("p",{className:"text-xs text-ink/60 max-w-sm",children:"Type an address above and press Enter. The page loads inside this panel."}),e("p",{className:"text-[11px] text-ink/45 max-w-sm mt-2",children:"Sebagian situs (Google, GitHub) menolak ditampilkan dalam iframe — pakai tombol buka di tab baru."})]});return e("div",{className:"flex-1 min-h-0 relative flex items-center justify-center p-2 overflow-auto bg-canvas/60",children:[r?e("div",{className:"absolute inset-0 z-10 flex items-center justify-center pointer-events-none",children:e("div",{className:"flex items-center space-x-2 px-3 py-1.5 rounded-md bg-paper border border-ink/15",children:[e(m,{size:13,className:"animate-spin text-ink/50"}),e("span",{className:"text-[11px] font-mono text-ink/60",children:"Memuat…"})]})}):null,e("div",{className:`relative flex flex-col bg-white ${Z[l]} transition-all duration-200`,style:{zoom:p!==100?`${p}%`:void 0,transformOrigin:"top center"},children:[e("iframe",{ref:(A)=>x?.(A),src:t,title:"Browser pengguna",onLoad:f,referrerPolicy:"no-referrer",allow:ce,className:"w-full h-full bg-white border-0",style:c?{pointerEvents:"none"}:void 0},s),c]})]})}var W="w-full min-w-0 bg-canvas border border-ink/15 rounded px-2 py-1 text-[11px] font-mono text-ink placeholder:text-ink/35 focus:outline-none focus:border-ink/40";function ue(t){if(!t||t.ok)return null;if(t.reason==="cross-origin")return"This page is cross-origin, so its elements cannot be read. Name the part and add a note instead.";if(t.reason==="no-frame")return"The page has not loaded, so its elements cannot be read yet.";return"There is no element at this point (empty space). Name the part instead."}function Y({shape:t,index:s,readability:r,onLabel:l,onNote:p}){let f=ue(r),h=t.element;return e("div",{className:"flex items-start gap-1.5 min-w-0",children:[e("span",{className:"text-[11px] font-mono text-ink/45 pt-1 flex-shrink-0",children:[Fu[t.tool]," #",s]}),e("div",{className:"flex-1 min-w-0 space-y-1",children:[e("div",{className:"flex items-center gap-1 flex-wrap",children:[e("span",{className:"text-[10px] uppercase font-mono text-ink/40",children:"bagian"}),cg.map((c)=>{let x=t.label===c;return e("button",{type:"button",onClick:()=>l(x?"":c),"aria-pressed":x,className:`px-1.5 py-0.5 rounded-full border text-[10px] font-mono transition-colors cursor-pointer ${x?"bg-ink text-canvas border-ink":"bg-canvas text-ink/65 border-ink/15 hover:border-ink/40"}`,children:c},c)}),e("input",{value:t.label,onInput:(c)=>l(c.currentTarget.value),placeholder:"or type your own…","aria-label":"Name of the marked part",spellcheck:!1,className:`${W} flex-1 min-w-[110px]`})]}),e("textarea",{value:t.note,onInput:(c)=>p(c.currentTarget.value),placeholder:"What is wrong with this part? (e.g. the Pay button looks disabled)",rows:2,"aria-label":"Annotation note",className:`${W} resize-y`}),h?e("p",{className:"text-[10px] font-mono text-ink/45 truncate",title:h.path,children:["elemen: ",h.path,h.state?` · ${h.state}`:""]}):null,f?e("p",{className:"text-[10px] text-ink/40",children:f}):null]})]})}var me=["box","pin","arrow"],pe="px-2 py-1 rounded text-[11px] font-mono border transition-colors cursor-pointer",F="flex items-center gap-1 px-2 py-1 rounded text-[11px] border border-ink/15 hover:border-ink/40 text-ink/80 hover:text-ink transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed";function j({tool:t,shapes:s,selectedId:r,readability:l,onTool:p,onLabel:f,onNote:h,onRemove:c,onReset:x,onCancel:A,onSend:P}){let T=s.find((E)=>E.id===r)??null,v=s.length>0;return e("div",{className:"flex-shrink-0 border-b border-ink/10 bg-paper px-2.5 py-1.5 space-y-1.5 select-none",children:[e("div",{className:"flex items-center gap-1.5",children:[e("span",{className:"text-[10px] uppercase font-mono text-ink/50 mr-1",children:"Anotasi"}),me.map((E)=>e("button",{type:"button",onClick:()=>p(E),"aria-pressed":t===E,className:`${pe} ${t===E?"bg-ink text-canvas border-ink":"bg-canvas text-ink/70 border-ink/15 hover:border-ink/40"}`,children:Fu[E]},E)),e("span",{className:"text-[11px] font-mono text-ink/45 ml-1",children:s.length>0?`${s.length} mark${s.length===1?"":"s"}`:"drag on the page to mark a part"}),e("div",{className:"flex-1"}),e("button",{type:"button",onClick:x,disabled:!v,className:F,title:"Clear all marks",children:[e(M,{size:12})," Bersihkan"]}),e("button",{type:"button",onClick:P,disabled:!v,className:F,title:"Kirim anotasi ke draft chat",children:[e(Dn,{size:12})," Kirim ke chat"]}),e("button",{type:"button",onClick:A,className:F,title:"Tutup mode anotasi",children:e(b,{size:12})})]}),T?e("div",{className:"flex items-start gap-1.5",children:[e("div",{className:"flex-1 min-w-0",children:e(Y,{shape:T,index:s.indexOf(T)+1,readability:l,onLabel:(E)=>f(T.id,E),onNote:(E)=>h(T.id,E)})}),e("button",{type:"button",onClick:()=>c(T.id),className:F,title:"Remove this mark",children:e(M,{size:12})})]}):e("p",{className:"text-[11px] text-ink/45",children:"This page cannot be screenshotted, so what gets sent is the area, the part name and your note."})]})}var q=0;function J(){return q+=1,`annot-${Date.now().toString(36)}-${q}`}function Q(t){let[s,r]=n(!1),[l,p]=n("box"),[f,h]=n([]),[c,x]=n(null);i(()=>{h([]),x(null)},[t]);let A=a(()=>{r((N)=>!N),x(null)},[]),P=a(()=>{x(null),r(!1)},[]),T=a((N)=>{h((L)=>[...L,N]),x(N.id)},[]),v=a((N,L)=>{h((u)=>u.map((g)=>g.id===N?{...g,note:L}:g))},[]),E=a((N,L)=>{h((u)=>u.map((g)=>g.id===N?{...g,label:L}:g))},[]),O=a((N)=>{h((L)=>L.filter((u)=>u.id!==N)),x((L)=>L===N?null:L)},[]),I=a(()=>{h([]),x(null)},[]);return{active:s,tool:l,shapes:f,selectedId:c,setTool:p,toggle:A,close:P,add:T,setNote:v,setLabel:E,select:x,remove:O,reset:I}}var fe=4,U="var(--theme-error)";function ee({shapes:t,tool:s,selectedId:r,onMeasure:l,onAdd:p,onSelect:f}){let h=o(null),c=o(null),[x,A]=n(null),[P,T]=n({width:0,height:0});i(()=>{let u=h.current;if(!u)return;let g=()=>{let w=u.getBoundingClientRect();if(w.width<=0||w.height<=0)return;T((B)=>B.width===w.width&&B.height===w.height?B:{width:w.width,height:w.height}),l({width:w.width,height:w.height})};if(g(),typeof ResizeObserver!=="function")return;let k=new ResizeObserver(g);return k.observe(u),()=>k.disconnect()},[l]);let v=(u)=>{let g=h.current;if(!g)return null;let k=g.getBoundingClientRect(),w={x:u.clientX-k.left,y:u.clientY-k.top};return{normalized:lg(k,w),px:w.x,py:w.y}},E=(u)=>{if(u.button!==0)return;let g=v(u);if(!g)return;u.preventDefault(),f(null),u.currentTarget.setPointerCapture?.(u.pointerId);let k={id:J(),tool:s,start:g.normalized,end:g.normalized,label:"",note:""};c.current=k,A(k)},O=(u)=>{let g=c.current;if(!g)return;let k=v(u);if(!k)return;let w={...g,end:k.normalized};c.current=w,A(w)},I=(u)=>{let g=c.current;if(!g)return;let k=v(u),w=k?{...g,end:k.normalized}:g;if(c.current=null,A(null),u.currentTarget.releasePointerCapture?.(u.pointerId),w.tool!=="pin"){let B=h.current?.getBoundingClientRect();if((B?Math.hypot((w.end.x-w.start.x)*B.width,(w.end.y-w.start.y)*B.height):0)<fe)return}p(w)},N=()=>{c.current=null,A(null)},L=x?[...t,x]:t;return e("div",{ref:h,className:"absolute inset-0 cursor-crosshair touch-none",onPointerDown:E,onPointerMove:O,onPointerUp:I,onPointerCancel:N,children:e("svg",{className:"absolute inset-0 w-full h-full",viewBox:`0 0 ${Math.max(1,P.width)} ${Math.max(1,P.height)}`,preserveAspectRatio:"none","aria-label":"Page annotation area",children:L.map((u,g)=>e(he,{shape:u,index:g+1,box:P,selected:u.id===r,onSelect:()=>f(u.id)},u.id))})})}function he({shape:t,index:s,box:r,selected:l,onSelect:p}){let f={x:t.start.x*r.width,y:t.start.y*r.height},h={x:t.end.x*r.width,y:t.end.y*r.height},c=Mp(t),x=l?3:2,A=String(s);return e("g",{onPointerDown:(T)=>{T.stopPropagation(),T.preventDefault(),p()},className:"cursor-pointer",children:[t.tool==="box"&&e("rect",{x:c.x*r.width,y:c.y*r.height,width:Math.max(1,c.width*r.width),height:Math.max(1,c.height*r.height),fill:U,fillOpacity:l?0.16:0.1,stroke:U,strokeWidth:x,vectorEffect:"non-scaling-stroke",rx:3}),t.tool==="arrow"&&e(d,{children:[e("line",{x1:f.x,y1:f.y,x2:h.x,y2:h.y,stroke:U,strokeWidth:x,vectorEffect:"non-scaling-stroke"}),e("circle",{cx:h.x,cy:h.y,r:4,fill:U})]}),t.tool==="pin"&&e("circle",{cx:f.x,cy:f.y,r:7,fill:U,fillOpacity:l?0.5:0.3,stroke:U,strokeWidth:x}),e("circle",{cx:f.x,cy:f.y,r:9,fill:U}),e("text",{x:f.x,y:f.y,textAnchor:"middle",dominantBaseline:"central",fontSize:11,fontWeight:700,fill:"var(--theme-paper)",children:A})]})}function te(t){let s=t.trim();if(!s)return s;let r=/^[a-z][a-z0-9+.-]*:/i.test(s)?s:`https://${s}`,l=new URL(r);if(l.protocol!=="http:"&&l.protocol!=="https:")throw Error("Only http and https URLs are allowed");return l.toString()}var ge="userBrowser.history",be="userBrowser.historyIndex",xe="userBrowser.inputUrl";function ne(){let[t,s]=S(ge,[]),[r,l]=S(be,-1),[p,f]=S(xe,""),[h,c]=n(0),[x,A]=n(!1),[P,T]=n(void 0),v=r>=0&&r<t.length?t[r]??"":"",E=a((u)=>{let g=u.trim();if(!g)return;let k;try{k=te(g)}catch(z){T(z instanceof Error?z.message:"Alamat tidak valid");return}T(void 0),A(!0);let B=[...t.slice(0,r+1),k];s(B),l(B.length-1),f(k),c((z)=>z+1)},[t,r,s,l,f]),O=a(()=>{if(r<=0)return;A(!0),l(r-1)},[r,l]),I=a(()=>{if(r>=t.length-1)return;A(!0),l(r+1)},[t.length,r,l]),N=a(()=>{if(!v)return;A(!0),c((u)=>u+1)},[v]),L=a(()=>{A(!1)},[]);return{url:v,input:p,setInput:f,frameKey:h,loading:x,error:P,canGoBack:r>0,canGoForward:r>=0&&r<t.length-1,submit:E,goBack:O,goForward:I,reload:N,markLoaded:L}}function we(t){if(!t)return"no-frame";try{return t.contentDocument?"readable":"cross-origin"}catch{return"cross-origin"}}function H(t){let s=t.replace(/\s+/g," ").trim();return s.length>60?`${s.slice(0,59)}…`:s}function ve(t){let s=t.tagName.toLowerCase();if(t.id)return`${s}#${t.id}`;for(let l of["data-testid","data-test","aria-label"]){let p=t.getAttribute(l);if(p)return`${s}[${l}="${H(p)}"]`}let r=t.getAttribute("role");if(r)return`${s}[role="${r}"]`;return s}function ye(t){let s=[],r=t;while(r&&s.length<4){if(r.tagName.toLowerCase()==="html")break;s.unshift(ve(r)),r=r.parentElement}return s.join(" > ")}function ke(t){let s=[];if(t.disabled)s.push("nonaktif");if(t instanceof HTMLSelectElement||t.tagName.toLowerCase()==="select"){let r=t,p=r.selectedOptions?.[0]?.textContent?.trim()||r.value;if(p)s.push(`nilai "${H(p)}"`);let f=r.options?.length??0;if(f>0)s.push(`${f} opsi`)}else if(t.tagName.toLowerCase()==="input"){let r=t;if(r.type)s.push(`tipe ${r.type}`);if(r.type!=="password"&&r.placeholder)s.push(`placeholder "${H(r.placeholder)}"`)}return s.length>0?s.join(", "):void 0}function Ae(t){let s={path:ye(t),tag:t.tagName.toLowerCase()},r=t.getAttribute("role");if(r)s.role=r;let l=H(t.innerText??t.textContent??"");if(l)s.text=l;let p=ke(t);if(p)s.state=p;return s}function oe(t,s){let r=we(t);if(r!=="readable")return{ok:!1,reason:r};let{contentWindow:l,contentDocument:p}=t;if(!l||!p)return{ok:!1,reason:"cross-origin"};try{let f=Math.min(Math.max(s.x,0),1)*l.innerWidth,h=Math.min(Math.max(s.y,0),1)*l.innerHeight,c=p.elementFromPoint(f,h);if(!c||c===p.documentElement||c===p.body)return{ok:!1,reason:"no-element"};return{ok:!0,element:Ae(c)}}catch{return{ok:!1,reason:"cross-origin"}}}function mt({className:t="",active:s=!0}){let[r,l]=S("userBrowser.viewportMode","responsive"),[p,f]=S("userBrowser.zoomLevel",100),[h,c]=n(null),[x,A]=n(null),[P,T]=n(null),{url:v,input:E,setInput:O,frameKey:I,loading:N,error:L,canGoBack:u,canGoForward:g,submit:k,goBack:w,goForward:B,reload:z,markLoaded:D}=ne(),y=Q(I),re=a(()=>{if(!v)return;window.open(v,"_blank","noopener,noreferrer")},[v]),ae=a(()=>{if(!v)return;Kl({url:v})},[v]),ie=a((R)=>{c((_)=>_&&_.width===R.width&&_.height===R.height?_:R)},[]),se=a((R)=>{let _=oe(x,R.start);T(_),y.add(_.ok?{...R,element:_.element}:R)},[y,x]),le=a(()=>{if(!v||y.shapes.length===0)return;let R=p/100;Kl({url:v,annotations:y.shapes,panel:{width:(h?.width??0)/R,height:(h?.height??0)/R,viewportMode:r,zoom:p}}),y.close()},[v,y,h,r,p]),G=y.active&&Boolean(v);return e("div",{className:`flex flex-col h-full w-full bg-paper text-ink overflow-hidden ${t}`,children:[e(K,{url:v,input:E,loading:N,error:L,canGoBack:u,canGoForward:g,viewportMode:r,zoomLevel:p,onInputChange:O,onSubmit:k,onBack:w,onForward:B,onReload:z,onOpenExternal:re,onIncludeInChat:ae,onChangeViewport:l,onZoomIn:()=>f((R)=>Math.min(200,R+10)),onZoomOut:()=>f((R)=>Math.max(50,R-10)),onResetZoom:()=>f(100),onSetZoom:f,annotate:{active:G,count:y.shapes.length,onToggle:y.toggle}}),G&&e(j,{tool:y.tool,shapes:y.shapes,selectedId:y.selectedId,readability:P,onTool:y.setTool,onLabel:y.setLabel,onNote:y.setNote,onRemove:y.remove,onReset:y.reset,onCancel:y.close,onSend:le}),e(X,{url:v,frameKey:I,loading:N,viewportMode:r,zoomLevel:p,onLoad:D,onFrame:A,active:s,overlay:G?e(ee,{shapes:y.shapes,tool:y.tool,selectedId:y.selectedId,onMeasure:ie,onAdd:se,onSelect:y.select}):null})]})}export{mt as UserBrowserPanel};