cullmann.io/themes/blowfish/assets/lib/mermaid/flowDiagram-f287d002.js.map

1 line
87 KiB
Plaintext

{"version":3,"file":"flowDiagram-f287d002.js","sources":["../../../node_modules/.pnpm/d3-fetch@3.0.1/node_modules/d3-fetch/src/text.js","../../../node_modules/.pnpm/d3-fetch@3.0.1/node_modules/d3-fetch/src/xml.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/arrows.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/label/add-svg-label.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/label/add-text-label.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/label/add-label.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/create-clusters.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/create-edge-labels.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/intersect/intersect-node.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/create-edge-paths.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/create-nodes.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/position-clusters.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/position-edge-labels.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/position-nodes.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/intersect/intersect-ellipse.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/intersect/intersect-circle.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/intersect/intersect-line.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/intersect/intersect-polygon.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/intersect/intersect-rect.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/shapes.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/render.js","../src/diagrams/flowchart/flowChartShapes.js","../src/diagrams/flowchart/flowRenderer.js","../src/diagrams/flowchart/flowDiagram.ts"],"sourcesContent":["function responseText(response) {\n if (!response.ok) throw new Error(response.status + \" \" + response.statusText);\n return response.text();\n}\n\nexport default function(input, init) {\n return fetch(input, init).then(responseText);\n}\n","import text from \"./text.js\";\n\nfunction parser(type) {\n return (input, init) => text(input, init)\n .then(text => (new DOMParser).parseFromString(text, type));\n}\n\nexport default parser(\"application/xml\");\n\nexport var html = parser(\"text/html\");\n\nexport var svg = parser(\"image/svg+xml\");\n","import * as util from './util.js';\n\nexport { arrows, setArrows };\n\nvar arrows = {\n normal,\n vee,\n undirected,\n};\n\nfunction setArrows(value) {\n arrows = value;\n}\n\nfunction normal(parent, id, edge, type) {\n var marker = parent\n .append('marker')\n .attr('id', id)\n .attr('viewBox', '0 0 10 10')\n .attr('refX', 9)\n .attr('refY', 5)\n .attr('markerUnits', 'strokeWidth')\n .attr('markerWidth', 8)\n .attr('markerHeight', 6)\n .attr('orient', 'auto');\n\n var path = marker\n .append('path')\n .attr('d', 'M 0 0 L 10 5 L 0 10 z')\n .style('stroke-width', 1)\n .style('stroke-dasharray', '1,0');\n util.applyStyle(path, edge[type + 'Style']);\n if (edge[type + 'Class']) {\n path.attr('class', edge[type + 'Class']);\n }\n}\n\nfunction vee(parent, id, edge, type) {\n var marker = parent\n .append('marker')\n .attr('id', id)\n .attr('viewBox', '0 0 10 10')\n .attr('refX', 9)\n .attr('refY', 5)\n .attr('markerUnits', 'strokeWidth')\n .attr('markerWidth', 8)\n .attr('markerHeight', 6)\n .attr('orient', 'auto');\n\n var path = marker\n .append('path')\n .attr('d', 'M 0 0 L 10 5 L 0 10 L 4 5 z')\n .style('stroke-width', 1)\n .style('stroke-dasharray', '1,0');\n util.applyStyle(path, edge[type + 'Style']);\n if (edge[type + 'Class']) {\n path.attr('class', edge[type + 'Class']);\n }\n}\n\nfunction undirected(parent, id, edge, type) {\n var marker = parent\n .append('marker')\n .attr('id', id)\n .attr('viewBox', '0 0 10 10')\n .attr('refX', 9)\n .attr('refY', 5)\n .attr('markerUnits', 'strokeWidth')\n .attr('markerWidth', 8)\n .attr('markerHeight', 6)\n .attr('orient', 'auto');\n\n var path = marker\n .append('path')\n .attr('d', 'M 0 5 L 10 5')\n .style('stroke-width', 1)\n .style('stroke-dasharray', '1,0');\n util.applyStyle(path, edge[type + 'Style']);\n if (edge[type + 'Class']) {\n path.attr('class', edge[type + 'Class']);\n }\n}\n","import * as util from '../util.js';\n\nexport { addSVGLabel };\n\nfunction addSVGLabel(root, node) {\n var domNode = root;\n\n domNode.node().appendChild(node.label);\n\n util.applyStyle(domNode, node.labelStyle);\n\n return domNode;\n}\n","import * as util from '../util.js';\n\nexport { addTextLabel };\n\n/*\n * Attaches a text label to the specified root. Handles escape sequences.\n */\nfunction addTextLabel(root, node) {\n var domNode = root.append('text');\n\n var lines = processEscapeSequences(node.label).split('\\n');\n for (var i = 0; i < lines.length; i++) {\n domNode\n .append('tspan')\n .attr('xml:space', 'preserve')\n .attr('dy', '1em')\n .attr('x', '1')\n .text(lines[i]);\n }\n\n util.applyStyle(domNode, node.labelStyle);\n\n return domNode;\n}\n\nfunction processEscapeSequences(text) {\n var newText = '';\n var escaped = false;\n var ch;\n for (var i = 0; i < text.length; ++i) {\n ch = text[i];\n if (escaped) {\n switch (ch) {\n case 'n':\n newText += '\\n';\n break;\n default:\n newText += ch;\n }\n escaped = false;\n } else if (ch === '\\\\') {\n escaped = true;\n } else {\n newText += ch;\n }\n }\n return newText;\n}\n","import { addHtmlLabel } from './add-html-label.js';\nimport { addSVGLabel } from './add-svg-label.js';\nimport { addTextLabel } from './add-text-label.js';\n\nexport { addLabel };\n\nfunction addLabel(root, node, location) {\n var label = node.label;\n var labelSvg = root.append('g');\n\n // Allow the label to be a string, a function that returns a DOM element, or\n // a DOM element itself.\n if (node.labelType === 'svg') {\n addSVGLabel(labelSvg, node);\n } else if (typeof label !== 'string' || node.labelType === 'html') {\n addHtmlLabel(labelSvg, node);\n } else {\n addTextLabel(labelSvg, node);\n }\n\n var labelBBox = labelSvg.node().getBBox();\n var y;\n switch (location) {\n case 'top':\n y = -node.height / 2;\n break;\n case 'bottom':\n y = node.height / 2 - labelBBox.height;\n break;\n default:\n y = -labelBBox.height / 2;\n }\n labelSvg.attr('transform', 'translate(' + -labelBBox.width / 2 + ',' + y + ')');\n\n return labelSvg;\n}\n","import * as d3 from 'd3';\nimport { addLabel } from './label/add-label.js';\nimport * as util from './util.js';\n\nexport { createClusters, setCreateClusters };\n\nvar createClusters = function (selection, g) {\n var clusters = g.nodes().filter(function (v) {\n return util.isSubgraph(g, v);\n });\n var svgClusters = selection.selectAll('g.cluster').data(clusters, function (v) {\n return v;\n });\n\n util.applyTransition(svgClusters.exit(), g).style('opacity', 0).remove();\n\n var enterSelection = svgClusters\n .enter()\n .append('g')\n .attr('class', 'cluster')\n .attr('id', function (v) {\n var node = g.node(v);\n return node.id;\n })\n .style('opacity', 0)\n .each(function (v) {\n var node = g.node(v);\n var thisGroup = d3.select(this);\n d3.select(this).append('rect');\n var labelGroup = thisGroup.append('g').attr('class', 'label');\n addLabel(labelGroup, node, node.clusterLabelPos);\n });\n\n svgClusters = svgClusters.merge(enterSelection);\n\n svgClusters = util.applyTransition(svgClusters, g).style('opacity', 1);\n\n svgClusters.selectAll('rect').each(function (c) {\n var node = g.node(c);\n var domCluster = d3.select(this);\n util.applyStyle(domCluster, node.style);\n });\n\n return svgClusters;\n};\n\nfunction setCreateClusters(value) {\n createClusters = value;\n}\n","import * as d3 from 'd3';\nimport * as _ from 'lodash-es';\nimport { addLabel } from './label/add-label.js';\nimport * as util from './util.js';\n\nexport { createEdgeLabels, setCreateEdgeLabels };\n\nlet createEdgeLabels = function (selection, g) {\n var svgEdgeLabels = selection\n .selectAll('g.edgeLabel')\n .data(g.edges(), function (e) {\n return util.edgeToId(e);\n })\n .classed('update', true);\n\n svgEdgeLabels.exit().remove();\n svgEdgeLabels.enter().append('g').classed('edgeLabel', true).style('opacity', 0);\n\n svgEdgeLabels = selection.selectAll('g.edgeLabel');\n\n svgEdgeLabels.each(function (e) {\n var root = d3.select(this);\n root.select('.label').remove();\n var edge = g.edge(e);\n var label = addLabel(root, g.edge(e), 0).classed('label', true);\n var bbox = label.node().getBBox();\n\n if (edge.labelId) {\n label.attr('id', edge.labelId);\n }\n if (!_.has(edge, 'width')) {\n edge.width = bbox.width;\n }\n if (!_.has(edge, 'height')) {\n edge.height = bbox.height;\n }\n });\n\n var exitSelection;\n\n if (svgEdgeLabels.exit) {\n exitSelection = svgEdgeLabels.exit();\n } else {\n exitSelection = svgEdgeLabels.selectAll(null); // empty selection\n }\n\n util.applyTransition(exitSelection, g).style('opacity', 0).remove();\n\n return svgEdgeLabels;\n};\n\nfunction setCreateEdgeLabels(value) {\n createEdgeLabels = value;\n}\n","export { intersectNode };\n\nfunction intersectNode(node, point) {\n return node.intersect(point);\n}\n","import * as d3 from 'd3';\nimport * as _ from 'lodash-es';\nimport { intersectNode } from './intersect/intersect-node.js';\nimport * as util from './util.js';\n\nexport { createEdgePaths, setCreateEdgePaths };\n\nvar createEdgePaths = function (selection, g, arrows) {\n var previousPaths = selection\n .selectAll('g.edgePath')\n .data(g.edges(), function (e) {\n return util.edgeToId(e);\n })\n .classed('update', true);\n\n var newPaths = enter(previousPaths, g);\n exit(previousPaths, g);\n\n var svgPaths = previousPaths.merge !== undefined ? previousPaths.merge(newPaths) : previousPaths;\n util.applyTransition(svgPaths, g).style('opacity', 1);\n\n // Save DOM element in the path group, and set ID and class\n svgPaths.each(function (e) {\n var domEdge = d3.select(this);\n var edge = g.edge(e);\n edge.elem = this;\n\n if (edge.id) {\n domEdge.attr('id', edge.id);\n }\n\n util.applyClass(\n domEdge,\n edge['class'],\n (domEdge.classed('update') ? 'update ' : '') + 'edgePath'\n );\n });\n\n svgPaths.selectAll('path.path').each(function (e) {\n var edge = g.edge(e);\n edge.arrowheadId = _.uniqueId('arrowhead');\n\n var domEdge = d3\n .select(this)\n .attr('marker-end', function () {\n return 'url(' + makeFragmentRef(location.href, edge.arrowheadId) + ')';\n })\n .style('fill', 'none');\n\n util.applyTransition(domEdge, g).attr('d', function (e) {\n return calcPoints(g, e);\n });\n\n util.applyStyle(domEdge, edge.style);\n });\n\n svgPaths.selectAll('defs *').remove();\n svgPaths.selectAll('defs').each(function (e) {\n var edge = g.edge(e);\n var arrowhead = arrows[edge.arrowhead];\n arrowhead(d3.select(this), edge.arrowheadId, edge, 'arrowhead');\n });\n\n return svgPaths;\n};\n\nfunction setCreateEdgePaths(value) {\n createEdgePaths = value;\n}\n\nfunction makeFragmentRef(url, fragmentId) {\n var baseUrl = url.split('#')[0];\n return baseUrl + '#' + fragmentId;\n}\n\nfunction calcPoints(g, e) {\n var edge = g.edge(e);\n var tail = g.node(e.v);\n var head = g.node(e.w);\n var points = edge.points.slice(1, edge.points.length - 1);\n points.unshift(intersectNode(tail, points[0]));\n points.push(intersectNode(head, points[points.length - 1]));\n\n return createLine(edge, points);\n}\n\nfunction createLine(edge, points) {\n // @ts-expect-error\n var line = (d3.line || d3.svg.line)()\n .x(function (d) {\n return d.x;\n })\n .y(function (d) {\n return d.y;\n });\n\n (line.curve || line.interpolate)(edge.curve);\n\n return line(points);\n}\n\nfunction getCoords(elem) {\n var bbox = elem.getBBox();\n var matrix = elem.ownerSVGElement\n .getScreenCTM()\n .inverse()\n .multiply(elem.getScreenCTM())\n .translate(bbox.width / 2, bbox.height / 2);\n return { x: matrix.e, y: matrix.f };\n}\n\nfunction enter(svgPaths, g) {\n var svgPathsEnter = svgPaths.enter().append('g').attr('class', 'edgePath').style('opacity', 0);\n svgPathsEnter\n .append('path')\n .attr('class', 'path')\n .attr('d', function (e) {\n var edge = g.edge(e);\n var sourceElem = g.node(e.v).elem;\n var points = _.range(edge.points.length).map(function () {\n return getCoords(sourceElem);\n });\n return createLine(edge, points);\n });\n svgPathsEnter.append('defs');\n return svgPathsEnter;\n}\n\nfunction exit(svgPaths, g) {\n var svgPathExit = svgPaths.exit();\n util.applyTransition(svgPathExit, g).style('opacity', 0).remove();\n}\n","import * as d3 from 'd3';\nimport * as _ from 'lodash-es';\nimport { addLabel } from './label/add-label.js';\nimport * as util from './util.js';\n\nexport { createNodes, setCreateNodes };\n\nvar createNodes = function (selection, g, shapes) {\n var simpleNodes = g.nodes().filter(function (v) {\n return !util.isSubgraph(g, v);\n });\n var svgNodes = selection\n .selectAll('g.node')\n .data(simpleNodes, function (v) {\n return v;\n })\n .classed('update', true);\n\n svgNodes.exit().remove();\n\n svgNodes.enter().append('g').attr('class', 'node').style('opacity', 0);\n\n svgNodes = selection.selectAll('g.node');\n\n svgNodes.each(function (v) {\n var node = g.node(v);\n var thisGroup = d3.select(this);\n util.applyClass(\n thisGroup,\n node['class'],\n (thisGroup.classed('update') ? 'update ' : '') + 'node'\n );\n\n thisGroup.select('g.label').remove();\n var labelGroup = thisGroup.append('g').attr('class', 'label');\n var labelDom = addLabel(labelGroup, node);\n var shape = shapes[node.shape];\n var bbox = _.pick(labelDom.node().getBBox(), 'width', 'height');\n\n node.elem = this;\n\n if (node.id) {\n thisGroup.attr('id', node.id);\n }\n if (node.labelId) {\n labelGroup.attr('id', node.labelId);\n }\n\n if (_.has(node, 'width')) {\n bbox.width = node.width;\n }\n if (_.has(node, 'height')) {\n bbox.height = node.height;\n }\n\n bbox.width += node.paddingLeft + node.paddingRight;\n bbox.height += node.paddingTop + node.paddingBottom;\n labelGroup.attr(\n 'transform',\n 'translate(' +\n (node.paddingLeft - node.paddingRight) / 2 +\n ',' +\n (node.paddingTop - node.paddingBottom) / 2 +\n ')'\n );\n\n var root = d3.select(this);\n root.select('.label-container').remove();\n var shapeSvg = shape(root, bbox, node).classed('label-container', true);\n util.applyStyle(shapeSvg, node.style);\n\n var shapeBBox = shapeSvg.node().getBBox();\n node.width = shapeBBox.width;\n node.height = shapeBBox.height;\n });\n\n var exitSelection;\n\n if (svgNodes.exit) {\n exitSelection = svgNodes.exit();\n } else {\n exitSelection = svgNodes.selectAll(null); // empty selection\n }\n\n util.applyTransition(exitSelection, g).style('opacity', 0).remove();\n\n return svgNodes;\n};\n\nfunction setCreateNodes(value) {\n createNodes = value;\n}\n","import * as d3 from 'd3';\nimport * as util from './util.js';\n\nexport { positionClusters };\n\nfunction positionClusters(selection, g) {\n var created = selection.filter(function () {\n return !d3.select(this).classed('update');\n });\n\n function translate(v) {\n var node = g.node(v);\n return 'translate(' + node.x + ',' + node.y + ')';\n }\n\n created.attr('transform', translate);\n\n util.applyTransition(selection, g).style('opacity', 1).attr('transform', translate);\n\n util\n .applyTransition(created.selectAll('rect'), g)\n .attr('width', function (v) {\n return g.node(v).width;\n })\n .attr('height', function (v) {\n return g.node(v).height;\n })\n .attr('x', function (v) {\n var node = g.node(v);\n return -node.width / 2;\n })\n .attr('y', function (v) {\n var node = g.node(v);\n return -node.height / 2;\n });\n}\n","import * as d3 from 'd3';\nimport * as _ from 'lodash-es';\nimport * as util from './util.js';\n\nexport { positionEdgeLabels };\n\nfunction positionEdgeLabels(selection, g) {\n var created = selection.filter(function () {\n return !d3.select(this).classed('update');\n });\n\n function translate(e) {\n var edge = g.edge(e);\n return _.has(edge, 'x') ? 'translate(' + edge.x + ',' + edge.y + ')' : '';\n }\n\n created.attr('transform', translate);\n\n util.applyTransition(selection, g).style('opacity', 1).attr('transform', translate);\n}\n","import * as d3 from 'd3';\nimport * as util from './util.js';\n\nexport { positionNodes };\n\nfunction positionNodes(selection, g) {\n var created = selection.filter(function () {\n return !d3.select(this).classed('update');\n });\n\n function translate(v) {\n var node = g.node(v);\n return 'translate(' + node.x + ',' + node.y + ')';\n }\n\n created.attr('transform', translate);\n\n util.applyTransition(selection, g).style('opacity', 1).attr('transform', translate);\n}\n","export { intersectEllipse };\n\nfunction intersectEllipse(node, rx, ry, point) {\n // Formulae from: http://mathworld.wolfram.com/Ellipse-LineIntersection.html\n\n var cx = node.x;\n var cy = node.y;\n\n var px = cx - point.x;\n var py = cy - point.y;\n\n var det = Math.sqrt(rx * rx * py * py + ry * ry * px * px);\n\n var dx = Math.abs((rx * ry * px) / det);\n if (point.x < cx) {\n dx = -dx;\n }\n var dy = Math.abs((rx * ry * py) / det);\n if (point.y < cy) {\n dy = -dy;\n }\n\n return { x: cx + dx, y: cy + dy };\n}\n","import { intersectEllipse } from './intersect-ellipse.js';\n\nexport { intersectCircle };\n\nfunction intersectCircle(node, rx, point) {\n return intersectEllipse(node, rx, rx, point);\n}\n","export { intersectLine };\n\n/*\n * Returns the point at which two lines, p and q, intersect or returns\n * undefined if they do not intersect.\n */\nfunction intersectLine(p1, p2, q1, q2) {\n // Algorithm from J. Avro, (ed.) Graphics Gems, No 2, Morgan Kaufmann, 1994,\n // p7 and p473.\n\n var a1, a2, b1, b2, c1, c2;\n var r1, r2, r3, r4;\n var denom, offset, num;\n var x, y;\n\n // Compute a1, b1, c1, where line joining points 1 and 2 is F(x,y) = a1 x +\n // b1 y + c1 = 0.\n a1 = p2.y - p1.y;\n b1 = p1.x - p2.x;\n c1 = p2.x * p1.y - p1.x * p2.y;\n\n // Compute r3 and r4.\n r3 = a1 * q1.x + b1 * q1.y + c1;\n r4 = a1 * q2.x + b1 * q2.y + c1;\n\n // Check signs of r3 and r4. If both point 3 and point 4 lie on\n // same side of line 1, the line segments do not intersect.\n if (r3 !== 0 && r4 !== 0 && sameSign(r3, r4)) {\n return /*DONT_INTERSECT*/;\n }\n\n // Compute a2, b2, c2 where line joining points 3 and 4 is G(x,y) = a2 x + b2 y + c2 = 0\n a2 = q2.y - q1.y;\n b2 = q1.x - q2.x;\n c2 = q2.x * q1.y - q1.x * q2.y;\n\n // Compute r1 and r2\n r1 = a2 * p1.x + b2 * p1.y + c2;\n r2 = a2 * p2.x + b2 * p2.y + c2;\n\n // Check signs of r1 and r2. If both point 1 and point 2 lie\n // on same side of second line segment, the line segments do\n // not intersect.\n if (r1 !== 0 && r2 !== 0 && sameSign(r1, r2)) {\n return /*DONT_INTERSECT*/;\n }\n\n // Line segments intersect: compute intersection point.\n denom = a1 * b2 - a2 * b1;\n if (denom === 0) {\n return /*COLLINEAR*/;\n }\n\n offset = Math.abs(denom / 2);\n\n // The denom/2 is to get rounding instead of truncating. It\n // is added or subtracted to the numerator, depending upon the\n // sign of the numerator.\n num = b1 * c2 - b2 * c1;\n x = num < 0 ? (num - offset) / denom : (num + offset) / denom;\n\n num = a2 * c1 - a1 * c2;\n y = num < 0 ? (num - offset) / denom : (num + offset) / denom;\n\n return { x: x, y: y };\n}\n\nfunction sameSign(r1, r2) {\n return r1 * r2 > 0;\n}\n","import { intersectLine } from './intersect-line.js';\n\nexport { intersectPolygon };\n\n/*\n * Returns the point ({x, y}) at which the point argument intersects with the\n * node argument assuming that it has the shape specified by polygon.\n */\nfunction intersectPolygon(node, polyPoints, point) {\n var x1 = node.x;\n var y1 = node.y;\n\n var intersections = [];\n\n var minX = Number.POSITIVE_INFINITY;\n var minY = Number.POSITIVE_INFINITY;\n polyPoints.forEach(function (entry) {\n minX = Math.min(minX, entry.x);\n minY = Math.min(minY, entry.y);\n });\n\n var left = x1 - node.width / 2 - minX;\n var top = y1 - node.height / 2 - minY;\n\n for (var i = 0; i < polyPoints.length; i++) {\n var p1 = polyPoints[i];\n var p2 = polyPoints[i < polyPoints.length - 1 ? i + 1 : 0];\n var intersect = intersectLine(\n node,\n point,\n { x: left + p1.x, y: top + p1.y },\n { x: left + p2.x, y: top + p2.y }\n );\n if (intersect) {\n intersections.push(intersect);\n }\n }\n\n if (!intersections.length) {\n console.log('NO INTERSECTION FOUND, RETURN NODE CENTER', node);\n return node;\n }\n\n if (intersections.length > 1) {\n // More intersections, find the one nearest to edge end point\n intersections.sort(function (p, q) {\n var pdx = p.x - point.x;\n var pdy = p.y - point.y;\n var distp = Math.sqrt(pdx * pdx + pdy * pdy);\n\n var qdx = q.x - point.x;\n var qdy = q.y - point.y;\n var distq = Math.sqrt(qdx * qdx + qdy * qdy);\n\n return distp < distq ? -1 : distp === distq ? 0 : 1;\n });\n }\n return intersections[0];\n}\n","export { intersectRect };\n\nfunction intersectRect(node, point) {\n var x = node.x;\n var y = node.y;\n\n // Rectangle intersection algorithm from:\n // http://math.stackexchange.com/questions/108113/find-edge-between-two-boxes\n var dx = point.x - x;\n var dy = point.y - y;\n var w = node.width / 2;\n var h = node.height / 2;\n\n var sx, sy;\n if (Math.abs(dy) * w > Math.abs(dx) * h) {\n // Intersection is top or bottom of rect.\n if (dy < 0) {\n h = -h;\n }\n sx = dy === 0 ? 0 : (h * dx) / dy;\n sy = h;\n } else {\n // Intersection is left or right of rect.\n if (dx < 0) {\n w = -w;\n }\n sx = w;\n sy = dx === 0 ? 0 : (w * dy) / dx;\n }\n\n return { x: x + sx, y: y + sy };\n}\n","import { intersectCircle } from './intersect/intersect-circle.js';\nimport { intersectEllipse } from './intersect/intersect-ellipse.js';\nimport { intersectPolygon } from './intersect/intersect-polygon.js';\nimport { intersectRect } from './intersect/intersect-rect.js';\n\nexport { shapes, setShapes };\n\nvar shapes = {\n rect,\n ellipse,\n circle,\n diamond,\n};\n\nfunction setShapes(value) {\n shapes = value;\n}\n\nfunction rect(parent, bbox, node) {\n var shapeSvg = parent\n .insert('rect', ':first-child')\n .attr('rx', node.rx)\n .attr('ry', node.ry)\n .attr('x', -bbox.width / 2)\n .attr('y', -bbox.height / 2)\n .attr('width', bbox.width)\n .attr('height', bbox.height);\n\n node.intersect = function (point) {\n return intersectRect(node, point);\n };\n\n return shapeSvg;\n}\n\nfunction ellipse(parent, bbox, node) {\n var rx = bbox.width / 2;\n var ry = bbox.height / 2;\n var shapeSvg = parent\n .insert('ellipse', ':first-child')\n .attr('x', -bbox.width / 2)\n .attr('y', -bbox.height / 2)\n .attr('rx', rx)\n .attr('ry', ry);\n\n node.intersect = function (point) {\n return intersectEllipse(node, rx, ry, point);\n };\n\n return shapeSvg;\n}\n\nfunction circle(parent, bbox, node) {\n var r = Math.max(bbox.width, bbox.height) / 2;\n var shapeSvg = parent\n .insert('circle', ':first-child')\n .attr('x', -bbox.width / 2)\n .attr('y', -bbox.height / 2)\n .attr('r', r);\n\n node.intersect = function (point) {\n return intersectCircle(node, r, point);\n };\n\n return shapeSvg;\n}\n\n// Circumscribe an ellipse for the bounding box with a diamond shape. I derived\n// the function to calculate the diamond shape from:\n// http://mathforum.org/kb/message.jspa?messageID=3750236\nfunction diamond(parent, bbox, node) {\n var w = (bbox.width * Math.SQRT2) / 2;\n var h = (bbox.height * Math.SQRT2) / 2;\n var points = [\n { x: 0, y: -h },\n { x: -w, y: 0 },\n { x: 0, y: h },\n { x: w, y: 0 },\n ];\n var shapeSvg = parent.insert('polygon', ':first-child').attr(\n 'points',\n points\n .map(function (p) {\n return p.x + ',' + p.y;\n })\n .join(' ')\n );\n\n node.intersect = function (p) {\n return intersectPolygon(node, points, p);\n };\n\n return shapeSvg;\n}\n","import * as d3 from 'd3';\nimport * as _ from 'lodash-es';\nimport { layout } from '../dagre/index.js';\nimport { arrows, setArrows } from './arrows.js';\nimport { createClusters, setCreateClusters } from './create-clusters.js';\nimport { createEdgeLabels, setCreateEdgeLabels } from './create-edge-labels.js';\nimport { createEdgePaths, setCreateEdgePaths } from './create-edge-paths.js';\nimport { createNodes, setCreateNodes } from './create-nodes.js';\nimport { positionClusters } from './position-clusters.js';\nimport { positionEdgeLabels } from './position-edge-labels.js';\nimport { positionNodes } from './position-nodes.js';\nimport { shapes, setShapes } from './shapes.js';\n\nexport { render };\n\n// This design is based on http://bost.ocks.org/mike/chart/.\nfunction render() {\n var fn = function (svg, g) {\n preProcessGraph(g);\n\n var outputGroup = createOrSelectGroup(svg, 'output');\n var clustersGroup = createOrSelectGroup(outputGroup, 'clusters');\n var edgePathsGroup = createOrSelectGroup(outputGroup, 'edgePaths');\n var edgeLabels = createEdgeLabels(createOrSelectGroup(outputGroup, 'edgeLabels'), g);\n var nodes = createNodes(createOrSelectGroup(outputGroup, 'nodes'), g, shapes);\n\n layout(g);\n\n positionNodes(nodes, g);\n positionEdgeLabels(edgeLabels, g);\n createEdgePaths(edgePathsGroup, g, arrows);\n\n var clusters = createClusters(clustersGroup, g);\n positionClusters(clusters, g);\n\n postProcessGraph(g);\n };\n\n fn.createNodes = function (value) {\n if (!arguments.length) return createNodes;\n setCreateNodes(value);\n return fn;\n };\n\n fn.createClusters = function (value) {\n if (!arguments.length) return createClusters;\n setCreateClusters(value);\n return fn;\n };\n\n fn.createEdgeLabels = function (value) {\n if (!arguments.length) return createEdgeLabels;\n setCreateEdgeLabels(value);\n return fn;\n };\n\n fn.createEdgePaths = function (value) {\n if (!arguments.length) return createEdgePaths;\n setCreateEdgePaths(value);\n return fn;\n };\n\n fn.shapes = function (value) {\n if (!arguments.length) return shapes;\n setShapes(value);\n return fn;\n };\n\n fn.arrows = function (value) {\n if (!arguments.length) return arrows;\n setArrows(value);\n return fn;\n };\n\n return fn;\n}\n\nvar NODE_DEFAULT_ATTRS = {\n paddingLeft: 10,\n paddingRight: 10,\n paddingTop: 10,\n paddingBottom: 10,\n rx: 0,\n ry: 0,\n shape: 'rect',\n};\n\nvar EDGE_DEFAULT_ATTRS = {\n arrowhead: 'normal',\n curve: d3.curveLinear,\n};\n\nfunction preProcessGraph(g) {\n g.nodes().forEach(function (v) {\n var node = g.node(v);\n if (!_.has(node, 'label') && !g.children(v).length) {\n node.label = v;\n }\n\n if (_.has(node, 'paddingX')) {\n _.defaults(node, {\n paddingLeft: node.paddingX,\n paddingRight: node.paddingX,\n });\n }\n\n if (_.has(node, 'paddingY')) {\n _.defaults(node, {\n paddingTop: node.paddingY,\n paddingBottom: node.paddingY,\n });\n }\n\n if (_.has(node, 'padding')) {\n _.defaults(node, {\n paddingLeft: node.padding,\n paddingRight: node.padding,\n paddingTop: node.padding,\n paddingBottom: node.padding,\n });\n }\n\n _.defaults(node, NODE_DEFAULT_ATTRS);\n\n _.each(['paddingLeft', 'paddingRight', 'paddingTop', 'paddingBottom'], function (k) {\n node[k] = Number(node[k]);\n });\n\n // Save dimensions for restore during post-processing\n if (_.has(node, 'width')) {\n node._prevWidth = node.width;\n }\n if (_.has(node, 'height')) {\n node._prevHeight = node.height;\n }\n });\n\n g.edges().forEach(function (e) {\n var edge = g.edge(e);\n if (!_.has(edge, 'label')) {\n edge.label = '';\n }\n _.defaults(edge, EDGE_DEFAULT_ATTRS);\n });\n}\n\nfunction postProcessGraph(g) {\n _.each(g.nodes(), function (v) {\n var node = g.node(v);\n\n // Restore original dimensions\n if (_.has(node, '_prevWidth')) {\n node.width = node._prevWidth;\n } else {\n delete node.width;\n }\n\n if (_.has(node, '_prevHeight')) {\n node.height = node._prevHeight;\n } else {\n delete node.height;\n }\n\n delete node._prevWidth;\n delete node._prevHeight;\n });\n}\n\nfunction createOrSelectGroup(root, name) {\n var selection = root.select('g.' + name);\n if (selection.empty()) {\n selection = root.append('g').attr('class', name);\n }\n return selection;\n}\n","import { intersectPolygon } from 'dagre-d3-es/src/dagre-js/intersect/intersect-polygon.js';\nimport { intersectRect } from 'dagre-d3-es/src/dagre-js/intersect/intersect-rect.js';\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction question(parent, bbox, node) {\n const w = bbox.width;\n const h = bbox.height;\n const s = (w + h) * 0.9;\n const points = [\n { x: s / 2, y: 0 },\n { x: s, y: -s / 2 },\n { x: s / 2, y: -s },\n { x: 0, y: -s / 2 },\n ];\n const shapeSvg = insertPolygonShape(parent, s, s, points);\n node.intersect = function (point) {\n return intersectPolygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction hexagon(parent, bbox, node) {\n const f = 4;\n const h = bbox.height;\n const m = h / f;\n const w = bbox.width + 2 * m;\n const points = [\n { x: m, y: 0 },\n { x: w - m, y: 0 },\n { x: w, y: -h / 2 },\n { x: w - m, y: -h },\n { x: m, y: -h },\n { x: 0, y: -h / 2 },\n ];\n const shapeSvg = insertPolygonShape(parent, w, h, points);\n node.intersect = function (point) {\n return intersectPolygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction rect_left_inv_arrow(parent, bbox, node) {\n const w = bbox.width;\n const h = bbox.height;\n const points = [\n { x: -h / 2, y: 0 },\n { x: w, y: 0 },\n { x: w, y: -h },\n { x: -h / 2, y: -h },\n { x: 0, y: -h / 2 },\n ];\n const shapeSvg = insertPolygonShape(parent, w, h, points);\n node.intersect = function (point) {\n return intersectPolygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction lean_right(parent, bbox, node) {\n const w = bbox.width;\n const h = bbox.height;\n const points = [\n { x: (-2 * h) / 6, y: 0 },\n { x: w - h / 6, y: 0 },\n { x: w + (2 * h) / 6, y: -h },\n { x: h / 6, y: -h },\n ];\n const shapeSvg = insertPolygonShape(parent, w, h, points);\n node.intersect = function (point) {\n return intersectPolygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction lean_left(parent, bbox, node) {\n const w = bbox.width;\n const h = bbox.height;\n const points = [\n { x: (2 * h) / 6, y: 0 },\n { x: w + h / 6, y: 0 },\n { x: w - (2 * h) / 6, y: -h },\n { x: -h / 6, y: -h },\n ];\n const shapeSvg = insertPolygonShape(parent, w, h, points);\n node.intersect = function (point) {\n return intersectPolygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction trapezoid(parent, bbox, node) {\n const w = bbox.width;\n const h = bbox.height;\n const points = [\n { x: (-2 * h) / 6, y: 0 },\n { x: w + (2 * h) / 6, y: 0 },\n { x: w - h / 6, y: -h },\n { x: h / 6, y: -h },\n ];\n const shapeSvg = insertPolygonShape(parent, w, h, points);\n node.intersect = function (point) {\n return intersectPolygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction inv_trapezoid(parent, bbox, node) {\n const w = bbox.width;\n const h = bbox.height;\n const points = [\n { x: h / 6, y: 0 },\n { x: w - h / 6, y: 0 },\n { x: w + (2 * h) / 6, y: -h },\n { x: (-2 * h) / 6, y: -h },\n ];\n const shapeSvg = insertPolygonShape(parent, w, h, points);\n node.intersect = function (point) {\n return intersectPolygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction rect_right_inv_arrow(parent, bbox, node) {\n const w = bbox.width;\n const h = bbox.height;\n const points = [\n { x: 0, y: 0 },\n { x: w + h / 2, y: 0 },\n { x: w, y: -h / 2 },\n { x: w + h / 2, y: -h },\n { x: 0, y: -h },\n ];\n const shapeSvg = insertPolygonShape(parent, w, h, points);\n node.intersect = function (point) {\n return intersectPolygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction stadium(parent, bbox, node) {\n const h = bbox.height;\n const w = bbox.width + h / 4;\n\n const shapeSvg = parent\n .insert('rect', ':first-child')\n .attr('rx', h / 2)\n .attr('ry', h / 2)\n .attr('x', -w / 2)\n .attr('y', -h / 2)\n .attr('width', w)\n .attr('height', h);\n\n node.intersect = function (point) {\n return intersectRect(node, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction subroutine(parent, bbox, node) {\n const w = bbox.width;\n const h = bbox.height;\n const points = [\n { x: 0, y: 0 },\n { x: w, y: 0 },\n { x: w, y: -h },\n { x: 0, y: -h },\n { x: 0, y: 0 },\n { x: -8, y: 0 },\n { x: w + 8, y: 0 },\n { x: w + 8, y: -h },\n { x: -8, y: -h },\n { x: -8, y: 0 },\n ];\n const shapeSvg = insertPolygonShape(parent, w, h, points);\n node.intersect = function (point) {\n return intersectPolygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction cylinder(parent, bbox, node) {\n const w = bbox.width;\n const rx = w / 2;\n const ry = rx / (2.5 + w / 50);\n const h = bbox.height + ry;\n\n const shape =\n 'M 0,' +\n ry +\n ' a ' +\n rx +\n ',' +\n ry +\n ' 0,0,0 ' +\n w +\n ' 0 a ' +\n rx +\n ',' +\n ry +\n ' 0,0,0 ' +\n -w +\n ' 0 l 0,' +\n h +\n ' a ' +\n rx +\n ',' +\n ry +\n ' 0,0,0 ' +\n w +\n ' 0 l 0,' +\n -h;\n\n const shapeSvg = parent\n .attr('label-offset-y', ry)\n .insert('path', ':first-child')\n .attr('d', shape)\n .attr('transform', 'translate(' + -w / 2 + ',' + -(h / 2 + ry) + ')');\n\n node.intersect = function (point) {\n const pos = intersectRect(node, point);\n const x = pos.x - node.x;\n\n if (\n rx != 0 &&\n (Math.abs(x) < node.width / 2 ||\n (Math.abs(x) == node.width / 2 && Math.abs(pos.y - node.y) > node.height / 2 - ry))\n ) {\n // ellipsis equation: x*x / a*a + y*y / b*b = 1\n // solve for y to get adjusted value for pos.y\n let y = ry * ry * (1 - (x * x) / (rx * rx));\n if (y != 0) {\n y = Math.sqrt(y);\n }\n y = ry - y;\n if (point.y - node.y > 0) {\n y = -y;\n }\n\n pos.y += y;\n }\n\n return pos;\n };\n\n return shapeSvg;\n}\n\n/** @param render */\nexport function addToRender(render) {\n render.shapes().question = question;\n render.shapes().hexagon = hexagon;\n render.shapes().stadium = stadium;\n render.shapes().subroutine = subroutine;\n render.shapes().cylinder = cylinder;\n\n // Add custom shape for box with inverted arrow on left side\n render.shapes().rect_left_inv_arrow = rect_left_inv_arrow;\n\n // Add custom shape for box with inverted arrow on left side\n render.shapes().lean_right = lean_right;\n\n // Add custom shape for box with inverted arrow on left side\n render.shapes().lean_left = lean_left;\n\n // Add custom shape for box with inverted arrow on left side\n render.shapes().trapezoid = trapezoid;\n\n // Add custom shape for box with inverted arrow on left side\n render.shapes().inv_trapezoid = inv_trapezoid;\n\n // Add custom shape for box with inverted arrow on right side\n render.shapes().rect_right_inv_arrow = rect_right_inv_arrow;\n}\n\n/** @param addShape */\nexport function addToRenderV2(addShape) {\n addShape({ question });\n addShape({ hexagon });\n addShape({ stadium });\n addShape({ subroutine });\n addShape({ cylinder });\n\n // Add custom shape for box with inverted arrow on left side\n addShape({ rect_left_inv_arrow });\n\n // Add custom shape for box with inverted arrow on left side\n addShape({ lean_right });\n\n // Add custom shape for box with inverted arrow on left side\n addShape({ lean_left });\n\n // Add custom shape for box with inverted arrow on left side\n addShape({ trapezoid });\n\n // Add custom shape for box with inverted arrow on left side\n addShape({ inv_trapezoid });\n\n // Add custom shape for box with inverted arrow on right side\n addShape({ rect_right_inv_arrow });\n}\n\n/**\n * @param parent\n * @param w\n * @param h\n * @param points\n */\nfunction insertPolygonShape(parent, w, h, points) {\n return parent\n .insert('polygon', ':first-child')\n .attr(\n 'points',\n points\n .map(function (d) {\n return d.x + ',' + d.y;\n })\n .join(' ')\n )\n .attr('transform', 'translate(' + -w / 2 + ',' + h / 2 + ')');\n}\n\nexport default {\n addToRender,\n addToRenderV2,\n};\n","import * as graphlib from 'dagre-d3-es/src/graphlib/index.js';\nimport { select, curveLinear, selectAll } from 'd3';\nimport { getConfig } from '../../config';\nimport { render as Render } from 'dagre-d3-es';\nimport { applyStyle } from 'dagre-d3-es/src/dagre-js/util.js';\nimport { addHtmlLabel } from 'dagre-d3-es/src/dagre-js/label/add-html-label.js';\nimport { log } from '../../logger';\nimport common, { evaluate } from '../common/common';\nimport { interpolateToCurve, getStylesFromArray } from '../../utils';\nimport { setupGraphViewbox } from '../../setupGraphViewbox';\nimport flowChartShapes from './flowChartShapes';\n\nconst conf = {};\nexport const setConf = function (cnf) {\n const keys = Object.keys(cnf);\n for (const key of keys) {\n conf[key] = cnf[key];\n }\n};\n\n/**\n * Function that adds the vertices found in the graph definition to the graph to be rendered.\n *\n * @param vert Object containing the vertices.\n * @param g The graph that is to be drawn.\n * @param svgId\n * @param root\n * @param _doc\n * @param diagObj\n */\nexport const addVertices = function (vert, g, svgId, root, _doc, diagObj) {\n const svg = !root ? select(`[id=\"${svgId}\"]`) : root.select(`[id=\"${svgId}\"]`);\n const doc = !_doc ? document : _doc;\n const keys = Object.keys(vert);\n\n // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition\n keys.forEach(function (id) {\n const vertex = vert[id];\n\n /**\n * Variable for storing the classes for the vertex\n *\n * @type {string}\n */\n let classStr = 'default';\n if (vertex.classes.length > 0) {\n classStr = vertex.classes.join(' ');\n }\n\n const styles = getStylesFromArray(vertex.styles);\n\n // Use vertex id as text in the box if no text is provided by the graph definition\n let vertexText = vertex.text !== undefined ? vertex.text : vertex.id;\n\n // We create a SVG label, either by delegating to addHtmlLabel or manually\n let vertexNode;\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n // TODO: addHtmlLabel accepts a labelStyle. Do we possibly have that?\n const node = {\n label: vertexText.replace(\n /fa[blrs]?:fa-[\\w-]+/g,\n (s) => `<i class='${s.replace(':', ' ')}'></i>`\n ),\n };\n vertexNode = addHtmlLabel(svg, node).node();\n vertexNode.parentNode.removeChild(vertexNode);\n } else {\n const svgLabel = doc.createElementNS('http://www.w3.org/2000/svg', 'text');\n svgLabel.setAttribute('style', styles.labelStyle.replace('color:', 'fill:'));\n\n const rows = vertexText.split(common.lineBreakRegex);\n\n for (const row of rows) {\n const tspan = doc.createElementNS('http://www.w3.org/2000/svg', 'tspan');\n tspan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');\n tspan.setAttribute('dy', '1em');\n tspan.setAttribute('x', '1');\n tspan.textContent = row;\n svgLabel.appendChild(tspan);\n }\n vertexNode = svgLabel;\n }\n\n let radious = 0;\n let _shape = '';\n // Set the shape based parameters\n switch (vertex.type) {\n case 'round':\n radious = 5;\n _shape = 'rect';\n break;\n case 'square':\n _shape = 'rect';\n break;\n case 'diamond':\n _shape = 'question';\n break;\n case 'hexagon':\n _shape = 'hexagon';\n break;\n case 'odd':\n _shape = 'rect_left_inv_arrow';\n break;\n case 'lean_right':\n _shape = 'lean_right';\n break;\n case 'lean_left':\n _shape = 'lean_left';\n break;\n case 'trapezoid':\n _shape = 'trapezoid';\n break;\n case 'inv_trapezoid':\n _shape = 'inv_trapezoid';\n break;\n case 'odd_right':\n _shape = 'rect_left_inv_arrow';\n break;\n case 'circle':\n _shape = 'circle';\n break;\n case 'ellipse':\n _shape = 'ellipse';\n break;\n case 'stadium':\n _shape = 'stadium';\n break;\n case 'subroutine':\n _shape = 'subroutine';\n break;\n case 'cylinder':\n _shape = 'cylinder';\n break;\n case 'group':\n _shape = 'rect';\n break;\n default:\n _shape = 'rect';\n }\n // Add the node\n log.warn('Adding node', vertex.id, vertex.domId);\n g.setNode(diagObj.db.lookUpDomId(vertex.id), {\n labelType: 'svg',\n labelStyle: styles.labelStyle,\n shape: _shape,\n label: vertexNode,\n rx: radious,\n ry: radious,\n class: classStr,\n style: styles.style,\n id: diagObj.db.lookUpDomId(vertex.id),\n });\n });\n};\n\n/**\n * Add edges to graph based on parsed graph definition\n *\n * @param {object} edges The edges to add to the graph\n * @param {object} g The graph object\n * @param diagObj\n */\nexport const addEdges = function (edges, g, diagObj) {\n let cnt = 0;\n\n let defaultStyle;\n let defaultLabelStyle;\n\n if (edges.defaultStyle !== undefined) {\n const defaultStyles = getStylesFromArray(edges.defaultStyle);\n defaultStyle = defaultStyles.style;\n defaultLabelStyle = defaultStyles.labelStyle;\n }\n\n edges.forEach(function (edge) {\n cnt++;\n\n // Identify Link\n var linkId = 'L-' + edge.start + '-' + edge.end;\n var linkNameStart = 'LS-' + edge.start;\n var linkNameEnd = 'LE-' + edge.end;\n\n const edgeData = {};\n\n // Set link type for rendering\n if (edge.type === 'arrow_open') {\n edgeData.arrowhead = 'none';\n } else {\n edgeData.arrowhead = 'normal';\n }\n\n let style = '';\n let labelStyle = '';\n\n if (edge.style !== undefined) {\n const styles = getStylesFromArray(edge.style);\n style = styles.style;\n labelStyle = styles.labelStyle;\n } else {\n switch (edge.stroke) {\n case 'normal':\n style = 'fill:none';\n if (defaultStyle !== undefined) {\n style = defaultStyle;\n }\n if (defaultLabelStyle !== undefined) {\n labelStyle = defaultLabelStyle;\n }\n break;\n case 'dotted':\n style = 'fill:none;stroke-width:2px;stroke-dasharray:3;';\n break;\n case 'thick':\n style = ' stroke-width: 3.5px;fill:none';\n break;\n }\n }\n\n edgeData.style = style;\n edgeData.labelStyle = labelStyle;\n\n if (edge.interpolate !== undefined) {\n edgeData.curve = interpolateToCurve(edge.interpolate, curveLinear);\n } else if (edges.defaultInterpolate !== undefined) {\n edgeData.curve = interpolateToCurve(edges.defaultInterpolate, curveLinear);\n } else {\n edgeData.curve = interpolateToCurve(conf.curve, curveLinear);\n }\n\n if (edge.text === undefined) {\n if (edge.style !== undefined) {\n edgeData.arrowheadStyle = 'fill: #333';\n }\n } else {\n edgeData.arrowheadStyle = 'fill: #333';\n edgeData.labelpos = 'c';\n\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n edgeData.labelType = 'html';\n edgeData.label = `<span id=\"L-${linkId}\" class=\"edgeLabel L-${linkNameStart}' L-${linkNameEnd}\" style=\"${\n edgeData.labelStyle\n }\">${edge.text.replace(\n /fa[blrs]?:fa-[\\w-]+/g,\n (s) => `<i class='${s.replace(':', ' ')}'></i>`\n )}</span>`;\n } else {\n edgeData.labelType = 'text';\n edgeData.label = edge.text.replace(common.lineBreakRegex, '\\n');\n\n if (edge.style === undefined) {\n edgeData.style = edgeData.style || 'stroke: #333; stroke-width: 1.5px;fill:none';\n }\n\n edgeData.labelStyle = edgeData.labelStyle.replace('color:', 'fill:');\n }\n }\n\n edgeData.id = linkId;\n edgeData.class = linkNameStart + ' ' + linkNameEnd;\n edgeData.minlen = edge.length || 1;\n\n // Add the edge to the graph\n g.setEdge(diagObj.db.lookUpDomId(edge.start), diagObj.db.lookUpDomId(edge.end), edgeData, cnt);\n });\n};\n\n/**\n * Returns the all the styles from classDef statements in the graph definition.\n *\n * @param text\n * @param diagObj\n * @returns {object} ClassDef styles\n */\nexport const getClasses = function (text, diagObj) {\n log.info('Extracting classes');\n diagObj.db.clear();\n try {\n // Parse the graph definition\n diagObj.parse(text);\n return diagObj.db.getClasses();\n } catch (e) {\n log.error(e);\n return {};\n }\n};\n\n/**\n * Draws a flowchart in the tag with id: id based on the graph definition in text.\n *\n * @param text\n * @param id\n * @param _version\n * @param diagObj\n */\nexport const draw = function (text, id, _version, diagObj) {\n log.info('Drawing flowchart');\n diagObj.db.clear();\n const { securityLevel, flowchart: conf } = getConfig();\n let sandboxElement;\n if (securityLevel === 'sandbox') {\n sandboxElement = select('#i' + id);\n }\n const root =\n securityLevel === 'sandbox'\n ? select(sandboxElement.nodes()[0].contentDocument.body)\n : select('body');\n const doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document;\n\n // Parse the graph definition\n try {\n diagObj.parser.parse(text);\n } catch (err) {\n log.debug('Parsing failed');\n }\n\n // Fetch the default direction, use TD if none was found\n let dir = diagObj.db.getDirection();\n if (dir === undefined) {\n dir = 'TD';\n }\n const nodeSpacing = conf.nodeSpacing || 50;\n const rankSpacing = conf.rankSpacing || 50;\n\n // Create the input mermaid.graph\n const g = new graphlib.Graph({\n multigraph: true,\n compound: true,\n })\n .setGraph({\n rankdir: dir,\n nodesep: nodeSpacing,\n ranksep: rankSpacing,\n marginx: 8,\n marginy: 8,\n })\n .setDefaultEdgeLabel(function () {\n return {};\n });\n\n let subG;\n const subGraphs = diagObj.db.getSubGraphs();\n for (let i = subGraphs.length - 1; i >= 0; i--) {\n subG = subGraphs[i];\n diagObj.db.addVertex(subG.id, subG.title, 'group', undefined, subG.classes);\n }\n\n // Fetch the vertices/nodes and edges/links from the parsed graph definition\n const vert = diagObj.db.getVertices();\n log.warn('Get vertices', vert);\n\n const edges = diagObj.db.getEdges();\n\n let i = 0;\n for (i = subGraphs.length - 1; i >= 0; i--) {\n subG = subGraphs[i];\n\n selectAll('cluster').append('text');\n\n for (let j = 0; j < subG.nodes.length; j++) {\n log.warn(\n 'Setting subgraph',\n subG.nodes[j],\n diagObj.db.lookUpDomId(subG.nodes[j]),\n diagObj.db.lookUpDomId(subG.id)\n );\n g.setParent(diagObj.db.lookUpDomId(subG.nodes[j]), diagObj.db.lookUpDomId(subG.id));\n }\n }\n addVertices(vert, g, id, root, doc, diagObj);\n addEdges(edges, g, diagObj);\n\n // Create the renderer\n const render = new Render();\n\n // Add custom shapes\n flowChartShapes.addToRender(render);\n\n // Add our custom arrow - an empty arrowhead\n render.arrows().none = function normal(parent, id, edge, type) {\n const marker = parent\n .append('marker')\n .attr('id', id)\n .attr('viewBox', '0 0 10 10')\n .attr('refX', 9)\n .attr('refY', 5)\n .attr('markerUnits', 'strokeWidth')\n .attr('markerWidth', 8)\n .attr('markerHeight', 6)\n .attr('orient', 'auto');\n\n const path = marker.append('path').attr('d', 'M 0 0 L 0 0 L 0 0 z');\n applyStyle(path, edge[type + 'Style']);\n };\n\n // Override normal arrowhead defined in d3. Remove style & add class to allow css styling.\n render.arrows().normal = function normal(parent, id) {\n const marker = parent\n .append('marker')\n .attr('id', id)\n .attr('viewBox', '0 0 10 10')\n .attr('refX', 9)\n .attr('refY', 5)\n .attr('markerUnits', 'strokeWidth')\n .attr('markerWidth', 8)\n .attr('markerHeight', 6)\n .attr('orient', 'auto');\n\n marker\n .append('path')\n .attr('d', 'M 0 0 L 10 5 L 0 10 z')\n .attr('class', 'arrowheadPath')\n .style('stroke-width', 1)\n .style('stroke-dasharray', '1,0');\n };\n\n // Set up an SVG group so that we can translate the final graph.\n const svg = root.select(`[id=\"${id}\"]`);\n\n // Run the renderer. This is what draws the final graph.\n const element = root.select('#' + id + ' g');\n render(element, g);\n\n element.selectAll('g.node').attr('title', function () {\n return diagObj.db.getTooltip(this.id);\n });\n\n // Index nodes\n diagObj.db.indexNodes('subGraph' + i);\n\n // reposition labels\n for (i = 0; i < subGraphs.length; i++) {\n subG = subGraphs[i];\n if (subG.title !== 'undefined') {\n const clusterRects = doc.querySelectorAll(\n '#' + id + ' [id=\"' + diagObj.db.lookUpDomId(subG.id) + '\"] rect'\n );\n const clusterEl = doc.querySelectorAll(\n '#' + id + ' [id=\"' + diagObj.db.lookUpDomId(subG.id) + '\"]'\n );\n\n const xPos = clusterRects[0].x.baseVal.value;\n const yPos = clusterRects[0].y.baseVal.value;\n const _width = clusterRects[0].width.baseVal.value;\n const cluster = select(clusterEl[0]);\n const te = cluster.select('.label');\n te.attr('transform', `translate(${xPos + _width / 2}, ${yPos + 14})`);\n te.attr('id', id + 'Text');\n\n for (let j = 0; j < subG.classes.length; j++) {\n clusterEl[0].classList.add(subG.classes[j]);\n }\n }\n }\n\n // Add label rects for non html labels\n if (!conf.htmlLabels) {\n const labels = doc.querySelectorAll('[id=\"' + id + '\"] .edgeLabel .label');\n for (const label of labels) {\n // Get dimensions of label\n const dim = label.getBBox();\n\n const rect = doc.createElementNS('http://www.w3.org/2000/svg', 'rect');\n rect.setAttribute('rx', 0);\n rect.setAttribute('ry', 0);\n rect.setAttribute('width', dim.width);\n rect.setAttribute('height', dim.height);\n // rect.setAttribute('style', 'fill:#e8e8e8;');\n\n label.insertBefore(rect, label.firstChild);\n }\n }\n setupGraphViewbox(g, svg, conf.diagramPadding, conf.useMaxWidth);\n\n // If node has a link, wrap it in an anchor SVG object.\n const keys = Object.keys(vert);\n keys.forEach(function (key) {\n const vertex = vert[key];\n\n if (vertex.link) {\n const node = root.select('#' + id + ' [id=\"' + diagObj.db.lookUpDomId(key) + '\"]');\n if (node) {\n const link = doc.createElementNS('http://www.w3.org/2000/svg', 'a');\n link.setAttributeNS('http://www.w3.org/2000/svg', 'class', vertex.classes.join(' '));\n link.setAttributeNS('http://www.w3.org/2000/svg', 'href', vertex.link);\n link.setAttributeNS('http://www.w3.org/2000/svg', 'rel', 'noopener');\n if (securityLevel === 'sandbox') {\n link.setAttributeNS('http://www.w3.org/2000/svg', 'target', '_top');\n } else if (vertex.linkTarget) {\n link.setAttributeNS('http://www.w3.org/2000/svg', 'target', vertex.linkTarget);\n }\n\n const linkNode = node.insert(function () {\n return link;\n }, ':first-child');\n\n const shape = node.select('.label-container');\n if (shape) {\n linkNode.append(function () {\n return shape.node();\n });\n }\n\n const label = node.select('.label');\n if (label) {\n linkNode.append(function () {\n return label.node();\n });\n }\n }\n }\n });\n};\n\nexport default {\n setConf,\n addVertices,\n addEdges,\n getClasses,\n draw,\n};\n","// @ts-ignore: TODO Fix ts errors\nimport flowParser from './parser/flow';\nimport flowDb from './flowDb';\nimport flowRenderer from './flowRenderer';\nimport flowRendererV2 from './flowRenderer-v2';\nimport flowStyles from './styles';\nimport { MermaidConfig } from '../../config.type';\n\nexport const diagram = {\n parser: flowParser,\n db: flowDb,\n renderer: flowRendererV2,\n styles: flowStyles,\n init: (cnf: MermaidConfig) => {\n if (!cnf.flowchart) {\n cnf.flowchart = {};\n }\n // TODO, broken as of 2022-09-14 (13809b50251845475e6dca65cc395761be38fbd2)\n cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;\n flowRenderer.setConf(cnf.flowchart);\n flowDb.clear();\n flowDb.setGen('gen-1');\n },\n};\n"],"names":["text","util.applyStyle","location","util.isSubgraph","util.applyTransition","d3.select","util.edgeToId","_.has","arrows","util.applyClass","_.uniqueId","d3\n .select","e","line","d3.line","d3.svg","_.range","shapes","_.pick","util\n .applyTransition","svg","d3.curveLinear","_.defaults","_.each","render","conf","graphlib.Graph","i","Render","normal","id","rect","flowParser"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAS,aAAa,UAAU;AAC9B,MAAI,CAAC,SAAS;AAAI,UAAM,IAAI,M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