dishui 0.0.62 → 0.0.65

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 (177) hide show
  1. package/dist/components/Badge/index.js +12 -9
  2. package/dist/components/Badge/index.js.map +1 -1
  3. package/dist/components/Button/index.js +43 -40
  4. package/dist/components/Button/index.js.map +1 -1
  5. package/dist/components/Card/index.d.ts +11 -0
  6. package/dist/components/Card/index.js +62 -37
  7. package/dist/components/Card/index.js.map +1 -1
  8. package/dist/components/Chart/Chart.js.map +1 -1
  9. package/dist/components/Checkbox/index.js +32 -30
  10. package/dist/components/Checkbox/index.js.map +1 -1
  11. package/dist/components/Demo/index.js.map +1 -1
  12. package/dist/components/EmptyState/index.d.ts +4 -1
  13. package/dist/components/EmptyState/index.js +3 -3
  14. package/dist/components/EmptyState/index.js.map +1 -1
  15. package/dist/components/FileUploader/DropZone.js.map +1 -1
  16. package/dist/components/FileUploader/FileItem.js.map +1 -1
  17. package/dist/components/FileUploader/FileUploader.js.map +1 -1
  18. package/dist/components/FileUploader/UploadQueue.js.map +1 -1
  19. package/dist/components/Input/index.js +30 -30
  20. package/dist/components/Input/index.js.map +1 -1
  21. package/dist/components/Label/index.js +41 -40
  22. package/dist/components/Label/index.js.map +1 -1
  23. package/dist/components/List/index.js +47 -32
  24. package/dist/components/List/index.js.map +1 -1
  25. package/dist/components/Markdown/Markdown.js +61 -57
  26. package/dist/components/Markdown/Markdown.js.map +1 -1
  27. package/dist/components/Markdown/markdownComponents.js +49 -49
  28. package/dist/components/Markdown/markdownComponents.js.map +1 -1
  29. package/dist/components/Modal/index.d.ts +7 -3
  30. package/dist/components/Modal/index.js +77 -65
  31. package/dist/components/Modal/index.js.map +1 -1
  32. package/dist/components/Page/index.d.ts +58 -0
  33. package/dist/components/Page/index.js +74 -0
  34. package/dist/components/Page/index.js.map +1 -0
  35. package/dist/components/PageHeader/index.js.map +1 -1
  36. package/dist/components/Select/index.js +0 -3
  37. package/dist/components/Select/index.js.map +1 -1
  38. package/dist/components/SidebarToggleButton/index.js.map +1 -1
  39. package/dist/components/StatCard/index.d.ts +3 -1
  40. package/dist/components/StatCard/index.js +39 -11
  41. package/dist/components/StatCard/index.js.map +1 -1
  42. package/dist/components/Table/index.js +103 -85
  43. package/dist/components/Table/index.js.map +1 -1
  44. package/dist/components/Tabs/index.d.ts +19 -5
  45. package/dist/components/Tabs/index.js +32 -13
  46. package/dist/components/Tabs/index.js.map +1 -1
  47. package/dist/components/Tree/Tree.js.map +1 -1
  48. package/dist/components/pro/ArticleContextMenu/index.js.map +1 -1
  49. package/dist/components/pro/ArticleControl/ArticleControl2.js.map +1 -1
  50. package/dist/components/pro/CodeEditor/editors/CodeEditor.js +141 -134
  51. package/dist/components/pro/CodeEditor/editors/CodeEditor.js.map +1 -1
  52. package/dist/components/pro/CodeEditor/editors/MarkdownEditor.js +81 -78
  53. package/dist/components/pro/CodeEditor/editors/MarkdownEditor.js.map +1 -1
  54. package/dist/components/pro/CodeEditor/panels/FootnotePanel.js.map +1 -1
  55. package/dist/components/pro/CodeEditor/panels/HistoryPanel.js.map +1 -1
  56. package/dist/components/pro/CodeEditor/panels/OutlinePanel.js.map +1 -1
  57. package/dist/components/pro/CodeEditor/panels/TableOfContentsPanel.js.map +1 -1
  58. package/dist/components/pro/CodeEditor/panels/VariablePanel.js.map +1 -1
  59. package/dist/components/pro/CodeEditor/themes.js +59 -59
  60. package/dist/components/pro/CodeEditor/themes.js.map +1 -1
  61. package/dist/components/pro/DataTable/DataTable.js +49 -48
  62. package/dist/components/pro/DataTable/DataTable.js.map +1 -1
  63. package/dist/components/pro/DataTable/Filters.js +42 -42
  64. package/dist/components/pro/DataTable/Filters.js.map +1 -1
  65. package/dist/components/pro/DataTable/PivotPanel.js.map +1 -1
  66. package/dist/components/pro/DataTable/PivotView.js +35 -32
  67. package/dist/components/pro/DataTable/PivotView.js.map +1 -1
  68. package/dist/components/pro/DataTable/components/BulkActions.js.map +1 -1
  69. package/dist/components/pro/DataTable/components/ColumnSelector.js.map +1 -1
  70. package/dist/components/pro/DataTable/components/FilterBar.js.map +1 -1
  71. package/dist/components/pro/DataTable/components/TableBody.js.map +1 -1
  72. package/dist/components/pro/DataTable/components/TableHeader.js.map +1 -1
  73. package/dist/components/pro/DataTable/components/TablePagination.js.map +1 -1
  74. package/dist/components/pro/DataTable/components/TableToolbar.js.map +1 -1
  75. package/dist/components/pro/DataTable/pivotExtension.js.map +1 -1
  76. package/dist/components/pro/DataTable/rowDetailExtension.js.map +1 -1
  77. package/dist/components/pro/DataTable/tanstack-table.js +37 -37
  78. package/dist/components/pro/DataTable/tanstack-table.js.map +1 -1
  79. package/dist/components/pro/FileExplorer/Breadcrumb.js +53 -53
  80. package/dist/components/pro/FileExplorer/Breadcrumb.js.map +1 -1
  81. package/dist/components/pro/FileExplorer/CreateDialog.js.map +1 -1
  82. package/dist/components/pro/FileExplorer/FileExplorer.js.map +1 -1
  83. package/dist/components/pro/FileExplorer/FileIcon.js +22 -22
  84. package/dist/components/pro/FileExplorer/FileIcon.js.map +1 -1
  85. package/dist/components/pro/FileExplorer/GridView.js.map +1 -1
  86. package/dist/components/pro/FileExplorer/ListView.js.map +1 -1
  87. package/dist/components/pro/FileExplorer/Toolbar.js.map +1 -1
  88. package/dist/components/pro/Flow/Flow.js +496 -494
  89. package/dist/components/pro/Flow/Flow.js.map +1 -1
  90. package/dist/components/pro/Flow/FlowCanvas.js +916 -917
  91. package/dist/components/pro/Flow/FlowCanvas.js.map +1 -1
  92. package/dist/components/pro/Flow/context/FlowUIContext.js.map +1 -1
  93. package/dist/components/pro/Flow/edges/EdgeRenderer.js +59 -59
  94. package/dist/components/pro/Flow/edges/EdgeRenderer.js.map +1 -1
  95. package/dist/components/pro/Flow/hooks/useClipboard.js.map +1 -1
  96. package/dist/components/pro/Flow/hooks/useDeleteSelection.js.map +1 -1
  97. package/dist/components/pro/Flow/hooks/useEdgeMutations.js.map +1 -1
  98. package/dist/components/pro/Flow/hooks/useLayoutActions.js +9 -11
  99. package/dist/components/pro/Flow/hooks/useLayoutActions.js.map +1 -1
  100. package/dist/components/pro/Flow/hooks/useLineMutations.js.map +1 -1
  101. package/dist/components/pro/Flow/hooks/useMindMap.js.map +1 -1
  102. package/dist/components/pro/Flow/hooks/useNodeMutations.js.map +1 -1
  103. package/dist/components/pro/Flow/lines/FreehandTool.js +9 -9
  104. package/dist/components/pro/Flow/lines/FreehandTool.js.map +1 -1
  105. package/dist/components/pro/Flow/lines/LineRenderer.js +5 -5
  106. package/dist/components/pro/Flow/lines/LineRenderer.js.map +1 -1
  107. package/dist/components/pro/Flow/nodes/DataNodeView.js +113 -93
  108. package/dist/components/pro/Flow/nodes/DataNodeView.js.map +1 -1
  109. package/dist/components/pro/Flow/nodes/MediaContent.js.map +1 -1
  110. package/dist/components/pro/Flow/nodes/MediaOverlay.js.map +1 -1
  111. package/dist/components/pro/Flow/nodes/Model3DView.js +1 -1
  112. package/dist/components/pro/Flow/nodes/Model3DView.js.map +1 -1
  113. package/dist/components/pro/Flow/nodes/NodeRenderer.js +118 -118
  114. package/dist/components/pro/Flow/nodes/NodeRenderer.js.map +1 -1
  115. package/dist/components/pro/Flow/nodes/dataUtils.js.map +1 -1
  116. package/dist/components/pro/Flow/nodes/shapes.js +1 -3
  117. package/dist/components/pro/Flow/nodes/shapes.js.map +1 -1
  118. package/dist/components/pro/Flow/panels/AIPanel.js.map +1 -1
  119. package/dist/components/pro/Flow/panels/Breadcrumb.js.map +1 -1
  120. package/dist/components/pro/Flow/panels/ContextMenu.js.map +1 -1
  121. package/dist/components/pro/Flow/panels/DataInspectorSection.js.map +1 -1
  122. package/dist/components/pro/Flow/panels/ExpandableTextarea.js.map +1 -1
  123. package/dist/components/pro/Flow/panels/FlowPanelGroup.js.map +1 -1
  124. package/dist/components/pro/Flow/panels/FlowToolbar.js +79 -79
  125. package/dist/components/pro/Flow/panels/FlowToolbar.js.map +1 -1
  126. package/dist/components/pro/Flow/panels/InspectorPanel.js +57 -57
  127. package/dist/components/pro/Flow/panels/InspectorPanel.js.map +1 -1
  128. package/dist/components/pro/Flow/panels/OutlinePanel.js +26 -22
  129. package/dist/components/pro/Flow/panels/OutlinePanel.js.map +1 -1
  130. package/dist/components/pro/Flow/panels/PresentationMode.js +18 -16
  131. package/dist/components/pro/Flow/panels/PresentationMode.js.map +1 -1
  132. package/dist/components/pro/Flow/panels/ProjectTitle.js.map +1 -1
  133. package/dist/components/pro/Flow/panels/ShapePalette.js +109 -104
  134. package/dist/components/pro/Flow/panels/ShapePalette.js.map +1 -1
  135. package/dist/components/pro/Flow/panels/toolbarIcons.js.map +1 -1
  136. package/dist/components/pro/RichTextEditor/AIRewrite.js.map +1 -1
  137. package/dist/components/pro/RichTextEditor/BlockHandle.js.map +1 -1
  138. package/dist/components/pro/RichTextEditor/BubbleToolbar.js.map +1 -1
  139. package/dist/components/pro/RichTextEditor/CommentDialog.js.map +1 -1
  140. package/dist/components/pro/RichTextEditor/CommentPanel.js.map +1 -1
  141. package/dist/components/pro/RichTextEditor/CommentPopover.js.map +1 -1
  142. package/dist/components/pro/RichTextEditor/ContextMenu.js.map +1 -1
  143. package/dist/components/pro/RichTextEditor/RichTextEditor.js.map +1 -1
  144. package/dist/components/pro/RichTextEditor/SlashMenu.js.map +1 -1
  145. package/dist/components/pro/RichTextEditor/Toolbar/ColorPicker.js.map +1 -1
  146. package/dist/components/pro/RichTextEditor/Toolbar/FloatingDialogMenu.js.map +1 -1
  147. package/dist/components/pro/RichTextEditor/Toolbar/MarkdownTemplates.js.map +1 -1
  148. package/dist/components/pro/RichTextEditor/Toolbar/SelectDropdown.js.map +1 -1
  149. package/dist/components/pro/RichTextEditor/Toolbar/TableOpsMenu.js.map +1 -1
  150. package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js.map +1 -1
  151. package/dist/components/pro/RichTextEditor/extensions/CodeBlockView.js.map +1 -1
  152. package/dist/components/pro/RichTextEditor/extensions/FloatingDialog.js.map +1 -1
  153. package/dist/components/pro/RichTextEditor/extensions/MarkdownBlock.js.map +1 -1
  154. package/dist/contexts/AppContext.js.map +1 -1
  155. package/dist/dishui.css +1 -1
  156. package/dist/hooks/useTableColumns.js +7 -8
  157. package/dist/hooks/useTableColumns.js.map +1 -1
  158. package/dist/index.d.ts +2 -0
  159. package/dist/index.js +227 -221
  160. package/dist/layouts/MainLayout.js +22 -22
  161. package/dist/layouts/MainLayout.js.map +1 -1
  162. package/dist/layouts/Navbar.js.map +1 -1
  163. package/dist/layouts/Sidebar.js +94 -73
  164. package/dist/layouts/Sidebar.js.map +1 -1
  165. package/dist/layouts/headbar/Headbar.js.map +1 -1
  166. package/dist/layouts/headbar/HeadbarLangSwitcher.js.map +1 -1
  167. package/dist/layouts/headbar/HeadbarSearch.js.map +1 -1
  168. package/dist/layouts/headbar/HeadbarThemeSwitcher.js +11 -11
  169. package/dist/layouts/headbar/HeadbarThemeSwitcher.js.map +1 -1
  170. package/dist/layouts/headbar/HeadbarTitle.js.map +1 -1
  171. package/dist/utils/i18n.js +10 -10
  172. package/dist/utils/i18n.js.map +1 -1
  173. package/dist/utils/menu.js.map +1 -1
  174. package/dist/utils/routerBuilder.js +17 -15
  175. package/dist/utils/routerBuilder.js.map +1 -1
  176. package/dist/utils/themes.js.map +1 -1
  177. package/package.json +7 -7
