cullmann.io/themes/blowfish/assets/lib/mermaid/erDiagram-779a1e9e.js.map

1 line
91 KiB
Plaintext

{"version":3,"file":"erDiagram-779a1e9e.js","sources":["../src/diagrams/er/parser/erDiagram.jison","../src/diagrams/er/erDb.js","../src/diagrams/er/erMarkers.js","../../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/regex.js","../../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/validate.js","../../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/stringify.js","../../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/parse.js","../../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/v35.js","../../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/sha1.js","../../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/v5.js","../src/diagrams/er/erRenderer.js","../src/diagrams/er/styles.js","../src/diagrams/er/erDiagram.ts"],"sourcesContent":["%lex\n\n%options case-insensitive\n%x open_directive type_directive arg_directive block\n%x acc_title\n%x acc_descr\n%x acc_descr_multiline\n\n%%\naccTitle\\s*\":\"\\s* { this.begin(\"acc_title\");return 'acc_title'; }\n<acc_title>(?!\\n|;|#)*[^\\n]* { this.popState(); return \"acc_title_value\"; }\naccDescr\\s*\":\"\\s* { this.begin(\"acc_descr\");return 'acc_descr'; }\n<acc_descr>(?!\\n|;|#)*[^\\n]* { this.popState(); return \"acc_descr_value\"; }\naccDescr\\s*\"{\"\\s* { this.begin(\"acc_descr_multiline\");}\n<acc_descr_multiline>[\\}] { this.popState(); }\n<acc_descr_multiline>[^\\}]* return \"acc_descr_multiline_value\";\n\\%\\%\\{ { this.begin('open_directive'); return 'open_directive'; }\n<open_directive>((?:(?!\\}\\%\\%)[^:.])*) { this.begin('type_directive'); return 'type_directive'; }\n<type_directive>\":\" { this.popState(); this.begin('arg_directive'); return ':'; }\n<type_directive,arg_directive>\\}\\%\\% { this.popState(); this.popState(); return 'close_directive'; }\n<arg_directive>((?:(?!\\}\\%\\%).|\\n)*) return 'arg_directive';\n\\%%(?!\\{)[^\\n]* /* skip comments */\n[^\\}]\\%\\%[^\\n]* /* skip comments */\n[\\n]+ return 'NEWLINE';\n\\s+ /* skip whitespace */\n[\\s]+ return 'SPACE';\n\\\"[^\"%\\r\\n\\v\\b\\\\]+\\\" return 'ENTITY_NAME';\n\\\"[^\"]*\\\" return 'WORD';\n\"erDiagram\" return 'ER_DIAGRAM';\n\"{\" { this.begin(\"block\"); return 'BLOCK_START'; }\n<block>\",\" return 'COMMA';\n<block>\\s+ /* skip whitespace in block */\n<block>\\b((?:PK)|(?:FK)|(?:UK))\\b return 'ATTRIBUTE_KEY'\n<block>(.*?)[~](.*?)*[~] return 'ATTRIBUTE_WORD';\n<block>[A-Za-z_][A-Za-z0-9\\-_\\[\\]\\(\\)]* return 'ATTRIBUTE_WORD'\n<block>\\\"[^\"]*\\\" return 'COMMENT';\n<block>[\\n]+ /* nothing */\n<block>\\%%(?!\\{)[^\\n]* /* skip comments in attribute block */\n<block>[^\\}]\\%\\%[^\\n]* /* skip comments in attribute block */\n<block>\"}\" { this.popState(); return 'BLOCK_STOP'; }\n<block>. return yytext[0];\n\n\"one or zero\" return 'ZERO_OR_ONE';\n\"one or more\" return 'ONE_OR_MORE';\n\"one or many\" return 'ONE_OR_MORE';\n\"1+\" return 'ONE_OR_MORE';\n\\|o return 'ZERO_OR_ONE';\n\"zero or one\" return 'ZERO_OR_ONE';\n\"zero or more\" return 'ZERO_OR_MORE';\n\"zero or many\" return 'ZERO_OR_MORE';\n\"0+\" return 'ZERO_OR_MORE';\n\\}o return 'ZERO_OR_MORE';\n\"many(0)\" return 'ZERO_OR_MORE';\n\"many(1)\" return 'ONE_OR_MORE';\n\"many\" return 'ZERO_OR_MORE';\n\\}\\| return 'ONE_OR_MORE';\n\"one\" return 'ONLY_ONE';\n\"only one\" return 'ONLY_ONE';\n\"1\" return 'ONLY_ONE';\n\\|\\| return 'ONLY_ONE';\no\\| return 'ZERO_OR_ONE';\no\\{ return 'ZERO_OR_MORE';\n\\|\\{ return 'ONE_OR_MORE';\n\\.\\. return 'NON_IDENTIFYING';\n\\-\\- return 'IDENTIFYING';\n\"to\" return 'IDENTIFYING';\n\"optionally to\" return 'NON_IDENTIFYING';\n\\.\\- return 'NON_IDENTIFYING';\n\\-\\. return 'NON_IDENTIFYING';\n[A-Za-z][A-Za-z0-9\\-_]* return 'ALPHANUM';\n. return yytext[0];\n<<EOF>> return 'EOF';\n\n/lex\n\n%start start\n%% /* language grammar */\n\nstart\n : 'ER_DIAGRAM' document 'EOF' { /*console.log('finished parsing');*/ }\n \t| directive start\n ;\n\ndocument\n\t: /* empty */ { $$ = [] }\n\t| document line {$1.push($2);$$ = $1}\n\t;\n\nline\n\t: SPACE statement { $$ = $2 }\n\t| statement { $$ = $1 }\n\t| NEWLINE { $$=[];}\n\t| EOF { $$=[];}\n\t;\n\ndirective\n : openDirective typeDirective closeDirective 'NEWLINE'\n | openDirective typeDirective ':' argDirective closeDirective 'NEWLINE'\n ;\n\nstatement\n : directive\n | entityName relSpec entityName ':' role\n {\n yy.addEntity($1);\n yy.addEntity($3);\n yy.addRelationship($1, $5, $3, $2);\n /*console.log($1 + $2 + $3 + ':' + $5);*/\n }\n | entityName BLOCK_START attributes BLOCK_STOP\n {\n /* console.log('detected block'); */\n yy.addEntity($1);\n yy.addAttributes($1, $3);\n /* console.log('handled block'); */\n }\n | entityName BLOCK_START BLOCK_STOP { yy.addEntity($1); }\n | entityName { yy.addEntity($1); }\n | title title_value { $$=$2.trim();yy.setAccTitle($$); }\n | acc_title acc_title_value { $$=$2.trim();yy.setAccTitle($$); }\n | acc_descr acc_descr_value { $$=$2.trim();yy.setAccDescription($$); }\n | acc_descr_multiline_value { $$=$1.trim();yy.setAccDescription($$); }\n ;\n\nentityName\n : 'ALPHANUM' { $$ = $1; }\n | 'ENTITY_NAME' { $$ = $1.replace(/\"/g, ''); }\n ;\n\nattributes\n : attribute { $$ = [$1]; }\n | attribute attributes { $2.push($1); $$=$2; }\n ;\n\nattribute\n : attributeType attributeName { $$ = { attributeType: $1, attributeName: $2 }; }\n | attributeType attributeName attributeKeyTypeList { $$ = { attributeType: $1, attributeName: $2, attributeKeyTypeList: $3 }; }\n | attributeType attributeName attributeComment { $$ = { attributeType: $1, attributeName: $2, attributeComment: $3 }; }\n | attributeType attributeName attributeKeyTypeList attributeComment { $$ = { attributeType: $1, attributeName: $2, attributeKeyTypeList: $3, attributeComment: $4 }; }\n ;\n\n\nattributeType\n : ATTRIBUTE_WORD { $$=$1; }\n ;\n\nattributeName\n : ATTRIBUTE_WORD { $$=$1; }\n ;\n\nattributeKeyTypeList\n : attributeKeyType { $$ = [$1]; }\n | attributeKeyTypeList COMMA attributeKeyType { $1.push($3); $$ = $1; }\n ;\n\nattributeKeyType\n : ATTRIBUTE_KEY { $$=$1; }\n ;\n\nattributeComment\n : COMMENT { $$=$1.replace(/\"/g, ''); }\n ;\n\nrelSpec\n : cardinality relType cardinality\n {\n $$ = { cardA: $3, relType: $2, cardB: $1 };\n /*console.log('relSpec: ' + $3 + $2 + $1);*/\n }\n ;\n\ncardinality\n : 'ZERO_OR_ONE' { $$ = yy.Cardinality.ZERO_OR_ONE; }\n | 'ZERO_OR_MORE' { $$ = yy.Cardinality.ZERO_OR_MORE; }\n | 'ONE_OR_MORE' { $$ = yy.Cardinality.ONE_OR_MORE; }\n | 'ONLY_ONE' { $$ = yy.Cardinality.ONLY_ONE; }\n ;\n\nrelType\n : 'NON_IDENTIFYING' { $$ = yy.Identification.NON_IDENTIFYING; }\n | 'IDENTIFYING' { $$ = yy.Identification.IDENTIFYING; }\n ;\n\nrole\n : 'WORD' { $$ = $1.replace(/\"/g, ''); }\n | 'ENTITY_NAME' { $$ = $1.replace(/\"/g, ''); }\n | 'ALPHANUM' { $$ = $1; }\n ;\n\nopenDirective\n : open_directive { yy.parseDirective('%%{', 'open_directive'); }\n ;\n\ntypeDirective\n : type_directive { yy.parseDirective($1, 'type_directive'); }\n ;\n\nargDirective\n : arg_directive { $1 = $1.trim().replace(/'/g, '\"'); yy.parseDirective($1, 'arg_directive'); }\n ;\n\ncloseDirective\n : close_directive { yy.parseDirective('}%%', 'close_directive', 'er'); }\n ;\n\n%%\n","import { log } from '../../logger';\nimport mermaidAPI from '../../mermaidAPI';\nimport * as configApi from '../../config';\n\nimport {\n setAccTitle,\n getAccTitle,\n getAccDescription,\n setAccDescription,\n clear as commonClear,\n setDiagramTitle,\n getDiagramTitle,\n} from '../../commonDb';\n\nlet entities = {};\nlet relationships = [];\n\nconst 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};\n\nconst Identification = {\n NON_IDENTIFYING: 'NON_IDENTIFYING',\n IDENTIFYING: 'IDENTIFYING',\n};\n\nexport const parseDirective = function (statement, context, type) {\n mermaidAPI.parseDirective(this, statement, context, type);\n};\n\nconst addEntity = function (name) {\n if (entities[name] === undefined) {\n entities[name] = { attributes: [] };\n log.info('Added new entity :', name);\n }\n\n return entities[name];\n};\n\nconst getEntities = () => entities;\n\nconst addAttributes = function (entityName, attribs) {\n let entity = addEntity(entityName); // May do nothing (if entity has already been added)\n\n // Process attribs in reverse order due to effect of recursive construction (last attribute is first)\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};\n\n/**\n * Add a relationship\n *\n * @param entA The first entity in the relationship\n * @param rolA The role played by the first entity in relation to the second\n * @param entB The second entity in the relationship\n * @param rSpec The details of the relationship between the two entities\n */\nconst addRelationship = function (entA, rolA, entB, rSpec) {\n let rel = {\n entityA: entA,\n roleA: rolA,\n entityB: entB,\n relSpec: rSpec,\n };\n\n relationships.push(rel);\n log.debug('Added new relationship :', rel);\n};\n\nconst getRelationships = () => relationships;\n\nconst clear = function () {\n entities = {};\n relationships = [];\n commonClear();\n};\n\nexport default {\n Cardinality,\n Identification,\n parseDirective,\n getConfig: () => configApi.getConfig().er,\n addEntity,\n addAttributes,\n getEntities,\n addRelationship,\n getRelationships,\n clear,\n setAccTitle,\n getAccTitle,\n setAccDescription,\n getAccDescription,\n setDiagramTitle,\n getDiagramTitle,\n};\n","const 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};\n\n/**\n * Put the markers into the svg DOM for later use with edge paths\n *\n * @param elem\n * @param conf\n */\nconst insertMarkers = function (elem, conf) {\n let marker;\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', ERMarkers.ONLY_ONE_START)\n .attr('refX', 0)\n .attr('refY', 9)\n .attr('markerWidth', 18)\n .attr('markerHeight', 18)\n .attr('orient', 'auto')\n .append('path')\n .attr('stroke', conf.stroke)\n .attr('fill', 'none')\n .attr('d', 'M9,0 L9,18 M15,0 L15,18');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', ERMarkers.ONLY_ONE_END)\n .attr('refX', 18)\n .attr('refY', 9)\n .attr('markerWidth', 18)\n .attr('markerHeight', 18)\n .attr('orient', 'auto')\n .append('path')\n .attr('stroke', conf.stroke)\n .attr('fill', 'none')\n .attr('d', 'M3,0 L3,18 M9,0 L9,18');\n\n marker = elem\n .append('defs')\n .append('marker')\n .attr('id', ERMarkers.ZERO_OR_ONE_START)\n .attr('refX', 0)\n .attr('refY', 9)\n .attr('markerWidth', 30)\n .attr('markerHeight', 18)\n .attr('orient', 'auto');\n marker\n .append('circle')\n .attr('stroke', conf.stroke)\n .attr('fill', 'white')\n .attr('cx', 21)\n .attr('cy', 9)\n .attr('r', 6);\n marker.append('path').attr('stroke', conf.stroke).attr('fill', 'none').attr('d', 'M9,0 L9,18');\n\n marker = elem\n .append('defs')\n .append('marker')\n .attr('id', ERMarkers.ZERO_OR_ONE_END)\n .attr('refX', 30)\n .attr('refY', 9)\n .attr('markerWidth', 30)\n .attr('markerHeight', 18)\n .attr('orient', 'auto');\n marker\n .append('circle')\n .attr('stroke', conf.stroke)\n .attr('fill', 'white')\n .attr('cx', 9)\n .attr('cy', 9)\n .attr('r', 6);\n marker.append('path').attr('stroke', conf.stroke).attr('fill', 'none').attr('d', 'M21,0 L21,18');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', ERMarkers.ONE_OR_MORE_START)\n .attr('refX', 18)\n .attr('refY', 18)\n .attr('markerWidth', 45)\n .attr('markerHeight', 36)\n .attr('orient', 'auto')\n .append('path')\n .attr('stroke', conf.stroke)\n .attr('fill', 'none')\n .attr('d', 'M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', ERMarkers.ONE_OR_MORE_END)\n .attr('refX', 27)\n .attr('refY', 18)\n .attr('markerWidth', 45)\n .attr('markerHeight', 36)\n .attr('orient', 'auto')\n .append('path')\n .attr('stroke', conf.stroke)\n .attr('fill', 'none')\n .attr('d', 'M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18');\n\n marker = elem\n .append('defs')\n .append('marker')\n .attr('id', ERMarkers.ZERO_OR_MORE_START)\n .attr('refX', 18)\n .attr('refY', 18)\n .attr('markerWidth', 57)\n .attr('markerHeight', 36)\n .attr('orient', 'auto');\n marker\n .append('circle')\n .attr('stroke', conf.stroke)\n .attr('fill', 'white')\n .attr('cx', 48)\n .attr('cy', 18)\n .attr('r', 6);\n marker\n .append('path')\n .attr('stroke', conf.stroke)\n .attr('fill', 'none')\n .attr('d', 'M0,18 Q18,0 36,18 Q18,36 0,18');\n\n marker = elem\n .append('defs')\n .append('marker')\n .attr('id', ERMarkers.ZERO_OR_MORE_END)\n .attr('refX', 39)\n .attr('refY', 18)\n .attr('markerWidth', 57)\n .attr('markerHeight', 36)\n .attr('orient', 'auto');\n marker\n .append('circle')\n .attr('stroke', conf.stroke)\n .attr('fill', 'white')\n .attr('cx', 9)\n .attr('cy', 18)\n .attr('r', 6);\n marker\n .append('path')\n .attr('stroke', conf.stroke)\n .attr('fill', 'none')\n .attr('d', 'M21,18 Q39,0 57,18 Q39,36 21,18');\n\n return;\n};\n\nexport default {\n ERMarkers,\n insertMarkers,\n};\n","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/**\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]]).toLowerCase();\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;","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}","// Adapted from Chris Veness' SHA1 code at\n// http://www.movable-type.co.uk/scripts/sha1.html\nfunction f(s, x, y, z) {\n switch (s) {\n case 0:\n return x & y ^ ~x & z;\n\n case 1:\n return x ^ y ^ z;\n\n case 2:\n return x & y ^ x & z ^ y & z;\n\n case 3:\n return x ^ y ^ z;\n }\n}\n\nfunction ROTL(x, n) {\n return x << n | x >>> 32 - n;\n}\n\nfunction sha1(bytes) {\n const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];\n const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];\n\n if (typeof bytes === 'string') {\n const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape\n\n bytes = [];\n\n for (let i = 0; i < msg.length; ++i) {\n bytes.push(msg.charCodeAt(i));\n }\n } else if (!Array.isArray(bytes)) {\n // Convert Array-like to Array\n bytes = Array.prototype.slice.call(bytes);\n }\n\n bytes.push(0x80);\n const l = bytes.length / 4 + 2;\n const N = Math.ceil(l / 16);\n const M = new Array(N);\n\n for (let i = 0; i < N; ++i) {\n const arr = new Uint32Array(16);\n\n for (let j = 0; j < 16; ++j) {\n arr[j] = bytes[i * 64 + j * 4] << 24 | bytes[i * 64 + j * 4 + 1] << 16 | bytes[i * 64 + j * 4 + 2] << 8 | bytes[i * 64 + j * 4 + 3];\n }\n\n M[i] = arr;\n }\n\n M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);\n M[N - 1][14] = Math.floor(M[N - 1][14]);\n M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;\n\n for (let i = 0; i < N; ++i) {\n const W = new Uint32Array(80);\n\n for (let t = 0; t < 16; ++t) {\n W[t] = M[i][t];\n }\n\n for (let t = 16; t < 80; ++t) {\n W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);\n }\n\n let a = H[0];\n let b = H[1];\n let c = H[2];\n let d = H[3];\n let e = H[4];\n\n for (let t = 0; t < 80; ++t) {\n const s = Math.floor(t / 20);\n const T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0;\n e = d;\n d = c;\n c = ROTL(b, 30) >>> 0;\n b = a;\n a = T;\n }\n\n H[0] = H[0] + a >>> 0;\n H[1] = H[1] + b >>> 0;\n H[2] = H[2] + c >>> 0;\n H[3] = H[3] + d >>> 0;\n H[4] = H[4] + e >>> 0;\n }\n\n return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff];\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 * 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';\nimport { getConfig } from '../../config';\nimport { log } from '../../logger';\nimport utils from '../../utils';\nimport erMarkers from './erMarkers';\nimport { configureSvgSize } from '../../setupGraphViewbox';\nimport { parseGenericTypes } from '../common/common';\nimport { v5 as uuid5 } from 'uuid';\n\n/** Regex used to remove chars from the entity name so the result can be used in an id */\nconst BAD_ID_CHARS_REGEXP = /[^\\dA-Za-z](\\W)*/g;\n\n// Configuration\nlet conf = {};\n\n// Map so we can look up the id of an entity based on the name\nlet entityNameIds = new Map();\n\n/**\n * Allows the top-level API module to inject config specific to this renderer, storing it in the\n * local conf object. Note that generic config still needs to be retrieved using getConfig()\n * imported from the config module\n *\n * @param cnf\n */\nexport const setConf = function (cnf) {\n const keys = Object.keys(cnf);\n for (const key of keys) {\n conf[key] = cnf[key];\n }\n};\n\n/**\n * Draw attributes for an entity\n *\n * @param groupNode The svg group node for the entity\n * @param entityTextNode The svg node for the entity label text\n * @param attributes An array of attributes defined for the entity (each attribute has a type and a\n * name)\n * @returns {object} The bounding box of the entity, after attributes have been added. The bounding\n * box has a .width and .height\n */\nconst drawAttributes = (groupNode, entityTextNode, attributes) => {\n const heightPadding = conf.entityPadding / 3; // Padding internal to attribute boxes\n const widthPadding = conf.entityPadding / 3; // Ditto\n const attrFontSize = conf.fontSize * 0.85;\n const labelBBox = entityTextNode.node().getBBox();\n const attributeNodes = []; // Intermediate storage for attribute nodes created so that we can do a second pass\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\n // Check to see if any of the attributes has a key or a comment\n attributes.forEach((item) => {\n if (item.attributeKeyTypeList !== undefined && item.attributeKeyTypeList.length > 0) {\n hasKeyType = true;\n }\n\n if (item.attributeComment !== undefined) {\n hasComment = true;\n }\n });\n\n attributes.forEach((item) => {\n const attrPrefix = `${entityTextNode.node().id}-attr-${attrNum}`;\n let nodeHeight = 0;\n\n const attributeType = parseGenericTypes(item.attributeType);\n\n // Add a text node for the attribute type\n const typeNode = groupNode\n .append('text')\n .classed('er entityLabel', true)\n .attr('id', `${attrPrefix}-type`)\n .attr('x', 0)\n .attr('y', 0)\n .style('dominant-baseline', 'middle')\n .style('text-anchor', 'left')\n .style('font-family', getConfig().fontFamily)\n .style('font-size', attrFontSize + 'px')\n .text(attributeType);\n\n // Add a text node for the attribute name\n const nameNode = groupNode\n .append('text')\n .classed('er entityLabel', true)\n .attr('id', `${attrPrefix}-name`)\n .attr('x', 0)\n .attr('y', 0)\n .style('dominant-baseline', 'middle')\n .style('text-anchor', 'left')\n .style('font-family', getConfig().fontFamily)\n .style('font-size', attrFontSize + 'px')\n .text(item.attributeName);\n\n const attributeNode = {};\n attributeNode.tn = typeNode;\n attributeNode.nn = nameNode;\n\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\n nodeHeight = Math.max(typeBBox.height, nameBBox.height);\n\n if (hasKeyType) {\n const keyTypeNodeText =\n item.attributeKeyTypeList !== undefined ? item.attributeKeyTypeList.join(',') : '';\n\n const keyTypeNode = groupNode\n .append('text')\n .classed('er entityLabel', true)\n .attr('id', `${attrPrefix}-key`)\n .attr('x', 0)\n .attr('y', 0)\n .style('dominant-baseline', 'middle')\n .style('text-anchor', 'left')\n .style('font-family', getConfig().fontFamily)\n .style('font-size', attrFontSize + 'px')\n .text(keyTypeNodeText);\n\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\n if (hasComment) {\n const commentNode = groupNode\n .append('text')\n .classed('er entityLabel', true)\n .attr('id', `${attrPrefix}-comment`)\n .attr('x', 0)\n .attr('y', 0)\n .style('dominant-baseline', 'middle')\n .style('text-anchor', 'left')\n .style('font-family', getConfig().fontFamily)\n .style('font-size', attrFontSize + 'px')\n .text(item.attributeComment || '');\n\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\n attributeNode.height = nodeHeight;\n // Keep a reference to the nodes so that we can iterate through them later\n attributeNodes.push(attributeNode);\n cumulativeHeight += nodeHeight + heightPadding * 2;\n attrNum += 1;\n });\n\n let widthPaddingFactor = 4;\n if (hasKeyType) {\n widthPaddingFactor += 2;\n }\n if (hasComment) {\n widthPaddingFactor += 2;\n }\n\n const maxWidth = maxTypeWidth + maxNameWidth + maxKeyWidth + maxCommentWidth;\n\n // Calculate the new bounding box of the overall entity, now that attributes have been added\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:\n attributes.length > 0\n ? cumulativeHeight\n : Math.max(conf.minEntityHeight, labelBBox.height + conf.entityPadding * 2),\n };\n\n if (attributes.length > 0) {\n // There might be some spare width for padding out attributes if the entity name is very long\n const spareColumnWidth = Math.max(\n 0,\n (bBox.width - maxWidth - widthPadding * widthPaddingFactor) / (widthPaddingFactor / 2)\n );\n\n // Position the entity label near the top of the entity bounding box\n entityTextNode.attr(\n 'transform',\n 'translate(' + bBox.width / 2 + ',' + (heightPadding + labelBBox.height / 2) + ')'\n );\n\n // Add rectangular boxes for the attribute types/names\n let heightOffset = labelBBox.height + heightPadding * 2; // Start at the bottom of the entity label\n let attribStyle = 'attributeBoxOdd'; // We will flip the style on alternate rows to achieve a banded effect\n\n attributeNodes.forEach((attributeNode) => {\n // Calculate the alignment y co-ordinate for the type/name of the attribute\n const alignY = heightOffset + heightPadding + attributeNode.height / 2;\n\n // Position the type attribute\n attributeNode.tn.attr('transform', 'translate(' + widthPadding + ',' + alignY + ')');\n\n // TODO Handle spareWidth in attr('width')\n // Insert a rectangle for the type\n const typeRect = groupNode\n .insert('rect', '#' + attributeNode.tn.node().id)\n .classed(`er ${attribStyle}`, true)\n .attr('x', 0)\n .attr('y', heightOffset)\n .attr('width', maxTypeWidth + widthPadding * 2 + spareColumnWidth)\n .attr('height', attributeNode.height + heightPadding * 2);\n\n const nameXOffset = parseFloat(typeRect.attr('x')) + parseFloat(typeRect.attr('width'));\n\n // Position the name attribute\n attributeNode.nn.attr(\n 'transform',\n 'translate(' + (nameXOffset + widthPadding) + ',' + alignY + ')'\n );\n\n // Insert a rectangle for the name\n const nameRect = groupNode\n .insert('rect', '#' + attributeNode.nn.node().id)\n .classed(`er ${attribStyle}`, true)\n .attr('x', nameXOffset)\n .attr('y', heightOffset)\n .attr('width', maxNameWidth + widthPadding * 2 + spareColumnWidth)\n .attr('height', attributeNode.height + heightPadding * 2);\n\n let keyTypeAndCommentXOffset =\n parseFloat(nameRect.attr('x')) + parseFloat(nameRect.attr('width'));\n\n if (hasKeyType) {\n // Position the key type attribute\n attributeNode.kn.attr(\n 'transform',\n 'translate(' + (keyTypeAndCommentXOffset + widthPadding) + ',' + alignY + ')'\n );\n\n // Insert a rectangle for the key type\n const keyTypeRect = groupNode\n .insert('rect', '#' + attributeNode.kn.node().id)\n .classed(`er ${attribStyle}`, true)\n .attr('x', keyTypeAndCommentXOffset)\n .attr('y', heightOffset)\n .attr('width', maxKeyWidth + widthPadding * 2 + spareColumnWidth)\n .attr('height', attributeNode.height + heightPadding * 2);\n\n keyTypeAndCommentXOffset =\n parseFloat(keyTypeRect.attr('x')) + parseFloat(keyTypeRect.attr('width'));\n }\n\n if (hasComment) {\n // Position the comment attribute\n attributeNode.cn.attr(\n 'transform',\n 'translate(' + (keyTypeAndCommentXOffset + widthPadding) + ',' + alignY + ')'\n );\n\n // Insert a rectangle for the comment\n groupNode\n .insert('rect', '#' + attributeNode.cn.node().id)\n .classed(`er ${attribStyle}`, 'true')\n .attr('x', keyTypeAndCommentXOffset)\n .attr('y', heightOffset)\n .attr('width', maxCommentWidth + widthPadding * 2 + spareColumnWidth)\n .attr('height', attributeNode.height + heightPadding * 2);\n }\n\n // Increment the height offset to move to the next row\n heightOffset += attributeNode.height + heightPadding * 2;\n\n // Flip the attribute style for row banding\n attribStyle = attribStyle === 'attributeBoxOdd' ? 'attributeBoxEven' : 'attributeBoxOdd';\n });\n } else {\n // Ensure the entity box is a decent size without any attributes\n bBox.height = Math.max(conf.minEntityHeight, cumulativeHeight);\n\n // Position the entity label in the middle of the box\n entityTextNode.attr('transform', 'translate(' + bBox.width / 2 + ',' + bBox.height / 2 + ')');\n }\n\n return bBox;\n};\n\n/**\n * Use D3 to construct the svg elements for the entities\n *\n * @param svgNode The svg node that contains the diagram\n * @param entities The entities to be drawn\n * @param graph The graph that contains the vertex and edge definitions post-layout\n * @returns {object} The first entity that was inserted\n */\nconst drawEntities = function (svgNode, entities, graph) {\n const keys = Object.keys(entities);\n let firstOne;\n\n keys.forEach(function (entityName) {\n const entityId = generateId(entityName, 'entity');\n entityNameIds.set(entityName, entityId);\n\n // Create a group for each entity\n const groupNode = svgNode.append('g').attr('id', entityId);\n\n firstOne = firstOne === undefined ? entityId : firstOne;\n\n // Label the entity - this is done first so that we can get the bounding box\n // which then determines the size of the rectangle\n const textId = 'text-' + entityId;\n const textNode = groupNode\n .append('text')\n .classed('er entityLabel', true)\n .attr('id', textId)\n .attr('x', 0)\n .attr('y', 0)\n .style('dominant-baseline', 'middle')\n .style('text-anchor', 'middle')\n .style('font-family', getConfig().fontFamily)\n .style('font-size', conf.fontSize + 'px')\n .text(entityName);\n\n const { width: entityWidth, height: entityHeight } = drawAttributes(\n groupNode,\n textNode,\n entities[entityName].attributes\n );\n\n // Draw the rectangle - insert it before the text so that the text is not obscured\n const rectNode = groupNode\n .insert('rect', '#' + textId)\n .classed('er entityBox', true)\n .attr('x', 0)\n .attr('y', 0)\n .attr('width', entityWidth)\n .attr('height', entityHeight);\n\n const rectBBox = rectNode.node().getBBox();\n\n // Add the entity to the graph using the entityId\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\n\nconst adjustEntities = function (svgNode, graph) {\n graph.nodes().forEach(function (v) {\n if (v !== undefined && graph.node(v) !== undefined) {\n svgNode\n .select('#' + v)\n .attr(\n 'transform',\n 'translate(' +\n (graph.node(v).x - graph.node(v).width / 2) +\n ',' +\n (graph.node(v).y - graph.node(v).height / 2) +\n ' )'\n );\n }\n });\n};\n\n/**\n * Construct a name for an edge based on the names of the 2 entities and the role (relationship)\n * between them. Remove any spaces from it\n *\n * @param rel - A (parsed) relationship (e.g. one of the objects in the list returned by\n * erDb.getRelationships)\n * @returns {string}\n */\nconst getEdgeName = function (rel) {\n return (rel.entityA + rel.roleA + rel.entityB).replace(/\\s/g, '');\n};\n\n/**\n * Add each relationship to the graph\n *\n * @param relationships The relationships to be added\n * @param g The graph\n * @returns {Array} The array of relationships\n */\nconst addRelationships = function (relationships, g) {\n relationships.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 relationships;\n}; // addRelationships\n\nlet relCnt = 0;\n/**\n * Draw a relationship using edge information from the graph\n *\n * @param svg The svg node\n * @param rel The relationship to draw in the svg\n * @param g The graph containing the edge information\n * @param insert The insertion point in the svg DOM (because relationships have markers that need to\n * sit 'behind' opaque entity boxes)\n * @param diagObj\n */\nconst drawRelationshipFromLayout = function (svg, rel, g, insert, diagObj) {\n relCnt++;\n\n // Find the edge relating to this relationship\n const edge = g.edge(\n entityNameIds.get(rel.entityA),\n entityNameIds.get(rel.entityB),\n getEdgeName(rel)\n );\n\n // Get a function that will generate the line path\n const lineFunction = line()\n .x(function (d) {\n return d.x;\n })\n .y(function (d) {\n return d.y;\n })\n .curve(curveBasis);\n\n // Insert the line at the right place\n const svgPath = svg\n .insert('path', '#' + insert)\n .classed('er relationshipLine', true)\n .attr('d', lineFunction(edge.points))\n .style('stroke', conf.stroke)\n .style('fill', 'none');\n\n // ...and with dashes if necessary\n if (rel.relSpec.relType === diagObj.db.Identification.NON_IDENTIFYING) {\n svgPath.attr('stroke-dasharray', '8,8');\n }\n\n // TODO: Understand this better\n let url = '';\n if (conf.arrowMarkerAbsolute) {\n url =\n window.location.protocol +\n '//' +\n window.location.host +\n window.location.pathname +\n window.location.search;\n url = url.replace(/\\(/g, '\\\\(');\n url = url.replace(/\\)/g, '\\\\)');\n }\n\n // Decide which start and end markers it needs. It may be possible to be more concise here\n // by reversing a start marker to make an end marker...but this will do for now\n\n // Note that the 'A' entity's marker is at the end of the relationship and the 'B' entity's marker is at the start\n switch (rel.relSpec.cardA) {\n case diagObj.db.Cardinality.ZERO_OR_ONE:\n svgPath.attr('marker-end', 'url(' + url + '#' + erMarkers.ERMarkers.ZERO_OR_ONE_END + ')');\n break;\n case diagObj.db.Cardinality.ZERO_OR_MORE:\n svgPath.attr('marker-end', 'url(' + url + '#' + erMarkers.ERMarkers.ZERO_OR_MORE_END + ')');\n break;\n case diagObj.db.Cardinality.ONE_OR_MORE:\n svgPath.attr('marker-end', 'url(' + url + '#' + erMarkers.ERMarkers.ONE_OR_MORE_END + ')');\n break;\n case diagObj.db.Cardinality.ONLY_ONE:\n svgPath.attr('marker-end', 'url(' + url + '#' + erMarkers.ERMarkers.ONLY_ONE_END + ')');\n break;\n }\n\n switch (rel.relSpec.cardB) {\n case diagObj.db.Cardinality.ZERO_OR_ONE:\n svgPath.attr(\n 'marker-start',\n 'url(' + url + '#' + erMarkers.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.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.ERMarkers.ONE_OR_MORE_START + ')'\n );\n break;\n case diagObj.db.Cardinality.ONLY_ONE:\n svgPath.attr('marker-start', 'url(' + url + '#' + erMarkers.ERMarkers.ONLY_ONE_START + ')');\n break;\n }\n\n // Now label the relationship\n\n // Find the half-way point\n const len = svgPath.node().getTotalLength();\n const labelPoint = svgPath.node().getPointAtLength(len * 0.5);\n\n // Append a text node containing the label\n const labelId = 'rel' + relCnt;\n\n const labelNode = svg\n .append('text')\n .classed('er relationshipLabel', true)\n .attr('id', labelId)\n .attr('x', labelPoint.x)\n .attr('y', labelPoint.y)\n .style('text-anchor', 'middle')\n .style('dominant-baseline', 'middle')\n .style('font-family', getConfig().fontFamily)\n .style('font-size', conf.fontSize + 'px')\n .text(rel.roleA);\n\n // Figure out how big the opaque 'container' rectangle needs to be\n const labelBBox = labelNode.node().getBBox();\n\n // Insert the opaque rectangle before the text label\n svg\n .insert('rect', '#' + labelId)\n .classed('er relationshipLabelBox', true)\n .attr('x', labelPoint.x - labelBBox.width / 2)\n .attr('y', labelPoint.y - labelBBox.height / 2)\n .attr('width', labelBBox.width)\n .attr('height', labelBBox.height);\n};\n\n/**\n * Draw en E-R diagram in the tag with id: id based on the text definition of the diagram\n *\n * @param text The text of the diagram\n * @param id The unique id of the DOM node that contains the diagram\n * @param _version\n * @param diagObj\n */\nexport const draw = function (text, id, _version, diagObj) {\n conf = getConfig().er;\n log.info('Drawing ER diagram');\n // diag.db.clear();\n const securityLevel = getConfig().securityLevel;\n // Handle root and Document for when rendering in sandbox mode\n let sandboxElement;\n if (securityLevel === 'sandbox') {\n sandboxElement = select('#i' + id);\n }\n const root =\n securityLevel === 'sandbox'\n ? select(sandboxElement.nodes()[0].contentDocument.body)\n : select('body');\n // const doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document;\n\n // Parse the text to populate erDb\n // try {\n // parser.parse(text);\n // } catch (err) {\n // log.debug('Parsing failed');\n // }\n\n // Get a reference to the svg node that contains the text\n const svg = root.select(`[id='${id}']`);\n\n // Add cardinality marker definitions to the svg\n erMarkers.insertMarkers(svg, conf);\n\n // Now we have to construct the diagram in a specific way:\n // ---\n // 1. Create all the entities in the svg node at 0,0, but with the correct dimensions (allowing for text content)\n // 2. Make sure they are all added to the graph\n // 3. Add all the edges (relationships) to the graph as well\n // 4. Let dagre do its magic to lay out the graph. This assigns:\n // - the centre co-ordinates for each node, bearing in mind the dimensions and edge relationships\n // - the path co-ordinates for each edge\n // But it has no impact on the svg child nodes - the diagram remains with every entity rooted at 0,0\n // 5. Now assign a transform to each entity in the svg node so that it gets drawn in the correct place, as determined by\n // its centre point, which is obtained from the graph, and it's width and height\n // 6. And finally, create all the edges in the svg node using information from the graph\n // ---\n\n // Create the graph\n let g;\n\n // TODO: Explore directed vs undirected graphs, and how the layout is affected\n // An E-R diagram could be said to be undirected, but there is merit in setting\n // the direction from parent to child in a one-to-many as this influences graphlib to\n // put the parent above the child (does it?), which is intuitive. Most relationships\n // in ER diagrams are one-to-many.\n g = new graphlib.Graph({\n multigraph: true,\n directed: true,\n compound: false,\n })\n .setGraph({\n rankdir: conf.layoutDirection,\n marginx: 20,\n marginy: 20,\n nodesep: 100,\n edgesep: 100,\n ranksep: 100,\n })\n .setDefaultEdgeLabel(function () {\n return {};\n });\n\n // Draw the entities (at 0,0), returning the first svg node that got\n // inserted - this represents the insertion point for relationship paths\n const firstEntity = drawEntities(svg, diagObj.db.getEntities(), g);\n\n // TODO: externalize the addition of entities to the graph - it's a bit 'buried' in the above\n\n // Add all the relationships to the graph\n const relationships = addRelationships(diagObj.db.getRelationships(), g);\n\n dagreLayout(g); // Node and edge positions will be updated\n\n // Adjust the positions of the entities so that they adhere to the layout\n adjustEntities(svg, g);\n\n // Draw the relationships\n relationships.forEach(function (rel) {\n drawRelationshipFromLayout(svg, rel, g, firstEntity, diagObj);\n });\n\n const padding = conf.diagramPadding;\n\n utils.insertTitle(svg, 'entityTitleText', conf.titleTopMargin, diagObj.db.getDiagramTitle());\n\n const svgBounds = svg.node().getBBox();\n const width = svgBounds.width + padding * 2;\n const height = svgBounds.height + padding * 2;\n\n configureSvgSize(svg, height, width, conf.useMaxWidth);\n\n svg.attr('viewBox', `${svgBounds.x - padding} ${svgBounds.y - padding} ${width} ${height}`);\n}; // draw\n\n/**\n * UUID namespace for ER diagram IDs\n *\n * This can be generated via running:\n *\n * ```js\n * const { v5: uuid5 } = await import('uuid');\n * uuid5(\n * 'https://mermaid-js.github.io/mermaid/syntax/entityRelationshipDiagram.html',\n * uuid5.URL\n * );\n * ```\n */\nconst MERMAID_ERDIAGRAM_UUID = '28e9f9db-3c8d-5aa5-9faf-44286ae5937c';\n\n/**\n * Return a unique id based on the given string. Start with the prefix, then a hyphen, then the\n * simplified str, then a hyphen, then a unique uuid based on the str. (Hyphens are only included if needed.)\n * Although the official XML standard for ids says that many more characters are valid in the id,\n * this keeps things simple by accepting only A-Za-z0-9.\n *\n * @param {string} str Given string to use as the basis for the id. Default is `''`\n * @param {string} prefix String to put at the start, followed by '-'. Default is `''`\n * @returns {string}\n * @see https://www.w3.org/TR/xml/#NT-Name\n */\nexport function generateId(str = '', prefix = '') {\n const simplifiedStr = str.replace(BAD_ID_CHARS_REGEXP, '');\n // we use `uuid v5` so that UUIDs are consistent given a string.\n return `${strWithHyphen(prefix)}${strWithHyphen(simplifiedStr)}${uuid5(\n str,\n MERMAID_ERDIAGRAM_UUID\n )}`;\n}\n\n/**\n * Append a hyphen to a string only if the string isn't empty\n *\n * @param {string} str\n * @returns {string}\n * @todo This could be moved into a string utility file/class.\n */\nfunction strWithHyphen(str = '') {\n return str.length > 0 ? `${str}-` : '';\n}\n\nexport default {\n setConf,\n draw,\n};\n","const getStyles = (options) =>\n `\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`;\n\nexport default getStyles;\n","// @ts-ignore: TODO Fix ts errors\nimport erParser from './parser/erDiagram';\nimport erDb from './erDb';\nimport erRenderer from './erRenderer';\nimport erStyles from './styles';\n\nexport const diagram = {\n parser: erParser,\n db: erDb,\n renderer: erRenderer,\n styles: erStyles,\n};\n"],"names":["parser","o","k","v","l","$V0","$V1","$V2","$V3","$V4","$V5","$V6","$V7","$V8","$V9","$Va","$Vb","$Vc","$Vd","$Ve","$Vf","$Vg","$Vh","$Vi","$Vj","$Vk","$Vl","$Vm","yytext","yyleng","yylineno","yy","yystate","$$","_$","$0","str","hash","error","input","self","stack","tstack","vstack","lstack","table","TERROR","EOF","args","lexer","sharedState","yyloc","ranges","lex","token","symbol","state","action","r","yyval","p","len","newState","expected","errStr","ch","lines","oldLines","past","next","pre","c","match","indexed_rule","backup","tempMatch","index","rules","condition","n","yy_","$avoiding_name_collisions","YY_START","Parser","entities","relationships","Cardinality","Identification","parseDirective","statement","context","type","mermaidAPI","addEntity","name","log","getEntities","addAttributes","entityName","attribs","entity","i","addRelationship","entA","rolA","entB","rSpec","rel","getRelationships","clear","commonClear","erDb","configApi.getConfig","setAccTitle","getAccTitle","setAccDescription","getAccDescription","setDiagramTitle","getDiagramTitle","ERMarkers","insertMarkers","elem","conf","marker","erMarkers","REGEX","validate","uuid","byteToHex","unsafeStringify","arr","offset","parse","stringToBytes","bytes","DNS","URL","v35","version","hashfunc","generateUUID","value","namespace","buf","_namespace","f","s","x","y","z","ROTL","sha1","K","H","msg","N","M","j","W","t","a","b","d","e","T","v5","uuid5","BAD_ID_CHARS_REGEXP","entityNameIds","setConf","cnf","keys","key","drawAttributes","groupNode","entityTextNode","attributes","heightPadding","widthPadding","attrFontSize","labelBBox","attributeNodes","hasKeyType","hasComment","maxTypeWidth","maxNameWidth","maxKeyWidth","maxCommentWidth","cumulativeHeight","attrNum","item","attrPrefix","nodeHeight","attributeType","parseGenericTypes","typeNode","getConfig","nameNode","attributeNode","typeBBox","nameBBox","keyTypeNodeText","keyTypeNode","keyTypeBBox","commentNode","commentNodeBBox","widthPaddingFactor","maxWidth","bBox","spareColumnWidth","heightOffset","attribStyle","alignY","typeRect","nameXOffset","nameRect","keyTypeAndCommentXOffset","keyTypeRect","drawEntities","svgNode","graph","firstOne","entityId","generateId","textId","textNode","entityWidth","entityHeight","rectBBox","adjustEntities","getEdgeName","addRelationships","g","relCnt","drawRelationshipFromLayout","svg","insert","diagObj","edge","lineFunction","line","curveBasis","svgPath","url","labelPoint","labelId","draw","text","id","_version","securityLevel","sandboxElement","select","graphlib.Graph","firstEntity","dagreLayout","padding","utils","svgBounds","width","height","configureSvgSize","MERMAID_ERDIAGRAM_UUID","prefix","simplifiedStr","strWithHyphen","erRenderer","getStyles","options","erStyles","diagram","erParser"],"mappings":";;;;;;;;;;AAyEA,IAAIA,KAAU,WAAU;AACxB,MAAIC,IAAE,SAASC,GAAEC,GAAEF,GAAEG,GAAE;AAAC,SAAIH,IAAEA,KAAG,CAAE,GAACG,IAAEF,EAAE,QAAOE,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