mdts 0.18.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +3 -2
- package/dist/frontend/bundle.js +2454 -2245
- package/dist/frontend/{node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_architecture-PBZL5I3N_mjs.bundle.js → node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_architecture-YZFGNWBL_mjs.bundle.js} +4 -4
- package/dist/frontend/{node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_gitGraph-HDMCJU4V_mjs.bundle.js → node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_gitGraph-7Q5UKJZL_mjs.bundle.js} +4 -4
- package/dist/frontend/{node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_info-3K5VOQVL_mjs.bundle.js → node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_info-OMHHGYJF_mjs.bundle.js} +4 -4
- package/dist/frontend/{node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_packet-RMMSAZCW_mjs.bundle.js → node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_packet-4T2RLAQJ_mjs.bundle.js} +4 -4
- package/dist/frontend/{node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_pie-UPGHQEXC_mjs.bundle.js → node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_pie-ZZUOXDRM_mjs.bundle.js} +4 -4
- package/dist/frontend/{node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_radar-KQ55EAFF_mjs.bundle.js → node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_radar-PYXPWWZC_mjs.bundle.js} +4 -4
- package/dist/frontend/node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_treeView-SZITEDCU_mjs.bundle.js +22 -0
- package/dist/frontend/{node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_treemap-KZPCXAKY_mjs.bundle.js → node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_treemap-W4RFUUIX_mjs.bundle.js} +4 -4
- package/dist/frontend/node_modules_mermaid-js_parser_dist_chunks_mermaid-parser_core_wardley-RL74JXVD_mjs.bundle.js +22 -0
- package/dist/frontend/node_modules_mermaid_dist_chunks_mermaid_core_classDiagram-6PBFFD2Q_mjs.bundle.js +22 -0
- package/dist/frontend/node_modules_mermaid_dist_chunks_mermaid_core_classDiagram-v2-HSJHXN6E_mjs.bundle.js +22 -0
- package/dist/frontend/node_modules_mermaid_dist_chunks_mermaid_core_diagram-5BDNPKRD_mjs.bundle.js +42 -0
- package/dist/frontend/{node_modules_mermaid_dist_chunks_mermaid_core_diagram-P4PSJMXO_mjs.bundle.js → node_modules_mermaid_dist_chunks_mermaid_core_diagram-TYMM5635_mjs.bundle.js} +4 -4
- package/dist/frontend/{node_modules_mermaid_dist_chunks_mermaid_core_infoDiagram-LFFYTUFH_mjs.bundle.js → node_modules_mermaid_dist_chunks_mermaid_core_infoDiagram-42DDH7IO_mjs.bundle.js} +4 -4
- package/dist/frontend/{node_modules_mermaid_dist_chunks_mermaid_core_pieDiagram-SKSYHLDU_mjs.bundle.js → node_modules_mermaid_dist_chunks_mermaid_core_pieDiagram-DEJITSTG_mjs.bundle.js} +4 -4
- package/dist/frontend/node_modules_mermaid_dist_chunks_mermaid_core_stateDiagram-v2-QKLJ7IA2_mjs.bundle.js +22 -0
- package/dist/frontend/vendors-node_modules_mermaid-js_parser_dist_mermaid-parser_core_mjs.bundle.js +45 -25
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_architectureDiagram-2XIMDMQ5_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_architectureDiagram-Q4EWVU46_mjs.bundle.js} +4 -4
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_blockDiagram-DXYQGD6D_mjs.bundle.js +52 -0
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_c4Diagram-IC4MRINW_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_c4Diagram-AHTNJAMY_mjs.bundle.js} +7 -7
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_chunk-4TB4RGXK_mjs.bundle.js +62 -0
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_chunk-NQ4KR5QH_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_chunk-OYMX7WX6_mjs.bundle.js} +7 -7
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_dagre-KLK3FWXG_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_dagre-KV5264BT_mjs.bundle.js} +4 -4
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_diagram-E7M64L7V_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_diagram-G4DWMVQ6_mjs.bundle.js} +7 -7
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_diagram-IFDJBPK2_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_diagram-MMDJMWI5_mjs.bundle.js} +4 -4
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_erDiagram-INFDFZHY_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_erDiagram-SMLLAGMA_mjs.bundle.js} +7 -7
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_flowDiagram-DWJPFMVM_mjs.bundle.js +72 -0
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_ganttDiagram-T4ZO3ILL_mjs.bundle.js +62 -0
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_gitGraphDiagram-UUTBAWPF_mjs.bundle.js +42 -0
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_ishikawaDiagram-PHBUUO56_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_ishikawaDiagram-UXIWVN3A_mjs.bundle.js} +4 -4
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_journeyDiagram-4ABVD52K_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_journeyDiagram-VCZTEJTY_mjs.bundle.js} +7 -7
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_kanban-definition-K7BYSVSG_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_kanban-definition-6JOO6SKY_mjs.bundle.js} +4 -4
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_mindmap-definition-YRQLILUH_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_mindmap-definition-QFDTVHPH_mjs.bundle.js} +7 -7
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_quadrantDiagram-337W2JSQ_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_quadrantDiagram-34T5L4WZ_mjs.bundle.js} +4 -4
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_requirementDiagram-Z7DCOOCP_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_requirementDiagram-MS252O5E_mjs.bundle.js} +7 -7
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_sankeyDiagram-WA2Y5GQK_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_sankeyDiagram-XADWPNL6_mjs.bundle.js} +7 -7
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_sequenceDiagram-FGHM5R23_mjs.bundle.js +42 -0
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_stateDiagram-FHFEXIEX_mjs.bundle.js +22 -0
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_timeline-definition-GMOUNBTQ_mjs.bundle.js +22 -0
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_vennDiagram-LZ73GAT5_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_vennDiagram-DHZGUBPP_mjs.bundle.js} +4 -4
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_wardleyDiagram-NUSXRM2D_mjs.bundle.js +32 -0
- package/dist/frontend/{vendors-node_modules_mermaid_dist_chunks_mermaid_core_xychartDiagram-JWTSCODW_mjs.bundle.js → vendors-node_modules_mermaid_dist_chunks_mermaid_core_xychartDiagram-5P7HB3ND_mjs.bundle.js} +4 -4
- package/package.json +3 -3
- package/dist/frontend/node_modules_mermaid_dist_chunks_mermaid_core_classDiagram-VBA2DB6C_mjs.bundle.js +0 -22
- package/dist/frontend/node_modules_mermaid_dist_chunks_mermaid_core_classDiagram-v2-RAHNMMFH_mjs.bundle.js +0 -22
- package/dist/frontend/node_modules_mermaid_dist_chunks_mermaid_core_stateDiagram-v2-FVOUBMTO_mjs.bundle.js +0 -22
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_blockDiagram-WCTKOSBZ_mjs.bundle.js +0 -52
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_chunk-WL4C6EOR_mjs.bundle.js +0 -62
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_flowDiagram-PKNHOUZH_mjs.bundle.js +0 -72
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_ganttDiagram-A5KZAMGK_mjs.bundle.js +0 -62
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_gitGraphDiagram-K3NZZRJ6_mjs.bundle.js +0 -42
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_sequenceDiagram-2WXFIKYE_mjs.bundle.js +0 -42
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_stateDiagram-RAJIS63D_mjs.bundle.js +0 -22
- package/dist/frontend/vendors-node_modules_mermaid_dist_chunks_mermaid_core_timeline-definition-YZTLITO2_mjs.bundle.js +0 -22
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
4
|
+
* This devtool is neither made for production nor for readable output files.
|
|
5
|
+
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
6
|
+
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
7
|
+
* or disable the default devtool with "devtool: false".
|
|
8
|
+
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
9
|
+
*/
|
|
10
|
+
(self["webpackChunk_mdts_frontend"] = self["webpackChunk_mdts_frontend"] || []).push([["vendors-node_modules_mermaid_dist_chunks_mermaid_core_wardleyDiagram-NUSXRM2D_mjs"],{
|
|
11
|
+
|
|
12
|
+
/***/ "./node_modules/mermaid/dist/chunks/mermaid.core/chunk-4BX2VUAB.mjs"
|
|
13
|
+
/*!**************************************************************************!*\
|
|
14
|
+
!*** ./node_modules/mermaid/dist/chunks/mermaid.core/chunk-4BX2VUAB.mjs ***!
|
|
15
|
+
\**************************************************************************/
|
|
16
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
17
|
+
|
|
18
|
+
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://@mdts/frontend/./node_modules/mermaid/dist/chunks/mermaid.core/chunk-4BX2VUAB.mjs?\n}");
|
|
19
|
+
|
|
20
|
+
/***/ },
|
|
21
|
+
|
|
22
|
+
/***/ "./node_modules/mermaid/dist/chunks/mermaid.core/wardleyDiagram-NUSXRM2D.mjs"
|
|
23
|
+
/*!***********************************************************************************!*\
|
|
24
|
+
!*** ./node_modules/mermaid/dist/chunks/mermaid.core/wardleyDiagram-NUSXRM2D.mjs ***!
|
|
25
|
+
\***********************************************************************************/
|
|
26
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
27
|
+
|
|
28
|
+
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_426QAEUC_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chunk-426QAEUC.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-426QAEUC.mjs\");\n/* harmony import */ var _chunk_4BX2VUAB_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./chunk-4BX2VUAB.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-4BX2VUAB.mjs\");\n/* harmony import */ var _chunk_ICPOFSXX_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./chunk-ICPOFSXX.mjs */ \"./node_modules/mermaid/dist/chunks/mermaid.core/chunk-ICPOFSXX.mjs\");\n/* harmony import */ var _chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__ = __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_4__ = __webpack_require__(/*! @mermaid-js/parser */ \"./node_modules/@mermaid-js/parser/dist/mermaid-parser.core.mjs\");\n\n\n\n\n\n// src/diagrams/wardley/wardleyParser.ts\n\nvar toPercent = /* @__PURE__ */ (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)((value, context) => {\n const normalized = value <= 1 ? value * 100 : value;\n if (normalized < 0 || normalized > 100) {\n throw new Error(\n `${context} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${value}`\n );\n }\n return normalized;\n}, \"toPercent\");\nvar toCoordinates = /* @__PURE__ */ (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)((visibility, evolution, context) => {\n return {\n x: toPercent(evolution, `${context} evolution`),\n y: toPercent(visibility, `${context} visibility`)\n };\n}, \"toCoordinates\");\nvar getFlowFromPort = /* @__PURE__ */ (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)((port) => {\n if (!port) {\n return void 0;\n }\n if (port === \"+<>\") {\n return \"bidirectional\";\n }\n if (port === \"+<\") {\n return \"backward\";\n }\n if (port === \"+>\") {\n return \"forward\";\n }\n return void 0;\n}, \"getFlowFromPort\");\nvar extractFlowFromArrow = /* @__PURE__ */ (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)((arrow) => {\n if (!arrow?.startsWith(\"+\")) {\n return {};\n }\n const labelMatch = /^\\+'([^']*)'/.exec(arrow);\n const flowLabel = labelMatch?.[1];\n if (arrow.includes(\"<>\")) {\n return { flow: \"bidirectional\", label: flowLabel };\n }\n if (arrow.includes(\"<\")) {\n return { flow: \"backward\", label: flowLabel };\n }\n if (arrow.includes(\">\")) {\n return { flow: \"forward\", label: flowLabel };\n }\n return { label: flowLabel };\n}, \"extractFlowFromArrow\");\nvar populateDb = /* @__PURE__ */ (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)((ast, db) => {\n (0,_chunk_4BX2VUAB_mjs__WEBPACK_IMPORTED_MODULE_1__.populateCommonDb)(ast, db);\n if (ast.size) {\n db.setSize(ast.size.width, ast.size.height);\n }\n if (ast.evolution) {\n const stages = ast.evolution.stages.map((stage) => {\n if (stage.secondName) {\n return `${stage.name.trim()} / ${stage.secondName.trim()}`;\n }\n return stage.name.trim();\n });\n const stageBoundaries = ast.evolution.stages.filter((stage) => stage.boundary !== void 0).map((stage) => stage.boundary);\n db.updateAxes({ stages, stageBoundaries });\n }\n ast.anchors.forEach((anchor) => {\n const coords = toCoordinates(anchor.visibility, anchor.evolution, `Anchor \"${anchor.name}\"`);\n db.addNode(anchor.name, anchor.name, coords.x, coords.y, \"anchor\");\n });\n ast.components.forEach((component) => {\n const coords = toCoordinates(\n component.visibility,\n component.evolution,\n `Component \"${component.name}\"`\n );\n const labelOffsetX = component.label ? (component.label.negX ? -1 : 1) * component.label.offsetX : void 0;\n const labelOffsetY = component.label ? (component.label.negY ? -1 : 1) * component.label.offsetY : void 0;\n const sourceStrategy = component.decorator?.strategy;\n db.addNode(\n component.name,\n component.name,\n coords.x,\n coords.y,\n \"component\",\n labelOffsetX,\n labelOffsetY,\n component.inertia,\n sourceStrategy\n );\n });\n ast.notes.forEach((note) => {\n const coords = toCoordinates(note.visibility, note.evolution, `Note \"${note.text}\"`);\n db.addNote(note.text, coords.x, coords.y);\n });\n ast.pipelines.forEach((pipeline) => {\n const parentNode = db.getNode(pipeline.parent);\n if (!parentNode || typeof parentNode.y !== \"number\") {\n throw new Error(\n `Pipeline \"${pipeline.parent}\" must reference an existing component with coordinates.`\n );\n }\n const parentY = parentNode.y;\n db.startPipeline(pipeline.parent);\n pipeline.components.forEach((component) => {\n const componentId = `${pipeline.parent}_${component.name}`;\n const labelOffsetX = component.label ? (component.label.negX ? -1 : 1) * component.label.offsetX : void 0;\n const labelOffsetY = component.label ? (component.label.negY ? -1 : 1) * component.label.offsetY : void 0;\n const x = toPercent(component.evolution, `Pipeline component \"${component.name}\" evolution`);\n db.addNode(\n componentId,\n component.name,\n x,\n parentY,\n \"pipeline-component\",\n labelOffsetX,\n labelOffsetY\n );\n db.addPipelineComponent(pipeline.parent, componentId);\n });\n });\n ast.links.forEach((link) => {\n const isDashed = !!link.arrow && (link.arrow.includes(\"-.->\") || link.arrow.includes(\".-.\"));\n let flow = getFlowFromPort(link.fromPort) ?? getFlowFromPort(link.toPort);\n const { flow: arrowFlow, label: flowLabel } = extractFlowFromArrow(link.arrow);\n if (!flow && arrowFlow) {\n flow = arrowFlow;\n }\n const annotation = link.linkLabel;\n const label = flowLabel ?? annotation;\n db.addLink(link.from, link.to, isDashed, label, flow);\n });\n ast.evolves.forEach((evolve) => {\n const node = db.getNode(evolve.component);\n if (node?.y !== void 0) {\n const target = toPercent(evolve.target, `Evolve target for \"${evolve.component}\"`);\n db.addTrend(evolve.component, target, node.y);\n }\n });\n if (ast.annotations.length > 0) {\n const annotationsBox = ast.annotations[0];\n const coords = toCoordinates(annotationsBox.x, annotationsBox.y, \"Annotations box\");\n db.setAnnotationsBox(coords.x, coords.y);\n }\n ast.annotation.forEach((annotation) => {\n const coords = toCoordinates(annotation.x, annotation.y, `Annotation ${annotation.number}`);\n db.addAnnotation(annotation.number, [{ x: coords.x, y: coords.y }], annotation.text);\n });\n ast.accelerators.forEach((accelerator) => {\n const coords = toCoordinates(accelerator.x, accelerator.y, `Accelerator \"${accelerator.name}\"`);\n db.addAccelerator(accelerator.name, coords.x, coords.y);\n });\n ast.deaccelerators.forEach((deaccelerator) => {\n const coords = toCoordinates(\n deaccelerator.x,\n deaccelerator.y,\n `Deaccelerator \"${deaccelerator.name}\"`\n );\n db.addDeaccelerator(deaccelerator.name, coords.x, coords.y);\n });\n}, \"populateDb\");\nvar parser = {\n parser: {\n // @ts-expect-error - WardleyDB is not assignable to DiagramDB\n yy: void 0\n },\n parse: /* @__PURE__ */ (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)(async (input) => {\n const ast = await (0,_mermaid_js_parser__WEBPACK_IMPORTED_MODULE_4__.parse)(\"wardley\", input);\n _chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.log.debug(ast);\n const db = parser.parser?.yy;\n if (!db || typeof db.addNode !== \"function\") {\n throw new Error(\n \"parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.\"\n );\n }\n populateDb(ast, db);\n }, \"parse\")\n};\n\n// src/diagrams/wardley/wardleyBuilder.ts\nvar WardleyBuilder = class {\n constructor() {\n this.nodes = /* @__PURE__ */ new Map();\n this.links = [];\n this.trends = /* @__PURE__ */ new Map();\n this.pipelines = /* @__PURE__ */ new Map();\n this.annotations = [];\n this.notes = [];\n this.accelerators = [];\n this.deaccelerators = [];\n this.axes = {};\n }\n static {\n (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)(this, \"WardleyBuilder\");\n }\n addNode(node) {\n const existing = this.nodes.get(node.id) ?? { id: node.id, label: node.label };\n const merged = {\n ...existing,\n ...node,\n className: node.className ?? existing.className,\n labelOffsetX: node.labelOffsetX ?? existing.labelOffsetX,\n labelOffsetY: node.labelOffsetY ?? existing.labelOffsetY\n };\n this.nodes.set(node.id, merged);\n }\n addLink(link) {\n this.links.push(link);\n }\n addTrend(trend) {\n this.trends.set(trend.nodeId, trend);\n }\n startPipeline(nodeId) {\n this.pipelines.set(nodeId, { nodeId, componentIds: [] });\n const node = this.nodes.get(nodeId);\n if (node) {\n node.isPipelineParent = true;\n }\n }\n addPipelineComponent(pipelineNodeId, componentId) {\n const pipeline = this.pipelines.get(pipelineNodeId);\n if (pipeline) {\n pipeline.componentIds.push(componentId);\n }\n const node = this.nodes.get(componentId);\n if (node) {\n node.inPipeline = true;\n }\n }\n addAnnotation(annotation) {\n this.annotations.push(annotation);\n }\n addNote(note) {\n this.notes.push(note);\n }\n addAccelerator(accelerator) {\n this.accelerators.push(accelerator);\n }\n addDeaccelerator(deaccelerator) {\n this.deaccelerators.push(deaccelerator);\n }\n setAnnotationsBox(x, y) {\n this.annotationsBox = { x, y };\n }\n setAxes(partial) {\n this.axes = {\n ...this.axes,\n ...partial\n };\n }\n setSize(width, height) {\n this.size = { width, height };\n }\n getNode(id) {\n return this.nodes.get(id);\n }\n build() {\n const nodes = [];\n for (const node of this.nodes.values()) {\n if (typeof node.x !== \"number\" || typeof node.y !== \"number\") {\n throw new Error(`Node \"${node.label}\" is missing coordinates`);\n }\n nodes.push(node);\n }\n return {\n nodes,\n links: [...this.links],\n trends: [...this.trends.values()],\n pipelines: [...this.pipelines.values()],\n annotations: [...this.annotations],\n notes: [...this.notes],\n accelerators: [...this.accelerators],\n deaccelerators: [...this.deaccelerators],\n annotationsBox: this.annotationsBox,\n axes: { ...this.axes },\n size: this.size\n };\n }\n clear() {\n this.nodes.clear();\n this.links = [];\n this.trends.clear();\n this.pipelines.clear();\n this.annotations = [];\n this.notes = [];\n this.accelerators = [];\n this.deaccelerators = [];\n this.annotationsBox = void 0;\n this.axes = {};\n this.size = void 0;\n }\n};\n\n// src/diagrams/wardley/wardleyDb.ts\nvar builder = new WardleyBuilder();\nfunction textSanitizer(text) {\n const config = (0,_chunk_ICPOFSXX_mjs__WEBPACK_IMPORTED_MODULE_2__.getConfig2)();\n return (0,_chunk_ICPOFSXX_mjs__WEBPACK_IMPORTED_MODULE_2__.sanitizeText)(text.trim(), config);\n}\n(0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)(textSanitizer, \"textSanitizer\");\nfunction getConfig2() {\n return (0,_chunk_ICPOFSXX_mjs__WEBPACK_IMPORTED_MODULE_2__.getConfig2)()[\"wardley-beta\"];\n}\n(0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)(getConfig2, \"getConfig\");\nfunction addNode(id, label, x, y, className, labelOffsetX, labelOffsetY, inertia, sourceStrategy) {\n builder.addNode({\n id,\n label: textSanitizer(label),\n x,\n y,\n className,\n labelOffsetX,\n labelOffsetY,\n inertia,\n sourceStrategy\n });\n}\n(0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)(addNode, \"addNode\");\nfunction addLink(sourceId, targetId, dashed = false, label, flow) {\n builder.addLink({ source: sourceId, target: targetId, dashed, label, flow });\n}\n(0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)(addLink, \"addLink\");\nfunction addTrend(nodeId, targetX, targetY) {\n builder.addTrend({ nodeId, targetX, targetY });\n}\n(0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)(addTrend, \"addTrend\");\nfunction addAnnotation(number, coordinates, text) {\n builder.addAnnotation({\n number,\n coordinates,\n text: text ? textSanitizer(text) : void 0\n });\n}\n(0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)(addAnnotation, \"addAnnotation\");\nfunction addNote(text, x, y) {\n builder.addNote({\n text: textSanitizer(text),\n x,\n y\n });\n}\n(0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)(addNote, \"addNote\");\nfunction addAccelerator(name, x, y) {\n builder.addAccelerator({\n name: textSanitizer(name),\n x,\n y\n });\n}\n(0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)(addAccelerator, \"addAccelerator\");\nfunction addDeaccelerator(name, x, y) {\n builder.addDeaccelerator({\n name: textSanitizer(name),\n x,\n y\n });\n}\n(0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)(addDeaccelerator, \"addDeaccelerator\");\nfunction setAnnotationsBox(x, y) {\n builder.setAnnotationsBox(x, y);\n}\n(0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)(setAnnotationsBox, \"setAnnotationsBox\");\nfunction setSize(width, height) {\n builder.setSize(width, height);\n}\n(0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)(setSize, \"setSize\");\nfunction startPipeline(nodeId) {\n builder.startPipeline(nodeId);\n}\n(0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)(startPipeline, \"startPipeline\");\nfunction addPipelineComponent(pipelineNodeId, componentId) {\n builder.addPipelineComponent(pipelineNodeId, componentId);\n}\n(0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)(addPipelineComponent, \"addPipelineComponent\");\nfunction updateAxes(partial) {\n const sanitized = {};\n if (partial.xLabel) {\n sanitized.xLabel = textSanitizer(partial.xLabel);\n }\n if (partial.yLabel) {\n sanitized.yLabel = textSanitizer(partial.yLabel);\n }\n if (partial.stages) {\n sanitized.stages = partial.stages.map((stage) => textSanitizer(stage));\n }\n if (partial.stageBoundaries) {\n sanitized.stageBoundaries = partial.stageBoundaries;\n }\n builder.setAxes(sanitized);\n}\n(0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)(updateAxes, \"updateAxes\");\nfunction getNode(id) {\n return builder.getNode(id);\n}\n(0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)(getNode, \"getNode\");\nfunction getWardleyData() {\n return builder.build();\n}\n(0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)(getWardleyData, \"getWardleyData\");\nfunction clear2() {\n builder.clear();\n (0,_chunk_ICPOFSXX_mjs__WEBPACK_IMPORTED_MODULE_2__.clear)();\n}\n(0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)(clear2, \"clear\");\nvar wardleyDb_default = {\n getConfig: getConfig2,\n addNode,\n addLink,\n addTrend,\n addAnnotation,\n addNote,\n addAccelerator,\n addDeaccelerator,\n setAnnotationsBox,\n setSize,\n startPipeline,\n addPipelineComponent,\n updateAxes,\n getNode,\n getWardleyData,\n clear: clear2,\n setAccTitle: _chunk_ICPOFSXX_mjs__WEBPACK_IMPORTED_MODULE_2__.setAccTitle,\n getAccTitle: _chunk_ICPOFSXX_mjs__WEBPACK_IMPORTED_MODULE_2__.getAccTitle,\n setDiagramTitle: _chunk_ICPOFSXX_mjs__WEBPACK_IMPORTED_MODULE_2__.setDiagramTitle,\n getDiagramTitle: _chunk_ICPOFSXX_mjs__WEBPACK_IMPORTED_MODULE_2__.getDiagramTitle,\n getAccDescription: _chunk_ICPOFSXX_mjs__WEBPACK_IMPORTED_MODULE_2__.getAccDescription,\n setAccDescription: _chunk_ICPOFSXX_mjs__WEBPACK_IMPORTED_MODULE_2__.setAccDescription\n};\n\n// src/diagrams/wardley/wardleyRenderer.ts\nvar DEFAULT_STAGES = [\"Genesis\", \"Custom Built\", \"Product\", \"Commodity\"];\nvar getTheme = /* @__PURE__ */ (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)(() => {\n const { themeVariables } = (0,_chunk_ICPOFSXX_mjs__WEBPACK_IMPORTED_MODULE_2__.getConfig2)();\n return {\n backgroundColor: themeVariables.wardley?.backgroundColor ?? themeVariables.background ?? \"#fff\",\n axisColor: themeVariables.wardley?.axisColor ?? \"#000\",\n axisTextColor: themeVariables.wardley?.axisTextColor ?? themeVariables.primaryTextColor ?? \"#222\",\n gridColor: themeVariables.wardley?.gridColor ?? \"rgba(100, 100, 100, 0.2)\",\n componentFill: themeVariables.wardley?.componentFill ?? \"#fff\",\n componentStroke: themeVariables.wardley?.componentStroke ?? \"#000\",\n componentLabelColor: themeVariables.wardley?.componentLabelColor ?? themeVariables.primaryTextColor ?? \"#222\",\n linkStroke: themeVariables.wardley?.linkStroke ?? \"#000\",\n evolutionStroke: themeVariables.wardley?.evolutionStroke ?? \"#dc3545\",\n annotationStroke: themeVariables.wardley?.annotationStroke ?? \"#000\",\n annotationTextColor: themeVariables.wardley?.annotationTextColor ?? themeVariables.primaryTextColor ?? \"#222\",\n annotationFill: themeVariables.wardley?.annotationFill ?? themeVariables.background ?? \"#fff\"\n };\n}, \"getTheme\");\nvar getConfigValues = /* @__PURE__ */ (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)(() => {\n const wardleyConfig = (0,_chunk_ICPOFSXX_mjs__WEBPACK_IMPORTED_MODULE_2__.getConfig2)()[\"wardley-beta\"];\n return {\n width: wardleyConfig?.width ?? 900,\n height: wardleyConfig?.height ?? 600,\n padding: wardleyConfig?.padding ?? 48,\n nodeRadius: wardleyConfig?.nodeRadius ?? 6,\n nodeLabelOffset: wardleyConfig?.nodeLabelOffset ?? 8,\n axisFontSize: wardleyConfig?.axisFontSize ?? 12,\n labelFontSize: wardleyConfig?.labelFontSize ?? 10,\n showGrid: wardleyConfig?.showGrid ?? false,\n useMaxWidth: wardleyConfig?.useMaxWidth ?? true\n };\n}, \"getConfigValues\");\nvar draw = /* @__PURE__ */ (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)((text, id, _version, diagObj) => {\n _chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.log.debug(\"Rendering Wardley map\\n\" + text);\n const configValues = getConfigValues();\n const theme = getTheme();\n const squareSize = configValues.nodeRadius * 1.6;\n const db = diagObj.db;\n const data = db.getWardleyData();\n const title = db.getDiagramTitle();\n const width = data.size?.width ?? configValues.width;\n const height = data.size?.height ?? configValues.height;\n const svg = (0,_chunk_426QAEUC_mjs__WEBPACK_IMPORTED_MODULE_0__.selectSvgElement)(id);\n svg.selectAll(\"*\").remove();\n (0,_chunk_ICPOFSXX_mjs__WEBPACK_IMPORTED_MODULE_2__.configureSvgSize)(svg, height, width, configValues.useMaxWidth);\n svg.attr(\"viewBox\", `0 0 ${width} ${height}`);\n const root = svg.append(\"g\").attr(\"class\", \"wardley-map\");\n const defs = svg.append(\"defs\");\n defs.append(\"marker\").attr(\"id\", `arrow-${id}`).attr(\"viewBox\", \"0 0 10 10\").attr(\"refX\", 9).attr(\"refY\", 5).attr(\"markerWidth\", 6).attr(\"markerHeight\", 6).attr(\"orient\", \"auto-start-reverse\").append(\"path\").attr(\"d\", \"M 0 0 L 10 5 L 0 10 z\").attr(\"fill\", theme.evolutionStroke).attr(\"stroke\", \"none\");\n defs.append(\"marker\").attr(\"id\", `link-arrow-end-${id}`).attr(\"viewBox\", \"0 0 10 10\").attr(\"refX\", 9).attr(\"refY\", 5).attr(\"markerWidth\", 5).attr(\"markerHeight\", 5).attr(\"orient\", \"auto\").append(\"path\").attr(\"d\", \"M 0 0 L 10 5 L 0 10 z\").attr(\"fill\", theme.linkStroke).attr(\"stroke\", \"none\");\n defs.append(\"marker\").attr(\"id\", `link-arrow-start-${id}`).attr(\"viewBox\", \"0 0 10 10\").attr(\"refX\", 1).attr(\"refY\", 5).attr(\"markerWidth\", 5).attr(\"markerHeight\", 5).attr(\"orient\", \"auto\").append(\"path\").attr(\"d\", \"M 10 0 L 0 5 L 10 10 z\").attr(\"fill\", theme.linkStroke).attr(\"stroke\", \"none\");\n root.append(\"rect\").attr(\"class\", \"wardley-background\").attr(\"width\", width).attr(\"height\", height).attr(\"fill\", theme.backgroundColor);\n const chartWidth = width - configValues.padding * 2;\n const chartHeight = height - configValues.padding * 2;\n if (title) {\n root.append(\"text\").attr(\"class\", \"wardley-title\").attr(\"x\", width / 2).attr(\"y\", configValues.padding / 2).attr(\"fill\", theme.axisTextColor).attr(\"font-size\", configValues.axisFontSize * 1.05).attr(\"font-weight\", \"bold\").attr(\"text-anchor\", \"middle\").attr(\"dominant-baseline\", \"middle\").text(title);\n }\n const projectX = /* @__PURE__ */ (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)((value) => configValues.padding + value / 100 * chartWidth, \"projectX\");\n const projectY = /* @__PURE__ */ (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)((value) => height - configValues.padding - value / 100 * chartHeight, \"projectY\");\n const axisGroup = root.append(\"g\").attr(\"class\", \"wardley-axes\");\n axisGroup.append(\"line\").attr(\"x1\", configValues.padding).attr(\"x2\", width - configValues.padding).attr(\"y1\", height - configValues.padding).attr(\"y2\", height - configValues.padding).attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1);\n axisGroup.append(\"line\").attr(\"x1\", configValues.padding).attr(\"x2\", configValues.padding).attr(\"y1\", configValues.padding).attr(\"y2\", height - configValues.padding).attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1);\n const xLabel = data.axes.xLabel ?? \"Evolution\";\n const yLabel = data.axes.yLabel ?? \"Visibility\";\n axisGroup.append(\"text\").attr(\"class\", \"wardley-axis-label wardley-axis-label-x\").attr(\"x\", configValues.padding + chartWidth / 2).attr(\"y\", height - configValues.padding / 4).attr(\"fill\", theme.axisTextColor).attr(\"font-size\", configValues.axisFontSize).attr(\"font-weight\", \"bold\").attr(\"text-anchor\", \"middle\").text(xLabel);\n axisGroup.append(\"text\").attr(\"class\", \"wardley-axis-label wardley-axis-label-y\").attr(\"x\", configValues.padding / 3).attr(\"y\", configValues.padding + chartHeight / 2).attr(\"fill\", theme.axisTextColor).attr(\"font-size\", configValues.axisFontSize).attr(\"font-weight\", \"bold\").attr(\"text-anchor\", \"middle\").attr(\n \"transform\",\n `rotate(-90 ${configValues.padding / 3} ${configValues.padding + chartHeight / 2})`\n ).text(yLabel);\n const stages = data.axes.stages && data.axes.stages.length > 0 ? data.axes.stages : DEFAULT_STAGES;\n if (stages.length > 0) {\n const stageGroup = root.append(\"g\").attr(\"class\", \"wardley-stages\");\n const boundaries = data.axes.stageBoundaries;\n const stagePositions = [];\n if (boundaries && boundaries.length === stages.length) {\n let prevBoundary = 0;\n boundaries.forEach((boundary) => {\n stagePositions.push({ start: prevBoundary, end: boundary });\n prevBoundary = boundary;\n });\n } else {\n const stageWidth = 1 / stages.length;\n stages.forEach((_, index) => {\n stagePositions.push({\n start: index * stageWidth,\n end: (index + 1) * stageWidth\n });\n });\n }\n stages.forEach((stage, index) => {\n const pos = stagePositions[index];\n const startX = configValues.padding + pos.start * chartWidth;\n const endX = configValues.padding + pos.end * chartWidth;\n const centerX = (startX + endX) / 2;\n if (index > 0) {\n stageGroup.append(\"line\").attr(\"x1\", startX).attr(\"x2\", startX).attr(\"y1\", configValues.padding).attr(\"y2\", height - configValues.padding).attr(\"stroke\", \"#000\").attr(\"stroke-width\", 1).attr(\"stroke-dasharray\", \"5 5\").attr(\"opacity\", 0.8);\n }\n stageGroup.append(\"text\").attr(\"class\", \"wardley-stage-label\").attr(\"x\", centerX).attr(\"y\", height - configValues.padding / 1.5).attr(\"fill\", theme.axisTextColor).attr(\"font-size\", configValues.axisFontSize - 2).attr(\"text-anchor\", \"middle\").text(stage);\n });\n }\n if (configValues.showGrid) {\n const gridGroup = root.append(\"g\").attr(\"class\", \"wardley-grid\");\n for (let i = 1; i < 4; i++) {\n const ratio = i / 4;\n const x = configValues.padding + chartWidth * ratio;\n gridGroup.append(\"line\").attr(\"x1\", x).attr(\"x2\", x).attr(\"y1\", configValues.padding).attr(\"y2\", height - configValues.padding).attr(\"stroke\", theme.gridColor).attr(\"stroke-dasharray\", \"2 6\");\n gridGroup.append(\"line\").attr(\"x1\", configValues.padding).attr(\"x2\", width - configValues.padding).attr(\"y1\", height - configValues.padding - chartHeight * ratio).attr(\"y2\", height - configValues.padding - chartHeight * ratio).attr(\"stroke\", theme.gridColor).attr(\"stroke-dasharray\", \"2 6\");\n }\n }\n const positions = /* @__PURE__ */ new Map();\n data.nodes.forEach((node) => {\n positions.set(node.id, {\n x: projectX(node.x),\n y: projectY(node.y),\n node\n });\n });\n if (data.pipelines.length > 0) {\n const pipelineGroup = root.append(\"g\").attr(\"class\", \"wardley-pipelines\");\n const pipelineLinksGroup = root.append(\"g\").attr(\"class\", \"wardley-pipeline-links\");\n data.pipelines.forEach((pipeline) => {\n if (pipeline.componentIds.length === 0) {\n return;\n }\n const sortedComponents = pipeline.componentIds.map((id2) => ({ id: id2, pos: positions.get(id2), node: data.nodes.find((n) => n.id === id2) })).filter((c) => c.pos && c.node).sort((a, b) => a.node.x - b.node.x);\n for (let i = 0; i < sortedComponents.length - 1; i++) {\n const current = sortedComponents[i];\n const next = sortedComponents[i + 1];\n pipelineLinksGroup.append(\"line\").attr(\"class\", \"wardley-pipeline-evolution-link\").attr(\"x1\", current.pos.x).attr(\"y1\", current.pos.y).attr(\"x2\", next.pos.x).attr(\"y2\", next.pos.y).attr(\"stroke\", theme.linkStroke).attr(\"stroke-width\", 1).attr(\"stroke-dasharray\", \"4 4\");\n }\n let minX = Infinity;\n let maxX = -Infinity;\n let y = 0;\n pipeline.componentIds.forEach((componentId) => {\n const pos = positions.get(componentId);\n if (pos) {\n minX = Math.min(minX, pos.x);\n maxX = Math.max(maxX, pos.x);\n y = pos.y;\n }\n });\n if (minX !== Infinity && maxX !== -Infinity) {\n const padding = 15;\n const height2 = configValues.nodeRadius * 4;\n const boxTop = y - height2 / 2;\n const parentPos = positions.get(pipeline.nodeId);\n if (parentPos) {\n const centerX = (minX + maxX) / 2;\n parentPos.x = centerX;\n parentPos.y = boxTop - squareSize / 6;\n }\n pipelineGroup.append(\"rect\").attr(\"class\", \"wardley-pipeline-box\").attr(\"x\", minX - padding).attr(\"y\", boxTop).attr(\"width\", maxX - minX + padding * 2).attr(\"height\", height2).attr(\"fill\", \"none\").attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1.5).attr(\"rx\", 4).attr(\"ry\", 4);\n }\n });\n }\n const linksGroup = root.append(\"g\").attr(\"class\", \"wardley-links\");\n const pipelineMap = /* @__PURE__ */ new Map();\n data.pipelines.forEach((pipeline) => {\n pipelineMap.set(pipeline.nodeId, new Set(pipeline.componentIds));\n });\n const validLinks = data.links.filter((link) => {\n if (!positions.has(link.source) || !positions.has(link.target)) {\n return false;\n }\n const pipelineComponents = pipelineMap.get(link.target);\n if (pipelineComponents?.has(link.source)) {\n return false;\n }\n return true;\n });\n linksGroup.selectAll(\"line\").data(validLinks).enter().append(\"line\").attr(\"class\", (link) => `wardley-link${link.dashed ? \" wardley-link--dashed\" : \"\"}`).attr(\"x1\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const sourceNode = data.nodes.find((n) => n.id === link.source);\n const radius = sourceNode.isPipelineParent ? squareSize / Math.sqrt(2) : configValues.nodeRadius;\n const dx = targetPos.x - sourcePos.x;\n const dy = targetPos.y - sourcePos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n return sourcePos.x + dx / distance * radius;\n }).attr(\"y1\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const sourceNode = data.nodes.find((n) => n.id === link.source);\n const radius = sourceNode.isPipelineParent ? squareSize / Math.sqrt(2) : configValues.nodeRadius;\n const dx = targetPos.x - sourcePos.x;\n const dy = targetPos.y - sourcePos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n return sourcePos.y + dy / distance * radius;\n }).attr(\"x2\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const targetNode = data.nodes.find((n) => n.id === link.target);\n const radius = targetNode.isPipelineParent ? squareSize / Math.sqrt(2) : configValues.nodeRadius;\n const dx = sourcePos.x - targetPos.x;\n const dy = sourcePos.y - targetPos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n return targetPos.x + dx / distance * radius;\n }).attr(\"y2\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const targetNode = data.nodes.find((n) => n.id === link.target);\n const radius = targetNode.isPipelineParent ? squareSize / Math.sqrt(2) : configValues.nodeRadius;\n const dx = sourcePos.x - targetPos.x;\n const dy = sourcePos.y - targetPos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n return targetPos.y + dy / distance * radius;\n }).attr(\"stroke\", theme.linkStroke).attr(\"stroke-width\", 1).attr(\"stroke-dasharray\", (link) => link.dashed ? \"6 6\" : null).attr(\"marker-end\", (link) => {\n if (link.flow === \"forward\" || link.flow === \"bidirectional\") {\n return `url(#link-arrow-end-${id})`;\n }\n return null;\n }).attr(\"marker-start\", (link) => {\n if (link.flow === \"backward\" || link.flow === \"bidirectional\") {\n return `url(#link-arrow-start-${id})`;\n }\n return null;\n });\n linksGroup.selectAll(\"text\").data(validLinks.filter((link) => link.label)).enter().append(\"text\").attr(\"class\", \"wardley-link-label\").attr(\"x\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const midX = (sourcePos.x + targetPos.x) / 2;\n const dy = targetPos.y - sourcePos.y;\n const dx = targetPos.x - sourcePos.x;\n const distance = Math.sqrt(dx * dx + dy * dy);\n const offset = 8;\n const perpX = dy / distance;\n return midX + perpX * offset;\n }).attr(\"y\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const midY = (sourcePos.y + targetPos.y) / 2;\n const dx = targetPos.x - sourcePos.x;\n const dy = targetPos.y - sourcePos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n const offset = 8;\n const perpY = -dx / distance;\n return midY + perpY * offset;\n }).attr(\"fill\", theme.axisTextColor).attr(\"font-size\", configValues.labelFontSize).attr(\"text-anchor\", \"middle\").attr(\"dominant-baseline\", \"middle\").attr(\"transform\", (link) => {\n const sourcePos = positions.get(link.source);\n const targetPos = positions.get(link.target);\n const midX = (sourcePos.x + targetPos.x) / 2;\n const midY = (sourcePos.y + targetPos.y) / 2;\n const dx = targetPos.x - sourcePos.x;\n const dy = targetPos.y - sourcePos.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n const offset = 8;\n const perpX = dy / distance;\n const perpY = -dx / distance;\n const labelX = midX + perpX * offset;\n const labelY = midY + perpY * offset;\n let angle = Math.atan2(dy, dx) * 180 / Math.PI;\n if (angle > 90 || angle < -90) {\n angle += 180;\n }\n return `rotate(${angle} ${labelX} ${labelY})`;\n }).text((link) => link.label);\n const trendGroup = root.append(\"g\").attr(\"class\", \"wardley-trends\");\n const trendsWithPositions = data.trends.map((trend) => {\n const origin = positions.get(trend.nodeId);\n if (!origin) {\n return null;\n }\n const targetX = projectX(trend.targetX);\n const targetY = projectY(trend.targetY);\n const dx = targetX - origin.x;\n const dy = targetY - origin.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n const shortenBy = configValues.nodeRadius + 2;\n const adjustedX2 = distance > shortenBy ? targetX - dx / distance * shortenBy : targetX;\n const adjustedY2 = distance > shortenBy ? targetY - dy / distance * shortenBy : targetY;\n return {\n origin,\n targetX,\n targetY,\n adjustedX2,\n adjustedY2\n };\n }).filter((trend) => trend !== null);\n trendGroup.selectAll(\"line\").data(trendsWithPositions).enter().append(\"line\").attr(\"class\", \"wardley-trend\").attr(\"x1\", (trend) => trend.origin.x).attr(\"y1\", (trend) => trend.origin.y).attr(\"x2\", (trend) => trend.adjustedX2).attr(\"y2\", (trend) => trend.adjustedY2).attr(\"stroke\", theme.evolutionStroke).attr(\"stroke-width\", 1).attr(\"stroke-dasharray\", \"4 4\").attr(\"marker-end\", `url(#arrow-${id})`);\n const nodesGroup = root.append(\"g\").attr(\"class\", \"wardley-nodes\");\n const nodeEnter = nodesGroup.selectAll(\"g\").data(data.nodes).enter().append(\"g\").attr(\n \"class\",\n (node) => [\"wardley-node\", node.className ? `wardley-node--${node.className}` : \"\"].filter(Boolean).join(\" \")\n );\n nodeEnter.filter((node) => node.sourceStrategy === \"outsource\").append(\"circle\").attr(\"class\", \"wardley-outsource-overlay\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y).attr(\"r\", configValues.nodeRadius * 2).attr(\"fill\", \"#666\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n nodeEnter.filter((node) => node.sourceStrategy === \"buy\").append(\"circle\").attr(\"class\", \"wardley-buy-overlay\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y).attr(\"r\", configValues.nodeRadius * 2).attr(\"fill\", \"#ccc\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n nodeEnter.filter((node) => node.sourceStrategy === \"build\").append(\"circle\").attr(\"class\", \"wardley-build-overlay\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y).attr(\"r\", configValues.nodeRadius * 2).attr(\"fill\", \"#eee\").attr(\"stroke\", \"#000\").attr(\"stroke-width\", 1);\n const marketNodes = nodeEnter.filter((node) => node.sourceStrategy === \"market\");\n marketNodes.append(\"circle\").attr(\"class\", \"wardley-market-overlay\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y).attr(\"r\", configValues.nodeRadius * 2).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n nodeEnter.filter(\n (node) => !node.isPipelineParent && node.sourceStrategy !== \"market\" && node.className !== \"anchor\"\n ).append(\"circle\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y).attr(\"r\", configValues.nodeRadius).attr(\"fill\", theme.componentFill).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n const smallCircleRadius = configValues.nodeRadius * 0.7;\n const triangleRadius = configValues.nodeRadius * 1.2;\n marketNodes.append(\"line\").attr(\"class\", \"wardley-market-line\").attr(\"x1\", (node) => positions.get(node.id).x).attr(\"y1\", (node) => positions.get(node.id).y - triangleRadius).attr(\"x2\", (node) => positions.get(node.id).x - triangleRadius * Math.cos(Math.PI / 6)).attr(\"y2\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n marketNodes.append(\"line\").attr(\"class\", \"wardley-market-line\").attr(\"x1\", (node) => positions.get(node.id).x - triangleRadius * Math.cos(Math.PI / 6)).attr(\"y1\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"x2\", (node) => positions.get(node.id).x + triangleRadius * Math.cos(Math.PI / 6)).attr(\"y2\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n marketNodes.append(\"line\").attr(\"class\", \"wardley-market-line\").attr(\"x1\", (node) => positions.get(node.id).x + triangleRadius * Math.cos(Math.PI / 6)).attr(\"y1\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"x2\", (node) => positions.get(node.id).x).attr(\"y2\", (node) => positions.get(node.id).y - triangleRadius).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n marketNodes.append(\"circle\").attr(\"class\", \"wardley-market-dot\").attr(\"cx\", (node) => positions.get(node.id).x).attr(\"cy\", (node) => positions.get(node.id).y - triangleRadius).attr(\"r\", smallCircleRadius).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 2);\n marketNodes.append(\"circle\").attr(\"class\", \"wardley-market-dot\").attr(\"cx\", (node) => positions.get(node.id).x - triangleRadius * Math.cos(Math.PI / 6)).attr(\"cy\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"r\", smallCircleRadius).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 2);\n marketNodes.append(\"circle\").attr(\"class\", \"wardley-market-dot\").attr(\"cx\", (node) => positions.get(node.id).x + triangleRadius * Math.cos(Math.PI / 6)).attr(\"cy\", (node) => positions.get(node.id).y + triangleRadius * Math.sin(Math.PI / 6)).attr(\"r\", smallCircleRadius).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 2);\n nodeEnter.filter((node) => node.isPipelineParent === true).append(\"rect\").attr(\"x\", (node) => positions.get(node.id).x - squareSize / 2).attr(\"y\", (node) => positions.get(node.id).y - squareSize / 2).attr(\"width\", squareSize).attr(\"height\", squareSize).attr(\"fill\", theme.componentFill).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n nodeEnter.filter((node) => node.inertia === true).append(\"line\").attr(\"class\", \"wardley-inertia\").attr(\"x1\", (node) => {\n const pos = positions.get(node.id);\n let offset = node.isPipelineParent ? squareSize / 2 + 15 : configValues.nodeRadius + 15;\n if (node.sourceStrategy) {\n offset += configValues.nodeRadius + 10;\n }\n return pos.x + offset;\n }).attr(\"y1\", (node) => {\n const pos = positions.get(node.id);\n const lineHeight = node.isPipelineParent ? squareSize : configValues.nodeRadius * 2;\n return pos.y - lineHeight / 2;\n }).attr(\"x2\", (node) => {\n const pos = positions.get(node.id);\n let offset = node.isPipelineParent ? squareSize / 2 + 15 : configValues.nodeRadius + 15;\n if (node.sourceStrategy) {\n offset += configValues.nodeRadius + 10;\n }\n return pos.x + offset;\n }).attr(\"y2\", (node) => {\n const pos = positions.get(node.id);\n const lineHeight = node.isPipelineParent ? squareSize : configValues.nodeRadius * 2;\n return pos.y + lineHeight / 2;\n }).attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 6);\n nodeEnter.append(\"text\").attr(\"x\", (node) => {\n const pos = positions.get(node.id);\n if (node.className === \"anchor\") {\n return node.labelOffsetX !== void 0 ? pos.x + node.labelOffsetX : pos.x;\n }\n let defaultOffset = configValues.nodeLabelOffset;\n if (node.sourceStrategy && node.labelOffsetX === void 0) {\n defaultOffset += 10;\n }\n const customOffset = node.labelOffsetX ?? defaultOffset;\n return pos.x + customOffset;\n }).attr(\"y\", (node) => {\n const pos = positions.get(node.id);\n if (node.className === \"anchor\") {\n return node.labelOffsetY !== void 0 ? pos.y + node.labelOffsetY : pos.y - 3;\n }\n let defaultOffset = -configValues.nodeLabelOffset;\n if (node.sourceStrategy && node.labelOffsetY === void 0) {\n defaultOffset -= 10;\n }\n const customOffset = node.labelOffsetY ?? defaultOffset;\n return pos.y + customOffset;\n }).attr(\"class\", \"wardley-node-label\").attr(\"fill\", (node) => {\n if (node.className === \"evolved\") {\n return theme.evolutionStroke;\n }\n if (node.className === \"anchor\") {\n return \"#000\";\n }\n return theme.componentLabelColor;\n }).attr(\"font-size\", configValues.labelFontSize).attr(\"font-weight\", (node) => node.className === \"anchor\" ? \"bold\" : \"normal\").attr(\"text-anchor\", (node) => node.className === \"anchor\" ? \"middle\" : \"start\").attr(\"dominant-baseline\", (node) => node.className === \"anchor\" ? \"middle\" : \"auto\").text((node) => node.label);\n if (data.annotations.length > 0) {\n const annotationsGroup = root.append(\"g\").attr(\"class\", \"wardley-annotations\");\n data.annotations.forEach((annotation) => {\n const projectedCoords = annotation.coordinates.map((coord) => ({\n x: projectX(coord.x),\n y: projectY(coord.y)\n }));\n if (projectedCoords.length > 1) {\n for (let i = 0; i < projectedCoords.length - 1; i++) {\n annotationsGroup.append(\"line\").attr(\"class\", \"wardley-annotation-line\").attr(\"x1\", projectedCoords[i].x).attr(\"y1\", projectedCoords[i].y).attr(\"x2\", projectedCoords[i + 1].x).attr(\"y2\", projectedCoords[i + 1].y).attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1.5).attr(\"stroke-dasharray\", \"4 4\");\n }\n }\n projectedCoords.forEach((coord) => {\n const annotationNode = annotationsGroup.append(\"g\").attr(\"class\", \"wardley-annotation\");\n annotationNode.append(\"circle\").attr(\"cx\", coord.x).attr(\"cy\", coord.y).attr(\"r\", 10).attr(\"fill\", \"white\").attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1.5);\n annotationNode.append(\"text\").attr(\"x\", coord.x).attr(\"y\", coord.y).attr(\"text-anchor\", \"middle\").attr(\"dominant-baseline\", \"central\").attr(\"font-size\", 10).attr(\"fill\", theme.axisTextColor).attr(\"font-weight\", \"bold\").text(annotation.number);\n });\n });\n if (data.annotationsBox) {\n let boxX = projectX(data.annotationsBox.x);\n let boxY = projectY(data.annotationsBox.y);\n const padding = 10;\n const lineHeight = 16;\n const fontSize = 11;\n const textBoxGroup = annotationsGroup.append(\"g\").attr(\"class\", \"wardley-annotations-box\");\n const sortedAnnotations = [...data.annotations].filter((a) => a.text).sort((a, b) => a.number - b.number);\n const textElements = [];\n sortedAnnotations.forEach((annotation, idx) => {\n const text2 = textBoxGroup.append(\"text\").attr(\"x\", boxX + padding).attr(\"y\", boxY + padding + (idx + 1) * lineHeight).attr(\"font-size\", fontSize).attr(\"fill\", theme.axisTextColor).attr(\"text-anchor\", \"start\").attr(\"dominant-baseline\", \"middle\").text(`${annotation.number}. ${annotation.text}`);\n textElements.push(text2);\n });\n if (textElements.length > 0) {\n let maxWidth = 0;\n let maxHeight = 0;\n textElements.forEach((text2) => {\n const textNode = text2.node();\n const textWidth = textNode.getComputedTextLength();\n maxWidth = Math.max(maxWidth, textWidth);\n const bbox = textNode.getBBox();\n maxHeight = Math.max(maxHeight, bbox.height);\n });\n const boxWidth = maxWidth + padding * 2 + 105;\n const boxHeight = sortedAnnotations.length * lineHeight + padding * 2 + maxHeight / 2;\n const minX = configValues.padding;\n const maxX = width - configValues.padding - boxWidth;\n const minY = configValues.padding;\n const maxY = height - configValues.padding - boxHeight;\n boxX = Math.max(minX, Math.min(boxX, maxX));\n boxY = Math.max(minY, Math.min(boxY, maxY));\n textElements.forEach((text2, idx) => {\n text2.attr(\"x\", boxX + padding).attr(\"y\", boxY + padding + (idx + 1) * lineHeight);\n });\n textBoxGroup.insert(\"rect\", \"text\").attr(\"x\", boxX).attr(\"y\", boxY).attr(\"width\", boxWidth).attr(\"height\", boxHeight).attr(\"fill\", \"white\").attr(\"stroke\", theme.axisColor).attr(\"stroke-width\", 1.5).attr(\"rx\", 4).attr(\"ry\", 4);\n }\n }\n }\n if (data.notes.length > 0) {\n const notesGroup = root.append(\"g\").attr(\"class\", \"wardley-notes\");\n data.notes.forEach((note) => {\n const noteX = projectX(note.x);\n const noteY = projectY(note.y);\n notesGroup.append(\"text\").attr(\"x\", noteX).attr(\"y\", noteY).attr(\"text-anchor\", \"start\").attr(\"font-size\", 11).attr(\"fill\", theme.axisTextColor).attr(\"font-weight\", \"bold\").text(note.text);\n });\n }\n if (data.accelerators.length > 0) {\n const acceleratorsGroup = root.append(\"g\").attr(\"class\", \"wardley-accelerators\");\n data.accelerators.forEach((accelerator) => {\n const accX = projectX(accelerator.x);\n const accY = projectY(accelerator.y);\n const arrowWidth = 60;\n const arrowHeight = 30;\n const arrowHeadWidth = 20;\n const arrowPath = `\n M ${accX} ${accY - arrowHeight / 2}\n L ${accX + arrowWidth - arrowHeadWidth} ${accY - arrowHeight / 2}\n L ${accX + arrowWidth - arrowHeadWidth} ${accY - arrowHeight / 2 - 8}\n L ${accX + arrowWidth} ${accY}\n L ${accX + arrowWidth - arrowHeadWidth} ${accY + arrowHeight / 2 + 8}\n L ${accX + arrowWidth - arrowHeadWidth} ${accY + arrowHeight / 2}\n L ${accX} ${accY + arrowHeight / 2}\n Z\n `;\n acceleratorsGroup.append(\"path\").attr(\"d\", arrowPath).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n acceleratorsGroup.append(\"text\").attr(\"x\", accX + arrowWidth / 2).attr(\"y\", accY + arrowHeight / 2 + 15).attr(\"text-anchor\", \"middle\").attr(\"font-size\", 10).attr(\"fill\", theme.axisTextColor).attr(\"font-weight\", \"bold\").text(accelerator.name);\n });\n }\n if (data.deaccelerators.length > 0) {\n const deacceleratorsGroup = root.append(\"g\").attr(\"class\", \"wardley-deaccelerators\");\n data.deaccelerators.forEach((deaccelerator) => {\n const decX = projectX(deaccelerator.x);\n const decY = projectY(deaccelerator.y);\n const arrowWidth = 60;\n const arrowHeight = 30;\n const arrowHeadWidth = 20;\n const arrowPath = `\n M ${decX + arrowWidth} ${decY - arrowHeight / 2}\n L ${decX + arrowHeadWidth} ${decY - arrowHeight / 2}\n L ${decX + arrowHeadWidth} ${decY - arrowHeight / 2 - 8}\n L ${decX} ${decY}\n L ${decX + arrowHeadWidth} ${decY + arrowHeight / 2 + 8}\n L ${decX + arrowHeadWidth} ${decY + arrowHeight / 2}\n L ${decX + arrowWidth} ${decY + arrowHeight / 2}\n Z\n `;\n deacceleratorsGroup.append(\"path\").attr(\"d\", arrowPath).attr(\"fill\", \"white\").attr(\"stroke\", theme.componentStroke).attr(\"stroke-width\", 1);\n deacceleratorsGroup.append(\"text\").attr(\"x\", decX + arrowWidth / 2).attr(\"y\", decY + arrowHeight / 2 + 15).attr(\"text-anchor\", \"middle\").attr(\"font-size\", 10).attr(\"fill\", theme.axisTextColor).attr(\"font-weight\", \"bold\").text(deaccelerator.name);\n });\n }\n}, \"draw\");\nvar wardleyRenderer_default = {\n draw\n};\n\n// src/diagrams/wardley/wardleyDiagram.ts\nvar diagram = {\n parser,\n db: wardleyDb_default,\n renderer: wardleyRenderer_default,\n styles: /* @__PURE__ */ (0,_chunk_AGHRB4JF_mjs__WEBPACK_IMPORTED_MODULE_3__.__name)(() => \"\", \"styles\")\n};\n\n\n\n//# sourceURL=webpack://@mdts/frontend/./node_modules/mermaid/dist/chunks/mermaid.core/wardleyDiagram-NUSXRM2D.mjs?\n}");
|
|
29
|
+
|
|
30
|
+
/***/ }
|
|
31
|
+
|
|
32
|
+
}]);
|