UNPKG

483 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/mermaid.js");
95/******/ })
96/************************************************************************/
97/******/ ({
98
99/***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/lib/loader.js!./src/themes/dark/index.scss":
100/*!*******************************************************************************************************************!*\
101 !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/lib/loader.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.label {\n font-family: 'trebuchet ms', verdana, arial;\n color: #333; }\n\n.label text {\n fill: #333; }\n\n.node rect,\n.node circle,\n.node ellipse,\n.node polygon {\n fill: #BDD5EA;\n stroke: purple;\n stroke-width: 1px; }\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\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-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-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.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\n/* Grid and axis */\n.grid .tick {\n stroke: lightgrey;\n opacity: 0.3;\n shape-rendering: crispEdges; }\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-size: 11px; }\n\n.taskTextOutsideRight {\n fill: #323D47;\n text-anchor: start;\n font-size: 11px; }\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\ng.classGroup text {\n fill: purple;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 10px; }\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#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\n.pieTitleText {\n text-anchor: middle;\n font-size: 25px;\n fill: #323D47; }\n", ""]);
109
110
111
112/***/ }),
113
114/***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/lib/loader.js!./src/themes/default/index.scss":
115/*!**********************************************************************************************************************!*\
116 !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/lib/loader.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.label {\n font-family: 'trebuchet ms', verdana, arial;\n color: #333; }\n\n.label text {\n fill: #333; }\n\n.node rect,\n.node circle,\n.node ellipse,\n.node polygon {\n fill: #ECECFF;\n stroke: #9370DB;\n stroke-width: 1px; }\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\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-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-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.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\n/* Grid and axis */\n.grid .tick {\n stroke: lightgrey;\n opacity: 0.3;\n shape-rendering: crispEdges; }\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-size: 11px; }\n\n.taskTextOutsideRight {\n fill: black;\n text-anchor: start;\n font-size: 11px; }\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\ng.classGroup text {\n fill: #9370DB;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 10px; }\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#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\n.pieTitleText {\n text-anchor: middle;\n font-size: 25px;\n fill: black; }\n", ""]);
124
125
126
127/***/ }),
128
129/***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/lib/loader.js!./src/themes/forest/index.scss":
130/*!*********************************************************************************************************************!*\
131 !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/lib/loader.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.label {\n font-family: 'trebuchet ms', verdana, arial;\n color: #333; }\n\n.label text {\n fill: #333; }\n\n.node rect,\n.node circle,\n.node ellipse,\n.node polygon {\n fill: #cde498;\n stroke: #13540c;\n stroke-width: 1px; }\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\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-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-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.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\n/* Grid and axis */\n.grid .tick {\n stroke: lightgrey;\n opacity: 0.3;\n shape-rendering: crispEdges; }\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-size: 11px; }\n\n.taskTextOutsideRight {\n fill: black;\n text-anchor: start;\n font-size: 11px; }\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\ng.classGroup text {\n fill: #13540c;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 10px; }\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#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\n.pieTitleText {\n text-anchor: middle;\n font-size: 25px;\n fill: black; }\n", ""]);
139
140
141
142/***/ }),
143
144/***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/lib/loader.js!./src/themes/neutral/index.scss":
145/*!**********************************************************************************************************************!*\
146 !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/lib/loader.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.label {\n font-family: 'trebuchet ms', verdana, arial;\n color: #333; }\n\n.label text {\n fill: #333; }\n\n.node rect,\n.node circle,\n.node ellipse,\n.node polygon {\n fill: #eee;\n stroke: #999;\n stroke-width: 1px; }\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\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-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-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.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\n/* Grid and axis */\n.grid .tick {\n stroke: #e6e6e6;\n opacity: 0.3;\n shape-rendering: crispEdges; }\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-size: 11px; }\n\n.taskTextOutsideRight {\n fill: #333;\n text-anchor: start;\n font-size: 11px; }\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\ng.classGroup text {\n fill: #999;\n stroke: none;\n font-family: 'trebuchet ms', verdana, arial;\n font-size: 10px; }\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#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\n.pieTitleText {\n text-anchor: middle;\n font-size: 25px;\n fill: #333; }\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) {// Copyright Joyent, Inc. and other Node contributors.
274//
275// Permission is hereby granted, free of charge, to any person obtaining a
276// copy of this software and associated documentation files (the
277// "Software"), to deal in the Software without restriction, including
278// without limitation the rights to use, copy, modify, merge, publish,
279// distribute, sublicense, and/or sell copies of the Software, and to permit
280// persons to whom the Software is furnished to do so, subject to the
281// following conditions:
282//
283// The above copyright notice and this permission notice shall be included
284// in all copies or substantial portions of the Software.
285//
286// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
287// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
288// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
289// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
290// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
291// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
292// USE OR OTHER DEALINGS IN THE SOFTWARE.
293
294// resolves . and .. elements in a path array with directory names there
295// must be no slashes, empty elements, or device names (c:\) in the array
296// (so also no leading and trailing slashes - it does not distinguish
297// relative and absolute paths)
298function normalizeArray(parts, allowAboveRoot) {
299 // if the path tries to go above the root, `up` ends up > 0
300 var up = 0;
301 for (var i = parts.length - 1; i >= 0; i--) {
302 var last = parts[i];
303 if (last === '.') {
304 parts.splice(i, 1);
305 } else if (last === '..') {
306 parts.splice(i, 1);
307 up++;
308 } else if (up) {
309 parts.splice(i, 1);
310 up--;
311 }
312 }
313
314 // if the path is allowed to go above the root, restore leading ..s
315 if (allowAboveRoot) {
316 for (; up--; up) {
317 parts.unshift('..');
318 }
319 }
320
321 return parts;
322}
323
324// Split a filename into [root, dir, basename, ext], unix version
325// 'root' is just a slash, or nothing.
326var splitPathRe =
327 /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
328var splitPath = function(filename) {
329 return splitPathRe.exec(filename).slice(1);
330};
331
332// path.resolve([from ...], to)
333// posix version
334exports.resolve = function() {
335 var resolvedPath = '',
336 resolvedAbsolute = false;
337
338 for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
339 var path = (i >= 0) ? arguments[i] : process.cwd();
340
341 // Skip empty and invalid entries
342 if (typeof path !== 'string') {
343 throw new TypeError('Arguments to path.resolve must be strings');
344 } else if (!path) {
345 continue;
346 }
347
348 resolvedPath = path + '/' + resolvedPath;
349 resolvedAbsolute = path.charAt(0) === '/';
350 }
351
352 // At this point the path should be resolved to a full absolute path, but
353 // handle relative paths to be safe (might happen when process.cwd() fails)
354
355 // Normalize the path
356 resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
357 return !!p;
358 }), !resolvedAbsolute).join('/');
359
360 return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
361};
362
363// path.normalize(path)
364// posix version
365exports.normalize = function(path) {
366 var isAbsolute = exports.isAbsolute(path),
367 trailingSlash = substr(path, -1) === '/';
368
369 // Normalize the path
370 path = normalizeArray(filter(path.split('/'), function(p) {
371 return !!p;
372 }), !isAbsolute).join('/');
373
374 if (!path && !isAbsolute) {
375 path = '.';
376 }
377 if (path && trailingSlash) {
378 path += '/';
379 }
380
381 return (isAbsolute ? '/' : '') + path;
382};
383
384// posix version
385exports.isAbsolute = function(path) {
386 return path.charAt(0) === '/';
387};
388
389// posix version
390exports.join = function() {
391 var paths = Array.prototype.slice.call(arguments, 0);
392 return exports.normalize(filter(paths, function(p, index) {
393 if (typeof p !== 'string') {
394 throw new TypeError('Arguments to path.join must be strings');
395 }
396 return p;
397 }).join('/'));
398};
399
400
401// path.relative(from, to)
402// posix version
403exports.relative = function(from, to) {
404 from = exports.resolve(from).substr(1);
405 to = exports.resolve(to).substr(1);
406
407 function trim(arr) {
408 var start = 0;
409 for (; start < arr.length; start++) {
410 if (arr[start] !== '') break;
411 }
412
413 var end = arr.length - 1;
414 for (; end >= 0; end--) {
415 if (arr[end] !== '') break;
416 }
417
418 if (start > end) return [];
419 return arr.slice(start, end - start + 1);
420 }
421
422 var fromParts = trim(from.split('/'));
423 var toParts = trim(to.split('/'));
424
425 var length = Math.min(fromParts.length, toParts.length);
426 var samePartsLength = length;
427 for (var i = 0; i < length; i++) {
428 if (fromParts[i] !== toParts[i]) {
429 samePartsLength = i;
430 break;
431 }
432 }
433
434 var outputParts = [];
435 for (var i = samePartsLength; i < fromParts.length; i++) {
436 outputParts.push('..');
437 }
438
439 outputParts = outputParts.concat(toParts.slice(samePartsLength));
440
441 return outputParts.join('/');
442};
443
444exports.sep = '/';
445exports.delimiter = ':';
446
447exports.dirname = function(path) {
448 var result = splitPath(path),
449 root = result[0],
450 dir = result[1];
451
452 if (!root && !dir) {
453 // No dirname whatsoever
454 return '.';
455 }
456
457 if (dir) {
458 // It has a dirname, strip trailing slash
459 dir = dir.substr(0, dir.length - 1);
460 }
461
462 return root + dir;
463};
464
465
466exports.basename = function(path, ext) {
467 var f = splitPath(path)[2];
468 // TODO: make this comparison case-insensitive on windows?
469 if (ext && f.substr(-1 * ext.length) === ext) {
470 f = f.substr(0, f.length - ext.length);
471 }
472 return f;
473};
474
475
476exports.extname = function(path) {
477 return splitPath(path)[3];
478};
479
480function filter (xs, f) {
481 if (xs.filter) return xs.filter(f);
482 var res = [];
483 for (var i = 0; i < xs.length; i++) {
484 if (f(xs[i], i, xs)) res.push(xs[i]);
485 }
486 return res;
487}
488
489// String.prototype.substr - negative index don't work in IE8
490var substr = 'ab'.substr(-1) === 'b'
491 ? function (str, start, len) { return str.substr(start, len) }
492 : function (str, start, len) {
493 if (start < 0) start = str.length + start;
494 return str.substr(start, len);
495 }
496;
497
498/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ "./node_modules/process/browser.js")))
499
500/***/ }),
501
502/***/ "./node_modules/process/browser.js":
503/*!*****************************************!*\
504 !*** ./node_modules/process/browser.js ***!
505 \*****************************************/
506/*! no static exports found */
507/***/ (function(module, exports) {
508
509// shim for using process in browser
510var process = module.exports = {};
511
512// cached from whatever global is present so that test runners that stub it
513// don't break things. But we need to wrap it in a try catch in case it is
514// wrapped in strict mode code which doesn't define any globals. It's inside a
515// function because try/catches deoptimize in certain engines.
516
517var cachedSetTimeout;
518var cachedClearTimeout;
519
520function defaultSetTimout() {
521 throw new Error('setTimeout has not been defined');
522}
523function defaultClearTimeout () {
524 throw new Error('clearTimeout has not been defined');
525}
526(function () {
527 try {
528 if (typeof setTimeout === 'function') {
529 cachedSetTimeout = setTimeout;
530 } else {
531 cachedSetTimeout = defaultSetTimout;
532 }
533 } catch (e) {
534 cachedSetTimeout = defaultSetTimout;
535 }
536 try {
537 if (typeof clearTimeout === 'function') {
538 cachedClearTimeout = clearTimeout;
539 } else {
540 cachedClearTimeout = defaultClearTimeout;
541 }
542 } catch (e) {
543 cachedClearTimeout = defaultClearTimeout;
544 }
545} ())
546function runTimeout(fun) {
547 if (cachedSetTimeout === setTimeout) {
548 //normal enviroments in sane situations
549 return setTimeout(fun, 0);
550 }
551 // if setTimeout wasn't available but was latter defined
552 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
553 cachedSetTimeout = setTimeout;
554 return setTimeout(fun, 0);
555 }
556 try {
557 // when when somebody has screwed with setTimeout but no I.E. maddness
558 return cachedSetTimeout(fun, 0);
559 } catch(e){
560 try {
561 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
562 return cachedSetTimeout.call(null, fun, 0);
563 } catch(e){
564 // 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
565 return cachedSetTimeout.call(this, fun, 0);
566 }
567 }
568
569
570}
571function runClearTimeout(marker) {
572 if (cachedClearTimeout === clearTimeout) {
573 //normal enviroments in sane situations
574 return clearTimeout(marker);
575 }
576 // if clearTimeout wasn't available but was latter defined
577 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
578 cachedClearTimeout = clearTimeout;
579 return clearTimeout(marker);
580 }
581 try {
582 // when when somebody has screwed with setTimeout but no I.E. maddness
583 return cachedClearTimeout(marker);
584 } catch (e){
585 try {
586 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
587 return cachedClearTimeout.call(null, marker);
588 } catch (e){
589 // 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.
590 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
591 return cachedClearTimeout.call(this, marker);
592 }
593 }
594
595
596
597}
598var queue = [];
599var draining = false;
600var currentQueue;
601var queueIndex = -1;
602
603function cleanUpNextTick() {
604 if (!draining || !currentQueue) {
605 return;
606 }
607 draining = false;
608 if (currentQueue.length) {
609 queue = currentQueue.concat(queue);
610 } else {
611 queueIndex = -1;
612 }
613 if (queue.length) {
614 drainQueue();
615 }
616}
617
618function drainQueue() {
619 if (draining) {
620 return;
621 }
622 var timeout = runTimeout(cleanUpNextTick);
623 draining = true;
624
625 var len = queue.length;
626 while(len) {
627 currentQueue = queue;
628 queue = [];
629 while (++queueIndex < len) {
630 if (currentQueue) {
631 currentQueue[queueIndex].run();
632 }
633 }
634 queueIndex = -1;
635 len = queue.length;
636 }
637 currentQueue = null;
638 draining = false;
639 runClearTimeout(timeout);
640}
641
642process.nextTick = function (fun) {
643 var args = new Array(arguments.length - 1);
644 if (arguments.length > 1) {
645 for (var i = 1; i < arguments.length; i++) {
646 args[i - 1] = arguments[i];
647 }
648 }
649 queue.push(new Item(fun, args));
650 if (queue.length === 1 && !draining) {
651 runTimeout(drainQueue);
652 }
653};
654
655// v8 likes predictible objects
656function Item(fun, array) {
657 this.fun = fun;
658 this.array = array;
659}
660Item.prototype.run = function () {
661 this.fun.apply(null, this.array);
662};
663process.title = 'browser';
664process.browser = true;
665process.env = {};
666process.argv = [];
667process.version = ''; // empty string to avoid regexp issues
668process.versions = {};
669
670function noop() {}
671
672process.on = noop;
673process.addListener = noop;
674process.once = noop;
675process.off = noop;
676process.removeListener = noop;
677process.removeAllListeners = noop;
678process.emit = noop;
679process.prependListener = noop;
680process.prependOnceListener = noop;
681
682process.listeners = function (name) { return [] }
683
684process.binding = function (name) {
685 throw new Error('process.binding is not supported');
686};
687
688process.cwd = function () { return '/' };
689process.chdir = function (dir) {
690 throw new Error('process.chdir is not supported');
691};
692process.umask = function() { return 0; };
693
694
695/***/ }),
696
697/***/ "./node_modules/webpack/buildin/module.js":
698/*!***********************************!*\
699 !*** (webpack)/buildin/module.js ***!
700 \***********************************/
701/*! no static exports found */
702/***/ (function(module, exports) {
703
704module.exports = function(module) {
705 if (!module.webpackPolyfill) {
706 module.deprecate = function() {};
707 module.paths = [];
708 // module.parent = undefined by default
709 if (!module.children) module.children = [];
710 Object.defineProperty(module, "loaded", {
711 enumerable: true,
712 get: function() {
713 return module.l;
714 }
715 });
716 Object.defineProperty(module, "id", {
717 enumerable: true,
718 get: function() {
719 return module.i;
720 }
721 });
722 module.webpackPolyfill = 1;
723 }
724 return module;
725};
726
727
728/***/ }),
729
730/***/ "./package.json":
731/*!**********************!*\
732 !*** ./package.json ***!
733 \**********************/
734/*! exports provided: name, version, description, main, keywords, scripts, repository, author, license, standard, dependencies, devDependencies, files, yarn-upgrade-all, default */
735/***/ (function(module) {
736
737module.exports = {"name":"mermaid","version":"8.3.1","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","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","d3":"^5.7.0","dagre-d3-renderer":"^0.5.8","dagre-layout":"^0.8.8","graphlibrary":"^2.2.0","he":"^1.2.0","lodash":"^4.17.11","minify":"^4.1.1","moment-mini":"^2.22.1","prettier":"^1.18.2","scope-css":"^1.2.1"},"devDependencies":{"documentation":"^12.0.1","eslint":"^6.3.0","eslint-config-prettier":"^6.3.0","eslint-plugin-prettier":"^3.1.0","@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":"^23.6.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","husky":"^1.2.1","identity-obj-proxy":"^3.0.0","jest":"^23.6.0","jest-environment-puppeteer":"^4.2.0","jest-image-snapshot":"^2.8.2","jest-puppeteer":"^4.2.0","jison":"^0.4.18","moment":"^2.23.0","node-sass":"^4.11.0","puppeteer":"^1.17.0","sass-loader":"^7.1.0","start-server-and-test":"^1.10.0","webpack":"^4.27.1","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"]}};
738
739/***/ }),
740
741/***/ "./src/config.js":
742/*!***********************!*\
743 !*** ./src/config.js ***!
744 \***********************/
745/*! exports provided: setConfig, getConfig */
746/***/ (function(module, __webpack_exports__, __webpack_require__) {
747
748"use strict";
749__webpack_require__.r(__webpack_exports__);
750/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConfig", function() { return setConfig; });
751/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getConfig", function() { return getConfig; });
752let config = {};
753
754const setConf = function (cnf) {
755 // Top level initially mermaid, gflow, sequenceDiagram and gantt
756 const lvl1Keys = Object.keys(cnf);
757
758 for (let i = 0; i < lvl1Keys.length; i++) {
759 if (typeof cnf[lvl1Keys[i]] === 'object' && cnf[lvl1Keys[i]] != null) {
760 const lvl2Keys = Object.keys(cnf[lvl1Keys[i]]);
761
762 for (let j = 0; j < lvl2Keys.length; j++) {
763 // logger.debug('Setting conf ', lvl1Keys[i], '-', lvl2Keys[j])
764 if (typeof config[lvl1Keys[i]] === 'undefined') {
765 config[lvl1Keys[i]] = {};
766 } // logger.debug('Setting config: ' + lvl1Keys[i] + ' ' + lvl2Keys[j] + ' to ' + cnf[lvl1Keys[i]][lvl2Keys[j]])
767
768
769 config[lvl1Keys[i]][lvl2Keys[j]] = cnf[lvl1Keys[i]][lvl2Keys[j]];
770 }
771 } else {
772 config[lvl1Keys[i]] = cnf[lvl1Keys[i]];
773 }
774 }
775};
776
777const setConfig = conf => {
778 setConf(conf);
779};
780const getConfig = () => config;
781
782/***/ }),
783
784/***/ "./src/diagrams/class/classDb.js":
785/*!***************************************!*\
786 !*** ./src/diagrams/class/classDb.js ***!
787 \***************************************/
788/*! exports provided: addClass, clear, getClass, getClasses, getRelations, addRelation, addMember, addMembers, cleanupLabel, lineType, relationType, default */
789/***/ (function(module, __webpack_exports__, __webpack_require__) {
790
791"use strict";
792__webpack_require__.r(__webpack_exports__);
793/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addClass", function() { return addClass; });
794/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clear", function() { return clear; });
795/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClass", function() { return getClass; });
796/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClasses", function() { return getClasses; });
797/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRelations", function() { return getRelations; });
798/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addRelation", function() { return addRelation; });
799/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addMember", function() { return addMember; });
800/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addMembers", function() { return addMembers; });
801/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cleanupLabel", function() { return cleanupLabel; });
802/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lineType", function() { return lineType; });
803/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "relationType", function() { return relationType; });
804/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
805
806let relations = [];
807let classes = {};
808/**
809 * Function called by parser when a node definition has been found.
810 * @param id
811 * @param text
812 * @param type
813 * @param style
814 */
815
816const addClass = function (id) {
817 if (typeof classes[id] === 'undefined') {
818 classes[id] = {
819 id: id,
820 methods: [],
821 members: []
822 };
823 }
824};
825const clear = function () {
826 relations = [];
827 classes = {};
828};
829const getClass = function (id) {
830 return classes[id];
831};
832const getClasses = function () {
833 return classes;
834};
835const getRelations = function () {
836 return relations;
837};
838const addRelation = function (relation) {
839 _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Adding relation: ' + JSON.stringify(relation));
840 addClass(relation.id1);
841 addClass(relation.id2);
842 relations.push(relation);
843};
844const addMember = function (className, member) {
845 const theClass = classes[className];
846
847 if (typeof member === 'string') {
848 if (member.substr(-1) === ')') {
849 theClass.methods.push(member);
850 } else {
851 theClass.members.push(member);
852 }
853 }
854};
855const addMembers = function (className, MembersArr) {
856 if (Array.isArray(MembersArr)) {
857 MembersArr.forEach(member => addMember(className, member));
858 }
859};
860const cleanupLabel = function (label) {
861 if (label.substring(0, 1) === ':') {
862 return label.substr(2).trim();
863 } else {
864 return label.trim();
865 }
866};
867const lineType = {
868 LINE: 0,
869 DOTTED_LINE: 1
870};
871const relationType = {
872 AGGREGATION: 0,
873 EXTENSION: 1,
874 COMPOSITION: 2,
875 DEPENDENCY: 3
876};
877/* harmony default export */ __webpack_exports__["default"] = ({
878 addClass,
879 clear,
880 getClass,
881 getClasses,
882 getRelations,
883 addRelation,
884 addMember,
885 addMembers,
886 cleanupLabel,
887 lineType,
888 relationType
889});
890
891/***/ }),
892
893/***/ "./src/diagrams/class/classRenderer.js":
894/*!*********************************************!*\
895 !*** ./src/diagrams/class/classRenderer.js ***!
896 \*********************************************/
897/*! exports provided: setConf, draw, default */
898/***/ (function(module, __webpack_exports__, __webpack_require__) {
899
900"use strict";
901__webpack_require__.r(__webpack_exports__);
902/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; });
903/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; });
904/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
905/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
906/* harmony import */ var dagre_layout__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dagre-layout */ "dagre-layout");
907/* harmony import */ var dagre_layout__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dagre_layout__WEBPACK_IMPORTED_MODULE_1__);
908/* harmony import */ var graphlibrary__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! graphlibrary */ "graphlibrary");
909/* harmony import */ var graphlibrary__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(graphlibrary__WEBPACK_IMPORTED_MODULE_2__);
910/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
911/* harmony import */ var _classDb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./classDb */ "./src/diagrams/class/classDb.js");
912/* harmony import */ var _parser_classDiagram__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./parser/classDiagram */ "./src/diagrams/class/parser/classDiagram.jison");
913/* harmony import */ var _parser_classDiagram__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_parser_classDiagram__WEBPACK_IMPORTED_MODULE_5__);
914
915
916
917
918
919
920_parser_classDiagram__WEBPACK_IMPORTED_MODULE_5__["parser"].yy = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"];
921const idCache = {};
922let classCnt = 0;
923const conf = {
924 dividerMargin: 10,
925 padding: 5,
926 textHeight: 10
927}; // Todo optimize
928
929const getGraphId = function (label) {
930 const keys = Object.keys(idCache);
931
932 for (let i = 0; i < keys.length; i++) {
933 if (idCache[keys[i]].label === label) {
934 return keys[i];
935 }
936 }
937
938 return undefined;
939};
940/**
941 * Setup arrow head and define the marker. The result is appended to the svg.
942 */
943
944
945const insertMarkers = function (elem) {
946 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');
947 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
948
949 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');
950 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');
951 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');
952 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');
953 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');
954 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');
955};
956
957let edgeCount = 0;
958let total = 0;
959
960const drawEdge = function (elem, path, relation) {
961 const getRelationType = function (type) {
962 switch (type) {
963 case _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].relationType.AGGREGATION:
964 return 'aggregation';
965
966 case _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].relationType.EXTENSION:
967 return 'extension';
968
969 case _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].relationType.COMPOSITION:
970 return 'composition';
971
972 case _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].relationType.DEPENDENCY:
973 return 'dependency';
974 }
975 };
976
977 path.points = path.points.filter(p => !Number.isNaN(p.y)); // The data for our line
978
979 const lineData = path.points; // This is the accessor function we talked about above
980
981 const lineFunction = d3__WEBPACK_IMPORTED_MODULE_0__["line"]().x(function (d) {
982 return d.x;
983 }).y(function (d) {
984 return d.y;
985 }).curve(d3__WEBPACK_IMPORTED_MODULE_0__["curveBasis"]);
986 const svgPath = elem.append('path').attr('d', lineFunction(lineData)).attr('id', 'edge' + edgeCount).attr('class', 'relation');
987 let url = '';
988
989 if (conf.arrowMarkerAbsolute) {
990 url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search;
991 url = url.replace(/\(/g, '\\(');
992 url = url.replace(/\)/g, '\\)');
993 }
994
995 if (relation.relation.type1 !== 'none') {
996 svgPath.attr('marker-start', 'url(' + url + '#' + getRelationType(relation.relation.type1) + 'Start' + ')');
997 }
998
999 if (relation.relation.type2 !== 'none') {
1000 svgPath.attr('marker-end', 'url(' + url + '#' + getRelationType(relation.relation.type2) + 'End' + ')');
1001 }
1002
1003 let x, y;
1004 const l = path.points.length;
1005
1006 if (l % 2 !== 0 && l > 1) {
1007 const p1 = path.points[Math.floor(l / 2)];
1008 const p2 = path.points[Math.ceil(l / 2)];
1009 x = (p1.x + p2.x) / 2;
1010 y = (p1.y + p2.y) / 2;
1011 } else {
1012 const p = path.points[Math.floor(l / 2)];
1013 x = p.x;
1014 y = p.y;
1015 }
1016
1017 if (typeof relation.title !== 'undefined') {
1018 const g = elem.append('g').attr('class', 'classLabel');
1019 const label = g.append('text').attr('class', 'label').attr('x', x).attr('y', y).attr('fill', 'red').attr('text-anchor', 'middle').text(relation.title);
1020 window.label = label;
1021 const bounds = label.node().getBBox();
1022 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);
1023 }
1024
1025 edgeCount++;
1026};
1027
1028const drawClass = function (elem, classDef) {
1029 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('Rendering class ' + classDef);
1030
1031 const addTspan = function (textEl, txt, isFirst) {
1032 const tSpan = textEl.append('tspan').attr('x', conf.padding).text(txt);
1033
1034 if (!isFirst) {
1035 tSpan.attr('dy', conf.textHeight);
1036 }
1037 };
1038
1039 const id = 'classId' + classCnt % total;
1040 const classInfo = {
1041 id: id,
1042 label: classDef.id,
1043 width: 0,
1044 height: 0
1045 };
1046 const g = elem.append('g').attr('id', id).attr('class', 'classGroup');
1047 const title = g.append('text').attr('x', conf.padding).attr('y', conf.textHeight + conf.padding).text(classDef.id);
1048 const titleHeight = title.node().getBBox().height;
1049 const membersLine = g.append('line') // text label for the x axis
1050 .attr('x1', 0).attr('y1', conf.padding + titleHeight + conf.dividerMargin / 2).attr('y2', conf.padding + titleHeight + conf.dividerMargin / 2);
1051 const members = g.append('text') // text label for the x axis
1052 .attr('x', conf.padding).attr('y', titleHeight + conf.dividerMargin + conf.textHeight).attr('fill', 'white').attr('class', 'classText');
1053 let isFirst = true;
1054 classDef.members.forEach(function (member) {
1055 addTspan(members, member, isFirst);
1056 isFirst = false;
1057 });
1058 const membersBox = members.node().getBBox();
1059 const methodsLine = g.append('line') // text label for the x axis
1060 .attr('x1', 0).attr('y1', conf.padding + titleHeight + conf.dividerMargin + membersBox.height).attr('y2', conf.padding + titleHeight + conf.dividerMargin + membersBox.height);
1061 const methods = g.append('text') // text label for the x axis
1062 .attr('x', conf.padding).attr('y', titleHeight + 2 * conf.dividerMargin + membersBox.height + conf.textHeight).attr('fill', 'white').attr('class', 'classText');
1063 isFirst = true;
1064 classDef.methods.forEach(function (method) {
1065 addTspan(methods, method, isFirst);
1066 isFirst = false;
1067 });
1068 const classBox = g.node().getBBox();
1069 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);
1070 membersLine.attr('x2', classBox.width + 2 * conf.padding);
1071 methodsLine.attr('x2', classBox.width + 2 * conf.padding);
1072 classInfo.width = classBox.width + 2 * conf.padding;
1073 classInfo.height = classBox.height + conf.padding + 0.5 * conf.dividerMargin;
1074 idCache[id] = classInfo;
1075 classCnt++;
1076 return classInfo;
1077};
1078
1079const setConf = function (cnf) {
1080 const keys = Object.keys(cnf);
1081 keys.forEach(function (key) {
1082 conf[key] = cnf[key];
1083 });
1084};
1085/**
1086 * Draws a flowchart in the tag with id: id based on the graph definition in text.
1087 * @param text
1088 * @param id
1089 */
1090
1091const draw = function (text, id) {
1092 _parser_classDiagram__WEBPACK_IMPORTED_MODULE_5__["parser"].yy.clear();
1093 _parser_classDiagram__WEBPACK_IMPORTED_MODULE_5__["parser"].parse(text);
1094 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('Rendering diagram ' + text); /// / Fetch the default direction, use TD if none was found
1095
1096 const diagram = d3__WEBPACK_IMPORTED_MODULE_0__["select"](`[id='${id}']`);
1097 insertMarkers(diagram); // Layout graph, Create a new directed graph
1098
1099 const g = new graphlibrary__WEBPACK_IMPORTED_MODULE_2___default.a.Graph({
1100 multigraph: true
1101 }); // Set an object for the graph label
1102
1103 g.setGraph({
1104 isMultiGraph: true
1105 }); // Default to assigning a new object as a label for each new edge.
1106
1107 g.setDefaultEdgeLabel(function () {
1108 return {};
1109 });
1110 const classes = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].getClasses();
1111 const keys = Object.keys(classes);
1112 total = keys.length;
1113
1114 for (let i = 0; i < keys.length; i++) {
1115 const classDef = classes[keys[i]];
1116 const node = drawClass(diagram, classDef); // Add nodes to the graph. The first argument is the node id. The second is
1117 // metadata about the node. In this case we're going to add labels to each of
1118 // our nodes.
1119
1120 g.setNode(node.id, node);
1121 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('Org height: ' + node.height);
1122 }
1123
1124 const relations = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].getRelations();
1125 relations.forEach(function (relation) {
1126 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('tjoho' + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation));
1127 g.setEdge(getGraphId(relation.id1), getGraphId(relation.id2), {
1128 relation: relation
1129 });
1130 });
1131 dagre_layout__WEBPACK_IMPORTED_MODULE_1___default.a.layout(g);
1132 g.nodes().forEach(function (v) {
1133 if (typeof v !== 'undefined' && typeof g.node(v) !== 'undefined') {
1134 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Node ' + v + ': ' + JSON.stringify(g.node(v)));
1135 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) + ' )');
1136 }
1137 });
1138 g.edges().forEach(function (e) {
1139 if (typeof e !== 'undefined' && typeof g.edge(e) !== 'undefined') {
1140 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(g.edge(e)));
1141 drawEdge(diagram, g.edge(e), g.edge(e).relation);
1142 }
1143 });
1144 diagram.attr('height', '100%');
1145 diagram.attr('width', '100%');
1146 diagram.attr('viewBox', '0 0 ' + (g.graph().width + 20) + ' ' + (g.graph().height + 20));
1147};
1148/* harmony default export */ __webpack_exports__["default"] = ({
1149 setConf,
1150 draw
1151});
1152
1153/***/ }),
1154
1155/***/ "./src/diagrams/class/parser/classDiagram.jison":
1156/*!******************************************************!*\
1157 !*** ./src/diagrams/class/parser/classDiagram.jison ***!
1158 \******************************************************/
1159/*! no static exports found */
1160/***/ (function(module, exports, __webpack_require__) {
1161
1162/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */
1163/*
1164 Returns a Parser object of the following structure:
1165
1166 Parser: {
1167 yy: {}
1168 }
1169
1170 Parser.prototype: {
1171 yy: {},
1172 trace: function(),
1173 symbols_: {associative list: name ==> number},
1174 terminals_: {associative list: number ==> name},
1175 productions_: [...],
1176 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
1177 table: [...],
1178 defaultActions: {...},
1179 parseError: function(str, hash),
1180 parse: function(input),
1181
1182 lexer: {
1183 EOF: 1,
1184 parseError: function(str, hash),
1185 setInput: function(input),
1186 input: function(),
1187 unput: function(str),
1188 more: function(),
1189 less: function(n),
1190 pastInput: function(),
1191 upcomingInput: function(),
1192 showPosition: function(),
1193 test_match: function(regex_match_array, rule_index),
1194 next: function(),
1195 lex: function(),
1196 begin: function(condition),
1197 popState: function(),
1198 _currentRules: function(),
1199 topState: function(),
1200 pushState: function(condition),
1201
1202 options: {
1203 ranges: boolean (optional: true ==> token location info will include a .range[] member)
1204 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
1205 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)
1206 },
1207
1208 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
1209 rules: [...],
1210 conditions: {associative list: name ==> set},
1211 }
1212 }
1213
1214
1215 token location info (@$, _$, etc.): {
1216 first_line: n,
1217 last_line: n,
1218 first_column: n,
1219 last_column: n,
1220 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
1221 }
1222
1223
1224 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
1225 text: (matched text)
1226 token: (the produced terminal token, if any)
1227 line: (yylineno)
1228 }
1229 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
1230 loc: (yylloc)
1231 expected: (string describing the set of expected tokens)
1232 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
1233 }
1234*/
1235var parser = (function(){
1236var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,11],$V1=[1,12],$V2=[1,13],$V3=[1,15],$V4=[1,16],$V5=[1,17],$V6=[6,8],$V7=[1,26],$V8=[1,27],$V9=[1,28],$Va=[1,29],$Vb=[1,30],$Vc=[1,31],$Vd=[6,8,13,17,23,26,27,28,29,30,31],$Ve=[6,8,13,17,23,26,27,28,29,30,31,45,46,47],$Vf=[23,45,46,47],$Vg=[23,30,31,45,46,47],$Vh=[23,26,27,28,29,45,46,47],$Vi=[6,8,13],$Vj=[1,46];
1237var parser = {trace: function trace () { },
1238yy: {},
1239symbols_: {"error":2,"mermaidDoc":3,"graphConfig":4,"CLASS_DIAGRAM":5,"NEWLINE":6,"statements":7,"EOF":8,"statement":9,"className":10,"alphaNumToken":11,"relationStatement":12,"LABEL":13,"classStatement":14,"methodStatement":15,"CLASS":16,"STRUCT_START":17,"members":18,"STRUCT_STOP":19,"MEMBER":20,"SEPARATOR":21,"relation":22,"STR":23,"relationType":24,"lineType":25,"AGGREGATION":26,"EXTENSION":27,"COMPOSITION":28,"DEPENDENCY":29,"LINE":30,"DOTTED_LINE":31,"commentToken":32,"textToken":33,"graphCodeTokens":34,"textNoTagsToken":35,"TAGSTART":36,"TAGEND":37,"==":38,"--":39,"PCT":40,"DEFAULT":41,"SPACE":42,"MINUS":43,"keywords":44,"UNICODE_TEXT":45,"NUM":46,"ALPHA":47,"$accept":0,"$end":1},
1240terminals_: {2:"error",5:"CLASS_DIAGRAM",6:"NEWLINE",8:"EOF",13:"LABEL",16:"CLASS",17:"STRUCT_START",19:"STRUCT_STOP",20:"MEMBER",21:"SEPARATOR",23:"STR",26:"AGGREGATION",27:"EXTENSION",28:"COMPOSITION",29:"DEPENDENCY",30:"LINE",31:"DOTTED_LINE",34:"graphCodeTokens",36:"TAGSTART",37:"TAGEND",38:"==",39:"--",40:"PCT",41:"DEFAULT",42:"SPACE",43:"MINUS",44:"keywords",45:"UNICODE_TEXT",46:"NUM",47:"ALPHA"},
1241productions_: [0,[3,1],[4,4],[7,1],[7,2],[7,3],[10,2],[10,1],[9,1],[9,2],[9,1],[9,1],[14,2],[14,5],[18,1],[18,2],[15,1],[15,2],[15,1],[15,1],[12,3],[12,4],[12,4],[12,5],[22,3],[22,2],[22,2],[22,1],[24,1],[24,1],[24,1],[24,1],[25,1],[25,1],[32,1],[32,1],[33,1],[33,1],[33,1],[33,1],[33,1],[33,1],[33,1],[35,1],[35,1],[35,1],[35,1],[11,1],[11,1],[11,1]],
1242performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
1243/* this == yyval */
1244
1245var $0 = $$.length - 1;
1246switch (yystate) {
1247case 6:
1248 this.$=$$[$0-1]+$$[$0];
1249break;
1250case 7:
1251 this.$=$$[$0];
1252break;
1253case 8:
1254 yy.addRelation($$[$0]);
1255break;
1256case 9:
1257 $$[$0-1].title = yy.cleanupLabel($$[$0]); yy.addRelation($$[$0-1]);
1258break;
1259case 12:
1260yy.addClass($$[$0]);
1261break;
1262case 13:
1263/*console.log($$[$0-3],JSON.stringify($$[$0-1]));*/yy.addClass($$[$0-3]);yy.addMembers($$[$0-3],$$[$0-1]);
1264break;
1265case 14:
1266 this.$ = [$$[$0]];
1267break;
1268case 15:
1269 $$[$0].push($$[$0-1]);this.$=$$[$0];
1270break;
1271case 16:
1272/*console.log('Rel found',$$[$0]);*/
1273break;
1274case 17:
1275yy.addMember($$[$0-1],yy.cleanupLabel($$[$0]));
1276break;
1277case 18:
1278console.warn('Member',$$[$0]);
1279break;
1280case 19:
1281/*console.log('sep found',$$[$0]);*/
1282break;
1283case 20:
1284 this.$ = {'id1':$$[$0-2],'id2':$$[$0], relation:$$[$0-1], relationTitle1:'none', relationTitle2:'none'};
1285break;
1286case 21:
1287 this.$ = {id1:$$[$0-3], id2:$$[$0], relation:$$[$0-1], relationTitle1:$$[$0-2], relationTitle2:'none'}
1288break;
1289case 22:
1290 this.$ = {id1:$$[$0-3], id2:$$[$0], relation:$$[$0-2], relationTitle1:'none', relationTitle2:$$[$0-1]};
1291break;
1292case 23:
1293 this.$ = {id1:$$[$0-4], id2:$$[$0], relation:$$[$0-2], relationTitle1:$$[$0-3], relationTitle2:$$[$0-1]}
1294break;
1295case 24:
1296 this.$={type1:$$[$0-2],type2:$$[$0],lineType:$$[$0-1]};
1297break;
1298case 25:
1299 this.$={type1:'none',type2:$$[$0],lineType:$$[$0-1]};
1300break;
1301case 26:
1302 this.$={type1:$$[$0-1],type2:'none',lineType:$$[$0]};
1303break;
1304case 27:
1305 this.$={type1:'none',type2:'none',lineType:$$[$0]};
1306break;
1307case 28:
1308 this.$=yy.relationType.AGGREGATION;
1309break;
1310case 29:
1311 this.$=yy.relationType.EXTENSION;
1312break;
1313case 30:
1314 this.$=yy.relationType.COMPOSITION;
1315break;
1316case 31:
1317 this.$=yy.relationType.DEPENDENCY;
1318break;
1319case 32:
1320this.$=yy.lineType.LINE;
1321break;
1322case 33:
1323this.$=yy.lineType.DOTTED_LINE;
1324break;
1325}
1326},
1327table: [{3:1,4:2,5:[1,3]},{1:[3]},{1:[2,1]},{6:[1,4]},{7:5,9:6,10:10,11:14,12:7,14:8,15:9,16:$V0,20:$V1,21:$V2,45:$V3,46:$V4,47:$V5},{8:[1,18]},{6:[1,19],8:[2,3]},o($V6,[2,8],{13:[1,20]}),o($V6,[2,10]),o($V6,[2,11]),o($V6,[2,16],{22:21,24:24,25:25,13:[1,23],23:[1,22],26:$V7,27:$V8,28:$V9,29:$Va,30:$Vb,31:$Vc}),{10:32,11:14,45:$V3,46:$V4,47:$V5},o($V6,[2,18]),o($V6,[2,19]),o($Vd,[2,7],{11:14,10:33,45:$V3,46:$V4,47:$V5}),o($Ve,[2,47]),o($Ve,[2,48]),o($Ve,[2,49]),{1:[2,2]},{7:34,8:[2,4],9:6,10:10,11:14,12:7,14:8,15:9,16:$V0,20:$V1,21:$V2,45:$V3,46:$V4,47:$V5},o($V6,[2,9]),{10:35,11:14,23:[1,36],45:$V3,46:$V4,47:$V5},{22:37,24:24,25:25,26:$V7,27:$V8,28:$V9,29:$Va,30:$Vb,31:$Vc},o($V6,[2,17]),{25:38,30:$Vb,31:$Vc},o($Vf,[2,27],{24:39,26:$V7,27:$V8,28:$V9,29:$Va}),o($Vg,[2,28]),o($Vg,[2,29]),o($Vg,[2,30]),o($Vg,[2,31]),o($Vh,[2,32]),o($Vh,[2,33]),o($V6,[2,12],{17:[1,40]}),o($Vd,[2,6]),{8:[2,5]},o($Vi,[2,20]),{10:41,11:14,45:$V3,46:$V4,47:$V5},{10:42,11:14,23:[1,43],45:$V3,46:$V4,47:$V5},o($Vf,[2,26],{24:44,26:$V7,27:$V8,28:$V9,29:$Va}),o($Vf,[2,25]),{18:45,20:$Vj},o($Vi,[2,22]),o($Vi,[2,21]),{10:47,11:14,45:$V3,46:$V4,47:$V5},o($Vf,[2,24]),{19:[1,48]},{18:49,19:[2,14],20:$Vj},o($Vi,[2,23]),o($V6,[2,13]),{19:[2,15]}],
1328defaultActions: {2:[2,1],18:[2,2],34:[2,5],49:[2,15]},
1329parseError: function parseError (str, hash) {
1330 if (hash.recoverable) {
1331 this.trace(str);
1332 } else {
1333 var error = new Error(str);
1334 error.hash = hash;
1335 throw error;
1336 }
1337},
1338parse: function parse(input) {
1339 var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
1340 var args = lstack.slice.call(arguments, 1);
1341 var lexer = Object.create(this.lexer);
1342 var sharedState = { yy: {} };
1343 for (var k in this.yy) {
1344 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
1345 sharedState.yy[k] = this.yy[k];
1346 }
1347 }
1348 lexer.setInput(input, sharedState.yy);
1349 sharedState.yy.lexer = lexer;
1350 sharedState.yy.parser = this;
1351 if (typeof lexer.yylloc == 'undefined') {
1352 lexer.yylloc = {};
1353 }
1354 var yyloc = lexer.yylloc;
1355 lstack.push(yyloc);
1356 var ranges = lexer.options && lexer.options.ranges;
1357 if (typeof sharedState.yy.parseError === 'function') {
1358 this.parseError = sharedState.yy.parseError;
1359 } else {
1360 this.parseError = Object.getPrototypeOf(this).parseError;
1361 }
1362 function popStack(n) {
1363 stack.length = stack.length - 2 * n;
1364 vstack.length = vstack.length - n;
1365 lstack.length = lstack.length - n;
1366 }
1367 function lex() {
1368 var token;
1369 token = tstack.pop() || lexer.lex() || EOF;
1370 if (typeof token !== 'number') {
1371 if (token instanceof Array) {
1372 tstack = token;
1373 token = tstack.pop();
1374 }
1375 token = self.symbols_[token] || token;
1376 }
1377 return token;
1378 }
1379 var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
1380 while (true) {
1381 state = stack[stack.length - 1];
1382 if (this.defaultActions[state]) {
1383 action = this.defaultActions[state];
1384 } else {
1385 if (symbol === null || typeof symbol == 'undefined') {
1386 symbol = lex();
1387 }
1388 action = table[state] && table[state][symbol];
1389 }
1390 if (typeof action === 'undefined' || !action.length || !action[0]) {
1391 var errStr = '';
1392 expected = [];
1393 for (p in table[state]) {
1394 if (this.terminals_[p] && p > TERROR) {
1395 expected.push('\'' + this.terminals_[p] + '\'');
1396 }
1397 }
1398 if (lexer.showPosition) {
1399 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
1400 } else {
1401 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
1402 }
1403 this.parseError(errStr, {
1404 text: lexer.match,
1405 token: this.terminals_[symbol] || symbol,
1406 line: lexer.yylineno,
1407 loc: yyloc,
1408 expected: expected
1409 });
1410 }
1411 if (action[0] instanceof Array && action.length > 1) {
1412 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
1413 }
1414 switch (action[0]) {
1415 case 1:
1416 stack.push(symbol);
1417 vstack.push(lexer.yytext);
1418 lstack.push(lexer.yylloc);
1419 stack.push(action[1]);
1420 symbol = null;
1421 if (!preErrorSymbol) {
1422 yyleng = lexer.yyleng;
1423 yytext = lexer.yytext;
1424 yylineno = lexer.yylineno;
1425 yyloc = lexer.yylloc;
1426 if (recovering > 0) {
1427 recovering--;
1428 }
1429 } else {
1430 symbol = preErrorSymbol;
1431 preErrorSymbol = null;
1432 }
1433 break;
1434 case 2:
1435 len = this.productions_[action[1]][1];
1436 yyval.$ = vstack[vstack.length - len];
1437 yyval._$ = {
1438 first_line: lstack[lstack.length - (len || 1)].first_line,
1439 last_line: lstack[lstack.length - 1].last_line,
1440 first_column: lstack[lstack.length - (len || 1)].first_column,
1441 last_column: lstack[lstack.length - 1].last_column
1442 };
1443 if (ranges) {
1444 yyval._$.range = [
1445 lstack[lstack.length - (len || 1)].range[0],
1446 lstack[lstack.length - 1].range[1]
1447 ];
1448 }
1449 r = this.performAction.apply(yyval, [
1450 yytext,
1451 yyleng,
1452 yylineno,
1453 sharedState.yy,
1454 action[1],
1455 vstack,
1456 lstack
1457 ].concat(args));
1458 if (typeof r !== 'undefined') {
1459 return r;
1460 }
1461 if (len) {
1462 stack = stack.slice(0, -1 * len * 2);
1463 vstack = vstack.slice(0, -1 * len);
1464 lstack = lstack.slice(0, -1 * len);
1465 }
1466 stack.push(this.productions_[action[1]][0]);
1467 vstack.push(yyval.$);
1468 lstack.push(yyval._$);
1469 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
1470 stack.push(newState);
1471 break;
1472 case 3:
1473 return true;
1474 }
1475 }
1476 return true;
1477}};
1478
1479/* generated by jison-lex 0.3.4 */
1480var lexer = (function(){
1481var lexer = ({
1482
1483EOF:1,
1484
1485parseError:function parseError(str, hash) {
1486 if (this.yy.parser) {
1487 this.yy.parser.parseError(str, hash);
1488 } else {
1489 throw new Error(str);
1490 }
1491 },
1492
1493// resets the lexer, sets new input
1494setInput:function (input, yy) {
1495 this.yy = yy || this.yy || {};
1496 this._input = input;
1497 this._more = this._backtrack = this.done = false;
1498 this.yylineno = this.yyleng = 0;
1499 this.yytext = this.matched = this.match = '';
1500 this.conditionStack = ['INITIAL'];
1501 this.yylloc = {
1502 first_line: 1,
1503 first_column: 0,
1504 last_line: 1,
1505 last_column: 0
1506 };
1507 if (this.options.ranges) {
1508 this.yylloc.range = [0,0];
1509 }
1510 this.offset = 0;
1511 return this;
1512 },
1513
1514// consumes and returns one char from the input
1515input:function () {
1516 var ch = this._input[0];
1517 this.yytext += ch;
1518 this.yyleng++;
1519 this.offset++;
1520 this.match += ch;
1521 this.matched += ch;
1522 var lines = ch.match(/(?:\r\n?|\n).*/g);
1523 if (lines) {
1524 this.yylineno++;
1525 this.yylloc.last_line++;
1526 } else {
1527 this.yylloc.last_column++;
1528 }
1529 if (this.options.ranges) {
1530 this.yylloc.range[1]++;
1531 }
1532
1533 this._input = this._input.slice(1);
1534 return ch;
1535 },
1536
1537// unshifts one char (or a string) into the input
1538unput:function (ch) {
1539 var len = ch.length;
1540 var lines = ch.split(/(?:\r\n?|\n)/g);
1541
1542 this._input = ch + this._input;
1543 this.yytext = this.yytext.substr(0, this.yytext.length - len);
1544 //this.yyleng -= len;
1545 this.offset -= len;
1546 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
1547 this.match = this.match.substr(0, this.match.length - 1);
1548 this.matched = this.matched.substr(0, this.matched.length - 1);
1549
1550 if (lines.length - 1) {
1551 this.yylineno -= lines.length - 1;
1552 }
1553 var r = this.yylloc.range;
1554
1555 this.yylloc = {
1556 first_line: this.yylloc.first_line,
1557 last_line: this.yylineno + 1,
1558 first_column: this.yylloc.first_column,
1559 last_column: lines ?
1560 (lines.length === oldLines.length ? this.yylloc.first_column : 0)
1561 + oldLines[oldLines.length - lines.length].length - lines[0].length :
1562 this.yylloc.first_column - len
1563 };
1564
1565 if (this.options.ranges) {
1566 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
1567 }
1568 this.yyleng = this.yytext.length;
1569 return this;
1570 },
1571
1572// When called from action, caches matched text and appends it on next action
1573more:function () {
1574 this._more = true;
1575 return this;
1576 },
1577
1578// 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.
1579reject:function () {
1580 if (this.options.backtrack_lexer) {
1581 this._backtrack = true;
1582 } else {
1583 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(), {
1584 text: "",
1585 token: null,
1586 line: this.yylineno
1587 });
1588
1589 }
1590 return this;
1591 },
1592
1593// retain first n characters of the match
1594less:function (n) {
1595 this.unput(this.match.slice(n));
1596 },
1597
1598// displays already matched input, i.e. for error messages
1599pastInput:function () {
1600 var past = this.matched.substr(0, this.matched.length - this.match.length);
1601 return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
1602 },
1603
1604// displays upcoming input, i.e. for error messages
1605upcomingInput:function () {
1606 var next = this.match;
1607 if (next.length < 20) {
1608 next += this._input.substr(0, 20-next.length);
1609 }
1610 return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
1611 },
1612
1613// displays the character position where the lexing error occurred, i.e. for error messages
1614showPosition:function () {
1615 var pre = this.pastInput();
1616 var c = new Array(pre.length + 1).join("-");
1617 return pre + this.upcomingInput() + "\n" + c + "^";
1618 },
1619
1620// test the lexed token: return FALSE when not a match, otherwise return token
1621test_match:function(match, indexed_rule) {
1622 var token,
1623 lines,
1624 backup;
1625
1626 if (this.options.backtrack_lexer) {
1627 // save context
1628 backup = {
1629 yylineno: this.yylineno,
1630 yylloc: {
1631 first_line: this.yylloc.first_line,
1632 last_line: this.last_line,
1633 first_column: this.yylloc.first_column,
1634 last_column: this.yylloc.last_column
1635 },
1636 yytext: this.yytext,
1637 match: this.match,
1638 matches: this.matches,
1639 matched: this.matched,
1640 yyleng: this.yyleng,
1641 offset: this.offset,
1642 _more: this._more,
1643 _input: this._input,
1644 yy: this.yy,
1645 conditionStack: this.conditionStack.slice(0),
1646 done: this.done
1647 };
1648 if (this.options.ranges) {
1649 backup.yylloc.range = this.yylloc.range.slice(0);
1650 }
1651 }
1652
1653 lines = match[0].match(/(?:\r\n?|\n).*/g);
1654 if (lines) {
1655 this.yylineno += lines.length;
1656 }
1657 this.yylloc = {
1658 first_line: this.yylloc.last_line,
1659 last_line: this.yylineno + 1,
1660 first_column: this.yylloc.last_column,
1661 last_column: lines ?
1662 lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
1663 this.yylloc.last_column + match[0].length
1664 };
1665 this.yytext += match[0];
1666 this.match += match[0];
1667 this.matches = match;
1668 this.yyleng = this.yytext.length;
1669 if (this.options.ranges) {
1670 this.yylloc.range = [this.offset, this.offset += this.yyleng];
1671 }
1672 this._more = false;
1673 this._backtrack = false;
1674 this._input = this._input.slice(match[0].length);
1675 this.matched += match[0];
1676 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
1677 if (this.done && this._input) {
1678 this.done = false;
1679 }
1680 if (token) {
1681 return token;
1682 } else if (this._backtrack) {
1683 // recover context
1684 for (var k in backup) {
1685 this[k] = backup[k];
1686 }
1687 return false; // rule action called reject() implying the next rule should be tested instead.
1688 }
1689 return false;
1690 },
1691
1692// return next match in input
1693next:function () {
1694 if (this.done) {
1695 return this.EOF;
1696 }
1697 if (!this._input) {
1698 this.done = true;
1699 }
1700
1701 var token,
1702 match,
1703 tempMatch,
1704 index;
1705 if (!this._more) {
1706 this.yytext = '';
1707 this.match = '';
1708 }
1709 var rules = this._currentRules();
1710 for (var i = 0; i < rules.length; i++) {
1711 tempMatch = this._input.match(this.rules[rules[i]]);
1712 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
1713 match = tempMatch;
1714 index = i;
1715 if (this.options.backtrack_lexer) {
1716 token = this.test_match(tempMatch, rules[i]);
1717 if (token !== false) {
1718 return token;
1719 } else if (this._backtrack) {
1720 match = false;
1721 continue; // rule action called reject() implying a rule MISmatch.
1722 } else {
1723 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
1724 return false;
1725 }
1726 } else if (!this.options.flex) {
1727 break;
1728 }
1729 }
1730 }
1731 if (match) {
1732 token = this.test_match(match, rules[index]);
1733 if (token !== false) {
1734 return token;
1735 }
1736 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
1737 return false;
1738 }
1739 if (this._input === "") {
1740 return this.EOF;
1741 } else {
1742 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
1743 text: "",
1744 token: null,
1745 line: this.yylineno
1746 });
1747 }
1748 },
1749
1750// return next match that has a token
1751lex:function lex () {
1752 var r = this.next();
1753 if (r) {
1754 return r;
1755 } else {
1756 return this.lex();
1757 }
1758 },
1759
1760// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
1761begin:function begin (condition) {
1762 this.conditionStack.push(condition);
1763 },
1764
1765// pop the previously active lexer condition state off the condition stack
1766popState:function popState () {
1767 var n = this.conditionStack.length - 1;
1768 if (n > 0) {
1769 return this.conditionStack.pop();
1770 } else {
1771 return this.conditionStack[0];
1772 }
1773 },
1774
1775// produce the lexer rule set which is active for the currently active lexer condition state
1776_currentRules:function _currentRules () {
1777 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
1778 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
1779 } else {
1780 return this.conditions["INITIAL"].rules;
1781 }
1782 },
1783
1784// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
1785topState:function topState (n) {
1786 n = this.conditionStack.length - 1 - Math.abs(n || 0);
1787 if (n >= 0) {
1788 return this.conditionStack[n];
1789 } else {
1790 return "INITIAL";
1791 }
1792 },
1793
1794// alias for begin(condition)
1795pushState:function pushState (condition) {
1796 this.begin(condition);
1797 },
1798
1799// return the number of states currently on the stack
1800stateStackSize:function stateStackSize() {
1801 return this.conditionStack.length;
1802 },
1803options: {},
1804performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
1805var YYSTATE=YY_START;
1806switch($avoiding_name_collisions) {
1807case 0:/* do nothing */
1808break;
1809case 1:return 6;
1810break;
1811case 2:/* skip whitespace */
1812break;
1813case 3:return 5;
1814break;
1815case 4: this.begin("struct"); /*console.log('Starting struct');*/return 17;
1816break;
1817case 5: /*console.log('Ending struct');*/this.popState(); return 19;
1818break;
1819case 6:/* nothing */
1820break;
1821case 7: /*console.log('lex-member: ' + yy_.yytext);*/ return "MEMBER";
1822break;
1823case 8:return 16;
1824break;
1825case 9:this.begin("string");
1826break;
1827case 10:this.popState();
1828break;
1829case 11:return "STR";
1830break;
1831case 12:return 27;
1832break;
1833case 13:return 27;
1834break;
1835case 14:return 29;
1836break;
1837case 15:return 29;
1838break;
1839case 16:return 28;
1840break;
1841case 17:return 26;
1842break;
1843case 18:return 30;
1844break;
1845case 19:return 31;
1846break;
1847case 20:return 13;
1848break;
1849case 21:return 43;
1850break;
1851case 22:return 'DOT';
1852break;
1853case 23:return 'PLUS';
1854break;
1855case 24:return 40;
1856break;
1857case 25:return 'EQUALS';
1858break;
1859case 26:return 'EQUALS';
1860break;
1861case 27:return 47;
1862break;
1863case 28:return 'PUNCTUATION';
1864break;
1865case 29:return 46;
1866break;
1867case 30:return 45;
1868break;
1869case 31:return 42;
1870break;
1871case 32:return 8;
1872break;
1873}
1874},
1875rules: [/^(?:%%[^\n]*)/,/^(?:\n+)/,/^(?:\s+)/,/^(?:classDiagram\b)/,/^(?:[\{])/,/^(?:\})/,/^(?:[\n])/,/^(?:[^\{\}\n]*)/,/^(?:class\b)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:--)/,/^(?:\.\.)/,/^(?::[^#\n;]+)/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:[A-Za-z]+)/,/^(?:[!"#$%&'*+,-.`?\\_\/])/,/^(?:[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)/,/^(?:$)/],
1876conditions: {"string":{"rules":[10,11],"inclusive":false},"struct":{"rules":[5,6,7],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,8,9,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32],"inclusive":true}}
1877});
1878return lexer;
1879})();
1880parser.lexer = lexer;
1881function Parser () {
1882 this.yy = {};
1883}
1884Parser.prototype = parser;parser.Parser = Parser;
1885return new Parser;
1886})();
1887
1888
1889if (true) {
1890exports.parser = parser;
1891exports.Parser = parser.Parser;
1892exports.parse = function () { return parser.parse.apply(parser, arguments); };
1893exports.main = function commonjsMain (args) {
1894 if (!args[1]) {
1895 console.log('Usage: '+args[0]+' FILE');
1896 process.exit(1);
1897 }
1898 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");
1899 return exports.parser.parse(source);
1900};
1901if ( true && __webpack_require__.c[__webpack_require__.s] === module) {
1902 exports.main(process.argv.slice(1));
1903}
1904}
1905/* 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)))
1906
1907/***/ }),
1908
1909/***/ "./src/diagrams/flowchart/flowDb.js":
1910/*!******************************************!*\
1911 !*** ./src/diagrams/flowchart/flowDb.js ***!
1912 \******************************************/
1913/*! exports provided: addVertex, addLink, updateLinkInterpolate, updateLink, addClass, setDirection, setClass, setLink, getTooltip, setClickEvent, bindFunctions, getDirection, getVertices, getEdges, getClasses, clear, defaultStyle, addSubGraph, getDepthFirstPos, indexNodes, getSubGraphs, firstGraph, default */
1914/***/ (function(module, __webpack_exports__, __webpack_require__) {
1915
1916"use strict";
1917__webpack_require__.r(__webpack_exports__);
1918/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addVertex", function() { return addVertex; });
1919/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addLink", function() { return addLink; });
1920/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateLinkInterpolate", function() { return updateLinkInterpolate; });
1921/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateLink", function() { return updateLink; });
1922/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addClass", function() { return addClass; });
1923/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setDirection", function() { return setDirection; });
1924/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setClass", function() { return setClass; });
1925/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLink", function() { return setLink; });
1926/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTooltip", function() { return getTooltip; });
1927/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setClickEvent", function() { return setClickEvent; });
1928/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bindFunctions", function() { return bindFunctions; });
1929/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDirection", function() { return getDirection; });
1930/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getVertices", function() { return getVertices; });
1931/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEdges", function() { return getEdges; });
1932/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClasses", function() { return getClasses; });
1933/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clear", function() { return clear; });
1934/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultStyle", function() { return defaultStyle; });
1935/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addSubGraph", function() { return addSubGraph; });
1936/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDepthFirstPos", function() { return getDepthFirstPos; });
1937/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "indexNodes", function() { return indexNodes; });
1938/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSubGraphs", function() { return getSubGraphs; });
1939/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstGraph", function() { return firstGraph; });
1940/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
1941/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
1942/* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @braintree/sanitize-url */ "@braintree/sanitize-url");
1943/* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1__);
1944/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
1945/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils */ "./src/utils.js");
1946/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../config */ "./src/config.js");
1947
1948
1949
1950
1951
1952const config = Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])();
1953let vertices = {};
1954let edges = [];
1955let classes = [];
1956let subGraphs = [];
1957let subGraphLookup = {};
1958let tooltips = {};
1959let subCount = 0;
1960let firstGraphFlag = true;
1961let direction; // Functions to be run after graph rendering
1962
1963let funs = [];
1964
1965const sanitize = text => {
1966 let txt = text;
1967
1968 if (config.securityLevel !== 'loose') {
1969 txt = txt.replace(/<br>/g, '#br#');
1970 txt = txt.replace(/<br\S*?\/>/g, '#br#');
1971 txt = txt.replace(/</g, '&lt;').replace(/>/g, '&gt;');
1972 txt = txt.replace(/=/g, '&equals;');
1973 txt = txt.replace(/#br#/g, '<br/>');
1974 }
1975
1976 return txt;
1977};
1978/**
1979 * Function called by parser when a node definition has been found
1980 * @param id
1981 * @param text
1982 * @param type
1983 * @param style
1984 * @param classes
1985 */
1986
1987
1988const addVertex = function (_id, text, type, style, classes) {
1989 let txt;
1990 let id = _id;
1991
1992 if (typeof id === 'undefined') {
1993 return;
1994 }
1995
1996 if (id.trim().length === 0) {
1997 return;
1998 }
1999
2000 if (id[0].match(/\d/)) id = 's' + id;
2001
2002 if (typeof vertices[id] === 'undefined') {
2003 vertices[id] = {
2004 id: id,
2005 styles: [],
2006 classes: []
2007 };
2008 }
2009
2010 if (typeof text !== 'undefined') {
2011 txt = sanitize(text.trim()); // strip quotes if string starts and exnds with a quote
2012
2013 if (txt[0] === '"' && txt[txt.length - 1] === '"') {
2014 txt = txt.substring(1, txt.length - 1);
2015 }
2016
2017 vertices[id].text = txt;
2018 } else {
2019 if (!vertices[id].text) {
2020 vertices[id].text = _id;
2021 }
2022 }
2023
2024 if (typeof type !== 'undefined') {
2025 vertices[id].type = type;
2026 }
2027
2028 if (typeof style !== 'undefined') {
2029 if (style !== null) {
2030 style.forEach(function (s) {
2031 vertices[id].styles.push(s);
2032 });
2033 }
2034 }
2035
2036 if (typeof classes !== 'undefined') {
2037 if (classes !== null) {
2038 classes.forEach(function (s) {
2039 vertices[id].classes.push(s);
2040 });
2041 }
2042 }
2043};
2044/**
2045 * Function called by parser when a link/edge definition has been found
2046 * @param start
2047 * @param end
2048 * @param type
2049 * @param linktext
2050 */
2051
2052const addLink = function (_start, _end, type, linktext) {
2053 let start = _start;
2054 let end = _end;
2055 if (start[0].match(/\d/)) start = 's' + start;
2056 if (end[0].match(/\d/)) end = 's' + end;
2057 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].info('Got edge...', start, end);
2058 const edge = {
2059 start: start,
2060 end: end,
2061 type: undefined,
2062 text: ''
2063 };
2064 linktext = type.text;
2065
2066 if (typeof linktext !== 'undefined') {
2067 edge.text = sanitize(linktext.trim()); // strip quotes if string starts and exnds with a quote
2068
2069 if (edge.text[0] === '"' && edge.text[edge.text.length - 1] === '"') {
2070 edge.text = edge.text.substring(1, edge.text.length - 1);
2071 }
2072 }
2073
2074 if (typeof type !== 'undefined') {
2075 edge.type = type.type;
2076 edge.stroke = type.stroke;
2077 }
2078
2079 edges.push(edge);
2080};
2081/**
2082 * Updates a link's line interpolation algorithm
2083 * @param pos
2084 * @param interpolate
2085 */
2086
2087const updateLinkInterpolate = function (positions, interp) {
2088 positions.forEach(function (pos) {
2089 if (pos === 'default') {
2090 edges.defaultInterpolate = interp;
2091 } else {
2092 edges[pos].interpolate = interp;
2093 }
2094 });
2095};
2096/**
2097 * Updates a link with a style
2098 * @param pos
2099 * @param style
2100 */
2101
2102const updateLink = function (positions, style) {
2103 positions.forEach(function (pos) {
2104 if (pos === 'default') {
2105 edges.defaultStyle = style;
2106 } else {
2107 if (_utils__WEBPACK_IMPORTED_MODULE_3__["default"].isSubstringInArray('fill', style) === -1) {
2108 style.push('fill:none');
2109 }
2110
2111 edges[pos].style = style;
2112 }
2113 });
2114};
2115const addClass = function (id, style) {
2116 if (typeof classes[id] === 'undefined') {
2117 classes[id] = {
2118 id: id,
2119 styles: []
2120 };
2121 }
2122
2123 if (typeof style !== 'undefined') {
2124 if (style !== null) {
2125 style.forEach(function (s) {
2126 classes[id].styles.push(s);
2127 });
2128 }
2129 }
2130};
2131/**
2132 * Called by parser when a graph definition is found, stores the direction of the chart.
2133 * @param dir
2134 */
2135
2136const setDirection = function (dir) {
2137 direction = dir;
2138
2139 if (direction.match(/.*</)) {
2140 direction = 'RL';
2141 }
2142
2143 if (direction.match(/.*\^/)) {
2144 direction = 'BT';
2145 }
2146
2147 if (direction.match(/.*>/)) {
2148 direction = 'LR';
2149 }
2150
2151 if (direction.match(/.*v/)) {
2152 direction = 'TB';
2153 }
2154};
2155/**
2156 * Called by parser when a special node is found, e.g. a clickable element.
2157 * @param ids Comma separated list of ids
2158 * @param className Class to add
2159 */
2160
2161const setClass = function (ids, className) {
2162 ids.split(',').forEach(function (_id) {
2163 let id = _id;
2164 if (_id[0].match(/\d/)) id = 's' + id;
2165
2166 if (typeof vertices[id] !== 'undefined') {
2167 vertices[id].classes.push(className);
2168 }
2169
2170 if (typeof subGraphLookup[id] !== 'undefined') {
2171 subGraphLookup[id].classes.push(className);
2172 }
2173 });
2174};
2175
2176const setTooltip = function (ids, tooltip) {
2177 ids.split(',').forEach(function (id) {
2178 if (typeof tooltip !== 'undefined') {
2179 tooltips[id] = sanitize(tooltip);
2180 }
2181 });
2182};
2183
2184const setClickFun = function (_id, functionName) {
2185 let id = _id;
2186 if (_id[0].match(/\d/)) id = 's' + id;
2187
2188 if (config.securityLevel !== 'loose') {
2189 return;
2190 }
2191
2192 if (typeof functionName === 'undefined') {
2193 return;
2194 }
2195
2196 if (typeof vertices[id] !== 'undefined') {
2197 funs.push(function (element) {
2198 const elem = document.querySelector(`[id="${id}"]`);
2199
2200 if (elem !== null) {
2201 elem.addEventListener('click', function () {
2202 window[functionName](id);
2203 }, false);
2204 }
2205 });
2206 }
2207};
2208/**
2209 * Called by parser when a link is found. Adds the URL to the vertex data.
2210 * @param ids Comma separated list of ids
2211 * @param linkStr URL to create a link for
2212 * @param tooltip Tooltip for the clickable element
2213 */
2214
2215
2216const setLink = function (ids, linkStr, tooltip) {
2217 ids.split(',').forEach(function (_id) {
2218 let id = _id;
2219 if (_id[0].match(/\d/)) id = 's' + id;
2220
2221 if (typeof vertices[id] !== 'undefined') {
2222 if (config.securityLevel !== 'loose') {
2223 vertices[id].link = Object(_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1__["sanitizeUrl"])(linkStr); // .replace(/javascript:.*/g, '')
2224 } else {
2225 vertices[id].link = linkStr;
2226 }
2227 }
2228 });
2229 setTooltip(ids, tooltip);
2230 setClass(ids, 'clickable');
2231};
2232const getTooltip = function (id) {
2233 return tooltips[id];
2234};
2235/**
2236 * Called by parser when a click definition is found. Registers an event handler.
2237 * @param ids Comma separated list of ids
2238 * @param functionName Function to be called on click
2239 * @param tooltip Tooltip for the clickable element
2240 */
2241
2242const setClickEvent = function (ids, functionName, tooltip) {
2243 ids.split(',').forEach(function (id) {
2244 setClickFun(id, functionName);
2245 });
2246 setTooltip(ids, tooltip);
2247 setClass(ids, 'clickable');
2248};
2249const bindFunctions = function (element) {
2250 funs.forEach(function (fun) {
2251 fun(element);
2252 });
2253};
2254const getDirection = function () {
2255 return direction.trim();
2256};
2257/**
2258 * Retrieval function for fetching the found nodes after parsing has completed.
2259 * @returns {{}|*|vertices}
2260 */
2261
2262const getVertices = function () {
2263 return vertices;
2264};
2265/**
2266 * Retrieval function for fetching the found links after parsing has completed.
2267 * @returns {{}|*|edges}
2268 */
2269
2270const getEdges = function () {
2271 return edges;
2272};
2273/**
2274 * Retrieval function for fetching the found class definitions after parsing has completed.
2275 * @returns {{}|*|classes}
2276 */
2277
2278const getClasses = function () {
2279 return classes;
2280};
2281
2282const setupToolTips = function (element) {
2283 let tooltipElem = d3__WEBPACK_IMPORTED_MODULE_0__["select"]('.mermaidTooltip');
2284
2285 if ((tooltipElem._groups || tooltipElem)[0][0] === null) {
2286 tooltipElem = d3__WEBPACK_IMPORTED_MODULE_0__["select"]('body').append('div').attr('class', 'mermaidTooltip').style('opacity', 0);
2287 }
2288
2289 const svg = d3__WEBPACK_IMPORTED_MODULE_0__["select"](element).select('svg');
2290 const nodes = svg.selectAll('g.node');
2291 nodes.on('mouseover', function () {
2292 const el = d3__WEBPACK_IMPORTED_MODULE_0__["select"](this);
2293 const title = el.attr('title'); // Dont try to draw a tooltip if no data is provided
2294
2295 if (title === null) {
2296 return;
2297 }
2298
2299 const rect = this.getBoundingClientRect();
2300 tooltipElem.transition().duration(200).style('opacity', '.9');
2301 tooltipElem.html(el.attr('title')).style('left', rect.left + (rect.right - rect.left) / 2 + 'px').style('top', rect.top - 14 + document.body.scrollTop + 'px');
2302 el.classed('hover', true);
2303 }).on('mouseout', function () {
2304 tooltipElem.transition().duration(500).style('opacity', 0);
2305 const el = d3__WEBPACK_IMPORTED_MODULE_0__["select"](this);
2306 el.classed('hover', false);
2307 });
2308};
2309
2310funs.push(setupToolTips);
2311/**
2312 * Clears the internal graph db so that a new graph can be parsed.
2313 */
2314
2315const clear = function () {
2316 vertices = {};
2317 classes = {};
2318 edges = [];
2319 funs = [];
2320 funs.push(setupToolTips);
2321 subGraphs = [];
2322 subGraphLookup = {};
2323 subCount = 0;
2324 tooltips = [];
2325 firstGraphFlag = true;
2326};
2327/**
2328 *
2329 * @returns {string}
2330 */
2331
2332const defaultStyle = function () {
2333 return 'fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;';
2334};
2335/**
2336 * Clears the internal graph db so that a new graph can be parsed.
2337 */
2338
2339const addSubGraph = function (_id, list, _title) {
2340 let id = _id;
2341 let title = _title;
2342
2343 if (_id === _title && _title.match(/\s/)) {
2344 id = undefined;
2345 }
2346
2347 function uniq(a) {
2348 const prims = {
2349 boolean: {},
2350 number: {},
2351 string: {}
2352 };
2353 const objs = [];
2354 return a.filter(function (item) {
2355 const type = typeof item;
2356
2357 if (item.trim() === '') {
2358 return false;
2359 }
2360
2361 if (type in prims) {
2362 return prims[type].hasOwnProperty(item) ? false : prims[type][item] = true;
2363 } else {
2364 return objs.indexOf(item) >= 0 ? false : objs.push(item);
2365 }
2366 });
2367 }
2368
2369 let nodeList = [];
2370 nodeList = uniq(nodeList.concat.apply(nodeList, list));
2371
2372 for (let i = 0; i < nodeList.length; i++) {
2373 if (nodeList[i][0].match(/\d/)) nodeList[i] = 's' + nodeList[i];
2374 }
2375
2376 id = id || 'subGraph' + subCount;
2377 if (id[0].match(/\d/)) id = 's' + id;
2378 title = title || '';
2379 title = sanitize(title);
2380 subCount = subCount + 1;
2381 const subGraph = {
2382 id: id,
2383 nodes: nodeList,
2384 title: title.trim(),
2385 classes: []
2386 };
2387 subGraphs.push(subGraph);
2388 subGraphLookup[id] = subGraph;
2389 return id;
2390};
2391
2392const getPosForId = function (id) {
2393 for (let i = 0; i < subGraphs.length; i++) {
2394 if (subGraphs[i].id === id) {
2395 return i;
2396 }
2397 }
2398
2399 return -1;
2400};
2401
2402let secCount = -1;
2403const posCrossRef = [];
2404
2405const indexNodes2 = function (id, pos) {
2406 const nodes = subGraphs[pos].nodes;
2407 secCount = secCount + 1;
2408
2409 if (secCount > 2000) {
2410 return;
2411 }
2412
2413 posCrossRef[secCount] = pos; // Check if match
2414
2415 if (subGraphs[pos].id === id) {
2416 return {
2417 result: true,
2418 count: 0
2419 };
2420 }
2421
2422 let count = 0;
2423 let posCount = 1;
2424
2425 while (count < nodes.length) {
2426 const childPos = getPosForId(nodes[count]); // Ignore regular nodes (pos will be -1)
2427
2428 if (childPos >= 0) {
2429 const res = indexNodes2(id, childPos);
2430
2431 if (res.result) {
2432 return {
2433 result: true,
2434 count: posCount + res.count
2435 };
2436 } else {
2437 posCount = posCount + res.count;
2438 }
2439 }
2440
2441 count = count + 1;
2442 }
2443
2444 return {
2445 result: false,
2446 count: posCount
2447 };
2448};
2449
2450const getDepthFirstPos = function (pos) {
2451 return posCrossRef[pos];
2452};
2453const indexNodes = function () {
2454 secCount = -1;
2455
2456 if (subGraphs.length > 0) {
2457 indexNodes2('none', subGraphs.length - 1, 0);
2458 }
2459};
2460const getSubGraphs = function () {
2461 return subGraphs;
2462};
2463const firstGraph = () => {
2464 if (firstGraphFlag) {
2465 firstGraphFlag = false;
2466 return true;
2467 }
2468
2469 return false;
2470};
2471/* harmony default export */ __webpack_exports__["default"] = ({
2472 addVertex,
2473 addLink,
2474 updateLinkInterpolate,
2475 updateLink,
2476 addClass,
2477 setDirection,
2478 setClass,
2479 getTooltip,
2480 setClickEvent,
2481 setLink,
2482 bindFunctions,
2483 getDirection,
2484 getVertices,
2485 getEdges,
2486 getClasses,
2487 clear,
2488 defaultStyle,
2489 addSubGraph,
2490 getDepthFirstPos,
2491 indexNodes,
2492 getSubGraphs,
2493 lex: {
2494 firstGraph
2495 }
2496});
2497
2498/***/ }),
2499
2500/***/ "./src/diagrams/flowchart/flowRenderer.js":
2501/*!************************************************!*\
2502 !*** ./src/diagrams/flowchart/flowRenderer.js ***!
2503 \************************************************/
2504/*! exports provided: setConf, addVertices, addEdges, getClasses, draw, default */
2505/***/ (function(module, __webpack_exports__, __webpack_require__) {
2506
2507"use strict";
2508__webpack_require__.r(__webpack_exports__);
2509/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; });
2510/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addVertices", function() { return addVertices; });
2511/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addEdges", function() { return addEdges; });
2512/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClasses", function() { return getClasses; });
2513/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; });
2514/* harmony import */ var graphlibrary__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! graphlibrary */ "graphlibrary");
2515/* harmony import */ var graphlibrary__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(graphlibrary__WEBPACK_IMPORTED_MODULE_0__);
2516/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3 */ "d3");
2517/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_1__);
2518/* harmony import */ var _flowDb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./flowDb */ "./src/diagrams/flowchart/flowDb.js");
2519/* harmony import */ var _parser_flow__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parser/flow */ "./src/diagrams/flowchart/parser/flow.jison");
2520/* harmony import */ var _parser_flow__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_parser_flow__WEBPACK_IMPORTED_MODULE_3__);
2521/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../config */ "./src/config.js");
2522/* harmony import */ var dagre_d3_renderer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! dagre-d3-renderer */ "dagre-d3-renderer");
2523/* harmony import */ var dagre_d3_renderer__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(dagre_d3_renderer__WEBPACK_IMPORTED_MODULE_5__);
2524/* harmony import */ var dagre_d3_renderer_lib_label_add_html_label_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! dagre-d3-renderer/lib/label/add-html-label.js */ "dagre-d3-renderer/lib/label/add-html-label.js");
2525/* harmony import */ var dagre_d3_renderer_lib_label_add_html_label_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(dagre_d3_renderer_lib_label_add_html_label_js__WEBPACK_IMPORTED_MODULE_6__);
2526/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
2527/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils */ "./src/utils.js");
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537const conf = {};
2538const setConf = function (cnf) {
2539 const keys = Object.keys(cnf);
2540
2541 for (let i = 0; i < keys.length; i++) {
2542 conf[keys[i]] = cnf[keys[i]];
2543 }
2544};
2545/**
2546 * Function that adds the vertices found in the graph definition to the graph to be rendered.
2547 * @param vert Object containing the vertices.
2548 * @param g The graph that is to be drawn.
2549 */
2550
2551const addVertices = function (vert, g, svgId) {
2552 const svg = d3__WEBPACK_IMPORTED_MODULE_1__["select"](`[id="${svgId}"]`);
2553 const keys = Object.keys(vert);
2554
2555 const styleFromStyleArr = function (styleStr, arr, {
2556 label
2557 }) {
2558 if (!label) {
2559 // Create a compound style definition from the style definitions found for the node in the graph definition
2560 for (let i = 0; i < arr.length; i++) {
2561 if (typeof arr[i] !== 'undefined') {
2562 styleStr = styleStr + arr[i] + ';';
2563 }
2564 }
2565 } else {
2566 for (let i = 0; i < arr.length; i++) {
2567 if (typeof arr[i] !== 'undefined') {
2568 if (arr[i].match('^color:')) styleStr = styleStr + arr[i] + ';';
2569 }
2570 }
2571 }
2572
2573 return styleStr;
2574 }; // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition
2575
2576
2577 keys.forEach(function (id) {
2578 const vertex = vert[id];
2579 /**
2580 * Variable for storing the classes for the vertex
2581 * @type {string}
2582 */
2583
2584 let classStr = '';
2585
2586 if (vertex.classes.length > 0) {
2587 classStr = vertex.classes.join(' ');
2588 }
2589 /**
2590 * Variable for storing the extracted style for the vertex
2591 * @type {string}
2592 */
2593
2594
2595 let style = ''; // Create a compound style definition from the style definitions found for the node in the graph definition
2596
2597 style = styleFromStyleArr(style, vertex.styles, {
2598 label: false
2599 });
2600 let labelStyle = '';
2601 labelStyle = styleFromStyleArr(labelStyle, vertex.styles, {
2602 label: true
2603 }); // Use vertex id as text in the box if no text is provided by the graph definition
2604
2605 let vertexText = vertex.text !== undefined ? vertex.text : vertex.id; // We create a SVG label, either by delegating to addHtmlLabel or manually
2606
2607 let vertexNode;
2608
2609 if (Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart.htmlLabels) {
2610 // TODO: addHtmlLabel accepts a labelStyle. Do we possibly have that?
2611 const node = {
2612 label: vertexText.replace(/fa[lrsb]?:fa-[\w-]+/g, s => `<i class='${s.replace(':', ' ')}'></i>`)
2613 };
2614 vertexNode = dagre_d3_renderer_lib_label_add_html_label_js__WEBPACK_IMPORTED_MODULE_6___default()(svg, node).node();
2615 vertexNode.parentNode.removeChild(vertexNode);
2616 } else {
2617 const svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text');
2618 const rows = vertexText.split(/<br[/]{0,1}>/);
2619
2620 for (let j = 0; j < rows.length; j++) {
2621 const tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan');
2622 tspan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');
2623 tspan.setAttribute('dy', '1em');
2624 tspan.setAttribute('x', '1');
2625 tspan.textContent = rows[j];
2626 svgLabel.appendChild(tspan);
2627 }
2628
2629 vertexNode = svgLabel;
2630 } // If the node has a link, we wrap it in a SVG link
2631
2632
2633 if (vertex.link) {
2634 const link = document.createElementNS('http://www.w3.org/2000/svg', 'a');
2635 link.setAttributeNS('http://www.w3.org/2000/svg', 'href', vertex.link);
2636 link.setAttributeNS('http://www.w3.org/2000/svg', 'rel', 'noopener');
2637 link.appendChild(vertexNode);
2638 vertexNode = link;
2639 }
2640
2641 let radious = 0;
2642 let _shape = ''; // Set the shape based parameters
2643
2644 switch (vertex.type) {
2645 case 'round':
2646 radious = 5;
2647 _shape = 'rect';
2648 break;
2649
2650 case 'square':
2651 _shape = 'rect';
2652 break;
2653
2654 case 'diamond':
2655 _shape = 'question';
2656 break;
2657
2658 case 'odd':
2659 _shape = 'rect_left_inv_arrow';
2660 break;
2661
2662 case 'lean_right':
2663 _shape = 'lean_right';
2664 break;
2665
2666 case 'lean_left':
2667 _shape = 'lean_left';
2668 break;
2669
2670 case 'trapezoid':
2671 _shape = 'trapezoid';
2672 break;
2673
2674 case 'inv_trapezoid':
2675 _shape = 'inv_trapezoid';
2676 break;
2677
2678 case 'odd_right':
2679 _shape = 'rect_left_inv_arrow';
2680 break;
2681
2682 case 'circle':
2683 _shape = 'circle';
2684 break;
2685
2686 case 'ellipse':
2687 _shape = 'ellipse';
2688 break;
2689
2690 case 'group':
2691 _shape = 'rect';
2692 break;
2693
2694 default:
2695 _shape = 'rect';
2696 } // Add the node
2697
2698
2699 g.setNode(vertex.id, {
2700 labelType: 'svg',
2701 labelStyle: labelStyle,
2702 shape: _shape,
2703 label: vertexNode,
2704 rx: radious,
2705 ry: radious,
2706 class: classStr,
2707 style: style,
2708 id: vertex.id
2709 });
2710 });
2711};
2712/**
2713 * Add edges to graph based on parsed graph defninition
2714 * @param {Object} edges The edges to add to the graph
2715 * @param {Object} g The graph object
2716 */
2717
2718const addEdges = function (edges, g) {
2719 let cnt = 0;
2720 let defaultStyle;
2721
2722 if (typeof edges.defaultStyle !== 'undefined') {
2723 defaultStyle = edges.defaultStyle.toString().replace(/,/g, ';');
2724 }
2725
2726 edges.forEach(function (edge) {
2727 cnt++;
2728 const edgeData = {}; // Set link type for rendering
2729
2730 if (edge.type === 'arrow_open') {
2731 edgeData.arrowhead = 'none';
2732 } else {
2733 edgeData.arrowhead = 'normal';
2734 }
2735
2736 let style = '';
2737
2738 if (typeof edge.style !== 'undefined') {
2739 edge.style.forEach(function (s) {
2740 style = style + s + ';';
2741 });
2742 } else {
2743 switch (edge.stroke) {
2744 case 'normal':
2745 style = 'fill:none';
2746
2747 if (typeof defaultStyle !== 'undefined') {
2748 style = defaultStyle;
2749 }
2750
2751 break;
2752
2753 case 'dotted':
2754 style = 'stroke: #333; fill:none;stroke-width:2px;stroke-dasharray:3;';
2755 break;
2756
2757 case 'thick':
2758 style = 'stroke: #333; stroke-width: 3.5px;fill:none';
2759 break;
2760 }
2761 }
2762
2763 edgeData.style = style;
2764
2765 if (typeof edge.interpolate !== 'undefined') {
2766 edgeData.curve = Object(_utils__WEBPACK_IMPORTED_MODULE_8__["interpolateToCurve"])(edge.interpolate, d3__WEBPACK_IMPORTED_MODULE_1__["curveLinear"]);
2767 } else if (typeof edges.defaultInterpolate !== 'undefined') {
2768 edgeData.curve = Object(_utils__WEBPACK_IMPORTED_MODULE_8__["interpolateToCurve"])(edges.defaultInterpolate, d3__WEBPACK_IMPORTED_MODULE_1__["curveLinear"]);
2769 } else {
2770 edgeData.curve = Object(_utils__WEBPACK_IMPORTED_MODULE_8__["interpolateToCurve"])(conf.curve, d3__WEBPACK_IMPORTED_MODULE_1__["curveLinear"]);
2771 }
2772
2773 if (typeof edge.text === 'undefined') {
2774 if (typeof edge.style !== 'undefined') {
2775 edgeData.arrowheadStyle = 'fill: #333';
2776 }
2777 } else {
2778 edgeData.arrowheadStyle = 'fill: #333';
2779
2780 if (typeof edge.style === 'undefined') {
2781 edgeData.labelpos = 'c';
2782
2783 if (Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart.htmlLabels) {
2784 edgeData.labelType = 'html';
2785 edgeData.label = '<span class="edgeLabel">' + edge.text + '</span>';
2786 } else {
2787 edgeData.labelType = 'text';
2788 edgeData.style = edgeData.style || 'stroke: #333; stroke-width: 1.5px;fill:none';
2789 edgeData.label = edge.text.replace(/<br>/g, '\n');
2790 }
2791 } else {
2792 edgeData.label = edge.text.replace(/<br>/g, '\n');
2793 }
2794 } // Add the edge to the graph
2795
2796
2797 g.setEdge(edge.start, edge.end, edgeData, cnt);
2798 });
2799};
2800/**
2801 * Returns the all the styles from classDef statements in the graph definition.
2802 * @returns {object} classDef styles
2803 */
2804
2805const getClasses = function (text) {
2806 _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].info('Extracting classes');
2807 _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].clear();
2808 const parser = _parser_flow__WEBPACK_IMPORTED_MODULE_3___default.a.parser;
2809 parser.yy = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"]; // Parse the graph definition
2810
2811 parser.parse(text);
2812 return _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getClasses();
2813};
2814/**
2815 * Draws a flowchart in the tag with id: id based on the graph definition in text.
2816 * @param text
2817 * @param id
2818 */
2819
2820const draw = function (text, id) {
2821 _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].info('Drawing flowchart');
2822 _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].clear();
2823 const parser = _parser_flow__WEBPACK_IMPORTED_MODULE_3___default.a.parser;
2824 parser.yy = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"]; // Parse the graph definition
2825
2826 try {
2827 parser.parse(text);
2828 } catch (err) {
2829 _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].debug('Parsing failed');
2830 } // Fetch the default direction, use TD if none was found
2831
2832
2833 let dir = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getDirection();
2834
2835 if (typeof dir === 'undefined') {
2836 dir = 'TD';
2837 } // Create the input mermaid.graph
2838
2839
2840 const g = new graphlibrary__WEBPACK_IMPORTED_MODULE_0___default.a.Graph({
2841 multigraph: true,
2842 compound: true
2843 }).setGraph({
2844 rankdir: dir,
2845 marginx: 20,
2846 marginy: 20
2847 }).setDefaultEdgeLabel(function () {
2848 return {};
2849 });
2850 let subG;
2851 const subGraphs = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getSubGraphs();
2852
2853 for (let i = subGraphs.length - 1; i >= 0; i--) {
2854 subG = subGraphs[i];
2855 _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].addVertex(subG.id, subG.title, 'group', undefined, subG.classes);
2856 } // Fetch the verices/nodes and edges/links from the parsed graph definition
2857
2858
2859 const vert = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getVertices();
2860 const edges = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getEdges();
2861 let i = 0;
2862
2863 for (i = subGraphs.length - 1; i >= 0; i--) {
2864 subG = subGraphs[i];
2865 d3__WEBPACK_IMPORTED_MODULE_1__["selectAll"]('cluster').append('text');
2866
2867 for (let j = 0; j < subG.nodes.length; j++) {
2868 g.setParent(subG.nodes[j], subG.id);
2869 }
2870 }
2871
2872 addVertices(vert, g, id);
2873 addEdges(edges, g); // Create the renderer
2874
2875 const Render = dagre_d3_renderer__WEBPACK_IMPORTED_MODULE_5___default.a.render;
2876 const render = new Render(); // Add custom shape for rhombus type of boc (decision)
2877
2878 render.shapes().question = function (parent, bbox, node) {
2879 const w = bbox.width;
2880 const h = bbox.height;
2881 const s = (w + h) * 0.9;
2882 const points = [{
2883 x: s / 2,
2884 y: 0
2885 }, {
2886 x: s,
2887 y: -s / 2
2888 }, {
2889 x: s / 2,
2890 y: -s
2891 }, {
2892 x: 0,
2893 y: -s / 2
2894 }];
2895 const shapeSvg = parent.insert('polygon', ':first-child').attr('points', points.map(function (d) {
2896 return d.x + ',' + d.y;
2897 }).join(' ')).attr('rx', 5).attr('ry', 5).attr('transform', 'translate(' + -s / 2 + ',' + s * 2 / 4 + ')');
2898
2899 node.intersect = function (point) {
2900 return dagre_d3_renderer__WEBPACK_IMPORTED_MODULE_5___default.a.intersect.polygon(node, points, point);
2901 };
2902
2903 return shapeSvg;
2904 }; // Add custom shape for box with inverted arrow on left side
2905
2906
2907 render.shapes().rect_left_inv_arrow = function (parent, bbox, node) {
2908 const w = bbox.width;
2909 const h = bbox.height;
2910 const points = [{
2911 x: -h / 2,
2912 y: 0
2913 }, {
2914 x: w,
2915 y: 0
2916 }, {
2917 x: w,
2918 y: -h
2919 }, {
2920 x: -h / 2,
2921 y: -h
2922 }, {
2923 x: 0,
2924 y: -h / 2
2925 }];
2926 const shapeSvg = parent.insert('polygon', ':first-child').attr('points', points.map(function (d) {
2927 return d.x + ',' + d.y;
2928 }).join(' ')).attr('transform', 'translate(' + -w / 2 + ',' + h * 2 / 4 + ')');
2929
2930 node.intersect = function (point) {
2931 return dagre_d3_renderer__WEBPACK_IMPORTED_MODULE_5___default.a.intersect.polygon(node, points, point);
2932 };
2933
2934 return shapeSvg;
2935 }; // Add custom shape for box with inverted arrow on left side
2936
2937
2938 render.shapes().lean_right = function (parent, bbox, node) {
2939 const w = bbox.width;
2940 const h = bbox.height;
2941 const points = [{
2942 x: -2 * h / 6,
2943 y: 0
2944 }, {
2945 x: w - h / 6,
2946 y: 0
2947 }, {
2948 x: w + 2 * h / 6,
2949 y: -h
2950 }, {
2951 x: h / 6,
2952 y: -h
2953 }];
2954 const shapeSvg = parent.insert('polygon', ':first-child').attr('points', points.map(function (d) {
2955 return d.x + ',' + d.y;
2956 }).join(' ')).attr('transform', 'translate(' + -w / 2 + ',' + h * 2 / 4 + ')');
2957
2958 node.intersect = function (point) {
2959 return dagre_d3_renderer__WEBPACK_IMPORTED_MODULE_5___default.a.intersect.polygon(node, points, point);
2960 };
2961
2962 return shapeSvg;
2963 }; // Add custom shape for box with inverted arrow on left side
2964
2965
2966 render.shapes().lean_left = function (parent, bbox, node) {
2967 const w = bbox.width;
2968 const h = bbox.height;
2969 const points = [{
2970 x: 2 * h / 6,
2971 y: 0
2972 }, {
2973 x: w + h / 6,
2974 y: 0
2975 }, {
2976 x: w - 2 * h / 6,
2977 y: -h
2978 }, {
2979 x: -h / 6,
2980 y: -h
2981 }];
2982 const shapeSvg = parent.insert('polygon', ':first-child').attr('points', points.map(function (d) {
2983 return d.x + ',' + d.y;
2984 }).join(' ')).attr('transform', 'translate(' + -w / 2 + ',' + h * 2 / 4 + ')');
2985
2986 node.intersect = function (point) {
2987 return dagre_d3_renderer__WEBPACK_IMPORTED_MODULE_5___default.a.intersect.polygon(node, points, point);
2988 };
2989
2990 return shapeSvg;
2991 }; // Add custom shape for box with inverted arrow on left side
2992
2993
2994 render.shapes().trapezoid = function (parent, bbox, node) {
2995 const w = bbox.width;
2996 const h = bbox.height;
2997 const points = [{
2998 x: -2 * h / 6,
2999 y: 0
3000 }, {
3001 x: w + 2 * h / 6,
3002 y: 0
3003 }, {
3004 x: w - h / 6,
3005 y: -h
3006 }, {
3007 x: h / 6,
3008 y: -h
3009 }];
3010 const shapeSvg = parent.insert('polygon', ':first-child').attr('points', points.map(function (d) {
3011 return d.x + ',' + d.y;
3012 }).join(' ')).attr('transform', 'translate(' + -w / 2 + ',' + h * 2 / 4 + ')');
3013
3014 node.intersect = function (point) {
3015 return dagre_d3_renderer__WEBPACK_IMPORTED_MODULE_5___default.a.intersect.polygon(node, points, point);
3016 };
3017
3018 return shapeSvg;
3019 }; // Add custom shape for box with inverted arrow on left side
3020
3021
3022 render.shapes().inv_trapezoid = function (parent, bbox, node) {
3023 const w = bbox.width;
3024 const h = bbox.height;
3025 const points = [{
3026 x: h / 6,
3027 y: 0
3028 }, {
3029 x: w - h / 6,
3030 y: 0
3031 }, {
3032 x: w + 2 * h / 6,
3033 y: -h
3034 }, {
3035 x: -2 * h / 6,
3036 y: -h
3037 }];
3038 const shapeSvg = parent.insert('polygon', ':first-child').attr('points', points.map(function (d) {
3039 return d.x + ',' + d.y;
3040 }).join(' ')).attr('transform', 'translate(' + -w / 2 + ',' + h * 2 / 4 + ')');
3041
3042 node.intersect = function (point) {
3043 return dagre_d3_renderer__WEBPACK_IMPORTED_MODULE_5___default.a.intersect.polygon(node, points, point);
3044 };
3045
3046 return shapeSvg;
3047 }; // Add custom shape for box with inverted arrow on right side
3048
3049
3050 render.shapes().rect_right_inv_arrow = function (parent, bbox, node) {
3051 const w = bbox.width;
3052 const h = bbox.height;
3053 const points = [{
3054 x: 0,
3055 y: 0
3056 }, {
3057 x: w + h / 2,
3058 y: 0
3059 }, {
3060 x: w,
3061 y: -h / 2
3062 }, {
3063 x: w + h / 2,
3064 y: -h
3065 }, {
3066 x: 0,
3067 y: -h
3068 }];
3069 const shapeSvg = parent.insert('polygon', ':first-child').attr('points', points.map(function (d) {
3070 return d.x + ',' + d.y;
3071 }).join(' ')).attr('transform', 'translate(' + -w / 2 + ',' + h * 2 / 4 + ')');
3072
3073 node.intersect = function (point) {
3074 return dagre_d3_renderer__WEBPACK_IMPORTED_MODULE_5___default.a.intersect.polygon(node, points, point);
3075 };
3076
3077 return shapeSvg;
3078 }; // Add our custom arrow - an empty arrowhead
3079
3080
3081 render.arrows().none = function normal(parent, id, edge, type) {
3082 const 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');
3083 const path = marker.append('path').attr('d', 'M 0 0 L 0 0 L 0 0 z');
3084 dagre_d3_renderer__WEBPACK_IMPORTED_MODULE_5___default.a.util.applyStyle(path, edge[type + 'Style']);
3085 }; // Override normal arrowhead defined in d3. Remove style & add class to allow css styling.
3086
3087
3088 render.arrows().normal = function normal(parent, id, edge, type) {
3089 const 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');
3090 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');
3091 }; // Set up an SVG group so that we can translate the final graph.
3092
3093
3094 const svg = d3__WEBPACK_IMPORTED_MODULE_1__["select"](`[id="${id}"]`); // Run the renderer. This is what draws the final graph.
3095
3096 const element = d3__WEBPACK_IMPORTED_MODULE_1__["select"]('#' + id + ' g');
3097 render(element, g);
3098 element.selectAll('g.node').attr('title', function () {
3099 return _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getTooltip(this.id);
3100 });
3101 const padding = 8;
3102 const width = g.maxX - g.minX + padding * 2;
3103 const height = g.maxY - g.minY + padding * 2;
3104 svg.attr('width', '100%');
3105 svg.attr('style', `max-width: ${width}px;`);
3106 svg.attr('viewBox', `0 0 ${width} ${height}`);
3107 svg.select('g').attr('transform', `translate(${padding - g.minX}, ${padding - g.minY})`); // Index nodes
3108
3109 _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].indexNodes('subGraph' + i); // reposition labels
3110
3111 for (i = 0; i < subGraphs.length; i++) {
3112 subG = subGraphs[i];
3113
3114 if (subG.title !== 'undefined') {
3115 const clusterRects = document.querySelectorAll('#' + id + ' #' + subG.id + ' rect');
3116 const clusterEl = document.querySelectorAll('#' + id + ' #' + subG.id);
3117 const xPos = clusterRects[0].x.baseVal.value;
3118 const yPos = clusterRects[0].y.baseVal.value;
3119 const width = clusterRects[0].width.baseVal.value;
3120 const cluster = d3__WEBPACK_IMPORTED_MODULE_1__["select"](clusterEl[0]);
3121 const te = cluster.select('.label');
3122 te.attr('transform', `translate(${xPos + width / 2}, ${yPos + 14})`);
3123 te.attr('id', id + 'Text');
3124 }
3125 } // Add label rects for non html labels
3126
3127
3128 if (!Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart.htmlLabels) {
3129 const labels = document.querySelectorAll('#' + id + ' .edgeLabel .label');
3130
3131 for (let k = 0; k < labels.length; k++) {
3132 const label = labels[k]; // Get dimensions of label
3133
3134 const dim = label.getBBox();
3135 const rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
3136 rect.setAttribute('rx', 0);
3137 rect.setAttribute('ry', 0);
3138 rect.setAttribute('width', dim.width);
3139 rect.setAttribute('height', dim.height);
3140 rect.setAttribute('style', 'fill:#e8e8e8;');
3141 label.insertBefore(rect, label.firstChild);
3142 }
3143 }
3144};
3145/* harmony default export */ __webpack_exports__["default"] = ({
3146 setConf,
3147 addVertices,
3148 addEdges,
3149 getClasses,
3150 draw
3151});
3152
3153/***/ }),
3154
3155/***/ "./src/diagrams/flowchart/parser/flow.jison":
3156/*!**************************************************!*\
3157 !*** ./src/diagrams/flowchart/parser/flow.jison ***!
3158 \**************************************************/
3159/*! no static exports found */
3160/***/ (function(module, exports, __webpack_require__) {
3161
3162/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */
3163/*
3164 Returns a Parser object of the following structure:
3165
3166 Parser: {
3167 yy: {}
3168 }
3169
3170 Parser.prototype: {
3171 yy: {},
3172 trace: function(),
3173 symbols_: {associative list: name ==> number},
3174 terminals_: {associative list: number ==> name},
3175 productions_: [...],
3176 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
3177 table: [...],
3178 defaultActions: {...},
3179 parseError: function(str, hash),
3180 parse: function(input),
3181
3182 lexer: {
3183 EOF: 1,
3184 parseError: function(str, hash),
3185 setInput: function(input),
3186 input: function(),
3187 unput: function(str),
3188 more: function(),
3189 less: function(n),
3190 pastInput: function(),
3191 upcomingInput: function(),
3192 showPosition: function(),
3193 test_match: function(regex_match_array, rule_index),
3194 next: function(),
3195 lex: function(),
3196 begin: function(condition),
3197 popState: function(),
3198 _currentRules: function(),
3199 topState: function(),
3200 pushState: function(condition),
3201
3202 options: {
3203 ranges: boolean (optional: true ==> token location info will include a .range[] member)
3204 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
3205 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)
3206 },
3207
3208 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
3209 rules: [...],
3210 conditions: {associative list: name ==> set},
3211 }
3212 }
3213
3214
3215 token location info (@$, _$, etc.): {
3216 first_line: n,
3217 last_line: n,
3218 first_column: n,
3219 last_column: n,
3220 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
3221 }
3222
3223
3224 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
3225 text: (matched text)
3226 token: (the produced terminal token, if any)
3227 line: (yylineno)
3228 }
3229 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
3230 loc: (yylloc)
3231 expected: (string describing the set of expected tokens)
3232 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
3233 }
3234*/
3235var parser = (function(){
3236var 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,89,90,91,92,93,94,106,107,110,111,112,114,115,121,122,123,124,125,126],$V4=[2,2],$V5=[1,12],$V6=[1,13],$V7=[1,14],$V8=[1,15],$V9=[1,22],$Va=[1,24],$Vb=[1,25],$Vc=[1,26],$Vd=[1,27],$Ve=[1,28],$Vf=[1,40],$Vg=[1,35],$Vh=[1,37],$Vi=[1,32],$Vj=[1,36],$Vk=[1,39],$Vl=[1,43],$Vm=[1,44],$Vn=[1,45],$Vo=[1,34],$Vp=[1,38],$Vq=[1,41],$Vr=[1,42],$Vs=[1,33],$Vt=[1,50],$Vu=[1,8,9,10,11,26,30,89,90,91,92,93,94,106,107,110,111,112,114,115,121,122,123,124,125,126],$Vv=[1,54],$Vw=[1,53],$Vx=[1,55],$Vy=[8,9,11,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],$Vz=[8,9,11,34,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],$VA=[8,9,10,11,28,34,36,38,40,42,43,45,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,94,106,107,110,111,112,114,115,121,122,123,124,125,126],$VB=[94,106,107,110,111,112,114,115,121,122,123,124,125,126],$VC=[1,129],$VD=[1,149],$VE=[1,150],$VF=[1,151],$VG=[1,152],$VH=[1,123],$VI=[1,125],$VJ=[1,124],$VK=[1,120],$VL=[1,144],$VM=[1,145],$VN=[1,146],$VO=[1,147],$VP=[1,148],$VQ=[1,153],$VR=[1,154],$VS=[1,127],$VT=[1,126],$VU=[1,134],$VV=[1,137],$VW=[1,135],$VX=[1,136],$VY=[1,130],$VZ=[1,142],$V_=[1,141],$V$=[1,122],$V01=[1,132],$V11=[1,133],$V21=[1,138],$V31=[1,139],$V41=[1,140],$V51=[1,143],$V61=[49,83,94,106,107,110,111,112,114,115,121,122,123,124,125,126],$V71=[8,9,10,11,26,30,89,90,91,92,93,94,106,107,110,111,112,114,115,121,122,123,124,125,126],$V81=[1,171],$V91=[1,173],$Va1=[1,174],$Vb1=[8,9,10,11,12,13,26,28,29,30,37,39,41,42,44,46,50,51,53,55,57,59,61,63,65,66,67,69,71,73,83,89,90,91,92,93,94,95,98,105,106,107,110,111,112,114,115,117,121,122,123,124,125,126],$Vc1=[8,9,10,11,13,94,106,107,110,111,112,114,115,121,122,123,124,125,126],$Vd1=[10,107],$Ve1=[1,250],$Vf1=[1,254],$Vg1=[1,251],$Vh1=[1,255],$Vi1=[1,248],$Vj1=[1,245],$Vk1=[1,246],$Vl1=[1,247],$Vm1=[1,249],$Vn1=[1,252],$Vo1=[1,253],$Vp1=[8,9,11],$Vq1=[1,279],$Vr1=[8,9,11,107],$Vs1=[8,9,10,11,89,101,105,106,107,110,111,112,113,114,115];
3237var parser = {trace: function trace () { },
3238yy: {},
3239symbols_: {"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,"STYLE_SEPARATOR":34,"idString":35,"PS":36,"PE":37,"(-":38,"-)":39,"DIAMOND_START":40,"DIAMOND_STOP":41,"TAGEND":42,"TRAPSTART":43,"TRAPEND":44,"INVTRAPSTART":45,"INVTRAPEND":46,"linkStatement":47,"arrowText":48,"TESTSTR":49,"--":50,"ARROW_POINT":51,"START_DOUBLE_ARROW_POINT":52,"ARROW_CIRCLE":53,"START_DOUBLE_ARROW_CIRCLE":54,"ARROW_CROSS":55,"START_DOUBLE_ARROW_CROSS":56,"ARROW_OPEN":57,"-.":58,"DOTTED_ARROW_POINT":59,"START_DOUBLE_DOTTED_ARROW_POINT":60,"DOTTED_ARROW_CIRCLE":61,"START_DOUBLE_DOTTED_ARROW_CIRCLE":62,"DOTTED_ARROW_CROSS":63,"START_DOUBLE_DOTTED_ARROW_CROSS":64,"DOTTED_ARROW_OPEN":65,"==":66,"THICK_ARROW_POINT":67,"START_DOUBLE_THICK_ARROW_POINT":68,"THICK_ARROW_CIRCLE":69,"START_DOUBLE_THICK_ARROW_CIRCLE":70,"THICK_ARROW_CROSS":71,"START_DOUBLE_THICK_ARROW_CROSS":72,"THICK_ARROW_OPEN":73,"DOUBLE_ARROW_POINT":74,"DOUBLE_ARROW_CIRCLE":75,"DOUBLE_ARROW_CROSS":76,"DOUBLE_DOTTED_ARROW_POINT":77,"DOUBLE_DOTTED_ARROW_CIRCLE":78,"DOUBLE_DOTTED_ARROW_CROSS":79,"DOUBLE_THICK_ARROW_POINT":80,"DOUBLE_THICK_ARROW_CIRCLE":81,"DOUBLE_THICK_ARROW_CROSS":82,"PIPE":83,"textToken":84,"STR":85,"commentText":86,"commentToken":87,"keywords":88,"STYLE":89,"LINKSTYLE":90,"CLASSDEF":91,"CLASS":92,"CLICK":93,"DOWN":94,"UP":95,"textNoTags":96,"textNoTagsToken":97,"DEFAULT":98,"stylesOpt":99,"alphaNum":100,"HEX":101,"numList":102,"INTERPOLATE":103,"commentStatement":104,"PCT":105,"NUM":106,"COMMA":107,"style":108,"styleComponent":109,"ALPHA":110,"COLON":111,"MINUS":112,"UNIT":113,"BRKT":114,"DOT":115,"graphCodeTokens":116,"TAGSTART":117,"alphaNumToken":118,"idStringToken":119,"alphaNumStatement":120,"PUNCTUATION":121,"UNICODE_TEXT":122,"PLUS":123,"EQUALS":124,"MULT":125,"UNDERSCORE":126,"QUOTE":127,"$accept":0,"$end":1},
3240terminals_: {2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"DIR",26:"subgraph",28:"SQS",29:"SQE",30:"end",34:"STYLE_SEPARATOR",36:"PS",37:"PE",38:"(-",39:"-)",40:"DIAMOND_START",41:"DIAMOND_STOP",42:"TAGEND",43:"TRAPSTART",44:"TRAPEND",45:"INVTRAPSTART",46:"INVTRAPEND",49:"TESTSTR",50:"--",51:"ARROW_POINT",52:"START_DOUBLE_ARROW_POINT",53:"ARROW_CIRCLE",54:"START_DOUBLE_ARROW_CIRCLE",55:"ARROW_CROSS",56:"START_DOUBLE_ARROW_CROSS",57:"ARROW_OPEN",58:"-.",59:"DOTTED_ARROW_POINT",60:"START_DOUBLE_DOTTED_ARROW_POINT",61:"DOTTED_ARROW_CIRCLE",62:"START_DOUBLE_DOTTED_ARROW_CIRCLE",63:"DOTTED_ARROW_CROSS",64:"START_DOUBLE_DOTTED_ARROW_CROSS",65:"DOTTED_ARROW_OPEN",66:"==",67:"THICK_ARROW_POINT",68:"START_DOUBLE_THICK_ARROW_POINT",69:"THICK_ARROW_CIRCLE",70:"START_DOUBLE_THICK_ARROW_CIRCLE",71:"THICK_ARROW_CROSS",72:"START_DOUBLE_THICK_ARROW_CROSS",73:"THICK_ARROW_OPEN",74:"DOUBLE_ARROW_POINT",75:"DOUBLE_ARROW_CIRCLE",76:"DOUBLE_ARROW_CROSS",77:"DOUBLE_DOTTED_ARROW_POINT",78:"DOUBLE_DOTTED_ARROW_CIRCLE",79:"DOUBLE_DOTTED_ARROW_CROSS",80:"DOUBLE_THICK_ARROW_POINT",81:"DOUBLE_THICK_ARROW_CIRCLE",82:"DOUBLE_THICK_ARROW_CROSS",83:"PIPE",85:"STR",89:"STYLE",90:"LINKSTYLE",91:"CLASSDEF",92:"CLASS",93:"CLICK",94:"DOWN",95:"UP",98:"DEFAULT",101:"HEX",103:"INTERPOLATE",105:"PCT",106:"NUM",107:"COMMA",110:"ALPHA",111:"COLON",112:"MINUS",113:"UNIT",114:"BRKT",115:"DOT",117:"TAGSTART",121:"PUNCTUATION",122:"UNICODE_TEXT",123:"PLUS",124:"EQUALS",125:"MULT",126:"UNDERSCORE",127:"QUOTE"},
3241productions_: [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,1],[32,1],[32,3],[33,4],[33,5],[33,6],[33,7],[33,4],[33,5],[33,4],[33,5],[33,4],[33,5],[33,4],[33,5],[33,4],[33,5],[33,4],[33,5],[33,4],[33,5],[33,4],[33,5],[33,1],[33,2],[31,2],[31,3],[31,3],[31,1],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[31,3],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[47,1],[48,3],[27,1],[27,2],[27,1],[86,1],[86,2],[88,1],[88,1],[88,1],[88,1],[88,1],[88,1],[88,1],[88,1],[88,1],[88,1],[88,1],[96,1],[96,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],[104,3],[102,1],[102,3],[99,1],[99,3],[108,1],[108,2],[109,1],[109,1],[109,1],[109,1],[109,1],[109,1],[109,1],[109,1],[109,1],[109,1],[109,1],[87,1],[87,1],[84,1],[84,1],[84,1],[84,1],[84,1],[84,1],[84,1],[97,1],[97,1],[97,1],[97,1],[35,1],[35,2],[100,1],[100,2],[120,1],[120,1],[120,1],[120,1],[118,1],[118,1],[118,1],[118,1],[118,1],[118,1],[118,1],[118,1],[118,1],[118,1],[118,1],[118,1],[119,1],[119,1],[119,1],[119,1],[119,1],[119,1],[119,1],[119,1],[119,1],[119,1],[119,1],[119,1],[119,1],[119,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1]],
3242performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
3243/* this == yyval */
3244
3245var $0 = $$.length - 1;
3246switch (yystate) {
3247case 2:
3248 this.$ = [];
3249break;
3250case 3:
3251
3252 if($$[$0] !== []){
3253 $$[$0-1].push($$[$0]);
3254 }
3255 this.$=$$[$0-1];
3256break;
3257case 4: case 111: case 113: case 114: case 127: case 177: case 179: case 180:
3258this.$=$$[$0];
3259break;
3260case 11:
3261 yy.setDirection($$[$0-1]);this.$ = $$[$0-1];
3262break;
3263case 26:
3264 this.$=$$[$0-1]
3265break;
3266case 27: case 28: case 29: case 30: case 31:
3267this.$=[];
3268break;
3269case 32:
3270this.$=yy.addSubGraph($$[$0-6],$$[$0-1],$$[$0-4]);
3271break;
3272case 33:
3273this.$=yy.addSubGraph($$[$0-3],$$[$0-1],$$[$0-3]);
3274break;
3275case 34:
3276this.$=yy.addSubGraph(undefined,$$[$0-1],undefined);
3277break;
3278case 38:
3279 yy.addLink($$[$0-2][0],$$[$0][0],$$[$0-1]); this.$ = $$[$0].concat($$[$0-2])
3280break;
3281case 39:
3282 this.$ = $$[$0]
3283break;
3284case 40:
3285 this.$ = [$$[$0]];
3286break;
3287case 41:
3288this.$ = [$$[$0-2]];yy.setClass($$[$0-2],$$[$0])
3289break;
3290case 42:
3291this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'square');
3292break;
3293case 43:
3294this.$ = $$[$0-4];yy.addVertex($$[$0-4],$$[$0-2],'square');
3295break;
3296case 44:
3297this.$ = $$[$0-5];yy.addVertex($$[$0-5],$$[$0-2],'circle');
3298break;
3299case 45:
3300this.$ = $$[$0-6];yy.addVertex($$[$0-6],$$[$0-3],'circle');
3301break;
3302case 46:
3303this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'ellipse');
3304break;
3305case 47:
3306this.$ = $$[$0-4];yy.addVertex($$[$0-4],$$[$0-2],'ellipse');
3307break;
3308case 48:
3309this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'round');
3310break;
3311case 49:
3312this.$ = $$[$0-4];yy.addVertex($$[$0-4],$$[$0-2],'round');
3313break;
3314case 50:
3315this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'diamond');
3316break;
3317case 51:
3318this.$ = $$[$0-4];yy.addVertex($$[$0-4],$$[$0-2],'diamond');
3319break;
3320case 52:
3321this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'odd');
3322break;
3323case 53:
3324this.$ = $$[$0-4];yy.addVertex($$[$0-4],$$[$0-2],'odd');
3325break;
3326case 54:
3327this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'trapezoid');
3328break;
3329case 55:
3330this.$ = $$[$0-4];yy.addVertex($$[$0-4],$$[$0-2],'trapezoid');
3331break;
3332case 56:
3333this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'inv_trapezoid');
3334break;
3335case 57:
3336this.$ = $$[$0-4];yy.addVertex($$[$0-4],$$[$0-2],'inv_trapezoid');
3337break;
3338case 58:
3339this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'lean_right');
3340break;
3341case 59:
3342this.$ = $$[$0-4];yy.addVertex($$[$0-4],$$[$0-2],'lean_right');
3343break;
3344case 60:
3345this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'lean_left');
3346break;
3347case 61:
3348this.$ = $$[$0-4];yy.addVertex($$[$0-4],$$[$0-2],'lean_left');
3349break;
3350case 62:
3351this.$ = $$[$0];yy.addVertex($$[$0]);
3352break;
3353case 63:
3354this.$ = $$[$0-1];yy.addVertex($$[$0-1]);
3355break;
3356case 64:
3357$$[$0-1].text = $$[$0];this.$ = $$[$0-1];
3358break;
3359case 65: case 66:
3360$$[$0-2].text = $$[$0-1];this.$ = $$[$0-2];
3361break;
3362case 67:
3363this.$ = $$[$0];
3364break;
3365case 68:
3366this.$ = {"type":"arrow","stroke":"normal","text":$$[$0-1]};
3367break;
3368case 69:
3369this.$ = {"type":"double_arrow_point","stroke":"normal","text":$$[$0-1]};
3370break;
3371case 70:
3372this.$ = {"type":"arrow_circle","stroke":"normal","text":$$[$0-1]};
3373break;
3374case 71:
3375this.$ = {"type":"double_arrow_circle","stroke":"normal","text":$$[$0-1]};
3376break;
3377case 72:
3378this.$ = {"type":"arrow_cross","stroke":"normal","text":$$[$0-1]};
3379break;
3380case 73:
3381this.$ = {"type":"double_arrow_cross","stroke":"normal","text":$$[$0-1]};
3382break;
3383case 74:
3384this.$ = {"type":"arrow_open","stroke":"normal","text":$$[$0-1]};
3385break;
3386case 75:
3387this.$ = {"type":"arrow","stroke":"dotted","text":$$[$0-1]};
3388break;
3389case 76:
3390this.$ = {"type":"double_arrow_point","stroke":"dotted","text":$$[$0-1]};
3391break;
3392case 77:
3393this.$ = {"type":"arrow_circle","stroke":"dotted","text":$$[$0-1]};
3394break;
3395case 78:
3396this.$ = {"type":"double_arrow_circle","stroke":"dotted","text":$$[$0-1]};
3397break;
3398case 79:
3399this.$ = {"type":"arrow_cross","stroke":"dotted","text":$$[$0-1]};
3400break;
3401case 80:
3402this.$ = {"type":"double_arrow_cross","stroke":"dotted","text":$$[$0-1]};
3403break;
3404case 81:
3405this.$ = {"type":"arrow_open","stroke":"dotted","text":$$[$0-1]};
3406break;
3407case 82:
3408this.$ = {"type":"arrow","stroke":"thick","text":$$[$0-1]};
3409break;
3410case 83:
3411this.$ = {"type":"double_arrow_point","stroke":"thick","text":$$[$0-1]};
3412break;
3413case 84:
3414this.$ = {"type":"arrow_circle","stroke":"thick","text":$$[$0-1]};
3415break;
3416case 85:
3417this.$ = {"type":"double_arrow_circle","stroke":"thick","text":$$[$0-1]};
3418break;
3419case 86:
3420this.$ = {"type":"arrow_cross","stroke":"thick","text":$$[$0-1]};
3421break;
3422case 87:
3423this.$ = {"type":"double_arrow_cross","stroke":"thick","text":$$[$0-1]};
3424break;
3425case 88:
3426this.$ = {"type":"arrow_open","stroke":"thick","text":$$[$0-1]};
3427break;
3428case 89:
3429this.$ = {"type":"arrow","stroke":"normal"};
3430break;
3431case 90:
3432this.$ = {"type":"double_arrow_point","stroke":"normal"};
3433break;
3434case 91:
3435this.$ = {"type":"arrow_circle","stroke":"normal"};
3436break;
3437case 92:
3438this.$ = {"type":"double_arrow_circle","stroke":"normal"};
3439break;
3440case 93:
3441this.$ = {"type":"arrow_cross","stroke":"normal"};
3442break;
3443case 94:
3444this.$ = {"type":"double_arrow_cross","stroke":"normal"};
3445break;
3446case 95:
3447this.$ = {"type":"arrow_open","stroke":"normal"};
3448break;
3449case 96:
3450this.$ = {"type":"arrow","stroke":"dotted"};
3451break;
3452case 97:
3453this.$ = {"type":"double_arrow_point","stroke":"dotted"};
3454break;
3455case 98:
3456this.$ = {"type":"arrow_circle","stroke":"dotted"};
3457break;
3458case 99:
3459this.$ = {"type":"double_arrow_circle","stroke":"dotted"};
3460break;
3461case 100:
3462this.$ = {"type":"arrow_cross","stroke":"dotted"};
3463break;
3464case 101:
3465this.$ = {"type":"double_arrow_cross","stroke":"dotted"};
3466break;
3467case 102:
3468this.$ = {"type":"arrow_open","stroke":"dotted"};
3469break;
3470case 103:
3471this.$ = {"type":"arrow","stroke":"thick"};
3472break;
3473case 104:
3474this.$ = {"type":"double_arrow_point","stroke":"thick"};
3475break;
3476case 105:
3477this.$ = {"type":"arrow_circle","stroke":"thick"};
3478break;
3479case 106:
3480this.$ = {"type":"double_arrow_circle","stroke":"thick"};
3481break;
3482case 107:
3483this.$ = {"type":"arrow_cross","stroke":"thick"};
3484break;
3485case 108:
3486this.$ = {"type":"double_arrow_cross","stroke":"thick"};
3487break;
3488case 109:
3489this.$ = {"type":"arrow_open","stroke":"thick"};
3490break;
3491case 110:
3492this.$ = $$[$0-1];
3493break;
3494case 112: case 115: case 128: case 178:
3495this.$=$$[$0-1]+''+$$[$0];
3496break;
3497case 129: case 130:
3498this.$ = $$[$0-4];yy.addClass($$[$0-2],$$[$0]);
3499break;
3500case 131:
3501this.$ = $$[$0-4];yy.setClass($$[$0-2], $$[$0]);
3502break;
3503case 132:
3504this.$ = $$[$0-4];yy.setClickEvent($$[$0-2], $$[$0], undefined);
3505break;
3506case 133:
3507this.$ = $$[$0-6];yy.setClickEvent($$[$0-4], $$[$0-2], $$[$0]) ;
3508break;
3509case 134:
3510this.$ = $$[$0-4];yy.setLink($$[$0-2], $$[$0], undefined);
3511break;
3512case 135:
3513this.$ = $$[$0-6];yy.setLink($$[$0-4], $$[$0-2], $$[$0] );
3514break;
3515case 136:
3516this.$ = $$[$0-4];yy.addVertex($$[$0-2],undefined,undefined,$$[$0]);
3517break;
3518case 137: case 139:
3519this.$ = $$[$0-4];yy.updateLink($$[$0-2],$$[$0]);
3520break;
3521case 138:
3522this.$ = $$[$0-4];yy.updateLink([$$[$0-2]],$$[$0]);
3523break;
3524case 140:
3525this.$ = $$[$0-8];yy.updateLinkInterpolate([$$[$0-6]],$$[$0-2]);yy.updateLink([$$[$0-6]],$$[$0]);
3526break;
3527case 141:
3528this.$ = $$[$0-8];yy.updateLinkInterpolate($$[$0-6],$$[$0-2]);yy.updateLink($$[$0-6],$$[$0]);
3529break;
3530case 142:
3531this.$ = $$[$0-6];yy.updateLinkInterpolate([$$[$0-4]],$$[$0]);
3532break;
3533case 143:
3534this.$ = $$[$0-6];yy.updateLinkInterpolate($$[$0-4],$$[$0]);
3535break;
3536case 145: case 147:
3537this.$ = [$$[$0]]
3538break;
3539case 146: case 148:
3540$$[$0-2].push($$[$0]);this.$ = $$[$0-2];
3541break;
3542case 150:
3543this.$ = $$[$0-1] + $$[$0];
3544break;
3545case 175:
3546this.$=$$[$0]
3547break;
3548case 176:
3549this.$=$$[$0-1]+''+$$[$0]
3550break;
3551case 181:
3552this.$='v';
3553break;
3554case 182:
3555this.$='-';
3556break;
3557}
3558},
3559table: [{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,35:30,89:$Va,90:$Vb,91:$Vc,92:$Vd,93:$Ve,94:$Vf,106:$Vg,107:$Vh,110:$Vi,111:$Vj,112:$Vk,114:$Vl,115:$Vm,119:31,121:$Vn,122:$Vo,123:$Vp,124:$Vq,125:$Vr,126:$Vs},o($V3,[2,9]),o($V3,[2,10]),{8:[1,47],9:[1,48],10:$Vt,14:46,17:49},o($Vu,[2,3]),o($Vu,[2,4]),o($Vu,[2,5]),o($Vu,[2,6]),o($Vu,[2,7]),o($Vu,[2,8]),{8:$Vv,9:$Vw,11:$Vx,20:51,31:52,47:56,50:[1,57],51:[1,69],52:[1,58],53:[1,71],54:[1,59],55:[1,73],56:[1,60],57:[1,75],58:[1,61],59:[1,76],60:[1,62],61:[1,78],62:[1,63],63:[1,80],64:[1,64],65:[1,82],66:[1,65],67:[1,83],68:[1,66],69:[1,85],70:[1,67],71:[1,87],72:[1,68],73:[1,89],74:[1,70],75:[1,72],76:[1,74],77:[1,77],78:[1,79],79:[1,81],80:[1,84],81:[1,86],82:[1,88]},{8:$Vv,9:$Vw,11:$Vx,20:90},{8:$Vv,9:$Vw,11:$Vx,20:91},{8:$Vv,9:$Vw,11:$Vx,20:92},{8:$Vv,9:$Vw,11:$Vx,20:93},{8:$Vv,9:$Vw,11:$Vx,20:94},{8:$Vv,9:$Vw,10:[1,95],11:$Vx,20:96},o($Vy,[2,39]),{10:[1,97]},{10:[1,98]},{10:[1,99]},{10:[1,100]},{10:[1,101]},o($Vy,[2,40],{34:[1,102]}),o($Vz,[2,62],{17:110,119:111,10:$Vt,28:[1,103],36:[1,104],38:[1,105],40:[1,106],42:[1,107],43:[1,108],45:[1,109],94:$Vf,106:$Vg,107:$Vh,110:$Vi,111:$Vj,112:$Vk,114:$Vl,115:$Vm,121:$Vn,122:$Vo,123:$Vp,124:$Vq,125:$Vr,126:$Vs}),o($VA,[2,175]),o($VA,[2,195]),o($VA,[2,196]),o($VA,[2,197]),o($VA,[2,198]),o($VA,[2,199]),o($VA,[2,200]),o($VA,[2,201]),o($VA,[2,202]),o($VA,[2,203]),o($VA,[2,204]),o($VA,[2,205]),o($VA,[2,206]),o($VA,[2,207]),o($VA,[2,208]),o($V3,[2,11]),o($V3,[2,17]),o($V3,[2,18]),{9:[1,112]},o($Vz,[2,25],{17:113,10:$Vt}),o($Vu,[2,26]),{32:114,33:29,35:30,94:$Vf,106:$Vg,107:$Vh,110:$Vi,111:$Vj,112:$Vk,114:$Vl,115:$Vm,119:31,121:$Vn,122:$Vo,123:$Vp,124:$Vq,125:$Vr,126:$Vs},o($Vu,[2,35]),o($Vu,[2,36]),o($Vu,[2,37]),o($VB,[2,67],{48:115,49:[1,116],83:[1,117]}),{10:$VC,12:$VD,13:$VE,26:$VF,27:118,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:155,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:156,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:157,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:158,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:159,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:160,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:161,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:162,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:163,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:164,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:165,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},o($V61,[2,89]),o($V61,[2,90]),o($V61,[2,91]),o($V61,[2,92]),o($V61,[2,93]),o($V61,[2,94]),o($V61,[2,95]),o($V61,[2,96]),o($V61,[2,97]),o($V61,[2,98]),o($V61,[2,99]),o($V61,[2,100]),o($V61,[2,101]),o($V61,[2,102]),o($V61,[2,103]),o($V61,[2,104]),o($V61,[2,105]),o($V61,[2,106]),o($V61,[2,107]),o($V61,[2,108]),o($V61,[2,109]),o($Vu,[2,27]),o($Vu,[2,28]),o($Vu,[2,29]),o($Vu,[2,30]),o($Vu,[2,31]),{10:$VC,12:$VD,13:$VE,26:$VF,27:166,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},o($V71,$V4,{5:167}),{13:$V81,94:$V91,100:168,101:[1,169],106:$VU,107:$VV,110:$VW,111:$VX,112:$Va1,114:$VZ,115:$V_,118:172,120:170,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{98:[1,175],102:176,106:[1,177]},{13:$V81,94:$V91,98:[1,178],100:179,106:$VU,107:$VV,110:$VW,111:$VX,112:$Va1,114:$VZ,115:$V_,118:172,120:170,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{13:$V81,94:$V91,100:180,106:$VU,107:$VV,110:$VW,111:$VX,112:$Va1,114:$VZ,115:$V_,118:172,120:170,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{13:$V81,94:$V91,100:181,106:$VU,107:$VV,110:$VW,111:$VX,112:$Va1,114:$VZ,115:$V_,118:172,120:170,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{35:182,94:$Vf,106:$Vg,107:$Vh,110:$Vi,111:$Vj,112:$Vk,114:$Vl,115:$Vm,119:31,121:$Vn,122:$Vo,123:$Vp,124:$Vq,125:$Vr,126:$Vs},{10:$VC,12:$VD,13:$VE,26:$VF,27:183,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:185,30:$VG,36:[1,184],42:$VH,50:$VI,66:$VJ,84:119,85:$VK,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:186,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:187,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:188,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:189,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:190,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},o($Vz,[2,63]),o($VA,[2,176]),o($V3,[2,19]),o($Vz,[2,24]),o($Vy,[2,38]),o($VB,[2,64],{10:[1,191]}),{10:[1,192]},{10:$VC,12:$VD,13:$VE,26:$VF,27:193,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,50:$VI,51:[1,194],53:[1,195],55:[1,196],57:[1,197],66:$VJ,84:198,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},o($Vb1,[2,111]),o($Vb1,[2,113]),o($Vb1,[2,164]),o($Vb1,[2,165]),o($Vb1,[2,166]),o($Vb1,[2,167]),o($Vb1,[2,168]),o($Vb1,[2,169]),o($Vb1,[2,170]),o($Vb1,[2,171]),o($Vb1,[2,172]),o($Vb1,[2,173]),o($Vb1,[2,174]),o($Vb1,[2,183]),o($Vb1,[2,184]),o($Vb1,[2,185]),o($Vb1,[2,186]),o($Vb1,[2,187]),o($Vb1,[2,188]),o($Vb1,[2,189]),o($Vb1,[2,190]),o($Vb1,[2,191]),o($Vb1,[2,192]),o($Vb1,[2,193]),o($Vb1,[2,194]),o($Vb1,[2,116]),o($Vb1,[2,117]),o($Vb1,[2,118]),o($Vb1,[2,119]),o($Vb1,[2,120]),o($Vb1,[2,121]),o($Vb1,[2,122]),o($Vb1,[2,123]),o($Vb1,[2,124]),o($Vb1,[2,125]),o($Vb1,[2,126]),{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,50:$VI,51:[1,199],66:$VJ,84:198,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,50:$VI,53:[1,200],66:$VJ,84:198,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,50:$VI,55:[1,201],66:$VJ,84:198,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,50:$VI,59:[1,202],61:[1,203],63:[1,204],65:[1,205],66:$VJ,84:198,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,50:$VI,59:[1,206],66:$VJ,84:198,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,50:$VI,61:[1,207],66:$VJ,84:198,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,50:$VI,63:[1,208],66:$VJ,84:198,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,50:$VI,66:$VJ,67:[1,209],69:[1,210],71:[1,211],73:[1,212],84:198,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,50:$VI,66:$VJ,67:[1,213],84:198,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,50:$VI,66:$VJ,69:[1,214],84:198,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,50:$VI,66:$VJ,71:[1,215],84:198,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{8:$Vv,9:$Vw,10:$VC,11:$Vx,12:$VD,13:$VE,20:217,26:$VF,28:[1,216],30:$VG,42:$VH,50:$VI,66:$VJ,84:198,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{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,218],32:23,33:29,35:30,89:$Va,90:$Vb,91:$Vc,92:$Vd,93:$Ve,94:$Vf,106:$Vg,107:$Vh,110:$Vi,111:$Vj,112:$Vk,114:$Vl,115:$Vm,119:31,121:$Vn,122:$Vo,123:$Vp,124:$Vq,125:$Vr,126:$Vs},{10:[1,219],13:$V81,94:$V91,106:$VU,107:$VV,110:$VW,111:$VX,112:$Va1,114:$VZ,115:$V_,118:172,120:220,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:[1,221]},o($Vc1,[2,177]),o($Vc1,[2,179]),o($Vc1,[2,180]),o($Vc1,[2,181]),o($Vc1,[2,182]),{10:[1,222]},{10:[1,223],107:[1,224]},o($Vd1,[2,145]),{10:[1,225]},{10:[1,226],13:$V81,94:$V91,106:$VU,107:$VV,110:$VW,111:$VX,112:$Va1,114:$VZ,115:$V_,118:172,120:220,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:[1,227],13:$V81,94:$V91,106:$VU,107:$VV,110:$VW,111:$VX,112:$Va1,114:$VZ,115:$V_,118:172,120:220,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:[1,228],13:$V81,94:$V91,106:$VU,107:$VV,110:$VW,111:$VX,112:$Va1,114:$VZ,115:$V_,118:172,120:220,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},o($Vy,[2,41],{119:111,94:$Vf,106:$Vg,107:$Vh,110:$Vi,111:$Vj,112:$Vk,114:$Vl,115:$Vm,121:$Vn,122:$Vo,123:$Vp,124:$Vq,125:$Vr,126:$Vs}),{10:$VC,12:$VD,13:$VE,26:$VF,29:[1,229],30:$VG,42:$VH,50:$VI,66:$VJ,84:198,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,27:230,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,37:[1,231],42:$VH,50:$VI,66:$VJ,84:198,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,39:[1,232],42:$VH,50:$VI,66:$VJ,84:198,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,41:[1,233],42:$VH,50:$VI,66:$VJ,84:198,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,29:[1,234],30:$VG,42:$VH,50:$VI,66:$VJ,84:198,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,44:[1,235],46:[1,236],50:$VI,66:$VJ,84:198,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,44:[1,238],46:[1,237],50:$VI,66:$VJ,84:198,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},o($VB,[2,66]),o($VB,[2,65]),{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,42:$VH,50:$VI,66:$VJ,83:[1,239],84:198,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},o($VB,[2,68]),o($VB,[2,70]),o($VB,[2,72]),o($VB,[2,74]),o($Vb1,[2,112]),o($VB,[2,69]),o($VB,[2,71]),o($VB,[2,73]),o($VB,[2,75]),o($VB,[2,77]),o($VB,[2,79]),o($VB,[2,81]),o($VB,[2,76]),o($VB,[2,78]),o($VB,[2,80]),o($VB,[2,82]),o($VB,[2,84]),o($VB,[2,86]),o($VB,[2,88]),o($VB,[2,83]),o($VB,[2,85]),o($VB,[2,87]),{10:$VC,12:$VD,13:$VE,26:$VF,27:240,30:$VG,42:$VH,50:$VI,66:$VJ,84:119,85:$VK,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},o($V71,$V4,{5:241}),o($Vu,[2,34]),{10:$Ve1,89:$Vf1,99:242,101:$Vg1,105:$Vh1,106:$Vi1,108:243,109:244,110:$Vj1,111:$Vk1,112:$Vl1,113:$Vm1,114:$Vn1,115:$Vo1},o($Vc1,[2,178]),{10:$Ve1,89:$Vf1,99:256,101:$Vg1,105:$Vh1,106:$Vi1,108:243,109:244,110:$Vj1,111:$Vk1,112:$Vl1,113:$Vm1,114:$Vn1,115:$Vo1},{10:$Ve1,89:$Vf1,99:257,101:$Vg1,103:[1,258],105:$Vh1,106:$Vi1,108:243,109:244,110:$Vj1,111:$Vk1,112:$Vl1,113:$Vm1,114:$Vn1,115:$Vo1},{10:$Ve1,89:$Vf1,99:259,101:$Vg1,103:[1,260],105:$Vh1,106:$Vi1,108:243,109:244,110:$Vj1,111:$Vk1,112:$Vl1,113:$Vm1,114:$Vn1,115:$Vo1},{106:[1,261]},{10:$Ve1,89:$Vf1,99:262,101:$Vg1,105:$Vh1,106:$Vi1,108:243,109:244,110:$Vj1,111:$Vk1,112:$Vl1,113:$Vm1,114:$Vn1,115:$Vo1},{10:$Ve1,89:$Vf1,99:263,101:$Vg1,105:$Vh1,106:$Vi1,108:243,109:244,110:$Vj1,111:$Vk1,112:$Vl1,113:$Vm1,114:$Vn1,115:$Vo1},{13:$V81,94:$V91,100:264,106:$VU,107:$VV,110:$VW,111:$VX,112:$Va1,114:$VZ,115:$V_,118:172,120:170,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{13:$V81,85:[1,266],94:$V91,100:265,106:$VU,107:$VV,110:$VW,111:$VX,112:$Va1,114:$VZ,115:$V_,118:172,120:170,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},o($Vz,[2,42],{17:267,10:$Vt}),{10:$VC,12:$VD,13:$VE,26:$VF,30:$VG,37:[1,268],42:$VH,50:$VI,66:$VJ,84:198,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},o($Vz,[2,48],{17:269,10:$Vt}),o($Vz,[2,46],{17:270,10:$Vt}),o($Vz,[2,50],{17:271,10:$Vt}),o($Vz,[2,52],{17:272,10:$Vt}),o($Vz,[2,54],{17:273,10:$Vt}),o($Vz,[2,58],{17:274,10:$Vt}),o($Vz,[2,56],{17:275,10:$Vt}),o($Vz,[2,60],{17:276,10:$Vt}),o([10,94,106,107,110,111,112,114,115,121,122,123,124,125,126],[2,110]),{10:$VC,12:$VD,13:$VE,26:$VF,29:[1,277],30:$VG,42:$VH,50:$VI,66:$VJ,84:198,88:131,89:$VL,90:$VM,91:$VN,92:$VO,93:$VP,94:$VQ,95:$VR,97:121,98:$VS,105:$VT,106:$VU,107:$VV,110:$VW,111:$VX,112:$VY,114:$VZ,115:$V_,117:$V$,118:128,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{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,278],32:23,33:29,35:30,89:$Va,90:$Vb,91:$Vc,92:$Vd,93:$Ve,94:$Vf,106:$Vg,107:$Vh,110:$Vi,111:$Vj,112:$Vk,114:$Vl,115:$Vm,119:31,121:$Vn,122:$Vo,123:$Vp,124:$Vq,125:$Vr,126:$Vs},o($Vp1,[2,136],{107:$Vq1}),o($Vr1,[2,147],{109:280,10:$Ve1,89:$Vf1,101:$Vg1,105:$Vh1,106:$Vi1,110:$Vj1,111:$Vk1,112:$Vl1,113:$Vm1,114:$Vn1,115:$Vo1}),o($Vs1,[2,149]),o($Vs1,[2,151]),o($Vs1,[2,152]),o($Vs1,[2,153]),o($Vs1,[2,154]),o($Vs1,[2,155]),o($Vs1,[2,156]),o($Vs1,[2,157]),o($Vs1,[2,158]),o($Vs1,[2,159]),o($Vs1,[2,160]),o($Vs1,[2,161]),o($Vp1,[2,137],{107:$Vq1}),o($Vp1,[2,138],{107:$Vq1}),{10:[1,281]},o($Vp1,[2,139],{107:$Vq1}),{10:[1,282]},o($Vd1,[2,146]),o($Vp1,[2,129],{107:$Vq1}),o($Vp1,[2,130],{107:$Vq1}),o($Vp1,[2,131],{118:172,120:220,13:$V81,94:$V91,106:$VU,107:$VV,110:$VW,111:$VX,112:$Va1,114:$VZ,115:$V_,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51}),o($Vp1,[2,132],{118:172,120:220,10:[1,283],13:$V81,94:$V91,106:$VU,107:$VV,110:$VW,111:$VX,112:$Va1,114:$VZ,115:$V_,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51}),o($Vp1,[2,134],{10:[1,284]}),o($Vz,[2,43]),{37:[1,285]},o($Vz,[2,49]),o($Vz,[2,47]),o($Vz,[2,51]),o($Vz,[2,53]),o($Vz,[2,55]),o($Vz,[2,59]),o($Vz,[2,57]),o($Vz,[2,61]),{8:$Vv,9:$Vw,11:$Vx,20:286},o($Vu,[2,33]),{10:$Ve1,89:$Vf1,101:$Vg1,105:$Vh1,106:$Vi1,108:287,109:244,110:$Vj1,111:$Vk1,112:$Vl1,113:$Vm1,114:$Vn1,115:$Vo1},o($Vs1,[2,150]),{13:$V81,94:$V91,100:288,106:$VU,107:$VV,110:$VW,111:$VX,112:$Va1,114:$VZ,115:$V_,118:172,120:170,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{13:$V81,94:$V91,100:289,106:$VU,107:$VV,110:$VW,111:$VX,112:$Va1,114:$VZ,115:$V_,118:172,120:170,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51},{85:[1,290]},{85:[1,291]},o($Vz,[2,44],{17:292,10:$Vt}),o($V71,$V4,{5:293}),o($Vr1,[2,148],{109:280,10:$Ve1,89:$Vf1,101:$Vg1,105:$Vh1,106:$Vi1,110:$Vj1,111:$Vk1,112:$Vl1,113:$Vm1,114:$Vn1,115:$Vo1}),o($Vp1,[2,142],{118:172,120:220,10:[1,294],13:$V81,94:$V91,106:$VU,107:$VV,110:$VW,111:$VX,112:$Va1,114:$VZ,115:$V_,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51}),o($Vp1,[2,143],{118:172,120:220,10:[1,295],13:$V81,94:$V91,106:$VU,107:$VV,110:$VW,111:$VX,112:$Va1,114:$VZ,115:$V_,121:$V01,122:$V11,123:$V21,124:$V31,125:$V41,126:$V51}),o($Vp1,[2,133]),o($Vp1,[2,135]),o($Vz,[2,45]),{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,296],32:23,33:29,35:30,89:$Va,90:$Vb,91:$Vc,92:$Vd,93:$Ve,94:$Vf,106:$Vg,107:$Vh,110:$Vi,111:$Vj,112:$Vk,114:$Vl,115:$Vm,119:31,121:$Vn,122:$Vo,123:$Vp,124:$Vq,125:$Vr,126:$Vs},{10:$Ve1,89:$Vf1,99:297,101:$Vg1,105:$Vh1,106:$Vi1,108:243,109:244,110:$Vj1,111:$Vk1,112:$Vl1,113:$Vm1,114:$Vn1,115:$Vo1},{10:$Ve1,89:$Vf1,99:298,101:$Vg1,105:$Vh1,106:$Vi1,108:243,109:244,110:$Vj1,111:$Vk1,112:$Vl1,113:$Vm1,114:$Vn1,115:$Vo1},o($Vu,[2,32]),o($Vp1,[2,140],{107:$Vq1}),o($Vp1,[2,141],{107:$Vq1})],
3560defaultActions: {},
3561parseError: function parseError (str, hash) {
3562 if (hash.recoverable) {
3563 this.trace(str);
3564 } else {
3565 var error = new Error(str);
3566 error.hash = hash;
3567 throw error;
3568 }
3569},
3570parse: function parse(input) {
3571 var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
3572 var args = lstack.slice.call(arguments, 1);
3573 var lexer = Object.create(this.lexer);
3574 var sharedState = { yy: {} };
3575 for (var k in this.yy) {
3576 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
3577 sharedState.yy[k] = this.yy[k];
3578 }
3579 }
3580 lexer.setInput(input, sharedState.yy);
3581 sharedState.yy.lexer = lexer;
3582 sharedState.yy.parser = this;
3583 if (typeof lexer.yylloc == 'undefined') {
3584 lexer.yylloc = {};
3585 }
3586 var yyloc = lexer.yylloc;
3587 lstack.push(yyloc);
3588 var ranges = lexer.options && lexer.options.ranges;
3589 if (typeof sharedState.yy.parseError === 'function') {
3590 this.parseError = sharedState.yy.parseError;
3591 } else {
3592 this.parseError = Object.getPrototypeOf(this).parseError;
3593 }
3594 function popStack(n) {
3595 stack.length = stack.length - 2 * n;
3596 vstack.length = vstack.length - n;
3597 lstack.length = lstack.length - n;
3598 }
3599 function lex() {
3600 var token;
3601 token = tstack.pop() || lexer.lex() || EOF;
3602 if (typeof token !== 'number') {
3603 if (token instanceof Array) {
3604 tstack = token;
3605 token = tstack.pop();
3606 }
3607 token = self.symbols_[token] || token;
3608 }
3609 return token;
3610 }
3611 var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
3612 while (true) {
3613 state = stack[stack.length - 1];
3614 if (this.defaultActions[state]) {
3615 action = this.defaultActions[state];
3616 } else {
3617 if (symbol === null || typeof symbol == 'undefined') {
3618 symbol = lex();
3619 }
3620 action = table[state] && table[state][symbol];
3621 }
3622 if (typeof action === 'undefined' || !action.length || !action[0]) {
3623 var errStr = '';
3624 expected = [];
3625 for (p in table[state]) {
3626 if (this.terminals_[p] && p > TERROR) {
3627 expected.push('\'' + this.terminals_[p] + '\'');
3628 }
3629 }
3630 if (lexer.showPosition) {
3631 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
3632 } else {
3633 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
3634 }
3635 this.parseError(errStr, {
3636 text: lexer.match,
3637 token: this.terminals_[symbol] || symbol,
3638 line: lexer.yylineno,
3639 loc: yyloc,
3640 expected: expected
3641 });
3642 }
3643 if (action[0] instanceof Array && action.length > 1) {
3644 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
3645 }
3646 switch (action[0]) {
3647 case 1:
3648 stack.push(symbol);
3649 vstack.push(lexer.yytext);
3650 lstack.push(lexer.yylloc);
3651 stack.push(action[1]);
3652 symbol = null;
3653 if (!preErrorSymbol) {
3654 yyleng = lexer.yyleng;
3655 yytext = lexer.yytext;
3656 yylineno = lexer.yylineno;
3657 yyloc = lexer.yylloc;
3658 if (recovering > 0) {
3659 recovering--;
3660 }
3661 } else {
3662 symbol = preErrorSymbol;
3663 preErrorSymbol = null;
3664 }
3665 break;
3666 case 2:
3667 len = this.productions_[action[1]][1];
3668 yyval.$ = vstack[vstack.length - len];
3669 yyval._$ = {
3670 first_line: lstack[lstack.length - (len || 1)].first_line,
3671 last_line: lstack[lstack.length - 1].last_line,
3672 first_column: lstack[lstack.length - (len || 1)].first_column,
3673 last_column: lstack[lstack.length - 1].last_column
3674 };
3675 if (ranges) {
3676 yyval._$.range = [
3677 lstack[lstack.length - (len || 1)].range[0],
3678 lstack[lstack.length - 1].range[1]
3679 ];
3680 }
3681 r = this.performAction.apply(yyval, [
3682 yytext,
3683 yyleng,
3684 yylineno,
3685 sharedState.yy,
3686 action[1],
3687 vstack,
3688 lstack
3689 ].concat(args));
3690 if (typeof r !== 'undefined') {
3691 return r;
3692 }
3693 if (len) {
3694 stack = stack.slice(0, -1 * len * 2);
3695 vstack = vstack.slice(0, -1 * len);
3696 lstack = lstack.slice(0, -1 * len);
3697 }
3698 stack.push(this.productions_[action[1]][0]);
3699 vstack.push(yyval.$);
3700 lstack.push(yyval._$);
3701 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
3702 stack.push(newState);
3703 break;
3704 case 3:
3705 return true;
3706 }
3707 }
3708 return true;
3709}};
3710
3711/* generated by jison-lex 0.3.4 */
3712var lexer = (function(){
3713var lexer = ({
3714
3715EOF:1,
3716
3717parseError:function parseError(str, hash) {
3718 if (this.yy.parser) {
3719 this.yy.parser.parseError(str, hash);
3720 } else {
3721 throw new Error(str);
3722 }
3723 },
3724
3725// resets the lexer, sets new input
3726setInput:function (input, yy) {
3727 this.yy = yy || this.yy || {};
3728 this._input = input;
3729 this._more = this._backtrack = this.done = false;
3730 this.yylineno = this.yyleng = 0;
3731 this.yytext = this.matched = this.match = '';
3732 this.conditionStack = ['INITIAL'];
3733 this.yylloc = {
3734 first_line: 1,
3735 first_column: 0,
3736 last_line: 1,
3737 last_column: 0
3738 };
3739 if (this.options.ranges) {
3740 this.yylloc.range = [0,0];
3741 }
3742 this.offset = 0;
3743 return this;
3744 },
3745
3746// consumes and returns one char from the input
3747input:function () {
3748 var ch = this._input[0];
3749 this.yytext += ch;
3750 this.yyleng++;
3751 this.offset++;
3752 this.match += ch;
3753 this.matched += ch;
3754 var lines = ch.match(/(?:\r\n?|\n).*/g);
3755 if (lines) {
3756 this.yylineno++;
3757 this.yylloc.last_line++;
3758 } else {
3759 this.yylloc.last_column++;
3760 }
3761 if (this.options.ranges) {
3762 this.yylloc.range[1]++;
3763 }
3764
3765 this._input = this._input.slice(1);
3766 return ch;
3767 },
3768
3769// unshifts one char (or a string) into the input
3770unput:function (ch) {
3771 var len = ch.length;
3772 var lines = ch.split(/(?:\r\n?|\n)/g);
3773
3774 this._input = ch + this._input;
3775 this.yytext = this.yytext.substr(0, this.yytext.length - len);
3776 //this.yyleng -= len;
3777 this.offset -= len;
3778 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
3779 this.match = this.match.substr(0, this.match.length - 1);
3780 this.matched = this.matched.substr(0, this.matched.length - 1);
3781
3782 if (lines.length - 1) {
3783 this.yylineno -= lines.length - 1;
3784 }
3785 var r = this.yylloc.range;
3786
3787 this.yylloc = {
3788 first_line: this.yylloc.first_line,
3789 last_line: this.yylineno + 1,
3790 first_column: this.yylloc.first_column,
3791 last_column: lines ?
3792 (lines.length === oldLines.length ? this.yylloc.first_column : 0)
3793 + oldLines[oldLines.length - lines.length].length - lines[0].length :
3794 this.yylloc.first_column - len
3795 };
3796
3797 if (this.options.ranges) {
3798 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
3799 }
3800 this.yyleng = this.yytext.length;
3801 return this;
3802 },
3803
3804// When called from action, caches matched text and appends it on next action
3805more:function () {
3806 this._more = true;
3807 return this;
3808 },
3809
3810// 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.
3811reject:function () {
3812 if (this.options.backtrack_lexer) {
3813 this._backtrack = true;
3814 } else {
3815 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(), {
3816 text: "",
3817 token: null,
3818 line: this.yylineno
3819 });
3820
3821 }
3822 return this;
3823 },
3824
3825// retain first n characters of the match
3826less:function (n) {
3827 this.unput(this.match.slice(n));
3828 },
3829
3830// displays already matched input, i.e. for error messages
3831pastInput:function () {
3832 var past = this.matched.substr(0, this.matched.length - this.match.length);
3833 return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
3834 },
3835
3836// displays upcoming input, i.e. for error messages
3837upcomingInput:function () {
3838 var next = this.match;
3839 if (next.length < 20) {
3840 next += this._input.substr(0, 20-next.length);
3841 }
3842 return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
3843 },
3844
3845// displays the character position where the lexing error occurred, i.e. for error messages
3846showPosition:function () {
3847 var pre = this.pastInput();
3848 var c = new Array(pre.length + 1).join("-");
3849 return pre + this.upcomingInput() + "\n" + c + "^";
3850 },
3851
3852// test the lexed token: return FALSE when not a match, otherwise return token
3853test_match:function(match, indexed_rule) {
3854 var token,
3855 lines,
3856 backup;
3857
3858 if (this.options.backtrack_lexer) {
3859 // save context
3860 backup = {
3861 yylineno: this.yylineno,
3862 yylloc: {
3863 first_line: this.yylloc.first_line,
3864 last_line: this.last_line,
3865 first_column: this.yylloc.first_column,
3866 last_column: this.yylloc.last_column
3867 },
3868 yytext: this.yytext,
3869 match: this.match,
3870 matches: this.matches,
3871 matched: this.matched,
3872 yyleng: this.yyleng,
3873 offset: this.offset,
3874 _more: this._more,
3875 _input: this._input,
3876 yy: this.yy,
3877 conditionStack: this.conditionStack.slice(0),
3878 done: this.done
3879 };
3880 if (this.options.ranges) {
3881 backup.yylloc.range = this.yylloc.range.slice(0);
3882 }
3883 }
3884
3885 lines = match[0].match(/(?:\r\n?|\n).*/g);
3886 if (lines) {
3887 this.yylineno += lines.length;
3888 }
3889 this.yylloc = {
3890 first_line: this.yylloc.last_line,
3891 last_line: this.yylineno + 1,
3892 first_column: this.yylloc.last_column,
3893 last_column: lines ?
3894 lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
3895 this.yylloc.last_column + match[0].length
3896 };
3897 this.yytext += match[0];
3898 this.match += match[0];
3899 this.matches = match;
3900 this.yyleng = this.yytext.length;
3901 if (this.options.ranges) {
3902 this.yylloc.range = [this.offset, this.offset += this.yyleng];
3903 }
3904 this._more = false;
3905 this._backtrack = false;
3906 this._input = this._input.slice(match[0].length);
3907 this.matched += match[0];
3908 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
3909 if (this.done && this._input) {
3910 this.done = false;
3911 }
3912 if (token) {
3913 return token;
3914 } else if (this._backtrack) {
3915 // recover context
3916 for (var k in backup) {
3917 this[k] = backup[k];
3918 }
3919 return false; // rule action called reject() implying the next rule should be tested instead.
3920 }
3921 return false;
3922 },
3923
3924// return next match in input
3925next:function () {
3926 if (this.done) {
3927 return this.EOF;
3928 }
3929 if (!this._input) {
3930 this.done = true;
3931 }
3932
3933 var token,
3934 match,
3935 tempMatch,
3936 index;
3937 if (!this._more) {
3938 this.yytext = '';
3939 this.match = '';
3940 }
3941 var rules = this._currentRules();
3942 for (var i = 0; i < rules.length; i++) {
3943 tempMatch = this._input.match(this.rules[rules[i]]);
3944 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
3945 match = tempMatch;
3946 index = i;
3947 if (this.options.backtrack_lexer) {
3948 token = this.test_match(tempMatch, rules[i]);
3949 if (token !== false) {
3950 return token;
3951 } else if (this._backtrack) {
3952 match = false;
3953 continue; // rule action called reject() implying a rule MISmatch.
3954 } else {
3955 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
3956 return false;
3957 }
3958 } else if (!this.options.flex) {
3959 break;
3960 }
3961 }
3962 }
3963 if (match) {
3964 token = this.test_match(match, rules[index]);
3965 if (token !== false) {
3966 return token;
3967 }
3968 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
3969 return false;
3970 }
3971 if (this._input === "") {
3972 return this.EOF;
3973 } else {
3974 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
3975 text: "",
3976 token: null,
3977 line: this.yylineno
3978 });
3979 }
3980 },
3981
3982// return next match that has a token
3983lex:function lex () {
3984 var r = this.next();
3985 if (r) {
3986 return r;
3987 } else {
3988 return this.lex();
3989 }
3990 },
3991
3992// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
3993begin:function begin (condition) {
3994 this.conditionStack.push(condition);
3995 },
3996
3997// pop the previously active lexer condition state off the condition stack
3998popState:function popState () {
3999 var n = this.conditionStack.length - 1;
4000 if (n > 0) {
4001 return this.conditionStack.pop();
4002 } else {
4003 return this.conditionStack[0];
4004 }
4005 },
4006
4007// produce the lexer rule set which is active for the currently active lexer condition state
4008_currentRules:function _currentRules () {
4009 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
4010 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
4011 } else {
4012 return this.conditions["INITIAL"].rules;
4013 }
4014 },
4015
4016// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
4017topState:function topState (n) {
4018 n = this.conditionStack.length - 1 - Math.abs(n || 0);
4019 if (n >= 0) {
4020 return this.conditionStack[n];
4021 } else {
4022 return "INITIAL";
4023 }
4024 },
4025
4026// alias for begin(condition)
4027pushState:function pushState (condition) {
4028 this.begin(condition);
4029 },
4030
4031// return the number of states currently on the stack
4032stateStackSize:function stateStackSize() {
4033 return this.conditionStack.length;
4034 },
4035options: {},
4036performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
4037var YYSTATE=YY_START;
4038switch($avoiding_name_collisions) {
4039case 0:/* do nothing */
4040break;
4041case 1:this.begin("string");
4042break;
4043case 2:this.popState();
4044break;
4045case 3:return "STR";
4046break;
4047case 4:return 89;
4048break;
4049case 5:return 98;
4050break;
4051case 6:return 90;
4052break;
4053case 7:return 103;
4054break;
4055case 8:return 91;
4056break;
4057case 9:return 92;
4058break;
4059case 10:return 93;
4060break;
4061case 11:if(yy.lex.firstGraph()){this.begin("dir");} return 12;
4062break;
4063case 12:return 26;
4064break;
4065case 13:return 30;
4066break;
4067case 14: this.popState(); return 13;
4068break;
4069case 15: this.popState(); return 13;
4070break;
4071case 16: this.popState(); return 13;
4072break;
4073case 17: this.popState(); return 13;
4074break;
4075case 18: this.popState(); return 13;
4076break;
4077case 19: this.popState(); return 13;
4078break;
4079case 20: this.popState(); return 13;
4080break;
4081case 21: this.popState(); return 13;
4082break;
4083case 22: this.popState(); return 13;
4084break;
4085case 23: this.popState(); return 13;
4086break;
4087case 24: return 106;
4088break;
4089case 25:return 114;
4090break;
4091case 26:return 34;
4092break;
4093case 27:return 111;
4094break;
4095case 28:return 8;
4096break;
4097case 29:return 107;
4098break;
4099case 30:return 125;
4100break;
4101case 31:return 55;
4102break;
4103case 32:return 51;
4104break;
4105case 33:return 74;
4106break;
4107case 34:return 76;
4108break;
4109case 35:return 75;
4110break;
4111case 36:return 78;
4112break;
4113case 37:return 80;
4114break;
4115case 38:return 81;
4116break;
4117case 39:return 82;
4118break;
4119case 40:return 79;
4120break;
4121case 41:return 79;
4122break;
4123case 42:return 77;
4124break;
4125case 43:return 77;
4126break;
4127case 44:return 78;
4128break;
4129case 45:return 53;
4130break;
4131case 46:return 57;
4132break;
4133case 47:return 63;
4134break;
4135case 48:return 59;
4136break;
4137case 49:return 61;
4138break;
4139case 50:return 65;
4140break;
4141case 51:return 63;
4142break;
4143case 52:return 59;
4144break;
4145case 53:return 61;
4146break;
4147case 54:return 65;
4148break;
4149case 55:return 71;
4150break;
4151case 56:return 67;
4152break;
4153case 57:return 69;
4154break;
4155case 58:return 73;
4156break;
4157case 59:return 52;
4158break;
4159case 60:return 56;
4160break;
4161case 61:return 54;
4162break;
4163case 62:return 60;
4164break;
4165case 63:return 64;
4166break;
4167case 64:return 62;
4168break;
4169case 65:return 68;
4170break;
4171case 66:return 72;
4172break;
4173case 67:return 70;
4174break;
4175case 68:return 50;
4176break;
4177case 69:return 58;
4178break;
4179case 70:return 66;
4180break;
4181case 71:return 38;
4182break;
4183case 72:return 39;
4184break;
4185case 73:return 112;
4186break;
4187case 74:return 115;
4188break;
4189case 75:return 126;
4190break;
4191case 76:return 123;
4192break;
4193case 77:return 105;
4194break;
4195case 78:return 124;
4196break;
4197case 79:return 124;
4198break;
4199case 80:return 117;
4200break;
4201case 81:return 42;
4202break;
4203case 82:return 95;
4204break;
4205case 83:return 94;
4206break;
4207case 84:return 110;
4208break;
4209case 85:return 44;
4210break;
4211case 86:return 43;
4212break;
4213case 87:return 46;
4214break;
4215case 88:return 45;
4216break;
4217case 89:return 121;
4218break;
4219case 90:return 122;
4220break;
4221case 91:return 83;
4222break;
4223case 92:return 36;
4224break;
4225case 93:return 37;
4226break;
4227case 94:return 28;
4228break;
4229case 95:return 29;
4230break;
4231case 96:return 40
4232break;
4233case 97:return 41
4234break;
4235case 98:return 127;
4236break;
4237case 99:return 9;
4238break;
4239case 100:return 10;
4240break;
4241case 101:return 11;
4242break;
4243}
4244},
4245rules: [/^(?:%%[^\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])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:")/,/^(?:\n+)/,/^(?:\s)/,/^(?:$)/],
4246conditions: {"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],"inclusive":true}}
4247});
4248return lexer;
4249})();
4250parser.lexer = lexer;
4251function Parser () {
4252 this.yy = {};
4253}
4254Parser.prototype = parser;parser.Parser = Parser;
4255return new Parser;
4256})();
4257
4258
4259if (true) {
4260exports.parser = parser;
4261exports.Parser = parser.Parser;
4262exports.parse = function () { return parser.parse.apply(parser, arguments); };
4263exports.main = function commonjsMain (args) {
4264 if (!args[1]) {
4265 console.log('Usage: '+args[0]+' FILE');
4266 process.exit(1);
4267 }
4268 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");
4269 return exports.parser.parse(source);
4270};
4271if ( true && __webpack_require__.c[__webpack_require__.s] === module) {
4272 exports.main(process.argv.slice(1));
4273}
4274}
4275/* 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)))
4276
4277/***/ }),
4278
4279/***/ "./src/diagrams/gantt/ganttDb.js":
4280/*!***************************************!*\
4281 !*** ./src/diagrams/gantt/ganttDb.js ***!
4282 \***************************************/
4283/*! exports provided: clear, setAxisFormat, getAxisFormat, setDateFormat, enableInclusiveEndDates, endDatesAreInclusive, getDateFormat, setExcludes, getExcludes, setTitle, getTitle, addSection, getSections, getTasks, addTask, findTaskById, addTaskOrg, setLink, setClass, setClickEvent, bindFunctions, default */
4284/***/ (function(module, __webpack_exports__, __webpack_require__) {
4285
4286"use strict";
4287__webpack_require__.r(__webpack_exports__);
4288/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clear", function() { return clear; });
4289/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAxisFormat", function() { return setAxisFormat; });
4290/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAxisFormat", function() { return getAxisFormat; });
4291/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setDateFormat", function() { return setDateFormat; });
4292/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enableInclusiveEndDates", function() { return enableInclusiveEndDates; });
4293/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "endDatesAreInclusive", function() { return endDatesAreInclusive; });
4294/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDateFormat", function() { return getDateFormat; });
4295/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setExcludes", function() { return setExcludes; });
4296/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getExcludes", function() { return getExcludes; });
4297/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTitle", function() { return setTitle; });
4298/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTitle", function() { return getTitle; });
4299/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addSection", function() { return addSection; });
4300/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSections", function() { return getSections; });
4301/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTasks", function() { return getTasks; });
4302/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addTask", function() { return addTask; });
4303/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findTaskById", function() { return findTaskById; });
4304/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addTaskOrg", function() { return addTaskOrg; });
4305/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLink", function() { return setLink; });
4306/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setClass", function() { return setClass; });
4307/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setClickEvent", function() { return setClickEvent; });
4308/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bindFunctions", function() { return bindFunctions; });
4309/* harmony import */ var moment_mini__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment-mini */ "moment-mini");
4310/* harmony import */ var moment_mini__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment_mini__WEBPACK_IMPORTED_MODULE_0__);
4311/* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @braintree/sanitize-url */ "@braintree/sanitize-url");
4312/* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1__);
4313/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
4314/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../config */ "./src/config.js");
4315
4316
4317
4318
4319const config = Object(_config__WEBPACK_IMPORTED_MODULE_3__["getConfig"])();
4320let dateFormat = '';
4321let axisFormat = '';
4322let excludes = [];
4323let title = '';
4324let sections = [];
4325let tasks = [];
4326let currentSection = '';
4327const tags = ['active', 'done', 'crit', 'milestone'];
4328let funs = [];
4329let inclusiveEndDates = false;
4330const clear = function () {
4331 sections = [];
4332 tasks = [];
4333 currentSection = '';
4334 funs = [];
4335 title = '';
4336 taskCnt = 0;
4337 lastTask = undefined;
4338 lastTaskID = undefined;
4339 rawTasks = [];
4340 dateFormat = '';
4341 axisFormat = '';
4342 excludes = [];
4343 inclusiveEndDates = false;
4344};
4345const setAxisFormat = function (txt) {
4346 axisFormat = txt;
4347};
4348const getAxisFormat = function () {
4349 return axisFormat;
4350};
4351const setDateFormat = function (txt) {
4352 dateFormat = txt;
4353};
4354const enableInclusiveEndDates = function () {
4355 inclusiveEndDates = true;
4356};
4357const endDatesAreInclusive = function () {
4358 return inclusiveEndDates;
4359};
4360const getDateFormat = function () {
4361 return dateFormat;
4362};
4363const setExcludes = function (txt) {
4364 excludes = txt.toLowerCase().split(/[\s,]+/);
4365};
4366const getExcludes = function () {
4367 return excludes;
4368};
4369const setTitle = function (txt) {
4370 title = txt;
4371};
4372const getTitle = function () {
4373 return title;
4374};
4375const addSection = function (txt) {
4376 currentSection = txt;
4377 sections.push(txt);
4378};
4379const getSections = function () {
4380 return sections;
4381};
4382const getTasks = function () {
4383 let allItemsPricessed = compileTasks();
4384 const maxDepth = 10;
4385 let iterationCount = 0;
4386
4387 while (!allItemsPricessed && iterationCount < maxDepth) {
4388 allItemsPricessed = compileTasks();
4389 iterationCount++;
4390 }
4391
4392 tasks = rawTasks;
4393 return tasks;
4394};
4395
4396const isInvalidDate = function (date, dateFormat, excludes) {
4397 if (date.isoWeekday() >= 6 && excludes.indexOf('weekends') >= 0) {
4398 return true;
4399 }
4400
4401 if (excludes.indexOf(date.format('dddd').toLowerCase()) >= 0) {
4402 return true;
4403 }
4404
4405 return excludes.indexOf(date.format(dateFormat.trim())) >= 0;
4406};
4407
4408const checkTaskDates = function (task, dateFormat, excludes) {
4409 if (!excludes.length || task.manualEndTime) return;
4410 let startTime = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(task.startTime, dateFormat, true);
4411 startTime.add(1, 'd');
4412 let endTime = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(task.endTime, dateFormat, true);
4413 let renderEndTime = fixTaskDates(startTime, endTime, dateFormat, excludes);
4414 task.endTime = endTime.toDate();
4415 task.renderEndTime = renderEndTime;
4416};
4417
4418const fixTaskDates = function (startTime, endTime, dateFormat, excludes) {
4419 let invalid = false;
4420 let renderEndTime = null;
4421
4422 while (startTime.date() <= endTime.date()) {
4423 if (!invalid) {
4424 renderEndTime = endTime.toDate();
4425 }
4426
4427 invalid = isInvalidDate(startTime, dateFormat, excludes);
4428
4429 if (invalid) {
4430 endTime.add(1, 'd');
4431 }
4432
4433 startTime.add(1, 'd');
4434 }
4435
4436 return renderEndTime;
4437};
4438
4439const getStartDate = function (prevTime, dateFormat, str) {
4440 str = str.trim(); // Test for after
4441
4442 const re = /^after\s+([\d\w-]+)/;
4443 const afterStatement = re.exec(str.trim());
4444
4445 if (afterStatement !== null) {
4446 const task = findTaskById(afterStatement[1]);
4447
4448 if (typeof task === 'undefined') {
4449 const dt = new Date();
4450 dt.setHours(0, 0, 0, 0);
4451 return dt;
4452 }
4453
4454 return task.endTime;
4455 } // Check for actual date set
4456
4457
4458 let mDate = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(str, dateFormat.trim(), true);
4459
4460 if (mDate.isValid()) {
4461 return mDate.toDate();
4462 } else {
4463 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('Invalid date:' + str);
4464 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('With date format:' + dateFormat.trim());
4465 } // Default date - now
4466
4467
4468 return new Date();
4469};
4470
4471const durationToDate = function (durationStatement, relativeTime) {
4472 if (durationStatement !== null) {
4473 switch (durationStatement[2]) {
4474 case 's':
4475 relativeTime.add(durationStatement[1], 'seconds');
4476 break;
4477
4478 case 'm':
4479 relativeTime.add(durationStatement[1], 'minutes');
4480 break;
4481
4482 case 'h':
4483 relativeTime.add(durationStatement[1], 'hours');
4484 break;
4485
4486 case 'd':
4487 relativeTime.add(durationStatement[1], 'days');
4488 break;
4489
4490 case 'w':
4491 relativeTime.add(durationStatement[1], 'weeks');
4492 break;
4493 }
4494 } // Default date - now
4495
4496
4497 return relativeTime.toDate();
4498};
4499
4500const getEndDate = function (prevTime, dateFormat, str, inclusive) {
4501 inclusive = inclusive || false;
4502 str = str.trim(); // Check for actual date
4503
4504 let mDate = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(str, dateFormat.trim(), true);
4505
4506 if (mDate.isValid()) {
4507 if (inclusive) {
4508 mDate.add(1, 'd');
4509 }
4510
4511 return mDate.toDate();
4512 }
4513
4514 return durationToDate(/^([\d]+)([wdhms])/.exec(str.trim()), moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(prevTime));
4515};
4516
4517let taskCnt = 0;
4518
4519const parseId = function (idStr) {
4520 if (typeof idStr === 'undefined') {
4521 taskCnt = taskCnt + 1;
4522 return 'task' + taskCnt;
4523 }
4524
4525 return idStr;
4526}; // id, startDate, endDate
4527// id, startDate, length
4528// id, after x, endDate
4529// id, after x, length
4530// startDate, endDate
4531// startDate, length
4532// after x, endDate
4533// after x, length
4534// endDate
4535// length
4536
4537
4538const compileData = function (prevTask, dataStr) {
4539 let ds;
4540
4541 if (dataStr.substr(0, 1) === ':') {
4542 ds = dataStr.substr(1, dataStr.length);
4543 } else {
4544 ds = dataStr;
4545 }
4546
4547 const data = ds.split(',');
4548 const task = {}; // Get tags like active, done, crit and milestone
4549
4550 getTaskTags(data, task, tags);
4551
4552 for (let i = 0; i < data.length; i++) {
4553 data[i] = data[i].trim();
4554 }
4555
4556 let endTimeData = '';
4557
4558 switch (data.length) {
4559 case 1:
4560 task.id = parseId();
4561 task.startTime = prevTask.endTime;
4562 endTimeData = data[0];
4563 break;
4564
4565 case 2:
4566 task.id = parseId();
4567 task.startTime = getStartDate(undefined, dateFormat, data[0]);
4568 endTimeData = data[1];
4569 break;
4570
4571 case 3:
4572 task.id = parseId(data[0]);
4573 task.startTime = getStartDate(undefined, dateFormat, data[1]);
4574 endTimeData = data[2];
4575 break;
4576
4577 default:
4578 }
4579
4580 if (endTimeData) {
4581 task.endTime = getEndDate(task.startTime, dateFormat, endTimeData, inclusiveEndDates);
4582 task.manualEndTime = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(endTimeData, 'YYYY-MM-DD', true).isValid();
4583 checkTaskDates(task, dateFormat, excludes);
4584 }
4585
4586 return task;
4587};
4588
4589const parseData = function (prevTaskId, dataStr) {
4590 let ds;
4591
4592 if (dataStr.substr(0, 1) === ':') {
4593 ds = dataStr.substr(1, dataStr.length);
4594 } else {
4595 ds = dataStr;
4596 }
4597
4598 const data = ds.split(',');
4599 const task = {}; // Get tags like active, done, crit and milestone
4600
4601 getTaskTags(data, task, tags);
4602
4603 for (let i = 0; i < data.length; i++) {
4604 data[i] = data[i].trim();
4605 }
4606
4607 switch (data.length) {
4608 case 1:
4609 task.id = parseId();
4610 task.startTime = {
4611 type: 'prevTaskEnd',
4612 id: prevTaskId
4613 };
4614 task.endTime = {
4615 data: data[0]
4616 };
4617 break;
4618
4619 case 2:
4620 task.id = parseId();
4621 task.startTime = {
4622 type: 'getStartDate',
4623 startData: data[0]
4624 };
4625 task.endTime = {
4626 data: data[1]
4627 };
4628 break;
4629
4630 case 3:
4631 task.id = parseId(data[0]);
4632 task.startTime = {
4633 type: 'getStartDate',
4634 startData: data[1]
4635 };
4636 task.endTime = {
4637 data: data[2]
4638 };
4639 break;
4640
4641 default:
4642 }
4643
4644 return task;
4645};
4646
4647let lastTask;
4648let lastTaskID;
4649let rawTasks = [];
4650const taskDb = {};
4651const addTask = function (descr, data) {
4652 const rawTask = {
4653 section: currentSection,
4654 type: currentSection,
4655 processed: false,
4656 manualEndTime: false,
4657 renderEndTime: null,
4658 raw: {
4659 data: data
4660 },
4661 task: descr,
4662 classes: []
4663 };
4664 const taskInfo = parseData(lastTaskID, data);
4665 rawTask.raw.startTime = taskInfo.startTime;
4666 rawTask.raw.endTime = taskInfo.endTime;
4667 rawTask.id = taskInfo.id;
4668 rawTask.prevTaskId = lastTaskID;
4669 rawTask.active = taskInfo.active;
4670 rawTask.done = taskInfo.done;
4671 rawTask.crit = taskInfo.crit;
4672 rawTask.milestone = taskInfo.milestone;
4673 const pos = rawTasks.push(rawTask);
4674 lastTaskID = rawTask.id; // Store cross ref
4675
4676 taskDb[rawTask.id] = pos - 1;
4677};
4678const findTaskById = function (id) {
4679 const pos = taskDb[id];
4680 return rawTasks[pos];
4681};
4682const addTaskOrg = function (descr, data) {
4683 const newTask = {
4684 section: currentSection,
4685 type: currentSection,
4686 description: descr,
4687 task: descr,
4688 classes: []
4689 };
4690 const taskInfo = compileData(lastTask, data);
4691 newTask.startTime = taskInfo.startTime;
4692 newTask.endTime = taskInfo.endTime;
4693 newTask.id = taskInfo.id;
4694 newTask.active = taskInfo.active;
4695 newTask.done = taskInfo.done;
4696 newTask.crit = taskInfo.crit;
4697 newTask.milestone = taskInfo.milestone;
4698 lastTask = newTask;
4699 tasks.push(newTask);
4700};
4701
4702const compileTasks = function () {
4703 const compileTask = function (pos) {
4704 const task = rawTasks[pos];
4705 let startTime = '';
4706
4707 switch (rawTasks[pos].raw.startTime.type) {
4708 case 'prevTaskEnd':
4709 const prevTask = findTaskById(task.prevTaskId);
4710 task.startTime = prevTask.endTime;
4711 break;
4712
4713 case 'getStartDate':
4714 startTime = getStartDate(undefined, dateFormat, rawTasks[pos].raw.startTime.startData);
4715
4716 if (startTime) {
4717 rawTasks[pos].startTime = startTime;
4718 }
4719
4720 break;
4721 }
4722
4723 if (rawTasks[pos].startTime) {
4724 rawTasks[pos].endTime = getEndDate(rawTasks[pos].startTime, dateFormat, rawTasks[pos].raw.endTime.data, inclusiveEndDates);
4725
4726 if (rawTasks[pos].endTime) {
4727 rawTasks[pos].processed = true;
4728 rawTasks[pos].manualEndTime = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()(rawTasks[pos].raw.endTime.data, 'YYYY-MM-DD', true).isValid();
4729 checkTaskDates(rawTasks[pos], dateFormat, excludes);
4730 }
4731 }
4732
4733 return rawTasks[pos].processed;
4734 };
4735
4736 let allProcessed = true;
4737
4738 for (let i = 0; i < rawTasks.length; i++) {
4739 compileTask(i);
4740 allProcessed = allProcessed && rawTasks[i].processed;
4741 }
4742
4743 return allProcessed;
4744};
4745/**
4746 * Called by parser when a link is found. Adds the URL to the vertex data.
4747 * @param ids Comma separated list of ids
4748 * @param linkStr URL to create a link for
4749 */
4750
4751
4752const setLink = function (ids, _linkStr) {
4753 let linkStr = _linkStr;
4754
4755 if (config.securityLevel !== 'loose') {
4756 linkStr = Object(_braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_1__["sanitizeUrl"])(_linkStr);
4757 }
4758
4759 ids.split(',').forEach(function (id) {
4760 let rawTask = findTaskById(id);
4761
4762 if (typeof rawTask !== 'undefined') {
4763 pushFun(id, () => {
4764 window.open(linkStr, '_self');
4765 });
4766 }
4767 });
4768 setClass(ids, 'clickable');
4769};
4770/**
4771 * Called by parser when a special node is found, e.g. a clickable element.
4772 * @param ids Comma separated list of ids
4773 * @param className Class to add
4774 */
4775
4776const setClass = function (ids, className) {
4777 ids.split(',').forEach(function (id) {
4778 let rawTask = findTaskById(id);
4779
4780 if (typeof rawTask !== 'undefined') {
4781 rawTask.classes.push(className);
4782 }
4783 });
4784};
4785
4786const setClickFun = function (id, functionName, functionArgs) {
4787 if (config.securityLevel !== 'loose') {
4788 return;
4789 }
4790
4791 if (typeof functionName === 'undefined') {
4792 return;
4793 }
4794
4795 let argList = [];
4796
4797 if (typeof functionArgs === 'string') {
4798 /* Splits functionArgs by ',', ignoring all ',' in double quoted strings */
4799 argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
4800
4801 for (let i = 0; i < argList.length; i++) {
4802 let item = argList[i].trim();
4803 /* Removes all double quotes at the start and end of an argument */
4804
4805 /* This preserves all starting and ending whitespace inside */
4806
4807 if (item.charAt(0) === '"' && item.charAt(item.length - 1) === '"') {
4808 item = item.substr(1, item.length - 2);
4809 }
4810
4811 argList[i] = item;
4812 }
4813 }
4814
4815 let rawTask = findTaskById(id);
4816
4817 if (typeof rawTask !== 'undefined') {
4818 pushFun(id, () => {
4819 window[functionName](...argList);
4820 });
4821 }
4822};
4823/**
4824 * The callbackFunction is executed in a click event bound to the task with the specified id or the task's assigned text
4825 * @param id The task's id
4826 * @param callbackFunction A function to be executed when clicked on the task or the task's text
4827 */
4828
4829
4830const pushFun = function (id, callbackFunction) {
4831 funs.push(function (element) {
4832 // const elem = d3.select(element).select(`[id="${id}"]`)
4833 const elem = document.querySelector(`[id="${id}"]`);
4834
4835 if (elem !== null) {
4836 elem.addEventListener('click', function () {
4837 callbackFunction();
4838 });
4839 }
4840 });
4841 funs.push(function (element) {
4842 // const elem = d3.select(element).select(`[id="${id}-text"]`)
4843 const elem = document.querySelector(`[id="${id}-text"]`);
4844
4845 if (elem !== null) {
4846 elem.addEventListener('click', function () {
4847 callbackFunction();
4848 });
4849 }
4850 });
4851};
4852/**
4853 * Called by parser when a click definition is found. Registers an event handler.
4854 * @param ids Comma separated list of ids
4855 * @param functionName Function to be called on click
4856 * @param functionArgs Function args the function should be called with
4857 */
4858
4859
4860const setClickEvent = function (ids, functionName, functionArgs) {
4861 ids.split(',').forEach(function (id) {
4862 setClickFun(id, functionName, functionArgs);
4863 });
4864 setClass(ids, 'clickable');
4865};
4866/**
4867 * Binds all functions previously added to fun (specified through click) to the element
4868 * @param element
4869 */
4870
4871const bindFunctions = function (element) {
4872 funs.forEach(function (fun) {
4873 fun(element);
4874 });
4875};
4876/* harmony default export */ __webpack_exports__["default"] = ({
4877 clear,
4878 setDateFormat,
4879 getDateFormat,
4880 enableInclusiveEndDates,
4881 endDatesAreInclusive,
4882 setAxisFormat,
4883 getAxisFormat,
4884 setTitle,
4885 getTitle,
4886 addSection,
4887 getSections,
4888 getTasks,
4889 addTask,
4890 findTaskById,
4891 addTaskOrg,
4892 setExcludes,
4893 getExcludes,
4894 setClickEvent,
4895 setLink,
4896 bindFunctions,
4897 durationToDate
4898});
4899
4900function getTaskTags(data, task, tags) {
4901 let matchFound = true;
4902
4903 while (matchFound) {
4904 matchFound = false;
4905 tags.forEach(function (t) {
4906 const pattern = '^\\s*' + t + '\\s*$';
4907 const regex = new RegExp(pattern);
4908
4909 if (data[0].match(regex)) {
4910 task[t] = true;
4911 data.shift(1);
4912 matchFound = true;
4913 }
4914 });
4915 }
4916}
4917
4918/***/ }),
4919
4920/***/ "./src/diagrams/gantt/ganttRenderer.js":
4921/*!*********************************************!*\
4922 !*** ./src/diagrams/gantt/ganttRenderer.js ***!
4923 \*********************************************/
4924/*! exports provided: setConf, draw, default */
4925/***/ (function(module, __webpack_exports__, __webpack_require__) {
4926
4927"use strict";
4928__webpack_require__.r(__webpack_exports__);
4929/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; });
4930/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; });
4931/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
4932/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
4933/* harmony import */ var _parser_gantt__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parser/gantt */ "./src/diagrams/gantt/parser/gantt.jison");
4934/* harmony import */ var _parser_gantt__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_parser_gantt__WEBPACK_IMPORTED_MODULE_1__);
4935/* harmony import */ var _ganttDb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ganttDb */ "./src/diagrams/gantt/ganttDb.js");
4936
4937
4938
4939_parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].yy = _ganttDb__WEBPACK_IMPORTED_MODULE_2__["default"];
4940const conf = {
4941 titleTopMargin: 25,
4942 barHeight: 20,
4943 barGap: 4,
4944 topPadding: 50,
4945 rightPadding: 75,
4946 leftPadding: 75,
4947 gridLineStartPadding: 35,
4948 fontSize: 11,
4949 fontFamily: '"Open-Sans", "sans-serif"'
4950};
4951const setConf = function (cnf) {
4952 const keys = Object.keys(cnf);
4953 keys.forEach(function (key) {
4954 conf[key] = cnf[key];
4955 });
4956};
4957let w;
4958const draw = function (text, id) {
4959 _parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].yy.clear();
4960 _parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].parse(text);
4961 const elem = document.getElementById(id);
4962 w = elem.parentElement.offsetWidth;
4963
4964 if (typeof w === 'undefined') {
4965 w = 1200;
4966 }
4967
4968 if (typeof conf.useWidth !== 'undefined') {
4969 w = conf.useWidth;
4970 }
4971
4972 const taskArray = _parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].yy.getTasks(); // Set height based on number of tasks
4973
4974 const h = taskArray.length * (conf.barHeight + conf.barGap) + 2 * conf.topPadding;
4975 elem.setAttribute('height', '100%'); // Set viewBox
4976
4977 elem.setAttribute('viewBox', '0 0 ' + w + ' ' + h);
4978 const svg = d3__WEBPACK_IMPORTED_MODULE_0__["select"](`[id="${id}"]`); // Set timescale
4979
4980 const timeScale = d3__WEBPACK_IMPORTED_MODULE_0__["scaleTime"]().domain([d3__WEBPACK_IMPORTED_MODULE_0__["min"](taskArray, function (d) {
4981 return d.startTime;
4982 }), d3__WEBPACK_IMPORTED_MODULE_0__["max"](taskArray, function (d) {
4983 return d.endTime;
4984 })]).rangeRound([0, w - conf.leftPadding - conf.rightPadding]);
4985 let categories = [];
4986
4987 for (let i = 0; i < taskArray.length; i++) {
4988 categories.push(taskArray[i].type);
4989 }
4990
4991 const catsUnfiltered = categories; // for vert labels
4992
4993 categories = checkUnique(categories);
4994 makeGant(taskArray, w, h);
4995
4996 if (typeof conf.useWidth !== 'undefined') {
4997 elem.setAttribute('width', w);
4998 }
4999
5000 svg.append('text').text(_parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].yy.getTitle()).attr('x', w / 2).attr('y', conf.titleTopMargin).attr('class', 'titleText');
5001
5002 function makeGant(tasks, pageWidth, pageHeight) {
5003 const barHeight = conf.barHeight;
5004 const gap = barHeight + conf.barGap;
5005 const topPadding = conf.topPadding;
5006 const leftPadding = conf.leftPadding;
5007 const colorScale = d3__WEBPACK_IMPORTED_MODULE_0__["scaleLinear"]().domain([0, categories.length]).range(['#00B9FA', '#F95002']).interpolate(d3__WEBPACK_IMPORTED_MODULE_0__["interpolateHcl"]);
5008 makeGrid(leftPadding, topPadding, pageWidth, pageHeight);
5009 drawRects(tasks, gap, topPadding, leftPadding, barHeight, colorScale, pageWidth, pageHeight);
5010 vertLabels(gap, topPadding, leftPadding, barHeight, colorScale);
5011 drawToday(leftPadding, topPadding, pageWidth, pageHeight);
5012 }
5013
5014 function drawRects(theArray, theGap, theTopPad, theSidePad, theBarHeight, theColorScale, w, h) {
5015 // Draw background rects covering the entire width of the graph, these form the section rows.
5016 svg.append('g').selectAll('rect').data(theArray).enter().append('rect').attr('x', 0).attr('y', function (d, i) {
5017 return i * theGap + theTopPad - 2;
5018 }).attr('width', function () {
5019 return w - conf.rightPadding / 2;
5020 }).attr('height', theGap).attr('class', function (d) {
5021 for (let i = 0; i < categories.length; i++) {
5022 if (d.type === categories[i]) {
5023 return 'section section' + i % conf.numberSectionStyles;
5024 }
5025 }
5026
5027 return 'section section0';
5028 }); // Draw the rects representing the tasks
5029
5030 const rectangles = svg.append('g').selectAll('rect').data(theArray).enter();
5031 rectangles.append('rect').attr('id', function (d) {
5032 return d.id;
5033 }).attr('rx', 3).attr('ry', 3).attr('x', function (d) {
5034 if (d.milestone) {
5035 return timeScale(d.startTime) + theSidePad + 0.5 * (timeScale(d.endTime) - timeScale(d.startTime)) - 0.5 * theBarHeight;
5036 }
5037
5038 return timeScale(d.startTime) + theSidePad;
5039 }).attr('y', function (d, i) {
5040 return i * theGap + theTopPad;
5041 }).attr('width', function (d) {
5042 if (d.milestone) {
5043 return theBarHeight;
5044 }
5045
5046 return timeScale(d.renderEndTime || d.endTime) - timeScale(d.startTime);
5047 }).attr('height', theBarHeight).attr('transform-origin', function (d, i) {
5048 return (timeScale(d.startTime) + theSidePad + 0.5 * (timeScale(d.endTime) - timeScale(d.startTime))).toString() + 'px ' + (i * theGap + theTopPad + 0.5 * theBarHeight).toString() + 'px';
5049 }).attr('class', function (d) {
5050 const res = 'task';
5051 let classStr = '';
5052
5053 if (d.classes.length > 0) {
5054 classStr = d.classes.join(' ');
5055 }
5056
5057 let secNum = 0;
5058
5059 for (let i = 0; i < categories.length; i++) {
5060 if (d.type === categories[i]) {
5061 secNum = i % conf.numberSectionStyles;
5062 }
5063 }
5064
5065 let taskClass = '';
5066
5067 if (d.active) {
5068 if (d.crit) {
5069 taskClass += ' activeCrit';
5070 } else {
5071 taskClass = ' active';
5072 }
5073 } else if (d.done) {
5074 if (d.crit) {
5075 taskClass = ' doneCrit';
5076 } else {
5077 taskClass = ' done';
5078 }
5079 } else {
5080 if (d.crit) {
5081 taskClass += ' crit';
5082 }
5083 }
5084
5085 if (taskClass.length === 0) {
5086 taskClass = ' task';
5087 }
5088
5089 if (d.milestone) {
5090 taskClass = ' milestone ' + taskClass;
5091 }
5092
5093 taskClass += secNum;
5094 taskClass += ' ' + classStr;
5095 return res + taskClass;
5096 }); // Append task labels
5097
5098 rectangles.append('text').attr('id', function (d) {
5099 return d.id + '-text';
5100 }).text(function (d) {
5101 return d.task;
5102 }).attr('font-size', conf.fontSize).attr('x', function (d) {
5103 let startX = timeScale(d.startTime);
5104 let endX = timeScale(d.renderEndTime || d.endTime);
5105
5106 if (d.milestone) {
5107 startX += 0.5 * (timeScale(d.endTime) - timeScale(d.startTime)) - 0.5 * theBarHeight;
5108 }
5109
5110 if (d.milestone) {
5111 endX = startX + theBarHeight;
5112 }
5113
5114 const textWidth = this.getBBox().width; // Check id text width > width of rectangle
5115
5116 if (textWidth > endX - startX) {
5117 if (endX + textWidth + 1.5 * conf.leftPadding > w) {
5118 return startX + theSidePad - 5;
5119 } else {
5120 return endX + theSidePad + 5;
5121 }
5122 } else {
5123 return (endX - startX) / 2 + startX + theSidePad;
5124 }
5125 }).attr('y', function (d, i) {
5126 return i * theGap + conf.barHeight / 2 + (conf.fontSize / 2 - 2) + theTopPad;
5127 }).attr('text-height', theBarHeight).attr('class', function (d) {
5128 const startX = timeScale(d.startTime);
5129 let endX = timeScale(d.endTime);
5130
5131 if (d.milestone) {
5132 endX = startX + theBarHeight;
5133 }
5134
5135 const textWidth = this.getBBox().width;
5136 let classStr = '';
5137
5138 if (d.classes.length > 0) {
5139 classStr = d.classes.join(' ');
5140 }
5141
5142 let secNum = 0;
5143
5144 for (let i = 0; i < categories.length; i++) {
5145 if (d.type === categories[i]) {
5146 secNum = i % conf.numberSectionStyles;
5147 }
5148 }
5149
5150 let taskType = '';
5151
5152 if (d.active) {
5153 if (d.crit) {
5154 taskType = 'activeCritText' + secNum;
5155 } else {
5156 taskType = 'activeText' + secNum;
5157 }
5158 }
5159
5160 if (d.done) {
5161 if (d.crit) {
5162 taskType = taskType + ' doneCritText' + secNum;
5163 } else {
5164 taskType = taskType + ' doneText' + secNum;
5165 }
5166 } else {
5167 if (d.crit) {
5168 taskType = taskType + ' critText' + secNum;
5169 }
5170 }
5171
5172 if (d.milestone) {
5173 taskType += ' milestoneText';
5174 } // Check id text width > width of rectangle
5175
5176
5177 if (textWidth > endX - startX) {
5178 if (endX + textWidth + 1.5 * conf.leftPadding > w) {
5179 return classStr + ' taskTextOutsideLeft taskTextOutside' + secNum + ' ' + taskType;
5180 } else {
5181 return classStr + ' taskTextOutsideRight taskTextOutside' + secNum + ' ' + taskType;
5182 }
5183 } else {
5184 return classStr + ' taskText taskText' + secNum + ' ' + taskType;
5185 }
5186 });
5187 }
5188
5189 function makeGrid(theSidePad, theTopPad, w, h) {
5190 let 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'));
5191 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');
5192 }
5193
5194 function vertLabels(theGap, theTopPad) {
5195 const numOccurances = [];
5196 let prevGap = 0;
5197
5198 for (let i = 0; i < categories.length; i++) {
5199 numOccurances[i] = [categories[i], getCount(categories[i], catsUnfiltered)];
5200 }
5201
5202 svg.append('g') // without doing this, impossible to put grid lines behind text
5203 .selectAll('text').data(numOccurances).enter().append('text').text(function (d) {
5204 return d[0];
5205 }).attr('x', 10).attr('y', function (d, i) {
5206 if (i > 0) {
5207 for (let j = 0; j < i; j++) {
5208 prevGap += numOccurances[i - 1][1];
5209 return d[1] * theGap / 2 + prevGap * theGap + theTopPad;
5210 }
5211 } else {
5212 return d[1] * theGap / 2 + theTopPad;
5213 }
5214 }).attr('class', function (d) {
5215 for (let i = 0; i < categories.length; i++) {
5216 if (d[0] === categories[i]) {
5217 return 'sectionTitle sectionTitle' + i % conf.numberSectionStyles;
5218 }
5219 }
5220
5221 return 'sectionTitle';
5222 });
5223 }
5224
5225 function drawToday(theSidePad, theTopPad, w, h) {
5226 const todayG = svg.append('g').attr('class', 'today');
5227 const today = new Date();
5228 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');
5229 } // from this stackexchange question: http://stackoverflow.com/questions/1890203/unique-for-arrays-in-javascript
5230
5231
5232 function checkUnique(arr) {
5233 const hash = {};
5234 const result = [];
5235
5236 for (let i = 0, l = arr.length; i < l; ++i) {
5237 if (!hash.hasOwnProperty(arr[i])) {
5238 // it works with objects! in FF, at least
5239 hash[arr[i]] = true;
5240 result.push(arr[i]);
5241 }
5242 }
5243
5244 return result;
5245 } // from this stackexchange question: http://stackoverflow.com/questions/14227981/count-how-many-strings-in-an-array-have-duplicates-in-the-same-array
5246
5247
5248 function getCounts(arr) {
5249 let i = arr.length; // const to loop over
5250
5251 const obj = {}; // obj to store results
5252
5253 while (i) {
5254 obj[arr[--i]] = (obj[arr[i]] || 0) + 1; // count occurrences
5255 }
5256
5257 return obj;
5258 } // get specific from everything
5259
5260
5261 function getCount(word, arr) {
5262 return getCounts(arr)[word] || 0;
5263 }
5264};
5265/* harmony default export */ __webpack_exports__["default"] = ({
5266 setConf,
5267 draw
5268});
5269
5270/***/ }),
5271
5272/***/ "./src/diagrams/gantt/parser/gantt.jison":
5273/*!***********************************************!*\
5274 !*** ./src/diagrams/gantt/parser/gantt.jison ***!
5275 \***********************************************/
5276/*! no static exports found */
5277/***/ (function(module, exports, __webpack_require__) {
5278
5279/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */
5280/*
5281 Returns a Parser object of the following structure:
5282
5283 Parser: {
5284 yy: {}
5285 }
5286
5287 Parser.prototype: {
5288 yy: {},
5289 trace: function(),
5290 symbols_: {associative list: name ==> number},
5291 terminals_: {associative list: number ==> name},
5292 productions_: [...],
5293 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
5294 table: [...],
5295 defaultActions: {...},
5296 parseError: function(str, hash),
5297 parse: function(input),
5298
5299 lexer: {
5300 EOF: 1,
5301 parseError: function(str, hash),
5302 setInput: function(input),
5303 input: function(),
5304 unput: function(str),
5305 more: function(),
5306 less: function(n),
5307 pastInput: function(),
5308 upcomingInput: function(),
5309 showPosition: function(),
5310 test_match: function(regex_match_array, rule_index),
5311 next: function(),
5312 lex: function(),
5313 begin: function(condition),
5314 popState: function(),
5315 _currentRules: function(),
5316 topState: function(),
5317 pushState: function(condition),
5318
5319 options: {
5320 ranges: boolean (optional: true ==> token location info will include a .range[] member)
5321 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
5322 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)
5323 },
5324
5325 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
5326 rules: [...],
5327 conditions: {associative list: name ==> set},
5328 }
5329 }
5330
5331
5332 token location info (@$, _$, etc.): {
5333 first_line: n,
5334 last_line: n,
5335 first_column: n,
5336 last_column: n,
5337 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
5338 }
5339
5340
5341 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
5342 text: (matched text)
5343 token: (the produced terminal token, if any)
5344 line: (yylineno)
5345 }
5346 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
5347 loc: (yylloc)
5348 expected: (string describing the set of expected tokens)
5349 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
5350 }
5351*/
5352var parser = (function(){
5353var 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];
5354var parser = {trace: function trace () { },
5355yy: {},
5356symbols_: {"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},
5357terminals_: {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"},
5358productions_: [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]],
5359performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
5360/* this == yyval */
5361
5362var $0 = $$.length - 1;
5363switch (yystate) {
5364case 1:
5365 return $$[$0-1];
5366break;
5367case 2:
5368 this.$ = []
5369break;
5370case 3:
5371$$[$0-1].push($$[$0]);this.$ = $$[$0-1]
5372break;
5373case 4: case 5:
5374 this.$ = $$[$0]
5375break;
5376case 6: case 7:
5377 this.$=[];
5378break;
5379case 8:
5380yy.setDateFormat($$[$0].substr(11));this.$=$$[$0].substr(11);
5381break;
5382case 9:
5383yy.enableInclusiveEndDates();this.$=$$[$0].substr(18);
5384break;
5385case 10:
5386yy.setAxisFormat($$[$0].substr(11));this.$=$$[$0].substr(11);
5387break;
5388case 11:
5389yy.setExcludes($$[$0].substr(9));this.$=$$[$0].substr(9);
5390break;
5391case 12:
5392yy.setTitle($$[$0].substr(6));this.$=$$[$0].substr(6);
5393break;
5394case 13:
5395yy.addSection($$[$0].substr(8));this.$=$$[$0].substr(8);
5396break;
5397case 15:
5398yy.addTask($$[$0-1],$$[$0]);this.$='task';
5399break;
5400case 16:
5401this.$ = $$[$0-1];yy.setClickEvent($$[$0-1], $$[$0], null);
5402break;
5403case 17:
5404this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], $$[$0]);
5405break;
5406case 18:
5407this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], null);yy.setLink($$[$0-2],$$[$0]);
5408break;
5409case 19:
5410this.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-2], $$[$0-1]);yy.setLink($$[$0-3],$$[$0]);
5411break;
5412case 20:
5413this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0], null);yy.setLink($$[$0-2],$$[$0-1]);
5414break;
5415case 21:
5416this.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-1], $$[$0]);yy.setLink($$[$0-3],$$[$0-2]);
5417break;
5418case 22:
5419this.$ = $$[$0-1];yy.setLink($$[$0-1], $$[$0]);
5420break;
5421case 23: case 29:
5422this.$=$$[$0-1] + ' ' + $$[$0];
5423break;
5424case 24: case 25: case 27:
5425this.$=$$[$0-2] + ' ' + $$[$0-1] + ' ' + $$[$0];
5426break;
5427case 26: case 28:
5428this.$=$$[$0-3] + ' ' + $$[$0-2] + ' ' + $$[$0-1] + ' ' + $$[$0];
5429break;
5430}
5431},
5432table: [{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])],
5433defaultActions: {},
5434parseError: function parseError (str, hash) {
5435 if (hash.recoverable) {
5436 this.trace(str);
5437 } else {
5438 var error = new Error(str);
5439 error.hash = hash;
5440 throw error;
5441 }
5442},
5443parse: function parse(input) {
5444 var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
5445 var args = lstack.slice.call(arguments, 1);
5446 var lexer = Object.create(this.lexer);
5447 var sharedState = { yy: {} };
5448 for (var k in this.yy) {
5449 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
5450 sharedState.yy[k] = this.yy[k];
5451 }
5452 }
5453 lexer.setInput(input, sharedState.yy);
5454 sharedState.yy.lexer = lexer;
5455 sharedState.yy.parser = this;
5456 if (typeof lexer.yylloc == 'undefined') {
5457 lexer.yylloc = {};
5458 }
5459 var yyloc = lexer.yylloc;
5460 lstack.push(yyloc);
5461 var ranges = lexer.options && lexer.options.ranges;
5462 if (typeof sharedState.yy.parseError === 'function') {
5463 this.parseError = sharedState.yy.parseError;
5464 } else {
5465 this.parseError = Object.getPrototypeOf(this).parseError;
5466 }
5467 function popStack(n) {
5468 stack.length = stack.length - 2 * n;
5469 vstack.length = vstack.length - n;
5470 lstack.length = lstack.length - n;
5471 }
5472 function lex() {
5473 var token;
5474 token = tstack.pop() || lexer.lex() || EOF;
5475 if (typeof token !== 'number') {
5476 if (token instanceof Array) {
5477 tstack = token;
5478 token = tstack.pop();
5479 }
5480 token = self.symbols_[token] || token;
5481 }
5482 return token;
5483 }
5484 var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
5485 while (true) {
5486 state = stack[stack.length - 1];
5487 if (this.defaultActions[state]) {
5488 action = this.defaultActions[state];
5489 } else {
5490 if (symbol === null || typeof symbol == 'undefined') {
5491 symbol = lex();
5492 }
5493 action = table[state] && table[state][symbol];
5494 }
5495 if (typeof action === 'undefined' || !action.length || !action[0]) {
5496 var errStr = '';
5497 expected = [];
5498 for (p in table[state]) {
5499 if (this.terminals_[p] && p > TERROR) {
5500 expected.push('\'' + this.terminals_[p] + '\'');
5501 }
5502 }
5503 if (lexer.showPosition) {
5504 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
5505 } else {
5506 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
5507 }
5508 this.parseError(errStr, {
5509 text: lexer.match,
5510 token: this.terminals_[symbol] || symbol,
5511 line: lexer.yylineno,
5512 loc: yyloc,
5513 expected: expected
5514 });
5515 }
5516 if (action[0] instanceof Array && action.length > 1) {
5517 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
5518 }
5519 switch (action[0]) {
5520 case 1:
5521 stack.push(symbol);
5522 vstack.push(lexer.yytext);
5523 lstack.push(lexer.yylloc);
5524 stack.push(action[1]);
5525 symbol = null;
5526 if (!preErrorSymbol) {
5527 yyleng = lexer.yyleng;
5528 yytext = lexer.yytext;
5529 yylineno = lexer.yylineno;
5530 yyloc = lexer.yylloc;
5531 if (recovering > 0) {
5532 recovering--;
5533 }
5534 } else {
5535 symbol = preErrorSymbol;
5536 preErrorSymbol = null;
5537 }
5538 break;
5539 case 2:
5540 len = this.productions_[action[1]][1];
5541 yyval.$ = vstack[vstack.length - len];
5542 yyval._$ = {
5543 first_line: lstack[lstack.length - (len || 1)].first_line,
5544 last_line: lstack[lstack.length - 1].last_line,
5545 first_column: lstack[lstack.length - (len || 1)].first_column,
5546 last_column: lstack[lstack.length - 1].last_column
5547 };
5548 if (ranges) {
5549 yyval._$.range = [
5550 lstack[lstack.length - (len || 1)].range[0],
5551 lstack[lstack.length - 1].range[1]
5552 ];
5553 }
5554 r = this.performAction.apply(yyval, [
5555 yytext,
5556 yyleng,
5557 yylineno,
5558 sharedState.yy,
5559 action[1],
5560 vstack,
5561 lstack
5562 ].concat(args));
5563 if (typeof r !== 'undefined') {
5564 return r;
5565 }
5566 if (len) {
5567 stack = stack.slice(0, -1 * len * 2);
5568 vstack = vstack.slice(0, -1 * len);
5569 lstack = lstack.slice(0, -1 * len);
5570 }
5571 stack.push(this.productions_[action[1]][0]);
5572 vstack.push(yyval.$);
5573 lstack.push(yyval._$);
5574 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
5575 stack.push(newState);
5576 break;
5577 case 3:
5578 return true;
5579 }
5580 }
5581 return true;
5582}};
5583
5584/* generated by jison-lex 0.3.4 */
5585var lexer = (function(){
5586var lexer = ({
5587
5588EOF:1,
5589
5590parseError:function parseError(str, hash) {
5591 if (this.yy.parser) {
5592 this.yy.parser.parseError(str, hash);
5593 } else {
5594 throw new Error(str);
5595 }
5596 },
5597
5598// resets the lexer, sets new input
5599setInput:function (input, yy) {
5600 this.yy = yy || this.yy || {};
5601 this._input = input;
5602 this._more = this._backtrack = this.done = false;
5603 this.yylineno = this.yyleng = 0;
5604 this.yytext = this.matched = this.match = '';
5605 this.conditionStack = ['INITIAL'];
5606 this.yylloc = {
5607 first_line: 1,
5608 first_column: 0,
5609 last_line: 1,
5610 last_column: 0
5611 };
5612 if (this.options.ranges) {
5613 this.yylloc.range = [0,0];
5614 }
5615 this.offset = 0;
5616 return this;
5617 },
5618
5619// consumes and returns one char from the input
5620input:function () {
5621 var ch = this._input[0];
5622 this.yytext += ch;
5623 this.yyleng++;
5624 this.offset++;
5625 this.match += ch;
5626 this.matched += ch;
5627 var lines = ch.match(/(?:\r\n?|\n).*/g);
5628 if (lines) {
5629 this.yylineno++;
5630 this.yylloc.last_line++;
5631 } else {
5632 this.yylloc.last_column++;
5633 }
5634 if (this.options.ranges) {
5635 this.yylloc.range[1]++;
5636 }
5637
5638 this._input = this._input.slice(1);
5639 return ch;
5640 },
5641
5642// unshifts one char (or a string) into the input
5643unput:function (ch) {
5644 var len = ch.length;
5645 var lines = ch.split(/(?:\r\n?|\n)/g);
5646
5647 this._input = ch + this._input;
5648 this.yytext = this.yytext.substr(0, this.yytext.length - len);
5649 //this.yyleng -= len;
5650 this.offset -= len;
5651 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
5652 this.match = this.match.substr(0, this.match.length - 1);
5653 this.matched = this.matched.substr(0, this.matched.length - 1);
5654
5655 if (lines.length - 1) {
5656 this.yylineno -= lines.length - 1;
5657 }
5658 var r = this.yylloc.range;
5659
5660 this.yylloc = {
5661 first_line: this.yylloc.first_line,
5662 last_line: this.yylineno + 1,
5663 first_column: this.yylloc.first_column,
5664 last_column: lines ?
5665 (lines.length === oldLines.length ? this.yylloc.first_column : 0)
5666 + oldLines[oldLines.length - lines.length].length - lines[0].length :
5667 this.yylloc.first_column - len
5668 };
5669
5670 if (this.options.ranges) {
5671 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
5672 }
5673 this.yyleng = this.yytext.length;
5674 return this;
5675 },
5676
5677// When called from action, caches matched text and appends it on next action
5678more:function () {
5679 this._more = true;
5680 return this;
5681 },
5682
5683// 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.
5684reject:function () {
5685 if (this.options.backtrack_lexer) {
5686 this._backtrack = true;
5687 } else {
5688 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(), {
5689 text: "",
5690 token: null,
5691 line: this.yylineno
5692 });
5693
5694 }
5695 return this;
5696 },
5697
5698// retain first n characters of the match
5699less:function (n) {
5700 this.unput(this.match.slice(n));
5701 },
5702
5703// displays already matched input, i.e. for error messages
5704pastInput:function () {
5705 var past = this.matched.substr(0, this.matched.length - this.match.length);
5706 return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
5707 },
5708
5709// displays upcoming input, i.e. for error messages
5710upcomingInput:function () {
5711 var next = this.match;
5712 if (next.length < 20) {
5713 next += this._input.substr(0, 20-next.length);
5714 }
5715 return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
5716 },
5717
5718// displays the character position where the lexing error occurred, i.e. for error messages
5719showPosition:function () {
5720 var pre = this.pastInput();
5721 var c = new Array(pre.length + 1).join("-");
5722 return pre + this.upcomingInput() + "\n" + c + "^";
5723 },
5724
5725// test the lexed token: return FALSE when not a match, otherwise return token
5726test_match:function(match, indexed_rule) {
5727 var token,
5728 lines,
5729 backup;
5730
5731 if (this.options.backtrack_lexer) {
5732 // save context
5733 backup = {
5734 yylineno: this.yylineno,
5735 yylloc: {
5736 first_line: this.yylloc.first_line,
5737 last_line: this.last_line,
5738 first_column: this.yylloc.first_column,
5739 last_column: this.yylloc.last_column
5740 },
5741 yytext: this.yytext,
5742 match: this.match,
5743 matches: this.matches,
5744 matched: this.matched,
5745 yyleng: this.yyleng,
5746 offset: this.offset,
5747 _more: this._more,
5748 _input: this._input,
5749 yy: this.yy,
5750 conditionStack: this.conditionStack.slice(0),
5751 done: this.done
5752 };
5753 if (this.options.ranges) {
5754 backup.yylloc.range = this.yylloc.range.slice(0);
5755 }
5756 }
5757
5758 lines = match[0].match(/(?:\r\n?|\n).*/g);
5759 if (lines) {
5760 this.yylineno += lines.length;
5761 }
5762 this.yylloc = {
5763 first_line: this.yylloc.last_line,
5764 last_line: this.yylineno + 1,
5765 first_column: this.yylloc.last_column,
5766 last_column: lines ?
5767 lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
5768 this.yylloc.last_column + match[0].length
5769 };
5770 this.yytext += match[0];
5771 this.match += match[0];
5772 this.matches = match;
5773 this.yyleng = this.yytext.length;
5774 if (this.options.ranges) {
5775 this.yylloc.range = [this.offset, this.offset += this.yyleng];
5776 }
5777 this._more = false;
5778 this._backtrack = false;
5779 this._input = this._input.slice(match[0].length);
5780 this.matched += match[0];
5781 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
5782 if (this.done && this._input) {
5783 this.done = false;
5784 }
5785 if (token) {
5786 return token;
5787 } else if (this._backtrack) {
5788 // recover context
5789 for (var k in backup) {
5790 this[k] = backup[k];
5791 }
5792 return false; // rule action called reject() implying the next rule should be tested instead.
5793 }
5794 return false;
5795 },
5796
5797// return next match in input
5798next:function () {
5799 if (this.done) {
5800 return this.EOF;
5801 }
5802 if (!this._input) {
5803 this.done = true;
5804 }
5805
5806 var token,
5807 match,
5808 tempMatch,
5809 index;
5810 if (!this._more) {
5811 this.yytext = '';
5812 this.match = '';
5813 }
5814 var rules = this._currentRules();
5815 for (var i = 0; i < rules.length; i++) {
5816 tempMatch = this._input.match(this.rules[rules[i]]);
5817 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
5818 match = tempMatch;
5819 index = i;
5820 if (this.options.backtrack_lexer) {
5821 token = this.test_match(tempMatch, rules[i]);
5822 if (token !== false) {
5823 return token;
5824 } else if (this._backtrack) {
5825 match = false;
5826 continue; // rule action called reject() implying a rule MISmatch.
5827 } else {
5828 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
5829 return false;
5830 }
5831 } else if (!this.options.flex) {
5832 break;
5833 }
5834 }
5835 }
5836 if (match) {
5837 token = this.test_match(match, rules[index]);
5838 if (token !== false) {
5839 return token;
5840 }
5841 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
5842 return false;
5843 }
5844 if (this._input === "") {
5845 return this.EOF;
5846 } else {
5847 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
5848 text: "",
5849 token: null,
5850 line: this.yylineno
5851 });
5852 }
5853 },
5854
5855// return next match that has a token
5856lex:function lex () {
5857 var r = this.next();
5858 if (r) {
5859 return r;
5860 } else {
5861 return this.lex();
5862 }
5863 },
5864
5865// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
5866begin:function begin (condition) {
5867 this.conditionStack.push(condition);
5868 },
5869
5870// pop the previously active lexer condition state off the condition stack
5871popState:function popState () {
5872 var n = this.conditionStack.length - 1;
5873 if (n > 0) {
5874 return this.conditionStack.pop();
5875 } else {
5876 return this.conditionStack[0];
5877 }
5878 },
5879
5880// produce the lexer rule set which is active for the currently active lexer condition state
5881_currentRules:function _currentRules () {
5882 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
5883 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
5884 } else {
5885 return this.conditions["INITIAL"].rules;
5886 }
5887 },
5888
5889// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
5890topState:function topState (n) {
5891 n = this.conditionStack.length - 1 - Math.abs(n || 0);
5892 if (n >= 0) {
5893 return this.conditionStack[n];
5894 } else {
5895 return "INITIAL";
5896 }
5897 },
5898
5899// alias for begin(condition)
5900pushState:function pushState (condition) {
5901 this.begin(condition);
5902 },
5903
5904// return the number of states currently on the stack
5905stateStackSize:function stateStackSize() {
5906 return this.conditionStack.length;
5907 },
5908options: {"case-insensitive":true},
5909performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
5910var YYSTATE=YY_START;
5911switch($avoiding_name_collisions) {
5912case 0:return 10;
5913break;
5914case 1:/* skip whitespace */
5915break;
5916case 2:/* skip comments */
5917break;
5918case 3:/* skip comments */
5919break;
5920case 4:this.begin("href");
5921break;
5922case 5:this.popState();
5923break;
5924case 6:return 23;
5925break;
5926case 7:this.begin("callbackname");
5927break;
5928case 8:this.popState();
5929break;
5930case 9:this.popState(); this.begin("callbackargs");
5931break;
5932case 10:return 21;
5933break;
5934case 11:this.popState();
5935break;
5936case 12:return 22;
5937break;
5938case 13:this.begin("click");
5939break;
5940case 14:this.popState();
5941break;
5942case 15:return 20;
5943break;
5944case 16:return 4;
5945break;
5946case 17:return 11;
5947break;
5948case 18:return 12;
5949break;
5950case 19:return 13;
5951break;
5952case 20:return 14;
5953break;
5954case 21:return 'date';
5955break;
5956case 22:return 15;
5957break;
5958case 23:return 16;
5959break;
5960case 24:return 18;
5961break;
5962case 25:return 19;
5963break;
5964case 26:return ':';
5965break;
5966case 27:return 6;
5967break;
5968case 28:return 'INVALID';
5969break;
5970}
5971},
5972rules: [/^(?:[\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],
5973conditions: {"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}}
5974});
5975return lexer;
5976})();
5977parser.lexer = lexer;
5978function Parser () {
5979 this.yy = {};
5980}
5981Parser.prototype = parser;parser.Parser = Parser;
5982return new Parser;
5983})();
5984
5985
5986if (true) {
5987exports.parser = parser;
5988exports.Parser = parser.Parser;
5989exports.parse = function () { return parser.parse.apply(parser, arguments); };
5990exports.main = function commonjsMain (args) {
5991 if (!args[1]) {
5992 console.log('Usage: '+args[0]+' FILE');
5993 process.exit(1);
5994 }
5995 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");
5996 return exports.parser.parse(source);
5997};
5998if ( true && __webpack_require__.c[__webpack_require__.s] === module) {
5999 exports.main(process.argv.slice(1));
6000}
6001}
6002/* 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)))
6003
6004/***/ }),
6005
6006/***/ "./src/diagrams/git/gitGraphAst.js":
6007/*!*****************************************!*\
6008 !*** ./src/diagrams/git/gitGraphAst.js ***!
6009 \*****************************************/
6010/*! exports provided: setDirection, setOptions, getOptions, commit, branch, merge, checkout, reset, prettyPrint, clear, getBranchesAsObjArray, getBranches, getCommits, getCommitsArray, getCurrentBranch, getDirection, getHead, default */
6011/***/ (function(module, __webpack_exports__, __webpack_require__) {
6012
6013"use strict";
6014__webpack_require__.r(__webpack_exports__);
6015/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setDirection", function() { return setDirection; });
6016/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setOptions", function() { return setOptions; });
6017/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getOptions", function() { return getOptions; });
6018/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commit", function() { return commit; });
6019/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "branch", function() { return branch; });
6020/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return merge; });
6021/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "checkout", function() { return checkout; });
6022/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reset", function() { return reset; });
6023/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prettyPrint", function() { return prettyPrint; });
6024/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clear", function() { return clear; });
6025/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBranchesAsObjArray", function() { return getBranchesAsObjArray; });
6026/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBranches", function() { return getBranches; });
6027/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCommits", function() { return getCommits; });
6028/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCommitsArray", function() { return getCommitsArray; });
6029/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCurrentBranch", function() { return getCurrentBranch; });
6030/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDirection", function() { return getDirection; });
6031/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getHead", function() { return getHead; });
6032/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "lodash");
6033/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
6034/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
6035
6036
6037let commits = {};
6038let head = null;
6039let branches = {
6040 master: head
6041};
6042let curBranch = 'master';
6043let direction = 'LR';
6044let seq = 0;
6045
6046function getRandomInt(min, max) {
6047 return Math.floor(Math.random() * (max - min)) + min;
6048}
6049
6050function getId() {
6051 const pool = '0123456789abcdef';
6052 let id = '';
6053
6054 for (let i = 0; i < 7; i++) {
6055 id += pool[getRandomInt(0, 16)];
6056 }
6057
6058 return id;
6059}
6060
6061function isfastforwardable(currentCommit, otherCommit) {
6062 _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug('Entering isfastforwardable:', currentCommit.id, otherCommit.id);
6063
6064 while (currentCommit.seq <= otherCommit.seq && currentCommit !== otherCommit) {
6065 // only if other branch has more commits
6066 if (otherCommit.parent == null) break;
6067
6068 if (Array.isArray(otherCommit.parent)) {
6069 _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug('In merge commit:', otherCommit.parent);
6070 return isfastforwardable(currentCommit, commits[otherCommit.parent[0]]) || isfastforwardable(currentCommit, commits[otherCommit.parent[1]]);
6071 } else {
6072 otherCommit = commits[otherCommit.parent];
6073 }
6074 }
6075
6076 _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug(currentCommit.id, otherCommit.id);
6077 return currentCommit.id === otherCommit.id;
6078}
6079
6080function isReachableFrom(currentCommit, otherCommit) {
6081 const currentSeq = currentCommit.seq;
6082 const otherSeq = otherCommit.seq;
6083 if (currentSeq > otherSeq) return isfastforwardable(otherCommit, currentCommit);
6084 return false;
6085}
6086
6087const setDirection = function (dir) {
6088 direction = dir;
6089};
6090let options = {};
6091const setOptions = function (rawOptString) {
6092 _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug('options str', rawOptString);
6093 rawOptString = rawOptString && rawOptString.trim();
6094 rawOptString = rawOptString || '{}';
6095
6096 try {
6097 options = JSON.parse(rawOptString);
6098 } catch (e) {
6099 _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].error('error while parsing gitGraph options', e.message);
6100 }
6101};
6102const getOptions = function () {
6103 return options;
6104};
6105const commit = function (msg) {
6106 const commit = {
6107 id: getId(),
6108 message: msg,
6109 seq: seq++,
6110 parent: head == null ? null : head.id
6111 };
6112 head = commit;
6113 commits[commit.id] = commit;
6114 branches[curBranch] = commit.id;
6115 _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug('in pushCommit ' + commit.id);
6116};
6117const branch = function (name) {
6118 branches[name] = head != null ? head.id : null;
6119 _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug('in createBranch');
6120};
6121const merge = function (otherBranch) {
6122 const currentCommit = commits[branches[curBranch]];
6123 const otherCommit = commits[branches[otherBranch]];
6124
6125 if (isReachableFrom(currentCommit, otherCommit)) {
6126 _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug('Already merged');
6127 return;
6128 }
6129
6130 if (isfastforwardable(currentCommit, otherCommit)) {
6131 branches[curBranch] = branches[otherBranch];
6132 head = commits[branches[curBranch]];
6133 } else {
6134 // create merge commit
6135 const commit = {
6136 id: getId(),
6137 message: 'merged branch ' + otherBranch + ' into ' + curBranch,
6138 seq: seq++,
6139 parent: [head == null ? null : head.id, branches[otherBranch]]
6140 };
6141 head = commit;
6142 commits[commit.id] = commit;
6143 branches[curBranch] = commit.id;
6144 }
6145
6146 _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug(branches);
6147 _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug('in mergeBranch');
6148};
6149const checkout = function (branch) {
6150 _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug('in checkout');
6151 curBranch = branch;
6152 const id = branches[curBranch];
6153 head = commits[id];
6154};
6155const reset = function (commitRef) {
6156 _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug('in reset', commitRef);
6157 const ref = commitRef.split(':')[0];
6158 let parentCount = parseInt(commitRef.split(':')[1]);
6159 let commit = ref === 'HEAD' ? head : commits[branches[ref]];
6160 _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug(commit, parentCount);
6161
6162 while (parentCount > 0) {
6163 commit = commits[commit.parent];
6164 parentCount--;
6165
6166 if (!commit) {
6167 const err = 'Critical error - unique parent commit not found during reset';
6168 _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].error(err);
6169 throw err;
6170 }
6171 }
6172
6173 head = commit;
6174 branches[curBranch] = commit.id;
6175};
6176
6177function upsert(arr, key, newval) {
6178 const index = arr.indexOf(key);
6179
6180 if (index === -1) {
6181 arr.push(newval);
6182 } else {
6183 arr.splice(index, 1, newval);
6184 }
6185}
6186
6187function prettyPrintCommitHistory(commitArr) {
6188 const commit = lodash__WEBPACK_IMPORTED_MODULE_0___default.a.maxBy(commitArr, 'seq');
6189
6190 let line = '';
6191 commitArr.forEach(function (c) {
6192 if (c === commit) {
6193 line += '\t*';
6194 } else {
6195 line += '\t|';
6196 }
6197 });
6198 const label = [line, commit.id, commit.seq];
6199
6200 for (let branch in branches) {
6201 if (branches[branch] === commit.id) label.push(branch);
6202 }
6203
6204 _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug(label.join(' '));
6205
6206 if (Array.isArray(commit.parent)) {
6207 const newCommit = commits[commit.parent[0]];
6208 upsert(commitArr, commit, newCommit);
6209 commitArr.push(commits[commit.parent[1]]);
6210 } else if (commit.parent == null) {
6211 return;
6212 } else {
6213 const nextCommit = commits[commit.parent];
6214 upsert(commitArr, commit, nextCommit);
6215 }
6216
6217 commitArr = lodash__WEBPACK_IMPORTED_MODULE_0___default.a.uniqBy(commitArr, 'id');
6218 prettyPrintCommitHistory(commitArr);
6219}
6220
6221const prettyPrint = function () {
6222 _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug(commits);
6223 const node = getCommitsArray()[0];
6224 prettyPrintCommitHistory([node]);
6225};
6226const clear = function () {
6227 commits = {};
6228 head = null;
6229 branches = {
6230 master: head
6231 };
6232 curBranch = 'master';
6233 seq = 0;
6234};
6235const getBranchesAsObjArray = function () {
6236 const branchArr = [];
6237
6238 for (let branch in branches) {
6239 branchArr.push({
6240 name: branch,
6241 commit: commits[branches[branch]]
6242 });
6243 }
6244
6245 return branchArr;
6246};
6247const getBranches = function () {
6248 return branches;
6249};
6250const getCommits = function () {
6251 return commits;
6252};
6253const getCommitsArray = function () {
6254 const commitArr = Object.keys(commits).map(function (key) {
6255 return commits[key];
6256 });
6257 commitArr.forEach(function (o) {
6258 _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug(o.id);
6259 });
6260 return lodash__WEBPACK_IMPORTED_MODULE_0___default.a.orderBy(commitArr, ['seq'], ['desc']);
6261};
6262const getCurrentBranch = function () {
6263 return curBranch;
6264};
6265const getDirection = function () {
6266 return direction;
6267};
6268const getHead = function () {
6269 return head;
6270};
6271/* harmony default export */ __webpack_exports__["default"] = ({
6272 setDirection,
6273 setOptions,
6274 getOptions,
6275 commit,
6276 branch,
6277 merge,
6278 checkout,
6279 reset,
6280 prettyPrint,
6281 clear,
6282 getBranchesAsObjArray,
6283 getBranches,
6284 getCommits,
6285 getCommitsArray,
6286 getCurrentBranch,
6287 getDirection,
6288 getHead
6289});
6290
6291/***/ }),
6292
6293/***/ "./src/diagrams/git/gitGraphRenderer.js":
6294/*!**********************************************!*\
6295 !*** ./src/diagrams/git/gitGraphRenderer.js ***!
6296 \**********************************************/
6297/*! exports provided: setConf, draw, default */
6298/***/ (function(module, __webpack_exports__, __webpack_require__) {
6299
6300"use strict";
6301__webpack_require__.r(__webpack_exports__);
6302/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; });
6303/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; });
6304/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
6305/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
6306/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "lodash");
6307/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
6308/* harmony import */ var _gitGraphAst__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./gitGraphAst */ "./src/diagrams/git/gitGraphAst.js");
6309/* harmony import */ var _parser_gitGraph__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parser/gitGraph */ "./src/diagrams/git/parser/gitGraph.jison");
6310/* harmony import */ var _parser_gitGraph__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_parser_gitGraph__WEBPACK_IMPORTED_MODULE_3__);
6311/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
6312/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils */ "./src/utils.js");
6313
6314
6315
6316
6317
6318
6319let allCommitsDict = {};
6320let branchNum;
6321let config = {
6322 nodeSpacing: 150,
6323 nodeFillColor: 'yellow',
6324 nodeStrokeWidth: 2,
6325 nodeStrokeColor: 'grey',
6326 lineStrokeWidth: 4,
6327 branchOffset: 50,
6328 lineColor: 'grey',
6329 leftMargin: 50,
6330 branchColors: ['#442f74', '#983351', '#609732', '#AA9A39'],
6331 nodeRadius: 10,
6332 nodeLabel: {
6333 width: 75,
6334 height: 100,
6335 x: -25,
6336 y: 0
6337 }
6338};
6339let apiConfig = {};
6340const setConf = function (c) {
6341 apiConfig = c;
6342};
6343
6344function svgCreateDefs(svg) {
6345 svg.append('defs').append('g').attr('id', 'def-commit').append('circle').attr('r', config.nodeRadius).attr('cx', 0).attr('cy', 0);
6346 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('');
6347}
6348
6349function svgDrawLine(svg, points, colorIdx, interpolate) {
6350 const curve = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["interpolateToCurve"])(interpolate, d3__WEBPACK_IMPORTED_MODULE_0__["curveBasis"]);
6351 const color = config.branchColors[colorIdx % config.branchColors.length];
6352 const lineGen = d3__WEBPACK_IMPORTED_MODULE_0__["line"]().x(function (d) {
6353 return Math.round(d.x);
6354 }).y(function (d) {
6355 return Math.round(d.y);
6356 }).curve(curve);
6357 svg.append('svg:path').attr('d', lineGen(points)).style('stroke', color).style('stroke-width', config.lineStrokeWidth).style('fill', 'none');
6358} // Pass in the element and its pre-transform coords
6359
6360
6361function getElementCoords(element, coords) {
6362 coords = coords || element.node().getBBox();
6363 const ctm = element.node().getCTM();
6364 const xn = ctm.e + coords.x * ctm.a;
6365 const yn = ctm.f + coords.y * ctm.d;
6366 return {
6367 left: xn,
6368 top: yn,
6369 width: coords.width,
6370 height: coords.height
6371 };
6372}
6373
6374function svgDrawLineForCommits(svg, fromId, toId, direction, color) {
6375 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('svgDrawLineForCommits: ', fromId, toId);
6376 const fromBbox = getElementCoords(svg.select('#node-' + fromId + ' circle'));
6377 const toBbox = getElementCoords(svg.select('#node-' + toId + ' circle'));
6378
6379 switch (direction) {
6380 case 'LR':
6381 // (toBbox)
6382 // +--------
6383 // + (fromBbox)
6384 if (fromBbox.left - toBbox.left > config.nodeSpacing) {
6385 const lineStart = {
6386 x: fromBbox.left - config.nodeSpacing,
6387 y: toBbox.top + toBbox.height / 2
6388 };
6389 const lineEnd = {
6390 x: toBbox.left + toBbox.width,
6391 y: toBbox.top + toBbox.height / 2
6392 };
6393 svgDrawLine(svg, [lineStart, lineEnd], color, 'linear');
6394 svgDrawLine(svg, [{
6395 x: fromBbox.left,
6396 y: fromBbox.top + fromBbox.height / 2
6397 }, {
6398 x: fromBbox.left - config.nodeSpacing / 2,
6399 y: fromBbox.top + fromBbox.height / 2
6400 }, {
6401 x: fromBbox.left - config.nodeSpacing / 2,
6402 y: lineStart.y
6403 }, lineStart], color);
6404 } else {
6405 svgDrawLine(svg, [{
6406 x: fromBbox.left,
6407 y: fromBbox.top + fromBbox.height / 2
6408 }, {
6409 x: fromBbox.left - config.nodeSpacing / 2,
6410 y: fromBbox.top + fromBbox.height / 2
6411 }, {
6412 x: fromBbox.left - config.nodeSpacing / 2,
6413 y: toBbox.top + toBbox.height / 2
6414 }, {
6415 x: toBbox.left + toBbox.width,
6416 y: toBbox.top + toBbox.height / 2
6417 }], color);
6418 }
6419
6420 break;
6421
6422 case 'BT':
6423 // + (fromBbox)
6424 // |
6425 // |
6426 // + (toBbox)
6427 if (toBbox.top - fromBbox.top > config.nodeSpacing) {
6428 const lineStart = {
6429 x: toBbox.left + toBbox.width / 2,
6430 y: fromBbox.top + fromBbox.height + config.nodeSpacing
6431 };
6432 const lineEnd = {
6433 x: toBbox.left + toBbox.width / 2,
6434 y: toBbox.top
6435 };
6436 svgDrawLine(svg, [lineStart, lineEnd], color, 'linear');
6437 svgDrawLine(svg, [{
6438 x: fromBbox.left + fromBbox.width / 2,
6439 y: fromBbox.top + fromBbox.height
6440 }, {
6441 x: fromBbox.left + fromBbox.width / 2,
6442 y: fromBbox.top + fromBbox.height + config.nodeSpacing / 2
6443 }, {
6444 x: toBbox.left + toBbox.width / 2,
6445 y: lineStart.y - config.nodeSpacing / 2
6446 }, lineStart], color);
6447 } else {
6448 svgDrawLine(svg, [{
6449 x: fromBbox.left + fromBbox.width / 2,
6450 y: fromBbox.top + fromBbox.height
6451 }, {
6452 x: fromBbox.left + fromBbox.width / 2,
6453 y: fromBbox.top + config.nodeSpacing / 2
6454 }, {
6455 x: toBbox.left + toBbox.width / 2,
6456 y: toBbox.top - config.nodeSpacing / 2
6457 }, {
6458 x: toBbox.left + toBbox.width / 2,
6459 y: toBbox.top
6460 }], color);
6461 }
6462
6463 break;
6464 }
6465}
6466
6467function cloneNode(svg, selector) {
6468 return svg.select(selector).node().cloneNode(true);
6469}
6470
6471function renderCommitHistory(svg, commitid, branches, direction) {
6472 let commit;
6473 const numCommits = Object.keys(allCommitsDict).length;
6474
6475 if (typeof commitid === 'string') {
6476 do {
6477 commit = allCommitsDict[commitid];
6478 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('in renderCommitHistory', commit.id, commit.seq);
6479
6480 if (svg.select('#node-' + commitid).size() > 0) {
6481 return;
6482 }
6483
6484 svg.append(function () {
6485 return cloneNode(svg, '#def-commit');
6486 }).attr('class', 'commit').attr('id', function () {
6487 return 'node-' + commit.id;
6488 }).attr('transform', function () {
6489 switch (direction) {
6490 case 'LR':
6491 return 'translate(' + (commit.seq * config.nodeSpacing + config.leftMargin) + ', ' + branchNum * config.branchOffset + ')';
6492
6493 case 'BT':
6494 return 'translate(' + (branchNum * config.branchOffset + config.leftMargin) + ', ' + (numCommits - commit.seq) * config.nodeSpacing + ')';
6495 }
6496 }).attr('fill', config.nodeFillColor).attr('stroke', config.nodeStrokeColor).attr('stroke-width', config.nodeStrokeWidth);
6497 let branch;
6498
6499 for (let branchName in branches) {
6500 if (branches[branchName].commit === commit) {
6501 branch = branches[branchName];
6502 break;
6503 }
6504 }
6505
6506 if (branch) {
6507 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('found branch ', branch.name);
6508 svg.select('#node-' + commit.id + ' p').append('xhtml:span').attr('class', 'branch-label').text(branch.name + ', ');
6509 }
6510
6511 svg.select('#node-' + commit.id + ' p').append('xhtml:span').attr('class', 'commit-id').text(commit.id);
6512
6513 if (commit.message !== '' && direction === 'BT') {
6514 svg.select('#node-' + commit.id + ' p').append('xhtml:span').attr('class', 'commit-msg').text(', ' + commit.message);
6515 }
6516
6517 commitid = commit.parent;
6518 } while (commitid && allCommitsDict[commitid]);
6519 }
6520
6521 if (Array.isArray(commitid)) {
6522 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('found merge commmit', commitid);
6523 renderCommitHistory(svg, commitid[0], branches, direction);
6524 branchNum++;
6525 renderCommitHistory(svg, commitid[1], branches, direction);
6526 branchNum--;
6527 }
6528}
6529
6530function renderLines(svg, commit, direction, branchColor) {
6531 branchColor = branchColor || 0;
6532
6533 while (commit.seq > 0 && !commit.lineDrawn) {
6534 if (typeof commit.parent === 'string') {
6535 svgDrawLineForCommits(svg, commit.id, commit.parent, direction, branchColor);
6536 commit.lineDrawn = true;
6537 commit = allCommitsDict[commit.parent];
6538 } else if (Array.isArray(commit.parent)) {
6539 svgDrawLineForCommits(svg, commit.id, commit.parent[0], direction, branchColor);
6540 svgDrawLineForCommits(svg, commit.id, commit.parent[1], direction, branchColor + 1);
6541 renderLines(svg, allCommitsDict[commit.parent[1]], direction, branchColor + 1);
6542 commit.lineDrawn = true;
6543 commit = allCommitsDict[commit.parent[0]];
6544 }
6545 }
6546}
6547
6548const draw = function (txt, id, ver) {
6549 try {
6550 const parser = _parser_gitGraph__WEBPACK_IMPORTED_MODULE_3___default.a.parser;
6551 parser.yy = _gitGraphAst__WEBPACK_IMPORTED_MODULE_2__["default"];
6552 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('in gitgraph renderer', txt, id, ver); // Parse the graph definition
6553
6554 parser.parse(txt + '\n');
6555 config = lodash__WEBPACK_IMPORTED_MODULE_1___default.a.assign(config, apiConfig, _gitGraphAst__WEBPACK_IMPORTED_MODULE_2__["default"].getOptions());
6556 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('effective options', config);
6557 const direction = _gitGraphAst__WEBPACK_IMPORTED_MODULE_2__["default"].getDirection();
6558 allCommitsDict = _gitGraphAst__WEBPACK_IMPORTED_MODULE_2__["default"].getCommits();
6559 const branches = _gitGraphAst__WEBPACK_IMPORTED_MODULE_2__["default"].getBranchesAsObjArray();
6560
6561 if (direction === 'BT') {
6562 config.nodeLabel.x = branches.length * config.branchOffset;
6563 config.nodeLabel.width = '100%';
6564 config.nodeLabel.y = -1 * 2 * config.nodeRadius;
6565 }
6566
6567 const svg = d3__WEBPACK_IMPORTED_MODULE_0__["select"](`[id="${id}"]`);
6568 svgCreateDefs(svg);
6569 branchNum = 1;
6570
6571 for (let branch in branches) {
6572 const v = branches[branch];
6573 renderCommitHistory(svg, v.commit.id, branches, direction);
6574 renderLines(svg, v.commit, direction);
6575 branchNum++;
6576 }
6577
6578 svg.attr('height', function () {
6579 if (direction === 'BT') return Object.keys(allCommitsDict).length * config.nodeSpacing;
6580 return (branches.length + 1) * config.branchOffset;
6581 });
6582 } catch (e) {
6583 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].error('Error while rendering gitgraph');
6584 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].error(e.message);
6585 }
6586};
6587/* harmony default export */ __webpack_exports__["default"] = ({
6588 setConf,
6589 draw
6590});
6591
6592/***/ }),
6593
6594/***/ "./src/diagrams/git/parser/gitGraph.jison":
6595/*!************************************************!*\
6596 !*** ./src/diagrams/git/parser/gitGraph.jison ***!
6597 \************************************************/
6598/*! no static exports found */
6599/***/ (function(module, exports, __webpack_require__) {
6600
6601/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */
6602/*
6603 Returns a Parser object of the following structure:
6604
6605 Parser: {
6606 yy: {}
6607 }
6608
6609 Parser.prototype: {
6610 yy: {},
6611 trace: function(),
6612 symbols_: {associative list: name ==> number},
6613 terminals_: {associative list: number ==> name},
6614 productions_: [...],
6615 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
6616 table: [...],
6617 defaultActions: {...},
6618 parseError: function(str, hash),
6619 parse: function(input),
6620
6621 lexer: {
6622 EOF: 1,
6623 parseError: function(str, hash),
6624 setInput: function(input),
6625 input: function(),
6626 unput: function(str),
6627 more: function(),
6628 less: function(n),
6629 pastInput: function(),
6630 upcomingInput: function(),
6631 showPosition: function(),
6632 test_match: function(regex_match_array, rule_index),
6633 next: function(),
6634 lex: function(),
6635 begin: function(condition),
6636 popState: function(),
6637 _currentRules: function(),
6638 topState: function(),
6639 pushState: function(condition),
6640
6641 options: {
6642 ranges: boolean (optional: true ==> token location info will include a .range[] member)
6643 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
6644 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)
6645 },
6646
6647 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
6648 rules: [...],
6649 conditions: {associative list: name ==> set},
6650 }
6651 }
6652
6653
6654 token location info (@$, _$, etc.): {
6655 first_line: n,
6656 last_line: n,
6657 first_column: n,
6658 last_column: n,
6659 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
6660 }
6661
6662
6663 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
6664 text: (matched text)
6665 token: (the produced terminal token, if any)
6666 line: (yylineno)
6667 }
6668 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
6669 loc: (yylloc)
6670 expected: (string describing the set of expected tokens)
6671 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
6672 }
6673*/
6674var parser = (function(){
6675var 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];
6676var parser = {trace: function trace () { },
6677yy: {},
6678symbols_: {"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},
6679terminals_: {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"},
6680productions_: [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]],
6681performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
6682/* this == yyval */
6683
6684var $0 = $$.length - 1;
6685switch (yystate) {
6686case 1:
6687 return $$[$0-1];
6688break;
6689case 2:
6690yy.setDirection($$[$0-3]); return $$[$0-1];
6691break;
6692case 4:
6693 yy.setOptions($$[$0-1]); this.$ = $$[$0]
6694break;
6695case 5:
6696$$[$0-1] +=$$[$0]; this.$=$$[$0-1]
6697break;
6698case 7:
6699this.$ = []
6700break;
6701case 8:
6702$$[$0-1].push($$[$0]); this.$=$$[$0-1];
6703break;
6704case 9:
6705this.$ =$$[$0-1]
6706break;
6707case 11:
6708yy.commit($$[$0])
6709break;
6710case 12:
6711yy.branch($$[$0])
6712break;
6713case 13:
6714yy.checkout($$[$0])
6715break;
6716case 14:
6717yy.merge($$[$0])
6718break;
6719case 15:
6720yy.reset($$[$0])
6721break;
6722case 16:
6723this.$ = ""
6724break;
6725case 17:
6726this.$=$$[$0]
6727break;
6728case 18:
6729this.$ = $$[$0-1]+ ":" + $$[$0]
6730break;
6731case 19:
6732this.$ = $$[$0-1]+ ":" + yy.count; yy.count = 0
6733break;
6734case 20:
6735yy.count = 0
6736break;
6737case 21:
6738 yy.count += 1
6739break;
6740}
6741},
6742table: [{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]}],
6743defaultActions: {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]},
6744parseError: function parseError (str, hash) {
6745 if (hash.recoverable) {
6746 this.trace(str);
6747 } else {
6748 var error = new Error(str);
6749 error.hash = hash;
6750 throw error;
6751 }
6752},
6753parse: function parse(input) {
6754 var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
6755 var args = lstack.slice.call(arguments, 1);
6756 var lexer = Object.create(this.lexer);
6757 var sharedState = { yy: {} };
6758 for (var k in this.yy) {
6759 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
6760 sharedState.yy[k] = this.yy[k];
6761 }
6762 }
6763 lexer.setInput(input, sharedState.yy);
6764 sharedState.yy.lexer = lexer;
6765 sharedState.yy.parser = this;
6766 if (typeof lexer.yylloc == 'undefined') {
6767 lexer.yylloc = {};
6768 }
6769 var yyloc = lexer.yylloc;
6770 lstack.push(yyloc);
6771 var ranges = lexer.options && lexer.options.ranges;
6772 if (typeof sharedState.yy.parseError === 'function') {
6773 this.parseError = sharedState.yy.parseError;
6774 } else {
6775 this.parseError = Object.getPrototypeOf(this).parseError;
6776 }
6777 function popStack(n) {
6778 stack.length = stack.length - 2 * n;
6779 vstack.length = vstack.length - n;
6780 lstack.length = lstack.length - n;
6781 }
6782 function lex() {
6783 var token;
6784 token = tstack.pop() || lexer.lex() || EOF;
6785 if (typeof token !== 'number') {
6786 if (token instanceof Array) {
6787 tstack = token;
6788 token = tstack.pop();
6789 }
6790 token = self.symbols_[token] || token;
6791 }
6792 return token;
6793 }
6794 var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
6795 while (true) {
6796 state = stack[stack.length - 1];
6797 if (this.defaultActions[state]) {
6798 action = this.defaultActions[state];
6799 } else {
6800 if (symbol === null || typeof symbol == 'undefined') {
6801 symbol = lex();
6802 }
6803 action = table[state] && table[state][symbol];
6804 }
6805 if (typeof action === 'undefined' || !action.length || !action[0]) {
6806 var errStr = '';
6807 expected = [];
6808 for (p in table[state]) {
6809 if (this.terminals_[p] && p > TERROR) {
6810 expected.push('\'' + this.terminals_[p] + '\'');
6811 }
6812 }
6813 if (lexer.showPosition) {
6814 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
6815 } else {
6816 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
6817 }
6818 this.parseError(errStr, {
6819 text: lexer.match,
6820 token: this.terminals_[symbol] || symbol,
6821 line: lexer.yylineno,
6822 loc: yyloc,
6823 expected: expected
6824 });
6825 }
6826 if (action[0] instanceof Array && action.length > 1) {
6827 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
6828 }
6829 switch (action[0]) {
6830 case 1:
6831 stack.push(symbol);
6832 vstack.push(lexer.yytext);
6833 lstack.push(lexer.yylloc);
6834 stack.push(action[1]);
6835 symbol = null;
6836 if (!preErrorSymbol) {
6837 yyleng = lexer.yyleng;
6838 yytext = lexer.yytext;
6839 yylineno = lexer.yylineno;
6840 yyloc = lexer.yylloc;
6841 if (recovering > 0) {
6842 recovering--;
6843 }
6844 } else {
6845 symbol = preErrorSymbol;
6846 preErrorSymbol = null;
6847 }
6848 break;
6849 case 2:
6850 len = this.productions_[action[1]][1];
6851 yyval.$ = vstack[vstack.length - len];
6852 yyval._$ = {
6853 first_line: lstack[lstack.length - (len || 1)].first_line,
6854 last_line: lstack[lstack.length - 1].last_line,
6855 first_column: lstack[lstack.length - (len || 1)].first_column,
6856 last_column: lstack[lstack.length - 1].last_column
6857 };
6858 if (ranges) {
6859 yyval._$.range = [
6860 lstack[lstack.length - (len || 1)].range[0],
6861 lstack[lstack.length - 1].range[1]
6862 ];
6863 }
6864 r = this.performAction.apply(yyval, [
6865 yytext,
6866 yyleng,
6867 yylineno,
6868 sharedState.yy,
6869 action[1],
6870 vstack,
6871 lstack
6872 ].concat(args));
6873 if (typeof r !== 'undefined') {
6874 return r;
6875 }
6876 if (len) {
6877 stack = stack.slice(0, -1 * len * 2);
6878 vstack = vstack.slice(0, -1 * len);
6879 lstack = lstack.slice(0, -1 * len);
6880 }
6881 stack.push(this.productions_[action[1]][0]);
6882 vstack.push(yyval.$);
6883 lstack.push(yyval._$);
6884 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
6885 stack.push(newState);
6886 break;
6887 case 3:
6888 return true;
6889 }
6890 }
6891 return true;
6892}};
6893/* generated by jison-lex 0.3.4 */
6894var lexer = (function(){
6895var lexer = ({
6896
6897EOF:1,
6898
6899parseError:function parseError(str, hash) {
6900 if (this.yy.parser) {
6901 this.yy.parser.parseError(str, hash);
6902 } else {
6903 throw new Error(str);
6904 }
6905 },
6906
6907// resets the lexer, sets new input
6908setInput:function (input, yy) {
6909 this.yy = yy || this.yy || {};
6910 this._input = input;
6911 this._more = this._backtrack = this.done = false;
6912 this.yylineno = this.yyleng = 0;
6913 this.yytext = this.matched = this.match = '';
6914 this.conditionStack = ['INITIAL'];
6915 this.yylloc = {
6916 first_line: 1,
6917 first_column: 0,
6918 last_line: 1,
6919 last_column: 0
6920 };
6921 if (this.options.ranges) {
6922 this.yylloc.range = [0,0];
6923 }
6924 this.offset = 0;
6925 return this;
6926 },
6927
6928// consumes and returns one char from the input
6929input:function () {
6930 var ch = this._input[0];
6931 this.yytext += ch;
6932 this.yyleng++;
6933 this.offset++;
6934 this.match += ch;
6935 this.matched += ch;
6936 var lines = ch.match(/(?:\r\n?|\n).*/g);
6937 if (lines) {
6938 this.yylineno++;
6939 this.yylloc.last_line++;
6940 } else {
6941 this.yylloc.last_column++;
6942 }
6943 if (this.options.ranges) {
6944 this.yylloc.range[1]++;
6945 }
6946
6947 this._input = this._input.slice(1);
6948 return ch;
6949 },
6950
6951// unshifts one char (or a string) into the input
6952unput:function (ch) {
6953 var len = ch.length;
6954 var lines = ch.split(/(?:\r\n?|\n)/g);
6955
6956 this._input = ch + this._input;
6957 this.yytext = this.yytext.substr(0, this.yytext.length - len);
6958 //this.yyleng -= len;
6959 this.offset -= len;
6960 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
6961 this.match = this.match.substr(0, this.match.length - 1);
6962 this.matched = this.matched.substr(0, this.matched.length - 1);
6963
6964 if (lines.length - 1) {
6965 this.yylineno -= lines.length - 1;
6966 }
6967 var r = this.yylloc.range;
6968
6969 this.yylloc = {
6970 first_line: this.yylloc.first_line,
6971 last_line: this.yylineno + 1,
6972 first_column: this.yylloc.first_column,
6973 last_column: lines ?
6974 (lines.length === oldLines.length ? this.yylloc.first_column : 0)
6975 + oldLines[oldLines.length - lines.length].length - lines[0].length :
6976 this.yylloc.first_column - len
6977 };
6978
6979 if (this.options.ranges) {
6980 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
6981 }
6982 this.yyleng = this.yytext.length;
6983 return this;
6984 },
6985
6986// When called from action, caches matched text and appends it on next action
6987more:function () {
6988 this._more = true;
6989 return this;
6990 },
6991
6992// 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.
6993reject:function () {
6994 if (this.options.backtrack_lexer) {
6995 this._backtrack = true;
6996 } else {
6997 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(), {
6998 text: "",
6999 token: null,
7000 line: this.yylineno
7001 });
7002
7003 }
7004 return this;
7005 },
7006
7007// retain first n characters of the match
7008less:function (n) {
7009 this.unput(this.match.slice(n));
7010 },
7011
7012// displays already matched input, i.e. for error messages
7013pastInput:function () {
7014 var past = this.matched.substr(0, this.matched.length - this.match.length);
7015 return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
7016 },
7017
7018// displays upcoming input, i.e. for error messages
7019upcomingInput:function () {
7020 var next = this.match;
7021 if (next.length < 20) {
7022 next += this._input.substr(0, 20-next.length);
7023 }
7024 return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
7025 },
7026
7027// displays the character position where the lexing error occurred, i.e. for error messages
7028showPosition:function () {
7029 var pre = this.pastInput();
7030 var c = new Array(pre.length + 1).join("-");
7031 return pre + this.upcomingInput() + "\n" + c + "^";
7032 },
7033
7034// test the lexed token: return FALSE when not a match, otherwise return token
7035test_match:function(match, indexed_rule) {
7036 var token,
7037 lines,
7038 backup;
7039
7040 if (this.options.backtrack_lexer) {
7041 // save context
7042 backup = {
7043 yylineno: this.yylineno,
7044 yylloc: {
7045 first_line: this.yylloc.first_line,
7046 last_line: this.last_line,
7047 first_column: this.yylloc.first_column,
7048 last_column: this.yylloc.last_column
7049 },
7050 yytext: this.yytext,
7051 match: this.match,
7052 matches: this.matches,
7053 matched: this.matched,
7054 yyleng: this.yyleng,
7055 offset: this.offset,
7056 _more: this._more,
7057 _input: this._input,
7058 yy: this.yy,
7059 conditionStack: this.conditionStack.slice(0),
7060 done: this.done
7061 };
7062 if (this.options.ranges) {
7063 backup.yylloc.range = this.yylloc.range.slice(0);
7064 }
7065 }
7066
7067 lines = match[0].match(/(?:\r\n?|\n).*/g);
7068 if (lines) {
7069 this.yylineno += lines.length;
7070 }
7071 this.yylloc = {
7072 first_line: this.yylloc.last_line,
7073 last_line: this.yylineno + 1,
7074 first_column: this.yylloc.last_column,
7075 last_column: lines ?
7076 lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
7077 this.yylloc.last_column + match[0].length
7078 };
7079 this.yytext += match[0];
7080 this.match += match[0];
7081 this.matches = match;
7082 this.yyleng = this.yytext.length;
7083 if (this.options.ranges) {
7084 this.yylloc.range = [this.offset, this.offset += this.yyleng];
7085 }
7086 this._more = false;
7087 this._backtrack = false;
7088 this._input = this._input.slice(match[0].length);
7089 this.matched += match[0];
7090 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
7091 if (this.done && this._input) {
7092 this.done = false;
7093 }
7094 if (token) {
7095 return token;
7096 } else if (this._backtrack) {
7097 // recover context
7098 for (var k in backup) {
7099 this[k] = backup[k];
7100 }
7101 return false; // rule action called reject() implying the next rule should be tested instead.
7102 }
7103 return false;
7104 },
7105
7106// return next match in input
7107next:function () {
7108 if (this.done) {
7109 return this.EOF;
7110 }
7111 if (!this._input) {
7112 this.done = true;
7113 }
7114
7115 var token,
7116 match,
7117 tempMatch,
7118 index;
7119 if (!this._more) {
7120 this.yytext = '';
7121 this.match = '';
7122 }
7123 var rules = this._currentRules();
7124 for (var i = 0; i < rules.length; i++) {
7125 tempMatch = this._input.match(this.rules[rules[i]]);
7126 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
7127 match = tempMatch;
7128 index = i;
7129 if (this.options.backtrack_lexer) {
7130 token = this.test_match(tempMatch, rules[i]);
7131 if (token !== false) {
7132 return token;
7133 } else if (this._backtrack) {
7134 match = false;
7135 continue; // rule action called reject() implying a rule MISmatch.
7136 } else {
7137 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
7138 return false;
7139 }
7140 } else if (!this.options.flex) {
7141 break;
7142 }
7143 }
7144 }
7145 if (match) {
7146 token = this.test_match(match, rules[index]);
7147 if (token !== false) {
7148 return token;
7149 }
7150 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
7151 return false;
7152 }
7153 if (this._input === "") {
7154 return this.EOF;
7155 } else {
7156 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
7157 text: "",
7158 token: null,
7159 line: this.yylineno
7160 });
7161 }
7162 },
7163
7164// return next match that has a token
7165lex:function lex () {
7166 var r = this.next();
7167 if (r) {
7168 return r;
7169 } else {
7170 return this.lex();
7171 }
7172 },
7173
7174// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
7175begin:function begin (condition) {
7176 this.conditionStack.push(condition);
7177 },
7178
7179// pop the previously active lexer condition state off the condition stack
7180popState:function popState () {
7181 var n = this.conditionStack.length - 1;
7182 if (n > 0) {
7183 return this.conditionStack.pop();
7184 } else {
7185 return this.conditionStack[0];
7186 }
7187 },
7188
7189// produce the lexer rule set which is active for the currently active lexer condition state
7190_currentRules:function _currentRules () {
7191 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
7192 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
7193 } else {
7194 return this.conditions["INITIAL"].rules;
7195 }
7196 },
7197
7198// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
7199topState:function topState (n) {
7200 n = this.conditionStack.length - 1 - Math.abs(n || 0);
7201 if (n >= 0) {
7202 return this.conditionStack[n];
7203 } else {
7204 return "INITIAL";
7205 }
7206 },
7207
7208// alias for begin(condition)
7209pushState:function pushState (condition) {
7210 this.begin(condition);
7211 },
7212
7213// return the number of states currently on the stack
7214stateStackSize:function stateStackSize() {
7215 return this.conditionStack.length;
7216 },
7217options: {"case-insensitive":true},
7218performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
7219var YYSTATE=YY_START;
7220switch($avoiding_name_collisions) {
7221case 0:return 12;
7222break;
7223case 1:/* skip all whitespace */
7224break;
7225case 2:/* skip comments */
7226break;
7227case 3:/* skip comments */
7228break;
7229case 4:return 4;
7230break;
7231case 5:return 15;
7232break;
7233case 6:return 17;
7234break;
7235case 7:return 20;
7236break;
7237case 8:return 21;
7238break;
7239case 9:return 19;
7240break;
7241case 10:return 8;
7242break;
7243case 11:return 8;
7244break;
7245case 12:return 5;
7246break;
7247case 13:return 26
7248break;
7249case 14:this.begin("options");
7250break;
7251case 15:this.popState();
7252break;
7253case 16:return 11;
7254break;
7255case 17:this.begin("string");
7256break;
7257case 18:this.popState();
7258break;
7259case 19:return 23;
7260break;
7261case 20:return 18;
7262break;
7263case 21:return 7;
7264break;
7265}
7266},
7267rules: [/^(?:(\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],
7268conditions: {"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}}
7269});
7270return lexer;
7271})();
7272parser.lexer = lexer;
7273function Parser () {
7274 this.yy = {};
7275}
7276Parser.prototype = parser;parser.Parser = Parser;
7277return new Parser;
7278})();
7279
7280
7281if (true) {
7282exports.parser = parser;
7283exports.Parser = parser.Parser;
7284exports.parse = function () { return parser.parse.apply(parser, arguments); };
7285exports.main = function commonjsMain (args) {
7286 if (!args[1]) {
7287 console.log('Usage: '+args[0]+' FILE');
7288 process.exit(1);
7289 }
7290 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");
7291 return exports.parser.parse(source);
7292};
7293if ( true && __webpack_require__.c[__webpack_require__.s] === module) {
7294 exports.main(process.argv.slice(1));
7295}
7296}
7297/* 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)))
7298
7299/***/ }),
7300
7301/***/ "./src/diagrams/info/infoDb.js":
7302/*!*************************************!*\
7303 !*** ./src/diagrams/info/infoDb.js ***!
7304 \*************************************/
7305/*! exports provided: setMessage, getMessage, setInfo, getInfo, default */
7306/***/ (function(module, __webpack_exports__, __webpack_require__) {
7307
7308"use strict";
7309__webpack_require__.r(__webpack_exports__);
7310/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setMessage", function() { return setMessage; });
7311/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMessage", function() { return getMessage; });
7312/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setInfo", function() { return setInfo; });
7313/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getInfo", function() { return getInfo; });
7314/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
7315/**
7316 * Created by knut on 15-01-14.
7317 */
7318
7319var message = '';
7320var info = false;
7321const setMessage = txt => {
7322 _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Setting message to: ' + txt);
7323 message = txt;
7324};
7325const getMessage = () => {
7326 return message;
7327};
7328const setInfo = inf => {
7329 info = inf;
7330};
7331const getInfo = () => {
7332 return info;
7333}; // export const parseError = (err, hash) => {
7334// global.mermaidAPI.parseError(err, hash)
7335// }
7336
7337/* harmony default export */ __webpack_exports__["default"] = ({
7338 setMessage,
7339 getMessage,
7340 setInfo,
7341 getInfo // parseError
7342
7343});
7344
7345/***/ }),
7346
7347/***/ "./src/diagrams/info/infoRenderer.js":
7348/*!*******************************************!*\
7349 !*** ./src/diagrams/info/infoRenderer.js ***!
7350 \*******************************************/
7351/*! exports provided: setConf, draw, default */
7352/***/ (function(module, __webpack_exports__, __webpack_require__) {
7353
7354"use strict";
7355__webpack_require__.r(__webpack_exports__);
7356/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; });
7357/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; });
7358/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
7359/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
7360/* harmony import */ var _infoDb__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./infoDb */ "./src/diagrams/info/infoDb.js");
7361/* harmony import */ var _parser_info__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./parser/info */ "./src/diagrams/info/parser/info.jison");
7362/* harmony import */ var _parser_info__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_parser_info__WEBPACK_IMPORTED_MODULE_2__);
7363/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
7364/**
7365 * Created by knut on 14-12-11.
7366 */
7367
7368
7369
7370
7371const conf = {};
7372const setConf = function (cnf) {
7373 const keys = Object.keys(cnf);
7374 keys.forEach(function (key) {
7375 conf[key] = cnf[key];
7376 });
7377};
7378/**
7379 * Draws a an info picture in the tag with id: id based on the graph definition in text.
7380 * @param text
7381 * @param id
7382 */
7383
7384const draw = (txt, id, ver) => {
7385 try {
7386 const parser = _parser_info__WEBPACK_IMPORTED_MODULE_2___default.a.parser;
7387 parser.yy = _infoDb__WEBPACK_IMPORTED_MODULE_1__["default"];
7388 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Renering info diagram\n' + txt); // Parse the graph definition
7389
7390 parser.parse(txt);
7391 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Parsed info diagram'); // Fetch the default direction, use TD if none was found
7392
7393 const svg = d3__WEBPACK_IMPORTED_MODULE_0__["select"]('#' + id);
7394 const g = svg.append('g');
7395 g.append('text') // text label for the x axis
7396 .attr('x', 100).attr('y', 40).attr('class', 'version').attr('font-size', '32px').style('text-anchor', 'middle').text('v ' + ver);
7397 svg.attr('height', 100);
7398 svg.attr('width', 400); // svg.attr('viewBox', '0 0 300 150');
7399 } catch (e) {
7400 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].error('Error while rendering info diagram');
7401 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].error(e.message);
7402 }
7403};
7404/* harmony default export */ __webpack_exports__["default"] = ({
7405 setConf,
7406 draw
7407});
7408
7409/***/ }),
7410
7411/***/ "./src/diagrams/info/parser/info.jison":
7412/*!*********************************************!*\
7413 !*** ./src/diagrams/info/parser/info.jison ***!
7414 \*********************************************/
7415/*! no static exports found */
7416/***/ (function(module, exports, __webpack_require__) {
7417
7418/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */
7419/*
7420 Returns a Parser object of the following structure:
7421
7422 Parser: {
7423 yy: {}
7424 }
7425
7426 Parser.prototype: {
7427 yy: {},
7428 trace: function(),
7429 symbols_: {associative list: name ==> number},
7430 terminals_: {associative list: number ==> name},
7431 productions_: [...],
7432 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
7433 table: [...],
7434 defaultActions: {...},
7435 parseError: function(str, hash),
7436 parse: function(input),
7437
7438 lexer: {
7439 EOF: 1,
7440 parseError: function(str, hash),
7441 setInput: function(input),
7442 input: function(),
7443 unput: function(str),
7444 more: function(),
7445 less: function(n),
7446 pastInput: function(),
7447 upcomingInput: function(),
7448 showPosition: function(),
7449 test_match: function(regex_match_array, rule_index),
7450 next: function(),
7451 lex: function(),
7452 begin: function(condition),
7453 popState: function(),
7454 _currentRules: function(),
7455 topState: function(),
7456 pushState: function(condition),
7457
7458 options: {
7459 ranges: boolean (optional: true ==> token location info will include a .range[] member)
7460 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
7461 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)
7462 },
7463
7464 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
7465 rules: [...],
7466 conditions: {associative list: name ==> set},
7467 }
7468 }
7469
7470
7471 token location info (@$, _$, etc.): {
7472 first_line: n,
7473 last_line: n,
7474 first_column: n,
7475 last_column: n,
7476 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
7477 }
7478
7479
7480 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
7481 text: (matched text)
7482 token: (the produced terminal token, if any)
7483 line: (yylineno)
7484 }
7485 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
7486 loc: (yylloc)
7487 expected: (string describing the set of expected tokens)
7488 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
7489 }
7490*/
7491var parser = (function(){
7492var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[6,9,10];
7493var parser = {trace: function trace () { },
7494yy: {},
7495symbols_: {"error":2,"start":3,"info":4,"document":5,"EOF":6,"line":7,"statement":8,"NL":9,"showInfo":10,"$accept":0,"$end":1},
7496terminals_: {2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo"},
7497productions_: [0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1]],
7498performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
7499/* this == yyval */
7500
7501var $0 = $$.length - 1;
7502switch (yystate) {
7503case 1:
7504 return yy;
7505break;
7506case 4:
7507
7508break;
7509case 6:
7510 yy.setInfo(true);
7511break;
7512}
7513},
7514table: [{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])],
7515defaultActions: {4:[2,1]},
7516parseError: function parseError (str, hash) {
7517 if (hash.recoverable) {
7518 this.trace(str);
7519 } else {
7520 var error = new Error(str);
7521 error.hash = hash;
7522 throw error;
7523 }
7524},
7525parse: function parse(input) {
7526 var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
7527 var args = lstack.slice.call(arguments, 1);
7528 var lexer = Object.create(this.lexer);
7529 var sharedState = { yy: {} };
7530 for (var k in this.yy) {
7531 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
7532 sharedState.yy[k] = this.yy[k];
7533 }
7534 }
7535 lexer.setInput(input, sharedState.yy);
7536 sharedState.yy.lexer = lexer;
7537 sharedState.yy.parser = this;
7538 if (typeof lexer.yylloc == 'undefined') {
7539 lexer.yylloc = {};
7540 }
7541 var yyloc = lexer.yylloc;
7542 lstack.push(yyloc);
7543 var ranges = lexer.options && lexer.options.ranges;
7544 if (typeof sharedState.yy.parseError === 'function') {
7545 this.parseError = sharedState.yy.parseError;
7546 } else {
7547 this.parseError = Object.getPrototypeOf(this).parseError;
7548 }
7549 function popStack(n) {
7550 stack.length = stack.length - 2 * n;
7551 vstack.length = vstack.length - n;
7552 lstack.length = lstack.length - n;
7553 }
7554 function lex() {
7555 var token;
7556 token = tstack.pop() || lexer.lex() || EOF;
7557 if (typeof token !== 'number') {
7558 if (token instanceof Array) {
7559 tstack = token;
7560 token = tstack.pop();
7561 }
7562 token = self.symbols_[token] || token;
7563 }
7564 return token;
7565 }
7566 var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
7567 while (true) {
7568 state = stack[stack.length - 1];
7569 if (this.defaultActions[state]) {
7570 action = this.defaultActions[state];
7571 } else {
7572 if (symbol === null || typeof symbol == 'undefined') {
7573 symbol = lex();
7574 }
7575 action = table[state] && table[state][symbol];
7576 }
7577 if (typeof action === 'undefined' || !action.length || !action[0]) {
7578 var errStr = '';
7579 expected = [];
7580 for (p in table[state]) {
7581 if (this.terminals_[p] && p > TERROR) {
7582 expected.push('\'' + this.terminals_[p] + '\'');
7583 }
7584 }
7585 if (lexer.showPosition) {
7586 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
7587 } else {
7588 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
7589 }
7590 this.parseError(errStr, {
7591 text: lexer.match,
7592 token: this.terminals_[symbol] || symbol,
7593 line: lexer.yylineno,
7594 loc: yyloc,
7595 expected: expected
7596 });
7597 }
7598 if (action[0] instanceof Array && action.length > 1) {
7599 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
7600 }
7601 switch (action[0]) {
7602 case 1:
7603 stack.push(symbol);
7604 vstack.push(lexer.yytext);
7605 lstack.push(lexer.yylloc);
7606 stack.push(action[1]);
7607 symbol = null;
7608 if (!preErrorSymbol) {
7609 yyleng = lexer.yyleng;
7610 yytext = lexer.yytext;
7611 yylineno = lexer.yylineno;
7612 yyloc = lexer.yylloc;
7613 if (recovering > 0) {
7614 recovering--;
7615 }
7616 } else {
7617 symbol = preErrorSymbol;
7618 preErrorSymbol = null;
7619 }
7620 break;
7621 case 2:
7622 len = this.productions_[action[1]][1];
7623 yyval.$ = vstack[vstack.length - len];
7624 yyval._$ = {
7625 first_line: lstack[lstack.length - (len || 1)].first_line,
7626 last_line: lstack[lstack.length - 1].last_line,
7627 first_column: lstack[lstack.length - (len || 1)].first_column,
7628 last_column: lstack[lstack.length - 1].last_column
7629 };
7630 if (ranges) {
7631 yyval._$.range = [
7632 lstack[lstack.length - (len || 1)].range[0],
7633 lstack[lstack.length - 1].range[1]
7634 ];
7635 }
7636 r = this.performAction.apply(yyval, [
7637 yytext,
7638 yyleng,
7639 yylineno,
7640 sharedState.yy,
7641 action[1],
7642 vstack,
7643 lstack
7644 ].concat(args));
7645 if (typeof r !== 'undefined') {
7646 return r;
7647 }
7648 if (len) {
7649 stack = stack.slice(0, -1 * len * 2);
7650 vstack = vstack.slice(0, -1 * len);
7651 lstack = lstack.slice(0, -1 * len);
7652 }
7653 stack.push(this.productions_[action[1]][0]);
7654 vstack.push(yyval.$);
7655 lstack.push(yyval._$);
7656 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
7657 stack.push(newState);
7658 break;
7659 case 3:
7660 return true;
7661 }
7662 }
7663 return true;
7664}};
7665/* generated by jison-lex 0.3.4 */
7666var lexer = (function(){
7667var lexer = ({
7668
7669EOF:1,
7670
7671parseError:function parseError(str, hash) {
7672 if (this.yy.parser) {
7673 this.yy.parser.parseError(str, hash);
7674 } else {
7675 throw new Error(str);
7676 }
7677 },
7678
7679// resets the lexer, sets new input
7680setInput:function (input, yy) {
7681 this.yy = yy || this.yy || {};
7682 this._input = input;
7683 this._more = this._backtrack = this.done = false;
7684 this.yylineno = this.yyleng = 0;
7685 this.yytext = this.matched = this.match = '';
7686 this.conditionStack = ['INITIAL'];
7687 this.yylloc = {
7688 first_line: 1,
7689 first_column: 0,
7690 last_line: 1,
7691 last_column: 0
7692 };
7693 if (this.options.ranges) {
7694 this.yylloc.range = [0,0];
7695 }
7696 this.offset = 0;
7697 return this;
7698 },
7699
7700// consumes and returns one char from the input
7701input:function () {
7702 var ch = this._input[0];
7703 this.yytext += ch;
7704 this.yyleng++;
7705 this.offset++;
7706 this.match += ch;
7707 this.matched += ch;
7708 var lines = ch.match(/(?:\r\n?|\n).*/g);
7709 if (lines) {
7710 this.yylineno++;
7711 this.yylloc.last_line++;
7712 } else {
7713 this.yylloc.last_column++;
7714 }
7715 if (this.options.ranges) {
7716 this.yylloc.range[1]++;
7717 }
7718
7719 this._input = this._input.slice(1);
7720 return ch;
7721 },
7722
7723// unshifts one char (or a string) into the input
7724unput:function (ch) {
7725 var len = ch.length;
7726 var lines = ch.split(/(?:\r\n?|\n)/g);
7727
7728 this._input = ch + this._input;
7729 this.yytext = this.yytext.substr(0, this.yytext.length - len);
7730 //this.yyleng -= len;
7731 this.offset -= len;
7732 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
7733 this.match = this.match.substr(0, this.match.length - 1);
7734 this.matched = this.matched.substr(0, this.matched.length - 1);
7735
7736 if (lines.length - 1) {
7737 this.yylineno -= lines.length - 1;
7738 }
7739 var r = this.yylloc.range;
7740
7741 this.yylloc = {
7742 first_line: this.yylloc.first_line,
7743 last_line: this.yylineno + 1,
7744 first_column: this.yylloc.first_column,
7745 last_column: lines ?
7746 (lines.length === oldLines.length ? this.yylloc.first_column : 0)
7747 + oldLines[oldLines.length - lines.length].length - lines[0].length :
7748 this.yylloc.first_column - len
7749 };
7750
7751 if (this.options.ranges) {
7752 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
7753 }
7754 this.yyleng = this.yytext.length;
7755 return this;
7756 },
7757
7758// When called from action, caches matched text and appends it on next action
7759more:function () {
7760 this._more = true;
7761 return this;
7762 },
7763
7764// 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.
7765reject:function () {
7766 if (this.options.backtrack_lexer) {
7767 this._backtrack = true;
7768 } else {
7769 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(), {
7770 text: "",
7771 token: null,
7772 line: this.yylineno
7773 });
7774
7775 }
7776 return this;
7777 },
7778
7779// retain first n characters of the match
7780less:function (n) {
7781 this.unput(this.match.slice(n));
7782 },
7783
7784// displays already matched input, i.e. for error messages
7785pastInput:function () {
7786 var past = this.matched.substr(0, this.matched.length - this.match.length);
7787 return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
7788 },
7789
7790// displays upcoming input, i.e. for error messages
7791upcomingInput:function () {
7792 var next = this.match;
7793 if (next.length < 20) {
7794 next += this._input.substr(0, 20-next.length);
7795 }
7796 return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
7797 },
7798
7799// displays the character position where the lexing error occurred, i.e. for error messages
7800showPosition:function () {
7801 var pre = this.pastInput();
7802 var c = new Array(pre.length + 1).join("-");
7803 return pre + this.upcomingInput() + "\n" + c + "^";
7804 },
7805
7806// test the lexed token: return FALSE when not a match, otherwise return token
7807test_match:function(match, indexed_rule) {
7808 var token,
7809 lines,
7810 backup;
7811
7812 if (this.options.backtrack_lexer) {
7813 // save context
7814 backup = {
7815 yylineno: this.yylineno,
7816 yylloc: {
7817 first_line: this.yylloc.first_line,
7818 last_line: this.last_line,
7819 first_column: this.yylloc.first_column,
7820 last_column: this.yylloc.last_column
7821 },
7822 yytext: this.yytext,
7823 match: this.match,
7824 matches: this.matches,
7825 matched: this.matched,
7826 yyleng: this.yyleng,
7827 offset: this.offset,
7828 _more: this._more,
7829 _input: this._input,
7830 yy: this.yy,
7831 conditionStack: this.conditionStack.slice(0),
7832 done: this.done
7833 };
7834 if (this.options.ranges) {
7835 backup.yylloc.range = this.yylloc.range.slice(0);
7836 }
7837 }
7838
7839 lines = match[0].match(/(?:\r\n?|\n).*/g);
7840 if (lines) {
7841 this.yylineno += lines.length;
7842 }
7843 this.yylloc = {
7844 first_line: this.yylloc.last_line,
7845 last_line: this.yylineno + 1,
7846 first_column: this.yylloc.last_column,
7847 last_column: lines ?
7848 lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
7849 this.yylloc.last_column + match[0].length
7850 };
7851 this.yytext += match[0];
7852 this.match += match[0];
7853 this.matches = match;
7854 this.yyleng = this.yytext.length;
7855 if (this.options.ranges) {
7856 this.yylloc.range = [this.offset, this.offset += this.yyleng];
7857 }
7858 this._more = false;
7859 this._backtrack = false;
7860 this._input = this._input.slice(match[0].length);
7861 this.matched += match[0];
7862 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
7863 if (this.done && this._input) {
7864 this.done = false;
7865 }
7866 if (token) {
7867 return token;
7868 } else if (this._backtrack) {
7869 // recover context
7870 for (var k in backup) {
7871 this[k] = backup[k];
7872 }
7873 return false; // rule action called reject() implying the next rule should be tested instead.
7874 }
7875 return false;
7876 },
7877
7878// return next match in input
7879next:function () {
7880 if (this.done) {
7881 return this.EOF;
7882 }
7883 if (!this._input) {
7884 this.done = true;
7885 }
7886
7887 var token,
7888 match,
7889 tempMatch,
7890 index;
7891 if (!this._more) {
7892 this.yytext = '';
7893 this.match = '';
7894 }
7895 var rules = this._currentRules();
7896 for (var i = 0; i < rules.length; i++) {
7897 tempMatch = this._input.match(this.rules[rules[i]]);
7898 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
7899 match = tempMatch;
7900 index = i;
7901 if (this.options.backtrack_lexer) {
7902 token = this.test_match(tempMatch, rules[i]);
7903 if (token !== false) {
7904 return token;
7905 } else if (this._backtrack) {
7906 match = false;
7907 continue; // rule action called reject() implying a rule MISmatch.
7908 } else {
7909 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
7910 return false;
7911 }
7912 } else if (!this.options.flex) {
7913 break;
7914 }
7915 }
7916 }
7917 if (match) {
7918 token = this.test_match(match, rules[index]);
7919 if (token !== false) {
7920 return token;
7921 }
7922 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
7923 return false;
7924 }
7925 if (this._input === "") {
7926 return this.EOF;
7927 } else {
7928 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
7929 text: "",
7930 token: null,
7931 line: this.yylineno
7932 });
7933 }
7934 },
7935
7936// return next match that has a token
7937lex:function lex () {
7938 var r = this.next();
7939 if (r) {
7940 return r;
7941 } else {
7942 return this.lex();
7943 }
7944 },
7945
7946// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
7947begin:function begin (condition) {
7948 this.conditionStack.push(condition);
7949 },
7950
7951// pop the previously active lexer condition state off the condition stack
7952popState:function popState () {
7953 var n = this.conditionStack.length - 1;
7954 if (n > 0) {
7955 return this.conditionStack.pop();
7956 } else {
7957 return this.conditionStack[0];
7958 }
7959 },
7960
7961// produce the lexer rule set which is active for the currently active lexer condition state
7962_currentRules:function _currentRules () {
7963 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
7964 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
7965 } else {
7966 return this.conditions["INITIAL"].rules;
7967 }
7968 },
7969
7970// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
7971topState:function topState (n) {
7972 n = this.conditionStack.length - 1 - Math.abs(n || 0);
7973 if (n >= 0) {
7974 return this.conditionStack[n];
7975 } else {
7976 return "INITIAL";
7977 }
7978 },
7979
7980// alias for begin(condition)
7981pushState:function pushState (condition) {
7982 this.begin(condition);
7983 },
7984
7985// return the number of states currently on the stack
7986stateStackSize:function stateStackSize() {
7987 return this.conditionStack.length;
7988 },
7989options: {"case-insensitive":true},
7990performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
7991 // Pre-lexer code can go here
7992
7993var YYSTATE=YY_START;
7994switch($avoiding_name_collisions) {
7995case 0:return 4 ;
7996break;
7997case 1:return 9 ;
7998break;
7999case 2:return 'space';
8000break;
8001case 3:return 10;
8002break;
8003case 4:return 6 ;
8004break;
8005case 5:return 'TXT' ;
8006break;
8007}
8008},
8009rules: [/^(?:info\b)/i,/^(?:[\s\n\r]+)/i,/^(?:[\s]+)/i,/^(?:showInfo\b)/i,/^(?:$)/i,/^(?:.)/i],
8010conditions: {"INITIAL":{"rules":[0,1,2,3,4,5],"inclusive":true}}
8011});
8012return lexer;
8013})();
8014parser.lexer = lexer;
8015function Parser () {
8016 this.yy = {};
8017}
8018Parser.prototype = parser;parser.Parser = Parser;
8019return new Parser;
8020})();
8021
8022
8023if (true) {
8024exports.parser = parser;
8025exports.Parser = parser.Parser;
8026exports.parse = function () { return parser.parse.apply(parser, arguments); };
8027exports.main = function commonjsMain (args) {
8028 if (!args[1]) {
8029 console.log('Usage: '+args[0]+' FILE');
8030 process.exit(1);
8031 }
8032 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");
8033 return exports.parser.parse(source);
8034};
8035if ( true && __webpack_require__.c[__webpack_require__.s] === module) {
8036 exports.main(process.argv.slice(1));
8037}
8038}
8039/* 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)))
8040
8041/***/ }),
8042
8043/***/ "./src/diagrams/pie/parser/pie.jison":
8044/*!*******************************************!*\
8045 !*** ./src/diagrams/pie/parser/pie.jison ***!
8046 \*******************************************/
8047/*! no static exports found */
8048/***/ (function(module, exports, __webpack_require__) {
8049
8050/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */
8051/*
8052 Returns a Parser object of the following structure:
8053
8054 Parser: {
8055 yy: {}
8056 }
8057
8058 Parser.prototype: {
8059 yy: {},
8060 trace: function(),
8061 symbols_: {associative list: name ==> number},
8062 terminals_: {associative list: number ==> name},
8063 productions_: [...],
8064 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
8065 table: [...],
8066 defaultActions: {...},
8067 parseError: function(str, hash),
8068 parse: function(input),
8069
8070 lexer: {
8071 EOF: 1,
8072 parseError: function(str, hash),
8073 setInput: function(input),
8074 input: function(),
8075 unput: function(str),
8076 more: function(),
8077 less: function(n),
8078 pastInput: function(),
8079 upcomingInput: function(),
8080 showPosition: function(),
8081 test_match: function(regex_match_array, rule_index),
8082 next: function(),
8083 lex: function(),
8084 begin: function(condition),
8085 popState: function(),
8086 _currentRules: function(),
8087 topState: function(),
8088 pushState: function(condition),
8089
8090 options: {
8091 ranges: boolean (optional: true ==> token location info will include a .range[] member)
8092 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
8093 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)
8094 },
8095
8096 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
8097 rules: [...],
8098 conditions: {associative list: name ==> set},
8099 }
8100 }
8101
8102
8103 token location info (@$, _$, etc.): {
8104 first_line: n,
8105 last_line: n,
8106 first_column: n,
8107 last_column: n,
8108 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
8109 }
8110
8111
8112 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
8113 text: (matched text)
8114 token: (the produced terminal token, if any)
8115 line: (yylineno)
8116 }
8117 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
8118 loc: (yylloc)
8119 expected: (string describing the set of expected tokens)
8120 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
8121 }
8122*/
8123var parser = (function(){
8124var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[6,9,10,12];
8125var parser = {trace: function trace () { },
8126yy: {},
8127symbols_: {"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},
8128terminals_: {2:"error",4:"pie",6:"EOF",9:"NL",10:"STR",11:"VALUE",12:"title"},
8129productions_: [0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,2],[8,1]],
8130performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
8131/* this == yyval */
8132
8133var $0 = $$.length - 1;
8134switch (yystate) {
8135case 4:
8136
8137break;
8138case 6:
8139
8140 console.log('str:'+$$[$0-1]+' value: '+$$[$0])
8141 yy.addSection($$[$0-1],yy.cleanupValue($$[$0]));
8142break;
8143case 7:
8144yy.setTitle($$[$0].substr(6));this.$=$$[$0].substr(6);
8145break;
8146}
8147},
8148table: [{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])],
8149defaultActions: {4:[2,1]},
8150parseError: function parseError (str, hash) {
8151 if (hash.recoverable) {
8152 this.trace(str);
8153 } else {
8154 var error = new Error(str);
8155 error.hash = hash;
8156 throw error;
8157 }
8158},
8159parse: function parse(input) {
8160 var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
8161 var args = lstack.slice.call(arguments, 1);
8162 var lexer = Object.create(this.lexer);
8163 var sharedState = { yy: {} };
8164 for (var k in this.yy) {
8165 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
8166 sharedState.yy[k] = this.yy[k];
8167 }
8168 }
8169 lexer.setInput(input, sharedState.yy);
8170 sharedState.yy.lexer = lexer;
8171 sharedState.yy.parser = this;
8172 if (typeof lexer.yylloc == 'undefined') {
8173 lexer.yylloc = {};
8174 }
8175 var yyloc = lexer.yylloc;
8176 lstack.push(yyloc);
8177 var ranges = lexer.options && lexer.options.ranges;
8178 if (typeof sharedState.yy.parseError === 'function') {
8179 this.parseError = sharedState.yy.parseError;
8180 } else {
8181 this.parseError = Object.getPrototypeOf(this).parseError;
8182 }
8183 function popStack(n) {
8184 stack.length = stack.length - 2 * n;
8185 vstack.length = vstack.length - n;
8186 lstack.length = lstack.length - n;
8187 }
8188 function lex() {
8189 var token;
8190 token = tstack.pop() || lexer.lex() || EOF;
8191 if (typeof token !== 'number') {
8192 if (token instanceof Array) {
8193 tstack = token;
8194 token = tstack.pop();
8195 }
8196 token = self.symbols_[token] || token;
8197 }
8198 return token;
8199 }
8200 var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
8201 while (true) {
8202 state = stack[stack.length - 1];
8203 if (this.defaultActions[state]) {
8204 action = this.defaultActions[state];
8205 } else {
8206 if (symbol === null || typeof symbol == 'undefined') {
8207 symbol = lex();
8208 }
8209 action = table[state] && table[state][symbol];
8210 }
8211 if (typeof action === 'undefined' || !action.length || !action[0]) {
8212 var errStr = '';
8213 expected = [];
8214 for (p in table[state]) {
8215 if (this.terminals_[p] && p > TERROR) {
8216 expected.push('\'' + this.terminals_[p] + '\'');
8217 }
8218 }
8219 if (lexer.showPosition) {
8220 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
8221 } else {
8222 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
8223 }
8224 this.parseError(errStr, {
8225 text: lexer.match,
8226 token: this.terminals_[symbol] || symbol,
8227 line: lexer.yylineno,
8228 loc: yyloc,
8229 expected: expected
8230 });
8231 }
8232 if (action[0] instanceof Array && action.length > 1) {
8233 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
8234 }
8235 switch (action[0]) {
8236 case 1:
8237 stack.push(symbol);
8238 vstack.push(lexer.yytext);
8239 lstack.push(lexer.yylloc);
8240 stack.push(action[1]);
8241 symbol = null;
8242 if (!preErrorSymbol) {
8243 yyleng = lexer.yyleng;
8244 yytext = lexer.yytext;
8245 yylineno = lexer.yylineno;
8246 yyloc = lexer.yylloc;
8247 if (recovering > 0) {
8248 recovering--;
8249 }
8250 } else {
8251 symbol = preErrorSymbol;
8252 preErrorSymbol = null;
8253 }
8254 break;
8255 case 2:
8256 len = this.productions_[action[1]][1];
8257 yyval.$ = vstack[vstack.length - len];
8258 yyval._$ = {
8259 first_line: lstack[lstack.length - (len || 1)].first_line,
8260 last_line: lstack[lstack.length - 1].last_line,
8261 first_column: lstack[lstack.length - (len || 1)].first_column,
8262 last_column: lstack[lstack.length - 1].last_column
8263 };
8264 if (ranges) {
8265 yyval._$.range = [
8266 lstack[lstack.length - (len || 1)].range[0],
8267 lstack[lstack.length - 1].range[1]
8268 ];
8269 }
8270 r = this.performAction.apply(yyval, [
8271 yytext,
8272 yyleng,
8273 yylineno,
8274 sharedState.yy,
8275 action[1],
8276 vstack,
8277 lstack
8278 ].concat(args));
8279 if (typeof r !== 'undefined') {
8280 return r;
8281 }
8282 if (len) {
8283 stack = stack.slice(0, -1 * len * 2);
8284 vstack = vstack.slice(0, -1 * len);
8285 lstack = lstack.slice(0, -1 * len);
8286 }
8287 stack.push(this.productions_[action[1]][0]);
8288 vstack.push(yyval.$);
8289 lstack.push(yyval._$);
8290 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
8291 stack.push(newState);
8292 break;
8293 case 3:
8294 return true;
8295 }
8296 }
8297 return true;
8298}};
8299/* generated by jison-lex 0.3.4 */
8300var lexer = (function(){
8301var lexer = ({
8302
8303EOF:1,
8304
8305parseError:function parseError(str, hash) {
8306 if (this.yy.parser) {
8307 this.yy.parser.parseError(str, hash);
8308 } else {
8309 throw new Error(str);
8310 }
8311 },
8312
8313// resets the lexer, sets new input
8314setInput:function (input, yy) {
8315 this.yy = yy || this.yy || {};
8316 this._input = input;
8317 this._more = this._backtrack = this.done = false;
8318 this.yylineno = this.yyleng = 0;
8319 this.yytext = this.matched = this.match = '';
8320 this.conditionStack = ['INITIAL'];
8321 this.yylloc = {
8322 first_line: 1,
8323 first_column: 0,
8324 last_line: 1,
8325 last_column: 0
8326 };
8327 if (this.options.ranges) {
8328 this.yylloc.range = [0,0];
8329 }
8330 this.offset = 0;
8331 return this;
8332 },
8333
8334// consumes and returns one char from the input
8335input:function () {
8336 var ch = this._input[0];
8337 this.yytext += ch;
8338 this.yyleng++;
8339 this.offset++;
8340 this.match += ch;
8341 this.matched += ch;
8342 var lines = ch.match(/(?:\r\n?|\n).*/g);
8343 if (lines) {
8344 this.yylineno++;
8345 this.yylloc.last_line++;
8346 } else {
8347 this.yylloc.last_column++;
8348 }
8349 if (this.options.ranges) {
8350 this.yylloc.range[1]++;
8351 }
8352
8353 this._input = this._input.slice(1);
8354 return ch;
8355 },
8356
8357// unshifts one char (or a string) into the input
8358unput:function (ch) {
8359 var len = ch.length;
8360 var lines = ch.split(/(?:\r\n?|\n)/g);
8361
8362 this._input = ch + this._input;
8363 this.yytext = this.yytext.substr(0, this.yytext.length - len);
8364 //this.yyleng -= len;
8365 this.offset -= len;
8366 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
8367 this.match = this.match.substr(0, this.match.length - 1);
8368 this.matched = this.matched.substr(0, this.matched.length - 1);
8369
8370 if (lines.length - 1) {
8371 this.yylineno -= lines.length - 1;
8372 }
8373 var r = this.yylloc.range;
8374
8375 this.yylloc = {
8376 first_line: this.yylloc.first_line,
8377 last_line: this.yylineno + 1,
8378 first_column: this.yylloc.first_column,
8379 last_column: lines ?
8380 (lines.length === oldLines.length ? this.yylloc.first_column : 0)
8381 + oldLines[oldLines.length - lines.length].length - lines[0].length :
8382 this.yylloc.first_column - len
8383 };
8384
8385 if (this.options.ranges) {
8386 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
8387 }
8388 this.yyleng = this.yytext.length;
8389 return this;
8390 },
8391
8392// When called from action, caches matched text and appends it on next action
8393more:function () {
8394 this._more = true;
8395 return this;
8396 },
8397
8398// 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.
8399reject:function () {
8400 if (this.options.backtrack_lexer) {
8401 this._backtrack = true;
8402 } else {
8403 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(), {
8404 text: "",
8405 token: null,
8406 line: this.yylineno
8407 });
8408
8409 }
8410 return this;
8411 },
8412
8413// retain first n characters of the match
8414less:function (n) {
8415 this.unput(this.match.slice(n));
8416 },
8417
8418// displays already matched input, i.e. for error messages
8419pastInput:function () {
8420 var past = this.matched.substr(0, this.matched.length - this.match.length);
8421 return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
8422 },
8423
8424// displays upcoming input, i.e. for error messages
8425upcomingInput:function () {
8426 var next = this.match;
8427 if (next.length < 20) {
8428 next += this._input.substr(0, 20-next.length);
8429 }
8430 return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
8431 },
8432
8433// displays the character position where the lexing error occurred, i.e. for error messages
8434showPosition:function () {
8435 var pre = this.pastInput();
8436 var c = new Array(pre.length + 1).join("-");
8437 return pre + this.upcomingInput() + "\n" + c + "^";
8438 },
8439
8440// test the lexed token: return FALSE when not a match, otherwise return token
8441test_match:function(match, indexed_rule) {
8442 var token,
8443 lines,
8444 backup;
8445
8446 if (this.options.backtrack_lexer) {
8447 // save context
8448 backup = {
8449 yylineno: this.yylineno,
8450 yylloc: {
8451 first_line: this.yylloc.first_line,
8452 last_line: this.last_line,
8453 first_column: this.yylloc.first_column,
8454 last_column: this.yylloc.last_column
8455 },
8456 yytext: this.yytext,
8457 match: this.match,
8458 matches: this.matches,
8459 matched: this.matched,
8460 yyleng: this.yyleng,
8461 offset: this.offset,
8462 _more: this._more,
8463 _input: this._input,
8464 yy: this.yy,
8465 conditionStack: this.conditionStack.slice(0),
8466 done: this.done
8467 };
8468 if (this.options.ranges) {
8469 backup.yylloc.range = this.yylloc.range.slice(0);
8470 }
8471 }
8472
8473 lines = match[0].match(/(?:\r\n?|\n).*/g);
8474 if (lines) {
8475 this.yylineno += lines.length;
8476 }
8477 this.yylloc = {
8478 first_line: this.yylloc.last_line,
8479 last_line: this.yylineno + 1,
8480 first_column: this.yylloc.last_column,
8481 last_column: lines ?
8482 lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
8483 this.yylloc.last_column + match[0].length
8484 };
8485 this.yytext += match[0];
8486 this.match += match[0];
8487 this.matches = match;
8488 this.yyleng = this.yytext.length;
8489 if (this.options.ranges) {
8490 this.yylloc.range = [this.offset, this.offset += this.yyleng];
8491 }
8492 this._more = false;
8493 this._backtrack = false;
8494 this._input = this._input.slice(match[0].length);
8495 this.matched += match[0];
8496 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
8497 if (this.done && this._input) {
8498 this.done = false;
8499 }
8500 if (token) {
8501 return token;
8502 } else if (this._backtrack) {
8503 // recover context
8504 for (var k in backup) {
8505 this[k] = backup[k];
8506 }
8507 return false; // rule action called reject() implying the next rule should be tested instead.
8508 }
8509 return false;
8510 },
8511
8512// return next match in input
8513next:function () {
8514 if (this.done) {
8515 return this.EOF;
8516 }
8517 if (!this._input) {
8518 this.done = true;
8519 }
8520
8521 var token,
8522 match,
8523 tempMatch,
8524 index;
8525 if (!this._more) {
8526 this.yytext = '';
8527 this.match = '';
8528 }
8529 var rules = this._currentRules();
8530 for (var i = 0; i < rules.length; i++) {
8531 tempMatch = this._input.match(this.rules[rules[i]]);
8532 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
8533 match = tempMatch;
8534 index = i;
8535 if (this.options.backtrack_lexer) {
8536 token = this.test_match(tempMatch, rules[i]);
8537 if (token !== false) {
8538 return token;
8539 } else if (this._backtrack) {
8540 match = false;
8541 continue; // rule action called reject() implying a rule MISmatch.
8542 } else {
8543 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
8544 return false;
8545 }
8546 } else if (!this.options.flex) {
8547 break;
8548 }
8549 }
8550 }
8551 if (match) {
8552 token = this.test_match(match, rules[index]);
8553 if (token !== false) {
8554 return token;
8555 }
8556 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
8557 return false;
8558 }
8559 if (this._input === "") {
8560 return this.EOF;
8561 } else {
8562 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
8563 text: "",
8564 token: null,
8565 line: this.yylineno
8566 });
8567 }
8568 },
8569
8570// return next match that has a token
8571lex:function lex () {
8572 var r = this.next();
8573 if (r) {
8574 return r;
8575 } else {
8576 return this.lex();
8577 }
8578 },
8579
8580// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
8581begin:function begin (condition) {
8582 this.conditionStack.push(condition);
8583 },
8584
8585// pop the previously active lexer condition state off the condition stack
8586popState:function popState () {
8587 var n = this.conditionStack.length - 1;
8588 if (n > 0) {
8589 return this.conditionStack.pop();
8590 } else {
8591 return this.conditionStack[0];
8592 }
8593 },
8594
8595// produce the lexer rule set which is active for the currently active lexer condition state
8596_currentRules:function _currentRules () {
8597 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
8598 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
8599 } else {
8600 return this.conditions["INITIAL"].rules;
8601 }
8602 },
8603
8604// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
8605topState:function topState (n) {
8606 n = this.conditionStack.length - 1 - Math.abs(n || 0);
8607 if (n >= 0) {
8608 return this.conditionStack[n];
8609 } else {
8610 return "INITIAL";
8611 }
8612 },
8613
8614// alias for begin(condition)
8615pushState:function pushState (condition) {
8616 this.begin(condition);
8617 },
8618
8619// return the number of states currently on the stack
8620stateStackSize:function stateStackSize() {
8621 return this.conditionStack.length;
8622 },
8623options: {"case-insensitive":true},
8624performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
8625 // Pre-lexer code can go here
8626
8627var YYSTATE=YY_START;
8628switch($avoiding_name_collisions) {
8629case 0:/* do nothing */
8630break;
8631case 1:/* skip whitespace */
8632break;
8633case 2:return 4 ;
8634break;
8635case 3:return 9 ;
8636break;
8637case 4:return 'space';
8638break;
8639case 5:return 12;
8640break;
8641case 6:/*console.log('begin str');*/this.begin("string");
8642break;
8643case 7:/*console.log('pop-state');*/this.popState();
8644break;
8645case 8:/*console.log('ending string')*/return "STR";
8646break;
8647case 9:return "VALUE";
8648break;
8649case 10:return 6 ;
8650break;
8651}
8652},
8653rules: [/^(?:%%[^\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],
8654conditions: {"string":{"rules":[7,8],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,5,6,9,10],"inclusive":true}}
8655});
8656return lexer;
8657})();
8658parser.lexer = lexer;
8659function Parser () {
8660 this.yy = {};
8661}
8662Parser.prototype = parser;parser.Parser = Parser;
8663return new Parser;
8664})();
8665
8666
8667if (true) {
8668exports.parser = parser;
8669exports.Parser = parser.Parser;
8670exports.parse = function () { return parser.parse.apply(parser, arguments); };
8671exports.main = function commonjsMain (args) {
8672 if (!args[1]) {
8673 console.log('Usage: '+args[0]+' FILE');
8674 process.exit(1);
8675 }
8676 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");
8677 return exports.parser.parse(source);
8678};
8679if ( true && __webpack_require__.c[__webpack_require__.s] === module) {
8680 exports.main(process.argv.slice(1));
8681}
8682}
8683/* 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)))
8684
8685/***/ }),
8686
8687/***/ "./src/diagrams/pie/pieDb.js":
8688/*!***********************************!*\
8689 !*** ./src/diagrams/pie/pieDb.js ***!
8690 \***********************************/
8691/*! exports provided: default */
8692/***/ (function(module, __webpack_exports__, __webpack_require__) {
8693
8694"use strict";
8695__webpack_require__.r(__webpack_exports__);
8696/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
8697/**
8698 *
8699 */
8700
8701let sections = {};
8702let title = '';
8703
8704const addSection = function (id, value) {
8705 if (typeof sections[id] === 'undefined') {
8706 sections[id] = value;
8707 _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Added new section :', id); // console.log('Added new section:', id, value)
8708 }
8709};
8710
8711const getSections = () => sections;
8712
8713const setTitle = function (txt) {
8714 title = txt;
8715};
8716
8717const getTitle = function () {
8718 return title;
8719};
8720
8721const cleanupValue = function (value) {
8722 if (value.substring(0, 1) === ':') {
8723 value = value.substring(1).trim();
8724 return Number(value.trim());
8725 } else {
8726 return Number(value.trim());
8727 }
8728};
8729
8730const clear = function () {
8731 sections = {};
8732 title = '';
8733}; // export const parseError = (err, hash) => {
8734// global.mermaidAPI.parseError(err, hash)
8735// }
8736
8737
8738/* harmony default export */ __webpack_exports__["default"] = ({
8739 addSection,
8740 getSections,
8741 cleanupValue,
8742 clear,
8743 setTitle,
8744 getTitle // parseError
8745
8746});
8747
8748/***/ }),
8749
8750/***/ "./src/diagrams/pie/pieRenderer.js":
8751/*!*****************************************!*\
8752 !*** ./src/diagrams/pie/pieRenderer.js ***!
8753 \*****************************************/
8754/*! exports provided: setConf, draw, default */
8755/***/ (function(module, __webpack_exports__, __webpack_require__) {
8756
8757"use strict";
8758__webpack_require__.r(__webpack_exports__);
8759/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; });
8760/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; });
8761/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
8762/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
8763/* harmony import */ var _pieDb__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pieDb */ "./src/diagrams/pie/pieDb.js");
8764/* harmony import */ var _parser_pie__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./parser/pie */ "./src/diagrams/pie/parser/pie.jison");
8765/* harmony import */ var _parser_pie__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_parser_pie__WEBPACK_IMPORTED_MODULE_2__);
8766/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
8767/**
8768 * Created by AshishJ on 11-09-2019.
8769 */
8770
8771
8772
8773
8774const conf = {};
8775const setConf = function (cnf) {
8776 const keys = Object.keys(cnf);
8777 keys.forEach(function (key) {
8778 conf[key] = cnf[key];
8779 });
8780};
8781/**
8782 * Draws a Pie Chart with the data given in text.
8783 * @param text
8784 * @param id
8785 */
8786
8787let w;
8788const draw = (txt, id, ver) => {
8789 try {
8790 const parser = _parser_pie__WEBPACK_IMPORTED_MODULE_2___default.a.parser;
8791 parser.yy = _pieDb__WEBPACK_IMPORTED_MODULE_1__["default"];
8792 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Rendering info diagram\n' + txt); // Parse the Pie Chart definition
8793
8794 parser.yy.clear();
8795 parser.parse(txt);
8796 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Parsed info diagram');
8797 const elem = document.getElementById(id);
8798 w = elem.parentElement.offsetWidth;
8799
8800 if (typeof w === 'undefined') {
8801 w = 1200;
8802 }
8803
8804 if (typeof conf.useWidth !== 'undefined') {
8805 w = conf.useWidth;
8806 }
8807
8808 const h = 450;
8809 elem.setAttribute('height', '100%'); // Set viewBox
8810
8811 elem.setAttribute('viewBox', '0 0 ' + w + ' ' + h); // Fetch the default direction, use TD if none was found
8812
8813 var width = w; // 450
8814
8815 var height = 450;
8816 var margin = 40;
8817 var radius = Math.min(width, height) / 2 - margin;
8818 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 + ')');
8819 var data = _pieDb__WEBPACK_IMPORTED_MODULE_1__["default"].getSections();
8820 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info(data); // set the color scale
8821
8822 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:
8823
8824 var pie = d3__WEBPACK_IMPORTED_MODULE_0__["pie"]().value(function (d) {
8825 return d.value;
8826 });
8827 var dataReady = pie(d3__WEBPACK_IMPORTED_MODULE_0__["entries"](data)); // Now I know that group A goes from 0 degrees to x degrees and so on.
8828 // shape helper to build arcs:
8829
8830 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.
8831
8832 svg.selectAll('mySlices').data(dataReady).enter().append('path').attr('d', arcGenerator).attr('fill', function (d) {
8833 return color(d.data.key);
8834 }).attr('stroke', 'black').style('stroke-width', '2px').style('opacity', 0.7); // Now add the annotation. Use the centroid method to get the best coordinates
8835
8836 svg.selectAll('mySlices').data(dataReady).enter().append('text').text(function (d) {
8837 return d.data.key;
8838 }).attr('transform', function (d) {
8839 return 'translate(' + arcGenerator.centroid(d) + ')';
8840 }).style('text-anchor', 'middle').style('font-size', 17);
8841 svg.append('text').text(parser.yy.getTitle()).attr('x', 0).attr('y', -(h - 50) / 2).attr('class', 'pieTitleText');
8842 } catch (e) {
8843 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].error('Error while rendering info diagram');
8844 _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].error(e.message);
8845 }
8846};
8847/* harmony default export */ __webpack_exports__["default"] = ({
8848 setConf,
8849 draw
8850});
8851
8852/***/ }),
8853
8854/***/ "./src/diagrams/sequence/parser/sequenceDiagram.jison":
8855/*!************************************************************!*\
8856 !*** ./src/diagrams/sequence/parser/sequenceDiagram.jison ***!
8857 \************************************************************/
8858/*! no static exports found */
8859/***/ (function(module, exports, __webpack_require__) {
8860
8861/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */
8862/*
8863 Returns a Parser object of the following structure:
8864
8865 Parser: {
8866 yy: {}
8867 }
8868
8869 Parser.prototype: {
8870 yy: {},
8871 trace: function(),
8872 symbols_: {associative list: name ==> number},
8873 terminals_: {associative list: number ==> name},
8874 productions_: [...],
8875 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
8876 table: [...],
8877 defaultActions: {...},
8878 parseError: function(str, hash),
8879 parse: function(input),
8880
8881 lexer: {
8882 EOF: 1,
8883 parseError: function(str, hash),
8884 setInput: function(input),
8885 input: function(),
8886 unput: function(str),
8887 more: function(),
8888 less: function(n),
8889 pastInput: function(),
8890 upcomingInput: function(),
8891 showPosition: function(),
8892 test_match: function(regex_match_array, rule_index),
8893 next: function(),
8894 lex: function(),
8895 begin: function(condition),
8896 popState: function(),
8897 _currentRules: function(),
8898 topState: function(),
8899 pushState: function(condition),
8900
8901 options: {
8902 ranges: boolean (optional: true ==> token location info will include a .range[] member)
8903 flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
8904 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)
8905 },
8906
8907 performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
8908 rules: [...],
8909 conditions: {associative list: name ==> set},
8910 }
8911 }
8912
8913
8914 token location info (@$, _$, etc.): {
8915 first_line: n,
8916 last_line: n,
8917 first_column: n,
8918 last_column: n,
8919 range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
8920 }
8921
8922
8923 the parseError function receives a 'hash' object with these members for lexer and parser errors: {
8924 text: (matched text)
8925 token: (the produced terminal token, if any)
8926 line: (yylineno)
8927 }
8928 while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
8929 loc: (yylloc)
8930 expected: (string describing the set of expected tokens)
8931 recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
8932 }
8933*/
8934var parser = (function(){
8935var 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];
8936var parser = {trace: function trace () { },
8937yy: {},
8938symbols_: {"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},
8939terminals_: {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"},
8940productions_: [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]],
8941performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
8942/* this == yyval */
8943
8944var $0 = $$.length - 1;
8945switch (yystate) {
8946case 3:
8947 yy.apply($$[$0]);return $$[$0];
8948break;
8949case 4:
8950 this.$ = []
8951break;
8952case 5:
8953$$[$0-1].push($$[$0]);this.$ = $$[$0-1]
8954break;
8955case 6: case 7:
8956 this.$ = $$[$0]
8957break;
8958case 8:
8959 this.$=[];
8960break;
8961case 9:
8962$$[$0-3].description=$$[$0-1]; this.$=$$[$0-3];
8963break;
8964case 10:
8965this.$=$$[$0-1];
8966break;
8967case 12:
8968this.$={type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0-1]};
8969break;
8970case 13:
8971this.$={type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0-1]};
8972break;
8973case 15:
8974this.$=[{type:'setTitle', text:$$[$0-1]}]
8975break;
8976case 16:
8977
8978 $$[$0-1].unshift({type: 'loopStart', loopText:$$[$0-2], signalType: yy.LINETYPE.LOOP_START});
8979 $$[$0-1].push({type: 'loopEnd', loopText:$$[$0-2], signalType: yy.LINETYPE.LOOP_END});
8980 this.$=$$[$0-1];
8981break;
8982case 17:
8983
8984 $$[$0-1].unshift({type: 'rectStart', color:$$[$0-2], signalType: yy.LINETYPE.RECT_START });
8985 $$[$0-1].push({type: 'rectEnd', color:$$[$0-2], signalType: yy.LINETYPE.RECT_END });
8986 this.$=$$[$0-1];
8987break;
8988case 18:
8989
8990 $$[$0-1].unshift({type: 'optStart', optText:$$[$0-2], signalType: yy.LINETYPE.OPT_START});
8991 $$[$0-1].push({type: 'optEnd', optText:$$[$0-2], signalType: yy.LINETYPE.OPT_END});
8992 this.$=$$[$0-1];
8993break;
8994case 19:
8995
8996 // Alt start
8997 $$[$0-1].unshift({type: 'altStart', altText:$$[$0-2], signalType: yy.LINETYPE.ALT_START});
8998 // Content in alt is already in $$[$0-1]
8999 // End
9000 $$[$0-1].push({type: 'altEnd', signalType: yy.LINETYPE.ALT_END});
9001 this.$=$$[$0-1];
9002break;
9003case 20:
9004
9005 // Parallel start
9006 $$[$0-1].unshift({type: 'parStart', parText:$$[$0-2], signalType: yy.LINETYPE.PAR_START});
9007 // Content in par is already in $$[$0-1]
9008 // End
9009 $$[$0-1].push({type: 'parEnd', signalType: yy.LINETYPE.PAR_END});
9010 this.$=$$[$0-1];
9011break;
9012case 22:
9013 this.$ = $$[$0-3].concat([{type: 'and', parText:$$[$0-1], signalType: yy.LINETYPE.PAR_AND}, $$[$0]]);
9014break;
9015case 24:
9016 this.$ = $$[$0-3].concat([{type: 'else', altText:$$[$0-1], signalType: yy.LINETYPE.ALT_ELSE}, $$[$0]]);
9017break;
9018case 25:
9019
9020 this.$ = [$$[$0-1], {type:'addNote', placement:$$[$0-2], actor:$$[$0-1].actor, text:$$[$0]}];
9021break;
9022case 26:
9023
9024 // Coerce actor_pair into a [to, from, ...] array
9025 $$[$0-2] = [].concat($$[$0-1], $$[$0-1]).slice(0, 2);
9026 $$[$0-2][0] = $$[$0-2][0].actor;
9027 $$[$0-2][1] = $$[$0-2][1].actor;
9028 this.$ = [$$[$0-1], {type:'addNote', placement:yy.PLACEMENT.OVER, actor:$$[$0-2].slice(0, 2), text:$$[$0]}];
9029break;
9030case 29:
9031 this.$ = [$$[$0-2], $$[$0]];
9032break;
9033case 30:
9034 this.$ = $$[$0];
9035break;
9036case 31:
9037 this.$ = yy.PLACEMENT.LEFTOF;
9038break;
9039case 32:
9040 this.$ = yy.PLACEMENT.RIGHTOF;
9041break;
9042case 33:
9043 this.$ = [$$[$0-4],$$[$0-1],{type: 'addMessage', from:$$[$0-4].actor, to:$$[$0-1].actor, signalType:$$[$0-3], msg:$$[$0]},
9044 {type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0-1]}
9045 ]
9046break;
9047case 34:
9048 this.$ = [$$[$0-4],$$[$0-1],{type: 'addMessage', from:$$[$0-4].actor, to:$$[$0-1].actor, signalType:$$[$0-3], msg:$$[$0]},
9049 {type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0-4]}
9050 ]
9051break;
9052case 35:
9053 this.$ = [$$[$0-3],$$[$0-1],{type: 'addMessage', from:$$[$0-3].actor, to:$$[$0-1].actor, signalType:$$[$0-2], msg:$$[$0]}]
9054break;
9055case 36:
9056this.$={type: 'addActor', actor:$$[$0]}
9057break;
9058case 37:
9059 this.$ = yy.LINETYPE.SOLID_OPEN;
9060break;
9061case 38:
9062 this.$ = yy.LINETYPE.DOTTED_OPEN;
9063break;
9064case 39:
9065 this.$ = yy.LINETYPE.SOLID;
9066break;
9067case 40:
9068 this.$ = yy.LINETYPE.DOTTED;
9069break;
9070case 41:
9071 this.$ = yy.LINETYPE.SOLID_CROSS;
9072break;
9073case 42:
9074 this.$ = yy.LINETYPE.DOTTED_CROSS;
9075break;
9076case 43:
9077this.$ = $$[$0].substring(1).trim().replace(/\\n/gm, "\n");
9078break;
9079}
9080},
9081table: [{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]}],
9082defaultActions: {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]},
9083parseError: function parseError (str, hash) {
9084 if (hash.recoverable) {
9085 this.trace(str);
9086 } else {
9087 var error = new Error(str);
9088 error.hash = hash;
9089 throw error;
9090 }
9091},
9092parse: function parse(input) {
9093 var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
9094 var args = lstack.slice.call(arguments, 1);
9095 var lexer = Object.create(this.lexer);
9096 var sharedState = { yy: {} };
9097 for (var k in this.yy) {
9098 if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
9099 sharedState.yy[k] = this.yy[k];
9100 }
9101 }
9102 lexer.setInput(input, sharedState.yy);
9103 sharedState.yy.lexer = lexer;
9104 sharedState.yy.parser = this;
9105 if (typeof lexer.yylloc == 'undefined') {
9106 lexer.yylloc = {};
9107 }
9108 var yyloc = lexer.yylloc;
9109 lstack.push(yyloc);
9110 var ranges = lexer.options && lexer.options.ranges;
9111 if (typeof sharedState.yy.parseError === 'function') {
9112 this.parseError = sharedState.yy.parseError;
9113 } else {
9114 this.parseError = Object.getPrototypeOf(this).parseError;
9115 }
9116 function popStack(n) {
9117 stack.length = stack.length - 2 * n;
9118 vstack.length = vstack.length - n;
9119 lstack.length = lstack.length - n;
9120 }
9121 function lex() {
9122 var token;
9123 token = tstack.pop() || lexer.lex() || EOF;
9124 if (typeof token !== 'number') {
9125 if (token instanceof Array) {
9126 tstack = token;
9127 token = tstack.pop();
9128 }
9129 token = self.symbols_[token] || token;
9130 }
9131 return token;
9132 }
9133 var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
9134 while (true) {
9135 state = stack[stack.length - 1];
9136 if (this.defaultActions[state]) {
9137 action = this.defaultActions[state];
9138 } else {
9139 if (symbol === null || typeof symbol == 'undefined') {
9140 symbol = lex();
9141 }
9142 action = table[state] && table[state][symbol];
9143 }
9144 if (typeof action === 'undefined' || !action.length || !action[0]) {
9145 var errStr = '';
9146 expected = [];
9147 for (p in table[state]) {
9148 if (this.terminals_[p] && p > TERROR) {
9149 expected.push('\'' + this.terminals_[p] + '\'');
9150 }
9151 }
9152 if (lexer.showPosition) {
9153 errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
9154 } else {
9155 errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
9156 }
9157 this.parseError(errStr, {
9158 text: lexer.match,
9159 token: this.terminals_[symbol] || symbol,
9160 line: lexer.yylineno,
9161 loc: yyloc,
9162 expected: expected
9163 });
9164 }
9165 if (action[0] instanceof Array && action.length > 1) {
9166 throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
9167 }
9168 switch (action[0]) {
9169 case 1:
9170 stack.push(symbol);
9171 vstack.push(lexer.yytext);
9172 lstack.push(lexer.yylloc);
9173 stack.push(action[1]);
9174 symbol = null;
9175 if (!preErrorSymbol) {
9176 yyleng = lexer.yyleng;
9177 yytext = lexer.yytext;
9178 yylineno = lexer.yylineno;
9179 yyloc = lexer.yylloc;
9180 if (recovering > 0) {
9181 recovering--;
9182 }
9183 } else {
9184 symbol = preErrorSymbol;
9185 preErrorSymbol = null;
9186 }
9187 break;
9188 case 2:
9189 len = this.productions_[action[1]][1];
9190 yyval.$ = vstack[vstack.length - len];
9191 yyval._$ = {
9192 first_line: lstack[lstack.length - (len || 1)].first_line,
9193 last_line: lstack[lstack.length - 1].last_line,
9194 first_column: lstack[lstack.length - (len || 1)].first_column,
9195 last_column: lstack[lstack.length - 1].last_column
9196 };
9197 if (ranges) {
9198 yyval._$.range = [
9199 lstack[lstack.length - (len || 1)].range[0],
9200 lstack[lstack.length - 1].range[1]
9201 ];
9202 }
9203 r = this.performAction.apply(yyval, [
9204 yytext,
9205 yyleng,
9206 yylineno,
9207 sharedState.yy,
9208 action[1],
9209 vstack,
9210 lstack
9211 ].concat(args));
9212 if (typeof r !== 'undefined') {
9213 return r;
9214 }
9215 if (len) {
9216 stack = stack.slice(0, -1 * len * 2);
9217 vstack = vstack.slice(0, -1 * len);
9218 lstack = lstack.slice(0, -1 * len);
9219 }
9220 stack.push(this.productions_[action[1]][0]);
9221 vstack.push(yyval.$);
9222 lstack.push(yyval._$);
9223 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
9224 stack.push(newState);
9225 break;
9226 case 3:
9227 return true;
9228 }
9229 }
9230 return true;
9231}};
9232
9233/* generated by jison-lex 0.3.4 */
9234var lexer = (function(){
9235var lexer = ({
9236
9237EOF:1,
9238
9239parseError:function parseError(str, hash) {
9240 if (this.yy.parser) {
9241 this.yy.parser.parseError(str, hash);
9242 } else {
9243 throw new Error(str);
9244 }
9245 },
9246
9247// resets the lexer, sets new input
9248setInput:function (input, yy) {
9249 this.yy = yy || this.yy || {};
9250 this._input = input;
9251 this._more = this._backtrack = this.done = false;
9252 this.yylineno = this.yyleng = 0;
9253 this.yytext = this.matched = this.match = '';
9254 this.conditionStack = ['INITIAL'];
9255 this.yylloc = {
9256 first_line: 1,
9257 first_column: 0,
9258 last_line: 1,
9259 last_column: 0
9260 };
9261 if (this.options.ranges) {
9262 this.yylloc.range = [0,0];
9263 }
9264 this.offset = 0;
9265 return this;
9266 },
9267
9268// consumes and returns one char from the input
9269input:function () {
9270 var ch = this._input[0];
9271 this.yytext += ch;
9272 this.yyleng++;
9273 this.offset++;
9274 this.match += ch;
9275 this.matched += ch;
9276 var lines = ch.match(/(?:\r\n?|\n).*/g);
9277 if (lines) {
9278 this.yylineno++;
9279 this.yylloc.last_line++;
9280 } else {
9281 this.yylloc.last_column++;
9282 }
9283 if (this.options.ranges) {
9284 this.yylloc.range[1]++;
9285 }
9286
9287 this._input = this._input.slice(1);
9288 return ch;
9289 },
9290
9291// unshifts one char (or a string) into the input
9292unput:function (ch) {
9293 var len = ch.length;
9294 var lines = ch.split(/(?:\r\n?|\n)/g);
9295
9296 this._input = ch + this._input;
9297 this.yytext = this.yytext.substr(0, this.yytext.length - len);
9298 //this.yyleng -= len;
9299 this.offset -= len;
9300 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
9301 this.match = this.match.substr(0, this.match.length - 1);
9302 this.matched = this.matched.substr(0, this.matched.length - 1);
9303
9304 if (lines.length - 1) {
9305 this.yylineno -= lines.length - 1;
9306 }
9307 var r = this.yylloc.range;
9308
9309 this.yylloc = {
9310 first_line: this.yylloc.first_line,
9311 last_line: this.yylineno + 1,
9312 first_column: this.yylloc.first_column,
9313 last_column: lines ?
9314 (lines.length === oldLines.length ? this.yylloc.first_column : 0)
9315 + oldLines[oldLines.length - lines.length].length - lines[0].length :
9316 this.yylloc.first_column - len
9317 };
9318
9319 if (this.options.ranges) {
9320 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
9321 }
9322 this.yyleng = this.yytext.length;
9323 return this;
9324 },
9325
9326// When called from action, caches matched text and appends it on next action
9327more:function () {
9328 this._more = true;
9329 return this;
9330 },
9331
9332// 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.
9333reject:function () {
9334 if (this.options.backtrack_lexer) {
9335 this._backtrack = true;
9336 } else {
9337 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(), {
9338 text: "",
9339 token: null,
9340 line: this.yylineno
9341 });
9342
9343 }
9344 return this;
9345 },
9346
9347// retain first n characters of the match
9348less:function (n) {
9349 this.unput(this.match.slice(n));
9350 },
9351
9352// displays already matched input, i.e. for error messages
9353pastInput:function () {
9354 var past = this.matched.substr(0, this.matched.length - this.match.length);
9355 return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
9356 },
9357
9358// displays upcoming input, i.e. for error messages
9359upcomingInput:function () {
9360 var next = this.match;
9361 if (next.length < 20) {
9362 next += this._input.substr(0, 20-next.length);
9363 }
9364 return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
9365 },
9366
9367// displays the character position where the lexing error occurred, i.e. for error messages
9368showPosition:function () {
9369 var pre = this.pastInput();
9370 var c = new Array(pre.length + 1).join("-");
9371 return pre + this.upcomingInput() + "\n" + c + "^";
9372 },
9373
9374// test the lexed token: return FALSE when not a match, otherwise return token
9375test_match:function(match, indexed_rule) {
9376 var token,
9377 lines,
9378 backup;
9379
9380 if (this.options.backtrack_lexer) {
9381 // save context
9382 backup = {
9383 yylineno: this.yylineno,
9384 yylloc: {
9385 first_line: this.yylloc.first_line,
9386 last_line: this.last_line,
9387 first_column: this.yylloc.first_column,
9388 last_column: this.yylloc.last_column
9389 },
9390 yytext: this.yytext,
9391 match: this.match,
9392 matches: this.matches,
9393 matched: this.matched,
9394 yyleng: this.yyleng,
9395 offset: this.offset,
9396 _more: this._more,
9397 _input: this._input,
9398 yy: this.yy,
9399 conditionStack: this.conditionStack.slice(0),
9400 done: this.done
9401 };
9402 if (this.options.ranges) {
9403 backup.yylloc.range = this.yylloc.range.slice(0);
9404 }
9405 }
9406
9407 lines = match[0].match(/(?:\r\n?|\n).*/g);
9408 if (lines) {
9409 this.yylineno += lines.length;
9410 }
9411 this.yylloc = {
9412 first_line: this.yylloc.last_line,
9413 last_line: this.yylineno + 1,
9414 first_column: this.yylloc.last_column,
9415 last_column: lines ?
9416 lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
9417 this.yylloc.last_column + match[0].length
9418 };
9419 this.yytext += match[0];
9420 this.match += match[0];
9421 this.matches = match;
9422 this.yyleng = this.yytext.length;
9423 if (this.options.ranges) {
9424 this.yylloc.range = [this.offset, this.offset += this.yyleng];
9425 }
9426 this._more = false;
9427 this._backtrack = false;
9428 this._input = this._input.slice(match[0].length);
9429 this.matched += match[0];
9430 token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
9431 if (this.done && this._input) {
9432 this.done = false;
9433 }
9434 if (token) {
9435 return token;
9436 } else if (this._backtrack) {
9437 // recover context
9438 for (var k in backup) {
9439 this[k] = backup[k];
9440 }
9441 return false; // rule action called reject() implying the next rule should be tested instead.
9442 }
9443 return false;
9444 },
9445
9446// return next match in input
9447next:function () {
9448 if (this.done) {
9449 return this.EOF;
9450 }
9451 if (!this._input) {
9452 this.done = true;
9453 }
9454
9455 var token,
9456 match,
9457 tempMatch,
9458 index;
9459 if (!this._more) {
9460 this.yytext = '';
9461 this.match = '';
9462 }
9463 var rules = this._currentRules();
9464 for (var i = 0; i < rules.length; i++) {
9465 tempMatch = this._input.match(this.rules[rules[i]]);
9466 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
9467 match = tempMatch;
9468 index = i;
9469 if (this.options.backtrack_lexer) {
9470 token = this.test_match(tempMatch, rules[i]);
9471 if (token !== false) {
9472 return token;
9473 } else if (this._backtrack) {
9474 match = false;
9475 continue; // rule action called reject() implying a rule MISmatch.
9476 } else {
9477 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
9478 return false;
9479 }
9480 } else if (!this.options.flex) {
9481 break;
9482 }
9483 }
9484 }
9485 if (match) {
9486 token = this.test_match(match, rules[index]);
9487 if (token !== false) {
9488 return token;
9489 }
9490 // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
9491 return false;
9492 }
9493 if (this._input === "") {
9494 return this.EOF;
9495 } else {
9496 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
9497 text: "",
9498 token: null,
9499 line: this.yylineno
9500 });
9501 }
9502 },
9503
9504// return next match that has a token
9505lex:function lex () {
9506 var r = this.next();
9507 if (r) {
9508 return r;
9509 } else {
9510 return this.lex();
9511 }
9512 },
9513
9514// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
9515begin:function begin (condition) {
9516 this.conditionStack.push(condition);
9517 },
9518
9519// pop the previously active lexer condition state off the condition stack
9520popState:function popState () {
9521 var n = this.conditionStack.length - 1;
9522 if (n > 0) {
9523 return this.conditionStack.pop();
9524 } else {
9525 return this.conditionStack[0];
9526 }
9527 },
9528
9529// produce the lexer rule set which is active for the currently active lexer condition state
9530_currentRules:function _currentRules () {
9531 if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
9532 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
9533 } else {
9534 return this.conditions["INITIAL"].rules;
9535 }
9536 },
9537
9538// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
9539topState:function topState (n) {
9540 n = this.conditionStack.length - 1 - Math.abs(n || 0);
9541 if (n >= 0) {
9542 return this.conditionStack[n];
9543 } else {
9544 return "INITIAL";
9545 }
9546 },
9547
9548// alias for begin(condition)
9549pushState:function pushState (condition) {
9550 this.begin(condition);
9551 },
9552
9553// return the number of states currently on the stack
9554stateStackSize:function stateStackSize() {
9555 return this.conditionStack.length;
9556 },
9557options: {"case-insensitive":true},
9558performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
9559var YYSTATE=YY_START;
9560switch($avoiding_name_collisions) {
9561case 0:return 5;
9562break;
9563case 1:/* skip all whitespace */
9564break;
9565case 2:/* skip same-line whitespace */
9566break;
9567case 3:/* skip comments */
9568break;
9569case 4:/* skip comments */
9570break;
9571case 5: this.begin('ID'); return 10;
9572break;
9573case 6: yy_.yytext = yy_.yytext.trim(); this.begin('ALIAS'); return 41;
9574break;
9575case 7: this.popState(); this.popState(); this.begin('LINE'); return 12;
9576break;
9577case 8: this.popState(); this.popState(); return 5;
9578break;
9579case 9: this.begin('LINE'); return 20;
9580break;
9581case 10: this.begin('LINE'); return 22;
9582break;
9583case 11: this.begin('LINE'); return 23;
9584break;
9585case 12: this.begin('LINE'); return 24;
9586break;
9587case 13: this.begin('LINE'); return 29;
9588break;
9589case 14: this.begin('LINE'); return 26;
9590break;
9591case 15: this.begin('LINE'); return 28;
9592break;
9593case 16: this.popState(); return 13;
9594break;
9595case 17:return 21;
9596break;
9597case 18:return 36;
9598break;
9599case 19:return 37;
9600break;
9601case 20:return 32;
9602break;
9603case 21:return 30;
9604break;
9605case 22: this.begin('ID'); return 15;
9606break;
9607case 23: this.begin('ID'); return 16;
9608break;
9609case 24:return 18;
9610break;
9611case 25:return 6;
9612break;
9613case 26:return 35;
9614break;
9615case 27:return 5;
9616break;
9617case 28: yy_.yytext = yy_.yytext.trim(); return 41;
9618break;
9619case 29:return 44;
9620break;
9621case 30:return 45;
9622break;
9623case 31:return 42;
9624break;
9625case 32:return 43;
9626break;
9627case 33:return 46;
9628break;
9629case 34:return 47;
9630break;
9631case 35:return 48;
9632break;
9633case 36:return 39;
9634break;
9635case 37:return 40;
9636break;
9637case 38:return 5;
9638break;
9639case 39:return 'INVALID';
9640break;
9641}
9642},
9643rules: [/^(?:[\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],
9644conditions: {"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}}
9645});
9646return lexer;
9647})();
9648parser.lexer = lexer;
9649function Parser () {
9650 this.yy = {};
9651}
9652Parser.prototype = parser;parser.Parser = Parser;
9653return new Parser;
9654})();
9655
9656
9657if (true) {
9658exports.parser = parser;
9659exports.Parser = parser.Parser;
9660exports.parse = function () { return parser.parse.apply(parser, arguments); };
9661exports.main = function commonjsMain (args) {
9662 if (!args[1]) {
9663 console.log('Usage: '+args[0]+' FILE');
9664 process.exit(1);
9665 }
9666 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");
9667 return exports.parser.parse(source);
9668};
9669if ( true && __webpack_require__.c[__webpack_require__.s] === module) {
9670 exports.main(process.argv.slice(1));
9671}
9672}
9673/* 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)))
9674
9675/***/ }),
9676
9677/***/ "./src/diagrams/sequence/sequenceDb.js":
9678/*!*********************************************!*\
9679 !*** ./src/diagrams/sequence/sequenceDb.js ***!
9680 \*********************************************/
9681/*! exports provided: addActor, addMessage, addSignal, getMessages, getActors, getActor, getActorKeys, getTitle, clear, LINETYPE, ARROWTYPE, PLACEMENT, addNote, setTitle, apply, default */
9682/***/ (function(module, __webpack_exports__, __webpack_require__) {
9683
9684"use strict";
9685__webpack_require__.r(__webpack_exports__);
9686/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addActor", function() { return addActor; });
9687/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addMessage", function() { return addMessage; });
9688/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addSignal", function() { return addSignal; });
9689/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMessages", function() { return getMessages; });
9690/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getActors", function() { return getActors; });
9691/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getActor", function() { return getActor; });
9692/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getActorKeys", function() { return getActorKeys; });
9693/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTitle", function() { return getTitle; });
9694/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clear", function() { return clear; });
9695/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LINETYPE", function() { return LINETYPE; });
9696/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ARROWTYPE", function() { return ARROWTYPE; });
9697/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PLACEMENT", function() { return PLACEMENT; });
9698/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addNote", function() { return addNote; });
9699/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setTitle", function() { return setTitle; });
9700/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "apply", function() { return apply; });
9701/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
9702
9703let actors = {};
9704let messages = [];
9705const notes = [];
9706let title = '';
9707const addActor = function (id, name, description) {
9708 // Don't allow description nulling
9709 const old = actors[id];
9710 if (old && name === old.name && description == null) return; // Don't allow null descriptions, either
9711
9712 if (description == null) description = name;
9713 actors[id] = {
9714 name: name,
9715 description: description
9716 };
9717};
9718const addMessage = function (idFrom, idTo, message, answer) {
9719 messages.push({
9720 from: idFrom,
9721 to: idTo,
9722 message: message,
9723 answer: answer
9724 });
9725};
9726const addSignal = function (idFrom, idTo, message, messageType) {
9727 _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Adding message from=' + idFrom + ' to=' + idTo + ' message=' + message + ' type=' + messageType);
9728 messages.push({
9729 from: idFrom,
9730 to: idTo,
9731 message: message,
9732 type: messageType
9733 });
9734};
9735const getMessages = function () {
9736 return messages;
9737};
9738const getActors = function () {
9739 return actors;
9740};
9741const getActor = function (id) {
9742 return actors[id];
9743};
9744const getActorKeys = function () {
9745 return Object.keys(actors);
9746};
9747const getTitle = function () {
9748 return title;
9749};
9750const clear = function () {
9751 actors = {};
9752 messages = [];
9753};
9754const LINETYPE = {
9755 SOLID: 0,
9756 DOTTED: 1,
9757 NOTE: 2,
9758 SOLID_CROSS: 3,
9759 DOTTED_CROSS: 4,
9760 SOLID_OPEN: 5,
9761 DOTTED_OPEN: 6,
9762 LOOP_START: 10,
9763 LOOP_END: 11,
9764 ALT_START: 12,
9765 ALT_ELSE: 13,
9766 ALT_END: 14,
9767 OPT_START: 15,
9768 OPT_END: 16,
9769 ACTIVE_START: 17,
9770 ACTIVE_END: 18,
9771 PAR_START: 19,
9772 PAR_AND: 20,
9773 PAR_END: 21,
9774 RECT_START: 22,
9775 RECT_END: 23
9776};
9777const ARROWTYPE = {
9778 FILLED: 0,
9779 OPEN: 1
9780};
9781const PLACEMENT = {
9782 LEFTOF: 0,
9783 RIGHTOF: 1,
9784 OVER: 2
9785};
9786const addNote = function (actor, placement, message) {
9787 const note = {
9788 actor: actor,
9789 placement: placement,
9790 message: message
9791 }; // Coerce actor into a [to, from, ...] array
9792
9793 const actors = [].concat(actor, actor);
9794 notes.push(note);
9795 messages.push({
9796 from: actors[0],
9797 to: actors[1],
9798 message: message,
9799 type: LINETYPE.NOTE,
9800 placement: placement
9801 });
9802};
9803const setTitle = function (titleText) {
9804 title = titleText;
9805};
9806const apply = function (param) {
9807 if (param instanceof Array) {
9808 param.forEach(function (item) {
9809 apply(item);
9810 });
9811 } else {
9812 switch (param.type) {
9813 case 'addActor':
9814 addActor(param.actor, param.actor, param.description);
9815 break;
9816
9817 case 'activeStart':
9818 addSignal(param.actor, undefined, undefined, param.signalType);
9819 break;
9820
9821 case 'activeEnd':
9822 addSignal(param.actor, undefined, undefined, param.signalType);
9823 break;
9824
9825 case 'addNote':
9826 addNote(param.actor, param.placement, param.text);
9827 break;
9828
9829 case 'addMessage':
9830 addSignal(param.from, param.to, param.msg, param.signalType);
9831 break;
9832
9833 case 'loopStart':
9834 addSignal(undefined, undefined, param.loopText, param.signalType);
9835 break;
9836
9837 case 'loopEnd':
9838 addSignal(undefined, undefined, undefined, param.signalType);
9839 break;
9840
9841 case 'rectStart':
9842 addSignal(undefined, undefined, param.color, param.signalType);
9843 break;
9844
9845 case 'rectEnd':
9846 addSignal(undefined, undefined, undefined, param.signalType);
9847 break;
9848
9849 case 'optStart':
9850 addSignal(undefined, undefined, param.optText, param.signalType);
9851 break;
9852
9853 case 'optEnd':
9854 addSignal(undefined, undefined, undefined, param.signalType);
9855 break;
9856
9857 case 'altStart':
9858 addSignal(undefined, undefined, param.altText, param.signalType);
9859 break;
9860
9861 case 'else':
9862 addSignal(undefined, undefined, param.altText, param.signalType);
9863 break;
9864
9865 case 'altEnd':
9866 addSignal(undefined, undefined, undefined, param.signalType);
9867 break;
9868
9869 case 'setTitle':
9870 setTitle(param.text);
9871 break;
9872
9873 case 'parStart':
9874 addSignal(undefined, undefined, param.parText, param.signalType);
9875 break;
9876
9877 case 'and':
9878 addSignal(undefined, undefined, param.parText, param.signalType);
9879 break;
9880
9881 case 'parEnd':
9882 addSignal(undefined, undefined, undefined, param.signalType);
9883 break;
9884 }
9885 }
9886};
9887/* harmony default export */ __webpack_exports__["default"] = ({
9888 addActor,
9889 addMessage,
9890 addSignal,
9891 getMessages,
9892 getActors,
9893 getActor,
9894 getActorKeys,
9895 getTitle,
9896 clear,
9897 LINETYPE,
9898 ARROWTYPE,
9899 PLACEMENT,
9900 addNote,
9901 setTitle,
9902 apply
9903});
9904
9905/***/ }),
9906
9907/***/ "./src/diagrams/sequence/sequenceRenderer.js":
9908/*!***************************************************!*\
9909 !*** ./src/diagrams/sequence/sequenceRenderer.js ***!
9910 \***************************************************/
9911/*! exports provided: bounds, drawActors, setConf, draw, default */
9912/***/ (function(module, __webpack_exports__, __webpack_require__) {
9913
9914"use strict";
9915__webpack_require__.r(__webpack_exports__);
9916/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bounds", function() { return bounds; });
9917/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawActors", function() { return drawActors; });
9918/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; });
9919/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; });
9920/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
9921/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
9922/* harmony import */ var _svgDraw__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./svgDraw */ "./src/diagrams/sequence/svgDraw.js");
9923/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
9924/* harmony import */ var _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parser/sequenceDiagram */ "./src/diagrams/sequence/parser/sequenceDiagram.jison");
9925/* harmony import */ var _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__);
9926/* harmony import */ var _sequenceDb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./sequenceDb */ "./src/diagrams/sequence/sequenceDb.js");
9927
9928
9929
9930
9931
9932_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy = _sequenceDb__WEBPACK_IMPORTED_MODULE_4__["default"];
9933const conf = {
9934 diagramMarginX: 50,
9935 diagramMarginY: 30,
9936 // Margin between actors
9937 actorMargin: 50,
9938 // Width of actor boxes
9939 width: 150,
9940 // Height of actor boxes
9941 height: 65,
9942 actorFontSize: 14,
9943 actorFontFamily: '"Open-Sans", "sans-serif"',
9944 // Margin around loop boxes
9945 boxMargin: 10,
9946 boxTextMargin: 5,
9947 noteMargin: 10,
9948 // Space between messages
9949 messageMargin: 35,
9950 // mirror actors under diagram
9951 mirrorActors: false,
9952 // Depending on css styling this might need adjustment
9953 // Prolongs the edge of the diagram downwards
9954 bottomMarginAdj: 1,
9955 // width of activation box
9956 activationWidth: 10,
9957 // text placement as: tspan | fo | old only text as before
9958 textPlacement: 'tspan',
9959 showSequenceNumbers: false
9960};
9961const bounds = {
9962 data: {
9963 startx: undefined,
9964 stopx: undefined,
9965 starty: undefined,
9966 stopy: undefined
9967 },
9968 verticalPos: 0,
9969 sequenceItems: [],
9970 activations: [],
9971 init: function () {
9972 this.sequenceItems = [];
9973 this.activations = [];
9974 this.data = {
9975 startx: undefined,
9976 stopx: undefined,
9977 starty: undefined,
9978 stopy: undefined
9979 };
9980 this.verticalPos = 0;
9981 },
9982 updateVal: function (obj, key, val, fun) {
9983 if (typeof obj[key] === 'undefined') {
9984 obj[key] = val;
9985 } else {
9986 obj[key] = fun(val, obj[key]);
9987 }
9988 },
9989 updateBounds: function (startx, starty, stopx, stopy) {
9990 const _self = this;
9991
9992 let cnt = 0;
9993
9994 function updateFn(type) {
9995 return function updateItemBounds(item) {
9996 cnt++; // The loop sequenceItems is a stack so the biggest margins in the beginning of the sequenceItems
9997
9998 const n = _self.sequenceItems.length - cnt + 1;
9999
10000 _self.updateVal(item, 'starty', starty - n * conf.boxMargin, Math.min);
10001
10002 _self.updateVal(item, 'stopy', stopy + n * conf.boxMargin, Math.max);
10003
10004 _self.updateVal(bounds.data, 'startx', startx - n * conf.boxMargin, Math.min);
10005
10006 _self.updateVal(bounds.data, 'stopx', stopx + n * conf.boxMargin, Math.max);
10007
10008 if (!(type === 'activation')) {
10009 _self.updateVal(item, 'startx', startx - n * conf.boxMargin, Math.min);
10010
10011 _self.updateVal(item, 'stopx', stopx + n * conf.boxMargin, Math.max);
10012
10013 _self.updateVal(bounds.data, 'starty', starty - n * conf.boxMargin, Math.min);
10014
10015 _self.updateVal(bounds.data, 'stopy', stopy + n * conf.boxMargin, Math.max);
10016 }
10017 };
10018 }
10019
10020 this.sequenceItems.forEach(updateFn());
10021 this.activations.forEach(updateFn('activation'));
10022 },
10023 insert: function (startx, starty, stopx, stopy) {
10024 const _startx = Math.min(startx, stopx);
10025
10026 const _stopx = Math.max(startx, stopx);
10027
10028 const _starty = Math.min(starty, stopy);
10029
10030 const _stopy = Math.max(starty, stopy);
10031
10032 this.updateVal(bounds.data, 'startx', _startx, Math.min);
10033 this.updateVal(bounds.data, 'starty', _starty, Math.min);
10034 this.updateVal(bounds.data, 'stopx', _stopx, Math.max);
10035 this.updateVal(bounds.data, 'stopy', _stopy, Math.max);
10036 this.updateBounds(_startx, _starty, _stopx, _stopy);
10037 },
10038 newActivation: function (message, diagram) {
10039 const actorRect = _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.getActors()[message.from.actor];
10040 const stackedSize = actorActivations(message.from.actor).length;
10041 const x = actorRect.x + conf.width / 2 + (stackedSize - 1) * conf.activationWidth / 2;
10042 this.activations.push({
10043 startx: x,
10044 starty: this.verticalPos + 2,
10045 stopx: x + conf.activationWidth,
10046 stopy: undefined,
10047 actor: message.from.actor,
10048 anchored: _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].anchorElement(diagram)
10049 });
10050 },
10051 endActivation: function (message) {
10052 // find most recent activation for given actor
10053 const lastActorActivationIdx = this.activations.map(function (activation) {
10054 return activation.actor;
10055 }).lastIndexOf(message.from.actor);
10056 const activation = this.activations.splice(lastActorActivationIdx, 1)[0];
10057 return activation;
10058 },
10059 newLoop: function (title, fill) {
10060 this.sequenceItems.push({
10061 startx: undefined,
10062 starty: this.verticalPos,
10063 stopx: undefined,
10064 stopy: undefined,
10065 title: title,
10066 fill: fill
10067 });
10068 },
10069 endLoop: function () {
10070 const loop = this.sequenceItems.pop();
10071 return loop;
10072 },
10073 addSectionToLoop: function (message) {
10074 const loop = this.sequenceItems.pop();
10075 loop.sections = loop.sections || [];
10076 loop.sectionTitles = loop.sectionTitles || [];
10077 loop.sections.push(bounds.getVerticalPos());
10078 loop.sectionTitles.push(message);
10079 this.sequenceItems.push(loop);
10080 },
10081 bumpVerticalPos: function (bump) {
10082 this.verticalPos = this.verticalPos + bump;
10083 this.data.stopy = this.verticalPos;
10084 },
10085 getVerticalPos: function () {
10086 return this.verticalPos;
10087 },
10088 getBounds: function () {
10089 return this.data;
10090 }
10091};
10092
10093const _drawLongText = (text, x, y, g, width) => {
10094 let textHeight = 0;
10095 const lines = text.split(/<br\/?>/gi);
10096
10097 for (const line of lines) {
10098 const textObj = _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].getTextObj();
10099 textObj.x = x;
10100 textObj.y = y + textHeight;
10101 textObj.textMargin = conf.noteMargin;
10102 textObj.dy = '1em';
10103 textObj.text = line;
10104 textObj.class = 'noteText';
10105 const textElem = _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawText(g, textObj, width);
10106 textHeight += (textElem._groups || textElem)[0][0].getBBox().height;
10107 }
10108
10109 return textHeight;
10110};
10111/**
10112 * Draws an actor in the diagram with the attaced line
10113 * @param center - The center of the the actor
10114 * @param pos The position if the actor in the liost of actors
10115 * @param description The text in the box
10116 */
10117
10118
10119const drawNote = function (elem, startx, verticalPos, msg, forceWidth) {
10120 const rect = _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].getNoteRect();
10121 rect.x = startx;
10122 rect.y = verticalPos;
10123 rect.width = forceWidth || conf.width;
10124 rect.class = 'note';
10125 let g = elem.append('g');
10126 const rectElem = _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawRect(g, rect);
10127
10128 const textHeight = _drawLongText(msg.message, startx - 4, verticalPos + 24, g, rect.width - conf.noteMargin);
10129
10130 bounds.insert(startx, verticalPos, startx + rect.width, verticalPos + 2 * conf.noteMargin + textHeight);
10131 rectElem.attr('height', textHeight + 2 * conf.noteMargin);
10132 bounds.bumpVerticalPos(textHeight + 2 * conf.noteMargin);
10133};
10134/**
10135 * Draws a message
10136 * @param elem
10137 * @param startx
10138 * @param stopx
10139 * @param verticalPos
10140 * @param txtCenter
10141 * @param msg
10142 */
10143
10144
10145const drawMessage = function (elem, startx, stopx, verticalPos, msg, sequenceIndex) {
10146 const g = elem.append('g');
10147 const txtCenter = startx + (stopx - startx) / 2;
10148 const textElem = g.append('text') // text label for the x axis
10149 .attr('x', txtCenter).attr('y', verticalPos - 7).style('text-anchor', 'middle').attr('class', 'messageText').text(msg.message);
10150 let textWidth = (textElem._groups || textElem)[0][0].getBBox().width;
10151 let line;
10152
10153 if (startx === stopx) {
10154 if (conf.rightAngles) {
10155 line = g.append('path').attr('d', `M ${startx},${verticalPos} H ${startx + conf.width / 2} V ${verticalPos + 25} H ${startx}`);
10156 } else {
10157 line = g.append('path').attr('d', 'M ' + startx + ',' + verticalPos + ' C ' + (startx + 60) + ',' + (verticalPos - 10) + ' ' + (startx + 60) + ',' + (verticalPos + 30) + ' ' + startx + ',' + (verticalPos + 20));
10158 }
10159
10160 bounds.bumpVerticalPos(30);
10161 const dx = Math.max(textWidth / 2, 100);
10162 bounds.insert(startx - dx, bounds.getVerticalPos() - 10, stopx + dx, bounds.getVerticalPos());
10163 } else {
10164 line = g.append('line');
10165 line.attr('x1', startx);
10166 line.attr('y1', verticalPos);
10167 line.attr('x2', stopx);
10168 line.attr('y2', verticalPos);
10169 bounds.insert(startx, bounds.getVerticalPos() - 10, stopx, bounds.getVerticalPos());
10170 } // Make an SVG Container
10171 // Draw the line
10172
10173
10174 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) {
10175 line.style('stroke-dasharray', '3, 3');
10176 line.attr('class', 'messageLine1');
10177 } else {
10178 line.attr('class', 'messageLine0');
10179 }
10180
10181 let url = '';
10182
10183 if (conf.arrowMarkerAbsolute) {
10184 url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search;
10185 url = url.replace(/\(/g, '\\(');
10186 url = url.replace(/\)/g, '\\)');
10187 }
10188
10189 line.attr('stroke-width', 2);
10190 line.attr('stroke', 'black');
10191 line.style('fill', 'none'); // remove any fill colour
10192
10193 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) {
10194 line.attr('marker-end', 'url(' + url + '#arrowhead)');
10195 }
10196
10197 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) {
10198 line.attr('marker-end', 'url(' + url + '#crosshead)');
10199 } // add node number
10200
10201
10202 if (conf.showSequenceNumbers) {
10203 line.attr('marker-start', 'url(' + url + '#sequencenumber)');
10204 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);
10205 }
10206};
10207
10208const drawActors = function (diagram, actors, actorKeys, verticalPos) {
10209 // Draw the actors
10210 for (let i = 0; i < actorKeys.length; i++) {
10211 const key = actorKeys[i]; // Add some rendering data to the object
10212
10213 actors[key].x = i * conf.actorMargin + i * conf.width;
10214 actors[key].y = verticalPos;
10215 actors[key].width = conf.diagramMarginX;
10216 actors[key].height = conf.diagramMarginY; // Draw the box with the attached line
10217
10218 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawActor(diagram, actors[key].x, verticalPos, actors[key].description, conf);
10219 bounds.insert(actors[key].x, verticalPos, actors[key].x + conf.width, conf.height);
10220 } // Add a margin between the actor boxes and the first arrow
10221
10222
10223 bounds.bumpVerticalPos(conf.height);
10224};
10225const setConf = function (cnf) {
10226 const keys = Object.keys(cnf);
10227 keys.forEach(function (key) {
10228 conf[key] = cnf[key];
10229 });
10230};
10231
10232const actorActivations = function (actor) {
10233 return bounds.activations.filter(function (activation) {
10234 return activation.actor === actor;
10235 });
10236};
10237
10238const actorFlowVerticaBounds = function (actor) {
10239 // handle multiple stacked activations for same actor
10240 const actors = _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.getActors();
10241 const activations = actorActivations(actor);
10242 const left = activations.reduce(function (acc, activation) {
10243 return Math.min(acc, activation.startx);
10244 }, actors[actor].x + conf.width / 2);
10245 const right = activations.reduce(function (acc, activation) {
10246 return Math.max(acc, activation.stopx);
10247 }, actors[actor].x + conf.width / 2);
10248 return [left, right];
10249};
10250/**
10251 * Draws a flowchart in the tag with id: id based on the graph definition in text.
10252 * @param text
10253 * @param id
10254 */
10255
10256
10257const draw = function (text, id) {
10258 _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.clear();
10259 _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].parse(text + '\n');
10260 bounds.init();
10261 const diagram = d3__WEBPACK_IMPORTED_MODULE_0__["select"](`[id="${id}"]`);
10262 let startx;
10263 let stopx;
10264 let forceWidth; // Fetch data from the parsing
10265
10266 const actors = _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.getActors();
10267 const actorKeys = _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.getActorKeys();
10268 const messages = _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.getMessages();
10269 const title = _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.getTitle();
10270 drawActors(diagram, actors, actorKeys, 0); // The arrow head definition is attached to the svg once
10271
10272 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].insertArrowHead(diagram);
10273 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].insertArrowCrossHead(diagram);
10274 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].insertSequenceNumber(diagram);
10275
10276 function activeEnd(msg, verticalPos) {
10277 const activationData = bounds.endActivation(msg);
10278
10279 if (activationData.starty + 18 > verticalPos) {
10280 activationData.starty = verticalPos - 6;
10281 verticalPos += 12;
10282 }
10283
10284 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawActivation(diagram, activationData, verticalPos, conf, actorActivations(msg.from.actor).length);
10285 bounds.insert(activationData.startx, verticalPos - 10, activationData.stopx, verticalPos);
10286 } // const lastMsg
10287 // Draw the messages/signals
10288
10289
10290 let sequenceIndex = 1;
10291 messages.forEach(function (msg) {
10292 let loopData;
10293
10294 switch (msg.type) {
10295 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.NOTE:
10296 bounds.bumpVerticalPos(conf.boxMargin);
10297 startx = actors[msg.from].x;
10298 stopx = actors[msg.to].x;
10299
10300 if (msg.placement === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.PLACEMENT.RIGHTOF) {
10301 drawNote(diagram, startx + (conf.width + conf.actorMargin) / 2, bounds.getVerticalPos(), msg);
10302 } else if (msg.placement === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.PLACEMENT.LEFTOF) {
10303 drawNote(diagram, startx - (conf.width + conf.actorMargin) / 2, bounds.getVerticalPos(), msg);
10304 } else if (msg.to === msg.from) {
10305 // Single-actor over
10306 drawNote(diagram, startx, bounds.getVerticalPos(), msg);
10307 } else {
10308 // Multi-actor over
10309 forceWidth = Math.abs(startx - stopx) + conf.actorMargin;
10310 drawNote(diagram, (startx + stopx + conf.width - forceWidth) / 2, bounds.getVerticalPos(), msg, forceWidth);
10311 }
10312
10313 break;
10314
10315 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.ACTIVE_START:
10316 bounds.newActivation(msg, diagram);
10317 break;
10318
10319 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.ACTIVE_END:
10320 activeEnd(msg, bounds.getVerticalPos());
10321 break;
10322
10323 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.LOOP_START:
10324 bounds.bumpVerticalPos(conf.boxMargin);
10325 bounds.newLoop(msg.message);
10326 bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin);
10327 break;
10328
10329 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.LOOP_END:
10330 loopData = bounds.endLoop();
10331 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawLoop(diagram, loopData, 'loop', conf);
10332 bounds.bumpVerticalPos(conf.boxMargin);
10333 break;
10334
10335 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.RECT_START:
10336 bounds.bumpVerticalPos(conf.boxMargin);
10337 bounds.newLoop(undefined, msg.message);
10338 bounds.bumpVerticalPos(conf.boxMargin);
10339 break;
10340
10341 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.RECT_END:
10342 const rectData = bounds.endLoop();
10343 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawBackgroundRect(diagram, rectData);
10344 bounds.bumpVerticalPos(conf.boxMargin);
10345 break;
10346
10347 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.OPT_START:
10348 bounds.bumpVerticalPos(conf.boxMargin);
10349 bounds.newLoop(msg.message);
10350 bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin);
10351 break;
10352
10353 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.OPT_END:
10354 loopData = bounds.endLoop();
10355 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawLoop(diagram, loopData, 'opt', conf);
10356 bounds.bumpVerticalPos(conf.boxMargin);
10357 break;
10358
10359 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.ALT_START:
10360 bounds.bumpVerticalPos(conf.boxMargin);
10361 bounds.newLoop(msg.message);
10362 bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin);
10363 break;
10364
10365 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.ALT_ELSE:
10366 bounds.bumpVerticalPos(conf.boxMargin);
10367 loopData = bounds.addSectionToLoop(msg.message);
10368 bounds.bumpVerticalPos(conf.boxMargin);
10369 break;
10370
10371 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.ALT_END:
10372 loopData = bounds.endLoop();
10373 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawLoop(diagram, loopData, 'alt', conf);
10374 bounds.bumpVerticalPos(conf.boxMargin);
10375 break;
10376
10377 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.PAR_START:
10378 bounds.bumpVerticalPos(conf.boxMargin);
10379 bounds.newLoop(msg.message);
10380 bounds.bumpVerticalPos(conf.boxMargin + conf.boxTextMargin);
10381 break;
10382
10383 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.PAR_AND:
10384 bounds.bumpVerticalPos(conf.boxMargin);
10385 loopData = bounds.addSectionToLoop(msg.message);
10386 bounds.bumpVerticalPos(conf.boxMargin);
10387 break;
10388
10389 case _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.PAR_END:
10390 loopData = bounds.endLoop();
10391 _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].drawLoop(diagram, loopData, 'par', conf);
10392 bounds.bumpVerticalPos(conf.boxMargin);
10393 break;
10394
10395 default:
10396 try {
10397 // lastMsg = msg
10398 bounds.bumpVerticalPos(conf.messageMargin);
10399 const fromBounds = actorFlowVerticaBounds(msg.from);
10400 const toBounds = actorFlowVerticaBounds(msg.to);
10401 const fromIdx = fromBounds[0] <= toBounds[0] ? 1 : 0;
10402 const toIdx = fromBounds[0] < toBounds[0] ? 0 : 1;
10403 startx = fromBounds[fromIdx];
10404 stopx = toBounds[toIdx];
10405 const verticalPos = bounds.getVerticalPos();
10406 drawMessage(diagram, startx, stopx, verticalPos, msg, sequenceIndex);
10407 const allBounds = fromBounds.concat(toBounds);
10408 bounds.insert(Math.min.apply(null, allBounds), verticalPos, Math.max.apply(null, allBounds), verticalPos);
10409 } catch (e) {
10410 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].error('error while drawing message', e);
10411 }
10412
10413 } // Increment sequence counter if msg.type is a line (and not another event like activation or note, etc)
10414
10415
10416 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)) {
10417 sequenceIndex++;
10418 }
10419 });
10420
10421 if (conf.mirrorActors) {
10422 // Draw actors below diagram
10423 bounds.bumpVerticalPos(conf.boxMargin * 2);
10424 drawActors(diagram, actors, actorKeys, bounds.getVerticalPos());
10425 }
10426
10427 const box = bounds.getBounds(); // Adjust line height of actor lines now that the height of the diagram is known
10428
10429 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('For line height fix Querying: #' + id + ' .actor-line');
10430 const actorLines = d3__WEBPACK_IMPORTED_MODULE_0__["selectAll"]('#' + id + ' .actor-line');
10431 actorLines.attr('y2', box.stopy);
10432 let height = box.stopy - box.starty + 2 * conf.diagramMarginY;
10433
10434 if (conf.mirrorActors) {
10435 height = height - conf.boxMargin + conf.bottomMarginAdj;
10436 }
10437
10438 const width = box.stopx - box.startx + 2 * conf.diagramMarginX;
10439
10440 if (title) {
10441 diagram.append('text').text(title).attr('x', (box.stopx - box.startx) / 2 - 2 * conf.diagramMarginX).attr('y', -25);
10442 }
10443
10444 if (conf.useMaxWidth) {
10445 diagram.attr('height', '100%');
10446 diagram.attr('width', '100%');
10447 diagram.attr('style', 'max-width:' + width + 'px;');
10448 } else {
10449 diagram.attr('height', height);
10450 diagram.attr('width', width);
10451 }
10452
10453 const extraVertForTitle = title ? 40 : 0;
10454 diagram.attr('viewBox', box.startx - conf.diagramMarginX + ' -' + (conf.diagramMarginY + extraVertForTitle) + ' ' + width + ' ' + (height + extraVertForTitle));
10455};
10456/* harmony default export */ __webpack_exports__["default"] = ({
10457 bounds,
10458 drawActors,
10459 setConf,
10460 draw
10461});
10462
10463/***/ }),
10464
10465/***/ "./src/diagrams/sequence/svgDraw.js":
10466/*!******************************************!*\
10467 !*** ./src/diagrams/sequence/svgDraw.js ***!
10468 \******************************************/
10469/*! exports provided: drawRect, drawText, drawLabel, drawActor, anchorElement, drawActivation, drawLoop, drawBackgroundRect, insertArrowHead, insertSequenceNumber, insertArrowCrossHead, getTextObj, getNoteRect, default */
10470/***/ (function(module, __webpack_exports__, __webpack_require__) {
10471
10472"use strict";
10473__webpack_require__.r(__webpack_exports__);
10474/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawRect", function() { return drawRect; });
10475/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawText", function() { return drawText; });
10476/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawLabel", function() { return drawLabel; });
10477/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawActor", function() { return drawActor; });
10478/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "anchorElement", function() { return anchorElement; });
10479/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawActivation", function() { return drawActivation; });
10480/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawLoop", function() { return drawLoop; });
10481/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawBackgroundRect", function() { return drawBackgroundRect; });
10482/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertArrowHead", function() { return insertArrowHead; });
10483/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertSequenceNumber", function() { return insertSequenceNumber; });
10484/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertArrowCrossHead", function() { return insertArrowCrossHead; });
10485/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTextObj", function() { return getTextObj; });
10486/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNoteRect", function() { return getNoteRect; });
10487const drawRect = function (elem, rectData) {
10488 const rectElem = elem.append('rect');
10489 rectElem.attr('x', rectData.x);
10490 rectElem.attr('y', rectData.y);
10491 rectElem.attr('fill', rectData.fill);
10492 rectElem.attr('stroke', rectData.stroke);
10493 rectElem.attr('width', rectData.width);
10494 rectElem.attr('height', rectData.height);
10495 rectElem.attr('rx', rectData.rx);
10496 rectElem.attr('ry', rectData.ry);
10497
10498 if (typeof rectData.class !== 'undefined') {
10499 rectElem.attr('class', rectData.class);
10500 }
10501
10502 return rectElem;
10503};
10504const drawText = function (elem, textData, width) {
10505 // Remove and ignore br:s
10506 const nText = textData.text.replace(/<br\/?>/gi, ' ');
10507 const textElem = elem.append('text');
10508 textElem.attr('x', textData.x);
10509 textElem.attr('y', textData.y);
10510 textElem.style('text-anchor', textData.anchor);
10511 textElem.attr('fill', textData.fill);
10512
10513 if (typeof textData.class !== 'undefined') {
10514 textElem.attr('class', textData.class);
10515 }
10516
10517 const span = textElem.append('tspan');
10518 span.attr('x', textData.x + textData.textMargin * 2);
10519 span.attr('fill', textData.fill);
10520 span.text(nText);
10521 return textElem;
10522};
10523const drawLabel = function (elem, txtObject) {
10524 function genPoints(x, y, width, height, cut) {
10525 return x + ',' + y + ' ' + (x + width) + ',' + y + ' ' + (x + width) + ',' + (y + height - cut) + ' ' + (x + width - cut * 1.2) + ',' + (y + height) + ' ' + x + ',' + (y + height);
10526 }
10527
10528 const polygon = elem.append('polygon');
10529 polygon.attr('points', genPoints(txtObject.x, txtObject.y, 50, 20, 7));
10530 polygon.attr('class', 'labelBox');
10531 txtObject.y = txtObject.y + txtObject.labelMargin;
10532 txtObject.x = txtObject.x + 0.5 * txtObject.labelMargin;
10533 drawText(elem, txtObject);
10534};
10535let actorCnt = -1;
10536/**
10537 * Draws an actor in the diagram with the attaced line
10538 * @param center - The center of the the actor
10539 * @param pos The position if the actor in the liost of actors
10540 * @param description The text in the box
10541 */
10542
10543const drawActor = function (elem, left, verticalPos, description, conf) {
10544 const center = left + conf.width / 2;
10545 const g = elem.append('g');
10546
10547 if (verticalPos === 0) {
10548 actorCnt++;
10549 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');
10550 }
10551
10552 const rect = getNoteRect();
10553 rect.x = left;
10554 rect.y = verticalPos;
10555 rect.fill = '#eaeaea';
10556 rect.width = conf.width;
10557 rect.height = conf.height;
10558 rect.class = 'actor';
10559 rect.rx = 3;
10560 rect.ry = 3;
10561 drawRect(g, rect);
10562
10563 _drawTextCandidateFunc(conf)(description, g, rect.x, rect.y, rect.width, rect.height, {
10564 class: 'actor'
10565 }, conf);
10566};
10567const anchorElement = function (elem) {
10568 return elem.append('g');
10569};
10570/**
10571 * Draws an actor in the diagram with the attaced line
10572 * @param elem - element to append activation rect
10573 * @param bounds - activation box bounds
10574 * @param verticalPos - precise y cooridnate of bottom activation box edge
10575 */
10576
10577const drawActivation = function (elem, bounds, verticalPos, conf, actorActivations) {
10578 const rect = getNoteRect();
10579 const g = bounds.anchored;
10580 rect.x = bounds.startx;
10581 rect.y = bounds.starty;
10582 rect.class = 'activation' + actorActivations % 3; // Will evaluate to 0, 1 or 2
10583
10584 rect.width = bounds.stopx - bounds.startx;
10585 rect.height = verticalPos - bounds.starty;
10586 drawRect(g, rect);
10587};
10588/**
10589 * Draws an actor in the diagram with the attaced line
10590 * @param center - The center of the the actor
10591 * @param pos The position if the actor in the list of actors
10592 * @param description The text in the box
10593 */
10594
10595const drawLoop = function (elem, bounds, labelText, conf) {
10596 const g = elem.append('g');
10597
10598 const drawLoopLine = function (startx, starty, stopx, stopy) {
10599 return g.append('line').attr('x1', startx).attr('y1', starty).attr('x2', stopx).attr('y2', stopy).attr('class', 'loopLine');
10600 };
10601
10602 drawLoopLine(bounds.startx, bounds.starty, bounds.stopx, bounds.starty);
10603 drawLoopLine(bounds.stopx, bounds.starty, bounds.stopx, bounds.stopy);
10604 drawLoopLine(bounds.startx, bounds.stopy, bounds.stopx, bounds.stopy);
10605 drawLoopLine(bounds.startx, bounds.starty, bounds.startx, bounds.stopy);
10606
10607 if (typeof bounds.sections !== 'undefined') {
10608 bounds.sections.forEach(function (item) {
10609 drawLoopLine(bounds.startx, item, bounds.stopx, item).style('stroke-dasharray', '3, 3');
10610 });
10611 }
10612
10613 let txt = getTextObj();
10614 txt.text = labelText;
10615 txt.x = bounds.startx;
10616 txt.y = bounds.starty;
10617 txt.labelMargin = 1.5 * 10; // This is the small box that says "loop"
10618
10619 txt.class = 'labelText'; // Its size & position are fixed.
10620
10621 drawLabel(g, txt);
10622 txt = getTextObj();
10623 txt.text = '[ ' + bounds.title + ' ]';
10624 txt.x = bounds.startx + (bounds.stopx - bounds.startx) / 2;
10625 txt.y = bounds.starty + 1.5 * conf.boxMargin;
10626 txt.anchor = 'middle';
10627 txt.class = 'loopText';
10628 drawText(g, txt);
10629
10630 if (typeof bounds.sectionTitles !== 'undefined') {
10631 bounds.sectionTitles.forEach(function (item, idx) {
10632 if (item !== '') {
10633 txt.text = '[ ' + item + ' ]';
10634 txt.y = bounds.sections[idx] + 1.5 * conf.boxMargin;
10635 drawText(g, txt);
10636 }
10637 });
10638 }
10639};
10640/**
10641 * Draws a background rectangle
10642 * @param color - The fill color for the background
10643 */
10644
10645const drawBackgroundRect = function (elem, bounds) {
10646 const rectElem = drawRect(elem, {
10647 x: bounds.startx,
10648 y: bounds.starty,
10649 width: bounds.stopx - bounds.startx,
10650 height: bounds.stopy - bounds.starty,
10651 fill: bounds.fill,
10652 class: 'rect'
10653 });
10654 rectElem.lower();
10655};
10656/**
10657 * Setup arrow head and define the marker. The result is appended to the svg.
10658 */
10659
10660const insertArrowHead = function (elem) {
10661 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
10662};
10663/**
10664 * Setup node number. The result is appended to the svg.
10665 */
10666
10667const insertSequenceNumber = function (elem) {
10668 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');
10669};
10670/**
10671 * Setup arrow head and define the marker. The result is appended to the svg.
10672 */
10673
10674const insertArrowCrossHead = function (elem) {
10675 const defs = elem.append('defs');
10676 const marker = defs.append('marker').attr('id', 'crosshead').attr('markerWidth', 15).attr('markerHeight', 8).attr('orient', 'auto').attr('refX', 16).attr('refY', 4); // The arrow
10677
10678 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
10679
10680 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
10681};
10682const getTextObj = function () {
10683 const txt = {
10684 x: 0,
10685 y: 0,
10686 fill: undefined,
10687 'text-anchor': 'start',
10688 style: '#666',
10689 width: 100,
10690 height: 100,
10691 textMargin: 0,
10692 rx: 0,
10693 ry: 0
10694 };
10695 return txt;
10696};
10697const getNoteRect = function () {
10698 const rect = {
10699 x: 0,
10700 y: 0,
10701 fill: '#EDF2AE',
10702 stroke: '#666',
10703 width: 100,
10704 anchor: 'start',
10705 height: 100,
10706 rx: 0,
10707 ry: 0
10708 };
10709 return rect;
10710};
10711
10712const _drawTextCandidateFunc = function () {
10713 function byText(content, g, x, y, width, height, textAttrs) {
10714 const text = g.append('text').attr('x', x + width / 2).attr('y', y + height / 2 + 5).style('text-anchor', 'middle').text(content);
10715
10716 _setTextAttrs(text, textAttrs);
10717 }
10718
10719 function byTspan(content, g, x, y, width, height, textAttrs, conf) {
10720 const {
10721 actorFontSize,
10722 actorFontFamily
10723 } = conf;
10724 const lines = content.split(/<br\/?>/gi);
10725
10726 for (let i = 0; i < lines.length; i++) {
10727 const dy = i * actorFontSize - actorFontSize * (lines.length - 1) / 2;
10728 const text = g.append('text').attr('x', x + width / 2).attr('y', y).style('text-anchor', 'middle').style('font-size', actorFontSize).style('font-family', actorFontFamily);
10729 text.append('tspan').attr('x', x + width / 2).attr('dy', dy).text(lines[i]);
10730 text.attr('y', y + height / 2.0).attr('dominant-baseline', 'central').attr('alignment-baseline', 'central');
10731
10732 _setTextAttrs(text, textAttrs);
10733 }
10734 }
10735
10736 function byFo(content, g, x, y, width, height, textAttrs, conf) {
10737 const s = g.append('switch');
10738 const f = s.append('foreignObject').attr('x', x).attr('y', y).attr('width', width).attr('height', height);
10739 const text = f.append('div').style('display', 'table').style('height', '100%').style('width', '100%');
10740 text.append('div').style('display', 'table-cell').style('text-align', 'center').style('vertical-align', 'middle').text(content);
10741 byTspan(content, s, x, y, width, height, textAttrs, conf);
10742
10743 _setTextAttrs(text, textAttrs);
10744 }
10745
10746 function _setTextAttrs(toText, fromTextAttrsDict) {
10747 for (const key in fromTextAttrsDict) {
10748 if (fromTextAttrsDict.hasOwnProperty(key)) {
10749 toText.attr(key, fromTextAttrsDict[key]);
10750 }
10751 }
10752 }
10753
10754 return function (conf) {
10755 return conf.textPlacement === 'fo' ? byFo : conf.textPlacement === 'old' ? byText : byTspan;
10756 };
10757}();
10758
10759/* harmony default export */ __webpack_exports__["default"] = ({
10760 drawRect,
10761 drawText,
10762 drawLabel,
10763 drawActor,
10764 anchorElement,
10765 drawActivation,
10766 drawLoop,
10767 drawBackgroundRect,
10768 insertArrowHead,
10769 insertSequenceNumber,
10770 insertArrowCrossHead,
10771 getTextObj,
10772 getNoteRect
10773});
10774
10775/***/ }),
10776
10777/***/ "./src/logger.js":
10778/*!***********************!*\
10779 !*** ./src/logger.js ***!
10780 \***********************/
10781/*! exports provided: LEVELS, logger, setLogLevel */
10782/***/ (function(module, __webpack_exports__, __webpack_require__) {
10783
10784"use strict";
10785__webpack_require__.r(__webpack_exports__);
10786/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LEVELS", function() { return LEVELS; });
10787/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logger", function() { return logger; });
10788/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLogLevel", function() { return setLogLevel; });
10789/* harmony import */ var moment_mini__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment-mini */ "moment-mini");
10790/* harmony import */ var moment_mini__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment_mini__WEBPACK_IMPORTED_MODULE_0__);
10791
10792const LEVELS = {
10793 debug: 1,
10794 info: 2,
10795 warn: 3,
10796 error: 4,
10797 fatal: 5
10798};
10799const logger = {
10800 debug: () => {},
10801 info: () => {},
10802 warn: () => {},
10803 error: () => {},
10804 fatal: () => {}
10805};
10806const setLogLevel = function (level) {
10807 logger.debug = () => {};
10808
10809 logger.info = () => {};
10810
10811 logger.warn = () => {};
10812
10813 logger.error = () => {};
10814
10815 logger.fatal = () => {};
10816
10817 if (level <= LEVELS.fatal) {
10818 logger.fatal = console.log.bind(console, '\x1b[35m', format('FATAL'));
10819 }
10820
10821 if (level <= LEVELS.error) {
10822 logger.error = console.log.bind(console, '\x1b[31m', format('ERROR'));
10823 }
10824
10825 if (level <= LEVELS.warn) {
10826 logger.warn = console.log.bind(console, `\x1b[33m`, format('WARN'));
10827 }
10828
10829 if (level <= LEVELS.info) {
10830 logger.info = console.log.bind(console, '\x1b[34m', format('INFO'));
10831 }
10832
10833 if (level <= LEVELS.debug) {
10834 logger.debug = console.log.bind(console, '\x1b[32m', format('DEBUG'));
10835 }
10836};
10837
10838const format = level => {
10839 const time = moment_mini__WEBPACK_IMPORTED_MODULE_0___default()().format('HH:mm:ss.SSS');
10840 return `${time} : ${level} : `;
10841};
10842
10843/***/ }),
10844
10845/***/ "./src/mermaid.js":
10846/*!************************!*\
10847 !*** ./src/mermaid.js ***!
10848 \************************/
10849/*! exports provided: default */
10850/***/ (function(module, __webpack_exports__, __webpack_require__) {
10851
10852"use strict";
10853__webpack_require__.r(__webpack_exports__);
10854/* harmony import */ var he__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! he */ "he");
10855/* harmony import */ var he__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(he__WEBPACK_IMPORTED_MODULE_0__);
10856/* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mermaidAPI */ "./src/mermaidAPI.js");
10857/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./logger */ "./src/logger.js");
10858/**
10859 * Web page integration module for the mermaid framework. It uses the mermaidAPI for mermaid functionality and to render
10860 * the diagrams to svg code.
10861 */
10862
10863
10864
10865/**
10866 * ## init
10867 * Function that goes through the document to find the chart definitions in there and render them.
10868 *
10869 * The function tags the processed attributes with the attribute data-processed and ignores found elements with the
10870 * attribute already set. This way the init function can be triggered several times.
10871 *
10872 * Optionally, `init` can accept in the second argument one of the following:
10873 * - a DOM Node
10874 * - an array of DOM nodes (as would come from a jQuery selector)
10875 * - a W3C selector, a la `.mermaid`
10876 *
10877 * ```mermaid
10878 * graph LR;
10879 * a(Find elements)-->b{Processed}
10880 * b-->|Yes|c(Leave element)
10881 * b-->|No |d(Transform)
10882 * ```
10883 * Renders the mermaid diagrams
10884 * @param nodes a css selector or an array of nodes
10885 */
10886
10887const init = function () {
10888 const conf = _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"].getConfig();
10889 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('Starting rendering diagrams');
10890 let nodes;
10891
10892 if (arguments.length >= 2) {
10893 /*! sequence config was passed as #1 */
10894 if (typeof arguments[0] !== 'undefined') {
10895 mermaid.sequenceConfig = arguments[0];
10896 }
10897
10898 nodes = arguments[1];
10899 } else {
10900 nodes = arguments[0];
10901 } // if last argument is a function this is the callback function
10902
10903
10904 let callback;
10905
10906 if (typeof arguments[arguments.length - 1] === 'function') {
10907 callback = arguments[arguments.length - 1];
10908 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('Callback function found');
10909 } else {
10910 if (typeof conf.mermaid !== 'undefined') {
10911 if (typeof conf.mermaid.callback === 'function') {
10912 callback = conf.mermaid.callback;
10913 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('Callback function found');
10914 } else {
10915 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('No Callback function found');
10916 }
10917 }
10918 }
10919
10920 nodes = nodes === undefined ? document.querySelectorAll('.mermaid') : typeof nodes === 'string' ? document.querySelectorAll(nodes) : nodes instanceof window.Node ? [nodes] : nodes; // Last case - sequence config was passed pick next
10921
10922 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('Start On Load before: ' + mermaid.startOnLoad);
10923
10924 if (typeof mermaid.startOnLoad !== 'undefined') {
10925 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('Start On Load inner: ' + mermaid.startOnLoad);
10926 _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"].initialize({
10927 startOnLoad: mermaid.startOnLoad
10928 });
10929 }
10930
10931 if (typeof mermaid.ganttConfig !== 'undefined') {
10932 _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"].initialize({
10933 gantt: mermaid.ganttConfig
10934 });
10935 }
10936
10937 let txt;
10938
10939 for (let i = 0; i < nodes.length; i++) {
10940 const element = nodes[i];
10941 /*! Check if previously processed */
10942
10943 if (!element.getAttribute('data-processed')) {
10944 element.setAttribute('data-processed', true);
10945 } else {
10946 continue;
10947 }
10948
10949 const id = `mermaid-${Date.now()}`; // Fetch the graph definition including tags
10950
10951 txt = element.innerHTML; // transforms the html to pure text
10952
10953 txt = he__WEBPACK_IMPORTED_MODULE_0___default.a.decode(txt).trim().replace(/<br>/gi, '<br/>');
10954 _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"].render(id, txt, (svgCode, bindFunctions) => {
10955 element.innerHTML = svgCode;
10956
10957 if (typeof callback !== 'undefined') {
10958 callback(id);
10959 }
10960
10961 if (bindFunctions) bindFunctions(element);
10962 }, element);
10963 }
10964};
10965
10966const initialize = function (config) {
10967 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('Initializing mermaid ');
10968
10969 if (typeof config.mermaid !== 'undefined') {
10970 if (typeof config.mermaid.startOnLoad !== 'undefined') {
10971 mermaid.startOnLoad = config.mermaid.startOnLoad;
10972 }
10973
10974 if (typeof config.mermaid.htmlLabels !== 'undefined') {
10975 mermaid.htmlLabels = config.mermaid.htmlLabels;
10976 }
10977 }
10978
10979 _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"].initialize(config);
10980};
10981/**
10982 * ##contentLoaded
10983 * Callback function that is called when page is loaded. This functions fetches configuration for mermaid rendering and
10984 * calls init for rendering the mermaid diagrams on the page.
10985 */
10986
10987
10988const contentLoaded = function () {
10989 let config;
10990
10991 if (mermaid.startOnLoad) {
10992 // No config found, do check API config
10993 config = _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"].getConfig();
10994
10995 if (config.startOnLoad) {
10996 mermaid.init();
10997 }
10998 } else {
10999 if (typeof mermaid.startOnLoad === 'undefined') {
11000 _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('In start, no config');
11001 config = _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"].getConfig();
11002
11003 if (config.startOnLoad) {
11004 mermaid.init();
11005 }
11006 }
11007 }
11008};
11009
11010if (typeof document !== 'undefined') {
11011 /*!
11012 * Wait for document loaded before starting the execution
11013 */
11014 window.addEventListener('load', function () {
11015 contentLoaded();
11016 }, false);
11017}
11018
11019const mermaid = {
11020 startOnLoad: true,
11021 htmlLabels: true,
11022 mermaidAPI: _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"],
11023 parse: _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"].parse,
11024 render: _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"].render,
11025 init,
11026 initialize,
11027 contentLoaded
11028};
11029/* harmony default export */ __webpack_exports__["default"] = (mermaid);
11030
11031/***/ }),
11032
11033/***/ "./src/mermaidAPI.js":
11034/*!***************************!*\
11035 !*** ./src/mermaidAPI.js ***!
11036 \***************************/
11037/*! exports provided: encodeEntities, decodeEntities, default */
11038/***/ (function(module, __webpack_exports__, __webpack_require__) {
11039
11040"use strict";
11041__webpack_require__.r(__webpack_exports__);
11042/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "encodeEntities", function() { return encodeEntities; });
11043/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "decodeEntities", function() { return decodeEntities; });
11044/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
11045/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
11046/* harmony import */ var scope_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! scope-css */ "scope-css");
11047/* harmony import */ var scope_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(scope_css__WEBPACK_IMPORTED_MODULE_1__);
11048/* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../package.json */ "./package.json");
11049var _package_json__WEBPACK_IMPORTED_MODULE_2___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../package.json */ "./package.json", 1);
11050/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./config */ "./src/config.js");
11051/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./logger */ "./src/logger.js");
11052/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils */ "./src/utils.js");
11053/* harmony import */ var _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./diagrams/flowchart/flowRenderer */ "./src/diagrams/flowchart/flowRenderer.js");
11054/* harmony import */ var _diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./diagrams/flowchart/parser/flow */ "./src/diagrams/flowchart/parser/flow.jison");
11055/* harmony import */ var _diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7__);
11056/* harmony import */ var _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./diagrams/flowchart/flowDb */ "./src/diagrams/flowchart/flowDb.js");
11057/* harmony import */ var _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./diagrams/sequence/sequenceRenderer */ "./src/diagrams/sequence/sequenceRenderer.js");
11058/* harmony import */ var _diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./diagrams/sequence/parser/sequenceDiagram */ "./src/diagrams/sequence/parser/sequenceDiagram.jison");
11059/* harmony import */ var _diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_10__);
11060/* harmony import */ var _diagrams_sequence_sequenceDb__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./diagrams/sequence/sequenceDb */ "./src/diagrams/sequence/sequenceDb.js");
11061/* harmony import */ var _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./diagrams/gantt/ganttRenderer */ "./src/diagrams/gantt/ganttRenderer.js");
11062/* harmony import */ var _diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./diagrams/gantt/parser/gantt */ "./src/diagrams/gantt/parser/gantt.jison");
11063/* harmony import */ var _diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_13__);
11064/* harmony import */ var _diagrams_gantt_ganttDb__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./diagrams/gantt/ganttDb */ "./src/diagrams/gantt/ganttDb.js");
11065/* harmony import */ var _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./diagrams/class/classRenderer */ "./src/diagrams/class/classRenderer.js");
11066/* harmony import */ var _diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./diagrams/class/parser/classDiagram */ "./src/diagrams/class/parser/classDiagram.jison");
11067/* harmony import */ var _diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_16__);
11068/* harmony import */ var _diagrams_class_classDb__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./diagrams/class/classDb */ "./src/diagrams/class/classDb.js");
11069/* harmony import */ var _diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./diagrams/git/gitGraphRenderer */ "./src/diagrams/git/gitGraphRenderer.js");
11070/* harmony import */ var _diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./diagrams/git/parser/gitGraph */ "./src/diagrams/git/parser/gitGraph.jison");
11071/* harmony import */ var _diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_19__);
11072/* harmony import */ var _diagrams_git_gitGraphAst__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./diagrams/git/gitGraphAst */ "./src/diagrams/git/gitGraphAst.js");
11073/* harmony import */ var _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./diagrams/info/infoRenderer */ "./src/diagrams/info/infoRenderer.js");
11074/* harmony import */ var _diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./diagrams/info/parser/info */ "./src/diagrams/info/parser/info.jison");
11075/* harmony import */ var _diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(_diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_22__);
11076/* harmony import */ var _diagrams_info_infoDb__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./diagrams/info/infoDb */ "./src/diagrams/info/infoDb.js");
11077/* harmony import */ var _diagrams_pie_pieRenderer__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./diagrams/pie/pieRenderer */ "./src/diagrams/pie/pieRenderer.js");
11078/* harmony import */ var _diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./diagrams/pie/parser/pie */ "./src/diagrams/pie/parser/pie.jison");
11079/* harmony import */ var _diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(_diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_25__);
11080/* harmony import */ var _diagrams_pie_pieDb__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./diagrams/pie/pieDb */ "./src/diagrams/pie/pieDb.js");
11081/**
11082 * 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.
11083 *
11084 * The core of this api is the [**render**](https://github.com/knsv/mermaid/blob/master/docs/mermaidAPI.md#render) function which, given a graph
11085 * definition as text, renders the graph/diagram and returns an svg element for the graph.
11086 *
11087 * 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.
11088 *
11089 * In addition to the render function, a number of behavioral configuration options are available.
11090 *
11091 * @name mermaidAPI
11092 */
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120const themes = {};
11121
11122for (const themeName of ['default', 'forest', 'dark', 'neutral']) {
11123 themes[themeName] = __webpack_require__("./src/themes sync recursive ^\\.\\/.*\\/index\\.scss$")(`./${themeName}/index.scss`);
11124}
11125/**
11126 * These are the default options which can be overridden with the initialization call like so:
11127 * **Example 1:**
11128 * <pre>
11129 * mermaid.initialize({
11130 * flowchart:{
11131 * htmlLabels: false
11132 * }
11133 * });
11134 * </pre>
11135 *
11136 * **Example 2:**
11137 * <pre>
11138 * <script>
11139 * var config = {
11140 * startOnLoad:true,
11141 * flowchart:{
11142 * useMaxWidth:true,
11143 * htmlLabels:true,
11144 * curve:'cardinal',
11145 * },
11146 *
11147 * securityLevel:'loose',
11148 * };
11149 * mermaid.initialize(config);
11150 * </script>
11151 * </pre>
11152 * 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.
11153 *
11154 * @name Configuration
11155 */
11156
11157
11158const config = {
11159 /** theme , the CSS style sheet
11160 *
11161 * **theme** - Choose one of the built-in themes:
11162 * * default
11163 * * forest
11164 * * dark
11165 * * neutral.
11166 * To disable any pre-defined mermaid theme, use "null".
11167 *
11168 * **themeCSS** - Use your own CSS. This overrides **theme**.
11169 * <pre>
11170 * "theme": "forest",
11171 * "themeCSS": ".node rect { fill: red; }"
11172 * </pre>
11173 */
11174 theme: 'default',
11175 themeCSS: undefined,
11176
11177 /**
11178 * This option decides the amount of logging to be used.
11179 * * debug: 1
11180 * * info: 2
11181 * * warn: 3
11182 * * error: 4
11183 * * fatal: (**default**) 5
11184 */
11185 logLevel: 5,
11186
11187 /**
11188 * Sets the level of trust to be used on the parsed diagrams.
11189 * * **strict**: (**default**) tags in text are encoded, click functionality is disabeled
11190 * * **loose**: tags in text are allowed, click functionality is enabled
11191 */
11192 securityLevel: 'strict',
11193
11194 /**
11195 * This options controls whether or mermaid starts when the page loads
11196 * **Default value true**.
11197 */
11198 startOnLoad: true,
11199
11200 /**
11201 * This options controls whether or arrow markers in html code will be absolute paths or
11202 * an anchor, #. This matters if you are using base tag settings.
11203 * **Default value false**.
11204 */
11205 arrowMarkerAbsolute: false,
11206
11207 /**
11208 * The object containing configurations specific for flowcharts
11209 */
11210 flowchart: {
11211 /**
11212 * Flag for setting whether or not a html tag should be used for rendering labels
11213 * on the edges.
11214 * **Default value true**.
11215 */
11216 htmlLabels: true,
11217
11218 /**
11219 * How mermaid renders curves for flowcharts. Possible values are
11220 * * basis
11221 * * linear **default**
11222 * * cardinal
11223 */
11224 curve: 'linear'
11225 },
11226
11227 /**
11228 * The object containing configurations specific for sequence diagrams
11229 */
11230 sequence: {
11231 /**
11232 * margin to the right and left of the sequence diagram.
11233 * **Default value 50**.
11234 */
11235 diagramMarginX: 50,
11236
11237 /**
11238 * margin to the over and under the sequence diagram.
11239 * **Default value 10**.
11240 */
11241 diagramMarginY: 10,
11242
11243 /**
11244 * Margin between actors.
11245 * **Default value 50**.
11246 */
11247 actorMargin: 50,
11248
11249 /**
11250 * Width of actor boxes
11251 * **Default value 150**.
11252 */
11253 width: 150,
11254
11255 /**
11256 * Height of actor boxes
11257 * **Default value 65**.
11258 */
11259 height: 65,
11260
11261 /**
11262 * Margin around loop boxes
11263 * **Default value 10**.
11264 */
11265 boxMargin: 10,
11266
11267 /**
11268 * margin around the text in loop/alt/opt boxes
11269 * **Default value 5**.
11270 */
11271 boxTextMargin: 5,
11272
11273 /**
11274 * margin around notes.
11275 * **Default value 10**.
11276 */
11277 noteMargin: 10,
11278
11279 /**
11280 * Space between messages.
11281 * **Default value 35**.
11282 */
11283 messageMargin: 35,
11284
11285 /**
11286 * mirror actors under diagram.
11287 * **Default value true**.
11288 */
11289 mirrorActors: true,
11290
11291 /**
11292 * Depending on css styling this might need adjustment.
11293 * Prolongs the edge of the diagram downwards.
11294 * **Default value 1**.
11295 */
11296 bottomMarginAdj: 1,
11297
11298 /**
11299 * when this flag is set the height and width is set to 100% and is then scaling with the
11300 * available space if not the absolute space required is used.
11301 * **Default value true**.
11302 */
11303 useMaxWidth: true,
11304
11305 /**
11306 * This will display arrows that start and begin at the same node as right angles, rather than a curve
11307 * **Default value false**.
11308 */
11309 rightAngles: false,
11310
11311 /**
11312 * This will show the node numbers
11313 * **Default value false**.
11314 */
11315 showSequenceNumbers: false
11316 },
11317
11318 /**
11319 * The object containing configurations specific for gantt diagrams*
11320 */
11321 gantt: {
11322 /**
11323 * Margin top for the text over the gantt diagram
11324 * **Default value 25**.
11325 */
11326 titleTopMargin: 25,
11327
11328 /**
11329 * The height of the bars in the graph
11330 * **Default value 20**.
11331 */
11332 barHeight: 20,
11333
11334 /**
11335 * The margin between the different activities in the gantt diagram.
11336 * **Default value 4**.
11337 */
11338 barGap: 4,
11339
11340 /**
11341 * Margin between title and gantt diagram and between axis and gantt diagram.
11342 * **Default value 50**.
11343 */
11344 topPadding: 50,
11345
11346 /**
11347 * The space allocated for the section name to the left of the activities.
11348 * **Default value 75**.
11349 */
11350 leftPadding: 75,
11351
11352 /**
11353 * Vertical starting position of the grid lines.
11354 * **Default value 35**.
11355 */
11356 gridLineStartPadding: 35,
11357
11358 /**
11359 * Font size ...
11360 * **Default value 11**.
11361 */
11362 fontSize: 11,
11363
11364 /**
11365 * font family ...
11366 * **Default value '"Open-Sans", "sans-serif"'**.
11367 */
11368 fontFamily: '"Open-Sans", "sans-serif"',
11369
11370 /**
11371 * The number of alternating section styles.
11372 * **Default value 4**.
11373 */
11374 numberSectionStyles: 4,
11375
11376 /**
11377 * Datetime format of the axis. This might need adjustment to match your locale and preferences
11378 * **Default value '%Y-%m-%d'**.
11379 */
11380 axisFormat: '%Y-%m-%d'
11381 },
11382 class: {},
11383 git: {}
11384};
11385Object(_logger__WEBPACK_IMPORTED_MODULE_4__["setLogLevel"])(config.logLevel);
11386Object(_config__WEBPACK_IMPORTED_MODULE_3__["setConfig"])(config);
11387
11388function parse(text) {
11389 const graphType = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].detectType(text);
11390 let parser;
11391 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('Type ' + graphType);
11392
11393 switch (graphType) {
11394 case 'git':
11395 parser = _diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_19___default.a;
11396 parser.parser.yy = _diagrams_git_gitGraphAst__WEBPACK_IMPORTED_MODULE_20__["default"];
11397 break;
11398
11399 case 'flowchart':
11400 _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__["default"].clear();
11401 parser = _diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7___default.a;
11402 parser.parser.yy = _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__["default"];
11403 break;
11404
11405 case 'sequence':
11406 parser = _diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_10___default.a;
11407 parser.parser.yy = _diagrams_sequence_sequenceDb__WEBPACK_IMPORTED_MODULE_11__["default"];
11408 break;
11409
11410 case 'gantt':
11411 parser = _diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_13___default.a;
11412 parser.parser.yy = _diagrams_gantt_ganttDb__WEBPACK_IMPORTED_MODULE_14__["default"];
11413 break;
11414
11415 case 'class':
11416 parser = _diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_16___default.a;
11417 parser.parser.yy = _diagrams_class_classDb__WEBPACK_IMPORTED_MODULE_17__["default"];
11418 break;
11419
11420 case 'info':
11421 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('info info info');
11422 console.warn('In API', _package_json__WEBPACK_IMPORTED_MODULE_2__.version);
11423 parser = _diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_22___default.a;
11424 parser.parser.yy = _diagrams_info_infoDb__WEBPACK_IMPORTED_MODULE_23__["default"];
11425 break;
11426
11427 case 'pie':
11428 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('pie');
11429 parser = _diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_25___default.a;
11430 parser.parser.yy = _diagrams_pie_pieDb__WEBPACK_IMPORTED_MODULE_26__["default"];
11431 break;
11432 }
11433
11434 parser.parser.yy.parseError = (str, hash) => {
11435 const error = {
11436 str,
11437 hash
11438 };
11439 throw error;
11440 };
11441
11442 parser.parse(text);
11443}
11444
11445const encodeEntities = function (text) {
11446 let txt = text;
11447 txt = txt.replace(/style.*:\S*#.*;/g, function (s) {
11448 const innerTxt = s.substring(0, s.length - 1);
11449 return innerTxt;
11450 });
11451 txt = txt.replace(/classDef.*:\S*#.*;/g, function (s) {
11452 const innerTxt = s.substring(0, s.length - 1);
11453 return innerTxt;
11454 });
11455 txt = txt.replace(/#\w+;/g, function (s) {
11456 const innerTxt = s.substring(1, s.length - 1);
11457 const isInt = /^\+?\d+$/.test(innerTxt);
11458
11459 if (isInt) {
11460 return 'fl°°' + innerTxt + '¶ß';
11461 } else {
11462 return 'fl°' + innerTxt + '¶ß';
11463 }
11464 });
11465 return txt;
11466};
11467const decodeEntities = function (text) {
11468 let txt = text;
11469 txt = txt.replace(/fl°°/g, function () {
11470 return '&#';
11471 });
11472 txt = txt.replace(/fl°/g, function () {
11473 return '&';
11474 });
11475 txt = txt.replace(/¶ß/g, function () {
11476 return ';';
11477 });
11478 return txt;
11479};
11480/**
11481 * Function that renders an svg with a graph from a chart definition. Usage example below.
11482 *
11483 * ```js
11484 * mermaidAPI.initialize({
11485 * startOnLoad:true
11486 * });
11487 * $(function(){
11488 * const graphDefinition = 'graph TB\na-->b';
11489 * const cb = function(svgGraph){
11490 * console.log(svgGraph);
11491 * };
11492 * mermaidAPI.render('id1',graphDefinition,cb);
11493 * });
11494 *```
11495 * @param id the id of the element to be rendered
11496 * @param txt the graph definition
11497 * @param cb callback which is called after rendering is finished with the svg code as inparam.
11498 * @param container selector to element in which a div with the graph temporarily will be inserted. In one is
11499 * provided a hidden div will be inserted in the body of the page instead. The element will be removed when rendering is
11500 * completed.
11501 */
11502
11503const render = function (id, txt, cb, container) {
11504 if (typeof container !== 'undefined') {
11505 container.innerHTML = '';
11506 d3__WEBPACK_IMPORTED_MODULE_0__["select"](container).append('div').attr('id', 'd' + id).append('svg').attr('id', id).attr('width', '100%').attr('xmlns', 'http://www.w3.org/2000/svg').append('g');
11507 } else {
11508 const element = document.querySelector('#' + 'd' + id);
11509
11510 if (element) {
11511 element.innerHTML = '';
11512 }
11513
11514 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');
11515 }
11516
11517 window.txt = txt;
11518 txt = encodeEntities(txt);
11519 const element = d3__WEBPACK_IMPORTED_MODULE_0__["select"]('#d' + id).node();
11520 const graphType = _utils__WEBPACK_IMPORTED_MODULE_5__["default"].detectType(txt); // insert inline style into svg
11521
11522 const svg = element.firstChild;
11523 const firstChild = svg.firstChild; // pre-defined theme
11524
11525 let style = themes[config.theme];
11526
11527 if (style === undefined) {
11528 style = '';
11529 } // user provided theme CSS
11530
11531
11532 if (config.themeCSS !== undefined) {
11533 style += `\n${config.themeCSS}`;
11534 } // classDef
11535
11536
11537 if (graphType === 'flowchart') {
11538 const classes = _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_6__["default"].getClasses(txt);
11539
11540 for (const className in classes) {
11541 style += `\n.${className} > * { ${classes[className].styles.join(' !important; ')} !important; }`;
11542 }
11543 }
11544
11545 const style1 = document.createElement('style');
11546 style1.innerHTML = scope_css__WEBPACK_IMPORTED_MODULE_1___default()(style, `#${id}`);
11547 svg.insertBefore(style1, firstChild);
11548 const style2 = document.createElement('style');
11549 const cs = window.getComputedStyle(svg);
11550 style2.innerHTML = `#${id} {
11551 color: ${cs.color};
11552 font: ${cs.font};
11553 }`;
11554 svg.insertBefore(style2, firstChild);
11555
11556 switch (graphType) {
11557 case 'git':
11558 config.flowchart.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
11559 _diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_18__["default"].setConf(config.git);
11560 _diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_18__["default"].draw(txt, id, false);
11561 break;
11562
11563 case 'flowchart':
11564 config.flowchart.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
11565 _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_6__["default"].setConf(config.flowchart);
11566 _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_6__["default"].draw(txt, id, false);
11567 break;
11568
11569 case 'sequence':
11570 config.sequence.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
11571
11572 if (config.sequenceDiagram) {
11573 // backwards compatibility
11574 _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__["default"].setConf(Object.assign(config.sequence, config.sequenceDiagram));
11575 console.error('`mermaid config.sequenceDiagram` has been renamed to `config.sequence`. Please update your mermaid config.');
11576 } else {
11577 _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__["default"].setConf(config.sequence);
11578 }
11579
11580 _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__["default"].draw(txt, id);
11581 break;
11582
11583 case 'gantt':
11584 config.gantt.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
11585 _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_12__["default"].setConf(config.gantt);
11586 _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_12__["default"].draw(txt, id);
11587 break;
11588
11589 case 'class':
11590 config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
11591 _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_15__["default"].setConf(config.class);
11592 _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_15__["default"].draw(txt, id);
11593 break;
11594
11595 case 'info':
11596 config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
11597 _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_21__["default"].setConf(config.class);
11598 _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_21__["default"].draw(txt, id, _package_json__WEBPACK_IMPORTED_MODULE_2__.version);
11599 break;
11600
11601 case 'pie':
11602 config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
11603 _diagrams_pie_pieRenderer__WEBPACK_IMPORTED_MODULE_24__["default"].setConf(config.class);
11604 _diagrams_pie_pieRenderer__WEBPACK_IMPORTED_MODULE_24__["default"].draw(txt, id, _package_json__WEBPACK_IMPORTED_MODULE_2__.version);
11605 break;
11606 }
11607
11608 d3__WEBPACK_IMPORTED_MODULE_0__["select"](`[id="${id}"]`).selectAll('foreignobject > *').attr('xmlns', 'http://www.w3.org/1999/xhtml');
11609 let url = '';
11610
11611 if (config.arrowMarkerAbsolute) {
11612 url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search;
11613 url = url.replace(/\(/g, '\\(');
11614 url = url.replace(/\)/g, '\\)');
11615 } // Fix for when the base tag is used
11616
11617
11618 let svgCode = d3__WEBPACK_IMPORTED_MODULE_0__["select"]('#d' + id).node().innerHTML.replace(/url\(#arrowhead/g, 'url(' + url + '#arrowhead', 'g');
11619 svgCode = decodeEntities(svgCode);
11620
11621 if (typeof cb !== 'undefined') {
11622 switch (graphType) {
11623 case 'flowchart':
11624 cb(svgCode, _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__["default"].bindFunctions);
11625 break;
11626
11627 case 'gantt':
11628 cb(svgCode, _diagrams_gantt_ganttDb__WEBPACK_IMPORTED_MODULE_14__["default"].bindFunctions);
11629 break;
11630
11631 default:
11632 cb(svgCode);
11633 }
11634 } else {
11635 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('CB = undefined!');
11636 }
11637
11638 const node = d3__WEBPACK_IMPORTED_MODULE_0__["select"]('#d' + id).node();
11639
11640 if (node !== null && typeof node.remove === 'function') {
11641 d3__WEBPACK_IMPORTED_MODULE_0__["select"]('#d' + id).node().remove();
11642 }
11643
11644 return svgCode;
11645};
11646
11647const setConf = function (cnf) {
11648 // Top level initially mermaid, gflow, sequenceDiagram and gantt
11649 const lvl1Keys = Object.keys(cnf);
11650
11651 for (let i = 0; i < lvl1Keys.length; i++) {
11652 if (typeof cnf[lvl1Keys[i]] === 'object' && cnf[lvl1Keys[i]] != null) {
11653 const lvl2Keys = Object.keys(cnf[lvl1Keys[i]]);
11654
11655 for (let j = 0; j < lvl2Keys.length; j++) {
11656 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('Setting conf ', lvl1Keys[i], '-', lvl2Keys[j]);
11657
11658 if (typeof config[lvl1Keys[i]] === 'undefined') {
11659 config[lvl1Keys[i]] = {};
11660 }
11661
11662 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('Setting config: ' + lvl1Keys[i] + ' ' + lvl2Keys[j] + ' to ' + cnf[lvl1Keys[i]][lvl2Keys[j]]);
11663 config[lvl1Keys[i]][lvl2Keys[j]] = cnf[lvl1Keys[i]][lvl2Keys[j]];
11664 }
11665 } else {
11666 config[lvl1Keys[i]] = cnf[lvl1Keys[i]];
11667 }
11668 }
11669};
11670
11671function initialize(options) {
11672 _logger__WEBPACK_IMPORTED_MODULE_4__["logger"].debug('Initializing mermaidAPI ', _package_json__WEBPACK_IMPORTED_MODULE_2__.version); // Update default config with options supplied at initialization
11673
11674 if (typeof options === 'object') {
11675 setConf(options);
11676 }
11677
11678 Object(_config__WEBPACK_IMPORTED_MODULE_3__["setConfig"])(config);
11679 Object(_logger__WEBPACK_IMPORTED_MODULE_4__["setLogLevel"])(config.logLevel);
11680} // function getConfig () {
11681// console.warn('get config')
11682// return config
11683// }
11684
11685
11686const mermaidAPI = {
11687 render,
11688 parse,
11689 initialize,
11690 getConfig: _config__WEBPACK_IMPORTED_MODULE_3__["getConfig"]
11691};
11692/* harmony default export */ __webpack_exports__["default"] = (mermaidAPI);
11693/**
11694 * ## mermaidAPI configuration defaults
11695 * <pre>
11696 *
11697 * <script>
11698 * var config = {
11699 * theme:'default',
11700 * logLevel:'fatal',
11701 * securityLevel:'strict',
11702 * startOnLoad:true,
11703 * arrowMarkerAbsolute:false,
11704 *
11705 * flowchart:{
11706 * htmlLabels:true,
11707 * curve:'linear',
11708 * },
11709 * sequence:{
11710 * diagramMarginX:50,
11711 * diagramMarginY:10,
11712 * actorMargin:50,
11713 * width:150,
11714 * height:65,
11715 * boxMargin:10,
11716 * boxTextMargin:5,
11717 * noteMargin:10,
11718 * messageMargin:35,
11719 * mirrorActors:true,
11720 * bottomMarginAdj:1,
11721 * useMaxWidth:true,
11722 * rightAngles:false,
11723 * showSequenceNumbers:false,
11724 * },
11725 * gantt:{
11726 * titleTopMargin:25,
11727 * barHeight:20,
11728 * barGap:4,
11729 * topPadding:50,
11730 * leftPadding:75,
11731 * gridLineStartPadding:35,
11732 * fontSize:11,
11733 * fontFamily:'"Open-Sans", "sans-serif"',
11734 * numberSectionStyles:4,
11735 * axisFormat:'%Y-%m-%d',
11736 * }
11737 * };
11738 * mermaid.initialize(config);
11739 * </script>
11740 *</pre>
11741 */
11742
11743/***/ }),
11744
11745/***/ "./src/themes sync recursive ^\\.\\/.*\\/index\\.scss$":
11746/*!***********************************************!*\
11747 !*** ./src/themes sync ^\.\/.*\/index\.scss$ ***!
11748 \***********************************************/
11749/*! no static exports found */
11750/***/ (function(module, exports, __webpack_require__) {
11751
11752var map = {
11753 "./dark/index.scss": "./src/themes/dark/index.scss",
11754 "./default/index.scss": "./src/themes/default/index.scss",
11755 "./forest/index.scss": "./src/themes/forest/index.scss",
11756 "./neutral/index.scss": "./src/themes/neutral/index.scss"
11757};
11758
11759
11760function webpackContext(req) {
11761 var id = webpackContextResolve(req);
11762 return __webpack_require__(id);
11763}
11764function webpackContextResolve(req) {
11765 var id = map[req];
11766 if(!(id + 1)) { // check for number or string
11767 var e = new Error("Cannot find module '" + req + "'");
11768 e.code = 'MODULE_NOT_FOUND';
11769 throw e;
11770 }
11771 return id;
11772}
11773webpackContext.keys = function webpackContextKeys() {
11774 return Object.keys(map);
11775};
11776webpackContext.resolve = webpackContextResolve;
11777module.exports = webpackContext;
11778webpackContext.id = "./src/themes sync recursive ^\\.\\/.*\\/index\\.scss$";
11779
11780/***/ }),
11781
11782/***/ "./src/themes/dark/index.scss":
11783/*!************************************!*\
11784 !*** ./src/themes/dark/index.scss ***!
11785 \************************************/
11786/*! no static exports found */
11787/***/ (function(module, exports, __webpack_require__) {
11788
11789// css-to-string-loader: transforms styles from css-loader to a string output
11790
11791// Get the styles
11792var styles = __webpack_require__(/*! !../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/lib/loader.js!./index.scss */ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/lib/loader.js!./src/themes/dark/index.scss");
11793
11794if (typeof styles === 'string') {
11795 // Return an existing string
11796 module.exports = styles;
11797} else {
11798 // Call the custom toString method from css-loader module
11799 module.exports = styles.toString();
11800}
11801
11802/***/ }),
11803
11804/***/ "./src/themes/default/index.scss":
11805/*!***************************************!*\
11806 !*** ./src/themes/default/index.scss ***!
11807 \***************************************/
11808/*! no static exports found */
11809/***/ (function(module, exports, __webpack_require__) {
11810
11811// css-to-string-loader: transforms styles from css-loader to a string output
11812
11813// Get the styles
11814var styles = __webpack_require__(/*! !../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/lib/loader.js!./index.scss */ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/lib/loader.js!./src/themes/default/index.scss");
11815
11816if (typeof styles === 'string') {
11817 // Return an existing string
11818 module.exports = styles;
11819} else {
11820 // Call the custom toString method from css-loader module
11821 module.exports = styles.toString();
11822}
11823
11824/***/ }),
11825
11826/***/ "./src/themes/forest/index.scss":
11827/*!**************************************!*\
11828 !*** ./src/themes/forest/index.scss ***!
11829 \**************************************/
11830/*! no static exports found */
11831/***/ (function(module, exports, __webpack_require__) {
11832
11833// css-to-string-loader: transforms styles from css-loader to a string output
11834
11835// Get the styles
11836var styles = __webpack_require__(/*! !../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/lib/loader.js!./index.scss */ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/lib/loader.js!./src/themes/forest/index.scss");
11837
11838if (typeof styles === 'string') {
11839 // Return an existing string
11840 module.exports = styles;
11841} else {
11842 // Call the custom toString method from css-loader module
11843 module.exports = styles.toString();
11844}
11845
11846/***/ }),
11847
11848/***/ "./src/themes/neutral/index.scss":
11849/*!***************************************!*\
11850 !*** ./src/themes/neutral/index.scss ***!
11851 \***************************************/
11852/*! no static exports found */
11853/***/ (function(module, exports, __webpack_require__) {
11854
11855// css-to-string-loader: transforms styles from css-loader to a string output
11856
11857// Get the styles
11858var styles = __webpack_require__(/*! !../../../node_modules/css-loader/dist/cjs.js!../../../node_modules/sass-loader/lib/loader.js!./index.scss */ "./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/lib/loader.js!./src/themes/neutral/index.scss");
11859
11860if (typeof styles === 'string') {
11861 // Return an existing string
11862 module.exports = styles;
11863} else {
11864 // Call the custom toString method from css-loader module
11865 module.exports = styles.toString();
11866}
11867
11868/***/ }),
11869
11870/***/ "./src/utils.js":
11871/*!**********************!*\
11872 !*** ./src/utils.js ***!
11873 \**********************/
11874/*! exports provided: detectType, isSubstringInArray, interpolateToCurve, default */
11875/***/ (function(module, __webpack_exports__, __webpack_require__) {
11876
11877"use strict";
11878__webpack_require__.r(__webpack_exports__);
11879/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "detectType", function() { return detectType; });
11880/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isSubstringInArray", function() { return isSubstringInArray; });
11881/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "interpolateToCurve", function() { return interpolateToCurve; });
11882/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
11883/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
11884/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./logger */ "./src/logger.js");
11885
11886
11887/**
11888 * @function detectType
11889 * Detects the type of the graph text.
11890 * ```mermaid
11891 * graph LR
11892 * a-->b
11893 * b-->c
11894 * c-->d
11895 * d-->e
11896 * e-->f
11897 * f-->g
11898 * g-->h
11899 * ```
11900 *
11901 * @param {string} text The text defining the graph
11902 * @returns {string} A graph definition key
11903 */
11904
11905const detectType = function (text) {
11906 text = text.replace(/^\s*%%.*\n/g, '\n');
11907 _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug('Detecting diagram type based on the text ' + text);
11908
11909 if (text.match(/^\s*sequenceDiagram/)) {
11910 return 'sequence';
11911 }
11912
11913 if (text.match(/^\s*gantt/)) {
11914 return 'gantt';
11915 }
11916
11917 if (text.match(/^\s*classDiagram/)) {
11918 return 'class';
11919 }
11920
11921 if (text.match(/^\s*gitGraph/)) {
11922 return 'git';
11923 }
11924
11925 if (text.match(/^\s*info/)) {
11926 return 'info';
11927 }
11928
11929 if (text.match(/^\s*pie/)) {
11930 return 'pie';
11931 }
11932
11933 return 'flowchart';
11934};
11935/**
11936 * @function isSubstringInArray
11937 * Detects whether a substring in present in a given array
11938 * @param {string} str The substring to detect
11939 * @param {array} arr The array to search
11940 * @returns {number} the array index containing the substring or -1 if not present
11941 **/
11942
11943const isSubstringInArray = function (str, arr) {
11944 for (let i = 0; i < arr.length; i++) {
11945 if (arr[i].match(str)) return i;
11946 }
11947
11948 return -1;
11949};
11950const interpolateToCurve = (interpolate, defaultCurve) => {
11951 if (!interpolate) {
11952 return defaultCurve;
11953 }
11954
11955 const curveName = `curve${interpolate.charAt(0).toUpperCase() + interpolate.slice(1)}`;
11956 return d3__WEBPACK_IMPORTED_MODULE_0__[curveName] || defaultCurve;
11957};
11958/* harmony default export */ __webpack_exports__["default"] = ({
11959 detectType,
11960 isSubstringInArray,
11961 interpolateToCurve
11962});
11963
11964/***/ }),
11965
11966/***/ "@braintree/sanitize-url":
11967/*!******************************************!*\
11968 !*** external "@braintree/sanitize-url" ***!
11969 \******************************************/
11970/*! no static exports found */
11971/***/ (function(module, exports) {
11972
11973module.exports = require("@braintree/sanitize-url");
11974
11975/***/ }),
11976
11977/***/ "d3":
11978/*!*********************!*\
11979 !*** external "d3" ***!
11980 \*********************/
11981/*! no static exports found */
11982/***/ (function(module, exports) {
11983
11984module.exports = require("d3");
11985
11986/***/ }),
11987
11988/***/ "dagre-d3-renderer":
11989/*!************************************!*\
11990 !*** external "dagre-d3-renderer" ***!
11991 \************************************/
11992/*! no static exports found */
11993/***/ (function(module, exports) {
11994
11995module.exports = require("dagre-d3-renderer");
11996
11997/***/ }),
11998
11999/***/ "dagre-d3-renderer/lib/label/add-html-label.js":
12000/*!****************************************************************!*\
12001 !*** external "dagre-d3-renderer/lib/label/add-html-label.js" ***!
12002 \****************************************************************/
12003/*! no static exports found */
12004/***/ (function(module, exports) {
12005
12006module.exports = require("dagre-d3-renderer/lib/label/add-html-label.js");
12007
12008/***/ }),
12009
12010/***/ "dagre-layout":
12011/*!*******************************!*\
12012 !*** external "dagre-layout" ***!
12013 \*******************************/
12014/*! no static exports found */
12015/***/ (function(module, exports) {
12016
12017module.exports = require("dagre-layout");
12018
12019/***/ }),
12020
12021/***/ "graphlibrary":
12022/*!*******************************!*\
12023 !*** external "graphlibrary" ***!
12024 \*******************************/
12025/*! no static exports found */
12026/***/ (function(module, exports) {
12027
12028module.exports = require("graphlibrary");
12029
12030/***/ }),
12031
12032/***/ "he":
12033/*!*********************!*\
12034 !*** external "he" ***!
12035 \*********************/
12036/*! no static exports found */
12037/***/ (function(module, exports) {
12038
12039module.exports = require("he");
12040
12041/***/ }),
12042
12043/***/ "lodash":
12044/*!*************************!*\
12045 !*** external "lodash" ***!
12046 \*************************/
12047/*! no static exports found */
12048/***/ (function(module, exports) {
12049
12050module.exports = require("lodash");
12051
12052/***/ }),
12053
12054/***/ "moment-mini":
12055/*!******************************!*\
12056 !*** external "moment-mini" ***!
12057 \******************************/
12058/*! no static exports found */
12059/***/ (function(module, exports) {
12060
12061module.exports = require("moment-mini");
12062
12063/***/ }),
12064
12065/***/ "scope-css":
12066/*!****************************!*\
12067 !*** external "scope-css" ***!
12068 \****************************/
12069/*! no static exports found */
12070/***/ (function(module, exports) {
12071
12072module.exports = require("scope-css");
12073
12074/***/ })
12075
12076/******/ })["default"];
12077});
12078//# sourceMappingURL=mermaid.core.js.map
\No newline at end of file