"use strict"; exports.id = 9279; exports.ids = [9279]; exports.modules = { /***/ 99279: /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ diagram: () => (/* binding */ diagram) /* harmony export */ }); /* harmony import */ var _styles_4ba6ed67_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(82891); /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(92509); /* harmony import */ var dagre_d3_es_src_dagre_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32085); /* harmony import */ var dagre_d3_es_src_graphlib_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50680); /* harmony import */ var _mermaid_934d9bea_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(58810); /* harmony import */ var ts_dedent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(62059); /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(43598); /* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5123); /* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(62841); let edgeCount = 0; const drawEdge = function(elem, path, relation, conf, diagObj) { const getRelationType = function(type) { switch (type) { case diagObj.db.relationType.AGGREGATION: return "aggregation"; case diagObj.db.relationType.EXTENSION: return "extension"; case diagObj.db.relationType.COMPOSITION: return "composition"; case diagObj.db.relationType.DEPENDENCY: return "dependency"; case diagObj.db.relationType.LOLLIPOP: return "lollipop"; } }; path.points = path.points.filter((p) => !Number.isNaN(p.y)); const lineData = path.points; const lineFunction = (0,d3__WEBPACK_IMPORTED_MODULE_0__/* .line */ .jvg)().x(function(d) { return d.x; }).y(function(d) { return d.y; }).curve(d3__WEBPACK_IMPORTED_MODULE_0__/* .curveBasis */ .$0Z); const svgPath = elem.append("path").attr("d", lineFunction(lineData)).attr("id", "edge" + edgeCount).attr("class", "relation"); let url = ""; if (conf.arrowMarkerAbsolute) { url = window.location.protocol + "//" + window.location.host + window.location.pathname + window.location.search; url = url.replace(/\(/g, "\\("); url = url.replace(/\)/g, "\\)"); } if (relation.relation.lineType == 1) { svgPath.attr("class", "relation dashed-line"); } if (relation.relation.lineType == 10) { svgPath.attr("class", "relation dotted-line"); } if (relation.relation.type1 !== "none") { svgPath.attr( "marker-start", "url(" + url + "#" + getRelationType(relation.relation.type1) + "Start)" ); } if (relation.relation.type2 !== "none") { svgPath.attr( "marker-end", "url(" + url + "#" + getRelationType(relation.relation.type2) + "End)" ); } let x, y; const l = path.points.length; let labelPosition = _mermaid_934d9bea_js__WEBPACK_IMPORTED_MODULE_7__.u.calcLabelPosition(path.points); x = labelPosition.x; y = labelPosition.y; let p1_card_x, p1_card_y; let p2_card_x, p2_card_y; if (l % 2 !== 0 && l > 1) { let cardinality_1_point = _mermaid_934d9bea_js__WEBPACK_IMPORTED_MODULE_7__.u.calcCardinalityPosition( relation.relation.type1 !== "none", path.points, path.points[0] ); let cardinality_2_point = _mermaid_934d9bea_js__WEBPACK_IMPORTED_MODULE_7__.u.calcCardinalityPosition( relation.relation.type2 !== "none", path.points, path.points[l - 1] ); _mermaid_934d9bea_js__WEBPACK_IMPORTED_MODULE_7__.l.debug("cardinality_1_point " + JSON.stringify(cardinality_1_point)); _mermaid_934d9bea_js__WEBPACK_IMPORTED_MODULE_7__.l.debug("cardinality_2_point " + JSON.stringify(cardinality_2_point)); p1_card_x = cardinality_1_point.x; p1_card_y = cardinality_1_point.y; p2_card_x = cardinality_2_point.x; p2_card_y = cardinality_2_point.y; } if (relation.title !== void 0) { const g = elem.append("g").attr("class", "classLabel"); const label = g.append("text").attr("class", "label").attr("x", x).attr("y", y).attr("fill", "red").attr("text-anchor", "middle").text(relation.title); window.label = label; const bounds = label.node().getBBox(); g.insert("rect", ":first-child").attr("class", "box").attr("x", bounds.x - conf.padding / 2).attr("y", bounds.y - conf.padding / 2).attr("width", bounds.width + conf.padding).attr("height", bounds.height + conf.padding); } _mermaid_934d9bea_js__WEBPACK_IMPORTED_MODULE_7__.l.info("Rendering relation " + JSON.stringify(relation)); if (relation.relationTitle1 !== void 0 && relation.relationTitle1 !== "none") { const g = elem.append("g").attr("class", "cardinality"); g.append("text").attr("class", "type1").attr("x", p1_card_x).attr("y", p1_card_y).attr("fill", "black").attr("font-size", "6").text(relation.relationTitle1); } if (relation.relationTitle2 !== void 0 && relation.relationTitle2 !== "none") { const g = elem.append("g").attr("class", "cardinality"); g.append("text").attr("class", "type2").attr("x", p2_card_x).attr("y", p2_card_y).attr("fill", "black").attr("font-size", "6").text(relation.relationTitle2); } edgeCount++; }; const drawClass = function(elem, classDef, conf, diagObj) { _mermaid_934d9bea_js__WEBPACK_IMPORTED_MODULE_7__.l.debug("Rendering class ", classDef, conf); const id = classDef.id; const classInfo = { id, label: classDef.id, width: 0, height: 0 }; const g = elem.append("g").attr("id", diagObj.db.lookUpDomId(id)).attr("class", "classGroup"); let title; if (classDef.link) { title = g.append("svg:a").attr("xlink:href", classDef.link).attr("target", classDef.linkTarget).append("text").attr("y", conf.textHeight + conf.padding).attr("x", 0); } else { title = g.append("text").attr("y", conf.textHeight + conf.padding).attr("x", 0); } let isFirst = true; classDef.annotations.forEach(function(member) { const titleText2 = title.append("tspan").text("«" + member + "»"); if (!isFirst) { titleText2.attr("dy", conf.textHeight); } isFirst = false; }); let classTitleString = getClassTitleString(classDef); const classTitle = title.append("tspan").text(classTitleString).attr("class", "title"); if (!isFirst) { classTitle.attr("dy", conf.textHeight); } const titleHeight = title.node().getBBox().height; let membersLine; let membersBox; let methodsLine; if (classDef.members.length > 0) { membersLine = g.append("line").attr("x1", 0).attr("y1", conf.padding + titleHeight + conf.dividerMargin / 2).attr("y2", conf.padding + titleHeight + conf.dividerMargin / 2); const members = g.append("text").attr("x", conf.padding).attr("y", titleHeight + conf.dividerMargin + conf.textHeight).attr("fill", "white").attr("class", "classText"); isFirst = true; classDef.members.forEach(function(member) { addTspan(members, member, isFirst, conf); isFirst = false; }); membersBox = members.node().getBBox(); } if (classDef.methods.length > 0) { methodsLine = g.append("line").attr("x1", 0).attr("y1", conf.padding + titleHeight + conf.dividerMargin + membersBox.height).attr("y2", conf.padding + titleHeight + conf.dividerMargin + membersBox.height); const methods = g.append("text").attr("x", conf.padding).attr("y", titleHeight + 2 * conf.dividerMargin + membersBox.height + conf.textHeight).attr("fill", "white").attr("class", "classText"); isFirst = true; classDef.methods.forEach(function(method) { addTspan(methods, method, isFirst, conf); isFirst = false; }); } const classBox = g.node().getBBox(); var cssClassStr = " "; if (classDef.cssClasses.length > 0) { cssClassStr = cssClassStr + classDef.cssClasses.join(" "); } const rect = g.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", classBox.width + 2 * conf.padding).attr("height", classBox.height + conf.padding + 0.5 * conf.dividerMargin).attr("class", cssClassStr); const rectWidth = rect.node().getBBox().width; title.node().childNodes.forEach(function(x) { x.setAttribute("x", (rectWidth - x.getBBox().width) / 2); }); if (classDef.tooltip) { title.insert("title").text(classDef.tooltip); } if (membersLine) { membersLine.attr("x2", rectWidth); } if (methodsLine) { methodsLine.attr("x2", rectWidth); } classInfo.width = rectWidth; classInfo.height = classBox.height + conf.padding + 0.5 * conf.dividerMargin; return classInfo; }; const getClassTitleString = function(classDef) { let classTitleString = classDef.id; if (classDef.type) { classTitleString += "<" + (0,_mermaid_934d9bea_js__WEBPACK_IMPORTED_MODULE_7__.v)(classDef.type) + ">"; } return classTitleString; }; const drawNote = function(elem, note, conf, diagObj) { _mermaid_934d9bea_js__WEBPACK_IMPORTED_MODULE_7__.l.debug("Rendering note ", note, conf); const id = note.id; const noteInfo = { id, text: note.text, width: 0, height: 0 }; const g = elem.append("g").attr("id", id).attr("class", "classGroup"); let text = g.append("text").attr("y", conf.textHeight + conf.padding).attr("x", 0); const lines = JSON.parse(`"${note.text}"`).split("\n"); lines.forEach(function(line2) { _mermaid_934d9bea_js__WEBPACK_IMPORTED_MODULE_7__.l.debug(`Adding line: ${line2}`); text.append("tspan").text(line2).attr("class", "title").attr("dy", conf.textHeight); }); const noteBox = g.node().getBBox(); const rect = g.insert("rect", ":first-child").attr("x", 0).attr("y", 0).attr("width", noteBox.width + 2 * conf.padding).attr( "height", noteBox.height + lines.length * conf.textHeight + conf.padding + 0.5 * conf.dividerMargin ); const rectWidth = rect.node().getBBox().width; text.node().childNodes.forEach(function(x) { x.setAttribute("x", (rectWidth - x.getBBox().width) / 2); }); noteInfo.width = rectWidth; noteInfo.height = noteBox.height + lines.length * conf.textHeight + conf.padding + 0.5 * conf.dividerMargin; return noteInfo; }; const addTspan = function(textEl, member, isFirst, conf) { const { displayText, cssStyle } = member.getDisplayDetails(); const tSpan = textEl.append("tspan").attr("x", conf.padding).text(displayText); if (cssStyle !== "") { tSpan.attr("style", member.cssStyle); } if (!isFirst) { tSpan.attr("dy", conf.textHeight); } }; const svgDraw = { getClassTitleString, drawClass, drawEdge, drawNote }; let idCache = {}; const padding = 20; const getGraphId = function(label) { const foundEntry = Object.entries(idCache).find((entry) => entry[1].label === label); if (foundEntry) { return foundEntry[0]; } }; const insertMarkers = function(elem) { elem.append("defs").append("marker").attr("id", "extensionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"); elem.append("defs").append("marker").attr("id", "extensionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z"); elem.append("defs").append("marker").attr("id", "compositionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); elem.append("defs").append("marker").attr("id", "compositionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); elem.append("defs").append("marker").attr("id", "aggregationStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); elem.append("defs").append("marker").attr("id", "aggregationEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"); elem.append("defs").append("marker").attr("id", "dependencyStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"); elem.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z"); }; const draw = function(text, id, _version, diagObj) { const conf = (0,_mermaid_934d9bea_js__WEBPACK_IMPORTED_MODULE_7__.c)().class; idCache = {}; _mermaid_934d9bea_js__WEBPACK_IMPORTED_MODULE_7__.l.info("Rendering diagram " + text); const securityLevel = (0,_mermaid_934d9bea_js__WEBPACK_IMPORTED_MODULE_7__.c)().securityLevel; let sandboxElement; if (securityLevel === "sandbox") { sandboxElement = (0,d3__WEBPACK_IMPORTED_MODULE_0__/* .select */ .Ys)("#i" + id); } const root = securityLevel === "sandbox" ? (0,d3__WEBPACK_IMPORTED_MODULE_0__/* .select */ .Ys)(sandboxElement.nodes()[0].contentDocument.body) : (0,d3__WEBPACK_IMPORTED_MODULE_0__/* .select */ .Ys)("body"); const diagram2 = root.select(`[id='${id}']`); insertMarkers(diagram2); const g = new dagre_d3_es_src_graphlib_index_js__WEBPACK_IMPORTED_MODULE_2__/* .Graph */ .k({ multigraph: true }); g.setGraph({ isMultiGraph: true }); g.setDefaultEdgeLabel(function() { return {}; }); const classes = diagObj.db.getClasses(); const keys = Object.keys(classes); for (const key of keys) { const classDef = classes[key]; const node = svgDraw.drawClass(diagram2, classDef, conf, diagObj); idCache[node.id] = node; g.setNode(node.id, node); _mermaid_934d9bea_js__WEBPACK_IMPORTED_MODULE_7__.l.info("Org height: " + node.height); } const relations = diagObj.db.getRelations(); relations.forEach(function(relation) { _mermaid_934d9bea_js__WEBPACK_IMPORTED_MODULE_7__.l.info( "tjoho" + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation) ); g.setEdge( getGraphId(relation.id1), getGraphId(relation.id2), { relation }, relation.title || "DEFAULT" ); }); const notes = diagObj.db.getNotes(); notes.forEach(function(note) { _mermaid_934d9bea_js__WEBPACK_IMPORTED_MODULE_7__.l.debug(`Adding note: ${JSON.stringify(note)}`); const node = svgDraw.drawNote(diagram2, note, conf, diagObj); idCache[node.id] = node; g.setNode(node.id, node); if (note.class && note.class in classes) { g.setEdge( note.id, getGraphId(note.class), { relation: { id1: note.id, id2: note.class, relation: { type1: "none", type2: "none", lineType: 10 } } }, "DEFAULT" ); } }); (0,dagre_d3_es_src_dagre_index_js__WEBPACK_IMPORTED_MODULE_1__/* .layout */ .bK)(g); g.nodes().forEach(function(v) { if (v !== void 0 && g.node(v) !== void 0) { _mermaid_934d9bea_js__WEBPACK_IMPORTED_MODULE_7__.l.debug("Node " + v + ": " + JSON.stringify(g.node(v))); root.select("#" + (diagObj.db.lookUpDomId(v) || v)).attr( "transform", "translate(" + (g.node(v).x - g.node(v).width / 2) + "," + (g.node(v).y - g.node(v).height / 2) + " )" ); } }); g.edges().forEach(function(e) { if (e !== void 0 && g.edge(e) !== void 0) { _mermaid_934d9bea_js__WEBPACK_IMPORTED_MODULE_7__.l.debug("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(g.edge(e))); svgDraw.drawEdge(diagram2, g.edge(e), g.edge(e).relation, conf, diagObj); } }); const svgBounds = diagram2.node().getBBox(); const width = svgBounds.width + padding * 2; const height = svgBounds.height + padding * 2; (0,_mermaid_934d9bea_js__WEBPACK_IMPORTED_MODULE_7__.i)(diagram2, height, width, conf.useMaxWidth); const vBox = `${svgBounds.x - padding} ${svgBounds.y - padding} ${width} ${height}`; _mermaid_934d9bea_js__WEBPACK_IMPORTED_MODULE_7__.l.debug(`viewBox ${vBox}`); diagram2.attr("viewBox", vBox); }; const renderer = { draw }; const diagram = { parser: _styles_4ba6ed67_js__WEBPACK_IMPORTED_MODULE_8__.p, db: _styles_4ba6ed67_js__WEBPACK_IMPORTED_MODULE_8__.d, renderer, styles: _styles_4ba6ed67_js__WEBPACK_IMPORTED_MODULE_8__.s, init: (cnf) => { if (!cnf.class) { cnf.class = {}; } cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; _styles_4ba6ed67_js__WEBPACK_IMPORTED_MODULE_8__.d.clear(); } }; /***/ }) }; ;