"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_JUPYTERLAB_CORE_OUTPUT"] = self["webpackChunk_JUPYTERLAB_CORE_OUTPUT"] || []).push([["vendors-node_modules_mermaid_dist_chunks_mermaid_core_diagram-PSM6KHXK_mjs"],{

/***/ "../node_modules/mermaid/dist/chunks/mermaid.core/chunk-4BX2VUAB.mjs":
/*!***************************************************************************!*\
  !*** ../node_modules/mermaid/dist/chunks/mermaid.core/chunk-4BX2VUAB.mjs ***!
  \***************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   populateCommonDb: () => (/* binding */ populateCommonDb)\n/* harmony export */ });\n/* harmony import */ var _chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chunk-AGHRB4JF.mjs */ \"../node_modules/mermaid/dist/chunks/mermaid.core/chunk-AGHRB4JF.mjs\");\n\n\n// src/diagrams/common/populateCommonDb.ts\nfunction populateCommonDb(ast, db) {\n  if (ast.accDescr) {\n    db.setAccDescription?.(ast.accDescr);\n  }\n  if (ast.accTitle) {\n    db.setAccTitle?.(ast.accTitle);\n  }\n  if (ast.title) {\n    db.setDiagramTitle?.(ast.title);\n  }\n}\n(0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_0__.__name)(populateCommonDb, \"populateCommonDb\");\n\n\n\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/mermaid/dist/chunks/mermaid.core/chunk-4BX2VUAB.mjs?");

/***/ }),

/***/ "../node_modules/mermaid/dist/chunks/mermaid.core/chunk-QN33PNHL.mjs":
/*!***************************************************************************!*\
  !*** ../node_modules/mermaid/dist/chunks/mermaid.core/chunk-QN33PNHL.mjs ***!
  \***************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   setupViewPortForSVG: () => (/* binding */ setupViewPortForSVG)\n/* harmony export */ });\n/* harmony import */ var _chunk_ABZYJK2D_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chunk-ABZYJK2D.mjs */ \"../node_modules/mermaid/dist/chunks/mermaid.core/chunk-ABZYJK2D.mjs\");\n/* harmony import */ var _chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./chunk-AGHRB4JF.mjs */ \"../node_modules/mermaid/dist/chunks/mermaid.core/chunk-AGHRB4JF.mjs\");\n\n\n\n// src/rendering-util/setupViewPortForSVG.ts\nvar setupViewPortForSVG = /* @__PURE__ */ (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_1__.__name)((svg, padding, cssDiagram, useMaxWidth) => {\n  svg.attr(\"class\", cssDiagram);\n  const { width, height, x, y } = calculateDimensionsWithPadding(svg, padding);\n  (0,_chunk_ABZYJK2D_mjs__WEBPACK_IMPORTED_MODULE_0__.configureSvgSize)(svg, height, width, useMaxWidth);\n  const viewBox = createViewBox(x, y, width, height, padding);\n  svg.attr(\"viewBox\", viewBox);\n  _chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_1__.log.debug(`viewBox configured: ${viewBox} with padding: ${padding}`);\n}, \"setupViewPortForSVG\");\nvar calculateDimensionsWithPadding = /* @__PURE__ */ (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_1__.__name)((svg, padding) => {\n  const bounds = svg.node()?.getBBox() || { width: 0, height: 0, x: 0, y: 0 };\n  return {\n    width: bounds.width + padding * 2,\n    height: bounds.height + padding * 2,\n    x: bounds.x,\n    y: bounds.y\n  };\n}, \"calculateDimensionsWithPadding\");\nvar createViewBox = /* @__PURE__ */ (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_1__.__name)((x, y, width, height, padding) => {\n  return `${x - padding} ${y - padding} ${width} ${height}`;\n}, \"createViewBox\");\n\n\n\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/mermaid/dist/chunks/mermaid.core/chunk-QN33PNHL.mjs?");

/***/ }),

