@loopstack/loopstack-studio 0.21.0 → 0.21.1

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 (649) hide show
  1. package/dist/components/LoadingCentered.js +2 -2
  2. package/dist/components/ai-elements/code-block.js +96 -0
  3. package/dist/components/ai-elements/message.js +87 -0
  4. package/dist/components/ai-elements/prompt-input.js +321 -0
  5. package/dist/components/ai-elements/reasoning.js +124 -0
  6. package/dist/components/ai-elements/shimmer.js +37 -0
  7. package/dist/components/ai-elements/sources.js +65 -0
  8. package/dist/components/ai-elements/tool.js +158 -0
  9. package/dist/components/content/ErrorAlert.js +17 -0
  10. package/dist/components/data-table/DataTable.js +99 -96
  11. package/dist/components/dynamic-form/CodeContent.js +2 -2
  12. package/dist/components/dynamic-form/FormElement.js +3 -3
  13. package/dist/components/dynamic-form/FormElementHeader.js +2 -2
  14. package/dist/components/dynamic-form/ObjectController.js +2 -2
  15. package/dist/components/layout/MainLayout.js +0 -1
  16. package/dist/components/lists/ListView.js +62 -59
  17. package/dist/components/loopstack-elements/link.js +115 -0
  18. package/dist/components/ui/button-group.js +13 -0
  19. package/dist/components/ui/command.js +7 -0
  20. package/dist/components/ui/context-menu.js +63 -0
  21. package/dist/components/ui/hover-card.js +6 -0
  22. package/dist/components/ui/input-group.js +85 -0
  23. package/dist/components/ui/table.js +2 -2
  24. package/dist/components/ui/tabs.js +54 -0
  25. package/dist/components/ui-widgets/UiActions.js +24 -0
  26. package/dist/components/ui-widgets/UiWidget.js +43 -0
  27. package/dist/components/ui-widgets/widgets/AiPromptInput.js +43 -0
  28. package/dist/components/ui-widgets/widgets/ButtonFullWidth.js +23 -0
  29. package/dist/components/ui-widgets/widgets/SubmitButton.js +23 -0
  30. package/dist/features/code-explorer/CodeExplorer.js +69 -0
  31. package/dist/features/code-explorer/components/CodeExplorerTree.js +43 -0
  32. package/dist/features/code-explorer/components/CodeExplorerTreeNode.js +82 -0
  33. package/dist/features/code-explorer/components/FileContentViewer.js +237 -0
  34. package/dist/features/code-explorer/components/FileTabsBar.js +191 -0
  35. package/dist/features/code-explorer/providers/CodeExplorerProvider.js +165 -0
  36. package/dist/features/code-explorer/utils/fileIcons.js +42 -0
  37. package/dist/features/dashboard/Dashboard.js +125 -0
  38. package/dist/features/dashboard/RunItem.js +76 -0
  39. package/dist/features/dashboard/RunList.js +32 -0
  40. package/dist/features/debug/components/ConfigFlowViewer.js +79 -0
  41. package/dist/features/debug/components/PipelineDebugHeader.js +48 -0
  42. package/dist/features/debug/components/PipelineDebugLegend.js +68 -0
  43. package/dist/features/debug/components/PipelineFlowViewer.js +109 -0
  44. package/dist/features/debug/components/pipeline-flow/StateNode.js +111 -0
  45. package/dist/features/debug/components/pipeline-flow/WorkflowGraph.js +41 -0
  46. package/dist/features/debug/components/pipeline-flow/WorkflowTransitionEdge.js +97 -0
  47. package/dist/features/debug/lib/edge-paths.js +47 -0
  48. package/dist/features/debug/lib/flow-utils.js +247 -0
  49. package/dist/features/health/LocalHealthCheck.js +1 -1
  50. package/dist/features/oauth/OAuthCallbackPage.js +2 -0
  51. package/dist/features/oauth/OAuthPromptRenderer.js +223 -0
  52. package/dist/features/oauth/index.js +3 -0
  53. package/dist/features/oauth/useOAuthPopup.js +83 -0
  54. package/dist/features/workbench/NavigationItems.js +52 -0
  55. package/dist/features/workbench/Workbench.js +101 -0
  56. package/dist/features/workbench/WorkbenchNavigation.js +38 -0
  57. package/dist/features/workbench/WorkflowItem.js +67 -0
  58. package/dist/features/workbench/WorkflowList.js +110 -0
  59. package/dist/features/workbench/components/DocumentItem.js +27 -0
  60. package/dist/features/workbench/components/DocumentList.js +40 -0
  61. package/dist/features/workbench/components/DocumentMetadataPills.js +63 -0
  62. package/dist/features/workbench/components/DocumentRenderer.js +54 -0
  63. package/dist/features/workbench/components/NavigationItem.js +68 -0
  64. package/dist/features/workbench/components/PipelineHistoryList.js +56 -0
  65. package/dist/features/workbench/components/WorkbenchSettingsModal.js +89 -0
  66. package/dist/features/workbench/components/WorkbenchSidebar.js +109 -0
  67. package/dist/features/workbench/components/WorkflowForms.js +22 -0
  68. package/dist/features/workbench/components/WorkflowHistoryItem.js +144 -0
  69. package/dist/features/workbench/components/buttons/WorkflowButtons.js +85 -0
  70. package/dist/features/workbench/components/document-details/DocumentDetails.js +425 -0
  71. package/dist/features/workbench/components/document-details/PromptDetails.js +146 -0
  72. package/dist/features/workbench/components/document-renderer/AiMessage.js +56 -0
  73. package/dist/features/workbench/components/document-renderer/AiMessageContent.js +174 -0
  74. package/dist/features/workbench/components/document-renderer/DocumentDebugRenderer.js +30 -0
  75. package/dist/features/workbench/components/document-renderer/DocumentFormRenderer.js +79 -0
  76. package/dist/features/workbench/components/document-renderer/DocumentMessageRenderer.js +10 -0
  77. package/dist/features/workbench/components/document-renderer/ErrorMessageRenderer.js +13 -0
  78. package/dist/features/workbench/components/document-renderer/LinkMessageRenderer.js +17 -0
  79. package/dist/features/workbench/components/document-renderer/MarkdownMessageRenderer.js +10 -0
  80. package/dist/features/workbench/components/document-renderer/PlainMessageRenderer.js +9 -0
  81. package/dist/features/workbench/hooks/useAutoScrollBottom.js +29 -0
  82. package/dist/features/workbench/hooks/useIntersectionObserver.js +44 -0
  83. package/dist/features/workbench/hooks/useScrollToListItem.js +23 -0
  84. package/dist/features/workbench/providers/ScrollProvider.js +22 -0
  85. package/dist/features/workbench/providers/WorkbenchContextProvider.js +3 -0
  86. package/dist/features/workspaces/Workspaces.js +156 -89
  87. package/dist/features/workspaces/components/CreateWorkspace.js +101 -78
  88. package/dist/features/workspaces/components/ExecutionTimeline.js +1 -1
  89. package/dist/hooks/index.js +1 -0
  90. package/dist/hooks/useDashboard.js +23 -0
  91. package/dist/hooks/useDocuments.js +45 -0
  92. package/dist/hooks/useFiles.js +63 -0
  93. package/dist/hooks/useNamespaceTree.js +27 -0
  94. package/dist/hooks/useNamespaces.js +34 -0
  95. package/dist/hooks/usePipelines.js +83 -6
  96. package/dist/hooks/useWorkflows.js +122 -0
  97. package/dist/hooks/useWorkspaces.js +49 -29
  98. package/dist/index.d.ts +75 -9
  99. package/dist/index.js +9 -1
  100. package/dist/lib/requireParam.js +6 -0
  101. package/dist/loopstack-studio.css +1 -1
  102. package/dist/node_modules/@ai-sdk/provider/dist/index.js +65 -0
  103. package/dist/node_modules/@ai-sdk/provider-utils/dist/index.js +1008 -0
  104. package/dist/node_modules/@dagrejs/dagre/dist/dagre.esm.js +1968 -0
  105. package/dist/node_modules/@shikijs/core/dist/index.js +1420 -0
  106. package/dist/node_modules/@shikijs/engine-oniguruma/dist/index.js +236 -0
  107. package/dist/node_modules/@shikijs/engine-oniguruma/dist/wasm-inlined.js +2 -0
  108. package/dist/node_modules/@shikijs/langs/dist/abap.js +2 -0
  109. package/dist/node_modules/@shikijs/langs/dist/actionscript-3.js +2 -0
  110. package/dist/node_modules/@shikijs/langs/dist/ada.js +2 -0
  111. package/dist/node_modules/@shikijs/langs/dist/angular-expression.js +2 -0
  112. package/dist/node_modules/@shikijs/langs/dist/angular-html.js +14 -0
  113. package/dist/node_modules/@shikijs/langs/dist/angular-inline-style.js +3 -0
  114. package/dist/node_modules/@shikijs/langs/dist/angular-inline-template.js +8 -0
  115. package/dist/node_modules/@shikijs/langs/dist/angular-let-declaration.js +3 -0
  116. package/dist/node_modules/@shikijs/langs/dist/angular-template-blocks.js +8 -0
  117. package/dist/node_modules/@shikijs/langs/dist/angular-template.js +3 -0
  118. package/dist/node_modules/@shikijs/langs/dist/angular-ts.js +16 -0
  119. package/dist/node_modules/@shikijs/langs/dist/apache.js +2 -0
  120. package/dist/node_modules/@shikijs/langs/dist/apex.js +2 -0
  121. package/dist/node_modules/@shikijs/langs/dist/apl.js +14 -0
  122. package/dist/node_modules/@shikijs/langs/dist/applescript.js +2 -0
  123. package/dist/node_modules/@shikijs/langs/dist/ara.js +2 -0
  124. package/dist/node_modules/@shikijs/langs/dist/asciidoc.js +2 -0
  125. package/dist/node_modules/@shikijs/langs/dist/asm.js +2 -0
  126. package/dist/node_modules/@shikijs/langs/dist/astro.js +16 -0
  127. package/dist/node_modules/@shikijs/langs/dist/awk.js +2 -0
  128. package/dist/node_modules/@shikijs/langs/dist/ballerina.js +2 -0
  129. package/dist/node_modules/@shikijs/langs/dist/bat.js +2 -0
  130. package/dist/node_modules/@shikijs/langs/dist/beancount.js +2 -0
  131. package/dist/node_modules/@shikijs/langs/dist/berry.js +2 -0
  132. package/dist/node_modules/@shikijs/langs/dist/bibtex.js +2 -0
  133. package/dist/node_modules/@shikijs/langs/dist/bicep.js +2 -0
  134. package/dist/node_modules/@shikijs/langs/dist/bird2.js +2 -0
  135. package/dist/node_modules/@shikijs/langs/dist/blade.js +18 -0
  136. package/dist/node_modules/@shikijs/langs/dist/bsl.js +3 -0
  137. package/dist/node_modules/@shikijs/langs/dist/c.js +2 -0
  138. package/dist/node_modules/@shikijs/langs/dist/c3.js +2 -0
  139. package/dist/node_modules/@shikijs/langs/dist/cadence.js +2 -0
  140. package/dist/node_modules/@shikijs/langs/dist/cairo.js +3 -0
  141. package/dist/node_modules/@shikijs/langs/dist/clarity.js +2 -0
  142. package/dist/node_modules/@shikijs/langs/dist/clojure.js +2 -0
  143. package/dist/node_modules/@shikijs/langs/dist/cmake.js +2 -0
  144. package/dist/node_modules/@shikijs/langs/dist/cobol.js +8 -0
  145. package/dist/node_modules/@shikijs/langs/dist/codeowners.js +2 -0
  146. package/dist/node_modules/@shikijs/langs/dist/codeql.js +2 -0
  147. package/dist/node_modules/@shikijs/langs/dist/coffee.js +3 -0
  148. package/dist/node_modules/@shikijs/langs/dist/common-lisp.js +2 -0
  149. package/dist/node_modules/@shikijs/langs/dist/coq.js +2 -0
  150. package/dist/node_modules/@shikijs/langs/dist/cpp-macro.js +10 -0
  151. package/dist/node_modules/@shikijs/langs/dist/cpp.js +12 -0
  152. package/dist/node_modules/@shikijs/langs/dist/crystal.js +16 -0
  153. package/dist/node_modules/@shikijs/langs/dist/csharp.js +2 -0
  154. package/dist/node_modules/@shikijs/langs/dist/css.js +2 -0
  155. package/dist/node_modules/@shikijs/langs/dist/csv.js +2 -0
  156. package/dist/node_modules/@shikijs/langs/dist/cue.js +2 -0
  157. package/dist/node_modules/@shikijs/langs/dist/cypher.js +2 -0
  158. package/dist/node_modules/@shikijs/langs/dist/d.js +2 -0
  159. package/dist/node_modules/@shikijs/langs/dist/dart.js +2 -0
  160. package/dist/node_modules/@shikijs/langs/dist/dax.js +2 -0
  161. package/dist/node_modules/@shikijs/langs/dist/desktop.js +2 -0
  162. package/dist/node_modules/@shikijs/langs/dist/diff.js +2 -0
  163. package/dist/node_modules/@shikijs/langs/dist/docker.js +2 -0
  164. package/dist/node_modules/@shikijs/langs/dist/dotenv.js +2 -0
  165. package/dist/node_modules/@shikijs/langs/dist/dream-maker.js +2 -0
  166. package/dist/node_modules/@shikijs/langs/dist/edge.js +10 -0
  167. package/dist/node_modules/@shikijs/langs/dist/elixir.js +3 -0
  168. package/dist/node_modules/@shikijs/langs/dist/elm.js +3 -0
  169. package/dist/node_modules/@shikijs/langs/dist/emacs-lisp.js +2 -0
  170. package/dist/node_modules/@shikijs/langs/dist/erb.js +8 -0
  171. package/dist/node_modules/@shikijs/langs/dist/erlang.js +3 -0
  172. package/dist/node_modules/@shikijs/langs/dist/es-tag-css.js +10 -0
  173. package/dist/node_modules/@shikijs/langs/dist/es-tag-glsl.js +10 -0
  174. package/dist/node_modules/@shikijs/langs/dist/es-tag-html.js +10 -0
  175. package/dist/node_modules/@shikijs/langs/dist/es-tag-sql.js +8 -0
  176. package/dist/node_modules/@shikijs/langs/dist/es-tag-xml.js +3 -0
  177. package/dist/node_modules/@shikijs/langs/dist/fennel.js +2 -0
  178. package/dist/node_modules/@shikijs/langs/dist/fish.js +2 -0
  179. package/dist/node_modules/@shikijs/langs/dist/fluent.js +2 -0
  180. package/dist/node_modules/@shikijs/langs/dist/fortran-fixed-form.js +3 -0
  181. package/dist/node_modules/@shikijs/langs/dist/fortran-free-form.js +2 -0
  182. package/dist/node_modules/@shikijs/langs/dist/fsharp.js +3 -0
  183. package/dist/node_modules/@shikijs/langs/dist/gdresource.js +8 -0
  184. package/dist/node_modules/@shikijs/langs/dist/gdscript.js +2 -0
  185. package/dist/node_modules/@shikijs/langs/dist/gdshader.js +2 -0
  186. package/dist/node_modules/@shikijs/langs/dist/genie.js +2 -0
  187. package/dist/node_modules/@shikijs/langs/dist/gherkin.js +2 -0
  188. package/dist/node_modules/@shikijs/langs/dist/git-commit.js +3 -0
  189. package/dist/node_modules/@shikijs/langs/dist/git-rebase.js +3 -0
  190. package/dist/node_modules/@shikijs/langs/dist/gleam.js +2 -0
  191. package/dist/node_modules/@shikijs/langs/dist/glimmer-js.js +12 -0
  192. package/dist/node_modules/@shikijs/langs/dist/glimmer-ts.js +12 -0
  193. package/dist/node_modules/@shikijs/langs/dist/glsl.js +3 -0
  194. package/dist/node_modules/@shikijs/langs/dist/gn.js +2 -0
  195. package/dist/node_modules/@shikijs/langs/dist/gnuplot.js +2 -0
  196. package/dist/node_modules/@shikijs/langs/dist/go.js +2 -0
  197. package/dist/node_modules/@shikijs/langs/dist/graphql.js +12 -0
  198. package/dist/node_modules/@shikijs/langs/dist/groovy.js +2 -0
  199. package/dist/node_modules/@shikijs/langs/dist/hack.js +8 -0
  200. package/dist/node_modules/@shikijs/langs/dist/haml.js +8 -0
  201. package/dist/node_modules/@shikijs/langs/dist/handlebars.js +12 -0
  202. package/dist/node_modules/@shikijs/langs/dist/haskell.js +2 -0
  203. package/dist/node_modules/@shikijs/langs/dist/haxe.js +2 -0
  204. package/dist/node_modules/@shikijs/langs/dist/hcl.js +2 -0
  205. package/dist/node_modules/@shikijs/langs/dist/hjson.js +2 -0
  206. package/dist/node_modules/@shikijs/langs/dist/hlsl.js +2 -0
  207. package/dist/node_modules/@shikijs/langs/dist/html-derivative.js +3 -0
  208. package/dist/node_modules/@shikijs/langs/dist/html.js +8 -0
  209. package/dist/node_modules/@shikijs/langs/dist/http.js +12 -0
  210. package/dist/node_modules/@shikijs/langs/dist/hurl.js +10 -0
  211. package/dist/node_modules/@shikijs/langs/dist/hxml.js +3 -0
  212. package/dist/node_modules/@shikijs/langs/dist/hy.js +2 -0
  213. package/dist/node_modules/@shikijs/langs/dist/imba.js +2 -0
  214. package/dist/node_modules/@shikijs/langs/dist/ini.js +2 -0
  215. package/dist/node_modules/@shikijs/langs/dist/java.js +2 -0
  216. package/dist/node_modules/@shikijs/langs/dist/javascript.js +2 -0
  217. package/dist/node_modules/@shikijs/langs/dist/jinja-html.js +3 -0
  218. package/dist/node_modules/@shikijs/langs/dist/jinja.js +3 -0
  219. package/dist/node_modules/@shikijs/langs/dist/jison.js +3 -0
  220. package/dist/node_modules/@shikijs/langs/dist/json.js +2 -0
  221. package/dist/node_modules/@shikijs/langs/dist/json5.js +2 -0
  222. package/dist/node_modules/@shikijs/langs/dist/jsonc.js +2 -0
  223. package/dist/node_modules/@shikijs/langs/dist/jsonl.js +2 -0
  224. package/dist/node_modules/@shikijs/langs/dist/jsonnet.js +2 -0
  225. package/dist/node_modules/@shikijs/langs/dist/jssm.js +2 -0
  226. package/dist/node_modules/@shikijs/langs/dist/jsx.js +2 -0
  227. package/dist/node_modules/@shikijs/langs/dist/julia.js +14 -0
  228. package/dist/node_modules/@shikijs/langs/dist/just.js +16 -0
  229. package/dist/node_modules/@shikijs/langs/dist/kdl.js +2 -0
  230. package/dist/node_modules/@shikijs/langs/dist/kotlin.js +2 -0
  231. package/dist/node_modules/@shikijs/langs/dist/kusto.js +2 -0
  232. package/dist/node_modules/@shikijs/langs/dist/latex.js +3 -0
  233. package/dist/node_modules/@shikijs/langs/dist/lean.js +2 -0
  234. package/dist/node_modules/@shikijs/langs/dist/less.js +2 -0
  235. package/dist/node_modules/@shikijs/langs/dist/liquid.js +12 -0
  236. package/dist/node_modules/@shikijs/langs/dist/llvm.js +2 -0
  237. package/dist/node_modules/@shikijs/langs/dist/log.js +2 -0
  238. package/dist/node_modules/@shikijs/langs/dist/logo.js +2 -0
  239. package/dist/node_modules/@shikijs/langs/dist/lua.js +3 -0
  240. package/dist/node_modules/@shikijs/langs/dist/luau.js +2 -0
  241. package/dist/node_modules/@shikijs/langs/dist/make.js +2 -0
  242. package/dist/node_modules/@shikijs/langs/dist/markdown-nix.js +2 -0
  243. package/dist/node_modules/@shikijs/langs/dist/markdown-vue.js +2 -0
  244. package/dist/node_modules/@shikijs/langs/dist/markdown.js +2 -0
  245. package/dist/node_modules/@shikijs/langs/dist/marko.js +12 -0
  246. package/dist/node_modules/@shikijs/langs/dist/matlab.js +2 -0
  247. package/dist/node_modules/@shikijs/langs/dist/mdc.js +10 -0
  248. package/dist/node_modules/@shikijs/langs/dist/mdx.js +2 -0
  249. package/dist/node_modules/@shikijs/langs/dist/mermaid.js +2 -0
  250. package/dist/node_modules/@shikijs/langs/dist/mipsasm.js +2 -0
  251. package/dist/node_modules/@shikijs/langs/dist/mojo.js +2 -0
  252. package/dist/node_modules/@shikijs/langs/dist/moonbit.js +2 -0
  253. package/dist/node_modules/@shikijs/langs/dist/move.js +2 -0
  254. package/dist/node_modules/@shikijs/langs/dist/narrat.js +2 -0
  255. package/dist/node_modules/@shikijs/langs/dist/nextflow-groovy.js +2 -0
  256. package/dist/node_modules/@shikijs/langs/dist/nextflow.js +3 -0
  257. package/dist/node_modules/@shikijs/langs/dist/nginx.js +3 -0
  258. package/dist/node_modules/@shikijs/langs/dist/nim.js +18 -0
  259. package/dist/node_modules/@shikijs/langs/dist/nix.js +3 -0
  260. package/dist/node_modules/@shikijs/langs/dist/nushell.js +2 -0
  261. package/dist/node_modules/@shikijs/langs/dist/objective-c.js +2 -0
  262. package/dist/node_modules/@shikijs/langs/dist/objective-cpp.js +2 -0
  263. package/dist/node_modules/@shikijs/langs/dist/ocaml.js +2 -0
  264. package/dist/node_modules/@shikijs/langs/dist/odin.js +2 -0
  265. package/dist/node_modules/@shikijs/langs/dist/openscad.js +2 -0
  266. package/dist/node_modules/@shikijs/langs/dist/pascal.js +2 -0
  267. package/dist/node_modules/@shikijs/langs/dist/perl.js +14 -0
  268. package/dist/node_modules/@shikijs/langs/dist/php.js +16 -0
  269. package/dist/node_modules/@shikijs/langs/dist/pkl.js +2 -0
  270. package/dist/node_modules/@shikijs/langs/dist/plsql.js +2 -0
  271. package/dist/node_modules/@shikijs/langs/dist/po.js +2 -0
  272. package/dist/node_modules/@shikijs/langs/dist/polar.js +2 -0
  273. package/dist/node_modules/@shikijs/langs/dist/postcss.js +2 -0
  274. package/dist/node_modules/@shikijs/langs/dist/powerquery.js +2 -0
  275. package/dist/node_modules/@shikijs/langs/dist/powershell.js +2 -0
  276. package/dist/node_modules/@shikijs/langs/dist/prisma.js +2 -0
  277. package/dist/node_modules/@shikijs/langs/dist/prolog.js +2 -0
  278. package/dist/node_modules/@shikijs/langs/dist/proto.js +2 -0
  279. package/dist/node_modules/@shikijs/langs/dist/pug.js +10 -0
  280. package/dist/node_modules/@shikijs/langs/dist/puppet.js +2 -0
  281. package/dist/node_modules/@shikijs/langs/dist/purescript.js +2 -0
  282. package/dist/node_modules/@shikijs/langs/dist/python.js +2 -0
  283. package/dist/node_modules/@shikijs/langs/dist/qml.js +3 -0
  284. package/dist/node_modules/@shikijs/langs/dist/qmldir.js +2 -0
  285. package/dist/node_modules/@shikijs/langs/dist/qss.js +2 -0
  286. package/dist/node_modules/@shikijs/langs/dist/r.js +2 -0
  287. package/dist/node_modules/@shikijs/langs/dist/racket.js +2 -0
  288. package/dist/node_modules/@shikijs/langs/dist/raku.js +2 -0
  289. package/dist/node_modules/@shikijs/langs/dist/razor.js +8 -0
  290. package/dist/node_modules/@shikijs/langs/dist/reg.js +2 -0
  291. package/dist/node_modules/@shikijs/langs/dist/regexp.js +2 -0
  292. package/dist/node_modules/@shikijs/langs/dist/rel.js +2 -0
  293. package/dist/node_modules/@shikijs/langs/dist/riscv.js +2 -0
  294. package/dist/node_modules/@shikijs/langs/dist/ron.js +2 -0
  295. package/dist/node_modules/@shikijs/langs/dist/rosmsg.js +2 -0
  296. package/dist/node_modules/@shikijs/langs/dist/rst.js +20 -0
  297. package/dist/node_modules/@shikijs/langs/dist/ruby.js +28 -0
  298. package/dist/node_modules/@shikijs/langs/dist/rust.js +2 -0
  299. package/dist/node_modules/@shikijs/langs/dist/sas.js +3 -0
  300. package/dist/node_modules/@shikijs/langs/dist/sass.js +2 -0
  301. package/dist/node_modules/@shikijs/langs/dist/scala.js +2 -0
  302. package/dist/node_modules/@shikijs/langs/dist/scheme.js +2 -0
  303. package/dist/node_modules/@shikijs/langs/dist/scss.js +3 -0
  304. package/dist/node_modules/@shikijs/langs/dist/sdbl.js +2 -0
  305. package/dist/node_modules/@shikijs/langs/dist/shaderlab.js +3 -0
  306. package/dist/node_modules/@shikijs/langs/dist/shellscript.js +2 -0
  307. package/dist/node_modules/@shikijs/langs/dist/shellsession.js +3 -0
  308. package/dist/node_modules/@shikijs/langs/dist/smalltalk.js +2 -0
  309. package/dist/node_modules/@shikijs/langs/dist/solidity.js +2 -0
  310. package/dist/node_modules/@shikijs/langs/dist/soy.js +3 -0
  311. package/dist/node_modules/@shikijs/langs/dist/sparql.js +3 -0
  312. package/dist/node_modules/@shikijs/langs/dist/splunk.js +2 -0
  313. package/dist/node_modules/@shikijs/langs/dist/sql.js +2 -0
  314. package/dist/node_modules/@shikijs/langs/dist/ssh-config.js +2 -0
  315. package/dist/node_modules/@shikijs/langs/dist/stata.js +3 -0
  316. package/dist/node_modules/@shikijs/langs/dist/stylus.js +2 -0
  317. package/dist/node_modules/@shikijs/langs/dist/surrealql.js +3 -0
  318. package/dist/node_modules/@shikijs/langs/dist/svelte.js +12 -0
  319. package/dist/node_modules/@shikijs/langs/dist/swift.js +2 -0
  320. package/dist/node_modules/@shikijs/langs/dist/system-verilog.js +2 -0
  321. package/dist/node_modules/@shikijs/langs/dist/systemd.js +2 -0
  322. package/dist/node_modules/@shikijs/langs/dist/talonscript.js +2 -0
  323. package/dist/node_modules/@shikijs/langs/dist/tasl.js +2 -0
  324. package/dist/node_modules/@shikijs/langs/dist/tcl.js +2 -0
  325. package/dist/node_modules/@shikijs/langs/dist/templ.js +10 -0
  326. package/dist/node_modules/@shikijs/langs/dist/terraform.js +2 -0
  327. package/dist/node_modules/@shikijs/langs/dist/tex.js +3 -0
  328. package/dist/node_modules/@shikijs/langs/dist/toml.js +2 -0
  329. package/dist/node_modules/@shikijs/langs/dist/ts-tags.js +16 -0
  330. package/dist/node_modules/@shikijs/langs/dist/tsv.js +2 -0
  331. package/dist/node_modules/@shikijs/langs/dist/tsx.js +2 -0
  332. package/dist/node_modules/@shikijs/langs/dist/turtle.js +2 -0
  333. package/dist/node_modules/@shikijs/langs/dist/twig.js +16 -0
  334. package/dist/node_modules/@shikijs/langs/dist/typescript.js +2 -0
  335. package/dist/node_modules/@shikijs/langs/dist/typespec.js +2 -0
  336. package/dist/node_modules/@shikijs/langs/dist/typst.js +2 -0
  337. package/dist/node_modules/@shikijs/langs/dist/v.js +2 -0
  338. package/dist/node_modules/@shikijs/langs/dist/vala.js +2 -0
  339. package/dist/node_modules/@shikijs/langs/dist/vb.js +2 -0
  340. package/dist/node_modules/@shikijs/langs/dist/verilog.js +2 -0
  341. package/dist/node_modules/@shikijs/langs/dist/vhdl.js +2 -0
  342. package/dist/node_modules/@shikijs/langs/dist/viml.js +2 -0
  343. package/dist/node_modules/@shikijs/langs/dist/vue-directives.js +2 -0
  344. package/dist/node_modules/@shikijs/langs/dist/vue-html.js +3 -0
  345. package/dist/node_modules/@shikijs/langs/dist/vue-interpolations.js +2 -0
  346. package/dist/node_modules/@shikijs/langs/dist/vue-sfc-style-variable-injection.js +3 -0
  347. package/dist/node_modules/@shikijs/langs/dist/vue-vine.js +16 -0
  348. package/dist/node_modules/@shikijs/langs/dist/vue.js +24 -0
  349. package/dist/node_modules/@shikijs/langs/dist/vyper.js +2 -0
  350. package/dist/node_modules/@shikijs/langs/dist/wasm.js +2 -0
  351. package/dist/node_modules/@shikijs/langs/dist/wenyan.js +2 -0
  352. package/dist/node_modules/@shikijs/langs/dist/wgsl.js +2 -0
  353. package/dist/node_modules/@shikijs/langs/dist/wikitext.js +2 -0
  354. package/dist/node_modules/@shikijs/langs/dist/wit.js +2 -0
  355. package/dist/node_modules/@shikijs/langs/dist/wolfram.js +2 -0
  356. package/dist/node_modules/@shikijs/langs/dist/xml.js +3 -0
  357. package/dist/node_modules/@shikijs/langs/dist/xsl.js +3 -0
  358. package/dist/node_modules/@shikijs/langs/dist/yaml.js +2 -0
  359. package/dist/node_modules/@shikijs/langs/dist/zenscript.js +2 -0
  360. package/dist/node_modules/@shikijs/langs/dist/zig.js +2 -0
  361. package/dist/node_modules/@shikijs/themes/dist/andromeeda.js +2 -0
  362. package/dist/node_modules/@shikijs/themes/dist/aurora-x.js +2 -0
  363. package/dist/node_modules/@shikijs/themes/dist/ayu-dark.js +2 -0
  364. package/dist/node_modules/@shikijs/themes/dist/ayu-light.js +2 -0
  365. package/dist/node_modules/@shikijs/themes/dist/ayu-mirage.js +2 -0
  366. package/dist/node_modules/@shikijs/themes/dist/catppuccin-frappe.js +2 -0
  367. package/dist/node_modules/@shikijs/themes/dist/catppuccin-latte.js +2 -0
  368. package/dist/node_modules/@shikijs/themes/dist/catppuccin-macchiato.js +2 -0
  369. package/dist/node_modules/@shikijs/themes/dist/catppuccin-mocha.js +2 -0
  370. package/dist/node_modules/@shikijs/themes/dist/dark-plus.js +2 -0
  371. package/dist/node_modules/@shikijs/themes/dist/dracula-soft.js +2 -0
  372. package/dist/node_modules/@shikijs/themes/dist/dracula.js +2 -0
  373. package/dist/node_modules/@shikijs/themes/dist/everforest-dark.js +2 -0
  374. package/dist/node_modules/@shikijs/themes/dist/everforest-light.js +2 -0
  375. package/dist/node_modules/@shikijs/themes/dist/github-dark-default.js +2 -0
  376. package/dist/node_modules/@shikijs/themes/dist/github-dark-dimmed.js +2 -0
  377. package/dist/node_modules/@shikijs/themes/dist/github-dark-high-contrast.js +2 -0
  378. package/dist/node_modules/@shikijs/themes/dist/github-dark.js +2 -0
  379. package/dist/node_modules/@shikijs/themes/dist/github-light-default.js +2 -0
  380. package/dist/node_modules/@shikijs/themes/dist/github-light-high-contrast.js +2 -0
  381. package/dist/node_modules/@shikijs/themes/dist/github-light.js +2 -0
  382. package/dist/node_modules/@shikijs/themes/dist/gruvbox-dark-hard.js +2 -0
  383. package/dist/node_modules/@shikijs/themes/dist/gruvbox-dark-medium.js +2 -0
  384. package/dist/node_modules/@shikijs/themes/dist/gruvbox-dark-soft.js +2 -0
  385. package/dist/node_modules/@shikijs/themes/dist/gruvbox-light-hard.js +2 -0
  386. package/dist/node_modules/@shikijs/themes/dist/gruvbox-light-medium.js +2 -0
  387. package/dist/node_modules/@shikijs/themes/dist/gruvbox-light-soft.js +2 -0
  388. package/dist/node_modules/@shikijs/themes/dist/horizon-bright.js +2 -0
  389. package/dist/node_modules/@shikijs/themes/dist/horizon.js +2 -0
  390. package/dist/node_modules/@shikijs/themes/dist/houston.js +2 -0
  391. package/dist/node_modules/@shikijs/themes/dist/kanagawa-dragon.js +2 -0
  392. package/dist/node_modules/@shikijs/themes/dist/kanagawa-lotus.js +2 -0
  393. package/dist/node_modules/@shikijs/themes/dist/kanagawa-wave.js +2 -0
  394. package/dist/node_modules/@shikijs/themes/dist/laserwave.js +2 -0
  395. package/dist/node_modules/@shikijs/themes/dist/light-plus.js +2 -0
  396. package/dist/node_modules/@shikijs/themes/dist/material-theme-darker.js +2 -0
  397. package/dist/node_modules/@shikijs/themes/dist/material-theme-lighter.js +2 -0
  398. package/dist/node_modules/@shikijs/themes/dist/material-theme-ocean.js +2 -0
  399. package/dist/node_modules/@shikijs/themes/dist/material-theme-palenight.js +2 -0
  400. package/dist/node_modules/@shikijs/themes/dist/material-theme.js +2 -0
  401. package/dist/node_modules/@shikijs/themes/dist/min-dark.js +2 -0
  402. package/dist/node_modules/@shikijs/themes/dist/min-light.js +2 -0
  403. package/dist/node_modules/@shikijs/themes/dist/monokai.js +2 -0
  404. package/dist/node_modules/@shikijs/themes/dist/night-owl-light.js +2 -0
  405. package/dist/node_modules/@shikijs/themes/dist/night-owl.js +2 -0
  406. package/dist/node_modules/@shikijs/themes/dist/nord.js +2 -0
  407. package/dist/node_modules/@shikijs/themes/dist/one-dark-pro.js +2 -0
  408. package/dist/node_modules/@shikijs/themes/dist/one-light.js +2 -0
  409. package/dist/node_modules/@shikijs/themes/dist/plastic.js +2 -0
  410. package/dist/node_modules/@shikijs/themes/dist/poimandres.js +2 -0
  411. package/dist/node_modules/@shikijs/themes/dist/red.js +2 -0
  412. package/dist/node_modules/@shikijs/themes/dist/rose-pine-dawn.js +2 -0
  413. package/dist/node_modules/@shikijs/themes/dist/rose-pine-moon.js +2 -0
  414. package/dist/node_modules/@shikijs/themes/dist/rose-pine.js +2 -0
  415. package/dist/node_modules/@shikijs/themes/dist/slack-dark.js +2 -0
  416. package/dist/node_modules/@shikijs/themes/dist/slack-ochin.js +2 -0
  417. package/dist/node_modules/@shikijs/themes/dist/snazzy-light.js +2 -0
  418. package/dist/node_modules/@shikijs/themes/dist/solarized-dark.js +2 -0
  419. package/dist/node_modules/@shikijs/themes/dist/solarized-light.js +2 -0
  420. package/dist/node_modules/@shikijs/themes/dist/synthwave-84.js +2 -0
  421. package/dist/node_modules/@shikijs/themes/dist/tokyo-night.js +2 -0
  422. package/dist/node_modules/@shikijs/themes/dist/vesper.js +2 -0
  423. package/dist/node_modules/@shikijs/themes/dist/vitesse-black.js +2 -0
  424. package/dist/node_modules/@shikijs/themes/dist/vitesse-dark.js +2 -0
  425. package/dist/node_modules/@shikijs/themes/dist/vitesse-light.js +2 -0
  426. package/dist/node_modules/@shikijs/types/dist/index.js +6 -0
  427. package/dist/node_modules/@shikijs/vscode-textmate/dist/index.js +1580 -0
  428. package/dist/node_modules/@ungap/structured-clone/esm/deserialize.js +51 -0
  429. package/dist/node_modules/@ungap/structured-clone/esm/index.js +4 -0
  430. package/dist/node_modules/@ungap/structured-clone/esm/serialize.js +91 -0
  431. package/dist/node_modules/@ungap/structured-clone/esm/types.js +2 -0
  432. package/dist/node_modules/@xyflow/react/dist/esm/index.js +3280 -0
  433. package/dist/node_modules/@xyflow/system/dist/esm/index.js +1839 -0
  434. package/dist/node_modules/ai/dist/index.js +1083 -0
  435. package/dist/node_modules/bail/index.js +4 -0
  436. package/dist/node_modules/character-entities-html4/index.js +255 -0
  437. package/dist/node_modules/character-entities-legacy/index.js +2 -0
  438. package/dist/node_modules/chevrotain/lib/src/parse/errors_public.js +6 -1
  439. package/dist/node_modules/chevrotain/lib/src/scan/lexer.js +4 -10
  440. package/dist/node_modules/chevrotain/lib/src/scan/lexer_public.js +56 -65
  441. package/dist/node_modules/classcat/index.js +8 -0
  442. package/dist/node_modules/comma-separated-tokens/index.js +5 -1
  443. package/dist/node_modules/d3/src/index.js +5 -0
  444. package/dist/node_modules/d3-drag/src/constant.js +2 -0
  445. package/dist/node_modules/d3-drag/src/drag.js +112 -0
  446. package/dist/node_modules/d3-drag/src/event.js +60 -0
  447. package/dist/node_modules/d3-drag/src/nodrag.js +13 -0
  448. package/dist/node_modules/d3-drag/src/noevent.js +11 -0
  449. package/dist/node_modules/d3-interpolate/src/zoom.js +39 -0
  450. package/dist/node_modules/d3-selection/src/pointer.js +16 -0
  451. package/dist/node_modules/d3-selection/src/sourceEvent.js +6 -0
  452. package/dist/node_modules/d3-zoom/src/constant.js +2 -0
  453. package/dist/node_modules/d3-zoom/src/event.js +26 -0
  454. package/dist/node_modules/d3-zoom/src/index.js +1 -1
  455. package/dist/node_modules/d3-zoom/src/noevent.js +7 -0
  456. package/dist/node_modules/d3-zoom/src/zoom.js +214 -1
  457. package/dist/node_modules/decode-named-character-reference/index.dom.js +8 -0
  458. package/dist/node_modules/entities/dist/esm/decode-codepoint.js +35 -0
  459. package/dist/node_modules/entities/dist/esm/decode.js +129 -0
  460. package/dist/node_modules/entities/dist/esm/generated/decode-data-html.js +2 -0
  461. package/dist/node_modules/estree-util-is-identifier-name/lib/index.js +5 -0
  462. package/dist/node_modules/extend/index.js +37 -0
  463. package/dist/node_modules/hast-util-from-parse5/lib/index.js +121 -0
  464. package/dist/node_modules/hast-util-raw/lib/index.js +204 -0
  465. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/doctype.js +34 -0
  466. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/error-codes.js +5 -0
  467. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/foreign-content.js +150 -0
  468. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/html.js +267 -0
  469. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/token.js +9 -0
  470. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/unicode.js +65 -0
  471. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/index.js +8 -0
  472. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/formatting-element-list.js +69 -0
  473. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/index.js +1936 -0
  474. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/open-element-stack.js +239 -0
  475. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/serializer/index.js +22 -0
  476. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/index.js +1451 -0
  477. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/preprocessor.js +75 -0
  478. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tree-adapters/default.js +155 -0
  479. package/dist/node_modules/hast-util-sanitize/lib/index.js +159 -0
  480. package/dist/node_modules/hast-util-sanitize/lib/schema.js +73 -0
  481. package/dist/node_modules/hast-util-to-html/lib/handle/comment.js +9 -0
  482. package/dist/node_modules/hast-util-to-html/lib/handle/doctype.js +4 -0
  483. package/dist/node_modules/hast-util-to-html/lib/handle/element.js +47 -0
  484. package/dist/node_modules/hast-util-to-html/lib/handle/index.js +27 -0
  485. package/dist/node_modules/hast-util-to-html/lib/handle/raw.js +5 -0
  486. package/dist/node_modules/hast-util-to-html/lib/handle/root.js +4 -0
  487. package/dist/node_modules/hast-util-to-html/lib/handle/text.js +6 -0
  488. package/dist/node_modules/hast-util-to-html/lib/index.js +46 -0
  489. package/dist/node_modules/hast-util-to-html/lib/omission/closing.js +84 -0
  490. package/dist/node_modules/hast-util-to-html/lib/omission/omission.js +8 -0
  491. package/dist/node_modules/hast-util-to-html/lib/omission/opening.js +37 -0
  492. package/dist/node_modules/hast-util-to-html/lib/omission/util/siblings.js +12 -0
  493. package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +251 -0
  494. package/dist/node_modules/hast-util-to-parse5/lib/index.js +113 -0
  495. package/dist/node_modules/hast-util-whitespace/lib/index.js +8 -0
  496. package/dist/node_modules/html-url-attributes/lib/index.js +34 -0
  497. package/dist/node_modules/html-void-elements/index.js +23 -0
  498. package/dist/node_modules/inline-style-parser/cjs/index.js +88 -0
  499. package/dist/node_modules/mdast-util-from-markdown/lib/index.js +555 -0
  500. package/dist/node_modules/mdast-util-to-hast/lib/footer.js +101 -0
  501. package/dist/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js +10 -0
  502. package/dist/node_modules/mdast-util-to-hast/lib/handlers/break.js +13 -0
  503. package/dist/node_modules/mdast-util-to-hast/lib/handlers/code.js +20 -0
  504. package/dist/node_modules/mdast-util-to-hast/lib/handlers/delete.js +10 -0
  505. package/dist/node_modules/mdast-util-to-hast/lib/handlers/emphasis.js +10 -0
  506. package/dist/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js +28 -0
  507. package/dist/node_modules/mdast-util-to-hast/lib/handlers/heading.js +10 -0
  508. package/dist/node_modules/mdast-util-to-hast/lib/handlers/html.js +10 -0
  509. package/dist/node_modules/mdast-util-to-hast/lib/handlers/image-reference.js +19 -0
  510. package/dist/node_modules/mdast-util-to-hast/lib/handlers/image.js +13 -0
  511. package/dist/node_modules/mdast-util-to-hast/lib/handlers/index.js +54 -0
  512. package/dist/node_modules/mdast-util-to-hast/lib/handlers/inline-code.js +15 -0
  513. package/dist/node_modules/mdast-util-to-hast/lib/handlers/link-reference.js +16 -0
  514. package/dist/node_modules/mdast-util-to-hast/lib/handlers/link.js +13 -0
  515. package/dist/node_modules/mdast-util-to-hast/lib/handlers/list-item.js +57 -0
  516. package/dist/node_modules/mdast-util-to-hast/lib/handlers/list.js +18 -0
  517. package/dist/node_modules/mdast-util-to-hast/lib/handlers/paragraph.js +10 -0
  518. package/dist/node_modules/mdast-util-to-hast/lib/handlers/root.js +8 -0
  519. package/dist/node_modules/mdast-util-to-hast/lib/handlers/strong.js +10 -0
  520. package/dist/node_modules/mdast-util-to-hast/lib/handlers/table-cell.js +10 -0
  521. package/dist/node_modules/mdast-util-to-hast/lib/handlers/table-row.js +22 -0
  522. package/dist/node_modules/mdast-util-to-hast/lib/handlers/table.js +33 -0
  523. package/dist/node_modules/mdast-util-to-hast/lib/handlers/text.js +9 -0
  524. package/dist/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js +10 -0
  525. package/dist/node_modules/mdast-util-to-hast/lib/index.js +17 -0
  526. package/dist/node_modules/mdast-util-to-hast/lib/revert.js +18 -0
  527. package/dist/node_modules/mdast-util-to-hast/lib/state.js +106 -0
  528. package/dist/node_modules/micromark/lib/constructs.js +79 -0
  529. package/dist/node_modules/micromark/lib/create-tokenizer.js +175 -0
  530. package/dist/node_modules/micromark/lib/initialize/content.js +32 -0
  531. package/dist/node_modules/micromark/lib/initialize/document.js +101 -0
  532. package/dist/node_modules/micromark/lib/initialize/flow.js +23 -0
  533. package/dist/node_modules/micromark/lib/initialize/text.js +84 -0
  534. package/dist/node_modules/micromark/lib/parse.js +27 -0
  535. package/dist/node_modules/micromark/lib/postprocess.js +6 -0
  536. package/dist/node_modules/micromark/lib/preprocess.js +30 -0
  537. package/dist/node_modules/micromark-core-commonmark/lib/attention.js +112 -0
  538. package/dist/node_modules/micromark-core-commonmark/lib/autolink.js +41 -0
  539. package/dist/node_modules/micromark-core-commonmark/lib/block-quote.js +36 -0
  540. package/dist/node_modules/micromark-core-commonmark/lib/character-escape.js +15 -0
  541. package/dist/node_modules/micromark-core-commonmark/lib/character-reference.js +27 -0
  542. package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.js +88 -0
  543. package/dist/node_modules/micromark-core-commonmark/lib/code-indented.js +42 -0
  544. package/dist/node_modules/micromark-core-commonmark/lib/code-text.js +41 -0
  545. package/dist/node_modules/micromark-core-commonmark/lib/content.js +46 -0
  546. package/dist/node_modules/micromark-core-commonmark/lib/definition.js +59 -0
  547. package/dist/node_modules/micromark-core-commonmark/lib/hard-break-escape.js +15 -0
  548. package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.js +65 -0
  549. package/dist/node_modules/micromark-core-commonmark/lib/html-flow.js +140 -0
  550. package/dist/node_modules/micromark-core-commonmark/lib/html-text.js +98 -0
  551. package/dist/node_modules/micromark-core-commonmark/lib/label-end.js +157 -0
  552. package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.js +21 -0
  553. package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.js +18 -0
  554. package/dist/node_modules/micromark-core-commonmark/lib/line-ending.js +12 -0
  555. package/dist/node_modules/micromark-core-commonmark/lib/list.js +77 -0
  556. package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.js +57 -0
  557. package/dist/node_modules/micromark-core-commonmark/lib/thematic-break.js +23 -0
  558. package/dist/node_modules/micromark-factory-destination/index.js +24 -0
  559. package/dist/node_modules/micromark-factory-label/index.js +18 -0
  560. package/dist/node_modules/micromark-factory-title/index.js +22 -0
  561. package/dist/node_modules/micromark-factory-whitespace/index.js +10 -0
  562. package/dist/node_modules/micromark-util-character/index.js +6 -5
  563. package/dist/node_modules/micromark-util-chunked/index.js +4 -1
  564. package/dist/node_modules/micromark-util-decode-numeric-character-reference/index.js +5 -0
  565. package/dist/node_modules/micromark-util-decode-string/index.js +15 -0
  566. package/dist/node_modules/micromark-util-html-tag-name/index.js +7 -0
  567. package/dist/node_modules/micromark-util-sanitize-uri/index.js +16 -0
  568. package/dist/node_modules/micromark-util-subtokenize/index.js +33 -0
  569. package/dist/node_modules/micromark-util-subtokenize/lib/splice-buffer.js +55 -0
  570. package/dist/node_modules/motion/dist/es/react.js +3 -0
  571. package/dist/node_modules/nanoid/index.browser.js +7 -0
  572. package/dist/node_modules/nanoid/url-alphabet/index.js +2 -0
  573. package/dist/node_modules/property-information/index.js +1 -0
  574. package/dist/node_modules/property-information/lib/hast-to-react.js +20 -0
  575. package/dist/node_modules/rehype-harden/dist/index.js +168 -0
  576. package/dist/node_modules/rehype-raw/lib/index.js +10 -0
  577. package/dist/node_modules/rehype-sanitize/lib/index.js +7 -0
  578. package/dist/node_modules/remark-parse/lib/index.js +14 -0
  579. package/dist/node_modules/remark-rehype/lib/index.js +16 -0
  580. package/dist/node_modules/remend/dist/index.js +459 -0
  581. package/dist/node_modules/shiki/dist/bundle-full.js +11 -0
  582. package/dist/node_modules/shiki/dist/langs.js +1278 -0
  583. package/dist/node_modules/shiki/dist/themes.js +393 -0
  584. package/dist/node_modules/shiki/dist/wasm.js +2 -0
  585. package/dist/node_modules/space-separated-tokens/index.js +4 -1
  586. package/dist/node_modules/streamdown/dist/chunk-RLXIAIE6.js +2189 -0
  587. package/dist/node_modules/streamdown/dist/highlighted-body-B3W2YXNL.js +33 -0
  588. package/dist/node_modules/streamdown/dist/index.js +2 -0
  589. package/dist/node_modules/streamdown/dist/mermaid-3ZIDBTTL.js +3 -0
  590. package/dist/node_modules/streamdown/node_modules/marked/lib/marked.esm.js +1421 -0
  591. package/dist/node_modules/stringify-entities/lib/constant/dangerous.js +11 -0
  592. package/dist/node_modules/stringify-entities/lib/core.js +21 -0
  593. package/dist/node_modules/stringify-entities/lib/index.js +6 -0
  594. package/dist/node_modules/stringify-entities/lib/util/format-smart.js +12 -0
  595. package/dist/node_modules/stringify-entities/lib/util/to-decimal.js +6 -0
  596. package/dist/node_modules/stringify-entities/lib/util/to-hexadecimal.js +6 -0
  597. package/dist/node_modules/stringify-entities/lib/util/to-named.js +15 -0
  598. package/dist/node_modules/style-to-js/cjs/index.js +17 -0
  599. package/dist/node_modules/style-to-js/cjs/utilities.js +16 -0
  600. package/dist/node_modules/style-to-object/cjs/index.js +21 -0
  601. package/dist/node_modules/trim-lines/index.js +19 -0
  602. package/dist/node_modules/trough/lib/index.js +48 -0
  603. package/dist/node_modules/unified/lib/callable-instance.js +7 -0
  604. package/dist/node_modules/unified/lib/index.js +160 -0
  605. package/dist/node_modules/unified/node_modules/is-plain-obj/index.js +6 -0
  606. package/dist/node_modules/unist-util-position/lib/index.js +20 -0
  607. package/dist/node_modules/unist-util-stringify-position/lib/index.js +13 -0
  608. package/dist/node_modules/vfile/lib/index.js +87 -0
  609. package/dist/node_modules/vfile/lib/minpath.browser.js +97 -0
  610. package/dist/node_modules/vfile/lib/minproc.browser.js +5 -0
  611. package/dist/node_modules/vfile/lib/minurl.browser.js +29 -0
  612. package/dist/node_modules/vfile/lib/minurl.shared.js +4 -0
  613. package/dist/node_modules/vfile-location/lib/index.js +41 -0
  614. package/dist/node_modules/vfile-message/lib/index.js +22 -0
  615. package/dist/node_modules/zod/v3/ZodError.js +79 -0
  616. package/dist/node_modules/zod/v3/errors.js +6 -0
  617. package/dist/node_modules/zod/v3/helpers/errorUtil.js +5 -0
  618. package/dist/node_modules/zod/v3/helpers/parseUtil.js +90 -0
  619. package/dist/node_modules/zod/v3/helpers/util.js +72 -0
  620. package/dist/node_modules/zod/v3/locales/en.js +58 -0
  621. package/dist/node_modules/zod/v3/types.js +2425 -0
  622. package/dist/node_modules/zod/v4/classic/errors.js +21 -0
  623. package/dist/node_modules/zod/v4/classic/iso.js +29 -0
  624. package/dist/node_modules/zod/v4/classic/parse.js +4 -0
  625. package/dist/node_modules/zod/v4/classic/schemas.js +392 -0
  626. package/dist/node_modules/zod/v4/core/api.js +532 -0
  627. package/dist/node_modules/zod/v4/core/checks.js +283 -0
  628. package/dist/node_modules/zod/v4/core/core.js +44 -0
  629. package/dist/node_modules/zod/v4/core/doc.js +21 -0
  630. package/dist/node_modules/zod/v4/core/errors.js +40 -0
  631. package/dist/node_modules/zod/v4/core/json-schema-processors.js +305 -0
  632. package/dist/node_modules/zod/v4/core/parse.js +66 -0
  633. package/dist/node_modules/zod/v4/core/regexes.js +28 -0
  634. package/dist/node_modules/zod/v4/core/registries.js +38 -0
  635. package/dist/node_modules/zod/v4/core/schemas.js +863 -0
  636. package/dist/node_modules/zod/v4/core/to-json-schema.js +220 -0
  637. package/dist/node_modules/zod/v4/core/util.js +267 -0
  638. package/dist/node_modules/zod/v4/core/versions.js +6 -0
  639. package/dist/node_modules/zwitch/index.js +14 -0
  640. package/dist/pages/DashboardPage.js +58 -0
  641. package/dist/pages/DebugWorkflowDetailsPage.js +121 -0
  642. package/dist/pages/DebugWorkflowsPage.js +130 -0
  643. package/dist/pages/EmbedWorkbenchPage.js +73 -0
  644. package/dist/pages/PipelineDebugPage.js +114 -0
  645. package/dist/pages/WorkbenchPage.js +67 -0
  646. package/dist/pages/WorkspacePage.js +1 -1
  647. package/dist/providers/ComponentOverridesProvider.js +12 -0
  648. package/dist/routing/LocalRouter.js +3 -0
  649. package/package.json +3 -3
