@xyflow/vue 2.0.0-next.2 → 2.0.0-next.3

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.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Slots","infiniteExtent","noop","alwaysValid","ConnectionMode","Position","Position","BaseEdge","Position","BaseEdge","Position","BaseEdge","BaseEdge","ResizeControlVariant","SelectionMode","PanOnScrollMode","ConnectionLineType","ConnectionMode","Position","Handle","Fragment","Position","Fragment","Handle","Position","Handle","Fragment","Slots","ConnectionMode","Position","oppositePosition","ConnectionLineType","Position","Slots","ConnectionMode","Position","Slots","Slots"],"sources":["../src/context/index.ts","../src/utils/errors.ts","../src/composables/useVueFlow.ts","../src/components/Background/patterns.ts","../src/components/Background/Background.vue","../src/components/Controls/ControlButton.vue","../src/composables/storeToRefs.ts","../src/composables/useDrag.ts","../src/utils/a11y.ts","../src/utils/changes.ts","../src/utils/createExtendedEventHook.ts","../src/utils/drag.ts","../src/utils/edge.ts","../src/utils/graph.ts","../src/utils/handle.ts","../src/utils/log.ts","../src/utils/node.ts","../src/utils/store.ts","../src/composables/useEdge.ts","../src/composables/useStore.ts","../src/composables/useHandle.ts","../src/composables/useNodeId.ts","../src/composables/useInternalNode.ts","../src/composables/useKeyPress.ts","../src/composables/useNode.ts","../src/composables/useUpdateNodePositions.ts","../src/composables/useViewportHelper.ts","../src/composables/useWatchProps.ts","../src/components/Panel/Panel.vue","../src/components/Controls/icons.ts","../src/components/Controls/Controls.vue","../src/components/Edges/EdgeText.vue","../src/components/Edges/BaseEdge.vue","../src/components/Edges/utils.ts","../src/components/Edges/BezierEdge.ts","../src/components/Edges/EdgeLabelRenderer.vue","../src/components/Edges/SimpleBezierEdge.ts","../src/components/Edges/SmoothStepEdge.ts","../src/components/Edges/StepEdge.ts","../src/components/Edges/StraightEdge.ts","../src/components/Handle/Handle.vue","../src/components/MiniMap/types.ts","../src/components/MiniMap/MiniMapNode.vue","../src/components/MiniMap/MiniMap.vue","../src/components/NodeResizer/utils.ts","../src/components/NodeResizer/ResizeControl.vue","../src/components/NodeResizer/NodeResizer.vue","../src/components/NodeToolbar/NodeToolbar.vue","../src/composables/useConnection.ts","../src/composables/useEdgesData.ts","../src/composables/useNodeConnections.ts","../src/composables/useNodesData.ts","../src/composables/useNodesInitialized.ts","../src/components/A11y/A11yDescriptions.vue","../src/store/hooks.ts","../src/store/state.ts","../src/store/actions.ts","../src/components/Nodes/DefaultNode.ts","../src/components/Nodes/InputNode.ts","../src/components/Nodes/OutputNode.ts","../src/utils/defaultNodesEdges.ts","../src/store/getters.ts","../src/store/createStore.ts","../src/composables/useCreateVueFlow.ts","../src/composables/useOnInitHandler.ts","../src/composables/useSelectionChange.ts","../src/composables/useStylesLoadedWarning.ts","../src/composables/useViewportSync.ts","../src/components/ConnectionLine/index.ts","../src/composables/useFitViewOnInit.ts","../src/composables/useResizeHandler.ts","../src/components/Edges/EdgeAnchor.ts","../src/components/Edges/EdgeWrapper.ts","../src/types/edge.ts","../src/container/EdgeRenderer/MarkerSymbols.vue","../src/container/EdgeRenderer/MarkerDefinitions.vue","../src/container/EdgeRenderer/EdgeRenderer.vue","../src/components/Nodes/NodeWrapper.ts","../src/components/NodesSelection/NodesSelection.vue","../src/components/UserSelection/UserSelection.vue","../src/container/NodeRenderer/NodeRenderer.vue","../src/container/Pane/Pane.vue","../src/container/Viewport/ZoomPaneSlot.ts","../src/container/Viewport/Viewport.vue","../src/container/ZoomPane/ZoomPane.vue","../src/container/VueFlow/VueFlow.vue","../src/container/VueFlowProvider/VueFlowProvider.vue"],"sourcesContent":["import type { InjectionKey, ShallowRef } from 'vue';\nimport type { FlowSlots, VueFlowInstance, VueFlowState } from '../types';\n\n/** the curated instance (`useVueFlow()`) */\nexport const VueFlow: InjectionKey<VueFlowInstance> = Symbol('vueFlow');\n/** the reactive state (`useStore()`) */\nexport const VueFlowStateKey: InjectionKey<VueFlowState> = Symbol('vueFlowState');\nexport const NodeId: InjectionKey<string> = Symbol('nodeId');\nexport const NodeRef: InjectionKey<ShallowRef<HTMLDivElement | null>> = Symbol('nodeRef');\nexport const EdgeId: InjectionKey<string> = Symbol('edgeId');\nexport const EdgeRef: InjectionKey<ShallowRef<SVGElement | null>> = Symbol('edgeRef');\nexport const Slots: InjectionKey<Readonly<FlowSlots>> = Symbol('slots');\n","export enum ErrorCode {\n MISSING_STYLES = 'MISSING_STYLES',\n MISSING_VIEWPORT_DIMENSIONS = 'MISSING_VIEWPORT_DIMENSIONS',\n NODE_INVALID = 'NODE_INVALID',\n NODE_NOT_FOUND = 'NODE_NOT_FOUND',\n NODE_MISSING_PARENT = 'NODE_MISSING_PARENT',\n NODE_TYPE_MISSING = 'NODE_TYPE_MISSING',\n NODE_EXTENT_INVALID = 'NODE_EXTENT_INVALID',\n EDGE_INVALID = 'EDGE_INVALID',\n EDGE_NOT_FOUND = 'EDGE_NOT_FOUND',\n EDGE_SOURCE_MISSING = 'EDGE_SOURCE_MISSING',\n EDGE_TARGET_MISSING = 'EDGE_TARGET_MISSING',\n EDGE_TYPE_MISSING = 'EDGE_TYPE_MISSING',\n EDGE_SOURCE_TARGET_MISSING = 'EDGE_SOURCE_TARGET_MISSING',\n\n USE_VUE_FLOW_OUTSIDE_PROVIDER = 'USE_VUE_FLOW_OUTSIDE_PROVIDER',\n}\n\nconst messages = {\n [ErrorCode.MISSING_STYLES]: () =>\n `It seems that you haven't loaded the necessary styles. Please import '@vue-flow/core/dist/style.css' to ensure that the graph is rendered correctly`,\n [ErrorCode.MISSING_VIEWPORT_DIMENSIONS]: () => 'The Vue Flow parent container needs a width and a height to render the graph',\n [ErrorCode.NODE_INVALID]: (id?: string) => `Node is invalid\\nNode id: ${id}`,\n [ErrorCode.NODE_NOT_FOUND]: (id: string | null) => `Node not found\\nNode id: ${id}`,\n [ErrorCode.NODE_MISSING_PARENT]: (id: string, parentId: string) =>\n `Node is missing a parent\\nNode id: ${id}\\nParent id: ${parentId}`,\n [ErrorCode.NODE_TYPE_MISSING]: (type: string) => `Node type is missing\\nType: ${type}`,\n [ErrorCode.NODE_EXTENT_INVALID]: (id: string) => `Only child nodes can use a parent extent\\nNode id: ${id}`,\n [ErrorCode.EDGE_INVALID]: (id: string) => `An edge needs a source and a target\\nEdge id: ${id}`,\n [ErrorCode.EDGE_SOURCE_MISSING]: (id: string, source: string) =>\n `Edge source is missing\\nEdge id: ${id} \\nSource id: ${source}`,\n [ErrorCode.EDGE_TARGET_MISSING]: (id: string, target: string) =>\n `Edge target is missing\\nEdge id: ${id} \\nTarget id: ${target}`,\n [ErrorCode.EDGE_TYPE_MISSING]: (type: string) => `Edge type is missing\\nType: ${type}`,\n [ErrorCode.EDGE_SOURCE_TARGET_MISSING]: (id: string, source: string, target: string) =>\n `Edge source or target is missing\\nEdge id: ${id} \\nSource id: ${source} \\nTarget id: ${target}`,\n [ErrorCode.EDGE_NOT_FOUND]: (id: string) => `Edge not found\\nEdge id: ${id}`,\n [ErrorCode.USE_VUE_FLOW_OUTSIDE_PROVIDER]: () =>\n `useVueFlow() was called without a <VueFlow> or <VueFlowProvider> ancestor (or outside a component setup). Render one of them above the call, or wrap your components in <VueFlowProvider> to share a store.`,\n} as const;\n\ntype ErrorArgs<T extends ErrorCode> = (typeof messages)[T] extends (...args: any[]) => string\n ? Parameters<(typeof messages)[T]>\n : never;\n\nexport class VueFlowError<T extends ErrorCode = ErrorCode, Args extends ErrorArgs<T> = ErrorArgs<T>> extends Error {\n name = 'VueFlowError';\n code: T;\n args: Args;\n\n constructor(code: T, ...args: Args) {\n // @ts-expect-error - TS doesn't know that the message is a key of messages\n super(messages[code]?.(...args));\n this.code = code;\n this.args = args;\n }\n}\n\nexport function isErrorOfType<T extends ErrorCode>(error: VueFlowError, code: T): error is VueFlowError<T> {\n return error.code === code;\n}\n","import type { Edge, Node, VueFlowInstance } from '../types';\nimport { inject } from 'vue';\nimport { VueFlow } from '../context';\nimport { ErrorCode, VueFlowError } from '../utils/errors';\n\n/**\n * Access the VueFlow instance for the surrounding flow — actions, computed getters, and event hooks\n * (mirrors `useReactFlow` / `useSvelteFlow`). For the raw reactive state (`nodes`, `transform`,\n * lookups, …) use {@link useStore} (and `storeToRefs` to destructure it).\n *\n * Pure context consumer — resolves the instance provided by the nearest `<VueFlow>` /\n * `<VueFlowProvider>` ancestor. It takes **no arguments**: there is no global registry, no\n * lookup-by-id, and no store creation here. To create/own a store, render a `<VueFlowProvider>` (or\n * `<VueFlow>`, which provides its own); to share one across components, wrap them in a common\n * `<VueFlowProvider>`.\n *\n * Throws if called outside a provider (or outside a component `setup`, where `inject` is unavailable).\n *\n * @public\n * @returns the VueFlow instance for the current context\n */\nexport function useVueFlow<NodeType extends Node = Node, EdgeType extends Edge = Edge>(): VueFlowInstance<NodeType, EdgeType> {\n const instance = inject(VueFlow, null) as VueFlowInstance<NodeType, EdgeType> | null;\n\n if (!instance) {\n throw new VueFlowError(ErrorCode.USE_VUE_FLOW_OUTSIDE_PROVIDER);\n }\n\n return instance;\n}\n","import type { FunctionalComponent } from 'vue';\nimport type { BackgroundVariant } from './types';\nimport { h } from 'vue';\n\ninterface LinePatternProps {\n dimensions: [number, number];\n size?: number;\n color: string;\n}\n\nexport const LinePattern: FunctionalComponent<LinePatternProps> = function ({ dimensions, size, color }) {\n return h('path', {\n 'stroke': color,\n 'stroke-width': size,\n 'd': `M${dimensions[0] / 2} 0 V${dimensions[1]} M0 ${dimensions[1] / 2} H${dimensions[0]}`,\n });\n};\n\ninterface DotPatternProps {\n radius: number;\n color: string;\n}\n\nexport const DotPattern: FunctionalComponent<DotPatternProps> = function ({ radius, color }) {\n return h('circle', { cx: radius, cy: radius, r: radius, fill: color });\n};\n\nexport const Patterns = {\n lines: LinePattern,\n dots: DotPattern,\n};\n\nexport const DefaultBgColors: Record<BackgroundVariant, string> = {\n lines: '#eee',\n dots: '#91919a',\n};\n","<script lang=\"ts\" setup>\nimport type { BackgroundProps } from './types';\nimport { computed } from 'vue';\nimport { useVueFlow } from '../../composables/useVueFlow';\nimport { DefaultBgColors, DotPattern, LinePattern } from './patterns';\n\nconst props = withDefaults(defineProps<BackgroundProps>(), {\n variant: 'dots',\n gap: 20,\n size: 1,\n lineWidth: 1,\n x: 0,\n y: 0,\n offset: 0,\n});\n\nconst { id: vueFlowId, viewport } = useVueFlow();\n\nconst background = computed(() => {\n const { gap, offset, size } = props;\n\n const zoom = viewport.value.zoom;\n const [gapX, gapY] = Array.isArray(gap) ? gap : [gap, gap];\n const scaledGap: [number, number] = [gapX * zoom || 1, gapY * zoom || 1];\n const scaledSize = size * zoom;\n const [offsetX, offsetY]: [number, number] = Array.isArray(offset) ? offset : [offset, offset];\n\n const scaledOffset: [number, number] = [offsetX * zoom || 1 + scaledGap[0] / 2, offsetY * zoom || 1 + scaledGap[1] / 2];\n\n return {\n scaledGap,\n offset: scaledOffset,\n size: scaledSize,\n };\n});\n\n// when there are multiple flows on a page we need to make sure that every background gets its own pattern.\nconst patternId = computed(() => `pattern-${vueFlowId}${props.id ? `-${props.id}` : ''}`);\n\nconst patternColor = computed(() => props.color || DefaultBgColors[props.variant || 'dots']);\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'Background',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <svg class=\"vue-flow__background vue-flow__container\">\n <slot :id=\"patternId\" name=\"pattern-container\">\n <pattern\n :id=\"patternId\"\n :x=\"viewport.x % background.scaledGap[0]\"\n :y=\"viewport.y % background.scaledGap[1]\"\n :width=\"background.scaledGap[0]\"\n :height=\"background.scaledGap[1]\"\n :patternTransform=\"`translate(-${background.offset[0]},-${background.offset[1]})`\"\n patternUnits=\"userSpaceOnUse\"\n >\n <slot name=\"pattern\">\n <template v-if=\"variant === 'lines'\">\n <LinePattern :size=\"lineWidth\" :color=\"patternColor\" :dimensions=\"background.scaledGap\" />\n </template>\n\n <template v-else-if=\"variant === 'dots'\">\n <DotPattern :color=\"patternColor\" :radius=\"background.size / 2\" />\n </template>\n </slot>\n </pattern>\n </slot>\n\n <rect :x=\"x\" :y=\"y\" width=\"100%\" height=\"100%\" :fill=\"`url(#${patternId})`\" />\n\n <slot :id=\"patternId\" />\n </svg>\n</template>\n","<script lang=\"ts\" setup>\ndefineProps<{\n disabled?: boolean;\n /** accessible label; applied as both `aria-label` and `title` (mirrors xyflow) */\n label?: string;\n}>();\n\ndefineEmits<{\n click: [payload: MouseEvent];\n}>();\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'ControlButton',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <button\n type=\"button\"\n class=\"vue-flow__controls-button\"\n :disabled=\"disabled\"\n :aria-label=\"label\"\n :title=\"label\"\n @click=\"$emit('click', $event)\"\n >\n <slot />\n </button>\n</template>\n","import type { ToRefs } from 'vue';\nimport type { Edge, Node, VueFlowState } from '../types';\nimport { toRefs } from 'vue';\n\n/**\n * Destructure the reactive state from {@link useStore} into refs without losing reactivity (Pinia's\n * `storeToRefs`). Destructuring the reactive state object directly hands back plain values for\n * scalar/array fields; this projects them to refs instead:\n *\n * ```ts\n * const { nodes, transform } = storeToRefs(useStore()) // Ref<Node[]>, Ref<Transform>\n * ```\n *\n * Reference-type fields (the `nodeLookup`/`parentLookup`/`edgeLookup`/`connectionLookup` Maps) stay\n * reactive when destructured straight off `useStore()` — you only need this for the value-type fields.\n *\n * @public\n */\nexport function storeToRefs<NodeType extends Node = Node, EdgeType extends Edge = Edge>(\n store: VueFlowState<NodeType, EdgeType>,\n): ToRefs<VueFlowState<NodeType, EdgeType>> {\n return toRefs(store);\n}\n","import type { CoordinateExtent, EdgeBase, InternalNodeBase, NodeBase, NodeDragItem as SystemNodeDragItem } from '@xyflow/system';\nimport type { MaybeRefOrGetter, Ref } from 'vue';\nimport type { Node, NodeDragEvent, NodeDragItem } from '../types';\nimport { infiniteExtent, isCoordinateExtent, XYDrag } from '@xyflow/system';\nimport { shallowRef, toValue, watchEffect } from 'vue';\nimport { useStore, useVueFlow } from '.';\n\ninterface UseDragParams {\n onStart: (event: NodeDragEvent) => void;\n onDrag: (event: NodeDragEvent) => void;\n onStop: (event: NodeDragEvent) => void;\n onClick?: (event: PointerEvent) => void;\n el: Ref<Element | null>;\n disabled?: MaybeRefOrGetter<boolean>;\n selectable?: MaybeRefOrGetter<boolean>;\n dragHandle?: MaybeRefOrGetter<string | undefined>;\n id?: string;\n}\n\n/**\n * Composable that provides drag behavior for nodes\n *\n * @internal\n * @param params\n */\nexport function useDrag(params: UseDragParams) {\n const { panBy, getInternalNode, removeSelectedNodes, removeSelectedEdges, updateNodePositions, getNodes, getEdges }\n = useVueFlow();\n\n // Read the reactive store directly — these are read inside the XYDrag `getStoreItems`/`update` callbacks\n // and the `watchEffect`, where `store.x` yields the current value with the same reactivity (no per-node\n // ref projection).\n const store = useStore();\n\n const { nodeLookup } = store;\n\n const { onStart, onDrag, onStop, onClick, el, disabled, id, selectable, dragHandle } = params;\n\n const dragging = shallowRef(false);\n\n watchEffect((onCleanup) => {\n const nodeEl = el.value;\n\n if (!nodeEl || toValue(disabled)) {\n return;\n }\n\n let dragFired = false;\n let pointerDownPos = { x: 0, y: 0 };\n\n const dragInstance = XYDrag({\n getStoreItems: () => ({\n // lazy getters: XYDrag never destructures `nodes`/`edges` (verified against every getStoreItems\n // call site in system), and getStoreItems runs multiple times per pointermove — eagerly reading\n // the getters here would recompute them per frame (O(n+m) with `onlyRenderVisibleElements`).\n // getNodes is readonly (public guard); XYDrag reads node data from nodeLookup, not this array.\n get nodes() {\n return getNodes.value as NodeBase[];\n },\n nodeLookup,\n get edges() {\n return getEdges.value as EdgeBase[];\n },\n nodeExtent: (isCoordinateExtent(store.nodeExtent as CoordinateExtent)\n ? store.nodeExtent\n : infiniteExtent) as CoordinateExtent,\n snapGrid: store.snapGrid,\n snapToGrid: store.snapToGrid,\n nodeOrigin: store.nodeOrigin,\n multiSelectionActive: store.multiSelectionActive,\n domNode: store.vueFlowRef,\n transform: store.transform,\n autoPanOnNodeDrag: store.autoPanOnNodeDrag,\n nodesDraggable: store.nodesDraggable,\n selectNodesOnDrag: store.selectNodesOnDrag,\n nodeDragThreshold: store.nodeDragThreshold,\n panBy,\n unselectNodesAndEdges: (args?: { nodes?: any[]; edges?: any[] }) => {\n removeSelectedNodes(args?.nodes);\n removeSelectedEdges(args?.edges);\n },\n updateNodePositions: (dragItems: Map<string, SystemNodeDragItem | InternalNodeBase>, isDragging?: boolean) => {\n const items: NodeDragItem[] = [];\n for (const raw of dragItems.values()) {\n // XYDrag may emit either NodeDragItem (the normal case) or InternalNodeBase entries\n // (selection drags). Both shapes carry `measured` and `internals.positionAbsolute`.\n const item = raw as SystemNodeDragItem;\n const node = getInternalNode(item.id);\n const width = item.measured?.width ?? node?.measured.width ?? 0;\n const height = item.measured?.height ?? node?.measured.height ?? 0;\n const positionAbsolute = item.internals?.positionAbsolute ?? node?.internals.positionAbsolute ?? { x: 0, y: 0 };\n items.push({\n id: item.id,\n position: item.position,\n distance: item.distance ?? { x: 0, y: 0 },\n measured: { width, height },\n internals: { positionAbsolute },\n extent: item.extent,\n parentId: item.parentId,\n expandParent: item.expandParent,\n dragging: item.dragging,\n origin: item.origin,\n });\n }\n updateNodePositions(items, true, isDragging ?? false);\n },\n autoPanSpeed: store.autoPanSpeed,\n }),\n // XYDrag hands user nodes (the InternalNode's `userNode`, spread with the live drag position +\n // `dragging`), which is exactly the event payload — emit them directly, no lookup round-trip\n onDragStart: (event, _dragItems, node, nodes) => {\n dragFired = true;\n dragging.value = true;\n onStart({ event, node: node as Node, nodes: nodes as Node[] });\n },\n onDrag: (event, _dragItems, node, nodes) => {\n onDrag({ event, node: node as Node, nodes: nodes as Node[] });\n },\n onDragStop: (event, _dragItems, node, nodes) => {\n dragging.value = false;\n onStop({ event, node: node as Node, nodes: nodes as Node[] });\n },\n });\n\n dragInstance.update({\n noDragClassName: store.noDragClassName,\n handleSelector: toValue(dragHandle),\n isSelectable: toValue(selectable),\n nodeId: id,\n domNode: nodeEl,\n nodeClickDistance: store.nodeClickDistance,\n });\n\n // Handle the \"moved slightly but within threshold\" click case.\n // XYDrag won't fire drag events for sub-threshold movement, and d3 would normally\n // suppress the native click. We detect this case with pointer listeners.\n const handlePointerDown = (e: PointerEvent) => {\n dragFired = false;\n pointerDownPos = { x: e.clientX, y: e.clientY };\n };\n\n const handlePointerUp = (e: PointerEvent) => {\n if (!dragFired && onClick) {\n const dx = e.clientX - pointerDownPos.x;\n const dy = e.clientY - pointerDownPos.y;\n const dist = Math.sqrt(dx * dx + dy * dy);\n\n if (dist > 0 && dist <= store.nodeDragThreshold) {\n onClick(e);\n }\n }\n };\n\n const target = nodeEl as HTMLElement;\n target.addEventListener('pointerdown', handlePointerDown);\n target.addEventListener('pointerup', handlePointerUp);\n\n onCleanup(() => {\n dragInstance.destroy();\n target.removeEventListener('pointerdown', handlePointerDown);\n target.removeEventListener('pointerup', handlePointerUp);\n });\n });\n\n return dragging;\n}\n","import type { XYPosition } from '@xyflow/system';\n\nexport const ARIA_NODE_DESC_KEY = 'vue-flow__node-desc';\nexport const ARIA_EDGE_DESC_KEY = 'vue-flow__edge-desc';\n\nexport const ARIA_LIVE_MESSAGE = 'vue-flow__aria-live';\n\nexport const elementSelectionKeys = ['Enter', ' ', 'Escape'];\n\nexport const arrowKeyDiffs: Record<string, XYPosition> = {\n ArrowUp: { x: 0, y: -1 },\n ArrowDown: { x: 0, y: 1 },\n ArrowLeft: { x: -1, y: 0 },\n ArrowRight: { x: 1, y: 0 },\n};\n","import type {\n EdgeRemoveChange,\n EdgeSelectionChange,\n NodeRemoveChange,\n NodeSelectionChange,\n} from '@xyflow/system';\nimport type {\n Edge,\n EdgeAddChange,\n EdgeChange,\n ElementChange,\n InternalNode,\n Node,\n NodeAddChange,\n NodeChange,\n} from '../types';\nimport { isNode } from '.';\n\n/**\n * Apply element changes IMMUTABLY (xyflow/react `applyNodeChanges` semantics): returns a NEW array where\n * changed elements are NEW objects and unchanged elements are reused by reference. Immutability is required\n * by the node split — the store re-adopts the result via `adoptUserNodes`, whose `checkEquality` reuses the\n * existing `InternalNode` when the user-node reference is unchanged; mutating in place would keep the same\n * reference and re-adopt a stale internal node. Reusing unchanged refs keeps re-adoption O(changed).\n *\n * `position`/`dimensions` changes are gated on `isNode` (user `Node`s have no `internals`, so the old\n * `isInternalNode` guard would skip them) — edges never receive those change types anyway.\n */\nexport function applyChanges<\n T extends Node | Edge = Node | Edge,\n C extends ElementChange = T extends InternalNode ? NodeChange : EdgeChange,\n>(changes: C[], elements: T[]): T[] {\n // bucket changes: field updates by id, plus add/remove\n const updatesById = new Map<string, C[]>();\n const addChanges: (NodeAddChange | EdgeAddChange)[] = [];\n const removeIds = new Set<string>();\n\n for (const change of changes) {\n if (change.type === 'add') {\n addChanges.push(change as NodeAddChange | EdgeAddChange);\n }\n else if (change.type === 'remove') {\n removeIds.add((change as NodeRemoveChange | EdgeRemoveChange).id);\n }\n else {\n const id = (change as { id?: string }).id;\n if (id == null) {\n continue;\n }\n const bucket = updatesById.get(id);\n if (bucket) {\n bucket.push(change);\n }\n else {\n updatesById.set(id, [change]);\n }\n }\n }\n\n const next: T[] = [];\n\n for (const element of elements) {\n if (removeIds.has(element.id)) {\n continue;\n }\n\n const elementChanges = updatesById.get(element.id);\n if (!elementChanges) {\n // unchanged → reuse the same reference (so the store's `checkEquality` re-adopt is a no-op)\n next.push(element);\n continue;\n }\n\n const updated = { ...element } as T;\n\n for (const currentChange of elementChanges) {\n switch (currentChange.type) {\n case 'select':\n ;(updated as { selected?: boolean }).selected = currentChange.selected;\n break;\n case 'position':\n if (isNode(updated)) {\n if (typeof currentChange.position !== 'undefined') {\n updated.position = currentChange.position;\n }\n\n if (typeof currentChange.dragging !== 'undefined') {\n updated.dragging = currentChange.dragging;\n }\n }\n break;\n case 'dimensions':\n if (isNode(updated)) {\n if (typeof currentChange.dimensions !== 'undefined') {\n updated.measured = { width: currentChange.dimensions.width, height: currentChange.dimensions.height };\n }\n\n if (currentChange.setAttributes) {\n const setW = currentChange.setAttributes === true || currentChange.setAttributes === 'width';\n const setH = currentChange.setAttributes === true || currentChange.setAttributes === 'height';\n updated.style = {\n ...(updated.style ?? {}),\n ...(setW && { width: `${currentChange.dimensions?.width}px` }),\n ...(setH && { height: `${currentChange.dimensions?.height}px` }),\n };\n }\n\n if (typeof currentChange.resizing !== 'undefined') {\n updated.resizing = currentChange.resizing;\n }\n }\n break;\n }\n }\n\n next.push(updated);\n }\n\n for (const change of addChanges) {\n if (next.some(el => el.id === change.item.id)) {\n continue;\n }\n\n if (typeof change.index === 'number') {\n next.splice(change.index, 0, change.item as unknown as T);\n }\n else {\n next.push(change.item as unknown as T);\n }\n }\n\n return next;\n}\n\n/** @deprecated Prefer the store instance's apply methods (from `useVueFlow` or the `onInit` instance). */\nexport function applyEdgeChanges(changes: EdgeChange[], edges: Edge[]) {\n return applyChanges(changes, edges);\n}\n\n/** @deprecated Prefer the store instance's apply methods (from `useVueFlow` or the `onInit` instance). */\nexport function applyNodeChanges(changes: NodeChange[], nodes: InternalNode[]) {\n return applyChanges(changes, nodes);\n}\n\nexport function createSelectionChange(id: string, selected: boolean): NodeSelectionChange | EdgeSelectionChange {\n return {\n id,\n type: 'select',\n selected,\n };\n}\n\nexport function createAdditionChange<\n T extends Node | Edge = Node,\n C extends NodeAddChange | EdgeAddChange = T extends Node ? NodeAddChange : EdgeAddChange,\n>(item: T, index?: number): C {\n return <C>{\n item,\n type: 'add',\n ...(typeof index === 'number' && { index }),\n };\n}\n\nexport function createNodeRemoveChange(id: string): NodeRemoveChange {\n return {\n id,\n type: 'remove',\n };\n}\n\nexport function createEdgeRemoveChange(id: string): EdgeRemoveChange {\n return {\n id,\n type: 'remove',\n };\n}\n\nexport function getSelectionChanges(\n items: Map<string, { id: string; selected?: boolean }>,\n selectedIds: Set<string> = new Set(),\n): NodeSelectionChange[] | EdgeSelectionChange[] {\n const changes: NodeSelectionChange[] | EdgeSelectionChange[] = [];\n\n for (const [id, item] of items) {\n const willBeSelected = selectedIds.has(id);\n\n // we don't want to set all items to selected=false on the first selection\n if (!(item.selected === undefined && !willBeSelected) && item.selected !== willBeSelected) {\n changes.push(createSelectionChange(item.id, willBeSelected));\n }\n }\n\n return changes;\n}\n","import { onScopeDispose } from 'vue';\n\n/**\n * vue-flow's own event-hook types. We intentionally do NOT reuse `@vueuse/core`'s `EventHook*` types:\n * since v14 its `Callback<T>` spreads array payloads (for `T extends any[]` it becomes\n * `(...param: T) => void`), which is incompatible with vue-flow's single-array-payload hooks — e.g.\n * `onNodesChange((changes: NodeChange[]) => void)` and `trigger(changes)`. Owning these types keeps the\n * public hook contract stable regardless of `@vueuse/core`'s internal callback variance.\n */\nexport type EventHookOn<T = any> = (fn: (param: T) => void) => { off: () => void };\nexport type EventHookOff<T = any> = (fn: (param: T) => void) => void;\nexport type EventHookTrigger<T = any> = (param: T) => Promise<unknown[]>;\n\nexport interface EventHook<T = any> {\n on: EventHookOn<T>;\n off: EventHookOff<T>;\n trigger: EventHookTrigger<T>;\n}\n\nexport interface EventHookExtended<T> extends EventHook<T> {\n /** true if any user listeners are registered (emitter ignored) */\n hasListeners: () => boolean;\n /** current user listeners (read-only; do not mutate externally) */\n listeners: ReadonlySet<(param: T) => void>;\n /** wire a single external emitter (e.g., for `emit`) */\n setEmitter: (fn: (param: T) => void) => void;\n /** remove the external emitter */\n removeEmitter: () => void;\n /** wire a function to detect if any emit listeners exist (e.g., for `$listeners` in Vue 2) */\n setHasEmitListeners: (fn: () => boolean) => void;\n /** remove the emit listeners detector */\n removeHasEmitListeners: () => void;\n}\n\ntype Handler<T = any> = (param: T) => any | Promise<any>;\n\nconst noop: Handler = () => {};\n\n// shared resolved promise for triggers with no observers — pointer-move hooks fire per mousemove, so\n// allocating a fresh array + allSettled chain for nothing is measurable GC pressure\nconst EMPTY_TRIGGER_RESULT: Promise<unknown[]> = Promise.resolve([]);\n\nexport function createExtendedEventHook<T = any>(defaultHandler?: (param: T) => void): EventHookExtended<T> {\n const listeners = new Set<Handler>();\n let emitter: Handler = noop;\n let hasEmitListeners = () => false;\n\n const hasListeners = () => listeners.size > 0 || hasEmitListeners();\n\n const setEmitter = (fn: Handler) => {\n emitter = fn;\n };\n\n const removeEmitter = () => {\n emitter = noop;\n };\n\n const setHasEmitListeners = (fn: () => boolean) => {\n hasEmitListeners = fn;\n };\n\n const removeHasEmitListeners = () => {\n hasEmitListeners = () => false;\n };\n\n const off: EventHookOff<T> = (fn) => {\n listeners.delete(fn);\n };\n\n const on: EventHookOn<T> = (fn) => {\n listeners.add(fn);\n\n const offFn = () => off(fn);\n // `failSilently` (Vue 3.5+) mirrors `tryOnScopeDispose`: auto-remove the listener when registered\n // inside an effect scope, and no-op (no warning) when `on()` is called outside one.\n onScopeDispose(offFn, true);\n\n return { off: offFn };\n };\n\n /**\n * Trigger order:\n * 1) If any user listeners OR an emitter exist -> call all of those (defaultHandler is skipped)\n * 2) Else (no listeners and no emitter) -> call defaultHandler (if provided)\n *\n * Errors are isolated via allSettled so one failing handler doesn't break others.\n */\n const trigger: EventHookTrigger<T> = (param) => {\n // fast path: nothing can observe this event — no programmatic listeners, no `@event` vnode handler\n // (the emitter would dispatch into a void emit), no default. Skip the dispatch + allocations.\n if (listeners.size === 0 && !hasEmitListeners() && !defaultHandler) {\n return EMPTY_TRIGGER_RESULT;\n }\n\n const queue: Handler[] = [emitter];\n\n if (hasListeners()) {\n queue.push(...listeners);\n }\n else if (defaultHandler) {\n queue.push(defaultHandler);\n }\n\n return Promise.allSettled(queue.map(fn => fn(param)));\n };\n\n return {\n on,\n off,\n trigger,\n hasListeners,\n listeners,\n setEmitter,\n removeEmitter,\n setHasEmitListeners,\n removeHasEmitListeners,\n };\n}\n","import type { CoordinateExtent, XYPosition } from '@xyflow/system';\nimport type { InternalNode, NodeDragItem, State } from '../types';\nimport { clampPosition, getNodeDimensions } from '@xyflow/system';\nimport { ErrorCode, VueFlowError } from '.';\n\n// The absolute bounds of `parent` — the extent a child with `extent: 'parent'` is clamped to.\nfunction getParentExtent(parent: InternalNode): CoordinateExtent | false {\n if (\n parent\n && typeof parent.internals.positionAbsolute.x !== 'undefined'\n && typeof parent.internals.positionAbsolute.y !== 'undefined'\n && typeof parent.measured.width !== 'undefined'\n && typeof parent.measured.height !== 'undefined'\n ) {\n return [\n [parent.internals.positionAbsolute.x, parent.internals.positionAbsolute.y],\n [\n parent.internals.positionAbsolute.x + parent.measured.width,\n parent.internals.positionAbsolute.y + parent.measured.height,\n ],\n ];\n }\n\n return false;\n}\n\nexport function getExtent<T extends NodeDragItem | InternalNode>(\n item: T,\n triggerError: State['hooks']['error']['trigger'],\n extent?: State['nodeExtent'],\n parent?: InternalNode,\n) {\n let currentExtent = item.extent || extent;\n\n if (currentExtent === 'parent' && !item.expandParent) {\n if (item.parentId && parent && item.measured.width && item.measured.height) {\n const parentExtent = getParentExtent(parent);\n\n if (parentExtent) {\n currentExtent = parentExtent;\n }\n }\n else {\n triggerError(new VueFlowError(ErrorCode.NODE_EXTENT_INVALID, item.id));\n\n currentExtent = extent;\n }\n }\n else if (Array.isArray(currentExtent)) {\n const parentX = parent?.internals.positionAbsolute.x || 0;\n const parentY = parent?.internals.positionAbsolute.y || 0;\n\n currentExtent = [\n [currentExtent[0][0] + parentX, currentExtent[0][1] + parentY],\n [currentExtent[1][0] + parentX, currentExtent[1][1] + parentY],\n ];\n }\n\n return (\n currentExtent === 'parent'\n ? [\n [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY],\n [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY],\n ]\n : currentExtent\n ) as CoordinateExtent;\n}\n\nexport function calcNextPosition(\n node: InternalNode | NodeDragItem,\n nextPosition: XYPosition,\n triggerError: State['hooks']['error']['trigger'],\n nodeExtent?: State['nodeExtent'],\n parentNode?: InternalNode,\n) {\n const measured = getNodeDimensions(node);\n\n // `clampPosition` already subtracts the node's dimensions from the extent's max corner (same as\n // system's own `clampPositionToParent`), so pass `getExtent`'s region straight through — pre-shrinking\n // it by the node size first would double-count it and clamp the node a full width/height too far in.\n const clampedPos = clampPosition(nextPosition, getExtent(node, triggerError, nodeExtent, parentNode), measured);\n\n return {\n position: {\n x: clampedPos.x - (parentNode?.internals.positionAbsolute.x || 0),\n y: clampedPos.y - (parentNode?.internals.positionAbsolute.y || 0),\n },\n computedPosition: clampedPos,\n };\n}\n","import type { ZIndexMode } from '@xyflow/system';\nimport type { Actions, Edge, HandleElement } from '../types';\nimport { getElevatedEdgeZIndex } from '@xyflow/system';\n\nexport function getEdgeHandle(bounds: HandleElement[] | null, handleId?: string | null): HandleElement | null {\n if (!bounds) {\n return null;\n }\n\n // if no handleId is given, we use the first handle, otherwise we check for the id\n return (!handleId ? bounds[0] : bounds.find(d => d.id === handleId)) || null;\n}\n\nexport function getEdgeZIndex(\n edge: Edge,\n getInternalNode: Actions['getInternalNode'],\n elevateEdgesOnSelect = false,\n zIndexMode: ZIndexMode = 'basic',\n) {\n const source = getInternalNode(edge.source);\n const target = getInternalNode(edge.target);\n\n if (!source || !target) {\n return 0;\n }\n\n return getElevatedEdgeZIndex({\n sourceNode: source,\n targetNode: target,\n selected: edge.selected ?? false,\n zIndex: typeof edge.zIndex === 'number' ? edge.zIndex : 0,\n elevateOnSelect: elevateEdgesOnSelect,\n zIndexMode,\n });\n}\n","import type { Connection } from '@xyflow/system';\nimport type { Edge, InternalNode, Node } from '../types';\nimport { isEdgeBase, isInternalNodeBase, isNodeBase } from '@xyflow/system';\n\nexport function isEdge<EdgeType extends Edge = Edge>(element: unknown): element is EdgeType {\n return !!element && typeof element === 'object' && isEdgeBase(element);\n}\n\nexport function isNode<NodeType extends Node = Node>(element: unknown): element is NodeType {\n return !!element && typeof element === 'object' && isNodeBase(element);\n}\n\nexport function isInternalNode<NodeType extends Node = Node>(element: unknown): element is InternalNode<NodeType> {\n return !!element && typeof element === 'object' && isInternalNodeBase(element);\n}\n\nexport function connectionExists(edge: Edge | Connection, edges: Edge[]) {\n return edges.some(\n el =>\n el.source === edge.source\n && el.target === edge.target\n && (el.sourceHandle === edge.sourceHandle || (!el.sourceHandle && !edge.sourceHandle))\n && (el.targetHandle === edge.targetHandle || (!el.targetHandle && !edge.targetHandle)),\n );\n}\n","import type { Connection, HandleType } from '@xyflow/system';\nimport type { Actions, Edge, HandleElement, IsValidParams, Node, NodeLookup, Result } from '../types';\nimport { ConnectionMode, getEventPosition, getHandlePosition } from '@xyflow/system';\n\nconst alwaysValid = () => true;\n\nfunction getHandleType(handleDomNode: Element | null): HandleType | null {\n if (handleDomNode?.classList.contains('target')) {\n return 'target';\n }\n else if (handleDomNode?.classList.contains('source')) {\n return 'source';\n }\n\n return null;\n}\n\nexport function getHandle(\n nodeId: string,\n handleType: HandleType,\n handleId: string | null,\n nodeLookup: NodeLookup,\n connectionMode: ConnectionMode,\n withAbsolutePosition = false,\n): HandleElement | null {\n const node = nodeLookup.get(nodeId);\n if (!node) {\n return null;\n }\n\n const handles\n = connectionMode === ConnectionMode.Strict\n ? node.internals.handleBounds?.[handleType]\n : [...(node.internals.handleBounds?.source ?? []), ...(node.internals.handleBounds?.target ?? [])];\n const handle = (handleId ? handles?.find(h => h.id === handleId) : handles?.[0]) ?? null;\n\n return handle && withAbsolutePosition ? { ...handle, ...getHandlePosition(node, handle, handle.position, true) } : handle;\n}\n\n// checks if and returns connection in form of an object { source: 123, target: 312 }\nexport function isValidHandle(\n event: MouseEvent | TouchEvent,\n {\n handle,\n connectionMode,\n fromNodeId,\n fromHandleId,\n fromType,\n doc,\n lib,\n flowId,\n isValidConnection = alwaysValid,\n }: IsValidParams,\n edges: Edge[],\n nodes: Node[],\n getInternalNode: Actions['getInternalNode'],\n nodeLookup: NodeLookup,\n) {\n const isTarget = fromType === 'target';\n const handleDomNode = handle\n ? doc.querySelector(`.${lib}-flow__handle[data-id=\"${flowId}-${handle?.nodeId}-${handle?.id}-${handle?.type}\"]`)\n : null;\n\n const { x, y } = getEventPosition(event);\n const handleBelow = doc.elementFromPoint(x, y);\n // we always want to prioritize the handle below the mouse cursor over the closest distance handle,\n // because it could be that the center of another handle is closer to the mouse pointer than the handle below the cursor\n const handleToCheck = handleBelow?.classList.contains(`${lib}-flow__handle`) ? handleBelow : handleDomNode;\n\n const result: Result = {\n handleDomNode: handleToCheck,\n isValid: false,\n connection: null,\n toHandle: null,\n };\n\n if (handleToCheck) {\n const handleType = getHandleType(handleToCheck);\n const handleNodeId = handleToCheck.getAttribute('data-nodeid');\n const handleId = handleToCheck.getAttribute('data-handleid');\n const connectable = handleToCheck.classList.contains('connectable');\n const connectableEnd = handleToCheck.classList.contains('connectableend');\n\n if (!handleNodeId || !handleType) {\n return result;\n }\n\n const connection: Connection = {\n source: isTarget ? handleNodeId : fromNodeId,\n sourceHandle: isTarget ? handleId : fromHandleId,\n target: isTarget ? fromNodeId : handleNodeId,\n targetHandle: isTarget ? fromHandleId : handleId,\n };\n\n result.connection = connection;\n\n const isConnectable = connectable && connectableEnd;\n // in strict mode we don't allow target to target or source to source connections\n const isValid\n = isConnectable\n && (connectionMode === ConnectionMode.Strict\n ? (isTarget && handleType === 'source') || (!isTarget && handleType === 'target')\n : handleNodeId !== fromNodeId || handleId !== fromHandleId);\n\n result.isValid\n = isValid\n && isValidConnection(connection, {\n nodes,\n edges,\n sourceNode: getInternalNode(connection.source)!,\n targetNode: getInternalNode(connection.target)!,\n });\n\n result.toHandle = getHandle(handleNodeId, handleType, handleId, nodeLookup, connectionMode, true);\n }\n\n return result;\n}\n","const productionEnvs = ['production', 'prod'];\n\nexport function warn(message: string, ...args: unknown[]) {\n if (isDev()) {\n console.warn(`[Vue Flow]: ${message}`, ...args);\n }\n}\n\nexport function isDev() {\n return !productionEnvs.includes(__ENV__ || '');\n}\n","import type { Ref } from 'vue';\nimport type { Actions, InternalNode, NodeLookup } from '../types';\nimport { nextTick } from 'vue';\n\n/**\n * Whether every node in the lookup has been measured — handle bounds resolved + non-zero dimensions. Hidden\n * nodes are skipped unless `includeHiddenNodes`. Shared by `useNodesInitialized` and `fitView`'s queue so the\n * \"are nodes ready\" check has a single definition.\n */\nexport function areNodesInitialized(nodeLookup: NodeLookup, includeHiddenNodes = false): boolean {\n if (nodeLookup.size === 0) {\n return false;\n }\n\n for (const node of nodeLookup.values()) {\n if (includeHiddenNodes || !node.hidden) {\n if (node.internals.handleBounds === undefined || !node.measured?.width || !node.measured?.height) {\n return false;\n }\n }\n }\n\n return true;\n}\n\nexport function handleNodeClick(\n node: InternalNode,\n multiSelectionActive: boolean,\n addSelectedNodes: Actions['addSelectedNodes'],\n removeSelectedNodes: Actions['removeSelectedNodes'],\n nodesSelectionActive: Ref<boolean>,\n unselect = false,\n nodeEl: HTMLDivElement,\n) {\n nodesSelectionActive.value = false;\n\n if (!node.selected) {\n addSelectedNodes([node]);\n }\n else if (unselect || (node.selected && multiSelectionActive)) {\n removeSelectedNodes([node]);\n\n nextTick(() => {\n nodeEl.blur();\n });\n }\n}\n","import type {\n Connection,\n CoordinateExtent,\n NodeConnection,\n NodeLookup as SystemNodeLookup,\n ParentLookup as SystemParentLookup,\n ZIndexMode,\n} from '@xyflow/system';\nimport type {\n Actions,\n ConnectionLookup,\n DefaultEdgeOptions,\n Edge,\n InternalNode,\n Node,\n NodeHandleBounds,\n NodeOrigin,\n State,\n ValidConnectionFunc,\n VueFlowInstance,\n} from '../types';\nimport { adoptUserNodes, getEdgeId } from '@xyflow/system';\nimport { markRaw, toRaw, unref } from 'vue';\nimport { connectionExists, ErrorCode, isEdge, isNode, VueFlowError } from '.';\n\ntype NonUndefined<T> = T extends undefined ? never : T;\n\nexport function isDef<T>(val: T): val is NonUndefined<T> {\n const unrefVal = unref(val);\n\n return typeof unrefVal !== 'undefined';\n}\n\n/**\n * Build a user `Edge` from a `Connection` (or validate a passed `Edge`). A `Connection` becomes a NEW\n * edge with `defaultEdgeOptions` merged in — the only point where defaults are persisted onto an edge.\n * User-supplied `Edge`s pass through verbatim; stored edges are never parsed or re-stamped.\n */\nexport function addEdgeToStore<EdgeType extends Edge = Edge>(\n edgeParams: EdgeType | Connection,\n edges: EdgeType[],\n triggerError: State['hooks']['error']['trigger'],\n defaultEdgeOptions?: DefaultEdgeOptions,\n): EdgeType | false {\n if (!edgeParams || !edgeParams.source || !edgeParams.target) {\n triggerError(new VueFlowError(ErrorCode.EDGE_INVALID, (edgeParams as undefined | Edge)?.id ?? `[ID UNKNOWN]`));\n return false;\n }\n\n let edge: EdgeType;\n if (isEdge<EdgeType>(edgeParams)) {\n edge = edgeParams;\n }\n else {\n edge = {\n ...defaultEdgeOptions,\n ...edgeParams,\n id: getEdgeId(edgeParams),\n } as EdgeType;\n }\n\n if (connectionExists(edge, edges)) {\n return false;\n }\n\n return edge;\n}\n\nexport function reconnectEdgeAction(\n edge: Edge,\n newConnection: Connection,\n prevEdge: Edge | undefined,\n shouldReplaceId: boolean,\n triggerError: State['hooks']['error']['trigger'],\n) {\n if (!newConnection.source || !newConnection.target) {\n triggerError(new VueFlowError(ErrorCode.EDGE_INVALID, edge.id));\n return false;\n }\n\n if (!prevEdge) {\n triggerError(new VueFlowError(ErrorCode.EDGE_NOT_FOUND, edge.id));\n return false;\n }\n\n const { id, ...rest } = edge;\n\n return {\n ...rest,\n id: shouldReplaceId ? getEdgeId(newConnection) : id,\n source: newConnection.source,\n target: newConnection.target,\n sourceHandle: newConnection.sourceHandle,\n targetHandle: newConnection.targetHandle,\n };\n}\n\nexport interface CreateInternalNodesOptions {\n nodeOrigin?: NodeOrigin;\n nodeExtent?: CoordinateExtent;\n elevateNodesOnSelect?: boolean;\n zIndexMode?: ZIndexMode;\n}\n\n/**\n * Adopt user `Node`s into the store's lookups, xyflow/react+svelte style: validate, then run\n * `@xyflow/system`'s `adoptUserNodes` DIRECTLY against the PERSISTENT `nodeLookup`/`parentLookup`\n * (mutated in place — cleared + repopulated) to build the enriched `InternalNode`s with parent-aware\n * `internals.{positionAbsolute, z, rootParentIndex, handleBounds, userNode}`.\n *\n * There is no second `parseNode` pass and no vue-flow-specific default-stamping (parity with RF/SF, which\n * apply no node defaults — undefined fields stay undefined; consumers tolerate them). `checkEquality`\n * reuses the existing `InternalNode` by reference whenever the user node is unchanged, so re-adopting on\n * every change is O(changed) and `measured`/`handleBounds` survive for unchanged nodes for free.\n *\n * Returns the validated user nodes (to be stored as the canonical `state.nodes` array) plus\n * `hasSelectedNodes` (whether any adopted node is `selected`, surfaced by `adoptUserNodes` for free — the\n * caller uses it to clear a stale `nodesSelectionActive`). The InternalNodes live only in `nodeLookup`;\n * `internals.userNode` references the exact user object stored in the array.\n */\nexport function adoptNodes<NodeType extends Node = Node>(\n nodes: NodeType[],\n nodeLookup: SystemNodeLookup<InternalNode<NodeType>>,\n parentLookup: SystemParentLookup<InternalNode<NodeType>>,\n triggerError: State['hooks']['error']['trigger'],\n options?: CreateInternalNodesOptions,\n): { nodes: NodeType[]; hasSelectedNodes: boolean } {\n const validNodes: NodeType[] = [];\n for (let i = 0; i < nodes.length; ++i) {\n const node = nodes[i];\n\n if (!isNode(node)) {\n triggerError(\n new VueFlowError(ErrorCode.NODE_INVALID, (node as undefined | Record<any, any>)?.id ?? `[ID UNKNOWN|INDEX ${i}]`),\n );\n continue;\n }\n\n // `markRaw` the user node so Vue never deep-proxies it (the perf goal — large `data` objects stay\n // raw). `toRaw` first in case it arrived as a reactive proxy; this is the choke point through which\n // every node enters `state.nodes`/`nodeLookup`. Reactivity for the UI comes from re-adopting (the\n // lookup `.set` + the per-node render computed), not from deep-proxying. Idempotent across re-adopts,\n // so `checkEquality` (reference identity) keeps matching for unchanged nodes.\n validNodes.push(markRaw(toRaw(node)));\n }\n\n // vue-flow's node-rep split keeps `measured` AND `handleBounds` off the user `Node`s — they live only on\n // the `InternalNode`. The system's `adoptUserNodes` sources both from the user node (`parseHandles` even\n // resets `handleBounds` to `undefined` when the node carries no `measured`), so re-committing fresh user\n // objects (a one-way `:nodes` reassignment, a layout pass, `nodes.value.map(...)`) resets:\n // - `measured` → `undefined`: the node fails `nodeHasDimensions`, renders `visibility:hidden`, and — since\n // its DOM size didn't change — the ResizeObserver never re-fires to restore it.\n // - `handleBounds` → `undefined`: edges fall back to the node's default handle positions, ignoring its\n // `sourcePosition`/`targetPosition` (e.g. a dagre layout's edges no longer meet the handles).\n // Snapshot both before adoption clears the lookup and carry them forward below. A genuine re-measure\n // (`updateNodeDimensions`, e.g. NodeWrapper's `sourcePosition` watcher) still overwrites them, and that\n // fresh result is in turn preserved by the next re-commit.\n const priorInternals = new Map<\n string,\n { measured?: { width?: number; height?: number }; handleBounds: NodeHandleBounds | undefined }\n >();\n for (const [id, internal] of nodeLookup) {\n const { width, height } = internal.measured ?? {};\n priorInternals.set(id, {\n measured: width !== undefined && height !== undefined ? { width, height } : undefined,\n handleBounds: internal.internals.handleBounds,\n });\n }\n\n const { hasSelectedNodes } = adoptUserNodes(validNodes, nodeLookup, parentLookup, { ...options, checkEquality: true });\n\n for (const node of validNodes) {\n if (node.parentId && !nodeLookup.has(node.parentId)) {\n triggerError(new VueFlowError(ErrorCode.NODE_MISSING_PARENT, node.id, node.parentId));\n }\n\n // re-adoption only kept `measured`/`handleBounds` if the user object carried them; restore the prior\n // values for re-committed nodes that didn't, so a content-agnostic update (class/position/layout) keeps\n // the node visible and its edges anchored to the right handles (see the snapshot above)\n const prior = priorInternals.get(node.id);\n if (prior) {\n const internal = nodeLookup.get(node.id);\n if (internal) {\n if (prior.measured && (internal.measured?.width === undefined || internal.measured?.height === undefined)) {\n internal.measured = prior.measured;\n }\n if (prior.handleBounds && !internal.internals.handleBounds) {\n internal.internals.handleBounds = prior.handleBounds;\n }\n }\n }\n }\n\n return { nodes: validNodes, hasSelectedNodes };\n}\n\n/**\n * this function adds the connection to the connectionLookup\n * at the following keys: nodeId-type-handleId, nodeId-type and nodeId\n * @param type type of the connection\n * @param connection connection that should be added to the lookup\n * @param connectionKey at which key the connection should be added\n * @param connectionLookup reference to the connection lookup\n * @param nodeId nodeId of the connection\n * @param handleId handleId of the conneciton\n */\nfunction addConnectionToLookup(\n type: 'source' | 'target',\n connection: NodeConnection,\n connectionKey: string,\n connectionLookup: ConnectionLookup,\n nodeId: string,\n handleId: string | null,\n) {\n // We add the connection to the connectionLookup at the following keys\n // 1. nodeId, 2. nodeId-type, 3. nodeId-type-handleId\n // If the key already exists, we add the connection to the existing map\n let key = nodeId;\n const nodeMap = connectionLookup.get(key) || new Map();\n connectionLookup.set(key, nodeMap.set(connectionKey, connection));\n\n key = `${nodeId}-${type}`;\n const typeMap = connectionLookup.get(key) || new Map();\n connectionLookup.set(key, typeMap.set(connectionKey, connection));\n\n if (handleId) {\n key = `${nodeId}-${type}-${handleId}`;\n const handleMap = connectionLookup.get(key) || new Map();\n connectionLookup.set(key, handleMap.set(connectionKey, connection));\n }\n}\n\nexport function updateConnectionLookup(connectionLookup: ConnectionLookup, edges: Edge[]) {\n connectionLookup.clear();\n\n for (const edge of edges) {\n const { source: sourceNode, target: targetNode, sourceHandle = null, targetHandle = null } = edge;\n\n const connection = { edgeId: edge.id, source: sourceNode, target: targetNode, sourceHandle, targetHandle };\n const sourceKey = `${sourceNode}-${sourceHandle}--${targetNode}-${targetHandle}`;\n const targetKey = `${targetNode}-${targetHandle}--${sourceNode}-${sourceHandle}`;\n\n addConnectionToLookup('source', connection, targetKey, connectionLookup, sourceNode, sourceHandle);\n addConnectionToLookup('target', connection, sourceKey, connectionLookup, targetNode, targetHandle);\n }\n}\n\n/**\n * Validate edges-or-connections for the store, xyflow-style: the returned edges are the USER's objects\n * (a `Connection` becomes a new edge via {@link addEdgeToStore}, the only path that persists\n * `defaultEdgeOptions`) — no enrichment, no captured node references, no default-stamping. Source/target\n * node resolution and `EdgePosition` happen per-render in `EdgeWrapper`.\n *\n * @internal\n */\nexport function validateEdges<EdgeType extends Edge = Edge>(\n nextEdges: (EdgeType | Connection)[],\n isValidConnection: ValidConnectionFunc | null,\n getInternalNode: Actions['getInternalNode'],\n onError: VueFlowInstance['emits']['error'],\n defaultEdgeOptions: DefaultEdgeOptions | undefined,\n nodes: Node[],\n edges: EdgeType[],\n): EdgeType[] {\n const validEdges: EdgeType[] = [];\n\n for (const edgeOrConnection of nextEdges) {\n const edge = isEdge<EdgeType>(edgeOrConnection)\n ? edgeOrConnection\n : addEdgeToStore(edgeOrConnection, edges, onError, defaultEdgeOptions);\n\n if (!edge) {\n continue;\n }\n\n const sourceNode = getInternalNode(edge.source);\n const targetNode = getInternalNode(edge.target);\n\n if (!sourceNode && !targetNode) {\n onError(new VueFlowError(ErrorCode.EDGE_SOURCE_TARGET_MISSING, edge.id, edge.source, edge.target));\n continue;\n }\n\n if (!sourceNode) {\n onError(new VueFlowError(ErrorCode.EDGE_SOURCE_MISSING, edge.id, edge.source));\n continue;\n }\n\n if (!targetNode) {\n onError(new VueFlowError(ErrorCode.EDGE_TARGET_MISSING, edge.id, edge.target));\n continue;\n }\n\n if (isValidConnection) {\n const isValid = isValidConnection(\n {\n source: edge.source,\n target: edge.target,\n sourceHandle: edge.sourceHandle ?? null,\n targetHandle: edge.targetHandle ?? null,\n },\n {\n edges,\n nodes,\n sourceNode,\n targetNode,\n },\n );\n\n if (!isValid) {\n onError(new VueFlowError(ErrorCode.EDGE_INVALID, edge.id));\n continue;\n }\n }\n\n validEdges.push(edge);\n }\n\n return validEdges;\n}\n","import type { Edge, Node } from '../types';\nimport { computed, inject, shallowRef } from 'vue';\nimport { EdgeId, EdgeRef } from '../context';\nimport { ErrorCode, VueFlowError } from '../utils';\nimport { useVueFlow } from './useVueFlow';\n\n/**\n * Composable that provides access to an edge object and it's dom element\n *\n * If no edge id is provided, the edge id is injected from context\n *\n * If you do not provide an id, this composable has to be called in a child of your custom edge component, or it will throw\n *\n * @public\n * @param id - The id of the edge to access\n * @returns the edge id, the edge (a `ComputedRef`) and the edge dom element\n */\nexport function useEdge<EdgeType extends Edge = Edge>(id?: string) {\n const edgeId = id ?? inject(EdgeId, '');\n const edgeEl = inject(EdgeRef, shallowRef(null));\n\n const { getEdge, emits } = useVueFlow<Node, EdgeType>();\n\n // a `computed` (not a one-time read) so it re-resolves whenever the store replaces this edge's lookup\n // entry — required for the immutable model where a changed edge is a NEW object (mirrors `useNode`)\n const edge = computed(() => getEdge(edgeId));\n\n if (!edge.value) {\n emits.error(new VueFlowError(ErrorCode.EDGE_NOT_FOUND, edgeId));\n }\n\n return {\n id: edgeId,\n edge,\n edgeEl,\n };\n}\n","import type { Edge, Node, VueFlowState } from '../types';\nimport { inject } from 'vue';\nimport { VueFlowStateKey } from '../context';\nimport { ErrorCode, VueFlowError } from '../utils/errors';\n\n/**\n * Access the raw reactive state of the surrounding flow — every {@link VueFlowState} field plus the\n * lookups, read directly (`store.nodes`, `store.transform`, `store.nodeLookup`, …; no `.value`, like\n * `xyflow/svelte`'s store). Mirrors `useStore` in `xyflow/react`+`svelte`.\n *\n * Reading a field inside a `computed`/`watch`/template tracks it reactively; reading it in a plain\n * callback is just a current-value read. To destructure scalar/array fields as refs, wrap the result in\n * `storeToRefs`; reference-type lookups (`nodeLookup`, …) can be destructured directly.\n *\n * For actions, getters, and event hooks use {@link useVueFlow} instead. Throws if called outside a\n * provider (or outside a component `setup`).\n *\n * @public\n * @returns the reactive state for the current context\n */\nexport function useStore<NodeType extends Node = Node, EdgeType extends Edge = Edge>(): VueFlowState<NodeType, EdgeType> {\n const state = inject(VueFlowStateKey, null) as VueFlowState<NodeType, EdgeType> | null;\n\n if (!state) {\n throw new VueFlowError(ErrorCode.USE_VUE_FLOW_OUTSIDE_PROVIDER);\n }\n\n return state;\n}\n","import type { Connection, ConnectionState, FinalConnectionState, HandleType, IsValidConnection as SystemIsValidConnection } from '@xyflow/system';\nimport type { MaybeRefOrGetter } from 'vue';\nimport type { ConnectingHandle, InternalNode, MouseTouchEvent, ValidConnectionFunc } from '../types';\nimport { getEventPosition, getHostForElement, Position, XYHandle } from '@xyflow/system';\nimport { toValue } from 'vue';\nimport { isValidHandle } from '../utils';\nimport { useStore } from './useStore';\nimport { useVueFlow } from './useVueFlow';\n\nexport interface UseHandleProps {\n handleId: MaybeRefOrGetter<string | null>;\n nodeId: MaybeRefOrGetter<string>;\n type: MaybeRefOrGetter<HandleType>;\n isValidConnection?: MaybeRefOrGetter<ValidConnectionFunc | null>;\n reconnectHandleType?: MaybeRefOrGetter<HandleType>;\n onReconnectStart?: (event: MouseTouchEvent) => void;\n onReconnect?: (event: MouseTouchEvent, connection: Connection) => void;\n onReconnectEnd?: (event: MouseTouchEvent, connectionState: FinalConnectionState<InternalNode>) => void;\n}\n\nfunction alwaysValid() {\n return true;\n}\n\n/**\n * Connection-drag composable. Drag-to-connect is delegated to `@xyflow/system`'s `XYHandle` instance\n * (same pattern as `XYDrag` / `XYResizer`). Click-to-connect stays vue-flow specific because the click\n * path interacts with the richer `ValidConnectionFunc` signature (which receives full source/target\n * `InternalNode`s on top of the bare `Connection`).\n *\n * Generally it's recommended to use the `<Handle />` component instead of this composable.\n *\n * @public\n */\nexport function useHandle({\n handleId,\n nodeId,\n type,\n isValidConnection,\n reconnectHandleType,\n onReconnectStart,\n onReconnect,\n onReconnectEnd,\n}: UseHandleProps) {\n const { id: flowId, getNode, getInternalNode, panBy, startConnection, updateConnection, endConnection, emits } = useVueFlow();\n\n // Read the reactive store directly — every store value below is read inside an event handler or a lazy\n // callback (getTransform/getFromHandle/getStoreItems), so `store.x` yields the current value with the\n // same reactivity; no per-handle ref projection needed.\n const store = useStore();\n\n const { nodeLookup } = store;\n\n /**\n * Adapt our richer `ValidConnectionFunc` (which receives `{ nodes, edges, sourceNode, targetNode }`)\n * into system's bare `IsValidConnection` (which only receives the `Connection`/`EdgeBase`). Resolves\n * source/target nodes from `nodeLookup` before delegating to the user's callback.\n */\n function buildSystemIsValidConnection(): SystemIsValidConnection | undefined {\n const userFn = toValue(isValidConnection) || store.isValidConnection;\n if (!userFn) {\n return undefined;\n }\n return (edge) => {\n const sourceNode = getInternalNode(edge.source);\n const targetNode = getInternalNode(edge.target);\n if (!sourceNode || !targetNode) {\n return false;\n }\n return userFn(\n {\n source: edge.source,\n target: edge.target,\n sourceHandle: edge.sourceHandle ?? null,\n targetHandle: edge.targetHandle ?? null,\n },\n { nodes: store.nodes, edges: store.edges, sourceNode, targetNode },\n );\n };\n }\n\n function handlePointerDown(event: MouseTouchEvent) {\n const handleDomNode = event.currentTarget as Element | null;\n if (!handleDomNode || !store.vueFlowRef) {\n return;\n }\n\n XYHandle.onPointerDown(event, {\n autoPanOnConnect: store.autoPanOnConnect,\n connectionMode: store.connectionMode,\n connectionRadius: store.connectionRadius,\n domNode: store.vueFlowRef as HTMLDivElement,\n handleId: toValue(handleId),\n nodeId: toValue(nodeId),\n isTarget: toValue(type) === 'target',\n nodeLookup,\n lib: 'vue',\n flowId,\n // system's own param name stays `edgeUpdaterType`; our prop is `reconnectHandleType`\n edgeUpdaterType: toValue(reconnectHandleType),\n autoPanSpeed: store.autoPanSpeed,\n dragThreshold: store.connectionDragThreshold,\n handleDomNode,\n panBy,\n isValidConnection: buildSystemIsValidConnection(),\n getTransform: () => store.transform,\n // system aborts the move loop if this returns null, so once `startConnection` has populated the\n // store's `connectionStartHandle`, surface it as a system-shaped `Handle`. Width/height aren't\n // tracked on `ConnectingHandle` — fall back to 0; system only reads them for rendering.\n getFromHandle: () => {\n const h = store.connectionStartHandle;\n if (!h) {\n return null;\n }\n return {\n id: h.id,\n nodeId: h.nodeId,\n type: h.type,\n position: h.position,\n x: h.x,\n y: h.y,\n width: 0,\n height: 0,\n };\n },\n updateConnection: (state: ConnectionState) => {\n if (state.inProgress) {\n // first move emits the in-progress state — mirror it to our split-field store so consumers\n // like `useConnection` and `Pane.vue`'s `connectionInProgress` keep working.\n if (!store.connectionStartHandle) {\n startConnection({\n nodeId: state.fromHandle.nodeId,\n id: state.fromHandle.id ?? null,\n type: state.fromHandle.type,\n position: state.fromHandle.position,\n x: state.to.x,\n y: state.to.y,\n });\n }\n // `connectionPosition` tracks the raw pointer (not the snapped `to`): `useConnection` derives the\n // snapped end from `connectionEndHandle`, and the connection line snaps via the same handle, so\n // storing the raw pointer here surfaces it as `pointer` (xyflow/react #5594/#5578).\n updateConnection(\n state.pointer,\n state.toHandle\n ? ({\n nodeId: state.toHandle.nodeId,\n id: state.toHandle.id ?? null,\n type: state.toHandle.type,\n position: state.toHandle.position,\n x: state.toHandle.x,\n y: state.toHandle.y,\n } as ConnectingHandle)\n : null,\n state.isValid !== null ? (state.isValid ? 'valid' : 'invalid') : null,\n );\n }\n },\n cancelConnection: () => {\n endConnection(event, false);\n },\n onConnectStart: (evt, params) => {\n emits.connectStart({\n event: evt as MouseTouchEvent,\n nodeId: params.nodeId ?? undefined,\n handleId: params.handleId,\n handleType: params.handleType ?? undefined,\n });\n // For a reconnect this fires only once the drag actually begins (after `connectionDragThreshold`,\n // or immediately when it's 0) — the cue to hide the original edge. Hiding it eagerly on pointerdown\n // would strand a plain click (no drag) with a permanently hidden edge, because the system fires\n // onConnectEnd/onReconnectEnd only after the drag has started.\n if (reconnectHandleType) {\n onReconnectStart?.(evt as MouseTouchEvent);\n }\n },\n onConnect: (connection) => {\n if (onReconnect) {\n onReconnect(event, connection);\n }\n else {\n emits.connect(connection);\n }\n },\n onConnectEnd: (evt, connectionState) => {\n emits.connectEnd({ event: evt as MouseTouchEvent, connectionState });\n if (reconnectHandleType) {\n onReconnectEnd?.(evt as MouseTouchEvent, connectionState);\n }\n },\n });\n }\n\n function handleClick(event: MouseEvent) {\n if (!store.connectOnClick) {\n return;\n }\n\n if (!store.connectionClickStartHandle) {\n emits.clickConnectStart({\n event,\n nodeId: toValue(nodeId),\n handleId: toValue(handleId),\n });\n\n startConnection(\n {\n nodeId: toValue(nodeId),\n type: toValue(type),\n id: toValue(handleId),\n position: Position.Top,\n ...getEventPosition(event),\n },\n undefined,\n true,\n );\n\n return;\n }\n\n const isValidConnectionHandler = toValue(isValidConnection) || store.isValidConnection || alwaysValid;\n\n const node = getNode(toValue(nodeId));\n\n if (node && (typeof node.connectable === 'undefined' ? store.nodesConnectable : node.connectable) === false) {\n return;\n }\n\n const doc = getHostForElement(event.target as HTMLElement);\n\n const result = isValidHandle(\n event,\n {\n handle: {\n nodeId: toValue(nodeId),\n id: toValue(handleId),\n type: toValue(type),\n position: Position.Top,\n ...getEventPosition(event),\n },\n connectionMode: store.connectionMode,\n fromNodeId: store.connectionClickStartHandle.nodeId,\n fromHandleId: store.connectionClickStartHandle.id ?? null,\n fromType: store.connectionClickStartHandle.type,\n isValidConnection: isValidConnectionHandler,\n doc,\n lib: 'vue',\n flowId,\n },\n store.edges,\n store.nodes,\n getInternalNode,\n nodeLookup,\n );\n\n const isOwnHandle = result.connection?.source === result.connection?.target;\n\n if (result.isValid && result.connection && !isOwnHandle) {\n emits.connect(result.connection);\n }\n\n // the click path doesn't drive the system's connection state machine, so assemble the\n // `FinalConnectionState` ourselves from the click-start handle + the resolved end handle, so\n // `clickConnectEnd` carries the same payload shape as `connectEnd` (handles → system `Handle`s by\n // padding the missing width/height, as `getFromHandle` does above).\n const fromHandle = store.connectionClickStartHandle;\n const fromNode = fromHandle ? getInternalNode(fromHandle.nodeId) : undefined;\n const toHandle = result.toHandle;\n const pointer = getEventPosition(event);\n const connectionState: FinalConnectionState<InternalNode>\n = fromHandle && fromNode\n ? {\n isValid: result.isValid,\n from: { x: fromHandle.x, y: fromHandle.y },\n fromHandle: { ...fromHandle, width: 0, height: 0 },\n fromPosition: fromHandle.position,\n fromNode,\n to: toHandle ? { x: toHandle.x, y: toHandle.y } : pointer,\n toHandle: toHandle ? { ...toHandle, width: 0, height: 0 } : null,\n toPosition: toHandle?.position ?? null,\n toNode: toHandle ? (getInternalNode(toHandle.nodeId) ?? null) : null,\n pointer,\n }\n : {\n isValid: null,\n from: null,\n fromHandle: null,\n fromPosition: null,\n fromNode: null,\n to: null,\n toHandle: null,\n toPosition: null,\n toNode: null,\n pointer: null,\n };\n\n emits.clickConnectEnd({ event, connectionState });\n\n endConnection(event, true);\n }\n\n return {\n handlePointerDown,\n handleClick,\n };\n}\n","import { inject } from 'vue';\nimport { NodeId } from '../context';\n\n/**\n * This composable returns the current node id from the ctx.\n *\n * It should be used inside a (custom-)node components ctx as the id is provided by the internal `NodeWrapper` component.\n *\n * @public\n * @returns the current node id\n */\nexport function useNodeId() {\n return inject(NodeId, '');\n}\n","import type { MaybeRefOrGetter } from 'vue';\nimport type { InternalNode, Node } from '../types';\nimport { computed, toValue } from 'vue';\nimport { useNodeId } from './useNodeId';\nimport { useVueFlow } from './useVueFlow';\n\n/**\n * Access the enriched {@link InternalNode} (store-computed `internals.{positionAbsolute, z, handleBounds}` +\n * authoritative `measured`) for an id, as a `computed` that re-resolves whenever the store re-adopts the node.\n *\n * Mirrors xyflow/react's `useInternalNode`. If no id is given it is read from node context (call inside a\n * custom node). Use {@link useNode} for the user-facing node + dom element + connected edges.\n *\n * The id accepts a ref/getter so it can track a reactive source — e.g. a custom edge resolving its\n * endpoint with `useInternalNode(() => props.source)` stays correct after a reconnect changes the source.\n *\n * @public\n * @param id - The id of the node to access (a value, ref, or getter; defaults to the node context id)\n */\nexport function useInternalNode<NodeType extends Node = Node>(id?: MaybeRefOrGetter<string | undefined>) {\n const contextNodeId = useNodeId();\n\n const { getInternalNode } = useVueFlow();\n\n return computed(() => getInternalNode(toValue(id) ?? contextNodeId ?? '') as InternalNode<NodeType> | undefined);\n}\n","import type { KeyFilter, KeyPredicate } from '@vueuse/core';\nimport type { MaybeRefOrGetter } from 'vue';\nimport { onKeyStroke, useEventListener } from '@vueuse/core';\nimport { computed, shallowRef, toValue, watch } from 'vue';\n\ntype PressedKeys = Set<string>;\ntype KeyOrCode = 'key' | 'code';\n\nexport interface UseKeyPressOptions {\n target?: MaybeRefOrGetter<EventTarget | null | undefined>;\n actInsideInputWithModifier?: MaybeRefOrGetter<boolean>;\n preventDefault?: MaybeRefOrGetter<boolean>;\n}\n\nconst inputTags = ['INPUT', 'SELECT', 'TEXTAREA'];\n\nconst defaultDoc = typeof document !== 'undefined' ? document : null;\n\nexport function isInputDOMNode(event: KeyboardEvent): boolean {\n const target = (event.composedPath?.()?.[0] || event.target) as HTMLElement;\n\n const hasAttribute = typeof target?.hasAttribute === 'function' ? target.hasAttribute('contenteditable') : false;\n\n const closest = typeof target?.closest === 'function' ? target.closest('.nokey') : null;\n\n // when an input field is focused we don't want to trigger deletion or movement of nodes\n return inputTags.includes(target?.nodeName) || hasAttribute || !!closest;\n}\n\n// we want to be able to do a multi selection event if we are in an input field\nfunction wasModifierPressed(event: KeyboardEvent) {\n return event.ctrlKey || event.metaKey || event.shiftKey || event.altKey;\n}\n\nfunction isKeyMatch(pressedKey: string, keyToMatch: string, pressedKeys: Set<string>, isKeyUp: boolean) {\n const keyCombination = keyToMatch\n .replace('+', '\\n')\n .replace('\\n\\n', '\\n+')\n .split('\\n')\n .map(k => k.trim().toLowerCase());\n\n if (keyCombination.length === 1) {\n return pressedKey.toLowerCase() === keyToMatch.toLowerCase();\n }\n\n // we need to remove the key *after* checking for a match otherwise a combination like 'shift+a' would never get unmatched/reset\n if (!isKeyUp) {\n pressedKeys.add(pressedKey.toLowerCase());\n }\n\n const isMatch = keyCombination.every(\n (key, index) => pressedKeys.has(key) && Array.from(pressedKeys.values())[index] === keyCombination[index],\n );\n\n if (isKeyUp) {\n pressedKeys.delete(pressedKey.toLowerCase());\n }\n\n return isMatch;\n}\n\nfunction createKeyPredicate(keyFilter: string | string[], pressedKeys: PressedKeys): KeyPredicate {\n return (event: KeyboardEvent) => {\n if (!event.code && !event.key) {\n return false;\n }\n\n const keyOrCode = useKeyOrCode(event.code, keyFilter);\n\n // if the keyFilter is an array of multiple keys, we need to check each possible key combination\n if (Array.isArray(keyFilter)) {\n return keyFilter.some(key => isKeyMatch(event[keyOrCode], key, pressedKeys, event.type === 'keyup'));\n }\n\n // if the keyFilter is a string, we need to check if the key matches the string\n return isKeyMatch(event[keyOrCode], keyFilter, pressedKeys, event.type === 'keyup');\n };\n}\n\nfunction useKeyOrCode(code: string, keysToWatch: string | string[]): KeyOrCode {\n return keysToWatch.includes(code) ? 'code' : 'key';\n}\n\n/**\n * Composable that returns a boolean value if a key is pressed\n *\n * @public\n * @param keyFilter - Can be a boolean, a string, an array of strings or a function that returns a boolean. If it's a boolean, it will act as if the key is always pressed. If it's a string, it will return true if a key matching that string is pressed. If it's an array of strings, it will return true if any of the strings match a key being pressed, or a combination (e.g. ['ctrl+a', 'ctrl+b'])\n * @param options - Options object\n */\nexport function useKeyPress(keyFilter: MaybeRefOrGetter<KeyFilter | boolean | null>, options?: UseKeyPressOptions) {\n const target = computed(() => toValue(options?.target) ?? defaultDoc);\n\n const isPressed = shallowRef(toValue(keyFilter) === true);\n\n let modifierPressed = false;\n\n const pressedKeys = new Set<string>();\n\n let currentFilter = createKeyFilterFn(toValue(keyFilter));\n\n watch(\n () => toValue(keyFilter),\n (nextKeyFilter, previousKeyFilter) => {\n // if the previous keyFilter was a boolean but is now something else, we need to reset the isPressed value\n if (typeof previousKeyFilter === 'boolean' && typeof nextKeyFilter !== 'boolean') {\n reset();\n }\n\n currentFilter = createKeyFilterFn(nextKeyFilter);\n },\n {\n immediate: true,\n },\n );\n\n useEventListener(['blur', 'contextmenu'], reset);\n\n onKeyStroke(\n (...args) => currentFilter(...args),\n (e) => {\n const actInsideInputWithModifier = toValue(options?.actInsideInputWithModifier) ?? true;\n const preventDefault = toValue(options?.preventDefault) ?? false;\n\n modifierPressed = wasModifierPressed(e);\n\n const preventAction = (!modifierPressed || (modifierPressed && !actInsideInputWithModifier)) && isInputDOMNode(e);\n\n if (preventAction) {\n return;\n }\n\n const target = (e.composedPath?.()?.[0] || e.target) as Element | null;\n const isInteractiveElement = target?.nodeName === 'BUTTON' || target?.nodeName === 'A';\n\n if (!preventDefault && (modifierPressed || !isInteractiveElement)) {\n e.preventDefault();\n }\n\n isPressed.value = true;\n },\n { eventName: 'keydown', target },\n );\n\n onKeyStroke(\n (...args) => currentFilter(...args),\n (e) => {\n const actInsideInputWithModifier = toValue(options?.actInsideInputWithModifier) ?? true;\n\n if (isPressed.value) {\n const preventAction = (!modifierPressed || (modifierPressed && !actInsideInputWithModifier)) && isInputDOMNode(e);\n\n if (preventAction) {\n return;\n }\n\n modifierPressed = false;\n isPressed.value = false;\n }\n },\n { eventName: 'keyup', target },\n );\n\n function reset() {\n modifierPressed = false;\n\n pressedKeys.clear();\n\n isPressed.value = toValue(keyFilter) === true;\n }\n\n function createKeyFilterFn(keyFilter: KeyFilter | boolean | null) {\n // if the keyFilter is null, we just set the isPressed value to false\n if (keyFilter === null) {\n reset();\n return () => false;\n }\n\n // if the keyFilter is a boolean, we just set the isPressed value to that boolean\n if (typeof keyFilter === 'boolean') {\n reset();\n isPressed.value = keyFilter;\n\n return () => false;\n }\n\n if (Array.isArray(keyFilter) || typeof keyFilter === 'string') {\n return createKeyPredicate(keyFilter, pressedKeys);\n }\n\n return keyFilter;\n }\n\n return isPressed;\n}\n","import type { Node } from '../types';\nimport { getConnectedEdges } from '@xyflow/system';\nimport { computed, inject, shallowRef } from 'vue';\nimport { NodeRef } from '../context';\nimport { ErrorCode, VueFlowError } from '../utils';\nimport { useNodeId } from './useNodeId';\nimport { useStore } from './useStore';\nimport { useVueFlow } from './useVueFlow';\n\n/**\n * Composable that provides access to a node object, parent node object, connected edges and it's dom element\n *\n * If no node id is provided, the node id is injected from context\n *\n * If you do not provide an id, this composable has to be called in a child of your custom node component, or it will throw\n *\n * @public\n * @param id - The id of the node to access\n * @returns the node id, the node (a `ComputedRef`), the node dom element, it's parent and connected edges\n */\nexport function useNode<NodeType extends Node = Node>(id?: string) {\n const nodeId = id ?? useNodeId() ?? '';\n const nodeEl = inject(NodeRef, shallowRef(null));\n\n const { getInternalNode, emits } = useVueFlow<NodeType>();\n const store = useStore<NodeType>();\n\n // `node` is the enriched `InternalNode` (it carries `internals`/`measured`, which NodeWrapper + custom\n // nodes read) and a `computed` (not a one-time read) so it re-resolves whenever the store replaces this\n // node's lookup entry — required for the immutable re-adopt model where a changed node is a NEW object.\n const node = computed(() => getInternalNode(nodeId));\n\n if (!node.value) {\n emits.error(new VueFlowError(ErrorCode.NODE_NOT_FOUND, nodeId));\n }\n\n return {\n id: nodeId,\n nodeEl,\n node,\n parentNode: computed(() => (node.value ? getInternalNode(node.value.parentId) : undefined)),\n connectedEdges: computed(() => (node.value ? getConnectedEdges([node.value], store.edges) : [])),\n };\n}\n","import type { XYPosition } from '@xyflow/system';\nimport type { NodeDragItem } from '../types';\nimport { getNodeDimensions } from '@xyflow/system';\nimport { calcNextPosition } from '../utils';\nimport { useStore } from './useStore';\nimport { useVueFlow } from './useVueFlow';\n\n/**\n * Composable for updating the position of nodes.\n *\n * @internal\n */\nexport function useUpdateNodePositions() {\n const { getSelectedNodes, updateNodePositions, getInternalNode, emits } = useVueFlow();\n const store = useStore();\n\n return (positionDiff: XYPosition, isShiftPressed = false) => {\n // by default a node moves 5px on each key press, or 20px if shift is pressed\n // if snap grid is enabled, we use that for the velocity.\n const xVelo = store.snapToGrid ? store.snapGrid[0] : 5;\n const yVelo = store.snapToGrid ? store.snapGrid[1] : 5;\n const factor = isShiftPressed ? 4 : 1;\n\n const positionDiffX = positionDiff.x * xVelo * factor;\n const positionDiffY = positionDiff.y * yVelo * factor;\n\n const nodeUpdates: NodeDragItem[] = [];\n for (const node of getSelectedNodes.value) {\n if (node.draggable || (store.nodesDraggable && typeof node.draggable === 'undefined')) {\n // `getSelectedNodes` returns user `Node`s — resolve the enriched InternalNode for internals/measured\n const internalNode = getInternalNode(node.id);\n if (!internalNode) {\n continue;\n }\n\n const nextPosition = {\n x: internalNode.internals.positionAbsolute.x + positionDiffX,\n y: internalNode.internals.positionAbsolute.y + positionDiffY,\n };\n\n const { position } = calcNextPosition(\n internalNode,\n nextPosition,\n emits.error,\n store.nodeExtent,\n node.parentId ? getInternalNode(node.parentId) : undefined,\n );\n\n nodeUpdates.push({\n id: node.id,\n position,\n distance: { x: positionDiff.x, y: positionDiff.y },\n measured: getNodeDimensions(internalNode),\n internals: {\n positionAbsolute: { x: internalNode.internals.positionAbsolute.x, y: internalNode.internals.positionAbsolute.y },\n },\n });\n }\n }\n\n updateNodePositions(nodeUpdates, true, false);\n };\n}\n","import type { Project } from '@xyflow/system';\nimport type { Edge, Node, NodeLookup, State, ViewportFunctions } from '../types';\nimport { until } from '@vueuse/core';\nimport { fitViewport, getViewportForBounds, pointToRendererPoint, rendererPointToPoint } from '@xyflow/system';\nimport { computed } from 'vue';\nimport { areNodesInitialized, warn } from '../utils';\n\nexport interface ViewportHelper<NodeType extends Node = Node> extends ViewportFunctions<NodeType> {\n viewportInitialized: boolean;\n screenToFlowPosition: Project;\n flowToScreenPosition: Project;\n}\n\nconst DEFAULT_PADDING = 0.1;\n\nasync function noop() {\n warn('Viewport not initialized yet.');\n\n return false;\n}\n\nconst initialViewportHelper: ViewportHelper = {\n zoomIn: noop,\n zoomOut: noop,\n zoomTo: noop,\n fitView: noop,\n setCenter: noop,\n fitBounds: noop,\n screenToFlowPosition: position => position,\n flowToScreenPosition: position => position,\n setViewport: noop,\n getViewport: () => ({ x: 0, y: 0, zoom: 1 }),\n viewportInitialized: false,\n};\n\n/**\n * Composable that provides viewport helper functions.\n *\n * @internal\n * @param state\n */\nexport function useViewportHelper<NodeType extends Node = Node, EdgeType extends Edge = Edge>(\n state: State<NodeType, EdgeType>,\n nodeLookup: NodeLookup<NodeType>,\n) {\n // whether every (non-hidden) node has been measured — `fitView` waits on this so an imperative call right\n // after `addNodes` doesn't fit around stale (unmeasured) geometry (`getFitViewNodes` skips unmeasured nodes)\n const nodesInitialized = computed(() => areNodesInitialized(nodeLookup));\n\n return computed<ViewportHelper<NodeType>>(() => {\n const panZoom = state.panZoom;\n const isInitialized = state.panZoom && state.dimensions.width && state.dimensions.height;\n\n if (!isInitialized) {\n return initialViewportHelper;\n }\n\n return {\n viewportInitialized: true,\n // todo: allow passing scale as option\n zoomIn: async options => (panZoom ? panZoom.scaleBy(1.2, options) : false),\n zoomOut: async options => (panZoom ? panZoom.scaleBy(1 / 1.2, options) : false),\n zoomTo: async (zoomLevel, options) => (panZoom ? panZoom.scaleTo(zoomLevel, options) : false),\n setViewport: async (viewport, options) => {\n if (!panZoom) {\n return false;\n }\n\n await panZoom.setViewport(\n {\n x: viewport.x ?? state.transform[0],\n y: viewport.y ?? state.transform[1],\n zoom: viewport.zoom ?? state.transform[2],\n },\n options,\n );\n\n return true;\n },\n getViewport: () => ({\n x: state.transform[0],\n y: state.transform[1],\n zoom: state.transform[2],\n }),\n fitView: async (\n options = {\n padding: DEFAULT_PADDING,\n includeHiddenNodes: false,\n duration: 0,\n },\n ) => {\n if (!panZoom) {\n return false;\n }\n\n // queue the fit until every node is measured (xyflow/react's `fitViewQueued`): a fit requested\n // before the nodes settle — e.g. right after `addNodes` — would otherwise frame only the already\n // measured nodes (`getFitViewNodes` skips unmeasured ones) and ignore the new ones. An empty flow has\n // nothing to wait for, so don't queue (else the fit would never resolve).\n if (nodeLookup.size > 0 && !nodesInitialized.value) {\n await until(nodesInitialized).toBe(true);\n }\n\n return fitViewport(\n {\n nodes: nodeLookup,\n width: state.dimensions.width,\n height: state.dimensions.height,\n panZoom,\n minZoom: state.minZoom,\n maxZoom: state.maxZoom,\n },\n {\n padding: options.padding ?? DEFAULT_PADDING,\n duration: options.duration,\n ease: options.ease,\n interpolate: options.interpolate,\n minZoom: options.minZoom,\n maxZoom: options.maxZoom,\n // `fitViewport` forwards these to `getFitViewNodes` at runtime, but its options type `Omit`s\n // them — pass via spread to satisfy TS.\n ...(options.includeHiddenNodes ? { includeHiddenNodes: true } : {}),\n ...(options.nodes?.length ? { nodes: options.nodes } : {}),\n },\n );\n },\n setCenter: async (x, y, options) => {\n if (!panZoom) {\n return false;\n }\n\n const nextZoom = typeof options?.zoom !== 'undefined' ? options.zoom : state.maxZoom;\n const centerX = state.dimensions.width / 2 - x * nextZoom;\n const centerY = state.dimensions.height / 2 - y * nextZoom;\n\n await panZoom.setViewport({ x: centerX, y: centerY, zoom: nextZoom }, options);\n\n return true;\n },\n fitBounds: async (bounds, options = { padding: DEFAULT_PADDING }) => {\n if (!panZoom) {\n return false;\n }\n\n const { x, y, zoom } = getViewportForBounds(\n bounds,\n state.dimensions.width,\n state.dimensions.height,\n state.minZoom,\n state.maxZoom,\n options.padding ?? DEFAULT_PADDING,\n );\n\n await panZoom.setViewport({ x, y, zoom }, options);\n\n return true;\n },\n screenToFlowPosition: (position) => {\n if (state.vueFlowRef) {\n const { x: domX, y: domY } = state.vueFlowRef.getBoundingClientRect();\n\n const correctedPosition = {\n x: position.x - domX,\n y: position.y - domY,\n };\n\n return pointToRendererPoint(correctedPosition, state.transform, state.snapToGrid, state.snapGrid);\n }\n\n return { x: 0, y: 0 };\n },\n flowToScreenPosition: (position) => {\n if (state.vueFlowRef) {\n const { x: domX, y: domY } = state.vueFlowRef.getBoundingClientRect();\n\n const correctedPosition = {\n x: position.x + domX,\n y: position.y + domY,\n };\n\n return rendererPointToPoint(correctedPosition, state.transform);\n }\n\n return { x: 0, y: 0 };\n },\n };\n });\n}\n","import type { Connection } from '@xyflow/system';\nimport type { Ref, ToRefs } from 'vue';\nimport type { Edge, FlowProps, Node, VueFlowStoreHandle } from '../types';\nimport { mergeAriaLabelConfig } from '@xyflow/system';\nimport { effectScope, isRef, toRaw, toRef, watch } from 'vue';\nimport { isDef } from '../utils';\nimport { storeToRefs } from './storeToRefs';\n\n/**\n * Two-way bind a `v-model` array ref to the store, identity-in / snapshot-out, with native `watch`.\n *\n * Used only when `<VueFlow>` does NOT own its store (it reuses a `<VueFlowProvider>`'s), so the model\n * refs can't back the store directly. The owned-store path is single-source instead — the model refs\n * ARE the store's nodes/edges (see `createStore`'s `StoreSignals` binding), needing no sync here.\n *\n * - **out** (store → model): snapshot on every membership change; element refs are shared, so per-node\n * field mutations surface without a copy.\n * - **in** (model → store): adopt externally-assigned arrays via `setItems`, ignoring our own snapshot\n * (identity check against `lastSnapshot`) — replacing the previous `@vueuse` `watchPausable` flag dance.\n */\nfunction syncModelArray<ModelItem, StoreItem>(\n model: Ref<ModelItem[] | undefined> | undefined,\n storeItems: Ref<StoreItem[]>,\n setItems: (items: ModelItem[]) => void,\n) {\n if (!model) {\n return;\n }\n\n // the array we last pushed store → model; the `in` watcher skips it so the snapshot doesn't loop back\n let lastSnapshot: ModelItem[] | undefined;\n\n watch(\n [storeItems, () => storeItems.value.length],\n () => {\n lastSnapshot = [...storeItems.value] as unknown as ModelItem[];\n model.value = lastSnapshot;\n },\n // seed the model only if the store already holds elements (populated by `setState(props)` on create)\n { immediate: storeItems.value.length > 0 },\n );\n\n watch(\n [model, () => model.value?.length],\n ([next]) => {\n if (!Array.isArray(next)) {\n return;\n }\n\n // compare raw identities: a deep model `ref` hands our own snapshot back as its reactive proxy,\n // which would fail a plain `===` and loop snapshot → setItems → snapshot forever\n const nextRaw = toRaw(next);\n if (nextRaw === lastSnapshot) {\n return;\n }\n\n setItems(nextRaw);\n },\n { immediate: true },\n );\n}\n\n/**\n * Watches props and updates the store accordingly\n *\n * @internal\n * @param models v-model refs for nodes/edges (bound only when `ownsStore` is false — see {@link syncModelArray})\n * @param props the `<VueFlow>` props\n * @param handle the created store handle ({@link VueFlowStoreHandle}) — instance (actions) + reactive state\n * @param ownsStore whether this `<VueFlow>` created the store (then nodes/edges are signal-backed and skipped here)\n */\nexport function useWatchProps<NodeType extends Node = Node, EdgeType extends Edge = Edge>(\n models: ToRefs<Pick<FlowProps<NodeType, EdgeType>, 'nodes' | 'edges'>>,\n props: FlowProps<NodeType, EdgeType>,\n handle: VueFlowStoreHandle<NodeType, EdgeType>,\n ownsStore = false,\n) {\n const { instance, state } = handle;\n // refs over the reactive state (writable) so the prop→store sync below can assign as before\n const storeRefs = storeToRefs(state);\n\n const scope = effectScope(true);\n\n scope.run(() => {\n // Only when this `<VueFlow>` reuses a provider's store (it didn't create it, so the model refs can't\n // back it). Owned stores are single-source — the models ARE the store's nodes/edges — so these are skipped.\n const watchNodesValue = () => {\n scope.run(() => {\n syncModelArray(models.nodes, storeRefs.nodes, nodes => instance.setNodes(nodes));\n });\n };\n\n const watchEdgesValue = () => {\n scope.run(() => {\n syncModelArray(models.edges, storeRefs.edges, edges => instance.setEdges(edges));\n });\n };\n\n const watchMaxZoom = () => {\n scope.run(() => {\n watch(\n () => props.maxZoom,\n (maxZoom) => {\n if (maxZoom && isDef(maxZoom)) {\n instance.setMaxZoom(maxZoom);\n }\n },\n {\n immediate: true,\n },\n );\n });\n };\n\n const watchMinZoom = () => {\n scope.run(() => {\n watch(\n () => props.minZoom,\n (minZoom) => {\n if (minZoom && isDef(minZoom)) {\n instance.setMinZoom(minZoom);\n }\n },\n { immediate: true },\n );\n });\n };\n\n const watchTranslateExtent = () => {\n scope.run(() => {\n watch(\n () => props.translateExtent,\n (translateExtent) => {\n if (translateExtent && isDef(translateExtent)) {\n instance.setTranslateExtent(translateExtent);\n }\n },\n {\n immediate: true,\n },\n );\n });\n };\n\n const watchNodeExtent = () => {\n scope.run(() => {\n watch(\n () => props.nodeExtent,\n (nodeExtent) => {\n if (nodeExtent && isDef(nodeExtent)) {\n instance.setNodeExtent(nodeExtent);\n }\n },\n {\n immediate: true,\n },\n );\n });\n };\n\n const watchAriaLabelConfig = () => {\n scope.run(() => {\n watch(\n () => props.ariaLabelConfig,\n (ariaLabelConfig) => {\n // merge over the defaults so unspecified keys keep their default text (handled here rather than\n // in `watchRest`, which would assign the partial verbatim and drop the defaults)\n state.ariaLabelConfig = mergeAriaLabelConfig(ariaLabelConfig);\n },\n { immediate: true },\n );\n });\n };\n\n const watchApplyDefault = () => {\n scope.run(() => {\n watch(\n () => props.autoApplyChanges,\n (autoApplyChanges) => {\n if (isDef(autoApplyChanges)) {\n storeRefs.autoApplyChanges.value = autoApplyChanges;\n }\n },\n {\n immediate: true,\n },\n );\n });\n };\n\n const watchAutoConnect = () => {\n scope.run(() => {\n const autoConnector = async (params: Connection) => {\n let connection: boolean | Connection = params;\n\n if (typeof props.autoConnect === 'function') {\n connection = await props.autoConnect(params);\n }\n\n if (connection !== false) {\n instance.addEdges([connection]);\n }\n };\n\n watch(\n () => props.autoConnect,\n (autConnect) => {\n if (isDef(autConnect)) {\n storeRefs.autoConnect.value = autConnect;\n }\n },\n { immediate: true },\n );\n\n watch(\n storeRefs.autoConnect,\n (autoConnectEnabled, _, onCleanup) => {\n if (autoConnectEnabled) {\n instance.onConnect(autoConnector);\n }\n else {\n state.hooks.connect.off(autoConnector);\n }\n\n onCleanup(() => {\n state.hooks.connect.off(autoConnector);\n });\n },\n { immediate: true },\n );\n });\n };\n\n const watchRest = () => {\n const skip: (keyof typeof props)[] = [\n 'id',\n 'translateExtent',\n 'nodeExtent',\n 'edges',\n 'nodes',\n 'maxZoom',\n 'minZoom',\n 'autoApplyChanges',\n 'autoConnect',\n // `viewport` isn't a state field (it's a getter on the instance); `useViewportSync` two-way binds it\n 'viewport',\n // merged (not assigned verbatim) by `watchAriaLabelConfig`\n 'ariaLabelConfig',\n ];\n\n for (const key of Object.keys(props)) {\n const propKey = key as keyof typeof props;\n if (!skip.includes(propKey)) {\n const propValue = toRef(() => props[propKey]);\n\n const storeRef = storeRefs[propKey as keyof typeof storeRefs];\n\n if (isRef(storeRef)) {\n scope.run(() => {\n watch(\n propValue,\n (nextValue) => {\n if (isDef(nextValue)) {\n ;(storeRef.value as any) = nextValue;\n }\n },\n { immediate: true },\n );\n });\n }\n }\n }\n };\n\n const runAll = () => {\n // owned stores bind nodes/edges single-source via signals (createStore); only reused stores sync here\n if (!ownsStore) {\n watchNodesValue();\n watchEdgesValue();\n }\n watchMinZoom();\n watchMaxZoom();\n watchTranslateExtent();\n watchNodeExtent();\n watchApplyDefault();\n watchAutoConnect();\n watchAriaLabelConfig();\n watchRest();\n };\n\n runAll();\n });\n\n return () => scope.stop();\n}\n","<script lang=\"ts\" setup>\nimport type { PanelProps } from '../../types/panel';\nimport { computed } from 'vue';\nimport { storeToRefs, useStore } from '../../composables';\n\nconst props = defineProps<PanelProps>();\n\nconst { userSelectionActive } = storeToRefs(useStore());\n\nconst positionClasses = computed(() => `${props.position}`.split('-'));\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'Panel',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <div\n class=\"vue-flow__panel\"\n :class=\"positionClasses\"\n :aria-label=\"label ?? undefined\"\n :style=\"{ pointerEvents: userSelectionActive ? 'none' : 'all' }\"\n >\n <slot />\n </div>\n</template>\n","import type { FunctionalComponent } from 'vue';\nimport { h } from 'vue';\n\n// Static control icons as functional components (formerly `.svg` files compiled by vite-svg-loader).\n// Keeping them as plain components means the build needs no svg-to-component loader.\nfunction icon(viewBox: string, d: string): FunctionalComponent {\n return () => h('svg', { 'xmlns': 'http://www.w3.org/2000/svg', viewBox, 'aria-hidden': 'true' }, [h('path', { d })]);\n}\n\nexport const PlusIcon = icon('0 0 32 32', 'M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z');\n\nexport const MinusIcon = icon('0 0 32 5', 'M0 0h32v4.2H0z');\n\nexport const FitView = icon(\n '0 0 32 30',\n 'M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z',\n);\n\nexport const Lock = icon(\n '0 0 25 32',\n 'M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z',\n);\n\nexport const Unlock = icon(\n '0 0 25 32',\n 'M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z',\n);\n","<script lang=\"ts\" setup>\nimport type { ControlEmits, ControlProps } from './types';\nimport { toRef } from 'vue';\nimport { storeToRefs, useStore, useVueFlow } from '../../composables';\nimport Panel from '../Panel/Panel.vue';\nimport ControlButton from './ControlButton.vue';\nimport { FitView, Lock, MinusIcon, PlusIcon, Unlock } from './icons';\n\nconst props = withDefaults(defineProps<ControlProps>(), {\n showZoom: true,\n showFitView: true,\n showInteractive: true,\n position: 'bottom-left',\n});\n\nconst emit = defineEmits<ControlEmits>();\n\nconst { setInteractive, zoomIn, zoomOut, fitView, viewport } = useVueFlow();\n\nconst { nodesDraggable, nodesConnectable, elementsSelectable, minZoom, maxZoom, ariaLabelConfig } = storeToRefs(useStore());\n\nconst isInteractive = toRef(() => nodesDraggable.value || nodesConnectable.value || elementsSelectable.value);\n\nconst minZoomReached = toRef(() => viewport.value.zoom <= minZoom.value);\n\nconst maxZoomReached = toRef(() => viewport.value.zoom >= maxZoom.value);\n\nfunction onZoomInHandler() {\n zoomIn();\n\n emit('zoomIn');\n}\n\nfunction onZoomOutHandler() {\n zoomOut();\n\n emit('zoomOut');\n}\n\nfunction onFitViewHandler() {\n fitView(props.fitViewParams);\n\n emit('fitView');\n}\n\nfunction onInteractiveChangeHandler() {\n setInteractive(!isInteractive.value);\n\n emit('interactionChange', !isInteractive.value);\n}\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'Controls',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <Panel class=\"vue-flow__controls\" :position=\"position\" :label=\"ariaLabel ?? ariaLabelConfig['controls.ariaLabel']\">\n <slot name=\"top\" />\n\n <template v-if=\"showZoom\">\n <slot name=\"control-zoom-in\">\n <ControlButton\n class=\"vue-flow__controls-zoomin\"\n :disabled=\"maxZoomReached\"\n :label=\"ariaLabelConfig['controls.zoomIn.ariaLabel']\"\n @click=\"onZoomInHandler\"\n >\n <slot name=\"icon-zoom-in\">\n <component :is=\"PlusIcon\" />\n </slot>\n </ControlButton>\n </slot>\n\n <slot name=\"control-zoom-out\">\n <ControlButton\n class=\"vue-flow__controls-zoomout\"\n :disabled=\"minZoomReached\"\n :label=\"ariaLabelConfig['controls.zoomOut.ariaLabel']\"\n @click=\"onZoomOutHandler\"\n >\n <slot name=\"icon-zoom-out\">\n <component :is=\"MinusIcon\" />\n </slot>\n </ControlButton>\n </slot>\n </template>\n\n <template v-if=\"showFitView\">\n <slot name=\"control-fit-view\">\n <ControlButton\n class=\"vue-flow__controls-fitview\"\n :label=\"ariaLabelConfig['controls.fitView.ariaLabel']\"\n @click=\"onFitViewHandler\"\n >\n <slot name=\"icon-fit-view\">\n <component :is=\"FitView\" />\n </slot>\n </ControlButton>\n </slot>\n </template>\n\n <template v-if=\"showInteractive\">\n <slot name=\"control-interactive\">\n <ControlButton\n v-if=\"showInteractive\"\n class=\"vue-flow__controls-interactive\"\n :label=\"ariaLabelConfig['controls.interactive.ariaLabel']\"\n @click=\"onInteractiveChangeHandler\"\n >\n <slot v-if=\"isInteractive\" name=\"icon-unlock\">\n <component :is=\"Unlock\" />\n </slot>\n <slot v-if=\"!isInteractive\" name=\"icon-lock\">\n <component :is=\"Lock\" />\n </slot>\n </ControlButton>\n </slot>\n </template>\n\n <slot />\n </Panel>\n</template>\n","<script lang=\"ts\" setup>\nimport type { Rect as RectType } from '@xyflow/system';\nimport type { EdgeTextProps } from '../../types/components';\nimport { computed, onMounted, shallowRef, watch } from 'vue';\n\nconst {\n x,\n y,\n label,\n labelStyle = {},\n labelShowBg = true,\n labelBgStyle = {},\n labelBgPadding = [2, 4],\n labelBgBorderRadius = 2,\n} = defineProps<EdgeTextProps>();\n\nconst box = shallowRef<RectType>({ x: 0, y: 0, width: 0, height: 0 });\n\nconst el = shallowRef<SVGTextElement | null>(null);\n\nconst transform = computed(() => `translate(${x - box.value.width / 2} ${y - box.value.height / 2})`);\n\nonMounted(() => {\n getBox();\n\n // The first measurement can run before the theme stylesheet (`font-size`) and web font are applied,\n // sizing the box for the wrong (default 16px) font. Since we deliberately don't re-measure on x/y\n // changes (that would force a reflow every drag frame — see the watch below), it would never self-\n // correct. Re-measure once after a frame and once fonts settle so the box snaps to the real text size.\n requestAnimationFrame(getBox);\n document.fonts?.ready?.then(getBox);\n});\n\n// the text's bounding box depends on its content/font, NOT its x/y position — re-measuring (getBBox forces\n// a reflow) on every move would thrash layout each drag frame for no change, so only watch el + label\nwatch([el, () => label], getBox);\n\nfunction getBox() {\n if (!el.value) {\n return;\n }\n\n const nextBox = el.value.getBBox();\n\n if (nextBox.width !== box.value.width || nextBox.height !== box.value.height) {\n box.value = nextBox;\n }\n}\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'EdgeText',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <g :transform=\"transform\" :visibility=\"box.width ? 'visible' : 'hidden'\" class=\"vue-flow__edge-textwrapper\">\n <rect\n v-if=\"labelShowBg\"\n class=\"vue-flow__edge-textbg\"\n :width=\"`${box.width + 2 * labelBgPadding[0]}px`\"\n :height=\"`${box.height + 2 * labelBgPadding[1]}px`\"\n :x=\"-labelBgPadding[0]\"\n :y=\"-labelBgPadding[1]\"\n :style=\"labelBgStyle\"\n :rx=\"labelBgBorderRadius\"\n :ry=\"labelBgBorderRadius\"\n />\n\n <text v-bind=\"$attrs\" ref=\"el\" class=\"vue-flow__edge-text\" :y=\"box.height / 2\" dy=\"0.3em\" :style=\"labelStyle\">\n <slot>\n <component :is=\"label\" v-if=\"typeof label !== 'string'\" />\n <template v-else>\n {{ label }}\n </template>\n </slot>\n </text>\n </g>\n</template>\n","<script lang=\"ts\" setup>\nimport type { BaseEdgeProps } from '../../types';\nimport { shallowRef, useAttrs } from 'vue';\nimport EdgeText from './EdgeText.vue';\n\nwithDefaults(defineProps<BaseEdgeProps>(), { interactionWidth: 20 });\n\nconst pathEl = shallowRef<SVGPathElement | null>(null);\n\nconst interactionEl = shallowRef<SVGPathElement | null>(null);\n\nconst labelEl = shallowRef<SVGGElement | null>(null);\n\nconst attrs = useAttrs();\n\ndefineExpose({\n pathEl,\n interactionEl,\n labelEl,\n});\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'BaseEdge',\n inheritAttrs: false,\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <path\n v-bind=\"attrs\"\n :id=\"id\"\n ref=\"pathEl\"\n :d=\"path\"\n class=\"vue-flow__edge-path\"\n :marker-end=\"markerEnd\"\n :marker-start=\"markerStart\"\n />\n\n <path\n v-if=\"interactionWidth\"\n ref=\"interactionEl\"\n fill=\"none\"\n :d=\"path\"\n :stroke-width=\"interactionWidth\"\n :stroke-opacity=\"0\"\n class=\"vue-flow__edge-interaction\"\n />\n\n <EdgeText\n v-if=\"label && labelX && labelY\"\n ref=\"labelEl\"\n :x=\"labelX\"\n :y=\"labelY\"\n :label=\"label\"\n :label-show-bg=\"labelShowBg\"\n :label-bg-style=\"labelBgStyle\"\n :label-bg-padding=\"labelBgPadding\"\n :label-bg-border-radius=\"labelBgBorderRadius\"\n :label-style=\"labelStyle\"\n />\n</template>\n","import type { CSSProperties } from 'vue';\n\n/**\n * The props `BaseEdge` actually renders (label/marker/interaction) plus genuine `style`/`class`\n * fallthrough. The built-in edge components receive the full `EdgeProps` surface (geometry like\n * `sourceX`/`sourceY` + identity like `source`/`type`/`selected`); the geometry is consumed to COMPUTE\n * the path and the identity isn't BaseEdge's concern, so forwarding `{ ...attrs, ...props }` wholesale\n * leaked all of it onto the `<path>` via BaseEdge's `v-bind=\"$attrs\"` (and re-wrote the changing\n * `sourceX`/`sourceY`/`targetX`/`targetY` attrs every drag frame). Pick only what BaseEdge needs.\n */\nexport function baseEdgeProps(props: Record<string, any>, attrs: Record<string, any>) {\n return {\n label: props.label,\n labelStyle: props.labelStyle,\n labelShowBg: props.labelShowBg,\n labelBgStyle: props.labelBgStyle,\n labelBgPadding: props.labelBgPadding,\n labelBgBorderRadius: props.labelBgBorderRadius,\n markerStart: props.markerStart,\n markerEnd: props.markerEnd,\n interactionWidth: props.interactionWidth,\n style: attrs.style as CSSProperties | undefined,\n class: attrs.class,\n };\n}\n","import type { BezierEdgeProps } from '../../types';\nimport { getBezierPath, Position } from '@xyflow/system';\nimport { defineComponent, h } from 'vue';\nimport BaseEdge from './BaseEdge.vue';\nimport { baseEdgeProps } from './utils';\n\nconst BezierEdge = defineComponent<BezierEdgeProps>({\n name: 'BezierEdge',\n // see StraightEdge: keep undeclared attrs (source/target/…) from leaking onto the <path>\n inheritAttrs: false,\n props: [\n 'sourcePosition',\n 'targetPosition',\n 'label',\n 'labelStyle',\n 'labelShowBg',\n 'labelBgStyle',\n 'labelBgPadding',\n 'labelBgBorderRadius',\n 'sourceY',\n 'sourceX',\n 'targetX',\n 'targetY',\n 'curvature',\n 'markerEnd',\n 'markerStart',\n 'interactionWidth',\n ],\n compatConfig: { MODE: 3 },\n setup(props, { attrs }) {\n return () => {\n const [path, labelX, labelY] = getBezierPath({\n ...props,\n sourcePosition: props.sourcePosition ?? Position.Bottom,\n targetPosition: props.targetPosition ?? Position.Top,\n });\n\n return h(BaseEdge, { path, labelX, labelY, ...baseEdgeProps(props, attrs) });\n };\n },\n});\n\nexport default BezierEdge;\n","<script lang=\"ts\" setup>\nimport type { TeleportProps } from 'vue';\nimport { computed } from 'vue';\nimport { storeToRefs, useStore } from '../../composables';\n\nconst { viewportRef } = storeToRefs(useStore());\n\nconst teleportTarget = computed(() => viewportRef.value?.getElementsByClassName('vue-flow__edgelabel-renderer')[0] as TeleportProps['to']);\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'EdgeLabelRenderer',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <svg>\n <foreignObject height=\"0\" width=\"0\">\n <Teleport :to=\"teleportTarget\" :disabled=\"!teleportTarget\">\n <slot />\n </Teleport>\n </foreignObject>\n </svg>\n</template>\n","import type { SimpleBezierEdgeProps } from '../../types';\nimport { getBezierEdgeCenter, Position } from '@xyflow/system';\nimport { defineComponent, h } from 'vue';\nimport BaseEdge from './BaseEdge.vue';\nimport { baseEdgeProps } from './utils';\n\nexport interface GetSimpleBezierPathParams {\n sourceX: number;\n sourceY: number;\n sourcePosition?: Position;\n targetX: number;\n targetY: number;\n targetPosition?: Position;\n}\n\ninterface GetControlParams {\n pos: Position;\n x1: number;\n y1: number;\n x2: number;\n y2: number;\n}\n\nfunction getControl({ pos, x1, y1, x2, y2 }: GetControlParams): [number, number] {\n let ctX: number, ctY: number;\n switch (pos) {\n case Position.Left:\n case Position.Right:\n ctX = 0.5 * (x1 + x2);\n ctY = y1;\n break;\n case Position.Top:\n case Position.Bottom:\n ctX = x1;\n ctY = 0.5 * (y1 + y2);\n break;\n }\n return [ctX, ctY];\n}\n\n/**\n * Get a simple bezier path from source to target handle (no curvature)\n * @public\n *\n * @param simpleBezierPathParams\n * @param simpleBezierPathParams.sourceX - The x position of the source handle\n * @param simpleBezierPathParams.sourceY - The y position of the source handle\n * @param simpleBezierPathParams.sourcePosition - The position of the source handle (default: Position.Bottom)\n * @param simpleBezierPathParams.targetX - The x position of the target handle\n * @param simpleBezierPathParams.targetY - The y position of the target handle\n * @param simpleBezierPathParams.targetPosition - The position of the target handle (default: Position.Top)\n * @returns A path string you can use in an SVG, the labelX and labelY position (center of path) and offsetX, offsetY between source handle and label\n */\nexport function getSimpleBezierPath({\n sourceX,\n sourceY,\n sourcePosition = Position.Bottom,\n targetX,\n targetY,\n targetPosition = Position.Top,\n}: GetSimpleBezierPathParams): [path: string, labelX: number, labelY: number, offsetX: number, offsetY: number] {\n const [sourceControlX, sourceControlY] = getControl({\n pos: sourcePosition,\n x1: sourceX,\n y1: sourceY,\n x2: targetX,\n y2: targetY,\n });\n\n const [targetControlX, targetControlY] = getControl({\n pos: targetPosition,\n x1: targetX,\n y1: targetY,\n x2: sourceX,\n y2: sourceY,\n });\n\n const [labelX, labelY, offsetX, offsetY] = getBezierEdgeCenter({\n sourceX,\n sourceY,\n targetX,\n targetY,\n sourceControlX,\n sourceControlY,\n targetControlX,\n targetControlY,\n });\n\n return [\n `M${sourceX},${sourceY} C${sourceControlX},${sourceControlY} ${targetControlX},${targetControlY} ${targetX},${targetY}`,\n labelX,\n labelY,\n offsetX,\n offsetY,\n ];\n}\n\nconst SimpleBezierEdge = defineComponent<SimpleBezierEdgeProps>({\n name: 'SimpleBezierEdge',\n // see StraightEdge: keep undeclared attrs (source/target/…) from leaking onto the <path>\n inheritAttrs: false,\n props: [\n 'sourcePosition',\n 'targetPosition',\n 'label',\n 'labelStyle',\n 'labelShowBg',\n 'labelBgStyle',\n 'labelBgPadding',\n 'labelBgBorderRadius',\n 'sourceY',\n 'sourceX',\n 'targetX',\n 'targetY',\n 'markerEnd',\n 'markerStart',\n 'interactionWidth',\n ],\n compatConfig: { MODE: 3 },\n setup(props, { attrs }) {\n return () => {\n const [path, labelX, labelY] = getSimpleBezierPath({\n ...props,\n sourcePosition: props.sourcePosition ?? Position.Bottom,\n targetPosition: props.targetPosition ?? Position.Top,\n });\n\n return h(BaseEdge, { path, labelX, labelY, ...baseEdgeProps(props, attrs) });\n };\n },\n});\n\nexport default SimpleBezierEdge;\n","import type { SmoothStepEdgeProps } from '../../types';\nimport { getSmoothStepPath, Position } from '@xyflow/system';\nimport { defineComponent, h } from 'vue';\nimport BaseEdge from './BaseEdge.vue';\nimport { baseEdgeProps } from './utils';\n\nconst SmoothStepEdge = defineComponent<SmoothStepEdgeProps>({\n name: 'SmoothStepEdge',\n // see StraightEdge: keep undeclared attrs (source/target/…) from leaking onto the <path>\n inheritAttrs: false,\n props: [\n 'sourcePosition',\n 'targetPosition',\n 'label',\n 'labelStyle',\n 'labelShowBg',\n 'labelBgStyle',\n 'labelBgPadding',\n 'labelBgBorderRadius',\n 'sourceY',\n 'sourceX',\n 'targetX',\n 'targetY',\n 'borderRadius',\n 'markerEnd',\n 'markerStart',\n 'interactionWidth',\n 'offset',\n 'stepPosition',\n ],\n compatConfig: { MODE: 3 },\n setup(props, { attrs }) {\n return () => {\n const [path, labelX, labelY] = getSmoothStepPath({\n ...props,\n sourcePosition: props.sourcePosition ?? Position.Bottom,\n targetPosition: props.targetPosition ?? Position.Top,\n });\n\n return h(BaseEdge, { path, labelX, labelY, ...baseEdgeProps(props, attrs) });\n };\n },\n});\n\nexport default SmoothStepEdge;\n","import type { StepEdgeProps } from '../../types';\nimport { defineComponent, h } from 'vue';\nimport SmoothStepEdge from './SmoothStepEdge';\n\nconst StepEdge = defineComponent<StepEdgeProps>({\n name: 'StepEdge',\n // see StraightEdge: keep undeclared attrs from auto-applying to the SmoothStepEdge root\n inheritAttrs: false,\n props: [\n 'sourcePosition',\n 'targetPosition',\n 'label',\n 'labelStyle',\n 'labelShowBg',\n 'labelBgStyle',\n 'labelBgPadding',\n 'labelBgBorderRadius',\n 'sourceY',\n 'sourceX',\n 'targetX',\n 'targetY',\n 'markerEnd',\n 'markerStart',\n 'interactionWidth',\n ],\n setup(props, { attrs }) {\n return () => h(SmoothStepEdge, { ...props, ...attrs, borderRadius: 0 });\n },\n});\n\nexport default StepEdge;\n","import type { StraightEdgeProps } from '../../types';\nimport { getStraightPath } from '@xyflow/system';\nimport { defineComponent, h } from 'vue';\nimport BaseEdge from './BaseEdge.vue';\nimport { baseEdgeProps } from './utils';\n\nconst StraightEdge = defineComponent<StraightEdgeProps>({\n name: 'StraightEdge',\n // attrs (the EdgeProps the component doesn't declare: source/target/selected/…) must not auto-apply to\n // the BaseEdge root and leak onto the <path>; genuine style/class are forwarded via `baseEdgeProps`\n inheritAttrs: false,\n props: [\n 'label',\n 'labelStyle',\n 'labelShowBg',\n 'labelBgStyle',\n 'labelBgPadding',\n 'labelBgBorderRadius',\n 'sourceY',\n 'sourceX',\n 'targetX',\n 'targetY',\n 'markerEnd',\n 'markerStart',\n 'interactionWidth',\n ],\n compatConfig: { MODE: 3 },\n setup(props, { attrs }) {\n return () => {\n const [path, labelX, labelY] = getStraightPath(props);\n\n return h(BaseEdge, { path, labelX, labelY, ...baseEdgeProps(props, attrs) });\n };\n },\n});\n\nexport default StraightEdge;\n","<script lang=\"ts\" setup>\nimport type { HandleProps } from '../../types';\nimport { ConnectionMode, getDimensions, isMouseEvent, nodeHasDimensions, Position } from '@xyflow/system';\nimport { computed, onMounted, shallowRef, toRef } from 'vue';\nimport { useHandle, useNode, useStore, useVueFlow } from '../../composables';\nimport { isDef } from '../../utils';\n\nconst {\n position = Position.Top,\n isConnectable = undefined,\n connectableStart = true,\n connectableEnd = true,\n id: handleId = null,\n ...props\n} = defineProps<HandleProps>();\n\nconst type = toRef(() => props.type ?? 'source');\n\nconst isValidConnection = toRef(() => props.isValidConnection ?? null);\n\nconst { id: flowId } = useVueFlow();\n\n// Read the reactive store directly (see NodeWrapper) instead of projecting it into refs — there are ~2\n// handles per node, so this setup runs a lot; `store.x` already tracks reactively in computeds/template.\nconst store = useStore();\n\nconst { id: nodeId, node: nodeRef, nodeEl, connectedEdges } = useNode();\n\nconst handle = shallowRef<HTMLDivElement>();\n\n// `data-id` (queried by handle DOM lookup in `utils/handle.ts`) and the other handle identifiers are\n// typed through a `Record` because this vue version's `HTMLAttributes` lacks the `data-*` index signature\n// that `strictTemplates` needs, so they can't be written as bare `:data-*` attributes in the template.\nconst handleDataIds = computed<Record<string, string | null>>(() => ({\n 'data-id': `${flowId}-${nodeId}-${handleId}-${type.value}`,\n 'data-handleid': handleId,\n 'data-nodeid': nodeId,\n 'data-handlepos': position,\n}));\n\nconst { handlePointerDown, handleClick } = useHandle({\n nodeId,\n handleId,\n isValidConnection,\n type,\n});\n\nconst isHandleConnectable = computed(() => {\n if (typeof isConnectable === 'string' && isConnectable === 'single') {\n return !connectedEdges.value.some((edge) => {\n const id = edge[`${type.value}Handle`];\n\n if (edge[type.value] !== nodeId) {\n return false;\n }\n\n return id ? id === handleId : true;\n });\n }\n\n if (typeof isConnectable === 'number') {\n return (\n connectedEdges.value.filter((edge) => {\n const id = edge[`${type.value}Handle`];\n\n if (edge[type.value] !== nodeId) {\n return false;\n }\n\n return id ? id === handleId : true;\n }).length < isConnectable\n );\n }\n\n if (typeof isConnectable === 'function') {\n return nodeRef.value ? isConnectable(nodeRef.value, connectedEdges.value) : false;\n }\n\n return isDef(isConnectable) ? isConnectable : store.nodesConnectable;\n});\n\n// All connection-driven classes in one computed instead of ~7 separate refs: they all derive from the same\n// global `connection*` store state (so they toggle together during a connection) and are used only in the\n// class binding. Mirrors xyflow/react's `connectingSelector`.\nconst connectionClasses = computed<Record<string, boolean>>((prev) => {\n const fromHandle = store.connectionStartHandle;\n const clickFromHandle = store.connectionClickStartHandle;\n const toHandle = store.connectionEndHandle;\n const handleType = type.value;\n\n const connectionInProcess = fromHandle !== null;\n const clickConnectionInProcess = clickFromHandle !== null;\n // whether this handle can be the END of the in-progress (drag) connection\n const isPossibleEndHandle = store.connectionMode === ConnectionMode.Strict\n ? fromHandle?.type !== handleType\n : nodeId !== fromHandle?.nodeId || handleId !== fromHandle?.id;\n const connectingto = toHandle?.nodeId === nodeId && toHandle?.id === handleId && toHandle?.type === handleType;\n\n const next = {\n // resolved value (falls back to `nodesConnectable`), not the raw prop — XYHandle's DOM query targets\n // `.connectable` to find drop targets, so an unset `:connectable` must still mark it\n connectable: isHandleConnectable.value,\n connecting:\n clickFromHandle?.nodeId === nodeId && clickFromHandle?.id === handleId && clickFromHandle?.type === handleType,\n connectablestart: connectableStart,\n connectableend: connectableEnd,\n connectingfrom: fromHandle?.nodeId === nodeId && fromHandle?.id === handleId && fromHandle?.type === handleType,\n connectingto,\n valid: connectingto && store.connectionStatus === 'valid',\n connectionindicator:\n isHandleConnectable.value\n && (!connectionInProcess || isPossibleEndHandle)\n && ((connectionInProcess || clickConnectionInProcess) ? connectableEnd : connectableStart),\n };\n\n // Reuse the previous object when nothing changed so the class binding's render effect doesn't re-run\n // (Vue gates dependents on reference identity). During a connection drag `connectionEndHandle` toggles\n // every handle's recompute, but only the two endpoints' classes actually change — without this every\n // visible handle re-renders on each intermediate target change.\n if (\n prev\n && prev.connectable === next.connectable\n && prev.connecting === next.connecting\n && prev.connectablestart === next.connectablestart\n && prev.connectableend === next.connectableend\n && prev.connectingfrom === next.connectingfrom\n && prev.connectingto === next.connectingto\n && prev.valid === next.valid\n && prev.connectionindicator === next.connectionindicator\n ) {\n return prev;\n }\n\n return next;\n});\n\n// todo: remove this and have users handle this themselves using `updateNodeInternals`\n// set up handle bounds if they don't exist yet and the node has been initialized (i.e. the handle was added after the node has already been mounted)\nonMounted(() => {\n const node = nodeRef.value;\n\n // if the node isn't initialized yet, we can't set up the handle bounds\n // the handle bounds will be automatically set up when the node is initialized (`updateNodeDimensions`)\n if (!node || !nodeHasDimensions(node)) {\n return;\n }\n\n const existingBounds = node.internals.handleBounds?.[type.value]?.find(b => b.id === handleId);\n\n if (!store.vueFlowRef || existingBounds) {\n return;\n }\n\n const viewportNode = store.vueFlowRef.querySelector('.vue-flow__viewport');\n\n if (!nodeEl.value || !handle.value || !viewportNode || !handleId) {\n return;\n }\n\n const nodeBounds = nodeEl.value.getBoundingClientRect();\n\n const handleBounds = handle.value.getBoundingClientRect();\n\n const style = window.getComputedStyle(viewportNode);\n const { m22: zoom } = new window.DOMMatrixReadOnly(style.transform);\n\n const nextBounds = {\n id: handleId,\n position,\n x: (handleBounds.left - nodeBounds.left) / zoom,\n y: (handleBounds.top - nodeBounds.top) / zoom,\n type: type.value,\n nodeId,\n ...getDimensions(handle.value),\n };\n\n if (!node.internals.handleBounds) {\n node.internals.handleBounds = { source: null, target: null };\n }\n const bounds = node.internals.handleBounds;\n bounds[type.value] = [...(bounds[type.value] ?? []), nextBounds];\n});\n\nfunction onPointerDown(event: MouseEvent | TouchEvent) {\n const isMouseTriggered = isMouseEvent(event);\n\n if (isHandleConnectable.value && connectableStart && ((isMouseTriggered && event.button === 0) || !isMouseTriggered)) {\n handlePointerDown(event);\n }\n}\n\nfunction onClick(event: MouseEvent) {\n if (!nodeId || (!store.connectionClickStartHandle && !connectableStart)) {\n return;\n }\n\n if (isHandleConnectable.value) {\n handleClick(event);\n }\n}\n\ndefineExpose({\n handleClick,\n handlePointerDown,\n onClick,\n onPointerDown,\n});\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'Handle',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <div\n ref=\"handle\"\n v-bind=\"handleDataIds\"\n :aria-label=\"store.ariaLabelConfig['handle.ariaLabel']\"\n class=\"vue-flow__handle\"\n :class=\"[\n `vue-flow__handle-${position}`,\n handleId && `vue-flow__handle-${handleId}`,\n store.noDragClassName,\n store.noPanClassName,\n type,\n connectionClasses,\n ]\"\n @mousedown=\"onPointerDown\"\n @touchstart.passive=\"onPointerDown\"\n @click=\"onClick\"\n >\n <slot :id=\"id\" />\n </div>\n</template>\n","import type { Dimensions, PanelPosition, XYPosition } from '@xyflow/system';\nimport type { CSSProperties, InjectionKey } from 'vue';\nimport type { InternalNode, NodeMouseEvent } from '../../types';\n\n/** expects a node and returns a color value */\nexport type MiniMapNodeFunc = (node: InternalNode) => string;\n\nexport type ShapeRendering = CSSProperties['shapeRendering'];\n\nexport interface MiniMapProps {\n /** Node color, can be either a string or a string func that receives the current node */\n nodeColor?: string | MiniMapNodeFunc;\n /** Node stroke color, can be either a string or a string func that receives the current node */\n nodeStrokeColor?: string | MiniMapNodeFunc;\n /** Additional node class name, can be either a string or a string func that receives the current node */\n nodeClassName?: string | MiniMapNodeFunc;\n /** Node border radius */\n nodeBorderRadius?: number;\n /** Node stroke width */\n nodeStrokeWidth?: number;\n /** Background color of minimap mask */\n maskColor?: string;\n /** Border color of minimap mask */\n maskStrokeColor?: string;\n /** Border width of minimap mask */\n maskStrokeWidth?: number;\n /** Position of the minimap {@link PanelPosition} */\n position?: PanelPosition;\n /** Enable drag minimap to drag viewport */\n pannable?: boolean;\n /** Enable zoom minimap to zoom viewport */\n zoomable?: boolean;\n\n width?: number;\n\n height?: number;\n\n ariaLabel?: string | null;\n /** Enable inverse panning, i.e. drag minimap to move viewport in opposite direction */\n inversePan?: boolean;\n /** Specify zoom step */\n zoomStep?: number;\n /** Specify minimap scale */\n offsetScale?: number;\n /** Mask border radius */\n maskBorderRadius?: number;\n}\n\n/** these props are passed to mini map node slots */\nexport interface MiniMapNodeProps {\n id: string;\n type?: string;\n selected?: boolean;\n dragging?: boolean;\n position: XYPosition;\n dimensions: Dimensions;\n borderRadius?: number;\n color?: string;\n shapeRendering?: ShapeRendering;\n strokeColor?: string;\n strokeWidth?: number;\n hidden?: boolean;\n}\n\nexport interface MiniMapEmits {\n click: [params: { event: MouseEvent; position: XYPosition }];\n nodeClick: [params: NodeMouseEvent];\n nodeDblclick: [params: NodeMouseEvent];\n nodeMouseenter: [params: NodeMouseEvent];\n nodeMousemove: [params: NodeMouseEvent];\n nodeMouseleave: [params: NodeMouseEvent];\n}\n\nexport interface MiniMapNodeEmits {\n click: [params: MouseEvent];\n dblclick: [params: MouseEvent];\n mouseenter: [params: MouseEvent];\n mousemove: [params: MouseEvent];\n mouseleave: [params: MouseEvent];\n}\n\nexport interface MiniMapSlots extends Record<`node-${string}`, (nodeProps: MiniMapNodeProps) => any> {}\n\nexport const Slots: InjectionKey<MiniMapSlots> = Symbol('MiniMapSlots');\n","<script setup lang=\"ts\">\nimport type { MiniMapNodeEmits, MiniMapNodeProps } from './types';\nimport { inject, useAttrs } from 'vue';\nimport { Slots } from './types';\n\nconst props = defineProps<MiniMapNodeProps>();\n\nconst emits = defineEmits<MiniMapNodeEmits>();\n\nconst miniMapSlots = inject(Slots, {});\n\nconst attrs = useAttrs() as Record<string, any>;\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'MiniMapNode',\n compatConfig: { MODE: 3 },\n inheritAttrs: false,\n};\n</script>\n\n<template>\n <template v-if=\"!hidden && dimensions.width !== 0 && dimensions.height !== 0\">\n <component\n :is=\"miniMapSlots[`node-${props.type}`]\"\n v-if=\"miniMapSlots[`node-${props.type}`]\"\n v-bind=\"{ ...props, ...attrs }\"\n />\n\n <rect\n v-else\n :id=\"id\"\n v-bind=\"attrs\"\n class=\"vue-flow__minimap-node\"\n :class=\"{ selected, dragging }\"\n :x=\"position.x\"\n :y=\"position.y\"\n :rx=\"borderRadius\"\n :ry=\"borderRadius\"\n :width=\"dimensions.width\"\n :height=\"dimensions.height\"\n :fill=\"color || (attrs.style?.background as string) || attrs.style?.backgroundColor\"\n :stroke=\"strokeColor\"\n :stroke-width=\"strokeWidth\"\n :shape-rendering=\"shapeRendering\"\n @click=\"emits('click', $event)\"\n @dblclick=\"emits('dblclick', $event)\"\n @mouseenter=\"emits('mouseenter', $event)\"\n @mousemove=\"emits('mousemove', $event)\"\n @mouseleave=\"emits('mouseleave', $event)\"\n />\n </template>\n</template>\n","<script lang=\"ts\" setup>\nimport type { XYMinimapInstance } from '@xyflow/system';\nimport type { InternalNode } from '../../types';\nimport type { MiniMapEmits, MiniMapNodeFunc, MiniMapProps, MiniMapSlots, ShapeRendering } from './types';\nimport { getBoundsOfRects, getConnectedEdges, getNodeDimensions, getNodesBounds, XYMinimap } from '@xyflow/system';\nimport { computed, onMounted, onUnmounted, provide, shallowRef, toRef, useAttrs, watch } from 'vue';\nimport { storeToRefs, useStore, useVueFlow } from '../../composables';\nimport Panel from '../Panel/Panel.vue';\nimport MiniMapNode from './MiniMapNode.vue';\nimport { Slots } from './types';\n\nconst {\n width,\n height,\n nodeStrokeColor = 'var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default))',\n nodeColor = 'var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default))',\n nodeClassName,\n nodeBorderRadius = 5,\n nodeStrokeWidth = 2,\n maskColor = 'var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default))',\n position = 'bottom-right',\n maskStrokeColor = 'var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default))',\n maskStrokeWidth = 1,\n maskBorderRadius = 0,\n pannable = false,\n zoomable = false,\n ariaLabel,\n inversePan = false,\n zoomStep = 1,\n offsetScale = 5,\n} = defineProps<MiniMapProps>();\n\nconst emit = defineEmits<MiniMapEmits>();\n\nconst slots = defineSlots<MiniMapSlots>();\n\nconst attrs: Record<string, any> = useAttrs();\n\nconst defaultWidth = 200;\nconst defaultHeight = 150;\n\nconst { id, viewport, emits } = useVueFlow();\n\nconst { nodeLookup } = useStore();\n\nconst { edges, nodes, transform, translateExtent, dimensions, panZoom, ariaLabelConfig } = storeToRefs(useStore());\n\n// fall back to the configurable default label (`ariaLabelConfig`) when no explicit `ariaLabel` is passed\nconst resolvedAriaLabel = computed(() => ariaLabel ?? ariaLabelConfig.value['minimap.ariaLabel']);\n\nconst el = shallowRef<SVGElement>();\n\nlet minimapInstance: XYMinimapInstance | null = null;\n\nprovide(Slots, slots);\n\nconst elementWidth = toRef(() => width ?? attrs.style?.width ?? defaultWidth);\n\nconst elementHeight = toRef(() => height ?? attrs.style?.height ?? defaultHeight);\n\nconst shapeRendering: ShapeRendering = typeof window === 'undefined' || !!window.chrome ? 'crispEdges' : 'geometricPrecision';\n\nconst nodeColorFunc = computed<MiniMapNodeFunc>(() => (typeof nodeColor === 'string' ? () => nodeColor : nodeColor));\n\nconst nodeStrokeColorFunc = computed<MiniMapNodeFunc>(() =>\n typeof nodeStrokeColor === 'string' ? () => nodeStrokeColor : nodeStrokeColor,\n);\n\nconst nodeClassNameFunc = computed<MiniMapNodeFunc>(() =>\n typeof nodeClassName === 'string' ? () => nodeClassName : typeof nodeClassName === 'function' ? nodeClassName : () => '',\n);\n\n// The minimap renders absolute positions + measured dimensions, which live on the InternalNode — iterate\n// the lookup (the public `nodes` ref holds user `Node`s without `internals`).\nconst minimapNodes = computed(() => Array.from(nodeLookup.values()));\n\nconst bb = computed(() =>\n getNodesBounds(\n nodes.value.filter(node => !node.hidden),\n { nodeLookup },\n ),\n);\n\nconst viewBB = computed(() => ({\n x: -viewport.value.x / viewport.value.zoom,\n y: -viewport.value.y / viewport.value.zoom,\n width: dimensions.value.width / viewport.value.zoom,\n height: dimensions.value.height / viewport.value.zoom,\n}));\n\nconst boundingRect = computed(() => (nodes.value && nodes.value.length ? getBoundsOfRects(bb.value, viewBB.value) : viewBB.value));\n\nconst viewScale = computed(() => {\n const scaledWidth = boundingRect.value.width / elementWidth.value;\n const scaledHeight = boundingRect.value.height / elementHeight.value;\n\n return Math.max(scaledWidth, scaledHeight);\n});\n\nconst viewBox = computed(() => {\n const viewWidth = viewScale.value * elementWidth.value;\n const viewHeight = viewScale.value * elementHeight.value;\n const offset = offsetScale * viewScale.value;\n\n return {\n offset,\n x: boundingRect.value.x - (viewWidth - boundingRect.value.width) / 2 - offset,\n y: boundingRect.value.y - (viewHeight - boundingRect.value.height) / 2 - offset,\n width: viewWidth + offset * 2,\n height: viewHeight + offset * 2,\n };\n});\n\nconst d = computed(() => {\n if (!viewBox.value.x || !viewBox.value.y) {\n return '';\n }\n\n return `\n M${viewBox.value.x - viewBox.value.offset},${viewBox.value.y - viewBox.value.offset}\n h${viewBox.value.width + viewBox.value.offset * 2}\n v${viewBox.value.height + viewBox.value.offset * 2}\n h${-viewBox.value.width - viewBox.value.offset * 2}z\n M${viewBB.value.x + maskBorderRadius},${viewBB.value.y}\n h${viewBB.value.width - 2 * maskBorderRadius}\n a${maskBorderRadius},${maskBorderRadius} 0 0 1 ${maskBorderRadius},${maskBorderRadius}\n v${viewBB.value.height - 2 * maskBorderRadius}\n a${maskBorderRadius},${maskBorderRadius} 0 0 1 -${maskBorderRadius},${maskBorderRadius}\n h${-(viewBB.value.width - 2 * maskBorderRadius)}\n a${maskBorderRadius},${maskBorderRadius} 0 0 1 -${maskBorderRadius},-${maskBorderRadius}\n v${-(viewBB.value.height - 2 * maskBorderRadius)}\n a${maskBorderRadius},${maskBorderRadius} 0 0 1 ${maskBorderRadius},-${maskBorderRadius}z`;\n});\n\nonMounted(() => {\n watch(\n panZoom,\n (panZoomInstance) => {\n if (el.value && panZoomInstance) {\n minimapInstance = XYMinimap({\n domNode: el.value,\n panZoom: panZoomInstance,\n getTransform: () => transform.value,\n getViewScale: () => viewScale.value,\n });\n }\n },\n { immediate: true },\n );\n\n onUnmounted(() => {\n minimapInstance?.destroy();\n });\n\n watch(\n [\n () => pannable,\n () => zoomable,\n () => inversePan,\n () => zoomStep,\n translateExtent,\n () => dimensions.value.height,\n () => dimensions.value.width,\n ],\n () => {\n minimapInstance?.update({\n translateExtent: translateExtent.value,\n width: dimensions.value.width,\n height: dimensions.value.height,\n inversePan,\n pannable,\n zoomStep,\n zoomable,\n });\n },\n { immediate: true },\n );\n});\n\nfunction onSvgClick(event: MouseEvent) {\n const [x, y] = minimapInstance?.pointer(event) || [0, 0];\n\n emit('click', { event, position: { x, y } });\n}\n\nfunction onNodeClick(event: MouseEvent, node: InternalNode) {\n const param = { event, node: node.internals.userNode, connectedEdges: getConnectedEdges([node], edges.value) };\n emits.miniMapNodeClick(param);\n emit('nodeClick', param);\n}\n\nfunction onNodeDblClick(event: MouseEvent, node: InternalNode) {\n const param = { event, node: node.internals.userNode, connectedEdges: getConnectedEdges([node], edges.value) };\n emits.miniMapNodeDoubleClick(param);\n emit('nodeDblclick', param);\n}\n\nfunction onNodeMouseEnter(event: MouseEvent, node: InternalNode) {\n const param = { event, node: node.internals.userNode, connectedEdges: getConnectedEdges([node], edges.value) };\n emits.miniMapNodeMouseEnter(param);\n emit('nodeMouseenter', param);\n}\n\nfunction onNodeMouseMove(event: MouseEvent, node: InternalNode) {\n const param = { event, node: node.internals.userNode, connectedEdges: getConnectedEdges([node], edges.value) };\n emits.miniMapNodeMouseMove(param);\n emit('nodeMousemove', param);\n}\n\nfunction onNodeMouseLeave(event: MouseEvent, node: InternalNode) {\n const param = { event, node: node.internals.userNode, connectedEdges: getConnectedEdges([node], edges.value) };\n emits.miniMapNodeMouseLeave(param);\n emit('nodeMouseleave', param);\n}\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'MiniMap',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <Panel :class=\"{ pannable, zoomable }\" :position=\"position\" class=\"vue-flow__minimap\">\n <svg\n ref=\"el\"\n :width=\"elementWidth\"\n :height=\"elementHeight\"\n :viewBox=\"[viewBox.x, viewBox.y, viewBox.width, viewBox.height].join(' ')\"\n :aria-labelledby=\"`vue-flow__minimap-${id}`\"\n role=\"img\"\n @click=\"onSvgClick\"\n >\n <title v-if=\"resolvedAriaLabel\" :id=\"`vue-flow__minimap-${id}`\">{{ resolvedAriaLabel }}</title>\n\n <!-- v-memo on the lookup entry: unchanged nodes keep their InternalNode reference across commits\n (checkEquality reuse), so drag/pan-frame MiniMap re-renders skip every untouched child instead of\n re-rendering all of them (the inline per-node prop objects/calls would otherwise always patch). The\n node*Func RESULTS are in the deps (not the fn refs) so a recolor driven by an external reactive dep\n read inside a `nodeColor`/`nodeStrokeColor`/`nodeClassName` callback still re-renders the affected\n node — memoizing the fn refs froze the color until the node itself changed -->\n <MiniMapNode\n v-for=\"node of minimapNodes\"\n :id=\"node.id\"\n :key=\"node.id\"\n v-memo=\"[node, nodeClassNameFunc(node), nodeColorFunc(node), nodeStrokeColorFunc(node), nodeBorderRadius, nodeStrokeWidth, shapeRendering]\"\n :position=\"node.internals.positionAbsolute\"\n :dimensions=\"getNodeDimensions(node)\"\n :selected=\"node.selected\"\n :dragging=\"node.dragging\"\n :style=\"node.style\"\n :class=\"nodeClassNameFunc(node)\"\n :color=\"nodeColorFunc(node)\"\n :border-radius=\"nodeBorderRadius\"\n :stroke-color=\"nodeStrokeColorFunc(node)\"\n :stroke-width=\"nodeStrokeWidth\"\n :shape-rendering=\"shapeRendering\"\n :type=\"node.type\"\n :hidden=\"node.hidden\"\n @click=\"onNodeClick($event, node)\"\n @dblclick=\"onNodeDblClick($event, node)\"\n @mouseenter=\"onNodeMouseEnter($event, node)\"\n @mousemove=\"onNodeMouseMove($event, node)\"\n @mouseleave=\"onNodeMouseLeave($event, node)\"\n />\n\n <path\n :d=\"d\"\n :fill=\"maskColor\"\n :stroke=\"maskStrokeColor\"\n :stroke-width=\"maskStrokeWidth\"\n class=\"vue-flow__minimap-mask\"\n fill-rule=\"evenodd\"\n />\n </svg>\n </Panel>\n</template>\n","import type { ControlPosition } from './types';\nimport { ResizeControlVariant } from './types';\n\nexport const DefaultPositions: Record<ResizeControlVariant, ControlPosition> = {\n [ResizeControlVariant.Line]: 'right',\n [ResizeControlVariant.Handle]: 'bottom-right',\n};\n\nexport const StylingProperty = {\n [ResizeControlVariant.Line]: 'borderColor',\n [ResizeControlVariant.Handle]: 'backgroundColor',\n};\n","<script lang=\"ts\" setup>\nimport type { NodeDimensionChange, NodePositionChange } from '@xyflow/system';\nimport type { NodeChange } from '../../types';\nimport type { NodeResizerEmits, ResizeControlProps } from './types';\nimport { evaluateAbsolutePosition, handleExpandParent, XYResizer } from '@xyflow/system';\nimport { computed, shallowRef, toRef, watchEffect } from 'vue';\nimport { storeToRefs, useStore, useVueFlow } from '../../composables';\nimport { ResizeControlVariant } from './types';\nimport { DefaultPositions, StylingProperty } from './utils';\n\nconst props = withDefaults(defineProps<ResizeControlProps>(), {\n variant: 'handle' as ResizeControlVariant,\n minWidth: 10,\n minHeight: 10,\n maxWidth: Number.MAX_VALUE,\n maxHeight: Number.MAX_VALUE,\n keepAspectRatio: false,\n autoScale: true,\n});\n\nconst emits = defineEmits<NodeResizerEmits>();\n\nconst { emits: triggerEmits, viewport } = useVueFlow();\n\nconst { nodeLookup, parentLookup } = useStore();\n\nconst { transform, nodeOrigin, snapGrid, snapToGrid, vueFlowRef, noDragClassName } = storeToRefs(useStore());\n\nconst resizeControlRef = shallowRef<HTMLDivElement>();\n\nconst controlPosition = toRef(() => props.position ?? DefaultPositions[props.variant]);\n\nconst positionClassNames = computed(() => controlPosition.value.split('-'));\n\nconst controlStyle = toRef(() => (props.color ? { [StylingProperty[props.variant]]: props.color } : {}));\n\nwatchEffect((onCleanup) => {\n if (!resizeControlRef.value || !props.nodeId) {\n return;\n }\n\n const resizerInstance = XYResizer({\n domNode: resizeControlRef.value,\n nodeId: props.nodeId,\n getStoreItems: () => ({\n nodeLookup,\n transform: transform.value,\n snapGrid: snapGrid.value,\n snapToGrid: snapToGrid.value,\n nodeOrigin: nodeOrigin.value,\n paneDomNode: vueFlowRef.value,\n }),\n onChange: (changes, childChanges) => {\n const nodeChanges: NodeChange[] = [];\n const node = nodeLookup.get(props.nodeId!);\n\n // resolved x/y for the resized node; clamped below when the node expands its parent\n let nextX = changes.x;\n let nextY = changes.y;\n\n if (node?.expandParent && node.parentId) {\n const origin = node.origin ?? nodeOrigin.value;\n const width = changes.width ?? node.measured.width ?? 0;\n const height = changes.height ?? node.measured.height ?? 0;\n\n // grow the parent to fit the resized child (mirrors xyflow/react's NodeResizeControl)\n const child = {\n id: node.id,\n parentId: node.parentId,\n rect: {\n width,\n height,\n ...evaluateAbsolutePosition(\n { x: changes.x ?? node.position.x, y: changes.y ?? node.position.y },\n { width, height },\n node.parentId,\n nodeLookup,\n origin,\n ),\n },\n };\n\n nodeChanges.push(...(handleExpandParent([child], nodeLookup, parentLookup, nodeOrigin.value) as NodeChange[]));\n\n // once the parent was expanded, the child clamps to the parent's edge (0,0 for origin [0,0],\n // width/height for [1,1]).\n nextX = typeof changes.x !== 'undefined' ? Math.max(origin[0] * width, changes.x) : undefined;\n nextY = typeof changes.y !== 'undefined' ? Math.max(origin[1] * height, changes.y) : undefined;\n }\n\n if (typeof nextX !== 'undefined' || typeof nextY !== 'undefined') {\n const position = {\n x: nextX ?? node?.position.x ?? 0,\n y: nextY ?? node?.position.y ?? 0,\n };\n nodeChanges.push({\n id: props.nodeId!,\n type: 'position',\n position,\n positionAbsolute: position,\n } as NodePositionChange);\n }\n\n if (typeof changes.width !== 'undefined' || typeof changes.height !== 'undefined') {\n nodeChanges.push({\n id: props.nodeId!,\n type: 'dimensions',\n setAttributes: true,\n resizing: true,\n dimensions: {\n width: changes.width ?? 0,\n height: changes.height ?? 0,\n },\n } as NodeDimensionChange);\n }\n\n for (const child of childChanges) {\n nodeChanges.push({\n id: child.id,\n type: 'position',\n position: child.position,\n positionAbsolute: child.position,\n } as NodePositionChange);\n }\n\n if (nodeChanges.length) {\n triggerEmits.nodesChange(nodeChanges);\n }\n },\n onEnd: ({ width, height }) => {\n triggerEmits.nodesChange([\n {\n id: props.nodeId!,\n type: 'dimensions',\n resizing: false,\n dimensions: { width, height },\n } as NodeDimensionChange,\n ]);\n },\n });\n\n resizerInstance.update({\n controlPosition: controlPosition.value,\n boundaries: {\n minWidth: props.minWidth,\n minHeight: props.minHeight,\n maxWidth: props.maxWidth,\n maxHeight: props.maxHeight,\n },\n keepAspectRatio: Boolean(props.keepAspectRatio ?? false),\n onResizeStart: (event, params) => emits('resizeStart', { event, params }),\n onResize: (event, params) => emits('resize', { event, params }),\n onResizeEnd: (event, params) => emits('resizeEnd', { event, params }),\n shouldResize: props.shouldResize,\n });\n\n onCleanup(() => {\n resizerInstance.destroy();\n });\n});\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'ResizeControl',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <div\n ref=\"resizeControlRef\"\n class=\"vue-flow__resize-control\"\n :class=\"[...positionClassNames, variant, noDragClassName]\"\n :style=\"{\n ...controlStyle,\n // keep handle controls from shrinking below their base size when zooming out; `autoScale` opts out\n scale: variant === ResizeControlVariant.Handle && autoScale ? `${Math.max(1 / viewport.zoom, 1)}` : undefined,\n }\"\n >\n <slot />\n </div>\n</template>\n","<script lang=\"ts\" setup>\nimport type { NodeDimensionChange } from '@xyflow/system';\nimport type { ControlLinePosition, ControlPosition, NodeResizerEmits, NodeResizerProps } from './types';\nimport { getNodeDimensions } from '@xyflow/system';\nimport { computed, inject, toRef, watch } from 'vue';\nimport { useVueFlow } from '../../composables';\nimport { NodeId } from '../../context';\nimport ResizeControl from './ResizeControl.vue';\nimport { ResizeControlVariant } from './types';\n\nconst props = withDefaults(defineProps<NodeResizerProps>(), {\n isVisible: true,\n autoScale: true,\n});\n\nconst emits = defineEmits<NodeResizerEmits>();\n\nconst { getInternalNode, emits: triggerEmits } = useVueFlow();\n\nconst handleControls: ControlPosition[] = ['top-left', 'top-right', 'bottom-left', 'bottom-right'];\n\nconst lineControls: ControlLinePosition[] = ['top', 'right', 'bottom', 'left'];\n\nconst contextNodeId = inject(NodeId, null);\n\nconst nodeId = toRef(() => (typeof props.nodeId === 'string' ? props.nodeId : contextNodeId ?? undefined));\n\nconst node = computed(() => getInternalNode(nodeId.value));\n\nwatch(\n [\n () => props.minWidth,\n () => props.minHeight,\n () => props.maxWidth,\n () => props.maxHeight,\n () => !!node.value?.measured.width && !!node.value.measured.height,\n ],\n ([minWidth, minHeight, maxWidth, maxHeight, isInitialized]) => {\n const n = node.value;\n\n if (n && isInitialized) {\n const dimensions = getNodeDimensions(n);\n\n const dimensionChange: NodeDimensionChange = {\n id: n.id,\n type: 'dimensions',\n setAttributes: true,\n dimensions: {\n width: dimensions.width,\n height: dimensions.height,\n },\n };\n\n if (minWidth && dimensions.width < minWidth) {\n dimensionChange.dimensions!.width = minWidth;\n }\n\n if (minHeight && dimensions.height < minHeight) {\n dimensionChange.dimensions!.height = minHeight;\n }\n\n if (maxWidth && dimensions.width > maxWidth) {\n dimensionChange.dimensions!.width = maxWidth;\n }\n\n if (maxHeight && dimensions.height > maxHeight) {\n dimensionChange.dimensions!.height = maxHeight;\n }\n\n if (dimensionChange.dimensions!.width !== n.measured.width || dimensionChange.dimensions!.height !== n.measured.height) {\n triggerEmits.nodesChange([dimensionChange]);\n }\n }\n },\n { flush: 'post', immediate: true },\n);\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'NodeResizer',\n compatConfig: { MODE: 3 },\n inheritAttrs: false,\n};\n</script>\n\n<template>\n <template v-if=\"isVisible\">\n <ResizeControl\n v-for=\"c of lineControls\"\n :key=\"c\"\n :class=\"lineClassName\"\n :style=\"lineStyle\"\n :node-id=\"nodeId\"\n :position=\"c\"\n :variant=\"ResizeControlVariant.Line\"\n :color=\"color\"\n :min-width=\"minWidth\"\n :min-height=\"minHeight\"\n :max-width=\"maxWidth\"\n :max-height=\"maxHeight\"\n :should-resize=\"shouldResize\"\n :keep-aspect-ratio=\"keepAspectRatio\"\n :auto-scale=\"autoScale\"\n @resize-start=\"emits('resizeStart', $event)\"\n @resize=\"emits('resize', $event)\"\n @resize-end=\"emits('resizeEnd', $event)\"\n />\n\n <ResizeControl\n v-for=\"c of handleControls\"\n :key=\"c\"\n :class=\"handleClassName\"\n :style=\"handleStyle\"\n :node-id=\"nodeId\"\n :position=\"c\"\n :color=\"color\"\n :min-width=\"minWidth\"\n :min-height=\"minHeight\"\n :max-width=\"maxWidth\"\n :max-height=\"maxHeight\"\n :should-resize=\"shouldResize\"\n :keep-aspect-ratio=\"keepAspectRatio\"\n :auto-scale=\"autoScale\"\n @resize-start=\"emits('resizeStart', $event)\"\n @resize=\"emits('resize', $event)\"\n @resize-end=\"emits('resizeEnd', $event)\"\n />\n </template>\n</template>\n","<script lang=\"ts\" setup>\nimport type { CSSProperties } from 'vue';\nimport type { InternalNode } from '../../types';\nimport type { NodeToolbarProps } from './types';\nimport { getNodesBounds, getNodeToolbarTransform, Position } from '@xyflow/system';\nimport { computed, inject } from 'vue';\nimport { storeToRefs, useStore, useVueFlow } from '../../composables';\nimport { NodeId } from '../../context';\n\nconst props = withDefaults(defineProps<NodeToolbarProps>(), {\n position: Position.Top,\n offset: 10,\n align: 'center',\n isVisible: undefined,\n});\n\nconst contextNodeId = inject(NodeId, null);\n\nconst { viewport, getSelectedNodes, getInternalNode } = useVueFlow();\n\nconst { nodeLookup } = useStore();\n\nconst { viewportRef } = storeToRefs(useStore());\n\nconst nodes = computed(() => {\n const nodeIds = Array.isArray(props.nodeId) ? props.nodeId : [props.nodeId || contextNodeId || ''];\n\n return nodeIds.reduce<InternalNode[]>((acc, id) => {\n const node = getInternalNode(id);\n\n if (node) {\n acc.push(node);\n }\n\n return acc;\n }, [] as InternalNode[]);\n});\n\nconst isActive = computed(() =>\n typeof props.isVisible === 'boolean'\n ? props.isVisible\n : nodes.value.length === 1 && nodes.value[0].selected && getSelectedNodes.value.length === 1,\n);\n\nconst nodeRect = computed(() => getNodesBounds(nodes.value, { nodeLookup }));\n\nconst zIndex = computed(() => Math.max(...nodes.value.map(node => (node.internals.z || 1) + 1)));\n\nconst wrapperStyle = computed<CSSProperties>(() => ({\n position: 'absolute',\n transform: getNodeToolbarTransform(nodeRect.value, viewport.value, props.position, props.offset, props.align),\n zIndex: zIndex.value,\n}));\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'NodeToolbar',\n compatConfig: { MODE: 3 },\n inheritAttrs: false,\n};\n</script>\n\n<template>\n <Teleport :to=\"viewportRef\" :disabled=\"!viewportRef\">\n <div v-if=\"isActive && nodes.length\" v-bind=\"$attrs\" :style=\"wrapperStyle\" class=\"vue-flow__node-toolbar\">\n <slot />\n </div>\n </Teleport>\n</template>\n","import type { ComputedRef } from 'vue';\nimport type { ConnectionState, InternalNode, Node } from '../types';\nimport { computed } from 'vue';\nimport { storeToRefs } from './storeToRefs';\nimport { useStore } from './useStore';\nimport { useVueFlow } from './useVueFlow';\n\nconst NO_CONNECTION = Object.freeze({\n inProgress: false,\n isValid: null,\n from: null,\n fromHandle: null,\n fromPosition: null,\n fromNode: null,\n to: null,\n toHandle: null,\n toPosition: null,\n toNode: null,\n pointer: null,\n} as const);\n\n/**\n * Access the currently ongoing connection, composed from the store's split connection fields into a\n * single {@link ConnectionState}.\n *\n * @public\n * @returns a `ComputedRef<ConnectionState>` — `inProgress: false` (all-null fields) when idle\n */\nexport function useConnection<NodeType extends Node = Node>(): ComputedRef<ConnectionState<NodeType>> {\n const { getInternalNode } = useVueFlow();\n const { connectionStartHandle, connectionEndHandle, connectionPosition, connectionStatus } = storeToRefs(useStore<NodeType>());\n\n return computed<ConnectionState<NodeType>>(() => {\n const fromHandle = connectionStartHandle.value;\n const fromNode = fromHandle ? getInternalNode(fromHandle.nodeId) : undefined;\n\n // no connection (or its source node vanished) → the resting state\n if (!fromHandle || !fromNode) {\n return NO_CONNECTION;\n }\n\n const toHandle = connectionEndHandle.value;\n const pointer = connectionPosition.value;\n\n return {\n inProgress: true,\n isValid: connectionStatus.value === null ? null : connectionStatus.value === 'valid',\n from: { x: fromHandle.x, y: fromHandle.y },\n fromHandle,\n fromPosition: fromHandle.position,\n fromNode: fromNode as InternalNode<NodeType>,\n // `to` snaps to the hovered end handle; falls back to the raw pointer when over empty canvas\n to: toHandle ? { x: toHandle.x, y: toHandle.y } : pointer,\n toHandle: toHandle ?? null,\n toPosition: toHandle?.position ?? null,\n toNode: ((toHandle ? getInternalNode(toHandle.nodeId) : undefined) ?? null) as InternalNode<NodeType> | null,\n pointer,\n };\n });\n}\n","import type { ComputedRef, MaybeRefOrGetter } from 'vue';\nimport type { Edge } from '../types';\nimport { computed, toValue } from 'vue';\nimport { warn } from '../utils';\nimport { useVueFlow } from './useVueFlow';\n\ninterface EdgeData<EdgeType extends Edge = Edge> {\n id: string;\n type: EdgeType['type'];\n data: NonNullable<EdgeType['data']> | null;\n}\n\n/**\n * Composable for receiving data of one or multiple nodes\n *\n * @public\n * @param edgeId - The id (or ids) of the node to get the data from\n * @param guard - Optional guard function to narrow down the node type\n * @returns An array of data objects\n */\nexport function useEdgesData<EdgeType extends Edge = Edge>(\n edgeId: MaybeRefOrGetter<string>,\n): ComputedRef<EdgeData<EdgeType> | null>;\nexport function useEdgesData<EdgeType extends Edge = Edge>(edgeIds: MaybeRefOrGetter<string[]>): ComputedRef<EdgeData<EdgeType>[]>;\nexport function useEdgesData<EdgeType extends Edge = Edge>(\n edgeIds: MaybeRefOrGetter<string[]>,\n guard: (node: Edge) => node is EdgeType,\n): ComputedRef<EdgeData<EdgeType>[]>;\nexport function useEdgesData(_edgeIds: any): any {\n const { getEdge } = useVueFlow();\n\n return computed({\n get() {\n const edgeIds = toValue(_edgeIds);\n\n if (!Array.isArray(edgeIds)) {\n const edge = getEdge(edgeIds);\n\n if (edge) {\n return {\n id: edge.id,\n type: edge.type,\n data: edge.data ?? null,\n };\n }\n\n return null;\n }\n\n const data: EdgeData<Edge>[] = [];\n\n for (const edgeId of edgeIds) {\n const edge = getEdge(edgeId);\n\n if (edge) {\n data.push({\n id: edge.id,\n type: edge.type,\n data: edge.data ?? null,\n });\n }\n }\n\n return data;\n },\n set() {\n // noop\n warn('You are trying to set edge data via useEdgesData. This is not supported.');\n },\n });\n}\n","import type { HandleType, NodeConnection } from '@xyflow/system';\nimport type { MaybeRefOrGetter } from 'vue';\nimport { areConnectionMapsEqual, handleConnectionChange } from '@xyflow/system';\nimport { computed, shallowRef, toValue, watch } from 'vue';\nimport { useNodeId } from './useNodeId';\nimport { useStore } from './useStore';\n\nexport type UseNodeConnectionsParams = {\n /** node id - if not provided, the node id from the `useNodeId` context injection is used */\n id?: MaybeRefOrGetter<string | null | undefined>;\n onConnect?: (connections: NodeConnection[]) => void;\n onDisconnect?: (connections: NodeConnection[]) => void;\n} & (\n | {\n /** handle type `source` or `target` */\n handleType: MaybeRefOrGetter<HandleType | null | undefined>;\n /** the handle id (only needed if the node has multiple handles of the same type). Requires `handleType` to be set. */\n handleId?: MaybeRefOrGetter<string | null | undefined>;\n }\n // without `handleType` a `handleId` is meaningless at runtime, so the type forbids it (mirrors xyflow/react & xyflow/svelte)\n | { handleType?: MaybeRefOrGetter<HandleType | null | undefined>; handleId?: never }\n);\n\n/**\n * Hook to retrieve all edges connected to a node. Can be filtered by handle type and id.\n *\n * @public\n * @param params\n * @param params.handleType - handle type `source` or `target`\n * @param params.id - node id - if not provided, the node id from the `useNodeId` (meaning, the context-based injection) is used\n * @param params.handleId - the handle id (only needed if the node has multiple handles of the same type; requires `handleType` to be set)\n * @param params.onConnect - gets called when a connection is created\n * @param params.onDisconnect - gets called when a connection is removed\n *\n * @returns An array of connections\n */\nexport function useNodeConnections(params: UseNodeConnectionsParams = {}) {\n const { handleType, handleId, id, onConnect, onDisconnect } = params;\n\n const store = useStore();\n\n const nodeId = useNodeId();\n\n const prevConnections = shallowRef<Map<string, NodeConnection> | null>(null);\n\n const connections = shallowRef<Map<string, NodeConnection>>();\n\n const lookupKey = computed(() => {\n const currNodeId = toValue(id) ?? nodeId;\n const currentHandleType = toValue(handleType);\n const currHandleId = toValue(handleId);\n\n let handleSuffix = '';\n if (currentHandleType) {\n handleSuffix = currHandleId ? `-${currentHandleType}-${currHandleId}` : `-${currentHandleType}`;\n }\n\n return `${currNodeId}${handleSuffix}`;\n });\n\n watch(\n () => store.connectionLookup.get(lookupKey.value),\n (nextConnections) => {\n if (areConnectionMapsEqual(connections.value, nextConnections)) {\n return;\n }\n\n connections.value = nextConnections;\n },\n { immediate: true },\n );\n\n watch(\n [connections, () => typeof onConnect !== 'undefined', () => typeof onDisconnect !== 'undefined'],\n ([currentConnections = new Map<string, NodeConnection>()]) => {\n if (prevConnections.value && prevConnections.value !== currentConnections) {\n handleConnectionChange(prevConnections.value, currentConnections, onDisconnect);\n handleConnectionChange(currentConnections, prevConnections.value, onConnect);\n }\n\n prevConnections.value = currentConnections;\n },\n { immediate: true },\n );\n\n return computed(() => {\n if (!connections.value) {\n return [];\n }\n\n return Array.from(connections.value.values());\n });\n}\n","import type { DistributivePick } from '@xyflow/system';\nimport type { ComputedRef, MaybeRefOrGetter } from 'vue';\nimport type { InternalNode, Node } from '../types';\nimport { computed, toValue } from 'vue';\nimport { warn } from '../utils';\nimport { useVueFlow } from './useVueFlow';\n\n// `DistributivePick` (over `Pick`) distributes across a union `NodeType`, so the result is a discriminated\n// union — checking `.type` narrows `.data`. Mirrors xyflow/react & xyflow/svelte.\ntype NodeData<NodeType extends Node = InternalNode> = DistributivePick<NodeType, 'id' | 'type' | 'data'>;\n\n/**\n * Composable for receiving data of one or multiple nodes\n *\n * @public\n * @param nodeId - The id (or ids) of the node to get the data from\n * @param guard - Optional guard function to narrow down the node type\n * @returns An array of data objects\n */\nexport function useNodesData<NodeType extends Node = InternalNode>(\n nodeId: MaybeRefOrGetter<string>,\n): ComputedRef<NodeData<NodeType> | null>;\nexport function useNodesData<NodeType extends Node = InternalNode>(\n nodeIds: MaybeRefOrGetter<string[]>,\n): ComputedRef<NodeData<NodeType>[]>;\nexport function useNodesData<NodeType extends Node = InternalNode>(\n nodeIds: MaybeRefOrGetter<string[]>,\n guard: (node: Node) => node is NodeType,\n): ComputedRef<NodeData<NodeType>[]>;\nexport function useNodesData(_nodeIds: any): any {\n const { getNode } = useVueFlow();\n\n return computed({\n get() {\n const nodeIds = toValue(_nodeIds);\n\n if (!Array.isArray(nodeIds)) {\n const node = getNode(nodeIds);\n\n if (node) {\n return {\n id: node.id,\n type: node.type,\n data: node.data,\n };\n }\n\n return null;\n }\n\n const data: NodeData<Node>[] = [];\n\n for (const nodeId of nodeIds) {\n const node = getNode(nodeId);\n\n if (node) {\n data.push({\n id: node.id,\n type: node.type,\n data: node.data,\n });\n }\n }\n\n return data;\n },\n set() {\n // noop\n warn('You are trying to set node data via useNodesData. This is not supported.');\n },\n });\n}\n","import { computed } from 'vue';\nimport { areNodesInitialized } from '../utils';\nimport { useStore } from './useStore';\n\nexport interface UseNodesInitializedOptions {\n includeHiddenNodes?: boolean;\n}\n\n/**\n * Composable for getting the initialized state of all nodes.\n *\n * When a new node is added to the graph, it is not immediately initialized.\n * That's because the node's bounds are not yet known.\n * This composable will return false and then true when all nodes are initialized, i.e. when their bounds are known.\n *\n * @public\n * @param options - Options\n * @returns boolean indicating whether all nodes are initialized\n */\nexport function useNodesInitialized(options: UseNodesInitializedOptions = { includeHiddenNodes: false }) {\n const { nodeLookup } = useStore();\n\n return computed(() => areNodesInitialized(nodeLookup, options.includeHiddenNodes));\n}\n","<script lang=\"ts\" setup>\nimport { storeToRefs, useStore, useVueFlow } from '../../composables';\nimport { ARIA_EDGE_DESC_KEY, ARIA_LIVE_MESSAGE, ARIA_NODE_DESC_KEY } from '../../utils/a11y';\n\nconst { id } = useVueFlow();\nconst { disableKeyboardA11y, ariaLiveMessage, ariaLabelConfig } = storeToRefs(useStore());\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'A11yDescriptions',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <div :id=\"`${ARIA_NODE_DESC_KEY}-${id}`\" style=\"display: none\">\n {{\n disableKeyboardA11y\n ? ariaLabelConfig['node.a11yDescription.default']\n : ariaLabelConfig['node.a11yDescription.keyboardDisabled']\n }}\n </div>\n\n <div :id=\"`${ARIA_EDGE_DESC_KEY}-${id}`\" style=\"display: none\">\n {{ ariaLabelConfig['edge.a11yDescription.default'] }}\n </div>\n\n <div\n v-if=\"!disableKeyboardA11y\"\n :id=\"`${ARIA_LIVE_MESSAGE}-${id}`\"\n aria-live=\"assertive\"\n aria-atomic=\"true\"\n style=\"\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n border: 0;\n padding: 0;\n overflow: hidden;\n clip: rect(0px, 0px, 0px, 0px);\n clip-path: inset(100%);\n \"\n >\n {{ ariaLiveMessage }}\n </div>\n</template>\n","import type { Edge, FlowEvents, FlowHooks, Node } from '../types';\nimport { getCurrentInstance, onBeforeMount, onScopeDispose } from 'vue';\nimport { createExtendedEventHook, warn } from '../utils';\n\nexport function createHooks<NodeType extends Node = Node, EdgeType extends Edge = Edge>(): FlowHooks<NodeType, EdgeType> {\n return {\n edgesChange: createExtendedEventHook(),\n nodesChange: createExtendedEventHook(),\n nodeDoubleClick: createExtendedEventHook(),\n nodeClick: createExtendedEventHook(),\n nodeMouseEnter: createExtendedEventHook(),\n nodeMouseMove: createExtendedEventHook(),\n nodeMouseLeave: createExtendedEventHook(),\n nodeContextMenu: createExtendedEventHook(),\n nodeDragStart: createExtendedEventHook(),\n nodeDrag: createExtendedEventHook(),\n nodeDragStop: createExtendedEventHook(),\n nodesInitialized: createExtendedEventHook(),\n miniMapNodeClick: createExtendedEventHook(),\n miniMapNodeDoubleClick: createExtendedEventHook(),\n miniMapNodeMouseEnter: createExtendedEventHook(),\n miniMapNodeMouseMove: createExtendedEventHook(),\n miniMapNodeMouseLeave: createExtendedEventHook(),\n connect: createExtendedEventHook(),\n connectStart: createExtendedEventHook(),\n connectEnd: createExtendedEventHook(),\n clickConnectStart: createExtendedEventHook(),\n clickConnectEnd: createExtendedEventHook(),\n init: createExtendedEventHook(),\n move: createExtendedEventHook(),\n moveStart: createExtendedEventHook(),\n moveEnd: createExtendedEventHook(),\n selectionDragStart: createExtendedEventHook(),\n selectionDrag: createExtendedEventHook(),\n selectionDragStop: createExtendedEventHook(),\n selectionContextMenu: createExtendedEventHook(),\n selectionStart: createExtendedEventHook(),\n selectionEnd: createExtendedEventHook(),\n selectionChange: createExtendedEventHook(),\n viewportChangeStart: createExtendedEventHook(),\n viewportChange: createExtendedEventHook(),\n viewportChangeEnd: createExtendedEventHook(),\n paneScroll: createExtendedEventHook(),\n paneClick: createExtendedEventHook(),\n paneContextMenu: createExtendedEventHook(),\n paneMouseEnter: createExtendedEventHook(),\n paneMouseMove: createExtendedEventHook(),\n paneMouseLeave: createExtendedEventHook(),\n edgeContextMenu: createExtendedEventHook(),\n edgeMouseEnter: createExtendedEventHook(),\n edgeMouseMove: createExtendedEventHook(),\n edgeMouseLeave: createExtendedEventHook(),\n edgeDoubleClick: createExtendedEventHook(),\n edgeClick: createExtendedEventHook(),\n reconnectStart: createExtendedEventHook(),\n reconnect: createExtendedEventHook(),\n reconnectEnd: createExtendedEventHook(),\n updateNodeInternals: createExtendedEventHook(),\n error: createExtendedEventHook(err => warn(err.message)),\n };\n}\n\nexport function useHooks<NodeType extends Node = Node, EdgeType extends Edge = Edge>(\n emit: (...args: any[]) => void,\n hooks: FlowHooks<NodeType, EdgeType>,\n) {\n const inst = getCurrentInstance();\n onBeforeMount(() => {\n for (const [key, value] of Object.entries(hooks)) {\n const listener = (data: unknown) => {\n emit(key, data);\n };\n\n // push into fns instead of using `on` to avoid overwriting default handlers - the emitter should be called in addition to the default handlers\n value.setEmitter(listener);\n onScopeDispose(value.removeEmitter, true);\n\n value.setHasEmitListeners(() => hasVNodeListener(key as keyof FlowEvents));\n onScopeDispose(value.removeHasEmitListeners, true);\n }\n });\n\n function hasVNodeListener(event: keyof FlowEvents) {\n const key = toHandlerKey(event);\n // listeners live on vnode.props; value can be a Function or an array of Functions\n const h = inst?.vnode.props?.[key];\n return !!h;\n }\n}\n\n/**\n * Converts an event name to the corresponding handler key.\n * E.g. 'nodeClick' -> 'onNodeClick'\n *\n * @param event The event name to convert.\n * @returns The corresponding handler key.\n */\nfunction toHandlerKey(event: string) {\n const [head, ...rest] = event.split(':');\n const camel = head.replace(/(?:^|-)(\\w)/g, (_, c: string) => c.toUpperCase());\n return `on${camel}${rest.length ? `:${rest.join(':')}` : ''}`;\n}\n","import type { Edge, FlowProps, Node, State } from '../types';\nimport { ConnectionLineType, ConnectionMode, isMacOs, mergeAriaLabelConfig, PanOnScrollMode, SelectionMode } from '@xyflow/system';\n\nimport { createHooks } from './hooks';\n\nexport function useState<NodeType extends Node = Node, EdgeType extends Edge = Edge>(): State<NodeType, EdgeType> {\n return {\n vueFlowRef: null,\n viewportRef: null,\n nodes: [],\n edges: [],\n nodeLookup: new Map(),\n parentLookup: new Map(),\n edgeLookup: new Map(),\n connectionLookup: new Map(),\n nodeTypes: {},\n edgeTypes: {},\n\n initialized: false,\n\n dimensions: {\n width: 0,\n height: 0,\n },\n transform: [0, 0, 1],\n\n panZoom: null,\n\n minZoom: 0.5,\n maxZoom: 2,\n\n translateExtent: [\n [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY],\n [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY],\n ],\n nodeExtent: [\n [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY],\n [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY],\n ],\n nodeOrigin: [0, 0],\n\n selectionMode: SelectionMode.Full,\n paneDragging: false,\n preventScrolling: true,\n zoomOnScroll: true,\n zoomOnPinch: true,\n zoomOnDoubleClick: true,\n panOnScroll: false,\n panOnScrollSpeed: 0.5,\n panOnScrollMode: PanOnScrollMode.Free,\n paneClickDistance: 0,\n nodeClickDistance: 0,\n panOnDrag: true,\n reconnectRadius: 10,\n onlyRenderVisibleElements: false,\n defaultViewport: { x: 0, y: 0, zoom: 1 },\n\n nodesSelectionActive: false,\n userSelectionActive: false,\n\n userSelectionRect: null,\n\n defaultMarkerColor: '#b1b1b7',\n connectionLineOptions: {\n type: ConnectionLineType.Bezier,\n style: {},\n },\n connectionMode: ConnectionMode.Strict,\n connectionStartHandle: null,\n connectionEndHandle: null,\n connectionClickStartHandle: null,\n connectionPosition: { x: Number.NaN, y: Number.NaN },\n connectionRadius: 20,\n connectionDragThreshold: 1,\n connectOnClick: true,\n connectionStatus: null,\n isValidConnection: null,\n onBeforeDelete: null,\n\n snapGrid: [15, 15],\n snapToGrid: false,\n\n edgesReconnectable: false,\n edgesFocusable: true,\n nodesFocusable: true,\n nodesConnectable: true,\n nodesDraggable: true,\n nodeDragThreshold: 1,\n elementsSelectable: true,\n selectNodesOnDrag: true,\n multiSelectionActive: false,\n selectionKeyCode: 'Shift',\n selectionOnDrag: false,\n multiSelectionKeyCode: isMacOs() ? 'Meta' : 'Control',\n zoomActivationKeyCode: isMacOs() ? 'Meta' : 'Control',\n deleteKeyCode: 'Backspace',\n panActivationKeyCode: 'Space',\n\n hooks: createHooks(),\n\n autoApplyChanges: true,\n autoConnect: false,\n\n fitViewOnInit: false,\n fitViewOnInitDone: false,\n\n noDragClassName: 'nodrag',\n noWheelClassName: 'nowheel',\n noPanClassName: 'nopan',\n defaultEdgeOptions: undefined,\n elevateEdgesOnSelect: false,\n elevateNodesOnSelect: true,\n zIndexMode: 'basic',\n\n autoPanOnNodeDrag: true,\n autoPanOnConnect: true,\n autoPanOnNodeFocus: true,\n autoPanOnSelection: true,\n autoPanSpeed: 15,\n\n disableKeyboardA11y: false,\n ariaLabelConfig: mergeAriaLabelConfig(),\n ariaLiveMessage: '',\n };\n}\n\n// these options will be set using the appropriate methods\nexport const storeOptionsToSkip: (keyof Partial<FlowProps & Omit<State, 'nodes' | 'edges'>>)[] = [\n 'id',\n 'vueFlowRef',\n 'viewportRef',\n 'initialized',\n 'nodes',\n 'edges',\n 'maxZoom',\n 'minZoom',\n 'translateExtent',\n 'nodeExtent',\n 'fitView',\n // mapped from the `fitView` prop in `setState`; keep the generic option loop from re-applying the\n // default — the full state is spread into `setState` on store creation, so a stale `fitViewOnInit: false`\n // would otherwise clobber the value `fitView` just set, leaving `:fit-view` inert.\n 'fitViewOnInit',\n 'viewport',\n 'hooks',\n 'defaultEdgeOptions',\n];\n","import type {\n EdgeRemoveChange,\n EdgeSelectionChange,\n NodeDimensionChange,\n NodePositionChange,\n NodeRemoveChange,\n Rect,\n} from '@xyflow/system';\nimport type {\n Actions,\n Edge,\n EdgeAddChange,\n EdgeLookup,\n InternalNode,\n Node,\n NodeAddChange,\n NodeLookup,\n State,\n} from '../types';\nimport {\n clampPosition,\n clampPositionToParent,\n getConnectedEdges as getConnectedEdgesBase,\n getDimensions,\n getElementsToRemove,\n getHandleBounds,\n getOverlappingArea,\n handleExpandParent,\n isRectObject,\n nodeToRect,\n panBy as panBySystem,\n updateAbsolutePositions,\n} from '@xyflow/system';\nimport { computed, markRaw, toRaw } from 'vue';\nimport { useViewportHelper } from '../composables';\nimport {\n adoptNodes,\n applyChanges,\n createAdditionChange,\n createEdgeRemoveChange,\n createNodeRemoveChange,\n createSelectionChange,\n getSelectionChanges,\n isDef,\n isInternalNode,\n isNode,\n reconnectEdgeAction,\n updateConnectionLookup,\n validateEdges,\n} from '../utils';\nimport { storeOptionsToSkip, useState } from './state';\n\nexport function useActions<NodeType extends Node = Node, EdgeType extends Edge = Edge>(\n state: State<NodeType, EdgeType>,\n nodeLookup: NodeLookup<NodeType>,\n parentLookup: Map<string, Map<string, InternalNode<NodeType>>>,\n edgeLookup: EdgeLookup<EdgeType>,\n): Actions<NodeType, EdgeType> {\n const viewportHelper = useViewportHelper(state, nodeLookup);\n\n // The system-facing twins of the reactive lookups. `@xyflow/system`'s `adoptUserNodes` re-adopts by\n // clearing + refilling the lookup it's given — on a `reactive(Map)` that's an O(n) trigger storm per\n // call (`clear()` invalidates every key and iteration subscriber, every drag frame). Adoption and\n // recompute therefore run against these plain Maps (which also persist across adoptions, keeping\n // `checkEquality` reuse intact); `syncLookups` then mirrors the result into the reactive lookups with\n // targeted `.set`/`.delete`, so only entries whose `InternalNode` reference actually changed trigger —\n // per-frame render invalidation stays O(changed) instead of O(n).\n const systemNodeLookup: NodeLookup<NodeType> = new Map();\n const systemParentLookup: Map<string, Map<string, InternalNode<NodeType>>> = new Map();\n\n function sameMapEntries<K, V>(a: Map<K, V>, b: Map<K, V>) {\n if (a.size !== b.size) {\n return false;\n }\n\n for (const [key, value] of a) {\n if (b.get(key) !== value) {\n return false;\n }\n }\n\n return true;\n }\n\n /** Mirror the system lookups into the reactive ones, touching only entries that actually changed. */\n function syncLookups() {\n const rawNodeLookup = toRaw(nodeLookup);\n\n for (const [id, internal] of systemNodeLookup) {\n if (rawNodeLookup.get(id) !== internal) {\n // `markRaw` exactly the entries that are new since the last sync — `adoptUserNodes` rebuilds\n // changed nodes as fresh plain objects and `updateAbsolutePositions` clones moved children, and\n // without the mark the reactive lookup would deep-proxy them on read. The per-node render\n // computed still re-renders on the `.set` (key-level reactivity is independent of value markRaw).\n nodeLookup.set(id, markRaw(internal));\n }\n }\n\n if (rawNodeLookup.size !== systemNodeLookup.size) {\n for (const id of rawNodeLookup.keys()) {\n if (!systemNodeLookup.has(id)) {\n nodeLookup.delete(id);\n }\n }\n }\n\n // adoption rebuilds every nested child-map instance, so compare content — blindly re-setting an\n // unchanged entry would re-trigger every `parentLookup` subscriber each frame\n const rawParentLookup = toRaw(parentLookup);\n\n for (const [parentId, children] of systemParentLookup) {\n const prev = rawParentLookup.get(parentId);\n if (!prev || !sameMapEntries(prev, children)) {\n parentLookup.set(parentId, children);\n }\n }\n\n if (rawParentLookup.size !== systemParentLookup.size) {\n for (const parentId of rawParentLookup.keys()) {\n if (!systemParentLookup.has(parentId)) {\n parentLookup.delete(parentId);\n }\n }\n }\n }\n\n /**\n * Single write path for node membership/content. Takes the canonical USER `Node`s, re-adopts them into\n * `nodeLookup`/`parentLookup` via `adoptNodes` (xyflow/react+svelte parity — `adoptUserNodes` mutates the\n * lookups in place, reusing unchanged `InternalNode`s by reference via `checkEquality`), then stores the\n * validated user nodes as `state.nodes` (the v-model array / `getNodes`). The enriched `InternalNode`s\n * live only in the lookup. `recomputeAbsolutePositions` refreshes parent-aware absolute positions/z.\n *\n * Because adoption is immutable+reference-based, callers MUST pass NEW user-node objects for changed\n * nodes (see the immutable `applyChanges`) — mutating a node in place keeps its reference, so\n * `checkEquality` would re-adopt the stale `InternalNode`.\n */\n function commitNodes(nodes: NodeType[]) {\n const { nodes: adopted, hasSelectedNodes } = adoptNodes(nodes, systemNodeLookup, systemParentLookup, state.hooks.error.trigger, {\n nodeOrigin: state.nodeOrigin,\n nodeExtent: state.nodeExtent,\n elevateNodesOnSelect: state.elevateNodesOnSelect,\n zIndexMode: state.zIndexMode,\n });\n\n state.nodes = adopted;\n\n // clear a stale visual selection box: `nodesSelectionActive` only ever turns on via a user drag-select,\n // so once the selection empties out (e.g. the selected nodes were deleted) it must turn back off — else\n // a later programmatic select would wrongly render the `NodesSelection` rect (xyflow/react #5727).\n state.nodesSelectionActive = state.nodesSelectionActive && hasSelectedNodes;\n\n recomputeAbsolutePositions();\n }\n\n /**\n * Single write path for edge membership (see {@link commitNodes}). Stores the USER edges verbatim\n * (`edgeLookup` values are the same references as the `state.edges` elements; no\n * enriched edge representation exists). `markRaw` at this choke point keeps edges out of Vue's deep\n * proxy: renders are driven by key-level lookup triggers + immutable replacement, like nodes.\n */\n function commitEdges(next: EdgeType[]) {\n // targeted sync instead of clear+refill: clearing a `reactive(Map)` invalidates every edge\n // subscriber even when a single edge changed\n const rawEdgeLookup = toRaw(edgeLookup);\n\n for (let i = 0; i < next.length; i++) {\n const edge = (next[i] = markRaw(toRaw(next[i])));\n if (rawEdgeLookup.get(edge.id) !== edge) {\n edgeLookup.set(edge.id, edge);\n }\n }\n\n if (rawEdgeLookup.size !== next.length) {\n const nextIds = new Set<string>();\n for (const edge of next) {\n nextIds.add(edge.id);\n }\n\n for (const id of rawEdgeLookup.keys()) {\n if (!nextIds.has(id)) {\n edgeLookup.delete(id);\n }\n }\n }\n\n state.edges = next;\n\n // the connection lookup derives 1:1 from the edges array — rebuilding it here keeps every write\n // path (setEdges/applyEdgeChanges/reconnectEdge/$reset) consistent by construction\n updateConnectionLookup(state.connectionLookup, state.edges);\n }\n\n /**\n * Recompute parent-aware `internals.positionAbsolute` on the system lookup, then mirror into the\n * reactive lookups (`syncLookups`). Lookup-only: there is NO write-back onto `state.nodes` — those hold\n * the raw user `Node`s. This replaces the per-node positionAbsolute watcher that used to live in\n * `NodeWrapper`.\n *\n * Adoption (`adoptUserNodes`) already computes clamped positions and `z` (via `calculateZ`, including\n * select-elevation) for every changed node, so the full `updateAbsolutePositions` pass only runs for\n * graphs with child nodes — or when `forceFullPass` says inputs changed without a re-adoption.\n */\n function recomputeAbsolutePositions(forceFullPass = false) {\n // `adoptUserNodes` already computed the clamped `positionAbsolute` + `z` for every changed node\n // (reused nodes keep their still-valid values) and cascades parented nodes inline, so after a commit\n // the full pass is only needed when child nodes exist — a moved parent must cascade to REUSED\n // children regardless of the user array's parent/child order. Callers that change inputs without\n // re-adopting (`setNodeExtent`) force it.\n if (forceFullPass || systemParentLookup.size > 0) {\n updateAbsolutePositions(systemNodeLookup, systemParentLookup, {\n nodeOrigin: state.nodeOrigin,\n nodeExtent: state.nodeExtent,\n elevateNodesOnSelect: state.elevateNodesOnSelect,\n zIndexMode: state.zIndexMode,\n });\n }\n\n syncLookups();\n }\n\n const updateNodeInternals: Actions<NodeType>['updateNodeInternals'] = (ids) => {\n const updateIds = ids ?? [];\n\n state.hooks.updateNodeInternals.trigger(updateIds);\n };\n\n const getConnectedEdges: Actions<NodeType, EdgeType>['getConnectedEdges'] = (nodes) => {\n return getConnectedEdgesBase(nodes, state.edges);\n };\n\n const getHandleConnections: Actions['getHandleConnections'] = ({ id, type, nodeId }) => {\n const handleSuffix = id ? `-${type}-${id}` : `-${type}`;\n return Array.from(state.connectionLookup.get(`${nodeId}${handleSuffix}`)?.values() ?? []);\n };\n\n const getNode: Actions<NodeType>['getNode'] = (id) => {\n if (!id) {\n return;\n }\n\n // The public contract: `getNode` returns the user-facing `Node` (the exact object held in\n // `state.nodes`/v-model), which the store keeps on the InternalNode as `internals.userNode`. Enriched\n // data (internals/measured) is reached via `getInternalNode`. Don't mutate the result in place — it\n // won't propagate; use the helpers (updateNode/applyNodeChanges/setNodes).\n return nodeLookup.get(id)?.internals.userNode as NodeType | undefined;\n };\n\n // The enriched-node accessor (xyflow/react parity): returns the lookup `InternalNode` (enriched\n // `internals`/`measured`), whereas `getNode` returns the user-facing `Node` (`internals.userNode`).\n // Internal call sites that need `internals`/`measured` use this.\n const getInternalNode: Actions<NodeType>['getInternalNode'] = (id) => {\n if (!id) {\n return;\n }\n\n return nodeLookup.get(id);\n };\n\n const getEdge: Actions<NodeType, EdgeType>['getEdge'] = (id) => {\n if (!id) {\n return;\n }\n\n return edgeLookup.get(id);\n };\n\n const updateNodePositions: Actions<NodeType>['updateNodePositions'] = (dragItems, changed, dragging) => {\n const changes: (NodePositionChange | NodeDimensionChange)[] = [];\n const parentExpandChildren: { id: string; parentId: string; rect: Rect }[] = [];\n\n for (const node of dragItems) {\n // read `expandParent`/`parentId` from the canonical node: drag items carry them, but keyboard-move\n // items (from `useUpdateNodePositions`) do not.\n const lookupNode = getNode(node.id);\n const expandParentId = lookupNode?.expandParent ? lookupNode.parentId : undefined;\n\n const change: NodePositionChange = {\n id: node.id,\n type: 'position',\n dragging,\n positionAbsolute: node.internals.positionAbsolute,\n };\n\n if (changed) {\n // drag items already carry the parent-RELATIVE position: XYDrag's `calculateNodePosition` and the\n // keyboard path's `calcNextPosition` both subtract the parent offset before handing items here.\n change.position = node.position;\n\n if (expandParentId) {\n // pin the child's relative position to >= 0; the parent grows to contain it instead\n // (xyflow/react clamps the same way before collecting the child for expansion).\n change.position = { x: Math.max(0, change.position.x), y: Math.max(0, change.position.y) };\n\n parentExpandChildren.push({\n id: node.id,\n parentId: expandParentId,\n rect: {\n ...node.internals.positionAbsolute,\n width: node.measured?.width ?? 0,\n height: node.measured?.height ?? 0,\n },\n });\n }\n }\n\n changes.push(change);\n }\n\n // grow each parent to fit its `expandParent` children — system returns the parent's position +\n // dimension changes plus counter-offsets for the other children, applied through the same pipeline.\n if (parentExpandChildren.length > 0) {\n changes.push(...handleExpandParent(parentExpandChildren, systemNodeLookup, systemParentLookup, state.nodeOrigin));\n }\n\n if (changes.length) {\n state.hooks.nodesChange.trigger(changes);\n }\n };\n\n const updateNodeDimensions: Actions<NodeType>['updateNodeDimensions'] = (updates) => {\n if (!state.vueFlowRef) {\n return;\n }\n\n const viewportNode = state.vueFlowRef.querySelector('.vue-flow__viewport') as HTMLElement;\n\n if (!viewportNode) {\n return;\n }\n\n const style = window.getComputedStyle(viewportNode);\n const { m22: zoom } = new window.DOMMatrixReadOnly(style.transform);\n\n const changes: (NodeDimensionChange | NodePositionChange)[] = [];\n const parentExpandChildren: { id: string; parentId: string; rect: Rect }[] = [];\n\n for (const element of updates) {\n const update = element;\n\n const node = getInternalNode(update.id);\n\n if (node) {\n const dimensions = getDimensions(update.nodeElement);\n\n const doUpdate = !!(\n dimensions.width\n && dimensions.height\n && (node.measured.width !== dimensions.width || node.measured.height !== dimensions.height || update.forceUpdate)\n );\n\n if (doUpdate) {\n const nodeBounds = update.nodeElement.getBoundingClientRect();\n node.measured = { width: dimensions.width, height: dimensions.height };\n if (!node.internals.handleBounds) {\n node.internals.handleBounds = { source: null, target: null };\n }\n node.internals.handleBounds.source = getHandleBounds('source', update.nodeElement, nodeBounds, zoom, node.id);\n node.internals.handleBounds.target = getHandleBounds('target', update.nodeElement, nodeBounds, zoom, node.id);\n\n changes.push({\n id: node.id,\n type: 'dimensions',\n dimensions,\n });\n\n // a freshly-measured `expandParent` child grows its parent to fit (mirrors system's own\n // `updateNodeDimensions`). Unlike the drag path (where the position is the user's target), here\n // the position is fixed and only the size grew — so re-clamp it against the NEW dimensions and\n // the node's extent BEFORE measuring expansion, exactly as system does. Otherwise a node that\n // merely grew would be treated as overflowing and the parent would expand more than necessary.\n if (node.expandParent && node.parentId) {\n const parent = getInternalNode(node.parentId);\n let positionAbsolute = node.internals.positionAbsolute;\n const extent = node.extent;\n\n if (extent === 'parent' && parent) {\n positionAbsolute = clampPositionToParent(positionAbsolute, dimensions, parent);\n }\n else if (Array.isArray(extent)) {\n positionAbsolute = clampPosition(positionAbsolute, extent, dimensions);\n }\n else {\n positionAbsolute = clampPosition(positionAbsolute, state.nodeExtent, dimensions);\n }\n\n parentExpandChildren.push({\n id: node.id,\n parentId: node.parentId,\n rect: { ...positionAbsolute, width: dimensions.width, height: dimensions.height },\n });\n }\n\n // Re-set a fresh entry so the markRaw lookup re-renders this node — in-place `measured`/\n // `handleBounds` writes don't trigger the per-node render computed (markRaw values aren't deep\n // tracked; only the lookup `.set` is). This makes measurement reflect even with `autoApplyChanges:false`\n // (the 'dimensions' change additionally flows `measured` onto the user node via re-adopt).\n // The fresh entry goes into BOTH maps: the system map is what `adoptUserNodes` reuses via\n // `checkEquality`, so leaving the old object there would let the maps' references diverge.\n const fresh = markRaw({ ...toRaw(node) });\n systemNodeLookup.set(node.id, fresh);\n nodeLookup.set(node.id, fresh);\n }\n }\n }\n\n if (parentExpandChildren.length > 0) {\n changes.push(...handleExpandParent(parentExpandChildren, systemNodeLookup, systemParentLookup, state.nodeOrigin));\n }\n\n // the initial `fitView` (the `fitView` prop) is handled reactively by `useFitViewOnInit`: it waits\n // for every node to be measured AND re-fits while the container is still settling — neither of which\n // a one-shot here (fired per measurement batch, against a partial/zero-bounds subset) could do.\n\n if (changes.length) {\n state.hooks.nodesChange.trigger(changes);\n }\n };\n\n const addSelectedNodes: Actions<NodeType>['addSelectedNodes'] = (nodes) => {\n if (state.multiSelectionActive) {\n const nodeChanges = nodes.map(node => createSelectionChange(node.id, true));\n state.hooks.nodesChange.trigger(nodeChanges);\n return;\n }\n\n state.hooks.nodesChange.trigger(getSelectionChanges(nodeLookup, new Set(nodes.map(n => n.id))));\n state.hooks.edgesChange.trigger(getSelectionChanges(edgeLookup));\n };\n\n const addSelectedEdges: Actions<NodeType, EdgeType>['addSelectedEdges'] = (edges) => {\n if (state.multiSelectionActive) {\n const changedEdges = edges.map(edge => createSelectionChange(edge.id, true));\n state.hooks.edgesChange.trigger(changedEdges as EdgeSelectionChange[]);\n return;\n }\n\n state.hooks.edgesChange.trigger(getSelectionChanges(edgeLookup, new Set(edges.map(e => e.id))));\n state.hooks.nodesChange.trigger(getSelectionChanges(nodeLookup, new Set()));\n };\n\n const removeSelectedNodes: Actions<NodeType>['removeSelectedNodes'] = (nodes) => {\n const nodesToUnselect = nodes || state.nodes;\n\n // Emit select=false changes only for nodes that ARE selected — skipping the rest avoids re-committing\n // (and re-rendering) every node on an unselect, e.g. on drag start with `selectNodesOnDrag: false`\n // (xyflow/react #5682). `applyNodeChanges` applies them immutably + re-adopts (no in-place\n // `n.selected = false`: it would keep the node's reference, so the re-adopt would reuse the stale entry).\n const nodeChanges = nodesToUnselect.filter(n => n.selected).map(n => createSelectionChange(n.id, false));\n\n if (nodeChanges.length) {\n state.hooks.nodesChange.trigger(nodeChanges);\n }\n };\n\n const removeSelectedEdges: Actions<NodeType, EdgeType>['removeSelectedEdges'] = (edges) => {\n const edgesToUnselect = edges || state.edges;\n\n const edgeChanges = edgesToUnselect.filter(e => e.selected).map(e => createSelectionChange(e.id, false));\n\n if (edgeChanges.length) {\n state.hooks.edgesChange.trigger(edgeChanges);\n }\n };\n\n const resetSelectedElements: Actions<NodeType, EdgeType>['resetSelectedElements'] = () => {\n // the interactive selection reset (used by a pane click): a no-op while selection is disabled, so a\n // selection made before `elementsSelectable` was turned off — or set programmatically — survives the\n // click (xyflow/react #5217). For unconditional clearing, call `removeSelectedNodes`/`removeSelectedEdges`\n // directly (the equivalent of xyflow/react's ungated `unselectNodesAndEdges`).\n if (!state.elementsSelectable) {\n return;\n }\n\n removeSelectedNodes();\n removeSelectedEdges();\n };\n\n const setMinZoom: Actions<NodeType>['setMinZoom'] = (minZoom) => {\n state.panZoom?.setScaleExtent([minZoom, state.maxZoom]);\n state.minZoom = minZoom;\n };\n\n const setMaxZoom: Actions<NodeType>['setMaxZoom'] = (maxZoom) => {\n state.panZoom?.setScaleExtent([state.minZoom, maxZoom]);\n state.maxZoom = maxZoom;\n };\n\n const setTranslateExtent: Actions<NodeType>['setTranslateExtent'] = (translateExtent) => {\n state.panZoom?.setTranslateExtent(translateExtent);\n state.translateExtent = translateExtent;\n };\n\n const setNodeExtent: Actions<NodeType>['setNodeExtent'] = (nodeExtent) => {\n state.nodeExtent = nodeExtent;\n // force the full system pass — the extent changed without a re-adoption, so every root needs re-clamping\n recomputeAbsolutePositions(true);\n updateNodeInternals();\n };\n\n const setPaneClickDistance: Actions<NodeType>['setPaneClickDistance'] = (clickDistance) => {\n state.panZoom?.setClickDistance(clickDistance);\n };\n\n const setInteractive: Actions<NodeType>['setInteractive'] = (isInteractive) => {\n state.nodesDraggable = isInteractive;\n state.nodesConnectable = isInteractive;\n state.elementsSelectable = isInteractive;\n };\n\n const setNodes: Actions<NodeType>['setNodes'] = (nodes) => {\n const nextNodes = typeof nodes === 'function' ? nodes(state.nodes) : nodes;\n\n if (!state.initialized && !nextNodes.length) {\n return;\n }\n\n // `commitNodes` re-adopts the user nodes into the lookup (xyflow-style) and stores them as `state.nodes`\n commitNodes(nextNodes);\n };\n\n const setEdges: Actions<NodeType, EdgeType>['setEdges'] = (edges) => {\n const nextEdges = typeof edges === 'function' ? edges(state.edges) : edges;\n\n if (!state.initialized && !nextEdges.length) {\n return;\n }\n\n commitEdges(\n validateEdges<EdgeType>(\n nextEdges,\n state.isValidConnection,\n getInternalNode,\n state.hooks.error.trigger,\n state.defaultEdgeOptions,\n state.nodes,\n state.edges,\n ),\n );\n };\n\n const addNodes: Actions<NodeType>['addNodes'] = (nodes) => {\n let nextNodes = typeof nodes === 'function' ? nodes(state.nodes) : nodes;\n nextNodes = Array.isArray(nextNodes) ? nextNodes : [nextNodes];\n\n // Emit `add` changes for the valid user nodes (filter invalid up front — `applyChanges` would\n // otherwise read `.id` off a non-node and throw; `commitNodes`/`adoptNodes` re-validates on adopt).\n const changes: NodeAddChange<NodeType>[] = [];\n for (const node of nextNodes) {\n if (!isNode(node)) {\n continue;\n }\n changes.push(createAdditionChange(node));\n }\n\n if (changes.length) {\n state.hooks.nodesChange.trigger(changes);\n }\n };\n\n const addEdges: Actions<NodeType, EdgeType>['addEdges'] = (params) => {\n let nextEdges = typeof params === 'function' ? params(state.edges) : params;\n nextEdges = Array.isArray(nextEdges) ? nextEdges : [nextEdges];\n\n // the `add` change items are the validated USER edges (a `Connection` becomes a new edge with\n // `defaultEdgeOptions` merged at creation) — no enrichment leaks into the change event payload\n const validEdges = validateEdges<EdgeType>(\n nextEdges,\n state.isValidConnection,\n getInternalNode,\n state.hooks.error.trigger,\n state.defaultEdgeOptions,\n state.nodes,\n state.edges,\n );\n\n const changes: EdgeAddChange<EdgeType>[] = [];\n for (const edge of validEdges) {\n changes.push(createAdditionChange(edge));\n }\n\n if (changes.length) {\n state.hooks.edgesChange.trigger(changes);\n }\n };\n\n const removeNodes: Actions<NodeType>['removeNodes'] = (nodes, removeConnectedEdges = true, removeChildren = false) => {\n const nextNodes = typeof nodes === 'function' ? nodes(state.nodes) : nodes;\n const nodesToRemove = Array.isArray(nextNodes) ? nextNodes : [nextNodes];\n\n const nodeChanges: NodeRemoveChange[] = [];\n const edgeChanges: EdgeRemoveChange[] = [];\n\n function createEdgeRemovalChanges(nodes: Node[]) {\n const connectedEdges = getConnectedEdges(nodes);\n for (const edge of connectedEdges) {\n // deletable is no longer stamped onto stored edges — resolve through defaultEdgeOptions at read time\n const deletable = edge.deletable ?? state.defaultEdgeOptions?.deletable;\n if (isDef(deletable) ? deletable : true) {\n edgeChanges.push(createEdgeRemoveChange(edge.id));\n }\n }\n }\n\n // recursively get all children and if the child is a parent, get those children as well until all nodes have been removed that are children of the current node\n function createChildrenRemovalChanges(id: string) {\n const children: NodeType[] = [];\n for (const node of state.nodes) {\n if (node.parentId === id) {\n children.push(node);\n }\n }\n\n if (children.length) {\n for (const child of children) {\n nodeChanges.push(createNodeRemoveChange(child.id));\n }\n\n if (removeConnectedEdges) {\n createEdgeRemovalChanges(children);\n }\n\n for (const child of children) {\n createChildrenRemovalChanges(child.id);\n }\n }\n }\n\n for (const item of nodesToRemove) {\n const currNode = typeof item === 'string' ? getNode(item) : item;\n\n if (!currNode) {\n continue;\n }\n\n if (isDef(currNode.deletable) && !currNode.deletable) {\n continue;\n }\n\n nodeChanges.push(createNodeRemoveChange(currNode.id));\n\n if (removeConnectedEdges) {\n createEdgeRemovalChanges([currNode as Node]);\n }\n\n if (removeChildren) {\n createChildrenRemovalChanges(currNode.id);\n }\n }\n\n if (edgeChanges.length) {\n state.hooks.edgesChange.trigger(edgeChanges);\n }\n\n if (nodeChanges.length) {\n state.hooks.nodesChange.trigger(nodeChanges);\n }\n };\n\n const removeEdges: Actions<NodeType, EdgeType>['removeEdges'] = (edges) => {\n const nextEdges = typeof edges === 'function' ? edges(state.edges) : edges;\n const edgesToRemove = Array.isArray(nextEdges) ? nextEdges : [nextEdges];\n\n const changes: EdgeRemoveChange[] = [];\n\n for (const item of edgesToRemove) {\n const currEdge = typeof item === 'string' ? getEdge(item) : item;\n\n if (!currEdge) {\n continue;\n }\n\n const deletable = currEdge.deletable ?? state.defaultEdgeOptions?.deletable;\n if (isDef(deletable) && !deletable) {\n continue;\n }\n\n changes.push(createEdgeRemoveChange(typeof item === 'string' ? item : item.id));\n }\n\n state.hooks.edgesChange.trigger(changes);\n };\n\n const deleteElements: Actions<NodeType, EdgeType>['deleteElements'] = async ({ nodes = [], edges = [] }) => {\n // `getElementsToRemove` (xyflow/system) gathers the full set — the targeted nodes + their child nodes,\n // plus connected + explicitly-listed edges, skipping `deletable: false` — then consults `onBeforeDelete`\n // and returns the elements that should actually be removed (`false` → none, an object → that subset).\n const { nodes: matchingNodes, edges: matchingEdges } = await getElementsToRemove<NodeType, EdgeType>({\n nodesToRemove: nodes,\n edgesToRemove: edges,\n nodes: state.nodes,\n edges: state.edges,\n onBeforeDelete: state.onBeforeDelete ?? undefined,\n });\n\n // remove exactly that set: `matchingNodes` already includes children and `matchingEdges` the connected\n // edges (both reflecting any `onBeforeDelete` filtering), so tell `removeNodes` NOT to also pull in\n // connected edges/children — that would bypass an `onBeforeDelete` that chose to keep some.\n if (matchingNodes.length) {\n removeNodes(matchingNodes, false, false);\n }\n\n if (matchingEdges.length) {\n removeEdges(matchingEdges);\n }\n\n return { deletedNodes: matchingNodes, deletedEdges: matchingEdges };\n };\n\n const reconnectEdge: Actions<NodeType, EdgeType>['reconnectEdge'] = (oldEdge, newConnection, shouldReplaceId = true) => {\n const prevEdge = getEdge(oldEdge.id);\n\n if (!prevEdge) {\n return false;\n }\n\n // resolve by id, not identity — callers commonly pass stale references (e.g. an edge captured in an\n // event payload before an immutable change replaced the stored object)\n const prevEdgeIndex = state.edges.findIndex(edge => edge.id === oldEdge.id);\n\n const newEdge = reconnectEdgeAction(oldEdge, newConnection, prevEdge as EdgeType, shouldReplaceId, state.hooks.error.trigger);\n\n if (newEdge) {\n const [validEdge] = validateEdges<EdgeType>(\n [newEdge as unknown as EdgeType],\n state.isValidConnection,\n getInternalNode,\n state.hooks.error.trigger,\n state.defaultEdgeOptions,\n state.nodes,\n state.edges,\n );\n\n if (!validEdge) {\n return false;\n }\n\n commitEdges(state.edges.map((edge, index) => (index === prevEdgeIndex ? validEdge : edge)));\n\n return validEdge;\n }\n\n return false;\n };\n\n const updateEdge: Actions<NodeType, EdgeType>['updateEdge'] = (id, edgeUpdate, options = { replace: false }) => {\n const edge = getEdge(id);\n\n if (!edge) {\n return;\n }\n\n const nextEdge = typeof edgeUpdate === 'function' ? edgeUpdate(edge as EdgeType) : edgeUpdate;\n\n // immutable: build a NEW edge (full replace or shallow merge) for the target id and recommit\n const next = state.edges.map(e => (e.id === id ? ((options.replace ? nextEdge : { ...e, ...nextEdge }) as EdgeType) : e));\n commitEdges(next);\n };\n\n const updateEdgeData: Actions<NodeType, EdgeType>['updateEdgeData'] = (id, dataUpdate, options = { replace: false }) => {\n const edge = getEdge(id);\n\n if (!edge) {\n return;\n }\n\n const nextData = typeof dataUpdate === 'function' ? dataUpdate(edge as EdgeType) : dataUpdate;\n\n // build a NEW edge object — in-place mutation isn't reactive (edges are markRaw'd; renders trigger\n // on lookup replacement)\n const nextEdge = { ...edge, data: options.replace ? nextData : { ...edge.data, ...nextData } } as EdgeType;\n\n commitEdges(state.edges.map(item => (item.id === id ? nextEdge : item)));\n };\n\n const applyNodeChanges: Actions<NodeType>['applyNodeChanges'] = (changes) => {\n // Apply changes IMMUTABLY against the canonical user nodes (`applyChanges` returns a new array — new\n // objects for changed nodes, unchanged reused by reference), then re-adopt via `commitNodes`\n // (`adoptUserNodes` reuses unchanged InternalNodes by reference via `checkEquality`).\n const result = applyChanges(changes, state.nodes);\n commitNodes(result);\n return result;\n };\n\n const applyEdgeChanges: Actions<NodeType, EdgeType>['applyEdgeChanges'] = (changes) => {\n // apply immutably against the canonical user edges: new array, new objects for changed edges,\n // unchanged reused by reference\n const result = applyChanges(changes, state.edges);\n commitEdges(result);\n return result;\n };\n\n const updateNode: Actions<NodeType>['updateNode'] = (id, nodeUpdate, options = { replace: false }) => {\n const node = getInternalNode(id);\n\n if (!node) {\n return;\n }\n\n const nextNode = typeof nodeUpdate === 'function' ? nodeUpdate(node) : nodeUpdate;\n\n // Immutable update: build a NEW user node (full replacement or shallow merge) for the target id and\n // re-adopt via `commitNodes`. Mutating in place would keep the reference and re-adopt the stale node.\n const next = state.nodes.map(n => (n.id === id ? ((options.replace ? nextNode : { ...n, ...nextNode }) as NodeType) : n));\n commitNodes(next);\n };\n\n const updateNodeData: Actions<NodeType>['updateNodeData'] = (id, dataUpdate, options = { replace: false }) => {\n const node = getInternalNode(id);\n\n if (!node) {\n return;\n }\n\n const nextData = typeof dataUpdate === 'function' ? dataUpdate(node) : dataUpdate;\n\n // Immutable: new user node with new `data`, then re-adopt (see {@link updateNode}).\n const next = state.nodes.map(n =>\n n.id === id ? ({ ...n, data: options.replace ? nextData : { ...n.data, ...nextData } } as NodeType) : n,\n );\n commitNodes(next);\n };\n\n const startConnection: Actions<NodeType>['startConnection'] = (startHandle, position, isClick = false) => {\n if (isClick) {\n state.connectionClickStartHandle = startHandle;\n }\n else {\n state.connectionStartHandle = startHandle;\n }\n\n state.connectionEndHandle = null;\n state.connectionStatus = null;\n\n if (position) {\n state.connectionPosition = position;\n }\n };\n\n const updateConnection: Actions<NodeType>['updateConnection'] = (position, result = null, status = null) => {\n if (state.connectionStartHandle) {\n state.connectionPosition = position;\n state.connectionEndHandle = result;\n state.connectionStatus = status;\n }\n };\n\n const endConnection: Actions<NodeType>['endConnection'] = (event, isClick) => {\n state.connectionPosition = { x: Number.NaN, y: Number.NaN };\n state.connectionEndHandle = null;\n state.connectionStatus = null;\n\n if (isClick) {\n state.connectionClickStartHandle = null;\n }\n else {\n state.connectionStartHandle = null;\n }\n };\n\n const getNodeRect = (\n nodeOrRect: (Partial<Node> & { id: Node['id'] }) | Rect,\n ): [Rect | null, Node | null | undefined, boolean] => {\n const isRectObj = isRectObject(nodeOrRect);\n // use `getInternalNode` (not getNode): `nodeToRect` below needs `internals`/`measured`, which live on\n // the InternalNode, not the user `Node` that getNode returns\n const node = isRectObj ? null : isInternalNode(nodeOrRect) ? nodeOrRect : getInternalNode(nodeOrRect.id);\n\n if (!isRectObj && !node) {\n return [null, null, isRectObj];\n }\n\n const nodeRect = isRectObj ? nodeOrRect : nodeToRect(node!);\n\n return [nodeRect, node, isRectObj];\n };\n\n const getIntersectingNodes: Actions<NodeType>['getIntersectingNodes'] = (\n nodeOrRect,\n partially = true,\n // defaults to the enriched InternalNodes — intersection geometry needs `internals`/`measured`\n nodes = Array.from(nodeLookup.values()),\n ) => {\n const [nodeRect, node, isRect] = getNodeRect(nodeOrRect);\n\n if (!nodeRect) {\n return [];\n }\n\n const intersections: InternalNode<NodeType>[] = [];\n for (const n of nodes) {\n if (!isRect && (n.id === node!.id || !n.internals.positionAbsolute)) {\n continue;\n }\n\n const currNodeRect = nodeToRect(n);\n const overlappingArea = getOverlappingArea(currNodeRect, nodeRect);\n const partiallyVisible = partially && overlappingArea > 0;\n\n if (\n partiallyVisible\n || overlappingArea >= currNodeRect.width * currNodeRect.height\n || overlappingArea >= Number(nodeRect.width) * Number(nodeRect.height)\n ) {\n intersections.push(n);\n }\n }\n\n return intersections;\n };\n\n const isNodeIntersecting: Actions<NodeType>['isNodeIntersecting'] = (nodeOrRect, area, partially = true) => {\n const [nodeRect] = getNodeRect(nodeOrRect);\n\n if (!nodeRect) {\n return false;\n }\n\n const overlappingArea = getOverlappingArea(nodeRect, area);\n const partiallyVisible = partially && overlappingArea > 0;\n\n // \"intersecting\" when partially overlapping (if `partially`) OR fully contained either way — the node\n // inside the area, or the area inside the node (the latter was missing; xyflow/react #5482)\n return (\n partiallyVisible\n || overlappingArea >= area.width * area.height\n || overlappingArea >= Number(nodeRect.width) * Number(nodeRect.height)\n );\n };\n\n const panBy: Actions<NodeType>['panBy'] = (delta) => {\n const { transform, dimensions, translateExtent, panZoom } = state;\n\n return panBySystem({ delta, panZoom, transform, translateExtent, ...dimensions });\n };\n\n const setState: Actions<NodeType, EdgeType>['setState'] = (options) => {\n const opts = typeof options === 'function' ? options(state) : options;\n\n // these options cannot be set after initialization\n const exclude: (keyof typeof opts)[] = ['viewportRef', 'vueFlowRef', 'dimensions', 'hooks'];\n\n // we need to set the default opts before setting any elements so the options are applied to the elements on first render\n if (isDef(opts.defaultEdgeOptions)) {\n state.defaultEdgeOptions = opts.defaultEdgeOptions;\n }\n\n // the `fitView` prop maps to the internal `fitViewOnInit` flag (kept separate from the `fitView()`\n // action); skipped from the generic loop above via `storeOptionsToSkip`\n if (isDef(opts.fitView)) {\n state.fitViewOnInit = opts.fitView;\n }\n\n if (isDef(opts.nodes)) {\n setNodes(opts.nodes);\n }\n\n if (isDef(opts.edges)) {\n setEdges(opts.edges);\n }\n\n const setSkippedOptions = () => {\n if (isDef(opts.maxZoom)) {\n setMaxZoom(opts.maxZoom);\n }\n if (isDef(opts.minZoom)) {\n setMinZoom(opts.minZoom);\n }\n if (isDef(opts.translateExtent)) {\n setTranslateExtent(opts.translateExtent);\n }\n // route through the setter (recomputes absolute positions) instead of the raw generic-loop\n // assignment — runs after `setNodes`, so preloaded nodes get re-clamped to the extent\n if (isDef(opts.nodeExtent)) {\n setNodeExtent(opts.nodeExtent);\n }\n };\n\n for (const o of Object.keys(opts)) {\n const key = o as keyof State;\n const option = opts[key];\n\n if (![...storeOptionsToSkip, ...exclude].includes(key) && isDef(option)) {\n ;(<any>state)[key] = option;\n }\n }\n\n // min/max-zoom + translateExtent setters are panZoom-null-safe (they always write state, and\n // `XYPanZoom` reads those state values when it mounts), so apply them directly — no need to wait\n // for the panZoom instance to exist.\n setSkippedOptions();\n\n if (!state.initialized) {\n state.initialized = true;\n }\n };\n\n // Mirror xyflow/react's `toObject`: shallow-clone each node/edge and read the viewport off the transform.\n // No field stripping (notably `measured` is kept, so a restored flow renders immediately instead of\n // staying `visibility: hidden` until re-measured) and no JSON round-trip — the nodes/edges are already\n // plain `markRaw`'d user objects, and callers that persist the result serialize it (`JSON.stringify(...)`).\n const toObject: Actions<NodeType>['toObject'] = () => ({\n nodes: state.nodes.map(node => ({ ...node })),\n edges: state.edges.map(edge => ({ ...edge })),\n viewport: { x: state.transform[0], y: state.transform[1], zoom: state.transform[2] },\n });\n\n const $reset: Actions<NodeType, EdgeType>['$reset'] = () => {\n const { nodes: _nodes, edges: _edges, ...resetState } = useState<NodeType, EdgeType>();\n\n commitEdges([]);\n commitNodes([]);\n\n if (state.panZoom) {\n state.panZoom.setViewport({\n x: state.defaultViewport.x ?? 0,\n y: state.defaultViewport.y ?? 0,\n zoom: state.defaultViewport.zoom ?? 1,\n });\n }\n\n setState(resetState);\n };\n\n return {\n updateNodePositions,\n updateNodeDimensions,\n setNodes,\n setEdges,\n addNodes,\n addEdges,\n removeNodes,\n removeEdges,\n deleteElements,\n getNode,\n getInternalNode,\n getEdge,\n reconnectEdge,\n updateEdge,\n updateEdgeData,\n updateNode,\n updateNodeData,\n applyEdgeChanges,\n applyNodeChanges,\n addSelectedNodes,\n addSelectedEdges,\n setMinZoom,\n setMaxZoom,\n setTranslateExtent,\n setNodeExtent,\n setPaneClickDistance,\n removeSelectedNodes,\n removeSelectedEdges,\n resetSelectedElements,\n startConnection,\n updateConnection,\n endConnection,\n setInteractive,\n setState,\n getIntersectingNodes,\n getConnectedEdges,\n getHandleConnections,\n isNodeIntersecting,\n panBy,\n fitView: params => viewportHelper.value.fitView(params),\n zoomIn: transitionOpts => viewportHelper.value.zoomIn(transitionOpts),\n zoomOut: transitionOpts => viewportHelper.value.zoomOut(transitionOpts),\n zoomTo: (zoomLevel, transitionOpts) => viewportHelper.value.zoomTo(zoomLevel, transitionOpts),\n setViewport: (params, transitionOpts) => viewportHelper.value.setViewport(params, transitionOpts),\n getViewport: () => viewportHelper.value.getViewport(),\n setCenter: (x, y, opts) => viewportHelper.value.setCenter(x, y, opts),\n fitBounds: (params, opts) => viewportHelper.value.fitBounds(params, opts),\n screenToFlowPosition: params => viewportHelper.value.screenToFlowPosition(params),\n flowToScreenPosition: params => viewportHelper.value.flowToScreenPosition(params),\n toObject,\n updateNodeInternals,\n viewportInitialized: computed(() => viewportHelper.value.viewportInitialized),\n $reset,\n $destroy: () => {},\n };\n}\n","import type { Component, FunctionalComponent } from 'vue';\nimport type { BuiltInNode, NodeProps } from '../../types';\nimport { Position } from '@xyflow/system';\nimport { Fragment, h } from 'vue';\nimport Handle from '../Handle/Handle.vue';\n\nconst DefaultNode: FunctionalComponent<NodeProps<BuiltInNode>> = function ({\n sourcePosition = Position.Bottom,\n targetPosition = Position.Top,\n isConnectable = true,\n data,\n}) {\n const label = data?.label;\n\n return [\n h(Handle as Component, { type: 'target', position: targetPosition, isConnectable }),\n typeof label !== 'string' && label ? h(label) : h(Fragment, [label]),\n h(Handle as Component, { type: 'source', position: sourcePosition, isConnectable }),\n ];\n};\n\nDefaultNode.props = ['sourcePosition', 'targetPosition', 'isConnectable', 'data'];\nDefaultNode.inheritAttrs = false;\nDefaultNode.compatConfig = { MODE: 3 };\n\nexport default DefaultNode;\n","import type { Component, FunctionalComponent } from 'vue';\nimport type { BuiltInNode, NodeProps } from '../../types';\nimport { Position } from '@xyflow/system';\nimport { Fragment, h } from 'vue';\nimport Handle from '../Handle/Handle.vue';\n\nconst InputNode: FunctionalComponent<NodeProps<BuiltInNode>> = function ({\n sourcePosition = Position.Bottom,\n isConnectable = true,\n data,\n}) {\n const label = data?.label;\n\n return [\n typeof label !== 'string' && label ? h(label) : h(Fragment, [label]),\n h(Handle as Component, { type: 'source', position: sourcePosition, isConnectable }),\n ];\n};\n\nInputNode.props = ['sourcePosition', 'isConnectable', 'data'];\nInputNode.inheritAttrs = false;\nInputNode.compatConfig = { MODE: 3 };\n\nexport default InputNode;\n","import type { Component, FunctionalComponent } from 'vue';\nimport type { BuiltInNode, NodeProps } from '../../types';\nimport { Position } from '@xyflow/system';\nimport { Fragment, h } from 'vue';\nimport Handle from '../Handle/Handle.vue';\n\nconst OutputNode: FunctionalComponent<NodeProps<BuiltInNode>> = function ({\n targetPosition = Position.Top,\n isConnectable,\n data,\n}) {\n const label = data?.label;\n\n return [\n h(Handle as Component, { type: 'target', position: targetPosition, isConnectable }),\n typeof label !== 'string' && label ? h(label) : h(Fragment, [label]),\n ];\n};\n\nOutputNode.props = ['targetPosition', 'isConnectable', 'data'];\nOutputNode.inheritAttrs = false;\nOutputNode.compatConfig = { MODE: 3 };\n\nexport default OutputNode;\n","import type { DefaultEdgeTypes, DefaultNodeTypes } from '../types';\n\nimport BezierEdge from '../components/Edges/BezierEdge';\nimport SimpleBezierEdge from '../components/Edges/SimpleBezierEdge';\nimport SmoothStepEdge from '../components/Edges/SmoothStepEdge';\nimport StepEdge from '../components/Edges/StepEdge';\nimport StraightEdge from '../components/Edges/StraightEdge';\nimport DefaultNode from '../components/Nodes/DefaultNode';\nimport InputNode from '../components/Nodes/InputNode';\nimport OutputNode from '../components/Nodes/OutputNode';\n\nexport const defaultNodeTypes: DefaultNodeTypes = {\n input: InputNode,\n default: DefaultNode,\n output: OutputNode,\n};\n\nexport const defaultEdgeTypes: DefaultEdgeTypes = {\n default: BezierEdge,\n straight: StraightEdge,\n step: StepEdge,\n smoothstep: SmoothStepEdge,\n simplebezier: SimpleBezierEdge,\n};\n","import type { ComputedGetters, Edge, Node, NodeLookup, State } from '../types';\nimport { getNodesInside, isEdgeVisible } from '@xyflow/system';\nimport { computed } from 'vue';\nimport { defaultEdgeTypes, defaultNodeTypes } from '../utils/defaultNodesEdges';\n\nexport function useGetters<NodeType extends Node = Node, EdgeType extends Edge = Edge>(\n state: State<NodeType, EdgeType>,\n nodeLookup: NodeLookup<NodeType>,\n): ComputedGetters<NodeType, EdgeType> {\n const getEdgeTypes: ComputedGetters<NodeType, EdgeType>['getEdgeTypes'] = computed(() => {\n const edgeTypes: Record<string, any> = {\n ...defaultEdgeTypes,\n ...state.edgeTypes,\n };\n\n const keys = Object.keys(edgeTypes);\n\n // defaults are not stamped onto stored edges — auto-register defaultEdgeOptions.type too, else\n // edges relying on it would render the bezier default instead of the configured component\n const defaultType = state.defaultEdgeOptions?.type;\n if (defaultType && !keys.includes(defaultType)) {\n edgeTypes[defaultType] = defaultType;\n keys.push(defaultType);\n }\n\n for (const e of state.edges) {\n e.type && !keys.includes(e.type) && (edgeTypes[e.type] = e.type);\n }\n\n return edgeTypes;\n });\n\n const getNodeTypes: ComputedGetters<NodeType>['getNodeTypes'] = computed(() => {\n const nodeTypes: Record<string, any> = {\n ...defaultNodeTypes,\n ...state.nodeTypes,\n };\n\n const keys = Object.keys(nodeTypes);\n\n for (const n of state.nodes) {\n n.type && !keys.includes(n.type) && (nodeTypes[n.type] = n.type);\n }\n\n return nodeTypes;\n });\n\n const getNodes: ComputedGetters<NodeType>['getNodes'] = computed(() => {\n if (state.onlyRenderVisibleElements) {\n // `getNodesInside` works on the InternalNode lookup; surface the user nodes (the public contract)\n return getNodesInside(\n nodeLookup,\n {\n x: 0,\n y: 0,\n width: state.dimensions.width,\n height: state.dimensions.height,\n },\n state.transform,\n true,\n ).map(node => node.internals.userNode);\n }\n\n return state.nodes;\n });\n\n const getEdges: ComputedGetters<NodeType, EdgeType>['getEdges'] = computed(() => {\n if (state.onlyRenderVisibleElements) {\n const visibleEdges: EdgeType[] = [];\n\n for (const edge of state.edges) {\n const source = nodeLookup.get(edge.source);\n const target = nodeLookup.get(edge.target);\n\n // skip dangling edges (missing endpoint node) instead of crashing on the non-null assertion\n if (!source || !target) {\n continue;\n }\n\n if (\n isEdgeVisible({\n sourceNode: source,\n targetNode: target,\n width: state.dimensions.width,\n height: state.dimensions.height,\n transform: state.transform,\n })\n ) {\n visibleEdges.push(edge);\n }\n }\n\n return visibleEdges;\n }\n\n return state.edges;\n });\n\n const getSelectedNodes: ComputedGetters<NodeType>['getSelectedNodes'] = computed(() => {\n const selectedNodes: NodeType[] = [];\n for (const node of state.nodes) {\n if (node.selected) {\n selectedNodes.push(node);\n }\n }\n\n return selectedNodes;\n });\n\n const getSelectedEdges: ComputedGetters<NodeType, EdgeType>['getSelectedEdges'] = computed(() => {\n const selectedEdges: EdgeType[] = [];\n for (const edge of state.edges) {\n if (edge.selected) {\n selectedEdges.push(edge);\n }\n }\n\n return selectedEdges;\n });\n\n // the public `{ x, y, zoom }` shape derived from the canonical `transform` tuple (read-only)\n const viewport: ComputedGetters<NodeType, EdgeType>['viewport'] = computed(() => ({\n x: state.transform[0],\n y: state.transform[1],\n zoom: state.transform[2],\n }));\n\n return {\n getEdgeTypes,\n getNodeTypes,\n getEdges,\n getNodes,\n getSelectedNodes,\n getSelectedEdges,\n viewport,\n };\n}\n","import type { Ref } from 'vue';\nimport type {\n Edge,\n EdgeLookup,\n FlowProps,\n InternalNode,\n Node,\n NodeLookup,\n VueFlowInstance,\n VueFlowState,\n VueFlowStoreHandle,\n} from '../types';\nimport { reactive, shallowRef, toRaw, watch } from 'vue';\nimport { useActions } from './actions';\nimport { useGetters } from './getters';\nimport { useState } from './state';\n\n/**\n * External backing refs for a store's nodes/edges. When `<VueFlow>` passes its `v-model` refs here, the\n * store reads/writes them directly (single source of truth, like svelte's `$bindable` proxy) so a\n * separate v-model sync layer isn't needed. Omitted → the store uses internal refs.\n */\nexport interface StoreSignals<NodeType extends Node = Node, EdgeType extends Edge = Edge> {\n nodes?: Ref<NodeType[]>;\n edges?: Ref<EdgeType[]>;\n}\n\n/**\n * Builds a fully-wired VueFlow store instance (reactive state, lookups, getters, actions, hooks).\n *\n * Standalone factory so store ownership lives in the component that creates it — `<VueFlow>` or\n * `<VueFlowProvider>` via `useCreateVueFlow` — which `provide`s it to descendants. There is no global\n * registry; `useVueFlow()` resolves the store purely through `inject`.\n *\n * @internal\n */\nexport function createVueFlowStore<NodeType extends Node = Node, EdgeType extends Edge = Edge>(\n id: string,\n preloadedState?: FlowProps<NodeType, EdgeType>,\n onDestroy?: (id: string) => void,\n signals?: StoreSignals<NodeType, EdgeType>,\n): VueFlowStoreHandle<NodeType, EdgeType> {\n // nodes/edges are backed by (optionally injected) signal refs — the single source of truth. When\n // `<VueFlow>` passes its v-model refs, mutating the store *is* the v-model update (svelte's\n // bindable-prop proxy), so no separate sync layer is needed. Default: internal `shallowRef`s — the\n // arrays are only ever reassigned whole (immutable commits), and `shallowRef` keeps the fallback's\n // type at `Ref<NodeType[]>` exactly (a deep `ref` would unwrap to `Ref<UnwrapRefSimple<NodeType>[]>`,\n // which TS can't reconcile with the injected signal's type over an unresolved generic). The explicit\n // `| undefined` reflects an injected-but-unbound `defineModel` ref.\n const nodesSignal: Ref<NodeType[] | undefined> = signals?.nodes ?? shallowRef([]);\n const edgesSignal: Ref<EdgeType[] | undefined> = signals?.edges ?? shallowRef([]);\n\n // The array references the store itself last wrote (through the `state.nodes`/`.edges` setters below).\n // The single-source binding watch (further down) uses these to tell its own writes apart from an\n // external `v-model` reassignment — no pause/resume flags needed.\n let lastWriteNodes: NodeType[] | undefined;\n let lastWriteEdges: EdgeType[] | undefined;\n\n // Stable empty fallbacks: an injected `v-model` ref is `undefined` until bound (e.g. `<VueFlow>` with no\n // `:nodes`), so reads must never surface `undefined` (everything iterates `state.nodes`/`.edges`). A\n // stable reference avoids reactivity churn while unbound; `setState`/`commit` replace it with a real array.\n const emptyNodes: NodeType[] = [];\n const emptyEdges: EdgeType[] = [];\n\n const state = useState<NodeType, EdgeType>();\n\n // Proxy `state.nodes`/`.edges` through the signals via accessors (svelte's `get nodes()` pattern), so\n // every existing `state.nodes` read/write stays unchanged while the backing becomes injectable.\n Object.defineProperty(state, 'nodes', {\n get: () => nodesSignal.value ?? emptyNodes,\n set: (value: NodeType[]) => {\n lastWriteNodes = toRaw(value);\n nodesSignal.value = value;\n },\n enumerable: true,\n configurable: true,\n });\n Object.defineProperty(state, 'edges', {\n get: () => edgesSignal.value ?? emptyEdges,\n set: (value: EdgeType[]) => {\n lastWriteEdges = toRaw(value);\n edgesSignal.value = value;\n },\n enumerable: true,\n configurable: true,\n });\n\n const reactiveState = reactive(state) as any;\n\n const hooksOn = <any>{};\n for (const [n, h] of Object.entries(reactiveState.hooks)) {\n const name = `on${n.charAt(0).toUpperCase() + n.slice(1)}`;\n hooksOn[name] = (h as any).on;\n }\n\n const emits = <any>{};\n for (const [n, h] of Object.entries(reactiveState.hooks)) {\n emits[n] = (h as any).trigger;\n }\n\n // The lookup maps hold the enriched `InternalNode`s/edges (canonical for `internals`/`measured`); the\n // canonical user-facing `Node`/`Edge` arrays live in `state.nodes`/`state.edges` (the v-model source of\n // truth). They are created as plain `Map`s in `useState` and made reactive by `reactive(state)` above, so\n // Map identity is stable across mutations (`@xyflow/system` helpers `.set` clones in place while reads via\n // `.get` stay reactive) AND `useStore()` surfaces them as part of the state. The store actions write both\n // in one imperative pass (`commitNodes` re-adopts the user nodes into the lookup, `commitEdges` mirrors\n // edges) — no derivation watcher, no rebuild thrash.\n //\n // The `as` casts undo `reactive()`'s `UnwrapNestedRefs` widening over a Map of the *generic*\n // `InternalNode<NodeType>` (TS can't prove the element type has no refs to unwrap); at runtime the proxy is\n // exactly a `Map<string, InternalNode>`, so the assertion is sound (documented Vue + generics friction).\n const nodeLookup = reactiveState.nodeLookup as NodeLookup<NodeType>;\n const parentLookup = reactiveState.parentLookup as Map<string, Map<string, InternalNode<NodeType>>>;\n const edgeLookup = reactiveState.edgeLookup as EdgeLookup<EdgeType>;\n\n const getters = useGetters<NodeType, EdgeType>(reactiveState, nodeLookup);\n\n const actions = useActions<NodeType, EdgeType>(reactiveState, nodeLookup, parentLookup, edgeLookup);\n\n actions.setState({ ...reactiveState, ...preloadedState } as any);\n\n // Single-source `v-model` binding. When `<VueFlow>` passes its model refs as signals, the store's\n // nodes/edges ARE those refs: internal mutations (drag, `addEdges`, `applyNodeChanges`, …) write them\n // through the `state.nodes`/`.edges` setters, which IS the v-model write-back — the OUT direction is\n // free, no watcher. The only thing left is adopting an EXTERNAL reassignment (`nodes.value = [...]` in\n // user land) so the lookups rebuild. The store's own writes are recorded in `lastWriteNodes`; a user\n // reassignment writes the signal directly, bypassing the setter, so we re-adopt only then (mirrors\n // svelte-flow re-running `adoptUserNodes` via `$derived` on a reference change — no pause/resume).\n // Identity must be compared on the RAW arrays: a parent binding the v-model to a deep `ref` hands our\n // own write back as its reactive proxy, which would fail a plain `!==` and loop `setNodes` forever.\n if (signals?.nodes) {\n watch(nodesSignal, (next) => {\n const nextRaw = next && toRaw(next);\n if (nextRaw && nextRaw !== lastWriteNodes) {\n actions.setNodes(nextRaw);\n }\n });\n }\n if (signals?.edges) {\n watch(edgesSignal, (next) => {\n const nextRaw = next && toRaw(next);\n if (nextRaw && nextRaw !== lastWriteEdges) {\n actions.setEdges(nextRaw as unknown as EdgeType[]);\n }\n });\n }\n\n // The curated instance (`useVueFlow()`): actions + getters + event hooks + identity. Raw reactive\n // state (`useStore()`) is `reactiveState` itself — the two views over one store.\n const instance: VueFlowInstance<NodeType, EdgeType> = {\n ...hooksOn,\n ...getters,\n ...actions,\n emits,\n id,\n $destroy: () => {\n onDestroy?.(id);\n },\n };\n\n return { instance, state: reactiveState as VueFlowState<NodeType, EdgeType> };\n}\n","import type { StoreSignals } from '../store/createStore';\nimport type { Edge, EdgeChange, FlowOptions, Node, NodeChange, VueFlowInstance, VueFlowState, VueFlowStoreHandle } from '../types';\nimport { provide, useId, watch } from 'vue';\nimport { VueFlow, VueFlowStateKey } from '../context';\nimport { createVueFlowStore } from '../store/createStore';\n\n/**\n * Create a VueFlow store, register the default change handlers, and `provide` it to descendants.\n *\n * Owned by `<VueFlow>` / `<VueFlowProvider>`. This is the *only* place a store is created and provided;\n * the public `useVueFlow()` (instance) and `useStore()` (state) are pure `inject` consumers. Must run in\n * a component `setup` (it calls `provide` + `watch` + `useId`, which bind to the component instance).\n *\n * @internal\n */\nexport function useCreateVueFlow<NodeType extends Node = Node, EdgeType extends Edge = Edge>(\n options?: FlowOptions<NodeType, EdgeType>,\n signals?: StoreSignals<NodeType, EdgeType>,\n): VueFlowStoreHandle<NodeType, EdgeType> {\n // the flow id is only an aria/debug label (not a lookup key), so default it to Vue's SSR-safe `useId()`\n const handle = createVueFlowStore<NodeType, EdgeType>(options?.id ?? useId(), options, undefined, signals);\n const { instance, state } = handle;\n\n /**\n * Register default change handlers so `addNodes`/`addEdges`/etc. mutate the store. Disabling\n * `autoApplyChanges` (the user handles changes manually) removes them. Mirrors xyflow/react.\n */\n watch(\n () => state.autoApplyChanges,\n (shouldApplyDefault, _prev, onCleanup) => {\n const nodesChangeHandler = (changes: NodeChange[]) => {\n instance.applyNodeChanges(changes as NodeChange<NodeType>[]);\n };\n const edgesChangeHandler = (changes: EdgeChange[]) => {\n instance.applyEdgeChanges(changes as EdgeChange<EdgeType>[]);\n };\n\n if (shouldApplyDefault) {\n instance.onNodesChange(nodesChangeHandler);\n instance.onEdgesChange(edgesChangeHandler);\n }\n else {\n state.hooks.nodesChange.off(nodesChangeHandler);\n state.hooks.edgesChange.off(edgesChangeHandler);\n }\n\n onCleanup(() => {\n state.hooks.nodesChange.off(nodesChangeHandler);\n state.hooks.edgesChange.off(edgesChangeHandler);\n });\n },\n { immediate: true },\n );\n\n provide(VueFlow, instance as unknown as VueFlowInstance);\n provide(VueFlowStateKey, state as unknown as VueFlowState);\n\n return handle;\n}\n","import type { Edge, Node } from '../types';\nimport { watch } from 'vue';\nimport { useVueFlow } from './useVueFlow';\n\n/**\n * Composable that handles the initialization of the viewport.\n *\n * Takes the store explicitly because it runs inside `<VueFlow>`'s own setup, where `inject` can't see\n * `<VueFlow>`'s own `provide` (provide reaches descendants only). Defaults to `useVueFlow()` for\n * descendant callers.\n *\n * @internal\n */\nexport function useOnInitHandler<NodeType extends Node = Node, EdgeType extends Edge = Edge>(\n vfInstance = useVueFlow<NodeType, EdgeType>(),\n) {\n watch(\n () => vfInstance.viewportInitialized.value,\n (isInitialized) => {\n if (isInitialized) {\n vfInstance.emits.init(vfInstance);\n }\n },\n // `flush: 'post'` runs the callback after the viewport DOM update, so consumers' `onInit` see the\n // initialized viewport. Replaces a `setTimeout(() => …, 1)` that deferred the emit by a macrotask to\n // approximate the same \"after the viewport is ready\" timing.\n { flush: 'post' },\n );\n}\n","import type { Edge, Node } from '../types';\nimport { watch } from 'vue';\nimport { useVueFlow } from './useVueFlow';\n\n/**\n * Fires the `selectionChange` event whenever the set of selected nodes or edges changes, mirroring\n * xyflow/react's `onSelectionChange`. Membership is tracked by id, so the event fires on select/deselect\n * — not on unrelated node/edge mutations (which would re-run the `getSelected*` getters but not change ids).\n *\n * Takes the store explicitly because it runs inside `<VueFlow>`'s own setup, where `inject` can't see\n * `<VueFlow>`'s own `provide` (see {@link useOnInitHandler}). Defaults to `useVueFlow()` for descendant callers.\n *\n * @internal\n */\nexport function useSelectionChange<NodeType extends Node = Node, EdgeType extends Edge = Edge>(\n vfInstance = useVueFlow<NodeType, EdgeType>(),\n) {\n watch(\n [\n () => vfInstance.getSelectedNodes.value.map(node => node.id).join(' '),\n () => vfInstance.getSelectedEdges.value.map(edge => edge.id).join(' '),\n ],\n () => {\n vfInstance.emits.selectionChange({\n nodes: [...vfInstance.getSelectedNodes.value],\n edges: [...vfInstance.getSelectedEdges.value],\n });\n },\n );\n}\n","import type { Edge, Node } from '../types';\nimport { onMounted } from 'vue';\nimport { ErrorCode, isDev, VueFlowError } from '../utils';\nimport { useVueFlow } from './useVueFlow';\n\n/**\n * Takes the store explicitly because it runs inside `<VueFlow>`'s own setup, where `inject` can't see\n * `<VueFlow>`'s own `provide`. Defaults to `useVueFlow()` for descendant callers.\n *\n * @internal\n */\nexport function useStylesLoadedWarning<NodeType extends Node = Node, EdgeType extends Edge = Edge>(\n vfInstance = useVueFlow<NodeType, EdgeType>(),\n) {\n const { emits } = vfInstance;\n\n onMounted(() => {\n if (isDev()) {\n const pane = document.querySelector('.vue-flow__pane');\n\n if (pane && !(window.getComputedStyle(pane).zIndex === '1')) {\n emits.error(new VueFlowError(ErrorCode.MISSING_STYLES));\n }\n }\n });\n}\n","import type { Viewport } from '@xyflow/system';\nimport type { Ref } from 'vue';\nimport type { Edge, Node, VueFlowState } from '../types';\nimport { watch } from 'vue';\nimport { storeToRefs } from './storeToRefs';\nimport { useStore } from './useStore';\n\nfunction sameViewport(a: Viewport | undefined, b: Viewport | undefined) {\n return !!a && !!b && a.x === b.x && a.y === b.y && a.zoom === b.zoom;\n}\n\n/**\n * Two-way binds the `viewport` v-model to the store's canonical `transform`, matching xyflow/react's\n * controlled viewport and svelte's `bind:viewport`.\n *\n * - **in** (model → store): applies an externally-set `viewport` to the panzoom via `syncViewport` (which\n * doesn't fire pan/zoom events) and mirrors it onto `transform`. Re-runs once the panzoom mounts so the\n * controlled value wins over `ZoomPane`'s `defaultViewport` seed.\n * - **out** (store → model): writes `transform` changes back to the model so the binding stays in sync.\n *\n * Equality guards on both sides stop the round-trip from looping.\n *\n * @internal\n */\nexport function useViewportSync<NodeType extends Node = Node, EdgeType extends Edge = Edge>(\n model: Ref<Viewport | undefined>,\n state: VueFlowState<NodeType, EdgeType> = useStore<NodeType, EdgeType>(),\n) {\n const { transform, panZoom } = storeToRefs(state);\n\n // also keyed on `panZoom` so the controlled value is re-applied once the instance mounts (its initial\n // `defaultViewport` seed would otherwise clobber a transform set before mount)\n watch(\n [model, panZoom],\n ([viewport]) => {\n if (!viewport) {\n return;\n }\n\n const current = { x: transform.value[0], y: transform.value[1], zoom: transform.value[2] };\n if (sameViewport(viewport, current)) {\n return;\n }\n\n panZoom.value?.syncViewport(viewport);\n transform.value = [viewport.x, viewport.y, viewport.zoom];\n },\n { immediate: true },\n );\n\n watch(transform, (next) => {\n const viewport = { x: next[0], y: next[1], zoom: next[2] };\n if (sameViewport(viewport, model.value)) {\n return;\n }\n\n model.value = viewport;\n });\n}\n","import type { HandleElement } from '../../types';\nimport { ConnectionLineType, ConnectionMode, getBezierPath, getHandlePosition, getMarkerId, getSmoothStepPath, oppositePosition, Position } from '@xyflow/system';\nimport { computed, defineComponent, h, inject } from 'vue';\nimport { storeToRefs, useStore, useVueFlow } from '../../composables';\nimport { Slots } from '../../context';\nimport { getSimpleBezierPath } from '../Edges/SimpleBezierEdge';\n\nconst ConnectionLine = defineComponent({\n name: 'ConnectionLine',\n compatConfig: { MODE: 3 },\n setup() {\n const { id, viewport, getInternalNode } = useVueFlow();\n\n const {\n connectionMode,\n connectionStartHandle,\n connectionEndHandle,\n connectionPosition,\n connectionLineOptions,\n connectionStatus,\n } = storeToRefs(useStore());\n\n const connectionLineComponent = inject(Slots)?.['connection-line'];\n\n const fromNode = computed(() => getInternalNode(connectionStartHandle.value?.nodeId));\n\n const toNode = computed(() => getInternalNode(connectionEndHandle.value?.nodeId) ?? null);\n\n // `connectionPosition` holds the raw pointer (screen space); convert to flow space for the line + the\n // custom connection-line component. The line END snaps to the hovered handle (below) when there is one.\n const pointer = computed(() => {\n return {\n x: (connectionPosition.value.x - viewport.value.x) / viewport.value.zoom,\n y: (connectionPosition.value.y - viewport.value.y) / viewport.value.zoom,\n };\n });\n\n const markerStart = computed(() =>\n connectionLineOptions.value.markerStart ? `url(#${getMarkerId(connectionLineOptions.value.markerStart, id)})` : '',\n );\n\n const markerEnd = computed(() =>\n connectionLineOptions.value.markerEnd ? `url(#${getMarkerId(connectionLineOptions.value.markerEnd, id)})` : '',\n );\n\n return () => {\n if (!fromNode.value || !connectionStartHandle.value) {\n return null;\n }\n\n const startHandleId = connectionStartHandle.value.id;\n\n const handleType = connectionStartHandle.value.type;\n\n const fromHandleBounds = fromNode.value.internals.handleBounds;\n let handleBounds = fromHandleBounds?.[handleType] ?? [];\n\n if (connectionMode.value === ConnectionMode.Loose) {\n const oppositeBounds = fromHandleBounds?.[handleType === 'source' ? 'target' : 'source'] ?? [];\n handleBounds = [...handleBounds, ...oppositeBounds];\n }\n\n const fromHandle = (startHandleId ? handleBounds.find(d => d.id === startHandleId) : handleBounds[0]) ?? null;\n const fromPosition = fromHandle?.position ?? Position.Top;\n const { x: fromX, y: fromY } = getHandlePosition(fromNode.value, fromHandle, fromPosition);\n\n let toHandle: HandleElement | null = null;\n if (toNode.value) {\n // if connection mode is strict, we only look for handles of the opposite type\n if (connectionMode.value === ConnectionMode.Strict) {\n toHandle\n = toNode.value.internals.handleBounds?.[handleType === 'source' ? 'target' : 'source']?.find(\n d => d.id === connectionEndHandle.value?.id,\n ) || null;\n }\n else {\n // if connection mode is loose, look for the handle in both source and target bounds\n toHandle\n = [\n ...(toNode.value.internals.handleBounds?.source ?? []),\n ...(toNode.value.internals.handleBounds?.target ?? []),\n ]?.find(d => d.id === connectionEndHandle.value?.id) || null;\n }\n }\n\n const toPosition = connectionEndHandle.value?.position ?? (fromPosition ? oppositePosition[fromPosition] : null);\n\n if (!fromPosition || !toPosition) {\n return null;\n }\n\n // snap the line end to the hovered handle when there is one; otherwise follow the raw pointer\n const { x: toX, y: toY }\n = toHandle && toNode.value ? getHandlePosition(toNode.value, toHandle, toPosition) : pointer.value;\n\n const type = connectionLineOptions.value.type ?? ConnectionLineType.Bezier;\n\n let dAttr = '';\n\n const pathParams = {\n sourceX: fromX,\n sourceY: fromY,\n sourcePosition: fromPosition,\n targetX: toX,\n targetY: toY,\n targetPosition: toPosition,\n };\n\n if (type === ConnectionLineType.Bezier) {\n ;[dAttr] = getBezierPath(pathParams);\n }\n else if (type === ConnectionLineType.Step) {\n ;[dAttr] = getSmoothStepPath({\n ...pathParams,\n borderRadius: 0,\n });\n }\n else if (type === ConnectionLineType.SmoothStep) {\n ;[dAttr] = getSmoothStepPath(pathParams);\n }\n else if (type === ConnectionLineType.SimpleBezier) {\n ;[dAttr] = getSimpleBezierPath(pathParams);\n }\n else {\n dAttr = `M${fromX},${fromY} ${toX},${toY}`;\n }\n\n return h(\n 'svg',\n { class: 'vue-flow__edges vue-flow__connectionline vue-flow__container' },\n h(\n 'g',\n { class: 'vue-flow__connection' },\n connectionLineComponent\n ? h(connectionLineComponent, {\n fromX,\n fromY,\n fromPosition,\n toX,\n toY,\n toPosition,\n fromNode: fromNode.value,\n fromHandle,\n toNode: toNode.value,\n toHandle,\n markerEnd: markerEnd.value,\n markerStart: markerStart.value,\n connectionStatus: connectionStatus.value,\n pointer: pointer.value,\n })\n : h('path', {\n 'd': dAttr,\n 'class': [connectionLineOptions.value.class, connectionStatus.value, 'vue-flow__connection-path'],\n 'style': {\n ...connectionLineOptions.value.style,\n },\n 'marker-end': markerEnd.value,\n 'marker-start': markerStart.value,\n }),\n ),\n );\n };\n },\n});\n\nexport default ConnectionLine;\n","import { onScopeDispose, watch } from 'vue';\nimport { storeToRefs } from './storeToRefs';\nimport { useNodesInitialized } from './useNodesInitialized';\nimport { useStore } from './useStore';\nimport { useVueFlow } from './useVueFlow';\n\n/**\n * Drives the `fitView` prop's initial fit.\n *\n * The fit is **one-shot**, mirroring xyflow — later user resizes don't re-fit. But the container can keep\n * resizing right after mount (e.g. the docs REPL lays out its preview pane after the flow), and a single fit\n * on the first measurement would latch against a too-small container → top-aligned view. So we re-fit on each\n * settle tick and only mark the fit *done* once the dimensions have stayed put for a frame; from then on the\n * watcher is inert. A user pan/zoom also ends it immediately.\n *\n * Must be called from a descendant of the provider (it injects the store) — currently `<ZoomPane>`, not\n * `<VueFlow>` itself (which can't inject its own `provide`).\n *\n * @internal\n */\nexport function useFitViewOnInit() {\n const { fitView, onMoveStart } = useVueFlow();\n const { panZoom, dimensions, fitViewOnInit, fitViewOnInitDone, fitViewOptions } = storeToRefs(useStore());\n const nodesInitialized = useNodesInitialized();\n\n // A user pan/zoom hands viewport control to the user — stop auto-fitting from then on. Our own\n // programmatic `fitView` also fires `moveStart`, but with a `null` `event` (no DOM source event), so\n // gating on `event` ignores it.\n let userControlled = false;\n onMoveStart(({ event }) => {\n if (event) {\n userControlled = true;\n }\n });\n\n // Latched once the container has settled (or the user took over). The initial fit is one-shot: once this\n // flips true the watcher is inert, so a later resize no longer re-fits.\n let done = false;\n // Each fit (re)arms this frame; if no dimension change re-fires the watcher before it runs, the container\n // has settled and we're done. A change cancels it and re-fits, so we always land on the final size.\n let settleFrame: number | undefined;\n\n watch(\n [nodesInitialized, panZoom, () => dimensions.value.width, () => dimensions.value.height],\n () => {\n if (\n done\n || userControlled\n || !fitViewOnInit.value\n || !panZoom.value\n || !nodesInitialized.value\n || !dimensions.value.width\n || !dimensions.value.height\n ) {\n return;\n }\n\n fitView(fitViewOptions?.value);\n // reveal the pane after the first fit — it's kept at `opacity: 0` until now (see `Viewport.vue`) to\n // avoid a flash of nodes at their unfit coordinates\n fitViewOnInitDone.value = true;\n\n if (settleFrame !== undefined) {\n cancelAnimationFrame(settleFrame);\n }\n settleFrame = requestAnimationFrame(() => {\n done = true;\n });\n },\n { immediate: true, flush: 'post' },\n );\n\n onScopeDispose(() => {\n if (settleFrame !== undefined) {\n cancelAnimationFrame(settleFrame);\n }\n }, true);\n}\n","import type { Ref } from 'vue';\nimport { getDimensions } from '@xyflow/system';\nimport { onBeforeUnmount, onMounted } from 'vue';\nimport { ErrorCode, VueFlowError } from '../utils';\nimport { storeToRefs } from './storeToRefs';\nimport { useStore } from './useStore';\nimport { useVueFlow } from './useVueFlow';\n\n/**\n * Composable that handles the resize of the viewport.\n *\n * @internal\n * @param viewportEl\n */\nexport function useResizeHandler(viewportEl: Ref<HTMLDivElement | null>): void {\n const { emits } = useVueFlow();\n const { dimensions } = storeToRefs(useStore());\n\n let resizeObserver: ResizeObserver;\n\n onMounted(() => {\n const updateDimensions = () => {\n if (!viewportEl.value || !(viewportEl.value.checkVisibility?.() ?? true)) {\n return;\n }\n\n const size = getDimensions(viewportEl.value);\n\n if (size.width === 0 || size.height === 0) {\n emits.error(new VueFlowError(ErrorCode.MISSING_VIEWPORT_DIMENSIONS));\n }\n\n dimensions.value = { width: size.width || 500, height: size.height || 500 };\n };\n\n updateDimensions();\n window.addEventListener('resize', updateDimensions);\n\n if (viewportEl.value) {\n resizeObserver = new ResizeObserver(() => updateDimensions());\n resizeObserver.observe(viewportEl.value);\n }\n\n onBeforeUnmount(() => {\n window.removeEventListener('resize', updateDimensions);\n\n const el = viewportEl.value;\n if (resizeObserver && el) {\n resizeObserver.unobserve(el);\n }\n });\n });\n}\n","import type { FunctionalComponent, HTMLAttributes } from 'vue';\nimport { Position } from '@xyflow/system';\nimport { h } from 'vue';\n\ninterface Props extends HTMLAttributes {\n position: Position;\n centerX: number;\n centerY: number;\n radius?: number;\n type: string;\n}\n\nfunction shiftX(x: number, shift: number, position: Position): number {\n if (position === Position.Left) {\n return x - shift;\n }\n if (position === Position.Right) {\n return x + shift;\n }\n return x;\n}\n\nfunction shiftY(y: number, shift: number, position: Position): number {\n if (position === Position.Top) {\n return y - shift;\n }\n if (position === Position.Bottom) {\n return y + shift;\n }\n return y;\n}\n\nconst EdgeAnchor: FunctionalComponent<Props> = function ({\n radius = 10,\n centerX = 0,\n centerY = 0,\n position = Position.Top,\n type,\n}) {\n return h('circle', {\n class: `vue-flow__edgeupdater vue-flow__edgeupdater-${type}`,\n cx: shiftX(centerX, radius, position),\n cy: shiftY(centerY, radius, position),\n r: radius,\n stroke: 'transparent',\n fill: 'transparent',\n });\n};\n\nEdgeAnchor.props = ['radius', 'centerX', 'centerY', 'position', 'type'];\nEdgeAnchor.compatConfig = { MODE: 3 };\n\nexport default EdgeAnchor;\n","import type { Connection, FinalConnectionState, HandleType } from '@xyflow/system';\nimport type { Edge, EdgeComponent, InternalNode, MouseTouchEvent } from '../../types';\nimport { ConnectionMode, getHandlePosition, getMarkerId, Position } from '@xyflow/system';\nimport { computed, defineComponent, getCurrentInstance, h, inject, provide, resolveComponent, shallowRef, toRef } from 'vue';\nimport { useHandle, useStore, useVueFlow } from '../../composables';\nimport { EdgeId, EdgeRef, Slots } from '../../context';\nimport { ARIA_EDGE_DESC_KEY, elementSelectionKeys, ErrorCode, getEdgeHandle, getEdgeZIndex, VueFlowError } from '../../utils';\nimport EdgeAnchor from './EdgeAnchor';\n\ninterface Props {\n id: string;\n}\n\n// candidate handles for one end of an edge: strict mode = only the matching side; loose mode = both\n// sides, matching side first (so `getEdgeHandle` prefers it)\nfunction getNodeHandles(node: InternalNode, side: 'source' | 'target', strict: boolean) {\n const bounds = node.internals.handleBounds;\n if (strict) {\n return bounds?.[side] ?? null;\n }\n\n const other = side === 'source' ? 'target' : 'source';\n return [...(bounds?.[side] ?? []), ...(bounds?.[other] ?? [])];\n}\n\nconst EdgeWrapper = defineComponent({\n name: 'Edge',\n compatConfig: { MODE: 3 },\n props: ['id'],\n setup(props: Props) {\n const { id: vueFlowId, addSelectedEdges, emits, getEdgeTypes, removeSelectedEdges, getEdge, getInternalNode } = useVueFlow();\n\n // Read the reactive store directly (see NodeWrapper) — `store.x` tracks reactively inside\n // computeds/handlers, so there's no need to project the whole state into refs per edge.\n const store = useStore();\n\n // `isValidConnection` is handed to `useHandle`, which reads it as a ref, so keep it as one.\n const isValidConnection = toRef(store, 'isValidConnection');\n\n const storedEdge = computed(() => getEdge(props.id) as Edge);\n\n const edge = computed<Edge>(() => {\n const defaults = store.defaultEdgeOptions;\n return defaults ? ({ ...(defaults as Edge), ...storedEdge.value } as Edge) : storedEdge.value;\n });\n\n // resolved per edge (value-gated computed) so the z-tracking of BOTH endpoint lookup keys lives in\n // this component's scope — resolving it in EdgeRenderer's v-for made the whole renderer re-render\n // (all edge vnodes) whenever ANY node entry was replaced, i.e. every drag frame\n const zIndex = computed(() => getEdgeZIndex(edge.value, getInternalNode, store.elevateEdgesOnSelect, store.zIndexMode));\n\n const slots = inject(Slots);\n\n const instance = getCurrentInstance();\n\n const mouseOver = shallowRef(false);\n\n const updating = shallowRef(false);\n\n const nodeId = shallowRef('');\n\n const handleId = shallowRef<string | null>(null);\n\n const reconnectHandleType = shallowRef<HandleType>('source');\n\n const edgeEl = shallowRef<SVGElement | null>(null);\n\n const isSelectable = toRef(() =>\n typeof edge.value.selectable === 'undefined' ? store.elementsSelectable : edge.value.selectable,\n );\n\n const isReconnectable = toRef(() =>\n typeof edge.value.reconnectable === 'undefined' ? store.edgesReconnectable : edge.value.reconnectable,\n );\n\n const isFocusable = toRef(() => (typeof edge.value.focusable === 'undefined' ? store.edgesFocusable : edge.value.focusable));\n\n provide(EdgeId, props.id);\n provide(EdgeRef, edgeEl);\n\n const edgeClass = computed(() => edge.value.class);\n const edgeStyle = computed(() => edge.value.style);\n\n const edgeCmp = computed(() => {\n const name = edge.value.type || 'default';\n\n const slot = slots?.[`edge-${name}`];\n if (slot) {\n return slot;\n }\n\n let edgeType = edge.value.template ?? getEdgeTypes.value[name];\n\n if (typeof edgeType === 'string') {\n if (instance) {\n const components = Object.keys(instance.appContext.components);\n if (components && components.includes(name)) {\n edgeType = resolveComponent(name, false) as EdgeComponent;\n }\n }\n }\n\n if (edgeType && typeof edgeType !== 'string') {\n return edgeType;\n }\n\n emits.error(new VueFlowError(ErrorCode.EDGE_TYPE_MISSING, edgeType));\n\n return false;\n });\n\n const { handlePointerDown } = useHandle({\n nodeId,\n handleId,\n type: reconnectHandleType,\n isValidConnection,\n reconnectHandleType,\n // xyflow/react + svelte hide the original edge AND emit `reconnectStart` from the system's\n // `onConnectStart` — i.e. once the reconnect drag actually starts (after the drag threshold), not\n // eagerly on pointerdown. A plain click on the anchor then leaves the edge in place and emits nothing.\n onReconnectStart: (event) => {\n updating.value = true;\n emits.reconnectStart({ event, edge: storedEdge.value, handleType: reconnectHandleType.value });\n },\n onReconnect,\n onReconnectEnd,\n });\n\n return () => {\n // bail if the edge was removed between a lookup update and this wrapper unmounting — otherwise the\n // derefs below throw when no `defaultEdgeOptions` mask the now-undefined edge\n if (!storedEdge.value) {\n return null;\n }\n\n const sourceNode = getInternalNode(edge.value.source);\n const targetNode = getInternalNode(edge.value.target);\n const pathOptions = 'pathOptions' in edge.value ? edge.value.pathOptions : {};\n\n if (!sourceNode && !targetNode) {\n emits.error(new VueFlowError(ErrorCode.EDGE_SOURCE_TARGET_MISSING, edge.value.id, edge.value.source, edge.value.target));\n\n return null;\n }\n\n if (!sourceNode) {\n emits.error(new VueFlowError(ErrorCode.EDGE_SOURCE_MISSING, edge.value.id, edge.value.source));\n\n return null;\n }\n\n if (!targetNode) {\n emits.error(new VueFlowError(ErrorCode.EDGE_TARGET_MISSING, edge.value.id, edge.value.target));\n\n return null;\n }\n\n if (!edge.value || edge.value.hidden || sourceNode.hidden || targetNode.hidden) {\n return null;\n }\n\n // strict mode considers only the matching side's handles; loose mode considers both (matching first)\n const strict = store.connectionMode === ConnectionMode.Strict;\n const sourceHandle = getEdgeHandle(getNodeHandles(sourceNode, 'source', strict), edge.value.sourceHandle);\n const targetHandle = getEdgeHandle(getNodeHandles(targetNode, 'target', strict), edge.value.targetHandle);\n\n const sourcePosition = sourceHandle?.position || Position.Bottom;\n\n const targetPosition = targetHandle?.position || Position.Top;\n\n // positions are render-local — computed each render and passed to the edge component as props,\n // never stored on the edge\n const { x: sourceX, y: sourceY } = getHandlePosition(sourceNode, sourceHandle, sourcePosition);\n const { x: targetX, y: targetY } = getHandlePosition(targetNode, targetHandle, targetPosition);\n\n // the full-container svg wrapper (one stacking context per edge zIndex) is rendered here rather\n // than in EdgeRenderer's v-for so its node-lookup tracking stays scoped to this edge\n return h(\n 'svg',\n { style: { zIndex: zIndex.value } },\n h(\n 'g',\n {\n 'ref': edgeEl,\n 'key': props.id,\n 'data-id': props.id,\n 'class': [\n 'vue-flow__edge',\n `vue-flow__edge-${edgeCmp.value === false ? 'default' : edge.value.type || 'default'}`,\n store.noPanClassName,\n edgeClass.value,\n {\n updating: mouseOver.value,\n selected: edge.value.selected,\n animated: edge.value.animated,\n inactive: !isSelectable.value && !store.hooks.edgeClick.hasListeners(),\n // @xyflow/system's CSS keys `cursor: pointer` and the focus stroke off `.selectable`\n selectable: isSelectable.value,\n },\n ],\n 'tabIndex': isFocusable.value ? 0 : undefined,\n 'aria-label':\n edge.value.ariaLabel === null\n ? undefined\n : edge.value.ariaLabel ?? `Edge from ${edge.value.source} to ${edge.value.target}`,\n 'aria-describedby': isFocusable.value ? `${ARIA_EDGE_DESC_KEY}-${vueFlowId}` : undefined,\n 'aria-roledescription': 'edge',\n 'role': isFocusable.value ? 'group' : 'img',\n ...edge.value.domAttributes,\n 'onClick': onEdgeClick,\n 'onContextmenu': onEdgeContextMenu,\n 'onDblclick': onDoubleClick,\n 'onMouseenter': onEdgeMouseEnter,\n 'onMousemove': onEdgeMouseMove,\n 'onMouseleave': onEdgeMouseLeave,\n 'onKeyDown': isFocusable.value ? onKeyDown : undefined,\n },\n [\n updating.value\n ? null\n : h(edgeCmp.value === false ? getEdgeTypes.value.default : (edgeCmp.value as any), {\n // no sourceNode/targetNode (custom edges resolve nodes via `useInternalNode`);\n // handles passed as sourceHandleId/targetHandleId\n id: props.id,\n source: edge.value.source,\n target: edge.value.target,\n type: edge.value.type,\n reconnectable: isReconnectable.value,\n selectable: isSelectable.value,\n deletable: edge.value.deletable,\n selected: edge.value.selected,\n animated: edge.value.animated,\n label: edge.value.label,\n labelStyle: edge.value.labelStyle,\n labelShowBg: edge.value.labelShowBg,\n labelBgStyle: edge.value.labelBgStyle,\n labelBgPadding: edge.value.labelBgPadding,\n labelBgBorderRadius: edge.value.labelBgBorderRadius,\n data: edge.value.data,\n style: edgeStyle.value,\n // only emit a marker ref when the edge actually has one — `getMarkerId(undefined)`\n // returns '' (→ `url('#')`), which otherwise writes a bogus marker attr on every edge\n // path every render (a wasted `setAttribute` per frame for the common marker-less edge)\n markerStart: edge.value.markerStart ? `url('#${getMarkerId(edge.value.markerStart, vueFlowId)}')` : undefined,\n markerEnd: edge.value.markerEnd ? `url('#${getMarkerId(edge.value.markerEnd, vueFlowId)}')` : undefined,\n sourcePosition,\n targetPosition,\n sourceX,\n sourceY,\n targetX,\n targetY,\n sourceHandleId: edge.value.sourceHandle,\n targetHandleId: edge.value.targetHandle,\n interactionWidth: edge.value.interactionWidth,\n ...pathOptions,\n }),\n [\n isReconnectable.value === 'source' || isReconnectable.value === true\n ? [\n h(\n 'g',\n {\n onMousedown: onReconnectSourceMouseDown,\n onMouseenter: onReconnectMouseEnter,\n onMouseout: onReconnectMouseOut,\n },\n h(EdgeAnchor, {\n 'position': sourcePosition,\n 'centerX': sourceX,\n 'centerY': sourceY,\n 'radius': store.reconnectRadius,\n 'type': 'source',\n 'data-type': 'source',\n }),\n ),\n ]\n : null,\n isReconnectable.value === 'target' || isReconnectable.value === true\n ? [\n h(\n 'g',\n {\n onMousedown: onReconnectTargetMouseDown,\n onMouseenter: onReconnectMouseEnter,\n onMouseout: onReconnectMouseOut,\n },\n h(EdgeAnchor, {\n 'position': targetPosition,\n 'centerX': targetX,\n 'centerY': targetY,\n 'radius': store.reconnectRadius,\n 'type': 'target',\n 'data-type': 'target',\n }),\n ),\n ]\n : null,\n ],\n ],\n ),\n );\n };\n\n function onReconnectMouseEnter() {\n mouseOver.value = true;\n }\n\n function onReconnectMouseOut() {\n mouseOver.value = false;\n }\n\n function onReconnect(event: MouseTouchEvent, connection: Connection) {\n emits.reconnect({ event, edge: storedEdge.value, connection });\n }\n\n function onReconnectEnd(event: MouseTouchEvent, connectionState: FinalConnectionState<InternalNode>) {\n emits.reconnectEnd({ event, edge: storedEdge.value, handleType: reconnectHandleType.value, connectionState });\n updating.value = false;\n }\n\n function handleReconnect(event: MouseEvent, isSourceHandle: boolean) {\n if (event.button !== 0) {\n return;\n }\n\n nodeId.value = isSourceHandle ? edge.value.target : edge.value.source;\n handleId.value = (isSourceHandle ? edge.value.targetHandle : edge.value.sourceHandle) ?? null;\n\n reconnectHandleType.value = isSourceHandle ? 'target' : 'source';\n\n handlePointerDown(event);\n }\n\n function onEdgeClick(event: MouseEvent) {\n const data = { event, edge: storedEdge.value };\n\n if (isSelectable.value) {\n store.nodesSelectionActive = false;\n\n if (edge.value.selected && store.multiSelectionActive) {\n removeSelectedEdges([storedEdge.value]);\n\n edgeEl.value?.blur();\n }\n else {\n addSelectedEdges([storedEdge.value]);\n }\n }\n\n emits.edgeClick(data);\n }\n\n function onEdgeContextMenu(event: MouseEvent) {\n emits.edgeContextMenu({ event, edge: storedEdge.value });\n }\n\n function onDoubleClick(event: MouseEvent) {\n emits.edgeDoubleClick({ event, edge: storedEdge.value });\n }\n\n function onEdgeMouseEnter(event: MouseEvent) {\n emits.edgeMouseEnter({ event, edge: storedEdge.value });\n }\n\n function onEdgeMouseMove(event: MouseEvent) {\n emits.edgeMouseMove({ event, edge: storedEdge.value });\n }\n\n function onEdgeMouseLeave(event: MouseEvent) {\n emits.edgeMouseLeave({ event, edge: storedEdge.value });\n }\n\n function onReconnectSourceMouseDown(event: MouseEvent) {\n handleReconnect(event, true);\n }\n\n function onReconnectTargetMouseDown(event: MouseEvent) {\n handleReconnect(event, false);\n }\n\n function onKeyDown(event: KeyboardEvent) {\n if (!store.disableKeyboardA11y && elementSelectionKeys.includes(event.key) && isSelectable.value) {\n const unselect = event.key === 'Escape';\n\n if (unselect) {\n edgeEl.value?.blur();\n\n removeSelectedEdges([storedEdge.value]);\n }\n else {\n addSelectedEdges([storedEdge.value]);\n }\n }\n }\n },\n});\n\nexport default EdgeWrapper;\n","import type { EdgeBase, Position } from '@xyflow/system';\nimport type { Component, CSSProperties, SVGAttributes, VNode } from 'vue';\nimport type { EdgeComponent, EdgeTextProps } from './components';\nimport type { ClassValue, Styles } from './flow';\n\n/** Edge markers */\nexport enum MarkerType {\n Arrow = 'arrow',\n ArrowClosed = 'arrowclosed',\n}\n\n/** Edge marker definition */\nexport interface EdgeMarker {\n /** Unique marker id */\n id?: string;\n /** Marker type */\n type: MarkerType;\n /** Marker color */\n color?: string;\n /** Marker width */\n width?: number;\n /** Marker height */\n height?: number;\n /** Marker units */\n markerUnits?: string;\n /** Marker orientation */\n orient?: string;\n /** Marker stroke width */\n strokeWidth?: number;\n}\n\nexport interface MarkerProps {\n id: string;\n type: MarkerType | string;\n /** Marker color; `null`/unset lets the `--xy-edge-stroke` CSS variable drive the arrowhead color */\n color?: string | null;\n width?: number;\n height?: number;\n markerUnits?: string;\n orient?: string;\n strokeWidth?: number;\n}\n\nexport type EdgeMarkerType = string | EdgeMarker;\n\nexport type EdgeReconnectable = boolean | 'target' | 'source';\n\nexport interface EdgeLabelOptions {\n /** Label styles (CSSProperties) */\n labelStyle?: CSSProperties;\n /** Show label bg */\n labelShowBg?: boolean;\n /** Label Bg styles (CSSProperties) */\n labelBgStyle?: CSSProperties;\n /** Label Bg padding */\n labelBgPadding?: [number, number];\n /** Label Bg border radius */\n labelBgBorderRadius?: number;\n}\n\n/**\n * User-facing edge type — reuses `@xyflow/system`'s `EdgeBase` (id, source/target(+handles), type,\n * animated, markers, data, deletable/selectable/selected, hidden, zIndex, ariaLabel, interactionWidth)\n * plus vue-flow-specific fields, mirroring how xyflow/react does `Edge = EdgeBase & EdgeLabelOptions & {…}`.\n */\nexport interface DefaultEdge<Data extends Record<string, unknown> = Record<string, unknown>, Type extends string = string>\n extends EdgeBase<Data, Type>,\n EdgeLabelOptions {\n /** An edge label */\n label?: string | VNode | Component<EdgeTextProps>;\n /** EdgeMarker — vue-flow's `EdgeMarkerType` (own `MarkerType` enum + `EdgeMarker`), overriding `EdgeBase`'s */\n markerStart?: EdgeMarkerType;\n /** EdgeMarker */\n markerEnd?: EdgeMarkerType;\n /** Disable/enable updating edge */\n reconnectable?: EdgeReconnectable;\n /** Disable/enable focusing edge (a11y) */\n focusable?: boolean;\n /** Additional class names */\n class?: ClassValue;\n /** Additional styles */\n style?: Styles;\n /** Overwrites current edge type */\n template?: EdgeComponent;\n /**\n * General escape hatch for adding custom attributes to the edge's DOM element.\n */\n domAttributes?: Omit<\n SVGAttributes,\n | 'id'\n | 'style'\n | 'className'\n | 'role'\n | 'aria-label'\n | 'onClick'\n | 'onMouseenter'\n | 'onMousemove'\n | 'onMouseleave'\n | 'onContextmenu'\n | 'onDblclick'\n | 'onKeyDown'\n >;\n}\n\nexport interface SmoothStepPathOptions {\n offset?: number;\n borderRadius?: number;\n /** where the bend sits along the path: 0 = at source, 1 = at target, 0.5 = midpoint @default 0.5 */\n stepPosition?: number;\n}\n\nexport type SmoothStepEdgeType<Data extends Record<string, unknown> = Record<string, unknown>> = DefaultEdge<Data> & {\n type: 'smoothstep';\n pathOptions?: SmoothStepPathOptions;\n};\n\nexport interface BezierPathOptions {\n curvature?: number;\n}\n\nexport type BezierEdgeType<Data extends Record<string, unknown> = Record<string, unknown>> = DefaultEdge<Data> & {\n type: 'default';\n pathOptions?: BezierPathOptions;\n};\n\nexport type Edge<Data extends Record<string, unknown> = Record<string, unknown>, Type extends string = string>\n = | DefaultEdge<Data, Type>\n | SmoothStepEdgeType<Data>\n | BezierEdgeType<Data>;\n\nexport type DefaultEdgeOptions = Omit<Edge, 'id' | 'source' | 'target' | 'sourceHandle' | 'targetHandle' | 'selected'>;\n\n/**\n * The computed positions an edge renders with — a render-OUTPUT type (xyflow's `EdgePosition`),\n * computed per render from the source/target `InternalNode`s. Never stored on an edge.\n */\nexport interface EdgePositions {\n sourceX: number;\n sourceY: number;\n targetX: number;\n targetY: number;\n}\n\n/**\n * Props passed to edge components. No `sourceNode`/`targetNode` (resolve them with `useInternalNode`);\n * handles are exposed as `sourceHandleId`/`targetHandleId`; markers are pre-resolved to url strings.\n */\nexport interface EdgeProps<EdgeType extends Edge = Edge> extends EdgeLabelOptions, EdgePositions {\n id: string;\n source: string;\n target: string;\n // optional, matching the verbatim model + RF's Pick: defaults are no longer stamped onto stored edges,\n // so `type`/`data` are genuinely undefined at runtime when the user didn't set them\n type?: EdgeType['type'];\n label?: string | VNode | Component<EdgeTextProps> | object;\n style?: CSSProperties;\n selected?: boolean;\n selectable?: boolean;\n deletable?: boolean;\n sourcePosition: Position;\n targetPosition: Position;\n sourceHandleId?: string | null;\n targetHandleId?: string | null;\n animated?: boolean;\n reconnectable?: EdgeReconnectable;\n // optional: an edge without markers has none at runtime, and `EdgeWrapper` passes them through\n // verbatim. Typed as required, a custom edge's `defineProps<EdgeProps>()` generates required runtime\n // props and Vue warns \"Invalid prop 'markerStart' … Expected String, got Undefined\". (Matches `Edge`,\n // `BaseEdgeProps` and xyflow/react, which all have these optional.)\n markerStart?: string;\n markerEnd?: string;\n curvature?: number;\n interactionWidth?: number;\n data?: EdgeType['data'];\n}\n\nexport interface BaseEdgeProps extends EdgeLabelOptions {\n id?: string;\n labelX?: number;\n labelY?: number;\n path: string;\n label?: any;\n markerStart?: string;\n markerEnd?: string;\n interactionWidth?: number;\n}\n\nexport type BezierEdgeProps = EdgePositions\n & BezierPathOptions\n & Omit<BaseEdgeProps, 'labelX' | 'labelY' | 'path'>\n & Pick<EdgeProps, 'sourcePosition' | 'targetPosition'>;\n\nexport type SimpleBezierEdgeProps = EdgePositions\n & Omit<BaseEdgeProps, 'labelX' | 'labelY' | 'path'>\n & Pick<EdgeProps, 'sourcePosition' | 'targetPosition'>;\n\nexport type StraightEdgeProps = EdgePositions & Omit<BaseEdgeProps, 'labelX' | 'labelY' | 'path'>;\n\nexport type StepEdgeProps = EdgePositions\n & Omit<BaseEdgeProps, 'labelX' | 'labelY' | 'path'>\n & Pick<EdgeProps, 'sourcePosition' | 'targetPosition'>;\n\nexport type SmoothStepEdgeProps = EdgePositions\n & Omit<BaseEdgeProps, 'labelX' | 'labelY' | 'path'>\n & Pick<EdgeProps, 'sourcePosition' | 'targetPosition'>\n & SmoothStepPathOptions;\n","<script lang=\"ts\" setup>\nimport type { MarkerProps } from '../../types';\nimport { MarkerType } from '../../types';\n\nconst {\n id,\n type,\n width = 12.5,\n height = 12.5,\n markerUnits = 'strokeWidth',\n orient = 'auto-start-reverse',\n strokeWidth = 1,\n color = 'none',\n} = defineProps<MarkerProps>();\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'MarkerType',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <marker\n :id=\"id\"\n class=\"vue-flow__arrowhead\"\n viewBox=\"-10 -10 20 20\"\n refX=\"0\"\n refY=\"0\"\n :markerWidth=\"`${width}`\"\n :markerHeight=\"`${height}`\"\n :markerUnits=\"markerUnits\"\n :orient=\"orient\"\n >\n <polyline\n v-if=\"type === MarkerType.ArrowClosed\"\n class=\"arrowclosed\"\n :style=\"color ? { stroke: color, fill: color, strokeWidth } : { strokeWidth }\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n points=\"-5,-4 0,0 -5,4 -5,-4\"\n />\n\n <polyline\n v-if=\"type === MarkerType.Arrow\"\n class=\"arrow\"\n :style=\"color ? { stroke: color, strokeWidth } : { strokeWidth }\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n fill=\"none\"\n points=\"-5,-4 0,0 -5,4\"\n />\n </marker>\n</template>\n","<script lang=\"ts\" setup>\nimport type { EdgeMarkerType, MarkerProps, MarkerType } from '../../types';\nimport { getMarkerId } from '@xyflow/system';\nimport { computed } from 'vue';\nimport { storeToRefs, useStore, useVueFlow } from '../../composables';\nimport MarkerSymbols from './MarkerSymbols.vue';\n\nconst { id: vueFlowId } = useVueFlow();\n\nconst { edges, connectionLineOptions, defaultEdgeOptions, defaultMarkerColor: defaultColor } = storeToRefs(useStore());\n\nconst markers = computed(() => {\n const ids: Set<string> = new Set();\n const markers: MarkerProps[] = [];\n\n const createMarkers = (marker?: EdgeMarkerType) => {\n if (marker) {\n const markerId = getMarkerId(marker, vueFlowId);\n\n if (!ids.has(markerId)) {\n if (typeof marker === 'object') {\n markers.push({ ...marker, id: markerId, color: marker.color || defaultColor.value });\n }\n else {\n markers.push({ id: markerId, color: defaultColor.value, type: marker as MarkerType });\n }\n\n ids.add(markerId);\n }\n }\n };\n\n for (const marker of [connectionLineOptions.value.markerEnd, connectionLineOptions.value.markerStart]) {\n createMarkers(marker);\n }\n\n for (const edge of edges.value) {\n // defaults are not stamped onto stored edges — resolve markers through defaultEdgeOptions at read time\n for (const marker of [\n edge.markerStart ?? defaultEdgeOptions.value?.markerStart,\n edge.markerEnd ?? defaultEdgeOptions.value?.markerEnd,\n ]) {\n createMarkers(marker);\n }\n }\n\n return markers.sort((a, b) => a.id.localeCompare(b.id));\n});\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'MarkerDefinitions',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <svg class=\"vue-flow__marker vue-flow__container\" aria-hidden=\"true\">\n <defs>\n <MarkerSymbols\n v-for=\"marker of markers\"\n :id=\"marker.id\"\n :key=\"marker.id\"\n :type=\"marker.type\"\n :color=\"marker.color\"\n :width=\"marker.width\"\n :height=\"marker.height\"\n :markerUnits=\"marker.markerUnits\"\n :stroke-width=\"marker.strokeWidth\"\n :orient=\"marker.orient\"\n />\n </defs>\n </svg>\n</template>\n","<script lang=\"ts\" setup>\nimport { computed } from 'vue';\nimport EdgeWrapper from '../../components/Edges/EdgeWrapper';\nimport { useVueFlow } from '../../composables';\nimport MarkerDefinitions from './MarkerDefinitions.vue';\n\nconst { getEdges } = useVueFlow();\n\n// value-stable id list (see NodeRenderer): keeps this v-for's render effect from re-running on every\n// edge commit — an edge data/selection update then re-renders only that edge's own wrapper, not all of them.\nconst edgeIds = computed<string[]>((prev) => {\n // hot path: reuse `prev` when edge membership is unchanged, allocating nothing. a plain indexed loop\n // avoids the per-element callback of `.every`; the rebuild below only runs on a membership change.\n const edges = getEdges.value;\n const len = edges.length;\n if (prev && prev.length === len) {\n let unchanged = true;\n for (let i = 0; i < len; i++) {\n if (edges[i].id !== prev[i]) {\n unchanged = false;\n break;\n }\n }\n if (unchanged) {\n return prev;\n }\n }\n return edges.map(edge => edge.id);\n});\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'Edges',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <div class=\"vue-flow__edges\">\n <MarkerDefinitions />\n\n <!-- iterate stable ids + v-memo so this v-for only re-runs on edge membership changes; an edge\n data/selection update re-renders just that edge's wrapper, and a node drag never touches it -->\n <EdgeWrapper v-for=\"id of edgeIds\" :id=\"id\" :key=\"id\" v-memo=\"[id]\" />\n </div>\n</template>\n","import type { BuiltInNode, MouseTouchEvent, NodeComponent } from '../../types';\nimport { getNodesInside, nodeHasDimensions } from '@xyflow/system';\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n h,\n inject,\n nextTick,\n onMounted,\n provide,\n resolveComponent,\n shallowRef,\n toRef,\n watch,\n} from 'vue';\nimport {\n isInputDOMNode,\n useDrag,\n useStore,\n useUpdateNodePositions,\n useVueFlow,\n} from '../../composables';\nimport { NodeId, NodeRef, Slots } from '../../context';\nimport { ARIA_NODE_DESC_KEY, arrowKeyDiffs, elementSelectionKeys, ErrorCode, handleNodeClick, VueFlowError } from '../../utils';\n\ninterface Props {\n id: string;\n resizeObserver: ResizeObserver;\n}\n\nconst NodeWrapper = defineComponent({\n name: 'Node',\n compatConfig: { MODE: 3 },\n props: ['id', 'resizeObserver'],\n setup(props: Props) {\n const {\n id: vueFlowId,\n emits,\n getInternalNode,\n removeSelectedNodes,\n addSelectedNodes,\n updateNodeDimensions,\n onUpdateNodeInternals,\n getNodeTypes,\n setCenter,\n } = useVueFlow();\n\n // Read the reactive store directly. Inside computeds/handlers `store.x` already tracks reactively, so\n // there's no need to project the whole state into refs per node (`storeToRefs` allocates a ref for every\n // state key on each call — a real cost when it runs once per node/edge/handle).\n const store = useStore();\n const { parentLookup } = store;\n\n // `nodesSelectionActive` is the one exception: it's handed to `handleNodeClick`, which writes it back,\n // so it needs a writable ref.\n const nodesSelectionActive = toRef(store, 'nodesSelectionActive');\n\n const nodeElement = shallowRef<HTMLDivElement | null>(null);\n provide(NodeRef, nodeElement);\n provide(NodeId, props.id);\n\n const slots = inject(Slots);\n\n const instance = getCurrentInstance();\n\n const updateNodePositions = useUpdateNodePositions();\n\n // `nodeRef` re-resolves to a NEW InternalNode object whenever the store re-adopts this node (immutable\n // model) — that reference swap is what re-renders this wrapper. Resolve it directly rather than through\n // the public `useNode`, which the wrapper would only use for `node` while also allocating unused\n // `parentNode`/`connectedEdges` computeds and a `nodeEl` inject per instance.\n const nodeRef = computed(() => getInternalNode(props.id));\n\n const isDraggable = toRef(() => {\n const node = nodeRef.value;\n return !node || typeof node.draggable === 'undefined' ? store.nodesDraggable : node.draggable;\n });\n\n const isSelectable = toRef(() => {\n const node = nodeRef.value;\n return !node || typeof node.selectable === 'undefined' ? store.elementsSelectable : node.selectable;\n });\n\n const isConnectable = toRef(() => {\n const node = nodeRef.value;\n return !node || typeof node.connectable === 'undefined' ? store.nodesConnectable : node.connectable;\n });\n\n const isFocusable = toRef(() => {\n const node = nodeRef.value;\n return !node || typeof node.focusable === 'undefined' ? store.nodesFocusable : node.focusable;\n });\n\n const hasPointerEvents = computed(\n () =>\n isSelectable.value\n || isDraggable.value\n || store.hooks.nodeClick.hasListeners()\n || store.hooks.nodeDoubleClick.hasListeners()\n || store.hooks.nodeMouseEnter.hasListeners()\n || store.hooks.nodeMouseMove.hasListeners()\n || store.hooks.nodeMouseLeave.hasListeners(),\n );\n\n // a node \"has dimensions\" once it's measured OR carries explicit `width`/`height` OR `initialWidth`/\n // `initialHeight` (the SSR fallback, where there's no ResizeObserver to measure) — mirrors xyflow/react\n // & xyflow/svelte's visibility gate so sized/SSR nodes render immediately instead of staying hidden.\n const isInit = computed(() => (nodeRef.value ? nodeHasDimensions(nodeRef.value) : false));\n\n // computed (not toRef): the value-equality gate keeps this node's render effect from re-running on\n // every `parentLookup` entry replacement — an uncached getter read in render tracks the raw map key\n const isParent = computed(() => (parentLookup.get(props.id)?.size ?? 0) > 0);\n\n const nodeCmp = computed(() => {\n const name = nodeRef.value?.type || 'default';\n\n const slot = slots?.[`node-${name}`];\n if (slot) {\n return slot;\n }\n\n let nodeType = getNodeTypes.value[name];\n\n if (typeof nodeType === 'string') {\n if (instance) {\n const components = Object.keys(instance.appContext.components);\n if (components && components.includes(name)) {\n nodeType = resolveComponent(name, false) as NodeComponent;\n }\n }\n }\n\n if (nodeType && typeof nodeType !== 'string') {\n return nodeType;\n }\n\n emits.error(new VueFlowError(ErrorCode.NODE_TYPE_MISSING, nodeType));\n\n return false;\n });\n\n const dragging = useDrag({\n id: props.id,\n el: nodeElement,\n disabled: () => !isDraggable.value,\n selectable: isSelectable,\n dragHandle: () => nodeRef.value?.dragHandle,\n onStart(event) {\n emits.nodeDragStart(event);\n },\n onDrag(event) {\n emits.nodeDrag(event);\n },\n onStop(event) {\n emits.nodeDragStop(event);\n },\n onClick(event) {\n onSelectNode(event);\n },\n });\n\n const getStyle = computed(() => {\n const node = nodeRef.value;\n // clone: never mutate the user's `node.style` (nodes are markRaw, so an in-place write isn't\n // reactive AND would cache stale width/height onto the user object across renders)\n const styles = { ...node?.style };\n\n // mirror xyflow/react's `getNodeInlineStyleDimensions`: before the node is measured (no handle bounds\n // yet — e.g. first paint / SSR) fall back through `initialWidth`/`initialHeight`; once measured, only\n // an explicit `width`/`height` overrides the natural measured size.\n const isMeasured = !!node?.internals.handleBounds;\n const width = node?.width ?? (isMeasured ? undefined : node?.initialWidth);\n const height = node?.height ?? (isMeasured ? undefined : node?.initialHeight);\n\n if (!styles.width && width != null) {\n styles.width = `${width}px`;\n }\n\n if (!styles.height && height != null) {\n styles.height = `${height}px`;\n }\n\n return styles;\n });\n\n const zIndex = toRef(() => Number(nodeRef.value?.zIndex ?? getStyle.value.zIndex ?? 0));\n\n onUpdateNodeInternals((updateIds) => {\n // when no ids are passed, update all nodes\n if (updateIds.includes(props.id) || !updateIds.length) {\n updateInternals();\n }\n });\n\n onMounted(() => {\n watch(\n () => nodeRef.value?.hidden,\n (isHidden = false, _, onCleanup) => {\n if (!isHidden && nodeElement.value) {\n props.resizeObserver.observe(nodeElement.value);\n\n onCleanup(() => {\n if (nodeElement.value) {\n props.resizeObserver.unobserve(nodeElement.value);\n }\n });\n }\n },\n { immediate: true, flush: 'post' },\n );\n });\n\n watch([() => nodeRef.value?.type, () => nodeRef.value?.sourcePosition, () => nodeRef.value?.targetPosition], () => {\n nextTick(() => {\n updateNodeDimensions([{ id: props.id, nodeElement: nodeElement.value as HTMLDivElement, forceUpdate: true }]);\n });\n });\n\n return () => {\n const node = nodeRef.value;\n\n if (!node || node.hidden) {\n return null;\n }\n\n return h(\n 'div',\n {\n 'ref': nodeElement,\n 'data-id': node.id,\n 'class': [\n 'vue-flow__node',\n `vue-flow__node-${nodeCmp.value === false ? 'default' : node.type || 'default'}`,\n {\n [store.noPanClassName]: isDraggable.value,\n dragging: dragging?.value,\n draggable: isDraggable.value,\n selected: node.selected,\n selectable: isSelectable.value,\n parent: isParent.value,\n },\n node.class,\n ],\n 'style': {\n visibility: isInit.value ? 'visible' : 'hidden',\n zIndex: node.internals.z ?? zIndex.value,\n transform: `translate(${node.internals.positionAbsolute.x}px,${node.internals.positionAbsolute.y}px)`,\n pointerEvents: hasPointerEvents.value ? 'all' : 'none',\n ...getStyle.value,\n },\n 'tabIndex': isFocusable.value ? 0 : undefined,\n 'role': isFocusable.value ? 'group' : undefined,\n 'aria-describedby': store.disableKeyboardA11y ? undefined : `${ARIA_NODE_DESC_KEY}-${vueFlowId}`,\n 'aria-label': node.ariaLabel,\n 'aria-roledescription': 'node',\n ...node.domAttributes,\n 'onMouseenter': onMouseEnter,\n 'onMousemove': onMouseMove,\n 'onMouseleave': onMouseLeave,\n 'onContextmenu': onContextMenu,\n 'onClick': onSelectNode,\n 'onDblclick': onDoubleClick,\n 'onKeydown': onKeyDown,\n 'onFocus': isFocusable.value ? onFocus : undefined,\n },\n [\n h(nodeCmp.value === false ? (getNodeTypes.value.default as NodeComponent<BuiltInNode>) : (nodeCmp.value as any), {\n // exactly the `NodeProps` surface (xyflow/react parity) — no legacy `connectable`/`position`/\n // `dimensions`/`parent`/`parentNodeId`/`resizing` duplicates, which bloated every node's props\n // and leaked onto custom-node DOM as `$attrs`\n id: node.id,\n type: node.type,\n data: node.data,\n selected: !!node.selected,\n dragging: dragging.value,\n isConnectable: isConnectable.value,\n positionAbsoluteX: node.internals.positionAbsolute.x,\n positionAbsoluteY: node.internals.positionAbsolute.y,\n width: node.measured.width,\n height: node.measured.height,\n parentId: node.parentId,\n zIndex: node.internals.z ?? zIndex.value,\n selectable: node.selectable ?? true,\n deletable: node.deletable ?? true,\n draggable: node.draggable ?? true,\n targetPosition: node.targetPosition,\n sourcePosition: node.sourcePosition,\n dragHandle: node.dragHandle,\n onUpdateNodeInternals: updateInternals,\n }),\n ],\n );\n };\n function updateInternals() {\n if (nodeElement.value) {\n updateNodeDimensions([{ id: props.id, nodeElement: nodeElement.value, forceUpdate: true }]);\n }\n }\n\n function onMouseEnter(event: MouseEvent) {\n const node = nodeRef.value;\n if (node && !dragging?.value) {\n emits.nodeMouseEnter({ event, node: node.internals.userNode });\n }\n }\n\n function onMouseMove(event: MouseEvent) {\n const node = nodeRef.value;\n if (node && !dragging?.value) {\n emits.nodeMouseMove({ event, node: node.internals.userNode });\n }\n }\n\n function onMouseLeave(event: MouseEvent) {\n const node = nodeRef.value;\n if (node && !dragging?.value) {\n emits.nodeMouseLeave({ event, node: node.internals.userNode });\n }\n }\n\n function onContextMenu(event: MouseEvent) {\n const node = nodeRef.value;\n if (node) {\n emits.nodeContextMenu({ event, node: node.internals.userNode });\n }\n }\n\n function onDoubleClick(event: MouseEvent) {\n const node = nodeRef.value;\n if (node) {\n emits.nodeDoubleClick({ event, node: node.internals.userNode });\n }\n }\n\n function onSelectNode(event: MouseTouchEvent) {\n const node = nodeRef.value;\n if (!node) {\n return;\n }\n\n if (isSelectable.value && (!store.selectNodesOnDrag || !isDraggable.value || store.nodeDragThreshold > 0)) {\n // handleNodeClick needs the enriched InternalNode; the event payload gets the user node\n handleNodeClick(\n node,\n store.multiSelectionActive,\n addSelectedNodes,\n removeSelectedNodes,\n nodesSelectionActive,\n false,\n nodeElement.value!,\n );\n }\n\n emits.nodeClick({ event, node: node.internals.userNode });\n }\n\n function onKeyDown(event: KeyboardEvent) {\n const node = nodeRef.value;\n if (!node || isInputDOMNode(event) || store.disableKeyboardA11y) {\n return;\n }\n\n if (elementSelectionKeys.includes(event.key) && isSelectable.value) {\n const unselect = event.key === 'Escape';\n\n handleNodeClick(\n node,\n store.multiSelectionActive,\n addSelectedNodes,\n removeSelectedNodes,\n nodesSelectionActive,\n unselect,\n nodeElement.value!,\n );\n }\n else if (isDraggable.value && node.selected && arrowKeyDiffs[event.key]) {\n // prevent page scrolling\n event.preventDefault();\n\n store.ariaLiveMessage = store.ariaLabelConfig['node.a11yDescription.ariaLiveMessage']({\n direction: event.key.replace('Arrow', '').toLowerCase(),\n x: ~~node.position.x,\n y: ~~node.position.y,\n });\n\n updateNodePositions(\n {\n x: arrowKeyDiffs[event.key].x,\n y: arrowKeyDiffs[event.key].y,\n },\n event.shiftKey,\n );\n }\n }\n\n // Pan the viewport to a node that receives KEYBOARD focus (Tab) and isn't currently visible, so\n // tabbing through nodes never lands on an off-screen one. `:focus-visible` keeps this to keyboard\n // focus (not pointer/programmatic).\n function onFocus() {\n const node = nodeRef.value;\n if (!node || store.disableKeyboardA11y || !store.autoPanOnNodeFocus || !nodeElement.value?.matches(':focus-visible')) {\n return;\n }\n\n const withinViewport\n = getNodesInside(\n new Map([[node.id, node]]),\n { x: 0, y: 0, width: store.dimensions.width, height: store.dimensions.height },\n store.transform,\n true,\n ).length > 0;\n\n if (!withinViewport) {\n setCenter(\n node.internals.positionAbsolute.x + (node.measured.width ?? 0) / 2,\n node.internals.positionAbsolute.y + (node.measured.height ?? 0) / 2,\n { zoom: store.transform[2] },\n );\n }\n }\n },\n});\n\nexport default NodeWrapper;\n","<script lang=\"ts\" setup>\nimport type { InternalNode } from '../../types';\nimport { getNodesBounds } from '@xyflow/system';\nimport { computed, onMounted, shallowRef } from 'vue';\nimport { storeToRefs, useDrag, useStore, useUpdateNodePositions, useVueFlow } from '../../composables';\nimport { arrowKeyDiffs } from '../../utils';\n\nconst { emits, viewport, getSelectedNodes } = useVueFlow();\n\nconst { nodeLookup } = useStore();\n\nconst { noPanClassName, disableKeyboardA11y, userSelectionActive } = storeToRefs(useStore());\n\nconst updatePositions = useUpdateNodePositions();\n\nconst el = shallowRef<HTMLDivElement | null>(null);\n\nconst dragging = useDrag({\n el,\n onStart(args) {\n emits.selectionDragStart(args);\n emits.nodeDragStart(args);\n },\n onDrag(args) {\n emits.selectionDrag(args);\n emits.nodeDrag(args);\n },\n onStop(args) {\n emits.selectionDragStop(args);\n emits.nodeDragStop(args);\n },\n});\n\nonMounted(() => {\n if (!disableKeyboardA11y.value) {\n el.value?.focus({ preventScroll: true });\n }\n});\n\n// getSelectedNodes is readonly (public guard); getNodesBounds only reads it (dims come from nodeLookup)\nconst selectedNodesBBox = computed(() => getNodesBounds(getSelectedNodes.value as InternalNode[], { nodeLookup }));\n\nconst innerStyle = computed(() => ({\n width: `${selectedNodesBBox.value.width}px`,\n height: `${selectedNodesBBox.value.height}px`,\n top: `${selectedNodesBBox.value.y}px`,\n left: `${selectedNodesBBox.value.x}px`,\n}));\n\nfunction onContextMenu(event: MouseEvent) {\n emits.selectionContextMenu({ event, nodes: [...getSelectedNodes.value] });\n}\n\nfunction onKeyDown(event: KeyboardEvent) {\n if (disableKeyboardA11y.value) {\n return;\n }\n\n if (arrowKeyDiffs[event.key]) {\n event.preventDefault();\n\n updatePositions(\n {\n x: arrowKeyDiffs[event.key].x,\n y: arrowKeyDiffs[event.key].y,\n },\n event.shiftKey,\n );\n }\n}\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'NodesSelection',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <div\n v-if=\"!userSelectionActive && selectedNodesBBox.width && selectedNodesBBox.height\"\n class=\"vue-flow__nodesselection vue-flow__container\"\n :class=\"noPanClassName\"\n :style=\"{ transform: `translate(${viewport.x}px,${viewport.y}px) scale(${viewport.zoom})` }\"\n >\n <div\n ref=\"el\"\n :class=\"{ dragging }\"\n class=\"vue-flow__nodesselection-rect\"\n :style=\"innerStyle\"\n :tabindex=\"disableKeyboardA11y ? undefined : -1\"\n @contextmenu=\"onContextMenu\"\n @keydown=\"onKeyDown\"\n />\n </div>\n</template>\n","<script lang=\"ts\" setup>\nimport type { SelectionRect } from '@xyflow/system';\n\ndefineProps<{ userSelectionRect: SelectionRect }>();\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'UserSelection',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <div\n class=\"vue-flow__selection vue-flow__container\"\n :style=\"{\n width: `${userSelectionRect.width}px`,\n height: `${userSelectionRect.height}px`,\n transform: `translate(${userSelectionRect.x}px, ${userSelectionRect.y}px)`,\n }\"\n />\n</template>\n","<script lang=\"ts\" setup>\nimport { computed, nextTick, onBeforeUnmount, onMounted, shallowRef, watch } from 'vue';\nimport { NodeWrapper } from '../../components';\nimport { useStore, useVueFlow } from '../../composables';\nimport { useNodesInitialized } from '../../composables/useNodesInitialized';\n\nconst { getNodes, updateNodeDimensions, emits } = useVueFlow();\n\nconst { nodeLookup } = useStore();\n\n// Iterate a value-stable id list so this v-for's render effect only re-runs when node *membership*\n// changes — not on every commit (each position/data update replaces the whole `nodes` array). A moved\n// node still re-renders through its own lookup-backed computed in NodeWrapper; this keeps a single-node\n// drag from re-diffing all N children every frame.\nconst nodeIds = computed<string[]>((prev) => {\n // hot path (every commit): reuse `prev` when membership is unchanged, allocating nothing. a plain\n // indexed loop avoids the per-element callback of `.every` on this O(n)-per-frame comparison; the\n // rebuild below only runs on the rare membership change, so the builtin stays for readability there.\n const nodes = getNodes.value;\n const len = nodes.length;\n if (prev && prev.length === len) {\n let unchanged = true;\n for (let i = 0; i < len; i++) {\n if (nodes[i].id !== prev[i]) {\n unchanged = false;\n break;\n }\n }\n if (unchanged) {\n return prev;\n }\n }\n return nodes.map(node => node.id);\n});\n\nconst nodesInitialized = useNodesInitialized();\n\nconst resizeObserver = shallowRef<ResizeObserver>();\n\nwatch(\n nodesInitialized,\n (isInit) => {\n if (isInit) {\n nextTick(() => {\n emits.nodesInitialized(Array.from(nodeLookup.values(), node => node.internals.userNode));\n });\n }\n },\n { immediate: true },\n);\n\nonMounted(() => {\n resizeObserver.value = new ResizeObserver((entries) => {\n const updates = entries.map((entry) => {\n const id = entry.target.getAttribute('data-id') as string;\n\n return {\n id,\n nodeElement: entry.target as HTMLDivElement,\n forceUpdate: true,\n };\n });\n\n nextTick(() => updateNodeDimensions(updates));\n });\n});\n\nonBeforeUnmount(() => resizeObserver.value?.disconnect());\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'Nodes',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <div class=\"vue-flow__nodes vue-flow__container\">\n <template v-if=\"resizeObserver\">\n <NodeWrapper v-for=\"id of nodeIds\" :id=\"id\" :key=\"id\" v-memo=\"[id]\" :resize-observer=\"resizeObserver\" />\n </template>\n </div>\n</template>\n","<script lang=\"ts\" setup>\nimport type { XYPosition } from '@xyflow/system';\nimport type { EdgeChange, NodeChange } from '../../types';\nimport { areSetsEqual, calcAutoPan, getEventPosition, getNodesInside, pointToRendererPoint, rendererPointToPoint, SelectionMode } from '@xyflow/system';\nimport { onUnmounted, shallowRef, toRef, watch } from 'vue';\nimport NodesSelection from '../../components/NodesSelection/NodesSelection.vue';\nimport UserSelection from '../../components/UserSelection/UserSelection.vue';\nimport { storeToRefs, useKeyPress, useStore, useVueFlow } from '../../composables';\nimport { getSelectionChanges } from '../../utils';\n\nconst { isSelecting, selectionKeyPressed } = defineProps<{ isSelecting: boolean; selectionKeyPressed: boolean }>();\n\nconst { emits, removeSelectedNodes, removeSelectedEdges, resetSelectedElements, getSelectedEdges, getSelectedNodes, deleteElements, panBy } = useVueFlow();\n\nconst { edgeLookup, nodeLookup } = useStore();\n\nconst {\n vueFlowRef,\n transform,\n userSelectionActive,\n userSelectionRect,\n elementsSelectable,\n nodesSelectionActive,\n selectionMode,\n deleteKeyCode,\n multiSelectionKeyCode,\n multiSelectionActive,\n connectionLookup,\n defaultEdgeOptions,\n connectionStartHandle,\n panOnDrag,\n paneClickDistance,\n autoPanOnSelection,\n autoPanSpeed,\n} = storeToRefs(useStore());\n\nconst container = shallowRef<HTMLDivElement | null>(null);\n\nconst selectedNodeIds = shallowRef<Set<string>>(new Set());\n\nconst selectedEdgeIds = shallowRef<Set<string>>(new Set());\n\nconst containerBounds = shallowRef<DOMRect | null>(null);\n\nconst hasActiveSelection = toRef(() => elementsSelectable.value && (isSelecting || userSelectionActive.value));\n\nconst connectionInProgress = toRef(() => connectionStartHandle.value !== null);\n\n// Used to prevent click events when the user lets go of the selectionKey during a selection\nlet selectionInProgress = false;\nlet selectionStarted = false;\n\n// Auto-pan while dragging the selection box near the edges of the container\nlet autoPanId = 0;\nlet autoPanStarted = false;\nlet lastPointerPosition: XYPosition = { x: 0, y: 0 };\n\nconst deleteKeyPressed = useKeyPress(deleteKeyCode, { actInsideInputWithModifier: false });\n\nconst multiSelectKeyPressed = useKeyPress(multiSelectionKeyCode);\n\nwatch(deleteKeyPressed, (isKeyPressed) => {\n if (!isKeyPressed) {\n return;\n }\n\n // routed through `deleteElements` so the `onBeforeDelete` guard (cancel/confirm/filter) is consulted\n deleteElements({\n nodes: [...getSelectedNodes.value],\n edges: [...getSelectedEdges.value],\n });\n\n nodesSelectionActive.value = false;\n});\n\nwatch(multiSelectKeyPressed, (isKeyPressed) => {\n multiSelectionActive.value = isKeyPressed;\n});\n\nonUnmounted(() => {\n cleanupAutoPan();\n});\n\nfunction wrapHandler(handler: Function, containerRef: HTMLDivElement | null) {\n return (event: MouseEvent) => {\n if (event.target !== containerRef) {\n return;\n }\n\n handler?.(event);\n };\n}\n\nfunction onClick(event: MouseEvent) {\n if (selectionInProgress || connectionInProgress.value) {\n selectionInProgress = false;\n return;\n }\n\n emits.paneClick(event);\n\n // clears the selection, but keeps it while `elementsSelectable` is off (xyflow/react #5217)\n resetSelectedElements();\n\n nodesSelectionActive.value = false;\n}\n\nfunction onContextMenu(event: MouseEvent) {\n if (Array.isArray(panOnDrag.value) && panOnDrag.value?.includes(2)) {\n event.preventDefault();\n return;\n }\n\n emits.paneContextMenu(event);\n}\n\nfunction onWheel(event: WheelEvent) {\n emits.paneScroll(event);\n}\n\nfunction onPointerDown(event: PointerEvent) {\n containerBounds.value = vueFlowRef.value?.getBoundingClientRect() ?? null;\n\n if (\n !elementsSelectable.value\n || !isSelecting\n || event.button !== 0\n || event.target !== container.value\n || !containerBounds.value\n ) {\n return;\n }\n\n ;(event.target as Element)?.setPointerCapture?.(event.pointerId);\n\n const { x, y } = getEventPosition(event, containerBounds.value);\n\n selectionStarted = true;\n selectionInProgress = false;\n autoPanStarted = false;\n\n // the selection (resetting the current selection + `selectionStart`) only begins once the pointer moves\n // past the click threshold — see `onPointerMove`. Resetting here would clear the selection on a plain\n // click and open a selection box for it (xyflow/react #5593).\n\n // store the origin in flow coordinates so it stays anchored to the canvas while auto-panning\n const flowStart = pointToRendererPoint({ x, y }, transform.value);\n\n userSelectionRect.value = {\n width: 0,\n height: 0,\n startX: flowStart.x,\n startY: flowStart.y,\n x,\n y,\n };\n}\n\n// Recompute the selection rect (and the selected nodes/edges) from the current pointer position. Called\n// both on pointer move and on every auto-pan frame, so the selection keeps growing while the viewport pans.\nfunction commitUserSelectionRect(mouseX: number, mouseY: number) {\n if (!userSelectionRect.value) {\n return;\n }\n\n // `startX`/`startY` are stored in flow coordinates (so the origin stays put while panning); convert\n // back to screen coordinates to build the rect, which `getNodesInside` and `UserSelection` consume.\n const { startX = 0, startY = 0 } = userSelectionRect.value;\n const screenStart = rendererPointToPoint({ x: startX, y: startY }, transform.value);\n\n const nextUserSelectRect = {\n startX,\n startY,\n x: mouseX < screenStart.x ? mouseX : screenStart.x,\n y: mouseY < screenStart.y ? mouseY : screenStart.y,\n width: Math.abs(mouseX - screenStart.x),\n height: Math.abs(mouseY - screenStart.y),\n };\n\n const prevSelectedNodeIds = selectedNodeIds.value;\n const prevSelectedEdgeIds = selectedEdgeIds.value;\n selectedNodeIds.value = new Set(\n getNodesInside(nodeLookup, nextUserSelectRect, transform.value, selectionMode.value === SelectionMode.Partial, true).map(\n node => node.id,\n ),\n );\n\n selectedEdgeIds.value = new Set();\n // resolution order mirrors EdgeWrapper's isSelectable: edge.selectable ?? defaults ?? global flag\n const edgesSelectable = defaultEdgeOptions.value?.selectable ?? elementsSelectable.value;\n\n // We look for all edges connected to the selected nodes\n for (const nodeId of selectedNodeIds.value) {\n const connections = connectionLookup.value.get(nodeId);\n if (!connections) {\n continue;\n }\n for (const { edgeId } of connections.values()) {\n const edge = edgeLookup.get(edgeId);\n if (edge && (edge.selectable ?? edgesSelectable)) {\n selectedEdgeIds.value.add(edgeId);\n }\n }\n }\n\n if (!areSetsEqual(prevSelectedNodeIds, selectedNodeIds.value)) {\n const changes = getSelectionChanges(nodeLookup, selectedNodeIds.value) as NodeChange[];\n emits.nodesChange(changes);\n }\n\n if (!areSetsEqual(prevSelectedEdgeIds, selectedEdgeIds.value)) {\n const changes = getSelectionChanges(edgeLookup, selectedEdgeIds.value) as EdgeChange[];\n emits.edgesChange(changes);\n }\n\n userSelectionRect.value = nextUserSelectRect;\n userSelectionActive.value = true;\n nodesSelectionActive.value = false;\n}\n\n// rAF loop that pans the viewport while the pointer sits near a container edge during a selection, then\n// re-commits the selection rect from the (unchanged) pointer position so it grows toward the new viewport.\nfunction autoPan() {\n if (!autoPanOnSelection.value || !containerBounds.value) {\n return;\n }\n\n const [xMovement, yMovement] = calcAutoPan(lastPointerPosition, containerBounds.value, autoPanSpeed.value);\n\n panBy({ x: xMovement, y: yMovement }).then((panned) => {\n if (selectionInProgress && panned) {\n commitUserSelectionRect(lastPointerPosition.x, lastPointerPosition.y);\n }\n\n autoPanId = requestAnimationFrame(autoPan);\n });\n}\n\nfunction cleanupAutoPan() {\n cancelAnimationFrame(autoPanId);\n autoPanId = 0;\n autoPanStarted = false;\n}\n\nfunction onPointerMove(event: PointerEvent) {\n if (!containerBounds.value || !userSelectionRect.value) {\n return;\n }\n\n const { x: mouseX, y: mouseY } = getEventPosition(event, containerBounds.value);\n lastPointerPosition = { x: mouseX, y: mouseY };\n\n // begin the selection only once the pointer has moved past the click threshold — so a plain click\n // neither resets the current selection nor opens a selection box (xyflow/react #5593). Holding the\n // selection key starts immediately (`requiredDistance` 0). `startX`/`startY` are flow coords, so compare\n // against the start in screen space.\n if (!selectionInProgress) {\n const screenStart = rendererPointToPoint({ x: userSelectionRect.value.startX, y: userSelectionRect.value.startY }, transform.value);\n const requiredDistance = selectionKeyPressed ? 0 : paneClickDistance.value;\n const distance = Math.hypot(mouseX - screenStart.x, mouseY - screenStart.y);\n\n if (distance <= requiredDistance) {\n return;\n }\n\n removeSelectedNodes();\n removeSelectedEdges();\n emits.selectionStart(event);\n }\n\n selectionInProgress = true;\n\n if (!autoPanStarted) {\n autoPan();\n autoPanStarted = true;\n }\n\n commitUserSelectionRect(mouseX, mouseY);\n}\n\nfunction onPointerUp(event: PointerEvent) {\n if (event.button !== 0 || !selectionStarted) {\n return;\n }\n\n ;(event.target as Element)?.releasePointerCapture(event.pointerId);\n\n // We only want to trigger click functions when in selection mode if\n // the user did not move the mouse.\n if (!userSelectionActive.value && userSelectionRect.value && event.target === container.value) {\n onClick(event);\n }\n\n userSelectionActive.value = false;\n userSelectionRect.value = null;\n\n // only a real selection drag (not a plain click) updates the selection box / emits `selectionEnd`\n // (xyflow/react #5593)\n if (selectionInProgress) {\n nodesSelectionActive.value = selectedNodeIds.value.size > 0;\n emits.selectionEnd(event);\n }\n\n // If the user kept holding the selectionKey during the selection,\n // we need to reset the selectionInProgress, so the next click event is not prevented\n if (selectionKeyPressed) {\n selectionInProgress = false;\n }\n\n selectionStarted = false;\n\n cleanupAutoPan();\n}\n\nfunction onPointerCancel(event: PointerEvent) {\n ;(event.target as Element)?.releasePointerCapture?.(event.pointerId);\n cleanupAutoPan();\n}\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'Pane',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <div\n ref=\"container\"\n class=\"vue-flow__pane vue-flow__container\"\n :class=\"{ selection: isSelecting }\"\n @click=\"(event) => (hasActiveSelection ? undefined : wrapHandler(onClick, container)(event))\"\n @contextmenu=\"wrapHandler(onContextMenu, container)($event)\"\n @wheel.passive=\"wrapHandler(onWheel, container)($event)\"\n @pointerenter=\"(event) => (hasActiveSelection ? undefined : emits.paneMouseEnter(event))\"\n @pointerdown=\"(event) => (hasActiveSelection ? onPointerDown(event) : emits.paneMouseMove(event))\"\n @pointermove=\"(event) => (hasActiveSelection ? onPointerMove(event) : emits.paneMouseMove(event))\"\n @pointerup=\"(event) => (hasActiveSelection ? onPointerUp(event) : undefined)\"\n @pointercancel=\"(event) => (hasActiveSelection ? onPointerCancel(event) : undefined)\"\n @pointerleave=\"emits.paneMouseLeave($event)\"\n >\n <slot />\n <UserSelection v-if=\"userSelectionActive && userSelectionRect\" :user-selection-rect=\"userSelectionRect\" />\n <NodesSelection v-if=\"nodesSelectionActive && getSelectedNodes.length\" />\n </div>\n</template>\n","import { defineComponent, inject } from 'vue';\nimport { Slots } from '../../context';\n\n/**\n * Renders the `zoom-pane` slot from the provided {@link Slots} as its own propless component, so it\n * bails out of Viewport's per-frame (transform) re-renders: the slot is invoked once and rides the CSS\n * transform instead of being rebuilt each pan/zoom frame, and its own reactive updates stay contained\n * here rather than re-rendering Viewport. Same reason the node/edge renderers are child components.\n *\n * @internal\n */\nexport default defineComponent({\n name: 'ZoomPaneSlot',\n compatConfig: { MODE: 3 },\n setup() {\n const slots = inject(Slots);\n\n return () => slots?.['zoom-pane']?.() ?? null;\n },\n});\n","<script lang=\"ts\" setup>\nimport { computed } from 'vue';\nimport { storeToRefs, useStore, useVueFlow } from '../../composables';\nimport ZoomPaneSlot from './ZoomPaneSlot';\n\nconst { viewport } = useVueFlow();\n\nconst { fitViewOnInit, fitViewOnInitDone } = storeToRefs(useStore());\n\nconst isHidden = computed(() => {\n if (fitViewOnInit.value) {\n return !fitViewOnInitDone.value;\n }\n\n return false;\n});\n\nconst transform = computed(() => `translate(${viewport.value.x}px,${viewport.value.y}px) scale(${viewport.value.zoom})`);\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'Viewport',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <div class=\"vue-flow__viewport vue-flow__container\" :style=\"{ transform, opacity: isHidden ? 0 : undefined }\">\n <slot />\n\n <!-- the `zoom-pane` slot belongs in this transformed layer; pulled from the provided `Slots` as a\n propless child so it bails out of this component's per-frame (transform) re-renders -->\n <ZoomPaneSlot />\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { XYPanZoom } from '@xyflow/system';\nimport { onMounted, onUnmounted, toRef, watch } from 'vue';\nimport ConnectionLine from '../../components/ConnectionLine';\nimport { storeToRefs, useKeyPress, useStore, useVueFlow } from '../../composables';\nimport { useFitViewOnInit } from '../../composables/useFitViewOnInit';\nimport { useResizeHandler } from '../../composables/useResizeHandler';\nimport EdgeRenderer from '../EdgeRenderer/EdgeRenderer.vue';\nimport NodeRenderer from '../NodeRenderer/NodeRenderer.vue';\nimport Pane from '../Pane/Pane.vue';\nimport Viewport from '../Viewport/Viewport.vue';\n\nconst { id, emits } = useVueFlow();\n\nconst {\n transform,\n viewportRef: zoomPane,\n panZoom,\n paneDragging,\n userSelectionActive,\n zoomActivationKeyCode,\n minZoom,\n maxZoom,\n translateExtent,\n defaultViewport,\n zoomOnScroll,\n zoomOnPinch,\n panOnScroll,\n panOnScrollSpeed,\n panOnScrollMode,\n zoomOnDoubleClick,\n panOnDrag,\n preventScrolling,\n noPanClassName,\n noWheelClassName,\n panActivationKeyCode,\n selectionKeyCode,\n selectionOnDrag,\n paneClickDistance,\n connectionStartHandle,\n} = storeToRefs(useStore());\n\nconst zoomActivationKeyPressed = useKeyPress(zoomActivationKeyCode);\n\nconst panKeyPressed = useKeyPress(panActivationKeyCode);\n\nconst selectionKeyPressed = useKeyPress(selectionKeyCode);\n\nconst shouldPanOnDrag = toRef(() => !selectionKeyPressed.value && (panKeyPressed.value || panOnDrag.value));\n\nconst shouldPanOnScroll = toRef(() => panKeyPressed.value || panOnScroll.value);\n\n// selection-on-drag is active when the user opted in AND a left-drag wouldn't pan (so it selects instead)\nconst selectionOnDragActive = toRef(() => selectionOnDrag.value === true && shouldPanOnDrag.value !== true);\n\nconst isSelecting = toRef(() => selectionKeyPressed.value || selectionOnDragActive.value);\n\nuseResizeHandler(zoomPane);\n\n// drives the `fitView` prop's initial fit (waits for nodes + re-fits while the container settles)\nuseFitViewOnInit();\n\nonUnmounted(() => panZoom.value?.destroy());\n\nonMounted(() => {\n if (zoomPane.value) {\n const panZoomInstance = XYPanZoom({\n domNode: zoomPane.value,\n minZoom: minZoom.value,\n maxZoom: maxZoom.value,\n translateExtent: translateExtent.value,\n viewport: { x: transform.value[0], y: transform.value[1], zoom: transform.value[2], ...defaultViewport.value },\n onDraggingChange: isDraggingPane => (paneDragging.value = isDraggingPane),\n onPanZoomStart: (event, viewport) => {\n emits.moveStart({ event, viewport });\n emits.viewportChangeStart(viewport);\n },\n // `viewportChange` is emitted once per transform by `onTransformChange` below (which fires for both\n // user gestures and programmatic changes) — emitting it here too would double-fire it every frame.\n onPanZoom: (event, viewport) => {\n emits.move({ event, viewport });\n },\n onPanZoomEnd: (event, viewport) => {\n emits.moveEnd({ event, viewport });\n emits.viewportChangeEnd(viewport);\n },\n });\n\n const initialViewport = panZoomInstance.getViewport();\n transform.value = [initialViewport.x, initialViewport.y, initialViewport.zoom];\n panZoom.value = panZoomInstance;\n\n watch(\n [\n zoomOnScroll,\n zoomOnPinch,\n shouldPanOnScroll,\n panOnScrollSpeed,\n panOnScrollMode,\n zoomOnDoubleClick,\n shouldPanOnDrag,\n zoomActivationKeyPressed,\n preventScrolling,\n noPanClassName,\n userSelectionActive,\n noWheelClassName,\n paneClickDistance,\n selectionOnDragActive,\n connectionStartHandle,\n ],\n () => {\n panZoom.value?.update({\n zoomOnScroll: zoomOnScroll.value,\n zoomOnPinch: zoomOnPinch.value,\n panOnScroll: shouldPanOnScroll.value,\n panOnScrollSpeed: panOnScrollSpeed.value,\n panOnScrollMode: panOnScrollMode.value,\n zoomOnDoubleClick: zoomOnDoubleClick.value,\n panOnDrag: shouldPanOnDrag.value,\n zoomActivationKeyPressed: zoomActivationKeyPressed.value,\n preventScrolling: preventScrolling.value,\n noPanClassName: noPanClassName.value,\n userSelectionActive: userSelectionActive.value,\n noWheelClassName: noWheelClassName.value,\n paneClickDistance: paneClickDistance.value,\n // when selecting on drag, d3-zoom's click distance is set to Infinity so it never swallows the\n // gesture as a click — letting `paneClick` fire (xyflow/react #5572)\n selectionOnDrag: selectionOnDragActive.value,\n onTransformChange: (nextTransform) => {\n emits.viewportChange({ x: nextTransform[0], y: nextTransform[1], zoom: nextTransform[2] });\n transform.value = nextTransform;\n },\n connectionInProgress: !!connectionStartHandle.value,\n lib: 'vue',\n });\n },\n { immediate: true },\n );\n }\n});\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'ZoomPane',\n};\n</script>\n\n<template>\n <div ref=\"zoomPane\" :key=\"`renderer-${id}`\" class=\"vue-flow__renderer vue-flow__container\">\n <Pane\n :is-selecting=\"isSelecting\"\n :selection-key-pressed=\"selectionKeyPressed\"\n :class=\"{ connecting: !!connectionStartHandle, dragging: paneDragging, draggable: shouldPanOnDrag }\"\n >\n <Viewport>\n <EdgeRenderer />\n\n <ConnectionLine />\n\n <div class=\"vue-flow__edgelabel-renderer\" />\n\n <NodeRenderer />\n </Viewport>\n </Pane>\n </div>\n</template>\n","<script lang=\"ts\" setup generic=\"NodeType extends Node = Node, EdgeType extends Edge = Edge\">\nimport type { Viewport } from '@xyflow/system';\nimport type { Ref } from 'vue';\nimport type { Edge, FlowEmits, FlowProps, FlowSlots, Node, VueFlowInstance, VueFlowState } from '../../types';\nimport { inject, onUnmounted, provide } from 'vue';\nimport A11yDescriptions from '../../components/A11y/A11yDescriptions.vue';\nimport { storeToRefs } from '../../composables/storeToRefs';\nimport { useCreateVueFlow } from '../../composables/useCreateVueFlow';\nimport { useOnInitHandler } from '../../composables/useOnInitHandler';\nimport { useSelectionChange } from '../../composables/useSelectionChange';\nimport { useStylesLoadedWarning } from '../../composables/useStylesLoadedWarning';\nimport { useViewportSync } from '../../composables/useViewportSync';\nimport { useWatchProps } from '../../composables/useWatchProps';\nimport { Slots, VueFlow as VueFlowInjectionKey, VueFlowStateKey } from '../../context';\nimport { useHooks } from '../../store/hooks';\nimport ZoomPane from '../ZoomPane/ZoomPane.vue';\n\nconst props = withDefaults(defineProps<FlowProps<NodeType, EdgeType>>(), {\n snapToGrid: undefined,\n onlyRenderVisibleElements: undefined,\n edgesReconnectable: undefined,\n nodesConnectable: undefined,\n nodesDraggable: undefined,\n elementsSelectable: undefined,\n selectNodesOnDrag: undefined,\n preventScrolling: undefined,\n zoomOnScroll: undefined,\n zoomOnPinch: undefined,\n zoomOnDoubleClick: undefined,\n panOnScroll: undefined,\n panOnDrag: undefined,\n autoApplyChanges: undefined,\n forceColorMode: undefined,\n fitView: undefined,\n fitViewOptions: undefined,\n connectOnClick: undefined,\n connectionLineOptions: undefined,\n autoConnect: undefined,\n elevateEdgesOnSelect: undefined,\n elevateNodesOnSelect: undefined,\n disableKeyboardA11y: undefined,\n edgesFocusable: undefined,\n nodesFocusable: undefined,\n autoPanOnConnect: undefined,\n autoPanOnNodeDrag: undefined,\n autoPanOnNodeFocus: undefined,\n autoPanOnSelection: undefined,\n isValidConnection: undefined,\n onBeforeDelete: undefined,\n deleteKeyCode: undefined,\n selectionKeyCode: undefined,\n selectionOnDrag: undefined,\n multiSelectionKeyCode: undefined,\n panActivationKeyCode: undefined,\n zoomActivationKeyCode: undefined,\n});\n\nconst emit = defineEmits<FlowEmits<NodeType, EdgeType>>();\n\nconst slots = defineSlots<FlowSlots<NodeType, EdgeType>>();\n\nconst modelNodes = defineModel<NodeType[]>('nodes');\nconst modelEdges = defineModel<EdgeType[]>('edges');\nconst modelViewport = defineModel<Viewport>('viewport');\n\n// Reuse an ancestor `<VueFlowProvider>`'s store if present; otherwise this `<VueFlow>` owns it —\n// create + provide our own (auto-wrap, like react's `<Wrapper>`). The store is only ever created by a\n// provider boundary; `useVueFlow()`/`useStore()` are pure consumers. A reused store exposes its two\n// views via the same pair of injection keys (instance + state).\nconst injectedInstance = inject(VueFlowInjectionKey, null) as VueFlowInstance<NodeType, EdgeType> | null;\nconst injectedState = inject(VueFlowStateKey, null) as VueFlowState<NodeType, EdgeType> | null;\n\n// This `<VueFlow>` owns its store unless it reuses an ancestor provider's. When it owns the store, the\n// v-model refs back it directly as signals — single source of truth (svelte's `$bindable` proxy), so the\n// store mutating nodes/edges IS the v-model update, no out-sync. When it reuses a provider's store, the\n// model refs can't back the already-created store, so `useWatchProps` syncs them instead (rebinding a\n// reused store to the hosting `<VueFlow>`'s models is deferred to the multi-instance guard work).\nconst ownsStore = !injectedInstance;\n\nconst { instance, state } =\n injectedInstance && injectedState\n ? { instance: injectedInstance, state: injectedState }\n : useCreateVueFlow<NodeType, EdgeType>(props, {\n nodes: modelNodes as unknown as Ref<NodeType[]>,\n edges: modelEdges as unknown as Ref<EdgeType[]>,\n });\n\n// when reusing a provider's store, apply this `<VueFlow>`'s props to it\nif (!ownsStore) {\n instance.setState(props as Parameters<typeof instance.setState>[0]);\n}\n\n// watch props and update store state (nodes/edges are signal-backed when we own the store — see above)\nconst disposeWatchers = useWatchProps({ nodes: modelNodes, edges: modelEdges }, props, { instance, state }, ownsStore);\n\nuseHooks(emit, state.hooks);\n\nuseOnInitHandler(instance);\n\nuseSelectionChange(instance);\n\nuseStylesLoadedWarning(instance);\n\nuseViewportSync(modelViewport, state);\n\n// the container element ref needs the writable ref (not the unwrapped value) so Vue can assign it;\n// access it by member (`stateRefs.vueFlowRef`) so the template `:ref` binding doesn't auto-unwrap it\nconst stateRefs = storeToRefs(state);\n\n// slots will be passed via provide\n// this is to avoid having to pass them down through all the components\n// as that would require a lot of boilerplate and causes significant performance drops\nprovide(Slots, slots as unknown as FlowSlots);\n\nonUnmounted(disposeWatchers);\n\ndefineExpose<VueFlowInstance<NodeType, EdgeType>>(instance);\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'VueFlow',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <div :ref=\"stateRefs.vueFlowRef\" class=\"vue-flow\" :class=\"props.forceColorMode\">\n <!-- the `zoom-pane` slot (affected by zooming & panning) renders inside the transformed Viewport via\n the provided `Slots` (see ZoomPaneSlot), not drilled through ZoomPane → Pane → Viewport -->\n <ZoomPane />\n\n <!-- This slot is _not_ affected by zooming & panning -->\n <slot />\n\n <A11yDescriptions />\n </div>\n</template>\n","<script lang=\"ts\" setup>\nimport { useCreateVueFlow } from '../../composables/useCreateVueFlow';\n\n/**\n * Owns a VueFlow store and `provide`s it to its subtree. A descendant `<VueFlow>` reuses this\n * provided store instead of creating its own, and any component that calls `useVueFlow()` below this\n * point resolves the same store via `inject` — the way to share one store across sibling components\n * (mirrors `<ReactFlowProvider>` / `<SvelteFlowProvider>`). One provider scopes one store, so host a\n * single `<VueFlow>` per provider and use a separate provider for each independent flow.\n */\nconst props = defineProps<{ id?: string }>();\n\nuseCreateVueFlow({ id: props.id });\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'VueFlowProvider',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <slot />\n</template>\n"],"mappings":";;;;;;AAIA,MAAa,UAAyC,OAAO,SAAS;;AAEtE,MAAa,kBAA8C,OAAO,cAAc;AAChF,MAAa,SAA+B,OAAO,QAAQ;AAC3D,MAAa,UAA2D,OAAO,SAAS;AACxF,MAAa,SAA+B,OAAO,QAAQ;AAC3D,MAAa,UAAuD,OAAO,SAAS;AACpF,MAAaA,UAA2C,OAAO,OAAO;;;ACXtE,IAAY,YAAL,yBAAA,WAAA;CACL,UAAA,oBAAA;CACA,UAAA,iCAAA;CACA,UAAA,kBAAA;CACA,UAAA,oBAAA;CACA,UAAA,yBAAA;CACA,UAAA,uBAAA;CACA,UAAA,yBAAA;CACA,UAAA,kBAAA;CACA,UAAA,oBAAA;CACA,UAAA,yBAAA;CACA,UAAA,yBAAA;CACA,UAAA,uBAAA;CACA,UAAA,gCAAA;CAEA,UAAA,mCAAA;;AACF,EAAA,CAAA,CAAA;AAEA,MAAM,WAAW;2BAEb;wCAC6C;oBACpB,OAAgB,6BAA6B;sBAC3C,OAAsB,4BAA4B;2BAC7C,IAAY,aAC5C,sCAAsC,GAAG,eAAe;yBAC1B,SAAiB,+BAA+B;2BAC9C,OAAe,sDAAsD;oBAC5E,OAAe,iDAAiD;2BACzD,IAAY,WAC5C,oCAAoC,GAAG,gBAAgB;2BACvB,IAAY,WAC5C,oCAAoC,GAAG,gBAAgB;yBACzB,SAAiB,+BAA+B;kCACvC,IAAY,QAAgB,WACnE,8CAA8C,GAAG,gBAAgB,OAAO,gBAAgB;sBAC7D,OAAe,4BAA4B;0CAEtE;AACJ;AAMA,IAAa,eAAb,cAA6G,MAAM;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EAEd,iBAAiB,EAAE,IAAI,MAAM,GAAG,CAAC;;;;;;;;;;4BAWvB,KAAA,QAAA,SAAA"}
1
+ {"version":3,"file":"index.js","names":["Slots","infiniteExtent","noop","alwaysValid","ConnectionMode","Position","Position","BaseEdge","Position","BaseEdge","Position","BaseEdge","BaseEdge","ResizeControlVariant","SelectionMode","PanOnScrollMode","ConnectionLineType","ConnectionMode","Position","Handle","Fragment","Position","Fragment","Handle","Position","Handle","Fragment","Slots","ConnectionMode","Position","oppositePosition","ConnectionLineType","Position","Slots","ConnectionMode","Position","Slots","Slots"],"sources":["../src/context/index.ts","../src/utils/errors.ts","../src/composables/useVueFlow.ts","../src/components/Background/patterns.ts","../src/components/Background/Background.vue","../src/components/Controls/ControlButton.vue","../src/composables/storeToRefs.ts","../src/composables/useDrag.ts","../src/utils/a11y.ts","../src/utils/changes.ts","../src/utils/createExtendedEventHook.ts","../src/utils/edge.ts","../src/utils/graph.ts","../src/utils/handle.ts","../src/utils/log.ts","../src/utils/node.ts","../src/utils/store.ts","../src/composables/useEdge.ts","../src/composables/useStore.ts","../src/composables/useHandle.ts","../src/composables/useNodeId.ts","../src/composables/useInternalNode.ts","../src/composables/useKeyPress.ts","../src/composables/useNode.ts","../src/composables/useUpdateNodePositions.ts","../src/composables/useViewportHelper.ts","../src/composables/useWatchProps.ts","../src/components/Panel/Panel.vue","../src/components/Controls/icons.ts","../src/components/Controls/Controls.vue","../src/components/Edges/EdgeText.vue","../src/components/Edges/BaseEdge.vue","../src/components/Edges/utils.ts","../src/components/Edges/BezierEdge.ts","../src/components/Edges/EdgeLabelRenderer.vue","../src/components/Edges/SimpleBezierEdge.ts","../src/components/Edges/SmoothStepEdge.ts","../src/components/Edges/StepEdge.ts","../src/components/Edges/StraightEdge.ts","../src/components/Handle/Handle.vue","../src/components/MiniMap/types.ts","../src/components/MiniMap/MiniMapNode.vue","../src/components/MiniMap/MiniMap.vue","../src/components/NodeResizer/utils.ts","../src/components/NodeResizer/ResizeControl.vue","../src/components/NodeResizer/NodeResizer.vue","../src/components/NodeToolbar/NodeToolbar.vue","../src/composables/useConnection.ts","../src/composables/useEdgesData.ts","../src/composables/useNodeConnections.ts","../src/composables/useNodesData.ts","../src/composables/useNodesInitialized.ts","../src/components/A11y/A11yDescriptions.vue","../src/store/hooks.ts","../src/store/state.ts","../src/store/actions.ts","../src/components/Nodes/DefaultNode.ts","../src/components/Nodes/InputNode.ts","../src/components/Nodes/OutputNode.ts","../src/utils/defaultNodesEdges.ts","../src/store/getters.ts","../src/store/createStore.ts","../src/composables/useCreateVueFlow.ts","../src/composables/useOnInitHandler.ts","../src/composables/useSelectionChange.ts","../src/composables/useStylesLoadedWarning.ts","../src/composables/useViewportSync.ts","../src/components/ConnectionLine/index.ts","../src/composables/useFitViewOnInit.ts","../src/composables/useResizeHandler.ts","../src/components/Edges/EdgeAnchor.ts","../src/components/Edges/EdgeWrapper.ts","../src/types/edge.ts","../src/container/EdgeRenderer/MarkerSymbols.vue","../src/container/EdgeRenderer/MarkerDefinitions.vue","../src/container/EdgeRenderer/EdgeRenderer.vue","../src/components/Nodes/NodeWrapper.ts","../src/components/NodesSelection/NodesSelection.vue","../src/components/UserSelection/UserSelection.vue","../src/container/NodeRenderer/NodeRenderer.vue","../src/container/Pane/Pane.vue","../src/container/Viewport/ZoomPaneSlot.ts","../src/container/Viewport/Viewport.vue","../src/container/ZoomPane/ZoomPane.vue","../src/container/VueFlow/VueFlow.vue","../src/container/VueFlowProvider/VueFlowProvider.vue"],"sourcesContent":["import type { InjectionKey, ShallowRef } from 'vue';\nimport type { FlowSlots, VueFlowInstance, VueFlowState } from '../types';\n\n/** the curated instance (`useVueFlow()`) */\nexport const VueFlow: InjectionKey<VueFlowInstance> = Symbol('vueFlow');\n/** the reactive state (`useStore()`) */\nexport const VueFlowStateKey: InjectionKey<VueFlowState> = Symbol('vueFlowState');\nexport const NodeId: InjectionKey<string> = Symbol('nodeId');\nexport const NodeRef: InjectionKey<ShallowRef<HTMLDivElement | null>> = Symbol('nodeRef');\nexport const EdgeId: InjectionKey<string> = Symbol('edgeId');\nexport const EdgeRef: InjectionKey<ShallowRef<SVGElement | null>> = Symbol('edgeRef');\nexport const Slots: InjectionKey<Readonly<FlowSlots>> = Symbol('slots');\n","export enum ErrorCode {\n MISSING_STYLES = 'MISSING_STYLES',\n MISSING_VIEWPORT_DIMENSIONS = 'MISSING_VIEWPORT_DIMENSIONS',\n NODE_INVALID = 'NODE_INVALID',\n NODE_NOT_FOUND = 'NODE_NOT_FOUND',\n NODE_MISSING_PARENT = 'NODE_MISSING_PARENT',\n NODE_TYPE_MISSING = 'NODE_TYPE_MISSING',\n NODE_EXTENT_INVALID = 'NODE_EXTENT_INVALID',\n EDGE_INVALID = 'EDGE_INVALID',\n EDGE_NOT_FOUND = 'EDGE_NOT_FOUND',\n EDGE_SOURCE_MISSING = 'EDGE_SOURCE_MISSING',\n EDGE_TARGET_MISSING = 'EDGE_TARGET_MISSING',\n EDGE_TYPE_MISSING = 'EDGE_TYPE_MISSING',\n EDGE_SOURCE_TARGET_MISSING = 'EDGE_SOURCE_TARGET_MISSING',\n\n USE_VUE_FLOW_OUTSIDE_PROVIDER = 'USE_VUE_FLOW_OUTSIDE_PROVIDER',\n}\n\nconst messages = {\n [ErrorCode.MISSING_STYLES]: () =>\n `It seems that you haven't loaded the necessary styles. Please import '@vue-flow/core/dist/style.css' to ensure that the graph is rendered correctly`,\n [ErrorCode.MISSING_VIEWPORT_DIMENSIONS]: () => 'The Vue Flow parent container needs a width and a height to render the graph',\n [ErrorCode.NODE_INVALID]: (id?: string) => `Node is invalid\\nNode id: ${id}`,\n [ErrorCode.NODE_NOT_FOUND]: (id: string | null) => `Node not found\\nNode id: ${id}`,\n [ErrorCode.NODE_MISSING_PARENT]: (id: string, parentId: string) =>\n `Node is missing a parent\\nNode id: ${id}\\nParent id: ${parentId}`,\n [ErrorCode.NODE_TYPE_MISSING]: (type: string) => `Node type is missing\\nType: ${type}`,\n [ErrorCode.NODE_EXTENT_INVALID]: (id: string) => `Only child nodes can use a parent extent\\nNode id: ${id}`,\n [ErrorCode.EDGE_INVALID]: (id: string) => `An edge needs a source and a target\\nEdge id: ${id}`,\n [ErrorCode.EDGE_SOURCE_MISSING]: (id: string, source: string) =>\n `Edge source is missing\\nEdge id: ${id} \\nSource id: ${source}`,\n [ErrorCode.EDGE_TARGET_MISSING]: (id: string, target: string) =>\n `Edge target is missing\\nEdge id: ${id} \\nTarget id: ${target}`,\n [ErrorCode.EDGE_TYPE_MISSING]: (type: string) => `Edge type is missing\\nType: ${type}`,\n [ErrorCode.EDGE_SOURCE_TARGET_MISSING]: (id: string, source: string, target: string) =>\n `Edge source or target is missing\\nEdge id: ${id} \\nSource id: ${source} \\nTarget id: ${target}`,\n [ErrorCode.EDGE_NOT_FOUND]: (id: string) => `Edge not found\\nEdge id: ${id}`,\n [ErrorCode.USE_VUE_FLOW_OUTSIDE_PROVIDER]: () =>\n `useVueFlow() was called without a <VueFlow> or <VueFlowProvider> ancestor (or outside a component setup). Render one of them above the call, or wrap your components in <VueFlowProvider> to share a store.`,\n} as const;\n\ntype ErrorArgs<T extends ErrorCode> = (typeof messages)[T] extends (...args: any[]) => string\n ? Parameters<(typeof messages)[T]>\n : never;\n\nexport class VueFlowError<T extends ErrorCode = ErrorCode, Args extends ErrorArgs<T> = ErrorArgs<T>> extends Error {\n name = 'VueFlowError';\n code: T;\n args: Args;\n\n constructor(code: T, ...args: Args) {\n // @ts-expect-error - TS doesn't know that the message is a key of messages\n super(messages[code]?.(...args));\n this.code = code;\n this.args = args;\n }\n}\n\nexport function isErrorOfType<T extends ErrorCode>(error: VueFlowError, code: T): error is VueFlowError<T> {\n return error.code === code;\n}\n","import type { Edge, Node, VueFlowInstance } from '../types';\nimport { inject } from 'vue';\nimport { VueFlow } from '../context';\nimport { ErrorCode, VueFlowError } from '../utils/errors';\n\n/**\n * Access the VueFlow instance for the surrounding flow — actions, computed getters, and event hooks\n * (mirrors `useReactFlow` / `useSvelteFlow`). For the raw reactive state (`nodes`, `transform`,\n * lookups, …) use {@link useStore} (and `storeToRefs` to destructure it).\n *\n * Pure context consumer — resolves the instance provided by the nearest `<VueFlow>` /\n * `<VueFlowProvider>` ancestor. It takes **no arguments**: there is no global registry, no\n * lookup-by-id, and no store creation here. To create/own a store, render a `<VueFlowProvider>` (or\n * `<VueFlow>`, which provides its own); to share one across components, wrap them in a common\n * `<VueFlowProvider>`.\n *\n * Throws if called outside a provider (or outside a component `setup`, where `inject` is unavailable).\n *\n * @public\n * @returns the VueFlow instance for the current context\n */\nexport function useVueFlow<NodeType extends Node = Node, EdgeType extends Edge = Edge>(): VueFlowInstance<NodeType, EdgeType> {\n const instance = inject(VueFlow, null) as VueFlowInstance<NodeType, EdgeType> | null;\n\n if (!instance) {\n throw new VueFlowError(ErrorCode.USE_VUE_FLOW_OUTSIDE_PROVIDER);\n }\n\n return instance;\n}\n","import type { FunctionalComponent } from 'vue';\nimport type { BackgroundVariant } from './types';\nimport { h } from 'vue';\n\ninterface LinePatternProps {\n dimensions: [number, number];\n size?: number;\n color: string;\n}\n\nexport const LinePattern: FunctionalComponent<LinePatternProps> = function ({ dimensions, size, color }) {\n return h('path', {\n 'stroke': color,\n 'stroke-width': size,\n 'd': `M${dimensions[0] / 2} 0 V${dimensions[1]} M0 ${dimensions[1] / 2} H${dimensions[0]}`,\n });\n};\n\ninterface DotPatternProps {\n radius: number;\n color: string;\n}\n\nexport const DotPattern: FunctionalComponent<DotPatternProps> = function ({ radius, color }) {\n return h('circle', { cx: radius, cy: radius, r: radius, fill: color });\n};\n\nexport const Patterns = {\n lines: LinePattern,\n dots: DotPattern,\n};\n\nexport const DefaultBgColors: Record<BackgroundVariant, string> = {\n lines: '#eee',\n dots: '#91919a',\n};\n","<script lang=\"ts\" setup>\nimport type { BackgroundProps } from './types';\nimport { computed } from 'vue';\nimport { useVueFlow } from '../../composables/useVueFlow';\nimport { DefaultBgColors, DotPattern, LinePattern } from './patterns';\n\nconst props = withDefaults(defineProps<BackgroundProps>(), {\n variant: 'dots',\n gap: 20,\n size: 1,\n lineWidth: 1,\n x: 0,\n y: 0,\n offset: 0,\n});\n\nconst { id: vueFlowId, viewport } = useVueFlow();\n\nconst background = computed(() => {\n const { gap, offset, size } = props;\n\n const zoom = viewport.value.zoom;\n const [gapX, gapY] = Array.isArray(gap) ? gap : [gap, gap];\n const scaledGap: [number, number] = [gapX * zoom || 1, gapY * zoom || 1];\n const scaledSize = size * zoom;\n const [offsetX, offsetY]: [number, number] = Array.isArray(offset) ? offset : [offset, offset];\n\n const scaledOffset: [number, number] = [offsetX * zoom || 1 + scaledGap[0] / 2, offsetY * zoom || 1 + scaledGap[1] / 2];\n\n return {\n scaledGap,\n offset: scaledOffset,\n size: scaledSize,\n };\n});\n\n// when there are multiple flows on a page we need to make sure that every background gets its own pattern.\nconst patternId = computed(() => `pattern-${vueFlowId}${props.id ? `-${props.id}` : ''}`);\n\nconst patternColor = computed(() => props.color || DefaultBgColors[props.variant || 'dots']);\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'Background',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <svg class=\"vue-flow__background vue-flow__container\">\n <slot :id=\"patternId\" name=\"pattern-container\">\n <pattern\n :id=\"patternId\"\n :x=\"viewport.x % background.scaledGap[0]\"\n :y=\"viewport.y % background.scaledGap[1]\"\n :width=\"background.scaledGap[0]\"\n :height=\"background.scaledGap[1]\"\n :patternTransform=\"`translate(-${background.offset[0]},-${background.offset[1]})`\"\n patternUnits=\"userSpaceOnUse\"\n >\n <slot name=\"pattern\">\n <template v-if=\"variant === 'lines'\">\n <LinePattern :size=\"lineWidth\" :color=\"patternColor\" :dimensions=\"background.scaledGap\" />\n </template>\n\n <template v-else-if=\"variant === 'dots'\">\n <DotPattern :color=\"patternColor\" :radius=\"background.size / 2\" />\n </template>\n </slot>\n </pattern>\n </slot>\n\n <rect :x=\"x\" :y=\"y\" width=\"100%\" height=\"100%\" :fill=\"`url(#${patternId})`\" />\n\n <slot :id=\"patternId\" />\n </svg>\n</template>\n","<script lang=\"ts\" setup>\ndefineProps<{\n disabled?: boolean;\n /** accessible label; applied as both `aria-label` and `title` (mirrors xyflow) */\n label?: string;\n}>();\n\ndefineEmits<{\n click: [payload: MouseEvent];\n}>();\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'ControlButton',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <button\n type=\"button\"\n class=\"vue-flow__controls-button\"\n :disabled=\"disabled\"\n :aria-label=\"label\"\n :title=\"label\"\n @click=\"$emit('click', $event)\"\n >\n <slot />\n </button>\n</template>\n","import type { ToRefs } from 'vue';\nimport type { Edge, Node, VueFlowState } from '../types';\nimport { toRefs } from 'vue';\n\n/**\n * Destructure the reactive state from {@link useStore} into refs without losing reactivity (Pinia's\n * `storeToRefs`). Destructuring the reactive state object directly hands back plain values for\n * scalar/array fields; this projects them to refs instead:\n *\n * ```ts\n * const { nodes, transform } = storeToRefs(useStore()) // Ref<Node[]>, Ref<Transform>\n * ```\n *\n * Reference-type fields (the `nodeLookup`/`parentLookup`/`edgeLookup`/`connectionLookup` Maps) stay\n * reactive when destructured straight off `useStore()` — you only need this for the value-type fields.\n *\n * @public\n */\nexport function storeToRefs<NodeType extends Node = Node, EdgeType extends Edge = Edge>(\n store: VueFlowState<NodeType, EdgeType>,\n): ToRefs<VueFlowState<NodeType, EdgeType>> {\n return toRefs(store);\n}\n","import type { CoordinateExtent, EdgeBase, InternalNodeBase, NodeBase, NodeDragItem as SystemNodeDragItem } from '@xyflow/system';\nimport type { MaybeRefOrGetter, Ref } from 'vue';\nimport type { Node, NodeDragEvent, NodeDragItem } from '../types';\nimport { infiniteExtent, isCoordinateExtent, XYDrag } from '@xyflow/system';\nimport { shallowRef, toValue, watchEffect } from 'vue';\nimport { useStore, useVueFlow } from '.';\n\ninterface UseDragParams {\n onStart: (event: NodeDragEvent) => void;\n onDrag: (event: NodeDragEvent) => void;\n onStop: (event: NodeDragEvent) => void;\n onClick?: (event: PointerEvent) => void;\n el: Ref<Element | null>;\n disabled?: MaybeRefOrGetter<boolean>;\n selectable?: MaybeRefOrGetter<boolean>;\n dragHandle?: MaybeRefOrGetter<string | undefined>;\n id?: string;\n}\n\n/**\n * Composable that provides drag behavior for nodes\n *\n * @internal\n * @param params\n */\nexport function useDrag(params: UseDragParams) {\n const { panBy, getInternalNode, removeSelectedNodes, removeSelectedEdges, updateNodePositions, getNodes, getEdges }\n = useVueFlow();\n\n // Read the reactive store directly — these are read inside the XYDrag `getStoreItems`/`update` callbacks\n // and the `watchEffect`, where `store.x` yields the current value with the same reactivity (no per-node\n // ref projection).\n const store = useStore();\n\n const { nodeLookup } = store;\n\n const { onStart, onDrag, onStop, onClick, el, disabled, id, selectable, dragHandle } = params;\n\n const dragging = shallowRef(false);\n\n watchEffect((onCleanup) => {\n const nodeEl = el.value;\n\n if (!nodeEl || toValue(disabled)) {\n return;\n }\n\n let dragFired = false;\n let pointerDownPos = { x: 0, y: 0 };\n\n const dragInstance = XYDrag({\n getStoreItems: () => ({\n // lazy getters: XYDrag never destructures `nodes`/`edges` (verified against every getStoreItems\n // call site in system), and getStoreItems runs multiple times per pointermove — eagerly reading\n // the getters here would recompute them per frame (O(n+m) with `onlyRenderVisibleElements`).\n // getNodes is readonly (public guard); XYDrag reads node data from nodeLookup, not this array.\n get nodes() {\n return getNodes.value as NodeBase[];\n },\n nodeLookup,\n get edges() {\n return getEdges.value as EdgeBase[];\n },\n nodeExtent: (isCoordinateExtent(store.nodeExtent as CoordinateExtent)\n ? store.nodeExtent\n : infiniteExtent) as CoordinateExtent,\n snapGrid: store.snapGrid,\n snapToGrid: store.snapToGrid,\n nodeOrigin: store.nodeOrigin,\n multiSelectionActive: store.multiSelectionActive,\n domNode: store.vueFlowRef,\n transform: store.transform,\n autoPanOnNodeDrag: store.autoPanOnNodeDrag,\n nodesDraggable: store.nodesDraggable,\n selectNodesOnDrag: store.selectNodesOnDrag,\n nodeDragThreshold: store.nodeDragThreshold,\n panBy,\n unselectNodesAndEdges: (args?: { nodes?: any[]; edges?: any[] }) => {\n removeSelectedNodes(args?.nodes);\n removeSelectedEdges(args?.edges);\n },\n updateNodePositions: (dragItems: Map<string, SystemNodeDragItem | InternalNodeBase>, isDragging?: boolean) => {\n const items: NodeDragItem[] = [];\n for (const raw of dragItems.values()) {\n // XYDrag may emit either NodeDragItem (the normal case) or InternalNodeBase entries\n // (selection drags). Both shapes carry `measured` and `internals.positionAbsolute`.\n const item = raw as SystemNodeDragItem;\n const node = getInternalNode(item.id);\n const width = item.measured?.width ?? node?.measured.width ?? 0;\n const height = item.measured?.height ?? node?.measured.height ?? 0;\n const positionAbsolute = item.internals?.positionAbsolute ?? node?.internals.positionAbsolute ?? { x: 0, y: 0 };\n items.push({\n id: item.id,\n position: item.position,\n distance: item.distance ?? { x: 0, y: 0 },\n measured: { width, height },\n internals: { positionAbsolute },\n extent: item.extent,\n parentId: item.parentId,\n expandParent: item.expandParent,\n dragging: item.dragging,\n origin: item.origin,\n });\n }\n updateNodePositions(items, true, isDragging ?? false);\n },\n autoPanSpeed: store.autoPanSpeed,\n }),\n // XYDrag hands user nodes (the InternalNode's `userNode`, spread with the live drag position +\n // `dragging`), which is exactly the event payload — emit them directly, no lookup round-trip\n onDragStart: (event, _dragItems, node, nodes) => {\n dragFired = true;\n dragging.value = true;\n onStart({ event, node: node as Node, nodes: nodes as Node[] });\n },\n onDrag: (event, _dragItems, node, nodes) => {\n onDrag({ event, node: node as Node, nodes: nodes as Node[] });\n },\n onDragStop: (event, _dragItems, node, nodes) => {\n dragging.value = false;\n onStop({ event, node: node as Node, nodes: nodes as Node[] });\n },\n });\n\n dragInstance.update({\n noDragClassName: store.noDragClassName,\n handleSelector: toValue(dragHandle),\n isSelectable: toValue(selectable),\n nodeId: id,\n domNode: nodeEl,\n nodeClickDistance: store.nodeClickDistance,\n });\n\n // Handle the \"moved slightly but within threshold\" click case.\n // XYDrag won't fire drag events for sub-threshold movement, and d3 would normally\n // suppress the native click. We detect this case with pointer listeners.\n const handlePointerDown = (e: PointerEvent) => {\n dragFired = false;\n pointerDownPos = { x: e.clientX, y: e.clientY };\n };\n\n const handlePointerUp = (e: PointerEvent) => {\n if (!dragFired && onClick) {\n const dx = e.clientX - pointerDownPos.x;\n const dy = e.clientY - pointerDownPos.y;\n const dist = Math.sqrt(dx * dx + dy * dy);\n\n if (dist > 0 && dist <= store.nodeDragThreshold) {\n onClick(e);\n }\n }\n };\n\n const target = nodeEl as HTMLElement;\n target.addEventListener('pointerdown', handlePointerDown);\n target.addEventListener('pointerup', handlePointerUp);\n\n onCleanup(() => {\n dragInstance.destroy();\n target.removeEventListener('pointerdown', handlePointerDown);\n target.removeEventListener('pointerup', handlePointerUp);\n });\n });\n\n return dragging;\n}\n","import type { XYPosition } from '@xyflow/system';\n\nexport const ARIA_NODE_DESC_KEY = 'vue-flow__node-desc';\nexport const ARIA_EDGE_DESC_KEY = 'vue-flow__edge-desc';\n\nexport const ARIA_LIVE_MESSAGE = 'vue-flow__aria-live';\n\nexport const elementSelectionKeys = ['Enter', ' ', 'Escape'];\n\nexport const arrowKeyDiffs: Record<string, XYPosition> = {\n ArrowUp: { x: 0, y: -1 },\n ArrowDown: { x: 0, y: 1 },\n ArrowLeft: { x: -1, y: 0 },\n ArrowRight: { x: 1, y: 0 },\n};\n","import type {\n EdgeRemoveChange,\n EdgeSelectionChange,\n NodeRemoveChange,\n NodeSelectionChange,\n} from '@xyflow/system';\nimport type {\n Edge,\n EdgeAddChange,\n EdgeChange,\n ElementChange,\n InternalNode,\n Node,\n NodeAddChange,\n NodeChange,\n} from '../types';\nimport { isNode } from '.';\n\n/**\n * Apply element changes IMMUTABLY (xyflow/react `applyNodeChanges` semantics): returns a NEW array where\n * changed elements are NEW objects and unchanged elements are reused by reference. Immutability is required\n * by the node split — the store re-adopts the result via `adoptUserNodes`, whose `checkEquality` reuses the\n * existing `InternalNode` when the user-node reference is unchanged; mutating in place would keep the same\n * reference and re-adopt a stale internal node. Reusing unchanged refs keeps re-adoption O(changed).\n *\n * `position`/`dimensions` changes are gated on `isNode` (user `Node`s have no `internals`, so the old\n * `isInternalNode` guard would skip them) — edges never receive those change types anyway.\n */\nexport function applyChanges<\n T extends Node | Edge = Node | Edge,\n C extends ElementChange = T extends InternalNode ? NodeChange : EdgeChange,\n>(changes: C[], elements: T[]): T[] {\n // bucket changes: field updates by id, plus add/remove\n const updatesById = new Map<string, C[]>();\n const addChanges: (NodeAddChange | EdgeAddChange)[] = [];\n const removeIds = new Set<string>();\n\n for (const change of changes) {\n if (change.type === 'add') {\n addChanges.push(change as NodeAddChange | EdgeAddChange);\n }\n else if (change.type === 'remove') {\n removeIds.add((change as NodeRemoveChange | EdgeRemoveChange).id);\n }\n else {\n const id = (change as { id?: string }).id;\n if (id == null) {\n continue;\n }\n const bucket = updatesById.get(id);\n if (bucket) {\n bucket.push(change);\n }\n else {\n updatesById.set(id, [change]);\n }\n }\n }\n\n const next: T[] = [];\n\n for (const element of elements) {\n if (removeIds.has(element.id)) {\n continue;\n }\n\n const elementChanges = updatesById.get(element.id);\n if (!elementChanges) {\n // unchanged → reuse the same reference (so the store's `checkEquality` re-adopt is a no-op)\n next.push(element);\n continue;\n }\n\n const updated = { ...element } as T;\n\n for (const currentChange of elementChanges) {\n switch (currentChange.type) {\n case 'select':\n ;(updated as { selected?: boolean }).selected = currentChange.selected;\n break;\n case 'position':\n if (isNode(updated)) {\n if (typeof currentChange.position !== 'undefined') {\n updated.position = currentChange.position;\n }\n\n if (typeof currentChange.dragging !== 'undefined') {\n updated.dragging = currentChange.dragging;\n }\n }\n break;\n case 'dimensions':\n if (isNode(updated)) {\n if (typeof currentChange.dimensions !== 'undefined') {\n updated.measured = { width: currentChange.dimensions.width, height: currentChange.dimensions.height };\n }\n\n if (currentChange.setAttributes) {\n const setW = currentChange.setAttributes === true || currentChange.setAttributes === 'width';\n const setH = currentChange.setAttributes === true || currentChange.setAttributes === 'height';\n updated.style = {\n ...(updated.style ?? {}),\n ...(setW && { width: `${currentChange.dimensions?.width}px` }),\n ...(setH && { height: `${currentChange.dimensions?.height}px` }),\n };\n }\n\n if (typeof currentChange.resizing !== 'undefined') {\n updated.resizing = currentChange.resizing;\n }\n }\n break;\n }\n }\n\n next.push(updated);\n }\n\n for (const change of addChanges) {\n if (next.some(el => el.id === change.item.id)) {\n continue;\n }\n\n if (typeof change.index === 'number') {\n next.splice(change.index, 0, change.item as unknown as T);\n }\n else {\n next.push(change.item as unknown as T);\n }\n }\n\n return next;\n}\n\n/** @deprecated Prefer the store instance's apply methods (from `useVueFlow` or the `onInit` instance). */\nexport function applyEdgeChanges(changes: EdgeChange[], edges: Edge[]) {\n return applyChanges(changes, edges);\n}\n\n/** @deprecated Prefer the store instance's apply methods (from `useVueFlow` or the `onInit` instance). */\nexport function applyNodeChanges(changes: NodeChange[], nodes: InternalNode[]) {\n return applyChanges(changes, nodes);\n}\n\nexport function createSelectionChange(id: string, selected: boolean): NodeSelectionChange | EdgeSelectionChange {\n return {\n id,\n type: 'select',\n selected,\n };\n}\n\nexport function createAdditionChange<\n T extends Node | Edge = Node,\n C extends NodeAddChange | EdgeAddChange = T extends Node ? NodeAddChange : EdgeAddChange,\n>(item: T, index?: number): C {\n return <C>{\n item,\n type: 'add',\n ...(typeof index === 'number' && { index }),\n };\n}\n\nexport function createNodeRemoveChange(id: string): NodeRemoveChange {\n return {\n id,\n type: 'remove',\n };\n}\n\nexport function createEdgeRemoveChange(id: string): EdgeRemoveChange {\n return {\n id,\n type: 'remove',\n };\n}\n\nexport function getSelectionChanges(\n items: Map<string, { id: string; selected?: boolean }>,\n selectedIds: Set<string> = new Set(),\n): NodeSelectionChange[] | EdgeSelectionChange[] {\n const changes: NodeSelectionChange[] | EdgeSelectionChange[] = [];\n\n for (const [id, item] of items) {\n const willBeSelected = selectedIds.has(id);\n\n // we don't want to set all items to selected=false on the first selection\n if (!(item.selected === undefined && !willBeSelected) && item.selected !== willBeSelected) {\n changes.push(createSelectionChange(item.id, willBeSelected));\n }\n }\n\n return changes;\n}\n","import { onScopeDispose } from 'vue';\n\n/**\n * vue-flow's own event-hook types. We intentionally do NOT reuse `@vueuse/core`'s `EventHook*` types:\n * since v14 its `Callback<T>` spreads array payloads (for `T extends any[]` it becomes\n * `(...param: T) => void`), which is incompatible with vue-flow's single-array-payload hooks — e.g.\n * `onNodesChange((changes: NodeChange[]) => void)` and `trigger(changes)`. Owning these types keeps the\n * public hook contract stable regardless of `@vueuse/core`'s internal callback variance.\n */\nexport type EventHookOn<T = any> = (fn: (param: T) => void) => { off: () => void };\nexport type EventHookOff<T = any> = (fn: (param: T) => void) => void;\nexport type EventHookTrigger<T = any> = (param: T) => Promise<unknown[]>;\n\nexport interface EventHook<T = any> {\n on: EventHookOn<T>;\n off: EventHookOff<T>;\n trigger: EventHookTrigger<T>;\n}\n\nexport interface EventHookExtended<T> extends EventHook<T> {\n /** true if any user listeners are registered (emitter ignored) */\n hasListeners: () => boolean;\n /** current user listeners (read-only; do not mutate externally) */\n listeners: ReadonlySet<(param: T) => void>;\n /** wire a single external emitter (e.g., for `emit`) */\n setEmitter: (fn: (param: T) => void) => void;\n /** remove the external emitter */\n removeEmitter: () => void;\n /** wire a function to detect if any emit listeners exist (e.g., for `$listeners` in Vue 2) */\n setHasEmitListeners: (fn: () => boolean) => void;\n /** remove the emit listeners detector */\n removeHasEmitListeners: () => void;\n}\n\ntype Handler<T = any> = (param: T) => any | Promise<any>;\n\nconst noop: Handler = () => {};\n\n// shared resolved promise for triggers with no observers — pointer-move hooks fire per mousemove, so\n// allocating a fresh array + allSettled chain for nothing is measurable GC pressure\nconst EMPTY_TRIGGER_RESULT: Promise<unknown[]> = Promise.resolve([]);\n\nexport function createExtendedEventHook<T = any>(defaultHandler?: (param: T) => void): EventHookExtended<T> {\n const listeners = new Set<Handler>();\n let emitter: Handler = noop;\n let hasEmitListeners = () => false;\n\n const hasListeners = () => listeners.size > 0 || hasEmitListeners();\n\n const setEmitter = (fn: Handler) => {\n emitter = fn;\n };\n\n const removeEmitter = () => {\n emitter = noop;\n };\n\n const setHasEmitListeners = (fn: () => boolean) => {\n hasEmitListeners = fn;\n };\n\n const removeHasEmitListeners = () => {\n hasEmitListeners = () => false;\n };\n\n const off: EventHookOff<T> = (fn) => {\n listeners.delete(fn);\n };\n\n const on: EventHookOn<T> = (fn) => {\n listeners.add(fn);\n\n const offFn = () => off(fn);\n // `failSilently` (Vue 3.5+) mirrors `tryOnScopeDispose`: auto-remove the listener when registered\n // inside an effect scope, and no-op (no warning) when `on()` is called outside one.\n onScopeDispose(offFn, true);\n\n return { off: offFn };\n };\n\n /**\n * Trigger order:\n * 1) If any user listeners OR an emitter exist -> call all of those (defaultHandler is skipped)\n * 2) Else (no listeners and no emitter) -> call defaultHandler (if provided)\n *\n * Errors are isolated via allSettled so one failing handler doesn't break others.\n */\n const trigger: EventHookTrigger<T> = (param) => {\n // fast path: nothing can observe this event — no programmatic listeners, no `@event` vnode handler\n // (the emitter would dispatch into a void emit), no default. Skip the dispatch + allocations.\n if (listeners.size === 0 && !hasEmitListeners() && !defaultHandler) {\n return EMPTY_TRIGGER_RESULT;\n }\n\n const queue: Handler[] = [emitter];\n\n if (hasListeners()) {\n queue.push(...listeners);\n }\n else if (defaultHandler) {\n queue.push(defaultHandler);\n }\n\n return Promise.allSettled(queue.map(fn => fn(param)));\n };\n\n return {\n on,\n off,\n trigger,\n hasListeners,\n listeners,\n setEmitter,\n removeEmitter,\n setHasEmitListeners,\n removeHasEmitListeners,\n };\n}\n","import type { ZIndexMode } from '@xyflow/system';\nimport type { Actions, Edge, HandleElement } from '../types';\nimport { getElevatedEdgeZIndex } from '@xyflow/system';\n\nexport function getEdgeHandle(bounds: HandleElement[] | null, handleId?: string | null): HandleElement | null {\n if (!bounds) {\n return null;\n }\n\n // if no handleId is given, we use the first handle, otherwise we check for the id\n return (!handleId ? bounds[0] : bounds.find(d => d.id === handleId)) || null;\n}\n\nexport function getEdgeZIndex(\n edge: Edge,\n getInternalNode: Actions['getInternalNode'],\n elevateEdgesOnSelect = false,\n zIndexMode: ZIndexMode = 'basic',\n) {\n const source = getInternalNode(edge.source);\n const target = getInternalNode(edge.target);\n\n if (!source || !target) {\n return 0;\n }\n\n return getElevatedEdgeZIndex({\n sourceNode: source,\n targetNode: target,\n selected: edge.selected ?? false,\n zIndex: typeof edge.zIndex === 'number' ? edge.zIndex : 0,\n elevateOnSelect: elevateEdgesOnSelect,\n zIndexMode,\n });\n}\n","import type { Connection } from '@xyflow/system';\nimport type { Edge, InternalNode, Node } from '../types';\nimport { isEdgeBase, isInternalNodeBase, isNodeBase } from '@xyflow/system';\n\nexport function isEdge<EdgeType extends Edge = Edge>(element: unknown): element is EdgeType {\n return !!element && typeof element === 'object' && isEdgeBase(element);\n}\n\nexport function isNode<NodeType extends Node = Node>(element: unknown): element is NodeType {\n return !!element && typeof element === 'object' && isNodeBase(element);\n}\n\nexport function isInternalNode<NodeType extends Node = Node>(element: unknown): element is InternalNode<NodeType> {\n return !!element && typeof element === 'object' && isInternalNodeBase(element);\n}\n\nexport function connectionExists(edge: Edge | Connection, edges: Edge[]) {\n return edges.some(\n el =>\n el.source === edge.source\n && el.target === edge.target\n && (el.sourceHandle === edge.sourceHandle || (!el.sourceHandle && !edge.sourceHandle))\n && (el.targetHandle === edge.targetHandle || (!el.targetHandle && !edge.targetHandle)),\n );\n}\n","import type { Connection, HandleType } from '@xyflow/system';\nimport type { Actions, Edge, HandleElement, IsValidParams, Node, NodeLookup, Result } from '../types';\nimport { ConnectionMode, getEventPosition, getHandlePosition } from '@xyflow/system';\n\nconst alwaysValid = () => true;\n\nfunction getHandleType(handleDomNode: Element | null): HandleType | null {\n if (handleDomNode?.classList.contains('target')) {\n return 'target';\n }\n else if (handleDomNode?.classList.contains('source')) {\n return 'source';\n }\n\n return null;\n}\n\nexport function getHandle(\n nodeId: string,\n handleType: HandleType,\n handleId: string | null,\n nodeLookup: NodeLookup,\n connectionMode: ConnectionMode,\n withAbsolutePosition = false,\n): HandleElement | null {\n const node = nodeLookup.get(nodeId);\n if (!node) {\n return null;\n }\n\n const handles\n = connectionMode === ConnectionMode.Strict\n ? node.internals.handleBounds?.[handleType]\n : [...(node.internals.handleBounds?.source ?? []), ...(node.internals.handleBounds?.target ?? [])];\n const handle = (handleId ? handles?.find(h => h.id === handleId) : handles?.[0]) ?? null;\n\n return handle && withAbsolutePosition ? { ...handle, ...getHandlePosition(node, handle, handle.position, true) } : handle;\n}\n\n// checks if and returns connection in form of an object { source: 123, target: 312 }\nexport function isValidHandle(\n event: MouseEvent | TouchEvent,\n {\n handle,\n connectionMode,\n fromNodeId,\n fromHandleId,\n fromType,\n doc,\n lib,\n flowId,\n isValidConnection = alwaysValid,\n }: IsValidParams,\n edges: Edge[],\n nodes: Node[],\n getInternalNode: Actions['getInternalNode'],\n nodeLookup: NodeLookup,\n) {\n const isTarget = fromType === 'target';\n const handleDomNode = handle\n ? doc.querySelector(`.${lib}-flow__handle[data-id=\"${flowId}-${handle?.nodeId}-${handle?.id}-${handle?.type}\"]`)\n : null;\n\n const { x, y } = getEventPosition(event);\n const handleBelow = doc.elementFromPoint(x, y);\n // we always want to prioritize the handle below the mouse cursor over the closest distance handle,\n // because it could be that the center of another handle is closer to the mouse pointer than the handle below the cursor\n const handleToCheck = handleBelow?.classList.contains(`${lib}-flow__handle`) ? handleBelow : handleDomNode;\n\n const result: Result = {\n handleDomNode: handleToCheck,\n isValid: false,\n connection: null,\n toHandle: null,\n };\n\n if (handleToCheck) {\n const handleType = getHandleType(handleToCheck);\n const handleNodeId = handleToCheck.getAttribute('data-nodeid');\n const handleId = handleToCheck.getAttribute('data-handleid');\n const connectable = handleToCheck.classList.contains('connectable');\n const connectableEnd = handleToCheck.classList.contains('connectableend');\n\n if (!handleNodeId || !handleType) {\n return result;\n }\n\n const connection: Connection = {\n source: isTarget ? handleNodeId : fromNodeId,\n sourceHandle: isTarget ? handleId : fromHandleId,\n target: isTarget ? fromNodeId : handleNodeId,\n targetHandle: isTarget ? fromHandleId : handleId,\n };\n\n result.connection = connection;\n\n const isConnectable = connectable && connectableEnd;\n // in strict mode we don't allow target to target or source to source connections\n const isValid\n = isConnectable\n && (connectionMode === ConnectionMode.Strict\n ? (isTarget && handleType === 'source') || (!isTarget && handleType === 'target')\n : handleNodeId !== fromNodeId || handleId !== fromHandleId);\n\n result.isValid\n = isValid\n && isValidConnection(connection, {\n nodes,\n edges,\n sourceNode: getInternalNode(connection.source)!,\n targetNode: getInternalNode(connection.target)!,\n });\n\n result.toHandle = getHandle(handleNodeId, handleType, handleId, nodeLookup, connectionMode, true);\n }\n\n return result;\n}\n","const productionEnvs = ['production', 'prod'];\n\nexport function warn(message: string, ...args: unknown[]) {\n if (isDev()) {\n console.warn(`[Vue Flow]: ${message}`, ...args);\n }\n}\n\nexport function isDev() {\n return !productionEnvs.includes(__ENV__ || '');\n}\n","import type { Ref } from 'vue';\nimport type { Actions, InternalNode, NodeLookup } from '../types';\nimport { nextTick } from 'vue';\n\n/**\n * Whether every node in the lookup has been measured — handle bounds resolved + non-zero dimensions. Hidden\n * nodes are skipped unless `includeHiddenNodes`. Shared by `useNodesInitialized` and `fitView`'s queue so the\n * \"are nodes ready\" check has a single definition.\n */\nexport function areNodesInitialized(nodeLookup: NodeLookup, includeHiddenNodes = false): boolean {\n if (nodeLookup.size === 0) {\n return false;\n }\n\n for (const node of nodeLookup.values()) {\n if (includeHiddenNodes || !node.hidden) {\n if (node.internals.handleBounds === undefined || !node.measured?.width || !node.measured?.height) {\n return false;\n }\n }\n }\n\n return true;\n}\n\nexport function handleNodeClick(\n node: InternalNode,\n multiSelectionActive: boolean,\n addSelectedNodes: Actions['addSelectedNodes'],\n removeSelectedNodes: Actions['removeSelectedNodes'],\n nodesSelectionActive: Ref<boolean>,\n unselect = false,\n nodeEl: HTMLDivElement,\n) {\n nodesSelectionActive.value = false;\n\n if (!node.selected) {\n addSelectedNodes([node]);\n }\n else if (unselect || (node.selected && multiSelectionActive)) {\n removeSelectedNodes([node]);\n\n nextTick(() => {\n nodeEl.blur();\n });\n }\n}\n","import type {\n Connection,\n CoordinateExtent,\n NodeConnection,\n NodeLookup as SystemNodeLookup,\n ParentLookup as SystemParentLookup,\n ZIndexMode,\n} from '@xyflow/system';\nimport type {\n Actions,\n ConnectionLookup,\n DefaultEdgeOptions,\n Edge,\n InternalNode,\n Node,\n NodeHandleBounds,\n NodeOrigin,\n State,\n ValidConnectionFunc,\n VueFlowInstance,\n} from '../types';\nimport { adoptUserNodes, getEdgeId } from '@xyflow/system';\nimport { markRaw, toRaw, unref } from 'vue';\nimport { connectionExists, ErrorCode, isEdge, isNode, VueFlowError } from '.';\n\ntype NonUndefined<T> = T extends undefined ? never : T;\n\nexport function isDef<T>(val: T): val is NonUndefined<T> {\n const unrefVal = unref(val);\n\n return typeof unrefVal !== 'undefined';\n}\n\n/**\n * Build a user `Edge` from a `Connection` (or validate a passed `Edge`). A `Connection` becomes a NEW\n * edge with `defaultEdgeOptions` merged in — the only point where defaults are persisted onto an edge.\n * User-supplied `Edge`s pass through verbatim; stored edges are never parsed or re-stamped.\n */\nexport function addEdgeToStore<EdgeType extends Edge = Edge>(\n edgeParams: EdgeType | Connection,\n edges: EdgeType[],\n triggerError: State['hooks']['error']['trigger'],\n defaultEdgeOptions?: DefaultEdgeOptions,\n): EdgeType | false {\n if (!edgeParams || !edgeParams.source || !edgeParams.target) {\n triggerError(new VueFlowError(ErrorCode.EDGE_INVALID, (edgeParams as undefined | Edge)?.id ?? `[ID UNKNOWN]`));\n return false;\n }\n\n let edge: EdgeType;\n if (isEdge<EdgeType>(edgeParams)) {\n edge = edgeParams;\n }\n else {\n edge = {\n ...defaultEdgeOptions,\n ...edgeParams,\n id: getEdgeId(edgeParams),\n } as EdgeType;\n }\n\n if (connectionExists(edge, edges)) {\n return false;\n }\n\n return edge;\n}\n\nexport function reconnectEdgeAction(\n edge: Edge,\n newConnection: Connection,\n prevEdge: Edge | undefined,\n shouldReplaceId: boolean,\n triggerError: State['hooks']['error']['trigger'],\n) {\n if (!newConnection.source || !newConnection.target) {\n triggerError(new VueFlowError(ErrorCode.EDGE_INVALID, edge.id));\n return false;\n }\n\n if (!prevEdge) {\n triggerError(new VueFlowError(ErrorCode.EDGE_NOT_FOUND, edge.id));\n return false;\n }\n\n const { id, ...rest } = edge;\n\n return {\n ...rest,\n id: shouldReplaceId ? getEdgeId(newConnection) : id,\n source: newConnection.source,\n target: newConnection.target,\n sourceHandle: newConnection.sourceHandle,\n targetHandle: newConnection.targetHandle,\n };\n}\n\nexport interface CreateInternalNodesOptions {\n nodeOrigin?: NodeOrigin;\n nodeExtent?: CoordinateExtent;\n elevateNodesOnSelect?: boolean;\n zIndexMode?: ZIndexMode;\n}\n\n/**\n * Adopt user `Node`s into the store's lookups, xyflow/react+svelte style: validate, then run\n * `@xyflow/system`'s `adoptUserNodes` DIRECTLY against the PERSISTENT `nodeLookup`/`parentLookup`\n * (mutated in place — cleared + repopulated) to build the enriched `InternalNode`s with parent-aware\n * `internals.{positionAbsolute, z, rootParentIndex, handleBounds, userNode}`.\n *\n * There is no second `parseNode` pass and no vue-flow-specific default-stamping (parity with RF/SF, which\n * apply no node defaults — undefined fields stay undefined; consumers tolerate them). `checkEquality`\n * reuses the existing `InternalNode` by reference whenever the user node is unchanged, so re-adopting on\n * every change is O(changed) and `measured`/`handleBounds` survive for unchanged nodes for free.\n *\n * Returns the validated user nodes (to be stored as the canonical `state.nodes` array) plus\n * `hasSelectedNodes` (whether any adopted node is `selected`, surfaced by `adoptUserNodes` for free — the\n * caller uses it to clear a stale `nodesSelectionActive`). The InternalNodes live only in `nodeLookup`;\n * `internals.userNode` references the exact user object stored in the array.\n */\nexport function adoptNodes<NodeType extends Node = Node>(\n nodes: NodeType[],\n nodeLookup: SystemNodeLookup<InternalNode<NodeType>>,\n parentLookup: SystemParentLookup<InternalNode<NodeType>>,\n triggerError: State['hooks']['error']['trigger'],\n options?: CreateInternalNodesOptions,\n): { nodes: NodeType[]; hasSelectedNodes: boolean } {\n const validNodes: NodeType[] = [];\n for (let i = 0; i < nodes.length; ++i) {\n const node = nodes[i];\n\n if (!isNode(node)) {\n triggerError(\n new VueFlowError(ErrorCode.NODE_INVALID, (node as undefined | Record<any, any>)?.id ?? `[ID UNKNOWN|INDEX ${i}]`),\n );\n continue;\n }\n\n // `markRaw` the user node so Vue never deep-proxies it (the perf goal — large `data` objects stay\n // raw). `toRaw` first in case it arrived as a reactive proxy; this is the choke point through which\n // every node enters `state.nodes`/`nodeLookup`. Reactivity for the UI comes from re-adopting (the\n // lookup `.set` + the per-node render computed), not from deep-proxying. Idempotent across re-adopts,\n // so `checkEquality` (reference identity) keeps matching for unchanged nodes.\n validNodes.push(markRaw(toRaw(node)));\n }\n\n // vue-flow's node-rep split keeps `measured` AND `handleBounds` off the user `Node`s — they live only on\n // the `InternalNode`. The system's `adoptUserNodes` sources both from the user node (`parseHandles` even\n // resets `handleBounds` to `undefined` when the node carries no `measured`), so re-committing fresh user\n // objects (a one-way `:nodes` reassignment, a layout pass, `nodes.value.map(...)`) resets:\n // - `measured` → `undefined`: the node fails `nodeHasDimensions`, renders `visibility:hidden`, and — since\n // its DOM size didn't change — the ResizeObserver never re-fires to restore it.\n // - `handleBounds` → `undefined`: edges fall back to the node's default handle positions, ignoring its\n // `sourcePosition`/`targetPosition` (e.g. a dagre layout's edges no longer meet the handles).\n // Snapshot both before adoption clears the lookup and carry them forward below. A genuine re-measure\n // (`updateNodeDimensions`, e.g. NodeWrapper's `sourcePosition` watcher) still overwrites them, and that\n // fresh result is in turn preserved by the next re-commit.\n const priorInternals = new Map<\n string,\n { measured?: { width?: number; height?: number }; handleBounds: NodeHandleBounds | undefined }\n >();\n for (const [id, internal] of nodeLookup) {\n const { width, height } = internal.measured ?? {};\n priorInternals.set(id, {\n measured: width !== undefined && height !== undefined ? { width, height } : undefined,\n handleBounds: internal.internals.handleBounds,\n });\n }\n\n const { hasSelectedNodes } = adoptUserNodes(validNodes, nodeLookup, parentLookup, { ...options, checkEquality: true });\n\n for (const node of validNodes) {\n if (node.parentId && !nodeLookup.has(node.parentId)) {\n triggerError(new VueFlowError(ErrorCode.NODE_MISSING_PARENT, node.id, node.parentId));\n }\n\n // re-adoption only kept `measured`/`handleBounds` if the user object carried them; restore the prior\n // values for re-committed nodes that didn't, so a content-agnostic update (class/position/layout) keeps\n // the node visible and its edges anchored to the right handles (see the snapshot above)\n const prior = priorInternals.get(node.id);\n if (prior) {\n const internal = nodeLookup.get(node.id);\n if (internal) {\n if (prior.measured && (internal.measured?.width === undefined || internal.measured?.height === undefined)) {\n internal.measured = prior.measured;\n }\n if (prior.handleBounds && !internal.internals.handleBounds) {\n internal.internals.handleBounds = prior.handleBounds;\n }\n }\n }\n }\n\n return { nodes: validNodes, hasSelectedNodes };\n}\n\n/**\n * this function adds the connection to the connectionLookup\n * at the following keys: nodeId-type-handleId, nodeId-type and nodeId\n * @param type type of the connection\n * @param connection connection that should be added to the lookup\n * @param connectionKey at which key the connection should be added\n * @param connectionLookup reference to the connection lookup\n * @param nodeId nodeId of the connection\n * @param handleId handleId of the conneciton\n */\nfunction addConnectionToLookup(\n type: 'source' | 'target',\n connection: NodeConnection,\n connectionKey: string,\n connectionLookup: ConnectionLookup,\n nodeId: string,\n handleId: string | null,\n) {\n // We add the connection to the connectionLookup at the following keys\n // 1. nodeId, 2. nodeId-type, 3. nodeId-type-handleId\n // If the key already exists, we add the connection to the existing map\n let key = nodeId;\n const nodeMap = connectionLookup.get(key) || new Map();\n connectionLookup.set(key, nodeMap.set(connectionKey, connection));\n\n key = `${nodeId}-${type}`;\n const typeMap = connectionLookup.get(key) || new Map();\n connectionLookup.set(key, typeMap.set(connectionKey, connection));\n\n if (handleId) {\n key = `${nodeId}-${type}-${handleId}`;\n const handleMap = connectionLookup.get(key) || new Map();\n connectionLookup.set(key, handleMap.set(connectionKey, connection));\n }\n}\n\nexport function updateConnectionLookup(connectionLookup: ConnectionLookup, edges: Edge[]) {\n connectionLookup.clear();\n\n for (const edge of edges) {\n const { source: sourceNode, target: targetNode, sourceHandle = null, targetHandle = null } = edge;\n\n const connection = { edgeId: edge.id, source: sourceNode, target: targetNode, sourceHandle, targetHandle };\n const sourceKey = `${sourceNode}-${sourceHandle}--${targetNode}-${targetHandle}`;\n const targetKey = `${targetNode}-${targetHandle}--${sourceNode}-${sourceHandle}`;\n\n addConnectionToLookup('source', connection, targetKey, connectionLookup, sourceNode, sourceHandle);\n addConnectionToLookup('target', connection, sourceKey, connectionLookup, targetNode, targetHandle);\n }\n}\n\n/**\n * Validate edges-or-connections for the store, xyflow-style: the returned edges are the USER's objects\n * (a `Connection` becomes a new edge via {@link addEdgeToStore}, the only path that persists\n * `defaultEdgeOptions`) — no enrichment, no captured node references, no default-stamping. Source/target\n * node resolution and `EdgePosition` happen per-render in `EdgeWrapper`.\n *\n * @internal\n */\nexport function validateEdges<EdgeType extends Edge = Edge>(\n nextEdges: (EdgeType | Connection)[],\n isValidConnection: ValidConnectionFunc | null,\n getInternalNode: Actions['getInternalNode'],\n onError: VueFlowInstance['emits']['error'],\n defaultEdgeOptions: DefaultEdgeOptions | undefined,\n nodes: Node[],\n edges: EdgeType[],\n): EdgeType[] {\n const validEdges: EdgeType[] = [];\n\n for (const edgeOrConnection of nextEdges) {\n const edge = isEdge<EdgeType>(edgeOrConnection)\n ? edgeOrConnection\n : addEdgeToStore(edgeOrConnection, edges, onError, defaultEdgeOptions);\n\n if (!edge) {\n continue;\n }\n\n const sourceNode = getInternalNode(edge.source);\n const targetNode = getInternalNode(edge.target);\n\n if (!sourceNode && !targetNode) {\n onError(new VueFlowError(ErrorCode.EDGE_SOURCE_TARGET_MISSING, edge.id, edge.source, edge.target));\n continue;\n }\n\n if (!sourceNode) {\n onError(new VueFlowError(ErrorCode.EDGE_SOURCE_MISSING, edge.id, edge.source));\n continue;\n }\n\n if (!targetNode) {\n onError(new VueFlowError(ErrorCode.EDGE_TARGET_MISSING, edge.id, edge.target));\n continue;\n }\n\n if (isValidConnection) {\n const isValid = isValidConnection(\n {\n source: edge.source,\n target: edge.target,\n sourceHandle: edge.sourceHandle ?? null,\n targetHandle: edge.targetHandle ?? null,\n },\n {\n edges,\n nodes,\n sourceNode,\n targetNode,\n },\n );\n\n if (!isValid) {\n onError(new VueFlowError(ErrorCode.EDGE_INVALID, edge.id));\n continue;\n }\n }\n\n validEdges.push(edge);\n }\n\n return validEdges;\n}\n","import type { Edge, Node } from '../types';\nimport { computed, inject, shallowRef } from 'vue';\nimport { EdgeId, EdgeRef } from '../context';\nimport { ErrorCode, VueFlowError } from '../utils';\nimport { useVueFlow } from './useVueFlow';\n\n/**\n * Composable that provides access to an edge object and it's dom element\n *\n * If no edge id is provided, the edge id is injected from context\n *\n * If you do not provide an id, this composable has to be called in a child of your custom edge component, or it will throw\n *\n * @public\n * @param id - The id of the edge to access\n * @returns the edge id, the edge (a `ComputedRef`) and the edge dom element\n */\nexport function useEdge<EdgeType extends Edge = Edge>(id?: string) {\n const edgeId = id ?? inject(EdgeId, '');\n const edgeEl = inject(EdgeRef, shallowRef(null));\n\n const { getEdge, emits } = useVueFlow<Node, EdgeType>();\n\n // a `computed` (not a one-time read) so it re-resolves whenever the store replaces this edge's lookup\n // entry — required for the immutable model where a changed edge is a NEW object (mirrors `useNode`)\n const edge = computed(() => getEdge(edgeId));\n\n if (!edge.value) {\n emits.error(new VueFlowError(ErrorCode.EDGE_NOT_FOUND, edgeId));\n }\n\n return {\n id: edgeId,\n edge,\n edgeEl,\n };\n}\n","import type { Edge, Node, VueFlowState } from '../types';\nimport { inject } from 'vue';\nimport { VueFlowStateKey } from '../context';\nimport { ErrorCode, VueFlowError } from '../utils/errors';\n\n/**\n * Access the raw reactive state of the surrounding flow — every {@link VueFlowState} field plus the\n * lookups, read directly (`store.nodes`, `store.transform`, `store.nodeLookup`, …; no `.value`, like\n * `xyflow/svelte`'s store). Mirrors `useStore` in `xyflow/react`+`svelte`.\n *\n * Reading a field inside a `computed`/`watch`/template tracks it reactively; reading it in a plain\n * callback is just a current-value read. To destructure scalar/array fields as refs, wrap the result in\n * `storeToRefs`; reference-type lookups (`nodeLookup`, …) can be destructured directly.\n *\n * For actions, getters, and event hooks use {@link useVueFlow} instead. Throws if called outside a\n * provider (or outside a component `setup`).\n *\n * @public\n * @returns the reactive state for the current context\n */\nexport function useStore<NodeType extends Node = Node, EdgeType extends Edge = Edge>(): VueFlowState<NodeType, EdgeType> {\n const state = inject(VueFlowStateKey, null) as VueFlowState<NodeType, EdgeType> | null;\n\n if (!state) {\n throw new VueFlowError(ErrorCode.USE_VUE_FLOW_OUTSIDE_PROVIDER);\n }\n\n return state;\n}\n","import type { Connection, ConnectionState, FinalConnectionState, HandleType, IsValidConnection as SystemIsValidConnection } from '@xyflow/system';\nimport type { MaybeRefOrGetter } from 'vue';\nimport type { ConnectingHandle, InternalNode, MouseTouchEvent, ValidConnectionFunc } from '../types';\nimport { getEventPosition, getHostForElement, Position, XYHandle } from '@xyflow/system';\nimport { toValue } from 'vue';\nimport { isValidHandle } from '../utils';\nimport { useStore } from './useStore';\nimport { useVueFlow } from './useVueFlow';\n\nexport interface UseHandleProps {\n handleId: MaybeRefOrGetter<string | null>;\n nodeId: MaybeRefOrGetter<string>;\n type: MaybeRefOrGetter<HandleType>;\n isValidConnection?: MaybeRefOrGetter<ValidConnectionFunc | null>;\n reconnectHandleType?: MaybeRefOrGetter<HandleType>;\n onReconnectStart?: (event: MouseTouchEvent) => void;\n onReconnect?: (event: MouseTouchEvent, connection: Connection) => void;\n onReconnectEnd?: (event: MouseTouchEvent, connectionState: FinalConnectionState<InternalNode>) => void;\n}\n\nfunction alwaysValid() {\n return true;\n}\n\n/**\n * Connection-drag composable. Drag-to-connect is delegated to `@xyflow/system`'s `XYHandle` instance\n * (same pattern as `XYDrag` / `XYResizer`). Click-to-connect stays vue-flow specific because the click\n * path interacts with the richer `ValidConnectionFunc` signature (which receives full source/target\n * `InternalNode`s on top of the bare `Connection`).\n *\n * Generally it's recommended to use the `<Handle />` component instead of this composable.\n *\n * @public\n */\nexport function useHandle({\n handleId,\n nodeId,\n type,\n isValidConnection,\n reconnectHandleType,\n onReconnectStart,\n onReconnect,\n onReconnectEnd,\n}: UseHandleProps) {\n const { id: flowId, getNode, getInternalNode, panBy, startConnection, updateConnection, endConnection, emits } = useVueFlow();\n\n // Read the reactive store directly — every store value below is read inside an event handler or a lazy\n // callback (getTransform/getFromHandle/getStoreItems), so `store.x` yields the current value with the\n // same reactivity; no per-handle ref projection needed.\n const store = useStore();\n\n const { nodeLookup } = store;\n\n /**\n * Adapt our richer `ValidConnectionFunc` (which receives `{ nodes, edges, sourceNode, targetNode }`)\n * into system's bare `IsValidConnection` (which only receives the `Connection`/`EdgeBase`). Resolves\n * source/target nodes from `nodeLookup` before delegating to the user's callback.\n */\n function buildSystemIsValidConnection(): SystemIsValidConnection | undefined {\n const userFn = toValue(isValidConnection) || store.isValidConnection;\n if (!userFn) {\n return undefined;\n }\n return (edge) => {\n const sourceNode = getInternalNode(edge.source);\n const targetNode = getInternalNode(edge.target);\n if (!sourceNode || !targetNode) {\n return false;\n }\n return userFn(\n {\n source: edge.source,\n target: edge.target,\n sourceHandle: edge.sourceHandle ?? null,\n targetHandle: edge.targetHandle ?? null,\n },\n { nodes: store.nodes, edges: store.edges, sourceNode, targetNode },\n );\n };\n }\n\n function handlePointerDown(event: MouseTouchEvent) {\n const handleDomNode = event.currentTarget as Element | null;\n if (!handleDomNode || !store.vueFlowRef) {\n return;\n }\n\n XYHandle.onPointerDown(event, {\n autoPanOnConnect: store.autoPanOnConnect,\n connectionMode: store.connectionMode,\n connectionRadius: store.connectionRadius,\n domNode: store.vueFlowRef as HTMLDivElement,\n handleId: toValue(handleId),\n nodeId: toValue(nodeId),\n isTarget: toValue(type) === 'target',\n nodeLookup,\n lib: 'vue',\n flowId,\n // system's own param name stays `edgeUpdaterType`; our prop is `reconnectHandleType`\n edgeUpdaterType: toValue(reconnectHandleType),\n autoPanSpeed: store.autoPanSpeed,\n dragThreshold: store.connectionDragThreshold,\n handleDomNode,\n panBy,\n isValidConnection: buildSystemIsValidConnection(),\n getTransform: () => store.transform,\n // system aborts the move loop if this returns null, so once `startConnection` has populated the\n // store's `connectionStartHandle`, surface it as a system-shaped `Handle`. Width/height aren't\n // tracked on `ConnectingHandle` — fall back to 0; system only reads them for rendering.\n getFromHandle: () => {\n const h = store.connectionStartHandle;\n if (!h) {\n return null;\n }\n return {\n id: h.id,\n nodeId: h.nodeId,\n type: h.type,\n position: h.position,\n x: h.x,\n y: h.y,\n width: 0,\n height: 0,\n };\n },\n updateConnection: (state: ConnectionState) => {\n if (state.inProgress) {\n // first move emits the in-progress state — mirror it to our split-field store so consumers\n // like `useConnection` and `Pane.vue`'s `connectionInProgress` keep working.\n if (!store.connectionStartHandle) {\n startConnection({\n nodeId: state.fromHandle.nodeId,\n id: state.fromHandle.id ?? null,\n type: state.fromHandle.type,\n position: state.fromHandle.position,\n x: state.to.x,\n y: state.to.y,\n });\n }\n // `connectionPosition` tracks the raw pointer (not the snapped `to`): `useConnection` derives the\n // snapped end from `connectionEndHandle`, and the connection line snaps via the same handle, so\n // storing the raw pointer here surfaces it as `pointer` (xyflow/react #5594/#5578).\n updateConnection(\n state.pointer,\n state.toHandle\n ? ({\n nodeId: state.toHandle.nodeId,\n id: state.toHandle.id ?? null,\n type: state.toHandle.type,\n position: state.toHandle.position,\n x: state.toHandle.x,\n y: state.toHandle.y,\n } as ConnectingHandle)\n : null,\n state.isValid !== null ? (state.isValid ? 'valid' : 'invalid') : null,\n );\n }\n },\n cancelConnection: () => {\n endConnection(event, false);\n },\n onConnectStart: (evt, params) => {\n emits.connectStart({\n event: evt as MouseTouchEvent,\n nodeId: params.nodeId ?? undefined,\n handleId: params.handleId,\n handleType: params.handleType ?? undefined,\n });\n // For a reconnect this fires only once the drag actually begins (after `connectionDragThreshold`,\n // or immediately when it's 0) — the cue to hide the original edge. Hiding it eagerly on pointerdown\n // would strand a plain click (no drag) with a permanently hidden edge, because the system fires\n // onConnectEnd/onReconnectEnd only after the drag has started.\n if (reconnectHandleType) {\n onReconnectStart?.(evt as MouseTouchEvent);\n }\n },\n onConnect: (connection) => {\n if (onReconnect) {\n onReconnect(event, connection);\n }\n else {\n emits.connect(connection);\n }\n },\n onConnectEnd: (evt, connectionState) => {\n emits.connectEnd({ event: evt as MouseTouchEvent, connectionState });\n if (reconnectHandleType) {\n onReconnectEnd?.(evt as MouseTouchEvent, connectionState);\n }\n },\n });\n }\n\n function handleClick(event: MouseEvent) {\n if (!store.connectOnClick) {\n return;\n }\n\n if (!store.connectionClickStartHandle) {\n emits.clickConnectStart({\n event,\n nodeId: toValue(nodeId),\n handleId: toValue(handleId),\n });\n\n startConnection(\n {\n nodeId: toValue(nodeId),\n type: toValue(type),\n id: toValue(handleId),\n position: Position.Top,\n ...getEventPosition(event),\n },\n undefined,\n true,\n );\n\n return;\n }\n\n const isValidConnectionHandler = toValue(isValidConnection) || store.isValidConnection || alwaysValid;\n\n const node = getNode(toValue(nodeId));\n\n if (node && (typeof node.connectable === 'undefined' ? store.nodesConnectable : node.connectable) === false) {\n return;\n }\n\n const doc = getHostForElement(event.target as HTMLElement);\n\n const result = isValidHandle(\n event,\n {\n handle: {\n nodeId: toValue(nodeId),\n id: toValue(handleId),\n type: toValue(type),\n position: Position.Top,\n ...getEventPosition(event),\n },\n connectionMode: store.connectionMode,\n fromNodeId: store.connectionClickStartHandle.nodeId,\n fromHandleId: store.connectionClickStartHandle.id ?? null,\n fromType: store.connectionClickStartHandle.type,\n isValidConnection: isValidConnectionHandler,\n doc,\n lib: 'vue',\n flowId,\n },\n store.edges,\n store.nodes,\n getInternalNode,\n nodeLookup,\n );\n\n const isOwnHandle = result.connection?.source === result.connection?.target;\n\n if (result.isValid && result.connection && !isOwnHandle) {\n emits.connect(result.connection);\n }\n\n // the click path doesn't drive the system's connection state machine, so assemble the\n // `FinalConnectionState` ourselves from the click-start handle + the resolved end handle, so\n // `clickConnectEnd` carries the same payload shape as `connectEnd` (handles → system `Handle`s by\n // padding the missing width/height, as `getFromHandle` does above).\n const fromHandle = store.connectionClickStartHandle;\n const fromNode = fromHandle ? getInternalNode(fromHandle.nodeId) : undefined;\n const toHandle = result.toHandle;\n const pointer = getEventPosition(event);\n const connectionState: FinalConnectionState<InternalNode>\n = fromHandle && fromNode\n ? {\n isValid: result.isValid,\n from: { x: fromHandle.x, y: fromHandle.y },\n fromHandle: { ...fromHandle, width: 0, height: 0 },\n fromPosition: fromHandle.position,\n fromNode,\n to: toHandle ? { x: toHandle.x, y: toHandle.y } : pointer,\n toHandle: toHandle ? { ...toHandle, width: 0, height: 0 } : null,\n toPosition: toHandle?.position ?? null,\n toNode: toHandle ? (getInternalNode(toHandle.nodeId) ?? null) : null,\n pointer,\n }\n : {\n isValid: null,\n from: null,\n fromHandle: null,\n fromPosition: null,\n fromNode: null,\n to: null,\n toHandle: null,\n toPosition: null,\n toNode: null,\n pointer: null,\n };\n\n emits.clickConnectEnd({ event, connectionState });\n\n endConnection(event, true);\n }\n\n return {\n handlePointerDown,\n handleClick,\n };\n}\n","import { inject } from 'vue';\nimport { NodeId } from '../context';\n\n/**\n * This composable returns the current node id from the ctx.\n *\n * It should be used inside a (custom-)node components ctx as the id is provided by the internal `NodeWrapper` component.\n *\n * @public\n * @returns the current node id\n */\nexport function useNodeId() {\n return inject(NodeId, '');\n}\n","import type { MaybeRefOrGetter } from 'vue';\nimport type { InternalNode, Node } from '../types';\nimport { computed, toValue } from 'vue';\nimport { useNodeId } from './useNodeId';\nimport { useVueFlow } from './useVueFlow';\n\n/**\n * Access the enriched {@link InternalNode} (store-computed `internals.{positionAbsolute, z, handleBounds}` +\n * authoritative `measured`) for an id, as a `computed` that re-resolves whenever the store re-adopts the node.\n *\n * Mirrors xyflow/react's `useInternalNode`. If no id is given it is read from node context (call inside a\n * custom node). Use {@link useNode} for the user-facing node + dom element + connected edges.\n *\n * The id accepts a ref/getter so it can track a reactive source — e.g. a custom edge resolving its\n * endpoint with `useInternalNode(() => props.source)` stays correct after a reconnect changes the source.\n *\n * @public\n * @param id - The id of the node to access (a value, ref, or getter; defaults to the node context id)\n */\nexport function useInternalNode<NodeType extends Node = Node>(id?: MaybeRefOrGetter<string | undefined>) {\n const contextNodeId = useNodeId();\n\n const { getInternalNode } = useVueFlow();\n\n return computed(() => getInternalNode(toValue(id) ?? contextNodeId ?? '') as InternalNode<NodeType> | undefined);\n}\n","import type { KeyFilter, KeyPredicate } from '@vueuse/core';\nimport type { MaybeRefOrGetter } from 'vue';\nimport { onKeyStroke, useEventListener } from '@vueuse/core';\nimport { computed, shallowRef, toValue, watch } from 'vue';\n\ntype PressedKeys = Set<string>;\ntype KeyOrCode = 'key' | 'code';\n\nexport interface UseKeyPressOptions {\n target?: MaybeRefOrGetter<EventTarget | null | undefined>;\n actInsideInputWithModifier?: MaybeRefOrGetter<boolean>;\n preventDefault?: MaybeRefOrGetter<boolean>;\n}\n\nconst inputTags = ['INPUT', 'SELECT', 'TEXTAREA'];\n\nconst defaultDoc = typeof document !== 'undefined' ? document : null;\n\nexport function isInputDOMNode(event: KeyboardEvent): boolean {\n const target = (event.composedPath?.()?.[0] || event.target) as HTMLElement;\n\n const hasAttribute = typeof target?.hasAttribute === 'function' ? target.hasAttribute('contenteditable') : false;\n\n const closest = typeof target?.closest === 'function' ? target.closest('.nokey') : null;\n\n // when an input field is focused we don't want to trigger deletion or movement of nodes\n return inputTags.includes(target?.nodeName) || hasAttribute || !!closest;\n}\n\n// we want to be able to do a multi selection event if we are in an input field\nfunction wasModifierPressed(event: KeyboardEvent) {\n return event.ctrlKey || event.metaKey || event.shiftKey || event.altKey;\n}\n\nfunction isKeyMatch(pressedKey: string, keyToMatch: string, pressedKeys: Set<string>, isKeyUp: boolean) {\n const keyCombination = keyToMatch\n .replace('+', '\\n')\n .replace('\\n\\n', '\\n+')\n .split('\\n')\n .map(k => k.trim().toLowerCase());\n\n if (keyCombination.length === 1) {\n return pressedKey.toLowerCase() === keyToMatch.toLowerCase();\n }\n\n // we need to remove the key *after* checking for a match otherwise a combination like 'shift+a' would never get unmatched/reset\n if (!isKeyUp) {\n pressedKeys.add(pressedKey.toLowerCase());\n }\n\n const isMatch = keyCombination.every(\n (key, index) => pressedKeys.has(key) && Array.from(pressedKeys.values())[index] === keyCombination[index],\n );\n\n if (isKeyUp) {\n pressedKeys.delete(pressedKey.toLowerCase());\n }\n\n return isMatch;\n}\n\nfunction createKeyPredicate(keyFilter: string | string[], pressedKeys: PressedKeys): KeyPredicate {\n return (event: KeyboardEvent) => {\n if (!event.code && !event.key) {\n return false;\n }\n\n const keyOrCode = useKeyOrCode(event.code, keyFilter);\n\n // if the keyFilter is an array of multiple keys, we need to check each possible key combination\n if (Array.isArray(keyFilter)) {\n return keyFilter.some(key => isKeyMatch(event[keyOrCode], key, pressedKeys, event.type === 'keyup'));\n }\n\n // if the keyFilter is a string, we need to check if the key matches the string\n return isKeyMatch(event[keyOrCode], keyFilter, pressedKeys, event.type === 'keyup');\n };\n}\n\nfunction useKeyOrCode(code: string, keysToWatch: string | string[]): KeyOrCode {\n return keysToWatch.includes(code) ? 'code' : 'key';\n}\n\n/**\n * Composable that returns a boolean value if a key is pressed\n *\n * @public\n * @param keyFilter - Can be a boolean, a string, an array of strings or a function that returns a boolean. If it's a boolean, it will act as if the key is always pressed. If it's a string, it will return true if a key matching that string is pressed. If it's an array of strings, it will return true if any of the strings match a key being pressed, or a combination (e.g. ['ctrl+a', 'ctrl+b'])\n * @param options - Options object\n */\nexport function useKeyPress(keyFilter: MaybeRefOrGetter<KeyFilter | boolean | null>, options?: UseKeyPressOptions) {\n const target = computed(() => toValue(options?.target) ?? defaultDoc);\n\n const isPressed = shallowRef(toValue(keyFilter) === true);\n\n let modifierPressed = false;\n\n const pressedKeys = new Set<string>();\n\n let currentFilter = createKeyFilterFn(toValue(keyFilter));\n\n watch(\n () => toValue(keyFilter),\n (nextKeyFilter, previousKeyFilter) => {\n // if the previous keyFilter was a boolean but is now something else, we need to reset the isPressed value\n if (typeof previousKeyFilter === 'boolean' && typeof nextKeyFilter !== 'boolean') {\n reset();\n }\n\n currentFilter = createKeyFilterFn(nextKeyFilter);\n },\n {\n immediate: true,\n },\n );\n\n useEventListener(['blur', 'contextmenu'], reset);\n\n onKeyStroke(\n (...args) => currentFilter(...args),\n (e) => {\n const actInsideInputWithModifier = toValue(options?.actInsideInputWithModifier) ?? true;\n const preventDefault = toValue(options?.preventDefault) ?? false;\n\n modifierPressed = wasModifierPressed(e);\n\n const preventAction = (!modifierPressed || (modifierPressed && !actInsideInputWithModifier)) && isInputDOMNode(e);\n\n if (preventAction) {\n return;\n }\n\n const target = (e.composedPath?.()?.[0] || e.target) as Element | null;\n const isInteractiveElement = target?.nodeName === 'BUTTON' || target?.nodeName === 'A';\n\n if (!preventDefault && (modifierPressed || !isInteractiveElement)) {\n e.preventDefault();\n }\n\n isPressed.value = true;\n },\n { eventName: 'keydown', target },\n );\n\n onKeyStroke(\n (...args) => currentFilter(...args),\n (e) => {\n const actInsideInputWithModifier = toValue(options?.actInsideInputWithModifier) ?? true;\n\n if (isPressed.value) {\n const preventAction = (!modifierPressed || (modifierPressed && !actInsideInputWithModifier)) && isInputDOMNode(e);\n\n if (preventAction) {\n return;\n }\n\n modifierPressed = false;\n isPressed.value = false;\n }\n },\n { eventName: 'keyup', target },\n );\n\n function reset() {\n modifierPressed = false;\n\n pressedKeys.clear();\n\n isPressed.value = toValue(keyFilter) === true;\n }\n\n function createKeyFilterFn(keyFilter: KeyFilter | boolean | null) {\n // if the keyFilter is null, we just set the isPressed value to false\n if (keyFilter === null) {\n reset();\n return () => false;\n }\n\n // if the keyFilter is a boolean, we just set the isPressed value to that boolean\n if (typeof keyFilter === 'boolean') {\n reset();\n isPressed.value = keyFilter;\n\n return () => false;\n }\n\n if (Array.isArray(keyFilter) || typeof keyFilter === 'string') {\n return createKeyPredicate(keyFilter, pressedKeys);\n }\n\n return keyFilter;\n }\n\n return isPressed;\n}\n","import type { Node } from '../types';\nimport { getConnectedEdges } from '@xyflow/system';\nimport { computed, inject, shallowRef } from 'vue';\nimport { NodeRef } from '../context';\nimport { ErrorCode, VueFlowError } from '../utils';\nimport { useNodeId } from './useNodeId';\nimport { useStore } from './useStore';\nimport { useVueFlow } from './useVueFlow';\n\n/**\n * Composable that provides access to a node object, parent node object, connected edges and it's dom element\n *\n * If no node id is provided, the node id is injected from context\n *\n * If you do not provide an id, this composable has to be called in a child of your custom node component, or it will throw\n *\n * @public\n * @param id - The id of the node to access\n * @returns the node id, the node (a `ComputedRef`), the node dom element, it's parent and connected edges\n */\nexport function useNode<NodeType extends Node = Node>(id?: string) {\n const nodeId = id ?? useNodeId() ?? '';\n const nodeEl = inject(NodeRef, shallowRef(null));\n\n const { getInternalNode, emits } = useVueFlow<NodeType>();\n const store = useStore<NodeType>();\n\n // `node` is the enriched `InternalNode` (it carries `internals`/`measured`, which NodeWrapper + custom\n // nodes read) and a `computed` (not a one-time read) so it re-resolves whenever the store replaces this\n // node's lookup entry — required for the immutable re-adopt model where a changed node is a NEW object.\n const node = computed(() => getInternalNode(nodeId));\n\n if (!node.value) {\n emits.error(new VueFlowError(ErrorCode.NODE_NOT_FOUND, nodeId));\n }\n\n return {\n id: nodeId,\n nodeEl,\n node,\n parentNode: computed(() => (node.value ? getInternalNode(node.value.parentId) : undefined)),\n connectedEdges: computed(() => (node.value ? getConnectedEdges([node.value], store.edges) : [])),\n };\n}\n","import type { XYPosition } from '@xyflow/system';\nimport type { NodeDragItem } from '../types';\nimport { calculateNodePosition, getNodeDimensions, snapPosition } from '@xyflow/system';\nimport { useStore } from './useStore';\nimport { useVueFlow } from './useVueFlow';\n\n/**\n * Composable for updating the position of nodes.\n *\n * @internal\n */\nexport function useUpdateNodePositions() {\n const { getSelectedNodes, updateNodePositions, getInternalNode } = useVueFlow();\n const store = useStore();\n\n return (positionDiff: XYPosition, isShiftPressed = false) => {\n // by default a node moves 5px on each key press, or 20px if shift is pressed\n // if snap grid is enabled, we use that for the velocity.\n const xVelo = store.snapToGrid ? store.snapGrid[0] : 5;\n const yVelo = store.snapToGrid ? store.snapGrid[1] : 5;\n const factor = isShiftPressed ? 4 : 1;\n\n const positionDiffX = positionDiff.x * xVelo * factor;\n const positionDiffY = positionDiff.y * yVelo * factor;\n\n const nodeUpdates: NodeDragItem[] = [];\n for (const node of getSelectedNodes.value) {\n if (node.draggable || (store.nodesDraggable && typeof node.draggable === 'undefined')) {\n // `getSelectedNodes` returns user `Node`s — resolve the enriched InternalNode for internals/measured\n const internalNode = getInternalNode(node.id);\n if (!internalNode) {\n continue;\n }\n\n let nextPosition = {\n x: internalNode.internals.positionAbsolute.x + positionDiffX,\n y: internalNode.internals.positionAbsolute.y + positionDiffY,\n };\n\n if (store.snapToGrid) {\n nextPosition = snapPosition(nextPosition, store.snapGrid);\n }\n\n // mirror xyflow/react's `useMoveSelectedNodes`: the origin-aware `calculateNodePosition` derives the\n // new `position` AND `positionAbsolute` (accounting for `nodeOrigin`, extent + parent). The previous\n // `calcNextPosition` ignored `nodeOrigin` and reused the stale `positionAbsolute`, so with a\n // non-default origin the offset re-applied on every key press — the node drifted by the origin offset.\n const { position, positionAbsolute } = calculateNodePosition({\n nodeId: node.id,\n nextPosition,\n nodeLookup: store.nodeLookup,\n nodeExtent: store.nodeExtent,\n nodeOrigin: store.nodeOrigin,\n });\n\n nodeUpdates.push({\n id: node.id,\n position,\n distance: { x: positionDiff.x, y: positionDiff.y },\n measured: getNodeDimensions(internalNode),\n internals: { positionAbsolute },\n });\n }\n }\n\n updateNodePositions(nodeUpdates, true, false);\n };\n}\n","import type { Project } from '@xyflow/system';\nimport type { Edge, Node, NodeLookup, State, ViewportFunctions } from '../types';\nimport { until } from '@vueuse/core';\nimport { fitViewport, getViewportForBounds, pointToRendererPoint, rendererPointToPoint } from '@xyflow/system';\nimport { computed } from 'vue';\nimport { areNodesInitialized, warn } from '../utils';\n\nexport interface ViewportHelper<NodeType extends Node = Node> extends ViewportFunctions<NodeType> {\n viewportInitialized: boolean;\n screenToFlowPosition: Project;\n flowToScreenPosition: Project;\n}\n\nconst DEFAULT_PADDING = 0.1;\n\nasync function noop() {\n warn('Viewport not initialized yet.');\n\n return false;\n}\n\nconst initialViewportHelper: ViewportHelper = {\n zoomIn: noop,\n zoomOut: noop,\n zoomTo: noop,\n fitView: noop,\n setCenter: noop,\n fitBounds: noop,\n screenToFlowPosition: position => position,\n flowToScreenPosition: position => position,\n setViewport: noop,\n getViewport: () => ({ x: 0, y: 0, zoom: 1 }),\n viewportInitialized: false,\n};\n\n/**\n * Composable that provides viewport helper functions.\n *\n * @internal\n * @param state\n */\nexport function useViewportHelper<NodeType extends Node = Node, EdgeType extends Edge = Edge>(\n state: State<NodeType, EdgeType>,\n nodeLookup: NodeLookup<NodeType>,\n) {\n // whether every (non-hidden) node has been measured — `fitView` waits on this so an imperative call right\n // after `addNodes` doesn't fit around stale (unmeasured) geometry (`getFitViewNodes` skips unmeasured nodes)\n const nodesInitialized = computed(() => areNodesInitialized(nodeLookup));\n\n return computed<ViewportHelper<NodeType>>(() => {\n const panZoom = state.panZoom;\n const isInitialized = state.panZoom && state.dimensions.width && state.dimensions.height;\n\n if (!isInitialized) {\n return initialViewportHelper;\n }\n\n return {\n viewportInitialized: true,\n // todo: allow passing scale as option\n zoomIn: async options => (panZoom ? panZoom.scaleBy(1.2, options) : false),\n zoomOut: async options => (panZoom ? panZoom.scaleBy(1 / 1.2, options) : false),\n zoomTo: async (zoomLevel, options) => (panZoom ? panZoom.scaleTo(zoomLevel, options) : false),\n setViewport: async (viewport, options) => {\n if (!panZoom) {\n return false;\n }\n\n await panZoom.setViewport(\n {\n x: viewport.x ?? state.transform[0],\n y: viewport.y ?? state.transform[1],\n zoom: viewport.zoom ?? state.transform[2],\n },\n options,\n );\n\n return true;\n },\n getViewport: () => ({\n x: state.transform[0],\n y: state.transform[1],\n zoom: state.transform[2],\n }),\n fitView: async (\n options = {\n padding: DEFAULT_PADDING,\n includeHiddenNodes: false,\n duration: 0,\n },\n ) => {\n if (!panZoom) {\n return false;\n }\n\n // queue the fit until every node is measured (xyflow/react's `fitViewQueued`): a fit requested\n // before the nodes settle — e.g. right after `addNodes` — would otherwise frame only the already\n // measured nodes (`getFitViewNodes` skips unmeasured ones) and ignore the new ones. An empty flow has\n // nothing to wait for, so don't queue (else the fit would never resolve).\n if (nodeLookup.size > 0 && !nodesInitialized.value) {\n await until(nodesInitialized).toBe(true);\n }\n\n return fitViewport(\n {\n nodes: nodeLookup,\n width: state.dimensions.width,\n height: state.dimensions.height,\n panZoom,\n minZoom: state.minZoom,\n maxZoom: state.maxZoom,\n },\n {\n padding: options.padding ?? DEFAULT_PADDING,\n duration: options.duration,\n ease: options.ease,\n interpolate: options.interpolate,\n minZoom: options.minZoom,\n maxZoom: options.maxZoom,\n // `fitViewport` forwards these to `getFitViewNodes` at runtime, but its options type `Omit`s\n // them — pass via spread to satisfy TS.\n ...(options.includeHiddenNodes ? { includeHiddenNodes: true } : {}),\n ...(options.nodes?.length ? { nodes: options.nodes } : {}),\n },\n );\n },\n setCenter: async (x, y, options) => {\n if (!panZoom) {\n return false;\n }\n\n const nextZoom = typeof options?.zoom !== 'undefined' ? options.zoom : state.maxZoom;\n const centerX = state.dimensions.width / 2 - x * nextZoom;\n const centerY = state.dimensions.height / 2 - y * nextZoom;\n\n await panZoom.setViewport({ x: centerX, y: centerY, zoom: nextZoom }, options);\n\n return true;\n },\n fitBounds: async (bounds, options = { padding: DEFAULT_PADDING }) => {\n if (!panZoom) {\n return false;\n }\n\n const { x, y, zoom } = getViewportForBounds(\n bounds,\n state.dimensions.width,\n state.dimensions.height,\n state.minZoom,\n state.maxZoom,\n options.padding ?? DEFAULT_PADDING,\n );\n\n await panZoom.setViewport({ x, y, zoom }, options);\n\n return true;\n },\n screenToFlowPosition: (position) => {\n if (state.vueFlowRef) {\n const { x: domX, y: domY } = state.vueFlowRef.getBoundingClientRect();\n\n const correctedPosition = {\n x: position.x - domX,\n y: position.y - domY,\n };\n\n return pointToRendererPoint(correctedPosition, state.transform, state.snapToGrid, state.snapGrid);\n }\n\n return { x: 0, y: 0 };\n },\n flowToScreenPosition: (position) => {\n if (state.vueFlowRef) {\n const { x: domX, y: domY } = state.vueFlowRef.getBoundingClientRect();\n\n const correctedPosition = {\n x: position.x + domX,\n y: position.y + domY,\n };\n\n return rendererPointToPoint(correctedPosition, state.transform);\n }\n\n return { x: 0, y: 0 };\n },\n };\n });\n}\n","import type { Connection } from '@xyflow/system';\nimport type { Ref, ToRefs } from 'vue';\nimport type { Edge, FlowProps, Node, VueFlowStoreHandle } from '../types';\nimport { mergeAriaLabelConfig } from '@xyflow/system';\nimport { effectScope, isRef, toRaw, toRef, watch } from 'vue';\nimport { isDef } from '../utils';\nimport { storeToRefs } from './storeToRefs';\n\n/**\n * Two-way bind a `v-model` array ref to the store, identity-in / snapshot-out, with native `watch`.\n *\n * Used only when `<VueFlow>` does NOT own its store (it reuses a `<VueFlowProvider>`'s), so the model\n * refs can't back the store directly. The owned-store path is single-source instead — the model refs\n * ARE the store's nodes/edges (see `createStore`'s `StoreSignals` binding), needing no sync here.\n *\n * - **out** (store → model): snapshot on every membership change; element refs are shared, so per-node\n * field mutations surface without a copy.\n * - **in** (model → store): adopt externally-assigned arrays via `setItems`, ignoring our own snapshot\n * (identity check against `lastSnapshot`) — replacing the previous `@vueuse` `watchPausable` flag dance.\n */\nfunction syncModelArray<ModelItem, StoreItem>(\n model: Ref<ModelItem[] | undefined> | undefined,\n storeItems: Ref<StoreItem[]>,\n setItems: (items: ModelItem[]) => void,\n) {\n if (!model) {\n return;\n }\n\n // the array we last pushed store → model; the `in` watcher skips it so the snapshot doesn't loop back\n let lastSnapshot: ModelItem[] | undefined;\n\n watch(\n [storeItems, () => storeItems.value.length],\n () => {\n lastSnapshot = [...storeItems.value] as unknown as ModelItem[];\n model.value = lastSnapshot;\n },\n // seed the model only if the store already holds elements (populated by `setState(props)` on create)\n { immediate: storeItems.value.length > 0 },\n );\n\n watch(\n [model, () => model.value?.length],\n ([next]) => {\n if (!Array.isArray(next)) {\n return;\n }\n\n // compare raw identities: a deep model `ref` hands our own snapshot back as its reactive proxy,\n // which would fail a plain `===` and loop snapshot → setItems → snapshot forever\n const nextRaw = toRaw(next);\n if (nextRaw === lastSnapshot) {\n return;\n }\n\n setItems(nextRaw);\n },\n { immediate: true },\n );\n}\n\n/**\n * Watches props and updates the store accordingly\n *\n * @internal\n * @param models v-model refs for nodes/edges (bound only when `ownsStore` is false — see {@link syncModelArray})\n * @param props the `<VueFlow>` props\n * @param handle the created store handle ({@link VueFlowStoreHandle}) — instance (actions) + reactive state\n * @param ownsStore whether this `<VueFlow>` created the store (then nodes/edges are signal-backed and skipped here)\n */\nexport function useWatchProps<NodeType extends Node = Node, EdgeType extends Edge = Edge>(\n models: ToRefs<Pick<FlowProps<NodeType, EdgeType>, 'nodes' | 'edges'>>,\n props: FlowProps<NodeType, EdgeType>,\n handle: VueFlowStoreHandle<NodeType, EdgeType>,\n ownsStore = false,\n) {\n const { instance, state } = handle;\n // refs over the reactive state (writable) so the prop→store sync below can assign as before\n const storeRefs = storeToRefs(state);\n\n const scope = effectScope(true);\n\n scope.run(() => {\n // Only when this `<VueFlow>` reuses a provider's store (it didn't create it, so the model refs can't\n // back it). Owned stores are single-source — the models ARE the store's nodes/edges — so these are skipped.\n const watchNodesValue = () => {\n scope.run(() => {\n syncModelArray(models.nodes, storeRefs.nodes, nodes => instance.setNodes(nodes));\n });\n };\n\n const watchEdgesValue = () => {\n scope.run(() => {\n syncModelArray(models.edges, storeRefs.edges, edges => instance.setEdges(edges));\n });\n };\n\n const watchMaxZoom = () => {\n scope.run(() => {\n watch(\n () => props.maxZoom,\n (maxZoom) => {\n if (maxZoom && isDef(maxZoom)) {\n instance.setMaxZoom(maxZoom);\n }\n },\n {\n immediate: true,\n },\n );\n });\n };\n\n const watchMinZoom = () => {\n scope.run(() => {\n watch(\n () => props.minZoom,\n (minZoom) => {\n if (minZoom && isDef(minZoom)) {\n instance.setMinZoom(minZoom);\n }\n },\n { immediate: true },\n );\n });\n };\n\n const watchTranslateExtent = () => {\n scope.run(() => {\n watch(\n () => props.translateExtent,\n (translateExtent) => {\n if (translateExtent && isDef(translateExtent)) {\n instance.setTranslateExtent(translateExtent);\n }\n },\n {\n immediate: true,\n },\n );\n });\n };\n\n const watchNodeExtent = () => {\n scope.run(() => {\n watch(\n () => props.nodeExtent,\n (nodeExtent) => {\n if (nodeExtent && isDef(nodeExtent)) {\n instance.setNodeExtent(nodeExtent);\n }\n },\n {\n immediate: true,\n },\n );\n });\n };\n\n const watchAriaLabelConfig = () => {\n scope.run(() => {\n watch(\n () => props.ariaLabelConfig,\n (ariaLabelConfig) => {\n // merge over the defaults so unspecified keys keep their default text (handled here rather than\n // in `watchRest`, which would assign the partial verbatim and drop the defaults)\n state.ariaLabelConfig = mergeAriaLabelConfig(ariaLabelConfig);\n },\n { immediate: true },\n );\n });\n };\n\n const watchApplyDefault = () => {\n scope.run(() => {\n watch(\n () => props.autoApplyChanges,\n (autoApplyChanges) => {\n if (isDef(autoApplyChanges)) {\n storeRefs.autoApplyChanges.value = autoApplyChanges;\n }\n },\n {\n immediate: true,\n },\n );\n });\n };\n\n const watchAutoConnect = () => {\n scope.run(() => {\n const autoConnector = async (params: Connection) => {\n let connection: boolean | Connection = params;\n\n if (typeof props.autoConnect === 'function') {\n connection = await props.autoConnect(params);\n }\n\n if (connection !== false) {\n instance.addEdges([connection]);\n }\n };\n\n watch(\n () => props.autoConnect,\n (autConnect) => {\n if (isDef(autConnect)) {\n storeRefs.autoConnect.value = autConnect;\n }\n },\n { immediate: true },\n );\n\n watch(\n storeRefs.autoConnect,\n (autoConnectEnabled, _, onCleanup) => {\n if (autoConnectEnabled) {\n instance.onConnect(autoConnector);\n }\n else {\n state.hooks.connect.off(autoConnector);\n }\n\n onCleanup(() => {\n state.hooks.connect.off(autoConnector);\n });\n },\n { immediate: true },\n );\n });\n };\n\n const watchRest = () => {\n const skip: (keyof typeof props)[] = [\n 'id',\n 'translateExtent',\n 'nodeExtent',\n 'edges',\n 'nodes',\n 'maxZoom',\n 'minZoom',\n 'autoApplyChanges',\n 'autoConnect',\n // `viewport` isn't a state field (it's a getter on the instance); `useViewportSync` two-way binds it\n 'viewport',\n // merged (not assigned verbatim) by `watchAriaLabelConfig`\n 'ariaLabelConfig',\n ];\n\n for (const key of Object.keys(props)) {\n const propKey = key as keyof typeof props;\n if (!skip.includes(propKey)) {\n const propValue = toRef(() => props[propKey]);\n\n const storeRef = storeRefs[propKey as keyof typeof storeRefs];\n\n if (isRef(storeRef)) {\n scope.run(() => {\n watch(\n propValue,\n (nextValue) => {\n if (isDef(nextValue)) {\n ;(storeRef.value as any) = nextValue;\n }\n },\n { immediate: true },\n );\n });\n }\n }\n }\n };\n\n const runAll = () => {\n // owned stores bind nodes/edges single-source via signals (createStore); only reused stores sync here\n if (!ownsStore) {\n watchNodesValue();\n watchEdgesValue();\n }\n watchMinZoom();\n watchMaxZoom();\n watchTranslateExtent();\n watchNodeExtent();\n watchApplyDefault();\n watchAutoConnect();\n watchAriaLabelConfig();\n watchRest();\n };\n\n runAll();\n });\n\n return () => scope.stop();\n}\n","<script lang=\"ts\" setup>\nimport type { PanelProps } from '../../types/panel';\nimport { computed } from 'vue';\nimport { storeToRefs, useStore } from '../../composables';\n\nconst props = defineProps<PanelProps>();\n\nconst { userSelectionActive } = storeToRefs(useStore());\n\nconst positionClasses = computed(() => `${props.position}`.split('-'));\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'Panel',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <div\n class=\"vue-flow__panel\"\n :class=\"positionClasses\"\n :aria-label=\"label ?? undefined\"\n :style=\"{ pointerEvents: userSelectionActive ? 'none' : 'all' }\"\n >\n <slot />\n </div>\n</template>\n","import type { FunctionalComponent } from 'vue';\nimport { h } from 'vue';\n\n// Static control icons as functional components (formerly `.svg` files compiled by vite-svg-loader).\n// Keeping them as plain components means the build needs no svg-to-component loader.\nfunction icon(viewBox: string, d: string): FunctionalComponent {\n return () => h('svg', { 'xmlns': 'http://www.w3.org/2000/svg', viewBox, 'aria-hidden': 'true' }, [h('path', { d })]);\n}\n\nexport const PlusIcon = icon('0 0 32 32', 'M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z');\n\nexport const MinusIcon = icon('0 0 32 5', 'M0 0h32v4.2H0z');\n\nexport const FitView = icon(\n '0 0 32 30',\n 'M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z',\n);\n\nexport const Lock = icon(\n '0 0 25 32',\n 'M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z',\n);\n\nexport const Unlock = icon(\n '0 0 25 32',\n 'M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z',\n);\n","<script lang=\"ts\" setup>\nimport type { ControlEmits, ControlProps } from './types';\nimport { toRef } from 'vue';\nimport { storeToRefs, useStore, useVueFlow } from '../../composables';\nimport Panel from '../Panel/Panel.vue';\nimport ControlButton from './ControlButton.vue';\nimport { FitView, Lock, MinusIcon, PlusIcon, Unlock } from './icons';\n\nconst props = withDefaults(defineProps<ControlProps>(), {\n showZoom: true,\n showFitView: true,\n showInteractive: true,\n position: 'bottom-left',\n});\n\nconst emit = defineEmits<ControlEmits>();\n\nconst { setInteractive, zoomIn, zoomOut, fitView, viewport } = useVueFlow();\n\nconst { nodesDraggable, nodesConnectable, elementsSelectable, minZoom, maxZoom, ariaLabelConfig } = storeToRefs(useStore());\n\nconst isInteractive = toRef(() => nodesDraggable.value || nodesConnectable.value || elementsSelectable.value);\n\nconst minZoomReached = toRef(() => viewport.value.zoom <= minZoom.value);\n\nconst maxZoomReached = toRef(() => viewport.value.zoom >= maxZoom.value);\n\nfunction onZoomInHandler() {\n zoomIn();\n\n emit('zoomIn');\n}\n\nfunction onZoomOutHandler() {\n zoomOut();\n\n emit('zoomOut');\n}\n\nfunction onFitViewHandler() {\n fitView(props.fitViewParams);\n\n emit('fitView');\n}\n\nfunction onInteractiveChangeHandler() {\n setInteractive(!isInteractive.value);\n\n emit('interactionChange', !isInteractive.value);\n}\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'Controls',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <Panel class=\"vue-flow__controls\" :position=\"position\" :label=\"ariaLabel ?? ariaLabelConfig['controls.ariaLabel']\">\n <slot name=\"top\" />\n\n <template v-if=\"showZoom\">\n <slot name=\"control-zoom-in\">\n <ControlButton\n class=\"vue-flow__controls-zoomin\"\n :disabled=\"maxZoomReached\"\n :label=\"ariaLabelConfig['controls.zoomIn.ariaLabel']\"\n @click=\"onZoomInHandler\"\n >\n <slot name=\"icon-zoom-in\">\n <component :is=\"PlusIcon\" />\n </slot>\n </ControlButton>\n </slot>\n\n <slot name=\"control-zoom-out\">\n <ControlButton\n class=\"vue-flow__controls-zoomout\"\n :disabled=\"minZoomReached\"\n :label=\"ariaLabelConfig['controls.zoomOut.ariaLabel']\"\n @click=\"onZoomOutHandler\"\n >\n <slot name=\"icon-zoom-out\">\n <component :is=\"MinusIcon\" />\n </slot>\n </ControlButton>\n </slot>\n </template>\n\n <template v-if=\"showFitView\">\n <slot name=\"control-fit-view\">\n <ControlButton\n class=\"vue-flow__controls-fitview\"\n :label=\"ariaLabelConfig['controls.fitView.ariaLabel']\"\n @click=\"onFitViewHandler\"\n >\n <slot name=\"icon-fit-view\">\n <component :is=\"FitView\" />\n </slot>\n </ControlButton>\n </slot>\n </template>\n\n <template v-if=\"showInteractive\">\n <slot name=\"control-interactive\">\n <ControlButton\n v-if=\"showInteractive\"\n class=\"vue-flow__controls-interactive\"\n :label=\"ariaLabelConfig['controls.interactive.ariaLabel']\"\n @click=\"onInteractiveChangeHandler\"\n >\n <slot v-if=\"isInteractive\" name=\"icon-unlock\">\n <component :is=\"Unlock\" />\n </slot>\n <slot v-if=\"!isInteractive\" name=\"icon-lock\">\n <component :is=\"Lock\" />\n </slot>\n </ControlButton>\n </slot>\n </template>\n\n <slot />\n </Panel>\n</template>\n","<script lang=\"ts\" setup>\nimport type { Rect as RectType } from '@xyflow/system';\nimport type { EdgeTextProps } from '../../types/components';\nimport { computed, onMounted, shallowRef, watch } from 'vue';\n\nconst {\n x,\n y,\n label,\n labelStyle = {},\n labelShowBg = true,\n labelBgStyle = {},\n labelBgPadding = [2, 4],\n labelBgBorderRadius = 2,\n} = defineProps<EdgeTextProps>();\n\nconst box = shallowRef<RectType>({ x: 0, y: 0, width: 0, height: 0 });\n\nconst el = shallowRef<SVGTextElement | null>(null);\n\nconst transform = computed(() => `translate(${x - box.value.width / 2} ${y - box.value.height / 2})`);\n\nonMounted(() => {\n getBox();\n\n // The first measurement can run before the theme stylesheet (`font-size`) and web font are applied,\n // sizing the box for the wrong (default 16px) font. Since we deliberately don't re-measure on x/y\n // changes (that would force a reflow every drag frame — see the watch below), it would never self-\n // correct. Re-measure once after a frame and once fonts settle so the box snaps to the real text size.\n requestAnimationFrame(getBox);\n document.fonts?.ready?.then(getBox);\n});\n\n// the text's bounding box depends on its content/font, NOT its x/y position — re-measuring (getBBox forces\n// a reflow) on every move would thrash layout each drag frame for no change, so only watch el + label\nwatch([el, () => label], getBox);\n\nfunction getBox() {\n if (!el.value) {\n return;\n }\n\n const nextBox = el.value.getBBox();\n\n if (nextBox.width !== box.value.width || nextBox.height !== box.value.height) {\n box.value = nextBox;\n }\n}\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'EdgeText',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <g :transform=\"transform\" :visibility=\"box.width ? 'visible' : 'hidden'\" class=\"vue-flow__edge-textwrapper\">\n <rect\n v-if=\"labelShowBg\"\n class=\"vue-flow__edge-textbg\"\n :width=\"`${box.width + 2 * labelBgPadding[0]}px`\"\n :height=\"`${box.height + 2 * labelBgPadding[1]}px`\"\n :x=\"-labelBgPadding[0]\"\n :y=\"-labelBgPadding[1]\"\n :style=\"labelBgStyle\"\n :rx=\"labelBgBorderRadius\"\n :ry=\"labelBgBorderRadius\"\n />\n\n <text v-bind=\"$attrs\" ref=\"el\" class=\"vue-flow__edge-text\" :y=\"box.height / 2\" dy=\"0.3em\" :style=\"labelStyle\">\n <slot>\n <component :is=\"label\" v-if=\"typeof label !== 'string'\" />\n <template v-else>\n {{ label }}\n </template>\n </slot>\n </text>\n </g>\n</template>\n","<script lang=\"ts\" setup>\nimport type { BaseEdgeProps } from '../../types';\nimport { shallowRef, useAttrs } from 'vue';\nimport EdgeText from './EdgeText.vue';\n\nwithDefaults(defineProps<BaseEdgeProps>(), { interactionWidth: 20 });\n\nconst pathEl = shallowRef<SVGPathElement | null>(null);\n\nconst interactionEl = shallowRef<SVGPathElement | null>(null);\n\nconst labelEl = shallowRef<SVGGElement | null>(null);\n\nconst attrs = useAttrs();\n\ndefineExpose({\n pathEl,\n interactionEl,\n labelEl,\n});\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'BaseEdge',\n inheritAttrs: false,\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <path\n v-bind=\"attrs\"\n :id=\"id\"\n ref=\"pathEl\"\n :d=\"path\"\n class=\"vue-flow__edge-path\"\n :marker-end=\"markerEnd\"\n :marker-start=\"markerStart\"\n />\n\n <path\n v-if=\"interactionWidth\"\n ref=\"interactionEl\"\n fill=\"none\"\n :d=\"path\"\n :stroke-width=\"interactionWidth\"\n :stroke-opacity=\"0\"\n class=\"vue-flow__edge-interaction\"\n />\n\n <EdgeText\n v-if=\"label && labelX && labelY\"\n ref=\"labelEl\"\n :x=\"labelX\"\n :y=\"labelY\"\n :label=\"label\"\n :label-show-bg=\"labelShowBg\"\n :label-bg-style=\"labelBgStyle\"\n :label-bg-padding=\"labelBgPadding\"\n :label-bg-border-radius=\"labelBgBorderRadius\"\n :label-style=\"labelStyle\"\n />\n</template>\n","import type { CSSProperties } from 'vue';\n\n/**\n * The props `BaseEdge` actually renders (label/marker/interaction) plus genuine `style`/`class`\n * fallthrough. The built-in edge components receive the full `EdgeProps` surface (geometry like\n * `sourceX`/`sourceY` + identity like `source`/`type`/`selected`); the geometry is consumed to COMPUTE\n * the path and the identity isn't BaseEdge's concern, so forwarding `{ ...attrs, ...props }` wholesale\n * leaked all of it onto the `<path>` via BaseEdge's `v-bind=\"$attrs\"` (and re-wrote the changing\n * `sourceX`/`sourceY`/`targetX`/`targetY` attrs every drag frame). Pick only what BaseEdge needs.\n */\nexport function baseEdgeProps(props: Record<string, any>, attrs: Record<string, any>) {\n return {\n label: props.label,\n labelStyle: props.labelStyle,\n labelShowBg: props.labelShowBg,\n labelBgStyle: props.labelBgStyle,\n labelBgPadding: props.labelBgPadding,\n labelBgBorderRadius: props.labelBgBorderRadius,\n markerStart: props.markerStart,\n markerEnd: props.markerEnd,\n interactionWidth: props.interactionWidth,\n style: attrs.style as CSSProperties | undefined,\n class: attrs.class,\n };\n}\n","import type { BezierEdgeProps } from '../../types';\nimport { getBezierPath, Position } from '@xyflow/system';\nimport { defineComponent, h } from 'vue';\nimport BaseEdge from './BaseEdge.vue';\nimport { baseEdgeProps } from './utils';\n\nconst BezierEdge = defineComponent<BezierEdgeProps>({\n name: 'BezierEdge',\n // see StraightEdge: keep undeclared attrs (source/target/…) from leaking onto the <path>\n inheritAttrs: false,\n props: [\n 'sourcePosition',\n 'targetPosition',\n 'label',\n 'labelStyle',\n 'labelShowBg',\n 'labelBgStyle',\n 'labelBgPadding',\n 'labelBgBorderRadius',\n 'sourceY',\n 'sourceX',\n 'targetX',\n 'targetY',\n 'curvature',\n 'markerEnd',\n 'markerStart',\n 'interactionWidth',\n ],\n compatConfig: { MODE: 3 },\n setup(props, { attrs }) {\n return () => {\n const [path, labelX, labelY] = getBezierPath({\n ...props,\n sourcePosition: props.sourcePosition ?? Position.Bottom,\n targetPosition: props.targetPosition ?? Position.Top,\n });\n\n return h(BaseEdge, { path, labelX, labelY, ...baseEdgeProps(props, attrs) });\n };\n },\n});\n\nexport default BezierEdge;\n","<script lang=\"ts\" setup>\nimport type { TeleportProps } from 'vue';\nimport { computed } from 'vue';\nimport { storeToRefs, useStore } from '../../composables';\n\nconst { viewportRef } = storeToRefs(useStore());\n\nconst teleportTarget = computed(() => viewportRef.value?.getElementsByClassName('vue-flow__edgelabel-renderer')[0] as TeleportProps['to']);\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'EdgeLabelRenderer',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <svg>\n <foreignObject height=\"0\" width=\"0\">\n <Teleport :to=\"teleportTarget\" :disabled=\"!teleportTarget\">\n <slot />\n </Teleport>\n </foreignObject>\n </svg>\n</template>\n","import type { SimpleBezierEdgeProps } from '../../types';\nimport { getBezierEdgeCenter, Position } from '@xyflow/system';\nimport { defineComponent, h } from 'vue';\nimport BaseEdge from './BaseEdge.vue';\nimport { baseEdgeProps } from './utils';\n\nexport interface GetSimpleBezierPathParams {\n sourceX: number;\n sourceY: number;\n sourcePosition?: Position;\n targetX: number;\n targetY: number;\n targetPosition?: Position;\n}\n\ninterface GetControlParams {\n pos: Position;\n x1: number;\n y1: number;\n x2: number;\n y2: number;\n}\n\nfunction getControl({ pos, x1, y1, x2, y2 }: GetControlParams): [number, number] {\n let ctX: number, ctY: number;\n switch (pos) {\n case Position.Left:\n case Position.Right:\n ctX = 0.5 * (x1 + x2);\n ctY = y1;\n break;\n case Position.Top:\n case Position.Bottom:\n ctX = x1;\n ctY = 0.5 * (y1 + y2);\n break;\n }\n return [ctX, ctY];\n}\n\n/**\n * Get a simple bezier path from source to target handle (no curvature)\n * @public\n *\n * @param simpleBezierPathParams\n * @param simpleBezierPathParams.sourceX - The x position of the source handle\n * @param simpleBezierPathParams.sourceY - The y position of the source handle\n * @param simpleBezierPathParams.sourcePosition - The position of the source handle (default: Position.Bottom)\n * @param simpleBezierPathParams.targetX - The x position of the target handle\n * @param simpleBezierPathParams.targetY - The y position of the target handle\n * @param simpleBezierPathParams.targetPosition - The position of the target handle (default: Position.Top)\n * @returns A path string you can use in an SVG, the labelX and labelY position (center of path) and offsetX, offsetY between source handle and label\n */\nexport function getSimpleBezierPath({\n sourceX,\n sourceY,\n sourcePosition = Position.Bottom,\n targetX,\n targetY,\n targetPosition = Position.Top,\n}: GetSimpleBezierPathParams): [path: string, labelX: number, labelY: number, offsetX: number, offsetY: number] {\n const [sourceControlX, sourceControlY] = getControl({\n pos: sourcePosition,\n x1: sourceX,\n y1: sourceY,\n x2: targetX,\n y2: targetY,\n });\n\n const [targetControlX, targetControlY] = getControl({\n pos: targetPosition,\n x1: targetX,\n y1: targetY,\n x2: sourceX,\n y2: sourceY,\n });\n\n const [labelX, labelY, offsetX, offsetY] = getBezierEdgeCenter({\n sourceX,\n sourceY,\n targetX,\n targetY,\n sourceControlX,\n sourceControlY,\n targetControlX,\n targetControlY,\n });\n\n return [\n `M${sourceX},${sourceY} C${sourceControlX},${sourceControlY} ${targetControlX},${targetControlY} ${targetX},${targetY}`,\n labelX,\n labelY,\n offsetX,\n offsetY,\n ];\n}\n\nconst SimpleBezierEdge = defineComponent<SimpleBezierEdgeProps>({\n name: 'SimpleBezierEdge',\n // see StraightEdge: keep undeclared attrs (source/target/…) from leaking onto the <path>\n inheritAttrs: false,\n props: [\n 'sourcePosition',\n 'targetPosition',\n 'label',\n 'labelStyle',\n 'labelShowBg',\n 'labelBgStyle',\n 'labelBgPadding',\n 'labelBgBorderRadius',\n 'sourceY',\n 'sourceX',\n 'targetX',\n 'targetY',\n 'markerEnd',\n 'markerStart',\n 'interactionWidth',\n ],\n compatConfig: { MODE: 3 },\n setup(props, { attrs }) {\n return () => {\n const [path, labelX, labelY] = getSimpleBezierPath({\n ...props,\n sourcePosition: props.sourcePosition ?? Position.Bottom,\n targetPosition: props.targetPosition ?? Position.Top,\n });\n\n return h(BaseEdge, { path, labelX, labelY, ...baseEdgeProps(props, attrs) });\n };\n },\n});\n\nexport default SimpleBezierEdge;\n","import type { SmoothStepEdgeProps } from '../../types';\nimport { getSmoothStepPath, Position } from '@xyflow/system';\nimport { defineComponent, h } from 'vue';\nimport BaseEdge from './BaseEdge.vue';\nimport { baseEdgeProps } from './utils';\n\nconst SmoothStepEdge = defineComponent<SmoothStepEdgeProps>({\n name: 'SmoothStepEdge',\n // see StraightEdge: keep undeclared attrs (source/target/…) from leaking onto the <path>\n inheritAttrs: false,\n props: [\n 'sourcePosition',\n 'targetPosition',\n 'label',\n 'labelStyle',\n 'labelShowBg',\n 'labelBgStyle',\n 'labelBgPadding',\n 'labelBgBorderRadius',\n 'sourceY',\n 'sourceX',\n 'targetX',\n 'targetY',\n 'borderRadius',\n 'markerEnd',\n 'markerStart',\n 'interactionWidth',\n 'offset',\n 'stepPosition',\n ],\n compatConfig: { MODE: 3 },\n setup(props, { attrs }) {\n return () => {\n const [path, labelX, labelY] = getSmoothStepPath({\n ...props,\n sourcePosition: props.sourcePosition ?? Position.Bottom,\n targetPosition: props.targetPosition ?? Position.Top,\n });\n\n return h(BaseEdge, { path, labelX, labelY, ...baseEdgeProps(props, attrs) });\n };\n },\n});\n\nexport default SmoothStepEdge;\n","import type { StepEdgeProps } from '../../types';\nimport { defineComponent, h } from 'vue';\nimport SmoothStepEdge from './SmoothStepEdge';\n\nconst StepEdge = defineComponent<StepEdgeProps>({\n name: 'StepEdge',\n // see StraightEdge: keep undeclared attrs from auto-applying to the SmoothStepEdge root\n inheritAttrs: false,\n props: [\n 'sourcePosition',\n 'targetPosition',\n 'label',\n 'labelStyle',\n 'labelShowBg',\n 'labelBgStyle',\n 'labelBgPadding',\n 'labelBgBorderRadius',\n 'sourceY',\n 'sourceX',\n 'targetX',\n 'targetY',\n 'markerEnd',\n 'markerStart',\n 'interactionWidth',\n ],\n setup(props, { attrs }) {\n return () => h(SmoothStepEdge, { ...props, ...attrs, borderRadius: 0 });\n },\n});\n\nexport default StepEdge;\n","import type { StraightEdgeProps } from '../../types';\nimport { getStraightPath } from '@xyflow/system';\nimport { defineComponent, h } from 'vue';\nimport BaseEdge from './BaseEdge.vue';\nimport { baseEdgeProps } from './utils';\n\nconst StraightEdge = defineComponent<StraightEdgeProps>({\n name: 'StraightEdge',\n // attrs (the EdgeProps the component doesn't declare: source/target/selected/…) must not auto-apply to\n // the BaseEdge root and leak onto the <path>; genuine style/class are forwarded via `baseEdgeProps`\n inheritAttrs: false,\n props: [\n 'label',\n 'labelStyle',\n 'labelShowBg',\n 'labelBgStyle',\n 'labelBgPadding',\n 'labelBgBorderRadius',\n 'sourceY',\n 'sourceX',\n 'targetX',\n 'targetY',\n 'markerEnd',\n 'markerStart',\n 'interactionWidth',\n ],\n compatConfig: { MODE: 3 },\n setup(props, { attrs }) {\n return () => {\n const [path, labelX, labelY] = getStraightPath(props);\n\n return h(BaseEdge, { path, labelX, labelY, ...baseEdgeProps(props, attrs) });\n };\n },\n});\n\nexport default StraightEdge;\n","<script lang=\"ts\" setup>\nimport type { HandleProps } from '../../types';\nimport { ConnectionMode, getDimensions, isMouseEvent, nodeHasDimensions, Position } from '@xyflow/system';\nimport { computed, onMounted, shallowRef, toRef } from 'vue';\nimport { useHandle, useNode, useStore, useVueFlow } from '../../composables';\nimport { isDef } from '../../utils';\n\nconst {\n position = Position.Top,\n isConnectable = undefined,\n connectableStart = true,\n connectableEnd = true,\n id: handleId = null,\n ...props\n} = defineProps<HandleProps>();\n\nconst type = toRef(() => props.type ?? 'source');\n\nconst isValidConnection = toRef(() => props.isValidConnection ?? null);\n\nconst { id: flowId } = useVueFlow();\n\n// Read the reactive store directly (see NodeWrapper) instead of projecting it into refs — there are ~2\n// handles per node, so this setup runs a lot; `store.x` already tracks reactively in computeds/template.\nconst store = useStore();\n\nconst { id: nodeId, node: nodeRef, nodeEl, connectedEdges } = useNode();\n\nconst handle = shallowRef<HTMLDivElement>();\n\n// `data-id` (queried by handle DOM lookup in `utils/handle.ts`) and the other handle identifiers are\n// typed through a `Record` because this vue version's `HTMLAttributes` lacks the `data-*` index signature\n// that `strictTemplates` needs, so they can't be written as bare `:data-*` attributes in the template.\nconst handleDataIds = computed<Record<string, string | null>>(() => ({\n 'data-id': `${flowId}-${nodeId}-${handleId}-${type.value}`,\n 'data-handleid': handleId,\n 'data-nodeid': nodeId,\n 'data-handlepos': position,\n}));\n\nconst { handlePointerDown, handleClick } = useHandle({\n nodeId,\n handleId,\n isValidConnection,\n type,\n});\n\nconst isHandleConnectable = computed(() => {\n if (typeof isConnectable === 'string' && isConnectable === 'single') {\n return !connectedEdges.value.some((edge) => {\n const id = edge[`${type.value}Handle`];\n\n if (edge[type.value] !== nodeId) {\n return false;\n }\n\n return id ? id === handleId : true;\n });\n }\n\n if (typeof isConnectable === 'number') {\n return (\n connectedEdges.value.filter((edge) => {\n const id = edge[`${type.value}Handle`];\n\n if (edge[type.value] !== nodeId) {\n return false;\n }\n\n return id ? id === handleId : true;\n }).length < isConnectable\n );\n }\n\n if (typeof isConnectable === 'function') {\n return nodeRef.value ? isConnectable(nodeRef.value, connectedEdges.value) : false;\n }\n\n return isDef(isConnectable) ? isConnectable : store.nodesConnectable;\n});\n\n// All connection-driven classes in one computed instead of ~7 separate refs: they all derive from the same\n// global `connection*` store state (so they toggle together during a connection) and are used only in the\n// class binding. Mirrors xyflow/react's `connectingSelector`.\nconst connectionClasses = computed<Record<string, boolean>>((prev) => {\n const fromHandle = store.connectionStartHandle;\n const clickFromHandle = store.connectionClickStartHandle;\n const toHandle = store.connectionEndHandle;\n const handleType = type.value;\n\n const connectionInProcess = fromHandle !== null;\n const clickConnectionInProcess = clickFromHandle !== null;\n // whether this handle can be the END of the in-progress (drag) connection\n const isPossibleEndHandle = store.connectionMode === ConnectionMode.Strict\n ? fromHandle?.type !== handleType\n : nodeId !== fromHandle?.nodeId || handleId !== fromHandle?.id;\n const connectingto = toHandle?.nodeId === nodeId && toHandle?.id === handleId && toHandle?.type === handleType;\n\n const next = {\n // resolved value (falls back to `nodesConnectable`), not the raw prop — XYHandle's DOM query targets\n // `.connectable` to find drop targets, so an unset `:connectable` must still mark it\n connectable: isHandleConnectable.value,\n connecting:\n clickFromHandle?.nodeId === nodeId && clickFromHandle?.id === handleId && clickFromHandle?.type === handleType,\n connectablestart: connectableStart,\n connectableend: connectableEnd,\n connectingfrom: fromHandle?.nodeId === nodeId && fromHandle?.id === handleId && fromHandle?.type === handleType,\n connectingto,\n valid: connectingto && store.connectionStatus === 'valid',\n connectionindicator:\n isHandleConnectable.value\n && (!connectionInProcess || isPossibleEndHandle)\n && ((connectionInProcess || clickConnectionInProcess) ? connectableEnd : connectableStart),\n };\n\n // Reuse the previous object when nothing changed so the class binding's render effect doesn't re-run\n // (Vue gates dependents on reference identity). During a connection drag `connectionEndHandle` toggles\n // every handle's recompute, but only the two endpoints' classes actually change — without this every\n // visible handle re-renders on each intermediate target change.\n if (\n prev\n && prev.connectable === next.connectable\n && prev.connecting === next.connecting\n && prev.connectablestart === next.connectablestart\n && prev.connectableend === next.connectableend\n && prev.connectingfrom === next.connectingfrom\n && prev.connectingto === next.connectingto\n && prev.valid === next.valid\n && prev.connectionindicator === next.connectionindicator\n ) {\n return prev;\n }\n\n return next;\n});\n\n// todo: remove this and have users handle this themselves using `updateNodeInternals`\n// set up handle bounds if they don't exist yet and the node has been initialized (i.e. the handle was added after the node has already been mounted)\nonMounted(() => {\n const node = nodeRef.value;\n\n // if the node isn't initialized yet, we can't set up the handle bounds\n // the handle bounds will be automatically set up when the node is initialized (`updateNodeDimensions`)\n if (!node || !nodeHasDimensions(node)) {\n return;\n }\n\n const existingBounds = node.internals.handleBounds?.[type.value]?.find(b => b.id === handleId);\n\n if (!store.vueFlowRef || existingBounds) {\n return;\n }\n\n const viewportNode = store.vueFlowRef.querySelector('.vue-flow__viewport');\n\n if (!nodeEl.value || !handle.value || !viewportNode || !handleId) {\n return;\n }\n\n const nodeBounds = nodeEl.value.getBoundingClientRect();\n\n const handleBounds = handle.value.getBoundingClientRect();\n\n const style = window.getComputedStyle(viewportNode);\n const { m22: zoom } = new window.DOMMatrixReadOnly(style.transform);\n\n const nextBounds = {\n id: handleId,\n position,\n x: (handleBounds.left - nodeBounds.left) / zoom,\n y: (handleBounds.top - nodeBounds.top) / zoom,\n type: type.value,\n nodeId,\n ...getDimensions(handle.value),\n };\n\n if (!node.internals.handleBounds) {\n node.internals.handleBounds = { source: null, target: null };\n }\n const bounds = node.internals.handleBounds;\n bounds[type.value] = [...(bounds[type.value] ?? []), nextBounds];\n});\n\nfunction onPointerDown(event: MouseEvent | TouchEvent) {\n const isMouseTriggered = isMouseEvent(event);\n\n if (isHandleConnectable.value && connectableStart && ((isMouseTriggered && event.button === 0) || !isMouseTriggered)) {\n handlePointerDown(event);\n }\n}\n\nfunction onClick(event: MouseEvent) {\n if (!nodeId || (!store.connectionClickStartHandle && !connectableStart)) {\n return;\n }\n\n if (isHandleConnectable.value) {\n handleClick(event);\n }\n}\n\ndefineExpose({\n handleClick,\n handlePointerDown,\n onClick,\n onPointerDown,\n});\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'Handle',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <div\n ref=\"handle\"\n v-bind=\"handleDataIds\"\n :aria-label=\"store.ariaLabelConfig['handle.ariaLabel']\"\n class=\"vue-flow__handle\"\n :class=\"[\n `vue-flow__handle-${position}`,\n handleId && `vue-flow__handle-${handleId}`,\n store.noDragClassName,\n store.noPanClassName,\n type,\n connectionClasses,\n ]\"\n @mousedown=\"onPointerDown\"\n @touchstart.passive=\"onPointerDown\"\n @click=\"onClick\"\n >\n <slot :id=\"id\" />\n </div>\n</template>\n","import type { Dimensions, PanelPosition, XYPosition } from '@xyflow/system';\nimport type { CSSProperties, InjectionKey } from 'vue';\nimport type { InternalNode, NodeMouseEvent } from '../../types';\n\n/** expects a node and returns a color value */\nexport type MiniMapNodeFunc = (node: InternalNode) => string;\n\nexport type ShapeRendering = CSSProperties['shapeRendering'];\n\nexport interface MiniMapProps {\n /** Node color, can be either a string or a string func that receives the current node */\n nodeColor?: string | MiniMapNodeFunc;\n /** Node stroke color, can be either a string or a string func that receives the current node */\n nodeStrokeColor?: string | MiniMapNodeFunc;\n /** Additional node class name, can be either a string or a string func that receives the current node */\n nodeClassName?: string | MiniMapNodeFunc;\n /** Node border radius */\n nodeBorderRadius?: number;\n /** Node stroke width */\n nodeStrokeWidth?: number;\n /** Background color of minimap mask */\n maskColor?: string;\n /** Border color of minimap mask */\n maskStrokeColor?: string;\n /** Border width of minimap mask */\n maskStrokeWidth?: number;\n /** Position of the minimap {@link PanelPosition} */\n position?: PanelPosition;\n /** Enable drag minimap to drag viewport */\n pannable?: boolean;\n /** Enable zoom minimap to zoom viewport */\n zoomable?: boolean;\n\n width?: number;\n\n height?: number;\n\n ariaLabel?: string | null;\n /** Enable inverse panning, i.e. drag minimap to move viewport in opposite direction */\n inversePan?: boolean;\n /** Specify zoom step */\n zoomStep?: number;\n /** Specify minimap scale */\n offsetScale?: number;\n /** Mask border radius */\n maskBorderRadius?: number;\n}\n\n/** these props are passed to mini map node slots */\nexport interface MiniMapNodeProps {\n id: string;\n type?: string;\n selected?: boolean;\n dragging?: boolean;\n position: XYPosition;\n dimensions: Dimensions;\n borderRadius?: number;\n color?: string;\n shapeRendering?: ShapeRendering;\n strokeColor?: string;\n strokeWidth?: number;\n hidden?: boolean;\n}\n\nexport interface MiniMapEmits {\n click: [params: { event: MouseEvent; position: XYPosition }];\n nodeClick: [params: NodeMouseEvent];\n nodeDblclick: [params: NodeMouseEvent];\n nodeMouseenter: [params: NodeMouseEvent];\n nodeMousemove: [params: NodeMouseEvent];\n nodeMouseleave: [params: NodeMouseEvent];\n}\n\nexport interface MiniMapNodeEmits {\n click: [params: MouseEvent];\n dblclick: [params: MouseEvent];\n mouseenter: [params: MouseEvent];\n mousemove: [params: MouseEvent];\n mouseleave: [params: MouseEvent];\n}\n\nexport interface MiniMapSlots extends Record<`node-${string}`, (nodeProps: MiniMapNodeProps) => any> {}\n\nexport const Slots: InjectionKey<MiniMapSlots> = Symbol('MiniMapSlots');\n","<script setup lang=\"ts\">\nimport type { MiniMapNodeEmits, MiniMapNodeProps } from './types';\nimport { inject, useAttrs } from 'vue';\nimport { Slots } from './types';\n\nconst props = defineProps<MiniMapNodeProps>();\n\nconst emits = defineEmits<MiniMapNodeEmits>();\n\nconst miniMapSlots = inject(Slots, {});\n\nconst attrs = useAttrs() as Record<string, any>;\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'MiniMapNode',\n compatConfig: { MODE: 3 },\n inheritAttrs: false,\n};\n</script>\n\n<template>\n <template v-if=\"!hidden && dimensions.width !== 0 && dimensions.height !== 0\">\n <component\n :is=\"miniMapSlots[`node-${props.type}`]\"\n v-if=\"miniMapSlots[`node-${props.type}`]\"\n v-bind=\"{ ...props, ...attrs }\"\n />\n\n <rect\n v-else\n :id=\"id\"\n v-bind=\"attrs\"\n class=\"vue-flow__minimap-node\"\n :class=\"{ selected, dragging }\"\n :x=\"position.x\"\n :y=\"position.y\"\n :rx=\"borderRadius\"\n :ry=\"borderRadius\"\n :width=\"dimensions.width\"\n :height=\"dimensions.height\"\n :fill=\"color || (attrs.style?.background as string) || attrs.style?.backgroundColor\"\n :stroke=\"strokeColor\"\n :stroke-width=\"strokeWidth\"\n :shape-rendering=\"shapeRendering\"\n @click=\"emits('click', $event)\"\n @dblclick=\"emits('dblclick', $event)\"\n @mouseenter=\"emits('mouseenter', $event)\"\n @mousemove=\"emits('mousemove', $event)\"\n @mouseleave=\"emits('mouseleave', $event)\"\n />\n </template>\n</template>\n","<script lang=\"ts\" setup>\nimport type { XYMinimapInstance } from '@xyflow/system';\nimport type { InternalNode } from '../../types';\nimport type { MiniMapEmits, MiniMapNodeFunc, MiniMapProps, MiniMapSlots, ShapeRendering } from './types';\nimport { getBoundsOfRects, getConnectedEdges, getNodeDimensions, getNodesBounds, XYMinimap } from '@xyflow/system';\nimport { computed, onMounted, onUnmounted, provide, shallowRef, toRef, useAttrs, watch } from 'vue';\nimport { storeToRefs, useStore, useVueFlow } from '../../composables';\nimport Panel from '../Panel/Panel.vue';\nimport MiniMapNode from './MiniMapNode.vue';\nimport { Slots } from './types';\n\nconst {\n width,\n height,\n nodeStrokeColor = 'var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default))',\n nodeColor = 'var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default))',\n nodeClassName,\n nodeBorderRadius = 5,\n nodeStrokeWidth = 2,\n maskColor = 'var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default))',\n position = 'bottom-right',\n maskStrokeColor = 'var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default))',\n maskStrokeWidth = 1,\n maskBorderRadius = 0,\n pannable = false,\n zoomable = false,\n ariaLabel,\n inversePan = false,\n zoomStep = 1,\n offsetScale = 5,\n} = defineProps<MiniMapProps>();\n\nconst emit = defineEmits<MiniMapEmits>();\n\nconst slots = defineSlots<MiniMapSlots>();\n\nconst attrs: Record<string, any> = useAttrs();\n\nconst defaultWidth = 200;\nconst defaultHeight = 150;\n\nconst { id, viewport, emits } = useVueFlow();\n\nconst { nodeLookup } = useStore();\n\nconst { edges, nodes, transform, translateExtent, dimensions, panZoom, ariaLabelConfig } = storeToRefs(useStore());\n\n// fall back to the configurable default label (`ariaLabelConfig`) when no explicit `ariaLabel` is passed\nconst resolvedAriaLabel = computed(() => ariaLabel ?? ariaLabelConfig.value['minimap.ariaLabel']);\n\nconst el = shallowRef<SVGElement>();\n\nlet minimapInstance: XYMinimapInstance | null = null;\n\nprovide(Slots, slots);\n\nconst elementWidth = toRef(() => width ?? attrs.style?.width ?? defaultWidth);\n\nconst elementHeight = toRef(() => height ?? attrs.style?.height ?? defaultHeight);\n\nconst shapeRendering: ShapeRendering = typeof window === 'undefined' || !!window.chrome ? 'crispEdges' : 'geometricPrecision';\n\nconst nodeColorFunc = computed<MiniMapNodeFunc>(() => (typeof nodeColor === 'string' ? () => nodeColor : nodeColor));\n\nconst nodeStrokeColorFunc = computed<MiniMapNodeFunc>(() =>\n typeof nodeStrokeColor === 'string' ? () => nodeStrokeColor : nodeStrokeColor,\n);\n\nconst nodeClassNameFunc = computed<MiniMapNodeFunc>(() =>\n typeof nodeClassName === 'string' ? () => nodeClassName : typeof nodeClassName === 'function' ? nodeClassName : () => '',\n);\n\n// The minimap renders absolute positions + measured dimensions, which live on the InternalNode — iterate\n// the lookup (the public `nodes` ref holds user `Node`s without `internals`).\nconst minimapNodes = computed(() => Array.from(nodeLookup.values()));\n\nconst bb = computed(() =>\n getNodesBounds(\n nodes.value.filter(node => !node.hidden),\n { nodeLookup },\n ),\n);\n\nconst viewBB = computed(() => ({\n x: -viewport.value.x / viewport.value.zoom,\n y: -viewport.value.y / viewport.value.zoom,\n width: dimensions.value.width / viewport.value.zoom,\n height: dimensions.value.height / viewport.value.zoom,\n}));\n\nconst boundingRect = computed(() => (nodes.value && nodes.value.length ? getBoundsOfRects(bb.value, viewBB.value) : viewBB.value));\n\nconst viewScale = computed(() => {\n const scaledWidth = boundingRect.value.width / elementWidth.value;\n const scaledHeight = boundingRect.value.height / elementHeight.value;\n\n return Math.max(scaledWidth, scaledHeight);\n});\n\nconst viewBox = computed(() => {\n const viewWidth = viewScale.value * elementWidth.value;\n const viewHeight = viewScale.value * elementHeight.value;\n const offset = offsetScale * viewScale.value;\n\n return {\n offset,\n x: boundingRect.value.x - (viewWidth - boundingRect.value.width) / 2 - offset,\n y: boundingRect.value.y - (viewHeight - boundingRect.value.height) / 2 - offset,\n width: viewWidth + offset * 2,\n height: viewHeight + offset * 2,\n };\n});\n\nconst d = computed(() => {\n if (!viewBox.value.x || !viewBox.value.y) {\n return '';\n }\n\n return `\n M${viewBox.value.x - viewBox.value.offset},${viewBox.value.y - viewBox.value.offset}\n h${viewBox.value.width + viewBox.value.offset * 2}\n v${viewBox.value.height + viewBox.value.offset * 2}\n h${-viewBox.value.width - viewBox.value.offset * 2}z\n M${viewBB.value.x + maskBorderRadius},${viewBB.value.y}\n h${viewBB.value.width - 2 * maskBorderRadius}\n a${maskBorderRadius},${maskBorderRadius} 0 0 1 ${maskBorderRadius},${maskBorderRadius}\n v${viewBB.value.height - 2 * maskBorderRadius}\n a${maskBorderRadius},${maskBorderRadius} 0 0 1 -${maskBorderRadius},${maskBorderRadius}\n h${-(viewBB.value.width - 2 * maskBorderRadius)}\n a${maskBorderRadius},${maskBorderRadius} 0 0 1 -${maskBorderRadius},-${maskBorderRadius}\n v${-(viewBB.value.height - 2 * maskBorderRadius)}\n a${maskBorderRadius},${maskBorderRadius} 0 0 1 ${maskBorderRadius},-${maskBorderRadius}z`;\n});\n\nonMounted(() => {\n watch(\n panZoom,\n (panZoomInstance) => {\n if (el.value && panZoomInstance) {\n minimapInstance = XYMinimap({\n domNode: el.value,\n panZoom: panZoomInstance,\n getTransform: () => transform.value,\n getViewScale: () => viewScale.value,\n });\n }\n },\n { immediate: true },\n );\n\n onUnmounted(() => {\n minimapInstance?.destroy();\n });\n\n watch(\n [\n () => pannable,\n () => zoomable,\n () => inversePan,\n () => zoomStep,\n translateExtent,\n () => dimensions.value.height,\n () => dimensions.value.width,\n ],\n () => {\n minimapInstance?.update({\n translateExtent: translateExtent.value,\n width: dimensions.value.width,\n height: dimensions.value.height,\n inversePan,\n pannable,\n zoomStep,\n zoomable,\n });\n },\n { immediate: true },\n );\n});\n\nfunction onSvgClick(event: MouseEvent) {\n const [x, y] = minimapInstance?.pointer(event) || [0, 0];\n\n emit('click', { event, position: { x, y } });\n}\n\nfunction onNodeClick(event: MouseEvent, node: InternalNode) {\n const param = { event, node: node.internals.userNode, connectedEdges: getConnectedEdges([node], edges.value) };\n emits.miniMapNodeClick(param);\n emit('nodeClick', param);\n}\n\nfunction onNodeDblClick(event: MouseEvent, node: InternalNode) {\n const param = { event, node: node.internals.userNode, connectedEdges: getConnectedEdges([node], edges.value) };\n emits.miniMapNodeDoubleClick(param);\n emit('nodeDblclick', param);\n}\n\nfunction onNodeMouseEnter(event: MouseEvent, node: InternalNode) {\n const param = { event, node: node.internals.userNode, connectedEdges: getConnectedEdges([node], edges.value) };\n emits.miniMapNodeMouseEnter(param);\n emit('nodeMouseenter', param);\n}\n\nfunction onNodeMouseMove(event: MouseEvent, node: InternalNode) {\n const param = { event, node: node.internals.userNode, connectedEdges: getConnectedEdges([node], edges.value) };\n emits.miniMapNodeMouseMove(param);\n emit('nodeMousemove', param);\n}\n\nfunction onNodeMouseLeave(event: MouseEvent, node: InternalNode) {\n const param = { event, node: node.internals.userNode, connectedEdges: getConnectedEdges([node], edges.value) };\n emits.miniMapNodeMouseLeave(param);\n emit('nodeMouseleave', param);\n}\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'MiniMap',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <Panel :class=\"{ pannable, zoomable }\" :position=\"position\" class=\"vue-flow__minimap\">\n <svg\n ref=\"el\"\n :width=\"elementWidth\"\n :height=\"elementHeight\"\n :viewBox=\"[viewBox.x, viewBox.y, viewBox.width, viewBox.height].join(' ')\"\n :aria-labelledby=\"`vue-flow__minimap-${id}`\"\n role=\"img\"\n @click=\"onSvgClick\"\n >\n <title v-if=\"resolvedAriaLabel\" :id=\"`vue-flow__minimap-${id}`\">{{ resolvedAriaLabel }}</title>\n\n <!-- v-memo on the lookup entry: unchanged nodes keep their InternalNode reference across commits\n (checkEquality reuse), so drag/pan-frame MiniMap re-renders skip every untouched child instead of\n re-rendering all of them (the inline per-node prop objects/calls would otherwise always patch). The\n node*Func RESULTS are in the deps (not the fn refs) so a recolor driven by an external reactive dep\n read inside a `nodeColor`/`nodeStrokeColor`/`nodeClassName` callback still re-renders the affected\n node — memoizing the fn refs froze the color until the node itself changed -->\n <MiniMapNode\n v-for=\"node of minimapNodes\"\n :id=\"node.id\"\n :key=\"node.id\"\n v-memo=\"[node, nodeClassNameFunc(node), nodeColorFunc(node), nodeStrokeColorFunc(node), nodeBorderRadius, nodeStrokeWidth, shapeRendering]\"\n :position=\"node.internals.positionAbsolute\"\n :dimensions=\"getNodeDimensions(node)\"\n :selected=\"node.selected\"\n :dragging=\"node.dragging\"\n :style=\"node.style\"\n :class=\"nodeClassNameFunc(node)\"\n :color=\"nodeColorFunc(node)\"\n :border-radius=\"nodeBorderRadius\"\n :stroke-color=\"nodeStrokeColorFunc(node)\"\n :stroke-width=\"nodeStrokeWidth\"\n :shape-rendering=\"shapeRendering\"\n :type=\"node.type\"\n :hidden=\"node.hidden\"\n @click=\"onNodeClick($event, node)\"\n @dblclick=\"onNodeDblClick($event, node)\"\n @mouseenter=\"onNodeMouseEnter($event, node)\"\n @mousemove=\"onNodeMouseMove($event, node)\"\n @mouseleave=\"onNodeMouseLeave($event, node)\"\n />\n\n <path\n :d=\"d\"\n :fill=\"maskColor\"\n :stroke=\"maskStrokeColor\"\n :stroke-width=\"maskStrokeWidth\"\n class=\"vue-flow__minimap-mask\"\n fill-rule=\"evenodd\"\n />\n </svg>\n </Panel>\n</template>\n","import type { ControlPosition } from './types';\nimport { ResizeControlVariant } from './types';\n\nexport const DefaultPositions: Record<ResizeControlVariant, ControlPosition> = {\n [ResizeControlVariant.Line]: 'right',\n [ResizeControlVariant.Handle]: 'bottom-right',\n};\n\nexport const StylingProperty = {\n [ResizeControlVariant.Line]: 'borderColor',\n [ResizeControlVariant.Handle]: 'backgroundColor',\n};\n","<script lang=\"ts\" setup>\nimport type { NodeDimensionChange, NodePositionChange } from '@xyflow/system';\nimport type { NodeChange } from '../../types';\nimport type { NodeResizerEmits, ResizeControlProps } from './types';\nimport { evaluateAbsolutePosition, handleExpandParent, XYResizer } from '@xyflow/system';\nimport { computed, shallowRef, toRef, watchEffect } from 'vue';\nimport { storeToRefs, useStore, useVueFlow } from '../../composables';\nimport { ResizeControlVariant } from './types';\nimport { DefaultPositions, StylingProperty } from './utils';\n\nconst props = withDefaults(defineProps<ResizeControlProps>(), {\n variant: 'handle' as ResizeControlVariant,\n minWidth: 10,\n minHeight: 10,\n maxWidth: Number.MAX_VALUE,\n maxHeight: Number.MAX_VALUE,\n keepAspectRatio: false,\n autoScale: true,\n});\n\nconst emits = defineEmits<NodeResizerEmits>();\n\nconst { emits: triggerEmits, viewport } = useVueFlow();\n\nconst { nodeLookup, parentLookup } = useStore();\n\nconst { transform, nodeOrigin, snapGrid, snapToGrid, vueFlowRef, noDragClassName } = storeToRefs(useStore());\n\nconst resizeControlRef = shallowRef<HTMLDivElement>();\n\nconst controlPosition = toRef(() => props.position ?? DefaultPositions[props.variant]);\n\nconst positionClassNames = computed(() => controlPosition.value.split('-'));\n\nconst controlStyle = toRef(() => (props.color ? { [StylingProperty[props.variant]]: props.color } : {}));\n\nwatchEffect((onCleanup) => {\n if (!resizeControlRef.value || !props.nodeId) {\n return;\n }\n\n const resizerInstance = XYResizer({\n domNode: resizeControlRef.value,\n nodeId: props.nodeId,\n getStoreItems: () => ({\n nodeLookup,\n transform: transform.value,\n snapGrid: snapGrid.value,\n snapToGrid: snapToGrid.value,\n nodeOrigin: nodeOrigin.value,\n paneDomNode: vueFlowRef.value,\n }),\n onChange: (changes, childChanges) => {\n const nodeChanges: NodeChange[] = [];\n const node = nodeLookup.get(props.nodeId!);\n\n // resolved x/y for the resized node; clamped below when the node expands its parent\n let nextX = changes.x;\n let nextY = changes.y;\n\n if (node?.expandParent && node.parentId) {\n const origin = node.origin ?? nodeOrigin.value;\n const width = changes.width ?? node.measured.width ?? 0;\n const height = changes.height ?? node.measured.height ?? 0;\n\n // grow the parent to fit the resized child (mirrors xyflow/react's NodeResizeControl)\n const child = {\n id: node.id,\n parentId: node.parentId,\n rect: {\n width,\n height,\n ...evaluateAbsolutePosition(\n { x: changes.x ?? node.position.x, y: changes.y ?? node.position.y },\n { width, height },\n node.parentId,\n nodeLookup,\n origin,\n ),\n },\n };\n\n nodeChanges.push(...(handleExpandParent([child], nodeLookup, parentLookup, nodeOrigin.value) as NodeChange[]));\n\n // once the parent was expanded, the child clamps to the parent's edge (0,0 for origin [0,0],\n // width/height for [1,1]).\n nextX = typeof changes.x !== 'undefined' ? Math.max(origin[0] * width, changes.x) : undefined;\n nextY = typeof changes.y !== 'undefined' ? Math.max(origin[1] * height, changes.y) : undefined;\n }\n\n if (typeof nextX !== 'undefined' || typeof nextY !== 'undefined') {\n const position = {\n x: nextX ?? node?.position.x ?? 0,\n y: nextY ?? node?.position.y ?? 0,\n };\n nodeChanges.push({\n id: props.nodeId!,\n type: 'position',\n position,\n positionAbsolute: position,\n } as NodePositionChange);\n }\n\n if (typeof changes.width !== 'undefined' || typeof changes.height !== 'undefined') {\n nodeChanges.push({\n id: props.nodeId!,\n type: 'dimensions',\n setAttributes: true,\n resizing: true,\n dimensions: {\n width: changes.width ?? 0,\n height: changes.height ?? 0,\n },\n } as NodeDimensionChange);\n }\n\n for (const child of childChanges) {\n nodeChanges.push({\n id: child.id,\n type: 'position',\n position: child.position,\n positionAbsolute: child.position,\n } as NodePositionChange);\n }\n\n if (nodeChanges.length) {\n triggerEmits.nodesChange(nodeChanges);\n }\n },\n onEnd: ({ width, height }) => {\n triggerEmits.nodesChange([\n {\n id: props.nodeId!,\n type: 'dimensions',\n resizing: false,\n dimensions: { width, height },\n } as NodeDimensionChange,\n ]);\n },\n });\n\n resizerInstance.update({\n controlPosition: controlPosition.value,\n boundaries: {\n minWidth: props.minWidth,\n minHeight: props.minHeight,\n maxWidth: props.maxWidth,\n maxHeight: props.maxHeight,\n },\n keepAspectRatio: Boolean(props.keepAspectRatio ?? false),\n onResizeStart: (event, params) => emits('resizeStart', { event, params }),\n onResize: (event, params) => emits('resize', { event, params }),\n onResizeEnd: (event, params) => emits('resizeEnd', { event, params }),\n shouldResize: props.shouldResize,\n });\n\n onCleanup(() => {\n resizerInstance.destroy();\n });\n});\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'ResizeControl',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <div\n ref=\"resizeControlRef\"\n class=\"vue-flow__resize-control\"\n :class=\"[...positionClassNames, variant, noDragClassName]\"\n :style=\"{\n ...controlStyle,\n // keep handle controls from shrinking below their base size when zooming out; `autoScale` opts out\n scale: variant === ResizeControlVariant.Handle && autoScale ? `${Math.max(1 / viewport.zoom, 1)}` : undefined,\n }\"\n >\n <slot />\n </div>\n</template>\n","<script lang=\"ts\" setup>\nimport type { NodeDimensionChange } from '@xyflow/system';\nimport type { ControlLinePosition, ControlPosition, NodeResizerEmits, NodeResizerProps } from './types';\nimport { getNodeDimensions } from '@xyflow/system';\nimport { computed, inject, toRef, watch } from 'vue';\nimport { useVueFlow } from '../../composables';\nimport { NodeId } from '../../context';\nimport ResizeControl from './ResizeControl.vue';\nimport { ResizeControlVariant } from './types';\n\nconst props = withDefaults(defineProps<NodeResizerProps>(), {\n isVisible: true,\n autoScale: true,\n});\n\nconst emits = defineEmits<NodeResizerEmits>();\n\nconst { getInternalNode, emits: triggerEmits } = useVueFlow();\n\nconst handleControls: ControlPosition[] = ['top-left', 'top-right', 'bottom-left', 'bottom-right'];\n\nconst lineControls: ControlLinePosition[] = ['top', 'right', 'bottom', 'left'];\n\nconst contextNodeId = inject(NodeId, null);\n\nconst nodeId = toRef(() => (typeof props.nodeId === 'string' ? props.nodeId : contextNodeId ?? undefined));\n\nconst node = computed(() => getInternalNode(nodeId.value));\n\nwatch(\n [\n () => props.minWidth,\n () => props.minHeight,\n () => props.maxWidth,\n () => props.maxHeight,\n () => !!node.value?.measured.width && !!node.value.measured.height,\n ],\n ([minWidth, minHeight, maxWidth, maxHeight, isInitialized]) => {\n const n = node.value;\n\n if (n && isInitialized) {\n const dimensions = getNodeDimensions(n);\n\n const dimensionChange: NodeDimensionChange = {\n id: n.id,\n type: 'dimensions',\n setAttributes: true,\n dimensions: {\n width: dimensions.width,\n height: dimensions.height,\n },\n };\n\n if (minWidth && dimensions.width < minWidth) {\n dimensionChange.dimensions!.width = minWidth;\n }\n\n if (minHeight && dimensions.height < minHeight) {\n dimensionChange.dimensions!.height = minHeight;\n }\n\n if (maxWidth && dimensions.width > maxWidth) {\n dimensionChange.dimensions!.width = maxWidth;\n }\n\n if (maxHeight && dimensions.height > maxHeight) {\n dimensionChange.dimensions!.height = maxHeight;\n }\n\n if (dimensionChange.dimensions!.width !== n.measured.width || dimensionChange.dimensions!.height !== n.measured.height) {\n triggerEmits.nodesChange([dimensionChange]);\n }\n }\n },\n { flush: 'post', immediate: true },\n);\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'NodeResizer',\n compatConfig: { MODE: 3 },\n inheritAttrs: false,\n};\n</script>\n\n<template>\n <template v-if=\"isVisible\">\n <ResizeControl\n v-for=\"c of lineControls\"\n :key=\"c\"\n :class=\"lineClassName\"\n :style=\"lineStyle\"\n :node-id=\"nodeId\"\n :position=\"c\"\n :variant=\"ResizeControlVariant.Line\"\n :color=\"color\"\n :min-width=\"minWidth\"\n :min-height=\"minHeight\"\n :max-width=\"maxWidth\"\n :max-height=\"maxHeight\"\n :should-resize=\"shouldResize\"\n :keep-aspect-ratio=\"keepAspectRatio\"\n :auto-scale=\"autoScale\"\n @resize-start=\"emits('resizeStart', $event)\"\n @resize=\"emits('resize', $event)\"\n @resize-end=\"emits('resizeEnd', $event)\"\n />\n\n <ResizeControl\n v-for=\"c of handleControls\"\n :key=\"c\"\n :class=\"handleClassName\"\n :style=\"handleStyle\"\n :node-id=\"nodeId\"\n :position=\"c\"\n :color=\"color\"\n :min-width=\"minWidth\"\n :min-height=\"minHeight\"\n :max-width=\"maxWidth\"\n :max-height=\"maxHeight\"\n :should-resize=\"shouldResize\"\n :keep-aspect-ratio=\"keepAspectRatio\"\n :auto-scale=\"autoScale\"\n @resize-start=\"emits('resizeStart', $event)\"\n @resize=\"emits('resize', $event)\"\n @resize-end=\"emits('resizeEnd', $event)\"\n />\n </template>\n</template>\n","<script lang=\"ts\" setup>\nimport type { CSSProperties } from 'vue';\nimport type { InternalNode } from '../../types';\nimport type { NodeToolbarProps } from './types';\nimport { getNodesBounds, getNodeToolbarTransform, Position } from '@xyflow/system';\nimport { computed, inject } from 'vue';\nimport { storeToRefs, useStore, useVueFlow } from '../../composables';\nimport { NodeId } from '../../context';\n\nconst props = withDefaults(defineProps<NodeToolbarProps>(), {\n position: Position.Top,\n offset: 10,\n align: 'center',\n isVisible: undefined,\n});\n\nconst contextNodeId = inject(NodeId, null);\n\nconst { viewport, getSelectedNodes, getInternalNode } = useVueFlow();\n\nconst { nodeLookup } = useStore();\n\nconst { viewportRef } = storeToRefs(useStore());\n\nconst nodes = computed(() => {\n const nodeIds = Array.isArray(props.nodeId) ? props.nodeId : [props.nodeId || contextNodeId || ''];\n\n return nodeIds.reduce<InternalNode[]>((acc, id) => {\n const node = getInternalNode(id);\n\n if (node) {\n acc.push(node);\n }\n\n return acc;\n }, [] as InternalNode[]);\n});\n\nconst isActive = computed(() =>\n typeof props.isVisible === 'boolean'\n ? props.isVisible\n : nodes.value.length === 1 && nodes.value[0].selected && getSelectedNodes.value.length === 1,\n);\n\nconst nodeRect = computed(() => getNodesBounds(nodes.value, { nodeLookup }));\n\nconst zIndex = computed(() => Math.max(...nodes.value.map(node => (node.internals.z || 1) + 1)));\n\nconst wrapperStyle = computed<CSSProperties>(() => ({\n position: 'absolute',\n transform: getNodeToolbarTransform(nodeRect.value, viewport.value, props.position, props.offset, props.align),\n zIndex: zIndex.value,\n}));\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'NodeToolbar',\n compatConfig: { MODE: 3 },\n inheritAttrs: false,\n};\n</script>\n\n<template>\n <Teleport :to=\"viewportRef\" :disabled=\"!viewportRef\">\n <div v-if=\"isActive && nodes.length\" v-bind=\"$attrs\" :style=\"wrapperStyle\" class=\"vue-flow__node-toolbar\">\n <slot />\n </div>\n </Teleport>\n</template>\n","import type { ComputedRef } from 'vue';\nimport type { ConnectionState, InternalNode, Node } from '../types';\nimport { computed } from 'vue';\nimport { storeToRefs } from './storeToRefs';\nimport { useStore } from './useStore';\nimport { useVueFlow } from './useVueFlow';\n\nconst NO_CONNECTION = Object.freeze({\n inProgress: false,\n isValid: null,\n from: null,\n fromHandle: null,\n fromPosition: null,\n fromNode: null,\n to: null,\n toHandle: null,\n toPosition: null,\n toNode: null,\n pointer: null,\n} as const);\n\n/**\n * Access the currently ongoing connection, composed from the store's split connection fields into a\n * single {@link ConnectionState}.\n *\n * @public\n * @returns a `ComputedRef<ConnectionState>` — `inProgress: false` (all-null fields) when idle\n */\nexport function useConnection<NodeType extends Node = Node>(): ComputedRef<ConnectionState<NodeType>> {\n const { getInternalNode } = useVueFlow();\n const { connectionStartHandle, connectionEndHandle, connectionPosition, connectionStatus } = storeToRefs(useStore<NodeType>());\n\n return computed<ConnectionState<NodeType>>(() => {\n const fromHandle = connectionStartHandle.value;\n const fromNode = fromHandle ? getInternalNode(fromHandle.nodeId) : undefined;\n\n // no connection (or its source node vanished) → the resting state\n if (!fromHandle || !fromNode) {\n return NO_CONNECTION;\n }\n\n const toHandle = connectionEndHandle.value;\n const pointer = connectionPosition.value;\n\n return {\n inProgress: true,\n isValid: connectionStatus.value === null ? null : connectionStatus.value === 'valid',\n from: { x: fromHandle.x, y: fromHandle.y },\n fromHandle,\n fromPosition: fromHandle.position,\n fromNode: fromNode as InternalNode<NodeType>,\n // `to` snaps to the hovered end handle; falls back to the raw pointer when over empty canvas\n to: toHandle ? { x: toHandle.x, y: toHandle.y } : pointer,\n toHandle: toHandle ?? null,\n toPosition: toHandle?.position ?? null,\n toNode: ((toHandle ? getInternalNode(toHandle.nodeId) : undefined) ?? null) as InternalNode<NodeType> | null,\n pointer,\n };\n });\n}\n","import type { ComputedRef, MaybeRefOrGetter } from 'vue';\nimport type { Edge } from '../types';\nimport { computed, toValue } from 'vue';\nimport { warn } from '../utils';\nimport { useVueFlow } from './useVueFlow';\n\ninterface EdgeData<EdgeType extends Edge = Edge> {\n id: string;\n type: EdgeType['type'];\n data: NonNullable<EdgeType['data']> | null;\n}\n\n/**\n * Composable for receiving data of one or multiple nodes\n *\n * @public\n * @param edgeId - The id (or ids) of the node to get the data from\n * @param guard - Optional guard function to narrow down the node type\n * @returns An array of data objects\n */\nexport function useEdgesData<EdgeType extends Edge = Edge>(\n edgeId: MaybeRefOrGetter<string>,\n): ComputedRef<EdgeData<EdgeType> | null>;\nexport function useEdgesData<EdgeType extends Edge = Edge>(edgeIds: MaybeRefOrGetter<string[]>): ComputedRef<EdgeData<EdgeType>[]>;\nexport function useEdgesData<EdgeType extends Edge = Edge>(\n edgeIds: MaybeRefOrGetter<string[]>,\n guard: (node: Edge) => node is EdgeType,\n): ComputedRef<EdgeData<EdgeType>[]>;\nexport function useEdgesData(_edgeIds: any): any {\n const { getEdge } = useVueFlow();\n\n return computed({\n get() {\n const edgeIds = toValue(_edgeIds);\n\n if (!Array.isArray(edgeIds)) {\n const edge = getEdge(edgeIds);\n\n if (edge) {\n return {\n id: edge.id,\n type: edge.type,\n data: edge.data ?? null,\n };\n }\n\n return null;\n }\n\n const data: EdgeData<Edge>[] = [];\n\n for (const edgeId of edgeIds) {\n const edge = getEdge(edgeId);\n\n if (edge) {\n data.push({\n id: edge.id,\n type: edge.type,\n data: edge.data ?? null,\n });\n }\n }\n\n return data;\n },\n set() {\n // noop\n warn('You are trying to set edge data via useEdgesData. This is not supported.');\n },\n });\n}\n","import type { HandleType, NodeConnection } from '@xyflow/system';\nimport type { MaybeRefOrGetter } from 'vue';\nimport { areConnectionMapsEqual, handleConnectionChange } from '@xyflow/system';\nimport { computed, shallowRef, toValue, watch } from 'vue';\nimport { useNodeId } from './useNodeId';\nimport { useStore } from './useStore';\n\nexport type UseNodeConnectionsParams = {\n /** node id - if not provided, the node id from the `useNodeId` context injection is used */\n id?: MaybeRefOrGetter<string | null | undefined>;\n onConnect?: (connections: NodeConnection[]) => void;\n onDisconnect?: (connections: NodeConnection[]) => void;\n} & (\n | {\n /** handle type `source` or `target` */\n handleType: MaybeRefOrGetter<HandleType | null | undefined>;\n /** the handle id (only needed if the node has multiple handles of the same type). Requires `handleType` to be set. */\n handleId?: MaybeRefOrGetter<string | null | undefined>;\n }\n // without `handleType` a `handleId` is meaningless at runtime, so the type forbids it (mirrors xyflow/react & xyflow/svelte)\n | { handleType?: MaybeRefOrGetter<HandleType | null | undefined>; handleId?: never }\n);\n\n/**\n * Hook to retrieve all edges connected to a node. Can be filtered by handle type and id.\n *\n * @public\n * @param params\n * @param params.handleType - handle type `source` or `target`\n * @param params.id - node id - if not provided, the node id from the `useNodeId` (meaning, the context-based injection) is used\n * @param params.handleId - the handle id (only needed if the node has multiple handles of the same type; requires `handleType` to be set)\n * @param params.onConnect - gets called when a connection is created\n * @param params.onDisconnect - gets called when a connection is removed\n *\n * @returns An array of connections\n */\nexport function useNodeConnections(params: UseNodeConnectionsParams = {}) {\n const { handleType, handleId, id, onConnect, onDisconnect } = params;\n\n const store = useStore();\n\n const nodeId = useNodeId();\n\n const prevConnections = shallowRef<Map<string, NodeConnection> | null>(null);\n\n const connections = shallowRef<Map<string, NodeConnection>>();\n\n const lookupKey = computed(() => {\n const currNodeId = toValue(id) ?? nodeId;\n const currentHandleType = toValue(handleType);\n const currHandleId = toValue(handleId);\n\n let handleSuffix = '';\n if (currentHandleType) {\n handleSuffix = currHandleId ? `-${currentHandleType}-${currHandleId}` : `-${currentHandleType}`;\n }\n\n return `${currNodeId}${handleSuffix}`;\n });\n\n watch(\n () => store.connectionLookup.get(lookupKey.value),\n (nextConnections) => {\n if (areConnectionMapsEqual(connections.value, nextConnections)) {\n return;\n }\n\n connections.value = nextConnections;\n },\n { immediate: true },\n );\n\n watch(\n [connections, () => typeof onConnect !== 'undefined', () => typeof onDisconnect !== 'undefined'],\n ([currentConnections = new Map<string, NodeConnection>()]) => {\n if (prevConnections.value && prevConnections.value !== currentConnections) {\n handleConnectionChange(prevConnections.value, currentConnections, onDisconnect);\n handleConnectionChange(currentConnections, prevConnections.value, onConnect);\n }\n\n prevConnections.value = currentConnections;\n },\n { immediate: true },\n );\n\n return computed(() => {\n if (!connections.value) {\n return [];\n }\n\n return Array.from(connections.value.values());\n });\n}\n","import type { DistributivePick } from '@xyflow/system';\nimport type { ComputedRef, MaybeRefOrGetter } from 'vue';\nimport type { InternalNode, Node } from '../types';\nimport { computed, toValue } from 'vue';\nimport { warn } from '../utils';\nimport { useVueFlow } from './useVueFlow';\n\n// `DistributivePick` (over `Pick`) distributes across a union `NodeType`, so the result is a discriminated\n// union — checking `.type` narrows `.data`. Mirrors xyflow/react & xyflow/svelte.\ntype NodeData<NodeType extends Node = InternalNode> = DistributivePick<NodeType, 'id' | 'type' | 'data'>;\n\n/**\n * Composable for receiving data of one or multiple nodes\n *\n * @public\n * @param nodeId - The id (or ids) of the node to get the data from\n * @param guard - Optional guard function to narrow down the node type\n * @returns An array of data objects\n */\nexport function useNodesData<NodeType extends Node = InternalNode>(\n nodeId: MaybeRefOrGetter<string>,\n): ComputedRef<NodeData<NodeType> | null>;\nexport function useNodesData<NodeType extends Node = InternalNode>(\n nodeIds: MaybeRefOrGetter<string[]>,\n): ComputedRef<NodeData<NodeType>[]>;\nexport function useNodesData<NodeType extends Node = InternalNode>(\n nodeIds: MaybeRefOrGetter<string[]>,\n guard: (node: Node) => node is NodeType,\n): ComputedRef<NodeData<NodeType>[]>;\nexport function useNodesData(_nodeIds: any): any {\n const { getNode } = useVueFlow();\n\n return computed({\n get() {\n const nodeIds = toValue(_nodeIds);\n\n if (!Array.isArray(nodeIds)) {\n const node = getNode(nodeIds);\n\n if (node) {\n return {\n id: node.id,\n type: node.type,\n data: node.data,\n };\n }\n\n return null;\n }\n\n const data: NodeData<Node>[] = [];\n\n for (const nodeId of nodeIds) {\n const node = getNode(nodeId);\n\n if (node) {\n data.push({\n id: node.id,\n type: node.type,\n data: node.data,\n });\n }\n }\n\n return data;\n },\n set() {\n // noop\n warn('You are trying to set node data via useNodesData. This is not supported.');\n },\n });\n}\n","import { computed } from 'vue';\nimport { areNodesInitialized } from '../utils';\nimport { useStore } from './useStore';\n\nexport interface UseNodesInitializedOptions {\n includeHiddenNodes?: boolean;\n}\n\n/**\n * Composable for getting the initialized state of all nodes.\n *\n * When a new node is added to the graph, it is not immediately initialized.\n * That's because the node's bounds are not yet known.\n * This composable will return false and then true when all nodes are initialized, i.e. when their bounds are known.\n *\n * @public\n * @param options - Options\n * @returns boolean indicating whether all nodes are initialized\n */\nexport function useNodesInitialized(options: UseNodesInitializedOptions = { includeHiddenNodes: false }) {\n const { nodeLookup } = useStore();\n\n return computed(() => areNodesInitialized(nodeLookup, options.includeHiddenNodes));\n}\n","<script lang=\"ts\" setup>\nimport { storeToRefs, useStore, useVueFlow } from '../../composables';\nimport { ARIA_EDGE_DESC_KEY, ARIA_LIVE_MESSAGE, ARIA_NODE_DESC_KEY } from '../../utils/a11y';\n\nconst { id } = useVueFlow();\nconst { disableKeyboardA11y, ariaLiveMessage, ariaLabelConfig } = storeToRefs(useStore());\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'A11yDescriptions',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <div :id=\"`${ARIA_NODE_DESC_KEY}-${id}`\" style=\"display: none\">\n {{\n disableKeyboardA11y\n ? ariaLabelConfig['node.a11yDescription.default']\n : ariaLabelConfig['node.a11yDescription.keyboardDisabled']\n }}\n </div>\n\n <div :id=\"`${ARIA_EDGE_DESC_KEY}-${id}`\" style=\"display: none\">\n {{ ariaLabelConfig['edge.a11yDescription.default'] }}\n </div>\n\n <div\n v-if=\"!disableKeyboardA11y\"\n :id=\"`${ARIA_LIVE_MESSAGE}-${id}`\"\n aria-live=\"assertive\"\n aria-atomic=\"true\"\n style=\"\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n border: 0;\n padding: 0;\n overflow: hidden;\n clip: rect(0px, 0px, 0px, 0px);\n clip-path: inset(100%);\n \"\n >\n {{ ariaLiveMessage }}\n </div>\n</template>\n","import type { Edge, FlowEvents, FlowHooks, Node } from '../types';\nimport { getCurrentInstance, onBeforeMount, onScopeDispose } from 'vue';\nimport { createExtendedEventHook, warn } from '../utils';\n\nexport function createHooks<NodeType extends Node = Node, EdgeType extends Edge = Edge>(): FlowHooks<NodeType, EdgeType> {\n return {\n edgesChange: createExtendedEventHook(),\n nodesChange: createExtendedEventHook(),\n nodeDoubleClick: createExtendedEventHook(),\n nodeClick: createExtendedEventHook(),\n nodeMouseEnter: createExtendedEventHook(),\n nodeMouseMove: createExtendedEventHook(),\n nodeMouseLeave: createExtendedEventHook(),\n nodeContextMenu: createExtendedEventHook(),\n nodeDragStart: createExtendedEventHook(),\n nodeDrag: createExtendedEventHook(),\n nodeDragStop: createExtendedEventHook(),\n nodesInitialized: createExtendedEventHook(),\n miniMapNodeClick: createExtendedEventHook(),\n miniMapNodeDoubleClick: createExtendedEventHook(),\n miniMapNodeMouseEnter: createExtendedEventHook(),\n miniMapNodeMouseMove: createExtendedEventHook(),\n miniMapNodeMouseLeave: createExtendedEventHook(),\n connect: createExtendedEventHook(),\n connectStart: createExtendedEventHook(),\n connectEnd: createExtendedEventHook(),\n clickConnectStart: createExtendedEventHook(),\n clickConnectEnd: createExtendedEventHook(),\n init: createExtendedEventHook(),\n move: createExtendedEventHook(),\n moveStart: createExtendedEventHook(),\n moveEnd: createExtendedEventHook(),\n selectionDragStart: createExtendedEventHook(),\n selectionDrag: createExtendedEventHook(),\n selectionDragStop: createExtendedEventHook(),\n selectionContextMenu: createExtendedEventHook(),\n selectionStart: createExtendedEventHook(),\n selectionEnd: createExtendedEventHook(),\n selectionChange: createExtendedEventHook(),\n viewportChangeStart: createExtendedEventHook(),\n viewportChange: createExtendedEventHook(),\n viewportChangeEnd: createExtendedEventHook(),\n paneScroll: createExtendedEventHook(),\n paneClick: createExtendedEventHook(),\n paneContextMenu: createExtendedEventHook(),\n paneMouseEnter: createExtendedEventHook(),\n paneMouseMove: createExtendedEventHook(),\n paneMouseLeave: createExtendedEventHook(),\n edgeContextMenu: createExtendedEventHook(),\n edgeMouseEnter: createExtendedEventHook(),\n edgeMouseMove: createExtendedEventHook(),\n edgeMouseLeave: createExtendedEventHook(),\n edgeDoubleClick: createExtendedEventHook(),\n edgeClick: createExtendedEventHook(),\n reconnectStart: createExtendedEventHook(),\n reconnect: createExtendedEventHook(),\n reconnectEnd: createExtendedEventHook(),\n updateNodeInternals: createExtendedEventHook(),\n error: createExtendedEventHook(err => warn(err.message)),\n };\n}\n\nexport function useHooks<NodeType extends Node = Node, EdgeType extends Edge = Edge>(\n emit: (...args: any[]) => void,\n hooks: FlowHooks<NodeType, EdgeType>,\n) {\n const inst = getCurrentInstance();\n onBeforeMount(() => {\n for (const [key, value] of Object.entries(hooks)) {\n const listener = (data: unknown) => {\n emit(key, data);\n };\n\n // push into fns instead of using `on` to avoid overwriting default handlers - the emitter should be called in addition to the default handlers\n value.setEmitter(listener);\n onScopeDispose(value.removeEmitter, true);\n\n value.setHasEmitListeners(() => hasVNodeListener(key as keyof FlowEvents));\n onScopeDispose(value.removeHasEmitListeners, true);\n }\n });\n\n function hasVNodeListener(event: keyof FlowEvents) {\n const key = toHandlerKey(event);\n // listeners live on vnode.props; value can be a Function or an array of Functions\n const h = inst?.vnode.props?.[key];\n return !!h;\n }\n}\n\n/**\n * Converts an event name to the corresponding handler key.\n * E.g. 'nodeClick' -> 'onNodeClick'\n *\n * @param event The event name to convert.\n * @returns The corresponding handler key.\n */\nfunction toHandlerKey(event: string) {\n const [head, ...rest] = event.split(':');\n const camel = head.replace(/(?:^|-)(\\w)/g, (_, c: string) => c.toUpperCase());\n return `on${camel}${rest.length ? `:${rest.join(':')}` : ''}`;\n}\n","import type { Edge, FlowProps, Node, State } from '../types';\nimport { ConnectionLineType, ConnectionMode, isMacOs, mergeAriaLabelConfig, PanOnScrollMode, SelectionMode } from '@xyflow/system';\n\nimport { createHooks } from './hooks';\n\nexport function useState<NodeType extends Node = Node, EdgeType extends Edge = Edge>(): State<NodeType, EdgeType> {\n return {\n vueFlowRef: null,\n viewportRef: null,\n nodes: [],\n edges: [],\n nodeLookup: new Map(),\n parentLookup: new Map(),\n edgeLookup: new Map(),\n connectionLookup: new Map(),\n nodeTypes: {},\n edgeTypes: {},\n\n initialized: false,\n\n dimensions: {\n width: 0,\n height: 0,\n },\n transform: [0, 0, 1],\n\n panZoom: null,\n\n minZoom: 0.5,\n maxZoom: 2,\n\n translateExtent: [\n [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY],\n [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY],\n ],\n nodeExtent: [\n [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY],\n [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY],\n ],\n nodeOrigin: [0, 0],\n\n selectionMode: SelectionMode.Full,\n paneDragging: false,\n preventScrolling: true,\n zoomOnScroll: true,\n zoomOnPinch: true,\n zoomOnDoubleClick: true,\n panOnScroll: false,\n panOnScrollSpeed: 0.5,\n panOnScrollMode: PanOnScrollMode.Free,\n paneClickDistance: 0,\n nodeClickDistance: 0,\n panOnDrag: true,\n reconnectRadius: 10,\n onlyRenderVisibleElements: false,\n defaultViewport: { x: 0, y: 0, zoom: 1 },\n\n nodesSelectionActive: false,\n userSelectionActive: false,\n\n userSelectionRect: null,\n\n defaultMarkerColor: '#b1b1b7',\n connectionLineOptions: {\n type: ConnectionLineType.Bezier,\n style: {},\n },\n connectionMode: ConnectionMode.Strict,\n connectionStartHandle: null,\n connectionEndHandle: null,\n connectionClickStartHandle: null,\n connectionPosition: { x: Number.NaN, y: Number.NaN },\n connectionRadius: 20,\n connectionDragThreshold: 1,\n connectOnClick: true,\n connectionStatus: null,\n isValidConnection: null,\n onBeforeDelete: null,\n\n snapGrid: [15, 15],\n snapToGrid: false,\n\n edgesReconnectable: false,\n edgesFocusable: true,\n nodesFocusable: true,\n nodesConnectable: true,\n nodesDraggable: true,\n nodeDragThreshold: 1,\n elementsSelectable: true,\n selectNodesOnDrag: true,\n multiSelectionActive: false,\n selectionKeyCode: 'Shift',\n selectionOnDrag: false,\n multiSelectionKeyCode: isMacOs() ? 'Meta' : 'Control',\n zoomActivationKeyCode: isMacOs() ? 'Meta' : 'Control',\n deleteKeyCode: 'Backspace',\n panActivationKeyCode: 'Space',\n\n hooks: createHooks(),\n\n autoApplyChanges: true,\n autoConnect: false,\n\n fitViewOnInit: false,\n fitViewOnInitDone: false,\n\n noDragClassName: 'nodrag',\n noWheelClassName: 'nowheel',\n noPanClassName: 'nopan',\n defaultEdgeOptions: undefined,\n elevateEdgesOnSelect: false,\n elevateNodesOnSelect: true,\n zIndexMode: 'basic',\n\n autoPanOnNodeDrag: true,\n autoPanOnConnect: true,\n autoPanOnNodeFocus: true,\n autoPanOnSelection: true,\n autoPanSpeed: 15,\n\n disableKeyboardA11y: false,\n ariaLabelConfig: mergeAriaLabelConfig(),\n ariaLiveMessage: '',\n };\n}\n\n// these options will be set using the appropriate methods\nexport const storeOptionsToSkip: (keyof Partial<FlowProps & Omit<State, 'nodes' | 'edges'>>)[] = [\n 'id',\n 'vueFlowRef',\n 'viewportRef',\n 'initialized',\n 'nodes',\n 'edges',\n 'maxZoom',\n 'minZoom',\n 'translateExtent',\n 'nodeExtent',\n 'fitView',\n // mapped from the `fitView` prop in `setState`; keep the generic option loop from re-applying the\n // default — the full state is spread into `setState` on store creation, so a stale `fitViewOnInit: false`\n // would otherwise clobber the value `fitView` just set, leaving `:fit-view` inert.\n 'fitViewOnInit',\n 'viewport',\n 'hooks',\n 'defaultEdgeOptions',\n];\n","import type {\n EdgeRemoveChange,\n EdgeSelectionChange,\n NodeDimensionChange,\n NodePositionChange,\n NodeRemoveChange,\n Rect,\n} from '@xyflow/system';\nimport type {\n Actions,\n Edge,\n EdgeAddChange,\n EdgeLookup,\n InternalNode,\n Node,\n NodeAddChange,\n NodeLookup,\n State,\n} from '../types';\nimport {\n clampPosition,\n clampPositionToParent,\n getConnectedEdges as getConnectedEdgesBase,\n getDimensions,\n getElementsToRemove,\n getHandleBounds,\n getOverlappingArea,\n handleExpandParent,\n isRectObject,\n nodeToRect,\n panBy as panBySystem,\n updateAbsolutePositions,\n} from '@xyflow/system';\nimport { computed, markRaw, toRaw } from 'vue';\nimport { useViewportHelper } from '../composables';\nimport {\n adoptNodes,\n applyChanges,\n createAdditionChange,\n createEdgeRemoveChange,\n createNodeRemoveChange,\n createSelectionChange,\n getSelectionChanges,\n isDef,\n isInternalNode,\n isNode,\n reconnectEdgeAction,\n updateConnectionLookup,\n validateEdges,\n} from '../utils';\nimport { storeOptionsToSkip, useState } from './state';\n\nexport function useActions<NodeType extends Node = Node, EdgeType extends Edge = Edge>(\n state: State<NodeType, EdgeType>,\n nodeLookup: NodeLookup<NodeType>,\n parentLookup: Map<string, Map<string, InternalNode<NodeType>>>,\n edgeLookup: EdgeLookup<EdgeType>,\n): Actions<NodeType, EdgeType> {\n const viewportHelper = useViewportHelper(state, nodeLookup);\n\n // The system-facing twins of the reactive lookups. `@xyflow/system`'s `adoptUserNodes` re-adopts by\n // clearing + refilling the lookup it's given — on a `reactive(Map)` that's an O(n) trigger storm per\n // call (`clear()` invalidates every key and iteration subscriber, every drag frame). Adoption and\n // recompute therefore run against these plain Maps (which also persist across adoptions, keeping\n // `checkEquality` reuse intact); `syncLookups` then mirrors the result into the reactive lookups with\n // targeted `.set`/`.delete`, so only entries whose `InternalNode` reference actually changed trigger —\n // per-frame render invalidation stays O(changed) instead of O(n).\n const systemNodeLookup: NodeLookup<NodeType> = new Map();\n const systemParentLookup: Map<string, Map<string, InternalNode<NodeType>>> = new Map();\n\n function sameMapEntries<K, V>(a: Map<K, V>, b: Map<K, V>) {\n if (a.size !== b.size) {\n return false;\n }\n\n for (const [key, value] of a) {\n if (b.get(key) !== value) {\n return false;\n }\n }\n\n return true;\n }\n\n /** Mirror the system lookups into the reactive ones, touching only entries that actually changed. */\n function syncLookups() {\n const rawNodeLookup = toRaw(nodeLookup);\n\n for (const [id, internal] of systemNodeLookup) {\n if (rawNodeLookup.get(id) !== internal) {\n // `markRaw` exactly the entries that are new since the last sync — `adoptUserNodes` rebuilds\n // changed nodes as fresh plain objects and `updateAbsolutePositions` clones moved children, and\n // without the mark the reactive lookup would deep-proxy them on read. The per-node render\n // computed still re-renders on the `.set` (key-level reactivity is independent of value markRaw).\n nodeLookup.set(id, markRaw(internal));\n }\n }\n\n if (rawNodeLookup.size !== systemNodeLookup.size) {\n for (const id of rawNodeLookup.keys()) {\n if (!systemNodeLookup.has(id)) {\n nodeLookup.delete(id);\n }\n }\n }\n\n // adoption rebuilds every nested child-map instance, so compare content — blindly re-setting an\n // unchanged entry would re-trigger every `parentLookup` subscriber each frame\n const rawParentLookup = toRaw(parentLookup);\n\n for (const [parentId, children] of systemParentLookup) {\n const prev = rawParentLookup.get(parentId);\n if (!prev || !sameMapEntries(prev, children)) {\n parentLookup.set(parentId, children);\n }\n }\n\n if (rawParentLookup.size !== systemParentLookup.size) {\n for (const parentId of rawParentLookup.keys()) {\n if (!systemParentLookup.has(parentId)) {\n parentLookup.delete(parentId);\n }\n }\n }\n }\n\n /**\n * Single write path for node membership/content. Takes the canonical USER `Node`s, re-adopts them into\n * `nodeLookup`/`parentLookup` via `adoptNodes` (xyflow/react+svelte parity — `adoptUserNodes` mutates the\n * lookups in place, reusing unchanged `InternalNode`s by reference via `checkEquality`), then stores the\n * validated user nodes as `state.nodes` (the v-model array / `getNodes`). The enriched `InternalNode`s\n * live only in the lookup. `recomputeAbsolutePositions` refreshes parent-aware absolute positions/z.\n *\n * Because adoption is immutable+reference-based, callers MUST pass NEW user-node objects for changed\n * nodes (see the immutable `applyChanges`) — mutating a node in place keeps its reference, so\n * `checkEquality` would re-adopt the stale `InternalNode`.\n */\n function commitNodes(nodes: NodeType[]) {\n const { nodes: adopted, hasSelectedNodes } = adoptNodes(nodes, systemNodeLookup, systemParentLookup, state.hooks.error.trigger, {\n nodeOrigin: state.nodeOrigin,\n nodeExtent: state.nodeExtent,\n elevateNodesOnSelect: state.elevateNodesOnSelect,\n zIndexMode: state.zIndexMode,\n });\n\n state.nodes = adopted;\n\n // clear a stale visual selection box: `nodesSelectionActive` only ever turns on via a user drag-select,\n // so once the selection empties out (e.g. the selected nodes were deleted) it must turn back off — else\n // a later programmatic select would wrongly render the `NodesSelection` rect (xyflow/react #5727).\n state.nodesSelectionActive = state.nodesSelectionActive && hasSelectedNodes;\n\n recomputeAbsolutePositions();\n }\n\n /**\n * Single write path for edge membership (see {@link commitNodes}). Stores the USER edges verbatim\n * (`edgeLookup` values are the same references as the `state.edges` elements; no\n * enriched edge representation exists). `markRaw` at this choke point keeps edges out of Vue's deep\n * proxy: renders are driven by key-level lookup triggers + immutable replacement, like nodes.\n */\n function commitEdges(next: EdgeType[]) {\n // targeted sync instead of clear+refill: clearing a `reactive(Map)` invalidates every edge\n // subscriber even when a single edge changed\n const rawEdgeLookup = toRaw(edgeLookup);\n\n for (let i = 0; i < next.length; i++) {\n const edge = (next[i] = markRaw(toRaw(next[i])));\n if (rawEdgeLookup.get(edge.id) !== edge) {\n edgeLookup.set(edge.id, edge);\n }\n }\n\n if (rawEdgeLookup.size !== next.length) {\n const nextIds = new Set<string>();\n for (const edge of next) {\n nextIds.add(edge.id);\n }\n\n for (const id of rawEdgeLookup.keys()) {\n if (!nextIds.has(id)) {\n edgeLookup.delete(id);\n }\n }\n }\n\n state.edges = next;\n\n // the connection lookup derives 1:1 from the edges array — rebuilding it here keeps every write\n // path (setEdges/applyEdgeChanges/reconnectEdge/$reset) consistent by construction. Feed it `next`\n // (the array we just committed), NOT the `state.edges` getter: edges are backed by a `defineModel`\n // v-model ref whose writes round-trip through the parent asynchronously, so the getter still reads\n // the pre-commit value on this tick — reading it here would rebuild the lookup from stale edges and\n // leave `useNodeConnections` empty until the next commit (the reported one-frame connection lag).\n updateConnectionLookup(state.connectionLookup, next);\n }\n\n /**\n * Recompute parent-aware `internals.positionAbsolute` on the system lookup, then mirror into the\n * reactive lookups (`syncLookups`). Lookup-only: there is NO write-back onto `state.nodes` — those hold\n * the raw user `Node`s. This replaces the per-node positionAbsolute watcher that used to live in\n * `NodeWrapper`.\n *\n * Adoption (`adoptUserNodes`) already computes clamped positions and `z` (via `calculateZ`, including\n * select-elevation) for every changed node, so the full `updateAbsolutePositions` pass only runs for\n * graphs with child nodes — or when `forceFullPass` says inputs changed without a re-adoption.\n */\n function recomputeAbsolutePositions(forceFullPass = false) {\n // `adoptUserNodes` already computed the clamped `positionAbsolute` + `z` for every changed node\n // (reused nodes keep their still-valid values) and cascades parented nodes inline, so after a commit\n // the full pass is only needed when child nodes exist — a moved parent must cascade to REUSED\n // children regardless of the user array's parent/child order. Callers that change inputs without\n // re-adopting (`setNodeExtent`) force it.\n if (forceFullPass || systemParentLookup.size > 0) {\n updateAbsolutePositions(systemNodeLookup, systemParentLookup, {\n nodeOrigin: state.nodeOrigin,\n nodeExtent: state.nodeExtent,\n elevateNodesOnSelect: state.elevateNodesOnSelect,\n zIndexMode: state.zIndexMode,\n });\n }\n\n syncLookups();\n }\n\n const updateNodeInternals: Actions<NodeType>['updateNodeInternals'] = (ids) => {\n const updateIds = ids ?? [];\n\n state.hooks.updateNodeInternals.trigger(updateIds);\n };\n\n const getConnectedEdges: Actions<NodeType, EdgeType>['getConnectedEdges'] = (nodes) => {\n return getConnectedEdgesBase(nodes, state.edges);\n };\n\n const getHandleConnections: Actions['getHandleConnections'] = ({ id, type, nodeId }) => {\n const handleSuffix = id ? `-${type}-${id}` : `-${type}`;\n return Array.from(state.connectionLookup.get(`${nodeId}${handleSuffix}`)?.values() ?? []);\n };\n\n const getNode: Actions<NodeType>['getNode'] = (id) => {\n if (!id) {\n return;\n }\n\n // The public contract: `getNode` returns the user-facing `Node` (the exact object held in\n // `state.nodes`/v-model), which the store keeps on the InternalNode as `internals.userNode`. Enriched\n // data (internals/measured) is reached via `getInternalNode`. Don't mutate the result in place — it\n // won't propagate; use the helpers (updateNode/applyNodeChanges/setNodes).\n return nodeLookup.get(id)?.internals.userNode as NodeType | undefined;\n };\n\n // The enriched-node accessor (xyflow/react parity): returns the lookup `InternalNode` (enriched\n // `internals`/`measured`), whereas `getNode` returns the user-facing `Node` (`internals.userNode`).\n // Internal call sites that need `internals`/`measured` use this.\n const getInternalNode: Actions<NodeType>['getInternalNode'] = (id) => {\n if (!id) {\n return;\n }\n\n return nodeLookup.get(id);\n };\n\n const getEdge: Actions<NodeType, EdgeType>['getEdge'] = (id) => {\n if (!id) {\n return;\n }\n\n return edgeLookup.get(id);\n };\n\n const updateNodePositions: Actions<NodeType>['updateNodePositions'] = (dragItems, changed, dragging) => {\n const changes: (NodePositionChange | NodeDimensionChange)[] = [];\n const parentExpandChildren: { id: string; parentId: string; rect: Rect }[] = [];\n\n for (const node of dragItems) {\n // read `expandParent`/`parentId` from the canonical node: drag items carry them, but keyboard-move\n // items (from `useUpdateNodePositions`) do not.\n const lookupNode = getNode(node.id);\n const expandParentId = lookupNode?.expandParent ? lookupNode.parentId : undefined;\n\n const change: NodePositionChange = {\n id: node.id,\n type: 'position',\n dragging,\n positionAbsolute: node.internals.positionAbsolute,\n };\n\n if (changed) {\n // drag items already carry the parent-RELATIVE position: XYDrag's `calculateNodePosition` and the\n // keyboard path's `calcNextPosition` both subtract the parent offset before handing items here.\n change.position = node.position;\n\n if (expandParentId) {\n // pin the child's relative position to >= 0; the parent grows to contain it instead\n // (xyflow/react clamps the same way before collecting the child for expansion).\n change.position = { x: Math.max(0, change.position.x), y: Math.max(0, change.position.y) };\n\n parentExpandChildren.push({\n id: node.id,\n parentId: expandParentId,\n rect: {\n ...node.internals.positionAbsolute,\n width: node.measured?.width ?? 0,\n height: node.measured?.height ?? 0,\n },\n });\n }\n }\n\n changes.push(change);\n }\n\n // grow each parent to fit its `expandParent` children — system returns the parent's position +\n // dimension changes plus counter-offsets for the other children, applied through the same pipeline.\n if (parentExpandChildren.length > 0) {\n changes.push(...handleExpandParent(parentExpandChildren, systemNodeLookup, systemParentLookup, state.nodeOrigin));\n }\n\n if (changes.length) {\n state.hooks.nodesChange.trigger(changes);\n }\n };\n\n const updateNodeDimensions: Actions<NodeType>['updateNodeDimensions'] = (updates) => {\n if (!state.vueFlowRef) {\n return;\n }\n\n const viewportNode = state.vueFlowRef.querySelector('.vue-flow__viewport') as HTMLElement;\n\n if (!viewportNode) {\n return;\n }\n\n const style = window.getComputedStyle(viewportNode);\n const { m22: zoom } = new window.DOMMatrixReadOnly(style.transform);\n\n const changes: (NodeDimensionChange | NodePositionChange)[] = [];\n const parentExpandChildren: { id: string; parentId: string; rect: Rect }[] = [];\n\n for (const element of updates) {\n const update = element;\n\n const node = getInternalNode(update.id);\n\n if (node) {\n const dimensions = getDimensions(update.nodeElement);\n\n const doUpdate = !!(\n dimensions.width\n && dimensions.height\n && (node.measured.width !== dimensions.width || node.measured.height !== dimensions.height || update.forceUpdate)\n );\n\n if (doUpdate) {\n const nodeBounds = update.nodeElement.getBoundingClientRect();\n node.measured = { width: dimensions.width, height: dimensions.height };\n if (!node.internals.handleBounds) {\n node.internals.handleBounds = { source: null, target: null };\n }\n node.internals.handleBounds.source = getHandleBounds('source', update.nodeElement, nodeBounds, zoom, node.id);\n node.internals.handleBounds.target = getHandleBounds('target', update.nodeElement, nodeBounds, zoom, node.id);\n\n changes.push({\n id: node.id,\n type: 'dimensions',\n dimensions,\n });\n\n // a freshly-measured `expandParent` child grows its parent to fit (mirrors system's own\n // `updateNodeDimensions`). Unlike the drag path (where the position is the user's target), here\n // the position is fixed and only the size grew — so re-clamp it against the NEW dimensions and\n // the node's extent BEFORE measuring expansion, exactly as system does. Otherwise a node that\n // merely grew would be treated as overflowing and the parent would expand more than necessary.\n if (node.expandParent && node.parentId) {\n const parent = getInternalNode(node.parentId);\n let positionAbsolute = node.internals.positionAbsolute;\n const extent = node.extent;\n\n if (extent === 'parent' && parent) {\n positionAbsolute = clampPositionToParent(positionAbsolute, dimensions, parent);\n }\n else if (Array.isArray(extent)) {\n positionAbsolute = clampPosition(positionAbsolute, extent, dimensions);\n }\n else {\n positionAbsolute = clampPosition(positionAbsolute, state.nodeExtent, dimensions);\n }\n\n parentExpandChildren.push({\n id: node.id,\n parentId: node.parentId,\n rect: { ...positionAbsolute, width: dimensions.width, height: dimensions.height },\n });\n }\n\n // Re-set a fresh entry so the markRaw lookup re-renders this node — in-place `measured`/\n // `handleBounds` writes don't trigger the per-node render computed (markRaw values aren't deep\n // tracked; only the lookup `.set` is). This makes measurement reflect even with `autoApplyChanges:false`\n // (the 'dimensions' change additionally flows `measured` onto the user node via re-adopt).\n // The fresh entry goes into BOTH maps: the system map is what `adoptUserNodes` reuses via\n // `checkEquality`, so leaving the old object there would let the maps' references diverge.\n const fresh = markRaw({ ...toRaw(node) });\n systemNodeLookup.set(node.id, fresh);\n nodeLookup.set(node.id, fresh);\n }\n }\n }\n\n if (parentExpandChildren.length > 0) {\n changes.push(...handleExpandParent(parentExpandChildren, systemNodeLookup, systemParentLookup, state.nodeOrigin));\n }\n\n // the initial `fitView` (the `fitView` prop) is handled reactively by `useFitViewOnInit`: it waits\n // for every node to be measured AND re-fits while the container is still settling — neither of which\n // a one-shot here (fired per measurement batch, against a partial/zero-bounds subset) could do.\n\n if (changes.length) {\n state.hooks.nodesChange.trigger(changes);\n }\n };\n\n const addSelectedNodes: Actions<NodeType>['addSelectedNodes'] = (nodes) => {\n if (state.multiSelectionActive) {\n const nodeChanges = nodes.map(node => createSelectionChange(node.id, true));\n state.hooks.nodesChange.trigger(nodeChanges);\n return;\n }\n\n state.hooks.nodesChange.trigger(getSelectionChanges(nodeLookup, new Set(nodes.map(n => n.id))));\n state.hooks.edgesChange.trigger(getSelectionChanges(edgeLookup));\n };\n\n const addSelectedEdges: Actions<NodeType, EdgeType>['addSelectedEdges'] = (edges) => {\n if (state.multiSelectionActive) {\n const changedEdges = edges.map(edge => createSelectionChange(edge.id, true));\n state.hooks.edgesChange.trigger(changedEdges as EdgeSelectionChange[]);\n return;\n }\n\n state.hooks.edgesChange.trigger(getSelectionChanges(edgeLookup, new Set(edges.map(e => e.id))));\n state.hooks.nodesChange.trigger(getSelectionChanges(nodeLookup, new Set()));\n };\n\n const removeSelectedNodes: Actions<NodeType>['removeSelectedNodes'] = (nodes) => {\n const nodesToUnselect = nodes || state.nodes;\n\n // Emit select=false changes only for nodes that ARE selected — skipping the rest avoids re-committing\n // (and re-rendering) every node on an unselect, e.g. on drag start with `selectNodesOnDrag: false`\n // (xyflow/react #5682). `applyNodeChanges` applies them immutably + re-adopts (no in-place\n // `n.selected = false`: it would keep the node's reference, so the re-adopt would reuse the stale entry).\n const nodeChanges = nodesToUnselect.filter(n => n.selected).map(n => createSelectionChange(n.id, false));\n\n if (nodeChanges.length) {\n state.hooks.nodesChange.trigger(nodeChanges);\n }\n };\n\n const removeSelectedEdges: Actions<NodeType, EdgeType>['removeSelectedEdges'] = (edges) => {\n const edgesToUnselect = edges || state.edges;\n\n const edgeChanges = edgesToUnselect.filter(e => e.selected).map(e => createSelectionChange(e.id, false));\n\n if (edgeChanges.length) {\n state.hooks.edgesChange.trigger(edgeChanges);\n }\n };\n\n const resetSelectedElements: Actions<NodeType, EdgeType>['resetSelectedElements'] = () => {\n // the interactive selection reset (used by a pane click): a no-op while selection is disabled, so a\n // selection made before `elementsSelectable` was turned off — or set programmatically — survives the\n // click (xyflow/react #5217). For unconditional clearing, call `removeSelectedNodes`/`removeSelectedEdges`\n // directly (the equivalent of xyflow/react's ungated `unselectNodesAndEdges`).\n if (!state.elementsSelectable) {\n return;\n }\n\n removeSelectedNodes();\n removeSelectedEdges();\n };\n\n const setMinZoom: Actions<NodeType>['setMinZoom'] = (minZoom) => {\n state.panZoom?.setScaleExtent([minZoom, state.maxZoom]);\n state.minZoom = minZoom;\n };\n\n const setMaxZoom: Actions<NodeType>['setMaxZoom'] = (maxZoom) => {\n state.panZoom?.setScaleExtent([state.minZoom, maxZoom]);\n state.maxZoom = maxZoom;\n };\n\n const setTranslateExtent: Actions<NodeType>['setTranslateExtent'] = (translateExtent) => {\n state.panZoom?.setTranslateExtent(translateExtent);\n state.translateExtent = translateExtent;\n };\n\n const setNodeExtent: Actions<NodeType>['setNodeExtent'] = (nodeExtent) => {\n state.nodeExtent = nodeExtent;\n // force the full system pass — the extent changed without a re-adoption, so every root needs re-clamping\n recomputeAbsolutePositions(true);\n updateNodeInternals();\n };\n\n const setPaneClickDistance: Actions<NodeType>['setPaneClickDistance'] = (clickDistance) => {\n state.panZoom?.setClickDistance(clickDistance);\n };\n\n const setInteractive: Actions<NodeType>['setInteractive'] = (isInteractive) => {\n state.nodesDraggable = isInteractive;\n state.nodesConnectable = isInteractive;\n state.elementsSelectable = isInteractive;\n };\n\n const setNodes: Actions<NodeType>['setNodes'] = (nodes) => {\n const nextNodes = typeof nodes === 'function' ? nodes(state.nodes) : nodes;\n\n if (!state.initialized && !nextNodes.length) {\n return;\n }\n\n // `commitNodes` re-adopts the user nodes into the lookup (xyflow-style) and stores them as `state.nodes`\n commitNodes(nextNodes);\n };\n\n const setEdges: Actions<NodeType, EdgeType>['setEdges'] = (edges) => {\n const nextEdges = typeof edges === 'function' ? edges(state.edges) : edges;\n\n if (!state.initialized && !nextEdges.length) {\n return;\n }\n\n commitEdges(\n validateEdges<EdgeType>(\n nextEdges,\n state.isValidConnection,\n getInternalNode,\n state.hooks.error.trigger,\n state.defaultEdgeOptions,\n state.nodes,\n state.edges,\n ),\n );\n };\n\n const addNodes: Actions<NodeType>['addNodes'] = (nodes) => {\n let nextNodes = typeof nodes === 'function' ? nodes(state.nodes) : nodes;\n nextNodes = Array.isArray(nextNodes) ? nextNodes : [nextNodes];\n\n // Emit `add` changes for the valid user nodes (filter invalid up front — `applyChanges` would\n // otherwise read `.id` off a non-node and throw; `commitNodes`/`adoptNodes` re-validates on adopt).\n const changes: NodeAddChange<NodeType>[] = [];\n for (const node of nextNodes) {\n if (!isNode(node)) {\n continue;\n }\n changes.push(createAdditionChange(node));\n }\n\n if (changes.length) {\n state.hooks.nodesChange.trigger(changes);\n }\n };\n\n const addEdges: Actions<NodeType, EdgeType>['addEdges'] = (params) => {\n let nextEdges = typeof params === 'function' ? params(state.edges) : params;\n nextEdges = Array.isArray(nextEdges) ? nextEdges : [nextEdges];\n\n // the `add` change items are the validated USER edges (a `Connection` becomes a new edge with\n // `defaultEdgeOptions` merged at creation) — no enrichment leaks into the change event payload\n const validEdges = validateEdges<EdgeType>(\n nextEdges,\n state.isValidConnection,\n getInternalNode,\n state.hooks.error.trigger,\n state.defaultEdgeOptions,\n state.nodes,\n state.edges,\n );\n\n const changes: EdgeAddChange<EdgeType>[] = [];\n for (const edge of validEdges) {\n changes.push(createAdditionChange(edge));\n }\n\n if (changes.length) {\n state.hooks.edgesChange.trigger(changes);\n }\n };\n\n const removeNodes: Actions<NodeType>['removeNodes'] = (nodes, removeConnectedEdges = true, removeChildren = false) => {\n const nextNodes = typeof nodes === 'function' ? nodes(state.nodes) : nodes;\n const nodesToRemove = Array.isArray(nextNodes) ? nextNodes : [nextNodes];\n\n const nodeChanges: NodeRemoveChange[] = [];\n const edgeChanges: EdgeRemoveChange[] = [];\n\n function createEdgeRemovalChanges(nodes: Node[]) {\n const connectedEdges = getConnectedEdges(nodes);\n for (const edge of connectedEdges) {\n // deletable is no longer stamped onto stored edges — resolve through defaultEdgeOptions at read time\n const deletable = edge.deletable ?? state.defaultEdgeOptions?.deletable;\n if (isDef(deletable) ? deletable : true) {\n edgeChanges.push(createEdgeRemoveChange(edge.id));\n }\n }\n }\n\n // recursively get all children and if the child is a parent, get those children as well until all nodes have been removed that are children of the current node\n function createChildrenRemovalChanges(id: string) {\n const children: NodeType[] = [];\n for (const node of state.nodes) {\n if (node.parentId === id) {\n children.push(node);\n }\n }\n\n if (children.length) {\n for (const child of children) {\n nodeChanges.push(createNodeRemoveChange(child.id));\n }\n\n if (removeConnectedEdges) {\n createEdgeRemovalChanges(children);\n }\n\n for (const child of children) {\n createChildrenRemovalChanges(child.id);\n }\n }\n }\n\n for (const item of nodesToRemove) {\n const currNode = typeof item === 'string' ? getNode(item) : item;\n\n if (!currNode) {\n continue;\n }\n\n if (isDef(currNode.deletable) && !currNode.deletable) {\n continue;\n }\n\n nodeChanges.push(createNodeRemoveChange(currNode.id));\n\n if (removeConnectedEdges) {\n createEdgeRemovalChanges([currNode as Node]);\n }\n\n if (removeChildren) {\n createChildrenRemovalChanges(currNode.id);\n }\n }\n\n if (edgeChanges.length) {\n state.hooks.edgesChange.trigger(edgeChanges);\n }\n\n if (nodeChanges.length) {\n state.hooks.nodesChange.trigger(nodeChanges);\n }\n };\n\n const removeEdges: Actions<NodeType, EdgeType>['removeEdges'] = (edges) => {\n const nextEdges = typeof edges === 'function' ? edges(state.edges) : edges;\n const edgesToRemove = Array.isArray(nextEdges) ? nextEdges : [nextEdges];\n\n const changes: EdgeRemoveChange[] = [];\n\n for (const item of edgesToRemove) {\n const currEdge = typeof item === 'string' ? getEdge(item) : item;\n\n if (!currEdge) {\n continue;\n }\n\n const deletable = currEdge.deletable ?? state.defaultEdgeOptions?.deletable;\n if (isDef(deletable) && !deletable) {\n continue;\n }\n\n changes.push(createEdgeRemoveChange(typeof item === 'string' ? item : item.id));\n }\n\n state.hooks.edgesChange.trigger(changes);\n };\n\n const deleteElements: Actions<NodeType, EdgeType>['deleteElements'] = async ({ nodes = [], edges = [] }) => {\n // `getElementsToRemove` (xyflow/system) gathers the full set — the targeted nodes + their child nodes,\n // plus connected + explicitly-listed edges, skipping `deletable: false` — then consults `onBeforeDelete`\n // and returns the elements that should actually be removed (`false` → none, an object → that subset).\n const { nodes: matchingNodes, edges: matchingEdges } = await getElementsToRemove<NodeType, EdgeType>({\n nodesToRemove: nodes,\n edgesToRemove: edges,\n nodes: state.nodes,\n edges: state.edges,\n onBeforeDelete: state.onBeforeDelete ?? undefined,\n });\n\n // remove exactly that set: `matchingNodes` already includes children and `matchingEdges` the connected\n // edges (both reflecting any `onBeforeDelete` filtering), so tell `removeNodes` NOT to also pull in\n // connected edges/children — that would bypass an `onBeforeDelete` that chose to keep some.\n if (matchingNodes.length) {\n removeNodes(matchingNodes, false, false);\n }\n\n if (matchingEdges.length) {\n removeEdges(matchingEdges);\n }\n\n return { deletedNodes: matchingNodes, deletedEdges: matchingEdges };\n };\n\n const reconnectEdge: Actions<NodeType, EdgeType>['reconnectEdge'] = (oldEdge, newConnection, shouldReplaceId = true) => {\n const prevEdge = getEdge(oldEdge.id);\n\n if (!prevEdge) {\n return false;\n }\n\n // resolve by id, not identity — callers commonly pass stale references (e.g. an edge captured in an\n // event payload before an immutable change replaced the stored object)\n const prevEdgeIndex = state.edges.findIndex(edge => edge.id === oldEdge.id);\n\n const newEdge = reconnectEdgeAction(oldEdge, newConnection, prevEdge as EdgeType, shouldReplaceId, state.hooks.error.trigger);\n\n if (newEdge) {\n const [validEdge] = validateEdges<EdgeType>(\n [newEdge as unknown as EdgeType],\n state.isValidConnection,\n getInternalNode,\n state.hooks.error.trigger,\n state.defaultEdgeOptions,\n state.nodes,\n state.edges,\n );\n\n if (!validEdge) {\n return false;\n }\n\n commitEdges(state.edges.map((edge, index) => (index === prevEdgeIndex ? validEdge : edge)));\n\n return validEdge;\n }\n\n return false;\n };\n\n const updateEdge: Actions<NodeType, EdgeType>['updateEdge'] = (id, edgeUpdate, options = { replace: false }) => {\n const edge = getEdge(id);\n\n if (!edge) {\n return;\n }\n\n const nextEdge = typeof edgeUpdate === 'function' ? edgeUpdate(edge as EdgeType) : edgeUpdate;\n\n // immutable: build a NEW edge (full replace or shallow merge) for the target id and recommit\n const next = state.edges.map(e => (e.id === id ? ((options.replace ? nextEdge : { ...e, ...nextEdge }) as EdgeType) : e));\n commitEdges(next);\n };\n\n const updateEdgeData: Actions<NodeType, EdgeType>['updateEdgeData'] = (id, dataUpdate, options = { replace: false }) => {\n const edge = getEdge(id);\n\n if (!edge) {\n return;\n }\n\n const nextData = typeof dataUpdate === 'function' ? dataUpdate(edge as EdgeType) : dataUpdate;\n\n // build a NEW edge object — in-place mutation isn't reactive (edges are markRaw'd; renders trigger\n // on lookup replacement)\n const nextEdge = { ...edge, data: options.replace ? nextData : { ...edge.data, ...nextData } } as EdgeType;\n\n commitEdges(state.edges.map(item => (item.id === id ? nextEdge : item)));\n };\n\n const applyNodeChanges: Actions<NodeType>['applyNodeChanges'] = (changes) => {\n // Apply changes IMMUTABLY against the canonical user nodes (`applyChanges` returns a new array — new\n // objects for changed nodes, unchanged reused by reference), then re-adopt via `commitNodes`\n // (`adoptUserNodes` reuses unchanged InternalNodes by reference via `checkEquality`).\n const result = applyChanges(changes, state.nodes);\n commitNodes(result);\n return result;\n };\n\n const applyEdgeChanges: Actions<NodeType, EdgeType>['applyEdgeChanges'] = (changes) => {\n // apply immutably against the canonical user edges: new array, new objects for changed edges,\n // unchanged reused by reference\n const result = applyChanges(changes, state.edges);\n commitEdges(result);\n return result;\n };\n\n const updateNode: Actions<NodeType>['updateNode'] = (id, nodeUpdate, options = { replace: false }) => {\n const node = getInternalNode(id);\n\n if (!node) {\n return;\n }\n\n const nextNode = typeof nodeUpdate === 'function' ? nodeUpdate(node) : nodeUpdate;\n\n // Immutable update: build a NEW user node (full replacement or shallow merge) for the target id and\n // re-adopt via `commitNodes`. Mutating in place would keep the reference and re-adopt the stale node.\n const next = state.nodes.map(n => (n.id === id ? ((options.replace ? nextNode : { ...n, ...nextNode }) as NodeType) : n));\n commitNodes(next);\n };\n\n const updateNodeData: Actions<NodeType>['updateNodeData'] = (id, dataUpdate, options = { replace: false }) => {\n const node = getInternalNode(id);\n\n if (!node) {\n return;\n }\n\n const nextData = typeof dataUpdate === 'function' ? dataUpdate(node) : dataUpdate;\n\n // Immutable: new user node with new `data`, then re-adopt (see {@link updateNode}).\n const next = state.nodes.map(n =>\n n.id === id ? ({ ...n, data: options.replace ? nextData : { ...n.data, ...nextData } } as NodeType) : n,\n );\n commitNodes(next);\n };\n\n const startConnection: Actions<NodeType>['startConnection'] = (startHandle, position, isClick = false) => {\n if (isClick) {\n state.connectionClickStartHandle = startHandle;\n }\n else {\n state.connectionStartHandle = startHandle;\n }\n\n state.connectionEndHandle = null;\n state.connectionStatus = null;\n\n if (position) {\n state.connectionPosition = position;\n }\n };\n\n const updateConnection: Actions<NodeType>['updateConnection'] = (position, result = null, status = null) => {\n if (state.connectionStartHandle) {\n state.connectionPosition = position;\n state.connectionEndHandle = result;\n state.connectionStatus = status;\n }\n };\n\n const endConnection: Actions<NodeType>['endConnection'] = (event, isClick) => {\n state.connectionPosition = { x: Number.NaN, y: Number.NaN };\n state.connectionEndHandle = null;\n state.connectionStatus = null;\n\n if (isClick) {\n state.connectionClickStartHandle = null;\n }\n else {\n state.connectionStartHandle = null;\n }\n };\n\n const getNodeRect = (\n nodeOrRect: (Partial<Node> & { id: Node['id'] }) | Rect,\n ): [Rect | null, Node | null | undefined, boolean] => {\n const isRectObj = isRectObject(nodeOrRect);\n // use `getInternalNode` (not getNode): `nodeToRect` below needs `internals`/`measured`, which live on\n // the InternalNode, not the user `Node` that getNode returns\n const node = isRectObj ? null : isInternalNode(nodeOrRect) ? nodeOrRect : getInternalNode(nodeOrRect.id);\n\n if (!isRectObj && !node) {\n return [null, null, isRectObj];\n }\n\n const nodeRect = isRectObj ? nodeOrRect : nodeToRect(node!);\n\n return [nodeRect, node, isRectObj];\n };\n\n const getIntersectingNodes: Actions<NodeType>['getIntersectingNodes'] = (\n nodeOrRect,\n partially = true,\n // defaults to the enriched InternalNodes — intersection geometry needs `internals`/`measured`\n nodes = Array.from(nodeLookup.values()),\n ) => {\n const [nodeRect, node, isRect] = getNodeRect(nodeOrRect);\n\n if (!nodeRect) {\n return [];\n }\n\n const intersections: InternalNode<NodeType>[] = [];\n for (const n of nodes) {\n if (!isRect && (n.id === node!.id || !n.internals.positionAbsolute)) {\n continue;\n }\n\n const currNodeRect = nodeToRect(n);\n const overlappingArea = getOverlappingArea(currNodeRect, nodeRect);\n const partiallyVisible = partially && overlappingArea > 0;\n\n if (\n partiallyVisible\n || overlappingArea >= currNodeRect.width * currNodeRect.height\n || overlappingArea >= Number(nodeRect.width) * Number(nodeRect.height)\n ) {\n intersections.push(n);\n }\n }\n\n return intersections;\n };\n\n const isNodeIntersecting: Actions<NodeType>['isNodeIntersecting'] = (nodeOrRect, area, partially = true) => {\n const [nodeRect] = getNodeRect(nodeOrRect);\n\n if (!nodeRect) {\n return false;\n }\n\n const overlappingArea = getOverlappingArea(nodeRect, area);\n const partiallyVisible = partially && overlappingArea > 0;\n\n // \"intersecting\" when partially overlapping (if `partially`) OR fully contained either way — the node\n // inside the area, or the area inside the node (the latter was missing; xyflow/react #5482)\n return (\n partiallyVisible\n || overlappingArea >= area.width * area.height\n || overlappingArea >= Number(nodeRect.width) * Number(nodeRect.height)\n );\n };\n\n const panBy: Actions<NodeType>['panBy'] = (delta) => {\n const { transform, dimensions, translateExtent, panZoom } = state;\n\n return panBySystem({ delta, panZoom, transform, translateExtent, ...dimensions });\n };\n\n const setState: Actions<NodeType, EdgeType>['setState'] = (options) => {\n const opts = typeof options === 'function' ? options(state) : options;\n\n // these options cannot be set after initialization\n const exclude: (keyof typeof opts)[] = ['viewportRef', 'vueFlowRef', 'dimensions', 'hooks'];\n\n // we need to set the default opts before setting any elements so the options are applied to the elements on first render\n if (isDef(opts.defaultEdgeOptions)) {\n state.defaultEdgeOptions = opts.defaultEdgeOptions;\n }\n\n // the `fitView` prop maps to the internal `fitViewOnInit` flag (kept separate from the `fitView()`\n // action); skipped from the generic loop above via `storeOptionsToSkip`\n if (isDef(opts.fitView)) {\n state.fitViewOnInit = opts.fitView;\n }\n\n if (isDef(opts.nodes)) {\n setNodes(opts.nodes);\n }\n\n if (isDef(opts.edges)) {\n setEdges(opts.edges);\n }\n\n const setSkippedOptions = () => {\n if (isDef(opts.maxZoom)) {\n setMaxZoom(opts.maxZoom);\n }\n if (isDef(opts.minZoom)) {\n setMinZoom(opts.minZoom);\n }\n if (isDef(opts.translateExtent)) {\n setTranslateExtent(opts.translateExtent);\n }\n // route through the setter (recomputes absolute positions) instead of the raw generic-loop\n // assignment — runs after `setNodes`, so preloaded nodes get re-clamped to the extent\n if (isDef(opts.nodeExtent)) {\n setNodeExtent(opts.nodeExtent);\n }\n };\n\n for (const o of Object.keys(opts)) {\n const key = o as keyof State;\n const option = opts[key];\n\n if (![...storeOptionsToSkip, ...exclude].includes(key) && isDef(option)) {\n ;(<any>state)[key] = option;\n }\n }\n\n // min/max-zoom + translateExtent setters are panZoom-null-safe (they always write state, and\n // `XYPanZoom` reads those state values when it mounts), so apply them directly — no need to wait\n // for the panZoom instance to exist.\n setSkippedOptions();\n\n if (!state.initialized) {\n state.initialized = true;\n }\n };\n\n // Mirror xyflow/react's `toObject`: shallow-clone each node/edge and read the viewport off the transform.\n // No field stripping (notably `measured` is kept, so a restored flow renders immediately instead of\n // staying `visibility: hidden` until re-measured) and no JSON round-trip — the nodes/edges are already\n // plain `markRaw`'d user objects, and callers that persist the result serialize it (`JSON.stringify(...)`).\n const toObject: Actions<NodeType>['toObject'] = () => ({\n nodes: state.nodes.map(node => ({ ...node })),\n edges: state.edges.map(edge => ({ ...edge })),\n viewport: { x: state.transform[0], y: state.transform[1], zoom: state.transform[2] },\n });\n\n const $reset: Actions<NodeType, EdgeType>['$reset'] = () => {\n const { nodes: _nodes, edges: _edges, ...resetState } = useState<NodeType, EdgeType>();\n\n commitEdges([]);\n commitNodes([]);\n\n if (state.panZoom) {\n state.panZoom.setViewport({\n x: state.defaultViewport.x ?? 0,\n y: state.defaultViewport.y ?? 0,\n zoom: state.defaultViewport.zoom ?? 1,\n });\n }\n\n setState(resetState);\n };\n\n return {\n updateNodePositions,\n updateNodeDimensions,\n setNodes,\n setEdges,\n addNodes,\n addEdges,\n removeNodes,\n removeEdges,\n deleteElements,\n getNode,\n getInternalNode,\n getEdge,\n reconnectEdge,\n updateEdge,\n updateEdgeData,\n updateNode,\n updateNodeData,\n applyEdgeChanges,\n applyNodeChanges,\n addSelectedNodes,\n addSelectedEdges,\n setMinZoom,\n setMaxZoom,\n setTranslateExtent,\n setNodeExtent,\n setPaneClickDistance,\n removeSelectedNodes,\n removeSelectedEdges,\n resetSelectedElements,\n startConnection,\n updateConnection,\n endConnection,\n setInteractive,\n setState,\n getIntersectingNodes,\n getConnectedEdges,\n getHandleConnections,\n isNodeIntersecting,\n panBy,\n fitView: params => viewportHelper.value.fitView(params),\n zoomIn: transitionOpts => viewportHelper.value.zoomIn(transitionOpts),\n zoomOut: transitionOpts => viewportHelper.value.zoomOut(transitionOpts),\n zoomTo: (zoomLevel, transitionOpts) => viewportHelper.value.zoomTo(zoomLevel, transitionOpts),\n setViewport: (params, transitionOpts) => viewportHelper.value.setViewport(params, transitionOpts),\n getViewport: () => viewportHelper.value.getViewport(),\n setCenter: (x, y, opts) => viewportHelper.value.setCenter(x, y, opts),\n fitBounds: (params, opts) => viewportHelper.value.fitBounds(params, opts),\n screenToFlowPosition: params => viewportHelper.value.screenToFlowPosition(params),\n flowToScreenPosition: params => viewportHelper.value.flowToScreenPosition(params),\n toObject,\n updateNodeInternals,\n viewportInitialized: computed(() => viewportHelper.value.viewportInitialized),\n $reset,\n $destroy: () => {},\n };\n}\n","import type { Component, FunctionalComponent } from 'vue';\nimport type { BuiltInNode, NodeProps } from '../../types';\nimport { Position } from '@xyflow/system';\nimport { Fragment, h } from 'vue';\nimport Handle from '../Handle/Handle.vue';\n\nconst DefaultNode: FunctionalComponent<NodeProps<BuiltInNode>> = function ({\n sourcePosition = Position.Bottom,\n targetPosition = Position.Top,\n isConnectable = true,\n data,\n}) {\n const label = data?.label;\n\n return [\n h(Handle as Component, { type: 'target', position: targetPosition, isConnectable }),\n typeof label !== 'string' && label ? h(label) : h(Fragment, [label]),\n h(Handle as Component, { type: 'source', position: sourcePosition, isConnectable }),\n ];\n};\n\nDefaultNode.props = ['sourcePosition', 'targetPosition', 'isConnectable', 'data'];\nDefaultNode.inheritAttrs = false;\nDefaultNode.compatConfig = { MODE: 3 };\n\nexport default DefaultNode;\n","import type { Component, FunctionalComponent } from 'vue';\nimport type { BuiltInNode, NodeProps } from '../../types';\nimport { Position } from '@xyflow/system';\nimport { Fragment, h } from 'vue';\nimport Handle from '../Handle/Handle.vue';\n\nconst InputNode: FunctionalComponent<NodeProps<BuiltInNode>> = function ({\n sourcePosition = Position.Bottom,\n isConnectable = true,\n data,\n}) {\n const label = data?.label;\n\n return [\n typeof label !== 'string' && label ? h(label) : h(Fragment, [label]),\n h(Handle as Component, { type: 'source', position: sourcePosition, isConnectable }),\n ];\n};\n\nInputNode.props = ['sourcePosition', 'isConnectable', 'data'];\nInputNode.inheritAttrs = false;\nInputNode.compatConfig = { MODE: 3 };\n\nexport default InputNode;\n","import type { Component, FunctionalComponent } from 'vue';\nimport type { BuiltInNode, NodeProps } from '../../types';\nimport { Position } from '@xyflow/system';\nimport { Fragment, h } from 'vue';\nimport Handle from '../Handle/Handle.vue';\n\nconst OutputNode: FunctionalComponent<NodeProps<BuiltInNode>> = function ({\n targetPosition = Position.Top,\n isConnectable,\n data,\n}) {\n const label = data?.label;\n\n return [\n h(Handle as Component, { type: 'target', position: targetPosition, isConnectable }),\n typeof label !== 'string' && label ? h(label) : h(Fragment, [label]),\n ];\n};\n\nOutputNode.props = ['targetPosition', 'isConnectable', 'data'];\nOutputNode.inheritAttrs = false;\nOutputNode.compatConfig = { MODE: 3 };\n\nexport default OutputNode;\n","import type { DefaultEdgeTypes, DefaultNodeTypes } from '../types';\n\nimport BezierEdge from '../components/Edges/BezierEdge';\nimport SimpleBezierEdge from '../components/Edges/SimpleBezierEdge';\nimport SmoothStepEdge from '../components/Edges/SmoothStepEdge';\nimport StepEdge from '../components/Edges/StepEdge';\nimport StraightEdge from '../components/Edges/StraightEdge';\nimport DefaultNode from '../components/Nodes/DefaultNode';\nimport InputNode from '../components/Nodes/InputNode';\nimport OutputNode from '../components/Nodes/OutputNode';\n\nexport const defaultNodeTypes: DefaultNodeTypes = {\n input: InputNode,\n default: DefaultNode,\n output: OutputNode,\n};\n\nexport const defaultEdgeTypes: DefaultEdgeTypes = {\n default: BezierEdge,\n straight: StraightEdge,\n step: StepEdge,\n smoothstep: SmoothStepEdge,\n simplebezier: SimpleBezierEdge,\n};\n","import type { ComputedGetters, Edge, Node, NodeLookup, State } from '../types';\nimport { getNodesInside, isEdgeVisible } from '@xyflow/system';\nimport { computed } from 'vue';\nimport { defaultEdgeTypes, defaultNodeTypes } from '../utils/defaultNodesEdges';\n\nexport function useGetters<NodeType extends Node = Node, EdgeType extends Edge = Edge>(\n state: State<NodeType, EdgeType>,\n nodeLookup: NodeLookup<NodeType>,\n): ComputedGetters<NodeType, EdgeType> {\n const getEdgeTypes: ComputedGetters<NodeType, EdgeType>['getEdgeTypes'] = computed(() => {\n const edgeTypes: Record<string, any> = {\n ...defaultEdgeTypes,\n ...state.edgeTypes,\n };\n\n const keys = Object.keys(edgeTypes);\n\n // defaults are not stamped onto stored edges — auto-register defaultEdgeOptions.type too, else\n // edges relying on it would render the bezier default instead of the configured component\n const defaultType = state.defaultEdgeOptions?.type;\n if (defaultType && !keys.includes(defaultType)) {\n edgeTypes[defaultType] = defaultType;\n keys.push(defaultType);\n }\n\n for (const e of state.edges) {\n e.type && !keys.includes(e.type) && (edgeTypes[e.type] = e.type);\n }\n\n return edgeTypes;\n });\n\n const getNodeTypes: ComputedGetters<NodeType>['getNodeTypes'] = computed(() => {\n const nodeTypes: Record<string, any> = {\n ...defaultNodeTypes,\n ...state.nodeTypes,\n };\n\n const keys = Object.keys(nodeTypes);\n\n for (const n of state.nodes) {\n n.type && !keys.includes(n.type) && (nodeTypes[n.type] = n.type);\n }\n\n return nodeTypes;\n });\n\n const getNodes: ComputedGetters<NodeType>['getNodes'] = computed(() => {\n if (state.onlyRenderVisibleElements) {\n // `getNodesInside` works on the InternalNode lookup; surface the user nodes (the public contract)\n return getNodesInside(\n nodeLookup,\n {\n x: 0,\n y: 0,\n width: state.dimensions.width,\n height: state.dimensions.height,\n },\n state.transform,\n true,\n ).map(node => node.internals.userNode);\n }\n\n return state.nodes;\n });\n\n const getEdges: ComputedGetters<NodeType, EdgeType>['getEdges'] = computed(() => {\n if (state.onlyRenderVisibleElements) {\n const visibleEdges: EdgeType[] = [];\n\n for (const edge of state.edges) {\n const source = nodeLookup.get(edge.source);\n const target = nodeLookup.get(edge.target);\n\n // skip dangling edges (missing endpoint node) instead of crashing on the non-null assertion\n if (!source || !target) {\n continue;\n }\n\n if (\n isEdgeVisible({\n sourceNode: source,\n targetNode: target,\n width: state.dimensions.width,\n height: state.dimensions.height,\n transform: state.transform,\n })\n ) {\n visibleEdges.push(edge);\n }\n }\n\n return visibleEdges;\n }\n\n return state.edges;\n });\n\n const getSelectedNodes: ComputedGetters<NodeType>['getSelectedNodes'] = computed(() => {\n const selectedNodes: NodeType[] = [];\n for (const node of state.nodes) {\n if (node.selected) {\n selectedNodes.push(node);\n }\n }\n\n return selectedNodes;\n });\n\n const getSelectedEdges: ComputedGetters<NodeType, EdgeType>['getSelectedEdges'] = computed(() => {\n const selectedEdges: EdgeType[] = [];\n for (const edge of state.edges) {\n if (edge.selected) {\n selectedEdges.push(edge);\n }\n }\n\n return selectedEdges;\n });\n\n // the public `{ x, y, zoom }` shape derived from the canonical `transform` tuple (read-only)\n const viewport: ComputedGetters<NodeType, EdgeType>['viewport'] = computed(() => ({\n x: state.transform[0],\n y: state.transform[1],\n zoom: state.transform[2],\n }));\n\n return {\n getEdgeTypes,\n getNodeTypes,\n getEdges,\n getNodes,\n getSelectedNodes,\n getSelectedEdges,\n viewport,\n };\n}\n","import type { Ref } from 'vue';\nimport type {\n Edge,\n EdgeLookup,\n FlowProps,\n InternalNode,\n Node,\n NodeLookup,\n VueFlowInstance,\n VueFlowState,\n VueFlowStoreHandle,\n} from '../types';\nimport { reactive, shallowRef, toRaw, watch } from 'vue';\nimport { useActions } from './actions';\nimport { useGetters } from './getters';\nimport { useState } from './state';\n\n/**\n * External backing refs for a store's nodes/edges. When `<VueFlow>` passes its `v-model` refs here, the\n * store reads/writes them directly (single source of truth, like svelte's `$bindable` proxy) so a\n * separate v-model sync layer isn't needed. Omitted → the store uses internal refs.\n */\nexport interface StoreSignals<NodeType extends Node = Node, EdgeType extends Edge = Edge> {\n nodes?: Ref<NodeType[]>;\n edges?: Ref<EdgeType[]>;\n}\n\n/**\n * Builds a fully-wired VueFlow store instance (reactive state, lookups, getters, actions, hooks).\n *\n * Standalone factory so store ownership lives in the component that creates it — `<VueFlow>` or\n * `<VueFlowProvider>` via `useCreateVueFlow` — which `provide`s it to descendants. There is no global\n * registry; `useVueFlow()` resolves the store purely through `inject`.\n *\n * @internal\n */\nexport function createVueFlowStore<NodeType extends Node = Node, EdgeType extends Edge = Edge>(\n id: string,\n preloadedState?: FlowProps<NodeType, EdgeType>,\n onDestroy?: (id: string) => void,\n signals?: StoreSignals<NodeType, EdgeType>,\n): VueFlowStoreHandle<NodeType, EdgeType> {\n // nodes/edges are backed by (optionally injected) signal refs — the single source of truth. When\n // `<VueFlow>` passes its v-model refs, mutating the store *is* the v-model update (svelte's\n // bindable-prop proxy), so no separate sync layer is needed. Default: internal `shallowRef`s — the\n // arrays are only ever reassigned whole (immutable commits), and `shallowRef` keeps the fallback's\n // type at `Ref<NodeType[]>` exactly (a deep `ref` would unwrap to `Ref<UnwrapRefSimple<NodeType>[]>`,\n // which TS can't reconcile with the injected signal's type over an unresolved generic). The explicit\n // `| undefined` reflects an injected-but-unbound `defineModel` ref.\n const nodesSignal: Ref<NodeType[] | undefined> = signals?.nodes ?? shallowRef([]);\n const edgesSignal: Ref<EdgeType[] | undefined> = signals?.edges ?? shallowRef([]);\n\n // The array references the store itself last wrote (through the `state.nodes`/`.edges` setters below).\n // The single-source binding watch (further down) uses these to tell its own writes apart from an\n // external `v-model` reassignment — no pause/resume flags needed.\n let lastWriteNodes: NodeType[] | undefined;\n let lastWriteEdges: EdgeType[] | undefined;\n\n // Stable empty fallbacks: an injected `v-model` ref is `undefined` until bound (e.g. `<VueFlow>` with no\n // `:nodes`), so reads must never surface `undefined` (everything iterates `state.nodes`/`.edges`). A\n // stable reference avoids reactivity churn while unbound; `setState`/`commit` replace it with a real array.\n const emptyNodes: NodeType[] = [];\n const emptyEdges: EdgeType[] = [];\n\n const state = useState<NodeType, EdgeType>();\n\n // Proxy `state.nodes`/`.edges` through the signals via accessors (svelte's `get nodes()` pattern), so\n // every existing `state.nodes` read/write stays unchanged while the backing becomes injectable.\n Object.defineProperty(state, 'nodes', {\n get: () => nodesSignal.value ?? emptyNodes,\n set: (value: NodeType[]) => {\n lastWriteNodes = toRaw(value);\n nodesSignal.value = value;\n },\n enumerable: true,\n configurable: true,\n });\n Object.defineProperty(state, 'edges', {\n get: () => edgesSignal.value ?? emptyEdges,\n set: (value: EdgeType[]) => {\n lastWriteEdges = toRaw(value);\n edgesSignal.value = value;\n },\n enumerable: true,\n configurable: true,\n });\n\n const reactiveState = reactive(state) as any;\n\n const hooksOn = <any>{};\n for (const [n, h] of Object.entries(reactiveState.hooks)) {\n const name = `on${n.charAt(0).toUpperCase() + n.slice(1)}`;\n hooksOn[name] = (h as any).on;\n }\n\n const emits = <any>{};\n for (const [n, h] of Object.entries(reactiveState.hooks)) {\n emits[n] = (h as any).trigger;\n }\n\n // The lookup maps hold the enriched `InternalNode`s/edges (canonical for `internals`/`measured`); the\n // canonical user-facing `Node`/`Edge` arrays live in `state.nodes`/`state.edges` (the v-model source of\n // truth). They are created as plain `Map`s in `useState` and made reactive by `reactive(state)` above, so\n // Map identity is stable across mutations (`@xyflow/system` helpers `.set` clones in place while reads via\n // `.get` stay reactive) AND `useStore()` surfaces them as part of the state. The store actions write both\n // in one imperative pass (`commitNodes` re-adopts the user nodes into the lookup, `commitEdges` mirrors\n // edges) — no derivation watcher, no rebuild thrash.\n //\n // The `as` casts undo `reactive()`'s `UnwrapNestedRefs` widening over a Map of the *generic*\n // `InternalNode<NodeType>` (TS can't prove the element type has no refs to unwrap); at runtime the proxy is\n // exactly a `Map<string, InternalNode>`, so the assertion is sound (documented Vue + generics friction).\n const nodeLookup = reactiveState.nodeLookup as NodeLookup<NodeType>;\n const parentLookup = reactiveState.parentLookup as Map<string, Map<string, InternalNode<NodeType>>>;\n const edgeLookup = reactiveState.edgeLookup as EdgeLookup<EdgeType>;\n\n const getters = useGetters<NodeType, EdgeType>(reactiveState, nodeLookup);\n\n const actions = useActions<NodeType, EdgeType>(reactiveState, nodeLookup, parentLookup, edgeLookup);\n\n actions.setState({ ...reactiveState, ...preloadedState } as any);\n\n // Single-source `v-model` binding. When `<VueFlow>` passes its model refs as signals, the store's\n // nodes/edges ARE those refs: internal mutations (drag, `addEdges`, `applyNodeChanges`, …) write them\n // through the `state.nodes`/`.edges` setters, which IS the v-model write-back — the OUT direction is\n // free, no watcher. The only thing left is adopting an EXTERNAL reassignment (`nodes.value = [...]` in\n // user land) so the lookups rebuild. The store's own writes are recorded in `lastWriteNodes`; a user\n // reassignment writes the signal directly, bypassing the setter, so we re-adopt only then (mirrors\n // svelte-flow re-running `adoptUserNodes` via `$derived` on a reference change — no pause/resume).\n // Identity must be compared on the RAW arrays: a parent binding the v-model to a deep `ref` hands our\n // own write back as its reactive proxy, which would fail a plain `!==` and loop `setNodes` forever.\n if (signals?.nodes) {\n watch(nodesSignal, (next) => {\n const nextRaw = next && toRaw(next);\n if (nextRaw && nextRaw !== lastWriteNodes) {\n actions.setNodes(nextRaw);\n }\n });\n }\n if (signals?.edges) {\n watch(edgesSignal, (next) => {\n const nextRaw = next && toRaw(next);\n if (nextRaw && nextRaw !== lastWriteEdges) {\n actions.setEdges(nextRaw as unknown as EdgeType[]);\n }\n });\n }\n\n // The curated instance (`useVueFlow()`): actions + getters + event hooks + identity. Raw reactive\n // state (`useStore()`) is `reactiveState` itself — the two views over one store.\n const instance: VueFlowInstance<NodeType, EdgeType> = {\n ...hooksOn,\n ...getters,\n ...actions,\n emits,\n id,\n $destroy: () => {\n onDestroy?.(id);\n },\n };\n\n return { instance, state: reactiveState as VueFlowState<NodeType, EdgeType> };\n}\n","import type { StoreSignals } from '../store/createStore';\nimport type { Edge, EdgeChange, FlowOptions, Node, NodeChange, VueFlowInstance, VueFlowState, VueFlowStoreHandle } from '../types';\nimport { provide, useId, watch } from 'vue';\nimport { VueFlow, VueFlowStateKey } from '../context';\nimport { createVueFlowStore } from '../store/createStore';\n\n/**\n * Create a VueFlow store, register the default change handlers, and `provide` it to descendants.\n *\n * Owned by `<VueFlow>` / `<VueFlowProvider>`. This is the *only* place a store is created and provided;\n * the public `useVueFlow()` (instance) and `useStore()` (state) are pure `inject` consumers. Must run in\n * a component `setup` (it calls `provide` + `watch` + `useId`, which bind to the component instance).\n *\n * @internal\n */\nexport function useCreateVueFlow<NodeType extends Node = Node, EdgeType extends Edge = Edge>(\n options?: FlowOptions<NodeType, EdgeType>,\n signals?: StoreSignals<NodeType, EdgeType>,\n): VueFlowStoreHandle<NodeType, EdgeType> {\n // the flow id is only an aria/debug label (not a lookup key), so default it to Vue's SSR-safe `useId()`\n const handle = createVueFlowStore<NodeType, EdgeType>(options?.id ?? useId(), options, undefined, signals);\n const { instance, state } = handle;\n\n /**\n * Register default change handlers so `addNodes`/`addEdges`/etc. mutate the store. Disabling\n * `autoApplyChanges` (the user handles changes manually) removes them. Mirrors xyflow/react.\n */\n watch(\n () => state.autoApplyChanges,\n (shouldApplyDefault, _prev, onCleanup) => {\n const nodesChangeHandler = (changes: NodeChange[]) => {\n instance.applyNodeChanges(changes as NodeChange<NodeType>[]);\n };\n const edgesChangeHandler = (changes: EdgeChange[]) => {\n instance.applyEdgeChanges(changes as EdgeChange<EdgeType>[]);\n };\n\n if (shouldApplyDefault) {\n instance.onNodesChange(nodesChangeHandler);\n instance.onEdgesChange(edgesChangeHandler);\n }\n else {\n state.hooks.nodesChange.off(nodesChangeHandler);\n state.hooks.edgesChange.off(edgesChangeHandler);\n }\n\n onCleanup(() => {\n state.hooks.nodesChange.off(nodesChangeHandler);\n state.hooks.edgesChange.off(edgesChangeHandler);\n });\n },\n { immediate: true },\n );\n\n provide(VueFlow, instance as unknown as VueFlowInstance);\n provide(VueFlowStateKey, state as unknown as VueFlowState);\n\n return handle;\n}\n","import type { Edge, Node } from '../types';\nimport { watch } from 'vue';\nimport { useVueFlow } from './useVueFlow';\n\n/**\n * Composable that handles the initialization of the viewport.\n *\n * Takes the store explicitly because it runs inside `<VueFlow>`'s own setup, where `inject` can't see\n * `<VueFlow>`'s own `provide` (provide reaches descendants only). Defaults to `useVueFlow()` for\n * descendant callers.\n *\n * @internal\n */\nexport function useOnInitHandler<NodeType extends Node = Node, EdgeType extends Edge = Edge>(\n vfInstance = useVueFlow<NodeType, EdgeType>(),\n) {\n watch(\n () => vfInstance.viewportInitialized.value,\n (isInitialized) => {\n if (isInitialized) {\n vfInstance.emits.init(vfInstance);\n }\n },\n // `flush: 'post'` runs the callback after the viewport DOM update, so consumers' `onInit` see the\n // initialized viewport. Replaces a `setTimeout(() => …, 1)` that deferred the emit by a macrotask to\n // approximate the same \"after the viewport is ready\" timing.\n { flush: 'post' },\n );\n}\n","import type { Edge, Node } from '../types';\nimport { watch } from 'vue';\nimport { useVueFlow } from './useVueFlow';\n\n/**\n * Fires the `selectionChange` event whenever the set of selected nodes or edges changes, mirroring\n * xyflow/react's `onSelectionChange`. Membership is tracked by id, so the event fires on select/deselect\n * — not on unrelated node/edge mutations (which would re-run the `getSelected*` getters but not change ids).\n *\n * Takes the store explicitly because it runs inside `<VueFlow>`'s own setup, where `inject` can't see\n * `<VueFlow>`'s own `provide` (see {@link useOnInitHandler}). Defaults to `useVueFlow()` for descendant callers.\n *\n * @internal\n */\nexport function useSelectionChange<NodeType extends Node = Node, EdgeType extends Edge = Edge>(\n vfInstance = useVueFlow<NodeType, EdgeType>(),\n) {\n watch(\n [\n () => vfInstance.getSelectedNodes.value.map(node => node.id).join(' '),\n () => vfInstance.getSelectedEdges.value.map(edge => edge.id).join(' '),\n ],\n () => {\n vfInstance.emits.selectionChange({\n nodes: [...vfInstance.getSelectedNodes.value],\n edges: [...vfInstance.getSelectedEdges.value],\n });\n },\n );\n}\n","import type { Edge, Node } from '../types';\nimport { onMounted } from 'vue';\nimport { ErrorCode, isDev, VueFlowError } from '../utils';\nimport { useVueFlow } from './useVueFlow';\n\n/**\n * Takes the store explicitly because it runs inside `<VueFlow>`'s own setup, where `inject` can't see\n * `<VueFlow>`'s own `provide`. Defaults to `useVueFlow()` for descendant callers.\n *\n * @internal\n */\nexport function useStylesLoadedWarning<NodeType extends Node = Node, EdgeType extends Edge = Edge>(\n vfInstance = useVueFlow<NodeType, EdgeType>(),\n) {\n const { emits } = vfInstance;\n\n onMounted(() => {\n if (isDev()) {\n const pane = document.querySelector('.vue-flow__pane');\n\n if (pane && !(window.getComputedStyle(pane).zIndex === '1')) {\n emits.error(new VueFlowError(ErrorCode.MISSING_STYLES));\n }\n }\n });\n}\n","import type { Viewport } from '@xyflow/system';\nimport type { Ref } from 'vue';\nimport type { Edge, Node, VueFlowState } from '../types';\nimport { watch } from 'vue';\nimport { storeToRefs } from './storeToRefs';\nimport { useStore } from './useStore';\n\nfunction sameViewport(a: Viewport | undefined, b: Viewport | undefined) {\n return !!a && !!b && a.x === b.x && a.y === b.y && a.zoom === b.zoom;\n}\n\n/**\n * Two-way binds the `viewport` v-model to the store's canonical `transform`, matching xyflow/react's\n * controlled viewport and svelte's `bind:viewport`.\n *\n * - **in** (model → store): applies an externally-set `viewport` to the panzoom via `syncViewport` (which\n * doesn't fire pan/zoom events) and mirrors it onto `transform`. Re-runs once the panzoom mounts so the\n * controlled value wins over `ZoomPane`'s `defaultViewport` seed.\n * - **out** (store → model): writes `transform` changes back to the model so the binding stays in sync.\n *\n * Equality guards on both sides stop the round-trip from looping.\n *\n * @internal\n */\nexport function useViewportSync<NodeType extends Node = Node, EdgeType extends Edge = Edge>(\n model: Ref<Viewport | undefined>,\n state: VueFlowState<NodeType, EdgeType> = useStore<NodeType, EdgeType>(),\n) {\n const { transform, panZoom } = storeToRefs(state);\n\n // also keyed on `panZoom` so the controlled value is re-applied once the instance mounts (its initial\n // `defaultViewport` seed would otherwise clobber a transform set before mount)\n watch(\n [model, panZoom],\n ([viewport]) => {\n if (!viewport) {\n return;\n }\n\n const current = { x: transform.value[0], y: transform.value[1], zoom: transform.value[2] };\n if (sameViewport(viewport, current)) {\n return;\n }\n\n panZoom.value?.syncViewport(viewport);\n transform.value = [viewport.x, viewport.y, viewport.zoom];\n },\n { immediate: true },\n );\n\n watch(transform, (next) => {\n const viewport = { x: next[0], y: next[1], zoom: next[2] };\n if (sameViewport(viewport, model.value)) {\n return;\n }\n\n model.value = viewport;\n });\n}\n","import type { HandleElement } from '../../types';\nimport { ConnectionLineType, ConnectionMode, getBezierPath, getHandlePosition, getMarkerId, getSmoothStepPath, oppositePosition, Position } from '@xyflow/system';\nimport { computed, defineComponent, h, inject } from 'vue';\nimport { storeToRefs, useStore, useVueFlow } from '../../composables';\nimport { Slots } from '../../context';\nimport { getSimpleBezierPath } from '../Edges/SimpleBezierEdge';\n\nconst ConnectionLine = defineComponent({\n name: 'ConnectionLine',\n compatConfig: { MODE: 3 },\n setup() {\n const { id, viewport, getInternalNode } = useVueFlow();\n\n const {\n connectionMode,\n connectionStartHandle,\n connectionEndHandle,\n connectionPosition,\n connectionLineOptions,\n connectionStatus,\n } = storeToRefs(useStore());\n\n const connectionLineComponent = inject(Slots)?.['connection-line'];\n\n const fromNode = computed(() => getInternalNode(connectionStartHandle.value?.nodeId));\n\n const toNode = computed(() => getInternalNode(connectionEndHandle.value?.nodeId) ?? null);\n\n // `connectionPosition` holds the raw pointer (screen space); convert to flow space for the line + the\n // custom connection-line component. The line END snaps to the hovered handle (below) when there is one.\n const pointer = computed(() => {\n return {\n x: (connectionPosition.value.x - viewport.value.x) / viewport.value.zoom,\n y: (connectionPosition.value.y - viewport.value.y) / viewport.value.zoom,\n };\n });\n\n const markerStart = computed(() =>\n connectionLineOptions.value.markerStart ? `url(#${getMarkerId(connectionLineOptions.value.markerStart, id)})` : '',\n );\n\n const markerEnd = computed(() =>\n connectionLineOptions.value.markerEnd ? `url(#${getMarkerId(connectionLineOptions.value.markerEnd, id)})` : '',\n );\n\n return () => {\n if (!fromNode.value || !connectionStartHandle.value) {\n return null;\n }\n\n const startHandleId = connectionStartHandle.value.id;\n\n const handleType = connectionStartHandle.value.type;\n\n const fromHandleBounds = fromNode.value.internals.handleBounds;\n let handleBounds = fromHandleBounds?.[handleType] ?? [];\n\n if (connectionMode.value === ConnectionMode.Loose) {\n const oppositeBounds = fromHandleBounds?.[handleType === 'source' ? 'target' : 'source'] ?? [];\n handleBounds = [...handleBounds, ...oppositeBounds];\n }\n\n const fromHandle = (startHandleId ? handleBounds.find(d => d.id === startHandleId) : handleBounds[0]) ?? null;\n const fromPosition = fromHandle?.position ?? Position.Top;\n const { x: fromX, y: fromY } = getHandlePosition(fromNode.value, fromHandle, fromPosition);\n\n let toHandle: HandleElement | null = null;\n if (toNode.value) {\n // if connection mode is strict, we only look for handles of the opposite type\n if (connectionMode.value === ConnectionMode.Strict) {\n toHandle\n = toNode.value.internals.handleBounds?.[handleType === 'source' ? 'target' : 'source']?.find(\n d => d.id === connectionEndHandle.value?.id,\n ) || null;\n }\n else {\n // if connection mode is loose, look for the handle in both source and target bounds\n toHandle\n = [\n ...(toNode.value.internals.handleBounds?.source ?? []),\n ...(toNode.value.internals.handleBounds?.target ?? []),\n ]?.find(d => d.id === connectionEndHandle.value?.id) || null;\n }\n }\n\n const toPosition = connectionEndHandle.value?.position ?? (fromPosition ? oppositePosition[fromPosition] : null);\n\n if (!fromPosition || !toPosition) {\n return null;\n }\n\n // snap the line end to the hovered handle when there is one; otherwise follow the raw pointer\n const { x: toX, y: toY }\n = toHandle && toNode.value ? getHandlePosition(toNode.value, toHandle, toPosition) : pointer.value;\n\n const type = connectionLineOptions.value.type ?? ConnectionLineType.Bezier;\n\n let dAttr = '';\n\n const pathParams = {\n sourceX: fromX,\n sourceY: fromY,\n sourcePosition: fromPosition,\n targetX: toX,\n targetY: toY,\n targetPosition: toPosition,\n };\n\n if (type === ConnectionLineType.Bezier) {\n ;[dAttr] = getBezierPath(pathParams);\n }\n else if (type === ConnectionLineType.Step) {\n ;[dAttr] = getSmoothStepPath({\n ...pathParams,\n borderRadius: 0,\n });\n }\n else if (type === ConnectionLineType.SmoothStep) {\n ;[dAttr] = getSmoothStepPath(pathParams);\n }\n else if (type === ConnectionLineType.SimpleBezier) {\n ;[dAttr] = getSimpleBezierPath(pathParams);\n }\n else {\n dAttr = `M${fromX},${fromY} ${toX},${toY}`;\n }\n\n return h(\n 'svg',\n { class: 'vue-flow__edges vue-flow__connectionline vue-flow__container' },\n h(\n 'g',\n { class: 'vue-flow__connection' },\n connectionLineComponent\n ? h(connectionLineComponent, {\n fromX,\n fromY,\n fromPosition,\n toX,\n toY,\n toPosition,\n fromNode: fromNode.value,\n fromHandle,\n toNode: toNode.value,\n toHandle,\n markerEnd: markerEnd.value,\n markerStart: markerStart.value,\n connectionStatus: connectionStatus.value,\n pointer: pointer.value,\n })\n : h('path', {\n 'd': dAttr,\n 'class': [connectionLineOptions.value.class, connectionStatus.value, 'vue-flow__connection-path'],\n 'style': {\n ...connectionLineOptions.value.style,\n },\n 'marker-end': markerEnd.value,\n 'marker-start': markerStart.value,\n }),\n ),\n );\n };\n },\n});\n\nexport default ConnectionLine;\n","import { onScopeDispose, watch } from 'vue';\nimport { storeToRefs } from './storeToRefs';\nimport { useNodesInitialized } from './useNodesInitialized';\nimport { useStore } from './useStore';\nimport { useVueFlow } from './useVueFlow';\n\n/**\n * Drives the `fitView` prop's initial fit.\n *\n * The fit is **one-shot**, mirroring xyflow — later user resizes don't re-fit. But the container can keep\n * resizing right after mount (e.g. the docs REPL lays out its preview pane after the flow), and a single fit\n * on the first measurement would latch against a too-small container → top-aligned view. So we re-fit on each\n * settle tick and only mark the fit *done* once the dimensions have stayed put for a frame; from then on the\n * watcher is inert. A user pan/zoom also ends it immediately.\n *\n * Must be called from a descendant of the provider (it injects the store) — currently `<ZoomPane>`, not\n * `<VueFlow>` itself (which can't inject its own `provide`).\n *\n * @internal\n */\nexport function useFitViewOnInit() {\n const { fitView, onMoveStart } = useVueFlow();\n const { panZoom, dimensions, fitViewOnInit, fitViewOnInitDone, fitViewOptions } = storeToRefs(useStore());\n const nodesInitialized = useNodesInitialized();\n\n // A user pan/zoom hands viewport control to the user — stop auto-fitting from then on. Our own\n // programmatic `fitView` also fires `moveStart`, but with a `null` `event` (no DOM source event), so\n // gating on `event` ignores it.\n let userControlled = false;\n onMoveStart(({ event }) => {\n if (event) {\n userControlled = true;\n }\n });\n\n // Latched once the container has settled (or the user took over). The initial fit is one-shot: once this\n // flips true the watcher is inert, so a later resize no longer re-fits.\n let done = false;\n // Each fit (re)arms this frame; if no dimension change re-fires the watcher before it runs, the container\n // has settled and we're done. A change cancels it and re-fits, so we always land on the final size.\n let settleFrame: number | undefined;\n\n watch(\n [nodesInitialized, panZoom, () => dimensions.value.width, () => dimensions.value.height],\n () => {\n if (\n done\n || userControlled\n || !fitViewOnInit.value\n || !panZoom.value\n || !nodesInitialized.value\n || !dimensions.value.width\n || !dimensions.value.height\n ) {\n return;\n }\n\n fitView(fitViewOptions?.value);\n // reveal the pane after the first fit — it's kept at `opacity: 0` until now (see `Viewport.vue`) to\n // avoid a flash of nodes at their unfit coordinates\n fitViewOnInitDone.value = true;\n\n if (settleFrame !== undefined) {\n cancelAnimationFrame(settleFrame);\n }\n settleFrame = requestAnimationFrame(() => {\n done = true;\n });\n },\n { immediate: true, flush: 'post' },\n );\n\n onScopeDispose(() => {\n if (settleFrame !== undefined) {\n cancelAnimationFrame(settleFrame);\n }\n }, true);\n}\n","import type { Ref } from 'vue';\nimport { getDimensions } from '@xyflow/system';\nimport { onBeforeUnmount, onMounted } from 'vue';\nimport { ErrorCode, VueFlowError } from '../utils';\nimport { storeToRefs } from './storeToRefs';\nimport { useStore } from './useStore';\nimport { useVueFlow } from './useVueFlow';\n\n/**\n * Composable that handles the resize of the viewport.\n *\n * @internal\n * @param viewportEl\n */\nexport function useResizeHandler(viewportEl: Ref<HTMLDivElement | null>): void {\n const { emits } = useVueFlow();\n const { dimensions } = storeToRefs(useStore());\n\n let resizeObserver: ResizeObserver;\n\n onMounted(() => {\n const updateDimensions = () => {\n if (!viewportEl.value || !(viewportEl.value.checkVisibility?.() ?? true)) {\n return;\n }\n\n const size = getDimensions(viewportEl.value);\n\n if (size.width === 0 || size.height === 0) {\n emits.error(new VueFlowError(ErrorCode.MISSING_VIEWPORT_DIMENSIONS));\n }\n\n dimensions.value = { width: size.width || 500, height: size.height || 500 };\n };\n\n updateDimensions();\n window.addEventListener('resize', updateDimensions);\n\n if (viewportEl.value) {\n resizeObserver = new ResizeObserver(() => updateDimensions());\n resizeObserver.observe(viewportEl.value);\n }\n\n onBeforeUnmount(() => {\n window.removeEventListener('resize', updateDimensions);\n\n const el = viewportEl.value;\n if (resizeObserver && el) {\n resizeObserver.unobserve(el);\n }\n });\n });\n}\n","import type { FunctionalComponent, HTMLAttributes } from 'vue';\nimport { Position } from '@xyflow/system';\nimport { h } from 'vue';\n\ninterface Props extends HTMLAttributes {\n position: Position;\n centerX: number;\n centerY: number;\n radius?: number;\n type: string;\n}\n\nfunction shiftX(x: number, shift: number, position: Position): number {\n if (position === Position.Left) {\n return x - shift;\n }\n if (position === Position.Right) {\n return x + shift;\n }\n return x;\n}\n\nfunction shiftY(y: number, shift: number, position: Position): number {\n if (position === Position.Top) {\n return y - shift;\n }\n if (position === Position.Bottom) {\n return y + shift;\n }\n return y;\n}\n\nconst EdgeAnchor: FunctionalComponent<Props> = function ({\n radius = 10,\n centerX = 0,\n centerY = 0,\n position = Position.Top,\n type,\n}) {\n return h('circle', {\n class: `vue-flow__edgeupdater vue-flow__edgeupdater-${type}`,\n cx: shiftX(centerX, radius, position),\n cy: shiftY(centerY, radius, position),\n r: radius,\n stroke: 'transparent',\n fill: 'transparent',\n });\n};\n\nEdgeAnchor.props = ['radius', 'centerX', 'centerY', 'position', 'type'];\nEdgeAnchor.compatConfig = { MODE: 3 };\n\nexport default EdgeAnchor;\n","import type { Connection, FinalConnectionState, HandleType } from '@xyflow/system';\nimport type { Edge, EdgeComponent, InternalNode, MouseTouchEvent } from '../../types';\nimport { ConnectionMode, getHandlePosition, getMarkerId, Position } from '@xyflow/system';\nimport { computed, defineComponent, getCurrentInstance, h, inject, provide, resolveComponent, shallowRef, toRef } from 'vue';\nimport { useHandle, useStore, useVueFlow } from '../../composables';\nimport { EdgeId, EdgeRef, Slots } from '../../context';\nimport { ARIA_EDGE_DESC_KEY, elementSelectionKeys, ErrorCode, getEdgeHandle, getEdgeZIndex, VueFlowError } from '../../utils';\nimport EdgeAnchor from './EdgeAnchor';\n\ninterface Props {\n id: string;\n}\n\n// candidate handles for one end of an edge: strict mode = only the matching side; loose mode = both\n// sides, matching side first (so `getEdgeHandle` prefers it)\nfunction getNodeHandles(node: InternalNode, side: 'source' | 'target', strict: boolean) {\n const bounds = node.internals.handleBounds;\n if (strict) {\n return bounds?.[side] ?? null;\n }\n\n const other = side === 'source' ? 'target' : 'source';\n return [...(bounds?.[side] ?? []), ...(bounds?.[other] ?? [])];\n}\n\nconst EdgeWrapper = defineComponent({\n name: 'Edge',\n compatConfig: { MODE: 3 },\n props: ['id'],\n setup(props: Props) {\n const { id: vueFlowId, addSelectedEdges, emits, getEdgeTypes, removeSelectedEdges, getEdge, getInternalNode } = useVueFlow();\n\n // Read the reactive store directly (see NodeWrapper) — `store.x` tracks reactively inside\n // computeds/handlers, so there's no need to project the whole state into refs per edge.\n const store = useStore();\n\n // `isValidConnection` is handed to `useHandle`, which reads it as a ref, so keep it as one.\n const isValidConnection = toRef(store, 'isValidConnection');\n\n const storedEdge = computed(() => getEdge(props.id) as Edge);\n\n const edge = computed<Edge>(() => {\n const defaults = store.defaultEdgeOptions;\n return defaults ? ({ ...(defaults as Edge), ...storedEdge.value } as Edge) : storedEdge.value;\n });\n\n // resolved per edge (value-gated computed) so the z-tracking of BOTH endpoint lookup keys lives in\n // this component's scope — resolving it in EdgeRenderer's v-for made the whole renderer re-render\n // (all edge vnodes) whenever ANY node entry was replaced, i.e. every drag frame\n const zIndex = computed(() => getEdgeZIndex(edge.value, getInternalNode, store.elevateEdgesOnSelect, store.zIndexMode));\n\n const slots = inject(Slots);\n\n const instance = getCurrentInstance();\n\n const mouseOver = shallowRef(false);\n\n const updating = shallowRef(false);\n\n const nodeId = shallowRef('');\n\n const handleId = shallowRef<string | null>(null);\n\n const reconnectHandleType = shallowRef<HandleType>('source');\n\n const edgeEl = shallowRef<SVGElement | null>(null);\n\n const isSelectable = toRef(() =>\n typeof edge.value.selectable === 'undefined' ? store.elementsSelectable : edge.value.selectable,\n );\n\n const isReconnectable = toRef(() =>\n typeof edge.value.reconnectable === 'undefined' ? store.edgesReconnectable : edge.value.reconnectable,\n );\n\n const isFocusable = toRef(() => (typeof edge.value.focusable === 'undefined' ? store.edgesFocusable : edge.value.focusable));\n\n provide(EdgeId, props.id);\n provide(EdgeRef, edgeEl);\n\n const edgeClass = computed(() => edge.value.class);\n const edgeStyle = computed(() => edge.value.style);\n\n const edgeCmp = computed(() => {\n const name = edge.value.type || 'default';\n\n const slot = slots?.[`edge-${name}`];\n if (slot) {\n return slot;\n }\n\n let edgeType = edge.value.template ?? getEdgeTypes.value[name];\n\n if (typeof edgeType === 'string') {\n if (instance) {\n const components = Object.keys(instance.appContext.components);\n if (components && components.includes(name)) {\n edgeType = resolveComponent(name, false) as EdgeComponent;\n }\n }\n }\n\n if (edgeType && typeof edgeType !== 'string') {\n return edgeType;\n }\n\n emits.error(new VueFlowError(ErrorCode.EDGE_TYPE_MISSING, edgeType));\n\n return false;\n });\n\n const { handlePointerDown } = useHandle({\n nodeId,\n handleId,\n type: reconnectHandleType,\n isValidConnection,\n reconnectHandleType,\n // xyflow/react + svelte hide the original edge AND emit `reconnectStart` from the system's\n // `onConnectStart` — i.e. once the reconnect drag actually starts (after the drag threshold), not\n // eagerly on pointerdown. A plain click on the anchor then leaves the edge in place and emits nothing.\n onReconnectStart: (event) => {\n updating.value = true;\n emits.reconnectStart({ event, edge: storedEdge.value, handleType: reconnectHandleType.value });\n },\n onReconnect,\n onReconnectEnd,\n });\n\n return () => {\n // bail if the edge was removed between a lookup update and this wrapper unmounting — otherwise the\n // derefs below throw when no `defaultEdgeOptions` mask the now-undefined edge\n if (!storedEdge.value) {\n return null;\n }\n\n const sourceNode = getInternalNode(edge.value.source);\n const targetNode = getInternalNode(edge.value.target);\n const pathOptions = 'pathOptions' in edge.value ? edge.value.pathOptions : {};\n\n if (!sourceNode && !targetNode) {\n emits.error(new VueFlowError(ErrorCode.EDGE_SOURCE_TARGET_MISSING, edge.value.id, edge.value.source, edge.value.target));\n\n return null;\n }\n\n if (!sourceNode) {\n emits.error(new VueFlowError(ErrorCode.EDGE_SOURCE_MISSING, edge.value.id, edge.value.source));\n\n return null;\n }\n\n if (!targetNode) {\n emits.error(new VueFlowError(ErrorCode.EDGE_TARGET_MISSING, edge.value.id, edge.value.target));\n\n return null;\n }\n\n if (!edge.value || edge.value.hidden || sourceNode.hidden || targetNode.hidden) {\n return null;\n }\n\n // strict mode considers only the matching side's handles; loose mode considers both (matching first)\n const strict = store.connectionMode === ConnectionMode.Strict;\n const sourceHandle = getEdgeHandle(getNodeHandles(sourceNode, 'source', strict), edge.value.sourceHandle);\n const targetHandle = getEdgeHandle(getNodeHandles(targetNode, 'target', strict), edge.value.targetHandle);\n\n const sourcePosition = sourceHandle?.position || Position.Bottom;\n\n const targetPosition = targetHandle?.position || Position.Top;\n\n // positions are render-local — computed each render and passed to the edge component as props,\n // never stored on the edge\n const { x: sourceX, y: sourceY } = getHandlePosition(sourceNode, sourceHandle, sourcePosition);\n const { x: targetX, y: targetY } = getHandlePosition(targetNode, targetHandle, targetPosition);\n\n // the full-container svg wrapper (one stacking context per edge zIndex) is rendered here rather\n // than in EdgeRenderer's v-for so its node-lookup tracking stays scoped to this edge\n return h(\n 'svg',\n { style: { zIndex: zIndex.value } },\n h(\n 'g',\n {\n 'ref': edgeEl,\n 'key': props.id,\n 'data-id': props.id,\n 'class': [\n 'vue-flow__edge',\n `vue-flow__edge-${edgeCmp.value === false ? 'default' : edge.value.type || 'default'}`,\n store.noPanClassName,\n edgeClass.value,\n {\n updating: mouseOver.value,\n selected: edge.value.selected,\n animated: edge.value.animated,\n inactive: !isSelectable.value && !store.hooks.edgeClick.hasListeners(),\n // @xyflow/system's CSS keys `cursor: pointer` and the focus stroke off `.selectable`\n selectable: isSelectable.value,\n },\n ],\n 'tabIndex': isFocusable.value ? 0 : undefined,\n 'aria-label':\n edge.value.ariaLabel === null\n ? undefined\n : edge.value.ariaLabel ?? `Edge from ${edge.value.source} to ${edge.value.target}`,\n 'aria-describedby': isFocusable.value ? `${ARIA_EDGE_DESC_KEY}-${vueFlowId}` : undefined,\n 'aria-roledescription': 'edge',\n 'role': isFocusable.value ? 'group' : 'img',\n ...edge.value.domAttributes,\n 'onClick': onEdgeClick,\n 'onContextmenu': onEdgeContextMenu,\n 'onDblclick': onDoubleClick,\n 'onMouseenter': onEdgeMouseEnter,\n 'onMousemove': onEdgeMouseMove,\n 'onMouseleave': onEdgeMouseLeave,\n 'onKeyDown': isFocusable.value ? onKeyDown : undefined,\n },\n [\n updating.value\n ? null\n : h(edgeCmp.value === false ? getEdgeTypes.value.default : (edgeCmp.value as any), {\n // no sourceNode/targetNode (custom edges resolve nodes via `useInternalNode`);\n // handles passed as sourceHandleId/targetHandleId\n id: props.id,\n source: edge.value.source,\n target: edge.value.target,\n type: edge.value.type,\n reconnectable: isReconnectable.value,\n selectable: isSelectable.value,\n deletable: edge.value.deletable,\n selected: edge.value.selected,\n animated: edge.value.animated,\n label: edge.value.label,\n labelStyle: edge.value.labelStyle,\n labelShowBg: edge.value.labelShowBg,\n labelBgStyle: edge.value.labelBgStyle,\n labelBgPadding: edge.value.labelBgPadding,\n labelBgBorderRadius: edge.value.labelBgBorderRadius,\n data: edge.value.data,\n style: edgeStyle.value,\n // only emit a marker ref when the edge actually has one — `getMarkerId(undefined)`\n // returns '' (→ `url('#')`), which otherwise writes a bogus marker attr on every edge\n // path every render (a wasted `setAttribute` per frame for the common marker-less edge)\n markerStart: edge.value.markerStart ? `url('#${getMarkerId(edge.value.markerStart, vueFlowId)}')` : undefined,\n markerEnd: edge.value.markerEnd ? `url('#${getMarkerId(edge.value.markerEnd, vueFlowId)}')` : undefined,\n sourcePosition,\n targetPosition,\n sourceX,\n sourceY,\n targetX,\n targetY,\n sourceHandleId: edge.value.sourceHandle,\n targetHandleId: edge.value.targetHandle,\n interactionWidth: edge.value.interactionWidth,\n ...pathOptions,\n }),\n [\n isReconnectable.value === 'source' || isReconnectable.value === true\n ? [\n h(\n 'g',\n {\n onMousedown: onReconnectSourceMouseDown,\n onMouseenter: onReconnectMouseEnter,\n onMouseout: onReconnectMouseOut,\n },\n h(EdgeAnchor, {\n 'position': sourcePosition,\n 'centerX': sourceX,\n 'centerY': sourceY,\n 'radius': store.reconnectRadius,\n 'type': 'source',\n 'data-type': 'source',\n }),\n ),\n ]\n : null,\n isReconnectable.value === 'target' || isReconnectable.value === true\n ? [\n h(\n 'g',\n {\n onMousedown: onReconnectTargetMouseDown,\n onMouseenter: onReconnectMouseEnter,\n onMouseout: onReconnectMouseOut,\n },\n h(EdgeAnchor, {\n 'position': targetPosition,\n 'centerX': targetX,\n 'centerY': targetY,\n 'radius': store.reconnectRadius,\n 'type': 'target',\n 'data-type': 'target',\n }),\n ),\n ]\n : null,\n ],\n ],\n ),\n );\n };\n\n function onReconnectMouseEnter() {\n mouseOver.value = true;\n }\n\n function onReconnectMouseOut() {\n mouseOver.value = false;\n }\n\n function onReconnect(event: MouseTouchEvent, connection: Connection) {\n emits.reconnect({ event, edge: storedEdge.value, connection });\n }\n\n function onReconnectEnd(event: MouseTouchEvent, connectionState: FinalConnectionState<InternalNode>) {\n emits.reconnectEnd({ event, edge: storedEdge.value, handleType: reconnectHandleType.value, connectionState });\n updating.value = false;\n }\n\n function handleReconnect(event: MouseEvent, isSourceHandle: boolean) {\n if (event.button !== 0) {\n return;\n }\n\n nodeId.value = isSourceHandle ? edge.value.target : edge.value.source;\n handleId.value = (isSourceHandle ? edge.value.targetHandle : edge.value.sourceHandle) ?? null;\n\n reconnectHandleType.value = isSourceHandle ? 'target' : 'source';\n\n handlePointerDown(event);\n }\n\n function onEdgeClick(event: MouseEvent) {\n const data = { event, edge: storedEdge.value };\n\n if (isSelectable.value) {\n store.nodesSelectionActive = false;\n\n if (edge.value.selected && store.multiSelectionActive) {\n removeSelectedEdges([storedEdge.value]);\n\n edgeEl.value?.blur();\n }\n else {\n addSelectedEdges([storedEdge.value]);\n }\n }\n\n emits.edgeClick(data);\n }\n\n function onEdgeContextMenu(event: MouseEvent) {\n emits.edgeContextMenu({ event, edge: storedEdge.value });\n }\n\n function onDoubleClick(event: MouseEvent) {\n emits.edgeDoubleClick({ event, edge: storedEdge.value });\n }\n\n function onEdgeMouseEnter(event: MouseEvent) {\n emits.edgeMouseEnter({ event, edge: storedEdge.value });\n }\n\n function onEdgeMouseMove(event: MouseEvent) {\n emits.edgeMouseMove({ event, edge: storedEdge.value });\n }\n\n function onEdgeMouseLeave(event: MouseEvent) {\n emits.edgeMouseLeave({ event, edge: storedEdge.value });\n }\n\n function onReconnectSourceMouseDown(event: MouseEvent) {\n handleReconnect(event, true);\n }\n\n function onReconnectTargetMouseDown(event: MouseEvent) {\n handleReconnect(event, false);\n }\n\n function onKeyDown(event: KeyboardEvent) {\n if (!store.disableKeyboardA11y && elementSelectionKeys.includes(event.key) && isSelectable.value) {\n const unselect = event.key === 'Escape';\n\n if (unselect) {\n edgeEl.value?.blur();\n\n removeSelectedEdges([storedEdge.value]);\n }\n else {\n addSelectedEdges([storedEdge.value]);\n }\n }\n }\n },\n});\n\nexport default EdgeWrapper;\n","import type { EdgeBase, Position } from '@xyflow/system';\nimport type { Component, CSSProperties, SVGAttributes, VNode } from 'vue';\nimport type { EdgeComponent, EdgeTextProps } from './components';\nimport type { ClassValue, Styles } from './flow';\n\n/** Edge markers */\nexport enum MarkerType {\n Arrow = 'arrow',\n ArrowClosed = 'arrowclosed',\n}\n\n/** Edge marker definition */\nexport interface EdgeMarker {\n /** Unique marker id */\n id?: string;\n /** Marker type */\n type: MarkerType;\n /** Marker color */\n color?: string;\n /** Marker width */\n width?: number;\n /** Marker height */\n height?: number;\n /** Marker units */\n markerUnits?: string;\n /** Marker orientation */\n orient?: string;\n /** Marker stroke width */\n strokeWidth?: number;\n}\n\nexport interface MarkerProps {\n id: string;\n type: MarkerType | string;\n /** Marker color; `null`/unset lets the `--xy-edge-stroke` CSS variable drive the arrowhead color */\n color?: string | null;\n width?: number;\n height?: number;\n markerUnits?: string;\n orient?: string;\n strokeWidth?: number;\n}\n\nexport type EdgeMarkerType = string | EdgeMarker;\n\nexport type EdgeReconnectable = boolean | 'target' | 'source';\n\nexport interface EdgeLabelOptions {\n /** Label styles (CSSProperties) */\n labelStyle?: CSSProperties;\n /** Show label bg */\n labelShowBg?: boolean;\n /** Label Bg styles (CSSProperties) */\n labelBgStyle?: CSSProperties;\n /** Label Bg padding */\n labelBgPadding?: [number, number];\n /** Label Bg border radius */\n labelBgBorderRadius?: number;\n}\n\n/**\n * User-facing edge type — reuses `@xyflow/system`'s `EdgeBase` (id, source/target(+handles), type,\n * animated, markers, data, deletable/selectable/selected, hidden, zIndex, ariaLabel, interactionWidth)\n * plus vue-flow-specific fields, mirroring how xyflow/react does `Edge = EdgeBase & EdgeLabelOptions & {…}`.\n */\nexport interface DefaultEdge<Data extends Record<string, unknown> = Record<string, unknown>, Type extends string = string>\n extends EdgeBase<Data, Type>,\n EdgeLabelOptions {\n /** An edge label */\n label?: string | VNode | Component<EdgeTextProps>;\n /** EdgeMarker — vue-flow's `EdgeMarkerType` (own `MarkerType` enum + `EdgeMarker`), overriding `EdgeBase`'s */\n markerStart?: EdgeMarkerType;\n /** EdgeMarker */\n markerEnd?: EdgeMarkerType;\n /** Disable/enable updating edge */\n reconnectable?: EdgeReconnectable;\n /** Disable/enable focusing edge (a11y) */\n focusable?: boolean;\n /** Additional class names */\n class?: ClassValue;\n /** Additional styles */\n style?: Styles;\n /** Overwrites current edge type */\n template?: EdgeComponent;\n /**\n * General escape hatch for adding custom attributes to the edge's DOM element.\n */\n domAttributes?: Omit<\n SVGAttributes,\n | 'id'\n | 'style'\n | 'className'\n | 'role'\n | 'aria-label'\n | 'onClick'\n | 'onMouseenter'\n | 'onMousemove'\n | 'onMouseleave'\n | 'onContextmenu'\n | 'onDblclick'\n | 'onKeyDown'\n >;\n}\n\nexport interface SmoothStepPathOptions {\n offset?: number;\n borderRadius?: number;\n /** where the bend sits along the path: 0 = at source, 1 = at target, 0.5 = midpoint @default 0.5 */\n stepPosition?: number;\n}\n\nexport type SmoothStepEdgeType<Data extends Record<string, unknown> = Record<string, unknown>> = DefaultEdge<Data> & {\n type: 'smoothstep';\n pathOptions?: SmoothStepPathOptions;\n};\n\nexport interface BezierPathOptions {\n curvature?: number;\n}\n\nexport type BezierEdgeType<Data extends Record<string, unknown> = Record<string, unknown>> = DefaultEdge<Data> & {\n type: 'default';\n pathOptions?: BezierPathOptions;\n};\n\nexport type Edge<Data extends Record<string, unknown> = Record<string, unknown>, Type extends string = string>\n = | DefaultEdge<Data, Type>\n | SmoothStepEdgeType<Data>\n | BezierEdgeType<Data>;\n\nexport type DefaultEdgeOptions = Omit<Edge, 'id' | 'source' | 'target' | 'sourceHandle' | 'targetHandle' | 'selected'>;\n\n/**\n * The computed positions an edge renders with — a render-OUTPUT type (xyflow's `EdgePosition`),\n * computed per render from the source/target `InternalNode`s. Never stored on an edge.\n */\nexport interface EdgePositions {\n sourceX: number;\n sourceY: number;\n targetX: number;\n targetY: number;\n}\n\n/**\n * Props passed to edge components. No `sourceNode`/`targetNode` (resolve them with `useInternalNode`);\n * handles are exposed as `sourceHandleId`/`targetHandleId`; markers are pre-resolved to url strings.\n */\nexport interface EdgeProps<EdgeType extends Edge = Edge> extends EdgeLabelOptions, EdgePositions {\n id: string;\n source: string;\n target: string;\n // optional, matching the verbatim model + RF's Pick: defaults are no longer stamped onto stored edges,\n // so `type`/`data` are genuinely undefined at runtime when the user didn't set them\n type?: EdgeType['type'];\n label?: string | VNode | Component<EdgeTextProps> | object;\n style?: CSSProperties;\n selected?: boolean;\n selectable?: boolean;\n deletable?: boolean;\n sourcePosition: Position;\n targetPosition: Position;\n sourceHandleId?: string | null;\n targetHandleId?: string | null;\n animated?: boolean;\n reconnectable?: EdgeReconnectable;\n // optional: an edge without markers has none at runtime, and `EdgeWrapper` passes them through\n // verbatim. Typed as required, a custom edge's `defineProps<EdgeProps>()` generates required runtime\n // props and Vue warns \"Invalid prop 'markerStart' … Expected String, got Undefined\". (Matches `Edge`,\n // `BaseEdgeProps` and xyflow/react, which all have these optional.)\n markerStart?: string;\n markerEnd?: string;\n curvature?: number;\n interactionWidth?: number;\n data?: EdgeType['data'];\n}\n\nexport interface BaseEdgeProps extends EdgeLabelOptions {\n id?: string;\n labelX?: number;\n labelY?: number;\n path: string;\n label?: any;\n markerStart?: string;\n markerEnd?: string;\n interactionWidth?: number;\n}\n\nexport type BezierEdgeProps = EdgePositions\n & BezierPathOptions\n & Omit<BaseEdgeProps, 'labelX' | 'labelY' | 'path'>\n & Pick<EdgeProps, 'sourcePosition' | 'targetPosition'>;\n\nexport type SimpleBezierEdgeProps = EdgePositions\n & Omit<BaseEdgeProps, 'labelX' | 'labelY' | 'path'>\n & Pick<EdgeProps, 'sourcePosition' | 'targetPosition'>;\n\nexport type StraightEdgeProps = EdgePositions & Omit<BaseEdgeProps, 'labelX' | 'labelY' | 'path'>;\n\nexport type StepEdgeProps = EdgePositions\n & Omit<BaseEdgeProps, 'labelX' | 'labelY' | 'path'>\n & Pick<EdgeProps, 'sourcePosition' | 'targetPosition'>;\n\nexport type SmoothStepEdgeProps = EdgePositions\n & Omit<BaseEdgeProps, 'labelX' | 'labelY' | 'path'>\n & Pick<EdgeProps, 'sourcePosition' | 'targetPosition'>\n & SmoothStepPathOptions;\n","<script lang=\"ts\" setup>\nimport type { MarkerProps } from '../../types';\nimport { MarkerType } from '../../types';\n\nconst {\n id,\n type,\n width = 12.5,\n height = 12.5,\n markerUnits = 'strokeWidth',\n orient = 'auto-start-reverse',\n strokeWidth = 1,\n color = 'none',\n} = defineProps<MarkerProps>();\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'MarkerType',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <marker\n :id=\"id\"\n class=\"vue-flow__arrowhead\"\n viewBox=\"-10 -10 20 20\"\n refX=\"0\"\n refY=\"0\"\n :markerWidth=\"`${width}`\"\n :markerHeight=\"`${height}`\"\n :markerUnits=\"markerUnits\"\n :orient=\"orient\"\n >\n <polyline\n v-if=\"type === MarkerType.ArrowClosed\"\n class=\"arrowclosed\"\n :style=\"color ? { stroke: color, fill: color, strokeWidth } : { strokeWidth }\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n points=\"-5,-4 0,0 -5,4 -5,-4\"\n />\n\n <polyline\n v-if=\"type === MarkerType.Arrow\"\n class=\"arrow\"\n :style=\"color ? { stroke: color, strokeWidth } : { strokeWidth }\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n fill=\"none\"\n points=\"-5,-4 0,0 -5,4\"\n />\n </marker>\n</template>\n","<script lang=\"ts\" setup>\nimport type { EdgeMarkerType, MarkerProps, MarkerType } from '../../types';\nimport { getMarkerId } from '@xyflow/system';\nimport { computed } from 'vue';\nimport { storeToRefs, useStore, useVueFlow } from '../../composables';\nimport MarkerSymbols from './MarkerSymbols.vue';\n\nconst { id: vueFlowId } = useVueFlow();\n\nconst { edges, connectionLineOptions, defaultEdgeOptions, defaultMarkerColor: defaultColor } = storeToRefs(useStore());\n\nconst markers = computed(() => {\n const ids: Set<string> = new Set();\n const markers: MarkerProps[] = [];\n\n const createMarkers = (marker?: EdgeMarkerType) => {\n if (marker) {\n const markerId = getMarkerId(marker, vueFlowId);\n\n if (!ids.has(markerId)) {\n if (typeof marker === 'object') {\n markers.push({ ...marker, id: markerId, color: marker.color || defaultColor.value });\n }\n else {\n markers.push({ id: markerId, color: defaultColor.value, type: marker as MarkerType });\n }\n\n ids.add(markerId);\n }\n }\n };\n\n for (const marker of [connectionLineOptions.value.markerEnd, connectionLineOptions.value.markerStart]) {\n createMarkers(marker);\n }\n\n for (const edge of edges.value) {\n // defaults are not stamped onto stored edges — resolve markers through defaultEdgeOptions at read time\n for (const marker of [\n edge.markerStart ?? defaultEdgeOptions.value?.markerStart,\n edge.markerEnd ?? defaultEdgeOptions.value?.markerEnd,\n ]) {\n createMarkers(marker);\n }\n }\n\n return markers.sort((a, b) => a.id.localeCompare(b.id));\n});\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'MarkerDefinitions',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <svg class=\"vue-flow__marker vue-flow__container\" aria-hidden=\"true\">\n <defs>\n <MarkerSymbols\n v-for=\"marker of markers\"\n :id=\"marker.id\"\n :key=\"marker.id\"\n :type=\"marker.type\"\n :color=\"marker.color\"\n :width=\"marker.width\"\n :height=\"marker.height\"\n :markerUnits=\"marker.markerUnits\"\n :stroke-width=\"marker.strokeWidth\"\n :orient=\"marker.orient\"\n />\n </defs>\n </svg>\n</template>\n","<script lang=\"ts\" setup>\nimport { computed } from 'vue';\nimport EdgeWrapper from '../../components/Edges/EdgeWrapper';\nimport { useVueFlow } from '../../composables';\nimport MarkerDefinitions from './MarkerDefinitions.vue';\n\nconst { getEdges } = useVueFlow();\n\n// value-stable id list (see NodeRenderer): keeps this v-for's render effect from re-running on every\n// edge commit — an edge data/selection update then re-renders only that edge's own wrapper, not all of them.\nconst edgeIds = computed<string[]>((prev) => {\n // hot path: reuse `prev` when edge membership is unchanged, allocating nothing. a plain indexed loop\n // avoids the per-element callback of `.every`; the rebuild below only runs on a membership change.\n const edges = getEdges.value;\n const len = edges.length;\n if (prev && prev.length === len) {\n let unchanged = true;\n for (let i = 0; i < len; i++) {\n if (edges[i].id !== prev[i]) {\n unchanged = false;\n break;\n }\n }\n if (unchanged) {\n return prev;\n }\n }\n return edges.map(edge => edge.id);\n});\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'Edges',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <div class=\"vue-flow__edges\">\n <MarkerDefinitions />\n\n <!-- iterate stable ids + v-memo so this v-for only re-runs on edge membership changes; an edge\n data/selection update re-renders just that edge's wrapper, and a node drag never touches it -->\n <EdgeWrapper v-for=\"id of edgeIds\" :id=\"id\" :key=\"id\" v-memo=\"[id]\" />\n </div>\n</template>\n","import type { BuiltInNode, MouseTouchEvent, NodeComponent } from '../../types';\nimport { getNodesInside, nodeHasDimensions } from '@xyflow/system';\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n h,\n inject,\n nextTick,\n onMounted,\n provide,\n resolveComponent,\n shallowRef,\n toRef,\n watch,\n} from 'vue';\nimport {\n isInputDOMNode,\n useDrag,\n useStore,\n useUpdateNodePositions,\n useVueFlow,\n} from '../../composables';\nimport { NodeId, NodeRef, Slots } from '../../context';\nimport { ARIA_NODE_DESC_KEY, arrowKeyDiffs, elementSelectionKeys, ErrorCode, handleNodeClick, VueFlowError } from '../../utils';\n\ninterface Props {\n id: string;\n resizeObserver: ResizeObserver;\n}\n\nconst NodeWrapper = defineComponent({\n name: 'Node',\n compatConfig: { MODE: 3 },\n props: ['id', 'resizeObserver'],\n setup(props: Props) {\n const {\n id: vueFlowId,\n emits,\n getInternalNode,\n removeSelectedNodes,\n addSelectedNodes,\n updateNodeDimensions,\n onUpdateNodeInternals,\n getNodeTypes,\n setCenter,\n } = useVueFlow();\n\n // Read the reactive store directly. Inside computeds/handlers `store.x` already tracks reactively, so\n // there's no need to project the whole state into refs per node (`storeToRefs` allocates a ref for every\n // state key on each call — a real cost when it runs once per node/edge/handle).\n const store = useStore();\n const { parentLookup } = store;\n\n // `nodesSelectionActive` is the one exception: it's handed to `handleNodeClick`, which writes it back,\n // so it needs a writable ref.\n const nodesSelectionActive = toRef(store, 'nodesSelectionActive');\n\n const nodeElement = shallowRef<HTMLDivElement | null>(null);\n provide(NodeRef, nodeElement);\n provide(NodeId, props.id);\n\n const slots = inject(Slots);\n\n const instance = getCurrentInstance();\n\n const updateNodePositions = useUpdateNodePositions();\n\n // `nodeRef` re-resolves to a NEW InternalNode object whenever the store re-adopts this node (immutable\n // model) — that reference swap is what re-renders this wrapper. Resolve it directly rather than through\n // the public `useNode`, which the wrapper would only use for `node` while also allocating unused\n // `parentNode`/`connectedEdges` computeds and a `nodeEl` inject per instance.\n const nodeRef = computed(() => getInternalNode(props.id));\n\n const isDraggable = toRef(() => {\n const node = nodeRef.value;\n return !node || typeof node.draggable === 'undefined' ? store.nodesDraggable : node.draggable;\n });\n\n const isSelectable = toRef(() => {\n const node = nodeRef.value;\n return !node || typeof node.selectable === 'undefined' ? store.elementsSelectable : node.selectable;\n });\n\n const isConnectable = toRef(() => {\n const node = nodeRef.value;\n return !node || typeof node.connectable === 'undefined' ? store.nodesConnectable : node.connectable;\n });\n\n const isFocusable = toRef(() => {\n const node = nodeRef.value;\n return !node || typeof node.focusable === 'undefined' ? store.nodesFocusable : node.focusable;\n });\n\n const hasPointerEvents = computed(\n () =>\n isSelectable.value\n || isDraggable.value\n || store.hooks.nodeClick.hasListeners()\n || store.hooks.nodeDoubleClick.hasListeners()\n || store.hooks.nodeMouseEnter.hasListeners()\n || store.hooks.nodeMouseMove.hasListeners()\n || store.hooks.nodeMouseLeave.hasListeners(),\n );\n\n // a node \"has dimensions\" once it's measured OR carries explicit `width`/`height` OR `initialWidth`/\n // `initialHeight` (the SSR fallback, where there's no ResizeObserver to measure) — mirrors xyflow/react\n // & xyflow/svelte's visibility gate so sized/SSR nodes render immediately instead of staying hidden.\n const isInit = computed(() => (nodeRef.value ? nodeHasDimensions(nodeRef.value) : false));\n\n // computed (not toRef): the value-equality gate keeps this node's render effect from re-running on\n // every `parentLookup` entry replacement — an uncached getter read in render tracks the raw map key\n const isParent = computed(() => (parentLookup.get(props.id)?.size ?? 0) > 0);\n\n const nodeCmp = computed(() => {\n const name = nodeRef.value?.type || 'default';\n\n const slot = slots?.[`node-${name}`];\n if (slot) {\n return slot;\n }\n\n let nodeType = getNodeTypes.value[name];\n\n if (typeof nodeType === 'string') {\n if (instance) {\n const components = Object.keys(instance.appContext.components);\n if (components && components.includes(name)) {\n nodeType = resolveComponent(name, false) as NodeComponent;\n }\n }\n }\n\n if (nodeType && typeof nodeType !== 'string') {\n return nodeType;\n }\n\n emits.error(new VueFlowError(ErrorCode.NODE_TYPE_MISSING, nodeType));\n\n return false;\n });\n\n const dragging = useDrag({\n id: props.id,\n el: nodeElement,\n disabled: () => !isDraggable.value,\n selectable: isSelectable,\n dragHandle: () => nodeRef.value?.dragHandle,\n onStart(event) {\n emits.nodeDragStart(event);\n },\n onDrag(event) {\n emits.nodeDrag(event);\n },\n onStop(event) {\n emits.nodeDragStop(event);\n },\n onClick(event) {\n onSelectNode(event);\n },\n });\n\n const getStyle = computed(() => {\n const node = nodeRef.value;\n // clone: never mutate the user's `node.style` (nodes are markRaw, so an in-place write isn't\n // reactive AND would cache stale width/height onto the user object across renders)\n const styles = { ...node?.style };\n\n // mirror xyflow/react's `getNodeInlineStyleDimensions`: before the node is measured (no handle bounds\n // yet — e.g. first paint / SSR) fall back through `initialWidth`/`initialHeight`; once measured, only\n // an explicit `width`/`height` overrides the natural measured size.\n const isMeasured = !!node?.internals.handleBounds;\n const width = node?.width ?? (isMeasured ? undefined : node?.initialWidth);\n const height = node?.height ?? (isMeasured ? undefined : node?.initialHeight);\n\n if (!styles.width && width != null) {\n styles.width = `${width}px`;\n }\n\n if (!styles.height && height != null) {\n styles.height = `${height}px`;\n }\n\n return styles;\n });\n\n const zIndex = toRef(() => Number(nodeRef.value?.zIndex ?? getStyle.value.zIndex ?? 0));\n\n onUpdateNodeInternals((updateIds) => {\n // when no ids are passed, update all nodes\n if (updateIds.includes(props.id) || !updateIds.length) {\n updateInternals();\n }\n });\n\n onMounted(() => {\n watch(\n () => nodeRef.value?.hidden,\n (isHidden = false, _, onCleanup) => {\n if (!isHidden && nodeElement.value) {\n props.resizeObserver.observe(nodeElement.value);\n\n onCleanup(() => {\n if (nodeElement.value) {\n props.resizeObserver.unobserve(nodeElement.value);\n }\n });\n }\n },\n { immediate: true, flush: 'post' },\n );\n });\n\n watch([() => nodeRef.value?.type, () => nodeRef.value?.sourcePosition, () => nodeRef.value?.targetPosition], () => {\n nextTick(() => {\n updateNodeDimensions([{ id: props.id, nodeElement: nodeElement.value as HTMLDivElement, forceUpdate: true }]);\n });\n });\n\n return () => {\n const node = nodeRef.value;\n\n if (!node || node.hidden) {\n return null;\n }\n\n return h(\n 'div',\n {\n 'ref': nodeElement,\n 'data-id': node.id,\n 'class': [\n 'vue-flow__node',\n `vue-flow__node-${nodeCmp.value === false ? 'default' : node.type || 'default'}`,\n {\n [store.noPanClassName]: isDraggable.value,\n dragging: dragging?.value,\n draggable: isDraggable.value,\n selected: node.selected,\n selectable: isSelectable.value,\n parent: isParent.value,\n },\n node.class,\n ],\n 'style': {\n visibility: isInit.value ? 'visible' : 'hidden',\n zIndex: node.internals.z ?? zIndex.value,\n transform: `translate(${node.internals.positionAbsolute.x}px,${node.internals.positionAbsolute.y}px)`,\n pointerEvents: hasPointerEvents.value ? 'all' : 'none',\n ...getStyle.value,\n },\n 'tabIndex': isFocusable.value ? 0 : undefined,\n 'role': isFocusable.value ? 'group' : undefined,\n 'aria-describedby': store.disableKeyboardA11y ? undefined : `${ARIA_NODE_DESC_KEY}-${vueFlowId}`,\n 'aria-label': node.ariaLabel,\n 'aria-roledescription': 'node',\n ...node.domAttributes,\n 'onMouseenter': onMouseEnter,\n 'onMousemove': onMouseMove,\n 'onMouseleave': onMouseLeave,\n 'onContextmenu': onContextMenu,\n 'onClick': onSelectNode,\n 'onDblclick': onDoubleClick,\n 'onKeydown': onKeyDown,\n 'onFocus': isFocusable.value ? onFocus : undefined,\n },\n [\n h(nodeCmp.value === false ? (getNodeTypes.value.default as NodeComponent<BuiltInNode>) : (nodeCmp.value as any), {\n // exactly the `NodeProps` surface (xyflow/react parity) — no legacy `connectable`/`position`/\n // `dimensions`/`parent`/`parentNodeId`/`resizing` duplicates, which bloated every node's props\n // and leaked onto custom-node DOM as `$attrs`\n id: node.id,\n type: node.type,\n data: node.data,\n selected: !!node.selected,\n dragging: dragging.value,\n isConnectable: isConnectable.value,\n positionAbsoluteX: node.internals.positionAbsolute.x,\n positionAbsoluteY: node.internals.positionAbsolute.y,\n width: node.measured.width,\n height: node.measured.height,\n parentId: node.parentId,\n zIndex: node.internals.z ?? zIndex.value,\n selectable: node.selectable ?? true,\n deletable: node.deletable ?? true,\n draggable: node.draggable ?? true,\n targetPosition: node.targetPosition,\n sourcePosition: node.sourcePosition,\n dragHandle: node.dragHandle,\n onUpdateNodeInternals: updateInternals,\n }),\n ],\n );\n };\n function updateInternals() {\n if (nodeElement.value) {\n updateNodeDimensions([{ id: props.id, nodeElement: nodeElement.value, forceUpdate: true }]);\n }\n }\n\n function onMouseEnter(event: MouseEvent) {\n const node = nodeRef.value;\n if (node && !dragging?.value) {\n emits.nodeMouseEnter({ event, node: node.internals.userNode });\n }\n }\n\n function onMouseMove(event: MouseEvent) {\n const node = nodeRef.value;\n if (node && !dragging?.value) {\n emits.nodeMouseMove({ event, node: node.internals.userNode });\n }\n }\n\n function onMouseLeave(event: MouseEvent) {\n const node = nodeRef.value;\n if (node && !dragging?.value) {\n emits.nodeMouseLeave({ event, node: node.internals.userNode });\n }\n }\n\n function onContextMenu(event: MouseEvent) {\n const node = nodeRef.value;\n if (node) {\n emits.nodeContextMenu({ event, node: node.internals.userNode });\n }\n }\n\n function onDoubleClick(event: MouseEvent) {\n const node = nodeRef.value;\n if (node) {\n emits.nodeDoubleClick({ event, node: node.internals.userNode });\n }\n }\n\n function onSelectNode(event: MouseTouchEvent) {\n const node = nodeRef.value;\n if (!node) {\n return;\n }\n\n if (isSelectable.value && (!store.selectNodesOnDrag || !isDraggable.value || store.nodeDragThreshold > 0)) {\n // handleNodeClick needs the enriched InternalNode; the event payload gets the user node\n handleNodeClick(\n node,\n store.multiSelectionActive,\n addSelectedNodes,\n removeSelectedNodes,\n nodesSelectionActive,\n false,\n nodeElement.value!,\n );\n }\n\n emits.nodeClick({ event, node: node.internals.userNode });\n }\n\n function onKeyDown(event: KeyboardEvent) {\n const node = nodeRef.value;\n if (!node || isInputDOMNode(event) || store.disableKeyboardA11y) {\n return;\n }\n\n if (elementSelectionKeys.includes(event.key) && isSelectable.value) {\n const unselect = event.key === 'Escape';\n\n handleNodeClick(\n node,\n store.multiSelectionActive,\n addSelectedNodes,\n removeSelectedNodes,\n nodesSelectionActive,\n unselect,\n nodeElement.value!,\n );\n }\n else if (isDraggable.value && node.selected && arrowKeyDiffs[event.key]) {\n // prevent page scrolling\n event.preventDefault();\n\n store.ariaLiveMessage = store.ariaLabelConfig['node.a11yDescription.ariaLiveMessage']({\n direction: event.key.replace('Arrow', '').toLowerCase(),\n x: ~~node.position.x,\n y: ~~node.position.y,\n });\n\n updateNodePositions(\n {\n x: arrowKeyDiffs[event.key].x,\n y: arrowKeyDiffs[event.key].y,\n },\n event.shiftKey,\n );\n }\n }\n\n // Pan the viewport to a node that receives KEYBOARD focus (Tab) and isn't currently visible, so\n // tabbing through nodes never lands on an off-screen one. `:focus-visible` keeps this to keyboard\n // focus (not pointer/programmatic).\n function onFocus() {\n const node = nodeRef.value;\n if (!node || store.disableKeyboardA11y || !store.autoPanOnNodeFocus || !nodeElement.value?.matches(':focus-visible')) {\n return;\n }\n\n const withinViewport\n = getNodesInside(\n new Map([[node.id, node]]),\n { x: 0, y: 0, width: store.dimensions.width, height: store.dimensions.height },\n store.transform,\n true,\n ).length > 0;\n\n if (!withinViewport) {\n setCenter(\n node.internals.positionAbsolute.x + (node.measured.width ?? 0) / 2,\n node.internals.positionAbsolute.y + (node.measured.height ?? 0) / 2,\n { zoom: store.transform[2] },\n );\n }\n }\n },\n});\n\nexport default NodeWrapper;\n","<script lang=\"ts\" setup>\nimport type { InternalNode } from '../../types';\nimport { getNodesBounds } from '@xyflow/system';\nimport { computed, onMounted, shallowRef } from 'vue';\nimport { storeToRefs, useDrag, useStore, useUpdateNodePositions, useVueFlow } from '../../composables';\nimport { arrowKeyDiffs } from '../../utils';\n\nconst { emits, viewport, getSelectedNodes } = useVueFlow();\n\nconst { nodeLookup } = useStore();\n\nconst { noPanClassName, disableKeyboardA11y, userSelectionActive } = storeToRefs(useStore());\n\nconst updatePositions = useUpdateNodePositions();\n\nconst el = shallowRef<HTMLDivElement | null>(null);\n\nconst dragging = useDrag({\n el,\n onStart(args) {\n emits.selectionDragStart(args);\n emits.nodeDragStart(args);\n },\n onDrag(args) {\n emits.selectionDrag(args);\n emits.nodeDrag(args);\n },\n onStop(args) {\n emits.selectionDragStop(args);\n emits.nodeDragStop(args);\n },\n});\n\nonMounted(() => {\n if (!disableKeyboardA11y.value) {\n el.value?.focus({ preventScroll: true });\n }\n});\n\n// getSelectedNodes is readonly (public guard); getNodesBounds only reads it (dims come from nodeLookup)\nconst selectedNodesBBox = computed(() => getNodesBounds(getSelectedNodes.value as InternalNode[], { nodeLookup }));\n\nconst innerStyle = computed(() => ({\n width: `${selectedNodesBBox.value.width}px`,\n height: `${selectedNodesBBox.value.height}px`,\n top: `${selectedNodesBBox.value.y}px`,\n left: `${selectedNodesBBox.value.x}px`,\n}));\n\nfunction onContextMenu(event: MouseEvent) {\n emits.selectionContextMenu({ event, nodes: [...getSelectedNodes.value] });\n}\n\nfunction onKeyDown(event: KeyboardEvent) {\n if (disableKeyboardA11y.value) {\n return;\n }\n\n if (arrowKeyDiffs[event.key]) {\n event.preventDefault();\n\n updatePositions(\n {\n x: arrowKeyDiffs[event.key].x,\n y: arrowKeyDiffs[event.key].y,\n },\n event.shiftKey,\n );\n }\n}\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'NodesSelection',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <div\n v-if=\"!userSelectionActive && selectedNodesBBox.width && selectedNodesBBox.height\"\n class=\"vue-flow__nodesselection vue-flow__container\"\n :class=\"noPanClassName\"\n :style=\"{ transform: `translate(${viewport.x}px,${viewport.y}px) scale(${viewport.zoom})` }\"\n >\n <div\n ref=\"el\"\n :class=\"{ dragging }\"\n class=\"vue-flow__nodesselection-rect\"\n :style=\"innerStyle\"\n :tabindex=\"disableKeyboardA11y ? undefined : -1\"\n @contextmenu=\"onContextMenu\"\n @keydown=\"onKeyDown\"\n />\n </div>\n</template>\n","<script lang=\"ts\" setup>\nimport type { SelectionRect } from '@xyflow/system';\n\ndefineProps<{ userSelectionRect: SelectionRect }>();\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'UserSelection',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <div\n class=\"vue-flow__selection vue-flow__container\"\n :style=\"{\n width: `${userSelectionRect.width}px`,\n height: `${userSelectionRect.height}px`,\n transform: `translate(${userSelectionRect.x}px, ${userSelectionRect.y}px)`,\n }\"\n />\n</template>\n","<script lang=\"ts\" setup>\nimport { computed, nextTick, onBeforeUnmount, onMounted, shallowRef, watch } from 'vue';\nimport { NodeWrapper } from '../../components';\nimport { useStore, useVueFlow } from '../../composables';\nimport { useNodesInitialized } from '../../composables/useNodesInitialized';\n\nconst { getNodes, updateNodeDimensions, emits } = useVueFlow();\n\nconst { nodeLookup } = useStore();\n\n// Iterate a value-stable id list so this v-for's render effect only re-runs when node *membership*\n// changes — not on every commit (each position/data update replaces the whole `nodes` array). A moved\n// node still re-renders through its own lookup-backed computed in NodeWrapper; this keeps a single-node\n// drag from re-diffing all N children every frame.\nconst nodeIds = computed<string[]>((prev) => {\n // hot path (every commit): reuse `prev` when membership is unchanged, allocating nothing. a plain\n // indexed loop avoids the per-element callback of `.every` on this O(n)-per-frame comparison; the\n // rebuild below only runs on the rare membership change, so the builtin stays for readability there.\n const nodes = getNodes.value;\n const len = nodes.length;\n if (prev && prev.length === len) {\n let unchanged = true;\n for (let i = 0; i < len; i++) {\n if (nodes[i].id !== prev[i]) {\n unchanged = false;\n break;\n }\n }\n if (unchanged) {\n return prev;\n }\n }\n return nodes.map(node => node.id);\n});\n\nconst nodesInitialized = useNodesInitialized();\n\nconst resizeObserver = shallowRef<ResizeObserver>();\n\nwatch(\n nodesInitialized,\n (isInit) => {\n if (isInit) {\n nextTick(() => {\n emits.nodesInitialized(Array.from(nodeLookup.values(), node => node.internals.userNode));\n });\n }\n },\n { immediate: true },\n);\n\nonMounted(() => {\n resizeObserver.value = new ResizeObserver((entries) => {\n const updates = entries.map((entry) => {\n const id = entry.target.getAttribute('data-id') as string;\n\n return {\n id,\n nodeElement: entry.target as HTMLDivElement,\n forceUpdate: true,\n };\n });\n\n nextTick(() => updateNodeDimensions(updates));\n });\n});\n\nonBeforeUnmount(() => resizeObserver.value?.disconnect());\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'Nodes',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <div class=\"vue-flow__nodes vue-flow__container\">\n <template v-if=\"resizeObserver\">\n <NodeWrapper v-for=\"id of nodeIds\" :id=\"id\" :key=\"id\" v-memo=\"[id]\" :resize-observer=\"resizeObserver\" />\n </template>\n </div>\n</template>\n","<script lang=\"ts\" setup>\nimport type { XYPosition } from '@xyflow/system';\nimport type { EdgeChange, NodeChange } from '../../types';\nimport { areSetsEqual, calcAutoPan, getEventPosition, getNodesInside, pointToRendererPoint, rendererPointToPoint, SelectionMode } from '@xyflow/system';\nimport { onUnmounted, shallowRef, toRef, watch } from 'vue';\nimport NodesSelection from '../../components/NodesSelection/NodesSelection.vue';\nimport UserSelection from '../../components/UserSelection/UserSelection.vue';\nimport { storeToRefs, useKeyPress, useStore, useVueFlow } from '../../composables';\nimport { getSelectionChanges } from '../../utils';\n\nconst { isSelecting, selectionKeyPressed } = defineProps<{ isSelecting: boolean; selectionKeyPressed: boolean }>();\n\nconst { emits, removeSelectedNodes, removeSelectedEdges, resetSelectedElements, getSelectedEdges, getSelectedNodes, deleteElements, panBy } = useVueFlow();\n\nconst { edgeLookup, nodeLookup } = useStore();\n\nconst {\n vueFlowRef,\n transform,\n userSelectionActive,\n userSelectionRect,\n elementsSelectable,\n nodesSelectionActive,\n selectionMode,\n deleteKeyCode,\n multiSelectionKeyCode,\n multiSelectionActive,\n connectionLookup,\n defaultEdgeOptions,\n connectionStartHandle,\n panOnDrag,\n paneClickDistance,\n autoPanOnSelection,\n autoPanSpeed,\n} = storeToRefs(useStore());\n\nconst container = shallowRef<HTMLDivElement | null>(null);\n\nconst selectedNodeIds = shallowRef<Set<string>>(new Set());\n\nconst selectedEdgeIds = shallowRef<Set<string>>(new Set());\n\nconst containerBounds = shallowRef<DOMRect | null>(null);\n\nconst hasActiveSelection = toRef(() => elementsSelectable.value && (isSelecting || userSelectionActive.value));\n\nconst connectionInProgress = toRef(() => connectionStartHandle.value !== null);\n\n// Used to prevent click events when the user lets go of the selectionKey during a selection\nlet selectionInProgress = false;\nlet selectionStarted = false;\n\n// Auto-pan while dragging the selection box near the edges of the container\nlet autoPanId = 0;\nlet autoPanStarted = false;\nlet lastPointerPosition: XYPosition = { x: 0, y: 0 };\n\nconst deleteKeyPressed = useKeyPress(deleteKeyCode, { actInsideInputWithModifier: false });\n\nconst multiSelectKeyPressed = useKeyPress(multiSelectionKeyCode);\n\nwatch(deleteKeyPressed, (isKeyPressed) => {\n if (!isKeyPressed) {\n return;\n }\n\n // routed through `deleteElements` so the `onBeforeDelete` guard (cancel/confirm/filter) is consulted\n deleteElements({\n nodes: [...getSelectedNodes.value],\n edges: [...getSelectedEdges.value],\n });\n\n nodesSelectionActive.value = false;\n});\n\nwatch(multiSelectKeyPressed, (isKeyPressed) => {\n multiSelectionActive.value = isKeyPressed;\n});\n\nonUnmounted(() => {\n cleanupAutoPan();\n});\n\nfunction wrapHandler(handler: Function, containerRef: HTMLDivElement | null) {\n return (event: MouseEvent) => {\n if (event.target !== containerRef) {\n return;\n }\n\n handler?.(event);\n };\n}\n\nfunction onClick(event: MouseEvent) {\n if (selectionInProgress || connectionInProgress.value) {\n selectionInProgress = false;\n return;\n }\n\n emits.paneClick(event);\n\n // clears the selection, but keeps it while `elementsSelectable` is off (xyflow/react #5217)\n resetSelectedElements();\n\n nodesSelectionActive.value = false;\n}\n\nfunction onContextMenu(event: MouseEvent) {\n if (Array.isArray(panOnDrag.value) && panOnDrag.value?.includes(2)) {\n event.preventDefault();\n return;\n }\n\n emits.paneContextMenu(event);\n}\n\nfunction onWheel(event: WheelEvent) {\n emits.paneScroll(event);\n}\n\nfunction onPointerDown(event: PointerEvent) {\n containerBounds.value = vueFlowRef.value?.getBoundingClientRect() ?? null;\n\n if (\n !elementsSelectable.value\n || !isSelecting\n || event.button !== 0\n || event.target !== container.value\n || !containerBounds.value\n ) {\n return;\n }\n\n ;(event.target as Element)?.setPointerCapture?.(event.pointerId);\n\n const { x, y } = getEventPosition(event, containerBounds.value);\n\n selectionStarted = true;\n selectionInProgress = false;\n autoPanStarted = false;\n\n // the selection (resetting the current selection + `selectionStart`) only begins once the pointer moves\n // past the click threshold — see `onPointerMove`. Resetting here would clear the selection on a plain\n // click and open a selection box for it (xyflow/react #5593).\n\n // store the origin in flow coordinates so it stays anchored to the canvas while auto-panning\n const flowStart = pointToRendererPoint({ x, y }, transform.value);\n\n userSelectionRect.value = {\n width: 0,\n height: 0,\n startX: flowStart.x,\n startY: flowStart.y,\n x,\n y,\n };\n}\n\n// Recompute the selection rect (and the selected nodes/edges) from the current pointer position. Called\n// both on pointer move and on every auto-pan frame, so the selection keeps growing while the viewport pans.\nfunction commitUserSelectionRect(mouseX: number, mouseY: number) {\n if (!userSelectionRect.value) {\n return;\n }\n\n // `startX`/`startY` are stored in flow coordinates (so the origin stays put while panning); convert\n // back to screen coordinates to build the rect, which `getNodesInside` and `UserSelection` consume.\n const { startX = 0, startY = 0 } = userSelectionRect.value;\n const screenStart = rendererPointToPoint({ x: startX, y: startY }, transform.value);\n\n const nextUserSelectRect = {\n startX,\n startY,\n x: mouseX < screenStart.x ? mouseX : screenStart.x,\n y: mouseY < screenStart.y ? mouseY : screenStart.y,\n width: Math.abs(mouseX - screenStart.x),\n height: Math.abs(mouseY - screenStart.y),\n };\n\n const prevSelectedNodeIds = selectedNodeIds.value;\n const prevSelectedEdgeIds = selectedEdgeIds.value;\n selectedNodeIds.value = new Set(\n getNodesInside(nodeLookup, nextUserSelectRect, transform.value, selectionMode.value === SelectionMode.Partial, true).map(\n node => node.id,\n ),\n );\n\n selectedEdgeIds.value = new Set();\n // resolution order mirrors EdgeWrapper's isSelectable: edge.selectable ?? defaults ?? global flag\n const edgesSelectable = defaultEdgeOptions.value?.selectable ?? elementsSelectable.value;\n\n // We look for all edges connected to the selected nodes\n for (const nodeId of selectedNodeIds.value) {\n const connections = connectionLookup.value.get(nodeId);\n if (!connections) {\n continue;\n }\n for (const { edgeId } of connections.values()) {\n const edge = edgeLookup.get(edgeId);\n if (edge && (edge.selectable ?? edgesSelectable)) {\n selectedEdgeIds.value.add(edgeId);\n }\n }\n }\n\n if (!areSetsEqual(prevSelectedNodeIds, selectedNodeIds.value)) {\n const changes = getSelectionChanges(nodeLookup, selectedNodeIds.value) as NodeChange[];\n emits.nodesChange(changes);\n }\n\n if (!areSetsEqual(prevSelectedEdgeIds, selectedEdgeIds.value)) {\n const changes = getSelectionChanges(edgeLookup, selectedEdgeIds.value) as EdgeChange[];\n emits.edgesChange(changes);\n }\n\n userSelectionRect.value = nextUserSelectRect;\n userSelectionActive.value = true;\n nodesSelectionActive.value = false;\n}\n\n// rAF loop that pans the viewport while the pointer sits near a container edge during a selection, then\n// re-commits the selection rect from the (unchanged) pointer position so it grows toward the new viewport.\nfunction autoPan() {\n if (!autoPanOnSelection.value || !containerBounds.value) {\n return;\n }\n\n const [xMovement, yMovement] = calcAutoPan(lastPointerPosition, containerBounds.value, autoPanSpeed.value);\n\n panBy({ x: xMovement, y: yMovement }).then((panned) => {\n if (selectionInProgress && panned) {\n commitUserSelectionRect(lastPointerPosition.x, lastPointerPosition.y);\n }\n\n autoPanId = requestAnimationFrame(autoPan);\n });\n}\n\nfunction cleanupAutoPan() {\n cancelAnimationFrame(autoPanId);\n autoPanId = 0;\n autoPanStarted = false;\n}\n\nfunction onPointerMove(event: PointerEvent) {\n if (!containerBounds.value || !userSelectionRect.value) {\n return;\n }\n\n const { x: mouseX, y: mouseY } = getEventPosition(event, containerBounds.value);\n lastPointerPosition = { x: mouseX, y: mouseY };\n\n // begin the selection only once the pointer has moved past the click threshold — so a plain click\n // neither resets the current selection nor opens a selection box (xyflow/react #5593). Holding the\n // selection key starts immediately (`requiredDistance` 0). `startX`/`startY` are flow coords, so compare\n // against the start in screen space.\n if (!selectionInProgress) {\n const screenStart = rendererPointToPoint({ x: userSelectionRect.value.startX, y: userSelectionRect.value.startY }, transform.value);\n const requiredDistance = selectionKeyPressed ? 0 : paneClickDistance.value;\n const distance = Math.hypot(mouseX - screenStart.x, mouseY - screenStart.y);\n\n if (distance <= requiredDistance) {\n return;\n }\n\n removeSelectedNodes();\n removeSelectedEdges();\n emits.selectionStart(event);\n }\n\n selectionInProgress = true;\n\n if (!autoPanStarted) {\n autoPan();\n autoPanStarted = true;\n }\n\n commitUserSelectionRect(mouseX, mouseY);\n}\n\nfunction onPointerUp(event: PointerEvent) {\n if (event.button !== 0 || !selectionStarted) {\n return;\n }\n\n ;(event.target as Element)?.releasePointerCapture(event.pointerId);\n\n // We only want to trigger click functions when in selection mode if\n // the user did not move the mouse.\n if (!userSelectionActive.value && userSelectionRect.value && event.target === container.value) {\n onClick(event);\n }\n\n userSelectionActive.value = false;\n userSelectionRect.value = null;\n\n // only a real selection drag (not a plain click) updates the selection box / emits `selectionEnd`\n // (xyflow/react #5593)\n if (selectionInProgress) {\n nodesSelectionActive.value = selectedNodeIds.value.size > 0;\n emits.selectionEnd(event);\n }\n\n // If the user kept holding the selectionKey during the selection,\n // we need to reset the selectionInProgress, so the next click event is not prevented\n if (selectionKeyPressed) {\n selectionInProgress = false;\n }\n\n selectionStarted = false;\n\n cleanupAutoPan();\n}\n\nfunction onPointerCancel(event: PointerEvent) {\n ;(event.target as Element)?.releasePointerCapture?.(event.pointerId);\n cleanupAutoPan();\n}\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'Pane',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <div\n ref=\"container\"\n class=\"vue-flow__pane vue-flow__container\"\n :class=\"{ selection: isSelecting }\"\n @click=\"(event) => (hasActiveSelection ? undefined : wrapHandler(onClick, container)(event))\"\n @contextmenu=\"wrapHandler(onContextMenu, container)($event)\"\n @wheel.passive=\"wrapHandler(onWheel, container)($event)\"\n @pointerenter=\"(event) => (hasActiveSelection ? undefined : emits.paneMouseEnter(event))\"\n @pointerdown=\"(event) => (hasActiveSelection ? onPointerDown(event) : emits.paneMouseMove(event))\"\n @pointermove=\"(event) => (hasActiveSelection ? onPointerMove(event) : emits.paneMouseMove(event))\"\n @pointerup=\"(event) => (hasActiveSelection ? onPointerUp(event) : undefined)\"\n @pointercancel=\"(event) => (hasActiveSelection ? onPointerCancel(event) : undefined)\"\n @pointerleave=\"emits.paneMouseLeave($event)\"\n >\n <slot />\n <UserSelection v-if=\"userSelectionActive && userSelectionRect\" :user-selection-rect=\"userSelectionRect\" />\n <NodesSelection v-if=\"nodesSelectionActive && getSelectedNodes.length\" />\n </div>\n</template>\n","import { defineComponent, inject } from 'vue';\nimport { Slots } from '../../context';\n\n/**\n * Renders the `zoom-pane` slot from the provided {@link Slots} as its own propless component, so it\n * bails out of Viewport's per-frame (transform) re-renders: the slot is invoked once and rides the CSS\n * transform instead of being rebuilt each pan/zoom frame, and its own reactive updates stay contained\n * here rather than re-rendering Viewport. Same reason the node/edge renderers are child components.\n *\n * @internal\n */\nexport default defineComponent({\n name: 'ZoomPaneSlot',\n compatConfig: { MODE: 3 },\n setup() {\n const slots = inject(Slots);\n\n return () => slots?.['zoom-pane']?.() ?? null;\n },\n});\n","<script lang=\"ts\" setup>\nimport { computed } from 'vue';\nimport { storeToRefs, useStore, useVueFlow } from '../../composables';\nimport ZoomPaneSlot from './ZoomPaneSlot';\n\nconst { viewport } = useVueFlow();\n\nconst { fitViewOnInit, fitViewOnInitDone } = storeToRefs(useStore());\n\nconst isHidden = computed(() => {\n if (fitViewOnInit.value) {\n return !fitViewOnInitDone.value;\n }\n\n return false;\n});\n\nconst transform = computed(() => `translate(${viewport.value.x}px,${viewport.value.y}px) scale(${viewport.value.zoom})`);\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'Viewport',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <div class=\"vue-flow__viewport vue-flow__container\" :style=\"{ transform, opacity: isHidden ? 0 : undefined }\">\n <slot />\n\n <!-- the `zoom-pane` slot belongs in this transformed layer; pulled from the provided `Slots` as a\n propless child so it bails out of this component's per-frame (transform) re-renders -->\n <ZoomPaneSlot />\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { XYPanZoom } from '@xyflow/system';\nimport { onMounted, onUnmounted, toRef, watch } from 'vue';\nimport ConnectionLine from '../../components/ConnectionLine';\nimport { storeToRefs, useKeyPress, useStore, useVueFlow } from '../../composables';\nimport { useFitViewOnInit } from '../../composables/useFitViewOnInit';\nimport { useResizeHandler } from '../../composables/useResizeHandler';\nimport EdgeRenderer from '../EdgeRenderer/EdgeRenderer.vue';\nimport NodeRenderer from '../NodeRenderer/NodeRenderer.vue';\nimport Pane from '../Pane/Pane.vue';\nimport Viewport from '../Viewport/Viewport.vue';\n\nconst { id, emits } = useVueFlow();\n\nconst {\n transform,\n viewportRef: zoomPane,\n panZoom,\n paneDragging,\n userSelectionActive,\n zoomActivationKeyCode,\n minZoom,\n maxZoom,\n translateExtent,\n defaultViewport,\n zoomOnScroll,\n zoomOnPinch,\n panOnScroll,\n panOnScrollSpeed,\n panOnScrollMode,\n zoomOnDoubleClick,\n panOnDrag,\n preventScrolling,\n noPanClassName,\n noWheelClassName,\n panActivationKeyCode,\n selectionKeyCode,\n selectionOnDrag,\n paneClickDistance,\n connectionStartHandle,\n} = storeToRefs(useStore());\n\nconst zoomActivationKeyPressed = useKeyPress(zoomActivationKeyCode);\n\nconst panKeyPressed = useKeyPress(panActivationKeyCode);\n\nconst selectionKeyPressed = useKeyPress(selectionKeyCode);\n\nconst shouldPanOnDrag = toRef(() => !selectionKeyPressed.value && (panKeyPressed.value || panOnDrag.value));\n\nconst shouldPanOnScroll = toRef(() => panKeyPressed.value || panOnScroll.value);\n\n// selection-on-drag is active when the user opted in AND a left-drag wouldn't pan (so it selects instead)\nconst selectionOnDragActive = toRef(() => selectionOnDrag.value === true && shouldPanOnDrag.value !== true);\n\nconst isSelecting = toRef(() => selectionKeyPressed.value || selectionOnDragActive.value);\n\nuseResizeHandler(zoomPane);\n\n// drives the `fitView` prop's initial fit (waits for nodes + re-fits while the container settles)\nuseFitViewOnInit();\n\nonUnmounted(() => panZoom.value?.destroy());\n\nonMounted(() => {\n if (zoomPane.value) {\n const panZoomInstance = XYPanZoom({\n domNode: zoomPane.value,\n minZoom: minZoom.value,\n maxZoom: maxZoom.value,\n translateExtent: translateExtent.value,\n viewport: { x: transform.value[0], y: transform.value[1], zoom: transform.value[2], ...defaultViewport.value },\n onDraggingChange: isDraggingPane => (paneDragging.value = isDraggingPane),\n onPanZoomStart: (event, viewport) => {\n emits.moveStart({ event, viewport });\n emits.viewportChangeStart(viewport);\n },\n // `viewportChange` is emitted once per transform by `onTransformChange` below (which fires for both\n // user gestures and programmatic changes) — emitting it here too would double-fire it every frame.\n onPanZoom: (event, viewport) => {\n emits.move({ event, viewport });\n },\n onPanZoomEnd: (event, viewport) => {\n emits.moveEnd({ event, viewport });\n emits.viewportChangeEnd(viewport);\n },\n });\n\n const initialViewport = panZoomInstance.getViewport();\n transform.value = [initialViewport.x, initialViewport.y, initialViewport.zoom];\n panZoom.value = panZoomInstance;\n\n watch(\n [\n zoomOnScroll,\n zoomOnPinch,\n shouldPanOnScroll,\n panOnScrollSpeed,\n panOnScrollMode,\n zoomOnDoubleClick,\n shouldPanOnDrag,\n zoomActivationKeyPressed,\n preventScrolling,\n noPanClassName,\n userSelectionActive,\n noWheelClassName,\n paneClickDistance,\n selectionOnDragActive,\n connectionStartHandle,\n ],\n () => {\n panZoom.value?.update({\n zoomOnScroll: zoomOnScroll.value,\n zoomOnPinch: zoomOnPinch.value,\n panOnScroll: shouldPanOnScroll.value,\n panOnScrollSpeed: panOnScrollSpeed.value,\n panOnScrollMode: panOnScrollMode.value,\n zoomOnDoubleClick: zoomOnDoubleClick.value,\n panOnDrag: shouldPanOnDrag.value,\n zoomActivationKeyPressed: zoomActivationKeyPressed.value,\n preventScrolling: preventScrolling.value,\n noPanClassName: noPanClassName.value,\n userSelectionActive: userSelectionActive.value,\n noWheelClassName: noWheelClassName.value,\n paneClickDistance: paneClickDistance.value,\n // when selecting on drag, d3-zoom's click distance is set to Infinity so it never swallows the\n // gesture as a click — letting `paneClick` fire (xyflow/react #5572)\n selectionOnDrag: selectionOnDragActive.value,\n onTransformChange: (nextTransform) => {\n emits.viewportChange({ x: nextTransform[0], y: nextTransform[1], zoom: nextTransform[2] });\n transform.value = nextTransform;\n },\n connectionInProgress: !!connectionStartHandle.value,\n lib: 'vue',\n });\n },\n { immediate: true },\n );\n }\n});\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'ZoomPane',\n};\n</script>\n\n<template>\n <div ref=\"zoomPane\" :key=\"`renderer-${id}`\" class=\"vue-flow__renderer vue-flow__container\">\n <Pane\n :is-selecting=\"isSelecting\"\n :selection-key-pressed=\"selectionKeyPressed\"\n :class=\"{ connecting: !!connectionStartHandle, dragging: paneDragging, draggable: shouldPanOnDrag }\"\n >\n <Viewport>\n <EdgeRenderer />\n\n <ConnectionLine />\n\n <div class=\"vue-flow__edgelabel-renderer\" />\n\n <NodeRenderer />\n </Viewport>\n </Pane>\n </div>\n</template>\n","<script lang=\"ts\" setup generic=\"NodeType extends Node = Node, EdgeType extends Edge = Edge\">\nimport type { Viewport } from '@xyflow/system';\nimport type { Ref } from 'vue';\nimport type { Edge, FlowEmits, FlowProps, FlowSlots, Node, VueFlowInstance, VueFlowState } from '../../types';\nimport { inject, onUnmounted, provide } from 'vue';\nimport A11yDescriptions from '../../components/A11y/A11yDescriptions.vue';\nimport { storeToRefs } from '../../composables/storeToRefs';\nimport { useCreateVueFlow } from '../../composables/useCreateVueFlow';\nimport { useOnInitHandler } from '../../composables/useOnInitHandler';\nimport { useSelectionChange } from '../../composables/useSelectionChange';\nimport { useStylesLoadedWarning } from '../../composables/useStylesLoadedWarning';\nimport { useViewportSync } from '../../composables/useViewportSync';\nimport { useWatchProps } from '../../composables/useWatchProps';\nimport { Slots, VueFlow as VueFlowInjectionKey, VueFlowStateKey } from '../../context';\nimport { useHooks } from '../../store/hooks';\nimport ZoomPane from '../ZoomPane/ZoomPane.vue';\n\nconst props = withDefaults(defineProps<FlowProps<NodeType, EdgeType>>(), {\n snapToGrid: undefined,\n onlyRenderVisibleElements: undefined,\n edgesReconnectable: undefined,\n nodesConnectable: undefined,\n nodesDraggable: undefined,\n elementsSelectable: undefined,\n selectNodesOnDrag: undefined,\n preventScrolling: undefined,\n zoomOnScroll: undefined,\n zoomOnPinch: undefined,\n zoomOnDoubleClick: undefined,\n panOnScroll: undefined,\n panOnDrag: undefined,\n autoApplyChanges: undefined,\n forceColorMode: undefined,\n fitView: undefined,\n fitViewOptions: undefined,\n connectOnClick: undefined,\n connectionLineOptions: undefined,\n autoConnect: undefined,\n elevateEdgesOnSelect: undefined,\n elevateNodesOnSelect: undefined,\n disableKeyboardA11y: undefined,\n edgesFocusable: undefined,\n nodesFocusable: undefined,\n autoPanOnConnect: undefined,\n autoPanOnNodeDrag: undefined,\n autoPanOnNodeFocus: undefined,\n autoPanOnSelection: undefined,\n isValidConnection: undefined,\n onBeforeDelete: undefined,\n deleteKeyCode: undefined,\n selectionKeyCode: undefined,\n selectionOnDrag: undefined,\n multiSelectionKeyCode: undefined,\n panActivationKeyCode: undefined,\n zoomActivationKeyCode: undefined,\n});\n\nconst emit = defineEmits<FlowEmits<NodeType, EdgeType>>();\n\nconst slots = defineSlots<FlowSlots<NodeType, EdgeType>>();\n\nconst modelNodes = defineModel<NodeType[]>('nodes');\nconst modelEdges = defineModel<EdgeType[]>('edges');\nconst modelViewport = defineModel<Viewport>('viewport');\n\n// Reuse an ancestor `<VueFlowProvider>`'s store if present; otherwise this `<VueFlow>` owns it —\n// create + provide our own (auto-wrap, like react's `<Wrapper>`). The store is only ever created by a\n// provider boundary; `useVueFlow()`/`useStore()` are pure consumers. A reused store exposes its two\n// views via the same pair of injection keys (instance + state).\nconst injectedInstance = inject(VueFlowInjectionKey, null) as VueFlowInstance<NodeType, EdgeType> | null;\nconst injectedState = inject(VueFlowStateKey, null) as VueFlowState<NodeType, EdgeType> | null;\n\n// This `<VueFlow>` owns its store unless it reuses an ancestor provider's. When it owns the store, the\n// v-model refs back it directly as signals — single source of truth (svelte's `$bindable` proxy), so the\n// store mutating nodes/edges IS the v-model update, no out-sync. When it reuses a provider's store, the\n// model refs can't back the already-created store, so `useWatchProps` syncs them instead (rebinding a\n// reused store to the hosting `<VueFlow>`'s models is deferred to the multi-instance guard work).\nconst ownsStore = !injectedInstance;\n\nconst { instance, state } =\n injectedInstance && injectedState\n ? { instance: injectedInstance, state: injectedState }\n : useCreateVueFlow<NodeType, EdgeType>(props, {\n nodes: modelNodes as unknown as Ref<NodeType[]>,\n edges: modelEdges as unknown as Ref<EdgeType[]>,\n });\n\n// when reusing a provider's store, apply this `<VueFlow>`'s props to it\nif (!ownsStore) {\n instance.setState(props as Parameters<typeof instance.setState>[0]);\n}\n\n// watch props and update store state (nodes/edges are signal-backed when we own the store — see above)\nconst disposeWatchers = useWatchProps({ nodes: modelNodes, edges: modelEdges }, props, { instance, state }, ownsStore);\n\nuseHooks(emit, state.hooks);\n\nuseOnInitHandler(instance);\n\nuseSelectionChange(instance);\n\nuseStylesLoadedWarning(instance);\n\nuseViewportSync(modelViewport, state);\n\n// the container element ref needs the writable ref (not the unwrapped value) so Vue can assign it;\n// access it by member (`stateRefs.vueFlowRef`) so the template `:ref` binding doesn't auto-unwrap it\nconst stateRefs = storeToRefs(state);\n\n// slots will be passed via provide\n// this is to avoid having to pass them down through all the components\n// as that would require a lot of boilerplate and causes significant performance drops\nprovide(Slots, slots as unknown as FlowSlots);\n\nonUnmounted(disposeWatchers);\n\ndefineExpose<VueFlowInstance<NodeType, EdgeType>>(instance);\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'VueFlow',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <div :ref=\"stateRefs.vueFlowRef\" class=\"vue-flow\" :class=\"props.forceColorMode\">\n <!-- the `zoom-pane` slot (affected by zooming & panning) renders inside the transformed Viewport via\n the provided `Slots` (see ZoomPaneSlot), not drilled through ZoomPane → Pane → Viewport -->\n <ZoomPane />\n\n <!-- This slot is _not_ affected by zooming & panning -->\n <slot />\n\n <A11yDescriptions />\n </div>\n</template>\n","<script lang=\"ts\" setup>\nimport { useCreateVueFlow } from '../../composables/useCreateVueFlow';\n\n/**\n * Owns a VueFlow store and `provide`s it to its subtree. A descendant `<VueFlow>` reuses this\n * provided store instead of creating its own, and any component that calls `useVueFlow()` below this\n * point resolves the same store via `inject` — the way to share one store across sibling components\n * (mirrors `<ReactFlowProvider>` / `<SvelteFlowProvider>`). One provider scopes one store, so host a\n * single `<VueFlow>` per provider and use a separate provider for each independent flow.\n */\nconst props = defineProps<{ id?: string }>();\n\nuseCreateVueFlow({ id: props.id });\n</script>\n\n<script lang=\"ts\">\nexport default {\n name: 'VueFlowProvider',\n compatConfig: { MODE: 3 },\n};\n</script>\n\n<template>\n <slot />\n</template>\n"],"mappings":";;;;;;AAIA,MAAa,UAAyC,OAAO,SAAS;;AAEtE,MAAa,kBAA8C,OAAO,cAAc;AAChF,MAAa,SAA+B,OAAO,QAAQ;AAC3D,MAAa,UAA2D,OAAO,SAAS;AACxF,MAAa,SAA+B,OAAO,QAAQ;AAC3D,MAAa,UAAuD,OAAO,SAAS;AACpF,MAAaA,UAA2C,OAAO,OAAO;;;ACXtE,IAAY,YAAL,yBAAA,WAAA;CACL,UAAA,oBAAA;CACA,UAAA,iCAAA;CACA,UAAA,kBAAA;CACA,UAAA,oBAAA;CACA,UAAA,yBAAA;CACA,UAAA,uBAAA;CACA,UAAA,yBAAA;CACA,UAAA,kBAAA;CACA,UAAA,oBAAA;CACA,UAAA,yBAAA;CACA,UAAA,yBAAA;CACA,UAAA,uBAAA;CACA,UAAA,gCAAA;CAEA,UAAA,mCAAA;;AACF,EAAA,CAAA,CAAA;AAEA,MAAM,WAAW;2BAEb;wCAC6C;oBACpB,OAAgB,6BAA6B;sBAC3C,OAAsB,4BAA4B;2BAC7C,IAAY,aAC5C,sCAAsC,GAAG,eAAe;yBAC1B,SAAiB,+BAA+B;2BAC9C,OAAe,sDAAsD;oBAC5E,OAAe,iDAAiD;2BACzD,IAAY,WAC5C,oCAAoC,GAAG,gBAAgB;2BACvB,IAAY,WAC5C,oCAAoC,GAAG,gBAAgB;yBACzB,SAAiB,+BAA+B;kCACvC,IAAY,QAAgB,WACnE,8CAA8C,GAAG,gBAAgB,OAAO,gBAAgB;sBAC7D,OAAe,4BAA4B;0CAEtE;AACJ;AAMA,IAAa,eAAb,cAA6G,MAAM;CAKjH,YAAY,MAAS,GAAG,MAAY;EAElC,MAAM,SAAS,QAAQ,GAAG,IAAI,CAAC;EANjC,KAAA,O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