/***/ "../node_modules/mermaid/dist/chunks/mermaid.core/diagram-PSM6KHXK.mjs":
/*!*****************************************************************************!*\
  !*** ../node_modules/mermaid/dist/chunks/mermaid.core/diagram-PSM6KHXK.mjs ***!
  \*****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   diagram: () => (/* binding */ diagram)\n/* harmony export */ });\n/* harmony import */ var _chunk_EXTU4WIE_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chunk-EXTU4WIE.mjs */ \"../node_modules/mermaid/dist/chunks/mermaid.core/chunk-EXTU4WIE.mjs\");\n/* harmony import */ var _chunk_QN33PNHL_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./chunk-QN33PNHL.mjs */ \"../node_modules/mermaid/dist/chunks/mermaid.core/chunk-QN33PNHL.mjs\");\n/* harmony import */ var _chunk_ATLVNIR6_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./chunk-ATLVNIR6.mjs */ \"../node_modules/mermaid/dist/chunks/mermaid.core/chunk-ATLVNIR6.mjs\");\n/* harmony import */ var _chunk_4BX2VUAB_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./chunk-4BX2VUAB.mjs */ \"../node_modules/mermaid/dist/chunks/mermaid.core/chunk-4BX2VUAB.mjs\");\n/* harmony import */ var _chunk_S3R3BYOJ_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./chunk-S3R3BYOJ.mjs */ \"../node_modules/mermaid/dist/chunks/mermaid.core/chunk-S3R3BYOJ.mjs\");\n/* harmony import */ var _chunk_ABZYJK2D_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./chunk-ABZYJK2D.mjs */ \"../node_modules/mermaid/dist/chunks/mermaid.core/chunk-ABZYJK2D.mjs\");\n/* harmony import */ var _chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./chunk-AGHRB4JF.mjs */ \"../node_modules/mermaid/dist/chunks/mermaid.core/chunk-AGHRB4JF.mjs\");\n/* harmony import */ var _mermaid_js_parser__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @mermaid-js/parser */ \"../node_modules/@mermaid-js/parser/dist/mermaid-parser.core.mjs\");\n/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! d3 */ \"../node_modules/d3/src/index.js\");\n\n\n\n\n\n\n\n\n// src/diagrams/treemap/db.ts\nvar TreeMapDB = class {\n  constructor() {\n    this.nodes = [];\n    this.levels = /* @__PURE__ */ new Map();\n    this.outerNodes = [];\n    this.classes = /* @__PURE__ */ new Map();\n    this.setAccTitle = _chunk_ABZYJK2D_mjs__WEBPACK_IMPORTED_MODULE_5__.setAccTitle;\n    this.getAccTitle = _chunk_ABZYJK2D_mjs__WEBPACK_IMPORTED_MODULE_5__.getAccTitle;\n    this.setDiagramTitle = _chunk_ABZYJK2D_mjs__WEBPACK_IMPORTED_MODULE_5__.setDiagramTitle;\n    this.getDiagramTitle = _chunk_ABZYJK2D_mjs__WEBPACK_IMPORTED_MODULE_5__.getDiagramTitle;\n    this.getAccDescription = _chunk_ABZYJK2D_mjs__WEBPACK_IMPORTED_MODULE_5__.getAccDescription;\n    this.setAccDescription = _chunk_ABZYJK2D_mjs__WEBPACK_IMPORTED_MODULE_5__.setAccDescription;\n  }\n  static {\n    (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_6__.__name)(this, \"TreeMapDB\");\n  }\n  getNodes() {\n    return this.nodes;\n  }\n  getConfig() {\n    const defaultConfig = _chunk_ABZYJK2D_mjs__WEBPACK_IMPORTED_MODULE_5__.defaultConfig_default;\n    const userConfig = (0,_chunk_ABZYJK2D_mjs__WEBPACK_IMPORTED_MODULE_5__.getConfig)();\n    return (0,_chunk_S3R3BYOJ_mjs__WEBPACK_IMPORTED_MODULE_4__.cleanAndMerge)({\n      ...defaultConfig.treemap,\n      ...userConfig.treemap ?? {}\n    });\n  }\n  addNode(node, level) {\n    this.nodes.push(node);\n    this.levels.set(node, level);\n    if (level === 0) {\n      this.outerNodes.push(node);\n      this.root ??= node;\n    }\n  }\n  getRoot() {\n    return { name: \"\", children: this.outerNodes };\n  }\n  addClass(id, _style) {\n    const styleClass = this.classes.get(id) ?? { id, styles: [], textStyles: [] };\n    const styles = _style.replace(/\\\\,/g, \"\\xA7\\xA7\\xA7\").replace(/,/g, \";\").replace(/§§§/g, \",\").split(\";\");\n    if (styles) {\n      styles.forEach((s) => {\n        if ((0,_chunk_ATLVNIR6_mjs__WEBPACK_IMPORTED_MODULE_2__.isLabelStyle)(s)) {\n          if (styleClass?.textStyles) {\n            styleClass.textStyles.push(s);\n          } else {\n            styleClass.textStyles = [s];\n          }\n        }\n        if (styleClass?.styles) {\n          styleClass.styles.push(s);\n        } else {\n          styleClass.styles = [s];\n        }\n      });\n    }\n    this.classes.set(id, styleClass);\n  }\n  getClasses() {\n    return this.classes;\n  }\n  getStylesForClass(classSelector) {\n    return this.classes.get(classSelector)?.styles ?? [];\n  }\n  clear() {\n    (0,_chunk_ABZYJK2D_mjs__WEBPACK_IMPORTED_MODULE_5__.clear)();\n    this.nodes = [];\n    this.levels = /* @__PURE__ */ new Map();\n    this.outerNodes = [];\n    this.classes = /* @__PURE__ */ new Map();\n    this.root = void 0;\n  }\n};\n\n// src/diagrams/treemap/parser.ts\n\n\n// src/diagrams/treemap/utils.ts\nfunction buildHierarchy(items) {\n  if (!items.length) {\n    return [];\n  }\n  const root = [];\n  const stack = [];\n  items.forEach((item) => {\n    const node = {\n      name: item.name,\n      children: item.type === \"Leaf\" ? void 0 : []\n    };\n    node.classSelector = item?.classSelector;\n    if (item?.cssCompiledStyles) {\n      node.cssCompiledStyles = [item.cssCompiledStyles];\n    }\n    if (item.type === \"Leaf\" && item.value !== void 0) {\n      node.value = item.value;\n    }\n    while (stack.length > 0 && stack[stack.length - 1].level >= item.level) {\n      stack.pop();\n    }\n    if (stack.length === 0) {\n      root.push(node);\n    } else {\n      const parent = stack[stack.length - 1].node;\n      if (parent.children) {\n        parent.children.push(node);\n      } else {\n        parent.children = [node];\n      }\n    }\n    if (item.type !== \"Leaf\") {\n      stack.push({ node, level: item.level });\n    }\n  });\n  return root;\n}\n(0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_6__.__name)(buildHierarchy, \"buildHierarchy\");\n\n// src/diagrams/treemap/parser.ts\nvar populate = /* @__PURE__ */ (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_6__.__name)((ast, db) => {\n  (0,_chunk_4BX2VUAB_mjs__WEBPACK_IMPORTED_MODULE_3__.populateCommonDb)(ast, db);\n  const items = [];\n  for (const row of ast.TreemapRows ?? []) {\n    if (row.$type === \"ClassDefStatement\") {\n      db.addClass(row.className ?? \"\", row.styleText ?? \"\");\n    }\n  }\n  for (const row of ast.TreemapRows ?? []) {\n    const item = row.item;\n    if (!item) {\n      continue;\n    }\n    const level = row.indent ? parseInt(row.indent) : 0;\n    const name = getItemName(item);\n    const styles = item.classSelector ? db.getStylesForClass(item.classSelector) : [];\n    const cssCompiledStyles = styles.length > 0 ? styles.join(\";\") : void 0;\n    const itemData = {\n      level,\n      name,\n      type: item.$type,\n      value: item.value,\n      classSelector: item.classSelector,\n      cssCompiledStyles\n    };\n    items.push(itemData);\n  }\n  const hierarchyNodes = buildHierarchy(items);\n  const addNodesRecursively = /* @__PURE__ */ (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_6__.__name)((nodes, level) => {\n    for (const node of nodes) {\n      db.addNode(node, level);\n      if (node.children && node.children.length > 0) {\n        addNodesRecursively(node.children, level + 1);\n      }\n    }\n  }, \"addNodesRecursively\");\n  addNodesRecursively(hierarchyNodes, 0);\n}, \"populate\");\nvar getItemName = /* @__PURE__ */ (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_6__.__name)((item) => {\n  return item.name ? String(item.name) : \"\";\n}, \"getItemName\");\nvar parser = {\n  // @ts-expect-error - TreeMapDB is not assignable to DiagramDB\n  parser: { yy: void 0 },\n  parse: /* @__PURE__ */ (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_6__.__name)(async (text) => {\n    try {\n      const parseFunc = _mermaid_js_parser__WEBPACK_IMPORTED_MODULE_7__.parse;\n      const ast = await parseFunc(\"treemap\", text);\n      _chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_6__.log.debug(\"Treemap AST:\", ast);\n      const db = parser.parser?.yy;\n      if (!(db instanceof TreeMapDB)) {\n        throw new Error(\n          \"parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.\"\n        );\n      }\n      populate(ast, db);\n    } catch (error) {\n      _chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_6__.log.error(\"Error parsing treemap:\", error);\n      throw error;\n    }\n  }, \"parse\")\n};\n\n// src/diagrams/treemap/renderer.ts\n\nvar DEFAULT_INNER_PADDING = 10;\nvar SECTION_INNER_PADDING = 10;\nvar SECTION_HEADER_HEIGHT = 25;\nvar draw = /* @__PURE__ */ (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_6__.__name)((_text, id, _version, diagram2) => {\n  const treemapDb = diagram2.db;\n  const config = treemapDb.getConfig();\n  const treemapInnerPadding = config.padding ?? DEFAULT_INNER_PADDING;\n  const title = treemapDb.getDiagramTitle();\n  const root = treemapDb.getRoot();\n  const { themeVariables } = (0,_chunk_ABZYJK2D_mjs__WEBPACK_IMPORTED_MODULE_5__.getConfig)();\n  if (!root) {\n    return;\n  }\n  const titleHeight = title ? 30 : 0;\n  const svg = (0,_chunk_EXTU4WIE_mjs__WEBPACK_IMPORTED_MODULE_0__.selectSvgElement)(id);\n  const width = config.nodeWidth ? config.nodeWidth * SECTION_INNER_PADDING : 960;\n  const height = config.nodeHeight ? config.nodeHeight * SECTION_INNER_PADDING : 500;\n  const svgWidth = width;\n  const svgHeight = height + titleHeight;\n  svg.attr(\"viewBox\", `0 0 ${svgWidth} ${svgHeight}`);\n  (0,_chunk_ABZYJK2D_mjs__WEBPACK_IMPORTED_MODULE_5__.configureSvgSize)(svg, svgHeight, svgWidth, config.useMaxWidth);\n  let valueFormat;\n  try {\n    const formatStr = config.valueFormat || \",\";\n    if (formatStr === \"$0,0\") {\n      valueFormat = /* @__PURE__ */ (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_6__.__name)((value) => \"$\" + (0,d3__WEBPACK_IMPORTED_MODULE_8__.format)(\",\")(value), \"valueFormat\");\n    } else if (formatStr.startsWith(\"$\") && formatStr.includes(\",\")) {\n      const precision = /\\.\\d+/.exec(formatStr);\n      const precisionStr = precision ? precision[0] : \"\";\n      valueFormat = /* @__PURE__ */ (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_6__.__name)((value) => \"$\" + (0,d3__WEBPACK_IMPORTED_MODULE_8__.format)(\",\" + precisionStr)(value), \"valueFormat\");\n    } else if (formatStr.startsWith(\"$\")) {\n      const restOfFormat = formatStr.substring(1);\n      valueFormat = /* @__PURE__ */ (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_6__.__name)((value) => \"$\" + (0,d3__WEBPACK_IMPORTED_MODULE_8__.format)(restOfFormat || \"\")(value), \"valueFormat\");\n    } else {\n      valueFormat = (0,d3__WEBPACK_IMPORTED_MODULE_8__.format)(formatStr);\n    }\n  } catch (error) {\n    _chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_6__.log.error(\"Error creating format function:\", error);\n    valueFormat = (0,d3__WEBPACK_IMPORTED_MODULE_8__.format)(\",\");\n  }\n  const colorScale = (0,d3__WEBPACK_IMPORTED_MODULE_8__.scaleOrdinal)().range([\n    \"transparent\",\n    themeVariables.cScale0,\n    themeVariables.cScale1,\n    themeVariables.cScale2,\n    themeVariables.cScale3,\n    themeVariables.cScale4,\n    themeVariables.cScale5,\n    themeVariables.cScale6,\n    themeVariables.cScale7,\n    themeVariables.cScale8,\n    themeVariables.cScale9,\n    themeVariables.cScale10,\n    themeVariables.cScale11\n  ]);\n  const colorScalePeer = (0,d3__WEBPACK_IMPORTED_MODULE_8__.scaleOrdinal)().range([\n    \"transparent\",\n    themeVariables.cScalePeer0,\n    themeVariables.cScalePeer1,\n    themeVariables.cScalePeer2,\n    themeVariables.cScalePeer3,\n    themeVariables.cScalePeer4,\n    themeVariables.cScalePeer5,\n    themeVariables.cScalePeer6,\n    themeVariables.cScalePeer7,\n    themeVariables.cScalePeer8,\n    themeVariables.cScalePeer9,\n    themeVariables.cScalePeer10,\n    themeVariables.cScalePeer11\n  ]);\n  const colorScaleLabel = (0,d3__WEBPACK_IMPORTED_MODULE_8__.scaleOrdinal)().range([\n    themeVariables.cScaleLabel0,\n    themeVariables.cScaleLabel1,\n    themeVariables.cScaleLabel2,\n    themeVariables.cScaleLabel3,\n    themeVariables.cScaleLabel4,\n    themeVariables.cScaleLabel5,\n    themeVariables.cScaleLabel6,\n    themeVariables.cScaleLabel7,\n    themeVariables.cScaleLabel8,\n    themeVariables.cScaleLabel9,\n    themeVariables.cScaleLabel10,\n    themeVariables.cScaleLabel11\n  ]);\n  if (title) {\n    svg.append(\"text\").attr(\"x\", svgWidth / 2).attr(\"y\", titleHeight / 2).attr(\"class\", \"treemapTitle\").attr(\"text-anchor\", \"middle\").attr(\"dominant-baseline\", \"middle\").text(title);\n  }\n  const g = svg.append(\"g\").attr(\"transform\", `translate(0, ${titleHeight})`).attr(\"class\", \"treemapContainer\");\n  const hierarchyRoot = (0,d3__WEBPACK_IMPORTED_MODULE_8__.hierarchy)(root).sum((d) => d.value ?? 0).sort((a, b) => (b.value ?? 0) - (a.value ?? 0));\n  const treemapLayout = (0,d3__WEBPACK_IMPORTED_MODULE_8__.treemap)().size([width, height]).paddingTop(\n    (d) => d.children && d.children.length > 0 ? SECTION_HEADER_HEIGHT + SECTION_INNER_PADDING : 0\n  ).paddingInner(treemapInnerPadding).paddingLeft((d) => d.children && d.children.length > 0 ? SECTION_INNER_PADDING : 0).paddingRight((d) => d.children && d.children.length > 0 ? SECTION_INNER_PADDING : 0).paddingBottom((d) => d.children && d.children.length > 0 ? SECTION_INNER_PADDING : 0).round(true);\n  const treemapData = treemapLayout(hierarchyRoot);\n  const branchNodes = treemapData.descendants().filter((d) => d.children && d.children.length > 0);\n  const sections = g.selectAll(\".treemapSection\").data(branchNodes).enter().append(\"g\").attr(\"class\", \"treemapSection\").attr(\"transform\", (d) => `translate(${d.x0},${d.y0})`);\n  sections.append(\"rect\").attr(\"width\", (d) => d.x1 - d.x0).attr(\"height\", SECTION_HEADER_HEIGHT).attr(\"class\", \"treemapSectionHeader\").attr(\"fill\", \"none\").attr(\"fill-opacity\", 0.6).attr(\"stroke-width\", 0.6).attr(\"style\", (d) => {\n    if (d.depth === 0) {\n      return \"display: none;\";\n    }\n    return \"\";\n  });\n  sections.append(\"clipPath\").attr(\"id\", (_d, i) => `clip-section-${id}-${i}`).append(\"rect\").attr(\"width\", (d) => Math.max(0, d.x1 - d.x0 - 12)).attr(\"height\", SECTION_HEADER_HEIGHT);\n  sections.append(\"rect\").attr(\"width\", (d) => d.x1 - d.x0).attr(\"height\", (d) => d.y1 - d.y0).attr(\"class\", (_d, i) => {\n    return `treemapSection section${i}`;\n  }).attr(\"fill\", (d) => colorScale(d.data.name)).attr(\"fill-opacity\", 0.6).attr(\"stroke\", (d) => colorScalePeer(d.data.name)).attr(\"stroke-width\", 2).attr(\"stroke-opacity\", 0.4).attr(\"style\", (d) => {\n    if (d.depth === 0) {\n      return \"display: none;\";\n    }\n    const styles = (0,_chunk_ATLVNIR6_mjs__WEBPACK_IMPORTED_MODULE_2__.styles2String)({ cssCompiledStyles: d.data.cssCompiledStyles });\n    return styles.nodeStyles + \";\" + styles.borderStyles.join(\";\");\n  });\n  sections.append(\"text\").attr(\"class\", \"treemapSectionLabel\").attr(\"x\", 6).attr(\"y\", SECTION_HEADER_HEIGHT / 2).attr(\"dominant-baseline\", \"middle\").text((d) => d.depth === 0 ? \"\" : d.data.name).attr(\"font-weight\", \"bold\").attr(\"style\", (d) => {\n    if (d.depth === 0) {\n      return \"display: none;\";\n    }\n    const labelStyles = \"dominant-baseline: middle; font-size: 12px; fill:\" + colorScaleLabel(d.data.name) + \"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\";\n    const styles = (0,_chunk_ATLVNIR6_mjs__WEBPACK_IMPORTED_MODULE_2__.styles2String)({ cssCompiledStyles: d.data.cssCompiledStyles });\n    return labelStyles + styles.labelStyles.replace(\"color:\", \"fill:\");\n  }).each(function(d) {\n    if (d.depth === 0) {\n      return;\n    }\n    const self = (0,d3__WEBPACK_IMPORTED_MODULE_8__.select)(this);\n    const originalText = d.data.name;\n    self.text(originalText);\n    const totalHeaderWidth = d.x1 - d.x0;\n    const labelXPosition = 6;\n    let spaceForTextContent;\n    if (config.showValues !== false && d.value) {\n      const valueEndsAtXRelative = totalHeaderWidth - 10;\n      const estimatedValueTextActualWidth = 30;\n      const gapBetweenLabelAndValue = 10;\n      const labelMustEndBeforeX = valueEndsAtXRelative - estimatedValueTextActualWidth - gapBetweenLabelAndValue;\n      spaceForTextContent = labelMustEndBeforeX - labelXPosition;\n    } else {\n      const labelOwnRightPadding = 6;\n      spaceForTextContent = totalHeaderWidth - labelXPosition - labelOwnRightPadding;\n    }\n    const minimumWidthToDisplay = 15;\n    const actualAvailableWidth = Math.max(minimumWidthToDisplay, spaceForTextContent);\n    const textNode = self.node();\n    const currentTextContentLength = textNode.getComputedTextLength();\n    if (currentTextContentLength > actualAvailableWidth) {\n      const ellipsis = \"...\";\n      let currentTruncatedText = originalText;\n      while (currentTruncatedText.length > 0) {\n        currentTruncatedText = originalText.substring(0, currentTruncatedText.length - 1);\n        if (currentTruncatedText.length === 0) {\n          self.text(ellipsis);\n          if (textNode.getComputedTextLength() > actualAvailableWidth) {\n            self.text(\"\");\n          }\n          break;\n        }\n        self.text(currentTruncatedText + ellipsis);\n        if (textNode.getComputedTextLength() <= actualAvailableWidth) {\n          break;\n        }\n      }\n    }\n  });\n  if (config.showValues !== false) {\n    sections.append(\"text\").attr(\"class\", \"treemapSectionValue\").attr(\"x\", (d) => d.x1 - d.x0 - 10).attr(\"y\", SECTION_HEADER_HEIGHT / 2).attr(\"text-anchor\", \"end\").attr(\"dominant-baseline\", \"middle\").text((d) => d.value ? valueFormat(d.value) : \"\").attr(\"font-style\", \"italic\").attr(\"style\", (d) => {\n      if (d.depth === 0) {\n        return \"display: none;\";\n      }\n      const labelStyles = \"text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:\" + colorScaleLabel(d.data.name) + \"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\";\n      const styles = (0,_chunk_ATLVNIR6_mjs__WEBPACK_IMPORTED_MODULE_2__.styles2String)({ cssCompiledStyles: d.data.cssCompiledStyles });\n      return labelStyles + styles.labelStyles.replace(\"color:\", \"fill:\");\n    });\n  }\n  const leafNodes = treemapData.leaves();\n  const cell = g.selectAll(\".treemapLeafGroup\").data(leafNodes).enter().append(\"g\").attr(\"class\", (d, i) => {\n    return `treemapNode treemapLeafGroup leaf${i}${d.data.classSelector ? ` ${d.data.classSelector}` : \"\"}x`;\n  }).attr(\"transform\", (d) => `translate(${d.x0},${d.y0})`);\n  cell.append(\"rect\").attr(\"width\", (d) => d.x1 - d.x0).attr(\"height\", (d) => d.y1 - d.y0).attr(\"class\", \"treemapLeaf\").attr(\"fill\", (d) => {\n    return d.parent ? colorScale(d.parent.data.name) : colorScale(d.data.name);\n  }).attr(\"style\", (d) => {\n    const styles = (0,_chunk_ATLVNIR6_mjs__WEBPACK_IMPORTED_MODULE_2__.styles2String)({ cssCompiledStyles: d.data.cssCompiledStyles });\n    return styles.nodeStyles;\n  }).attr(\"fill-opacity\", 0.3).attr(\"stroke\", (d) => {\n    return d.parent ? colorScale(d.parent.data.name) : colorScale(d.data.name);\n  }).attr(\"stroke-width\", 3);\n  cell.append(\"clipPath\").attr(\"id\", (_d, i) => `clip-${id}-${i}`).append(\"rect\").attr(\"width\", (d) => Math.max(0, d.x1 - d.x0 - 4)).attr(\"height\", (d) => Math.max(0, d.y1 - d.y0 - 4));\n  const leafLabels = cell.append(\"text\").attr(\"class\", \"treemapLabel\").attr(\"x\", (d) => (d.x1 - d.x0) / 2).attr(\"y\", (d) => (d.y1 - d.y0) / 2).attr(\"style\", (d) => {\n    const labelStyles = \"text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:\" + colorScaleLabel(d.data.name) + \";\";\n    const styles = (0,_chunk_ATLVNIR6_mjs__WEBPACK_IMPORTED_MODULE_2__.styles2String)({ cssCompiledStyles: d.data.cssCompiledStyles });\n    return labelStyles + styles.labelStyles.replace(\"color:\", \"fill:\");\n  }).attr(\"clip-path\", (_d, i) => `url(#clip-${id}-${i})`).text((d) => d.data.name);\n  leafLabels.each(function(d) {\n    const self = (0,d3__WEBPACK_IMPORTED_MODULE_8__.select)(this);\n    const nodeWidth = d.x1 - d.x0;\n    const nodeHeight = d.y1 - d.y0;\n    const textNode = self.node();\n    const padding = 4;\n    const availableWidth = nodeWidth - 2 * padding;\n    const availableHeight = nodeHeight - 2 * padding;\n    if (availableWidth < 10 || availableHeight < 10) {\n      self.style(\"display\", \"none\");\n      return;\n    }\n    let currentLabelFontSize = parseInt(self.style(\"font-size\"), 10);\n    const minLabelFontSize = 8;\n    const originalValueRelFontSize = 28;\n    const valueScaleFactor = 0.6;\n    const minValueFontSize = 6;\n    const spacingBetweenLabelAndValue = 2;\n    while (textNode.getComputedTextLength() > availableWidth && currentLabelFontSize > minLabelFontSize) {\n      currentLabelFontSize--;\n      self.style(\"font-size\", `${currentLabelFontSize}px`);\n    }\n    let prospectiveValueFontSize = Math.max(\n      minValueFontSize,\n      Math.min(originalValueRelFontSize, Math.round(currentLabelFontSize * valueScaleFactor))\n    );\n    let combinedHeight = currentLabelFontSize + spacingBetweenLabelAndValue + prospectiveValueFontSize;\n    while (combinedHeight > availableHeight && currentLabelFontSize > minLabelFontSize) {\n      currentLabelFontSize--;\n      prospectiveValueFontSize = Math.max(\n        minValueFontSize,\n        Math.min(originalValueRelFontSize, Math.round(currentLabelFontSize * valueScaleFactor))\n      );\n      if (prospectiveValueFontSize < minValueFontSize && currentLabelFontSize === minLabelFontSize) {\n        break;\n      }\n      self.style(\"font-size\", `${currentLabelFontSize}px`);\n      combinedHeight = currentLabelFontSize + spacingBetweenLabelAndValue + prospectiveValueFontSize;\n      if (prospectiveValueFontSize <= minValueFontSize && combinedHeight > availableHeight) {\n      }\n    }\n    self.style(\"font-size\", `${currentLabelFontSize}px`);\n    if (textNode.getComputedTextLength() > availableWidth || currentLabelFontSize < minLabelFontSize || availableHeight < currentLabelFontSize) {\n      self.style(\"display\", \"none\");\n    }\n  });\n  if (config.showValues !== false) {\n    const leafValues = cell.append(\"text\").attr(\"class\", \"treemapValue\").attr(\"x\", (d) => (d.x1 - d.x0) / 2).attr(\"y\", function(d) {\n      return (d.y1 - d.y0) / 2;\n    }).attr(\"style\", (d) => {\n      const labelStyles = \"text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:\" + colorScaleLabel(d.data.name) + \";\";\n      const styles = (0,_chunk_ATLVNIR6_mjs__WEBPACK_IMPORTED_MODULE_2__.styles2String)({ cssCompiledStyles: d.data.cssCompiledStyles });\n      return labelStyles + styles.labelStyles.replace(\"color:\", \"fill:\");\n    }).attr(\"clip-path\", (_d, i) => `url(#clip-${id}-${i})`).text((d) => d.value ? valueFormat(d.value) : \"\");\n    leafValues.each(function(d) {\n      const valueTextElement = (0,d3__WEBPACK_IMPORTED_MODULE_8__.select)(this);\n      const parentCellNode = this.parentNode;\n      if (!parentCellNode) {\n        valueTextElement.style(\"display\", \"none\");\n        return;\n      }\n      const labelElement = (0,d3__WEBPACK_IMPORTED_MODULE_8__.select)(parentCellNode).select(\".treemapLabel\");\n      if (labelElement.empty() || labelElement.style(\"display\") === \"none\") {\n        valueTextElement.style(\"display\", \"none\");\n        return;\n      }\n      const finalLabelFontSize = parseFloat(labelElement.style(\"font-size\"));\n      const originalValueFontSize = 28;\n      const valueScaleFactor = 0.6;\n      const minValueFontSize = 6;\n      const spacingBetweenLabelAndValue = 2;\n      const actualValueFontSize = Math.max(\n        minValueFontSize,\n        Math.min(originalValueFontSize, Math.round(finalLabelFontSize * valueScaleFactor))\n      );\n      valueTextElement.style(\"font-size\", `${actualValueFontSize}px`);\n      const labelCenterY = (d.y1 - d.y0) / 2;\n      const valueTopActualY = labelCenterY + finalLabelFontSize / 2 + spacingBetweenLabelAndValue;\n      valueTextElement.attr(\"y\", valueTopActualY);\n      const nodeWidth = d.x1 - d.x0;\n      const nodeTotalHeight = d.y1 - d.y0;\n      const cellBottomPadding = 4;\n      const maxValueBottomY = nodeTotalHeight - cellBottomPadding;\n      const availableWidthForValue = nodeWidth - 2 * 4;\n      if (valueTextElement.node().getComputedTextLength() > availableWidthForValue || valueTopActualY + actualValueFontSize > maxValueBottomY || actualValueFontSize < minValueFontSize) {\n        valueTextElement.style(\"display\", \"none\");\n      } else {\n        valueTextElement.style(\"display\", null);\n      }\n    });\n  }\n  const diagramPadding = config.diagramPadding ?? 8;\n  (0,_chunk_QN33PNHL_mjs__WEBPACK_IMPORTED_MODULE_1__.setupViewPortForSVG)(svg, diagramPadding, \"flowchart\", config?.useMaxWidth || false);\n}, \"draw\");\nvar getClasses = /* @__PURE__ */ (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_6__.__name)(function(_text, diagramObj) {\n  return diagramObj.db.getClasses();\n}, \"getClasses\");\nvar renderer = { draw, getClasses };\n\n// src/diagrams/treemap/styles.ts\nvar defaultTreemapStyleOptions = {\n  sectionStrokeColor: \"black\",\n  sectionStrokeWidth: \"1\",\n  sectionFillColor: \"#efefef\",\n  leafStrokeColor: \"black\",\n  leafStrokeWidth: \"1\",\n  leafFillColor: \"#efefef\",\n  labelColor: \"black\",\n  labelFontSize: \"12px\",\n  valueFontSize: \"10px\",\n  valueColor: \"black\",\n  titleColor: \"black\",\n  titleFontSize: \"14px\"\n};\nvar getStyles = /* @__PURE__ */ (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_6__.__name)(({\n  treemap: treemap2\n} = {}) => {\n  const options = (0,_chunk_S3R3BYOJ_mjs__WEBPACK_IMPORTED_MODULE_4__.cleanAndMerge)(defaultTreemapStyleOptions, treemap2);\n  return `\n  .treemapNode.section {\n    stroke: ${options.sectionStrokeColor};\n    stroke-width: ${options.sectionStrokeWidth};\n    fill: ${options.sectionFillColor};\n  }\n  .treemapNode.leaf {\n    stroke: ${options.leafStrokeColor};\n    stroke-width: ${options.leafStrokeWidth};\n    fill: ${options.leafFillColor};\n  }\n  .treemapLabel {\n    fill: ${options.labelColor};\n    font-size: ${options.labelFontSize};\n  }\n  .treemapValue {\n    fill: ${options.valueColor};\n    font-size: ${options.valueFontSize};\n  }\n  .treemapTitle {\n    fill: ${options.titleColor};\n    font-size: ${options.titleFontSize};\n  }\n  `;\n}, \"getStyles\");\nvar styles_default = getStyles;\n\n// src/diagrams/treemap/diagram.ts\nvar diagram = {\n  parser,\n  get db() {\n    return new TreeMapDB();\n  },\n  renderer,\n  styles: styles_default\n};\n\n\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/mermaid/dist/chunks/mermaid.core/diagram-PSM6KHXK.mjs?");

/***/ })

}]);