@loopstack/loopstack-studio 0.21.0 → 0.21.2

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 (668) 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/select.js +2 -2
  24. package/dist/components/ui/table.js +2 -2
  25. package/dist/components/ui/tabs.js +54 -0
  26. package/dist/components/ui-widgets/UiActions.js +24 -0
  27. package/dist/components/ui-widgets/UiWidget.js +43 -0
  28. package/dist/components/ui-widgets/widgets/AiPromptInput.js +43 -0
  29. package/dist/components/ui-widgets/widgets/ButtonFullWidth.js +23 -0
  30. package/dist/components/ui-widgets/widgets/SubmitButton.js +23 -0
  31. package/dist/events/sse-client-events.js +7 -0
  32. package/dist/features/code-explorer/CodeExplorer.js +69 -0
  33. package/dist/features/code-explorer/components/CodeExplorerTree.js +43 -0
  34. package/dist/features/code-explorer/components/CodeExplorerTreeNode.js +82 -0
  35. package/dist/features/code-explorer/components/FileContentViewer.js +237 -0
  36. package/dist/features/code-explorer/components/FileTabsBar.js +191 -0
  37. package/dist/features/code-explorer/providers/CodeExplorerProvider.js +165 -0
  38. package/dist/features/code-explorer/utils/fileIcons.js +42 -0
  39. package/dist/features/dashboard/Dashboard.js +125 -0
  40. package/dist/features/dashboard/RunItem.js +76 -0
  41. package/dist/features/dashboard/RunList.js +32 -0
  42. package/dist/features/debug/components/ConfigFlowViewer.js +79 -0
  43. package/dist/features/debug/components/PipelineDebugHeader.js +48 -0
  44. package/dist/features/debug/components/PipelineDebugLegend.js +68 -0
  45. package/dist/features/debug/components/PipelineFlowViewer.js +109 -0
  46. package/dist/features/debug/components/pipeline-flow/StateNode.js +111 -0
  47. package/dist/features/debug/components/pipeline-flow/WorkflowGraph.js +41 -0
  48. package/dist/features/debug/components/pipeline-flow/WorkflowTransitionEdge.js +97 -0
  49. package/dist/features/debug/lib/edge-paths.js +47 -0
  50. package/dist/features/debug/lib/flow-utils.js +247 -0
  51. package/dist/features/health/LocalHealthCheck.js +80 -67
  52. package/dist/features/oauth/OAuthCallbackPage.js +2 -0
  53. package/dist/features/oauth/OAuthPromptRenderer.js +223 -0
  54. package/dist/features/oauth/index.js +3 -0
  55. package/dist/features/oauth/useOAuthPopup.js +83 -0
  56. package/dist/features/workbench/NavigationItems.js +52 -0
  57. package/dist/features/workbench/Workbench.js +101 -0
  58. package/dist/features/workbench/WorkbenchNavigation.js +38 -0
  59. package/dist/features/workbench/WorkflowItem.js +67 -0
  60. package/dist/features/workbench/WorkflowList.js +110 -0
  61. package/dist/features/workbench/components/DocumentItem.js +27 -0
  62. package/dist/features/workbench/components/DocumentList.js +40 -0
  63. package/dist/features/workbench/components/DocumentMetadataPills.js +63 -0
  64. package/dist/features/workbench/components/DocumentRenderer.js +54 -0
  65. package/dist/features/workbench/components/NavigationItem.js +68 -0
  66. package/dist/features/workbench/components/PipelineHistoryList.js +56 -0
  67. package/dist/features/workbench/components/WorkbenchSettingsModal.js +89 -0
  68. package/dist/features/workbench/components/WorkbenchSidebar.js +109 -0
  69. package/dist/features/workbench/components/WorkflowForms.js +22 -0
  70. package/dist/features/workbench/components/WorkflowHistoryItem.js +144 -0
  71. package/dist/features/workbench/components/buttons/WorkflowButtons.js +85 -0
  72. package/dist/features/workbench/components/document-details/DocumentDetails.js +425 -0
  73. package/dist/features/workbench/components/document-details/PromptDetails.js +146 -0
  74. package/dist/features/workbench/components/document-renderer/AiMessage.js +56 -0
  75. package/dist/features/workbench/components/document-renderer/AiMessageContent.js +174 -0
  76. package/dist/features/workbench/components/document-renderer/DocumentDebugRenderer.js +30 -0
  77. package/dist/features/workbench/components/document-renderer/DocumentFormRenderer.js +79 -0
  78. package/dist/features/workbench/components/document-renderer/DocumentMessageRenderer.js +10 -0
  79. package/dist/features/workbench/components/document-renderer/ErrorMessageRenderer.js +13 -0
  80. package/dist/features/workbench/components/document-renderer/LinkMessageRenderer.js +17 -0
  81. package/dist/features/workbench/components/document-renderer/MarkdownMessageRenderer.js +10 -0
  82. package/dist/features/workbench/components/document-renderer/PlainMessageRenderer.js +9 -0
  83. package/dist/features/workbench/hooks/useAutoScrollBottom.js +29 -0
  84. package/dist/features/workbench/hooks/useIntersectionObserver.js +44 -0
  85. package/dist/features/workbench/hooks/useScrollToListItem.js +23 -0
  86. package/dist/features/workbench/providers/ScrollProvider.js +22 -0
  87. package/dist/features/workbench/providers/WorkbenchContextProvider.js +3 -0
  88. package/dist/features/workspaces/Workspaces.js +166 -99
  89. package/dist/features/workspaces/components/CreateWorkspace.js +101 -78
  90. package/dist/features/workspaces/components/ExecutionTimeline.js +1 -1
  91. package/dist/hooks/index.js +1 -0
  92. package/dist/hooks/useAuth.js +25 -4
  93. package/dist/hooks/useDashboard.js +23 -0
  94. package/dist/hooks/useDocuments.js +45 -0
  95. package/dist/hooks/useFiles.js +63 -0
  96. package/dist/hooks/useNamespaceTree.js +27 -0
  97. package/dist/hooks/useNamespaces.js +34 -0
  98. package/dist/hooks/usePipelines.js +83 -6
  99. package/dist/hooks/useWorkflows.js +122 -0
  100. package/dist/hooks/useWorkspaces.js +49 -29
  101. package/dist/index.d.ts +88 -10
  102. package/dist/index.js +11 -1
  103. package/dist/lib/requireParam.js +6 -0
  104. package/dist/loopstack-studio.css +1 -1
  105. package/dist/node_modules/@ai-sdk/provider/dist/index.js +65 -0
  106. package/dist/node_modules/@ai-sdk/provider-utils/dist/index.js +1008 -0
  107. package/dist/node_modules/@dagrejs/dagre/dist/dagre.esm.js +1968 -0
  108. package/dist/node_modules/@shikijs/core/dist/index.js +1420 -0
  109. package/dist/node_modules/@shikijs/engine-oniguruma/dist/index.js +236 -0
  110. package/dist/node_modules/@shikijs/engine-oniguruma/dist/wasm-inlined.js +2 -0
  111. package/dist/node_modules/@shikijs/langs/dist/abap.js +2 -0
  112. package/dist/node_modules/@shikijs/langs/dist/actionscript-3.js +2 -0
  113. package/dist/node_modules/@shikijs/langs/dist/ada.js +2 -0
  114. package/dist/node_modules/@shikijs/langs/dist/angular-expression.js +2 -0
  115. package/dist/node_modules/@shikijs/langs/dist/angular-html.js +14 -0
  116. package/dist/node_modules/@shikijs/langs/dist/angular-inline-style.js +3 -0
  117. package/dist/node_modules/@shikijs/langs/dist/angular-inline-template.js +8 -0
  118. package/dist/node_modules/@shikijs/langs/dist/angular-let-declaration.js +3 -0
  119. package/dist/node_modules/@shikijs/langs/dist/angular-template-blocks.js +8 -0
  120. package/dist/node_modules/@shikijs/langs/dist/angular-template.js +3 -0
  121. package/dist/node_modules/@shikijs/langs/dist/angular-ts.js +16 -0
  122. package/dist/node_modules/@shikijs/langs/dist/apache.js +2 -0
  123. package/dist/node_modules/@shikijs/langs/dist/apex.js +2 -0
  124. package/dist/node_modules/@shikijs/langs/dist/apl.js +14 -0
  125. package/dist/node_modules/@shikijs/langs/dist/applescript.js +2 -0
  126. package/dist/node_modules/@shikijs/langs/dist/ara.js +2 -0
  127. package/dist/node_modules/@shikijs/langs/dist/asciidoc.js +2 -0
  128. package/dist/node_modules/@shikijs/langs/dist/asm.js +2 -0
  129. package/dist/node_modules/@shikijs/langs/dist/astro.js +16 -0
  130. package/dist/node_modules/@shikijs/langs/dist/awk.js +2 -0
  131. package/dist/node_modules/@shikijs/langs/dist/ballerina.js +2 -0
  132. package/dist/node_modules/@shikijs/langs/dist/bat.js +2 -0
  133. package/dist/node_modules/@shikijs/langs/dist/beancount.js +2 -0
  134. package/dist/node_modules/@shikijs/langs/dist/berry.js +2 -0
  135. package/dist/node_modules/@shikijs/langs/dist/bibtex.js +2 -0
  136. package/dist/node_modules/@shikijs/langs/dist/bicep.js +2 -0
  137. package/dist/node_modules/@shikijs/langs/dist/bird2.js +2 -0
  138. package/dist/node_modules/@shikijs/langs/dist/blade.js +18 -0
  139. package/dist/node_modules/@shikijs/langs/dist/bsl.js +3 -0
  140. package/dist/node_modules/@shikijs/langs/dist/c.js +2 -0
  141. package/dist/node_modules/@shikijs/langs/dist/c3.js +2 -0
  142. package/dist/node_modules/@shikijs/langs/dist/cadence.js +2 -0
  143. package/dist/node_modules/@shikijs/langs/dist/cairo.js +3 -0
  144. package/dist/node_modules/@shikijs/langs/dist/clarity.js +2 -0
  145. package/dist/node_modules/@shikijs/langs/dist/clojure.js +2 -0
  146. package/dist/node_modules/@shikijs/langs/dist/cmake.js +2 -0
  147. package/dist/node_modules/@shikijs/langs/dist/cobol.js +8 -0
  148. package/dist/node_modules/@shikijs/langs/dist/codeowners.js +2 -0
  149. package/dist/node_modules/@shikijs/langs/dist/codeql.js +2 -0
  150. package/dist/node_modules/@shikijs/langs/dist/coffee.js +3 -0
  151. package/dist/node_modules/@shikijs/langs/dist/common-lisp.js +2 -0
  152. package/dist/node_modules/@shikijs/langs/dist/coq.js +2 -0
  153. package/dist/node_modules/@shikijs/langs/dist/cpp-macro.js +10 -0
  154. package/dist/node_modules/@shikijs/langs/dist/cpp.js +12 -0
  155. package/dist/node_modules/@shikijs/langs/dist/crystal.js +16 -0
  156. package/dist/node_modules/@shikijs/langs/dist/csharp.js +2 -0
  157. package/dist/node_modules/@shikijs/langs/dist/css.js +2 -0
  158. package/dist/node_modules/@shikijs/langs/dist/csv.js +2 -0
  159. package/dist/node_modules/@shikijs/langs/dist/cue.js +2 -0
  160. package/dist/node_modules/@shikijs/langs/dist/cypher.js +2 -0
  161. package/dist/node_modules/@shikijs/langs/dist/d.js +2 -0
  162. package/dist/node_modules/@shikijs/langs/dist/dart.js +2 -0
  163. package/dist/node_modules/@shikijs/langs/dist/dax.js +2 -0
  164. package/dist/node_modules/@shikijs/langs/dist/desktop.js +2 -0
  165. package/dist/node_modules/@shikijs/langs/dist/diff.js +2 -0
  166. package/dist/node_modules/@shikijs/langs/dist/docker.js +2 -0
  167. package/dist/node_modules/@shikijs/langs/dist/dotenv.js +2 -0
  168. package/dist/node_modules/@shikijs/langs/dist/dream-maker.js +2 -0
  169. package/dist/node_modules/@shikijs/langs/dist/edge.js +10 -0
  170. package/dist/node_modules/@shikijs/langs/dist/elixir.js +3 -0
  171. package/dist/node_modules/@shikijs/langs/dist/elm.js +3 -0
  172. package/dist/node_modules/@shikijs/langs/dist/emacs-lisp.js +2 -0
  173. package/dist/node_modules/@shikijs/langs/dist/erb.js +8 -0
  174. package/dist/node_modules/@shikijs/langs/dist/erlang.js +3 -0
  175. package/dist/node_modules/@shikijs/langs/dist/es-tag-css.js +10 -0
  176. package/dist/node_modules/@shikijs/langs/dist/es-tag-glsl.js +10 -0
  177. package/dist/node_modules/@shikijs/langs/dist/es-tag-html.js +10 -0
  178. package/dist/node_modules/@shikijs/langs/dist/es-tag-sql.js +8 -0
  179. package/dist/node_modules/@shikijs/langs/dist/es-tag-xml.js +3 -0
  180. package/dist/node_modules/@shikijs/langs/dist/fennel.js +2 -0
  181. package/dist/node_modules/@shikijs/langs/dist/fish.js +2 -0
  182. package/dist/node_modules/@shikijs/langs/dist/fluent.js +2 -0
  183. package/dist/node_modules/@shikijs/langs/dist/fortran-fixed-form.js +3 -0
  184. package/dist/node_modules/@shikijs/langs/dist/fortran-free-form.js +2 -0
  185. package/dist/node_modules/@shikijs/langs/dist/fsharp.js +3 -0
  186. package/dist/node_modules/@shikijs/langs/dist/gdresource.js +8 -0
  187. package/dist/node_modules/@shikijs/langs/dist/gdscript.js +2 -0
  188. package/dist/node_modules/@shikijs/langs/dist/gdshader.js +2 -0
  189. package/dist/node_modules/@shikijs/langs/dist/genie.js +2 -0
  190. package/dist/node_modules/@shikijs/langs/dist/gherkin.js +2 -0
  191. package/dist/node_modules/@shikijs/langs/dist/git-commit.js +3 -0
  192. package/dist/node_modules/@shikijs/langs/dist/git-rebase.js +3 -0
  193. package/dist/node_modules/@shikijs/langs/dist/gleam.js +2 -0
  194. package/dist/node_modules/@shikijs/langs/dist/glimmer-js.js +12 -0
  195. package/dist/node_modules/@shikijs/langs/dist/glimmer-ts.js +12 -0
  196. package/dist/node_modules/@shikijs/langs/dist/glsl.js +3 -0
  197. package/dist/node_modules/@shikijs/langs/dist/gn.js +2 -0
  198. package/dist/node_modules/@shikijs/langs/dist/gnuplot.js +2 -0
  199. package/dist/node_modules/@shikijs/langs/dist/go.js +2 -0
  200. package/dist/node_modules/@shikijs/langs/dist/graphql.js +12 -0
  201. package/dist/node_modules/@shikijs/langs/dist/groovy.js +2 -0
  202. package/dist/node_modules/@shikijs/langs/dist/hack.js +8 -0
  203. package/dist/node_modules/@shikijs/langs/dist/haml.js +8 -0
  204. package/dist/node_modules/@shikijs/langs/dist/handlebars.js +12 -0
  205. package/dist/node_modules/@shikijs/langs/dist/haskell.js +2 -0
  206. package/dist/node_modules/@shikijs/langs/dist/haxe.js +2 -0
  207. package/dist/node_modules/@shikijs/langs/dist/hcl.js +2 -0
  208. package/dist/node_modules/@shikijs/langs/dist/hjson.js +2 -0
  209. package/dist/node_modules/@shikijs/langs/dist/hlsl.js +2 -0
  210. package/dist/node_modules/@shikijs/langs/dist/html-derivative.js +3 -0
  211. package/dist/node_modules/@shikijs/langs/dist/html.js +8 -0
  212. package/dist/node_modules/@shikijs/langs/dist/http.js +12 -0
  213. package/dist/node_modules/@shikijs/langs/dist/hurl.js +10 -0
  214. package/dist/node_modules/@shikijs/langs/dist/hxml.js +3 -0
  215. package/dist/node_modules/@shikijs/langs/dist/hy.js +2 -0
  216. package/dist/node_modules/@shikijs/langs/dist/imba.js +2 -0
  217. package/dist/node_modules/@shikijs/langs/dist/ini.js +2 -0
  218. package/dist/node_modules/@shikijs/langs/dist/java.js +2 -0
  219. package/dist/node_modules/@shikijs/langs/dist/javascript.js +2 -0
  220. package/dist/node_modules/@shikijs/langs/dist/jinja-html.js +3 -0
  221. package/dist/node_modules/@shikijs/langs/dist/jinja.js +3 -0
  222. package/dist/node_modules/@shikijs/langs/dist/jison.js +3 -0
  223. package/dist/node_modules/@shikijs/langs/dist/json.js +2 -0
  224. package/dist/node_modules/@shikijs/langs/dist/json5.js +2 -0
  225. package/dist/node_modules/@shikijs/langs/dist/jsonc.js +2 -0
  226. package/dist/node_modules/@shikijs/langs/dist/jsonl.js +2 -0
  227. package/dist/node_modules/@shikijs/langs/dist/jsonnet.js +2 -0
  228. package/dist/node_modules/@shikijs/langs/dist/jssm.js +2 -0
  229. package/dist/node_modules/@shikijs/langs/dist/jsx.js +2 -0
  230. package/dist/node_modules/@shikijs/langs/dist/julia.js +14 -0
  231. package/dist/node_modules/@shikijs/langs/dist/just.js +16 -0
  232. package/dist/node_modules/@shikijs/langs/dist/kdl.js +2 -0
  233. package/dist/node_modules/@shikijs/langs/dist/kotlin.js +2 -0
  234. package/dist/node_modules/@shikijs/langs/dist/kusto.js +2 -0
  235. package/dist/node_modules/@shikijs/langs/dist/latex.js +3 -0
  236. package/dist/node_modules/@shikijs/langs/dist/lean.js +2 -0
  237. package/dist/node_modules/@shikijs/langs/dist/less.js +2 -0
  238. package/dist/node_modules/@shikijs/langs/dist/liquid.js +12 -0
  239. package/dist/node_modules/@shikijs/langs/dist/llvm.js +2 -0
  240. package/dist/node_modules/@shikijs/langs/dist/log.js +2 -0
  241. package/dist/node_modules/@shikijs/langs/dist/logo.js +2 -0
  242. package/dist/node_modules/@shikijs/langs/dist/lua.js +3 -0
  243. package/dist/node_modules/@shikijs/langs/dist/luau.js +2 -0
  244. package/dist/node_modules/@shikijs/langs/dist/make.js +2 -0
  245. package/dist/node_modules/@shikijs/langs/dist/markdown-nix.js +2 -0
  246. package/dist/node_modules/@shikijs/langs/dist/markdown-vue.js +2 -0
  247. package/dist/node_modules/@shikijs/langs/dist/markdown.js +2 -0
  248. package/dist/node_modules/@shikijs/langs/dist/marko.js +12 -0
  249. package/dist/node_modules/@shikijs/langs/dist/matlab.js +2 -0
  250. package/dist/node_modules/@shikijs/langs/dist/mdc.js +10 -0
  251. package/dist/node_modules/@shikijs/langs/dist/mdx.js +2 -0
  252. package/dist/node_modules/@shikijs/langs/dist/mermaid.js +2 -0
  253. package/dist/node_modules/@shikijs/langs/dist/mipsasm.js +2 -0
  254. package/dist/node_modules/@shikijs/langs/dist/mojo.js +2 -0
  255. package/dist/node_modules/@shikijs/langs/dist/moonbit.js +2 -0
  256. package/dist/node_modules/@shikijs/langs/dist/move.js +2 -0
  257. package/dist/node_modules/@shikijs/langs/dist/narrat.js +2 -0
  258. package/dist/node_modules/@shikijs/langs/dist/nextflow-groovy.js +2 -0
  259. package/dist/node_modules/@shikijs/langs/dist/nextflow.js +3 -0
  260. package/dist/node_modules/@shikijs/langs/dist/nginx.js +3 -0
  261. package/dist/node_modules/@shikijs/langs/dist/nim.js +18 -0
  262. package/dist/node_modules/@shikijs/langs/dist/nix.js +3 -0
  263. package/dist/node_modules/@shikijs/langs/dist/nushell.js +2 -0
  264. package/dist/node_modules/@shikijs/langs/dist/objective-c.js +2 -0
  265. package/dist/node_modules/@shikijs/langs/dist/objective-cpp.js +2 -0
  266. package/dist/node_modules/@shikijs/langs/dist/ocaml.js +2 -0
  267. package/dist/node_modules/@shikijs/langs/dist/odin.js +2 -0
  268. package/dist/node_modules/@shikijs/langs/dist/openscad.js +2 -0
  269. package/dist/node_modules/@shikijs/langs/dist/pascal.js +2 -0
  270. package/dist/node_modules/@shikijs/langs/dist/perl.js +14 -0
  271. package/dist/node_modules/@shikijs/langs/dist/php.js +16 -0
  272. package/dist/node_modules/@shikijs/langs/dist/pkl.js +2 -0
  273. package/dist/node_modules/@shikijs/langs/dist/plsql.js +2 -0
  274. package/dist/node_modules/@shikijs/langs/dist/po.js +2 -0
  275. package/dist/node_modules/@shikijs/langs/dist/polar.js +2 -0
  276. package/dist/node_modules/@shikijs/langs/dist/postcss.js +2 -0
  277. package/dist/node_modules/@shikijs/langs/dist/powerquery.js +2 -0
  278. package/dist/node_modules/@shikijs/langs/dist/powershell.js +2 -0
  279. package/dist/node_modules/@shikijs/langs/dist/prisma.js +2 -0
  280. package/dist/node_modules/@shikijs/langs/dist/prolog.js +2 -0
  281. package/dist/node_modules/@shikijs/langs/dist/proto.js +2 -0
  282. package/dist/node_modules/@shikijs/langs/dist/pug.js +10 -0
  283. package/dist/node_modules/@shikijs/langs/dist/puppet.js +2 -0
  284. package/dist/node_modules/@shikijs/langs/dist/purescript.js +2 -0
  285. package/dist/node_modules/@shikijs/langs/dist/python.js +2 -0
  286. package/dist/node_modules/@shikijs/langs/dist/qml.js +3 -0
  287. package/dist/node_modules/@shikijs/langs/dist/qmldir.js +2 -0
  288. package/dist/node_modules/@shikijs/langs/dist/qss.js +2 -0
  289. package/dist/node_modules/@shikijs/langs/dist/r.js +2 -0
  290. package/dist/node_modules/@shikijs/langs/dist/racket.js +2 -0
  291. package/dist/node_modules/@shikijs/langs/dist/raku.js +2 -0
  292. package/dist/node_modules/@shikijs/langs/dist/razor.js +8 -0
  293. package/dist/node_modules/@shikijs/langs/dist/reg.js +2 -0
  294. package/dist/node_modules/@shikijs/langs/dist/regexp.js +2 -0
  295. package/dist/node_modules/@shikijs/langs/dist/rel.js +2 -0
  296. package/dist/node_modules/@shikijs/langs/dist/riscv.js +2 -0
  297. package/dist/node_modules/@shikijs/langs/dist/ron.js +2 -0
  298. package/dist/node_modules/@shikijs/langs/dist/rosmsg.js +2 -0
  299. package/dist/node_modules/@shikijs/langs/dist/rst.js +20 -0
  300. package/dist/node_modules/@shikijs/langs/dist/ruby.js +28 -0
  301. package/dist/node_modules/@shikijs/langs/dist/rust.js +2 -0
  302. package/dist/node_modules/@shikijs/langs/dist/sas.js +3 -0
  303. package/dist/node_modules/@shikijs/langs/dist/sass.js +2 -0
  304. package/dist/node_modules/@shikijs/langs/dist/scala.js +2 -0
  305. package/dist/node_modules/@shikijs/langs/dist/scheme.js +2 -0
  306. package/dist/node_modules/@shikijs/langs/dist/scss.js +3 -0
  307. package/dist/node_modules/@shikijs/langs/dist/sdbl.js +2 -0
  308. package/dist/node_modules/@shikijs/langs/dist/shaderlab.js +3 -0
  309. package/dist/node_modules/@shikijs/langs/dist/shellscript.js +2 -0
  310. package/dist/node_modules/@shikijs/langs/dist/shellsession.js +3 -0
  311. package/dist/node_modules/@shikijs/langs/dist/smalltalk.js +2 -0
  312. package/dist/node_modules/@shikijs/langs/dist/solidity.js +2 -0
  313. package/dist/node_modules/@shikijs/langs/dist/soy.js +3 -0
  314. package/dist/node_modules/@shikijs/langs/dist/sparql.js +3 -0
  315. package/dist/node_modules/@shikijs/langs/dist/splunk.js +2 -0
  316. package/dist/node_modules/@shikijs/langs/dist/sql.js +2 -0
  317. package/dist/node_modules/@shikijs/langs/dist/ssh-config.js +2 -0
  318. package/dist/node_modules/@shikijs/langs/dist/stata.js +3 -0
  319. package/dist/node_modules/@shikijs/langs/dist/stylus.js +2 -0
  320. package/dist/node_modules/@shikijs/langs/dist/surrealql.js +3 -0
  321. package/dist/node_modules/@shikijs/langs/dist/svelte.js +12 -0
  322. package/dist/node_modules/@shikijs/langs/dist/swift.js +2 -0
  323. package/dist/node_modules/@shikijs/langs/dist/system-verilog.js +2 -0
  324. package/dist/node_modules/@shikijs/langs/dist/systemd.js +2 -0
  325. package/dist/node_modules/@shikijs/langs/dist/talonscript.js +2 -0
  326. package/dist/node_modules/@shikijs/langs/dist/tasl.js +2 -0
  327. package/dist/node_modules/@shikijs/langs/dist/tcl.js +2 -0
  328. package/dist/node_modules/@shikijs/langs/dist/templ.js +10 -0
  329. package/dist/node_modules/@shikijs/langs/dist/terraform.js +2 -0
  330. package/dist/node_modules/@shikijs/langs/dist/tex.js +3 -0
  331. package/dist/node_modules/@shikijs/langs/dist/toml.js +2 -0
  332. package/dist/node_modules/@shikijs/langs/dist/ts-tags.js +16 -0
  333. package/dist/node_modules/@shikijs/langs/dist/tsv.js +2 -0
  334. package/dist/node_modules/@shikijs/langs/dist/tsx.js +2 -0
  335. package/dist/node_modules/@shikijs/langs/dist/turtle.js +2 -0
  336. package/dist/node_modules/@shikijs/langs/dist/twig.js +16 -0
  337. package/dist/node_modules/@shikijs/langs/dist/typescript.js +2 -0
  338. package/dist/node_modules/@shikijs/langs/dist/typespec.js +2 -0
  339. package/dist/node_modules/@shikijs/langs/dist/typst.js +2 -0
  340. package/dist/node_modules/@shikijs/langs/dist/v.js +2 -0
  341. package/dist/node_modules/@shikijs/langs/dist/vala.js +2 -0
  342. package/dist/node_modules/@shikijs/langs/dist/vb.js +2 -0
  343. package/dist/node_modules/@shikijs/langs/dist/verilog.js +2 -0
  344. package/dist/node_modules/@shikijs/langs/dist/vhdl.js +2 -0
  345. package/dist/node_modules/@shikijs/langs/dist/viml.js +2 -0
  346. package/dist/node_modules/@shikijs/langs/dist/vue-directives.js +2 -0
  347. package/dist/node_modules/@shikijs/langs/dist/vue-html.js +3 -0
  348. package/dist/node_modules/@shikijs/langs/dist/vue-interpolations.js +2 -0
  349. package/dist/node_modules/@shikijs/langs/dist/vue-sfc-style-variable-injection.js +3 -0
  350. package/dist/node_modules/@shikijs/langs/dist/vue-vine.js +16 -0
  351. package/dist/node_modules/@shikijs/langs/dist/vue.js +24 -0
  352. package/dist/node_modules/@shikijs/langs/dist/vyper.js +2 -0
  353. package/dist/node_modules/@shikijs/langs/dist/wasm.js +2 -0
  354. package/dist/node_modules/@shikijs/langs/dist/wenyan.js +2 -0
  355. package/dist/node_modules/@shikijs/langs/dist/wgsl.js +2 -0
  356. package/dist/node_modules/@shikijs/langs/dist/wikitext.js +2 -0
  357. package/dist/node_modules/@shikijs/langs/dist/wit.js +2 -0
  358. package/dist/node_modules/@shikijs/langs/dist/wolfram.js +2 -0
  359. package/dist/node_modules/@shikijs/langs/dist/xml.js +3 -0
  360. package/dist/node_modules/@shikijs/langs/dist/xsl.js +3 -0
  361. package/dist/node_modules/@shikijs/langs/dist/yaml.js +2 -0
  362. package/dist/node_modules/@shikijs/langs/dist/zenscript.js +2 -0
  363. package/dist/node_modules/@shikijs/langs/dist/zig.js +2 -0
  364. package/dist/node_modules/@shikijs/themes/dist/andromeeda.js +2 -0
  365. package/dist/node_modules/@shikijs/themes/dist/aurora-x.js +2 -0
  366. package/dist/node_modules/@shikijs/themes/dist/ayu-dark.js +2 -0
  367. package/dist/node_modules/@shikijs/themes/dist/ayu-light.js +2 -0
  368. package/dist/node_modules/@shikijs/themes/dist/ayu-mirage.js +2 -0
  369. package/dist/node_modules/@shikijs/themes/dist/catppuccin-frappe.js +2 -0
  370. package/dist/node_modules/@shikijs/themes/dist/catppuccin-latte.js +2 -0
  371. package/dist/node_modules/@shikijs/themes/dist/catppuccin-macchiato.js +2 -0
  372. package/dist/node_modules/@shikijs/themes/dist/catppuccin-mocha.js +2 -0
  373. package/dist/node_modules/@shikijs/themes/dist/dark-plus.js +2 -0
  374. package/dist/node_modules/@shikijs/themes/dist/dracula-soft.js +2 -0
  375. package/dist/node_modules/@shikijs/themes/dist/dracula.js +2 -0
  376. package/dist/node_modules/@shikijs/themes/dist/everforest-dark.js +2 -0
  377. package/dist/node_modules/@shikijs/themes/dist/everforest-light.js +2 -0
  378. package/dist/node_modules/@shikijs/themes/dist/github-dark-default.js +2 -0
  379. package/dist/node_modules/@shikijs/themes/dist/github-dark-dimmed.js +2 -0
  380. package/dist/node_modules/@shikijs/themes/dist/github-dark-high-contrast.js +2 -0
  381. package/dist/node_modules/@shikijs/themes/dist/github-dark.js +2 -0
  382. package/dist/node_modules/@shikijs/themes/dist/github-light-default.js +2 -0
  383. package/dist/node_modules/@shikijs/themes/dist/github-light-high-contrast.js +2 -0
  384. package/dist/node_modules/@shikijs/themes/dist/github-light.js +2 -0
  385. package/dist/node_modules/@shikijs/themes/dist/gruvbox-dark-hard.js +2 -0
  386. package/dist/node_modules/@shikijs/themes/dist/gruvbox-dark-medium.js +2 -0
  387. package/dist/node_modules/@shikijs/themes/dist/gruvbox-dark-soft.js +2 -0
  388. package/dist/node_modules/@shikijs/themes/dist/gruvbox-light-hard.js +2 -0
  389. package/dist/node_modules/@shikijs/themes/dist/gruvbox-light-medium.js +2 -0
  390. package/dist/node_modules/@shikijs/themes/dist/gruvbox-light-soft.js +2 -0
  391. package/dist/node_modules/@shikijs/themes/dist/horizon-bright.js +2 -0
  392. package/dist/node_modules/@shikijs/themes/dist/horizon.js +2 -0
  393. package/dist/node_modules/@shikijs/themes/dist/houston.js +2 -0
  394. package/dist/node_modules/@shikijs/themes/dist/kanagawa-dragon.js +2 -0
  395. package/dist/node_modules/@shikijs/themes/dist/kanagawa-lotus.js +2 -0
  396. package/dist/node_modules/@shikijs/themes/dist/kanagawa-wave.js +2 -0
  397. package/dist/node_modules/@shikijs/themes/dist/laserwave.js +2 -0
  398. package/dist/node_modules/@shikijs/themes/dist/light-plus.js +2 -0
  399. package/dist/node_modules/@shikijs/themes/dist/material-theme-darker.js +2 -0
  400. package/dist/node_modules/@shikijs/themes/dist/material-theme-lighter.js +2 -0
  401. package/dist/node_modules/@shikijs/themes/dist/material-theme-ocean.js +2 -0
  402. package/dist/node_modules/@shikijs/themes/dist/material-theme-palenight.js +2 -0
  403. package/dist/node_modules/@shikijs/themes/dist/material-theme.js +2 -0
  404. package/dist/node_modules/@shikijs/themes/dist/min-dark.js +2 -0
  405. package/dist/node_modules/@shikijs/themes/dist/min-light.js +2 -0
  406. package/dist/node_modules/@shikijs/themes/dist/monokai.js +2 -0
  407. package/dist/node_modules/@shikijs/themes/dist/night-owl-light.js +2 -0
  408. package/dist/node_modules/@shikijs/themes/dist/night-owl.js +2 -0
  409. package/dist/node_modules/@shikijs/themes/dist/nord.js +2 -0
  410. package/dist/node_modules/@shikijs/themes/dist/one-dark-pro.js +2 -0
  411. package/dist/node_modules/@shikijs/themes/dist/one-light.js +2 -0
  412. package/dist/node_modules/@shikijs/themes/dist/plastic.js +2 -0
  413. package/dist/node_modules/@shikijs/themes/dist/poimandres.js +2 -0
  414. package/dist/node_modules/@shikijs/themes/dist/red.js +2 -0
  415. package/dist/node_modules/@shikijs/themes/dist/rose-pine-dawn.js +2 -0
  416. package/dist/node_modules/@shikijs/themes/dist/rose-pine-moon.js +2 -0
  417. package/dist/node_modules/@shikijs/themes/dist/rose-pine.js +2 -0
  418. package/dist/node_modules/@shikijs/themes/dist/slack-dark.js +2 -0
  419. package/dist/node_modules/@shikijs/themes/dist/slack-ochin.js +2 -0
  420. package/dist/node_modules/@shikijs/themes/dist/snazzy-light.js +2 -0
  421. package/dist/node_modules/@shikijs/themes/dist/solarized-dark.js +2 -0
  422. package/dist/node_modules/@shikijs/themes/dist/solarized-light.js +2 -0
  423. package/dist/node_modules/@shikijs/themes/dist/synthwave-84.js +2 -0
  424. package/dist/node_modules/@shikijs/themes/dist/tokyo-night.js +2 -0
  425. package/dist/node_modules/@shikijs/themes/dist/vesper.js +2 -0
  426. package/dist/node_modules/@shikijs/themes/dist/vitesse-black.js +2 -0
  427. package/dist/node_modules/@shikijs/themes/dist/vitesse-dark.js +2 -0
  428. package/dist/node_modules/@shikijs/themes/dist/vitesse-light.js +2 -0
  429. package/dist/node_modules/@shikijs/types/dist/index.js +6 -0
  430. package/dist/node_modules/@shikijs/vscode-textmate/dist/index.js +1580 -0
  431. package/dist/node_modules/@ungap/structured-clone/esm/deserialize.js +51 -0
  432. package/dist/node_modules/@ungap/structured-clone/esm/index.js +4 -0
  433. package/dist/node_modules/@ungap/structured-clone/esm/serialize.js +91 -0
  434. package/dist/node_modules/@ungap/structured-clone/esm/types.js +2 -0
  435. package/dist/node_modules/@xyflow/react/dist/esm/index.js +3280 -0
  436. package/dist/node_modules/@xyflow/system/dist/esm/index.js +1839 -0
  437. package/dist/node_modules/ai/dist/index.js +1083 -0
  438. package/dist/node_modules/bail/index.js +4 -0
  439. package/dist/node_modules/character-entities-html4/index.js +255 -0
  440. package/dist/node_modules/character-entities-legacy/index.js +2 -0
  441. package/dist/node_modules/chevrotain/lib/src/parse/errors_public.js +6 -1
  442. package/dist/node_modules/chevrotain/lib/src/scan/lexer.js +4 -10
  443. package/dist/node_modules/chevrotain/lib/src/scan/lexer_public.js +56 -65
  444. package/dist/node_modules/classcat/index.js +8 -0
  445. package/dist/node_modules/comma-separated-tokens/index.js +5 -1
  446. package/dist/node_modules/d3/src/index.js +5 -0
  447. package/dist/node_modules/d3-drag/src/constant.js +2 -0
  448. package/dist/node_modules/d3-drag/src/drag.js +112 -0
  449. package/dist/node_modules/d3-drag/src/event.js +60 -0
  450. package/dist/node_modules/d3-drag/src/nodrag.js +13 -0
  451. package/dist/node_modules/d3-drag/src/noevent.js +11 -0
  452. package/dist/node_modules/d3-interpolate/src/zoom.js +39 -0
  453. package/dist/node_modules/d3-selection/src/pointer.js +16 -0
  454. package/dist/node_modules/d3-selection/src/sourceEvent.js +6 -0
  455. package/dist/node_modules/d3-zoom/src/constant.js +2 -0
  456. package/dist/node_modules/d3-zoom/src/event.js +26 -0
  457. package/dist/node_modules/d3-zoom/src/index.js +1 -1
  458. package/dist/node_modules/d3-zoom/src/noevent.js +7 -0
  459. package/dist/node_modules/d3-zoom/src/zoom.js +214 -1
  460. package/dist/node_modules/decode-named-character-reference/index.dom.js +8 -0
  461. package/dist/node_modules/entities/dist/esm/decode-codepoint.js +35 -0
  462. package/dist/node_modules/entities/dist/esm/decode.js +129 -0
  463. package/dist/node_modules/entities/dist/esm/generated/decode-data-html.js +2 -0
  464. package/dist/node_modules/estree-util-is-identifier-name/lib/index.js +5 -0
  465. package/dist/node_modules/extend/index.js +37 -0
  466. package/dist/node_modules/hast-util-from-parse5/lib/index.js +121 -0
  467. package/dist/node_modules/hast-util-raw/lib/index.js +204 -0
  468. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/doctype.js +34 -0
  469. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/error-codes.js +5 -0
  470. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/foreign-content.js +150 -0
  471. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/html.js +267 -0
  472. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/token.js +9 -0
  473. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/unicode.js +65 -0
  474. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/index.js +8 -0
  475. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/formatting-element-list.js +69 -0
  476. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/index.js +1936 -0
  477. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/open-element-stack.js +239 -0
  478. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/serializer/index.js +22 -0
  479. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/index.js +1451 -0
  480. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/preprocessor.js +75 -0
  481. package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tree-adapters/default.js +155 -0
  482. package/dist/node_modules/hast-util-sanitize/lib/index.js +159 -0
  483. package/dist/node_modules/hast-util-sanitize/lib/schema.js +73 -0
  484. package/dist/node_modules/hast-util-to-html/lib/handle/comment.js +9 -0
  485. package/dist/node_modules/hast-util-to-html/lib/handle/doctype.js +4 -0
  486. package/dist/node_modules/hast-util-to-html/lib/handle/element.js +47 -0
  487. package/dist/node_modules/hast-util-to-html/lib/handle/index.js +27 -0
  488. package/dist/node_modules/hast-util-to-html/lib/handle/raw.js +5 -0
  489. package/dist/node_modules/hast-util-to-html/lib/handle/root.js +4 -0
  490. package/dist/node_modules/hast-util-to-html/lib/handle/text.js +6 -0
  491. package/dist/node_modules/hast-util-to-html/lib/index.js +46 -0
  492. package/dist/node_modules/hast-util-to-html/lib/omission/closing.js +84 -0
  493. package/dist/node_modules/hast-util-to-html/lib/omission/omission.js +8 -0
  494. package/dist/node_modules/hast-util-to-html/lib/omission/opening.js +37 -0
  495. package/dist/node_modules/hast-util-to-html/lib/omission/util/siblings.js +12 -0
  496. package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +251 -0
  497. package/dist/node_modules/hast-util-to-parse5/lib/index.js +113 -0
  498. package/dist/node_modules/hast-util-whitespace/lib/index.js +8 -0
  499. package/dist/node_modules/html-url-attributes/lib/index.js +34 -0
  500. package/dist/node_modules/html-void-elements/index.js +23 -0
  501. package/dist/node_modules/inline-style-parser/cjs/index.js +88 -0
  502. package/dist/node_modules/lodash/_Symbol.js +7 -0
  503. package/dist/node_modules/lodash/_baseGetTag.js +13 -0
  504. package/dist/node_modules/lodash/_baseTrim.js +11 -0
  505. package/dist/node_modules/lodash/_freeGlobal.js +6 -0
  506. package/dist/node_modules/lodash/_getRawTag.js +17 -0
  507. package/dist/node_modules/lodash/_objectToString.js +10 -0
  508. package/dist/node_modules/lodash/_root.js +8 -0
  509. package/dist/node_modules/lodash/_trimmedEndIndex.js +11 -0
  510. package/dist/node_modules/lodash/debounce.js +53 -0
  511. package/dist/node_modules/lodash/isObject.js +10 -0
  512. package/dist/node_modules/lodash/isObjectLike.js +9 -0
  513. package/dist/node_modules/lodash/isSymbol.js +12 -0
  514. package/dist/node_modules/lodash/now.js +10 -0
  515. package/dist/node_modules/lodash/toNumber.js +22 -0
  516. package/dist/node_modules/mdast-util-from-markdown/lib/index.js +555 -0
  517. package/dist/node_modules/mdast-util-to-hast/lib/footer.js +101 -0
  518. package/dist/node_modules/mdast-util-to-hast/lib/handlers/blockquote.js +10 -0
  519. package/dist/node_modules/mdast-util-to-hast/lib/handlers/break.js +13 -0
  520. package/dist/node_modules/mdast-util-to-hast/lib/handlers/code.js +20 -0
  521. package/dist/node_modules/mdast-util-to-hast/lib/handlers/delete.js +10 -0
  522. package/dist/node_modules/mdast-util-to-hast/lib/handlers/emphasis.js +10 -0
  523. package/dist/node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js +28 -0
  524. package/dist/node_modules/mdast-util-to-hast/lib/handlers/heading.js +10 -0
  525. package/dist/node_modules/mdast-util-to-hast/lib/handlers/html.js +10 -0
  526. package/dist/node_modules/mdast-util-to-hast/lib/handlers/image-reference.js +19 -0
  527. package/dist/node_modules/mdast-util-to-hast/lib/handlers/image.js +13 -0
  528. package/dist/node_modules/mdast-util-to-hast/lib/handlers/index.js +54 -0
  529. package/dist/node_modules/mdast-util-to-hast/lib/handlers/inline-code.js +15 -0
  530. package/dist/node_modules/mdast-util-to-hast/lib/handlers/link-reference.js +16 -0
  531. package/dist/node_modules/mdast-util-to-hast/lib/handlers/link.js +13 -0
  532. package/dist/node_modules/mdast-util-to-hast/lib/handlers/list-item.js +57 -0
  533. package/dist/node_modules/mdast-util-to-hast/lib/handlers/list.js +18 -0
  534. package/dist/node_modules/mdast-util-to-hast/lib/handlers/paragraph.js +10 -0
  535. package/dist/node_modules/mdast-util-to-hast/lib/handlers/root.js +8 -0
  536. package/dist/node_modules/mdast-util-to-hast/lib/handlers/strong.js +10 -0
  537. package/dist/node_modules/mdast-util-to-hast/lib/handlers/table-cell.js +10 -0
  538. package/dist/node_modules/mdast-util-to-hast/lib/handlers/table-row.js +22 -0
  539. package/dist/node_modules/mdast-util-to-hast/lib/handlers/table.js +33 -0
  540. package/dist/node_modules/mdast-util-to-hast/lib/handlers/text.js +9 -0
  541. package/dist/node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js +10 -0
  542. package/dist/node_modules/mdast-util-to-hast/lib/index.js +17 -0
  543. package/dist/node_modules/mdast-util-to-hast/lib/revert.js +18 -0
  544. package/dist/node_modules/mdast-util-to-hast/lib/state.js +106 -0
  545. package/dist/node_modules/micromark/lib/constructs.js +79 -0
  546. package/dist/node_modules/micromark/lib/create-tokenizer.js +175 -0
  547. package/dist/node_modules/micromark/lib/initialize/content.js +32 -0
  548. package/dist/node_modules/micromark/lib/initialize/document.js +101 -0
  549. package/dist/node_modules/micromark/lib/initialize/flow.js +23 -0
  550. package/dist/node_modules/micromark/lib/initialize/text.js +84 -0
  551. package/dist/node_modules/micromark/lib/parse.js +27 -0
  552. package/dist/node_modules/micromark/lib/postprocess.js +6 -0
  553. package/dist/node_modules/micromark/lib/preprocess.js +30 -0
  554. package/dist/node_modules/micromark-core-commonmark/lib/attention.js +112 -0
  555. package/dist/node_modules/micromark-core-commonmark/lib/autolink.js +41 -0
  556. package/dist/node_modules/micromark-core-commonmark/lib/block-quote.js +36 -0
  557. package/dist/node_modules/micromark-core-commonmark/lib/character-escape.js +15 -0
  558. package/dist/node_modules/micromark-core-commonmark/lib/character-reference.js +27 -0
  559. package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.js +88 -0
  560. package/dist/node_modules/micromark-core-commonmark/lib/code-indented.js +42 -0
  561. package/dist/node_modules/micromark-core-commonmark/lib/code-text.js +41 -0
  562. package/dist/node_modules/micromark-core-commonmark/lib/content.js +46 -0
  563. package/dist/node_modules/micromark-core-commonmark/lib/definition.js +59 -0
  564. package/dist/node_modules/micromark-core-commonmark/lib/hard-break-escape.js +15 -0
  565. package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.js +65 -0
  566. package/dist/node_modules/micromark-core-commonmark/lib/html-flow.js +140 -0
  567. package/dist/node_modules/micromark-core-commonmark/lib/html-text.js +98 -0
  568. package/dist/node_modules/micromark-core-commonmark/lib/label-end.js +157 -0
  569. package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.js +21 -0
  570. package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.js +18 -0
  571. package/dist/node_modules/micromark-core-commonmark/lib/line-ending.js +12 -0
  572. package/dist/node_modules/micromark-core-commonmark/lib/list.js +77 -0
  573. package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.js +57 -0
  574. package/dist/node_modules/micromark-core-commonmark/lib/thematic-break.js +23 -0
  575. package/dist/node_modules/micromark-factory-destination/index.js +24 -0
  576. package/dist/node_modules/micromark-factory-label/index.js +18 -0
  577. package/dist/node_modules/micromark-factory-title/index.js +22 -0
  578. package/dist/node_modules/micromark-factory-whitespace/index.js +10 -0
  579. package/dist/node_modules/micromark-util-character/index.js +6 -5
  580. package/dist/node_modules/micromark-util-chunked/index.js +4 -1
  581. package/dist/node_modules/micromark-util-decode-numeric-character-reference/index.js +5 -0
  582. package/dist/node_modules/micromark-util-decode-string/index.js +15 -0
  583. package/dist/node_modules/micromark-util-html-tag-name/index.js +7 -0
  584. package/dist/node_modules/micromark-util-sanitize-uri/index.js +16 -0
  585. package/dist/node_modules/micromark-util-subtokenize/index.js +33 -0
  586. package/dist/node_modules/micromark-util-subtokenize/lib/splice-buffer.js +55 -0
  587. package/dist/node_modules/motion/dist/es/react.js +3 -0
  588. package/dist/node_modules/nanoid/index.browser.js +7 -0
  589. package/dist/node_modules/nanoid/url-alphabet/index.js +2 -0
  590. package/dist/node_modules/property-information/index.js +1 -0
  591. package/dist/node_modules/property-information/lib/hast-to-react.js +20 -0
  592. package/dist/node_modules/rehype-harden/dist/index.js +168 -0
  593. package/dist/node_modules/rehype-raw/lib/index.js +10 -0
  594. package/dist/node_modules/rehype-sanitize/lib/index.js +7 -0
  595. package/dist/node_modules/remark-parse/lib/index.js +14 -0
  596. package/dist/node_modules/remark-rehype/lib/index.js +16 -0
  597. package/dist/node_modules/remend/dist/index.js +459 -0
  598. package/dist/node_modules/shiki/dist/bundle-full.js +11 -0
  599. package/dist/node_modules/shiki/dist/langs.js +1278 -0
  600. package/dist/node_modules/shiki/dist/themes.js +393 -0
  601. package/dist/node_modules/shiki/dist/wasm.js +2 -0
  602. package/dist/node_modules/space-separated-tokens/index.js +4 -1
  603. package/dist/node_modules/streamdown/dist/chunk-RLXIAIE6.js +2189 -0
  604. package/dist/node_modules/streamdown/dist/highlighted-body-B3W2YXNL.js +33 -0
  605. package/dist/node_modules/streamdown/dist/index.js +2 -0
  606. package/dist/node_modules/streamdown/dist/mermaid-3ZIDBTTL.js +3 -0
  607. package/dist/node_modules/streamdown/node_modules/marked/lib/marked.esm.js +1421 -0
  608. package/dist/node_modules/stringify-entities/lib/constant/dangerous.js +11 -0
  609. package/dist/node_modules/stringify-entities/lib/core.js +21 -0
  610. package/dist/node_modules/stringify-entities/lib/index.js +6 -0
  611. package/dist/node_modules/stringify-entities/lib/util/format-smart.js +12 -0
  612. package/dist/node_modules/stringify-entities/lib/util/to-decimal.js +6 -0
  613. package/dist/node_modules/stringify-entities/lib/util/to-hexadecimal.js +6 -0
  614. package/dist/node_modules/stringify-entities/lib/util/to-named.js +15 -0
  615. package/dist/node_modules/style-to-js/cjs/index.js +17 -0
  616. package/dist/node_modules/style-to-js/cjs/utilities.js +16 -0
  617. package/dist/node_modules/style-to-object/cjs/index.js +21 -0
  618. package/dist/node_modules/trim-lines/index.js +19 -0
  619. package/dist/node_modules/trough/lib/index.js +48 -0
  620. package/dist/node_modules/unified/lib/callable-instance.js +7 -0
  621. package/dist/node_modules/unified/lib/index.js +160 -0
  622. package/dist/node_modules/unified/node_modules/is-plain-obj/index.js +6 -0
  623. package/dist/node_modules/unist-util-position/lib/index.js +20 -0
  624. package/dist/node_modules/unist-util-stringify-position/lib/index.js +13 -0
  625. package/dist/node_modules/vfile/lib/index.js +87 -0
  626. package/dist/node_modules/vfile/lib/minpath.browser.js +97 -0
  627. package/dist/node_modules/vfile/lib/minproc.browser.js +5 -0
  628. package/dist/node_modules/vfile/lib/minurl.browser.js +29 -0
  629. package/dist/node_modules/vfile/lib/minurl.shared.js +4 -0
  630. package/dist/node_modules/vfile-location/lib/index.js +41 -0
  631. package/dist/node_modules/vfile-message/lib/index.js +22 -0
  632. package/dist/node_modules/zod/v3/ZodError.js +79 -0
  633. package/dist/node_modules/zod/v3/errors.js +6 -0
  634. package/dist/node_modules/zod/v3/helpers/errorUtil.js +5 -0
  635. package/dist/node_modules/zod/v3/helpers/parseUtil.js +90 -0
  636. package/dist/node_modules/zod/v3/helpers/util.js +72 -0
  637. package/dist/node_modules/zod/v3/locales/en.js +58 -0
  638. package/dist/node_modules/zod/v3/types.js +2425 -0
  639. package/dist/node_modules/zod/v4/classic/errors.js +21 -0
  640. package/dist/node_modules/zod/v4/classic/iso.js +29 -0
  641. package/dist/node_modules/zod/v4/classic/parse.js +4 -0
  642. package/dist/node_modules/zod/v4/classic/schemas.js +392 -0
  643. package/dist/node_modules/zod/v4/core/api.js +532 -0
  644. package/dist/node_modules/zod/v4/core/checks.js +283 -0
  645. package/dist/node_modules/zod/v4/core/core.js +44 -0
  646. package/dist/node_modules/zod/v4/core/doc.js +21 -0
  647. package/dist/node_modules/zod/v4/core/errors.js +40 -0
  648. package/dist/node_modules/zod/v4/core/json-schema-processors.js +305 -0
  649. package/dist/node_modules/zod/v4/core/parse.js +66 -0
  650. package/dist/node_modules/zod/v4/core/regexes.js +28 -0
  651. package/dist/node_modules/zod/v4/core/registries.js +38 -0
  652. package/dist/node_modules/zod/v4/core/schemas.js +863 -0
  653. package/dist/node_modules/zod/v4/core/to-json-schema.js +220 -0
  654. package/dist/node_modules/zod/v4/core/util.js +267 -0
  655. package/dist/node_modules/zod/v4/core/versions.js +6 -0
  656. package/dist/node_modules/zwitch/index.js +14 -0
  657. package/dist/pages/DashboardPage.js +58 -0
  658. package/dist/pages/DebugWorkflowDetailsPage.js +121 -0
  659. package/dist/pages/DebugWorkflowsPage.js +130 -0
  660. package/dist/pages/EmbedWorkbenchPage.js +73 -0
  661. package/dist/pages/PipelineDebugPage.js +114 -0
  662. package/dist/pages/WorkbenchPage.js +67 -0
  663. package/dist/pages/WorkspacePage.js +1 -1
  664. package/dist/providers/ComponentOverridesProvider.js +12 -0
  665. package/dist/providers/InvalidationEventsProvider.js +43 -0
  666. package/dist/providers/SseProvider.js +44 -0
  667. package/dist/routing/LocalRouter.js +3 -0
  668. package/package.json +3 -3
