ompchamber 0.3.0 → 0.4.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 (240) hide show
  1. package/README.md +9 -6
  2. package/dist/client/index.html +1 -1
  3. package/dist/client/static/css/index.5291f58223.css +2 -0
  4. package/dist/client/static/js/async/{1k.544adbf77d.js → 1k.5974df3b87.js} +2 -2
  5. package/dist/client/static/js/async/3j.357c80ff38.js +2 -0
  6. package/dist/client/static/js/async/{3y.22075aa079.js → 3y.ededeebde8.js} +5 -5
  7. package/dist/client/static/js/async/51.95bcae98af.js +2 -0
  8. package/dist/client/static/js/async/6.f034c9b528.js +1 -0
  9. package/dist/client/static/js/async/a.e05da304c8.js +10 -0
  10. package/dist/client/static/js/async/ar.1e14da5588.js +1 -0
  11. package/dist/client/static/js/async/art.62139ed479.js +2 -0
  12. package/dist/client/static/js/async/ct.b74928f7a3.js +1 -0
  13. package/dist/client/static/js/async/fw.6a51998a8e.js +6 -0
  14. package/dist/client/static/js/async/g.7a4bbd4798.js +2 -0
  15. package/dist/client/static/js/async/g.7a4bbd4798.js.LICENSE.txt +11 -0
  16. package/dist/client/static/js/async/{k.e878dd350f.js → k.7466330d1a.js} +2 -2
  17. package/dist/client/static/js/async/katex-vendor.de6a87c308.js +1 -0
  18. package/dist/client/static/js/async/kc.bbdb35b771.js +1 -0
  19. package/dist/client/static/js/async/l6.c56640c205.js +1 -0
  20. package/dist/client/static/js/async/{m.3fc017a055.js → m.4b29d34f93.js} +3 -3
  21. package/dist/client/static/js/async/{og.ae7acf03ac.js → og.634fba99ac.js} +2 -2
  22. package/dist/client/static/js/async/q.7fb4d2f374.js +21 -0
  23. package/dist/client/static/js/async/rd.cb6bf495bb.js +2 -0
  24. package/dist/client/static/js/async/rf.d626afc367.js +2 -0
  25. package/dist/client/static/js/async/s.413c2a4683.js +2 -0
  26. package/dist/client/static/js/async/s.413c2a4683.js.LICENSE.txt +6 -0
  27. package/dist/client/static/js/async/sy.d16be843a7.js +94 -0
  28. package/dist/client/static/js/async/t.cb3fcf8615.js +1 -0
  29. package/dist/client/static/js/async/ud.3065bfee31.js +2 -0
  30. package/dist/client/static/js/async/uf.46ad6209fa.js +2 -0
  31. package/dist/client/static/js/async/uf.46ad6209fa.js.LICENSE.txt +6 -0
  32. package/dist/client/static/js/async/v.7d28d3c241.js +34 -0
  33. package/dist/client/static/js/async/v0.394ed37c6b.js +2 -0
  34. package/dist/client/static/js/async/v0.394ed37c6b.js.LICENSE.txt +6 -0
  35. package/dist/client/static/js/async/vt.42416b707d.js +1 -0
  36. package/dist/client/static/js/async/vy.bbe114c4e0.js +2 -0
  37. package/dist/client/static/js/async/vy.bbe114c4e0.js.LICENSE.txt +6 -0
  38. package/dist/client/static/js/async/xw.ae67ba06fd.js +31 -0
  39. package/dist/client/static/js/async/xw.ae67ba06fd.js.LICENSE.txt +4 -0
  40. package/dist/client/static/js/async/yg.35bebd6d0c.js +149 -0
  41. package/dist/client/static/js/async/yv.2fa22f009a.js +1 -0
  42. package/dist/client/static/js/index.bf1b1fe988.js +33 -0
  43. package/dist/client/static/js/index.bf1b1fe988.js.LICENSE.txt +4 -0
  44. package/dist/client/static/js/{markdown-vendor.9da142c67b.js → markdown-vendor.71e43278b3.js} +1 -1
  45. package/dist/client/static/js/uy.5f791144ce.js +139 -0
  46. package/package.json +2 -1
  47. package/src/client/App.tsx +22 -5
  48. package/src/client/components/common/MarkdownRenderer.tsx +36 -0
  49. package/src/client/components/layout/desktop-layout/index.tsx +1 -1
  50. package/src/client/components/layout/session-sidebar/Modals.tsx +1 -1
  51. package/src/client/components/mobile/LayoutWrapper.tsx +1 -1
  52. package/src/client/components/settings/LazyModal.tsx +46 -0
  53. package/src/client/components/settings/Modal.tsx +1 -1
  54. package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +43 -29
  55. package/src/client/components/workspace/chat-timeline/MessageItem.tsx +15 -69
  56. package/src/client/components/workspace/chat-timeline/MessageList.tsx +47 -66
  57. package/src/client/components/workspace/chat-timeline/RunFooter.tsx +60 -0
  58. package/src/client/components/workspace/chat-timeline/SubagentView.tsx +37 -21
  59. package/src/client/components/workspace/chat-timeline/ToolCallCard.tsx +22 -4
  60. package/src/client/components/workspace/chat-timeline/index.tsx +3 -6
  61. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Edit.tsx +15 -19
  62. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/EnvelopeHeader.tsx +46 -0
  63. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/FallbackOutput.tsx +18 -68
  64. package/src/client/components/workspace/file-explorer/TreeItem.tsx +8 -2
  65. package/src/client/hooks/chat/omp/index.ts +9 -10
  66. package/src/client/hooks/chat/omp/revalidation-throttle.ts +6 -5
  67. package/src/client/hooks/chat/timeline/actions.ts +1 -2
  68. package/src/client/hooks/chat/timeline/index.ts +5 -0
  69. package/src/client/hooks/chat/timeline/send.ts +1 -2
  70. package/src/client/hooks/chat/timeline/session-load.ts +3 -4
  71. package/src/client/hooks/ui/syntax-ready.ts +16 -3
  72. package/src/client/main.tsx +2 -5
  73. package/src/client/stubs/elkjs.ts +37 -0
  74. package/src/client/tailwind.css +10 -0
  75. package/src/server/lib/fs/git-ignore.ts +49 -0
  76. package/src/server/lib/omp/rpc/constants.ts +10 -0
  77. package/src/server/lib/omp/rpc/lifecycle.test.ts +138 -0
  78. package/src/server/lib/omp/rpc/manager.ts +32 -4
  79. package/src/server/lib/omp/rpc/session-commands.ts +32 -9
  80. package/src/server/lib/omp/rpc/session-registry.ts +3 -2
  81. package/src/server/lib/omp/rpc/subagent-liveness.test.ts +62 -0
  82. package/src/server/lib/omp/rpc/subagent-liveness.ts +100 -0
  83. package/src/server/lib/omp/session/messages.test.ts +112 -0
  84. package/src/server/lib/omp/session/messages.ts +6 -5
  85. package/src/server/routes/agent/command.ts +34 -16
  86. package/src/server/routes/fs/read.ts +15 -7
  87. package/src/shared/lib/chat/notice-row.test.ts +89 -0
  88. package/src/shared/lib/chat/notice-row.ts +78 -0
  89. package/src/shared/lib/chat/omp/abort.ts +41 -0
  90. package/src/shared/lib/chat/timeline/omp-callbacks.test.ts +154 -0
  91. package/src/shared/lib/chat/timeline/omp-callbacks.ts +36 -7
  92. package/src/shared/lib/chat/timeline/run-footer.test.ts +84 -0
  93. package/src/shared/lib/chat/timeline/run-footer.ts +96 -0
  94. package/src/shared/lib/chat/tool-output.test.ts +91 -0
  95. package/src/shared/lib/chat/tool-output.ts +54 -0
  96. package/src/shared/lib/chat/xml-envelope.ts +158 -0
  97. package/src/shared/lib/code/highlighter-lazy.ts +106 -0
  98. package/src/shared/lib/code/highlighter.ts +31 -52
  99. package/src/shared/lib/code/syntax-highlight.test.ts +36 -1
  100. package/src/shared/lib/code/syntax-highlight.ts +17 -3
  101. package/src/shared/lib/format/time.ts +19 -0
  102. package/src/shared/lib/markdown/fira-code-fonts.css +51 -0
  103. package/src/shared/lib/markdown/katex-fonts.css +20 -0
  104. package/src/shared/lib/markdown/katex.ts +101 -0
  105. package/src/shared/lib/markdown/marked.ts +23 -14
  106. package/src/shared/lib/markdown/math.test.ts +109 -0
  107. package/src/shared/lib/markdown/mermaid.ts +6 -0
  108. package/src/shared/lib/markdown/sanitize.ts +48 -2
  109. package/src/shared/lib/omp/session/mapper.ts +11 -3
  110. package/src/shared/lib/omp/session/messages-map.ts +12 -12
  111. package/src/shared/types/chat.ts +3 -1
  112. package/src/shared/types/fs.ts +3 -0
  113. package/dist/client/static/css/g.f36aa429fa.css +0 -1
  114. package/dist/client/static/css/index.a0f07455bd.css +0 -2
  115. package/dist/client/static/css/katex-vendor.ca3a0600e8.css +0 -1
  116. package/dist/client/static/font/KaTeX_AMS-Regular.1608a09b4a.woff +0 -0
  117. package/dist/client/static/font/KaTeX_AMS-Regular.4aafdb685c.ttf +0 -0
  118. package/dist/client/static/font/KaTeX_Caligraphic-Bold.b67709187b.woff +0 -0
  119. package/dist/client/static/font/KaTeX_Caligraphic-Bold.cce5b8ecea.ttf +0 -0
  120. package/dist/client/static/font/KaTeX_Caligraphic-Regular.07ef19e7b0.ttf +0 -0
  121. package/dist/client/static/font/KaTeX_Caligraphic-Regular.dad44a7fc6.woff +0 -0
  122. package/dist/client/static/font/KaTeX_Fraktur-Bold.9f256b8593.woff +0 -0
  123. package/dist/client/static/font/KaTeX_Fraktur-Bold.b18f59e1d1.ttf +0 -0
  124. package/dist/client/static/font/KaTeX_Fraktur-Regular.7c1871215e.woff +0 -0
  125. package/dist/client/static/font/KaTeX_Fraktur-Regular.ed38e79f57.ttf +0 -0
  126. package/dist/client/static/font/KaTeX_Main-Bold.b74a1a8b2c.ttf +0 -0
  127. package/dist/client/static/font/KaTeX_Main-Bold.d181c4650d.woff +0 -0
  128. package/dist/client/static/font/KaTeX_Main-BoldItalic.70d8b0a530.ttf +0 -0
  129. package/dist/client/static/font/KaTeX_Main-BoldItalic.e3f82f9d27.woff +0 -0
  130. package/dist/client/static/font/KaTeX_Main-Italic.47373d1e51.ttf +0 -0
  131. package/dist/client/static/font/KaTeX_Main-Italic.9024d815ba.woff +0 -0
  132. package/dist/client/static/font/KaTeX_Main-Regular.7f51fe0340.woff +0 -0
  133. package/dist/client/static/font/KaTeX_Main-Regular.b7f8fe9b5f.ttf +0 -0
  134. package/dist/client/static/font/KaTeX_Math-BoldItalic.a879cf8383.ttf +0 -0
  135. package/dist/client/static/font/KaTeX_Math-BoldItalic.f1035d8d5d.woff +0 -0
  136. package/dist/client/static/font/KaTeX_Math-Italic.5295ba483a.woff +0 -0
  137. package/dist/client/static/font/KaTeX_Math-Italic.939bc64440.ttf +0 -0
  138. package/dist/client/static/font/KaTeX_SansSerif-Bold.94e1e8dc5f.ttf +0 -0
  139. package/dist/client/static/font/KaTeX_SansSerif-Bold.bf59d231c3.woff +0 -0
  140. package/dist/client/static/font/KaTeX_SansSerif-Italic.7c9bc82b17.woff +0 -0
  141. package/dist/client/static/font/KaTeX_SansSerif-Italic.b4c20c84d8.ttf +0 -0
  142. package/dist/client/static/font/KaTeX_SansSerif-Regular.740484788f.woff +0 -0
  143. package/dist/client/static/font/KaTeX_SansSerif-Regular.d4d7ba4804.ttf +0 -0
  144. package/dist/client/static/font/KaTeX_Script-Regular.0750571032.woff +0 -0
  145. package/dist/client/static/font/KaTeX_Script-Regular.fe9cbbe1a0.ttf +0 -0
  146. package/dist/client/static/font/KaTeX_Size1-Regular.e1e279cbdd.woff +0 -0
  147. package/dist/client/static/font/KaTeX_Size1-Regular.fabc004aab.ttf +0 -0
  148. package/dist/client/static/font/KaTeX_Size2-Regular.577270225e.woff +0 -0
  149. package/dist/client/static/font/KaTeX_Size2-Regular.d6b476ecd3.ttf +0 -0
  150. package/dist/client/static/font/KaTeX_Size3-Regular.9acaf01c64.woff +0 -0
  151. package/dist/client/static/font/KaTeX_Size3-Regular.a144ef5840.ttf +0 -0
  152. package/dist/client/static/font/KaTeX_Size4-Regular.7a996c9da2.woff +0 -0
  153. package/dist/client/static/font/KaTeX_Size4-Regular.fbccdabe0a.ttf +0 -0
  154. package/dist/client/static/font/KaTeX_Typewriter-Regular.6258592bdc.woff +0 -0
  155. package/dist/client/static/font/KaTeX_Typewriter-Regular.d97aaf4a1e.ttf +0 -0
  156. package/dist/client/static/font/fira-code-cyrillic-400-normal.5971438a4a.woff2 +0 -0
  157. package/dist/client/static/font/fira-code-cyrillic-400-normal.9bb7bfea9c.woff +0 -0
  158. package/dist/client/static/font/fira-code-cyrillic-500-normal.5486265b18.woff2 +0 -0
  159. package/dist/client/static/font/fira-code-cyrillic-500-normal.89f92bfb31.woff +0 -0
  160. package/dist/client/static/font/fira-code-cyrillic-600-normal.2805b497e5.woff +0 -0
  161. package/dist/client/static/font/fira-code-cyrillic-600-normal.86e0df22a3.woff2 +0 -0
  162. package/dist/client/static/font/fira-code-cyrillic-700-normal.505a88f22a.woff +0 -0
  163. package/dist/client/static/font/fira-code-cyrillic-700-normal.76f5e8d2e2.woff2 +0 -0
  164. package/dist/client/static/font/fira-code-cyrillic-ext-400-normal.3c4b15e57d.woff2 +0 -0
  165. package/dist/client/static/font/fira-code-cyrillic-ext-400-normal.61323debaa.woff +0 -0
  166. package/dist/client/static/font/fira-code-cyrillic-ext-500-normal.0f34210f2a.woff2 +0 -0
  167. package/dist/client/static/font/fira-code-cyrillic-ext-500-normal.2497cfa1aa.woff +0 -0
  168. package/dist/client/static/font/fira-code-cyrillic-ext-600-normal.40fce94af9.woff2 +0 -0
  169. package/dist/client/static/font/fira-code-cyrillic-ext-600-normal.6c8774b829.woff +0 -0
  170. package/dist/client/static/font/fira-code-cyrillic-ext-700-normal.4b742eb865.woff +0 -0
  171. package/dist/client/static/font/fira-code-cyrillic-ext-700-normal.e75eb4fccc.woff2 +0 -0
  172. package/dist/client/static/font/fira-code-greek-400-normal.bb900468b6.woff2 +0 -0
  173. package/dist/client/static/font/fira-code-greek-400-normal.be76e699ba.woff +0 -0
  174. package/dist/client/static/font/fira-code-greek-500-normal.176c9fb001.woff2 +0 -0
  175. package/dist/client/static/font/fira-code-greek-500-normal.d2c596136b.woff +0 -0
  176. package/dist/client/static/font/fira-code-greek-600-normal.490c3deed7.woff +0 -0
  177. package/dist/client/static/font/fira-code-greek-600-normal.7df14376d9.woff2 +0 -0
  178. package/dist/client/static/font/fira-code-greek-700-normal.c82b6072fc.woff2 +0 -0
  179. package/dist/client/static/font/fira-code-greek-700-normal.d5f2b2917b.woff +0 -0
  180. package/dist/client/static/font/fira-code-greek-ext-400-normal.4849a79781.woff +0 -0
  181. package/dist/client/static/font/fira-code-greek-ext-400-normal.7f5bfc4538.woff2 +0 -0
  182. package/dist/client/static/font/fira-code-greek-ext-500-normal.aaccca4075.woff2 +0 -0
  183. package/dist/client/static/font/fira-code-greek-ext-500-normal.e383181256.woff +0 -0
  184. package/dist/client/static/font/fira-code-greek-ext-600-normal.78cb4bff8e.woff +0 -0
  185. package/dist/client/static/font/fira-code-greek-ext-600-normal.d6c93d54f9.woff2 +0 -0
  186. package/dist/client/static/font/fira-code-greek-ext-700-normal.57ec7c92d9.woff +0 -0
  187. package/dist/client/static/font/fira-code-greek-ext-700-normal.8fafdae5e8.woff2 +0 -0
  188. package/dist/client/static/font/fira-code-latin-400-normal.973295532b.woff +0 -0
  189. package/dist/client/static/font/fira-code-latin-500-normal.7ae2be8fb8.woff +0 -0
  190. package/dist/client/static/font/fira-code-latin-600-normal.1dbbe5bc27.woff +0 -0
  191. package/dist/client/static/font/fira-code-latin-700-normal.497a70148b.woff +0 -0
  192. package/dist/client/static/font/fira-code-latin-ext-400-normal.9dfae29aaf.woff +0 -0
  193. package/dist/client/static/font/fira-code-latin-ext-400-normal.e534ae46e2.woff2 +0 -0
  194. package/dist/client/static/font/fira-code-latin-ext-500-normal.24c7b781b0.woff +0 -0
  195. package/dist/client/static/font/fira-code-latin-ext-500-normal.aad44ab072.woff2 +0 -0
  196. package/dist/client/static/font/fira-code-latin-ext-600-normal.7bed0f2f7e.woff +0 -0
  197. package/dist/client/static/font/fira-code-latin-ext-600-normal.c509a7c9f1.woff2 +0 -0
  198. package/dist/client/static/font/fira-code-latin-ext-700-normal.6c66c8b0a9.woff2 +0 -0
  199. package/dist/client/static/font/fira-code-latin-ext-700-normal.88f64e2822.woff +0 -0
  200. package/dist/client/static/font/fira-code-symbols2-400-normal.97d3f4b17c.woff +0 -0
  201. package/dist/client/static/font/fira-code-symbols2-500-normal.b06f1a06e4.woff +0 -0
  202. package/dist/client/static/font/fira-code-symbols2-600-normal.304b653b93.woff +0 -0
  203. package/dist/client/static/font/fira-code-symbols2-700-normal.d8ce0ad586.woff +0 -0
  204. package/dist/client/static/js/async/3j.a2fcea99be.js +0 -2
  205. package/dist/client/static/js/async/51.1938cec320.js +0 -2
  206. package/dist/client/static/js/async/6.7929428505.js +0 -1
  207. package/dist/client/static/js/async/69.a18a10882f.js +0 -1
  208. package/dist/client/static/js/async/a.bce4542392.js +0 -1
  209. package/dist/client/static/js/async/ar.9dc8b1992a.js +0 -2
  210. package/dist/client/static/js/async/bi.cbfe8eaa8e.js +0 -1
  211. package/dist/client/static/js/async/ct.38d9da8a5a.js +0 -1
  212. package/dist/client/static/js/async/fw.fb1a08b92d.js +0 -6
  213. package/dist/client/static/js/async/l6.45f3b62e15.js +0 -1
  214. package/dist/client/static/js/async/q.0b6fb9bf8d.js +0 -21
  215. package/dist/client/static/js/async/rd.b77011ab7f.js +0 -2
  216. package/dist/client/static/js/async/rf.cfbde7f744.js +0 -2
  217. package/dist/client/static/js/async/s.c7d521a8ae.js +0 -2
  218. package/dist/client/static/js/async/sy.7345abcd67.js +0 -94
  219. package/dist/client/static/js/async/t.0dcb01dfde.js +0 -1
  220. package/dist/client/static/js/async/v.5c7a4b087b.js +0 -1
  221. package/dist/client/static/js/async/vu.311f1d202c.js +0 -34
  222. package/dist/client/static/js/async/yg.9bd4e09ecb.js +0 -149
  223. package/dist/client/static/js/async/yv.593a3f7d54.js +0 -1
  224. package/dist/client/static/js/g.124fba0826.js +0 -139
  225. package/dist/client/static/js/index.907fd4670e.js +0 -68
  226. package/dist/client/static/js/katex-vendor.95e48cf65a.js +0 -1
  227. package/src/shared/lib/chat/order.ts +0 -40
  228. /package/dist/client/static/js/async/{1k.544adbf77d.js.LICENSE.txt → 1k.5974df3b87.js.LICENSE.txt} +0 -0
  229. /package/dist/client/static/js/async/{3j.a2fcea99be.js.LICENSE.txt → 3j.357c80ff38.js.LICENSE.txt} +0 -0
  230. /package/dist/client/static/js/async/{3y.22075aa079.js.LICENSE.txt → 3y.ededeebde8.js.LICENSE.txt} +0 -0
  231. /package/dist/client/static/js/async/{51.1938cec320.js.LICENSE.txt → 51.95bcae98af.js.LICENSE.txt} +0 -0
  232. /package/dist/client/static/js/async/{ar.9dc8b1992a.js.LICENSE.txt → a.e05da304c8.js.LICENSE.txt} +0 -0
  233. /package/dist/client/static/js/async/{fw.fb1a08b92d.js.LICENSE.txt → art.62139ed479.js.LICENSE.txt} +0 -0
  234. /package/dist/client/static/js/async/{m.3fc017a055.js.LICENSE.txt → fw.6a51998a8e.js.LICENSE.txt} +0 -0
  235. /package/dist/client/static/js/async/{q.0b6fb9bf8d.js.LICENSE.txt → m.4b29d34f93.js.LICENSE.txt} +0 -0
  236. /package/dist/client/static/js/async/{rf.cfbde7f744.js.LICENSE.txt → q.7fb4d2f374.js.LICENSE.txt} +0 -0
  237. /package/dist/client/static/js/async/{rd.b77011ab7f.js.LICENSE.txt → rd.cb6bf495bb.js.LICENSE.txt} +0 -0
  238. /package/dist/client/static/js/async/{s.c7d521a8ae.js.LICENSE.txt → rf.d626afc367.js.LICENSE.txt} +0 -0
  239. /package/dist/client/static/js/{index.907fd4670e.js.LICENSE.txt → async/ud.3065bfee31.js.LICENSE.txt} +0 -0
  240. /package/dist/client/static/js/{g.124fba0826.js.LICENSE.txt → uy.5f791144ce.js.LICENSE.txt} +0 -0
