UNPKG

588 kBJavaScriptView Raw
1(function webpackUniversalModuleDefinition(root, factory) {
2 if(typeof exports === 'object' && typeof module === 'object')
3 module.exports = factory();
4 else if(typeof define === 'function' && define.amd)
5 define([], factory);
6 else if(typeof exports === 'object')
7 exports["mermaid"] = factory();
8 else
9 root["mermaid"] = factory();
10})(window, function() {
11return /******/ (function(modules) { // webpackBootstrap
12/******/ // The module cache
13/******/ var installedModules = {};
14/******/
15/******/ // The require function
16/******/ function __webpack_require__(moduleId) {
17/******/
18/******/ // Check if module is in cache
19/******/ if(installedModules[moduleId]) {
20/******/ return installedModules[moduleId].exports;
21/******/ }
22/******/ // Create a new module (and put it into the cache)
23/******/ var module = installedModules[moduleId] = {
24/******/ i: moduleId,
25/******/ l: false,
26/******/ exports: {}
27/******/ };
28/******/
29/******/ // Execute the module function
30/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31/******/
32/******/ // Flag the module as loaded
33/******/ module.l = true;
34/******/
35/******/ // Return the exports of the module
36/******/ return module.exports;
37/******/ }
38/******/
39/******/
40/******/ // expose the modules object (__webpack_modules__)
41/******/ __webpack_require__.m = modules;
42/******/
43/******/ // expose the module cache
44/******/ __webpack_require__.c = installedModules;
45/******/
46/******/ // define getter function for harmony exports
47/******/ __webpack_require__.d = function(exports, name, getter) {
48/******/ if(!__webpack_require__.o(exports, name)) {
49/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
50/******/ }
51/******/ };
52/******/
53/******/ // define __esModule on exports
54/******/ __webpack_require__.r = function(exports) {
55/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
56/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
57/******/ }
58/******/ Object.defineProperty(exports, '__esModule', { value: true });
59/******/ };
60/******/
61/******/ // create a fake namespace object
62/******/ // mode & 1: value is a module id, require it
63/******/ // mode & 2: merge all properties of value into the ns
64/******/ // mode & 4: return value when already ns object
65/******/ // mode & 8|1: behave like require
66/******/ __webpack_require__.t = function(value, mode) {
67/******/ if(mode & 1) value = __webpack_require__(value);
68/******/ if(mode & 8) return value;
69/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
70/******/ var ns = Object.create(null);
71/******/ __webpack_require__.r(ns);
72/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
73/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
74/******/ return ns;
75/******/ };
76/******/
77/******/ // getDefaultExport function for compatibility with non-harmony modules
78/******/ __webpack_require__.n = function(module) {
79/******/ var getter = module && module.__esModule ?
80/******/ function getDefault() { return module['default']; } :
81/******/ function getModuleExports() { return module; };
82/******/ __webpack_require__.d(getter, 'a', getter);
83/******/ return getter;
84/******/ };
85/******/
86/******/ // Object.prototype.hasOwnProperty.call
87/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
88/******/
89/******/ // __webpack_public_path__
90/******/ __webpack_require__.p = "";
91/******/
92/******/
93/******/ // Load entry module and return exports
94/******/ return __webpack_require__(__webpack_require__.s = "./src/mermaidAPI.js");
95/******/ })
96/************************************************************************/
97/******/ ({
98
99/***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/themes/dark/index.scss":
100/*!*****************************************************************************************************************!*\
101 !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/themes/dark/index.scss ***!
102 \*****************************************************************************************************************/
103/*! no static exports found */
104/***/ (function(module, exports, __webpack_require__) {
105
106exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js")(false);
107// Module
108exports.push([module.i, "/* Flowchart variables */\n/* Sequence Diagram variables */\n/* Gantt chart variables */\n/* state colors */\n.label {\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n color: #333; }\n\n.label text {\n fill: #333; }\n\n.node rect,\n.node circle,\n.node ellipse,\n.node polygon,\n.node path {\n fill: #BDD5EA;\n stroke: purple;\n stroke-width: 1px; }\n\n.node .label {\n text-align: center; }\n\n.node.clickable {\n cursor: pointer; }\n\n.arrowheadPath {\n fill: lightgrey; }\n\n.edgePath .path {\n stroke: lightgrey;\n stroke-width: 1.5px; }\n\n.edgeLabel {\n background-color: #e8e8e8;\n text-align: center; }\n\n.cluster rect {\n fill: #6D6D65;\n stroke: rgba(255, 255, 255, 0.25);\n stroke-width: 1px; }\n\n.cluster text {\n fill: #F9FFFE; }\n\ndiv.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n font-size: 12px;\n background: #6D6D65;\n border: 1px solid rgba(255, 255, 255, 0.25);\n border-radius: 2px;\n pointer-events: none;\n z-index: 100; }\n\n.actor {\n stroke: #81B1DB;\n fill: #BDD5EA; }\n\ntext.actor {\n fill: black;\n stroke: none; }\n\n.actor-line {\n stroke: lightgrey; }\n\n.messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n stroke: lightgrey; }\n\n.messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n stroke: lightgrey; }\n\n#arrowhead {\n fill: lightgrey; }\n\n.sequenceNumber {\n fill: white; }\n\n#sequencenumber {\n fill: lightgrey; }\n\n#crosshead path {\n fill: lightgrey !important;\n stroke: lightgrey !important; }\n\n.messageText {\n fill: lightgrey;\n stroke: none; }\n\n.labelBox {\n stroke: #81B1DB;\n fill: #BDD5EA; }\n\n.labelText {\n fill: #323D47;\n stroke: none; }\n\n.loopText {\n fill: lightgrey;\n stroke: none; }\n\n.loopLine {\n stroke-width: 2;\n stroke-dasharray: '2 2';\n stroke: #81B1DB; }\n\n.note {\n stroke: rgba(255, 255, 255, 0.25);\n fill: #fff5ad; }\n\n.noteText {\n fill: black;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n font-size: 14px; }\n\n.activation0 {\n fill: #f4f4f4;\n stroke: #666; }\n\n.activation1 {\n fill: #f4f4f4;\n stroke: #666; }\n\n.activation2 {\n fill: #f4f4f4;\n stroke: #666; }\n\n/** Section styling */\n.mermaid-main-font {\n font-family: \"trebuchet ms\", verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.section {\n stroke: none;\n opacity: 0.2; }\n\n.section0 {\n fill: rgba(255, 255, 255, 0.3); }\n\n.section2 {\n fill: #EAE8B9; }\n\n.section1,\n.section3 {\n fill: white;\n opacity: 0.2; }\n\n.sectionTitle0 {\n fill: #F9FFFE; }\n\n.sectionTitle1 {\n fill: #F9FFFE; }\n\n.sectionTitle2 {\n fill: #F9FFFE; }\n\n.sectionTitle3 {\n fill: #F9FFFE; }\n\n.sectionTitle {\n text-anchor: start;\n font-size: 11px;\n text-height: 14px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n/* Grid and axis */\n.grid .tick {\n stroke: lightgrey;\n opacity: 0.8;\n shape-rendering: crispEdges; }\n .grid .tick text {\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.grid path {\n stroke-width: 0; }\n\n/* Today line */\n.today {\n fill: none;\n stroke: #DB5757;\n stroke-width: 2px; }\n\n/* Task styling */\n/* Default task */\n.task {\n stroke-width: 2; }\n\n.taskText {\n text-anchor: middle;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.taskText:not([font-size]) {\n font-size: 11px; }\n\n.taskTextOutsideRight {\n fill: #323D47;\n text-anchor: start;\n font-size: 11px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.taskTextOutsideLeft {\n fill: #323D47;\n text-anchor: end;\n font-size: 11px; }\n\n/* Special case clickable */\n.task.clickable {\n cursor: pointer; }\n\n.taskText.clickable {\n cursor: pointer;\n fill: #003163 !important;\n font-weight: bold; }\n\n.taskTextOutsideLeft.clickable {\n cursor: pointer;\n fill: #003163 !important;\n font-weight: bold; }\n\n.taskTextOutsideRight.clickable {\n cursor: pointer;\n fill: #003163 !important;\n font-weight: bold; }\n\n/* Specific task settings for the sections*/\n.taskText0,\n.taskText1,\n.taskText2,\n.taskText3 {\n fill: #323D47; }\n\n.task0,\n.task1,\n.task2,\n.task3 {\n fill: #BDD5EA;\n stroke: rgba(255, 255, 255, 0.5); }\n\n.taskTextOutside0,\n.taskTextOutside2 {\n fill: lightgrey; }\n\n.taskTextOutside1,\n.taskTextOutside3 {\n fill: lightgrey; }\n\n/* Active task */\n.active0,\n.active1,\n.active2,\n.active3 {\n fill: #81B1DB;\n stroke: rgba(255, 255, 255, 0.5); }\n\n.activeText0,\n.activeText1,\n.activeText2,\n.activeText3 {\n fill: #323D47 !important; }\n\n/* Completed task */\n.done0,\n.done1,\n.done2,\n.done3 {\n stroke: grey;\n fill: lightgrey;\n stroke-width: 2; }\n\n.doneText0,\n.doneText1,\n.doneText2,\n.doneText3 {\n fill: #323D47 !important; }\n\n/* Tasks on the critical line */\n.crit0,\n.crit1,\n.crit2,\n.crit3 {\n stroke: #E83737;\n fill: #E83737;\n stroke-width: 2; }\n\n.activeCrit0,\n.activeCrit1,\n.activeCrit2,\n.activeCrit3 {\n stroke: #E83737;\n fill: #81B1DB;\n stroke-width: 2; }\n\n.doneCrit0,\n.doneCrit1,\n.doneCrit2,\n.doneCrit3 {\n stroke: #E83737;\n fill: lightgrey;\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges; }\n\n.milestone {\n transform: rotate(45deg) scale(0.8, 0.8); }\n\n.milestoneText {\n font-style: italic; }\n\n.doneCritText0,\n.doneCritText1,\n.doneCritText2,\n.doneCritText3 {\n fill: #323D47 !important; }\n\n.activeCritText0,\n.activeCritText1,\n.activeCritText2,\n.activeCritText3 {\n fill: #323D47 !important; }\n\n.titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: #323D47;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\ng.classGroup text {\n fill: purple;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n font-size: 10px; }\n g.classGroup text .title {\n font-weight: bolder; }\n\ng.clickable {\n cursor: pointer; }\n\ng.classGroup rect {\n fill: #BDD5EA;\n stroke: purple; }\n\ng.classGroup line {\n stroke: purple;\n stroke-width: 1; }\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: #BDD5EA;\n opacity: 0.5; }\n\n.classLabel .label {\n fill: purple;\n font-size: 10px; }\n\n.relation {\n stroke: purple;\n stroke-width: 1;\n fill: none; }\n\n.dashed-line {\n stroke-dasharray: 3; }\n\n#compositionStart {\n fill: purple;\n stroke: purple;\n stroke-width: 1; }\n\n#compositionEnd {\n fill: purple;\n stroke: purple;\n stroke-width: 1; }\n\n#aggregationStart {\n fill: #BDD5EA;\n stroke: purple;\n stroke-width: 1; }\n\n#aggregationEnd {\n fill: #BDD5EA;\n stroke: purple;\n stroke-width: 1; }\n\n#dependencyStart {\n fill: purple;\n stroke: purple;\n stroke-width: 1; }\n\n#dependencyEnd {\n fill: purple;\n stroke: purple;\n stroke-width: 1; }\n\n#extensionStart {\n fill: purple;\n stroke: purple;\n stroke-width: 1; }\n\n#extensionEnd {\n fill: purple;\n stroke: purple;\n stroke-width: 1; }\n\n.commit-id,\n.commit-msg,\n.branch-label {\n fill: lightgrey;\n color: lightgrey;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.pieTitleText {\n text-anchor: middle;\n font-size: 25px;\n fill: #323D47;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.slice {\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\ng.stateGroup text {\n fill: purple;\n stroke: none;\n font-size: 10px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\ng.stateGroup text {\n fill: purple;\n stroke: none;\n font-size: 10px; }\n\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: black; }\n\ng.stateGroup rect {\n fill: #BDD5EA;\n stroke: purple; }\n\ng.stateGroup line {\n stroke: purple;\n stroke-width: 1; }\n\n.transition {\n stroke: purple;\n stroke-width: 1;\n fill: none; }\n\n.stateGroup .composit {\n fill: white;\n border-bottom: 1px; }\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px; }\n\n.state-note {\n stroke: rgba(255, 255, 255, 0.25);\n fill: #fff5ad; }\n .state-note text {\n fill: black;\n stroke: none;\n font-size: 10px; }\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: #BDD5EA;\n opacity: 0.5; }\n\n.stateLabel text {\n fill: black;\n font-size: 10px;\n font-weight: bold;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n:root {\n --mermaid-font-family: '\"trebuchet ms\", verdana, arial';\n --mermaid-font-family: \"Comic Sans MS\", \"Comic Sans\", cursive; }\n", ""]);
109
110
111
112/***/ }),
113
114/***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/themes/default/index.scss":
115/*!********************************************************************************************************************!*\
116 !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/themes/default/index.scss ***!
117 \********************************************************************************************************************/
118/*! no static exports found */
119/***/ (function(module, exports, __webpack_require__) {
120
121exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js")(false);
122// Module
123exports.push([module.i, "/* Flowchart variables */\n/* Sequence Diagram variables */\n/* Gantt chart variables */\n/* state colors */\n.label {\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n color: #333; }\n\n.label text {\n fill: #333; }\n\n.node rect,\n.node circle,\n.node ellipse,\n.node polygon,\n.node path {\n fill: #ECECFF;\n stroke: #9370DB;\n stroke-width: 1px; }\n\n.node .label {\n text-align: center; }\n\n.node.clickable {\n cursor: pointer; }\n\n.arrowheadPath {\n fill: #333333; }\n\n.edgePath .path {\n stroke: #333333;\n stroke-width: 1.5px; }\n\n.edgeLabel {\n background-color: #e8e8e8;\n text-align: center; }\n\n.cluster rect {\n fill: #ffffde;\n stroke: #aaaa33;\n stroke-width: 1px; }\n\n.cluster text {\n fill: #333; }\n\ndiv.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n font-size: 12px;\n background: #ffffde;\n border: 1px solid #aaaa33;\n border-radius: 2px;\n pointer-events: none;\n z-index: 100; }\n\n.actor {\n stroke: #CCCCFF;\n fill: #ECECFF; }\n\ntext.actor {\n fill: black;\n stroke: none; }\n\n.actor-line {\n stroke: grey; }\n\n.messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n stroke: #333; }\n\n.messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n stroke: #333; }\n\n#arrowhead {\n fill: #333; }\n\n.sequenceNumber {\n fill: white; }\n\n#sequencenumber {\n fill: #333; }\n\n#crosshead path {\n fill: #333 !important;\n stroke: #333 !important; }\n\n.messageText {\n fill: #333;\n stroke: none; }\n\n.labelBox {\n stroke: #CCCCFF;\n fill: #ECECFF; }\n\n.labelText {\n fill: black;\n stroke: none; }\n\n.loopText {\n fill: black;\n stroke: none; }\n\n.loopLine {\n stroke-width: 2;\n stroke-dasharray: '2 2';\n stroke: #CCCCFF; }\n\n.note {\n stroke: #aaaa33;\n fill: #fff5ad; }\n\n.noteText {\n fill: black;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n font-size: 14px; }\n\n.activation0 {\n fill: #f4f4f4;\n stroke: #666; }\n\n.activation1 {\n fill: #f4f4f4;\n stroke: #666; }\n\n.activation2 {\n fill: #f4f4f4;\n stroke: #666; }\n\n/** Section styling */\n.mermaid-main-font {\n font-family: \"trebuchet ms\", verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.section {\n stroke: none;\n opacity: 0.2; }\n\n.section0 {\n fill: rgba(102, 102, 255, 0.49); }\n\n.section2 {\n fill: #fff400; }\n\n.section1,\n.section3 {\n fill: white;\n opacity: 0.2; }\n\n.sectionTitle0 {\n fill: #333; }\n\n.sectionTitle1 {\n fill: #333; }\n\n.sectionTitle2 {\n fill: #333; }\n\n.sectionTitle3 {\n fill: #333; }\n\n.sectionTitle {\n text-anchor: start;\n font-size: 11px;\n text-height: 14px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n/* Grid and axis */\n.grid .tick {\n stroke: lightgrey;\n opacity: 0.8;\n shape-rendering: crispEdges; }\n .grid .tick text {\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.grid path {\n stroke-width: 0; }\n\n/* Today line */\n.today {\n fill: none;\n stroke: red;\n stroke-width: 2px; }\n\n/* Task styling */\n/* Default task */\n.task {\n stroke-width: 2; }\n\n.taskText {\n text-anchor: middle;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.taskText:not([font-size]) {\n font-size: 11px; }\n\n.taskTextOutsideRight {\n fill: black;\n text-anchor: start;\n font-size: 11px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.taskTextOutsideLeft {\n fill: black;\n text-anchor: end;\n font-size: 11px; }\n\n/* Special case clickable */\n.task.clickable {\n cursor: pointer; }\n\n.taskText.clickable {\n cursor: pointer;\n fill: #003163 !important;\n font-weight: bold; }\n\n.taskTextOutsideLeft.clickable {\n cursor: pointer;\n fill: #003163 !important;\n font-weight: bold; }\n\n.taskTextOutsideRight.clickable {\n cursor: pointer;\n fill: #003163 !important;\n font-weight: bold; }\n\n/* Specific task settings for the sections*/\n.taskText0,\n.taskText1,\n.taskText2,\n.taskText3 {\n fill: white; }\n\n.task0,\n.task1,\n.task2,\n.task3 {\n fill: #8a90dd;\n stroke: #534fbc; }\n\n.taskTextOutside0,\n.taskTextOutside2 {\n fill: black; }\n\n.taskTextOutside1,\n.taskTextOutside3 {\n fill: black; }\n\n/* Active task */\n.active0,\n.active1,\n.active2,\n.active3 {\n fill: #bfc7ff;\n stroke: #534fbc; }\n\n.activeText0,\n.activeText1,\n.activeText2,\n.activeText3 {\n fill: black !important; }\n\n/* Completed task */\n.done0,\n.done1,\n.done2,\n.done3 {\n stroke: grey;\n fill: lightgrey;\n stroke-width: 2; }\n\n.doneText0,\n.doneText1,\n.doneText2,\n.doneText3 {\n fill: black !important; }\n\n/* Tasks on the critical line */\n.crit0,\n.crit1,\n.crit2,\n.crit3 {\n stroke: #ff8888;\n fill: red;\n stroke-width: 2; }\n\n.activeCrit0,\n.activeCrit1,\n.activeCrit2,\n.activeCrit3 {\n stroke: #ff8888;\n fill: #bfc7ff;\n stroke-width: 2; }\n\n.doneCrit0,\n.doneCrit1,\n.doneCrit2,\n.doneCrit3 {\n stroke: #ff8888;\n fill: lightgrey;\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges; }\n\n.milestone {\n transform: rotate(45deg) scale(0.8, 0.8); }\n\n.milestoneText {\n font-style: italic; }\n\n.doneCritText0,\n.doneCritText1,\n.doneCritText2,\n.doneCritText3 {\n fill: black !important; }\n\n.activeCritText0,\n.activeCritText1,\n.activeCritText2,\n.activeCritText3 {\n fill: black !important; }\n\n.titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: black;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\ng.classGroup text {\n fill: #9370DB;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n font-size: 10px; }\n g.classGroup text .title {\n font-weight: bolder; }\n\ng.clickable {\n cursor: pointer; }\n\ng.classGroup rect {\n fill: #ECECFF;\n stroke: #9370DB; }\n\ng.classGroup line {\n stroke: #9370DB;\n stroke-width: 1; }\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: #ECECFF;\n opacity: 0.5; }\n\n.classLabel .label {\n fill: #9370DB;\n font-size: 10px; }\n\n.relation {\n stroke: #9370DB;\n stroke-width: 1;\n fill: none; }\n\n.dashed-line {\n stroke-dasharray: 3; }\n\n#compositionStart {\n fill: #9370DB;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#compositionEnd {\n fill: #9370DB;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#aggregationStart {\n fill: #ECECFF;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#aggregationEnd {\n fill: #ECECFF;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#dependencyStart {\n fill: #9370DB;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#dependencyEnd {\n fill: #9370DB;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#extensionStart {\n fill: #9370DB;\n stroke: #9370DB;\n stroke-width: 1; }\n\n#extensionEnd {\n fill: #9370DB;\n stroke: #9370DB;\n stroke-width: 1; }\n\n.commit-id,\n.commit-msg,\n.branch-label {\n fill: lightgrey;\n color: lightgrey;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.pieTitleText {\n text-anchor: middle;\n font-size: 25px;\n fill: black;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.slice {\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\ng.stateGroup text {\n fill: #9370DB;\n stroke: none;\n font-size: 10px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\ng.stateGroup text {\n fill: #9370DB;\n stroke: none;\n font-size: 10px; }\n\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: black; }\n\ng.stateGroup rect {\n fill: #ECECFF;\n stroke: #9370DB; }\n\ng.stateGroup line {\n stroke: #9370DB;\n stroke-width: 1; }\n\n.transition {\n stroke: #9370DB;\n stroke-width: 1;\n fill: none; }\n\n.stateGroup .composit {\n fill: white;\n border-bottom: 1px; }\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px; }\n\n.state-note {\n stroke: #aaaa33;\n fill: #fff5ad; }\n .state-note text {\n fill: black;\n stroke: none;\n font-size: 10px; }\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: #ECECFF;\n opacity: 0.5; }\n\n.stateLabel text {\n fill: black;\n font-size: 10px;\n font-weight: bold;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n:root {\n --mermaid-font-family: '\"trebuchet ms\", verdana, arial';\n --mermaid-font-family: \"Comic Sans MS\", \"Comic Sans\", cursive; }\n", ""]);
124
125
126
127/***/ }),
128
129/***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/themes/forest/index.scss":
130/*!*******************************************************************************************************************!*\
131 !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/themes/forest/index.scss ***!
132 \*******************************************************************************************************************/
133/*! no static exports found */
134/***/ (function(module, exports, __webpack_require__) {
135
136exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js")(false);
137// Module
138exports.push([module.i, "/* Flowchart variables */\n/* Sequence Diagram variables */\n/* Gantt chart variables */\n/* state colors */\n.label {\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n color: #333; }\n\n.label text {\n fill: #333; }\n\n.node rect,\n.node circle,\n.node ellipse,\n.node polygon,\n.node path {\n fill: #cde498;\n stroke: #13540c;\n stroke-width: 1px; }\n\n.node .label {\n text-align: center; }\n\n.node.clickable {\n cursor: pointer; }\n\n.arrowheadPath {\n fill: green; }\n\n.edgePath .path {\n stroke: green;\n stroke-width: 1.5px; }\n\n.edgeLabel {\n background-color: #e8e8e8;\n text-align: center; }\n\n.cluster rect {\n fill: #cdffb2;\n stroke: #6eaa49;\n stroke-width: 1px; }\n\n.cluster text {\n fill: #333; }\n\ndiv.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n font-size: 12px;\n background: #cdffb2;\n border: 1px solid #6eaa49;\n border-radius: 2px;\n pointer-events: none;\n z-index: 100; }\n\n.actor {\n stroke: #13540c;\n fill: #cde498; }\n\ntext.actor {\n fill: black;\n stroke: none; }\n\n.actor-line {\n stroke: grey; }\n\n.messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n stroke: #333; }\n\n.messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n stroke: #333; }\n\n#arrowhead {\n fill: #333; }\n\n.sequenceNumber {\n fill: white; }\n\n#sequencenumber {\n fill: #333; }\n\n#crosshead path {\n fill: #333 !important;\n stroke: #333 !important; }\n\n.messageText {\n fill: #333;\n stroke: none; }\n\n.labelBox {\n stroke: #326932;\n fill: #cde498; }\n\n.labelText {\n fill: black;\n stroke: none; }\n\n.loopText {\n fill: black;\n stroke: none; }\n\n.loopLine {\n stroke-width: 2;\n stroke-dasharray: '2 2';\n stroke: #326932; }\n\n.note {\n stroke: #6eaa49;\n fill: #fff5ad; }\n\n.noteText {\n fill: black;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n font-size: 14px; }\n\n.activation0 {\n fill: #f4f4f4;\n stroke: #666; }\n\n.activation1 {\n fill: #f4f4f4;\n stroke: #666; }\n\n.activation2 {\n fill: #f4f4f4;\n stroke: #666; }\n\n/** Section styling */\n.mermaid-main-font {\n font-family: \"trebuchet ms\", verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.section {\n stroke: none;\n opacity: 0.2; }\n\n.section0 {\n fill: #6eaa49; }\n\n.section2 {\n fill: #6eaa49; }\n\n.section1,\n.section3 {\n fill: white;\n opacity: 0.2; }\n\n.sectionTitle0 {\n fill: #333; }\n\n.sectionTitle1 {\n fill: #333; }\n\n.sectionTitle2 {\n fill: #333; }\n\n.sectionTitle3 {\n fill: #333; }\n\n.sectionTitle {\n text-anchor: start;\n font-size: 11px;\n text-height: 14px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n/* Grid and axis */\n.grid .tick {\n stroke: lightgrey;\n opacity: 0.8;\n shape-rendering: crispEdges; }\n .grid .tick text {\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.grid path {\n stroke-width: 0; }\n\n/* Today line */\n.today {\n fill: none;\n stroke: red;\n stroke-width: 2px; }\n\n/* Task styling */\n/* Default task */\n.task {\n stroke-width: 2; }\n\n.taskText {\n text-anchor: middle;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.taskText:not([font-size]) {\n font-size: 11px; }\n\n.taskTextOutsideRight {\n fill: black;\n text-anchor: start;\n font-size: 11px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.taskTextOutsideLeft {\n fill: black;\n text-anchor: end;\n font-size: 11px; }\n\n/* Special case clickable */\n.task.clickable {\n cursor: pointer; }\n\n.taskText.clickable {\n cursor: pointer;\n fill: #003163 !important;\n font-weight: bold; }\n\n.taskTextOutsideLeft.clickable {\n cursor: pointer;\n fill: #003163 !important;\n font-weight: bold; }\n\n.taskTextOutsideRight.clickable {\n cursor: pointer;\n fill: #003163 !important;\n font-weight: bold; }\n\n/* Specific task settings for the sections*/\n.taskText0,\n.taskText1,\n.taskText2,\n.taskText3 {\n fill: white; }\n\n.task0,\n.task1,\n.task2,\n.task3 {\n fill: #487e3a;\n stroke: #13540c; }\n\n.taskTextOutside0,\n.taskTextOutside2 {\n fill: black; }\n\n.taskTextOutside1,\n.taskTextOutside3 {\n fill: black; }\n\n/* Active task */\n.active0,\n.active1,\n.active2,\n.active3 {\n fill: #cde498;\n stroke: #13540c; }\n\n.activeText0,\n.activeText1,\n.activeText2,\n.activeText3 {\n fill: black !important; }\n\n/* Completed task */\n.done0,\n.done1,\n.done2,\n.done3 {\n stroke: grey;\n fill: lightgrey;\n stroke-width: 2; }\n\n.doneText0,\n.doneText1,\n.doneText2,\n.doneText3 {\n fill: black !important; }\n\n/* Tasks on the critical line */\n.crit0,\n.crit1,\n.crit2,\n.crit3 {\n stroke: #ff8888;\n fill: red;\n stroke-width: 2; }\n\n.activeCrit0,\n.activeCrit1,\n.activeCrit2,\n.activeCrit3 {\n stroke: #ff8888;\n fill: #cde498;\n stroke-width: 2; }\n\n.doneCrit0,\n.doneCrit1,\n.doneCrit2,\n.doneCrit3 {\n stroke: #ff8888;\n fill: lightgrey;\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges; }\n\n.milestone {\n transform: rotate(45deg) scale(0.8, 0.8); }\n\n.milestoneText {\n font-style: italic; }\n\n.doneCritText0,\n.doneCritText1,\n.doneCritText2,\n.doneCritText3 {\n fill: black !important; }\n\n.activeCritText0,\n.activeCritText1,\n.activeCritText2,\n.activeCritText3 {\n fill: black !important; }\n\n.titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: black;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\ng.classGroup text {\n fill: #13540c;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n font-size: 10px; }\n g.classGroup text .title {\n font-weight: bolder; }\n\ng.clickable {\n cursor: pointer; }\n\ng.classGroup rect {\n fill: #cde498;\n stroke: #13540c; }\n\ng.classGroup line {\n stroke: #13540c;\n stroke-width: 1; }\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: #cde498;\n opacity: 0.5; }\n\n.classLabel .label {\n fill: #13540c;\n font-size: 10px; }\n\n.relation {\n stroke: #13540c;\n stroke-width: 1;\n fill: none; }\n\n.dashed-line {\n stroke-dasharray: 3; }\n\n#compositionStart {\n fill: #13540c;\n stroke: #13540c;\n stroke-width: 1; }\n\n#compositionEnd {\n fill: #13540c;\n stroke: #13540c;\n stroke-width: 1; }\n\n#aggregationStart {\n fill: #cde498;\n stroke: #13540c;\n stroke-width: 1; }\n\n#aggregationEnd {\n fill: #cde498;\n stroke: #13540c;\n stroke-width: 1; }\n\n#dependencyStart {\n fill: #13540c;\n stroke: #13540c;\n stroke-width: 1; }\n\n#dependencyEnd {\n fill: #13540c;\n stroke: #13540c;\n stroke-width: 1; }\n\n#extensionStart {\n fill: #13540c;\n stroke: #13540c;\n stroke-width: 1; }\n\n#extensionEnd {\n fill: #13540c;\n stroke: #13540c;\n stroke-width: 1; }\n\n.commit-id,\n.commit-msg,\n.branch-label {\n fill: lightgrey;\n color: lightgrey;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.pieTitleText {\n text-anchor: middle;\n font-size: 25px;\n fill: black;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.slice {\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\ng.stateGroup text {\n fill: #13540c;\n stroke: none;\n font-size: 10px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\ng.stateGroup text {\n fill: #13540c;\n stroke: none;\n font-size: 10px; }\n\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: black; }\n\ng.stateGroup rect {\n fill: #cde498;\n stroke: #13540c; }\n\ng.stateGroup line {\n stroke: #13540c;\n stroke-width: 1; }\n\n.transition {\n stroke: #13540c;\n stroke-width: 1;\n fill: none; }\n\n.stateGroup .composit {\n fill: white;\n border-bottom: 1px; }\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px; }\n\n.state-note {\n stroke: #6eaa49;\n fill: #fff5ad; }\n .state-note text {\n fill: black;\n stroke: none;\n font-size: 10px; }\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: #cde498;\n opacity: 0.5; }\n\n.stateLabel text {\n fill: black;\n font-size: 10px;\n font-weight: bold;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n:root {\n --mermaid-font-family: '\"trebuchet ms\", verdana, arial';\n --mermaid-font-family: \"Comic Sans MS\", \"Comic Sans\", cursive; }\n", ""]);
139
140
141
142/***/ }),
143
144/***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/themes/neutral/index.scss":
145/*!********************************************************************************************************************!*\
146 !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/themes/neutral/index.scss ***!
147 \********************************************************************************************************************/
148/*! no static exports found */
149/***/ (function(module, exports, __webpack_require__) {
150
151exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js")(false);
152// Module
153exports.push([module.i, "/* Flowchart variables */\n/* Sequence Diagram variables */\n/* Gantt chart variables */\n/* state colors */\n.label {\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n color: #333; }\n\n.label text {\n fill: #333; }\n\n.node rect,\n.node circle,\n.node ellipse,\n.node polygon,\n.node path {\n fill: #eee;\n stroke: #999;\n stroke-width: 1px; }\n\n.node .label {\n text-align: center; }\n\n.node.clickable {\n cursor: pointer; }\n\n.arrowheadPath {\n fill: #333333; }\n\n.edgePath .path {\n stroke: #666;\n stroke-width: 1.5px; }\n\n.edgeLabel {\n background-color: white;\n text-align: center; }\n\n.cluster rect {\n fill: #eaf2fb;\n stroke: #26a;\n stroke-width: 1px; }\n\n.cluster text {\n fill: #333; }\n\ndiv.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n font-size: 12px;\n background: #eaf2fb;\n border: 1px solid #26a;\n border-radius: 2px;\n pointer-events: none;\n z-index: 100; }\n\n.actor {\n stroke: #999;\n fill: #eee; }\n\ntext.actor {\n fill: #333;\n stroke: none; }\n\n.actor-line {\n stroke: #666; }\n\n.messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n stroke: #333; }\n\n.messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: '2 2';\n stroke: #333; }\n\n#arrowhead {\n fill: #333; }\n\n.sequenceNumber {\n fill: white; }\n\n#sequencenumber {\n fill: #333; }\n\n#crosshead path {\n fill: #333 !important;\n stroke: #333 !important; }\n\n.messageText {\n fill: #333;\n stroke: none; }\n\n.labelBox {\n stroke: #999;\n fill: #eee; }\n\n.labelText {\n fill: #333;\n stroke: none; }\n\n.loopText {\n fill: #333;\n stroke: none; }\n\n.loopLine {\n stroke-width: 2;\n stroke-dasharray: '2 2';\n stroke: #999; }\n\n.note {\n stroke: #777700;\n fill: #ffa; }\n\n.noteText {\n fill: black;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n font-size: 14px; }\n\n.activation0 {\n fill: #f4f4f4;\n stroke: #666; }\n\n.activation1 {\n fill: #f4f4f4;\n stroke: #666; }\n\n.activation2 {\n fill: #f4f4f4;\n stroke: #666; }\n\n/** Section styling */\n.mermaid-main-font {\n font-family: \"trebuchet ms\", verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.section {\n stroke: none;\n opacity: 0.2; }\n\n.section0 {\n fill: #80b3e6; }\n\n.section2 {\n fill: #80b3e6; }\n\n.section1,\n.section3 {\n fill: white;\n opacity: 0.2; }\n\n.sectionTitle0 {\n fill: #333; }\n\n.sectionTitle1 {\n fill: #333; }\n\n.sectionTitle2 {\n fill: #333; }\n\n.sectionTitle3 {\n fill: #333; }\n\n.sectionTitle {\n text-anchor: start;\n font-size: 11px;\n text-height: 14px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n/* Grid and axis */\n.grid .tick {\n stroke: #e6e6e6;\n opacity: 0.8;\n shape-rendering: crispEdges; }\n .grid .tick text {\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.grid path {\n stroke-width: 0; }\n\n/* Today line */\n.today {\n fill: none;\n stroke: #d42;\n stroke-width: 2px; }\n\n/* Task styling */\n/* Default task */\n.task {\n stroke-width: 2; }\n\n.taskText {\n text-anchor: middle;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.taskText:not([font-size]) {\n font-size: 11px; }\n\n.taskTextOutsideRight {\n fill: #333;\n text-anchor: start;\n font-size: 11px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.taskTextOutsideLeft {\n fill: #333;\n text-anchor: end;\n font-size: 11px; }\n\n/* Special case clickable */\n.task.clickable {\n cursor: pointer; }\n\n.taskText.clickable {\n cursor: pointer;\n fill: #003163 !important;\n font-weight: bold; }\n\n.taskTextOutsideLeft.clickable {\n cursor: pointer;\n fill: #003163 !important;\n font-weight: bold; }\n\n.taskTextOutsideRight.clickable {\n cursor: pointer;\n fill: #003163 !important;\n font-weight: bold; }\n\n/* Specific task settings for the sections*/\n.taskText0,\n.taskText1,\n.taskText2,\n.taskText3 {\n fill: white; }\n\n.task0,\n.task1,\n.task2,\n.task3 {\n fill: #26a;\n stroke: #1a4d80; }\n\n.taskTextOutside0,\n.taskTextOutside2 {\n fill: #333; }\n\n.taskTextOutside1,\n.taskTextOutside3 {\n fill: #333; }\n\n/* Active task */\n.active0,\n.active1,\n.active2,\n.active3 {\n fill: #eee;\n stroke: #1a4d80; }\n\n.activeText0,\n.activeText1,\n.activeText2,\n.activeText3 {\n fill: #333 !important; }\n\n/* Completed task */\n.done0,\n.done1,\n.done2,\n.done3 {\n stroke: #666;\n fill: #bbb;\n stroke-width: 2; }\n\n.doneText0,\n.doneText1,\n.doneText2,\n.doneText3 {\n fill: #333 !important; }\n\n/* Tasks on the critical line */\n.crit0,\n.crit1,\n.crit2,\n.crit3 {\n stroke: #b1361b;\n fill: #d42;\n stroke-width: 2; }\n\n.activeCrit0,\n.activeCrit1,\n.activeCrit2,\n.activeCrit3 {\n stroke: #b1361b;\n fill: #eee;\n stroke-width: 2; }\n\n.doneCrit0,\n.doneCrit1,\n.doneCrit2,\n.doneCrit3 {\n stroke: #b1361b;\n fill: #bbb;\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges; }\n\n.milestone {\n transform: rotate(45deg) scale(0.8, 0.8); }\n\n.milestoneText {\n font-style: italic; }\n\n.doneCritText0,\n.doneCritText1,\n.doneCritText2,\n.doneCritText3 {\n fill: #333 !important; }\n\n.activeCritText0,\n.activeCritText1,\n.activeCritText2,\n.activeCritText3 {\n fill: #333 !important; }\n\n.titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: #333;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\ng.classGroup text {\n fill: #999;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family);\n font-size: 10px; }\n g.classGroup text .title {\n font-weight: bolder; }\n\ng.clickable {\n cursor: pointer; }\n\ng.classGroup rect {\n fill: #eee;\n stroke: #999; }\n\ng.classGroup line {\n stroke: #999;\n stroke-width: 1; }\n\n.classLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: #eee;\n opacity: 0.5; }\n\n.classLabel .label {\n fill: #999;\n font-size: 10px; }\n\n.relation {\n stroke: #999;\n stroke-width: 1;\n fill: none; }\n\n.dashed-line {\n stroke-dasharray: 3; }\n\n#compositionStart {\n fill: #999;\n stroke: #999;\n stroke-width: 1; }\n\n#compositionEnd {\n fill: #999;\n stroke: #999;\n stroke-width: 1; }\n\n#aggregationStart {\n fill: #eee;\n stroke: #999;\n stroke-width: 1; }\n\n#aggregationEnd {\n fill: #eee;\n stroke: #999;\n stroke-width: 1; }\n\n#dependencyStart {\n fill: #999;\n stroke: #999;\n stroke-width: 1; }\n\n#dependencyEnd {\n fill: #999;\n stroke: #999;\n stroke-width: 1; }\n\n#extensionStart {\n fill: #999;\n stroke: #999;\n stroke-width: 1; }\n\n#extensionEnd {\n fill: #999;\n stroke: #999;\n stroke-width: 1; }\n\n.commit-id,\n.commit-msg,\n.branch-label {\n fill: lightgrey;\n color: lightgrey;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.pieTitleText {\n text-anchor: middle;\n font-size: 25px;\n fill: #333;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n.slice {\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\ng.stateGroup text {\n fill: #999;\n stroke: none;\n font-size: 10px;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\ng.stateGroup text {\n fill: #999;\n stroke: none;\n font-size: 10px; }\n\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: black; }\n\ng.stateGroup rect {\n fill: #eee;\n stroke: #999; }\n\ng.stateGroup line {\n stroke: #999;\n stroke-width: 1; }\n\n.transition {\n stroke: #999;\n stroke-width: 1;\n fill: none; }\n\n.stateGroup .composit {\n fill: white;\n border-bottom: 1px; }\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px; }\n\n.state-note {\n stroke: #777700;\n fill: #ffa; }\n .state-note text {\n fill: black;\n stroke: none;\n font-size: 10px; }\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: #eee;\n opacity: 0.5; }\n\n.stateLabel text {\n fill: black;\n font-size: 10px;\n font-weight: bold;\n font-family: 'trebuchet ms', verdana, arial;\n font-family: var(--mermaid-font-family); }\n\n:root {\n --mermaid-font-family: '\"trebuchet ms\", verdana, arial';\n --mermaid-font-family: \"Comic Sans MS\", \"Comic Sans\", cursive; }\n", ""]);
154
155
156
157/***/ }),
158
159/***/ "./node_modules/css-loader/dist/runtime/api.js":
160/*!*****************************************************!*\
161 !*** ./node_modules/css-loader/dist/runtime/api.js ***!
162 \*****************************************************/
163/*! no static exports found */
164/***/ (function(module, exports, __webpack_require__) {
165
166"use strict";
167
168
169/*
170 MIT License http://www.opensource.org/licenses/mit-license.php
171 Author Tobias Koppers @sokra
172*/
173// css base code, injected by the css-loader
174module.exports = function (useSourceMap) {
175 var list = []; // return the list of modules as css string
176
177 list.toString = function toString() {
178 return this.map(function (item) {
179 var content = cssWithMappingToString(item, useSourceMap);
180
181 if (item[2]) {
182 return '@media ' + item[2] + '{' + content + '}';
183 } else {
184 return content;
185 }
186 }).join('');
187 }; // import a list of modules into the list
188
189
190 list.i = function (modules, mediaQuery) {
191 if (typeof modules === 'string') {
192 modules = [[null, modules, '']];
193 }
194
195 var alreadyImportedModules = {};
196
197 for (var i = 0; i < this.length; i++) {
198 var id = this[i][0];
199
200 if (id != null) {
201 alreadyImportedModules[id] = true;
202 }
203 }
204
205 for (i = 0; i < modules.length; i++) {
206 var item = modules[i]; // skip already imported module
207 // this implementation is not 100% perfect for weird media query combinations
208 // when a module is imported multiple times with different media queries.
209 // I hope this will never occur (Hey this way we have smaller bundles)
210
211 if (item[0] == null || !alreadyImportedModules[item[0]]) {
212 if (mediaQuery && !item[2]) {
213 item[2] = mediaQuery;
214 } else if (mediaQuery) {
215 item[2] = '(' + item[2] + ') and (' + mediaQuery + ')';
216 }
217
218 list.push(item);
219 }
220 }
221 };
222
223 return list;
224};
225
226function cssWithMappingToString(item, useSourceMap) {
227 var content = item[1] || '';
228 var cssMapping = item[3];
229
230 if (!cssMapping) {
231 return content;
232 }
233
234 if (useSourceMap && typeof btoa === 'function') {
235 var sourceMapping = toComment(cssMapping);
236 var sourceURLs = cssMapping.sources.map(function (source) {
237 return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */';
238 });
239 return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
240 }
241
242 return [content].join('\n');
243} // Adapted from convert-source-map (MIT)
244
245
246function toComment(sourceMap) {
247 // eslint-disable-next-line no-undef
248 var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
249 var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
250 return '/*# ' + data + ' */';
251}
252
253/***/ }),
254
255/***/ "./node_modules/node-libs-browser/mock/empty.js":
256/*!******************************************************!*\
257 !*** ./node_modules/node-libs-browser/mock/empty.js ***!
258 \******************************************************/
259/*! no static exports found */
260/***/ (function(module, exports) {
261
262
263
264/***/ }),
265
266/***/ "./node_modules/path-browserify/index.js":
267/*!***********************************************!*\
268 !*** ./node_modules/path-browserify/index.js ***!
269 \***********************************************/
270/*! no static exports found */
271/***/ (function(module, exports, __webpack_require__) {
272
273/* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,
274// backported and transplited with Babel, with backwards-compat fixes
275
276// Copyright Joyent, Inc. and other Node contributors.
277//
278// Permission is hereby granted, free of charge, to any person obtaining a
279// copy of this software and associated documentation files (the
280// "Software"), to deal in the Software without restriction, including
281// without limitation the rights to use, copy, modify, merge, publish,
282// distribute, sublicense, and/or sell copies of the Software, and to permit
283// persons to whom the Software is furnished to do so, subject to the
284// following conditions:
285//
286// The above copyright notice and this permission notice shall be included
287// in all copies or substantial portions of the Software.
288//
289// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
290// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
291// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
292// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
293// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
294// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
295// USE OR OTHER DEALINGS IN THE SOFTWARE.
296
297// resolves . and .. elements in a path array with directory names there
298// must be no slashes, empty elements, or device names (c:\) in the array
299// (so also no leading and trailing slashes - it does not distinguish
300// relative and absolute paths)
301function normalizeArray(parts, allowAboveRoot) {
302 // if the path tries to go above the root, `up` ends up > 0
303 var up = 0;
304 for (var i = parts.length - 1; i >= 0; i--) {
305 var last = parts[i];
306 if (last === '.') {
307 parts.splice(i, 1);
308 } else if (last === '..') {
309 parts.splice(i, 1);
310 up++;
311 } else if (up) {
312 parts.splice(i, 1);
313 up--;
314 }
315 }
316
317 // if the path is allowed to go above the root, restore leading ..s
318 if (allowAboveRoot) {
319 for (; up--; up) {
320 parts.unshift('..');
321 }
322 }
323
324 return parts;
325}
326
327// path.resolve([from ...], to)
328// posix version
329exports.resolve = function() {
330 var resolvedPath = '',
331 resolvedAbsolute = false;
332
333 for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
334 var path = (i >= 0) ? arguments[i] : process.cwd();
335
336 // Skip empty and invalid entries
337 if (typeof path !== 'string') {
338 throw new TypeError('Arguments to path.resolve must be strings');
339 } else if (!path) {
340 continue;
341 }
342
343 resolvedPath = path + '/' + resolvedPath;
344 resolvedAbsolute = path.charAt(0) === '/';
345 }
346
347 // At this point the path should be resolved to a full absolute path, but
348 // handle relative paths to be safe (might happen when process.cwd() fails)
349
350 // Normalize the path
351 resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
352 return !!p;
353 }), !resolvedAbsolute).join('/');
354
355 return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
356};
357
358// path.normalize(path)
359// posix version
360exports.normalize = function(path) {
361 var isAbsolute = exports.isAbsolute(path),
362 trailingSlash = substr(path, -1) === '/';
363
364 // Normalize the path
365 path = normalizeArray(filter(path.split('/'), function(p) {
366 return !!p;
367 }), !isAbsolute).join('/');
368
369 if (!path && !isAbsolute) {
370 path = '.';
371 }
372 if (path && trailingSlash) {
373 path += '/';
374 }
375
376 return (isAbsolute ? '/' : '') + path;
377};
378
379// posix version
380exports.isAbsolute = function(path) {
381 return path.charAt(0) === '/';
382};
383
384// posix version
385exports.join = function() {
386 var paths = Array.prototype.slice.call(arguments, 0);
387 return exports.normalize(filter(paths, function(p, index) {
388 if (typeof p !== 'string') {
389 throw new TypeError('Arguments to path.join must be strings');
390 }
391 return p;
392 }).join('/'));
393};
394
395
396// path.relative(from, to)
397// posix version
398exports.relative = function(from, to) {
399 from = exports.resolve(from).substr(1);
400 to = exports.resolve(to).substr(1);
401
402 function trim(arr) {
403 var start = 0;
404 for (; start < arr.length; start++) {
405 if (arr[start] !== '') break;
406 }
407
408 var end = arr.length - 1;
409 for (; end >= 0; end--) {
410 if (arr[end] !== '') break;
411 }
412
413 if (start > end) return [];
414 return arr.slice(start, end - start + 1);
415 }
416
417 var fromParts = trim(from.split('/'));
418 var toParts = trim(to.split('/'));
419
420 var length = Math.min(fromParts.length, toParts.length);
421 var samePartsLength = length;
422 for (var i = 0; i < length; i++) {
423 if (fromParts[i] !== toParts[i]) {
424 samePartsLength = i;
425 break;
426 }
427 }
428
429 var outputParts = [];
430 for (var i = samePartsLength; i < fromParts.length; i++) {
431 outputParts.push('..');
432 }
433
434 outputParts = outputParts.concat(toParts.slice(samePartsLength));
435
436 return outputParts.join('/');
437};
438
439exports.sep = '/';
440exports.delimiter = ':';
441
442exports.dirname = function (path) {
443 if (typeof path !== 'string') path = path + '';
444 if (path.length === 0) return '.';
445 var code = path.charCodeAt(0);
446 var hasRoot = code === 47 /*/*/;
447 var end = -1;
448 var matchedSlash = true;
449 for (var i = path.length - 1; i >= 1; --i) {
450 code = path.charCodeAt(i);
451 if (code === 47 /*/*/) {
452 if (!matchedSlash) {
453 end = i;
454 break;
455 }
456 } else {
457 // We saw the first non-path separator
458 matchedSlash = false;
459 }
460 }
461
462 if (end === -1) return hasRoot ? '/' : '.';
463 if (hasRoot && end === 1) {
464 // return '//';
465 // Backwards-compat fix:
466 return '/';
467 }
468 return path.slice(0, end);
469};
470
471function basename(path) {
472 if (typeof path !== 'string') path = path + '';
473
474 var start = 0;
475 var end = -1;
476 var matchedSlash = true;
477 var i;
478
479 for (i = path.length - 1; i >= 0; --i) {
480 if (path.charCodeAt(i) === 47 /*/*/) {
481 // If we reached a path separator that was not part of a set of path
482 // separators at the end of the string, stop now
483 if (!matchedSlash) {
484 start = i + 1;
485 break;
486 }
487 } else if (end === -1) {
488 // We saw the first non-path separator, mark this as the end of our
489 // path component
490 matchedSlash = false;
491 end = i + 1;
492 }
493 }
494
495 if (end === -1) return '';
496 return path.slice(start, end);
497}
498
499// Uses a mixed approach for backwards-compatibility, as ext behavior changed
500// in new Node.js versions, so only basename() above is backported here
501exports.basename = function (path, ext) {
502 var f = basename(path);
503 if (ext && f.substr(-1 * ext.length) === ext) {
504 f = f.substr(0, f.length - ext.length);
505 }
506 return f;
507};
508
509exports.extname = function (path) {
510 if (typeof path !== 'string') path = path + '';
511 var startDot = -1;
512 var startPart = 0;
513 var end = -1;
514 var matchedSlash = true;
515 // Track the state of characters (if any) we see before our first dot and
516 // after any path separator we find
517 var preDotState = 0;
518 for (var i = path.length - 1; i >= 0; --i) {
519 var code = path.charCodeAt(i);
520 if (code === 47 /*/*/) {
521 // If we reached a path separator that was not part of a set of path
522 // separators at the end of the string, stop now
523 if (!matchedSlash) {
524 startPart = i + 1;
525 break;
526 }
527 continue;
528 }
529 if (end === -1) {
530 // We saw the first non-path separator, mark this as the end of our
531 // extension
532 matchedSlash = false;
533 end = i + 1;
534 }
535 if (code === 46 /*.*/) {
536 // If this is our first dot, mark it as the start of our extension
537 if (startDot === -1)
538 startDot = i;
539 else if (preDotState !== 1)
540 preDotState = 1;
541 } else if (startDot !== -1) {
542 // We saw a non-dot and non-path separator before our dot, so we should
543 // have a good chance at having a non-empty extension
544 preDotState = -1;
545 }
546 }
547
548 if (startDot === -1 || end === -1 ||
549 // We saw a non-dot character immediately before the dot
550 preDotState === 0 ||
551 // The (right-most) trimmed path component is exactly '..'
552 preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
553 return '';
554 }
555 return path.slice(startDot, end);
556};
557
558function filter (xs, f) {
559 if (xs.filter) return xs.filter(f);
560 var res = [];
561 for (var i = 0; i < xs.length; i++) {
562 if (f(xs[i], i, xs)) res.push(xs[i]);
563 }
564 return res;
565}
566
567// String.prototype.substr - negative index don't work in IE8
568var substr = 'ab'.substr(-1) === 'b'
569 ? function (str, start, len) { return str.substr(start, len) }
570 : function (str, start, len) {
571 if (start < 0) start = str.length + start;
572 return str.substr(start, len);
573 }
574;
575
576/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ "./node_modules/process/browser.js")))
577
578/***/ }),
579
580/***/ "./node_modules/process/browser.js":
581/*!*****************************************!*\
582 !*** ./node_modules/process/browser.js ***!
583 \*****************************************/
584/*! no static exports found */
585/***/ (function(module, exports) {
586
587// shim for using process in browser
588var process = module.exports = {};
589
590// cached from whatever global is present so that test runners that stub it
591// don't break things. But we need to wrap it in a try catch in case it is
592// wrapped in strict mode code which doesn't define any globals. It's inside a
593// function because try/catches deoptimize in certain engines.
594
595var cachedSetTimeout;
596var cachedClearTimeout;
597
598function defaultSetTimout() {
599 throw new Error('setTimeout has not been defined');
600}
601function defaultClearTimeout () {
602 throw new Error('clearTimeout has not been defined');
603}
604(function () {
605 try {
606 if (typeof setTimeout === 'function') {
607 cachedSetTimeout = setTimeout;
608 } else {
609 cachedSetTimeout = defaultSetTimout;
610 }
611 } catch (e) {
612 cachedSetTimeout = defaultSetTimout;
613 }
614 try {
615 if (typeof clearTimeout === 'function') {
616 cachedClearTimeout = clearTimeout;
617 } else {
618 cachedClearTimeout = defaultClearTimeout;
619 }
620 } catch (e) {
621 cachedClearTimeout = defaultClearTimeout;
622 }
623} ())
624function runTimeout(fun) {
625 if (cachedSetTimeout === setTimeout) {
626 //normal enviroments in sane situations
627 return setTimeout(fun, 0);
628 }
629 // if setTimeout wasn't available but was latter defined
630 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
631 cachedSetTimeout = setTimeout;
632 return setTimeout(fun, 0);
633 }
634 try {
635 // when when somebody has screwed with setTimeout but no I.E. maddness
636 return cachedSetTimeout(fun, 0);
637 } catch(e){
638 try {
639 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
640 return cachedSetTimeout.call(null, fun, 0);
641 } catch(e){
642 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
643 return cachedSetTimeout.call(this, fun, 0);
644 }
645 }
646
647
648}
649function runClearTimeout(marker) {
650 if (cachedClearTimeout === clearTimeout) {
651 //normal enviroments in sane situations
652 return clearTimeout(marker);
653 }
654 // if clearTimeout wasn't available but was latter defined
655 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
656 cachedClearTimeout = clearTimeout;
657 return clearTimeout(marker);
658 }
659 try {
660 // when when somebody has screwed with setTimeout but no I.E. maddness
661 return cachedClearTimeout(marker);
662 } catch (e){
663 try {
664 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
665 return cachedClearTimeout.call(null, marker);
666 } catch (e){
667 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
668 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
669 return cachedClearTimeout.call(this, marker);
670 }
671 }
672
673
674
675}
676var queue = [];
677var draining = false;
678var currentQueue;
679var queueIndex = -1;
680
681function cleanUpNextTick() {
682 if (!draining || !currentQueue) {
683 return;
684 }
685 draining = false;
686 if (currentQueue.length) {
687 queue = currentQueue.concat(queue);
688 } else {
689 queueIndex = -1;
690 }
691 if (queue.length) {
692 drainQueue();
693 }
694}
695
696function drainQueue() {
697 if (draining) {
698 return;
699 }
700 var timeout = runTimeout(cleanUpNextTick);
701 draining = true;
702
703 var len = queue.length;
704 while(len) {
705 currentQueue = queue;
706 queue = [];
707 while (++queueIndex < len) {
708 if (currentQueue) {
709 currentQueue[queueIndex].run();
710 }
711 }
712 queueIndex = -1;
713 len = queue.length;
714 }
715 currentQueue = null;
716 draining = false;
717 runClearTimeout(timeout);
718}
719
720process.nextTick = function (fun) {
721 var args = new Array(arguments.length - 1);
722 if (arguments.length > 1) {
723 for (var i = 1; i < arguments.length; i++) {
724 args[i - 1] = arguments[i];
725 }
726 }
727 queue.push(new Item(fun, args));
728 if (queue.length === 1 && !draining) {
729 runTimeout(drainQueue);
730 }
731};
732
733// v8 likes predictible objects
734function Item(fun, array) {
735 this.fun = fun;
736 this.array = array;
737}
738Item.prototype.run = function () {
739 this.fun.apply(null, this.array);
740};
741process.title = 'browser';
742process.browser = true;
743process.env = {};
744process.argv = [];
745process.version = ''; // empty string to avoid regexp issues
746process.versions = {};
747
748function noop() {}
749
750process.on = noop;
751process.addListener = noop;
752process.once = noop;
753process.off = noop;
754process.removeListener = noop;
755process.removeAllListeners = noop;
756process.emit = noop;
757process.prependListener = noop;
758process.prependOnceListener = noop;
759
760process.listeners = function (name) { return [] }
761
762process.binding = function (name) {
763 throw new Error('process.binding is not supported');
764};
765
766process.cwd = function () { return '/' };
767process.chdir = function (dir) {
768 throw new Error('process.chdir is not supported');
769};
770process.umask = function() { return 0; };
771
772
773/***/ }),
774
775/***/ "./node_modules/webpack/buildin/module.js":
776/*!***********************************!*\
777 !*** (webpack)/buildin/module.js ***!
778 \***********************************/
779/*! no static exports found */
780/***/ (function(module, exports) {
781
782module.exports = function(module) {
783 if (!module.webpackPolyfill) {
784 module.deprecate = function() {};
785 module.paths = [];
786 // module.parent = undefined by default
787 if (!module.children) module.children = [];
788 Object.defineProperty(module, "loaded", {
789 enumerable: true,
790 get: function() {
791 return module.l;
792 }
793 });
794 Object.defineProperty(module, "id", {
795 enumerable: true,
796 get: function() {
797 return module.i;
798 }
799 });
800 module.webpackPolyfill = 1;
801 }
802 return module;
803};
804
805
806/***/ }),
807
808/***/ "./package.json":
809/*!**********************!*\
810 !*** ./package.json ***!
811 \**********************/
812/*! exports provided: name, version, description, main, keywords, scripts, repository, author, license, standard, dependencies, devDependencies, files, yarn-upgrade-all, default */
813/***/ (function(module) {
814
815module.exports = JSON.parse("{\"name\":\"mermaid\",\"version\":\"8.4.4\",\"description\":\"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.\",\"main\":\"dist/mermaid.core.js\",\"keywords\":[\"diagram\",\"markdown\",\"flowchart\",\"sequence diagram\",\"gantt\",\"class diagram\",\"git graph\"],\"scripts\":{\"build\":\"webpack --progress --colors\",\"postbuild\":\"documentation build src/mermaidAPI.js --shallow -f md --markdown-toc false -o docs/mermaidAPI.md\",\"build:watch\":\"yarn build --watch\",\"minify\":\"minify ./dist/mermaid.js > ./dist/mermaid.min.js\",\"release\":\"yarn build -p --config webpack.config.prod.babel.js\",\"lint\":\"eslint src\",\"e2e:depr\":\"yarn lint && jest e2e --config e2e/jest.config.js\",\"cypress\":\"percy exec -- cypress run\",\"e2e\":\"start-server-and-test dev http://localhost:9000/ cypress\",\"e2e-upd\":\"yarn lint && jest e2e -u --config e2e/jest.config.js\",\"dev\":\"webpack-dev-server --config webpack.config.e2e.js\",\"test\":\"yarn lint && jest src/.*\",\"test:watch\":\"jest --watch src\",\"prepublishOnly\":\"yarn build && yarn release && yarn test && yarn e2e\",\"prepush\":\"yarn test\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/knsv/mermaid\"},\"author\":\"Knut Sveidqvist\",\"license\":\"MIT\",\"standard\":{\"ignore\":[\"**/parser/*.js\",\"dist/**/*.js\",\"cypress/**/*.js\"],\"globals\":[\"page\"]},\"dependencies\":{\"@braintree/sanitize-url\":\"^3.1.0\",\"crypto-random-string\":\"^3.0.1\",\"d3\":\"^5.7.0\",\"dagre\":\"^0.8.4\",\"dagre-d3\":\"^0.6.4\",\"graphlib\":\"^2.1.7\",\"he\":\"^1.2.0\",\"lodash\":\"^4.17.11\",\"minify\":\"^4.1.1\",\"moment-mini\":\"^2.22.1\",\"scope-css\":\"^1.2.1\"},\"devDependencies\":{\"@babel/core\":\"^7.2.2\",\"@babel/preset-env\":\"^7.2.0\",\"@babel/register\":\"^7.0.0\",\"@percy/cypress\":\"^2.0.1\",\"babel-core\":\"7.0.0-bridge.0\",\"babel-jest\":\"^24.9.0\",\"babel-loader\":\"^8.0.4\",\"coveralls\":\"^3.0.2\",\"css-loader\":\"^2.0.1\",\"css-to-string-loader\":\"^0.1.3\",\"cypress\":\"3.4.0\",\"documentation\":\"^12.0.1\",\"eslint\":\"^6.3.0\",\"eslint-config-prettier\":\"^6.3.0\",\"eslint-plugin-prettier\":\"^3.1.0\",\"husky\":\"^1.2.1\",\"identity-obj-proxy\":\"^3.0.0\",\"jest\":\"^24.9.0\",\"jison\":\"^0.4.18\",\"moment\":\"^2.23.0\",\"node-sass\":\"^4.12.0\",\"prettier\":\"^1.18.2\",\"puppeteer\":\"^1.17.0\",\"sass-loader\":\"^7.1.0\",\"start-server-and-test\":\"^1.10.6\",\"terser-webpack-plugin\":\"^2.2.2\",\"webpack\":\"^4.41.2\",\"webpack-cli\":\"^3.1.2\",\"webpack-dev-server\":\"^3.4.1\",\"webpack-node-externals\":\"^1.7.2\",\"yarn-upgrade-all\":\"^0.5.0\"},\"files\":[\"dist\"],\"yarn-upgrade-all\":{\"ignore\":[\"babel-core\"]}}");
816
817/***/ }),
818
819/***/ "./src/config.js":
820/*!***********************!*\
821 !*** ./src/config.js ***!
822 \***********************/
823/*! exports provided: setConfig, getConfig, default */
824/***/ (function(module, __webpack_exports__, __webpack_require__) {
825
826"use strict";
827__webpack_require__.r(__webpack_exports__);
828/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConfig", function() { return setConfig; });
829/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getConfig", function() { return getConfig; });
830function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
831
832var config = {};
833
834var setConf = function setConf(cnf) {
835 // Top level initially mermaid, gflow, sequenceDiagram and gantt
836 var lvl1Keys = Object.keys(cnf);
837
838 for (var i = 0; i < lvl1Keys.length; i++) {
839 if (_typeof(cnf[lvl1Keys[i]]) === 'object' && cnf[lvl1Keys[i]] != null) {
840 var lvl2Keys = Object.keys(cnf[lvl1Keys[i]]);
841
842 for (var j = 0; j < lvl2Keys.length; j++) {
843 // logger.debug('Setting conf ', lvl1Keys[i], '-', lvl2Keys[j])
844 if (typeof config[lvl1Keys[i]] === 'undefined') {
845 config[lvl1Keys[i]] = {};
846 } // logger.debug('Setting config: ' + lvl1Keys[i] + ' ' + lvl2Keys[j] + ' to ' + cnf[lvl1Keys[i]][lvl2Keys[j]])
847
848
849 config[lvl1Keys[i]][lvl2Keys[j]] = cnf[lvl1Keys[i]][lvl2Keys[j]];
850 }
851 } else {
852 config[lvl1Keys[i]] = cnf[lvl1Keys[i]];
853 }
854 }
855};
856
857var setConfig = function setConfig(conf) {
858 setConf(conf);
859};
860var getConfig = function getConfig() {
861 return config;
862};
863var configApi = {
864 setConfig: setConfig,
865 getConfig: getConfig // get conf() {
866 // return config;
867 // }
868
869};
870/* harmony default export */ __webpack_exports__["default"] = (configApi);
871
872/***/ }),
873
874/***/ "./src/diagrams/class/classDb.js":
875/*!***************************************!*\
876 !*** ./src/diagrams/class/classDb.js ***!
877 \***************************************/
878/*! exports provided: addClass, clear, getClass, getClasses, getRelations, addRelation, addAnnotation, addMember, addMembers, cleanupLabel, setCssClass, setLink, setClickEvent, bindFunctions, lineType, relationType, default */
879/***/ (function(module, __webpack_exports__, __webpack_require__) {
880
881"use strict";
882__webpack_require__.r(__webpack_exports__);
883/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addClass", function() { return addClass; });
884/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clear", function() { return clear; });
885/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClass", function() { return getClass; });
886/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClasses", function() { return getClasses; });
887/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRelations", function() { return getRelations; });
888/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addRelation", function() { return addRelation; });
889/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addAnnotation", function() { return addAnnotation; });
890/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addMember", function() { return addMember; });
891/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addMembers", function() { return addMembers; });
892/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cleanupLabel", function() { return cleanupLabel; });
893/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setCssClass", function() { return setCssClass; });
894/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLink", function() { return setLink; });
895/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setClickEvent", function() { return setClickEvent; });
896/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bindFunctions", function() { return bindFunctions; });
897/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lineType", function() { return lineType; });
898/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "relationType", function() { return relationType; });
899/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
900/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
901/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
902/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../config */ "./src/config.js");
903/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils */ "./src/utils.js");
904
905
906
907
908var MERMAID_DOM_ID_PREFIX = 'classid-';
909var config = Object(_config__WEBPACK_IMPORTED_MODULE_2__["getConfig"])();
910var relations = [];
911var classes = {};
912var funs = [];
913
914var splitClassNameAndType = function splitClassNameAndType(id) {
915 var genericType = '';
916 var className = id;
917
918 if (id.indexOf('~') > 0) {
919 var split = id.split('~');
920 className = split[0];
921 genericType = split[1];
922 }
923
924 return {
925 className: className,
926 type: genericType
927 };
928};
929/**
930 * Function called by parser when a node definition has been found.
931 * @param id
932 * @public
933 */
934
935
936var addClass = function addClass(id) {
937 var classId = splitClassNameAndType(id); // Only add class if not exists
938
939 if (typeof classes[classId.className] !== 'undefined') return;
940 classes[classId.className] = {
941 id: classId.className,
942 type: classId.type,
943 cssClasses: [],
944 methods: [],
945 members: [],
946 annotations: []
947 };
948};
949var clear = function clear() {
950 relations = [];
951 classes = {};
952 funs = [];
953 funs.push(setupToolTips);
954};
955var getClass = function getClass(id) {
956 return classes[id];
957};
958var getClasses = function getClasses() {
959 return classes;
960};
961var getRelations = function getRelations() {
962 return relations;
963};
964var addRelation = function addRelation(relation) {
965 _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug('Adding relation: ' + JSON.stringify(relation));
966 addClass(relation.id1);
967 addClass(relation.id2);
968 relation.id1 = splitClassNameAndType(relation.id1).className;
969 relation.id2 = splitClassNameAndType(relation.id2).className;
970 relations.push(relation);
971};
972/**
973 * Adds an annotation to the specified class
974 * Annotations mark special properties of the given type (like 'interface' or 'service')
975 * @param className The class name
976 * @param annotation The name of the annotation without any brackets
977 * @public
978 */
979
980var addAnnotation = function addAnnotation(className, annotation) {
981 var validatedClassName = splitClassNameAndType(className).className;
982 classes[validatedClassName].annotations.push(annotation);
983};
984/**
985 * Adds a member to the specified class
986 * @param className The class name
987 * @param member The full name of the member.
988 * If the member is enclosed in <<brackets>> it is treated as an annotation
989 * If the member is ending with a closing bracket ) it is treated as a method
990 * Otherwise the member will be treated as a normal property
991 * @public
992 */
993
994var addMember = function addMember(className, member) {
995 var validatedClassName = splitClassNameAndType(className).className;
996 var theClass = classes[validatedClassName];
997
998 if (typeof member === 'string') {
999 // Member can contain white spaces, we trim them out
1000 var memberString = member.trim();
1001
1002 if (memberString.startsWith('<<') && memberString.endsWith('>>')) {
1003 // Remove leading and trailing brackets
1004 theClass.annotations.push(memberString.substring(2, memberString.length - 2));
1005 } else if (memberString.indexOf(')') > 0) {
1006 theClass.methods.push(memberString);
1007 } else if (memberString) {
1008 theClass.members.push(memberString);
1009 }
1010 }
1011};
1012var addMembers = function addMembers(className, members) {
1013 if (Array.isArray(members)) {
1014 members.reverse();
1015 members.forEach(function (member) {
1016 return addMember(className, member);
1017 });
1018 }
1019};
1020var cleanupLabel = function cleanupLabel(label) {
1021 if (label.substring(0, 1) === ':') {
1022 return label.substr(2).trim();
1023 } else {
1024 return label.trim();
1025 }
1026};
1027/**
1028 * Called by parser when a special node is found, e.g. a clickable element.
1029 * @param ids Comma separated list of ids
1030 * @param className Class to add
1031 */
1032
1033var setCssClass = function setCssClass(ids, className) {
1034 ids.split(',').forEach(function (_id) {
1035 var id = _id;
1036 if (_id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id;
1037
1038 if (typeof classes[id] !== 'undefined') {
1039 classes[id].cssClasses.push(className);
1040 }
1041 });
1042};
1043/**
1044 * Called by parser when a link is found. Adds the URL to the vertex data.
1045 * @param ids Comma separated list of ids
1046 * @param linkStr URL to create a link for
1047 * @param tooltip Tooltip for the clickable element
1048 */
1049
1050var setLink = function setLink(ids, linkStr, tooltip) {
1051 ids.split(',').forEach(function (_id) {
1052 var id = _id;
1053 if (_id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id;
1054
1055 if (typeof classes[id] !== 'undefined') {
1056 classes[id].link = _utils__WEBPACK_IMPORTED_MODULE_3__["default"].formatUrl(linkStr, config);
1057
1058 if (tooltip) {
1059 classes[id].tooltip = _utils__WEBPACK_IMPORTED_MODULE_3__["default"].sanitize(tooltip, config);
1060 }
1061 }
1062 });
1063 setCssClass(ids, 'clickable');
1064};
1065/**
1066 * Called by parser when a click definition is found. Registers an event handler.
1067 * @param ids Comma separated list of ids
1068 * @param functionName Function to be called on click
1069 * @param tooltip Tooltip for the clickable element
1070 */
1071
1072var setClickEvent = function setClickEvent(ids, functionName, tooltip) {
1073 ids.split(',').forEach(function (id) {
1074 setClickFunc(id, functionName, tooltip);
1075 });
1076 setCssClass(ids, 'clickable');
1077};
1078
1079var setClickFunc = function setClickFunc(_id, functionName, tooltip) {
1080 var id = _id;
1081 var elemId = MERMAID_DOM_ID_PREFIX + id;
1082
1083 if (config.securityLevel !== 'loose') {
1084 return;
1085 }
1086
1087 if (typeof functionName === 'undefined') {
1088 return;
1089 }
1090
1091 if (typeof classes[id] !== 'undefined') {
1092 if (tooltip) {
1093 classes[id].tooltip = _utils__WEBPACK_IMPORTED_MODULE_3__["default"].sanitize(tooltip, config);
1094 }
1095
1096 funs.push(function () {
1097 var elem = document.querySelector("[id=\"".concat(elemId, "\"]"));
1098
1099 if (elem !== null) {
1100 elem.addEventListener('click', function () {
1101 window[functionName](elemId);
1102 }, false);
1103 }
1104 });
1105 }
1106};
1107
1108var bindFunctions = function bindFunctions(element) {
1109 funs.forEach(function (fun) {
1110 fun(element);
1111 });
1112};
1113var lineType = {
1114 LINE: 0,
1115 DOTTED_LINE: 1
1116};
1117var relationType = {
1118 AGGREGATION: 0,
1119 EXTENSION: 1,
1120 COMPOSITION: 2,
1121 DEPENDENCY: 3
1122};
1123
1124var setupToolTips = function setupToolTips(element) {
1125 var tooltipElem = d3__WEBPACK_IMPORTED_MODULE_0__["select"]('.mermaidTooltip');
1126
1127 if ((tooltipElem._groups || tooltipElem)[0][0] === null) {
1128 tooltipElem = d3__WEBPACK_IMPORTED_MODULE_0__["select"]('body').append('div').attr('class', 'mermaidTooltip').style('opacity', 0);
1129 }
1130
1131 var svg = d3__WEBPACK_IMPORTED_MODULE_0__["select"](element).select('svg');
1132 var nodes = svg.selectAll('g.node');
1133 nodes.on('mouseover', function () {
1134 var el = d3__WEBPACK_IMPORTED_MODULE_0__["select"](this);
1135 var title = el.attr('title'); // Dont try to draw a tooltip if no data is provided
1136
1137 if (title === null) {
1138 return;
1139 }
1140
1141 var rect = this.getBoundingClientRect();
1142 tooltipElem.transition().duration(200).style('opacity', '.9');
1143 tooltipElem.html(el.attr('title')).style('left', rect.left + (rect.right - rect.left) / 2 + 'px').style('top', rect.top - 14 + document.body.scrollTop + 'px');
1144 el.classed('hover', true);
1145 }).on('mouseout', function () {
1146 tooltipElem.transition().duration(500).style('opacity', 0);
1147 var el = d3__WEBPACK_IMPORTED_MODULE_0__["select"](this);
1148 el.classed('hover', false);
1149 });
1150};
1151
1152funs.push(setupToolTips);
1153/* harmony default export */ __webpack_exports__["default"] = ({
1154 addClass: addClass,
1155 bindFunctions: bindFunctions,
1156 clear: clear,
1157 getClass: getClass,
1158 getClasses: getClasses,
1159 addAnnotation: addAnnotation,
1160 getRelations: getRelations,
1161 addRelation: addRelation,
1162 addMember: addMember,
1163 addMembers: addMembers,
1164 cleanupLabel: cleanupLabel,
1165 lineType: lineType,
1166 relationType: relationType,
1167 setClickEvent: setClickEvent,
1168 setCssClass: setCssClass,
1169 setLink: setLink
1170});
1171
1172/***/ }),
1173
1174/***/ "./src/diagrams/class/classRenderer.js":
1175/*!*********************************************!*\
1176 !*** ./src/diagrams/class/classRenderer.js ***!
1177 \*********************************************/
1178/*! exports provided: setConf, draw, default */
1179/***/ (function(module, __webpack_exports__, __webpack_require__) {
1180
1181"use strict";
1182__webpack_require__.r(__webpack_exports__);
1183/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; });
1184/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; });
1185/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
1186/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
1187/* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dagre */ "dagre");
1188/* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dagre__WEBPACK_IMPORTED_MODULE_1__);
1189/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! graphlib */ "graphlib");
1190/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(graphlib__WEBPACK_IMPORTED_MODULE_2__);
1191/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
1192/* harmony import */ var _classDb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./classDb */ "./src/diagrams/class/classDb.js");
1193/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils */ "./src/utils.js");
1194/* harmony import */ var _parser_classDiagram__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./parser/classDiagram */ "./src/diagrams/class/parser/classDiagram.jison");
1195/* harmony import */ var _parser_classDiagram__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_parser_classDiagram__WEBPACK_IMPORTED_MODULE_6__);
1196
1197
1198
1199
1200
1201
1202
1203_parser_classDiagram__WEBPACK_IMPORTED_MODULE_6__["parser"].yy = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"];
1204var MERMAID_DOM_ID_PREFIX = 'classid-';
1205var idCache = {};
1206var conf = {
1207 dividerMargin: 10,
1208 padding: 5,
1209 textHeight: 10
1210}; // Todo optimize
1211
1212var getGraphId = function getGraphId(label) {
1213 var keys = Object.keys(idCache);
1214
1215 for (var i = 0; i < keys.length; i++) {
1216 if (idCache[keys[i]].label === label) {
1217 return keys[i];
1218 }
1219 }
1220
1221 return undefined;
1222};
1223/**
1224 * Setup arrow head and define the marker. The result is appended to the svg.
1225 */
1226
1227
1228var insertMarkers = function insertMarkers(elem) {
1229 elem.append('defs').append('marker').attr('id', 'extensionStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 1,7 L18,13 V 1 Z');
1230 elem.append('defs').append('marker').attr('id', 'extensionEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 1,1 V 13 L18,7 Z'); // this is actual shape for arrowhead
1231
1232 elem.append('defs').append('marker').attr('id', 'compositionStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');
1233 elem.append('defs').append('marker').attr('id', 'compositionEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');
1234 elem.append('defs').append('marker').attr('id', 'aggregationStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');
1235 elem.append('defs').append('marker').attr('id', 'aggregationEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');
1236 elem.append('defs').append('marker').attr('id', 'dependencyStart').attr('class', 'extension').attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 5,7 L9,13 L1,7 L9,1 Z');
1237 elem.append('defs').append('marker').attr('id', 'dependencyEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L14,7 L9,1 Z');
1238};
1239
1240var edgeCount = 0;
1241
1242var drawEdge = function drawEdge(elem, path, relation) {
1243 var getRelationType = function getRelationType(type) {
1244 switch (type) {
1245 case _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].relationType.AGGREGATION:
1246 return 'aggregation';
1247
1248 case _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].relationType.EXTENSION:
1249 return 'extension';
1250
1251 case _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].relationType.COMPOSITION:
1252 return 'composition';
1253
1254 case _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].relationType.DEPENDENCY:
1255 return 'dependency';
1256 }
1257 };
1258
1259 path.points = path.points.filter(function (p) {
1260 return !Number.isNaN(p.y);
1261 }); // The data for our line
1262
1263 var lineData = path.points; // This is the accessor function we talked about above
1264
1265 var lineFunction = d3__WEBPACK_IMPORTED_MODULE_0__["line"]().x(function (d) {
1266 return d.x;
1267 }).y(function (d) {
1268 return d.y;
1269 }).curve(d3__WEBPACK_IMPORTED_MODULE_0__["curveBasis"]);
1270 var svgPath = elem.append('path').attr('d', lineFunction(lineData)).attr('id', 'edge' + edgeCount).attr('class', 'relation');
1271 var url = '';
1272
1273 if (conf.arrowMarkerAbsolute) {
1274 url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search;
1275 url = url.replace(/\(/g, '\\(');
1276 url = url.replace(/\)/g, '\\)');
1277 }
1278
1279 if (relation.relation.lineType == 1) {
1280 svgPath.attr('class', 'relation dashed-line');
1281 }
1282
1283 if (relation.relation.type1 !== 'none') {
1284 svgPath.attr('marker-start', 'url(' + url + '#' + getRelationType(relation.relation.type1) + 'Start' + ')');
1285 }
1286
1287 if (relation.relation.type2 !== 'none') {
1288 svgPath.attr('marker-end', 'url(' + url + '#' + getRelationType(relation.relation.type2) + 'End' + ')');
1289 }
1290
1291 var x, y;
1292 var l = path.points.length; // Calculate Label position
1293
1294 var labalPosition = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].calcLabelPosition(path.points);
1295 x = labalPosition.x;
1296 y = labalPosition.y;
1297 var p1_card_x, p1_card_y; // p1_card_padd_x = conf.padding * 2,
1298 // p1_card_padd_y = conf.padding;
1299
1300 var p2_card_x, p2_card_y; // p2_card_padd_x = conf.padding * 2,
1301 // p2_card_padd_y = -conf.padding / 2;
1302
1303 if (l % 2 !== 0 && l > 1) {
1304 var cardinality_1_point = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].calcCardinalityPosition(relation.relation.type1 !== 'none', path.points, path.points[0]);
1305 var cardinality_2_point = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].calcCardinalityPosition(relation.relation.type2 !== 'none', path.points, path.points[l - 1]);
1306 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('cardinality_1_point ' + JSON.stringify(cardinality_1_point));
1307 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('cardinality_2_point ' + JSON.stringify(cardinality_2_point));
1308 p1_card_x = cardinality_1_point.x;
1309 p1_card_y = cardinality_1_point.y;
1310 p2_card_x = cardinality_2_point.x;
1311 p2_card_y = cardinality_2_point.y;
1312 }
1313
1314 if (typeof relation.title !== 'undefined') {
1315 var g = elem.append('g').attr('class', 'classLabel');
1316 var label = g.append('text').attr('class', 'label').attr('x', x).attr('y', y).attr('fill', 'red').attr('text-anchor', 'middle').text(relation.title);
1317 window.label = label;
1318 var bounds = label.node().getBBox();
1319 g.insert('rect', ':first-child').attr('class', 'box').attr('x', bounds.x - conf.padding / 2).attr('y', bounds.y - conf.padding / 2).attr('width', bounds.width + conf.padding).attr('height', bounds.height + conf.padding);
1320 }
1321
1322 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('Rendering relation ' + JSON.stringify(relation));
1323
1324 if (typeof relation.relationTitle1 !== 'undefined' && relation.relationTitle1 !== 'none') {
1325 var _g = elem.append('g').attr('class', 'cardinality');
1326
1327 _g.append('text').attr('class', 'type1').attr('x', p1_card_x).attr('y', p1_card_y).attr('fill', 'black').attr('font-size', '6').text(relation.relationTitle1);
1328 }
1329
1330 if (typeof relation.relationTitle2 !== 'undefined' && relation.relationTitle2 !== 'none') {
1331 var _g2 = elem.append('g').attr('class', 'cardinality');
1332
1333 _g2.append('text').attr('class', 'type2').attr('x', p2_card_x).attr('y', p2_card_y).attr('fill', 'black').attr('font-size', '6').text(relation.relationTitle2);
1334 }
1335
1336 edgeCount++;
1337};
1338
1339var drawClass = function drawClass(elem, classDef) {
1340 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('Rendering class ' + classDef);
1341 var cssClassStr = 'classGroup ';
1342
1343 if (classDef.cssClasses.length > 0) {
1344 cssClassStr = cssClassStr + classDef.cssClasses.join(' ');
1345 }
1346
1347 var addTspan = function addTspan(textEl, txt, isFirst) {
1348 var displayText = txt;
1349 var cssStyle = '';
1350 var methodEnd = txt.indexOf(')') + 1;
1351
1352 if (methodEnd > 1 && methodEnd <= txt.length) {
1353 var classifier = txt.substring(methodEnd);
1354
1355 switch (classifier) {
1356 case '*':
1357 cssStyle = 'font-style:italic;';
1358 break;
1359
1360 case '$':
1361 cssStyle = 'text-decoration:underline;';
1362 break;
1363 }
1364
1365 displayText = txt.substring(0, methodEnd);
1366 }
1367
1368 var tSpan = textEl.append('tspan').attr('x', conf.padding).text(displayText);
1369
1370 if (cssStyle !== '') {
1371 tSpan.attr('style', cssStyle);
1372 }
1373
1374 if (!isFirst) {
1375 tSpan.attr('dy', conf.textHeight);
1376 }
1377 };
1378
1379 var id = MERMAID_DOM_ID_PREFIX + classDef.id;
1380 var classInfo = {
1381 id: id,
1382 label: classDef.id,
1383 width: 0,
1384 height: 0
1385 }; // add class group
1386
1387 var g = elem.append('g').attr('id', id).attr('class', cssClassStr); // add title
1388
1389 var title;
1390
1391 if (classDef.link) {
1392 title = g.append('svg:a').attr('xlink:href', classDef.link).attr('target', '_blank').append('text').attr('y', conf.textHeight + conf.padding).attr('x', 0);
1393 } else {
1394 title = g.append('text').attr('y', conf.textHeight + conf.padding).attr('x', 0);
1395 } // add annotations
1396
1397
1398 var isFirst = true;
1399 classDef.annotations.forEach(function (member) {
1400 var titleText2 = title.append('tspan').text('«' + member + '»');
1401 if (!isFirst) titleText2.attr('dy', conf.textHeight);
1402 isFirst = false;
1403 });
1404 var classTitleString = classDef.id;
1405
1406 if (classDef.type !== undefined && classDef.type !== '') {
1407 classTitleString += '<' + classDef.type + '>';
1408 }
1409
1410 var classTitle = title.append('tspan').text(classTitleString).attr('class', 'title'); // If class has annotations the title needs to have an offset of the text height
1411
1412 if (!isFirst) classTitle.attr('dy', conf.textHeight);
1413 var titleHeight = title.node().getBBox().height;
1414 var membersLine = g.append('line') // text label for the x axis
1415 .attr('x1', 0).attr('y1', conf.padding + titleHeight + conf.dividerMargin / 2).attr('y2', conf.padding + titleHeight + conf.dividerMargin / 2);
1416 var members = g.append('text') // text label for the x axis
1417 .attr('x', conf.padding).attr('y', titleHeight + conf.dividerMargin + conf.textHeight).attr('fill', 'white').attr('class', 'classText');
1418 isFirst = true;
1419 classDef.members.forEach(function (member) {
1420 addTspan(members, member, isFirst);
1421 isFirst = false;
1422 });
1423 var membersBox = members.node().getBBox();
1424 var methodsLine = g.append('line') // text label for the x axis
1425 .attr('x1', 0).attr('y1', conf.padding + titleHeight + conf.dividerMargin + membersBox.height).attr('y2', conf.padding + titleHeight + conf.dividerMargin + membersBox.height);
1426 var methods = g.append('text') // text label for the x axis
1427 .attr('x', conf.padding).attr('y', titleHeight + 2 * conf.dividerMargin + membersBox.height + conf.textHeight).attr('fill', 'white').attr('class', 'classText');
1428 isFirst = true;
1429 classDef.methods.forEach(function (method) {
1430 addTspan(methods, method, isFirst);
1431 isFirst = false;
1432 });
1433 var classBox = g.node().getBBox();
1434 var rect = g.insert('rect', ':first-child').attr('x', 0).attr('y', 0).attr('width', classBox.width + 2 * conf.padding).attr('height', classBox.height + conf.padding + 0.5 * conf.dividerMargin);
1435 var rectWidth = rect.node().getBBox().width; // Center title
1436 // We subtract the width of each text element from the class box width and divide it by 2
1437
1438 title.node().childNodes.forEach(function (x) {
1439 x.setAttribute('x', (rectWidth - x.getBBox().width) / 2);
1440 });
1441
1442 if (classDef.tooltip) {
1443 title.insert('title').text(classDef.tooltip);
1444 }
1445
1446 membersLine.attr('x2', rectWidth);
1447 methodsLine.attr('x2', rectWidth);
1448 classInfo.width = rectWidth;
1449 classInfo.height = classBox.height + conf.padding + 0.5 * conf.dividerMargin;
1450 idCache[id] = classInfo;
1451 return classInfo;
1452};
1453
1454var setConf = function setConf(cnf) {
1455 var keys = Object.keys(cnf);
1456 keys.forEach(function (key) {
1457 conf[key] = cnf[key];
1458 });
1459};
1460/**
1461 * Draws a flowchart in the tag with id: id based on the graph definition in text.
1462 * @param text
1463 * @param id
1464 */
1465
1466var draw = function draw(text, id) {
1467 idCache = {};
1468 _parser_classDiagram__WEBPACK_IMPORTED_MODULE_6__["parser"].yy.clear();
1469 _parser_classDiagram__WEBPACK_IMPORTED_MODULE_6__["parser"].parse(text);
1470 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('Rendering diagram ' + text); /// / Fetch the default direction, use TD if none was found
1471
1472 var diagram = d3__WEBPACK_IMPORTED_MODULE_0__["select"]("[id='".concat(id, "']"));
1473 insertMarkers(diagram); // Layout graph, Create a new directed graph
1474
1475 var g = new graphlib__WEBPACK_IMPORTED_MODULE_2___default.a.Graph({
1476 multigraph: true
1477 }); // Set an object for the graph label
1478
1479 g.setGraph({
1480 isMultiGraph: true
1481 }); // Default to assigning a new object as a label for each new edge.
1482
1483 g.setDefaultEdgeLabel(function () {
1484 return {};
1485 });
1486 var classes = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].getClasses();
1487 var keys = Object.keys(classes);
1488
1489 for (var i = 0; i < keys.length; i++) {
1490 var classDef = classes[keys[i]];
1491 var node = drawClass(diagram, classDef); // Add nodes to the graph. The first argument is the node id. The second is
1492 // metadata about the node. In this case we're going to add labels to each of
1493 // our nodes.
1494
1495 g.setNode(node.id, node);
1496 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('Org height: ' + node.height);
1497 }
1498
1499 var relations = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].getRelations();
1500 relations.forEach(function (relation) {
1501 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('tjoho' + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation));
1502 g.setEdge(getGraphId(relation.id1), getGraphId(relation.id2), {
1503 relation: relation
1504 });
1505 });
1506 dagre__WEBPACK_IMPORTED_MODULE_1___default.a.layout(g);
1507 g.nodes().forEach(function (v) {
1508 if (typeof v !== 'undefined' && typeof g.node(v) !== 'undefined') {
1509 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Node ' + v + ': ' + JSON.stringify(g.node(v)));
1510 d3__WEBPACK_IMPORTED_MODULE_0__["select"]('#' + v).attr('transform', 'translate(' + (g.node(v).x - g.node(v).width / 2) + ',' + (g.node(v).y - g.node(v).height / 2) + ' )');
1511 }
1512 });
1513 g.edges().forEach(function (e) {
1514 if (typeof e !== 'undefined' && typeof g.edge(e) !== 'undefined') {
1515 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(g.edge(e)));
1516 drawEdge(diagram, g.edge(e), g.edge(e).relation);
1517 }
1518 });
1519 diagram.attr('height', '100%');
1520 diagram.attr('width', "".concat(g.graph().width * 1.5 + 20));
1521 diagram.attr('viewBox', '-10 -10 ' + (g.graph().width + 20) + ' ' + (g.graph().height + 20));
1522};
1523/* harmony default export */ __webpack_exports__["default"] = ({
1524 setConf: setConf,
1525 draw: draw
1526});
1527
1528/***/ }),
1529
1530/***/ "./src/diagrams/class/parser/classDiagram.jison":
1531/*!******************************************************!*\
1532 !*** ./src/diagrams/class/parser/classDiagram.jison ***!
1533 \******************************************************/
1534/*! no static exports found */
1535/***/ (function(module, exports, __webpack_require__) {
1536
1537/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */
1538/*
1539 Returns a Parser object of the following structure:
1540
1541 Parser: {
1542 yy: {}
1543 }
1544
1545 Parser.prototype: {
1546 yy: {},
1547 trace: function(),
1548 symbols_: {associative list: name ==> number},
1549 terminals_: {associative list: number ==> name},
1550 productions_: [...],
1551 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
1552 table: [...],
1553 defaultActions: {...},
1554 parseError: function(str, hash),
1555 parse: function(input),
1556
1557 lexer: {
1558 EOF: 1,
1559 parseError: function(str, hash),
1560 setInput: function(input),
1561 input: function(),
1562 unput: function(str),
1563 more: function(),
1564 less: function(n),
1565 pastInput: function(),
1566 upcomingInput: function(),
1567 showPosition: function(),
1568 test_match: function(regex_match_array, rule_index),
1569 next: function(),
1570 lex: function(),
1571 begin: function(condition),
1572 popState: function(),
1573 _currentRules: function(),
1574 topState: function(),
1575 pushState: function(condition),
1576
1577 options: {
1578 ranges: boolean (optional: true ==> token location info will include a .range[] member)
1579 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
1580 backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
1581 },
1582
1583 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
1584 rules: [...],
1585 conditions: {associative list: name ==> set},
1586 }
1587 }
1588
1589
1590 token location info (@$, _$, etc.): {
1591 first_line: n,
1592 last_line: n,
1593 first_column: n,
1594 last_column: n,
1595 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
1596 }
1597
1598
1599 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
1600 text: (matched text)
1601 token: (the produced terminal token, if any)
1602 line: (yylineno)
1603 }
1604 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
1605 loc: (yylloc)
1606 expected: (string describing the set of expected tokens)
1607 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
1608 }
1609*/
1610var parser = (function(){
1611var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,13],$V1=[1,16],$V2=[1,14],$V3=[1,15],$V4=[1,17],$V5=[1,18],$V6=[1,20],$V7=[1,21],$V8=[1,22],$V9=[6,8],$Va=[1,31],$Vb=[1,32],$Vc=[1,33],$Vd=[1,34],$Ve=[1,35],$Vf=[1,36],$Vg=[6,8,14,20,28,31,32,33,34,35,36],$Vh=[6,8,12,14,20,24,28,31,32,33,34,35,36,52,53,54],$Vi=[28,52,53,54],$Vj=[28,35,36,52,53,54],$Vk=[28,31,32,33,34,52,53,54],$Vl=[6,8,14],$Vm=[1,59];
1612var parser = {trace: function trace () { },
1613yy: {},
1614symbols_: {"error":2,"mermaidDoc":3,"graphConfig":4,"CLASS_DIAGRAM":5,"NEWLINE":6,"statements":7,"EOF":8,"statement":9,"className":10,"alphaNumToken":11,"GENERICTYPE":12,"relationStatement":13,"LABEL":14,"classStatement":15,"methodStatement":16,"annotationStatement":17,"clickStatement":18,"CLASS":19,"STRUCT_START":20,"members":21,"STRUCT_STOP":22,"ANNOTATION_START":23,"ANNOTATION_END":24,"MEMBER":25,"SEPARATOR":26,"relation":27,"STR":28,"relationType":29,"lineType":30,"AGGREGATION":31,"EXTENSION":32,"COMPOSITION":33,"DEPENDENCY":34,"LINE":35,"DOTTED_LINE":36,"CALLBACK":37,"LINK":38,"commentToken":39,"textToken":40,"graphCodeTokens":41,"textNoTagsToken":42,"TAGSTART":43,"TAGEND":44,"==":45,"--":46,"PCT":47,"DEFAULT":48,"SPACE":49,"MINUS":50,"keywords":51,"UNICODE_TEXT":52,"NUM":53,"ALPHA":54,"$accept":0,"$end":1},
1615terminals_: {2:"error",5:"CLASS_DIAGRAM",6:"NEWLINE",8:"EOF",12:"GENERICTYPE",14:"LABEL",19:"CLASS",20:"STRUCT_START",22:"STRUCT_STOP",23:"ANNOTATION_START",24:"ANNOTATION_END",25:"MEMBER",26:"SEPARATOR",28:"STR",31:"AGGREGATION",32:"EXTENSION",33:"COMPOSITION",34:"DEPENDENCY",35:"LINE",36:"DOTTED_LINE",37:"CALLBACK",38:"LINK",41:"graphCodeTokens",43:"TAGSTART",44:"TAGEND",45:"==",46:"--",47:"PCT",48:"DEFAULT",49:"SPACE",50:"MINUS",51:"keywords",52:"UNICODE_TEXT",53:"NUM",54:"ALPHA"},
1616productions_: [0,[3,1],[4,4],[7,1],[7,2],[7,3],[10,2],[10,1],[10,3],[10,2],[9,1],[9,2],[9,1],[9,1],[9,1],[9,1],[15,2],[15,5],[17,4],[21,1],[21,2],[16,1],[16,2],[16,1],[16,1],[13,3],[13,4],[13,4],[13,5],[27,3],[27,2],[27,2],[27,1],[29,1],[29,1],[29,1],[29,1],[30,1],[30,1],[18,3],[18,4],[18,3],[18,4],[39,1],[39,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[42,1],[42,1],[42,1],[42,1],[11,1],[11,1],[11,1]],
1617performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
1618/* this == yyval */
1619
1620var $0 = $$.length - 1;
1621switch (yystate) {
1622case 6:
1623 this.$=$$[$0-1]+$$[$0];
1624break;
1625case 7:
1626 this.$=$$[$0];
1627break;
1628case 8:
1629 this.$=$$[$0-2]+'~'+$$[$0-1]+$$[$0];
1630break;
1631case 9:
1632 this.$=$$[$0-1]+'~'+$$[$0];
1633break;
1634case 10:
1635 yy.addRelation($$[$0]);
1636break;
1637case 11:
1638 $$[$0-1].title = yy.cleanupLabel($$[$0]); yy.addRelation($$[$0-1]);
1639break;
1640case 16:
1641yy.addClass($$[$0]);
1642break;
1643case 17:
1644/*console.log($$[$0-3],JSON.stringify($$[$0-1]));*/yy.addClass($$[$0-3]);yy.addMembers($$[$0-3],$$[$0-1]);
1645break;
1646case 18:
1647 yy.addAnnotation($$[$0],$$[$0-2]);
1648break;
1649case 19:
1650 this.$ = [$$[$0]];
1651break;
1652case 20:
1653 $$[$0].push($$[$0-1]);this.$=$$[$0];
1654break;
1655case 21:
1656/*console.log('Rel found',$$[$0]);*/
1657break;
1658case 22:
1659yy.addMember($$[$0-1],yy.cleanupLabel($$[$0]));
1660break;
1661case 23:
1662/*console.warn('Member',$$[$0]);*/
1663break;
1664case 24:
1665/*console.log('sep found',$$[$0]);*/
1666break;
1667case 25:
1668 this.$ = {'id1':$$[$0-2],'id2':$$[$0], relation:$$[$0-1], relationTitle1:'none', relationTitle2:'none'};
1669break;
1670case 26:
1671 this.$ = {id1:$$[$0-3], id2:$$[$0], relation:$$[$0-1], relationTitle1:$$[$0-2], relationTitle2:'none'}
1672break;
1673case 27:
1674 this.$ = {id1:$$[$0-3], id2:$$[$0], relation:$$[$0-2], relationTitle1:'none', relationTitle2:$$[$0-1]};
1675break;
1676case 28:
1677 this.$ = {id1:$$[$0-4], id2:$$[$0], relation:$$[$0-2], relationTitle1:$$[$0-3], relationTitle2:$$[$0-1]}
1678break;
1679case 29:
1680 this.$={type1:$$[$0-2],type2:$$[$0],lineType:$$[$0-1]};
1681break;
1682case 30:
1683 this.$={type1:'none',type2:$$[$0],lineType:$$[$0-1]};
1684break;
1685case 31:
1686 this.$={type1:$$[$0-1],type2:'none',lineType:$$[$0]};
1687break;
1688case 32:
1689 this.$={type1:'none',type2:'none',lineType:$$[$0]};
1690break;
1691case 33:
1692 this.$=yy.relationType.AGGREGATION;
1693break;
1694case 34:
1695 this.$=yy.relationType.EXTENSION;
1696break;
1697case 35:
1698 this.$=yy.relationType.COMPOSITION;
1699break;
1700case 36:
1701 this.$=yy.relationType.DEPENDENCY;
1702break;
1703case 37:
1704this.$=yy.lineType.LINE;
1705break;
1706case 38:
1707this.$=yy.lineType.DOTTED_LINE;
1708break;
1709case 39:
1710this.$ = $$[$0-2];yy.setClickEvent($$[$0-1], $$[$0], undefined);
1711break;
1712case 40:
1713this.$ = $$[$0-3];yy.setClickEvent($$[$0-2], $$[$0-1], $$[$0]);
1714break;
1715case 41:
1716this.$ = $$[$0-2];yy.setLink($$[$0-1], $$[$0], undefined);
1717break;
1718case 42:
1719this.$ = $$[$0-3];yy.setLink($$[$0-2], $$[$0-1], $$[$0]);
1720break;
1721}
1722},
1723table: [{3:1,4:2,5:[1,3]},{1:[3]},{1:[2,1]},{6:[1,4]},{7:5,9:6,10:12,11:19,13:7,15:8,16:9,17:10,18:11,19:$V0,23:$V1,25:$V2,26:$V3,37:$V4,38:$V5,52:$V6,53:$V7,54:$V8},{8:[1,23]},{6:[1,24],8:[2,3]},o($V9,[2,10],{14:[1,25]}),o($V9,[2,12]),o($V9,[2,13]),o($V9,[2,14]),o($V9,[2,15]),o($V9,[2,21],{27:26,29:29,30:30,14:[1,28],28:[1,27],31:$Va,32:$Vb,33:$Vc,34:$Vd,35:$Ve,36:$Vf}),{10:37,11:19,52:$V6,53:$V7,54:$V8},o($V9,[2,23]),o($V9,[2,24]),{11:38,52:$V6,53:$V7,54:$V8},{10:39,11:19,52:$V6,53:$V7,54:$V8},{10:40,11:19,52:$V6,53:$V7,54:$V8},o($Vg,[2,7],{11:19,10:41,12:[1,42],52:$V6,53:$V7,54:$V8}),o($Vh,[2,56]),o($Vh,[2,57]),o($Vh,[2,58]),{1:[2,2]},{7:43,8:[2,4],9:6,10:12,11:19,13:7,15:8,16:9,17:10,18:11,19:$V0,23:$V1,25:$V2,26:$V3,37:$V4,38:$V5,52:$V6,53:$V7,54:$V8},o($V9,[2,11]),{10:44,11:19,28:[1,45],52:$V6,53:$V7,54:$V8},{27:46,29:29,30:30,31:$Va,32:$Vb,33:$Vc,34:$Vd,35:$Ve,36:$Vf},o($V9,[2,22]),{30:47,35:$Ve,36:$Vf},o($Vi,[2,32],{29:48,31:$Va,32:$Vb,33:$Vc,34:$Vd}),o($Vj,[2,33]),o($Vj,[2,34]),o($Vj,[2,35]),o($Vj,[2,36]),o($Vk,[2,37]),o($Vk,[2,38]),o($V9,[2,16],{20:[1,49]}),{24:[1,50]},{28:[1,51]},{28:[1,52]},o($Vg,[2,6]),o($Vg,[2,9],{11:19,10:53,52:$V6,53:$V7,54:$V8}),{8:[2,5]},o($Vl,[2,25]),{10:54,11:19,52:$V6,53:$V7,54:$V8},{10:55,11:19,28:[1,56],52:$V6,53:$V7,54:$V8},o($Vi,[2,31],{29:57,31:$Va,32:$Vb,33:$Vc,34:$Vd}),o($Vi,[2,30]),{21:58,25:$Vm},{10:60,11:19,52:$V6,53:$V7,54:$V8},o($V9,[2,39],{28:[1,61]}),o($V9,[2,41],{28:[1,62]}),o($Vg,[2,8]),o($Vl,[2,27]),o($Vl,[2,26]),{10:63,11:19,52:$V6,53:$V7,54:$V8},o($Vi,[2,29]),{22:[1,64]},{21:65,22:[2,19],25:$Vm},o($V9,[2,18]),o($V9,[2,40]),o($V9,[2,42]),o($Vl,[2,28]),o($V9,[2,17]),{22:[2,20]}],
1724defaultActions: {2:[2,1],23:[2,2],43:[2,5],65:[2,20]},
1725parseError: function parseError (str, hash) {
1726 if (hash.recoverable) {
1727 this.trace(str);
1728 } else {
1729 var error = new Error(str);
1730 error.hash = hash;
1731 throw error;
1732 }
1733},
1734parse: function parse(input) {
1735 var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
1736 var args = lstack.slice.call(arguments, 1);
1737 var lexer = Object.create(this.lexer);
1738 var sharedState = { yy: {} };
1739 for (var k in this.yy) {
1740 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
1741 sharedState.yy[k] = this.yy[k];
1742 }
1743 }
1744 lexer.setInput(input, sharedState.yy);
1745 sharedState.yy.lexer = lexer;
1746 sharedState.yy.parser = this;
1747 if (typeof lexer.yylloc == 'undefined') {
1748 lexer.yylloc = {};
1749 }
1750 var yyloc = lexer.yylloc;
1751 lstack.push(yyloc);
1752 var ranges = lexer.options && lexer.options.ranges;
1753 if (typeof sharedState.yy.parseError === 'function') {
1754 this.parseError = sharedState.yy.parseError;
1755 } else {
1756 this.parseError = Object.getPrototypeOf(this).parseError;
1757 }
1758 function popStack(n) {
1759 stack.length = stack.length - 2 * n;
1760 vstack.length = vstack.length - n;
1761 lstack.length = lstack.length - n;
1762 }
1763 function lex() {
1764 var token;
1765 token = tstack.pop() || lexer.lex() || EOF;
1766 if (typeof token !== 'number') {
1767 if (token instanceof Array) {
1768 tstack = token;
1769 token = tstack.pop();
1770 }
1771 token = self.symbols_[token] || token;
1772 }
1773 return token;
1774 }
1775 var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
1776 while (true) {
1777 state = stack[stack.length - 1];
1778 if (this.defaultActions[state]) {
1779 action = this.defaultActions[state];
1780 } else {
1781 if (symbol === null || typeof symbol == 'undefined') {
1782 symbol = lex();
1783 }
1784 action = table[state] && table[state][symbol];
1785 }
1786 if (typeof action === 'undefined' || !action.length || !action[0]) {
1787 var errStr = '';
1788 expected = [];
1789 for (p in table[state]) {
1790 if (this.terminals_[p] && p > TERROR) {
1791 expected.push('\'' + this.terminals_[p] + '\'');
1792 }
1793 }
1794 if (lexer.showPosition) {
1795 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
1796 } else {
1797 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
1798 }
1799 this.parseError(errStr, {
1800 text: lexer.match,
1801 token: this.terminals_[symbol] || symbol,
1802 line: lexer.yylineno,
1803 loc: yyloc,
1804 expected: expected
1805 });
1806 }
1807 if (action[0] instanceof Array && action.length > 1) {
1808 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
1809 }
1810 switch (action[0]) {
1811 case 1:
1812 stack.push(symbol);
1813 vstack.push(lexer.yytext);
1814 lstack.push(lexer.yylloc);
1815 stack.push(action[1]);
1816 symbol = null;
1817 if (!preErrorSymbol) {
1818 yyleng = lexer.yyleng;
1819 yytext = lexer.yytext;
1820 yylineno = lexer.yylineno;
1821 yyloc = lexer.yylloc;
1822 if (recovering > 0) {
1823 recovering--;
1824 }
1825 } else {
1826 symbol = preErrorSymbol;
1827 preErrorSymbol = null;
1828 }
1829 break;
1830 case 2:
1831 len = this.productions_[action[1]][1];
1832 yyval.$ = vstack[vstack.length - len];
1833 yyval._$ = {
1834 first_line: lstack[lstack.length - (len || 1)].first_line,
1835 last_line: lstack[lstack.length - 1].last_line,
1836 first_column: lstack[lstack.length - (len || 1)].first_column,
1837 last_column: lstack[lstack.length - 1].last_column
1838 };
1839 if (ranges) {
1840 yyval._$.range = [
1841 lstack[lstack.length - (len || 1)].range[0],
1842 lstack[lstack.length - 1].range[1]
1843 ];
1844 }
1845 r = this.performAction.apply(yyval, [
1846 yytext,
1847 yyleng,
1848 yylineno,
1849 sharedState.yy,
1850 action[1],
1851 vstack,
1852 lstack
1853 ].concat(args));
1854 if (typeof r !== 'undefined') {
1855 return r;
1856 }
1857 if (len) {
1858 stack = stack.slice(0, -1 * len * 2);
1859 vstack = vstack.slice(0, -1 * len);
1860 lstack = lstack.slice(0, -1 * len);
1861 }
1862 stack.push(this.productions_[action[1]][0]);
1863 vstack.push(yyval.$);
1864 lstack.push(yyval._$);
1865 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
1866 stack.push(newState);
1867 break;
1868 case 3:
1869 return true;
1870 }
1871 }
1872 return true;
1873}};
1874
1875/* generated by jison-lex 0.3.4 */
1876var lexer = (function(){
1877var lexer = ({
1878
1879EOF:1,
1880
1881parseError:function parseError(str, hash) {
1882 if (this.yy.parser) {
1883 this.yy.parser.parseError(str, hash);
1884 } else {
1885 throw new Error(str);
1886 }
1887 },
1888
1889// resets the lexer, sets new input
1890setInput:function (input, yy) {
1891 this.yy = yy || this.yy || {};
1892 this._input = input;
1893 this._more = this._backtrack = this.done = false;
1894 this.yylineno = this.yyleng = 0;
1895 this.yytext = this.matched = this.match = '';
1896 this.conditionStack = ['INITIAL'];
1897 this.yylloc = {
1898 first_line: 1,
1899 first_column: 0,
1900 last_line: 1,
1901 last_column: 0
1902 };
1903 if (this.options.ranges) {
1904 this.yylloc.range = [0,0];
1905 }
1906 this.offset = 0;
1907 return this;
1908 },
1909
1910// consumes and returns one char from the input
1911input:function () {
1912 var ch = this._input[0];
1913 this.yytext += ch;
1914 this.yyleng++;
1915 this.offset++;
1916 this.match += ch;
1917 this.matched += ch;
1918 var lines = ch.match(/(?:\r\n?|\n).*/g);
1919 if (lines) {
1920 this.yylineno++;
1921 this.yylloc.last_line++;
1922 } else {
1923 this.yylloc.last_column++;
1924 }
1925 if (this.options.ranges) {
1926 this.yylloc.range[1]++;
1927 }
1928
1929 this._input = this._input.slice(1);
1930 return ch;
1931 },
1932
1933// unshifts one char (or a string) into the input
1934unput:function (ch) {
1935 var len = ch.length;
1936 var lines = ch.split(/(?:\r\n?|\n)/g);
1937
1938 this._input = ch + this._input;
1939 this.yytext = this.yytext.substr(0, this.yytext.length - len);
1940 //this.yyleng -= len;
1941 this.offset -= len;
1942 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
1943 this.match = this.match.substr(0, this.match.length - 1);
1944 this.matched = this.matched.substr(0, this.matched.length - 1);
1945
1946 if (lines.length - 1) {
1947 this.yylineno -= lines.length - 1;
1948 }
1949 var r = this.yylloc.range;
1950
1951 this.yylloc = {
1952 first_line: this.yylloc.first_line,
1953 last_line: this.yylineno + 1,
1954 first_column: this.yylloc.first_column,
1955 last_column: lines ?
1956 (lines.length === oldLines.length ? this.yylloc.first_column : 0)
1957 + oldLines[oldLines.length - lines.length].length - lines[0].length :
1958 this.yylloc.first_column - len
1959 };
1960
1961 if (this.options.ranges) {
1962 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
1963 }
1964 this.yyleng = this.yytext.length;
1965 return this;
1966 },
1967
1968// When called from action, caches matched text and appends it on next action
1969more:function () {
1970 this._more = true;
1971 return this;
1972 },
1973
1974// 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.
1975reject:function () {
1976 if (this.options.backtrack_lexer) {
1977 this._backtrack = true;
1978 } else {
1979 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(), {
1980 text: "",
1981 token: null,
1982 line: this.yylineno
1983 });
1984
1985 }
1986 return this;
1987 },
1988
1989// retain first n characters of the match
1990less:function (n) {
1991 this.unput(this.match.slice(n));
1992 },
1993
1994// displays already matched input, i.e. for error messages
1995pastInput:function () {
1996 var past = this.matched.substr(0, this.matched.length - this.match.length);
1997 return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
1998 },
1999
2000// displays upcoming input, i.e. for error messages
2001upcomingInput:function () {
2002 var next = this.match;
2003 if (next.length < 20) {
2004 next += this._input.substr(0, 20-next.length);
2005 }
2006 return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
2007 },
2008
2009// displays the character position where the lexing error occurred, i.e. for error messages
2010showPosition:function () {
2011 var pre = this.pastInput();
2012 var c = new Array(pre.length + 1).join("-");
2013 return pre + this.upcomingInput() + "\n" + c + "^";
2014 },
2015
2016// test the lexed token: return FALSE when not a match, otherwise return token
2017test_match:function(match, indexed_rule) {
2018 var token,
2019 lines,
2020 backup;
2021
2022 if (this.options.backtrack_lexer) {
2023 // save context
2024 backup = {
2025 yylineno: this.yylineno,
2026 yylloc: {
2027 first_line: this.yylloc.first_line,
2028 last_line: this.last_line,
2029 first_column: this.yylloc.first_column,
2030 last_column: this.yylloc.last_column
2031 },
2032 yytext: this.yytext,
2033 match: this.match,
2034 matches: this.matches,
2035 matched: this.matched,
2036 yyleng: this.yyleng,
2037 offset: this.offset,
2038 _more: this._more,
2039 _input: this._input,
2040 yy: this.yy,
2041 conditionStack: this.conditionStack.slice(0),
2042 done: this.done
2043 };
2044 if (this.options.ranges) {
2045 backup.yylloc.range = this.yylloc.range.slice(0);
2046 }
2047 }
2048
2049 lines = match[0].match(/(?:\r\n?|\n).*/g);
2050 if (lines) {
2051 this.yylineno += lines.length;
2052 }
2053 this.yylloc = {
2054 first_line: this.yylloc.last_line,
2055 last_line: this.yylineno + 1,
2056 first_column: this.yylloc.last_column,
2057 last_column: lines ?
2058 lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
2059 this.yylloc.last_column + match[0].length
2060 };
2061 this.yytext += match[0];
2062 this.match += match[0];
2063 this.matches = match;
2064 this.yyleng = this.yytext.length;
2065 if (this.options.ranges) {
2066 this.yylloc.range = [this.offset, this.offset += this.yyleng];
2067 }
2068 this._more = false;
2069 this._backtrack = false;
2070 this._input = this._input.slice(match[0].length);
2071 this.matched += match[0];
2072 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
2073 if (this.done && this._input) {
2074 this.done = false;
2075 }
2076 if (token) {
2077 return token;
2078 } else if (this._backtrack) {
2079 // recover context
2080 for (var k in backup) {
2081 this[k] = backup[k];
2082 }
2083 return false; // rule action called reject() implying the next rule should be tested instead.
2084 }
2085 return false;
2086 },
2087
2088// return next match in input
2089next:function () {
2090 if (this.done) {
2091 return this.EOF;
2092 }
2093 if (!this._input) {
2094 this.done = true;
2095 }
2096
2097 var token,
2098 match,
2099 tempMatch,
2100 index;
2101 if (!this._more) {
2102 this.yytext = '';
2103 this.match = '';
2104 }
2105 var rules = this._currentRules();
2106 for (var i = 0; i < rules.length; i++) {
2107 tempMatch = this._input.match(this.rules[rules[i]]);
2108 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
2109 match = tempMatch;
2110 index = i;
2111 if (this.options.backtrack_lexer) {
2112 token = this.test_match(tempMatch, rules[i]);
2113 if (token !== false) {
2114 return token;
2115 } else if (this._backtrack) {
2116 match = false;
2117 continue; // rule action called reject() implying a rule MISmatch.
2118 } else {
2119 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
2120 return false;
2121 }
2122 } else if (!this.options.flex) {
2123 break;
2124 }
2125 }
2126 }
2127 if (match) {
2128 token = this.test_match(match, rules[index]);
2129 if (token !== false) {
2130 return token;
2131 }
2132 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
2133 return false;
2134 }
2135 if (this._input === "") {
2136 return this.EOF;
2137 } else {
2138 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
2139 text: "",
2140 token: null,
2141 line: this.yylineno
2142 });
2143 }
2144 },
2145
2146// return next match that has a token
2147lex:function lex () {
2148 var r = this.next();
2149 if (r) {
2150 return r;
2151 } else {
2152 return this.lex();
2153 }
2154 },
2155
2156// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
2157begin:function begin (condition) {
2158 this.conditionStack.push(condition);
2159 },
2160
2161// pop the previously active lexer condition state off the condition stack
2162popState:function popState () {
2163 var n = this.conditionStack.length - 1;
2164 if (n > 0) {
2165 return this.conditionStack.pop();
2166 } else {
2167 return this.conditionStack[0];
2168 }
2169 },
2170
2171// produce the lexer rule set which is active for the currently active lexer condition state
2172_currentRules:function _currentRules () {
2173 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
2174 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
2175 } else {
2176 return this.conditions["INITIAL"].rules;
2177 }
2178 },
2179
2180// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
2181topState:function topState (n) {
2182 n = this.conditionStack.length - 1 - Math.abs(n || 0);
2183 if (n >= 0) {
2184 return this.conditionStack[n];
2185 } else {
2186 return "INITIAL";
2187 }
2188 },
2189
2190// alias for begin(condition)
2191pushState:function pushState (condition) {
2192 this.begin(condition);
2193 },
2194
2195// return the number of states currently on the stack
2196stateStackSize:function stateStackSize() {
2197 return this.conditionStack.length;
2198 },
2199options: {},
2200performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
2201var YYSTATE=YY_START;
2202switch($avoiding_name_collisions) {
2203case 0:/* do nothing */
2204break;
2205case 1:return 6;
2206break;
2207case 2:/* skip whitespace */
2208break;
2209case 3:return 5;
2210break;
2211case 4: this.begin("struct"); /*console.log('Starting struct');*/return 20;
2212break;
2213case 5: /*console.log('Ending struct');*/this.popState(); return 22;
2214break;
2215case 6:/* nothing */
2216break;
2217case 7: /*console.log('lex-member: ' + yy_.yytext);*/ return "MEMBER";
2218break;
2219case 8:return 19;
2220break;
2221case 9:return 37;
2222break;
2223case 10:return 38;
2224break;
2225case 11:return 23;
2226break;
2227case 12:return 24;
2228break;
2229case 13:this.begin("generic");
2230break;
2231case 14:this.popState();
2232break;
2233case 15:return "GENERICTYPE";
2234break;
2235case 16:this.begin("string");
2236break;
2237case 17:this.popState();
2238break;
2239case 18:return "STR";
2240break;
2241case 19:return 32;
2242break;
2243case 20:return 32;
2244break;
2245case 21:return 34;
2246break;
2247case 22:return 34;
2248break;
2249case 23:return 33;
2250break;
2251case 24:return 31;
2252break;
2253case 25:return 35;
2254break;
2255case 26:return 36;
2256break;
2257case 27:return 14;
2258break;
2259case 28:return 50;
2260break;
2261case 29:return 'DOT';
2262break;
2263case 30:return 'PLUS';
2264break;
2265case 31:return 47;
2266break;
2267case 32:return 'EQUALS';
2268break;
2269case 33:return 'EQUALS';
2270break;
2271case 34:return 54;
2272break;
2273case 35:return 'PUNCTUATION';
2274break;
2275case 36:return 53;
2276break;
2277case 37:return 52;
2278break;
2279case 38:return 49;
2280break;
2281case 39:return 8;
2282break;
2283}
2284},
2285rules: [/^(?:%%[^\n]*\n*)/,/^(?:\n+)/,/^(?:\s+)/,/^(?:classDiagram\b)/,/^(?:[\{])/,/^(?:\})/,/^(?:[\n])/,/^(?:[^\{\}\n]*)/,/^(?:class\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:[~])/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:--)/,/^(?:\.\.)/,/^(?::[^\n;]+)/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:[!"#$%&'*+,-.`?\\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:$)/],
2286conditions: {"string":{"rules":[17,18],"inclusive":false},"generic":{"rules":[14,15],"inclusive":false},"struct":{"rules":[5,6,7],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,8,9,10,11,12,13,16,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39],"inclusive":true}}
2287});
2288return lexer;
2289})();
2290parser.lexer = lexer;
2291function Parser () {
2292 this.yy = {};
2293}
2294Parser.prototype = parser;parser.Parser = Parser;
2295return new Parser;
2296})();
2297
2298
2299if (true) {
2300exports.parser = parser;
2301exports.Parser = parser.Parser;
2302exports.parse = function () { return parser.parse.apply(parser, arguments); };
2303exports.main = function commonjsMain (args) {
2304 if (!args[1]) {
2305 console.log('Usage: '+args[0]+' FILE');
2306 process.exit(1);
2307 }
2308 var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8");
2309 return exports.parser.parse(source);
2310};
2311if ( true && __webpack_require__.c[__webpack_require__.s] === module) {
2312 exports.main(process.argv.slice(1));
2313}
2314}
2315/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
2316
2317/***/ }),
2318
2319/***/ "./src/diagrams/flowchart/flowChartShapes.js":
2320/*!***************************************************!*\
2321 !*** ./src/diagrams/flowchart/flowChartShapes.js ***!
2322 \***************************************************/
2323/*! exports provided: addToRender, default */
2324/***/ (function(module, __webpack_exports__, __webpack_require__) {
2325
2326"use strict";
2327__webpack_require__.r(__webpack_exports__);
2328/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addToRender", function() { return addToRender; });
2329/* harmony import */ var dagre_d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dagre-d3 */ "dagre-d3");
2330/* harmony import */ var dagre_d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(dagre_d3__WEBPACK_IMPORTED_MODULE_0__);
2331
2332
2333function question(parent, bbox, node) {
2334 var w = bbox.width;
2335 var h = bbox.height;
2336 var s = (w + h) * 0.9;
2337 var points = [{
2338 x: s / 2,
2339 y: 0
2340 }, {
2341 x: s,
2342 y: -s / 2
2343 }, {
2344 x: s / 2,
2345 y: -s
2346 }, {
2347 x: 0,
2348 y: -s / 2
2349 }];
2350 var shapeSvg = insertPolygonShape(parent, s, s, points);
2351
2352 node.intersect = function (point) {
2353 return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.polygon(node, points, point);
2354 };
2355
2356 return shapeSvg;
2357}
2358
2359function hexagon(parent, bbox, node) {
2360 var f = 4;
2361 var h = bbox.height;
2362 var m = h / f;
2363 var w = bbox.width + 2 * m;
2364 var points = [{
2365 x: m,
2366 y: 0
2367 }, {
2368 x: w - m,
2369 y: 0
2370 }, {
2371 x: w,
2372 y: -h / 2
2373 }, {
2374 x: w - m,
2375 y: -h
2376 }, {
2377 x: m,
2378 y: -h
2379 }, {
2380 x: 0,
2381 y: -h / 2
2382 }];
2383 var shapeSvg = insertPolygonShape(parent, w, h, points);
2384
2385 node.intersect = function (point) {
2386 return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.polygon(node, points, point);
2387 };
2388
2389 return shapeSvg;
2390}
2391
2392function rect_left_inv_arrow(parent, bbox, node) {
2393 var w = bbox.width;
2394 var h = bbox.height;
2395 var points = [{
2396 x: -h / 2,
2397 y: 0
2398 }, {
2399 x: w,
2400 y: 0
2401 }, {
2402 x: w,
2403 y: -h
2404 }, {
2405 x: -h / 2,
2406 y: -h
2407 }, {
2408 x: 0,
2409 y: -h / 2
2410 }];
2411 var shapeSvg = insertPolygonShape(parent, w, h, points);
2412
2413 node.intersect = function (point) {
2414 return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.polygon(node, points, point);
2415 };
2416
2417 return shapeSvg;
2418}
2419
2420function lean_right(parent, bbox, node) {
2421 var w = bbox.width;
2422 var h = bbox.height;
2423 var points = [{
2424 x: -2 * h / 6,
2425 y: 0
2426 }, {
2427 x: w - h / 6,
2428 y: 0
2429 }, {
2430 x: w + 2 * h / 6,
2431 y: -h
2432 }, {
2433 x: h / 6,
2434 y: -h
2435 }];
2436 var shapeSvg = insertPolygonShape(parent, w, h, points);
2437
2438 node.intersect = function (point) {
2439 return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.polygon(node, points, point);
2440 };
2441
2442 return shapeSvg;
2443}
2444
2445function lean_left(parent, bbox, node) {
2446 var w = bbox.width;
2447 var h = bbox.height;
2448 var points = [{
2449 x: 2 * h / 6,
2450 y: 0
2451 }, {
2452 x: w + h / 6,
2453 y: 0
2454 }, {
2455 x: w - 2 * h / 6,
2456 y: -h
2457 }, {
2458 x: -h / 6,
2459 y: -h
2460 }];
2461 var shapeSvg = insertPolygonShape(parent, w, h, points);
2462
2463 node.intersect = function (point) {
2464 return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.polygon(node, points, point);
2465 };
2466
2467 return shapeSvg;
2468}
2469
2470function trapezoid(parent, bbox, node) {
2471 var w = bbox.width;
2472 var h = bbox.height;
2473 var points = [{
2474 x: -2 * h / 6,
2475 y: 0
2476 }, {
2477 x: w + 2 * h / 6,
2478 y: 0
2479 }, {
2480 x: w - h / 6,
2481 y: -h
2482 }, {
2483 x: h / 6,
2484 y: -h
2485 }];
2486 var shapeSvg = insertPolygonShape(parent, w, h, points);
2487
2488 node.intersect = function (point) {
2489 return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.polygon(node, points, point);
2490 };
2491
2492 return shapeSvg;
2493}
2494
2495function inv_trapezoid(parent, bbox, node) {
2496 var w = bbox.width;
2497 var h = bbox.height;
2498 var points = [{
2499 x: h / 6,
2500 y: 0
2501 }, {
2502 x: w - h / 6,
2503 y: 0
2504 }, {
2505 x: w + 2 * h / 6,
2506 y: -h
2507 }, {
2508 x: -2 * h / 6,
2509 y: -h
2510 }];
2511 var shapeSvg = insertPolygonShape(parent, w, h, points);
2512
2513 node.intersect = function (point) {
2514 return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.polygon(node, points, point);
2515 };
2516
2517 return shapeSvg;
2518}
2519
2520function rect_right_inv_arrow(parent, bbox, node) {
2521 var w = bbox.width;
2522 var h = bbox.height;
2523 var points = [{
2524 x: 0,
2525 y: 0
2526 }, {
2527 x: w + h / 2,
2528 y: 0
2529 }, {
2530 x: w,
2531 y: -h / 2
2532 }, {
2533 x: w + h / 2,
2534 y: -h
2535 }, {
2536 x: 0,
2537 y: -h
2538 }];
2539 var shapeSvg = insertPolygonShape(parent, w, h, points);
2540
2541 node.intersect = function (point) {
2542 return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.polygon(node, points, point);
2543 };
2544
2545 return shapeSvg;
2546}
2547
2548function stadium(parent, bbox, node) {
2549 var h = bbox.height;
2550 var w = bbox.width + h / 4;
2551 var shapeSvg = parent.insert('rect', ':first-child').attr('rx', h / 2).attr('ry', h / 2).attr('x', -w / 2).attr('y', -h / 2).attr('width', w).attr('height', h);
2552
2553 node.intersect = function (point) {
2554 return dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.rect(node, point);
2555 };
2556
2557 return shapeSvg;
2558}
2559
2560function cylinder(parent, bbox, node) {
2561 var w = bbox.width;
2562 var rx = w / 2;
2563 var ry = rx / (2.5 + w / 50);
2564 var h = bbox.height + ry;
2565 var shape = 'M 0,' + ry + ' a ' + rx + ',' + ry + ' 0,0,0 ' + w + ' 0 a ' + rx + ',' + ry + ' 0,0,0 ' + -w + ' 0 l 0,' + h + ' a ' + rx + ',' + ry + ' 0,0,0 ' + w + ' 0 l 0,' + -h;
2566 var shapeSvg = parent.attr('label-offset-y', ry).insert('path', ':first-child').attr('d', shape).attr('transform', 'translate(' + -w / 2 + ',' + -(h / 2 + ry) + ')');
2567
2568 node.intersect = function (point) {
2569 var pos = dagre_d3__WEBPACK_IMPORTED_MODULE_0___default.a.intersect.rect(node, point);
2570 var x = pos.x - node.x;
2571
2572 if (rx != 0 && (Math.abs(x) < node.width / 2 || Math.abs(x) == node.width / 2 && Math.abs(pos.y - node.y) > node.height / 2 - ry)) {
2573 // ellipsis equation: x*x / a*a + y*y / b*b = 1
2574 // solve for y to get adjustion value for pos.y
2575 var y = ry * ry * (1 - x * x / (rx * rx));
2576 if (y != 0) y = Math.sqrt(y);
2577 y = ry - y;
2578 if (point.y - node.y > 0) y = -y;
2579 pos.y += y;
2580 }
2581
2582 return pos;
2583 };
2584
2585 return shapeSvg;
2586}
2587
2588function addToRender(render) {
2589 render.shapes().question = question;
2590 render.shapes().hexagon = hexagon;
2591 render.shapes().stadium = stadium;
2592 render.shapes().cylinder = cylinder; // Add custom shape for box with inverted arrow on left side
2593
2594 render.shapes().rect_left_inv_arrow = rect_left_inv_arrow; // Add custom shape for box with inverted arrow on left side
2595
2596 render.shapes().lean_right = lean_right; // Add custom shape for box with inverted arrow on left side
2597
2598 render.shapes().lean_left = lean_left; // Add custom shape for box with inverted arrow on left side
2599
2600 render.shapes().trapezoid = trapezoid; // Add custom shape for box with inverted arrow on left side
2601
2602 render.shapes().inv_trapezoid = inv_trapezoid; // Add custom shape for box with inverted arrow on right side
2603
2604 render.shapes().rect_right_inv_arrow = rect_right_inv_arrow;
2605}
2606
2607function insertPolygonShape(parent, w, h, points) {
2608 return parent.insert('polygon', ':first-child').attr('points', points.map(function (d) {
2609 return d.x + ',' + d.y;
2610 }).join(' ')).attr('transform', 'translate(' + -w / 2 + ',' + h / 2 + ')');
2611}
2612
2613/* harmony default export */ __webpack_exports__["default"] = ({
2614 addToRender: addToRender
2615});
2616
2617/***/ }),
2618
2619/***/ "./src/diagrams/flowchart/flowDb.js":
2620/*!******************************************!*\
2621 !*** ./src/diagrams/flowchart/flowDb.js ***!
2622 \******************************************/
2623/*! exports provided: addVertex, addSingleLink, addLink, updateLinkInterpolate, updateLink, addClass, setDirection, setClass, setLink, getTooltip, setClickEvent, bindFunctions, getDirection, getVertices, getEdges, getClasses, clear, defaultStyle, addSubGraph, getDepthFirstPos, indexNodes, getSubGraphs, firstGraph, default */
2624/***/ (function(module, __webpack_exports__, __webpack_require__) {
2625
2626"use strict";
2627__webpack_require__.r(__webpack_exports__);
2628/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addVertex", function() { return addVertex; });
2629/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addSingleLink", function() { return addSingleLink; });
2630/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addLink", function() { return addLink; });
2631/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateLinkInterpolate", function() { return updateLinkInterpolate; });
2632/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateLink", function() { return updateLink; });
2633/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addClass", function() { return addClass; });
2634/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setDirection", function() { return setDirection; });
2635/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setClass", function() { return setClass; });
2636/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLink", function() { return setLink; });
2637/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTooltip", function() { return getTooltip; });
2638/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setClickEvent", function() { return setClickEvent; });
2639/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bindFunctions", function() { return bindFunctions; });
2640/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDirection", function() { return getDirection; });
2641/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getVertices", function() { return getVertices; });
2642/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEdges", function() { return getEdges; });
2643/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClasses", function() { return getClasses; });
2644/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clear", function() { return clear; });
2645/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultStyle", function() { return defaultStyle; });
2646/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addSubGraph", function() { return addSubGraph; });
2647/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDepthFirstPos", function() { return getDepthFirstPos; });
2648/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "indexNodes", function() { return indexNodes; });
2649/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSubGraphs", function() { return getSubGraphs; });
2650/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstGraph", function() { return firstGraph; });
2651/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
2652/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
2653/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
2654/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils */ "./src/utils.js");
2655/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../config */ "./src/config.js");
2656function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
2657
2658
2659
2660
2661 // const MERMAID_DOM_ID_PREFIX = 'mermaid-dom-id-';
2662
2663var MERMAID_DOM_ID_PREFIX = '';
2664var config = Object(_config__WEBPACK_IMPORTED_MODULE_3__["getConfig"])();
2665var vertices = {};
2666var edges = [];
2667var classes = [];
2668var subGraphs = [];
2669var subGraphLookup = {};
2670var tooltips = {};
2671var subCount = 0;
2672var firstGraphFlag = true;
2673var direction; // Functions to be run after graph rendering
2674
2675var funs = [];
2676/**
2677 * Function called by parser when a node definition has been found
2678 * @param id
2679 * @param text
2680 * @param type
2681 * @param style
2682 * @param classes
2683 */
2684
2685var addVertex = function addVertex(_id, text, type, style, classes) {
2686 var txt;
2687 var id = _id;
2688
2689 if (typeof id === 'undefined') {
2690 return;
2691 }
2692
2693 if (id.trim().length === 0) {
2694 return;
2695 }
2696
2697 if (id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id;
2698
2699 if (typeof vertices[id] === 'undefined') {
2700 vertices[id] = {
2701 id: id,
2702 styles: [],
2703 classes: []
2704 };
2705 }
2706
2707 if (typeof text !== 'undefined') {
2708 txt = _utils__WEBPACK_IMPORTED_MODULE_2__["default"].sanitize(text.trim(), config); // strip quotes if string starts and ends with a quote
2709
2710 if (txt[0] === '"' && txt[txt.length - 1] === '"') {
2711 txt = txt.substring(1, txt.length - 1);
2712 }
2713
2714 vertices[id].text = txt;
2715 } else {
2716 if (!vertices[id].text) {
2717 vertices[id].text = _id;
2718 }
2719 }
2720
2721 if (typeof type !== 'undefined') {
2722 vertices[id].type = type;
2723 }
2724
2725 if (typeof style !== 'undefined') {
2726 if (style !== null) {
2727 style.forEach(function (s) {
2728 vertices[id].styles.push(s);
2729 });
2730 }
2731 }
2732
2733 if (typeof classes !== 'undefined') {
2734 if (classes !== null) {
2735 classes.forEach(function (s) {
2736 vertices[id].classes.push(s);
2737 });
2738 }
2739 }
2740};
2741/**
2742 * Function called by parser when a link/edge definition has been found
2743 * @param start
2744 * @param end
2745 * @param type
2746 * @param linktext
2747 */
2748
2749var addSingleLink = function addSingleLink(_start, _end, type, linktext) {
2750 var start = _start;
2751 var end = _end;
2752 if (start[0].match(/\d/)) start = MERMAID_DOM_ID_PREFIX + start;
2753 if (end[0].match(/\d/)) end = MERMAID_DOM_ID_PREFIX + end;
2754 _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].info('Got edge...', start, end);
2755 var edge = {
2756 start: start,
2757 end: end,
2758 type: undefined,
2759 text: ''
2760 };
2761 linktext = type.text;
2762
2763 if (typeof linktext !== 'undefined') {
2764 edge.text = _utils__WEBPACK_IMPORTED_MODULE_2__["default"].sanitize(linktext.trim(), config); // strip quotes if string starts and exnds with a quote
2765
2766 if (edge.text[0] === '"' && edge.text[edge.text.length - 1] === '"') {
2767 edge.text = edge.text.substring(1, edge.text.length - 1);
2768 }
2769 }
2770
2771 if (typeof type !== 'undefined') {
2772 edge.type = type.type;
2773 edge.stroke = type.stroke;
2774 }
2775
2776 edges.push(edge);
2777};
2778var addLink = function addLink(_start, _end, type, linktext) {
2779 var i, j;
2780
2781 for (i = 0; i < _start.length; i++) {
2782 for (j = 0; j < _end.length; j++) {
2783 addSingleLink(_start[i], _end[j], type, linktext);
2784 }
2785 }
2786};
2787/**
2788 * Updates a link's line interpolation algorithm
2789 * @param pos
2790 * @param interpolate
2791 */
2792
2793var updateLinkInterpolate = function updateLinkInterpolate(positions, interp) {
2794 positions.forEach(function (pos) {
2795 if (pos === 'default') {
2796 edges.defaultInterpolate = interp;
2797 } else {
2798 edges[pos].interpolate = interp;
2799 }
2800 });
2801};
2802/**
2803 * Updates a link with a style
2804 * @param pos
2805 * @param style
2806 */
2807
2808var updateLink = function updateLink(positions, style) {
2809 positions.forEach(function (pos) {
2810 if (pos === 'default') {
2811 edges.defaultStyle = style;
2812 } else {
2813 if (_utils__WEBPACK_IMPORTED_MODULE_2__["default"].isSubstringInArray('fill', style) === -1) {
2814 style.push('fill:none');
2815 }
2816
2817 edges[pos].style = style;
2818 }
2819 });
2820};
2821var addClass = function addClass(id, style) {
2822 if (typeof classes[id] === 'undefined') {
2823 classes[id] = {
2824 id: id,
2825 styles: []
2826 };
2827 }
2828
2829 if (typeof style !== 'undefined') {
2830 if (style !== null) {
2831 style.forEach(function (s) {
2832 classes[id].styles.push(s);
2833 });
2834 }
2835 }
2836};
2837/**
2838 * Called by parser when a graph definition is found, stores the direction of the chart.
2839 * @param dir
2840 */
2841
2842var setDirection = function setDirection(dir) {
2843 direction = dir;
2844
2845 if (direction.match(/.*</)) {
2846 direction = 'RL';
2847 }
2848
2849 if (direction.match(/.*\^/)) {
2850 direction = 'BT';
2851 }
2852
2853 if (direction.match(/.*>/)) {
2854 direction = 'LR';
2855 }
2856
2857 if (direction.match(/.*v/)) {
2858 direction = 'TB';
2859 }
2860};
2861/**
2862 * Called by parser when a special node is found, e.g. a clickable element.
2863 * @param ids Comma separated list of ids
2864 * @param className Class to add
2865 */
2866
2867var setClass = function setClass(ids, className) {
2868 ids.split(',').forEach(function (_id) {
2869 var id = _id;
2870 if (_id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id;
2871
2872 if (typeof vertices[id] !== 'undefined') {
2873 vertices[id].classes.push(className);
2874 }
2875
2876 if (typeof subGraphLookup[id] !== 'undefined') {
2877 subGraphLookup[id].classes.push(className);
2878 }
2879 });
2880};
2881
2882var setTooltip = function setTooltip(ids, tooltip) {
2883 ids.split(',').forEach(function (id) {
2884 if (typeof tooltip !== 'undefined') {
2885 tooltips[id] = _utils__WEBPACK_IMPORTED_MODULE_2__["default"].sanitize(tooltip, config);
2886 }
2887 });
2888};
2889
2890var setClickFun = function setClickFun(_id, functionName) {
2891 var id = _id;
2892 if (_id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id;
2893
2894 if (config.securityLevel !== 'loose') {
2895 return;
2896 }
2897
2898 if (typeof functionName === 'undefined') {
2899 return;
2900 }
2901
2902 if (typeof vertices[id] !== 'undefined') {
2903 funs.push(function () {
2904 var elem = document.querySelector("[id=\"".concat(id, "\"]"));
2905
2906 if (elem !== null) {
2907 elem.addEventListener('click', function () {
2908 window[functionName](id);
2909 }, false);
2910 }
2911 });
2912 }
2913};
2914/**
2915 * Called by parser when a link is found. Adds the URL to the vertex data.
2916 * @param ids Comma separated list of ids
2917 * @param linkStr URL to create a link for
2918 * @param tooltip Tooltip for the clickable element
2919 */
2920
2921
2922var setLink = function setLink(ids, linkStr, tooltip) {
2923 ids.split(',').forEach(function (_id) {
2924 var id = _id;
2925 if (_id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id;
2926
2927 if (typeof vertices[id] !== 'undefined') {
2928 vertices[id].link = _utils__WEBPACK_IMPORTED_MODULE_2__["default"].formatUrl(linkStr, config);
2929 }
2930 });
2931 setTooltip(ids, tooltip);
2932 setClass(ids, 'clickable');
2933};
2934var getTooltip = function getTooltip(id) {
2935 return tooltips[id];
2936};
2937/**
2938 * Called by parser when a click definition is found. Registers an event handler.
2939 * @param ids Comma separated list of ids
2940 * @param functionName Function to be called on click
2941 * @param tooltip Tooltip for the clickable element
2942 */
2943
2944var setClickEvent = function setClickEvent(ids, functionName, tooltip) {
2945 ids.split(',').forEach(function (id) {
2946 setClickFun(id, functionName);
2947 });
2948 setTooltip(ids, tooltip);
2949 setClass(ids, 'clickable');
2950};
2951var bindFunctions = function bindFunctions(element) {
2952 funs.forEach(function (fun) {
2953 fun(element);
2954 });
2955};
2956var getDirection = function getDirection() {
2957 return direction.trim();
2958};
2959/**
2960 * Retrieval function for fetching the found nodes after parsing has completed.
2961 * @returns {{}|*|vertices}
2962 */
2963
2964var getVertices = function getVertices() {
2965 return vertices;
2966};
2967/**
2968 * Retrieval function for fetching the found links after parsing has completed.
2969 * @returns {{}|*|edges}
2970 */
2971
2972var getEdges = function getEdges() {
2973 return edges;
2974};
2975/**
2976 * Retrieval function for fetching the found class definitions after parsing has completed.
2977 * @returns {{}|*|classes}
2978 */
2979
2980var getClasses = function getClasses() {
2981 return classes;
2982};
2983
2984var setupToolTips = function setupToolTips(element) {
2985 var tooltipElem = d3__WEBPACK_IMPORTED_MODULE_0__["select"]('.mermaidTooltip');
2986
2987 if ((tooltipElem._groups || tooltipElem)[0][0] === null) {
2988 tooltipElem = d3__WEBPACK_IMPORTED_MODULE_0__["select"]('body').append('div').attr('class', 'mermaidTooltip').style('opacity', 0);
2989 }
2990
2991 var svg = d3__WEBPACK_IMPORTED_MODULE_0__["select"](element).select('svg');
2992 var nodes = svg.selectAll('g.node');
2993 nodes.on('mouseover', function () {
2994 var el = d3__WEBPACK_IMPORTED_MODULE_0__["select"](this);
2995 var title = el.attr('title'); // Dont try to draw a tooltip if no data is provided
2996
2997 if (title === null) {
2998 return;
2999 }
3000
3001 var rect = this.getBoundingClientRect();
3002 tooltipElem.transition().duration(200).style('opacity', '.9');
3003 tooltipElem.html(el.attr('title')).style('left', rect.left + (rect.right - rect.left) / 2 + 'px').style('top', rect.top - 14 + document.body.scrollTop + 'px');
3004 el.classed('hover', true);
3005 }).on('mouseout', function () {
3006 tooltipElem.transition().duration(500).style('opacity', 0);
3007 var el = d3__WEBPACK_IMPORTED_MODULE_0__["select"](this);
3008 el.classed('hover', false);
3009 });
3010};
3011
3012funs.push(setupToolTips);
3013/**
3014 * Clears the internal graph db so that a new graph can be parsed.
3015 */
3016
3017var clear = function clear() {
3018 vertices = {};
3019 classes = {};
3020 edges = [];
3021 funs = [];
3022 funs.push(setupToolTips);
3023 subGraphs = [];
3024 subGraphLookup = {};
3025 subCount = 0;
3026 tooltips = [];
3027 firstGraphFlag = true;
3028};
3029/**
3030 *
3031 * @returns {string}
3032 */
3033
3034var defaultStyle = function defaultStyle() {
3035 return 'fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;';
3036};
3037/**
3038 * Clears the internal graph db so that a new graph can be parsed.
3039 */
3040
3041var addSubGraph = function addSubGraph(_id, list, _title) {
3042 var id = _id;
3043 var title = _title;
3044
3045 if (_id === _title && _title.match(/\s/)) {
3046 id = undefined;
3047 }
3048
3049 function uniq(a) {
3050 var prims = {
3051 boolean: {},
3052 number: {},
3053 string: {}
3054 };
3055 var objs = [];
3056 return a.filter(function (item) {
3057 var type = _typeof(item);
3058
3059 if (item.trim() === '') {
3060 return false;
3061 }
3062
3063 if (type in prims) {
3064 return prims[type].hasOwnProperty(item) ? false : prims[type][item] = true; // eslint-disable-line
3065 } else {
3066 return objs.indexOf(item) >= 0 ? false : objs.push(item);
3067 }
3068 });
3069 }
3070
3071 var nodeList = [];
3072 nodeList = uniq(nodeList.concat.apply(nodeList, list));
3073
3074 for (var i = 0; i < nodeList.length; i++) {
3075 if (nodeList[i][0].match(/\d/)) nodeList[i] = MERMAID_DOM_ID_PREFIX + nodeList[i];
3076 }
3077
3078 id = id || 'subGraph' + subCount;
3079 if (id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id;
3080 title = title || '';
3081 title = _utils__WEBPACK_IMPORTED_MODULE_2__["default"].sanitize(title, config);
3082 subCount = subCount + 1;
3083 var subGraph = {
3084 id: id,
3085 nodes: nodeList,
3086 title: title.trim(),
3087 classes: []
3088 };
3089 subGraphs.push(subGraph);
3090 subGraphLookup[id] = subGraph;
3091 return id;
3092};
3093
3094var getPosForId = function getPosForId(id) {
3095 for (var i = 0; i < subGraphs.length; i++) {
3096 if (subGraphs[i].id === id) {
3097 return i;
3098 }
3099 }
3100
3101 return -1;
3102};
3103
3104var secCount = -1;
3105var posCrossRef = [];
3106
3107var indexNodes2 = function indexNodes2(id, pos) {
3108 var nodes = subGraphs[pos].nodes;
3109 secCount = secCount + 1;
3110
3111 if (secCount > 2000) {
3112 return;
3113 }
3114
3115 posCrossRef[secCount] = pos; // Check if match
3116
3117 if (subGraphs[pos].id === id) {
3118 return {
3119 result: true,
3120 count: 0
3121 };
3122 }
3123
3124 var count = 0;
3125 var posCount = 1;
3126
3127 while (count < nodes.length) {
3128 var childPos = getPosForId(nodes[count]); // Ignore regular nodes (pos will be -1)
3129
3130 if (childPos >= 0) {
3131 var res = indexNodes2(id, childPos);
3132
3133 if (res.result) {
3134 return {
3135 result: true,
3136 count: posCount + res.count
3137 };
3138 } else {
3139 posCount = posCount + res.count;
3140 }
3141 }
3142
3143 count = count + 1;
3144 }
3145
3146 return {
3147 result: false,
3148 count: posCount
3149 };
3150};
3151
3152var getDepthFirstPos = function getDepthFirstPos(pos) {
3153 return posCrossRef[pos];
3154};
3155var indexNodes = function indexNodes() {
3156 secCount = -1;
3157
3158 if (subGraphs.length > 0) {
3159 indexNodes2('none', subGraphs.length - 1, 0);
3160 }
3161};
3162var getSubGraphs = function getSubGraphs() {
3163 return subGraphs;
3164};
3165var firstGraph = function firstGraph() {
3166 if (firstGraphFlag) {
3167 firstGraphFlag = false;
3168 return true;
3169 }
3170
3171 return false;
3172};
3173
3174var destructStartLink = function destructStartLink(_str) {
3175 var str = _str.trim();
3176
3177 switch (str) {
3178 case '<--':
3179 return {
3180 type: 'arrow',
3181 stroke: 'normal'
3182 };
3183
3184 case 'x--':
3185 return {
3186 type: 'arrow_cross',
3187 stroke: 'normal'
3188 };
3189
3190 case 'o--':
3191 return {
3192 type: 'arrow_circle',
3193 stroke: 'normal'
3194 };
3195
3196 case '<-.':
3197 return {
3198 type: 'arrow',
3199 stroke: 'dotted'
3200 };
3201
3202 case 'x-.':
3203 return {
3204 type: 'arrow_cross',
3205 stroke: 'dotted'
3206 };
3207
3208 case 'o-.':
3209 return {
3210 type: 'arrow_circle',
3211 stroke: 'dotted'
3212 };
3213
3214 case '<==':
3215 return {
3216 type: 'arrow',
3217 stroke: 'thick'
3218 };
3219
3220 case 'x==':
3221 return {
3222 type: 'arrow_cross',
3223 stroke: 'thick'
3224 };
3225
3226 case 'o==':
3227 return {
3228 type: 'arrow_circle',
3229 stroke: 'thick'
3230 };
3231
3232 case '--':
3233 return {
3234 type: 'arrow_open',
3235 stroke: 'normal'
3236 };
3237
3238 case '==':
3239 return {
3240 type: 'arrow_open',
3241 stroke: 'thick'
3242 };
3243
3244 case '-.':
3245 return {
3246 type: 'arrow_open',
3247 stroke: 'dotted'
3248 };
3249 }
3250};
3251
3252var destructEndLink = function destructEndLink(_str) {
3253 var str = _str.trim();
3254
3255 switch (str) {
3256 case '--x':
3257 return {
3258 type: 'arrow_cross',
3259 stroke: 'normal'
3260 };
3261
3262 case '-->':
3263 return {
3264 type: 'arrow',
3265 stroke: 'normal'
3266 };
3267
3268 case '<-->':
3269 return {
3270 type: 'double_arrow_point',
3271 stroke: 'normal'
3272 };
3273
3274 case 'x--x':
3275 return {
3276 type: 'double_arrow_cross',
3277 stroke: 'normal'
3278 };
3279
3280 case 'o--o':
3281 return {
3282 type: 'double_arrow_circle',
3283 stroke: 'normal'
3284 };
3285
3286 case 'o.-o':
3287 return {
3288 type: 'double_arrow_circle',
3289 stroke: 'dotted'
3290 };
3291
3292 case '<==>':
3293 return {
3294 type: 'double_arrow_point',
3295 stroke: 'thick'
3296 };
3297
3298 case 'o==o':
3299 return {
3300 type: 'double_arrow_circle',
3301 stroke: 'thick'
3302 };
3303
3304 case 'x==x':
3305 return {
3306 type: 'double_arrow_cross',
3307 stroke: 'thick'
3308 };
3309
3310 case 'x.-x':
3311 return {
3312 type: 'double_arrow_cross',
3313 stroke: 'dotted'
3314 };
3315
3316 case 'x-.-x':
3317 return {
3318 type: 'double_arrow_cross',
3319 stroke: 'dotted'
3320 };
3321
3322 case '<.->':
3323 return {
3324 type: 'double_arrow_point',
3325 stroke: 'dotted'
3326 };
3327
3328 case '<-.->':
3329 return {
3330 type: 'double_arrow_point',
3331 stroke: 'dotted'
3332 };
3333
3334 case 'o-.-o':
3335 return {
3336 type: 'double_arrow_circle',
3337 stroke: 'dotted'
3338 };
3339
3340 case '--o':
3341 return {
3342 type: 'arrow_circle',
3343 stroke: 'normal'
3344 };
3345
3346 case '---':
3347 return {
3348 type: 'arrow_open',
3349 stroke: 'normal'
3350 };
3351
3352 case '-.-x':
3353 return {
3354 type: 'arrow_cross',
3355 stroke: 'dotted'
3356 };
3357
3358 case '-.->':
3359 return {
3360 type: 'arrow',
3361 stroke: 'dotted'
3362 };
3363
3364 case '-.-o':
3365 return {
3366 type: 'arrow_circle',
3367 stroke: 'dotted'
3368 };
3369
3370 case '-.-':
3371 return {
3372 type: 'arrow_open',
3373 stroke: 'dotted'
3374 };
3375
3376 case '.-x':
3377 return {
3378 type: 'arrow_cross',
3379 stroke: 'dotted'
3380 };
3381
3382 case '.->':
3383 return {
3384 type: 'arrow',
3385 stroke: 'dotted'
3386 };
3387
3388 case '.-o':
3389 return {
3390 type: 'arrow_circle',
3391 stroke: 'dotted'
3392 };
3393
3394 case '.-':
3395 return {
3396 type: 'arrow_open',
3397 stroke: 'dotted'
3398 };
3399
3400 case '==x':
3401 return {
3402 type: 'arrow_cross',
3403 stroke: 'thick'
3404 };
3405
3406 case '==>':
3407 return {
3408 type: 'arrow',
3409 stroke: 'thick'
3410 };
3411
3412 case '==o':
3413 return {
3414 type: 'arrow_circle',
3415 stroke: 'thick'
3416 };
3417
3418 case '===':
3419 return {
3420 type: 'arrow_open',
3421 stroke: 'thick'
3422 };
3423 }
3424};
3425
3426var destructLink = function destructLink(_str, _startStr) {
3427 var info = destructEndLink(_str);
3428 var startInfo;
3429
3430 if (_startStr) {
3431 startInfo = destructStartLink(_startStr);
3432
3433 if (startInfo.stroke !== info.stroke) {
3434 return {
3435 type: 'INVALID',
3436 stroke: 'INVALID'
3437 };
3438 }
3439
3440 if (startInfo.type === 'arrow_open') {
3441 // -- xyz --> - take arrow type form ending
3442 startInfo.type = info.type;
3443 } else {
3444 // x-- xyz --> - not supported
3445 if (startInfo.type !== info.type) return {
3446 type: 'INVALID',
3447 stroke: 'INVALID'
3448 };
3449 startInfo.type = 'double_' + startInfo.type;
3450 }
3451
3452 if (startInfo.type === 'double_arrow') {
3453 startInfo.type = 'double_arrow_point';
3454 }
3455
3456 return startInfo;
3457 }
3458
3459 return info;
3460};
3461
3462/* harmony default export */ __webpack_exports__["default"] = ({
3463 addVertex: addVertex,
3464 addLink: addLink,
3465 updateLinkInterpolate: updateLinkInterpolate,
3466 updateLink: updateLink,
3467 addClass: addClass,
3468 setDirection: setDirection,
3469 setClass: setClass,
3470 getTooltip: getTooltip,
3471 setClickEvent: setClickEvent,
3472 setLink: setLink,
3473 bindFunctions: bindFunctions,
3474 getDirection: getDirection,
3475 getVertices: getVertices,
3476 getEdges: getEdges,
3477 getClasses: getClasses,
3478 clear: clear,
3479 defaultStyle: defaultStyle,
3480 addSubGraph: addSubGraph,
3481 getDepthFirstPos: getDepthFirstPos,
3482 indexNodes: indexNodes,
3483 getSubGraphs: getSubGraphs,
3484 destructLink: destructLink,
3485 lex: {
3486 firstGraph: firstGraph
3487 }
3488});
3489
3490/***/ }),
3491
3492/***/ "./src/diagrams/flowchart/flowRenderer.js":
3493/*!************************************************!*\
3494 !*** ./src/diagrams/flowchart/flowRenderer.js ***!
3495 \************************************************/
3496/*! exports provided: setConf, addVertices, addEdges, getClasses, draw, default */
3497/***/ (function(module, __webpack_exports__, __webpack_require__) {
3498
3499"use strict";
3500__webpack_require__.r(__webpack_exports__);
3501/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; });
3502/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addVertices", function() { return addVertices; });
3503/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addEdges", function() { return addEdges; });
3504/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClasses", function() { return getClasses; });
3505/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; });
3506/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! graphlib */ "graphlib");
3507/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(graphlib__WEBPACK_IMPORTED_MODULE_0__);
3508/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3 */ "d3");
3509/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_1__);
3510/* harmony import */ var _flowDb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./flowDb */ "./src/diagrams/flowchart/flowDb.js");
3511/* harmony import */ var _parser_flow__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parser/flow */ "./src/diagrams/flowchart/parser/flow.jison");
3512/* harmony import */ var _parser_flow__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_parser_flow__WEBPACK_IMPORTED_MODULE_3__);
3513/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../config */ "./src/config.js");
3514/* harmony import */ var dagre_d3__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! dagre-d3 */ "dagre-d3");
3515/* harmony import */ var dagre_d3__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(dagre_d3__WEBPACK_IMPORTED_MODULE_5__);
3516/* harmony import */ var dagre_d3_lib_label_add_html_label_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! dagre-d3/lib/label/add-html-label.js */ "dagre-d3/lib/label/add-html-label.js");
3517/* harmony import */ var dagre_d3_lib_label_add_html_label_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(dagre_d3_lib_label_add_html_label_js__WEBPACK_IMPORTED_MODULE_6__);
3518/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
3519/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils */ "./src/utils.js");
3520/* harmony import */ var _flowChartShapes__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./flowChartShapes */ "./src/diagrams/flowchart/flowChartShapes.js");
3521
3522
3523
3524
3525
3526var newDagreD3 = true;
3527 // const newDagreD3 = false;
3528
3529
3530
3531
3532
3533var conf = {};
3534var setConf = function setConf(cnf) {
3535 var keys = Object.keys(cnf);
3536
3537 for (var i = 0; i < keys.length; i++) {
3538 conf[keys[i]] = cnf[keys[i]];
3539 }
3540};
3541/**
3542 * Function that adds the vertices found in the graph definition to the graph to be rendered.
3543 * @param vert Object containing the vertices.
3544 * @param g The graph that is to be drawn.
3545 */
3546
3547var addVertices = function addVertices(vert, g, svgId) {
3548 var svg = d3__WEBPACK_IMPORTED_MODULE_1__["select"]("[id=\"".concat(svgId, "\"]"));
3549 var keys = Object.keys(vert);
3550
3551 var styleFromStyleArr = function styleFromStyleArr(styleStr, arr, _ref) {
3552 var label = _ref.label;
3553
3554 if (!label) {
3555 // Create a compound style definition from the style definitions found for the node in the graph definition
3556 for (var i = 0; i < arr.length; i++) {
3557 if (typeof arr[i] !== 'undefined') {
3558 styleStr = styleStr + arr[i] + ';';
3559 }
3560 }
3561 } else {
3562 // create the style definition for the text, if property is a text-property
3563 for (var _i = 0; _i < arr.length; _i++) {
3564 if (typeof arr[_i] !== 'undefined') {
3565 if (arr[_i].match('^color:|^text-align:')) styleStr = styleStr + arr[_i] + ';';
3566 }
3567 }
3568 }
3569
3570 return styleStr;
3571 }; // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition
3572
3573
3574 keys.forEach(function (id) {
3575 var vertex = vert[id];
3576 /**
3577 * Variable for storing the classes for the vertex
3578 * @type {string}
3579 */
3580
3581 var classStr = '';
3582
3583 if (vertex.classes.length > 0) {
3584 classStr = vertex.classes.join(' ');
3585 }
3586 /**
3587 * Variable for storing the extracted style for the vertex
3588 * @type {string}
3589 */
3590
3591
3592 var style = ''; // Create a compound style definition from the style definitions found for the node in the graph definition
3593
3594 style = styleFromStyleArr(style, vertex.styles, {
3595 label: false
3596 });
3597 var labelStyle = '';
3598 labelStyle = styleFromStyleArr(labelStyle, vertex.styles, {
3599 label: true
3600 }); // Use vertex id as text in the box if no text is provided by the graph definition
3601
3602 var vertexText = vertex.text !== undefined ? vertex.text : vertex.id; // We create a SVG label, either by delegating to addHtmlLabel or manually
3603
3604 var vertexNode;
3605
3606 if (Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart.htmlLabels) {
3607 // TODO: addHtmlLabel accepts a labelStyle. Do we possibly have that?
3608 var node = {
3609 label: vertexText.replace(/fa[lrsb]?:fa-[\w-]+/g, function (s) {
3610 return "<i class='".concat(s.replace(':', ' '), "'></i>");
3611 })
3612 };
3613 vertexNode = dagre_d3_lib_label_add_html_label_js__WEBPACK_IMPORTED_MODULE_6___default()(svg, node).node();
3614 vertexNode.parentNode.removeChild(vertexNode);
3615 } else {
3616 var svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text');
3617 var rows = vertexText.split(/<br[/]{0,1}>/);
3618
3619 for (var j = 0; j < rows.length; j++) {
3620 var tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan');
3621 tspan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');
3622 tspan.setAttribute('dy', '1em');
3623 tspan.setAttribute('x', '1');
3624 tspan.textContent = rows[j];
3625 svgLabel.appendChild(tspan);
3626 }
3627
3628 vertexNode = svgLabel;
3629 }
3630
3631 var radious = 0;
3632 var _shape = ''; // Set the shape based parameters
3633
3634 switch (vertex.type) {
3635 case 'round':
3636 radious = 5;
3637 _shape = 'rect';
3638 break;
3639
3640 case 'square':
3641 _shape = 'rect';
3642 break;
3643
3644 case 'diamond':
3645 _shape = 'question';
3646 break;
3647
3648 case 'hexagon':
3649 _shape = 'hexagon';
3650 break;
3651
3652 case 'odd':
3653 _shape = 'rect_left_inv_arrow';
3654 break;
3655
3656 case 'lean_right':
3657 _shape = 'lean_right';
3658 break;
3659
3660 case 'lean_left':
3661 _shape = 'lean_left';
3662 break;
3663
3664 case 'trapezoid':
3665 _shape = 'trapezoid';
3666 break;
3667
3668 case 'inv_trapezoid':
3669 _shape = 'inv_trapezoid';
3670 break;
3671
3672 case 'odd_right':
3673 _shape = 'rect_left_inv_arrow';
3674 break;
3675
3676 case 'circle':
3677 _shape = 'circle';
3678 break;
3679
3680 case 'ellipse':
3681 _shape = 'ellipse';
3682 break;
3683
3684 case 'stadium':
3685 _shape = 'stadium';
3686 break;
3687
3688 case 'cylinder':
3689 _shape = 'cylinder';
3690 break;
3691
3692 case 'group':
3693 _shape = 'rect';
3694 break;
3695
3696 default:
3697 _shape = 'rect';
3698 } // Add the node
3699
3700
3701 g.setNode(vertex.id, {
3702 labelType: 'svg',
3703 labelStyle: labelStyle,
3704 shape: _shape,
3705 label: vertexNode,
3706 rx: radious,
3707 ry: radious,
3708 class: classStr,
3709 style: style,
3710 id: vertex.id
3711 });
3712 });
3713};
3714/**
3715 * Add edges to graph based on parsed graph defninition
3716 * @param {Object} edges The edges to add to the graph
3717 * @param {Object} g The graph object
3718 */
3719
3720var addEdges = function addEdges(edges, g) {
3721 var cnt = 0;
3722 var defaultStyle;
3723
3724 if (typeof edges.defaultStyle !== 'undefined') {
3725 defaultStyle = edges.defaultStyle.toString().replace(/,/g, ';');
3726 }
3727
3728 edges.forEach(function (edge) {
3729 cnt++;
3730 var edgeData = {}; // Set link type for rendering
3731
3732 if (edge.type === 'arrow_open') {
3733 edgeData.arrowhead = 'none';
3734 } else {
3735 edgeData.arrowhead = 'normal';
3736 }
3737
3738 var style = '';
3739
3740 if (typeof edge.style !== 'undefined') {
3741 edge.style.forEach(function (s) {
3742 style = style + s + ';';
3743 });
3744 } else {
3745 switch (edge.stroke) {
3746 case 'normal':
3747 style = 'fill:none';
3748
3749 if (typeof defaultStyle !== 'undefined') {
3750 style = defaultStyle;
3751 }
3752
3753 break;
3754
3755 case 'dotted':
3756 style = 'fill:none;stroke-width:2px;stroke-dasharray:3;';
3757 break;
3758
3759 case 'thick':
3760 style = ' stroke-width: 3.5px;fill:none';
3761 break;
3762 }
3763 }
3764
3765 edgeData.style = style;
3766
3767 if (typeof edge.interpolate !== 'undefined') {
3768 edgeData.curve = Object(_utils__WEBPACK_IMPORTED_MODULE_8__["interpolateToCurve"])(edge.interpolate, d3__WEBPACK_IMPORTED_MODULE_1__["curveLinear"]);
3769 } else if (typeof edges.defaultInterpolate !== 'undefined') {
3770 edgeData.curve = Object(_utils__WEBPACK_IMPORTED_MODULE_8__["interpolateToCurve"])(edges.defaultInterpolate, d3__WEBPACK_IMPORTED_MODULE_1__["curveLinear"]);
3771 } else {
3772 edgeData.curve = Object(_utils__WEBPACK_IMPORTED_MODULE_8__["interpolateToCurve"])(conf.curve, d3__WEBPACK_IMPORTED_MODULE_1__["curveLinear"]);
3773 }
3774
3775 if (typeof edge.text === 'undefined') {
3776 if (typeof edge.style !== 'undefined') {
3777 edgeData.arrowheadStyle = 'fill: #333';
3778 }
3779 } else {
3780 edgeData.arrowheadStyle = 'fill: #333';
3781 edgeData.labelpos = 'c';
3782
3783 if (Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart.htmlLabels) {
3784 edgeData.labelType = 'html';
3785 edgeData.label = '<span class="edgeLabel">' + edge.text + '</span>';
3786 } else {
3787 edgeData.labelType = 'text';
3788 edgeData.label = edge.text.replace(/<br\s*\/?>/g, '\n');
3789
3790 if (typeof edge.style === 'undefined') {
3791 edgeData.style = edgeData.style || 'stroke: #333; stroke-width: 1.5px;fill:none';
3792 }
3793 }
3794 } // Add the edge to the graph
3795
3796
3797 g.setEdge(edge.start, edge.end, edgeData, cnt);
3798 });
3799};
3800/**
3801 * Returns the all the styles from classDef statements in the graph definition.
3802 * @returns {object} classDef styles
3803 */
3804
3805var getClasses = function getClasses(text) {
3806 _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].info('Extracting classes');
3807 _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].clear();
3808 var parser = _parser_flow__WEBPACK_IMPORTED_MODULE_3___default.a.parser;
3809 parser.yy = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"]; // Parse the graph definition
3810
3811 parser.parse(text);
3812 return _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getClasses();
3813};
3814/**
3815 * Draws a flowchart in the tag with id: id based on the graph definition in text.
3816 * @param text
3817 * @param id
3818 */
3819
3820var draw = function draw(text, id) {
3821 _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].info('Drawing flowchart');
3822 _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].clear();
3823 var parser = _parser_flow__WEBPACK_IMPORTED_MODULE_3___default.a.parser;
3824 parser.yy = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"]; // Parse the graph definition
3825
3826 try {
3827 parser.parse(text);
3828 } catch (err) {
3829 _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].debug('Parsing failed');
3830 } // Fetch the default direction, use TD if none was found
3831
3832
3833 var dir = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getDirection();
3834
3835 if (typeof dir === 'undefined') {
3836 dir = 'TD';
3837 } // Create the input mermaid.graph
3838
3839
3840 var g; // Todo remove newDagreD3 when properly verified
3841
3842 if (newDagreD3) {
3843 g = new graphlib__WEBPACK_IMPORTED_MODULE_0___default.a.Graph({
3844 multigraph: true,
3845 compound: true
3846 }).setGraph({
3847 rankdir: dir,
3848 marginx: 8,
3849 marginy: 8
3850 }).setDefaultEdgeLabel(function () {
3851 return {};
3852 });
3853 } else {
3854 g = new graphlib__WEBPACK_IMPORTED_MODULE_0___default.a.Graph({
3855 multigraph: true,
3856 compound: true
3857 }).setGraph({
3858 rankdir: dir,
3859 marginx: 20,
3860 marginy: 20
3861 }).setDefaultEdgeLabel(function () {
3862 return {};
3863 });
3864 }
3865
3866 var subG;
3867 var subGraphs = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getSubGraphs();
3868
3869 for (var _i2 = subGraphs.length - 1; _i2 >= 0; _i2--) {
3870 subG = subGraphs[_i2];
3871 _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].addVertex(subG.id, subG.title, 'group', undefined, subG.classes);
3872 } // Fetch the verices/nodes and edges/links from the parsed graph definition
3873
3874
3875 var vert = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getVertices();
3876 var edges = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getEdges();
3877 var i = 0;
3878
3879 for (i = subGraphs.length - 1; i >= 0; i--) {
3880 subG = subGraphs[i];
3881 d3__WEBPACK_IMPORTED_MODULE_1__["selectAll"]('cluster').append('text');
3882
3883 for (var j = 0; j < subG.nodes.length; j++) {
3884 g.setParent(subG.nodes[j], subG.id);
3885 }
3886 }
3887
3888 addVertices(vert, g, id);
3889 addEdges(edges, g); // Create the renderer
3890
3891 var Render = dagre_d3__WEBPACK_IMPORTED_MODULE_5___default.a.render;
3892 var render = new Render(); // Add custom shapes
3893
3894 _flowChartShapes__WEBPACK_IMPORTED_MODULE_9__["default"].addToRender(render); // Add our custom arrow - an empty arrowhead
3895
3896 render.arrows().none = function normal(parent, id, edge, type) {
3897 var marker = parent.append('marker').attr('id', id).attr('viewBox', '0 0 10 10').attr('refX', 9).attr('refY', 5).attr('markerUnits', 'strokeWidth').attr('markerWidth', 8).attr('markerHeight', 6).attr('orient', 'auto');
3898 var path = marker.append('path').attr('d', 'M 0 0 L 0 0 L 0 0 z');
3899 dagre_d3__WEBPACK_IMPORTED_MODULE_5___default.a.util.applyStyle(path, edge[type + 'Style']);
3900 }; // Override normal arrowhead defined in d3. Remove style & add class to allow css styling.
3901
3902
3903 render.arrows().normal = function normal(parent, id) {
3904 var marker = parent.append('marker').attr('id', id).attr('viewBox', '0 0 10 10').attr('refX', 9).attr('refY', 5).attr('markerUnits', 'strokeWidth').attr('markerWidth', 8).attr('markerHeight', 6).attr('orient', 'auto');
3905 marker.append('path').attr('d', 'M 0 0 L 10 5 L 0 10 z').attr('class', 'arrowheadPath').style('stroke-width', 1).style('stroke-dasharray', '1,0');
3906 }; // Set up an SVG group so that we can translate the final graph.
3907
3908
3909 var svg = d3__WEBPACK_IMPORTED_MODULE_1__["select"]("[id=\"".concat(id, "\"]")); // Run the renderer. This is what draws the final graph.
3910
3911 var element = d3__WEBPACK_IMPORTED_MODULE_1__["select"]('#' + id + ' g');
3912 render(element, g);
3913 element.selectAll('g.node').attr('title', function () {
3914 return _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getTooltip(this.id);
3915 });
3916 var conf = Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart;
3917 var padding = 8; // Todo remove newDagreD3 when properly verified
3918
3919 if (newDagreD3) {
3920 var svgBounds = svg.node().getBBox();
3921 var width = svgBounds.width + padding * 2;
3922 var height = svgBounds.height + padding * 2;
3923 _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].debug("new ViewBox 0 0 ".concat(width, " ").concat(height), "translate(".concat(padding - g._label.marginx, ", ").concat(padding - g._label.marginy, ")"));
3924
3925 if (conf.useMaxWidth) {
3926 svg.attr('width', '100%');
3927 svg.attr('style', "max-width: ".concat(width, "px;"));
3928 } else {
3929 svg.attr('height', height);
3930 svg.attr('width', width);
3931 }
3932
3933 svg.attr('viewBox', "0 0 ".concat(width, " ").concat(height));
3934 svg.select('g').attr('transform', "translate(".concat(padding - g._label.marginx, ", ").concat(padding - svgBounds.y, ")"));
3935 } else {
3936 var _width = g.maxX - g.minX + padding * 2;
3937
3938 var _height = g.maxY - g.minY + padding * 2;
3939
3940 if (conf.useMaxWidth) {
3941 svg.attr('width', '100%');
3942 svg.attr('style', "max-width: ".concat(_width, "px;"));
3943 } else {
3944 svg.attr('height', _height);
3945 svg.attr('width', _width);
3946 }
3947
3948 _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].debug("Org ViewBox 0 0 ".concat(_width, " ").concat(_height), "translate(".concat(padding - g.minX, ", ").concat(padding - g.minY, ")\n").concat(location.href));
3949 svg.attr('viewBox', "0 0 ".concat(_width, " ").concat(_height));
3950 svg.select('g').attr('transform', "translate(".concat(padding - g.minX, ", ").concat(padding - g.minY, ")")); // svg.select('g').attr('transform', `translate(${padding - minX}, ${padding - minY})`);
3951 } // Index nodes
3952
3953
3954 _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].indexNodes('subGraph' + i); // reposition labels
3955
3956 for (i = 0; i < subGraphs.length; i++) {
3957 subG = subGraphs[i];
3958
3959 if (subG.title !== 'undefined') {
3960 var clusterRects = document.querySelectorAll('#' + id + ' [id="' + subG.id + '"] rect');
3961 var clusterEl = document.querySelectorAll('#' + id + ' [id="' + subG.id + '"]');
3962 var xPos = clusterRects[0].x.baseVal.value;
3963 var yPos = clusterRects[0].y.baseVal.value;
3964 var _width2 = clusterRects[0].width.baseVal.value;
3965 var cluster = d3__WEBPACK_IMPORTED_MODULE_1__["select"](clusterEl[0]);
3966 var te = cluster.select('.label');
3967 te.attr('transform', "translate(".concat(xPos + _width2 / 2, ", ").concat(yPos + 14, ")"));
3968 te.attr('id', id + 'Text');
3969 }
3970 } // Add label rects for non html labels
3971
3972
3973 if (!conf.htmlLabels) {
3974 var labels = document.querySelectorAll('[id="' + id + '"] .edgeLabel .label');
3975
3976 for (var k = 0; k < labels.length; k++) {
3977 var label = labels[k]; // Get dimensions of label
3978
3979 var dim = label.getBBox();
3980 var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
3981 rect.setAttribute('rx', 0);
3982 rect.setAttribute('ry', 0);
3983 rect.setAttribute('width', dim.width);
3984 rect.setAttribute('height', dim.height);
3985 rect.setAttribute('style', 'fill:#e8e8e8;');
3986 label.insertBefore(rect, label.firstChild);
3987 }
3988 } // If node has a link, wrap it in an anchor SVG object.
3989
3990
3991 var keys = Object.keys(vert);
3992 keys.forEach(function (key) {
3993 var vertex = vert[key];
3994
3995 if (vertex.link) {
3996 var node = d3__WEBPACK_IMPORTED_MODULE_1__["select"]('#' + id + ' [id="' + key + '"]');
3997
3998 if (node) {
3999 var link = document.createElementNS('http://www.w3.org/2000/svg', 'a');
4000 link.setAttributeNS('http://www.w3.org/2000/svg', 'href', vertex.link);
4001 link.setAttributeNS('http://www.w3.org/2000/svg', 'rel', 'noopener');
4002 var linkNode = node.insert(function () {
4003 return link;
4004 }, ':first-child');
4005 var shape = node.select('.label-container');
4006
4007 if (shape) {
4008 linkNode.append(function () {
4009 return shape.node();
4010 });
4011 }
4012
4013 var _label = node.select('.label');
4014
4015 if (_label) {
4016 linkNode.append(function () {
4017 return _label.node();
4018 });
4019 }
4020 }
4021 }
4022 });
4023};
4024/* harmony default export */ __webpack_exports__["default"] = ({
4025 setConf: setConf,
4026 addVertices: addVertices,
4027 addEdges: addEdges,
4028 getClasses: getClasses,
4029 draw: draw
4030});
4031
4032/***/ }),
4033
4034/***/ "./src/diagrams/flowchart/parser/flow.jison":
4035/*!**************************************************!*\
4036 !*** ./src/diagrams/flowchart/parser/flow.jison ***!
4037 \**************************************************/
4038/*! no static exports found */
4039/***/ (function(module, exports, __webpack_require__) {
4040
4041/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */
4042/*
4043 Returns a Parser object of the following structure:
4044
4045 Parser: {
4046 yy: {}
4047 }
4048
4049 Parser.prototype: {
4050 yy: {},
4051 trace: function(),
4052 symbols_: {associative list: name ==> number},
4053 terminals_: {associative list: number ==> name},
4054 productions_: [...],
4055 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
4056 table: [...],
4057 defaultActions: {...},
4058 parseError: function(str, hash),
4059 parse: function(input),
4060
4061 lexer: {
4062 EOF: 1,
4063 parseError: function(str, hash),
4064 setInput: function(input),
4065 input: function(),
4066 unput: function(str),
4067 more: function(),
4068 less: function(n),
4069 pastInput: function(),
4070 upcomingInput: function(),
4071 showPosition: function(),
4072 test_match: function(regex_match_array, rule_index),
4073 next: function(),
4074 lex: function(),
4075 begin: function(condition),
4076 popState: function(),
4077 _currentRules: function(),
4078 topState: function(),
4079 pushState: function(condition),
4080
4081 options: {
4082 ranges: boolean (optional: true ==> token location info will include a .range[] member)
4083 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
4084 backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
4085 },
4086
4087 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
4088 rules: [...],
4089 conditions: {associative list: name ==> set},
4090 }
4091 }
4092
4093
4094 token location info (@$, _$, etc.): {
4095 first_line: n,
4096 last_line: n,
4097 first_column: n,
4098 last_column: n,
4099 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
4100 }
4101
4102
4103 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
4104 text: (matched text)
4105 token: (the produced terminal token, if any)
4106 line: (yylineno)
4107 }
4108 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
4109 loc: (yylloc)
4110 expected: (string describing the set of expected tokens)
4111 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
4112 }
4113*/
4114var parser = (function(){
4115var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,4],$V1=[1,3],$V2=[1,5],$V3=[1,8,9,10,11,26,34,61,62,63,64,65,66,76,77,80,81,82,84,85,91,92,93,94,95,96],$V4=[2,2],$V5=[1,12],$V6=[1,13],$V7=[1,14],$V8=[1,15],$V9=[1,22],$Va=[1,46],$Vb=[1,24],$Vc=[1,25],$Vd=[1,26],$Ve=[1,27],$Vf=[1,28],$Vg=[1,40],$Vh=[1,35],$Vi=[1,37],$Vj=[1,32],$Vk=[1,36],$Vl=[1,39],$Vm=[1,43],$Vn=[1,44],$Vo=[1,45],$Vp=[1,34],$Vq=[1,38],$Vr=[1,41],$Vs=[1,42],$Vt=[1,33],$Vu=[1,51],$Vv=[1,8,9,10,11,26,30,34,61,62,63,64,65,66,76,77,80,81,82,84,85,91,92,93,94,95,96],$Vw=[1,55],$Vx=[1,54],$Vy=[1,56],$Vz=[8,9,11,55,56],$VA=[8,9,10,11,55,56],$VB=[8,9,10,11,35,55,56],$VC=[8,9,10,11,28,34,35,37,39,41,43,45,47,48,50,55,56,66,76,77,80,81,82,84,85,91,92,93,94,95,96],$VD=[8,9,11,34,55,56,66,76,77,80,81,82,84,85,91,92,93,94,95,96],$VE=[34,66,76,77,80,81,82,84,85,91,92,93,94,95,96],$VF=[1,100],$VG=[1,121],$VH=[1,122],$VI=[1,123],$VJ=[1,124],$VK=[1,104],$VL=[1,95],$VM=[1,96],$VN=[1,92],$VO=[1,116],$VP=[1,117],$VQ=[1,118],$VR=[1,119],$VS=[1,120],$VT=[1,125],$VU=[1,126],$VV=[1,98],$VW=[1,106],$VX=[1,109],$VY=[1,107],$VZ=[1,108],$V_=[1,101],$V$=[1,114],$V01=[1,113],$V11=[1,97],$V21=[1,94],$V31=[1,103],$V41=[1,105],$V51=[1,110],$V61=[1,111],$V71=[1,112],$V81=[1,115],$V91=[8,9,10,11,26,30,34,61,62,63,64,65,66,76,77,80,81,82,84,85,91,92,93,94,95,96],$Va1=[1,129],$Vb1=[1,133],$Vc1=[1,135],$Vd1=[1,136],$Ve1=[8,9,10,11,12,13,26,28,29,30,34,38,40,42,44,46,47,49,51,55,56,57,61,62,63,64,65,66,67,70,76,77,80,81,82,84,85,86,87,91,92,93,94,95,96],$Vf1=[8,9,10,11,13,34,66,76,77,80,81,82,84,85,91,92,93,94,95,96],$Vg1=[10,77],$Vh1=[1,201],$Vi1=[1,205],$Vj1=[1,202],$Vk1=[1,199],$Vl1=[1,196],$Vm1=[1,197],$Vn1=[1,198],$Vo1=[1,200],$Vp1=[1,203],$Vq1=[1,204],$Vr1=[1,206],$Vs1=[8,9,11],$Vt1=[1,222],$Vu1=[8,9,11,77],$Vv1=[8,9,10,11,61,73,76,77,80,81,82,83,84,85,86];
4116var parser = {trace: function trace () { },
4117yy: {},
4118symbols_: {"error":2,"mermaidDoc":3,"graphConfig":4,"document":5,"line":6,"statement":7,"SEMI":8,"NEWLINE":9,"SPACE":10,"EOF":11,"GRAPH":12,"DIR":13,"FirstStmtSeperator":14,"ending":15,"endToken":16,"spaceList":17,"spaceListNewline":18,"verticeStatement":19,"separator":20,"styleStatement":21,"linkStyleStatement":22,"classDefStatement":23,"classStatement":24,"clickStatement":25,"subgraph":26,"text":27,"SQS":28,"SQE":29,"end":30,"link":31,"node":32,"vertex":33,"AMP":34,"STYLE_SEPARATOR":35,"idString":36,"PS":37,"PE":38,"(-":39,"-)":40,"STADIUMSTART":41,"STADIUMEND":42,"CYLINDERSTART":43,"CYLINDEREND":44,"DIAMOND_START":45,"DIAMOND_STOP":46,"TAGEND":47,"TRAPSTART":48,"TRAPEND":49,"INVTRAPSTART":50,"INVTRAPEND":51,"linkStatement":52,"arrowText":53,"TESTSTR":54,"START_LINK":55,"LINK":56,"PIPE":57,"textToken":58,"STR":59,"keywords":60,"STYLE":61,"LINKSTYLE":62,"CLASSDEF":63,"CLASS":64,"CLICK":65,"DOWN":66,"UP":67,"textNoTags":68,"textNoTagsToken":69,"DEFAULT":70,"stylesOpt":71,"alphaNum":72,"HEX":73,"numList":74,"INTERPOLATE":75,"NUM":76,"COMMA":77,"style":78,"styleComponent":79,"ALPHA":80,"COLON":81,"MINUS":82,"UNIT":83,"BRKT":84,"DOT":85,"PCT":86,"TAGSTART":87,"alphaNumToken":88,"idStringToken":89,"alphaNumStatement":90,"PUNCTUATION":91,"UNICODE_TEXT":92,"PLUS":93,"EQUALS":94,"MULT":95,"UNDERSCORE":96,"graphCodeTokens":97,"ARROW_CROSS":98,"ARROW_POINT":99,"ARROW_CIRCLE":100,"ARROW_OPEN":101,"QUOTE":102,"$accept":0,"$end":1},
4119terminals_: {2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"DIR",26:"subgraph",28:"SQS",29:"SQE",30:"end",34:"AMP",35:"STYLE_SEPARATOR",37:"PS",38:"PE",39:"(-",40:"-)",41:"STADIUMSTART",42:"STADIUMEND",43:"CYLINDERSTART",44:"CYLINDEREND",45:"DIAMOND_START",46:"DIAMOND_STOP",47:"TAGEND",48:"TRAPSTART",49:"TRAPEND",50:"INVTRAPSTART",51:"INVTRAPEND",54:"TESTSTR",55:"START_LINK",56:"LINK",57:"PIPE",59:"STR",61:"STYLE",62:"LINKSTYLE",63:"CLASSDEF",64:"CLASS",65:"CLICK",66:"DOWN",67:"UP",70:"DEFAULT",73:"HEX",75:"INTERPOLATE",76:"NUM",77:"COMMA",80:"ALPHA",81:"COLON",82:"MINUS",83:"UNIT",84:"BRKT",85:"DOT",86:"PCT",87:"TAGSTART",91:"PUNCTUATION",92:"UNICODE_TEXT",93:"PLUS",94:"EQUALS",95:"MULT",96:"UNDERSCORE",98:"ARROW_CROSS",99:"ARROW_POINT",100:"ARROW_CIRCLE",101:"ARROW_OPEN",102:"QUOTE"},
4120productions_: [0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,3],[15,2],[15,1],[16,1],[16,1],[16,1],[14,1],[14,1],[14,2],[18,2],[18,2],[18,1],[18,1],[17,2],[17,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[20,1],[20,1],[20,1],[19,3],[19,4],[19,2],[19,1],[32,1],[32,5],[32,3],[33,4],[33,6],[33,4],[33,4],[33,4],[33,4],[33,4],[33,6],[33,4],[33,4],[33,4],[33,4],[33,4],[33,1],[31,2],[31,3],[31,3],[31,1],[31,3],[52,1],[53,3],[27,1],[27,2],[27,1],[60,1],[60,1],[60,1],[60,1],[60,1],[60,1],[60,1],[60,1],[60,1],[60,1],[60,1],[68,1],[68,2],[23,5],[23,5],[24,5],[25,5],[25,7],[25,5],[25,7],[21,5],[21,5],[22,5],[22,5],[22,9],[22,9],[22,7],[22,7],[74,1],[74,3],[71,1],[71,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[69,1],[69,1],[69,1],[69,1],[36,1],[36,2],[72,1],[72,2],[90,1],[90,1],[90,1],[90,1],[88,1],[88,1],[88,1],[88,1],[88,1],[88,1],[88,1],[88,1],[88,1],[88,1],[88,1],[88,1],[88,1],[89,1],[89,1],[89,1],[89,1],[89,1],[89,1],[89,1],[89,1],[89,1],[89,1],[89,1],[89,1],[89,1],[89,1],[89,1],[97,1],[97,1],[97,1],[97,1],[97,1],[97,1],[97,1],[97,1],[97,1],[97,1],[97,1],[97,1],[97,1],[97,1],[97,1],[97,1],[97,1],[97,1],[97,1],[97,1],[97,1],[97,1],[97,1]],
4121performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
4122/* this == yyval */
4123
4124var $0 = $$.length - 1;
4125switch (yystate) {
4126case 2:
4127 this.$ = [];
4128break;
4129case 3:
4130
4131 if($$[$0] !== []){
4132 $$[$0-1].push($$[$0]);
4133 }
4134 this.$=$$[$0-1];
4135break;
4136case 4: case 66: case 68: case 80: case 126: case 128: case 129:
4137this.$=$$[$0];
4138break;
4139case 11:
4140 yy.setDirection($$[$0-1]);this.$ = $$[$0-1];
4141break;
4142case 26:
4143 /* console.warn('finat vs', $$[$0-1].nodes); */ this.$=$$[$0-1].nodes
4144break;
4145case 27: case 28: case 29: case 30: case 31:
4146this.$=[];
4147break;
4148case 32:
4149this.$=yy.addSubGraph($$[$0-6],$$[$0-1],$$[$0-4]);
4150break;
4151case 33:
4152this.$=yy.addSubGraph($$[$0-3],$$[$0-1],$$[$0-3]);
4153break;
4154case 34:
4155this.$=yy.addSubGraph(undefined,$$[$0-1],undefined);
4156break;
4157case 38:
4158 /* console.warn('vs',$$[$0-2].stmt,$$[$0]); */ yy.addLink($$[$0-2].stmt,$$[$0],$$[$0-1]); this.$ = { stmt: $$[$0], nodes: $$[$0].concat($$[$0-2].nodes) }
4159break;
4160case 39:
4161 /* console.warn('vs',$$[$0-3].stmt,$$[$0-1]); */ yy.addLink($$[$0-3].stmt,$$[$0-1],$$[$0-2]); this.$ = { stmt: $$[$0-1], nodes: $$[$0-1].concat($$[$0-3].nodes) }
4162break;
4163case 40:
4164/*console.warn('noda', $$[$0-1]);*/ this.$ = {stmt: $$[$0-1], nodes:$$[$0-1] }
4165break;
4166case 41:
4167 /*console.warn('noda', $$[$0]);*/ this.$ = {stmt: $$[$0], nodes:$$[$0] }
4168break;
4169case 42:
4170 /* console.warn('nod', $$[$0]); */ this.$ = [$$[$0]];
4171break;
4172case 43:
4173 this.$ = $$[$0-4].concat($$[$0]); /* console.warn('pip', $$[$0-4][0], $$[$0], this.$); */
4174break;
4175case 44:
4176this.$ = [$$[$0-2]];yy.setClass($$[$0-2],$$[$0])
4177break;
4178case 45:
4179this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'square');
4180break;
4181case 46:
4182this.$ = $$[$0-5];yy.addVertex($$[$0-5],$$[$0-2],'circle');
4183break;
4184case 47:
4185this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'ellipse');
4186break;
4187case 48:
4188this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'stadium');
4189break;
4190case 49:
4191this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'cylinder');
4192break;
4193case 50:
4194this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'round');
4195break;
4196case 51:
4197this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'diamond');
4198break;
4199case 52:
4200this.$ = $$[$0-5];yy.addVertex($$[$0-5],$$[$0-2],'hexagon');
4201break;
4202case 53:
4203this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'odd');
4204break;
4205case 54:
4206this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'trapezoid');
4207break;
4208case 55:
4209this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'inv_trapezoid');
4210break;
4211case 56:
4212this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'lean_right');
4213break;
4214case 57:
4215this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'lean_left');
4216break;
4217case 58:
4218 /*console.warn('h: ', $$[$0]);*/this.$ = $$[$0];yy.addVertex($$[$0]);
4219break;
4220case 59:
4221$$[$0-1].text = $$[$0];this.$ = $$[$0-1];
4222break;
4223case 60: case 61:
4224$$[$0-2].text = $$[$0-1];this.$ = $$[$0-2];
4225break;
4226case 62:
4227this.$ = $$[$0];
4228break;
4229case 63:
4230var inf = yy.destructLink($$[$0], $$[$0-2]); this.$ = {"type":inf.type,"stroke":inf.stroke,"text":$$[$0-1]};
4231break;
4232case 64:
4233var inf = yy.destructLink($$[$0]);this.$ = {"type":inf.type,"stroke":inf.stroke};
4234break;
4235case 65:
4236this.$ = $$[$0-1];
4237break;
4238case 67: case 81: case 127:
4239this.$=$$[$0-1]+''+$$[$0];
4240break;
4241case 82: case 83:
4242this.$ = $$[$0-4];yy.addClass($$[$0-2],$$[$0]);
4243break;
4244case 84:
4245this.$ = $$[$0-4];yy.setClass($$[$0-2], $$[$0]);
4246break;
4247case 85:
4248this.$ = $$[$0-4];yy.setClickEvent($$[$0-2], $$[$0], undefined);
4249break;
4250case 86:
4251this.$ = $$[$0-6];yy.setClickEvent($$[$0-4], $$[$0-2], $$[$0]) ;
4252break;
4253case 87:
4254this.$ = $$[$0-4];yy.setLink($$[$0-2], $$[$0], undefined);
4255break;
4256case 88:
4257this.$ = $$[$0-6];yy.setLink($$[$0-4], $$[$0-2], $$[$0] );
4258break;
4259case 89:
4260this.$ = $$[$0-4];yy.addVertex($$[$0-2],undefined,undefined,$$[$0]);
4261break;
4262case 90: case 92:
4263this.$ = $$[$0-4];yy.updateLink($$[$0-2],$$[$0]);
4264break;
4265case 91:
4266this.$ = $$[$0-4];yy.updateLink([$$[$0-2]],$$[$0]);
4267break;
4268case 93:
4269this.$ = $$[$0-8];yy.updateLinkInterpolate([$$[$0-6]],$$[$0-2]);yy.updateLink([$$[$0-6]],$$[$0]);
4270break;
4271case 94:
4272this.$ = $$[$0-8];yy.updateLinkInterpolate($$[$0-6],$$[$0-2]);yy.updateLink($$[$0-6],$$[$0]);
4273break;
4274case 95:
4275this.$ = $$[$0-6];yy.updateLinkInterpolate([$$[$0-4]],$$[$0]);
4276break;
4277case 96:
4278this.$ = $$[$0-6];yy.updateLinkInterpolate($$[$0-4],$$[$0]);
4279break;
4280case 97: case 99:
4281this.$ = [$$[$0]]
4282break;
4283case 98: case 100:
4284$$[$0-2].push($$[$0]);this.$ = $$[$0-2];
4285break;
4286case 102:
4287this.$ = $$[$0-1] + $$[$0];
4288break;
4289case 124:
4290this.$=$$[$0]
4291break;
4292case 125:
4293this.$=$$[$0-1]+''+$$[$0]
4294break;
4295case 130:
4296this.$='v';
4297break;
4298case 131:
4299this.$='-';
4300break;
4301}
4302},
4303table: [{3:1,4:2,9:$V0,10:$V1,12:$V2},{1:[3]},o($V3,$V4,{5:6}),{4:7,9:$V0,10:$V1,12:$V2},{4:8,9:$V0,10:$V1,12:$V2},{13:[1,9]},{1:[2,1],6:10,7:11,8:$V5,9:$V6,10:$V7,11:$V8,19:16,21:17,22:18,23:19,24:20,25:21,26:$V9,32:23,33:29,34:$Va,36:30,61:$Vb,62:$Vc,63:$Vd,64:$Ve,65:$Vf,66:$Vg,76:$Vh,77:$Vi,80:$Vj,81:$Vk,82:$Vl,84:$Vm,85:$Vn,89:31,91:$Vo,92:$Vp,93:$Vq,94:$Vr,95:$Vs,96:$Vt},o($V3,[2,9]),o($V3,[2,10]),{8:[1,48],9:[1,49],10:$Vu,14:47,17:50},o($Vv,[2,3]),o($Vv,[2,4]),o($Vv,[2,5]),o($Vv,[2,6]),o($Vv,[2,7]),o($Vv,[2,8]),{8:$Vw,9:$Vx,11:$Vy,20:52,31:53,52:57,55:[1,58],56:[1,59]},{8:$Vw,9:$Vx,11:$Vy,20:60},{8:$Vw,9:$Vx,11:$Vy,20:61},{8:$Vw,9:$Vx,11:$Vy,20:62},{8:$Vw,9:$Vx,11:$Vy,20:63},{8:$Vw,9:$Vx,11:$Vy,20:64},{8:$Vw,9:$Vx,10:[1,65],11:$Vy,20:66},o($Vz,[2,41],{17:67,10:$Vu}),{10:[1,68]},{10:[1,69]},{10:[1,70]},{10:[1,71]},{10:[1,72]},o($VA,[2,42],{35:[1,73]}),o($VB,[2,58],{89:83,28:[1,74],34:$Va,37:[1,75],39:[1,76],41:[1,77],43:[1,78],45:[1,79],47:[1,80],48:[1,81],50:[1,82],66:$Vg,76:$Vh,77:$Vi,80:$Vj,81:$Vk,82:$Vl,84:$Vm,85:$Vn,91:$Vo,92:$Vp,93:$Vq,94:$Vr,95:$Vs,96:$Vt}),o($VC,[2,124]),o($VC,[2,145]),o($VC,[2,146]),o($VC,[2,147]),o($VC,[2,148]),o($VC,[2,149]),o($VC,[2,150]),o($VC,[2,151]),o($VC,[2,152]),o($VC,[2,153]),o($VC,[2,154]),o($VC,[2,155]),o($VC,[2,156]),o($VC,[2,157]),o($VC,[2,158]),o($VC,[2,159]),o($V3,[2,11]),o($V3,[2,17]),o($V3,[2,18]),{9:[1,84]},o($VD,[2,25],{17:85,10:$Vu}),o($Vv,[2,26]),{32:86,33:29,34:$Va,36:30,66:$Vg,76:$Vh,77:$Vi,80:$Vj,81:$Vk,82:$Vl,84:$Vm,85:$Vn,89:31,91:$Vo,92:$Vp,93:$Vq,94:$Vr,95:$Vs,96:$Vt},o($Vv,[2,35]),o($Vv,[2,36]),o($Vv,[2,37]),o($VE,[2,62],{53:87,54:[1,88],57:[1,89]}),{10:$VF,12:$VG,13:$VH,26:$VI,27:90,30:$VJ,34:$VK,47:$VL,55:$VM,58:91,59:$VN,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},o([34,54,57,66,76,77,80,81,82,84,85,91,92,93,94,95,96],[2,64]),o($Vv,[2,27]),o($Vv,[2,28]),o($Vv,[2,29]),o($Vv,[2,30]),o($Vv,[2,31]),{10:$VF,12:$VG,13:$VH,26:$VI,27:127,30:$VJ,34:$VK,47:$VL,55:$VM,58:91,59:$VN,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},o($V91,$V4,{5:128}),o($Vz,[2,40],{34:$Va1}),{13:$Vb1,34:$VK,66:$Vc1,72:130,73:[1,131],76:$VW,77:$VX,80:$VY,81:$VZ,82:$Vd1,84:$V$,85:$V01,88:134,90:132,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{70:[1,137],74:138,76:[1,139]},{13:$Vb1,34:$VK,66:$Vc1,70:[1,140],72:141,76:$VW,77:$VX,80:$VY,81:$VZ,82:$Vd1,84:$V$,85:$V01,88:134,90:132,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{13:$Vb1,34:$VK,66:$Vc1,72:142,76:$VW,77:$VX,80:$VY,81:$VZ,82:$Vd1,84:$V$,85:$V01,88:134,90:132,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{13:$Vb1,34:$VK,66:$Vc1,72:143,76:$VW,77:$VX,80:$VY,81:$VZ,82:$Vd1,84:$V$,85:$V01,88:134,90:132,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{34:$Va,36:144,66:$Vg,76:$Vh,77:$Vi,80:$Vj,81:$Vk,82:$Vl,84:$Vm,85:$Vn,89:31,91:$Vo,92:$Vp,93:$Vq,94:$Vr,95:$Vs,96:$Vt},{10:$VF,12:$VG,13:$VH,26:$VI,27:145,30:$VJ,34:$VK,47:$VL,55:$VM,58:91,59:$VN,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{10:$VF,12:$VG,13:$VH,26:$VI,27:147,30:$VJ,34:$VK,37:[1,146],47:$VL,55:$VM,58:91,59:$VN,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{10:$VF,12:$VG,13:$VH,26:$VI,27:148,30:$VJ,34:$VK,47:$VL,55:$VM,58:91,59:$VN,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{10:$VF,12:$VG,13:$VH,26:$VI,27:149,30:$VJ,34:$VK,47:$VL,55:$VM,58:91,59:$VN,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{10:$VF,12:$VG,13:$VH,26:$VI,27:150,30:$VJ,34:$VK,47:$VL,55:$VM,58:91,59:$VN,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{10:$VF,12:$VG,13:$VH,26:$VI,27:151,30:$VJ,34:$VK,45:[1,152],47:$VL,55:$VM,58:91,59:$VN,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{10:$VF,12:$VG,13:$VH,26:$VI,27:153,30:$VJ,34:$VK,47:$VL,55:$VM,58:91,59:$VN,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{10:$VF,12:$VG,13:$VH,26:$VI,27:154,30:$VJ,34:$VK,47:$VL,55:$VM,58:91,59:$VN,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{10:$VF,12:$VG,13:$VH,26:$VI,27:155,30:$VJ,34:$VK,47:$VL,55:$VM,58:91,59:$VN,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},o($VC,[2,125]),o($V3,[2,19]),o($VD,[2,24]),o($Vz,[2,38],{17:156,10:$Vu}),o($VE,[2,59],{10:[1,157]}),{10:[1,158]},{10:$VF,12:$VG,13:$VH,26:$VI,27:159,30:$VJ,34:$VK,47:$VL,55:$VM,58:91,59:$VN,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{10:$VF,12:$VG,13:$VH,26:$VI,30:$VJ,34:$VK,47:$VL,55:$VM,56:[1,160],58:161,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},o($Ve1,[2,66]),o($Ve1,[2,68]),o($Ve1,[2,114]),o($Ve1,[2,115]),o($Ve1,[2,116]),o($Ve1,[2,117]),o($Ve1,[2,118]),o($Ve1,[2,119]),o($Ve1,[2,120]),o($Ve1,[2,121]),o($Ve1,[2,122]),o($Ve1,[2,123]),o($Ve1,[2,132]),o($Ve1,[2,133]),o($Ve1,[2,134]),o($Ve1,[2,135]),o($Ve1,[2,136]),o($Ve1,[2,137]),o($Ve1,[2,138]),o($Ve1,[2,139]),o($Ve1,[2,140]),o($Ve1,[2,141]),o($Ve1,[2,142]),o($Ve1,[2,143]),o($Ve1,[2,144]),o($Ve1,[2,69]),o($Ve1,[2,70]),o($Ve1,[2,71]),o($Ve1,[2,72]),o($Ve1,[2,73]),o($Ve1,[2,74]),o($Ve1,[2,75]),o($Ve1,[2,76]),o($Ve1,[2,77]),o($Ve1,[2,78]),o($Ve1,[2,79]),{8:$Vw,9:$Vx,10:$VF,11:$Vy,12:$VG,13:$VH,20:163,26:$VI,28:[1,162],30:$VJ,34:$VK,47:$VL,55:$VM,58:161,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{6:10,7:11,8:$V5,9:$V6,10:$V7,11:$V8,19:16,21:17,22:18,23:19,24:20,25:21,26:$V9,30:[1,164],32:23,33:29,34:$Va,36:30,61:$Vb,62:$Vc,63:$Vd,64:$Ve,65:$Vf,66:$Vg,76:$Vh,77:$Vi,80:$Vj,81:$Vk,82:$Vl,84:$Vm,85:$Vn,89:31,91:$Vo,92:$Vp,93:$Vq,94:$Vr,95:$Vs,96:$Vt},{10:$Vu,17:165},{10:[1,166],13:$Vb1,34:$VK,66:$Vc1,76:$VW,77:$VX,80:$VY,81:$VZ,82:$Vd1,84:$V$,85:$V01,88:134,90:167,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{10:[1,168]},o($Vf1,[2,126]),o($Vf1,[2,128]),o($Vf1,[2,129]),o($Vf1,[2,130]),o($Vf1,[2,131]),{10:[1,169]},{10:[1,170],77:[1,171]},o($Vg1,[2,97]),{10:[1,172]},{10:[1,173],13:$Vb1,34:$VK,66:$Vc1,76:$VW,77:$VX,80:$VY,81:$VZ,82:$Vd1,84:$V$,85:$V01,88:134,90:167,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{10:[1,174],13:$Vb1,34:$VK,66:$Vc1,76:$VW,77:$VX,80:$VY,81:$VZ,82:$Vd1,84:$V$,85:$V01,88:134,90:167,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{10:[1,175],13:$Vb1,34:$VK,66:$Vc1,76:$VW,77:$VX,80:$VY,81:$VZ,82:$Vd1,84:$V$,85:$V01,88:134,90:167,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},o($VA,[2,44],{89:83,34:$Va,66:$Vg,76:$Vh,77:$Vi,80:$Vj,81:$Vk,82:$Vl,84:$Vm,85:$Vn,91:$Vo,92:$Vp,93:$Vq,94:$Vr,95:$Vs,96:$Vt}),{10:$VF,12:$VG,13:$VH,26:$VI,29:[1,176],30:$VJ,34:$VK,47:$VL,55:$VM,58:161,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{10:$VF,12:$VG,13:$VH,26:$VI,27:177,30:$VJ,34:$VK,47:$VL,55:$VM,58:91,59:$VN,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{10:$VF,12:$VG,13:$VH,26:$VI,30:$VJ,34:$VK,38:[1,178],47:$VL,55:$VM,58:161,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{10:$VF,12:$VG,13:$VH,26:$VI,30:$VJ,34:$VK,40:[1,179],47:$VL,55:$VM,58:161,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{10:$VF,12:$VG,13:$VH,26:$VI,30:$VJ,34:$VK,42:[1,180],47:$VL,55:$VM,58:161,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{10:$VF,12:$VG,13:$VH,26:$VI,30:$VJ,34:$VK,44:[1,181],47:$VL,55:$VM,58:161,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{10:$VF,12:$VG,13:$VH,26:$VI,30:$VJ,34:$VK,46:[1,182],47:$VL,55:$VM,58:161,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{10:$VF,12:$VG,13:$VH,26:$VI,27:183,30:$VJ,34:$VK,47:$VL,55:$VM,58:91,59:$VN,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{10:$VF,12:$VG,13:$VH,26:$VI,29:[1,184],30:$VJ,34:$VK,47:$VL,55:$VM,58:161,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{10:$VF,12:$VG,13:$VH,26:$VI,30:$VJ,34:$VK,47:$VL,49:[1,185],51:[1,186],55:$VM,58:161,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{10:$VF,12:$VG,13:$VH,26:$VI,30:$VJ,34:$VK,47:$VL,49:[1,188],51:[1,187],55:$VM,58:161,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},o($Vz,[2,39],{34:$Va1}),o($VE,[2,61]),o($VE,[2,60]),{10:$VF,12:$VG,13:$VH,26:$VI,30:$VJ,34:$VK,47:$VL,55:$VM,57:[1,189],58:161,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},o($VE,[2,63]),o($Ve1,[2,67]),{10:$VF,12:$VG,13:$VH,26:$VI,27:190,30:$VJ,34:$VK,47:$VL,55:$VM,58:91,59:$VN,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},o($V91,$V4,{5:191}),o($Vv,[2,34]),{33:192,34:$Va,36:30,66:$Vg,76:$Vh,77:$Vi,80:$Vj,81:$Vk,82:$Vl,84:$Vm,85:$Vn,89:31,91:$Vo,92:$Vp,93:$Vq,94:$Vr,95:$Vs,96:$Vt},{10:$Vh1,61:$Vi1,71:193,73:$Vj1,76:$Vk1,78:194,79:195,80:$Vl1,81:$Vm1,82:$Vn1,83:$Vo1,84:$Vp1,85:$Vq1,86:$Vr1},o($Vf1,[2,127]),{10:$Vh1,61:$Vi1,71:207,73:$Vj1,76:$Vk1,78:194,79:195,80:$Vl1,81:$Vm1,82:$Vn1,83:$Vo1,84:$Vp1,85:$Vq1,86:$Vr1},{10:$Vh1,61:$Vi1,71:208,73:$Vj1,75:[1,209],76:$Vk1,78:194,79:195,80:$Vl1,81:$Vm1,82:$Vn1,83:$Vo1,84:$Vp1,85:$Vq1,86:$Vr1},{10:$Vh1,61:$Vi1,71:210,73:$Vj1,75:[1,211],76:$Vk1,78:194,79:195,80:$Vl1,81:$Vm1,82:$Vn1,83:$Vo1,84:$Vp1,85:$Vq1,86:$Vr1},{76:[1,212]},{10:$Vh1,61:$Vi1,71:213,73:$Vj1,76:$Vk1,78:194,79:195,80:$Vl1,81:$Vm1,82:$Vn1,83:$Vo1,84:$Vp1,85:$Vq1,86:$Vr1},{10:$Vh1,61:$Vi1,71:214,73:$Vj1,76:$Vk1,78:194,79:195,80:$Vl1,81:$Vm1,82:$Vn1,83:$Vo1,84:$Vp1,85:$Vq1,86:$Vr1},{13:$Vb1,34:$VK,66:$Vc1,72:215,76:$VW,77:$VX,80:$VY,81:$VZ,82:$Vd1,84:$V$,85:$V01,88:134,90:132,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{13:$Vb1,34:$VK,59:[1,217],66:$Vc1,72:216,76:$VW,77:$VX,80:$VY,81:$VZ,82:$Vd1,84:$V$,85:$V01,88:134,90:132,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},o($VB,[2,45]),{10:$VF,12:$VG,13:$VH,26:$VI,30:$VJ,34:$VK,38:[1,218],47:$VL,55:$VM,58:161,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},o($VB,[2,50]),o($VB,[2,47]),o($VB,[2,48]),o($VB,[2,49]),o($VB,[2,51]),{10:$VF,12:$VG,13:$VH,26:$VI,30:$VJ,34:$VK,46:[1,219],47:$VL,55:$VM,58:161,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},o($VB,[2,53]),o($VB,[2,54]),o($VB,[2,56]),o($VB,[2,55]),o($VB,[2,57]),o([10,34,66,76,77,80,81,82,84,85,91,92,93,94,95,96],[2,65]),{10:$VF,12:$VG,13:$VH,26:$VI,29:[1,220],30:$VJ,34:$VK,47:$VL,55:$VM,58:161,60:102,61:$VO,62:$VP,63:$VQ,64:$VR,65:$VS,66:$VT,67:$VU,69:93,70:$VV,76:$VW,77:$VX,80:$VY,81:$VZ,82:$V_,84:$V$,85:$V01,86:$V11,87:$V21,88:99,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{6:10,7:11,8:$V5,9:$V6,10:$V7,11:$V8,19:16,21:17,22:18,23:19,24:20,25:21,26:$V9,30:[1,221],32:23,33:29,34:$Va,36:30,61:$Vb,62:$Vc,63:$Vd,64:$Ve,65:$Vf,66:$Vg,76:$Vh,77:$Vi,80:$Vj,81:$Vk,82:$Vl,84:$Vm,85:$Vn,89:31,91:$Vo,92:$Vp,93:$Vq,94:$Vr,95:$Vs,96:$Vt},o($VA,[2,43]),o($Vs1,[2,89],{77:$Vt1}),o($Vu1,[2,99],{79:223,10:$Vh1,61:$Vi1,73:$Vj1,76:$Vk1,80:$Vl1,81:$Vm1,82:$Vn1,83:$Vo1,84:$Vp1,85:$Vq1,86:$Vr1}),o($Vv1,[2,101]),o($Vv1,[2,103]),o($Vv1,[2,104]),o($Vv1,[2,105]),o($Vv1,[2,106]),o($Vv1,[2,107]),o($Vv1,[2,108]),o($Vv1,[2,109]),o($Vv1,[2,110]),o($Vv1,[2,111]),o($Vv1,[2,112]),o($Vv1,[2,113]),o($Vs1,[2,90],{77:$Vt1}),o($Vs1,[2,91],{77:$Vt1}),{10:[1,224]},o($Vs1,[2,92],{77:$Vt1}),{10:[1,225]},o($Vg1,[2,98]),o($Vs1,[2,82],{77:$Vt1}),o($Vs1,[2,83],{77:$Vt1}),o($Vs1,[2,84],{88:134,90:167,13:$Vb1,34:$VK,66:$Vc1,76:$VW,77:$VX,80:$VY,81:$VZ,82:$Vd1,84:$V$,85:$V01,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81}),o($Vs1,[2,85],{88:134,90:167,10:[1,226],13:$Vb1,34:$VK,66:$Vc1,76:$VW,77:$VX,80:$VY,81:$VZ,82:$Vd1,84:$V$,85:$V01,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81}),o($Vs1,[2,87],{10:[1,227]}),{38:[1,228]},{46:[1,229]},{8:$Vw,9:$Vx,11:$Vy,20:230},o($Vv,[2,33]),{10:$Vh1,61:$Vi1,73:$Vj1,76:$Vk1,78:231,79:195,80:$Vl1,81:$Vm1,82:$Vn1,83:$Vo1,84:$Vp1,85:$Vq1,86:$Vr1},o($Vv1,[2,102]),{13:$Vb1,34:$VK,66:$Vc1,72:232,76:$VW,77:$VX,80:$VY,81:$VZ,82:$Vd1,84:$V$,85:$V01,88:134,90:132,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{13:$Vb1,34:$VK,66:$Vc1,72:233,76:$VW,77:$VX,80:$VY,81:$VZ,82:$Vd1,84:$V$,85:$V01,88:134,90:132,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81},{59:[1,234]},{59:[1,235]},o($VB,[2,46]),o($VB,[2,52]),o($V91,$V4,{5:236}),o($Vu1,[2,100],{79:223,10:$Vh1,61:$Vi1,73:$Vj1,76:$Vk1,80:$Vl1,81:$Vm1,82:$Vn1,83:$Vo1,84:$Vp1,85:$Vq1,86:$Vr1}),o($Vs1,[2,95],{88:134,90:167,10:[1,237],13:$Vb1,34:$VK,66:$Vc1,76:$VW,77:$VX,80:$VY,81:$VZ,82:$Vd1,84:$V$,85:$V01,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81}),o($Vs1,[2,96],{88:134,90:167,10:[1,238],13:$Vb1,34:$VK,66:$Vc1,76:$VW,77:$VX,80:$VY,81:$VZ,82:$Vd1,84:$V$,85:$V01,91:$V31,92:$V41,93:$V51,94:$V61,95:$V71,96:$V81}),o($Vs1,[2,86]),o($Vs1,[2,88]),{6:10,7:11,8:$V5,9:$V6,10:$V7,11:$V8,19:16,21:17,22:18,23:19,24:20,25:21,26:$V9,30:[1,239],32:23,33:29,34:$Va,36:30,61:$Vb,62:$Vc,63:$Vd,64:$Ve,65:$Vf,66:$Vg,76:$Vh,77:$Vi,80:$Vj,81:$Vk,82:$Vl,84:$Vm,85:$Vn,89:31,91:$Vo,92:$Vp,93:$Vq,94:$Vr,95:$Vs,96:$Vt},{10:$Vh1,61:$Vi1,71:240,73:$Vj1,76:$Vk1,78:194,79:195,80:$Vl1,81:$Vm1,82:$Vn1,83:$Vo1,84:$Vp1,85:$Vq1,86:$Vr1},{10:$Vh1,61:$Vi1,71:241,73:$Vj1,76:$Vk1,78:194,79:195,80:$Vl1,81:$Vm1,82:$Vn1,83:$Vo1,84:$Vp1,85:$Vq1,86:$Vr1},o($Vv,[2,32]),o($Vs1,[2,93],{77:$Vt1}),o($Vs1,[2,94],{77:$Vt1})],
4304defaultActions: {},
4305parseError: function parseError (str, hash) {
4306 if (hash.recoverable) {
4307 this.trace(str);
4308 } else {
4309 var error = new Error(str);
4310 error.hash = hash;
4311 throw error;
4312 }
4313},
4314parse: function parse(input) {
4315 var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
4316 var args = lstack.slice.call(arguments, 1);
4317 var lexer = Object.create(this.lexer);
4318 var sharedState = { yy: {} };
4319 for (var k in this.yy) {
4320 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
4321 sharedState.yy[k] = this.yy[k];
4322 }
4323 }
4324 lexer.setInput(input, sharedState.yy);
4325 sharedState.yy.lexer = lexer;
4326 sharedState.yy.parser = this;
4327 if (typeof lexer.yylloc == 'undefined') {
4328 lexer.yylloc = {};
4329 }
4330 var yyloc = lexer.yylloc;
4331 lstack.push(yyloc);
4332 var ranges = lexer.options && lexer.options.ranges;
4333 if (typeof sharedState.yy.parseError === 'function') {
4334 this.parseError = sharedState.yy.parseError;
4335 } else {
4336 this.parseError = Object.getPrototypeOf(this).parseError;
4337 }
4338 function popStack(n) {
4339 stack.length = stack.length - 2 * n;
4340 vstack.length = vstack.length - n;
4341 lstack.length = lstack.length - n;
4342 }
4343 function lex() {
4344 var token;
4345 token = tstack.pop() || lexer.lex() || EOF;
4346 if (typeof token !== 'number') {
4347 if (token instanceof Array) {
4348 tstack = token;
4349 token = tstack.pop();
4350 }
4351 token = self.symbols_[token] || token;
4352 }
4353 return token;
4354 }
4355 var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
4356 while (true) {
4357 state = stack[stack.length - 1];
4358 if (this.defaultActions[state]) {
4359 action = this.defaultActions[state];
4360 } else {
4361 if (symbol === null || typeof symbol == 'undefined') {
4362 symbol = lex();
4363 }
4364 action = table[state] && table[state][symbol];
4365 }
4366 if (typeof action === 'undefined' || !action.length || !action[0]) {
4367 var errStr = '';
4368 expected = [];
4369 for (p in table[state]) {
4370 if (this.terminals_[p] && p > TERROR) {
4371 expected.push('\'' + this.terminals_[p] + '\'');
4372 }
4373 }
4374 if (lexer.showPosition) {
4375 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
4376 } else {
4377 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
4378 }
4379 this.parseError(errStr, {
4380 text: lexer.match,
4381 token: this.terminals_[symbol] || symbol,
4382 line: lexer.yylineno,
4383 loc: yyloc,
4384 expected: expected
4385 });
4386 }
4387 if (action[0] instanceof Array && action.length > 1) {
4388 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
4389 }
4390 switch (action[0]) {
4391 case 1:
4392 stack.push(symbol);
4393 vstack.push(lexer.yytext);
4394 lstack.push(lexer.yylloc);
4395 stack.push(action[1]);
4396 symbol = null;
4397 if (!preErrorSymbol) {
4398 yyleng = lexer.yyleng;
4399 yytext = lexer.yytext;
4400 yylineno = lexer.yylineno;
4401 yyloc = lexer.yylloc;
4402 if (recovering > 0) {
4403 recovering--;
4404 }
4405 } else {
4406 symbol = preErrorSymbol;
4407 preErrorSymbol = null;
4408 }
4409 break;
4410 case 2:
4411 len = this.productions_[action[1]][1];
4412 yyval.$ = vstack[vstack.length - len];
4413 yyval._$ = {
4414 first_line: lstack[lstack.length - (len || 1)].first_line,
4415 last_line: lstack[lstack.length - 1].last_line,
4416 first_column: lstack[lstack.length - (len || 1)].first_column,
4417 last_column: lstack[lstack.length - 1].last_column
4418 };
4419 if (ranges) {
4420 yyval._$.range = [
4421 lstack[lstack.length - (len || 1)].range[0],
4422 lstack[lstack.length - 1].range[1]
4423 ];
4424 }
4425 r = this.performAction.apply(yyval, [
4426 yytext,
4427 yyleng,
4428 yylineno,
4429 sharedState.yy,
4430 action[1],
4431 vstack,
4432 lstack
4433 ].concat(args));
4434 if (typeof r !== 'undefined') {
4435 return r;
4436 }
4437 if (len) {
4438 stack = stack.slice(0, -1 * len * 2);
4439 vstack = vstack.slice(0, -1 * len);
4440 lstack = lstack.slice(0, -1 * len);
4441 }
4442 stack.push(this.productions_[action[1]][0]);
4443 vstack.push(yyval.$);
4444 lstack.push(yyval._$);
4445 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
4446 stack.push(newState);
4447 break;
4448 case 3:
4449 return true;
4450 }
4451 }
4452 return true;
4453}};
4454
4455/* generated by jison-lex 0.3.4 */
4456var lexer = (function(){
4457var lexer = ({
4458
4459EOF:1,
4460
4461parseError:function parseError(str, hash) {
4462 if (this.yy.parser) {
4463 this.yy.parser.parseError(str, hash);
4464 } else {
4465 throw new Error(str);
4466 }
4467 },
4468
4469// resets the lexer, sets new input
4470setInput:function (input, yy) {
4471 this.yy = yy || this.yy || {};
4472 this._input = input;
4473 this._more = this._backtrack = this.done = false;
4474 this.yylineno = this.yyleng = 0;
4475 this.yytext = this.matched = this.match = '';
4476 this.conditionStack = ['INITIAL'];
4477 this.yylloc = {
4478 first_line: 1,
4479 first_column: 0,
4480 last_line: 1,
4481 last_column: 0
4482 };
4483 if (this.options.ranges) {
4484 this.yylloc.range = [0,0];
4485 }
4486 this.offset = 0;
4487 return this;
4488 },
4489
4490// consumes and returns one char from the input
4491input:function () {
4492 var ch = this._input[0];
4493 this.yytext += ch;
4494 this.yyleng++;
4495 this.offset++;
4496 this.match += ch;
4497 this.matched += ch;
4498 var lines = ch.match(/(?:\r\n?|\n).*/g);
4499 if (lines) {
4500 this.yylineno++;
4501 this.yylloc.last_line++;
4502 } else {
4503 this.yylloc.last_column++;
4504 }
4505 if (this.options.ranges) {
4506 this.yylloc.range[1]++;
4507 }
4508
4509 this._input = this._input.slice(1);
4510 return ch;
4511 },
4512
4513// unshifts one char (or a string) into the input
4514unput:function (ch) {
4515 var len = ch.length;
4516 var lines = ch.split(/(?:\r\n?|\n)/g);
4517
4518 this._input = ch + this._input;
4519 this.yytext = this.yytext.substr(0, this.yytext.length - len);
4520 //this.yyleng -= len;
4521 this.offset -= len;
4522 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
4523 this.match = this.match.substr(0, this.match.length - 1);
4524 this.matched = this.matched.substr(0, this.matched.length - 1);
4525
4526 if (lines.length - 1) {
4527 this.yylineno -= lines.length - 1;
4528 }
4529 var r = this.yylloc.range;
4530
4531 this.yylloc = {
4532 first_line: this.yylloc.first_line,
4533 last_line: this.yylineno + 1,
4534 first_column: this.yylloc.first_column,
4535 last_column: lines ?
4536 (lines.length === oldLines.length ? this.yylloc.first_column : 0)
4537 + oldLines[oldLines.length - lines.length].length - lines[0].length :
4538 this.yylloc.first_column - len
4539 };
4540
4541 if (this.options.ranges) {
4542 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
4543 }
4544 this.yyleng = this.yytext.length;
4545 return this;
4546 },
4547
4548// When called from action, caches matched text and appends it on next action
4549more:function () {
4550 this._more = true;
4551 return this;
4552 },
4553
4554// 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.
4555reject:function () {
4556 if (this.options.backtrack_lexer) {
4557 this._backtrack = true;
4558 } else {
4559 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(), {
4560 text: "",
4561 token: null,
4562 line: this.yylineno
4563 });
4564
4565 }
4566 return this;
4567 },
4568
4569// retain first n characters of the match
4570less:function (n) {
4571 this.unput(this.match.slice(n));
4572 },
4573
4574// displays already matched input, i.e. for error messages
4575pastInput:function () {
4576 var past = this.matched.substr(0, this.matched.length - this.match.length);
4577 return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
4578 },
4579
4580// displays upcoming input, i.e. for error messages
4581upcomingInput:function () {
4582 var next = this.match;
4583 if (next.length < 20) {
4584 next += this._input.substr(0, 20-next.length);
4585 }
4586 return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
4587 },
4588
4589// displays the character position where the lexing error occurred, i.e. for error messages
4590showPosition:function () {
4591 var pre = this.pastInput();
4592 var c = new Array(pre.length + 1).join("-");
4593 return pre + this.upcomingInput() + "\n" + c + "^";
4594 },
4595
4596// test the lexed token: return FALSE when not a match, otherwise return token
4597test_match:function(match, indexed_rule) {
4598 var token,
4599 lines,
4600 backup;
4601
4602 if (this.options.backtrack_lexer) {
4603 // save context
4604 backup = {
4605 yylineno: this.yylineno,
4606 yylloc: {
4607 first_line: this.yylloc.first_line,
4608 last_line: this.last_line,
4609 first_column: this.yylloc.first_column,
4610 last_column: this.yylloc.last_column
4611 },
4612 yytext: this.yytext,
4613 match: this.match,
4614 matches: this.matches,
4615 matched: this.matched,
4616 yyleng: this.yyleng,
4617 offset: this.offset,
4618 _more: this._more,
4619 _input: this._input,
4620 yy: this.yy,
4621 conditionStack: this.conditionStack.slice(0),
4622 done: this.done
4623 };
4624 if (this.options.ranges) {
4625 backup.yylloc.range = this.yylloc.range.slice(0);
4626 }
4627 }
4628
4629 lines = match[0].match(/(?:\r\n?|\n).*/g);
4630 if (lines) {
4631 this.yylineno += lines.length;
4632 }
4633 this.yylloc = {
4634 first_line: this.yylloc.last_line,
4635 last_line: this.yylineno + 1,
4636 first_column: this.yylloc.last_column,
4637 last_column: lines ?
4638 lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
4639 this.yylloc.last_column + match[0].length
4640 };
4641 this.yytext += match[0];
4642 this.match += match[0];
4643 this.matches = match;
4644 this.yyleng = this.yytext.length;
4645 if (this.options.ranges) {
4646 this.yylloc.range = [this.offset, this.offset += this.yyleng];
4647 }
4648 this._more = false;
4649 this._backtrack = false;
4650 this._input = this._input.slice(match[0].length);
4651 this.matched += match[0];
4652 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
4653 if (this.done && this._input) {
4654 this.done = false;
4655 }
4656 if (token) {
4657 return token;
4658 } else if (this._backtrack) {
4659 // recover context
4660 for (var k in backup) {
4661 this[k] = backup[k];
4662 }
4663 return false; // rule action called reject() implying the next rule should be tested instead.
4664 }
4665 return false;
4666 },
4667
4668// return next match in input
4669next:function () {
4670 if (this.done) {
4671 return this.EOF;
4672 }
4673 if (!this._input) {
4674 this.done = true;
4675 }
4676
4677 var token,
4678 match,
4679 tempMatch,
4680 index;
4681 if (!this._more) {
4682 this.yytext = '';
4683 this.match = '';
4684 }
4685 var rules = this._currentRules();
4686 for (var i = 0; i < rules.length; i++) {
4687 tempMatch = this._input.match(this.rules[rules[i]]);
4688 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
4689 match = tempMatch;
4690 index = i;
4691 if (this.options.backtrack_lexer) {
4692 token = this.test_match(tempMatch, rules[i]);
4693 if (token !== false) {
4694 return token;
4695 } else if (this._backtrack) {
4696 match = false;
4697 continue; // rule action called reject() implying a rule MISmatch.
4698 } else {
4699 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
4700 return false;
4701 }
4702 } else if (!this.options.flex) {
4703 break;
4704 }
4705 }
4706 }
4707 if (match) {
4708 token = this.test_match(match, rules[index]);
4709 if (token !== false) {
4710 return token;
4711 }
4712 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
4713 return false;
4714 }
4715 if (this._input === "") {
4716 return this.EOF;
4717 } else {
4718 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
4719 text: "",
4720 token: null,
4721 line: this.yylineno
4722 });
4723 }
4724 },
4725
4726// return next match that has a token
4727lex:function lex () {
4728 var r = this.next();
4729 if (r) {
4730 return r;
4731 } else {
4732 return this.lex();
4733 }
4734 },
4735
4736// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
4737begin:function begin (condition) {
4738 this.conditionStack.push(condition);
4739 },
4740
4741// pop the previously active lexer condition state off the condition stack
4742popState:function popState () {
4743 var n = this.conditionStack.length - 1;
4744 if (n > 0) {
4745 return this.conditionStack.pop();
4746 } else {
4747 return this.conditionStack[0];
4748 }
4749 },
4750
4751// produce the lexer rule set which is active for the currently active lexer condition state
4752_currentRules:function _currentRules () {
4753 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
4754 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
4755 } else {
4756 return this.conditions["INITIAL"].rules;
4757 }
4758 },
4759
4760// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
4761topState:function topState (n) {
4762 n = this.conditionStack.length - 1 - Math.abs(n || 0);
4763 if (n >= 0) {
4764 return this.conditionStack[n];
4765 } else {
4766 return "INITIAL";
4767 }
4768 },
4769
4770// alias for begin(condition)
4771pushState:function pushState (condition) {
4772 this.begin(condition);
4773 },
4774
4775// return the number of states currently on the stack
4776stateStackSize:function stateStackSize() {
4777 return this.conditionStack.length;
4778 },
4779options: {},
4780performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
4781var YYSTATE=YY_START;
4782switch($avoiding_name_collisions) {
4783case 0:/* do nothing */
4784break;
4785case 1:this.begin("string");
4786break;
4787case 2:this.popState();
4788break;
4789case 3:return "STR";
4790break;
4791case 4:return 61;
4792break;
4793case 5:return 70;
4794break;
4795case 6:return 62;
4796break;
4797case 7:return 75;
4798break;
4799case 8:return 63;
4800break;
4801case 9:return 64;
4802break;
4803case 10:return 65;
4804break;
4805case 11:if(yy.lex.firstGraph()){this.begin("dir");} return 12;
4806break;
4807case 12:return 26;
4808break;
4809case 13:return 30;
4810break;
4811case 14: this.popState(); return 13;
4812break;
4813case 15: this.popState(); return 13;
4814break;
4815case 16: this.popState(); return 13;
4816break;
4817case 17: this.popState(); return 13;
4818break;
4819case 18: this.popState(); return 13;
4820break;
4821case 19: this.popState(); return 13;
4822break;
4823case 20: this.popState(); return 13;
4824break;
4825case 21: this.popState(); return 13;
4826break;
4827case 22: this.popState(); return 13;
4828break;
4829case 23: this.popState(); return 13;
4830break;
4831case 24: return 76;
4832break;
4833case 25:return 84;
4834break;
4835case 26:return 35;
4836break;
4837case 27:return 81;
4838break;
4839case 28:return 34;
4840break;
4841case 29:return 8;
4842break;
4843case 30:return 77;
4844break;
4845case 31:return 95;
4846break;
4847case 32:return 56;
4848break;
4849case 33:return 56;
4850break;
4851case 34:return 56;
4852break;
4853case 35:return 56;
4854break;
4855case 36:return 56;
4856break;
4857case 37:return 56;
4858break;
4859case 38:return 56;
4860break;
4861case 39:return 56;
4862break;
4863case 40:return 56;
4864break;
4865case 41:return 56;
4866break;
4867case 42:return 56;
4868break;
4869case 43:return 56;
4870break;
4871case 44:return 56;
4872break;
4873case 45:return 56;
4874break;
4875case 46:return 56;
4876break;
4877case 47:return 56;
4878break;
4879case 48:return 56;
4880break;
4881case 49:return 56;
4882break;
4883case 50:return 56;
4884break;
4885case 51:return 56;
4886break;
4887case 52:return 56;
4888break;
4889case 53:return 56;
4890break;
4891case 54:return 56;
4892break;
4893case 55:return 56;
4894break;
4895case 56:return 56;
4896break;
4897case 57:return 56;
4898break;
4899case 58:return 56;
4900break;
4901case 59:return 56;
4902break;
4903case 60:return 55;
4904break;
4905case 61:return 55;
4906break;
4907case 62:return 55;
4908break;
4909case 63:return 55;
4910break;
4911case 64:return 55;
4912break;
4913case 65:return 55;
4914break;
4915case 66:return 55;
4916break;
4917case 67:return 55;
4918break;
4919case 68:return 55;
4920break;
4921case 69:return 55;
4922break;
4923case 70:return 55;
4924break;
4925case 71:return 55;
4926break;
4927case 72:return 39;
4928break;
4929case 73:return 40;
4930break;
4931case 74:return 41;
4932break;
4933case 75:return 42;
4934break;
4935case 76:return 43;
4936break;
4937case 77:return 44;
4938break;
4939case 78:return 82;
4940break;
4941case 79:return 85;
4942break;
4943case 80:return 96;
4944break;
4945case 81:return 93;
4946break;
4947case 82:return 86;
4948break;
4949case 83:return 94;
4950break;
4951case 84:return 94;
4952break;
4953case 85:return 87;
4954break;
4955case 86:return 47;
4956break;
4957case 87:return 67;
4958break;
4959case 88:return 'SEP';
4960break;
4961case 89:return 66;
4962break;
4963case 90:return 80;
4964break;
4965case 91:return 49;
4966break;
4967case 92:return 48;
4968break;
4969case 93:return 51;
4970break;
4971case 94:return 50;
4972break;
4973case 95:return 91;
4974break;
4975case 96:return 92;
4976break;
4977case 97:return 57;
4978break;
4979case 98:return 37;
4980break;
4981case 99:return 38;
4982break;
4983case 100:return 28;
4984break;
4985case 101:return 29;
4986break;
4987case 102:return 45
4988break;
4989case 103:return 46
4990break;
4991case 104:return 102;
4992break;
4993case 105:return 9;
4994break;
4995case 106:return 10;
4996break;
4997case 107:return 11;
4998break;
4999}
5000},
5001rules: [/^(?:%%[^\n]*\n*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*--[x]\s*)/,/^(?:\s*-->\s*)/,/^(?:\s*<-->\s*)/,/^(?:\s*[x]--[x]\s*)/,/^(?:\s*[o]--[o]\s*)/,/^(?:\s*[o]\.-[o]\s*)/,/^(?:\s*<==>\s*)/,/^(?:\s*[o]==[o]\s*)/,/^(?:\s*[x]==[x]\s*)/,/^(?:\s*[x].-[x]\s*)/,/^(?:\s*[x]-\.-[x]\s*)/,/^(?:\s*<\.->\s*)/,/^(?:\s*<-\.->\s*)/,/^(?:\s*[o]-\.-[o]\s*)/,/^(?:\s*--[o]\s*)/,/^(?:\s*---\s*)/,/^(?:\s*-\.-[x]\s*)/,/^(?:\s*-\.->\s*)/,/^(?:\s*-\.-[o]\s*)/,/^(?:\s*-\.-\s*)/,/^(?:\s*.-[x]\s*)/,/^(?:\s*\.->\s*)/,/^(?:\s*\.-[o]\s*)/,/^(?:\s*\.-\s*)/,/^(?:\s*==[x]\s*)/,/^(?:\s*==>\s*)/,/^(?:\s*==[o]\s*)/,/^(?:\s*==[\=]\s*)/,/^(?:\s*<--\s*)/,/^(?:\s*[x]--\s*)/,/^(?:\s*[o]--\s*)/,/^(?:\s*<-\.\s*)/,/^(?:\s*[x]-\.\s*)/,/^(?:\s*[o]-\.\s*)/,/^(?:\s*<==\s*)/,/^(?:\s*[x]==\s*)/,/^(?:\s*[o]==\s*)/,/^(?:\s*--\s*)/,/^(?:\s*-\.\s*)/,/^(?:\s*==\s*)/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\[)/,/^(?:\]\))/,/^(?:\[\()/,/^(?:\)\])/,/^(?:-)/,/^(?:\.)/,/^(?:[\_])/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:[A-Za-z]+)/,/^(?:\\\])/,/^(?:\[\/)/,/^(?:\/\])/,/^(?:\[\\)/,/^(?:[!"#$%&'*+,-.`?\\_\/])/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:")/,/^(?:(\r|\n|\r\n)+)/,/^(?:\s)/,/^(?:$)/],
5002conditions: {"vertex":{"rules":[],"inclusive":false},"dir":{"rules":[14,15,16,17,18,19,20,21,22,23],"inclusive":false},"string":{"rules":[2,3],"inclusive":false},"INITIAL":{"rules":[0,1,4,5,6,7,8,9,10,11,12,13,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,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107],"inclusive":true}}
5003});
5004return lexer;
5005})();
5006parser.lexer = lexer;
5007function Parser () {
5008 this.yy = {};
5009}
5010Parser.prototype = parser;parser.Parser = Parser;
5011return new Parser;
5012})();
5013
5014
5015if (true) {
5016exports.parser = parser;
5017exports.Parser = parser.Parser;
5018exports.parse = function () { return parser.parse.apply(parser, arguments); };
5019exports.main = function commonjsMain (args) {
5020 if (!args[1]) {
5021 console.log('Usage: '+args[0]+' FILE');
5022 process.exit(1);
5023 }
5024 var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8");
5025 return exports.parser.parse(source);
5026};
5027if ( true && __webpack_require__.c[__webpack_require__.s] === module) {
5028 exports.main(process.argv.slice(1));
5029}
5030}
5031/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
5032
5033/***/ }),
5034
5035/***/ "./src/diagrams/gantt/ganttDb.js":
5036/*!***************************************!*\
5037 !*** ./src/diagrams/gantt/ganttDb.js ***!
5038 \***************************************/
5039/*! exports provided: clear, setAxisFormat, getAxisFormat, setDateFormat, enableInclusiveEndDates, endDatesAreInclusive, getDateFormat, setExcludes, getExcludes, setTitle, getTitle, addSection, getSections, getTasks, addTask, findTaskById, addTaskOrg, setLink, setClass, setClickEvent, bindFunctions, default */
5040/***/ (function(module, __webpack_exports__, __webpack_require__) {
5041
5042"use strict";
5043__webpack_require__.r(__webpack_exports__);
5044/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clear", function() { return clear; });
5045/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAxisFormat", function() { return setAxisFormat; });
5046/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAxisFormat", function() { return getAxisFormat; });
5047/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setDateFormat", function() { return setDateFormat; });
5048/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enableInclusiveEndDates", function() { return enableInclusiveEndDates; });
5049/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "endDatesAreInclusive", function() { return endDatesAreInclusive; });
5050/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDateFormat", function() { return getDateFormat; });
5051/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setExcludes", function() { return setExcludes; });
5052/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getExcludes", function() { return getExcludes; });
5053/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTitle", function() { return setTitle; });
5054/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTitle", function() { return getTitle; });
5055/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addSection", function() { return addSection; });
5056/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSections", function() { return getSections; });
5057/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTasks", function() { return getTasks; });
5058/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addTask", function() { return addTask; });
5059/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findTaskById", function() { return findTaskById; });
5060/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addTaskOrg", function() { return addTaskOrg; });
5061/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLink", function() { return setLink; });
5062/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setClass", function() { return setClass; });
5063/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setClickEvent", function() { return setClickEvent; });
5064/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bindFunctions", function() { return bindFunctions; });
5065/* harmony import */ var moment_mini__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment-mini */ "moment-mini");
5066/* harmony import */ var moment_mini__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment_mini__WEBPACK_IMPORTED_MODULE_0__);
5067/* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @braintree/sanitize-url */ "@braintree/sanitize-url");
5068/* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1__);
5069/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
5070/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../config */ "./src/config.js");
5071function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
5072
5073function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
5074
5075function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
5076
5077function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
5078
5079
5080
5081
5082
5083var config = Object(_config__WEBPACK_IMPORTED_MODULE_3__["getConfig"])();
5084var dateFormat = '';
5085var axisFormat = '';
5086var excludes = [];
5087var title = '';
5088var sections = [];
5089var tasks = [];
5090var currentSection = '';
5091var tags = ['active', 'done', 'crit', 'milestone'];
5092var funs = [];
5093var inclusiveEndDates = false;
5094var clear = function clear() {
5095 sections = [];
5096 tasks = [];
5097 currentSection = '';
5098 funs = [];
5099 title = '';
5100 taskCnt = 0;
5101 lastTask = undefined;
5102 lastTaskID = undefined;
5103 rawTasks = [];
5104 dateFormat = '';
5105 axisFormat = '';
5106 excludes = [];
5107 inclusiveEndDates = false;
5108};
5109var setAxisFormat = function setAxisFormat(txt) {
5110 axisFormat = txt;
5111};
5112var getAxisFormat = function getAxisFormat() {
5113 return axisFormat;
5114};
5115var setDateFormat = function setDateFormat(txt) {
5116 dateFormat = txt;
5117};
5118var enableInclusiveEndDates = function enableInclusiveEndDates() {
5119 inclusiveEndDates = true;
5120};
5121var endDatesAreInclusive = function endDatesAreInclusive() {
5122 return inclusiveEndDates;
5123};
5124var getDateFormat = function getDateFormat() {
5125 return dateFormat;
5126};
5127var setExcludes = function setExcludes(txt) {
5128 excludes = txt.toLowerCase().split(/[\s,]+/);
5129};
5130var getExcludes = function getExcludes() {
5131 return excludes;
5132};
5133var setTitle = function setTitle(txt) {
5134 title = txt;
5135};
5136var getTitle = function getTitle() {
5137 return title;
5138};
5139var addSection = function addSection(txt) {
5140 currentSection = txt;
5141 sections.push(txt);
5142};
5143var getSections = function getSections() {
5144 return sections;
5145};
5146var getTasks = function getTasks() {
5147 var allItemsPricessed = compileTasks();
5148 var maxDepth = 10;
5149 var iterationCount = 0;
5150
5151 while (!allItemsPricessed && iterationCount < maxDepth) {
5152 allItemsPricessed = compileTasks();
5153 iterationCount++;
5154 }
5155
5156 tasks = rawTasks;
5157 return tasks;
5158};
5159
5160var isInvalidDate = function isInvalidDate(date, dateFormat, excludes) {
5161 if (date.isoWeekday() >= 6 && excludes.indexOf('weekends') >= 0) {
5162 return true;
5163 }
5164
5165 if (excludes.indexOf(date.format('dddd').toLowerCase()) >= 0) {
5166 return true;
5167 }
5168
5169 return excludes.indexOf(date.format(dateFormat.trim())) >= 0;
5170};
5171
5172var checkTaskDates = function checkTaskDates(task, dateFormat, excludes) {
5173 if (!excludes.length || task.manualEndTime) return;
5174 var startTime = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(task.startTime, dateFormat, true);
5175 startTime.add(1, 'd');
5176 var endTime = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(task.endTime, dateFormat, true);
5177 var renderEndTime = fixTaskDates(startTime, endTime, dateFormat, excludes);
5178 task.endTime = endTime.toDate();
5179 task.renderEndTime = renderEndTime;
5180};
5181
5182var fixTaskDates = function fixTaskDates(startTime, endTime, dateFormat, excludes) {
5183 var invalid = false;
5184 var renderEndTime = null;
5185
5186 while (startTime <= endTime) {
5187 if (!invalid) {
5188 renderEndTime = endTime.toDate();
5189 }
5190
5191 invalid = isInvalidDate(startTime, dateFormat, excludes);
5192
5193 if (invalid) {
5194 endTime.add(1, 'd');
5195 }
5196
5197 startTime.add(1, 'd');
5198 }
5199
5200 return renderEndTime;
5201};
5202
5203var getStartDate = function getStartDate(prevTime, dateFormat, str) {
5204 str = str.trim(); // Test for after
5205
5206 var re = /^after\s+([\d\w- ]+)/;
5207 var afterStatement = re.exec(str.trim());
5208
5209 if (afterStatement !== null) {
5210 // check all after ids and take the latest
5211 var latestEndingTask = null;
5212 afterStatement[1].split(' ').forEach(function (id) {
5213 var task = findTaskById(id);
5214
5215 if (typeof task !== 'undefined') {
5216 if (!latestEndingTask) {
5217 latestEndingTask = task;
5218 } else {
5219 if (task.endTime > latestEndingTask.endTime) {
5220 latestEndingTask = task;
5221 }
5222 }
5223 }
5224 });
5225
5226 if (!latestEndingTask) {
5227 var dt = new Date();
5228 dt.setHours(0, 0, 0, 0);
5229 return dt;
5230 } else {
5231 return latestEndingTask.endTime;
5232 }
5233 } // Check for actual date set
5234
5235
5236 var mDate = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(str, dateFormat.trim(), true);
5237
5238 if (mDate.isValid()) {
5239 return mDate.toDate();
5240 } else {
5241 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('Invalid date:' + str);
5242 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('With date format:' + dateFormat.trim());
5243 } // Default date - now
5244
5245
5246 return new Date();
5247};
5248
5249var durationToDate = function durationToDate(durationStatement, relativeTime) {
5250 if (durationStatement !== null) {
5251 switch (durationStatement[2]) {
5252 case 's':
5253 relativeTime.add(durationStatement[1], 'seconds');
5254 break;
5255
5256 case 'm':
5257 relativeTime.add(durationStatement[1], 'minutes');
5258 break;
5259
5260 case 'h':
5261 relativeTime.add(durationStatement[1], 'hours');
5262 break;
5263
5264 case 'd':
5265 relativeTime.add(durationStatement[1], 'days');
5266 break;
5267
5268 case 'w':
5269 relativeTime.add(durationStatement[1], 'weeks');
5270 break;
5271 }
5272 } // Default date - now
5273
5274
5275 return relativeTime.toDate();
5276};
5277
5278var getEndDate = function getEndDate(prevTime, dateFormat, str, inclusive) {
5279 inclusive = inclusive || false;
5280 str = str.trim(); // Check for actual date
5281
5282 var mDate = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(str, dateFormat.trim(), true);
5283
5284 if (mDate.isValid()) {
5285 if (inclusive) {
5286 mDate.add(1, 'd');
5287 }
5288
5289 return mDate.toDate();
5290 }
5291
5292 return durationToDate(/^([\d]+)([wdhms])/.exec(str.trim()), moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(prevTime));
5293};
5294
5295var taskCnt = 0;
5296
5297var parseId = function parseId(idStr) {
5298 if (typeof idStr === 'undefined') {
5299 taskCnt = taskCnt + 1;
5300 return 'task' + taskCnt;
5301 }
5302
5303 return idStr;
5304}; // id, startDate, endDate
5305// id, startDate, length
5306// id, after x, endDate
5307// id, after x, length
5308// startDate, endDate
5309// startDate, length
5310// after x, endDate
5311// after x, length
5312// endDate
5313// length
5314
5315
5316var compileData = function compileData(prevTask, dataStr) {
5317 var ds;
5318
5319 if (dataStr.substr(0, 1) === ':') {
5320 ds = dataStr.substr(1, dataStr.length);
5321 } else {
5322 ds = dataStr;
5323 }
5324
5325 var data = ds.split(',');
5326 var task = {}; // Get tags like active, done, crit and milestone
5327
5328 getTaskTags(data, task, tags);
5329
5330 for (var i = 0; i < data.length; i++) {
5331 data[i] = data[i].trim();
5332 }
5333
5334 var endTimeData = '';
5335
5336 switch (data.length) {
5337 case 1:
5338 task.id = parseId();
5339 task.startTime = prevTask.endTime;
5340 endTimeData = data[0];
5341 break;
5342
5343 case 2:
5344 task.id = parseId();
5345 task.startTime = getStartDate(undefined, dateFormat, data[0]);
5346 endTimeData = data[1];
5347 break;
5348
5349 case 3:
5350 task.id = parseId(data[0]);
5351 task.startTime = getStartDate(undefined, dateFormat, data[1]);
5352 endTimeData = data[2];
5353 break;
5354
5355 default:
5356 }
5357
5358 if (endTimeData) {
5359 task.endTime = getEndDate(task.startTime, dateFormat, endTimeData, inclusiveEndDates);
5360 task.manualEndTime = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(endTimeData, 'YYYY-MM-DD', true).isValid();
5361 checkTaskDates(task, dateFormat, excludes);
5362 }
5363
5364 return task;
5365};
5366
5367var parseData = function parseData(prevTaskId, dataStr) {
5368 var ds;
5369
5370 if (dataStr.substr(0, 1) === ':') {
5371 ds = dataStr.substr(1, dataStr.length);
5372 } else {
5373 ds = dataStr;
5374 }
5375
5376 var data = ds.split(',');
5377 var task = {}; // Get tags like active, done, crit and milestone
5378
5379 getTaskTags(data, task, tags);
5380
5381 for (var i = 0; i < data.length; i++) {
5382 data[i] = data[i].trim();
5383 }
5384
5385 switch (data.length) {
5386 case 1:
5387 task.id = parseId();
5388 task.startTime = {
5389 type: 'prevTaskEnd',
5390 id: prevTaskId
5391 };
5392 task.endTime = {
5393 data: data[0]
5394 };
5395 break;
5396
5397 case 2:
5398 task.id = parseId();
5399 task.startTime = {
5400 type: 'getStartDate',
5401 startData: data[0]
5402 };
5403 task.endTime = {
5404 data: data[1]
5405 };
5406 break;
5407
5408 case 3:
5409 task.id = parseId(data[0]);
5410 task.startTime = {
5411 type: 'getStartDate',
5412 startData: data[1]
5413 };
5414 task.endTime = {
5415 data: data[2]
5416 };
5417 break;
5418
5419 default:
5420 }
5421
5422 return task;
5423};
5424
5425var lastTask;
5426var lastTaskID;
5427var rawTasks = [];
5428var taskDb = {};
5429var addTask = function addTask(descr, data) {
5430 var rawTask = {
5431 section: currentSection,
5432 type: currentSection,
5433 processed: false,
5434 manualEndTime: false,
5435 renderEndTime: null,
5436 raw: {
5437 data: data
5438 },
5439 task: descr,
5440 classes: []
5441 };
5442 var taskInfo = parseData(lastTaskID, data);
5443 rawTask.raw.startTime = taskInfo.startTime;
5444 rawTask.raw.endTime = taskInfo.endTime;
5445 rawTask.id = taskInfo.id;
5446 rawTask.prevTaskId = lastTaskID;
5447 rawTask.active = taskInfo.active;
5448 rawTask.done = taskInfo.done;
5449 rawTask.crit = taskInfo.crit;
5450 rawTask.milestone = taskInfo.milestone;
5451 var pos = rawTasks.push(rawTask);
5452 lastTaskID = rawTask.id; // Store cross ref
5453
5454 taskDb[rawTask.id] = pos - 1;
5455};
5456var findTaskById = function findTaskById(id) {
5457 var pos = taskDb[id];
5458 return rawTasks[pos];
5459};
5460var addTaskOrg = function addTaskOrg(descr, data) {
5461 var newTask = {
5462 section: currentSection,
5463 type: currentSection,
5464 description: descr,
5465 task: descr,
5466 classes: []
5467 };
5468 var taskInfo = compileData(lastTask, data);
5469 newTask.startTime = taskInfo.startTime;
5470 newTask.endTime = taskInfo.endTime;
5471 newTask.id = taskInfo.id;
5472 newTask.active = taskInfo.active;
5473 newTask.done = taskInfo.done;
5474 newTask.crit = taskInfo.crit;
5475 newTask.milestone = taskInfo.milestone;
5476 lastTask = newTask;
5477 tasks.push(newTask);
5478};
5479
5480var compileTasks = function compileTasks() {
5481 var compileTask = function compileTask(pos) {
5482 var task = rawTasks[pos];
5483 var startTime = '';
5484
5485 switch (rawTasks[pos].raw.startTime.type) {
5486 case 'prevTaskEnd':
5487 {
5488 var prevTask = findTaskById(task.prevTaskId);
5489 task.startTime = prevTask.endTime;
5490 break;
5491 }
5492
5493 case 'getStartDate':
5494 startTime = getStartDate(undefined, dateFormat, rawTasks[pos].raw.startTime.startData);
5495
5496 if (startTime) {
5497 rawTasks[pos].startTime = startTime;
5498 }
5499
5500 break;
5501 }
5502
5503 if (rawTasks[pos].startTime) {
5504 rawTasks[pos].endTime = getEndDate(rawTasks[pos].startTime, dateFormat, rawTasks[pos].raw.endTime.data, inclusiveEndDates);
5505
5506 if (rawTasks[pos].endTime) {
5507 rawTasks[pos].processed = true;
5508 rawTasks[pos].manualEndTime = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(rawTasks[pos].raw.endTime.data, 'YYYY-MM-DD', true).isValid();
5509 checkTaskDates(rawTasks[pos], dateFormat, excludes);
5510 }
5511 }
5512
5513 return rawTasks[pos].processed;
5514 };
5515
5516 var allProcessed = true;
5517
5518 for (var i = 0; i < rawTasks.length; i++) {
5519 compileTask(i);
5520 allProcessed = allProcessed && rawTasks[i].processed;
5521 }
5522
5523 return allProcessed;
5524};
5525/**
5526 * Called by parser when a link is found. Adds the URL to the vertex data.
5527 * @param ids Comma separated list of ids
5528 * @param linkStr URL to create a link for
5529 */
5530
5531
5532var setLink = function setLink(ids, _linkStr) {
5533 var linkStr = _linkStr;
5534
5535 if (config.securityLevel !== 'loose') {
5536 linkStr = Object(_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1__["sanitizeUrl"])(_linkStr);
5537 }
5538
5539 ids.split(',').forEach(function (id) {
5540 var rawTask = findTaskById(id);
5541
5542 if (typeof rawTask !== 'undefined') {
5543 pushFun(id, function () {
5544 window.open(linkStr, '_self');
5545 });
5546 }
5547 });
5548 setClass(ids, 'clickable');
5549};
5550/**
5551 * Called by parser when a special node is found, e.g. a clickable element.
5552 * @param ids Comma separated list of ids
5553 * @param className Class to add
5554 */
5555
5556var setClass = function setClass(ids, className) {
5557 ids.split(',').forEach(function (id) {
5558 var rawTask = findTaskById(id);
5559
5560 if (typeof rawTask !== 'undefined') {
5561 rawTask.classes.push(className);
5562 }
5563 });
5564};
5565
5566var setClickFun = function setClickFun(id, functionName, functionArgs) {
5567 if (config.securityLevel !== 'loose') {
5568 return;
5569 }
5570
5571 if (typeof functionName === 'undefined') {
5572 return;
5573 }
5574
5575 var argList = [];
5576
5577 if (typeof functionArgs === 'string') {
5578 /* Splits functionArgs by ',', ignoring all ',' in double quoted strings */
5579 argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
5580
5581 for (var i = 0; i < argList.length; i++) {
5582 var item = argList[i].trim();
5583 /* Removes all double quotes at the start and end of an argument */
5584
5585 /* This preserves all starting and ending whitespace inside */
5586
5587 if (item.charAt(0) === '"' && item.charAt(item.length - 1) === '"') {
5588 item = item.substr(1, item.length - 2);
5589 }
5590
5591 argList[i] = item;
5592 }
5593 }
5594 /* if no arguments passed into callback, default to passing in id */
5595
5596
5597 if (argList.length === 0) {
5598 argList.push(id);
5599 }
5600
5601 var rawTask = findTaskById(id);
5602
5603 if (typeof rawTask !== 'undefined') {
5604 pushFun(id, function () {
5605 var _window;
5606
5607 (_window = window)[functionName].apply(_window, _toConsumableArray(argList));
5608 });
5609 }
5610};
5611/**
5612 * The callbackFunction is executed in a click event bound to the task with the specified id or the task's assigned text
5613 * @param id The task's id
5614 * @param callbackFunction A function to be executed when clicked on the task or the task's text
5615 */
5616
5617
5618var pushFun = function pushFun(id, callbackFunction) {
5619 funs.push(function () {
5620 // const elem = d3.select(element).select(`[id="${id}"]`)
5621 var elem = document.querySelector("[id=\"".concat(id, "\"]"));
5622
5623 if (elem !== null) {
5624 elem.addEventListener('click', function () {
5625 callbackFunction();
5626 });
5627 }
5628 });
5629 funs.push(function () {
5630 // const elem = d3.select(element).select(`[id="${id}-text"]`)
5631 var elem = document.querySelector("[id=\"".concat(id, "-text\"]"));
5632
5633 if (elem !== null) {
5634 elem.addEventListener('click', function () {
5635 callbackFunction();
5636 });
5637 }
5638 });
5639};
5640/**
5641 * Called by parser when a click definition is found. Registers an event handler.
5642 * @param ids Comma separated list of ids
5643 * @param functionName Function to be called on click
5644 * @param functionArgs Function args the function should be called with
5645 */
5646
5647
5648var setClickEvent = function setClickEvent(ids, functionName, functionArgs) {
5649 ids.split(',').forEach(function (id) {
5650 setClickFun(id, functionName, functionArgs);
5651 });
5652 setClass(ids, 'clickable');
5653};
5654/**
5655 * Binds all functions previously added to fun (specified through click) to the element
5656 * @param element
5657 */
5658
5659var bindFunctions = function bindFunctions(element) {
5660 funs.forEach(function (fun) {
5661 fun(element);
5662 });
5663};
5664/* harmony default export */ __webpack_exports__["default"] = ({
5665 clear: clear,
5666 setDateFormat: setDateFormat,
5667 getDateFormat: getDateFormat,
5668 enableInclusiveEndDates: enableInclusiveEndDates,
5669 endDatesAreInclusive: endDatesAreInclusive,
5670 setAxisFormat: setAxisFormat,
5671 getAxisFormat: getAxisFormat,
5672 setTitle: setTitle,
5673 getTitle: getTitle,
5674 addSection: addSection,
5675 getSections: getSections,
5676 getTasks: getTasks,
5677 addTask: addTask,
5678 findTaskById: findTaskById,
5679 addTaskOrg: addTaskOrg,
5680 setExcludes: setExcludes,
5681 getExcludes: getExcludes,
5682 setClickEvent: setClickEvent,
5683 setLink: setLink,
5684 bindFunctions: bindFunctions,
5685 durationToDate: durationToDate
5686});
5687
5688function getTaskTags(data, task, tags) {
5689 var matchFound = true;
5690
5691 while (matchFound) {
5692 matchFound = false;
5693 tags.forEach(function (t) {
5694 var pattern = '^\\s*' + t + '\\s*$';
5695 var regex = new RegExp(pattern);
5696
5697 if (data[0].match(regex)) {
5698 task[t] = true;
5699 data.shift(1);
5700 matchFound = true;
5701 }
5702 });
5703 }
5704}
5705
5706/***/ }),
5707
5708/***/ "./src/diagrams/gantt/ganttRenderer.js":
5709/*!*********************************************!*\
5710 !*** ./src/diagrams/gantt/ganttRenderer.js ***!
5711 \*********************************************/
5712/*! exports provided: setConf, draw, default */
5713/***/ (function(module, __webpack_exports__, __webpack_require__) {
5714
5715"use strict";
5716__webpack_require__.r(__webpack_exports__);
5717/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; });
5718/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; });
5719/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
5720/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
5721/* harmony import */ var _parser_gantt__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parser/gantt */ "./src/diagrams/gantt/parser/gantt.jison");
5722/* harmony import */ var _parser_gantt__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_parser_gantt__WEBPACK_IMPORTED_MODULE_1__);
5723/* harmony import */ var _ganttDb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ganttDb */ "./src/diagrams/gantt/ganttDb.js");
5724
5725
5726
5727_parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].yy = _ganttDb__WEBPACK_IMPORTED_MODULE_2__["default"];
5728var conf = {
5729 titleTopMargin: 25,
5730 barHeight: 20,
5731 barGap: 4,
5732 topPadding: 50,
5733 rightPadding: 75,
5734 leftPadding: 75,
5735 gridLineStartPadding: 35,
5736 fontSize: 11,
5737 fontFamily: '"Open-Sans", "sans-serif"'
5738};
5739var setConf = function setConf(cnf) {
5740 var keys = Object.keys(cnf);
5741 keys.forEach(function (key) {
5742 conf[key] = cnf[key];
5743 });
5744};
5745var w;
5746var draw = function draw(text, id) {
5747 _parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].yy.clear();
5748 _parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].parse(text);
5749 var elem = document.getElementById(id);
5750 w = elem.parentElement.offsetWidth;
5751
5752 if (typeof w === 'undefined') {
5753 w = 1200;
5754 }
5755
5756 if (typeof conf.useWidth !== 'undefined') {
5757 w = conf.useWidth;
5758 }
5759
5760 var taskArray = _parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].yy.getTasks(); // Set height based on number of tasks
5761
5762 var h = taskArray.length * (conf.barHeight + conf.barGap) + 2 * conf.topPadding;
5763 elem.setAttribute('height', '100%'); // Set viewBox
5764
5765 elem.setAttribute('viewBox', '0 0 ' + w + ' ' + h);
5766 var svg = d3__WEBPACK_IMPORTED_MODULE_0__["select"]("[id=\"".concat(id, "\"]")); // Set timescale
5767
5768 var timeScale = d3__WEBPACK_IMPORTED_MODULE_0__["scaleTime"]().domain([d3__WEBPACK_IMPORTED_MODULE_0__["min"](taskArray, function (d) {
5769 return d.startTime;
5770 }), d3__WEBPACK_IMPORTED_MODULE_0__["max"](taskArray, function (d) {
5771 return d.endTime;
5772 })]).rangeRound([0, w - conf.leftPadding - conf.rightPadding]);
5773 var categories = [];
5774
5775 for (var i = 0; i < taskArray.length; i++) {
5776 categories.push(taskArray[i].type);
5777 }
5778
5779 var catsUnfiltered = categories; // for vert labels
5780
5781 categories = checkUnique(categories);
5782 makeGant(taskArray, w, h);
5783
5784 if (typeof conf.useWidth !== 'undefined') {
5785 elem.setAttribute('width', w);
5786 }
5787
5788 svg.append('text').text(_parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].yy.getTitle()).attr('x', w / 2).attr('y', conf.titleTopMargin).attr('class', 'titleText');
5789
5790 function makeGant(tasks, pageWidth, pageHeight) {
5791 var barHeight = conf.barHeight;
5792 var gap = barHeight + conf.barGap;
5793 var topPadding = conf.topPadding;
5794 var leftPadding = conf.leftPadding;
5795 var colorScale = d3__WEBPACK_IMPORTED_MODULE_0__["scaleLinear"]().domain([0, categories.length]).range(['#00B9FA', '#F95002']).interpolate(d3__WEBPACK_IMPORTED_MODULE_0__["interpolateHcl"]);
5796 makeGrid(leftPadding, topPadding, pageWidth, pageHeight);
5797 drawRects(tasks, gap, topPadding, leftPadding, barHeight, colorScale, pageWidth, pageHeight);
5798 vertLabels(gap, topPadding, leftPadding, barHeight, colorScale);
5799 drawToday(leftPadding, topPadding, pageWidth, pageHeight);
5800 }
5801
5802 function drawRects(theArray, theGap, theTopPad, theSidePad, theBarHeight, theColorScale, w) {
5803 // Draw background rects covering the entire width of the graph, these form the section rows.
5804 svg.append('g').selectAll('rect').data(theArray).enter().append('rect').attr('x', 0).attr('y', function (d, i) {
5805 return i * theGap + theTopPad - 2;
5806 }).attr('width', function () {
5807 return w - conf.rightPadding / 2;
5808 }).attr('height', theGap).attr('class', function (d) {
5809 for (var _i = 0; _i < categories.length; _i++) {
5810 if (d.type === categories[_i]) {
5811 return 'section section' + _i % conf.numberSectionStyles;
5812 }
5813 }
5814
5815 return 'section section0';
5816 }); // Draw the rects representing the tasks
5817
5818 var rectangles = svg.append('g').selectAll('rect').data(theArray).enter();
5819 rectangles.append('rect').attr('id', function (d) {
5820 return d.id;
5821 }).attr('rx', 3).attr('ry', 3).attr('x', function (d) {
5822 if (d.milestone) {
5823 return timeScale(d.startTime) + theSidePad + 0.5 * (timeScale(d.endTime) - timeScale(d.startTime)) - 0.5 * theBarHeight;
5824 }
5825
5826 return timeScale(d.startTime) + theSidePad;
5827 }).attr('y', function (d, i) {
5828 return i * theGap + theTopPad;
5829 }).attr('width', function (d) {
5830 if (d.milestone) {
5831 return theBarHeight;
5832 }
5833
5834 return timeScale(d.renderEndTime || d.endTime) - timeScale(d.startTime);
5835 }).attr('height', theBarHeight).attr('transform-origin', function (d, i) {
5836 return (timeScale(d.startTime) + theSidePad + 0.5 * (timeScale(d.endTime) - timeScale(d.startTime))).toString() + 'px ' + (i * theGap + theTopPad + 0.5 * theBarHeight).toString() + 'px';
5837 }).attr('class', function (d) {
5838 var res = 'task';
5839 var classStr = '';
5840
5841 if (d.classes.length > 0) {
5842 classStr = d.classes.join(' ');
5843 }
5844
5845 var secNum = 0;
5846
5847 for (var _i2 = 0; _i2 < categories.length; _i2++) {
5848 if (d.type === categories[_i2]) {
5849 secNum = _i2 % conf.numberSectionStyles;
5850 }
5851 }
5852
5853 var taskClass = '';
5854
5855 if (d.active) {
5856 if (d.crit) {
5857 taskClass += ' activeCrit';
5858 } else {
5859 taskClass = ' active';
5860 }
5861 } else if (d.done) {
5862 if (d.crit) {
5863 taskClass = ' doneCrit';
5864 } else {
5865 taskClass = ' done';
5866 }
5867 } else {
5868 if (d.crit) {
5869 taskClass += ' crit';
5870 }
5871 }
5872
5873 if (taskClass.length === 0) {
5874 taskClass = ' task';
5875 }
5876
5877 if (d.milestone) {
5878 taskClass = ' milestone ' + taskClass;
5879 }
5880
5881 taskClass += secNum;
5882 taskClass += ' ' + classStr;
5883 return res + taskClass;
5884 }); // Append task labels
5885
5886 rectangles.append('text').attr('id', function (d) {
5887 return d.id + '-text';
5888 }).text(function (d) {
5889 return d.task;
5890 }).attr('font-size', conf.fontSize).attr('x', function (d) {
5891 var startX = timeScale(d.startTime);
5892 var endX = timeScale(d.renderEndTime || d.endTime);
5893
5894 if (d.milestone) {
5895 startX += 0.5 * (timeScale(d.endTime) - timeScale(d.startTime)) - 0.5 * theBarHeight;
5896 }
5897
5898 if (d.milestone) {
5899 endX = startX + theBarHeight;
5900 }
5901
5902 var textWidth = this.getBBox().width; // Check id text width > width of rectangle
5903
5904 if (textWidth > endX - startX) {
5905 if (endX + textWidth + 1.5 * conf.leftPadding > w) {
5906 return startX + theSidePad - 5;
5907 } else {
5908 return endX + theSidePad + 5;
5909 }
5910 } else {
5911 return (endX - startX) / 2 + startX + theSidePad;
5912 }
5913 }).attr('y', function (d, i) {
5914 return i * theGap + conf.barHeight / 2 + (conf.fontSize / 2 - 2) + theTopPad;
5915 }).attr('text-height', theBarHeight).attr('class', function (d) {
5916 var startX = timeScale(d.startTime);
5917 var endX = timeScale(d.endTime);
5918
5919 if (d.milestone) {
5920 endX = startX + theBarHeight;
5921 }
5922
5923 var textWidth = this.getBBox().width;
5924 var classStr = '';
5925
5926 if (d.classes.length > 0) {
5927 classStr = d.classes.join(' ');
5928 }
5929
5930 var secNum = 0;
5931
5932 for (var _i3 = 0; _i3 < categories.length; _i3++) {
5933 if (d.type === categories[_i3]) {
5934 secNum = _i3 % conf.numberSectionStyles;
5935 }
5936 }
5937
5938 var taskType = '';
5939
5940 if (d.active) {
5941 if (d.crit) {
5942 taskType = 'activeCritText' + secNum;
5943 } else {
5944 taskType = 'activeText' + secNum;
5945 }
5946 }
5947
5948 if (d.done) {
5949 if (d.crit) {
5950 taskType = taskType + ' doneCritText' + secNum;
5951 } else {
5952 taskType = taskType + ' doneText' + secNum;
5953 }
5954 } else {
5955 if (d.crit) {
5956 taskType = taskType + ' critText' + secNum;
5957 }
5958 }
5959
5960 if (d.milestone) {
5961 taskType += ' milestoneText';
5962 } // Check id text width > width of rectangle
5963
5964
5965 if (textWidth > endX - startX) {
5966 if (endX + textWidth + 1.5 * conf.leftPadding > w) {
5967 return classStr + ' taskTextOutsideLeft taskTextOutside' + secNum + ' ' + taskType;
5968 } else {
5969 return classStr + ' taskTextOutsideRight taskTextOutside' + secNum + ' ' + taskType + ' width-' + textWidth;
5970 }
5971 } else {
5972 return classStr + ' taskText taskText' + secNum + ' ' + taskType + ' width-' + textWidth;
5973 }
5974 });
5975 }
5976
5977 function makeGrid(theSidePad, theTopPad, w, h) {
5978 var xAxis = d3__WEBPACK_IMPORTED_MODULE_0__["axisBottom"](timeScale).tickSize(-h + theTopPad + conf.gridLineStartPadding).tickFormat(d3__WEBPACK_IMPORTED_MODULE_0__["timeFormat"](_parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].yy.getAxisFormat() || conf.axisFormat || '%Y-%m-%d'));
5979 svg.append('g').attr('class', 'grid').attr('transform', 'translate(' + theSidePad + ', ' + (h - 50) + ')').call(xAxis).selectAll('text').style('text-anchor', 'middle').attr('fill', '#000').attr('stroke', 'none').attr('font-size', 10).attr('dy', '1em');
5980 }
5981
5982 function vertLabels(theGap, theTopPad) {
5983 var numOccurances = [];
5984 var prevGap = 0;
5985
5986 for (var _i4 = 0; _i4 < categories.length; _i4++) {
5987 numOccurances[_i4] = [categories[_i4], getCount(categories[_i4], catsUnfiltered)];
5988 }
5989
5990 svg.append('g') // without doing this, impossible to put grid lines behind text
5991 .selectAll('text').data(numOccurances).enter().append('text').text(function (d) {
5992 return d[0];
5993 }).attr('x', 10).attr('y', function (d, i) {
5994 if (i > 0) {
5995 for (var j = 0; j < i; j++) {
5996 prevGap += numOccurances[i - 1][1];
5997 return d[1] * theGap / 2 + prevGap * theGap + theTopPad;
5998 }
5999 } else {
6000 return d[1] * theGap / 2 + theTopPad;
6001 }
6002 }).attr('class', function (d) {
6003 for (var _i5 = 0; _i5 < categories.length; _i5++) {
6004 if (d[0] === categories[_i5]) {
6005 return 'sectionTitle sectionTitle' + _i5 % conf.numberSectionStyles;
6006 }
6007 }
6008
6009 return 'sectionTitle';
6010 });
6011 }
6012
6013 function drawToday(theSidePad, theTopPad, w, h) {
6014 var todayG = svg.append('g').attr('class', 'today');
6015 var today = new Date();
6016 todayG.append('line').attr('x1', timeScale(today) + theSidePad).attr('x2', timeScale(today) + theSidePad).attr('y1', conf.titleTopMargin).attr('y2', h - conf.titleTopMargin).attr('class', 'today');
6017 } // from this stackexchange question: http://stackoverflow.com/questions/1890203/unique-for-arrays-in-javascript
6018
6019
6020 function checkUnique(arr) {
6021 var hash = {};
6022 var result = [];
6023
6024 for (var _i6 = 0, l = arr.length; _i6 < l; ++_i6) {
6025 if (!hash.hasOwnProperty(arr[_i6])) {
6026 // eslint-disable-line
6027 // it works with objects! in FF, at least
6028 hash[arr[_i6]] = true;
6029 result.push(arr[_i6]);
6030 }
6031 }
6032
6033 return result;
6034 } // from this stackexchange question: http://stackoverflow.com/questions/14227981/count-how-many-strings-in-an-array-have-duplicates-in-the-same-array
6035
6036
6037 function getCounts(arr) {
6038 var i = arr.length; // const to loop over
6039
6040 var obj = {}; // obj to store results
6041
6042 while (i) {
6043 obj[arr[--i]] = (obj[arr[i]] || 0) + 1; // count occurrences
6044 }
6045
6046 return obj;
6047 } // get specific from everything
6048
6049
6050 function getCount(word, arr) {
6051 return getCounts(arr)[word] || 0;
6052 }
6053};
6054/* harmony default export */ __webpack_exports__["default"] = ({
6055 setConf: setConf,
6056 draw: draw
6057});
6058
6059/***/ }),
6060
6061/***/ "./src/diagrams/gantt/parser/gantt.jison":
6062/*!***********************************************!*\
6063 !*** ./src/diagrams/gantt/parser/gantt.jison ***!
6064 \***********************************************/
6065/*! no static exports found */
6066/***/ (function(module, exports, __webpack_require__) {
6067
6068/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */
6069/*
6070 Returns a Parser object of the following structure:
6071
6072 Parser: {
6073 yy: {}
6074 }
6075
6076 Parser.prototype: {
6077 yy: {},
6078 trace: function(),
6079 symbols_: {associative list: name ==> number},
6080 terminals_: {associative list: number ==> name},
6081 productions_: [...],
6082 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
6083 table: [...],
6084 defaultActions: {...},
6085 parseError: function(str, hash),
6086 parse: function(input),
6087
6088 lexer: {
6089 EOF: 1,
6090 parseError: function(str, hash),
6091 setInput: function(input),
6092 input: function(),
6093 unput: function(str),
6094 more: function(),
6095 less: function(n),
6096 pastInput: function(),
6097 upcomingInput: function(),
6098 showPosition: function(),
6099 test_match: function(regex_match_array, rule_index),
6100 next: function(),
6101 lex: function(),
6102 begin: function(condition),
6103 popState: function(),
6104 _currentRules: function(),
6105 topState: function(),
6106 pushState: function(condition),
6107
6108 options: {
6109 ranges: boolean (optional: true ==> token location info will include a .range[] member)
6110 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
6111 backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
6112 },
6113
6114 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
6115 rules: [...],
6116 conditions: {associative list: name ==> set},
6117 }
6118 }
6119
6120
6121 token location info (@$, _$, etc.): {
6122 first_line: n,
6123 last_line: n,
6124 first_column: n,
6125 last_column: n,
6126 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
6127 }
6128
6129
6130 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
6131 text: (matched text)
6132 token: (the produced terminal token, if any)
6133 line: (yylineno)
6134 }
6135 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
6136 loc: (yylloc)
6137 expected: (string describing the set of expected tokens)
6138 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
6139 }
6140*/
6141var parser = (function(){
6142var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[6,8,10,11,12,13,14,15,16,18,20],$V1=[1,9],$V2=[1,10],$V3=[1,11],$V4=[1,12],$V5=[1,13],$V6=[1,14],$V7=[1,16],$V8=[1,17];
6143var parser = {trace: function trace () { },
6144yy: {},
6145symbols_: {"error":2,"start":3,"gantt":4,"document":5,"EOF":6,"line":7,"SPACE":8,"statement":9,"NL":10,"dateFormat":11,"inclusiveEndDates":12,"axisFormat":13,"excludes":14,"title":15,"section":16,"clickStatement":17,"taskTxt":18,"taskData":19,"click":20,"callbackname":21,"callbackargs":22,"href":23,"clickStatementDebug":24,"$accept":0,"$end":1},
6146terminals_: {2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",11:"dateFormat",12:"inclusiveEndDates",13:"axisFormat",14:"excludes",15:"title",16:"section",18:"taskTxt",19:"taskData",20:"click",21:"callbackname",22:"callbackargs",23:"href"},
6147productions_: [0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[17,2],[17,3],[17,3],[17,4],[17,3],[17,4],[17,2],[24,2],[24,3],[24,3],[24,4],[24,3],[24,4],[24,2]],
6148performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
6149/* this == yyval */
6150
6151var $0 = $$.length - 1;
6152switch (yystate) {
6153case 1:
6154 return $$[$0-1];
6155break;
6156case 2:
6157 this.$ = []
6158break;
6159case 3:
6160$$[$0-1].push($$[$0]);this.$ = $$[$0-1]
6161break;
6162case 4: case 5:
6163 this.$ = $$[$0]
6164break;
6165case 6: case 7:
6166 this.$=[];
6167break;
6168case 8:
6169yy.setDateFormat($$[$0].substr(11));this.$=$$[$0].substr(11);
6170break;
6171case 9:
6172yy.enableInclusiveEndDates();this.$=$$[$0].substr(18);
6173break;
6174case 10:
6175yy.setAxisFormat($$[$0].substr(11));this.$=$$[$0].substr(11);
6176break;
6177case 11:
6178yy.setExcludes($$[$0].substr(9));this.$=$$[$0].substr(9);
6179break;
6180case 12:
6181yy.setTitle($$[$0].substr(6));this.$=$$[$0].substr(6);
6182break;
6183case 13:
6184yy.addSection($$[$0].substr(8));this.$=$$[$0].substr(8);
6185break;
6186case 15:
6187yy.addTask($$[$0-1],$$[$0]);this.$='task';
6188break;
6189case 16:
6190this.$ = $$[$0-1];yy.setClickEvent($$[$0-1], $$[$0], null);
6191break;
6192case 17:
6193this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], $$[$0]);
6194break;
6195case 18:
6196this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], null);yy.setLink($$[$0-2],$$[$0]);
6197break;
6198case 19:
6199this.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-2], $$[$0-1]);yy.setLink($$[$0-3],$$[$0]);
6200break;
6201case 20:
6202this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0], null);yy.setLink($$[$0-2],$$[$0-1]);
6203break;
6204case 21:
6205this.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-1], $$[$0]);yy.setLink($$[$0-3],$$[$0-2]);
6206break;
6207case 22:
6208this.$ = $$[$0-1];yy.setLink($$[$0-1], $$[$0]);
6209break;
6210case 23: case 29:
6211this.$=$$[$0-1] + ' ' + $$[$0];
6212break;
6213case 24: case 25: case 27:
6214this.$=$$[$0-2] + ' ' + $$[$0-1] + ' ' + $$[$0];
6215break;
6216case 26: case 28:
6217this.$=$$[$0-3] + ' ' + $$[$0-2] + ' ' + $$[$0-1] + ' ' + $$[$0];
6218break;
6219}
6220},
6221table: [{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:$V1,12:$V2,13:$V3,14:$V4,15:$V5,16:$V6,17:15,18:$V7,20:$V8},o($V0,[2,7],{1:[2,1]}),o($V0,[2,3]),{9:18,11:$V1,12:$V2,13:$V3,14:$V4,15:$V5,16:$V6,17:15,18:$V7,20:$V8},o($V0,[2,5]),o($V0,[2,6]),o($V0,[2,8]),o($V0,[2,9]),o($V0,[2,10]),o($V0,[2,11]),o($V0,[2,12]),o($V0,[2,13]),o($V0,[2,14]),{19:[1,19]},{21:[1,20],23:[1,21]},o($V0,[2,4]),o($V0,[2,15]),o($V0,[2,16],{22:[1,22],23:[1,23]}),o($V0,[2,22],{21:[1,24]}),o($V0,[2,17],{23:[1,25]}),o($V0,[2,18]),o($V0,[2,20],{22:[1,26]}),o($V0,[2,19]),o($V0,[2,21])],
6222defaultActions: {},
6223parseError: function parseError (str, hash) {
6224 if (hash.recoverable) {
6225 this.trace(str);
6226 } else {
6227 var error = new Error(str);
6228 error.hash = hash;
6229 throw error;
6230 }
6231},
6232parse: function parse(input) {
6233 var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
6234 var args = lstack.slice.call(arguments, 1);
6235 var lexer = Object.create(this.lexer);
6236 var sharedState = { yy: {} };
6237 for (var k in this.yy) {
6238 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
6239 sharedState.yy[k] = this.yy[k];
6240 }
6241 }
6242 lexer.setInput(input, sharedState.yy);
6243 sharedState.yy.lexer = lexer;
6244 sharedState.yy.parser = this;
6245 if (typeof lexer.yylloc == 'undefined') {
6246 lexer.yylloc = {};
6247 }
6248 var yyloc = lexer.yylloc;
6249 lstack.push(yyloc);
6250 var ranges = lexer.options && lexer.options.ranges;
6251 if (typeof sharedState.yy.parseError === 'function') {
6252 this.parseError = sharedState.yy.parseError;
6253 } else {
6254 this.parseError = Object.getPrototypeOf(this).parseError;
6255 }
6256 function popStack(n) {
6257 stack.length = stack.length - 2 * n;
6258 vstack.length = vstack.length - n;
6259 lstack.length = lstack.length - n;
6260 }
6261 function lex() {
6262 var token;
6263 token = tstack.pop() || lexer.lex() || EOF;
6264 if (typeof token !== 'number') {
6265 if (token instanceof Array) {
6266 tstack = token;
6267 token = tstack.pop();
6268 }
6269 token = self.symbols_[token] || token;
6270 }
6271 return token;
6272 }
6273 var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
6274 while (true) {
6275 state = stack[stack.length - 1];
6276 if (this.defaultActions[state]) {
6277 action = this.defaultActions[state];
6278 } else {
6279 if (symbol === null || typeof symbol == 'undefined') {
6280 symbol = lex();
6281 }
6282 action = table[state] && table[state][symbol];
6283 }
6284 if (typeof action === 'undefined' || !action.length || !action[0]) {
6285 var errStr = '';
6286 expected = [];
6287 for (p in table[state]) {
6288 if (this.terminals_[p] && p > TERROR) {
6289 expected.push('\'' + this.terminals_[p] + '\'');
6290 }
6291 }
6292 if (lexer.showPosition) {
6293 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
6294 } else {
6295 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
6296 }
6297 this.parseError(errStr, {
6298 text: lexer.match,
6299 token: this.terminals_[symbol] || symbol,
6300 line: lexer.yylineno,
6301 loc: yyloc,
6302 expected: expected
6303 });
6304 }
6305 if (action[0] instanceof Array && action.length > 1) {
6306 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
6307 }
6308 switch (action[0]) {
6309 case 1:
6310 stack.push(symbol);
6311 vstack.push(lexer.yytext);
6312 lstack.push(lexer.yylloc);
6313 stack.push(action[1]);
6314 symbol = null;
6315 if (!preErrorSymbol) {
6316 yyleng = lexer.yyleng;
6317 yytext = lexer.yytext;
6318 yylineno = lexer.yylineno;
6319 yyloc = lexer.yylloc;
6320 if (recovering > 0) {
6321 recovering--;
6322 }
6323 } else {
6324 symbol = preErrorSymbol;
6325 preErrorSymbol = null;
6326 }
6327 break;
6328 case 2:
6329 len = this.productions_[action[1]][1];
6330 yyval.$ = vstack[vstack.length - len];
6331 yyval._$ = {
6332 first_line: lstack[lstack.length - (len || 1)].first_line,
6333 last_line: lstack[lstack.length - 1].last_line,
6334 first_column: lstack[lstack.length - (len || 1)].first_column,
6335 last_column: lstack[lstack.length - 1].last_column
6336 };
6337 if (ranges) {
6338 yyval._$.range = [
6339 lstack[lstack.length - (len || 1)].range[0],
6340 lstack[lstack.length - 1].range[1]
6341 ];
6342 }
6343 r = this.performAction.apply(yyval, [
6344 yytext,
6345 yyleng,
6346 yylineno,
6347 sharedState.yy,
6348 action[1],
6349 vstack,
6350 lstack
6351 ].concat(args));
6352 if (typeof r !== 'undefined') {
6353 return r;
6354 }
6355 if (len) {
6356 stack = stack.slice(0, -1 * len * 2);
6357 vstack = vstack.slice(0, -1 * len);
6358 lstack = lstack.slice(0, -1 * len);
6359 }
6360 stack.push(this.productions_[action[1]][0]);
6361 vstack.push(yyval.$);
6362 lstack.push(yyval._$);
6363 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
6364 stack.push(newState);
6365 break;
6366 case 3:
6367 return true;
6368 }
6369 }
6370 return true;
6371}};
6372
6373/* generated by jison-lex 0.3.4 */
6374var lexer = (function(){
6375var lexer = ({
6376
6377EOF:1,
6378
6379parseError:function parseError(str, hash) {
6380 if (this.yy.parser) {
6381 this.yy.parser.parseError(str, hash);
6382 } else {
6383 throw new Error(str);
6384 }
6385 },
6386
6387// resets the lexer, sets new input
6388setInput:function (input, yy) {
6389 this.yy = yy || this.yy || {};
6390 this._input = input;
6391 this._more = this._backtrack = this.done = false;
6392 this.yylineno = this.yyleng = 0;
6393 this.yytext = this.matched = this.match = '';
6394 this.conditionStack = ['INITIAL'];
6395 this.yylloc = {
6396 first_line: 1,
6397 first_column: 0,
6398 last_line: 1,
6399 last_column: 0
6400 };
6401 if (this.options.ranges) {
6402 this.yylloc.range = [0,0];
6403 }
6404 this.offset = 0;
6405 return this;
6406 },
6407
6408// consumes and returns one char from the input
6409input:function () {
6410 var ch = this._input[0];
6411 this.yytext += ch;
6412 this.yyleng++;
6413 this.offset++;
6414 this.match += ch;
6415 this.matched += ch;
6416 var lines = ch.match(/(?:\r\n?|\n).*/g);
6417 if (lines) {
6418 this.yylineno++;
6419 this.yylloc.last_line++;
6420 } else {
6421 this.yylloc.last_column++;
6422 }
6423 if (this.options.ranges) {
6424 this.yylloc.range[1]++;
6425 }
6426
6427 this._input = this._input.slice(1);
6428 return ch;
6429 },
6430
6431// unshifts one char (or a string) into the input
6432unput:function (ch) {
6433 var len = ch.length;
6434 var lines = ch.split(/(?:\r\n?|\n)/g);
6435
6436 this._input = ch + this._input;
6437 this.yytext = this.yytext.substr(0, this.yytext.length - len);
6438 //this.yyleng -= len;
6439 this.offset -= len;
6440 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
6441 this.match = this.match.substr(0, this.match.length - 1);
6442 this.matched = this.matched.substr(0, this.matched.length - 1);
6443
6444 if (lines.length - 1) {
6445 this.yylineno -= lines.length - 1;
6446 }
6447 var r = this.yylloc.range;
6448
6449 this.yylloc = {
6450 first_line: this.yylloc.first_line,
6451 last_line: this.yylineno + 1,
6452 first_column: this.yylloc.first_column,
6453 last_column: lines ?
6454 (lines.length === oldLines.length ? this.yylloc.first_column : 0)
6455 + oldLines[oldLines.length - lines.length].length - lines[0].length :
6456 this.yylloc.first_column - len
6457 };
6458
6459 if (this.options.ranges) {
6460 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
6461 }
6462 this.yyleng = this.yytext.length;
6463 return this;
6464 },
6465
6466// When called from action, caches matched text and appends it on next action
6467more:function () {
6468 this._more = true;
6469 return this;
6470 },
6471
6472// 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.
6473reject:function () {
6474 if (this.options.backtrack_lexer) {
6475 this._backtrack = true;
6476 } else {
6477 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(), {
6478 text: "",
6479 token: null,
6480 line: this.yylineno
6481 });
6482
6483 }
6484 return this;
6485 },
6486
6487// retain first n characters of the match
6488less:function (n) {
6489 this.unput(this.match.slice(n));
6490 },
6491
6492// displays already matched input, i.e. for error messages
6493pastInput:function () {
6494 var past = this.matched.substr(0, this.matched.length - this.match.length);
6495 return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
6496 },
6497
6498// displays upcoming input, i.e. for error messages
6499upcomingInput:function () {
6500 var next = this.match;
6501 if (next.length < 20) {
6502 next += this._input.substr(0, 20-next.length);
6503 }
6504 return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
6505 },
6506
6507// displays the character position where the lexing error occurred, i.e. for error messages
6508showPosition:function () {
6509 var pre = this.pastInput();
6510 var c = new Array(pre.length + 1).join("-");
6511 return pre + this.upcomingInput() + "\n" + c + "^";
6512 },
6513
6514// test the lexed token: return FALSE when not a match, otherwise return token
6515test_match:function(match, indexed_rule) {
6516 var token,
6517 lines,
6518 backup;
6519
6520 if (this.options.backtrack_lexer) {
6521 // save context
6522 backup = {
6523 yylineno: this.yylineno,
6524 yylloc: {
6525 first_line: this.yylloc.first_line,
6526 last_line: this.last_line,
6527 first_column: this.yylloc.first_column,
6528 last_column: this.yylloc.last_column
6529 },
6530 yytext: this.yytext,
6531 match: this.match,
6532 matches: this.matches,
6533 matched: this.matched,
6534 yyleng: this.yyleng,
6535 offset: this.offset,
6536 _more: this._more,
6537 _input: this._input,
6538 yy: this.yy,
6539 conditionStack: this.conditionStack.slice(0),
6540 done: this.done
6541 };
6542 if (this.options.ranges) {
6543 backup.yylloc.range = this.yylloc.range.slice(0);
6544 }
6545 }
6546
6547 lines = match[0].match(/(?:\r\n?|\n).*/g);
6548 if (lines) {
6549 this.yylineno += lines.length;
6550 }
6551 this.yylloc = {
6552 first_line: this.yylloc.last_line,
6553 last_line: this.yylineno + 1,
6554 first_column: this.yylloc.last_column,
6555 last_column: lines ?
6556 lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
6557 this.yylloc.last_column + match[0].length
6558 };
6559 this.yytext += match[0];
6560 this.match += match[0];
6561 this.matches = match;
6562 this.yyleng = this.yytext.length;
6563 if (this.options.ranges) {
6564 this.yylloc.range = [this.offset, this.offset += this.yyleng];
6565 }
6566 this._more = false;
6567 this._backtrack = false;
6568 this._input = this._input.slice(match[0].length);
6569 this.matched += match[0];
6570 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
6571 if (this.done && this._input) {
6572 this.done = false;
6573 }
6574 if (token) {
6575 return token;
6576 } else if (this._backtrack) {
6577 // recover context
6578 for (var k in backup) {
6579 this[k] = backup[k];
6580 }
6581 return false; // rule action called reject() implying the next rule should be tested instead.
6582 }
6583 return false;
6584 },
6585
6586// return next match in input
6587next:function () {
6588 if (this.done) {
6589 return this.EOF;
6590 }
6591 if (!this._input) {
6592 this.done = true;
6593 }
6594
6595 var token,
6596 match,
6597 tempMatch,
6598 index;
6599 if (!this._more) {
6600 this.yytext = '';
6601 this.match = '';
6602 }
6603 var rules = this._currentRules();
6604 for (var i = 0; i < rules.length; i++) {
6605 tempMatch = this._input.match(this.rules[rules[i]]);
6606 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
6607 match = tempMatch;
6608 index = i;
6609 if (this.options.backtrack_lexer) {
6610 token = this.test_match(tempMatch, rules[i]);
6611 if (token !== false) {
6612 return token;
6613 } else if (this._backtrack) {
6614 match = false;
6615 continue; // rule action called reject() implying a rule MISmatch.
6616 } else {
6617 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
6618 return false;
6619 }
6620 } else if (!this.options.flex) {
6621 break;
6622 }
6623 }
6624 }
6625 if (match) {
6626 token = this.test_match(match, rules[index]);
6627 if (token !== false) {
6628 return token;
6629 }
6630 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
6631 return false;
6632 }
6633 if (this._input === "") {
6634 return this.EOF;
6635 } else {
6636 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
6637 text: "",
6638 token: null,
6639 line: this.yylineno
6640 });
6641 }
6642 },
6643
6644// return next match that has a token
6645lex:function lex () {
6646 var r = this.next();
6647 if (r) {
6648 return r;
6649 } else {
6650 return this.lex();
6651 }
6652 },
6653
6654// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
6655begin:function begin (condition) {
6656 this.conditionStack.push(condition);
6657 },
6658
6659// pop the previously active lexer condition state off the condition stack
6660popState:function popState () {
6661 var n = this.conditionStack.length - 1;
6662 if (n > 0) {
6663 return this.conditionStack.pop();
6664 } else {
6665 return this.conditionStack[0];
6666 }
6667 },
6668
6669// produce the lexer rule set which is active for the currently active lexer condition state
6670_currentRules:function _currentRules () {
6671 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
6672 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
6673 } else {
6674 return this.conditions["INITIAL"].rules;
6675 }
6676 },
6677
6678// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
6679topState:function topState (n) {
6680 n = this.conditionStack.length - 1 - Math.abs(n || 0);
6681 if (n >= 0) {
6682 return this.conditionStack[n];
6683 } else {
6684 return "INITIAL";
6685 }
6686 },
6687
6688// alias for begin(condition)
6689pushState:function pushState (condition) {
6690 this.begin(condition);
6691 },
6692
6693// return the number of states currently on the stack
6694stateStackSize:function stateStackSize() {
6695 return this.conditionStack.length;
6696 },
6697options: {"case-insensitive":true},
6698performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
6699var YYSTATE=YY_START;
6700switch($avoiding_name_collisions) {
6701case 0:return 10;
6702break;
6703case 1:/* skip whitespace */
6704break;
6705case 2:/* skip comments */
6706break;
6707case 3:/* skip comments */
6708break;
6709case 4:this.begin("href");
6710break;
6711case 5:this.popState();
6712break;
6713case 6:return 23;
6714break;
6715case 7:this.begin("callbackname");
6716break;
6717case 8:this.popState();
6718break;
6719case 9:this.popState(); this.begin("callbackargs");
6720break;
6721case 10:return 21;
6722break;
6723case 11:this.popState();
6724break;
6725case 12:return 22;
6726break;
6727case 13:this.begin("click");
6728break;
6729case 14:this.popState();
6730break;
6731case 15:return 20;
6732break;
6733case 16:return 4;
6734break;
6735case 17:return 11;
6736break;
6737case 18:return 12;
6738break;
6739case 19:return 13;
6740break;
6741case 20:return 14;
6742break;
6743case 21:return 'date';
6744break;
6745case 22:return 15;
6746break;
6747case 23:return 16;
6748break;
6749case 24:return 18;
6750break;
6751case 25:return 19;
6752break;
6753case 26:return ':';
6754break;
6755case 27:return 6;
6756break;
6757case 28:return 'INVALID';
6758break;
6759}
6760},
6761rules: [/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],
6762conditions: {"callbackargs":{"rules":[11,12],"inclusive":false},"callbackname":{"rules":[8,9,10],"inclusive":false},"href":{"rules":[5,6],"inclusive":false},"click":{"rules":[14,15],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,7,13,16,17,18,19,20,21,22,23,24,25,26,27,28],"inclusive":true}}
6763});
6764return lexer;
6765})();
6766parser.lexer = lexer;
6767function Parser () {
6768 this.yy = {};
6769}
6770Parser.prototype = parser;parser.Parser = Parser;
6771return new Parser;
6772})();
6773
6774
6775if (true) {
6776exports.parser = parser;
6777exports.Parser = parser.Parser;
6778exports.parse = function () { return parser.parse.apply(parser, arguments); };
6779exports.main = function commonjsMain (args) {
6780 if (!args[1]) {
6781 console.log('Usage: '+args[0]+' FILE');
6782 process.exit(1);
6783 }
6784 var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8");
6785 return exports.parser.parse(source);
6786};
6787if ( true && __webpack_require__.c[__webpack_require__.s] === module) {
6788 exports.main(process.argv.slice(1));
6789}
6790}
6791/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
6792
6793/***/ }),
6794
6795/***/ "./src/diagrams/git/gitGraphAst.js":
6796/*!*****************************************!*\
6797 !*** ./src/diagrams/git/gitGraphAst.js ***!
6798 \*****************************************/
6799/*! exports provided: setDirection, setOptions, getOptions, commit, branch, merge, checkout, reset, prettyPrint, clear, getBranchesAsObjArray, getBranches, getCommits, getCommitsArray, getCurrentBranch, getDirection, getHead, default */
6800/***/ (function(module, __webpack_exports__, __webpack_require__) {
6801
6802"use strict";
6803__webpack_require__.r(__webpack_exports__);
6804/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setDirection", function() { return setDirection; });
6805/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setOptions", function() { return setOptions; });
6806/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOptions", function() { return getOptions; });
6807/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commit", function() { return commit; });
6808/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "branch", function() { return branch; });
6809/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return merge; });
6810/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkout", function() { return checkout; });
6811/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reset", function() { return reset; });
6812/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prettyPrint", function() { return prettyPrint; });
6813/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clear", function() { return clear; });
6814/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBranchesAsObjArray", function() { return getBranchesAsObjArray; });
6815/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBranches", function() { return getBranches; });
6816/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCommits", function() { return getCommits; });
6817/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCommitsArray", function() { return getCommitsArray; });
6818/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCurrentBranch", function() { return getCurrentBranch; });
6819/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDirection", function() { return getDirection; });
6820/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getHead", function() { return getHead; });
6821/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash");
6822/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
6823/* harmony import */ var crypto_random_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! crypto-random-string */ "crypto-random-string");
6824/* harmony import */ var crypto_random_string__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(crypto_random_string__WEBPACK_IMPORTED_MODULE_1__);
6825/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
6826
6827
6828
6829var commits = {};
6830var head = null;
6831var branches = {
6832 master: head
6833};
6834var curBranch = 'master';
6835var direction = 'LR';
6836var seq = 0;
6837
6838function getId() {
6839 return crypto_random_string__WEBPACK_IMPORTED_MODULE_1___default()({
6840 length: 7,
6841 characters: '0123456789abcdef'
6842 });
6843}
6844
6845function isfastforwardable(currentCommit, otherCommit) {
6846 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('Entering isfastforwardable:', currentCommit.id, otherCommit.id);
6847
6848 while (currentCommit.seq <= otherCommit.seq && currentCommit !== otherCommit) {
6849 // only if other branch has more commits
6850 if (otherCommit.parent == null) break;
6851
6852 if (Array.isArray(otherCommit.parent)) {
6853 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('In merge commit:', otherCommit.parent);
6854 return isfastforwardable(currentCommit, commits[otherCommit.parent[0]]) || isfastforwardable(currentCommit, commits[otherCommit.parent[1]]);
6855 } else {
6856 otherCommit = commits[otherCommit.parent];
6857 }
6858 }
6859
6860 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug(currentCommit.id, otherCommit.id);
6861 return currentCommit.id === otherCommit.id;
6862}
6863
6864function isReachableFrom(currentCommit, otherCommit) {
6865 var currentSeq = currentCommit.seq;
6866 var otherSeq = otherCommit.seq;
6867 if (currentSeq > otherSeq) return isfastforwardable(otherCommit, currentCommit);
6868 return false;
6869}
6870
6871var setDirection = function setDirection(dir) {
6872 direction = dir;
6873};
6874var options = {};
6875var setOptions = function setOptions(rawOptString) {
6876 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('options str', rawOptString);
6877 rawOptString = rawOptString && rawOptString.trim();
6878 rawOptString = rawOptString || '{}';
6879
6880 try {
6881 options = JSON.parse(rawOptString);
6882 } catch (e) {
6883 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].error('error while parsing gitGraph options', e.message);
6884 }
6885};
6886var getOptions = function getOptions() {
6887 return options;
6888};
6889var commit = function commit(msg) {
6890 var commit = {
6891 id: getId(),
6892 message: msg,
6893 seq: seq++,
6894 parent: head == null ? null : head.id
6895 };
6896 head = commit;
6897 commits[commit.id] = commit;
6898 branches[curBranch] = commit.id;
6899 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('in pushCommit ' + commit.id);
6900};
6901var branch = function branch(name) {
6902 branches[name] = head != null ? head.id : null;
6903 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('in createBranch');
6904};
6905var merge = function merge(otherBranch) {
6906 var currentCommit = commits[branches[curBranch]];
6907 var otherCommit = commits[branches[otherBranch]];
6908
6909 if (isReachableFrom(currentCommit, otherCommit)) {
6910 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('Already merged');
6911 return;
6912 }
6913
6914 if (isfastforwardable(currentCommit, otherCommit)) {
6915 branches[curBranch] = branches[otherBranch];
6916 head = commits[branches[curBranch]];
6917 } else {
6918 // create merge commit
6919 var _commit = {
6920 id: getId(),
6921 message: 'merged branch ' + otherBranch + ' into ' + curBranch,
6922 seq: seq++,
6923 parent: [head == null ? null : head.id, branches[otherBranch]]
6924 };
6925 head = _commit;
6926 commits[_commit.id] = _commit;
6927 branches[curBranch] = _commit.id;
6928 }
6929
6930 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug(branches);
6931 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('in mergeBranch');
6932};
6933var checkout = function checkout(branch) {
6934 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('in checkout');
6935 curBranch = branch;
6936 var id = branches[curBranch];
6937 head = commits[id];
6938};
6939var reset = function reset(commitRef) {
6940 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('in reset', commitRef);
6941 var ref = commitRef.split(':')[0];
6942 var parentCount = parseInt(commitRef.split(':')[1]);
6943 var commit = ref === 'HEAD' ? head : commits[branches[ref]];
6944 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug(commit, parentCount);
6945
6946 while (parentCount > 0) {
6947 commit = commits[commit.parent];
6948 parentCount--;
6949
6950 if (!commit) {
6951 var err = 'Critical error - unique parent commit not found during reset';
6952 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].error(err);
6953 throw err;
6954 }
6955 }
6956
6957 head = commit;
6958 branches[curBranch] = commit.id;
6959};
6960
6961function upsert(arr, key, newval) {
6962 var index = arr.indexOf(key);
6963
6964 if (index === -1) {
6965 arr.push(newval);
6966 } else {
6967 arr.splice(index, 1, newval);
6968 }
6969}
6970
6971function prettyPrintCommitHistory(commitArr) {
6972 var commit = lodash__WEBPACK_IMPORTED_MODULE_0___default.a.maxBy(commitArr, 'seq');
6973
6974 var line = '';
6975 commitArr.forEach(function (c) {
6976 if (c === commit) {
6977 line += '\t*';
6978 } else {
6979 line += '\t|';
6980 }
6981 });
6982 var label = [line, commit.id, commit.seq];
6983
6984 for (var _branch in branches) {
6985 if (branches[_branch] === commit.id) label.push(_branch);
6986 }
6987
6988 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug(label.join(' '));
6989
6990 if (Array.isArray(commit.parent)) {
6991 var newCommit = commits[commit.parent[0]];
6992 upsert(commitArr, commit, newCommit);
6993 commitArr.push(commits[commit.parent[1]]);
6994 } else if (commit.parent == null) {
6995 return;
6996 } else {
6997 var nextCommit = commits[commit.parent];
6998 upsert(commitArr, commit, nextCommit);
6999 }
7000
7001 commitArr = lodash__WEBPACK_IMPORTED_MODULE_0___default.a.uniqBy(commitArr, 'id');
7002 prettyPrintCommitHistory(commitArr);
7003}
7004
7005var prettyPrint = function prettyPrint() {
7006 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug(commits);
7007 var node = getCommitsArray()[0];
7008 prettyPrintCommitHistory([node]);
7009};
7010var clear = function clear() {
7011 commits = {};
7012 head = null;
7013 branches = {
7014 master: head
7015 };
7016 curBranch = 'master';
7017 seq = 0;
7018};
7019var getBranchesAsObjArray = function getBranchesAsObjArray() {
7020 var branchArr = [];
7021
7022 for (var _branch2 in branches) {
7023 branchArr.push({
7024 name: _branch2,
7025 commit: commits[branches[_branch2]]
7026 });
7027 }
7028
7029 return branchArr;
7030};
7031var getBranches = function getBranches() {
7032 return branches;
7033};
7034var getCommits = function getCommits() {
7035 return commits;
7036};
7037var getCommitsArray = function getCommitsArray() {
7038 var commitArr = Object.keys(commits).map(function (key) {
7039 return commits[key];
7040 });
7041 commitArr.forEach(function (o) {
7042 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug(o.id);
7043 });
7044 return lodash__WEBPACK_IMPORTED_MODULE_0___default.a.orderBy(commitArr, ['seq'], ['desc']);
7045};
7046var getCurrentBranch = function getCurrentBranch() {
7047 return curBranch;
7048};
7049var getDirection = function getDirection() {
7050 return direction;
7051};
7052var getHead = function getHead() {
7053 return head;
7054};
7055/* harmony default export */ __webpack_exports__["default"] = ({
7056 setDirection: setDirection,
7057 setOptions: setOptions,
7058 getOptions: getOptions,
7059 commit: commit,
7060 branch: branch,
7061 merge: merge,
7062 checkout: checkout,
7063 reset: reset,
7064 prettyPrint: prettyPrint,
7065 clear: clear,
7066 getBranchesAsObjArray: getBranchesAsObjArray,
7067 getBranches: getBranches,
7068 getCommits: getCommits,
7069 getCommitsArray: getCommitsArray,
7070 getCurrentBranch: getCurrentBranch,
7071 getDirection: getDirection,
7072 getHead: getHead
7073});
7074
7075/***/ }),
7076
7077/***/ "./src/diagrams/git/gitGraphRenderer.js":
7078/*!**********************************************!*\
7079 !*** ./src/diagrams/git/gitGraphRenderer.js ***!
7080 \**********************************************/
7081/*! exports provided: setConf, draw, default */
7082/***/ (function(module, __webpack_exports__, __webpack_require__) {
7083
7084"use strict";
7085__webpack_require__.r(__webpack_exports__);
7086/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; });
7087/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; });
7088/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
7089/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
7090/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash");
7091/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
7092/* harmony import */ var _gitGraphAst__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./gitGraphAst */ "./src/diagrams/git/gitGraphAst.js");
7093/* harmony import */ var _parser_gitGraph__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parser/gitGraph */ "./src/diagrams/git/parser/gitGraph.jison");
7094/* harmony import */ var _parser_gitGraph__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_parser_gitGraph__WEBPACK_IMPORTED_MODULE_3__);
7095/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
7096/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils */ "./src/utils.js");
7097
7098
7099
7100
7101
7102
7103var allCommitsDict = {};
7104var branchNum;
7105var config = {
7106 nodeSpacing: 150,
7107 nodeFillColor: 'yellow',
7108 nodeStrokeWidth: 2,
7109 nodeStrokeColor: 'grey',
7110 lineStrokeWidth: 4,
7111 branchOffset: 50,
7112 lineColor: 'grey',
7113 leftMargin: 50,
7114 branchColors: ['#442f74', '#983351', '#609732', '#AA9A39'],
7115 nodeRadius: 10,
7116 nodeLabel: {
7117 width: 75,
7118 height: 100,
7119 x: -25,
7120 y: 0
7121 }
7122};
7123var apiConfig = {};
7124var setConf = function setConf(c) {
7125 apiConfig = c;
7126};
7127
7128function svgCreateDefs(svg) {
7129 svg.append('defs').append('g').attr('id', 'def-commit').append('circle').attr('r', config.nodeRadius).attr('cx', 0).attr('cy', 0);
7130 svg.select('#def-commit').append('foreignObject').attr('width', config.nodeLabel.width).attr('height', config.nodeLabel.height).attr('x', config.nodeLabel.x).attr('y', config.nodeLabel.y).attr('class', 'node-label').attr('requiredFeatures', 'http://www.w3.org/TR/SVG11/feature#Extensibility').append('p').html('');
7131}
7132
7133function svgDrawLine(svg, points, colorIdx, interpolate) {
7134 var curve = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["interpolateToCurve"])(interpolate, d3__WEBPACK_IMPORTED_MODULE_0__["curveBasis"]);
7135 var color = config.branchColors[colorIdx % config.branchColors.length];
7136 var lineGen = d3__WEBPACK_IMPORTED_MODULE_0__["line"]().x(function (d) {
7137 return Math.round(d.x);
7138 }).y(function (d) {
7139 return Math.round(d.y);
7140 }).curve(curve);
7141 svg.append('svg:path').attr('d', lineGen(points)).style('stroke', color).style('stroke-width', config.lineStrokeWidth).style('fill', 'none');
7142} // Pass in the element and its pre-transform coords
7143
7144
7145function getElementCoords(element, coords) {
7146 coords = coords || element.node().getBBox();
7147 var ctm = element.node().getCTM();
7148 var xn = ctm.e + coords.x * ctm.a;
7149 var yn = ctm.f + coords.y * ctm.d;
7150 return {
7151 left: xn,
7152 top: yn,
7153 width: coords.width,
7154 height: coords.height
7155 };
7156}
7157
7158function svgDrawLineForCommits(svg, fromId, toId, direction, color) {
7159 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('svgDrawLineForCommits: ', fromId, toId);
7160 var fromBbox = getElementCoords(svg.select('#node-' + fromId + ' circle'));
7161 var toBbox = getElementCoords(svg.select('#node-' + toId + ' circle'));
7162
7163 switch (direction) {
7164 case 'LR':
7165 // (toBbox)
7166 // +--------
7167 // + (fromBbox)
7168 if (fromBbox.left - toBbox.left > config.nodeSpacing) {
7169 var lineStart = {
7170 x: fromBbox.left - config.nodeSpacing,
7171 y: toBbox.top + toBbox.height / 2
7172 };
7173 var lineEnd = {
7174 x: toBbox.left + toBbox.width,
7175 y: toBbox.top + toBbox.height / 2
7176 };
7177 svgDrawLine(svg, [lineStart, lineEnd], color, 'linear');
7178 svgDrawLine(svg, [{
7179 x: fromBbox.left,
7180 y: fromBbox.top + fromBbox.height / 2
7181 }, {
7182 x: fromBbox.left - config.nodeSpacing / 2,
7183 y: fromBbox.top + fromBbox.height / 2
7184 }, {
7185 x: fromBbox.left - config.nodeSpacing / 2,
7186 y: lineStart.y
7187 }, lineStart], color);
7188 } else {
7189 svgDrawLine(svg, [{
7190 x: fromBbox.left,
7191 y: fromBbox.top + fromBbox.height / 2
7192 }, {
7193 x: fromBbox.left - config.nodeSpacing / 2,
7194 y: fromBbox.top + fromBbox.height / 2
7195 }, {
7196 x: fromBbox.left - config.nodeSpacing / 2,
7197 y: toBbox.top + toBbox.height / 2
7198 }, {
7199 x: toBbox.left + toBbox.width,
7200 y: toBbox.top + toBbox.height / 2
7201 }], color);
7202 }
7203
7204 break;
7205
7206 case 'BT':
7207 // + (fromBbox)
7208 // |
7209 // |
7210 // + (toBbox)
7211 if (toBbox.top - fromBbox.top > config.nodeSpacing) {
7212 var _lineStart = {
7213 x: toBbox.left + toBbox.width / 2,
7214 y: fromBbox.top + fromBbox.height + config.nodeSpacing
7215 };
7216 var _lineEnd = {
7217 x: toBbox.left + toBbox.width / 2,
7218 y: toBbox.top
7219 };
7220 svgDrawLine(svg, [_lineStart, _lineEnd], color, 'linear');
7221 svgDrawLine(svg, [{
7222 x: fromBbox.left + fromBbox.width / 2,
7223 y: fromBbox.top + fromBbox.height
7224 }, {
7225 x: fromBbox.left + fromBbox.width / 2,
7226 y: fromBbox.top + fromBbox.height + config.nodeSpacing / 2
7227 }, {
7228 x: toBbox.left + toBbox.width / 2,
7229 y: _lineStart.y - config.nodeSpacing / 2
7230 }, _lineStart], color);
7231 } else {
7232 svgDrawLine(svg, [{
7233 x: fromBbox.left + fromBbox.width / 2,
7234 y: fromBbox.top + fromBbox.height
7235 }, {
7236 x: fromBbox.left + fromBbox.width / 2,
7237 y: fromBbox.top + config.nodeSpacing / 2
7238 }, {
7239 x: toBbox.left + toBbox.width / 2,
7240 y: toBbox.top - config.nodeSpacing / 2
7241 }, {
7242 x: toBbox.left + toBbox.width / 2,
7243 y: toBbox.top
7244 }], color);
7245 }
7246
7247 break;
7248 }
7249}
7250
7251function cloneNode(svg, selector) {
7252 return svg.select(selector).node().cloneNode(true);
7253}
7254
7255function renderCommitHistory(svg, commitid, branches, direction) {
7256 var commit;
7257 var numCommits = Object.keys(allCommitsDict).length;
7258
7259 if (typeof commitid === 'string') {
7260 do {
7261 commit = allCommitsDict[commitid];
7262 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('in renderCommitHistory', commit.id, commit.seq);
7263
7264 if (svg.select('#node-' + commitid).size() > 0) {
7265 return;
7266 }
7267
7268 svg.append(function () {
7269 return cloneNode(svg, '#def-commit');
7270 }).attr('class', 'commit').attr('id', function () {
7271 return 'node-' + commit.id;
7272 }).attr('transform', function () {
7273 switch (direction) {
7274 case 'LR':
7275 return 'translate(' + (commit.seq * config.nodeSpacing + config.leftMargin) + ', ' + branchNum * config.branchOffset + ')';
7276
7277 case 'BT':
7278 return 'translate(' + (branchNum * config.branchOffset + config.leftMargin) + ', ' + (numCommits - commit.seq) * config.nodeSpacing + ')';
7279 }
7280 }).attr('fill', config.nodeFillColor).attr('stroke', config.nodeStrokeColor).attr('stroke-width', config.nodeStrokeWidth);
7281 var branch = void 0;
7282
7283 for (var branchName in branches) {
7284 if (branches[branchName].commit === commit) {
7285 branch = branches[branchName];
7286 break;
7287 }
7288 }
7289
7290 if (branch) {
7291 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('found branch ', branch.name);
7292 svg.select('#node-' + commit.id + ' p').append('xhtml:span').attr('class', 'branch-label').text(branch.name + ', ');
7293 }
7294
7295 svg.select('#node-' + commit.id + ' p').append('xhtml:span').attr('class', 'commit-id').text(commit.id);
7296
7297 if (commit.message !== '' && direction === 'BT') {
7298 svg.select('#node-' + commit.id + ' p').append('xhtml:span').attr('class', 'commit-msg').text(', ' + commit.message);
7299 }
7300
7301 commitid = commit.parent;
7302 } while (commitid && allCommitsDict[commitid]);
7303 }
7304
7305 if (Array.isArray(commitid)) {
7306 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('found merge commmit', commitid);
7307 renderCommitHistory(svg, commitid[0], branches, direction);
7308 branchNum++;
7309 renderCommitHistory(svg, commitid[1], branches, direction);
7310 branchNum--;
7311 }
7312}
7313
7314function renderLines(svg, commit, direction, branchColor) {
7315 branchColor = branchColor || 0;
7316
7317 while (commit.seq > 0 && !commit.lineDrawn) {
7318 if (typeof commit.parent === 'string') {
7319 svgDrawLineForCommits(svg, commit.id, commit.parent, direction, branchColor);
7320 commit.lineDrawn = true;
7321 commit = allCommitsDict[commit.parent];
7322 } else if (Array.isArray(commit.parent)) {
7323 svgDrawLineForCommits(svg, commit.id, commit.parent[0], direction, branchColor);
7324 svgDrawLineForCommits(svg, commit.id, commit.parent[1], direction, branchColor + 1);
7325 renderLines(svg, allCommitsDict[commit.parent[1]], direction, branchColor + 1);
7326 commit.lineDrawn = true;
7327 commit = allCommitsDict[commit.parent[0]];
7328 }
7329 }
7330}
7331
7332var draw = function draw(txt, id, ver) {
7333 try {
7334 var parser = _parser_gitGraph__WEBPACK_IMPORTED_MODULE_3___default.a.parser;
7335 parser.yy = _gitGraphAst__WEBPACK_IMPORTED_MODULE_2__["default"];
7336 parser.yy.clear();
7337 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('in gitgraph renderer', txt + '\n', 'id:', id, ver); // Parse the graph definition
7338
7339 parser.parse(txt + '\n');
7340 config = lodash__WEBPACK_IMPORTED_MODULE_1___default.a.assign(config, apiConfig, _gitGraphAst__WEBPACK_IMPORTED_MODULE_2__["default"].getOptions());
7341 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('effective options', config);
7342 var direction = _gitGraphAst__WEBPACK_IMPORTED_MODULE_2__["default"].getDirection();
7343 allCommitsDict = _gitGraphAst__WEBPACK_IMPORTED_MODULE_2__["default"].getCommits();
7344 var branches = _gitGraphAst__WEBPACK_IMPORTED_MODULE_2__["default"].getBranchesAsObjArray();
7345
7346 if (direction === 'BT') {
7347 config.nodeLabel.x = branches.length * config.branchOffset;
7348 config.nodeLabel.width = '100%';
7349 config.nodeLabel.y = -1 * 2 * config.nodeRadius;
7350 }
7351
7352 var svg = d3__WEBPACK_IMPORTED_MODULE_0__["select"]("[id=\"".concat(id, "\"]"));
7353 svgCreateDefs(svg);
7354 branchNum = 1;
7355
7356 for (var branch in branches) {
7357 var v = branches[branch];
7358 renderCommitHistory(svg, v.commit.id, branches, direction);
7359 renderLines(svg, v.commit, direction);
7360 branchNum++;
7361 }
7362
7363 svg.attr('height', function () {
7364 if (direction === 'BT') return Object.keys(allCommitsDict).length * config.nodeSpacing;
7365 return (branches.length + 1) * config.branchOffset;
7366 });
7367 } catch (e) {
7368 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].error('Error while rendering gitgraph');
7369 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].error(e.message);
7370 }
7371};
7372/* harmony default export */ __webpack_exports__["default"] = ({
7373 setConf: setConf,
7374 draw: draw
7375});
7376
7377/***/ }),
7378
7379/***/ "./src/diagrams/git/parser/gitGraph.jison":
7380/*!************************************************!*\
7381 !*** ./src/diagrams/git/parser/gitGraph.jison ***!
7382 \************************************************/
7383/*! no static exports found */
7384/***/ (function(module, exports, __webpack_require__) {
7385
7386/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */
7387/*
7388 Returns a Parser object of the following structure:
7389
7390 Parser: {
7391 yy: {}
7392 }
7393
7394 Parser.prototype: {
7395 yy: {},
7396 trace: function(),
7397 symbols_: {associative list: name ==> number},
7398 terminals_: {associative list: number ==> name},
7399 productions_: [...],
7400 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
7401 table: [...],
7402 defaultActions: {...},
7403 parseError: function(str, hash),
7404 parse: function(input),
7405
7406 lexer: {
7407 EOF: 1,
7408 parseError: function(str, hash),
7409 setInput: function(input),
7410 input: function(),
7411 unput: function(str),
7412 more: function(),
7413 less: function(n),
7414 pastInput: function(),
7415 upcomingInput: function(),
7416 showPosition: function(),
7417 test_match: function(regex_match_array, rule_index),
7418 next: function(),
7419 lex: function(),
7420 begin: function(condition),
7421 popState: function(),
7422 _currentRules: function(),
7423 topState: function(),
7424 pushState: function(condition),
7425
7426 options: {
7427 ranges: boolean (optional: true ==> token location info will include a .range[] member)
7428 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
7429 backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
7430 },
7431
7432 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
7433 rules: [...],
7434 conditions: {associative list: name ==> set},
7435 }
7436 }
7437
7438
7439 token location info (@$, _$, etc.): {
7440 first_line: n,
7441 last_line: n,
7442 first_column: n,
7443 last_column: n,
7444 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
7445 }
7446
7447
7448 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
7449 text: (matched text)
7450 token: (the produced terminal token, if any)
7451 line: (yylineno)
7452 }
7453 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
7454 loc: (yylloc)
7455 expected: (string describing the set of expected tokens)
7456 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
7457 }
7458*/
7459var parser = (function(){
7460var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[2,3],$V1=[1,7],$V2=[7,12,15,17,19,20,21],$V3=[7,11,12,15,17,19,20,21],$V4=[2,20],$V5=[1,32];
7461var parser = {trace: function trace () { },
7462yy: {},
7463symbols_: {"error":2,"start":3,"GG":4,":":5,"document":6,"EOF":7,"DIR":8,"options":9,"body":10,"OPT":11,"NL":12,"line":13,"statement":14,"COMMIT":15,"commit_arg":16,"BRANCH":17,"ID":18,"CHECKOUT":19,"MERGE":20,"RESET":21,"reset_arg":22,"STR":23,"HEAD":24,"reset_parents":25,"CARET":26,"$accept":0,"$end":1},
7464terminals_: {2:"error",4:"GG",5:":",7:"EOF",8:"DIR",11:"OPT",12:"NL",15:"COMMIT",17:"BRANCH",18:"ID",19:"CHECKOUT",20:"MERGE",21:"RESET",23:"STR",24:"HEAD",26:"CARET"},
7465productions_: [0,[3,4],[3,5],[6,0],[6,2],[9,2],[9,1],[10,0],[10,2],[13,2],[13,1],[14,2],[14,2],[14,2],[14,2],[14,2],[16,0],[16,1],[22,2],[22,2],[25,0],[25,2]],
7466performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
7467/* this == yyval */
7468
7469var $0 = $$.length - 1;
7470switch (yystate) {
7471case 1:
7472 return $$[$0-1];
7473break;
7474case 2:
7475yy.setDirection($$[$0-3]); return $$[$0-1];
7476break;
7477case 4:
7478 yy.setOptions($$[$0-1]); this.$ = $$[$0]
7479break;
7480case 5:
7481$$[$0-1] +=$$[$0]; this.$=$$[$0-1]
7482break;
7483case 7:
7484this.$ = []
7485break;
7486case 8:
7487$$[$0-1].push($$[$0]); this.$=$$[$0-1];
7488break;
7489case 9:
7490this.$ =$$[$0-1]
7491break;
7492case 11:
7493yy.commit($$[$0])
7494break;
7495case 12:
7496yy.branch($$[$0])
7497break;
7498case 13:
7499yy.checkout($$[$0])
7500break;
7501case 14:
7502yy.merge($$[$0])
7503break;
7504case 15:
7505yy.reset($$[$0])
7506break;
7507case 16:
7508this.$ = ""
7509break;
7510case 17:
7511this.$=$$[$0]
7512break;
7513case 18:
7514this.$ = $$[$0-1]+ ":" + $$[$0]
7515break;
7516case 19:
7517this.$ = $$[$0-1]+ ":" + yy.count; yy.count = 0
7518break;
7519case 20:
7520yy.count = 0
7521break;
7522case 21:
7523 yy.count += 1
7524break;
7525}
7526},
7527table: [{3:1,4:[1,2]},{1:[3]},{5:[1,3],8:[1,4]},{6:5,7:$V0,9:6,12:$V1},{5:[1,8]},{7:[1,9]},o($V2,[2,7],{10:10,11:[1,11]}),o($V3,[2,6]),{6:12,7:$V0,9:6,12:$V1},{1:[2,1]},{7:[2,4],12:[1,15],13:13,14:14,15:[1,16],17:[1,17],19:[1,18],20:[1,19],21:[1,20]},o($V3,[2,5]),{7:[1,21]},o($V2,[2,8]),{12:[1,22]},o($V2,[2,10]),{12:[2,16],16:23,23:[1,24]},{18:[1,25]},{18:[1,26]},{18:[1,27]},{18:[1,30],22:28,24:[1,29]},{1:[2,2]},o($V2,[2,9]),{12:[2,11]},{12:[2,17]},{12:[2,12]},{12:[2,13]},{12:[2,14]},{12:[2,15]},{12:$V4,25:31,26:$V5},{12:$V4,25:33,26:$V5},{12:[2,18]},{12:$V4,25:34,26:$V5},{12:[2,19]},{12:[2,21]}],
7528defaultActions: {9:[2,1],21:[2,2],23:[2,11],24:[2,17],25:[2,12],26:[2,13],27:[2,14],28:[2,15],31:[2,18],33:[2,19],34:[2,21]},
7529parseError: function parseError (str, hash) {
7530 if (hash.recoverable) {
7531 this.trace(str);
7532 } else {
7533 var error = new Error(str);
7534 error.hash = hash;
7535 throw error;
7536 }
7537},
7538parse: function parse(input) {
7539 var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
7540 var args = lstack.slice.call(arguments, 1);
7541 var lexer = Object.create(this.lexer);
7542 var sharedState = { yy: {} };
7543 for (var k in this.yy) {
7544 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
7545 sharedState.yy[k] = this.yy[k];
7546 }
7547 }
7548 lexer.setInput(input, sharedState.yy);
7549 sharedState.yy.lexer = lexer;
7550 sharedState.yy.parser = this;
7551 if (typeof lexer.yylloc == 'undefined') {
7552 lexer.yylloc = {};
7553 }
7554 var yyloc = lexer.yylloc;
7555 lstack.push(yyloc);
7556 var ranges = lexer.options && lexer.options.ranges;
7557 if (typeof sharedState.yy.parseError === 'function') {
7558 this.parseError = sharedState.yy.parseError;
7559 } else {
7560 this.parseError = Object.getPrototypeOf(this).parseError;
7561 }
7562 function popStack(n) {
7563 stack.length = stack.length - 2 * n;
7564 vstack.length = vstack.length - n;
7565 lstack.length = lstack.length - n;
7566 }
7567 function lex() {
7568 var token;
7569 token = tstack.pop() || lexer.lex() || EOF;
7570 if (typeof token !== 'number') {
7571 if (token instanceof Array) {
7572 tstack = token;
7573 token = tstack.pop();
7574 }
7575 token = self.symbols_[token] || token;
7576 }
7577 return token;
7578 }
7579 var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
7580 while (true) {
7581 state = stack[stack.length - 1];
7582 if (this.defaultActions[state]) {
7583 action = this.defaultActions[state];
7584 } else {
7585 if (symbol === null || typeof symbol == 'undefined') {
7586 symbol = lex();
7587 }
7588 action = table[state] && table[state][symbol];
7589 }
7590 if (typeof action === 'undefined' || !action.length || !action[0]) {
7591 var errStr = '';
7592 expected = [];
7593 for (p in table[state]) {
7594 if (this.terminals_[p] && p > TERROR) {
7595 expected.push('\'' + this.terminals_[p] + '\'');
7596 }
7597 }
7598 if (lexer.showPosition) {
7599 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
7600 } else {
7601 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
7602 }
7603 this.parseError(errStr, {
7604 text: lexer.match,
7605 token: this.terminals_[symbol] || symbol,
7606 line: lexer.yylineno,
7607 loc: yyloc,
7608 expected: expected
7609 });
7610 }
7611 if (action[0] instanceof Array && action.length > 1) {
7612 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
7613 }
7614 switch (action[0]) {
7615 case 1:
7616 stack.push(symbol);
7617 vstack.push(lexer.yytext);
7618 lstack.push(lexer.yylloc);
7619 stack.push(action[1]);
7620 symbol = null;
7621 if (!preErrorSymbol) {
7622 yyleng = lexer.yyleng;
7623 yytext = lexer.yytext;
7624 yylineno = lexer.yylineno;
7625 yyloc = lexer.yylloc;
7626 if (recovering > 0) {
7627 recovering--;
7628 }
7629 } else {
7630 symbol = preErrorSymbol;
7631 preErrorSymbol = null;
7632 }
7633 break;
7634 case 2:
7635 len = this.productions_[action[1]][1];
7636 yyval.$ = vstack[vstack.length - len];
7637 yyval._$ = {
7638 first_line: lstack[lstack.length - (len || 1)].first_line,
7639 last_line: lstack[lstack.length - 1].last_line,
7640 first_column: lstack[lstack.length - (len || 1)].first_column,
7641 last_column: lstack[lstack.length - 1].last_column
7642 };
7643 if (ranges) {
7644 yyval._$.range = [
7645 lstack[lstack.length - (len || 1)].range[0],
7646 lstack[lstack.length - 1].range[1]
7647 ];
7648 }
7649 r = this.performAction.apply(yyval, [
7650 yytext,
7651 yyleng,
7652 yylineno,
7653 sharedState.yy,
7654 action[1],
7655 vstack,
7656 lstack
7657 ].concat(args));
7658 if (typeof r !== 'undefined') {
7659 return r;
7660 }
7661 if (len) {
7662 stack = stack.slice(0, -1 * len * 2);
7663 vstack = vstack.slice(0, -1 * len);
7664 lstack = lstack.slice(0, -1 * len);
7665 }
7666 stack.push(this.productions_[action[1]][0]);
7667 vstack.push(yyval.$);
7668 lstack.push(yyval._$);
7669 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
7670 stack.push(newState);
7671 break;
7672 case 3:
7673 return true;
7674 }
7675 }
7676 return true;
7677}};
7678/* generated by jison-lex 0.3.4 */
7679var lexer = (function(){
7680var lexer = ({
7681
7682EOF:1,
7683
7684parseError:function parseError(str, hash) {
7685 if (this.yy.parser) {
7686 this.yy.parser.parseError(str, hash);
7687 } else {
7688 throw new Error(str);
7689 }
7690 },
7691
7692// resets the lexer, sets new input
7693setInput:function (input, yy) {
7694 this.yy = yy || this.yy || {};
7695 this._input = input;
7696 this._more = this._backtrack = this.done = false;
7697 this.yylineno = this.yyleng = 0;
7698 this.yytext = this.matched = this.match = '';
7699 this.conditionStack = ['INITIAL'];
7700 this.yylloc = {
7701 first_line: 1,
7702 first_column: 0,
7703 last_line: 1,
7704 last_column: 0
7705 };
7706 if (this.options.ranges) {
7707 this.yylloc.range = [0,0];
7708 }
7709 this.offset = 0;
7710 return this;
7711 },
7712
7713// consumes and returns one char from the input
7714input:function () {
7715 var ch = this._input[0];
7716 this.yytext += ch;
7717 this.yyleng++;
7718 this.offset++;
7719 this.match += ch;
7720 this.matched += ch;
7721 var lines = ch.match(/(?:\r\n?|\n).*/g);
7722 if (lines) {
7723 this.yylineno++;
7724 this.yylloc.last_line++;
7725 } else {
7726 this.yylloc.last_column++;
7727 }
7728 if (this.options.ranges) {
7729 this.yylloc.range[1]++;
7730 }
7731
7732 this._input = this._input.slice(1);
7733 return ch;
7734 },
7735
7736// unshifts one char (or a string) into the input
7737unput:function (ch) {
7738 var len = ch.length;
7739 var lines = ch.split(/(?:\r\n?|\n)/g);
7740
7741 this._input = ch + this._input;
7742 this.yytext = this.yytext.substr(0, this.yytext.length - len);
7743 //this.yyleng -= len;
7744 this.offset -= len;
7745 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
7746 this.match = this.match.substr(0, this.match.length - 1);
7747 this.matched = this.matched.substr(0, this.matched.length - 1);
7748
7749 if (lines.length - 1) {
7750 this.yylineno -= lines.length - 1;
7751 }
7752 var r = this.yylloc.range;
7753
7754 this.yylloc = {
7755 first_line: this.yylloc.first_line,
7756 last_line: this.yylineno + 1,
7757 first_column: this.yylloc.first_column,
7758 last_column: lines ?
7759 (lines.length === oldLines.length ? this.yylloc.first_column : 0)
7760 + oldLines[oldLines.length - lines.length].length - lines[0].length :
7761 this.yylloc.first_column - len
7762 };
7763
7764 if (this.options.ranges) {
7765 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
7766 }
7767 this.yyleng = this.yytext.length;
7768 return this;
7769 },
7770
7771// When called from action, caches matched text and appends it on next action
7772more:function () {
7773 this._more = true;
7774 return this;
7775 },
7776
7777// 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.
7778reject:function () {
7779 if (this.options.backtrack_lexer) {
7780 this._backtrack = true;
7781 } else {
7782 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(), {
7783 text: "",
7784 token: null,
7785 line: this.yylineno
7786 });
7787
7788 }
7789 return this;
7790 },
7791
7792// retain first n characters of the match
7793less:function (n) {
7794 this.unput(this.match.slice(n));
7795 },
7796
7797// displays already matched input, i.e. for error messages
7798pastInput:function () {
7799 var past = this.matched.substr(0, this.matched.length - this.match.length);
7800 return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
7801 },
7802
7803// displays upcoming input, i.e. for error messages
7804upcomingInput:function () {
7805 var next = this.match;
7806 if (next.length < 20) {
7807 next += this._input.substr(0, 20-next.length);
7808 }
7809 return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
7810 },
7811
7812// displays the character position where the lexing error occurred, i.e. for error messages
7813showPosition:function () {
7814 var pre = this.pastInput();
7815 var c = new Array(pre.length + 1).join("-");
7816 return pre + this.upcomingInput() + "\n" + c + "^";
7817 },
7818
7819// test the lexed token: return FALSE when not a match, otherwise return token
7820test_match:function(match, indexed_rule) {
7821 var token,
7822 lines,
7823 backup;
7824
7825 if (this.options.backtrack_lexer) {
7826 // save context
7827 backup = {
7828 yylineno: this.yylineno,
7829 yylloc: {
7830 first_line: this.yylloc.first_line,
7831 last_line: this.last_line,
7832 first_column: this.yylloc.first_column,
7833 last_column: this.yylloc.last_column
7834 },
7835 yytext: this.yytext,
7836 match: this.match,
7837 matches: this.matches,
7838 matched: this.matched,
7839 yyleng: this.yyleng,
7840 offset: this.offset,
7841 _more: this._more,
7842 _input: this._input,
7843 yy: this.yy,
7844 conditionStack: this.conditionStack.slice(0),
7845 done: this.done
7846 };
7847 if (this.options.ranges) {
7848 backup.yylloc.range = this.yylloc.range.slice(0);
7849 }
7850 }
7851
7852 lines = match[0].match(/(?:\r\n?|\n).*/g);
7853 if (lines) {
7854 this.yylineno += lines.length;
7855 }
7856 this.yylloc = {
7857 first_line: this.yylloc.last_line,
7858 last_line: this.yylineno + 1,
7859 first_column: this.yylloc.last_column,
7860 last_column: lines ?
7861 lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
7862 this.yylloc.last_column + match[0].length
7863 };
7864 this.yytext += match[0];
7865 this.match += match[0];
7866 this.matches = match;
7867 this.yyleng = this.yytext.length;
7868 if (this.options.ranges) {
7869 this.yylloc.range = [this.offset, this.offset += this.yyleng];
7870 }
7871 this._more = false;
7872 this._backtrack = false;
7873 this._input = this._input.slice(match[0].length);
7874 this.matched += match[0];
7875 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
7876 if (this.done && this._input) {
7877 this.done = false;
7878 }
7879 if (token) {
7880 return token;
7881 } else if (this._backtrack) {
7882 // recover context
7883 for (var k in backup) {
7884 this[k] = backup[k];
7885 }
7886 return false; // rule action called reject() implying the next rule should be tested instead.
7887 }
7888 return false;
7889 },
7890
7891// return next match in input
7892next:function () {
7893 if (this.done) {
7894 return this.EOF;
7895 }
7896 if (!this._input) {
7897 this.done = true;
7898 }
7899
7900 var token,
7901 match,
7902 tempMatch,
7903 index;
7904 if (!this._more) {
7905 this.yytext = '';
7906 this.match = '';
7907 }
7908 var rules = this._currentRules();
7909 for (var i = 0; i < rules.length; i++) {
7910 tempMatch = this._input.match(this.rules[rules[i]]);
7911 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
7912 match = tempMatch;
7913 index = i;
7914 if (this.options.backtrack_lexer) {
7915 token = this.test_match(tempMatch, rules[i]);
7916 if (token !== false) {
7917 return token;
7918 } else if (this._backtrack) {
7919 match = false;
7920 continue; // rule action called reject() implying a rule MISmatch.
7921 } else {
7922 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
7923 return false;
7924 }
7925 } else if (!this.options.flex) {
7926 break;
7927 }
7928 }
7929 }
7930 if (match) {
7931 token = this.test_match(match, rules[index]);
7932 if (token !== false) {
7933 return token;
7934 }
7935 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
7936 return false;
7937 }
7938 if (this._input === "") {
7939 return this.EOF;
7940 } else {
7941 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
7942 text: "",
7943 token: null,
7944 line: this.yylineno
7945 });
7946 }
7947 },
7948
7949// return next match that has a token
7950lex:function lex () {
7951 var r = this.next();
7952 if (r) {
7953 return r;
7954 } else {
7955 return this.lex();
7956 }
7957 },
7958
7959// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
7960begin:function begin (condition) {
7961 this.conditionStack.push(condition);
7962 },
7963
7964// pop the previously active lexer condition state off the condition stack
7965popState:function popState () {
7966 var n = this.conditionStack.length - 1;
7967 if (n > 0) {
7968 return this.conditionStack.pop();
7969 } else {
7970 return this.conditionStack[0];
7971 }
7972 },
7973
7974// produce the lexer rule set which is active for the currently active lexer condition state
7975_currentRules:function _currentRules () {
7976 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
7977 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
7978 } else {
7979 return this.conditions["INITIAL"].rules;
7980 }
7981 },
7982
7983// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
7984topState:function topState (n) {
7985 n = this.conditionStack.length - 1 - Math.abs(n || 0);
7986 if (n >= 0) {
7987 return this.conditionStack[n];
7988 } else {
7989 return "INITIAL";
7990 }
7991 },
7992
7993// alias for begin(condition)
7994pushState:function pushState (condition) {
7995 this.begin(condition);
7996 },
7997
7998// return the number of states currently on the stack
7999stateStackSize:function stateStackSize() {
8000 return this.conditionStack.length;
8001 },
8002options: {"case-insensitive":true},
8003performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
8004var YYSTATE=YY_START;
8005switch($avoiding_name_collisions) {
8006case 0:return 12;
8007break;
8008case 1:/* skip all whitespace */
8009break;
8010case 2:/* skip comments */
8011break;
8012case 3:/* skip comments */
8013break;
8014case 4:return 4;
8015break;
8016case 5:return 15;
8017break;
8018case 6:return 17;
8019break;
8020case 7:return 20;
8021break;
8022case 8:return 21;
8023break;
8024case 9:return 19;
8025break;
8026case 10:return 8;
8027break;
8028case 11:return 8;
8029break;
8030case 12:return 5;
8031break;
8032case 13:return 26
8033break;
8034case 14:this.begin("options");
8035break;
8036case 15:this.popState();
8037break;
8038case 16:return 11;
8039break;
8040case 17:this.begin("string");
8041break;
8042case 18:this.popState();
8043break;
8044case 19:return 23;
8045break;
8046case 20:return 18;
8047break;
8048case 21:return 7;
8049break;
8050}
8051},
8052rules: [/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:gitGraph\b)/i,/^(?:commit\b)/i,/^(?:branch\b)/i,/^(?:merge\b)/i,/^(?:reset\b)/i,/^(?:checkout\b)/i,/^(?:LR\b)/i,/^(?:BT\b)/i,/^(?::)/i,/^(?:\^)/i,/^(?:options\r?\n)/i,/^(?:end\r?\n)/i,/^(?:[^\n]+\r?\n)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[a-zA-Z][a-zA-Z0-9_]+)/i,/^(?:$)/i],
8053conditions: {"options":{"rules":[15,16],"inclusive":false},"string":{"rules":[18,19],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17,20,21],"inclusive":true}}
8054});
8055return lexer;
8056})();
8057parser.lexer = lexer;
8058function Parser () {
8059 this.yy = {};
8060}
8061Parser.prototype = parser;parser.Parser = Parser;
8062return new Parser;
8063})();
8064
8065
8066if (true) {
8067exports.parser = parser;
8068exports.Parser = parser.Parser;
8069exports.parse = function () { return parser.parse.apply(parser, arguments); };
8070exports.main = function commonjsMain (args) {
8071 if (!args[1]) {
8072 console.log('Usage: '+args[0]+' FILE');
8073 process.exit(1);
8074 }
8075 var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8");
8076 return exports.parser.parse(source);
8077};
8078if ( true && __webpack_require__.c[__webpack_require__.s] === module) {
8079 exports.main(process.argv.slice(1));
8080}
8081}
8082/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
8083
8084/***/ }),
8085
8086/***/ "./src/diagrams/info/infoDb.js":
8087/*!*************************************!*\
8088 !*** ./src/diagrams/info/infoDb.js ***!
8089 \*************************************/
8090/*! exports provided: setMessage, getMessage, setInfo, getInfo, default */
8091/***/ (function(module, __webpack_exports__, __webpack_require__) {
8092
8093"use strict";
8094__webpack_require__.r(__webpack_exports__);
8095/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setMessage", function() { return setMessage; });
8096/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMessage", function() { return getMessage; });
8097/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setInfo", function() { return setInfo; });
8098/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getInfo", function() { return getInfo; });
8099/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
8100/**
8101 * Created by knut on 15-01-14.
8102 */
8103
8104var message = '';
8105var info = false;
8106var setMessage = function setMessage(txt) {
8107 _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Setting message to: ' + txt);
8108 message = txt;
8109};
8110var getMessage = function getMessage() {
8111 return message;
8112};
8113var setInfo = function setInfo(inf) {
8114 info = inf;
8115};
8116var getInfo = function getInfo() {
8117 return info;
8118}; // export const parseError = (err, hash) => {
8119// global.mermaidAPI.parseError(err, hash)
8120// }
8121
8122/* harmony default export */ __webpack_exports__["default"] = ({
8123 setMessage: setMessage,
8124 getMessage: getMessage,
8125 setInfo: setInfo,
8126 getInfo: getInfo // parseError
8127
8128});
8129
8130/***/ }),
8131
8132/***/ "./src/diagrams/info/infoRenderer.js":
8133/*!*******************************************!*\
8134 !*** ./src/diagrams/info/infoRenderer.js ***!
8135 \*******************************************/
8136/*! exports provided: setConf, draw, default */
8137/***/ (function(module, __webpack_exports__, __webpack_require__) {
8138
8139"use strict";
8140__webpack_require__.r(__webpack_exports__);
8141/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; });
8142/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; });
8143/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
8144/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
8145/* harmony import */ var _infoDb__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./infoDb */ "./src/diagrams/info/infoDb.js");
8146/* harmony import */ var _parser_info__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./parser/info */ "./src/diagrams/info/parser/info.jison");
8147/* harmony import */ var _parser_info__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_parser_info__WEBPACK_IMPORTED_MODULE_2__);
8148/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
8149/**
8150 * Created by knut on 14-12-11.
8151 */
8152
8153
8154
8155
8156var conf = {};
8157var setConf = function setConf(cnf) {
8158 var keys = Object.keys(cnf);
8159 keys.forEach(function (key) {
8160 conf[key] = cnf[key];
8161 });
8162};
8163/**
8164 * Draws a an info picture in the tag with id: id based on the graph definition in text.
8165 * @param text
8166 * @param id
8167 */
8168
8169var draw = function draw(txt, id, ver) {
8170 try {
8171 var parser = _parser_info__WEBPACK_IMPORTED_MODULE_2___default.a.parser;
8172 parser.yy = _infoDb__WEBPACK_IMPORTED_MODULE_1__["default"];
8173 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Renering info diagram\n' + txt); // Parse the graph definition
8174
8175 parser.parse(txt);
8176 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Parsed info diagram'); // Fetch the default direction, use TD if none was found
8177
8178 var svg = d3__WEBPACK_IMPORTED_MODULE_0__["select"]('#' + id);
8179 var g = svg.append('g');
8180 g.append('text') // text label for the x axis
8181 .attr('x', 100).attr('y', 40).attr('class', 'version').attr('font-size', '32px').style('text-anchor', 'middle').text('v ' + ver);
8182 svg.attr('height', 100);
8183 svg.attr('width', 400); // svg.attr('viewBox', '0 0 300 150');
8184 } catch (e) {
8185 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].error('Error while rendering info diagram');
8186 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].error(e.message);
8187 }
8188};
8189/* harmony default export */ __webpack_exports__["default"] = ({
8190 setConf: setConf,
8191 draw: draw
8192});
8193
8194/***/ }),
8195
8196/***/ "./src/diagrams/info/parser/info.jison":
8197/*!*********************************************!*\
8198 !*** ./src/diagrams/info/parser/info.jison ***!
8199 \*********************************************/
8200/*! no static exports found */
8201/***/ (function(module, exports, __webpack_require__) {
8202
8203/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */
8204/*
8205 Returns a Parser object of the following structure:
8206
8207 Parser: {
8208 yy: {}
8209 }
8210
8211 Parser.prototype: {
8212 yy: {},
8213 trace: function(),
8214 symbols_: {associative list: name ==> number},
8215 terminals_: {associative list: number ==> name},
8216 productions_: [...],
8217 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
8218 table: [...],
8219 defaultActions: {...},
8220 parseError: function(str, hash),
8221 parse: function(input),
8222
8223 lexer: {
8224 EOF: 1,
8225 parseError: function(str, hash),
8226 setInput: function(input),
8227 input: function(),
8228 unput: function(str),
8229 more: function(),
8230 less: function(n),
8231 pastInput: function(),
8232 upcomingInput: function(),
8233 showPosition: function(),
8234 test_match: function(regex_match_array, rule_index),
8235 next: function(),
8236 lex: function(),
8237 begin: function(condition),
8238 popState: function(),
8239 _currentRules: function(),
8240 topState: function(),
8241 pushState: function(condition),
8242
8243 options: {
8244 ranges: boolean (optional: true ==> token location info will include a .range[] member)
8245 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
8246 backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
8247 },
8248
8249 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
8250 rules: [...],
8251 conditions: {associative list: name ==> set},
8252 }
8253 }
8254
8255
8256 token location info (@$, _$, etc.): {
8257 first_line: n,
8258 last_line: n,
8259 first_column: n,
8260 last_column: n,
8261 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
8262 }
8263
8264
8265 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
8266 text: (matched text)
8267 token: (the produced terminal token, if any)
8268 line: (yylineno)
8269 }
8270 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
8271 loc: (yylloc)
8272 expected: (string describing the set of expected tokens)
8273 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
8274 }
8275*/
8276var parser = (function(){
8277var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[6,9,10];
8278var parser = {trace: function trace () { },
8279yy: {},
8280symbols_: {"error":2,"start":3,"info":4,"document":5,"EOF":6,"line":7,"statement":8,"NL":9,"showInfo":10,"$accept":0,"$end":1},
8281terminals_: {2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo"},
8282productions_: [0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1]],
8283performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
8284/* this == yyval */
8285
8286var $0 = $$.length - 1;
8287switch (yystate) {
8288case 1:
8289 return yy;
8290break;
8291case 4:
8292
8293break;
8294case 6:
8295 yy.setInfo(true);
8296break;
8297}
8298},
8299table: [{3:1,4:[1,2]},{1:[3]},o($V0,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8]},{1:[2,1]},o($V0,[2,3]),o($V0,[2,4]),o($V0,[2,5]),o($V0,[2,6])],
8300defaultActions: {4:[2,1]},
8301parseError: function parseError (str, hash) {
8302 if (hash.recoverable) {
8303 this.trace(str);
8304 } else {
8305 var error = new Error(str);
8306 error.hash = hash;
8307 throw error;
8308 }
8309},
8310parse: function parse(input) {
8311 var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
8312 var args = lstack.slice.call(arguments, 1);
8313 var lexer = Object.create(this.lexer);
8314 var sharedState = { yy: {} };
8315 for (var k in this.yy) {
8316 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
8317 sharedState.yy[k] = this.yy[k];
8318 }
8319 }
8320 lexer.setInput(input, sharedState.yy);
8321 sharedState.yy.lexer = lexer;
8322 sharedState.yy.parser = this;
8323 if (typeof lexer.yylloc == 'undefined') {
8324 lexer.yylloc = {};
8325 }
8326 var yyloc = lexer.yylloc;
8327 lstack.push(yyloc);
8328 var ranges = lexer.options && lexer.options.ranges;
8329 if (typeof sharedState.yy.parseError === 'function') {
8330 this.parseError = sharedState.yy.parseError;
8331 } else {
8332 this.parseError = Object.getPrototypeOf(this).parseError;
8333 }
8334 function popStack(n) {
8335 stack.length = stack.length - 2 * n;
8336 vstack.length = vstack.length - n;
8337 lstack.length = lstack.length - n;
8338 }
8339 function lex() {
8340 var token;
8341 token = tstack.pop() || lexer.lex() || EOF;
8342 if (typeof token !== 'number') {
8343 if (token instanceof Array) {
8344 tstack = token;
8345 token = tstack.pop();
8346 }
8347 token = self.symbols_[token] || token;
8348 }
8349 return token;
8350 }
8351 var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
8352 while (true) {
8353 state = stack[stack.length - 1];
8354 if (this.defaultActions[state]) {
8355 action = this.defaultActions[state];
8356 } else {
8357 if (symbol === null || typeof symbol == 'undefined') {
8358 symbol = lex();
8359 }
8360 action = table[state] && table[state][symbol];
8361 }
8362 if (typeof action === 'undefined' || !action.length || !action[0]) {
8363 var errStr = '';
8364 expected = [];
8365 for (p in table[state]) {
8366 if (this.terminals_[p] && p > TERROR) {
8367 expected.push('\'' + this.terminals_[p] + '\'');
8368 }
8369 }
8370 if (lexer.showPosition) {
8371 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
8372 } else {
8373 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
8374 }
8375 this.parseError(errStr, {
8376 text: lexer.match,
8377 token: this.terminals_[symbol] || symbol,
8378 line: lexer.yylineno,
8379 loc: yyloc,
8380 expected: expected
8381 });
8382 }
8383 if (action[0] instanceof Array && action.length > 1) {
8384 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
8385 }
8386 switch (action[0]) {
8387 case 1:
8388 stack.push(symbol);
8389 vstack.push(lexer.yytext);
8390 lstack.push(lexer.yylloc);
8391 stack.push(action[1]);
8392 symbol = null;
8393 if (!preErrorSymbol) {
8394 yyleng = lexer.yyleng;
8395 yytext = lexer.yytext;
8396 yylineno = lexer.yylineno;
8397 yyloc = lexer.yylloc;
8398 if (recovering > 0) {
8399 recovering--;
8400 }
8401 } else {
8402 symbol = preErrorSymbol;
8403 preErrorSymbol = null;
8404 }
8405 break;
8406 case 2:
8407 len = this.productions_[action[1]][1];
8408 yyval.$ = vstack[vstack.length - len];
8409 yyval._$ = {
8410 first_line: lstack[lstack.length - (len || 1)].first_line,
8411 last_line: lstack[lstack.length - 1].last_line,
8412 first_column: lstack[lstack.length - (len || 1)].first_column,
8413 last_column: lstack[lstack.length - 1].last_column
8414 };
8415 if (ranges) {
8416 yyval._$.range = [
8417 lstack[lstack.length - (len || 1)].range[0],
8418 lstack[lstack.length - 1].range[1]
8419 ];
8420 }
8421 r = this.performAction.apply(yyval, [
8422 yytext,
8423 yyleng,
8424 yylineno,
8425 sharedState.yy,
8426 action[1],
8427 vstack,
8428 lstack
8429 ].concat(args));
8430 if (typeof r !== 'undefined') {
8431 return r;
8432 }
8433 if (len) {
8434 stack = stack.slice(0, -1 * len * 2);
8435 vstack = vstack.slice(0, -1 * len);
8436 lstack = lstack.slice(0, -1 * len);
8437 }
8438 stack.push(this.productions_[action[1]][0]);
8439 vstack.push(yyval.$);
8440 lstack.push(yyval._$);
8441 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
8442 stack.push(newState);
8443 break;
8444 case 3:
8445 return true;
8446 }
8447 }
8448 return true;
8449}};
8450
8451/* generated by jison-lex 0.3.4 */
8452var lexer = (function(){
8453var lexer = ({
8454
8455EOF:1,
8456
8457parseError:function parseError(str, hash) {
8458 if (this.yy.parser) {
8459 this.yy.parser.parseError(str, hash);
8460 } else {
8461 throw new Error(str);
8462 }
8463 },
8464
8465// resets the lexer, sets new input
8466setInput:function (input, yy) {
8467 this.yy = yy || this.yy || {};
8468 this._input = input;
8469 this._more = this._backtrack = this.done = false;
8470 this.yylineno = this.yyleng = 0;
8471 this.yytext = this.matched = this.match = '';
8472 this.conditionStack = ['INITIAL'];
8473 this.yylloc = {
8474 first_line: 1,
8475 first_column: 0,
8476 last_line: 1,
8477 last_column: 0
8478 };
8479 if (this.options.ranges) {
8480 this.yylloc.range = [0,0];
8481 }
8482 this.offset = 0;
8483 return this;
8484 },
8485
8486// consumes and returns one char from the input
8487input:function () {
8488 var ch = this._input[0];
8489 this.yytext += ch;
8490 this.yyleng++;
8491 this.offset++;
8492 this.match += ch;
8493 this.matched += ch;
8494 var lines = ch.match(/(?:\r\n?|\n).*/g);
8495 if (lines) {
8496 this.yylineno++;
8497 this.yylloc.last_line++;
8498 } else {
8499 this.yylloc.last_column++;
8500 }
8501 if (this.options.ranges) {
8502 this.yylloc.range[1]++;
8503 }
8504
8505 this._input = this._input.slice(1);
8506 return ch;
8507 },
8508
8509// unshifts one char (or a string) into the input
8510unput:function (ch) {
8511 var len = ch.length;
8512 var lines = ch.split(/(?:\r\n?|\n)/g);
8513
8514 this._input = ch + this._input;
8515 this.yytext = this.yytext.substr(0, this.yytext.length - len);
8516 //this.yyleng -= len;
8517 this.offset -= len;
8518 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
8519 this.match = this.match.substr(0, this.match.length - 1);
8520 this.matched = this.matched.substr(0, this.matched.length - 1);
8521
8522 if (lines.length - 1) {
8523 this.yylineno -= lines.length - 1;
8524 }
8525 var r = this.yylloc.range;
8526
8527 this.yylloc = {
8528 first_line: this.yylloc.first_line,
8529 last_line: this.yylineno + 1,
8530 first_column: this.yylloc.first_column,
8531 last_column: lines ?
8532 (lines.length === oldLines.length ? this.yylloc.first_column : 0)
8533 + oldLines[oldLines.length - lines.length].length - lines[0].length :
8534 this.yylloc.first_column - len
8535 };
8536
8537 if (this.options.ranges) {
8538 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
8539 }
8540 this.yyleng = this.yytext.length;
8541 return this;
8542 },
8543
8544// When called from action, caches matched text and appends it on next action
8545more:function () {
8546 this._more = true;
8547 return this;
8548 },
8549
8550// 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.
8551reject:function () {
8552 if (this.options.backtrack_lexer) {
8553 this._backtrack = true;
8554 } else {
8555 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(), {
8556 text: "",
8557 token: null,
8558 line: this.yylineno
8559 });
8560
8561 }
8562 return this;
8563 },
8564
8565// retain first n characters of the match
8566less:function (n) {
8567 this.unput(this.match.slice(n));
8568 },
8569
8570// displays already matched input, i.e. for error messages
8571pastInput:function () {
8572 var past = this.matched.substr(0, this.matched.length - this.match.length);
8573 return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
8574 },
8575
8576// displays upcoming input, i.e. for error messages
8577upcomingInput:function () {
8578 var next = this.match;
8579 if (next.length < 20) {
8580 next += this._input.substr(0, 20-next.length);
8581 }
8582 return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
8583 },
8584
8585// displays the character position where the lexing error occurred, i.e. for error messages
8586showPosition:function () {
8587 var pre = this.pastInput();
8588 var c = new Array(pre.length + 1).join("-");
8589 return pre + this.upcomingInput() + "\n" + c + "^";
8590 },
8591
8592// test the lexed token: return FALSE when not a match, otherwise return token
8593test_match:function(match, indexed_rule) {
8594 var token,
8595 lines,
8596 backup;
8597
8598 if (this.options.backtrack_lexer) {
8599 // save context
8600 backup = {
8601 yylineno: this.yylineno,
8602 yylloc: {
8603 first_line: this.yylloc.first_line,
8604 last_line: this.last_line,
8605 first_column: this.yylloc.first_column,
8606 last_column: this.yylloc.last_column
8607 },
8608 yytext: this.yytext,
8609 match: this.match,
8610 matches: this.matches,
8611 matched: this.matched,
8612 yyleng: this.yyleng,
8613 offset: this.offset,
8614 _more: this._more,
8615 _input: this._input,
8616 yy: this.yy,
8617 conditionStack: this.conditionStack.slice(0),
8618 done: this.done
8619 };
8620 if (this.options.ranges) {
8621 backup.yylloc.range = this.yylloc.range.slice(0);
8622 }
8623 }
8624
8625 lines = match[0].match(/(?:\r\n?|\n).*/g);
8626 if (lines) {
8627 this.yylineno += lines.length;
8628 }
8629 this.yylloc = {
8630 first_line: this.yylloc.last_line,
8631 last_line: this.yylineno + 1,
8632 first_column: this.yylloc.last_column,
8633 last_column: lines ?
8634 lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
8635 this.yylloc.last_column + match[0].length
8636 };
8637 this.yytext += match[0];
8638 this.match += match[0];
8639 this.matches = match;
8640 this.yyleng = this.yytext.length;
8641 if (this.options.ranges) {
8642 this.yylloc.range = [this.offset, this.offset += this.yyleng];
8643 }
8644 this._more = false;
8645 this._backtrack = false;
8646 this._input = this._input.slice(match[0].length);
8647 this.matched += match[0];
8648 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
8649 if (this.done && this._input) {
8650 this.done = false;
8651 }
8652 if (token) {
8653 return token;
8654 } else if (this._backtrack) {
8655 // recover context
8656 for (var k in backup) {
8657 this[k] = backup[k];
8658 }
8659 return false; // rule action called reject() implying the next rule should be tested instead.
8660 }
8661 return false;
8662 },
8663
8664// return next match in input
8665next:function () {
8666 if (this.done) {
8667 return this.EOF;
8668 }
8669 if (!this._input) {
8670 this.done = true;
8671 }
8672
8673 var token,
8674 match,
8675 tempMatch,
8676 index;
8677 if (!this._more) {
8678 this.yytext = '';
8679 this.match = '';
8680 }
8681 var rules = this._currentRules();
8682 for (var i = 0; i < rules.length; i++) {
8683 tempMatch = this._input.match(this.rules[rules[i]]);
8684 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
8685 match = tempMatch;
8686 index = i;
8687 if (this.options.backtrack_lexer) {
8688 token = this.test_match(tempMatch, rules[i]);
8689 if (token !== false) {
8690 return token;
8691 } else if (this._backtrack) {
8692 match = false;
8693 continue; // rule action called reject() implying a rule MISmatch.
8694 } else {
8695 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
8696 return false;
8697 }
8698 } else if (!this.options.flex) {
8699 break;
8700 }
8701 }
8702 }
8703 if (match) {
8704 token = this.test_match(match, rules[index]);
8705 if (token !== false) {
8706 return token;
8707 }
8708 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
8709 return false;
8710 }
8711 if (this._input === "") {
8712 return this.EOF;
8713 } else {
8714 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
8715 text: "",
8716 token: null,
8717 line: this.yylineno
8718 });
8719 }
8720 },
8721
8722// return next match that has a token
8723lex:function lex () {
8724 var r = this.next();
8725 if (r) {
8726 return r;
8727 } else {
8728 return this.lex();
8729 }
8730 },
8731
8732// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
8733begin:function begin (condition) {
8734 this.conditionStack.push(condition);
8735 },
8736
8737// pop the previously active lexer condition state off the condition stack
8738popState:function popState () {
8739 var n = this.conditionStack.length - 1;
8740 if (n > 0) {
8741 return this.conditionStack.pop();
8742 } else {
8743 return this.conditionStack[0];
8744 }
8745 },
8746
8747// produce the lexer rule set which is active for the currently active lexer condition state
8748_currentRules:function _currentRules () {
8749 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
8750 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
8751 } else {
8752 return this.conditions["INITIAL"].rules;
8753 }
8754 },
8755
8756// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
8757topState:function topState (n) {
8758 n = this.conditionStack.length - 1 - Math.abs(n || 0);
8759 if (n >= 0) {
8760 return this.conditionStack[n];
8761 } else {
8762 return "INITIAL";
8763 }
8764 },
8765
8766// alias for begin(condition)
8767pushState:function pushState (condition) {
8768 this.begin(condition);
8769 },
8770
8771// return the number of states currently on the stack
8772stateStackSize:function stateStackSize() {
8773 return this.conditionStack.length;
8774 },
8775options: {"case-insensitive":true},
8776performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
8777 // Pre-lexer code can go here
8778
8779var YYSTATE=YY_START;
8780switch($avoiding_name_collisions) {
8781case 0:return 4 ;
8782break;
8783case 1:return 9 ;
8784break;
8785case 2:return 'space';
8786break;
8787case 3:return 10;
8788break;
8789case 4:return 6 ;
8790break;
8791case 5:return 'TXT' ;
8792break;
8793}
8794},
8795rules: [/^(?:info\b)/i,/^(?:[\s\n\r]+)/i,/^(?:[\s]+)/i,/^(?:showInfo\b)/i,/^(?:$)/i,/^(?:.)/i],
8796conditions: {"INITIAL":{"rules":[0,1,2,3,4,5],"inclusive":true}}
8797});
8798return lexer;
8799})();
8800parser.lexer = lexer;
8801function Parser () {
8802 this.yy = {};
8803}
8804Parser.prototype = parser;parser.Parser = Parser;
8805return new Parser;
8806})();
8807
8808
8809if (true) {
8810exports.parser = parser;
8811exports.Parser = parser.Parser;
8812exports.parse = function () { return parser.parse.apply(parser, arguments); };
8813exports.main = function commonjsMain (args) {
8814 if (!args[1]) {
8815 console.log('Usage: '+args[0]+' FILE');
8816 process.exit(1);
8817 }
8818 var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8");
8819 return exports.parser.parse(source);
8820};
8821if ( true && __webpack_require__.c[__webpack_require__.s] === module) {
8822 exports.main(process.argv.slice(1));
8823}
8824}
8825/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
8826
8827/***/ }),
8828
8829/***/ "./src/diagrams/pie/parser/pie.jison":
8830/*!*******************************************!*\
8831 !*** ./src/diagrams/pie/parser/pie.jison ***!
8832 \*******************************************/
8833/*! no static exports found */
8834/***/ (function(module, exports, __webpack_require__) {
8835
8836/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */
8837/*
8838 Returns a Parser object of the following structure:
8839
8840 Parser: {
8841 yy: {}
8842 }
8843
8844 Parser.prototype: {
8845 yy: {},
8846 trace: function(),
8847 symbols_: {associative list: name ==> number},
8848 terminals_: {associative list: number ==> name},
8849 productions_: [...],
8850 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
8851 table: [...],
8852 defaultActions: {...},
8853 parseError: function(str, hash),
8854 parse: function(input),
8855
8856 lexer: {
8857 EOF: 1,
8858 parseError: function(str, hash),
8859 setInput: function(input),
8860 input: function(),
8861 unput: function(str),
8862 more: function(),
8863 less: function(n),
8864 pastInput: function(),
8865 upcomingInput: function(),
8866 showPosition: function(),
8867 test_match: function(regex_match_array, rule_index),
8868 next: function(),
8869 lex: function(),
8870 begin: function(condition),
8871 popState: function(),
8872 _currentRules: function(),
8873 topState: function(),
8874 pushState: function(condition),
8875
8876 options: {
8877 ranges: boolean (optional: true ==> token location info will include a .range[] member)
8878 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
8879 backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
8880 },
8881
8882 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
8883 rules: [...],
8884 conditions: {associative list: name ==> set},
8885 }
8886 }
8887
8888
8889 token location info (@$, _$, etc.): {
8890 first_line: n,
8891 last_line: n,
8892 first_column: n,
8893 last_column: n,
8894 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
8895 }
8896
8897
8898 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
8899 text: (matched text)
8900 token: (the produced terminal token, if any)
8901 line: (yylineno)
8902 }
8903 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
8904 loc: (yylloc)
8905 expected: (string describing the set of expected tokens)
8906 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
8907 }
8908*/
8909var parser = (function(){
8910var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[6,9,10,12];
8911var parser = {trace: function trace () { },
8912yy: {},
8913symbols_: {"error":2,"start":3,"pie":4,"document":5,"EOF":6,"line":7,"statement":8,"NL":9,"STR":10,"VALUE":11,"title":12,"$accept":0,"$end":1},
8914terminals_: {2:"error",4:"pie",6:"EOF",9:"NL",10:"STR",11:"VALUE",12:"title"},
8915productions_: [0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,2],[8,1]],
8916performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
8917/* this == yyval */
8918
8919var $0 = $$.length - 1;
8920switch (yystate) {
8921case 4:
8922
8923break;
8924case 6:
8925
8926 /*console.log('str:'+$$[$0-1]+' value: '+$$[$0])*/
8927 yy.addSection($$[$0-1],yy.cleanupValue($$[$0]));
8928break;
8929case 7:
8930yy.setTitle($$[$0].substr(6));this.$=$$[$0].substr(6);
8931break;
8932}
8933},
8934table: [{3:1,4:[1,2]},{1:[3]},o($V0,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:[1,8],12:[1,9]},{1:[2,1]},o($V0,[2,3]),o($V0,[2,4]),o($V0,[2,5]),{11:[1,10]},o($V0,[2,7]),o($V0,[2,6])],
8935defaultActions: {4:[2,1]},
8936parseError: function parseError (str, hash) {
8937 if (hash.recoverable) {
8938 this.trace(str);
8939 } else {
8940 var error = new Error(str);
8941 error.hash = hash;
8942 throw error;
8943 }
8944},
8945parse: function parse(input) {
8946 var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
8947 var args = lstack.slice.call(arguments, 1);
8948 var lexer = Object.create(this.lexer);
8949 var sharedState = { yy: {} };
8950 for (var k in this.yy) {
8951 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
8952 sharedState.yy[k] = this.yy[k];
8953 }
8954 }
8955 lexer.setInput(input, sharedState.yy);
8956 sharedState.yy.lexer = lexer;
8957 sharedState.yy.parser = this;
8958 if (typeof lexer.yylloc == 'undefined') {
8959 lexer.yylloc = {};
8960 }
8961 var yyloc = lexer.yylloc;
8962 lstack.push(yyloc);
8963 var ranges = lexer.options && lexer.options.ranges;
8964 if (typeof sharedState.yy.parseError === 'function') {
8965 this.parseError = sharedState.yy.parseError;
8966 } else {
8967 this.parseError = Object.getPrototypeOf(this).parseError;
8968 }
8969 function popStack(n) {
8970 stack.length = stack.length - 2 * n;
8971 vstack.length = vstack.length - n;
8972 lstack.length = lstack.length - n;
8973 }
8974 function lex() {
8975 var token;
8976 token = tstack.pop() || lexer.lex() || EOF;
8977 if (typeof token !== 'number') {
8978 if (token instanceof Array) {
8979 tstack = token;
8980 token = tstack.pop();
8981 }
8982 token = self.symbols_[token] || token;
8983 }
8984 return token;
8985 }
8986 var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
8987 while (true) {
8988 state = stack[stack.length - 1];
8989 if (this.defaultActions[state]) {
8990 action = this.defaultActions[state];
8991 } else {
8992 if (symbol === null || typeof symbol == 'undefined') {
8993 symbol = lex();
8994 }
8995 action = table[state] && table[state][symbol];
8996 }
8997 if (typeof action === 'undefined' || !action.length || !action[0]) {
8998 var errStr = '';
8999 expected = [];
9000 for (p in table[state]) {
9001 if (this.terminals_[p] && p > TERROR) {
9002 expected.push('\'' + this.terminals_[p] + '\'');
9003 }
9004 }
9005 if (lexer.showPosition) {
9006 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
9007 } else {
9008 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
9009 }
9010 this.parseError(errStr, {
9011 text: lexer.match,
9012 token: this.terminals_[symbol] || symbol,
9013 line: lexer.yylineno,
9014 loc: yyloc,
9015 expected: expected
9016 });
9017 }
9018 if (action[0] instanceof Array && action.length > 1) {
9019 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
9020 }
9021 switch (action[0]) {
9022 case 1:
9023 stack.push(symbol);
9024 vstack.push(lexer.yytext);
9025 lstack.push(lexer.yylloc);
9026 stack.push(action[1]);
9027 symbol = null;
9028 if (!preErrorSymbol) {
9029 yyleng = lexer.yyleng;
9030 yytext = lexer.yytext;
9031 yylineno = lexer.yylineno;
9032 yyloc = lexer.yylloc;
9033 if (recovering > 0) {
9034 recovering--;
9035 }
9036 } else {
9037 symbol = preErrorSymbol;
9038 preErrorSymbol = null;
9039 }
9040 break;
9041 case 2:
9042 len = this.productions_[action[1]][1];
9043 yyval.$ = vstack[vstack.length - len];
9044 yyval._$ = {
9045 first_line: lstack[lstack.length - (len || 1)].first_line,
9046 last_line: lstack[lstack.length - 1].last_line,
9047 first_column: lstack[lstack.length - (len || 1)].first_column,
9048 last_column: lstack[lstack.length - 1].last_column
9049 };
9050 if (ranges) {
9051 yyval._$.range = [
9052 lstack[lstack.length - (len || 1)].range[0],
9053 lstack[lstack.length - 1].range[1]
9054 ];
9055 }
9056 r = this.performAction.apply(yyval, [
9057 yytext,
9058 yyleng,
9059 yylineno,
9060 sharedState.yy,
9061 action[1],
9062 vstack,
9063 lstack
9064 ].concat(args));
9065 if (typeof r !== 'undefined') {
9066 return r;
9067 }
9068 if (len) {
9069 stack = stack.slice(0, -1 * len * 2);
9070 vstack = vstack.slice(0, -1 * len);
9071 lstack = lstack.slice(0, -1 * len);
9072 }
9073 stack.push(this.productions_[action[1]][0]);
9074 vstack.push(yyval.$);
9075 lstack.push(yyval._$);
9076 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
9077 stack.push(newState);
9078 break;
9079 case 3:
9080 return true;
9081 }
9082 }
9083 return true;
9084}};
9085
9086/* generated by jison-lex 0.3.4 */
9087var lexer = (function(){
9088var lexer = ({
9089
9090EOF:1,
9091
9092parseError:function parseError(str, hash) {
9093 if (this.yy.parser) {
9094 this.yy.parser.parseError(str, hash);
9095 } else {
9096 throw new Error(str);
9097 }
9098 },
9099
9100// resets the lexer, sets new input
9101setInput:function (input, yy) {
9102 this.yy = yy || this.yy || {};
9103 this._input = input;
9104 this._more = this._backtrack = this.done = false;
9105 this.yylineno = this.yyleng = 0;
9106 this.yytext = this.matched = this.match = '';
9107 this.conditionStack = ['INITIAL'];
9108 this.yylloc = {
9109 first_line: 1,
9110 first_column: 0,
9111 last_line: 1,
9112 last_column: 0
9113 };
9114 if (this.options.ranges) {
9115 this.yylloc.range = [0,0];
9116 }
9117 this.offset = 0;
9118 return this;
9119 },
9120
9121// consumes and returns one char from the input
9122input:function () {
9123 var ch = this._input[0];
9124 this.yytext += ch;
9125 this.yyleng++;
9126 this.offset++;
9127 this.match += ch;
9128 this.matched += ch;
9129 var lines = ch.match(/(?:\r\n?|\n).*/g);
9130 if (lines) {
9131 this.yylineno++;
9132 this.yylloc.last_line++;
9133 } else {
9134 this.yylloc.last_column++;
9135 }
9136 if (this.options.ranges) {
9137 this.yylloc.range[1]++;
9138 }
9139
9140 this._input = this._input.slice(1);
9141 return ch;
9142 },
9143
9144// unshifts one char (or a string) into the input
9145unput:function (ch) {
9146 var len = ch.length;
9147 var lines = ch.split(/(?:\r\n?|\n)/g);
9148
9149 this._input = ch + this._input;
9150 this.yytext = this.yytext.substr(0, this.yytext.length - len);
9151 //this.yyleng -= len;
9152 this.offset -= len;
9153 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
9154 this.match = this.match.substr(0, this.match.length - 1);
9155 this.matched = this.matched.substr(0, this.matched.length - 1);
9156
9157 if (lines.length - 1) {
9158 this.yylineno -= lines.length - 1;
9159 }
9160 var r = this.yylloc.range;
9161
9162 this.yylloc = {
9163 first_line: this.yylloc.first_line,
9164 last_line: this.yylineno + 1,
9165 first_column: this.yylloc.first_column,
9166 last_column: lines ?
9167 (lines.length === oldLines.length ? this.yylloc.first_column : 0)
9168 + oldLines[oldLines.length - lines.length].length - lines[0].length :
9169 this.yylloc.first_column - len
9170 };
9171
9172 if (this.options.ranges) {
9173 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
9174 }
9175 this.yyleng = this.yytext.length;
9176 return this;
9177 },
9178
9179// When called from action, caches matched text and appends it on next action
9180more:function () {
9181 this._more = true;
9182 return this;
9183 },
9184
9185// 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.
9186reject:function () {
9187 if (this.options.backtrack_lexer) {
9188 this._backtrack = true;
9189 } else {
9190 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(), {
9191 text: "",
9192 token: null,
9193 line: this.yylineno
9194 });
9195
9196 }
9197 return this;
9198 },
9199
9200// retain first n characters of the match
9201less:function (n) {
9202 this.unput(this.match.slice(n));
9203 },
9204
9205// displays already matched input, i.e. for error messages
9206pastInput:function () {
9207 var past = this.matched.substr(0, this.matched.length - this.match.length);
9208 return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
9209 },
9210
9211// displays upcoming input, i.e. for error messages
9212upcomingInput:function () {
9213 var next = this.match;
9214 if (next.length < 20) {
9215 next += this._input.substr(0, 20-next.length);
9216 }
9217 return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
9218 },
9219
9220// displays the character position where the lexing error occurred, i.e. for error messages
9221showPosition:function () {
9222 var pre = this.pastInput();
9223 var c = new Array(pre.length + 1).join("-");
9224 return pre + this.upcomingInput() + "\n" + c + "^";
9225 },
9226
9227// test the lexed token: return FALSE when not a match, otherwise return token
9228test_match:function(match, indexed_rule) {
9229 var token,
9230 lines,
9231 backup;
9232
9233 if (this.options.backtrack_lexer) {
9234 // save context
9235 backup = {
9236 yylineno: this.yylineno,
9237 yylloc: {
9238 first_line: this.yylloc.first_line,
9239 last_line: this.last_line,
9240 first_column: this.yylloc.first_column,
9241 last_column: this.yylloc.last_column
9242 },
9243 yytext: this.yytext,
9244 match: this.match,
9245 matches: this.matches,
9246 matched: this.matched,
9247 yyleng: this.yyleng,
9248 offset: this.offset,
9249 _more: this._more,
9250 _input: this._input,
9251 yy: this.yy,
9252 conditionStack: this.conditionStack.slice(0),
9253 done: this.done
9254 };
9255 if (this.options.ranges) {
9256 backup.yylloc.range = this.yylloc.range.slice(0);
9257 }
9258 }
9259
9260 lines = match[0].match(/(?:\r\n?|\n).*/g);
9261 if (lines) {
9262 this.yylineno += lines.length;
9263 }
9264 this.yylloc = {
9265 first_line: this.yylloc.last_line,
9266 last_line: this.yylineno + 1,
9267 first_column: this.yylloc.last_column,
9268 last_column: lines ?
9269 lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
9270 this.yylloc.last_column + match[0].length
9271 };
9272 this.yytext += match[0];
9273 this.match += match[0];
9274 this.matches = match;
9275 this.yyleng = this.yytext.length;
9276 if (this.options.ranges) {
9277 this.yylloc.range = [this.offset, this.offset += this.yyleng];
9278 }
9279 this._more = false;
9280 this._backtrack = false;
9281 this._input = this._input.slice(match[0].length);
9282 this.matched += match[0];
9283 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
9284 if (this.done && this._input) {
9285 this.done = false;
9286 }
9287 if (token) {
9288 return token;
9289 } else if (this._backtrack) {
9290 // recover context
9291 for (var k in backup) {
9292 this[k] = backup[k];
9293 }
9294 return false; // rule action called reject() implying the next rule should be tested instead.
9295 }
9296 return false;
9297 },
9298
9299// return next match in input
9300next:function () {
9301 if (this.done) {
9302 return this.EOF;
9303 }
9304 if (!this._input) {
9305 this.done = true;
9306 }
9307
9308 var token,
9309 match,
9310 tempMatch,
9311 index;
9312 if (!this._more) {
9313 this.yytext = '';
9314 this.match = '';
9315 }
9316 var rules = this._currentRules();
9317 for (var i = 0; i < rules.length; i++) {
9318 tempMatch = this._input.match(this.rules[rules[i]]);
9319 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
9320 match = tempMatch;
9321 index = i;
9322 if (this.options.backtrack_lexer) {
9323 token = this.test_match(tempMatch, rules[i]);
9324 if (token !== false) {
9325 return token;
9326 } else if (this._backtrack) {
9327 match = false;
9328 continue; // rule action called reject() implying a rule MISmatch.
9329 } else {
9330 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
9331 return false;
9332 }
9333 } else if (!this.options.flex) {
9334 break;
9335 }
9336 }
9337 }
9338 if (match) {
9339 token = this.test_match(match, rules[index]);
9340 if (token !== false) {
9341 return token;
9342 }
9343 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
9344 return false;
9345 }
9346 if (this._input === "") {
9347 return this.EOF;
9348 } else {
9349 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
9350 text: "",
9351 token: null,
9352 line: this.yylineno
9353 });
9354 }
9355 },
9356
9357// return next match that has a token
9358lex:function lex () {
9359 var r = this.next();
9360 if (r) {
9361 return r;
9362 } else {
9363 return this.lex();
9364 }
9365 },
9366
9367// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
9368begin:function begin (condition) {
9369 this.conditionStack.push(condition);
9370 },
9371
9372// pop the previously active lexer condition state off the condition stack
9373popState:function popState () {
9374 var n = this.conditionStack.length - 1;
9375 if (n > 0) {
9376 return this.conditionStack.pop();
9377 } else {
9378 return this.conditionStack[0];
9379 }
9380 },
9381
9382// produce the lexer rule set which is active for the currently active lexer condition state
9383_currentRules:function _currentRules () {
9384 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
9385 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
9386 } else {
9387 return this.conditions["INITIAL"].rules;
9388 }
9389 },
9390
9391// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
9392topState:function topState (n) {
9393 n = this.conditionStack.length - 1 - Math.abs(n || 0);
9394 if (n >= 0) {
9395 return this.conditionStack[n];
9396 } else {
9397 return "INITIAL";
9398 }
9399 },
9400
9401// alias for begin(condition)
9402pushState:function pushState (condition) {
9403 this.begin(condition);
9404 },
9405
9406// return the number of states currently on the stack
9407stateStackSize:function stateStackSize() {
9408 return this.conditionStack.length;
9409 },
9410options: {"case-insensitive":true},
9411performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
9412 // Pre-lexer code can go here
9413
9414var YYSTATE=YY_START;
9415switch($avoiding_name_collisions) {
9416case 0:/* do nothing */
9417break;
9418case 1:/* skip whitespace */
9419break;
9420case 2:return 4 ;
9421break;
9422case 3:return 9 ;
9423break;
9424case 4:return 'space';
9425break;
9426case 5:return 12;
9427break;
9428case 6:/*console.log('begin str');*/this.begin("string");
9429break;
9430case 7:/*console.log('pop-state');*/this.popState();
9431break;
9432case 8:/*console.log('ending string')*/return "STR";
9433break;
9434case 9:return "VALUE";
9435break;
9436case 10:return 6 ;
9437break;
9438}
9439},
9440rules: [/^(?:%%[^\n]*)/i,/^(?:\s+)/i,/^(?:pie\b)/i,/^(?:[\s\n\r]+)/i,/^(?:[\s]+)/i,/^(?:title\s[^#\n;]+)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::[\s]*[\d]+(?:\.[\d]+)?)/i,/^(?:$)/i],
9441conditions: {"string":{"rules":[7,8],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,5,6,9,10],"inclusive":true}}
9442});
9443return lexer;
9444})();
9445parser.lexer = lexer;
9446function Parser () {
9447 this.yy = {};
9448}
9449Parser.prototype = parser;parser.Parser = Parser;
9450return new Parser;
9451})();
9452
9453
9454if (true) {
9455exports.parser = parser;
9456exports.Parser = parser.Parser;
9457exports.parse = function () { return parser.parse.apply(parser, arguments); };
9458exports.main = function commonjsMain (args) {
9459 if (!args[1]) {
9460 console.log('Usage: '+args[0]+' FILE');
9461 process.exit(1);
9462 }
9463 var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8");
9464 return exports.parser.parse(source);
9465};
9466if ( true && __webpack_require__.c[__webpack_require__.s] === module) {
9467 exports.main(process.argv.slice(1));
9468}
9469}
9470/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
9471
9472/***/ }),
9473
9474/***/ "./src/diagrams/pie/pieDb.js":
9475/*!***********************************!*\
9476 !*** ./src/diagrams/pie/pieDb.js ***!
9477 \***********************************/
9478/*! exports provided: default */
9479/***/ (function(module, __webpack_exports__, __webpack_require__) {
9480
9481"use strict";
9482__webpack_require__.r(__webpack_exports__);
9483/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
9484/**
9485 *
9486 */
9487
9488var sections = {};
9489var title = '';
9490
9491var addSection = function addSection(id, value) {
9492 if (typeof sections[id] === 'undefined') {
9493 sections[id] = value;
9494 _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Added new section :', id); // console.log('Added new section:', id, value)
9495 }
9496};
9497
9498var getSections = function getSections() {
9499 return sections;
9500};
9501
9502var setTitle = function setTitle(txt) {
9503 title = txt;
9504};
9505
9506var getTitle = function getTitle() {
9507 return title;
9508};
9509
9510var cleanupValue = function cleanupValue(value) {
9511 if (value.substring(0, 1) === ':') {
9512 value = value.substring(1).trim();
9513 return Number(value.trim());
9514 } else {
9515 return Number(value.trim());
9516 }
9517};
9518
9519var clear = function clear() {
9520 sections = {};
9521 title = '';
9522}; // export const parseError = (err, hash) => {
9523// global.mermaidAPI.parseError(err, hash)
9524// }
9525
9526
9527/* harmony default export */ __webpack_exports__["default"] = ({
9528 addSection: addSection,
9529 getSections: getSections,
9530 cleanupValue: cleanupValue,
9531 clear: clear,
9532 setTitle: setTitle,
9533 getTitle: getTitle // parseError
9534
9535});
9536
9537/***/ }),
9538
9539/***/ "./src/diagrams/pie/pieRenderer.js":
9540/*!*****************************************!*\
9541 !*** ./src/diagrams/pie/pieRenderer.js ***!
9542 \*****************************************/
9543/*! exports provided: setConf, draw, default */
9544/***/ (function(module, __webpack_exports__, __webpack_require__) {
9545
9546"use strict";
9547__webpack_require__.r(__webpack_exports__);
9548/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; });
9549/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; });
9550/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
9551/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
9552/* harmony import */ var _pieDb__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pieDb */ "./src/diagrams/pie/pieDb.js");
9553/* harmony import */ var _parser_pie__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./parser/pie */ "./src/diagrams/pie/parser/pie.jison");
9554/* harmony import */ var _parser_pie__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_parser_pie__WEBPACK_IMPORTED_MODULE_2__);
9555/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
9556/**
9557 * Created by AshishJ on 11-09-2019.
9558 */
9559
9560
9561
9562
9563var conf = {};
9564var setConf = function setConf(cnf) {
9565 var keys = Object.keys(cnf);
9566 keys.forEach(function (key) {
9567 conf[key] = cnf[key];
9568 });
9569};
9570/**
9571 * Draws a Pie Chart with the data given in text.
9572 * @param text
9573 * @param id
9574 */
9575
9576var w;
9577var draw = function draw(txt, id) {
9578 try {
9579 var parser = _parser_pie__WEBPACK_IMPORTED_MODULE_2___default.a.parser;
9580 parser.yy = _pieDb__WEBPACK_IMPORTED_MODULE_1__["default"];
9581 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Rendering info diagram\n' + txt); // Parse the Pie Chart definition
9582
9583 parser.yy.clear();
9584 parser.parse(txt);
9585 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Parsed info diagram');
9586 var elem = document.getElementById(id);
9587 w = elem.parentElement.offsetWidth;
9588
9589 if (typeof w === 'undefined') {
9590 w = 1200;
9591 }
9592
9593 if (typeof conf.useWidth !== 'undefined') {
9594 w = conf.useWidth;
9595 }
9596
9597 var h = 450;
9598 elem.setAttribute('height', '100%'); // Set viewBox
9599
9600 elem.setAttribute('viewBox', '0 0 ' + w + ' ' + h); // Fetch the default direction, use TD if none was found
9601
9602 var width = w; // 450
9603
9604 var height = 450;
9605 var margin = 40;
9606 var legendRectSize = 18;
9607 var legendSpacing = 4;
9608 var radius = Math.min(width, height) / 2 - margin;
9609 var svg = d3__WEBPACK_IMPORTED_MODULE_0__["select"]('#' + id).append('svg').attr('width', width).attr('height', height).append('g').attr('transform', 'translate(' + width / 2 + ',' + height / 2 + ')');
9610 var data = _pieDb__WEBPACK_IMPORTED_MODULE_1__["default"].getSections();
9611 var sum = 0;
9612 Object.keys(data).forEach(function (key) {
9613 sum += data[key];
9614 });
9615 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info(data); // set the color scale
9616
9617 var color = d3__WEBPACK_IMPORTED_MODULE_0__["scaleOrdinal"]().domain(data).range(d3__WEBPACK_IMPORTED_MODULE_0__["schemeSet2"]); // Compute the position of each group on the pie:
9618
9619 var pie = d3__WEBPACK_IMPORTED_MODULE_0__["pie"]().value(function (d) {
9620 return d.value;
9621 });
9622 var dataReady = pie(d3__WEBPACK_IMPORTED_MODULE_0__["entries"](data)); // shape helper to build arcs:
9623
9624 var arcGenerator = d3__WEBPACK_IMPORTED_MODULE_0__["arc"]().innerRadius(0).outerRadius(radius); // Build the pie chart: Basically, each part of the pie is a path that we build using the arc function.
9625
9626 svg.selectAll('mySlices').data(dataReady).enter().append('path').attr('d', arcGenerator).attr('fill', function (d) {
9627 return color(d.data.key);
9628 }).attr('stroke', 'black').style('stroke-width', '2px').style('opacity', 0.7); // Now add the Percentage. Use the centroid method to get the best coordinates
9629
9630 svg.selectAll('mySlices').data(dataReady).enter().append('text').text(function (d) {
9631 return (d.data.value / sum * 100).toFixed(0) + '%';
9632 }).attr('transform', function (d) {
9633 return 'translate(' + arcGenerator.centroid(d) + ')';
9634 }).style('text-anchor', 'middle').attr('class', 'slice').style('font-size', 17);
9635 svg.append('text').text(parser.yy.getTitle()).attr('x', 0).attr('y', -(h - 50) / 2).attr('class', 'pieTitleText'); //Add the slegend/annotations for each section
9636
9637 var legend = svg.selectAll('.legend').data(color.domain()).enter().append('g').attr('class', 'legend').attr('transform', function (d, i) {
9638 var height = legendRectSize + legendSpacing;
9639 var offset = height * color.domain().length / 2;
9640 var horz = 12 * legendRectSize;
9641 var vert = i * height - offset;
9642 return 'translate(' + horz + ',' + vert + ')';
9643 });
9644 legend.append('rect').attr('width', legendRectSize).attr('height', legendRectSize).style('fill', color).style('stroke', color);
9645 legend.append('text').attr('x', legendRectSize + legendSpacing).attr('y', legendRectSize - legendSpacing).text(function (d) {
9646 return d;
9647 });
9648 } catch (e) {
9649 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].error('Error while rendering info diagram');
9650 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].error(e.message);
9651 }
9652};
9653/* harmony default export */ __webpack_exports__["default"] = ({
9654 setConf: setConf,
9655 draw: draw
9656});
9657
9658/***/ }),
9659
9660/***/ "./src/diagrams/sequence/parser/sequenceDiagram.jison":
9661/*!************************************************************!*\
9662 !*** ./src/diagrams/sequence/parser/sequenceDiagram.jison ***!
9663 \************************************************************/
9664/*! no static exports found */
9665/***/ (function(module, exports, __webpack_require__) {
9666
9667/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */
9668/*
9669 Returns a Parser object of the following structure:
9670
9671 Parser: {
9672 yy: {}
9673 }
9674
9675 Parser.prototype: {
9676 yy: {},
9677 trace: function(),
9678 symbols_: {associative list: name ==> number},
9679 terminals_: {associative list: number ==> name},
9680 productions_: [...],
9681 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
9682 table: [...],
9683 defaultActions: {...},
9684 parseError: function(str, hash),
9685 parse: function(input),
9686
9687 lexer: {
9688 EOF: 1,
9689 parseError: function(str, hash),
9690 setInput: function(input),
9691 input: function(),
9692 unput: function(str),
9693 more: function(),
9694 less: function(n),
9695 pastInput: function(),
9696 upcomingInput: function(),
9697 showPosition: function(),
9698 test_match: function(regex_match_array, rule_index),
9699 next: function(),
9700 lex: function(),
9701 begin: function(condition),
9702 popState: function(),
9703 _currentRules: function(),
9704 topState: function(),
9705 pushState: function(condition),
9706
9707 options: {
9708 ranges: boolean (optional: true ==> token location info will include a .range[] member)
9709 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
9710 backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
9711 },
9712
9713 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
9714 rules: [...],
9715 conditions: {associative list: name ==> set},
9716 }
9717 }
9718
9719
9720 token location info (@$, _$, etc.): {
9721 first_line: n,
9722 last_line: n,
9723 first_column: n,
9724 last_column: n,
9725 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
9726 }
9727
9728
9729 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
9730 text: (matched text)
9731 token: (the produced terminal token, if any)
9732 line: (yylineno)
9733 }
9734 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
9735 loc: (yylloc)
9736 expected: (string describing the set of expected tokens)
9737 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
9738 }
9739*/
9740var parser = (function(){
9741var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,3],$V2=[1,4],$V3=[2,4],$V4=[1,9],$V5=[1,11],$V6=[1,12],$V7=[1,14],$V8=[1,15],$V9=[1,17],$Va=[1,18],$Vb=[1,19],$Vc=[1,20],$Vd=[1,21],$Ve=[1,22],$Vf=[1,24],$Vg=[1,25],$Vh=[1,4,5,10,15,16,18,20,21,22,23,24,26,28,29,30,41],$Vi=[1,33],$Vj=[4,5,10,15,16,18,20,21,22,23,24,26,30,41],$Vk=[4,5,10,15,16,18,20,21,22,23,24,26,29,30,41],$Vl=[4,5,10,15,16,18,20,21,22,23,24,26,28,30,41],$Vm=[39,40,41];
9742var parser = {trace: function trace () { },
9743yy: {},
9744symbols_: {"error":2,"start":3,"SPACE":4,"NL":5,"SD":6,"document":7,"line":8,"statement":9,"participant":10,"actor":11,"AS":12,"restOfLine":13,"signal":14,"activate":15,"deactivate":16,"note_statement":17,"title":18,"text2":19,"loop":20,"end":21,"rect":22,"opt":23,"alt":24,"else_sections":25,"par":26,"par_sections":27,"and":28,"else":29,"note":30,"placement":31,"over":32,"actor_pair":33,"spaceList":34,",":35,"left_of":36,"right_of":37,"signaltype":38,"+":39,"-":40,"ACTOR":41,"SOLID_OPEN_ARROW":42,"DOTTED_OPEN_ARROW":43,"SOLID_ARROW":44,"DOTTED_ARROW":45,"SOLID_CROSS":46,"DOTTED_CROSS":47,"TXT":48,"$accept":0,"$end":1},
9745terminals_: {2:"error",4:"SPACE",5:"NL",6:"SD",10:"participant",12:"AS",13:"restOfLine",15:"activate",16:"deactivate",18:"title",20:"loop",21:"end",22:"rect",23:"opt",24:"alt",26:"par",28:"and",29:"else",30:"note",32:"over",35:",",36:"left_of",37:"right_of",39:"+",40:"-",41:"ACTOR",42:"SOLID_OPEN_ARROW",43:"DOTTED_OPEN_ARROW",44:"SOLID_ARROW",45:"DOTTED_ARROW",46:"SOLID_CROSS",47:"DOTTED_CROSS",48:"TXT"},
9746productions_: [0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,5],[9,3],[9,2],[9,3],[9,3],[9,2],[9,3],[9,4],[9,4],[9,4],[9,4],[9,4],[27,1],[27,4],[25,1],[25,4],[17,4],[17,4],[34,2],[34,1],[33,3],[33,1],[31,1],[31,1],[14,5],[14,5],[14,4],[11,1],[38,1],[38,1],[38,1],[38,1],[38,1],[38,1],[19,1]],
9747performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
9748/* this == yyval */
9749
9750var $0 = $$.length - 1;
9751switch (yystate) {
9752case 3:
9753 yy.apply($$[$0]);return $$[$0];
9754break;
9755case 4:
9756 this.$ = []
9757break;
9758case 5:
9759$$[$0-1].push($$[$0]);this.$ = $$[$0-1]
9760break;
9761case 6: case 7:
9762 this.$ = $$[$0]
9763break;
9764case 8:
9765 this.$=[];
9766break;
9767case 9:
9768$$[$0-3].description=$$[$0-1]; this.$=$$[$0-3];
9769break;
9770case 10:
9771this.$=$$[$0-1];
9772break;
9773case 12:
9774this.$={type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0-1]};
9775break;
9776case 13:
9777this.$={type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0-1]};
9778break;
9779case 15:
9780this.$=[{type:'setTitle', text:$$[$0-1]}]
9781break;
9782case 16:
9783
9784 $$[$0-1].unshift({type: 'loopStart', loopText:$$[$0-2], signalType: yy.LINETYPE.LOOP_START});
9785 $$[$0-1].push({type: 'loopEnd', loopText:$$[$0-2], signalType: yy.LINETYPE.LOOP_END});
9786 this.$=$$[$0-1];
9787break;
9788case 17:
9789
9790 $$[$0-1].unshift({type: 'rectStart', color:$$[$0-2], signalType: yy.LINETYPE.RECT_START });
9791 $$[$0-1].push({type: 'rectEnd', color:$$[$0-2], signalType: yy.LINETYPE.RECT_END });
9792 this.$=$$[$0-1];
9793break;
9794case 18:
9795
9796 $$[$0-1].unshift({type: 'optStart', optText:$$[$0-2], signalType: yy.LINETYPE.OPT_START});
9797 $$[$0-1].push({type: 'optEnd', optText:$$[$0-2], signalType: yy.LINETYPE.OPT_END});
9798 this.$=$$[$0-1];
9799break;
9800case 19:
9801
9802 // Alt start
9803 $$[$0-1].unshift({type: 'altStart', altText:$$[$0-2], signalType: yy.LINETYPE.ALT_START});
9804 // Content in alt is already in $$[$0-1]
9805 // End
9806 $$[$0-1].push({type: 'altEnd', signalType: yy.LINETYPE.ALT_END});
9807 this.$=$$[$0-1];
9808break;
9809case 20:
9810
9811 // Parallel start
9812 $$[$0-1].unshift({type: 'parStart', parText:$$[$0-2], signalType: yy.LINETYPE.PAR_START});
9813 // Content in par is already in $$[$0-1]
9814 // End
9815 $$[$0-1].push({type: 'parEnd', signalType: yy.LINETYPE.PAR_END});
9816 this.$=$$[$0-1];
9817break;
9818case 22:
9819 this.$ = $$[$0-3].concat([{type: 'and', parText:$$[$0-1], signalType: yy.LINETYPE.PAR_AND}, $$[$0]]);
9820break;
9821case 24:
9822 this.$ = $$[$0-3].concat([{type: 'else', altText:$$[$0-1], signalType: yy.LINETYPE.ALT_ELSE}, $$[$0]]);
9823break;
9824case 25:
9825
9826 this.$ = [$$[$0-1], {type:'addNote', placement:$$[$0-2], actor:$$[$0-1].actor, text:$$[$0]}];
9827break;
9828case 26:
9829
9830 // Coerce actor_pair into a [to, from, ...] array
9831 $$[$0-2] = [].concat($$[$0-1], $$[$0-1]).slice(0, 2);
9832 $$[$0-2][0] = $$[$0-2][0].actor;
9833 $$[$0-2][1] = $$[$0-2][1].actor;
9834 this.$ = [$$[$0-1], {type:'addNote', placement:yy.PLACEMENT.OVER, actor:$$[$0-2].slice(0, 2), text:$$[$0]}];
9835break;
9836case 29:
9837 this.$ = [$$[$0-2], $$[$0]];
9838break;
9839case 30:
9840 this.$ = $$[$0];
9841break;
9842case 31:
9843 this.$ = yy.PLACEMENT.LEFTOF;
9844break;
9845case 32:
9846 this.$ = yy.PLACEMENT.RIGHTOF;
9847break;
9848case 33:
9849 this.$ = [$$[$0-4],$$[$0-1],{type: 'addMessage', from:$$[$0-4].actor, to:$$[$0-1].actor, signalType:$$[$0-3], msg:$$[$0]},
9850 {type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0-1]}
9851 ]
9852break;
9853case 34:
9854 this.$ = [$$[$0-4],$$[$0-1],{type: 'addMessage', from:$$[$0-4].actor, to:$$[$0-1].actor, signalType:$$[$0-3], msg:$$[$0]},
9855 {type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0-4]}
9856 ]
9857break;
9858case 35:
9859 this.$ = [$$[$0-3],$$[$0-1],{type: 'addMessage', from:$$[$0-3].actor, to:$$[$0-1].actor, signalType:$$[$0-2], msg:$$[$0]}]
9860break;
9861case 36:
9862this.$={type: 'addActor', actor:$$[$0]}
9863break;
9864case 37:
9865 this.$ = yy.LINETYPE.SOLID_OPEN;
9866break;
9867case 38:
9868 this.$ = yy.LINETYPE.DOTTED_OPEN;
9869break;
9870case 39:
9871 this.$ = yy.LINETYPE.SOLID;
9872break;
9873case 40:
9874 this.$ = yy.LINETYPE.DOTTED;
9875break;
9876case 41:
9877 this.$ = yy.LINETYPE.SOLID_CROSS;
9878break;
9879case 42:
9880 this.$ = yy.LINETYPE.DOTTED_CROSS;
9881break;
9882case 43:
9883this.$ = $$[$0].substring(1).trim().replace(/\\n/gm, "\n");
9884break;
9885}
9886},
9887table: [{3:1,4:$V0,5:$V1,6:$V2},{1:[3]},{3:5,4:$V0,5:$V1,6:$V2},{3:6,4:$V0,5:$V1,6:$V2},o([1,4,5,10,15,16,18,20,22,23,24,26,30,41],$V3,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:$V4,5:$V5,8:8,9:10,10:$V6,11:23,14:13,15:$V7,16:$V8,17:16,18:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,26:$Ve,30:$Vf,41:$Vg},o($Vh,[2,5]),{9:26,10:$V6,11:23,14:13,15:$V7,16:$V8,17:16,18:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,26:$Ve,30:$Vf,41:$Vg},o($Vh,[2,7]),o($Vh,[2,8]),{11:27,41:$Vg},{5:[1,28]},{11:29,41:$Vg},{11:30,41:$Vg},{5:[1,31]},{19:32,48:$Vi},{13:[1,34]},{13:[1,35]},{13:[1,36]},{13:[1,37]},{13:[1,38]},{38:39,42:[1,40],43:[1,41],44:[1,42],45:[1,43],46:[1,44],47:[1,45]},{31:46,32:[1,47],36:[1,48],37:[1,49]},o([5,12,35,42,43,44,45,46,47,48],[2,36]),o($Vh,[2,6]),{5:[1,51],12:[1,50]},o($Vh,[2,11]),{5:[1,52]},{5:[1,53]},o($Vh,[2,14]),{5:[1,54]},{5:[2,43]},o($Vj,$V3,{7:55}),o($Vj,$V3,{7:56}),o($Vj,$V3,{7:57}),o($Vk,$V3,{25:58,7:59}),o($Vl,$V3,{27:60,7:61}),{11:64,39:[1,62],40:[1,63],41:$Vg},o($Vm,[2,37]),o($Vm,[2,38]),o($Vm,[2,39]),o($Vm,[2,40]),o($Vm,[2,41]),o($Vm,[2,42]),{11:65,41:$Vg},{11:67,33:66,41:$Vg},{41:[2,31]},{41:[2,32]},{13:[1,68]},o($Vh,[2,10]),o($Vh,[2,12]),o($Vh,[2,13]),o($Vh,[2,15]),{4:$V4,5:$V5,8:8,9:10,10:$V6,11:23,14:13,15:$V7,16:$V8,17:16,18:$V9,20:$Va,21:[1,69],22:$Vb,23:$Vc,24:$Vd,26:$Ve,30:$Vf,41:$Vg},{4:$V4,5:$V5,8:8,9:10,10:$V6,11:23,14:13,15:$V7,16:$V8,17:16,18:$V9,20:$Va,21:[1,70],22:$Vb,23:$Vc,24:$Vd,26:$Ve,30:$Vf,41:$Vg},{4:$V4,5:$V5,8:8,9:10,10:$V6,11:23,14:13,15:$V7,16:$V8,17:16,18:$V9,20:$Va,21:[1,71],22:$Vb,23:$Vc,24:$Vd,26:$Ve,30:$Vf,41:$Vg},{21:[1,72]},{4:$V4,5:$V5,8:8,9:10,10:$V6,11:23,14:13,15:$V7,16:$V8,17:16,18:$V9,20:$Va,21:[2,23],22:$Vb,23:$Vc,24:$Vd,26:$Ve,29:[1,73],30:$Vf,41:$Vg},{21:[1,74]},{4:$V4,5:$V5,8:8,9:10,10:$V6,11:23,14:13,15:$V7,16:$V8,17:16,18:$V9,20:$Va,21:[2,21],22:$Vb,23:$Vc,24:$Vd,26:$Ve,28:[1,75],30:$Vf,41:$Vg},{11:76,41:$Vg},{11:77,41:$Vg},{19:78,48:$Vi},{19:79,48:$Vi},{19:80,48:$Vi},{35:[1,81],48:[2,30]},{5:[1,82]},o($Vh,[2,16]),o($Vh,[2,17]),o($Vh,[2,18]),o($Vh,[2,19]),{13:[1,83]},o($Vh,[2,20]),{13:[1,84]},{19:85,48:$Vi},{19:86,48:$Vi},{5:[2,35]},{5:[2,25]},{5:[2,26]},{11:87,41:$Vg},o($Vh,[2,9]),o($Vk,$V3,{7:59,25:88}),o($Vl,$V3,{7:61,27:89}),{5:[2,33]},{5:[2,34]},{48:[2,29]},{21:[2,24]},{21:[2,22]}],
9888defaultActions: {5:[2,1],6:[2,2],33:[2,43],48:[2,31],49:[2,32],78:[2,35],79:[2,25],80:[2,26],85:[2,33],86:[2,34],87:[2,29],88:[2,24],89:[2,22]},
9889parseError: function parseError (str, hash) {
9890 if (hash.recoverable) {
9891 this.trace(str);
9892 } else {
9893 var error = new Error(str);
9894 error.hash = hash;
9895 throw error;
9896 }
9897},
9898parse: function parse(input) {
9899 var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
9900 var args = lstack.slice.call(arguments, 1);
9901 var lexer = Object.create(this.lexer);
9902 var sharedState = { yy: {} };
9903 for (var k in this.yy) {
9904 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
9905 sharedState.yy[k] = this.yy[k];
9906 }
9907 }
9908 lexer.setInput(input, sharedState.yy);
9909 sharedState.yy.lexer = lexer;
9910 sharedState.yy.parser = this;
9911 if (typeof lexer.yylloc == 'undefined') {
9912 lexer.yylloc = {};
9913 }
9914 var yyloc = lexer.yylloc;
9915 lstack.push(yyloc);
9916 var ranges = lexer.options && lexer.options.ranges;
9917 if (typeof sharedState.yy.parseError === 'function') {
9918 this.parseError = sharedState.yy.parseError;
9919 } else {
9920 this.parseError = Object.getPrototypeOf(this).parseError;
9921 }
9922 function popStack(n) {
9923 stack.length = stack.length - 2 * n;
9924 vstack.length = vstack.length - n;
9925 lstack.length = lstack.length - n;
9926 }
9927 function lex() {
9928 var token;
9929 token = tstack.pop() || lexer.lex() || EOF;
9930 if (typeof token !== 'number') {
9931 if (token instanceof Array) {
9932 tstack = token;
9933 token = tstack.pop();
9934 }
9935 token = self.symbols_[token] || token;
9936 }
9937 return token;
9938 }
9939 var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
9940 while (true) {
9941 state = stack[stack.length - 1];
9942 if (this.defaultActions[state]) {
9943 action = this.defaultActions[state];
9944 } else {
9945 if (symbol === null || typeof symbol == 'undefined') {
9946 symbol = lex();
9947 }
9948 action = table[state] && table[state][symbol];
9949 }
9950 if (typeof action === 'undefined' || !action.length || !action[0]) {
9951 var errStr = '';
9952 expected = [];
9953 for (p in table[state]) {
9954 if (this.terminals_[p] && p > TERROR) {
9955 expected.push('\'' + this.terminals_[p] + '\'');
9956 }
9957 }
9958 if (lexer.showPosition) {
9959 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
9960 } else {
9961 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
9962 }
9963 this.parseError(errStr, {
9964 text: lexer.match,
9965 token: this.terminals_[symbol] || symbol,
9966 line: lexer.yylineno,
9967 loc: yyloc,
9968 expected: expected
9969 });
9970 }
9971 if (action[0] instanceof Array && action.length > 1) {
9972 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
9973 }
9974 switch (action[0]) {
9975 case 1:
9976 stack.push(symbol);
9977 vstack.push(lexer.yytext);
9978 lstack.push(lexer.yylloc);
9979 stack.push(action[1]);
9980 symbol = null;
9981 if (!preErrorSymbol) {
9982 yyleng = lexer.yyleng;
9983 yytext = lexer.yytext;
9984 yylineno = lexer.yylineno;
9985 yyloc = lexer.yylloc;
9986 if (recovering > 0) {
9987 recovering--;
9988 }
9989 } else {
9990 symbol = preErrorSymbol;
9991 preErrorSymbol = null;
9992 }
9993 break;
9994 case 2:
9995 len = this.productions_[action[1]][1];
9996 yyval.$ = vstack[vstack.length - len];
9997 yyval._$ = {
9998 first_line: lstack[lstack.length - (len || 1)].first_line,
9999 last_line: lstack[lstack.length - 1].last_line,
10000 first_column: lstack[lstack.length - (len || 1)].first_column,
10001 last_column: lstack[lstack.length - 1].last_column
10002 };
10003 if (ranges) {
10004 yyval._$.range = [
10005 lstack[lstack.length - (len || 1)].range[0],
10006 lstack[lstack.length - 1].range[1]
10007 ];
10008 }
10009 r = this.performAction.apply(yyval, [
10010 yytext,
10011 yyleng,
10012 yylineno,
10013 sharedState.yy,
10014 action[1],
10015 vstack,
10016 lstack
10017 ].concat(args));
10018 if (typeof r !== 'undefined') {
10019 return r;
10020 }
10021 if (len) {
10022 stack = stack.slice(0, -1 * len * 2);
10023 vstack = vstack.slice(0, -1 * len);
10024 lstack = lstack.slice(0, -1 * len);
10025 }
10026 stack.push(this.productions_[action[1]][0]);
10027 vstack.push(yyval.$);
10028 lstack.push(yyval._$);
10029 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
10030 stack.push(newState);
10031 break;
10032 case 3:
10033 return true;
10034 }
10035 }
10036 return true;
10037}};
10038
10039/* generated by jison-lex 0.3.4 */
10040var lexer = (function(){
10041var lexer = ({
10042
10043EOF:1,
10044
10045parseError:function parseError(str, hash) {
10046 if (this.yy.parser) {
10047 this.yy.parser.parseError(str, hash);
10048 } else {
10049 throw new Error(str);
10050 }
10051 },
10052
10053// resets the lexer, sets new input
10054setInput:function (input, yy) {
10055 this.yy = yy || this.yy || {};
10056 this._input = input;
10057 this._more = this._backtrack = this.done = false;
10058 this.yylineno = this.yyleng = 0;
10059 this.yytext = this.matched = this.match = '';
10060 this.conditionStack = ['INITIAL'];
10061 this.yylloc = {
10062 first_line: 1,
10063 first_column: 0,
10064 last_line: 1,
10065 last_column: 0
10066 };
10067 if (this.options.ranges) {
10068 this.yylloc.range = [0,0];
10069 }
10070 this.offset = 0;
10071 return this;
10072 },
10073
10074// consumes and returns one char from the input
10075input:function () {
10076 var ch = this._input[0];
10077 this.yytext += ch;
10078 this.yyleng++;
10079 this.offset++;
10080 this.match += ch;
10081 this.matched += ch;
10082 var lines = ch.match(/(?:\r\n?|\n).*/g);
10083 if (lines) {
10084 this.yylineno++;
10085 this.yylloc.last_line++;
10086 } else {
10087 this.yylloc.last_column++;
10088 }
10089 if (this.options.ranges) {
10090 this.yylloc.range[1]++;
10091 }
10092
10093 this._input = this._input.slice(1);
10094 return ch;
10095 },
10096
10097// unshifts one char (or a string) into the input
10098unput:function (ch) {
10099 var len = ch.length;
10100 var lines = ch.split(/(?:\r\n?|\n)/g);
10101
10102 this._input = ch + this._input;
10103 this.yytext = this.yytext.substr(0, this.yytext.length - len);
10104 //this.yyleng -= len;
10105 this.offset -= len;
10106 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
10107 this.match = this.match.substr(0, this.match.length - 1);
10108 this.matched = this.matched.substr(0, this.matched.length - 1);
10109
10110 if (lines.length - 1) {
10111 this.yylineno -= lines.length - 1;
10112 }
10113 var r = this.yylloc.range;
10114
10115 this.yylloc = {
10116 first_line: this.yylloc.first_line,
10117 last_line: this.yylineno + 1,
10118 first_column: this.yylloc.first_column,
10119 last_column: lines ?
10120 (lines.length === oldLines.length ? this.yylloc.first_column : 0)
10121 + oldLines[oldLines.length - lines.length].length - lines[0].length :
10122 this.yylloc.first_column - len
10123 };
10124
10125 if (this.options.ranges) {
10126 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
10127 }
10128 this.yyleng = this.yytext.length;
10129 return this;
10130 },
10131
10132// When called from action, caches matched text and appends it on next action
10133more:function () {
10134 this._more = true;
10135 return this;
10136 },
10137
10138// 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.
10139reject:function () {
10140 if (this.options.backtrack_lexer) {
10141 this._backtrack = true;
10142 } else {
10143 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(), {
10144 text: "",
10145 token: null,
10146 line: this.yylineno
10147 });
10148
10149 }
10150 return this;
10151 },
10152
10153// retain first n characters of the match
10154less:function (n) {
10155 this.unput(this.match.slice(n));
10156 },
10157
10158// displays already matched input, i.e. for error messages
10159pastInput:function () {
10160 var past = this.matched.substr(0, this.matched.length - this.match.length);
10161 return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
10162 },
10163
10164// displays upcoming input, i.e. for error messages
10165upcomingInput:function () {
10166 var next = this.match;
10167 if (next.length < 20) {
10168 next += this._input.substr(0, 20-next.length);
10169 }
10170 return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
10171 },
10172
10173// displays the character position where the lexing error occurred, i.e. for error messages
10174showPosition:function () {
10175 var pre = this.pastInput();
10176 var c = new Array(pre.length + 1).join("-");
10177 return pre + this.upcomingInput() + "\n" + c + "^";
10178 },
10179
10180// test the lexed token: return FALSE when not a match, otherwise return token
10181test_match:function(match, indexed_rule) {
10182 var token,
10183 lines,
10184 backup;
10185
10186 if (this.options.backtrack_lexer) {
10187 // save context
10188 backup = {
10189 yylineno: this.yylineno,
10190 yylloc: {
10191 first_line: this.yylloc.first_line,
10192 last_line: this.last_line,
10193 first_column: this.yylloc.first_column,
10194 last_column: this.yylloc.last_column
10195 },
10196 yytext: this.yytext,
10197 match: this.match,
10198 matches: this.matches,
10199 matched: this.matched,
10200 yyleng: this.yyleng,
10201 offset: this.offset,
10202 _more: this._more,
10203 _input: this._input,
10204 yy: this.yy,
10205 conditionStack: this.conditionStack.slice(0),
10206 done: this.done
10207 };
10208 if (this.options.ranges) {
10209 backup.yylloc.range = this.yylloc.range.slice(0);
10210 }
10211 }
10212
10213 lines = match[0].match(/(?:\r\n?|\n).*/g);
10214 if (lines) {
10215 this.yylineno += lines.length;
10216 }
10217 this.yylloc = {
10218 first_line: this.yylloc.last_line,
10219 last_line: this.yylineno + 1,
10220 first_column: this.yylloc.last_column,
10221 last_column: lines ?
10222 lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
10223 this.yylloc.last_column + match[0].length
10224 };
10225 this.yytext += match[0];
10226 this.match += match[0];
10227 this.matches = match;
10228 this.yyleng = this.yytext.length;
10229 if (this.options.ranges) {
10230 this.yylloc.range = [this.offset, this.offset += this.yyleng];
10231 }
10232 this._more = false;
10233 this._backtrack = false;
10234 this._input = this._input.slice(match[0].length);
10235 this.matched += match[0];
10236 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
10237 if (this.done && this._input) {
10238 this.done = false;
10239 }
10240 if (token) {
10241 return token;
10242 } else if (this._backtrack) {
10243 // recover context
10244 for (var k in backup) {
10245 this[k] = backup[k];
10246 }
10247 return false; // rule action called reject() implying the next rule should be tested instead.
10248 }
10249 return false;
10250 },
10251
10252// return next match in input
10253next:function () {
10254 if (this.done) {
10255 return this.EOF;
10256 }
10257 if (!this._input) {
10258 this.done = true;
10259 }
10260
10261 var token,
10262 match,
10263 tempMatch,
10264 index;
10265 if (!this._more) {
10266 this.yytext = '';
10267 this.match = '';
10268 }
10269 var rules = this._currentRules();
10270 for (var i = 0; i < rules.length; i++) {
10271 tempMatch = this._input.match(this.rules[rules[i]]);
10272 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
10273 match = tempMatch;
10274 index = i;
10275 if (this.options.backtrack_lexer) {
10276 token = this.test_match(tempMatch, rules[i]);
10277 if (token !== false) {
10278 return token;
10279 } else if (this._backtrack) {
10280 match = false;
10281 continue; // rule action called reject() implying a rule MISmatch.
10282 } else {
10283 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
10284 return false;
10285 }
10286 } else if (!this.options.flex) {
10287 break;
10288 }
10289 }
10290 }
10291 if (match) {
10292 token = this.test_match(match, rules[index]);
10293 if (token !== false) {
10294 return token;
10295 }
10296 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
10297 return false;
10298 }
10299 if (this._input === "") {
10300 return this.EOF;
10301 } else {
10302 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
10303 text: "",
10304 token: null,
10305 line: this.yylineno
10306 });
10307 }
10308 },
10309
10310// return next match that has a token
10311lex:function lex () {
10312 var r = this.next();
10313 if (r) {
10314 return r;
10315 } else {
10316 return this.lex();
10317 }
10318 },
10319
10320// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
10321begin:function begin (condition) {
10322 this.conditionStack.push(condition);
10323 },
10324
10325// pop the previously active lexer condition state off the condition stack
10326popState:function popState () {
10327 var n = this.conditionStack.length - 1;
10328 if (n > 0) {
10329 return this.conditionStack.pop();
10330 } else {
10331 return this.conditionStack[0];
10332 }
10333 },
10334
10335// produce the lexer rule set which is active for the currently active lexer condition state
10336_currentRules:function _currentRules () {
10337 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
10338 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
10339 } else {
10340 return this.conditions["INITIAL"].rules;
10341 }
10342 },
10343
10344// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
10345topState:function topState (n) {
10346 n = this.conditionStack.length - 1 - Math.abs(n || 0);
10347 if (n >= 0) {
10348 return this.conditionStack[n];
10349 } else {
10350 return "INITIAL";
10351 }
10352 },
10353
10354// alias for begin(condition)
10355pushState:function pushState (condition) {
10356 this.begin(condition);
10357 },
10358
10359// return the number of states currently on the stack
10360stateStackSize:function stateStackSize() {
10361 return this.conditionStack.length;
10362 },
10363options: {"case-insensitive":true},
10364performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
10365var YYSTATE=YY_START;
10366switch($avoiding_name_collisions) {
10367case 0:return 5;
10368break;
10369case 1:/* skip all whitespace */
10370break;
10371case 2:/* skip same-line whitespace */
10372break;
10373case 3:/* skip comments */
10374break;
10375case 4:/* skip comments */
10376break;
10377case 5: this.begin('ID'); return 10;
10378break;
10379case 6: yy_.yytext = yy_.yytext.trim(); this.begin('ALIAS'); return 41;
10380break;
10381case 7: this.popState(); this.popState(); this.begin('LINE'); return 12;
10382break;
10383case 8: this.popState(); this.popState(); return 5;
10384break;
10385case 9: this.begin('LINE'); return 20;
10386break;
10387case 10: this.begin('LINE'); return 22;
10388break;
10389case 11: this.begin('LINE'); return 23;
10390break;
10391case 12: this.begin('LINE'); return 24;
10392break;
10393case 13: this.begin('LINE'); return 29;
10394break;
10395case 14: this.begin('LINE'); return 26;
10396break;
10397case 15: this.begin('LINE'); return 28;
10398break;
10399case 16: this.popState(); return 13;
10400break;
10401case 17:return 21;
10402break;
10403case 18:return 36;
10404break;
10405case 19:return 37;
10406break;
10407case 20:return 32;
10408break;
10409case 21:return 30;
10410break;
10411case 22: this.begin('ID'); return 15;
10412break;
10413case 23: this.begin('ID'); return 16;
10414break;
10415case 24:return 18;
10416break;
10417case 25:return 6;
10418break;
10419case 26:return 35;
10420break;
10421case 27:return 5;
10422break;
10423case 28: yy_.yytext = yy_.yytext.trim(); return 41;
10424break;
10425case 29:return 44;
10426break;
10427case 30:return 45;
10428break;
10429case 31:return 42;
10430break;
10431case 32:return 43;
10432break;
10433case 33:return 46;
10434break;
10435case 34:return 47;
10436break;
10437case 35:return 48;
10438break;
10439case 36:return 39;
10440break;
10441case 37:return 40;
10442break;
10443case 38:return 5;
10444break;
10445case 39:return 'INVALID';
10446break;
10447}
10448},
10449rules: [/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:participant\b)/i,/^(?:[^\->:\n,;]+?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:and\b)/i,/^(?:[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\b)/i,/^(?:sequenceDiagram\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\->:\n,;]+)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?::[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],
10450conditions: {"LINE":{"rules":[2,3,16],"inclusive":false},"ALIAS":{"rules":[2,3,7,8],"inclusive":false},"ID":{"rules":[2,3,6],"inclusive":false},"INITIAL":{"rules":[0,1,3,4,5,9,10,11,12,13,14,15,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39],"inclusive":true}}
10451});
10452return lexer;
10453})();
10454parser.lexer = lexer;
10455function Parser () {
10456 this.yy = {};
10457}
10458Parser.prototype = parser;parser.Parser = Parser;
10459return new Parser;
10460})();
10461
10462
10463if (true) {
10464exports.parser = parser;
10465exports.Parser = parser.Parser;
10466exports.parse = function () { return parser.parse.apply(parser, arguments); };
10467exports.main = function commonjsMain (args) {
10468 if (!args[1]) {
10469 console.log('Usage: '+args[0]+' FILE');
10470 process.exit(1);
10471 }
10472 var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8");
10473 return exports.parser.parse(source);
10474};
10475if ( true && __webpack_require__.c[__webpack_require__.s] === module) {
10476 exports.main(process.argv.slice(1));
10477}
10478}
10479/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
10480
10481/***/ }),
10482
10483/***/ "./src/diagrams/sequence/sequenceDb.js":
10484/*!*********************************************!*\
10485 !*** ./src/diagrams/sequence/sequenceDb.js ***!
10486 \*********************************************/
10487/*! exports provided: addActor, addMessage, addSignal, getMessages, getActors, getActor, getActorKeys, getTitle, clear, LINETYPE, ARROWTYPE, PLACEMENT, addNote, setTitle, apply, default */
10488/***/ (function(module, __webpack_exports__, __webpack_require__) {
10489
10490"use strict";
10491__webpack_require__.r(__webpack_exports__);
10492/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addActor", function() { return addActor; });
10493/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addMessage", function() { return addMessage; });
10494/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addSignal", function() { return addSignal; });
10495/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMessages", function() { return getMessages; });
10496/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getActors", function() { return getActors; });
10497/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getActor", function() { return getActor; });
10498/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getActorKeys", function() { return getActorKeys; });
10499/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTitle", function() { return getTitle; });
10500/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clear", function() { return clear; });
10501/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LINETYPE", function() { return LINETYPE; });
10502/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARROWTYPE", function() { return ARROWTYPE; });
10503/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLACEMENT", function() { return PLACEMENT; });
10504/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addNote", function() { return addNote; });
10505/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTitle", function() { return setTitle; });
10506/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "apply", function() { return apply; });
10507/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
10508
10509var actors = {};
10510var messages = [];
10511var notes = [];
10512var title = '';
10513var addActor = function addActor(id, name, description) {
10514 // Don't allow description nulling
10515 var old = actors[id];
10516 if (old && name === old.name && description == null) return; // Don't allow null descriptions, either
10517
10518 if (description == null) description = name;
10519 actors[id] = {
10520 name: name,
10521 description: description
10522 };
10523};
10524var addMessage = function addMessage(idFrom, idTo, message, answer) {
10525 messages.push({
10526 from: idFrom,
10527 to: idTo,
10528 message: message,
10529 answer: answer
10530 });
10531};
10532var addSignal = function addSignal(idFrom, idTo, message, messageType) {
10533 _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Adding message from=' + idFrom + ' to=' + idTo + ' message=' + message + ' type=' + messageType);
10534 messages.push({
10535 from: idFrom,
10536 to: idTo,
10537 message: message,
10538 type: messageType
10539 });
10540};
10541var getMessages = function getMessages() {
10542 return messages;
10543};
10544var getActors = function getActors() {
10545 return actors;
10546};
10547var getActor = function getActor(id) {
10548 return actors[id];
10549};
10550var getActorKeys = function getActorKeys() {
10551 return Object.keys(actors);
10552};
10553var getTitle = function getTitle() {
10554 return title;
10555};
10556var clear = function clear() {
10557 actors = {};
10558 messages = [];
10559};
10560var LINETYPE = {
10561 SOLID: 0,
10562 DOTTED: 1,
10563 NOTE: 2,
10564 SOLID_CROSS: 3,
10565 DOTTED_CROSS: 4,
10566 SOLID_OPEN: 5,
10567 DOTTED_OPEN: 6,
10568 LOOP_START: 10,
10569 LOOP_END: 11,
10570 ALT_START: 12,
10571 ALT_ELSE: 13,
10572 ALT_END: 14,
10573 OPT_START: 15,
10574 OPT_END: 16,
10575 ACTIVE_START: 17,
10576 ACTIVE_END: 18,
10577 PAR_START: 19,
10578 PAR_AND: 20,
10579 PAR_END: 21,
10580 RECT_START: 22,
10581 RECT_END: 23
10582};
10583var ARROWTYPE = {
10584 FILLED: 0,
10585 OPEN: 1
10586};
10587var PLACEMENT = {
10588 LEFTOF: 0,
10589 RIGHTOF: 1,
10590 OVER: 2
10591};
10592var addNote = function addNote(actor, placement, message) {
10593 var note = {
10594 actor: actor,
10595 placement: placement,
10596 message: message
10597 }; // Coerce actor into a [to, from, ...] array
10598
10599 var actors = [].concat(actor, actor);
10600 notes.push(note);
10601 messages.push({
10602 from: actors[0],
10603 to: actors[1],
10604 message: message,
10605 type: LINETYPE.NOTE,
10606 placement: placement
10607 });
10608};
10609var setTitle = function setTitle(titleText) {
10610 title = titleText;
10611};
10612var apply = function apply(param) {
10613 if (param instanceof Array) {
10614 param.forEach(function (item) {
10615 apply(item);
10616 });
10617 } else {
10618 switch (param.type) {
10619 case 'addActor':
10620 addActor(param.actor, param.actor, param.description);
10621 break;
10622
10623 case 'activeStart':
10624 addSignal(param.actor, undefined, undefined, param.signalType);
10625 break;
10626
10627 case 'activeEnd':
10628 addSignal(param.actor, undefined, undefined, param.signalType);
10629 break;
10630
10631 case 'addNote':
10632 addNote(param.actor, param.placement, param.text);
10633 break;
10634
10635 case 'addMessage':
10636 addSignal(param.from, param.to, param.msg, param.signalType);
10637 break;
10638
10639 case 'loopStart':
10640 addSignal(undefined, undefined, param.loopText, param.signalType);
10641 break;
10642
10643 case 'loopEnd':
10644 addSignal(undefined, undefined, undefined, param.signalType);
10645 break;
10646
10647 case 'rectStart':
10648 addSignal(undefined, undefined, param.color, param.signalType);
10649 break;
10650
10651 case 'rectEnd':
10652 addSignal(undefined, undefined, undefined, param.signalType);
10653 break;
10654
10655 case 'optStart':
10656 addSignal(undefined, undefined, param.optText, param.signalType);
10657 break;
10658
10659 case 'optEnd':
10660 addSignal(undefined, undefined, undefined, param.signalType);
10661 break;
10662
10663 case 'altStart':
10664 addSignal(undefined, undefined, param.altText, param.signalType);
10665 break;
10666
10667 case 'else':
10668 addSignal(undefined, undefined, param.altText, param.signalType);
10669 break;
10670
10671 case 'altEnd':
10672 addSignal(undefined, undefined, undefined, param.signalType);
10673 break;
10674
10675 case 'setTitle':
10676 setTitle(param.text);
10677 break;
10678
10679 case 'parStart':
10680 addSignal(undefined, undefined, param.parText, param.signalType);
10681 break;
10682
10683 case 'and':
10684 addSignal(undefined, undefined, param.parText, param.signalType);
10685 break;
10686
10687 case 'parEnd':
10688 addSignal(undefined, undefined, undefined, param.signalType);
10689 break;
10690 }
10691 }
10692};
10693/* harmony default export */ __webpack_exports__["default"] = ({
10694 addActor: addActor,
10695 addMessage: addMessage,
10696 addSignal: addSignal,
10697 getMessages: getMessages,
10698 getActors: getActors,
10699 getActor: getActor,
10700 getActorKeys: getActorKeys,
10701 getTitle: getTitle,
10702 clear: clear,
10703 LINETYPE: LINETYPE,
10704 ARROWTYPE: ARROWTYPE,
10705 PLACEMENT: PLACEMENT,
10706 addNote: addNote,
10707 setTitle: setTitle,
10708 apply: apply
10709});
10710
10711/***/ }),
10712
10713/***/ "./src/diagrams/sequence/sequenceRenderer.js":
10714/*!***************************************************!*\
10715 !*** ./src/diagrams/sequence/sequenceRenderer.js ***!
10716 \***************************************************/
10717/*! exports provided: bounds, drawActors, setConf, draw, default */
10718/***/ (function(module, __webpack_exports__, __webpack_require__) {
10719
10720"use strict";
10721__webpack_require__.r(__webpack_exports__);
10722/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bounds", function() { return bounds; });
10723/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawActors", function() { return drawActors; });
10724/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; });
10725/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; });
10726/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
10727/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
10728/* harmony import */ var _svgDraw__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./svgDraw */ "./src/diagrams/sequence/svgDraw.js");
10729/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
10730/* harmony import */ var _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parser/sequenceDiagram */ "./src/diagrams/sequence/parser/sequenceDiagram.jison");
10731/* harmony import */ var _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__);
10732/* harmony import */ var _sequenceDb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./sequenceDb */ "./src/diagrams/sequence/sequenceDb.js");
10733
10734
10735
10736
10737
10738_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy = _sequenceDb__WEBPACK_IMPORTED_MODULE_4__["default"];
10739var conf = {
10740 diagramMarginX: 50,
10741 diagramMarginY: 30,
10742 // Margin between actors
10743 actorMargin: 50,
10744 // Width of actor boxes
10745 width: 150,
10746 // Height of actor boxes
10747 height: 65,
10748 actorFontSize: 14,
10749 actorFontFamily: '"Open-Sans", "sans-serif"',
10750 // Margin around loop boxes
10751 boxMargin: 10,
10752 boxTextMargin: 5,
10753 noteMargin: 10,
10754 // Space between messages
10755 messageMargin: 35,
10756 // mirror actors under diagram
10757 mirrorActors: false,
10758 // Depending on css styling this might need adjustment
10759 // Prolongs the edge of the diagram downwards
10760 bottomMarginAdj: 1,
10761 // width of activation box
10762 activationWidth: 10,
10763 // text placement as: tspan | fo | old only text as before
10764 textPlacement: 'tspan',
10765 showSequenceNumbers: false
10766};
10767var bounds = {
10768 data: {
10769 startx: undefined,
10770 stopx: undefined,
10771 starty: undefined,
10772 stopy: undefined
10773 },
10774 verticalPos: 0,
10775 sequenceItems: [],
10776 activations: [],
10777 init: function init() {
10778 this.sequenceItems = [];
10779 this.activations = [];
10780 this.data = {
10781 startx: undefined,
10782 stopx: undefined,
10783 starty: undefined,
10784 stopy: undefined
10785 };
10786 this.verticalPos = 0;
10787 },
10788 updateVal: function updateVal(obj, key, val, fun) {
10789 if (typeof obj[key] === 'undefined') {
10790 obj[key] = val;
10791 } else {
10792 obj[key] = fun(val, obj[key]);
10793 }
10794 },
10795 updateBounds: function updateBounds(startx, starty, stopx, stopy) {
10796 var _self = this;
10797
10798 var cnt = 0;
10799
10800 function updateFn(type) {
10801 return function updateItemBounds(item) {
10802 cnt++; // The loop sequenceItems is a stack so the biggest margins in the beginning of the sequenceItems
10803
10804 var n = _self.sequenceItems.length - cnt + 1;
10805
10806 _self.updateVal(item, 'starty', starty - n * conf.boxMargin, Math.min);
10807
10808 _self.updateVal(item, 'stopy', stopy + n * conf.boxMargin, Math.max);
10809
10810 _self.updateVal(bounds.data, 'startx', startx - n * conf.boxMargin, Math.min);
10811
10812 _self.updateVal(bounds.data, 'stopx', stopx + n * conf.boxMargin, Math.max);
10813
10814 if (!(type === 'activation')) {
10815 _self.updateVal(item, 'startx', startx - n * conf.boxMargin, Math.min);
10816
10817 _self.updateVal(item, 'stopx', stopx + n * conf.boxMargin, Math.max);
10818
10819 _self.updateVal(bounds.data, 'starty', starty - n * conf.boxMargin, Math.min);
10820
10821 _self.updateVal(bounds.data, 'stopy', stopy + n * conf.boxMargin, Math.max);
10822 }
10823 };
10824 }
10825
10826 this.sequenceItems.forEach(updateFn());
10827 this.activations.forEach(updateFn('activation'));
10828 },
10829 insert: function insert(startx, starty, stopx, stopy) {
10830 var _startx = Math.min(startx, stopx);
10831
10832 var _stopx = Math.max(startx, stopx);
10833
10834 var _starty = Math.min(starty, stopy);
10835
10836 var _stopy = Math.max(starty, stopy);
10837
10838 this.updateVal(bounds.data, 'startx', _startx, Math.min);
10839 this.updateVal(bounds.data, 'starty', _starty, Math.min);
10840 this.updateVal(bounds.data, 'stopx', _stopx, Math.max);
10841 this.updateVal(bounds.data, 'stopy', _stopy, Math.max);
10842 this.updateBounds(_startx, _starty, _stopx, _stopy);
10843 },
10844 newActivation: function newActivation(message, diagram) {
10845 var actorRect = _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.getActors()[message.from.actor];
10846 var stackedSize = actorActivations(message.from.actor).length;
10847 var x = actorRect.x + conf.width / 2 + (stackedSize - 1) * conf.activationWidth / 2;
10848 this.activations.push({
10849 startx: x,
10850 starty: this.verticalPos + 2,
10851 stopx: x + conf.activationWidth,
10852 stopy: undefined,
10853 actor: message.from.actor,
10854 anchored: _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].anchorElement(diagram)
10855 });
10856 },
10857 endActivation: function endActivation(message) {
10858 // find most recent activation for given actor
10859 var lastActorActivationIdx = this.activations.map(function (activation) {
10860 return activation.actor;
10861 }).lastIndexOf(message.from.actor);
10862 var activation = this.activations.splice(lastActorActivationIdx, 1)[0];
10863 return activation;
10864 },
10865 newLoop: function newLoop(title, fill) {
10866 this.sequenceItems.push({
10867 startx: undefined,
10868 starty: this.verticalPos,
10869 stopx: undefined,
10870 stopy: undefined,
10871 title: title,
10872 fill: fill
10873 });
10874 },
10875 endLoop: function endLoop() {
10876 var loop = this.sequenceItems.pop();
10877 return loop;
10878 },
10879 addSectionToLoop: function addSectionToLoop(message) {
10880 var loop = this.sequenceItems.pop();
10881 loop.sections = loop.sections || [];
10882 loop.sectionTitles = loop.sectionTitles || [];
10883 loop.sections.push(bounds.getVerticalPos());
10884 loop.sectionTitles.push(message);
10885 this.sequenceItems.push(loop);
10886 },
10887 bumpVerticalPos: function bumpVerticalPos(bump) {
10888 this.verticalPos = this.verticalPos + bump;
10889 this.data.stopy = this.verticalPos;
10890 },
10891 getVerticalPos: function getVerticalPos() {
10892 return this.verticalPos;
10893 },
10894 getBounds: function getBounds() {
10895 return this.data;
10896 }
10897};
10898
10899var _drawLongText = function _drawLongText(text, x, y, g, width) {
10900 var textHeight = 0;
10901 var lines = text.split(/<br\s*\/?>/gi);
10902 var _iteratorNormalCompletion = true;
10903 var _didIteratorError = false;
10904 var _iteratorError = undefined;
10905
10906 try {
10907 for (var _iterator = lines[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
10908 var line = _step.value;
10909 var textObj = _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].getTextObj();
10910 textObj.x = x;
10911 textObj.y = y + textHeight;
10912 textObj.textMargin = conf.noteMargin;
10913 textObj.dy = '1em';
10914 textObj.text = line;
10915 textObj.class = 'noteText';
10916 var textElem = _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawText(g, textObj, width);
10917 textHeight += (textElem._groups || textElem)[0][0].getBBox().height;
10918 }
10919 } catch (err) {
10920 _didIteratorError = true;
10921 _iteratorError = err;
10922 } finally {
10923 try {
10924 if (!_iteratorNormalCompletion && _iterator.return != null) {
10925 _iterator.return();
10926 }
10927 } finally {
10928 if (_didIteratorError) {
10929 throw _iteratorError;
10930 }
10931 }
10932 }
10933
10934 return textHeight;
10935};
10936/**
10937 * Draws an actor in the diagram with the attaced line
10938 * @param center - The center of the the actor
10939 * @param pos The position if the actor in the liost of actors
10940 * @param description The text in the box
10941 */
10942
10943
10944var drawNote = function drawNote(elem, startx, verticalPos, msg, forceWidth) {
10945 var rect = _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].getNoteRect();
10946 rect.x = startx;
10947 rect.y = verticalPos;
10948 rect.width = forceWidth || conf.width;
10949 rect.class = 'note';
10950 var g = elem.append('g');
10951 var rectElem = _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawRect(g, rect);
10952
10953 var textHeight = _drawLongText(msg.message, startx - 4, verticalPos + 24, g, rect.width - conf.noteMargin);
10954
10955 bounds.insert(startx, verticalPos, startx + rect.width, verticalPos + 2 * conf.noteMargin + textHeight);
10956 rectElem.attr('height', textHeight + 2 * conf.noteMargin);
10957 bounds.bumpVerticalPos(textHeight + 2 * conf.noteMargin);
10958};
10959/**
10960 * Draws a message
10961 * @param elem
10962 * @param startx
10963 * @param stopx
10964 * @param verticalPos
10965 * @param txtCenter
10966 * @param msg
10967 */
10968
10969
10970var drawMessage = function drawMessage(elem, startx, stopx, verticalPos, msg, sequenceIndex) {
10971 var g = elem.append('g');
10972 var txtCenter = startx + (stopx - startx) / 2;
10973 var textElem;
10974 var counterBreaklines = 0;
10975 var breaklineOffset = 17;
10976 var breaklines = msg.message.split(/<br\s*\/?>/gi);
10977 var _iteratorNormalCompletion2 = true;
10978 var _didIteratorError2 = false;
10979 var _iteratorError2 = undefined;
10980
10981 try {
10982 for (var _iterator2 = breaklines[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
10983 var breakline = _step2.value;
10984 textElem = g.append('text') // text label for the x axis
10985 .attr('x', txtCenter).attr('y', verticalPos - 7 + counterBreaklines * breaklineOffset).style('text-anchor', 'middle').attr('class', 'messageText').text(breakline.trim());
10986 counterBreaklines++;
10987 }
10988 } catch (err) {
10989 _didIteratorError2 = true;
10990 _iteratorError2 = err;
10991 } finally {
10992 try {
10993 if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
10994 _iterator2.return();
10995 }
10996 } finally {
10997 if (_didIteratorError2) {
10998 throw _iteratorError2;
10999 }
11000 }
11001 }
11002
11003 var offsetLineCounter = counterBreaklines - 1;
11004 var totalOffset = offsetLineCounter * breaklineOffset;
11005 var textWidth = (textElem._groups || textElem)[0][0].getBBox().width;
11006 var line;
11007
11008 if (startx === stopx) {
11009 if (conf.rightAngles) {
11010 line = g.append('path').attr('d', "M ".concat(startx, ",").concat(verticalPos + totalOffset, " H ").concat(startx + conf.width / 2, " V ").concat(verticalPos + 25 + totalOffset, " H ").concat(startx));
11011 } else {
11012 line = g.append('path').attr('d', 'M ' + startx + ',' + (verticalPos + totalOffset) + ' C ' + (startx + 60) + ',' + (verticalPos - 10 + totalOffset) + ' ' + (startx + 60) + ',' + (verticalPos + 30 + totalOffset) + ' ' + startx + ',' + (verticalPos + 20 + totalOffset));
11013 }
11014
11015 bounds.bumpVerticalPos(30 + totalOffset);
11016 var dx = Math.max(textWidth / 2, 100);
11017 bounds.insert(startx - dx, bounds.getVerticalPos() - 10 + totalOffset, stopx + dx, bounds.getVerticalPos() + totalOffset);
11018 } else {
11019 line = g.append('line');
11020 line.attr('x1', startx);
11021 line.attr('y1', verticalPos);
11022 line.attr('x2', stopx);
11023 line.attr('y2', verticalPos);
11024 bounds.insert(startx, bounds.getVerticalPos() - 10 + totalOffset, stopx, bounds.getVerticalPos() + totalOffset);
11025 } // Make an SVG Container
11026 // Draw the line
11027
11028
11029 if (msg.type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED || msg.type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_CROSS || msg.type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_OPEN) {
11030 line.style('stroke-dasharray', '3, 3');
11031 line.attr('class', 'messageLine1');
11032 } else {
11033 line.attr('class', 'messageLine0');
11034 }
11035
11036 var url = '';
11037
11038 if (conf.arrowMarkerAbsolute) {
11039 url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search;
11040 url = url.replace(/\(/g, '\\(');
11041 url = url.replace(/\)/g, '\\)');
11042 }
11043
11044 line.attr('stroke-width', 2);
11045 line.attr('stroke', 'black');
11046 line.style('fill', 'none'); // remove any fill colour
11047
11048 if (msg.type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID || msg.type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED) {
11049 line.attr('marker-end', 'url(' + url + '#arrowhead)');
11050 }
11051
11052 if (msg.type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID_CROSS || msg.type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_CROSS) {
11053 line.attr('marker-end', 'url(' + url + '#crosshead)');
11054 } // add node number
11055
11056
11057 if (conf.showSequenceNumbers) {
11058 line.attr('marker-start', 'url(' + url + '#sequencenumber)');
11059 g.append('text').attr('x', startx).attr('y', verticalPos + 4).attr('font-family', 'sans-serif').attr('font-size', '12px').attr('text-anchor', 'middle').attr('textLength', '16px').attr('class', 'sequenceNumber').text(sequenceIndex);
11060 }
11061};
11062
11063var drawActors = function drawActors(diagram, actors, actorKeys, verticalPos) {
11064 // Draw the actors
11065 for (var i = 0; i < actorKeys.length; i++) {
11066 var key = actorKeys[i]; // Add some rendering data to the object
11067
11068 actors[key].x = i * conf.actorMargin + i * conf.width;
11069 actors[key].y = verticalPos;
11070 actors[key].width = conf.diagramMarginX;
11071 actors[key].height = conf.diagramMarginY; // Draw the box with the attached line
11072
11073 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawActor(diagram, actors[key].x, verticalPos, actors[key].description, conf);
11074 bounds.insert(actors[key].x, verticalPos, actors[key].x + conf.width, conf.height);
11075 } // Add a margin between the actor boxes and the first arrow
11076
11077
11078 bounds.bumpVerticalPos(conf.height);
11079};
11080var setConf = function setConf(cnf) {
11081 var keys = Object.keys(cnf);
11082 keys.forEach(function (key) {
11083 conf[key] = cnf[key];
11084 });
11085 conf.actorFontFamily = cnf.fontFamily;
11086};
11087
11088var actorActivations = function actorActivations(actor) {
11089 return bounds.activations.filter(function (activation) {
11090 return activation.actor === actor;
11091 });
11092};
11093
11094var actorFlowVerticaBounds = function actorFlowVerticaBounds(actor) {
11095 // handle multiple stacked activations for same actor
11096 var actors = _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.getActors();
11097 var activations = actorActivations(actor);
11098 var left = activations.reduce(function (acc, activation) {
11099 return Math.min(acc, activation.startx);
11100 }, actors[actor].x + conf.width / 2);
11101 var right = activations.reduce(function (acc, activation) {
11102 return Math.max(acc, activation.stopx);
11103 }, actors[actor].x + conf.width / 2);
11104 return [left, right];
11105};
11106/**
11107 * Draws a flowchart in the tag with id: id based on the graph definition in text.
11108 * @param text
11109 * @param id
11110 */
11111
11112
11113var draw = function draw(text, id) {
11114 _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.clear();
11115 _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].parse(text + '\n');
11116 bounds.init();
11117 var diagram = d3__WEBPACK_IMPORTED_MODULE_0__["select"]("[id=\"".concat(id, "\"]"));
11118 var startx;
11119 var stopx;
11120 var forceWidth; // Fetch data from the parsing
11121
11122 var actors = _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.getActors();
11123 var actorKeys = _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.getActorKeys();
11124 var messages = _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.getMessages();
11125 var title = _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.getTitle();
11126 drawActors(diagram, actors, actorKeys, 0); // The arrow head definition is attached to the svg once
11127
11128 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].insertArrowHead(diagram);
11129 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].insertArrowCrossHead(diagram);
11130 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].insertSequenceNumber(diagram);
11131
11132 function activeEnd(msg, verticalPos) {
11133 var activationData = bounds.endActivation(msg);
11134
11135 if (activationData.starty + 18 > verticalPos) {
11136 activationData.starty = verticalPos - 6;
11137 verticalPos += 12;
11138 }
11139
11140 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawActivation(diagram, activationData, verticalPos, conf, actorActivations(msg.from.actor).length);
11141 bounds.insert(activationData.startx, verticalPos - 10, activationData.stopx, verticalPos);
11142 } // const lastMsg
11143 // Draw the messages/signals
11144
11145
11146 var sequenceIndex = 1;
11147 messages.forEach(function (msg) {
11148 var loopData;
11149
11150 switch (msg.type) {
11151 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.NOTE:
11152 bounds.bumpVerticalPos(conf.boxMargin);
11153 startx = actors[msg.from].x;
11154 stopx = actors[msg.to].x;
11155
11156 if (msg.placement === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.PLACEMENT.RIGHTOF) {
11157 drawNote(diagram, startx + (conf.width + conf.actorMargin) / 2, bounds.getVerticalPos(), msg);
11158 } else if (msg.placement === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.PLACEMENT.LEFTOF) {
11159 drawNote(diagram, startx - (conf.width + conf.actorMargin) / 2, bounds.getVerticalPos(), msg);
11160 } else if (msg.to === msg.from) {
11161 // Single-actor over
11162 drawNote(diagram, startx, bounds.getVerticalPos(), msg);
11163 } else {
11164 // Multi-actor over
11165 forceWidth = Math.abs(startx - stopx) + conf.actorMargin;
11166 drawNote(diagram, (startx + stopx + conf.width - forceWidth) / 2, bounds.getVerticalPos(), msg, forceWidth);
11167 }
11168
11169 break;
11170
11171 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.ACTIVE_START:
11172 bounds.newActivation(msg, diagram);
11173 break;
11174
11175 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.ACTIVE_END:
11176 activeEnd(msg, bounds.getVerticalPos());
11177 break;
11178
11179 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.LOOP_START:
11180 bounds.bumpVerticalPos(conf.boxMargin);
11181 bounds.newLoop(msg.message);
11182 bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin);
11183 break;
11184
11185 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.LOOP_END:
11186 loopData = bounds.endLoop();
11187 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawLoop(diagram, loopData, 'loop', conf);
11188 bounds.bumpVerticalPos(conf.boxMargin);
11189 break;
11190
11191 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.RECT_START:
11192 bounds.bumpVerticalPos(conf.boxMargin);
11193 bounds.newLoop(undefined, msg.message);
11194 bounds.bumpVerticalPos(conf.boxMargin);
11195 break;
11196
11197 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.RECT_END:
11198 {
11199 var rectData = bounds.endLoop();
11200 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawBackgroundRect(diagram, rectData);
11201 bounds.bumpVerticalPos(conf.boxMargin);
11202 break;
11203 }
11204
11205 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.OPT_START:
11206 bounds.bumpVerticalPos(conf.boxMargin);
11207 bounds.newLoop(msg.message);
11208 bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin);
11209 break;
11210
11211 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.OPT_END:
11212 loopData = bounds.endLoop();
11213 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawLoop(diagram, loopData, 'opt', conf);
11214 bounds.bumpVerticalPos(conf.boxMargin);
11215 break;
11216
11217 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.ALT_START:
11218 bounds.bumpVerticalPos(conf.boxMargin);
11219 bounds.newLoop(msg.message);
11220 bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin);
11221 break;
11222
11223 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.ALT_ELSE:
11224 bounds.bumpVerticalPos(conf.boxMargin);
11225 loopData = bounds.addSectionToLoop(msg.message);
11226 bounds.bumpVerticalPos(conf.boxMargin);
11227 break;
11228
11229 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.ALT_END:
11230 loopData = bounds.endLoop();
11231 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawLoop(diagram, loopData, 'alt', conf);
11232 bounds.bumpVerticalPos(conf.boxMargin);
11233 break;
11234
11235 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.PAR_START:
11236 bounds.bumpVerticalPos(conf.boxMargin);
11237 bounds.newLoop(msg.message);
11238 bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin);
11239 break;
11240
11241 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.PAR_AND:
11242 bounds.bumpVerticalPos(conf.boxMargin);
11243 loopData = bounds.addSectionToLoop(msg.message);
11244 bounds.bumpVerticalPos(conf.boxMargin);
11245 break;
11246
11247 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.PAR_END:
11248 loopData = bounds.endLoop();
11249 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawLoop(diagram, loopData, 'par', conf);
11250 bounds.bumpVerticalPos(conf.boxMargin);
11251 break;
11252
11253 default:
11254 try {
11255 // lastMsg = msg
11256 bounds.bumpVerticalPos(conf.messageMargin);
11257 var fromBounds = actorFlowVerticaBounds(msg.from);
11258 var toBounds = actorFlowVerticaBounds(msg.to);
11259 var fromIdx = fromBounds[0] <= toBounds[0] ? 1 : 0;
11260 var toIdx = fromBounds[0] < toBounds[0] ? 0 : 1;
11261 startx = fromBounds[fromIdx];
11262 stopx = toBounds[toIdx];
11263 var verticalPos = bounds.getVerticalPos();
11264 drawMessage(diagram, startx, stopx, verticalPos, msg, sequenceIndex);
11265 var allBounds = fromBounds.concat(toBounds);
11266 bounds.insert(Math.min.apply(null, allBounds), verticalPos, Math.max.apply(null, allBounds), verticalPos);
11267 } catch (e) {
11268 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].error('error while drawing message', e);
11269 }
11270
11271 } // Increment sequence counter if msg.type is a line (and not another event like activation or note, etc)
11272
11273
11274 if ([_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID_OPEN, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_OPEN, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID_CROSS, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_CROSS].includes(msg.type)) {
11275 sequenceIndex++;
11276 }
11277 });
11278
11279 if (conf.mirrorActors) {
11280 // Draw actors below diagram
11281 bounds.bumpVerticalPos(conf.boxMargin * 2);
11282 drawActors(diagram, actors, actorKeys, bounds.getVerticalPos());
11283 }
11284
11285 var box = bounds.getBounds(); // Adjust line height of actor lines now that the height of the diagram is known
11286
11287 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('For line height fix Querying: #' + id + ' .actor-line');
11288 var actorLines = d3__WEBPACK_IMPORTED_MODULE_0__["selectAll"]('#' + id + ' .actor-line');
11289 actorLines.attr('y2', box.stopy);
11290 var height = box.stopy - box.starty + 2 * conf.diagramMarginY;
11291
11292 if (conf.mirrorActors) {
11293 height = height - conf.boxMargin + conf.bottomMarginAdj;
11294 }
11295
11296 var width = box.stopx - box.startx + 2 * conf.diagramMarginX;
11297
11298 if (title) {
11299 diagram.append('text').text(title).attr('x', (box.stopx - box.startx) / 2 - 2 * conf.diagramMarginX).attr('y', -25);
11300 }
11301
11302 if (conf.useMaxWidth) {
11303 diagram.attr('height', '100%');
11304 diagram.attr('width', '100%');
11305 diagram.attr('style', 'max-width:' + width + 'px;');
11306 } else {
11307 diagram.attr('height', height);
11308 diagram.attr('width', width);
11309 }
11310
11311 var extraVertForTitle = title ? 40 : 0;
11312 diagram.attr('viewBox', box.startx - conf.diagramMarginX + ' -' + (conf.diagramMarginY + extraVertForTitle) + ' ' + width + ' ' + (height + extraVertForTitle));
11313};
11314/* harmony default export */ __webpack_exports__["default"] = ({
11315 bounds: bounds,
11316 drawActors: drawActors,
11317 setConf: setConf,
11318 draw: draw
11319});
11320
11321/***/ }),
11322
11323/***/ "./src/diagrams/sequence/svgDraw.js":
11324/*!******************************************!*\
11325 !*** ./src/diagrams/sequence/svgDraw.js ***!
11326 \******************************************/
11327/*! exports provided: drawRect, drawText, drawLabel, drawActor, anchorElement, drawActivation, drawLoop, drawBackgroundRect, insertArrowHead, insertSequenceNumber, insertArrowCrossHead, getTextObj, getNoteRect, default */
11328/***/ (function(module, __webpack_exports__, __webpack_require__) {
11329
11330"use strict";
11331__webpack_require__.r(__webpack_exports__);
11332/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawRect", function() { return drawRect; });
11333/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawText", function() { return drawText; });
11334/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawLabel", function() { return drawLabel; });
11335/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawActor", function() { return drawActor; });
11336/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "anchorElement", function() { return anchorElement; });
11337/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawActivation", function() { return drawActivation; });
11338/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawLoop", function() { return drawLoop; });
11339/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawBackgroundRect", function() { return drawBackgroundRect; });
11340/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertArrowHead", function() { return insertArrowHead; });
11341/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertSequenceNumber", function() { return insertSequenceNumber; });
11342/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertArrowCrossHead", function() { return insertArrowCrossHead; });
11343/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTextObj", function() { return getTextObj; });
11344/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNoteRect", function() { return getNoteRect; });
11345var drawRect = function drawRect(elem, rectData) {
11346 var rectElem = elem.append('rect');
11347 rectElem.attr('x', rectData.x);
11348 rectElem.attr('y', rectData.y);
11349 rectElem.attr('fill', rectData.fill);
11350 rectElem.attr('stroke', rectData.stroke);
11351 rectElem.attr('width', rectData.width);
11352 rectElem.attr('height', rectData.height);
11353 rectElem.attr('rx', rectData.rx);
11354 rectElem.attr('ry', rectData.ry);
11355
11356 if (typeof rectData.class !== 'undefined') {
11357 rectElem.attr('class', rectData.class);
11358 }
11359
11360 return rectElem;
11361};
11362var drawText = function drawText(elem, textData) {
11363 // Remove and ignore br:s
11364 var nText = textData.text.replace(/<br\s*\/?>/gi, ' ');
11365 var textElem = elem.append('text');
11366 textElem.attr('x', textData.x);
11367 textElem.attr('y', textData.y);
11368 textElem.style('text-anchor', textData.anchor);
11369 textElem.attr('fill', textData.fill);
11370
11371 if (typeof textData.class !== 'undefined') {
11372 textElem.attr('class', textData.class);
11373 }
11374
11375 var span = textElem.append('tspan');
11376 span.attr('x', textData.x + textData.textMargin * 2);
11377 span.attr('fill', textData.fill);
11378 span.text(nText);
11379 return textElem;
11380};
11381var drawLabel = function drawLabel(elem, txtObject) {
11382 function genPoints(x, y, width, height, cut) {
11383 return x + ',' + y + ' ' + (x + width) + ',' + y + ' ' + (x + width) + ',' + (y + height - cut) + ' ' + (x + width - cut * 1.2) + ',' + (y + height) + ' ' + x + ',' + (y + height);
11384 }
11385
11386 var polygon = elem.append('polygon');
11387 polygon.attr('points', genPoints(txtObject.x, txtObject.y, 50, 20, 7));
11388 polygon.attr('class', 'labelBox');
11389 txtObject.y = txtObject.y + txtObject.labelMargin;
11390 txtObject.x = txtObject.x + 0.5 * txtObject.labelMargin;
11391 drawText(elem, txtObject);
11392};
11393var actorCnt = -1;
11394/**
11395 * Draws an actor in the diagram with the attaced line
11396 * @param center - The center of the the actor
11397 * @param pos The position if the actor in the liost of actors
11398 * @param description The text in the box
11399 */
11400
11401var drawActor = function drawActor(elem, left, verticalPos, description, conf) {
11402 var center = left + conf.width / 2;
11403 var g = elem.append('g');
11404
11405 if (verticalPos === 0) {
11406 actorCnt++;
11407 g.append('line').attr('id', 'actor' + actorCnt).attr('x1', center).attr('y1', 5).attr('x2', center).attr('y2', 2000).attr('class', 'actor-line').attr('stroke-width', '0.5px').attr('stroke', '#999');
11408 }
11409
11410 var rect = getNoteRect();
11411 rect.x = left;
11412 rect.y = verticalPos;
11413 rect.fill = '#eaeaea';
11414 rect.width = conf.width;
11415 rect.height = conf.height;
11416 rect.class = 'actor';
11417 rect.rx = 3;
11418 rect.ry = 3;
11419 drawRect(g, rect);
11420
11421 _drawTextCandidateFunc(conf)(description, g, rect.x, rect.y, rect.width, rect.height, {
11422 class: 'actor'
11423 }, conf);
11424};
11425var anchorElement = function anchorElement(elem) {
11426 return elem.append('g');
11427};
11428/**
11429 * Draws an actor in the diagram with the attaced line
11430 * @param elem - element to append activation rect
11431 * @param bounds - activation box bounds
11432 * @param verticalPos - precise y cooridnate of bottom activation box edge
11433 */
11434
11435var drawActivation = function drawActivation(elem, bounds, verticalPos, conf, actorActivations) {
11436 var rect = getNoteRect();
11437 var g = bounds.anchored;
11438 rect.x = bounds.startx;
11439 rect.y = bounds.starty;
11440 rect.class = 'activation' + actorActivations % 3; // Will evaluate to 0, 1 or 2
11441
11442 rect.width = bounds.stopx - bounds.startx;
11443 rect.height = verticalPos - bounds.starty;
11444 drawRect(g, rect);
11445};
11446/**
11447 * Draws an actor in the diagram with the attaced line
11448 * @param center - The center of the the actor
11449 * @param pos The position if the actor in the list of actors
11450 * @param description The text in the box
11451 */
11452
11453var drawLoop = function drawLoop(elem, bounds, labelText, conf) {
11454 var g = elem.append('g');
11455
11456 var drawLoopLine = function drawLoopLine(startx, starty, stopx, stopy) {
11457 return g.append('line').attr('x1', startx).attr('y1', starty).attr('x2', stopx).attr('y2', stopy).attr('class', 'loopLine');
11458 };
11459
11460 drawLoopLine(bounds.startx, bounds.starty, bounds.stopx, bounds.starty);
11461 drawLoopLine(bounds.stopx, bounds.starty, bounds.stopx, bounds.stopy);
11462 drawLoopLine(bounds.startx, bounds.stopy, bounds.stopx, bounds.stopy);
11463 drawLoopLine(bounds.startx, bounds.starty, bounds.startx, bounds.stopy);
11464
11465 if (typeof bounds.sections !== 'undefined') {
11466 bounds.sections.forEach(function (item) {
11467 drawLoopLine(bounds.startx, item, bounds.stopx, item).style('stroke-dasharray', '3, 3');
11468 });
11469 }
11470
11471 var txt = getTextObj();
11472 txt.text = labelText;
11473 txt.x = bounds.startx;
11474 txt.y = bounds.starty;
11475 txt.labelMargin = 1.5 * 10; // This is the small box that says "loop"
11476
11477 txt.class = 'labelText'; // Its size & position are fixed.
11478
11479 drawLabel(g, txt);
11480 txt = getTextObj();
11481 txt.text = '[ ' + bounds.title + ' ]';
11482 txt.x = bounds.startx + (bounds.stopx - bounds.startx) / 2;
11483 txt.y = bounds.starty + 1.5 * conf.boxMargin;
11484 txt.anchor = 'middle';
11485 txt.class = 'loopText';
11486 drawText(g, txt);
11487
11488 if (typeof bounds.sectionTitles !== 'undefined') {
11489 bounds.sectionTitles.forEach(function (item, idx) {
11490 if (item !== '') {
11491 txt.text = '[ ' + item + ' ]';
11492 txt.y = bounds.sections[idx] + 1.5 * conf.boxMargin;
11493 drawText(g, txt);
11494 }
11495 });
11496 }
11497};
11498/**
11499 * Draws a background rectangle
11500 * @param color - The fill color for the background
11501 */
11502
11503var drawBackgroundRect = function drawBackgroundRect(elem, bounds) {
11504 var rectElem = drawRect(elem, {
11505 x: bounds.startx,
11506 y: bounds.starty,
11507 width: bounds.stopx - bounds.startx,
11508 height: bounds.stopy - bounds.starty,
11509 fill: bounds.fill,
11510 class: 'rect'
11511 });
11512 rectElem.lower();
11513};
11514/**
11515 * Setup arrow head and define the marker. The result is appended to the svg.
11516 */
11517
11518var insertArrowHead = function insertArrowHead(elem) {
11519 elem.append('defs').append('marker').attr('id', 'arrowhead').attr('refX', 5).attr('refY', 2).attr('markerWidth', 6).attr('markerHeight', 4).attr('orient', 'auto').append('path').attr('d', 'M 0,0 V 4 L6,2 Z'); // this is actual shape for arrowhead
11520};
11521/**
11522 * Setup node number. The result is appended to the svg.
11523 */
11524
11525var insertSequenceNumber = function insertSequenceNumber(elem) {
11526 elem.append('defs').append('marker').attr('id', 'sequencenumber').attr('refX', 15).attr('refY', 15).attr('markerWidth', 60).attr('markerHeight', 40).attr('orient', 'auto').append('circle').attr('cx', 15).attr('cy', 15).attr('r', 6); // .style("fill", '#f00');
11527};
11528/**
11529 * Setup arrow head and define the marker. The result is appended to the svg.
11530 */
11531
11532var insertArrowCrossHead = function insertArrowCrossHead(elem) {
11533 var defs = elem.append('defs');
11534 var marker = defs.append('marker').attr('id', 'crosshead').attr('markerWidth', 15).attr('markerHeight', 8).attr('orient', 'auto').attr('refX', 16).attr('refY', 4); // The arrow
11535
11536 marker.append('path').attr('fill', 'black').attr('stroke', '#000000').style('stroke-dasharray', '0, 0').attr('stroke-width', '1px').attr('d', 'M 9,2 V 6 L16,4 Z'); // The cross
11537
11538 marker.append('path').attr('fill', 'none').attr('stroke', '#000000').style('stroke-dasharray', '0, 0').attr('stroke-width', '1px').attr('d', 'M 0,1 L 6,7 M 6,1 L 0,7'); // this is actual shape for arrowhead
11539};
11540var getTextObj = function getTextObj() {
11541 var txt = {
11542 x: 0,
11543 y: 0,
11544 fill: undefined,
11545 'text-anchor': 'start',
11546 style: '#666',
11547 width: 100,
11548 height: 100,
11549 textMargin: 0,
11550 rx: 0,
11551 ry: 0
11552 };
11553 return txt;
11554};
11555var getNoteRect = function getNoteRect() {
11556 var rect = {
11557 x: 0,
11558 y: 0,
11559 fill: '#EDF2AE',
11560 stroke: '#666',
11561 width: 100,
11562 anchor: 'start',
11563 height: 100,
11564 rx: 0,
11565 ry: 0
11566 };
11567 return rect;
11568};
11569
11570var _drawTextCandidateFunc = function () {
11571 function byText(content, g, x, y, width, height, textAttrs) {
11572 var text = g.append('text').attr('x', x + width / 2).attr('y', y + height / 2 + 5).style('text-anchor', 'middle').text(content);
11573
11574 _setTextAttrs(text, textAttrs);
11575 }
11576
11577 function byTspan(content, g, x, y, width, height, textAttrs, conf) {
11578 var actorFontSize = conf.actorFontSize,
11579 actorFontFamily = conf.actorFontFamily;
11580 var lines = content.split(/<br\s*\/?>/gi);
11581
11582 for (var i = 0; i < lines.length; i++) {
11583 var dy = i * actorFontSize - actorFontSize * (lines.length - 1) / 2;
11584 var text = g.append('text').attr('x', x + width / 2).attr('y', y).style('text-anchor', 'middle').style('font-size', actorFontSize).style('font-family', actorFontFamily);
11585 text.append('tspan').attr('x', x + width / 2).attr('dy', dy).text(lines[i]);
11586 text.attr('y', y + height / 2.0).attr('dominant-baseline', 'central').attr('alignment-baseline', 'central');
11587
11588 _setTextAttrs(text, textAttrs);
11589 }
11590 }
11591
11592 function byFo(content, g, x, y, width, height, textAttrs, conf) {
11593 var s = g.append('switch');
11594 var f = s.append('foreignObject').attr('x', x).attr('y', y).attr('width', width).attr('height', height);
11595 var text = f.append('div').style('display', 'table').style('height', '100%').style('width', '100%');
11596 text.append('div').style('display', 'table-cell').style('text-align', 'center').style('vertical-align', 'middle').text(content);
11597 byTspan(content, s, x, y, width, height, textAttrs, conf);
11598
11599 _setTextAttrs(text, textAttrs);
11600 }
11601
11602 function _setTextAttrs(toText, fromTextAttrsDict) {
11603 for (var key in fromTextAttrsDict) {
11604 if (fromTextAttrsDict.hasOwnProperty(key)) {
11605 // eslint-disable-line
11606 toText.attr(key, fromTextAttrsDict[key]);
11607 }
11608 }
11609 }
11610
11611 return function (conf) {
11612 return conf.textPlacement === 'fo' ? byFo : conf.textPlacement === 'old' ? byText : byTspan;
11613 };
11614}();
11615
11616/* harmony default export */ __webpack_exports__["default"] = ({
11617 drawRect: drawRect,
11618 drawText: drawText,
11619 drawLabel: drawLabel,
11620 drawActor: drawActor,
11621 anchorElement: anchorElement,
11622 drawActivation: drawActivation,
11623 drawLoop: drawLoop,
11624 drawBackgroundRect: drawBackgroundRect,
11625 insertArrowHead: insertArrowHead,
11626 insertSequenceNumber: insertSequenceNumber,
11627 insertArrowCrossHead: insertArrowCrossHead,
11628 getTextObj: getTextObj,
11629 getNoteRect: getNoteRect
11630});
11631
11632/***/ }),
11633
11634/***/ "./src/diagrams/state/id-cache.js":
11635/*!****************************************!*\
11636 !*** ./src/diagrams/state/id-cache.js ***!
11637 \****************************************/
11638/*! exports provided: set, get, keys, size, default */
11639/***/ (function(module, __webpack_exports__, __webpack_require__) {
11640
11641"use strict";
11642__webpack_require__.r(__webpack_exports__);
11643/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "set", function() { return set; });
11644/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "get", function() { return get; });
11645/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "keys", function() { return keys; });
11646/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "size", function() { return size; });
11647var idCache = {};
11648var set = function set(key, val) {
11649 idCache[key] = val;
11650};
11651var get = function get(k) {
11652 return idCache[k];
11653};
11654var keys = function keys() {
11655 return Object.keys(idCache);
11656};
11657var size = function size() {
11658 return keys().length;
11659};
11660/* harmony default export */ __webpack_exports__["default"] = ({
11661 get: get,
11662 set: set,
11663 keys: keys,
11664 size: size
11665});
11666
11667/***/ }),
11668
11669/***/ "./src/diagrams/state/parser/stateDiagram.jison":
11670/*!******************************************************!*\
11671 !*** ./src/diagrams/state/parser/stateDiagram.jison ***!
11672 \******************************************************/
11673/*! no static exports found */
11674/***/ (function(module, exports, __webpack_require__) {
11675
11676/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */
11677/*
11678 Returns a Parser object of the following structure:
11679
11680 Parser: {
11681 yy: {}
11682 }
11683
11684 Parser.prototype: {
11685 yy: {},
11686 trace: function(),
11687 symbols_: {associative list: name ==> number},
11688 terminals_: {associative list: number ==> name},
11689 productions_: [...],
11690 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
11691 table: [...],
11692 defaultActions: {...},
11693 parseError: function(str, hash),
11694 parse: function(input),
11695
11696 lexer: {
11697 EOF: 1,
11698 parseError: function(str, hash),
11699 setInput: function(input),
11700 input: function(),
11701 unput: function(str),
11702 more: function(),
11703 less: function(n),
11704 pastInput: function(),
11705 upcomingInput: function(),
11706 showPosition: function(),
11707 test_match: function(regex_match_array, rule_index),
11708 next: function(),
11709 lex: function(),
11710 begin: function(condition),
11711 popState: function(),
11712 _currentRules: function(),
11713 topState: function(),
11714 pushState: function(condition),
11715
11716 options: {
11717 ranges: boolean (optional: true ==> token location info will include a .range[] member)
11718 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
11719 backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
11720 },
11721
11722 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
11723 rules: [...],
11724 conditions: {associative list: name ==> set},
11725 }
11726 }
11727
11728
11729 token location info (@$, _$, etc.): {
11730 first_line: n,
11731 last_line: n,
11732 first_column: n,
11733 last_column: n,
11734 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
11735 }
11736
11737
11738 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
11739 text: (matched text)
11740 token: (the produced terminal token, if any)
11741 line: (yylineno)
11742 }
11743 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
11744 loc: (yylloc)
11745 expected: (string describing the set of expected tokens)
11746 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
11747 }
11748*/
11749var parser = (function(){
11750var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,3],$V2=[1,4],$V3=[2,4],$V4=[1,9],$V5=[1,11],$V6=[1,13],$V7=[1,14],$V8=[1,15],$V9=[1,16],$Va=[1,21],$Vb=[1,17],$Vc=[1,18],$Vd=[1,19],$Ve=[1,20],$Vf=[1,22],$Vg=[1,4,5,13,14,16,18,19,21,22,23,24,25,28],$Vh=[1,4,5,11,12,13,14,16,18,19,21,22,23,24,25,28],$Vi=[4,5,13,14,16,18,19,21,22,23,24,25,28];
11751var parser = {trace: function trace () { },
11752yy: {},
11753symbols_: {"error":2,"start":3,"SPACE":4,"NL":5,"SD":6,"document":7,"line":8,"statement":9,"idStatement":10,"DESCR":11,"-->":12,"HIDE_EMPTY":13,"scale":14,"WIDTH":15,"COMPOSIT_STATE":16,"STRUCT_START":17,"STRUCT_STOP":18,"STATE_DESCR":19,"AS":20,"ID":21,"FORK":22,"JOIN":23,"CONCURRENT":24,"note":25,"notePosition":26,"NOTE_TEXT":27,"EDGE_STATE":28,"left_of":29,"right_of":30,"$accept":0,"$end":1},
11754terminals_: {2:"error",4:"SPACE",5:"NL",6:"SD",11:"DESCR",12:"-->",13:"HIDE_EMPTY",14:"scale",15:"WIDTH",16:"COMPOSIT_STATE",17:"STRUCT_START",18:"STRUCT_STOP",19:"STATE_DESCR",20:"AS",21:"ID",22:"FORK",23:"JOIN",24:"CONCURRENT",25:"note",27:"NOTE_TEXT",28:"EDGE_STATE",29:"left_of",30:"right_of"},
11755productions_: [0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,4],[9,4],[10,1],[10,1],[26,1],[26,1]],
11756performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
11757/* this == yyval */
11758
11759var $0 = $$.length - 1;
11760switch (yystate) {
11761case 3:
11762 /*console.warn('Root document', $$[$0]);*/ yy.setRootDoc($$[$0]);return $$[$0];
11763break;
11764case 4:
11765 this.$ = []
11766break;
11767case 5:
11768
11769 if($$[$0]!='nl'){
11770 $$[$0-1].push($$[$0]);this.$ = $$[$0-1]
11771 }
11772 // console.warn('Got document',$$[$0-1], $$[$0]);
11773
11774break;
11775case 6: case 7:
11776 this.$ = $$[$0]
11777break;
11778case 8:
11779 this.$='nl';
11780break;
11781case 9:
11782 /*console.warn('got id and descr', $$[$0]);*/this.$={ stmt: 'state', id: $$[$0], type: 'default', description: ''};
11783break;
11784case 10:
11785 /*console.warn('got id and descr', $$[$0-1], $$[$0].trim());*/this.$={ stmt: 'state', id: $$[$0-1], type: 'default', description: $$[$0].trim()};
11786break;
11787case 11:
11788
11789 /*console.warn('got id', $$[$0-2]);yy.addRelation($$[$0-2], $$[$0]);*/
11790 this.$={ stmt: 'relation', state1: { stmt: 'state', id: $$[$0-2], type: 'default', description: '' }, state2:{ stmt: 'state', id: $$[$0] ,type: 'default', description: ''}};
11791
11792break;
11793case 12:
11794
11795 /*yy.addRelation($$[$0-3], $$[$0-1], $$[$0].substr(1).trim());*/
11796 this.$={ stmt: 'relation', state1: { stmt: 'state', id: $$[$0-3], type: 'default', description: '' }, state2:{ stmt: 'state', id: $$[$0-1] ,type: 'default', description: ''}, description: $$[$0].substr(1).trim()};
11797
11798break;
11799case 16:
11800
11801
11802 /* console.warn('Adding document for state without id ', $$[$0-3]);*/
11803 this.$={ stmt: 'state', id: $$[$0-3], type: 'default', description: '', doc: $$[$0-1] }
11804
11805break;
11806case 17:
11807
11808 var id=$$[$0];
11809 var description = $$[$0-2].trim();
11810 if($$[$0].match(':')){
11811 var parts = $$[$0].split(':');
11812 id=parts[0];
11813 description = [description, parts[1]];
11814 }
11815 this.$={stmt: 'state', id: id, type: 'default', description: description};
11816
11817
11818break;
11819case 18:
11820
11821 //console.warn('Adding document for state with id ', $$[$0-3], $$[$0-2]); yy.addDocument($$[$0-3]);
11822 this.$={ stmt: 'state', id: $$[$0-3], type: 'default', description: $$[$0-5], doc: $$[$0-1] }
11823
11824break;
11825case 19:
11826
11827 this.$={ stmt: 'state', id: $$[$0], type: 'fork' }
11828
11829break;
11830case 20:
11831
11832 this.$={ stmt: 'state', id: $$[$0], type: 'join' }
11833
11834break;
11835case 21:
11836
11837 this.$={ stmt: 'state', id: yy.getDividerId(), type: 'divider' }
11838
11839break;
11840case 22:
11841
11842 /*console.warn('got NOTE, position: ', $$[$0-2].trim(), 'id = ', $$[$0-1].trim(), 'note: ', $$[$0]);*/
11843 this.$={ stmt: 'state', id: $$[$0-1].trim(), note:{position: $$[$0-2].trim(), text: $$[$0].trim()}};
11844
11845break;
11846case 24: case 25:
11847this.$=$$[$0];
11848break;
11849}
11850},
11851table: [{3:1,4:$V0,5:$V1,6:$V2},{1:[3]},{3:5,4:$V0,5:$V1,6:$V2},{3:6,4:$V0,5:$V1,6:$V2},o([1,4,5,13,14,16,19,21,22,23,24,25,28],$V3,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:$V4,5:$V5,8:8,9:10,10:12,13:$V6,14:$V7,16:$V8,19:$V9,21:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,28:$Vf},o($Vg,[2,5]),{9:23,10:12,13:$V6,14:$V7,16:$V8,19:$V9,21:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,28:$Vf},o($Vg,[2,7]),o($Vg,[2,8]),o($Vg,[2,9],{11:[1,24],12:[1,25]}),o($Vg,[2,13]),{15:[1,26]},o($Vg,[2,15],{17:[1,27]}),{20:[1,28]},o($Vg,[2,19]),o($Vg,[2,20]),o($Vg,[2,21]),{26:29,27:[1,30],29:[1,31],30:[1,32]},o($Vh,[2,24]),o($Vh,[2,25]),o($Vg,[2,6]),o($Vg,[2,10]),{10:33,21:$Va,28:$Vf},o($Vg,[2,14]),o($Vi,$V3,{7:34}),{21:[1,35]},{21:[1,36]},{20:[1,37]},{21:[2,26]},{21:[2,27]},o($Vg,[2,11],{11:[1,38]}),{4:$V4,5:$V5,8:8,9:10,10:12,13:$V6,14:$V7,16:$V8,18:[1,39],19:$V9,21:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,28:$Vf},o($Vg,[2,17],{17:[1,40]}),{27:[1,41]},{21:[1,42]},o($Vg,[2,12]),o($Vg,[2,16]),o($Vi,$V3,{7:43}),o($Vg,[2,22]),o($Vg,[2,23]),{4:$V4,5:$V5,8:8,9:10,10:12,13:$V6,14:$V7,16:$V8,18:[1,44],19:$V9,21:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,28:$Vf},o($Vg,[2,18])],
11852defaultActions: {5:[2,1],6:[2,2],31:[2,26],32:[2,27]},
11853parseError: function parseError (str, hash) {
11854 if (hash.recoverable) {
11855 this.trace(str);
11856 } else {
11857 var error = new Error(str);
11858 error.hash = hash;
11859 throw error;
11860 }
11861},
11862parse: function parse(input) {
11863 var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
11864 var args = lstack.slice.call(arguments, 1);
11865 var lexer = Object.create(this.lexer);
11866 var sharedState = { yy: {} };
11867 for (var k in this.yy) {
11868 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
11869 sharedState.yy[k] = this.yy[k];
11870 }
11871 }
11872 lexer.setInput(input, sharedState.yy);
11873 sharedState.yy.lexer = lexer;
11874 sharedState.yy.parser = this;
11875 if (typeof lexer.yylloc == 'undefined') {
11876 lexer.yylloc = {};
11877 }
11878 var yyloc = lexer.yylloc;
11879 lstack.push(yyloc);
11880 var ranges = lexer.options && lexer.options.ranges;
11881 if (typeof sharedState.yy.parseError === 'function') {
11882 this.parseError = sharedState.yy.parseError;
11883 } else {
11884 this.parseError = Object.getPrototypeOf(this).parseError;
11885 }
11886 function popStack(n) {
11887 stack.length = stack.length - 2 * n;
11888 vstack.length = vstack.length - n;
11889 lstack.length = lstack.length - n;
11890 }
11891 function lex() {
11892 var token;
11893 token = tstack.pop() || lexer.lex() || EOF;
11894 if (typeof token !== 'number') {
11895 if (token instanceof Array) {
11896 tstack = token;
11897 token = tstack.pop();
11898 }
11899 token = self.symbols_[token] || token;
11900 }
11901 return token;
11902 }
11903 var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
11904 while (true) {
11905 state = stack[stack.length - 1];
11906 if (this.defaultActions[state]) {
11907 action = this.defaultActions[state];
11908 } else {
11909 if (symbol === null || typeof symbol == 'undefined') {
11910 symbol = lex();
11911 }
11912 action = table[state] && table[state][symbol];
11913 }
11914 if (typeof action === 'undefined' || !action.length || !action[0]) {
11915 var errStr = '';
11916 expected = [];
11917 for (p in table[state]) {
11918 if (this.terminals_[p] && p > TERROR) {
11919 expected.push('\'' + this.terminals_[p] + '\'');
11920 }
11921 }
11922 if (lexer.showPosition) {
11923 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
11924 } else {
11925 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
11926 }
11927 this.parseError(errStr, {
11928 text: lexer.match,
11929 token: this.terminals_[symbol] || symbol,
11930 line: lexer.yylineno,
11931 loc: yyloc,
11932 expected: expected
11933 });
11934 }
11935 if (action[0] instanceof Array && action.length > 1) {
11936 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
11937 }
11938 switch (action[0]) {
11939 case 1:
11940 stack.push(symbol);
11941 vstack.push(lexer.yytext);
11942 lstack.push(lexer.yylloc);
11943 stack.push(action[1]);
11944 symbol = null;
11945 if (!preErrorSymbol) {
11946 yyleng = lexer.yyleng;
11947 yytext = lexer.yytext;
11948 yylineno = lexer.yylineno;
11949 yyloc = lexer.yylloc;
11950 if (recovering > 0) {
11951 recovering--;
11952 }
11953 } else {
11954 symbol = preErrorSymbol;
11955 preErrorSymbol = null;
11956 }
11957 break;
11958 case 2:
11959 len = this.productions_[action[1]][1];
11960 yyval.$ = vstack[vstack.length - len];
11961 yyval._$ = {
11962 first_line: lstack[lstack.length - (len || 1)].first_line,
11963 last_line: lstack[lstack.length - 1].last_line,
11964 first_column: lstack[lstack.length - (len || 1)].first_column,
11965 last_column: lstack[lstack.length - 1].last_column
11966 };
11967 if (ranges) {
11968 yyval._$.range = [
11969 lstack[lstack.length - (len || 1)].range[0],
11970 lstack[lstack.length - 1].range[1]
11971 ];
11972 }
11973 r = this.performAction.apply(yyval, [
11974 yytext,
11975 yyleng,
11976 yylineno,
11977 sharedState.yy,
11978 action[1],
11979 vstack,
11980 lstack
11981 ].concat(args));
11982 if (typeof r !== 'undefined') {
11983 return r;
11984 }
11985 if (len) {
11986 stack = stack.slice(0, -1 * len * 2);
11987 vstack = vstack.slice(0, -1 * len);
11988 lstack = lstack.slice(0, -1 * len);
11989 }
11990 stack.push(this.productions_[action[1]][0]);
11991 vstack.push(yyval.$);
11992 lstack.push(yyval._$);
11993 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
11994 stack.push(newState);
11995 break;
11996 case 3:
11997 return true;
11998 }
11999 }
12000 return true;
12001}};
12002
12003/* generated by jison-lex 0.3.4 */
12004var lexer = (function(){
12005var lexer = ({
12006
12007EOF:1,
12008
12009parseError:function parseError(str, hash) {
12010 if (this.yy.parser) {
12011 this.yy.parser.parseError(str, hash);
12012 } else {
12013 throw new Error(str);
12014 }
12015 },
12016
12017// resets the lexer, sets new input
12018setInput:function (input, yy) {
12019 this.yy = yy || this.yy || {};
12020 this._input = input;
12021 this._more = this._backtrack = this.done = false;
12022 this.yylineno = this.yyleng = 0;
12023 this.yytext = this.matched = this.match = '';
12024 this.conditionStack = ['INITIAL'];
12025 this.yylloc = {
12026 first_line: 1,
12027 first_column: 0,
12028 last_line: 1,
12029 last_column: 0
12030 };
12031 if (this.options.ranges) {
12032 this.yylloc.range = [0,0];
12033 }
12034 this.offset = 0;
12035 return this;
12036 },
12037
12038// consumes and returns one char from the input
12039input:function () {
12040 var ch = this._input[0];
12041 this.yytext += ch;
12042 this.yyleng++;
12043 this.offset++;
12044 this.match += ch;
12045 this.matched += ch;
12046 var lines = ch.match(/(?:\r\n?|\n).*/g);
12047 if (lines) {
12048 this.yylineno++;
12049 this.yylloc.last_line++;
12050 } else {
12051 this.yylloc.last_column++;
12052 }
12053 if (this.options.ranges) {
12054 this.yylloc.range[1]++;
12055 }
12056
12057 this._input = this._input.slice(1);
12058 return ch;
12059 },
12060
12061// unshifts one char (or a string) into the input
12062unput:function (ch) {
12063 var len = ch.length;
12064 var lines = ch.split(/(?:\r\n?|\n)/g);
12065
12066 this._input = ch + this._input;
12067 this.yytext = this.yytext.substr(0, this.yytext.length - len);
12068 //this.yyleng -= len;
12069 this.offset -= len;
12070 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
12071 this.match = this.match.substr(0, this.match.length - 1);
12072 this.matched = this.matched.substr(0, this.matched.length - 1);
12073
12074 if (lines.length - 1) {
12075 this.yylineno -= lines.length - 1;
12076 }
12077 var r = this.yylloc.range;
12078
12079 this.yylloc = {
12080 first_line: this.yylloc.first_line,
12081 last_line: this.yylineno + 1,
12082 first_column: this.yylloc.first_column,
12083 last_column: lines ?
12084 (lines.length === oldLines.length ? this.yylloc.first_column : 0)
12085 + oldLines[oldLines.length - lines.length].length - lines[0].length :
12086 this.yylloc.first_column - len
12087 };
12088
12089 if (this.options.ranges) {
12090 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
12091 }
12092 this.yyleng = this.yytext.length;
12093 return this;
12094 },
12095
12096// When called from action, caches matched text and appends it on next action
12097more:function () {
12098 this._more = true;
12099 return this;
12100 },
12101
12102// 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.
12103reject:function () {
12104 if (this.options.backtrack_lexer) {
12105 this._backtrack = true;
12106 } else {
12107 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(), {
12108 text: "",
12109 token: null,
12110 line: this.yylineno
12111 });
12112
12113 }
12114 return this;
12115 },
12116
12117// retain first n characters of the match
12118less:function (n) {
12119 this.unput(this.match.slice(n));
12120 },
12121
12122// displays already matched input, i.e. for error messages
12123pastInput:function () {
12124 var past = this.matched.substr(0, this.matched.length - this.match.length);
12125 return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
12126 },
12127
12128// displays upcoming input, i.e. for error messages
12129upcomingInput:function () {
12130 var next = this.match;
12131 if (next.length < 20) {
12132 next += this._input.substr(0, 20-next.length);
12133 }
12134 return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
12135 },
12136
12137// displays the character position where the lexing error occurred, i.e. for error messages
12138showPosition:function () {
12139 var pre = this.pastInput();
12140 var c = new Array(pre.length + 1).join("-");
12141 return pre + this.upcomingInput() + "\n" + c + "^";
12142 },
12143
12144// test the lexed token: return FALSE when not a match, otherwise return token
12145test_match:function(match, indexed_rule) {
12146 var token,
12147 lines,
12148 backup;
12149
12150 if (this.options.backtrack_lexer) {
12151 // save context
12152 backup = {
12153 yylineno: this.yylineno,
12154 yylloc: {
12155 first_line: this.yylloc.first_line,
12156 last_line: this.last_line,
12157 first_column: this.yylloc.first_column,
12158 last_column: this.yylloc.last_column
12159 },
12160 yytext: this.yytext,
12161 match: this.match,
12162 matches: this.matches,
12163 matched: this.matched,
12164 yyleng: this.yyleng,
12165 offset: this.offset,
12166 _more: this._more,
12167 _input: this._input,
12168 yy: this.yy,
12169 conditionStack: this.conditionStack.slice(0),
12170 done: this.done
12171 };
12172 if (this.options.ranges) {
12173 backup.yylloc.range = this.yylloc.range.slice(0);
12174 }
12175 }
12176
12177 lines = match[0].match(/(?:\r\n?|\n).*/g);
12178 if (lines) {
12179 this.yylineno += lines.length;
12180 }
12181 this.yylloc = {
12182 first_line: this.yylloc.last_line,
12183 last_line: this.yylineno + 1,
12184 first_column: this.yylloc.last_column,
12185 last_column: lines ?
12186 lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
12187 this.yylloc.last_column + match[0].length
12188 };
12189 this.yytext += match[0];
12190 this.match += match[0];
12191 this.matches = match;
12192 this.yyleng = this.yytext.length;
12193 if (this.options.ranges) {
12194 this.yylloc.range = [this.offset, this.offset += this.yyleng];
12195 }
12196 this._more = false;
12197 this._backtrack = false;
12198 this._input = this._input.slice(match[0].length);
12199 this.matched += match[0];
12200 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
12201 if (this.done && this._input) {
12202 this.done = false;
12203 }
12204 if (token) {
12205 return token;
12206 } else if (this._backtrack) {
12207 // recover context
12208 for (var k in backup) {
12209 this[k] = backup[k];
12210 }
12211 return false; // rule action called reject() implying the next rule should be tested instead.
12212 }
12213 return false;
12214 },
12215
12216// return next match in input
12217next:function () {
12218 if (this.done) {
12219 return this.EOF;
12220 }
12221 if (!this._input) {
12222 this.done = true;
12223 }
12224
12225 var token,
12226 match,
12227 tempMatch,
12228 index;
12229 if (!this._more) {
12230 this.yytext = '';
12231 this.match = '';
12232 }
12233 var rules = this._currentRules();
12234 for (var i = 0; i < rules.length; i++) {
12235 tempMatch = this._input.match(this.rules[rules[i]]);
12236 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
12237 match = tempMatch;
12238 index = i;
12239 if (this.options.backtrack_lexer) {
12240 token = this.test_match(tempMatch, rules[i]);
12241 if (token !== false) {
12242 return token;
12243 } else if (this._backtrack) {
12244 match = false;
12245 continue; // rule action called reject() implying a rule MISmatch.
12246 } else {
12247 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
12248 return false;
12249 }
12250 } else if (!this.options.flex) {
12251 break;
12252 }
12253 }
12254 }
12255 if (match) {
12256 token = this.test_match(match, rules[index]);
12257 if (token !== false) {
12258 return token;
12259 }
12260 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
12261 return false;
12262 }
12263 if (this._input === "") {
12264 return this.EOF;
12265 } else {
12266 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
12267 text: "",
12268 token: null,
12269 line: this.yylineno
12270 });
12271 }
12272 },
12273
12274// return next match that has a token
12275lex:function lex () {
12276 var r = this.next();
12277 if (r) {
12278 return r;
12279 } else {
12280 return this.lex();
12281 }
12282 },
12283
12284// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
12285begin:function begin (condition) {
12286 this.conditionStack.push(condition);
12287 },
12288
12289// pop the previously active lexer condition state off the condition stack
12290popState:function popState () {
12291 var n = this.conditionStack.length - 1;
12292 if (n > 0) {
12293 return this.conditionStack.pop();
12294 } else {
12295 return this.conditionStack[0];
12296 }
12297 },
12298
12299// produce the lexer rule set which is active for the currently active lexer condition state
12300_currentRules:function _currentRules () {
12301 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
12302 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
12303 } else {
12304 return this.conditions["INITIAL"].rules;
12305 }
12306 },
12307
12308// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
12309topState:function topState (n) {
12310 n = this.conditionStack.length - 1 - Math.abs(n || 0);
12311 if (n >= 0) {
12312 return this.conditionStack[n];
12313 } else {
12314 return "INITIAL";
12315 }
12316 },
12317
12318// alias for begin(condition)
12319pushState:function pushState (condition) {
12320 this.begin(condition);
12321 },
12322
12323// return the number of states currently on the stack
12324stateStackSize:function stateStackSize() {
12325 return this.conditionStack.length;
12326 },
12327options: {"case-insensitive":true},
12328performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
12329var YYSTATE=YY_START;
12330switch($avoiding_name_collisions) {
12331case 0:return 5;
12332break;
12333case 1:/* skip all whitespace */
12334break;
12335case 2:/* skip same-line whitespace */
12336break;
12337case 3:/* skip comments */
12338break;
12339case 4:/* skip comments */
12340break;
12341case 5: this.pushState('SCALE'); /* console.log('Got scale', yy_.yytext);*/ return 14;
12342break;
12343case 6:return 15;
12344break;
12345case 7:this.popState();
12346break;
12347case 8: this.pushState('STATE');
12348break;
12349case 9:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim(); /*console.warn('Fork Fork: ',yy_.yytext);*/return 22;
12350break;
12351case 10:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 23;
12352break;
12353case 11:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Fork: ',yy_.yytext);*/return 22;
12354break;
12355case 12:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 23;
12356break;
12357case 13:this.begin("STATE_STRING");
12358break;
12359case 14:this.popState();this.pushState('STATE_ID');return "AS";
12360break;
12361case 15:this.popState();/* console.log('STATE_ID', yy_.yytext);*/return "ID";
12362break;
12363case 16:this.popState();
12364break;
12365case 17: /*console.log('Long description:', yy_.yytext);*/return "STATE_DESCR";
12366break;
12367case 18:/*console.log('COMPOSIT_STATE', yy_.yytext);*/return 16;
12368break;
12369case 19:this.popState();
12370break;
12371case 20:this.popState();this.pushState('struct'); /*console.log('begin struct', yy_.yytext);*/return 17;
12372break;
12373case 21: /*console.log('Ending struct');*/ this.popState(); return 18;
12374break;
12375case 22:/* nothing */
12376break;
12377case 23: this.begin('NOTE'); return 25;
12378break;
12379case 24: this.popState();this.pushState('NOTE_ID');return 29;
12380break;
12381case 25: this.popState();this.pushState('NOTE_ID');return 30;
12382break;
12383case 26: this.popState();this.pushState('FLOATING_NOTE');
12384break;
12385case 27:this.popState();this.pushState('FLOATING_NOTE_ID');return "AS";
12386break;
12387case 28:/**/
12388break;
12389case 29: /*console.log('Floating note text: ', yy_.yytext);*/return "NOTE_TEXT";
12390break;
12391case 30:this.popState();/*console.log('Floating note ID', yy_.yytext);*/return "ID";
12392break;
12393case 31: this.popState();this.pushState('NOTE_TEXT');/*console.log('Got ID for note', yy_.yytext);*/return 21;
12394break;
12395case 32: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.substr(2).trim();return 27;
12396break;
12397case 33: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.slice(0,-8).trim();return 27;
12398break;
12399case 34: /*console.log('Got state diagram', yy_.yytext,'#');*/return 6;
12400break;
12401case 35: /*console.log('HIDE_EMPTY', yy_.yytext,'#');*/return 13;
12402break;
12403case 36: /*console.log('EDGE_STATE=',yy_.yytext);*/ return 28;
12404break;
12405case 37: /*console.log('=>ID=',yy_.yytext);*/ return 21;
12406break;
12407case 38: yy_.yytext = yy_.yytext.trim(); /*console.log('Descr = ', yy_.yytext);*/ return 11;
12408break;
12409case 39:return 12;
12410break;
12411case 40:return 24;
12412break;
12413case 41:return 5;
12414break;
12415case 42:return 'INVALID';
12416break;
12417}
12418},
12419rules: [/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:["])/i,/^(?:as\s*)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:\s*[^:;]+end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?:$)/i,/^(?:.)/i],
12420conditions: {"LINE":{"rules":[2,3],"inclusive":false},"struct":{"rules":[2,3,8,21,22,23,36,37,38,39,40],"inclusive":false},"FLOATING_NOTE_ID":{"rules":[30],"inclusive":false},"FLOATING_NOTE":{"rules":[27,28,29],"inclusive":false},"NOTE_TEXT":{"rules":[32,33],"inclusive":false},"NOTE_ID":{"rules":[31],"inclusive":false},"NOTE":{"rules":[24,25,26],"inclusive":false},"SCALE":{"rules":[6,7],"inclusive":false},"ALIAS":{"rules":[],"inclusive":false},"STATE_ID":{"rules":[15],"inclusive":false},"STATE_STRING":{"rules":[16,17],"inclusive":false},"FORK_STATE":{"rules":[],"inclusive":false},"STATE":{"rules":[2,3,9,10,11,12,13,14,18,19,20],"inclusive":false},"ID":{"rules":[2,3],"inclusive":false},"INITIAL":{"rules":[0,1,3,4,5,8,20,23,34,35,36,37,38,39,41,42],"inclusive":true}}
12421});
12422return lexer;
12423})();
12424parser.lexer = lexer;
12425function Parser () {
12426 this.yy = {};
12427}
12428Parser.prototype = parser;parser.Parser = Parser;
12429return new Parser;
12430})();
12431
12432
12433if (true) {
12434exports.parser = parser;
12435exports.Parser = parser.Parser;
12436exports.parse = function () { return parser.parse.apply(parser, arguments); };
12437exports.main = function commonjsMain (args) {
12438 if (!args[1]) {
12439 console.log('Usage: '+args[0]+' FILE');
12440 process.exit(1);
12441 }
12442 var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8");
12443 return exports.parser.parse(source);
12444};
12445if ( true && __webpack_require__.c[__webpack_require__.s] === module) {
12446 exports.main(process.argv.slice(1));
12447}
12448}
12449/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
12450
12451/***/ }),
12452
12453/***/ "./src/diagrams/state/shapes.js":
12454/*!**************************************!*\
12455 !*** ./src/diagrams/state/shapes.js ***!
12456 \**************************************/
12457/*! exports provided: drawStartState, drawDivider, drawSimpleState, drawDescrState, addTitleAndBox, drawText, drawNote, drawState, drawEdge */
12458/***/ (function(module, __webpack_exports__, __webpack_require__) {
12459
12460"use strict";
12461__webpack_require__.r(__webpack_exports__);
12462/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawStartState", function() { return drawStartState; });
12463/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawDivider", function() { return drawDivider; });
12464/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawSimpleState", function() { return drawSimpleState; });
12465/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawDescrState", function() { return drawDescrState; });
12466/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addTitleAndBox", function() { return addTitleAndBox; });
12467/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawText", function() { return drawText; });
12468/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawNote", function() { return drawNote; });
12469/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawState", function() { return drawState; });
12470/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawEdge", function() { return drawEdge; });
12471/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
12472/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
12473/* harmony import */ var _id_cache_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./id-cache.js */ "./src/diagrams/state/id-cache.js");
12474/* harmony import */ var _stateDb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./stateDb */ "./src/diagrams/state/stateDb.js");
12475/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils */ "./src/utils.js");
12476/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../config */ "./src/config.js");
12477
12478
12479
12480
12481 // let conf;
12482
12483/**
12484 * Draws a start state as a black circle
12485 */
12486
12487var drawStartState = function drawStartState(g) {
12488 return g.append('circle').style('stroke', 'black').style('fill', 'black').attr('r', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.sizeUnit).attr('cx', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.sizeUnit).attr('cy', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.sizeUnit);
12489};
12490/**
12491 * Draws a start state as a black circle
12492 */
12493
12494var drawDivider = function drawDivider(g) {
12495 return g.append('line').style('stroke', 'grey').style('stroke-dasharray', '3').attr('x1', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.textHeight).attr('class', 'divider').attr('x2', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.textHeight * 2).attr('y1', 0).attr('y2', 0);
12496};
12497/**
12498 * Draws a an end state as a black circle
12499 */
12500
12501var drawSimpleState = function drawSimpleState(g, stateDef) {
12502 var state = g.append('text').attr('x', 2 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.textHeight + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('font-size', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.fontSize).attr('class', 'state-title').text(stateDef.id);
12503 var classBox = state.node().getBBox();
12504 g.insert('rect', ':first-child').attr('x', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('width', classBox.width + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('height', classBox.height + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('rx', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.radius);
12505 return state;
12506};
12507/**
12508 * Draws a state with descriptions
12509 * @param {*} g
12510 * @param {*} stateDef
12511 */
12512
12513var drawDescrState = function drawDescrState(g, stateDef) {
12514 var addTspan = function addTspan(textEl, txt, isFirst) {
12515 var tSpan = textEl.append('tspan').attr('x', 2 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).text(txt);
12516
12517 if (!isFirst) {
12518 tSpan.attr('dy', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.textHeight);
12519 }
12520 };
12521
12522 var title = g.append('text').attr('x', 2 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.textHeight + 1.3 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('font-size', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.fontSize).attr('class', 'state-title').text(stateDef.descriptions[0]);
12523 var titleBox = title.node().getBBox();
12524 var titleHeight = titleBox.height;
12525 var description = g.append('text') // text label for the x axis
12526 .attr('x', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('y', titleHeight + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding * 0.4 + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.dividerMargin + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.textHeight).attr('class', 'state-description');
12527 var isFirst = true;
12528 var isSecond = true;
12529 stateDef.descriptions.forEach(function (descr) {
12530 if (!isFirst) {
12531 addTspan(description, descr, isSecond);
12532 isSecond = false;
12533 }
12534
12535 isFirst = false;
12536 });
12537 var descrLine = g.append('line') // text label for the x axis
12538 .attr('x1', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('y1', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding + titleHeight + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.dividerMargin / 2).attr('y2', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding + titleHeight + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.dividerMargin / 2).attr('class', 'descr-divider');
12539 var descrBox = description.node().getBBox();
12540 var width = Math.max(descrBox.width, titleBox.width);
12541 descrLine.attr('x2', width + 3 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding); // const classBox = title.node().getBBox();
12542
12543 g.insert('rect', ':first-child').attr('x', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('width', width + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('height', descrBox.height + titleHeight + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('rx', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.radius);
12544 return g;
12545};
12546/**
12547 * Adds the creates a box around the existing content and adds a
12548 * panel for the id on top of the content.
12549 */
12550
12551/**
12552 * Function that creates an title row and a frame around a substate for a composit state diagram.
12553 * The function returns a new d3 svg object with updated width and height properties;
12554 * @param {*} g The d3 svg object for the substate to framed
12555 * @param {*} stateDef The info about the
12556 */
12557
12558var addTitleAndBox = function addTitleAndBox(g, stateDef, altBkg) {
12559 var pad = Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding;
12560 var dblPad = 2 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding;
12561 var orgBox = g.node().getBBox();
12562 var orgWidth = orgBox.width;
12563 var orgX = orgBox.x;
12564 var title = g.append('text').attr('x', 0).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.titleShift).attr('font-size', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.fontSize).attr('class', 'state-title').text(stateDef.id);
12565 var titleBox = title.node().getBBox();
12566 var titleWidth = titleBox.width + dblPad;
12567 var width = Math.max(titleWidth, orgWidth); // + dblPad;
12568
12569 if (width === orgWidth) {
12570 width = width + dblPad;
12571 }
12572
12573 var startX; // const lineY = 1 - getConfig().state.textHeight;
12574 // const descrLine = g
12575 // .append('line') // text label for the x axis
12576 // .attr('x1', 0)
12577 // .attr('y1', lineY)
12578 // .attr('y2', lineY)
12579 // .attr('class', 'descr-divider');
12580
12581 var graphBox = g.node().getBBox(); // console.warn(width / 2, titleWidth / 2, getConfig().state.padding, orgBox);
12582 // descrLine.attr('x2', graphBox.width + getConfig().state.padding);
12583
12584 if (stateDef.doc) {// cnsole.warn(
12585 // stateDef.id,
12586 // 'orgX: ',
12587 // orgX,
12588 // 'width: ',
12589 // width,
12590 // 'titleWidth: ',
12591 // titleWidth,
12592 // 'orgWidth: ',
12593 // orgWidth,
12594 // 'width',
12595 // width
12596 // );
12597 }
12598
12599 startX = orgX - pad;
12600
12601 if (titleWidth > orgWidth) {
12602 startX = (orgWidth - width) / 2 + pad;
12603 }
12604
12605 if (Math.abs(orgX - graphBox.x) < pad) {
12606 if (titleWidth > orgWidth) {
12607 startX = orgX - (titleWidth - orgWidth) / 2;
12608 }
12609 }
12610
12611 var lineY = 1 - Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.textHeight; // White color
12612
12613 g.insert('rect', ':first-child').attr('x', startX).attr('y', lineY).attr('class', altBkg ? 'alt-composit' : 'composit').attr('width', width).attr('height', graphBox.height + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.textHeight + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.titleShift + 1).attr('rx', '0');
12614 title.attr('x', startX + pad);
12615 if (titleWidth <= orgWidth) title.attr('x', orgX + (width - dblPad) / 2 - titleWidth / 2 + pad); // Title background
12616
12617 g.insert('rect', ':first-child').attr('x', startX).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.titleShift - Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.textHeight - Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('width', width) // Just needs to be higher then the descr line, will be clipped by the white color box
12618 .attr('height', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.textHeight * 3).attr('rx', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.radius); // Full background
12619
12620 g.insert('rect', ':first-child').attr('x', startX).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.titleShift - Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.textHeight - Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('width', width).attr('height', graphBox.height + 3 + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.textHeight).attr('rx', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.radius);
12621 return g;
12622};
12623
12624var drawEndState = function drawEndState(g) {
12625 g.append('circle').style('stroke', 'black').style('fill', 'white').attr('r', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.sizeUnit + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.miniPadding).attr('cx', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.sizeUnit + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.miniPadding).attr('cy', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.sizeUnit + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.miniPadding);
12626 return g.append('circle').style('stroke', 'black').style('fill', 'black').attr('r', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.sizeUnit).attr('cx', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.sizeUnit + 2).attr('cy', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.sizeUnit + 2);
12627};
12628
12629var drawForkJoinState = function drawForkJoinState(g, stateDef) {
12630 var width = Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.forkWidth;
12631 var height = Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.forkHeight;
12632
12633 if (stateDef.parentId) {
12634 var tmp = width;
12635 width = height;
12636 height = tmp;
12637 }
12638
12639 return g.append('rect').style('stroke', 'black').style('fill', 'black').attr('width', width).attr('height', height).attr('x', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding);
12640};
12641
12642var drawText = function drawText(elem, textData) {
12643 // Remove and ignore br:s
12644 var nText = textData.text.replace(/<br\/?>/gi, ' ');
12645 var textElem = elem.append('text');
12646 textElem.attr('x', textData.x);
12647 textElem.attr('y', textData.y);
12648 textElem.style('text-anchor', textData.anchor);
12649 textElem.attr('fill', textData.fill);
12650
12651 if (typeof textData.class !== 'undefined') {
12652 textElem.attr('class', textData.class);
12653 }
12654
12655 var span = textElem.append('tspan');
12656 span.attr('x', textData.x + textData.textMargin * 2);
12657 span.attr('fill', textData.fill);
12658 span.text(nText);
12659 return textElem;
12660};
12661
12662var _drawLongText = function _drawLongText(_text, x, y, g) {
12663 var textHeight = 0;
12664 var textElem = g.append('text');
12665 textElem.style('text-anchor', 'start');
12666 textElem.attr('class', 'noteText');
12667
12668 var text = _text.replace(/\r\n/g, '<br/>');
12669
12670 text = text.replace(/\n/g, '<br/>');
12671 var lines = text.split(/<br\/?>/gi);
12672 var tHeight = 1.25 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.noteMargin;
12673 var _iteratorNormalCompletion = true;
12674 var _didIteratorError = false;
12675 var _iteratorError = undefined;
12676
12677 try {
12678 for (var _iterator = lines[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
12679 var line = _step.value;
12680 var txt = line.trim();
12681
12682 if (txt.length > 0) {
12683 var span = textElem.append('tspan');
12684 span.text(txt);
12685
12686 if (tHeight === 0) {
12687 var textBounds = span.node().getBBox();
12688 tHeight += textBounds.height;
12689 } // console.warn('textBounds', textBounds);
12690
12691
12692 textHeight += tHeight;
12693 span.attr('x', x + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.noteMargin);
12694 span.attr('y', y + textHeight + 1.25 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.noteMargin);
12695 }
12696 }
12697 } catch (err) {
12698 _didIteratorError = true;
12699 _iteratorError = err;
12700 } finally {
12701 try {
12702 if (!_iteratorNormalCompletion && _iterator.return != null) {
12703 _iterator.return();
12704 }
12705 } finally {
12706 if (_didIteratorError) {
12707 throw _iteratorError;
12708 }
12709 }
12710 }
12711
12712 return {
12713 textWidth: textElem.node().getBBox().width,
12714 textHeight: textHeight
12715 };
12716};
12717/**
12718 * Draws an actor in the diagram with the attaced line
12719 * @param center - The center of the the actor
12720 * @param pos The position if the actor in the liost of actors
12721 * @param description The text in the box
12722 */
12723
12724
12725var drawNote = function drawNote(text, g) {
12726 g.attr('class', 'state-note');
12727 var note = g.append('rect').attr('x', 0).attr('y', Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding);
12728 var rectElem = g.append('g');
12729
12730 var _drawLongText2 = _drawLongText(text, 0, 0, rectElem),
12731 textWidth = _drawLongText2.textWidth,
12732 textHeight = _drawLongText2.textHeight;
12733
12734 note.attr('height', textHeight + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.noteMargin);
12735 note.attr('width', textWidth + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.noteMargin * 2);
12736 return note;
12737};
12738/**
12739 * Starting point for drawing a state. The function finds out the specifics
12740 * about the state and renders with approprtiate function.
12741 * @param {*} elem
12742 * @param {*} stateDef
12743 */
12744
12745var drawState = function drawState(elem, stateDef) {
12746 var id = stateDef.id;
12747 var stateInfo = {
12748 id: id,
12749 label: stateDef.id,
12750 width: 0,
12751 height: 0
12752 };
12753 var g = elem.append('g').attr('id', id).attr('class', 'stateGroup');
12754 if (stateDef.type === 'start') drawStartState(g);
12755 if (stateDef.type === 'end') drawEndState(g);
12756 if (stateDef.type === 'fork' || stateDef.type === 'join') drawForkJoinState(g, stateDef);
12757 if (stateDef.type === 'note') drawNote(stateDef.note.text, g);
12758 if (stateDef.type === 'divider') drawDivider(g);
12759 if (stateDef.type === 'default' && stateDef.descriptions.length === 0) drawSimpleState(g, stateDef);
12760 if (stateDef.type === 'default' && stateDef.descriptions.length > 0) drawDescrState(g, stateDef);
12761 var stateBox = g.node().getBBox();
12762 stateInfo.width = stateBox.width + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding;
12763 stateInfo.height = stateBox.height + 2 * Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding;
12764 _id_cache_js__WEBPACK_IMPORTED_MODULE_1__["default"].set(id, stateInfo); // stateCnt++;
12765
12766 return stateInfo;
12767};
12768
12769var getRows = function getRows(s) {
12770 var str = s.replace(/<br\/?>/gi, '#br#');
12771 str = str.replace(/\\n/g, '#br#');
12772 return str.split('#br#');
12773};
12774
12775var edgeCount = 0;
12776var drawEdge = function drawEdge(elem, path, relation) {
12777 var getRelationType = function getRelationType(type) {
12778 switch (type) {
12779 case _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].relationType.AGGREGATION:
12780 return 'aggregation';
12781
12782 case _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].relationType.EXTENSION:
12783 return 'extension';
12784
12785 case _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].relationType.COMPOSITION:
12786 return 'composition';
12787
12788 case _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].relationType.DEPENDENCY:
12789 return 'dependency';
12790 }
12791 };
12792
12793 path.points = path.points.filter(function (p) {
12794 return !Number.isNaN(p.y);
12795 }); // The data for our line
12796
12797 var lineData = path.points; // This is the accessor function we talked about above
12798
12799 var lineFunction = d3__WEBPACK_IMPORTED_MODULE_0__["line"]().x(function (d) {
12800 return d.x;
12801 }).y(function (d) {
12802 return d.y;
12803 }).curve(d3__WEBPACK_IMPORTED_MODULE_0__["curveBasis"]);
12804 var svgPath = elem.append('path').attr('d', lineFunction(lineData)).attr('id', 'edge' + edgeCount).attr('class', 'transition');
12805 var url = '';
12806
12807 if (Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.arrowMarkerAbsolute) {
12808 url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search;
12809 url = url.replace(/\(/g, '\\(');
12810 url = url.replace(/\)/g, '\\)');
12811 }
12812
12813 svgPath.attr('marker-end', 'url(' + url + '#' + getRelationType(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].relationType.DEPENDENCY) + 'End' + ')');
12814
12815 if (typeof relation.title !== 'undefined') {
12816 var label = elem.append('g').attr('class', 'stateLabel');
12817
12818 var _utils$calcLabelPosit = _utils__WEBPACK_IMPORTED_MODULE_3__["default"].calcLabelPosition(path.points),
12819 x = _utils$calcLabelPosit.x,
12820 y = _utils$calcLabelPosit.y;
12821
12822 var rows = getRows(relation.title); // console.warn(rows);
12823
12824 var titleHeight = 0;
12825 var titleRows = [];
12826
12827 for (var i = 0; i <= rows.length; i++) {
12828 var title = label.append('text').attr('text-anchor', 'middle').text(rows[i]).attr('x', x).attr('y', y + titleHeight);
12829
12830 if (titleHeight === 0) {
12831 var titleBox = title.node().getBBox();
12832 titleHeight = titleBox.height;
12833 }
12834
12835 titleRows.push(title);
12836 }
12837
12838 if (rows.length > 1) {
12839 var heightAdj = rows.length * titleHeight * 0.25;
12840 titleRows.forEach(function (title, i) {
12841 return title.attr('y', y + i * titleHeight - heightAdj);
12842 });
12843 }
12844
12845 var bounds = label.node().getBBox();
12846 label.insert('rect', ':first-child').attr('class', 'box').attr('x', bounds.x - Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding / 2).attr('y', bounds.y - Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding / 2).attr('width', bounds.width + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding).attr('height', bounds.height + Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state.padding); //label.attr('transform', '0 -' + (bounds.y / 2));
12847 // Debug points
12848 // path.points.forEach(point => {
12849 // g.append('circle')
12850 // .style('stroke', 'red')
12851 // .style('fill', 'red')
12852 // .attr('r', 1)
12853 // .attr('cx', point.x)
12854 // .attr('cy', point.y);
12855 // });
12856 // g.append('circle')
12857 // .style('stroke', 'blue')
12858 // .style('fill', 'blue')
12859 // .attr('r', 1)
12860 // .attr('cx', x)
12861 // .attr('cy', y);
12862 }
12863
12864 edgeCount++;
12865};
12866
12867/***/ }),
12868
12869/***/ "./src/diagrams/state/stateDb.js":
12870/*!***************************************!*\
12871 !*** ./src/diagrams/state/stateDb.js ***!
12872 \***************************************/
12873/*! exports provided: addState, clear, getState, getStates, logDocuments, getRelations, addRelation, cleanupLabel, lineType, relationType, default */
12874/***/ (function(module, __webpack_exports__, __webpack_require__) {
12875
12876"use strict";
12877__webpack_require__.r(__webpack_exports__);
12878/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addState", function() { return addState; });
12879/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clear", function() { return clear; });
12880/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getState", function() { return getState; });
12881/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getStates", function() { return getStates; });
12882/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logDocuments", function() { return logDocuments; });
12883/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRelations", function() { return getRelations; });
12884/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addRelation", function() { return addRelation; });
12885/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cleanupLabel", function() { return cleanupLabel; });
12886/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lineType", function() { return lineType; });
12887/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "relationType", function() { return relationType; });
12888/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
12889function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
12890
12891
12892var rootDoc = [];
12893
12894var setRootDoc = function setRootDoc(o) {
12895 _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].info('Setting root doc', o);
12896 rootDoc = o;
12897};
12898
12899var getRootDoc = function getRootDoc() {
12900 return rootDoc;
12901};
12902
12903var extract = function extract(doc) {
12904 // const res = { states: [], relations: [] };
12905 clear();
12906 doc.forEach(function (item) {
12907 if (item.stmt === 'state') {
12908 addState(item.id, item.type, item.doc, item.description, item.note);
12909 }
12910
12911 if (item.stmt === 'relation') {
12912 addRelation(item.state1.id, item.state2.id, item.description);
12913 }
12914 });
12915};
12916
12917var newDoc = function newDoc() {
12918 return {
12919 relations: [],
12920 states: {},
12921 documents: {}
12922 };
12923};
12924
12925var documents = {
12926 root: newDoc()
12927};
12928var currentDocument = documents.root;
12929var startCnt = 0;
12930var endCnt = 0; // eslint-disable-line
12931// let stateCnt = 0;
12932
12933/**
12934 * Function called by parser when a node definition has been found.
12935 * @param id
12936 * @param text
12937 * @param type
12938 * @param style
12939 */
12940
12941var addState = function addState(id, type, doc, descr, note) {
12942 if (typeof currentDocument.states[id] === 'undefined') {
12943 currentDocument.states[id] = {
12944 id: id,
12945 descriptions: [],
12946 type: type,
12947 doc: doc,
12948 note: note
12949 };
12950 } else {
12951 if (!currentDocument.states[id].doc) {
12952 currentDocument.states[id].doc = doc;
12953 }
12954
12955 if (!currentDocument.states[id].type) {
12956 currentDocument.states[id].type = type;
12957 }
12958 }
12959
12960 if (descr) {
12961 if (typeof descr === 'string') addDescription(id, descr.trim());
12962
12963 if (_typeof(descr) === 'object') {
12964 descr.forEach(function (des) {
12965 return addDescription(id, des.trim());
12966 });
12967 }
12968 }
12969
12970 if (note) currentDocument.states[id].note = note;
12971};
12972var clear = function clear() {
12973 documents = {
12974 root: newDoc()
12975 };
12976 currentDocument = documents.root;
12977};
12978var getState = function getState(id) {
12979 return currentDocument.states[id];
12980};
12981var getStates = function getStates() {
12982 return currentDocument.states;
12983};
12984var logDocuments = function logDocuments() {
12985 _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].info('Documents = ', documents);
12986};
12987var getRelations = function getRelations() {
12988 return currentDocument.relations;
12989};
12990var addRelation = function addRelation(_id1, _id2, title) {
12991 var id1 = _id1;
12992 var id2 = _id2;
12993 var type1 = 'default';
12994 var type2 = 'default';
12995
12996 if (_id1 === '[*]') {
12997 startCnt++;
12998 id1 = 'start' + startCnt;
12999 type1 = 'start';
13000 }
13001
13002 if (_id2 === '[*]') {
13003 endCnt++;
13004 id2 = 'end' + startCnt;
13005 type2 = 'end';
13006 }
13007
13008 addState(id1, type1);
13009 addState(id2, type2);
13010 currentDocument.relations.push({
13011 id1: id1,
13012 id2: id2,
13013 title: title
13014 });
13015};
13016
13017var addDescription = function addDescription(id, _descr) {
13018 var theState = currentDocument.states[id];
13019 var descr = _descr;
13020
13021 if (descr[0] === ':') {
13022 descr = descr.substr(1).trim();
13023 }
13024
13025 theState.descriptions.push(descr);
13026};
13027
13028var cleanupLabel = function cleanupLabel(label) {
13029 if (label.substring(0, 1) === ':') {
13030 return label.substr(2).trim();
13031 } else {
13032 return label.trim();
13033 }
13034};
13035var lineType = {
13036 LINE: 0,
13037 DOTTED_LINE: 1
13038};
13039var dividerCnt = 0;
13040
13041var getDividerId = function getDividerId() {
13042 dividerCnt++;
13043 return 'divider-id-' + dividerCnt;
13044};
13045
13046var relationType = {
13047 AGGREGATION: 0,
13048 EXTENSION: 1,
13049 COMPOSITION: 2,
13050 DEPENDENCY: 3
13051};
13052/* harmony default export */ __webpack_exports__["default"] = ({
13053 addState: addState,
13054 clear: clear,
13055 getState: getState,
13056 getStates: getStates,
13057 getRelations: getRelations,
13058 addRelation: addRelation,
13059 getDividerId: getDividerId,
13060 // addDescription,
13061 cleanupLabel: cleanupLabel,
13062 lineType: lineType,
13063 relationType: relationType,
13064 logDocuments: logDocuments,
13065 getRootDoc: getRootDoc,
13066 setRootDoc: setRootDoc,
13067 extract: extract
13068});
13069
13070/***/ }),
13071
13072/***/ "./src/diagrams/state/stateRenderer.js":
13073/*!*********************************************!*\
13074 !*** ./src/diagrams/state/stateRenderer.js ***!
13075 \*********************************************/
13076/*! exports provided: setConf, draw, default */
13077/***/ (function(module, __webpack_exports__, __webpack_require__) {
13078
13079"use strict";
13080__webpack_require__.r(__webpack_exports__);
13081/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; });
13082/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; });
13083/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
13084/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
13085/* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dagre */ "dagre");
13086/* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dagre__WEBPACK_IMPORTED_MODULE_1__);
13087/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! graphlib */ "graphlib");
13088/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(graphlib__WEBPACK_IMPORTED_MODULE_2__);
13089/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
13090/* harmony import */ var _stateDb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./stateDb */ "./src/diagrams/state/stateDb.js");
13091/* harmony import */ var _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./parser/stateDiagram */ "./src/diagrams/state/parser/stateDiagram.jison");
13092/* harmony import */ var _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_5__);
13093/* harmony import */ var _shapes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./shapes */ "./src/diagrams/state/shapes.js");
13094/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../config */ "./src/config.js");
13095
13096
13097
13098
13099
13100 // import idCache from './id-cache';
13101
13102
13103
13104_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_5__["parser"].yy = _stateDb__WEBPACK_IMPORTED_MODULE_4__["default"]; // TODO Move conf object to main conf in mermaidAPI
13105
13106var conf;
13107var transformationLog = {};
13108var setConf = function setConf() {}; // Todo optimize
13109
13110/**
13111 * Setup arrow head and define the marker. The result is appended to the svg.
13112 */
13113
13114var insertMarkers = function insertMarkers(elem) {
13115 elem.append('defs').append('marker').attr('id', 'dependencyEnd').attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 19,7 L9,13 L14,7 L9,1 Z');
13116};
13117/**
13118 * Draws a flowchart in the tag with id: id based on the graph definition in text.
13119 * @param text
13120 * @param id
13121 */
13122
13123
13124var draw = function draw(text, id) {
13125 conf = Object(_config__WEBPACK_IMPORTED_MODULE_7__["getConfig"])().state;
13126 _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_5__["parser"].yy.clear();
13127 _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_5__["parser"].parse(text);
13128 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Rendering diagram ' + text); // Fetch the default direction, use TD if none was found
13129
13130 var diagram = d3__WEBPACK_IMPORTED_MODULE_0__["select"]("[id='".concat(id, "']"));
13131 insertMarkers(diagram); // Layout graph, Create a new directed graph
13132
13133 var graph = new graphlib__WEBPACK_IMPORTED_MODULE_2___default.a.Graph({
13134 multigraph: false,
13135 compound: true,
13136 // acyclicer: 'greedy',
13137 rankdir: 'RL' // ranksep: '20'
13138
13139 }); // Default to assigning a new object as a label for each new edge.
13140
13141 graph.setDefaultEdgeLabel(function () {
13142 return {};
13143 });
13144 var rootDoc = _stateDb__WEBPACK_IMPORTED_MODULE_4__["default"].getRootDoc();
13145 renderDoc(rootDoc, diagram, undefined, false);
13146 var padding = conf.padding;
13147 var bounds = diagram.node().getBBox();
13148 var width = bounds.width + padding * 2;
13149 var height = bounds.height + padding * 2; // diagram.attr('height', '100%');
13150 // diagram.attr('style', `width: ${bounds.width * 3 + conf.padding * 2};`);
13151 // diagram.attr('height', height);
13152 // Zoom in a bit
13153
13154 diagram.attr('width', width * 1.75); // diagram.attr('height', bounds.height * 3 + conf.padding * 2);
13155
13156 diagram.attr('viewBox', "".concat(bounds.x - conf.padding, " ").concat(bounds.y - conf.padding, " ") + width + ' ' + height); // diagram.attr('transform', `translate(, 0)`);
13157 // diagram.attr(
13158 // 'viewBox',
13159 // `${conf.padding * -1} ${conf.padding * -1} ` +
13160 // (bounds.width * 1.5 + conf.padding * 2) +
13161 // ' ' +
13162 // (bounds.height + conf.padding * 5)
13163 // );
13164};
13165
13166var getLabelWidth = function getLabelWidth(text) {
13167 return text ? text.length * conf.fontSizeFactor : 1;
13168};
13169/* TODO: REMOVE DUPLICATION, SEE SHAPES */
13170
13171
13172var getRows = function getRows(s) {
13173 if (!s) return 1;
13174 var str = s.replace(/<br\/?>/gi, '#br#');
13175 str = str.replace(/\\n/g, '#br#');
13176 return str.split('#br#');
13177};
13178
13179var renderDoc = function renderDoc(doc, diagram, parentId, altBkg) {
13180 // // Layout graph, Create a new directed graph
13181 var graph = new graphlib__WEBPACK_IMPORTED_MODULE_2___default.a.Graph({
13182 compound: true
13183 });
13184 var i;
13185 var edgeFreeDoc = true;
13186
13187 for (i = 0; i < doc.length; i++) {
13188 if (doc[i].stmt === 'relation') {
13189 edgeFreeDoc = false;
13190 break;
13191 }
13192 } // Set an object for the graph label
13193
13194
13195 if (parentId) graph.setGraph({
13196 rankdir: 'LR',
13197 // multigraph: false,
13198 compound: true,
13199 // acyclicer: 'greedy',
13200 ranker: 'tight-tree',
13201 ranksep: edgeFreeDoc ? 1 : conf.edgeLengthFactor,
13202 nodeSep: edgeFreeDoc ? 1 : 50 // isMultiGraph: false
13203 // ranksep: 5,
13204 // nodesep: 1
13205
13206 });else {
13207 graph.setGraph({
13208 rankdir: 'TB',
13209 compound: true,
13210 // isCompound: true,
13211 // acyclicer: 'greedy',
13212 // ranker: 'longest-path'
13213 ranksep: edgeFreeDoc ? 1 : conf.edgeLengthFactor,
13214 nodeSep: edgeFreeDoc ? 1 : 50,
13215 ranker: 'tight-tree' // ranker: 'network-simplex'
13216 // isMultiGraph: false
13217
13218 });
13219 } // Default to assigning a new object as a label for each new edge.
13220
13221 graph.setDefaultEdgeLabel(function () {
13222 return {};
13223 });
13224 _stateDb__WEBPACK_IMPORTED_MODULE_4__["default"].extract(doc);
13225 var states = _stateDb__WEBPACK_IMPORTED_MODULE_4__["default"].getStates();
13226 var relations = _stateDb__WEBPACK_IMPORTED_MODULE_4__["default"].getRelations();
13227 var keys = Object.keys(states);
13228 var first = true;
13229
13230 for (var _i = 0; _i < keys.length; _i++) {
13231 var stateDef = states[keys[_i]];
13232
13233 if (parentId) {
13234 stateDef.parentId = parentId;
13235 }
13236
13237 var node = void 0;
13238
13239 if (stateDef.doc) {
13240 var sub = diagram.append('g').attr('id', stateDef.id).attr('class', 'stateGroup');
13241 node = renderDoc(stateDef.doc, sub, stateDef.id, !altBkg);
13242
13243 if (first) {
13244 // first = false;
13245 sub = Object(_shapes__WEBPACK_IMPORTED_MODULE_6__["addTitleAndBox"])(sub, stateDef, altBkg);
13246 var boxBounds = sub.node().getBBox();
13247 node.width = boxBounds.width;
13248 node.height = boxBounds.height + conf.padding / 2;
13249 transformationLog[stateDef.id] = {
13250 y: conf.compositTitleSize
13251 };
13252 } else {
13253 // sub = addIdAndBox(sub, stateDef);
13254 var _boxBounds = sub.node().getBBox();
13255
13256 node.width = _boxBounds.width;
13257 node.height = _boxBounds.height; // transformationLog[stateDef.id] = { y: conf.compositTitleSize };
13258 }
13259 } else {
13260 node = Object(_shapes__WEBPACK_IMPORTED_MODULE_6__["drawState"])(diagram, stateDef, graph);
13261 }
13262
13263 if (stateDef.note) {
13264 // Draw note note
13265 var noteDef = {
13266 descriptions: [],
13267 id: stateDef.id + '-note',
13268 note: stateDef.note,
13269 type: 'note'
13270 };
13271 var note = Object(_shapes__WEBPACK_IMPORTED_MODULE_6__["drawState"])(diagram, noteDef, graph); // graph.setNode(node.id, node);
13272
13273 if (stateDef.note.position === 'left of') {
13274 graph.setNode(node.id + '-note', note);
13275 graph.setNode(node.id, node);
13276 } else {
13277 graph.setNode(node.id, node);
13278 graph.setNode(node.id + '-note', note);
13279 } // graph.setNode(node.id);
13280
13281
13282 graph.setParent(node.id, node.id + '-group');
13283 graph.setParent(node.id + '-note', node.id + '-group');
13284 } else {
13285 // Add nodes to the graph. The first argument is the node id. The second is
13286 // metadata about the node. In this case we're going to add labels to each of
13287 // our nodes.
13288 graph.setNode(node.id, node);
13289 }
13290 }
13291
13292 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('Count=', graph.nodeCount());
13293 relations.forEach(function (relation) {
13294 graph.setEdge(relation.id1, relation.id2, {
13295 relation: relation,
13296 width: getLabelWidth(relation.title),
13297 height: conf.labelHeight * getRows(relation.title).length,
13298 labelpos: 'c'
13299 });
13300 });
13301 dagre__WEBPACK_IMPORTED_MODULE_1___default.a.layout(graph);
13302 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Graph after layout', graph.nodes());
13303 var svgElem = diagram.node();
13304 graph.nodes().forEach(function (v) {
13305 if (typeof v !== 'undefined' && typeof graph.node(v) !== 'undefined') {
13306 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].warn('Node ' + v + ': ' + JSON.stringify(graph.node(v)));
13307 d3__WEBPACK_IMPORTED_MODULE_0__["select"]('#' + svgElem.id + ' #' + v).attr('transform', 'translate(' + (graph.node(v).x - graph.node(v).width / 2) + ',' + (graph.node(v).y + (transformationLog[v] ? transformationLog[v].y : 0) - graph.node(v).height / 2) + ' )');
13308 d3__WEBPACK_IMPORTED_MODULE_0__["select"]('#' + svgElem.id + ' #' + v).attr('data-x-shift', graph.node(v).x - graph.node(v).width / 2);
13309 var dividers = document.querySelectorAll('#' + svgElem.id + ' #' + v + ' .divider');
13310 dividers.forEach(function (divider) {
13311 var parent = divider.parentElement;
13312 var pWidth = 0;
13313 var pShift = 0;
13314
13315 if (parent) {
13316 if (parent.parentElement) pWidth = parent.parentElement.getBBox().width;
13317 pShift = parseInt(parent.getAttribute('data-x-shift'), 10);
13318
13319 if (Number.isNaN(pShift)) {
13320 pShift = 0;
13321 }
13322 }
13323
13324 divider.setAttribute('x1', 0 - pShift + 8);
13325 divider.setAttribute('x2', pWidth - pShift - 8);
13326 });
13327 } else {
13328 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('No Node ' + v + ': ' + JSON.stringify(graph.node(v)));
13329 }
13330 });
13331 var stateBox = svgElem.getBBox();
13332 graph.edges().forEach(function (e) {
13333 if (typeof e !== 'undefined' && typeof graph.edge(e) !== 'undefined') {
13334 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(graph.edge(e)));
13335 Object(_shapes__WEBPACK_IMPORTED_MODULE_6__["drawEdge"])(diagram, graph.edge(e), graph.edge(e).relation);
13336 }
13337 });
13338 stateBox = svgElem.getBBox();
13339 var stateInfo = {
13340 id: parentId ? parentId : 'root',
13341 label: parentId ? parentId : 'root',
13342 width: 0,
13343 height: 0
13344 };
13345 stateInfo.width = stateBox.width + 2 * conf.padding;
13346 stateInfo.height = stateBox.height + 2 * conf.padding;
13347 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('Doc rendered', stateInfo, graph);
13348 return stateInfo;
13349};
13350
13351/* harmony default export */ __webpack_exports__["default"] = ({
13352 setConf: setConf,
13353 draw: draw
13354});
13355
13356/***/ }),
13357
13358/***/ "./src/logger.js":
13359/*!***********************!*\
13360 !*** ./src/logger.js ***!
13361 \***********************/
13362/*! exports provided: LEVELS, logger, setLogLevel */
13363/***/ (function(module, __webpack_exports__, __webpack_require__) {
13364
13365"use strict";
13366__webpack_require__.r(__webpack_exports__);
13367/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LEVELS", function() { return LEVELS; });
13368/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logger", function() { return logger; });
13369/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLogLevel", function() { return setLogLevel; });
13370/* harmony import */ var moment_mini__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment-mini */ "moment-mini");
13371/* harmony import */ var moment_mini__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment_mini__WEBPACK_IMPORTED_MODULE_0__);
13372
13373var LEVELS = {
13374 debug: 1,
13375 info: 2,
13376 warn: 3,
13377 error: 4,
13378 fatal: 5
13379};
13380var logger = {
13381 debug: function debug() {},
13382 info: function info() {},
13383 warn: function warn() {},
13384 error: function error() {},
13385 fatal: function fatal() {}
13386};
13387var setLogLevel = function setLogLevel(level) {
13388 logger.debug = function () {};
13389
13390 logger.info = function () {};
13391
13392 logger.warn = function () {};
13393
13394 logger.error = function () {};
13395
13396 logger.fatal = function () {};
13397
13398 if (level <= LEVELS.fatal) {
13399 logger.fatal = console.error ? console.error.bind(console, format('FATAL'), 'color: orange') : console.log.bind(console, '\x1b[35m', format('FATAL'));
13400 }
13401
13402 if (level <= LEVELS.error) {
13403 logger.error = console.error ? console.error.bind(console, format('ERROR'), 'color: orange') : console.log.bind(console, '\x1b[31m', format('ERROR'));
13404 }
13405
13406 if (level <= LEVELS.warn) {
13407 logger.warn = console.warn ? console.warn.bind(console, format('WARN'), 'color: orange') : console.log.bind(console, "\x1B[33m", format('WARN'));
13408 }
13409
13410 if (level <= LEVELS.info) {
13411 logger.info = console.info ? // ? console.info.bind(console, '\x1b[34m', format('INFO'), 'color: blue')
13412 console.info.bind(console, format('INFO'), 'color: lightblue') : console.log.bind(console, '\x1b[34m', format('INFO'));
13413 }
13414
13415 if (level <= LEVELS.debug) {
13416 logger.debug = console.debug ? console.debug.bind(console, format('DEBUG'), 'color: lightgreen') : console.log.bind(console, '\x1b[32m', format('DEBUG'));
13417 }
13418};
13419
13420var format = function format(level) {
13421 var time = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()().format('ss.SSS');
13422 return "%c".concat(time, " : ").concat(level, " : ");
13423};
13424
13425/***/ }),
13426
13427/***/ "./src/mermaidAPI.js":
13428/*!***************************!*\
13429 !*** ./src/mermaidAPI.js ***!
13430 \***************************/
13431/*! exports provided: encodeEntities, decodeEntities, default */
13432/***/ (function(module, __webpack_exports__, __webpack_require__) {
13433
13434"use strict";
13435__webpack_require__.r(__webpack_exports__);
13436/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "encodeEntities", function() { return encodeEntities; });
13437/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "decodeEntities", function() { return decodeEntities; });
13438/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
13439/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
13440/* harmony import */ var scope_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! scope-css */ "scope-css");
13441/* harmony import */ var scope_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(scope_css__WEBPACK_IMPORTED_MODULE_1__);
13442/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../package.json */ "./package.json");
13443var _package_json__WEBPACK_IMPORTED_MODULE_2___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../package.json */ "./package.json", 1);
13444/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./config */ "./src/config.js");
13445/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./logger */ "./src/logger.js");
13446/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils */ "./src/utils.js");
13447/* harmony import */ var _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./diagrams/flowchart/flowRenderer */ "./src/diagrams/flowchart/flowRenderer.js");
13448/* harmony import */ var _diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./diagrams/flowchart/parser/flow */ "./src/diagrams/flowchart/parser/flow.jison");
13449/* harmony import */ var _diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7__);
13450/* harmony import */ var _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./diagrams/flowchart/flowDb */ "./src/diagrams/flowchart/flowDb.js");
13451/* harmony import */ var _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./diagrams/sequence/sequenceRenderer */ "./src/diagrams/sequence/sequenceRenderer.js");
13452/* harmony import */ var _diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./diagrams/sequence/parser/sequenceDiagram */ "./src/diagrams/sequence/parser/sequenceDiagram.jison");
13453/* harmony import */ var _diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_10__);
13454/* harmony import */ var _diagrams_sequence_sequenceDb__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./diagrams/sequence/sequenceDb */ "./src/diagrams/sequence/sequenceDb.js");
13455/* harmony import */ var _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./diagrams/gantt/ganttRenderer */ "./src/diagrams/gantt/ganttRenderer.js");
13456/* harmony import */ var _diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./diagrams/gantt/parser/gantt */ "./src/diagrams/gantt/parser/gantt.jison");
13457/* harmony import */ var _diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_13__);
13458/* harmony import */ var _diagrams_gantt_ganttDb__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./diagrams/gantt/ganttDb */ "./src/diagrams/gantt/ganttDb.js");
13459/* harmony import */ var _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./diagrams/class/classRenderer */ "./src/diagrams/class/classRenderer.js");
13460/* harmony import */ var _diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./diagrams/class/parser/classDiagram */ "./src/diagrams/class/parser/classDiagram.jison");
13461/* harmony import */ var _diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_16__);
13462/* harmony import */ var _diagrams_class_classDb__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./diagrams/class/classDb */ "./src/diagrams/class/classDb.js");
13463/* harmony import */ var _diagrams_state_stateRenderer__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./diagrams/state/stateRenderer */ "./src/diagrams/state/stateRenderer.js");
13464/* harmony import */ var _diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./diagrams/state/parser/stateDiagram */ "./src/diagrams/state/parser/stateDiagram.jison");
13465/* harmony import */ var _diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_19__);
13466/* harmony import */ var _diagrams_state_stateDb__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./diagrams/state/stateDb */ "./src/diagrams/state/stateDb.js");
13467/* harmony import */ var _diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./diagrams/git/gitGraphRenderer */ "./src/diagrams/git/gitGraphRenderer.js");
13468/* harmony import */ var _diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./diagrams/git/parser/gitGraph */ "./src/diagrams/git/parser/gitGraph.jison");
13469/* harmony import */ var _diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(_diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_22__);
13470/* harmony import */ var _diagrams_git_gitGraphAst__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./diagrams/git/gitGraphAst */ "./src/diagrams/git/gitGraphAst.js");
13471/* harmony import */ var _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./diagrams/info/infoRenderer */ "./src/diagrams/info/infoRenderer.js");
13472/* harmony import */ var _diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./diagrams/info/parser/info */ "./src/diagrams/info/parser/info.jison");
13473/* harmony import */ var _diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(_diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_25__);
13474/* harmony import */ var _diagrams_info_infoDb__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./diagrams/info/infoDb */ "./src/diagrams/info/infoDb.js");
13475/* harmony import */ var _diagrams_pie_pieRenderer__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./diagrams/pie/pieRenderer */ "./src/diagrams/pie/pieRenderer.js");
13476/* harmony import */ var _diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./diagrams/pie/parser/pie */ "./src/diagrams/pie/parser/pie.jison");
13477/* harmony import */ var _diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_28___default = /*#__PURE__*/__webpack_require__.n(_diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_28__);
13478/* harmony import */ var _diagrams_pie_pieDb__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./diagrams/pie/pieDb */ "./src/diagrams/pie/pieDb.js");
13479function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
13480
13481/**
13482 * This is the api to be used when optionally handling the integration with the web page, instead of using the default integration provided by mermaid.js.
13483 *
13484 * The core of this api is the [**render**](https://github.com/knsv/mermaid/blob/master/docs/mermaidAPI.md#render) function which, given a graph
13485 * definition as text, renders the graph/diagram and returns an svg element for the graph.
13486 *
13487 * It is is then up to the user of the API to make use of the svg, either insert it somewhere in the page or do something completely different.
13488 *
13489 * In addition to the render function, a number of behavioral configuration options are available.
13490 *
13491 * @name mermaidAPI
13492 */
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523var themes = {};
13524
13525for (var _i = 0, _arr = ['default', 'forest', 'dark', 'neutral']; _i < _arr.length; _i++) {
13526 var themeName = _arr[_i];
13527 themes[themeName] = __webpack_require__("./src/themes sync recursive ^\\.\\/.*\\/index\\.scss$")("./".concat(themeName, "/index.scss"));
13528}
13529/**
13530 * These are the default options which can be overridden with the initialization call like so:
13531 * **Example 1:**
13532 * <pre>
13533 * mermaid.initialize({
13534 * flowchart:{
13535 * htmlLabels: false
13536 * }
13537 * });
13538 * </pre>
13539 *
13540 * **Example 2:**
13541 * <pre>
13542 * <script>
13543 * var config = {
13544 * startOnLoad:true,
13545 * flowchart:{
13546 * useMaxWidth:true,
13547 * htmlLabels:true,
13548 * curve:'cardinal',
13549 * },
13550 *
13551 * securityLevel:'loose',
13552 * };
13553 * mermaid.initialize(config);
13554 * </script>
13555 * </pre>
13556 * A summary of all options and their defaults is found [here](https://github.com/knsv/mermaid/blob/master/docs/mermaidAPI.md#mermaidapi-configuration-defaults). A description of each option follows below.
13557 *
13558 * @name Configuration
13559 */
13560
13561
13562var config = {
13563 /** theme , the CSS style sheet
13564 *
13565 * **theme** - Choose one of the built-in themes:
13566 * * default
13567 * * forest
13568 * * dark
13569 * * neutral.
13570 * To disable any pre-defined mermaid theme, use "null".
13571 *
13572 * **themeCSS** - Use your own CSS. This overrides **theme**.
13573 * <pre>
13574 * "theme": "forest",
13575 * "themeCSS": ".node rect { fill: red; }"
13576 * </pre>
13577 */
13578 theme: 'default',
13579 themeCSS: undefined,
13580
13581 /**
13582 * **fontFamily** The font to be used for the rendered diagrams. Default value is \"trebuchet ms\", verdana, arial;
13583 */
13584 fontFamily: '"trebuchet ms", verdana, arial;',
13585
13586 /**
13587 * This option decides the amount of logging to be used.
13588 * * debug: 1
13589 * * info: 2
13590 * * warn: 3
13591 * * error: 4
13592 * * fatal: (**default**) 5
13593 */
13594 logLevel: 5,
13595
13596 /**
13597 * Sets the level of trust to be used on the parsed diagrams.
13598 * * **strict**: (**default**) tags in text are encoded, click functionality is disabeled
13599 * * **loose**: tags in text are allowed, click functionality is enabled
13600 */
13601 securityLevel: 'strict',
13602
13603 /**
13604 * This options controls whether or mermaid starts when the page loads
13605 * **Default value true**.
13606 */
13607 startOnLoad: true,
13608
13609 /**
13610 * This options controls whether or arrow markers in html code will be absolute paths or
13611 * an anchor, #. This matters if you are using base tag settings.
13612 * **Default value false**.
13613 */
13614 arrowMarkerAbsolute: false,
13615
13616 /**
13617 * The object containing configurations specific for flowcharts
13618 */
13619 flowchart: {
13620 /**
13621 * Flag for setting whether or not a html tag should be used for rendering labels
13622 * on the edges.
13623 * **Default value true**.
13624 */
13625 htmlLabels: true,
13626
13627 /**
13628 * How mermaid renders curves for flowcharts. Possible values are
13629 * * basis
13630 * * linear **default**
13631 * * cardinal
13632 */
13633 curve: 'linear'
13634 },
13635
13636 /**
13637 * The object containing configurations specific for sequence diagrams
13638 */
13639 sequence: {
13640 /**
13641 * margin to the right and left of the sequence diagram.
13642 * **Default value 50**.
13643 */
13644 diagramMarginX: 50,
13645
13646 /**
13647 * margin to the over and under the sequence diagram.
13648 * **Default value 10**.
13649 */
13650 diagramMarginY: 10,
13651
13652 /**
13653 * Margin between actors.
13654 * **Default value 50**.
13655 */
13656 actorMargin: 50,
13657
13658 /**
13659 * Width of actor boxes
13660 * **Default value 150**.
13661 */
13662 width: 150,
13663
13664 /**
13665 * Height of actor boxes
13666 * **Default value 65**.
13667 */
13668 height: 65,
13669
13670 /**
13671 * Margin around loop boxes
13672 * **Default value 10**.
13673 */
13674 boxMargin: 10,
13675
13676 /**
13677 * margin around the text in loop/alt/opt boxes
13678 * **Default value 5**.
13679 */
13680 boxTextMargin: 5,
13681
13682 /**
13683 * margin around notes.
13684 * **Default value 10**.
13685 */
13686 noteMargin: 10,
13687
13688 /**
13689 * Space between messages.
13690 * **Default value 35**.
13691 */
13692 messageMargin: 35,
13693
13694 /**
13695 * mirror actors under diagram.
13696 * **Default value true**.
13697 */
13698 mirrorActors: true,
13699
13700 /**
13701 * Depending on css styling this might need adjustment.
13702 * Prolongs the edge of the diagram downwards.
13703 * **Default value 1**.
13704 */
13705 bottomMarginAdj: 1,
13706
13707 /**
13708 * when this flag is set the height and width is set to 100% and is then scaling with the
13709 * available space if not the absolute space required is used.
13710 * **Default value true**.
13711 */
13712 useMaxWidth: true,
13713
13714 /**
13715 * This will display arrows that start and begin at the same node as right angles, rather than a curve
13716 * **Default value false**.
13717 */
13718 rightAngles: false,
13719
13720 /**
13721 * This will show the node numbers
13722 * **Default value false**.
13723 */
13724 showSequenceNumbers: false
13725 },
13726
13727 /**
13728 * The object containing configurations specific for gantt diagrams*
13729 */
13730 gantt: {
13731 /**
13732 * Margin top for the text over the gantt diagram
13733 * **Default value 25**.
13734 */
13735 titleTopMargin: 25,
13736
13737 /**
13738 * The height of the bars in the graph
13739 * **Default value 20**.
13740 */
13741 barHeight: 20,
13742
13743 /**
13744 * The margin between the different activities in the gantt diagram.
13745 * **Default value 4**.
13746 */
13747 barGap: 4,
13748
13749 /**
13750 * Margin between title and gantt diagram and between axis and gantt diagram.
13751 * **Default value 50**.
13752 */
13753 topPadding: 50,
13754
13755 /**
13756 * The space allocated for the section name to the left of the activities.
13757 * **Default value 75**.
13758 */
13759 leftPadding: 75,
13760
13761 /**
13762 * Vertical starting position of the grid lines.
13763 * **Default value 35**.
13764 */
13765 gridLineStartPadding: 35,
13766
13767 /**
13768 * Font size ...
13769 * **Default value 11**.
13770 */
13771 fontSize: 11,
13772
13773 /**
13774 * font family ...
13775 * **Default value '"Open-Sans", "sans-serif"'**.
13776 */
13777 fontFamily: '"Open-Sans", "sans-serif"',
13778
13779 /**
13780 * The number of alternating section styles.
13781 * **Default value 4**.
13782 */
13783 numberSectionStyles: 4,
13784
13785 /**
13786 * Datetime format of the axis. This might need adjustment to match your locale and preferences
13787 * **Default value '%Y-%m-%d'**.
13788 */
13789 axisFormat: '%Y-%m-%d'
13790 },
13791 class: {},
13792 git: {},
13793 state: {
13794 dividerMargin: 10,
13795 sizeUnit: 5,
13796 padding: 8,
13797 textHeight: 10,
13798 titleShift: -15,
13799 noteMargin: 10,
13800 forkWidth: 70,
13801 forkHeight: 7,
13802 // Used
13803 miniPadding: 2,
13804 // Font size factor, this is used to guess the width of the edges labels before rendering by dagre
13805 // layout. This might need updating if/when switching font
13806 fontSizeFactor: 5.02,
13807 fontSize: 24,
13808 labelHeight: 16,
13809 edgeLengthFactor: '20',
13810 compositTitleSize: 35,
13811 radius: 5
13812 }
13813};
13814Object(_logger__WEBPACK_IMPORTED_MODULE_4__["setLogLevel"])(config.logLevel);
13815Object(_config__WEBPACK_IMPORTED_MODULE_3__["setConfig"])(config);
13816
13817function parse(text) {
13818 var graphType = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].detectType(text);
13819 var parser;
13820 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('Type ' + graphType);
13821
13822 switch (graphType) {
13823 case 'git':
13824 parser = _diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_22___default.a;
13825 parser.parser.yy = _diagrams_git_gitGraphAst__WEBPACK_IMPORTED_MODULE_23__["default"];
13826 break;
13827
13828 case 'flowchart':
13829 _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__["default"].clear();
13830 parser = _diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7___default.a;
13831 parser.parser.yy = _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__["default"];
13832 break;
13833
13834 case 'sequence':
13835 parser = _diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_10___default.a;
13836 parser.parser.yy = _diagrams_sequence_sequenceDb__WEBPACK_IMPORTED_MODULE_11__["default"];
13837 break;
13838
13839 case 'gantt':
13840 parser = _diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_13___default.a;
13841 parser.parser.yy = _diagrams_gantt_ganttDb__WEBPACK_IMPORTED_MODULE_14__["default"];
13842 break;
13843
13844 case 'class':
13845 parser = _diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_16___default.a;
13846 parser.parser.yy = _diagrams_class_classDb__WEBPACK_IMPORTED_MODULE_17__["default"];
13847 break;
13848
13849 case 'state':
13850 parser = _diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_19___default.a;
13851 parser.parser.yy = _diagrams_state_stateDb__WEBPACK_IMPORTED_MODULE_20__["default"];
13852 break;
13853
13854 case 'info':
13855 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('info info info');
13856 parser = _diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_25___default.a;
13857 parser.parser.yy = _diagrams_info_infoDb__WEBPACK_IMPORTED_MODULE_26__["default"];
13858 break;
13859
13860 case 'pie':
13861 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('pie');
13862 parser = _diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_28___default.a;
13863 parser.parser.yy = _diagrams_pie_pieDb__WEBPACK_IMPORTED_MODULE_29__["default"];
13864 break;
13865 }
13866
13867 parser.parser.yy.parseError = function (str, hash) {
13868 var error = {
13869 str: str,
13870 hash: hash
13871 };
13872 throw error;
13873 };
13874
13875 parser.parse(text);
13876}
13877
13878var encodeEntities = function encodeEntities(text) {
13879 var txt = text;
13880 txt = txt.replace(/style.*:\S*#.*;/g, function (s) {
13881 var innerTxt = s.substring(0, s.length - 1);
13882 return innerTxt;
13883 });
13884 txt = txt.replace(/classDef.*:\S*#.*;/g, function (s) {
13885 var innerTxt = s.substring(0, s.length - 1);
13886 return innerTxt;
13887 });
13888 txt = txt.replace(/#\w+;/g, function (s) {
13889 var innerTxt = s.substring(1, s.length - 1);
13890 var isInt = /^\+?\d+$/.test(innerTxt);
13891
13892 if (isInt) {
13893 return 'fl°°' + innerTxt + '¶ß';
13894 } else {
13895 return 'fl°' + innerTxt + '¶ß';
13896 }
13897 });
13898 return txt;
13899};
13900var decodeEntities = function decodeEntities(text) {
13901 var txt = text;
13902 txt = txt.replace(/fl°°/g, function () {
13903 return '&#';
13904 });
13905 txt = txt.replace(/fl°/g, function () {
13906 return '&';
13907 });
13908 txt = txt.replace(/¶ß/g, function () {
13909 return ';';
13910 });
13911 return txt;
13912};
13913/**
13914 * Function that renders an svg with a graph from a chart definition. Usage example below.
13915 *
13916 * ```js
13917 * mermaidAPI.initialize({
13918 * startOnLoad:true
13919 * });
13920 * $(function(){
13921 * const graphDefinition = 'graph TB\na-->b';
13922 * const cb = function(svgGraph){
13923 * console.log(svgGraph);
13924 * };
13925 * mermaidAPI.render('id1',graphDefinition,cb);
13926 * });
13927 *```
13928 * @param id the id of the element to be rendered
13929 * @param txt the graph definition
13930 * @param cb callback which is called after rendering is finished with the svg code as inparam.
13931 * @param container selector to element in which a div with the graph temporarily will be inserted. In one is
13932 * provided a hidden div will be inserted in the body of the page instead. The element will be removed when rendering is
13933 * completed.
13934 */
13935
13936var render = function render(id, txt, cb, container) {
13937 if (typeof container !== 'undefined') {
13938 container.innerHTML = '';
13939 d3__WEBPACK_IMPORTED_MODULE_0__["select"](container).append('div').attr('id', 'd' + id).attr('style', 'font-family: ' + config.fontFamily).append('svg').attr('id', id).attr('width', '100%').attr('xmlns', 'http://www.w3.org/2000/svg').append('g');
13940 } else {
13941 var existingSvg = document.getElementById(id);
13942
13943 if (existingSvg) {
13944 existingSvg.remove();
13945 }
13946
13947 var _element = document.querySelector('#' + 'd' + id);
13948
13949 if (_element) {
13950 _element.innerHTML = '';
13951 }
13952
13953 d3__WEBPACK_IMPORTED_MODULE_0__["select"]('body').append('div').attr('id', 'd' + id).append('svg').attr('id', id).attr('width', '100%').attr('xmlns', 'http://www.w3.org/2000/svg').append('g');
13954 }
13955
13956 window.txt = txt;
13957 txt = encodeEntities(txt);
13958 var element = d3__WEBPACK_IMPORTED_MODULE_0__["select"]('#d' + id).node();
13959 var graphType = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].detectType(txt); // insert inline style into svg
13960
13961 var svg = element.firstChild;
13962 var firstChild = svg.firstChild; // pre-defined theme
13963
13964 var style = themes[config.theme];
13965
13966 if (style === undefined) {
13967 style = '';
13968 } // user provided theme CSS
13969
13970
13971 if (config.themeCSS !== undefined) {
13972 style += "\n".concat(config.themeCSS);
13973 } // user provided theme CSS
13974
13975
13976 if (config.fontFamily !== undefined) {
13977 style += "\n:root { --mermaid-font-family: ".concat(config.fontFamily, "}");
13978 } // user provided theme CSS
13979
13980
13981 if (config.altFontFamily !== undefined) {
13982 style += "\n:root { --mermaid-alt-font-family: ".concat(config.altFontFamily, "}");
13983 } // classDef
13984
13985
13986 if (graphType === 'flowchart') {
13987 var classes = _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_6__["default"].getClasses(txt);
13988
13989 for (var className in classes) {
13990 style += "\n.".concat(className, " > * { ").concat(classes[className].styles.join(' !important; '), " !important; }");
13991 }
13992 }
13993
13994 var style1 = document.createElement('style');
13995 style1.innerHTML = scope_css__WEBPACK_IMPORTED_MODULE_1___default()(style, "#".concat(id));
13996 svg.insertBefore(style1, firstChild);
13997 var style2 = document.createElement('style');
13998 var cs = window.getComputedStyle(svg);
13999 style2.innerHTML = "#".concat(id, " {\n color: ").concat(cs.color, ";\n font: ").concat(cs.font, ";\n }");
14000 svg.insertBefore(style2, firstChild);
14001
14002 switch (graphType) {
14003 case 'git':
14004 config.flowchart.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
14005 _diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_21__["default"].setConf(config.git);
14006 _diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_21__["default"].draw(txt, id, false);
14007 break;
14008
14009 case 'flowchart':
14010 config.flowchart.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
14011 _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_6__["default"].setConf(config.flowchart);
14012 _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_6__["default"].draw(txt, id, false);
14013 break;
14014
14015 case 'sequence':
14016 config.sequence.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
14017
14018 if (config.sequenceDiagram) {
14019 // backwards compatibility
14020 _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__["default"].setConf(Object.assign(config.sequence, config.sequenceDiagram));
14021 console.error('`mermaid config.sequenceDiagram` has been renamed to `config.sequence`. Please update your mermaid config.');
14022 } else {
14023 _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__["default"].setConf(config.sequence);
14024 }
14025
14026 _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__["default"].draw(txt, id);
14027 break;
14028
14029 case 'gantt':
14030 config.gantt.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
14031 _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_12__["default"].setConf(config.gantt);
14032 _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_12__["default"].draw(txt, id);
14033 break;
14034
14035 case 'class':
14036 config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
14037 _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_15__["default"].setConf(config.class);
14038 _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_15__["default"].draw(txt, id);
14039 break;
14040
14041 case 'state':
14042 // config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
14043 _diagrams_state_stateRenderer__WEBPACK_IMPORTED_MODULE_18__["default"].setConf(config.state);
14044 _diagrams_state_stateRenderer__WEBPACK_IMPORTED_MODULE_18__["default"].draw(txt, id);
14045 break;
14046
14047 case 'info':
14048 config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
14049 _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_24__["default"].setConf(config.class);
14050 _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_24__["default"].draw(txt, id, _package_json__WEBPACK_IMPORTED_MODULE_2__.version);
14051 break;
14052
14053 case 'pie':
14054 config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
14055 _diagrams_pie_pieRenderer__WEBPACK_IMPORTED_MODULE_27__["default"].setConf(config.class);
14056 _diagrams_pie_pieRenderer__WEBPACK_IMPORTED_MODULE_27__["default"].draw(txt, id, _package_json__WEBPACK_IMPORTED_MODULE_2__.version);
14057 break;
14058 }
14059
14060 d3__WEBPACK_IMPORTED_MODULE_0__["select"]("[id=\"".concat(id, "\"]")).selectAll('foreignobject > *').attr('xmlns', 'http://www.w3.org/1999/xhtml'); // if (config.arrowMarkerAbsolute) {
14061 // url =
14062 // window.location.protocol +
14063 // '//' +
14064 // window.location.host +
14065 // window.location.pathname +
14066 // window.location.search;
14067 // url = url.replace(/\(/g, '\\(');
14068 // url = url.replace(/\)/g, '\\)');
14069 // }
14070 // Fix for when the base tag is used
14071
14072 var svgCode = d3__WEBPACK_IMPORTED_MODULE_0__["select"]('#d' + id).node().innerHTML;
14073
14074 if (!config.arrowMarkerAbsolute || config.arrowMarkerAbsolute === 'false') {
14075 svgCode = svgCode.replace(/marker-end="url\(.*?#/g, 'marker-end="url(#', 'g');
14076 }
14077
14078 svgCode = decodeEntities(svgCode);
14079
14080 if (typeof cb !== 'undefined') {
14081 switch (graphType) {
14082 case 'flowchart':
14083 cb(svgCode, _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__["default"].bindFunctions);
14084 break;
14085
14086 case 'gantt':
14087 cb(svgCode, _diagrams_gantt_ganttDb__WEBPACK_IMPORTED_MODULE_14__["default"].bindFunctions);
14088 break;
14089
14090 case 'class':
14091 cb(svgCode, _diagrams_class_classDb__WEBPACK_IMPORTED_MODULE_17__["default"].bindFunctions);
14092 break;
14093
14094 default:
14095 cb(svgCode);
14096 }
14097 } else {
14098 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('CB = undefined!');
14099 }
14100
14101 var node = d3__WEBPACK_IMPORTED_MODULE_0__["select"]('#d' + id).node();
14102
14103 if (node !== null && typeof node.remove === 'function') {
14104 d3__WEBPACK_IMPORTED_MODULE_0__["select"]('#d' + id).node().remove();
14105 }
14106
14107 return svgCode;
14108};
14109
14110var setConf = function setConf(cnf) {
14111 // Top level initially mermaid, gflow, sequenceDiagram and gantt
14112 var lvl1Keys = Object.keys(cnf);
14113
14114 for (var i = 0; i < lvl1Keys.length; i++) {
14115 if (_typeof(cnf[lvl1Keys[i]]) === 'object' && cnf[lvl1Keys[i]] != null) {
14116 var lvl2Keys = Object.keys(cnf[lvl1Keys[i]]);
14117
14118 for (var j = 0; j < lvl2Keys.length; j++) {
14119 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('Setting conf ', lvl1Keys[i], '-', lvl2Keys[j]);
14120
14121 if (typeof config[lvl1Keys[i]] === 'undefined') {
14122 config[lvl1Keys[i]] = {};
14123 }
14124
14125 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('Setting config: ' + lvl1Keys[i] + ' ' + lvl2Keys[j] + ' to ' + cnf[lvl1Keys[i]][lvl2Keys[j]]);
14126 config[lvl1Keys[i]][lvl2Keys[j]] = cnf[lvl1Keys[i]][lvl2Keys[j]];
14127 }
14128 } else {
14129 config[lvl1Keys[i]] = cnf[lvl1Keys[i]];
14130 }
14131 }
14132};
14133
14134function initialize(options) {
14135 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('Initializing mermaidAPI ', _package_json__WEBPACK_IMPORTED_MODULE_2__.version); // Update default config with options supplied at initialization
14136
14137 if (_typeof(options) === 'object') {
14138 setConf(options);
14139 }
14140
14141 Object(_config__WEBPACK_IMPORTED_MODULE_3__["setConfig"])(config);
14142 Object(_logger__WEBPACK_IMPORTED_MODULE_4__["setLogLevel"])(config.logLevel);
14143} // function getConfig () {
14144// console.warn('get config')
14145// return config
14146// }
14147
14148
14149var mermaidAPI = {
14150 render: render,
14151 parse: parse,
14152 initialize: initialize,
14153 getConfig: _config__WEBPACK_IMPORTED_MODULE_3__["getConfig"]
14154};
14155/* harmony default export */ __webpack_exports__["default"] = (mermaidAPI);
14156/**
14157 * ## mermaidAPI configuration defaults
14158 * <pre>
14159 *
14160 * &lt;script>
14161 * var config = {
14162 * theme:'default',
14163 * logLevel:'fatal',
14164 * securityLevel:'strict',
14165 * startOnLoad:true,
14166 * arrowMarkerAbsolute:false,
14167 *
14168 * flowchart:{
14169 * htmlLabels:true,
14170 * curve:'linear',
14171 * },
14172 * sequence:{
14173 * diagramMarginX:50,
14174 * diagramMarginY:10,
14175 * actorMargin:50,
14176 * width:150,
14177 * height:65,
14178 * boxMargin:10,
14179 * boxTextMargin:5,
14180 * noteMargin:10,
14181 * messageMargin:35,
14182 * mirrorActors:true,
14183 * bottomMarginAdj:1,
14184 * useMaxWidth:true,
14185 * rightAngles:false,
14186 * showSequenceNumbers:false,
14187 * },
14188 * gantt:{
14189 * titleTopMargin:25,
14190 * barHeight:20,
14191 * barGap:4,
14192 * topPadding:50,
14193 * leftPadding:75,
14194 * gridLineStartPadding:35,
14195 * fontSize:11,
14196 * fontFamily:'"Open-Sans", "sans-serif"',
14197 * numberSectionStyles:4,
14198 * axisFormat:'%Y-%m-%d',
14199 * }
14200 * };
14201 * mermaid.initialize(config);
14202 * &lt;/script>
14203 *</pre>
14204 */
14205
14206/***/ }),
14207
14208/***/ "./src/themes sync recursive ^\\.\\/.*\\/index\\.scss$":
14209/*!***********************************************!*\
14210 !*** ./src/themes sync ^\.\/.*\/index\.scss$ ***!
14211 \***********************************************/
14212/*! no static exports found */
14213/***/ (function(module, exports, __webpack_require__) {
14214
14215var map = {
14216 "./dark/index.scss": "./src/themes/dark/index.scss",
14217 "./default/index.scss": "./src/themes/default/index.scss",
14218 "./forest/index.scss": "./src/themes/forest/index.scss",
14219 "./neutral/index.scss": "./src/themes/neutral/index.scss"
14220};
14221
14222
14223function webpackContext(req) {
14224 var id = webpackContextResolve(req);
14225 return __webpack_require__(id);
14226}
14227function webpackContextResolve(req) {
14228 if(!__webpack_require__.o(map, req)) {
14229 var e = new Error("Cannot find module '" + req + "'");
14230 e.code = 'MODULE_NOT_FOUND';
14231 throw e;
14232 }
14233 return map[req];
14234}
14235webpackContext.keys = function webpackContextKeys() {
14236 return Object.keys(map);
14237};
14238webpackContext.resolve = webpackContextResolve;
14239module.exports = webpackContext;
14240webpackContext.id = "./src/themes sync recursive ^\\.\\/.*\\/index\\.scss$";
14241
14242/***/ }),
14243
14244/***/ "./src/themes/dark/index.scss":
14245/*!************************************!*\
14246 !*** ./src/themes/dark/index.scss ***!
14247 \************************************/
14248/*! no static exports found */
14249/***/ (function(module, exports, __webpack_require__) {
14250
14251// css-to-string-loader: transforms styles from css-loader to a string output
14252
14253// Get the styles
14254var styles = __webpack_require__(/*! !../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./index.scss */ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/themes/dark/index.scss");
14255
14256if (typeof styles === 'string') {
14257 // Return an existing string
14258 module.exports = styles;
14259} else {
14260 // Call the custom toString method from css-loader module
14261 module.exports = styles.toString();
14262}
14263
14264/***/ }),
14265
14266/***/ "./src/themes/default/index.scss":
14267/*!***************************************!*\
14268 !*** ./src/themes/default/index.scss ***!
14269 \***************************************/
14270/*! no static exports found */
14271/***/ (function(module, exports, __webpack_require__) {
14272
14273// css-to-string-loader: transforms styles from css-loader to a string output
14274
14275// Get the styles
14276var styles = __webpack_require__(/*! !../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./index.scss */ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/themes/default/index.scss");
14277
14278if (typeof styles === 'string') {
14279 // Return an existing string
14280 module.exports = styles;
14281} else {
14282 // Call the custom toString method from css-loader module
14283 module.exports = styles.toString();
14284}
14285
14286/***/ }),
14287
14288/***/ "./src/themes/forest/index.scss":
14289/*!**************************************!*\
14290 !*** ./src/themes/forest/index.scss ***!
14291 \**************************************/
14292/*! no static exports found */
14293/***/ (function(module, exports, __webpack_require__) {
14294
14295// css-to-string-loader: transforms styles from css-loader to a string output
14296
14297// Get the styles
14298var styles = __webpack_require__(/*! !../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./index.scss */ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/themes/forest/index.scss");
14299
14300if (typeof styles === 'string') {
14301 // Return an existing string
14302 module.exports = styles;
14303} else {
14304 // Call the custom toString method from css-loader module
14305 module.exports = styles.toString();
14306}
14307
14308/***/ }),
14309
14310/***/ "./src/themes/neutral/index.scss":
14311/*!***************************************!*\
14312 !*** ./src/themes/neutral/index.scss ***!
14313 \***************************************/
14314/*! no static exports found */
14315/***/ (function(module, exports, __webpack_require__) {
14316
14317// css-to-string-loader: transforms styles from css-loader to a string output
14318
14319// Get the styles
14320var styles = __webpack_require__(/*! !../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/dist/cjs.js!./index.scss */ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/themes/neutral/index.scss");
14321
14322if (typeof styles === 'string') {
14323 // Return an existing string
14324 module.exports = styles;
14325} else {
14326 // Call the custom toString method from css-loader module
14327 module.exports = styles.toString();
14328}
14329
14330/***/ }),
14331
14332/***/ "./src/utils.js":
14333/*!**********************!*\
14334 !*** ./src/utils.js ***!
14335 \**********************/
14336/*! exports provided: detectType, isSubstringInArray, interpolateToCurve, sanitize, formatUrl, default */
14337/***/ (function(module, __webpack_exports__, __webpack_require__) {
14338
14339"use strict";
14340__webpack_require__.r(__webpack_exports__);
14341/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "detectType", function() { return detectType; });
14342/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSubstringInArray", function() { return isSubstringInArray; });
14343/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "interpolateToCurve", function() { return interpolateToCurve; });
14344/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sanitize", function() { return sanitize; });
14345/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatUrl", function() { return formatUrl; });
14346/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
14347/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
14348/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./logger */ "./src/logger.js");
14349/* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @braintree/sanitize-url */ "@braintree/sanitize-url");
14350/* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_2__);
14351
14352
14353
14354/**
14355 * @function detectType
14356 * Detects the type of the graph text.
14357 * ```mermaid
14358 * graph LR
14359 * a-->b
14360 * b-->c
14361 * c-->d
14362 * d-->e
14363 * e-->f
14364 * f-->g
14365 * g-->h
14366 * ```
14367 *
14368 * @param {string} text The text defining the graph
14369 * @returns {string} A graph definition key
14370 */
14371
14372var detectType = function detectType(text) {
14373 text = text.replace(/^\s*%%.*\n/g, '\n');
14374 _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug('Detecting diagram type based on the text ' + text);
14375
14376 if (text.match(/^\s*sequenceDiagram/)) {
14377 return 'sequence';
14378 }
14379
14380 if (text.match(/^\s*gantt/)) {
14381 return 'gantt';
14382 }
14383
14384 if (text.match(/^\s*classDiagram/)) {
14385 return 'class';
14386 }
14387
14388 if (text.match(/^\s*stateDiagram/)) {
14389 return 'state';
14390 }
14391
14392 if (text.match(/^\s*gitGraph/)) {
14393 return 'git';
14394 }
14395
14396 if (text.match(/^\s*info/)) {
14397 return 'info';
14398 }
14399
14400 if (text.match(/^\s*pie/)) {
14401 return 'pie';
14402 }
14403
14404 return 'flowchart';
14405};
14406/**
14407 * @function isSubstringInArray
14408 * Detects whether a substring in present in a given array
14409 * @param {string} str The substring to detect
14410 * @param {array} arr The array to search
14411 * @returns {number} the array index containing the substring or -1 if not present
14412 **/
14413
14414var isSubstringInArray = function isSubstringInArray(str, arr) {
14415 for (var i = 0; i < arr.length; i++) {
14416 if (arr[i].match(str)) return i;
14417 }
14418
14419 return -1;
14420};
14421var interpolateToCurve = function interpolateToCurve(interpolate, defaultCurve) {
14422 if (!interpolate) {
14423 return defaultCurve;
14424 }
14425
14426 var curveName = "curve".concat(interpolate.charAt(0).toUpperCase() + interpolate.slice(1));
14427 return d3__WEBPACK_IMPORTED_MODULE_0__[curveName] || defaultCurve;
14428};
14429var sanitize = function sanitize(text, config) {
14430 var txt = text;
14431 var htmlLabels = true;
14432 if (config.flowchart && (config.flowchart.htmlLabels === false || config.flowchart.htmlLabels === 'false')) htmlLabels = false;
14433
14434 if (config.securityLevel !== 'loose' && htmlLabels) {
14435 // eslint-disable-line
14436 txt = txt.replace(/<br>/g, '#br#');
14437 txt = txt.replace(/<br\S*?\/>/g, '#br#');
14438 txt = txt.replace(/</g, '&lt;').replace(/>/g, '&gt;');
14439 txt = txt.replace(/=/g, '&equals;');
14440 txt = txt.replace(/#br#/g, '<br/>');
14441 }
14442
14443 return txt;
14444};
14445var formatUrl = function formatUrl(linkStr, config) {
14446 var url = linkStr.trim();
14447
14448 if (url) {
14449 if (config.securityLevel !== 'loose') {
14450 return Object(_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_2__["sanitizeUrl"])(url);
14451 } else {
14452 if (!/^(https?:)?\/\//i.test(url)) {
14453 url = 'http://' + url;
14454 }
14455 }
14456
14457 return url;
14458 }
14459};
14460
14461var distance = function distance(p1, p2) {
14462 return p1 && p2 ? Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)) : 0;
14463};
14464
14465var traverseEdge = function traverseEdge(points) {
14466 var prevPoint;
14467 var totalDistance = 0;
14468 points.forEach(function (point) {
14469 totalDistance += distance(point, prevPoint);
14470 prevPoint = point;
14471 }); // Traverse half of total distance along points
14472
14473 var distanceToLabel = totalDistance / 2;
14474 var remainingDistance = distanceToLabel;
14475 var center;
14476 prevPoint = undefined;
14477 points.forEach(function (point) {
14478 if (prevPoint && !center) {
14479 var vectorDistance = distance(point, prevPoint);
14480
14481 if (vectorDistance < remainingDistance) {
14482 remainingDistance -= vectorDistance;
14483 } else {
14484 // The point is remainingDistance from prevPoint in the vector between prevPoint and point
14485 // Calculate the coordinates
14486 var distanceRatio = remainingDistance / vectorDistance;
14487 if (distanceRatio <= 0) center = prevPoint;
14488 if (distanceRatio >= 1) center = {
14489 x: point.x,
14490 y: point.y
14491 };
14492
14493 if (distanceRatio > 0 && distanceRatio < 1) {
14494 center = {
14495 x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x,
14496 y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y
14497 };
14498 }
14499 }
14500 }
14501
14502 prevPoint = point;
14503 });
14504 return center;
14505};
14506
14507var calcLabelPosition = function calcLabelPosition(points) {
14508 var p = traverseEdge(points);
14509 return p;
14510};
14511
14512var calcCardinalityPosition = function calcCardinalityPosition(isRelationTypePresent, points, initialPosition) {
14513 var prevPoint;
14514 var totalDistance = 0; // eslint-disable-line
14515
14516 if (points[0] !== initialPosition) {
14517 points = points.reverse();
14518 }
14519
14520 points.forEach(function (point) {
14521 totalDistance += distance(point, prevPoint);
14522 prevPoint = point;
14523 }); // Traverse only 25 total distance along points to find cardinality point
14524
14525 var distanceToCardinalityPoint = 25;
14526 var remainingDistance = distanceToCardinalityPoint;
14527 var center;
14528 prevPoint = undefined;
14529 points.forEach(function (point) {
14530 if (prevPoint && !center) {
14531 var vectorDistance = distance(point, prevPoint);
14532
14533 if (vectorDistance < remainingDistance) {
14534 remainingDistance -= vectorDistance;
14535 } else {
14536 // The point is remainingDistance from prevPoint in the vector between prevPoint and point
14537 // Calculate the coordinates
14538 var distanceRatio = remainingDistance / vectorDistance;
14539 if (distanceRatio <= 0) center = prevPoint;
14540 if (distanceRatio >= 1) center = {
14541 x: point.x,
14542 y: point.y
14543 };
14544
14545 if (distanceRatio > 0 && distanceRatio < 1) {
14546 center = {
14547 x: (1 - distanceRatio) * prevPoint.x + distanceRatio * point.x,
14548 y: (1 - distanceRatio) * prevPoint.y + distanceRatio * point.y
14549 };
14550 }
14551 }
14552 }
14553
14554 prevPoint = point;
14555 }); // if relation is present (Arrows will be added), change cardinality point off-set distance (d)
14556
14557 var d = isRelationTypePresent ? 10 : 5; //Calculate Angle for x and y axis
14558
14559 var angle = Math.atan2(points[0].y - center.y, points[0].x - center.x);
14560 var cardinalityPosition = {
14561 x: 0,
14562 y: 0
14563 }; //Calculation cardinality position using angle, center point on the line/curve but pendicular and with offset-distance
14564
14565 cardinalityPosition.x = Math.sin(angle) * d + (points[0].x + center.x) / 2;
14566 cardinalityPosition.y = -Math.cos(angle) * d + (points[0].y + center.y) / 2;
14567 return cardinalityPosition;
14568};
14569
14570/* harmony default export */ __webpack_exports__["default"] = ({
14571 detectType: detectType,
14572 isSubstringInArray: isSubstringInArray,
14573 interpolateToCurve: interpolateToCurve,
14574 calcLabelPosition: calcLabelPosition,
14575 calcCardinalityPosition: calcCardinalityPosition,
14576 sanitize: sanitize,
14577 formatUrl: formatUrl
14578});
14579
14580/***/ }),
14581
14582/***/ "@braintree/sanitize-url":
14583/*!******************************************!*\
14584 !*** external "@braintree/sanitize-url" ***!
14585 \******************************************/
14586/*! no static exports found */
14587/***/ (function(module, exports) {
14588
14589module.exports = require("@braintree/sanitize-url");
14590
14591/***/ }),
14592
14593/***/ "crypto-random-string":
14594/*!***************************************!*\
14595 !*** external "crypto-random-string" ***!
14596 \***************************************/
14597/*! no static exports found */
14598/***/ (function(module, exports) {
14599
14600module.exports = require("crypto-random-string");
14601
14602/***/ }),
14603
14604/***/ "d3":
14605/*!*********************!*\
14606 !*** external "d3" ***!
14607 \*********************/
14608/*! no static exports found */
14609/***/ (function(module, exports) {
14610
14611module.exports = require("d3");
14612
14613/***/ }),
14614
14615/***/ "dagre":
14616/*!************************!*\
14617 !*** external "dagre" ***!
14618 \************************/
14619/*! no static exports found */
14620/***/ (function(module, exports) {
14621
14622module.exports = require("dagre");
14623
14624/***/ }),
14625
14626/***/ "dagre-d3":
14627/*!***************************!*\
14628 !*** external "dagre-d3" ***!
14629 \***************************/
14630/*! no static exports found */
14631/***/ (function(module, exports) {
14632
14633module.exports = require("dagre-d3");
14634
14635/***/ }),
14636
14637/***/ "dagre-d3/lib/label/add-html-label.js":
14638/*!*******************************************************!*\
14639 !*** external "dagre-d3/lib/label/add-html-label.js" ***!
14640 \*******************************************************/
14641/*! no static exports found */
14642/***/ (function(module, exports) {
14643
14644module.exports = require("dagre-d3/lib/label/add-html-label.js");
14645
14646/***/ }),
14647
14648/***/ "graphlib":
14649/*!***************************!*\
14650 !*** external "graphlib" ***!
14651 \***************************/
14652/*! no static exports found */
14653/***/ (function(module, exports) {
14654
14655module.exports = require("graphlib");
14656
14657/***/ }),
14658
14659/***/ "lodash":
14660/*!*************************!*\
14661 !*** external "lodash" ***!
14662 \*************************/
14663/*! no static exports found */
14664/***/ (function(module, exports) {
14665
14666module.exports = require("lodash");
14667
14668/***/ }),
14669
14670/***/ "moment-mini":
14671/*!******************************!*\
14672 !*** external "moment-mini" ***!
14673 \******************************/
14674/*! no static exports found */
14675/***/ (function(module, exports) {
14676
14677module.exports = require("moment-mini");
14678
14679/***/ }),
14680
14681/***/ "scope-css":
14682/*!****************************!*\
14683 !*** external "scope-css" ***!
14684 \****************************/
14685/*! no static exports found */
14686/***/ (function(module, exports) {
14687
14688module.exports = require("scope-css");
14689
14690/***/ })
14691
14692/******/ })["default"];
14693});
14694//# sourceMappingURL=mermaidAPI.core.js.map
\No newline at end of file