@@ -0,0 +1,1580 @@
1
+ function clone(l) {
2
+ return doClone(l);
3
+ }
4
+ function doClone(l) {
5
+ return Array.isArray(l) ? cloneArray(l) : l instanceof RegExp ? l : typeof l == "object" ? cloneObj(l) : l;
6
+ }
7
+ function cloneArray(l) {
8
+ let z = [];
9
+ for (let B = 0, V = l.length; B < V; B++) z[B] = doClone(l[B]);
10
+ return z;
11
+ }
12
+ function cloneObj(l) {
13
+ let z = {};
14
+ for (let B in l) z[B] = doClone(l[B]);
15
+ return z;
16
+ }
17
+ function mergeObjects(l, ...R) {
18
+ return R.forEach((R) => {
19
+ for (let z in R) l[z] = R[z];
20
+ }), l;
21
+ }
22
+ function basename(l) {
23
+ let R = ~l.lastIndexOf("/") || ~l.lastIndexOf("\\");
24
+ return R === 0 ? l : ~R === l.length - 1 ? basename(l.substring(0, l.length - 1)) : l.substr(~R + 1);
25
+ }
26
+ var CAPTURING_REGEX_SOURCE = /\$(\d+)|\${(\d+):\/(downcase|upcase)}/g, RegexSource = class {
27
+ static hasCaptures(l) {
28
+ return l === null ? !1 : (CAPTURING_REGEX_SOURCE.lastIndex = 0, CAPTURING_REGEX_SOURCE.test(l));
29
+ }
30
+ static replaceCaptures(l, R, z) {
31
+ return l.replace(CAPTURING_REGEX_SOURCE, (l, B, V, H) => {
32
+ let U = z[parseInt(B || V, 10)];
33
+ if (U) {
34
+ let l = R.substring(U.start, U.end);
35
+ for (; l[0] === ".";) l = l.substring(1);
36
+ switch (H) {
37
+ case "downcase": return l.toLowerCase();
38
+ case "upcase": return l.toUpperCase();
39
+ default: return l;
40
+ }
41
+ } else return l;
42
+ });
43
+ }
44
+ };
45
+ function strcmp(l, R) {
46
+ return l < R ? -1 : l > R ? 1 : 0;
47
+ }
48
+ function strArrCmp(l, R) {
49
+ if (l === null && R === null) return 0;
50
+ if (!l) return -1;
51
+ if (!R) return 1;
52
+ let z = l.length, B = R.length;
53
+ if (z === B) {
54
+ for (let B = 0; B < z; B++) {
55
+ let z = strcmp(l[B], R[B]);
56
+ if (z !== 0) return z;
57
+ }
58
+ return 0;
59
+ }
60
+ return z - B;
61
+ }
62
+ function isValidHexColor(l) {
63
+ return !!(/^#[0-9a-f]{6}$/i.test(l) || /^#[0-9a-f]{8}$/i.test(l) || /^#[0-9a-f]{3}$/i.test(l) || /^#[0-9a-f]{4}$/i.test(l));
64
+ }
65
+ function escapeRegExpCharacters(l) {
66
+ return l.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, "\\$&");
67
+ }
68
+ var CachedFn = class {
69
+ constructor(l) {
70
+ this.fn = l;
71
+ }
72
+ cache = /* @__PURE__ */ new Map();
73
+ get(l) {
74
+ if (this.cache.has(l)) return this.cache.get(l);
75
+ let R = this.fn(l);
76
+ return this.cache.set(l, R), R;
77
+ }
78
+ }, Theme = class {
79
+ constructor(l, R, z) {
80
+ this._colorMap = l, this._defaults = R, this._root = z;
81
+ }
82
+ static createFromRawTheme(l, R) {
83
+ return this.createFromParsedTheme(parseTheme(l), R);
84
+ }
85
+ static createFromParsedTheme(l, R) {
86
+ return resolveParsedThemeRules(l, R);
87
+ }
88
+ _cachedMatchRoot = new CachedFn((l) => this._root.match(l));
89
+ getColorMap() {
90
+ return this._colorMap.getColorMap();
91
+ }
92
+ getDefaults() {
93
+ return this._defaults;
94
+ }
95
+ match(l) {
96
+ if (l === null) return this._defaults;
97
+ let R = l.scopeName, z = this._cachedMatchRoot.get(R).find((R) => _scopePathMatchesParentScopes(l.parent, R.parentScopes));
98
+ return z ? new StyleAttributes(z.fontStyle, z.foreground, z.background) : null;
99
+ }
100
+ }, ScopeStack = class l {
101
+ constructor(l, R) {
102
+ this.parent = l, this.scopeName = R;
103
+ }
104
+ static push(R, z) {
105
+ for (let B of z) R = new l(R, B);
106
+ return R;
107
+ }
108
+ static from(...R) {
109
+ let z = null;
110
+ for (let B = 0; B < R.length; B++) z = new l(z, R[B]);
111
+ return z;
112
+ }
113
+ push(R) {
114
+ return new l(this, R);
115
+ }
116
+ getSegments() {
117
+ let l = this, R = [];
118
+ for (; l;) R.push(l.scopeName), l = l.parent;
119
+ return R.reverse(), R;
120
+ }
121
+ toString() {
122
+ return this.getSegments().join(" ");
123
+ }
124
+ extends(l) {
125
+ return this === l ? !0 : this.parent === null ? !1 : this.parent.extends(l);
126
+ }
127
+ getExtensionIfDefined(l) {
128
+ let R = [], z = this;
129
+ for (; z && z !== l;) R.push(z.scopeName), z = z.parent;
130
+ return z === l ? R.reverse() : void 0;
131
+ }
132
+ };
133
+ function _scopePathMatchesParentScopes(l, R) {
134
+ if (R.length === 0) return !0;
135
+ for (let z = 0; z < R.length; z++) {
136
+ let B = R[z], V = !1;
137
+ if (B === ">") {
138
+ if (z === R.length - 1) return !1;
139
+ B = R[++z], V = !0;
140
+ }
141
+ for (; l && !_matchesScope(l.scopeName, B);) {
142
+ if (V) return !1;
143
+ l = l.parent;
144
+ }
145
+ if (!l) return !1;
146
+ l = l.parent;
147
+ }
148
+ return !0;
149
+ }
150
+ function _matchesScope(l, R) {
151
+ return R === l || l.startsWith(R) && l[R.length] === ".";
152
+ }
153
+ var StyleAttributes = class {
154
+ constructor(l, R, z) {
155
+ this.fontStyle = l, this.foregroundId = R, this.backgroundId = z;
156
+ }
157
+ };
158
+ function parseTheme(l) {
159
+ if (!l || !l.settings || !Array.isArray(l.settings)) return [];
160
+ let R = l.settings, z = [], B = 0;
161
+ for (let l = 0, V = R.length; l < V; l++) {
162
+ let V = R[l];
163
+ if (!V.settings) continue;
164
+ let H;
165
+ if (typeof V.scope == "string") {
166
+ let l = V.scope;
167
+ l = l.replace(/^[,]+/, ""), l = l.replace(/[,]+$/, ""), H = l.split(",");
168
+ } else H = Array.isArray(V.scope) ? V.scope : [""];
169
+ let U = -1;
170
+ if (typeof V.settings.fontStyle == "string") {
171
+ U = 0;
172
+ let l = V.settings.fontStyle.split(" ");
173
+ for (let R = 0, z = l.length; R < z; R++) switch (l[R]) {
174
+ case "italic":
175
+ U |= 1;
176
+ break;
177
+ case "bold":
178
+ U |= 2;
179
+ break;
180
+ case "underline":
181
+ U |= 4;
182
+ break;
183
+ case "strikethrough":
184
+ U |= 8;
185
+ break;
186
+ }
187
+ }
188
+ let W = null;
189
+ typeof V.settings.foreground == "string" && isValidHexColor(V.settings.foreground) && (W = V.settings.foreground);
190
+ let G = null;
191
+ typeof V.settings.background == "string" && isValidHexColor(V.settings.background) && (G = V.settings.background);
192
+ for (let R = 0, V = H.length; R < V; R++) {
193
+ let V = H[R].trim().split(" "), K = V[V.length - 1], q = null;
194
+ V.length > 1 && (q = V.slice(0, V.length - 1), q.reverse()), z[B++] = new ParsedThemeRule(K, q, l, U, W, G);
195
+ }
196
+ }
197
+ return z;
198
+ }
199
+ var ParsedThemeRule = class {
200
+ constructor(l, R, z, B, V, H) {
201
+ this.scope = l, this.parentScopes = R, this.index = z, this.fontStyle = B, this.foreground = V, this.background = H;
202
+ }
203
+ }, FontStyle = /* @__PURE__ */ ((l) => (l[l.NotSet = -1] = "NotSet", l[l.None = 0] = "None", l[l.Italic = 1] = "Italic", l[l.Bold = 2] = "Bold", l[l.Underline = 4] = "Underline", l[l.Strikethrough = 8] = "Strikethrough", l))(FontStyle || {});
204
+ function resolveParsedThemeRules(l, R) {
205
+ l.sort((l, R) => {
206
+ let z = strcmp(l.scope, R.scope);
207
+ return z !== 0 || (z = strArrCmp(l.parentScopes, R.parentScopes), z !== 0) ? z : l.index - R.index;
208
+ });
209
+ let z = 0, B = "#000000", V = "#ffffff";
210
+ for (; l.length >= 1 && l[0].scope === "";) {
211
+ let R = l.shift();
212
+ R.fontStyle !== -1 && (z = R.fontStyle), R.foreground !== null && (B = R.foreground), R.background !== null && (V = R.background);
213
+ }
214
+ let H = new ColorMap(R), U = new StyleAttributes(z, H.getId(B), H.getId(V)), W = new ThemeTrieElement(new ThemeTrieElementRule(0, null, -1, 0, 0), []);
215
+ for (let R = 0, z = l.length; R < z; R++) {
216
+ let z = l[R];
217
+ W.insert(0, z.scope, z.parentScopes, z.fontStyle, H.getId(z.foreground), H.getId(z.background));
218
+ }
219
+ return new Theme(H, U, W);
220
+ }
221
+ var ColorMap = class {
222
+ _isFrozen;
223
+ _lastColorId;
224
+ _id2color;
225
+ _color2id;
226
+ constructor(l) {
227
+ if (this._lastColorId = 0, this._id2color = [], this._color2id = /* @__PURE__ */ Object.create(null), Array.isArray(l)) {
228
+ this._isFrozen = !0;
229
+ for (let R = 0, z = l.length; R < z; R++) this._color2id[l[R]] = R, this._id2color[R] = l[R];
230
+ } else this._isFrozen = !1;
231
+ }
232
+ getId(l) {
233
+ if (l === null) return 0;
234
+ l = l.toUpperCase();
235
+ let R = this._color2id[l];
236
+ if (R) return R;
237
+ if (this._isFrozen) throw Error(`Missing color in color map - ${l}`);
238
+ return R = ++this._lastColorId, this._color2id[l] = R, this._id2color[R] = l, R;
239
+ }
240
+ getColorMap() {
241
+ return this._id2color.slice(0);
242
+ }
243
+ }, emptyParentScopes = Object.freeze([]), ThemeTrieElementRule = class l {
244
+ scopeDepth;
245
+ parentScopes;
246
+ fontStyle;
247
+ foreground;
248
+ background;
249
+ constructor(l, R, z, B, V) {
250
+ this.scopeDepth = l, this.parentScopes = R || emptyParentScopes, this.fontStyle = z, this.foreground = B, this.background = V;
251
+ }
252
+ clone() {
253
+ return new l(this.scopeDepth, this.parentScopes, this.fontStyle, this.foreground, this.background);
254
+ }
255
+ static cloneArr(l) {
256
+ let R = [];
257
+ for (let z = 0, B = l.length; z < B; z++) R[z] = l[z].clone();
258
+ return R;
259
+ }
260
+ acceptOverwrite(l, R, z, B) {
261
+ this.scopeDepth > l ? console.log("how did this happen?") : this.scopeDepth = l, R !== -1 && (this.fontStyle = R), z !== 0 && (this.foreground = z), B !== 0 && (this.background = B);
262
+ }
263
+ }, ThemeTrieElement = class l {
264
+ constructor(l, R = [], z = {}) {
265
+ this._mainRule = l, this._children = z, this._rulesWithParentScopes = R;
266
+ }
267
+ _rulesWithParentScopes;
268
+ static _cmpBySpecificity(l, R) {
269
+ if (l.scopeDepth !== R.scopeDepth) return R.scopeDepth - l.scopeDepth;
270
+ let z = 0, B = 0;
271
+ for (; l.parentScopes[z] === ">" && z++, R.parentScopes[B] === ">" && B++, !(z >= l.parentScopes.length || B >= R.parentScopes.length);) {
272
+ let V = R.parentScopes[B].length - l.parentScopes[z].length;
273
+ if (V !== 0) return V;
274
+ z++, B++;
275
+ }
276
+ return R.parentScopes.length - l.parentScopes.length;
277
+ }
278
+ match(R) {
279
+ if (R !== "") {
280
+ let l = R.indexOf("."), z, B;
281
+ if (l === -1 ? (z = R, B = "") : (z = R.substring(0, l), B = R.substring(l + 1)), this._children.hasOwnProperty(z)) return this._children[z].match(B);
282
+ }
283
+ let z = this._rulesWithParentScopes.concat(this._mainRule);
284
+ return z.sort(l._cmpBySpecificity), z;
285
+ }
286
+ insert(R, z, B, V, H, U) {
287
+ if (z === "") {
288
+ this._doInsertHere(R, B, V, H, U);
289
+ return;
290
+ }
291
+ let W = z.indexOf("."), G, K;
292
+ W === -1 ? (G = z, K = "") : (G = z.substring(0, W), K = z.substring(W + 1));
293
+ let q;
294
+ this._children.hasOwnProperty(G) ? q = this._children[G] : (q = new l(this._mainRule.clone(), ThemeTrieElementRule.cloneArr(this._rulesWithParentScopes)), this._children[G] = q), q.insert(R + 1, K, B, V, H, U);
295
+ }
296
+ _doInsertHere(l, R, z, B, V) {
297
+ if (R === null) {
298
+ this._mainRule.acceptOverwrite(l, z, B, V);
299
+ return;
300
+ }
301
+ for (let H = 0, U = this._rulesWithParentScopes.length; H < U; H++) {
302
+ let U = this._rulesWithParentScopes[H];
303
+ if (strArrCmp(U.parentScopes, R) === 0) {
304
+ U.acceptOverwrite(l, z, B, V);
305
+ return;
306
+ }
307
+ }
308
+ z === -1 && (z = this._mainRule.fontStyle), B === 0 && (B = this._mainRule.foreground), V === 0 && (V = this._mainRule.background), this._rulesWithParentScopes.push(new ThemeTrieElementRule(l, R, z, B, V));
309
+ }
310
+ }, EncodedTokenMetadata = class l {
311
+ static toBinaryStr(l) {
312
+ return l.toString(2).padStart(32, "0");
313
+ }
314
+ static print(R) {
315
+ let z = l.getLanguageId(R), B = l.getTokenType(R), V = l.getFontStyle(R), H = l.getForeground(R), U = l.getBackground(R);
316
+ console.log({
317
+ languageId: z,
318
+ tokenType: B,
319
+ fontStyle: V,
320
+ foreground: H,
321
+ background: U
322
+ });
323
+ }
324
+ static getLanguageId(l) {
325
+ return (l & 255) >>> 0;
326
+ }
327
+ static getTokenType(l) {
328
+ return (l & 768) >>> 8;
329
+ }
330
+ static containsBalancedBrackets(l) {
331
+ return (l & 1024) != 0;
332
+ }
333
+ static getFontStyle(l) {
334
+ return (l & 30720) >>> 11;
335
+ }
336
+ static getForeground(l) {
337
+ return (l & 16744448) >>> 15;
338
+ }
339
+ static getBackground(l) {
340
+ return (l & 4278190080) >>> 24;
341
+ }
342
+ static set(R, z, B, V, H, U, W) {
343
+ let G = l.getLanguageId(R), K = l.getTokenType(R), q = l.containsBalancedBrackets(R) ? 1 : 0, J = l.getFontStyle(R), Y = l.getForeground(R), X = l.getBackground(R);
344
+ return z !== 0 && (G = z), B !== 8 && (K = fromOptionalTokenType(B)), V !== null && (q = V ? 1 : 0), H !== -1 && (J = H), U !== 0 && (Y = U), W !== 0 && (X = W), (G << 0 | K << 8 | q << 10 | J << 11 | Y << 15 | X << 24) >>> 0;
345
+ }
346
+ };
347
+ function toOptionalTokenType(l) {
348
+ return l;
349
+ }
350
+ function fromOptionalTokenType(l) {
351
+ return l;
352
+ }
353
+ function createMatchers(l, R) {
354
+ let z = [], B = newTokenizer(l), V = B.next();
355
+ for (; V !== null;) {
356
+ let l = 0;
357
+ if (V.length === 2 && V.charAt(1) === ":") {
358
+ switch (V.charAt(0)) {
359
+ case "R":
360
+ l = 1;
361
+ break;
362
+ case "L":
363
+ l = -1;
364
+ break;
365
+ default: console.log(`Unknown priority ${V} in scope selector`);
366
+ }
367
+ V = B.next();
368
+ }
369
+ let R = U();
370
+ if (z.push({
371
+ matcher: R,
372
+ priority: l
373
+ }), V !== ",") break;
374
+ V = B.next();
375
+ }
376
+ return z;
377
+ function H() {
378
+ if (V === "-") {
379
+ V = B.next();
380
+ let l = H();
381
+ return (R) => !!l && !l(R);
382
+ }
383
+ if (V === "(") {
384
+ V = B.next();
385
+ let l = W();
386
+ return V === ")" && (V = B.next()), l;
387
+ }
388
+ if (isIdentifier(V)) {
389
+ let l = [];
390
+ do
391
+ l.push(V), V = B.next();
392
+ while (isIdentifier(V));
393
+ return (z) => R(l, z);
394
+ }
395
+ return null;
396
+ }
397
+ function U() {
398
+ let l = [], R = H();
399
+ for (; R;) l.push(R), R = H();
400
+ return (R) => l.every((l) => l(R));
401
+ }
402
+ function W() {
403
+ let l = [], R = U();
404
+ for (; R && (l.push(R), V === "|" || V === ",");) {
405
+ do
406
+ V = B.next();
407
+ while (V === "|" || V === ",");
408
+ R = U();
409
+ }
410
+ return (R) => l.some((l) => l(R));
411
+ }
412
+ }
413
+ function isIdentifier(l) {
414
+ return !!l && !!l.match(/[\w\.:]+/);
415
+ }
416
+ function newTokenizer(l) {
417
+ let R = /([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g, z = R.exec(l);
418
+ return { next: () => {
419
+ if (!z) return null;
420
+ let B = z[0];
421
+ return z = R.exec(l), B;
422
+ } };
423
+ }
424
+ function disposeOnigString(l) {
425
+ typeof l.dispose == "function" && l.dispose();
426
+ }
427
+ var TopLevelRuleReference = class {
428
+ constructor(l) {
429
+ this.scopeName = l;
430
+ }
431
+ toKey() {
432
+ return this.scopeName;
433
+ }
434
+ }, TopLevelRepositoryRuleReference = class {
435
+ constructor(l, R) {
436
+ this.scopeName = l, this.ruleName = R;
437
+ }
438
+ toKey() {
439
+ return `${this.scopeName}#${this.ruleName}`;
440
+ }
441
+ }, ExternalReferenceCollector = class {
442
+ _references = [];
443
+ _seenReferenceKeys = /* @__PURE__ */ new Set();
444
+ get references() {
445
+ return this._references;
446
+ }
447
+ visitedRule = /* @__PURE__ */ new Set();
448
+ add(l) {
449
+ let R = l.toKey();
450
+ this._seenReferenceKeys.has(R) || (this._seenReferenceKeys.add(R), this._references.push(l));
451
+ }
452
+ }, ScopeDependencyProcessor = class {
453
+ constructor(l, R) {
454
+ this.repo = l, this.initialScopeName = R, this.seenFullScopeRequests.add(this.initialScopeName), this.Q = [new TopLevelRuleReference(this.initialScopeName)];
455
+ }
456
+ seenFullScopeRequests = /* @__PURE__ */ new Set();
457
+ seenPartialScopeRequests = /* @__PURE__ */ new Set();
458
+ Q;
459
+ processQueue() {
460
+ let l = this.Q;
461
+ this.Q = [];
462
+ let R = new ExternalReferenceCollector();
463
+ for (let z of l) collectReferencesOfReference(z, this.initialScopeName, this.repo, R);
464
+ for (let l of R.references) if (l instanceof TopLevelRuleReference) {
465
+ if (this.seenFullScopeRequests.has(l.scopeName)) continue;
466
+ this.seenFullScopeRequests.add(l.scopeName), this.Q.push(l);
467
+ } else {
468
+ if (this.seenFullScopeRequests.has(l.scopeName) || this.seenPartialScopeRequests.has(l.toKey())) continue;
469
+ this.seenPartialScopeRequests.add(l.toKey()), this.Q.push(l);
470
+ }
471
+ }
472
+ };
473
+ function collectReferencesOfReference(l, R, z, B) {
474
+ let V = z.lookup(l.scopeName);
475
+ if (!V) {
476
+ if (l.scopeName === R) throw Error(`No grammar provided for <${R}>`);
477
+ return;
478
+ }
479
+ let H = z.lookup(R);
480
+ l instanceof TopLevelRuleReference ? collectExternalReferencesInTopLevelRule({
481
+ baseGrammar: H,
482
+ selfGrammar: V
483
+ }, B) : collectExternalReferencesInTopLevelRepositoryRule(l.ruleName, {
484
+ baseGrammar: H,
485
+ selfGrammar: V,
486
+ repository: V.repository
487
+ }, B);
488
+ let U = z.injections(l.scopeName);
489
+ if (U) for (let l of U) B.add(new TopLevelRuleReference(l));
490
+ }
491
+ function collectExternalReferencesInTopLevelRepositoryRule(l, R, z) {
492
+ if (R.repository && R.repository[l]) {
493
+ let B = R.repository[l];
494
+ collectExternalReferencesInRules([B], R, z);
495
+ }
496
+ }
497
+ function collectExternalReferencesInTopLevelRule(l, R) {
498
+ l.selfGrammar.patterns && Array.isArray(l.selfGrammar.patterns) && collectExternalReferencesInRules(l.selfGrammar.patterns, {
499
+ ...l,
500
+ repository: l.selfGrammar.repository
501
+ }, R), l.selfGrammar.injections && collectExternalReferencesInRules(Object.values(l.selfGrammar.injections), {
502
+ ...l,
503
+ repository: l.selfGrammar.repository
504
+ }, R);
505
+ }
506
+ function collectExternalReferencesInRules(l, R, z) {
507
+ for (let B of l) {
508
+ if (z.visitedRule.has(B)) continue;
509
+ z.visitedRule.add(B);
510
+ let l = B.repository ? mergeObjects({}, R.repository, B.repository) : R.repository;
511
+ Array.isArray(B.patterns) && collectExternalReferencesInRules(B.patterns, {
512
+ ...R,
513
+ repository: l
514
+ }, z);
515
+ let H = B.include;
516
+ if (!H) continue;
517
+ let U = parseInclude(H);
518
+ switch (U.kind) {
519
+ case 0:
520
+ collectExternalReferencesInTopLevelRule({
521
+ ...R,
522
+ selfGrammar: R.baseGrammar
523
+ }, z);
524
+ break;
525
+ case 1:
526
+ collectExternalReferencesInTopLevelRule(R, z);
527
+ break;
528
+ case 2:
529
+ collectExternalReferencesInTopLevelRepositoryRule(U.ruleName, {
530
+ ...R,
531
+ repository: l
532
+ }, z);
533
+ break;
534
+ case 3:
535
+ case 4:
536
+ let B = U.scopeName === R.selfGrammar.scopeName ? R.selfGrammar : U.scopeName === R.baseGrammar.scopeName ? R.baseGrammar : void 0;
537
+ if (B) {
538
+ let V = {
539
+ baseGrammar: R.baseGrammar,
540
+ selfGrammar: B,
541
+ repository: l
542
+ };
543
+ U.kind === 4 ? collectExternalReferencesInTopLevelRepositoryRule(U.ruleName, V, z) : collectExternalReferencesInTopLevelRule(V, z);
544
+ } else U.kind === 4 ? z.add(new TopLevelRepositoryRuleReference(U.scopeName, U.ruleName)) : z.add(new TopLevelRuleReference(U.scopeName));
545
+ break;
546
+ }
547
+ }
548
+ }
549
+ var BaseReference = class {
550
+ kind = 0;
551
+ }, SelfReference = class {
552
+ kind = 1;
553
+ }, RelativeReference = class {
554
+ constructor(l) {
555
+ this.ruleName = l;
556
+ }
557
+ kind = 2;
558
+ }, TopLevelReference = class {
559
+ constructor(l) {
560
+ this.scopeName = l;
561
+ }
562
+ kind = 3;
563
+ }, TopLevelRepositoryReference = class {
564
+ constructor(l, R) {
565
+ this.scopeName = l, this.ruleName = R;
566
+ }
567
+ kind = 4;
568
+ };
569
+ function parseInclude(l) {
570
+ if (l === "$base") return new BaseReference();
571
+ if (l === "$self") return new SelfReference();
572
+ let R = l.indexOf("#");
573
+ return R === -1 ? new TopLevelReference(l) : R === 0 ? new RelativeReference(l.substring(1)) : new TopLevelRepositoryReference(l.substring(0, R), l.substring(R + 1));
574
+ }
575
+ var HAS_BACK_REFERENCES = /\\(\d+)/, BACK_REFERENCING_END = /\\(\d+)/g, endRuleId = -1, whileRuleId = -2;
576
+ function ruleIdFromNumber(l) {
577
+ return l;
578
+ }
579
+ function ruleIdToNumber(l) {
580
+ return l;
581
+ }
582
+ var Rule = class {
583
+ $location;
584
+ id;
585
+ _nameIsCapturing;
586
+ _name;
587
+ _contentNameIsCapturing;
588
+ _contentName;
589
+ constructor(l, R, z, B) {
590
+ this.$location = l, this.id = R, this._name = z || null, this._nameIsCapturing = RegexSource.hasCaptures(this._name), this._contentName = B || null, this._contentNameIsCapturing = RegexSource.hasCaptures(this._contentName);
591
+ }
592
+ get debugName() {
593
+ let l = this.$location ? `${basename(this.$location.filename)}:${this.$location.line}` : "unknown";
594
+ return `${this.constructor.name}#${this.id} @ ${l}`;
595
+ }
596
+ getName(l, R) {
597
+ return !this._nameIsCapturing || this._name === null || l === null || R === null ? this._name : RegexSource.replaceCaptures(this._name, l, R);
598
+ }
599
+ getContentName(l, R) {
600
+ return !this._contentNameIsCapturing || this._contentName === null ? this._contentName : RegexSource.replaceCaptures(this._contentName, l, R);
601
+ }
602
+ }, CaptureRule = class extends Rule {
603
+ retokenizeCapturedWithRuleId;
604
+ constructor(l, R, z, B, V) {
605
+ super(l, R, z, B), this.retokenizeCapturedWithRuleId = V;
606
+ }
607
+ dispose() {}
608
+ collectPatterns(l, R) {
609
+ throw Error("Not supported!");
610
+ }
611
+ compile(l, R) {
612
+ throw Error("Not supported!");
613
+ }
614
+ compileAG(l, R, z, B) {
615
+ throw Error("Not supported!");
616
+ }
617
+ }, MatchRule = class extends Rule {
618
+ _match;
619
+ captures;
620
+ _cachedCompiledPatterns;
621
+ constructor(l, R, z, B, V) {
622
+ super(l, R, z, null), this._match = new RegExpSource(B, this.id), this.captures = V, this._cachedCompiledPatterns = null;
623
+ }
624
+ dispose() {
625
+ this._cachedCompiledPatterns &&= (this._cachedCompiledPatterns.dispose(), null);
626
+ }
627
+ get debugMatchRegExp() {
628
+ return `${this._match.source}`;
629
+ }
630
+ collectPatterns(l, R) {
631
+ R.push(this._match);
632
+ }
633
+ compile(l, R) {
634
+ return this._getCachedCompiledPatterns(l).compile(l);
635
+ }
636
+ compileAG(l, R, z, B) {
637
+ return this._getCachedCompiledPatterns(l).compileAG(l, z, B);
638
+ }
639
+ _getCachedCompiledPatterns(l) {
640
+ return this._cachedCompiledPatterns || (this._cachedCompiledPatterns = new RegExpSourceList(), this.collectPatterns(l, this._cachedCompiledPatterns)), this._cachedCompiledPatterns;
641
+ }
642
+ }, IncludeOnlyRule = class extends Rule {
643
+ hasMissingPatterns;
644
+ patterns;
645
+ _cachedCompiledPatterns;
646
+ constructor(l, R, z, B, V) {
647
+ super(l, R, z, B), this.patterns = V.patterns, this.hasMissingPatterns = V.hasMissingPatterns, this._cachedCompiledPatterns = null;
648
+ }
649
+ dispose() {
650
+ this._cachedCompiledPatterns &&= (this._cachedCompiledPatterns.dispose(), null);
651
+ }
652
+ collectPatterns(l, R) {
653
+ for (let z of this.patterns) l.getRule(z).collectPatterns(l, R);
654
+ }
655
+ compile(l, R) {
656
+ return this._getCachedCompiledPatterns(l).compile(l);
657
+ }
658
+ compileAG(l, R, z, B) {
659
+ return this._getCachedCompiledPatterns(l).compileAG(l, z, B);
660
+ }
661
+ _getCachedCompiledPatterns(l) {
662
+ return this._cachedCompiledPatterns || (this._cachedCompiledPatterns = new RegExpSourceList(), this.collectPatterns(l, this._cachedCompiledPatterns)), this._cachedCompiledPatterns;
663
+ }
664
+ }, BeginEndRule = class extends Rule {
665
+ _begin;
666
+ beginCaptures;
667
+ _end;
668
+ endHasBackReferences;
669
+ endCaptures;
670
+ applyEndPatternLast;
671
+ hasMissingPatterns;
672
+ patterns;
673
+ _cachedCompiledPatterns;
674
+ constructor(l, R, z, B, V, H, U, W, G, K) {
675
+ super(l, R, z, B), this._begin = new RegExpSource(V, this.id), this.beginCaptures = H, this._end = new RegExpSource(U || "￿", -1), this.endHasBackReferences = this._end.hasBackReferences, this.endCaptures = W, this.applyEndPatternLast = G || !1, this.patterns = K.patterns, this.hasMissingPatterns = K.hasMissingPatterns, this._cachedCompiledPatterns = null;
676
+ }
677
+ dispose() {
678
+ this._cachedCompiledPatterns &&= (this._cachedCompiledPatterns.dispose(), null);
679
+ }
680
+ get debugBeginRegExp() {
681
+ return `${this._begin.source}`;
682
+ }
683
+ get debugEndRegExp() {
684
+ return `${this._end.source}`;
685
+ }
686
+ getEndWithResolvedBackReferences(l, R) {
687
+ return this._end.resolveBackReferences(l, R);
688
+ }
689
+ collectPatterns(l, R) {
690
+ R.push(this._begin);
691
+ }
692
+ compile(l, R) {
693
+ return this._getCachedCompiledPatterns(l, R).compile(l);
694
+ }
695
+ compileAG(l, R, z, B) {
696
+ return this._getCachedCompiledPatterns(l, R).compileAG(l, z, B);
697
+ }
698
+ _getCachedCompiledPatterns(l, R) {
699
+ if (!this._cachedCompiledPatterns) {
700
+ this._cachedCompiledPatterns = new RegExpSourceList();
701
+ for (let R of this.patterns) l.getRule(R).collectPatterns(l, this._cachedCompiledPatterns);
702
+ this.applyEndPatternLast ? this._cachedCompiledPatterns.push(this._end.hasBackReferences ? this._end.clone() : this._end) : this._cachedCompiledPatterns.unshift(this._end.hasBackReferences ? this._end.clone() : this._end);
703
+ }
704
+ return this._end.hasBackReferences && (this.applyEndPatternLast ? this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length() - 1, R) : this._cachedCompiledPatterns.setSource(0, R)), this._cachedCompiledPatterns;
705
+ }
706
+ }, BeginWhileRule = class extends Rule {
707
+ _begin;
708
+ beginCaptures;
709
+ whileCaptures;
710
+ _while;
711
+ whileHasBackReferences;
712
+ hasMissingPatterns;
713
+ patterns;
714
+ _cachedCompiledPatterns;
715
+ _cachedCompiledWhilePatterns;
716
+ constructor(l, R, z, B, V, H, U, W, G) {
717
+ super(l, R, z, B), this._begin = new RegExpSource(V, this.id), this.beginCaptures = H, this.whileCaptures = W, this._while = new RegExpSource(U, whileRuleId), this.whileHasBackReferences = this._while.hasBackReferences, this.patterns = G.patterns, this.hasMissingPatterns = G.hasMissingPatterns, this._cachedCompiledPatterns = null, this._cachedCompiledWhilePatterns = null;
718
+ }
719
+ dispose() {
720
+ this._cachedCompiledPatterns &&= (this._cachedCompiledPatterns.dispose(), null), this._cachedCompiledWhilePatterns &&= (this._cachedCompiledWhilePatterns.dispose(), null);
721
+ }
722
+ get debugBeginRegExp() {
723
+ return `${this._begin.source}`;
724
+ }
725
+ get debugWhileRegExp() {
726
+ return `${this._while.source}`;
727
+ }
728
+ getWhileWithResolvedBackReferences(l, R) {
729
+ return this._while.resolveBackReferences(l, R);
730
+ }
731
+ collectPatterns(l, R) {
732
+ R.push(this._begin);
733
+ }
734
+ compile(l, R) {
735
+ return this._getCachedCompiledPatterns(l).compile(l);
736
+ }
737
+ compileAG(l, R, z, B) {
738
+ return this._getCachedCompiledPatterns(l).compileAG(l, z, B);
739
+ }
740
+ _getCachedCompiledPatterns(l) {
741
+ if (!this._cachedCompiledPatterns) {
742
+ this._cachedCompiledPatterns = new RegExpSourceList();
743
+ for (let R of this.patterns) l.getRule(R).collectPatterns(l, this._cachedCompiledPatterns);
744
+ }
745
+ return this._cachedCompiledPatterns;
746
+ }
747
+ compileWhile(l, R) {
748
+ return this._getCachedCompiledWhilePatterns(l, R).compile(l);
749
+ }
750
+ compileWhileAG(l, R, z, B) {
751
+ return this._getCachedCompiledWhilePatterns(l, R).compileAG(l, z, B);
752
+ }
753
+ _getCachedCompiledWhilePatterns(l, R) {
754
+ return this._cachedCompiledWhilePatterns || (this._cachedCompiledWhilePatterns = new RegExpSourceList(), this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences ? this._while.clone() : this._while)), this._while.hasBackReferences && this._cachedCompiledWhilePatterns.setSource(0, R || "￿"), this._cachedCompiledWhilePatterns;
755
+ }
756
+ }, RuleFactory = class l {
757
+ static createCaptureRule(l, R, z, B, V) {
758
+ return l.registerRule((l) => new CaptureRule(R, l, z, B, V));
759
+ }
760
+ static getCompiledRuleId(R, z, B) {
761
+ return R.id || z.registerRule((H) => {
762
+ if (R.id = H, R.match) return new MatchRule(R.$vscodeTextmateLocation, R.id, R.name, R.match, l._compileCaptures(R.captures, z, B));
763
+ if (R.begin === void 0) {
764
+ R.repository && (B = mergeObjects({}, B, R.repository));
765
+ let H = R.patterns;
766
+ return H === void 0 && R.include && (H = [{ include: R.include }]), new IncludeOnlyRule(R.$vscodeTextmateLocation, R.id, R.name, R.contentName, l._compilePatterns(H, z, B));
767
+ }
768
+ return R.while ? new BeginWhileRule(R.$vscodeTextmateLocation, R.id, R.name, R.contentName, R.begin, l._compileCaptures(R.beginCaptures || R.captures, z, B), R.while, l._compileCaptures(R.whileCaptures || R.captures, z, B), l._compilePatterns(R.patterns, z, B)) : new BeginEndRule(R.$vscodeTextmateLocation, R.id, R.name, R.contentName, R.begin, l._compileCaptures(R.beginCaptures || R.captures, z, B), R.end, l._compileCaptures(R.endCaptures || R.captures, z, B), R.applyEndPatternLast, l._compilePatterns(R.patterns, z, B));
769
+ }), R.id;
770
+ }
771
+ static _compileCaptures(R, z, B) {
772
+ let V = [];
773
+ if (R) {
774
+ let H = 0;
775
+ for (let l in R) {
776
+ if (l === "$vscodeTextmateLocation") continue;
777
+ let R = parseInt(l, 10);
778
+ R > H && (H = R);
779
+ }
780
+ for (let l = 0; l <= H; l++) V[l] = null;
781
+ for (let H in R) {
782
+ if (H === "$vscodeTextmateLocation") continue;
783
+ let U = parseInt(H, 10), W = 0;
784
+ R[H].patterns && (W = l.getCompiledRuleId(R[H], z, B)), V[U] = l.createCaptureRule(z, R[H].$vscodeTextmateLocation, R[H].name, R[H].contentName, W);
785
+ }
786
+ }
787
+ return V;
788
+ }
789
+ static _compilePatterns(R, z, B) {
790
+ let V = [];
791
+ if (R) for (let H = 0, U = R.length; H < U; H++) {
792
+ let U = R[H], W = -1;
793
+ if (U.include) {
794
+ let R = parseInclude(U.include);
795
+ switch (R.kind) {
796
+ case 0:
797
+ case 1:
798
+ W = l.getCompiledRuleId(B[U.include], z, B);
799
+ break;
800
+ case 2:
801
+ let V = B[R.ruleName];
802
+ V && (W = l.getCompiledRuleId(V, z, B));
803
+ break;
804
+ case 3:
805
+ case 4:
806
+ let H = R.scopeName, G = R.kind === 4 ? R.ruleName : null, K = z.getExternalGrammar(H, B);
807
+ if (K) if (G) {
808
+ let R = K.repository[G];
809
+ R && (W = l.getCompiledRuleId(R, z, K.repository));
810
+ } else W = l.getCompiledRuleId(K.repository.$self, z, K.repository);
811
+ break;
812
+ }
813
+ } else W = l.getCompiledRuleId(U, z, B);
814
+ if (W !== -1) {
815
+ let l = z.getRule(W), R = !1;
816
+ if ((l instanceof IncludeOnlyRule || l instanceof BeginEndRule || l instanceof BeginWhileRule) && l.hasMissingPatterns && l.patterns.length === 0 && (R = !0), R) continue;
817
+ V.push(W);
818
+ }
819
+ }
820
+ return {
821
+ patterns: V,
822
+ hasMissingPatterns: (R ? R.length : 0) !== V.length
823
+ };
824
+ }
825
+ }, RegExpSource = class l {
826
+ source;
827
+ ruleId;
828
+ hasAnchor;
829
+ hasBackReferences;
830
+ _anchorCache;
831
+ constructor(l, R) {
832
+ if (l && typeof l == "string") {
833
+ let R = l.length, z = 0, B = [], V = !1;
834
+ for (let H = 0; H < R; H++) if (l.charAt(H) === "\\" && H + 1 < R) {
835
+ let R = l.charAt(H + 1);
836
+ R === "z" ? (B.push(l.substring(z, H)), B.push("$(?!\\n)(?<!\\n)"), z = H + 2) : (R === "A" || R === "G") && (V = !0), H++;
837
+ }
838
+ this.hasAnchor = V, z === 0 ? this.source = l : (B.push(l.substring(z, R)), this.source = B.join(""));
839
+ } else this.hasAnchor = !1, this.source = l;
840
+ this.hasAnchor ? this._anchorCache = this._buildAnchorCache() : this._anchorCache = null, this.ruleId = R, typeof this.source == "string" ? this.hasBackReferences = HAS_BACK_REFERENCES.test(this.source) : this.hasBackReferences = !1;
841
+ }
842
+ clone() {
843
+ return new l(this.source, this.ruleId);
844
+ }
845
+ setSource(l) {
846
+ this.source !== l && (this.source = l, this.hasAnchor && (this._anchorCache = this._buildAnchorCache()));
847
+ }
848
+ resolveBackReferences(l, R) {
849
+ if (typeof this.source != "string") throw Error("This method should only be called if the source is a string");
850
+ let z = R.map((R) => l.substring(R.start, R.end));
851
+ return BACK_REFERENCING_END.lastIndex = 0, this.source.replace(BACK_REFERENCING_END, (l, R) => escapeRegExpCharacters(z[parseInt(R, 10)] || ""));
852
+ }
853
+ _buildAnchorCache() {
854
+ if (typeof this.source != "string") throw Error("This method should only be called if the source is a string");
855
+ let l = [], R = [], z = [], B = [], V, H, U, W;
856
+ for (V = 0, H = this.source.length; V < H; V++) U = this.source.charAt(V), l[V] = U, R[V] = U, z[V] = U, B[V] = U, U === "\\" && V + 1 < H && (W = this.source.charAt(V + 1), W === "A" ? (l[V + 1] = "￿", R[V + 1] = "￿", z[V + 1] = "A", B[V + 1] = "A") : W === "G" ? (l[V + 1] = "￿", R[V + 1] = "G", z[V + 1] = "￿", B[V + 1] = "G") : (l[V + 1] = W, R[V + 1] = W, z[V + 1] = W, B[V + 1] = W), V++);
857
+ return {
858
+ A0_G0: l.join(""),
859
+ A0_G1: R.join(""),
860
+ A1_G0: z.join(""),
861
+ A1_G1: B.join("")
862
+ };
863
+ }
864
+ resolveAnchors(l, R) {
865
+ return !this.hasAnchor || !this._anchorCache || typeof this.source != "string" ? this.source : l ? R ? this._anchorCache.A1_G1 : this._anchorCache.A1_G0 : R ? this._anchorCache.A0_G1 : this._anchorCache.A0_G0;
866
+ }
867
+ }, RegExpSourceList = class {
868
+ _items;
869
+ _hasAnchors;
870
+ _cached;
871
+ _anchorCache;
872
+ constructor() {
873
+ this._items = [], this._hasAnchors = !1, this._cached = null, this._anchorCache = {
874
+ A0_G0: null,
875
+ A0_G1: null,
876
+ A1_G0: null,
877
+ A1_G1: null
878
+ };
879
+ }
880
+ dispose() {
881
+ this._disposeCaches();
882
+ }
883
+ _disposeCaches() {
884
+ this._cached &&= (this._cached.dispose(), null), this._anchorCache.A0_G0 && (this._anchorCache.A0_G0.dispose(), this._anchorCache.A0_G0 = null), this._anchorCache.A0_G1 && (this._anchorCache.A0_G1.dispose(), this._anchorCache.A0_G1 = null), this._anchorCache.A1_G0 && (this._anchorCache.A1_G0.dispose(), this._anchorCache.A1_G0 = null), this._anchorCache.A1_G1 && (this._anchorCache.A1_G1.dispose(), this._anchorCache.A1_G1 = null);
885
+ }
886
+ push(l) {
887
+ this._items.push(l), this._hasAnchors = this._hasAnchors || l.hasAnchor;
888
+ }
889
+ unshift(l) {
890
+ this._items.unshift(l), this._hasAnchors = this._hasAnchors || l.hasAnchor;
891
+ }
892
+ length() {
893
+ return this._items.length;
894
+ }
895
+ setSource(l, R) {
896
+ this._items[l].source !== R && (this._disposeCaches(), this._items[l].setSource(R));
897
+ }
898
+ compile(l) {
899
+ return this._cached ||= new CompiledRule(l, this._items.map((l) => l.source), this._items.map((l) => l.ruleId)), this._cached;
900
+ }
901
+ compileAG(l, R, z) {
902
+ return this._hasAnchors ? R ? z ? (this._anchorCache.A1_G1 || (this._anchorCache.A1_G1 = this._resolveAnchors(l, R, z)), this._anchorCache.A1_G1) : (this._anchorCache.A1_G0 || (this._anchorCache.A1_G0 = this._resolveAnchors(l, R, z)), this._anchorCache.A1_G0) : z ? (this._anchorCache.A0_G1 || (this._anchorCache.A0_G1 = this._resolveAnchors(l, R, z)), this._anchorCache.A0_G1) : (this._anchorCache.A0_G0 || (this._anchorCache.A0_G0 = this._resolveAnchors(l, R, z)), this._anchorCache.A0_G0) : this.compile(l);
903
+ }
904
+ _resolveAnchors(l, R, z) {
905
+ return new CompiledRule(l, this._items.map((l) => l.resolveAnchors(R, z)), this._items.map((l) => l.ruleId));
906
+ }
907
+ }, CompiledRule = class {
908
+ constructor(l, R, z) {
909
+ this.regExps = R, this.rules = z, this.scanner = l.createOnigScanner(R);
910
+ }
911
+ scanner;
912
+ dispose() {
913
+ typeof this.scanner.dispose == "function" && this.scanner.dispose();
914
+ }
915
+ toString() {
916
+ let l = [];
917
+ for (let R = 0, z = this.rules.length; R < z; R++) l.push(" - " + this.rules[R] + ": " + this.regExps[R]);
918
+ return l.join("\n");
919
+ }
920
+ findNextMatchSync(l, R, z) {
921
+ let B = this.scanner.findNextMatchSync(l, R, z);
922
+ return B ? {
923
+ ruleId: this.rules[B.index],
924
+ captureIndices: B.captureIndices
925
+ } : null;
926
+ }
927
+ }, BasicScopeAttributes = class {
928
+ constructor(l, R) {
929
+ this.languageId = l, this.tokenType = R;
930
+ }
931
+ }, BasicScopeAttributesProvider = class l {
932
+ _defaultAttributes;
933
+ _embeddedLanguagesMatcher;
934
+ constructor(l, R) {
935
+ this._defaultAttributes = new BasicScopeAttributes(l, 8), this._embeddedLanguagesMatcher = new ScopeMatcher(Object.entries(R || {}));
936
+ }
937
+ getDefaultAttributes() {
938
+ return this._defaultAttributes;
939
+ }
940
+ getBasicScopeAttributes(R) {
941
+ return R === null ? l._NULL_SCOPE_METADATA : this._getBasicScopeAttributes.get(R);
942
+ }
943
+ static _NULL_SCOPE_METADATA = new BasicScopeAttributes(0, 0);
944
+ _getBasicScopeAttributes = new CachedFn((l) => new BasicScopeAttributes(this._scopeToLanguage(l), this._toStandardTokenType(l)));
945
+ _scopeToLanguage(l) {
946
+ return this._embeddedLanguagesMatcher.match(l) || 0;
947
+ }
948
+ _toStandardTokenType(R) {
949
+ let z = R.match(l.STANDARD_TOKEN_TYPE_REGEXP);
950
+ if (!z) return 8;
951
+ switch (z[1]) {
952
+ case "comment": return 1;
953
+ case "string": return 2;
954
+ case "regex": return 3;
955
+ case "meta.embedded": return 0;
956
+ }
957
+ throw Error("Unexpected match for standard token type!");
958
+ }
959
+ static STANDARD_TOKEN_TYPE_REGEXP = /\b(comment|string|regex|meta\.embedded)\b/;
960
+ }, ScopeMatcher = class {
961
+ values;
962
+ scopesRegExp;
963
+ constructor(l) {
964
+ if (l.length === 0) this.values = null, this.scopesRegExp = null;
965
+ else {
966
+ this.values = new Map(l);
967
+ let R = l.map(([l, R]) => escapeRegExpCharacters(l));
968
+ R.sort(), R.reverse(), this.scopesRegExp = RegExp(`^((${R.join(")|(")}))($|\\.)`, "");
969
+ }
970
+ }
971
+ match(l) {
972
+ if (!this.scopesRegExp) return;
973
+ let R = l.match(this.scopesRegExp);
974
+ if (R) return this.values.get(R[1]);
975
+ }
976
+ };
977
+ typeof process < "u" && process.env.VSCODE_TEXTMATE_DEBUG;
978
+ var UseOnigurumaFindOptions = !1, TokenizeStringResult = class {
979
+ constructor(l, R) {
980
+ this.stack = l, this.stoppedEarly = R;
981
+ }
982
+ };
983
+ function _tokenizeString(l, R, z, B, V, H, U, W) {
984
+ let G = R.content.length, K = !1, q = -1;
985
+ if (U) {
986
+ let U = _checkWhileConditions(l, R, z, B, V, H);
987
+ V = U.stack, B = U.linePos, z = U.isFirstLine, q = U.anchorPosition;
988
+ }
989
+ let J = Date.now();
990
+ for (; !K;) {
991
+ if (W !== 0 && Date.now() - J > W) return new TokenizeStringResult(V, !0);
992
+ Y();
993
+ }
994
+ return new TokenizeStringResult(V, !1);
995
+ function Y() {
996
+ let U = matchRuleOrInjections(l, R, z, B, V, q);
997
+ if (!U) {
998
+ H.produce(V, G), K = !0;
999
+ return;
1000
+ }
1001
+ let W = U.captureIndices, J = U.matchedRuleId, Y = W && W.length > 0 ? W[0].end > B : !1;
1002
+ if (J === endRuleId) {
1003
+ let U = V.getRule(l);
1004
+ H.produce(V, W[0].start), V = V.withContentNameScopesList(V.nameScopesList), handleCaptures(l, R, z, V, H, U.endCaptures, W), H.produce(V, W[0].end);
1005
+ let J = V;
1006
+ if (V = V.parent, q = J.getAnchorPos(), !Y && J.getEnterPos() === B) {
1007
+ V = J, H.produce(V, G), K = !0;
1008
+ return;
1009
+ }
1010
+ } else {
1011
+ let U = l.getRule(J);
1012
+ H.produce(V, W[0].start);
1013
+ let X = V, Z = U.getName(R.content, W), Q = V.contentNameScopesList.pushAttributed(Z, l);
1014
+ if (V = V.push(J, B, q, W[0].end === G, null, Q, Q), U instanceof BeginEndRule) {
1015
+ let B = U;
1016
+ handleCaptures(l, R, z, V, H, B.beginCaptures, W), H.produce(V, W[0].end), q = W[0].end;
1017
+ let J = B.getContentName(R.content, W), Z = Q.pushAttributed(J, l);
1018
+ if (V = V.withContentNameScopesList(Z), B.endHasBackReferences && (V = V.withEndRule(B.getEndWithResolvedBackReferences(R.content, W))), !Y && X.hasSameRuleAs(V)) {
1019
+ V = V.pop(), H.produce(V, G), K = !0;
1020
+ return;
1021
+ }
1022
+ } else if (U instanceof BeginWhileRule) {
1023
+ let B = U;
1024
+ handleCaptures(l, R, z, V, H, B.beginCaptures, W), H.produce(V, W[0].end), q = W[0].end;
1025
+ let J = B.getContentName(R.content, W), Z = Q.pushAttributed(J, l);
1026
+ if (V = V.withContentNameScopesList(Z), B.whileHasBackReferences && (V = V.withEndRule(B.getWhileWithResolvedBackReferences(R.content, W))), !Y && X.hasSameRuleAs(V)) {
1027
+ V = V.pop(), H.produce(V, G), K = !0;
1028
+ return;
1029
+ }
1030
+ } else if (handleCaptures(l, R, z, V, H, U.captures, W), H.produce(V, W[0].end), V = V.pop(), !Y) {
1031
+ V = V.safePop(), H.produce(V, G), K = !0;
1032
+ return;
1033
+ }
1034
+ }
1035
+ W[0].end > B && (B = W[0].end, z = !1);
1036
+ }
1037
+ }
1038
+ function _checkWhileConditions(l, R, z, B, V, H) {
1039
+ let U = V.beginRuleCapturedEOL ? 0 : -1, W = [];
1040
+ for (let R = V; R; R = R.pop()) {
1041
+ let z = R.getRule(l);
1042
+ z instanceof BeginWhileRule && W.push({
1043
+ rule: z,
1044
+ stack: R
1045
+ });
1046
+ }
1047
+ for (let G = W.pop(); G; G = W.pop()) {
1048
+ let { ruleScanner: W, findOptions: K } = prepareRuleWhileSearch(G.rule, l, G.stack.endRule, z, B === U), q = W.findNextMatchSync(R, B, K);
1049
+ if (q) {
1050
+ if (q.ruleId !== whileRuleId) {
1051
+ V = G.stack.pop();
1052
+ break;
1053
+ }
1054
+ q.captureIndices && q.captureIndices.length && (H.produce(G.stack, q.captureIndices[0].start), handleCaptures(l, R, z, G.stack, H, G.rule.whileCaptures, q.captureIndices), H.produce(G.stack, q.captureIndices[0].end), U = q.captureIndices[0].end, q.captureIndices[0].end > B && (B = q.captureIndices[0].end, z = !1));
1055
+ } else {
1056
+ V = G.stack.pop();
1057
+ break;
1058
+ }
1059
+ }
1060
+ return {
1061
+ stack: V,
1062
+ linePos: B,
1063
+ anchorPosition: U,
1064
+ isFirstLine: z
1065
+ };
1066
+ }
1067
+ function matchRuleOrInjections(l, R, z, B, V, H) {
1068
+ let U = matchRule(l, R, z, B, V, H), W = l.getInjections();
1069
+ if (W.length === 0) return U;
1070
+ let G = matchInjections(W, l, R, z, B, V, H);
1071
+ if (!G) return U;
1072
+ if (!U) return G;
1073
+ let K = U.captureIndices[0].start, q = G.captureIndices[0].start;
1074
+ return q < K || G.priorityMatch && q === K ? G : U;
1075
+ }
1076
+ function matchRule(l, R, z, B, V, H) {
1077
+ let { ruleScanner: U, findOptions: W } = prepareRuleSearch(V.getRule(l), l, V.endRule, z, B === H), G = U.findNextMatchSync(R, B, W);
1078
+ return G ? {
1079
+ captureIndices: G.captureIndices,
1080
+ matchedRuleId: G.ruleId
1081
+ } : null;
1082
+ }
1083
+ function matchInjections(l, R, z, B, V, H, U) {
1084
+ let W = Number.MAX_VALUE, G = null, K, q = 0, J = H.contentNameScopesList.getScopeNames();
1085
+ for (let H = 0, Y = l.length; H < Y; H++) {
1086
+ let Y = l[H];
1087
+ if (!Y.matcher(J)) continue;
1088
+ let { ruleScanner: X, findOptions: Z } = prepareRuleSearch(R.getRule(Y.ruleId), R, null, B, V === U), Q = X.findNextMatchSync(z, V, Z);
1089
+ if (!Q) continue;
1090
+ let $ = Q.captureIndices[0].start;
1091
+ if (!($ >= W) && (W = $, G = Q.captureIndices, K = Q.ruleId, q = Y.priority, W === V)) break;
1092
+ }
1093
+ return G ? {
1094
+ priorityMatch: q === -1,
1095
+ captureIndices: G,
1096
+ matchedRuleId: K
1097
+ } : null;
1098
+ }
1099
+ function prepareRuleSearch(l, R, z, B, V) {
1100
+ return UseOnigurumaFindOptions ? {
1101
+ ruleScanner: l.compile(R, z),
1102
+ findOptions: getFindOptions(B, V)
1103
+ } : {
1104
+ ruleScanner: l.compileAG(R, z, B, V),
1105
+ findOptions: 0
1106
+ };
1107
+ }
1108
+ function prepareRuleWhileSearch(l, R, z, B, V) {
1109
+ return UseOnigurumaFindOptions ? {
1110
+ ruleScanner: l.compileWhile(R, z),
1111
+ findOptions: getFindOptions(B, V)
1112
+ } : {
1113
+ ruleScanner: l.compileWhileAG(R, z, B, V),
1114
+ findOptions: 0
1115
+ };
1116
+ }
1117
+ function getFindOptions(l, R) {
1118
+ let z = 0;
1119
+ return l || (z |= 1), R || (z |= 4), z;
1120
+ }
1121
+ function handleCaptures(l, R, z, B, V, H, U) {
1122
+ if (H.length === 0) return;
1123
+ let W = R.content, G = Math.min(H.length, U.length), K = [], q = U[0].end;
1124
+ for (let R = 0; R < G; R++) {
1125
+ let G = H[R];
1126
+ if (G === null) continue;
1127
+ let J = U[R];
1128
+ if (J.length === 0) continue;
1129
+ if (J.start > q) break;
1130
+ for (; K.length > 0 && K[K.length - 1].endPos <= J.start;) V.produceFromScopes(K[K.length - 1].scopes, K[K.length - 1].endPos), K.pop();
1131
+ if (K.length > 0 ? V.produceFromScopes(K[K.length - 1].scopes, J.start) : V.produce(B, J.start), G.retokenizeCapturedWithRuleId) {
1132
+ let R = G.getName(W, U), H = B.contentNameScopesList.pushAttributed(R, l), K = G.getContentName(W, U), q = H.pushAttributed(K, l), Y = B.push(G.retokenizeCapturedWithRuleId, J.start, -1, !1, null, H, q), X = l.createOnigString(W.substring(0, J.end));
1133
+ _tokenizeString(l, X, z && J.start === 0, J.start, Y, V, !1, 0), disposeOnigString(X);
1134
+ continue;
1135
+ }
1136
+ let Y = G.getName(W, U);
1137
+ if (Y !== null) {
1138
+ let R = (K.length > 0 ? K[K.length - 1].scopes : B.contentNameScopesList).pushAttributed(Y, l);
1139
+ K.push(new LocalStackElement(R, J.end));
1140
+ }
1141
+ }
1142
+ for (; K.length > 0;) V.produceFromScopes(K[K.length - 1].scopes, K[K.length - 1].endPos), K.pop();
1143
+ }
1144
+ var LocalStackElement = class {
1145
+ scopes;
1146
+ endPos;
1147
+ constructor(l, R) {
1148
+ this.scopes = l, this.endPos = R;
1149
+ }
1150
+ };
1151
+ function createGrammar(l, R, z, B, V, H, U, W) {
1152
+ return new Grammar(l, R, z, B, V, H, U, W);
1153
+ }
1154
+ function collectInjections(l, R, z, B, V) {
1155
+ let H = createMatchers(R, nameMatcher), U = RuleFactory.getCompiledRuleId(z, B, V.repository);
1156
+ for (let z of H) l.push({
1157
+ debugSelector: R,
1158
+ matcher: z.matcher,
1159
+ ruleId: U,
1160
+ grammar: V,
1161
+ priority: z.priority
1162
+ });
1163
+ }
1164
+ function nameMatcher(l, R) {
1165
+ if (R.length < l.length) return !1;
1166
+ let z = 0;
1167
+ return l.every((l) => {
1168
+ for (let B = z; B < R.length; B++) if (scopesAreMatching(R[B], l)) return z = B + 1, !0;
1169
+ return !1;
1170
+ });
1171
+ }
1172
+ function scopesAreMatching(l, R) {
1173
+ if (!l) return !1;
1174
+ if (l === R) return !0;
1175
+ let z = R.length;
1176
+ return l.length > z && l.substr(0, z) === R && l[z] === ".";
1177
+ }
1178
+ var Grammar = class {
1179
+ constructor(l, R, z, B, V, H, U, W) {
1180
+ if (this._rootScopeName = l, this.balancedBracketSelectors = H, this._onigLib = W, this._basicScopeAttributesProvider = new BasicScopeAttributesProvider(z, B), this._rootId = -1, this._lastRuleId = 0, this._ruleId2desc = [null], this._includedGrammars = {}, this._grammarRepository = U, this._grammar = initGrammar(R, null), this._injections = null, this._tokenTypeMatchers = [], V) for (let l of Object.keys(V)) {
1181
+ let R = createMatchers(l, nameMatcher);
1182
+ for (let z of R) this._tokenTypeMatchers.push({
1183
+ matcher: z.matcher,
1184
+ type: V[l]
1185
+ });
1186
+ }
1187
+ }
1188
+ _rootId;
1189
+ _lastRuleId;
1190
+ _ruleId2desc;
1191
+ _includedGrammars;
1192
+ _grammarRepository;
1193
+ _grammar;
1194
+ _injections;
1195
+ _basicScopeAttributesProvider;
1196
+ _tokenTypeMatchers;
1197
+ get themeProvider() {
1198
+ return this._grammarRepository;
1199
+ }
1200
+ dispose() {
1201
+ for (let l of this._ruleId2desc) l && l.dispose();
1202
+ }
1203
+ createOnigScanner(l) {
1204
+ return this._onigLib.createOnigScanner(l);
1205
+ }
1206
+ createOnigString(l) {
1207
+ return this._onigLib.createOnigString(l);
1208
+ }
1209
+ getMetadataForScope(l) {
1210
+ return this._basicScopeAttributesProvider.getBasicScopeAttributes(l);
1211
+ }
1212
+ _collectInjections() {
1213
+ let l = {
1214
+ lookup: (l) => l === this._rootScopeName ? this._grammar : this.getExternalGrammar(l),
1215
+ injections: (l) => this._grammarRepository.injections(l)
1216
+ }, R = [], z = this._rootScopeName, B = l.lookup(z);
1217
+ if (B) {
1218
+ let l = B.injections;
1219
+ if (l) for (let z in l) collectInjections(R, z, l[z], this, B);
1220
+ let V = this._grammarRepository.injections(z);
1221
+ V && V.forEach((l) => {
1222
+ let z = this.getExternalGrammar(l);
1223
+ if (z) {
1224
+ let l = z.injectionSelector;
1225
+ l && collectInjections(R, l, z, this, z);
1226
+ }
1227
+ });
1228
+ }
1229
+ return R.sort((l, R) => l.priority - R.priority), R;
1230
+ }
1231
+ getInjections() {
1232
+ return this._injections === null && (this._injections = this._collectInjections()), this._injections;
1233
+ }
1234
+ registerRule(l) {
1235
+ let R = ++this._lastRuleId, z = l(ruleIdFromNumber(R));
1236
+ return this._ruleId2desc[R] = z, z;
1237
+ }
1238
+ getRule(l) {
1239
+ return this._ruleId2desc[ruleIdToNumber(l)];
1240
+ }
1241
+ getExternalGrammar(l, R) {
1242
+ if (this._includedGrammars[l]) return this._includedGrammars[l];
1243
+ if (this._grammarRepository) {
1244
+ let z = this._grammarRepository.lookup(l);
1245
+ if (z) return this._includedGrammars[l] = initGrammar(z, R && R.$base), this._includedGrammars[l];
1246
+ }
1247
+ }
1248
+ tokenizeLine(l, R, z = 0) {
1249
+ let B = this._tokenize(l, R, !1, z);
1250
+ return {
1251
+ tokens: B.lineTokens.getResult(B.ruleStack, B.lineLength),
1252
+ ruleStack: B.ruleStack,
1253
+ stoppedEarly: B.stoppedEarly
1254
+ };
1255
+ }
1256
+ tokenizeLine2(l, R, z = 0) {
1257
+ let B = this._tokenize(l, R, !0, z);
1258
+ return {
1259
+ tokens: B.lineTokens.getBinaryResult(B.ruleStack, B.lineLength),
1260
+ ruleStack: B.ruleStack,
1261
+ stoppedEarly: B.stoppedEarly
1262
+ };
1263
+ }
1264
+ _tokenize(l, R, z, B) {
1265
+ this._rootId === -1 && (this._rootId = RuleFactory.getCompiledRuleId(this._grammar.repository.$self, this, this._grammar.repository), this.getInjections());
1266
+ let V;
1267
+ if (!R || R === StateStackImpl.NULL) {
1268
+ V = !0;
1269
+ let l = this._basicScopeAttributesProvider.getDefaultAttributes(), z = this.themeProvider.getDefaults(), B = EncodedTokenMetadata.set(0, l.languageId, l.tokenType, null, z.fontStyle, z.foregroundId, z.backgroundId), H = this.getRule(this._rootId).getName(null, null), U;
1270
+ U = H ? AttributedScopeStack.createRootAndLookUpScopeName(H, B, this) : AttributedScopeStack.createRoot("unknown", B), R = new StateStackImpl(null, this._rootId, -1, -1, !1, null, U, U);
1271
+ } else V = !1, R.reset();
1272
+ l += "\n";
1273
+ let H = this.createOnigString(l), U = H.content.length, W = new LineTokens(z, l, this._tokenTypeMatchers, this.balancedBracketSelectors), G = _tokenizeString(this, H, V, 0, R, W, !0, B);
1274
+ return disposeOnigString(H), {
1275
+ lineLength: U,
1276
+ lineTokens: W,
1277
+ ruleStack: G.stack,
1278
+ stoppedEarly: G.stoppedEarly
1279
+ };
1280
+ }
1281
+ };
1282
+ function initGrammar(R, z) {
1283
+ return R = clone(R), R.repository = R.repository || {}, R.repository.$self = {
1284
+ $vscodeTextmateLocation: R.$vscodeTextmateLocation,
1285
+ patterns: R.patterns,
1286
+ name: R.scopeName
1287
+ }, R.repository.$base = z || R.repository.$self, R;
1288
+ }
1289
+ var AttributedScopeStack = class l {
1290
+ constructor(l, R, z) {
1291
+ this.parent = l, this.scopePath = R, this.tokenAttributes = z;
1292
+ }
1293
+ static fromExtension(R, z) {
1294
+ let B = R, V = R?.scopePath ?? null;
1295
+ for (let R of z) V = ScopeStack.push(V, R.scopeNames), B = new l(B, V, R.encodedTokenAttributes);
1296
+ return B;
1297
+ }
1298
+ static createRoot(R, z) {
1299
+ return new l(null, new ScopeStack(null, R), z);
1300
+ }
1301
+ static createRootAndLookUpScopeName(R, z, B) {
1302
+ let V = B.getMetadataForScope(R), H = new ScopeStack(null, R), U = B.themeProvider.themeMatch(H);
1303
+ return new l(null, H, l.mergeAttributes(z, V, U));
1304
+ }
1305
+ get scopeName() {
1306
+ return this.scopePath.scopeName;
1307
+ }
1308
+ toString() {
1309
+ return this.getScopeNames().join(" ");
1310
+ }
1311
+ equals(R) {
1312
+ return l.equals(this, R);
1313
+ }
1314
+ static equals(l, R) {
1315
+ do {
1316
+ if (l === R || !l && !R) return !0;
1317
+ if (!l || !R || l.scopeName !== R.scopeName || l.tokenAttributes !== R.tokenAttributes) return !1;
1318
+ l = l.parent, R = R.parent;
1319
+ } while (!0);
1320
+ }
1321
+ static mergeAttributes(l, R, z) {
1322
+ let B = -1, V = 0, H = 0;
1323
+ return z !== null && (B = z.fontStyle, V = z.foregroundId, H = z.backgroundId), EncodedTokenMetadata.set(l, R.languageId, R.tokenType, null, B, V, H);
1324
+ }
1325
+ pushAttributed(R, z) {
1326
+ if (R === null) return this;
1327
+ if (R.indexOf(" ") === -1) return l._pushAttributed(this, R, z);
1328
+ let B = R.split(/ /g), V = this;
1329
+ for (let R of B) V = l._pushAttributed(V, R, z);
1330
+ return V;
1331
+ }
1332
+ static _pushAttributed(R, z, B) {
1333
+ let V = B.getMetadataForScope(z), H = R.scopePath.push(z), U = B.themeProvider.themeMatch(H);
1334
+ return new l(R, H, l.mergeAttributes(R.tokenAttributes, V, U));
1335
+ }
1336
+ getScopeNames() {
1337
+ return this.scopePath.getSegments();
1338
+ }
1339
+ getExtensionIfDefined(l) {
1340
+ let R = [], z = this;
1341
+ for (; z && z !== l;) R.push({
1342
+ encodedTokenAttributes: z.tokenAttributes,
1343
+ scopeNames: z.scopePath.getExtensionIfDefined(z.parent?.scopePath ?? null)
1344
+ }), z = z.parent;
1345
+ return z === l ? R.reverse() : void 0;
1346
+ }
1347
+ }, StateStackImpl = class l {
1348
+ constructor(l, R, z, B, V, H, U, W) {
1349
+ this.parent = l, this.ruleId = R, this.beginRuleCapturedEOL = V, this.endRule = H, this.nameScopesList = U, this.contentNameScopesList = W, this.depth = this.parent ? this.parent.depth + 1 : 1, this._enterPos = z, this._anchorPos = B;
1350
+ }
1351
+ _stackElementBrand = void 0;
1352
+ static NULL = new l(null, 0, 0, 0, !1, null, null, null);
1353
+ _enterPos;
1354
+ _anchorPos;
1355
+ depth;
1356
+ equals(R) {
1357
+ return R === null ? !1 : l._equals(this, R);
1358
+ }
1359
+ static _equals(l, R) {
1360
+ return l === R ? !0 : this._structuralEquals(l, R) ? AttributedScopeStack.equals(l.contentNameScopesList, R.contentNameScopesList) : !1;
1361
+ }
1362
+ static _structuralEquals(l, R) {
1363
+ do {
1364
+ if (l === R || !l && !R) return !0;
1365
+ if (!l || !R || l.depth !== R.depth || l.ruleId !== R.ruleId || l.endRule !== R.endRule) return !1;
1366
+ l = l.parent, R = R.parent;
1367
+ } while (!0);
1368
+ }
1369
+ clone() {
1370
+ return this;
1371
+ }
1372
+ static _reset(l) {
1373
+ for (; l;) l._enterPos = -1, l._anchorPos = -1, l = l.parent;
1374
+ }
1375
+ reset() {
1376
+ l._reset(this);
1377
+ }
1378
+ pop() {
1379
+ return this.parent;
1380
+ }
1381
+ safePop() {
1382
+ return this.parent ? this.parent : this;
1383
+ }
1384
+ push(R, z, B, V, H, U, W) {
1385
+ return new l(this, R, z, B, V, H, U, W);
1386
+ }
1387
+ getEnterPos() {
1388
+ return this._enterPos;
1389
+ }
1390
+ getAnchorPos() {
1391
+ return this._anchorPos;
1392
+ }
1393
+ getRule(l) {
1394
+ return l.getRule(this.ruleId);
1395
+ }
1396
+ toString() {
1397
+ let l = [];
1398
+ return this._writeString(l, 0), "[" + l.join(",") + "]";
1399
+ }
1400
+ _writeString(l, R) {
1401
+ return this.parent && (R = this.parent._writeString(l, R)), l[R++] = `(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`, R;
1402
+ }
1403
+ withContentNameScopesList(l) {
1404
+ return this.contentNameScopesList === l ? this : this.parent.push(this.ruleId, this._enterPos, this._anchorPos, this.beginRuleCapturedEOL, this.endRule, this.nameScopesList, l);
1405
+ }
1406
+ withEndRule(R) {
1407
+ return this.endRule === R ? this : new l(this.parent, this.ruleId, this._enterPos, this._anchorPos, this.beginRuleCapturedEOL, R, this.nameScopesList, this.contentNameScopesList);
1408
+ }
1409
+ hasSameRuleAs(l) {
1410
+ let R = this;
1411
+ for (; R && R._enterPos === l._enterPos;) {
1412
+ if (R.ruleId === l.ruleId) return !0;
1413
+ R = R.parent;
1414
+ }
1415
+ return !1;
1416
+ }
1417
+ toStateStackFrame() {
1418
+ return {
1419
+ ruleId: ruleIdToNumber(this.ruleId),
1420
+ beginRuleCapturedEOL: this.beginRuleCapturedEOL,
1421
+ endRule: this.endRule,
1422
+ nameScopesList: this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList ?? null) ?? [],
1423
+ contentNameScopesList: this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList) ?? []
1424
+ };
1425
+ }
1426
+ static pushFrame(R, z) {
1427
+ let B = AttributedScopeStack.fromExtension(R?.nameScopesList ?? null, z.nameScopesList);
1428
+ return new l(R, ruleIdFromNumber(z.ruleId), z.enterPos ?? -1, z.anchorPos ?? -1, z.beginRuleCapturedEOL, z.endRule, B, AttributedScopeStack.fromExtension(B, z.contentNameScopesList));
1429
+ }
1430
+ }, BalancedBracketSelectors = class {
1431
+ balancedBracketScopes;
1432
+ unbalancedBracketScopes;
1433
+ allowAny = !1;
1434
+ constructor(l, R) {
1435
+ this.balancedBracketScopes = l.flatMap((l) => l === "*" ? (this.allowAny = !0, []) : createMatchers(l, nameMatcher).map((l) => l.matcher)), this.unbalancedBracketScopes = R.flatMap((l) => createMatchers(l, nameMatcher).map((l) => l.matcher));
1436
+ }
1437
+ get matchesAlways() {
1438
+ return this.allowAny && this.unbalancedBracketScopes.length === 0;
1439
+ }
1440
+ get matchesNever() {
1441
+ return this.balancedBracketScopes.length === 0 && !this.allowAny;
1442
+ }
1443
+ match(l) {
1444
+ for (let R of this.unbalancedBracketScopes) if (R(l)) return !1;
1445
+ for (let R of this.balancedBracketScopes) if (R(l)) return !0;
1446
+ return this.allowAny;
1447
+ }
1448
+ }, LineTokens = class {
1449
+ constructor(l, R, z, B) {
1450
+ this.balancedBracketSelectors = B, this._emitBinaryTokens = l, this._tokenTypeOverrides = z, this._lineText = null, this._tokens = [], this._binaryTokens = [], this._lastTokenEndIndex = 0;
1451
+ }
1452
+ _emitBinaryTokens;
1453
+ _lineText;
1454
+ _tokens;
1455
+ _binaryTokens;
1456
+ _lastTokenEndIndex;
1457
+ _tokenTypeOverrides;
1458
+ produce(l, R) {
1459
+ this.produceFromScopes(l.contentNameScopesList, R);
1460
+ }
1461
+ produceFromScopes(l, R) {
1462
+ if (this._lastTokenEndIndex >= R) return;
1463
+ if (this._emitBinaryTokens) {
1464
+ let z = l?.tokenAttributes ?? 0, B = !1;
1465
+ if (this.balancedBracketSelectors?.matchesAlways && (B = !0), this._tokenTypeOverrides.length > 0 || this.balancedBracketSelectors && !this.balancedBracketSelectors.matchesAlways && !this.balancedBracketSelectors.matchesNever) {
1466
+ let R = l?.getScopeNames() ?? [];
1467
+ for (let l of this._tokenTypeOverrides) l.matcher(R) && (z = EncodedTokenMetadata.set(z, 0, toOptionalTokenType(l.type), null, -1, 0, 0));
1468
+ this.balancedBracketSelectors && (B = this.balancedBracketSelectors.match(R));
1469
+ }
1470
+ if (B && (z = EncodedTokenMetadata.set(z, 0, 8, B, -1, 0, 0)), this._binaryTokens.length > 0 && this._binaryTokens[this._binaryTokens.length - 1] === z) {
1471
+ this._lastTokenEndIndex = R;
1472
+ return;
1473
+ }
1474
+ this._binaryTokens.push(this._lastTokenEndIndex), this._binaryTokens.push(z), this._lastTokenEndIndex = R;
1475
+ return;
1476
+ }
1477
+ let z = l?.getScopeNames() ?? [];
1478
+ this._tokens.push({
1479
+ startIndex: this._lastTokenEndIndex,
1480
+ endIndex: R,
1481
+ scopes: z
1482
+ }), this._lastTokenEndIndex = R;
1483
+ }
1484
+ getResult(l, R) {
1485
+ return this._tokens.length > 0 && this._tokens[this._tokens.length - 1].startIndex === R - 1 && this._tokens.pop(), this._tokens.length === 0 && (this._lastTokenEndIndex = -1, this.produce(l, R), this._tokens[this._tokens.length - 1].startIndex = 0), this._tokens;
1486
+ }
1487
+ getBinaryResult(l, R) {
1488
+ this._binaryTokens.length > 0 && this._binaryTokens[this._binaryTokens.length - 2] === R - 1 && (this._binaryTokens.pop(), this._binaryTokens.pop()), this._binaryTokens.length === 0 && (this._lastTokenEndIndex = -1, this.produce(l, R), this._binaryTokens[this._binaryTokens.length - 2] = 0);
1489
+ let z = new Uint32Array(this._binaryTokens.length);
1490
+ for (let l = 0, R = this._binaryTokens.length; l < R; l++) z[l] = this._binaryTokens[l];
1491
+ return z;
1492
+ }
1493
+ }, SyncRegistry = class {
1494
+ constructor(l, R) {
1495
+ this._onigLib = R, this._theme = l;
1496
+ }
1497
+ _grammars = /* @__PURE__ */ new Map();
1498
+ _rawGrammars = /* @__PURE__ */ new Map();
1499
+ _injectionGrammars = /* @__PURE__ */ new Map();
1500
+ _theme;
1501
+ dispose() {
1502
+ for (let l of this._grammars.values()) l.dispose();
1503
+ }
1504
+ setTheme(l) {
1505
+ this._theme = l;
1506
+ }
1507
+ getColorMap() {
1508
+ return this._theme.getColorMap();
1509
+ }
1510
+ addGrammar(l, R) {
1511
+ this._rawGrammars.set(l.scopeName, l), R && this._injectionGrammars.set(l.scopeName, R);
1512
+ }
1513
+ lookup(l) {
1514
+ return this._rawGrammars.get(l);
1515
+ }
1516
+ injections(l) {
1517
+ return this._injectionGrammars.get(l);
1518
+ }
1519
+ getDefaults() {
1520
+ return this._theme.getDefaults();
1521
+ }
1522
+ themeMatch(l) {
1523
+ return this._theme.match(l);
1524
+ }
1525
+ grammarForScopeName(l, R, z, B, V) {
1526
+ if (!this._grammars.has(l)) {
1527
+ let H = this._rawGrammars.get(l);
1528
+ if (!H) return null;
1529
+ this._grammars.set(l, createGrammar(l, H, R, z, B, V, this, this._onigLib));
1530
+ }
1531
+ return this._grammars.get(l);
1532
+ }
1533
+ }, Registry = class {
1534
+ _options;
1535
+ _syncRegistry;
1536
+ _ensureGrammarCache;
1537
+ constructor(l) {
1538
+ this._options = l, this._syncRegistry = new SyncRegistry(Theme.createFromRawTheme(l.theme, l.colorMap), l.onigLib), this._ensureGrammarCache = /* @__PURE__ */ new Map();
1539
+ }
1540
+ dispose() {
1541
+ this._syncRegistry.dispose();
1542
+ }
1543
+ setTheme(l, R) {
1544
+ this._syncRegistry.setTheme(Theme.createFromRawTheme(l, R));
1545
+ }
1546
+ getColorMap() {
1547
+ return this._syncRegistry.getColorMap();
1548
+ }
1549
+ loadGrammarWithEmbeddedLanguages(l, R, z) {
1550
+ return this.loadGrammarWithConfiguration(l, R, { embeddedLanguages: z });
1551
+ }
1552
+ loadGrammarWithConfiguration(l, R, z) {
1553
+ return this._loadGrammar(l, R, z.embeddedLanguages, z.tokenTypes, new BalancedBracketSelectors(z.balancedBracketSelectors || [], z.unbalancedBracketSelectors || []));
1554
+ }
1555
+ loadGrammar(l) {
1556
+ return this._loadGrammar(l, 0, null, null, null);
1557
+ }
1558
+ _loadGrammar(l, R, z, B, V) {
1559
+ let H = new ScopeDependencyProcessor(this._syncRegistry, l);
1560
+ for (; H.Q.length > 0;) H.Q.map((l) => this._loadSingleGrammar(l.scopeName)), H.processQueue();
1561
+ return this._grammarForScopeName(l, R, z, B, V);
1562
+ }
1563
+ _loadSingleGrammar(l) {
1564
+ this._ensureGrammarCache.has(l) || (this._doLoadSingleGrammar(l), this._ensureGrammarCache.set(l, !0));
1565
+ }
1566
+ _doLoadSingleGrammar(l) {
1567
+ let R = this._options.loadGrammar(l);
1568
+ if (R) {
1569
+ let z = typeof this._options.getInjections == "function" ? this._options.getInjections(l) : void 0;
1570
+ this._syncRegistry.addGrammar(R, z);
1571
+ }
1572
+ }
1573
+ addGrammar(l, R = [], z = 0, B = null) {
1574
+ return this._syncRegistry.addGrammar(l, R), this._grammarForScopeName(l.scopeName, z, B);
1575
+ }
1576
+ _grammarForScopeName(l, R = 0, z = null, B = null, V = null) {
1577
+ return this._syncRegistry.grammarForScopeName(l, R, z, B, V);
1578
+ }
1579
+ }, INITIAL = StateStackImpl.NULL;
1580
+ export { EncodedTokenMetadata, FontStyle, INITIAL, Registry, Theme };