@readme/markdown 8.0.0 → 8.1.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/components/CodeTabs/style.scss +9 -7
- package/components/Style/index.tsx +18 -0
- package/components/TailwindRoot/index.tsx +9 -0
- package/components/index.ts +2 -0
- package/dist/10.node.js +2 -1
- package/dist/10.node.js.map +1 -0
- package/dist/11.node.js +2 -1
- package/dist/11.node.js.map +1 -0
- package/dist/120.node.js +2 -1
- package/dist/120.node.js.map +1 -0
- package/dist/134.node.js +2 -1
- package/dist/134.node.js.map +1 -0
- package/dist/150.node.js +2 -1
- package/dist/150.node.js.map +1 -0
- package/dist/17.node.js +2 -1
- package/dist/17.node.js.map +1 -0
- package/dist/246.node.js +2 -1
- package/dist/246.node.js.map +1 -0
- package/dist/351.node.js +2 -1
- package/dist/351.node.js.map +1 -0
- package/dist/366.node.js +2 -1
- package/dist/366.node.js.map +1 -0
- package/dist/403.node.js +2 -1
- package/dist/403.node.js.map +1 -0
- package/dist/429.node.js +2 -1
- package/dist/429.node.js.map +1 -0
- package/dist/485.node.js +2 -1
- package/dist/485.node.js.map +1 -0
- package/dist/486.node.js +2 -1
- package/dist/486.node.js.map +1 -0
- package/dist/488.node.js +2 -1
- package/dist/488.node.js.map +1 -0
- package/dist/489.node.js +2 -1
- package/dist/489.node.js.map +1 -0
- package/dist/510.node.js +2 -1
- package/dist/510.node.js.map +1 -0
- package/dist/52.node.js +2 -1
- package/dist/52.node.js.map +1 -0
- package/dist/550.node.js +2 -1
- package/dist/550.node.js.map +1 -0
- package/dist/551.node.js +2 -1
- package/dist/551.node.js.map +1 -0
- package/dist/617.node.js +2 -1
- package/dist/617.node.js.map +1 -0
- package/dist/687.node.js +2 -1
- package/dist/687.node.js.map +1 -0
- package/dist/745.node.js +2 -1
- package/dist/745.node.js.map +1 -0
- package/dist/775.node.js +2 -1
- package/dist/775.node.js.map +1 -0
- package/dist/786.node.js +2 -1
- package/dist/786.node.js.map +1 -0
- package/dist/788.node.js +2 -1
- package/dist/788.node.js.map +1 -0
- package/dist/81.node.js +2 -1
- package/dist/81.node.js.map +1 -0
- package/dist/849.node.js +2 -1
- package/dist/849.node.js.map +1 -0
- package/dist/863.node.js +2 -1
- package/dist/863.node.js.map +1 -0
- package/dist/867.node.js +2 -1
- package/dist/867.node.js.map +1 -0
- package/dist/881.node.js +2 -1
- package/dist/881.node.js.map +1 -0
- package/dist/885.node.js +2 -1
- package/dist/885.node.js.map +1 -0
- package/dist/896.node.js +2 -1
- package/dist/896.node.js.map +1 -0
- package/dist/906.node.js +2 -1
- package/dist/906.node.js.map +1 -0
- package/dist/91.node.js +2 -1
- package/dist/91.node.js.map +1 -0
- package/dist/940.node.js +2 -1
- package/dist/940.node.js.map +1 -0
- package/dist/952.node.js +2 -1
- package/dist/952.node.js.map +1 -0
- package/dist/995.node.js +2 -1
- package/dist/995.node.js.map +1 -0
- package/dist/components/Style/index.d.ts +6 -0
- package/dist/components/TailwindRoot/index.d.ts +6 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/example/components.d.ts +7 -0
- package/dist/lib/compile.d.ts +2 -1
- package/dist/lib/run.d.ts +1 -0
- package/dist/lib/styles.d.ts +2 -0
- package/dist/main.css +3 -1
- package/dist/main.css.map +1 -0
- package/dist/main.js +37293 -32287
- package/dist/main.node.js +20274 -11764
- package/dist/main.node.js.map +1 -0
- package/dist/processor/transform/index.d.ts +2 -1
- package/dist/processor/transform/tailwind.d.ts +6 -0
- package/dist/processor/utils.d.ts +15 -1
- package/dist/utils/tailwind-bundle.d.ts +5 -0
- package/package.json +8 -5
package/dist/510.node.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"510.node.js","mappings":";;;;;;;;;;;;AAE8B;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qEAAM;;AAIJ;;;;;;;;;;;;;;;;AClB4B;AAGA;AAGA;AAcA;;AAE9B;AACA;AACA;AACA;AACA;AACA,4BAA4B,gFAAqB;AACjD,iCAAiC,qEAAM;AACvC,iBAAiB,4EAAa;AAC9B;AACA,OAAO,wEAAS;AAChB,GAAG;AACH;AACA;AACA;AACA;AACA,CAAC;AACD,gCAAgC,qEAAM;AACtC,+BAA+B,qEAAM;AACrC;AACA;AACA;AACA,CAAC;AACD,6BAA6B,qEAAM;AACnC,EAAE,oEAAK;AACP;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,aAAa;AACb,iBAAiB;AACjB,iBAAiB;AACjB,mBAAmB;AACnB,mBAAmB;AACnB;;AAEA;AAC2C;AAC3C;AACA,+BAA+B,qEAAM;AACrC,EAAE,8EAAgB;AAClB;AACA;AACA;AACA,UAAU,aAAa;AACvB,aAAa,oBAAoB;AACjC;AACA,sCAAsC,OAAO,IAAI,KAAK;AACtD;AACA;AACA;AACA,wBAAwB,OAAO,IAAI,cAAc,0CAA0C,aAAa;AACxG;AACA;AACA;AACA,IAAI,8DAAG,uBAAuB,OAAO,IAAI,UAAU,aAAa,MAAM;AACtE;AACA,uDAAuD,mBAAmB;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,oBAAoB;AAC7B;AACA;AACA;AACA,CAAC;AACD,0CAA0C,qEAAM;AAChD;AACA;AACA;AACA;AACA,mCAAmC,aAAa,4BAA4B,UAAU;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA,yBAAyB,qEAAM;AAC/B,sBAAsB,mEAAK;AAC3B,IAAI,8DAAG;AACP;AACA,GAAG;AACH;;AAEA;AACA,2BAA2B,qEAAM;AACjC;AACA;AACA,UAAU,4CAA4C;AACtD;AACA;AACA;AACA;AACA;AACA,cAAc,8EAAgB;AAC9B,6BAA6B,UAAU,EAAE,UAAU;AACnD,EAAE,+EAAgB;AAClB;AACA;AACA;AACA;AACA,CAAC;AACD,+BAA+B,qEAAM,0BAA0B,+DAA+D;AAC9H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,qEAAM,IAAI,SAAS,IAAI;AACpD,kBAAkB,4EAAa;AAC/B;AACA;AACA,eAAe;AACf;AACA;AACA,UAAU;AACV;AACA;AACA,UAAU;AACV;AACA;AACA,UAAU;AACV,eAAe;AACf;AACA;AACA,UAAU;AACV,eAAe;AACf;AACA;AACA,YAAY;AACZ,kBAAkB;AAClB,UAAU;AACV;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AAGE","sources":["webpack://@readme/markdown/./node_modules/mermaid/dist/chunks/mermaid.core/chunk-RYO7GUH3.mjs","webpack://@readme/markdown/./node_modules/mermaid/dist/chunks/mermaid.core/diagram-AVGMFHF7.mjs"],"sourcesContent":["import {\n __name\n} from \"./chunk-S24QXQKS.mjs\";\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__name(populateCommonDb, \"populateCommonDb\");\n\nexport {\n populateCommonDb\n};\n","import {\n populateCommonDb\n} from \"./chunk-RYO7GUH3.mjs\";\nimport {\n cleanAndMerge\n} from \"./chunk-TLUHKHBO.mjs\";\nimport {\n selectSvgElement\n} from \"./chunk-OBAELV6Q.mjs\";\nimport {\n __name,\n clear,\n configureSvgSize,\n defaultConfig_default,\n getAccDescription,\n getAccTitle,\n getConfig,\n getDiagramTitle,\n log,\n setAccDescription,\n setAccTitle,\n setDiagramTitle\n} from \"./chunk-S24QXQKS.mjs\";\n\n// src/diagrams/packet/db.ts\nvar defaultPacketData = {\n packet: []\n};\nvar data = structuredClone(defaultPacketData);\nvar DEFAULT_PACKET_CONFIG = defaultConfig_default.packet;\nvar getConfig2 = /* @__PURE__ */ __name(() => {\n const config = cleanAndMerge({\n ...DEFAULT_PACKET_CONFIG,\n ...getConfig().packet\n });\n if (config.showBits) {\n config.paddingY += 10;\n }\n return config;\n}, \"getConfig\");\nvar getPacket = /* @__PURE__ */ __name(() => data.packet, \"getPacket\");\nvar pushWord = /* @__PURE__ */ __name((word) => {\n if (word.length > 0) {\n data.packet.push(word);\n }\n}, \"pushWord\");\nvar clear2 = /* @__PURE__ */ __name(() => {\n clear();\n data = structuredClone(defaultPacketData);\n}, \"clear\");\nvar db = {\n pushWord,\n getPacket,\n getConfig: getConfig2,\n clear: clear2,\n setAccTitle,\n getAccTitle,\n setDiagramTitle,\n getDiagramTitle,\n getAccDescription,\n setAccDescription\n};\n\n// src/diagrams/packet/parser.ts\nimport { parse } from \"@mermaid-js/parser\";\nvar maxPacketSize = 1e4;\nvar populate = /* @__PURE__ */ __name((ast) => {\n populateCommonDb(ast, db);\n let lastByte = -1;\n let word = [];\n let row = 1;\n const { bitsPerRow } = db.getConfig();\n for (let { start, end, label } of ast.blocks) {\n if (end && end < start) {\n throw new Error(`Packet block ${start} - ${end} is invalid. End must be greater than start.`);\n }\n if (start !== lastByte + 1) {\n throw new Error(\n `Packet block ${start} - ${end ?? start} is not contiguous. It should start from ${lastByte + 1}.`\n );\n }\n lastByte = end ?? start;\n log.debug(`Packet block ${start} - ${lastByte} with label ${label}`);\n while (word.length <= bitsPerRow + 1 && db.getPacket().length < maxPacketSize) {\n const [block, nextBlock] = getNextFittingBlock({ start, end, label }, row, bitsPerRow);\n word.push(block);\n if (block.end + 1 === row * bitsPerRow) {\n db.pushWord(word);\n word = [];\n row++;\n }\n if (!nextBlock) {\n break;\n }\n ({ start, end, label } = nextBlock);\n }\n }\n db.pushWord(word);\n}, \"populate\");\nvar getNextFittingBlock = /* @__PURE__ */ __name((block, row, bitsPerRow) => {\n if (block.end === void 0) {\n block.end = block.start;\n }\n if (block.start > block.end) {\n throw new Error(`Block start ${block.start} is greater than block end ${block.end}.`);\n }\n if (block.end + 1 <= row * bitsPerRow) {\n return [block, void 0];\n }\n return [\n {\n start: block.start,\n end: row * bitsPerRow - 1,\n label: block.label\n },\n {\n start: row * bitsPerRow,\n end: block.end,\n label: block.label\n }\n ];\n}, \"getNextFittingBlock\");\nvar parser = {\n parse: /* @__PURE__ */ __name(async (input) => {\n const ast = await parse(\"packet\", input);\n log.debug(ast);\n populate(ast);\n }, \"parse\")\n};\n\n// src/diagrams/packet/renderer.ts\nvar draw = /* @__PURE__ */ __name((_text, id, _version, diagram2) => {\n const db2 = diagram2.db;\n const config = db2.getConfig();\n const { rowHeight, paddingY, bitWidth, bitsPerRow } = config;\n const words = db2.getPacket();\n const title = db2.getDiagramTitle();\n const totalRowHeight = rowHeight + paddingY;\n const svgHeight = totalRowHeight * (words.length + 1) - (title ? 0 : rowHeight);\n const svgWidth = bitWidth * bitsPerRow + 2;\n const svg = selectSvgElement(id);\n svg.attr(\"viewbox\", `0 0 ${svgWidth} ${svgHeight}`);\n configureSvgSize(svg, svgHeight, svgWidth, config.useMaxWidth);\n for (const [word, packet] of words.entries()) {\n drawWord(svg, packet, word, config);\n }\n svg.append(\"text\").text(title).attr(\"x\", svgWidth / 2).attr(\"y\", svgHeight - totalRowHeight / 2).attr(\"dominant-baseline\", \"middle\").attr(\"text-anchor\", \"middle\").attr(\"class\", \"packetTitle\");\n}, \"draw\");\nvar drawWord = /* @__PURE__ */ __name((svg, word, rowNumber, { rowHeight, paddingX, paddingY, bitWidth, bitsPerRow, showBits }) => {\n const group = svg.append(\"g\");\n const wordY = rowNumber * (rowHeight + paddingY) + paddingY;\n for (const block of word) {\n const blockX = block.start % bitsPerRow * bitWidth + 1;\n const width = (block.end - block.start + 1) * bitWidth - paddingX;\n group.append(\"rect\").attr(\"x\", blockX).attr(\"y\", wordY).attr(\"width\", width).attr(\"height\", rowHeight).attr(\"class\", \"packetBlock\");\n group.append(\"text\").attr(\"x\", blockX + width / 2).attr(\"y\", wordY + rowHeight / 2).attr(\"class\", \"packetLabel\").attr(\"dominant-baseline\", \"middle\").attr(\"text-anchor\", \"middle\").text(block.label);\n if (!showBits) {\n continue;\n }\n const isSingleBlock = block.end === block.start;\n const bitNumberY = wordY - 2;\n group.append(\"text\").attr(\"x\", blockX + (isSingleBlock ? width / 2 : 0)).attr(\"y\", bitNumberY).attr(\"class\", \"packetByte start\").attr(\"dominant-baseline\", \"auto\").attr(\"text-anchor\", isSingleBlock ? \"middle\" : \"start\").text(block.start);\n if (!isSingleBlock) {\n group.append(\"text\").attr(\"x\", blockX + width).attr(\"y\", bitNumberY).attr(\"class\", \"packetByte end\").attr(\"dominant-baseline\", \"auto\").attr(\"text-anchor\", \"end\").text(block.end);\n }\n }\n}, \"drawWord\");\nvar renderer = { draw };\n\n// src/diagrams/packet/styles.ts\nvar defaultPacketStyleOptions = {\n byteFontSize: \"10px\",\n startByteColor: \"black\",\n endByteColor: \"black\",\n labelColor: \"black\",\n labelFontSize: \"12px\",\n titleColor: \"black\",\n titleFontSize: \"14px\",\n blockStrokeColor: \"black\",\n blockStrokeWidth: \"1\",\n blockFillColor: \"#efefef\"\n};\nvar styles = /* @__PURE__ */ __name(({ packet } = {}) => {\n const options = cleanAndMerge(defaultPacketStyleOptions, packet);\n return `\n\t.packetByte {\n\t\tfont-size: ${options.byteFontSize};\n\t}\n\t.packetByte.start {\n\t\tfill: ${options.startByteColor};\n\t}\n\t.packetByte.end {\n\t\tfill: ${options.endByteColor};\n\t}\n\t.packetLabel {\n\t\tfill: ${options.labelColor};\n\t\tfont-size: ${options.labelFontSize};\n\t}\n\t.packetTitle {\n\t\tfill: ${options.titleColor};\n\t\tfont-size: ${options.titleFontSize};\n\t}\n\t.packetBlock {\n\t\tstroke: ${options.blockStrokeColor};\n\t\tstroke-width: ${options.blockStrokeWidth};\n\t\tfill: ${options.blockFillColor};\n\t}\n\t`;\n}, \"styles\");\n\n// src/diagrams/packet/diagram.ts\nvar diagram = {\n parser,\n db,\n renderer,\n styles\n};\nexport {\n diagram\n};\n"],"names":[],"sourceRoot":""}
|
package/dist/52.node.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"52.node.js","mappings":";;;;;;;;;;;;;;;;AAA+B;AACI;;AAEZ;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO,0DAAa;AACpB,iBAAiB,0DAAO;AACxB;AACA;AACA;;AAEA;AACA,SAAS,0DAAK;AACd;AACA;AACA,iBAAiB;AACjB,SAAS,0DAAa;AACtB;AACA;AACA,SAAS,0DAAa;AACtB;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA,SAAS,0DAAK;AACd;AACA,iBAAiB;AACjB,SAAS,0DAAa;AACtB;AACA;AACA,SAAS,0DAAa;AACtB;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,gBAAgB,0CAA0C;AAC1D,GAAG;AACH;AACA;;;;;;;;;;;;AC9DwC;;AAExC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,aAAa,GAAG;AAChB;AACA;AACA;AACA,oBAAoB,QAAQ,IAAI,QAAQ;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,kEAAS;AAClB;;AAEA,iEAAe,KAAK,EAAC;;;;;;;;;;;;;;;;;;;;;ACtBS;AACA;AAGA;AACA;AACA;AAKA;;AAE9B;AACuE;AACL;AACH;;AAE/D;AAC8D;AACG;AACjE;AACA;AACA;AACA,6BAA6B,qEAAM;AACnC;AACA;AACA;AACA,CAAC;AACD,mCAAmC,qEAAM;AACzC;AACA,EAAE,8DAAG;AACL;AACA,CAAC;AACD,oCAAoC,qEAAM;AAC1C;AACA,EAAE,8DAAG;AACL,EAAE,8DAAG;AACL;AACA;AACA;AACA;AACA,IAAI,8DAAG;AACP;AACA;AACA;AACA,CAAC;AACD,2BAA2B,qEAAM;AACjC,EAAE,8DAAG;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,8DAAG;AACL;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM,8DAAG;AACT;AACA;AACA,QAAQ,8DAAG;AACX;AACA;AACA;AACA,QAAQ,8DAAG;AACX;AACA,QAAQ;AACR,QAAQ,8DAAG;AACX,QAAQ,8DAAG;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,8DAAG;AACT;AACA,QAAQ,8DAAG;AACX;AACA,QAAQ,8DAAG;AACX;AACA;AACA,YAAY,8DAAG;AACf;AACA,YAAY,8DAAG;AACf,YAAY;AACZ,YAAY,8DAAG;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,UAAU,8DAAG;AACb;AACA,OAAO;AACP;AACA,IAAI,8DAAG;AACP;AACA,GAAG;AACH,CAAC;AACD,yCAAyC,qEAAM;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,sCAAsC,qEAAM;AAC5C;AACA;AACA;AACA,aAAa;AACb,GAAG;AACH;AACA,aAAa;AACb,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD,0CAA0C,qEAAM;AAChD;AACA,EAAE,8DAAG;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,kCAAkC,qEAAM;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,6CAA6C,qEAAM;AACnD;AACA,IAAI,8DAAG;AACP;AACA,IAAI;AACJ,IAAI,8DAAG;AACP;AACA;AACA;AACA;AACA,MAAM,8DAAG;AACT;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,qEAAqE;AAC/F;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,MAAM,8DAAG;AACT;AACA;AACA;AACA;AACA,UAAU,8DAAG;AACb,UAAU,8DAAG;AACb;AACA;AACA,OAAO;AACP,MAAM;AACN,MAAM,8DAAG;AACT;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,8DAAG;AACP,IAAI,8DAAG;AACP;AACA;AACA,IAAI,8DAAG;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,8DAAG;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,8DAAG;AACT;AACA;AACA,GAAG;AACH,EAAE,8DAAG,wBAAwB,4EAAkB;AAC/C;AACA,EAAE,8DAAG;AACL,CAAC;AACD,gCAAgC,qEAAM;AACtC,EAAE,8DAAG,6BAA6B,4EAAkB;AACpD;AACA,IAAI,8DAAG;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,8DAAG;AACP;AACA;AACA,EAAE,8DAAG;AACL;AACA,IAAI,8DAAG;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,8DAAG;AACT,MAAM;AACN,MAAM,8DAAG;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAG;AACX;AACA,+BAA+B,6EAAc;AAC7C;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP,MAAM,8DAAG,+BAA+B,4EAAkB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,MAAM,8DAAG,iDAAiD,4EAAkB;AAC5E,MAAM,8DAAG,+BAA+B,4EAAkB;AAC1D,MAAM;AACN,MAAM,8DAAG;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,8DAAG;AACT;AACA;AACA;AACA,EAAE,8DAAG;AACL;AACA;AACA,IAAI,8DAAG;AACP;AACA;AACA;AACA;AACA,CAAC;AACD,6BAA6B,qEAAM;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD,2CAA2C,qEAAM;;AAEjD;AACA,sCAAsC,qEAAM;AAC5C,EAAE,8DAAG,uCAAuC,4EAAmB;AAC/D;AACA,EAAE,8DAAG;AACL;AACA;AACA,IAAI,8DAAG;AACP,IAAI;AACJ,IAAI,8DAAG;AACP;AACA;AACA,IAAI,8DAAG;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAG;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,8DAAG;AACb;AACA;AACA;AACA,MAAM,8DAAG;AACT;AACA,QAAQ,8DAAG;AACX,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,+EAAgB;AACxB;AACA,QAAQ,8DAAG;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,0EAAW;AACnB,QAAQ;AACR;AACA,UAAU,8DAAG;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,8DAAG;AACb,mCAAmC,+CAA+C;AAClF,UAAU;AACV,UAAU,8DAAG;AACb,gBAAgB,yEAAU,yBAAyB,yBAAyB;AAC5E;AACA;AACA,KAAK;AACL;AACA,uCAAuC,qEAAM;AAC7C;AACA;AACA,MAAM,8DAAG;AACT,MAAM,8DAAG;AACT,MAAM,8DAAG;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,8EAAe;AAC3B,KAAK;AACL;AACA,GAAG;AACH;AACA,EAAE,8DAAG,6CAA6C,4EAAmB;AACrE,EAAE,8DAAG;AACL,EAAE,8DAAG;AACL,EAAE,8DAAG;AACL,EAAE,gFAAW;AACb,EAAE,8DAAG,4CAA4C,4EAAmB;AACpE;AACA,QAAQ,2BAA2B,EAAE,qFAAuB;AAC5D;AACA;AACA;AACA,MAAM,8DAAG;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAG;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,2EAAY;AACpB,QAAQ;AACR;AACA,UAAU,8DAAG;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,8DAAG;AACb,gBAAgB,2EAAa;AAC7B;AACA,UAAU;AACV;AACA;AACA,UAAU,8DAAG;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,2EAAY;AACtB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,IAAI,8DAAG;AACP;AACA;AACA;AACA,kBAAkB,yEAAU;AAC5B,IAAI,gFAAiB;AACrB,GAAG;AACH;AACA;AACA,IAAI,8DAAG;AACP;AACA;AACA;AACA,GAAG;AACH,EAAE,8DAAG;AACL,WAAW;AACX,CAAC;AACD,6BAA6B,qEAAM;AACnC,oBAAoB,6EAAe;AACnC;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA,EAAE,8EAAe;AACjB,EAAE,qEAAM;AACR,EAAE,qEAAM;AACR,EAAE,oEAAK;AACP;AACA;AACA,6BAA6B,SAAS;AACtC;AACA;AACA;AACA,GAAG;AACH,EAAE,8DAAG;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,4CAA4C,SAAS;AACrD;AACA,GAAG;AACH,EAAE,8DAAG,wCAAwC,4EAAmB;AAChE;AACA,EAAE,8DAAG,yCAAyC,4EAAmB;AACjE,qBAAqB,yEAAS;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAGC","sources":["webpack://@readme/markdown/./node_modules/dagre-d3-es/src/graphlib/json.js","webpack://@readme/markdown/./node_modules/lodash-es/clone.js","webpack://@readme/markdown/./node_modules/mermaid/dist/chunks/mermaid.core/dagre-7KT5K2WU.mjs"],"sourcesContent":["import * as _ from 'lodash-es';\nimport { Graph } from './graph.js';\n\nexport { write, read };\n\nfunction write(g) {\n var json = {\n options: {\n directed: g.isDirected(),\n multigraph: g.isMultigraph(),\n compound: g.isCompound(),\n },\n nodes: writeNodes(g),\n edges: writeEdges(g),\n };\n if (!_.isUndefined(g.graph())) {\n json.value = _.clone(g.graph());\n }\n return json;\n}\n\nfunction writeNodes(g) {\n return _.map(g.nodes(), function (v) {\n var nodeValue = g.node(v);\n var parent = g.parent(v);\n var node = { v: v };\n if (!_.isUndefined(nodeValue)) {\n node.value = nodeValue;\n }\n if (!_.isUndefined(parent)) {\n node.parent = parent;\n }\n return node;\n });\n}\n\nfunction writeEdges(g) {\n return _.map(g.edges(), function (e) {\n var edgeValue = g.edge(e);\n var edge = { v: e.v, w: e.w };\n if (!_.isUndefined(e.name)) {\n edge.name = e.name;\n }\n if (!_.isUndefined(edgeValue)) {\n edge.value = edgeValue;\n }\n return edge;\n });\n}\n\nfunction read(json) {\n var g = new Graph(json.options).setGraph(json.value);\n _.each(json.nodes, function (entry) {\n g.setNode(entry.v, entry.value);\n if (entry.parent) {\n g.setParent(entry.v, entry.parent);\n }\n });\n _.each(json.edges, function (entry) {\n g.setEdge({ v: entry.v, w: entry.w, name: entry.name }, entry.value);\n });\n return g;\n}\n","import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\nfunction clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n}\n\nexport default clone;\n","import {\n clear,\n clear2,\n clear3,\n insertCluster,\n insertEdge,\n insertEdgeLabel,\n insertNode,\n markers_default,\n positionEdgeLabel,\n positionNode,\n setNodeElem,\n updateNodeBounds\n} from \"./chunk-O5FTX4FK.mjs\";\nimport \"./chunk-CTJGIJSU.mjs\";\nimport {\n getSubGraphTitleMargins\n} from \"./chunk-I3FGKTZ5.mjs\";\nimport \"./chunk-U7L4IQIU.mjs\";\nimport \"./chunk-TLUHKHBO.mjs\";\nimport {\n __name,\n getConfig2 as getConfig,\n log\n} from \"./chunk-S24QXQKS.mjs\";\n\n// src/rendering-util/layout-algorithms/dagre/index.js\nimport { layout as dagreLayout } from \"dagre-d3-es/src/dagre/index.js\";\nimport * as graphlibJson2 from \"dagre-d3-es/src/graphlib/json.js\";\nimport * as graphlib2 from \"dagre-d3-es/src/graphlib/index.js\";\n\n// src/rendering-util/layout-algorithms/dagre/mermaid-graphlib.js\nimport * as graphlib from \"dagre-d3-es/src/graphlib/index.js\";\nimport * as graphlibJson from \"dagre-d3-es/src/graphlib/json.js\";\nvar clusterDb = /* @__PURE__ */ new Map();\nvar descendants = /* @__PURE__ */ new Map();\nvar parents = /* @__PURE__ */ new Map();\nvar clear4 = /* @__PURE__ */ __name(() => {\n descendants.clear();\n parents.clear();\n clusterDb.clear();\n}, \"clear\");\nvar isDescendant = /* @__PURE__ */ __name((id, ancestorId) => {\n const ancestorDescendants = descendants.get(ancestorId) || [];\n log.trace(\"In isDescendant\", ancestorId, \" \", id, \" = \", ancestorDescendants.includes(id));\n return ancestorDescendants.includes(id);\n}, \"isDescendant\");\nvar edgeInCluster = /* @__PURE__ */ __name((edge, clusterId) => {\n const clusterDescendants = descendants.get(clusterId) || [];\n log.info(\"Descendants of \", clusterId, \" is \", clusterDescendants);\n log.info(\"Edge is \", edge);\n if (edge.v === clusterId || edge.w === clusterId) {\n return false;\n }\n if (!clusterDescendants) {\n log.debug(\"Tilt, \", clusterId, \",not in descendants\");\n return false;\n }\n return clusterDescendants.includes(edge.v) || isDescendant(edge.v, clusterId) || isDescendant(edge.w, clusterId) || clusterDescendants.includes(edge.w);\n}, \"edgeInCluster\");\nvar copy = /* @__PURE__ */ __name((clusterId, graph, newGraph, rootId) => {\n log.warn(\n \"Copying children of \",\n clusterId,\n \"root\",\n rootId,\n \"data\",\n graph.node(clusterId),\n rootId\n );\n const nodes = graph.children(clusterId) || [];\n if (clusterId !== rootId) {\n nodes.push(clusterId);\n }\n log.warn(\"Copying (nodes) clusterId\", clusterId, \"nodes\", nodes);\n nodes.forEach((node) => {\n if (graph.children(node).length > 0) {\n copy(node, graph, newGraph, rootId);\n } else {\n const data = graph.node(node);\n log.info(\"cp \", node, \" to \", rootId, \" with parent \", clusterId);\n newGraph.setNode(node, data);\n if (rootId !== graph.parent(node)) {\n log.warn(\"Setting parent\", node, graph.parent(node));\n newGraph.setParent(node, graph.parent(node));\n }\n if (clusterId !== rootId && node !== clusterId) {\n log.debug(\"Setting parent\", node, clusterId);\n newGraph.setParent(node, clusterId);\n } else {\n log.info(\"In copy \", clusterId, \"root\", rootId, \"data\", graph.node(clusterId), rootId);\n log.debug(\n \"Not Setting parent for node=\",\n node,\n \"cluster!==rootId\",\n clusterId !== rootId,\n \"node!==clusterId\",\n node !== clusterId\n );\n }\n const edges = graph.edges(node);\n log.debug(\"Copying Edges\", edges);\n edges.forEach((edge) => {\n log.info(\"Edge\", edge);\n const data2 = graph.edge(edge.v, edge.w, edge.name);\n log.info(\"Edge data\", data2, rootId);\n try {\n if (edgeInCluster(edge, rootId)) {\n log.info(\"Copying as \", edge.v, edge.w, data2, edge.name);\n newGraph.setEdge(edge.v, edge.w, data2, edge.name);\n log.info(\"newGraph edges \", newGraph.edges(), newGraph.edge(newGraph.edges()[0]));\n } else {\n log.info(\n \"Skipping copy of edge \",\n edge.v,\n \"-->\",\n edge.w,\n \" rootId: \",\n rootId,\n \" clusterId:\",\n clusterId\n );\n }\n } catch (e) {\n log.error(e);\n }\n });\n }\n log.debug(\"Removing node\", node);\n graph.removeNode(node);\n });\n}, \"copy\");\nvar extractDescendants = /* @__PURE__ */ __name((id, graph) => {\n const children = graph.children(id);\n let res = [...children];\n for (const child of children) {\n parents.set(child, id);\n res = [...res, ...extractDescendants(child, graph)];\n }\n return res;\n}, \"extractDescendants\");\nvar findCommonEdges = /* @__PURE__ */ __name((graph, id1, id2) => {\n const edges1 = graph.edges().filter((edge) => edge.v === id1 || edge.w === id1);\n const edges2 = graph.edges().filter((edge) => edge.v === id2 || edge.w === id2);\n const edges1Prim = edges1.map((edge) => {\n return { v: edge.v === id1 ? id2 : edge.v, w: edge.w === id1 ? id1 : edge.w };\n });\n const edges2Prim = edges2.map((edge) => {\n return { v: edge.v, w: edge.w };\n });\n const result = edges1Prim.filter((edgeIn1) => {\n return edges2Prim.some((edge) => edgeIn1.v === edge.v && edgeIn1.w === edge.w);\n });\n return result;\n}, \"findCommonEdges\");\nvar findNonClusterChild = /* @__PURE__ */ __name((id, graph, clusterId) => {\n const children = graph.children(id);\n log.trace(\"Searching children of id \", id, children);\n if (children.length < 1) {\n return id;\n }\n let reserve;\n for (const child of children) {\n const _id = findNonClusterChild(child, graph, clusterId);\n const commonEdges = findCommonEdges(graph, clusterId, _id);\n if (_id) {\n if (commonEdges.length > 0) {\n reserve = _id;\n } else {\n return _id;\n }\n }\n }\n return reserve;\n}, \"findNonClusterChild\");\nvar getAnchorId = /* @__PURE__ */ __name((id) => {\n if (!clusterDb.has(id)) {\n return id;\n }\n if (!clusterDb.get(id).externalConnections) {\n return id;\n }\n if (clusterDb.has(id)) {\n return clusterDb.get(id).id;\n }\n return id;\n}, \"getAnchorId\");\nvar adjustClustersAndEdges = /* @__PURE__ */ __name((graph, depth) => {\n if (!graph || depth > 10) {\n log.debug(\"Opting out, no graph \");\n return;\n } else {\n log.debug(\"Opting in, graph \");\n }\n graph.nodes().forEach(function(id) {\n const children = graph.children(id);\n if (children.length > 0) {\n log.warn(\n \"Cluster identified\",\n id,\n \" Replacement id in edges: \",\n findNonClusterChild(id, graph, id)\n );\n descendants.set(id, extractDescendants(id, graph));\n clusterDb.set(id, { id: findNonClusterChild(id, graph, id), clusterData: graph.node(id) });\n }\n });\n graph.nodes().forEach(function(id) {\n const children = graph.children(id);\n const edges = graph.edges();\n if (children.length > 0) {\n log.debug(\"Cluster identified\", id, descendants);\n edges.forEach((edge) => {\n const d1 = isDescendant(edge.v, id);\n const d2 = isDescendant(edge.w, id);\n if (d1 ^ d2) {\n log.warn(\"Edge: \", edge, \" leaves cluster \", id);\n log.warn(\"Descendants of XXX \", id, \": \", descendants.get(id));\n clusterDb.get(id).externalConnections = true;\n }\n });\n } else {\n log.debug(\"Not a cluster \", id, descendants);\n }\n });\n for (let id of clusterDb.keys()) {\n const nonClusterChild = clusterDb.get(id).id;\n const parent = graph.parent(nonClusterChild);\n if (parent !== id && clusterDb.has(parent) && !clusterDb.get(parent).externalConnections) {\n clusterDb.get(id).id = parent;\n }\n }\n graph.edges().forEach(function(e) {\n const edge = graph.edge(e);\n log.warn(\"Edge \" + e.v + \" -> \" + e.w + \": \" + JSON.stringify(e));\n log.warn(\"Edge \" + e.v + \" -> \" + e.w + \": \" + JSON.stringify(graph.edge(e)));\n let v = e.v;\n let w = e.w;\n log.warn(\n \"Fix XXX\",\n clusterDb,\n \"ids:\",\n e.v,\n e.w,\n \"Translating: \",\n clusterDb.get(e.v),\n \" --- \",\n clusterDb.get(e.w)\n );\n if (clusterDb.get(e.v) || clusterDb.get(e.w)) {\n log.warn(\"Fixing and trying - removing XXX\", e.v, e.w, e.name);\n v = getAnchorId(e.v);\n w = getAnchorId(e.w);\n graph.removeEdge(e.v, e.w, e.name);\n if (v !== e.v) {\n const parent = graph.parent(v);\n clusterDb.get(parent).externalConnections = true;\n edge.fromCluster = e.v;\n }\n if (w !== e.w) {\n const parent = graph.parent(w);\n clusterDb.get(parent).externalConnections = true;\n edge.toCluster = e.w;\n }\n log.warn(\"Fix Replacing with XXX\", v, w, e.name);\n graph.setEdge(v, w, edge, e.name);\n }\n });\n log.warn(\"Adjusted Graph\", graphlibJson.write(graph));\n extractor(graph, 0);\n log.trace(clusterDb);\n}, \"adjustClustersAndEdges\");\nvar extractor = /* @__PURE__ */ __name((graph, depth) => {\n log.warn(\"extractor - \", depth, graphlibJson.write(graph), graph.children(\"D\"));\n if (depth > 10) {\n log.error(\"Bailing out\");\n return;\n }\n let nodes = graph.nodes();\n let hasChildren = false;\n for (const node of nodes) {\n const children = graph.children(node);\n hasChildren = hasChildren || children.length > 0;\n }\n if (!hasChildren) {\n log.debug(\"Done, no node has children\", graph.nodes());\n return;\n }\n log.debug(\"Nodes = \", nodes, depth);\n for (const node of nodes) {\n log.debug(\n \"Extracting node\",\n node,\n clusterDb,\n clusterDb.has(node) && !clusterDb.get(node).externalConnections,\n !graph.parent(node),\n graph.node(node),\n graph.children(\"D\"),\n \" Depth \",\n depth\n );\n if (!clusterDb.has(node)) {\n log.debug(\"Not a cluster\", node, depth);\n } else if (!clusterDb.get(node).externalConnections && graph.children(node) && graph.children(node).length > 0) {\n log.warn(\n \"Cluster without external connections, without a parent and with children\",\n node,\n depth\n );\n const graphSettings = graph.graph();\n let dir = graphSettings.rankdir === \"TB\" ? \"LR\" : \"TB\";\n if (clusterDb.get(node)?.clusterData?.dir) {\n dir = clusterDb.get(node).clusterData.dir;\n log.warn(\"Fixing dir\", clusterDb.get(node).clusterData.dir, dir);\n }\n const clusterGraph = new graphlib.Graph({\n multigraph: true,\n compound: true\n }).setGraph({\n rankdir: dir,\n nodesep: 50,\n ranksep: 50,\n marginx: 8,\n marginy: 8\n }).setDefaultEdgeLabel(function() {\n return {};\n });\n log.warn(\"Old graph before copy\", graphlibJson.write(graph));\n copy(node, graph, clusterGraph, node);\n graph.setNode(node, {\n clusterNode: true,\n id: node,\n clusterData: clusterDb.get(node).clusterData,\n label: clusterDb.get(node).label,\n graph: clusterGraph\n });\n log.warn(\"New graph after copy node: (\", node, \")\", graphlibJson.write(clusterGraph));\n log.debug(\"Old graph after copy\", graphlibJson.write(graph));\n } else {\n log.warn(\n \"Cluster ** \",\n node,\n \" **not meeting the criteria !externalConnections:\",\n !clusterDb.get(node).externalConnections,\n \" no parent: \",\n !graph.parent(node),\n \" children \",\n graph.children(node) && graph.children(node).length > 0,\n graph.children(\"D\"),\n depth\n );\n log.debug(clusterDb);\n }\n }\n nodes = graph.nodes();\n log.warn(\"New list of nodes\", nodes);\n for (const node of nodes) {\n const data = graph.node(node);\n log.warn(\" Now next level\", node, data);\n if (data?.clusterNode) {\n extractor(data.graph, depth + 1);\n }\n }\n}, \"extractor\");\nvar sorter = /* @__PURE__ */ __name((graph, nodes) => {\n if (nodes.length === 0) {\n return [];\n }\n let result = Object.assign([], nodes);\n nodes.forEach((node) => {\n const children = graph.children(node);\n const sorted = sorter(graph, children);\n result = [...result, ...sorted];\n });\n return result;\n}, \"sorter\");\nvar sortNodesByHierarchy = /* @__PURE__ */ __name((graph) => sorter(graph, graph.children()), \"sortNodesByHierarchy\");\n\n// src/rendering-util/layout-algorithms/dagre/index.js\nvar recursiveRender = /* @__PURE__ */ __name(async (_elem, graph, diagramType, id, parentCluster, siteConfig) => {\n log.warn(\"Graph in recursive render:XAX\", graphlibJson2.write(graph), parentCluster);\n const dir = graph.graph().rankdir;\n log.trace(\"Dir in recursive render - dir:\", dir);\n const elem = _elem.insert(\"g\").attr(\"class\", \"root\");\n if (!graph.nodes()) {\n log.info(\"No nodes found for\", graph);\n } else {\n log.info(\"Recursive render XXX\", graph.nodes());\n }\n if (graph.edges().length > 0) {\n log.info(\"Recursive edges\", graph.edge(graph.edges()[0]));\n }\n const clusters = elem.insert(\"g\").attr(\"class\", \"clusters\");\n const edgePaths = elem.insert(\"g\").attr(\"class\", \"edgePaths\");\n const edgeLabels = elem.insert(\"g\").attr(\"class\", \"edgeLabels\");\n const nodes = elem.insert(\"g\").attr(\"class\", \"nodes\");\n await Promise.all(\n graph.nodes().map(async function(v) {\n const node = graph.node(v);\n if (parentCluster !== void 0) {\n const data = JSON.parse(JSON.stringify(parentCluster.clusterData));\n log.trace(\n \"Setting data for parent cluster XXX\\n Node.id = \",\n v,\n \"\\n data=\",\n data.height,\n \"\\nParent cluster\",\n parentCluster.height\n );\n graph.setNode(parentCluster.id, data);\n if (!graph.parent(v)) {\n log.trace(\"Setting parent\", v, parentCluster.id);\n graph.setParent(v, parentCluster.id, data);\n }\n }\n log.info(\"(Insert) Node XXX\" + v + \": \" + JSON.stringify(graph.node(v)));\n if (node?.clusterNode) {\n log.info(\"Cluster identified XBX\", v, node.width, graph.node(v));\n const { ranksep, nodesep } = graph.graph();\n node.graph.setGraph({\n ...node.graph.graph(),\n ranksep: ranksep + 25,\n nodesep\n });\n const o = await recursiveRender(\n nodes,\n node.graph,\n diagramType,\n id,\n graph.node(v),\n siteConfig\n );\n const newEl = o.elem;\n updateNodeBounds(node, newEl);\n node.diff = o.diff || 0;\n log.info(\n \"New compound node after recursive render XAX\",\n v,\n \"width\",\n // node,\n node.width,\n \"height\",\n node.height\n // node.x,\n // node.y\n );\n setNodeElem(newEl, node);\n } else {\n if (graph.children(v).length > 0) {\n log.trace(\n \"Cluster - the non recursive path XBX\",\n v,\n node.id,\n node,\n node.width,\n \"Graph:\",\n graph\n );\n log.trace(findNonClusterChild(node.id, graph));\n clusterDb.set(node.id, { id: findNonClusterChild(node.id, graph), node });\n } else {\n log.trace(\"Node - the non recursive path XAX\", v, nodes, graph.node(v), dir);\n await insertNode(nodes, graph.node(v), { config: siteConfig, dir });\n }\n }\n })\n );\n const processEdges = /* @__PURE__ */ __name(async () => {\n const edgePromises = graph.edges().map(async function(e) {\n const edge = graph.edge(e.v, e.w, e.name);\n log.info(\"Edge \" + e.v + \" -> \" + e.w + \": \" + JSON.stringify(e));\n log.info(\"Edge \" + e.v + \" -> \" + e.w + \": \", e, \" \", JSON.stringify(graph.edge(e)));\n log.info(\n \"Fix\",\n clusterDb,\n \"ids:\",\n e.v,\n e.w,\n \"Translating: \",\n clusterDb.get(e.v),\n clusterDb.get(e.w)\n );\n await insertEdgeLabel(edgeLabels, edge);\n });\n await Promise.all(edgePromises);\n }, \"processEdges\");\n await processEdges();\n log.info(\"Graph before layout:\", JSON.stringify(graphlibJson2.write(graph)));\n log.info(\"############################################# XXX\");\n log.info(\"### Layout ### XXX\");\n log.info(\"############################################# XXX\");\n dagreLayout(graph);\n log.info(\"Graph after layout:\", JSON.stringify(graphlibJson2.write(graph)));\n let diff = 0;\n let { subGraphTitleTotalMargin } = getSubGraphTitleMargins(siteConfig);\n await Promise.all(\n sortNodesByHierarchy(graph).map(async function(v) {\n const node = graph.node(v);\n log.info(\n \"Position XBX => \" + v + \": (\" + node.x,\n \",\" + node.y,\n \") width: \",\n node.width,\n \" height: \",\n node.height\n );\n if (node?.clusterNode) {\n node.y += subGraphTitleTotalMargin;\n log.info(\n \"A tainted cluster node XBX1\",\n v,\n node.id,\n node.width,\n node.height,\n node.x,\n node.y,\n graph.parent(v)\n );\n clusterDb.get(node.id).node = node;\n positionNode(node);\n } else {\n if (graph.children(v).length > 0) {\n log.info(\n \"A pure cluster node XBX1\",\n v,\n node.id,\n node.x,\n node.y,\n node.width,\n node.height,\n graph.parent(v)\n );\n node.height += subGraphTitleTotalMargin;\n graph.node(node.parentId);\n const halfPadding = node?.padding / 2 || 0;\n const labelHeight = node?.labelBBox?.height || 0;\n const offsetY = labelHeight - halfPadding || 0;\n log.debug(\"OffsetY\", offsetY, \"labelHeight\", labelHeight, \"halfPadding\", halfPadding);\n await insertCluster(clusters, node);\n clusterDb.get(node.id).node = node;\n } else {\n const parent = graph.node(node.parentId);\n node.y += subGraphTitleTotalMargin / 2;\n log.info(\n \"A regular node XBX1 - using the padding\",\n node.id,\n \"parent\",\n node.parentId,\n node.width,\n node.height,\n node.x,\n node.y,\n \"offsetY\",\n node.offsetY,\n \"parent\",\n parent,\n parent?.offsetY,\n node\n );\n positionNode(node);\n }\n }\n })\n );\n graph.edges().forEach(function(e) {\n const edge = graph.edge(e);\n log.info(\"Edge \" + e.v + \" -> \" + e.w + \": \" + JSON.stringify(edge), edge);\n edge.points.forEach((point) => point.y += subGraphTitleTotalMargin / 2);\n const startNode = graph.node(e.v);\n var endNode = graph.node(e.w);\n const paths = insertEdge(edgePaths, edge, clusterDb, diagramType, startNode, endNode, id);\n positionEdgeLabel(edge, paths);\n });\n graph.nodes().forEach(function(v) {\n const n = graph.node(v);\n log.info(v, n.type, n.diff);\n if (n.isGroup) {\n diff = n.diff;\n }\n });\n log.warn(\"Returning from recursive render XAX\", elem, diff);\n return { elem, diff };\n}, \"recursiveRender\");\nvar render = /* @__PURE__ */ __name(async (data4Layout, svg) => {\n const graph = new graphlib2.Graph({\n multigraph: true,\n compound: true\n }).setGraph({\n rankdir: data4Layout.direction,\n nodesep: data4Layout.config?.nodeSpacing || data4Layout.config?.flowchart?.nodeSpacing || data4Layout.nodeSpacing,\n ranksep: data4Layout.config?.rankSpacing || data4Layout.config?.flowchart?.rankSpacing || data4Layout.rankSpacing,\n marginx: 8,\n marginy: 8\n }).setDefaultEdgeLabel(function() {\n return {};\n });\n const element = svg.select(\"g\");\n markers_default(element, data4Layout.markers, data4Layout.type, data4Layout.diagramId);\n clear3();\n clear2();\n clear();\n clear4();\n data4Layout.nodes.forEach((node) => {\n graph.setNode(node.id, { ...node });\n if (node.parentId) {\n graph.setParent(node.id, node.parentId);\n }\n });\n log.debug(\"Edges:\", data4Layout.edges);\n data4Layout.edges.forEach((edge) => {\n if (edge.start === edge.end) {\n const nodeId = edge.start;\n const specialId1 = nodeId + \"---\" + nodeId + \"---1\";\n const specialId2 = nodeId + \"---\" + nodeId + \"---2\";\n const node = graph.node(nodeId);\n graph.setNode(specialId1, {\n domId: specialId1,\n id: specialId1,\n parentId: node.parentId,\n labelStyle: \"\",\n label: \"\",\n padding: 0,\n shape: \"labelRect\",\n // shape: 'rect',\n style: \"\",\n width: 10,\n height: 10\n });\n graph.setParent(specialId1, node.parentId);\n graph.setNode(specialId2, {\n domId: specialId2,\n id: specialId2,\n parentId: node.parentId,\n labelStyle: \"\",\n padding: 0,\n // shape: 'rect',\n shape: \"labelRect\",\n label: \"\",\n style: \"\",\n width: 10,\n height: 10\n });\n graph.setParent(specialId2, node.parentId);\n const edge1 = structuredClone(edge);\n const edgeMid = structuredClone(edge);\n const edge2 = structuredClone(edge);\n edge1.label = \"\";\n edge1.arrowTypeEnd = \"none\";\n edge1.id = nodeId + \"-cyclic-special-1\";\n edgeMid.arrowTypeEnd = \"none\";\n edgeMid.id = nodeId + \"-cyclic-special-mid\";\n edge2.label = \"\";\n if (node.isGroup) {\n edge1.fromCluster = nodeId;\n edge2.toCluster = nodeId;\n }\n edge2.id = nodeId + \"-cyclic-special-2\";\n graph.setEdge(nodeId, specialId1, edge1, nodeId + \"-cyclic-special-0\");\n graph.setEdge(specialId1, specialId2, edgeMid, nodeId + \"-cyclic-special-1\");\n graph.setEdge(specialId2, nodeId, edge2, nodeId + \"-cyc<lic-special-2\");\n } else {\n graph.setEdge(edge.start, edge.end, { ...edge }, edge.id);\n }\n });\n log.warn(\"Graph at first:\", JSON.stringify(graphlibJson2.write(graph)));\n adjustClustersAndEdges(graph);\n log.warn(\"Graph after XAX:\", JSON.stringify(graphlibJson2.write(graph)));\n const siteConfig = getConfig();\n await recursiveRender(\n element,\n graph,\n data4Layout.type,\n data4Layout.diagramId,\n void 0,\n siteConfig\n );\n}, \"render\");\nexport {\n render\n};\n"],"names":[],"sourceRoot":""}
|
package/dist/550.node.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"550.node.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAqC;AACrC;AACA;AACA;AACA;;AAEA;;AAEA,gBAAgB,SAAS;AACzB;AACA;;AAEO;AACP;AACA;AACA;AACA;;AAEA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,yDAAe,yDAAS;;AChCxB,4CAAe,cAAc,EAAE,UAAU,EAAE,eAAe,EAAE,gBAAgB,EAAE,UAAU,GAAG,yCAAyC;;ACArG;;AAE/B,SAAS,iBAAQ;AACjB,qCAAqC,KAAK;AAC1C;;AAEA,wDAAe,iBAAQ;;ACNc;;AAErC;AACA,OAAO,iBAAQ;AACf;AACA;;AAEA;AACA,kCAAkC;;AAElC;AACA;AACA;AACA,qBAAqB;;AAErB;AACA,qBAAqB;;AAErB;AACA,qBAAqB;;AAErB;AACA,qBAAqB;AACrB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qDAAe,KAAK;;AClC6B;AAClB;;AAE/B;AACA,2CAA2C;;AAE3C;;AAEA,kBAAkB,gBAAgB;AAClC;AACA;;AAEA;AACA;;AAEO;AACA;AACQ;AACf;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kBAAkB,cAAK;AACvB;;AAEA;AACA;AACA,MAAM;AACN;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,sBAAsB,QAAQ;AAC9B;AACA;;AAEA;AACA;;AAEA,WAAW,eAAe;AAC1B,IAAI;;;AAGJ;AACA,8BAA8B;AAC9B,IAAI,eAAe;;;AAGnB;AACA;AACA;AACA;;;;;ACjE4B;;AAE5B;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA,SAAS,oCAAiB;AAC1B;;AAEA,oDAAe,IAAI;;ACZQ;AACE;AAC7B,WAAW,GAAG,aAAa,aAAI;AAC/B,kDAAe,EAAE;;ACDa;AAcA;;AAE9B;AACA;AACA,0BAA0B,iCAAM;AAChC,sBAAsB,gBAAgB,KAAK;AAC3C;AACA,GAAG;AACH;AACA,2BAA2B,iCAAM;AACjC,KAAK;AACL,UAAU;AACV,gBAAgB,y0BAAy0B;AACz1B,kBAAkB,khBAAkhB;AACpiB;AACA,mCAAmC,iCAAM;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,cAAc,iBAAiB,IAAI,QAAQ,mBAAmB,MAAM,KAAK,2GAA2G,mBAAmB,WAAW,qBAAqB,oEAAoE,oDAAoD,uFAAuF,KAAK,aAAa,IAAI,aAAa,IAAI,aAAa,uEAAuE,0BAA0B,IAAI,8CAA8C,IAAI,0BAA0B,IAAI,kCAAkC,4IAA4I,aAAa,IAAI,aAAa,qBAAqB,8CAA8C,IAAI,qBAAqB,IAAI,aAAa,IAAI,aAAa,IAAI,qDAAqD,sCAAsC,+CAA+C,oBAAoB,aAAa,oBAAoB,0CAA0C,mDAAmD,aAAa,8GAA8G,8BAA8B,yEAAyE,8CAA8C,qBAAqB,iBAAiB,IAAI,aAAa;AAChlD,sBAAsB,0BAA0B;AAChD,gCAAgC,iCAAM;AACtC;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,KAAK;AACL,2BAA2B,iCAAM;AACjC;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,iCAAM;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,iCAAM;AACZ,iEAAiE;AACjE;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,kCAAkC,iCAAM;AACxC;AACA;AACA,UAAU;AACV;AACA;AACA,OAAO;AACP;AACA,gCAAgC,iCAAM;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,6BAA6B,iCAAM;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,6BAA6B,iCAAM;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,4BAA4B,iCAAM;AAClC;AACA;AACA,OAAO;AACP;AACA,8BAA8B,iCAAM;AACpC;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA,OAAO;AACP;AACA,4BAA4B,iCAAM;AAClC;AACA,OAAO;AACP;AACA,iCAAiC,iCAAM;AACvC;AACA;AACA,OAAO;AACP;AACA,qCAAqC,iCAAM;AAC3C;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,oCAAoC,iCAAM;AAC1C;AACA;AACA;AACA,OAAO;AACP;AACA,kCAAkC,iCAAM;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,4BAA4B,iCAAM;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA,gBAAgB;AAChB;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP;AACA,2BAA2B,iCAAM;AACjC;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,OAAO;AACP;AACA,6BAA6B,iCAAM;AACnC;AACA,OAAO;AACP;AACA,gCAAgC,iCAAM;AACtC;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,OAAO;AACP;AACA,qCAAqC,iCAAM;AAC3C;AACA;AACA,UAAU;AACV;AACA;AACA,OAAO;AACP,4DAA4D;AAC5D,gCAAgC,iCAAM;AACtC;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,OAAO;AACP;AACA,iCAAiC,iCAAM;AACvC;AACA,OAAO;AACP;AACA,sCAAsC,iCAAM;AAC5C;AACA,OAAO;AACP,iBAAiB,0BAA0B;AAC3C,qCAAqC,iCAAM;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,oIAAoI,gBAAgB,eAAe,2HAA2H,+KAA+K,oOAAoO,qEAAqE,0FAA0F,cAAc;AAC91B,oBAAoB,yBAAyB,qCAAqC,iBAAiB,kCAAkC,iBAAiB,kCAAkC,aAAa,mEAAmE,eAAe;AACvR;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,EAAE,iCAAM;AACR;AACA;AACA;AACA,CAAC;AACD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,iCAAM;AACtC;AACA,yBAAyB,uBAAuB;AAChD,IAAI,0BAAG;AACP,IAAI;AACJ;AACA,IAAI,0BAAG,oBAAoB,MAAM,eAAe,KAAK;AACrD;AACA;AACA,CAAC;AACD,kCAAkC,iCAAM;AACxC,oCAAoC,iCAAM;AAC1C;AACA;AACA,+BAA+B,QAAQ;AACvC;AACA,IAAI,0BAAG;AACP;AACA,CAAC;AACD,sCAAsC,iCAAM;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,0BAAG;AACL,CAAC;AACD,uCAAuC,iCAAM;AAC7C,6BAA6B,iCAAM;AACnC;AACA;AACA,EAAE,gCAAK;AACP,CAAC;AACD;AACA;AACA;AACA,6BAA6B,iCAAM,OAAO,qCAAS;AACnD;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,aAAa;AACb,mBAAmB;AACnB,mBAAmB;AACnB,iBAAiB;AACjB,iBAAiB;AACjB;;AAEA;AAC8D;AAChB;AACyB;;AAEvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,iCAAM;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACmC;AACnC;AACA;AACA;AACA,8BAA8B,iCAAM;AACpC;AACA;AACA;AACA;AACA,CAAC;AACD,qCAAqC,iCAAM;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,0BAA0B,yBAAyB,QAAQ,QAAQ;AACnE;AACA,0BAA0B,4CAAiB;AAC3C,4FAA4F,WAAW,yHAAyH,qCAAS;AACzO,4FAA4F,WAAW,yHAAyH,qCAAS;AACzO;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iGAAiG,WAAW,wHAAwH,qCAAS;AAC7O;AACA;AACA;AACA;AACA;AACA;AACA,iGAAiG,WAAW,4HAA4H,qCAAS;AACjP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gGAAgG,YAAY;AAC5G;AACA;AACA;AACA;AACA;AACA,gGAAgG,YAAY;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA,qGAAqG,YAAY;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,YAAY;AAC7F;AACA;AACA;AACA,KAAK;AACL,IAAI;AACJ;AACA;AACA;AACA;AACA,CAAC;AACD,mCAAmC,iCAAM;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oNAAoN,qCAAS;AAC7N,YAAY,2CAA2C;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA,CAAC;AACD,qCAAqC,iCAAM;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;AACD,kCAAkC,iCAAM;AACxC;AACA,CAAC;AACD,uCAAuC,iCAAM;AAC7C;AACA;AACA;AACA;AACA,QAAQ,iBAAiB;AACzB;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD;AACA,iDAAiD,iCAAM;AACvD;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,qBAAI;AAC3B;AACA,GAAG;AACH;AACA,GAAG,QAAQ,uBAAU;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0OAA0O,qCAAS;AACnP;AACA;AACA,IAAI;AACJ;AACA;AACA,sEAAsE,yBAAyB;AAC/F,KAAK;AACL;AACA;AACA;AACA,CAAC;AACD,2BAA2B,iCAAM;AACjC,SAAS,qCAAS;AAClB,EAAE,0BAAG;AACL,wBAAwB,qCAAS;AACjC;AACA;AACA,qBAAqB,uBAAM;AAC3B;AACA,6CAA6C,uBAAM,mDAAmD,uBAAM;AAC5G,kCAAkC,GAAG;AACrC;AACA;AACA,UAAU,qBAAc;AACxB;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA,EAAE,wBAAW;AACb;AACA;AACA;AACA,GAAG;AACH;AACA,EAAE,oCAAa;AACf;AACA;AACA;AACA,EAAE,2CAAgB;AAClB,yBAAyB,uBAAuB,EAAE,uBAAuB,EAAE,OAAO,EAAE,OAAO;AAC3F,CAAC;AACD;AACA;AACA;AACA,YAAY,sBAAsB,EAAE,6BAA6B,EAAE,WAAK;AACxE;AACA;AACA,IAAI;AACJ;AACA,iCAAM;AACN;AACA,6BAA6B,IAAI;AACjC;AACA,iCAAM;AACN;AACA;AACA;AACA;;AAEA;AACA,gCAAgC,iCAAM;AACtC;AACA,YAAY;AACZ,cAAc;AACd;;AAEA;AACA,YAAY;AACZ,cAAc;AACd;;AAEA;AACA,aAAa;AACb,cAAc;AACd;;AAEA;AACA,YAAY;AACZ;AACA,wBAAwB;AACxB;AACA;AACA;AACA;;AAEA;AACA,gBAAgB;AAChB;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA,cAAc,mBAAmB;AACjC;AACA;AACA;AACA;AACA,cAAc,mBAAmB;AACjC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAGE","sources":["webpack://@readme/markdown/./node_modules/mermaid/node_modules/uuid/dist/esm-node/stringify.js","webpack://@readme/markdown/./node_modules/mermaid/node_modules/uuid/dist/esm-node/regex.js","webpack://@readme/markdown/./node_modules/mermaid/node_modules/uuid/dist/esm-node/validate.js","webpack://@readme/markdown/./node_modules/mermaid/node_modules/uuid/dist/esm-node/parse.js","webpack://@readme/markdown/./node_modules/mermaid/node_modules/uuid/dist/esm-node/v35.js","webpack://@readme/markdown/./node_modules/mermaid/node_modules/uuid/dist/esm-node/sha1.js","webpack://@readme/markdown/./node_modules/mermaid/node_modules/uuid/dist/esm-node/v5.js","webpack://@readme/markdown/./node_modules/mermaid/dist/chunks/mermaid.core/erDiagram-DKC2X5TE.mjs"],"sourcesContent":["import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import validate from './validate.js';\n\nfunction parse(uuid) {\n if (!validate(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n let v;\n const arr = new Uint8Array(16); // Parse ########-....-....-....-............\n\n arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;\n arr[1] = v >>> 16 & 0xff;\n arr[2] = v >>> 8 & 0xff;\n arr[3] = v & 0xff; // Parse ........-####-....-....-............\n\n arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;\n arr[5] = v & 0xff; // Parse ........-....-####-....-............\n\n arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;\n arr[7] = v & 0xff; // Parse ........-....-....-####-............\n\n arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;\n arr[9] = v & 0xff; // Parse ........-....-....-....-############\n // (Use \"/\" to avoid 32-bit truncation when bit-shifting high-order bytes)\n\n arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;\n arr[11] = v / 0x100000000 & 0xff;\n arr[12] = v >>> 24 & 0xff;\n arr[13] = v >>> 16 & 0xff;\n arr[14] = v >>> 8 & 0xff;\n arr[15] = v & 0xff;\n return arr;\n}\n\nexport default parse;","import { unsafeStringify } from './stringify.js';\nimport parse from './parse.js';\n\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n\n const bytes = [];\n\n for (let i = 0; i < str.length; ++i) {\n bytes.push(str.charCodeAt(i));\n }\n\n return bytes;\n}\n\nexport const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nexport const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\nexport default function v35(name, version, hashfunc) {\n function generateUUID(value, namespace, buf, offset) {\n var _namespace;\n\n if (typeof value === 'string') {\n value = stringToBytes(value);\n }\n\n if (typeof namespace === 'string') {\n namespace = parse(namespace);\n }\n\n if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {\n throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');\n } // Compute hash of namespace and value, Per 4.3\n // Future: Use spread syntax when supported on all platforms, e.g. `bytes =\n // hashfunc([...namespace, ... value])`\n\n\n let bytes = new Uint8Array(16 + value.length);\n bytes.set(namespace);\n bytes.set(value, namespace.length);\n bytes = hashfunc(bytes);\n bytes[6] = bytes[6] & 0x0f | version;\n bytes[8] = bytes[8] & 0x3f | 0x80;\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = bytes[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(bytes);\n } // Function#name is not settable on some platforms (#270)\n\n\n try {\n generateUUID.name = name; // eslint-disable-next-line no-empty\n } catch (err) {} // For CommonJS default export support\n\n\n generateUUID.DNS = DNS;\n generateUUID.URL = URL;\n return generateUUID;\n}","import crypto from 'crypto';\n\nfunction sha1(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return crypto.createHash('sha1').update(bytes).digest();\n}\n\nexport default sha1;","import v35 from './v35.js';\nimport sha1 from './sha1.js';\nconst v5 = v35('v5', 0x50, sha1);\nexport default v5;","import {\n utils_default\n} from \"./chunk-TLUHKHBO.mjs\";\nimport {\n __name,\n clear,\n configureSvgSize,\n getAccDescription,\n getAccTitle,\n getConfig2 as getConfig,\n getDiagramTitle,\n log,\n parseGenericTypes,\n setAccDescription,\n setAccTitle,\n setDiagramTitle\n} from \"./chunk-S24QXQKS.mjs\";\n\n// src/diagrams/er/parser/erDiagram.jison\nvar parser = function() {\n var o = /* @__PURE__ */ __name(function(k, v, o2, l) {\n for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;\n return o2;\n }, \"o\"), $V0 = [6, 8, 10, 20, 22, 24, 26, 27, 28], $V1 = [1, 10], $V2 = [1, 11], $V3 = [1, 12], $V4 = [1, 13], $V5 = [1, 14], $V6 = [1, 15], $V7 = [1, 21], $V8 = [1, 22], $V9 = [1, 23], $Va = [1, 24], $Vb = [1, 25], $Vc = [6, 8, 10, 13, 15, 18, 19, 20, 22, 24, 26, 27, 28, 41, 42, 43, 44, 45], $Vd = [1, 34], $Ve = [27, 28, 46, 47], $Vf = [41, 42, 43, 44, 45], $Vg = [17, 34], $Vh = [1, 54], $Vi = [1, 53], $Vj = [17, 34, 36, 38];\n var parser2 = {\n trace: /* @__PURE__ */ __name(function trace() {\n }, \"trace\"),\n yy: {},\n symbols_: { \"error\": 2, \"start\": 3, \"ER_DIAGRAM\": 4, \"document\": 5, \"EOF\": 6, \"line\": 7, \"SPACE\": 8, \"statement\": 9, \"NEWLINE\": 10, \"entityName\": 11, \"relSpec\": 12, \":\": 13, \"role\": 14, \"BLOCK_START\": 15, \"attributes\": 16, \"BLOCK_STOP\": 17, \"SQS\": 18, \"SQE\": 19, \"title\": 20, \"title_value\": 21, \"acc_title\": 22, \"acc_title_value\": 23, \"acc_descr\": 24, \"acc_descr_value\": 25, \"acc_descr_multiline_value\": 26, \"ALPHANUM\": 27, \"ENTITY_NAME\": 28, \"attribute\": 29, \"attributeType\": 30, \"attributeName\": 31, \"attributeKeyTypeList\": 32, \"attributeComment\": 33, \"ATTRIBUTE_WORD\": 34, \"attributeKeyType\": 35, \"COMMA\": 36, \"ATTRIBUTE_KEY\": 37, \"COMMENT\": 38, \"cardinality\": 39, \"relType\": 40, \"ZERO_OR_ONE\": 41, \"ZERO_OR_MORE\": 42, \"ONE_OR_MORE\": 43, \"ONLY_ONE\": 44, \"MD_PARENT\": 45, \"NON_IDENTIFYING\": 46, \"IDENTIFYING\": 47, \"WORD\": 48, \"$accept\": 0, \"$end\": 1 },\n terminals_: { 2: \"error\", 4: \"ER_DIAGRAM\", 6: \"EOF\", 8: \"SPACE\", 10: \"NEWLINE\", 13: \":\", 15: \"BLOCK_START\", 17: \"BLOCK_STOP\", 18: \"SQS\", 19: \"SQE\", 20: \"title\", 21: \"title_value\", 22: \"acc_title\", 23: \"acc_title_value\", 24: \"acc_descr\", 25: \"acc_descr_value\", 26: \"acc_descr_multiline_value\", 27: \"ALPHANUM\", 28: \"ENTITY_NAME\", 34: \"ATTRIBUTE_WORD\", 36: \"COMMA\", 37: \"ATTRIBUTE_KEY\", 38: \"COMMENT\", 41: \"ZERO_OR_ONE\", 42: \"ZERO_OR_MORE\", 43: \"ONE_OR_MORE\", 44: \"ONLY_ONE\", 45: \"MD_PARENT\", 46: \"NON_IDENTIFYING\", 47: \"IDENTIFYING\", 48: \"WORD\" },\n productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [9, 5], [9, 4], [9, 3], [9, 1], [9, 7], [9, 6], [9, 4], [9, 2], [9, 2], [9, 2], [9, 1], [11, 1], [11, 1], [16, 1], [16, 2], [29, 2], [29, 3], [29, 3], [29, 4], [30, 1], [31, 1], [32, 1], [32, 3], [35, 1], [33, 1], [12, 3], [39, 1], [39, 1], [39, 1], [39, 1], [39, 1], [40, 1], [40, 1], [14, 1], [14, 1], [14, 1]],\n performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {\n var $0 = $$.length - 1;\n switch (yystate) {\n case 1:\n break;\n case 2:\n this.$ = [];\n break;\n case 3:\n $$[$0 - 1].push($$[$0]);\n this.$ = $$[$0 - 1];\n break;\n case 4:\n case 5:\n this.$ = $$[$0];\n break;\n case 6:\n case 7:\n this.$ = [];\n break;\n case 8:\n yy.addEntity($$[$0 - 4]);\n yy.addEntity($$[$0 - 2]);\n yy.addRelationship($$[$0 - 4], $$[$0], $$[$0 - 2], $$[$0 - 3]);\n break;\n case 9:\n yy.addEntity($$[$0 - 3]);\n yy.addAttributes($$[$0 - 3], $$[$0 - 1]);\n break;\n case 10:\n yy.addEntity($$[$0 - 2]);\n break;\n case 11:\n yy.addEntity($$[$0]);\n break;\n case 12:\n yy.addEntity($$[$0 - 6], $$[$0 - 4]);\n yy.addAttributes($$[$0 - 6], $$[$0 - 1]);\n break;\n case 13:\n yy.addEntity($$[$0 - 5], $$[$0 - 3]);\n break;\n case 14:\n yy.addEntity($$[$0 - 3], $$[$0 - 1]);\n break;\n case 15:\n case 16:\n this.$ = $$[$0].trim();\n yy.setAccTitle(this.$);\n break;\n case 17:\n case 18:\n this.$ = $$[$0].trim();\n yy.setAccDescription(this.$);\n break;\n case 19:\n case 43:\n this.$ = $$[$0];\n break;\n case 20:\n case 41:\n case 42:\n this.$ = $$[$0].replace(/\"/g, \"\");\n break;\n case 21:\n case 29:\n this.$ = [$$[$0]];\n break;\n case 22:\n $$[$0].push($$[$0 - 1]);\n this.$ = $$[$0];\n break;\n case 23:\n this.$ = { attributeType: $$[$0 - 1], attributeName: $$[$0] };\n break;\n case 24:\n this.$ = { attributeType: $$[$0 - 2], attributeName: $$[$0 - 1], attributeKeyTypeList: $$[$0] };\n break;\n case 25:\n this.$ = { attributeType: $$[$0 - 2], attributeName: $$[$0 - 1], attributeComment: $$[$0] };\n break;\n case 26:\n this.$ = { attributeType: $$[$0 - 3], attributeName: $$[$0 - 2], attributeKeyTypeList: $$[$0 - 1], attributeComment: $$[$0] };\n break;\n case 27:\n case 28:\n case 31:\n this.$ = $$[$0];\n break;\n case 30:\n $$[$0 - 2].push($$[$0]);\n this.$ = $$[$0 - 2];\n break;\n case 32:\n this.$ = $$[$0].replace(/\"/g, \"\");\n break;\n case 33:\n this.$ = { cardA: $$[$0], relType: $$[$0 - 1], cardB: $$[$0 - 2] };\n break;\n case 34:\n this.$ = yy.Cardinality.ZERO_OR_ONE;\n break;\n case 35:\n this.$ = yy.Cardinality.ZERO_OR_MORE;\n break;\n case 36:\n this.$ = yy.Cardinality.ONE_OR_MORE;\n break;\n case 37:\n this.$ = yy.Cardinality.ONLY_ONE;\n break;\n case 38:\n this.$ = yy.Cardinality.MD_PARENT;\n break;\n case 39:\n this.$ = yy.Identification.NON_IDENTIFYING;\n break;\n case 40:\n this.$ = yy.Identification.IDENTIFYING;\n break;\n }\n }, \"anonymous\"),\n table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o($V0, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: 9, 20: $V1, 22: $V2, 24: $V3, 26: $V4, 27: $V5, 28: $V6 }, o($V0, [2, 7], { 1: [2, 1] }), o($V0, [2, 3]), { 9: 16, 11: 9, 20: $V1, 22: $V2, 24: $V3, 26: $V4, 27: $V5, 28: $V6 }, o($V0, [2, 5]), o($V0, [2, 6]), o($V0, [2, 11], { 12: 17, 39: 20, 15: [1, 18], 18: [1, 19], 41: $V7, 42: $V8, 43: $V9, 44: $Va, 45: $Vb }), { 21: [1, 26] }, { 23: [1, 27] }, { 25: [1, 28] }, o($V0, [2, 18]), o($Vc, [2, 19]), o($Vc, [2, 20]), o($V0, [2, 4]), { 11: 29, 27: $V5, 28: $V6 }, { 16: 30, 17: [1, 31], 29: 32, 30: 33, 34: $Vd }, { 11: 35, 27: $V5, 28: $V6 }, { 40: 36, 46: [1, 37], 47: [1, 38] }, o($Ve, [2, 34]), o($Ve, [2, 35]), o($Ve, [2, 36]), o($Ve, [2, 37]), o($Ve, [2, 38]), o($V0, [2, 15]), o($V0, [2, 16]), o($V0, [2, 17]), { 13: [1, 39] }, { 17: [1, 40] }, o($V0, [2, 10]), { 16: 41, 17: [2, 21], 29: 32, 30: 33, 34: $Vd }, { 31: 42, 34: [1, 43] }, { 34: [2, 27] }, { 19: [1, 44] }, { 39: 45, 41: $V7, 42: $V8, 43: $V9, 44: $Va, 45: $Vb }, o($Vf, [2, 39]), o($Vf, [2, 40]), { 14: 46, 27: [1, 49], 28: [1, 48], 48: [1, 47] }, o($V0, [2, 9]), { 17: [2, 22] }, o($Vg, [2, 23], { 32: 50, 33: 51, 35: 52, 37: $Vh, 38: $Vi }), o([17, 34, 37, 38], [2, 28]), o($V0, [2, 14], { 15: [1, 55] }), o([27, 28], [2, 33]), o($V0, [2, 8]), o($V0, [2, 41]), o($V0, [2, 42]), o($V0, [2, 43]), o($Vg, [2, 24], { 33: 56, 36: [1, 57], 38: $Vi }), o($Vg, [2, 25]), o($Vj, [2, 29]), o($Vg, [2, 32]), o($Vj, [2, 31]), { 16: 58, 17: [1, 59], 29: 32, 30: 33, 34: $Vd }, o($Vg, [2, 26]), { 35: 60, 37: $Vh }, { 17: [1, 61] }, o($V0, [2, 13]), o($Vj, [2, 30]), o($V0, [2, 12])],\n defaultActions: { 34: [2, 27], 41: [2, 22] },\n parseError: /* @__PURE__ */ __name(function parseError(str, hash) {\n if (hash.recoverable) {\n this.trace(str);\n } else {\n var error = new Error(str);\n error.hash = hash;\n throw error;\n }\n }, \"parseError\"),\n parse: /* @__PURE__ */ __name(function parse(input) {\n var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = \"\", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;\n var args = lstack.slice.call(arguments, 1);\n var lexer2 = Object.create(this.lexer);\n var sharedState = { yy: {} };\n for (var k in this.yy) {\n if (Object.prototype.hasOwnProperty.call(this.yy, k)) {\n sharedState.yy[k] = this.yy[k];\n }\n }\n lexer2.setInput(input, sharedState.yy);\n sharedState.yy.lexer = lexer2;\n sharedState.yy.parser = this;\n if (typeof lexer2.yylloc == \"undefined\") {\n lexer2.yylloc = {};\n }\n var yyloc = lexer2.yylloc;\n lstack.push(yyloc);\n var ranges = lexer2.options && lexer2.options.ranges;\n if (typeof sharedState.yy.parseError === \"function\") {\n this.parseError = sharedState.yy.parseError;\n } else {\n this.parseError = Object.getPrototypeOf(this).parseError;\n }\n function popStack(n) {\n stack.length = stack.length - 2 * n;\n vstack.length = vstack.length - n;\n lstack.length = lstack.length - n;\n }\n __name(popStack, \"popStack\");\n function lex() {\n var token;\n token = tstack.pop() || lexer2.lex() || EOF;\n if (typeof token !== \"number\") {\n if (token instanceof Array) {\n tstack = token;\n token = tstack.pop();\n }\n token = self.symbols_[token] || token;\n }\n return token;\n }\n __name(lex, \"lex\");\n var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;\n while (true) {\n state = stack[stack.length - 1];\n if (this.defaultActions[state]) {\n action = this.defaultActions[state];\n } else {\n if (symbol === null || typeof symbol == \"undefined\") {\n symbol = lex();\n }\n action = table[state] && table[state][symbol];\n }\n if (typeof action === \"undefined\" || !action.length || !action[0]) {\n var errStr = \"\";\n expected = [];\n for (p in table[state]) {\n if (this.terminals_[p] && p > TERROR) {\n expected.push(\"'\" + this.terminals_[p] + \"'\");\n }\n }\n if (lexer2.showPosition) {\n errStr = \"Parse error on line \" + (yylineno + 1) + \":\\n\" + lexer2.showPosition() + \"\\nExpecting \" + expected.join(\", \") + \", got '\" + (this.terminals_[symbol] || symbol) + \"'\";\n } else {\n errStr = \"Parse error on line \" + (yylineno + 1) + \": Unexpected \" + (symbol == EOF ? \"end of input\" : \"'\" + (this.terminals_[symbol] || symbol) + \"'\");\n }\n this.parseError(errStr, {\n text: lexer2.match,\n token: this.terminals_[symbol] || symbol,\n line: lexer2.yylineno,\n loc: yyloc,\n expected\n });\n }\n if (action[0] instanceof Array && action.length > 1) {\n throw new Error(\"Parse Error: multiple actions possible at state: \" + state + \", token: \" + symbol);\n }\n switch (action[0]) {\n case 1:\n stack.push(symbol);\n vstack.push(lexer2.yytext);\n lstack.push(lexer2.yylloc);\n stack.push(action[1]);\n symbol = null;\n if (!preErrorSymbol) {\n yyleng = lexer2.yyleng;\n yytext = lexer2.yytext;\n yylineno = lexer2.yylineno;\n yyloc = lexer2.yylloc;\n if (recovering > 0) {\n recovering--;\n }\n } else {\n symbol = preErrorSymbol;\n preErrorSymbol = null;\n }\n break;\n case 2:\n len = this.productions_[action[1]][1];\n yyval.$ = vstack[vstack.length - len];\n yyval._$ = {\n first_line: lstack[lstack.length - (len || 1)].first_line,\n last_line: lstack[lstack.length - 1].last_line,\n first_column: lstack[lstack.length - (len || 1)].first_column,\n last_column: lstack[lstack.length - 1].last_column\n };\n if (ranges) {\n yyval._$.range = [\n lstack[lstack.length - (len || 1)].range[0],\n lstack[lstack.length - 1].range[1]\n ];\n }\n r = this.performAction.apply(yyval, [\n yytext,\n yyleng,\n yylineno,\n sharedState.yy,\n action[1],\n vstack,\n lstack\n ].concat(args));\n if (typeof r !== \"undefined\") {\n return r;\n }\n if (len) {\n stack = stack.slice(0, -1 * len * 2);\n vstack = vstack.slice(0, -1 * len);\n lstack = lstack.slice(0, -1 * len);\n }\n stack.push(this.productions_[action[1]][0]);\n vstack.push(yyval.$);\n lstack.push(yyval._$);\n newState = table[stack[stack.length - 2]][stack[stack.length - 1]];\n stack.push(newState);\n break;\n case 3:\n return true;\n }\n }\n return true;\n }, \"parse\")\n };\n var lexer = /* @__PURE__ */ function() {\n var lexer2 = {\n EOF: 1,\n parseError: /* @__PURE__ */ __name(function parseError(str, hash) {\n if (this.yy.parser) {\n this.yy.parser.parseError(str, hash);\n } else {\n throw new Error(str);\n }\n }, \"parseError\"),\n // resets the lexer, sets new input\n setInput: /* @__PURE__ */ __name(function(input, yy) {\n this.yy = yy || this.yy || {};\n this._input = input;\n this._more = this._backtrack = this.done = false;\n this.yylineno = this.yyleng = 0;\n this.yytext = this.matched = this.match = \"\";\n this.conditionStack = [\"INITIAL\"];\n this.yylloc = {\n first_line: 1,\n first_column: 0,\n last_line: 1,\n last_column: 0\n };\n if (this.options.ranges) {\n this.yylloc.range = [0, 0];\n }\n this.offset = 0;\n return this;\n }, \"setInput\"),\n // consumes and returns one char from the input\n input: /* @__PURE__ */ __name(function() {\n var ch = this._input[0];\n this.yytext += ch;\n this.yyleng++;\n this.offset++;\n this.match += ch;\n this.matched += ch;\n var lines = ch.match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno++;\n this.yylloc.last_line++;\n } else {\n this.yylloc.last_column++;\n }\n if (this.options.ranges) {\n this.yylloc.range[1]++;\n }\n this._input = this._input.slice(1);\n return ch;\n }, \"input\"),\n // unshifts one char (or a string) into the input\n unput: /* @__PURE__ */ __name(function(ch) {\n var len = ch.length;\n var lines = ch.split(/(?:\\r\\n?|\\n)/g);\n this._input = ch + this._input;\n this.yytext = this.yytext.substr(0, this.yytext.length - len);\n this.offset -= len;\n var oldLines = this.match.split(/(?:\\r\\n?|\\n)/g);\n this.match = this.match.substr(0, this.match.length - 1);\n this.matched = this.matched.substr(0, this.matched.length - 1);\n if (lines.length - 1) {\n this.yylineno -= lines.length - 1;\n }\n var r = this.yylloc.range;\n this.yylloc = {\n first_line: this.yylloc.first_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.first_column,\n last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len\n };\n if (this.options.ranges) {\n this.yylloc.range = [r[0], r[0] + this.yyleng - len];\n }\n this.yyleng = this.yytext.length;\n return this;\n }, \"unput\"),\n // When called from action, caches matched text and appends it on next action\n more: /* @__PURE__ */ __name(function() {\n this._more = true;\n return this;\n }, \"more\"),\n // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.\n reject: /* @__PURE__ */ __name(function() {\n if (this.options.backtrack_lexer) {\n this._backtrack = true;\n } else {\n return this.parseError(\"Lexical error on line \" + (this.yylineno + 1) + \". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n\" + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n return this;\n }, \"reject\"),\n // retain first n characters of the match\n less: /* @__PURE__ */ __name(function(n) {\n this.unput(this.match.slice(n));\n }, \"less\"),\n // displays already matched input, i.e. for error messages\n pastInput: /* @__PURE__ */ __name(function() {\n var past = this.matched.substr(0, this.matched.length - this.match.length);\n return (past.length > 20 ? \"...\" : \"\") + past.substr(-20).replace(/\\n/g, \"\");\n }, \"pastInput\"),\n // displays upcoming input, i.e. for error messages\n upcomingInput: /* @__PURE__ */ __name(function() {\n var next = this.match;\n if (next.length < 20) {\n next += this._input.substr(0, 20 - next.length);\n }\n return (next.substr(0, 20) + (next.length > 20 ? \"...\" : \"\")).replace(/\\n/g, \"\");\n }, \"upcomingInput\"),\n // displays the character position where the lexing error occurred, i.e. for error messages\n showPosition: /* @__PURE__ */ __name(function() {\n var pre = this.pastInput();\n var c = new Array(pre.length + 1).join(\"-\");\n return pre + this.upcomingInput() + \"\\n\" + c + \"^\";\n }, \"showPosition\"),\n // test the lexed token: return FALSE when not a match, otherwise return token\n test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {\n var token, lines, backup;\n if (this.options.backtrack_lexer) {\n backup = {\n yylineno: this.yylineno,\n yylloc: {\n first_line: this.yylloc.first_line,\n last_line: this.last_line,\n first_column: this.yylloc.first_column,\n last_column: this.yylloc.last_column\n },\n yytext: this.yytext,\n match: this.match,\n matches: this.matches,\n matched: this.matched,\n yyleng: this.yyleng,\n offset: this.offset,\n _more: this._more,\n _input: this._input,\n yy: this.yy,\n conditionStack: this.conditionStack.slice(0),\n done: this.done\n };\n if (this.options.ranges) {\n backup.yylloc.range = this.yylloc.range.slice(0);\n }\n }\n lines = match[0].match(/(?:\\r\\n?|\\n).*/g);\n if (lines) {\n this.yylineno += lines.length;\n }\n this.yylloc = {\n first_line: this.yylloc.last_line,\n last_line: this.yylineno + 1,\n first_column: this.yylloc.last_column,\n last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\\r?\\n?/)[0].length : this.yylloc.last_column + match[0].length\n };\n this.yytext += match[0];\n this.match += match[0];\n this.matches = match;\n this.yyleng = this.yytext.length;\n if (this.options.ranges) {\n this.yylloc.range = [this.offset, this.offset += this.yyleng];\n }\n this._more = false;\n this._backtrack = false;\n this._input = this._input.slice(match[0].length);\n this.matched += match[0];\n token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);\n if (this.done && this._input) {\n this.done = false;\n }\n if (token) {\n return token;\n } else if (this._backtrack) {\n for (var k in backup) {\n this[k] = backup[k];\n }\n return false;\n }\n return false;\n }, \"test_match\"),\n // return next match in input\n next: /* @__PURE__ */ __name(function() {\n if (this.done) {\n return this.EOF;\n }\n if (!this._input) {\n this.done = true;\n }\n var token, match, tempMatch, index;\n if (!this._more) {\n this.yytext = \"\";\n this.match = \"\";\n }\n var rules = this._currentRules();\n for (var i = 0; i < rules.length; i++) {\n tempMatch = this._input.match(this.rules[rules[i]]);\n if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {\n match = tempMatch;\n index = i;\n if (this.options.backtrack_lexer) {\n token = this.test_match(tempMatch, rules[i]);\n if (token !== false) {\n return token;\n } else if (this._backtrack) {\n match = false;\n continue;\n } else {\n return false;\n }\n } else if (!this.options.flex) {\n break;\n }\n }\n }\n if (match) {\n token = this.test_match(match, rules[index]);\n if (token !== false) {\n return token;\n }\n return false;\n }\n if (this._input === \"\") {\n return this.EOF;\n } else {\n return this.parseError(\"Lexical error on line \" + (this.yylineno + 1) + \". Unrecognized text.\\n\" + this.showPosition(), {\n text: \"\",\n token: null,\n line: this.yylineno\n });\n }\n }, \"next\"),\n // return next match that has a token\n lex: /* @__PURE__ */ __name(function lex() {\n var r = this.next();\n if (r) {\n return r;\n } else {\n return this.lex();\n }\n }, \"lex\"),\n // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)\n begin: /* @__PURE__ */ __name(function begin(condition) {\n this.conditionStack.push(condition);\n }, \"begin\"),\n // pop the previously active lexer condition state off the condition stack\n popState: /* @__PURE__ */ __name(function popState() {\n var n = this.conditionStack.length - 1;\n if (n > 0) {\n return this.conditionStack.pop();\n } else {\n return this.conditionStack[0];\n }\n }, \"popState\"),\n // produce the lexer rule set which is active for the currently active lexer condition state\n _currentRules: /* @__PURE__ */ __name(function _currentRules() {\n if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {\n return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;\n } else {\n return this.conditions[\"INITIAL\"].rules;\n }\n }, \"_currentRules\"),\n // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available\n topState: /* @__PURE__ */ __name(function topState(n) {\n n = this.conditionStack.length - 1 - Math.abs(n || 0);\n if (n >= 0) {\n return this.conditionStack[n];\n } else {\n return \"INITIAL\";\n }\n }, \"topState\"),\n // alias for begin(condition)\n pushState: /* @__PURE__ */ __name(function pushState(condition) {\n this.begin(condition);\n }, \"pushState\"),\n // return the number of states currently on the stack\n stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {\n return this.conditionStack.length;\n }, \"stateStackSize\"),\n options: { \"case-insensitive\": true },\n performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {\n var YYSTATE = YY_START;\n switch ($avoiding_name_collisions) {\n case 0:\n this.begin(\"acc_title\");\n return 22;\n break;\n case 1:\n this.popState();\n return \"acc_title_value\";\n break;\n case 2:\n this.begin(\"acc_descr\");\n return 24;\n break;\n case 3:\n this.popState();\n return \"acc_descr_value\";\n break;\n case 4:\n this.begin(\"acc_descr_multiline\");\n break;\n case 5:\n this.popState();\n break;\n case 6:\n return \"acc_descr_multiline_value\";\n break;\n case 7:\n return 10;\n break;\n case 8:\n break;\n case 9:\n return 8;\n break;\n case 10:\n return 28;\n break;\n case 11:\n return 48;\n break;\n case 12:\n return 4;\n break;\n case 13:\n this.begin(\"block\");\n return 15;\n break;\n case 14:\n return 36;\n break;\n case 15:\n break;\n case 16:\n return 37;\n break;\n case 17:\n return 34;\n break;\n case 18:\n return 34;\n break;\n case 19:\n return 38;\n break;\n case 20:\n break;\n case 21:\n this.popState();\n return 17;\n break;\n case 22:\n return yy_.yytext[0];\n break;\n case 23:\n return 18;\n break;\n case 24:\n return 19;\n break;\n case 25:\n return 41;\n break;\n case 26:\n return 43;\n break;\n case 27:\n return 43;\n break;\n case 28:\n return 43;\n break;\n case 29:\n return 41;\n break;\n case 30:\n return 41;\n break;\n case 31:\n return 42;\n break;\n case 32:\n return 42;\n break;\n case 33:\n return 42;\n break;\n case 34:\n return 42;\n break;\n case 35:\n return 42;\n break;\n case 36:\n return 43;\n break;\n case 37:\n return 42;\n break;\n case 38:\n return 43;\n break;\n case 39:\n return 44;\n break;\n case 40:\n return 44;\n break;\n case 41:\n return 44;\n break;\n case 42:\n return 44;\n break;\n case 43:\n return 41;\n break;\n case 44:\n return 42;\n break;\n case 45:\n return 43;\n break;\n case 46:\n return 45;\n break;\n case 47:\n return 46;\n break;\n case 48:\n return 47;\n break;\n case 49:\n return 47;\n break;\n case 50:\n return 46;\n break;\n case 51:\n return 46;\n break;\n case 52:\n return 46;\n break;\n case 53:\n return 27;\n break;\n case 54:\n return yy_.yytext[0];\n break;\n case 55:\n return 6;\n break;\n }\n }, \"anonymous\"),\n rules: [/^(?:accTitle\\s*:\\s*)/i, /^(?:(?!\\n||)*[^\\n]*)/i, /^(?:accDescr\\s*:\\s*)/i, /^(?:(?!\\n||)*[^\\n]*)/i, /^(?:accDescr\\s*\\{\\s*)/i, /^(?:[\\}])/i, /^(?:[^\\}]*)/i, /^(?:[\\n]+)/i, /^(?:\\s+)/i, /^(?:[\\s]+)/i, /^(?:\"[^\"%\\r\\n\\v\\b\\\\]+\")/i, /^(?:\"[^\"]*\")/i, /^(?:erDiagram\\b)/i, /^(?:\\{)/i, /^(?:,)/i, /^(?:\\s+)/i, /^(?:\\b((?:PK)|(?:FK)|(?:UK))\\b)/i, /^(?:(.*?)[~](.*?)*[~])/i, /^(?:[\\*A-Za-z_][A-Za-z0-9\\-_\\[\\]\\(\\)]*)/i, /^(?:\"[^\"]*\")/i, /^(?:[\\n]+)/i, /^(?:\\})/i, /^(?:.)/i, /^(?:\\[)/i, /^(?:\\])/i, /^(?:one or zero\\b)/i, /^(?:one or more\\b)/i, /^(?:one or many\\b)/i, /^(?:1\\+)/i, /^(?:\\|o\\b)/i, /^(?:zero or one\\b)/i, /^(?:zero or more\\b)/i, /^(?:zero or many\\b)/i, /^(?:0\\+)/i, /^(?:\\}o\\b)/i, /^(?:many\\(0\\))/i, /^(?:many\\(1\\))/i, /^(?:many\\b)/i, /^(?:\\}\\|)/i, /^(?:one\\b)/i, /^(?:only one\\b)/i, /^(?:1\\b)/i, /^(?:\\|\\|)/i, /^(?:o\\|)/i, /^(?:o\\{)/i, /^(?:\\|\\{)/i, /^(?:\\s*u\\b)/i, /^(?:\\.\\.)/i, /^(?:--)/i, /^(?:to\\b)/i, /^(?:optionally to\\b)/i, /^(?:\\.-)/i, /^(?:-\\.)/i, /^(?:[A-Za-z_][A-Za-z0-9\\-_]*)/i, /^(?:.)/i, /^(?:$)/i],\n conditions: { \"acc_descr_multiline\": { \"rules\": [5, 6], \"inclusive\": false }, \"acc_descr\": { \"rules\": [3], \"inclusive\": false }, \"acc_title\": { \"rules\": [1], \"inclusive\": false }, \"block\": { \"rules\": [14, 15, 16, 17, 18, 19, 20, 21, 22], \"inclusive\": false }, \"INITIAL\": { \"rules\": [0, 2, 4, 7, 8, 9, 10, 11, 12, 13, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55], \"inclusive\": true } }\n };\n return lexer2;\n }();\n parser2.lexer = lexer;\n function Parser() {\n this.yy = {};\n }\n __name(Parser, \"Parser\");\n Parser.prototype = parser2;\n parser2.Parser = Parser;\n return new Parser();\n}();\nparser.parser = parser;\nvar erDiagram_default = parser;\n\n// src/diagrams/er/erDb.js\nvar entities = /* @__PURE__ */ new Map();\nvar relationships = [];\nvar Cardinality = {\n ZERO_OR_ONE: \"ZERO_OR_ONE\",\n ZERO_OR_MORE: \"ZERO_OR_MORE\",\n ONE_OR_MORE: \"ONE_OR_MORE\",\n ONLY_ONE: \"ONLY_ONE\",\n MD_PARENT: \"MD_PARENT\"\n};\nvar Identification = {\n NON_IDENTIFYING: \"NON_IDENTIFYING\",\n IDENTIFYING: \"IDENTIFYING\"\n};\nvar addEntity = /* @__PURE__ */ __name(function(name, alias = void 0) {\n if (!entities.has(name)) {\n entities.set(name, { attributes: [], alias });\n log.info(\"Added new entity :\", name);\n } else if (!entities.get(name).alias && alias) {\n entities.get(name).alias = alias;\n log.info(`Add alias '${alias}' to entity '${name}'`);\n }\n return entities.get(name);\n}, \"addEntity\");\nvar getEntities = /* @__PURE__ */ __name(() => entities, \"getEntities\");\nvar addAttributes = /* @__PURE__ */ __name(function(entityName, attribs) {\n let entity = addEntity(entityName);\n let i;\n for (i = attribs.length - 1; i >= 0; i--) {\n entity.attributes.push(attribs[i]);\n log.debug(\"Added attribute \", attribs[i].attributeName);\n }\n}, \"addAttributes\");\nvar addRelationship = /* @__PURE__ */ __name(function(entA, rolA, entB, rSpec) {\n let rel = {\n entityA: entA,\n roleA: rolA,\n entityB: entB,\n relSpec: rSpec\n };\n relationships.push(rel);\n log.debug(\"Added new relationship :\", rel);\n}, \"addRelationship\");\nvar getRelationships = /* @__PURE__ */ __name(() => relationships, \"getRelationships\");\nvar clear2 = /* @__PURE__ */ __name(function() {\n entities = /* @__PURE__ */ new Map();\n relationships = [];\n clear();\n}, \"clear\");\nvar erDb_default = {\n Cardinality,\n Identification,\n getConfig: /* @__PURE__ */ __name(() => getConfig().er, \"getConfig\"),\n addEntity,\n addAttributes,\n getEntities,\n addRelationship,\n getRelationships,\n clear: clear2,\n setAccTitle,\n getAccTitle,\n setAccDescription,\n getAccDescription,\n setDiagramTitle,\n getDiagramTitle\n};\n\n// src/diagrams/er/erRenderer.js\nimport * as graphlib from \"dagre-d3-es/src/graphlib/index.js\";\nimport { line, curveBasis, select } from \"d3\";\nimport { layout as dagreLayout } from \"dagre-d3-es/src/dagre/index.js\";\n\n// src/diagrams/er/erMarkers.js\nvar ERMarkers = {\n ONLY_ONE_START: \"ONLY_ONE_START\",\n ONLY_ONE_END: \"ONLY_ONE_END\",\n ZERO_OR_ONE_START: \"ZERO_OR_ONE_START\",\n ZERO_OR_ONE_END: \"ZERO_OR_ONE_END\",\n ONE_OR_MORE_START: \"ONE_OR_MORE_START\",\n ONE_OR_MORE_END: \"ONE_OR_MORE_END\",\n ZERO_OR_MORE_START: \"ZERO_OR_MORE_START\",\n ZERO_OR_MORE_END: \"ZERO_OR_MORE_END\",\n MD_PARENT_END: \"MD_PARENT_END\",\n MD_PARENT_START: \"MD_PARENT_START\"\n};\nvar insertMarkers = /* @__PURE__ */ __name(function(elem, conf2) {\n let marker;\n elem.append(\"defs\").append(\"marker\").attr(\"id\", ERMarkers.MD_PARENT_START).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\");\n elem.append(\"defs\").append(\"marker\").attr(\"id\", ERMarkers.MD_PARENT_END).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\");\n elem.append(\"defs\").append(\"marker\").attr(\"id\", ERMarkers.ONLY_ONE_START).attr(\"refX\", 0).attr(\"refY\", 9).attr(\"markerWidth\", 18).attr(\"markerHeight\", 18).attr(\"orient\", \"auto\").append(\"path\").attr(\"stroke\", conf2.stroke).attr(\"fill\", \"none\").attr(\"d\", \"M9,0 L9,18 M15,0 L15,18\");\n elem.append(\"defs\").append(\"marker\").attr(\"id\", ERMarkers.ONLY_ONE_END).attr(\"refX\", 18).attr(\"refY\", 9).attr(\"markerWidth\", 18).attr(\"markerHeight\", 18).attr(\"orient\", \"auto\").append(\"path\").attr(\"stroke\", conf2.stroke).attr(\"fill\", \"none\").attr(\"d\", \"M3,0 L3,18 M9,0 L9,18\");\n marker = elem.append(\"defs\").append(\"marker\").attr(\"id\", ERMarkers.ZERO_OR_ONE_START).attr(\"refX\", 0).attr(\"refY\", 9).attr(\"markerWidth\", 30).attr(\"markerHeight\", 18).attr(\"orient\", \"auto\");\n marker.append(\"circle\").attr(\"stroke\", conf2.stroke).attr(\"fill\", \"white\").attr(\"cx\", 21).attr(\"cy\", 9).attr(\"r\", 6);\n marker.append(\"path\").attr(\"stroke\", conf2.stroke).attr(\"fill\", \"none\").attr(\"d\", \"M9,0 L9,18\");\n marker = elem.append(\"defs\").append(\"marker\").attr(\"id\", ERMarkers.ZERO_OR_ONE_END).attr(\"refX\", 30).attr(\"refY\", 9).attr(\"markerWidth\", 30).attr(\"markerHeight\", 18).attr(\"orient\", \"auto\");\n marker.append(\"circle\").attr(\"stroke\", conf2.stroke).attr(\"fill\", \"white\").attr(\"cx\", 9).attr(\"cy\", 9).attr(\"r\", 6);\n marker.append(\"path\").attr(\"stroke\", conf2.stroke).attr(\"fill\", \"none\").attr(\"d\", \"M21,0 L21,18\");\n elem.append(\"defs\").append(\"marker\").attr(\"id\", ERMarkers.ONE_OR_MORE_START).attr(\"refX\", 18).attr(\"refY\", 18).attr(\"markerWidth\", 45).attr(\"markerHeight\", 36).attr(\"orient\", \"auto\").append(\"path\").attr(\"stroke\", conf2.stroke).attr(\"fill\", \"none\").attr(\"d\", \"M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27\");\n elem.append(\"defs\").append(\"marker\").attr(\"id\", ERMarkers.ONE_OR_MORE_END).attr(\"refX\", 27).attr(\"refY\", 18).attr(\"markerWidth\", 45).attr(\"markerHeight\", 36).attr(\"orient\", \"auto\").append(\"path\").attr(\"stroke\", conf2.stroke).attr(\"fill\", \"none\").attr(\"d\", \"M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18\");\n marker = elem.append(\"defs\").append(\"marker\").attr(\"id\", ERMarkers.ZERO_OR_MORE_START).attr(\"refX\", 18).attr(\"refY\", 18).attr(\"markerWidth\", 57).attr(\"markerHeight\", 36).attr(\"orient\", \"auto\");\n marker.append(\"circle\").attr(\"stroke\", conf2.stroke).attr(\"fill\", \"white\").attr(\"cx\", 48).attr(\"cy\", 18).attr(\"r\", 6);\n marker.append(\"path\").attr(\"stroke\", conf2.stroke).attr(\"fill\", \"none\").attr(\"d\", \"M0,18 Q18,0 36,18 Q18,36 0,18\");\n marker = elem.append(\"defs\").append(\"marker\").attr(\"id\", ERMarkers.ZERO_OR_MORE_END).attr(\"refX\", 39).attr(\"refY\", 18).attr(\"markerWidth\", 57).attr(\"markerHeight\", 36).attr(\"orient\", \"auto\");\n marker.append(\"circle\").attr(\"stroke\", conf2.stroke).attr(\"fill\", \"white\").attr(\"cx\", 9).attr(\"cy\", 18).attr(\"r\", 6);\n marker.append(\"path\").attr(\"stroke\", conf2.stroke).attr(\"fill\", \"none\").attr(\"d\", \"M21,18 Q39,0 57,18 Q39,36 21,18\");\n return;\n}, \"insertMarkers\");\nvar erMarkers_default = {\n ERMarkers,\n insertMarkers\n};\n\n// src/diagrams/er/erRenderer.js\nimport { v5 as uuid5 } from \"uuid\";\nvar BAD_ID_CHARS_REGEXP = /[^\\dA-Za-z](\\W)*/g;\nvar conf = {};\nvar entityNameIds = /* @__PURE__ */ new Map();\nvar setConf = /* @__PURE__ */ __name(function(cnf) {\n const keys = Object.keys(cnf);\n for (const key of keys) {\n conf[key] = cnf[key];\n }\n}, \"setConf\");\nvar drawAttributes = /* @__PURE__ */ __name((groupNode, entityTextNode, attributes) => {\n const heightPadding = conf.entityPadding / 3;\n const widthPadding = conf.entityPadding / 3;\n const attrFontSize = conf.fontSize * 0.85;\n const labelBBox = entityTextNode.node().getBBox();\n const attributeNodes = [];\n let hasKeyType = false;\n let hasComment = false;\n let maxTypeWidth = 0;\n let maxNameWidth = 0;\n let maxKeyWidth = 0;\n let maxCommentWidth = 0;\n let cumulativeHeight = labelBBox.height + heightPadding * 2;\n let attrNum = 1;\n attributes.forEach((item) => {\n if (item.attributeKeyTypeList !== void 0 && item.attributeKeyTypeList.length > 0) {\n hasKeyType = true;\n }\n if (item.attributeComment !== void 0) {\n hasComment = true;\n }\n });\n attributes.forEach((item) => {\n const attrPrefix = `${entityTextNode.node().id}-attr-${attrNum}`;\n let nodeHeight = 0;\n const attributeType = parseGenericTypes(item.attributeType);\n const typeNode = groupNode.append(\"text\").classed(\"er entityLabel\", true).attr(\"id\", `${attrPrefix}-type`).attr(\"x\", 0).attr(\"y\", 0).style(\"dominant-baseline\", \"middle\").style(\"text-anchor\", \"left\").style(\"font-family\", getConfig().fontFamily).style(\"font-size\", attrFontSize + \"px\").text(attributeType);\n const nameNode = groupNode.append(\"text\").classed(\"er entityLabel\", true).attr(\"id\", `${attrPrefix}-name`).attr(\"x\", 0).attr(\"y\", 0).style(\"dominant-baseline\", \"middle\").style(\"text-anchor\", \"left\").style(\"font-family\", getConfig().fontFamily).style(\"font-size\", attrFontSize + \"px\").text(item.attributeName);\n const attributeNode = {};\n attributeNode.tn = typeNode;\n attributeNode.nn = nameNode;\n const typeBBox = typeNode.node().getBBox();\n const nameBBox = nameNode.node().getBBox();\n maxTypeWidth = Math.max(maxTypeWidth, typeBBox.width);\n maxNameWidth = Math.max(maxNameWidth, nameBBox.width);\n nodeHeight = Math.max(typeBBox.height, nameBBox.height);\n if (hasKeyType) {\n const keyTypeNodeText = item.attributeKeyTypeList !== void 0 ? item.attributeKeyTypeList.join(\",\") : \"\";\n const keyTypeNode = groupNode.append(\"text\").classed(\"er entityLabel\", true).attr(\"id\", `${attrPrefix}-key`).attr(\"x\", 0).attr(\"y\", 0).style(\"dominant-baseline\", \"middle\").style(\"text-anchor\", \"left\").style(\"font-family\", getConfig().fontFamily).style(\"font-size\", attrFontSize + \"px\").text(keyTypeNodeText);\n attributeNode.kn = keyTypeNode;\n const keyTypeBBox = keyTypeNode.node().getBBox();\n maxKeyWidth = Math.max(maxKeyWidth, keyTypeBBox.width);\n nodeHeight = Math.max(nodeHeight, keyTypeBBox.height);\n }\n if (hasComment) {\n const commentNode = groupNode.append(\"text\").classed(\"er entityLabel\", true).attr(\"id\", `${attrPrefix}-comment`).attr(\"x\", 0).attr(\"y\", 0).style(\"dominant-baseline\", \"middle\").style(\"text-anchor\", \"left\").style(\"font-family\", getConfig().fontFamily).style(\"font-size\", attrFontSize + \"px\").text(item.attributeComment || \"\");\n attributeNode.cn = commentNode;\n const commentNodeBBox = commentNode.node().getBBox();\n maxCommentWidth = Math.max(maxCommentWidth, commentNodeBBox.width);\n nodeHeight = Math.max(nodeHeight, commentNodeBBox.height);\n }\n attributeNode.height = nodeHeight;\n attributeNodes.push(attributeNode);\n cumulativeHeight += nodeHeight + heightPadding * 2;\n attrNum += 1;\n });\n let widthPaddingFactor = 4;\n if (hasKeyType) {\n widthPaddingFactor += 2;\n }\n if (hasComment) {\n widthPaddingFactor += 2;\n }\n const maxWidth = maxTypeWidth + maxNameWidth + maxKeyWidth + maxCommentWidth;\n const bBox = {\n width: Math.max(\n conf.minEntityWidth,\n Math.max(\n labelBBox.width + conf.entityPadding * 2,\n maxWidth + widthPadding * widthPaddingFactor\n )\n ),\n height: attributes.length > 0 ? cumulativeHeight : Math.max(conf.minEntityHeight, labelBBox.height + conf.entityPadding * 2)\n };\n if (attributes.length > 0) {\n const spareColumnWidth = Math.max(\n 0,\n (bBox.width - maxWidth - widthPadding * widthPaddingFactor) / (widthPaddingFactor / 2)\n );\n entityTextNode.attr(\n \"transform\",\n \"translate(\" + bBox.width / 2 + \",\" + (heightPadding + labelBBox.height / 2) + \")\"\n );\n let heightOffset = labelBBox.height + heightPadding * 2;\n let attribStyle = \"attributeBoxOdd\";\n attributeNodes.forEach((attributeNode) => {\n const alignY = heightOffset + heightPadding + attributeNode.height / 2;\n attributeNode.tn.attr(\"transform\", \"translate(\" + widthPadding + \",\" + alignY + \")\");\n const typeRect = groupNode.insert(\"rect\", \"#\" + attributeNode.tn.node().id).classed(`er ${attribStyle}`, true).attr(\"x\", 0).attr(\"y\", heightOffset).attr(\"width\", maxTypeWidth + widthPadding * 2 + spareColumnWidth).attr(\"height\", attributeNode.height + heightPadding * 2);\n const nameXOffset = parseFloat(typeRect.attr(\"x\")) + parseFloat(typeRect.attr(\"width\"));\n attributeNode.nn.attr(\n \"transform\",\n \"translate(\" + (nameXOffset + widthPadding) + \",\" + alignY + \")\"\n );\n const nameRect = groupNode.insert(\"rect\", \"#\" + attributeNode.nn.node().id).classed(`er ${attribStyle}`, true).attr(\"x\", nameXOffset).attr(\"y\", heightOffset).attr(\"width\", maxNameWidth + widthPadding * 2 + spareColumnWidth).attr(\"height\", attributeNode.height + heightPadding * 2);\n let keyTypeAndCommentXOffset = parseFloat(nameRect.attr(\"x\")) + parseFloat(nameRect.attr(\"width\"));\n if (hasKeyType) {\n attributeNode.kn.attr(\n \"transform\",\n \"translate(\" + (keyTypeAndCommentXOffset + widthPadding) + \",\" + alignY + \")\"\n );\n const keyTypeRect = groupNode.insert(\"rect\", \"#\" + attributeNode.kn.node().id).classed(`er ${attribStyle}`, true).attr(\"x\", keyTypeAndCommentXOffset).attr(\"y\", heightOffset).attr(\"width\", maxKeyWidth + widthPadding * 2 + spareColumnWidth).attr(\"height\", attributeNode.height + heightPadding * 2);\n keyTypeAndCommentXOffset = parseFloat(keyTypeRect.attr(\"x\")) + parseFloat(keyTypeRect.attr(\"width\"));\n }\n if (hasComment) {\n attributeNode.cn.attr(\n \"transform\",\n \"translate(\" + (keyTypeAndCommentXOffset + widthPadding) + \",\" + alignY + \")\"\n );\n groupNode.insert(\"rect\", \"#\" + attributeNode.cn.node().id).classed(`er ${attribStyle}`, \"true\").attr(\"x\", keyTypeAndCommentXOffset).attr(\"y\", heightOffset).attr(\"width\", maxCommentWidth + widthPadding * 2 + spareColumnWidth).attr(\"height\", attributeNode.height + heightPadding * 2);\n }\n heightOffset += attributeNode.height + heightPadding * 2;\n attribStyle = attribStyle === \"attributeBoxOdd\" ? \"attributeBoxEven\" : \"attributeBoxOdd\";\n });\n } else {\n bBox.height = Math.max(conf.minEntityHeight, cumulativeHeight);\n entityTextNode.attr(\"transform\", \"translate(\" + bBox.width / 2 + \",\" + bBox.height / 2 + \")\");\n }\n return bBox;\n}, \"drawAttributes\");\nvar drawEntities = /* @__PURE__ */ __name(function(svgNode, entities2, graph) {\n const keys = [...entities2.keys()];\n let firstOne;\n keys.forEach(function(entityName) {\n const entityId = generateId(entityName, \"entity\");\n entityNameIds.set(entityName, entityId);\n const groupNode = svgNode.append(\"g\").attr(\"id\", entityId);\n firstOne = firstOne === void 0 ? entityId : firstOne;\n const textId = \"text-\" + entityId;\n const textNode = groupNode.append(\"text\").classed(\"er entityLabel\", true).attr(\"id\", textId).attr(\"x\", 0).attr(\"y\", 0).style(\"dominant-baseline\", \"middle\").style(\"text-anchor\", \"middle\").style(\"font-family\", getConfig().fontFamily).style(\"font-size\", conf.fontSize + \"px\").text(entities2.get(entityName).alias ?? entityName);\n const { width: entityWidth, height: entityHeight } = drawAttributes(\n groupNode,\n textNode,\n entities2.get(entityName).attributes\n );\n const rectNode = groupNode.insert(\"rect\", \"#\" + textId).classed(\"er entityBox\", true).attr(\"x\", 0).attr(\"y\", 0).attr(\"width\", entityWidth).attr(\"height\", entityHeight);\n const rectBBox = rectNode.node().getBBox();\n graph.setNode(entityId, {\n width: rectBBox.width,\n height: rectBBox.height,\n shape: \"rect\",\n id: entityId\n });\n });\n return firstOne;\n}, \"drawEntities\");\nvar adjustEntities = /* @__PURE__ */ __name(function(svgNode, graph) {\n graph.nodes().forEach(function(v) {\n if (v !== void 0 && graph.node(v) !== void 0) {\n svgNode.select(\"#\" + v).attr(\n \"transform\",\n \"translate(\" + (graph.node(v).x - graph.node(v).width / 2) + \",\" + (graph.node(v).y - graph.node(v).height / 2) + \" )\"\n );\n }\n });\n}, \"adjustEntities\");\nvar getEdgeName = /* @__PURE__ */ __name(function(rel) {\n return (rel.entityA + rel.roleA + rel.entityB).replace(/\\s/g, \"\");\n}, \"getEdgeName\");\nvar addRelationships = /* @__PURE__ */ __name(function(relationships2, g) {\n relationships2.forEach(function(r) {\n g.setEdge(\n entityNameIds.get(r.entityA),\n entityNameIds.get(r.entityB),\n { relationship: r },\n getEdgeName(r)\n );\n });\n return relationships2;\n}, \"addRelationships\");\nvar relCnt = 0;\nvar drawRelationshipFromLayout = /* @__PURE__ */ __name(function(svg, rel, g, insert, diagObj) {\n relCnt++;\n const edge = g.edge(\n entityNameIds.get(rel.entityA),\n entityNameIds.get(rel.entityB),\n getEdgeName(rel)\n );\n const lineFunction = line().x(function(d) {\n return d.x;\n }).y(function(d) {\n return d.y;\n }).curve(curveBasis);\n const svgPath = svg.insert(\"path\", \"#\" + insert).classed(\"er relationshipLine\", true).attr(\"d\", lineFunction(edge.points)).style(\"stroke\", conf.stroke).style(\"fill\", \"none\");\n if (rel.relSpec.relType === diagObj.db.Identification.NON_IDENTIFYING) {\n svgPath.attr(\"stroke-dasharray\", \"8,8\");\n }\n let url = \"\";\n if (conf.arrowMarkerAbsolute) {\n url = window.location.protocol + \"//\" + window.location.host + window.location.pathname + window.location.search;\n url = url.replace(/\\(/g, \"\\\\(\");\n url = url.replace(/\\)/g, \"\\\\)\");\n }\n switch (rel.relSpec.cardA) {\n case diagObj.db.Cardinality.ZERO_OR_ONE:\n svgPath.attr(\"marker-end\", \"url(\" + url + \"#\" + erMarkers_default.ERMarkers.ZERO_OR_ONE_END + \")\");\n break;\n case diagObj.db.Cardinality.ZERO_OR_MORE:\n svgPath.attr(\"marker-end\", \"url(\" + url + \"#\" + erMarkers_default.ERMarkers.ZERO_OR_MORE_END + \")\");\n break;\n case diagObj.db.Cardinality.ONE_OR_MORE:\n svgPath.attr(\"marker-end\", \"url(\" + url + \"#\" + erMarkers_default.ERMarkers.ONE_OR_MORE_END + \")\");\n break;\n case diagObj.db.Cardinality.ONLY_ONE:\n svgPath.attr(\"marker-end\", \"url(\" + url + \"#\" + erMarkers_default.ERMarkers.ONLY_ONE_END + \")\");\n break;\n case diagObj.db.Cardinality.MD_PARENT:\n svgPath.attr(\"marker-end\", \"url(\" + url + \"#\" + erMarkers_default.ERMarkers.MD_PARENT_END + \")\");\n break;\n }\n switch (rel.relSpec.cardB) {\n case diagObj.db.Cardinality.ZERO_OR_ONE:\n svgPath.attr(\n \"marker-start\",\n \"url(\" + url + \"#\" + erMarkers_default.ERMarkers.ZERO_OR_ONE_START + \")\"\n );\n break;\n case diagObj.db.Cardinality.ZERO_OR_MORE:\n svgPath.attr(\n \"marker-start\",\n \"url(\" + url + \"#\" + erMarkers_default.ERMarkers.ZERO_OR_MORE_START + \")\"\n );\n break;\n case diagObj.db.Cardinality.ONE_OR_MORE:\n svgPath.attr(\n \"marker-start\",\n \"url(\" + url + \"#\" + erMarkers_default.ERMarkers.ONE_OR_MORE_START + \")\"\n );\n break;\n case diagObj.db.Cardinality.ONLY_ONE:\n svgPath.attr(\"marker-start\", \"url(\" + url + \"#\" + erMarkers_default.ERMarkers.ONLY_ONE_START + \")\");\n break;\n case diagObj.db.Cardinality.MD_PARENT:\n svgPath.attr(\"marker-start\", \"url(\" + url + \"#\" + erMarkers_default.ERMarkers.MD_PARENT_START + \")\");\n break;\n }\n const len = svgPath.node().getTotalLength();\n const labelPoint = svgPath.node().getPointAtLength(len * 0.5);\n const labelId = \"rel\" + relCnt;\n const labelText = rel.roleA.split(/<br ?\\/>/g);\n const labelNode = svg.append(\"text\").classed(\"er relationshipLabel\", true).attr(\"id\", labelId).attr(\"x\", labelPoint.x).attr(\"y\", labelPoint.y).style(\"text-anchor\", \"middle\").style(\"dominant-baseline\", \"middle\").style(\"font-family\", getConfig().fontFamily).style(\"font-size\", conf.fontSize + \"px\");\n if (labelText.length == 1) {\n labelNode.text(rel.roleA);\n } else {\n const firstShift = -(labelText.length - 1) * 0.5;\n labelText.forEach((txt, i) => {\n labelNode.append(\"tspan\").attr(\"x\", labelPoint.x).attr(\"dy\", `${i === 0 ? firstShift : 1}em`).text(txt);\n });\n }\n const labelBBox = labelNode.node().getBBox();\n svg.insert(\"rect\", \"#\" + labelId).classed(\"er relationshipLabelBox\", true).attr(\"x\", labelPoint.x - labelBBox.width / 2).attr(\"y\", labelPoint.y - labelBBox.height / 2).attr(\"width\", labelBBox.width).attr(\"height\", labelBBox.height);\n}, \"drawRelationshipFromLayout\");\nvar draw = /* @__PURE__ */ __name(function(text, id, _version, diagObj) {\n conf = getConfig().er;\n log.info(\"Drawing ER diagram\");\n const securityLevel = getConfig().securityLevel;\n let sandboxElement;\n if (securityLevel === \"sandbox\") {\n sandboxElement = select(\"#i\" + id);\n }\n const root = securityLevel === \"sandbox\" ? select(sandboxElement.nodes()[0].contentDocument.body) : select(\"body\");\n const svg = root.select(`[id='${id}']`);\n erMarkers_default.insertMarkers(svg, conf);\n let g;\n g = new graphlib.Graph({\n multigraph: true,\n directed: true,\n compound: false\n }).setGraph({\n rankdir: conf.layoutDirection,\n marginx: 20,\n marginy: 20,\n nodesep: 100,\n edgesep: 100,\n ranksep: 100\n }).setDefaultEdgeLabel(function() {\n return {};\n });\n const firstEntity = drawEntities(svg, diagObj.db.getEntities(), g);\n const relationships2 = addRelationships(diagObj.db.getRelationships(), g);\n dagreLayout(g);\n adjustEntities(svg, g);\n relationships2.forEach(function(rel) {\n drawRelationshipFromLayout(svg, rel, g, firstEntity, diagObj);\n });\n const padding = conf.diagramPadding;\n utils_default.insertTitle(svg, \"entityTitleText\", conf.titleTopMargin, diagObj.db.getDiagramTitle());\n const svgBounds = svg.node().getBBox();\n const width = svgBounds.width + padding * 2;\n const height = svgBounds.height + padding * 2;\n configureSvgSize(svg, height, width, conf.useMaxWidth);\n svg.attr(\"viewBox\", `${svgBounds.x - padding} ${svgBounds.y - padding} ${width} ${height}`);\n}, \"draw\");\nvar MERMAID_ERDIAGRAM_UUID = \"28e9f9db-3c8d-5aa5-9faf-44286ae5937c\";\nfunction generateId(str = \"\", prefix = \"\") {\n const simplifiedStr = str.replace(BAD_ID_CHARS_REGEXP, \"\");\n return `${strWithHyphen(prefix)}${strWithHyphen(simplifiedStr)}${uuid5(\n str,\n MERMAID_ERDIAGRAM_UUID\n )}`;\n}\n__name(generateId, \"generateId\");\nfunction strWithHyphen(str = \"\") {\n return str.length > 0 ? `${str}-` : \"\";\n}\n__name(strWithHyphen, \"strWithHyphen\");\nvar erRenderer_default = {\n setConf,\n draw\n};\n\n// src/diagrams/er/styles.js\nvar getStyles = /* @__PURE__ */ __name((options) => `\n .entityBox {\n fill: ${options.mainBkg};\n stroke: ${options.nodeBorder};\n }\n\n .attributeBoxOdd {\n fill: ${options.attributeBackgroundColorOdd};\n stroke: ${options.nodeBorder};\n }\n\n .attributeBoxEven {\n fill: ${options.attributeBackgroundColorEven};\n stroke: ${options.nodeBorder};\n }\n\n .relationshipLabelBox {\n fill: ${options.tertiaryColor};\n opacity: 0.7;\n background-color: ${options.tertiaryColor};\n rect {\n opacity: 0.5;\n }\n }\n\n .relationshipLine {\n stroke: ${options.lineColor};\n }\n\n .entityTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${options.textColor};\n } \n #MD_PARENT_START {\n fill: #f5f5f5 !important;\n stroke: ${options.lineColor} !important;\n stroke-width: 1;\n }\n #MD_PARENT_END {\n fill: #f5f5f5 !important;\n stroke: ${options.lineColor} !important;\n stroke-width: 1;\n }\n \n`, \"getStyles\");\nvar styles_default = getStyles;\n\n// src/diagrams/er/erDiagram.ts\nvar diagram = {\n parser: erDiagram_default,\n db: erDb_default,\n renderer: erRenderer_default,\n styles: styles_default\n};\nexport {\n diagram\n};\n"],"names":[],"sourceRoot":""}
|
package/dist/551.node.js
CHANGED