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KACtCt4C,EAAIg5C,EAAYh5C,EAChBC,EAAI+4C,EAAY/4C,EAChBC,EAAO84C,EAAY94C,KACnBq4C,EAAqBS,EAAYT,mBAKrC,KAFoC,kBAAdI,EAA0BA,EAA2B,IAAfr5C,EAAMmG,OAAyE,QAAzDizC,EAAwBp5C,EAAMiX,SAASte,OAAOT,aAA6C,IAA1BkhD,OAAmC,EAASA,EAAsBv6C,WAAoC,IAAvBo6C,KAEhNj5C,EAAMmG,KACtB,OAAO,KAGT,IAAIwP,GAAW,QAAuB3V,GAClC25C,EAAa7iD,MAAMY,KAAKsI,EAAMiX,UAC9BgZ,EAASvQ,KAAKqmB,IAAInsC,MAAM8lB,MAAM,OAAmBi6B,EAAWl6C,KAAI,SAAUb,GAC5E,OAAOA,EAAKE,UAAUoxB,EAAI,OAGxByX,EAAe9tC,EAAc,CAC/B4B,SAAU,WACV8R,WAAW,QAAwBoI,EAAU,CAC3CjV,EAAGA,EACHC,EAAGA,EACHC,KAAMA,GACLnF,EAAUy9B,EAAQugB,GACrBxpB,OAAQA,GACP30B,GAEH,OAAO,IAAAmB,KAAI+7C,GAAmB,CAC5B57C,UAAU,IAAAH,KAAI,MAAO5C,EAAcA,EAAc,CAC/CyB,MAAOqsC,EACPlqC,WAAW,OAAG,CAAC,2BAA4BA,KAC1CC,GAAO,GAAI,CACZ,UAAWi8C,EAAWv1C,QAAO,SAAUw1C,EAAKh7C,GAC1C,MAAO,GAAGjC,OAAOi9C,GAAKj9C,OAAOiC,EAAKlC,GAAI,OACrC,IAAIm9C,OACPj9C,SAAUA","sources":["webpack://gatsby-starter-typescript-plus/./node_modules/@xyflow/react/dist/esm/index.js"],"sourcesContent":["\"use client\";\n\nimport _asyncToGenerator from \"/home/vsts/work/1/s/node_modules/babel-preset-gatsby/node_modules/@babel/runtime/helpers/esm/asyncToGenerator\";\nimport _slicedToArray from \"/home/vsts/work/1/s/node_modules/babel-preset-gatsby/node_modules/@babel/runtime/helpers/esm/slicedToArray\";\nimport _toConsumableArray from \"/home/vsts/work/1/s/node_modules/babel-preset-gatsby/node_modules/@babel/runtime/helpers/esm/toConsumableArray\";\nimport _defineProperty from \"/home/vsts/work/1/s/node_modules/babel-preset-gatsby/node_modules/@babel/runtime/helpers/esm/defineProperty\";\nimport _objectWithoutProperties from \"/home/vsts/work/1/s/node_modules/babel-preset-gatsby/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties\";\n\nvar _MarkerSymbols, _defaultSize;\n\nvar _excluded = [\"position\", \"children\", \"className\", \"style\"],\n _excluded2 = [\"type\", \"position\", \"isValidConnection\", \"isConnectable\", \"isConnectableStart\", \"isConnectableEnd\", \"id\", \"onConnect\", \"children\", \"className\", \"onMouseDown\", \"onTouchStart\"],\n _excluded3 = [\"x\", \"y\", \"label\", \"labelStyle\", \"labelShowBg\", \"labelBgStyle\", \"labelBgPadding\", \"labelBgBorderRadius\", \"children\", \"className\"],\n _excluded4 = [\"path\", \"labelX\", \"labelY\", \"label\", \"labelStyle\", \"labelShowBg\", \"labelBgStyle\", \"labelBgPadding\", \"labelBgBorderRadius\", \"interactionWidth\"],\n _excluded5 = [\"id\"],\n _excluded6 = [\"nodes\", \"edges\", \"defaultNodes\", \"defaultEdges\", \"className\", \"nodeTypes\", \"edgeTypes\", \"onNodeClick\", \"onEdgeClick\", \"onInit\", \"onMove\", \"onMoveStart\", \"onMoveEnd\", \"onConnect\", \"onConnectStart\", \"onConnectEnd\", \"onClickConnectStart\", \"onClickConnectEnd\", \"onNodeMouseEnter\", \"onNodeMouseMove\", \"onNodeMouseLeave\", \"onNodeContextMenu\", \"onNodeDoubleClick\", \"onNodeDragStart\", \"onNodeDrag\", \"onNodeDragStop\", \"onNodesDelete\", \"onEdgesDelete\", \"onDelete\", \"onSelectionChange\", \"onSelectionDragStart\", \"onSelectionDrag\", \"onSelectionDragStop\", \"onSelectionContextMenu\", \"onSelectionStart\", \"onSelectionEnd\", \"onBeforeDelete\", \"connectionMode\", \"connectionLineType\", \"connectionLineStyle\", \"connectionLineComponent\", \"connectionLineContainerStyle\", \"deleteKeyCode\", \"selectionKeyCode\", \"selectionOnDrag\", \"selectionMode\", \"panActivationKeyCode\", \"multiSelectionKeyCode\", \"zoomActivationKeyCode\", \"snapToGrid\", \"snapGrid\", \"onlyRenderVisibleElements\", \"selectNodesOnDrag\", \"nodesDraggable\", \"nodesConnectable\", \"nodesFocusable\", \"nodeOrigin\", \"edgesFocusable\", \"edgesReconnectable\", \"elementsSelectable\", \"defaultViewport\", \"minZoom\", \"maxZoom\", \"translateExtent\", \"preventScrolling\", \"nodeExtent\", \"defaultMarkerColor\", \"zoomOnScroll\", \"zoomOnPinch\", \"panOnScroll\", \"panOnScrollSpeed\", \"panOnScrollMode\", \"zoomOnDoubleClick\", \"panOnDrag\", \"onPaneClick\", \"onPaneMouseEnter\", \"onPaneMouseMove\", \"onPaneMouseLeave\", \"onPaneScroll\", \"onPaneContextMenu\", \"paneClickDistance\", \"nodeClickDistance\", \"children\", \"onReconnect\", \"onReconnectStart\", \"onReconnectEnd\", \"onEdgeContextMenu\", \"onEdgeDoubleClick\", \"onEdgeMouseEnter\", \"onEdgeMouseMove\", \"onEdgeMouseLeave\", \"reconnectRadius\", \"onNodesChange\", \"onEdgesChange\", \"noDragClassName\", \"noWheelClassName\", \"noPanClassName\", \"fitView\", \"fitViewOptions\", \"connectOnClick\", \"attributionPosition\", \"proOptions\", \"defaultEdgeOptions\", \"elevateNodesOnSelect\", \"elevateEdgesOnSelect\", \"disableKeyboardA11y\", \"autoPanOnConnect\", \"autoPanOnNodeDrag\", \"autoPanSpeed\", \"connectionRadius\", \"isValidConnection\", \"onError\", \"style\", \"id\", \"nodeDragThreshold\", \"viewport\", \"onViewportChange\", \"width\", \"height\", \"colorMode\", \"debug\", \"onScroll\"],\n _excluded7 = [\"children\", \"className\"],\n _excluded8 = [\"nodeId\", \"children\", \"className\", \"style\", \"isVisible\", \"position\", \"offset\", \"align\"];\nimport _regeneratorRuntime from \"/home/vsts/work/1/s/node_modules/babel-preset-gatsby/node_modules/@babel/runtime/regenerator\";\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nimport { jsxs, Fragment, jsx } from 'react/jsx-runtime';\nimport { createContext, useContext, useMemo, forwardRef, useEffect, useRef, useState, useLayoutEffect, useCallback, memo } from 'react';\nimport cc from 'classcat';\nimport { errorMessages, infiniteExtent, isInputDOMNode, getViewportForBounds, pointToRendererPoint, rendererPointToPoint, isNodeBase, isEdgeBase, getElementsToRemove, isRectObject, nodeToRect, getOverlappingArea, getNodesBounds as _getNodesBounds, evaluateAbsolutePosition, getDimensions, XYPanZoom, PanOnScrollMode, SelectionMode, getEventPosition, getNodesInside, areSetsEqual, XYDrag, snapPosition, calculateNodePosition, Position, ConnectionMode, isMouseEvent, XYHandle, getHostForElement, addEdge, getInternalNodesBounds, isNumeric, nodeHasDimensions, getNodeDimensions, elementSelectionKeys, isEdgeVisible, MarkerType, createMarkerIds, getBezierEdgeCenter, getSmoothStepPath, getStraightPath, getBezierPath, getEdgePosition, getElevatedEdgeZIndex, getMarkerId, getConnectionStatus, ConnectionLineType, updateConnectionLookup, adoptUserNodes, initialConnection, devWarn, updateNodeInternals as _updateNodeInternals, updateAbsolutePositions, handleExpandParent, panBy as _panBy, fitViewport, isMacOs, areConnectionMapsEqual, handleConnectionChange, shallowNodeData, XYMinimap, getBoundsOfRects, ResizeControlVariant, XYResizer, XY_RESIZER_LINE_POSITIONS, XY_RESIZER_HANDLE_POSITIONS, getNodeToolbarTransform } from '@xyflow/system';\nexport { ConnectionLineType, ConnectionMode, MarkerType, PanOnScrollMode, Position, ResizeControlVariant, SelectionMode, addEdge, getBezierEdgeCenter, getBezierPath, getConnectedEdges, getEdgeCenter, getIncomers, getNodesBounds, getOutgoers, getSmoothStepPath, getStraightPath, getViewportForBounds, reconnectEdge } from '@xyflow/system';\nimport { useStoreWithEqualityFn, createWithEqualityFn } from 'zustand/traditional';\nimport { shallow } from 'zustand/shallow';\nimport { createPortal } from 'react-dom';\nvar StoreContext = createContext(null);\nvar Provider$1 = StoreContext.Provider;\nvar zustandErrorMessage = errorMessages['error001']();\n/**\n * This hook can be used to subscribe to internal state changes of the React Flow\n * component. The `useStore` hook is re-exported from the [Zustand](https://github.com/pmndrs/zustand)\n * state management library, so you should check out their docs for more details.\n *\n * @public\n * @param selector\n * @param equalityFn\n * @returns The selected state slice\n *\n * @example\n * ```ts\n * const nodes = useStore((state) => state.nodes);\n * ```\n *\n * @remarks This hook should only be used if there is no other way to access the internal\n * state. For many of the common use cases, there are dedicated hooks available\n * such as {@link useReactFlow}, {@link useViewport}, etc.\n */\n\nfunction useStore(selector, equalityFn) {\n var store = useContext(StoreContext);\n\n if (store === null) {\n throw new Error(zustandErrorMessage);\n }\n\n return useStoreWithEqualityFn(store, selector, equalityFn);\n}\n/**\n * In some cases, you might need to access the store directly. This hook returns the store object which can be used on demand to access the state or dispatch actions.\n *\n * @returns The store object\n *\n * @example\n * ```ts\n * const store = useStoreApi();\n * ```\n *\n * @remarks This hook should only be used if there is no other way to access the internal\n * state. For many of the common use cases, there are dedicated hooks available\n * such as {@link useReactFlow}, {@link useViewport}, etc.\n */\n\n\nfunction useStoreApi() {\n var store = useContext(StoreContext);\n\n if (store === null) {\n throw new Error(zustandErrorMessage);\n }\n\n return useMemo(function () {\n return {\n getState: store.getState,\n setState: store.setState,\n subscribe: store.subscribe\n };\n }, [store]);\n}\n\nvar style = {\n display: 'none'\n};\nvar ariaLiveStyle = {\n position: 'absolute',\n width: 1,\n height: 1,\n margin: -1,\n border: 0,\n padding: 0,\n overflow: 'hidden',\n clip: 'rect(0px, 0px, 0px, 0px)',\n clipPath: 'inset(100%)'\n};\nvar ARIA_NODE_DESC_KEY = 'react-flow__node-desc';\nvar ARIA_EDGE_DESC_KEY = 'react-flow__edge-desc';\nvar ARIA_LIVE_MESSAGE = 'react-flow__aria-live';\n\nvar selector$o = function selector$o(s) {\n return s.ariaLiveMessage;\n};\n\nfunction AriaLiveMessage(_ref) {\n var rfId = _ref.rfId;\n var ariaLiveMessage = useStore(selector$o);\n return jsx(\"div\", {\n id: \"\".concat(ARIA_LIVE_MESSAGE, \"-\").concat(rfId),\n \"aria-live\": \"assertive\",\n \"aria-atomic\": \"true\",\n style: ariaLiveStyle,\n children: ariaLiveMessage\n });\n}\n\nfunction A11yDescriptions(_ref2) {\n var rfId = _ref2.rfId,\n disableKeyboardA11y = _ref2.disableKeyboardA11y;\n return jsxs(Fragment, {\n children: [jsxs(\"div\", {\n id: \"\".concat(ARIA_NODE_DESC_KEY, \"-\").concat(rfId),\n style: style,\n children: [\"Press enter or space to select a node.\", !disableKeyboardA11y && 'You can then use the arrow keys to move the node around.', \" Press delete to remove it and escape to cancel.\", ' ']\n }), jsx(\"div\", {\n id: \"\".concat(ARIA_EDGE_DESC_KEY, \"-\").concat(rfId),\n style: style,\n children: \"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.\"\n }), !disableKeyboardA11y && jsx(AriaLiveMessage, {\n rfId: rfId\n })]\n });\n}\n\nvar selector$n = function selector$n(s) {\n return s.userSelectionActive ? 'none' : 'all';\n};\n/**\n * The `` component helps you position content above the viewport.\n * It is used internally by the [``](/api-reference/components/minimap)\n * and [``](/api-reference/components/controls) components.\n *\n * @public\n *\n * @example\n * ```jsx\n *import { ReactFlow, Background, Panel } from '@xyflow/react';\n *\n *export default function Flow() {\n * return (\n * \n * top-left\n * top-center\n * top-right\n * bottom-left\n * bottom-center\n * bottom-right\n * \n * );\n *}\n *```\n */\n\n\nvar Panel = forwardRef(function (_ref3, ref) {\n var _ref3$position = _ref3.position,\n position = _ref3$position === void 0 ? 'top-left' : _ref3$position,\n children = _ref3.children,\n className = _ref3.className,\n style = _ref3.style,\n rest = _objectWithoutProperties(_ref3, _excluded);\n\n var pointerEvents = useStore(selector$n);\n var positionClasses = \"\".concat(position).split('-');\n return jsx(\"div\", _objectSpread(_objectSpread({\n className: cc(['react-flow__panel', className].concat(_toConsumableArray(positionClasses))),\n style: _objectSpread(_objectSpread({}, style), {}, {\n pointerEvents: pointerEvents\n }),\n ref: ref\n }, rest), {}, {\n children: children\n }));\n});\nPanel.displayName = 'Panel';\n\nfunction Attribution(_ref4) {\n var proOptions = _ref4.proOptions,\n _ref4$position = _ref4.position,\n position = _ref4$position === void 0 ? 'bottom-right' : _ref4$position;\n\n if (proOptions !== null && proOptions !== void 0 && proOptions.hideAttribution) {\n return null;\n }\n\n return jsx(Panel, {\n position: position,\n className: \"react-flow__attribution\",\n \"data-message\": \"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev\",\n children: jsx(\"a\", {\n href: \"https://reactflow.dev\",\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n \"aria-label\": \"React Flow attribution\",\n children: \"React Flow\"\n })\n });\n}\n\nvar selector$m = function selector$m(s) {\n var selectedNodes = [];\n var selectedEdges = [];\n\n var _iterator = _createForOfIteratorHelper(s.nodeLookup),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _step$value = _slicedToArray(_step.value, 2),\n node = _step$value[1];\n\n if (node.selected) {\n selectedNodes.push(node.internals.userNode);\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n var _iterator2 = _createForOfIteratorHelper(s.edgeLookup),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var _step2$value = _slicedToArray(_step2.value, 2),\n edge = _step2$value[1];\n\n if (edge.selected) {\n selectedEdges.push(edge);\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n return {\n selectedNodes: selectedNodes,\n selectedEdges: selectedEdges\n };\n};\n\nvar selectId = function selectId(obj) {\n return obj.id;\n};\n\nfunction areEqual(a, b) {\n return shallow(a.selectedNodes.map(selectId), b.selectedNodes.map(selectId)) && shallow(a.selectedEdges.map(selectId), b.selectedEdges.map(selectId));\n}\n\nfunction SelectionListenerInner(_ref5) {\n var onSelectionChange = _ref5.onSelectionChange;\n var store = useStoreApi();\n\n var _useStore = useStore(selector$m, areEqual),\n selectedNodes = _useStore.selectedNodes,\n selectedEdges = _useStore.selectedEdges;\n\n useEffect(function () {\n var params = {\n nodes: selectedNodes,\n edges: selectedEdges\n };\n onSelectionChange === null || onSelectionChange === void 0 ? void 0 : onSelectionChange(params);\n store.getState().onSelectionChangeHandlers.forEach(function (fn) {\n return fn(params);\n });\n }, [selectedNodes, selectedEdges, onSelectionChange]);\n return null;\n}\n\nvar changeSelector = function changeSelector(s) {\n return !!s.onSelectionChangeHandlers;\n};\n\nfunction SelectionListener(_ref6) {\n var onSelectionChange = _ref6.onSelectionChange;\n var storeHasSelectionChangeHandlers = useStore(changeSelector);\n\n if (onSelectionChange || storeHasSelectionChangeHandlers) {\n return jsx(SelectionListenerInner, {\n onSelectionChange: onSelectionChange\n });\n }\n\n return null;\n}\n\nvar defaultNodeOrigin = [0, 0];\nvar defaultViewport = {\n x: 0,\n y: 0,\n zoom: 1\n};\n/*\n * This component helps us to update the store with the values coming from the user.\n * We distinguish between values we can update directly with `useDirectStoreUpdater` (like `snapGrid`)\n * and values that have a dedicated setter function in the store (like `setNodes`).\n */\n// these fields exist in the global store and we need to keep them up to date\n\nvar reactFlowFieldsToTrack = ['nodes', 'edges', 'defaultNodes', 'defaultEdges', 'onConnect', 'onConnectStart', 'onConnectEnd', 'onClickConnectStart', 'onClickConnectEnd', 'nodesDraggable', 'nodesConnectable', 'nodesFocusable', 'edgesFocusable', 'edgesReconnectable', 'elevateNodesOnSelect', 'elevateEdgesOnSelect', 'minZoom', 'maxZoom', 'nodeExtent', 'onNodesChange', 'onEdgesChange', 'elementsSelectable', 'connectionMode', 'snapGrid', 'snapToGrid', 'translateExtent', 'connectOnClick', 'defaultEdgeOptions', 'fitView', 'fitViewOptions', 'onNodesDelete', 'onEdgesDelete', 'onDelete', 'onNodeDrag', 'onNodeDragStart', 'onNodeDragStop', 'onSelectionDrag', 'onSelectionDragStart', 'onSelectionDragStop', 'onMoveStart', 'onMove', 'onMoveEnd', 'noPanClassName', 'nodeOrigin', 'autoPanOnConnect', 'autoPanOnNodeDrag', 'onError', 'connectionRadius', 'isValidConnection', 'selectNodesOnDrag', 'nodeDragThreshold', 'onBeforeDelete', 'debug', 'autoPanSpeed', 'paneClickDistance']; // rfId doesn't exist in ReactFlowProps, but it's one of the fields we want to update\n\nvar fieldsToTrack = [].concat(reactFlowFieldsToTrack, ['rfId']);\n\nvar selector$l = function selector$l(s) {\n return {\n setNodes: s.setNodes,\n setEdges: s.setEdges,\n setMinZoom: s.setMinZoom,\n setMaxZoom: s.setMaxZoom,\n setTranslateExtent: s.setTranslateExtent,\n setNodeExtent: s.setNodeExtent,\n reset: s.reset,\n setDefaultNodesAndEdges: s.setDefaultNodesAndEdges,\n setPaneClickDistance: s.setPaneClickDistance\n };\n};\n\nvar initPrevValues = {\n /*\n * these are values that are also passed directly to other components\n * than the StoreUpdater. We can reduce the number of setStore calls\n * by setting the same values here as prev fields.\n */\n translateExtent: infiniteExtent,\n nodeOrigin: defaultNodeOrigin,\n minZoom: 0.5,\n maxZoom: 2,\n elementsSelectable: true,\n noPanClassName: 'nopan',\n rfId: '1',\n paneClickDistance: 0\n};\n\nfunction StoreUpdater(props) {\n var _useStore2 = useStore(selector$l, shallow),\n setNodes = _useStore2.setNodes,\n setEdges = _useStore2.setEdges,\n setMinZoom = _useStore2.setMinZoom,\n setMaxZoom = _useStore2.setMaxZoom,\n setTranslateExtent = _useStore2.setTranslateExtent,\n setNodeExtent = _useStore2.setNodeExtent,\n reset = _useStore2.reset,\n setDefaultNodesAndEdges = _useStore2.setDefaultNodesAndEdges,\n setPaneClickDistance = _useStore2.setPaneClickDistance;\n\n var store = useStoreApi();\n useEffect(function () {\n setDefaultNodesAndEdges(props.defaultNodes, props.defaultEdges);\n return function () {\n // when we reset the store we also need to reset the previous fields\n previousFields.current = initPrevValues;\n reset();\n };\n }, []);\n var previousFields = useRef(initPrevValues);\n useEffect(function () {\n var _iterator3 = _createForOfIteratorHelper(fieldsToTrack),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var fieldName = _step3.value;\n var fieldValue = props[fieldName];\n var previousFieldValue = previousFields.current[fieldName];\n if (fieldValue === previousFieldValue) continue;\n if (typeof props[fieldName] === 'undefined') continue; // Custom handling with dedicated setters for some fields\n\n if (fieldName === 'nodes') setNodes(fieldValue);else if (fieldName === 'edges') setEdges(fieldValue);else if (fieldName === 'minZoom') setMinZoom(fieldValue);else if (fieldName === 'maxZoom') setMaxZoom(fieldValue);else if (fieldName === 'translateExtent') setTranslateExtent(fieldValue);else if (fieldName === 'nodeExtent') setNodeExtent(fieldValue);else if (fieldName === 'paneClickDistance') setPaneClickDistance(fieldValue); // Renamed fields\n else if (fieldName === 'fitView') store.setState({\n fitViewQueued: fieldValue\n });else if (fieldName === 'fitViewOptions') store.setState({\n fitViewOptions: fieldValue\n }); // General case\n else store.setState(_defineProperty({}, fieldName, fieldValue));\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n\n previousFields.current = props;\n }, // Only re-run the effect if one of the fields we track changes\n fieldsToTrack.map(function (fieldName) {\n return props[fieldName];\n }));\n return null;\n}\n\nfunction getMediaQuery() {\n if (typeof window === 'undefined' || !window.matchMedia) {\n return null;\n }\n\n return window.matchMedia('(prefers-color-scheme: dark)');\n}\n/**\n * Hook for receiving the current color mode class 'dark' or 'light'.\n *\n * @internal\n * @param colorMode - The color mode to use ('dark', 'light' or 'system')\n */\n\n\nfunction useColorModeClass(colorMode) {\n var _getMediaQuery;\n\n var _useState = useState(colorMode === 'system' ? null : colorMode),\n _useState2 = _slicedToArray(_useState, 2),\n colorModeClass = _useState2[0],\n setColorModeClass = _useState2[1];\n\n useEffect(function () {\n if (colorMode !== 'system') {\n setColorModeClass(colorMode);\n return;\n }\n\n var mediaQuery = getMediaQuery();\n\n var updateColorModeClass = function updateColorModeClass() {\n return setColorModeClass(mediaQuery !== null && mediaQuery !== void 0 && mediaQuery.matches ? 'dark' : 'light');\n };\n\n updateColorModeClass();\n mediaQuery === null || mediaQuery === void 0 ? void 0 : mediaQuery.addEventListener('change', updateColorModeClass);\n return function () {\n mediaQuery === null || mediaQuery === void 0 ? void 0 : mediaQuery.removeEventListener('change', updateColorModeClass);\n };\n }, [colorMode]);\n return colorModeClass !== null ? colorModeClass : (_getMediaQuery = getMediaQuery()) !== null && _getMediaQuery !== void 0 && _getMediaQuery.matches ? 'dark' : 'light';\n}\n\nvar defaultDoc = typeof document !== 'undefined' ? document : null;\n/**\n * This hook lets you listen for specific key codes and tells you whether they are\n * currently pressed or not.\n *\n * @public\n * @param param.keyCode - The key code (string or array of strings) to use\n * @param param.options - Options\n * @returns boolean\n *\n * @example\n * ```tsx\n *import { useKeyPress } from '@xyflow/react';\n *\n *export default function () {\n * const spacePressed = useKeyPress('Space');\n * const cmdAndSPressed = useKeyPress(['Meta+s', 'Strg+s']);\n *\n * return (\n *
\n * {spacePressed &&

Space pressed!

}\n * {cmdAndSPressed &&

Cmd + S pressed!

}\n *
\n * );\n *}\n *```\n */\n\nfunction useKeyPress() {\n var keyCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n target: defaultDoc,\n actInsideInputWithModifier: true\n };\n\n var _useState3 = useState(false),\n _useState4 = _slicedToArray(_useState3, 2),\n keyPressed = _useState4[0],\n setKeyPressed = _useState4[1]; // we need to remember if a modifier key is pressed in order to track it\n\n\n var modifierPressed = useRef(false); // we need to remember the pressed keys in order to support combinations\n\n var pressedKeys = useRef(new Set([]));\n /*\n * keyCodes = array with single keys [['a']] or key combinations [['a', 's']]\n * keysToWatch = array with all keys flattened ['a', 'd', 'ShiftLeft']\n * used to check if we store event.code or event.key. When the code is in the list of keysToWatch\n * we use the code otherwise the key. Explainer: When you press the left \"command\" key, the code is \"MetaLeft\"\n * and the key is \"Meta\". We want users to be able to pass keys and codes so we assume that the key is meant when\n * we can't find it in the list of keysToWatch.\n */\n\n var _useMemo = useMemo(function () {\n if (keyCode !== null) {\n var keyCodeArr = Array.isArray(keyCode) ? keyCode : [keyCode];\n var keys = keyCodeArr.filter(function (kc) {\n return typeof kc === 'string';\n })\n /*\n * we first replace all '+' with '\\n' which we will use to split the keys on\n * then we replace '\\n\\n' with '\\n+', this way we can also support the combination 'key++'\n * in the end we simply split on '\\n' to get the key array\n */\n .map(function (kc) {\n return kc.replace('+', '\\n').replace('\\n\\n', '\\n+').split('\\n');\n });\n var keysFlat = keys.reduce(function (res, item) {\n return res.concat.apply(res, _toConsumableArray(item));\n }, []);\n return [keys, keysFlat];\n }\n\n return [[], []];\n }, [keyCode]),\n _useMemo2 = _slicedToArray(_useMemo, 2),\n keyCodes = _useMemo2[0],\n keysToWatch = _useMemo2[1];\n\n useEffect(function () {\n var target = (options === null || options === void 0 ? void 0 : options.target) || defaultDoc;\n\n if (keyCode !== null) {\n var downHandler = function downHandler(event) {\n modifierPressed.current = event.ctrlKey || event.metaKey || event.shiftKey || event.altKey;\n var preventAction = (!modifierPressed.current || modifierPressed.current && !options.actInsideInputWithModifier) && isInputDOMNode(event);\n\n if (preventAction) {\n return false;\n }\n\n var keyOrCode = useKeyOrCode(event.code, keysToWatch);\n pressedKeys.current.add(event[keyOrCode]);\n\n if (isMatchingKey(keyCodes, pressedKeys.current, false)) {\n var _event$composedPath, _event$composedPath$c;\n\n var _target = ((_event$composedPath = event.composedPath) === null || _event$composedPath === void 0 ? void 0 : (_event$composedPath$c = _event$composedPath.call(event)) === null || _event$composedPath$c === void 0 ? void 0 : _event$composedPath$c[0]) || event.target;\n\n var isInteractiveElement = (_target === null || _target === void 0 ? void 0 : _target.nodeName) === 'BUTTON' || (_target === null || _target === void 0 ? void 0 : _target.nodeName) === 'A';\n\n if (options.preventDefault !== false && (modifierPressed.current || !isInteractiveElement)) {\n event.preventDefault();\n }\n\n setKeyPressed(true);\n }\n };\n\n var upHandler = function upHandler(event) {\n var keyOrCode = useKeyOrCode(event.code, keysToWatch);\n\n if (isMatchingKey(keyCodes, pressedKeys.current, true)) {\n setKeyPressed(false);\n pressedKeys.current.clear();\n } else {\n pressedKeys.current.delete(event[keyOrCode]);\n } // fix for Mac: when cmd key is pressed, keyup is not triggered for any other key, see: https://stackoverflow.com/questions/27380018/when-cmd-key-is-kept-pressed-keyup-is-not-triggered-for-any-other-key\n\n\n if (event.key === 'Meta') {\n pressedKeys.current.clear();\n }\n\n modifierPressed.current = false;\n };\n\n var resetHandler = function resetHandler() {\n pressedKeys.current.clear();\n setKeyPressed(false);\n };\n\n target === null || target === void 0 ? void 0 : target.addEventListener('keydown', downHandler);\n target === null || target === void 0 ? void 0 : target.addEventListener('keyup', upHandler);\n window.addEventListener('blur', resetHandler);\n window.addEventListener('contextmenu', resetHandler);\n return function () {\n target === null || target === void 0 ? void 0 : target.removeEventListener('keydown', downHandler);\n target === null || target === void 0 ? void 0 : target.removeEventListener('keyup', upHandler);\n window.removeEventListener('blur', resetHandler);\n window.removeEventListener('contextmenu', resetHandler);\n };\n }\n }, [keyCode, setKeyPressed]);\n return keyPressed;\n} // utils\n\n\nfunction isMatchingKey(keyCodes, pressedKeys, isUp) {\n return keyCodes\n /*\n * we only want to compare same sizes of keyCode definitions\n * and pressed keys. When the user specified 'Meta' as a key somewhere\n * this would also be truthy without this filter when user presses 'Meta' + 'r'\n */\n .filter(function (keys) {\n return isUp || keys.length === pressedKeys.size;\n })\n /*\n * since we want to support multiple possibilities only one of the\n * combinations need to be part of the pressed keys\n */\n .some(function (keys) {\n return keys.every(function (k) {\n return pressedKeys.has(k);\n });\n });\n}\n\nfunction useKeyOrCode(eventCode, keysToWatch) {\n return keysToWatch.includes(eventCode) ? 'code' : 'key';\n}\n/**\n * Hook for getting viewport helper functions.\n *\n * @internal\n * @returns viewport helper functions\n */\n\n\nvar useViewportHelper = function useViewportHelper() {\n var store = useStoreApi();\n return useMemo(function () {\n return {\n zoomIn: function zoomIn(options) {\n var _store$getState = store.getState(),\n panZoom = _store$getState.panZoom;\n\n return panZoom ? panZoom.scaleBy(1.2, {\n duration: options === null || options === void 0 ? void 0 : options.duration\n }) : Promise.resolve(false);\n },\n zoomOut: function zoomOut(options) {\n var _store$getState2 = store.getState(),\n panZoom = _store$getState2.panZoom;\n\n return panZoom ? panZoom.scaleBy(1 / 1.2, {\n duration: options === null || options === void 0 ? void 0 : options.duration\n }) : Promise.resolve(false);\n },\n zoomTo: function zoomTo(zoomLevel, options) {\n var _store$getState3 = store.getState(),\n panZoom = _store$getState3.panZoom;\n\n return panZoom ? panZoom.scaleTo(zoomLevel, {\n duration: options === null || options === void 0 ? void 0 : options.duration\n }) : Promise.resolve(false);\n },\n getZoom: function getZoom() {\n return store.getState().transform[2];\n },\n setViewport: function () {\n var _setViewport = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(viewport, options) {\n var _viewport$x, _viewport$y, _viewport$zoom;\n\n var _store$getState4, _store$getState4$tran, tX, tY, tZoom, panZoom;\n\n return _regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _store$getState4 = store.getState(), _store$getState4$tran = _slicedToArray(_store$getState4.transform, 3), tX = _store$getState4$tran[0], tY = _store$getState4$tran[1], tZoom = _store$getState4$tran[2], panZoom = _store$getState4.panZoom;\n\n if (panZoom) {\n _context.next = 3;\n break;\n }\n\n return _context.abrupt(\"return\", Promise.resolve(false));\n\n case 3:\n _context.next = 5;\n return panZoom.setViewport({\n x: (_viewport$x = viewport.x) !== null && _viewport$x !== void 0 ? _viewport$x : tX,\n y: (_viewport$y = viewport.y) !== null && _viewport$y !== void 0 ? _viewport$y : tY,\n zoom: (_viewport$zoom = viewport.zoom) !== null && _viewport$zoom !== void 0 ? _viewport$zoom : tZoom\n }, {\n duration: options === null || options === void 0 ? void 0 : options.duration\n });\n\n case 5:\n return _context.abrupt(\"return\", Promise.resolve(true));\n\n case 6:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n function setViewport(_x, _x2) {\n return _setViewport.apply(this, arguments);\n }\n\n return setViewport;\n }(),\n getViewport: function getViewport() {\n var _store$getState$trans = _slicedToArray(store.getState().transform, 3),\n x = _store$getState$trans[0],\n y = _store$getState$trans[1],\n zoom = _store$getState$trans[2];\n\n return {\n x: x,\n y: y,\n zoom: zoom\n };\n },\n setCenter: function () {\n var _setCenter = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(x, y, options) {\n var _store$getState5, width, height, maxZoom, panZoom, nextZoom, centerX, centerY;\n\n return _regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _store$getState5 = store.getState(), width = _store$getState5.width, height = _store$getState5.height, maxZoom = _store$getState5.maxZoom, panZoom = _store$getState5.panZoom;\n nextZoom = typeof (options === null || options === void 0 ? void 0 : options.zoom) !== 'undefined' ? options.zoom : maxZoom;\n centerX = width / 2 - x * nextZoom;\n centerY = height / 2 - y * nextZoom;\n\n if (panZoom) {\n _context2.next = 6;\n break;\n }\n\n return _context2.abrupt(\"return\", Promise.resolve(false));\n\n case 6:\n _context2.next = 8;\n return panZoom.setViewport({\n x: centerX,\n y: centerY,\n zoom: nextZoom\n }, {\n duration: options === null || options === void 0 ? void 0 : options.duration\n });\n\n case 8:\n return _context2.abrupt(\"return\", Promise.resolve(true));\n\n case 9:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n\n function setCenter(_x3, _x4, _x5) {\n return _setCenter.apply(this, arguments);\n }\n\n return setCenter;\n }(),\n fitBounds: function () {\n var _fitBounds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(bounds, options) {\n var _options$padding;\n\n var _store$getState6, width, height, minZoom, maxZoom, panZoom, viewport;\n\n return _regeneratorRuntime.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n _store$getState6 = store.getState(), width = _store$getState6.width, height = _store$getState6.height, minZoom = _store$getState6.minZoom, maxZoom = _store$getState6.maxZoom, panZoom = _store$getState6.panZoom;\n viewport = getViewportForBounds(bounds, width, height, minZoom, maxZoom, (_options$padding = options === null || options === void 0 ? void 0 : options.padding) !== null && _options$padding !== void 0 ? _options$padding : 0.1);\n\n if (panZoom) {\n _context3.next = 4;\n break;\n }\n\n return _context3.abrupt(\"return\", Promise.resolve(false));\n\n case 4:\n _context3.next = 6;\n return panZoom.setViewport(viewport, {\n duration: options === null || options === void 0 ? void 0 : options.duration\n });\n\n case 6:\n return _context3.abrupt(\"return\", Promise.resolve(true));\n\n case 7:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3);\n }));\n\n function fitBounds(_x6, _x7) {\n return _fitBounds.apply(this, arguments);\n }\n\n return fitBounds;\n }(),\n screenToFlowPosition: function screenToFlowPosition(clientPosition) {\n var _options$snapGrid, _options$snapToGrid;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var _store$getState7 = store.getState(),\n transform = _store$getState7.transform,\n snapGrid = _store$getState7.snapGrid,\n snapToGrid = _store$getState7.snapToGrid,\n domNode = _store$getState7.domNode;\n\n if (!domNode) {\n return clientPosition;\n }\n\n var _domNode$getBoundingC = domNode.getBoundingClientRect(),\n domX = _domNode$getBoundingC.x,\n domY = _domNode$getBoundingC.y;\n\n var correctedPosition = {\n x: clientPosition.x - domX,\n y: clientPosition.y - domY\n };\n\n var _snapGrid = (_options$snapGrid = options.snapGrid) !== null && _options$snapGrid !== void 0 ? _options$snapGrid : snapGrid;\n\n var _snapToGrid = (_options$snapToGrid = options.snapToGrid) !== null && _options$snapToGrid !== void 0 ? _options$snapToGrid : snapToGrid;\n\n return pointToRendererPoint(correctedPosition, transform, _snapToGrid, _snapGrid);\n },\n flowToScreenPosition: function flowToScreenPosition(flowPosition) {\n var _store$getState8 = store.getState(),\n transform = _store$getState8.transform,\n domNode = _store$getState8.domNode;\n\n if (!domNode) {\n return flowPosition;\n }\n\n var _domNode$getBoundingC2 = domNode.getBoundingClientRect(),\n domX = _domNode$getBoundingC2.x,\n domY = _domNode$getBoundingC2.y;\n\n var rendererPosition = rendererPointToPoint(flowPosition, transform);\n return {\n x: rendererPosition.x + domX,\n y: rendererPosition.y + domY\n };\n }\n };\n }, []);\n};\n/*\n * This function applies changes to nodes or edges that are triggered by React Flow internally.\n * When you drag a node for example, React Flow will send a position change update.\n * This function then applies the changes and returns the updated elements.\n */\n\n\nfunction applyChanges(changes, elements) {\n var updatedElements = [];\n /*\n * By storing a map of changes for each element, we can a quick lookup as we\n * iterate over the elements array!\n */\n\n var changesMap = new Map();\n var addItemChanges = [];\n\n var _iterator4 = _createForOfIteratorHelper(changes),\n _step4;\n\n try {\n for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n var change = _step4.value;\n\n if (change.type === 'add') {\n addItemChanges.push(change);\n continue;\n } else if (change.type === 'remove' || change.type === 'replace') {\n /*\n * For a 'remove' change we can safely ignore any other changes queued for\n * the same element, it's going to be removed anyway!\n */\n changesMap.set(change.id, [change]);\n } else {\n var elementChanges = changesMap.get(change.id);\n\n if (elementChanges) {\n /*\n * If we have some changes queued already, we can do a mutable update of\n * that array and save ourselves some copying.\n */\n elementChanges.push(change);\n } else {\n changesMap.set(change.id, [change]);\n }\n }\n }\n } catch (err) {\n _iterator4.e(err);\n } finally {\n _iterator4.f();\n }\n\n var _iterator5 = _createForOfIteratorHelper(elements),\n _step5;\n\n try {\n for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {\n var element = _step5.value;\n\n var _changes = changesMap.get(element.id);\n /*\n * When there are no changes for an element we can just push it unmodified,\n * no need to copy it.\n */\n\n\n if (!_changes) {\n updatedElements.push(element);\n continue;\n } // If we have a 'remove' change queued, it'll be the only change in the array\n\n\n if (_changes[0].type === 'remove') {\n continue;\n }\n\n if (_changes[0].type === 'replace') {\n updatedElements.push(_objectSpread({}, _changes[0].item));\n continue;\n }\n /**\n * For other types of changes, we want to start with a shallow copy of the\n * object so React knows this element has changed. Sequential changes will\n * each _mutate_ this object, so there's only ever one copy.\n */\n\n\n var updatedElement = _objectSpread({}, element);\n\n var _iterator6 = _createForOfIteratorHelper(_changes),\n _step6;\n\n try {\n for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {\n var _change = _step6.value;\n applyChange(_change, updatedElement);\n }\n } catch (err) {\n _iterator6.e(err);\n } finally {\n _iterator6.f();\n }\n\n updatedElements.push(updatedElement);\n }\n /*\n * we need to wait for all changes to be applied before adding new items\n * to be able to add them at the correct index\n */\n\n } catch (err) {\n _iterator5.e(err);\n } finally {\n _iterator5.f();\n }\n\n if (addItemChanges.length) {\n addItemChanges.forEach(function (change) {\n if (change.index !== undefined) {\n updatedElements.splice(change.index, 0, _objectSpread({}, change.item));\n } else {\n updatedElements.push(_objectSpread({}, change.item));\n }\n });\n }\n\n return updatedElements;\n} // Applies a single change to an element. This is a *mutable* update.\n\n\nfunction applyChange(change, element) {\n switch (change.type) {\n case 'select':\n {\n element.selected = change.selected;\n break;\n }\n\n case 'position':\n {\n if (typeof change.position !== 'undefined') {\n element.position = change.position;\n }\n\n if (typeof change.dragging !== 'undefined') {\n element.dragging = change.dragging;\n }\n\n break;\n }\n\n case 'dimensions':\n {\n if (typeof change.dimensions !== 'undefined') {\n var _element$measured;\n\n (_element$measured = element.measured) !== null && _element$measured !== void 0 ? _element$measured : element.measured = {};\n element.measured.width = change.dimensions.width;\n element.measured.height = change.dimensions.height;\n\n if (change.setAttributes) {\n element.width = change.dimensions.width;\n element.height = change.dimensions.height;\n }\n }\n\n if (typeof change.resizing === 'boolean') {\n element.resizing = change.resizing;\n }\n\n break;\n }\n }\n}\n/**\n * Drop in function that applies node changes to an array of nodes.\n * @public\n * @param changes - Array of changes to apply\n * @param nodes - Array of nodes to apply the changes to\n * @returns Array of updated nodes\n * @example\n *```tsx\n *import { useState, useCallback } from 'react';\n *import { ReactFlow, applyNodeChanges, type Node, type Edge, type OnNodesChange } from '@xyflow/react';\n *\n *export default function Flow() {\n * const [nodes, setNodes] = useState([]);\n * const [edges, setEdges] = useState([]);\n * const onNodesChange: OnNodesChange = useCallback(\n * (changes) => {\n * setNodes((oldNodes) => applyNodeChanges(changes, oldNodes));\n * },\n * [setNodes],\n * );\n *\n * return (\n * \n * );\n *}\n *```\n * @remarks Various events on the component can produce an {@link NodeChange}\n * that describes how to update the edges of your flow in some way.\n * If you don't need any custom behaviour, this util can be used to take an array\n * of these changes and apply them to your edges.\n */\n\n\nfunction applyNodeChanges(changes, nodes) {\n return applyChanges(changes, nodes);\n}\n/**\n * Drop in function that applies edge changes to an array of edges.\n * @public\n * @param changes - Array of changes to apply\n * @param edges - Array of edge to apply the changes to\n * @returns Array of updated edges\n * @example\n * ```tsx\n *import { useState, useCallback } from 'react';\n *import { ReactFlow, applyEdgeChanges } from '@xyflow/react';\n *\n *export default function Flow() {\n * const [nodes, setNodes] = useState([]);\n * const [edges, setEdges] = useState([]);\n * const onEdgesChange = useCallback(\n * (changes) => {\n * setEdges((oldEdges) => applyEdgeChanges(changes, oldEdges));\n * },\n * [setEdges],\n * );\n *\n * return (\n * \n * );\n *}\n *```\n * @remarks Various events on the component can produce an {@link EdgeChange}\n * that describes how to update the edges of your flow in some way.\n * If you don't need any custom behaviour, this util can be used to take an array\n * of these changes and apply them to your edges.\n */\n\n\nfunction applyEdgeChanges(changes, edges) {\n return applyChanges(changes, edges);\n}\n\nfunction createSelectionChange(id, selected) {\n return {\n id: id,\n type: 'select',\n selected: selected\n };\n}\n\nfunction getSelectionChanges(items) {\n var selectedIds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Set();\n var mutateItem = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var changes = [];\n\n var _iterator7 = _createForOfIteratorHelper(items),\n _step7;\n\n try {\n for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {\n var _step7$value = _slicedToArray(_step7.value, 2),\n id = _step7$value[0],\n item = _step7$value[1];\n\n var willBeSelected = selectedIds.has(id); // we don't want to set all items to selected=false on the first selection\n\n if (!(item.selected === undefined && !willBeSelected) && item.selected !== willBeSelected) {\n if (mutateItem) {\n /*\n * this hack is needed for nodes. When the user dragged a node, it's selected.\n * When another node gets dragged, we need to deselect the previous one,\n * in order to have only one selected node at a time - the onNodesChange callback comes too late here :/\n */\n item.selected = willBeSelected;\n }\n\n changes.push(createSelectionChange(item.id, willBeSelected));\n }\n }\n } catch (err) {\n _iterator7.e(err);\n } finally {\n _iterator7.f();\n }\n\n return changes;\n}\n\nfunction getElementsDiffChanges(_ref7) {\n var _ref7$items = _ref7.items,\n items = _ref7$items === void 0 ? [] : _ref7$items,\n lookup = _ref7.lookup;\n var changes = [];\n var itemsLookup = new Map(items.map(function (item) {\n return [item.id, item];\n }));\n\n var _iterator8 = _createForOfIteratorHelper(items.entries()),\n _step8;\n\n try {\n for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {\n var _lookupItem$internals, _lookupItem$internals2;\n\n var _step8$value = _slicedToArray(_step8.value, 2),\n _index = _step8$value[0],\n item = _step8$value[1];\n\n var lookupItem = lookup.get(item.id);\n var storeItem = (_lookupItem$internals = lookupItem === null || lookupItem === void 0 ? void 0 : (_lookupItem$internals2 = lookupItem.internals) === null || _lookupItem$internals2 === void 0 ? void 0 : _lookupItem$internals2.userNode) !== null && _lookupItem$internals !== void 0 ? _lookupItem$internals : lookupItem;\n\n if (storeItem !== undefined && storeItem !== item) {\n changes.push({\n id: item.id,\n item: item,\n type: 'replace'\n });\n }\n\n if (storeItem === undefined) {\n changes.push({\n item: item,\n type: 'add',\n index: _index\n });\n }\n }\n } catch (err) {\n _iterator8.e(err);\n } finally {\n _iterator8.f();\n }\n\n var _iterator9 = _createForOfIteratorHelper(lookup),\n _step9;\n\n try {\n for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {\n var _step9$value = _slicedToArray(_step9.value, 1),\n id = _step9$value[0];\n\n var nextNode = itemsLookup.get(id);\n\n if (nextNode === undefined) {\n changes.push({\n id: id,\n type: 'remove'\n });\n }\n }\n } catch (err) {\n _iterator9.e(err);\n } finally {\n _iterator9.f();\n }\n\n return changes;\n}\n\nfunction elementToRemoveChange(item) {\n return {\n id: item.id,\n type: 'remove'\n };\n}\n/**\n * Test whether an object is useable as an [`Node`](/api-reference/types/node).\n * In TypeScript this is a type guard that will narrow the type of whatever you pass in to\n * [`Node`](/api-reference/types/node) if it returns `true`.\n *\n * @public\n * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Node if it returns true\n * @param element - The element to test\n * @returns A boolean indicating whether the element is an Node\n *\n * @example\n * ```js\n *import { isNode } from '@xyflow/react';\n *\n *if (isNode(node)) {\n * // ..\n *}\n *```\n */\n\n\nvar isNode = function isNode(element) {\n return isNodeBase(element);\n};\n/**\n * Test whether an object is useable as an [`Edge`](/api-reference/types/edge).\n * In TypeScript this is a type guard that will narrow the type of whatever you pass in to\n * [`Edge`](/api-reference/types/edge) if it returns `true`.\n *\n * @public\n * @remarks In TypeScript this is a type guard that will narrow the type of whatever you pass in to Edge if it returns true\n * @param element - The element to test\n * @returns A boolean indicating whether the element is an Edge\n *\n * @example\n * ```js\n *import { isEdge } from '@xyflow/react';\n *\n *if (isEdge(edge)) {\n * // ..\n *}\n *```\n */\n\n\nvar isEdge = function isEdge(element) {\n return isEdgeBase(element);\n}; // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n\n\nfunction fixedForwardRef(render) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return forwardRef(render);\n} // we need this hook to prevent a warning when using react-flow in SSR\n\n\nvar useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n/**\n * This hook returns a queue that can be used to batch updates.\n *\n * @param runQueue - a function that gets called when the queue is flushed\n * @internal\n *\n * @returns a Queue object\n */\n\nfunction useQueue(runQueue) {\n /*\n * Because we're using a ref above, we need some way to let React know when to\n * actually process the queue. We increment this number any time we mutate the\n * queue, creating a new state to trigger the layout effect below.\n * Using a boolean dirty flag here instead would lead to issues related to\n * automatic batching. (https://github.com/xyflow/xyflow/issues/4779)\n */\n var _useState5 = useState(BigInt(0)),\n _useState6 = _slicedToArray(_useState5, 2),\n serial = _useState6[0],\n setSerial = _useState6[1];\n /*\n * A reference of all the batched updates to process before the next render. We\n * want a reference here so multiple synchronous calls to `setNodes` etc can be\n * batched together.\n */\n\n\n var _useState7 = useState(function () {\n return createQueue(function () {\n return setSerial(function (n) {\n return n + BigInt(1);\n });\n });\n }),\n _useState8 = _slicedToArray(_useState7, 1),\n queue = _useState8[0];\n /*\n * Layout effects are guaranteed to run before the next render which means we\n * shouldn't run into any issues with stale state or weird issues that come from\n * rendering things one frame later than expected (we used to use `setTimeout`).\n */\n\n\n useIsomorphicLayoutEffect(function () {\n var queueItems = queue.get();\n\n if (queueItems.length) {\n runQueue(queueItems);\n queue.reset();\n }\n }, [serial]);\n return queue;\n}\n\nfunction createQueue(cb) {\n var queue = [];\n return {\n get: function get() {\n return queue;\n },\n reset: function reset() {\n queue = [];\n },\n push: function push(item) {\n queue.push(item);\n cb();\n }\n };\n}\n\nvar BatchContext = createContext(null);\n/**\n * This is a context provider that holds and processes the node and edge update queues\n * that are needed to handle setNodes, addNodes, setEdges and addEdges.\n *\n * @internal\n */\n\nfunction BatchProvider(_ref8) {\n var children = _ref8.children;\n var store = useStoreApi();\n var nodeQueueHandler = useCallback(function (queueItems) {\n var _store$getState9 = store.getState(),\n _store$getState9$node = _store$getState9.nodes,\n nodes = _store$getState9$node === void 0 ? [] : _store$getState9$node,\n setNodes = _store$getState9.setNodes,\n hasDefaultNodes = _store$getState9.hasDefaultNodes,\n onNodesChange = _store$getState9.onNodesChange,\n nodeLookup = _store$getState9.nodeLookup;\n /*\n * This is essentially an `Array.reduce` in imperative clothing. Processing\n * this queue is a relatively hot path so we'd like to avoid the overhead of\n * array methods where we can.\n */\n\n\n var next = nodes;\n\n var _iterator10 = _createForOfIteratorHelper(queueItems),\n _step10;\n\n try {\n for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {\n var payload = _step10.value;\n next = typeof payload === 'function' ? payload(next) : payload;\n }\n } catch (err) {\n _iterator10.e(err);\n } finally {\n _iterator10.f();\n }\n\n if (hasDefaultNodes) {\n setNodes(next);\n } else if (onNodesChange) {\n onNodesChange(getElementsDiffChanges({\n items: next,\n lookup: nodeLookup\n }));\n }\n }, []);\n var nodeQueue = useQueue(nodeQueueHandler);\n var edgeQueueHandler = useCallback(function (queueItems) {\n var _store$getState10 = store.getState(),\n _store$getState10$edg = _store$getState10.edges,\n edges = _store$getState10$edg === void 0 ? [] : _store$getState10$edg,\n setEdges = _store$getState10.setEdges,\n hasDefaultEdges = _store$getState10.hasDefaultEdges,\n onEdgesChange = _store$getState10.onEdgesChange,\n edgeLookup = _store$getState10.edgeLookup;\n\n var next = edges;\n\n var _iterator11 = _createForOfIteratorHelper(queueItems),\n _step11;\n\n try {\n for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {\n var payload = _step11.value;\n next = typeof payload === 'function' ? payload(next) : payload;\n }\n } catch (err) {\n _iterator11.e(err);\n } finally {\n _iterator11.f();\n }\n\n if (hasDefaultEdges) {\n setEdges(next);\n } else if (onEdgesChange) {\n onEdgesChange(getElementsDiffChanges({\n items: next,\n lookup: edgeLookup\n }));\n }\n }, []);\n var edgeQueue = useQueue(edgeQueueHandler);\n var value = useMemo(function () {\n return {\n nodeQueue: nodeQueue,\n edgeQueue: edgeQueue\n };\n }, []);\n return jsx(BatchContext.Provider, {\n value: value,\n children: children\n });\n}\n\nfunction useBatchContext() {\n var batchContext = useContext(BatchContext);\n\n if (!batchContext) {\n throw new Error('useBatchContext must be used within a BatchProvider');\n }\n\n return batchContext;\n}\n\nvar selector$k = function selector$k(s) {\n return !!s.panZoom;\n};\n/**\n * This hook returns a ReactFlowInstance that can be used to update nodes and edges, manipulate the viewport, or query the current state of the flow.\n *\n * @public\n * @returns ReactFlowInstance\n *\n * @example\n * ```jsx\n *import { useCallback, useState } from 'react';\n *import { useReactFlow } from '@xyflow/react';\n *\n *export function NodeCounter() {\n * const reactFlow = useReactFlow();\n * const [count, setCount] = useState(0);\n * const countNodes = useCallback(() => {\n * setCount(reactFlow.getNodes().length);\n * // you need to pass it as a dependency if you are using it with useEffect or useCallback\n * // because at the first render, it's not initialized yet and some functions might not work.\n * }, [reactFlow]);\n *\n * return (\n *
\n * \n *

There are {count} nodes in the flow.

\n *
\n * );\n *}\n *```\n */\n\n\nfunction useReactFlow() {\n var viewportHelper = useViewportHelper();\n var store = useStoreApi();\n var batchContext = useBatchContext();\n var viewportInitialized = useStore(selector$k);\n var generalHelper = useMemo(function () {\n var getInternalNode = function getInternalNode(id) {\n return store.getState().nodeLookup.get(id);\n };\n\n var setNodes = function setNodes(payload) {\n batchContext.nodeQueue.push(payload);\n };\n\n var setEdges = function setEdges(payload) {\n batchContext.edgeQueue.push(payload);\n };\n\n var getNodeRect = function getNodeRect(node) {\n var _nodeToUse$measured$w, _nodeToUse$measured, _nodeToUse$measured$h, _nodeToUse$measured2;\n\n var _store$getState11 = store.getState(),\n nodeLookup = _store$getState11.nodeLookup,\n nodeOrigin = _store$getState11.nodeOrigin;\n\n var nodeToUse = isNode(node) ? node : nodeLookup.get(node.id);\n var position = nodeToUse.parentId ? evaluateAbsolutePosition(nodeToUse.position, nodeToUse.measured, nodeToUse.parentId, nodeLookup, nodeOrigin) : nodeToUse.position;\n\n var nodeWithPosition = _objectSpread(_objectSpread({}, nodeToUse), {}, {\n position: position,\n width: (_nodeToUse$measured$w = (_nodeToUse$measured = nodeToUse.measured) === null || _nodeToUse$measured === void 0 ? void 0 : _nodeToUse$measured.width) !== null && _nodeToUse$measured$w !== void 0 ? _nodeToUse$measured$w : nodeToUse.width,\n height: (_nodeToUse$measured$h = (_nodeToUse$measured2 = nodeToUse.measured) === null || _nodeToUse$measured2 === void 0 ? void 0 : _nodeToUse$measured2.height) !== null && _nodeToUse$measured$h !== void 0 ? _nodeToUse$measured$h : nodeToUse.height\n });\n\n return nodeToRect(nodeWithPosition);\n };\n\n var updateNode = function updateNode(id, nodeUpdate) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n replace: false\n };\n setNodes(function (prevNodes) {\n return prevNodes.map(function (node) {\n if (node.id === id) {\n var nextNode = typeof nodeUpdate === 'function' ? nodeUpdate(node) : nodeUpdate;\n return options.replace && isNode(nextNode) ? nextNode : _objectSpread(_objectSpread({}, node), nextNode);\n }\n\n return node;\n });\n });\n };\n\n var updateEdge = function updateEdge(id, edgeUpdate) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n replace: false\n };\n setEdges(function (prevEdges) {\n return prevEdges.map(function (edge) {\n if (edge.id === id) {\n var nextEdge = typeof edgeUpdate === 'function' ? edgeUpdate(edge) : edgeUpdate;\n return options.replace && isEdge(nextEdge) ? nextEdge : _objectSpread(_objectSpread({}, edge), nextEdge);\n }\n\n return edge;\n });\n });\n };\n\n return {\n getNodes: function getNodes() {\n return store.getState().nodes.map(function (n) {\n return _objectSpread({}, n);\n });\n },\n getNode: function getNode(id) {\n var _getInternalNode;\n\n return (_getInternalNode = getInternalNode(id)) === null || _getInternalNode === void 0 ? void 0 : _getInternalNode.internals.userNode;\n },\n getInternalNode: getInternalNode,\n getEdges: function getEdges() {\n var _store$getState12 = store.getState(),\n _store$getState12$edg = _store$getState12.edges,\n edges = _store$getState12$edg === void 0 ? [] : _store$getState12$edg;\n\n return edges.map(function (e) {\n return _objectSpread({}, e);\n });\n },\n getEdge: function getEdge(id) {\n return store.getState().edgeLookup.get(id);\n },\n setNodes: setNodes,\n setEdges: setEdges,\n addNodes: function addNodes(payload) {\n var newNodes = Array.isArray(payload) ? payload : [payload];\n batchContext.nodeQueue.push(function (nodes) {\n return [].concat(_toConsumableArray(nodes), _toConsumableArray(newNodes));\n });\n },\n addEdges: function addEdges(payload) {\n var newEdges = Array.isArray(payload) ? payload : [payload];\n batchContext.edgeQueue.push(function (edges) {\n return [].concat(_toConsumableArray(edges), _toConsumableArray(newEdges));\n });\n },\n toObject: function toObject() {\n var _store$getState13 = store.getState(),\n _store$getState13$nod = _store$getState13.nodes,\n nodes = _store$getState13$nod === void 0 ? [] : _store$getState13$nod,\n _store$getState13$edg = _store$getState13.edges,\n edges = _store$getState13$edg === void 0 ? [] : _store$getState13$edg,\n transform = _store$getState13.transform;\n\n var _transform = _slicedToArray(transform, 3),\n x = _transform[0],\n y = _transform[1],\n zoom = _transform[2];\n\n return {\n nodes: nodes.map(function (n) {\n return _objectSpread({}, n);\n }),\n edges: edges.map(function (e) {\n return _objectSpread({}, e);\n }),\n viewport: {\n x: x,\n y: y,\n zoom: zoom\n }\n };\n },\n deleteElements: function () {\n var _deleteElements = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref9) {\n var _ref9$nodes, nodesToRemove, _ref9$edges, edgesToRemove, _store$getState14, nodes, edges, onNodesDelete, onEdgesDelete, triggerNodeChanges, triggerEdgeChanges, onDelete, onBeforeDelete, _yield$getElementsToR, matchingNodes, matchingEdges, hasMatchingEdges, hasMatchingNodes, edgeChanges, nodeChanges;\n\n return _regeneratorRuntime.wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n _ref9$nodes = _ref9.nodes, nodesToRemove = _ref9$nodes === void 0 ? [] : _ref9$nodes, _ref9$edges = _ref9.edges, edgesToRemove = _ref9$edges === void 0 ? [] : _ref9$edges;\n _store$getState14 = store.getState(), nodes = _store$getState14.nodes, edges = _store$getState14.edges, onNodesDelete = _store$getState14.onNodesDelete, onEdgesDelete = _store$getState14.onEdgesDelete, triggerNodeChanges = _store$getState14.triggerNodeChanges, triggerEdgeChanges = _store$getState14.triggerEdgeChanges, onDelete = _store$getState14.onDelete, onBeforeDelete = _store$getState14.onBeforeDelete;\n _context4.next = 4;\n return getElementsToRemove({\n nodesToRemove: nodesToRemove,\n edgesToRemove: edgesToRemove,\n nodes: nodes,\n edges: edges,\n onBeforeDelete: onBeforeDelete\n });\n\n case 4:\n _yield$getElementsToR = _context4.sent;\n matchingNodes = _yield$getElementsToR.nodes;\n matchingEdges = _yield$getElementsToR.edges;\n hasMatchingEdges = matchingEdges.length > 0;\n hasMatchingNodes = matchingNodes.length > 0;\n\n if (hasMatchingEdges) {\n edgeChanges = matchingEdges.map(elementToRemoveChange);\n onEdgesDelete === null || onEdgesDelete === void 0 ? void 0 : onEdgesDelete(matchingEdges);\n triggerEdgeChanges(edgeChanges);\n }\n\n if (hasMatchingNodes) {\n nodeChanges = matchingNodes.map(elementToRemoveChange);\n onNodesDelete === null || onNodesDelete === void 0 ? void 0 : onNodesDelete(matchingNodes);\n triggerNodeChanges(nodeChanges);\n }\n\n if (hasMatchingNodes || hasMatchingEdges) {\n onDelete === null || onDelete === void 0 ? void 0 : onDelete({\n nodes: matchingNodes,\n edges: matchingEdges\n });\n }\n\n return _context4.abrupt(\"return\", {\n deletedNodes: matchingNodes,\n deletedEdges: matchingEdges\n });\n\n case 13:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4);\n }));\n\n function deleteElements(_x8) {\n return _deleteElements.apply(this, arguments);\n }\n\n return deleteElements;\n }(),\n getIntersectingNodes: function getIntersectingNodes(nodeOrRect) {\n var partially = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var nodes = arguments.length > 2 ? arguments[2] : undefined;\n var isRect = isRectObject(nodeOrRect);\n var nodeRect = isRect ? nodeOrRect : getNodeRect(nodeOrRect);\n var hasNodesOption = nodes !== undefined;\n\n if (!nodeRect) {\n return [];\n }\n\n return (nodes || store.getState().nodes).filter(function (n) {\n var internalNode = store.getState().nodeLookup.get(n.id);\n\n if (internalNode && !isRect && (n.id === nodeOrRect.id || !internalNode.internals.positionAbsolute)) {\n return false;\n }\n\n var currNodeRect = nodeToRect(hasNodesOption ? n : internalNode);\n var overlappingArea = getOverlappingArea(currNodeRect, nodeRect);\n var partiallyVisible = partially && overlappingArea > 0;\n return partiallyVisible || overlappingArea >= nodeRect.width * nodeRect.height;\n });\n },\n isNodeIntersecting: function isNodeIntersecting(nodeOrRect, area) {\n var partially = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n var isRect = isRectObject(nodeOrRect);\n var nodeRect = isRect ? nodeOrRect : getNodeRect(nodeOrRect);\n\n if (!nodeRect) {\n return false;\n }\n\n var overlappingArea = getOverlappingArea(nodeRect, area);\n var partiallyVisible = partially && overlappingArea > 0;\n return partiallyVisible || overlappingArea >= nodeRect.width * nodeRect.height;\n },\n updateNode: updateNode,\n updateNodeData: function updateNodeData(id, dataUpdate) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n replace: false\n };\n updateNode(id, function (node) {\n var nextData = typeof dataUpdate === 'function' ? dataUpdate(node) : dataUpdate;\n return options.replace ? _objectSpread(_objectSpread({}, node), {}, {\n data: nextData\n }) : _objectSpread(_objectSpread({}, node), {}, {\n data: _objectSpread(_objectSpread({}, node.data), nextData)\n });\n }, options);\n },\n updateEdge: updateEdge,\n updateEdgeData: function updateEdgeData(id, dataUpdate) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n replace: false\n };\n updateEdge(id, function (edge) {\n var nextData = typeof dataUpdate === 'function' ? dataUpdate(edge) : dataUpdate;\n return options.replace ? _objectSpread(_objectSpread({}, edge), {}, {\n data: nextData\n }) : _objectSpread(_objectSpread({}, edge), {}, {\n data: _objectSpread(_objectSpread({}, edge.data), nextData)\n });\n }, options);\n },\n getNodesBounds: function getNodesBounds(nodes) {\n var _store$getState15 = store.getState(),\n nodeLookup = _store$getState15.nodeLookup,\n nodeOrigin = _store$getState15.nodeOrigin;\n\n return _getNodesBounds(nodes, {\n nodeLookup: nodeLookup,\n nodeOrigin: nodeOrigin\n });\n },\n getHandleConnections: function getHandleConnections(_ref10) {\n var _store$getState$conne, _store$getState$conne2;\n\n var type = _ref10.type,\n id = _ref10.id,\n nodeId = _ref10.nodeId;\n return Array.from((_store$getState$conne = (_store$getState$conne2 = store.getState().connectionLookup.get(\"\".concat(nodeId, \"-\").concat(type).concat(id ? \"-\".concat(id) : ''))) === null || _store$getState$conne2 === void 0 ? void 0 : _store$getState$conne2.values()) !== null && _store$getState$conne !== void 0 ? _store$getState$conne : []);\n },\n getNodeConnections: function getNodeConnections(_ref11) {\n var _store$getState$conne3, _store$getState$conne4;\n\n var type = _ref11.type,\n handleId = _ref11.handleId,\n nodeId = _ref11.nodeId;\n return Array.from((_store$getState$conne3 = (_store$getState$conne4 = store.getState().connectionLookup.get(\"\".concat(nodeId).concat(type ? handleId ? \"-\".concat(type, \"-\").concat(handleId) : \"-\".concat(type) : ''))) === null || _store$getState$conne4 === void 0 ? void 0 : _store$getState$conne4.values()) !== null && _store$getState$conne3 !== void 0 ? _store$getState$conne3 : []);\n },\n fitView: function () {\n var _fitView = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(options) {\n var _store$getState$fitVi;\n\n var fitViewResolver;\n return _regeneratorRuntime.wrap(function _callee5$(_context5) {\n while (1) {\n switch (_context5.prev = _context5.next) {\n case 0:\n // We either create a new Promise or reuse the existing one\n // Even if fitView is called multiple times in a row, we only end up with a single Promise\n fitViewResolver = (_store$getState$fitVi = store.getState().fitViewResolver) !== null && _store$getState$fitVi !== void 0 ? _store$getState$fitVi : Promise.withResolvers(); // We schedule a fitView by setting fitViewQueued and triggering a setNodes\n\n store.setState({\n fitViewQueued: true,\n fitViewOptions: options,\n fitViewResolver: fitViewResolver\n });\n batchContext.nodeQueue.push(function (nodes) {\n return _toConsumableArray(nodes);\n });\n return _context5.abrupt(\"return\", fitViewResolver.promise);\n\n case 4:\n case \"end\":\n return _context5.stop();\n }\n }\n }, _callee5);\n }));\n\n function fitView(_x9) {\n return _fitView.apply(this, arguments);\n }\n\n return fitView;\n }()\n };\n }, []);\n return useMemo(function () {\n return _objectSpread(_objectSpread(_objectSpread({}, generalHelper), viewportHelper), {}, {\n viewportInitialized: viewportInitialized\n });\n }, [viewportInitialized]);\n}\n\nvar selected = function selected(item) {\n return item.selected;\n};\n\nvar deleteKeyOptions = {\n actInsideInputWithModifier: false\n};\nvar win$1 = typeof window !== 'undefined' ? window : undefined;\n/**\n * Hook for handling global key events.\n *\n * @internal\n */\n\nfunction useGlobalKeyHandler(_ref12) {\n var deleteKeyCode = _ref12.deleteKeyCode,\n multiSelectionKeyCode = _ref12.multiSelectionKeyCode;\n var store = useStoreApi();\n\n var _useReactFlow = useReactFlow(),\n deleteElements = _useReactFlow.deleteElements;\n\n var deleteKeyPressed = useKeyPress(deleteKeyCode, deleteKeyOptions);\n var multiSelectionKeyPressed = useKeyPress(multiSelectionKeyCode, {\n target: win$1\n });\n useEffect(function () {\n if (deleteKeyPressed) {\n var _store$getState16 = store.getState(),\n edges = _store$getState16.edges,\n nodes = _store$getState16.nodes;\n\n deleteElements({\n nodes: nodes.filter(selected),\n edges: edges.filter(selected)\n });\n store.setState({\n nodesSelectionActive: false\n });\n }\n }, [deleteKeyPressed]);\n useEffect(function () {\n store.setState({\n multiSelectionActive: multiSelectionKeyPressed\n });\n }, [multiSelectionKeyPressed]);\n}\n/**\n * Hook for handling resize events.\n *\n * @internal\n */\n\n\nfunction useResizeHandler(domNode) {\n var store = useStoreApi();\n useEffect(function () {\n var updateDimensions = function updateDimensions() {\n if (!domNode.current) {\n return false;\n }\n\n var size = getDimensions(domNode.current);\n\n if (size.height === 0 || size.width === 0) {\n var _store$getState$onErr, _store$getState17;\n\n (_store$getState$onErr = (_store$getState17 = store.getState()).onError) === null || _store$getState$onErr === void 0 ? void 0 : _store$getState$onErr.call(_store$getState17, '004', errorMessages['error004']());\n }\n\n store.setState({\n width: size.width || 500,\n height: size.height || 500\n });\n };\n\n if (domNode.current) {\n updateDimensions();\n window.addEventListener('resize', updateDimensions);\n var resizeObserver = new ResizeObserver(function () {\n return updateDimensions();\n });\n resizeObserver.observe(domNode.current);\n return function () {\n window.removeEventListener('resize', updateDimensions);\n\n if (resizeObserver && domNode.current) {\n resizeObserver.unobserve(domNode.current);\n }\n };\n }\n }, []);\n}\n\nvar containerStyle = {\n position: 'absolute',\n width: '100%',\n height: '100%',\n top: 0,\n left: 0\n};\n\nvar selector$j = function selector$j(s) {\n return {\n userSelectionActive: s.userSelectionActive,\n lib: s.lib\n };\n};\n\nfunction ZoomPane(_ref13) {\n var onPaneContextMenu = _ref13.onPaneContextMenu,\n _ref13$zoomOnScroll = _ref13.zoomOnScroll,\n zoomOnScroll = _ref13$zoomOnScroll === void 0 ? true : _ref13$zoomOnScroll,\n _ref13$zoomOnPinch = _ref13.zoomOnPinch,\n zoomOnPinch = _ref13$zoomOnPinch === void 0 ? true : _ref13$zoomOnPinch,\n _ref13$panOnScroll = _ref13.panOnScroll,\n panOnScroll = _ref13$panOnScroll === void 0 ? false : _ref13$panOnScroll,\n _ref13$panOnScrollSpe = _ref13.panOnScrollSpeed,\n panOnScrollSpeed = _ref13$panOnScrollSpe === void 0 ? 0.5 : _ref13$panOnScrollSpe,\n _ref13$panOnScrollMod = _ref13.panOnScrollMode,\n panOnScrollMode = _ref13$panOnScrollMod === void 0 ? PanOnScrollMode.Free : _ref13$panOnScrollMod,\n _ref13$zoomOnDoubleCl = _ref13.zoomOnDoubleClick,\n zoomOnDoubleClick = _ref13$zoomOnDoubleCl === void 0 ? true : _ref13$zoomOnDoubleCl,\n _ref13$panOnDrag = _ref13.panOnDrag,\n panOnDrag = _ref13$panOnDrag === void 0 ? true : _ref13$panOnDrag,\n defaultViewport = _ref13.defaultViewport,\n translateExtent = _ref13.translateExtent,\n minZoom = _ref13.minZoom,\n maxZoom = _ref13.maxZoom,\n zoomActivationKeyCode = _ref13.zoomActivationKeyCode,\n _ref13$preventScrolli = _ref13.preventScrolling,\n preventScrolling = _ref13$preventScrolli === void 0 ? true : _ref13$preventScrolli,\n children = _ref13.children,\n noWheelClassName = _ref13.noWheelClassName,\n noPanClassName = _ref13.noPanClassName,\n onViewportChange = _ref13.onViewportChange,\n isControlledViewport = _ref13.isControlledViewport,\n paneClickDistance = _ref13.paneClickDistance;\n var store = useStoreApi();\n var zoomPane = useRef(null);\n\n var _useStore3 = useStore(selector$j, shallow),\n userSelectionActive = _useStore3.userSelectionActive,\n lib = _useStore3.lib;\n\n var zoomActivationKeyPressed = useKeyPress(zoomActivationKeyCode);\n var panZoom = useRef();\n useResizeHandler(zoomPane);\n var onTransformChange = useCallback(function (transform) {\n onViewportChange === null || onViewportChange === void 0 ? void 0 : onViewportChange({\n x: transform[0],\n y: transform[1],\n zoom: transform[2]\n });\n\n if (!isControlledViewport) {\n store.setState({\n transform: transform\n });\n }\n }, [onViewportChange, isControlledViewport]);\n useEffect(function () {\n if (zoomPane.current) {\n panZoom.current = XYPanZoom({\n domNode: zoomPane.current,\n minZoom: minZoom,\n maxZoom: maxZoom,\n translateExtent: translateExtent,\n viewport: defaultViewport,\n paneClickDistance: paneClickDistance,\n onDraggingChange: function onDraggingChange(paneDragging) {\n return store.setState({\n paneDragging: paneDragging\n });\n },\n onPanZoomStart: function onPanZoomStart(event, vp) {\n var _store$getState18 = store.getState(),\n onViewportChangeStart = _store$getState18.onViewportChangeStart,\n onMoveStart = _store$getState18.onMoveStart;\n\n onMoveStart === null || onMoveStart === void 0 ? void 0 : onMoveStart(event, vp);\n onViewportChangeStart === null || onViewportChangeStart === void 0 ? void 0 : onViewportChangeStart(vp);\n },\n onPanZoom: function onPanZoom(event, vp) {\n var _store$getState19 = store.getState(),\n onViewportChange = _store$getState19.onViewportChange,\n onMove = _store$getState19.onMove;\n\n onMove === null || onMove === void 0 ? void 0 : onMove(event, vp);\n onViewportChange === null || onViewportChange === void 0 ? void 0 : onViewportChange(vp);\n },\n onPanZoomEnd: function onPanZoomEnd(event, vp) {\n var _store$getState20 = store.getState(),\n onViewportChangeEnd = _store$getState20.onViewportChangeEnd,\n onMoveEnd = _store$getState20.onMoveEnd;\n\n onMoveEnd === null || onMoveEnd === void 0 ? void 0 : onMoveEnd(event, vp);\n onViewportChangeEnd === null || onViewportChangeEnd === void 0 ? void 0 : onViewportChangeEnd(vp);\n }\n });\n\n var _panZoom$current$getV = panZoom.current.getViewport(),\n x = _panZoom$current$getV.x,\n y = _panZoom$current$getV.y,\n zoom = _panZoom$current$getV.zoom;\n\n store.setState({\n panZoom: panZoom.current,\n transform: [x, y, zoom],\n domNode: zoomPane.current.closest('.react-flow')\n });\n return function () {\n var _panZoom$current;\n\n (_panZoom$current = panZoom.current) === null || _panZoom$current === void 0 ? void 0 : _panZoom$current.destroy();\n };\n }\n }, []);\n useEffect(function () {\n var _panZoom$current2;\n\n (_panZoom$current2 = panZoom.current) === null || _panZoom$current2 === void 0 ? void 0 : _panZoom$current2.update({\n onPaneContextMenu: onPaneContextMenu,\n zoomOnScroll: zoomOnScroll,\n zoomOnPinch: zoomOnPinch,\n panOnScroll: panOnScroll,\n panOnScrollSpeed: panOnScrollSpeed,\n panOnScrollMode: panOnScrollMode,\n zoomOnDoubleClick: zoomOnDoubleClick,\n panOnDrag: panOnDrag,\n zoomActivationKeyPressed: zoomActivationKeyPressed,\n preventScrolling: preventScrolling,\n noPanClassName: noPanClassName,\n userSelectionActive: userSelectionActive,\n noWheelClassName: noWheelClassName,\n lib: lib,\n onTransformChange: onTransformChange\n });\n }, [onPaneContextMenu, zoomOnScroll, zoomOnPinch, panOnScroll, panOnScrollSpeed, panOnScrollMode, zoomOnDoubleClick, panOnDrag, zoomActivationKeyPressed, preventScrolling, noPanClassName, userSelectionActive, noWheelClassName, lib, onTransformChange]);\n return jsx(\"div\", {\n className: \"react-flow__renderer\",\n ref: zoomPane,\n style: containerStyle,\n children: children\n });\n}\n\nvar selector$i = function selector$i(s) {\n return {\n userSelectionActive: s.userSelectionActive,\n userSelectionRect: s.userSelectionRect\n };\n};\n\nfunction UserSelection() {\n var _useStore4 = useStore(selector$i, shallow),\n userSelectionActive = _useStore4.userSelectionActive,\n userSelectionRect = _useStore4.userSelectionRect;\n\n var isActive = userSelectionActive && userSelectionRect;\n\n if (!isActive) {\n return null;\n }\n\n return jsx(\"div\", {\n className: \"react-flow__selection react-flow__container\",\n style: {\n width: userSelectionRect.width,\n height: userSelectionRect.height,\n transform: \"translate(\".concat(userSelectionRect.x, \"px, \").concat(userSelectionRect.y, \"px)\")\n }\n });\n}\n\nvar wrapHandler = function wrapHandler(handler, containerRef) {\n return function (event) {\n if (event.target !== containerRef.current) {\n return;\n }\n\n handler === null || handler === void 0 ? void 0 : handler(event);\n };\n};\n\nvar selector$h = function selector$h(s) {\n return {\n userSelectionActive: s.userSelectionActive,\n elementsSelectable: s.elementsSelectable,\n connectionInProgress: s.connection.inProgress,\n dragging: s.paneDragging\n };\n};\n\nfunction Pane(_ref14) {\n var isSelecting = _ref14.isSelecting,\n selectionKeyPressed = _ref14.selectionKeyPressed,\n _ref14$selectionMode = _ref14.selectionMode,\n selectionMode = _ref14$selectionMode === void 0 ? SelectionMode.Full : _ref14$selectionMode,\n panOnDrag = _ref14.panOnDrag,\n selectionOnDrag = _ref14.selectionOnDrag,\n onSelectionStart = _ref14.onSelectionStart,\n onSelectionEnd = _ref14.onSelectionEnd,\n onPaneClick = _ref14.onPaneClick,\n onPaneContextMenu = _ref14.onPaneContextMenu,\n onPaneScroll = _ref14.onPaneScroll,\n onPaneMouseEnter = _ref14.onPaneMouseEnter,\n onPaneMouseMove = _ref14.onPaneMouseMove,\n onPaneMouseLeave = _ref14.onPaneMouseLeave,\n children = _ref14.children;\n var store = useStoreApi();\n\n var _useStore5 = useStore(selector$h, shallow),\n userSelectionActive = _useStore5.userSelectionActive,\n elementsSelectable = _useStore5.elementsSelectable,\n dragging = _useStore5.dragging,\n connectionInProgress = _useStore5.connectionInProgress;\n\n var hasActiveSelection = elementsSelectable && (isSelecting || userSelectionActive);\n var container = useRef(null);\n var containerBounds = useRef();\n var selectedNodeIds = useRef(new Set());\n var selectedEdgeIds = useRef(new Set()); // Used to prevent click events when the user lets go of the selectionKey during a selection\n\n var selectionInProgress = useRef(false);\n var selectionStarted = useRef(false);\n\n var onClick = function onClick(event) {\n // We prevent click events when the user let go of the selectionKey during a selection\n // We also prevent click events when a connection is in progress\n if (selectionInProgress.current || connectionInProgress) {\n selectionInProgress.current = false;\n return;\n }\n\n onPaneClick === null || onPaneClick === void 0 ? void 0 : onPaneClick(event);\n store.getState().resetSelectedElements();\n store.setState({\n nodesSelectionActive: false\n });\n };\n\n var onContextMenu = function onContextMenu(event) {\n if (Array.isArray(panOnDrag) && panOnDrag !== null && panOnDrag !== void 0 && panOnDrag.includes(2)) {\n event.preventDefault();\n return;\n }\n\n onPaneContextMenu === null || onPaneContextMenu === void 0 ? void 0 : onPaneContextMenu(event);\n };\n\n var onWheel = onPaneScroll ? function (event) {\n return onPaneScroll(event);\n } : undefined;\n\n var onPointerDown = function onPointerDown(event) {\n var _event$target, _event$target$setPoin;\n\n var _store$getState21 = store.getState(),\n resetSelectedElements = _store$getState21.resetSelectedElements,\n domNode = _store$getState21.domNode;\n\n containerBounds.current = domNode === null || domNode === void 0 ? void 0 : domNode.getBoundingClientRect();\n\n if (!elementsSelectable || !isSelecting || event.button !== 0 || event.target !== container.current || !containerBounds.current) {\n return;\n }\n\n (_event$target = event.target) === null || _event$target === void 0 ? void 0 : (_event$target$setPoin = _event$target.setPointerCapture) === null || _event$target$setPoin === void 0 ? void 0 : _event$target$setPoin.call(_event$target, event.pointerId);\n selectionStarted.current = true;\n selectionInProgress.current = false;\n\n var _getEventPosition = getEventPosition(event.nativeEvent, containerBounds.current),\n x = _getEventPosition.x,\n y = _getEventPosition.y;\n\n resetSelectedElements();\n store.setState({\n userSelectionRect: {\n width: 0,\n height: 0,\n startX: x,\n startY: y,\n x: x,\n y: y\n }\n });\n onSelectionStart === null || onSelectionStart === void 0 ? void 0 : onSelectionStart(event);\n };\n\n var onPointerMove = function onPointerMove(event) {\n var _defaultEdgeOptions$s;\n\n var _store$getState22 = store.getState(),\n userSelectionRect = _store$getState22.userSelectionRect,\n transform = _store$getState22.transform,\n nodeLookup = _store$getState22.nodeLookup,\n edgeLookup = _store$getState22.edgeLookup,\n connectionLookup = _store$getState22.connectionLookup,\n triggerNodeChanges = _store$getState22.triggerNodeChanges,\n triggerEdgeChanges = _store$getState22.triggerEdgeChanges,\n defaultEdgeOptions = _store$getState22.defaultEdgeOptions;\n\n if (!containerBounds.current || !userSelectionRect) {\n return;\n }\n\n selectionInProgress.current = true;\n\n var _getEventPosition2 = getEventPosition(event.nativeEvent, containerBounds.current),\n mouseX = _getEventPosition2.x,\n mouseY = _getEventPosition2.y;\n\n var startX = userSelectionRect.startX,\n startY = userSelectionRect.startY;\n var nextUserSelectRect = {\n startX: startX,\n startY: startY,\n x: mouseX < startX ? mouseX : startX,\n y: mouseY < startY ? mouseY : startY,\n width: Math.abs(mouseX - startX),\n height: Math.abs(mouseY - startY)\n };\n var prevSelectedNodeIds = selectedNodeIds.current;\n var prevSelectedEdgeIds = selectedEdgeIds.current;\n selectedNodeIds.current = new Set(getNodesInside(nodeLookup, nextUserSelectRect, transform, selectionMode === SelectionMode.Partial, true).map(function (node) {\n return node.id;\n }));\n selectedEdgeIds.current = new Set();\n var edgesSelectable = (_defaultEdgeOptions$s = defaultEdgeOptions === null || defaultEdgeOptions === void 0 ? void 0 : defaultEdgeOptions.selectable) !== null && _defaultEdgeOptions$s !== void 0 ? _defaultEdgeOptions$s : true; // We look for all edges connected to the selected nodes\n\n var _iterator12 = _createForOfIteratorHelper(selectedNodeIds.current),\n _step12;\n\n try {\n for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {\n var nodeId = _step12.value;\n var connections = connectionLookup.get(nodeId);\n if (!connections) continue;\n\n var _iterator13 = _createForOfIteratorHelper(connections.values()),\n _step13;\n\n try {\n for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {\n var _edge$selectable;\n\n var edgeId = _step13.value.edgeId;\n var edge = edgeLookup.get(edgeId);\n\n if (edge && ((_edge$selectable = edge.selectable) !== null && _edge$selectable !== void 0 ? _edge$selectable : edgesSelectable)) {\n selectedEdgeIds.current.add(edgeId);\n }\n }\n } catch (err) {\n _iterator13.e(err);\n } finally {\n _iterator13.f();\n }\n }\n } catch (err) {\n _iterator12.e(err);\n } finally {\n _iterator12.f();\n }\n\n if (!areSetsEqual(prevSelectedNodeIds, selectedNodeIds.current)) {\n var changes = getSelectionChanges(nodeLookup, selectedNodeIds.current, true);\n triggerNodeChanges(changes);\n }\n\n if (!areSetsEqual(prevSelectedEdgeIds, selectedEdgeIds.current)) {\n var _changes2 = getSelectionChanges(edgeLookup, selectedEdgeIds.current);\n\n triggerEdgeChanges(_changes2);\n }\n\n store.setState({\n userSelectionRect: nextUserSelectRect,\n userSelectionActive: true,\n nodesSelectionActive: false\n });\n };\n\n var onPointerUp = function onPointerUp(event) {\n var _event$target2, _event$target2$releas;\n\n if (event.button !== 0 || !selectionStarted.current) {\n return;\n }\n\n (_event$target2 = event.target) === null || _event$target2 === void 0 ? void 0 : (_event$target2$releas = _event$target2.releasePointerCapture) === null || _event$target2$releas === void 0 ? void 0 : _event$target2$releas.call(_event$target2, event.pointerId);\n\n var _store$getState23 = store.getState(),\n userSelectionRect = _store$getState23.userSelectionRect;\n /*\n * We only want to trigger click functions when in selection mode if\n * the user did not move the mouse.\n */\n\n\n if (!userSelectionActive && userSelectionRect && event.target === container.current) {\n onClick === null || onClick === void 0 ? void 0 : onClick(event);\n }\n\n store.setState({\n userSelectionActive: false,\n userSelectionRect: null,\n nodesSelectionActive: selectedNodeIds.current.size > 0\n });\n onSelectionEnd === null || onSelectionEnd === void 0 ? void 0 : onSelectionEnd(event);\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 */\n\n if (selectionKeyPressed || selectionOnDrag) {\n selectionInProgress.current = false;\n }\n\n selectionStarted.current = false;\n };\n\n var draggable = panOnDrag === true || Array.isArray(panOnDrag) && panOnDrag.includes(0);\n return jsxs(\"div\", {\n className: cc(['react-flow__pane', {\n draggable: draggable,\n dragging: dragging,\n selection: isSelecting\n }]),\n onClick: hasActiveSelection ? undefined : wrapHandler(onClick, container),\n onContextMenu: wrapHandler(onContextMenu, container),\n onWheel: wrapHandler(onWheel, container),\n onPointerEnter: hasActiveSelection ? undefined : onPaneMouseEnter,\n onPointerDown: hasActiveSelection ? onPointerDown : onPaneMouseMove,\n onPointerMove: hasActiveSelection ? onPointerMove : onPaneMouseMove,\n onPointerUp: hasActiveSelection ? onPointerUp : undefined,\n onPointerLeave: onPaneMouseLeave,\n ref: container,\n style: containerStyle,\n children: [children, jsx(UserSelection, {})]\n });\n}\n/*\n * this handler is called by\n * 1. the click handler when node is not draggable or selectNodesOnDrag = false\n * or\n * 2. the on drag start handler when node is draggable and selectNodesOnDrag = true\n */\n\n\nfunction handleNodeClick(_ref15) {\n var id = _ref15.id,\n store = _ref15.store,\n _ref15$unselect = _ref15.unselect,\n unselect = _ref15$unselect === void 0 ? false : _ref15$unselect,\n nodeRef = _ref15.nodeRef;\n\n var _store$getState24 = store.getState(),\n addSelectedNodes = _store$getState24.addSelectedNodes,\n unselectNodesAndEdges = _store$getState24.unselectNodesAndEdges,\n multiSelectionActive = _store$getState24.multiSelectionActive,\n nodeLookup = _store$getState24.nodeLookup,\n onError = _store$getState24.onError;\n\n var node = nodeLookup.get(id);\n\n if (!node) {\n onError === null || onError === void 0 ? void 0 : onError('012', errorMessages['error012'](id));\n return;\n }\n\n store.setState({\n nodesSelectionActive: false\n });\n\n if (!node.selected) {\n addSelectedNodes([id]);\n } else if (unselect || node.selected && multiSelectionActive) {\n unselectNodesAndEdges({\n nodes: [node],\n edges: []\n });\n requestAnimationFrame(function () {\n var _nodeRef$current;\n\n return nodeRef === null || nodeRef === void 0 ? void 0 : (_nodeRef$current = nodeRef.current) === null || _nodeRef$current === void 0 ? void 0 : _nodeRef$current.blur();\n });\n }\n}\n/**\n * Hook for calling XYDrag helper from @xyflow/system.\n *\n * @internal\n */\n\n\nfunction useDrag(_ref16) {\n var nodeRef = _ref16.nodeRef,\n _ref16$disabled = _ref16.disabled,\n disabled = _ref16$disabled === void 0 ? false : _ref16$disabled,\n noDragClassName = _ref16.noDragClassName,\n handleSelector = _ref16.handleSelector,\n nodeId = _ref16.nodeId,\n isSelectable = _ref16.isSelectable,\n nodeClickDistance = _ref16.nodeClickDistance;\n var store = useStoreApi();\n\n var _useState9 = useState(false),\n _useState10 = _slicedToArray(_useState9, 2),\n dragging = _useState10[0],\n setDragging = _useState10[1];\n\n var xyDrag = useRef();\n useEffect(function () {\n xyDrag.current = XYDrag({\n getStoreItems: function getStoreItems() {\n return store.getState();\n },\n onNodeMouseDown: function onNodeMouseDown(id) {\n handleNodeClick({\n id: id,\n store: store,\n nodeRef: nodeRef\n });\n },\n onDragStart: function onDragStart() {\n setDragging(true);\n },\n onDragStop: function onDragStop() {\n setDragging(false);\n }\n });\n }, []);\n useEffect(function () {\n if (disabled) {\n var _xyDrag$current;\n\n (_xyDrag$current = xyDrag.current) === null || _xyDrag$current === void 0 ? void 0 : _xyDrag$current.destroy();\n } else if (nodeRef.current) {\n var _xyDrag$current2;\n\n (_xyDrag$current2 = xyDrag.current) === null || _xyDrag$current2 === void 0 ? void 0 : _xyDrag$current2.update({\n noDragClassName: noDragClassName,\n handleSelector: handleSelector,\n domNode: nodeRef.current,\n isSelectable: isSelectable,\n nodeId: nodeId,\n nodeClickDistance: nodeClickDistance\n });\n return function () {\n var _xyDrag$current3;\n\n (_xyDrag$current3 = xyDrag.current) === null || _xyDrag$current3 === void 0 ? void 0 : _xyDrag$current3.destroy();\n };\n }\n }, [noDragClassName, handleSelector, disabled, isSelectable, nodeRef, nodeId]);\n return dragging;\n}\n\nvar selectedAndDraggable = function selectedAndDraggable(nodesDraggable) {\n return function (n) {\n return n.selected && (n.draggable || nodesDraggable && typeof n.draggable === 'undefined');\n };\n};\n/**\n * Hook for updating node positions by passing a direction and factor\n *\n * @internal\n * @returns function for updating node positions\n */\n\n\nfunction useMoveSelectedNodes() {\n var store = useStoreApi();\n var moveSelectedNodes = useCallback(function (params) {\n var _store$getState25 = store.getState(),\n nodeExtent = _store$getState25.nodeExtent,\n snapToGrid = _store$getState25.snapToGrid,\n snapGrid = _store$getState25.snapGrid,\n nodesDraggable = _store$getState25.nodesDraggable,\n onError = _store$getState25.onError,\n updateNodePositions = _store$getState25.updateNodePositions,\n nodeLookup = _store$getState25.nodeLookup,\n nodeOrigin = _store$getState25.nodeOrigin;\n\n var nodeUpdates = new Map();\n var isSelected = selectedAndDraggable(nodesDraggable);\n /*\n * by default a node moves 5px on each key press\n * if snap grid is enabled, we use that for the velocity\n */\n\n var xVelo = snapToGrid ? snapGrid[0] : 5;\n var yVelo = snapToGrid ? snapGrid[1] : 5;\n var xDiff = params.direction.x * xVelo * params.factor;\n var yDiff = params.direction.y * yVelo * params.factor;\n\n var _iterator14 = _createForOfIteratorHelper(nodeLookup),\n _step14;\n\n try {\n for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {\n var _step14$value = _slicedToArray(_step14.value, 2),\n node = _step14$value[1];\n\n if (!isSelected(node)) {\n continue;\n }\n\n var nextPosition = {\n x: node.internals.positionAbsolute.x + xDiff,\n y: node.internals.positionAbsolute.y + yDiff\n };\n\n if (snapToGrid) {\n nextPosition = snapPosition(nextPosition, snapGrid);\n }\n\n var _calculateNodePositio = calculateNodePosition({\n nodeId: node.id,\n nextPosition: nextPosition,\n nodeLookup: nodeLookup,\n nodeExtent: nodeExtent,\n nodeOrigin: nodeOrigin,\n onError: onError\n }),\n position = _calculateNodePositio.position,\n positionAbsolute = _calculateNodePositio.positionAbsolute;\n\n node.position = position;\n node.internals.positionAbsolute = positionAbsolute;\n nodeUpdates.set(node.id, node);\n }\n } catch (err) {\n _iterator14.e(err);\n } finally {\n _iterator14.f();\n }\n\n updateNodePositions(nodeUpdates);\n }, []);\n return moveSelectedNodes;\n}\n\nvar NodeIdContext = createContext(null);\nvar Provider = NodeIdContext.Provider;\nNodeIdContext.Consumer;\n/**\n * You can use this hook to get the id of the node it is used inside. It is useful\n * if you need the node's id deeper in the render tree but don't want to manually\n * drill down the id as a prop.\n *\n * @public\n * @returns id of the node\n *\n * @example\n *```jsx\n *import { useNodeId } from '@xyflow/react';\n *\n *export default function CustomNode() {\n * return (\n *
\n * This node has an id of \n * \n *
\n * );\n *}\n *\n *function NodeIdDisplay() {\n * const nodeId = useNodeId();\n *\n * return {nodeId};\n *}\n *```\n */\n\nvar useNodeId = function useNodeId() {\n var nodeId = useContext(NodeIdContext);\n return nodeId;\n};\n\nvar selector$g = function selector$g(s) {\n return {\n connectOnClick: s.connectOnClick,\n noPanClassName: s.noPanClassName,\n rfId: s.rfId\n };\n};\n\nvar connectingSelector = function connectingSelector(nodeId, handleId, type) {\n return function (state) {\n var clickHandle = state.connectionClickStartHandle,\n connectionMode = state.connectionMode,\n connection = state.connection;\n var fromHandle = connection.fromHandle,\n toHandle = connection.toHandle,\n isValid = connection.isValid;\n var connectingTo = (toHandle === null || toHandle === void 0 ? void 0 : toHandle.nodeId) === nodeId && (toHandle === null || toHandle === void 0 ? void 0 : toHandle.id) === handleId && (toHandle === null || toHandle === void 0 ? void 0 : toHandle.type) === type;\n return {\n connectingFrom: (fromHandle === null || fromHandle === void 0 ? void 0 : fromHandle.nodeId) === nodeId && (fromHandle === null || fromHandle === void 0 ? void 0 : fromHandle.id) === handleId && (fromHandle === null || fromHandle === void 0 ? void 0 : fromHandle.type) === type,\n connectingTo: connectingTo,\n clickConnecting: (clickHandle === null || clickHandle === void 0 ? void 0 : clickHandle.nodeId) === nodeId && (clickHandle === null || clickHandle === void 0 ? void 0 : clickHandle.id) === handleId && (clickHandle === null || clickHandle === void 0 ? void 0 : clickHandle.type) === type,\n isPossibleEndHandle: connectionMode === ConnectionMode.Strict ? (fromHandle === null || fromHandle === void 0 ? void 0 : fromHandle.type) !== type : nodeId !== (fromHandle === null || fromHandle === void 0 ? void 0 : fromHandle.nodeId) || handleId !== (fromHandle === null || fromHandle === void 0 ? void 0 : fromHandle.id),\n connectionInProcess: !!fromHandle,\n clickConnectionInProcess: !!clickHandle,\n valid: connectingTo && isValid\n };\n };\n};\n\nfunction HandleComponent(_ref17, ref) {\n var _ref17$type = _ref17.type,\n type = _ref17$type === void 0 ? 'source' : _ref17$type,\n _ref17$position = _ref17.position,\n position = _ref17$position === void 0 ? Position.Top : _ref17$position,\n isValidConnection = _ref17.isValidConnection,\n _ref17$isConnectable = _ref17.isConnectable,\n isConnectable = _ref17$isConnectable === void 0 ? true : _ref17$isConnectable,\n _ref17$isConnectableS = _ref17.isConnectableStart,\n isConnectableStart = _ref17$isConnectableS === void 0 ? true : _ref17$isConnectableS,\n _ref17$isConnectableE = _ref17.isConnectableEnd,\n isConnectableEnd = _ref17$isConnectableE === void 0 ? true : _ref17$isConnectableE,\n id = _ref17.id,\n onConnect = _ref17.onConnect,\n children = _ref17.children,\n className = _ref17.className,\n onMouseDown = _ref17.onMouseDown,\n onTouchStart = _ref17.onTouchStart,\n rest = _objectWithoutProperties(_ref17, _excluded2);\n\n var handleId = id || null;\n var isTarget = type === 'target';\n var store = useStoreApi();\n var nodeId = useNodeId();\n\n var _useStore6 = useStore(selector$g, shallow),\n connectOnClick = _useStore6.connectOnClick,\n noPanClassName = _useStore6.noPanClassName,\n rfId = _useStore6.rfId;\n\n var _useStore7 = useStore(connectingSelector(nodeId, handleId, type), shallow),\n connectingFrom = _useStore7.connectingFrom,\n connectingTo = _useStore7.connectingTo,\n clickConnecting = _useStore7.clickConnecting,\n isPossibleEndHandle = _useStore7.isPossibleEndHandle,\n connectionInProcess = _useStore7.connectionInProcess,\n clickConnectionInProcess = _useStore7.clickConnectionInProcess,\n valid = _useStore7.valid;\n\n if (!nodeId) {\n var _store$getState$onErr2, _store$getState26;\n\n (_store$getState$onErr2 = (_store$getState26 = store.getState()).onError) === null || _store$getState$onErr2 === void 0 ? void 0 : _store$getState$onErr2.call(_store$getState26, '010', errorMessages['error010']());\n }\n\n var onConnectExtended = function onConnectExtended(params) {\n var _store$getState27 = store.getState(),\n defaultEdgeOptions = _store$getState27.defaultEdgeOptions,\n onConnectAction = _store$getState27.onConnect,\n hasDefaultEdges = _store$getState27.hasDefaultEdges;\n\n var edgeParams = _objectSpread(_objectSpread({}, defaultEdgeOptions), params);\n\n if (hasDefaultEdges) {\n var _store$getState28 = store.getState(),\n edges = _store$getState28.edges,\n setEdges = _store$getState28.setEdges;\n\n setEdges(addEdge(edgeParams, edges));\n }\n\n onConnectAction === null || onConnectAction === void 0 ? void 0 : onConnectAction(edgeParams);\n onConnect === null || onConnect === void 0 ? void 0 : onConnect(edgeParams);\n };\n\n var onPointerDown = function onPointerDown(event) {\n if (!nodeId) {\n return;\n }\n\n var isMouseTriggered = isMouseEvent(event.nativeEvent);\n\n if (isConnectableStart && (isMouseTriggered && event.button === 0 || !isMouseTriggered)) {\n var currentStore = store.getState();\n XYHandle.onPointerDown(event.nativeEvent, {\n autoPanOnConnect: currentStore.autoPanOnConnect,\n connectionMode: currentStore.connectionMode,\n connectionRadius: currentStore.connectionRadius,\n domNode: currentStore.domNode,\n nodeLookup: currentStore.nodeLookup,\n lib: currentStore.lib,\n isTarget: isTarget,\n handleId: handleId,\n nodeId: nodeId,\n flowId: currentStore.rfId,\n panBy: currentStore.panBy,\n cancelConnection: currentStore.cancelConnection,\n onConnectStart: currentStore.onConnectStart,\n onConnectEnd: currentStore.onConnectEnd,\n updateConnection: currentStore.updateConnection,\n onConnect: onConnectExtended,\n isValidConnection: isValidConnection || currentStore.isValidConnection,\n getTransform: function getTransform() {\n return store.getState().transform;\n },\n getFromHandle: function getFromHandle() {\n return store.getState().connection.fromHandle;\n },\n autoPanSpeed: currentStore.autoPanSpeed\n });\n }\n\n if (isMouseTriggered) {\n onMouseDown === null || onMouseDown === void 0 ? void 0 : onMouseDown(event);\n } else {\n onTouchStart === null || onTouchStart === void 0 ? void 0 : onTouchStart(event);\n }\n };\n\n var onClick = function onClick(event) {\n var _store$getState29 = store.getState(),\n onClickConnectStart = _store$getState29.onClickConnectStart,\n onClickConnectEnd = _store$getState29.onClickConnectEnd,\n connectionClickStartHandle = _store$getState29.connectionClickStartHandle,\n connectionMode = _store$getState29.connectionMode,\n isValidConnectionStore = _store$getState29.isValidConnection,\n lib = _store$getState29.lib,\n flowId = _store$getState29.rfId,\n nodeLookup = _store$getState29.nodeLookup,\n connectionState = _store$getState29.connection;\n\n if (!nodeId || !connectionClickStartHandle && !isConnectableStart) {\n return;\n }\n\n if (!connectionClickStartHandle) {\n onClickConnectStart === null || onClickConnectStart === void 0 ? void 0 : onClickConnectStart(event.nativeEvent, {\n nodeId: nodeId,\n handleId: handleId,\n handleType: type\n });\n store.setState({\n connectionClickStartHandle: {\n nodeId: nodeId,\n type: type,\n id: handleId\n }\n });\n return;\n }\n\n var doc = getHostForElement(event.target);\n var isValidConnectionHandler = isValidConnection || isValidConnectionStore;\n\n var _XYHandle$isValid = XYHandle.isValid(event.nativeEvent, {\n handle: {\n nodeId: nodeId,\n id: handleId,\n type: type\n },\n connectionMode: connectionMode,\n fromNodeId: connectionClickStartHandle.nodeId,\n fromHandleId: connectionClickStartHandle.id || null,\n fromType: connectionClickStartHandle.type,\n isValidConnection: isValidConnectionHandler,\n flowId: flowId,\n doc: doc,\n lib: lib,\n nodeLookup: nodeLookup\n }),\n connection = _XYHandle$isValid.connection,\n isValid = _XYHandle$isValid.isValid;\n\n if (isValid && connection) {\n onConnectExtended(connection);\n }\n\n var connectionClone = structuredClone(connectionState);\n delete connectionClone.inProgress;\n connectionClone.toPosition = connectionClone.toHandle ? connectionClone.toHandle.position : null;\n onClickConnectEnd === null || onClickConnectEnd === void 0 ? void 0 : onClickConnectEnd(event, connectionClone);\n store.setState({\n connectionClickStartHandle: null\n });\n };\n\n return jsx(\"div\", _objectSpread(_objectSpread({\n \"data-handleid\": handleId,\n \"data-nodeid\": nodeId,\n \"data-handlepos\": position,\n \"data-id\": \"\".concat(rfId, \"-\").concat(nodeId, \"-\").concat(handleId, \"-\").concat(type),\n className: cc(['react-flow__handle', \"react-flow__handle-\".concat(position), 'nodrag', noPanClassName, className, {\n source: !isTarget,\n target: isTarget,\n connectable: isConnectable,\n connectablestart: isConnectableStart,\n connectableend: isConnectableEnd,\n clickconnecting: clickConnecting,\n connectingfrom: connectingFrom,\n connectingto: connectingTo,\n valid: valid,\n\n /*\n * shows where you can start a connection from\n * and where you can end it while connecting\n */\n connectionindicator: isConnectable && (!connectionInProcess || isPossibleEndHandle) && (connectionInProcess || clickConnectionInProcess ? isConnectableEnd : isConnectableStart)\n }]),\n onMouseDown: onPointerDown,\n onTouchStart: onPointerDown,\n onClick: connectOnClick ? onClick : undefined,\n ref: ref\n }, rest), {}, {\n children: children\n }));\n}\n/**\n * The `` component is used in your [custom nodes](/learn/customization/custom-nodes)\n * to define connection points.\n *\n *@public\n *\n *@example\n *\n *```jsx\n *import { Handle, Position } from '@xyflow/react';\n *\n *export function CustomNode({ data }) {\n * return (\n * <>\n *
\n * {data.label}\n *
\n *\n * \n * \n * \n * );\n *};\n *```\n */\n\n\nvar Handle = memo(fixedForwardRef(HandleComponent));\n\nfunction InputNode(_ref18) {\n var data = _ref18.data,\n isConnectable = _ref18.isConnectable,\n _ref18$sourcePosition = _ref18.sourcePosition,\n sourcePosition = _ref18$sourcePosition === void 0 ? Position.Bottom : _ref18$sourcePosition;\n return jsxs(Fragment, {\n children: [data === null || data === void 0 ? void 0 : data.label, jsx(Handle, {\n type: \"source\",\n position: sourcePosition,\n isConnectable: isConnectable\n })]\n });\n}\n\nfunction DefaultNode(_ref19) {\n var data = _ref19.data,\n isConnectable = _ref19.isConnectable,\n _ref19$targetPosition = _ref19.targetPosition,\n targetPosition = _ref19$targetPosition === void 0 ? Position.Top : _ref19$targetPosition,\n _ref19$sourcePosition = _ref19.sourcePosition,\n sourcePosition = _ref19$sourcePosition === void 0 ? Position.Bottom : _ref19$sourcePosition;\n return jsxs(Fragment, {\n children: [jsx(Handle, {\n type: \"target\",\n position: targetPosition,\n isConnectable: isConnectable\n }), data === null || data === void 0 ? void 0 : data.label, jsx(Handle, {\n type: \"source\",\n position: sourcePosition,\n isConnectable: isConnectable\n })]\n });\n}\n\nfunction GroupNode() {\n return null;\n}\n\nfunction OutputNode(_ref20) {\n var data = _ref20.data,\n isConnectable = _ref20.isConnectable,\n _ref20$targetPosition = _ref20.targetPosition,\n targetPosition = _ref20$targetPosition === void 0 ? Position.Top : _ref20$targetPosition;\n return jsxs(Fragment, {\n children: [jsx(Handle, {\n type: \"target\",\n position: targetPosition,\n isConnectable: isConnectable\n }), data === null || data === void 0 ? void 0 : data.label]\n });\n}\n\nvar arrowKeyDiffs = {\n ArrowUp: {\n x: 0,\n y: -1\n },\n ArrowDown: {\n x: 0,\n y: 1\n },\n ArrowLeft: {\n x: -1,\n y: 0\n },\n ArrowRight: {\n x: 1,\n y: 0\n }\n};\nvar builtinNodeTypes = {\n input: InputNode,\n default: DefaultNode,\n output: OutputNode,\n group: GroupNode\n};\n\nfunction getNodeInlineStyleDimensions(node) {\n var _node$width2, _node$style3, _node$height2, _node$style4;\n\n if (node.internals.handleBounds === undefined) {\n var _ref21, _node$width, _node$style, _ref22, _node$height, _node$style2;\n\n return {\n width: (_ref21 = (_node$width = node.width) !== null && _node$width !== void 0 ? _node$width : node.initialWidth) !== null && _ref21 !== void 0 ? _ref21 : (_node$style = node.style) === null || _node$style === void 0 ? void 0 : _node$style.width,\n height: (_ref22 = (_node$height = node.height) !== null && _node$height !== void 0 ? _node$height : node.initialHeight) !== null && _ref22 !== void 0 ? _ref22 : (_node$style2 = node.style) === null || _node$style2 === void 0 ? void 0 : _node$style2.height\n };\n }\n\n return {\n width: (_node$width2 = node.width) !== null && _node$width2 !== void 0 ? _node$width2 : (_node$style3 = node.style) === null || _node$style3 === void 0 ? void 0 : _node$style3.width,\n height: (_node$height2 = node.height) !== null && _node$height2 !== void 0 ? _node$height2 : (_node$style4 = node.style) === null || _node$style4 === void 0 ? void 0 : _node$style4.height\n };\n}\n\nvar selector$f = function selector$f(s) {\n var _getInternalNodesBoun = getInternalNodesBounds(s.nodeLookup, {\n filter: function filter(node) {\n return !!node.selected;\n }\n }),\n width = _getInternalNodesBoun.width,\n height = _getInternalNodesBoun.height,\n x = _getInternalNodesBoun.x,\n y = _getInternalNodesBoun.y;\n\n return {\n width: isNumeric(width) ? width : null,\n height: isNumeric(height) ? height : null,\n userSelectionActive: s.userSelectionActive,\n transformString: \"translate(\".concat(s.transform[0], \"px,\").concat(s.transform[1], \"px) scale(\").concat(s.transform[2], \") translate(\").concat(x, \"px,\").concat(y, \"px)\")\n };\n};\n\nfunction NodesSelection(_ref23) {\n var onSelectionContextMenu = _ref23.onSelectionContextMenu,\n noPanClassName = _ref23.noPanClassName,\n disableKeyboardA11y = _ref23.disableKeyboardA11y;\n var store = useStoreApi();\n\n var _useStore8 = useStore(selector$f, shallow),\n width = _useStore8.width,\n height = _useStore8.height,\n transformString = _useStore8.transformString,\n userSelectionActive = _useStore8.userSelectionActive;\n\n var moveSelectedNodes = useMoveSelectedNodes();\n var nodeRef = useRef(null);\n useEffect(function () {\n if (!disableKeyboardA11y) {\n var _nodeRef$current2;\n\n (_nodeRef$current2 = nodeRef.current) === null || _nodeRef$current2 === void 0 ? void 0 : _nodeRef$current2.focus({\n preventScroll: true\n });\n }\n }, [disableKeyboardA11y]);\n useDrag({\n nodeRef: nodeRef\n });\n\n if (userSelectionActive || !width || !height) {\n return null;\n }\n\n var onContextMenu = onSelectionContextMenu ? function (event) {\n var selectedNodes = store.getState().nodes.filter(function (n) {\n return n.selected;\n });\n onSelectionContextMenu(event, selectedNodes);\n } : undefined;\n\n var onKeyDown = function onKeyDown(event) {\n if (Object.prototype.hasOwnProperty.call(arrowKeyDiffs, event.key)) {\n event.preventDefault();\n moveSelectedNodes({\n direction: arrowKeyDiffs[event.key],\n factor: event.shiftKey ? 4 : 1\n });\n }\n };\n\n return jsx(\"div\", {\n className: cc(['react-flow__nodesselection', 'react-flow__container', noPanClassName]),\n style: {\n transform: transformString\n },\n children: jsx(\"div\", {\n ref: nodeRef,\n className: \"react-flow__nodesselection-rect\",\n onContextMenu: onContextMenu,\n tabIndex: disableKeyboardA11y ? undefined : -1,\n onKeyDown: disableKeyboardA11y ? undefined : onKeyDown,\n style: {\n width: width,\n height: height\n }\n })\n });\n}\n\nvar win = typeof window !== 'undefined' ? window : undefined;\n\nvar selector$e = function selector$e(s) {\n return {\n nodesSelectionActive: s.nodesSelectionActive,\n userSelectionActive: s.userSelectionActive\n };\n};\n\nfunction FlowRendererComponent(_ref24) {\n var children = _ref24.children,\n onPaneClick = _ref24.onPaneClick,\n onPaneMouseEnter = _ref24.onPaneMouseEnter,\n onPaneMouseMove = _ref24.onPaneMouseMove,\n onPaneMouseLeave = _ref24.onPaneMouseLeave,\n onPaneContextMenu = _ref24.onPaneContextMenu,\n onPaneScroll = _ref24.onPaneScroll,\n paneClickDistance = _ref24.paneClickDistance,\n deleteKeyCode = _ref24.deleteKeyCode,\n selectionKeyCode = _ref24.selectionKeyCode,\n selectionOnDrag = _ref24.selectionOnDrag,\n selectionMode = _ref24.selectionMode,\n onSelectionStart = _ref24.onSelectionStart,\n onSelectionEnd = _ref24.onSelectionEnd,\n multiSelectionKeyCode = _ref24.multiSelectionKeyCode,\n panActivationKeyCode = _ref24.panActivationKeyCode,\n zoomActivationKeyCode = _ref24.zoomActivationKeyCode,\n elementsSelectable = _ref24.elementsSelectable,\n zoomOnScroll = _ref24.zoomOnScroll,\n zoomOnPinch = _ref24.zoomOnPinch,\n _panOnScroll = _ref24.panOnScroll,\n panOnScrollSpeed = _ref24.panOnScrollSpeed,\n panOnScrollMode = _ref24.panOnScrollMode,\n zoomOnDoubleClick = _ref24.zoomOnDoubleClick,\n _panOnDrag = _ref24.panOnDrag,\n defaultViewport = _ref24.defaultViewport,\n translateExtent = _ref24.translateExtent,\n minZoom = _ref24.minZoom,\n maxZoom = _ref24.maxZoom,\n preventScrolling = _ref24.preventScrolling,\n onSelectionContextMenu = _ref24.onSelectionContextMenu,\n noWheelClassName = _ref24.noWheelClassName,\n noPanClassName = _ref24.noPanClassName,\n disableKeyboardA11y = _ref24.disableKeyboardA11y,\n onViewportChange = _ref24.onViewportChange,\n isControlledViewport = _ref24.isControlledViewport;\n\n var _useStore9 = useStore(selector$e),\n nodesSelectionActive = _useStore9.nodesSelectionActive,\n userSelectionActive = _useStore9.userSelectionActive;\n\n var selectionKeyPressed = useKeyPress(selectionKeyCode, {\n target: win\n });\n var panActivationKeyPressed = useKeyPress(panActivationKeyCode, {\n target: win\n });\n var panOnDrag = panActivationKeyPressed || _panOnDrag;\n var panOnScroll = panActivationKeyPressed || _panOnScroll;\n\n var _selectionOnDrag = selectionOnDrag && panOnDrag !== true;\n\n var isSelecting = selectionKeyPressed || userSelectionActive || _selectionOnDrag;\n useGlobalKeyHandler({\n deleteKeyCode: deleteKeyCode,\n multiSelectionKeyCode: multiSelectionKeyCode\n });\n return jsx(ZoomPane, {\n onPaneContextMenu: onPaneContextMenu,\n elementsSelectable: elementsSelectable,\n zoomOnScroll: zoomOnScroll,\n zoomOnPinch: zoomOnPinch,\n panOnScroll: panOnScroll,\n panOnScrollSpeed: panOnScrollSpeed,\n panOnScrollMode: panOnScrollMode,\n zoomOnDoubleClick: zoomOnDoubleClick,\n panOnDrag: !selectionKeyPressed && panOnDrag,\n defaultViewport: defaultViewport,\n translateExtent: translateExtent,\n minZoom: minZoom,\n maxZoom: maxZoom,\n zoomActivationKeyCode: zoomActivationKeyCode,\n preventScrolling: preventScrolling,\n noWheelClassName: noWheelClassName,\n noPanClassName: noPanClassName,\n onViewportChange: onViewportChange,\n isControlledViewport: isControlledViewport,\n paneClickDistance: paneClickDistance,\n children: jsxs(Pane, {\n onSelectionStart: onSelectionStart,\n onSelectionEnd: onSelectionEnd,\n onPaneClick: onPaneClick,\n onPaneMouseEnter: onPaneMouseEnter,\n onPaneMouseMove: onPaneMouseMove,\n onPaneMouseLeave: onPaneMouseLeave,\n onPaneContextMenu: onPaneContextMenu,\n onPaneScroll: onPaneScroll,\n panOnDrag: panOnDrag,\n isSelecting: !!isSelecting,\n selectionMode: selectionMode,\n selectionKeyPressed: selectionKeyPressed,\n selectionOnDrag: _selectionOnDrag,\n children: [children, nodesSelectionActive && jsx(NodesSelection, {\n onSelectionContextMenu: onSelectionContextMenu,\n noPanClassName: noPanClassName,\n disableKeyboardA11y: disableKeyboardA11y\n })]\n })\n });\n}\n\nFlowRendererComponent.displayName = 'FlowRenderer';\nvar FlowRenderer = memo(FlowRendererComponent);\n\nvar selector$d = function selector$d(onlyRenderVisible) {\n return function (s) {\n return onlyRenderVisible ? getNodesInside(s.nodeLookup, {\n x: 0,\n y: 0,\n width: s.width,\n height: s.height\n }, s.transform, true).map(function (node) {\n return node.id;\n }) : Array.from(s.nodeLookup.keys());\n };\n};\n/**\n * Hook for getting the visible node ids from the store.\n *\n * @internal\n * @param onlyRenderVisible\n * @returns array with visible node ids\n */\n\n\nfunction useVisibleNodeIds(onlyRenderVisible) {\n var nodeIds = useStore(useCallback(selector$d(onlyRenderVisible), [onlyRenderVisible]), shallow);\n return nodeIds;\n}\n\nvar selector$c = function selector$c(s) {\n return s.updateNodeInternals;\n};\n\nfunction useResizeObserver() {\n var updateNodeInternals = useStore(selector$c);\n\n var _useState11 = useState(function () {\n if (typeof ResizeObserver === 'undefined') {\n return null;\n }\n\n return new ResizeObserver(function (entries) {\n var updates = new Map();\n entries.forEach(function (entry) {\n var id = entry.target.getAttribute('data-id');\n updates.set(id, {\n id: id,\n nodeElement: entry.target,\n force: true\n });\n });\n updateNodeInternals(updates);\n });\n }),\n _useState12 = _slicedToArray(_useState11, 1),\n resizeObserver = _useState12[0];\n\n useEffect(function () {\n return function () {\n resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.disconnect();\n };\n }, [resizeObserver]);\n return resizeObserver;\n}\n/**\n * Hook to handle the resize observation + internal updates for the passed node.\n *\n * @internal\n * @returns nodeRef - reference to the node element\n */\n\n\nfunction useNodeObserver(_ref25) {\n var node = _ref25.node,\n nodeType = _ref25.nodeType,\n hasDimensions = _ref25.hasDimensions,\n resizeObserver = _ref25.resizeObserver;\n var store = useStoreApi();\n var nodeRef = useRef(null);\n var observedNode = useRef(null);\n var prevSourcePosition = useRef(node.sourcePosition);\n var prevTargetPosition = useRef(node.targetPosition);\n var prevType = useRef(nodeType);\n var isInitialized = hasDimensions && !!node.internals.handleBounds;\n useEffect(function () {\n if (nodeRef.current && !node.hidden && (!isInitialized || observedNode.current !== nodeRef.current)) {\n if (observedNode.current) {\n resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.unobserve(observedNode.current);\n }\n\n resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.observe(nodeRef.current);\n observedNode.current = nodeRef.current;\n }\n }, [isInitialized, node.hidden]);\n useEffect(function () {\n return function () {\n if (observedNode.current) {\n resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.unobserve(observedNode.current);\n observedNode.current = null;\n }\n };\n }, []);\n useEffect(function () {\n if (nodeRef.current) {\n /*\n * when the user programmatically changes the source or handle position, we need to update the internals\n * to make sure the edges are updated correctly\n */\n var typeChanged = prevType.current !== nodeType;\n var sourcePosChanged = prevSourcePosition.current !== node.sourcePosition;\n var targetPosChanged = prevTargetPosition.current !== node.targetPosition;\n\n if (typeChanged || sourcePosChanged || targetPosChanged) {\n prevType.current = nodeType;\n prevSourcePosition.current = node.sourcePosition;\n prevTargetPosition.current = node.targetPosition;\n store.getState().updateNodeInternals(new Map([[node.id, {\n id: node.id,\n nodeElement: nodeRef.current,\n force: true\n }]]));\n }\n }\n }, [node.id, nodeType, node.sourcePosition, node.targetPosition]);\n return nodeRef;\n}\n\nfunction NodeWrapper(_ref26) {\n var _node$selected, _node$deletable;\n\n var id = _ref26.id,\n onClick = _ref26.onClick,\n onMouseEnter = _ref26.onMouseEnter,\n onMouseMove = _ref26.onMouseMove,\n onMouseLeave = _ref26.onMouseLeave,\n onContextMenu = _ref26.onContextMenu,\n onDoubleClick = _ref26.onDoubleClick,\n nodesDraggable = _ref26.nodesDraggable,\n elementsSelectable = _ref26.elementsSelectable,\n nodesConnectable = _ref26.nodesConnectable,\n nodesFocusable = _ref26.nodesFocusable,\n resizeObserver = _ref26.resizeObserver,\n noDragClassName = _ref26.noDragClassName,\n noPanClassName = _ref26.noPanClassName,\n disableKeyboardA11y = _ref26.disableKeyboardA11y,\n rfId = _ref26.rfId,\n nodeTypes = _ref26.nodeTypes,\n nodeClickDistance = _ref26.nodeClickDistance,\n onError = _ref26.onError;\n\n var _useStore10 = useStore(function (s) {\n var node = s.nodeLookup.get(id);\n var isParent = s.parentLookup.has(id);\n return {\n node: node,\n internals: node.internals,\n isParent: isParent\n };\n }, shallow),\n node = _useStore10.node,\n internals = _useStore10.internals,\n isParent = _useStore10.isParent;\n\n var nodeType = node.type || 'default';\n var NodeComponent = (nodeTypes === null || nodeTypes === void 0 ? void 0 : nodeTypes[nodeType]) || builtinNodeTypes[nodeType];\n\n if (NodeComponent === undefined) {\n onError === null || onError === void 0 ? void 0 : onError('003', errorMessages['error003'](nodeType));\n nodeType = 'default';\n NodeComponent = builtinNodeTypes.default;\n }\n\n var isDraggable = !!(node.draggable || nodesDraggable && typeof node.draggable === 'undefined');\n var isSelectable = !!(node.selectable || elementsSelectable && typeof node.selectable === 'undefined');\n var isConnectable = !!(node.connectable || nodesConnectable && typeof node.connectable === 'undefined');\n var isFocusable = !!(node.focusable || nodesFocusable && typeof node.focusable === 'undefined');\n var store = useStoreApi();\n var hasDimensions = nodeHasDimensions(node);\n var nodeRef = useNodeObserver({\n node: node,\n nodeType: nodeType,\n hasDimensions: hasDimensions,\n resizeObserver: resizeObserver\n });\n var dragging = useDrag({\n nodeRef: nodeRef,\n disabled: node.hidden || !isDraggable,\n noDragClassName: noDragClassName,\n handleSelector: node.dragHandle,\n nodeId: id,\n isSelectable: isSelectable,\n nodeClickDistance: nodeClickDistance\n });\n var moveSelectedNodes = useMoveSelectedNodes();\n\n if (node.hidden) {\n return null;\n }\n\n var nodeDimensions = getNodeDimensions(node);\n var inlineDimensions = getNodeInlineStyleDimensions(node);\n var hasPointerEvents = isSelectable || isDraggable || onClick || onMouseEnter || onMouseMove || onMouseLeave;\n var onMouseEnterHandler = onMouseEnter ? function (event) {\n return onMouseEnter(event, _objectSpread({}, internals.userNode));\n } : undefined;\n var onMouseMoveHandler = onMouseMove ? function (event) {\n return onMouseMove(event, _objectSpread({}, internals.userNode));\n } : undefined;\n var onMouseLeaveHandler = onMouseLeave ? function (event) {\n return onMouseLeave(event, _objectSpread({}, internals.userNode));\n } : undefined;\n var onContextMenuHandler = onContextMenu ? function (event) {\n return onContextMenu(event, _objectSpread({}, internals.userNode));\n } : undefined;\n var onDoubleClickHandler = onDoubleClick ? function (event) {\n return onDoubleClick(event, _objectSpread({}, internals.userNode));\n } : undefined;\n\n var onSelectNodeHandler = function onSelectNodeHandler(event) {\n var _store$getState30 = store.getState(),\n selectNodesOnDrag = _store$getState30.selectNodesOnDrag,\n nodeDragThreshold = _store$getState30.nodeDragThreshold;\n\n if (isSelectable && (!selectNodesOnDrag || !isDraggable || nodeDragThreshold > 0)) {\n /*\n * this handler gets called by XYDrag on drag start when selectNodesOnDrag=true\n * here we only need to call it when selectNodesOnDrag=false\n */\n handleNodeClick({\n id: id,\n store: store,\n nodeRef: nodeRef\n });\n }\n\n if (onClick) {\n onClick(event, _objectSpread({}, internals.userNode));\n }\n };\n\n var onKeyDown = function onKeyDown(event) {\n if (isInputDOMNode(event.nativeEvent) || disableKeyboardA11y) {\n return;\n }\n\n if (elementSelectionKeys.includes(event.key) && isSelectable) {\n var unselect = event.key === 'Escape';\n handleNodeClick({\n id: id,\n store: store,\n unselect: unselect,\n nodeRef: nodeRef\n });\n } else if (isDraggable && node.selected && Object.prototype.hasOwnProperty.call(arrowKeyDiffs, event.key)) {\n // prevent default scrolling behavior on arrow key press when node is moved\n event.preventDefault();\n store.setState({\n ariaLiveMessage: \"Moved selected node \".concat(event.key.replace('Arrow', '').toLowerCase(), \". New position, x: \").concat(~~internals.positionAbsolute.x, \", y: \").concat(~~internals.positionAbsolute.y)\n });\n moveSelectedNodes({\n direction: arrowKeyDiffs[event.key],\n factor: event.shiftKey ? 4 : 1\n });\n }\n };\n\n return jsx(\"div\", {\n className: cc(['react-flow__node', \"react-flow__node-\".concat(nodeType), _defineProperty({}, noPanClassName, isDraggable), node.className, {\n selected: node.selected,\n selectable: isSelectable,\n parent: isParent,\n draggable: isDraggable,\n dragging: dragging\n }]),\n ref: nodeRef,\n style: _objectSpread(_objectSpread({\n zIndex: internals.z,\n transform: \"translate(\".concat(internals.positionAbsolute.x, \"px,\").concat(internals.positionAbsolute.y, \"px)\"),\n pointerEvents: hasPointerEvents ? 'all' : 'none',\n visibility: hasDimensions ? 'visible' : 'hidden'\n }, node.style), inlineDimensions),\n \"data-id\": id,\n \"data-testid\": \"rf__node-\".concat(id),\n onMouseEnter: onMouseEnterHandler,\n onMouseMove: onMouseMoveHandler,\n onMouseLeave: onMouseLeaveHandler,\n onContextMenu: onContextMenuHandler,\n onClick: onSelectNodeHandler,\n onDoubleClick: onDoubleClickHandler,\n onKeyDown: isFocusable ? onKeyDown : undefined,\n tabIndex: isFocusable ? 0 : undefined,\n role: isFocusable ? 'button' : undefined,\n \"aria-describedby\": disableKeyboardA11y ? undefined : \"\".concat(ARIA_NODE_DESC_KEY, \"-\").concat(rfId),\n \"aria-label\": node.ariaLabel,\n children: jsx(Provider, {\n value: id,\n children: jsx(NodeComponent, _objectSpread({\n id: id,\n data: node.data,\n type: nodeType,\n positionAbsoluteX: internals.positionAbsolute.x,\n positionAbsoluteY: internals.positionAbsolute.y,\n selected: (_node$selected = node.selected) !== null && _node$selected !== void 0 ? _node$selected : false,\n selectable: isSelectable,\n draggable: isDraggable,\n deletable: (_node$deletable = node.deletable) !== null && _node$deletable !== void 0 ? _node$deletable : true,\n isConnectable: isConnectable,\n sourcePosition: node.sourcePosition,\n targetPosition: node.targetPosition,\n dragging: dragging,\n dragHandle: node.dragHandle,\n zIndex: internals.z,\n parentId: node.parentId\n }, nodeDimensions))\n })\n });\n}\n\nvar selector$b = function selector$b(s) {\n return {\n nodesDraggable: s.nodesDraggable,\n nodesConnectable: s.nodesConnectable,\n nodesFocusable: s.nodesFocusable,\n elementsSelectable: s.elementsSelectable,\n onError: s.onError\n };\n};\n\nfunction NodeRendererComponent(props) {\n var _useStore11 = useStore(selector$b, shallow),\n nodesDraggable = _useStore11.nodesDraggable,\n nodesConnectable = _useStore11.nodesConnectable,\n nodesFocusable = _useStore11.nodesFocusable,\n elementsSelectable = _useStore11.elementsSelectable,\n onError = _useStore11.onError;\n\n var nodeIds = useVisibleNodeIds(props.onlyRenderVisibleElements);\n var resizeObserver = useResizeObserver();\n return jsx(\"div\", {\n className: \"react-flow__nodes\",\n style: containerStyle,\n children: nodeIds.map(function (nodeId) {\n return (\n /*\n * The split of responsibilities between NodeRenderer and\n * NodeComponentWrapper may appear weird. However, it’s designed to\n * minimize the cost of updates when individual nodes change.\n *\n * For example, when you’re dragging a single node, that node gets\n * updated multiple times per second. If `NodeRenderer` were to update\n * every time, it would have to re-run the `nodes.map()` loop every\n * time. This gets pricey with hundreds of nodes, especially if every\n * loop cycle does more than just rendering a JSX element!\n *\n * As a result of this choice, we took the following implementation\n * decisions:\n * - NodeRenderer subscribes *only* to node IDs – and therefore\n * rerender *only* when visible nodes are added or removed.\n * - NodeRenderer performs all operations the result of which can be\n * shared between nodes (such as creating the `ResizeObserver`\n * instance, or subscribing to `selector`). This means extra prop\n * drilling into `NodeComponentWrapper`, but it means we need to run\n * these operations only once – instead of once per node.\n * - Any operations that you’d normally write inside `nodes.map` are\n * moved into `NodeComponentWrapper`. This ensures they are\n * memorized – so if `NodeRenderer` *has* to rerender, it only\n * needs to regenerate the list of nodes, nothing else.\n */\n jsx(NodeWrapper, {\n id: nodeId,\n nodeTypes: props.nodeTypes,\n nodeExtent: props.nodeExtent,\n onClick: props.onNodeClick,\n onMouseEnter: props.onNodeMouseEnter,\n onMouseMove: props.onNodeMouseMove,\n onMouseLeave: props.onNodeMouseLeave,\n onContextMenu: props.onNodeContextMenu,\n onDoubleClick: props.onNodeDoubleClick,\n noDragClassName: props.noDragClassName,\n noPanClassName: props.noPanClassName,\n rfId: props.rfId,\n disableKeyboardA11y: props.disableKeyboardA11y,\n resizeObserver: resizeObserver,\n nodesDraggable: nodesDraggable,\n nodesConnectable: nodesConnectable,\n nodesFocusable: nodesFocusable,\n elementsSelectable: elementsSelectable,\n nodeClickDistance: props.nodeClickDistance,\n onError: onError\n }, nodeId)\n );\n })\n });\n}\n\nNodeRendererComponent.displayName = 'NodeRenderer';\nvar NodeRenderer = memo(NodeRendererComponent);\n/**\n * Hook for getting the visible edge ids from the store.\n *\n * @internal\n * @param onlyRenderVisible\n * @returns array with visible edge ids\n */\n\nfunction useVisibleEdgeIds(onlyRenderVisible) {\n var edgeIds = useStore(useCallback(function (s) {\n if (!onlyRenderVisible) {\n return s.edges.map(function (edge) {\n return edge.id;\n });\n }\n\n var visibleEdgeIds = [];\n\n if (s.width && s.height) {\n var _iterator15 = _createForOfIteratorHelper(s.edges),\n _step15;\n\n try {\n for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {\n var edge = _step15.value;\n var sourceNode = s.nodeLookup.get(edge.source);\n var targetNode = s.nodeLookup.get(edge.target);\n\n if (sourceNode && targetNode && isEdgeVisible({\n sourceNode: sourceNode,\n targetNode: targetNode,\n width: s.width,\n height: s.height,\n transform: s.transform\n })) {\n visibleEdgeIds.push(edge.id);\n }\n }\n } catch (err) {\n _iterator15.e(err);\n } finally {\n _iterator15.f();\n }\n }\n\n return visibleEdgeIds;\n }, [onlyRenderVisible]), shallow);\n return edgeIds;\n}\n\nvar ArrowSymbol = function ArrowSymbol(_ref28) {\n var _ref28$color = _ref28.color,\n color = _ref28$color === void 0 ? 'none' : _ref28$color,\n _ref28$strokeWidth = _ref28.strokeWidth,\n strokeWidth = _ref28$strokeWidth === void 0 ? 1 : _ref28$strokeWidth;\n return jsx(\"polyline\", {\n style: {\n stroke: color,\n strokeWidth: strokeWidth\n },\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n fill: \"none\",\n points: \"-5,-4 0,0 -5,4\"\n });\n};\n\nvar ArrowClosedSymbol = function ArrowClosedSymbol(_ref29) {\n var _ref29$color = _ref29.color,\n color = _ref29$color === void 0 ? 'none' : _ref29$color,\n _ref29$strokeWidth = _ref29.strokeWidth,\n strokeWidth = _ref29$strokeWidth === void 0 ? 1 : _ref29$strokeWidth;\n return jsx(\"polyline\", {\n style: {\n stroke: color,\n fill: color,\n strokeWidth: strokeWidth\n },\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n points: \"-5,-4 0,0 -5,4 -5,-4\"\n });\n};\n\nvar MarkerSymbols = (_MarkerSymbols = {}, _defineProperty(_MarkerSymbols, MarkerType.Arrow, ArrowSymbol), _defineProperty(_MarkerSymbols, MarkerType.ArrowClosed, ArrowClosedSymbol), _MarkerSymbols);\n\nfunction useMarkerSymbol(type) {\n var store = useStoreApi();\n var symbol = useMemo(function () {\n var symbolExists = Object.prototype.hasOwnProperty.call(MarkerSymbols, type);\n\n if (!symbolExists) {\n var _store$getState$onErr3, _store$getState31;\n\n (_store$getState$onErr3 = (_store$getState31 = store.getState()).onError) === null || _store$getState$onErr3 === void 0 ? void 0 : _store$getState$onErr3.call(_store$getState31, '009', errorMessages['error009'](type));\n return null;\n }\n\n return MarkerSymbols[type];\n }, [type]);\n return symbol;\n}\n\nvar Marker = function Marker(_ref30) {\n var id = _ref30.id,\n type = _ref30.type,\n color = _ref30.color,\n _ref30$width = _ref30.width,\n width = _ref30$width === void 0 ? 12.5 : _ref30$width,\n _ref30$height = _ref30.height,\n height = _ref30$height === void 0 ? 12.5 : _ref30$height,\n _ref30$markerUnits = _ref30.markerUnits,\n markerUnits = _ref30$markerUnits === void 0 ? 'strokeWidth' : _ref30$markerUnits,\n strokeWidth = _ref30.strokeWidth,\n _ref30$orient = _ref30.orient,\n orient = _ref30$orient === void 0 ? 'auto-start-reverse' : _ref30$orient;\n var Symbol = useMarkerSymbol(type);\n\n if (!Symbol) {\n return null;\n }\n\n return jsx(\"marker\", {\n className: \"react-flow__arrowhead\",\n id: id,\n markerWidth: \"\".concat(width),\n markerHeight: \"\".concat(height),\n viewBox: \"-10 -10 20 20\",\n markerUnits: markerUnits,\n orient: orient,\n refX: \"0\",\n refY: \"0\",\n children: jsx(Symbol, {\n color: color,\n strokeWidth: strokeWidth\n })\n });\n};\n/*\n * when you have multiple flows on a page and you hide the first one, the other ones have no markers anymore\n * when they do have markers with the same ids. To prevent this the user can pass a unique id to the react flow wrapper\n * that we can then use for creating our unique marker ids\n */\n\n\nvar MarkerDefinitions = function MarkerDefinitions(_ref31) {\n var defaultColor = _ref31.defaultColor,\n rfId = _ref31.rfId;\n var edges = useStore(function (s) {\n return s.edges;\n });\n var defaultEdgeOptions = useStore(function (s) {\n return s.defaultEdgeOptions;\n });\n var markers = useMemo(function () {\n var markers = createMarkerIds(edges, {\n id: rfId,\n defaultColor: defaultColor,\n defaultMarkerStart: defaultEdgeOptions === null || defaultEdgeOptions === void 0 ? void 0 : defaultEdgeOptions.markerStart,\n defaultMarkerEnd: defaultEdgeOptions === null || defaultEdgeOptions === void 0 ? void 0 : defaultEdgeOptions.markerEnd\n });\n return markers;\n }, [edges, defaultEdgeOptions, rfId, defaultColor]);\n\n if (!markers.length) {\n return null;\n }\n\n return jsx(\"svg\", {\n className: \"react-flow__marker\",\n children: jsx(\"defs\", {\n children: markers.map(function (marker) {\n return jsx(Marker, {\n id: marker.id,\n type: marker.type,\n color: marker.color,\n width: marker.width,\n height: marker.height,\n markerUnits: marker.markerUnits,\n strokeWidth: marker.strokeWidth,\n orient: marker.orient\n }, marker.id);\n })\n })\n });\n};\n\nMarkerDefinitions.displayName = 'MarkerDefinitions';\nvar MarkerDefinitions$1 = memo(MarkerDefinitions);\n\nfunction EdgeTextComponent(_ref32) {\n var x = _ref32.x,\n y = _ref32.y,\n label = _ref32.label,\n labelStyle = _ref32.labelStyle,\n _ref32$labelShowBg = _ref32.labelShowBg,\n labelShowBg = _ref32$labelShowBg === void 0 ? true : _ref32$labelShowBg,\n labelBgStyle = _ref32.labelBgStyle,\n _ref32$labelBgPadding = _ref32.labelBgPadding,\n labelBgPadding = _ref32$labelBgPadding === void 0 ? [2, 4] : _ref32$labelBgPadding,\n _ref32$labelBgBorderR = _ref32.labelBgBorderRadius,\n labelBgBorderRadius = _ref32$labelBgBorderR === void 0 ? 2 : _ref32$labelBgBorderR,\n children = _ref32.children,\n className = _ref32.className,\n rest = _objectWithoutProperties(_ref32, _excluded3);\n\n var _useState13 = useState({\n x: 1,\n y: 0,\n width: 0,\n height: 0\n }),\n _useState14 = _slicedToArray(_useState13, 2),\n edgeTextBbox = _useState14[0],\n setEdgeTextBbox = _useState14[1];\n\n var edgeTextClasses = cc(['react-flow__edge-textwrapper', className]);\n var edgeTextRef = useRef(null);\n useEffect(function () {\n if (edgeTextRef.current) {\n var textBbox = edgeTextRef.current.getBBox();\n setEdgeTextBbox({\n x: textBbox.x,\n y: textBbox.y,\n width: textBbox.width,\n height: textBbox.height\n });\n }\n }, [label]);\n\n if (!label) {\n return null;\n }\n\n return jsxs(\"g\", _objectSpread(_objectSpread({\n transform: \"translate(\".concat(x - edgeTextBbox.width / 2, \" \").concat(y - edgeTextBbox.height / 2, \")\"),\n className: edgeTextClasses,\n visibility: edgeTextBbox.width ? 'visible' : 'hidden'\n }, rest), {}, {\n children: [labelShowBg && jsx(\"rect\", {\n width: edgeTextBbox.width + 2 * labelBgPadding[0],\n x: -labelBgPadding[0],\n y: -labelBgPadding[1],\n height: edgeTextBbox.height + 2 * labelBgPadding[1],\n className: \"react-flow__edge-textbg\",\n style: labelBgStyle,\n rx: labelBgBorderRadius,\n ry: labelBgBorderRadius\n }), jsx(\"text\", {\n className: \"react-flow__edge-text\",\n y: edgeTextBbox.height / 2,\n dy: \"0.3em\",\n ref: edgeTextRef,\n style: labelStyle,\n children: label\n }), children]\n }));\n}\n\nEdgeTextComponent.displayName = 'EdgeText';\n/**\n * You can use the `` component as a helper component to display text\n * within your custom edges.\n *\n * @public\n *\n * @example\n * ```jsx\n * import { EdgeText } from '@xyflow/react';\n *\n * export function CustomEdgeLabel({ label }) {\n * return (\n * \n * );\n * }\n *```\n */\n\nvar EdgeText = memo(EdgeTextComponent);\n/**\n * The `` component gets used internally for all the edges. It can be\n * used inside a custom edge and handles the invisible helper edge and the edge label\n * for you.\n *\n * @public\n * @example\n * ```jsx\n *import { BaseEdge } from '@xyflow/react';\n *\n *export function CustomEdge({ sourceX, sourceY, targetX, targetY, ...props }) {\n * const [edgePath] = getStraightPath({\n * sourceX,\n * sourceY,\n * targetX,\n * targetY,\n * });\n *\n * return ;\n *}\n *```\n *\n * @remarks If you want to use an edge marker with the [``](/api-reference/components/base-edge) component,\n * you can pass the `markerStart` or `markerEnd` props passed to your custom edge\n * through to the [``](/api-reference/components/base-edge) component.\n * You can see all the props passed to a custom edge by looking at the [`EdgeProps`](/api-reference/types/edge-props) type.\n */\n\nfunction BaseEdge(_ref33) {\n var path = _ref33.path,\n labelX = _ref33.labelX,\n labelY = _ref33.labelY,\n label = _ref33.label,\n labelStyle = _ref33.labelStyle,\n labelShowBg = _ref33.labelShowBg,\n labelBgStyle = _ref33.labelBgStyle,\n labelBgPadding = _ref33.labelBgPadding,\n labelBgBorderRadius = _ref33.labelBgBorderRadius,\n _ref33$interactionWid = _ref33.interactionWidth,\n interactionWidth = _ref33$interactionWid === void 0 ? 20 : _ref33$interactionWid,\n props = _objectWithoutProperties(_ref33, _excluded4);\n\n return jsxs(Fragment, {\n children: [jsx(\"path\", _objectSpread(_objectSpread({}, props), {}, {\n d: path,\n fill: \"none\",\n className: cc(['react-flow__edge-path', props.className])\n })), interactionWidth && jsx(\"path\", {\n d: path,\n fill: \"none\",\n strokeOpacity: 0,\n strokeWidth: interactionWidth,\n className: \"react-flow__edge-interaction\"\n }), label && isNumeric(labelX) && isNumeric(labelY) ? jsx(EdgeText, {\n x: labelX,\n y: labelY,\n label: label,\n labelStyle: labelStyle,\n labelShowBg: labelShowBg,\n labelBgStyle: labelBgStyle,\n labelBgPadding: labelBgPadding,\n labelBgBorderRadius: labelBgBorderRadius\n }) : null]\n });\n}\n\nfunction getControl(_ref34) {\n var pos = _ref34.pos,\n x1 = _ref34.x1,\n y1 = _ref34.y1,\n x2 = _ref34.x2,\n y2 = _ref34.y2;\n\n if (pos === Position.Left || pos === Position.Right) {\n return [0.5 * (x1 + x2), y1];\n }\n\n return [x1, 0.5 * (y1 + y2)];\n}\n/**\n * The `getSimpleBezierPath` util returns everything you need to render a simple\n * bezier edge between two nodes.\n * @public\n */\n\n\nfunction getSimpleBezierPath(_ref35) {\n var sourceX = _ref35.sourceX,\n sourceY = _ref35.sourceY,\n _ref35$sourcePosition = _ref35.sourcePosition,\n sourcePosition = _ref35$sourcePosition === void 0 ? Position.Bottom : _ref35$sourcePosition,\n targetX = _ref35.targetX,\n targetY = _ref35.targetY,\n _ref35$targetPosition = _ref35.targetPosition,\n targetPosition = _ref35$targetPosition === void 0 ? Position.Top : _ref35$targetPosition;\n\n var _getControl = getControl({\n pos: sourcePosition,\n x1: sourceX,\n y1: sourceY,\n x2: targetX,\n y2: targetY\n }),\n _getControl2 = _slicedToArray(_getControl, 2),\n sourceControlX = _getControl2[0],\n sourceControlY = _getControl2[1];\n\n var _getControl3 = getControl({\n pos: targetPosition,\n x1: targetX,\n y1: targetY,\n x2: sourceX,\n y2: sourceY\n }),\n _getControl4 = _slicedToArray(_getControl3, 2),\n targetControlX = _getControl4[0],\n targetControlY = _getControl4[1];\n\n var _getBezierEdgeCenter = getBezierEdgeCenter({\n sourceX: sourceX,\n sourceY: sourceY,\n targetX: targetX,\n targetY: targetY,\n sourceControlX: sourceControlX,\n sourceControlY: sourceControlY,\n targetControlX: targetControlX,\n targetControlY: targetControlY\n }),\n _getBezierEdgeCenter2 = _slicedToArray(_getBezierEdgeCenter, 4),\n labelX = _getBezierEdgeCenter2[0],\n labelY = _getBezierEdgeCenter2[1],\n offsetX = _getBezierEdgeCenter2[2],\n offsetY = _getBezierEdgeCenter2[3];\n\n return [\"M\".concat(sourceX, \",\").concat(sourceY, \" C\").concat(sourceControlX, \",\").concat(sourceControlY, \" \").concat(targetControlX, \",\").concat(targetControlY, \" \").concat(targetX, \",\").concat(targetY), labelX, labelY, offsetX, offsetY];\n}\n\nfunction createSimpleBezierEdge(params) {\n // eslint-disable-next-line react/display-name\n return memo(function (_ref36) {\n var id = _ref36.id,\n sourceX = _ref36.sourceX,\n sourceY = _ref36.sourceY,\n targetX = _ref36.targetX,\n targetY = _ref36.targetY,\n _ref36$sourcePosition = _ref36.sourcePosition,\n sourcePosition = _ref36$sourcePosition === void 0 ? Position.Bottom : _ref36$sourcePosition,\n _ref36$targetPosition = _ref36.targetPosition,\n targetPosition = _ref36$targetPosition === void 0 ? Position.Top : _ref36$targetPosition,\n label = _ref36.label,\n labelStyle = _ref36.labelStyle,\n labelShowBg = _ref36.labelShowBg,\n labelBgStyle = _ref36.labelBgStyle,\n labelBgPadding = _ref36.labelBgPadding,\n labelBgBorderRadius = _ref36.labelBgBorderRadius,\n style = _ref36.style,\n markerEnd = _ref36.markerEnd,\n markerStart = _ref36.markerStart,\n interactionWidth = _ref36.interactionWidth;\n\n var _getSimpleBezierPath = getSimpleBezierPath({\n sourceX: sourceX,\n sourceY: sourceY,\n sourcePosition: sourcePosition,\n targetX: targetX,\n targetY: targetY,\n targetPosition: targetPosition\n }),\n _getSimpleBezierPath2 = _slicedToArray(_getSimpleBezierPath, 3),\n path = _getSimpleBezierPath2[0],\n labelX = _getSimpleBezierPath2[1],\n labelY = _getSimpleBezierPath2[2];\n\n var _id = params.isInternal ? undefined : id;\n\n return jsx(BaseEdge, {\n id: _id,\n path: path,\n labelX: labelX,\n labelY: labelY,\n label: label,\n labelStyle: labelStyle,\n labelShowBg: labelShowBg,\n labelBgStyle: labelBgStyle,\n labelBgPadding: labelBgPadding,\n labelBgBorderRadius: labelBgBorderRadius,\n style: style,\n markerEnd: markerEnd,\n markerStart: markerStart,\n interactionWidth: interactionWidth\n });\n });\n}\n\nvar SimpleBezierEdge = createSimpleBezierEdge({\n isInternal: false\n});\nvar SimpleBezierEdgeInternal = createSimpleBezierEdge({\n isInternal: true\n});\nSimpleBezierEdge.displayName = 'SimpleBezierEdge';\nSimpleBezierEdgeInternal.displayName = 'SimpleBezierEdgeInternal';\n\nfunction createSmoothStepEdge(params) {\n // eslint-disable-next-line react/display-name\n return memo(function (_ref37) {\n var id = _ref37.id,\n sourceX = _ref37.sourceX,\n sourceY = _ref37.sourceY,\n targetX = _ref37.targetX,\n targetY = _ref37.targetY,\n label = _ref37.label,\n labelStyle = _ref37.labelStyle,\n labelShowBg = _ref37.labelShowBg,\n labelBgStyle = _ref37.labelBgStyle,\n labelBgPadding = _ref37.labelBgPadding,\n labelBgBorderRadius = _ref37.labelBgBorderRadius,\n style = _ref37.style,\n _ref37$sourcePosition = _ref37.sourcePosition,\n sourcePosition = _ref37$sourcePosition === void 0 ? Position.Bottom : _ref37$sourcePosition,\n _ref37$targetPosition = _ref37.targetPosition,\n targetPosition = _ref37$targetPosition === void 0 ? Position.Top : _ref37$targetPosition,\n markerEnd = _ref37.markerEnd,\n markerStart = _ref37.markerStart,\n pathOptions = _ref37.pathOptions,\n interactionWidth = _ref37.interactionWidth;\n\n var _getSmoothStepPath = getSmoothStepPath({\n sourceX: sourceX,\n sourceY: sourceY,\n sourcePosition: sourcePosition,\n targetX: targetX,\n targetY: targetY,\n targetPosition: targetPosition,\n borderRadius: pathOptions === null || pathOptions === void 0 ? void 0 : pathOptions.borderRadius,\n offset: pathOptions === null || pathOptions === void 0 ? void 0 : pathOptions.offset\n }),\n _getSmoothStepPath2 = _slicedToArray(_getSmoothStepPath, 3),\n path = _getSmoothStepPath2[0],\n labelX = _getSmoothStepPath2[1],\n labelY = _getSmoothStepPath2[2];\n\n var _id = params.isInternal ? undefined : id;\n\n return jsx(BaseEdge, {\n id: _id,\n path: path,\n labelX: labelX,\n labelY: labelY,\n label: label,\n labelStyle: labelStyle,\n labelShowBg: labelShowBg,\n labelBgStyle: labelBgStyle,\n labelBgPadding: labelBgPadding,\n labelBgBorderRadius: labelBgBorderRadius,\n style: style,\n markerEnd: markerEnd,\n markerStart: markerStart,\n interactionWidth: interactionWidth\n });\n });\n}\n/**\n * Component that can be used inside a custom edge to render a smooth step edge.\n *\n * @public\n * @example\n *\n * ```tsx\n * import { SmoothStepEdge } from '@xyflow/react';\n *\n * function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) {\n * return (\n * \n * );\n * }\n * ```\n */\n\n\nvar SmoothStepEdge = createSmoothStepEdge({\n isInternal: false\n});\n/**\n * @internal\n */\n\nvar SmoothStepEdgeInternal = createSmoothStepEdge({\n isInternal: true\n});\nSmoothStepEdge.displayName = 'SmoothStepEdge';\nSmoothStepEdgeInternal.displayName = 'SmoothStepEdgeInternal';\n\nfunction createStepEdge(params) {\n // eslint-disable-next-line react/display-name\n return memo(function (_ref38) {\n var _props$pathOptions2;\n\n var id = _ref38.id,\n props = _objectWithoutProperties(_ref38, _excluded5);\n\n var _id = params.isInternal ? undefined : id;\n\n return jsx(SmoothStepEdge, _objectSpread(_objectSpread({}, props), {}, {\n id: _id,\n pathOptions: useMemo(function () {\n var _props$pathOptions;\n\n return {\n borderRadius: 0,\n offset: (_props$pathOptions = props.pathOptions) === null || _props$pathOptions === void 0 ? void 0 : _props$pathOptions.offset\n };\n }, [(_props$pathOptions2 = props.pathOptions) === null || _props$pathOptions2 === void 0 ? void 0 : _props$pathOptions2.offset])\n }));\n });\n}\n/**\n * Component that can be used inside a custom edge to render a step edge.\n *\n * @public\n * @example\n *\n * ```tsx\n * import { StepEdge } from '@xyflow/react';\n *\n * function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) {\n * return (\n * \n * );\n * }\n * ```\n */\n\n\nvar StepEdge = createStepEdge({\n isInternal: false\n});\n/**\n * @internal\n */\n\nvar StepEdgeInternal = createStepEdge({\n isInternal: true\n});\nStepEdge.displayName = 'StepEdge';\nStepEdgeInternal.displayName = 'StepEdgeInternal';\n\nfunction createStraightEdge(params) {\n // eslint-disable-next-line react/display-name\n return memo(function (_ref39) {\n var id = _ref39.id,\n sourceX = _ref39.sourceX,\n sourceY = _ref39.sourceY,\n targetX = _ref39.targetX,\n targetY = _ref39.targetY,\n label = _ref39.label,\n labelStyle = _ref39.labelStyle,\n labelShowBg = _ref39.labelShowBg,\n labelBgStyle = _ref39.labelBgStyle,\n labelBgPadding = _ref39.labelBgPadding,\n labelBgBorderRadius = _ref39.labelBgBorderRadius,\n style = _ref39.style,\n markerEnd = _ref39.markerEnd,\n markerStart = _ref39.markerStart,\n interactionWidth = _ref39.interactionWidth;\n\n var _getStraightPath = getStraightPath({\n sourceX: sourceX,\n sourceY: sourceY,\n targetX: targetX,\n targetY: targetY\n }),\n _getStraightPath2 = _slicedToArray(_getStraightPath, 3),\n path = _getStraightPath2[0],\n labelX = _getStraightPath2[1],\n labelY = _getStraightPath2[2];\n\n var _id = params.isInternal ? undefined : id;\n\n return jsx(BaseEdge, {\n id: _id,\n path: path,\n labelX: labelX,\n labelY: labelY,\n label: label,\n labelStyle: labelStyle,\n labelShowBg: labelShowBg,\n labelBgStyle: labelBgStyle,\n labelBgPadding: labelBgPadding,\n labelBgBorderRadius: labelBgBorderRadius,\n style: style,\n markerEnd: markerEnd,\n markerStart: markerStart,\n interactionWidth: interactionWidth\n });\n });\n}\n/**\n * Component that can be used inside a custom edge to render a straight line.\n *\n * @public\n * @example\n *\n * ```tsx\n * import { StraightEdge } from '@xyflow/react';\n *\n * function CustomEdge({ sourceX, sourceY, targetX, targetY }) {\n * return (\n * \n * );\n * }\n * ```\n */\n\n\nvar StraightEdge = createStraightEdge({\n isInternal: false\n});\n/**\n * @internal\n */\n\nvar StraightEdgeInternal = createStraightEdge({\n isInternal: true\n});\nStraightEdge.displayName = 'StraightEdge';\nStraightEdgeInternal.displayName = 'StraightEdgeInternal';\n\nfunction createBezierEdge(params) {\n // eslint-disable-next-line react/display-name\n return memo(function (_ref40) {\n var id = _ref40.id,\n sourceX = _ref40.sourceX,\n sourceY = _ref40.sourceY,\n targetX = _ref40.targetX,\n targetY = _ref40.targetY,\n _ref40$sourcePosition = _ref40.sourcePosition,\n sourcePosition = _ref40$sourcePosition === void 0 ? Position.Bottom : _ref40$sourcePosition,\n _ref40$targetPosition = _ref40.targetPosition,\n targetPosition = _ref40$targetPosition === void 0 ? Position.Top : _ref40$targetPosition,\n label = _ref40.label,\n labelStyle = _ref40.labelStyle,\n labelShowBg = _ref40.labelShowBg,\n labelBgStyle = _ref40.labelBgStyle,\n labelBgPadding = _ref40.labelBgPadding,\n labelBgBorderRadius = _ref40.labelBgBorderRadius,\n style = _ref40.style,\n markerEnd = _ref40.markerEnd,\n markerStart = _ref40.markerStart,\n pathOptions = _ref40.pathOptions,\n interactionWidth = _ref40.interactionWidth;\n\n var _getBezierPath = getBezierPath({\n sourceX: sourceX,\n sourceY: sourceY,\n sourcePosition: sourcePosition,\n targetX: targetX,\n targetY: targetY,\n targetPosition: targetPosition,\n curvature: pathOptions === null || pathOptions === void 0 ? void 0 : pathOptions.curvature\n }),\n _getBezierPath2 = _slicedToArray(_getBezierPath, 3),\n path = _getBezierPath2[0],\n labelX = _getBezierPath2[1],\n labelY = _getBezierPath2[2];\n\n var _id = params.isInternal ? undefined : id;\n\n return jsx(BaseEdge, {\n id: _id,\n path: path,\n labelX: labelX,\n labelY: labelY,\n label: label,\n labelStyle: labelStyle,\n labelShowBg: labelShowBg,\n labelBgStyle: labelBgStyle,\n labelBgPadding: labelBgPadding,\n labelBgBorderRadius: labelBgBorderRadius,\n style: style,\n markerEnd: markerEnd,\n markerStart: markerStart,\n interactionWidth: interactionWidth\n });\n });\n}\n/**\n * Component that can be used inside a custom edge to render a bezier curve.\n *\n * @public\n * @example\n *\n * ```tsx\n * import { BezierEdge } from '@xyflow/react';\n *\n * function CustomEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition }) {\n * return (\n * \n * );\n * }\n * ```\n */\n\n\nvar BezierEdge = createBezierEdge({\n isInternal: false\n});\n/**\n * @internal\n */\n\nvar BezierEdgeInternal = createBezierEdge({\n isInternal: true\n});\nBezierEdge.displayName = 'BezierEdge';\nBezierEdgeInternal.displayName = 'BezierEdgeInternal';\nvar builtinEdgeTypes = {\n default: BezierEdgeInternal,\n straight: StraightEdgeInternal,\n step: StepEdgeInternal,\n smoothstep: SmoothStepEdgeInternal,\n simplebezier: SimpleBezierEdgeInternal\n};\nvar nullPosition = {\n sourceX: null,\n sourceY: null,\n targetX: null,\n targetY: null,\n sourcePosition: null,\n targetPosition: null\n};\n\nvar shiftX = function shiftX(x, shift, position) {\n if (position === Position.Left) return x - shift;\n if (position === Position.Right) return x + shift;\n return x;\n};\n\nvar shiftY = function shiftY(y, shift, position) {\n if (position === Position.Top) return y - shift;\n if (position === Position.Bottom) return y + shift;\n return y;\n};\n\nvar EdgeUpdaterClassName = 'react-flow__edgeupdater';\n/**\n * @internal\n */\n\nfunction EdgeAnchor(_ref41) {\n var position = _ref41.position,\n centerX = _ref41.centerX,\n centerY = _ref41.centerY,\n _ref41$radius = _ref41.radius,\n radius = _ref41$radius === void 0 ? 10 : _ref41$radius,\n onMouseDown = _ref41.onMouseDown,\n onMouseEnter = _ref41.onMouseEnter,\n onMouseOut = _ref41.onMouseOut,\n type = _ref41.type;\n return jsx(\"circle\", {\n onMouseDown: onMouseDown,\n onMouseEnter: onMouseEnter,\n onMouseOut: onMouseOut,\n className: cc([EdgeUpdaterClassName, \"\".concat(EdgeUpdaterClassName, \"-\").concat(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\nfunction EdgeUpdateAnchors(_ref42) {\n var isReconnectable = _ref42.isReconnectable,\n reconnectRadius = _ref42.reconnectRadius,\n edge = _ref42.edge,\n sourceX = _ref42.sourceX,\n sourceY = _ref42.sourceY,\n targetX = _ref42.targetX,\n targetY = _ref42.targetY,\n sourcePosition = _ref42.sourcePosition,\n targetPosition = _ref42.targetPosition,\n onReconnect = _ref42.onReconnect,\n onReconnectStart = _ref42.onReconnectStart,\n onReconnectEnd = _ref42.onReconnectEnd,\n setReconnecting = _ref42.setReconnecting,\n setUpdateHover = _ref42.setUpdateHover;\n var store = useStoreApi();\n\n var handleEdgeUpdater = function handleEdgeUpdater(event, oppositeHandle) {\n // avoid triggering edge updater if mouse btn is not left\n if (event.button !== 0) {\n return;\n }\n\n var _store$getState32 = store.getState(),\n autoPanOnConnect = _store$getState32.autoPanOnConnect,\n domNode = _store$getState32.domNode,\n isValidConnection = _store$getState32.isValidConnection,\n connectionMode = _store$getState32.connectionMode,\n connectionRadius = _store$getState32.connectionRadius,\n lib = _store$getState32.lib,\n onConnectStart = _store$getState32.onConnectStart,\n onConnectEnd = _store$getState32.onConnectEnd,\n cancelConnection = _store$getState32.cancelConnection,\n nodeLookup = _store$getState32.nodeLookup,\n flowId = _store$getState32.rfId,\n panBy = _store$getState32.panBy,\n updateConnection = _store$getState32.updateConnection;\n\n var isTarget = oppositeHandle.type === 'target';\n setReconnecting(true);\n onReconnectStart === null || onReconnectStart === void 0 ? void 0 : onReconnectStart(event, edge, oppositeHandle.type);\n\n var _onReconnectEnd = function _onReconnectEnd(evt, connectionState) {\n setReconnecting(false);\n onReconnectEnd === null || onReconnectEnd === void 0 ? void 0 : onReconnectEnd(evt, edge, oppositeHandle.type, connectionState);\n };\n\n var onConnectEdge = function onConnectEdge(connection) {\n return onReconnect === null || onReconnect === void 0 ? void 0 : onReconnect(edge, connection);\n };\n\n XYHandle.onPointerDown(event.nativeEvent, {\n autoPanOnConnect: autoPanOnConnect,\n connectionMode: connectionMode,\n connectionRadius: connectionRadius,\n domNode: domNode,\n handleId: oppositeHandle.id,\n nodeId: oppositeHandle.nodeId,\n nodeLookup: nodeLookup,\n isTarget: isTarget,\n edgeUpdaterType: oppositeHandle.type,\n lib: lib,\n flowId: flowId,\n cancelConnection: cancelConnection,\n panBy: panBy,\n isValidConnection: isValidConnection,\n onConnect: onConnectEdge,\n onConnectStart: onConnectStart,\n onConnectEnd: onConnectEnd,\n onReconnectEnd: _onReconnectEnd,\n updateConnection: updateConnection,\n getTransform: function getTransform() {\n return store.getState().transform;\n },\n getFromHandle: function getFromHandle() {\n return store.getState().connection.fromHandle;\n }\n });\n };\n\n var onReconnectSourceMouseDown = function onReconnectSourceMouseDown(event) {\n var _edge$targetHandle;\n\n return handleEdgeUpdater(event, {\n nodeId: edge.target,\n id: (_edge$targetHandle = edge.targetHandle) !== null && _edge$targetHandle !== void 0 ? _edge$targetHandle : null,\n type: 'target'\n });\n };\n\n var onReconnectTargetMouseDown = function onReconnectTargetMouseDown(event) {\n var _edge$sourceHandle;\n\n return handleEdgeUpdater(event, {\n nodeId: edge.source,\n id: (_edge$sourceHandle = edge.sourceHandle) !== null && _edge$sourceHandle !== void 0 ? _edge$sourceHandle : null,\n type: 'source'\n });\n };\n\n var onReconnectMouseEnter = function onReconnectMouseEnter() {\n return setUpdateHover(true);\n };\n\n var onReconnectMouseOut = function onReconnectMouseOut() {\n return setUpdateHover(false);\n };\n\n return jsxs(Fragment, {\n children: [(isReconnectable === true || isReconnectable === 'source') && jsx(EdgeAnchor, {\n position: sourcePosition,\n centerX: sourceX,\n centerY: sourceY,\n radius: reconnectRadius,\n onMouseDown: onReconnectSourceMouseDown,\n onMouseEnter: onReconnectMouseEnter,\n onMouseOut: onReconnectMouseOut,\n type: \"source\"\n }), (isReconnectable === true || isReconnectable === 'target') && jsx(EdgeAnchor, {\n position: targetPosition,\n centerX: targetX,\n centerY: targetY,\n radius: reconnectRadius,\n onMouseDown: onReconnectTargetMouseDown,\n onMouseEnter: onReconnectMouseEnter,\n onMouseOut: onReconnectMouseOut,\n type: \"target\"\n })]\n });\n}\n\nfunction EdgeWrapper(_ref43) {\n var _edge$deletable;\n\n var id = _ref43.id,\n edgesFocusable = _ref43.edgesFocusable,\n edgesReconnectable = _ref43.edgesReconnectable,\n elementsSelectable = _ref43.elementsSelectable,\n onClick = _ref43.onClick,\n onDoubleClick = _ref43.onDoubleClick,\n onContextMenu = _ref43.onContextMenu,\n onMouseEnter = _ref43.onMouseEnter,\n onMouseMove = _ref43.onMouseMove,\n onMouseLeave = _ref43.onMouseLeave,\n reconnectRadius = _ref43.reconnectRadius,\n onReconnect = _ref43.onReconnect,\n onReconnectStart = _ref43.onReconnectStart,\n onReconnectEnd = _ref43.onReconnectEnd,\n rfId = _ref43.rfId,\n edgeTypes = _ref43.edgeTypes,\n noPanClassName = _ref43.noPanClassName,\n onError = _ref43.onError,\n disableKeyboardA11y = _ref43.disableKeyboardA11y;\n var edge = useStore(function (s) {\n return s.edgeLookup.get(id);\n });\n var defaultEdgeOptions = useStore(function (s) {\n return s.defaultEdgeOptions;\n });\n edge = defaultEdgeOptions ? _objectSpread(_objectSpread({}, defaultEdgeOptions), edge) : edge;\n var edgeType = edge.type || 'default';\n var EdgeComponent = (edgeTypes === null || edgeTypes === void 0 ? void 0 : edgeTypes[edgeType]) || builtinEdgeTypes[edgeType];\n\n if (EdgeComponent === undefined) {\n onError === null || onError === void 0 ? void 0 : onError('011', errorMessages['error011'](edgeType));\n edgeType = 'default';\n EdgeComponent = builtinEdgeTypes.default;\n }\n\n var isFocusable = !!(edge.focusable || edgesFocusable && typeof edge.focusable === 'undefined');\n var isReconnectable = typeof onReconnect !== 'undefined' && (edge.reconnectable || edgesReconnectable && typeof edge.reconnectable === 'undefined');\n var isSelectable = !!(edge.selectable || elementsSelectable && typeof edge.selectable === 'undefined');\n var edgeRef = useRef(null);\n\n var _useState15 = useState(false),\n _useState16 = _slicedToArray(_useState15, 2),\n updateHover = _useState16[0],\n setUpdateHover = _useState16[1];\n\n var _useState17 = useState(false),\n _useState18 = _slicedToArray(_useState17, 2),\n reconnecting = _useState18[0],\n setReconnecting = _useState18[1];\n\n var store = useStoreApi();\n\n var _useStore12 = useStore(useCallback(function (store) {\n var sourceNode = store.nodeLookup.get(edge.source);\n var targetNode = store.nodeLookup.get(edge.target);\n\n if (!sourceNode || !targetNode) {\n return _objectSpread({\n zIndex: edge.zIndex\n }, nullPosition);\n }\n\n var edgePosition = getEdgePosition({\n id: id,\n sourceNode: sourceNode,\n targetNode: targetNode,\n sourceHandle: edge.sourceHandle || null,\n targetHandle: edge.targetHandle || null,\n connectionMode: store.connectionMode,\n onError: onError\n });\n var zIndex = getElevatedEdgeZIndex({\n selected: edge.selected,\n zIndex: edge.zIndex,\n sourceNode: sourceNode,\n targetNode: targetNode,\n elevateOnSelect: store.elevateEdgesOnSelect\n });\n return _objectSpread({\n zIndex: zIndex\n }, edgePosition || nullPosition);\n }, [edge.source, edge.target, edge.sourceHandle, edge.targetHandle, edge.selected, edge.zIndex]), shallow),\n zIndex = _useStore12.zIndex,\n sourceX = _useStore12.sourceX,\n sourceY = _useStore12.sourceY,\n targetX = _useStore12.targetX,\n targetY = _useStore12.targetY,\n sourcePosition = _useStore12.sourcePosition,\n targetPosition = _useStore12.targetPosition;\n\n var markerStartUrl = useMemo(function () {\n return edge.markerStart ? \"url('#\".concat(getMarkerId(edge.markerStart, rfId), \"')\") : undefined;\n }, [edge.markerStart, rfId]);\n var markerEndUrl = useMemo(function () {\n return edge.markerEnd ? \"url('#\".concat(getMarkerId(edge.markerEnd, rfId), \"')\") : undefined;\n }, [edge.markerEnd, rfId]);\n\n if (edge.hidden || sourceX === null || sourceY === null || targetX === null || targetY === null) {\n return null;\n }\n\n var onEdgeClick = function onEdgeClick(event) {\n var _store$getState33 = store.getState(),\n addSelectedEdges = _store$getState33.addSelectedEdges,\n unselectNodesAndEdges = _store$getState33.unselectNodesAndEdges,\n multiSelectionActive = _store$getState33.multiSelectionActive;\n\n if (isSelectable) {\n store.setState({\n nodesSelectionActive: false\n });\n\n if (edge.selected && multiSelectionActive) {\n var _edgeRef$current;\n\n unselectNodesAndEdges({\n nodes: [],\n edges: [edge]\n });\n (_edgeRef$current = edgeRef.current) === null || _edgeRef$current === void 0 ? void 0 : _edgeRef$current.blur();\n } else {\n addSelectedEdges([id]);\n }\n }\n\n if (onClick) {\n onClick(event, edge);\n }\n };\n\n var onEdgeDoubleClick = onDoubleClick ? function (event) {\n onDoubleClick(event, _objectSpread({}, edge));\n } : undefined;\n var onEdgeContextMenu = onContextMenu ? function (event) {\n onContextMenu(event, _objectSpread({}, edge));\n } : undefined;\n var onEdgeMouseEnter = onMouseEnter ? function (event) {\n onMouseEnter(event, _objectSpread({}, edge));\n } : undefined;\n var onEdgeMouseMove = onMouseMove ? function (event) {\n onMouseMove(event, _objectSpread({}, edge));\n } : undefined;\n var onEdgeMouseLeave = onMouseLeave ? function (event) {\n onMouseLeave(event, _objectSpread({}, edge));\n } : undefined;\n\n var onKeyDown = function onKeyDown(event) {\n if (!disableKeyboardA11y && elementSelectionKeys.includes(event.key) && isSelectable) {\n var _store$getState34 = store.getState(),\n unselectNodesAndEdges = _store$getState34.unselectNodesAndEdges,\n addSelectedEdges = _store$getState34.addSelectedEdges;\n\n var unselect = event.key === 'Escape';\n\n if (unselect) {\n var _edgeRef$current2;\n\n (_edgeRef$current2 = edgeRef.current) === null || _edgeRef$current2 === void 0 ? void 0 : _edgeRef$current2.blur();\n unselectNodesAndEdges({\n edges: [edge]\n });\n } else {\n addSelectedEdges([id]);\n }\n }\n };\n\n return jsx(\"svg\", {\n style: {\n zIndex: zIndex\n },\n children: jsxs(\"g\", {\n className: cc(['react-flow__edge', \"react-flow__edge-\".concat(edgeType), edge.className, noPanClassName, {\n selected: edge.selected,\n animated: edge.animated,\n inactive: !isSelectable && !onClick,\n updating: updateHover,\n selectable: isSelectable\n }]),\n onClick: onEdgeClick,\n onDoubleClick: onEdgeDoubleClick,\n onContextMenu: onEdgeContextMenu,\n onMouseEnter: onEdgeMouseEnter,\n onMouseMove: onEdgeMouseMove,\n onMouseLeave: onEdgeMouseLeave,\n onKeyDown: isFocusable ? onKeyDown : undefined,\n tabIndex: isFocusable ? 0 : undefined,\n role: isFocusable ? 'button' : 'img',\n \"data-id\": id,\n \"data-testid\": \"rf__edge-\".concat(id),\n \"aria-label\": edge.ariaLabel === null ? undefined : edge.ariaLabel || \"Edge from \".concat(edge.source, \" to \").concat(edge.target),\n \"aria-describedby\": isFocusable ? \"\".concat(ARIA_EDGE_DESC_KEY, \"-\").concat(rfId) : undefined,\n ref: edgeRef,\n children: [!reconnecting && jsx(EdgeComponent, {\n id: id,\n source: edge.source,\n target: edge.target,\n type: edge.type,\n selected: edge.selected,\n animated: edge.animated,\n selectable: isSelectable,\n deletable: (_edge$deletable = edge.deletable) !== null && _edge$deletable !== void 0 ? _edge$deletable : true,\n label: edge.label,\n labelStyle: edge.labelStyle,\n labelShowBg: edge.labelShowBg,\n labelBgStyle: edge.labelBgStyle,\n labelBgPadding: edge.labelBgPadding,\n labelBgBorderRadius: edge.labelBgBorderRadius,\n sourceX: sourceX,\n sourceY: sourceY,\n targetX: targetX,\n targetY: targetY,\n sourcePosition: sourcePosition,\n targetPosition: targetPosition,\n data: edge.data,\n style: edge.style,\n sourceHandleId: edge.sourceHandle,\n targetHandleId: edge.targetHandle,\n markerStart: markerStartUrl,\n markerEnd: markerEndUrl,\n pathOptions: 'pathOptions' in edge ? edge.pathOptions : undefined,\n interactionWidth: edge.interactionWidth\n }), isReconnectable && jsx(EdgeUpdateAnchors, {\n edge: edge,\n isReconnectable: isReconnectable,\n reconnectRadius: reconnectRadius,\n onReconnect: onReconnect,\n onReconnectStart: onReconnectStart,\n onReconnectEnd: onReconnectEnd,\n sourceX: sourceX,\n sourceY: sourceY,\n targetX: targetX,\n targetY: targetY,\n sourcePosition: sourcePosition,\n targetPosition: targetPosition,\n setUpdateHover: setUpdateHover,\n setReconnecting: setReconnecting\n })]\n })\n });\n}\n\nvar selector$a = function selector$a(s) {\n return {\n edgesFocusable: s.edgesFocusable,\n edgesReconnectable: s.edgesReconnectable,\n elementsSelectable: s.elementsSelectable,\n connectionMode: s.connectionMode,\n onError: s.onError\n };\n};\n\nfunction EdgeRendererComponent(_ref44) {\n var defaultMarkerColor = _ref44.defaultMarkerColor,\n onlyRenderVisibleElements = _ref44.onlyRenderVisibleElements,\n rfId = _ref44.rfId,\n edgeTypes = _ref44.edgeTypes,\n noPanClassName = _ref44.noPanClassName,\n onReconnect = _ref44.onReconnect,\n onEdgeContextMenu = _ref44.onEdgeContextMenu,\n onEdgeMouseEnter = _ref44.onEdgeMouseEnter,\n onEdgeMouseMove = _ref44.onEdgeMouseMove,\n onEdgeMouseLeave = _ref44.onEdgeMouseLeave,\n onEdgeClick = _ref44.onEdgeClick,\n reconnectRadius = _ref44.reconnectRadius,\n onEdgeDoubleClick = _ref44.onEdgeDoubleClick,\n onReconnectStart = _ref44.onReconnectStart,\n onReconnectEnd = _ref44.onReconnectEnd,\n disableKeyboardA11y = _ref44.disableKeyboardA11y;\n\n var _useStore13 = useStore(selector$a, shallow),\n edgesFocusable = _useStore13.edgesFocusable,\n edgesReconnectable = _useStore13.edgesReconnectable,\n elementsSelectable = _useStore13.elementsSelectable,\n onError = _useStore13.onError;\n\n var edgeIds = useVisibleEdgeIds(onlyRenderVisibleElements);\n return jsxs(\"div\", {\n className: \"react-flow__edges\",\n children: [jsx(MarkerDefinitions$1, {\n defaultColor: defaultMarkerColor,\n rfId: rfId\n }), edgeIds.map(function (id) {\n return jsx(EdgeWrapper, {\n id: id,\n edgesFocusable: edgesFocusable,\n edgesReconnectable: edgesReconnectable,\n elementsSelectable: elementsSelectable,\n noPanClassName: noPanClassName,\n onReconnect: onReconnect,\n onContextMenu: onEdgeContextMenu,\n onMouseEnter: onEdgeMouseEnter,\n onMouseMove: onEdgeMouseMove,\n onMouseLeave: onEdgeMouseLeave,\n onClick: onEdgeClick,\n reconnectRadius: reconnectRadius,\n onDoubleClick: onEdgeDoubleClick,\n onReconnectStart: onReconnectStart,\n onReconnectEnd: onReconnectEnd,\n rfId: rfId,\n onError: onError,\n edgeTypes: edgeTypes,\n disableKeyboardA11y: disableKeyboardA11y\n }, id);\n })]\n });\n}\n\nEdgeRendererComponent.displayName = 'EdgeRenderer';\nvar EdgeRenderer = memo(EdgeRendererComponent);\n\nvar selector$9 = function selector$9(s) {\n return \"translate(\".concat(s.transform[0], \"px,\").concat(s.transform[1], \"px) scale(\").concat(s.transform[2], \")\");\n};\n\nfunction Viewport(_ref45) {\n var children = _ref45.children;\n var transform = useStore(selector$9);\n return jsx(\"div\", {\n className: \"react-flow__viewport xyflow__viewport react-flow__container\",\n style: {\n transform: transform\n },\n children: children\n });\n}\n/**\n * Hook for calling onInit handler.\n *\n * @internal\n */\n\n\nfunction useOnInitHandler(onInit) {\n var rfInstance = useReactFlow();\n var isInitialized = useRef(false);\n useEffect(function () {\n if (!isInitialized.current && rfInstance.viewportInitialized && onInit) {\n setTimeout(function () {\n return onInit(rfInstance);\n }, 1);\n isInitialized.current = true;\n }\n }, [onInit, rfInstance.viewportInitialized]);\n}\n\nvar selector$8 = function selector$8(state) {\n var _state$panZoom;\n\n return (_state$panZoom = state.panZoom) === null || _state$panZoom === void 0 ? void 0 : _state$panZoom.syncViewport;\n};\n/**\n * Hook for syncing the viewport with the panzoom instance.\n *\n * @internal\n * @param viewport\n */\n\n\nfunction useViewportSync(viewport) {\n var syncViewport = useStore(selector$8);\n var store = useStoreApi();\n useEffect(function () {\n if (viewport) {\n syncViewport === null || syncViewport === void 0 ? void 0 : syncViewport(viewport);\n store.setState({\n transform: [viewport.x, viewport.y, viewport.zoom]\n });\n }\n }, [viewport, syncViewport]);\n return null;\n}\n\nfunction storeSelector$1(s) {\n return s.connection.inProgress ? _objectSpread(_objectSpread({}, s.connection), {}, {\n to: pointToRendererPoint(s.connection.to, s.transform)\n }) : _objectSpread({}, s.connection);\n}\n\nfunction getSelector(connectionSelector) {\n if (connectionSelector) {\n var combinedSelector = function combinedSelector(s) {\n var connection = storeSelector$1(s);\n return connectionSelector(connection);\n };\n\n return combinedSelector;\n }\n\n return storeSelector$1;\n}\n/**\n * The `useConnection` hook returns the current connection when there is an active\n * connection interaction. If no connection interaction is active, it returns null\n * for every property. A typical use case for this hook is to colorize handles\n * based on a certain condition (e.g. if the connection is valid or not).\n *\n * @public\n * @example\n *\n * ```tsx\n *import { useConnection } from '@xyflow/react';\n *\n *function App() {\n * const connection = useConnection();\n *\n * return (\n *
{connection ? `Someone is trying to make a connection from ${connection.fromNode} to this one.` : 'There are currently no incoming connections!'}\n *\n *
\n * );\n * }\n * ```\n *\n * @returns ConnectionState\n */\n\n\nfunction useConnection(connectionSelector) {\n var combinedSelector = getSelector(connectionSelector);\n return useStore(combinedSelector, shallow);\n}\n\nvar selector$7 = function selector$7(s) {\n return {\n nodesConnectable: s.nodesConnectable,\n isValid: s.connection.isValid,\n inProgress: s.connection.inProgress,\n width: s.width,\n height: s.height\n };\n};\n\nfunction ConnectionLineWrapper(_ref46) {\n var containerStyle = _ref46.containerStyle,\n style = _ref46.style,\n type = _ref46.type,\n component = _ref46.component;\n\n var _useStore14 = useStore(selector$7, shallow),\n nodesConnectable = _useStore14.nodesConnectable,\n width = _useStore14.width,\n height = _useStore14.height,\n isValid = _useStore14.isValid,\n inProgress = _useStore14.inProgress;\n\n var renderConnection = !!(width && nodesConnectable && inProgress);\n\n if (!renderConnection) {\n return null;\n }\n\n return jsx(\"svg\", {\n style: containerStyle,\n width: width,\n height: height,\n className: \"react-flow__connectionline react-flow__container\",\n children: jsx(\"g\", {\n className: cc(['react-flow__connection', getConnectionStatus(isValid)]),\n children: jsx(ConnectionLine, {\n style: style,\n type: type,\n CustomComponent: component,\n isValid: isValid\n })\n })\n });\n}\n\nvar ConnectionLine = function ConnectionLine(_ref47) {\n var style = _ref47.style,\n _ref47$type = _ref47.type,\n type = _ref47$type === void 0 ? ConnectionLineType.Bezier : _ref47$type,\n CustomComponent = _ref47.CustomComponent,\n isValid = _ref47.isValid;\n\n var _useConnection = useConnection(),\n inProgress = _useConnection.inProgress,\n from = _useConnection.from,\n fromNode = _useConnection.fromNode,\n fromHandle = _useConnection.fromHandle,\n fromPosition = _useConnection.fromPosition,\n to = _useConnection.to,\n toNode = _useConnection.toNode,\n toHandle = _useConnection.toHandle,\n toPosition = _useConnection.toPosition;\n\n if (!inProgress) {\n return;\n }\n\n if (CustomComponent) {\n return jsx(CustomComponent, {\n connectionLineType: type,\n connectionLineStyle: style,\n fromNode: fromNode,\n fromHandle: fromHandle,\n fromX: from.x,\n fromY: from.y,\n toX: to.x,\n toY: to.y,\n fromPosition: fromPosition,\n toPosition: toPosition,\n connectionStatus: getConnectionStatus(isValid),\n toNode: toNode,\n toHandle: toHandle\n });\n }\n\n var path = '';\n var pathParams = {\n sourceX: from.x,\n sourceY: from.y,\n sourcePosition: fromPosition,\n targetX: to.x,\n targetY: to.y,\n targetPosition: toPosition\n };\n\n switch (type) {\n case ConnectionLineType.Bezier:\n var _getBezierPath3 = getBezierPath(pathParams);\n\n var _getBezierPath4 = _slicedToArray(_getBezierPath3, 1);\n\n path = _getBezierPath4[0];\n break;\n\n case ConnectionLineType.SimpleBezier:\n var _getSimpleBezierPath3 = getSimpleBezierPath(pathParams);\n\n var _getSimpleBezierPath4 = _slicedToArray(_getSimpleBezierPath3, 1);\n\n path = _getSimpleBezierPath4[0];\n break;\n\n case ConnectionLineType.Step:\n var _getSmoothStepPath3 = getSmoothStepPath(_objectSpread(_objectSpread({}, pathParams), {}, {\n borderRadius: 0\n }));\n\n var _getSmoothStepPath4 = _slicedToArray(_getSmoothStepPath3, 1);\n\n path = _getSmoothStepPath4[0];\n break;\n\n case ConnectionLineType.SmoothStep:\n var _getSmoothStepPath5 = getSmoothStepPath(pathParams);\n\n var _getSmoothStepPath6 = _slicedToArray(_getSmoothStepPath5, 1);\n\n path = _getSmoothStepPath6[0];\n break;\n\n default:\n var _getStraightPath3 = getStraightPath(pathParams);\n\n var _getStraightPath4 = _slicedToArray(_getStraightPath3, 1);\n\n path = _getStraightPath4[0];\n }\n\n return jsx(\"path\", {\n d: path,\n fill: \"none\",\n className: \"react-flow__connection-path\",\n style: style\n });\n};\n\nConnectionLine.displayName = 'ConnectionLine';\nvar emptyTypes = {}; // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\nfunction useNodeOrEdgeTypesWarning() {\n var nodeOrEdgeTypes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : emptyTypes;\n var typesRef = useRef(nodeOrEdgeTypes);\n var store = useStoreApi();\n useEffect(function () {\n if (process.env.NODE_ENV === 'development') {\n var usedKeys = new Set([].concat(_toConsumableArray(Object.keys(typesRef.current)), _toConsumableArray(Object.keys(nodeOrEdgeTypes))));\n\n var _iterator16 = _createForOfIteratorHelper(usedKeys),\n _step16;\n\n try {\n for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {\n var key = _step16.value;\n\n if (typesRef.current[key] !== nodeOrEdgeTypes[key]) {\n var _store$getState$onErr4, _store$getState35;\n\n (_store$getState$onErr4 = (_store$getState35 = store.getState()).onError) === null || _store$getState$onErr4 === void 0 ? void 0 : _store$getState$onErr4.call(_store$getState35, '002', errorMessages['error002']());\n break;\n }\n }\n } catch (err) {\n _iterator16.e(err);\n } finally {\n _iterator16.f();\n }\n\n typesRef.current = nodeOrEdgeTypes;\n }\n }, [nodeOrEdgeTypes]);\n}\n\nfunction useStylesLoadedWarning() {\n var store = useStoreApi();\n var checked = useRef(false);\n useEffect(function () {\n if (process.env.NODE_ENV === 'development') {\n if (!checked.current) {\n var pane = document.querySelector('.react-flow__pane');\n\n if (pane && !(window.getComputedStyle(pane).zIndex === '1')) {\n var _store$getState$onErr5, _store$getState36;\n\n (_store$getState$onErr5 = (_store$getState36 = store.getState()).onError) === null || _store$getState$onErr5 === void 0 ? void 0 : _store$getState$onErr5.call(_store$getState36, '013', errorMessages['error013']('react'));\n }\n\n checked.current = true;\n }\n }\n }, []);\n}\n\nfunction GraphViewComponent(_ref48) {\n var nodeTypes = _ref48.nodeTypes,\n edgeTypes = _ref48.edgeTypes,\n onInit = _ref48.onInit,\n onNodeClick = _ref48.onNodeClick,\n onEdgeClick = _ref48.onEdgeClick,\n onNodeDoubleClick = _ref48.onNodeDoubleClick,\n onEdgeDoubleClick = _ref48.onEdgeDoubleClick,\n onNodeMouseEnter = _ref48.onNodeMouseEnter,\n onNodeMouseMove = _ref48.onNodeMouseMove,\n onNodeMouseLeave = _ref48.onNodeMouseLeave,\n onNodeContextMenu = _ref48.onNodeContextMenu,\n onSelectionContextMenu = _ref48.onSelectionContextMenu,\n onSelectionStart = _ref48.onSelectionStart,\n onSelectionEnd = _ref48.onSelectionEnd,\n connectionLineType = _ref48.connectionLineType,\n connectionLineStyle = _ref48.connectionLineStyle,\n connectionLineComponent = _ref48.connectionLineComponent,\n connectionLineContainerStyle = _ref48.connectionLineContainerStyle,\n selectionKeyCode = _ref48.selectionKeyCode,\n selectionOnDrag = _ref48.selectionOnDrag,\n selectionMode = _ref48.selectionMode,\n multiSelectionKeyCode = _ref48.multiSelectionKeyCode,\n panActivationKeyCode = _ref48.panActivationKeyCode,\n zoomActivationKeyCode = _ref48.zoomActivationKeyCode,\n deleteKeyCode = _ref48.deleteKeyCode,\n onlyRenderVisibleElements = _ref48.onlyRenderVisibleElements,\n elementsSelectable = _ref48.elementsSelectable,\n defaultViewport = _ref48.defaultViewport,\n translateExtent = _ref48.translateExtent,\n minZoom = _ref48.minZoom,\n maxZoom = _ref48.maxZoom,\n preventScrolling = _ref48.preventScrolling,\n defaultMarkerColor = _ref48.defaultMarkerColor,\n zoomOnScroll = _ref48.zoomOnScroll,\n zoomOnPinch = _ref48.zoomOnPinch,\n panOnScroll = _ref48.panOnScroll,\n panOnScrollSpeed = _ref48.panOnScrollSpeed,\n panOnScrollMode = _ref48.panOnScrollMode,\n zoomOnDoubleClick = _ref48.zoomOnDoubleClick,\n panOnDrag = _ref48.panOnDrag,\n onPaneClick = _ref48.onPaneClick,\n onPaneMouseEnter = _ref48.onPaneMouseEnter,\n onPaneMouseMove = _ref48.onPaneMouseMove,\n onPaneMouseLeave = _ref48.onPaneMouseLeave,\n onPaneScroll = _ref48.onPaneScroll,\n onPaneContextMenu = _ref48.onPaneContextMenu,\n paneClickDistance = _ref48.paneClickDistance,\n nodeClickDistance = _ref48.nodeClickDistance,\n onEdgeContextMenu = _ref48.onEdgeContextMenu,\n onEdgeMouseEnter = _ref48.onEdgeMouseEnter,\n onEdgeMouseMove = _ref48.onEdgeMouseMove,\n onEdgeMouseLeave = _ref48.onEdgeMouseLeave,\n reconnectRadius = _ref48.reconnectRadius,\n onReconnect = _ref48.onReconnect,\n onReconnectStart = _ref48.onReconnectStart,\n onReconnectEnd = _ref48.onReconnectEnd,\n noDragClassName = _ref48.noDragClassName,\n noWheelClassName = _ref48.noWheelClassName,\n noPanClassName = _ref48.noPanClassName,\n disableKeyboardA11y = _ref48.disableKeyboardA11y,\n nodeExtent = _ref48.nodeExtent,\n rfId = _ref48.rfId,\n viewport = _ref48.viewport,\n onViewportChange = _ref48.onViewportChange;\n useNodeOrEdgeTypesWarning(nodeTypes);\n useNodeOrEdgeTypesWarning(edgeTypes);\n useStylesLoadedWarning();\n useOnInitHandler(onInit);\n useViewportSync(viewport);\n return jsx(FlowRenderer, {\n onPaneClick: onPaneClick,\n onPaneMouseEnter: onPaneMouseEnter,\n onPaneMouseMove: onPaneMouseMove,\n onPaneMouseLeave: onPaneMouseLeave,\n onPaneContextMenu: onPaneContextMenu,\n onPaneScroll: onPaneScroll,\n paneClickDistance: paneClickDistance,\n deleteKeyCode: deleteKeyCode,\n selectionKeyCode: selectionKeyCode,\n selectionOnDrag: selectionOnDrag,\n selectionMode: selectionMode,\n onSelectionStart: onSelectionStart,\n onSelectionEnd: onSelectionEnd,\n multiSelectionKeyCode: multiSelectionKeyCode,\n panActivationKeyCode: panActivationKeyCode,\n zoomActivationKeyCode: zoomActivationKeyCode,\n elementsSelectable: elementsSelectable,\n zoomOnScroll: zoomOnScroll,\n zoomOnPinch: zoomOnPinch,\n zoomOnDoubleClick: zoomOnDoubleClick,\n panOnScroll: panOnScroll,\n panOnScrollSpeed: panOnScrollSpeed,\n panOnScrollMode: panOnScrollMode,\n panOnDrag: panOnDrag,\n defaultViewport: defaultViewport,\n translateExtent: translateExtent,\n minZoom: minZoom,\n maxZoom: maxZoom,\n onSelectionContextMenu: onSelectionContextMenu,\n preventScrolling: preventScrolling,\n noDragClassName: noDragClassName,\n noWheelClassName: noWheelClassName,\n noPanClassName: noPanClassName,\n disableKeyboardA11y: disableKeyboardA11y,\n onViewportChange: onViewportChange,\n isControlledViewport: !!viewport,\n children: jsxs(Viewport, {\n children: [jsx(EdgeRenderer, {\n edgeTypes: edgeTypes,\n onEdgeClick: onEdgeClick,\n onEdgeDoubleClick: onEdgeDoubleClick,\n onReconnect: onReconnect,\n onReconnectStart: onReconnectStart,\n onReconnectEnd: onReconnectEnd,\n onlyRenderVisibleElements: onlyRenderVisibleElements,\n onEdgeContextMenu: onEdgeContextMenu,\n onEdgeMouseEnter: onEdgeMouseEnter,\n onEdgeMouseMove: onEdgeMouseMove,\n onEdgeMouseLeave: onEdgeMouseLeave,\n reconnectRadius: reconnectRadius,\n defaultMarkerColor: defaultMarkerColor,\n noPanClassName: noPanClassName,\n disableKeyboardA11y: disableKeyboardA11y,\n rfId: rfId\n }), jsx(ConnectionLineWrapper, {\n style: connectionLineStyle,\n type: connectionLineType,\n component: connectionLineComponent,\n containerStyle: connectionLineContainerStyle\n }), jsx(\"div\", {\n className: \"react-flow__edgelabel-renderer\"\n }), jsx(NodeRenderer, {\n nodeTypes: nodeTypes,\n onNodeClick: onNodeClick,\n onNodeDoubleClick: onNodeDoubleClick,\n onNodeMouseEnter: onNodeMouseEnter,\n onNodeMouseMove: onNodeMouseMove,\n onNodeMouseLeave: onNodeMouseLeave,\n onNodeContextMenu: onNodeContextMenu,\n nodeClickDistance: nodeClickDistance,\n onlyRenderVisibleElements: onlyRenderVisibleElements,\n noPanClassName: noPanClassName,\n noDragClassName: noDragClassName,\n disableKeyboardA11y: disableKeyboardA11y,\n nodeExtent: nodeExtent,\n rfId: rfId\n }), jsx(\"div\", {\n className: \"react-flow__viewport-portal\"\n })]\n })\n });\n}\n\nGraphViewComponent.displayName = 'GraphView';\nvar GraphView = memo(GraphViewComponent);\n\nvar getInitialState = function getInitialState() {\n var _ref50, _ref51;\n\n var _ref49 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n nodes = _ref49.nodes,\n edges = _ref49.edges,\n defaultNodes = _ref49.defaultNodes,\n defaultEdges = _ref49.defaultEdges,\n width = _ref49.width,\n height = _ref49.height,\n fitView = _ref49.fitView,\n nodeOrigin = _ref49.nodeOrigin,\n nodeExtent = _ref49.nodeExtent;\n\n var nodeLookup = new Map();\n var parentLookup = new Map();\n var connectionLookup = new Map();\n var edgeLookup = new Map();\n var storeEdges = (_ref50 = defaultEdges !== null && defaultEdges !== void 0 ? defaultEdges : edges) !== null && _ref50 !== void 0 ? _ref50 : [];\n var storeNodes = (_ref51 = defaultNodes !== null && defaultNodes !== void 0 ? defaultNodes : nodes) !== null && _ref51 !== void 0 ? _ref51 : [];\n var storeNodeOrigin = nodeOrigin !== null && nodeOrigin !== void 0 ? nodeOrigin : [0, 0];\n var storeNodeExtent = nodeExtent !== null && nodeExtent !== void 0 ? nodeExtent : infiniteExtent;\n updateConnectionLookup(connectionLookup, edgeLookup, storeEdges);\n adoptUserNodes(storeNodes, nodeLookup, parentLookup, {\n nodeOrigin: storeNodeOrigin,\n nodeExtent: storeNodeExtent,\n elevateNodesOnSelect: false\n });\n var transform = [0, 0, 1];\n\n if (fitView && width && height) {\n var bounds = getInternalNodesBounds(nodeLookup, {\n filter: function filter(node) {\n return !!((node.width || node.initialWidth) && (node.height || node.initialHeight));\n }\n });\n\n var _getViewportForBounds = getViewportForBounds(bounds, width, height, 0.5, 2, 0.1),\n x = _getViewportForBounds.x,\n y = _getViewportForBounds.y,\n zoom = _getViewportForBounds.zoom;\n\n transform = [x, y, zoom];\n }\n\n return {\n rfId: '1',\n width: 0,\n height: 0,\n transform: transform,\n nodes: storeNodes,\n nodeLookup: nodeLookup,\n parentLookup: parentLookup,\n edges: storeEdges,\n edgeLookup: edgeLookup,\n connectionLookup: connectionLookup,\n onNodesChange: null,\n onEdgesChange: null,\n hasDefaultNodes: defaultNodes !== undefined,\n hasDefaultEdges: defaultEdges !== undefined,\n panZoom: null,\n minZoom: 0.5,\n maxZoom: 2,\n translateExtent: infiniteExtent,\n nodeExtent: storeNodeExtent,\n nodesSelectionActive: false,\n userSelectionActive: false,\n userSelectionRect: null,\n connectionMode: ConnectionMode.Strict,\n domNode: null,\n paneDragging: false,\n noPanClassName: 'nopan',\n nodeOrigin: storeNodeOrigin,\n nodeDragThreshold: 1,\n snapGrid: [15, 15],\n snapToGrid: false,\n nodesDraggable: true,\n nodesConnectable: true,\n nodesFocusable: true,\n edgesFocusable: true,\n edgesReconnectable: true,\n elementsSelectable: true,\n elevateNodesOnSelect: true,\n elevateEdgesOnSelect: false,\n selectNodesOnDrag: true,\n multiSelectionActive: false,\n fitViewQueued: fitView !== null && fitView !== void 0 ? fitView : false,\n fitViewOptions: undefined,\n fitViewResolver: null,\n connection: _objectSpread({}, initialConnection),\n connectionClickStartHandle: null,\n connectOnClick: true,\n ariaLiveMessage: '',\n autoPanOnConnect: true,\n autoPanOnNodeDrag: true,\n autoPanSpeed: 15,\n connectionRadius: 20,\n onError: devWarn,\n isValidConnection: undefined,\n onSelectionChangeHandlers: [],\n lib: 'react',\n debug: false\n };\n};\n\nvar createStore = function createStore(_ref52) {\n var nodes = _ref52.nodes,\n edges = _ref52.edges,\n defaultNodes = _ref52.defaultNodes,\n defaultEdges = _ref52.defaultEdges,\n width = _ref52.width,\n height = _ref52.height,\n fitView = _ref52.fitView,\n nodeOrigin = _ref52.nodeOrigin,\n nodeExtent = _ref52.nodeExtent;\n return createWithEqualityFn(function (set, get) {\n function resolveFitView() {\n return _resolveFitView.apply(this, arguments);\n }\n\n function _resolveFitView() {\n _resolveFitView = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {\n var _get18, nodeLookup, panZoom, fitViewOptions, fitViewResolver, width, height, minZoom, maxZoom;\n\n return _regeneratorRuntime.wrap(function _callee6$(_context6) {\n while (1) {\n switch (_context6.prev = _context6.next) {\n case 0:\n _get18 = get(), nodeLookup = _get18.nodeLookup, panZoom = _get18.panZoom, fitViewOptions = _get18.fitViewOptions, fitViewResolver = _get18.fitViewResolver, width = _get18.width, height = _get18.height, minZoom = _get18.minZoom, maxZoom = _get18.maxZoom;\n\n if (panZoom) {\n _context6.next = 3;\n break;\n }\n\n return _context6.abrupt(\"return\");\n\n case 3:\n _context6.next = 5;\n return fitViewport({\n nodes: nodeLookup,\n width: width,\n height: height,\n panZoom: panZoom,\n minZoom: minZoom,\n maxZoom: maxZoom\n }, fitViewOptions);\n\n case 5:\n fitViewResolver === null || fitViewResolver === void 0 ? void 0 : fitViewResolver.resolve(true);\n /**\n * wait for the fitViewport to resolve before deleting the resolver,\n * we want to reuse the old resolver if the user calls fitView again in the mean time\n */\n\n set({\n fitViewResolver: null\n });\n\n case 7:\n case \"end\":\n return _context6.stop();\n }\n }\n }, _callee6);\n }));\n return _resolveFitView.apply(this, arguments);\n }\n\n return _objectSpread(_objectSpread({}, getInitialState({\n nodes: nodes,\n edges: edges,\n width: width,\n height: height,\n fitView: fitView,\n nodeOrigin: nodeOrigin,\n nodeExtent: nodeExtent,\n defaultNodes: defaultNodes,\n defaultEdges: defaultEdges\n })), {}, {\n setNodes: function setNodes(nodes) {\n var _get = get(),\n nodeLookup = _get.nodeLookup,\n parentLookup = _get.parentLookup,\n nodeOrigin = _get.nodeOrigin,\n elevateNodesOnSelect = _get.elevateNodesOnSelect,\n fitViewQueued = _get.fitViewQueued;\n /*\n * setNodes() is called exclusively in response to user actions:\n * - either when the `` prop is updated in the controlled ReactFlow setup,\n * - or when the user calls something like `reactFlowInstance.setNodes()` in an uncontrolled ReactFlow setup.\n *\n * When this happens, we take the note objects passed by the user and extend them with fields\n * relevant for internal React Flow operations.\n */\n\n\n var nodesInitialized = adoptUserNodes(nodes, nodeLookup, parentLookup, {\n nodeOrigin: nodeOrigin,\n nodeExtent: nodeExtent,\n elevateNodesOnSelect: elevateNodesOnSelect,\n checkEquality: true\n });\n\n if (fitViewQueued && nodesInitialized) {\n resolveFitView();\n set({\n nodes: nodes,\n fitViewQueued: false,\n fitViewOptions: undefined\n });\n } else {\n set({\n nodes: nodes\n });\n }\n },\n setEdges: function setEdges(edges) {\n var _get2 = get(),\n connectionLookup = _get2.connectionLookup,\n edgeLookup = _get2.edgeLookup;\n\n updateConnectionLookup(connectionLookup, edgeLookup, edges);\n set({\n edges: edges\n });\n },\n setDefaultNodesAndEdges: function setDefaultNodesAndEdges(nodes, edges) {\n if (nodes) {\n var _get3 = get(),\n setNodes = _get3.setNodes;\n\n setNodes(nodes);\n set({\n hasDefaultNodes: true\n });\n }\n\n if (edges) {\n var _get4 = get(),\n setEdges = _get4.setEdges;\n\n setEdges(edges);\n set({\n hasDefaultEdges: true\n });\n }\n },\n\n /*\n * Every node gets registerd at a ResizeObserver. Whenever a node\n * changes its dimensions, this function is called to measure the\n * new dimensions and update the nodes.\n */\n updateNodeInternals: function updateNodeInternals(updates) {\n var _get5 = get(),\n triggerNodeChanges = _get5.triggerNodeChanges,\n nodeLookup = _get5.nodeLookup,\n parentLookup = _get5.parentLookup,\n domNode = _get5.domNode,\n nodeOrigin = _get5.nodeOrigin,\n nodeExtent = _get5.nodeExtent,\n debug = _get5.debug,\n fitViewQueued = _get5.fitViewQueued;\n\n var _updateNodeInternals2 = _updateNodeInternals(updates, nodeLookup, parentLookup, domNode, nodeOrigin, nodeExtent),\n changes = _updateNodeInternals2.changes,\n updatedInternals = _updateNodeInternals2.updatedInternals;\n\n if (!updatedInternals) {\n return;\n }\n\n updateAbsolutePositions(nodeLookup, parentLookup, {\n nodeOrigin: nodeOrigin,\n nodeExtent: nodeExtent\n });\n\n if (fitViewQueued) {\n resolveFitView();\n set({\n fitViewQueued: false,\n fitViewOptions: undefined\n });\n } else {\n // we always want to trigger useStore calls whenever updateNodeInternals is called\n set({});\n }\n\n if ((changes === null || changes === void 0 ? void 0 : changes.length) > 0) {\n if (debug) {\n console.log('React Flow: trigger node changes', changes);\n }\n\n triggerNodeChanges === null || triggerNodeChanges === void 0 ? void 0 : triggerNodeChanges(changes);\n }\n },\n updateNodePositions: function updateNodePositions(nodeDragItems) {\n var dragging = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var parentExpandChildren = [];\n var changes = [];\n\n var _get6 = get(),\n nodeLookup = _get6.nodeLookup,\n triggerNodeChanges = _get6.triggerNodeChanges;\n\n var _iterator17 = _createForOfIteratorHelper(nodeDragItems),\n _step17;\n\n try {\n for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {\n var _step17$value = _slicedToArray(_step17.value, 2),\n id = _step17$value[0],\n dragItem = _step17$value[1];\n\n // we are using the nodelookup to be sure to use the current expandParent and parentId value\n var node = nodeLookup.get(id);\n var expandParent = !!(node !== null && node !== void 0 && node.expandParent && node !== null && node !== void 0 && node.parentId && dragItem !== null && dragItem !== void 0 && dragItem.position);\n var change = {\n id: id,\n type: 'position',\n position: expandParent ? {\n x: Math.max(0, dragItem.position.x),\n y: Math.max(0, dragItem.position.y)\n } : dragItem.position,\n dragging: dragging\n };\n\n if (expandParent && node.parentId) {\n var _dragItem$measured$wi, _dragItem$measured$he;\n\n parentExpandChildren.push({\n id: id,\n parentId: node.parentId,\n rect: _objectSpread(_objectSpread({}, dragItem.internals.positionAbsolute), {}, {\n width: (_dragItem$measured$wi = dragItem.measured.width) !== null && _dragItem$measured$wi !== void 0 ? _dragItem$measured$wi : 0,\n height: (_dragItem$measured$he = dragItem.measured.height) !== null && _dragItem$measured$he !== void 0 ? _dragItem$measured$he : 0\n })\n });\n }\n\n changes.push(change);\n }\n } catch (err) {\n _iterator17.e(err);\n } finally {\n _iterator17.f();\n }\n\n if (parentExpandChildren.length > 0) {\n var _get7 = get(),\n parentLookup = _get7.parentLookup,\n _nodeOrigin = _get7.nodeOrigin;\n\n var parentExpandChanges = handleExpandParent(parentExpandChildren, nodeLookup, parentLookup, _nodeOrigin);\n changes.push.apply(changes, _toConsumableArray(parentExpandChanges));\n }\n\n triggerNodeChanges(changes);\n },\n triggerNodeChanges: function triggerNodeChanges(changes) {\n var _get8 = get(),\n onNodesChange = _get8.onNodesChange,\n setNodes = _get8.setNodes,\n nodes = _get8.nodes,\n hasDefaultNodes = _get8.hasDefaultNodes,\n debug = _get8.debug;\n\n if (changes !== null && changes !== void 0 && changes.length) {\n if (hasDefaultNodes) {\n var updatedNodes = applyNodeChanges(changes, nodes);\n setNodes(updatedNodes);\n }\n\n if (debug) {\n console.log('React Flow: trigger node changes', changes);\n }\n\n onNodesChange === null || onNodesChange === void 0 ? void 0 : onNodesChange(changes);\n }\n },\n triggerEdgeChanges: function triggerEdgeChanges(changes) {\n var _get9 = get(),\n onEdgesChange = _get9.onEdgesChange,\n setEdges = _get9.setEdges,\n edges = _get9.edges,\n hasDefaultEdges = _get9.hasDefaultEdges,\n debug = _get9.debug;\n\n if (changes !== null && changes !== void 0 && changes.length) {\n if (hasDefaultEdges) {\n var updatedEdges = applyEdgeChanges(changes, edges);\n setEdges(updatedEdges);\n }\n\n if (debug) {\n console.log('React Flow: trigger edge changes', changes);\n }\n\n onEdgesChange === null || onEdgesChange === void 0 ? void 0 : onEdgesChange(changes);\n }\n },\n addSelectedNodes: function addSelectedNodes(selectedNodeIds) {\n var _get10 = get(),\n multiSelectionActive = _get10.multiSelectionActive,\n edgeLookup = _get10.edgeLookup,\n nodeLookup = _get10.nodeLookup,\n triggerNodeChanges = _get10.triggerNodeChanges,\n triggerEdgeChanges = _get10.triggerEdgeChanges;\n\n if (multiSelectionActive) {\n var nodeChanges = selectedNodeIds.map(function (nodeId) {\n return createSelectionChange(nodeId, true);\n });\n triggerNodeChanges(nodeChanges);\n return;\n }\n\n triggerNodeChanges(getSelectionChanges(nodeLookup, new Set(_toConsumableArray(selectedNodeIds)), true));\n triggerEdgeChanges(getSelectionChanges(edgeLookup));\n },\n addSelectedEdges: function addSelectedEdges(selectedEdgeIds) {\n var _get11 = get(),\n multiSelectionActive = _get11.multiSelectionActive,\n edgeLookup = _get11.edgeLookup,\n nodeLookup = _get11.nodeLookup,\n triggerNodeChanges = _get11.triggerNodeChanges,\n triggerEdgeChanges = _get11.triggerEdgeChanges;\n\n if (multiSelectionActive) {\n var changedEdges = selectedEdgeIds.map(function (edgeId) {\n return createSelectionChange(edgeId, true);\n });\n triggerEdgeChanges(changedEdges);\n return;\n }\n\n triggerEdgeChanges(getSelectionChanges(edgeLookup, new Set(_toConsumableArray(selectedEdgeIds))));\n triggerNodeChanges(getSelectionChanges(nodeLookup, new Set(), true));\n },\n unselectNodesAndEdges: function unselectNodesAndEdges() {\n var _ref53 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n nodes = _ref53.nodes,\n edges = _ref53.edges;\n\n var _get12 = get(),\n storeEdges = _get12.edges,\n storeNodes = _get12.nodes,\n nodeLookup = _get12.nodeLookup,\n triggerNodeChanges = _get12.triggerNodeChanges,\n triggerEdgeChanges = _get12.triggerEdgeChanges;\n\n var nodesToUnselect = nodes ? nodes : storeNodes;\n var edgesToUnselect = edges ? edges : storeEdges;\n var nodeChanges = nodesToUnselect.map(function (n) {\n var internalNode = nodeLookup.get(n.id);\n\n if (internalNode) {\n /*\n * we need to unselect the internal node that was selected previously before we\n * send the change to the user to prevent it to be selected while dragging the new node\n */\n internalNode.selected = false;\n }\n\n return createSelectionChange(n.id, false);\n });\n var edgeChanges = edgesToUnselect.map(function (edge) {\n return createSelectionChange(edge.id, false);\n });\n triggerNodeChanges(nodeChanges);\n triggerEdgeChanges(edgeChanges);\n },\n setMinZoom: function setMinZoom(minZoom) {\n var _get13 = get(),\n panZoom = _get13.panZoom,\n maxZoom = _get13.maxZoom;\n\n panZoom === null || panZoom === void 0 ? void 0 : panZoom.setScaleExtent([minZoom, maxZoom]);\n set({\n minZoom: minZoom\n });\n },\n setMaxZoom: function setMaxZoom(maxZoom) {\n var _get14 = get(),\n panZoom = _get14.panZoom,\n minZoom = _get14.minZoom;\n\n panZoom === null || panZoom === void 0 ? void 0 : panZoom.setScaleExtent([minZoom, maxZoom]);\n set({\n maxZoom: maxZoom\n });\n },\n setTranslateExtent: function setTranslateExtent(translateExtent) {\n var _get$panZoom;\n\n (_get$panZoom = get().panZoom) === null || _get$panZoom === void 0 ? void 0 : _get$panZoom.setTranslateExtent(translateExtent);\n set({\n translateExtent: translateExtent\n });\n },\n setPaneClickDistance: function setPaneClickDistance(clickDistance) {\n var _get$panZoom2;\n\n (_get$panZoom2 = get().panZoom) === null || _get$panZoom2 === void 0 ? void 0 : _get$panZoom2.setClickDistance(clickDistance);\n },\n resetSelectedElements: function resetSelectedElements() {\n var _get15 = get(),\n edges = _get15.edges,\n nodes = _get15.nodes,\n triggerNodeChanges = _get15.triggerNodeChanges,\n triggerEdgeChanges = _get15.triggerEdgeChanges;\n\n var nodeChanges = nodes.reduce(function (res, node) {\n return node.selected ? [].concat(_toConsumableArray(res), [createSelectionChange(node.id, false)]) : res;\n }, []);\n var edgeChanges = edges.reduce(function (res, edge) {\n return edge.selected ? [].concat(_toConsumableArray(res), [createSelectionChange(edge.id, false)]) : res;\n }, []);\n triggerNodeChanges(nodeChanges);\n triggerEdgeChanges(edgeChanges);\n },\n setNodeExtent: function setNodeExtent(nextNodeExtent) {\n var _get16 = get(),\n nodes = _get16.nodes,\n nodeLookup = _get16.nodeLookup,\n parentLookup = _get16.parentLookup,\n nodeOrigin = _get16.nodeOrigin,\n elevateNodesOnSelect = _get16.elevateNodesOnSelect,\n nodeExtent = _get16.nodeExtent;\n\n if (nextNodeExtent[0][0] === nodeExtent[0][0] && nextNodeExtent[0][1] === nodeExtent[0][1] && nextNodeExtent[1][0] === nodeExtent[1][0] && nextNodeExtent[1][1] === nodeExtent[1][1]) {\n return;\n }\n\n adoptUserNodes(nodes, nodeLookup, parentLookup, {\n nodeOrigin: nodeOrigin,\n nodeExtent: nextNodeExtent,\n elevateNodesOnSelect: elevateNodesOnSelect,\n checkEquality: false\n });\n set({\n nodeExtent: nextNodeExtent\n });\n },\n panBy: function panBy(delta) {\n var _get17 = get(),\n transform = _get17.transform,\n width = _get17.width,\n height = _get17.height,\n panZoom = _get17.panZoom,\n translateExtent = _get17.translateExtent;\n\n return _panBy({\n delta: delta,\n panZoom: panZoom,\n transform: transform,\n translateExtent: translateExtent,\n width: width,\n height: height\n });\n },\n cancelConnection: function cancelConnection() {\n set({\n connection: _objectSpread({}, initialConnection)\n });\n },\n updateConnection: function updateConnection(connection) {\n set({\n connection: connection\n });\n },\n reset: function reset() {\n return set(_objectSpread({}, getInitialState()));\n }\n });\n }, Object.is);\n};\n/**\n * The `` component is a [context provider](https://react.dev/learn/passing-data-deeply-with-context#)\n * that makes it possible to access a flow's internal state outside of the\n * [``](/api-reference/react-flow) component. Many of the hooks we\n * provide rely on this component to work.\n * @public\n *\n * @example\n * ```tsx\n *import { ReactFlow, ReactFlowProvider, useNodes } from '@xyflow/react'\n *\n *export default function Flow() {\n * return (\n * \n * \n * \n * \n * );\n *}\n *\n *function Sidebar() {\n * // This hook will only work if the component it's used in is a child of a\n * // .\n * const nodes = useNodes()\n *\n * return ;\n *}\n *```\n *\n * @remarks If you're using a router and want your flow's state to persist across routes,\n * it's vital that you place the `` component _outside_ of\n * your router. If you have multiple flows on the same page you will need to use a separate\n * `` for each flow.\n */\n\n\nfunction ReactFlowProvider(_ref54) {\n var nodes = _ref54.initialNodes,\n edges = _ref54.initialEdges,\n defaultNodes = _ref54.defaultNodes,\n defaultEdges = _ref54.defaultEdges,\n width = _ref54.initialWidth,\n height = _ref54.initialHeight,\n fitView = _ref54.fitView,\n nodeOrigin = _ref54.nodeOrigin,\n nodeExtent = _ref54.nodeExtent,\n children = _ref54.children;\n\n var _useState19 = useState(function () {\n return createStore({\n nodes: nodes,\n edges: edges,\n defaultNodes: defaultNodes,\n defaultEdges: defaultEdges,\n width: width,\n height: height,\n fitView: fitView,\n nodeOrigin: nodeOrigin,\n nodeExtent: nodeExtent\n });\n }),\n _useState20 = _slicedToArray(_useState19, 1),\n store = _useState20[0];\n\n return jsx(Provider$1, {\n value: store,\n children: jsx(BatchProvider, {\n children: children\n })\n });\n}\n\nfunction Wrapper(_ref55) {\n var children = _ref55.children,\n nodes = _ref55.nodes,\n edges = _ref55.edges,\n defaultNodes = _ref55.defaultNodes,\n defaultEdges = _ref55.defaultEdges,\n width = _ref55.width,\n height = _ref55.height,\n fitView = _ref55.fitView,\n nodeOrigin = _ref55.nodeOrigin,\n nodeExtent = _ref55.nodeExtent;\n var isWrapped = useContext(StoreContext);\n\n if (isWrapped) {\n /*\n * we need to wrap it with a fragment because it's not allowed for children to be a ReactNode\n * https://github.com/DefinitelyTyped/DefinitelyTyped/issues/18051\n */\n return jsx(Fragment, {\n children: children\n });\n }\n\n return jsx(ReactFlowProvider, {\n initialNodes: nodes,\n initialEdges: edges,\n defaultNodes: defaultNodes,\n defaultEdges: defaultEdges,\n initialWidth: width,\n initialHeight: height,\n fitView: fitView,\n nodeOrigin: nodeOrigin,\n nodeExtent: nodeExtent,\n children: children\n });\n}\n\nvar wrapperStyle = {\n width: '100%',\n height: '100%',\n overflow: 'hidden',\n position: 'relative',\n zIndex: 0\n};\n\nfunction ReactFlow(_ref56, ref) {\n var nodes = _ref56.nodes,\n edges = _ref56.edges,\n defaultNodes = _ref56.defaultNodes,\n defaultEdges = _ref56.defaultEdges,\n className = _ref56.className,\n nodeTypes = _ref56.nodeTypes,\n edgeTypes = _ref56.edgeTypes,\n onNodeClick = _ref56.onNodeClick,\n onEdgeClick = _ref56.onEdgeClick,\n onInit = _ref56.onInit,\n onMove = _ref56.onMove,\n onMoveStart = _ref56.onMoveStart,\n onMoveEnd = _ref56.onMoveEnd,\n onConnect = _ref56.onConnect,\n onConnectStart = _ref56.onConnectStart,\n onConnectEnd = _ref56.onConnectEnd,\n onClickConnectStart = _ref56.onClickConnectStart,\n onClickConnectEnd = _ref56.onClickConnectEnd,\n onNodeMouseEnter = _ref56.onNodeMouseEnter,\n onNodeMouseMove = _ref56.onNodeMouseMove,\n onNodeMouseLeave = _ref56.onNodeMouseLeave,\n onNodeContextMenu = _ref56.onNodeContextMenu,\n onNodeDoubleClick = _ref56.onNodeDoubleClick,\n onNodeDragStart = _ref56.onNodeDragStart,\n onNodeDrag = _ref56.onNodeDrag,\n onNodeDragStop = _ref56.onNodeDragStop,\n onNodesDelete = _ref56.onNodesDelete,\n onEdgesDelete = _ref56.onEdgesDelete,\n onDelete = _ref56.onDelete,\n onSelectionChange = _ref56.onSelectionChange,\n onSelectionDragStart = _ref56.onSelectionDragStart,\n onSelectionDrag = _ref56.onSelectionDrag,\n onSelectionDragStop = _ref56.onSelectionDragStop,\n onSelectionContextMenu = _ref56.onSelectionContextMenu,\n onSelectionStart = _ref56.onSelectionStart,\n onSelectionEnd = _ref56.onSelectionEnd,\n onBeforeDelete = _ref56.onBeforeDelete,\n connectionMode = _ref56.connectionMode,\n _ref56$connectionLine = _ref56.connectionLineType,\n connectionLineType = _ref56$connectionLine === void 0 ? ConnectionLineType.Bezier : _ref56$connectionLine,\n connectionLineStyle = _ref56.connectionLineStyle,\n connectionLineComponent = _ref56.connectionLineComponent,\n connectionLineContainerStyle = _ref56.connectionLineContainerStyle,\n _ref56$deleteKeyCode = _ref56.deleteKeyCode,\n deleteKeyCode = _ref56$deleteKeyCode === void 0 ? 'Backspace' : _ref56$deleteKeyCode,\n _ref56$selectionKeyCo = _ref56.selectionKeyCode,\n selectionKeyCode = _ref56$selectionKeyCo === void 0 ? 'Shift' : _ref56$selectionKeyCo,\n _ref56$selectionOnDra = _ref56.selectionOnDrag,\n selectionOnDrag = _ref56$selectionOnDra === void 0 ? false : _ref56$selectionOnDra,\n _ref56$selectionMode = _ref56.selectionMode,\n selectionMode = _ref56$selectionMode === void 0 ? SelectionMode.Full : _ref56$selectionMode,\n _ref56$panActivationK = _ref56.panActivationKeyCode,\n panActivationKeyCode = _ref56$panActivationK === void 0 ? 'Space' : _ref56$panActivationK,\n _ref56$multiSelection = _ref56.multiSelectionKeyCode,\n multiSelectionKeyCode = _ref56$multiSelection === void 0 ? isMacOs() ? 'Meta' : 'Control' : _ref56$multiSelection,\n _ref56$zoomActivation = _ref56.zoomActivationKeyCode,\n zoomActivationKeyCode = _ref56$zoomActivation === void 0 ? isMacOs() ? 'Meta' : 'Control' : _ref56$zoomActivation,\n snapToGrid = _ref56.snapToGrid,\n snapGrid = _ref56.snapGrid,\n _ref56$onlyRenderVisi = _ref56.onlyRenderVisibleElements,\n onlyRenderVisibleElements = _ref56$onlyRenderVisi === void 0 ? false : _ref56$onlyRenderVisi,\n selectNodesOnDrag = _ref56.selectNodesOnDrag,\n nodesDraggable = _ref56.nodesDraggable,\n nodesConnectable = _ref56.nodesConnectable,\n nodesFocusable = _ref56.nodesFocusable,\n _ref56$nodeOrigin = _ref56.nodeOrigin,\n nodeOrigin = _ref56$nodeOrigin === void 0 ? defaultNodeOrigin : _ref56$nodeOrigin,\n edgesFocusable = _ref56.edgesFocusable,\n edgesReconnectable = _ref56.edgesReconnectable,\n _ref56$elementsSelect = _ref56.elementsSelectable,\n elementsSelectable = _ref56$elementsSelect === void 0 ? true : _ref56$elementsSelect,\n _ref56$defaultViewpor = _ref56.defaultViewport,\n defaultViewport$1 = _ref56$defaultViewpor === void 0 ? defaultViewport : _ref56$defaultViewpor,\n _ref56$minZoom = _ref56.minZoom,\n minZoom = _ref56$minZoom === void 0 ? 0.5 : _ref56$minZoom,\n _ref56$maxZoom = _ref56.maxZoom,\n maxZoom = _ref56$maxZoom === void 0 ? 2 : _ref56$maxZoom,\n _ref56$translateExten = _ref56.translateExtent,\n translateExtent = _ref56$translateExten === void 0 ? infiniteExtent : _ref56$translateExten,\n _ref56$preventScrolli = _ref56.preventScrolling,\n preventScrolling = _ref56$preventScrolli === void 0 ? true : _ref56$preventScrolli,\n nodeExtent = _ref56.nodeExtent,\n _ref56$defaultMarkerC = _ref56.defaultMarkerColor,\n defaultMarkerColor = _ref56$defaultMarkerC === void 0 ? '#b1b1b7' : _ref56$defaultMarkerC,\n _ref56$zoomOnScroll = _ref56.zoomOnScroll,\n zoomOnScroll = _ref56$zoomOnScroll === void 0 ? true : _ref56$zoomOnScroll,\n _ref56$zoomOnPinch = _ref56.zoomOnPinch,\n zoomOnPinch = _ref56$zoomOnPinch === void 0 ? true : _ref56$zoomOnPinch,\n _ref56$panOnScroll = _ref56.panOnScroll,\n panOnScroll = _ref56$panOnScroll === void 0 ? false : _ref56$panOnScroll,\n _ref56$panOnScrollSpe = _ref56.panOnScrollSpeed,\n panOnScrollSpeed = _ref56$panOnScrollSpe === void 0 ? 0.5 : _ref56$panOnScrollSpe,\n _ref56$panOnScrollMod = _ref56.panOnScrollMode,\n panOnScrollMode = _ref56$panOnScrollMod === void 0 ? PanOnScrollMode.Free : _ref56$panOnScrollMod,\n _ref56$zoomOnDoubleCl = _ref56.zoomOnDoubleClick,\n zoomOnDoubleClick = _ref56$zoomOnDoubleCl === void 0 ? true : _ref56$zoomOnDoubleCl,\n _ref56$panOnDrag = _ref56.panOnDrag,\n panOnDrag = _ref56$panOnDrag === void 0 ? true : _ref56$panOnDrag,\n onPaneClick = _ref56.onPaneClick,\n onPaneMouseEnter = _ref56.onPaneMouseEnter,\n onPaneMouseMove = _ref56.onPaneMouseMove,\n onPaneMouseLeave = _ref56.onPaneMouseLeave,\n onPaneScroll = _ref56.onPaneScroll,\n onPaneContextMenu = _ref56.onPaneContextMenu,\n _ref56$paneClickDista = _ref56.paneClickDistance,\n paneClickDistance = _ref56$paneClickDista === void 0 ? 0 : _ref56$paneClickDista,\n _ref56$nodeClickDista = _ref56.nodeClickDistance,\n nodeClickDistance = _ref56$nodeClickDista === void 0 ? 0 : _ref56$nodeClickDista,\n children = _ref56.children,\n onReconnect = _ref56.onReconnect,\n onReconnectStart = _ref56.onReconnectStart,\n onReconnectEnd = _ref56.onReconnectEnd,\n onEdgeContextMenu = _ref56.onEdgeContextMenu,\n onEdgeDoubleClick = _ref56.onEdgeDoubleClick,\n onEdgeMouseEnter = _ref56.onEdgeMouseEnter,\n onEdgeMouseMove = _ref56.onEdgeMouseMove,\n onEdgeMouseLeave = _ref56.onEdgeMouseLeave,\n _ref56$reconnectRadiu = _ref56.reconnectRadius,\n reconnectRadius = _ref56$reconnectRadiu === void 0 ? 10 : _ref56$reconnectRadiu,\n onNodesChange = _ref56.onNodesChange,\n onEdgesChange = _ref56.onEdgesChange,\n _ref56$noDragClassNam = _ref56.noDragClassName,\n noDragClassName = _ref56$noDragClassNam === void 0 ? 'nodrag' : _ref56$noDragClassNam,\n _ref56$noWheelClassNa = _ref56.noWheelClassName,\n noWheelClassName = _ref56$noWheelClassNa === void 0 ? 'nowheel' : _ref56$noWheelClassNa,\n _ref56$noPanClassName = _ref56.noPanClassName,\n noPanClassName = _ref56$noPanClassName === void 0 ? 'nopan' : _ref56$noPanClassName,\n fitView = _ref56.fitView,\n fitViewOptions = _ref56.fitViewOptions,\n connectOnClick = _ref56.connectOnClick,\n attributionPosition = _ref56.attributionPosition,\n proOptions = _ref56.proOptions,\n defaultEdgeOptions = _ref56.defaultEdgeOptions,\n elevateNodesOnSelect = _ref56.elevateNodesOnSelect,\n elevateEdgesOnSelect = _ref56.elevateEdgesOnSelect,\n _ref56$disableKeyboar = _ref56.disableKeyboardA11y,\n disableKeyboardA11y = _ref56$disableKeyboar === void 0 ? false : _ref56$disableKeyboar,\n autoPanOnConnect = _ref56.autoPanOnConnect,\n autoPanOnNodeDrag = _ref56.autoPanOnNodeDrag,\n autoPanSpeed = _ref56.autoPanSpeed,\n connectionRadius = _ref56.connectionRadius,\n isValidConnection = _ref56.isValidConnection,\n onError = _ref56.onError,\n style = _ref56.style,\n id = _ref56.id,\n nodeDragThreshold = _ref56.nodeDragThreshold,\n viewport = _ref56.viewport,\n onViewportChange = _ref56.onViewportChange,\n width = _ref56.width,\n height = _ref56.height,\n _ref56$colorMode = _ref56.colorMode,\n colorMode = _ref56$colorMode === void 0 ? 'light' : _ref56$colorMode,\n debug = _ref56.debug,\n onScroll = _ref56.onScroll,\n rest = _objectWithoutProperties(_ref56, _excluded6);\n\n var rfId = id || '1';\n var colorModeClassName = useColorModeClass(colorMode); // Undo scroll events, preventing viewport from shifting when nodes outside of it are focused\n\n var wrapperOnScroll = useCallback(function (e) {\n e.currentTarget.scrollTo({\n top: 0,\n left: 0,\n behavior: 'instant'\n });\n onScroll === null || onScroll === void 0 ? void 0 : onScroll(e);\n }, [onScroll]);\n return jsx(\"div\", _objectSpread(_objectSpread({\n \"data-testid\": \"rf__wrapper\"\n }, rest), {}, {\n onScroll: wrapperOnScroll,\n style: _objectSpread(_objectSpread({}, style), wrapperStyle),\n ref: ref,\n className: cc(['react-flow', className, colorModeClassName]),\n id: id,\n children: jsxs(Wrapper, {\n nodes: nodes,\n edges: edges,\n width: width,\n height: height,\n fitView: fitView,\n nodeOrigin: nodeOrigin,\n nodeExtent: nodeExtent,\n children: [jsx(GraphView, {\n onInit: onInit,\n onNodeClick: onNodeClick,\n onEdgeClick: onEdgeClick,\n onNodeMouseEnter: onNodeMouseEnter,\n onNodeMouseMove: onNodeMouseMove,\n onNodeMouseLeave: onNodeMouseLeave,\n onNodeContextMenu: onNodeContextMenu,\n onNodeDoubleClick: onNodeDoubleClick,\n nodeTypes: nodeTypes,\n edgeTypes: edgeTypes,\n connectionLineType: connectionLineType,\n connectionLineStyle: connectionLineStyle,\n connectionLineComponent: connectionLineComponent,\n connectionLineContainerStyle: connectionLineContainerStyle,\n selectionKeyCode: selectionKeyCode,\n selectionOnDrag: selectionOnDrag,\n selectionMode: selectionMode,\n deleteKeyCode: deleteKeyCode,\n multiSelectionKeyCode: multiSelectionKeyCode,\n panActivationKeyCode: panActivationKeyCode,\n zoomActivationKeyCode: zoomActivationKeyCode,\n onlyRenderVisibleElements: onlyRenderVisibleElements,\n defaultViewport: defaultViewport$1,\n translateExtent: translateExtent,\n minZoom: minZoom,\n maxZoom: maxZoom,\n preventScrolling: preventScrolling,\n zoomOnScroll: zoomOnScroll,\n zoomOnPinch: zoomOnPinch,\n zoomOnDoubleClick: zoomOnDoubleClick,\n panOnScroll: panOnScroll,\n panOnScrollSpeed: panOnScrollSpeed,\n panOnScrollMode: panOnScrollMode,\n panOnDrag: panOnDrag,\n onPaneClick: onPaneClick,\n onPaneMouseEnter: onPaneMouseEnter,\n onPaneMouseMove: onPaneMouseMove,\n onPaneMouseLeave: onPaneMouseLeave,\n onPaneScroll: onPaneScroll,\n onPaneContextMenu: onPaneContextMenu,\n paneClickDistance: paneClickDistance,\n nodeClickDistance: nodeClickDistance,\n onSelectionContextMenu: onSelectionContextMenu,\n onSelectionStart: onSelectionStart,\n onSelectionEnd: onSelectionEnd,\n onReconnect: onReconnect,\n onReconnectStart: onReconnectStart,\n onReconnectEnd: onReconnectEnd,\n onEdgeContextMenu: onEdgeContextMenu,\n onEdgeDoubleClick: onEdgeDoubleClick,\n onEdgeMouseEnter: onEdgeMouseEnter,\n onEdgeMouseMove: onEdgeMouseMove,\n onEdgeMouseLeave: onEdgeMouseLeave,\n reconnectRadius: reconnectRadius,\n defaultMarkerColor: defaultMarkerColor,\n noDragClassName: noDragClassName,\n noWheelClassName: noWheelClassName,\n noPanClassName: noPanClassName,\n rfId: rfId,\n disableKeyboardA11y: disableKeyboardA11y,\n nodeExtent: nodeExtent,\n viewport: viewport,\n onViewportChange: onViewportChange\n }), jsx(StoreUpdater, {\n nodes: nodes,\n edges: edges,\n defaultNodes: defaultNodes,\n defaultEdges: defaultEdges,\n onConnect: onConnect,\n onConnectStart: onConnectStart,\n onConnectEnd: onConnectEnd,\n onClickConnectStart: onClickConnectStart,\n onClickConnectEnd: onClickConnectEnd,\n nodesDraggable: nodesDraggable,\n nodesConnectable: nodesConnectable,\n nodesFocusable: nodesFocusable,\n edgesFocusable: edgesFocusable,\n edgesReconnectable: edgesReconnectable,\n elementsSelectable: elementsSelectable,\n elevateNodesOnSelect: elevateNodesOnSelect,\n elevateEdgesOnSelect: elevateEdgesOnSelect,\n minZoom: minZoom,\n maxZoom: maxZoom,\n nodeExtent: nodeExtent,\n onNodesChange: onNodesChange,\n onEdgesChange: onEdgesChange,\n snapToGrid: snapToGrid,\n snapGrid: snapGrid,\n connectionMode: connectionMode,\n translateExtent: translateExtent,\n connectOnClick: connectOnClick,\n defaultEdgeOptions: defaultEdgeOptions,\n fitView: fitView,\n fitViewOptions: fitViewOptions,\n onNodesDelete: onNodesDelete,\n onEdgesDelete: onEdgesDelete,\n onDelete: onDelete,\n onNodeDragStart: onNodeDragStart,\n onNodeDrag: onNodeDrag,\n onNodeDragStop: onNodeDragStop,\n onSelectionDrag: onSelectionDrag,\n onSelectionDragStart: onSelectionDragStart,\n onSelectionDragStop: onSelectionDragStop,\n onMove: onMove,\n onMoveStart: onMoveStart,\n onMoveEnd: onMoveEnd,\n noPanClassName: noPanClassName,\n nodeOrigin: nodeOrigin,\n rfId: rfId,\n autoPanOnConnect: autoPanOnConnect,\n autoPanOnNodeDrag: autoPanOnNodeDrag,\n autoPanSpeed: autoPanSpeed,\n onError: onError,\n connectionRadius: connectionRadius,\n isValidConnection: isValidConnection,\n selectNodesOnDrag: selectNodesOnDrag,\n nodeDragThreshold: nodeDragThreshold,\n onBeforeDelete: onBeforeDelete,\n paneClickDistance: paneClickDistance,\n debug: debug\n }), jsx(SelectionListener, {\n onSelectionChange: onSelectionChange\n }), children, jsx(Attribution, {\n proOptions: proOptions,\n position: attributionPosition\n }), jsx(A11yDescriptions, {\n rfId: rfId,\n disableKeyboardA11y: disableKeyboardA11y\n })]\n })\n }));\n}\n/**\n * The `` component is the heart of your React Flow application.\n * It renders your nodes and edges and handles user interaction\n *\n * @public\n *\n * @example\n * ```tsx\n *import { ReactFlow } from '@xyflow/react'\n *\n *export default function Flow() {\n * return ();\n *}\n *```\n */\n\n\nvar index = fixedForwardRef(ReactFlow);\n\nvar selector$6 = function selector$6(s) {\n var _s$domNode;\n\n return (_s$domNode = s.domNode) === null || _s$domNode === void 0 ? void 0 : _s$domNode.querySelector('.react-flow__edgelabel-renderer');\n};\n/**\n * Edges are SVG-based. If you want to render more complex labels you can use the\n * `` component to access a div based renderer. This component\n * is a portal that renders the label in a `
` that is positioned on top of\n * the edges. You can see an example usage of the component in the\n * [edge label renderer example](/examples/edges/edge-label-renderer).\n * @public\n *\n * @example\n * ```jsx\n * import React from 'react';\n * import { getBezierPath, EdgeLabelRenderer, BaseEdge } from '@xyflow/react';\n *\n * export function CustomEdge({ id, data, ...props }) {\n * const [edgePath, labelX, labelY] = getBezierPath(props);\n *\n * return (\n * <>\n * \n * \n * \n * {data.label}\n *
\n *
\n * \n * );\n * };\n * ```\n *\n * @remarks The `` has no pointer events by default. If you want to\n * add mouse interactions you need to set the style `pointerEvents: all` and add\n * the `nopan` class on the label or the element you want to interact with.\n */\n\n\nfunction EdgeLabelRenderer(_ref57) {\n var children = _ref57.children;\n var edgeLabelRenderer = useStore(selector$6);\n\n if (!edgeLabelRenderer) {\n return null;\n }\n\n return createPortal(children, edgeLabelRenderer);\n}\n\nvar selector$5 = function selector$5(s) {\n var _s$domNode2;\n\n return (_s$domNode2 = s.domNode) === null || _s$domNode2 === void 0 ? void 0 : _s$domNode2.querySelector('.react-flow__viewport-portal');\n};\n/**\n * The `` component can be used to add components to the same viewport\n * of the flow where nodes and edges are rendered. This is useful when you want to render\n * your own components that are adhere to the same coordinate system as the nodes & edges\n * and are also affected by zooming and panning\n * @public\n * @example\n *\n * ```jsx\n *import React from 'react';\n *import { ViewportPortal } from '@xyflow/react';\n *\n *export default function () {\n * return (\n * \n * \n * This div is positioned at [100, 100] on the flow.\n * \n * \n * );\n *}\n *```\n */\n\n\nfunction ViewportPortal(_ref58) {\n var children = _ref58.children;\n var viewPortalDiv = useStore(selector$5);\n\n if (!viewPortalDiv) {\n return null;\n }\n\n return createPortal(children, viewPortalDiv);\n}\n/**\n * When you programmatically add or remove handles to a node or update a node's\n *handle position, you need to let React Flow know about it using this hook. This\n *will update the internal dimensions of the node and properly reposition handles\n *on the canvas if necessary.\n *\n * @public\n * @returns function for updating node internals\n *\n * @example\n * ```jsx\n *import { useCallback, useState } from 'react';\n *import { Handle, useUpdateNodeInternals } from '@xyflow/react';\n *\n *export default function RandomHandleNode({ id }) {\n * const updateNodeInternals = useUpdateNodeInternals();\n * const [handleCount, setHandleCount] = useState(0);\n * const randomizeHandleCount = useCallback(() => {\n * setHandleCount(Math.floor(Math.random() * 10));\n * updateNodeInternals(id);\n * }, [id, updateNodeInternals]);\n *\n * return (\n * <>\n * {Array.from({ length: handleCount }).map((_, index) => (\n * \n * ))}\n *\n *
\n * \n *

There are {handleCount} handles on this node.

\n *
\n * \n * );\n *}\n *```\n * @remarks This hook can only be used in a component that is a child of a\n *{@link ReactFlowProvider} or a {@link ReactFlow} component.\n */\n\n\nfunction useUpdateNodeInternals() {\n var store = useStoreApi();\n return useCallback(function (id) {\n var _store$getState37 = store.getState(),\n domNode = _store$getState37.domNode,\n updateNodeInternals = _store$getState37.updateNodeInternals;\n\n var updateIds = Array.isArray(id) ? id : [id];\n var updates = new Map();\n updateIds.forEach(function (updateId) {\n var nodeElement = domNode === null || domNode === void 0 ? void 0 : domNode.querySelector(\".react-flow__node[data-id=\\\"\".concat(updateId, \"\\\"]\"));\n\n if (nodeElement) {\n updates.set(updateId, {\n id: updateId,\n nodeElement: nodeElement,\n force: true\n });\n }\n });\n requestAnimationFrame(function () {\n return updateNodeInternals(updates, {\n triggerFitView: false\n });\n });\n }, []);\n}\n\nvar nodesSelector = function nodesSelector(state) {\n return state.nodes;\n};\n/**\n * This hook returns an array of the current nodes. Components that use this hook\n * will re-render **whenever any node changes**, including when a node is selected\n * or moved.\n *\n * @public\n * @returns An array of nodes\n *\n * @example\n * ```jsx\n *import { useNodes } from '@xyflow/react';\n *\n *export default function() {\n * const nodes = useNodes();\n *\n * return
There are currently {nodes.length} nodes!
;\n *}\n *```\n */\n\n\nfunction useNodes() {\n var nodes = useStore(nodesSelector, shallow);\n return nodes;\n}\n\nvar edgesSelector = function edgesSelector(state) {\n return state.edges;\n};\n/**\n * This hook returns an array of the current edges. Components that use this hook\n * will re-render **whenever any edge changes**.\n *\n * @public\n * @returns An array of edges\n *\n * @example\n * ```tsx\n *import { useEdges } from '@xyflow/react';\n *\n *export default function () {\n * const edges = useEdges();\n *\n * return
There are currently {edges.length} edges!
;\n *}\n *```\n */\n\n\nfunction useEdges() {\n var edges = useStore(edgesSelector, shallow);\n return edges;\n}\n\nvar viewportSelector = function viewportSelector(state) {\n return {\n x: state.transform[0],\n y: state.transform[1],\n zoom: state.transform[2]\n };\n};\n/**\n * The `useViewport` hook is a convenient way to read the current state of the\n *{@link Viewport} in a component. Components that use this hook\n *will re-render **whenever the viewport changes**.\n *\n * @public\n * @returns The current viewport\n *\n * @example\n *\n *```jsx\n *import { useViewport } from '@xyflow/react';\n *\n *export default function ViewportDisplay() {\n * const { x, y, zoom } = useViewport();\n *\n * return (\n *
\n *

\n * The viewport is currently at ({x}, {y}) and zoomed to {zoom}.\n *

\n *
\n * );\n *}\n *```\n *\n * @remarks This hook can only be used in a component that is a child of a\n *{@link ReactFlowProvider} or a {@link ReactFlow} component.\n */\n\n\nfunction useViewport() {\n var viewport = useStore(viewportSelector, shallow);\n return viewport;\n}\n/**\n * This hook makes it easy to prototype a controlled flow where you manage the\n * state of nodes and edges outside the `ReactFlowInstance`. You can think of it\n * like React's `useState` hook with an additional helper callback.\n *\n * @public\n * @param initialNodes\n * @returns an array [nodes, setNodes, onNodesChange]\n * @example\n *\n *```tsx\n *import { ReactFlow, useNodesState, useEdgesState } from '@xyflow/react';\n *\n *const initialNodes = [];\n *const initialEdges = [];\n *\n *export default function () {\n * const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);\n * const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges);\n *\n * return (\n * \n * );\n *}\n *```\n *\n * @remarks This hook was created to make prototyping easier and our documentation\n * examples clearer. Although it is OK to use this hook in production, in\n * practice you may want to use a more sophisticated state management solution\n * like Zustand {@link https://reactflow.dev/docs/guides/state-management/} instead.\n *\n */\n\n\nfunction useNodesState(initialNodes) {\n var _useState21 = useState(initialNodes),\n _useState22 = _slicedToArray(_useState21, 2),\n nodes = _useState22[0],\n setNodes = _useState22[1];\n\n var onNodesChange = useCallback(function (changes) {\n return setNodes(function (nds) {\n return applyNodeChanges(changes, nds);\n });\n }, []);\n return [nodes, setNodes, onNodesChange];\n}\n/**\n * This hook makes it easy to prototype a controlled flow where you manage the\n * state of nodes and edges outside the `ReactFlowInstance`. You can think of it\n * like React's `useState` hook with an additional helper callback.\n *\n * @public\n * @param initialEdges\n * @returns an array [edges, setEdges, onEdgesChange]\n * @example\n *\n *```tsx\n *import { ReactFlow, useNodesState, useEdgesState } from '@xyflow/react';\n *\n *const initialNodes = [];\n *const initialEdges = [];\n *\n *export default function () {\n * const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);\n * const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges);\n *\n * return (\n * \n * );\n *}\n *```\n *\n * @remarks This hook was created to make prototyping easier and our documentation\n * examples clearer. Although it is OK to use this hook in production, in\n * practice you may want to use a more sophisticated state management solution\n * like Zustand {@link https://reactflow.dev/docs/guides/state-management/} instead.\n *\n */\n\n\nfunction useEdgesState(initialEdges) {\n var _useState23 = useState(initialEdges),\n _useState24 = _slicedToArray(_useState23, 2),\n edges = _useState24[0],\n setEdges = _useState24[1];\n\n var onEdgesChange = useCallback(function (changes) {\n return setEdges(function (eds) {\n return applyEdgeChanges(changes, eds);\n });\n }, []);\n return [edges, setEdges, onEdgesChange];\n}\n/**\n * The `useOnViewportChange` hook lets you listen for changes to the viewport such\n *as panning and zooming. You can provide a callback for each phase of a viewport\n *change: `onStart`, `onChange`, and `onEnd`.\n *\n * @public\n * @param params.onStart - gets called when the viewport starts changing\n * @param params.onChange - gets called when the viewport changes\n * @param params.onEnd - gets called when the viewport stops changing\n *\n * @example\n * ```jsx\n *import { useCallback } from 'react';\n *import { useOnViewportChange } from '@xyflow/react';\n *\n *function ViewportChangeLogger() {\n * useOnViewportChange({\n * onStart: (viewport: Viewport) => console.log('start', viewport),\n * onChange: (viewport: Viewport) => console.log('change', viewport),\n * onEnd: (viewport: Viewport) => console.log('end', viewport),\n * });\n *\n * return null;\n *}\n *```\n */\n\n\nfunction useOnViewportChange(_ref59) {\n var onStart = _ref59.onStart,\n onChange = _ref59.onChange,\n onEnd = _ref59.onEnd;\n var store = useStoreApi();\n useEffect(function () {\n store.setState({\n onViewportChangeStart: onStart\n });\n }, [onStart]);\n useEffect(function () {\n store.setState({\n onViewportChange: onChange\n });\n }, [onChange]);\n useEffect(function () {\n store.setState({\n onViewportChangeEnd: onEnd\n });\n }, [onEnd]);\n}\n/**\n * This hook lets you listen for changes to both node and edge selection. As the\n *name implies, the callback you provide will be called whenever the selection of\n *_either_ nodes or edges changes.\n *\n * @public\n * @param params.onChange - The handler to register\n *\n * @example\n * ```jsx\n *import { useState } from 'react';\n *import { ReactFlow, useOnSelectionChange } from '@xyflow/react';\n *\n *function SelectionDisplay() {\n * const [selectedNodes, setSelectedNodes] = useState([]);\n * const [selectedEdges, setSelectedEdges] = useState([]);\n *\n * // the passed handler has to be memoized, otherwise the hook will not work correctly\n * const onChange = useCallback(({ nodes, edges }) => {\n * setSelectedNodes(nodes.map((node) => node.id));\n * setSelectedEdges(edges.map((edge) => edge.id));\n * }, []);\n *\n * useOnSelectionChange({\n * onChange,\n * });\n *\n * return (\n *
\n *

Selected nodes: {selectedNodes.join(', ')}

\n *

Selected edges: {selectedEdges.join(', ')}

\n *
\n * );\n *}\n *```\n *\n * @remarks You need to memoize the passed `onChange` handler, otherwise the hook will not work correctly.\n */\n\n\nfunction useOnSelectionChange(_ref60) {\n var onChange = _ref60.onChange;\n var store = useStoreApi();\n useEffect(function () {\n var nextOnSelectionChangeHandlers = [].concat(_toConsumableArray(store.getState().onSelectionChangeHandlers), [onChange]);\n store.setState({\n onSelectionChangeHandlers: nextOnSelectionChangeHandlers\n });\n return function () {\n var nextHandlers = store.getState().onSelectionChangeHandlers.filter(function (fn) {\n return fn !== onChange;\n });\n store.setState({\n onSelectionChangeHandlers: nextHandlers\n });\n };\n }, [onChange]);\n}\n\nvar selector$4 = function selector$4(options) {\n return function (s) {\n if (s.nodeLookup.size === 0) {\n return false;\n }\n\n var _iterator18 = _createForOfIteratorHelper(s.nodeLookup),\n _step18;\n\n try {\n for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {\n var _step18$value = _slicedToArray(_step18.value, 2),\n _step18$value$ = _step18$value[1],\n hidden = _step18$value$.hidden,\n internals = _step18$value$.internals;\n\n if (options.includeHiddenNodes || !hidden) {\n if (internals.handleBounds === undefined || !nodeHasDimensions(internals.userNode)) {\n return false;\n }\n }\n }\n } catch (err) {\n _iterator18.e(err);\n } finally {\n _iterator18.f();\n }\n\n return true;\n };\n};\n/**\n * This hook tells you whether all the nodes in a flow have been measured and given\n *a width and height. When you add a node to the flow, this hook will return\n *`false` and then `true` again once the node has been measured.\n *\n * @public\n * @param options.includeHiddenNodes - defaults to false\n * @returns boolean indicating whether all nodes are initialized\n *\n * @example\n * ```jsx\n *import { useReactFlow, useNodesInitialized } from '@xyflow/react';\n *import { useEffect, useState } from 'react';\n *\n *const options = {\n * includeHiddenNodes: false,\n *};\n *\n *export default function useLayout() {\n * const { getNodes } = useReactFlow();\n * const nodesInitialized = useNodesInitialized(options);\n * const [layoutedNodes, setLayoutedNodes] = useState(getNodes());\n *\n * useEffect(() => {\n * if (nodesInitialized) {\n * setLayoutedNodes(yourLayoutingFunction(getNodes()));\n * }\n * }, [nodesInitialized]);\n *\n * return layoutedNodes;\n *}\n *```\n */\n\n\nfunction useNodesInitialized() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {\n includeHiddenNodes: false\n };\n var initialized = useStore(selector$4(options));\n return initialized;\n}\n/**\n * Hook to check if a is connected to another and get the connections.\n *\n * @public\n * @deprecated Use `useNodeConnections` instead.\n * @param param.type - handle type 'source' or 'target'\n * @param param.nodeId - node id - if not provided, the node id from the NodeIdContext is used\n * @param param.id - the handle id (this is only needed if the node has multiple handles of the same type)\n * @param param.onConnect - gets called when a connection is established\n * @param param.onDisconnect - gets called when a connection is removed\n * @returns an array with handle connections\n */\n\n\nfunction useHandleConnections(_ref61) {\n var type = _ref61.type,\n id = _ref61.id,\n nodeId = _ref61.nodeId,\n onConnect = _ref61.onConnect,\n onDisconnect = _ref61.onDisconnect;\n console.warn('[DEPRECATED] `useHandleConnections` is deprecated. Instead use `useNodeConnections` https://reactflow.dev/api-reference/hooks/useNodeConnections');\n\n var _nodeId = useNodeId();\n\n var currentNodeId = nodeId !== null && nodeId !== void 0 ? nodeId : _nodeId;\n var prevConnections = useRef(null);\n var connections = useStore(function (state) {\n return state.connectionLookup.get(\"\".concat(currentNodeId, \"-\").concat(type).concat(id ? \"-\".concat(id) : ''));\n }, areConnectionMapsEqual);\n useEffect(function () {\n // @todo dicuss if onConnect/onDisconnect should be called when the component mounts/unmounts\n if (prevConnections.current && prevConnections.current !== connections) {\n var _connections = connections !== null && connections !== void 0 ? connections : new Map();\n\n handleConnectionChange(prevConnections.current, _connections, onDisconnect);\n handleConnectionChange(_connections, prevConnections.current, onConnect);\n }\n\n prevConnections.current = connections !== null && connections !== void 0 ? connections : new Map();\n }, [connections, onConnect, onDisconnect]);\n return useMemo(function () {\n var _connections$values;\n\n return Array.from((_connections$values = connections === null || connections === void 0 ? void 0 : connections.values()) !== null && _connections$values !== void 0 ? _connections$values : []);\n }, [connections]);\n}\n\nvar error014 = errorMessages['error014']();\n/**\n * This hook returns an array of connections on a specific node, handle type ('source', 'target') or handle ID.\n *\n * @public\n * @param param.id - node id - optional if called inside a custom node\n * @param param.handleType - filter by handle type 'source' or 'target'\n * @param param.handleId - filter by handle id (this is only needed if the node has multiple handles of the same type)\n * @param param.onConnect - gets called when a connection is established\n * @param param.onDisconnect - gets called when a connection is removed\n * @returns an array with connections\n *\n * @example\n * ```jsx\n *import { useNodeConnections } from '@xyflow/react';\n *\n *export default function () {\n * const connections = useNodeConnections({\n * handleType: 'target',\n * handleId: 'my-handle',\n * });\n *\n * return (\n *
There are currently {connections.length} incoming connections!
\n * );\n *}\n *```\n */\n\nfunction useNodeConnections() {\n var _ref62 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n id = _ref62.id,\n handleType = _ref62.handleType,\n handleId = _ref62.handleId,\n onConnect = _ref62.onConnect,\n onDisconnect = _ref62.onDisconnect;\n\n var nodeId = useNodeId();\n var currentNodeId = id !== null && id !== void 0 ? id : nodeId;\n\n if (!currentNodeId) {\n throw new Error(error014);\n }\n\n var prevConnections = useRef(null);\n var connections = useStore(function (state) {\n return state.connectionLookup.get(\"\".concat(currentNodeId).concat(handleType ? handleId ? \"-\".concat(handleType, \"-\").concat(handleId) : \"-\".concat(handleType) : ''));\n }, areConnectionMapsEqual);\n useEffect(function () {\n // @todo dicuss if onConnect/onDisconnect should be called when the component mounts/unmounts\n if (prevConnections.current && prevConnections.current !== connections) {\n var _connections = connections !== null && connections !== void 0 ? connections : new Map();\n\n handleConnectionChange(prevConnections.current, _connections, onDisconnect);\n handleConnectionChange(_connections, prevConnections.current, onConnect);\n }\n\n prevConnections.current = connections !== null && connections !== void 0 ? connections : new Map();\n }, [connections, onConnect, onDisconnect]);\n return useMemo(function () {\n var _connections$values2;\n\n return Array.from((_connections$values2 = connections === null || connections === void 0 ? void 0 : connections.values()) !== null && _connections$values2 !== void 0 ? _connections$values2 : []);\n }, [connections]);\n} // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\nfunction useNodesData(nodeIds) {\n var nodesData = useStore(useCallback(function (s) {\n var _data$;\n\n var data = [];\n var isArrayOfIds = Array.isArray(nodeIds);\n\n var _nodeIds = isArrayOfIds ? nodeIds : [nodeIds];\n\n var _iterator19 = _createForOfIteratorHelper(_nodeIds),\n _step19;\n\n try {\n for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {\n var nodeId = _step19.value;\n var node = s.nodeLookup.get(nodeId);\n\n if (node) {\n data.push({\n id: node.id,\n type: node.type,\n data: node.data\n });\n }\n }\n } catch (err) {\n _iterator19.e(err);\n } finally {\n _iterator19.f();\n }\n\n return isArrayOfIds ? data : (_data$ = data[0]) !== null && _data$ !== void 0 ? _data$ : null;\n }, [nodeIds]), shallowNodeData);\n return nodesData;\n}\n/**\n * This hook returns the internal representation of a specific node.\n * Components that use this hook will re-render **whenever the node changes**,\n * including when a node is selected or moved.\n *\n * @public\n * @param id - id of the node\n * @returns array with visible node ids\n *\n * @example\n * ```tsx\n *import { useInternalNode } from '@xyflow/react';\n *\n *export default function () {\n * const internalNode = useInternalNode('node-1');\n * const absolutePosition = internalNode.internals.positionAbsolute;\n *\n * return (\n *
\n * The absolute position of the node is at:\n *

x: {absolutePosition.x}

\n *

y: {absolutePosition.y}

\n *
\n * );\n *}\n *```\n */\n\n\nfunction useInternalNode(id) {\n var node = useStore(useCallback(function (s) {\n return s.nodeLookup.get(id);\n }, [id]), shallow);\n return node;\n}\n\nfunction LinePattern(_ref63) {\n var dimensions = _ref63.dimensions,\n lineWidth = _ref63.lineWidth,\n variant = _ref63.variant,\n className = _ref63.className;\n return jsx(\"path\", {\n strokeWidth: lineWidth,\n d: \"M\".concat(dimensions[0] / 2, \" 0 V\").concat(dimensions[1], \" M0 \").concat(dimensions[1] / 2, \" H\").concat(dimensions[0]),\n className: cc(['react-flow__background-pattern', variant, className])\n });\n}\n\nfunction DotPattern(_ref64) {\n var radius = _ref64.radius,\n className = _ref64.className;\n return jsx(\"circle\", {\n cx: radius,\n cy: radius,\n r: radius,\n className: cc(['react-flow__background-pattern', 'dots', className])\n });\n}\n/**\n * The three variants are exported as an enum for convenience. You can either import\n * the enum and use it like `BackgroundVariant.Lines` or you can use the raw string\n * value directly.\n * @public\n */\n\n\nvar BackgroundVariant;\n\n(function (BackgroundVariant) {\n BackgroundVariant[\"Lines\"] = \"lines\";\n BackgroundVariant[\"Dots\"] = \"dots\";\n BackgroundVariant[\"Cross\"] = \"cross\";\n})(BackgroundVariant || (BackgroundVariant = {}));\n\nvar defaultSize = (_defaultSize = {}, _defineProperty(_defaultSize, BackgroundVariant.Dots, 1), _defineProperty(_defaultSize, BackgroundVariant.Lines, 1), _defineProperty(_defaultSize, BackgroundVariant.Cross, 6), _defaultSize);\n\nvar selector$3 = function selector$3(s) {\n return {\n transform: s.transform,\n patternId: \"pattern-\".concat(s.rfId)\n };\n};\n\nfunction BackgroundComponent(_ref65) {\n var id = _ref65.id,\n _ref65$variant = _ref65.variant,\n variant = _ref65$variant === void 0 ? BackgroundVariant.Dots : _ref65$variant,\n _ref65$gap = _ref65.gap,\n gap = _ref65$gap === void 0 ? 20 : _ref65$gap,\n size = _ref65.size,\n _ref65$lineWidth = _ref65.lineWidth,\n lineWidth = _ref65$lineWidth === void 0 ? 1 : _ref65$lineWidth,\n _ref65$offset = _ref65.offset,\n offset = _ref65$offset === void 0 ? 0 : _ref65$offset,\n color = _ref65.color,\n bgColor = _ref65.bgColor,\n style = _ref65.style,\n className = _ref65.className,\n patternClassName = _ref65.patternClassName;\n var ref = useRef(null);\n\n var _useStore15 = useStore(selector$3, shallow),\n transform = _useStore15.transform,\n patternId = _useStore15.patternId;\n\n var patternSize = size || defaultSize[variant];\n var isDots = variant === BackgroundVariant.Dots;\n var isCross = variant === BackgroundVariant.Cross;\n var gapXY = Array.isArray(gap) ? gap : [gap, gap];\n var scaledGap = [gapXY[0] * transform[2] || 1, gapXY[1] * transform[2] || 1];\n var scaledSize = patternSize * transform[2];\n var offsetXY = Array.isArray(offset) ? offset : [offset, offset];\n var patternDimensions = isCross ? [scaledSize, scaledSize] : scaledGap;\n var scaledOffset = [offsetXY[0] * transform[2] || 1 + patternDimensions[0] / 2, offsetXY[1] * transform[2] || 1 + patternDimensions[1] / 2];\n\n var _patternId = \"\".concat(patternId).concat(id ? id : '');\n\n return jsxs(\"svg\", {\n className: cc(['react-flow__background', className]),\n style: _objectSpread(_objectSpread(_objectSpread({}, style), containerStyle), {}, {\n '--xy-background-color-props': bgColor,\n '--xy-background-pattern-color-props': color\n }),\n ref: ref,\n \"data-testid\": \"rf__background\",\n children: [jsx(\"pattern\", {\n id: _patternId,\n x: transform[0] % scaledGap[0],\n y: transform[1] % scaledGap[1],\n width: scaledGap[0],\n height: scaledGap[1],\n patternUnits: \"userSpaceOnUse\",\n patternTransform: \"translate(-\".concat(scaledOffset[0], \",-\").concat(scaledOffset[1], \")\"),\n children: isDots ? jsx(DotPattern, {\n radius: scaledSize / 2,\n className: patternClassName\n }) : jsx(LinePattern, {\n dimensions: patternDimensions,\n lineWidth: lineWidth,\n variant: variant,\n className: patternClassName\n })\n }), jsx(\"rect\", {\n x: \"0\",\n y: \"0\",\n width: \"100%\",\n height: \"100%\",\n fill: \"url(#\".concat(_patternId, \")\")\n })]\n });\n}\n\nBackgroundComponent.displayName = 'Background';\n/**\n * The `` component makes it convenient to render different types of backgrounds common in node-based UIs. It comes with three variants: lines, dots and cross.\n *\n * @example\n *\n * A simple example of how to use the Background component.\n *\n * ```tsx\n * import { useState } from 'react';\n * import { ReactFlow, Background, BackgroundVariant } from '@xyflow/react';\n *\n * export default function Flow() {\n * return (\n * \n * \n * \n * );\n * }\n * ```\n *\n * @example\n *\n * In this example you can see how to combine multiple backgrounds\n *\n * ```tsx\n * import { ReactFlow, Background, BackgroundVariant } from '@xyflow/react';\n * import '@xyflow/react/dist/style.css';\n *\n * export default function Flow() {\n * return (\n * \n * \n * \n * \n * );\n * }\n * ```\n *\n * @remarks\n *\n * When combining multiple components it’s important to give each of them a unique id prop!\n *\n */\n\nvar Background = memo(BackgroundComponent);\n\nfunction PlusIcon() {\n return jsx(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 32 32\",\n children: jsx(\"path\", {\n d: \"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z\"\n })\n });\n}\n\nfunction MinusIcon() {\n return jsx(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 32 5\",\n children: jsx(\"path\", {\n d: \"M0 0h32v4.2H0z\"\n })\n });\n}\n\nfunction FitViewIcon() {\n return jsx(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 32 30\",\n children: jsx(\"path\", {\n d: \"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 });\n}\n\nfunction LockIcon() {\n return jsx(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 25 32\",\n children: jsx(\"path\", {\n d: \"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 });\n}\n\nfunction UnlockIcon() {\n return jsx(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 25 32\",\n children: jsx(\"path\", {\n d: \"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 });\n}\n/**\n * You can add buttons to the control panel by using the `` component\n * and pass it as a child to the [``](/api-reference/components/controls) component.\n *\n * @public\n * @example\n *```jsx\n *import { MagicWand } from '@radix-ui/react-icons'\n *import { ReactFlow, Controls, ControlButton } from '@xyflow/react'\n *\n *export default function Flow() {\n * return (\n * \n * \n * alert('Something magical just happened. ✨')}>\n * \n * \n * \n * \n * )\n *}\n *```\n */\n\n\nfunction ControlButton(_ref66) {\n var children = _ref66.children,\n className = _ref66.className,\n rest = _objectWithoutProperties(_ref66, _excluded7);\n\n return jsx(\"button\", _objectSpread(_objectSpread({\n type: \"button\",\n className: cc(['react-flow__controls-button', className])\n }, rest), {}, {\n children: children\n }));\n}\n\nvar selector$2 = function selector$2(s) {\n return {\n isInteractive: s.nodesDraggable || s.nodesConnectable || s.elementsSelectable,\n minZoomReached: s.transform[2] <= s.minZoom,\n maxZoomReached: s.transform[2] >= s.maxZoom\n };\n};\n\nfunction ControlsComponent(_ref67) {\n var style = _ref67.style,\n _ref67$showZoom = _ref67.showZoom,\n showZoom = _ref67$showZoom === void 0 ? true : _ref67$showZoom,\n _ref67$showFitView = _ref67.showFitView,\n showFitView = _ref67$showFitView === void 0 ? true : _ref67$showFitView,\n _ref67$showInteractiv = _ref67.showInteractive,\n showInteractive = _ref67$showInteractiv === void 0 ? true : _ref67$showInteractiv,\n fitViewOptions = _ref67.fitViewOptions,\n onZoomIn = _ref67.onZoomIn,\n onZoomOut = _ref67.onZoomOut,\n onFitView = _ref67.onFitView,\n onInteractiveChange = _ref67.onInteractiveChange,\n className = _ref67.className,\n children = _ref67.children,\n _ref67$position = _ref67.position,\n position = _ref67$position === void 0 ? 'bottom-left' : _ref67$position,\n _ref67$orientation = _ref67.orientation,\n orientation = _ref67$orientation === void 0 ? 'vertical' : _ref67$orientation,\n _ref67$ariaLabel = _ref67['aria-label'],\n ariaLabel = _ref67$ariaLabel === void 0 ? 'React Flow controls' : _ref67$ariaLabel;\n var store = useStoreApi();\n\n var _useStore16 = useStore(selector$2, shallow),\n isInteractive = _useStore16.isInteractive,\n minZoomReached = _useStore16.minZoomReached,\n maxZoomReached = _useStore16.maxZoomReached;\n\n var _useReactFlow2 = useReactFlow(),\n zoomIn = _useReactFlow2.zoomIn,\n zoomOut = _useReactFlow2.zoomOut,\n fitView = _useReactFlow2.fitView;\n\n var onZoomInHandler = function onZoomInHandler() {\n zoomIn();\n onZoomIn === null || onZoomIn === void 0 ? void 0 : onZoomIn();\n };\n\n var onZoomOutHandler = function onZoomOutHandler() {\n zoomOut();\n onZoomOut === null || onZoomOut === void 0 ? void 0 : onZoomOut();\n };\n\n var onFitViewHandler = function onFitViewHandler() {\n fitView(fitViewOptions);\n onFitView === null || onFitView === void 0 ? void 0 : onFitView();\n };\n\n var onToggleInteractivity = function onToggleInteractivity() {\n store.setState({\n nodesDraggable: !isInteractive,\n nodesConnectable: !isInteractive,\n elementsSelectable: !isInteractive\n });\n onInteractiveChange === null || onInteractiveChange === void 0 ? void 0 : onInteractiveChange(!isInteractive);\n };\n\n var orientationClass = orientation === 'horizontal' ? 'horizontal' : 'vertical';\n return jsxs(Panel, {\n className: cc(['react-flow__controls', orientationClass, className]),\n position: position,\n style: style,\n \"data-testid\": \"rf__controls\",\n \"aria-label\": ariaLabel,\n children: [showZoom && jsxs(Fragment, {\n children: [jsx(ControlButton, {\n onClick: onZoomInHandler,\n className: \"react-flow__controls-zoomin\",\n title: \"zoom in\",\n \"aria-label\": \"zoom in\",\n disabled: maxZoomReached,\n children: jsx(PlusIcon, {})\n }), jsx(ControlButton, {\n onClick: onZoomOutHandler,\n className: \"react-flow__controls-zoomout\",\n title: \"zoom out\",\n \"aria-label\": \"zoom out\",\n disabled: minZoomReached,\n children: jsx(MinusIcon, {})\n })]\n }), showFitView && jsx(ControlButton, {\n className: \"react-flow__controls-fitview\",\n onClick: onFitViewHandler,\n title: \"fit view\",\n \"aria-label\": \"fit view\",\n children: jsx(FitViewIcon, {})\n }), showInteractive && jsx(ControlButton, {\n className: \"react-flow__controls-interactive\",\n onClick: onToggleInteractivity,\n title: \"toggle interactivity\",\n \"aria-label\": \"toggle interactivity\",\n children: isInteractive ? jsx(UnlockIcon, {}) : jsx(LockIcon, {})\n }), children]\n });\n}\n\nControlsComponent.displayName = 'Controls';\n/**\n * The `` component renders a small panel that contains convenient\n * buttons to zoom in, zoom out, fit the view, and lock the viewport.\n *\n * @public\n * @example\n *```tsx\n *import { ReactFlow, Controls } from '@xyflow/react'\n *\n *export default function Flow() {\n * return (\n * \n * \n * \n * )\n *}\n *```\n *\n * @remarks To extend or customise the controls, you can use the [``](/api-reference/components/control-button) component\n *\n */\n\nvar Controls = memo(ControlsComponent);\n\nfunction MiniMapNodeComponent(_ref68) {\n var id = _ref68.id,\n x = _ref68.x,\n y = _ref68.y,\n width = _ref68.width,\n height = _ref68.height,\n style = _ref68.style,\n color = _ref68.color,\n strokeColor = _ref68.strokeColor,\n strokeWidth = _ref68.strokeWidth,\n className = _ref68.className,\n borderRadius = _ref68.borderRadius,\n shapeRendering = _ref68.shapeRendering,\n selected = _ref68.selected,\n onClick = _ref68.onClick;\n\n var _ref69 = style || {},\n background = _ref69.background,\n backgroundColor = _ref69.backgroundColor;\n\n var fill = color || background || backgroundColor;\n return jsx(\"rect\", {\n className: cc(['react-flow__minimap-node', {\n selected: selected\n }, className]),\n x: x,\n y: y,\n rx: borderRadius,\n ry: borderRadius,\n width: width,\n height: height,\n style: {\n fill: fill,\n stroke: strokeColor,\n strokeWidth: strokeWidth\n },\n shapeRendering: shapeRendering,\n onClick: onClick ? function (event) {\n return onClick(event, id);\n } : undefined\n });\n}\n\nvar MiniMapNode = memo(MiniMapNodeComponent);\n\nvar selectorNodeIds = function selectorNodeIds(s) {\n return s.nodes.map(function (node) {\n return node.id;\n });\n};\n\nvar getAttrFunction = function getAttrFunction(func) {\n return func instanceof Function ? func : function () {\n return func;\n };\n};\n\nfunction MiniMapNodes(_ref70) {\n var nodeStrokeColor = _ref70.nodeStrokeColor,\n nodeColor = _ref70.nodeColor,\n _ref70$nodeClassName = _ref70.nodeClassName,\n nodeClassName = _ref70$nodeClassName === void 0 ? '' : _ref70$nodeClassName,\n _ref70$nodeBorderRadi = _ref70.nodeBorderRadius,\n nodeBorderRadius = _ref70$nodeBorderRadi === void 0 ? 5 : _ref70$nodeBorderRadi,\n nodeStrokeWidth = _ref70.nodeStrokeWidth,\n _ref70$nodeComponent = _ref70.nodeComponent,\n NodeComponent = _ref70$nodeComponent === void 0 ? MiniMapNode : _ref70$nodeComponent,\n onClick = _ref70.onClick;\n var nodeIds = useStore(selectorNodeIds, shallow);\n var nodeColorFunc = getAttrFunction(nodeColor);\n var nodeStrokeColorFunc = getAttrFunction(nodeStrokeColor);\n var nodeClassNameFunc = getAttrFunction(nodeClassName);\n var shapeRendering = typeof window === 'undefined' || !!window.chrome ? 'crispEdges' : 'geometricPrecision';\n return jsx(Fragment, {\n children: nodeIds.map(function (nodeId) {\n return (\n /*\n * The split of responsibilities between MiniMapNodes and\n * NodeComponentWrapper may appear weird. However, it’s designed to\n * minimize the cost of updates when individual nodes change.\n *\n * For more details, see a similar commit in `NodeRenderer/index.tsx`.\n */\n jsx(NodeComponentWrapper, {\n id: nodeId,\n nodeColorFunc: nodeColorFunc,\n nodeStrokeColorFunc: nodeStrokeColorFunc,\n nodeClassNameFunc: nodeClassNameFunc,\n nodeBorderRadius: nodeBorderRadius,\n nodeStrokeWidth: nodeStrokeWidth,\n NodeComponent: NodeComponent,\n onClick: onClick,\n shapeRendering: shapeRendering\n }, nodeId)\n );\n })\n });\n}\n\nfunction NodeComponentWrapperInner(_ref71) {\n var id = _ref71.id,\n nodeColorFunc = _ref71.nodeColorFunc,\n nodeStrokeColorFunc = _ref71.nodeStrokeColorFunc,\n nodeClassNameFunc = _ref71.nodeClassNameFunc,\n nodeBorderRadius = _ref71.nodeBorderRadius,\n nodeStrokeWidth = _ref71.nodeStrokeWidth,\n shapeRendering = _ref71.shapeRendering,\n NodeComponent = _ref71.NodeComponent,\n onClick = _ref71.onClick;\n\n var _useStore17 = useStore(function (s) {\n var node = s.nodeLookup.get(id);\n var _node$internals$posit = node.internals.positionAbsolute,\n x = _node$internals$posit.x,\n y = _node$internals$posit.y;\n\n var _getNodeDimensions = getNodeDimensions(node),\n width = _getNodeDimensions.width,\n height = _getNodeDimensions.height;\n\n return {\n node: node,\n x: x,\n y: y,\n width: width,\n height: height\n };\n }, shallow),\n node = _useStore17.node,\n x = _useStore17.x,\n y = _useStore17.y,\n width = _useStore17.width,\n height = _useStore17.height;\n\n if (!node || node.hidden || !nodeHasDimensions(node)) {\n return null;\n }\n\n return jsx(NodeComponent, {\n x: x,\n y: y,\n width: width,\n height: height,\n style: node.style,\n selected: !!node.selected,\n className: nodeClassNameFunc(node),\n color: nodeColorFunc(node),\n borderRadius: nodeBorderRadius,\n strokeColor: nodeStrokeColorFunc(node),\n strokeWidth: nodeStrokeWidth,\n shapeRendering: shapeRendering,\n onClick: onClick,\n id: node.id\n });\n}\n\nvar NodeComponentWrapper = memo(NodeComponentWrapperInner);\nvar MiniMapNodes$1 = memo(MiniMapNodes);\nvar defaultWidth = 200;\nvar defaultHeight = 150;\n\nvar filterHidden = function filterHidden(node) {\n return !node.hidden;\n};\n\nvar selector$1 = function selector$1(s) {\n var viewBB = {\n x: -s.transform[0] / s.transform[2],\n y: -s.transform[1] / s.transform[2],\n width: s.width / s.transform[2],\n height: s.height / s.transform[2]\n };\n return {\n viewBB: viewBB,\n boundingRect: s.nodeLookup.size > 0 ? getBoundsOfRects(getInternalNodesBounds(s.nodeLookup, {\n filter: filterHidden\n }), viewBB) : viewBB,\n rfId: s.rfId,\n panZoom: s.panZoom,\n translateExtent: s.translateExtent,\n flowWidth: s.width,\n flowHeight: s.height\n };\n};\n\nvar ARIA_LABEL_KEY = 'react-flow__minimap-desc';\n\nfunction MiniMapComponent(_ref72) {\n var _style$width, _style$height;\n\n var style = _ref72.style,\n className = _ref72.className,\n nodeStrokeColor = _ref72.nodeStrokeColor,\n nodeColor = _ref72.nodeColor,\n _ref72$nodeClassName = _ref72.nodeClassName,\n nodeClassName = _ref72$nodeClassName === void 0 ? '' : _ref72$nodeClassName,\n _ref72$nodeBorderRadi = _ref72.nodeBorderRadius,\n nodeBorderRadius = _ref72$nodeBorderRadi === void 0 ? 5 : _ref72$nodeBorderRadi,\n nodeStrokeWidth = _ref72.nodeStrokeWidth,\n nodeComponent = _ref72.nodeComponent,\n bgColor = _ref72.bgColor,\n maskColor = _ref72.maskColor,\n maskStrokeColor = _ref72.maskStrokeColor,\n maskStrokeWidth = _ref72.maskStrokeWidth,\n _ref72$position = _ref72.position,\n position = _ref72$position === void 0 ? 'bottom-right' : _ref72$position,\n onClick = _ref72.onClick,\n onNodeClick = _ref72.onNodeClick,\n _ref72$pannable = _ref72.pannable,\n pannable = _ref72$pannable === void 0 ? false : _ref72$pannable,\n _ref72$zoomable = _ref72.zoomable,\n zoomable = _ref72$zoomable === void 0 ? false : _ref72$zoomable,\n _ref72$ariaLabel = _ref72.ariaLabel,\n ariaLabel = _ref72$ariaLabel === void 0 ? 'React Flow mini map' : _ref72$ariaLabel,\n inversePan = _ref72.inversePan,\n _ref72$zoomStep = _ref72.zoomStep,\n zoomStep = _ref72$zoomStep === void 0 ? 10 : _ref72$zoomStep,\n _ref72$offsetScale = _ref72.offsetScale,\n offsetScale = _ref72$offsetScale === void 0 ? 5 : _ref72$offsetScale;\n var store = useStoreApi();\n var svg = useRef(null);\n\n var _useStore18 = useStore(selector$1, shallow),\n boundingRect = _useStore18.boundingRect,\n viewBB = _useStore18.viewBB,\n rfId = _useStore18.rfId,\n panZoom = _useStore18.panZoom,\n translateExtent = _useStore18.translateExtent,\n flowWidth = _useStore18.flowWidth,\n flowHeight = _useStore18.flowHeight;\n\n var elementWidth = (_style$width = style === null || style === void 0 ? void 0 : style.width) !== null && _style$width !== void 0 ? _style$width : defaultWidth;\n var elementHeight = (_style$height = style === null || style === void 0 ? void 0 : style.height) !== null && _style$height !== void 0 ? _style$height : defaultHeight;\n var scaledWidth = boundingRect.width / elementWidth;\n var scaledHeight = boundingRect.height / elementHeight;\n var viewScale = Math.max(scaledWidth, scaledHeight);\n var viewWidth = viewScale * elementWidth;\n var viewHeight = viewScale * elementHeight;\n var offset = offsetScale * viewScale;\n var x = boundingRect.x - (viewWidth - boundingRect.width) / 2 - offset;\n var y = boundingRect.y - (viewHeight - boundingRect.height) / 2 - offset;\n var width = viewWidth + offset * 2;\n var height = viewHeight + offset * 2;\n var labelledBy = \"\".concat(ARIA_LABEL_KEY, \"-\").concat(rfId);\n var viewScaleRef = useRef(0);\n var minimapInstance = useRef();\n viewScaleRef.current = viewScale;\n useEffect(function () {\n if (svg.current && panZoom) {\n minimapInstance.current = XYMinimap({\n domNode: svg.current,\n panZoom: panZoom,\n getTransform: function getTransform() {\n return store.getState().transform;\n },\n getViewScale: function getViewScale() {\n return viewScaleRef.current;\n }\n });\n return function () {\n var _minimapInstance$curr;\n\n (_minimapInstance$curr = minimapInstance.current) === null || _minimapInstance$curr === void 0 ? void 0 : _minimapInstance$curr.destroy();\n };\n }\n }, [panZoom]);\n useEffect(function () {\n var _minimapInstance$curr2;\n\n (_minimapInstance$curr2 = minimapInstance.current) === null || _minimapInstance$curr2 === void 0 ? void 0 : _minimapInstance$curr2.update({\n translateExtent: translateExtent,\n width: flowWidth,\n height: flowHeight,\n inversePan: inversePan,\n pannable: pannable,\n zoomStep: zoomStep,\n zoomable: zoomable\n });\n }, [pannable, zoomable, inversePan, zoomStep, translateExtent, flowWidth, flowHeight]);\n var onSvgClick = onClick ? function (event) {\n var _minimapInstance$curr3;\n\n var _ref73 = ((_minimapInstance$curr3 = minimapInstance.current) === null || _minimapInstance$curr3 === void 0 ? void 0 : _minimapInstance$curr3.pointer(event)) || [0, 0],\n _ref74 = _slicedToArray(_ref73, 2),\n x = _ref74[0],\n y = _ref74[1];\n\n onClick(event, {\n x: x,\n y: y\n });\n } : undefined;\n var onSvgNodeClick = onNodeClick ? useCallback(function (event, nodeId) {\n var node = store.getState().nodeLookup.get(nodeId);\n onNodeClick(event, node);\n }, []) : undefined;\n return jsx(Panel, {\n position: position,\n style: _objectSpread(_objectSpread({}, style), {}, {\n '--xy-minimap-background-color-props': typeof bgColor === 'string' ? bgColor : undefined,\n '--xy-minimap-mask-background-color-props': typeof maskColor === 'string' ? maskColor : undefined,\n '--xy-minimap-mask-stroke-color-props': typeof maskStrokeColor === 'string' ? maskStrokeColor : undefined,\n '--xy-minimap-mask-stroke-width-props': typeof maskStrokeWidth === 'number' ? maskStrokeWidth * viewScale : undefined,\n '--xy-minimap-node-background-color-props': typeof nodeColor === 'string' ? nodeColor : undefined,\n '--xy-minimap-node-stroke-color-props': typeof nodeStrokeColor === 'string' ? nodeStrokeColor : undefined,\n '--xy-minimap-node-stroke-width-props': typeof nodeStrokeWidth === 'string' ? nodeStrokeWidth : undefined\n }),\n className: cc(['react-flow__minimap', className]),\n \"data-testid\": \"rf__minimap\",\n children: jsxs(\"svg\", {\n width: elementWidth,\n height: elementHeight,\n viewBox: \"\".concat(x, \" \").concat(y, \" \").concat(width, \" \").concat(height),\n className: \"react-flow__minimap-svg\",\n role: \"img\",\n \"aria-labelledby\": labelledBy,\n ref: svg,\n onClick: onSvgClick,\n children: [ariaLabel && jsx(\"title\", {\n id: labelledBy,\n children: ariaLabel\n }), jsx(MiniMapNodes$1, {\n onClick: onSvgNodeClick,\n nodeColor: nodeColor,\n nodeStrokeColor: nodeStrokeColor,\n nodeBorderRadius: nodeBorderRadius,\n nodeClassName: nodeClassName,\n nodeStrokeWidth: nodeStrokeWidth,\n nodeComponent: nodeComponent\n }), jsx(\"path\", {\n className: \"react-flow__minimap-mask\",\n d: \"M\".concat(x - offset, \",\").concat(y - offset, \"h\").concat(width + offset * 2, \"v\").concat(height + offset * 2, \"h\").concat(-width - offset * 2, \"z\\n M\").concat(viewBB.x, \",\").concat(viewBB.y, \"h\").concat(viewBB.width, \"v\").concat(viewBB.height, \"h\").concat(-viewBB.width, \"z\"),\n fillRule: \"evenodd\",\n pointerEvents: \"none\"\n })]\n })\n });\n}\n\nMiniMapComponent.displayName = 'MiniMap';\n/**\n * The `` component can be used to render an overview of your flow. It\n * renders each node as an SVG element and visualizes where the current viewport is\n * in relation to the rest of the flow.\n *\n * @public\n * @example\n *\n * ```jsx\n *import { ReactFlow, MiniMap } from '@xyflow/react';\n *\n *export default function Flow() {\n * return (\n * \n * \n * \n * );\n *}\n *```\n */\n\nvar MiniMap = memo(MiniMapComponent);\n\nfunction ResizeControl(_ref75) {\n var nodeId = _ref75.nodeId,\n position = _ref75.position,\n _ref75$variant = _ref75.variant,\n variant = _ref75$variant === void 0 ? ResizeControlVariant.Handle : _ref75$variant,\n className = _ref75.className,\n _ref75$style = _ref75.style,\n style = _ref75$style === void 0 ? {} : _ref75$style,\n children = _ref75.children,\n color = _ref75.color,\n _ref75$minWidth = _ref75.minWidth,\n minWidth = _ref75$minWidth === void 0 ? 10 : _ref75$minWidth,\n _ref75$minHeight = _ref75.minHeight,\n minHeight = _ref75$minHeight === void 0 ? 10 : _ref75$minHeight,\n _ref75$maxWidth = _ref75.maxWidth,\n maxWidth = _ref75$maxWidth === void 0 ? Number.MAX_VALUE : _ref75$maxWidth,\n _ref75$maxHeight = _ref75.maxHeight,\n maxHeight = _ref75$maxHeight === void 0 ? Number.MAX_VALUE : _ref75$maxHeight,\n _ref75$keepAspectRati = _ref75.keepAspectRatio,\n keepAspectRatio = _ref75$keepAspectRati === void 0 ? false : _ref75$keepAspectRati,\n shouldResize = _ref75.shouldResize,\n onResizeStart = _ref75.onResizeStart,\n onResize = _ref75.onResize,\n onResizeEnd = _ref75.onResizeEnd;\n var contextNodeId = useNodeId();\n var id = typeof nodeId === 'string' ? nodeId : contextNodeId;\n var store = useStoreApi();\n var resizeControlRef = useRef(null);\n var defaultPosition = variant === ResizeControlVariant.Line ? 'right' : 'bottom-right';\n var controlPosition = position !== null && position !== void 0 ? position : defaultPosition;\n var resizer = useRef(null);\n useEffect(function () {\n if (!resizeControlRef.current || !id) {\n return;\n }\n\n if (!resizer.current) {\n resizer.current = XYResizer({\n domNode: resizeControlRef.current,\n nodeId: id,\n getStoreItems: function getStoreItems() {\n var _store$getState38 = store.getState(),\n nodeLookup = _store$getState38.nodeLookup,\n transform = _store$getState38.transform,\n snapGrid = _store$getState38.snapGrid,\n snapToGrid = _store$getState38.snapToGrid,\n nodeOrigin = _store$getState38.nodeOrigin,\n domNode = _store$getState38.domNode;\n\n return {\n nodeLookup: nodeLookup,\n transform: transform,\n snapGrid: snapGrid,\n snapToGrid: snapToGrid,\n nodeOrigin: nodeOrigin,\n paneDomNode: domNode\n };\n },\n onChange: function onChange(change, childChanges) {\n var _store$getState39 = store.getState(),\n triggerNodeChanges = _store$getState39.triggerNodeChanges,\n nodeLookup = _store$getState39.nodeLookup,\n parentLookup = _store$getState39.parentLookup,\n nodeOrigin = _store$getState39.nodeOrigin;\n\n var changes = [];\n var nextPosition = {\n x: change.x,\n y: change.y\n };\n var node = nodeLookup.get(id);\n\n if (node && node.expandParent && node.parentId) {\n var _node$origin, _ref76, _change$width, _ref77, _change$height, _change$x, _change$y;\n\n var origin = (_node$origin = node.origin) !== null && _node$origin !== void 0 ? _node$origin : nodeOrigin;\n var width = (_ref76 = (_change$width = change.width) !== null && _change$width !== void 0 ? _change$width : node.measured.width) !== null && _ref76 !== void 0 ? _ref76 : 0;\n var height = (_ref77 = (_change$height = change.height) !== null && _change$height !== void 0 ? _change$height : node.measured.height) !== null && _ref77 !== void 0 ? _ref77 : 0;\n var child = {\n id: node.id,\n parentId: node.parentId,\n rect: _objectSpread({\n width: width,\n height: height\n }, evaluateAbsolutePosition({\n x: (_change$x = change.x) !== null && _change$x !== void 0 ? _change$x : node.position.x,\n y: (_change$y = change.y) !== null && _change$y !== void 0 ? _change$y : node.position.y\n }, {\n width: width,\n height: height\n }, node.parentId, nodeLookup, origin))\n };\n var parentExpandChanges = handleExpandParent([child], nodeLookup, parentLookup, nodeOrigin);\n changes.push.apply(changes, _toConsumableArray(parentExpandChanges));\n /*\n * when the parent was expanded by the child node, its position will be clamped at\n * 0,0 when node origin is 0,0 and to width, height if it's 1,1\n */\n\n nextPosition.x = change.x ? Math.max(origin[0] * width, change.x) : undefined;\n nextPosition.y = change.y ? Math.max(origin[1] * height, change.y) : undefined;\n }\n\n if (nextPosition.x !== undefined && nextPosition.y !== undefined) {\n var positionChange = {\n id: id,\n type: 'position',\n position: _objectSpread({}, nextPosition)\n };\n changes.push(positionChange);\n }\n\n if (change.width !== undefined && change.height !== undefined) {\n var dimensionChange = {\n id: id,\n type: 'dimensions',\n resizing: true,\n setAttributes: true,\n dimensions: {\n width: change.width,\n height: change.height\n }\n };\n changes.push(dimensionChange);\n }\n\n var _iterator20 = _createForOfIteratorHelper(childChanges),\n _step20;\n\n try {\n for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) {\n var childChange = _step20.value;\n\n var _positionChange = _objectSpread(_objectSpread({}, childChange), {}, {\n type: 'position'\n });\n\n changes.push(_positionChange);\n }\n } catch (err) {\n _iterator20.e(err);\n } finally {\n _iterator20.f();\n }\n\n triggerNodeChanges(changes);\n },\n onEnd: function onEnd() {\n var dimensionChange = {\n id: id,\n type: 'dimensions',\n resizing: false\n };\n store.getState().triggerNodeChanges([dimensionChange]);\n }\n });\n }\n\n resizer.current.update({\n controlPosition: controlPosition,\n boundaries: {\n minWidth: minWidth,\n minHeight: minHeight,\n maxWidth: maxWidth,\n maxHeight: maxHeight\n },\n keepAspectRatio: keepAspectRatio,\n onResizeStart: onResizeStart,\n onResize: onResize,\n onResizeEnd: onResizeEnd,\n shouldResize: shouldResize\n });\n return function () {\n var _resizer$current;\n\n (_resizer$current = resizer.current) === null || _resizer$current === void 0 ? void 0 : _resizer$current.destroy();\n };\n }, [controlPosition, minWidth, minHeight, maxWidth, maxHeight, keepAspectRatio, onResizeStart, onResize, onResizeEnd, shouldResize]);\n var positionClassNames = controlPosition.split('-');\n var colorStyleProp = variant === ResizeControlVariant.Line ? 'borderColor' : 'backgroundColor';\n var controlStyle = color ? _objectSpread(_objectSpread({}, style), {}, _defineProperty({}, colorStyleProp, color)) : style;\n return jsx(\"div\", {\n className: cc(['react-flow__resize-control', 'nodrag'].concat(_toConsumableArray(positionClassNames), [variant, className])),\n ref: resizeControlRef,\n style: controlStyle,\n children: children\n });\n}\n/**\n * To create your own resizing UI, you can use the `NodeResizeControl` component where you can pass children (such as icons).\n * @public\n *\n */\n\n\nvar NodeResizeControl = memo(ResizeControl);\n/**\n * The `` component can be used to add a resize functionality to your\n * nodes. It renders draggable controls around the node to resize in all directions.\n * @public\n *\n * @example\n *```jsx\n *import { memo } from 'react';\n *import { Handle, Position, NodeResizer } from '@xyflow/react';\n *\n *function ResizableNode({ data }) {\n * return (\n * <>\n * \n * \n *
{data.label}
\n * \n * \n * );\n *};\n *\n *export default memo(ResizableNode);\n *```\n */\n\nfunction NodeResizer(_ref78) {\n var nodeId = _ref78.nodeId,\n _ref78$isVisible = _ref78.isVisible,\n isVisible = _ref78$isVisible === void 0 ? true : _ref78$isVisible,\n handleClassName = _ref78.handleClassName,\n handleStyle = _ref78.handleStyle,\n lineClassName = _ref78.lineClassName,\n lineStyle = _ref78.lineStyle,\n color = _ref78.color,\n _ref78$minWidth = _ref78.minWidth,\n minWidth = _ref78$minWidth === void 0 ? 10 : _ref78$minWidth,\n _ref78$minHeight = _ref78.minHeight,\n minHeight = _ref78$minHeight === void 0 ? 10 : _ref78$minHeight,\n _ref78$maxWidth = _ref78.maxWidth,\n maxWidth = _ref78$maxWidth === void 0 ? Number.MAX_VALUE : _ref78$maxWidth,\n _ref78$maxHeight = _ref78.maxHeight,\n maxHeight = _ref78$maxHeight === void 0 ? Number.MAX_VALUE : _ref78$maxHeight,\n _ref78$keepAspectRati = _ref78.keepAspectRatio,\n keepAspectRatio = _ref78$keepAspectRati === void 0 ? false : _ref78$keepAspectRati,\n shouldResize = _ref78.shouldResize,\n onResizeStart = _ref78.onResizeStart,\n onResize = _ref78.onResize,\n onResizeEnd = _ref78.onResizeEnd;\n\n if (!isVisible) {\n return null;\n }\n\n return jsxs(Fragment, {\n children: [XY_RESIZER_LINE_POSITIONS.map(function (position) {\n return jsx(NodeResizeControl, {\n className: lineClassName,\n style: lineStyle,\n nodeId: nodeId,\n position: position,\n variant: ResizeControlVariant.Line,\n color: color,\n minWidth: minWidth,\n minHeight: minHeight,\n maxWidth: maxWidth,\n maxHeight: maxHeight,\n onResizeStart: onResizeStart,\n keepAspectRatio: keepAspectRatio,\n shouldResize: shouldResize,\n onResize: onResize,\n onResizeEnd: onResizeEnd\n }, position);\n }), XY_RESIZER_HANDLE_POSITIONS.map(function (position) {\n return jsx(NodeResizeControl, {\n className: handleClassName,\n style: handleStyle,\n nodeId: nodeId,\n position: position,\n color: color,\n minWidth: minWidth,\n minHeight: minHeight,\n maxWidth: maxWidth,\n maxHeight: maxHeight,\n onResizeStart: onResizeStart,\n keepAspectRatio: keepAspectRatio,\n shouldResize: shouldResize,\n onResize: onResize,\n onResizeEnd: onResizeEnd\n }, position);\n })]\n });\n}\n\nvar selector = function selector(state) {\n var _state$domNode;\n\n return (_state$domNode = state.domNode) === null || _state$domNode === void 0 ? void 0 : _state$domNode.querySelector('.react-flow__renderer');\n};\n\nfunction NodeToolbarPortal(_ref79) {\n var children = _ref79.children;\n var wrapperRef = useStore(selector);\n\n if (!wrapperRef) {\n return null;\n }\n\n return createPortal(children, wrapperRef);\n}\n\nvar nodeEqualityFn = function nodeEqualityFn(a, b) {\n return (a === null || a === void 0 ? void 0 : a.internals.positionAbsolute.x) !== (b === null || b === void 0 ? void 0 : b.internals.positionAbsolute.x) || (a === null || a === void 0 ? void 0 : a.internals.positionAbsolute.y) !== (b === null || b === void 0 ? void 0 : b.internals.positionAbsolute.y) || (a === null || a === void 0 ? void 0 : a.measured.width) !== (b === null || b === void 0 ? void 0 : b.measured.width) || (a === null || a === void 0 ? void 0 : a.measured.height) !== (b === null || b === void 0 ? void 0 : b.measured.height) || (a === null || a === void 0 ? void 0 : a.selected) !== (b === null || b === void 0 ? void 0 : b.selected) || (a === null || a === void 0 ? void 0 : a.internals.z) !== (b === null || b === void 0 ? void 0 : b.internals.z);\n};\n\nvar nodesEqualityFn = function nodesEqualityFn(a, b) {\n if (a.size !== b.size) {\n return false;\n }\n\n var _iterator21 = _createForOfIteratorHelper(a),\n _step21;\n\n try {\n for (_iterator21.s(); !(_step21 = _iterator21.n()).done;) {\n var _step21$value = _slicedToArray(_step21.value, 2),\n key = _step21$value[0],\n node = _step21$value[1];\n\n if (nodeEqualityFn(node, b.get(key))) {\n return false;\n }\n }\n } catch (err) {\n _iterator21.e(err);\n } finally {\n _iterator21.f();\n }\n\n return true;\n};\n\nvar storeSelector = function storeSelector(state) {\n return {\n x: state.transform[0],\n y: state.transform[1],\n zoom: state.transform[2],\n selectedNodesCount: state.nodes.filter(function (node) {\n return node.selected;\n }).length\n };\n};\n/**\n * This component can render a toolbar or tooltip to one side of a custom node. This\n * toolbar doesn't scale with the viewport so that the content is always visible.\n *\n * @public\n * @example\n * ```jsx\n *import { memo } from 'react';\n *import { Handle, Position, NodeToolbar } from '@xyflow/react';\n *\n *function CustomNode({ data }) {\n * return (\n * <>\n * \n * \n * \n * \n * \n *\n *
\n * {data.label}\n *
\n *\n * \n * \n * \n * );\n *};\n *\n *export default memo(CustomNode);\n *```\n * @remarks By default, the toolbar is only visible when a node is selected. If multiple\n * nodes are selected it will not be visible to prevent overlapping toolbars or\n * clutter. You can override this behavior by setting the `isVisible` prop to `true`.\n */\n\n\nfunction NodeToolbar(_ref80) {\n var _nodes$values$next$va;\n\n var nodeId = _ref80.nodeId,\n children = _ref80.children,\n className = _ref80.className,\n style = _ref80.style,\n isVisible = _ref80.isVisible,\n _ref80$position = _ref80.position,\n position = _ref80$position === void 0 ? Position.Top : _ref80$position,\n _ref80$offset = _ref80.offset,\n offset = _ref80$offset === void 0 ? 10 : _ref80$offset,\n _ref80$align = _ref80.align,\n align = _ref80$align === void 0 ? 'center' : _ref80$align,\n rest = _objectWithoutProperties(_ref80, _excluded8);\n\n var contextNodeId = useNodeId();\n var nodesSelector = useCallback(function (state) {\n var nodeIds = Array.isArray(nodeId) ? nodeId : [nodeId || contextNodeId || ''];\n var internalNodes = nodeIds.reduce(function (res, id) {\n var node = state.nodeLookup.get(id);\n\n if (node) {\n res.set(node.id, node);\n }\n\n return res;\n }, new Map());\n return internalNodes;\n }, [nodeId, contextNodeId]);\n var nodes = useStore(nodesSelector, nodesEqualityFn);\n\n var _useStore19 = useStore(storeSelector, shallow),\n x = _useStore19.x,\n y = _useStore19.y,\n zoom = _useStore19.zoom,\n selectedNodesCount = _useStore19.selectedNodesCount; // if isVisible is not set, we show the toolbar only if its node is selected and no other node is selected\n\n\n var isActive = typeof isVisible === 'boolean' ? isVisible : nodes.size === 1 && ((_nodes$values$next$va = nodes.values().next().value) === null || _nodes$values$next$va === void 0 ? void 0 : _nodes$values$next$va.selected) && selectedNodesCount === 1;\n\n if (!isActive || !nodes.size) {\n return null;\n }\n\n var nodeRect = getInternalNodesBounds(nodes);\n var nodesArray = Array.from(nodes.values());\n var zIndex = Math.max.apply(Math, _toConsumableArray(nodesArray.map(function (node) {\n return node.internals.z + 1;\n })));\n\n var wrapperStyle = _objectSpread({\n position: 'absolute',\n transform: getNodeToolbarTransform(nodeRect, {\n x: x,\n y: y,\n zoom: zoom\n }, position, offset, align),\n zIndex: zIndex\n }, style);\n\n return jsx(NodeToolbarPortal, {\n children: jsx(\"div\", _objectSpread(_objectSpread({\n style: wrapperStyle,\n className: cc(['react-flow__node-toolbar', className])\n }, rest), {}, {\n \"data-id\": nodesArray.reduce(function (acc, node) {\n return \"\".concat(acc).concat(node.id, \" \");\n }, '').trim(),\n children: children\n }))\n });\n}\n\nexport { Background, BackgroundVariant, BaseEdge, BezierEdge, ControlButton, Controls, EdgeLabelRenderer, EdgeText, Handle, MiniMap, NodeResizeControl, NodeResizer, NodeToolbar, Panel, index as ReactFlow, ReactFlowProvider, SimpleBezierEdge, SmoothStepEdge, StepEdge, StraightEdge, ViewportPortal, applyEdgeChanges, applyNodeChanges, getSimpleBezierPath, isEdge, isNode, useConnection, useEdges, useEdgesState, useHandleConnections, useInternalNode, useKeyPress, useNodeConnections, useNodeId, useNodes, useNodesData, useNodesInitialized, useNodesState, useOnSelectionChange, useOnViewportChange, useReactFlow, useStore, useStoreApi, useUpdateNodeInternals, useViewport };"],"names":["_MarkerSymbols","_defaultSize","_excluded","_excluded2","_excluded3","_excluded4","_excluded5","_excluded6","_excluded7","_excluded8","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","minLen","_arrayLikeToArray","n","Object","prototype","toString","call","slice","constructor","name","from","test","_unsupportedIterableToArray","length","i","F","s","done","value","e","_e","f","TypeError","err","normalCompletion","didErr","step","next","_e2","return","arr","len","arr2","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","arguments","source","forEach","key","getOwnPropertyDescriptors","defineProperties","defineProperty","StoreContext","createContext","Provider$1","Provider","zustandErrorMessage","useStore","selector","equalityFn","store","useContext","Error","useStoreApi","useMemo","getState","setState","subscribe","style","display","ariaLiveStyle","position","width","height","margin","border","padding","overflow","clip","clipPath","ARIA_NODE_DESC_KEY","ARIA_EDGE_DESC_KEY","selector$o","ariaLiveMessage","AriaLiveMessage","_ref","rfId","jsx","id","concat","children","A11yDescriptions","_ref2","disableKeyboardA11y","jsxs","Fragment","selector$n","userSelectionActive","Panel","forwardRef","_ref3","ref","_ref3$position","className","rest","pointerEvents","positionClasses","split","Attribution","_ref4","proOptions","_ref4$position","hideAttribution","href","rel","displayName","selector$m","_step","selectedNodes","selectedEdges","_iterator","nodeLookup","node","selected","internals","userNode","_step2","_iterator2","edgeLookup","edge","selectId","obj","areEqual","a","b","map","SelectionListenerInner","_ref5","onSelectionChange","_useStore","useEffect","params","nodes","edges","onSelectionChangeHandlers","fn","changeSelector","SelectionListener","_ref6","storeHasSelectionChangeHandlers","defaultNodeOrigin","defaultViewport","x","y","zoom","fieldsToTrack","selector$l","setNodes","setEdges","setMinZoom","setMaxZoom","setTranslateExtent","setNodeExtent","reset","setDefaultNodesAndEdges","setPaneClickDistance","initPrevValues","translateExtent","nodeOrigin","minZoom","maxZoom","elementsSelectable","noPanClassName","paneClickDistance","StoreUpdater","props","_useStore2","defaultNodes","defaultEdges","previousFields","current","useRef","_step3","_iterator3","fieldName","fieldValue","fitViewQueued","fitViewOptions","getMediaQuery","window","matchMedia","defaultDoc","document","useKeyPress","keyCode","undefined","options","actInsideInputWithModifier","_useState3","useState","_useState4","keyPressed","setKeyPressed","modifierPressed","pressedKeys","Set","_useMemo","kc","replace","keysFlat","reduce","res","item","_useMemo2","keyCodes","keysToWatch","downHandler","event","ctrlKey","metaKey","shiftKey","altKey","keyOrCode","useKeyOrCode","code","add","isMatchingKey","_event$composedPath","_event$composedPath$c","_target","composedPath","isInteractiveElement","nodeName","preventDefault","upHandler","clear","delete","resetHandler","addEventListener","removeEventListener","isUp","size","some","every","k","has","eventCode","includes","applyChanges","changes","elements","_step4","updatedElements","changesMap","Map","addItemChanges","_iterator4","change","type","set","elementChanges","get","_step5","_iterator5","element","_changes","_step6","updatedElement","_iterator6","applyChange","index","splice","dragging","_element$measured","dimensions","measured","setAttributes","resizing","applyNodeChanges","applyEdgeChanges","createSelectionChange","getSelectionChanges","items","_step7","selectedIds","mutateItem","_iterator7","_step7$value","willBeSelected","getElementsDiffChanges","_ref7","_step8","_ref7$items","lookup","itemsLookup","_iterator8","entries","_lookupItem$internals","_lookupItem$internals2","_step8$value","_index","lookupItem","storeItem","_step9","_iterator9","elementToRemoveChange","isNode","isEdge","fixedForwardRef","render","useIsomorphicLayoutEffect","useLayoutEffect","useQueue","runQueue","_useState5","BigInt","_useState6","serial","setSerial","_useState7","cb","queue","createQueue","queueItems","BatchContext","BatchProvider","_ref8","nodeQueue","useCallback","_step10","_store$getState9","_store$getState9$node","hasDefaultNodes","onNodesChange","_iterator10","payload","edgeQueue","_step11","_store$getState10","_store$getState10$edg","hasDefaultEdges","onEdgesChange","_iterator11","selector$k","panZoom","useReactFlow","viewportHelper","zoomIn","scaleBy","duration","Promise","resolve","zoomOut","zoomTo","zoomLevel","scaleTo","getZoom","transform","setViewport","_setViewport","_callee","viewport","_viewport$x","_viewport$y","_viewport$zoom","_store$getState4","_store$getState4$tran","tX","tY","tZoom","_context","prev","abrupt","stop","_x","_x2","this","getViewport","_store$getState$trans","setCenter","_setCenter","_callee2","_store$getState5","nextZoom","centerX","centerY","_context2","_x3","_x4","_x5","fitBounds","_fitBounds","_callee3","bounds","_options$padding","_store$getState6","_context3","_x6","_x7","screenToFlowPosition","clientPosition","_options$snapGrid","_options$snapToGrid","_store$getState7","snapGrid","snapToGrid","domNode","_domNode$getBoundingC","getBoundingClientRect","domX","domY","correctedPosition","_snapGrid","_snapToGrid","flowToScreenPosition","flowPosition","_store$getState8","_domNode$getBoundingC2","rendererPosition","useViewportHelper","batchContext","useBatchContext","viewportInitialized","generalHelper","_fitView","_deleteElements","getInternalNode","getNodeRect","_nodeToUse$measured$w","_nodeToUse$measured","_nodeToUse$measured$h","_nodeToUse$measured2","_store$getState11","nodeToUse","parentId","nodeWithPosition","updateNode","nodeUpdate","prevNodes","nextNode","updateEdge","edgeUpdate","prevEdges","nextEdge","getNodes","getNode","_getInternalNode","getEdges","_store$getState12$edg","getEdge","addNodes","newNodes","addEdges","newEdges","toObject","_store$getState13","_store$getState13$nod","_store$getState13$edg","_transform","deleteElements","_callee4","_ref9","_ref9$nodes","nodesToRemove","_ref9$edges","edgesToRemove","_store$getState14","onNodesDelete","onEdgesDelete","triggerNodeChanges","triggerEdgeChanges","onDelete","onBeforeDelete","_yield$getElementsToR","matchingNodes","matchingEdges","hasMatchingEdges","hasMatchingNodes","edgeChanges","nodeChanges","_context4","sent","deletedNodes","deletedEdges","_x8","getIntersectingNodes","nodeOrRect","partially","isRect","nodeRect","hasNodesOption","internalNode","positionAbsolute","currNodeRect","overlappingArea","isNodeIntersecting","area","partiallyVisible","updateNodeData","dataUpdate","nextData","data","updateEdgeData","getNodesBounds","_store$getState15","getHandleConnections","_ref10","_store$getState$conne","_store$getState$conne2","nodeId","connectionLookup","values","getNodeConnections","_ref11","_store$getState$conne3","_store$getState$conne4","handleId","fitView","_callee5","_store$getState$fitVi","fitViewResolver","_context5","withResolvers","promise","_x9","deleteKeyOptions","win$1","containerStyle","top","left","selector$j","lib","ZoomPane","_ref13","onPaneContextMenu","_ref13$zoomOnScroll","zoomOnScroll","_ref13$zoomOnPinch","zoomOnPinch","_ref13$panOnScroll","panOnScroll","_ref13$panOnScrollSpe","panOnScrollSpeed","_ref13$panOnScrollMod","panOnScrollMode","_ref13$zoomOnDoubleCl","zoomOnDoubleClick","_ref13$panOnDrag","panOnDrag","zoomActivationKeyCode","_ref13$preventScrolli","preventScrolling","noWheelClassName","onViewportChange","isControlledViewport","zoomPane","_useStore3","zoomActivationKeyPressed","updateDimensions","_store$getState$onErr","_store$getState17","onError","resizeObserver","ResizeObserver","observe","unobserve","useResizeHandler","onTransformChange","onDraggingChange","paneDragging","onPanZoomStart","vp","_store$getState18","onViewportChangeStart","onMoveStart","onPanZoom","_store$getState19","onMove","onPanZoomEnd","_store$getState20","onViewportChangeEnd","onMoveEnd","_panZoom$current$getV","closest","_panZoom$current","destroy","_panZoom$current2","update","selector$i","userSelectionRect","UserSelection","_useStore4","wrapHandler","handler","containerRef","selector$h","connectionInProgress","connection","inProgress","Pane","_ref14","isSelecting","selectionKeyPressed","_ref14$selectionMode","selectionMode","selectionOnDrag","onSelectionStart","onSelectionEnd","onPaneClick","onPaneScroll","onPaneMouseEnter","onPaneMouseMove","onPaneMouseLeave","_useStore5","hasActiveSelection","container","containerBounds","selectedNodeIds","selectedEdgeIds","selectionInProgress","selectionStarted","onClick","resetSelectedElements","nodesSelectionActive","onWheel","draggable","selection","onContextMenu","onPointerEnter","onPointerDown","_event$target","_event$target$setPoin","_store$getState21","button","setPointerCapture","pointerId","_getEventPosition","nativeEvent","startX","startY","onPointerMove","_defaultEdgeOptions$s","_store$getState22","defaultEdgeOptions","_getEventPosition2","mouseX","mouseY","nextUserSelectRect","Math","abs","prevSelectedNodeIds","prevSelectedEdgeIds","_step12","edgesSelectable","selectable","_iterator12","connections","_step13","_iterator13","_edge$selectable","edgeId","onPointerUp","_event$target2","_event$target2$releas","releasePointerCapture","onPointerLeave","handleNodeClick","_ref15","_ref15$unselect","unselect","nodeRef","_store$getState24","addSelectedNodes","unselectNodesAndEdges","multiSelectionActive","requestAnimationFrame","_nodeRef$current","blur","useDrag","_ref16","_ref16$disabled","disabled","noDragClassName","handleSelector","isSelectable","nodeClickDistance","_useState9","_useState10","setDragging","xyDrag","getStoreItems","onNodeMouseDown","onDragStart","onDragStop","_xyDrag$current","_xyDrag$current2","_xyDrag$current3","useMoveSelectedNodes","_step14","_store$getState25","nodeExtent","nodesDraggable","updateNodePositions","nodeUpdates","isSelected","selectedAndDraggable","xVelo","yVelo","xDiff","direction","factor","yDiff","_iterator14","nextPosition","_calculateNodePositio","NodeIdContext","Consumer","useNodeId","selector$g","connectOnClick","Handle","memo","_ref17","_store$getState$onErr2","_store$getState26","_ref17$type","_ref17$position","isValidConnection","_ref17$isConnectable","isConnectable","_ref17$isConnectableS","isConnectableStart","_ref17$isConnectableE","isConnectableEnd","onConnect","onMouseDown","onTouchStart","isTarget","_useStore6","_useStore7","state","clickHandle","connectionClickStartHandle","connectionMode","fromHandle","toHandle","isValid","connectingTo","connectingFrom","clickConnecting","isPossibleEndHandle","connectionInProcess","clickConnectionInProcess","valid","connectingSelector","onConnectExtended","_store$getState27","onConnectAction","edgeParams","_store$getState28","isMouseTriggered","currentStore","autoPanOnConnect","connectionRadius","flowId","panBy","cancelConnection","onConnectStart","onConnectEnd","updateConnection","getTransform","getFromHandle","autoPanSpeed","connectable","connectablestart","connectableend","clickconnecting","connectingfrom","connectingto","connectionindicator","_store$getState29","onClickConnectStart","onClickConnectEnd","isValidConnectionStore","connectionState","handleType","doc","isValidConnectionHandler","_XYHandle$isValid","handle","fromNodeId","fromHandleId","fromType","connectionClone","structuredClone","toPosition","arrowKeyDiffs","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","builtinNodeTypes","input","_ref18","_ref18$sourcePosition","sourcePosition","label","default","_ref19","_ref19$targetPosition","targetPosition","_ref19$sourcePosition","output","_ref20","_ref20$targetPosition","group","selector$f","_getInternalNodesBoun","transformString","NodesSelection","_ref23","onSelectionContextMenu","_useStore8","moveSelectedNodes","_nodeRef$current2","focus","preventScroll","tabIndex","onKeyDown","hasOwnProperty","win","selector$e","FlowRendererComponent","_ref24","deleteKeyCode","selectionKeyCode","multiSelectionKeyCode","panActivationKeyCode","_panOnScroll","_panOnDrag","_useStore9","panActivationKeyPressed","_selectionOnDrag","_ref12","deleteKeyPressed","multiSelectionKeyPressed","_store$getState16","useGlobalKeyHandler","FlowRenderer","useVisibleNodeIds","onlyRenderVisible","selector$d","selector$c","updateNodeInternals","NodeWrapper","_ref26","_node$selected","_node$deletable","onMouseEnter","onMouseMove","onMouseLeave","onDoubleClick","nodesConnectable","nodesFocusable","nodeTypes","_useStore10","isParent","parentLookup","nodeType","NodeComponent","isDraggable","isFocusable","focusable","hasDimensions","_ref25","observedNode","prevSourcePosition","prevTargetPosition","prevType","isInitialized","handleBounds","hidden","typeChanged","sourcePosChanged","targetPosChanged","nodeElement","force","useNodeObserver","dragHandle","nodeDimensions","inlineDimensions","_node$width2","_node$style3","_node$height2","_node$style4","_ref21","_node$width","_node$style","_ref22","_node$height","_node$style2","initialWidth","initialHeight","getNodeInlineStyleDimensions","hasPointerEvents","onMouseEnterHandler","onMouseMoveHandler","onMouseLeaveHandler","onContextMenuHandler","onDoubleClickHandler","parent","zIndex","z","visibility","_store$getState30","selectNodesOnDrag","nodeDragThreshold","toLowerCase","role","ariaLabel","positionAbsoluteX","positionAbsoluteY","deletable","selector$b","NodeRendererComponent","_useStore11","nodeIds","onlyRenderVisibleElements","_useState11","updates","entry","getAttribute","disconnect","useResizeObserver","onNodeClick","onNodeMouseEnter","onNodeMouseMove","onNodeMouseLeave","onNodeContextMenu","onNodeDoubleClick","NodeRenderer","MarkerSymbols","_ref28","_ref28$color","color","_ref28$strokeWidth","strokeWidth","stroke","strokeLinecap","strokeLinejoin","fill","points","_ref29","_ref29$color","_ref29$strokeWidth","Marker","_ref30","_ref30$width","_ref30$height","_ref30$markerUnits","markerUnits","_ref30$orient","orient","_store$getState$onErr3","_store$getState31","useMarkerSymbol","markerWidth","markerHeight","viewBox","refX","refY","MarkerDefinitions","_ref31","defaultColor","markers","defaultMarkerStart","markerStart","defaultMarkerEnd","markerEnd","marker","MarkerDefinitions$1","EdgeTextComponent","_ref32","labelStyle","_ref32$labelShowBg","labelShowBg","labelBgStyle","_ref32$labelBgPadding","labelBgPadding","_ref32$labelBgBorderR","labelBgBorderRadius","_useState13","_useState14","edgeTextBbox","setEdgeTextBbox","edgeTextClasses","edgeTextRef","textBbox","getBBox","rx","ry","dy","EdgeText","BaseEdge","_ref33","path","labelX","labelY","_ref33$interactionWid","interactionWidth","d","strokeOpacity","getControl","_ref34","pos","x1","y1","x2","y2","getSimpleBezierPath","_ref35","sourceX","sourceY","_ref35$sourcePosition","targetX","targetY","_ref35$targetPosition","_getControl","_getControl2","sourceControlX","sourceControlY","_getControl3","_getControl4","targetControlX","targetControlY","_getBezierEdgeCenter","_getBezierEdgeCenter2","offsetX","offsetY","createSimpleBezierEdge","_ref36","_ref36$sourcePosition","_ref36$targetPosition","_getSimpleBezierPath","_getSimpleBezierPath2","_id","isInternal","SimpleBezierEdge","SimpleBezierEdgeInternal","createSmoothStepEdge","_ref37","_ref37$sourcePosition","_ref37$targetPosition","pathOptions","_getSmoothStepPath","borderRadius","offset","_getSmoothStepPath2","SmoothStepEdge","SmoothStepEdgeInternal","createStepEdge","_ref38","_props$pathOptions2","_props$pathOptions","StepEdge","StepEdgeInternal","createStraightEdge","_ref39","_getStraightPath","_getStraightPath2","StraightEdge","StraightEdgeInternal","createBezierEdge","_ref40","_ref40$sourcePosition","_ref40$targetPosition","_getBezierPath","curvature","_getBezierPath2","BezierEdge","BezierEdgeInternal","builtinEdgeTypes","straight","smoothstep","simplebezier","nullPosition","shiftX","shift","shiftY","EdgeUpdaterClassName","EdgeAnchor","_ref41","_ref41$radius","radius","onMouseOut","cx","cy","r","EdgeUpdateAnchors","_ref42","isReconnectable","reconnectRadius","onReconnect","onReconnectStart","onReconnectEnd","setReconnecting","setUpdateHover","handleEdgeUpdater","oppositeHandle","_store$getState32","edgeUpdaterType","evt","onReconnectMouseEnter","onReconnectMouseOut","_edge$targetHandle","targetHandle","_edge$sourceHandle","sourceHandle","EdgeWrapper","_ref43","_edge$deletable","edgesFocusable","edgesReconnectable","edgeTypes","edgeType","EdgeComponent","reconnectable","edgeRef","_useState15","_useState16","updateHover","_useState17","_useState18","reconnecting","_useStore12","sourceNode","targetNode","edgePosition","elevateOnSelect","elevateEdgesOnSelect","markerStartUrl","markerEndUrl","onEdgeDoubleClick","onEdgeContextMenu","onEdgeMouseEnter","onEdgeMouseMove","onEdgeMouseLeave","animated","inactive","updating","_edgeRef$current","_store$getState33","addSelectedEdges","_edgeRef$current2","_store$getState34","sourceHandleId","targetHandleId","selector$a","EdgeRendererComponent","_ref44","defaultMarkerColor","onEdgeClick","_useStore13","edgeIds","visibleEdgeIds","_step15","_iterator15","EdgeRenderer","selector$9","Viewport","_ref45","selector$8","_state$panZoom","syncViewport","storeSelector$1","to","useConnection","connectionSelector","combinedSelector","getSelector","selector$7","ConnectionLineWrapper","_ref46","component","_useStore14","ConnectionLine","CustomComponent","_ref47","_ref47$type","_useConnection","fromNode","fromPosition","toNode","connectionLineType","connectionLineStyle","fromX","fromY","toX","toY","connectionStatus","pathParams","_getBezierPath3","_getSimpleBezierPath3","_getSmoothStepPath3","_getSmoothStepPath5","_getStraightPath3","emptyTypes","useNodeOrEdgeTypesWarning","nodeOrEdgeTypes","GraphViewComponent","_ref48","onInit","connectionLineComponent","connectionLineContainerStyle","rfInstance","setTimeout","useOnInitHandler","useViewportSync","GraphView","getInitialState","_ref50","_ref51","_ref49","storeEdges","storeNodes","storeNodeOrigin","storeNodeExtent","elevateNodesOnSelect","_getViewportForBounds","autoPanOnNodeDrag","debug","ReactFlowProvider","_ref54","initialNodes","initialEdges","_useState19","_ref52","resolveFitView","_resolveFitView","_callee6","_get18","_context6","_get","nodesInitialized","checkEquality","_get2","_get5","_updateNodeInternals2","updatedInternals","console","log","nodeDragItems","_step17","parentExpandChildren","_get6","_iterator17","_dragItem$measured$wi","_dragItem$measured$he","_step17$value","dragItem","expandParent","max","rect","_get7","_nodeOrigin","parentExpandChanges","_get8","_get9","_get10","_get11","_ref53","_get12","edgesToUnselect","_get13","setScaleExtent","_get14","_get$panZoom","clickDistance","_get$panZoom2","setClickDistance","_get15","nextNodeExtent","_get16","delta","_get17","is","createStore","Wrapper","_ref55","wrapperStyle","_ref56","onNodeDragStart","onNodeDrag","onNodeDragStop","onSelectionDragStart","onSelectionDrag","onSelectionDragStop","_ref56$connectionLine","_ref56$deleteKeyCode","_ref56$selectionKeyCo","_ref56$selectionOnDra","_ref56$selectionMode","_ref56$panActivationK","_ref56$multiSelection","_ref56$zoomActivation","_ref56$onlyRenderVisi","_ref56$nodeOrigin","_ref56$elementsSelect","_ref56$defaultViewpor","defaultViewport$1","_ref56$minZoom","_ref56$maxZoom","_ref56$translateExten","_ref56$preventScrolli","_ref56$defaultMarkerC","_ref56$zoomOnScroll","_ref56$zoomOnPinch","_ref56$panOnScroll","_ref56$panOnScrollSpe","_ref56$panOnScrollMod","_ref56$zoomOnDoubleCl","_ref56$panOnDrag","_ref56$paneClickDista","_ref56$nodeClickDista","_ref56$reconnectRadiu","_ref56$noDragClassNam","_ref56$noWheelClassNa","_ref56$noPanClassName","attributionPosition","_ref56$disableKeyboar","_ref56$colorMode","colorMode","onScroll","colorModeClassName","_getMediaQuery","_useState","_useState2","colorModeClass","setColorModeClass","mediaQuery","updateColorModeClass","matches","useColorModeClass","wrapperOnScroll","currentTarget","scrollTo","behavior","selector$6","_s$domNode","querySelector","EdgeLabelRenderer","_ref57","edgeLabelRenderer","createPortal","useNodesState","_useState21","_useState22","nds","useEdgesState","_useState23","_useState24","eds","BackgroundVariant","LinePattern","_ref63","lineWidth","variant","DotPattern","_ref64","defaultSize","Dots","Lines","Cross","selector$3","patternId","BackgroundComponent","_ref65","_ref65$variant","_ref65$gap","gap","_ref65$lineWidth","_ref65$offset","bgColor","patternClassName","_useStore15","patternSize","isDots","isCross","gapXY","scaledGap","scaledSize","offsetXY","patternDimensions","scaledOffset","_patternId","patternUnits","patternTransform","PlusIcon","xmlns","MinusIcon","FitViewIcon","LockIcon","UnlockIcon","ControlButton","_ref66","selector$2","isInteractive","minZoomReached","maxZoomReached","ControlsComponent","_ref67","_ref67$showZoom","showZoom","_ref67$showFitView","showFitView","_ref67$showInteractiv","showInteractive","onZoomIn","onZoomOut","onFitView","onInteractiveChange","_ref67$position","_ref67$orientation","orientation","_ref67$ariaLabel","_useStore16","_useReactFlow2","orientationClass","title","MiniMapNode","_ref68","strokeColor","shapeRendering","_ref69","background","backgroundColor","selectorNodeIds","getAttrFunction","func","Function","NodeComponentWrapper","_ref71","nodeColorFunc","nodeStrokeColorFunc","nodeClassNameFunc","nodeBorderRadius","nodeStrokeWidth","_useStore17","_node$internals$posit","_getNodeDimensions","MiniMapNodes$1","_ref70","nodeStrokeColor","nodeColor","_ref70$nodeClassName","nodeClassName","_ref70$nodeBorderRadi","_ref70$nodeComponent","nodeComponent","chrome","filterHidden","selector$1","viewBB","boundingRect","flowWidth","flowHeight","MiniMapComponent","_ref72","_style$width","_style$height","_ref72$nodeClassName","_ref72$nodeBorderRadi","maskColor","maskStrokeColor","maskStrokeWidth","_ref72$position","_ref72$pannable","pannable","_ref72$zoomable","zoomable","_ref72$ariaLabel","inversePan","_ref72$zoomStep","zoomStep","_ref72$offsetScale","offsetScale","svg","_useStore18","elementWidth","elementHeight","scaledWidth","scaledHeight","viewScale","viewWidth","viewHeight","labelledBy","viewScaleRef","minimapInstance","getViewScale","_minimapInstance$curr","_minimapInstance$curr2","onSvgClick","_minimapInstance$curr3","_ref73","pointer","_ref74","onSvgNodeClick","fillRule","_ref75","_ref75$variant","_ref75$style","_ref75$minWidth","minWidth","_ref75$minHeight","minHeight","_ref75$maxWidth","maxWidth","Number","MAX_VALUE","_ref75$maxHeight","maxHeight","_ref75$keepAspectRati","keepAspectRatio","shouldResize","onResizeStart","onResize","onResizeEnd","contextNodeId","resizeControlRef","defaultPosition","controlPosition","resizer","_store$getState38","paneDomNode","onChange","childChanges","_store$getState39","_node$origin","_ref76","_change$width","_ref77","_change$height","_change$x","_change$y","origin","child","positionChange","dimensionChange","_step20","_iterator20","_positionChange","onEnd","boundaries","_resizer$current","positionClassNames","colorStyleProp","controlStyle","_state$domNode","NodeToolbarPortal","_ref79","wrapperRef","nodeEqualityFn","nodesEqualityFn","_step21","_iterator21","_step21$value","storeSelector","selectedNodesCount","NodeToolbar","_ref80","_nodes$values$next$va","isVisible","_ref80$position","_ref80$offset","_ref80$align","align","_useStore19","nodesArray","acc","trim"],"sourceRoot":""}