@@ -0,0 +1,1839 @@
1
+ import select_default from "../../../../d3-selection/src/select.js";
2
+ import pointer_default from "../../../../d3-selection/src/pointer.js";
3
+ import drag_default from "../../../../d3-drag/src/drag.js";
4
+ import value_default from "../../../../d3-interpolate/src/value.js";
5
+ import zoom_default$1 from "../../../../d3-interpolate/src/zoom.js";
6
+ import transform, { identity } from "../../../../d3-zoom/src/transform.js";
7
+ import zoom_default from "../../../../d3-zoom/src/zoom.js";
8
+ import "../../../../d3-zoom/src/index.js";
9
+ var errorMessages = {
10
+ error001: () => "[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",
11
+ error002: () => "It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",
12
+ error003: (e) => `Node type "${e}" not found. Using fallback type "default".`,
13
+ error004: () => "The React Flow parent container needs a width and a height to render the graph.",
14
+ error005: () => "Only child nodes can use a parent extent.",
15
+ error006: () => "Can't create edge. An edge needs a source and a target.",
16
+ error007: (e) => `The old edge with id=${e} does not exist.`,
17
+ error009: (e) => `Marker type "${e}" doesn't exist.`,
18
+ error008: (e, { id: s, sourceHandle: c, targetHandle: l }) => `Couldn't create edge for ${e} handle id: "${e === "source" ? c : l}", edge id: ${s}.`,
19
+ error010: () => "Handle: No node id found. Make sure to only use a Handle inside a custom Node.",
20
+ error011: (e) => `Edge type "${e}" not found. Using fallback type "default".`,
21
+ error012: (e) => `Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,
22
+ error013: (e = "react") => `It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,
23
+ error014: () => "useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",
24
+ error015: () => "It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."
25
+ }, infiniteExtent = [[-Infinity, -Infinity], [Infinity, Infinity]], elementSelectionKeys = [
26
+ "Enter",
27
+ " ",
28
+ "Escape"
29
+ ], defaultAriaLabelConfig = {
30
+ "node.a11yDescription.default": "Press enter or space to select a node. Press delete to remove it and escape to cancel.",
31
+ "node.a11yDescription.keyboardDisabled": "Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.",
32
+ "node.a11yDescription.ariaLiveMessage": ({ direction: e, x: s, y: c }) => `Moved selected node ${e}. New position, x: ${s}, y: ${c}`,
33
+ "edge.a11yDescription.default": "Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.",
34
+ "controls.ariaLabel": "Control Panel",
35
+ "controls.zoomIn.ariaLabel": "Zoom In",
36
+ "controls.zoomOut.ariaLabel": "Zoom Out",
37
+ "controls.fitView.ariaLabel": "Fit View",
38
+ "controls.interactive.ariaLabel": "Toggle Interactivity",
39
+ "minimap.ariaLabel": "Mini Map",
40
+ "handle.ariaLabel": "Handle"
41
+ }, ConnectionMode;
42
+ (function(e) {
43
+ e.Strict = "strict", e.Loose = "loose";
44
+ })(ConnectionMode ||= {});
45
+ var PanOnScrollMode;
46
+ (function(e) {
47
+ e.Free = "free", e.Vertical = "vertical", e.Horizontal = "horizontal";
48
+ })(PanOnScrollMode ||= {});
49
+ var SelectionMode;
50
+ (function(e) {
51
+ e.Partial = "partial", e.Full = "full";
52
+ })(SelectionMode ||= {});
53
+ var initialConnection = {
54
+ inProgress: !1,
55
+ isValid: null,
56
+ from: null,
57
+ fromHandle: null,
58
+ fromPosition: null,
59
+ fromNode: null,
60
+ to: null,
61
+ toHandle: null,
62
+ toPosition: null,
63
+ toNode: null,
64
+ pointer: null
65
+ }, ConnectionLineType;
66
+ (function(e) {
67
+ e.Bezier = "default", e.Straight = "straight", e.Step = "step", e.SmoothStep = "smoothstep", e.SimpleBezier = "simplebezier";
68
+ })(ConnectionLineType ||= {});
69
+ var MarkerType;
70
+ (function(e) {
71
+ e.Arrow = "arrow", e.ArrowClosed = "arrowclosed";
72
+ })(MarkerType ||= {});
73
+ var Position;
74
+ (function(e) {
75
+ e.Left = "left", e.Top = "top", e.Right = "right", e.Bottom = "bottom";
76
+ })(Position ||= {});
77
+ var oppositePosition = {
78
+ [Position.Left]: Position.Right,
79
+ [Position.Right]: Position.Left,
80
+ [Position.Top]: Position.Bottom,
81
+ [Position.Bottom]: Position.Top
82
+ };
83
+ function getConnectionStatus(e) {
84
+ return e === null ? null : e ? "valid" : "invalid";
85
+ }
86
+ var isEdgeBase = (e) => "id" in e && "source" in e && "target" in e, isNodeBase = (e) => "id" in e && "position" in e && !("source" in e) && !("target" in e), isInternalNodeBase = (e) => "id" in e && "internals" in e && !("source" in e) && !("target" in e), getNodePositionWithOrigin = (e, s = [0, 0]) => {
87
+ let { width: c, height: l } = getNodeDimensions(e), u = e.origin ?? s, d = c * u[0], f = l * u[1];
88
+ return {
89
+ x: e.position.x - d,
90
+ y: e.position.y - f
91
+ };
92
+ }, getNodesBounds = (e, s = { nodeOrigin: [0, 0] }) => (process.env.NODE_ENV === "development" && !s.nodeLookup && console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows."), e.length === 0 ? {
93
+ x: 0,
94
+ y: 0,
95
+ width: 0,
96
+ height: 0
97
+ } : boxToRect(e.reduce((e, c) => {
98
+ let l = typeof c == "string", u = !s.nodeLookup && !l ? c : void 0;
99
+ return s.nodeLookup && (u = l ? s.nodeLookup.get(c) : isInternalNodeBase(c) ? c : s.nodeLookup.get(c.id)), getBoundsOfBoxes(e, u ? nodeToBox(u, s.nodeOrigin) : {
100
+ x: 0,
101
+ y: 0,
102
+ x2: 0,
103
+ y2: 0
104
+ });
105
+ }, {
106
+ x: Infinity,
107
+ y: Infinity,
108
+ x2: -Infinity,
109
+ y2: -Infinity
110
+ }))), getInternalNodesBounds = (e, s = {}) => {
111
+ let c = {
112
+ x: Infinity,
113
+ y: Infinity,
114
+ x2: -Infinity,
115
+ y2: -Infinity
116
+ }, l = !1;
117
+ return e.forEach((e) => {
118
+ (s.filter === void 0 || s.filter(e)) && (c = getBoundsOfBoxes(c, nodeToBox(e)), l = !0);
119
+ }), l ? boxToRect(c) : {
120
+ x: 0,
121
+ y: 0,
122
+ width: 0,
123
+ height: 0
124
+ };
125
+ }, getNodesInside = (e, s, [c, l, u] = [
126
+ 0,
127
+ 0,
128
+ 1
129
+ ], d = !1, f = !1) => {
130
+ let p = {
131
+ ...pointToRendererPoint(s, [
132
+ c,
133
+ l,
134
+ u
135
+ ]),
136
+ width: s.width / u,
137
+ height: s.height / u
138
+ }, m = [];
139
+ for (let s of e.values()) {
140
+ let { measured: e, selectable: c = !0, hidden: l = !1 } = s;
141
+ if (f && !c || l) continue;
142
+ let u = e.width ?? s.width ?? s.initialWidth ?? null, h = e.height ?? s.height ?? s.initialHeight ?? null, g = getOverlappingArea(p, nodeToRect(s)), _ = (u ?? 0) * (h ?? 0), v = d && g > 0;
143
+ (!s.internals.handleBounds || v || g >= _ || s.dragging) && m.push(s);
144
+ }
145
+ return m;
146
+ }, getConnectedEdges = (e, s) => {
147
+ let c = /* @__PURE__ */ new Set();
148
+ return e.forEach((e) => {
149
+ c.add(e.id);
150
+ }), s.filter((e) => c.has(e.source) || c.has(e.target));
151
+ };
152
+ function getFitViewNodes(e, s) {
153
+ let c = /* @__PURE__ */ new Map(), l = s?.nodes ? new Set(s.nodes.map((e) => e.id)) : null;
154
+ return e.forEach((e) => {
155
+ e.measured.width && e.measured.height && (s?.includeHiddenNodes || !e.hidden) && (!l || l.has(e.id)) && c.set(e.id, e);
156
+ }), c;
157
+ }
158
+ async function fitViewport({ nodes: e, width: s, height: c, panZoom: l, minZoom: u, maxZoom: d }, f) {
159
+ if (e.size === 0) return Promise.resolve(!0);
160
+ let p = getViewportForBounds(getInternalNodesBounds(getFitViewNodes(e, f)), s, c, f?.minZoom ?? u, f?.maxZoom ?? d, f?.padding ?? .1);
161
+ return await l.setViewport(p, {
162
+ duration: f?.duration,
163
+ ease: f?.ease,
164
+ interpolate: f?.interpolate
165
+ }), Promise.resolve(!0);
166
+ }
167
+ function calculateNodePosition({ nodeId: e, nextPosition: s, nodeLookup: c, nodeOrigin: l = [0, 0], nodeExtent: u, onError: d }) {
168
+ let f = c.get(e), p = f.parentId ? c.get(f.parentId) : void 0, { x: h, y: g } = p ? p.internals.positionAbsolute : {
169
+ x: 0,
170
+ y: 0
171
+ }, _ = f.origin ?? l, v = f.extent || u;
172
+ if (f.extent === "parent" && !f.expandParent) if (!p) d?.("005", errorMessages.error005());
173
+ else {
174
+ let e = p.measured.width, s = p.measured.height;
175
+ e && s && (v = [[h, g], [h + e, g + s]]);
176
+ }
177
+ else p && isCoordinateExtent(f.extent) && (v = [[f.extent[0][0] + h, f.extent[0][1] + g], [f.extent[1][0] + h, f.extent[1][1] + g]]);
178
+ let y = isCoordinateExtent(v) ? clampPosition(s, v, f.measured) : s;
179
+ return (f.measured.width === void 0 || f.measured.height === void 0) && d?.("015", errorMessages.error015()), {
180
+ position: {
181
+ x: y.x - h + (f.measured.width ?? 0) * _[0],
182
+ y: y.y - g + (f.measured.height ?? 0) * _[1]
183
+ },
184
+ positionAbsolute: y
185
+ };
186
+ }
187
+ async function getElementsToRemove({ nodesToRemove: e = [], edgesToRemove: s = [], nodes: c, edges: l, onBeforeDelete: u }) {
188
+ let d = new Set(e.map((e) => e.id)), f = [];
189
+ for (let e of c) {
190
+ if (e.deletable === !1) continue;
191
+ let s = d.has(e.id), c = !s && e.parentId && f.find((s) => s.id === e.parentId);
192
+ (s || c) && f.push(e);
193
+ }
194
+ let p = new Set(s.map((e) => e.id)), m = l.filter((e) => e.deletable !== !1), h = getConnectedEdges(f, m);
195
+ for (let e of m) p.has(e.id) && !h.find((s) => s.id === e.id) && h.push(e);
196
+ if (!u) return {
197
+ edges: h,
198
+ nodes: f
199
+ };
200
+ let g = await u({
201
+ nodes: f,
202
+ edges: h
203
+ });
204
+ return typeof g == "boolean" ? g ? {
205
+ edges: h,
206
+ nodes: f
207
+ } : {
208
+ edges: [],
209
+ nodes: []
210
+ } : g;
211
+ }
212
+ var clamp = (e, s = 0, c = 1) => Math.min(Math.max(e, s), c), clampPosition = (e = {
213
+ x: 0,
214
+ y: 0
215
+ }, s, c) => ({
216
+ x: clamp(e.x, s[0][0], s[1][0] - (c?.width ?? 0)),
217
+ y: clamp(e.y, s[0][1], s[1][1] - (c?.height ?? 0))
218
+ });
219
+ function clampPositionToParent(e, s, c) {
220
+ let { width: l, height: u } = getNodeDimensions(c), { x: d, y: f } = c.internals.positionAbsolute;
221
+ return clampPosition(e, [[d, f], [d + l, f + u]], s);
222
+ }
223
+ var calcAutoPanVelocity = (e, s, c) => e < s ? clamp(Math.abs(e - s), 1, s) / s : e > c ? -clamp(Math.abs(e - c), 1, s) / s : 0, calcAutoPan = (e, s, c = 15, l = 40) => [calcAutoPanVelocity(e.x, l, s.width - l) * c, calcAutoPanVelocity(e.y, l, s.height - l) * c], getBoundsOfBoxes = (e, s) => ({
224
+ x: Math.min(e.x, s.x),
225
+ y: Math.min(e.y, s.y),
226
+ x2: Math.max(e.x2, s.x2),
227
+ y2: Math.max(e.y2, s.y2)
228
+ }), rectToBox = ({ x: e, y: s, width: c, height: l }) => ({
229
+ x: e,
230
+ y: s,
231
+ x2: e + c,
232
+ y2: s + l
233
+ }), boxToRect = ({ x: e, y: s, x2: c, y2: l }) => ({
234
+ x: e,
235
+ y: s,
236
+ width: c - e,
237
+ height: l - s
238
+ }), nodeToRect = (e, s = [0, 0]) => {
239
+ let { x: c, y: l } = isInternalNodeBase(e) ? e.internals.positionAbsolute : getNodePositionWithOrigin(e, s);
240
+ return {
241
+ x: c,
242
+ y: l,
243
+ width: e.measured?.width ?? e.width ?? e.initialWidth ?? 0,
244
+ height: e.measured?.height ?? e.height ?? e.initialHeight ?? 0
245
+ };
246
+ }, nodeToBox = (e, s = [0, 0]) => {
247
+ let { x: c, y: l } = isInternalNodeBase(e) ? e.internals.positionAbsolute : getNodePositionWithOrigin(e, s);
248
+ return {
249
+ x: c,
250
+ y: l,
251
+ x2: c + (e.measured?.width ?? e.width ?? e.initialWidth ?? 0),
252
+ y2: l + (e.measured?.height ?? e.height ?? e.initialHeight ?? 0)
253
+ };
254
+ }, getBoundsOfRects = (e, s) => boxToRect(getBoundsOfBoxes(rectToBox(e), rectToBox(s))), getOverlappingArea = (e, s) => {
255
+ let c = Math.max(0, Math.min(e.x + e.width, s.x + s.width) - Math.max(e.x, s.x)), l = Math.max(0, Math.min(e.y + e.height, s.y + s.height) - Math.max(e.y, s.y));
256
+ return Math.ceil(c * l);
257
+ }, isRectObject = (e) => isNumeric(e.width) && isNumeric(e.height) && isNumeric(e.x) && isNumeric(e.y), isNumeric = (e) => !isNaN(e) && isFinite(e), devWarn = (e, s) => {
258
+ process.env.NODE_ENV === "development" && console.warn(`[React Flow]: ${s} Help: https://reactflow.dev/error#${e}`);
259
+ }, snapPosition = (e, s = [1, 1]) => ({
260
+ x: s[0] * Math.round(e.x / s[0]),
261
+ y: s[1] * Math.round(e.y / s[1])
262
+ }), pointToRendererPoint = ({ x: e, y: s }, [c, l, u], d = !1, f = [1, 1]) => {
263
+ let p = {
264
+ x: (e - c) / u,
265
+ y: (s - l) / u
266
+ };
267
+ return d ? snapPosition(p, f) : p;
268
+ }, rendererPointToPoint = ({ x: e, y: s }, [c, l, u]) => ({
269
+ x: e * u + c,
270
+ y: s * u + l
271
+ });
272
+ function parsePadding(e, s) {
273
+ if (typeof e == "number") return Math.floor((s - s / (1 + e)) * .5);
274
+ if (typeof e == "string" && e.endsWith("px")) {
275
+ let s = parseFloat(e);
276
+ if (!Number.isNaN(s)) return Math.floor(s);
277
+ }
278
+ if (typeof e == "string" && e.endsWith("%")) {
279
+ let c = parseFloat(e);
280
+ if (!Number.isNaN(c)) return Math.floor(s * c * .01);
281
+ }
282
+ return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`), 0;
283
+ }
284
+ function parsePaddings(e, s, c) {
285
+ if (typeof e == "string" || typeof e == "number") {
286
+ let l = parsePadding(e, c), u = parsePadding(e, s);
287
+ return {
288
+ top: l,
289
+ right: u,
290
+ bottom: l,
291
+ left: u,
292
+ x: u * 2,
293
+ y: l * 2
294
+ };
295
+ }
296
+ if (typeof e == "object") {
297
+ let l = parsePadding(e.top ?? e.y ?? 0, c), u = parsePadding(e.bottom ?? e.y ?? 0, c), d = parsePadding(e.left ?? e.x ?? 0, s), f = parsePadding(e.right ?? e.x ?? 0, s);
298
+ return {
299
+ top: l,
300
+ right: f,
301
+ bottom: u,
302
+ left: d,
303
+ x: d + f,
304
+ y: l + u
305
+ };
306
+ }
307
+ return {
308
+ top: 0,
309
+ right: 0,
310
+ bottom: 0,
311
+ left: 0,
312
+ x: 0,
313
+ y: 0
314
+ };
315
+ }
316
+ function calculateAppliedPaddings(e, s, c, l, u, d) {
317
+ let { x: f, y: p } = rendererPointToPoint(e, [
318
+ s,
319
+ c,
320
+ l
321
+ ]), { x: m, y: h } = rendererPointToPoint({
322
+ x: e.x + e.width,
323
+ y: e.y + e.height
324
+ }, [
325
+ s,
326
+ c,
327
+ l
328
+ ]), g = u - m, _ = d - h;
329
+ return {
330
+ left: Math.floor(f),
331
+ top: Math.floor(p),
332
+ right: Math.floor(g),
333
+ bottom: Math.floor(_)
334
+ };
335
+ }
336
+ var getViewportForBounds = (e, s, c, l, u, d) => {
337
+ let f = parsePaddings(d, s, c), p = (s - f.x) / e.width, m = (c - f.y) / e.height, h = clamp(Math.min(p, m), l, u), g = e.x + e.width / 2, _ = e.y + e.height / 2, v = s / 2 - g * h, y = c / 2 - _ * h, b = calculateAppliedPaddings(e, v, y, h, s, c), x = {
338
+ left: Math.min(b.left - f.left, 0),
339
+ top: Math.min(b.top - f.top, 0),
340
+ right: Math.min(b.right - f.right, 0),
341
+ bottom: Math.min(b.bottom - f.bottom, 0)
342
+ };
343
+ return {
344
+ x: v - x.left + x.right,
345
+ y: y - x.top + x.bottom,
346
+ zoom: h
347
+ };
348
+ }, isMacOs = () => typeof navigator < "u" && navigator?.userAgent?.indexOf("Mac") >= 0;
349
+ function isCoordinateExtent(e) {
350
+ return e != null && e !== "parent";
351
+ }
352
+ function getNodeDimensions(e) {
353
+ return {
354
+ width: e.measured?.width ?? e.width ?? e.initialWidth ?? 0,
355
+ height: e.measured?.height ?? e.height ?? e.initialHeight ?? 0
356
+ };
357
+ }
358
+ function nodeHasDimensions(e) {
359
+ return (e.measured?.width ?? e.width ?? e.initialWidth) !== void 0 && (e.measured?.height ?? e.height ?? e.initialHeight) !== void 0;
360
+ }
361
+ function evaluateAbsolutePosition(e, s = {
362
+ width: 0,
363
+ height: 0
364
+ }, c, l, u) {
365
+ let d = { ...e }, f = l.get(c);
366
+ if (f) {
367
+ let e = f.origin || u;
368
+ d.x += f.internals.positionAbsolute.x - (s.width ?? 0) * e[0], d.y += f.internals.positionAbsolute.y - (s.height ?? 0) * e[1];
369
+ }
370
+ return d;
371
+ }
372
+ function areSetsEqual(e, s) {
373
+ if (e.size !== s.size) return !1;
374
+ for (let c of e) if (!s.has(c)) return !1;
375
+ return !0;
376
+ }
377
+ function withResolvers() {
378
+ let e, s;
379
+ return {
380
+ promise: new Promise((c, l) => {
381
+ e = c, s = l;
382
+ }),
383
+ resolve: e,
384
+ reject: s
385
+ };
386
+ }
387
+ function mergeAriaLabelConfig(e) {
388
+ return {
389
+ ...defaultAriaLabelConfig,
390
+ ...e || {}
391
+ };
392
+ }
393
+ function getPointerPosition(e, { snapGrid: s = [0, 0], snapToGrid: c = !1, transform: l, containerBounds: u }) {
394
+ let { x: d, y: f } = getEventPosition(e), p = pointToRendererPoint({
395
+ x: d - (u?.left ?? 0),
396
+ y: f - (u?.top ?? 0)
397
+ }, l), { x: m, y: h } = c ? snapPosition(p, s) : p;
398
+ return {
399
+ xSnapped: m,
400
+ ySnapped: h,
401
+ ...p
402
+ };
403
+ }
404
+ var getDimensions = (e) => ({
405
+ width: e.offsetWidth,
406
+ height: e.offsetHeight
407
+ }), getHostForElement = (e) => e?.getRootNode?.() || window?.document, inputTags = [
408
+ "INPUT",
409
+ "SELECT",
410
+ "TEXTAREA"
411
+ ];
412
+ function isInputDOMNode(e) {
413
+ let s = e.composedPath?.()?.[0] || e.target;
414
+ return s?.nodeType === 1 ? inputTags.includes(s.nodeName) || s.hasAttribute("contenteditable") || !!s.closest(".nokey") : !1;
415
+ }
416
+ var isMouseEvent = (e) => "clientX" in e, getEventPosition = (e, s) => {
417
+ let c = isMouseEvent(e), l = c ? e.clientX : e.touches?.[0].clientX, u = c ? e.clientY : e.touches?.[0].clientY;
418
+ return {
419
+ x: l - (s?.left ?? 0),
420
+ y: u - (s?.top ?? 0)
421
+ };
422
+ }, getHandleBounds = (e, s, c, l, u) => {
423
+ let d = s.querySelectorAll(`.${e}`);
424
+ return !d || !d.length ? null : Array.from(d).map((s) => {
425
+ let d = s.getBoundingClientRect();
426
+ return {
427
+ id: s.getAttribute("data-handleid"),
428
+ type: e,
429
+ nodeId: u,
430
+ position: s.getAttribute("data-handlepos"),
431
+ x: (d.left - c.left) / l,
432
+ y: (d.top - c.top) / l,
433
+ ...getDimensions(s)
434
+ };
435
+ });
436
+ };
437
+ function getBezierEdgeCenter({ sourceX: e, sourceY: s, targetX: c, targetY: l, sourceControlX: u, sourceControlY: d, targetControlX: f, targetControlY: p }) {
438
+ let m = e * .125 + u * .375 + f * .375 + c * .125, h = s * .125 + d * .375 + p * .375 + l * .125;
439
+ return [
440
+ m,
441
+ h,
442
+ Math.abs(m - e),
443
+ Math.abs(h - s)
444
+ ];
445
+ }
446
+ function calculateControlOffset(e, s) {
447
+ return e >= 0 ? .5 * e : s * 25 * Math.sqrt(-e);
448
+ }
449
+ function getControlWithCurvature({ pos: e, x1: s, y1: c, x2: l, y2: u, c: d }) {
450
+ switch (e) {
451
+ case Position.Left: return [s - calculateControlOffset(s - l, d), c];
452
+ case Position.Right: return [s + calculateControlOffset(l - s, d), c];
453
+ case Position.Top: return [s, c - calculateControlOffset(c - u, d)];
454
+ case Position.Bottom: return [s, c + calculateControlOffset(u - c, d)];
455
+ }
456
+ }
457
+ function getBezierPath({ sourceX: e, sourceY: s, sourcePosition: c = Position.Bottom, targetX: l, targetY: u, targetPosition: d = Position.Top, curvature: f = .25 }) {
458
+ let [p, m] = getControlWithCurvature({
459
+ pos: c,
460
+ x1: e,
461
+ y1: s,
462
+ x2: l,
463
+ y2: u,
464
+ c: f
465
+ }), [h, g] = getControlWithCurvature({
466
+ pos: d,
467
+ x1: l,
468
+ y1: u,
469
+ x2: e,
470
+ y2: s,
471
+ c: f
472
+ }), [_, v, y, b] = getBezierEdgeCenter({
473
+ sourceX: e,
474
+ sourceY: s,
475
+ targetX: l,
476
+ targetY: u,
477
+ sourceControlX: p,
478
+ sourceControlY: m,
479
+ targetControlX: h,
480
+ targetControlY: g
481
+ });
482
+ return [
483
+ `M${e},${s} C${p},${m} ${h},${g} ${l},${u}`,
484
+ _,
485
+ v,
486
+ y,
487
+ b
488
+ ];
489
+ }
490
+ function getEdgeCenter({ sourceX: e, sourceY: s, targetX: c, targetY: l }) {
491
+ let u = Math.abs(c - e) / 2, d = c < e ? c + u : c - u, f = Math.abs(l - s) / 2;
492
+ return [
493
+ d,
494
+ l < s ? l + f : l - f,
495
+ u,
496
+ f
497
+ ];
498
+ }
499
+ function getElevatedEdgeZIndex({ sourceNode: e, targetNode: s, selected: c = !1, zIndex: l = 0, elevateOnSelect: u = !1, zIndexMode: d = "basic" }) {
500
+ return d === "manual" ? l : (u && c ? l + 1e3 : l) + Math.max(e.parentId || u && e.selected ? e.internals.z : 0, s.parentId || u && s.selected ? s.internals.z : 0);
501
+ }
502
+ function isEdgeVisible({ sourceNode: e, targetNode: s, width: c, height: l, transform: u }) {
503
+ let d = getBoundsOfBoxes(nodeToBox(e), nodeToBox(s));
504
+ return d.x === d.x2 && (d.x2 += 1), d.y === d.y2 && (d.y2 += 1), getOverlappingArea({
505
+ x: -u[0] / u[2],
506
+ y: -u[1] / u[2],
507
+ width: c / u[2],
508
+ height: l / u[2]
509
+ }, boxToRect(d)) > 0;
510
+ }
511
+ var getEdgeId = ({ source: e, sourceHandle: s, target: c, targetHandle: l }) => `xy-edge__${e}${s || ""}-${c}${l || ""}`, connectionExists = (e, s) => s.some((s) => s.source === e.source && s.target === e.target && (s.sourceHandle === e.sourceHandle || !s.sourceHandle && !e.sourceHandle) && (s.targetHandle === e.targetHandle || !s.targetHandle && !e.targetHandle)), addEdge = (e, s, c = {}) => {
512
+ if (!e.source || !e.target) return devWarn("006", errorMessages.error006()), s;
513
+ let l = c.getEdgeId || getEdgeId, u;
514
+ return u = isEdgeBase(e) ? { ...e } : {
515
+ ...e,
516
+ id: l(e)
517
+ }, connectionExists(u, s) ? s : (u.sourceHandle === null && delete u.sourceHandle, u.targetHandle === null && delete u.targetHandle, s.concat(u));
518
+ };
519
+ function getStraightPath({ sourceX: e, sourceY: s, targetX: c, targetY: l }) {
520
+ let [u, d, f, p] = getEdgeCenter({
521
+ sourceX: e,
522
+ sourceY: s,
523
+ targetX: c,
524
+ targetY: l
525
+ });
526
+ return [
527
+ `M ${e},${s}L ${c},${l}`,
528
+ u,
529
+ d,
530
+ f,
531
+ p
532
+ ];
533
+ }
534
+ var handleDirections = {
535
+ [Position.Left]: {
536
+ x: -1,
537
+ y: 0
538
+ },
539
+ [Position.Right]: {
540
+ x: 1,
541
+ y: 0
542
+ },
543
+ [Position.Top]: {
544
+ x: 0,
545
+ y: -1
546
+ },
547
+ [Position.Bottom]: {
548
+ x: 0,
549
+ y: 1
550
+ }
551
+ }, getDirection = ({ source: e, sourcePosition: s = Position.Bottom, target: c }) => s === Position.Left || s === Position.Right ? e.x < c.x ? {
552
+ x: 1,
553
+ y: 0
554
+ } : {
555
+ x: -1,
556
+ y: 0
557
+ } : e.y < c.y ? {
558
+ x: 0,
559
+ y: 1
560
+ } : {
561
+ x: 0,
562
+ y: -1
563
+ }, distance = (e, s) => Math.sqrt((s.x - e.x) ** 2 + (s.y - e.y) ** 2);
564
+ function getPoints({ source: e, sourcePosition: s = Position.Bottom, target: c, targetPosition: l = Position.Top, center: u, offset: d, stepPosition: f }) {
565
+ let p = handleDirections[s], m = handleDirections[l], h = {
566
+ x: e.x + p.x * d,
567
+ y: e.y + p.y * d
568
+ }, g = {
569
+ x: c.x + m.x * d,
570
+ y: c.y + m.y * d
571
+ }, _ = getDirection({
572
+ source: h,
573
+ sourcePosition: s,
574
+ target: g
575
+ }), v = _.x === 0 ? "y" : "x", y = _[v], b = [], x, S, C = {
576
+ x: 0,
577
+ y: 0
578
+ }, T = {
579
+ x: 0,
580
+ y: 0
581
+ }, [, , E, D] = getEdgeCenter({
582
+ sourceX: e.x,
583
+ sourceY: e.y,
584
+ targetX: c.x,
585
+ targetY: c.y
586
+ });
587
+ if (p[v] * m[v] === -1) {
588
+ v === "x" ? (x = u.x ?? h.x + (g.x - h.x) * f, S = u.y ?? (h.y + g.y) / 2) : (x = u.x ?? (h.x + g.x) / 2, S = u.y ?? h.y + (g.y - h.y) * f);
589
+ let e = [{
590
+ x,
591
+ y: h.y
592
+ }, {
593
+ x,
594
+ y: g.y
595
+ }], s = [{
596
+ x: h.x,
597
+ y: S
598
+ }, {
599
+ x: g.x,
600
+ y: S
601
+ }];
602
+ b = p[v] === y ? v === "x" ? e : s : v === "x" ? s : e;
603
+ } else {
604
+ let u = [{
605
+ x: h.x,
606
+ y: g.y
607
+ }], f = [{
608
+ x: g.x,
609
+ y: h.y
610
+ }];
611
+ if (b = v === "x" ? p.x === y ? f : u : p.y === y ? u : f, s === l) {
612
+ let s = Math.abs(e[v] - c[v]);
613
+ if (s <= d) {
614
+ let l = Math.min(d - 1, d - s);
615
+ p[v] === y ? C[v] = (h[v] > e[v] ? -1 : 1) * l : T[v] = (g[v] > c[v] ? -1 : 1) * l;
616
+ }
617
+ }
618
+ if (s !== l) {
619
+ let e = v === "x" ? "y" : "x", s = p[v] === m[e], c = h[e] > g[e], l = h[e] < g[e];
620
+ (p[v] === 1 && (!s && c || s && l) || p[v] !== 1 && (!s && l || s && c)) && (b = v === "x" ? u : f);
621
+ }
622
+ let _ = {
623
+ x: h.x + C.x,
624
+ y: h.y + C.y
625
+ }, w = {
626
+ x: g.x + T.x,
627
+ y: g.y + T.y
628
+ };
629
+ Math.max(Math.abs(_.x - b[0].x), Math.abs(w.x - b[0].x)) >= Math.max(Math.abs(_.y - b[0].y), Math.abs(w.y - b[0].y)) ? (x = (_.x + w.x) / 2, S = b[0].y) : (x = b[0].x, S = (_.y + w.y) / 2);
630
+ }
631
+ return [
632
+ [
633
+ e,
634
+ {
635
+ x: h.x + C.x,
636
+ y: h.y + C.y
637
+ },
638
+ ...b,
639
+ {
640
+ x: g.x + T.x,
641
+ y: g.y + T.y
642
+ },
643
+ c
644
+ ],
645
+ x,
646
+ S,
647
+ E,
648
+ D
649
+ ];
650
+ }
651
+ function getBend(e, s, c, l) {
652
+ let u = Math.min(distance(e, s) / 2, distance(s, c) / 2, l), { x: d, y: f } = s;
653
+ if (e.x === d && d === c.x || e.y === f && f === c.y) return `L${d} ${f}`;
654
+ if (e.y === f) {
655
+ let s = e.x < c.x ? -1 : 1, l = e.y < c.y ? 1 : -1;
656
+ return `L ${d + u * s},${f}Q ${d},${f} ${d},${f + u * l}`;
657
+ }
658
+ let p = e.x < c.x ? 1 : -1;
659
+ return `L ${d},${f + u * (e.y < c.y ? -1 : 1)}Q ${d},${f} ${d + u * p},${f}`;
660
+ }
661
+ function getSmoothStepPath({ sourceX: e, sourceY: s, sourcePosition: c = Position.Bottom, targetX: l, targetY: u, targetPosition: d = Position.Top, borderRadius: f = 5, centerX: p, centerY: m, offset: h = 20, stepPosition: g = .5 }) {
662
+ let [_, v, y, b, x] = getPoints({
663
+ source: {
664
+ x: e,
665
+ y: s
666
+ },
667
+ sourcePosition: c,
668
+ target: {
669
+ x: l,
670
+ y: u
671
+ },
672
+ targetPosition: d,
673
+ center: {
674
+ x: p,
675
+ y: m
676
+ },
677
+ offset: h,
678
+ stepPosition: g
679
+ });
680
+ return [
681
+ _.reduce((e, s, c) => {
682
+ let l = "";
683
+ return l = c > 0 && c < _.length - 1 ? getBend(_[c - 1], s, _[c + 1], f) : `${c === 0 ? "M" : "L"}${s.x} ${s.y}`, e += l, e;
684
+ }, ""),
685
+ v,
686
+ y,
687
+ b,
688
+ x
689
+ ];
690
+ }
691
+ function isNodeInitialized(e) {
692
+ return e && !!(e.internals.handleBounds || e.handles?.length) && !!(e.measured.width || e.width || e.initialWidth);
693
+ }
694
+ function getEdgePosition(e) {
695
+ let { sourceNode: s, targetNode: c } = e;
696
+ if (!isNodeInitialized(s) || !isNodeInitialized(c)) return null;
697
+ let l = s.internals.handleBounds || toHandleBounds(s.handles), u = c.internals.handleBounds || toHandleBounds(c.handles), d = getHandle$1(l?.source ?? [], e.sourceHandle), f = getHandle$1(e.connectionMode === ConnectionMode.Strict ? u?.target ?? [] : (u?.target ?? []).concat(u?.source ?? []), e.targetHandle);
698
+ if (!d || !f) return e.onError?.("008", errorMessages.error008(d ? "target" : "source", {
699
+ id: e.id,
700
+ sourceHandle: e.sourceHandle,
701
+ targetHandle: e.targetHandle
702
+ })), null;
703
+ let p = d?.position || Position.Bottom, h = f?.position || Position.Top, g = getHandlePosition(s, d, p), _ = getHandlePosition(c, f, h);
704
+ return {
705
+ sourceX: g.x,
706
+ sourceY: g.y,
707
+ targetX: _.x,
708
+ targetY: _.y,
709
+ sourcePosition: p,
710
+ targetPosition: h
711
+ };
712
+ }
713
+ function toHandleBounds(e) {
714
+ if (!e) return null;
715
+ let s = [], c = [];
716
+ for (let l of e) l.width = l.width ?? 1, l.height = l.height ?? 1, l.type === "source" ? s.push(l) : l.type === "target" && c.push(l);
717
+ return {
718
+ source: s,
719
+ target: c
720
+ };
721
+ }
722
+ function getHandlePosition(e, s, c = Position.Left, l = !1) {
723
+ let u = (s?.x ?? 0) + e.internals.positionAbsolute.x, d = (s?.y ?? 0) + e.internals.positionAbsolute.y, { width: f, height: p } = s ?? getNodeDimensions(e);
724
+ if (l) return {
725
+ x: u + f / 2,
726
+ y: d + p / 2
727
+ };
728
+ switch (s?.position ?? c) {
729
+ case Position.Top: return {
730
+ x: u + f / 2,
731
+ y: d
732
+ };
733
+ case Position.Right: return {
734
+ x: u + f,
735
+ y: d + p / 2
736
+ };
737
+ case Position.Bottom: return {
738
+ x: u + f / 2,
739
+ y: d + p
740
+ };
741
+ case Position.Left: return {
742
+ x: u,
743
+ y: d + p / 2
744
+ };
745
+ }
746
+ }
747
+ function getHandle$1(e, s) {
748
+ return e && (s ? e.find((e) => e.id === s) : e[0]) || null;
749
+ }
750
+ function getMarkerId(e, s) {
751
+ return e ? typeof e == "string" ? e : `${s ? `${s}__` : ""}${Object.keys(e).sort().map((s) => `${s}=${e[s]}`).join("&")}` : "";
752
+ }
753
+ function createMarkerIds(e, { id: s, defaultColor: c, defaultMarkerStart: l, defaultMarkerEnd: u }) {
754
+ let d = /* @__PURE__ */ new Set();
755
+ return e.reduce((e, f) => ([f.markerStart || l, f.markerEnd || u].forEach((l) => {
756
+ if (l && typeof l == "object") {
757
+ let u = getMarkerId(l, s);
758
+ d.has(u) || (e.push({
759
+ id: u,
760
+ color: l.color || c,
761
+ ...l
762
+ }), d.add(u));
763
+ }
764
+ }), e), []).sort((e, s) => e.id.localeCompare(s.id));
765
+ }
766
+ var SELECTED_NODE_Z = 1e3, ROOT_PARENT_Z_INCREMENT = 10, defaultOptions = {
767
+ nodeOrigin: [0, 0],
768
+ nodeExtent: infiniteExtent,
769
+ elevateNodesOnSelect: !0,
770
+ zIndexMode: "basic",
771
+ defaults: {}
772
+ }, adoptUserNodesDefaultOptions = {
773
+ ...defaultOptions,
774
+ checkEquality: !0
775
+ };
776
+ function mergeObjects(e, s) {
777
+ let c = { ...e };
778
+ for (let e in s) s[e] !== void 0 && (c[e] = s[e]);
779
+ return c;
780
+ }
781
+ function updateAbsolutePositions(e, s, c) {
782
+ let l = mergeObjects(defaultOptions, c);
783
+ for (let c of e.values()) if (c.parentId) updateChildNode(c, e, s, l);
784
+ else {
785
+ let e = clampPosition(getNodePositionWithOrigin(c, l.nodeOrigin), isCoordinateExtent(c.extent) ? c.extent : l.nodeExtent, getNodeDimensions(c));
786
+ c.internals.positionAbsolute = e;
787
+ }
788
+ }
789
+ function parseHandles(e, s) {
790
+ if (!e.handles) return e.measured ? s?.internals.handleBounds : void 0;
791
+ let c = [], l = [];
792
+ for (let s of e.handles) {
793
+ let u = {
794
+ id: s.id,
795
+ width: s.width ?? 1,
796
+ height: s.height ?? 1,
797
+ nodeId: e.id,
798
+ x: s.x,
799
+ y: s.y,
800
+ position: s.position,
801
+ type: s.type
802
+ };
803
+ s.type === "source" ? c.push(u) : s.type === "target" && l.push(u);
804
+ }
805
+ return {
806
+ source: c,
807
+ target: l
808
+ };
809
+ }
810
+ function isManualZIndexMode(e) {
811
+ return e === "manual";
812
+ }
813
+ function adoptUserNodes(e, s, c, l = {}) {
814
+ let u = mergeObjects(adoptUserNodesDefaultOptions, l), d = { i: 0 }, f = new Map(s), p = u?.elevateNodesOnSelect && !isManualZIndexMode(u.zIndexMode) ? SELECTED_NODE_Z : 0, m = e.length > 0;
815
+ s.clear(), c.clear();
816
+ for (let h of e) {
817
+ let e = f.get(h.id);
818
+ if (u.checkEquality && h === e?.internals.userNode) s.set(h.id, e);
819
+ else {
820
+ let c = clampPosition(getNodePositionWithOrigin(h, u.nodeOrigin), isCoordinateExtent(h.extent) ? h.extent : u.nodeExtent, getNodeDimensions(h));
821
+ e = {
822
+ ...u.defaults,
823
+ ...h,
824
+ measured: {
825
+ width: h.measured?.width,
826
+ height: h.measured?.height
827
+ },
828
+ internals: {
829
+ positionAbsolute: c,
830
+ handleBounds: parseHandles(h, e),
831
+ z: calculateZ(h, p, u.zIndexMode),
832
+ userNode: h
833
+ }
834
+ }, s.set(h.id, e);
835
+ }
836
+ (e.measured === void 0 || e.measured.width === void 0 || e.measured.height === void 0) && !e.hidden && (m = !1), h.parentId && updateChildNode(e, s, c, l, d);
837
+ }
838
+ return m;
839
+ }
840
+ function updateParentLookup(e, s) {
841
+ if (!e.parentId) return;
842
+ let c = s.get(e.parentId);
843
+ c ? c.set(e.id, e) : s.set(e.parentId, new Map([[e.id, e]]));
844
+ }
845
+ function updateChildNode(e, s, c, l, u) {
846
+ let { elevateNodesOnSelect: d, nodeOrigin: f, nodeExtent: p, zIndexMode: m } = mergeObjects(defaultOptions, l), h = e.parentId, g = s.get(h);
847
+ if (!g) {
848
+ console.warn(`Parent node ${h} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);
849
+ return;
850
+ }
851
+ updateParentLookup(e, c), u && !g.parentId && g.internals.rootParentIndex === void 0 && m === "auto" && (g.internals.rootParentIndex = ++u.i, g.internals.z = g.internals.z + u.i * ROOT_PARENT_Z_INCREMENT), u && g.internals.rootParentIndex !== void 0 && (u.i = g.internals.rootParentIndex);
852
+ let { x: _, y: v, z: y } = calculateChildXYZ(e, g, f, p, d && !isManualZIndexMode(m) ? SELECTED_NODE_Z : 0, m), { positionAbsolute: b } = e.internals, x = _ !== b.x || v !== b.y;
853
+ (x || y !== e.internals.z) && s.set(e.id, {
854
+ ...e,
855
+ internals: {
856
+ ...e.internals,
857
+ positionAbsolute: x ? {
858
+ x: _,
859
+ y: v
860
+ } : b,
861
+ z: y
862
+ }
863
+ });
864
+ }
865
+ function calculateZ(e, s, c) {
866
+ let l = isNumeric(e.zIndex) ? e.zIndex : 0;
867
+ return isManualZIndexMode(c) ? l : l + (e.selected ? s : 0);
868
+ }
869
+ function calculateChildXYZ(e, s, c, l, u, d) {
870
+ let { x: f, y: p } = s.internals.positionAbsolute, m = getNodeDimensions(e), h = getNodePositionWithOrigin(e, c), g = isCoordinateExtent(e.extent) ? clampPosition(h, e.extent, m) : h, _ = clampPosition({
871
+ x: f + g.x,
872
+ y: p + g.y
873
+ }, l, m);
874
+ e.extent === "parent" && (_ = clampPositionToParent(_, m, s));
875
+ let v = calculateZ(e, u, d), y = s.internals.z ?? 0;
876
+ return {
877
+ x: _.x,
878
+ y: _.y,
879
+ z: y >= v ? y + 1 : v
880
+ };
881
+ }
882
+ function handleExpandParent(e, s, c, l = [0, 0]) {
883
+ let u = [], d = /* @__PURE__ */ new Map();
884
+ for (let c of e) {
885
+ let e = s.get(c.parentId);
886
+ if (!e) continue;
887
+ let l = getBoundsOfRects(d.get(c.parentId)?.expandedRect ?? nodeToRect(e), c.rect);
888
+ d.set(c.parentId, {
889
+ expandedRect: l,
890
+ parent: e
891
+ });
892
+ }
893
+ return d.size > 0 && d.forEach(({ expandedRect: s, parent: d }, f) => {
894
+ let p = d.internals.positionAbsolute, m = getNodeDimensions(d), h = d.origin ?? l, g = s.x < p.x ? Math.round(Math.abs(p.x - s.x)) : 0, _ = s.y < p.y ? Math.round(Math.abs(p.y - s.y)) : 0, v = Math.max(m.width, Math.round(s.width)), y = Math.max(m.height, Math.round(s.height)), b = (v - m.width) * h[0], x = (y - m.height) * h[1];
895
+ (g > 0 || _ > 0 || b || x) && (u.push({
896
+ id: f,
897
+ type: "position",
898
+ position: {
899
+ x: d.position.x - g + b,
900
+ y: d.position.y - _ + x
901
+ }
902
+ }), c.get(f)?.forEach((s) => {
903
+ e.some((e) => e.id === s.id) || u.push({
904
+ id: s.id,
905
+ type: "position",
906
+ position: {
907
+ x: s.position.x + g,
908
+ y: s.position.y + _
909
+ }
910
+ });
911
+ })), (m.width < s.width || m.height < s.height || g || _) && u.push({
912
+ id: f,
913
+ type: "dimensions",
914
+ setAttributes: !0,
915
+ dimensions: {
916
+ width: v + (g ? h[0] * g - b : 0),
917
+ height: y + (_ ? h[1] * _ - x : 0)
918
+ }
919
+ });
920
+ }), u;
921
+ }
922
+ function updateNodeInternals(e, s, c, l, u, d, f) {
923
+ let p = l?.querySelector(".xyflow__viewport"), m = !1;
924
+ if (!p) return {
925
+ changes: [],
926
+ updatedInternals: m
927
+ };
928
+ let h = [], g = window.getComputedStyle(p), { m22: _ } = new window.DOMMatrixReadOnly(g.transform), v = [];
929
+ for (let l of e.values()) {
930
+ let e = s.get(l.id);
931
+ if (!e) continue;
932
+ if (e.hidden) {
933
+ s.set(e.id, {
934
+ ...e,
935
+ internals: {
936
+ ...e.internals,
937
+ handleBounds: void 0
938
+ }
939
+ }), m = !0;
940
+ continue;
941
+ }
942
+ let p = getDimensions(l.nodeElement), g = e.measured.width !== p.width || e.measured.height !== p.height;
943
+ if (p.width && p.height && (g || !e.internals.handleBounds || l.force)) {
944
+ let y = l.nodeElement.getBoundingClientRect(), b = isCoordinateExtent(e.extent) ? e.extent : d, { positionAbsolute: x } = e.internals;
945
+ e.parentId && e.extent === "parent" ? x = clampPositionToParent(x, p, s.get(e.parentId)) : b && (x = clampPosition(x, b, p));
946
+ let S = {
947
+ ...e,
948
+ measured: p,
949
+ internals: {
950
+ ...e.internals,
951
+ positionAbsolute: x,
952
+ handleBounds: {
953
+ source: getHandleBounds("source", l.nodeElement, y, _, e.id),
954
+ target: getHandleBounds("target", l.nodeElement, y, _, e.id)
955
+ }
956
+ }
957
+ };
958
+ s.set(e.id, S), e.parentId && updateChildNode(S, s, c, {
959
+ nodeOrigin: u,
960
+ zIndexMode: f
961
+ }), m = !0, g && (h.push({
962
+ id: e.id,
963
+ type: "dimensions",
964
+ dimensions: p
965
+ }), e.expandParent && e.parentId && v.push({
966
+ id: e.id,
967
+ parentId: e.parentId,
968
+ rect: nodeToRect(S, u)
969
+ }));
970
+ }
971
+ }
972
+ if (v.length > 0) {
973
+ let e = handleExpandParent(v, s, c, u);
974
+ h.push(...e);
975
+ }
976
+ return {
977
+ changes: h,
978
+ updatedInternals: m
979
+ };
980
+ }
981
+ async function panBy({ delta: e, panZoom: s, transform: c, translateExtent: l, width: u, height: d }) {
982
+ if (!s || !e.x && !e.y) return Promise.resolve(!1);
983
+ let f = await s.setViewportConstrained({
984
+ x: c[0] + e.x,
985
+ y: c[1] + e.y,
986
+ zoom: c[2]
987
+ }, [[0, 0], [u, d]], l), p = !!f && (f.x !== c[0] || f.y !== c[1] || f.k !== c[2]);
988
+ return Promise.resolve(p);
989
+ }
990
+ function addConnectionToLookup(e, s, c, l, u, d) {
991
+ let f = u, p = l.get(f) || /* @__PURE__ */ new Map();
992
+ l.set(f, p.set(c, s)), f = `${u}-${e}`;
993
+ let m = l.get(f) || /* @__PURE__ */ new Map();
994
+ if (l.set(f, m.set(c, s)), d) {
995
+ f = `${u}-${e}-${d}`;
996
+ let p = l.get(f) || /* @__PURE__ */ new Map();
997
+ l.set(f, p.set(c, s));
998
+ }
999
+ }
1000
+ function updateConnectionLookup(e, s, c) {
1001
+ e.clear(), s.clear();
1002
+ for (let l of c) {
1003
+ let { source: c, target: u, sourceHandle: d = null, targetHandle: f = null } = l, p = {
1004
+ edgeId: l.id,
1005
+ source: c,
1006
+ target: u,
1007
+ sourceHandle: d,
1008
+ targetHandle: f
1009
+ }, m = `${c}-${d}--${u}-${f}`;
1010
+ addConnectionToLookup("source", p, `${u}-${f}--${c}-${d}`, e, c, d), addConnectionToLookup("target", p, m, e, u, f), s.set(l.id, l);
1011
+ }
1012
+ }
1013
+ function isParentSelected(e, s) {
1014
+ if (!e.parentId) return !1;
1015
+ let c = s.get(e.parentId);
1016
+ return c ? c.selected ? !0 : isParentSelected(c, s) : !1;
1017
+ }
1018
+ function hasSelector(e, s, c) {
1019
+ let l = e;
1020
+ do {
1021
+ if (l?.matches?.(s)) return !0;
1022
+ if (l === c) return !1;
1023
+ l = l?.parentElement;
1024
+ } while (l);
1025
+ return !1;
1026
+ }
1027
+ function getDragItems(e, s, c, l) {
1028
+ let u = /* @__PURE__ */ new Map();
1029
+ for (let [d, f] of e) if ((f.selected || f.id === l) && (!f.parentId || !isParentSelected(f, e)) && (f.draggable || s && f.draggable === void 0)) {
1030
+ let s = e.get(d);
1031
+ s && u.set(d, {
1032
+ id: d,
1033
+ position: s.position || {
1034
+ x: 0,
1035
+ y: 0
1036
+ },
1037
+ distance: {
1038
+ x: c.x - s.internals.positionAbsolute.x,
1039
+ y: c.y - s.internals.positionAbsolute.y
1040
+ },
1041
+ extent: s.extent,
1042
+ parentId: s.parentId,
1043
+ origin: s.origin,
1044
+ expandParent: s.expandParent,
1045
+ internals: { positionAbsolute: s.internals.positionAbsolute || {
1046
+ x: 0,
1047
+ y: 0
1048
+ } },
1049
+ measured: {
1050
+ width: s.measured.width ?? 0,
1051
+ height: s.measured.height ?? 0
1052
+ }
1053
+ });
1054
+ }
1055
+ return u;
1056
+ }
1057
+ function getEventHandlerParams({ nodeId: e, dragItems: s, nodeLookup: c, dragging: l = !0 }) {
1058
+ let u = [];
1059
+ for (let [e, d] of s) {
1060
+ let s = c.get(e)?.internals.userNode;
1061
+ s && u.push({
1062
+ ...s,
1063
+ position: d.position,
1064
+ dragging: l
1065
+ });
1066
+ }
1067
+ if (!e) return [u[0], u];
1068
+ let d = c.get(e)?.internals.userNode;
1069
+ return [d ? {
1070
+ ...d,
1071
+ position: s.get(e)?.position || d.position,
1072
+ dragging: l
1073
+ } : u[0], u];
1074
+ }
1075
+ function calculateSnapOffset({ dragItems: e, snapGrid: s, x: c, y: l }) {
1076
+ let u = e.values().next().value;
1077
+ if (!u) return null;
1078
+ let d = {
1079
+ x: c - u.distance.x,
1080
+ y: l - u.distance.y
1081
+ }, f = snapPosition(d, s);
1082
+ return {
1083
+ x: f.x - d.x,
1084
+ y: f.y - d.y
1085
+ };
1086
+ }
1087
+ function XYDrag({ onNodeMouseDown: s, getStoreItems: l, onDragStart: u, onDrag: d, onDragStop: f }) {
1088
+ let p = {
1089
+ x: null,
1090
+ y: null
1091
+ }, m = 0, h = /* @__PURE__ */ new Map(), g = !1, _ = {
1092
+ x: 0,
1093
+ y: 0
1094
+ }, v = null, y = !1, b = null, x = !1, S = !1, C = null;
1095
+ function w({ noDragClassName: w, handleSelector: T, domNode: E, isSelectable: D, nodeId: O, nodeClickDistance: k = 0 }) {
1096
+ b = select_default(E);
1097
+ function A({ x: e, y: s }) {
1098
+ let { nodeLookup: c, nodeExtent: u, snapGrid: f, snapToGrid: m, nodeOrigin: g, onNodeDrag: _, onSelectionDrag: v, onError: y, updateNodePositions: b } = l();
1099
+ p = {
1100
+ x: e,
1101
+ y: s
1102
+ };
1103
+ let x = !1, w = h.size > 1, T = w && u ? rectToBox(getInternalNodesBounds(h)) : null, E = w && m ? calculateSnapOffset({
1104
+ dragItems: h,
1105
+ snapGrid: f,
1106
+ x: e,
1107
+ y: s
1108
+ }) : null;
1109
+ for (let [l, d] of h) {
1110
+ if (!c.has(l)) continue;
1111
+ let p = {
1112
+ x: e - d.distance.x,
1113
+ y: s - d.distance.y
1114
+ };
1115
+ m && (p = E ? {
1116
+ x: Math.round(p.x + E.x),
1117
+ y: Math.round(p.y + E.y)
1118
+ } : snapPosition(p, f));
1119
+ let h = null;
1120
+ if (w && u && !d.extent && T) {
1121
+ let { positionAbsolute: e } = d.internals, s = e.x - T.x + u[0][0], c = e.x + d.measured.width - T.x2 + u[1][0], l = e.y - T.y + u[0][1], f = e.y + d.measured.height - T.y2 + u[1][1];
1122
+ h = [[s, l], [c, f]];
1123
+ }
1124
+ let { position: _, positionAbsolute: v } = calculateNodePosition({
1125
+ nodeId: l,
1126
+ nextPosition: p,
1127
+ nodeLookup: c,
1128
+ nodeExtent: h || u,
1129
+ nodeOrigin: g,
1130
+ onError: y
1131
+ });
1132
+ x = x || d.position.x !== _.x || d.position.y !== _.y, d.position = _, d.internals.positionAbsolute = v;
1133
+ }
1134
+ if (S ||= x, x && (b(h, !0), C && (d || _ || !O && v))) {
1135
+ let [e, s] = getEventHandlerParams({
1136
+ nodeId: O,
1137
+ dragItems: h,
1138
+ nodeLookup: c
1139
+ });
1140
+ d?.(C, h, e, s), _?.(C, e, s), O || v?.(C, s);
1141
+ }
1142
+ }
1143
+ async function j() {
1144
+ if (!v) return;
1145
+ let { transform: e, panBy: s, autoPanSpeed: c, autoPanOnNodeDrag: u } = l();
1146
+ if (!u) {
1147
+ g = !1, cancelAnimationFrame(m);
1148
+ return;
1149
+ }
1150
+ let [d, f] = calcAutoPan(_, v, c);
1151
+ (d !== 0 || f !== 0) && (p.x = (p.x ?? 0) - d / e[2], p.y = (p.y ?? 0) - f / e[2], await s({
1152
+ x: d,
1153
+ y: f
1154
+ }) && A(p)), m = requestAnimationFrame(j);
1155
+ }
1156
+ function N(e) {
1157
+ let { nodeLookup: c, multiSelectionActive: d, nodesDraggable: f, transform: m, snapGrid: g, snapToGrid: _, selectNodesOnDrag: b, onNodeDragStart: x, onSelectionDragStart: S, unselectNodesAndEdges: C } = l();
1158
+ y = !0, (!b || !D) && !d && O && (c.get(O)?.selected || C()), D && b && O && s?.(O);
1159
+ let w = getPointerPosition(e.sourceEvent, {
1160
+ transform: m,
1161
+ snapGrid: g,
1162
+ snapToGrid: _,
1163
+ containerBounds: v
1164
+ });
1165
+ if (p = w, h = getDragItems(c, f, w, O), h.size > 0 && (u || x || !O && S)) {
1166
+ let [s, l] = getEventHandlerParams({
1167
+ nodeId: O,
1168
+ dragItems: h,
1169
+ nodeLookup: c
1170
+ });
1171
+ u?.(e.sourceEvent, h, s, l), x?.(e.sourceEvent, s, l), O || S?.(e.sourceEvent, l);
1172
+ }
1173
+ }
1174
+ let P = drag_default().clickDistance(k).on("start", (e) => {
1175
+ let { domNode: s, nodeDragThreshold: c, transform: u, snapGrid: d, snapToGrid: f } = l();
1176
+ v = s?.getBoundingClientRect() || null, x = !1, S = !1, C = e.sourceEvent, c === 0 && N(e), p = getPointerPosition(e.sourceEvent, {
1177
+ transform: u,
1178
+ snapGrid: d,
1179
+ snapToGrid: f,
1180
+ containerBounds: v
1181
+ }), _ = getEventPosition(e.sourceEvent, v);
1182
+ }).on("drag", (e) => {
1183
+ let { autoPanOnNodeDrag: s, transform: c, snapGrid: u, snapToGrid: d, nodeDragThreshold: f, nodeLookup: m } = l(), b = getPointerPosition(e.sourceEvent, {
1184
+ transform: c,
1185
+ snapGrid: u,
1186
+ snapToGrid: d,
1187
+ containerBounds: v
1188
+ });
1189
+ if (C = e.sourceEvent, (e.sourceEvent.type === "touchmove" && e.sourceEvent.touches.length > 1 || O && !m.has(O)) && (x = !0), !x) {
1190
+ if (!g && s && y && (g = !0, j()), !y) {
1191
+ let s = getEventPosition(e.sourceEvent, v), c = s.x - _.x, l = s.y - _.y;
1192
+ Math.sqrt(c * c + l * l) > f && N(e);
1193
+ }
1194
+ (p.x !== b.xSnapped || p.y !== b.ySnapped) && h && y && (_ = getEventPosition(e.sourceEvent, v), A(b));
1195
+ }
1196
+ }).on("end", (e) => {
1197
+ if (!(!y || x) && (g = !1, y = !1, cancelAnimationFrame(m), h.size > 0)) {
1198
+ let { nodeLookup: s, updateNodePositions: c, onNodeDragStop: u, onSelectionDragStop: d } = l();
1199
+ if (S &&= (c(h, !1), !1), f || u || !O && d) {
1200
+ let [c, l] = getEventHandlerParams({
1201
+ nodeId: O,
1202
+ dragItems: h,
1203
+ nodeLookup: s,
1204
+ dragging: !1
1205
+ });
1206
+ f?.(e.sourceEvent, h, c, l), u?.(e.sourceEvent, c, l), O || d?.(e.sourceEvent, l);
1207
+ }
1208
+ }
1209
+ }).filter((e) => {
1210
+ let s = e.target;
1211
+ return !e.button && (!w || !hasSelector(s, `.${w}`, E)) && (!T || hasSelector(s, T, E));
1212
+ });
1213
+ b.call(P);
1214
+ }
1215
+ function T() {
1216
+ b?.on(".drag", null);
1217
+ }
1218
+ return {
1219
+ update: w,
1220
+ destroy: T
1221
+ };
1222
+ }
1223
+ function getNodesWithinDistance(e, s, c) {
1224
+ let l = [], u = {
1225
+ x: e.x - c,
1226
+ y: e.y - c,
1227
+ width: c * 2,
1228
+ height: c * 2
1229
+ };
1230
+ for (let e of s.values()) getOverlappingArea(u, nodeToRect(e)) > 0 && l.push(e);
1231
+ return l;
1232
+ }
1233
+ var ADDITIONAL_DISTANCE = 250;
1234
+ function getClosestHandle(e, s, c, l) {
1235
+ let u = [], d = Infinity, f = getNodesWithinDistance(e, c, s + ADDITIONAL_DISTANCE);
1236
+ for (let c of f) {
1237
+ let f = [...c.internals.handleBounds?.source ?? [], ...c.internals.handleBounds?.target ?? []];
1238
+ for (let p of f) {
1239
+ if (l.nodeId === p.nodeId && l.type === p.type && l.id === p.id) continue;
1240
+ let { x: f, y: m } = getHandlePosition(c, p, p.position, !0), h = Math.sqrt((f - e.x) ** 2 + (m - e.y) ** 2);
1241
+ h > s || (h < d ? (u = [{
1242
+ ...p,
1243
+ x: f,
1244
+ y: m
1245
+ }], d = h) : h === d && u.push({
1246
+ ...p,
1247
+ x: f,
1248
+ y: m
1249
+ }));
1250
+ }
1251
+ }
1252
+ if (!u.length) return null;
1253
+ if (u.length > 1) {
1254
+ let e = l.type === "source" ? "target" : "source";
1255
+ return u.find((s) => s.type === e) ?? u[0];
1256
+ }
1257
+ return u[0];
1258
+ }
1259
+ function getHandle(e, s, c, l, u, d = !1) {
1260
+ let f = l.get(e);
1261
+ if (!f) return null;
1262
+ let p = u === "strict" ? f.internals.handleBounds?.[s] : [...f.internals.handleBounds?.source ?? [], ...f.internals.handleBounds?.target ?? []], m = (c ? p?.find((e) => e.id === c) : p?.[0]) ?? null;
1263
+ return m && d ? {
1264
+ ...m,
1265
+ ...getHandlePosition(f, m, m.position, !0)
1266
+ } : m;
1267
+ }
1268
+ function getHandleType(e, s) {
1269
+ return e || (s?.classList.contains("target") ? "target" : s?.classList.contains("source") ? "source" : null);
1270
+ }
1271
+ function isConnectionValid(e, s) {
1272
+ let c = null;
1273
+ return s ? c = !0 : e && !s && (c = !1), c;
1274
+ }
1275
+ var alwaysValid = () => !0;
1276
+ function onPointerDown(e, { connectionMode: s, connectionRadius: c, handleId: l, nodeId: u, edgeUpdaterType: d, isTarget: f, domNode: p, nodeLookup: m, lib: h, autoPanOnConnect: g, flowId: _, panBy: v, cancelConnection: y, onConnectStart: b, onConnect: x, onConnectEnd: S, isValidConnection: C = alwaysValid, onReconnectEnd: E, updateConnection: D, getTransform: O, getFromHandle: k, autoPanSpeed: A, dragThreshold: j = 1, handleDomNode: M }) {
1277
+ let N = getHostForElement(e.target), P = 0, F, { x: I, y: L } = getEventPosition(e), R = getHandleType(d, M), z = p?.getBoundingClientRect(), B = !1;
1278
+ if (!z || !R) return;
1279
+ let V = getHandle(u, R, l, m, s);
1280
+ if (!V) return;
1281
+ let H = getEventPosition(e, z), U = !1, W = null, G = !1, K = null;
1282
+ function q() {
1283
+ if (!g || !z) return;
1284
+ let [e, s] = calcAutoPan(H, z, A);
1285
+ v({
1286
+ x: e,
1287
+ y: s
1288
+ }), P = requestAnimationFrame(q);
1289
+ }
1290
+ let J = {
1291
+ ...V,
1292
+ nodeId: u,
1293
+ type: R,
1294
+ position: V.position
1295
+ }, Y = m.get(u), X = {
1296
+ inProgress: !0,
1297
+ isValid: null,
1298
+ from: getHandlePosition(Y, J, Position.Left, !0),
1299
+ fromHandle: J,
1300
+ fromPosition: J.position,
1301
+ fromNode: Y,
1302
+ to: H,
1303
+ toHandle: null,
1304
+ toPosition: oppositePosition[J.position],
1305
+ toNode: null,
1306
+ pointer: H
1307
+ };
1308
+ function Z() {
1309
+ B = !0, D(X), b?.(e, {
1310
+ nodeId: u,
1311
+ handleId: l,
1312
+ handleType: R
1313
+ });
1314
+ }
1315
+ j === 0 && Z();
1316
+ function Q(e) {
1317
+ if (!B) {
1318
+ let { x: s, y: c } = getEventPosition(e), l = s - I, u = c - L;
1319
+ if (!(l * l + u * u > j * j)) return;
1320
+ Z();
1321
+ }
1322
+ if (!k() || !J) {
1323
+ $(e);
1324
+ return;
1325
+ }
1326
+ let d = O();
1327
+ H = getEventPosition(e, z), F = getClosestHandle(pointToRendererPoint(H, d, !1, [1, 1]), c, m, J), U ||= (q(), !0);
1328
+ let p = isValidHandle(e, {
1329
+ handle: F,
1330
+ connectionMode: s,
1331
+ fromNodeId: u,
1332
+ fromHandleId: l,
1333
+ fromType: f ? "target" : "source",
1334
+ isValidConnection: C,
1335
+ doc: N,
1336
+ lib: h,
1337
+ flowId: _,
1338
+ nodeLookup: m
1339
+ });
1340
+ K = p.handleDomNode, W = p.connection, G = isConnectionValid(!!F, p.isValid);
1341
+ let g = m.get(u), v = g ? getHandlePosition(g, J, Position.Left, !0) : X.from, y = {
1342
+ ...X,
1343
+ from: v,
1344
+ isValid: G,
1345
+ to: p.toHandle && G ? rendererPointToPoint({
1346
+ x: p.toHandle.x,
1347
+ y: p.toHandle.y
1348
+ }, d) : H,
1349
+ toHandle: p.toHandle,
1350
+ toPosition: G && p.toHandle ? p.toHandle.position : oppositePosition[J.position],
1351
+ toNode: p.toHandle ? m.get(p.toHandle.nodeId) : null,
1352
+ pointer: H
1353
+ };
1354
+ D(y), X = y;
1355
+ }
1356
+ function $(e) {
1357
+ if (!("touches" in e && e.touches.length > 0)) {
1358
+ if (B) {
1359
+ (F || K) && W && G && x?.(W);
1360
+ let { inProgress: s, ...c } = X, l = {
1361
+ ...c,
1362
+ toPosition: X.toHandle ? X.toPosition : null
1363
+ };
1364
+ S?.(e, l), d && E?.(e, l);
1365
+ }
1366
+ y(), cancelAnimationFrame(P), U = !1, G = !1, W = null, K = null, N.removeEventListener("mousemove", Q), N.removeEventListener("mouseup", $), N.removeEventListener("touchmove", Q), N.removeEventListener("touchend", $);
1367
+ }
1368
+ }
1369
+ N.addEventListener("mousemove", Q), N.addEventListener("mouseup", $), N.addEventListener("touchmove", Q), N.addEventListener("touchend", $);
1370
+ }
1371
+ function isValidHandle(e, { handle: s, connectionMode: c, fromNodeId: l, fromHandleId: u, fromType: d, doc: f, lib: p, flowId: m, isValidConnection: h = alwaysValid, nodeLookup: g }) {
1372
+ let _ = d === "target", y = s ? f.querySelector(`.${p}-flow__handle[data-id="${m}-${s?.nodeId}-${s?.id}-${s?.type}"]`) : null, { x: b, y: x } = getEventPosition(e), S = f.elementFromPoint(b, x), C = S?.classList.contains(`${p}-flow__handle`) ? S : y, w = {
1373
+ handleDomNode: C,
1374
+ isValid: !1,
1375
+ connection: null,
1376
+ toHandle: null
1377
+ };
1378
+ if (C) {
1379
+ let e = getHandleType(void 0, C), s = C.getAttribute("data-nodeid"), d = C.getAttribute("data-handleid"), f = C.classList.contains("connectable"), p = C.classList.contains("connectableend");
1380
+ if (!s || !e) return w;
1381
+ let m = {
1382
+ source: _ ? s : l,
1383
+ sourceHandle: _ ? d : u,
1384
+ target: _ ? l : s,
1385
+ targetHandle: _ ? u : d
1386
+ };
1387
+ w.connection = m, w.isValid = f && p && (c === ConnectionMode.Strict ? _ && e === "source" || !_ && e === "target" : s !== l || d !== u) && h(m), w.toHandle = getHandle(s, e, d, g, c, !0);
1388
+ }
1389
+ return w;
1390
+ }
1391
+ var XYHandle = {
1392
+ onPointerDown,
1393
+ isValid: isValidHandle
1394
+ };
1395
+ function XYMinimap({ domNode: c, panZoom: l, getTransform: u, getViewScale: d }) {
1396
+ let f = select_default(c);
1397
+ function m({ translateExtent: e, width: s, height: c, zoomStep: m = 1, pannable: h = !0, zoomable: g = !0, inversePan: _ = !1 }) {
1398
+ let v = (e) => {
1399
+ if (e.sourceEvent.type !== "wheel" || !l) return;
1400
+ let s = u(), c = e.sourceEvent.ctrlKey && isMacOs() ? 10 : 1, d = -e.sourceEvent.deltaY * (e.sourceEvent.deltaMode === 1 ? .05 : e.sourceEvent.deltaMode ? 1 : .002) * m, f = s[2] * 2 ** (d * c);
1401
+ l.scaleTo(f);
1402
+ }, y = [0, 0], b = zoom_default().on("start", (e) => {
1403
+ (e.sourceEvent.type === "mousedown" || e.sourceEvent.type === "touchstart") && (y = [e.sourceEvent.clientX ?? e.sourceEvent.touches[0].clientX, e.sourceEvent.clientY ?? e.sourceEvent.touches[0].clientY]);
1404
+ }).on("zoom", h ? (f) => {
1405
+ let p = u();
1406
+ if (f.sourceEvent.type !== "mousemove" && f.sourceEvent.type !== "touchmove" || !l) return;
1407
+ let m = [f.sourceEvent.clientX ?? f.sourceEvent.touches[0].clientX, f.sourceEvent.clientY ?? f.sourceEvent.touches[0].clientY], h = [m[0] - y[0], m[1] - y[1]];
1408
+ y = m;
1409
+ let g = d() * Math.max(p[2], Math.log(p[2])) * (_ ? -1 : 1), v = {
1410
+ x: p[0] - h[0] * g,
1411
+ y: p[1] - h[1] * g
1412
+ }, b = [[0, 0], [s, c]];
1413
+ l.setViewportConstrained({
1414
+ x: v.x,
1415
+ y: v.y,
1416
+ zoom: p[2]
1417
+ }, b, e);
1418
+ } : null).on("zoom.wheel", g ? v : null);
1419
+ f.call(b, {});
1420
+ }
1421
+ function h() {
1422
+ f.on("zoom", null);
1423
+ }
1424
+ return {
1425
+ update: m,
1426
+ destroy: h,
1427
+ pointer: pointer_default
1428
+ };
1429
+ }
1430
+ var transformToViewport = (e) => ({
1431
+ x: e.x,
1432
+ y: e.y,
1433
+ zoom: e.k
1434
+ }), viewportToTransform = ({ x: e, y: s, zoom: c }) => identity.translate(e, s).scale(c), isWrappedWithClass = (e, s) => e.target.closest(`.${s}`), isRightClickPan = (e, s) => s === 2 && Array.isArray(e) && e.includes(2), defaultEase = (e) => ((e *= 2) <= 1 ? e * e * e : (e -= 2) * e * e + 2) / 2, getD3Transition = (e, s = 0, c = defaultEase, l = () => {}) => {
1435
+ let u = typeof s == "number" && s > 0;
1436
+ return u || l(), u ? e.transition().duration(s).ease(c).on("end", l) : e;
1437
+ }, wheelDelta = (e) => {
1438
+ let s = e.ctrlKey && isMacOs() ? 10 : 1;
1439
+ return -e.deltaY * (e.deltaMode === 1 ? .05 : e.deltaMode ? 1 : .002) * s;
1440
+ };
1441
+ function createPanOnScrollHandler({ zoomPanValues: e, noWheelClassName: c, d3Selection: l, d3Zoom: u, panOnScrollMode: d, panOnScrollSpeed: f, zoomOnPinch: p, onPanZoomStart: m, onPanZoom: h, onPanZoomEnd: g }) {
1442
+ return (_) => {
1443
+ if (isWrappedWithClass(_, c)) return _.ctrlKey && _.preventDefault(), !1;
1444
+ _.preventDefault(), _.stopImmediatePropagation();
1445
+ let v = l.property("__zoom").k || 1;
1446
+ if (_.ctrlKey && p) {
1447
+ let e = pointer_default(_), c = v * 2 ** wheelDelta(_);
1448
+ u.scaleTo(l, c, e, _);
1449
+ return;
1450
+ }
1451
+ let b = _.deltaMode === 1 ? 20 : 1, x = d === PanOnScrollMode.Vertical ? 0 : _.deltaX * b, S = d === PanOnScrollMode.Horizontal ? 0 : _.deltaY * b;
1452
+ !isMacOs() && _.shiftKey && d !== PanOnScrollMode.Vertical && (x = _.deltaY * b, S = 0), u.translateBy(l, -(x / v) * f, -(S / v) * f, { internal: !0 });
1453
+ let C = transformToViewport(l.property("__zoom"));
1454
+ clearTimeout(e.panScrollTimeout), e.isPanScrolling ? (h?.(_, C), e.panScrollTimeout = setTimeout(() => {
1455
+ g?.(_, C), e.isPanScrolling = !1;
1456
+ }, 150)) : (e.isPanScrolling = !0, m?.(_, C));
1457
+ };
1458
+ }
1459
+ function createZoomOnScrollHandler({ noWheelClassName: e, preventScrolling: s, d3ZoomHandler: c }) {
1460
+ return function(l, u) {
1461
+ let d = l.type === "wheel", f = !s && d && !l.ctrlKey, p = isWrappedWithClass(l, e);
1462
+ if (l.ctrlKey && d && p && l.preventDefault(), f || p) return null;
1463
+ l.preventDefault(), c.call(this, l, u);
1464
+ };
1465
+ }
1466
+ function createPanZoomStartHandler({ zoomPanValues: e, onDraggingChange: s, onPanZoomStart: c }) {
1467
+ return (l) => {
1468
+ if (l.sourceEvent?.internal) return;
1469
+ let u = transformToViewport(l.transform);
1470
+ e.mouseButton = l.sourceEvent?.button || 0, e.isZoomingOrPanning = !0, e.prevViewport = u, l.sourceEvent?.type === "mousedown" && s(!0), c && c?.(l.sourceEvent, u);
1471
+ };
1472
+ }
1473
+ function createPanZoomHandler({ zoomPanValues: e, panOnDrag: s, onPaneContextMenu: c, onTransformChange: l, onPanZoom: u }) {
1474
+ return (d) => {
1475
+ e.usedRightMouseButton = !!(c && isRightClickPan(s, e.mouseButton ?? 0)), d.sourceEvent?.sync || l([
1476
+ d.transform.x,
1477
+ d.transform.y,
1478
+ d.transform.k
1479
+ ]), u && !d.sourceEvent?.internal && u?.(d.sourceEvent, transformToViewport(d.transform));
1480
+ };
1481
+ }
1482
+ function createPanZoomEndHandler({ zoomPanValues: e, panOnDrag: s, panOnScroll: c, onDraggingChange: l, onPanZoomEnd: u, onPaneContextMenu: d }) {
1483
+ return (f) => {
1484
+ if (!f.sourceEvent?.internal && (e.isZoomingOrPanning = !1, d && isRightClickPan(s, e.mouseButton ?? 0) && !e.usedRightMouseButton && f.sourceEvent && d(f.sourceEvent), e.usedRightMouseButton = !1, l(!1), u)) {
1485
+ let s = transformToViewport(f.transform);
1486
+ e.prevViewport = s, clearTimeout(e.timerId), e.timerId = setTimeout(() => {
1487
+ u?.(f.sourceEvent, s);
1488
+ }, c ? 150 : 0);
1489
+ }
1490
+ };
1491
+ }
1492
+ function createFilter({ zoomActivationKeyPressed: e, zoomOnScroll: s, zoomOnPinch: c, panOnDrag: l, panOnScroll: u, zoomOnDoubleClick: d, userSelectionActive: f, noWheelClassName: p, noPanClassName: m, lib: h, connectionInProgress: g }) {
1493
+ return (_) => {
1494
+ let v = e || s, y = c && _.ctrlKey, b = _.type === "wheel";
1495
+ if (_.button === 1 && _.type === "mousedown" && (isWrappedWithClass(_, `${h}-flow__node`) || isWrappedWithClass(_, `${h}-flow__edge`))) return !0;
1496
+ if (!l && !v && !u && !d && !c || f || g && !b || isWrappedWithClass(_, p) && b || isWrappedWithClass(_, m) && (!b || u && b && !e) || !c && _.ctrlKey && b) return !1;
1497
+ if (!c && _.type === "touchstart" && _.touches?.length > 1) return _.preventDefault(), !1;
1498
+ if (!v && !u && !y && b || !l && (_.type === "mousedown" || _.type === "touchstart") || Array.isArray(l) && !l.includes(_.button) && _.type === "mousedown") return !1;
1499
+ let x = Array.isArray(l) && l.includes(_.button) || !_.button || _.button <= 1;
1500
+ return (!_.ctrlKey || b) && x;
1501
+ };
1502
+ }
1503
+ function XYPanZoom({ domNode: s, minZoom: c, maxZoom: f, translateExtent: m, viewport: h, onPanZoom: g, onPanZoomStart: _, onPanZoomEnd: v, onDraggingChange: y }) {
1504
+ let b = {
1505
+ isZoomingOrPanning: !1,
1506
+ usedRightMouseButton: !1,
1507
+ prevViewport: {
1508
+ x: 0,
1509
+ y: 0,
1510
+ zoom: 0
1511
+ },
1512
+ mouseButton: 0,
1513
+ timerId: void 0,
1514
+ panScrollTimeout: void 0,
1515
+ isPanScrolling: !1
1516
+ }, x = s.getBoundingClientRect(), S = zoom_default().scaleExtent([c, f]).translateExtent(m), C = select_default(s).call(S);
1517
+ k({
1518
+ x: h.x,
1519
+ y: h.y,
1520
+ zoom: clamp(h.zoom, c, f)
1521
+ }, [[0, 0], [x.width, x.height]], m);
1522
+ let w = C.on("wheel.zoom"), T = C.on("dblclick.zoom");
1523
+ S.wheelDelta(wheelDelta);
1524
+ function E(e, s) {
1525
+ return C ? new Promise((c) => {
1526
+ S?.interpolate(s?.interpolate === "linear" ? value_default : zoom_default$1).transform(getD3Transition(C, s?.duration, s?.ease, () => c(!0)), e);
1527
+ }) : Promise.resolve(!1);
1528
+ }
1529
+ function D({ noWheelClassName: e, noPanClassName: s, onPaneContextMenu: c, userSelectionActive: l, panOnScroll: u, panOnDrag: d, panOnScrollMode: f, panOnScrollSpeed: p, preventScrolling: m, zoomOnPinch: h, zoomOnScroll: x, zoomOnDoubleClick: E, zoomActivationKeyPressed: D, lib: k, onTransformChange: A, connectionInProgress: j, paneClickDistance: M, selectionOnDrag: N }) {
1530
+ l && !b.isZoomingOrPanning && O();
1531
+ let P = u && !D && !l;
1532
+ S.clickDistance(N ? Infinity : !isNumeric(M) || M < 0 ? 0 : M);
1533
+ let F = P ? createPanOnScrollHandler({
1534
+ zoomPanValues: b,
1535
+ noWheelClassName: e,
1536
+ d3Selection: C,
1537
+ d3Zoom: S,
1538
+ panOnScrollMode: f,
1539
+ panOnScrollSpeed: p,
1540
+ zoomOnPinch: h,
1541
+ onPanZoomStart: _,
1542
+ onPanZoom: g,
1543
+ onPanZoomEnd: v
1544
+ }) : createZoomOnScrollHandler({
1545
+ noWheelClassName: e,
1546
+ preventScrolling: m,
1547
+ d3ZoomHandler: w
1548
+ });
1549
+ if (C.on("wheel.zoom", F, { passive: !1 }), !l) {
1550
+ let e = createPanZoomStartHandler({
1551
+ zoomPanValues: b,
1552
+ onDraggingChange: y,
1553
+ onPanZoomStart: _
1554
+ });
1555
+ S.on("start", e);
1556
+ let s = createPanZoomHandler({
1557
+ zoomPanValues: b,
1558
+ panOnDrag: d,
1559
+ onPaneContextMenu: !!c,
1560
+ onPanZoom: g,
1561
+ onTransformChange: A
1562
+ });
1563
+ S.on("zoom", s);
1564
+ let l = createPanZoomEndHandler({
1565
+ zoomPanValues: b,
1566
+ panOnDrag: d,
1567
+ panOnScroll: u,
1568
+ onPaneContextMenu: c,
1569
+ onPanZoomEnd: v,
1570
+ onDraggingChange: y
1571
+ });
1572
+ S.on("end", l);
1573
+ }
1574
+ let I = createFilter({
1575
+ zoomActivationKeyPressed: D,
1576
+ panOnDrag: d,
1577
+ zoomOnScroll: x,
1578
+ panOnScroll: u,
1579
+ zoomOnDoubleClick: E,
1580
+ zoomOnPinch: h,
1581
+ userSelectionActive: l,
1582
+ noPanClassName: s,
1583
+ noWheelClassName: e,
1584
+ lib: k,
1585
+ connectionInProgress: j
1586
+ });
1587
+ S.filter(I), E ? C.on("dblclick.zoom", T) : C.on("dblclick.zoom", null);
1588
+ }
1589
+ function O() {
1590
+ S.on("zoom", null);
1591
+ }
1592
+ async function k(e, s, c) {
1593
+ let l = viewportToTransform(e), u = S?.constrain()(l, s, c);
1594
+ return u && await E(u), new Promise((e) => e(u));
1595
+ }
1596
+ async function A(e, s) {
1597
+ let c = viewportToTransform(e);
1598
+ return await E(c, s), new Promise((e) => e(c));
1599
+ }
1600
+ function j(e) {
1601
+ if (C) {
1602
+ let s = viewportToTransform(e), c = C.property("__zoom");
1603
+ (c.k !== e.zoom || c.x !== e.x || c.y !== e.y) && S?.transform(C, s, null, { sync: !0 });
1604
+ }
1605
+ }
1606
+ function M() {
1607
+ let e = C ? transform(C.node()) : {
1608
+ x: 0,
1609
+ y: 0,
1610
+ k: 1
1611
+ };
1612
+ return {
1613
+ x: e.x,
1614
+ y: e.y,
1615
+ zoom: e.k
1616
+ };
1617
+ }
1618
+ function N(e, s) {
1619
+ return C ? new Promise((c) => {
1620
+ S?.interpolate(s?.interpolate === "linear" ? value_default : zoom_default$1).scaleTo(getD3Transition(C, s?.duration, s?.ease, () => c(!0)), e);
1621
+ }) : Promise.resolve(!1);
1622
+ }
1623
+ function P(e, s) {
1624
+ return C ? new Promise((c) => {
1625
+ S?.interpolate(s?.interpolate === "linear" ? value_default : zoom_default$1).scaleBy(getD3Transition(C, s?.duration, s?.ease, () => c(!0)), e);
1626
+ }) : Promise.resolve(!1);
1627
+ }
1628
+ function F(e) {
1629
+ S?.scaleExtent(e);
1630
+ }
1631
+ function I(e) {
1632
+ S?.translateExtent(e);
1633
+ }
1634
+ function L(e) {
1635
+ let s = !isNumeric(e) || e < 0 ? 0 : e;
1636
+ S?.clickDistance(s);
1637
+ }
1638
+ return {
1639
+ update: D,
1640
+ destroy: O,
1641
+ setViewport: A,
1642
+ setViewportConstrained: k,
1643
+ getViewport: M,
1644
+ scaleTo: N,
1645
+ scaleBy: P,
1646
+ setScaleExtent: F,
1647
+ setTranslateExtent: I,
1648
+ syncViewport: j,
1649
+ setClickDistance: L
1650
+ };
1651
+ }
1652
+ var ResizeControlVariant;
1653
+ (function(e) {
1654
+ e.Line = "line", e.Handle = "handle";
1655
+ })(ResizeControlVariant ||= {});
1656
+ function getResizeDirection({ width: e, prevWidth: s, height: c, prevHeight: l, affectsX: u, affectsY: d }) {
1657
+ let f = e - s, p = c - l, m = [f > 0 ? 1 : f < 0 ? -1 : 0, p > 0 ? 1 : p < 0 ? -1 : 0];
1658
+ return f && u && (m[0] *= -1), p && d && (m[1] *= -1), m;
1659
+ }
1660
+ function getControlDirection(e) {
1661
+ return {
1662
+ isHorizontal: e.includes("right") || e.includes("left"),
1663
+ isVertical: e.includes("bottom") || e.includes("top"),
1664
+ affectsX: e.includes("left"),
1665
+ affectsY: e.includes("top")
1666
+ };
1667
+ }
1668
+ function getLowerExtentClamp(e, s) {
1669
+ return Math.max(0, s - e);
1670
+ }
1671
+ function getUpperExtentClamp(e, s) {
1672
+ return Math.max(0, e - s);
1673
+ }
1674
+ function getSizeClamp(e, s, c) {
1675
+ return Math.max(0, s - e, e - c);
1676
+ }
1677
+ function xor(e, s) {
1678
+ return e ? !s : s;
1679
+ }
1680
+ function getDimensionsAfterResize(e, s, c, l, u, d, f, p) {
1681
+ let { affectsX: m, affectsY: h } = s, { isHorizontal: g, isVertical: _ } = s, v = g && _, { xSnapped: y, ySnapped: b } = c, { minWidth: x, maxWidth: S, minHeight: C, maxHeight: w } = l, { x: T, y: E, width: D, height: O, aspectRatio: k } = e, A = Math.floor(g ? y - e.pointerX : 0), j = Math.floor(_ ? b - e.pointerY : 0), M = D + (m ? -A : A), N = O + (h ? -j : j), P = -d[0] * D, F = -d[1] * O, I = getSizeClamp(M, x, S), L = getSizeClamp(N, C, w);
1682
+ if (f) {
1683
+ let e = 0, s = 0;
1684
+ m && A < 0 ? e = getLowerExtentClamp(T + A + P, f[0][0]) : !m && A > 0 && (e = getUpperExtentClamp(T + M + P, f[1][0])), h && j < 0 ? s = getLowerExtentClamp(E + j + F, f[0][1]) : !h && j > 0 && (s = getUpperExtentClamp(E + N + F, f[1][1])), I = Math.max(I, e), L = Math.max(L, s);
1685
+ }
1686
+ if (p) {
1687
+ let e = 0, s = 0;
1688
+ m && A > 0 ? e = getUpperExtentClamp(T + A, p[0][0]) : !m && A < 0 && (e = getLowerExtentClamp(T + M, p[1][0])), h && j > 0 ? s = getUpperExtentClamp(E + j, p[0][1]) : !h && j < 0 && (s = getLowerExtentClamp(E + N, p[1][1])), I = Math.max(I, e), L = Math.max(L, s);
1689
+ }
1690
+ if (u) {
1691
+ if (g) {
1692
+ let e = getSizeClamp(M / k, C, w) * k;
1693
+ if (I = Math.max(I, e), f) {
1694
+ let e = 0;
1695
+ e = !m && !h || m && !h && v ? getUpperExtentClamp(E + F + M / k, f[1][1]) * k : getLowerExtentClamp(E + F + (m ? A : -A) / k, f[0][1]) * k, I = Math.max(I, e);
1696
+ }
1697
+ if (p) {
1698
+ let e = 0;
1699
+ e = !m && !h || m && !h && v ? getLowerExtentClamp(E + M / k, p[1][1]) * k : getUpperExtentClamp(E + (m ? A : -A) / k, p[0][1]) * k, I = Math.max(I, e);
1700
+ }
1701
+ }
1702
+ if (_) {
1703
+ let e = getSizeClamp(N * k, x, S) / k;
1704
+ if (L = Math.max(L, e), f) {
1705
+ let e = 0;
1706
+ e = !m && !h || h && !m && v ? getUpperExtentClamp(T + N * k + P, f[1][0]) / k : getLowerExtentClamp(T + (h ? j : -j) * k + P, f[0][0]) / k, L = Math.max(L, e);
1707
+ }
1708
+ if (p) {
1709
+ let e = 0;
1710
+ e = !m && !h || h && !m && v ? getLowerExtentClamp(T + N * k, p[1][0]) / k : getUpperExtentClamp(T + (h ? j : -j) * k, p[0][0]) / k, L = Math.max(L, e);
1711
+ }
1712
+ }
1713
+ }
1714
+ j += j < 0 ? L : -L, A += A < 0 ? I : -I, u && (v ? M > N * k ? j = (xor(m, h) ? -A : A) / k : A = (xor(m, h) ? -j : j) * k : g ? (j = A / k, h = m) : (A = j * k, m = h));
1715
+ let R = m ? T + A : T, z = h ? E + j : E;
1716
+ return {
1717
+ width: D + (m ? -A : A),
1718
+ height: O + (h ? -j : j),
1719
+ x: d[0] * A * (m ? -1 : 1) + R,
1720
+ y: d[1] * j * (h ? -1 : 1) + z
1721
+ };
1722
+ }
1723
+ var initPrevValues = {
1724
+ width: 0,
1725
+ height: 0,
1726
+ x: 0,
1727
+ y: 0
1728
+ }, initStartValues = {
1729
+ ...initPrevValues,
1730
+ pointerX: 0,
1731
+ pointerY: 0,
1732
+ aspectRatio: 1
1733
+ };
1734
+ function nodeToParentExtent(e) {
1735
+ return [[0, 0], [e.measured.width, e.measured.height]];
1736
+ }
1737
+ function nodeToChildExtent(e, s, c) {
1738
+ let l = s.position.x + e.position.x, u = s.position.y + e.position.y, d = e.measured.width ?? 0, f = e.measured.height ?? 0, p = c[0] * d, m = c[1] * f;
1739
+ return [[l - p, u - m], [l + d - p, u + f - m]];
1740
+ }
1741
+ function XYResizer({ domNode: s, nodeId: l, getStoreItems: u, onChange: d, onEnd: f }) {
1742
+ let p = select_default(s), m = {
1743
+ controlDirection: getControlDirection("bottom-right"),
1744
+ boundaries: {
1745
+ minWidth: 0,
1746
+ minHeight: 0,
1747
+ maxWidth: Number.MAX_VALUE,
1748
+ maxHeight: Number.MAX_VALUE
1749
+ },
1750
+ resizeDirection: void 0,
1751
+ keepAspectRatio: !1
1752
+ };
1753
+ function h({ controlPosition: e, boundaries: s, keepAspectRatio: h, resizeDirection: g, onResizeStart: _, onResize: v, onResizeEnd: y, shouldResize: b }) {
1754
+ let x = { ...initPrevValues }, S = { ...initStartValues };
1755
+ m = {
1756
+ boundaries: s,
1757
+ resizeDirection: g,
1758
+ keepAspectRatio: h,
1759
+ controlDirection: getControlDirection(e)
1760
+ };
1761
+ let C, w = null, T = [], E, D, O, k = !1, A = drag_default().on("start", (e) => {
1762
+ let { nodeLookup: s, transform: c, snapGrid: d, snapToGrid: f, nodeOrigin: p, paneDomNode: m } = u();
1763
+ if (C = s.get(l), !C) return;
1764
+ w = m?.getBoundingClientRect() ?? null;
1765
+ let { xSnapped: h, ySnapped: g } = getPointerPosition(e.sourceEvent, {
1766
+ transform: c,
1767
+ snapGrid: d,
1768
+ snapToGrid: f,
1769
+ containerBounds: w
1770
+ });
1771
+ x = {
1772
+ width: C.measured.width ?? 0,
1773
+ height: C.measured.height ?? 0,
1774
+ x: C.position.x ?? 0,
1775
+ y: C.position.y ?? 0
1776
+ }, S = {
1777
+ ...x,
1778
+ pointerX: h,
1779
+ pointerY: g,
1780
+ aspectRatio: x.width / x.height
1781
+ }, E = void 0, C.parentId && (C.extent === "parent" || C.expandParent) && (E = s.get(C.parentId), D = E && C.extent === "parent" ? nodeToParentExtent(E) : void 0), T = [], O = void 0;
1782
+ for (let [e, c] of s) if (c.parentId === l && (T.push({
1783
+ id: e,
1784
+ position: { ...c.position },
1785
+ extent: c.extent
1786
+ }), c.extent === "parent" || c.expandParent)) {
1787
+ let e = nodeToChildExtent(c, C, c.origin ?? p);
1788
+ O = O ? [[Math.min(e[0][0], O[0][0]), Math.min(e[0][1], O[0][1])], [Math.max(e[1][0], O[1][0]), Math.max(e[1][1], O[1][1])]] : e;
1789
+ }
1790
+ _?.(e, { ...x });
1791
+ }).on("drag", (e) => {
1792
+ let { transform: s, snapGrid: c, snapToGrid: l, nodeOrigin: f } = u(), p = getPointerPosition(e.sourceEvent, {
1793
+ transform: s,
1794
+ snapGrid: c,
1795
+ snapToGrid: l,
1796
+ containerBounds: w
1797
+ }), h = [];
1798
+ if (!C) return;
1799
+ let { x: g, y: _, width: y, height: A } = x, j = {}, M = C.origin ?? f, { width: N, height: P, x: F, y: I } = getDimensionsAfterResize(S, m.controlDirection, p, m.boundaries, m.keepAspectRatio, M, D, O), L = N !== y, R = P !== A, z = F !== g && L, B = I !== _ && R;
1800
+ if (!z && !B && !L && !R) return;
1801
+ if ((z || B || M[0] === 1 || M[1] === 1) && (j.x = z ? F : x.x, j.y = B ? I : x.y, x.x = j.x, x.y = j.y, T.length > 0)) {
1802
+ let e = F - g, s = I - _;
1803
+ for (let c of T) c.position = {
1804
+ x: c.position.x - e + M[0] * (N - y),
1805
+ y: c.position.y - s + M[1] * (P - A)
1806
+ }, h.push(c);
1807
+ }
1808
+ if ((L || R) && (j.width = L && (!m.resizeDirection || m.resizeDirection === "horizontal") ? N : x.width, j.height = R && (!m.resizeDirection || m.resizeDirection === "vertical") ? P : x.height, x.width = j.width, x.height = j.height), E && C.expandParent) {
1809
+ let e = M[0] * (j.width ?? 0);
1810
+ j.x && j.x < e && (x.x = e, S.x -= j.x - e);
1811
+ let s = M[1] * (j.height ?? 0);
1812
+ j.y && j.y < s && (x.y = s, S.y -= j.y - s);
1813
+ }
1814
+ let V = getResizeDirection({
1815
+ width: x.width,
1816
+ prevWidth: y,
1817
+ height: x.height,
1818
+ prevHeight: A,
1819
+ affectsX: m.controlDirection.affectsX,
1820
+ affectsY: m.controlDirection.affectsY
1821
+ }), H = {
1822
+ ...x,
1823
+ direction: V
1824
+ };
1825
+ b?.(e, H) !== !1 && (k = !0, v?.(e, H), d(j, h));
1826
+ }).on("end", (e) => {
1827
+ k &&= (y?.(e, { ...x }), f?.({ ...x }), !1);
1828
+ });
1829
+ p.call(A);
1830
+ }
1831
+ function g() {
1832
+ p.on(".drag", null);
1833
+ }
1834
+ return {
1835
+ update: h,
1836
+ destroy: g
1837
+ };
1838
+ }
1839
+ export { ConnectionLineType, ConnectionMode, MarkerType, PanOnScrollMode, Position, ResizeControlVariant, SelectionMode, XYDrag, XYHandle, XYMinimap, XYPanZoom, XYResizer, addEdge, adoptUserNodes, areSetsEqual, calculateNodePosition, createMarkerIds, defaultAriaLabelConfig, devWarn, elementSelectionKeys, errorMessages, evaluateAbsolutePosition, fitViewport, getBezierEdgeCenter, getBezierPath, getBoundsOfRects, getConnectedEdges, getConnectionStatus, getDimensions, getEdgeCenter, getEdgePosition, getElementsToRemove, getElevatedEdgeZIndex, getEventPosition, getHandlePosition, getHostForElement, getInternalNodesBounds, getMarkerId, getNodeDimensions, getNodesBounds, getNodesInside, getOverlappingArea, getSmoothStepPath, getStraightPath, getViewportForBounds, handleExpandParent, infiniteExtent, initialConnection, isEdgeBase, isEdgeVisible, isInputDOMNode, isMacOs, isMouseEvent, isNodeBase, isNumeric, isRectObject, mergeAriaLabelConfig, nodeHasDimensions, nodeToRect, panBy, pointToRendererPoint, rendererPointToPoint, snapPosition, updateAbsolutePositions, updateConnectionLookup, updateNodeInternals, withResolvers };