@@ -1,460 +1,460 @@
1
- import { useFlowContext as Mn } from "./context/FlowContext.js";
2
- import { useFlowUI as Rn } from "./context/FlowUIContext.js";
3
- import { usePixiApp as Sn } from "./hooks/usePixiApp.js";
4
- import { useViewport as zn } from "./hooks/useViewport.js";
5
- import { GridRenderer as En } from "./canvas/GridRenderer.js";
6
- import { SelectionOverlay as Cn } from "./canvas/SelectionOverlay.js";
7
- import { shapeDrawers as an } from "./nodes/shapes.js";
8
- import { findClosestHandleWorld as Bt, getHandlePositions as Mt, handleWorldPos as Vt } from "./nodes/NodeHandles.js";
9
- import { distToSegment as Le, generateId as Nn, isPointInNode as qt, rectsOverlap as kn } from "./nodes/nodeUtils.js";
10
- import { NodeRenderer as Tn } from "./nodes/NodeRenderer.js";
11
- import { buildEdgePath as wn, linearizeSegments as mn, resolveEdgeEndpoints as St } from "./edges/edgePaths.js";
12
- import { EdgeRenderer as Dn } from "./edges/EdgeRenderer.js";
13
- import { LineRenderer as Hn } from "./lines/LineRenderer.js";
14
- import { FreehandTool as Pn } from "./lines/FreehandTool.js";
15
- import { GeometricLineTool as An } from "./lines/GeometricLineTool.js";
16
- import { computeAlignmentSnap as me } from "./hooks/useAlignmentGuides.js";
17
- import { AlignmentGuidesRenderer as Ln } from "./canvas/AlignmentGuides.js";
18
- import { getDocumentSlides as Gn, nextAnimIndex as Wn } from "./nodes/animAnchors.js";
19
- import { useDeleteSelection as Yn } from "./hooks/useDeleteSelection.js";
20
- import { useCallback as le, useEffect as Rt, useRef as m, useState as ln } from "react";
21
- import { jsx as Zt, jsxs as ve } from "react/jsx-runtime";
22
- import { Graphics as ue } from "pixi.js";
23
- var Xn = {
1
+ import { useFlowContext as Sn } from "./context/FlowContext.js";
2
+ import { useFlowUI as zn } from "./context/FlowUIContext.js";
3
+ import { usePixiApp as Cn } from "./hooks/usePixiApp.js";
4
+ import { useViewport as En } from "./hooks/useViewport.js";
5
+ import { GridRenderer as Nn } from "./canvas/GridRenderer.js";
6
+ import { SelectionOverlay as Tn } from "./canvas/SelectionOverlay.js";
7
+ import { shapeDrawers as ln } from "./nodes/shapes.js";
8
+ import { findClosestHandleWorld as Ft, getHandlePositions as Mt, handleWorldPos as Bt } from "./nodes/NodeHandles.js";
9
+ import { distToSegment as Ge, generateId as kn, isPointInNode as Vt, rectsOverlap as Dn } from "./nodes/nodeUtils.js";
10
+ import { NodeRenderer as Hn } from "./nodes/NodeRenderer.js";
11
+ import { buildEdgePath as mn, linearizeSegments as vn, resolveEdgeEndpoints as St } from "./edges/edgePaths.js";
12
+ import { EdgeRenderer as Pn } from "./edges/EdgeRenderer.js";
13
+ import { LineRenderer as An } from "./lines/LineRenderer.js";
14
+ import { FreehandTool as Ln } from "./lines/FreehandTool.js";
15
+ import { GeometricLineTool as Gn } from "./lines/GeometricLineTool.js";
16
+ import { computeAlignmentSnap as ve } from "./hooks/useAlignmentGuides.js";
17
+ import { AlignmentGuidesRenderer as Wn } from "./canvas/AlignmentGuides.js";
18
+ import { getDocumentSlides as Yn, nextAnimIndex as Xn } from "./nodes/animAnchors.js";
19
+ import { useDeleteSelection as _n } from "./hooks/useDeleteSelection.js";
20
+ import { useCallback as ae, useEffect as Rt, useRef as v, useState as un } from "react";
21
+ import { jsx as qt, jsxs as Ie } from "react/jsx-runtime";
22
+ import { Graphics as le } from "pixi.js";
23
+ var On = {
24
24
  nw: "nwse-resize",
25
25
  ne: "nesw-resize",
26
26
  se: "nwse-resize",
27
27
  sw: "nesw-resize"
28
- }, fe = typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(pointer: coarse)").matches, un = fe ? 2 : 1;
29
- function Q(L, M, H) {
30
- return Math.min(M * un / L, H * un);
28
+ }, ue = typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(pointer: coarse)").matches, fn = ue ? 2 : 1;
29
+ function Q(A, R, D) {
30
+ return Math.min(R * fn / A, D * fn);
31
31
  }
32
- var vn = 26;
33
- function fn(L, M) {
32
+ var In = 26;
33
+ function hn(A, R) {
34
34
  return {
35
- x: L.position.x + L.width / 2,
36
- y: L.position.y - vn / M
35
+ x: A.position.x + A.width / 2,
36
+ y: A.position.y - In / R
37
37
  };
38
38
  }
39
- function Kt(L, M, H) {
40
- return !H || !(M > 0) ? L : Math.round(L / M) * M;
39
+ function Zt(A, R, D) {
40
+ return !D || !(R > 0) ? A : Math.round(A / R) * R;
41
41
  }
42
- function hn(L, M, H) {
43
- const { x: U, y: D } = M.position, W = M.width, A = M.height, N = [
42
+ function yn(A, R, D) {
43
+ const { x: U, y: P } = R.position, L = R.width, Y = R.height, T = [
44
44
  [
45
45
  "nw",
46
46
  U,
47
- D
47
+ P
48
48
  ],
49
49
  [
50
50
  "ne",
51
- U + W,
52
- D
51
+ U + L,
52
+ P
53
53
  ],
54
54
  [
55
55
  "se",
56
- U + W,
57
- D + A
56
+ U + L,
57
+ P + Y
58
58
  ],
59
59
  [
60
60
  "sw",
61
61
  U,
62
- D + A
62
+ P + Y
63
63
  ]
64
64
  ];
65
- let E = null, q = H;
66
- for (const [j, lt, et] of N) {
67
- const $ = Math.hypot(L.x - lt, L.y - et);
68
- $ < q && (q = $, E = j);
65
+ let M = null, B = D;
66
+ for (const [j, ut, ot] of T) {
67
+ const $ = Math.hypot(A.x - ut, A.y - ot);
68
+ $ < B && (B = $, M = j);
69
69
  }
70
- return E;
70
+ return M;
71
71
  }
72
- function yn(L, M, H, U, D) {
73
- let W = null, A = D;
74
- for (const N of H) {
75
- const E = St(N, U);
76
- if (!E) continue;
77
- const q = Math.hypot(L - E.sx, M - E.sy);
78
- q < A && (A = q, W = {
79
- edgeId: N.id,
72
+ function pn(A, R, D, U, P) {
73
+ let L = null, Y = P;
74
+ for (const T of D) {
75
+ const M = St(T, U);
76
+ if (!M) continue;
77
+ const B = Math.hypot(A - M.sx, R - M.sy);
78
+ B < Y && (Y = B, L = {
79
+ edgeId: T.id,
80
80
  end: "source",
81
- worldX: E.sx,
82
- worldY: E.sy
81
+ worldX: M.sx,
82
+ worldY: M.sy
83
83
  });
84
- const j = Math.hypot(L - E.tx, M - E.ty);
85
- j < A && (A = j, W = {
86
- edgeId: N.id,
84
+ const j = Math.hypot(A - M.tx, R - M.ty);
85
+ j < Y && (Y = j, L = {
86
+ edgeId: T.id,
87
87
  end: "target",
88
- worldX: E.tx,
89
- worldY: E.ty
88
+ worldX: M.tx,
89
+ worldY: M.ty
90
90
  });
91
91
  }
92
- return W;
92
+ return L;
93
93
  }
94
- function pn(L, M, H, U) {
95
- let D = null, W = U;
96
- for (const A of H) {
97
- const N = A.data.waypoints;
98
- if (N)
99
- for (let E = 0; E < N.length; E++) {
100
- const q = Math.hypot(L - N[E].x, M - N[E].y);
101
- q < W && (W = q, D = {
102
- edgeId: A.id,
103
- waypointIndex: E,
104
- wx: N[E].x,
105
- wy: N[E].y
94
+ function xn(A, R, D, U) {
95
+ let P = null, L = U;
96
+ for (const Y of D) {
97
+ const T = Y.data.waypoints;
98
+ if (T)
99
+ for (let M = 0; M < T.length; M++) {
100
+ const B = Math.hypot(A - T[M].x, R - T[M].y);
101
+ B < L && (L = B, P = {
102
+ edgeId: Y.id,
103
+ waypointIndex: M,
104
+ wx: T[M].x,
105
+ wy: T[M].y
106
106
  });
107
107
  }
108
108
  }
109
- return D;
109
+ return P;
110
110
  }
111
- function xn(L, M, H, U, D) {
112
- let W = null, A = D;
113
- for (const N of H) {
114
- if (N.type !== "simplebezier") continue;
115
- const E = St(N, U);
116
- if (!E) continue;
117
- const q = N.data.waypoints ?? [], j = [
111
+ function gn(A, R, D, U, P) {
112
+ let L = null, Y = P;
113
+ for (const T of D) {
114
+ if (T.type !== "simplebezier") continue;
115
+ const M = St(T, U);
116
+ if (!M) continue;
117
+ const B = T.data.waypoints ?? [], j = [
118
118
  {
119
- x: E.sx,
120
- y: E.sy
119
+ x: M.sx,
120
+ y: M.sy
121
121
  },
122
- ...q,
122
+ ...B,
123
123
  {
124
- x: E.tx,
125
- y: E.ty
124
+ x: M.tx,
125
+ y: M.ty
126
126
  }
127
- ], lt = N.data.bezierControls, et = j.length - 2;
128
- for (let $ = 0; $ <= et; $++) {
129
- const ot = j[$], st = j[$ + 1], zt = lt?.[$], Ut = Math.hypot(st.x - ot.x, st.y - ot.y), Lt = Math.max(30, Ut * 0.3), he = zt?.c1x ?? ($ === 0 ? ot.x + E.snx * Lt : ot.x + (st.x - ot.x) * 0.4), $t = zt?.c1y ?? ($ === 0 ? ot.y + E.sny * Lt : ot.y), jt = zt?.c2x ?? ($ === et ? st.x + E.tnx * Lt : st.x - (st.x - ot.x) * 0.4), Et = zt?.c2y ?? ($ === et ? st.y + E.tny * Lt : st.y), Ct = Math.hypot(L - he, M - $t);
130
- Ct < A && (A = Ct, W = {
131
- edgeId: N.id,
127
+ ], ut = T.data.bezierControls, ot = j.length - 2;
128
+ for (let $ = 0; $ <= ot; $++) {
129
+ const et = j[$], st = j[$ + 1], zt = ut?.[$], fe = Math.hypot(st.x - et.x, st.y - et.y), wt = Math.max(30, fe * 0.3), he = zt?.c1x ?? ($ === 0 ? et.x + M.snx * wt : et.x + (st.x - et.x) * 0.4), ye = zt?.c1y ?? ($ === 0 ? et.y + M.sny * wt : et.y), Kt = zt?.c2x ?? ($ === ot ? st.x + M.tnx * wt : st.x - (st.x - et.x) * 0.4), Ut = zt?.c2y ?? ($ === ot ? st.y + M.tny * wt : st.y), Ct = Math.hypot(A - he, R - ye);
130
+ Ct < Y && (Y = Ct, L = {
131
+ edgeId: T.id,
132
132
  segmentIndex: $,
133
133
  controlEnd: "c1",
134
134
  wx: he,
135
- wy: $t
135
+ wy: ye
136
136
  });
137
- const gt = Math.hypot(L - jt, M - Et);
138
- gt < A && (A = gt, W = {
139
- edgeId: N.id,
137
+ const Et = Math.hypot(A - Kt, R - Ut);
138
+ Et < Y && (Y = Et, L = {
139
+ edgeId: T.id,
140
140
  segmentIndex: $,
141
141
  controlEnd: "c2",
142
- wx: jt,
143
- wy: Et
142
+ wx: Kt,
143
+ wy: Ut
144
144
  });
145
145
  }
146
146
  }
147
- return W;
147
+ return L;
148
148
  }
149
- function _n(L, M, H, U) {
150
- const D = St(H, U);
151
- if (!D) return 0;
152
- const W = H.data.waypoints ?? [], A = [
149
+ function Fn(A, R, D, U) {
150
+ const P = St(D, U);
151
+ if (!P) return 0;
152
+ const L = D.data.waypoints ?? [], Y = [
153
153
  {
154
- x: D.sx,
155
- y: D.sy
154
+ x: P.sx,
155
+ y: P.sy
156
156
  },
157
- ...W,
157
+ ...L,
158
158
  {
159
- x: D.tx,
160
- y: D.ty
159
+ x: P.tx,
160
+ y: P.ty
161
161
  }
162
162
  ];
163
- let N = 1 / 0, E = 0;
164
- for (let q = 0; q < A.length - 1; q++) {
165
- const j = Le(L, M, A[q].x, A[q].y, A[q + 1].x, A[q + 1].y);
166
- j < N && (N = j, E = q);
163
+ let T = 1 / 0, M = 0;
164
+ for (let B = 0; B < Y.length - 1; B++) {
165
+ const j = Ge(A, R, Y[B].x, Y[B].y, Y[B + 1].x, Y[B + 1].y);
166
+ j < T && (T = j, M = B);
167
167
  }
168
- return E;
168
+ return M;
169
169
  }
170
- function On(L, M, H, U, D = 24) {
171
- let { x: W, y: A, w: N, h: E } = { ...L };
172
- const q = M === "nw" || M === "sw", j = M === "ne" || M === "se", lt = M === "nw" || M === "ne", et = M === "sw" || M === "se";
173
- return q && (W += H, N -= H), j && (N += H), lt && (A += U, E -= U), et && (E += U), N < D && (q && (W = L.x + L.w - D), N = D), E < D && (lt && (A = L.y + L.h - D), E = D), {
174
- x: W,
175
- y: A,
176
- w: N,
177
- h: E
170
+ function Bn(A, R, D, U, P = 24) {
171
+ let { x: L, y: Y, w: T, h: M } = { ...A };
172
+ const B = R === "nw" || R === "sw", j = R === "ne" || R === "se", ut = R === "nw" || R === "ne", ot = R === "sw" || R === "se";
173
+ return B && (L += D, T -= D), j && (T += D), ut && (Y += U, M -= U), ot && (M += U), T < P && (B && (L = A.x + A.w - P), T = P), M < P && (ut && (Y = A.y + A.h - P), M = P), {
174
+ x: L,
175
+ y: Y,
176
+ w: T,
177
+ h: M
178
178
  };
179
179
  }
180
- function Ae(L, M, H, U, D) {
181
- const W = St(H, U);
182
- if (!W) return !1;
183
- const A = mn(wn(H.type, W, H.data.waypoints, H.data.bezierControls));
184
- for (let N = 0; N < A.length - 1; N++) if (Le(L, M, A[N].x, A[N].y, A[N + 1].x, A[N + 1].y) < D) return !0;
180
+ function Le(A, R, D, U, P) {
181
+ const L = St(D, U);
182
+ if (!L) return !1;
183
+ const Y = mn(D.type, L, D.data.waypoints, D.data.bezierControls), T = vn(Y);
184
+ for (let M = 0; M < T.length - 1; M++) if (Ge(A, R, T[M].x, T[M].y, T[M + 1].x, T[M + 1].y) < P) return !0;
185
185
  return !1;
186
186
  }
187
- function gn(L, M, H, U) {
188
- const D = H.points;
189
- for (let W = 0; W < D.length - 1; W++) if (Le(L, M, D[W].x, D[W].y, D[W + 1].x, D[W + 1].y) < U) return !0;
187
+ function wn(A, R, D, U) {
188
+ const P = D.points;
189
+ for (let L = 0; L < P.length - 1; L++) if (Ge(A, R, P[L].x, P[L].y, P[L + 1].x, P[L + 1].y) < U) return !0;
190
190
  return !1;
191
191
  }
192
- function fr({ onPixiReady: L }) {
193
- const M = m(null), H = m(null), U = m(13751771), { pixiRef: D, readyRef: W } = Sn(M, le((f) => {
194
- U.current = f.gridDot, H.current && (H.current.dotColor = f.gridDot);
195
- }, [])), { setViewportInternal: A, viewportReqRef: N, viewport: E, autoFocus: q, showGrid: j, showAnchors: lt, gridSize: et, toolMode: $, edgeType: ot, focusOnRect: st, setFocusOnRect: zt, pendingPlacement: Ut, setPendingPlacement: Lt, setContextMenu: he, beginNodeDrag: $t, endNodeDrag: jt, presentation: Et, editingNodeId: Ct, setEditingNodeId: gt, readOnly: Ge, placementSnap: We } = Rn(), { currentCanvas: Ie, selection: Ye, setSelection: pt, setDoc: tt, currentCanvasId: be, pushCanvas: In, doc: Xe } = Mn(), _e = Yn(), Oe = m(_e);
196
- Oe.current = _e;
197
- const Fe = m(null), Jt = m(Ge);
198
- Jt.current = Ge;
199
- const Qt = m(We);
200
- Qt.current = We;
201
- const Nt = m(et);
202
- Nt.current = et;
203
- const kt = m(null), ye = m(null), pe = m(null), xe = m(null), Me = m(null), Re = m(null), Tt = m(null), te = m(null), ee = m(null), ge = m(null), Gt = m([]), Wt = m(null), Yt = m(null), ut = m(null), ne = m(null), Be = m({
192
+ function yr({ onPixiReady: A }) {
193
+ const R = v(null), D = v(null), U = v(13751771), P = ae((f) => {
194
+ U.current = f.gridDot, D.current && (D.current.dotColor = f.gridDot);
195
+ }, []), { pixiRef: L, readyRef: Y } = Cn(R, P), { setViewportInternal: T, viewportReqRef: M, viewport: B, autoFocus: j, showGrid: ut, showAnchors: ot, gridSize: $, toolMode: et, edgeType: st, focusOnRect: zt, setFocusOnRect: fe, pendingPlacement: wt, setPendingPlacement: he, setContextMenu: ye, beginNodeDrag: Kt, endNodeDrag: Ut, presentation: Ct, editingNodeId: Et, setEditingNodeId: $t, readOnly: We, placementSnap: Ye } = zn(), { currentCanvas: be, selection: Xe, setSelection: xt, setDoc: tt, currentCanvasId: Me, pushCanvas: bn, doc: _e } = Sn(), Oe = _n(), Fe = v(Oe);
196
+ Fe.current = Oe;
197
+ const Be = v(null), jt = v(We);
198
+ jt.current = We;
199
+ const Jt = v(Ye);
200
+ Jt.current = Ye;
201
+ const Nt = v($);
202
+ Nt.current = $;
203
+ const Tt = v(null), pe = v(null), xe = v(null), ge = v(null), Re = v(null), Se = v(null), kt = v(null), Qt = v(null), te = v(null), we = v(null), Lt = v([]), Gt = v(null), Wt = v(null), ft = v(null), ee = v(null), Ve = v({
204
204
  time: 0,
205
205
  wx: 0,
206
206
  wy: 0
207
- }), Xt = m({
207
+ }), Yt = v({
208
208
  time: 0,
209
209
  wx: 0,
210
210
  wy: 0
211
- }), Ve = m(0), re = m(null), qe = m({
211
+ }), qe = v(0), ne = v(null), Ze = v({
212
212
  x: 0,
213
213
  y: 0
214
- }), Ze = lt || Et ? Ie : {
215
- ...Ie,
216
- nodes: Ie.nodes.filter((f) => f.type !== "animAnchor")
217
- }, X = m(Ze);
218
- X.current = Ze;
219
- const Z = m(be);
220
- Z.current = be;
221
- const oe = m(Ye);
222
- oe.current = Ye;
223
- const Ke = m(Xe);
224
- Ke.current = Xe;
225
- const se = m($);
226
- se.current = $;
227
- const ie = m(q);
228
- ie.current = q;
229
- const ce = m(st);
230
- ce.current = st;
231
- const Ue = m(ot);
232
- Ue.current = ot;
233
- const $e = m(lt);
234
- $e.current = lt;
235
- const Dt = m(Et);
236
- Dt.current = Et;
237
- const de = m(Ut);
238
- de.current = Ut;
239
- const Se = m($t);
240
- Se.current = $t;
241
- const Ht = m(jt);
242
- Ht.current = jt;
243
- const it = m(null), nt = m(null), rt = m(null), ft = m(null), ct = m(null), wt = m(null), xt = m(null), mt = m(null), ze = m(E), Ee = m(0), { vmRef: B, screenToWorld: je } = zn(D, le((f) => {
244
- ze.current = f, Ee.current || (Ee.current = requestAnimationFrame(() => {
245
- Ee.current = 0, A(ze.current);
214
+ }), Ke = ot || Ct ? be : {
215
+ ...be,
216
+ nodes: be.nodes.filter((f) => f.type !== "animAnchor")
217
+ }, X = v(Ke);
218
+ X.current = Ke;
219
+ const Z = v(Me);
220
+ Z.current = Me;
221
+ const re = v(Xe);
222
+ re.current = Xe;
223
+ const Ue = v(_e);
224
+ Ue.current = _e;
225
+ const oe = v(et);
226
+ oe.current = et;
227
+ const se = v(j);
228
+ se.current = j;
229
+ const ce = v(zt);
230
+ ce.current = zt;
231
+ const $e = v(st);
232
+ $e.current = st;
233
+ const je = v(ot);
234
+ je.current = ot;
235
+ const Dt = v(Ct);
236
+ Dt.current = Ct;
237
+ const ie = v(wt);
238
+ ie.current = wt;
239
+ const ze = v(Kt);
240
+ ze.current = Kt;
241
+ const Ht = v(Ut);
242
+ Ht.current = Ut;
243
+ const ct = v(null), nt = v(null), rt = v(null), ht = v(null), it = v(null), mt = v(null), gt = v(null), vt = v(null), Ce = v(B), Ee = v(0), Mn = ae((f) => {
244
+ Ce.current = f, Ee.current || (Ee.current = requestAnimationFrame(() => {
245
+ Ee.current = 0, T(Ce.current);
246
246
  }));
247
- }, [A])), dt = m(je);
248
- dt.current = je;
249
- const [ht, Ce] = ln(null), [Ne, ke] = ln(null), Te = m(ht);
250
- Te.current = ht;
251
- const we = m(() => {
247
+ }, [T]), { vmRef: V, screenToWorld: Je } = En(L, Mn), dt = v(Je);
248
+ dt.current = Je;
249
+ const [yt, Ne] = un(null), [Te, ke] = un(null), De = v(yt);
250
+ De.current = yt;
251
+ const me = v(() => {
252
252
  });
253
- we.current = (f, G, F) => {
254
- gt(f === "node" ? G : null), Ce({
253
+ me.current = (f, G, O) => {
254
+ $t(f === "node" ? G : null), Ne({
255
255
  kind: f,
256
256
  id: G,
257
- value: F
257
+ value: O
258
258
  });
259
259
  };
260
- const Je = le((f) => {
261
- const G = Te.current;
262
- G && (tt((F) => {
263
- const Y = Z.current, K = F.canvases[Y];
264
- if (!K) return F;
265
- let V = K;
266
- if (G.kind === "node") V = {
260
+ const Qe = ae((f) => {
261
+ const G = De.current;
262
+ G && (tt((O) => {
263
+ const W = Z.current, K = O.canvases[W];
264
+ if (!K) return O;
265
+ let q = K;
266
+ if (G.kind === "node") q = {
267
267
  ...K,
268
- nodes: K.nodes.map((O) => O.id === G.id ? {
269
- ...O,
268
+ nodes: K.nodes.map((F) => F.id === G.id ? {
269
+ ...F,
270
270
  data: {
271
- ...O.data,
271
+ ...F.data,
272
272
  label: f
273
273
  }
274
- } : O)
274
+ } : F)
275
275
  };
276
- else if (G.kind === "edge") V = {
276
+ else if (G.kind === "edge") q = {
277
277
  ...K,
278
- edges: K.edges.map((O) => O.id === G.id ? {
279
- ...O,
278
+ edges: K.edges.map((F) => F.id === G.id ? {
279
+ ...F,
280
280
  data: {
281
- ...O.data,
281
+ ...F.data,
282
282
  labelText: f
283
283
  }
284
- } : O)
284
+ } : F)
285
285
  };
286
- else return F;
286
+ else return O;
287
287
  return {
288
- ...F,
288
+ ...O,
289
289
  canvases: {
290
- ...F.canvases,
291
- [Y]: V
290
+ ...O.canvases,
291
+ [W]: q
292
292
  }
293
293
  };
294
- }), Ce(null), gt(null), ke(null));
295
- }, [tt, gt]), bn = le(() => {
296
- Ce(null), gt(null), ke(null);
297
- }, [gt]);
294
+ }), Ne(null), $t(null), ke(null));
295
+ }, [tt, $t]), Rn = ae(() => {
296
+ Ne(null), $t(null), ke(null);
297
+ }, [$t]);
298
298
  Rt(() => {
299
- if (!Ct || Te.current?.id === Ct) return;
300
- const f = X.current.nodes.find((G) => G.id === Ct);
301
- f && we.current("node", f.id, f.data.label);
302
- }, [Ct]), Rt(() => {
303
- if (!ht) return;
304
- const f = B.current;
299
+ if (!Et || De.current?.id === Et) return;
300
+ const f = X.current.nodes.find((G) => G.id === Et);
301
+ f && me.current("node", f.id, f.data.label);
302
+ }, [Et]), Rt(() => {
303
+ if (!yt) return;
304
+ const f = V.current;
305
305
  if (!f) return;
306
306
  const G = X.current;
307
- let F = null;
308
- if (ht.kind === "node") {
309
- const Y = G.nodes.find((K) => K.id === ht.id);
310
- Y && (F = {
311
- x: Y.position.x + Y.width / 2,
312
- y: Y.position.y + Y.height / 2
307
+ let O = null;
308
+ if (yt.kind === "node") {
309
+ const W = G.nodes.find((K) => K.id === yt.id);
310
+ W && (O = {
311
+ x: W.position.x + W.width / 2,
312
+ y: W.position.y + W.height / 2
313
313
  });
314
- } else if (ht.kind === "edge") {
315
- const Y = G.edges.find((V) => V.id === ht.id), K = /* @__PURE__ */ new Map();
316
- for (const V of G.nodes) K.set(V.id, V);
317
- if (Y) {
318
- const V = St(Y, K);
319
- if (V) {
320
- const O = mn(wn(Y.type, V, Y.data.waypoints, Y.data.bezierControls)), at = O[Math.floor(O.length / 2)] ?? {
321
- x: (V.sx + V.tx) / 2,
322
- y: (V.sy + V.ty) / 2
314
+ } else if (yt.kind === "edge") {
315
+ const W = G.edges.find((q) => q.id === yt.id), K = /* @__PURE__ */ new Map();
316
+ for (const q of G.nodes) K.set(q.id, q);
317
+ if (W) {
318
+ const q = St(W, K);
319
+ if (q) {
320
+ const F = mn(W.type, q, W.data.waypoints, W.data.bezierControls), at = vn(F), lt = at[Math.floor(at.length / 2)] ?? {
321
+ x: (q.sx + q.tx) / 2,
322
+ y: (q.sy + q.ty) / 2
323
323
  };
324
- F = {
325
- x: at.x,
326
- y: at.y
324
+ O = {
325
+ x: lt.x,
326
+ y: lt.y
327
327
  };
328
328
  }
329
329
  }
330
330
  }
331
- if (F) {
332
- const Y = f.worldToScreen(F.x, F.y);
331
+ if (O) {
332
+ const W = f.worldToScreen(O.x, O.y);
333
333
  ke({
334
- x: Y.x,
335
- y: Y.y
334
+ x: W.x,
335
+ y: W.y
336
336
  });
337
337
  }
338
- }, [ht, B]);
339
- const Qe = m(0);
338
+ }, [yt, V]);
339
+ const tn = v(0);
340
340
  Rt(() => {
341
- N.current !== Qe.current && (Qe.current = N.current, ze.current = E, B.current?.setState(E));
341
+ M.current !== tn.current && (tn.current = M.current, Ce.current = B, V.current?.setState(B));
342
342
  }, [
343
- E,
344
343
  B,
345
- N
344
+ V,
345
+ M
346
346
  ]), Rt(() => {
347
- zt((f, G, F, Y, K) => {
348
- const V = B.current, O = M.current;
349
- if (!V || !O) return;
350
- const at = O.clientWidth || 800, vt = O.clientHeight || 600, It = Math.max(0, K?.padding ?? 60), _t = Math.max(1, at - It * 2), bt = Math.max(1, vt - It * 2), Pt = K?.preserveZoom ? V.state.zoom : Math.min(_t / Math.max(F, 1), bt / Math.max(Y, 1), K?.maxZoom ?? 2), At = f + F / 2, yt = G + Y / 2, ae = at / 2 - At * Pt, He = vt / 2 - yt * Pt;
351
- V.animateTo({
352
- x: ae,
353
- y: He,
347
+ fe((f, G, O, W, K) => {
348
+ const q = V.current, F = R.current;
349
+ if (!q || !F) return;
350
+ const at = F.clientWidth || 800, lt = F.clientHeight || 600, It = Math.max(0, K?.padding ?? 60), Xt = Math.max(1, at - It * 2), bt = Math.max(1, lt - It * 2), Pt = K?.preserveZoom ? q.state.zoom : Math.min(Xt / Math.max(O, 1), bt / Math.max(W, 1), K?.maxZoom ?? 2), At = f + O / 2, pt = G + W / 2, de = at / 2 - At * Pt, Pe = lt / 2 - pt * Pt;
351
+ q.animateTo({
352
+ x: de,
353
+ y: Pe,
354
354
  zoom: Pt
355
355
  }, K?.duration ?? 350);
356
356
  });
357
- }, [zt, B]);
358
- const tn = le((f) => {
357
+ }, [fe, V]);
358
+ const en = ae((f) => {
359
359
  tt((G) => {
360
- const F = G.canvases[Z.current];
361
- return F ? {
360
+ const O = G.canvases[Z.current];
361
+ return O ? {
362
362
  ...G,
363
363
  canvases: {
364
364
  ...G.canvases,
365
365
  [Z.current]: {
366
- ...F,
367
- lines: [...F.lines, f]
366
+ ...O,
367
+ lines: [...O.lines, f]
368
368
  }
369
369
  }
370
370
  } : G;
371
371
  });
372
- }, [tt, be]), De = m(tn);
373
- return De.current = tn, Rt(() => {
374
- const f = D.current;
372
+ }, [tt, Me]), He = v(en);
373
+ return He.current = en, Rt(() => {
374
+ const f = L.current;
375
375
  if (!f || f.destroyed) return;
376
- let G = !1, F = null, Y = null, K = null;
377
- const V = () => {
376
+ let G = !1, O = null, W = null, K = null;
377
+ const q = () => {
378
378
  if (G) return;
379
- if (!W.current) {
380
- setTimeout(V, 30);
379
+ if (!Y.current) {
380
+ setTimeout(q, 30);
381
381
  return;
382
382
  }
383
- H.current = new En(f.app.stage, et, j), H.current.dotColor = U.current, kt.current = new Cn(f.app.stage), ye.current = new Tn(f.world), pe.current = new Dn(f.world), xe.current = new Hn(f.world);
384
- const O = new ue();
385
- O.label = "connect-line", O.visible = !1, f.world.addChild(O), wt.current = O;
386
- const at = new ue();
387
- at.label = "transform-handles", f.app.stage.addChild(at), te.current = at;
388
- const vt = new ue();
389
- vt.label = "handle-hover", f.world.addChild(vt), ee.current = vt;
390
- const It = new ue();
391
- It.label = "edge-edit-handles", f.world.addChild(It), ne.current = It;
392
- const _t = new ue();
393
- _t.label = "ghost-placement", _t.alpha = 0.5, f.world.addChild(_t), re.current = _t, ge.current = new Ln(f.world), Me.current = new Pn(f.app.stage, f.world, {
394
- onLineComplete: (x) => De.current(x),
395
- screenToWorld: (x, s) => dt.current(x, s)
396
- }), Re.current = new An(f.app.stage, f.world, {
397
- onLineComplete: (x) => De.current(x),
398
- screenToWorld: (x, s) => dt.current(x, s)
399
- }), L?.(f);
383
+ D.current = new Nn(f.app.stage, $, ut), D.current.dotColor = U.current, Tt.current = new Tn(f.app.stage), pe.current = new Hn(f.world), xe.current = new Pn(f.world), ge.current = new An(f.world);
384
+ const F = new le();
385
+ F.label = "connect-line", F.visible = !1, f.world.addChild(F), mt.current = F;
386
+ const at = new le();
387
+ at.label = "transform-handles", f.app.stage.addChild(at), Qt.current = at;
388
+ const lt = new le();
389
+ lt.label = "handle-hover", f.world.addChild(lt), te.current = lt;
390
+ const It = new le();
391
+ It.label = "edge-edit-handles", f.world.addChild(It), ee.current = It;
392
+ const Xt = new le();
393
+ Xt.label = "ghost-placement", Xt.alpha = 0.5, f.world.addChild(Xt), ne.current = Xt, we.current = new Wn(f.world), Re.current = new Ln(f.app.stage, f.world, {
394
+ onLineComplete: (g) => He.current(g),
395
+ screenToWorld: (g, c) => dt.current(g, c)
396
+ }), Se.current = new Gn(f.app.stage, f.world, {
397
+ onLineComplete: (g) => He.current(g),
398
+ screenToWorld: (g, c) => dt.current(g, c)
399
+ }), A?.(f);
400
400
  const bt = f.app.stage;
401
- bt.on("pointerdown", (x) => {
402
- if (M.current?.focus({ preventScroll: !0 }), B.current?.multiTouchActive || B.current?.isPanning || B.current?.isSpaceHeld || x.button !== 0) return;
403
- const s = se.current;
404
- if (s === "pan") {
405
- B.current?.startPan(x.global.x, x.global.y);
401
+ bt.on("pointerdown", (g) => {
402
+ if (R.current?.focus({ preventScroll: !0 }), V.current?.multiTouchActive || V.current?.isPanning || V.current?.isSpaceHeld || g.button !== 0) return;
403
+ const c = oe.current;
404
+ if (c === "pan") {
405
+ V.current?.startPan(g.global.x, g.global.y);
406
406
  return;
407
407
  }
408
- if (s === "freehand" || s === "line" || s === "polyline" || s === "arrow") return;
409
- const c = dt.current(x.global.x, x.global.y), p = X.current.nodes, P = X.current.edges, k = X.current.lines, R = oe.current, S = x.metaKey || x.ctrlKey || x.shiftKey, T = B.current?.state.zoom ?? 1;
410
- if (de.current) return;
411
- const r = Date.now(), h = Be.current, l = r - h.time < 350 && Math.hypot(c.x - h.wx, c.y - h.wy) < 8 / T;
412
- if (Be.current = {
413
- time: r,
414
- wx: c.x,
415
- wy: c.y
416
- }, R.nodeIds.size === 1 && !S && s === "select" && !Jt.current) {
417
- const t = p.find((o) => o.id === [...R.nodeIds][0]);
408
+ if (c === "freehand" || c === "line" || c === "polyline" || c === "arrow") return;
409
+ const i = dt.current(g.global.x, g.global.y), p = X.current.nodes, H = X.current.edges, N = X.current.lines, z = re.current, C = g.metaKey || g.ctrlKey || g.shiftKey, k = V.current?.state.zoom ?? 1;
410
+ if (ie.current) return;
411
+ const o = Date.now(), x = Ve.current, l = o - x.time < 350 && Math.hypot(i.x - x.wx, i.y - x.wy) < 8 / k;
412
+ if (Ve.current = {
413
+ time: o,
414
+ wx: i.x,
415
+ wy: i.y
416
+ }, z.nodeIds.size === 1 && !C && c === "select" && !jt.current) {
417
+ const t = p.find((r) => r.id === [...z.nodeIds][0]);
418
418
  if (t) {
419
- const o = fn(t, T);
420
- if (Math.hypot(c.x - o.x, c.y - o.y) < Q(T, 12, 24)) {
421
- ft.current = {
419
+ const r = hn(t, k);
420
+ if (Math.hypot(i.x - r.x, i.y - r.y) < Q(k, 12, 24)) {
421
+ ht.current = {
422
422
  active: !0,
423
423
  nodeId: t.id,
424
424
  cx: t.position.x + t.width / 2,
425
425
  cy: t.position.y + t.height / 2,
426
- startPointerAngle: Math.atan2(c.y - (t.position.y + t.height / 2), c.x - (t.position.x + t.width / 2)),
426
+ startPointerAngle: Math.atan2(i.y - (t.position.y + t.height / 2), i.x - (t.position.x + t.width / 2)),
427
427
  startRotation: t.data.rotation ?? 0
428
- }, Se.current();
428
+ }, ze.current();
429
429
  return;
430
430
  }
431
431
  }
432
432
  }
433
- if (R.nodeIds.size === 1 && !S && s === "select") {
434
- const t = p.find((o) => o.id === [...R.nodeIds][0]);
433
+ if (z.nodeIds.size === 1 && !C && c === "select") {
434
+ const t = p.find((r) => r.id === [...z.nodeIds][0]);
435
435
  if (t) {
436
- const o = hn(c, t, Q(T, 10, 16));
437
- if (o) {
438
- const a = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), n = t.type === "geometryGroup", d = n || t.type === "flowGroup" || t.data.isGroup, w = t.position.x, g = t.position.y, z = t.width, C = t.height;
436
+ const r = yn(i, t, Q(k, 10, 16));
437
+ if (r) {
438
+ const a = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), n = t.type === "geometryGroup", s = n || t.type === "flowGroup" || t.data.isGroup, m = t.position.x, h = t.position.y, I = t.width, S = t.height;
439
439
  for (const u of p)
440
440
  u.id !== t.id && (u.parentId === t.id ? a.set(u.id, {
441
441
  x: u.position.x,
442
442
  y: u.position.y,
443
443
  w: u.width,
444
444
  h: u.height
445
- }) : n && u.position.x >= w && u.position.y >= g && u.position.x + u.width <= w + z && u.position.y + u.height <= g + C && a.set(u.id, {
445
+ }) : n && u.position.x >= m && u.position.y >= h && u.position.x + u.width <= m + I && u.position.y + u.height <= h + S && a.set(u.id, {
446
446
  x: u.position.x,
447
447
  y: u.position.y,
448
448
  w: u.width,
449
449
  h: u.height
450
450
  }));
451
- if (d)
452
- for (const u of X.current.lines) u.parentId === t.id ? i.set(u.id, u.points.map((b) => ({ ...b }))) : n && u.points.length > 0 && u.points.every((b) => b.x >= w && b.x <= w + z && b.y >= g && b.y <= g + C) && i.set(u.id, u.points.map((b) => ({ ...b })));
453
- xt.current = {
451
+ if (s)
452
+ for (const u of X.current.lines) u.parentId === t.id ? d.set(u.id, u.points.map((b) => ({ ...b }))) : n && u.points.length > 0 && u.points.every((b) => b.x >= m && b.x <= m + I && b.y >= h && b.y <= h + S) && d.set(u.id, u.points.map((b) => ({ ...b })));
453
+ gt.current = {
454
454
  active: !0,
455
455
  nodeId: t.id,
456
- handle: o,
457
- startWorld: c,
456
+ handle: r,
457
+ startWorld: i,
458
458
  startBounds: {
459
459
  x: t.position.x,
460
460
  y: t.position.y,
@@ -462,108 +462,108 @@ function fr({ onPixiReady: L }) {
462
462
  h: t.height
463
463
  },
464
464
  childStarts: a,
465
- childLineStarts: i.size > 0 ? i : void 0
465
+ childLineStarts: d.size > 0 ? d : void 0
466
466
  };
467
467
  return;
468
468
  }
469
469
  }
470
470
  }
471
471
  let e = null;
472
- for (let t = p.length - 1; t >= 0; t--) if (qt(c.x, c.y, p[t])) {
472
+ for (let t = p.length - 1; t >= 0; t--) if (Vt(i.x, i.y, p[t])) {
473
473
  e = p[t];
474
474
  break;
475
475
  }
476
476
  if (e?.parentId) {
477
- const t = p.find((o) => o.id === e.parentId);
477
+ const t = p.find((r) => r.id === e.parentId);
478
478
  t && (e = t);
479
479
  }
480
- fe && (Tt.current = e ? e.parentId ? p.find((t) => t.id === e.parentId)?.id ?? e.id : e.id : null, Wt.current = null, Yt.current = null);
481
- let I = !1;
482
- if (e && s === "select" && (I = Math.min(c.x - e.position.x, e.position.x + e.width - c.x, c.y - e.position.y, e.position.y + e.height - c.y) > Math.min(14, Math.min(e.width, e.height) * 0.3)), (s === "select" || s === "connect") && (e || fe) && !I) {
483
- const t = e ? [e] : p, o = Q(T, 14, 20);
484
- let a = null, i = null, n = 1 / 0;
485
- for (const d of t) {
486
- const w = Bt(Mt(d.width, d.height), d, c.x, c.y, o);
487
- if (!w) continue;
488
- const g = Vt(w, d), z = Math.hypot(c.x - g.x, c.y - g.y);
489
- z < n && (n = z, a = d, i = w);
480
+ ue && (kt.current = e ? e.parentId ? p.find((t) => t.id === e.parentId)?.id ?? e.id : e.id : null, Gt.current = null, Wt.current = null);
481
+ let w = !1;
482
+ if (e && c === "select" && (w = Math.min(i.x - e.position.x, e.position.x + e.width - i.x, i.y - e.position.y, e.position.y + e.height - i.y) > Math.min(14, Math.min(e.width, e.height) * 0.3)), (c === "select" || c === "connect") && (e || ue) && !w) {
483
+ const t = e ? [e] : p, r = Q(k, 14, 20);
484
+ let a = null, d = null, n = 1 / 0;
485
+ for (const s of t) {
486
+ const m = Mt(s.width, s.height), h = Ft(m, s, i.x, i.y, r);
487
+ if (!h) continue;
488
+ const I = Bt(h, s), S = Math.hypot(i.x - I.x, i.y - I.y);
489
+ S < n && (n = S, a = s, d = h);
490
490
  }
491
- if (a && i) {
491
+ if (a && d) {
492
492
  rt.current = {
493
493
  active: !0,
494
494
  sourceNodeId: a.id,
495
- sourceHandleId: i.id
495
+ sourceHandleId: d.id
496
496
  };
497
497
  return;
498
498
  }
499
499
  }
500
- if ((s === "select" || s === "connect") && !S && R.edgeIds.size > 0) {
500
+ if ((c === "select" || c === "connect") && !C && z.edgeIds.size > 0) {
501
501
  const t = /* @__PURE__ */ new Map();
502
- for (const i of p) t.set(i.id, i);
503
- const o = P.filter((i) => R.edgeIds.has(i.id)), a = yn(c.x, c.y, o, t, Q(T, 14, 20));
502
+ for (const d of p) t.set(d.id, d);
503
+ const r = H.filter((d) => z.edgeIds.has(d.id)), a = pn(i.x, i.y, r, t, Q(k, 14, 20));
504
504
  if (a) {
505
- const i = P.find((n) => n.id === a.edgeId);
506
- if (i) {
505
+ const d = H.find((n) => n.id === a.edgeId);
506
+ if (d) {
507
507
  const n = a.end === "source" ? "target" : "source";
508
- ct.current = {
508
+ it.current = {
509
509
  active: !0,
510
- edgeId: i.id,
510
+ edgeId: d.id,
511
511
  movingEnd: a.end,
512
- fixedNodeId: n === "source" ? i.source : i.target,
513
- fixedHandleId: n === "source" ? i.sourceHandle : i.targetHandle
512
+ fixedNodeId: n === "source" ? d.source : d.target,
513
+ fixedHandleId: n === "source" ? d.sourceHandle : d.targetHandle
514
514
  };
515
515
  return;
516
516
  }
517
517
  }
518
518
  }
519
- if (s === "select" && R.edgeIds.size > 0 && !e) {
519
+ if (c === "select" && z.edgeIds.size > 0 && !e) {
520
520
  const t = /* @__PURE__ */ new Map();
521
- for (const d of p) t.set(d.id, d);
522
- const o = P.filter((d) => R.edgeIds.has(d.id)), a = Q(T, 10, 14), i = xn(c.x, c.y, o, t, a);
523
- if (i) {
524
- ut.current = {
521
+ for (const s of p) t.set(s.id, s);
522
+ const r = H.filter((s) => z.edgeIds.has(s.id)), a = Q(k, 10, 14), d = gn(i.x, i.y, r, t, a);
523
+ if (d) {
524
+ ft.current = {
525
525
  active: !0,
526
- edgeId: i.edgeId,
527
- type: i.controlEnd === "c1" ? "bezierC1" : "bezierC2",
528
- index: i.segmentIndex
526
+ edgeId: d.edgeId,
527
+ type: d.controlEnd === "c1" ? "bezierC1" : "bezierC2",
528
+ index: d.segmentIndex
529
529
  };
530
530
  return;
531
531
  }
532
- const n = pn(c.x, c.y, o, a);
532
+ const n = xn(i.x, i.y, r, a);
533
533
  if (n) {
534
534
  if (l) {
535
- tt((d) => {
536
- const w = d.canvases[Z.current];
537
- return w ? {
538
- ...d,
535
+ tt((s) => {
536
+ const m = s.canvases[Z.current];
537
+ return m ? {
538
+ ...s,
539
539
  canvases: {
540
- ...d.canvases,
540
+ ...s.canvases,
541
541
  [Z.current]: {
542
- ...w,
543
- edges: w.edges.map((g) => {
544
- if (g.id !== n.edgeId) return g;
545
- const z = [...g.data.waypoints ?? []];
546
- z.splice(n.waypointIndex, 1);
547
- const C = {
548
- ...g.data,
549
- waypoints: z.length > 0 ? z : void 0
542
+ ...m,
543
+ edges: m.edges.map((h) => {
544
+ if (h.id !== n.edgeId) return h;
545
+ const I = [...h.data.waypoints ?? []];
546
+ I.splice(n.waypointIndex, 1);
547
+ const S = {
548
+ ...h.data,
549
+ waypoints: I.length > 0 ? I : void 0
550
550
  };
551
- if (g.type === "simplebezier" && g.data.bezierControls) {
552
- const u = [...g.data.bezierControls];
553
- u.splice(n.waypointIndex, 2, null), C.bezierControls = u.some((b) => b !== null) ? u : void 0;
551
+ if (h.type === "simplebezier" && h.data.bezierControls) {
552
+ const u = [...h.data.bezierControls];
553
+ u.splice(n.waypointIndex, 2, null), S.bezierControls = u.some((b) => b !== null) ? u : void 0;
554
554
  }
555
555
  return {
556
- ...g,
557
- data: C
556
+ ...h,
557
+ data: S
558
558
  };
559
559
  })
560
560
  }
561
561
  }
562
- } : d;
562
+ } : s;
563
563
  });
564
564
  return;
565
565
  }
566
- ut.current = {
566
+ ft.current = {
567
567
  active: !0,
568
568
  edgeId: n.edgeId,
569
569
  type: "waypoint",
@@ -572,23 +572,23 @@ function fr({ onPixiReady: L }) {
572
572
  return;
573
573
  }
574
574
  if (l) {
575
- for (const d of o) if (Ae(c.x, c.y, d, t, Q(T, 8, 12))) {
576
- const w = _n(c.x, c.y, d, t), g = {
577
- x: c.x,
578
- y: c.y
575
+ for (const s of r) if (Le(i.x, i.y, s, t, Q(k, 8, 12))) {
576
+ const m = Fn(i.x, i.y, s, t), h = {
577
+ x: i.x,
578
+ y: i.y
579
579
  };
580
- tt((z) => {
581
- const C = z.canvases[Z.current];
582
- return C ? {
583
- ...z,
580
+ tt((I) => {
581
+ const S = I.canvases[Z.current];
582
+ return S ? {
583
+ ...I,
584
584
  canvases: {
585
- ...z.canvases,
585
+ ...I.canvases,
586
586
  [Z.current]: {
587
- ...C,
588
- edges: C.edges.map((u) => {
589
- if (u.id !== d.id) return u;
587
+ ...S,
588
+ edges: S.edges.map((u) => {
589
+ if (u.id !== s.id) return u;
590
590
  const b = [...u.data.waypoints ?? []];
591
- b.splice(w, 0, g);
591
+ b.splice(m, 0, h);
592
592
  const _ = {
593
593
  ...u.data,
594
594
  waypoints: b
@@ -596,7 +596,7 @@ function fr({ onPixiReady: L }) {
596
596
  if (u.type === "simplebezier" && u.data.bezierControls) {
597
597
  const J = [...u.data.bezierControls];
598
598
  for (; J.length < (u.data.waypoints ?? []).length + 1; ) J.push(null);
599
- J.splice(w, 1, null, null), _.bezierControls = J;
599
+ J.splice(m, 1, null, null), _.bezierControls = J;
600
600
  }
601
601
  return {
602
602
  ...u,
@@ -605,87 +605,87 @@ function fr({ onPixiReady: L }) {
605
605
  })
606
606
  }
607
607
  }
608
- } : z;
609
- }), ut.current = {
608
+ } : I;
609
+ }), ft.current = {
610
610
  active: !0,
611
- edgeId: d.id,
611
+ edgeId: s.id,
612
612
  type: "waypoint",
613
- index: w
613
+ index: m
614
614
  };
615
615
  return;
616
616
  }
617
617
  }
618
618
  }
619
- if (e && (s === "select" || s === "connect")) {
620
- !S && !R.nodeIds.has(e.id) ? pt({
619
+ if (e && (c === "select" || c === "connect")) {
620
+ !C && !z.nodeIds.has(e.id) ? xt({
621
621
  nodeIds: /* @__PURE__ */ new Set([e.id]),
622
622
  edgeIds: /* @__PURE__ */ new Set(),
623
623
  lineIds: /* @__PURE__ */ new Set()
624
- }) : S && pt((n) => {
625
- const d = new Set(n.nodeIds);
626
- return d.has(e.id) ? d.delete(e.id) : d.add(e.id), {
627
- nodeIds: d,
624
+ }) : C && xt((n) => {
625
+ const s = new Set(n.nodeIds);
626
+ return s.has(e.id) ? s.delete(e.id) : s.add(e.id), {
627
+ nodeIds: s,
628
628
  edgeIds: /* @__PURE__ */ new Set(),
629
629
  lineIds: /* @__PURE__ */ new Set()
630
630
  };
631
- }), ie.current && ce.current(e.position.x, e.position.y, e.width, e.height, {
631
+ }), se.current && ce.current(e.position.x, e.position.y, e.width, e.height, {
632
632
  padding: 80,
633
633
  preserveZoom: !0,
634
634
  duration: 280
635
635
  });
636
- const t = R.nodeIds.has(e.id) ? new Set(R.nodeIds) : /* @__PURE__ */ new Set([e.id]);
637
- S && !R.nodeIds.has(e.id) && t.add(e.id);
638
- const o = /* @__PURE__ */ new Set();
636
+ const t = z.nodeIds.has(e.id) ? new Set(z.nodeIds) : /* @__PURE__ */ new Set([e.id]);
637
+ C && !z.nodeIds.has(e.id) && t.add(e.id);
638
+ const r = /* @__PURE__ */ new Set();
639
639
  for (const n of [...t]) {
640
- const d = p.find((b) => b.id === n);
641
- if (!d || d.type !== "flowGroup" && d.type !== "geometryGroup" && !d.data.isGroup) continue;
642
- const w = d.type === "geometryGroup", g = d.position.x, z = d.position.y, C = d.width, u = d.height;
640
+ const s = p.find((b) => b.id === n);
641
+ if (!s || s.type !== "flowGroup" && s.type !== "geometryGroup" && !s.data.isGroup) continue;
642
+ const m = s.type === "geometryGroup", h = s.position.x, I = s.position.y, S = s.width, u = s.height;
643
643
  for (const b of p)
644
644
  if (!(t.has(b.id) || b.id === n)) {
645
645
  if (b.parentId === n) {
646
646
  t.add(b.id);
647
647
  continue;
648
648
  }
649
- w && b.position.x >= g && b.position.y >= z && b.position.x + b.width <= g + C && b.position.y + b.height <= z + u && t.add(b.id);
649
+ m && b.position.x >= h && b.position.y >= I && b.position.x + b.width <= h + S && b.position.y + b.height <= I + u && t.add(b.id);
650
650
  }
651
- for (const b of X.current.lines) b.parentId === n && o.add(b.id);
652
- if (w) for (const b of X.current.lines)
653
- o.has(b.id) || b.points.length > 0 && b.points.every((_) => _.x >= g && _.x <= g + C && _.y >= z && _.y <= z + u) && o.add(b.id);
651
+ for (const b of X.current.lines) b.parentId === n && r.add(b.id);
652
+ if (m) for (const b of X.current.lines)
653
+ r.has(b.id) || b.points.length > 0 && b.points.every((_) => _.x >= h && _.x <= h + S && _.y >= I && _.y <= I + u) && r.add(b.id);
654
654
  }
655
655
  const a = /* @__PURE__ */ new Map();
656
656
  for (const n of p) t.has(n.id) && a.set(n.id, { ...n.position });
657
- const i = /* @__PURE__ */ new Map();
658
- if (o.size > 0)
659
- for (const n of X.current.lines) o.has(n.id) && i.set(n.id, n.points.map((d) => ({ ...d })));
660
- it.current = {
657
+ const d = /* @__PURE__ */ new Map();
658
+ if (r.size > 0)
659
+ for (const n of X.current.lines) r.has(n.id) && d.set(n.id, n.points.map((s) => ({ ...s })));
660
+ ct.current = {
661
661
  active: !0,
662
662
  nodeIds: t,
663
- lineIds: o.size > 0 ? o : void 0,
664
- startWorld: c,
663
+ lineIds: r.size > 0 ? r : void 0,
664
+ startWorld: i,
665
665
  nodeStarts: a,
666
- linePointStarts: i.size > 0 ? i : void 0
667
- }, Se.current();
666
+ linePointStarts: d.size > 0 ? d : void 0
667
+ }, ze.current();
668
668
  return;
669
669
  }
670
670
  const y = /* @__PURE__ */ new Map();
671
671
  for (const t of p) y.set(t.id, t);
672
- const v = Q(T, 8, 12);
673
- for (const t of P) if (Ae(c.x, c.y, t, y, v)) {
674
- if (pt(S ? (o) => {
675
- const a = new Set(o.edgeIds);
672
+ const E = Q(k, 8, 12);
673
+ for (const t of H) if (Le(i.x, i.y, t, y, E)) {
674
+ if (xt(C ? (r) => {
675
+ const a = new Set(r.edgeIds);
676
676
  return a.has(t.id) ? a.delete(t.id) : a.add(t.id), {
677
- ...o,
677
+ ...r,
678
678
  edgeIds: a
679
679
  };
680
680
  } : {
681
681
  nodeIds: /* @__PURE__ */ new Set(),
682
682
  edgeIds: /* @__PURE__ */ new Set([t.id]),
683
683
  lineIds: /* @__PURE__ */ new Set()
684
- }), ie.current) {
685
- const o = y.get(t.source), a = y.get(t.target);
686
- if (o && a) {
687
- const i = Math.min(o.position.x, a.position.x), n = Math.min(o.position.y, a.position.y), d = Math.max(o.position.x + o.width, a.position.x + a.width), w = Math.max(o.position.y + o.height, a.position.y + a.height);
688
- ce.current(i, n, d - i, w - n, {
684
+ }), se.current) {
685
+ const r = y.get(t.source), a = y.get(t.target);
686
+ if (r && a) {
687
+ const d = Math.min(r.position.x, a.position.x), n = Math.min(r.position.y, a.position.y), s = Math.max(r.position.x + r.width, a.position.x + a.width), m = Math.max(r.position.y + r.height, a.position.y + a.height);
688
+ ce.current(d, n, s - d, m - n, {
689
689
  padding: 80,
690
690
  preserveZoom: !0,
691
691
  duration: 280
@@ -694,117 +694,117 @@ function fr({ onPixiReady: L }) {
694
694
  }
695
695
  return;
696
696
  }
697
- for (const t of k) if (gn(c.x, c.y, t, v)) {
698
- const o = R.lineIds.has(t.id);
699
- if (S ? pt((n) => {
700
- const d = new Set(n.lineIds);
701
- return d.has(t.id) ? d.delete(t.id) : d.add(t.id), {
697
+ for (const t of N) if (wn(i.x, i.y, t, E)) {
698
+ const r = z.lineIds.has(t.id);
699
+ if (C ? xt((n) => {
700
+ const s = new Set(n.lineIds);
701
+ return s.has(t.id) ? s.delete(t.id) : s.add(t.id), {
702
702
  ...n,
703
- lineIds: d
703
+ lineIds: s
704
704
  };
705
- }) : o || pt({
705
+ }) : r || xt({
706
706
  nodeIds: /* @__PURE__ */ new Set(),
707
707
  edgeIds: /* @__PURE__ */ new Set(),
708
708
  lineIds: /* @__PURE__ */ new Set([t.id])
709
- }), ie.current && t.points.length > 0) {
710
- const n = t.points.map((u) => u.x), d = t.points.map((u) => u.y), w = Math.min(...n), g = Math.min(...d), z = Math.max(...n), C = Math.max(...d);
711
- ce.current(w, g, Math.max(1, z - w), Math.max(1, C - g), {
709
+ }), se.current && t.points.length > 0) {
710
+ const n = t.points.map((u) => u.x), s = t.points.map((u) => u.y), m = Math.min(...n), h = Math.min(...s), I = Math.max(...n), S = Math.max(...s);
711
+ ce.current(m, h, Math.max(1, I - m), Math.max(1, S - h), {
712
712
  padding: 80,
713
713
  preserveZoom: !0,
714
714
  duration: 280
715
715
  });
716
716
  }
717
- const a = o ? new Set(R.lineIds) : /* @__PURE__ */ new Set([t.id]), i = /* @__PURE__ */ new Map();
718
- for (const n of k) a.has(n.id) && i.set(n.id, n.points.map((d) => ({ ...d })));
719
- mt.current = {
717
+ const a = r ? new Set(z.lineIds) : /* @__PURE__ */ new Set([t.id]), d = /* @__PURE__ */ new Map();
718
+ for (const n of N) a.has(n.id) && d.set(n.id, n.points.map((s) => ({ ...s })));
719
+ vt.current = {
720
720
  active: !0,
721
721
  lineIds: a,
722
- startWorld: c,
723
- pointStarts: i
722
+ startWorld: i,
723
+ pointStarts: d
724
724
  };
725
725
  return;
726
726
  }
727
- S || pt({
727
+ C || xt({
728
728
  nodeIds: /* @__PURE__ */ new Set(),
729
729
  edgeIds: /* @__PURE__ */ new Set(),
730
730
  lineIds: /* @__PURE__ */ new Set()
731
- }), s === "select" && (nt.current = {
731
+ }), c === "select" && (nt.current = {
732
732
  active: !0,
733
733
  startScreen: {
734
- x: x.global.x,
735
- y: x.global.y
734
+ x: g.global.x,
735
+ y: g.global.y
736
736
  }
737
737
  });
738
- }), bt.on("globalpointermove", (x) => {
739
- const s = dt.current(x.global.x, x.global.y);
740
- if (qe.current = s, B.current?.multiTouchActive) return;
741
- const c = se.current;
742
- if (c === "freehand" || c === "line" || c === "polyline" || c === "arrow") return;
743
- const p = X.current.nodes, P = X.current.edges, k = B.current?.state.zoom ?? 1, R = !it.current?.active && !rt.current?.active && !xt.current?.active && !ct.current?.active && !ut.current?.active && !mt.current?.active && !ft.current?.active;
744
- let S = null;
745
- for (let r = p.length - 1; r >= 0; r--) if (qt(s.x, s.y, p[r])) {
746
- const h = p[r];
747
- S = h.parentId ? p.find((l) => l.id === h.parentId)?.id ?? h.id : h.id;
738
+ }), bt.on("globalpointermove", (g) => {
739
+ const c = dt.current(g.global.x, g.global.y);
740
+ if (Ze.current = c, V.current?.multiTouchActive) return;
741
+ const i = oe.current;
742
+ if (i === "freehand" || i === "line" || i === "polyline" || i === "arrow") return;
743
+ const p = X.current.nodes, H = X.current.edges, N = V.current?.state.zoom ?? 1, z = !ct.current?.active && !rt.current?.active && !gt.current?.active && !it.current?.active && !ft.current?.active && !vt.current?.active && !ht.current?.active;
744
+ let C = null;
745
+ for (let o = p.length - 1; o >= 0; o--) if (Vt(c.x, c.y, p[o])) {
746
+ const x = p[o];
747
+ C = x.parentId ? p.find((l) => l.id === x.parentId)?.id ?? x.id : x.id;
748
748
  break;
749
749
  }
750
- if (Tt.current = S, R && (c === "select" || c === "connect")) {
751
- const r = /* @__PURE__ */ new Map();
752
- for (const y of p) r.set(y.id, y);
753
- const h = oe.current, l = h.edgeIds.size > 0 ? P.filter((y) => h.edgeIds.has(y.id)) : [], e = l.length > 0 ? yn(s.x, s.y, l, r, Q(k, 12, 18)) : null;
754
- Yt.current = e;
755
- let I = null;
756
- if (S) {
757
- const y = p.find((v) => v.id === S);
750
+ if (kt.current = C, z && (i === "select" || i === "connect")) {
751
+ const o = /* @__PURE__ */ new Map();
752
+ for (const y of p) o.set(y.id, y);
753
+ const x = re.current, l = x.edgeIds.size > 0 ? H.filter((y) => x.edgeIds.has(y.id)) : [], e = l.length > 0 ? pn(c.x, c.y, l, o, Q(N, 12, 18)) : null;
754
+ Wt.current = e;
755
+ let w = null;
756
+ if (C) {
757
+ const y = p.find((E) => E.id === C);
758
758
  if (y) {
759
- const v = Bt(Mt(y.width, y.height), y, s.x, s.y, Q(k, 14, 20));
760
- if (v) {
761
- const t = Vt(v, y);
762
- I = {
759
+ const E = Mt(y.width, y.height), t = Ft(E, y, c.x, c.y, Q(N, 14, 20));
760
+ if (t) {
761
+ const r = Bt(t, y);
762
+ w = {
763
763
  nodeId: y.id,
764
- handleId: v.id,
765
- wx: t.x,
766
- wy: t.y
764
+ handleId: t.id,
765
+ wx: r.x,
766
+ wy: r.y
767
767
  };
768
768
  }
769
769
  }
770
770
  }
771
- Wt.current = I;
771
+ Gt.current = w;
772
772
  }
773
- const T = M.current;
774
- if (T && R) {
775
- const r = oe.current;
776
- let h = "";
777
- if (Yt.current) h = "crosshair";
778
- else if (Wt.current) h = "crosshair";
779
- else if (r.edgeIds.size > 0 && c === "select") {
780
- const l = P.filter((y) => r.edgeIds.has(y.id)), e = /* @__PURE__ */ new Map();
773
+ const k = R.current;
774
+ if (k && z) {
775
+ const o = re.current;
776
+ let x = "";
777
+ if (Wt.current) x = "crosshair";
778
+ else if (Gt.current) x = "crosshair";
779
+ else if (o.edgeIds.size > 0 && i === "select") {
780
+ const l = H.filter((y) => o.edgeIds.has(y.id)), e = /* @__PURE__ */ new Map();
781
781
  for (const y of p) e.set(y.id, y);
782
- const I = Q(k, 10, 14);
783
- (pn(s.x, s.y, l, I) || xn(s.x, s.y, l, e, I)) && (h = "grab");
782
+ const w = Q(N, 10, 14);
783
+ (xn(c.x, c.y, l, w) || gn(c.x, c.y, l, e, w)) && (x = "grab");
784
784
  }
785
- if (!h && r.nodeIds.size === 1 && c === "select") {
786
- const l = p.find((e) => e.id === [...r.nodeIds][0]);
785
+ if (!x && o.nodeIds.size === 1 && i === "select") {
786
+ const l = p.find((e) => e.id === [...o.nodeIds][0]);
787
787
  if (l) {
788
- const e = hn(s, l, Q(k, 10, 16));
789
- if (e) h = Xn[e];
790
- else if (!Jt.current) {
791
- const I = fn(l, k);
792
- Math.hypot(s.x - I.x, s.y - I.y) < Q(k, 12, 24) && (h = "grab");
788
+ const e = yn(c, l, Q(N, 10, 16));
789
+ if (e) x = On[e];
790
+ else if (!jt.current) {
791
+ const w = hn(l, N);
792
+ Math.hypot(c.x - w.x, c.y - w.y) < Q(N, 12, 24) && (x = "grab");
793
793
  }
794
794
  }
795
795
  }
796
- if (!h && c === "select") {
797
- const l = X.current.lines, e = Q(k, 8, 12);
798
- for (const I of l) if (gn(s.x, s.y, I, e)) {
799
- h = "move";
796
+ if (!x && i === "select") {
797
+ const l = X.current.lines, e = Q(N, 8, 12);
798
+ for (const w of l) if (wn(c.x, c.y, w, e)) {
799
+ x = "move";
800
800
  break;
801
801
  }
802
802
  }
803
- T.style.cursor = h;
803
+ k.style.cursor = x;
804
804
  }
805
- if (xt.current?.active) {
806
- const r = xt.current, h = s.x - r.startWorld.x, l = s.y - r.startWorld.y, e = On(r.startBounds, r.handle, h, l), I = X.current.nodes, y = me([{
807
- id: r.nodeId,
805
+ if (gt.current?.active) {
806
+ const o = gt.current, x = c.x - o.startWorld.x, l = c.y - o.startWorld.y, e = Bn(o.startBounds, o.handle, x, l), w = X.current.nodes, y = {
807
+ id: o.nodeId,
808
808
  type: "shapeRect",
809
809
  position: {
810
810
  x: e.x,
@@ -813,74 +813,74 @@ function fr({ onPixiReady: L }) {
813
813
  width: e.w,
814
814
  height: e.h,
815
815
  data: {}
816
- }], I);
817
- if (e.x += y.dx, e.y += y.dy, (r.handle === "ne" || r.handle === "se") && (e.w += y.dx), (r.handle === "se" || r.handle === "sw") && (e.h += y.dy), Gt.current = y.guides, Qt.current && Nt.current > 0 && y.guides.length === 0) {
818
- const n = Nt.current;
819
- (r.handle === "nw" || r.handle === "sw") && (e.x = Math.round(e.x / n) * n), (r.handle === "nw" || r.handle === "ne") && (e.y = Math.round(e.y / n) * n), (r.handle === "ne" || r.handle === "se") && (e.w = Math.round((e.x + e.w) / n) * n - e.x), (r.handle === "se" || r.handle === "sw") && (e.h = Math.round((e.y + e.h) / n) * n - e.y);
816
+ }, E = ve([y], w);
817
+ if (e.x += E.dx, e.y += E.dy, (o.handle === "ne" || o.handle === "se") && (e.w += E.dx), (o.handle === "se" || o.handle === "sw") && (e.h += E.dy), Lt.current = E.guides, Jt.current && Nt.current > 0 && E.guides.length === 0) {
818
+ const s = Nt.current;
819
+ (o.handle === "nw" || o.handle === "sw") && (e.x = Math.round(e.x / s) * s), (o.handle === "nw" || o.handle === "ne") && (e.y = Math.round(e.y / s) * s), (o.handle === "ne" || o.handle === "se") && (e.w = Math.round((e.x + e.w) / s) * s - e.x), (o.handle === "se" || o.handle === "sw") && (e.h = Math.round((e.y + e.h) / s) * s - e.y);
820
820
  }
821
- const v = r.startBounds, t = Math.max(e.w, 24), o = Math.max(e.h, 24), a = v.w > 0 ? t / v.w : 1, i = v.h > 0 ? o / v.h : 1;
822
- tt((n) => {
823
- const d = n.canvases[Z.current];
824
- return d ? {
825
- ...n,
821
+ const t = o.startBounds, r = Math.max(e.w, 24), a = Math.max(e.h, 24), d = t.w > 0 ? r / t.w : 1, n = t.h > 0 ? a / t.h : 1;
822
+ tt((s) => {
823
+ const m = s.canvases[Z.current];
824
+ return m ? {
825
+ ...s,
826
826
  canvases: {
827
- ...n.canvases,
827
+ ...s.canvases,
828
828
  [Z.current]: {
829
- ...d,
830
- nodes: d.nodes.map((w) => {
831
- if (w.id === r.nodeId) return {
832
- ...w,
829
+ ...m,
830
+ nodes: m.nodes.map((h) => {
831
+ if (h.id === o.nodeId) return {
832
+ ...h,
833
833
  position: {
834
834
  x: e.x,
835
835
  y: e.y
836
836
  },
837
- width: t,
838
- height: o
837
+ width: r,
838
+ height: a
839
839
  };
840
- const g = r.childStarts.get(w.id);
841
- return g ? {
842
- ...w,
840
+ const I = o.childStarts.get(h.id);
841
+ return I ? {
842
+ ...h,
843
843
  position: {
844
- x: e.x + (g.x - v.x) * a,
845
- y: e.y + (g.y - v.y) * i
844
+ x: e.x + (I.x - t.x) * d,
845
+ y: e.y + (I.y - t.y) * n
846
846
  },
847
- width: Math.max(g.w * a, 24),
848
- height: Math.max(g.h * i, 24)
849
- } : w;
847
+ width: Math.max(I.w * d, 24),
848
+ height: Math.max(I.h * n, 24)
849
+ } : h;
850
850
  }),
851
- lines: r.childLineStarts ? d.lines.map((w) => {
852
- const g = r.childLineStarts.get(w.id);
853
- return g ? {
854
- ...w,
855
- points: g.map((z) => ({
856
- x: e.x + (z.x - v.x) * a,
857
- y: e.y + (z.y - v.y) * i
851
+ lines: o.childLineStarts ? m.lines.map((h) => {
852
+ const I = o.childLineStarts.get(h.id);
853
+ return I ? {
854
+ ...h,
855
+ points: I.map((S) => ({
856
+ x: e.x + (S.x - t.x) * d,
857
+ y: e.y + (S.y - t.y) * n
858
858
  }))
859
- } : w;
860
- }) : d.lines
859
+ } : h;
860
+ }) : m.lines
861
861
  }
862
862
  }
863
- } : n;
863
+ } : s;
864
864
  });
865
865
  return;
866
866
  }
867
- if (ft.current?.active) {
868
- const r = ft.current, h = (Math.atan2(s.y - r.cy, s.x - r.cx) - r.startPointerAngle) * 180 / Math.PI;
869
- let l = ((r.startRotation + h) % 360 + 360) % 360;
870
- if (x.shiftKey) l = Math.round(l / 15) * 15 % 360;
867
+ if (ht.current?.active) {
868
+ const o = ht.current, x = (Math.atan2(c.y - o.cy, c.x - o.cx) - o.startPointerAngle) * 180 / Math.PI;
869
+ let l = ((o.startRotation + x) % 360 + 360) % 360;
870
+ if (g.shiftKey) l = Math.round(l / 15) * 15 % 360;
871
871
  else {
872
872
  const e = Math.round(l / 45) * 45;
873
873
  Math.abs(l - e) < 4 && (l = (e % 360 + 360) % 360);
874
874
  }
875
875
  tt((e) => {
876
- const I = e.canvases[Z.current];
877
- return I ? {
876
+ const w = e.canvases[Z.current];
877
+ return w ? {
878
878
  ...e,
879
879
  canvases: {
880
880
  ...e.canvases,
881
881
  [Z.current]: {
882
- ...I,
883
- nodes: I.nodes.map((y) => y.id === r.nodeId ? {
882
+ ...w,
883
+ nodes: w.nodes.map((y) => y.id === o.nodeId ? {
884
884
  ...y,
885
885
  data: {
886
886
  ...y.data,
@@ -890,67 +890,67 @@ function fr({ onPixiReady: L }) {
890
890
  }
891
891
  }
892
892
  } : e;
893
- }), M.current && (M.current.style.cursor = "grabbing");
893
+ }), R.current && (R.current.style.cursor = "grabbing");
894
894
  return;
895
895
  }
896
- if (ut.current?.active) {
897
- const r = ut.current, h = X.current.nodes, l = /* @__PURE__ */ new Map();
898
- for (const e of h) l.set(e.id, e);
896
+ if (ft.current?.active) {
897
+ const o = ft.current, x = X.current.nodes, l = /* @__PURE__ */ new Map();
898
+ for (const e of x) l.set(e.id, e);
899
899
  tt((e) => {
900
- const I = e.canvases[Z.current];
901
- return I ? {
900
+ const w = e.canvases[Z.current];
901
+ return w ? {
902
902
  ...e,
903
903
  canvases: {
904
904
  ...e.canvases,
905
905
  [Z.current]: {
906
- ...I,
907
- edges: I.edges.map((y) => {
908
- if (y.id !== r.edgeId) return y;
909
- if (r.type === "waypoint") {
910
- const Ft = [...y.data.waypoints ?? []];
911
- return r.index < Ft.length && (Ft[r.index] = {
912
- x: s.x,
913
- y: s.y
906
+ ...w,
907
+ edges: w.edges.map((y) => {
908
+ if (y.id !== o.edgeId) return y;
909
+ if (o.type === "waypoint") {
910
+ const Ot = [...y.data.waypoints ?? []];
911
+ return o.index < Ot.length && (Ot[o.index] = {
912
+ x: c.x,
913
+ y: c.y
914
914
  }), {
915
915
  ...y,
916
916
  data: {
917
917
  ...y.data,
918
- waypoints: Ft
918
+ waypoints: Ot
919
919
  }
920
920
  };
921
921
  }
922
- const v = St(y, l);
923
- if (!v) return y;
924
- const t = y.data.waypoints ?? [], o = [
922
+ const E = St(y, l);
923
+ if (!E) return y;
924
+ const t = y.data.waypoints ?? [], r = [
925
925
  {
926
- x: v.sx,
927
- y: v.sy
926
+ x: E.sx,
927
+ y: E.sy
928
928
  },
929
929
  ...t,
930
930
  {
931
- x: v.tx,
932
- y: v.ty
931
+ x: E.tx,
932
+ y: E.ty
933
933
  }
934
- ], a = o.length - 1, i = [...y.data.bezierControls ?? []];
935
- for (; i.length < a; ) i.push(null);
936
- const n = r.index;
934
+ ], a = r.length - 1, d = [...y.data.bezierControls ?? []];
935
+ for (; d.length < a; ) d.push(null);
936
+ const n = o.index;
937
937
  if (n >= a) return y;
938
- const d = o[n], w = o[n + 1], g = i[n], z = Math.hypot(w.x - d.x, w.y - d.y), C = Math.max(30, z * 0.3), u = a - 1, b = n === 0 ? d.x + v.snx * C : d.x + (w.x - d.x) * 0.4, _ = n === 0 ? d.y + v.sny * C : d.y, J = n === u ? w.x + v.tnx * C : w.x - (w.x - d.x) * 0.4, Ot = n === u ? w.y + v.tny * C : w.y;
939
- return r.type === "bezierC1" ? i[n] = {
940
- c1x: s.x,
941
- c1y: s.y,
942
- c2x: g?.c2x ?? J,
943
- c2y: g?.c2y ?? Ot
944
- } : i[n] = {
945
- c1x: g?.c1x ?? b,
946
- c1y: g?.c1y ?? _,
947
- c2x: s.x,
948
- c2y: s.y
938
+ const s = r[n], m = r[n + 1], h = d[n], I = Math.hypot(m.x - s.x, m.y - s.y), S = Math.max(30, I * 0.3), u = a - 1, b = n === 0 ? s.x + E.snx * S : s.x + (m.x - s.x) * 0.4, _ = n === 0 ? s.y + E.sny * S : s.y, J = n === u ? m.x + E.tnx * S : m.x - (m.x - s.x) * 0.4, _t = n === u ? m.y + E.tny * S : m.y;
939
+ return o.type === "bezierC1" ? d[n] = {
940
+ c1x: c.x,
941
+ c1y: c.y,
942
+ c2x: h?.c2x ?? J,
943
+ c2y: h?.c2y ?? _t
944
+ } : d[n] = {
945
+ c1x: h?.c1x ?? b,
946
+ c1y: h?.c1y ?? _,
947
+ c2x: c.x,
948
+ c2y: c.y
949
949
  }, {
950
950
  ...y,
951
951
  data: {
952
952
  ...y.data,
953
- bezierControls: i
953
+ bezierControls: d
954
954
  }
955
955
  };
956
956
  })
@@ -960,22 +960,22 @@ function fr({ onPixiReady: L }) {
960
960
  });
961
961
  return;
962
962
  }
963
- if (mt.current?.active) {
964
- const r = mt.current, h = s.x - r.startWorld.x, l = s.y - r.startWorld.y;
963
+ if (vt.current?.active) {
964
+ const o = vt.current, x = c.x - o.startWorld.x, l = c.y - o.startWorld.y;
965
965
  tt((e) => {
966
- const I = e.canvases[Z.current];
967
- return I ? {
966
+ const w = e.canvases[Z.current];
967
+ return w ? {
968
968
  ...e,
969
969
  canvases: {
970
970
  ...e.canvases,
971
971
  [Z.current]: {
972
- ...I,
973
- lines: I.lines.map((y) => {
974
- const v = r.pointStarts.get(y.id);
975
- return v ? {
972
+ ...w,
973
+ lines: w.lines.map((y) => {
974
+ const E = o.pointStarts.get(y.id);
975
+ return E ? {
976
976
  ...y,
977
- points: v.map((t) => ({
978
- x: t.x + h,
977
+ points: E.map((t) => ({
978
+ x: t.x + x,
979
979
  y: t.y + l
980
980
  }))
981
981
  } : y;
@@ -986,109 +986,109 @@ function fr({ onPixiReady: L }) {
986
986
  });
987
987
  return;
988
988
  }
989
- if (it.current?.active) {
990
- const r = it.current, h = s.x - r.startWorld.x, l = s.y - r.startWorld.y;
991
- let e = h, I = l;
992
- if (Qt.current && Nt.current > 0 && r.nodeIds.size > 0) {
993
- const t = Nt.current, o = r.nodeStarts.values().next().value;
994
- o && (e = Kt(o.x + h, t, !0) - o.x, I = Kt(o.y + l, t, !0) - o.y);
989
+ if (ct.current?.active) {
990
+ const o = ct.current, x = c.x - o.startWorld.x, l = c.y - o.startWorld.y;
991
+ let e = x, w = l;
992
+ if (Jt.current && Nt.current > 0 && o.nodeIds.size > 0) {
993
+ const r = Nt.current, a = o.nodeStarts.values().next().value;
994
+ a && (e = Zt(a.x + x, r, !0) - a.x, w = Zt(a.y + l, r, !0) - a.y);
995
995
  }
996
- const y = X.current.nodes, v = me(y.filter((t) => r.nodeIds.has(t.id)).map((t) => {
997
- const o = r.nodeStarts.get(t.id);
996
+ const y = X.current.nodes, E = y.filter((r) => o.nodeIds.has(r.id)).map((r) => {
997
+ const a = o.nodeStarts.get(r.id);
998
998
  return {
999
- ...t,
999
+ ...r,
1000
1000
  position: {
1001
- x: o.x + e,
1002
- y: o.y + I
1001
+ x: a.x + e,
1002
+ y: a.y + w
1003
1003
  }
1004
1004
  };
1005
- }), y);
1006
- e += v.dx, I += v.dy, Gt.current = v.guides, tt((t) => {
1007
- const o = t.canvases[Z.current];
1008
- return o ? {
1009
- ...t,
1005
+ }), t = ve(E, y);
1006
+ e += t.dx, w += t.dy, Lt.current = t.guides, tt((r) => {
1007
+ const a = r.canvases[Z.current];
1008
+ return a ? {
1009
+ ...r,
1010
1010
  canvases: {
1011
- ...t.canvases,
1011
+ ...r.canvases,
1012
1012
  [Z.current]: {
1013
- ...o,
1014
- nodes: o.nodes.map((a) => {
1015
- const i = r.nodeStarts.get(a.id);
1016
- return i ? {
1017
- ...a,
1013
+ ...a,
1014
+ nodes: a.nodes.map((d) => {
1015
+ const n = o.nodeStarts.get(d.id);
1016
+ return n ? {
1017
+ ...d,
1018
1018
  position: {
1019
- x: i.x + e,
1020
- y: i.y + I
1019
+ x: n.x + e,
1020
+ y: n.y + w
1021
1021
  }
1022
- } : a;
1022
+ } : d;
1023
1023
  }),
1024
- lines: r.linePointStarts ? o.lines.map((a) => {
1025
- const i = r.linePointStarts.get(a.id);
1026
- return i ? {
1027
- ...a,
1028
- points: i.map((n) => ({
1029
- x: n.x + e,
1030
- y: n.y + I
1024
+ lines: o.linePointStarts ? a.lines.map((d) => {
1025
+ const n = o.linePointStarts.get(d.id);
1026
+ return n ? {
1027
+ ...d,
1028
+ points: n.map((s) => ({
1029
+ x: s.x + e,
1030
+ y: s.y + w
1031
1031
  }))
1032
- } : a;
1033
- }) : o.lines
1032
+ } : d;
1033
+ }) : a.lines
1034
1034
  }
1035
1035
  }
1036
- } : t;
1036
+ } : r;
1037
1037
  });
1038
1038
  return;
1039
1039
  }
1040
- if (nt.current?.active && kt.current) {
1041
- const r = Math.min(nt.current.startScreen.x, x.global.x), h = Math.min(nt.current.startScreen.y, x.global.y), l = Math.abs(x.global.x - nt.current.startScreen.x), e = Math.abs(x.global.y - nt.current.startScreen.y);
1042
- kt.current.showMarquee(r, h, l, e);
1040
+ if (nt.current?.active && Tt.current) {
1041
+ const o = Math.min(nt.current.startScreen.x, g.global.x), x = Math.min(nt.current.startScreen.y, g.global.y), l = Math.abs(g.global.x - nt.current.startScreen.x), e = Math.abs(g.global.y - nt.current.startScreen.y);
1042
+ Tt.current.showMarquee(o, x, l, e);
1043
1043
  }
1044
- if (rt.current?.active && wt.current) {
1045
- const r = X.current.nodes.find((h) => h.id === rt.current.sourceNodeId);
1046
- if (r) {
1047
- const h = Mt(r.width, r.height).find((l) => l.id === rt.current.sourceHandleId);
1048
- if (h) {
1049
- const l = Vt(h, r), e = l.x, I = l.y;
1050
- let y = s.x, v = s.y;
1051
- const t = Tt.current;
1044
+ if (rt.current?.active && mt.current) {
1045
+ const o = X.current.nodes.find((x) => x.id === rt.current.sourceNodeId);
1046
+ if (o) {
1047
+ const x = Mt(o.width, o.height).find((l) => l.id === rt.current.sourceHandleId);
1048
+ if (x) {
1049
+ const l = Bt(x, o), e = l.x, w = l.y;
1050
+ let y = c.x, E = c.y;
1051
+ const t = kt.current;
1052
1052
  if (t && t !== rt.current.sourceNodeId) {
1053
- const a = X.current.nodes.find((i) => i.id === t);
1053
+ const a = X.current.nodes.find((d) => d.id === t);
1054
1054
  if (a) {
1055
- const i = Bt(Mt(a.width, a.height), a, s.x, s.y, 1 / 0);
1056
- if (i) {
1057
- const n = Vt(i, a);
1058
- y = n.x, v = n.y;
1055
+ const d = Mt(a.width, a.height), n = Ft(d, a, c.x, c.y, 1 / 0);
1056
+ if (n) {
1057
+ const s = Bt(n, a);
1058
+ y = s.x, E = s.y;
1059
1059
  }
1060
1060
  }
1061
1061
  }
1062
- const o = wt.current;
1063
- o.clear(), o.moveTo(e, I).lineTo(y, v).stroke({
1062
+ const r = mt.current;
1063
+ r.clear(), r.moveTo(e, w).lineTo(y, E).stroke({
1064
1064
  color: 3900150,
1065
1065
  width: 2,
1066
1066
  alpha: 0.6
1067
- }), o.visible = !0;
1067
+ }), r.visible = !0;
1068
1068
  }
1069
1069
  }
1070
1070
  }
1071
- if (ct.current?.active && wt.current && !wt.current.destroyed) {
1072
- const r = ct.current, h = X.current.nodes.find((l) => l.id === r.fixedNodeId);
1073
- if (h) {
1074
- const l = Mt(h.width, h.height).find((i) => i.id === r.fixedHandleId), e = l ? Vt(l, h) : {
1075
- x: h.position.x + h.width / 2,
1076
- y: h.position.y + h.height / 2
1077
- }, I = e.x, y = e.y;
1078
- let v = s.x, t = s.y;
1079
- const o = Tt.current;
1080
- if (o && o !== r.fixedNodeId) {
1081
- const i = X.current.nodes.find((n) => n.id === o);
1082
- if (i) {
1083
- const n = Bt(Mt(i.width, i.height), i, s.x, s.y, 1 / 0);
1084
- if (n) {
1085
- const d = Vt(n, i);
1086
- v = d.x, t = d.y;
1071
+ if (it.current?.active && mt.current && !mt.current.destroyed) {
1072
+ const o = it.current, x = X.current.nodes.find((l) => l.id === o.fixedNodeId);
1073
+ if (x) {
1074
+ const l = Mt(x.width, x.height).find((d) => d.id === o.fixedHandleId), e = l ? Bt(l, x) : {
1075
+ x: x.position.x + x.width / 2,
1076
+ y: x.position.y + x.height / 2
1077
+ }, w = e.x, y = e.y;
1078
+ let E = c.x, t = c.y;
1079
+ const r = kt.current;
1080
+ if (r && r !== o.fixedNodeId) {
1081
+ const d = X.current.nodes.find((n) => n.id === r);
1082
+ if (d) {
1083
+ const n = Mt(d.width, d.height), s = Ft(n, d, c.x, c.y, 1 / 0);
1084
+ if (s) {
1085
+ const m = Bt(s, d);
1086
+ E = m.x, t = m.y;
1087
1087
  }
1088
1088
  }
1089
1089
  }
1090
- const a = wt.current;
1091
- a.clear(), a.moveTo(I, y).lineTo(v, t).stroke({
1090
+ const a = mt.current;
1091
+ a.clear(), a.moveTo(w, y).lineTo(E, t).stroke({
1092
1092
  color: 16347926,
1093
1093
  width: 2,
1094
1094
  alpha: 0.7
@@ -1097,108 +1097,108 @@ function fr({ onPixiReady: L }) {
1097
1097
  }
1098
1098
  });
1099
1099
  const Pt = () => {
1100
- Gt.current = [];
1100
+ Lt.current = [];
1101
1101
  try {
1102
- ge.current?.clear();
1102
+ we.current?.clear();
1103
1103
  } catch {
1104
1104
  }
1105
1105
  try {
1106
- const x = wt.current;
1107
- x && !x.destroyed && (x.clear(), x.visible = !1);
1106
+ const g = mt.current;
1107
+ g && !g.destroyed && (g.clear(), g.visible = !1);
1108
1108
  } catch {
1109
1109
  }
1110
- M.current && (M.current.style.cursor = "");
1110
+ R.current && (R.current.style.cursor = "");
1111
1111
  };
1112
- bt.on("pointerup", (x) => {
1113
- if (Pt(), ft.current?.active) {
1114
- ft.current = null, Ht.current();
1112
+ bt.on("pointerup", (g) => {
1113
+ if (Pt(), ht.current?.active) {
1114
+ ht.current = null, Ht.current();
1115
1115
  return;
1116
1116
  }
1117
- if (ut.current?.active) {
1118
- ut.current = null;
1117
+ if (ft.current?.active) {
1118
+ ft.current = null;
1119
1119
  return;
1120
1120
  }
1121
- if (xt.current?.active) {
1122
- xt.current = null;
1121
+ if (gt.current?.active) {
1122
+ gt.current = null;
1123
1123
  return;
1124
1124
  }
1125
- if (mt.current?.active) {
1126
- mt.current = null;
1125
+ if (vt.current?.active) {
1126
+ vt.current = null;
1127
1127
  return;
1128
1128
  }
1129
- if (it.current?.active && (it.current = null, Ht.current()), nt.current?.active) {
1130
- const s = dt.current(nt.current.startScreen.x, nt.current.startScreen.y), c = dt.current(x.global.x, x.global.y), p = Math.min(s.x, c.x), P = Math.min(s.y, c.y), k = Math.abs(c.x - s.x), R = Math.abs(c.y - s.y);
1131
- if (k > 4 && R > 4) {
1132
- const S = X.current.nodes.filter((r) => kn(p, P, k, R, r.position.x, r.position.y, r.width, r.height)), T = X.current.lines.filter((r) => r.points.length === 0 ? !1 : r.points.every((h) => h.x >= p && h.x <= p + k && h.y >= P && h.y <= P + R));
1133
- pt({
1134
- nodeIds: new Set(S.map((r) => r.id)),
1129
+ if (ct.current?.active && (ct.current = null, Ht.current()), nt.current?.active) {
1130
+ const c = dt.current(nt.current.startScreen.x, nt.current.startScreen.y), i = dt.current(g.global.x, g.global.y), p = Math.min(c.x, i.x), H = Math.min(c.y, i.y), N = Math.abs(i.x - c.x), z = Math.abs(i.y - c.y);
1131
+ if (N > 4 && z > 4) {
1132
+ const C = X.current.nodes.filter((o) => Dn(p, H, N, z, o.position.x, o.position.y, o.width, o.height)), k = X.current.lines.filter((o) => o.points.length === 0 ? !1 : o.points.every((x) => x.x >= p && x.x <= p + N && x.y >= H && x.y <= H + z));
1133
+ xt({
1134
+ nodeIds: new Set(C.map((o) => o.id)),
1135
1135
  edgeIds: /* @__PURE__ */ new Set(),
1136
- lineIds: new Set(T.map((r) => r.id))
1136
+ lineIds: new Set(k.map((o) => o.id))
1137
1137
  });
1138
1138
  }
1139
- nt.current = null, kt.current?.hideMarquee();
1139
+ nt.current = null, Tt.current?.hideMarquee();
1140
1140
  }
1141
- if (ct.current?.active) {
1142
- const s = ct.current.edgeId, c = ct.current.movingEnd, p = ct.current.fixedNodeId;
1143
- ct.current = null;
1144
- const P = dt.current(x.global.x, x.global.y), k = X.current.nodes, R = fe ? Q(B.current?.state.zoom ?? 1, 12, 24) : 0;
1145
- let S = null;
1146
- for (let T = k.length - 1; T >= 0; T--) if (qt(P.x, P.y, k[T], R) && k[T].id !== p) {
1147
- S = k[T];
1141
+ if (it.current?.active) {
1142
+ const c = it.current.edgeId, i = it.current.movingEnd, p = it.current.fixedNodeId;
1143
+ it.current = null;
1144
+ const H = dt.current(g.global.x, g.global.y), N = X.current.nodes, z = ue ? Q(V.current?.state.zoom ?? 1, 12, 24) : 0;
1145
+ let C = null;
1146
+ for (let k = N.length - 1; k >= 0; k--) if (Vt(H.x, H.y, N[k], z) && N[k].id !== p) {
1147
+ C = N[k];
1148
1148
  break;
1149
1149
  }
1150
- if (S) {
1151
- const T = S.id, r = Bt(Mt(S.width, S.height), S, P.x, P.y, 1 / 0)?.id;
1152
- tt((h) => {
1153
- const l = h.canvases[Z.current];
1154
- return l ? {
1155
- ...h,
1150
+ if (C) {
1151
+ const k = C.id, o = Mt(C.width, C.height), x = Ft(o, C, H.x, H.y, 1 / 0)?.id;
1152
+ tt((l) => {
1153
+ const e = l.canvases[Z.current];
1154
+ return e ? {
1155
+ ...l,
1156
1156
  canvases: {
1157
- ...h.canvases,
1157
+ ...l.canvases,
1158
1158
  [Z.current]: {
1159
- ...l,
1160
- edges: l.edges.map((e) => e.id !== s ? e : c === "source" ? {
1161
- ...e,
1162
- source: T,
1163
- sourceHandle: r
1159
+ ...e,
1160
+ edges: e.edges.map((w) => w.id !== c ? w : i === "source" ? {
1161
+ ...w,
1162
+ source: k,
1163
+ sourceHandle: x
1164
1164
  } : {
1165
- ...e,
1166
- target: T,
1167
- targetHandle: r
1165
+ ...w,
1166
+ target: k,
1167
+ targetHandle: x
1168
1168
  })
1169
1169
  }
1170
1170
  }
1171
- } : h;
1171
+ } : l;
1172
1172
  });
1173
1173
  }
1174
1174
  return;
1175
1175
  }
1176
1176
  if (rt.current?.active) {
1177
- const s = rt.current.sourceNodeId, c = rt.current.sourceHandleId;
1177
+ const c = rt.current.sourceNodeId, i = rt.current.sourceHandleId;
1178
1178
  rt.current = null;
1179
- const p = dt.current(x.global.x, x.global.y), P = X.current.nodes, k = fe ? Q(B.current?.state.zoom ?? 1, 12, 24) : 0;
1180
- let R = null;
1181
- for (let S = P.length - 1; S >= 0; S--) if (qt(p.x, p.y, P[S], k) && P[S].id !== s) {
1182
- R = P[S];
1179
+ const p = dt.current(g.global.x, g.global.y), H = X.current.nodes, N = ue ? Q(V.current?.state.zoom ?? 1, 12, 24) : 0;
1180
+ let z = null;
1181
+ for (let C = H.length - 1; C >= 0; C--) if (Vt(p.x, p.y, H[C], N) && H[C].id !== c) {
1182
+ z = H[C];
1183
1183
  break;
1184
1184
  }
1185
- if (R) {
1186
- const S = R.id, T = Bt(Mt(R.width, R.height), R, p.x, p.y, 1 / 0)?.id, r = `edge_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 6)}`, h = Ue.current;
1187
- tt((l) => {
1188
- const e = l.canvases[Z.current];
1189
- return !e || e.edges.some((I) => I.source === s && I.target === S && I.sourceHandle === c && I.targetHandle === T) ? l : {
1190
- ...l,
1185
+ if (z) {
1186
+ const C = z.id, k = Mt(z.width, z.height), o = Ft(k, z, p.x, p.y, 1 / 0)?.id, x = `edge_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 6)}`, l = $e.current;
1187
+ tt((e) => {
1188
+ const w = e.canvases[Z.current];
1189
+ return !w || w.edges.some((y) => y.source === c && y.target === C && y.sourceHandle === i && y.targetHandle === o) ? e : {
1190
+ ...e,
1191
1191
  canvases: {
1192
- ...l.canvases,
1192
+ ...e.canvases,
1193
1193
  [Z.current]: {
1194
- ...e,
1195
- edges: [...e.edges, {
1196
- id: r,
1197
- source: s,
1198
- target: S,
1199
- sourceHandle: c,
1200
- targetHandle: T,
1201
- type: h,
1194
+ ...w,
1195
+ edges: [...w.edges, {
1196
+ id: x,
1197
+ source: c,
1198
+ target: C,
1199
+ sourceHandle: i,
1200
+ targetHandle: o,
1201
+ type: l,
1202
1202
  data: {
1203
1203
  strokeColor: "theme:base-content",
1204
1204
  strokeWidth: 2,
@@ -1213,144 +1213,144 @@ function fr({ onPixiReady: L }) {
1213
1213
  }
1214
1214
  }
1215
1215
  }), bt.on("pointerupoutside", () => {
1216
- Pt(), it.current?.active && Ht.current(), ft.current?.active && Ht.current(), it.current = null, ft.current = null, xt.current = null, nt.current = null, ct.current = null, rt.current = null, ut.current = null, mt.current = null, Tt.current = null, Wt.current = null, Yt.current = null, kt.current?.hideMarquee();
1216
+ Pt(), ct.current?.active && Ht.current(), ht.current?.active && Ht.current(), ct.current = null, ht.current = null, gt.current = null, nt.current = null, it.current = null, rt.current = null, ft.current = null, vt.current = null, kt.current = null, Gt.current = null, Wt.current = null, Tt.current?.hideMarquee();
1217
1217
  });
1218
- const At = M.current;
1219
- let yt = null;
1220
- const ae = (x) => {
1221
- const s = At.getBoundingClientRect(), c = x[0].clientX, p = x[0].clientY, P = x[1].clientX, k = x[1].clientY;
1218
+ const At = R.current;
1219
+ let pt = null;
1220
+ const de = (g) => {
1221
+ const c = At.getBoundingClientRect(), i = g[0].clientX, p = g[0].clientY, H = g[1].clientX, N = g[1].clientY;
1222
1222
  return {
1223
- dist: Math.hypot(P - c, k - p),
1224
- midX: (c + P) / 2 - s.left,
1225
- midY: (p + k) / 2 - s.top
1223
+ dist: Math.hypot(H - i, N - p),
1224
+ midX: (i + H) / 2 - c.left,
1225
+ midY: (p + N) / 2 - c.top
1226
1226
  };
1227
- }, He = () => {
1228
- Pt(), it.current?.active && Ht.current(), ft.current?.active && Ht.current(), it.current = null, ft.current = null, xt.current = null, nt.current = null, ct.current = null, rt.current = null, ut.current = null, mt.current = null, Tt.current = null, Wt.current = null, Yt.current = null, kt.current?.hideMarquee(), B.current?.cancelPan();
1229
- }, en = (x) => {
1230
- if (x.touches.length < 2) return;
1231
- const s = B.current;
1232
- s && (s.multiTouchActive = !0, He(), yt = ae(x.touches), x.preventDefault());
1233
- }, nn = (x) => {
1234
- if (!yt || x.touches.length < 2) return;
1235
- x.preventDefault();
1236
- const s = B.current;
1237
- if (!s) return;
1238
- const c = ae(x.touches), p = c.dist / Math.max(1, yt.dist);
1239
- Number.isFinite(p) && p > 0 && s.zoomAt(c.midX, c.midY, p), s.setState({
1240
- x: s.state.x + (c.midX - yt.midX),
1241
- y: s.state.y + (c.midY - yt.midY)
1242
- }), yt = c;
1243
- }, Pe = (x) => {
1244
- if (x.touches.length >= 2) {
1245
- yt = ae(x.touches);
1227
+ }, Pe = () => {
1228
+ Pt(), ct.current?.active && Ht.current(), ht.current?.active && Ht.current(), ct.current = null, ht.current = null, gt.current = null, nt.current = null, it.current = null, rt.current = null, ft.current = null, vt.current = null, kt.current = null, Gt.current = null, Wt.current = null, Tt.current?.hideMarquee(), V.current?.cancelPan();
1229
+ }, nn = (g) => {
1230
+ if (g.touches.length < 2) return;
1231
+ const c = V.current;
1232
+ c && (c.multiTouchActive = !0, Pe(), pt = de(g.touches), g.preventDefault());
1233
+ }, rn = (g) => {
1234
+ if (!pt || g.touches.length < 2) return;
1235
+ g.preventDefault();
1236
+ const c = V.current;
1237
+ if (!c) return;
1238
+ const i = de(g.touches), p = i.dist / Math.max(1, pt.dist);
1239
+ Number.isFinite(p) && p > 0 && c.zoomAt(i.midX, i.midY, p), c.setState({
1240
+ x: c.state.x + (i.midX - pt.midX),
1241
+ y: c.state.y + (i.midY - pt.midY)
1242
+ }), pt = i;
1243
+ }, Ae = (g) => {
1244
+ if (g.touches.length >= 2) {
1245
+ pt = de(g.touches);
1246
1246
  return;
1247
1247
  }
1248
- if (yt = null, x.touches.length === 0) {
1249
- const s = B.current;
1250
- s && (s.multiTouchActive = !1), Ve.current = performance.now() + 350;
1248
+ if (pt = null, g.touches.length === 0) {
1249
+ const c = V.current;
1250
+ c && (c.multiTouchActive = !1), qe.current = performance.now() + 350;
1251
1251
  }
1252
1252
  };
1253
- At?.addEventListener("touchstart", en, { passive: !1 }), At?.addEventListener("touchmove", nn, { passive: !1 }), At?.addEventListener("touchend", Pe), At?.addEventListener("touchcancel", Pe), F = en, Y = nn, K = Pe, bt.on("rightclick", (x) => {
1254
- if (x.preventDefault?.(), B.current?.didRightPan) return;
1255
- const s = dt.current(x.global.x, x.global.y), c = X.current.nodes;
1253
+ At?.addEventListener("touchstart", nn, { passive: !1 }), At?.addEventListener("touchmove", rn, { passive: !1 }), At?.addEventListener("touchend", Ae), At?.addEventListener("touchcancel", Ae), O = nn, W = rn, K = Ae, bt.on("rightclick", (g) => {
1254
+ if (g.preventDefault?.(), V.current?.didRightPan) return;
1255
+ const c = dt.current(g.global.x, g.global.y), i = X.current.nodes;
1256
1256
  let p = null;
1257
- for (let S = c.length - 1; S >= 0; S--) if (qt(s.x, s.y, c[S])) {
1258
- p = c[S].id;
1257
+ for (let C = i.length - 1; C >= 0; C--) if (Vt(c.x, c.y, i[C])) {
1258
+ p = i[C].id;
1259
1259
  break;
1260
1260
  }
1261
- const P = x.nativeEvent, k = P?.clientX ?? x.global.x, R = P?.clientY ?? x.global.y;
1262
- he({
1263
- x: k,
1264
- y: R,
1261
+ const H = g.nativeEvent, N = H?.clientX ?? g.global.x, z = H?.clientY ?? g.global.y;
1262
+ ye({
1263
+ x: N,
1264
+ y: z,
1265
1265
  nodeId: p
1266
1266
  });
1267
- }), bt.on("pointertap", (x) => {
1268
- if (B.current?.multiTouchActive || performance.now() < Ve.current || x.button !== 0) return;
1269
- const s = Date.now(), c = dt.current(x.global.x, x.global.y), p = de.current;
1267
+ }), bt.on("pointertap", (g) => {
1268
+ if (V.current?.multiTouchActive || performance.now() < qe.current || g.button !== 0) return;
1269
+ const c = Date.now(), i = dt.current(g.global.x, g.global.y), p = ie.current;
1270
1270
  if (p) {
1271
- const S = Nn("node"), T = Nt.current, r = Qt.current, h = Kt(c.x - p.width / 2, T, r), l = Kt(c.y - p.height / 2, T, r), e = me([{
1271
+ const C = kn("node"), k = Nt.current, o = Jt.current, x = Zt(i.x - p.width / 2, k, o), l = Zt(i.y - p.height / 2, k, o), e = {
1272
1272
  id: "__ghost__",
1273
1273
  type: p.type,
1274
1274
  position: {
1275
- x: h,
1275
+ x,
1276
1276
  y: l
1277
1277
  },
1278
1278
  width: p.width,
1279
1279
  height: p.height,
1280
1280
  data: {}
1281
- }], X.current.nodes), I = h + e.dx, y = l + e.dy;
1282
- tt((v) => {
1283
- const t = v.canvases[Z.current];
1284
- if (!t) return v;
1285
- const o = {};
1286
- p.type === "animAnchor" && (o.animIndex = Wn(v));
1287
- const a = Math.max(0, ...t.nodes.map((i) => i.zIndex ?? 0), ...t.lines.map((i) => i.zIndex ?? 0));
1281
+ }, w = ve([e], X.current.nodes), y = x + w.dx, E = l + w.dy;
1282
+ tt((t) => {
1283
+ const r = t.canvases[Z.current];
1284
+ if (!r) return t;
1285
+ const a = {};
1286
+ p.type === "animAnchor" && (a.animIndex = Xn(t));
1287
+ const d = Math.max(0, ...r.nodes.map((n) => n.zIndex ?? 0), ...r.lines.map((n) => n.zIndex ?? 0));
1288
1288
  return {
1289
- ...v,
1289
+ ...t,
1290
1290
  canvases: {
1291
- ...v.canvases,
1291
+ ...t.canvases,
1292
1292
  [Z.current]: {
1293
- ...t,
1294
- nodes: [...t.nodes, {
1295
- id: S,
1293
+ ...r,
1294
+ nodes: [...r.nodes, {
1295
+ id: C,
1296
1296
  type: p.type,
1297
1297
  position: {
1298
- x: I,
1299
- y
1298
+ x: y,
1299
+ y: E
1300
1300
  },
1301
1301
  width: p.width,
1302
1302
  height: p.height,
1303
- zIndex: a + 1,
1303
+ zIndex: d + 1,
1304
1304
  data: {
1305
1305
  ...p.data,
1306
- ...o
1306
+ ...a
1307
1307
  }
1308
1308
  }]
1309
1309
  }
1310
1310
  }
1311
1311
  };
1312
- }), pt({
1313
- nodeIds: /* @__PURE__ */ new Set([S]),
1312
+ }), xt({
1313
+ nodeIds: /* @__PURE__ */ new Set([C]),
1314
1314
  edgeIds: /* @__PURE__ */ new Set(),
1315
1315
  lineIds: /* @__PURE__ */ new Set()
1316
- }), ie.current && window.setTimeout(() => {
1317
- ce.current(I, y, p.width, p.height, {
1316
+ }), se.current && window.setTimeout(() => {
1317
+ ce.current(y, E, p.width, p.height, {
1318
1318
  padding: 80,
1319
1319
  preserveZoom: !0,
1320
1320
  duration: 280
1321
1321
  });
1322
- }, 0), Xt.current = {
1322
+ }, 0), Yt.current = {
1323
1323
  time: 0,
1324
1324
  wx: 0,
1325
1325
  wy: 0
1326
1326
  };
1327
1327
  return;
1328
1328
  }
1329
- const P = Xt.current, k = c.x - P.wx, R = c.y - P.wy;
1330
- if (s - P.time < 400 && Math.abs(k) < 10 && Math.abs(R) < 10) {
1331
- const S = X.current.nodes;
1332
- for (let l = S.length - 1; l >= 0; l--) if (qt(c.x, c.y, S[l])) {
1333
- const e = S[l], I = e.data.childCanvasId;
1334
- if (I) {
1335
- In(I), Xt.current = {
1329
+ const H = Yt.current, N = i.x - H.wx, z = i.y - H.wy;
1330
+ if (c - H.time < 400 && Math.abs(N) < 10 && Math.abs(z) < 10) {
1331
+ const C = X.current.nodes;
1332
+ for (let l = C.length - 1; l >= 0; l--) if (Vt(i.x, i.y, C[l])) {
1333
+ const e = C[l], w = e.data.childCanvasId;
1334
+ if (w) {
1335
+ bn(w), Yt.current = {
1336
1336
  time: 0,
1337
1337
  wx: 0,
1338
1338
  wy: 0
1339
1339
  };
1340
1340
  return;
1341
1341
  }
1342
- we.current("node", e.id, e.data.label ?? ""), Xt.current = {
1342
+ me.current("node", e.id, e.data.label ?? ""), Yt.current = {
1343
1343
  time: 0,
1344
1344
  wx: 0,
1345
1345
  wy: 0
1346
1346
  };
1347
1347
  return;
1348
1348
  }
1349
- const T = X.current.edges, r = /* @__PURE__ */ new Map();
1350
- for (const l of S) r.set(l.id, l);
1351
- const h = B.current?.state.zoom ?? 1;
1352
- for (let l = T.length - 1; l >= 0; l--) if (Ae(c.x, c.y, T[l], r, Q(h, 8, 12))) {
1353
- we.current("edge", T[l].id, T[l].data.labelText ?? ""), Xt.current = {
1349
+ const k = X.current.edges, o = /* @__PURE__ */ new Map();
1350
+ for (const l of C) o.set(l.id, l);
1351
+ const x = V.current?.state.zoom ?? 1;
1352
+ for (let l = k.length - 1; l >= 0; l--) if (Le(i.x, i.y, k[l], o, Q(x, 8, 12))) {
1353
+ me.current("edge", k[l].id, k[l].data.labelText ?? ""), Yt.current = {
1354
1354
  time: 0,
1355
1355
  wx: 0,
1356
1356
  wy: 0
@@ -1358,66 +1358,66 @@ function fr({ onPixiReady: L }) {
1358
1358
  return;
1359
1359
  }
1360
1360
  }
1361
- Xt.current = {
1362
- time: s,
1363
- wx: c.x,
1364
- wy: c.y
1361
+ Yt.current = {
1362
+ time: c,
1363
+ wx: i.x,
1364
+ wy: i.y
1365
1365
  };
1366
1366
  });
1367
- let rn = !1;
1368
- f.app.ticker.add((x) => {
1367
+ let on = !1;
1368
+ f.app.ticker.add((g) => {
1369
1369
  if (f.destroyed) return;
1370
- const s = x.deltaMS, c = f.app.screen, p = B.current?.state ?? {
1370
+ const c = g.deltaMS, i = f.app.screen, p = V.current?.state ?? {
1371
1371
  x: 0,
1372
1372
  y: 0,
1373
1373
  zoom: 1
1374
1374
  };
1375
- H.current?.update(p, c.width, c.height);
1376
- const P = B.current?.isPanning ?? !1;
1377
- P !== rn && (rn = P, M.current && (M.current.style.cursor = P ? "grabbing" : ""));
1378
- const k = X.current, R = oe.current, S = Gn(Ke.current), T = /* @__PURE__ */ new Map();
1379
- S.forEach((t, o) => T.set(t.node.id, o + 1)), ye.current?.advanceAnimation(s);
1380
- const r = Dt.current ? S[Dt.current.current] : void 0;
1381
- ye.current?.sync(k.nodes, R.nodeIds, Tt.current, T, {
1382
- showAnchors: $e.current,
1375
+ D.current?.update(p, i.width, i.height);
1376
+ const H = V.current?.isPanning ?? !1;
1377
+ H !== on && (on = H, R.current && (R.current.style.cursor = H ? "grabbing" : ""));
1378
+ const N = X.current, z = re.current, C = Yn(Ue.current), k = /* @__PURE__ */ new Map();
1379
+ C.forEach((t, r) => k.set(t.node.id, r + 1)), pe.current?.advanceAnimation(c);
1380
+ const o = Dt.current ? C[Dt.current.current] : void 0;
1381
+ pe.current?.sync(N.nodes, z.nodeIds, kt.current, k, {
1382
+ showAnchors: je.current,
1383
1383
  presentation: Dt.current !== null,
1384
- presentationAnchorId: r?.node.id,
1384
+ presentationAnchorId: o?.node.id,
1385
1385
  presentationAnchorVisible: Dt.current?.showAnchor ?? !1
1386
1386
  });
1387
- const h = /* @__PURE__ */ new Map();
1388
- for (const t of k.nodes) h.set(t.id, t);
1389
- pe.current?.advanceAnimation(s), pe.current?.sync(k.edges, h, R.edgeIds, null, { presentation: Dt.current !== null }), xe.current?.advanceAnimation(s), xe.current?.sync(k.lines, R.lineIds), ge.current?.update(Gt.current, c.width, c.height, p);
1390
- const l = Fe.current;
1387
+ const x = /* @__PURE__ */ new Map();
1388
+ for (const t of N.nodes) x.set(t.id, t);
1389
+ xe.current?.advanceAnimation(c), xe.current?.sync(N.edges, x, z.edgeIds, null, { presentation: Dt.current !== null }), ge.current?.advanceAnimation(c), ge.current?.sync(N.lines, z.lineIds), we.current?.update(Lt.current, i.width, i.height, p);
1390
+ const l = Be.current;
1391
1391
  if (l) {
1392
- const t = (R.nodeIds.size > 0 || R.edgeIds.size > 0 || R.lineIds.size > 0) && !Jt.current && !Dt.current && !de.current;
1393
- let o = !t;
1392
+ const t = (z.nodeIds.size > 0 || z.edgeIds.size > 0 || z.lineIds.size > 0) && !jt.current && !Dt.current && !ie.current;
1393
+ let r = !t;
1394
1394
  if (t) {
1395
- let a = 1 / 0, i = 1 / 0, n = -1 / 0, d = -1 / 0;
1396
- const w = (g, z, C, u) => {
1397
- a = Math.min(a, g), i = Math.min(i, z), n = Math.max(n, g + C), d = Math.max(d, z + u);
1395
+ let a = 1 / 0, d = 1 / 0, n = -1 / 0, s = -1 / 0;
1396
+ const m = (h, I, S, u) => {
1397
+ a = Math.min(a, h), d = Math.min(d, I), n = Math.max(n, h + S), s = Math.max(s, I + u);
1398
1398
  };
1399
- for (const g of k.nodes) R.nodeIds.has(g.id) && w(g.position.x, g.position.y, g.width, g.height);
1400
- for (const g of k.edges) {
1401
- if (!R.edgeIds.has(g.id)) continue;
1402
- const z = h.get(g.source), C = h.get(g.target);
1403
- z && w(z.position.x, z.position.y, z.width, z.height), C && w(C.position.x, C.position.y, C.width, C.height);
1399
+ for (const h of N.nodes) z.nodeIds.has(h.id) && m(h.position.x, h.position.y, h.width, h.height);
1400
+ for (const h of N.edges) {
1401
+ if (!z.edgeIds.has(h.id)) continue;
1402
+ const I = x.get(h.source), S = x.get(h.target);
1403
+ I && m(I.position.x, I.position.y, I.width, I.height), S && m(S.position.x, S.position.y, S.width, S.height);
1404
1404
  }
1405
- for (const g of k.lines)
1406
- if (R.lineIds.has(g.id))
1407
- for (const z of g.points) w(z.x, z.y, 0, 0);
1408
- if (a === 1 / 0) o = !0;
1405
+ for (const h of N.lines)
1406
+ if (z.lineIds.has(h.id))
1407
+ for (const I of h.points) m(I.x, I.y, 0, 0);
1408
+ if (a === 1 / 0) r = !0;
1409
1409
  else {
1410
- const g = p.zoom, z = 66, C = 30, u = 6;
1411
- let b = n * g + p.x + 8, _ = i * g + p.y - C - 6;
1412
- b + z > c.width - u && (b = Math.max(u, c.width - z - u)), _ < u && (_ = i * g + p.y + u), _ + C > c.height - u && (_ = Math.max(u, c.height - C - u)), l.style.display = "flex", l.style.left = `${Math.round(b)}px`, l.style.top = `${Math.round(_)}px`;
1410
+ const h = p.zoom, I = 66, S = 30, u = 6;
1411
+ let b = n * h + p.x + 8, _ = d * h + p.y - S - 6;
1412
+ b + I > i.width - u && (b = Math.max(u, i.width - I - u)), _ < u && (_ = d * h + p.y + u), _ + S > i.height - u && (_ = Math.max(u, i.height - S - u)), l.style.display = "flex", l.style.left = `${Math.round(b)}px`, l.style.top = `${Math.round(_)}px`;
1413
1413
  }
1414
1414
  }
1415
- o && l.style.display !== "none" && (l.style.display = "none");
1415
+ r && l.style.display !== "none" && (l.style.display = "none");
1416
1416
  }
1417
- const e = ee.current;
1417
+ const e = te.current;
1418
1418
  if (e) {
1419
1419
  e.clear();
1420
- const t = Wt.current;
1420
+ const t = Gt.current;
1421
1421
  t && (e.circle(t.wx, t.wy, 10).fill({
1422
1422
  color: 3900150,
1423
1423
  alpha: 0.12
@@ -1429,36 +1429,36 @@ function fr({ onPixiReady: L }) {
1429
1429
  color: 3900150,
1430
1430
  alpha: 0.9
1431
1431
  }));
1432
- const o = Yt.current;
1433
- o && !t && (e.circle(o.worldX, o.worldY, 10).fill({
1432
+ const r = Wt.current;
1433
+ r && !t && (e.circle(r.worldX, r.worldY, 10).fill({
1434
1434
  color: 16347926,
1435
1435
  alpha: 0.12
1436
1436
  }).stroke({
1437
1437
  color: 16347926,
1438
1438
  width: 1.5,
1439
1439
  alpha: 0.5
1440
- }), e.circle(o.worldX, o.worldY, 4).fill({
1440
+ }), e.circle(r.worldX, r.worldY, 4).fill({
1441
1441
  color: 16347926,
1442
1442
  alpha: 0.9
1443
1443
  }));
1444
1444
  }
1445
- const I = re.current;
1446
- if (I) {
1447
- I.clear();
1448
- const t = de.current;
1445
+ const w = ne.current;
1446
+ if (w) {
1447
+ w.clear();
1448
+ const t = ie.current;
1449
1449
  if (t) {
1450
- const o = qe.current, a = Nt.current, i = Qt.current, n = Kt(o.x - t.width / 2, a, i), d = Kt(o.y - t.height / 2, a, i), w = me([{
1450
+ const r = Ze.current, a = Nt.current, d = Jt.current, n = Zt(r.x - t.width / 2, a, d), s = Zt(r.y - t.height / 2, a, d), m = {
1451
1451
  id: "__ghost__",
1452
1452
  type: t.type,
1453
1453
  position: {
1454
1454
  x: n,
1455
- y: d
1455
+ y: s
1456
1456
  },
1457
1457
  width: t.width,
1458
1458
  height: t.height,
1459
1459
  data: {}
1460
- }], k.nodes);
1461
- Gt.current = w.guides, I.position.set(n + w.dx, d + w.dy), (an[t.type] ?? an.shapeRect)(I, {
1460
+ }, h = ve([m], N.nodes);
1461
+ Lt.current = h.guides, w.position.set(n + h.dx, s + h.dy), (ln[t.type] ?? ln.shapeRect)(w, {
1462
1462
  width: t.width,
1463
1463
  height: t.height,
1464
1464
  fill: "#3b82f6",
@@ -1467,14 +1467,14 @@ function fr({ onPixiReady: L }) {
1467
1467
  borderStyle: t.data.borderStyle
1468
1468
  });
1469
1469
  } else
1470
- I.position.set(0, 0), !it.current?.active && !xt.current?.active && (Gt.current = []);
1470
+ w.position.set(0, 0), !ct.current?.active && !gt.current?.active && (Lt.current = []);
1471
1471
  }
1472
- const y = ne.current;
1473
- if (y && (y.clear(), R.edgeIds.size > 0 && se.current === "select")) {
1472
+ const y = ee.current;
1473
+ if (y && (y.clear(), z.edgeIds.size > 0 && oe.current === "select")) {
1474
1474
  const t = 1 / p.zoom;
1475
- for (const o of k.edges) {
1476
- if (!R.edgeIds.has(o.id)) continue;
1477
- const a = St(o, h);
1475
+ for (const r of N.edges) {
1476
+ if (!z.edgeIds.has(r.id)) continue;
1477
+ const a = St(r, x);
1478
1478
  a && (y.circle(a.sx, a.sy, 5 * t).fill({ color: 16777215 }).stroke({
1479
1479
  color: 16347926,
1480
1480
  width: 1.5 * t
@@ -1482,39 +1482,39 @@ function fr({ onPixiReady: L }) {
1482
1482
  color: 16347926,
1483
1483
  width: 1.5 * t
1484
1484
  }));
1485
- const i = o.data.waypoints;
1486
- if (i) for (const n of i) y.circle(n.x, n.y, 5 * t).fill({ color: 16777215 }).stroke({
1485
+ const d = r.data.waypoints;
1486
+ if (d) for (const n of d) y.circle(n.x, n.y, 5 * t).fill({ color: 16777215 }).stroke({
1487
1487
  color: 3900150,
1488
1488
  width: 1.5 * t
1489
1489
  });
1490
- if (o.type === "simplebezier") {
1491
- const n = St(o, h);
1490
+ if (r.type === "simplebezier") {
1491
+ const n = St(r, x);
1492
1492
  if (!n) continue;
1493
- const d = i ?? [], w = [
1493
+ const s = d ?? [], m = [
1494
1494
  {
1495
1495
  x: n.sx,
1496
1496
  y: n.sy
1497
1497
  },
1498
- ...d,
1498
+ ...s,
1499
1499
  {
1500
1500
  x: n.tx,
1501
1501
  y: n.ty
1502
1502
  }
1503
- ], g = o.data.bezierControls, z = w.length - 2;
1504
- for (let C = 0; C <= z; C++) {
1505
- const u = w[C], b = w[C + 1], _ = g?.[C], J = Math.hypot(b.x - u.x, b.y - u.y), Ot = Math.max(30, J * 0.3), Ft = _?.c1x ?? (C === 0 ? u.x + n.snx * Ot : u.x + (b.x - u.x) * 0.4), on = _?.c1y ?? (C === 0 ? u.y + n.sny * Ot : u.y), sn = _?.c2x ?? (C === z ? b.x + n.tnx * Ot : b.x - (b.x - u.x) * 0.4), cn = _?.c2y ?? (C === z ? b.y + n.tny * Ot : b.y);
1506
- y.moveTo(u.x, u.y).lineTo(Ft, on).stroke({
1503
+ ], h = r.data.bezierControls, I = m.length - 2;
1504
+ for (let S = 0; S <= I; S++) {
1505
+ const u = m[S], b = m[S + 1], _ = h?.[S], J = Math.hypot(b.x - u.x, b.y - u.y), _t = Math.max(30, J * 0.3), Ot = _?.c1x ?? (S === 0 ? u.x + n.snx * _t : u.x + (b.x - u.x) * 0.4), sn = _?.c1y ?? (S === 0 ? u.y + n.sny * _t : u.y), cn = _?.c2x ?? (S === I ? b.x + n.tnx * _t : b.x - (b.x - u.x) * 0.4), dn = _?.c2y ?? (S === I ? b.y + n.tny * _t : b.y);
1506
+ y.moveTo(u.x, u.y).lineTo(Ot, sn).stroke({
1507
1507
  color: 10265519,
1508
1508
  width: 1 * t
1509
- }), y.moveTo(b.x, b.y).lineTo(sn, cn).stroke({
1509
+ }), y.moveTo(b.x, b.y).lineTo(cn, dn).stroke({
1510
1510
  color: 10265519,
1511
1511
  width: 1 * t
1512
1512
  });
1513
- const dn = 4 * t;
1514
- y.circle(Ft, on, dn).fill({ color: 16777215 }).stroke({
1513
+ const an = 4 * t;
1514
+ y.circle(Ot, sn, an).fill({ color: 16777215 }).stroke({
1515
1515
  color: 3900150,
1516
1516
  width: 1.5 * t
1517
- }), y.circle(sn, cn, dn).fill({ color: 16777215 }).stroke({
1517
+ }), y.circle(cn, dn, an).fill({ color: 16777215 }).stroke({
1518
1518
  color: 3900150,
1519
1519
  width: 1.5 * t
1520
1520
  });
@@ -1522,62 +1522,62 @@ function fr({ onPixiReady: L }) {
1522
1522
  }
1523
1523
  }
1524
1524
  }
1525
- const v = te.current;
1526
- if (v && (v.clear(), R.nodeIds.size === 1 && se.current === "select")) {
1527
- const t = [...R.nodeIds][0], o = k.nodes.find((a) => a.id === t);
1528
- if (o) {
1529
- const a = p.zoom, i = o.position.x * a + p.x, n = o.position.y * a + p.y, d = o.width * a, w = o.height * a;
1530
- v.rect(i, n, d, w).stroke({
1525
+ const E = Qt.current;
1526
+ if (E && (E.clear(), z.nodeIds.size === 1 && oe.current === "select")) {
1527
+ const t = [...z.nodeIds][0], r = N.nodes.find((a) => a.id === t);
1528
+ if (r) {
1529
+ const a = p.zoom, d = r.position.x * a + p.x, n = r.position.y * a + p.y, s = r.width * a, m = r.height * a;
1530
+ E.rect(d, n, s, m).stroke({
1531
1531
  color: 3900150,
1532
1532
  width: 1.5
1533
1533
  });
1534
- const g = 7, z = g / 2, C = [
1535
- [i, n],
1536
- [i + d, n],
1537
- [i + d, n + w],
1538
- [i, n + w]
1534
+ const h = 7, I = h / 2, S = [
1535
+ [d, n],
1536
+ [d + s, n],
1537
+ [d + s, n + m],
1538
+ [d, n + m]
1539
1539
  ];
1540
- for (const [_, J] of C) v.rect(_ - z, J - z, g, g).fill({ color: 16777215 }).stroke({
1540
+ for (const [_, J] of S) E.rect(_ - I, J - I, h, h).fill({ color: 16777215 }).stroke({
1541
1541
  color: 3900150,
1542
1542
  width: 1.5
1543
1543
  });
1544
1544
  const u = 4, b = [
1545
- [i + d / 2, n],
1546
- [i + d, n + w / 2],
1547
- [i + d / 2, n + w],
1548
- [i, n + w / 2]
1545
+ [d + s / 2, n],
1546
+ [d + s, n + m / 2],
1547
+ [d + s / 2, n + m],
1548
+ [d, n + m / 2]
1549
1549
  ];
1550
- for (const [_, J] of b) v.circle(_, J, u).fill({
1550
+ for (const [_, J] of b) E.circle(_, J, u).fill({
1551
1551
  color: 3900150,
1552
1552
  alpha: 0.9
1553
1553
  });
1554
- if (!Jt.current) {
1555
- const _ = i + d / 2, J = n - vn;
1556
- v.moveTo(_, n).lineTo(_, J).stroke({
1554
+ if (!jt.current) {
1555
+ const _ = d + s / 2, J = n - In;
1556
+ E.moveTo(_, n).lineTo(_, J).stroke({
1557
1557
  color: 3900150,
1558
1558
  width: 1.5,
1559
1559
  alpha: 0.85
1560
- }), v.circle(_, J, 6).fill({ color: 16777215 }).stroke({
1560
+ }), E.circle(_, J, 6).fill({ color: 16777215 }).stroke({
1561
1561
  color: 3900150,
1562
1562
  width: 1.5
1563
- }), v.circle(_, J, 2.5).fill({ color: 3900150 });
1563
+ }), E.circle(_, J, 2.5).fill({ color: 3900150 });
1564
1564
  }
1565
1565
  }
1566
1566
  }
1567
1567
  });
1568
1568
  };
1569
- return V(), () => {
1569
+ return q(), () => {
1570
1570
  if (G = !0, f && !f.destroyed) try {
1571
1571
  f.app.stage.removeAllListeners();
1572
1572
  } catch {
1573
1573
  }
1574
- const O = M.current;
1575
- F && O?.removeEventListener("touchstart", F), Y && O?.removeEventListener("touchmove", Y), K && (O?.removeEventListener("touchend", K), O?.removeEventListener("touchcancel", K)), H.current?.destroy(), kt.current?.destroy(), ye.current?.destroy(), pe.current?.destroy(), xe.current?.destroy(), Me.current?.destroy(), Re.current?.destroy(), wt.current?.destroy(), te.current && (te.current.destroy(), te.current = null), ee.current && (ee.current.destroy(), ee.current = null), ne.current && (ne.current.destroy(), ne.current = null), re.current && (re.current.destroy(), re.current = null), ge.current?.destroy();
1574
+ const F = R.current;
1575
+ O && F?.removeEventListener("touchstart", O), W && F?.removeEventListener("touchmove", W), K && (F?.removeEventListener("touchend", K), F?.removeEventListener("touchcancel", K)), D.current?.destroy(), Tt.current?.destroy(), pe.current?.destroy(), xe.current?.destroy(), ge.current?.destroy(), Re.current?.destroy(), Se.current?.destroy(), mt.current?.destroy(), Qt.current && (Qt.current.destroy(), Qt.current = null), te.current && (te.current.destroy(), te.current = null), ee.current && (ee.current.destroy(), ee.current = null), ne.current && (ne.current.destroy(), ne.current = null), we.current?.destroy();
1576
1576
  };
1577
- }, [D.current]), Rt(() => {
1578
- const f = Me.current, G = Re.current;
1577
+ }, [L.current]), Rt(() => {
1578
+ const f = Re.current, G = Se.current;
1579
1579
  if (!(!f || !G))
1580
- switch (f.deactivate(), G.deactivate(), $) {
1580
+ switch (f.deactivate(), G.deactivate(), et) {
1581
1581
  case "freehand":
1582
1582
  f.activate();
1583
1583
  break;
@@ -1589,68 +1589,67 @@ function fr({ onPixiReady: L }) {
1589
1589
  break;
1590
1590
  case "arrow":
1591
1591
  G.activate("arrow");
1592
- break;
1593
1592
  }
1594
- }, [$]), Rt(() => {
1595
- H.current && (H.current.visible = j, H.current.gridSize = et);
1596
- }, [j, et]), Rt(() => {
1597
- const f = M.current;
1593
+ }, [et]), Rt(() => {
1594
+ D.current && (D.current.visible = ut, D.current.gridSize = $);
1595
+ }, [ut, $]), Rt(() => {
1596
+ const f = R.current;
1598
1597
  if (!f) return;
1599
- const G = 1e-3, F = (Y) => {
1600
- Y.preventDefault();
1601
- const K = B.current;
1598
+ const G = 1e-3, O = (W) => {
1599
+ W.preventDefault();
1600
+ const K = V.current;
1602
1601
  if (!K) return;
1603
- const V = f.getBoundingClientRect(), O = Y.clientX - V.left, at = Y.clientY - V.top, vt = Y.ctrlKey ? 3 : 1, It = -Y.deltaY * G * vt;
1604
- K.zoomAt(O, at, 1 + It);
1602
+ const q = f.getBoundingClientRect(), F = W.clientX - q.left, at = W.clientY - q.top, lt = W.ctrlKey ? 3 : 1, It = -W.deltaY * G * lt;
1603
+ K.zoomAt(F, at, 1 + It);
1605
1604
  };
1606
- return f.addEventListener("wheel", F, { passive: !1 }), () => f.removeEventListener("wheel", F);
1607
- }, [B]), /* @__PURE__ */ ve("div", {
1605
+ return f.addEventListener("wheel", O, { passive: !1 }), () => f.removeEventListener("wheel", O);
1606
+ }, [V]), /* @__PURE__ */ Ie("div", {
1608
1607
  style: {
1609
1608
  position: "relative",
1610
1609
  width: "100%",
1611
1610
  height: "100%"
1612
1611
  },
1613
1612
  children: [
1614
- /* @__PURE__ */ Zt("div", {
1615
- ref: M,
1613
+ /* @__PURE__ */ qt("div", {
1614
+ ref: R,
1616
1615
  className: "flow-canvas-wrapper",
1617
1616
  tabIndex: -1,
1618
1617
  onContextMenu: (f) => f.preventDefault()
1619
1618
  }),
1620
- ht && Ne && /* @__PURE__ */ Zt("input", {
1619
+ yt && Te && /* @__PURE__ */ qt("input", {
1621
1620
  className: "flow-label-editor",
1622
1621
  autoFocus: !0,
1623
- defaultValue: ht.value,
1622
+ defaultValue: yt.value,
1624
1623
  style: {
1625
- left: Ne.x,
1626
- top: Ne.y
1624
+ left: Te.x,
1625
+ top: Te.y
1627
1626
  },
1628
1627
  onFocus: (f) => f.currentTarget.select(),
1629
1628
  onKeyDown: (f) => {
1630
- f.key === "Enter" ? (f.preventDefault(), Je(f.target.value)) : f.key === "Escape" && (f.preventDefault(), bn()), f.stopPropagation();
1629
+ f.key === "Enter" ? (f.preventDefault(), Qe(f.target.value)) : f.key === "Escape" && (f.preventDefault(), Rn()), f.stopPropagation();
1631
1630
  },
1632
- onBlur: (f) => Je(f.target.value),
1631
+ onBlur: (f) => Qe(f.target.value),
1633
1632
  onPointerDown: (f) => f.stopPropagation()
1634
1633
  }),
1635
- Ut && !Et && /* @__PURE__ */ ve("button", {
1634
+ wt && !Ct && /* @__PURE__ */ Ie("button", {
1636
1635
  type: "button",
1637
1636
  className: "flow-esc-button",
1638
- onClick: () => Lt(null),
1637
+ onClick: () => he(null),
1639
1638
  title: "取消连续放置 (Esc)",
1640
- children: [/* @__PURE__ */ Zt("span", {
1639
+ children: [/* @__PURE__ */ qt("span", {
1641
1640
  "aria-hidden": !0,
1642
1641
  children: "⎋"
1643
1642
  }), " 取消放置 (ESC)"]
1644
1643
  }),
1645
- /* @__PURE__ */ ve("button", {
1646
- ref: Fe,
1644
+ /* @__PURE__ */ Ie("button", {
1645
+ ref: Be,
1647
1646
  type: "button",
1648
1647
  className: "flow-delete-button",
1649
1648
  style: { display: "none" },
1650
- onClick: () => Oe.current(),
1649
+ onClick: () => Fe.current(),
1651
1650
  title: "删除所选 (Delete)",
1652
1651
  "aria-label": "删除所选",
1653
- children: [/* @__PURE__ */ ve("svg", {
1652
+ children: [/* @__PURE__ */ Ie("svg", {
1654
1653
  width: "12",
1655
1654
  height: "12",
1656
1655
  viewBox: "0 0 24 24",
@@ -1661,9 +1660,9 @@ function fr({ onPixiReady: L }) {
1661
1660
  strokeLinejoin: "round",
1662
1661
  "aria-hidden": !0,
1663
1662
  children: [
1664
- /* @__PURE__ */ Zt("path", { d: "M3 6h18" }),
1665
- /* @__PURE__ */ Zt("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }),
1666
- /* @__PURE__ */ Zt("path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
1663
+ /* @__PURE__ */ qt("path", { d: "M3 6h18" }),
1664
+ /* @__PURE__ */ qt("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }),
1665
+ /* @__PURE__ */ qt("path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
1667
1666
  ]
1668
1667
  }), "删除"]
1669
1668
  })
@@ -1671,7 +1670,7 @@ function fr({ onPixiReady: L }) {
1671
1670
  });
1672
1671
  }
1673
1672
  export {
1674
- fr as default
1673
+ yr as default
1675
1674
  };
1676
1675
 
1677
1676
  //# sourceMappingURL=FlowCanvas.js.map