"use strict";
/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
(self["webpackChunk_mdts_frontend"] = self["webpackChunk_mdts_frontend"] || []).push([["vendors-node_modules_mermaid_dist_chunks_mermaid_core_dagre-VKFMJZFB_mjs"],{

/***/ "./node_modules/mermaid/dist/chunks/mermaid.core/dagre-VKFMJZFB.mjs"
/*!**************************************************************************!*\
  !*** ./node_modules/mermaid/dist/chunks/mermaid.core/dagre-VKFMJZFB.mjs ***!
  \**************************************************************************/
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {

eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   getEdgesToRender: () => (/* binding */ getEdgesToRender),\n/* harmony export */   render: () => (/* binding */ render)\n/* harmony export */ });\n/* harmony import */ var _chunk_RYQCIY6F_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chunk-RYQCIY6F.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-RYQCIY6F.mjs\");\n/* harmony import */ var _chunk_52WLFC77_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./chunk-52WLFC77.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-52WLFC77.mjs\");\n/* harmony import */ var _chunk_ZGVPDNZ5_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./chunk-ZGVPDNZ5.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-ZGVPDNZ5.mjs\");\n/* harmony import */ var _chunk_C7G6YPKG_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./chunk-C7G6YPKG.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-C7G6YPKG.mjs\");\n/* harmony import */ var _chunk_7BUUIJ7U_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./chunk-7BUUIJ7U.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-7BUUIJ7U.mjs\");\n/* harmony import */ var _chunk_OGEWGWER_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./chunk-OGEWGWER.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-OGEWGWER.mjs\");\n/* harmony import */ var _chunk_Q4XR5HBZ_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./chunk-Q4XR5HBZ.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-Q4XR5HBZ.mjs\");\n/* harmony import */ var _chunk_HOUHSVGY_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./chunk-HOUHSVGY.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-HOUHSVGY.mjs\");\n/* harmony import */ var _chunk_ICXQ74PX_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./chunk-ICXQ74PX.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-ICXQ74PX.mjs\");\n/* harmony import */ var _chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./chunk-WYO6CB5R.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-WYO6CB5R.mjs\");\n/* harmony import */ var _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./chunk-X3CZISLH.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-X3CZISLH.mjs\");\n/* harmony import */ var _chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./chunk-Y2CYZVJY.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-Y2CYZVJY.mjs\");\n/* harmony import */ var dagre_d3_es_src_dagre_index_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! dagre-d3-es/src/dagre/index.js */ \"./node_modules/dagre-d3-es/src/dagre/index.js\");\n/* harmony import */ var dagre_d3_es_src_graphlib_json_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! dagre-d3-es/src/graphlib/json.js */ \"./node_modules/dagre-d3-es/src/graphlib/json.js\");\n/* harmony import */ var dagre_d3_es_src_graphlib_index_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! dagre-d3-es/src/graphlib/index.js */ \"./node_modules/dagre-d3-es/src/graphlib/index.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n// src/rendering-util/layout-algorithms/dagre/index.js\n\n\n\nvar clamp = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_11__.__name)((value, min, max) => Math.max(min, Math.min(max, value)), \"clamp\");\nvar getDefaultSelfLoopSide = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_11__.__name)((rankdir = \"TB\") => {\n  switch (rankdir) {\n    case \"BT\":\n      return \"bottom\";\n    case \"LR\":\n      return \"right\";\n    case \"RL\":\n      return \"left\";\n    case \"TB\":\n    default:\n      return \"top\";\n  }\n}, \"getDefaultSelfLoopSide\");\nvar shouldMergeSelfLoopSegments = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_11__.__name)((diagramType) => diagramType === \"flowchart\" || diagramType === \"flowchart-v2\" || diagramType === \"stateDiagram\", \"shouldMergeSelfLoopSegments\");\nvar getSelfLoopSide = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_11__.__name)((graph, node, segments, originalNodeId, rankdir) => {\n  const layoutHints = [];\n  const dummyNodeIds = /* @__PURE__ */ new Set();\n  segments.forEach(({ start, end }) => {\n    if (start !== originalNodeId) {\n      dummyNodeIds.add(start);\n    }\n    if (end !== originalNodeId) {\n      dummyNodeIds.add(end);\n    }\n  });\n  dummyNodeIds.forEach((id) => {\n    const dummyNode = graph.node(id);\n    if (typeof dummyNode?.x === \"number\" && typeof dummyNode?.y === \"number\") {\n      layoutHints.push(dummyNode);\n    }\n  });\n  if (layoutHints.length === 0) {\n    segments.forEach(({ edge }) => {\n      (edge.points ?? []).forEach((point) => {\n        if (typeof point?.x === \"number\" && typeof point?.y === \"number\") {\n          layoutHints.push(point);\n        }\n      });\n    });\n  }\n  if (layoutHints.length === 0) {\n    return getDefaultSelfLoopSide(rankdir);\n  }\n  const center = layoutHints.reduce(\n    (acc, point) => ({\n      x: acc.x + point.x / layoutHints.length,\n      y: acc.y + point.y / layoutHints.length\n    }),\n    { x: 0, y: 0 }\n  );\n  const dx = center.x - node.x;\n  const dy = center.y - node.y;\n  if (Math.abs(dx) > Math.abs(dy)) {\n    return dx > 0 ? \"right\" : \"left\";\n  }\n  if (Math.abs(dy) > 0) {\n    return dy > 0 ? \"bottom\" : \"top\";\n  }\n  return getDefaultSelfLoopSide(rankdir);\n}, \"getSelfLoopSide\");\nvar getSelfLoopPoints = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_11__.__name)((node, side = \"top\", yOffset = 0, labelWidth = 0) => {\n  const x = node.x;\n  const y = node.y - yOffset;\n  const halfWidth = node.width / 2;\n  const halfHeight = node.height / 2;\n  const maxSpan = Math.max(36, Math.min(100, node.width * 0.8));\n  const span = clamp(Math.max(labelWidth, node.width * 0.35), 36, maxSpan);\n  const depth = clamp(Math.min(node.width, node.height) * 0.45, 24, 48);\n  switch (side) {\n    case \"bottom\": {\n      const bottom = y + halfHeight;\n      return [\n        { x: x - span / 2, y: bottom },\n        { x: x - span / 2, y: bottom + depth },\n        { x: x + span / 2, y: bottom + depth },\n        { x: x + span / 2, y: bottom }\n      ];\n    }\n    case \"right\": {\n      const right = x + halfWidth;\n      return [\n        { x: right, y: y - span / 2 },\n        { x: right + depth, y: y - span / 2 },\n        { x: right + depth, y: y + span / 2 },\n        { x: right, y: y + span / 2 }\n      ];\n    }\n    case \"left\": {\n      const left = x - halfWidth;\n      return [\n        { x: left, y: y - span / 2 },\n        { x: left - depth, y: y - span / 2 },\n        { x: left - depth, y: y + span / 2 },\n        { x: left, y: y + span / 2 }\n      ];\n    }\n    case \"top\":\n    default: {\n      const top = y - halfHeight;\n      return [\n        { x: x - span / 2, y: top },\n        { x: x - span / 2, y: top - depth },\n        { x: x + span / 2, y: top - depth },\n        { x: x + span / 2, y: top }\n      ];\n    }\n  }\n}, \"getSelfLoopPoints\");\nvar getSelfLoopLabelPosition = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_11__.__name)((node, points, side = \"top\", yOffset = 0, label = {}) => {\n  const gap = 4;\n  const x = node.x;\n  const y = node.y - yOffset;\n  const labelWidth = label.width ?? 0;\n  const labelHeight = label.height ?? 0;\n  switch (side) {\n    case \"bottom\":\n      return { x, y: Math.max(...points.map((point) => point.y)) + labelHeight / 2 + gap };\n    case \"right\":\n      return { x: Math.max(...points.map((point) => point.x)) + labelWidth / 2 + gap, y };\n    case \"left\":\n      return { x: Math.min(...points.map((point) => point.x)) - labelWidth / 2 - gap, y };\n    case \"top\":\n    default:\n      return { x, y: Math.min(...points.map((point) => point.y)) - labelHeight / 2 - gap };\n  }\n}, \"getSelfLoopLabelPosition\");\nvar getEdgesToRender = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_11__.__name)((graph, yOffset = 0, { mergeSelfLoops = true } = {}) => {\n  const selfLoopEdgeGroups = /* @__PURE__ */ new Map();\n  const edgesToRender = [];\n  const rankdir = graph.graph()?.rankdir;\n  graph.edges().forEach((e) => {\n    const edge = graph.edge(e);\n    if (mergeSelfLoops && edge.selfLoop) {\n      const key = edge.selfLoop.id;\n      if (!selfLoopEdgeGroups.has(key)) {\n        selfLoopEdgeGroups.set(key, []);\n      }\n      selfLoopEdgeGroups.get(key).push({ edge, start: e.v, end: e.w });\n    } else {\n      edgesToRender.push({ edge, start: e.v, end: e.w });\n    }\n  });\n  selfLoopEdgeGroups.forEach((segments) => {\n    if (segments.length !== 3) {\n      segments.forEach((segment) => edgesToRender.push(segment));\n      return;\n    }\n    segments.sort((a, b) => a.edge.selfLoop.order - b.edge.selfLoop.order);\n    const [firstSegment, middleSegment, lastSegment] = segments;\n    const originalEdge = firstSegment.edge.originalEdge ?? middleSegment.edge.originalEdge ?? lastSegment.edge.originalEdge ?? middleSegment.edge;\n    const node = graph.node(originalEdge.start);\n    if (!node) {\n      segments.forEach((segment) => edgesToRender.push(segment));\n      return;\n    }\n    const label = {\n      width: middleSegment.edge.width,\n      height: middleSegment.edge.height\n    };\n    const side = getSelfLoopSide(graph, node, segments, originalEdge.start, rankdir);\n    const points = getSelfLoopPoints(node, side, yOffset, label.width ?? 0);\n    const labelPosition = getSelfLoopLabelPosition(node, points, side, yOffset, label);\n    const mergedEdge = {\n      ...middleSegment.edge,\n      ...originalEdge,\n      id: originalEdge.id,\n      points,\n      start: originalEdge.start,\n      end: originalEdge.end,\n      x: labelPosition.x,\n      y: labelPosition.y,\n      width: label.width,\n      height: label.height,\n      labelStyle: middleSegment.edge.labelStyle,\n      fromCluster: firstSegment.edge.fromCluster ?? middleSegment.edge.fromCluster ?? lastSegment.edge.fromCluster,\n      toCluster: firstSegment.edge.toCluster ?? middleSegment.edge.toCluster ?? lastSegment.edge.toCluster\n    };\n    delete mergedEdge.selfLoop;\n    delete mergedEdge.originalEdge;\n    edgesToRender.push({ edge: mergedEdge, start: mergedEdge.start, end: mergedEdge.end });\n  });\n  return edgesToRender;\n}, \"getEdgesToRender\");\nvar recursiveRender = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_11__.__name)(async (_elem, graph, diagramType, id, parentCluster, siteConfig) => {\n  _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.warn(\"Graph in recursive render:XAX\", dagre_d3_es_src_graphlib_json_js__WEBPACK_IMPORTED_MODULE_13__.write(graph), parentCluster);\n  const dir = graph.graph().rankdir;\n  _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.trace(\"Dir in recursive render - dir:\", dir);\n  const elem = _elem.insert(\"g\").attr(\"class\", \"root\");\n  if (!graph.nodes()) {\n    _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.info(\"No nodes found for\", graph);\n  } else {\n    _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.info(\"Recursive render XXX\", graph.nodes());\n  }\n  if (graph.edges().length > 0) {\n    _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.info(\"Recursive edges\", graph.edge(graph.edges()[0]));\n  }\n  const clusters = elem.insert(\"g\").attr(\"class\", \"clusters\");\n  const edgePaths = elem.insert(\"g\").attr(\"class\", \"edgePaths\");\n  const edgeLabels = elem.insert(\"g\").attr(\"class\", \"edgeLabels\");\n  const nodes = elem.insert(\"g\").attr(\"class\", \"nodes\");\n  const mergeSelfLoops = shouldMergeSelfLoopSegments(diagramType);\n  await Promise.all(\n    graph.nodes().map(async function(v) {\n      const node = graph.node(v);\n      if (parentCluster !== void 0) {\n        const data = JSON.parse(JSON.stringify(parentCluster.clusterData));\n        _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.trace(\n          \"Setting data for parent cluster XXX\\n Node.id = \",\n          v,\n          \"\\n data=\",\n          data.height,\n          \"\\nParent cluster\",\n          parentCluster.height\n        );\n        graph.setNode(parentCluster.id, data);\n        if (!graph.parent(v)) {\n          _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.trace(\"Setting parent\", v, parentCluster.id);\n          graph.setParent(v, parentCluster.id, data);\n        }\n      }\n      _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.info(\"(Insert) Node XXX\" + v + \": \" + JSON.stringify(graph.node(v)));\n      if (node?.clusterNode) {\n        _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.info(\"Cluster identified XBX\", v, node.width, graph.node(v));\n        const { ranksep, nodesep } = graph.graph();\n        node.graph.setGraph({\n          ...node.graph.graph(),\n          ranksep: ranksep + 25,\n          nodesep\n        });\n        const o = await recursiveRender(\n          nodes,\n          node.graph,\n          diagramType,\n          id,\n          graph.node(v),\n          siteConfig\n        );\n        const newEl = o.elem;\n        (0,_chunk_ZGVPDNZ5_mjs__WEBPACK_IMPORTED_MODULE_2__.updateNodeBounds)(node, newEl);\n        node.diff = o.diff || 0;\n        _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.info(\n          \"New compound node after recursive render XAX\",\n          v,\n          \"width\",\n          // node,\n          node.width,\n          \"height\",\n          node.height\n          // node.x,\n          // node.y\n        );\n        (0,_chunk_ZGVPDNZ5_mjs__WEBPACK_IMPORTED_MODULE_2__.setNodeElem)(newEl, node);\n      } else {\n        if (graph.children(v).length > 0) {\n          _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.trace(\n            \"Cluster - the non recursive path XBX\",\n            v,\n            node.id,\n            node,\n            node.width,\n            \"Graph:\",\n            graph\n          );\n          _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.trace((0,_chunk_RYQCIY6F_mjs__WEBPACK_IMPORTED_MODULE_0__.findNonClusterChild)(node.id, graph));\n          _chunk_RYQCIY6F_mjs__WEBPACK_IMPORTED_MODULE_0__.clusterDb.set(node.id, { id: (0,_chunk_RYQCIY6F_mjs__WEBPACK_IMPORTED_MODULE_0__.findNonClusterChild)(node.id, graph), node });\n        } else {\n          _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.trace(\"Node - the non recursive path XAX\", v, nodes, graph.node(v), dir);\n          await (0,_chunk_ZGVPDNZ5_mjs__WEBPACK_IMPORTED_MODULE_2__.insertNode)(nodes, graph.node(v), { config: siteConfig, dir });\n        }\n      }\n    })\n  );\n  const processEdges = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_11__.__name)(async () => {\n    const edgePromises = graph.edges().map(async function(e) {\n      const edge = graph.edge(e.v, e.w, e.name);\n      _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.info(\"Edge \" + e.v + \" -> \" + e.w + \": \" + JSON.stringify(e));\n      _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.info(\"Edge \" + e.v + \" -> \" + e.w + \": \", e, \" \", JSON.stringify(graph.edge(e)));\n      _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.info(\n        \"Fix\",\n        _chunk_RYQCIY6F_mjs__WEBPACK_IMPORTED_MODULE_0__.clusterDb,\n        \"ids:\",\n        e.v,\n        e.w,\n        \"Translating: \",\n        _chunk_RYQCIY6F_mjs__WEBPACK_IMPORTED_MODULE_0__.clusterDb.get(e.v),\n        _chunk_RYQCIY6F_mjs__WEBPACK_IMPORTED_MODULE_0__.clusterDb.get(e.w)\n      );\n      if (mergeSelfLoops && edge.selfLoop) {\n        if (edge.selfLoop.order !== 1) {\n          return;\n        }\n        const segmentId = edge.id;\n        edge.id = edge.selfLoop.id;\n        await (0,_chunk_52WLFC77_mjs__WEBPACK_IMPORTED_MODULE_1__.insertEdgeLabel)(edgeLabels, edge);\n        edge.id = segmentId;\n        return;\n      }\n      await (0,_chunk_52WLFC77_mjs__WEBPACK_IMPORTED_MODULE_1__.insertEdgeLabel)(edgeLabels, edge);\n    });\n    await Promise.all(edgePromises);\n  }, \"processEdges\");\n  await processEdges();\n  _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.info(\"Graph before layout:\", JSON.stringify(dagre_d3_es_src_graphlib_json_js__WEBPACK_IMPORTED_MODULE_13__.write(graph)));\n  _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.info(\"############################################# XXX\");\n  _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.info(\"###                Layout                 ### XXX\");\n  _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.info(\"############################################# XXX\");\n  (0,dagre_d3_es_src_dagre_index_js__WEBPACK_IMPORTED_MODULE_12__.layout)(graph);\n  _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.info(\"Graph after layout:\", JSON.stringify(dagre_d3_es_src_graphlib_json_js__WEBPACK_IMPORTED_MODULE_13__.write(graph)));\n  let diff = 0;\n  let { subGraphTitleTotalMargin } = (0,_chunk_OGEWGWER_mjs__WEBPACK_IMPORTED_MODULE_5__.getSubGraphTitleMargins)(siteConfig);\n  await Promise.all(\n    (0,_chunk_RYQCIY6F_mjs__WEBPACK_IMPORTED_MODULE_0__.sortNodesByHierarchy)(graph).map(async function(v) {\n      const node = graph.node(v);\n      _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.info(\n        \"Position XBX => \" + v + \": (\" + node.x,\n        \",\" + node.y,\n        \") width: \",\n        node.width,\n        \" height: \",\n        node.height\n      );\n      if (node?.clusterNode) {\n        node.y += subGraphTitleTotalMargin;\n        _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.info(\n          \"A tainted cluster node XBX1\",\n          v,\n          node.id,\n          node.width,\n          node.height,\n          node.x,\n          node.y,\n          graph.parent(v)\n        );\n        _chunk_RYQCIY6F_mjs__WEBPACK_IMPORTED_MODULE_0__.clusterDb.get(node.id).node = node;\n        (0,_chunk_ZGVPDNZ5_mjs__WEBPACK_IMPORTED_MODULE_2__.positionNode)(node);\n      } else {\n        if (graph.children(v).length > 0) {\n          _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.info(\n            \"A pure cluster node XBX1\",\n            v,\n            node.id,\n            node.x,\n            node.y,\n            node.width,\n            node.height,\n            graph.parent(v)\n          );\n          node.height += subGraphTitleTotalMargin;\n          graph.node(node.parentId);\n          const halfPadding = node?.padding / 2 || 0;\n          const labelHeight = node?.labelBBox?.height || 0;\n          const offsetY = labelHeight - halfPadding || 0;\n          _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.debug(\"OffsetY\", offsetY, \"labelHeight\", labelHeight, \"halfPadding\", halfPadding);\n          await (0,_chunk_ZGVPDNZ5_mjs__WEBPACK_IMPORTED_MODULE_2__.insertCluster)(clusters, node);\n          _chunk_RYQCIY6F_mjs__WEBPACK_IMPORTED_MODULE_0__.clusterDb.get(node.id).node = node;\n        } else {\n          const parent = graph.node(node.parentId);\n          node.y += subGraphTitleTotalMargin / 2;\n          _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.info(\n            \"A regular node XBX1 - using the padding\",\n            node.id,\n            \"parent\",\n            node.parentId,\n            node.width,\n            node.height,\n            node.x,\n            node.y,\n            \"offsetY\",\n            node.offsetY,\n            \"parent\",\n            parent,\n            parent?.offsetY,\n            node\n          );\n          (0,_chunk_ZGVPDNZ5_mjs__WEBPACK_IMPORTED_MODULE_2__.positionNode)(node);\n        }\n      }\n    })\n  );\n  const edgeOffsetY = subGraphTitleTotalMargin / 2;\n  const edgesToRender = getEdgesToRender(graph, edgeOffsetY, { mergeSelfLoops });\n  edgesToRender.forEach(function({ edge, start, end }) {\n    _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.info(\"Edge \" + start + \" -> \" + end + \": \" + JSON.stringify(edge), edge);\n    edge.points.forEach((point) => point.y += edgeOffsetY);\n    const startNode = graph.node(start);\n    const endNode = graph.node(end);\n    const paths = (0,_chunk_52WLFC77_mjs__WEBPACK_IMPORTED_MODULE_1__.insertEdge)(edgePaths, edge, _chunk_RYQCIY6F_mjs__WEBPACK_IMPORTED_MODULE_0__.clusterDb, diagramType, startNode, endNode, id);\n    (0,_chunk_52WLFC77_mjs__WEBPACK_IMPORTED_MODULE_1__.positionEdgeLabel)(edge, paths);\n  });\n  graph.nodes().forEach(function(v) {\n    const n = graph.node(v);\n    _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.info(v, n.type, n.diff);\n    if (n.isGroup) {\n      diff = n.diff;\n    }\n  });\n  _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.warn(\"Returning from recursive render XAX\", elem, diff);\n  return { elem, diff };\n}, \"recursiveRender\");\nvar render = /* @__PURE__ */ (0,_chunk_Y2CYZVJY_mjs__WEBPACK_IMPORTED_MODULE_11__.__name)(async (data4Layout, svg) => {\n  const graph = new dagre_d3_es_src_graphlib_index_js__WEBPACK_IMPORTED_MODULE_14__.Graph({\n    multigraph: true,\n    compound: true\n  }).setGraph({\n    rankdir: data4Layout.direction,\n    nodesep: data4Layout.config?.nodeSpacing || data4Layout.config?.flowchart?.nodeSpacing || data4Layout.nodeSpacing,\n    ranksep: data4Layout.config?.rankSpacing || data4Layout.config?.flowchart?.rankSpacing || data4Layout.rankSpacing,\n    marginx: 8,\n    marginy: 8\n  }).setDefaultEdgeLabel(function() {\n    return {};\n  });\n  const element = svg.select(\"g\");\n  (0,_chunk_52WLFC77_mjs__WEBPACK_IMPORTED_MODULE_1__.markers_default)(element, data4Layout.markers, data4Layout.type, data4Layout.diagramId);\n  (0,_chunk_ZGVPDNZ5_mjs__WEBPACK_IMPORTED_MODULE_2__.clear2)();\n  (0,_chunk_52WLFC77_mjs__WEBPACK_IMPORTED_MODULE_1__.clear)();\n  (0,_chunk_ZGVPDNZ5_mjs__WEBPACK_IMPORTED_MODULE_2__.clear)();\n  (0,_chunk_RYQCIY6F_mjs__WEBPACK_IMPORTED_MODULE_0__.clear)();\n  data4Layout.nodes.forEach((node) => {\n    graph.setNode(node.id, { ...node });\n    if (node.parentId) {\n      graph.setParent(node.id, node.parentId);\n    }\n  });\n  _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.debug(\"Edges:\", data4Layout.edges);\n  data4Layout.edges.forEach((edge) => {\n    if (edge.start === edge.end) {\n      const nodeId = edge.start;\n      const specialId1 = nodeId + \"---\" + nodeId + \"---1\";\n      const specialId2 = nodeId + \"---\" + nodeId + \"---2\";\n      const node = graph.node(nodeId);\n      graph.setNode(specialId1, {\n        domId: specialId1,\n        id: specialId1,\n        parentId: node.parentId,\n        labelStyle: \"\",\n        label: \"\",\n        padding: 0,\n        shape: \"labelRect\",\n        // shape: 'rect',\n        style: \"\",\n        width: 10,\n        height: 10\n      });\n      graph.setParent(specialId1, node.parentId);\n      graph.setNode(specialId2, {\n        domId: specialId2,\n        id: specialId2,\n        parentId: node.parentId,\n        labelStyle: \"\",\n        padding: 0,\n        // shape: 'rect',\n        shape: \"labelRect\",\n        label: \"\",\n        style: \"\",\n        width: 10,\n        height: 10\n      });\n      graph.setParent(specialId2, node.parentId);\n      const originalEdge = structuredClone(edge);\n      const edge1 = structuredClone(edge);\n      const edgeMid = structuredClone(edge);\n      const edge2 = structuredClone(edge);\n      edge1.originalEdge = originalEdge;\n      edge1.selfLoop = { id: originalEdge.id, order: 0 };\n      edgeMid.originalEdge = originalEdge;\n      edgeMid.selfLoop = { id: originalEdge.id, order: 1 };\n      edge2.originalEdge = originalEdge;\n      edge2.selfLoop = { id: originalEdge.id, order: 2 };\n      edge1.label = \"\";\n      edge1.arrowTypeEnd = \"none\";\n      edge1.endLabelLeft = \"\";\n      edge1.endLabelRight = \"\";\n      edge1.startLabelLeft = \"\";\n      edge1.id = nodeId + \"-cyclic-special-1\";\n      edgeMid.startLabelRight = \"\";\n      edgeMid.startLabelLeft = \"\";\n      edgeMid.endLabelLeft = \"\";\n      edgeMid.endLabelRight = \"\";\n      edgeMid.arrowTypeStart = \"none\";\n      edgeMid.arrowTypeEnd = \"none\";\n      edgeMid.id = nodeId + \"-cyclic-special-mid\";\n      edge2.label = \"\";\n      edge2.startLabelRight = \"\";\n      edge2.startLabelLeft = \"\";\n      edge2.arrowTypeStart = \"none\";\n      if (node.isGroup) {\n        edge1.fromCluster = nodeId;\n        edge2.toCluster = nodeId;\n      }\n      edge2.id = nodeId + \"-cyclic-special-2\";\n      edge2.arrowTypeStart = \"none\";\n      graph.setEdge(nodeId, specialId1, edge1, nodeId + \"-cyclic-special-0\");\n      graph.setEdge(specialId1, specialId2, edgeMid, nodeId + \"-cyclic-special-1\");\n      graph.setEdge(specialId2, nodeId, edge2, nodeId + \"-cyclic-special-2\");\n    } else {\n      graph.setEdge(edge.start, edge.end, { ...edge }, edge.id);\n    }\n  });\n  _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.warn(\"Graph at first:\", JSON.stringify(dagre_d3_es_src_graphlib_json_js__WEBPACK_IMPORTED_MODULE_13__.write(graph)));\n  (0,_chunk_RYQCIY6F_mjs__WEBPACK_IMPORTED_MODULE_0__.adjustClustersAndEdges)(graph);\n  _chunk_X3CZISLH_mjs__WEBPACK_IMPORTED_MODULE_10__.log.warn(\"Graph after XAX:\", JSON.stringify(dagre_d3_es_src_graphlib_json_js__WEBPACK_IMPORTED_MODULE_13__.write(graph)));\n  const siteConfig = (0,_chunk_WYO6CB5R_mjs__WEBPACK_IMPORTED_MODULE_9__.getConfig2)();\n  await recursiveRender(\n    element,\n    graph,\n    data4Layout.type,\n    data4Layout.diagramId,\n    void 0,\n    siteConfig\n  );\n}, \"render\");\n\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/mermaid/dist/chunks/mermaid.core/dagre-VKFMJZFB.mjs?\n}");

/***/ }

}]);