@@ -0,0 +1,2 @@
1
+ /*! LICENSE: 51.95bcae98af.js.LICENSE.txt */
2
+ "use strict";(self.rspackChunkompchamber=self.rspackChunkompchamber||[]).push([[51],{nj(e,t,n){var a=n("j");function l(e){let{value:t,label:n,hint:l,tone:s="default",variant:i="metric",className:r=""}=e;return"compact"===i?(0,a.FD)("div",{className:"bg-canvas border border-ink/10 rounded-lg px-2.5 py-1.5 flex flex-col gap-0.5 flex-1 min-w-0",children:[(0,a.Y)("span",{className:"text-[10px] font-medium text-ink/50",children:n}),(0,a.Y)("span",{className:"text-xs font-semibold font-mono text-ink truncate",children:t})]}):(0,a.FD)("div",{className:`${"muted"===s?"bg-ink/5 border-ink/10":"bg-paper border-ink/15"} border rounded-lg p-3 shadow-xs flex flex-col justify-between h-full min-w-0 ${r}`,children:[(0,a.FD)("div",{className:"min-w-0",children:[(0,a.Y)("div",{className:"text-base font-bold tracking-tight text-ink leading-tight tabular-nums break-normal",children:t}),(0,a.Y)("div",{className:"text-[11px] font-semibold text-ink/75 mt-1.5 leading-snug min-h-[30px] flex items-start",children:(0,a.Y)("span",{className:"min-w-0 break-normal",children:n})})]}),l&&(0,a.Y)("div",{className:"text-[10px] text-ink/50 mt-1.5 leading-tight break-words",children:l})]})}n.d(t,{h:()=>l})},zO(e,t,n){n.d(t,{ContextPanel:()=>A});var a=n("j"),l=n("H"),s=n("s");function i(e){let{used:t,limit:n,percent:l}=e,s=t.toLocaleString(),i=n.toLocaleString(),r=Math.min(100,Math.max(0,l));return(0,a.FD)("div",{className:"bg-canvas border border-ink/10 rounded-xl p-4 transition-all",children:[(0,a.FD)("div",{className:"flex items-center justify-between text-xs mb-2",children:[(0,a.Y)("span",{className:"font-semibold text-ink/80",children:"Context"}),(0,a.FD)("span",{className:"font-mono text-ink/70 text-[11px]",children:[s," / ",i]})]}),(0,a.Y)("div",{className:"w-full h-1.5 bg-ink/10 rounded-full overflow-hidden mb-2",children:(0,a.Y)("div",{className:"h-full bg-ink/70 rounded-full transition-all duration-500 ease-out",style:{width:`${r}%`}})}),(0,a.FD)("div",{className:"text-[11px] font-mono text-ink/50 text-left",children:[r.toFixed(1),"% used"]})]})}var r=n("wU"),o=n("S"),c=n("oj");function d(e){return e<.01?"$0.01":`$${e.toFixed(6).replace(/0+$/,"").replace(/\.$/,"")}`}function m(e){let{open:t,onClose:n,breakdown:s,costFormatted:i}=e,r=(0,l.li)(null);if((0,c.W)(r,n),!t)return null;let m=s?[{label:"Total Cost",value:d(s.total),strong:!0},{label:"Input (cache miss)",value:d(s.input)},{label:"Output",value:d(s.output)},{label:"Cache Read (cache hit)",value:d(s.cacheRead)},{label:"Cache Write",value:d(s.cacheWrite)}]:[{label:"Total Cost",value:i??"$0.01",strong:!0}];return(0,a.FD)("div",{ref:r,className:"absolute top-full right-0 mt-1.5 z-50 w-64 bg-paper border border-ink/10 rounded-lg shadow-lg p-3",role:"dialog","aria-modal":"false",children:[(0,a.FD)("div",{className:"flex items-center justify-between mb-2.5",children:[(0,a.Y)("span",{className:"text-xs font-semibold text-ink tracking-tight",children:"Cost Breakdown"}),(0,a.Y)("button",{type:"button",onClick:n,className:"p-1 rounded hover:bg-ink/5 text-ink/60 hover:text-ink transition-colors","aria-label":"Close cost breakdown",children:(0,a.Y)(o.A,{size:14})})]}),(0,a.Y)("div",{className:"space-y-1.5",children:m.map(e=>(0,a.FD)("div",{className:"flex items-center justify-between text-[11px] font-mono border-b border-ink/5 last:border-0 pb-1.5 last:pb-0",children:[(0,a.Y)("span",{className:"text-ink/60",children:e.label}),(0,a.Y)("span",{className:`${e.strong?"font-semibold text-ink":"text-ink/80"}`,children:e.value})]},e.label))})]})}var h=n("nj");function u(e){let{messagesCount:t,userCount:n,assistantCount:s,costFormatted:i,cacheHitAverage:o,costBreakdown:c}=e,[d,u]=(0,l.J0)(!1);return(0,a.FD)(a.FK,{children:[(0,a.Y)("div",{className:"mb-1.5",children:(0,a.Y)("span",{className:"text-xs font-semibold text-ink/80",children:"Session Stats"})}),(0,a.FD)("div",{className:"flex gap-2 flex-wrap",children:[(0,a.Y)(h.h,{variant:"compact",label:"Messages",value:t}),(0,a.Y)(h.h,{variant:"compact",label:"User",value:n}),(0,a.Y)(h.h,{variant:"compact",label:"Assistant",value:s}),(0,a.Y)(h.h,{variant:"compact",label:"Cache Hit",value:void 0!==o?`${o.toFixed(1)}%`:"—"}),(0,a.FD)("div",{className:"relative bg-canvas border border-ink/10 rounded-lg px-2.5 py-1.5 flex flex-col gap-0.5 flex-1 min-w-0",children:[(0,a.FD)("span",{className:"text-[10px] font-medium text-ink/50 flex items-center gap-1",children:["Cost",(0,a.Y)("button",{type:"button",onClick:()=>u(!0),className:"p-0.5 rounded text-ink/40 hover:text-ink hover:bg-ink/5 transition-colors","aria-label":"Show cost breakdown",title:"Cost breakdown",children:(0,a.Y)(r.A,{size:11})})]}),(0,a.Y)("span",{className:"text-xs font-semibold font-mono text-ink truncate",children:i}),(0,a.Y)(m,{open:d,onClose:()=>u(!1),breakdown:c,costFormatted:i})]})]})]})}function p(e){let{input:t,output:n,reasoning:l,cacheRead:s,cacheWrite:i,cacheHitPercent:r}=e;return(0,a.FD)(a.FK,{children:[(0,a.Y)("div",{className:"mb-1.5",children:(0,a.Y)("span",{className:"text-xs font-semibold text-ink/80",children:"Last Assistant Message"})}),(0,a.FD)("div",{className:"flex gap-2 flex-wrap",children:[(0,a.Y)(h.h,{variant:"compact",label:"In",value:t.toLocaleString()}),(0,a.Y)(h.h,{variant:"compact",label:"Out",value:n.toLocaleString()}),(0,a.Y)(h.h,{variant:"compact",label:"Reason",value:l.toLocaleString()}),(0,a.Y)(h.h,{variant:"compact",label:"Cache",value:`${s.toLocaleString()}/${i.toLocaleString()}`}),(0,a.Y)(h.h,{variant:"compact",label:"Hit",value:`${r.toFixed(1)}%`})]})]})}function x(e){let{userPercent:t,assistantPercent:n,toolPercent:l,otherPercent:s}=e;return(0,a.FD)("div",{className:"space-y-2.5",children:[(0,a.FD)("div",{className:"w-full h-1.5 rounded-full overflow-hidden flex bg-ink/10",children:[(0,a.Y)("div",{className:"h-full bg-emerald-500 transition-all duration-300",style:{width:`${t}%`},title:`User: ${t}%`}),(0,a.Y)("div",{className:"h-full bg-sky-500 transition-all duration-300",style:{width:`${n}%`},title:`Assistant: ${n}%`}),(0,a.Y)("div",{className:"h-full bg-amber-500 transition-all duration-300",style:{width:`${l}%`},title:`Tool Calls: ${l}%`}),(0,a.Y)("div",{className:"h-full bg-slate-400 transition-all duration-300",style:{width:`${s}%`},title:`Other: ${s}%`})]}),(0,a.FD)("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-[11px] text-ink/70",children:[(0,a.FD)("div",{className:"flex items-center space-x-1.5",children:[(0,a.Y)("span",{className:"w-2 h-2 rounded-full bg-emerald-500 flex-shrink-0"}),(0,a.FD)("span",{children:["User ",t,"%"]})]}),(0,a.FD)("div",{className:"flex items-center space-x-1.5",children:[(0,a.Y)("span",{className:"w-2 h-2 rounded-full bg-sky-500 flex-shrink-0"}),(0,a.FD)("span",{children:["Assistant ",n,"%"]})]}),(0,a.FD)("div",{className:"flex items-center space-x-1.5",children:[(0,a.Y)("span",{className:"w-2 h-2 rounded-full bg-amber-500 flex-shrink-0"}),(0,a.FD)("span",{children:["Tool Calls ",l,"%"]})]}),(0,a.FD)("div",{className:"flex items-center space-x-1.5",children:[(0,a.Y)("span",{className:"w-2 h-2 rounded-full bg-slate-400 flex-shrink-0"}),(0,a.FD)("span",{children:["Other ",s,"%"]})]})]})]})}let b=(0,n("y").A)({name:"chevrons-up-down",size:24,node:[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]});var f=n("Go"),g=n("Nf"),v=n("qp"),k=n("FL"),N=n("Af"),y=n("z"),Y=n("b0"),w=n("DU"),F=n("Po");function D(e){let{data:t}=e;(0,F.w)();let[n,s]=(0,l.J0)(!1),i=(0,l.li)(null),r=(0,l.li)(null),o=JSON.stringify(t,null,2),c=(0,w.PH)(o),d=(0,l.hb)(e=>{let t=r.current;t&&(t.scrollLeft=e.currentTarget.scrollLeft,t.scrollTop=e.currentTarget.scrollTop)},[]),m=(0,l.hb)(async e=>{e.stopPropagation();try{await navigator.clipboard.writeText(o)}catch{let e=document.createElement("textarea");e.value=o,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)}s(!0),setTimeout(()=>s(!1),2e3)},[o]);return(0,a.FD)("div",{className:"relative my-1.5 rounded-lg bg-paper/80 border border-ink/10 overflow-hidden",children:[(0,a.FD)("div",{className:"flex items-center justify-between px-2.5 py-1.5 bg-ink/[0.04] border-b border-ink/10",children:[(0,a.FD)("span",{className:"text-[10px] font-mono text-ink/50 select-none",children:[Object.keys(t).length," keys · ",o.length," chars"]}),(0,a.Y)("button",{type:"button",onClick:m,className:"flex items-center space-x-1 px-2 py-1 rounded bg-canvas hover:bg-paper text-ink/70 hover:text-ink border border-ink/10 text-[10px] transition-colors shadow-xs",title:"Copy Pretty JSON",children:n?(0,a.FD)(a.FK,{children:[(0,a.Y)(y.A,{size:11,className:"text-emerald-600"}),(0,a.Y)("span",{className:"text-emerald-600 font-sans font-medium",children:"Copied"})]}):(0,a.FD)(a.FK,{children:[(0,a.Y)(Y.A,{size:11}),(0,a.Y)("span",{className:"font-sans",children:"Copy JSON"})]})})]}),(0,a.FD)("div",{className:"relative",children:[(0,a.Y)("pre",{ref:r,"aria-hidden":!0,className:"absolute inset-0 p-2.5 m-0 font-mono text-[11px] leading-5 overflow-x-auto overflow-y-auto whitespace-pre pointer-events-none",dangerouslySetInnerHTML:{__html:c}}),(0,a.Y)("pre",{ref:i,onScroll:d,className:"relative p-2.5 m-0 font-mono text-[11px] leading-5 overflow-x-auto overflow-y-auto whitespace-pre select-text selection:bg-ink selection:text-canvas",children:(0,a.Y)("code",{className:"text-transparent",children:o})})]})]})}let C=["bg-emerald-500","bg-sky-500","bg-amber-500","bg-violet-500","bg-rose-500","bg-teal-500","bg-indigo-500","bg-fuchsia-500","bg-lime-500","bg-cyan-500","bg-orange-500","bg-pink-500","bg-yellow-500","bg-purple-500","bg-red-500","bg-blue-500","bg-green-500","bg-cyan-600","bg-violet-600","bg-amber-600"];function $(e){let{sessionId:t,refreshKey:n=0}=e,[s,i]=(0,k.bL)("context.rawExpandedIds",{}),[r,o]=(0,k.bL)("context.rawFilterRole","all"),[c,d]=(0,l.J0)(1),[m,h]=(0,l.J0)([]),[u,p]=(0,l.J0)(0),[x,y]=(0,l.J0)(!1),Y=(0,l.li)(0),w=(0,l.li)(!1),F=(0,l.hb)(e=>{if("u"<typeof window)return;let n=++Y.current;e?.silent||y(!0);let a=new URLSearchParams({page:String(c),pageSize:String(20),role:r});t&&a.set("sessionId",t),fetch(`/api/telemetry/raw-messages?${a.toString()}`).then(e=>e.ok?e.json():null).then(e=>{w.current||n!==Y.current||(h(e&&Array.isArray(e.items)?e.items:[]),p(e&&Number.isFinite(e.filteredTotal)?e.filteredTotal:0))}).catch(()=>{w.current||n!==Y.current||(h([]),p(0))}).finally(()=>{e?.silent||n!==Y.current||y(!1)})},[t,c,r]);(0,l.vJ)(()=>(w.current=!1,F(),()=>{w.current=!0}),[F,n]),(0,N.n)(()=>F({silent:!0}),null!==t),(0,N.w)(()=>F({silent:!0}),null!==t);let $=Math.max(1,Math.ceil(u/20)),S=Math.min(c,$),A=e=>d(Math.min(Math.max(1,e),$)),P=(0,l.Kr)(()=>{let e=[];for(let t of m){let n=t.info.modelID;!n||e.includes(n)||e.push(n)}return e},[m]),M=e=>e?C[function(e){let t=0;for(let n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;return Math.abs(t)}(e)%C.length]:"bg-ink/20";return(0,a.FD)("div",{className:"space-y-3",children:[P.length>0&&(0,a.FD)("div",{children:[(0,a.Y)("div",{className:"mb-1.5",children:(0,a.Y)("span",{className:"text-xs font-semibold text-ink/80",children:"Legend"})}),(0,a.Y)("div",{className:"bg-canvas border border-ink/10 rounded-xl px-3 py-2",children:(0,a.Y)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[10px] font-mono text-ink/60",children:P.map(e=>{let t,n,l;return(0,a.FD)("span",{className:"flex items-center gap-1.5",children:[(0,a.Y)("span",{className:`w-2 h-2 rounded-full ${M(e)}`}),(0,a.Y)("span",{children:(n=(t=e.indexOf("/"))>0?e.slice(0,t):e,(l=t>0?e.slice(t+1):"")?`${n} \xb7 ${l}`:n)})]},e)})})})]}),(0,a.FD)("div",{className:"flex items-center justify-between",children:[(0,a.FD)("div",{className:"flex items-center space-x-2",children:[(0,a.Y)("span",{className:"text-xs font-semibold text-ink/80",children:"Raw Messages"}),(0,a.Y)("span",{className:"text-[10px] font-mono text-ink/50 bg-ink/5 px-1.5 py-0.5 rounded-full border border-ink/10",children:u})]}),(0,a.FD)("div",{className:"flex items-center space-x-1",children:[(0,a.FD)("div",{className:"flex items-center bg-canvas border border-ink/10 rounded-lg p-0.5 text-[10px]",children:[(0,a.Y)("button",{type:"button",onClick:()=>{o("all"),d(1)},className:`px-1.5 py-0.5 rounded ${"all"===r?"bg-ink text-canvas font-medium":"text-ink/60 hover:text-ink"}`,children:"All"}),(0,a.Y)("button",{type:"button",onClick:()=>{o("assistant"),d(1)},className:`px-1.5 py-0.5 rounded ${"assistant"===r?"bg-ink text-canvas font-medium":"text-ink/60 hover:text-ink"}`,children:"AI"}),(0,a.Y)("button",{type:"button",onClick:()=>{o("user"),d(1)},className:`px-1.5 py-0.5 rounded ${"user"===r?"bg-ink text-canvas font-medium":"text-ink/60 hover:text-ink"}`,children:"User"})]}),(0,a.Y)("button",{type:"button",onClick:()=>{if(m.every(e=>s[e.id]))i({});else{let e={};m.forEach(t=>{e[t.id]=!0}),i(e)}},className:"p-1 rounded text-ink/60 hover:text-ink hover:bg-ink/5 transition-colors text-[10px] flex items-center",title:"Expand / Collapse All",children:(0,a.Y)(b,{size:14})})]})]}),(0,a.Y)("div",{className:"space-y-1.5",children:x||0!==m.length?m.map(e=>{let t=!!s[e.id];return(0,a.FD)("div",{className:`bg-canvas border border-ink/10 rounded-xl overflow-hidden transition-all duration-200 ${x?"opacity-50":""}`,children:[(0,a.FD)("button",{type:"button",onClick:()=>{var t;return t=e.id,void i(e=>({...e,[t]:!e[t]}))},className:"w-full text-left px-3.5 py-2.5 flex items-center justify-between hover:bg-ink/5 transition-colors cursor-pointer",children:[(0,a.FD)("div",{className:"flex items-center space-x-2 min-w-0 flex-1 mr-2",children:[(0,a.Y)("span",{className:"text-ink/40 flex-shrink-0",children:t?(0,a.Y)(f.A,{size:14}):(0,a.Y)(g.A,{size:14})}),(0,a.Y)("span",{className:"text-xs font-mono text-ink/90 truncate",children:e.badgeLabel})]}),(0,a.FD)("div",{className:"flex items-center space-x-3 text-[11px] font-mono text-ink/50 flex-shrink-0",children:[e.tokenSummary&&(0,a.Y)("span",{className:"text-ink/60",children:e.tokenSummary}),(0,a.FD)("span",{className:"flex items-center gap-1.5",children:[(0,a.Y)("span",{className:`w-2 h-2 rounded-full ${M(e.info.modelID)}`}),(0,a.Y)("span",{children:e.timestamp})]})]})]}),t&&(0,a.Y)("div",{className:"px-3.5 pb-3 pt-1 border-t border-ink/5 bg-canvas/60",children:(0,a.Y)(D,{data:e.rawPayload})})]},e.id)}):(0,a.Y)("div",{className:"p-4 text-center text-xs text-ink/40 italic bg-canvas rounded-xl border border-ink/10",children:"No raw messages recorded yet."})}),$>1&&(0,a.FD)("div",{className:"flex items-center justify-between pt-1",children:[(0,a.FD)("span",{className:"text-[10px] font-mono text-ink/50",children:[(S-1)*20+1,"–",Math.min(20*S,u)," of ",u]}),(0,a.FD)("div",{className:"flex items-center gap-0.5",children:[(0,a.Y)("button",{type:"button",disabled:S<=1,onClick:()=>A(S-1),className:"p-1 rounded text-ink/60 hover:text-ink hover:bg-ink/5 disabled:opacity-30 disabled:hover:bg-transparent transition-colors",title:"Previous page",children:(0,a.Y)(v.A,{size:14})}),(function(e,t){if(t<=7)return Array.from({length:t},(e,t)=>t+1);let n=new Set([1,t,e,e-1,e+1]);e<=3&&[2,3,4].forEach(e=>n.add(e)),e>=t-2&&[t-3,t-2,t-1].forEach(e=>n.add(e));let a=[...n].filter(e=>e>=1&&e<=t).sort((e,t)=>e-t),l=[],s=0;for(let e of a)e-s>1&&l.push("…"),l.push(e),s=e;return l})(S,$).map((e,t)=>"…"===e?(0,a.Y)("span",{className:"px-1 text-[10px] font-mono text-ink/40 select-none",children:"…"},`gap-${t}`):(0,a.Y)("button",{type:"button",onClick:()=>A(e),className:`min-w-[22px] h-[22px] px-1 rounded text-[10px] font-mono transition-colors ${e===S?"bg-ink text-canvas font-medium":"text-ink/60 hover:text-ink hover:bg-ink/5"}`,children:e},e)),(0,a.Y)("button",{type:"button",disabled:S>=$,onClick:()=>A(S+1),className:"p-1 rounded text-ink/60 hover:text-ink hover:bg-ink/5 disabled:opacity-30 disabled:hover:bg-transparent transition-colors",title:"Next page",children:(0,a.Y)(g.A,{size:14})})]})]})]})}var S=n("jo");function A(e){let{className:t="",enabled:n=!0,refreshKey:r=0}=e,[o]=(0,s.o)(),c=o.get("sessionId"),{isScrolling:d,handleScroll:m}=(0,S.K)(),[h,b]=(0,l.J0)(()=>({sessionId:c||"default",sessionTitle:"Session not started",modelId:"",modelName:"",timestamp:"",contextUsed:0,contextLimit:1e6,contextPercent:0,messagesCount:0,userCount:0,assistantCount:0,totalCost:0,costFormatted:"$0.00",cacheHitAverage:0,costBreakdown:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0},lastMessage:{input:0,output:0,reasoning:0,cacheRead:0,cacheWrite:0,cacheHitPercent:0},distribution:{userTokens:0,userPercent:0,assistantTokens:0,assistantPercent:0,toolTokens:0,toolPercent:0,otherTokens:0,otherPercent:100},rawMessages:[]})),f=(0,l.li)(!1),g=(0,l.hb)(()=>{if("u"<typeof window)return;let e=c?`?sessionId=${encodeURIComponent(c)}`:"";fetch(`/api/telemetry/context${e}`).then(e=>e.ok?e.json():null).then(e=>{!f.current&&e&&e.telemetry&&b(e.telemetry)}).catch(e=>{f.current||console.warn("Failed to fetch context telemetry:",e)})},[c]);return((0,l.vJ)(()=>{if(f.current=!1,n)return g(),()=>{f.current=!0}},[n,r,g]),(0,N.n)(g,n),(0,N.w)(g,n),n)?0===h.messagesCount?(0,a.Y)("div",{className:`flex flex-col h-full bg-paper items-center justify-center text-ink/40 ${t}`,children:(0,a.Y)("span",{className:"text-xs font-mono",children:"Session not started"})}):(0,a.FD)("div",{className:`flex flex-col h-full bg-paper text-ink overflow-hidden select-none ${t}`,children:[(0,a.Y)("div",{className:"flex-shrink-0 p-4 border-b border-ink/10 bg-paper",children:(0,a.FD)("div",{children:[(0,a.Y)("h2",{className:"text-xs font-medium text-ink tracking-tight truncate",children:h.sessionTitle}),(0,a.Y)("div",{className:"text-[11px] text-ink/50 mt-1 truncate font-mono",children:h.timestamp})]})}),(0,a.FD)("div",{onScroll:m,className:`flex-1 scrollbar-overlay-container p-4 space-y-4 ${(0,S.p)(d)}`,children:[(0,a.Y)(i,{used:h.contextUsed,limit:h.contextLimit,percent:h.contextPercent}),(0,a.Y)(u,{messagesCount:h.messagesCount,userCount:h.userCount,assistantCount:h.assistantCount,costFormatted:h.costFormatted,cacheHitAverage:h.cacheHitAverage,costBreakdown:h.costBreakdown}),(0,a.Y)(p,{input:h.lastMessage.input,output:h.lastMessage.output,reasoning:h.lastMessage.reasoning,cacheRead:h.lastMessage.cacheRead,cacheWrite:h.lastMessage.cacheWrite,cacheHitPercent:h.lastMessage.cacheHitPercent}),(0,a.Y)(x,{userPercent:h.distribution.userPercent,assistantPercent:h.distribution.assistantPercent,toolPercent:h.distribution.toolPercent,otherPercent:h.distribution.otherPercent}),(0,a.Y)($,{sessionId:c,refreshKey:r})]})]}):(0,a.Y)("div",{className:`flex flex-col h-full bg-paper items-center justify-center text-ink/40 ${t}`,children:(0,a.Y)("span",{className:"text-xs font-mono",children:"No session selected"})})}},qp(e,t,n){let a=(0,n("y").A)({name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]});n.d(t,{},{A:a})}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.rspackChunkompchamber=self.rspackChunkompchamber||[]).push([[6],{ks(s,r,a){a.r(r);var e=a("kJ");a.d(r,{default:()=>e.A})}}]);
@@ -0,0 +1,10 @@
1
+ /*! LICENSE: a.e05da304c8.js.LICENSE.txt */
2
+ "use strict";(self.rspackChunkompchamber=self.rspackChunkompchamber||[]).push([["a"],{HO(e,t,n){n.d(t,{P:()=>u});var r=n("j"),i=n("H");let s=`
3
+ .code-editor-native-textarea {
4
+ -webkit-text-fill-color: transparent;
5
+ }
6
+ .code-editor-native-textarea::placeholder {
7
+ -webkit-text-fill-color: var(--theme-ink);
8
+ opacity: 0.45;
9
+ }
10
+ `;function a(){return(0,r.Y)("style",{dangerouslySetInnerHTML:{__html:s}})}function l(e,t){return e.substring(0,t).split("\n")}function o(e){let{value:t,onValueChange:n,highlight:s,padding:o=0,preClassName:c,textareaClassName:d,style:u,className:p,placeholder:h,readOnly:f,autoFocus:m}=e,x=(0,i.li)(null),b=(0,i.li)({stack:[],offset:-1}),[g,y]=(0,i.J0)(!0);(0,i.vJ)(()=>{let e=x.current;if(!e)return;let t={value:e.value,selectionStart:e.selectionStart,selectionEnd:e.selectionEnd,timestamp:Date.now()},{stack:n,offset:r}=b.current;n.length&&r>-1&&(b.current.stack=n.slice(0,r+1)),b.current.stack.push(t),b.current.offset=b.current.stack.length-1},[t]);let k=e=>{let t=x.current,r=b.current.stack[b.current.offset];if(r&&t&&(b.current.stack[b.current.offset]={...r,selectionStart:t.selectionStart,selectionEnd:t.selectionEnd}),b.current.stack.push({...e,timestamp:Date.now()}),b.current.offset=b.current.stack.length-1,b.current.stack.length>100){let e=b.current.stack.length-100;b.current.stack=b.current.stack.slice(e),b.current.offset=Math.max(b.current.offset-e,0)}n(e.value),t&&(t.value=e.value,t.selectionStart=e.selectionStart,t.selectionEnd=e.selectionEnd)},v={paddingTop:o,paddingRight:o,paddingBottom:o,paddingLeft:o},w=s(t),N={margin:0,border:0,background:"none",boxSizing:"inherit",display:"inherit",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontVariantLigatures:"inherit",fontWeight:"inherit",letterSpacing:"inherit",lineHeight:"inherit",tabSize:"inherit",textIndent:"inherit",textRendering:"inherit",textTransform:"inherit",whiteSpace:"pre-wrap",wordBreak:"keep-all",overflowWrap:"break-word"};return(0,r.FD)("div",{className:p,style:{position:"relative",textAlign:"left",boxSizing:"border-box",padding:0,overflow:"hidden",...u},children:[(0,r.Y)("pre",{className:c,"aria-hidden":"true",style:{...N,...v,position:"relative",pointerEvents:"none"},dangerouslySetInnerHTML:{__html:w+"<br />"}}),(0,r.Y)("textarea",{ref:x,className:`code-editor-native-textarea${d?` ${d}`:""}`,style:{...N,...v,position:"absolute",top:0,left:0,height:"100%",width:"100%",resize:"none",color:"inherit",overflow:"hidden",WebkitTextFillColor:"transparent"},value:t,onChange:e=>{let{value:t,selectionStart:r,selectionEnd:i}=e.target,{stack:s,offset:a}=b.current,o=Date.now();s.length&&a>-1&&(b.current.stack=s.slice(0,a+1));let c=b.current.stack[b.current.offset];if(c&&o-c.timestamp<3e3){let e=/[^a-z0-9]([a-z0-9]+)$/i,s=l(c.value,c.selectionStart).pop()?.match(e),a=l(t,r).pop()?.match(e);if(s?.[1]&&a?.[1]?.startsWith(s[1])){b.current.stack[b.current.offset]={value:t,selectionStart:r,selectionEnd:i,timestamp:o},n(t);return}}b.current.stack.push({value:t,selectionStart:r,selectionEnd:i,timestamp:o}),b.current.offset=b.current.stack.length-1,n(t)},onKeyDown:e=>{if("Escape"===e.key)return void e.currentTarget.blur();let{value:t,selectionStart:r,selectionEnd:i}=e.currentTarget,s=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),a=/Win/i.test(navigator.platform);if("Tab"===e.key&&g){if(e.preventDefault(),e.shiftKey){let e=l(t,r),n=e.length-1,s=l(t,i).length-1,a=t.split("\n").map((e,t)=>t>=n&&t<=s&&e.startsWith(" ")?e.substring(2):e).join("\n");if(a!==t){let s=e[n];k({value:a,selectionStart:s?.startsWith(" ")?r-2:r,selectionEnd:i-(t.length-a.length)})}}else if(r!==i){let e=l(t,r),n=e.length-1,s=l(t,i).length-1,a=e[n];k({value:t.split("\n").map((e,t)=>t>=n&&t<=s?" "+e:e).join("\n"),selectionStart:a&&/\S/.test(a)?r+2:r,selectionEnd:i+2*(s-n+1)})}else{let e=r+2;k({value:t.substring(0,r)+" "+t.substring(i),selectionStart:e,selectionEnd:e})}return}if("Backspace"===e.key&&r===i){if(t.substring(0,r).endsWith(" ")){e.preventDefault();let n=r-2;k({value:t.substring(0,r-2)+t.substring(i),selectionStart:n,selectionEnd:n})}return}if("Enter"===e.key&&r===i){let n=l(t,r).pop(),s=n?.match(/^\s+/);if(s?.[0]){e.preventDefault();let n="\n"+s[0],a=r+n.length;k({value:t.substring(0,r)+n+t.substring(i),selectionStart:a,selectionEnd:a})}return}if((s?e.metaKey&&"z"===e.key.toLowerCase():e.ctrlKey&&"z"===e.key.toLowerCase())&&!e.shiftKey&&!e.altKey){e.preventDefault();let{stack:t,offset:r}=b.current,i=t[r-1];i&&x.current&&(x.current.value=i.value,x.current.selectionStart=i.selectionStart,x.current.selectionEnd=i.selectionEnd,n(i.value),b.current.offset=Math.max(r-1,0));return}if((s?e.metaKey&&e.shiftKey&&"z"===e.key.toLowerCase():a?e.ctrlKey&&"y"===e.key.toLowerCase():e.ctrlKey&&e.shiftKey&&"z"===e.key.toLowerCase())&&!e.altKey){e.preventDefault();let{stack:t,offset:r}=b.current,i=t[r+1];i&&x.current&&(x.current.value=i.value,x.current.selectionStart=i.selectionStart,x.current.selectionEnd=i.selectionEnd,n(i.value),b.current.offset=Math.min(r+1,t.length-1));return}e.ctrlKey&&"m"===e.key.toLowerCase()&&(!s||e.shiftKey)&&(e.preventDefault(),y(e=>!e))},placeholder:h,readOnly:f,autoFocus:m,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",spellcheck:!1,"data-gramm":!1}),(0,r.Y)(a,{})]})}var c=n("DU"),d=n("Po");function u(e){let{value:t,onValueChange:n,language:i,wordWrap:s,rootClassName:a,gutterClassName:l,gutterStyle:u,gutterLineClassName:p,editorWrapperClassName:h,editorClassName:f,editorPadding:m=0,editorStyle:x}=e,b=s?"!whitespace-pre-wrap !break-words":"!whitespace-pre !break-normal";return(0,d.w)(),(0,r.FD)("div",{className:a,children:[(0,r.Y)("div",{className:l,style:u,children:t.split("\n").map((e,t)=>(0,r.Y)("div",{className:p,children:t+1},t+1))}),(0,r.Y)("div",{className:h,children:(0,r.Y)(o,{value:t,onValueChange:n,highlight:e=>(0,c.wY)(e,i),padding:m,textareaClassName:`focus:outline-none ${b}`,preClassName:b,style:x,className:f})})]})}},Xg(e,t,n){n.d(t,{M:()=>S});var r=n("j"),i=n("H"),s=n("X"),a=n("FL"),l=n("DU"),o=n("l"),c=n("y");let d=(0,c.A)({name:"text-align-justify",size:24,node:[["path",{d:"M3 5h18",key:"1u36vt"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 19h18",key:"awlh7x"}]],aliases:["align-justify"]}),u=(0,c.A)({name:"space",size:24,node:[["path",{d:"M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1",key:"lt2kga"}]]});var p=n("n"),h=n("z"),f=n("b0"),m=n("I"),x=n("DV"),b=n("r"),g=n("AB"),y=n("ob"),k=n("LQ");function v(e){let{filePath:t,status:n,isStaged:i,viewMode:s,ignoreWhitespace:a,additions:l,deletions:c,isLoading:v,isCopied:w,onToggleViewMode:N,onToggleWhitespace:Y,onStageUnstage:D,onDiscard:S,onOpenInEditor:F,onRefresh:z,onCopyDiff:T}=e,C=t.split("/").pop()||t,L=(0,k.R)(n,i);return(0,r.FD)("div",{className:"flex items-center justify-between px-3 py-1.5 bg-paper border-b border-ink/10 text-xs font-sans select-none flex-shrink-0 overflow-x-auto no-scrollbar",children:[(0,r.FD)("div",{className:"hidden md:flex items-center space-x-2 min-w-0 pr-2",children:[(0,r.Y)(y.o,{name:C,size:14,className:"flex-shrink-0"}),(0,r.Y)("span",{className:"font-mono text-ink font-medium truncate",title:t,children:C}),(0,r.FD)("span",{className:`px-1.5 py-0.5 text-[10px] font-mono font-semibold rounded border ${L.badgeBgClass} flex-shrink-0`,children:[L.charStatus," ",L.label]}),(l>0||c>0)&&(0,r.FD)("div",{className:"flex items-center space-x-1.5 text-[11px] font-mono flex-shrink-0 ml-1",children:[l>0&&(0,r.FD)("span",{className:"text-success font-semibold",children:["+",l]}),c>0&&(0,r.FD)("span",{className:"text-error font-semibold",children:["-",c]})]})]}),(0,r.FD)("div",{className:"flex items-center space-x-1 text-ink/70 flex-shrink-0 ml-auto",children:[(0,r.FD)("div",{className:"flex items-center bg-canvas rounded border border-ink/15 p-0.5 mr-1",children:[(0,r.FD)("button",{type:"button",onClick:N,className:`px-2 py-0.5 rounded text-[11px] font-medium flex items-center space-x-1 transition-colors ${"split"===s?"bg-paper text-ink shadow-xs":"text-ink/60 hover:text-ink"}`,title:"Split (side-by-side) Diff",children:[(0,r.Y)(o.A,{size:12}),(0,r.Y)("span",{className:"hidden sm:inline",children:"Split"})]}),(0,r.FD)("button",{type:"button",onClick:N,className:`px-2 py-0.5 rounded text-[11px] font-medium flex items-center space-x-1 transition-colors ${"unified"===s?"bg-paper text-ink shadow-xs":"text-ink/60 hover:text-ink"}`,title:"Unified Diff",children:[(0,r.Y)(d,{size:12}),(0,r.Y)("span",{className:"hidden sm:inline",children:"Unified"})]})]}),(0,r.Y)("button",{type:"button",onClick:Y,className:`p-1.5 rounded transition-colors ${a?"bg-ink/10 text-ink":"text-ink/50 hover:text-ink hover:bg-ink/5"}`,title:a?"Whitespace ignored":"Ignore whitespace",children:(0,r.Y)(u,{size:13})}),(0,r.Y)("button",{type:"button",onClick:z,className:"p-1.5 text-ink/50 hover:text-ink hover:bg-ink/5 rounded transition-colors",title:"Refresh Diff",disabled:v,children:(0,r.Y)(p.A,{size:13,className:v?"animate-spin":""})}),(0,r.Y)("button",{type:"button",onClick:T,className:"p-1.5 text-ink/50 hover:text-ink hover:bg-ink/5 rounded transition-colors",title:"Copy Diff Text",children:w?(0,r.Y)(h.A,{size:13,className:"text-success"}):(0,r.Y)(f.A,{size:13})}),!i&&(0,r.Y)("button",{type:"button",onClick:S,className:"p-1.5 text-ink/50 hover:text-error hover:bg-error/10 rounded transition-colors",title:"Discard changes in this file",children:(0,r.Y)(m.A,{size:13})}),(0,r.Y)("button",{type:"button",onClick:D,className:"px-2 py-1 text-[11px] font-medium rounded border border-ink/15 hover:bg-ink/5 flex items-center space-x-1 transition-colors text-ink",title:i?"Unstage file":"Stage file",children:i?(0,r.FD)(r.FK,{children:[(0,r.Y)(x.A,{size:12}),(0,r.Y)("span",{children:"Unstage"})]}):(0,r.FD)(r.FK,{children:[(0,r.Y)(b.A,{size:12}),(0,r.Y)("span",{children:"Stage"})]})}),F&&(0,r.FD)("button",{type:"button",onClick:F,className:"px-2 py-1 text-[11px] font-medium rounded bg-ink text-canvas hover:bg-ink/90 flex items-center space-x-1 transition-colors shadow-xs ml-1",title:"Open in Code Editor",children:[(0,r.Y)(g.A,{size:12}),(0,r.Y)("span",{className:"hidden sm:inline",children:"Edit File"})]})]})]})}var w=n("Po");function N(e){let{lines:t,language:n}=e,s=(0,w.w)(),a=(0,i.Kr)(()=>{let e=Array(t.length).fill(""),r=-1,i=i=>{if(r<0)return;let s=(0,l.O9)(t.slice(r,i).map(e=>e.text).join("\n"),n);for(let t=r;t<i;t++)e[t]=s[t-r]??"";r=-1};return t.forEach((e,t)=>{"meta"===e.type?i(t):r<0&&(r=t)}),i(t.length),e},[t,n,s]);return 0===t.length?(0,r.Y)("div",{className:"flex-1 flex items-center justify-center text-ink/40 font-mono text-xs p-8",children:"No differences between working file and target."}):(0,r.Y)("div",{className:"w-full h-full overflow-auto font-mono text-xs select-text bg-paper text-ink code-surface",children:(0,r.Y)("table",{className:"w-max min-w-full border-collapse",children:(0,r.Y)("tbody",{children:t.map((e,t)=>{if("meta"===e.type)return(0,r.FD)("tr",{className:"bg-canvas border-y border-ink/10 text-meta select-none",children:[(0,r.Y)("td",{className:"w-12 text-center py-1 px-2 text-[10px] opacity-60 border-r border-ink/10 font-mono",children:"..."}),(0,r.Y)("td",{className:"w-12 text-center py-1 px-2 text-[10px] opacity-60 border-r border-ink/10 font-mono",children:"..."}),(0,r.Y)("td",{className:"py-1 px-3 text-[11px] font-semibold text-meta font-mono tracking-tight",children:e.text})]},t);let n="add"===e.type,i="del"===e.type;return(0,r.FD)("tr",{className:`transition-colors group ${n?"bg-success/10 hover:bg-success/15":i?"bg-error/10 hover:bg-error/15":"hover:bg-ink/[0.03]"}`,children:[(0,r.Y)("td",{className:`w-12 py-0.5 px-2 text-right text-[10px] select-none border-r border-ink/10 font-mono ${i?"bg-error/15 text-error font-semibold":n?"bg-success/15 text-success/70":"bg-canvas/50 text-ink/40"}`,children:e.oldLineNumber||""}),(0,r.Y)("td",{className:`w-12 py-0.5 px-2 text-right text-[10px] select-none border-r border-ink/10 font-mono ${n?"bg-success/15 text-success font-semibold":i?"bg-error/15 text-error/70":"bg-canvas/50 text-ink/40"}`,children:e.newLineNumber||""}),(0,r.FD)("td",{className:"py-0.5 px-3 whitespace-pre text-ink pr-6",children:[(0,r.Y)("span",{className:`inline-block w-4 text-center select-none font-bold ${n?"text-success":i?"text-error":"opacity-0"}`,children:n?"+":i?"-":" "}),(0,r.Y)("span",{className:"shiki",dangerouslySetInnerHTML:{__html:e.text&&a[t]||"&nbsp;"}})]})]},t)})})})})}function Y(e){let{rows:t,language:n}=e,s=(0,w.w)(),a=(0,i.Kr)(()=>{let e=Array(t.length).fill(""),r=Array(t.length).fill(""),i=-1,s=s=>{if(i<0)return;let a=t.slice(i,s),o=(0,l.O9)(a.map(e=>e.left?.text??"").join("\n"),n),c=(0,l.O9)(a.map(e=>e.right?.text??"").join("\n"),n);for(let t=i;t<s;t++)e[t]=o[t-i]??"",r[t]=c[t-i]??"";i=-1};return t.forEach((e,t)=>{e.isMeta?s(t):i<0&&(i=t)}),s(t.length),{left:e,right:r}},[t,n,s]);return 0===t.length?(0,r.Y)("div",{className:"flex-1 flex items-center justify-center text-ink/40 font-mono text-xs p-8",children:"No differences between working file and target."}):(0,r.Y)("div",{className:"w-full h-full overflow-auto font-mono text-xs select-text bg-paper text-ink code-surface",children:(0,r.FD)("div",{className:"w-max min-w-full min-w-[700px]",children:[(0,r.FD)("div",{className:"grid grid-cols-2 sticky top-0 z-10 bg-canvas border-b border-ink/10 text-[11px] text-ink/70 font-sans select-none shadow-xs",children:[(0,r.Y)("div",{className:"px-3 py-1 font-medium border-r border-ink/10 flex items-center justify-between",children:(0,r.Y)("span",{children:"Original (HEAD / Base)"})}),(0,r.Y)("div",{className:"px-3 py-1 font-medium flex items-center justify-between",children:(0,r.Y)("span",{children:"Modified (Working Tree)"})})]}),(0,r.Y)("table",{className:"w-full border-collapse",children:(0,r.Y)("tbody",{children:t.map((e,t)=>{if(e.isMeta)return(0,r.Y)("tr",{className:"bg-canvas border-y border-ink/10 text-meta select-none",children:(0,r.Y)("td",{colSpan:4,className:"py-1 px-3 text-[11px] font-semibold text-meta text-center font-mono",children:e.metaText})},t);let n=e.left,i=e.right,s=n?.type==="del",l=i?.type==="add";return(0,r.FD)("tr",{className:"border-b border-ink/[0.04]",children:[(0,r.Y)("td",{className:`w-12 py-0.5 px-2 text-right text-[10px] select-none border-r border-ink/10 font-mono ${s?"bg-error/15 text-error font-semibold":n?"bg-canvas/50 text-ink/40":"bg-canvas/80 text-transparent"}`,children:n?.lineNumber||""}),(0,r.Y)("td",{className:`min-w-[320px] py-0.5 px-2 whitespace-pre border-r border-ink/10 text-ink ${s?"bg-error/10":n?"hover:bg-ink/[0.02]":"bg-canvas/40 select-none"}`,children:n?(0,r.FD)(r.FK,{children:[(0,r.Y)("span",{className:`inline-block w-4 text-center select-none font-bold ${s?"text-error":"opacity-0"}`,children:s?"-":" "}),(0,r.Y)("span",{className:"shiki",dangerouslySetInnerHTML:{__html:n.text&&a.left[t]||"&nbsp;"}})]}):(0,r.Y)("span",{className:"opacity-0",children:" "})}),(0,r.Y)("td",{className:`w-12 py-0.5 px-2 text-right text-[10px] select-none border-r border-ink/10 font-mono ${l?"bg-success/15 text-success font-semibold":i?"bg-canvas/50 text-ink/40":"bg-canvas/80 text-transparent"}`,children:i?.lineNumber||""}),(0,r.Y)("td",{className:`min-w-[320px] py-0.5 px-2 whitespace-pre text-ink ${l?"bg-success/10":i?"hover:bg-ink/[0.02]":"bg-canvas/40 select-none"}`,children:i?(0,r.FD)(r.FK,{children:[(0,r.Y)("span",{className:`inline-block w-4 text-center select-none font-bold ${l?"text-success":"opacity-0"}`,children:l?"+":" "}),(0,r.Y)("span",{className:"shiki",dangerouslySetInnerHTML:{__html:i.text&&a.right[t]||"&nbsp;"}})]}):(0,r.Y)("span",{className:"opacity-0",children:" "})})]},t)})})})]})})}var D=n("p");function S(e){let{filePath:t,status:n="M",isStaged:o=!1,root:c,repo:d=".",onOpenInEditor:u,onFileSaved:h,className:f=""}=e,[m,x]=(0,a.LO)("diff.viewMode","unified"),[b,g]=(0,a.LO)("diff.ignoreWhitespace",!1),[y,k]=(0,i.J0)(""),[w,S]=(0,i.J0)(n),[F,z]=(0,i.J0)(o),[T,C]=(0,i.J0)(!0),[L,j]=(0,i.J0)(null),[A,M]=(0,i.J0)(!1),[E,W]=(0,i.J0)(!1),$=(0,s.L)(),J=(0,i.hb)(async()=>{if(t){C(!0),j(null);try{let e=new URLSearchParams({fileDiff:"1",file:t,staged:F?"1":"0",repo:d||"."});(n||w)&&e.set("status",n||w),c&&e.set("root",c);let r=await fetch(`/api/fs/git?${e.toString()}`),i=await r.json();i.success?(k(i.diff||""),i.status&&S(i.status)):j(i.error||"Failed to load file diff")}catch(e){j(e.message||"Error fetching diff")}finally{C(!1)}}},[t,F,d,c]);(0,i.vJ)(()=>{S(n),z(o)},[n,o,t]),(0,i.vJ)(()=>{J()},[J]);let K=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[],r=[],i=0,s=0;if(!e||!e.trim())return{lines:n,splitRows:r,additions:i,deletions:s};let a=e.split(/\r?\n/),l=a.some(e=>e.startsWith("@@"))?a:[`@@ -1,${a.length} +1,${a.length} @@`,...a],o=1,c=1,d=[],u=[],p=()=>{let e=Math.max(d.length,u.length);for(let t=0;t<e;t++)r.push({left:d[t]?{type:"del",text:d[t].text,lineNumber:d[t].lineNumber}:void 0,right:u[t]?{type:"add",text:u[t].text,lineNumber:u[t].lineNumber}:void 0});d=[],u=[]};for(let e of l)if(!(e.startsWith("diff --git")||e.startsWith("index ")||e.startsWith("---")||e.startsWith("+++")||e.startsWith("new file mode")||e.startsWith("deleted file mode")||e.startsWith("similarity index")||e.startsWith("old mode")||e.startsWith("new mode")||e.startsWith("\\ No newline"))){if(e.startsWith("@@")){p();let t=e.match(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);t&&(o=parseInt(t[1],10),c=parseInt(t[2],10)),n.push({type:"meta",text:e}),r.push({isMeta:!0,metaText:e});continue}if(e.startsWith("+")){let r=e.slice(1),s=t?r.trim():r;i++,n.push({type:"add",text:s,newLineNumber:c}),u.push({text:s,lineNumber:c}),c++}else if(e.startsWith("-")){let r=e.slice(1),i=t?r.trim():r;s++,n.push({type:"del",text:i,oldLineNumber:o}),d.push({text:i,lineNumber:o}),o++}else{p();let i=e.startsWith(" ")?e.slice(1):e,s=t?i.trim():i;n.push({type:"context",text:s,oldLineNumber:o,newLineNumber:c}),r.push({left:{type:"context",text:s,lineNumber:o},right:{type:"context",text:s,lineNumber:c}}),o++,c++}}return p(),{lines:n,splitRows:r,additions:i,deletions:s}}(y,b),O=(0,l.sQ)(t);return(0,r.FD)("div",{className:`flex flex-col h-full bg-paper select-text relative font-sans ${f}`,children:[(0,r.Y)(v,{filePath:t,status:w,isStaged:F,viewMode:m,ignoreWhitespace:b,additions:K.additions,deletions:K.deletions,isLoading:T,isCopied:A,onToggleViewMode:()=>{x("unified"===m?"split":"unified")},onToggleWhitespace:()=>{g(!b)},onStageUnstage:()=>{let e=F?"unstage":"stage",n=new FormData;n.set("actionType",e),n.set("file",t),n.set("repo",d||"."),c&&n.set("root",c),$.submit(n,{method:"POST",action:"/api/fs/git"}),z(!F),setTimeout(()=>{J(),h?.()},300)},onDiscard:()=>{W(!0)},onOpenInEditor:u,onRefresh:J,onCopyDiff:()=>{y&&(navigator.clipboard.writeText(y),M(!0),setTimeout(()=>M(!1),2e3))}}),(0,r.Y)("div",{className:"flex-1 overflow-hidden relative flex flex-col bg-paper",children:T?(0,r.FD)("div",{className:"flex-1 flex items-center justify-center space-x-2 text-ink/50 text-xs font-mono",children:[(0,r.Y)(p.A,{size:14,className:"animate-spin"}),(0,r.Y)("span",{children:"Loading file diff..."})]}):L?(0,r.FD)("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center space-y-2",children:[(0,r.Y)(D.A,{size:20,className:"text-error"}),(0,r.Y)("p",{className:"text-xs text-error font-medium",children:L}),(0,r.Y)("button",{onClick:J,className:"px-3 py-1 text-xs bg-ink/10 hover:bg-ink/15 text-ink rounded font-sans transition-colors",children:"Retry"})]}):"split"===m?(0,r.Y)(Y,{rows:K.splitRows,language:O}):(0,r.Y)(N,{lines:K.lines,language:O})}),E&&(0,r.Y)("div",{className:"fixed inset-0 bg-ink/20 z-50 flex items-center justify-center p-4 backdrop-blur-xs",children:(0,r.FD)("div",{className:"bg-paper rounded-lg shadow-xl p-4 w-full max-w-sm border border-ink/15",children:[(0,r.Y)("h3",{className:"font-semibold text-ink mb-1.5 text-sm",children:"Discard Changes?"}),(0,r.FD)("p",{className:"text-xs text-ink/70 mb-4",children:["Are you sure you want to discard all unstaged changes in ",(0,r.Y)("span",{className:"font-mono font-medium text-ink",children:t}),"? This cannot be undone."]}),(0,r.FD)("div",{className:"flex justify-end space-x-2",children:[(0,r.Y)("button",{type:"button",onClick:()=>W(!1),className:"px-3 py-1.5 text-xs text-ink hover:bg-ink/5 rounded transition-colors",children:"Cancel"}),(0,r.Y)("button",{type:"button",onClick:()=>{W(!1);let e=new FormData;e.set("actionType","discard"),e.set("file",t),e.set("repo",d||"."),c&&e.set("root",c),$.submit(e,{method:"POST",action:"/api/fs/git"}),setTimeout(()=>{J(),h?.()},300)},className:"px-3 py-1.5 text-xs bg-error text-white rounded hover:bg-error/90 font-medium transition-colors",children:"Discard Changes"})]})]})})]})}},XY(e,t,n){var r=n("H"),i=n("DU");function s(e){return String(e.id??e.path??e.name)}function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{fallback:n,reportLoadError:a=!1,flushOnUnmount:l=!1,reportSaveError:o=!1,downloadMimeType:c="text/plain",onFileSaved:d}=t,[u,p]=(0,r.J0)({}),[h,f]=(0,r.J0)({}),[m,x]=(0,r.J0)(!1),[b,g]=(0,r.J0)(null),[y,k]=(0,r.J0)("idle"),[v,w]=(0,r.J0)(!1),N=e?s(e):"",Y=e?u[N]??e.content??"":"",D=Y!==(h[N]??Y),S=(0,r.li)(new Set),F=(0,r.li)(null),z=(0,r.hb)((e,t)=>{p(n=>({...n,[e]:t})),f(n=>({...n,[e]:t}))},[]),T=(0,r.hb)(async(e,t)=>{if(!e.path)return;k("saving");let n=new FormData;n.append("actionType","save"),n.append("path",e.path),n.append("content",t),e.root&&n.append("root",e.root),e.repo&&"."!==e.repo&&n.append("repo",e.repo);try{let r=await fetch("/api/fs/action",{method:"POST",body:n}),i=await r.json().catch(()=>null);r.ok&&i?.success?(k("saved"),f(n=>({...n,[s(e)]:t})),d?.()):k(o?"error":"idle")}catch{k(o?"error":"idle")}},[d,o]),C=(0,r.li)(T);C.current=T,(0,r.vJ)(()=>{if(!e)return;let t=s(e);if(S.current.has(t))return;if(S.current.add(t),void 0!==e.content){z(t,e.content),g(null);return}if(!e.path)return a?void g("No file path supplied for this attachment."):void z(t,n?n(e.name):"");let r=!1;x(!0),g(null);let i=new URLSearchParams({path:e.path});return e.root&&i.set("root",e.root),e.repo&&"."!==e.repo&&i.set("repo",e.repo),fetch(`/api/fs/read?${i.toString()}`).then(async e=>{let t=await e.json().catch(()=>null);if(a){if(!e.ok||!t||"string"!=typeof t.content)throw Error(t?.error||`HTTP ${e.status}`);return t.content}return"string"==typeof t?.content?t.content:null}).then(i=>{r||z(t,i??(n?n(e.name):""))}).catch(i=>{r||(a?(z(t,""),g(i instanceof Error?i.message:"Failed to read file")):z(t,n?n(e.name):""))}).finally(()=>{r||x(!1)}),()=>{r=!0}},[N,e,n,a,z]),(0,r.vJ)(()=>{if("saved"!==y)return;let e=window.setTimeout(()=>k("idle"),1500);return()=>window.clearTimeout(e)},[y]);let L=(0,r.hb)(t=>{if(!e)return;let n=s(e);if(p(e=>({...e,[n]:t})),!e.path)return;F.current&&window.clearTimeout(F.current.timer);let r=window.setTimeout(()=>{F.current=null,C.current(e,t)},800);F.current={timer:r,file:e,content:t}},[e]),j=(0,r.hb)(()=>{if(!e)return;let t=u[s(e)];void 0!==t&&(F.current&&(window.clearTimeout(F.current.timer),F.current=null),C.current(e,t))},[e,u]),A=(0,r.hb)(()=>{e&&navigator.clipboard&&navigator.clipboard.writeText(u[s(e)]??"").then(()=>{w(!0),window.setTimeout(()=>w(!1),1500)}).catch(()=>{})},[e,u]),M=(0,r.hb)(()=>{if(!e)return;let t=new Blob([u[s(e)]??""],{type:c}),n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download=e.name,r.click(),URL.revokeObjectURL(n)},[e,u,c]),E=(0,r.hb)(()=>{N&&(S.current.delete(N),p(e=>{if(void 0===e[N])return e;let t={...e};return delete t[N],t}))},[N]),W=(0,r.hb)(()=>{S.current.clear(),p({}),f({})},[]),$=(0,r.hb)(e=>{let t=new Set(e.map(String));for(let e of Array.from(S.current))t.has(e)||S.current.delete(e);p(e=>{let n=Object.keys(e);if(n.every(e=>t.has(e)))return e;let r={};for(let i of n)t.has(i)&&(r[i]=e[i]);return r})},[]);return(0,r.vJ)(()=>{if(l)return()=>{let e=F.current;e&&(window.clearTimeout(e.timer),F.current=null,C.current(e.file,e.content))}},[l]),{content:Y,onChange:L,isLoading:m,loadError:b,saveStatus:y,copied:v,isDirty:D,language:e?(0,i.sQ)(e.name):"javascript",saveNow:j,copy:A,download:M,reload:E,reset:W,retain:$}}n.d(t,{n:()=>a})},Soe(e,t,n){let r=(0,n("y").A)({name:"eye-off",size:24,node:[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]});n.d(t,{},{A:r})},DV(e,t,n){let r=(0,n("y").A)({name:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]});n.d(t,{},{A:r})},yh(e,t,n){let r=(0,n("y").A)({name:"text-wrap",size:24,node:[["path",{d:"m16 16-3 3 3 3",key:"117b85"}],["path",{d:"M3 12h14.5a1 1 0 0 1 0 7H13",key:"18xa6z"}],["path",{d:"M3 19h6",key:"1ygdsz"}],["path",{d:"M3 5h18",key:"1u36vt"}]],aliases:["wrap-text"]});n.d(t,{},{A:r})},na(e,t,n){let r=(0,n("y").A)({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"}]]});n.d(t,{},{A:r})},hj(e,t,n){let r=(0,n("y").A)({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"}]]});n.d(t,{},{A:r})}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.rspackChunkompchamber=self.rspackChunkompchamber||[]).push([["ar"],{IX(e,a,n){n.r(a),a.default=[Object.freeze(JSON.parse('{"displayName":"Haskell","fileTypes":["hs","hs-boot","hsig"],"name":"haskell","patterns":[{"include":"#liquid_haskell"},{"include":"#comment_like"},{"include":"#numeric_literals"},{"include":"#string_literal"},{"include":"#char_literal"},{"match":"(?<![#@])-}","name":"invalid"},{"captures":{"1":{"name":"punctuation.paren.haskell"},"2":{"name":"punctuation.paren.haskell"}},"match":"(\\\\()\\\\s*(\\\\))","name":"constant.language.unit.haskell"},{"captures":{"1":{"name":"punctuation.paren.haskell"},"2":{"name":"keyword.operator.hash.haskell"},"3":{"name":"keyword.operator.hash.haskell"},"4":{"name":"punctuation.paren.haskell"}},"match":"(\\\\()(#)\\\\s*(#)(\\\\))","name":"constant.language.unit.unboxed.haskell"},{"captures":{"1":{"name":"punctuation.paren.haskell"},"2":{"name":"punctuation.paren.haskell"}},"match":"(\\\\()\\\\s*,[,\\\\s]*(\\\\))","name":"support.constant.tuple.haskell"},{"captures":{"1":{"name":"punctuation.paren.haskell"},"2":{"name":"keyword.operator.hash.haskell"},"3":{"name":"keyword.operator.hash.haskell"},"4":{"name":"punctuation.paren.haskell"}},"match":"(\\\\()(#)\\\\s*,[,\\\\s]*(#)(\\\\))","name":"support.constant.tuple.unboxed.haskell"},{"captures":{"1":{"name":"punctuation.bracket.haskell"},"2":{"name":"punctuation.bracket.haskell"}},"match":"(\\\\[)\\\\s*(])","name":"constant.language.empty-list.haskell"},{"begin":"(\\\\b(?<!\')(module)|^(signature))\\\\b((?!\'))","beginCaptures":{"2":{"name":"keyword.other.module.haskell"},"3":{"name":"keyword.other.signature.haskell"}},"end":"(?=\\\\b(?<!\')where\\\\b(?!\'))","name":"meta.declaration.module.haskell","patterns":[{"include":"#comment_like"},{"include":"#module_name"},{"include":"#module_exports"},{"match":"[a-z]+","name":"invalid"}]},{"include":"#ffi"},{"begin":"^(\\\\s*)(class)\\\\b((?!\'))","beginCaptures":{"2":{"name":"keyword.other.class.haskell"}},"end":"(?=(?<!\')\\\\bwhere\\\\b(?!\'))|(?=[;}])|^(?!\\\\1\\\\s+\\\\S|\\\\s*(?:$|\\\\{-[^@]|--+(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]).*$))","name":"meta.declaration.class.haskell","patterns":[{"include":"#comment_like"},{"include":"#where"},{"include":"#type_signature"}]},{"begin":"^(\\\\s*)(data|newtype)(?:\\\\s+(instance))?\\\\s+((?:(?!(?<![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]])(?:=|--+)(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]])|\\\\b(?<!\')(?:where|deriving)\\\\b(?!\')|\\\\{-).)*)(?=\\\\b(?<!\'\')where\\\\b(?!\'\'))","beginCaptures":{"2":{"name":"keyword.other.$2.haskell"},"3":{"name":"keyword.other.instance.haskell"},"4":{"patterns":[{"include":"#type_signature"}]}},"end":"(?=(?<!\')\\\\bderiving\\\\b(?!\'))|(?=[;}])|^(?!\\\\1\\\\s+\\\\S|\\\\s*(?:$|\\\\{-[^@]|--+(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]).*$))","name":"meta.declaration.$2.generalized.haskell","patterns":[{"include":"#comment_like"},{"begin":"(?<!\')\\\\b(where)\\\\s*(\\\\{)(?!-)","beginCaptures":{"1":{"name":"keyword.other.where.haskell"},"2":{"name":"punctuation.brace.haskell"}},"end":"(})","endCaptures":{"1":{"name":"punctuation.brace.haskell"}},"patterns":[{"include":"#comment_like"},{"include":"#gadt_constructor"},{"match":";","name":"punctuation.semicolon.haskell"}]},{"match":"\\\\b(?<!\')(where)\\\\b(?!\')","name":"keyword.other.where.haskell"},{"include":"#deriving"},{"include":"#gadt_constructor"}]},{"include":"#role_annotation"},{"begin":"^(\\\\s*)(pattern)\\\\s+(.*?)\\\\s+(::|∷)(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]])","beginCaptures":{"2":{"name":"keyword.other.pattern.haskell"},"3":{"patterns":[{"include":"#comma"},{"include":"#data_constructor"}]},"4":{"name":"keyword.operator.double-colon.haskell"}},"end":"(?=[;}])|^(?!\\\\1\\\\s+\\\\S|\\\\s*(?:$|\\\\{-[^@]|--+(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]).*$))","name":"meta.declaration.pattern.type.haskell","patterns":[{"include":"#type_signature"}]},{"begin":"^\\\\s*(pattern)\\\\b(?!\')","captures":{"1":{"name":"keyword.other.pattern.haskell"}},"end":"(?=[;}])|^(?!\\\\1\\\\s+\\\\S|\\\\s*(?:$|\\\\{-[^@]|--+(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]).*$))","name":"meta.declaration.pattern.haskell","patterns":[{"include":"$self"}]},{"begin":"^(\\\\s*)(data|newtype)(?:\\\\s+(family|instance))?\\\\s+(((?!(?<![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]])(?:=|--+)(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]])|\\\\b(?<!\')(?:where|deriving)\\\\b(?!\')|\\\\{-).)*)","beginCaptures":{"2":{"name":"keyword.other.$2.haskell"},"3":{"name":"keyword.other.$3.haskell"},"4":{"patterns":[{"include":"#type_signature"}]}},"end":"(?=[;}])|^(?!\\\\1\\\\s+\\\\S|\\\\s*(?:$|\\\\{-[^@]|--+(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]).*$))","name":"meta.declaration.$2.algebraic.haskell","patterns":[{"include":"#comment_like"},{"include":"#deriving"},{"include":"#forall"},{"include":"#adt_constructor"},{"include":"#context"},{"include":"#record_decl"},{"include":"#type_signature"}]},{"begin":"^(\\\\s*)(type)\\\\s+(family)\\\\b(?!\')(((?!(?<![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]])(?:=|--+)(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]])|\\\\b(?<!\')where\\\\b(?!\')|\\\\{-).)*)","beginCaptures":{"2":{"name":"keyword.other.type.haskell"},"3":{"name":"keyword.other.family.haskell"},"4":{"patterns":[{"include":"#comment_like"},{"include":"#where"},{"include":"#type_signature"}]}},"end":"(?=[;}])|^(?!\\\\1\\\\s+\\\\S|\\\\s*(?:$|\\\\{-[^@]|--+(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]).*$))","name":"meta.declaration.type.family.haskell","patterns":[{"include":"#comment_like"},{"include":"#where"},{"include":"#type_signature"}]},{"begin":"^(\\\\s*)(type)(?:\\\\s+(instance))?\\\\s+(((?!(?<![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]])(?:=|--+|::|∷)(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]])|\\\\{-).)*)","beginCaptures":{"2":{"name":"keyword.other.type.haskell"},"3":{"name":"keyword.other.instance.haskell"},"4":{"patterns":[{"include":"#type_signature"}]}},"end":"(?=[;}])|^(?!\\\\1\\\\s+\\\\S|\\\\s*(?:$|\\\\{-[^@]|--+(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]).*$))","name":"meta.declaration.type.haskell","patterns":[{"include":"#type_signature"}]},{"begin":"^(\\\\s*)(instance)\\\\b((?!\'))","beginCaptures":{"2":{"name":"keyword.other.instance.haskell"}},"end":"(?=\\\\b(?<!\')(where)\\\\b(?!\'))|(?=[;}])|^(?!\\\\1\\\\s+\\\\S|\\\\s*(?:$|\\\\{-[^@]|--+(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]).*$))","name":"meta.declaration.instance.haskell","patterns":[{"include":"#comment_like"},{"include":"#where"},{"include":"#type_signature"}]},{"begin":"^(\\\\s*)(import)\\\\b((?!\'))","beginCaptures":{"2":{"name":"keyword.other.import.haskell"}},"end":"(?=\\\\b(?<!\')(where)\\\\b(?!\'))|(?=[;}])|^(?!\\\\1\\\\s+\\\\S|\\\\s*(?:$|\\\\{-[^@]|--+(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]).*$))","name":"meta.import.haskell","patterns":[{"include":"#comment_like"},{"include":"#where"},{"captures":{"1":{"name":"keyword.other.$1.haskell"}},"match":"(qualified|as|hiding)"},{"include":"#module_name"},{"include":"#module_exports"}]},{"include":"#deriving"},{"include":"#layout_herald"},{"include":"#keyword"},{"captures":{"1":{"name":"keyword.other.$1.haskell"},"2":{"patterns":[{"include":"#comment_like"},{"include":"#integer_literals"},{"include":"#infix_op"}]}},"match":"^\\\\s*(infix[lr]?)\\\\s+(.*)","name":"meta.fixity-declaration.haskell"},{"include":"#overloaded_label"},{"include":"#type_application"},{"include":"#reserved_symbol"},{"include":"#fun_decl"},{"include":"#qualifier"},{"include":"#data_constructor"},{"include":"#start_type_signature"},{"include":"#prefix_op"},{"include":"#infix_op"},{"begin":"(\\\\()(#)\\\\s","beginCaptures":{"1":{"name":"punctuation.paren.haskell"},"2":{"name":"keyword.operator.hash.haskell"}},"end":"(#)(\\\\))","endCaptures":{"1":{"name":"keyword.operator.hash.haskell"},"2":{"name":"punctuation.paren.haskell"}},"patterns":[{"include":"#comma"},{"include":"$self"}]},{"begin":"(\\\\()","beginCaptures":{"1":{"name":"punctuation.paren.haskell"}},"end":"(\\\\))","endCaptures":{"1":{"name":"punctuation.paren.haskell"}},"patterns":[{"include":"#comma"},{"include":"$self"}]},{"include":"#quasi_quote"},{"begin":"(\\\\[)","beginCaptures":{"1":{"name":"punctuation.bracket.haskell"}},"end":"(])","endCaptures":{"1":{"name":"punctuation.bracket.haskell"}},"patterns":[{"include":"#comma"},{"include":"$self"}]},{"include":"#record"}],"repository":{"adt_constructor":{"patterns":[{"include":"#comment_like"},{"begin":"(?<![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]])(?:(=)|(\\\\|))(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]])","beginCaptures":{"1":{"name":"keyword.operator.eq.haskell"},"2":{"name":"keyword.operator.pipe.haskell"}},"end":"(?:\\\\G|^)\\\\s*(?:(?<!\')\\\\b([\'._\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]+)|(\'?(?<paren>\\\\((?:[^()]?|\\\\g<paren>)*\\\\)))|(\'?(?<brac>\\\\((?:[^]\\\\[]?|\\\\g<brac>)*])))\\\\s*(?:(?<![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]])(:[[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]*)|(`)([\\\\p{Lu}\\\\p{Lt}][\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*)(`))|(?<!\')\\\\b([\\\\p{Lu}\\\\p{Lt}][\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*)|(\\\\()\\\\s*(:[[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]*)\\\\s*(\\\\))","endCaptures":{"1":{"patterns":[{"include":"#type_signature"}]},"2":{"patterns":[{"include":"#type_signature"}]},"4":{"patterns":[{"include":"#type_signature"}]},"6":{"name":"constant.other.operator.haskell"},"7":{"name":"punctuation.backtick.haskell"},"8":{"name":"constant.other.haskell"},"9":{"name":"punctuation.backtick.haskell"},"10":{"name":"constant.other.haskell"},"11":{"name":"punctuation.paren.haskell"},"12":{"name":"constant.other.operator.haskell"},"13":{"name":"punctuation.paren.haskell"}},"patterns":[{"include":"#comment_like"},{"include":"#deriving"},{"include":"#record_decl"},{"include":"#forall"},{"include":"#context"}]}]},"block_comment":{"applyEndPatternLast":1,"begin":"\\\\{-","captures":{"0":{"name":"punctuation.definition.comment.haskell"}},"end":"-}","name":"comment.block.haskell","patterns":[{"include":"#block_comment"}]},"char_literal":{"captures":{"1":{"name":"punctuation.definition.string.begin.haskell"},"2":{"name":"constant.character.escape.haskell"},"3":{"name":"constant.character.escape.octal.haskell"},"4":{"name":"constant.character.escape.hexadecimal.haskell"},"5":{"name":"constant.character.escape.control.haskell"},"6":{"name":"punctuation.definition.string.end.haskell"}},"match":"(?<![\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d])(\')(?:[ -\\\\[\\\\]-~]|(\\\\\\\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[\\"\\\\&\'\\\\\\\\abfnrtv]))|(\\\\\\\\o[0-7]+)|(\\\\\\\\x\\\\h+)|(\\\\\\\\\\\\^[@-_]))(\')","name":"string.quoted.single.haskell"},"comma":{"match":",","name":"punctuation.separator.comma.haskell"},"comment_like":{"patterns":[{"include":"#cpp"},{"include":"#pragma"},{"include":"#comments"}]},"comments":{"patterns":[{"begin":"^(\\\\s*)(--\\\\s[$|])","beginCaptures":{"2":{"name":"punctuation.whitespace.comment.leading.haskell"}},"end":"(?=^(?!\\\\1--+(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]])))","name":"comment.block.documentation.haskell"},{"begin":"(^[\\\\t ]+)?(--\\\\s[*^])","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.haskell"}},"end":"\\\\n","name":"comment.line.documentation.haskell"},{"applyEndPatternLast":1,"begin":"\\\\{-\\\\s?[$*^|]","captures":{"0":{"name":"punctuation.definition.comment.haskell"}},"end":"-}","name":"comment.block.documentation.haskell","patterns":[{"include":"#block_comment"}]},{"begin":"(^[\\\\t ]+)?(?=--+(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]))","beginCaptures":{"1":{"name":"punctuation.whitespace.comment.leading.haskell"}},"end":"(?!\\\\G)","patterns":[{"begin":"--","beginCaptures":{"0":{"name":"punctuation.definition.comment.haskell"}},"end":"\\\\n","name":"comment.line.double-dash.haskell"}]},{"include":"#block_comment"}]},"context":{"captures":{"1":{"patterns":[{"include":"#comment_like"},{"include":"#type_signature"}]},"2":{"name":"keyword.operator.big-arrow.haskell"}},"match":"(.*)(?<![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]])(=>|⇒)(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]])"},"cpp":{"captures":{"1":{"name":"punctuation.definition.preprocessor.c"}},"match":"^(#).*$","name":"meta.preprocessor.c"},"data_constructor":{"match":"\\\\b(?<!\')[\\\\p{Lu}\\\\p{Lt}][\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*(?![\'.\\\\w])","name":"constant.other.haskell"},"deriving":{"patterns":[{"begin":"^(\\\\s*)(deriving)\\\\s+(?:(via|stock|newtype|anyclass)\\\\s+)?","beginCaptures":{"2":{"name":"keyword.other.deriving.haskell"},"3":{"name":"keyword.other.deriving.strategy.$3.haskell"}},"end":"(?=[;}])|^(?!\\\\1\\\\s+\\\\S|\\\\s*(?:$|\\\\{-[^@]|--+(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]).*$))","name":"meta.deriving.haskell","patterns":[{"include":"#comment_like"},{"match":"(?<!\')\\\\b(instance)\\\\b(?!\')","name":"keyword.other.instance.haskell"},{"captures":{"1":{"name":"keyword.other.deriving.strategy.$1.haskell"}},"match":"(?<!\')\\\\b(via|stock|newtype|anyclass)\\\\b(?!\')"},{"include":"#type_signature"}]},{"begin":"(deriving)(?:\\\\s+(stock|newtype|anyclass))?\\\\s*(\\\\()","beginCaptures":{"1":{"name":"keyword.other.deriving.haskell"},"2":{"name":"keyword.other.deriving.strategy.$2.haskell"},"3":{"name":"punctuation.paren.haskell"}},"end":"(\\\\))","endCaptures":{"1":{"name":"punctuation.paren.haskell"}},"name":"meta.deriving.haskell","patterns":[{"include":"#type_signature"}]},{"captures":{"1":{"name":"keyword.other.deriving.haskell"},"2":{"name":"keyword.other.deriving.strategy.$2.haskell"},"3":{"patterns":[{"include":"#type_signature"}]},"5":{"name":"keyword.other.deriving.strategy.via.haskell"},"6":{"patterns":[{"include":"#type_signature"}]}},"match":"(deriving)(?:\\\\s+(stock|newtype|anyclass))?\\\\s+([\\\\p{Lu}\\\\p{Lt}][\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*)(\\\\s+(via)\\\\s+(.*)$)?","name":"meta.deriving.haskell"},{"match":"(?<!\')\\\\b(via)\\\\b(?!\')","name":"keyword.other.deriving.strategy.via.haskell"}]},"double_colon":{"captures":{"1":{"name":"keyword.operator.double-colon.haskell"}},"match":"\\\\s*(::|∷)(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]])\\\\s*"},"export_constructs":{"patterns":[{"include":"#comment_like"},{"begin":"\\\\b(?<!\')(pattern)\\\\b(?!\')","beginCaptures":{"1":{"name":"keyword.other.pattern.haskell"}},"end":"([\\\\p{Lu}\\\\p{Lt}][\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*)|(\\\\()\\\\s*(:[[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]+)\\\\s*(\\\\))","endCaptures":{"1":{"name":"constant.other.haskell"},"2":{"name":"punctuation.paren.haskell"},"3":{"name":"constant.other.operator.haskell"},"4":{"name":"punctuation.paren.haskell"}},"patterns":[{"include":"#comment_like"}]},{"begin":"\\\\b(?<!\')(type)\\\\b(?!\')","beginCaptures":{"1":{"name":"keyword.other.type.haskell"}},"end":"([\\\\p{Lu}\\\\p{Lt}][\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*)|(\\\\()\\\\s*([[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]+)\\\\s*(\\\\))","endCaptures":{"1":{"name":"storage.type.haskell"},"2":{"name":"punctuation.paren.haskell"},"3":{"name":"storage.type.operator.haskell"},"4":{"name":"punctuation.paren.haskell"}},"patterns":[{"include":"#comment_like"}]},{"match":"(?<!\')\\\\b[_\\\\p{Ll}][\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*","name":"entity.name.function.haskell"},{"match":"(?<!\')\\\\b[\\\\p{Lu}\\\\p{Lt}][\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*","name":"storage.type.haskell"},{"include":"#record_wildcard"},{"include":"#reserved_symbol"},{"include":"#prefix_op"}]},"ffi":{"begin":"^(\\\\s*)(foreign)\\\\s+((?:im|ex)port)\\\\s+","beginCaptures":{"2":{"name":"keyword.other.foreign.haskell"},"3":{"name":"keyword.other.$3.haskell"}},"end":"(?=[;}])|^(?!\\\\1\\\\s+\\\\S|\\\\s*(?:$|\\\\{-[^@]|--+(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]).*$))","name":"meta.$3.foreign.haskell","patterns":[{"include":"#comment_like"},{"captures":{"1":{"name":"keyword.other.calling-convention.$1.haskell"}},"match":"\\\\b(?<!\')(ccall|cplusplus|dotnet|jvm|stdcall|prim|capi)\\\\s+"},{"begin":"(?=\\")|(?=\\\\b(?<!\')([_\\\\p{Ll}][\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*)\\\\b(?!\'))","end":"(?=(::|∷)(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]))","patterns":[{"include":"#comment_like"},{"captures":{"1":{"name":"keyword.other.safety.$1.haskell"},"2":{"name":"entity.name.foreign.haskell","patterns":[{"include":"#string_literal"}]},"3":{"name":"entity.name.function.haskell"},"4":{"name":"entity.name.function.infix.haskell"}},"match":"\\\\b(?<!\')(safe|unsafe|interruptible)\\\\b(?!\')\\\\s*(\\"(?:\\\\\\\\\\"|[^\\"])*\\")?\\\\s*(?:\\\\b(?<!\'\')([_\\\\p{Ll}][\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*)\\\\b(?!\')|\\\\(\\\\s*(?!--+\\\\))([[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]+)\\\\s*\\\\))"},{"captures":{"1":{"name":"keyword.other.safety.$1.haskell"},"2":{"name":"entity.name.foreign.haskell","patterns":[{"include":"#string_literal"}]}},"match":"\\\\b(?<!\')(safe|unsafe|interruptible)\\\\b(?!\')\\\\s*(\\"(?:\\\\\\\\\\"|[^\\"])*\\")?\\\\s*$"},{"captures":{"0":{"name":"entity.name.foreign.haskell","patterns":[{"include":"#string_literal"}]}},"match":"\\"(?:\\\\\\\\\\"|[^\\"])*\\""},{"captures":{"1":{"name":"entity.name.function.haskell"},"2":{"name":"punctuation.paren.haskell"},"3":{"name":"entity.name.function.infix.haskell"},"4":{"name":"punctuation.paren.haskell"}},"match":"\\\\b(?<!\'\')([_\\\\p{Ll}][\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*)\\\\b(?!\')|(\\\\()\\\\s*(?!--+\\\\))([[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]+)\\\\s*(\\\\))"}]},{"include":"#double_colon"},{"include":"#type_signature"}]},"float_literals":{"captures":{"1":{"name":"constant.numeric.floating.decimal.haskell"},"2":{"name":"constant.numeric.floating.hexadecimal.haskell"}},"match":"\\\\b(?<!\')(?:([0-9][0-9_]*\\\\.[0-9][0-9_]*(?:[Ee][-+]?[0-9][0-9_]*)?|[0-9][0-9_]*[Ee][-+]?[0-9][0-9_]*)|(0(?:[Xx]_*\\\\h[_\\\\h]*\\\\.\\\\h[_\\\\h]*(?:[Pp][-+]?[0-9][0-9_]*)?|[Xx]_*\\\\h[_\\\\h]*[Pp][-+]?[0-9][0-9_]*)))\\\\b(?!\')"},"forall":{"begin":"\\\\b(?<!\')(forall|∀)\\\\b(?!\')","beginCaptures":{"1":{"name":"keyword.other.forall.haskell"}},"end":"(\\\\.)|(->|→)","endCaptures":{"1":{"name":"keyword.operator.period.haskell"},"2":{"name":"keyword.operator.arrow.haskell"}},"patterns":[{"include":"#comment_like"},{"include":"#type_variable"},{"include":"#type_signature"}]},"fun_decl":{"begin":"^(\\\\s*)(?<fn>(?:[_\\\\p{Ll}][\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*#*|\\\\(\\\\s*(?!--+\\\\))[[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),:;\\\\[_`{}]][[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]*\\\\s*\\\\))(?:\\\\s*,\\\\s*\\\\g<fn>)?)\\\\s*(?<![[\\\\p{S}\\\\p{P}]&&[^]\\"\'),;_`}]])(::|∷)(?![[\\\\p{S}\\\\p{P}]&&[^\\"\'(,;\\\\[_`{]])","beginCaptures":{"2":{"name":"entity.name.function.haskell","patterns":[{"include":"#reserved_symbol"},{"include":"#prefix_op"}]},"3":{"name":"keyword.operator.double-colon.haskell"}},"end":"(?=(?<![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]])((<-|←)|(=)|(-<|↢)|(-<<|⤛))([]\\"\'(),;\\\\[_`{}[^\\\\p{S}\\\\p{P}]]))|(?=[;}])|^(?!\\\\1\\\\s+\\\\S|\\\\s*(?:$|\\\\{-[^@]|--+(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]).*$))","name":"meta.function.type-declaration.haskell","patterns":[{"include":"#type_signature"}]},"gadt_constructor":{"patterns":[{"begin":"^(\\\\s*)(?:\\\\b((?<!\')[\\\\p{Lu}\\\\p{Lt}][\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*)|(\\\\()\\\\s*(:[[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]*)\\\\s*(\\\\)))","beginCaptures":{"2":{"name":"constant.other.haskell"},"3":{"name":"punctuation.paren.haskell"},"4":{"name":"constant.other.operator.haskell"},"5":{"name":"punctuation.paren.haskell"}},"end":"(?=\\\\b(?<!\'\')deriving\\\\b(?!\'))|(?=[;}])|^(?!\\\\1\\\\s+\\\\S|\\\\s*(?:$|\\\\{-[^@]|--+(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]).*$))","patterns":[{"include":"#comment_like"},{"include":"#deriving"},{"include":"#double_colon"},{"include":"#record_decl"},{"include":"#type_signature"}]},{"begin":"\\\\b((?<!\')[\\\\p{Lu}\\\\p{Lt}][_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*)|(\\\\()\\\\s*(:[[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]*)\\\\s*(\\\\))","beginCaptures":{"1":{"name":"constant.other.haskell"},"2":{"name":"punctuation.paren.haskell"},"3":{"name":"constant.other.operator.haskell"},"4":{"name":"punctuation.paren.haskell"}},"end":"$","patterns":[{"include":"#comment_like"},{"include":"#deriving"},{"include":"#double_colon"},{"include":"#record_decl"},{"include":"#type_signature"}]}]},"infix_op":{"patterns":[{"captures":{"1":{"name":"keyword.operator.promotion.haskell"},"2":{"name":"entity.name.namespace.haskell"},"3":{"name":"keyword.operator.infix.haskell"}},"match":"((?:(?<!\'\')(\'\')?[\\\\p{Lu}\\\\p{Lt}][\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*\\\\.)*)(#+|[[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]+(?<!#))"},{"captures":{"1":{"name":"punctuation.backtick.haskell"},"2":{"name":"entity.name.namespace.haskell"},"3":{"patterns":[{"include":"#data_constructor"}]},"4":{"name":"punctuation.backtick.haskell"}},"match":"(`)((?:[\\\\p{Lu}\\\\p{Lt}][\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*\\\\.)*)([_\\\\p{Ll}\\\\p{Lu}][\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*)(`)","name":"keyword.operator.function.infix.haskell"}]},"inline_phase":{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.bracket.haskell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.bracket.haskell"}},"name":"meta.inlining-phase.haskell","patterns":[{"match":"~","name":"punctuation.tilde.haskell"},{"include":"#integer_literals"},{"match":"\\\\w*","name":"invalid"}]},"integer_literals":{"captures":{"1":{"name":"constant.numeric.integral.decimal.haskell"},"2":{"name":"constant.numeric.integral.hexadecimal.haskell"},"3":{"name":"constant.numeric.integral.octal.haskell"},"4":{"name":"constant.numeric.integral.binary.haskell"}},"match":"\\\\b(?<!\')(?:([0-9][0-9_]*)|(0[Xx]_*\\\\h[_\\\\h]*)|(0[Oo]_*[0-7][0-7_]*)|(0[Bb]_*[01][01_]*))\\\\b(?!\')"},"keyword":{"captures":{"1":{"name":"keyword.other.$1.haskell"},"2":{"name":"keyword.control.$2.haskell"}},"match":"\\\\b(?<!\')(?:(where|let|in|default)|(m?do|if|then|else|case|of|proc|rec))\\\\b(?!\')"},"layout_herald":{"begin":"(?<!\')\\\\b(?:(where|let|m?do)|(of))\\\\s*(\\\\{)(?!-)","beginCaptures":{"1":{"name":"keyword.other.$1.haskell"},"2":{"name":"keyword.control.of.haskell"},"3":{"name":"punctuation.brace.haskell"}},"end":"(})","endCaptures":{"1":{"name":"punctuation.brace.haskell"}},"patterns":[{"include":"$self"},{"match":";","name":"punctuation.semicolon.haskell"}]},"liquid_haskell":{"begin":"\\\\{-@","end":"@-}","name":"block.liquidhaskell.haskell","patterns":[{"include":"$self"}]},"module_exports":{"applyEndPatternLast":1,"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.paren.haskell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.paren.haskell"}},"name":"meta.declaration.exports.haskell","patterns":[{"include":"#comment_like"},{"captures":{"1":{"name":"keyword.other.module.haskell"}},"match":"\\\\b(?<!\')(module)\\\\b(?!\')"},{"include":"#comma"},{"include":"#export_constructs"},{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.paren.haskell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.paren.haskell"}},"patterns":[{"include":"#comment_like"},{"include":"#record_wildcard"},{"include":"#export_constructs"},{"include":"#comma"}]}]},"module_name":{"match":"(?<conid>[\\\\p{Lu}\\\\p{Lt}][\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*(\\\\.\\\\g<conid>)?)","name":"entity.name.namespace.haskell"},"numeric_literals":{"patterns":[{"include":"#float_literals"},{"include":"#integer_literals"}]},"overloaded_label":{"patterns":[{"captures":{"1":{"name":"keyword.operator.prefix.hash.haskell"},"2":{"patterns":[{"include":"#string_literal"}]}},"match":"(?<![[_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d\\\\p{S}\\\\p{P}]&&[^(,;\\\\[`{]])(#)(?:(\\"(?:\\\\\\\\\\"|[^\\"])*\\")|[\'._\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]+)","name":"entity.name.label.haskell"}]},"pragma":{"begin":"\\\\{-#","end":"#-}","name":"meta.preprocessor.haskell","patterns":[{"begin":"(?i)\\\\b(?<!\')(LANGUAGE)\\\\b(?!\')","beginCaptures":{"1":{"name":"keyword.other.preprocessor.pragma.haskell"}},"end":"(?=#-})","patterns":[{"match":"(?:No)?(?:AutoDeriveTypeable|DatatypeContexts|DoRec|IncoherentInstances|MonadFailDesugaring|MonoPatBinds|NullaryTypeClasses|OverlappingInstances|PatternSignatures|RecordPuns|RelaxedPolyRec)","name":"invalid.deprecated"},{"captures":{"1":{"name":"keyword.other.preprocessor.extension.haskell"}},"match":"((?:No)?(?:AllowAmbiguousTypes|AlternativeLayoutRule|AlternativeLayoutRuleTransitional|Arrows|BangPatterns|BinaryLiterals|CApiFFI|CPP|CUSKs|ConstrainedClassMethods|ConstraintKinds|DataKinds|DefaultSignatures|DeriveAnyClass|DeriveDataTypeable|DeriveFoldable|DeriveFunctor|DeriveGeneric|DeriveLift|DeriveTraversable|DerivingStrategies|DerivingVia|DisambiguateRecordFields|DoAndIfThenElse|BlockArguments|DuplicateRecordFields|EmptyCase|EmptyDataDecls|EmptyDataDeriving|ExistentialQuantification|ExplicitForAll|ExplicitNamespaces|ExtendedDefaultRules|FlexibleContexts|FlexibleInstances|ForeignFunctionInterface|FunctionalDependencies|GADTSyntax|GADTs|GHCForeignImportPrim|Generali[sz]edNewtypeDeriving|ImplicitParams|ImplicitPrelude|ImportQualifiedPost|ImpredicativeTypes|TypeFamilyDependencies|InstanceSigs|ApplicativeDo|InterruptibleFFI|JavaScriptFFI|KindSignatures|LambdaCase|LiberalTypeSynonyms|MagicHash|MonadComprehensions|MonoLocalBinds|MonomorphismRestriction|MultiParamTypeClasses|MultiWayIf|NumericUnderscores|NPlusKPatterns|NamedFieldPuns|NamedWildCards|NegativeLiterals|HexFloatLiterals|NondecreasingIndentation|NumDecimals|OverloadedLabels|OverloadedLists|OverloadedStrings|PackageImports|ParallelArrays|ParallelListComp|PartialTypeSignatures|PatternGuards|PatternSynonyms|PolyKinds|PolymorphicComponents|QuantifiedConstraints|PostfixOperators|QuasiQuotes|Rank2Types|RankNTypes|RebindableSyntax|RecordWildCards|RecursiveDo|RelaxedLayout|RoleAnnotations|ScopedTypeVariables|StandaloneDeriving|StarIsType|StaticPointers|Strict|StrictData|TemplateHaskell|TemplateHaskellQuotes|StandaloneKindSignatures|TraditionalRecordSyntax|TransformListComp|TupleSections|TypeApplications|TypeInType|TypeFamilies|TypeOperators|TypeSynonymInstances|UnboxedTuples|UnboxedSums|UndecidableInstances|UndecidableSuperClasses|UnicodeSyntax|UnliftedFFITypes|UnliftedNewtypes|ViewPatterns))"},{"include":"#comma"}]},{"begin":"(?i)\\\\b(?<!\')(SPECIALI[SZ]E)(?:\\\\s*(\\\\[[^]\\\\[]*])?\\\\s*|\\\\s+)(instance)\\\\b(?!\')","beginCaptures":{"1":{"name":"keyword.other.preprocessor.pragma.haskell"},"2":{"patterns":[{"include":"#inline_phase"}]},"3":{"name":"keyword.other.instance.haskell"}},"end":"(?=#-})","patterns":[{"include":"#type_signature"}]},{"begin":"(?i)\\\\b(?<!\')(SPECIALI[SZ]E)\\\\b(?!\')(?:\\\\s+(INLINE)\\\\b(?!\'))?\\\\s*(\\\\[[^]\\\\[]*])?\\\\s*","beginCaptures":{"1":{"name":"keyword.other.preprocessor.pragma.haskell"},"2":{"name":"keyword.other.preprocessor.pragma.haskell"},"3":{"patterns":[{"include":"#inline_phase"}]}},"end":"(?=#-})","patterns":[{"include":"$self"}]},{"match":"(?i)\\\\b(?<!\')(LANGUAGE|OPTIONS_GHC|INCLUDE|MINIMAL|UNPACK|OVERLAPS|INCOHERENT|NOUNPACK|SOURCE|OVERLAPPING|OVERLAPPABLE|INLINE|NOINLINE|INLINE?ABLE|CONLIKE|LINE|COLUMN|RULES|COMPLETE)\\\\b(?!\')","name":"keyword.other.preprocessor.haskell"},{"begin":"(?i)\\\\b(DEPRECATED|WARNING)\\\\b","beginCaptures":{"1":{"name":"keyword.other.preprocessor.pragma.haskell"}},"end":"(?=#-})","patterns":[{"include":"#string_literal"}]}]},"prefix_op":{"patterns":[{"captures":{"1":{"name":"punctuation.paren.haskell"},"2":{"name":"entity.name.function.infix.haskell"},"3":{"name":"punctuation.paren.haskell"}},"match":"(\\\\()\\\\s*(?!(?:--+|\\\\.\\\\.)\\\\))(#+|[[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]+(?<!#))\\\\s*(\\\\))"}]},"qualifier":{"match":"\\\\b(?<!\')[\\\\p{Lu}\\\\p{Lt}][\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*\\\\.","name":"entity.name.namespace.haskell"},"quasi_quote":{"patterns":[{"begin":"(\\\\[)([dep])?(\\\\|\\\\|?)","beginCaptures":{"1":{"name":"keyword.operator.quasi-quotation.begin.haskell"},"2":{"name":"entity.name.quasi-quoter.haskell"},"3":{"name":"keyword.operator.quasi-quotation.begin.haskell"}},"end":"\\\\3]","endCaptures":{"0":{"name":"keyword.operator.quasi-quotation.end.haskell"}},"name":"meta.quasi-quotation.haskell","patterns":[{"include":"$self"}]},{"begin":"(\\\\[)(t)(\\\\|\\\\|?)","beginCaptures":{"1":{"name":"keyword.operator.quasi-quotation.begin.haskell"},"2":{"name":"entity.name.quasi-quoter.haskell"},"3":{"name":"keyword.operator.quasi-quotation.begin.haskell"}},"end":"\\\\3]","endCaptures":{"0":{"name":"keyword.operator.quasi-quotation.end.haskell"}},"name":"meta.quasi-quotation.haskell","patterns":[{"include":"#type_signature"}]},{"begin":"(\\\\[)(?:(\\\\$\\\\$)|(\\\\$))?([\'._[^\\\\s\\\\p{S}\\\\p{P}]]*)(\\\\|\\\\|?)","beginCaptures":{"1":{"name":"keyword.operator.quasi-quotation.begin.haskell"},"2":{"name":"keyword.operator.prefix.double-dollar.haskell"},"3":{"name":"keyword.operator.prefix.dollar.haskell"},"4":{"name":"entity.name.quasi-quoter.haskell","patterns":[{"include":"#qualifier"}]},"5":{"name":"keyword.operator.quasi-quotation.begin.haskell"}},"end":"\\\\5]","endCaptures":{"0":{"name":"keyword.operator.quasi-quotation.end.haskell"}},"name":"meta.quasi-quotation.haskell"}]},"record":{"begin":"(\\\\{)(?!-)","beginCaptures":{"1":{"name":"punctuation.brace.haskell"}},"end":"(?<!-)(})","endCaptures":{"1":{"name":"punctuation.brace.haskell"}},"name":"meta.record.haskell","patterns":[{"include":"#comment_like"},{"include":"#record_field"}]},"record_decl":{"begin":"(\\\\{)(?!-)","beginCaptures":{"1":{"name":"punctuation.brace.haskell"}},"end":"(?<!-)(})","endCaptures":{"1":{"name":"punctuation.brace.haskell"}},"name":"meta.record.definition.haskell","patterns":[{"include":"#comment_like"},{"include":"#record_decl_field"}]},"record_decl_field":{"begin":"([_\\\\p{Ll}][\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*)|(\\\\()\\\\s*([[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]+)\\\\s*(\\\\))","beginCaptures":{"1":{"name":"variable.other.member.definition.haskell"},"2":{"name":"punctuation.paren.haskell"},"3":{"name":"variable.other.member.definition.haskell"},"4":{"name":"punctuation.paren.haskell"}},"end":"(,)|(?=})","endCaptures":{"1":{"name":"punctuation.comma.haskell"}},"patterns":[{"include":"#comment_like"},{"include":"#comma"},{"include":"#double_colon"},{"include":"#type_signature"},{"include":"#record_decl_field"}]},"record_field":{"patterns":[{"begin":"([_\\\\p{Ll}\\\\p{Lu}][\'._\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*)|(\\\\()\\\\s*([[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]+)\\\\s*(\\\\))","beginCaptures":{"1":{"name":"variable.other.member.haskell","patterns":[{"include":"#qualifier"}]},"2":{"name":"punctuation.paren.haskell"},"3":{"name":"variable.other.member.haskell"},"4":{"name":"punctuation.paren.haskell"}},"end":"(,)|(?=})","endCaptures":{"1":{"name":"punctuation.comma.haskell"}},"patterns":[{"include":"#comment_like"},{"include":"#comma"},{"include":"$self"}]},{"include":"#record_wildcard"}]},"record_wildcard":{"captures":{"1":{"name":"variable.other.member.wildcard.haskell"}},"match":"(?<![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]])(\\\\.\\\\.)(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]])"},"reserved_symbol":{"patterns":[{"captures":{"1":{"name":"keyword.operator.double-dot.haskell"},"2":{"name":"keyword.operator.colon.haskell"},"3":{"name":"keyword.operator.eq.haskell"},"4":{"name":"keyword.operator.lambda.haskell"},"5":{"name":"keyword.operator.pipe.haskell"},"6":{"name":"keyword.operator.arrow.left.haskell"},"7":{"name":"keyword.operator.arrow.haskell"},"8":{"name":"keyword.operator.arrow.left.tail.haskell"},"9":{"name":"keyword.operator.arrow.left.tail.double.haskell"},"10":{"name":"keyword.operator.arrow.tail.haskell"},"11":{"name":"keyword.operator.arrow.tail.double.haskell"},"12":{"name":"keyword.other.forall.haskell"}},"match":"(?<![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]])(?:(\\\\.\\\\.)|(:)|(=)|(\\\\\\\\)|(\\\\|)|(<-|←)|(->|→)|(-<|↢)|(-<<|⤛)|(>-|⤚)|(>>-|⤜)|(∀))(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]])"},{"captures":{"1":{"name":"keyword.operator.postfix.hash.haskell"}},"match":"(?<=[[_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d\\\\p{S}\\\\p{P}]&&[^#,;\\\\[`{]])(#+)(?![[_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d\\\\p{S}\\\\p{P}]&&[^]),;`}]])"},{"captures":{"1":{"name":"keyword.operator.infix.tight.at.haskell"}},"match":"(?<=[])_}\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d])(@)(?=[(\\\\[_{\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d])"},{"captures":{"1":{"name":"keyword.operator.prefix.tilde.haskell"},"2":{"name":"keyword.operator.prefix.bang.haskell"},"3":{"name":"keyword.operator.prefix.minus.haskell"},"4":{"name":"keyword.operator.prefix.dollar.haskell"},"5":{"name":"keyword.operator.prefix.double-dollar.haskell"}},"match":"(?<![[_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d\\\\p{S}\\\\p{P}]&&[^(,;\\\\[`{]])(?:(~)|(!)|(-)|(\\\\$)|(\\\\$\\\\$))(?=[(\\\\[_{\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d])"}]},"role_annotation":{"patterns":[{"begin":"^(\\\\s*)(type)\\\\s+(role)\\\\b(?!\')","beginCaptures":{"2":{"name":"keyword.other.type.haskell"},"3":{"name":"keyword.other.role.haskell"}},"end":"(?=[;}])|^(?!\\\\1\\\\s+\\\\S|\\\\s*(?:$|\\\\{-[^@]|--+(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]).*$))","name":"meta.role-annotation.haskell","patterns":[{"include":"#comment_like"},{"include":"#type_constructor"},{"captures":{"1":{"name":"keyword.other.role.$1.haskell"}},"match":"\\\\b(?<!\')(nominal|representational|phantom)\\\\b(?!\')"}]}]},"start_type_signature":{"patterns":[{"begin":"^(\\\\s*)(::|∷)(?![[\\\\p{S}\\\\p{P}]&&[^\\"\'(,;\\\\[_`{]])\\\\s*","beginCaptures":{"2":{"name":"keyword.operator.double-colon.haskell"}},"end":"(?=#?\\\\)|[],]|(?<!\')\\\\b(in|then|else|of)\\\\b(?!\')|(?<![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]])(?:([\\\\\\\\λ])|(<-|←)|(=)|(-<|↢)|(-<<|⤛))([]\\"\'(),;\\\\[_`{}[^\\\\p{S}\\\\p{P}]])|([#@])-}|(?=[;}])|^(?!\\\\1\\\\s*\\\\S|\\\\s*(?:$|\\\\{-[^@]|--+(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]).*$)))","name":"meta.type-declaration.haskell","patterns":[{"include":"#type_signature"}]},{"begin":"(?<![[\\\\p{S}\\\\p{P}]&&[^\\"\'(,;\\\\[_`{]])(::|∷)(?![[\\\\p{S}\\\\p{P}]&&[^\\"\'(,;\\\\[_`{]])","beginCaptures":{"1":{"name":"keyword.operator.double-colon.haskell"}},"end":"(?=#?\\\\)|[],]|\\\\b(?<!\')(in|then|else|of)\\\\b(?!\')|([#@])-}|(?<![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]])(?:([\\\\\\\\λ])|(<-|←)|(=)|(-<|↢)|(-<<|⤛))([]\\"\'(),;\\\\[_`{}[^\\\\p{S}\\\\p{P}]])|(?=[;}])|$)","patterns":[{"include":"#type_signature"}]}]},"string_literal":{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.haskell"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.haskell"}},"name":"string.quoted.double.haskell","patterns":[{"match":"\\\\\\\\(NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[\\"\\\\&\'\\\\\\\\abfnrtv])","name":"constant.character.escape.haskell"},{"match":"\\\\\\\\(?:o[0-7]+|x\\\\h+|[0-9]+)","name":"constant.character.escape.octal.haskell"},{"match":"\\\\\\\\\\\\^[@-_]","name":"constant.character.escape.control.haskell"},{"begin":"\\\\\\\\\\\\s","beginCaptures":{"0":{"name":"constant.character.escape.begin.haskell"}},"end":"\\\\\\\\","endCaptures":{"0":{"name":"constant.character.escape.end.haskell"}},"patterns":[{"match":"\\\\S+","name":"invalid.illegal.character-not-allowed-here.haskell"}]}]},"type_application":{"patterns":[{"begin":"(?<=[]\\",;\\\\[{}\\\\s])(@)(\')?(\\\\()","beginCaptures":{"1":{"name":"keyword.operator.prefix.at.haskell"},"2":{"name":"keyword.operator.promotion.haskell"},"3":{"name":"punctuation.paren.haskell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.paren.haskell"}},"name":"meta.type-application.haskell","patterns":[{"include":"#type_signature"}]},{"begin":"(?<=[]\\",;\\\\[{}\\\\s])(@)(\')?(\\\\[)","beginCaptures":{"1":{"name":"keyword.operator.prefix.at.haskell"},"2":{"name":"keyword.operator.promotion.haskell"},"3":{"name":"punctuation.bracket.haskell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.bracket.haskell"}},"name":"meta.type-application.haskell","patterns":[{"include":"#type_signature"}]},{"begin":"(?<=[]\\",;\\\\[{}\\\\s])(@)(?=\\")","beginCaptures":{"1":{"name":"keyword.operator.prefix.at.haskell"}},"end":"(?<=\\")","name":"meta.type-application.haskell","patterns":[{"include":"#string_literal"}]},{"begin":"(?<=[]\\",;\\\\[{}\\\\s])(@)(?=[\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d])","beginCaptures":{"1":{"name":"keyword.operator.prefix.at.haskell"}},"end":"(?![\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d])","name":"meta.type-application.haskell","patterns":[{"include":"#type_signature"}]}]},"type_constructor":{"patterns":[{"captures":{"1":{"name":"keyword.operator.promotion.haskell"},"2":{"name":"entity.name.namespace.haskell"},"3":{"name":"storage.type.haskell"}},"match":"(\')?((?:\\\\b[\\\\p{Lu}\\\\p{Lt}][\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*\\\\.)*)\\\\b([\\\\p{Lu}\\\\p{Lt}][\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*)"},{"captures":{"1":{"name":"keyword.operator.promotion.haskell"},"2":{"name":"punctuation.paren.haskell"},"3":{"name":"entity.name.namespace.haskell"},"4":{"name":"storage.type.operator.haskell"},"5":{"name":"punctuation.paren.haskell"}},"match":"(\')?(\\\\()\\\\s*((?:[\\\\p{Lu}\\\\p{Lt}][\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*\\\\.)*)([[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]+)\\\\s*(\\\\))"}]},"type_operator":{"patterns":[{"captures":{"1":{"name":"keyword.operator.promotion.haskell"},"2":{"name":"entity.name.namespace.haskell"},"3":{"name":"storage.type.operator.infix.haskell"}},"match":"(?:(?<!\')(\'))?((?:\\\\b[\\\\p{Lu}\\\\p{Lt}][\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*\\\\.)*)(?![#@]?-})(#+|[[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]]+(?<!#))"},{"captures":{"1":{"name":"keyword.operator.promotion.haskell"},"2":{"name":"punctuation.backtick.haskell"},"3":{"name":"entity.name.namespace.haskell"},"4":{"name":"storage.type.infix.haskell"},"5":{"name":"punctuation.backtick.haskell"}},"match":"(\')?(`)((?:[\\\\p{Lu}\\\\p{Lt}][\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*\\\\.)*)([\\\\p{Lu}\\\\p{Lt}][\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*)(`)"}]},"type_signature":{"patterns":[{"include":"#comment_like"},{"captures":{"1":{"name":"keyword.operator.promotion.haskell"},"2":{"name":"punctuation.paren.haskell"},"3":{"name":"punctuation.paren.haskell"}},"match":"(\')?(\\\\()\\\\s*(\\\\))","name":"support.constant.unit.haskell"},{"captures":{"1":{"name":"punctuation.paren.haskell"},"2":{"name":"keyword.operator.hash.haskell"},"3":{"name":"keyword.operator.hash.haskell"},"4":{"name":"punctuation.paren.haskell"}},"match":"(\\\\()(#)\\\\s*(#)(\\\\))","name":"support.constant.unit.unboxed.haskell"},{"captures":{"1":{"name":"keyword.operator.promotion.haskell"},"2":{"name":"punctuation.paren.haskell"},"3":{"name":"punctuation.paren.haskell"}},"match":"(\')?(\\\\()\\\\s*,[,\\\\s]*(\\\\))","name":"support.constant.tuple.haskell"},{"captures":{"1":{"name":"punctuation.paren.haskell"},"2":{"name":"keyword.operator.hash.haskell"},"3":{"name":"keyword.operator.hash.haskell"},"4":{"name":"punctuation.paren.haskell"}},"match":"(\\\\()(#)\\\\s*(#)(\\\\))","name":"support.constant.unit.unboxed.haskell"},{"captures":{"1":{"name":"punctuation.paren.haskell"},"2":{"name":"keyword.operator.hash.haskell"},"3":{"name":"keyword.operator.hash.haskell"},"4":{"name":"punctuation.paren.haskell"}},"match":"(\\\\()(#)\\\\s*,[,\\\\s]*(#)(\\\\))","name":"support.constant.tuple.unboxed.haskell"},{"captures":{"1":{"name":"keyword.operator.promotion.haskell"},"2":{"name":"punctuation.bracket.haskell"},"3":{"name":"punctuation.bracket.haskell"}},"match":"(\')?(\\\\[)\\\\s*(])","name":"support.constant.empty-list.haskell"},{"include":"#integer_literals"},{"match":"(::|∷)(?![[\\\\p{S}\\\\p{P}]&&[^]\\"\'(),;\\\\[_`{}]])","name":"keyword.operator.double-colon.haskell"},{"include":"#forall"},{"match":"=>|⇒","name":"keyword.operator.big-arrow.haskell"},{"include":"#string_literal"},{"match":"\'[^\']\'","name":"invalid"},{"include":"#type_application"},{"include":"#reserved_symbol"},{"include":"#type_operator"},{"include":"#type_constructor"},{"begin":"(\\\\()(#)","beginCaptures":{"1":{"name":"punctuation.paren.haskell"},"2":{"name":"keyword.operator.hash.haskell"}},"end":"(#)(\\\\))","endCaptures":{"1":{"name":"keyword.operator.hash.haskell"},"2":{"name":"punctuation.paren.haskell"}},"patterns":[{"include":"#comma"},{"include":"#type_signature"}]},{"begin":"(\')?(\\\\()","beginCaptures":{"1":{"name":"keyword.operator.promotion.haskell"},"2":{"name":"punctuation.paren.haskell"}},"end":"(\\\\))","endCaptures":{"1":{"name":"punctuation.paren.haskell"}},"patterns":[{"include":"#comma"},{"include":"#type_signature"}]},{"begin":"(\')?(\\\\[)","beginCaptures":{"1":{"name":"keyword.operator.promotion.haskell"},"2":{"name":"punctuation.bracket.haskell"}},"end":"(])","endCaptures":{"1":{"name":"punctuation.bracket.haskell"}},"patterns":[{"include":"#comma"},{"include":"#type_signature"}]},{"include":"#type_variable"}]},"type_variable":{"match":"\\\\b(?<!\')(?!(?:forall|deriving)\\\\b(?!\'))[_\\\\p{Ll}][\'_\\\\p{Ll}\\\\p{Lu}\\\\p{Lt}\\\\d]*","name":"variable.other.generic-type.haskell"},"where":{"patterns":[{"begin":"(?<!\')\\\\b(where)\\\\s*(\\\\{)(?!-)","beginCaptures":{"1":{"name":"keyword.other.where.haskell"},"2":{"name":"punctuation.brace.haskell"}},"end":"(})","endCaptures":{"1":{"name":"punctuation.brace.haskell"}},"patterns":[{"include":"$self"},{"match":";","name":"punctuation.semicolon.haskell"}]},{"match":"\\\\b(?<!\')(where)\\\\b(?!\')","name":"keyword.other.where.haskell"}]}},"scopeName":"source.haskell","aliases":["hs"]}'))]}}]);
@@ -0,0 +1,2 @@
1
+ /*! LICENSE: art.62139ed479.js.LICENSE.txt */
2
+ "use strict";(self.rspackChunkompchamber=self.rspackChunkompchamber||[]).push([["art"],{wA(e,t,n){var a=n("j"),r=n("H"),i=n("rm"),l=n("Go"),s=n("t3"),o=n("Ir"),c=n("z"),d=n("oj");function p(e){let{rootPath:t,activeRepo:n,onSelectRepo:p}=e,[h,x]=(0,r.J0)(!1),[m,f]=(0,r.J0)(["."]),[u,b]=(0,r.J0)(!1),[k,y]=(0,r.J0)(""),g=(0,r.li)(null),v=function(e){if(!e)return"workspace root";let t=e.replace(/\\/g,"/").split("/").filter(Boolean);return t.length>0?t[t.length-1]:"workspace root"}(t),N=e=>"."===e?v:e,w=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=new URLSearchParams({reposOnly:"1"});t&&n.set("root",t),e&&n.set("rescan","1"),n.set("t",String(Date.now()));let a=await fetch(`/api/fs/git?${n.toString()}`).then(e=>e.json()).catch(()=>null);a&&Array.isArray(a.repos)&&(f(a.repos),a.reposPending?b(!0):b(!1))};(0,r.vJ)(()=>{h&&w()},[h,t]),(0,r.vJ)(()=>{if(!u)return;let e=new URLSearchParams({reposOnly:"1"});t&&e.set("root",t);let n=setInterval(async()=>{let t=await fetch(`/api/fs/git?${e.toString()}`).then(e=>e.json()).catch(()=>null);t&&!t.reposPending&&Array.isArray(t.repos)&&(f(t.repos),b(!1))},1500);return()=>clearInterval(n)},[u,t]),(0,d.W)(g,()=>x(!1));let Y=m.filter(e=>!k.trim()||N(e).toLowerCase().includes(k.toLowerCase()));return(0,a.FD)("div",{className:"relative",ref:g,children:[(0,a.FD)("button",{type:"button",onClick:()=>x(!h),title:"Switch git project",className:"flex items-center space-x-1.5 hover:bg-ink/5 px-2 py-1 rounded transition-colors text-xs text-ink/80 font-medium",children:[(0,a.Y)(i.A,{size:12,className:"text-ink/60"}),(0,a.Y)("span",{className:"truncate max-w-[110px]",children:"."===n?v:n.split("/").pop()}),(0,a.Y)(l.A,{size:12,className:"text-ink/40"})]}),h&&(0,a.FD)("div",{className:"absolute top-full left-0 mt-1 w-52 bg-paper border border-ink/20 rounded-md shadow-lg z-50 flex flex-col overflow-hidden text-xs",children:[(0,a.FD)("div",{className:"px-2 py-1.5 border-b border-ink/10 flex items-center space-x-1.5",children:[(0,a.Y)(s.A,{size:11,className:"text-ink/40 flex-shrink-0"}),(0,a.Y)("input",{type:"text",value:k,onChange:e=>y(e.currentTarget.value),placeholder:"Search repos...",title:"Search repositories",className:"w-full bg-transparent outline-none text-xs text-ink placeholder-ink/40",autoFocus:!0}),k&&(0,a.Y)("button",{type:"button",onClick:()=>y(""),title:"Clear search",className:"text-ink/40 hover:text-ink flex-shrink-0",children:"×"}),(0,a.Y)("button",{type:"button",onClick:()=>void w(!0),title:"Refresh nested repos",disabled:u,className:"text-ink/40 hover:text-ink flex-shrink-0 transition-colors disabled:opacity-40 disabled:hover:text-ink/40",children:(0,a.Y)(o.A,{size:11,className:u?"animate-spin":""})})]}),(0,a.Y)("div",{className:"max-h-48 scrollbar-overlay-container scrollbar-overlay-static py-1",children:0===Y.length?(0,a.Y)("div",{className:"px-3 py-2 text-ink/40 italic",children:"No repos found"}):Y.map(e=>(0,a.FD)("button",{type:"button",onClick:()=>{p(e),x(!1),y("")},title:N(e),className:"w-full text-left px-3 py-2 hover:bg-ink/5 flex items-center justify-between transition-colors",children:[(0,a.Y)("span",{className:"truncate",children:N(e)}),n===e&&(0,a.Y)(c.A,{size:12,className:"text-ink"})]},e))})]})]})}n.d(t,{I:()=>p})},Ek(e,t,n){n.d(t,{FileExplorer:()=>j});var a=n("j"),r=n("H"),i=n("n"),l=n("t3"),s=n("wA"),o=n("Go"),c=n("Nf"),d=n("X"),p=n("ob"),h=n("G"),x=n("bH"),m=n("YOg"),f=n("q"),u=n("b0"),b=n("hw");let k=(0,n("y").A)({name:"pen",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],aliases:["edit-2"]});var y=n("mO"),g=n("S");function v(e){let{x:t,y:n,isFolder:r,hasGitStatus:i,onAction:l,menuRef:s}=e,o=r?220:i?285:255,c="u">typeof window?Math.max(10,Math.min(t,window.innerWidth-190-12)):t,d="u">typeof window?Math.max(10,Math.min(n,window.innerHeight-o-12)):n;return(0,h.d5)((0,a.Y)("div",{className:"fixed inset-0 z-50 bg-ink/20",onClick:()=>l("close"),onContextMenu:e=>{e.preventDefault(),l("close")},children:(0,a.FD)("div",{ref:s,className:"fixed z-50 bg-paper border border-ink/15 shadow-2xl rounded-lg py-1 min-w-[185px] text-xs text-ink font-sans",style:{top:d,left:c},onClick:e=>e.stopPropagation(),children:[!r&&(0,a.FD)(a.FK,{children:[(0,a.FD)("button",{onClick:()=>l("view"),className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 flex items-center space-x-2 transition-colors",children:[(0,a.Y)(x.A,{size:13,className:"text-ink/60"}),(0,a.Y)("span",{children:"View"})]}),i&&(0,a.FD)("button",{onClick:()=>l("diff"),className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 flex items-center space-x-2 transition-colors text-ink",children:[(0,a.Y)(m.A,{size:13,className:"text-warning"}),(0,a.Y)("span",{className:"font-medium",children:"Open in Diff Panel"})]})]}),(0,a.FD)("button",{onClick:()=>l("explorer"),className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 flex items-center space-x-2 transition-colors",children:[(0,a.Y)(f.A,{size:13,className:"text-ink/60"}),(0,a.Y)("span",{children:"Go to Explorer"})]}),(0,a.Y)("div",{className:"my-1 border-t border-ink/10"}),(0,a.FD)("button",{onClick:()=>l("copy_path"),className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 flex items-center space-x-2 transition-colors",children:[(0,a.Y)(u.A,{size:13,className:"text-ink/60"}),(0,a.Y)("span",{children:"Copy Path"})]}),(0,a.FD)("button",{onClick:()=>l("copy_relative"),className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 flex items-center space-x-2 transition-colors",children:[(0,a.Y)(u.A,{size:13,className:"text-ink/60"}),(0,a.Y)("span",{children:"Copy Relative Path"})]}),(0,a.Y)("div",{className:"my-1 border-t border-ink/10"}),(0,a.FD)("button",{onClick:()=>l("history"),className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 flex items-center space-x-2 transition-colors",children:[(0,a.Y)(b.A,{size:13,className:"text-ink/60"}),(0,a.Y)("span",{children:"Show Git History"})]}),(0,a.Y)("div",{className:"my-1 border-t border-ink/10"}),(0,a.FD)("button",{onClick:()=>l("rename"),className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 flex items-center space-x-2 transition-colors",children:[(0,a.Y)(k,{size:13,className:"text-ink/60"}),(0,a.Y)("span",{children:"Rename"})]}),(0,a.FD)("button",{onClick:()=>l("delete"),className:"w-full text-left px-3 py-1.5 hover:bg-error/10 text-error flex items-center space-x-2 transition-colors",children:[(0,a.Y)(y.A,{size:13,className:"text-error"}),(0,a.Y)("span",{children:"Delete"})]})]})}),document.body)}function N(e){let{fileName:t,isFolder:n,isLoading:r,onCancel:i,onConfirm:l}=e;return(0,h.d5)((0,a.Y)("div",{className:"fixed inset-0 bg-ink/20 z-[100] flex items-center justify-center p-4 backdrop-blur-sm",children:(0,a.FD)("div",{className:"bg-paper rounded shadow-xl p-4 w-full max-w-sm border border-ink/10 font-sans",children:[(0,a.FD)("h3",{className:"font-semibold text-ink mb-2 text-sm",children:["Delete ",n?"Folder":"File"]}),(0,a.FD)("p",{className:"text-xs text-ink/70 mb-4",children:["Are you sure you want to delete ",(0,a.Y)("span",{className:"font-mono bg-canvas px-1 rounded",children:t}),"? This action cannot be undone."]}),(0,a.FD)("div",{className:"flex justify-end space-x-2",children:[(0,a.Y)("button",{onClick:i,className:"px-3 py-1.5 text-xs text-ink hover:bg-ink/5 rounded transition-colors",disabled:r,children:"Cancel"}),(0,a.Y)("button",{onClick:l,className:"px-3 py-1.5 text-xs bg-error text-white rounded hover:bg-error/90 transition-colors flex items-center",disabled:r,children:r?"Deleting...":"Delete"})]})]})}),document.body)}function w(e){let{isFolder:t,renameValue:n,originalPath:r,isLoading:i,onChange:l,onCancel:s,onSubmit:o}=e;return(0,h.d5)((0,a.Y)("div",{className:"fixed inset-0 bg-ink/20 z-[100] flex items-center justify-center p-4 backdrop-blur-sm",children:(0,a.FD)("form",{onSubmit:o,className:"bg-paper rounded shadow-xl p-4 w-full max-w-sm border border-ink/10 font-sans",children:[(0,a.FD)("h3",{className:"font-semibold text-ink mb-3 text-sm",children:["Rename ",t?"Folder":"File"]}),(0,a.Y)("input",{autoFocus:!0,type:"text",value:n,onChange:e=>l(e.currentTarget.value),className:"w-full bg-paper border border-ink/20 rounded px-2 py-1.5 text-xs font-mono focus:outline-none focus:border-ink mb-4"}),(0,a.FD)("div",{className:"flex justify-end space-x-2",children:[(0,a.Y)("button",{type:"button",onClick:s,className:"px-3 py-1.5 text-xs text-ink hover:bg-ink/5 rounded transition-colors",disabled:i,children:"Cancel"}),(0,a.Y)("button",{type:"submit",className:"px-3 py-1.5 text-xs bg-ink text-canvas rounded hover:bg-ink/90 transition-colors flex items-center",disabled:i||!n.trim()||n===r,children:i?"Renaming...":"Rename"})]})]})}),document.body)}function Y(e){let{filePath:t,fetcherState:n,fetcherData:r,onClose:l}=e;return(0,h.d5)((0,a.Y)("div",{className:"fixed inset-0 bg-ink/20 z-[100] flex items-center justify-center p-4 backdrop-blur-sm",children:(0,a.FD)("div",{className:"bg-paper rounded-lg shadow-xl w-full max-w-4xl border border-ink/10 flex flex-col max-h-[85vh]",children:[(0,a.FD)("div",{className:"flex items-center justify-between p-4 border-b border-ink/10",children:[(0,a.FD)("h3",{className:"text-sm font-semibold text-ink flex items-center space-x-2",children:[(0,a.Y)(b.A,{size:16,className:"text-ink/60"}),(0,a.FD)("span",{children:["Git History: ",(0,a.Y)("span",{className:"font-mono font-normal opacity-80",children:t})]})]}),(0,a.Y)("button",{onClick:l,className:"p-1 hover:bg-ink/5 rounded text-ink/60 transition-colors",children:(0,a.Y)(g.A,{size:14})})]}),(0,a.Y)("div",{className:"flex-1 scrollbar-overlay-container scrollbar-overlay-static bg-paper p-2",children:"idle"===n?r?.type==="history"?r.data.length>0?(0,a.FD)("table",{className:"w-full text-left border-collapse text-[11px]",children:[(0,a.Y)("thead",{className:"bg-canvas sticky top-0 z-10 border-b border-ink/10",children:(0,a.FD)("tr",{children:[(0,a.Y)("th",{className:"px-3 py-2 font-semibold text-ink/70 rounded-tl",children:"Description"}),(0,a.Y)("th",{className:"px-3 py-2 font-semibold text-ink/70 w-32",children:"Date"}),(0,a.Y)("th",{className:"px-3 py-2 font-semibold text-ink/70 w-32",children:"Author"}),(0,a.Y)("th",{className:"px-3 py-2 font-semibold text-ink/70 w-24 text-right rounded-tr",children:"Commit"})]})}),(0,a.Y)("tbody",{className:"divide-y divide-ink/5",children:r.data.map((e,t)=>(0,a.FD)("tr",{className:"hover:bg-ink/[0.03] transition-colors group bg-paper",children:[(0,a.Y)("td",{className:"px-3 py-2 text-ink",children:e.message?(0,a.Y)("span",{className:"font-medium text-ink/90 group-hover:text-ink",children:e.message}):null}),(0,a.Y)("td",{className:"px-3 py-2 text-ink/60 whitespace-nowrap font-mono text-[10.5px]",children:e.time}),(0,a.Y)("td",{className:"px-3 py-2 text-ink/70 whitespace-nowrap truncate max-w-[120px]",children:e.author}),(0,a.Y)("td",{className:"px-3 py-2 text-right",children:e.hash?(0,a.Y)("span",{className:"font-mono text-ink/50 group-hover:text-ink font-semibold transition-colors bg-canvas px-1.5 py-0.5 rounded border border-ink/10",children:e.hash}):null})]},t))})]}):(0,a.Y)("div",{className:"p-8 text-center text-ink/40 font-mono text-xs",children:"No commit history found for this file."}):r?.error?(0,a.Y)("div",{className:"p-8 text-center text-error font-mono text-xs",children:r.error}):(0,a.Y)("div",{className:"p-8 text-center text-ink/40 font-mono text-xs",children:"Loading history..."}):(0,a.FD)("div",{className:"p-8 text-center text-ink/40 font-mono text-xs flex items-center justify-center space-x-2",children:[(0,a.Y)(i.A,{size:14,className:"animate-spin"}),(0,a.Y)("span",{children:"Loading history..."})]})})]})}),document.body)}var F=n("LQ"),D=n("oj");function C(e){let{file:t,rootPath:n,repo:i,onLoadChildren:l,onOpenFile:s,onActionComplete:h,expandedPaths:x,onToggleFolder:m,gitFileMap:f,gitFolderMap:u}=e,b="folder"===t.type,[k,y]=(0,r.J0)(!1),[g,A]=(0,r.J0)(!1),z=(0,d.L)(),[S,J]=(0,r.J0)(!1),[j,L]=(0,r.J0)(null),P=(0,r.li)(null),[M,R]=(0,r.J0)(!1),[$,T]=(0,r.J0)(!1),[E,H]=(0,r.J0)(!1),[O,G]=(0,r.J0)(t.path),_=Array.isArray(t.children)?t.children:[],I=(t.path||"").replace(/^\/+/,""),V=b?void 0:f?.get(I)||f?.get(t.path),B=V?(0,F.R)(V.status,V.staged):null,U=b?u?.get(I)||u?.get(t.path):null,W=!!B,K=!0===t.ignored,Q=x?x.has(t.path):k,X=void 0!==t.forceExpanded?t.forceExpanded:Q;(0,r.vJ)(()=>{J(!0)},[]),(0,r.vJ)(()=>{b&&x&&y(x.has(t.path))},[x,t.path,b]),(0,r.vJ)(()=>{b&&X&&(!t.children||0===t.children.length)&&l&&!g&&(A(!0),Promise.resolve(l(t.path)).finally(()=>A(!1)))},[b,X,t.children,t.path,l]),(0,D.W)(P,()=>L(null)),(0,r.vJ)(()=>{"idle"===z.state&&z.data&&z.data.success&&!z.data.type&&(R(!1),T(!1),h())},[z.state,z.data]);let q=e=>{i&&"."!==i&&e.append("repo",i),n&&e.append("root",n),z.submit(e,{method:"post",action:"/api/fs/action"})};return(0,a.FD)("div",{children:[(0,a.FD)("div",{className:"flex items-center space-x-1.5 py-1 px-2 hover:bg-ink/5 cursor-pointer rounded group",onClick:e=>{if(e.stopPropagation(),b){let e=!X;y(e),void 0!==t.forceExpanded&&(t.forceExpanded=void 0),m?.(t.path,e),e&&l&&(!t.children||0===t.children.length)&&(A(!0),Promise.resolve(l(t.path)).finally(()=>A(!1)))}else s&&s({...t,root:n,repo:i||"."})},onContextMenu:e=>{e.preventDefault(),e.stopPropagation(),L({x:e.clientX,y:e.clientY})},children:[b?X?(0,a.Y)(o.A,{size:12,className:"flex-shrink-0 text-ink/40"}):(0,a.Y)(c.A,{size:12,className:"flex-shrink-0 text-ink/40"}):(0,a.Y)("span",{className:"w-3 flex-shrink-0"}),(0,a.Y)(p.o,{name:t.name,isFolder:b,isOpen:X,size:12,className:`flex-shrink-0${K?" opacity-40":""}`}),(0,a.Y)("span",{className:`truncate min-w-0 flex-1 ${B?B.colorClass:U?U.colorClass:K?"text-ink/40":""}`,title:K?`${t.path} — git-ignored`:void 0,children:t.name}),B&&(0,a.Y)("span",{className:`font-mono text-[9px] font-bold px-1 rounded flex-shrink-0 ${B.colorClass}`,title:`Git: ${B.label}`,children:B.charStatus}),U&&(0,a.Y)("span",{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 ${U.hasDeleted?"bg-error":U.hasModified||U.hasStaged?"bg-info":"bg-success"}`,title:`${U.count} changed file${U.count>1?"s":""}`})]}),X&&g&&(0,a.Y)("div",{className:"ml-3 border-l border-ink/10 pl-3 py-0.5 text-[10px] text-ink/30",children:"Loading…"}),X&&!g&&_.length>0&&(0,a.Y)("div",{className:"ml-3 border-l border-ink/10 pl-1",children:_.map(e=>(0,a.Y)(C,{file:e,rootPath:n,repo:i,onLoadChildren:l,onOpenFile:s,onActionComplete:h,expandedPaths:x,onToggleFolder:m,gitFileMap:f,gitFolderMap:u},e.id))}),S&&j&&(0,a.Y)(v,{x:j.x,y:j.y,isFolder:b,hasGitStatus:W,onAction:e=>{if(L(null),"view"===e)s&&s({...t,root:n,repo:i||"."});else if("diff"===e)window.dispatchEvent(new CustomEvent("omp:open-diff",{detail:{file:t.path,staged:V?.staged||V?.status&&" "!==V.status[0]&&"?"!==V.status[0],status:B?.charStatus||"M",repo:i||".",root:n}}));else if("explorer"===e){let e=new FormData;e.append("actionType","open_explorer"),e.append("path",t.path),q(e)}else if("copy_path"===e)navigator.clipboard.writeText("/app/applet/examples/"+t.path);else if("copy_relative"===e)navigator.clipboard.writeText(t.path);else if("history"===e){H(!0);let e=new FormData;e.append("actionType","git_history"),e.append("path",t.path),q(e)}else"rename"===e?(G(t.path),R(!0)):"delete"===e&&T(!0)}}),S&&$&&(0,a.Y)(N,{fileName:t.name,isFolder:b,isLoading:"idle"!==z.state,onCancel:()=>T(!1),onConfirm:()=>{let e=new FormData;e.append("actionType","delete"),e.append("path",t.path),q(e)}}),S&&M&&(0,a.Y)(w,{isFolder:b,renameValue:O,originalPath:t.path,isLoading:"idle"!==z.state,onChange:G,onCancel:()=>R(!1),onSubmit:e=>{e.preventDefault();let n=new FormData;n.append("actionType","rename"),n.append("path",t.path),n.append("newPath",O),q(n)}}),S&&E&&(0,a.Y)(Y,{filePath:t.path,fetcherState:z.state,fetcherData:z.data,onClose:()=>H(!1)})]})}var A=n("jo"),z=n("FL"),S=n("so"),J=n("Af");function j(e){let{className:t="",enabled:n=!0,rootPath:o,onOpenFile:c,refreshKey:d=0,onRefresh:p}=e,[h,x]=(0,r.J0)([]),[m,f]=(0,z.bL)("files.searchQuery",""),[u,b]=(0,r.J0)(!1),[k,y,g]=(0,z.bL)("files.expandedPaths",[]),[v,N]=(0,r.J0)(()=>new Set(k)),w=(0,r.li)({}),[Y,F]=(0,z.bL)("files.activeRepo","."),{isScrolling:D,handleScroll:j}=(0,A.K)(),{fileMap:L,folderMap:P,refreshGitStatus:M}=(0,S.e)(o,Y,d,n);(0,r.vJ)(()=>{g&&N(e=>{let t=new Set(k);return e.size===t.size&&Array.from(t).every(t=>e.has(t))?e:t})},[g,k]);let R=e=>{let t=new URLSearchParams;return o&&t.set("root",o),Y&&"."!==Y&&t.set("repo",Y),e&&t.set("path",e),t.set("t",String(Date.now())),`/api/fs/dir?${t.toString()}`},$=e=>{n&&(e?.silent||b(!0),fetch(R()).then(e=>e.json()).then(e=>{Array.isArray(e.files)&&x(function e(t,n,a){return t.map(t=>{if("folder"!==t.type)return t;let r=n[t.path],i=a.has(t.path);return r?{...t,children:e(r,n,a),is_expanded:+!!i}:t})}(e.files,w.current,v))}).catch(()=>{}).finally(()=>{e?.silent||b(!1)}))};(0,r.vJ)(()=>{g&&$()},[d,o,n,Y,g]),(0,J.n)(()=>$({silent:!0}),n&&g),(0,J.w)(()=>$({silent:!0}),n&&g);let T=e=>fetch(R(e)).then(e=>e.json()).then(t=>{Array.isArray(t.files)&&(w.current[e]=t.files,x(n=>(function e(t,n,a){return t.map(t=>{if(t.path===n)return{...t,children:a,is_expanded:1};if(Array.isArray(t.children)){let r=e(t.children,n,a);if(r!==t.children)return{...t,children:r}}return t})})(n,e,t.files)))}).catch(()=>{}),E=(e,t)=>{let n=new Set(v);t?n.add(e):n.delete(e),N(n),y(Array.from(n))};if(!n)return(0,a.Y)("div",{className:`flex flex-col h-full bg-paper items-center justify-center text-ink/40 ${t}`,children:(0,a.Y)("span",{className:"text-xs font-mono",children:"No session selected"})});let H=(()=>{if(!m.trim())return h;let e=m.toLowerCase(),t=n=>{let a=n.name.toLowerCase().includes(e);if("folder"===n.type){let e=(n.children||[]).map(t).filter(Boolean);return a||e.length>0?{...n,children:a&&0===e.length?n.children:e,forceExpanded:!0}:null}return a?n:null};return h.map(t).filter(Boolean)})(),O=()=>{M(),p?p():$()};return(0,a.FD)("div",{className:`flex flex-col h-full bg-paper ${t}`,children:[(0,a.FD)("div",{className:"p-3 border-b border-ink/10 flex flex-col space-y-2",children:[(0,a.FD)("div",{className:"flex items-center justify-between",children:[(0,a.Y)(s.I,{rootPath:o,activeRepo:Y,onSelectRepo:e=>{e!==Y&&(w.current={},N(new Set),y([]),F(e))}}),(0,a.Y)("button",{onClick:O,className:"p-1.5 text-ink/40 hover:text-ink hover:bg-ink/5 rounded transition-colors",title:"Refresh",children:(0,a.Y)(i.A,{size:14,className:u?"animate-spin":""})})]}),(0,a.FD)("div",{className:"relative",children:[(0,a.Y)(l.A,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-ink/40"}),(0,a.Y)("input",{type:"text",placeholder:"Search files...",value:m,onChange:e=>f(e.currentTarget.value),className:"w-full bg-canvas border border-ink/20 rounded pl-8 pr-3 py-1.5 text-xs focus:outline-none focus:border-ink transition-colors text-ink placeholder-ink/40"})]})]}),(0,a.Y)("div",{className:`flex-1 scrollbar-overlay-container p-2 font-mono text-[11px] text-ink/80 ${(0,A.p)(D)}`,onContextMenu:e=>e.preventDefault(),onScroll:j,children:u&&0===H.length?(0,a.Y)("div",{className:"p-4 text-center text-ink/40",children:"Loading files..."}):0===H.length?(0,a.Y)("div",{className:"p-4 text-center text-ink/40",children:"No files found"}):H.map(e=>(0,a.Y)(C,{file:e,rootPath:o,repo:Y,onLoadChildren:T,onOpenFile:c,onActionComplete:O,expandedPaths:v,onToggleFolder:E,gitFileMap:L,gitFolderMap:P},e.id))})]})}},rm(e,t,n){let a=(0,n("y").A)({name:"folder-git-2",size:24,node:[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]});n.d(t,{},{A:a})},YOg(e,t,n){let a=(0,n("y").A)({name:"git-compare",size:24,node:[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]});n.d(t,{},{A:a})}}]);