@next-bricks/diagram 0.68.4 → 0.68.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bricks.json +2 -2
- package/dist/chunks/3440.4132cdb6.js +2 -0
- package/dist/chunks/3440.4132cdb6.js.map +1 -0
- package/dist/chunks/3654.1ca3854c.js +3 -0
- package/dist/chunks/3654.1ca3854c.js.map +1 -0
- package/dist/chunks/3746.3c082d43.js +2 -0
- package/dist/chunks/3746.3c082d43.js.map +1 -0
- package/dist/chunks/577.be8fdde1.js +2 -0
- package/dist/chunks/577.be8fdde1.js.map +1 -0
- package/dist/chunks/editable-label.667b04d5.js +3 -0
- package/dist/chunks/editable-label.667b04d5.js.map +1 -0
- package/dist/chunks/eo-diagram.78450578.js +2 -0
- package/dist/chunks/{eo-diagram.ccbb3f33.js.map → eo-diagram.78450578.js.map} +1 -1
- package/dist/chunks/eo-display-canvas.2a43ce91.js +2 -0
- package/dist/chunks/{eo-display-canvas.969c8dc2.js.map → eo-display-canvas.2a43ce91.js.map} +1 -1
- package/dist/chunks/eo-draw-canvas.580045be.js +2 -0
- package/dist/chunks/{eo-draw-canvas.2fb409f0.js.map → eo-draw-canvas.580045be.js.map} +1 -1
- package/dist/chunks/experimental-node.2f4d802a.js +2 -0
- package/dist/chunks/experimental-node.2f4d802a.js.map +1 -0
- package/dist/chunks/main.a4e99faa.js +2 -0
- package/dist/chunks/{main.03dc5db0.js.map → main.a4e99faa.js.map} +1 -1
- package/dist/examples.json +3 -3
- package/dist/index.680276ff.js +2 -0
- package/dist/{index.cd3db676.js.map → index.680276ff.js.map} +1 -1
- package/dist/manifest.json +175 -175
- package/package.json +3 -3
- package/dist/chunks/3233.c247dfc0.js +0 -3
- package/dist/chunks/3233.c247dfc0.js.map +0 -1
- package/dist/chunks/551.fd9aaa4f.js +0 -2
- package/dist/chunks/551.fd9aaa4f.js.map +0 -1
- package/dist/chunks/5819.071430a0.js +0 -2
- package/dist/chunks/5819.071430a0.js.map +0 -1
- package/dist/chunks/9711.ecaa0666.js +0 -2
- package/dist/chunks/9711.ecaa0666.js.map +0 -1
- package/dist/chunks/editable-label.595d319c.js +0 -3
- package/dist/chunks/editable-label.595d319c.js.map +0 -1
- package/dist/chunks/eo-diagram.ccbb3f33.js +0 -2
- package/dist/chunks/eo-display-canvas.969c8dc2.js +0 -2
- package/dist/chunks/eo-draw-canvas.2fb409f0.js +0 -2
- package/dist/chunks/experimental-node.e8e2498e.js +0 -2
- package/dist/chunks/experimental-node.e8e2498e.js.map +0 -1
- package/dist/chunks/main.03dc5db0.js +0 -2
- package/dist/index.cd3db676.js +0 -2
- /package/dist/chunks/{3233.c247dfc0.js.LICENSE.txt → 3654.1ca3854c.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{editable-label.595d319c.js.LICENSE.txt → editable-label.667b04d5.js.LICENSE.txt} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunks/3233.c247dfc0.js","mappings":";wLAGIA,QAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,s0BAImX,KAE5Z,QAAeH,EAAwBI,2BCThC,SAASC,EACdC,EACAC,GAEA,IAAK,MAAM,GACTJ,EAAE,SACFK,EAAQ,UACRC,EAAS,MACTC,EACAC,KAAMC,KACHN,EAAoB,CACvB,MAAMO,EAAQN,EAAwBO,IAAIX,GAC1C,GAAIU,IACFA,EAAME,MAAMC,KAAO,GAAGR,EAAS,OAC/BK,EAAME,MAAME,IAAM,GAAGT,EAAS,OAC9BK,EAAME,MAAMG,WAAa,UAEP,WAAdT,QAAoCU,IAAVT,GAAqB,CACjD,MAAOU,EAAOC,GAAUT,QAAAA,EAAS,CAAC,EAAG,GAU/BU,EAAgBC,KAAKC,OACvBd,EAAQ,EAAc,EAAVa,KAAKE,GAASf,EAAQA,GAASa,KAAKE,GAAM,GAGpDC,EACU,UAAdjB,EAAwBa,GAAiBA,EAAgB,GAAK,EAC1D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K,YAKf","sources":["webpack:///./src/diagram/styles.shadow.css","webpack:///./src/diagram/processors/adjustLineLabels.ts","webpack:///./src/diagram/processors/getRenderedLines.ts","webpack:///./src/diagram/LineComponent.tsx","webpack:///./src/diagram/processors/handleNodesMouseDown.ts","webpack:///./src/diagram/LineLabelComponent.tsx","webpack:///./src/diagram/processors/sameTarget.ts","webpack:///./src/diagram/processors/handleKeyboard.ts","webpack:///./src/diagram/processors/getLineMaskRects.ts","webpack:///./src/diagram/ConnectLineComponent.tsx","webpack:///../../node_modules/@next-api-sdk/cmdb-sdk/dist/esm/api/cmdb/instance/postSearchV3.js","webpack:///../../node_modules/@next-api-sdk/cmdb-sdk/dist/esm/api/cmdb/instance/updateInstanceV2.js","webpack:///../../node_modules/@next-api-sdk/cmdb-sdk/dist/esm/api/cmdb/instance/createInstance.js","webpack:///./src/diagram/hooks/useUserView.ts","webpack:///./src/diagram/processors/createAsyncQueue.ts","webpack:///./src/diagram/processors/getRenderedLineLabels.ts","webpack:///./src/diagram/processors/adjustNodesSize.ts","webpack:///./src/diagram/processors/adjustNodesPosition.ts","webpack:///./src/diagram/processors/getRenderedEdges.ts","webpack:///./src/diagram/processors/getForceGraph.ts","webpack:///./src/diagram/hooks/useRenderedDiagram.ts","webpack:///./src/diagram/processors/getDagreGraph.ts","webpack:///./src/diagram/processors/getManualGraph.ts","webpack:///./src/diagram/processors/transformToCenter.ts","webpack:///./src/diagram/constants.ts","webpack:///./src/diagram/NodeComponent.tsx","webpack:///./src/diagram/processors/findNodeBrick.ts","webpack:///./src/diagram/processors/matchEdgeByFilter.ts","webpack:///./src/diagram/processors/normalizeLinesAndMarkers.ts","webpack:///./src/diagram/LineMaskComponent.tsx"],"sourcesContent":["// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:host{display:block;width:100%;height:100%;overflow:hidden}:host([hidden]){display:none}*{box-sizing:border-box}.diagram{width:100%;height:100%;position:relative;opacity:0}.diagram:focus{outline:none}.lines,\n.line-labels,\n.nodes{position:absolute;top:0;left:0}.line-labels{opacity:0}.ready{opacity:1}.diagram.ready.pannable{cursor:grab}.diagram.pannable.grabbing{cursor:grabbing}.nodes,\n.lines{transform-origin:0 0}.node,\n.line-label{position:absolute;visibility:hidden}.line-label{transform:translate(-50%,-50%);white-space:pre-line;width:max-content;text-align:center;line-height:1}.lines{pointer-events:none}.line.interactable{pointer-events:auto;cursor:default}.connect-line{position:fixed;top:0;left:0;right:0;bottom:0;pointer-events:none}.connect-line:not(.connecting){display:none}.line:not(.active) .active-bg{display:none}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","import type { RefRepository, RenderedLineLabel } from \"../interfaces\";\n\nexport function adjustLineLabels(\n renderedLineLabels: RenderedLineLabel[],\n lineLabelsRefRepository: RefRepository\n) {\n for (const {\n id,\n position,\n placement,\n angle,\n size: _size,\n } of renderedLineLabels) {\n const label = lineLabelsRefRepository.get(id);\n if (label) {\n label.style.left = `${position[0]}px`;\n label.style.top = `${position[1]}px`;\n label.style.visibility = \"visible\";\n // label.classList.add(placement);\n if (placement !== \"center\" && angle !== undefined) {\n const [width, height] = _size ?? [0, 0];\n // Get the numbered direction of the line\n //\n // \\ | /\n // \\ 5 | 6 /\n // 4 \\ | / 7\n // -----x-----\n // 3 / | \\ 0\n // / 2 | 1 \\\n // / | \\\n const tempDirection = Math.floor(\n ((angle < 0 ? Math.PI * 2 + angle : angle) / Math.PI) * 4\n );\n // Swap direction for end labels.\n const direction =\n placement === \"start\" ? tempDirection : (tempDirection + 4) % 8;\n const tangent = Math.tan(angle);\n const offsetAngle =\n angle + ((placement === \"start\" ? 1 : -1) * Math.PI) / 2;\n const offset = 2;\n const offsetSin = Math.sin(offsetAngle) * offset;\n const offsetCos = Math.cos(offsetAngle) * offset;\n let transform: string;\n switch (direction) {\n case 0:\n transform = `translate(0,${width * tangent + offsetSin}px)`;\n break;\n case 1:\n transform = `translate(${height / tangent - offsetCos}px,0)`;\n break;\n case 2:\n transform = `translate(calc(${\n height / tangent + offsetCos\n }px - 100%),0)`;\n break;\n case 3:\n transform = `translate(-100%,${-width * tangent - offsetSin}px)`;\n break;\n case 4:\n transform = `translate(-100%,calc(${\n -width * tangent + offsetSin\n }px - 100%))`;\n break;\n case 5:\n transform = `translate(calc(${\n -height / tangent - offsetCos\n }px - 100%),-100%)`;\n break;\n case 6:\n transform = `translate(${-height / tangent + offsetCos}px,-100%)`;\n break;\n default:\n transform = `translate(0,calc(${\n width * tangent - offsetSin\n }px - 100%))`;\n }\n label.style.transform = transform;\n }\n }\n }\n}\n","// istanbul ignore file: experimental\nimport type {\n DiagramEdge,\n Direction,\n NormalizedLine,\n RenderedEdge,\n RenderedLine,\n RenderedNode,\n} from \"../interfaces\";\nimport { curveLine } from \"../lines/curveLine\";\nimport { getDirectLinePoints } from \"../lines/getDirectLinePoints\";\nimport { getPolyLinePoints } from \"../lines/getPolyLinePoints\";\nimport { doTwoNodesOverlap } from \"./doTwoNodesOverlap\";\n\nexport function getRenderedLines(\n renderedEdges: RenderedEdge[],\n renderedNodes: RenderedNode[],\n normalizedLines: NormalizedLine[]\n): RenderedLine[] {\n const renderedEdgeMap = new WeakMap<DiagramEdge, RenderedEdge>();\n const renderedNodeMap = new Map<string, RenderedNode>();\n const relatedNodes = new Map<string, Set<RenderedNode>>();\n\n for (const renderedNode of renderedNodes) {\n renderedNodeMap.set(renderedNode.id, renderedNode);\n }\n\n for (const renderedEdge of renderedEdges) {\n const { data: edge } = renderedEdge;\n renderedEdgeMap.set(edge, renderedEdge);\n }\n\n let prepared = false;\n const prepareRelatedNodes = () => {\n if (prepared) {\n return;\n }\n prepared = true;\n\n const addRelatedNodes = (from: string, to: string) => {\n let relates = relatedNodes.get(from);\n if (!relates) {\n relatedNodes.set(from, (relates = new Set()));\n }\n const toNode = renderedNodeMap.get(to);\n if (toNode) {\n relates.add(toNode);\n }\n };\n\n for (const {\n data: { source, target },\n } of renderedEdges) {\n if (source !== target) {\n addRelatedNodes(source, target);\n addRelatedNodes(target, source);\n }\n }\n };\n\n return normalizedLines\n .map<RenderedLine | undefined>(({ line, edge, markers, ...rest }) => {\n const renderedEdge = renderedEdgeMap.get(edge);\n if (!renderedEdge) {\n return;\n }\n const startMarkerOffset =\n markers.find(\n (marker) =>\n marker.variant === \"default\" && marker.placement === \"start\"\n )?.offset ?? 0;\n const endMarkerOffset =\n markers.find(\n (marker) => marker.variant === \"default\" && marker.placement === \"end\"\n )?.offset ?? 0;\n let angle: number | undefined;\n\n let { points } = renderedEdge;\n // Only dagre graph will have pre-calculated line points\n if (!points) {\n const source = renderedNodeMap.get(edge.source);\n const target = renderedNodeMap.get(edge.target);\n\n if (source && target && source !== target) {\n if (line.type === \"polyline\") {\n if (\n !doTwoNodesOverlap(\n source,\n target,\n startMarkerOffset,\n endMarkerOffset\n )\n ) {\n prepareRelatedNodes();\n const sourceDirection = getDirection(\n source,\n target,\n startMarkerOffset\n );\n const targetDirection = getDirection(\n target,\n source,\n endMarkerOffset\n );\n const sourceRelates = getOrderedRelates(\n relatedNodes.get(edge.source) ?? [],\n source,\n sourceDirection,\n startMarkerOffset\n );\n const targetRelates = getOrderedRelates(\n relatedNodes.get(edge.target) ?? [],\n target,\n targetDirection,\n endMarkerOffset\n );\n\n const sourcePosition =\n (sourceRelates.indexOf(target) + 1) /\n (sourceRelates.length + 1);\n const targetPosition =\n (targetRelates.indexOf(source) + 1) /\n (targetRelates.length + 1);\n\n points = getPolyLinePoints(\n source,\n target,\n sourceDirection,\n targetDirection,\n sourcePosition,\n targetPosition\n );\n }\n } else {\n points = getDirectLinePoints(source, target);\n }\n\n if (points) {\n const start = points[0];\n const end = points[points.length - 1];\n angle = Math.atan2(end.y - start.y, end.x - start.x);\n }\n }\n }\n\n const d = curveLine(\n points,\n line.curveType,\n startMarkerOffset,\n endMarkerOffset\n );\n return {\n ...rest,\n markers,\n line,\n edge,\n d,\n angle,\n labelSize: renderedEdge.labelSize,\n };\n })\n .filter(Boolean) as RenderedLine[];\n}\n\nfunction getDirection(\n source: RenderedNode,\n target: RenderedNode,\n padding: number\n): Direction {\n // Add a padding to the source node to avoid the markers being warped.\n const sourceAngle = Math.atan2(\n source.height + padding * 2,\n source.width + padding * 2\n );\n const { x: sx, y: sy } = source;\n const { x: tx, y: ty } = target;\n const angle = Math.atan2(ty - sy, tx - sx);\n const fixedAngle = angle < 0 ? Math.PI * 2 + angle : angle;\n const direction = Math.floor((fixedAngle / Math.PI) * 2);\n switch (direction) {\n case 0:\n return fixedAngle < sourceAngle ? \"right\" : \"bottom\";\n case 1:\n return fixedAngle < Math.PI - sourceAngle ? \"bottom\" : \"left\";\n case 2:\n return fixedAngle < Math.PI + sourceAngle ? \"left\" : \"top\";\n default:\n return fixedAngle < Math.PI * 2 - sourceAngle ? \"top\" : \"right\";\n }\n}\n\nfunction getOrderedRelates(\n relates: Iterable<RenderedNode>,\n from: RenderedNode,\n direction: Direction,\n padding: number\n): RenderedNode[] {\n return [...relates]\n .filter((node) => getDirection(from, node, padding) === direction)\n .sort((a, b) => {\n const { x: ax, y: ay } = a;\n const { x: bx, y: by } = b;\n return direction === \"top\" || direction === \"bottom\" ? ax - bx : ay - by;\n });\n}\n","import React from \"react\";\nimport classNames from \"classnames\";\nimport type { LineTarget, RenderedLine, LineMaskRects } from \"./interfaces\";\n\nexport interface LineComponentProps {\n line: RenderedLine;\n linePaths: Map<string, SVGPathElement | null>;\n lineMaskRects: LineMaskRects;\n maskPrefix: string;\n markerPrefix: string;\n activeLineMarkerPrefix: string;\n active?: boolean;\n activeRelated?: boolean;\n onLineClick?(line: LineTarget): void;\n onLineDoubleClick?(line: LineTarget): void;\n}\n\nexport function LineComponent({\n line: { line, edge, d, markers },\n linePaths,\n lineMaskRects,\n maskPrefix,\n markerPrefix,\n activeLineMarkerPrefix,\n active,\n activeRelated,\n onLineClick,\n onLineDoubleClick,\n}: LineComponentProps): JSX.Element {\n const mask = lineMaskRects.has(line.$id)\n ? `url(#${maskPrefix}${line.$id})`\n : undefined;\n\n const { strokeColor, strokeWidth, interactStrokeWidth } = {\n ...line,\n ...(active\n ? line.overrides?.active\n : activeRelated\n ? line.overrides?.activeRelated\n : null),\n };\n\n const expectVariant = active\n ? \"active\"\n : activeRelated\n ? \"active-related\"\n : \"default\";\n\n let markerStart: string | undefined;\n let markerEnd: string | undefined;\n\n for (const marker of markers) {\n if (marker.variant === expectVariant) {\n if (marker.placement === \"start\") {\n markerStart = `url(#${markerPrefix}${marker.index})`;\n } else {\n markerEnd = `url(#${markerPrefix}${marker.index})`;\n }\n }\n }\n\n return (\n <g\n className={classNames(\"line\", {\n interactable: line.interactable,\n active,\n \"active-related\": activeRelated,\n })}\n onClick={\n line.interactable\n ? () => {\n onLineClick?.({ id: line.$id, edge });\n }\n : undefined\n }\n onDoubleClick={\n line.interactable\n ? (e) => {\n e.preventDefault();\n e.stopPropagation();\n onLineDoubleClick?.({ id: line.$id, edge });\n }\n : undefined\n }\n style={{ cursor: line.cursor }}\n >\n {line.interactable && (\n <path\n // This `path` is made for expanding interaction area of graph lines.\n d={d}\n fill=\"none\"\n stroke=\"transparent\"\n strokeWidth={interactStrokeWidth}\n />\n )}\n <path\n ref={(element) => linePaths.set(line.$id, element)}\n stroke={strokeColor}\n strokeWidth={strokeWidth}\n d={d}\n fill=\"none\"\n markerStart={markerStart}\n markerEnd={markerEnd}\n mask={mask}\n />\n <path\n stroke=\"var(--palette-blue-3)\"\n strokeWidth={strokeWidth}\n d={d}\n fill=\"none\"\n className=\"active-bg\"\n markerStart={`url(#${activeLineMarkerPrefix}start)`}\n markerEnd={`url(#${activeLineMarkerPrefix}end)`}\n mask={mask}\n />\n </g>\n );\n}\n","import { checkIfByTransform, __secret_internals } from \"@next-core/runtime\";\nimport type React from \"react\";\nimport {\n DEFAULT_LINE_STROKE_COLOR,\n DEFAULT_LINE_STROKE_WIDTH,\n} from \"../constants\";\nimport type {\n ConnectLineState,\n DiagramNode,\n ConnectLineDetail,\n ConnectNodesOptions,\n PositionTuple,\n RefRepository,\n ActiveTarget,\n DragNodesOptions,\n NodesFilterOptions,\n NodeMovement,\n ManualLayoutStatus,\n} from \"../interfaces\";\n\nexport function handleNodesMouseDown(\n event: MouseEvent,\n {\n nodes,\n nodesRefRepository,\n connectNodes,\n dragNodes,\n scale,\n setConnectLineState,\n setConnectLineTo,\n setManualLayoutStatus,\n setNodeMovement,\n onSwitchActiveTarget,\n onNodesConnect,\n }: {\n nodes: DiagramNode[] | undefined;\n connectNodes: ConnectNodesOptions | undefined;\n dragNodes: DragNodesOptions | undefined;\n nodesRefRepository: RefRepository | null;\n scale: number;\n setConnectLineState: (\n value: React.SetStateAction<ConnectLineState | null>\n ) => void;\n setConnectLineTo: (value: React.SetStateAction<PositionTuple>) => void;\n setManualLayoutStatus: (\n value: React.SetStateAction<ManualLayoutStatus>\n ) => void;\n setNodeMovement: (value: React.SetStateAction<NodeMovement | null>) => void;\n onSwitchActiveTarget?(target: ActiveTarget | null): void;\n onNodesConnect?(detail: ConnectLineDetail): void;\n }\n) {\n function findNode(match: (element: HTMLElement) => boolean) {\n if (nodesRefRepository) {\n for (const [id, element] of nodesRefRepository) {\n if (match(element)) {\n return nodes?.find((node) => node.id === id);\n }\n }\n }\n }\n\n if (!connectNodes && !dragNodes) {\n return;\n }\n\n const source = findNode((element) =>\n element.contains(event.target as Node | null)\n );\n\n if (!source) {\n return;\n }\n\n if (!nodeMatched(connectNodes || dragNodes!, source)) {\n return;\n }\n\n event.stopPropagation();\n const from: PositionTuple = [event.clientX, event.clientY];\n\n if (connectNodes) {\n setConnectLineState({\n from,\n options: {\n strokeColor: DEFAULT_LINE_STROKE_COLOR,\n strokeWidth: DEFAULT_LINE_STROKE_WIDTH,\n ...(__secret_internals.legacyDoTransform(\n { source },\n connectNodes\n ) as ConnectNodesOptions),\n },\n });\n setConnectLineTo(from);\n\n onSwitchActiveTarget?.({ type: \"node\", nodeId: source.id });\n\n const onMouseMove = (e: MouseEvent) => {\n setConnectLineTo([e.clientX, e.clientY]);\n };\n const onMouseUp = (e: MouseEvent) => {\n document.removeEventListener(\"mousemove\", onMouseMove);\n document.removeEventListener(\"mouseup\", onMouseUp);\n setConnectLineState(null);\n const eventTargets = e.composedPath();\n const target = findNode((element) => eventTargets.includes(element));\n if (target && source !== target) {\n onNodesConnect?.({ source, target });\n }\n };\n document.addEventListener(\"mousemove\", onMouseMove);\n document.addEventListener(\"mouseup\", onMouseUp);\n return;\n }\n\n // Drag node\n onSwitchActiveTarget?.({ type: \"node\", nodeId: source.id });\n\n let moved = false;\n const onMouseMove = (e: MouseEvent) => {\n // Respect the scale\n const movement: PositionTuple = [\n (e.clientX - from[0]) / scale,\n (e.clientY - from[1]) / scale,\n ];\n if (!moved) {\n moved = movement[0] ** 2 + movement[1] ** 2 >= 9;\n if (moved) {\n setManualLayoutStatus(\"started\");\n }\n }\n if (moved) {\n setNodeMovement({ id: source.id, move: movement });\n }\n };\n const onMouseUp = () => {\n moved = false;\n document.removeEventListener(\"mousemove\", onMouseMove);\n document.removeEventListener(\"mouseup\", onMouseUp);\n setNodeMovement(null);\n setManualLayoutStatus(\"finished\");\n };\n document.addEventListener(\"mousemove\", onMouseMove);\n document.addEventListener(\"mouseup\", onMouseUp);\n}\n\nfunction nodeMatched(\n options: NodesFilterOptions,\n source: DiagramNode\n): boolean {\n return options.sourceType\n ? ([] as unknown[]).concat(options.sourceType).includes(source.type)\n : checkIfByTransform(options, { source });\n}\n","import React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { ReactUseBrick } from \"@next-core/react-runtime\";\nimport { checkIfByTransform } from \"@next-core/runtime\";\nimport type {\n DiagramEdge,\n LineLabelConf,\n // PositionTuple,\n RefRepository,\n LineLabel,\n TextOptions,\n} from \"./interfaces\";\n\nexport interface LineLabelComponentGroupProps {\n labels?: LineLabel[];\n onRendered?: (refRepository: RefRepository | null) => void;\n}\n\nexport function LineLabelComponentGroup({\n labels,\n onRendered,\n}: LineLabelComponentGroupProps): JSX.Element {\n const [rendered, setRendered] = useState(false);\n const [renderedIds, setRenderedIds] = useState<string[]>([]);\n const refRepository = useMemo<RefRepository>(() => new Map(), []);\n\n const handleRenderer = useCallback(\n (id: string, element: HTMLElement | null) => {\n if (element) {\n refRepository.set(id, element);\n }\n setRenderedIds((previous) =>\n previous.includes(id) ? previous : previous.concat(id)\n );\n },\n [refRepository]\n );\n\n const handleUnmount = useCallback(\n (id: string) => {\n setRenderedIds((previous) => {\n const index = previous.indexOf(id);\n return index === -1\n ? previous\n : previous.slice(0, index).concat(previous.slice(index + 1));\n });\n refRepository.delete(id);\n },\n [refRepository]\n );\n\n useEffect(() => {\n // All nodes have been rendered.\n setRendered(!labels?.some((label) => !renderedIds.includes(label.id)));\n }, [labels, renderedIds]);\n\n useEffect(\n () => {\n onRendered?.(rendered ? refRepository : null);\n },\n // Dot not re-run effect when `onRendered` changed.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [/* onRendered, */ refRepository, rendered]\n );\n\n return (\n <React.Fragment>\n {labels?.map(({ text, label, /* position, */ id, edge }) =>\n label ? (\n <div\n key={id}\n className=\"line-label\"\n // style={{\n // left: position[0],\n // top: position[1],\n // }}\n >\n <LineLabelComponent\n id={id}\n edge={edge}\n label={label}\n onRendered={handleRenderer}\n onUnmount={handleUnmount}\n />\n </div>\n ) : (\n <LineTextComponent\n key={id}\n id={id}\n text={text!}\n // position={position}\n onRendered={handleRenderer}\n />\n )\n )}\n </React.Fragment>\n );\n}\n\nexport interface LineTextComponentProps {\n id: string;\n text: TextOptions;\n // position: PositionTuple;\n onRendered?: (id: string, element: HTMLElement | null) => void;\n // onUnmount?: (id: string) => void;\n}\n\nexport function LineTextComponent({\n id,\n text,\n // position,\n onRendered /* , onUnmount */,\n}: LineTextComponentProps): JSX.Element {\n const refCallback = useCallback(\n (element: HTMLDivElement) => {\n onRendered?.(id, element);\n },\n [id, onRendered]\n );\n\n return (\n <div\n className=\"line-label\"\n ref={refCallback}\n // style={{\n // left: position[0],\n // top: position[1],\n // ...text!.style,\n // }}\n style={text.style}\n >\n {text!.content}\n </div>\n );\n}\n\n// export const LineLabelComponentGroup = React.memo(LegacyLineLabelComponentGroup);\n\nexport interface LineLabelComponentProps {\n id: string;\n edge: DiagramEdge;\n label: LineLabelConf;\n onRendered?: (id: string, element: HTMLElement | null) => void;\n onUnmount?: (id: string) => void;\n}\n\nexport function LineLabelComponent({\n id,\n edge,\n label,\n onRendered,\n onUnmount,\n}: LineLabelComponentProps): JSX.Element | null {\n const useBrick = useMemo(\n () => (checkIfByTransform(label, { edge }) ? label.useBrick : null),\n [edge, label]\n );\n\n const memoizedData = useMemo(() => ({ edge }), [edge]);\n\n useEffect(() => {\n if (!useBrick) {\n // Keep the same time delay for reporting rendered.\n setTimeout(() => {\n onRendered?.(id, null);\n });\n }\n }, [id, onRendered, useBrick]);\n\n useEffect(\n () => {\n return () => {\n onUnmount?.(id);\n };\n },\n // Only unmount once\n // eslint-disable-next-line react-hooks/exhaustive-deps\n []\n );\n\n const refCallback = useCallback(\n (element: HTMLElement | null) => {\n if (element) {\n // Todo: correctly wait for `useBrick` in v3 to be rendered (after layout)\n // Wait a macro task to let `useBrick` to be rendered.\n setTimeout(() => {\n onRendered?.(id, element.parentElement);\n });\n }\n },\n [id, onRendered]\n );\n\n const ignoredCallback = useCallback(() => {\n setTimeout(() => {\n onRendered?.(id, null);\n });\n }, [id, onRendered]);\n\n if (!useBrick) {\n return null;\n }\n\n return (\n <ReactUseBrick\n refCallback={refCallback}\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore For v3 only\n ignoredCallback={ignoredCallback}\n useBrick={useBrick}\n data={memoizedData}\n />\n );\n}\n","import type {\n ActiveTarget,\n ActiveTargetOfEdge,\n ActiveTargetOfNode,\n} from \"../interfaces\";\n\nexport function sameTarget(\n a: ActiveTarget | null | undefined,\n b: ActiveTarget | null | undefined\n): boolean {\n return a\n ? !!b &&\n a.type === b.type &&\n (a.type === \"node\"\n ? a.nodeId === (b as ActiveTargetOfNode).nodeId\n : a.edge.source === (b as ActiveTargetOfEdge).edge.source &&\n a.edge.target === (b as ActiveTargetOfEdge).edge.target)\n : !b;\n}\n","import { minBy } from \"lodash\";\nimport type {\n ActiveTarget,\n DiagramEdge,\n DiagramNode,\n RenderedNode,\n} from \"../interfaces\";\n\nexport type KeyboardAction =\n | KeyboardActionSwitchActiveNode\n | KeyboardActionDeleteNode\n | KeyboardActionDeleteEdge;\n\nexport interface KeyboardActionSwitchActiveNode {\n action: \"switch-active-node\";\n node?: DiagramNode;\n}\n\nexport interface KeyboardActionDeleteNode {\n action: \"delete-node\";\n node: DiagramNode;\n}\n\nexport interface KeyboardActionDeleteEdge {\n action: \"delete-edge\";\n edge: DiagramEdge;\n}\n\nexport function handleKeyboard(\n event: KeyboardEvent,\n {\n renderedNodes,\n activeTarget,\n }: {\n renderedNodes: RenderedNode[];\n activeTarget: ActiveTarget | null | undefined;\n }\n): KeyboardAction | undefined {\n const activeNode =\n activeTarget?.type === \"node\"\n ? renderedNodes.find((node) => node.id === activeTarget.nodeId)\n : undefined;\n const activeEdge =\n activeTarget?.type === \"edge\" ? activeTarget.edge : undefined;\n\n if (!activeNode && !activeEdge) {\n return;\n }\n\n const key =\n event.key ||\n /* istanbul ignore next: compatibility */ event.keyCode ||\n /* istanbul ignore next: compatibility */ event.which;\n let action: KeyboardAction[\"action\"] | undefined;\n let node: RenderedNode | undefined;\n let edge: DiagramEdge | undefined;\n\n switch (key) {\n case \"Backspace\":\n case 8:\n case \"Delete\":\n case 46: {\n if (activeNode) {\n action = \"delete-node\";\n node = activeNode;\n } else {\n action = \"delete-edge\";\n edge = activeEdge;\n }\n break;\n }\n default:\n if (!activeNode) {\n return;\n }\n switch (key) {\n case \"ArrowLeft\":\n case 37: {\n node = moveOnAxis(\"x\", renderedNodes, activeNode, -1);\n action = \"switch-active-node\";\n break;\n }\n case \"ArrowUp\":\n case 38: {\n node = moveOnAxis(\"y\", renderedNodes, activeNode, -1);\n action = \"switch-active-node\";\n break;\n }\n case \"ArrowRight\":\n case 39: {\n node = moveOnAxis(\"x\", renderedNodes, activeNode, 1);\n action = \"switch-active-node\";\n break;\n }\n case \"ArrowDown\":\n case 40: {\n node = moveOnAxis(\"y\", renderedNodes, activeNode, 1);\n action = \"switch-active-node\";\n break;\n }\n }\n }\n if (action) {\n event.preventDefault();\n event.stopPropagation();\n return { action, node: node?.data, edge } as KeyboardAction;\n }\n}\n\nfunction moveOnAxis(\n axis: \"x\" | \"y\",\n renderedNodes: RenderedNode[],\n activeNode: RenderedNode,\n direction: 1 | -1\n) {\n const oppositeAxis = axis === \"x\" ? \"y\" : \"x\";\n let diff: number;\n const candidates = renderedNodes.filter(\n (node) =>\n node !== activeNode &&\n ((diff = (node[axis] - activeNode[axis]) * direction), diff > 0) &&\n diff > Math.abs(activeNode[oppositeAxis] - node[oppositeAxis])\n );\n return minBy(\n candidates,\n (node) =>\n (activeNode[oppositeAxis] - node[oppositeAxis]) ** 2 +\n (activeNode[axis] - node[axis]) ** 2\n );\n}\n","import type {\n LineMaskRects,\n RefRepository,\n RenderedLineLabel,\n} from \"../interfaces\";\n\nexport function getLineMaskRects(\n renderedLineLabels: RenderedLineLabel[],\n lineLabelsRefRepository: RefRepository\n) {\n const map: LineMaskRects = new Map();\n\n for (const { id, lineId, placement } of renderedLineLabels) {\n if (!lineLabelsRefRepository || placement !== \"center\") {\n continue;\n }\n const element = lineLabelsRefRepository.get(id);\n if (!element) {\n continue;\n }\n const { offsetWidth, offsetHeight } = element;\n // Do not mask out when the label takes no space.\n // istanbul ignore next\n if (\n process.env.NODE_ENV !== \"test\" &&\n (offsetWidth === 0 || offsetHeight === 0)\n ) {\n continue;\n }\n const padding = 3;\n // Currently no other rects\n map.set(lineId, [\n {\n left: element.offsetLeft - offsetWidth / 2 - padding,\n top: element.offsetTop - offsetHeight / 2 - padding,\n width: offsetWidth + padding * 2,\n height: offsetHeight + padding * 2,\n },\n ]);\n }\n\n return map;\n}\n","import React from \"react\";\nimport classNames from \"classnames\";\nimport type { ConnectLineState, PositionTuple } from \"./interfaces\";\nimport { MarkerComponent } from \"./MarkerComponent\";\n\nexport interface ConnectLineComponentProps {\n connectLineState: ConnectLineState | null;\n connectLineTo: PositionTuple;\n markerPrefix: string;\n}\n\nexport function ConnectLineComponent({\n connectLineState,\n connectLineTo,\n markerPrefix,\n}: ConnectLineComponentProps): JSX.Element {\n return (\n <svg\n width=\"100%\"\n height=\"100%\"\n className={classNames(\"connect-line\", {\n connecting:\n !!connectLineState &&\n // Do not show when the distance of mouse move is less than 5px\n (connectLineTo[0] - connectLineState.from[0]) ** 2 +\n (connectLineTo[1] - connectLineState.from[1]) ** 2 >\n 25,\n })}\n >\n <defs>\n <MarkerComponent\n type=\"arrow\"\n id={`${markerPrefix}connect-line`}\n strokeColor={connectLineState?.options.strokeColor}\n />\n </defs>\n <path\n d={\n connectLineState\n ? `M${connectLineState.from.join(\" \")}L${connectLineTo.join(\" \")}`\n : \"\"\n }\n fill=\"none\"\n stroke={connectLineState?.options.strokeColor}\n strokeWidth={connectLineState?.options.strokeWidth}\n markerEnd={\n connectLineState?.options.arrow\n ? `url(#${markerPrefix}connect-line)`\n : undefined\n }\n />\n </svg>\n );\n}\n","import _asyncToGenerator from \"@babel/runtime/helpers/asyncToGenerator\";\nimport { http } from \"@next-core/http\";\n/**\n * @description 搜索实例V3 (支持多属性排序)\n * @endpoint POST /v3/object/:objectId/instance/_search\n */\nexport var InstanceApi_postSearchV3 = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator(function* (objectId, data, options) {\n return (/**! @contract easyops.api.cmdb.instance.PostSearchV3@1.1.0 */(yield http.post(\"api/gateway/cmdb.instance.PostSearchV3/v3/object/\".concat(objectId, \"/instance/_search\"), data, options)).data\n );\n });\n return function InstanceApi_postSearchV3(_x, _x2, _x3) {\n return _ref.apply(this, arguments);\n };\n}();\n//# sourceMappingURL=postSearchV3.js.map","import _asyncToGenerator from \"@babel/runtime/helpers/asyncToGenerator\";\nimport { http } from \"@next-core/http\";\n\n/** 要更新的实例 */\n\n/**\n * @description 更新实例V2 (支持关系更新)\n * @endpoint PUT /v2/object/:objectId/instance/:instanceId\n */\nexport var InstanceApi_updateInstanceV2 = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator(function* (objectId, instanceId, data, options) {\n return (/**! @contract easyops.api.cmdb.instance.UpdateInstanceV2@1.0.0 */(yield http.put(\"api/gateway/cmdb.instance.UpdateInstanceV2/v2/object/\".concat(objectId, \"/instance/\").concat(instanceId), data, options)).data\n );\n });\n return function InstanceApi_updateInstanceV2(_x, _x2, _x3, _x4) {\n return _ref.apply(this, arguments);\n };\n}();\n//# sourceMappingURL=updateInstanceV2.js.map","import _asyncToGenerator from \"@babel/runtime/helpers/asyncToGenerator\";\nimport { http } from \"@next-core/http\";\n\n/** 创建实例 */\n\n/**\n * @description 创建实例 (body为实例信息,字段限制参考模型定义,支持关系创建)\n * @endpoint POST /v2/object/:objectId/instance\n */\nexport var InstanceApi_createInstance = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator(function* (objectId, data, options) {\n return (/**! @contract easyops.api.cmdb.instance.CreateInstance@1.1.0 */(yield http.post(\"api/gateway/cmdb.instance.CreateInstance/v2/object/\".concat(objectId, \"/instance\"), data, options)).data\n );\n });\n return function InstanceApi_createInstance(_x, _x2, _x3) {\n return _ref.apply(this, arguments);\n };\n}();\n//# sourceMappingURL=createInstance.js.map","import { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { handleHttpError } from \"@next-core/runtime\";\nimport {\n InstanceApi_postSearchV3,\n InstanceApi_updateInstanceV2,\n InstanceApi_createInstance,\n} from \"@next-api-sdk/cmdb-sdk\";\nimport { createAsyncQueue } from \"../processors/createAsyncQueue\";\nimport {\n NodeUserView,\n UserView,\n UserViewNodesMap,\n UserViewQuery,\n} from \"../interfaces\";\n\nconst USER_VIEW_MODEL_ID = \"GRAPH_USER_VIEW@EASYOPS\";\n\nexport interface UserViewHook {\n userViewReady: boolean;\n userViewNodesMap: UserViewNodesMap | null;\n saveUserView: (nodes: NodeUserView[]) => void;\n}\n\nexport function useUserView(query: UserViewQuery | undefined): UserViewHook {\n const [userViewReady, setUserViewReady] = useState(!query);\n const userViewIdRef = useRef<string>();\n const [userViewNodesMap, setUserViewNodesMap] =\n useState<UserViewNodesMap | null>(null);\n const queue = useMemo(() => createAsyncQueue(), []);\n\n useEffect(() => {\n async function getUserView(): Promise<void> {\n if (!query) {\n setUserViewReady(true);\n return;\n }\n const { namespace, key } = query;\n if (!(namespace && key)) {\n // eslint-disable-next-line no-console\n console.error(\"Namespace and key are required to save graph user view\");\n setUserViewReady(true);\n return;\n }\n try {\n const list = (\n await InstanceApi_postSearchV3(USER_VIEW_MODEL_ID, {\n fields: [\"nodes\"],\n query: {\n namespace: {\n $eq: namespace,\n },\n key: {\n $eq: key,\n },\n },\n page: 1,\n page_size: 30,\n })\n ).list as UserView[];\n if (list.length > 0) {\n const userView = list[0];\n const userViewNodesMap = new Map(\n userView.nodes?.map((node) => [node.id, node])\n );\n userViewIdRef.current = userView.instanceId;\n setUserViewNodesMap(userViewNodesMap);\n } else {\n setUserViewNodesMap(null);\n }\n } catch (error) {\n handleHttpError(error as Error);\n } finally {\n setUserViewReady(true);\n }\n }\n getUserView();\n }, [query]);\n\n const saveUserView = useCallback(\n (nodes: NodeUserView[]) => {\n const { namespace, key } = query ?? {};\n if (!(namespace && key)) {\n return;\n }\n queue(async () => {\n const userViewData = {\n namespace,\n key,\n nodes,\n };\n try {\n if (userViewIdRef.current) {\n await InstanceApi_updateInstanceV2(\n USER_VIEW_MODEL_ID,\n userViewIdRef.current,\n userViewData,\n {\n interceptorParams: {\n ignoreLoadingBar: true,\n },\n }\n );\n } else {\n const userView = await InstanceApi_createInstance(\n USER_VIEW_MODEL_ID,\n userViewData,\n {\n interceptorParams: {\n ignoreLoadingBar: true,\n },\n }\n );\n userViewIdRef.current = userView.instanceId;\n }\n } catch (error) {\n handleHttpError(error);\n }\n });\n },\n [query, queue]\n );\n\n return {\n userViewReady,\n userViewNodesMap,\n saveUserView,\n };\n}\n","type Task = (...args: unknown[]) => unknown;\ntype Queue = (task: Task) => Promise<void>;\n\nexport function createAsyncQueue(): Queue {\n let working = false;\n const waitingTasks: Task[] = [];\n return async function queue(task: Task) {\n waitingTasks.push(task);\n if (!working) {\n working = true;\n let nextTask: Task | undefined;\n while ((nextTask = waitingTasks.shift())) {\n try {\n await nextTask();\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(error);\n }\n }\n working = false;\n }\n };\n}\n","import type {\n LineLabelConf,\n RenderedLine,\n RenderedLineLabel,\n TextOptions,\n} from \"../interfaces\";\n\nexport function getRenderedLineLabels(\n previous: RenderedLineLabel[],\n renderedLines: RenderedLine[],\n linePaths: Map<string, SVGPathElement | null>\n) {\n if (previous.length === 0 && renderedLines.length === 0) {\n return previous;\n }\n return renderedLines.flatMap(\n ({ line: { text, label, $id }, edge, labelSize, angle }) => {\n const path = linePaths.get($id);\n if ((!text && !label) || !path || !path.getAttribute(\"d\")) {\n return [] as RenderedLineLabel[];\n }\n\n let key: \"label\" | \"text\";\n let list: LineLabelConf[] | TextOptions[];\n if (label) {\n key = \"label\";\n list = ([] as LineLabelConf[]).concat(label);\n } else {\n key = \"text\";\n list = ([] as TextOptions[]).concat(text!);\n }\n\n // istanbul ignore next\n const {\n x: left,\n y: top,\n width,\n height,\n } = process.env.NODE_ENV === \"test\"\n ? { x: 10, y: 20, width: 300, height: 400 }\n : path.getBBox();\n\n // istanbul ignore next\n const pathLength =\n process.env.NODE_ENV === \"test\" ? 50 : path.getTotalLength();\n\n return list.map<RenderedLineLabel>((item) => {\n const placement = item.placement ?? \"center\";\n const offset = 0;\n // istanbul ignore next\n const point =\n process.env.NODE_ENV === \"test\"\n ? { x: 50, y: 50 }\n : path.getPointAtLength(\n placement === \"start\"\n ? Math.min(offset, pathLength / 2)\n : placement === \"end\"\n ? Math.max(pathLength - offset, pathLength / 2)\n : pathLength / 2\n );\n\n return {\n [key as \"label\"]: item as LineLabelConf,\n edge,\n position: [point.x, point.y],\n lineRect: { left, top, width, height },\n id: `${$id}-${placement}`,\n lineId: $id,\n placement,\n angle,\n size: labelSize?.[placement],\n };\n });\n }\n );\n}\n","import type { FullRectTuple, RefRepository, RenderedNode } from \"../interfaces\";\n\nexport function adjustNodesSize(\n nodes: RenderedNode[],\n nodesRefRepository: RefRepository,\n nodePaddings: FullRectTuple\n) {\n for (const node of nodes) {\n const element = nodesRefRepository.get(node.id);\n node.width =\n Math.max(element?.offsetWidth ?? 0, 10) +\n nodePaddings[1] +\n nodePaddings[3];\n node.height =\n Math.max(element?.offsetHeight ?? 0, 10) +\n nodePaddings[0] +\n nodePaddings[2];\n }\n}\n","import type { FullRectTuple, RefRepository, RenderedNode } from \"../interfaces\";\n\nexport function adjustNodesPosition(\n nodes: RenderedNode[],\n nodesRefRepository: RefRepository,\n nodePaddings: FullRectTuple\n) {\n for (const node of nodes) {\n const x = node.x - node.width / 2 + nodePaddings[3];\n const y = node.y - node.height / 2 + nodePaddings[0];\n\n const nodeContainer = nodesRefRepository.get(node.id)?.parentElement;\n if (nodeContainer) {\n nodeContainer.style.left = `${x}px`;\n nodeContainer.style.top = `${y}px`;\n nodeContainer.style.visibility = \"visible\";\n }\n }\n}\n","// istanbul ignore file: experimental\nimport type {\n DiagramEdge,\n LabelSize,\n RefRepository,\n RenderedEdge,\n} from \"../interfaces\";\n\nexport function getRenderedEdges(\n edges: DiagramEdge[] | undefined,\n {\n normalizedLinesMap,\n lineLabelsRefRepository,\n }: {\n normalizedLinesMap: WeakMap<DiagramEdge, string>;\n lineLabelsRefRepository: RefRepository;\n }\n) {\n return (\n edges?.map<RenderedEdge>((edge) => {\n const lineId = normalizedLinesMap.get(edge);\n const labelSize: LabelSize = {};\n if (lineId) {\n for (const placement of [/* \"center\", */ \"start\", \"end\"] as const) {\n const element = lineLabelsRefRepository.get(`${lineId}-${placement}`);\n if (element) {\n labelSize[placement] = [element.offsetWidth, element.offsetHeight];\n }\n }\n }\n\n return {\n data: edge,\n labelSize,\n };\n }) ?? []\n );\n}\n","// istanbul ignore file: experimental\nimport {\n forceSimulation,\n forceLink,\n forceCollide,\n forceManyBody,\n forceX,\n forceY,\n type Simulation,\n type SimulationNodeDatum,\n type SimulationLinkDatum,\n} from \"d3-force\";\nimport { pick } from \"lodash\";\nimport type {\n DiagramEdge,\n DiagramNode,\n ForceCollideOptions,\n LayoutOptionsForce,\n RenderedNode,\n UnifiedGraph,\n UserViewNodesMap,\n} from \"../interfaces\";\nimport { adjustNodesSize } from \"./adjustNodesSize\";\nimport { adjustNodesPosition } from \"./adjustNodesPosition\";\nimport { extractPartialRectTuple } from \"./extractPartialRectTuple\";\nimport { getRenderedEdges } from \"./getRenderedEdges\";\n\ninterface NormalNode extends SimulationNodeDatum {\n dummy?: false;\n id: string;\n data: DiagramNode;\n width: number;\n height: number;\n}\n\ninterface DummyNode extends SimulationNodeDatum {\n dummy: true;\n id: string;\n}\n\ntype ForceNode = NormalNode | DummyNode;\n\ntype ForceLink = SimulationLinkDatum<ForceNode> & {\n dummy?: boolean;\n};\n\nexport function getForceGraph(\n previousGraph: UnifiedGraph | null,\n nodes: DiagramNode[] | undefined,\n edges: DiagramEdge[] | undefined,\n userViewNodesMap: UserViewNodesMap | null,\n forceLayoutOptions: LayoutOptionsForce | undefined\n): UnifiedGraph {\n const { nodePadding, dummyNodesOnEdges, collide } = {\n nodePadding: 0,\n dummyNodesOnEdges: 0,\n ...pick(forceLayoutOptions, [\"nodePadding\", \"dummyNodesOnEdges\"]),\n collide:\n forceLayoutOptions?.collide !== false\n ? ({\n dummyRadius: 1,\n radiusDiff: 5,\n strength: 1,\n iterations: 1,\n ...(forceLayoutOptions?.collide === true\n ? null\n : (forceLayoutOptions?.collide as ForceCollideOptions)),\n } as Required<ForceCollideOptions>)\n : (false as const),\n };\n const nodePaddings = extractPartialRectTuple(nodePadding);\n\n const renderedNodes: RenderedNode[] = [];\n for (const node of nodes ?? []) {\n const previousNode = previousGraph?.getNode(node.id);\n if (previousNode?.data === node) {\n renderedNodes.push(previousNode);\n } else {\n const renderedNode = {\n id: node.id,\n data: node,\n } as RenderedNode & { fx?: number; fy?: number };\n const userViewNode = userViewNodesMap?.get(node.id);\n if (userViewNode) {\n renderedNode.fx = userViewNode.x;\n renderedNode.fy = userViewNode.y;\n }\n renderedNodes.push(renderedNode);\n }\n }\n\n function getNode(id: string) {\n return renderedNodes.find((node) => node.data.id === id);\n }\n\n return {\n layout: \"force\",\n getNode,\n applyLayout({\n nodesRefRepository,\n lineLabelsRefRepository,\n normalizedLinesMap,\n }) {\n if (renderedNodes.length === 0) {\n return null;\n }\n\n adjustNodesSize(renderedNodes, nodesRefRepository, nodePaddings);\n\n const forceNodes = renderedNodes.slice();\n const forceLinks: ForceLink[] = [];\n\n for (const edge of edges ?? []) {\n forceLinks.push({ ...edge });\n if (dummyNodesOnEdges > 0) {\n forceNodes.push(\n ...(getDummyNodes(\n edge,\n dummyNodesOnEdges\n ) as Partial<RenderedNode>[] as RenderedNode[])\n );\n forceLinks.push(...getDummyEdges(edge, dummyNodesOnEdges));\n }\n }\n\n const linkSimulation = forceLink<ForceNode, ForceLink>(forceLinks).id(\n (d) => d.id\n );\n\n if (dummyNodesOnEdges > 0) {\n linkSimulation\n .distance((l) => (l.dummy ? 30 / (dummyNodesOnEdges + 1) : 30))\n .strength((l) => (l.dummy ? 0.5 : 1));\n }\n\n const simulation = forceSimulation<ForceNode>(forceNodes)\n .force(\"link\", linkSimulation)\n .force(\"x\", forceX())\n .force(\"y\", forceY())\n .force(\"charge\", forceManyBody());\n\n if (collide) {\n simulation.force(\n \"collide\",\n forceCollide<ForceNode>()\n .radius((d) =>\n d.dummy\n ? collide.dummyRadius\n : Math.sqrt(d.width ** 2 + d.height ** 2) / 2 +\n collide.radiusDiff\n )\n .strength(collide.strength)\n .iterations(collide.iterations)\n );\n }\n\n simulation.stop();\n manuallyTickToTheEnd(simulation);\n\n adjustNodesPosition(renderedNodes, nodesRefRepository, nodePaddings);\n\n const renderedEdges = getRenderedEdges(edges, {\n normalizedLinesMap,\n lineLabelsRefRepository,\n });\n\n return { nodes: renderedNodes, edges: renderedEdges };\n },\n };\n}\n\nfunction manuallyTickToTheEnd(\n simulation: Simulation<ForceNode, ForceLink>\n): void {\n // Manually tick to the end.\n simulation.tick(\n Math.ceil(\n Math.log(simulation.alphaMin()) / Math.log(1 - simulation.alphaDecay())\n )\n );\n}\n\nfunction getDummyNodes(edge: DiagramEdge, count: number): DummyNode[] {\n return new Array(count).fill(null).map<DummyNode>((v, i) => ({\n dummy: true,\n id: `$dummy-${edge.source}-${edge.target}-${i}`,\n }));\n}\n\nfunction getDummyEdges(edge: DiagramEdge, count: number): ForceLink[] {\n return new Array(count + 1).fill(null).map<ForceLink>((v, i) => ({\n dummy: true,\n source:\n i === 0 ? edge.source : `$dummy-${edge.source}-${edge.target}-${i - 1}`,\n target:\n i === count ? edge.target : `$dummy-${edge.source}-${edge.target}-${i}`,\n }));\n}\n","import { useEffect, useState } from \"react\";\nimport type {\n DiagramEdge,\n DiagramNode,\n LayoutOptions,\n LayoutOptionsDagre,\n LayoutOptionsForce,\n ManualLayoutStatus,\n NodeMovement,\n RefRepository,\n RenderedDiagram,\n UnifiedGraph,\n UserViewNodesMap,\n} from \"../interfaces\";\nimport { getDagreGraph } from \"../processors/getDagreGraph\";\nimport { getForceGraph } from \"../processors/getForceGraph\";\nimport { getManualGraph } from \"../processors/getManualGraph\";\n\nexport function useRenderedDiagram({\n layout: originalLayout,\n nodes,\n edges,\n manualLayoutStatus,\n userViewReady,\n userViewNodesMap,\n nodeMovement,\n nodesRefRepository,\n lineLabelsRefRepository,\n normalizedLinesMap,\n nodesRenderId,\n lineLabelsRenderId,\n layoutOptions,\n}: {\n layout: \"dagre\" | \"force\" | undefined;\n nodes: DiagramNode[] | undefined;\n edges: DiagramEdge[] | undefined;\n manualLayoutStatus: ManualLayoutStatus;\n userViewReady: boolean;\n userViewNodesMap: UserViewNodesMap | null;\n nodeMovement: NodeMovement | null;\n nodesRefRepository: RefRepository | null;\n lineLabelsRefRepository: RefRepository | null;\n normalizedLinesMap: WeakMap<DiagramEdge, string>;\n nodesRenderId: number;\n lineLabelsRenderId: number;\n layoutOptions?: LayoutOptions;\n}) {\n const layout = manualLayoutStatus === \"initial\" ? originalLayout : \"manual\";\n const [graph, setGraph] = useState<UnifiedGraph | null>(null);\n\n const [renderedDiagram, setRenderedDiagram] = useState<RenderedDiagram>({\n nodes: [],\n edges: [],\n });\n\n useEffect(() => {\n if (!userViewReady) {\n return;\n }\n setGraph((previousGraph) =>\n layout === \"dagre\"\n ? getDagreGraph(\n previousGraph,\n nodes,\n edges,\n layoutOptions as LayoutOptionsDagre\n )\n : layout === \"force\"\n ? getForceGraph(\n previousGraph,\n nodes,\n edges,\n userViewNodesMap,\n layoutOptions as LayoutOptionsForce\n )\n : layout === \"manual\"\n ? getManualGraph(previousGraph, nodes, edges, layoutOptions)\n : null\n );\n }, [edges, nodes, layout, layoutOptions, userViewReady, userViewNodesMap]);\n\n useEffect(() => {\n if (\n !nodesRefRepository ||\n !lineLabelsRefRepository ||\n layout !== graph?.layout\n ) {\n return;\n }\n const renderedDiagram = graph?.applyLayout({\n manualLayoutStatus,\n nodesRefRepository,\n lineLabelsRefRepository,\n normalizedLinesMap,\n nodeMovement,\n });\n if (renderedDiagram) {\n setRenderedDiagram(renderedDiagram);\n }\n }, [\n layout,\n manualLayoutStatus,\n graph,\n nodeMovement,\n nodesRefRepository,\n lineLabelsRefRepository,\n nodesRenderId,\n lineLabelsRenderId,\n normalizedLinesMap,\n ]);\n\n return renderedDiagram;\n}\n","import dagre from \"@dagrejs/dagre\";\nimport { pick } from \"lodash\";\nimport type {\n DiagramEdge,\n DiagramNode,\n LayoutOptionsDagre,\n RenderedEdge,\n RenderedNode,\n UnifiedGraph,\n} from \"../interfaces\";\nimport { adjustNodesSize } from \"./adjustNodesSize\";\nimport { adjustNodesPosition } from \"./adjustNodesPosition\";\nimport { extractPartialRectTuple } from \"./extractPartialRectTuple\";\n\nexport function getDagreGraph(\n previousGraph: UnifiedGraph | null,\n nodes: DiagramNode[] | undefined,\n edges: DiagramEdge[] | undefined,\n dagreLayoutOptions: LayoutOptionsDagre | undefined\n): UnifiedGraph {\n const { nodePadding, ...dagreGraphOptions } = {\n nodePadding: 0,\n rankdir: \"TB\",\n ranksep: 50,\n edgesep: 10,\n nodesep: 50,\n // align: undefined,\n ...pick(dagreLayoutOptions, [\n \"nodePadding\",\n \"rankdir\",\n \"ranksep\",\n \"edgesep\",\n \"nodesep\",\n \"align\",\n ]),\n };\n const nodePaddings = extractPartialRectTuple(nodePadding);\n\n // Create a new directed graph\n const graph = new dagre.graphlib.Graph<RenderedNode>();\n\n // Set an object for the graph label\n graph.setGraph(dagreGraphOptions);\n\n // Default to assigning a new object as a label for each new edge.\n graph.setDefaultEdgeLabel(function () {\n return {};\n });\n\n for (const node of nodes ?? []) {\n const previousNode = previousGraph?.getNode(node.id);\n graph.setNode(\n node.id,\n previousNode?.data === node\n ? previousNode\n : {\n id: node.id,\n data: node,\n }\n );\n }\n\n for (const edge of edges ?? []) {\n graph.setEdge(edge.source, edge.target, { data: edge });\n }\n\n return {\n layout: \"dagre\",\n getNode(id) {\n return graph.node(id);\n },\n applyLayout({\n nodesRefRepository,\n lineLabelsRefRepository,\n normalizedLinesMap,\n }) {\n const renderedNodes: RenderedNode[] = [];\n for (const id of graph.nodes()) {\n const node = graph.node(id);\n if (node) {\n renderedNodes.push(node);\n } else {\n // eslint-disable-next-line no-console\n console.error(\"Diagram node not found: %s\", id);\n }\n }\n\n if (renderedNodes.length === 0) {\n return null;\n }\n\n adjustNodesSize(renderedNodes, nodesRefRepository, nodePaddings);\n\n const renderedEdges = graph\n .edges()\n .map((e) => graph.edge(e) as RenderedEdge);\n for (const edge of renderedEdges) {\n const lineId = normalizedLinesMap.get(edge.data);\n if (lineId) {\n for (const placement of [\"center\", \"start\", \"end\"] as const) {\n const element = lineLabelsRefRepository.get(\n `${lineId}-${placement}`\n );\n if (element) {\n const { offsetWidth, offsetHeight } = element;\n if (placement === \"center\") {\n edge.labelpos = \"c\";\n edge.width = offsetWidth;\n edge.height = offsetHeight;\n }\n edge.labelSize ??= {};\n edge.labelSize[placement] = [offsetWidth, offsetHeight];\n }\n }\n }\n }\n dagre.layout(graph);\n\n adjustNodesPosition(renderedNodes, nodesRefRepository, nodePaddings);\n\n return {\n nodes: renderedNodes,\n edges: renderedEdges,\n };\n },\n };\n}\n","// istanbul ignore file: experimental\nimport { pick } from \"lodash\";\nimport type {\n DiagramEdge,\n DiagramNode,\n BaseLayoutOptions,\n RenderedNode,\n UnifiedGraph,\n} from \"../interfaces\";\nimport { extractPartialRectTuple } from \"./extractPartialRectTuple\";\nimport { adjustNodesSize } from \"./adjustNodesSize\";\nimport { adjustNodesPosition } from \"./adjustNodesPosition\";\nimport { getRenderedEdges } from \"./getRenderedEdges\";\n\nexport function getManualGraph(\n previousGraph: UnifiedGraph | null,\n nodes: DiagramNode[] | undefined,\n edges: DiagramEdge[] | undefined,\n layoutOptions: BaseLayoutOptions | undefined\n): UnifiedGraph {\n const { nodePadding } = {\n nodePadding: 0,\n ...pick(layoutOptions, [\"nodePadding\"]),\n };\n const nodePaddings = extractPartialRectTuple(nodePadding);\n\n const renderedNodes: RenderedNode[] = [];\n for (const node of nodes ?? []) {\n const previousNode = previousGraph?.getNode(node.id);\n if (previousNode?.data === node) {\n renderedNodes.push(previousNode);\n previousNode.x0 = previousNode.x;\n previousNode.y0 = previousNode.y;\n } else {\n renderedNodes.push({\n id: node.id,\n data: node,\n } as RenderedNode);\n }\n }\n\n function getNode(id: string) {\n return renderedNodes.find((node) => node.data.id === id);\n }\n\n let movedNode: RenderedNode | undefined;\n\n return {\n layout: \"manual\",\n getNode,\n applyLayout({\n manualLayoutStatus,\n nodesRefRepository,\n lineLabelsRefRepository,\n normalizedLinesMap,\n nodeMovement,\n }) {\n if (renderedNodes.length === 0) {\n return null;\n }\n\n adjustNodesSize(renderedNodes, nodesRefRepository, nodePaddings);\n\n if (nodeMovement) {\n movedNode = renderedNodes.find((node) => node.id === nodeMovement.id);\n if (movedNode) {\n movedNode.x = (movedNode.x0 ?? 0) + nodeMovement.move[0];\n movedNode.y = (movedNode.y0 ?? 0) + nodeMovement.move[1];\n }\n }\n\n if (manualLayoutStatus === \"finished\" && movedNode) {\n // Set x0/y0 after finished manual layout\n movedNode.x0 = movedNode.x;\n movedNode.y0 = movedNode.y;\n }\n\n adjustNodesPosition(renderedNodes, nodesRefRepository, nodePaddings);\n\n const renderedEdges = getRenderedEdges(edges, {\n normalizedLinesMap,\n lineLabelsRefRepository,\n });\n\n return { nodes: renderedNodes, edges: renderedEdges };\n },\n };\n}\n","import type { RenderedNode, TransformLiteral } from \"../interfaces\";\n\nexport interface TransformToCenterOptions {\n canvasWidth: number;\n canvasHeight: number;\n scaleRange?: [min: number, max: number];\n}\n\nexport function transformToCenter(\n renderedNodes: RenderedNode[],\n { canvasWidth, canvasHeight, scaleRange }: TransformToCenterOptions\n): TransformLiteral {\n let left = Infinity;\n let top = Infinity;\n let right = -Infinity;\n let bottom = -Infinity;\n for (const node of renderedNodes) {\n const hw = node.width / 2;\n const hh = node.height / 2;\n const l = node.x - hw;\n const r = node.x + hw;\n const t = node.y - hh;\n const b = node.y + hh;\n if (l < left) {\n left = l;\n }\n if (r > right) {\n right = r;\n }\n if (t < top) {\n top = t;\n }\n if (b > bottom) {\n bottom = b;\n }\n }\n\n const width = right - left;\n const height = bottom - top;\n\n const scale =\n scaleRange && (width > canvasWidth || height > canvasHeight)\n ? Math.max(\n Math.min(canvasWidth / width, canvasHeight / height, scaleRange[1]),\n scaleRange[0]\n )\n : 1;\n\n const x = (canvasWidth - width * scale) / 2 - left * scale;\n const y = (canvasHeight - height * scale) / 2 - top * scale;\n\n return { x, y, k: scale };\n}\n","export const DEFAULT_LINE_STROKE_COLOR = \"var(--palette-gray-5)\";\nexport const DEFAULT_LINE_STROKE_WIDTH = 1;\nexport const DEFAULT_LINE_CURVE_TYPE = \"curveBasis\";\nexport const DEFAULT_LINE_INTERACT_STROKE_WIDTH = 20;\nexport const DEFAULT_SCALE_RANGE_MIN = 0.5;\nexport const DEFAULT_SCALE_RANGE_MAX = 2;\n","import React, { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { ReactUseBrick } from \"@next-core/react-runtime\";\nimport type {\n DiagramNode,\n DiagramNodeId,\n NodeBrickConf,\n RefRepository,\n} from \"./interfaces\";\nimport { findNodeBrick } from \"./processors/findNodeBrick\";\n\nexport interface NodeComponentGroupProps {\n nodes?: DiagramNode[];\n nodeBricks?: NodeBrickConf[];\n onRendered?: (refRepository: RefRepository | null) => void;\n}\n\nexport function NodeComponentGroup({\n nodes,\n nodeBricks,\n onRendered,\n}: NodeComponentGroupProps): JSX.Element {\n const [rendered, setRendered] = useState(false);\n const [renderedIds, setRenderedIds] = useState<DiagramNodeId[]>([]);\n const refRepository = useMemo<RefRepository>(() => new Map(), []);\n\n const handleRenderer = useCallback(\n (id: DiagramNodeId, element: HTMLElement | null) => {\n if (element) {\n refRepository.set(id, element);\n }\n setRenderedIds((previous) =>\n previous.includes(id) ? previous : previous.concat(id)\n );\n },\n [refRepository]\n );\n\n const handleUnmount = useCallback(\n (id: DiagramNodeId) => {\n setRenderedIds((previous) => {\n const index = previous.indexOf(id);\n return index === -1\n ? previous\n : previous.slice(0, index).concat(previous.slice(index + 1));\n });\n refRepository.delete(id);\n },\n [refRepository]\n );\n\n useEffect(() => {\n // All nodes have been rendered.\n setRendered(!nodes?.some((node) => !renderedIds.includes(node.id)));\n }, [nodes, renderedIds]);\n\n useEffect(\n () => {\n onRendered?.(rendered ? refRepository : null);\n },\n // Dot not re-run effect when `onRendered` changed.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [/* onRendered, */ refRepository, rendered]\n );\n\n return (\n <React.Fragment>\n {nodes?.map((node) => (\n <div key={node.id} className=\"node\">\n <NodeComponent\n nodeBricks={nodeBricks}\n node={node}\n onRendered={handleRenderer}\n onUnmount={handleUnmount}\n />\n </div>\n ))}\n </React.Fragment>\n );\n}\n\nexport interface NodeComponentProps {\n node: DiagramNode;\n nodeBricks?: NodeBrickConf[];\n onRendered?: (id: DiagramNodeId, element: HTMLElement | null) => void;\n onUnmount?: (id: DiagramNodeId) => void;\n}\n\nexport function NodeComponent({\n node,\n nodeBricks,\n onRendered,\n onUnmount,\n}: NodeComponentProps): JSX.Element | null {\n const useBrick = useMemo(\n () => findNodeBrick(node, nodeBricks)?.useBrick,\n [node, nodeBricks]\n );\n const memoizedData = useMemo(() => ({ node }), [node]);\n\n useEffect(() => {\n if (!useBrick) {\n // Keep the same time delay for reporting rendered.\n setTimeout(() => {\n onRendered?.(node.id, null);\n });\n }\n }, [node.id, onRendered, useBrick]);\n\n useEffect(\n () => {\n return () => {\n onUnmount?.(node.id);\n };\n },\n // Only unmount once\n // eslint-disable-next-line react-hooks/exhaustive-deps\n []\n );\n\n const refCallback = useCallback(\n (element: HTMLElement | null) => {\n if (element) {\n // Todo: correctly wait for `useBrick` in v3 to be rendered (after layout)\n // Wait a macro task to let `useBrick` to be rendered.\n setTimeout(() => {\n onRendered?.(node.id, element);\n });\n }\n },\n [node.id, onRendered]\n );\n\n const ignoredCallback = useCallback(() => {\n setTimeout(() => {\n onRendered?.(node.id, null);\n });\n }, [node.id, onRendered]);\n\n if (!useBrick) {\n return null;\n }\n\n return (\n <ReactUseBrick\n refCallback={refCallback}\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore For v3 only\n ignoredCallback={ignoredCallback}\n useBrick={useBrick}\n data={memoizedData}\n />\n );\n}\n","import { checkIfByTransform } from \"@next-core/runtime\";\nimport { NodeBrickConf, DiagramNode } from \"../interfaces\";\n\nexport function findNodeBrick(\n node: DiagramNode,\n nodeBricks: NodeBrickConf[] | undefined\n): NodeBrickConf | undefined {\n return nodeBricks?.find((item) => {\n if (item.nodeType) {\n return ([] as unknown[]).concat(item.nodeType).includes(node.type);\n }\n return checkIfByTransform(item, { node });\n });\n}\n","import { checkIfByTransform } from \"@next-core/runtime\";\nimport type { DiagramEdge, LineConf } from \"../interfaces\";\n\nexport function matchEdgeByFilter(\n edge: DiagramEdge,\n filter: LineConf\n): boolean {\n if (!filter) {\n return false;\n }\n if (filter.edgeType) {\n return ([] as string[]).concat(filter.edgeType).includes(edge.type!);\n }\n return checkIfByTransform(filter, { edge });\n}\n","import { findIndex, uniqueId } from \"lodash\";\nimport { __secret_internals } from \"@next-core/runtime\";\nimport type {\n DiagramEdge,\n LineConf,\n LineMarker,\n LineMarkerConf,\n LineMarkerType,\n NormalizedLine,\n NormalizedLineMarker,\n} from \"../interfaces\";\nimport { matchEdgeByFilter } from \"./matchEdgeByFilter\";\nimport {\n DEFAULT_LINE_CURVE_TYPE,\n DEFAULT_LINE_INTERACT_STROKE_WIDTH,\n DEFAULT_LINE_STROKE_COLOR,\n DEFAULT_LINE_STROKE_WIDTH,\n} from \"../constants\";\n\nexport function normalizeLinesAndMarkers(\n edges: DiagramEdge[] | undefined,\n lines: LineConf[] | undefined\n) {\n const normalizedLines: NormalizedLine[] = [];\n const normalizedLinesMap = new WeakMap<DiagramEdge, string>();\n const markers: LineMarker[] = [];\n for (const edge of edges ?? []) {\n const { label, ...restLineConf } =\n lines?.find((line) => matchEdgeByFilter(edge, line)) ?? {};\n\n const computedLineConf = __secret_internals.legacyDoTransform(\n { edge },\n restLineConf\n ) as LineConf | undefined;\n if (computedLineConf?.draw === false) {\n continue;\n }\n const id = uniqueId(\"line-\");\n const line: NormalizedLine[\"line\"] = {\n strokeColor: DEFAULT_LINE_STROKE_COLOR,\n strokeWidth: DEFAULT_LINE_STROKE_WIDTH,\n curveType:\n computedLineConf?.type === \"polyline\"\n ? \"curveLinear\"\n : DEFAULT_LINE_CURVE_TYPE,\n interactStrokeWidth: DEFAULT_LINE_INTERACT_STROKE_WIDTH,\n type: \"auto\",\n ...computedLineConf,\n label,\n $id: id,\n };\n normalizedLinesMap.set(edge, id);\n\n const normalizedMarkers: NormalizedLineMarker[] = [];\n\n const lineMarkers: LineMarkerConf[] =\n line.markers ?? (line.arrow ? [{ placement: \"end\", type: \"arrow\" }] : []);\n for (const marker of lineMarkers) {\n const { placement: _placement, type: _type } = marker;\n const placement = _placement ?? \"end\";\n\n let type: LineMarkerType;\n let offsetUnit: number;\n\n switch (_type) {\n case \"0..1\":\n case \"0..N\":\n offsetUnit = 21;\n type = _type;\n break;\n default:\n offsetUnit = 1;\n type = \"arrow\";\n }\n const offset = offsetUnit * line.strokeWidth;\n\n const index = addMarker({ type, strokeColor: line.strokeColor }, markers);\n normalizedMarkers.push({\n index,\n placement,\n type,\n variant: \"default\",\n offset,\n });\n\n const activeStrokeColor =\n line.overrides?.active?.strokeColor ?? line.strokeColor;\n const activeMarkerIndex = addMarker(\n { type, strokeColor: activeStrokeColor },\n markers\n );\n normalizedMarkers.push({\n index: activeMarkerIndex,\n placement,\n type,\n variant: \"active\",\n offset,\n });\n const activeRelatedStrokeColor =\n line.overrides?.activeRelated?.strokeColor ?? line.strokeColor;\n const activeRelatedMarkerIndex = addMarker(\n { type, strokeColor: activeRelatedStrokeColor },\n markers\n );\n normalizedMarkers.push({\n index: activeRelatedMarkerIndex,\n placement,\n type,\n variant: \"active-related\",\n offset,\n });\n }\n\n normalizedLines.push({\n line,\n markers: normalizedMarkers,\n edge,\n });\n }\n return {\n normalizedLines,\n normalizedLinesMap,\n markers,\n };\n}\n\nfunction addMarker(marker: LineMarker, markers: LineMarker[]): number {\n let markerIndex = findIndex(markers, marker);\n if (markerIndex === -1) {\n markerIndex = markers.push(marker) - 1;\n }\n return markerIndex;\n}\n","import React from \"react\";\nimport type { RenderedLineLabel, SimpleRect } from \"./interfaces\";\n\nexport interface LineMaskComponentProps {\n maskPrefix: string;\n lineId: string;\n rects: SimpleRect[];\n renderedLineLabels: RenderedLineLabel[];\n}\n\nexport function LineMaskComponent({\n lineId,\n rects,\n maskPrefix,\n renderedLineLabels,\n}: LineMaskComponentProps): JSX.Element | null {\n const lineText = renderedLineLabels.find(\n (item) => item.lineId === lineId && item.placement === \"center\"\n );\n // istanbul ignore next\n if (!lineText) {\n return null;\n }\n const { lineRect } = lineText;\n const bgRect = getRectWithPadding(lineRect, 1000);\n return (\n <mask\n id={`${maskPrefix}${lineId}`}\n x={bgRect.left}\n y={bgRect.top}\n width={bgRect.width}\n height={bgRect.height}\n >\n <rect\n x={bgRect.left}\n y={bgRect.top}\n width={bgRect.width}\n height={bgRect.height}\n // Everything under a white pixel will be visible\n fill=\"white\"\n />\n {rects.map((rect, index) => (\n <rect\n key={index}\n x={rect.left}\n y={rect.top}\n width={rect.width}\n height={rect.height}\n // Everything under a black pixel will be invisible\n fill=\"black\"\n />\n ))}\n </mask>\n );\n}\n\nfunction getRectWithPadding(rect: SimpleRect, padding: number): SimpleRect {\n return {\n left: rect.left - padding,\n top: rect.top - padding,\n width: rect.width + padding * 2,\n height: rect.height + padding * 2,\n };\n}\n"],"names":["___CSS_LOADER_EXPORT___","push","module","id","toString","adjustLineLabels","renderedLineLabels","lineLabelsRefRepository","position","placement","angle","size","_size","label","get","style","left","top","visibility","undefined","width","height","tempDirection","Math","floor","PI","direction","tangent","tan","offsetAngle","offset","offsetSin","sin","offsetCos","cos","transform","getRenderedLines","renderedEdges","renderedNodes","normalizedLines","renderedEdgeMap","WeakMap","renderedNodeMap","Map","relatedNodes","renderedNode","set","renderedEdge","data","edge","prepared","map","_ref","_markers$find$offset","_markers$find","_markers$find$offset2","_markers$find2","line","markers","rest","startMarkerOffset","find","marker","variant","endMarkerOffset","points","source","target","type","doTwoNodesOverlap","_relatedNodes$get","_relatedNodes$get2","prepareRelatedNodes","addRelatedNodes","from","to","relates","Set","toNode","add","sourceDirection","getDirection","targetDirection","sourceRelates","getOrderedRelates","targetRelates","sourcePosition","indexOf","length","targetPosition","getPolyLinePoints","getDirectLinePoints","start","end","atan2","y","x","d","curveLine","curveType","labelSize","filter","Boolean","padding","sourceAngle","sx","sy","tx","ty","fixedAngle","node","sort","a","b","ax","ay","bx","by","LineComponent","_line$overrides","_line$overrides2","linePaths","lineMaskRects","maskPrefix","markerPrefix","activeLineMarkerPrefix","active","activeRelated","onLineClick","onLineDoubleClick","mask","has","$id","strokeColor","strokeWidth","interactStrokeWidth","overrides","expectVariant","markerStart","markerEnd","index","React","className","classNames","interactable","onClick","onDoubleClick","e","preventDefault","stopPropagation","cursor","fill","stroke","ref","element","handleNodesMouseDown","event","nodes","nodesRefRepository","connectNodes","dragNodes","scale","setConnectLineState","setConnectLineTo","setManualLayoutStatus","setNodeMovement","onSwitchActiveTarget","onNodesConnect","findNode","match","contains","options","sourceType","concat","includes","checkIfByTransform","nodeMatched","clientX","clientY","DEFAULT_LINE_STROKE_COLOR","DEFAULT_LINE_STROKE_WIDTH","__secret_internals","legacyDoTransform","nodeId","onMouseMove","onMouseUp","document","removeEventListener","eventTargets","composedPath","addEventListener","moved","movement","move","LineLabelComponentGroup","labels","onRendered","rendered","setRendered","useState","renderedIds","setRenderedIds","refRepository","useMemo","handleRenderer","useCallback","previous","handleUnmount","slice","delete","useEffect","some","_ref2","text","key","LineLabelComponent","onUnmount","LineTextComponent","_ref3","refCallback","content","_ref4","useBrick","memoizedData","setTimeout","parentElement","ignoredCallback","ReactUseBrick","sameTarget","handleKeyboard","activeTarget","activeNode","activeEdge","keyCode","which","action","moveOnAxis","_node","axis","oppositeAxis","diff","candidates","abs","minBy","getLineMaskRects","lineId","offsetWidth","offsetHeight","offsetLeft","offsetTop","ConnectLineComponent","connectLineState","connectLineTo","connecting","MarkerComponent","join","arrow","InstanceApi_postSearchV3","objectId","http","post","_x","_x2","_x3","apply","this","arguments","InstanceApi_updateInstanceV2","instanceId","put","_x4","InstanceApi_createInstance","USER_VIEW_MODEL_ID","useUserView","query","userViewReady","setUserViewReady","userViewIdRef","useRef","userViewNodesMap","setUserViewNodesMap","queue","working","waitingTasks","async","task","nextTask","shift","error","console","createAsyncQueue","namespace","list","fields","$eq","page","page_size","_userView$nodes","userView","current","handleHttpError","getUserView","saveUserView","userViewData","interceptorParams","ignoreLoadingBar","getRenderedLineLabels","renderedLines","flatMap","path","getAttribute","getBBox","pathLength","getTotalLength","item","_item$placement","point","getPointAtLength","min","max","lineRect","adjustNodesSize","nodePaddings","_element$offsetWidth","_element$offsetHeight","adjustNodesPosition","_nodesRefRepository$g","nodeContainer","getRenderedEdges","edges","_edges$map","normalizedLinesMap","getDummyNodes","count","Array","v","i","dummy","getDummyEdges","useRenderedDiagram","layout","originalLayout","manualLayoutStatus","nodeMovement","nodesRenderId","lineLabelsRenderId","layoutOptions","graph","setGraph","renderedDiagram","setRenderedDiagram","previousGraph","dagreLayoutOptions","nodePadding","dagreGraphOptions","rankdir","ranksep","edgesep","nodesep","pick","extractPartialRectTuple","dagre","Graph","setDefaultEdgeLabel","previousNode","getNode","setNode","setEdge","applyLayout","_edge$labelSize","labelpos","getDagreGraph","forceLayoutOptions","dummyNodesOnEdges","collide","dummyRadius","radiusDiff","strength","iterations","userViewNode","fx","fy","forceNodes","forceLinks","linkSimulation","forceLink","distance","l","simulation","forceSimulation","force","forceX","forceY","forceManyBody","forceCollide","radius","sqrt","stop","tick","ceil","log","alphaMin","alphaDecay","manuallyTickToTheEnd","getForceGraph","x0","y0","movedNode","_movedNode$x","_movedNode$y","getManualGraph","transformToCenter","canvasWidth","canvasHeight","scaleRange","Infinity","right","bottom","hw","hh","r","t","k","DEFAULT_LINE_CURVE_TYPE","DEFAULT_LINE_INTERACT_STROKE_WIDTH","DEFAULT_SCALE_RANGE_MIN","DEFAULT_SCALE_RANGE_MAX","NodeComponentGroup","nodeBricks","NodeComponent","_findNodeBrick","nodeType","findNodeBrick","matchEdgeByFilter","edgeType","normalizeLinesAndMarkers","lines","_lines$find","_line$markers","restLineConf","computedLineConf","draw","uniqueId","normalizedMarkers","lineMarkers","_line$overrides$activ","_line$overrides$activ2","_placement","_type","offsetUnit","addMarker","activeMarkerIndex","activeRelatedMarkerIndex","markerIndex","findIndex","LineMaskComponent","rects","lineText","bgRect","rect"],"sourceRoot":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_next_bricks_diagram=globalThis.webpackChunk_next_bricks_diagram||[]).push([[551],{227:(e,t,n)=>{n.d(t,{Y:()=>r});var o=n(4197);function r(e,t,n,r){const i=[];if(t){const n=new Set;for(const o of e)"edge"===o.type&&o.source===t.source.id&&n.add(o.target);for(const t of e)switch(t.type){case"node":n.has(t.id)&&i.push(t);break;case"decorator":r&&"text"!=t.decorator&&!n.has(t.id)||i.push(t);break;default:i.push(t)}}else switch(null==n?void 0:n.type){case"multi":{const t=new Map,r=new Set,l=new Set;for(const e of n.targets)"node"===e.type&&(r.add(e.id),l.add(e.id));for(const a of e)"node"===a.type?t.set(a.id,a):"edge"===a.type?r.has(a.source)?l.add(a.target):r.has(a.target)?l.add(a.source):(0,o.Q)(a,n)||i.push(a):(0,o.Q)(a,n)||i.push(a);for(const[e,n]of t)l.has(e)||i.push(n);break}case"node":{const t=new Map,o=new Set([n.id]);for(const r of e)"node"===r.type?t.set(r.id,r):"edge"===r.type?r.source===n.id?o.add(r.target):r.target===n.id?o.add(r.source):i.push(r):i.push(r);for(const[e,n]of t)o.has(e)||i.push(n);break}case"edge":for(const t of e)("edge"===t.type?(0,o.Q)(t,n):"node"===t.type&&(t.id===n.source||t.id===n.target))||i.push(t)}return i}},531:(e,t,n)=>{n.d(t,{N:()=>r,OD:()=>f,VF:()=>g,WW:()=>a,_m:()=>h,bo:()=>d,dS:()=>v,jw:()=>m,kN:()=>p,mH:()=>i,nv:()=>c,o6:()=>s,om:()=>y,t2:()=>u,vC:()=>l});var o=n(1030);function r(e){return"node"===e.type}function i(e){return"decorator"===e.type}function l(e){return"node"===e.type}function a(e){return"edge"===e.type}function c(e){return"node"===e.type||"edge"===e.type}function s(e){return"node"===e.type||"decorator"===e.type&&"area"===e.decorator}function d(e,t){return"node"===e.type||!!t&&"decorator"===e.type&&"area"===e.decorator}function u(e){return"decorator"===e.type&&"container"===e.decorator}function v(e){return"decorator"===e.type&&"group"===e.decorator}function h(e){return"decorator"===e.type&&"line"===e.decorator}function f(e){return!["manual",void 0].includes(e)}function g(e){return!(null!=e&&e.width&&null!=e&&e.height)}function p(e){return(0,o.isNil)(null==e?void 0:e.x)||(0,o.isNil)(null==e?void 0:e.y)}function m(e){return!("polyline"===e||"curve"===e)}function y(e){return!!e.edge}},967:(e,t,n)=>{n.d(t,{V:()=>u,P:()=>v});var o=n(1030),r=n(8875),i=n(4059);function l(e,t){return{x:e.x+e.width/2,y:e.y+e.height/2,width:e.width+t,height:e.height+t}}var a=n(3033),c=n(3188),s=n(531);const d=["right","top","left","bottom"];function u(e,t,n,u,m){var y,w,x,k,E,b;const{type:M,vertices:C,exitPosition:I,entryPosition:L}=null!=n?n:{};if((0,s.jw)(M))return"decorator"===m?[{x:e.x,y:e.y},...null!=C?C:[],{x:t.x,y:t.y}]:(0,c.h)(l(e,I?a.XK:a.p6),l(t,L?a.XK:a.p6),u,n);if(null!=C&&C.length){const n=C[0],o=C[C.length-1];let r,i,l,a;if(I)r=f(e,I);else{let i;if(C.length>1?i=C[1]:L&&(i=f(t,L)),i)r=g(n,e,n.y===i.y);else{const n=o.y<t.y||o.y>t.y+t.height?"ns":"ew";({point:r,direction:l}=p(e,t,C,n))}}if(L)i=f(t,L);else{let r;if(C.length>1?r=C[C.length-2]:I&&(r=f(e,I)),r)i=g(o,t,o.y===r.y);else{const o=n.x<e.x||n.x>e.x+e.width?"ew":"ns";({point:i,direction:a}=p(t,e,C.slice().reverse(),o))}}const{x:c,y:s}=r,{x:d,y:u}=i,h=[r,...C,i],m=[...C];return n&&n.x!==c&&n.y!==s&&m.unshift("ns"===l?{x:c,y:n.y}:"ew"===l?{x:n.x,y:s}:n.x===h[2].x?{x:c,y:n.y}:{x:n.x,y:s}),o&&o.x!==d&&o.y!==u&&m.push("ns"===a?{x:d,y:o.y}:"ew"===a?{x:o.x,y:u}:o.x===h[h.length-3].x?{x:d,y:o.y}:{x:o.x,y:u}),[r,...v(r,m,i),i]}const S=null!=I?I:h(t,e),N=null!=L?L:h(e,t),{x:z,y:P}=f(e,S),{x:R,y:A}=f(t,N),T=(0,r.X)(),H=null!==(y=null===(w=T.find((e=>e.x===S.x&&e.y===S.y)))||void 0===w?void 0:w.d)&&void 0!==y?y:d,W=null!==(x=null===(k=T.find((e=>e.x===N.x&&e.y===N.y)))||void 0===k?void 0:k.d)&&void 0!==x?x:d,j=[...H],D=[...W];z<R?((0,o.pull)(j,"left"),(0,o.pull)(D,"right")):((0,o.pull)(j,"right"),(0,o.pull)(D,"left")),P<A?((0,o.pull)(j,"top"),(0,o.pull)(D,"bottom")):((0,o.pull)(j,"bottom"),(0,o.pull)(D,"top"));const B=null!==(E=j[0])&&void 0!==E?E:H[0],Z=null!==(b=D[0])&&void 0!==b?b:W[0],$="left"===B||"right"===B?S.y:S.x,O="left"===Z||"right"===Z?N.y:N.x;return(0,i.o)(l(e,a.XK),l(t,a.XK),B,Z,$,O)}function v(e,t,n){const o=[];let r,i=e,l=0;for(;l<t.length;){const e=t[l],a=e.x!==i.x,c=e.y!==i.y;if(a||c){const c=a?"ew":"ns";if(c!==r){const a=l===t.length-1?n:t[l+1],s=a.x!==e.x,d=a.y!==e.y;(s||d)&&c!==(s?"ew":"ns")&&(r=c,o.push(e),i=e)}}l++}return o}function h(e,t){return t.y+t.height<e.y?{x:.5,y:1}:t.y>e.y+e.height?{x:.5,y:0}:t.x<e.x?{x:1,y:.5}:{x:0,y:.5}}function f(e,t){const n=a.XK/2;return{x:e.x-n+t.x*(e.width+a.XK),y:e.y-n+t.y*(e.height+a.XK)}}function g(e,t,n){let o,r,i,l,c;if(n?(o="y",r="x",i="height",l="width"):(o="x",r="y",i="width",l="height"),t[r]+t[l]<e[r]&&(c={[o]:.5,[r]:1}),t[r]>e[r]&&(c={[o]:.5,[r]:0}),c)return f(t,c);const s=t[o]<e[o]?1:0;return{[o]:t[o]-a.XK/2+s*(t[i]+a.XK),[r]:e[r]}}function p(e,t,n,o){let r,i,l,a,c,s,d,u;"ns"===o?(l="x",a="y",c="width",s="height",d="ns",u="ew"):(l="y",a="x",c="height",s="width",d="ew",u="ns");const v=n[0];if(v[l]>=e[l]&&v[l]<=e[l]+e[c])if(v[a]>e[a]+e[s])r={[l]:v[l],[a]:e[a]+e[s]},i=d;else if(v[a]<e[a])r={[l]:v[l],[a]:e[a]},i=d;else{var h;const o=null!==(h=n[1])&&void 0!==h?h:t;r={[l]:v[l],[a]:o[a]<v[a]?v[a]:e[a]+e[s]},i=d}else v[a]<e[a]?(r={[l]:e[l]+e[c]/2,[a]:e[a]},i=d):v[a]>e[a]+e[s]?(r={[l]:e[l]+e[c]/2,[a]:e[a]+e[s]},i=d):v[l]<e[l]?(r={[l]:e[l],[a]:v[a]},i=u):(r={[l]:e[l]+e[c],[a]:v[a]},i=u);return{point:r,direction:i}}},1103:(e,t,n)=>{n.d(t,{X:()=>u});var o=n(8769),r=n.n(o),i=n(3373),l=n.n(i),a=n(8653),c=n(9978),s=n(967),d=n(7531);function u(e){let{transform:t,lineSettings:n,options:i}=e;const[u,v]=(0,o.useState)(null),{hoverState:h,smartConnectLineState:f,setSmartConnectLineState:g}=(0,c.s)();(0,o.useEffect)((()=>{if(f)return document.addEventListener("mousemove",e),document.addEventListener("mouseup",n),o;function e(e){v([(e.clientX-t.x-f.offset[0])/t.k,(e.clientY-t.y-f.offset[1])/t.k])}function n(e){e.preventDefault(),o()}function o(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",n),v(null),g(null)}}),[g,f,t]);const p=(0,o.useMemo)((()=>{const e=function(e,t,n,o){if(!e||!t&&void 0===(null==n?void 0:n.activePointIndex))return null;const r=e.source.view;if(void 0!==(null==n?void 0:n.activePointIndex))return(0,s.V)(r,n.cell.view,{...o,exitPosition:e.exitPosition,entryPosition:n.relativePoints[n.activePointIndex]});const[i,l]=t;return(0,s.V)(r,{x:i,y:l,width:0,height:0},{...o,exitPosition:e.exitPosition})}(f,u,h,n);return(0,a.S)(e,"curve"===(null==n?void 0:n.type)?n.curveType:"curveLinear",0,1)}),[u,h,f,n]);let m,y;const w=(0,d.I)(i);for(const e of w)"start"===e.placement?m=i.$markerStartUrl:y=i.$markerEndUrl;return r().createElement("path",{className:l()("connect-line",{connecting:!(!f||!u)}),d:p,fill:"none",stroke:i.strokeColor,strokeWidth:i.strokeWidth,markerStart:m,markerEnd:y})}},1484:(e,t,n)=>{n.d(t,{g:()=>g});var o=n(8769),r=n(7566),i=n(9047),l=n(3033),a=n(531),c=n(4282),s=n(8802),d=n(1489),u=n(6170),v=n(9127);const h=new Map([["center",.5],["left",0],["right",1],["top",0],["bottom",1]]);function f(e,t){if("string"==typeof e){const n=h.get(e);if(void 0!==n)return n;const o=e.match(/^(-?\d+(?:\.\d+)?)%$/);if(o)return Number(o[1])/100;console.error("Unexpected align origin %s:",t,e)}else{if("number"==typeof e)return e;console.error("Unexpected align origin %s, expected %s, received %s:",t,"string | number",typeof e,e)}return.5}function g(e){let{layout:t,layoutOptions:n,autoSize:h,rootRef:g,cells:p,zoomable:m,zoomer:y,scaleRange:w,layoutKey:x,allowEdgeToArea:k,autoCenterWhenCellsChange:E,dispatch:b}=e;const[M,C]=(0,o.useState)("force"!==t&&"dagre"!==t),I=(0,o.useRef)(x),L=(0,o.useCallback)((()=>++I.current),[]),[S,N]=function(e){let{rootRef:t,cells:n,layoutInitialized:u,zoomable:v,zoomer:h,scaleRange:f,autoCenterWhenCellsChange:g,autoSize:p,padding:m}=e;const[y,w]=(0,o.useState)(!1);return(0,o.useEffect)((()=>{n.some((e=>(0,a.N)(e)||(0,a.mH)(e)))&&!g||w(!1)}),[n,g]),(0,o.useEffect)((()=>{const e=t.current;if(!e||!u||y||!n.some((e=>(0,a.N)(e)||(0,a.mH)(e)))||n.some((e=>(0,a.N)(e)&&!e[l.CV])))return;const o=(0,c.S)(n);let g=e.clientWidth,x=e.clientHeight;const k=!(null==p||!p.width),E=!(null==p||!p.height),b=(0,s.D)(null!=m?m:l.rn);var M,C,I,L;k&&(g=Math.min(Math.max(o.width+b[1]+b[3],null!==(M=p.minWidth)&&void 0!==M?M:0),null!==(C=p.maxWidth)&&void 0!==C?C:1/0),e.style.minWidth=`${g}px`),E&&(x=Math.min(Math.max(o.height+b[0]+b[2],null!==(I=p.minHeight)&&void 0!==I?I:0),null!==(L=p.maxHeight)&&void 0!==L?L:1/0),e.style.minHeight=`${x}px`);const{k:S,x:N,y:z}=(0,d.P)(o,{canvasWidth:g,canvasHeight:x,canvasPadding:b,scaleRange:v?f:void 0});h.transform((0,r.A)(e),new i.uV(S,N,z)),w(!0)}),[n,y,u,t,f,v,h,p,m]),[y,w]}({rootRef:g,layoutInitialized:M,cells:p,zoomable:m,zoomer:y,scaleRange:w,autoCenterWhenCellsChange:E,autoSize:h,padding:null==n?void 0:n.padding}),z=(0,o.useRef)(null);return(0,o.useEffect)((()=>{if(p.some((e=>(0,a.N)(e)&&!e[l.CV]))||0===p.length)return;if("force"!==t&&"dagre"!==t)return void C(!0);if(I.current!==x||(e=z.current,o=p.filter(a.nv),(null==e?void 0:e.length)===o.length&&e.every(((e,t)=>e===o[t]))))return;var e,o;let r,i;({getNodeView:r,nodePaddings:i}="force"===t?(0,u.k)({cells:p,layoutOptions:n,allowEdgeToArea:k}):(0,v.C)({cells:p,layoutOptions:n,allowEdgeToArea:k}));const c=function(e){const t=null!=e?e:[.5,.5];return[f(t[0],"x"),f(t[1],"y")]}(null==n?void 0:n.alignOrigin),s=p.map((e=>{if(k&&(0,a.o6)(e)||(0,a.N)(e)){const t=r(e.id);return{...e,view:{...e.view,x:t.x-t.width*c[0]+i[3],y:t.y-t.height*c[1]+i[0]},[l.xc]:!0}}return e}));z.current=s.filter(a.nv),b({type:"update-cells",payload:s}),C(!0)}),[p,b,t,x,n,k]),{centered:S,setCentered:N,getNextLayoutKey:L}}},1489:(e,t,n)=>{function o(e,t){let{canvasWidth:n,canvasHeight:o,canvasPadding:r,scaleRange:i}=t;const{left:l,top:a,width:c,height:s,empty:d}=e,[u,v,h,f]=null!=r?r:[0,0,0,0],g=n-f-v,p=o-u-h,m=i&&!d&&(c>g||s>p)?Math.max(Math.min(g/c,p/s,i[1]),i[0]):1;return{x:d?0:(g-c*m)/2+f-l*m,y:d?0:(p-s*m)/2+u-a*m,k:m}}n.d(t,{P:()=>o})},1819:(e,t,n)=>{n.d(t,{J:()=>i});var o=n(8769),r=n(8185);function i(e){let{rootRef:t,activeTarget:n,doNotResetActiveTargetForSelector:i,doNotResetActiveTargetOutsideCanvas:l,onActiveTargetChange:a}=e;const c=null!=n?n:null,[s,d]=(0,o.useState)(c);(0,o.useEffect)((()=>{d((e=>(0,r.c)(e,c)?e:c))}),[c]);const u=(0,o.useRef)(!1);return(0,o.useEffect)((()=>{u.current?a(s):u.current=!0}),[s,a]),(0,o.useEffect)((()=>{if(!s)return;const e=e=>{const n=e.composedPath(),o=n.indexOf(t.current);(l?0!==o:!(o<=0)||i&&n.some((e=>e instanceof Element&&e.matches(i))))||d(null)};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}}),[s,l,i,t]),s}},1825:(e,t,n)=>{n.d(t,{W:()=>g});var o=n(8769),r=n.n(o),i=n(3373),l=n.n(i),a=n(8653),c=n(9978),s=n(1030),d=n(967),u=n(531);function v(e,t,n,o){const{control:r}=t,{points:i}=n.get(e),l=[],[a,c]=o,s=i[0],u=i[i.length-1];0===r.index&&l.push("ns"===r.direction?{x:s.x,y:c}:{x:a,y:s.y});for(let e=1;e<i.length-1;e++){const t=i[e];l.push(e===r.index||e===r.index+1?"ns"===r.direction?{x:t.x,y:c}:{x:a,y:t.y}:t)}return r.index===i.length-2&&l.push("ns"===r.direction?{x:u.x,y:c}:{x:a,y:u.y}),(0,d.P)(s,l,u)}var h=n(7531);const f=["control","corner","break"];function g(e){let{cells:t,editableLineMap:n,transform:i,options:g,activeEditableLine:p}=e;const[m,y]=(0,o.useState)(null),{hoverState:w,lineEditorState:x,setLineEditorState:k,onChangeEdgeView:E,onChangeDecoratorView:b}=(0,c.s)(),M=(0,o.useRef)(!1);(0,o.useEffect)((()=>{x||setTimeout((()=>{M.current=!1}),0)}),[x]),(0,o.useEffect)((()=>{if(!p||!x)return;M.current=!1;const{type:e,offset:o,from:r}=x,l=l=>{const a={x:(l.clientX-i.x-o[0])/i.k,y:(l.clientY-i.y-o[1])/i.k},c=n.get(p).points,s={x:1/0,y:1/0};let d,v;const h=()=>{if(!M.current){const e=(l.clientX-r[0])/i.k,t=(l.clientY-r[1])/i.k;M.current=e**2+t**2>=9}return[a.x,a.y]};if(f.includes(e)&&!l.altKey){const t=x.control;v="control"===e?["ns"===t.direction?"y":"x"]:["x","y"],d=c.filter(((n,o)=>0===o||o===c.length-1||("control"===e?o!==t.index&&o!==t.index+1:"corner"!==e||o!==t.index+1)))}else{if(!(0,u._m)(p)||"exit"!==e&&"entry"!==e||l.altKey)return h();{const t="exit"===e?c[0]:c[c.length-1];d=c.filter((e=>e!==t)),v=["x","y"]}}for(const e of t){if(!(0,u.WW)(e)&&!(0,u._m)(e)||e===p)continue;const t=n.get(e);t&&d.push(...t.points.slice(1,-1))}for(const e of d)for(const t of v){const n=Math.abs(e[t]-a[t]);n<=5&&n<s[t]&&(a[t]=e[t],s[t]=n)}return h()},a=e=>{const t=l(e);M.current&&y(t)};function c(e){if(e.preventDefault(),s(),!M.current)return;const t=l(e),o=(0,u.WW)(p);if("control"!==(null==x?void 0:x.type)){if(!o)switch(null==x?void 0:x.type){case"entry":case"exit":null==b||b(p,{...p.view,["entry"===x.type?"target":"source"]:{x:t[0],y:t[1]}});break;case"corner":null==b||b(p,{...p.view,vertices:p.view.vertices.map(((e,n)=>n===x.control.index?{x:t[0],y:t[1]}:e))});break;case"break":{var r;const e=[...null!==(r=p.view.vertices)&&void 0!==r?r:[]];e.splice(x.control.index,0,{x:t[0],y:t[1]}),null==b||b(p,{...p.view,vertices:e});break}}}else if(o){const e=n.get(p),{source:o,target:r}=e;null==E||E(o,r,{...p.view,vertices:v(p,x,n,t)})}else null==b||b(p,{...p.view,vertices:v(p,x,n,t)})}function s(){document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",c),y(null),k(null)}return document.addEventListener("mousemove",a),document.addEventListener("mouseup",c),s}),[p,n,x,i,k,E,t,b]),(0,o.useEffect)((()=>{if(!p)return;const e=e=>{M.current&&(e.stopPropagation(),e.preventDefault())};return document.body.addEventListener("click",e),()=>{document.body.removeEventListener("click",e)}}),[p]);const C=(0,o.useMemo)((()=>{const e=function(e,t,n,o,r){if(!e||!t||!(o||"control"!==t.type&&void 0!==(null==r?void 0:r.activePointIndex)))return null;const i=n.get(e);if(!i)return null;const{type:l}=t;let a,c;const h=e.type;if((0,u.om)(i))a=i.source.view,c=i.target.view;else{const e=i.decorator.view;a={...e.source,width:0,height:0},c={...e.target,width:0,height:0}}const f=e.view,{exitPosition:g,entryPosition:p,vertices:m}=null!=f?f:{},y=(0,s.pick)(f,["type","curveType"]);if("control"===l){const r=v(e,t,n,o);return(0,d.V)(a,c,{...y,exitPosition:g,entryPosition:p,vertices:r},0,h)}if("corner"===l){const e=[...m];return e.splice(t.control.index,1,{x:o[0],y:o[1]}),(0,d.V)(a,c,{...y,exitPosition:g,entryPosition:p,vertices:e},0,h)}if("break"===l){const e=[...null!=m?m:[]];return e.splice(t.control.index,0,{x:o[0],y:o[1]}),(0,d.V)(a,c,{...y,exitPosition:g,entryPosition:p,vertices:e},0,h)}if("edge"===h&&void 0!==(null==r?void 0:r.activePointIndex)){const e=r.relativePoints[r.activePointIndex];return(0,d.V)(a,c,{...y,..."entry"===l?{exitPosition:g,entryPosition:e}:{exitPosition:e,entryPosition:p},vertices:m},0,h)}const[w,x]=o;return"entry"===l?(0,d.V)(a,{x:w,y:x,width:0,height:0},{...y,exitPosition:g,vertices:m},0,h):(0,d.V)({x:w,y:x,width:0,height:0},c,{...y,entryPosition:p,vertices:m},0,h)}(p,x,n,m,w),t=null==p?void 0:p.view;return(0,a.S)(e,"curve"===(null==t?void 0:t.type)?t.curveType:"curveLinear",0,1)}),[m,w,p,x,n]);let I,L;const S=(0,h.I)(g);for(const e of S)"start"===e.placement?I=g.$editingStartMarkerUrl:L=g.$editingEndMarkerUrl;return r().createElement("path",{className:l()("editing-line",{editing:!(!x||!m)}),d:C,fill:"none",stroke:g.editingStrokeColor,markerStart:I,markerEnd:L})}},1839:(e,t,n)=>{n.d(t,{Gd:()=>u,XV:()=>s,kR:()=>d});var o=n(1030),r=n(531),i=n(9127),l=n(3820),a=n(9940),c=n(3033);const s=12;function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={},d=e.filter((e=>(0,r.dS)(e)&&(0,r.kN)(e.view)));if(!d.length)return{groupMap:n};const{nodeLayout:u="dagre"}=t,v=e.filter((e=>"node"===e.type)),h=e.filter(r.WW),f=new Map;d.forEach((e=>{f.set(e.id,e)}));const g={};return v.forEach((e=>{const{groupId:t}=e;t&&(n[t]||(n[t]=[],g[t]=new Set),n[t].push(e),g[t].add(e.id))})),h.forEach((e=>{for(const[t,o]of Object.entries(g))if(o.has(e.source)&&o.has(e.target)){n[t].push(e);break}})),function(e,t,n,d){let u=0;e.forEach((e=>{const v=n.get(e),h=t[e].filter((e=>"node"===e.type));u+=+(s+2*c.Yl);let f=[];if("dagre"===d){const{getNodeView:e}=(0,i.C)({cells:h});f=h.map((t=>{if((0,r.kN)(t.view)){const n=e(t.id);t.view={...t.view,x:n.x,y:n.y+u,width:n.width,height:n.height}}return t}))}else"staggered"===d&&(f=(0,l.l)(h,{offsetY:u}));const g=(0,a.x)(f,{padding:s});v.view={...v.view,...g},u+=(0,o.get)(g,"height",0)+c.Yl}))}((0,o.orderBy)(d.filter((e=>n[e.id])),[e=>(0,r.VF)(e.view)?1:0,e=>(0,o.get)(e,"view.level",1)],["asc","asc"]).map((e=>e.id)),n,f,u),{groupMap:n}}function u(e,t,n){let o=[],i=!1;if("multi"===(null==t?void 0:t.type))o=t.targets;else if("node"===(null==t?void 0:t.type))o.push(t);else if("decorator"===(null==t?void 0:t.type))return i=t.id===e.id,i;return i=o.some((t=>{var o;return"node"===(null==t?void 0:t.type)&&(null===(o=n.find((e=>(0,r.N)(e)&&e.id===t.id)))||void 0===o?void 0:o.groupId)===e.id})),i}},1991:(e,t,n)=>{n.d(t,{_:()=>r});var o=n(531);function r(e,t,n){const r=t.filter((e=>(0,o.N)(e)||(0,o.dS)(e))),i=e.filter((e=>(0,o.t2)(e))).map((e=>e.id)),l=e.filter((e=>{const t=r.find((t=>t.id===e.id)),n=(null==t?void 0:t.containerId)&&i.includes(t.containerId);return((0,o.N)(e)&&!e.groupId||(0,o.dS)(e))&&!n})),a=t.filter((e=>{var t;return(0,o.t2)(e)&&!(null!==(t=e.view)&&void 0!==t&&t.locked)}));l.forEach((e=>{const t=e.x,n=e.x+e.width,o=e.y,r=e.y+e.height;for(const i of a){const l=i.view.x,a=i.view.x+i.view.width,c=i.view.y,s=i.view.y+i.view.height;if(t>=l&&n<=a&&o>=c&&r<=s){e.containerCell=i;break}}}));let c=[];return c=l.filter((e=>{var t;const n=r.find((t=>t.id===e.id));return(null==n?void 0:n.containerId)!==(null===(t=e.containerCell)||void 0===t?void 0:t.id)})),c.length>0&&(null==n||n(c)),c}},2202:(e,t,n)=>{n.d(t,{F:()=>h});var o=n(9575),r=n(8769),i=n.n(r),l=n(9978),a=n(531);const c="data:image/svg+xml;base64,PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj48c3ZnIHhtbG5zPSJodHRwOi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IycHgiIHZlcnNpb249IjEuMSI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iNyIgc3Ryb2tlPSIjZmZmIiBmaWxsPSIjMDFiZDIyIi8+PHBhdGggZD0ibSA4IDggTCAxNCAxNE0gOCAxNCBMIDE0IDgiIHN0cm9rZT0iI2ZmZiIvPjwvc3ZnPg==",u="data:image/svg+xml;base64,PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIxOHB4IiBoZWlnaHQ9IjE4cHgiIHZlcnNpb249IjEuMSI+PGNpcmNsZSBjeD0iOSIgY3k9IjkiIHI9IjUiIHN0cm9rZT0iI2ZmZiIgZmlsbD0iIzI5YjZmMiIvPjwvc3ZnPg==",v=22;function h(e){let{scale:t,editableLineMap:n,activeEditableLine:h,updateCurActiveEditableLine:f}=e;const{rootRef:g,movingCells:p,lineEditorState:m,setLineEditorState:y}=(0,l.s)(),w=(0,r.useRef)(null),x=(0,r.useRef)(null),k=(0,r.useRef)([]),E=(0,a._m)(h);(0,r.useEffect)((()=>{const e=w.current,t=x.current;if(!e||!t||!h)return;const n=e=>t=>{t.stopPropagation(),t.preventDefault();const n=g.current.getBoundingClientRect();y({offset:[n.left,n.top],from:[t.clientX,t.clientY],type:e}),null==f||f(h)},o=n("exit"),r=n("entry");return e.addEventListener("mousedown",o),t.addEventListener("mousedown",r),()=>{e.removeEventListener("mousedown",o),t.removeEventListener("mousedown",r)}}),[h,g,y,f]);const b=(0,r.useMemo)((()=>{var e;if(!h)return[];const t=n.get(h).points;return(0,a.jw)(null===(e=h.view)||void 0===e?void 0:e.type)?E?function(e){const t=[];let n=e[0],o=1;for(;o<e.length;){const r=e[o];t.push({type:"break",index:o-1,x:(n.x+r.x)/2,y:(n.y+r.y)/2}),o<e.length-1&&t.push({...r,type:"corner",index:o-1}),n=r,o++}return t}(t):[]:function(e){const t=[];let n=e[0],o=1;for(;o<e.length;){const r=e[o],i=n.y===r.y,l=n.x===r.x;if(!i||!l){const e=i?"ns":"ew";t.push({type:"control",direction:e,index:o-1,x:(n.x+r.x)/2,y:(n.y+r.y)/2})}n=r,o++}return t}(t)}),[h,n,E]);(0,r.useEffect)((()=>{if(!h)return;const e=k.current,t=b.map((e=>(e=>t=>{t.stopPropagation(),t.preventDefault(),null==f||f(h);const n=g.current.getBoundingClientRect();y({offset:[n.left,n.top],from:[t.clientX,t.clientY],type:e.type,control:e})})(e)));return e.forEach(((e,n)=>{null==e||e.addEventListener("mousedown",t[n])})),()=>{e.forEach(((e,n)=>{null==e||e.removeEventListener("mousedown",t[n])}))}}),[h,b,g,y,f]);const M=(0,r.useRef)(null);if((0,r.useEffect)((()=>{const e=M.current,t=e=>{e.stopPropagation(),e.preventDefault()};return null==e||e.addEventListener("click",t),()=>{null==e||e.removeEventListener("click",t)}}),[]),p)return null;const C=h.view,I=n.get(h).points,{exitPosition:L,entryPosition:S}=null!=C?C:{},N={width:v/t,height:v/t,preserveAspectRatio:"none",cursor:"pointer",pointerEvents:"fill"},z=I[0],P=I[I.length-1],R=v/t/2;return i().createElement("g",{ref:M},i().createElement("image",(0,o.A)({ref:w},N,{x:z.x-R,y:z.y-R,xlinkHref:E?u:L?d:c})),b.map(((e,t)=>i().createElement("image",(0,o.A)({key:t,ref:e=>{k.current[t]=e}},N,{x:e.x-R,y:e.y-R,opacity:"break"!==e.type||"break"===(null==m?void 0:m.type)&&m.control===e?1:.4,xlinkHref:u,cursor:E?"crosshair":"ns"===e.direction?"row-resize":"col-resize"})))),i().createElement("image",(0,o.A)({ref:x},N,{x:P.x-R,y:P.y-R,xlinkHref:E?s:S?d:c})))}},2219:(e,t,n)=>{function o(e,t){let{transform:n,offset:o,onLassoing:r,onLassoed:i}=t;if(e.ctrlKey||e.button)return;e.stopPropagation();const l=[e.clientX,e.clientY],a=(e.clientX-o[0]-n.x)/n.k,c=(e.clientY-o[1]-n.y)/n.k;let s=!1;const d=(e,t)=>{const o=function(e){return[(e.clientX-l[0])/n.k,(e.clientY-l[1])/n.k]}(e);if(s||(s=o[0]**2+o[1]**2>=9),s){let[e,n]=o,l=a,s=c;e<0&&(l=a+e,e=-e),n<0&&(s=c+n,n=-n),(t?i:r)({x:l,y:s,width:e,height:n})}},u=e=>{d(e)},v=e=>{d(e,!0),s=!1,document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",v)};document.addEventListener("mousemove",u),document.addEventListener("mouseup",v)}n.d(t,{F:()=>o})},2722:(e,t,n)=>{n.d(t,{T:()=>h});var o=n(8769),r=n.n(o),i=n(9978),l=n(4197),a=n(3033),c=n(531);const s="data:image/svg+xml;base64,PCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSI1cHgiIGhlaWdodD0iNXB4IiB2ZXJzaW9uPSIxLjEiPjxwYXRoIGQ9Im0gMCAwIEwgNSA1IE0gMCA1IEwgNSAwIiBzdHJva2Utd2lkdGg9IjIiIHN0eWxlPSJzdHJva2Utb3BhY2l0eTowLjQiIHN0cm9rZT0iI2ZmZmZmZiIvPjxwYXRoIGQ9Im0gMCAwIEwgNSA1IE0gMCA1IEwgNSAwIiBzdHJva2U9IiMyOWI2ZjIiLz48L3N2Zz4=",d=5,u=8,v=d/2;function h(e){let{activeTarget:t,editableLineMap:n,scale:s,activeEditableLine:d,disabled:v}=e;const{unsetHoverStateTimeoutRef:h,hoverState:g,setHoverState:p,smartConnectLineState:m,lineEditorState:y}=(0,i.s)(),w=(0,o.useCallback)((()=>{null!==h.current&&(clearTimeout(h.current),h.current=null)}),[h]),x=(0,o.useCallback)((()=>{w(),p((e=>void 0===(null==e?void 0:e.activePointIndex)?e:{...g,activePointIndex:void 0}))}),[g,p,w]),k=(0,o.useCallback)((()=>{h.current=setTimeout((()=>{p(null)}))}),[p,h]);let E,b,M;const C=!v&&g&&(!!m||(d&&y?(M=n.get(d))&&!!(0,c.om)(M)&&(({source:E,target:b}=M),"entry"===y.type?g.cell===b:"exit"===y.type&&g.cell===E):!(0,l.Q)(g.cell,t)&&!function(e){return e&&("edge"===e.type||"multi"===e.type&&e.targets.some((e=>"edge"===e.type)))}(t))),I=a.XK,L=I/2;return r().createElement("g",{onMouseEnter:x,onMouseLeave:k},C&&r().createElement(r().Fragment,null,r().createElement("rect",{x:g.cell.view.x-L,y:g.cell.view.y-L,width:g.cell.view.width+I,height:g.cell.view.height+I,fill:"none",stroke:"transparent",strokeWidth:2*u/s,pointerEvents:"stroke"}),void 0!==g.activePointIndex&&r().createElement("circle",{cx:g.points[g.activePointIndex].x,cy:g.points[g.activePointIndex].y,r:u/s,fill:"lightgreen",fillOpacity:.5,pointerEvents:"none"}),g.points.map(((e,t)=>r().createElement(f,{key:t,editableLineMap:n,index:t,point:e,scale:s,activeEditableLine:d,unsetActivePointIndex:x,unsetTimeout:w})))))}function f(e){let{editableLineMap:t,index:n,point:l,scale:a,activeEditableLine:c,unsetTimeout:h,unsetActivePointIndex:f}=e;const{rootRef:g,smartConnectLineState:p,hoverState:m,setHoverState:y,setSmartConnectLineState:w,onConnect:x,lineEditorState:k,setLineEditorState:E,onChangeEdgeView:b}=(0,i.s)(),M=(0,o.useRef)(null);return(0,o.useEffect)((()=>{const e=M.current,t=o=>{"mousemove"===o.type&&(null==e||e.removeEventListener(o.type,t)),h(),y((e=>e&&e.activePointIndex!==n?{...m,activePointIndex:n}:e))};return null==e||e.addEventListener("mouseenter",t),null==e||e.addEventListener("mousemove",t),()=>{null==e||e.removeEventListener("mouseenter",t),null==e||e.removeEventListener("mousemove",t)}}),[m,n,y,h]),(0,o.useEffect)((()=>{if(k)return;const e=e=>{e.preventDefault(),e.stopPropagation();const t=g.current.getBoundingClientRect(),o=m.points[n];w({source:m.cell,from:[o.x,o.y],offset:[t.left,t.top],exitPosition:m.relativePoints[n]})},t=M.current;return null==t||t.addEventListener("mousedown",e),()=>{null==t||t.removeEventListener("mousedown",e)}}),[m,n,k,g,w]),(0,o.useEffect)((()=>{const e=e=>{if(!c||!k||"decorator"!==c.type)if(e.preventDefault(),e.stopPropagation(),p)p.source!==(null==m?void 0:m.cell)&&(null==x||x(p.source,m.cell,p.exitPosition,m.relativePoints[m.activePointIndex])),w(null);else if(c&&k){const e=m.relativePoints[m.activePointIndex],{type:n}=k,{source:o,target:r}=t.get(c),{view:i}=c;"entry"===n?null==b||b(o,r,{...i,entryPosition:e}):null==b||b(o,r,{...i,exitPosition:e}),E(null)}},n=M.current;return null==n||n.addEventListener("mouseup",e),()=>{null==n||n.removeEventListener("mouseup",e)}}),[p,m,x,w,c,k,t,b,E]),r().createElement("g",{ref:M,onMouseLeave:f},r().createElement("circle",{cx:l.x,cy:l.y,r:u,fill:"transparent"}),r().createElement("image",{x:l.x-v/a,y:l.y-v/a,width:d/a,height:d/a,xlinkHref:s,preserveAspectRatio:"none"}))}},2733:(e,t,n)=>{n.d(t,{a:()=>i});var o=n(8944),r=n(4197);function i(e,t){let{cells:n,activeTarget:i,lockedIds:l}=t;const a=n.filter((e=>(0,r.Q)(e,i)&&!(0,o.l)(e,l)));if(0!==a.length)switch(e.key||e.keyCode||e.which){case"Backspace":case 8:case"Delete":case 46:return e.preventDefault(),e.stopPropagation(),{action:"delete-cells",cells:a}}}},2969:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(531),r=n(4197);function i(e,t,n,i){const l=[],a=[];for(const t of n)if((0,r.Q)(t,e)){var c;if((0,o.N)(t)&&t.containerId&&i.includes(t.containerId))continue;(null!==(c=t.view)&&void 0!==c&&c.locked?l:a).push(t)}let s=null;const d=[];return"unlock"!==t&&a.length>0?s=n.map((e=>{if(a.includes(e)){const t={...e,view:{...e.view,locked:!0}};return d.push(t),t}return e})):"lock"!==t&&l.length>0&&(s=n.map((e=>{if(l.includes(e)){const t={...e,view:{...e.view,locked:!1}};return d.push(t),t}return e}))),{newCells:s,updates:d}}},3012:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(6758),r=n.n(o),i=n(935),l=n.n(i)()(r());l.push([e.id,"*{box-sizing:border-box}:host{display:block;position:relative;overflow:hidden;--animation-dasharray:48;--stroke-dashedoffset:96;--stroke-dottedoffset:24;--dasharray:4;--dotted:1;--area-bg-color:rgba(119,141,195,0.1)}:host,\n.root{width:100%;height:100%}:host([hidden]){display:none}.root{opacity:0}.root.ready{opacity:1}.root:focus{outline:none}@keyframes solidAnimation{to{stroke-dashoffset:0}}@keyframes dashedAnimation{0%{stroke-dashoffset:var(--stroke-dashedoffset)}to{stroke-dashoffset:0}}@keyframes dottedAnimation{0%{stroke-dashoffset:var(--stroke-dottedoffset)}to{stroke-dashoffset:0}}.solid-animation{stroke-dasharray:var(--solid-length);stroke-dashoffset:var(--solid-length);animation:solidAnimation var(--time) linear infinite}.dashed-animation{animation:dashedAnimation var(--time) linear infinite}.dotted-animation{animation:dottedAnimation var(--time) linear infinite}.decorator-area .area,\n.container-wrapper .container{background-color:var(--area-bg-color);border:1px solid transparent}.decorator-text .text-container{border:1px solid transparent}.decorator-rect-container .rect-container{border:1px solid rgba(73,126,255,0.7)}.decorator-group .lock-icon,.decorator-group .plus-wrapper,.decorator-group .plus-icon{opacity:0}.decorator-group .group{position:relative}.decorator-group .group .plus-icon{position:absolute;left:50%;bottom:0;transform:translate(-50%,50%);padding:2px;background:var(--color-fill-bg-base-1);border-radius:2px;cursor:pointer}.decorator-group .group .plus-icon:hover{color:rgba(33,212,243,1)}.decorator-group.active-group:not(.does-not-exist) .group,.cell.active .decorator-group .group{border:1px dashed rgba(33,212,243,1)}.decorator-group.active-group:not(.does-not-exist) .resize-handle,.cell.active .decorator-group .resize-handle,.decorator-group.active-group:not(.does-not-exist) .lock-icon,.cell.active .decorator-group .lock-icon,.decorator-group.active-group:not(.does-not-exist) .plus-wrapper,.cell.active .decorator-group .plus-wrapper,.decorator-group.active-group:not(.does-not-exist) .plus-icon,.cell.active .decorator-group .plus-icon{opacity:1}.cell:has(.decorator-group.active-group),\n.cell:has(.container.active-container){opacity:1}.cell.active .decorator-area .area,\n.cell.active .decorator-rect-container .rect-container,\n.cell.active .decorator-text .text-container,\n.cell.active .container-wrapper .container,\n.cell.active .group-wrapper .group,\n.container-dragover .decorator-container .container,\n.active-container.container{border-style:dashed;border-color:rgba(73,126,255,0.7)}.node,\n.container-wrapper{overflow:visible}.decorator-text,\n.decorator-rect,\n.decorator-area{overflow:visible;pointer-events:none}.lock-icon,\n.decorator-text > *,\n.decorator-rect > *,\n.decorator-area > *{pointer-events:auto}.cell.active .line-active-bg{stroke:var(--palette-blue-5);stroke-dasharray:var(--dasharray);stroke-width:1}.cell:not(.read-only){-webkit-user-select:none;user-select:none}.resize-handle{cursor:nwse-resize;opacity:0}.resize-handle rect{fill:transparent;stroke:none}.resize-handle path{fill:none;stroke:var(--palette-gray-5);stroke-width:1.5}.decorator-area-container:hover .resize-handle,\n.decorator-rect-container:hover .resize-handle,\n.decorator-container:hover .resize-handle{opacity:1}.connect-line{pointer-events:none}.connect-line:not(.connecting){display:none}.editing-line{pointer-events:none;stroke-dasharray:var(--dasharray);stroke-width:1}.editing-line:not(.editing){display:none}.line.dashed{stroke-dasharray:var(--dasharray)}.line.dotted{stroke-dasharray:var(--dotted)}.decorator-text .text-container{width:max-content;padding:0.5em;white-space:pre}.cell:not(.read-only) .decorator-text .text-container:hover{color:#497eff}.decorator-text .text:focus{outline:none}.cell.faded{opacity:0.3}.cell.container-dragover{opacity:1}.cell .node{pointer-events:none}.cell .node > *{position:fixed;pointer-events:auto}.degraded{pointer-events:bounding-box}.degraded circle{fill:rgb(119,141,195)}.degraded text{text-anchor:middle;fill:var(--antd-text-color)}.cell.active .degraded circle,\n.cell.active .degraded text,\n.degraded:hover circle,\n.degraded:hover text{fill:var(--color-brand)}.decorator-container{--defaultSize:24px}.decorator-container .text-container{display:flex;align-items:center;justify-content:center;padding:0.5em;text-align:center;font-size:16px;color:#262626;background-color:rgba(119,141,195,0.25);overflow:hidden}.decorator-container .horizontal{height:max-content;width:100%}.decorator-container .horizontal .text{min-height:var(--defaultSize)}.decorator-container .vertical{width:max-content;height:100%;writing-mode:vertical-lr;-webkit-text-orientation:upright;text-orientation:upright;letter-spacing:4px}.decorator-container .vertical .text{min-width:var(--defaultSize)}.line-label-container{overflow:visible;opacity:0}.line-label-container.ready{opacity:1}.line-label{position:absolute;display:block;transform:translate(-50%,-50%);white-space:pre-line;width:max-content;text-align:center}.line-label.text{font-size:11px;color:var(--color-secondary-text);font-weight:400;line-height:1.63636364}.motion:not(.visible){opacity:0}",""]);const a=l.toString()},3033:(e,t,n)=>{n.d(t,{Be:()=>y,CE:()=>f,CV:()=>o,D9:()=>a,Dm:()=>l,Go:()=>S,HP:()=>i,Ie:()=>g,Jo:()=>I,N8:()=>c,Ub:()=>m,VO:()=>h,XK:()=>M,XV:()=>p,Yl:()=>L,Yt:()=>u,gx:()=>x,ld:()=>k,mF:()=>v,o5:()=>E,p6:()=>b,pC:()=>w,rn:()=>C,sS:()=>d,w1:()=>s,xc:()=>r});const o=Symbol.for("size-initialized"),r=Symbol.for("layout-initialized"),i=20,l=36,a=50,c=180,s=120,d=.5,u=2,v="gray",h=1,f="rgba(73, 126, 255, 0.7)",g=15,p=!1,m=!0,y=1,w=500,x=10,k=5,E="all",b=5,M=0,C=0,I=50,L=40,S=12},3371:(e,t,n)=>{n.d(t,{L:()=>m});var o=n(1030),r=n(3033),i=n(531),l=n(3783),a=n(4282),c=n(1489),s=n(6170),d=n(9127),u=n(8185),v=n(9940),h=n(1839);function f(e,t,n,o){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;const{x:l,y:a,width:c}=e,s=n+r,d=o+r,u=Math.max(Math.floor((c-2*i)/s),1);let v=0;for(;;){for(let e=0;e<u;e++){const r=l+i+e*s,c=a+i+v*d;if(!t.some((e=>g(r,c,n,o,e.x,e.y,n,o))))return{x:r,y:c}}v++}}function g(e,t,n,o,r,i,l,a){const c=e+n/2,s=t+o/2,d=r+l/2,u=i+a/2,v=(n+l)/2,h=(o+a)/2;return Math.abs(c-d)<v&&Math.abs(s-u)<h}var p=n(6811);function m(e){let{cells:t,layout:n,previousCells:g,defaultNodeSize:m,canvasWidth:y,canvasHeight:w,scaleRange:x,transform:k,reason:E,parent:b,parentNode:M,allowEdgeToArea:C,layoutOptions:I}=e;const L="force"!==n&&"dagre"!==n,S=(0,l.C)(t,{defaultNodeSize:m,layoutOptions:I,isInitialize:!1}),N=[];let z=!1;const P=new Map;let R=!1;for(const e of g)((0,i.mH)(e)||(0,i.N)(e))&&(R=!0,(0,i.N)(e)&&e[r.CV]&&P.set(e.id,e));const A=new Map;for(const e of S)if((0,i.N)(e)){A.set(e.id,e);const t=P.get(e.id);t&&(Object.assign(e.view,{width:t.view.width,height:t.view.height}),e[r.CV]=!0)}let T=!1;if("add-related-nodes"===E&&(T=function(e){let{newCells:t,nodesMap:n,parent:o,parentNode:l,isManualLayout:a,updateCandidates:c,handled:s}=e;const d=o?n.get(o):l;if(!d||(0,i.kN)(d.view))return s;const u=new Map,v=[];for(const e of t)(0,i.WW)(e)&&e.source&&e.target&&(u.has(e.source)||u.set(e.source,[]),u.get(e.source).push(e.target),v.push({id:e.target,parentId:e.source}));for(;v.length>0;){const{id:e,parentId:t}=v.shift(),o=n.get(e),l=n.get(t);if(o&&l){if((0,i.kN)(o.view)){if(a){const n=u.get(t).indexOf(e),i=l.view.x+l.view.width/2-o.view.width/2,a=l.view.y+l.view.height+r.D9;let c=0;n>0&&(c=(1-n%2*2)*Math.ceil(n/2)*(o.view.width+r.Dm)),o.view.x=i+c,o.view.y=a}c.push(o)}(u.get(e)||[]).forEach((t=>v.push({id:t,parentId:e})))}}return!t.some((e=>"decorator"===e.type&&(0,i.kN)(e.view)))}({newCells:S,nodesMap:A,parent:b,parentNode:M,isManualLayout:L,updateCandidates:N,handled:T})),!T){const e=[];let t=!1;for(const n of S)(0,i.N)(n)?(0,i.kN)(n.view)?N.push(n):e.push(n):(0,i.mH)(n)&&(t=!0);if(L){let n;R||(k=function(e,t){const n=(0,a.S)(e);return(0,c.P)(n,t)}((0,o.without)(S,...N),{canvasWidth:y,canvasHeight:w,scaleRange:x})),0===e.length||1===e.length&&!t&&N.length>0?(N.push(...e),({getNodeView:n}=(0,d.C)({cells:S,allowEdgeToArea:C})),z=0===g.length||g.length===S.length&&g.every(((e,t)=>(0,u.c)(e,S[t])))):({getNodeView:n}=(0,s.k)({cells:S,fixedPosition:!0,allowEdgeToArea:C,center:[(y/2-k.x)/k.k,(w/2-k.y)/k.k]}));const l=[...S.filter((e=>(0,i.t2)(e)&&(0,i.VF)(e.view))),...S.filter((e=>(0,i.dS)(e)&&(0,i.VF)(e.view)))],E="layered-staggered"===(0,o.get)(I,"initialLayout")?"staggered":"dagre";l.length>0?((0,p.G)(S,{nodeLayout:E}),N.push(...l)):function(e,t){let{defaultNodeSize:n}=t;const l=e.filter((e=>"node"===e.type&&(0,i.kN)(e.view)&&!(0,o.isNil)(e.containerId))),a=e.filter((e=>"node"===e.type&&(0,i.kN)(e.view)&&!(0,o.isNil)(e.groupId)));if(a.length){const t={};(0,o.forEach)((0,o.groupBy)(a,"groupId"),((e,n)=>{t[n]=e})),e.filter((e=>(0,i.dS)(e)&&t[e.id])).forEach((o=>{const l=o.id,a=t[l],c=(0,i.kN)(o.view)?(0,v.x)(e.filter((e=>"node"===e.type&&e.groupId===l)),{padding:h.XV}):o.view,s=e.filter((e=>(null==e?void 0:e.groupId)===l&&!(0,i.kN)(e.view))).map((e=>({x:e.view.x,y:e.view.y})));a.forEach((e=>{var t,o;const i=(null===(t=e.view)||void 0===t?void 0:t.width)||n[0],l=(null===(o=e.view)||void 0===o?void 0:o.height)||n[1],a=r.Yl,d=f(c,s,i,l,10,a);d&&(e.view={...e.view,x:d.x,y:d.y},s.push(d))}))}))}if(l.length){const t={};(0,o.forEach)((0,o.groupBy)(l,"containerId"),((e,n)=>{t[n]=e})),e.filter((e=>(0,i.t2)(e)&&t[e.id])).forEach((o=>{const l=o.id,a=o.view,c=e.filter((e=>(null==e?void 0:e.containerId)===l&&!(0,i.kN)(e.view))).map((e=>({x:e.view.x,y:e.view.y})));t[l].forEach((e=>{var t,o;const i=(null===(t=e.view)||void 0===t?void 0:t.width)||n[0],l=(null===(o=e.view)||void 0===o?void 0:o.height)||n[1],s=r.Yl,d=f(a,c,i,l,10,s);d&&(e.view={...e.view,x:d.x,y:d.y},c.push(d))}))}))}}(S,{defaultNodeSize:m});for(const e of S)if((0,i.N)(e)&&(0,i.kN)(e.view)){const t=n(e.id);e.view.x=t.x,e.view.y=t.y}}}return{cells:S,updated:N,shouldReCenter:z}}},3639:(e,t,n)=>{n.d(t,{w:()=>a});var o=n(8769),r=n.n(o),i=n(3373),l=n.n(i);function a(e){let{connectLineState:t,transform:n,markerEnd:i,onConnect:a}=e;const[c,s]=(0,o.useState)(null);return(0,o.useEffect)((()=>{t&&s(t.from)}),[t]),(0,o.useEffect)((()=>{if(t){const e=e=>[(e.clientX-n.x-t.offset[0])/n.k,(e.clientY-n.y-t.offset[1])/n.k],o=t=>{s(e(t))},r=e=>{e.stopPropagation()},i=n=>{n.stopPropagation(),l(),a(t,e(n))},l=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mousedown",r,{capture:!0}),document.removeEventListener("click",i,{capture:!0}),s(null)};return document.addEventListener("mousemove",o),document.addEventListener("mousedown",r,{capture:!0}),document.addEventListener("click",i,{capture:!0}),l}}),[t,a,n]),r().createElement("path",{className:l()("connect-line",{connecting:!!t&&c&&(c[0]-t.from[0])**2+(c[1]-t.from[1])**2>25}),d:t&&c?`M${t.from.join(" ")}L${c.join(" ")}`:"",fill:"none",stroke:"gray",strokeWidth:1,markerEnd:`url(#${i})`})}},3783:(e,t,n)=>{n.d(t,{C:()=>l});var o=n(1030),r=n(531),i=n(6811);function l(e,t){let{defaultNodeSize:n,layoutOptions:l,isInitialize:a}=t;const c=null!=e?e:[];return a&&("layered-architecture"===(0,o.get)(l,"initialLayout")?(0,i.G)(c,{nodeLayout:"dagre"}):"layered-staggered"===(0,o.get)(l,"initialLayout")&&(0,i.G)(c,{nodeLayout:"staggered"})),c.map((e=>{var t,o;return!(0,r.vC)(e)||void 0!==(null===(t=e.view)||void 0===t?void 0:t.width)&&void 0!==(null===(o=e.view)||void 0===o?void 0:o.height)?e:{...e,view:{width:n[0],height:n[1],...e.view}}}))}},3820:(e,t,n)=>{n.d(t,{l:()=>l});var o=n(1030),r=n(3033),i=n(531);function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{gapX:n=50,gapY:l=50,offsetY:a=r.Yl,maxPerRow:c=r.Go}=t,s=c,d=c-1,u=[];let v=0,h=0,f=a;for(;v<e.length;){const t=h%2==1,a=t?d:s;let c=t?r.Yl:0,g=0;for(let t=0;t<a&&v<e.length;t++,v++){const t=e[v],l=(0,o.get)(t,"view.width",r.HP),a=(0,o.get)(t,"view.height",r.HP),s=c,d=f;((0,i.kN)(e[v].view)||(0,i.dS)(e[v]))&&(e[v].view={...e[v].view,x:s,y:d,width:l,height:a}),c=s+(l+n),g=Math.max(g,a),u.push(e[v])}f=f+g+l,h++}return u}},4117:(e,t,n)=>{n.d(t,{A:()=>u});var o=n(8769),r=n(531);function i(e,t){return e.find((e=>(0,r.o6)(e)&&e.id===t))}var l=n(967),a=n(1030),c=n(4525);const s=6;function d(e,t,n,o,r){const i=(0,c.y)([e.x,e.y],[t.x,t.y],[n.x,n.y],[o.x,o.y]);if(i){const l=r*r;for(const r of[e,t,n,o]){const e=i[0]-r.x,t=i[1]-r.y;if(e*e+t*t<l)return null}return{x:i[0],y:i[1]}}return null}function u(e){let{cells:t,lineConfMap:n}=e;return(0,o.useMemo)((()=>{const e=new WeakMap,o=function(){const e=[],t=[];return function(n,o){const r=[],i=[];if("curve"!==o.type||"curveLinear"===o.curveType){for(let l=0;l<n.length-1;l++){const c=n[l],u=n[l+1],v=[],h=s/2+o.strokeWidth-1;if(o.jumps)e:for(const n of t){const t=d(c,u,n.start,n.end,h);if(t){for(const n of e)for(const e of n.jumpPoints)if(Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))<h+n.radius)continue e;v.push(t)}}if(v.length>0){const t={jumpPoints:(0,a.sortBy)(v,(e=>(e.x-n[0].x)**2+(e.y-n[0].y)**2)),index:l,radius:h};e.push(t),r.push(t)}i.push({start:c,end:u})}t.push(...i)}return r.length>0?new Map(r.map((e=>[e.index,e]))):null}}();for(const a of t)if((0,r.WW)(a)){var c;const s=n.get(a);if(!s)continue;const d=i(t,a.source),u=i(t,a.target),v=(0,r.jw)(null===(c=a.view)||void 0===c?void 0:c.type)&&t.some((e=>{var t;return(0,r.WW)(e)&&a.source===e.target&&a.target===e.source&&(0,r.jw)(null===(t=e.view)||void 0===t?void 0:t.type)}))?s.parallelGap:0,h=d&&u&&null!=d.view.x&&null!=u.view.x?(0,l.V)(d.view,u.view,a.view,v,a.type):null;if(h){const t=o(h,s);e.set(a,{edge:a,points:h,source:d,target:u,parallelGap:v,jumpsMap:t})}}else if((0,r._m)(a)){const t=n.get(a);if(!t)continue;const{source:r,target:i}=a.view,c=r&&i?(0,l.V)({...r,width:0,height:0},{...i,width:0,height:0},a.view,0,a.type):null;if(c){const n=o(c,t);e.set(a,{decorator:a,points:c,parallelGap:0,jumpsMap:n})}}return e}),[t,n])}},4197:(e,t,n)=>{n.d(t,{Q:()=>r});var o=n(8185);function r(e,t){return!!t&&("multi"===t.type?t.targets:[t]).some((t=>(0,o.c)(t,e)))}},4282:(e,t,n)=>{n.d(t,{S:()=>r});var o=n(531);function r(e){const t=[];let n=!0;for(const r of e)(0,o.WW)(r)||(n=!1,t.push(r.view));const{x:r,y:i,width:l,height:a}=function(e){let t=1/0,n=1/0,o=-1/0,r=-1/0;for(const i of e){const e=i.x+i.width,l=i.y+i.height;i.x<t&&(t=i.x),e>o&&(o=e),i.y<n&&(n=i.y),l>r&&(r=l)}return{x:t,y:n,width:o-t,height:r-n}}(t);return{left:r,top:i,width:l,height:a,empty:n}}},5748:(e,t,n)=>{n.d(t,{d:()=>d});var o=n(1030),r=n(531),i=n(3033);const l=[{type:"decorator",decorators:["line","area","container","rect"]},{type:"edge"},{type:"node"},{type:"decorator",decorators:["text"]}];function a(e,t){return c(e,[t])}function c(e,t){if(0===t.length)return e;const n=l.findIndex((e=>s(t[0],e)));-1===n&&console.warn("Default order index unhandled for the cell: %o.\n%s",t[0],"This is a bug of diagram-NB, please report it.");const o=e.findLastIndex((e=>l.findIndex((t=>s(e,t)))<=n))+1;return[...e.slice(0,o),...t,...e.slice(o)]}function s(e,t){return e.type===t.type&&("decorator"!==t.type||t.decorators.includes(e.decorator))}const d=(u={cells:(e,t)=>{switch(t.type){case"drop-node":case"drop-decorator":return a(e,t.payload);case"add-nodes":return c(e,t.payload);case"add-edge":{const n=e.findIndex((e=>"edge"===e.type&&e.source===t.payload.source&&e.target===t.payload.target));return-1===n?a(e,t.payload):[...e.slice(0,n),t.payload,...e.slice(n+1)]}case"change-edge-view":{const n=e.findIndex((e=>"edge"===e.type&&e.source===t.payload.source&&e.target===t.payload.target));return-1===n?e:[...e.slice(0,n),{...e[n],view:t.payload.view},...e.slice(n+1)]}case"change-decorator-view":{const n=e.findIndex((e=>"decorator"===e.type&&e.id===t.payload.id));return-1===n?e:[...e.slice(0,n),{...e[n],view:t.payload.view},...e.slice(n+1)]}case"move-cells":{let n=!1;const r=e.map((e=>{const r=t.payload.find((t=>e.type===t.type&&e.id===t.id));return r?(n=!0,{...e,view:{...e.view,x:r.x,y:r.y,...(0,o.pick)(r,"source","target","vertices")}}):e}));return n?r:e}case"resize-cell":{const{type:n,id:o,width:r,height:i}=t.payload,l=e.findIndex((e=>e.type===n&&e.id===o));if(-1!==l){const t=e[l];return[...e.slice(0,l),{...t,view:{...t.view,width:r,height:i}},...e.slice(l+1)]}return e}case"update-cells":return t.payload;case"update-node-size":return e.map((e=>(0,r.N)(e)&&e.id===t.payload.id?{...e,[i.CV]:!0,view:t.payload.size?{...e.view,width:t.payload.size[0],height:t.payload.size[1]}:e.view}:e))}return e},layoutKey:(e,t)=>"update-node-size"===t.type?t.layoutKey:e},(e,t)=>Object.fromEntries(Object.entries(u).map((n=>{let[o,r]=n;return[o,r(e[o],t)]}))));var u},6170:(e,t,n)=>{n.d(t,{k:()=>v});var o=n(1030),r=n(6149),i=n(4842),l=n(1945),a=n(9418),c=n(3854),s=n(7931),d=n(531),u=n(8802);function v(e){let{cells:t,layoutOptions:n,center:v,fixedPosition:h,allowEdgeToArea:f}=e;const{nodePadding:g,collide:p}={nodePadding:0,...(0,o.pick)(n,["nodePadding"]),collide:!1!==(null==n?void 0:n.collide)&&{radiusDiff:18,strength:1,iterations:1,...!0===(null==n?void 0:n.collide)?null:null==n?void 0:n.collide}},m=(0,u.D)(g),y=[],w=[],x=new Map;for(const e of t)if(f&&(0,d.o6)(e)||(0,d.N)(e)){const t={id:e.id,width:e.view.width+m[1]+m[3],height:e.view.height+m[0]+m[2],...h?{fx:e.view.x,fy:e.view.y}:null};y.push(t),x.set(t.id,t)}else(0,d.WW)(e)&&w.push({source:e.source,target:e.target});const k=(0,r.A)(w).id((e=>e.id)),E=(0,i.A)(y).force("link",k).force("x",(0,l.A)(null==v?void 0:v[0])).force("y",(0,a.A)(null==v?void 0:v[1])).force("charge",(0,c.A)());return p&&E.force("collide",(0,s.A)().radius((e=>Math.sqrt(e.width**2+e.height**2)/2+p.radiusDiff)).strength(p.strength).iterations(p.iterations)),E.stop(),function(e){e.tick(Math.ceil(Math.log(e.alphaMin())/Math.log(1-e.alphaDecay())))}(E),{getNodeView:e=>x.get(e),nodePaddings:m}}},6237:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(6758),r=n.n(o),i=n(935),l=n.n(i)()(r());l.push([e.id,'.zoom-bar{position:absolute;bottom:20px;right:20px;width:40px;scale:0.8}.zoom-slider,\n.center-button{width:100%;display:flex;align-items:center;border:1px solid var(--antd-background-color-base);border-radius:var(--larger-border-radius);box-shadow:var(--connected-overlay-shadow);background-color:var(--color-fill-bg-container-4)}.zoom-slider{height:140px;padding:8px 0;flex-direction:column}[role="button"]{cursor:pointer}.center-button{justify-content:center;margin-bottom:8px;height:40px}.center-button:hover{border-color:var(--antd-btn-default-hover-border-color)}.center-button path{fill:var(--antd-link-hover-color)}.center-button:hover path{fill:var(--palette-blue-7)}.zoom-button{font-size:16px;line-height:0}.zoom-button svg{width:1em;height:1em;fill:var(--antd-link-hover-color)}.zoom-slider .ant-slider-vertical{padding-left:5px;padding-right:5px}.zoom-slider .ant-slider-vertical .ant-slider-rail{width:2px}.zoom-slider .ant-slider-vertical .ant-slider-handle{width:6px;height:6px;left:3px}.zoom-slider .ant-slider .ant-slider-handle:hover::before,\n.zoom-slider .ant-slider .ant-slider-handle:focus::before,\n.zoom-slider .ant-slider .ant-slider-handle::before{width:10px;height:10px;left:-2px}.zoom-slider .ant-slider .ant-slider-handle:hover::after,\n.zoom-slider .ant-slider .ant-slider-handle:focus::after,\n.zoom-slider .ant-slider .ant-slider-handle::after{width:6px;height:6px;top:0;left:0}',""]);const a=l.toString()},6811:(e,t,n)=>{n.d(t,{G:()=>d});var o=n(1030),r=n(531),i=n(9127),l=n(9940),a=n(3033),c=n(3820),s=n(1839);function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{groupMap:n}=(0,s.kR)(e,t),d=e.filter((e=>"node"===e.type&&!(0,o.isNil)(e.containerId))),u=e.filter((e=>"decorator"===e.type&&"group"===e.decorator&&!(0,o.isNil)(e.containerId)));if(!d.length&&!u.length)return;const{nodeLayout:v="dagre"}=t,h=e.filter(r.WW),f=e.filter((e=>(0,r.t2)(e))),g=new Map;let p=0,m=0;f.forEach((e=>{g.set(e.id,e)}));const y={},w={};(0,o.forEach)((0,o.groupBy)([...d,...u],"containerId"),((e,t)=>{y[t]=e,w[t]=new Set(e.map((e=>e.id)))})),h.forEach((e=>{for(const[t,n]of Object.entries(w))if(n.has(e.source)&&n.has(e.target)){y[t].push(e);break}}));const x=[],k=(0,o.orderBy)(f.filter((e=>y[e.id])),[e=>(0,r.VF)(e.view)?1:0,e=>(0,o.get)(e,"view.level",1)],["asc","asc"]).map((e=>e.id)),{updatedGap:E,updatedMaxWidth:b}=function(e,t,n,d,u,v,h,f){let g=u,p=h;return e.forEach((e=>{const u=n.get(e),h=t[e];["top","bottom"].includes((0,o.get)(u,"view.direction","top"))&&(g+=a.Yl);const m=h.filter((e=>"node"===e.type)),y=(0,o.get)(f,"groupCells",[]).filter((t=>t.containerId===e));let w=[];if("dagre"===d){const{getNodeView:e}=(0,i.C)({cells:[...h,...y]});w=[...m,...y].map((t=>{if((0,r.kN)(t.view)||(0,r.dS)(t)){const n=e(t.id);t.view={...t.view,x:n.x,y:n.y+g,width:n.width,height:n.height}}return t}))}else"staggered"===d&&(w=(0,c.l)([...m,...y],{offsetY:g}));let x=0,k=0;if((0,r.VF)(u.view)){const e=(0,l.x)(w);x=(0,o.get)(e,"height",a.w1),k=(0,o.get)(e,"width",a.N8),u.view={...u.view,...e},v.push(u)}else x=(0,o.get)(u,"view.height"),k=(0,o.get)(u,"view.width");if(y.length>0){const e=(0,o.get)(f,"groupMap",{});y.forEach((t=>{const n=t.id,{x:r,y:i}=t.view,l=(0,o.get)(e,n,[]);if(!l.length)return;const a=l[0].view.x,c=l[0].view.y;l.forEach((e=>{var t,n;e.view={...e.view,x:r+((null===(t=e.view)||void 0===t?void 0:t.x)-a),y:i+((null===(n=e.view)||void 0===n?void 0:n.y)-c)}})),t.view={...t.view,x:r-s.XV,y:i-s.XV}}))}p=Math.max(k,p),g+=x+a.Yl})),{updatedGap:g,updatedMaxWidth:p}}(k,y,g,v,p,x,m,{groupCells:u,groupMap:n});p=E,m=b,x.forEach((e=>{e.view.width=Math.max(a.N8,m)}))}},7099:(e,t,n)=>{n.d(t,{Y:()=>f});var o=n(8769),r=n.n(o),i=n(9351),l=n(6768),a=n(1715),c=n(5694),s=n(2092),d=n(9575);const u=e=>o.createElement("svg",(0,d.A)({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24"},e),o.createElement("path",{d:"M12 0a.5.5 0 0 1 .5.5v2.013a9.5 9.5 0 0 1 8.987 8.988L23.5 11.5a.5.5 0 0 1 0 1h-2.013a9.5 9.5 0 0 1-8.987 8.987V23.5a.5.5 0 0 1-1 0v-2.013A9.5 9.5 0 0 1 2.514 12.5H.5a.5.5 0 0 1 0-1h2.013A9.5 9.5 0 0 1 11.5 2.514V.5A.5.5 0 0 1 12 0M3.514 11.5H7.5a.5.5 0 0 1 0 1H3.514a8.5 8.5 0 0 0 7.987 7.986L11.5 16.5a.5.5 0 0 1 1 0v3.986a8.5 8.5 0 0 0 7.986-7.986H16.5a.5.5 0 0 1 0-1h3.986A8.5 8.5 0 0 0 12.5 3.515V7.5a.5.5 0 0 1-1 0V3.514a8.5 8.5 0 0 0-7.986 7.987zm8.486-1a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3"})),v=e=>o.createElement("svg",(0,d.A)({xmlns:"http://www.w3.org/2000/svg",width:128,height:128,className:"icon",viewBox:"0 0 1024 1024"},e),o.createElement("path",{d:"M512 76.8A435.2 435.2 0 1 0 947.2 512 435.71 435.71 0 0 0 512 76.8m0 819.2a384 384 0 1 1 384-384 384 384 0 0 1-384 384"}),o.createElement("path",{d:"M744.448 486.4h-204.8V281.6a25.6 25.6 0 1 0-51.2 0v204.8h-204.8a25.6 25.6 0 0 0 0 51.2h204.8v204.8a25.6 25.6 0 0 0 51.2 0V537.6h204.8a25.6 25.6 0 0 0 0-51.2"})),h=e=>o.createElement("svg",(0,d.A)({xmlns:"http://www.w3.org/2000/svg",width:128,height:128,className:"icon",viewBox:"0 0 1024 1024"},e),o.createElement("path",{d:"M512 76.8A435.2 435.2 0 1 0 947.2 512 435.71 435.71 0 0 0 512 76.8m0 819.2a384 384 0 1 1 384-384 384 384 0 0 1-384 384"}),o.createElement("path",{d:"M744.448 486.4H280.064a25.6 25.6 0 1 0 0 51.2h464.384a25.6 25.6 0 0 0 0-51.2"}));function f(e){let{shadowRoot:t,scale:n,scaleRange:d,onZoomChange:f,onReCenter:g}=e;const p=(0,s.useCurrentTheme)(),m=(0,o.useMemo)((()=>(0,c.VC)()),[]),y=(0,o.useRef)(null),w=100*d[0],x=100*d[1],k=100*n,E=(0,o.useMemo)((()=>({formatter:e=>`${e}%`,placement:"left",getPopupContainer:()=>y.current})),[]),b=(0,o.useCallback)((()=>{f(Math.min(k+5,x))}),[x,f,k]),M=(0,o.useCallback)((()=>{f(Math.max(k-5,w))}),[w,f,k]);return r().createElement(i.Ay,{theme:{algorithm:"dark-v2"===p?l.A.darkAlgorithm:l.A.defaultAlgorithm}},r().createElement(c.N7,{container:t,autoClear:!0,cache:m,hashPriority:"high"},r().createElement("div",{className:"zoom-bar",ref:y},r().createElement("div",{className:"center-button",onClick:g,role:"button"},r().createElement(u,null)),r().createElement("div",{className:"zoom-slider"},r().createElement("div",{className:"zoom-button",role:"button",onClick:b},r().createElement(v,null)),r().createElement(a.A,{min:w,max:x,value:k,step:5,vertical:!0,included:!1,tooltip:E,onChange:f}),r().createElement("div",{className:"zoom-button",role:"button",onClick:M},r().createElement(h,null))))))}},7531:(e,t,n)=>{n.d(t,{I:()=>d,d:()=>c});var o=n(8769),r=n(1921),i=n(1030),l=n(531),a=n(3033);function c(e){let{cells:t,defaultEdgeLines:n,markerPrefix:c,lineConnector:h,useMemoizedResult:f}=e;const g=(0,o.useRef)(null);return(0,o.useMemo)((()=>{if(f&&g.current)return g.current;const e=[{strokeColor:a.mF,markerType:"arrow"}];let o=null;if(h){o={...v(),editingStrokeColor:"var(--palette-blue-5)",...(0,i.omitBy)(!0===h?{}:h,i.isUndefined)};const t=d(o);for(const n of t){const{placement:t,type:r}=n,i=null!=r?r:"arrow",l=u({strokeColor:o.strokeColor,markerType:i},e),a=u({strokeColor:o.editingStrokeColor,markerType:i},e);"start"===t?(o.$markerStartUrl=`url(#${c}${l})`,o.$editingStartMarkerUrl=`url(#${c}${a})`):(o.$markerEndUrl=`url(#${c}${l})`,o.$editingEndMarkerUrl=`url(#${c}${a})`)}}const p=new WeakMap;for(const o of t){const t=(0,l.WW)(o),h=(0,l._m)(o);let f;if(t){var m,y;const e=null!==(m=Array.isArray(n)?s(n.find((e=>(0,r.checkIfByTransform)(e,{edge:o}))),o):null===(y=r.__secret_internals.legacyDoTransform({edge:o},n))||void 0===y?void 0:y.find((e=>(0,r.checkIfOfComputed)(e))))&&void 0!==m?m:{};f={...v(),...(0,i.omitBy)(e,i.isUndefined),...(0,i.omitBy)(o.view,i.isUndefined)},void 0===f.parallelGap&&(f.parallelGap=f.interactStrokeWidth)}else f={...v(),showEndArrow:!1,strokeColor:a.CE,...(0,i.omitBy)(o.view,i.isUndefined)};if(t||h){const n=d(f);for(const o of n){var w;const{placement:n,type:r}=o,i=null!=r?r:"arrow",l=u({strokeColor:f.strokeColor,markerType:i},e);"start"===n?f.$markerStartUrl=`url(#${c}${l})`:f.$markerEndUrl=`url(#${c}${l})`;const a=null===(w=f.overrides)||void 0===w||null===(w=w.active)||void 0===w?void 0:w.strokeColor;if(a&&a!==f.strokeColor){const t=u({strokeColor:a,markerType:i},e);"start"===n?f.$activeMarkerStartUrl=`url(#${c}${t})`:f.$activeMarkerEndUrl=`url(#${c}${t})`}if(t){var x;const t=null===(x=f.overrides)||void 0===x||null===(x=x.activeRelated)||void 0===x?void 0:x.strokeColor;if(t&&t!==f.strokeColor){const o=u({strokeColor:t,markerType:i},e);"start"===n?f.$activeRelatedMarkerStartUrl=`url(#${c}${o})`:f.$activeRelatedMarkerEndUrl=`url(#${c}${o})`}}}p.set(o,f)}}return g.current={lineConfMap:p,lineConnectorConf:o,markers:e}}),[t,n,h,c,f])}function s(e,t){var n;if(null!=e&&null!==(n=e.label)&&void 0!==n&&n.useBrick){const{label:{useBrick:n,...o},...i}=e,l=r.__secret_internals.legacyDoTransform({edge:t},{...i,label:o});return{...l,label:{...l.label,useBrick:n}}}return r.__secret_internals.legacyDoTransform({edge:t},e)}function d(e){let t=[];return e.markers?t=e.markers:(e.showStartArrow&&t.push({type:"arrow",placement:"start"}),e.showEndArrow&&t.push({type:"arrow",placement:"end"})),t}function u(e,t){let n=(0,i.findIndex)(t,e);return-1===n&&(n=t.push(e)-1),n}function v(){return{type:"straight",dashed:!1,strokeColor:a.mF,strokeWidth:a.VO,interactStrokeWidth:a.Ie,showStartArrow:a.XV,showEndArrow:a.Ub,animate:{useAnimate:!1,duration:a.Be},jumps:!1}}},7590:(e,t,n)=>{n.d(t,{m:()=>$});var o=n(8769),r=n.n(o),i=n(3373),l=n.n(i),a=n(531),c=n(1030),s=n(9126),d=n(3033),u=n(8653),v=n(7531),h=n(1921),f=n(2092);function g(e){let{edge:t,position:n,offset:o,label:i,text:a,onRendered:c,onClick:s}=e;if(!i&&!a)return null;const d=!(!n||!o);return r().createElement("foreignObject",{className:l()("line-label-container",{ready:d}),x:d?n[0]+o[0]:0,y:d?n[1]+o[1]:0,onClick:s},i?r().createElement("div",{className:"line-label label"},r().createElement(m,{edge:t,label:i,onRendered:c})):r().createElement(p,{text:a,onRendered:c}))}function p(e){let{text:t,onRendered:n}=e;const i=(0,o.useCallback)((e=>{null==n||n(e)}),[n]);return r().createElement("div",{className:"line-label text",ref:i,style:t.style},t.content)}function m(e){let{edge:t,label:n,onRendered:i}=e;const l=(0,o.useMemo)((()=>(0,h.checkIfOfComputed)(n)?n.useBrick:null),[n]),a=(0,o.useMemo)((()=>({edge:t})),[t]);(0,o.useEffect)((()=>{l||setTimeout((()=>{null==i||i(null)}))}),[i,l]),(0,o.useEffect)((()=>()=>{null==i||i(null)}),[]);const c=(0,o.useCallback)((e=>{e&&setTimeout((()=>{null==i||i(e.parentElement)}))}),[i]),s=(0,o.useCallback)((()=>{setTimeout((()=>{null==i||i(null)}))}),[i]);return l?r().createElement(f.ReactUseBrick,{refCallback:c,ignoredCallback:s,useBrick:l,data:a}):null}var y=n(9386);function w(e){var t,n,i,a,h,f,p;let{edge:m,lineConfMap:w,editableLineMap:x,readOnly:k,active:E,activeRelated:b,onSwitchActiveTarget:M}=e;const C=(0,o.useRef)(null),I=w.get(m),{points:L,jumpsMap:S}=null!==(t=x.get(m))&&void 0!==t?t:{},N=(0,o.useMemo)((()=>(0,u.S)(L,"curve"===I.type?I.curveType:"curveLinear",0,1,S)),[I,L,S]),z=(0,o.useMemo)((()=>(0,c.uniqueId)("line-mask-")),[]),[P,R]=(0,o.useState)(null),[A,T]=(0,o.useState)(null),[H,W]=(0,o.useState)(null),j=(0,o.useCallback)((()=>{const e=C.current,{label:t,text:n}=I;if(e&&L&&(t||n)){var o,r;const i=null!==(o=t?t.placement:n.placement)&&void 0!==o?o:"center",l=null!==(r=t?t.offset:n.offset)&&void 0!==r?r:0,a=e.getTotalLength(),c=a/2,s=e.getPointAtLength("start"===i?0:"end"===i?a:c+l);let d="center",u=0;if("start"===i||"end"===i){let e,t;"start"===i?(e=L[0],t=L[1]):(e=L[L.length-1],t=L[L.length-2]),u=Math.atan2(t.y-e.y,t.x-e.x),d=Math.abs(e.x-t.x)>Math.abs(e.y-t.y)?e.x>t.x?"left":"right":e.y>t.y?"top":"bottom"}R([s.x,s.y,d,u,l]);const v=e.getBBox();W({x:v.x-1e3,y:v.y-1e3,width:v.width+2e3,height:v.height+2e3})}}),[I,L]),[D,B]=(0,o.useState)(null),Z=(0,o.useCallback)((e=>{if(C.current=e,e){var t,n,o;B(null!==(t=null===(n=e.getTotalLength)||void 0===n?void 0:n.call(e))&&void 0!==t?t:100);const r=null===(o=e.getBBox)||void 0===o?void 0:o.call(e);m.view={...m.view,x:null==r?void 0:r.x,y:null==r?void 0:r.y,width:null==r?void 0:r.width,height:null==r?void 0:r.height}}j()}),[j,m]),[$,O]=(0,o.useState)(null);(0,o.useEffect)((()=>{if(!$)return void T(null);const e=new s.A((()=>{const{offsetWidth:e,offsetHeight:t}=$;T(0!==e&&0!==t?[e,t]:null)}));return e.observe($),()=>{e.disconnect()}}),[$]);const V=(0,o.useCallback)((e=>{O(e)}),[]);(0,o.useEffect)((()=>{j()}),[j,L]);const G=(0,o.useCallback)((()=>{null==M||M((0,y.P)(m))}),[m,M]),U=(0,o.useCallback)((e=>{var t,n;!k&&I.callLabelOnDoubleClick&&(e.preventDefault(),e.stopPropagation(),null==$||null===(t=$.firstElementChild)||void 0===t||null===(n=t[I.callLabelOnDoubleClick])||void 0===n||n.call(t))}),[$,I,k]),[Y,X]=(0,o.useMemo)((()=>function(e,t){if(!e||!t)return[null,null];const[n,o,r,i,l]=e,[a,c]=t,s=n-a/2-3,d=o-c/2-3;let u=0,v=0;const h=a/2+3,f=c/2+3;switch(r){case"top":u=l*Math.cos(i)-f/Math.tan(i),v=l*Math.sin(i)-f;break;case"bottom":u=l*Math.cos(i)+f/Math.tan(i),v=l*Math.sin(i)+f;break;case"left":u=l*Math.cos(i)-h,v=l*Math.sin(i)-h*Math.tan(i);break;case"right":u=l*Math.cos(i)+h,v=l*Math.sin(i)+h*Math.tan(i)}return[{left:s+u,top:d+v,width:a+6,height:c+6},[u,v]]}(P,A)),[P,A]),F=(0,o.useMemo)((()=>{if(!Y||!H)return null;const e=H.x+H.width,t=H.y+H.height,n=Y.left+Y.width,o=Y.top+Y.height;return[[Y.left,o],[n,o],[n,Y.top],[Y.left,Y.top],[Y.left,H.y],[e,H.y],[e,t],[H.x,t],[H.x,H.y],[Y.left,H.y]].map((e=>e.join(","))).join(" ")}),[H,Y]);if(!N)return null;let Q,J,_,K,q;const ee=(0,v.I)(I);if(E){var te,ne,oe;const e=null===(te=I.overrides)||void 0===te?void 0:te.active;_=null!==(ne=null==e?void 0:e.strokeColor)&&void 0!==ne?ne:I.strokeColor,K=null!==(oe=null==e?void 0:e.strokeWidth)&&void 0!==oe?oe:I.strokeWidth,q=null==e?void 0:e.motion;for(const e of ee){var re,ie;"start"===e.placement?Q=null!==(re=I.$activeMarkerStartUrl)&&void 0!==re?re:I.$markerStartUrl:J=null!==(ie=I.$activeMarkerEndUrl)&&void 0!==ie?ie:I.$markerEndUrl}}else if(b){var le,ae,ce;const e=null===(le=I.overrides)||void 0===le?void 0:le.activeRelated;_=null!==(ae=null==e?void 0:e.strokeColor)&&void 0!==ae?ae:I.strokeColor,K=null!==(ce=null==e?void 0:e.strokeWidth)&&void 0!==ce?ce:I.strokeWidth,q=null==e?void 0:e.motion;for(const e of ee){var se,de;"start"===e.placement?Q=null!==(se=I.$activeRelatedMarkerStartUrl)&&void 0!==se?se:I.$markerStartUrl:J=null!==(de=I.$activeRelatedMarkerEndUrl)&&void 0!==de?de:I.$markerEndUrl}}else{_=I.strokeColor,K=I.strokeWidth;for(const e of ee)"start"===e.placement?Q=I.$markerStartUrl:J=I.$markerEndUrl}let ue,ve;if("dot"===(null===(n=q)||void 0===n?void 0:n.shape)){const e=null==q.size?2*K:q.size/2;ue=`M 0,${-e} A ${e},${e} 0,1,1 0,${e} A ${e},${e} 0,1,1 0,${-e} z`}else if("triangle"===(null===(i=q)||void 0===i?void 0:i.shape)){const e=null==q.size?2*K:q.size/2,t=e/Math.sqrt(3);ue=`M ${-t},${e} v ${2*-e} L ${2*t},0 z`}var he,fe;D&&(ve=D/(null!==(he=null===(fe=q)||void 0===fe?void 0:fe.speed)&&void 0!==he?he:d.Jo)+"s");const ge=[null===(a=I.overrides)||void 0===a||null===(a=a.active)||void 0===a||null===(a=a.motion)||void 0===a?void 0:a.shape,null===(h=I.overrides)||void 0===h||null===(h=h.activeRelated)||void 0===h||null===(h=h.motion)||void 0===h?void 0:h.shape].some((e=>"dot"===e||"triangle"===e)),pe=F?`url(#${z})`:void 0;return r().createElement(r().Fragment,null,F&&r().createElement("defs",null,r().createElement("clipPath",{id:z},r().createElement("polygon",{points:F}))),r().createElement("g",{className:"line-group",onDoubleClick:U},r().createElement("path",{d:N,fill:"none",stroke:"transparent",strokeWidth:I.interactStrokeWidth,clipPath:pe}),r().createElement("path",{ref:Z,className:l()("line",{dashed:I.dashed,dotted:I.dotted,[(I.dashed?"dashed":I.dotted?"dotted":"solid")+"-animation"]:I.animate.useAnimate}),clipPath:pe,style:{"--time":`${null!==(f=I.animate.duration)&&void 0!==f?f:d.Be}s`,"--solid-length":D},d:N,fill:"none",stroke:_,strokeWidth:K,markerStart:Q,markerEnd:J}),!(null!==(p=I.overrides)&&void 0!==p&&p.active)&&r().createElement("path",{className:"line-active-bg",d:N,fill:"none",clipPath:pe}),ge&&ve&&r().createElement("path",{className:l()("motion",{visible:!!ue}),d:ue,fill:_},r().createElement("animateMotion",{dur:ve,repeatCount:"indefinite",rotate:"auto",path:N}))),r().createElement(g,{edge:m,position:P,offset:X,label:I.label,text:I.text,onClick:G,onRendered:V}))}var x=n(9575);function k(e){let{x:t,y:n}=e;return r().createElement("g",{transform:`translate(${t}, ${n}) scale(0.0234375)`,className:"lock-icon"},r().createElement("path",{d:"M144 144l0 48 160 0 0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192l0-48C80 64.5 144.5 0 224 0s144 64.5 144 144l0 48 16 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256c0-35.3 28.7-64 64-64l16 0z",fill:"var(--color-secondary-text)",stroke:"none"}))}function E(e){var t;let{node:n,x:i,y:l,degraded:a,degradedNodeLabel:d,defaultNodeBricks:u,locked:v,containerLocked:g,groupLocked:p,onResize:m}=e;const y=function(e){const[t,n]=(0,o.useState)(e);return(0,o.useEffect)((()=>{n((t=>(0,c.isEqual)(t,e)?t:e))}),[e]),t}({node:{id:n.id,data:n.data,locked:!!v}}),w=n.useBrick,E=n.component,b=(0,o.useRef)(null),{useBrick:M,component:C}=null!==(t=(0,o.useMemo)((()=>a?null:w?{useBrick:w}:E?{component:E}:null==u?void 0:u.find((e=>(0,h.checkIfByTransform)(e,y)))),[u,a,y,E,w]))&&void 0!==t?t:{},I=(0,o.useMemo)((()=>a?String(h.__secret_internals.legacyDoTransform(y,null!=d?d:"<% DATA.node.id %>")):""),[a,d,y]),L=(0,o.useRef)(null),S=(0,o.useRef)(i),N=(0,o.useRef)(l),z=(0,o.useCallback)((e=>{L.current=e;const t=b.current;t&&(t.disconnect(),b.current=null),e?(null!=S.current&&null!=N.current&&(e.style.left=`${S.current}px`,e.style.top=`${N.current}px`),setTimeout((()=>{const t=new s.A((()=>{m(n.id,[e.offsetWidth,e.offsetHeight])}));t.observe(e),b.current=t}))):m(n.id,null)}),[n.id,m]);(0,o.useEffect)((()=>{S.current=i,N.current=l;const e=L.current;e&&null!=i&&null!=l&&(e.style.top=`${l}px`,e.style.left=`${i}px`)}),[i,l]);const P=(0,o.useCallback)((e=>{if(e){const t=e.getBBox();m(n.id,[t.width,t.height])}else m(n.id,null)}),[n.id,m]),R=(0,o.useRef)(null);return(0,o.useEffect)((()=>{const e=R.current;if(!e||!/firefox/i.test(navigator.userAgent))return;e.style.overflow="hidden";const t=setTimeout((()=>{e.style.overflow="visible"}),500);return()=>clearTimeout(t)}),[]),r().createElement(r().Fragment,null,M||C?r().createElement("foreignObject",{width:9999,height:9999,className:"node",ref:R},C?r().createElement(C,(0,x.A)({},y,{refCallback:z})):r().createElement(f.ReactUseBrick,{useBrick:M,data:y,refCallback:z})):a?r().createElement("g",{className:"degraded",ref:P},r().createElement("circle",{cx:8,cy:8,r:8}),r().createElement("text",{x:8,y:32},I)):null,v&&![g,p].some(Boolean)&&null!=i&&null!=l&&r().createElement(k,{x:i+n.view.width+4,y:l+n.view.height-12}))}const b=["center","top","bottom","left","right"];function M(e,t){const n={};for(const i of null!==(o=null==t||null===(r=t.split(/\s+/g))||void 0===r?void 0:r.flatMap((e=>"all"===e?b:e)))&&void 0!==o?o:[]){var o,r;let t;const l=e.x+e.width/2,a=e.y+e.height/2;switch(i){case"center":t=[l,a];break;case"top":t=[l,e.y];break;case"right":t=[e.x+e.width,a];break;case"bottom":t=[l,e.y+e.height];break;case"left":t=[e.x,a];break;default:throw new Error(`Unknown snap position: "${i}"`)}n[i]=t}return n}var C=n(8944),I=n(8185),L=n(4197);const S=["left","center","right"],N=["top","center","bottom"];function z(e,t){var n;let{action:o,cell:r,scale:i,layout:l,layoutOptions:s,activeTarget:u,cells:v,onCellsMoving:h,onCellsMoved:f,onCellResizing:g,onCellResized:p,onSwitchActiveTarget:m,updateCurActiveEditableLine:w}=t;if(e.stopPropagation(),2===e.button||0===e.button&&e.ctrlKey)return;const x=(0,L.Q)(r,u),k=(0,C.E)(v);let E=!1;if(e.shiftKey){const e=u?"multi"===(null==u?void 0:u.type)?u.targets:[u]:[];let t=[];x?t=e.filter((e=>!(0,I.c)(e,r))):(t=[...e,r],E=!0),null==m||m(t.length>0?{type:"multi",targets:t}:null)}else"resize"!==o&&x||(null==m||m((0,y.P)(r)),E=!0);if((0,C.l)(r,k))return;if(E&&((0,a.WW)(r)||(0,a._m)(r))&&(null==w||w(r)),(0,a.WW)(r))return;const b=[],z="multi"===(null==u?void 0:u.type)&&"move"===o?v.filter((e=>(0,L.Q)(e,u))):[r];z.forEach((e=>{if(b.push(e),"move"===o){if((0,a.t2)(e)){const t=(0,c.map)(v.filter((t=>(0,a.dS)(t)&&t.containerId===e.id)),"id"),n=v.filter((n=>((0,a.N)(n)||(0,a.dS)(n))&&n.containerId===e.id&&!z.includes(n)||(0,a.N)(n)&&t.includes(null==n?void 0:n.groupId)));b.push(...n)}(0,a.dS)(e)&&b.push(...v.filter((t=>(0,a.N)(t)&&t.groupId===e.id&&!z.includes(t))))}}));const P="force"===l||"dagre"===l,R=b.filter((e=>!(0,C.l)(e,k)&&((0,a.N)(e)&&!P||(0,a.mH)(e))));if(0===R.length)return;const A=function(e){var t,n,o;const r=e?!0===e?{grid:!0,object:!0}:e:null,i=null!=r&&r.grid?!0===r.grid?{}:r.grid:null,l=null!=r&&r.object?!0===r.object?{}:r.object:null;return{grid:i?{size:null!==(t=i.size)&&void 0!==t?t:d.gx}:null,object:l?{distance:null!==(n=l.distance)&&void 0!==n?n:d.ld,positions:null!==(o=l.positions)&&void 0!==o?o:d.o5}:null}}(null==s?void 0:s.snap),T=null===(n=A.object)||void 0===n?void 0:n.positions,H=[e.clientX,e.clientY],W=R.map((e=>({cell:e,position:"move"===o?[e.view.x,e.view.y]:[e.view.width,e.view.height],snapPositions:"move"!==o||(0,a.WW)(e)?null:M(e.view,T)}))),j=W[0].position;let D=[];if("move"===o&&A.object){const e=v.filter((e=>!(0,a.WW)(e)&&!(0,a._m)(e)&&!b.includes(e)));D=e.map((e=>({cell:e,snapPositions:M(e.view,T)})))}let B=!1;const Z=(e,t)=>{const n=function(e){return[(e.clientX-H[0])/i,(e.clientY-H[1])/i]}(e),l=[...n];let c,s,d,u,v;if(B||(B=n[0]**2+n[1]**2>=9),!A.grid&&!A.object||e.altKey)c=W.map((e=>{let{position:t}=e;return[t[0]+n[0],t[1]+n[1]]}));else{let e=1/0,t=1/0;if(A.object){const o=A.object.distance;let r,i,a,c,h=0,f=0;for(const{cell:s,snapPositions:d}of D)for(const{cell:g,snapPositions:p}of W)for(const[m,y]of Object.entries(p)){const p=S.includes(m),w=N.includes(m),[x,k]=d[m],[E,b]=y;if(p){const t=Math.abs(E+n[0]-x);t<o&&t<e&&(e=t,l[0]=x-E,u=g,a=s,r=[x,k],h=b)}if(w){const e=Math.abs(b+n[1]-k);e<o&&e<t&&(t=e,l[1]=k-b,v=g,c=s,i=[x,k],f=E)}}if(a&&a===c){const e=a.view.height/2,t=a.view.width/2;s=[[r[0],r[1]-e],[r[0],r[1]+e]],d=[[i[0]-t,i[1]],[i[0]+t,i[1]]]}else r&&(s=[r,[r[0],h+l[1]]]),i&&(d=[i,[f+l[0],i[1]]])}if(A.grid){const o=A.grid.size,r=[Math.round((j[0]+n[0])/o)*o,Math.round((j[1]+n[1])/o)*o],i=[r[0]-j[0],r[1]-j[1]],a=Math.abs(i[0]-n[0]),c=Math.abs(i[1]-n[1]);a<e&&(e=a,l[0]=i[0],s=void 0,u=void 0),c<t&&(t=c,l[1]=i[1],d=void 0,v=void 0)}c=W.map((e=>{let{position:t}=e;return[t[0]+l[0],t[1]+l[1]]}))}if(B)if("move"===o){var m;const e=W.map(((e,n)=>{var o;let{cell:r}=e;return{type:r.type,id:r.id,x:c[n][0],y:c[n][1],groupId:r.groupId,containerId:r.containerId,width:r.view.width,height:r.view.height,decorator:(0,a.mH)(r)?r.decorator:void 0,guideLines:t?void 0:[...u===r?[s]:[],...v===r?[d]:[]],...(0,a._m)(r)?{source:{x:r.view.source.x+l[0],y:r.view.source.y+l[1]},target:{x:r.view.target.x+l[0],y:r.view.target.y+l[1]},vertices:null===(o=r.view.vertices)||void 0===o?void 0:o.map((e=>({x:e.x+l[0],y:e.y+l[1]})))}:null}}));null===(m=t?f:h)||void 0===m||m(e)}else{var y;null===(y=t?p:g)||void 0===y||y({type:r.type,id:r.id,width:c[0][0],height:c[0][1]})}},$=e=>{Z(e)},O=e=>{Z(e,!0),B=!1,document.removeEventListener("mousemove",$),document.removeEventListener("mouseup",O)};document.addEventListener("mousemove",$),document.addEventListener("mouseup",O)}let P;function R(e){return e?function(){if("boolean"!=typeof P){const e=document.createElement("div");e.setAttribute("contenteditable","PLAINTEXT-ONLY"),P="plaintext-only"===e.contentEditable}return P}()?"plaintext-only":"true":"false"}function A(e){const t=document.createRange();t.selectNodeContents(e);const n=window.getSelection();n.removeAllRanges(),n.addRange(t)}var T=n(9068),H=n(1744),W=n(1839);const j=new Map([["group",function(e){var t;let{cell:n,view:i,activeTarget:a,cells:c,locked:s,onDecoratorGroupPlusClick:d}=e;const u=(0,o.useMemo)((()=>(0,W.Gd)(n,a,c)),[a,n,c]);return r().createElement("g",{className:l()("decorator-group",{"active-group":u})},r().createElement("foreignObject",{className:"group-wrapper",width:n.view.width+10,height:n.view.height+10},r().createElement("div",{className:"group",style:{...null===(t=n.view)||void 0===t?void 0:t.style,width:n.view.width,height:n.view.height}},i.usePlus&&r().createElement(H.A,{className:"plus-icon",onClick:()=>null==d?void 0:d(n)}))),s&&r().createElement(k,{x:n.view.width-16,y:n.view.height-16}))}],["container",function(e){let{cell:t,transform:n,readOnly:i,layout:s,view:d,activeTarget:u,cells:v,locked:h,onCellResizing:f,onCellResized:g,onSwitchActiveTarget:p,onDecoratorTextEditing:m,onDecoratorTextChange:y}=e;const w=(0,c.get)(t.view,"text",""),x=(0,c.get)(t.view,"direction","top"),E=(0,o.useRef)(null),b=r().useRef(null),[M,C]=(0,o.useState)(!1),[I,L]=(0,o.useState)(w),[S,N]=(0,o.useState)(!1),[P,H]=(0,o.useState)(),[W,j]=(0,o.useState)({x:0,y:0,width:t.view.width,height:t.view.height}),D=(0,o.useMemo)((()=>{let e=[],n=!1;"multi"===(null==u?void 0:u.type)?e=u.targets:"node"===(null==u?void 0:u.type)&&e.push(u);const o=t.view.x,r=t.view.x+t.view.width,i=t.view.y,l=t.view.y+t.view.height;return n=e.some((e=>{if("node"===(null==e?void 0:e.type)||"decorator"===e.type){const t=v.find((t=>("node"===(null==t?void 0:t.type)||"decorator"===t.type)&&t.id===e.id));if(t){const e=t.view.x,n=t.view.x+t.view.width,a=t.view.y,c=t.view.y+t.view.height;return e>=o&&n<=r&&a>=i&&c<=l}}})),n}),[u,t,v]),B=(0,o.useCallback)((e=>{i||h||(e.preventDefault(),e.stopPropagation(),C(!0))}),[i,h]),Z=(0,o.useCallback)((e=>{i||L(e.target.textContent)}),[i]),$=(0,o.useCallback)((()=>{i||(C(!1),N(!0),H((0,T.uuidV4)()))}),[i]);return(0,o.useEffect)((()=>{L(w)}),[w]),(0,o.useEffect)((()=>{const e=E.current;e&&e.textContent!==I&&(e.textContent=I)}),[I]),(0,o.useEffect)((()=>{var e;const t=null===(e=E.current)||void 0===e?void 0:e.parentElement;if(!t)return;const n=new ResizeObserver((()=>{const{clientWidth:e,clientHeight:n}=t;["left","right"].includes(x)?j({width:e,height:d.height,x:"left"===x?-e:d.width,y:0}):j({width:d.width,height:n,x:0,y:"top"===x?-n:d.height})}));return n.observe(t),()=>n.disconnect()}),[d,I,x,P]),(0,o.useEffect)((()=>{M&&E.current&&(E.current.focus(),A(E.current)),null==m||m({id:t.id,editing:M})}),[t.id,M,m]),(0,o.useEffect)((()=>{S&&(null==y||y({id:t.id,view:{...d,text:I}}),N(!1))}),[t,d,I,y,S]),(0,o.useEffect)((()=>{const e=b.current;if(!e||i)return;const o=e=>{z(e,{action:"resize",cell:t,scale:n.k,activeTarget:u,cells:v,onCellResizing:f,onCellResized:g,onSwitchActiveTarget:p})};return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[u,t,v,g,f,p,i,n.k]),r().createElement("g",{className:"decorator-container"},r().createElement("foreignObject",W,r().createElement("div",{className:l()("text-container",{editing:M,[["left","right"].includes(x)?"vertical":"horizontal"]:!0}),onDoubleClick:B,style:t.view.titleStyle},r().createElement("div",{className:"text",contentEditable:R(M),ref:E,onInput:Z,onBlur:$}))),r().createElement("foreignObject",{x:0,y:0,width:d.width,height:d.height,className:"container-wrapper"},r().createElement("div",{className:l()("container",{"active-container":D}),style:{...t.view.style,width:d.width,height:d.height}})),!i&&!h&&!(0,a.OD)(s)&&r().createElement("g",{ref:b,className:"resize-handle",transform:`translate(${d.width-20} ${d.height-20})`},r().createElement("rect",{width:20,height:20}),r().createElement("path",{d:"M10 18L18 10 M15 18L18 15"})),h&&r().createElement(k,{x:t.view.width-16,y:t.view.height-16}))}],["area",function(e){let{cell:t,transform:n,readOnly:i,layoutOptions:l,activeTarget:a,cells:c,locked:s,onCellResizing:d,onCellResized:u,onSwitchActiveTarget:v}=e;const h=r().useRef(null);return(0,o.useEffect)((()=>{const e=h.current;if(!e||i)return;const o=e=>{z(e,{action:"resize",cell:t,scale:n.k,layoutOptions:l,activeTarget:a,cells:c,onCellResizing:d,onCellResized:u,onSwitchActiveTarget:v})};return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[a,t,c,l,u,d,v,i,n.k]),r().createElement("g",{className:"decorator-area-container"},r().createElement("foreignObject",{className:"decorator-area",width:"9999",height:"9999"},r().createElement("div",{className:"area",style:{...t.view.style,width:t.view.width,height:t.view.height}})),!i&&!s&&r().createElement("g",{ref:h,className:"resize-handle",transform:`translate(${t.view.width-20} ${t.view.height-20})`},r().createElement("rect",{width:20,height:20}),r().createElement("path",{d:"M10 18L18 10 M15 18L18 15"})),s&&r().createElement(k,{x:t.view.width-16,y:t.view.height-16}))}],["text",function(e){var t;let{cell:n,readOnly:i,locked:a,onDecoratorTextEditing:c,onDecoratorTextChange:s}=e;const d=null!==(t=n.view.text)&&void 0!==t?t:"",[u,v]=(0,o.useState)(d),[h,f]=(0,o.useState)(!1),g=(0,o.useRef)(!1),[p,m]=(0,o.useState)(!1),y=(0,o.useRef)(null),w=(0,o.useCallback)((e=>{i||a||(e.preventDefault(),e.stopPropagation(),f(!0))}),[i,a]);(0,o.useEffect)((()=>{const e=y.current;e&&e.textContent!==u&&(e.textContent=u)}),[u]),(0,o.useEffect)((()=>{var e;const t=null===(e=y.current)||void 0===e?void 0:e.parentElement;t&&(n.view.width=t.clientWidth,n.view.height=t.clientHeight)}),[u,n.id]),(0,o.useEffect)((()=>{h&&y.current&&(y.current.focus(),A(y.current)),null==c||c({id:n.id,editing:h})}),[n.id,h,c]),(0,o.useEffect)((()=>{g.current?null==c||c({id:n.id,editing:h}):g.current=!0}),[n.id,h,c]);const x=(0,o.useCallback)((e=>{i||v(e.target.textContent)}),[i]),E=(0,o.useCallback)((()=>{i||(f(!1),m(!0))}),[i]);return(0,o.useEffect)((()=>{p&&(null==s||s({id:n.id,view:{...n.view,text:u}}),m(!1))}),[n,u,s,p]),r().createElement(r().Fragment,null,r().createElement("foreignObject",{className:"decorator-text",width:"9999",height:"9999"},r().createElement("div",{className:l()("text-container",{editing:h}),onDoubleClick:w,style:n.view.style},r().createElement("div",{className:"text",contentEditable:R(h),ref:y,onInput:x,onBlur:E}))),a&&r().createElement(k,{x:n.view.width,y:(n.view.height-12)/2}))}],["rect",function(e){let{cell:t,transform:n,readOnly:i,layout:l,view:c,activeTarget:s,cells:d,locked:u,onCellResizing:v,onCellResized:h,onSwitchActiveTarget:f}=e;const g=r().useRef(null);return(0,o.useEffect)((()=>{const e=g.current;if(!e||i)return;const o=e=>{z(e,{action:"resize",cell:t,scale:n.k,layout:l,activeTarget:s,cells:d,onCellResizing:v,onCellResized:h,onSwitchActiveTarget:f})};return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[s,t,d,h,v,f,i,n.k,l]),r().createElement("g",{className:"decorator-rect-container"},r().createElement("foreignObject",{className:"decorator-rect",width:"9999",height:"9999"},r().createElement("div",{className:"rect-container",style:{...t.view.style,width:c.width,height:c.height}})),!i&&!u&&!(0,a.OD)(l)&&r().createElement("g",{ref:g,className:"resize-handle",transform:`translate(${c.width-20} ${c.height-20})`},r().createElement("rect",{width:20,height:20}),r().createElement("path",{d:"M10 18L18 10 M15 18L18 15"})),u&&r().createElement(k,{x:t.view.width-16,y:t.view.height-16}))}],["line",function(e){var t;let{cell:n,active:i,lineConfMap:a,editableLineMap:c,locked:s}=e;const d=a.get(n),{points:h,jumpsMap:f}=null!==(t=c.get(n))&&void 0!==t?t:{},g=(0,o.useMemo)((()=>d?(0,u.S)(h,"curve"===d.type?d.curveType:"curveLinear",0,1,f):null),[d,h,f]),p=(0,o.useRef)(null),m=(0,o.useCallback)((e=>{if(p.current=e,e){const t=e.getBBox();n.view={...n.view,x:t.x,y:t.y,width:t.width,height:t.height}}}),[n]),y=(0,o.useMemo)((()=>s&&h?function(e){const t=e[e.length-1];if(e.length<2)return{x:t.x+16,y:t.y-6};const n=e[0],o=t.y-n.y,r=t.x-n.x;let i;i=Math.abs(o)>Math.abs(r)?o>0:r>0;const l=i?e[e.length-2]:e[1],a=i?t:n,c=Math.atan2(a.y-l.y,a.x-l.x)-3*Math.PI/4;return{x:a.x+16*Math.cos(c)-6,y:a.y+16*Math.sin(c)-6}}(h):null),[s,h]);if(!g||!d)return null;let w,x,E,b;const M=(0,v.I)(d);if(i){var C,I,L;const e=null===(C=d.overrides)||void 0===C?void 0:C.active;E=null!==(I=null==e?void 0:e.strokeColor)&&void 0!==I?I:d.strokeColor,b=null!==(L=null==e?void 0:e.strokeWidth)&&void 0!==L?L:d.strokeWidth;for(const e of M){var S,N;"start"===e.placement?w=null!==(S=d.$activeMarkerStartUrl)&&void 0!==S?S:d.$markerStartUrl:x=null!==(N=d.$activeMarkerEndUrl)&&void 0!==N?N:d.$markerEndUrl}}else{E=d.strokeColor,b=d.strokeWidth;for(const e of M)"start"===e.placement?w=d.$markerStartUrl:x=d.$markerEndUrl}return r().createElement("g",{className:"decorator-line"},r().createElement("path",{d:g,fill:"none",stroke:"transparent",strokeWidth:d.interactStrokeWidth}),r().createElement("path",{className:l()("line",{dashed:d.dashed,dotted:d.dotted}),ref:m,d:g,fill:"none",stroke:E,strokeWidth:b,markerStart:w,markerEnd:x}),s&&r().createElement(k,{x:y.x,y:y.y}))}]]);function D(e){let{cell:t,view:n,transform:o,readOnly:i,layout:l,layoutOptions:a,active:c,activeTarget:s,cells:d,lineConfMap:u,editableLineMap:v,locked:h,onCellResizing:f,onCellResized:g,onSwitchActiveTarget:p,onDecoratorTextEditing:m,onDecoratorTextChange:y,onDecoratorGroupPlusClick:w}=e;const x=j.get(t.decorator);return x?r().createElement(x,{cell:t,view:n,transform:o,readOnly:i,layout:l,layoutOptions:a,active:c,activeTarget:s,cells:d,lineConfMap:u,editableLineMap:v,locked:h,onCellResizing:f,onCellResized:g,onSwitchActiveTarget:p,onDecoratorTextEditing:m,onDecoratorTextChange:y,onDecoratorGroupPlusClick:w}):(console.error(`Unknown decorator: ${t.decorator}`),null)}var B=n(9940),Z=n(9978);function $(e){var t,n;let{layout:i,layoutOptions:s,cell:d,cells:u,degraded:v,degradedNodeLabel:h,defaultNodeBricks:f,lineConfMap:g,editableLineMap:p,activeTarget:m,dragoverContainer:x,readOnly:k,transform:b,hoverCell:M,unrelatedCells:C,allowEdgeToArea:S,curActiveEditableLine:N,locked:P,containerLocked:R,groupLocked:A,updateCurActiveEditableLine:T,onCellsMoving:H,onCellsMoved:j,onCellResizing:$,onCellResized:O,onSwitchActiveTarget:V,onCellContextMenu:G,onCellClick:U,onDecoratorTextEditing:Y,onDecoratorTextChange:X,onDecoratorGroupPlusClick:F,onNodeBrickResize:Q,onCellMouseEnter:J,onCellMouseLeave:_}=e;const{lineEditorState:K,smartConnectLineState:q,setSmartConnectLineState:ee,onConnect:te,setLineEditorState:ne,onChangeEdgeView:oe}=(0,Z.s)(),re=(0,o.useRef)(null),ie=(0,o.useMemo)((()=>C.some((e=>(0,I.c)(e,d)))),[d,C]),le=(0,o.useMemo)((()=>{if((0,a.t2)(d)&&(0,a.OD)(i)){const e=u.filter((e=>(0,a.N)(e)&&e.containerId===d.id)),t={...d.view,...(0,B.x)(e)};return d.view=t,t}if((0,a.dS)(d)&&(0,W.Gd)(d,m,u)){const e=u.filter((e=>"node"===e.type&&e.groupId===d.id)),t={...d.view,...(0,B.x)(e,{padding:W.XV})};return d.view=t,t}return(0,a.WW)(d)||(0,a._m)(d)?void 0:(0,c.get)(d,"view",{x:0,y:0,width:0,height:0})}),[i,d,u,m]);(0,o.useEffect)((()=>{const e=re.current;if(!e)return;const t=e=>{k||[(0,a.t2)(d),(0,a.dS)(d)].some(Boolean)&&(0,a.OD)(i)?e.stopPropagation():z(e,{layout:i,layoutOptions:s,action:"move",cell:d,scale:b.k,activeTarget:m,cells:u,onCellsMoving:H,onCellsMoved:j,onSwitchActiveTarget:V,updateCurActiveEditableLine:T})};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}}),[i,s,d,m,u,j,H,V,T,k,b.k]),(0,o.useEffect)((()=>{const e=re.current;if(!e||!(0,a.bo)(d,S)||!(q||K&&"control"!==K.type))return;const t=e=>{if(!N||!K||"decorator"!==N.type)if(e.preventDefault(),e.stopPropagation(),q)q.source!==d&&(null==te||te(q.source,d,q.exitPosition,void 0)),ee(null);else if(N&&K){const{type:e}=K,{source:t,target:n}=p.get(N),{view:o}=N,r="entry"===e;(r?n:t)===d&&(r?null==oe||oe(t,n,{...o,entryPosition:null}):null==oe||oe(t,n,{...o,exitPosition:null})),ne(null)}};return e.addEventListener("mouseup",t),()=>{e.removeEventListener("mouseup",t)}}),[N,p,S,d,K,oe,te,ne,ee,q,T]);const ae=(0,o.useCallback)((e=>{if(k&&"decorator"===d.type)return;e.preventDefault(),e.stopPropagation();let t=m;(0,L.Q)(d,m)||(t=(0,y.P)(d),V(t)),G({cell:d,clientX:e.clientX,clientY:e.clientY,locked:P,target:t})}),[k,d,m,G,P,V]),ce=(0,o.useCallback)((e=>{U&&"decorator"!==d.type&&U({cell:d,clientX:e.clientX,clientY:e.clientY,locked:P})}),[d,U,P]),se=(0,o.useCallback)((()=>{null==J||J(d)}),[d,J]),de=(0,o.useCallback)((()=>{null==_||_(d)}),[d,_]),ue=(0,L.Q)(d,m);return r().createElement("g",{className:l()("cell",{active:ue,faded:ie,"read-only":k,"container-dragover":x}),ref:re,transform:(0,a.N)(d)&&!v||(0,a.WW)(d)||(0,a._m)(d)||null==(null===(t=d.view)||void 0===t?void 0:t.x)||null==(null===(n=d.view)||void 0===n?void 0:n.y)?void 0:`translate(${le.x},${le.y})`,onContextMenu:ae,onClick:ce,onMouseEnter:se,onMouseLeave:de},(0,a.N)(d)?r().createElement(E,{node:d,x:null==le?void 0:le.x,y:null==le?void 0:le.y,degraded:v,degradedNodeLabel:h,defaultNodeBricks:f,locked:P,containerLocked:R,groupLocked:A,onResize:Q}):(0,a.WW)(d)?r().createElement(w,{edge:d,active:k?M===d:ue,activeRelated:!!(k?M:m)&&!ie,lineConfMap:g,editableLineMap:p,readOnly:k,onSwitchActiveTarget:V}):(0,a.mH)(d)?r().createElement(D,{cell:d,view:le,transform:b,readOnly:k,layout:i,layoutOptions:s,active:ue,activeTarget:m,cells:u,lineConfMap:g,editableLineMap:p,locked:P,onCellResizing:$,onCellResized:O,onSwitchActiveTarget:V,onDecoratorTextEditing:Y,onDecoratorTextChange:X,onDecoratorGroupPlusClick:F}):null)}},8091:(e,t,n)=>{n.d(t,{f:()=>v});var o,r,i,l=n(8769),a=n(7566),c=n(9047),s=n(3033);const d=/mac/i.test(null!==(o=null!==(r=null===(i=navigator.userAgentData)||void 0===i?void 0:i.platform)&&void 0!==r?r:navigator.platform)&&void 0!==o?o:navigator.userAgent);function u(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey&&d?10:1)}function v(e){let{rootRef:t,zoomable:n,scrollable:o,pannable:r,draggable:i,ctrlDraggable:d,scaleRange:v,onSwitchActiveTarget:h}=e;const[f,g]=(0,l.useState)(!1),[p,m]=(0,l.useState)({k:1,x:0,y:0}),y=(0,l.useMemo)((()=>null!=v?v:[s.sS,s.Yt]),[v]),w=(0,l.useMemo)((()=>(0,c.s_)().wheelDelta(u)),[]);return(0,l.useEffect)((()=>{let e=!1;w.scaleExtent(n?y:[1,1]).on("start",(()=>{e=!1,g(!0)})).on("zoom",(t=>{e=!0,m(t.transform)})).on("end",(()=>{g(!1),e||null==h||h(null)})).filter((e=>("wheel"===e.type?e.ctrlKey:d?i||e.ctrlKey:!e.ctrlKey)&&!e.button))}),[h,y,n,w,d,i]),(0,l.useEffect)((()=>{if(d){const e=e=>{e.ctrlKey&&e.preventDefault()};return document.addEventListener("contextmenu",e,!0),()=>{document.removeEventListener("contextmenu",e,!0)}}}),[d]),(0,l.useEffect)((()=>{const e=t.current;if(!e)return;const l=(0,a.A)(e),c=()=>{l.on(".zoom",null).on(".zoom.custom",null).on("wheel",null)};if(n||o||r)return(n||o)&&l.on("wheel.zoom.custom",(e=>{!e.ctrlKey&&o&&(e.preventDefault(),w.translateBy(l,e.wheelDeltaX/5,e.wheelDeltaY/5))})),l.call(w).on("wheel",(e=>{(o||n&&e.ctrlKey)&&e.preventDefault()})).on("dblclick.zoom",null),(i||d)&&r||l.on("mousedown.zoom",null),r||l.on("touchstart.zoom",null).on("touchmove.zoom",null).on("touchend.zoom",null),c;c()}),[d,i,r,t,o,n,w]),{grabbing:f,transform:p,zoomer:w,scaleRange:y}}},8185:(e,t,n)=>{function o(e,t){return e?!!t&&e.type===t.type&&("multi"===e.type?e.targets.length===t.targets.length&&e.targets.every((e=>t.targets.some((t=>o(e,t))))):"node"===e.type||"decorator"===e.type?e.id===t.id:e.source===t.source&&e.target===t.target):!t}n.d(t,{c:()=>o})},8197:(e,t,n)=>{n.d(t,{H:()=>l});var o=n(8769),r=n(531),i=n(3033);function l(e){let{cells:t,layout:n,centered:l}=e;return(0,o.useMemo)((()=>l&&t.every((e=>!(0,r.N)(e)||e[i.CV]&&("force"!==n&&"dagre"!==n||e[i.xc])))),[t,l,n])}},8875:(e,t,n)=>{n.d(t,{G:()=>l,X:()=>i});const o=[{x:0,y:0,d:["top","left"]},{x:.5,y:0,d:["top"]},{x:1,y:0,d:["top","right"]},{x:0,y:.5,d:["left"]},{x:1,y:.5,d:["right"]},{x:0,y:1,d:["bottom","left"]},{x:.5,y:1,d:["bottom"]},{x:1,y:1,d:["bottom","right"]}],r=o.map((e=>({x:e.x,y:e.y})));function i(){return o}function l(){return r}},8944:(e,t,n)=>{n.d(t,{E:()=>r,l:()=>i});var o=n(531);function r(e){return e.filter((e=>{var t,n;return(null===(t=e.view)||void 0===t?void 0:t.locked)&&(0,o.t2)(e)||(null===(n=e.view)||void 0===n?void 0:n.locked)&&(0,o.dS)(e)})).map((e=>e.id))}function i(e,t){var n;return(null===(n=e.view)||void 0===n?void 0:n.locked)||!(!(0,o.N)(e)&&!(0,o.dS)(e)||!e.containerId||null==t||!t.includes(e.containerId))||!!((0,o.N)(e)&&e.groupId&&null!=t&&t.includes(e.groupId))}},9127:(e,t,n)=>{n.d(t,{C:()=>c});var o=n(1030),r=n(7586),i=n.n(r),l=n(8802),a=n(531);function c(e){let{cells:t,layoutOptions:n,allowEdgeToArea:r}=e;const{nodePadding:c,...s}={nodePadding:0,rankdir:"TB",ranksep:50,edgesep:10,nodesep:50,...(0,o.pick)(n,["nodePadding","rankdir","ranksep","edgesep","nodesep","align"])},d=(0,l.D)(c);if(!t.some(a.N))return{getNodeView:()=>null,nodePaddings:d};const u=new(i().graphlib.Graph);u.setGraph(s),u.setDefaultEdgeLabel((function(){return{}}));for(const e of t)r&&(0,a.o6)(e)||(0,a.N)(e)||(0,a.dS)(e)?u.setNode(e.id,{id:e.id,width:(0,o.get)(e,"view.width",0)+d[1]+d[3],height:(0,o.get)(e,"view.height",0)+d[0]+d[2]}):(0,a.WW)(e)&&u.setEdge(e.source,e.target);return i().layout(u),{getNodeView:e=>u.node(e),nodePaddings:d}}},9386:(e,t,n)=>{n.d(t,{P:()=>r});var o=n(1030);function r(e){return"edge"===e.type?(0,o.pick)(e,["type","source","target","data"]):(0,o.pick)(e,["type","id","data"])}},9940:(e,t,n)=>{n.d(t,{x:()=>i});var o=n(1030),r=n(3033);function i(e,t){let n=1/0,i=1/0,l=-1/0,a=-1/0;if(e.forEach((e=>{const{x:t,y:o,width:r,height:c}=e.view;t<n&&(n=t),o<i&&(i=o),t+r>l&&(l=t+r),o+c>a&&(a=o+c)})),![n,l,i,a].some((e=>isFinite(e))))return{};const c=(0,o.get)(t,"padding",r.Yl);return{x:n-c,y:i-c,width:l-n+2*c,height:a-i+2*c}}},9978:(e,t,n)=>{n.d(t,{H:()=>i,s:()=>l});var o=n(8769),r=n.n(o);const i=r().createContext({rootRef:{current:null},smartConnectLineState:null,unsetHoverStateTimeoutRef:{current:null},hoverState:null,activeEditableLines:[],lineEditorState:null,setLineEditorState:()=>{},setHoverState:()=>{},setSmartConnectLineState:()=>{}});function l(){return r().useContext(i)}}}]);
|
|
2
|
-
//# sourceMappingURL=551.fd9aaa4f.js.map
|