Socket
Socket
Sign inDemoInstall

mermaid

Package Overview
Dependencies
Maintainers
1
Versions
230
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mermaid - npm Package Compare versions

Comparing version 0.3.2 to 0.3.3

lib/phantomscript_m.js

2

bower.json
{
"name": "mermaid",
"version": "0.3.2",
"version": "0.3.3",
"authors": [

@@ -5,0 +5,0 @@ "knsv <knut@sveido.com>"

@@ -30,2 +30,3 @@ var gulp = require('gulp');

'jison src/diagrams/sequenceDiagram/parser/sequenceDiagram.jison -o src/diagrams/sequenceDiagram/parser/sequenceDiagram.js',
'jison src/diagrams/example/parser/example.jison -o src/diagrams/example/parser/example.js',
//'jison src/diagrams/sequenceDiagram/parser/sequenceDiagram.jison -o src/diagrams/sequenceDiagram/parser/sequenceDiagram.js'

@@ -75,2 +76,7 @@ ]));

//var slim_ext_libs = [
// 'dagre-d3',
// 'd3'
//];
// Basic usage

@@ -81,2 +87,9 @@ gulp.task('slimDist', function() {

.pipe(browserify())
/*.pipe(browserify({standalone: 'mermaid'}))
.on('prebundle', function(bundle) {
// Keep these external for the slim version.
slim_ext_libs.forEach(function(lib) {
bundle.external(lib);
});
})*/
.pipe(rename('mermaid.slim.js'))

@@ -83,0 +96,0 @@ .pipe(gulp.dest('./dist/'))

@@ -26,2 +26,3 @@ var fs = require('fs')

, phantomPath: 'e'
, sequenceConfig: 'c'
}

@@ -41,9 +42,10 @@ , 'boolean': ['help', 'png', 'svg']

, "Options:"
, " -s --svg Output SVG instead of PNG (experimental)"
, " -p --png If SVG was selected, and you also want PNG, set this flag"
, " -o --outputDir Directory to save files, will be created automatically, defaults to `cwd`"
, " -e --phantomPath Specify the path to the phantomjs executable"
, " -h --help Show this message"
, " -v --verbose Show logging"
, " --version Print version and quit"
, " -s --svg Output SVG instead of PNG (experimental)"
, " -p --png If SVG was selected, and you also want PNG, set this flag"
, " -o --outputDir Directory to save files, will be created automatically, defaults to `cwd`"
, " -e --phantomPath Specify the path to the phantomjs executable"
, " -c --sequenceConfig Specify the path to the file with the configuration to be applied in the sequence diagram"
, " -h --help Show this message"
, " -v --verbose Show logging"
, " --version Print version and quit"
]

@@ -75,3 +77,3 @@

// ensure that parameter-expecting options have parameters
;['outputDir', 'phantomPath'].forEach(function(i) {
;['outputDir', 'phantomPath', 'sequenceConfig'].forEach(function(i) {
if(typeof options[i] !== 'undefined') {

@@ -92,2 +94,6 @@ if (typeof options[i] !== 'string' || options[i].length < 1) {

if (options.sequenceConfig) {
options.sequenceConfig = checkConfig(options.sequenceConfig)
}
this.checkPhantom = createCheckPhantom(options.phantomPath)

@@ -109,2 +115,12 @@

function checkConfig(configPath) {
try {
var text = fs.readFileSync(configPath, 'utf8')
JSON.parse(text)
return text
} catch (e) {
return null;
}
}
function createCheckPhantom(_phantomPath) {

@@ -136,3 +152,3 @@ var phantomPath = _phantomPath

)
next(err)

@@ -139,0 +155,0 @@ return

@@ -21,2 +21,3 @@ var os = require('os')

, options.svg
, options.sequenceConfig
, options.verbose

@@ -23,0 +24,0 @@ ]

@@ -32,3 +32,3 @@ /**

var page = webpage.create()
, files = phantom.args.slice(4, phantom.args.length)
, files = phantom.args.slice(5, phantom.args.length)
, options = {

@@ -38,3 +38,4 @@ outputDir: phantom.args[0]

, svg: phantom.args[2] === 'true' ? true : false
, verbose: phantom.args[3] === 'true' ? true : false
, sequenceConfig: phantom.args[3]
, verbose: phantom.args[4] === 'true' ? true : false
}

@@ -56,3 +57,5 @@ , log = logger(options.verbose)

page.injectJs('../dist/mermaid.full.js')
page.onConsoleMessage = function(msg, lineNum, sourceId) {
console.log('CONSOLE: ' + msg + ' (from line #' + lineNum + ' in "' + sourceId + '")');
};
files.forEach(function(file) {

@@ -69,3 +72,6 @@ var contents = fs.read(file)

// taken from the DOM
svgContent = page.evaluate(executeInPage, contents)
svgContent = page.evaluate(executeInPage, {
contents: contents,
sequenceConfig: options.sequenceConfig
})
oDOM = oParser.parseFromString(svgContent, "text/xml")

@@ -189,4 +195,6 @@

// The sandboxed function that's executed in-page by phantom
function executeInPage(contents) {
function executeInPage(data) {
var xmlSerializer = new XMLSerializer()
, contents = data.contents
, sequenceConfig = data.sequenceConfig
, toRemove

@@ -211,5 +219,4 @@ , el

document.body.appendChild(el)
mermaid.init(sequenceConfig)
mermaid.init()
svg = document.querySelector('svg')

@@ -216,0 +223,0 @@ svgValue = xmlSerializer.serializeToString(svg)

{
"name": "mermaid",
"version": "0.3.2",
"version": "0.3.3",
"description": "Markdownish syntax for generating flowcharts",

@@ -20,2 +20,3 @@ "main": "src/main.js",

"chalk": "^0.5.1",
"d3": "~3.4.13",
"dagre-d3": "~0.3.2",

@@ -75,2 +76,3 @@ "he": "^0.5.0",

"phantomjs": "^1.9.12",
"proxyquire": "^1.3.1",
"rewire": "^2.1.3",

@@ -77,0 +79,0 @@ "rimraf": "^2.2.8",

@@ -36,10 +36,10 @@

participant Bob
Alice->John: Hello John, how are you?
Alice->>John: Hello John, how are you?
loop Healthcheck
John->John: Fight against hypochondria
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts &lt;br/>prevail...
John-->Alice: Great!
John->Bob: How about you?
Bob-->John: Jolly good!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
</code>

@@ -46,0 +46,0 @@ </pre>

@@ -75,8 +75,8 @@ /* parser generated by jison 0.4.15 */

var parser = (function(){
var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[6,9,11];
var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[6,9,10,12];
var parser = {trace: function trace() { },
yy: {},
symbols_: {"error":2,"start":3,"EX":4,"document":5,"EOF":6,"line":7,"statement":8,"NL":9,"message":10,"MESSAGE":11,"$accept":0,"$end":1},
terminals_: {2:"error",4:"EX",6:"EOF",9:"NL",11:"MESSAGE"},
productions_: [0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1],[10,1]],
symbols_: {"error":2,"start":3,"info":4,"document":5,"EOF":6,"line":7,"statement":8,"NL":9,"showInfo":10,"message":11,"say":12,"TXT":13,"$accept":0,"$end":1},
terminals_: {2:"error",4:"info",6:"EOF",9:"NL",10:"showInfo",12:"say",13:"TXT"},
productions_: [0,[3,3],[5,0],[5,2],[7,1],[7,1],[8,1],[8,1],[11,2]],
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {

@@ -94,10 +94,13 @@ /* this == yyval */

case 6:
yy.setMessage($$[$0]);
yy.setInfo(true);
break;
case 7:
this.$ = $$[$0].substring(1).trim().replace(/\\n/gm, "\n");
yy.setMessage($$[$0]);
break;
case 8:
this.$ = $$[$0-1].substring(1).trim().replace(/\\n/gm, "\n");
break;
}
},
table: [{3:1,4:[1,2]},{1:[3]},o($V0,[2,2],{5:3}),{6:[1,4],7:5,8:6,9:[1,7],10:8,11:[1,9]},{1:[2,1]},o($V0,[2,3]),o($V0,[2,4]),o($V0,[2,5]),o($V0,[2,6]),o($V0,[2,7])],
table: [{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],11:9,12:[1,10]},{1:[2,1]},o($V0,[2,3]),o($V0,[2,4]),o($V0,[2,5]),o($V0,[2,6]),o($V0,[2,7]),{13:[1,11]},o($V0,[2,8])],
defaultActions: {4:[2,1]},

@@ -248,3 +251,354 @@ parseError: function parseError(str, hash) {

}};
/* generated by jison-lex 0.3.4 */
var lexer = (function(){
var lexer = ({
EOF:1,
parseError:function parseError(str, hash) {
if (this.yy.parser) {
this.yy.parser.parseError(str, hash);
} else {
throw new Error(str);
}
},
// resets the lexer, sets new input
setInput:function (input, yy) {
this.yy = yy || this.yy || {};
this._input = input;
this._more = this._backtrack = this.done = false;
this.yylineno = this.yyleng = 0;
this.yytext = this.matched = this.match = '';
this.conditionStack = ['INITIAL'];
this.yylloc = {
first_line: 1,
first_column: 0,
last_line: 1,
last_column: 0
};
if (this.options.ranges) {
this.yylloc.range = [0,0];
}
this.offset = 0;
return this;
},
// consumes and returns one char from the input
input:function () {
var ch = this._input[0];
this.yytext += ch;
this.yyleng++;
this.offset++;
this.match += ch;
this.matched += ch;
var lines = ch.match(/(?:\r\n?|\n).*/g);
if (lines) {
this.yylineno++;
this.yylloc.last_line++;
} else {
this.yylloc.last_column++;
}
if (this.options.ranges) {
this.yylloc.range[1]++;
}
this._input = this._input.slice(1);
return ch;
},
// unshifts one char (or a string) into the input
unput:function (ch) {
var len = ch.length;
var lines = ch.split(/(?:\r\n?|\n)/g);
this._input = ch + this._input;
this.yytext = this.yytext.substr(0, this.yytext.length - len);
//this.yyleng -= len;
this.offset -= len;
var oldLines = this.match.split(/(?:\r\n?|\n)/g);
this.match = this.match.substr(0, this.match.length - 1);
this.matched = this.matched.substr(0, this.matched.length - 1);
if (lines.length - 1) {
this.yylineno -= lines.length - 1;
}
var r = this.yylloc.range;
this.yylloc = {
first_line: this.yylloc.first_line,
last_line: this.yylineno + 1,
first_column: this.yylloc.first_column,
last_column: lines ?
(lines.length === oldLines.length ? this.yylloc.first_column : 0)
+ oldLines[oldLines.length - lines.length].length - lines[0].length :
this.yylloc.first_column - len
};
if (this.options.ranges) {
this.yylloc.range = [r[0], r[0] + this.yyleng - len];
}
this.yyleng = this.yytext.length;
return this;
},
// When called from action, caches matched text and appends it on next action
more:function () {
this._more = true;
return this;
},
// 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.
reject:function () {
if (this.options.backtrack_lexer) {
this._backtrack = true;
} else {
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(), {
text: "",
token: null,
line: this.yylineno
});
}
return this;
},
// retain first n characters of the match
less:function (n) {
this.unput(this.match.slice(n));
},
// displays already matched input, i.e. for error messages
pastInput:function () {
var past = this.matched.substr(0, this.matched.length - this.match.length);
return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
},
// displays upcoming input, i.e. for error messages
upcomingInput:function () {
var next = this.match;
if (next.length < 20) {
next += this._input.substr(0, 20-next.length);
}
return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
},
// displays the character position where the lexing error occurred, i.e. for error messages
showPosition:function () {
var pre = this.pastInput();
var c = new Array(pre.length + 1).join("-");
return pre + this.upcomingInput() + "\n" + c + "^";
},
// test the lexed token: return FALSE when not a match, otherwise return token
test_match:function (match, indexed_rule) {
var token,
lines,
backup;
if (this.options.backtrack_lexer) {
// save context
backup = {
yylineno: this.yylineno,
yylloc: {
first_line: this.yylloc.first_line,
last_line: this.last_line,
first_column: this.yylloc.first_column,
last_column: this.yylloc.last_column
},
yytext: this.yytext,
match: this.match,
matches: this.matches,
matched: this.matched,
yyleng: this.yyleng,
offset: this.offset,
_more: this._more,
_input: this._input,
yy: this.yy,
conditionStack: this.conditionStack.slice(0),
done: this.done
};
if (this.options.ranges) {
backup.yylloc.range = this.yylloc.range.slice(0);
}
}
lines = match[0].match(/(?:\r\n?|\n).*/g);
if (lines) {
this.yylineno += lines.length;
}
this.yylloc = {
first_line: this.yylloc.last_line,
last_line: this.yylineno + 1,
first_column: this.yylloc.last_column,
last_column: lines ?
lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length :
this.yylloc.last_column + match[0].length
};
this.yytext += match[0];
this.match += match[0];
this.matches = match;
this.yyleng = this.yytext.length;
if (this.options.ranges) {
this.yylloc.range = [this.offset, this.offset += this.yyleng];
}
this._more = false;
this._backtrack = false;
this._input = this._input.slice(match[0].length);
this.matched += match[0];
token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
if (this.done && this._input) {
this.done = false;
}
if (token) {
return token;
} else if (this._backtrack) {
// recover context
for (var k in backup) {
this[k] = backup[k];
}
return false; // rule action called reject() implying the next rule should be tested instead.
}
return false;
},
// return next match in input
next:function () {
if (this.done) {
return this.EOF;
}
if (!this._input) {
this.done = true;
}
var token,
match,
tempMatch,
index;
if (!this._more) {
this.yytext = '';
this.match = '';
}
var rules = this._currentRules();
for (var i = 0; i < rules.length; i++) {
tempMatch = this._input.match(this.rules[rules[i]]);
if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
match = tempMatch;
index = i;
if (this.options.backtrack_lexer) {
token = this.test_match(tempMatch, rules[i]);
if (token !== false) {
return token;
} else if (this._backtrack) {
match = false;
continue; // rule action called reject() implying a rule MISmatch.
} else {
// else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
return false;
}
} else if (!this.options.flex) {
break;
}
}
}
if (match) {
token = this.test_match(match, rules[index]);
if (token !== false) {
return token;
}
// else: this is a lexer rule which consumes input without producing a token (e.g. whitespace)
return false;
}
if (this._input === "") {
return this.EOF;
} else {
return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), {
text: "",
token: null,
line: this.yylineno
});
}
},
// return next match that has a token
lex:function lex() {
var r = this.next();
if (r) {
return r;
} else {
return this.lex();
}
},
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
begin:function begin(condition) {
this.conditionStack.push(condition);
},
// pop the previously active lexer condition state off the condition stack
popState:function popState() {
var n = this.conditionStack.length - 1;
if (n > 0) {
return this.conditionStack.pop();
} else {
return this.conditionStack[0];
}
},
// produce the lexer rule set which is active for the currently active lexer condition state
_currentRules:function _currentRules() {
if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
} else {
return this.conditions["INITIAL"].rules;
}
},
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
topState:function topState(n) {
n = this.conditionStack.length - 1 - Math.abs(n || 0);
if (n >= 0) {
return this.conditionStack[n];
} else {
return "INITIAL";
}
},
// alias for begin(condition)
pushState:function pushState(condition) {
this.begin(condition);
},
// return the number of states currently on the stack
stateStackSize:function stateStackSize() {
return this.conditionStack.length;
},
options: {"case-insensitive":true},
performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
// Pre-lexer code can go here
var YYSTATE=YY_START;
switch($avoiding_name_collisions) {
case 0:return 9;
break;
case 1:return 10;
break;
case 2:return 4;
break;
case 3:return 12;
break;
case 4:return 13;
break;
case 5:return 6;
break;
case 6:return 'INVALID';
break;
}
},
rules: [/^(?:[\n]+)/i,/^(?:showInfo\b)/i,/^(?:info\b)/i,/^(?:say\b)/i,/^(?::[^#\n;]+)/i,/^(?:$)/i,/^(?:.)/i],
conditions: {"INITIAL":{"rules":[0,1,2,3,4,5,6],"inclusive":true}}
});
return lexer;
})();
parser.lexer = lexer;
function Parser () {

@@ -251,0 +605,0 @@ this.yy = {};

@@ -7,3 +7,3 @@ /**

var dot = require('./parser/dot');
var dagreD3 = require('dagre-d3');
var dagreD3 = require('./dagre-d3');
/**

@@ -64,3 +64,9 @@ * Function that adds the vertices found in the graph definition to the graph to be rendered.

console.log(verticeText);
var labelTypeStr = '';
if(global.mermaid.htmlLabels) {
labelTypeStr = 'html';
} else {
verticeText = verticeText.replace(/<br>/g, "\n");
labelTypeStr = 'text';
}

@@ -85,2 +91,5 @@ var radious = 0;

break;
case 'odd_right':
_shape = 'rect_left_inv_arrow';
break;
case 'circle':

@@ -93,3 +102,3 @@ _shape = 'circle';

// Add the node
g.setNode(vertice.id, {labelType: "html",shape:_shape, label: verticeText, rx: radious, ry: radious, class: classStr, style: style, id:vertice.id});
g.setNode(vertice.id, {labelType: labelTypeStr, shape:_shape, label: verticeText, rx: radious, ry: radious, class: classStr, style: style, id:vertice.id});
});

@@ -154,8 +163,12 @@ };

else {
var edgeText = edge.text.replace(/<br>/g, "\n");
if(typeof edge.style === 'undefined'){
g.setEdge(edge.start, edge.end,{labelType: "html",style: style, labelpos:'c', label: '<span style="background:#e8e8e8">'+edge.text+'</span>', arrowheadStyle: "fill: #333", arrowhead: aHead},cnt);
}else{
if (global.mermaid.htmlLabels){
g.setEdge(edge.start, edge.end,{labelType: "html",style: style, labelpos:'c', label: '<span style="background:#e8e8e8">'+edge.text+'</span>', arrowheadStyle: "fill: #333", arrowhead: aHead},cnt);
}else{
g.setEdge(edge.start, edge.end,{labelType: "text", style: "stroke: #333; stroke-width: 1.5px;fill:none", labelpos:'c', label: edgeText, arrowheadStyle: "fill: #333", arrowhead: aHead},cnt);
}
}else{
g.setEdge(edge.start, edge.end, {
labelType: "html",style: style, arrowheadStyle: "fill: #333", label: edge.text, arrowhead: aHead
labelType: "text", style: style, arrowheadStyle: "fill: #333", label: edgeText, arrowhead: aHead
},cnt);

@@ -191,6 +204,8 @@ }

// Add default class if undefined
if(typeof classes.default === 'undefined') {
if(typeof(classes.default) === 'undefined') {
classes.default = {id:'default'};
classes.default.styles = ['fill:#eaeaea','stroke:#666','stroke-width:1.5px'];
}
classes.default.styles = ['fill:#ffa','stroke:#666','stroke-width:3px'];
classes.default.nodeLabelStyles = ['fill:#000','stroke:none','font-weight:300','font-family:"Helvetica Neue",Helvetica,Arial,sans-serf','font-size:14px'];
classes.default.edgeLabelStyles = ['fill:#000','stroke:none','font-weight:300','font-family:"Helvetica Neue",Helvetica,Arial,sans-serf','font-size:14px'];
}
return classes;

@@ -216,4 +231,10 @@ };

// Parse the graph definition
parser.parse(text);
try{
parser.parse(text);
}
catch(err){
}
// Fetch the default direction, use TD if none was found

@@ -322,2 +343,24 @@ var dir;

// Add custom shape for box with inverted arrow on right side
render.shapes().rect_right_inv_arrow = function (parent, bbox, node) {
var w = bbox.width,
h = bbox.height,
points = [
{x: 0, y: 0},
{x: w+h/2, y: 0},
{x: w, y: -h/2},
{x: w+h/2, y: -h},
{x: 0, y: -h},
];
var shapeSvg = parent.insert("polygon", ":first-child")
.attr("points", points.map(function (d) {
return d.x + "," + d.y;
}).join(" "))
.attr("transform", "translate(" + (-w / 2) + "," + (h * 2 / 4) + ")");
node.intersect = function (point) {
return dagreD3.intersect.polygon(node, points, point);
};
return shapeSvg;
};
// Add our custom arrow - an empty arrowhead

@@ -346,3 +389,3 @@ render.arrows().none = function normal(parent, id, edge, type) {

render(d3.select("#" + id + " g"), g);
var svgb = document.querySelector('#mermaidChart0');
var svgb = document.querySelector("#" + id);

@@ -368,8 +411,5 @@ /*

setTimeout(function(){
console.log('Fixing titles');
var i = 0;
subGraphs.forEach(function(subG){
console.log('Setting id '+id);
var clusterRects = document.querySelectorAll('#' + id + ' .clusters rect');

@@ -380,3 +420,2 @@ var clusters = document.querySelectorAll('#' + id + ' .cluster');

if(subG.title !== 'undefined'){
console.log(clusterRects[i]);
var xPos = clusterRects[i].x.baseVal.value;

@@ -393,6 +432,2 @@ var yPos = clusterRects[i].y.baseVal.value;

te.style('text-anchor', 'middle');
console.log('Title '+subG.title);
console.log('i',i);
console.log('x'+xPos+width/2);
console.log('y'+xPos);
te.text(subG.title);

@@ -402,3 +437,4 @@ }

});
},200);
};
},20);
};

@@ -238,1 +238,5 @@ /**

};
exports.parseError = function(err,hash){
mermaid.parseError(err,hash);
};

@@ -75,3 +75,3 @@ /* parser generated by jison 0.4.15 */

var parser = (function(){
var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,9,10,12,19,29,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],$V1=[2,2],$V2=[1,9],$V3=[1,10],$V4=[1,11],$V5=[1,12],$V6=[1,20],$V7=[1,23],$V8=[1,24],$V9=[1,25],$Va=[1,26],$Vb=[1,27],$Vc=[1,32],$Vd=[1,21],$Ve=[1,34],$Vf=[1,31],$Vg=[1,33],$Vh=[1,39],$Vi=[1,38],$Vj=[1,35],$Vk=[1,36],$Vl=[1,37],$Vm=[1,9,10,12,19,29,32,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],$Vn=[29,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],$Vo=[2,19],$Vp=[1,51],$Vq=[1,52],$Vr=[1,50],$Vs=[1,75],$Vt=[1,67],$Vu=[1,76],$Vv=[1,63],$Vw=[1,62],$Vx=[1,77],$Vy=[1,78],$Vz=[1,68],$VA=[1,65],$VB=[1,64],$VC=[1,70],$VD=[1,71],$VE=[1,72],$VF=[1,73],$VG=[1,74],$VH=[9,10,19],$VI=[1,85],$VJ=[1,86],$VK=[1,87],$VL=[1,88],$VM=[1,89],$VN=[1,90],$VO=[1,91],$VP=[1,92],$VQ=[1,93],$VR=[1,94],$VS=[1,95],$VT=[1,96],$VU=[9,10,19,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61],$VV=[9,10,12,15,19,36,38,40,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,76,79,81,82,84,85,87,88,89],$VW=[9,10,11,12,13,15,16,19,29,32,36,37,38,39,40,41,44,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,67,68,69,70,71,76,79,81,82,84,85,87,88,89,90,91,92],$VX=[1,110],$VY=[1,113],$VZ=[1,111],$V_=[9,10,12,19,29,32,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],$V$=[9,10,11,12,13,15,16,19,29,32,37,39,41,44,47,49,62,67,68,69,70,71,76,79,81,82,84,85,87,88,89],$V01=[9,10,11,12,13,15,16,19,29,32,36,37,38,39,40,41,44,47,49,50,51,52,53,62,67,68,69,70,71,76,79,81,82,84,85,87,88,89,90,91,92],$V11=[2,122],$V21=[1,139],$V31=[1,128],$V41=[1,129],$V51=[1,126],$V61=[1,127],$V71=[1,130],$V81=[1,131],$V91=[1,135],$Va1=[1,136],$Vb1=[1,134],$Vc1=[1,137],$Vd1=[1,125],$Ve1=[1,132],$Vf1=[1,133],$Vg1=[1,138],$Vh1=[76,79,81,82,84,85,87,88,89],$Vi1=[12,62,76,79,81,82,84,85,87,88,89],$Vj1=[1,164],$Vk1=[1,163],$Vl1=[9,11,12,13,15,16,19,29,32,36,37,38,39,40,41,44,47,49,50,51,52,53,62,67,68,69,70,71,76,79,81,82,84,85,87,88,89,90,91,92],$Vm1=[1,197],$Vn1=[1,194],$Vo1=[1,201],$Vp1=[1,198],$Vq1=[1,195],$Vr1=[1,202],$Vs1=[1,192],$Vt1=[1,193],$Vu1=[1,196],$Vv1=[1,199],$Vw1=[1,200],$Vx1=[11,12,13,15,16,29,32,44,47,49,67,68,69,70,71,76,79,81,82,84,85,87,88,89],$Vy1=[1,217],$Vz1=[9,10,19,79],$VA1=[9,10,12,19,44,67,75,76,77,79,81,82,83,84,85];
var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,9,10,12,19,29,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],$V1=[2,2],$V2=[1,9],$V3=[1,10],$V4=[1,11],$V5=[1,12],$V6=[1,20],$V7=[1,23],$V8=[1,24],$V9=[1,25],$Va=[1,26],$Vb=[1,27],$Vc=[1,32],$Vd=[1,21],$Ve=[1,34],$Vf=[1,31],$Vg=[1,33],$Vh=[1,39],$Vi=[1,38],$Vj=[1,35],$Vk=[1,36],$Vl=[1,37],$Vm=[1,9,10,12,19,29,32,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],$Vn=[29,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],$Vo=[2,19],$Vp=[1,51],$Vq=[1,52],$Vr=[1,50],$Vs=[1,76],$Vt=[1,68],$Vu=[1,77],$Vv=[1,63],$Vw=[1,62],$Vx=[1,81],$Vy=[1,80],$Vz=[1,78],$VA=[1,79],$VB=[1,69],$VC=[1,65],$VD=[1,64],$VE=[1,71],$VF=[1,72],$VG=[1,73],$VH=[1,74],$VI=[1,75],$VJ=[1,66],$VK=[9,10,19],$VL=[1,88],$VM=[1,89],$VN=[1,90],$VO=[1,91],$VP=[1,92],$VQ=[1,93],$VR=[1,94],$VS=[1,95],$VT=[1,96],$VU=[1,97],$VV=[1,98],$VW=[1,99],$VX=[9,10,19,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61],$VY=[9,10,12,15,19,36,38,40,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,76,79,81,82,84,85,87,88,89],$VZ=[9,10,11,12,13,15,16,17,18,19,29,32,36,37,38,39,40,41,44,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89,90,91,92],$V_=[1,113],$V$=[1,116],$V01=[1,114],$V11=[9,10,12,19,29,32,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],$V21=[9,10,11,12,13,15,16,17,18,19,29,32,37,39,41,44,47,49,62,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],$V31=[9,10,11,12,13,15,16,17,18,19,29,32,36,37,38,39,40,41,44,47,49,50,51,52,53,62,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89,90,91,92],$V41=[2,125],$V51=[1,142],$V61=[1,131],$V71=[1,132],$V81=[1,129],$V91=[1,130],$Va1=[1,133],$Vb1=[1,134],$Vc1=[1,138],$Vd1=[1,139],$Ve1=[1,137],$Vf1=[1,140],$Vg1=[1,128],$Vh1=[1,135],$Vi1=[1,136],$Vj1=[1,141],$Vk1=[76,79,81,82,84,85,87,88,89],$Vl1=[12,62,76,79,81,82,84,85,87,88,89],$Vm1=[1,167],$Vn1=[1,166],$Vo1=[9,11,12,13,15,16,17,18,19,29,32,36,37,38,39,40,41,44,47,49,50,51,52,53,62,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89,90,91,92],$Vp1=[1,200],$Vq1=[1,197],$Vr1=[1,204],$Vs1=[1,201],$Vt1=[1,198],$Vu1=[1,205],$Vv1=[1,195],$Vw1=[1,196],$Vx1=[1,199],$Vy1=[1,202],$Vz1=[1,203],$VA1=[11,12,13,15,16,17,18,29,32,44,47,49,67,68,69,70,71,76,77,79,81,82,84,85,87,88,89],$VB1=[1,220],$VC1=[9,10,19,79],$VD1=[9,10,12,19,44,67,75,76,77,79,81,82,83,84,85];
var parser = {trace: function trace() { },

@@ -81,3 +81,3 @@ yy: {},

terminals_: {2:"error",9:"SEMI",10:"EOF",11:"GRAPH",12:"SPACE",13:"DIR",15:"TAGEND",16:"TAGSTART",17:"UP",18:"DOWN",19:"NEWLINE",29:"subgraph",32:"end",36:"SQS",37:"SQE",38:"PS",39:"PE",40:"DIAMOND_START",41:"DIAMOND_STOP",44:"MINUS",47:"--",48:"-.",49:"==",50:"ARROW_POINT",51:"ARROW_CIRCLE",52:"ARROW_CROSS",53:"ARROW_OPEN",54:"DOTTED_ARROW_POINT",55:"DOTTED_ARROW_CIRCLE",56:"DOTTED_ARROW_CROSS",57:"DOTTED_ARROW_OPEN",58:"THICK_ARROW_POINT",59:"THICK_ARROW_CIRCLE",60:"THICK_ARROW_CROSS",61:"THICK_ARROW_OPEN",62:"PIPE",67:"STYLE",68:"LINKSTYLE",69:"CLASSDEF",70:"CLASS",71:"CLICK",75:"HEX",76:"NUM",77:"PCT",79:"COMMA",81:"ALPHA",82:"COLON",83:"UNIT",84:"BRKT",85:"DOT",87:"PLUS",88:"EQUALS",89:"MULT",90:"TAG_START",91:"TAG_END",92:"QUOTE"},
productions_: [0,[3,2],[5,0],[5,2],[6,2],[6,1],[6,1],[6,1],[4,4],[4,4],[4,4],[4,4],[4,4],[14,1],[14,1],[14,2],[7,2],[7,2],[7,1],[7,1],[20,2],[20,1],[8,2],[8,2],[8,2],[8,2],[8,2],[8,2],[8,2],[8,6],[8,5],[31,1],[31,2],[23,1],[23,1],[23,1],[22,3],[22,1],[33,4],[33,5],[33,6],[33,7],[33,4],[33,5],[33,4],[33,5],[33,4],[33,5],[33,1],[33,2],[35,1],[35,2],[42,1],[42,3],[34,2],[34,3],[34,1],[34,2],[34,5],[34,6],[34,5],[34,6],[34,5],[34,6],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[46,3],[30,1],[30,2],[64,1],[64,2],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[72,1],[72,2],[26,5],[27,5],[28,5],[24,5],[24,5],[25,5],[21,3],[74,1],[74,3],[78,1],[78,2],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[65,1],[65,1],[63,1],[63,1],[63,1],[63,1],[63,1],[73,1],[73,1],[73,1],[73,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1]],
productions_: [0,[3,2],[5,0],[5,2],[6,2],[6,1],[6,1],[6,1],[4,4],[4,4],[4,4],[4,4],[4,4],[14,1],[14,1],[14,2],[7,2],[7,2],[7,1],[7,1],[20,2],[20,1],[8,2],[8,2],[8,2],[8,2],[8,2],[8,2],[8,2],[8,6],[8,5],[31,1],[31,2],[23,1],[23,1],[23,1],[22,3],[22,1],[33,4],[33,5],[33,6],[33,7],[33,4],[33,5],[33,4],[33,5],[33,4],[33,5],[33,1],[33,2],[35,1],[35,2],[42,1],[42,3],[34,2],[34,3],[34,1],[34,2],[34,5],[34,6],[34,5],[34,6],[34,5],[34,6],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[46,3],[30,1],[30,2],[64,1],[64,2],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[66,1],[72,1],[72,2],[26,5],[27,5],[28,5],[24,5],[24,5],[25,5],[21,3],[74,1],[74,3],[78,1],[78,2],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[80,1],[65,1],[65,1],[63,1],[63,1],[63,1],[63,1],[63,1],[63,1],[73,1],[73,1],[73,1],[73,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[43,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1]],
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {

@@ -98,3 +98,3 @@ /* this == yyval */

break;
case 4: case 5: case 50: case 52: case 77: case 79: case 90:
case 4: case 5: case 50: case 52: case 77: case 79: case 92:
this.$=$$[$0];

@@ -171,3 +171,3 @@ break;

break;
case 51: case 78: case 80: case 91:
case 51: case 78: case 80: case 93:
this.$=$$[$0-1]+''+$$[$0];

@@ -232,24 +232,24 @@ break;

break;
case 92:
case 94:
this.$ = $$[$0-4];yy.addClass($$[$0-2],$$[$0]);
break;
case 93:
case 95:
this.$ = $$[$0-4];yy.setClass($$[$0-2], $$[$0]);
break;
case 94:
case 96:
this.$ = $$[$0-4];yy.setClickEvent($$[$0-2], $$[$0]);
break;
case 95:
case 97:
this.$ = $$[$0-4];yy.addVertex($$[$0-2],undefined,undefined,$$[$0]);
break;
case 96: case 97:
case 98: case 99:
this.$ = $$[$0-4];yy.updateLink($$[$0-2],$$[$0]);
break;
case 99:
case 101:
this.$ = [$$[$0]]
break;
case 100:
case 102:
$$[$0-2].push($$[$0]);this.$ = $$[$0-2];
break;
case 102:
case 104:
this.$ = $$[$0-1] + $$[$0];

@@ -259,4 +259,4 @@ break;

},
table: [{3:1,4:2,11:[1,3]},{1:[3]},o($V0,$V1,{5:4}),{12:[1,5]},{1:[2,1],6:6,7:7,8:8,9:$V2,10:$V3,12:$V4,19:$V5,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:$V6,33:22,35:28,42:29,43:30,67:$V7,68:$V8,69:$V9,70:$Va,71:$Vb,76:$Vc,77:$Vd,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{13:[1,40],15:[1,41],16:[1,42],17:[1,43],18:[1,44]},o($Vm,[2,3]),{8:45,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:$V6,33:22,35:28,42:29,43:30,67:$V7,68:$V8,69:$V9,70:$Va,71:$Vb,76:$Vc,77:$Vd,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},o($Vm,[2,5]),o($Vm,[2,6]),o($Vm,[2,7]),o($Vn,$Vo,{7:46,12:$V4,19:$V5}),o($Vn,[2,18],{7:47,12:$V4,19:$V5}),{19:[1,48]},{9:$Vp,10:$Vq,19:$Vr,23:49},{9:$Vp,10:$Vq,19:$Vr,23:53},{9:$Vp,10:$Vq,19:$Vr,23:54},{9:$Vp,10:$Vq,19:$Vr,23:55},{9:$Vp,10:$Vq,19:$Vr,23:56},{9:$Vp,10:$Vq,19:$Vr,23:57},{9:$Vp,10:$Vq,11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,19:$Vr,23:59,29:$Vx,30:58,32:$Vy,43:66,44:$Vz,47:$VA,49:$VB,63:60,66:69,67:$VC,68:$VD,69:$VE,70:$VF,71:$VG,73:61,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{77:[1,79]},o($VH,[2,37],{34:80,45:81,47:[1,82],48:[1,83],49:[1,84],50:$VI,51:$VJ,52:$VK,53:$VL,54:$VM,55:$VN,56:$VO,57:$VP,58:$VQ,59:$VR,60:$VS,61:$VT}),{12:[1,97]},{12:[1,98]},{12:[1,99]},{12:[1,100]},{12:[1,101]},o($VU,[2,48],{43:30,42:107,12:[1,106],15:[1,105],36:[1,102],38:[1,103],40:[1,104],76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl}),o($VV,[2,50]),o($VV,[2,52],{44:[1,108]}),o($VW,[2,125]),o($VW,[2,126]),o($VW,[2,127]),o($VW,[2,128]),o($VW,[2,129]),o($VW,[2,130]),o($VW,[2,131]),o($VW,[2,132]),o($VW,[2,133]),{9:$VX,12:$VY,14:109,19:$VZ,20:112},{9:$VX,12:$VY,14:114,19:$VZ,20:112},{9:$VX,12:$VY,14:115,19:$VZ,20:112},{9:$VX,12:$VY,14:116,19:$VZ,20:112},{9:$VX,12:$VY,14:117,19:$VZ,20:112},o($Vm,[2,4]),o($Vn,[2,16]),o($Vn,[2,17]),o($Vm,[2,22]),o($Vm,[2,23]),o($Vm,[2,33]),o($Vm,[2,34]),o($Vm,[2,35]),o($Vm,[2,24]),o($Vm,[2,25]),o($Vm,[2,26]),o($Vm,[2,27]),o($Vm,[2,28]),{9:$Vp,10:$Vq,11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,19:$Vr,23:118,29:$Vx,32:$Vy,43:66,44:$Vz,47:$VA,49:$VB,63:119,66:69,67:$VC,68:$VD,69:$VE,70:$VF,71:$VG,73:61,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},o($V_,$V1,{5:120}),o($V$,[2,77]),o($V01,[2,116]),o($V01,[2,117]),o($V01,[2,118]),o($V01,[2,119]),o($V01,[2,120]),o($V01,[2,121]),o($V01,$V11),o($V01,[2,123]),o($V01,[2,124]),o($V01,[2,81]),o($V01,[2,82]),o($V01,[2,83]),o($V01,[2,84]),o($V01,[2,85]),o($V01,[2,86]),o($V01,[2,87]),o($V01,[2,88]),o($V01,[2,89]),{9:$V21,11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,29:$Vx,32:$Vy,36:$V31,37:$V41,38:$V51,39:$V61,40:$V71,41:$V81,43:66,44:$Vz,47:$VA,49:$VB,50:$V91,51:$Va1,52:$Vb1,53:$Vc1,62:$Vd1,63:123,64:121,65:122,66:69,67:$VC,68:$VD,69:$VE,70:$VF,71:$VG,73:61,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,86:124,87:$Vj,88:$Vk,89:$Vl,90:$Ve1,91:$Vf1,92:$Vg1},{33:140,35:28,42:29,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},o($Vh1,[2,56],{46:141,12:[1,142],62:[1,143]}),{12:[1,144]},{12:[1,145]},{12:[1,146]},o($Vi1,[2,64]),o($Vi1,[2,65]),o($Vi1,[2,66]),o($Vi1,[2,67]),o($Vi1,[2,68]),o($Vi1,[2,69]),o($Vi1,[2,70]),o($Vi1,[2,71]),o($Vi1,[2,72]),o($Vi1,[2,73]),o($Vi1,[2,74]),o($Vi1,[2,75]),{35:147,42:29,43:30,75:[1,148],76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{76:[1,149]},{35:150,42:29,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{35:151,42:29,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{35:152,42:29,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,29:$Vx,30:153,32:$Vy,43:66,44:$Vz,47:$VA,49:$VB,63:60,66:69,67:$VC,68:$VD,69:$VE,70:$VF,71:$VG,73:61,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,29:$Vx,30:155,32:$Vy,38:[1,154],43:66,44:$Vz,47:$VA,49:$VB,63:60,66:69,67:$VC,68:$VD,69:$VE,70:$VF,71:$VG,73:61,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,29:$Vx,30:156,32:$Vy,43:66,44:$Vz,47:$VA,49:$VB,63:60,66:69,67:$VC,68:$VD,69:$VE,70:$VF,71:$VG,73:61,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,29:$Vx,30:157,32:$Vy,43:66,44:$Vz,47:$VA,49:$VB,63:60,66:69,67:$VC,68:$VD,69:$VE,70:$VF,71:$VG,73:61,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},o($VU,[2,49]),o($VV,[2,51]),{43:158,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},o($V0,[2,8]),o($V0,[2,13]),o($V0,[2,14]),{19:[1,159]},{12:$VY,19:[2,21],20:160},o($V0,[2,9]),o($V0,[2,10]),o($V0,[2,11]),o($V0,[2,12]),o($V_,$V1,{5:161}),o($V$,[2,78]),{6:6,7:7,8:8,9:$V2,10:$V3,12:$Vj1,19:$V5,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:$V6,31:162,32:$Vk1,33:22,35:28,42:29,43:30,67:$V7,68:$V8,69:$V9,70:$Va,71:$Vb,76:$Vc,77:$Vd,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{9:$V21,11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,19:[2,98],29:$Vx,32:$Vy,36:$V31,37:$V41,38:$V51,39:$V61,40:$V71,41:$V81,43:66,44:$Vz,47:$VA,49:$VB,50:$V91,51:$Va1,52:$Vb1,53:$Vc1,62:$Vd1,63:123,65:165,66:69,67:$VC,68:$VD,69:$VE,70:$VF,71:$VG,73:61,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,86:124,87:$Vj,88:$Vk,89:$Vl,90:$Ve1,91:$Vf1,92:$Vg1},o($Vl1,[2,79]),o($Vl1,[2,114]),o($Vl1,[2,115]),o($Vl1,[2,134]),o($Vl1,[2,135]),o($Vl1,[2,136]),o($Vl1,[2,137]),o($Vl1,[2,138]),o($Vl1,[2,139]),o($Vl1,[2,140]),o($Vl1,[2,141]),o($Vl1,[2,142]),o($Vl1,[2,143]),o($Vl1,[2,144]),o($Vl1,[2,145]),o($Vl1,[2,146]),o($Vl1,[2,147]),o($Vl1,[2,148]),o($VH,[2,36]),o($Vh1,[2,54],{12:[1,166]}),o($Vh1,[2,57]),{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,29:$Vx,30:167,32:$Vy,43:66,44:$Vz,47:$VA,49:$VB,63:60,66:69,67:$VC,68:$VD,69:$VE,70:$VF,71:$VG,73:61,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,29:$Vx,30:168,32:$Vy,43:66,44:$Vz,47:$VA,49:$VB,63:60,66:69,67:$VC,68:$VD,69:$VE,70:$VF,71:$VG,73:61,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,29:$Vx,30:169,32:$Vy,43:66,44:$Vz,47:$VA,49:$VB,63:60,66:69,67:$VC,68:$VD,69:$VE,70:$VF,71:$VG,73:61,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,29:$Vx,30:170,32:$Vy,43:66,44:$Vz,47:$VA,49:$VB,63:60,66:69,67:$VC,68:$VD,69:$VE,70:$VF,71:$VG,73:61,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{12:[1,171],42:107,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{12:[1,172]},{12:[1,173]},{12:[1,174],42:107,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{12:[1,175],42:107,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{12:[1,176],42:107,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,29:$Vx,32:$Vy,37:[1,177],43:66,44:$Vz,47:$VA,49:$VB,63:119,66:69,67:$VC,68:$VD,69:$VE,70:$VF,71:$VG,73:61,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,29:$Vx,30:178,32:$Vy,43:66,44:$Vz,47:$VA,49:$VB,63:60,66:69,67:$VC,68:$VD,69:$VE,70:$VF,71:$VG,73:61,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,29:$Vx,32:$Vy,39:[1,179],43:66,44:$Vz,47:$VA,49:$VB,63:119,66:69,67:$VC,68:$VD,69:$VE,70:$VF,71:$VG,73:61,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,29:$Vx,32:$Vy,41:[1,180],43:66,44:$Vz,47:$VA,49:$VB,63:119,66:69,67:$VC,68:$VD,69:$VE,70:$VF,71:$VG,73:61,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,29:$Vx,32:$Vy,37:[1,181],43:66,44:$Vz,47:$VA,49:$VB,63:119,66:69,67:$VC,68:$VD,69:$VE,70:$VF,71:$VG,73:61,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},o($VV,[2,53]),o($V0,[2,15]),{19:[2,20]},{6:6,7:7,8:8,9:$V2,10:$V3,12:$Vj1,19:$V5,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:$V6,31:182,32:$Vk1,33:22,35:28,42:29,43:30,67:$V7,68:$V8,69:$V9,70:$Va,71:$Vb,76:$Vc,77:$Vd,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{9:$Vp,10:$Vq,19:$Vr,23:183},o($VH,[2,31]),o($Vn,$Vo,{7:46,31:184,12:$Vj1,19:$V5,32:$Vk1}),o($Vl1,[2,80]),o($Vh1,[2,55]),{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,29:$Vx,32:$Vy,43:66,44:$Vz,47:$VA,49:$VB,62:[1,185],63:119,66:69,67:$VC,68:$VD,69:$VE,70:$VF,71:$VG,73:61,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:[1,186],13:$Vu,15:$Vv,16:$Vw,29:$Vx,32:$Vy,43:66,44:$Vz,47:$VA,49:$VB,63:119,66:69,67:$VC,68:$VD,69:$VE,70:$VF,71:$VG,73:61,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:[1,187],13:$Vu,15:$Vv,16:$Vw,29:$Vx,32:$Vy,43:66,44:$Vz,47:$VA,49:$VB,63:119,66:69,67:$VC,68:$VD,69:$VE,70:$VF,71:$VG,73:61,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:[1,188],13:$Vu,15:$Vv,16:$Vw,29:$Vx,32:$Vy,43:66,44:$Vz,47:$VA,49:$VB,63:119,66:69,67:$VC,68:$VD,69:$VE,70:$VF,71:$VG,73:61,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{12:$Vm1,44:$Vn1,67:$Vo1,74:189,75:$Vp1,76:$Vq1,77:$Vr1,78:190,80:191,81:$Vs1,82:$Vt1,83:$Vu1,84:$Vv1,85:$Vw1},{12:$Vm1,44:$Vn1,67:$Vo1,74:203,75:$Vp1,76:$Vq1,77:$Vr1,78:190,80:191,81:$Vs1,82:$Vt1,83:$Vu1,84:$Vv1,85:$Vw1},{12:$Vm1,44:$Vn1,67:$Vo1,74:204,75:$Vp1,76:$Vq1,77:$Vr1,78:190,80:191,81:$Vs1,82:$Vt1,83:$Vu1,84:$Vv1,85:$Vw1},{12:$Vm1,44:$Vn1,67:$Vo1,74:205,75:$Vp1,76:$Vq1,77:$Vr1,78:190,80:191,81:$Vs1,82:$Vt1,83:$Vu1,84:$Vv1,85:$Vw1},{35:206,42:29,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{35:207,42:29,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},o($VU,[2,38],{12:[1,208]}),{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,29:$Vx,32:$Vy,39:[1,209],43:66,44:$Vz,47:$VA,49:$VB,63:119,66:69,67:$VC,68:$VD,69:$VE,70:$VF,71:$VG,73:61,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},o($VU,[2,42],{12:[1,210]}),o($VU,[2,44],{12:[1,211]}),o($VU,[2,46],{12:[1,212]}),{9:$Vp,10:$Vq,19:$Vr,23:213},o($Vm,[2,30]),o($VH,[2,32]),o([12,76,79,81,82,84,85,87,88,89],[2,76]),o($Vx1,$V11,{45:214,50:$VI,51:$VJ,52:$VK,53:$VL,54:$VM,55:$VN,56:$VO,57:$VP,58:$VQ,59:$VR,60:$VS,61:$VT}),o($Vx1,$V11,{45:215,50:$VI,51:$VJ,52:$VK,53:$VL,54:$VM,55:$VN,56:$VO,57:$VP,58:$VQ,59:$VR,60:$VS,61:$VT}),o($Vx1,$V11,{45:216,50:$VI,51:$VJ,52:$VK,53:$VL,54:$VM,55:$VN,56:$VO,57:$VP,58:$VQ,59:$VR,60:$VS,61:$VT}),o($VH,[2,95],{79:$Vy1}),o($Vz1,[2,99],{80:218,12:$Vm1,44:$Vn1,67:$Vo1,75:$Vp1,76:$Vq1,77:$Vr1,81:$Vs1,82:$Vt1,83:$Vu1,84:$Vv1,85:$Vw1}),o($VA1,[2,101]),o($VA1,[2,103]),o($VA1,[2,104]),o($VA1,[2,105]),o($VA1,[2,106]),o($VA1,[2,107]),o($VA1,[2,108]),o($VA1,[2,109]),o($VA1,[2,110]),o($VA1,[2,111]),o($VA1,[2,112]),o($VA1,[2,113]),o($VH,[2,96],{79:$Vy1}),o($VH,[2,97],{79:$Vy1}),o($VH,[2,92],{79:$Vy1}),o($VH,[2,93],{43:30,42:107,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl}),o($VH,[2,94],{43:30,42:107,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl}),o($VU,[2,39]),{39:[1,219]},o($VU,[2,43]),o($VU,[2,45]),o($VU,[2,47]),o($Vm,[2,29]),o($Vh1,[2,58],{12:[1,220]}),o($Vh1,[2,60],{12:[1,221]}),o($Vh1,[2,62],{12:[1,222]}),{12:$Vm1,44:$Vn1,67:$Vo1,75:$Vp1,76:$Vq1,77:$Vr1,78:223,80:191,81:$Vs1,82:$Vt1,83:$Vu1,84:$Vv1,85:$Vw1},o($VA1,[2,102]),o($VU,[2,40],{12:[1,224]}),o($Vh1,[2,59]),o($Vh1,[2,61]),o($Vh1,[2,63]),o($Vz1,[2,100],{80:218,12:$Vm1,44:$Vn1,67:$Vo1,75:$Vp1,76:$Vq1,77:$Vr1,81:$Vs1,82:$Vt1,83:$Vu1,84:$Vv1,85:$Vw1}),o($VU,[2,41])],
defaultActions: {160:[2,20]},
table: [{3:1,4:2,11:[1,3]},{1:[3]},o($V0,$V1,{5:4}),{12:[1,5]},{1:[2,1],6:6,7:7,8:8,9:$V2,10:$V3,12:$V4,19:$V5,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:$V6,33:22,35:28,42:29,43:30,67:$V7,68:$V8,69:$V9,70:$Va,71:$Vb,76:$Vc,77:$Vd,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{13:[1,40],15:[1,41],16:[1,42],17:[1,43],18:[1,44]},o($Vm,[2,3]),{8:45,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:$V6,33:22,35:28,42:29,43:30,67:$V7,68:$V8,69:$V9,70:$Va,71:$Vb,76:$Vc,77:$Vd,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},o($Vm,[2,5]),o($Vm,[2,6]),o($Vm,[2,7]),o($Vn,$Vo,{7:46,12:$V4,19:$V5}),o($Vn,[2,18],{7:47,12:$V4,19:$V5}),{19:[1,48]},{9:$Vp,10:$Vq,19:$Vr,23:49},{9:$Vp,10:$Vq,19:$Vr,23:53},{9:$Vp,10:$Vq,19:$Vr,23:54},{9:$Vp,10:$Vq,19:$Vr,23:55},{9:$Vp,10:$Vq,19:$Vr,23:56},{9:$Vp,10:$Vq,19:$Vr,23:57},{9:$Vp,10:$Vq,11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,19:$Vr,23:59,29:$Vz,30:58,32:$VA,43:67,44:$VB,47:$VC,49:$VD,63:60,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{77:[1,82]},o($VK,[2,37],{34:83,45:84,47:[1,85],48:[1,86],49:[1,87],50:$VL,51:$VM,52:$VN,53:$VO,54:$VP,55:$VQ,56:$VR,57:$VS,58:$VT,59:$VU,60:$VV,61:$VW}),{12:[1,100]},{12:[1,101]},{12:[1,102]},{12:[1,103]},{12:[1,104]},o($VX,[2,48],{43:30,42:110,12:[1,109],15:[1,108],36:[1,105],38:[1,106],40:[1,107],76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl}),o($VY,[2,50]),o($VY,[2,52],{44:[1,111]}),o($VZ,[2,128]),o($VZ,[2,129]),o($VZ,[2,130]),o($VZ,[2,131]),o($VZ,[2,132]),o($VZ,[2,133]),o($VZ,[2,134]),o($VZ,[2,135]),o($VZ,[2,136]),{9:$V_,12:$V$,14:112,19:$V01,20:115},{9:$V_,12:$V$,14:117,19:$V01,20:115},{9:$V_,12:$V$,14:118,19:$V01,20:115},{9:$V_,12:$V$,14:119,19:$V01,20:115},{9:$V_,12:$V$,14:120,19:$V01,20:115},o($Vm,[2,4]),o($Vn,[2,16]),o($Vn,[2,17]),o($Vm,[2,22]),o($Vm,[2,23]),o($Vm,[2,33]),o($Vm,[2,34]),o($Vm,[2,35]),o($Vm,[2,24]),o($Vm,[2,25]),o($Vm,[2,26]),o($Vm,[2,27]),o($Vm,[2,28]),{9:$Vp,10:$Vq,11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,19:$Vr,23:121,29:$Vz,32:$VA,43:67,44:$VB,47:$VC,49:$VD,63:122,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},o($V11,$V1,{5:123}),o($V21,[2,77]),o($V31,[2,118]),o($V31,[2,119]),o($V31,[2,120]),o($V31,[2,121]),o($V31,[2,122]),o($V31,[2,123]),o($V31,[2,124]),o($V31,$V41),o($V31,[2,126]),o($V31,[2,127]),o($V31,[2,81]),o($V31,[2,82]),o($V31,[2,83]),o($V31,[2,84]),o($V31,[2,85]),o($V31,[2,86]),o($V31,[2,87]),o($V31,[2,88]),o($V31,[2,89]),o($V31,[2,90]),o($V31,[2,91]),{9:$V51,11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,32:$VA,36:$V61,37:$V71,38:$V81,39:$V91,40:$Va1,41:$Vb1,43:67,44:$VB,47:$VC,49:$VD,50:$Vc1,51:$Vd1,52:$Ve1,53:$Vf1,62:$Vg1,63:126,64:124,65:125,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,86:127,87:$Vj,88:$Vk,89:$Vl,90:$Vh1,91:$Vi1,92:$Vj1},{33:143,35:28,42:29,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},o($Vk1,[2,56],{46:144,12:[1,145],62:[1,146]}),{12:[1,147]},{12:[1,148]},{12:[1,149]},o($Vl1,[2,64]),o($Vl1,[2,65]),o($Vl1,[2,66]),o($Vl1,[2,67]),o($Vl1,[2,68]),o($Vl1,[2,69]),o($Vl1,[2,70]),o($Vl1,[2,71]),o($Vl1,[2,72]),o($Vl1,[2,73]),o($Vl1,[2,74]),o($Vl1,[2,75]),{35:150,42:29,43:30,75:[1,151],76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{76:[1,152]},{35:153,42:29,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{35:154,42:29,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{35:155,42:29,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,30:156,32:$VA,43:67,44:$VB,47:$VC,49:$VD,63:60,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,30:158,32:$VA,38:[1,157],43:67,44:$VB,47:$VC,49:$VD,63:60,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,30:159,32:$VA,43:67,44:$VB,47:$VC,49:$VD,63:60,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,30:160,32:$VA,43:67,44:$VB,47:$VC,49:$VD,63:60,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},o($VX,[2,49]),o($VY,[2,51]),{43:161,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},o($V0,[2,8]),o($V0,[2,13]),o($V0,[2,14]),{19:[1,162]},{12:$V$,19:[2,21],20:163},o($V0,[2,9]),o($V0,[2,10]),o($V0,[2,11]),o($V0,[2,12]),o($V11,$V1,{5:164}),o($V21,[2,78]),{6:6,7:7,8:8,9:$V2,10:$V3,12:$Vm1,19:$V5,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:$V6,31:165,32:$Vn1,33:22,35:28,42:29,43:30,67:$V7,68:$V8,69:$V9,70:$Va,71:$Vb,76:$Vc,77:$Vd,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{9:$V51,11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,19:[2,100],29:$Vz,32:$VA,36:$V61,37:$V71,38:$V81,39:$V91,40:$Va1,41:$Vb1,43:67,44:$VB,47:$VC,49:$VD,50:$Vc1,51:$Vd1,52:$Ve1,53:$Vf1,62:$Vg1,63:126,65:168,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,86:127,87:$Vj,88:$Vk,89:$Vl,90:$Vh1,91:$Vi1,92:$Vj1},o($Vo1,[2,79]),o($Vo1,[2,116]),o($Vo1,[2,117]),o($Vo1,[2,137]),o($Vo1,[2,138]),o($Vo1,[2,139]),o($Vo1,[2,140]),o($Vo1,[2,141]),o($Vo1,[2,142]),o($Vo1,[2,143]),o($Vo1,[2,144]),o($Vo1,[2,145]),o($Vo1,[2,146]),o($Vo1,[2,147]),o($Vo1,[2,148]),o($Vo1,[2,149]),o($Vo1,[2,150]),o($Vo1,[2,151]),o($VK,[2,36]),o($Vk1,[2,54],{12:[1,169]}),o($Vk1,[2,57]),{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,30:170,32:$VA,43:67,44:$VB,47:$VC,49:$VD,63:60,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,30:171,32:$VA,43:67,44:$VB,47:$VC,49:$VD,63:60,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,30:172,32:$VA,43:67,44:$VB,47:$VC,49:$VD,63:60,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,30:173,32:$VA,43:67,44:$VB,47:$VC,49:$VD,63:60,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{12:[1,174],42:110,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{12:[1,175]},{12:[1,176]},{12:[1,177],42:110,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{12:[1,178],42:110,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{12:[1,179],42:110,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,32:$VA,37:[1,180],43:67,44:$VB,47:$VC,49:$VD,63:122,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,30:181,32:$VA,43:67,44:$VB,47:$VC,49:$VD,63:60,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,32:$VA,39:[1,182],43:67,44:$VB,47:$VC,49:$VD,63:122,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,32:$VA,41:[1,183],43:67,44:$VB,47:$VC,49:$VD,63:122,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,32:$VA,37:[1,184],43:67,44:$VB,47:$VC,49:$VD,63:122,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},o($VY,[2,53]),o($V0,[2,15]),{19:[2,20]},{6:6,7:7,8:8,9:$V2,10:$V3,12:$Vm1,19:$V5,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:$V6,31:185,32:$Vn1,33:22,35:28,42:29,43:30,67:$V7,68:$V8,69:$V9,70:$Va,71:$Vb,76:$Vc,77:$Vd,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{9:$Vp,10:$Vq,19:$Vr,23:186},o($VK,[2,31]),o($Vn,$Vo,{7:46,31:187,12:$Vm1,19:$V5,32:$Vn1}),o($Vo1,[2,80]),o($Vk1,[2,55]),{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,32:$VA,43:67,44:$VB,47:$VC,49:$VD,62:[1,188],63:122,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:[1,189],13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,32:$VA,43:67,44:$VB,47:$VC,49:$VD,63:122,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:[1,190],13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,32:$VA,43:67,44:$VB,47:$VC,49:$VD,63:122,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{11:$Vs,12:[1,191],13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,32:$VA,43:67,44:$VB,47:$VC,49:$VD,63:122,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{12:$Vp1,44:$Vq1,67:$Vr1,74:192,75:$Vs1,76:$Vt1,77:$Vu1,78:193,80:194,81:$Vv1,82:$Vw1,83:$Vx1,84:$Vy1,85:$Vz1},{12:$Vp1,44:$Vq1,67:$Vr1,74:206,75:$Vs1,76:$Vt1,77:$Vu1,78:193,80:194,81:$Vv1,82:$Vw1,83:$Vx1,84:$Vy1,85:$Vz1},{12:$Vp1,44:$Vq1,67:$Vr1,74:207,75:$Vs1,76:$Vt1,77:$Vu1,78:193,80:194,81:$Vv1,82:$Vw1,83:$Vx1,84:$Vy1,85:$Vz1},{12:$Vp1,44:$Vq1,67:$Vr1,74:208,75:$Vs1,76:$Vt1,77:$Vu1,78:193,80:194,81:$Vv1,82:$Vw1,83:$Vx1,84:$Vy1,85:$Vz1},{35:209,42:29,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},{35:210,42:29,43:30,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},o($VX,[2,38],{12:[1,211]}),{11:$Vs,12:$Vt,13:$Vu,15:$Vv,16:$Vw,17:$Vx,18:$Vy,29:$Vz,32:$VA,39:[1,212],43:67,44:$VB,47:$VC,49:$VD,63:122,66:70,67:$VE,68:$VF,69:$VG,70:$VH,71:$VI,73:61,76:$Vc,77:$VJ,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl},o($VX,[2,42],{12:[1,213]}),o($VX,[2,44],{12:[1,214]}),o($VX,[2,46],{12:[1,215]}),{9:$Vp,10:$Vq,19:$Vr,23:216},o($Vm,[2,30]),o($VK,[2,32]),o([12,76,79,81,82,84,85,87,88,89],[2,76]),o($VA1,$V41,{45:217,50:$VL,51:$VM,52:$VN,53:$VO,54:$VP,55:$VQ,56:$VR,57:$VS,58:$VT,59:$VU,60:$VV,61:$VW}),o($VA1,$V41,{45:218,50:$VL,51:$VM,52:$VN,53:$VO,54:$VP,55:$VQ,56:$VR,57:$VS,58:$VT,59:$VU,60:$VV,61:$VW}),o($VA1,$V41,{45:219,50:$VL,51:$VM,52:$VN,53:$VO,54:$VP,55:$VQ,56:$VR,57:$VS,58:$VT,59:$VU,60:$VV,61:$VW}),o($VK,[2,97],{79:$VB1}),o($VC1,[2,101],{80:221,12:$Vp1,44:$Vq1,67:$Vr1,75:$Vs1,76:$Vt1,77:$Vu1,81:$Vv1,82:$Vw1,83:$Vx1,84:$Vy1,85:$Vz1}),o($VD1,[2,103]),o($VD1,[2,105]),o($VD1,[2,106]),o($VD1,[2,107]),o($VD1,[2,108]),o($VD1,[2,109]),o($VD1,[2,110]),o($VD1,[2,111]),o($VD1,[2,112]),o($VD1,[2,113]),o($VD1,[2,114]),o($VD1,[2,115]),o($VK,[2,98],{79:$VB1}),o($VK,[2,99],{79:$VB1}),o($VK,[2,94],{79:$VB1}),o($VK,[2,95],{43:30,42:110,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl}),o($VK,[2,96],{43:30,42:110,76:$Vc,79:$Ve,81:$Vf,82:$Vg,84:$Vh,85:$Vi,87:$Vj,88:$Vk,89:$Vl}),o($VX,[2,39]),{39:[1,222]},o($VX,[2,43]),o($VX,[2,45]),o($VX,[2,47]),o($Vm,[2,29]),o($Vk1,[2,58],{12:[1,223]}),o($Vk1,[2,60],{12:[1,224]}),o($Vk1,[2,62],{12:[1,225]}),{12:$Vp1,44:$Vq1,67:$Vr1,75:$Vs1,76:$Vt1,77:$Vu1,78:226,80:194,81:$Vv1,82:$Vw1,83:$Vx1,84:$Vy1,85:$Vz1},o($VD1,[2,104]),o($VX,[2,40],{12:[1,227]}),o($Vk1,[2,59]),o($Vk1,[2,61]),o($Vk1,[2,63]),o($VC1,[2,102],{80:221,12:$Vp1,44:$Vq1,67:$Vr1,75:$Vs1,76:$Vt1,77:$Vu1,81:$Vv1,82:$Vw1,83:$Vx1,84:$Vy1,85:$Vz1}),o($VX,[2,41])],
defaultActions: {163:[2,20]},
parseError: function parseError(str, hash) {

@@ -263,0 +263,0 @@ if (hash.recoverable) {

@@ -476,3 +476,3 @@ /**

it('it should handle text on lines', function () {
var res = flow.parser.parse('graph TD;A== test text with -- ==>B;');
var res = flow.parser.parse('graph TD;A== test text with - ==>B;');

@@ -573,3 +573,3 @@ var vert = flow.parser.yy.getVertices();

it('should handle keywords',function(){
var res = flow.parser.parse('graph TD;A-- text including graph space --xB;');
var res = flow.parser.parse('graph TD;A-- text including graph space and v --xB;');

@@ -579,6 +579,14 @@ var vert = flow.parser.yy.getVertices();

expect(edges[0].text).toBe('text including graph space and v');
});
xit('should handle text on open links',function(){
var res = flow.parser.parse('graph TD;A-- text including graph space --B');
var vert = flow.parser.yy.getVertices();
var edges = flow.parser.yy.getEdges();
expect(edges[0].text).toBe('text including graph space');
});
});

@@ -585,0 +593,0 @@

@@ -80,4 +80,4 @@ /**

exports.parseError = function(err, hash) {
console.log('Syntax error:' + err);
exports.parseError = function(err,hash){
mermaid.parseError(err,hash);
};

@@ -84,0 +84,0 @@

/**
* Created by knut on 14-11-18.
*/
var proxyquire = require('proxyquire');
var newD3;
var d3 = {
select:function(){
return new newD3();
}
};
var sq = require('./parser/sequenceDiagram').parser;
var sd = require('./sequenceRenderer');
var sd = proxyquire('./sequenceRenderer', { './d3': d3 });

@@ -472,2 +480,3 @@ var str;

});
describe('when rendering a sequenceDiagram',function() {

@@ -484,3 +493,3 @@ var parseError, _d3, conf;

function newD3() {
newD3 = function() {
var o = {

@@ -513,12 +522,4 @@ append: function (type) {

return o;
}
var _d3 = {
select:function(){
return new newD3();
}
};
d3 = _d3;
conf = {

@@ -676,2 +677,78 @@ diagramMarginX:50,

});
});
describe('when rendering a sequenceDiagram with actor mirror activated',function() {
var parseError, _d3, conf;
beforeEach(function () {
sq.yy = require('./sequenceDb');
sq.yy.clear();
parseError = function(err, hash) {
console.log('Syntax error:' + err);
console.log(hash);
};
sq.yy.parseError = parseError;
newD3 = function() {
var o = {
append: function (type) {
return newD3();
},
attr: function (key, val) {
return this;
},
style: function (key, val) {
return this;
},
text: function (txt) {
return this;
},
0:{
0: {
getBBox: function () {
return {
height: 10,
width: 20
};
}
}
}
};
return o;
};
conf = {
diagramMarginX:50,
diagramMarginY:10,
actorMargin:50,
width:150,
// Height of actor boxes
height:65,
boxMargin:10,
messageMargin:40,
boxTextMargin:15,
noteMargin:25,
mirrorActors:true,
// Depending on css styling this might need adjustment
// Prolongs the edge of the diagram downwards
bottomMarginAdj:1
};
sd.setConf(conf);
});
it('it should handle one actor', function () {
sd.bounds.init();
var str = 'sequenceDiagram\n' +
'participant Alice\n';
sq.parse(str);
sd.draw(str,'tst');
var bounds = sd.bounds.getBounds();
expect(bounds.startx).toBe(0);
expect(bounds.starty).toBe(0);
expect(bounds.stopx ).toBe( conf.width);
expect(bounds.stopy ).toBe(2*conf.height+2*conf.boxMargin);
});
});

@@ -1,2 +0,1 @@

/* globals d3 */
/**

@@ -9,2 +8,3 @@ * Created by knut on 14-11-23.

var svgDraw = require('./svgDraw');
var d3 = require('./d3');
var conf = {

@@ -26,3 +26,8 @@

// Space between messages
messageMargin:35
messageMargin:35,
//mirror actors under diagram
mirrorActors:false,
// Depending on css styling this might need adjustment
// Prolongs the edge of the diagram downwards
bottomMarginAdj:1
};

@@ -216,3 +221,3 @@

module.exports.drawActors = function(diagram, actors, actorKeys){
module.exports.drawActors = function(diagram, actors, actorKeys,verticalPos){
var i;

@@ -225,3 +230,3 @@ // Draw the actors

actors[key].x = i*conf.actorMargin +i*conf.width;
actors[key].y = 0;
actors[key].y = verticalPos;
actors[key].width = conf.diagramMarginY;

@@ -231,4 +236,4 @@ actors[key].height = conf.diagramMarginY;

// Draw the box with the attached line
svgDraw.drawActor(diagram, actors[key].x, actors[key].description, conf);
exports.bounds.insert(actors[key].x, 0, actors[key].x + conf.width, conf.height);
svgDraw.drawActor(diagram, actors[key].x, verticalPos, actors[key].description, conf);
exports.bounds.insert(actors[key].x, verticalPos, actors[key].x + conf.width, conf.height);

@@ -244,3 +249,7 @@ }

module.exports.setConf = function(cnf){
conf = cnf;
var keys = Object.keys(cnf);
keys.forEach(function(key){
conf[key] = cnf[key];
});
};

@@ -254,4 +263,4 @@ /**

sq.yy.clear();
//console.log(text);
sq.parse(text+'\n');
exports.bounds.init();

@@ -268,3 +277,3 @@ var diagram = d3.select('#'+id);

module.exports.drawActors(diagram, actors, actorKeys);
module.exports.drawActors(diagram, actors, actorKeys, 0);

@@ -345,5 +354,16 @@ // The arrow head definition is attached to the svg once

if(conf.mirrorActors){
// Draw actors below diagram
exports.bounds.bumpVerticalPos(conf.boxMargin*2);
module.exports.drawActors(diagram, actors, actorKeys, exports.bounds.getVerticalPos());
}
var box = exports.bounds.getBounds();
var height = box.stopy-box.starty+2*conf.diagramMarginY;
var height = box.stopy - box.starty + 2*conf.diagramMarginY;
if(conf.mirrorActors){
height = height - conf.boxMargin + conf.bottomMarginAdj;
}
var width = box.stopx-box.startx+2*conf.diagramMarginX;

@@ -350,0 +370,0 @@

@@ -70,16 +70,19 @@ /**

*/
exports.drawActor = function(elem, left,description,conf){
exports.drawActor = function(elem, left, verticalPos, description,conf){
var center = left + (conf.width/2);
var g = elem.append("g");
g.append("line")
.attr("x1", center)
.attr("y1", 5)
.attr("x2", center)
.attr("y2", 2000)
.attr("class", 'actor-line')
.attr("stroke-width", '0.5px')
.attr("stroke", '#999');
if(verticalPos === 0) {
g.append("line")
.attr("x1", center)
.attr("y1", 5)
.attr("x2", center)
.attr("y2", 2000)
.attr("class", 'actor-line')
.attr("stroke-width", '0.5px')
.attr("stroke", '#999');
}
var rect = exports.getNoteRect();
rect.x = left;
rect.y = verticalPos;
rect.fill = '#eaeaea';

@@ -95,3 +98,3 @@ rect.width = conf.width;

.attr("x", center)
.attr("y", (conf.height/2)+5)
.attr("y", verticalPos + (conf.height/2)+5)
.attr('class','actor')

@@ -98,0 +101,0 @@ .style("text-anchor", "middle")

@@ -6,5 +6,48 @@ var graph = require('./diagrams/flowchart/graphDb');

var seq = require('./diagrams/sequenceDiagram/sequenceRenderer');
var info = require('./diagrams/example/exampleRenderer');
var he = require('he');
var infoParser = require('./diagrams/example/parser/example');
var flowParser = require('./diagrams/flowchart/parser/flow');
var dotParser = require('./diagrams/flowchart/parser/dot');
var sequenceParser = require('./diagrams/sequenceDiagram/parser/sequenceDiagram');
var sequenceDb = require('./diagrams/sequenceDiagram/sequenceDb');
var infoDb = require('./diagrams/example/exampleDb');
/**
* Function that parses a mermaid diagram defintion. If parsing fails the parseError callback is called and an error is
* thrown and
* @param text
*/
var parse = function(text){
var graphType = utils.detectType(text);
var parser;
switch(graphType){
case 'graph':
parser = flowParser;
parser.parser.yy = graph;
break;
case 'dotGraph':
parser = dotParser;
parser.parser.yy = graph;
break;
case 'sequenceDiagram':
parser = sequenceParser;
parser.parser.yy = sequenceDb;
break;
case 'info':
parser = infoParser;
parser.parser.yy = infoDb;
break;
}
try{
parser.parse(text);
return true;
}
catch(err){
return false;
}
};
/**
* Function that goes through the document to find the chart definitions in there and render them.

@@ -22,6 +65,14 @@ *

*/
var init = function () {
var init = function (sequenceConfig) {
var arr = document.querySelectorAll('.mermaid');
var i;
if (sequenceConfig !== 'undefined' && (typeof sequenceConfig !== 'undefined')) {
if(typeof sequenceConfig === 'object'){
seq.setConf(sequenceConfig);
} else{
seq.setConf(JSON.parse(sequenceConfig));
}
}
var cnt = 0;

@@ -56,3 +107,3 @@ for (i = 0; i < arr.length; i++) {

switch(graphType){
case 'graph':
case 'graph':
classes = flowRenderer.getClasses(txt, false);

@@ -63,3 +114,3 @@ flowRenderer.draw(txt, id, false);

break;
case 'dotGraph':
case 'dotGraph':
classes = flowRenderer.getClasses(txt, true);

@@ -69,3 +120,3 @@ flowRenderer.draw(txt, id, true);

break;
case 'sequenceDiagram':
case 'sequenceDiagram':
seq.draw(txt,id);

@@ -75,2 +126,6 @@ // TODO - Get styles for sequence diagram

break;
case 'info':
info.draw(txt,id,exports.version());
utils.cloneCssStyles(element.firstChild, []);
break;
}

@@ -103,4 +158,6 @@

startOnLoad:true,
init:function(){
init();
htmlLabels:true,
init:function(sequenceConfig){
init(sequenceConfig);
},

@@ -112,2 +169,9 @@ version:function(){

return flow.parser;
},
parse:function(text){
return parse(text);
},
parseError:function(err,hash){
console.log('Mermaid Syntax error:');
console.log(err);
}

@@ -120,2 +184,8 @@ };

//console.log('mermaid_config',mermaid_config);
if (typeof mermaid_config !== 'undefined') {
if (equals(false, mermaid_config.htmlLabels)) {
global.mermaid.htmlLabels = false;
}
}
if(global.mermaid.startOnLoad) {

@@ -127,3 +197,3 @@

if (equals(true, mermaid_config.startOnLoad)) {
global.mermaid.init();
global.mermaid.init(mermaid.sequenceConfig);
}

@@ -133,3 +203,3 @@ }

// No config found, do autostart in this simple case
global.mermaid.init();
global.mermaid.init(mermaid.sequenceConfig);
}

@@ -142,3 +212,3 @@ }

/**
* Wait for coument loaded before starting the execution
* Wait for document loaded before starting the execution
*/

@@ -145,0 +215,0 @@ document.addEventListener('DOMContentLoaded', function(){

@@ -177,2 +177,86 @@ /**

});
describe('checking validity of input ', function(){
it('it should return false for an invalid definiton',function(){
spyOn(mermaid,'parseError');
var res = mermaid.parse('this is not a mermaid diagram definition');
expect(res).toBe(false);
expect(mermaid.parseError).toHaveBeenCalled();
});
it('it should return true for a valid flow definition',function(){
spyOn(mermaid,'parseError');
var res = mermaid.parse('graph TD;A--x|text including URL space|B;');
expect(res).toBe(true);
expect(mermaid.parseError).not.toHaveBeenCalled();
});
it('it should return false for an invalid flow definition',function(){
spyOn(mermaid,'parseError');
var res = mermaid.parse('graph TQ;A--x|text including URL space|B;');
expect(res).toBe(false);
expect(mermaid.parseError).toHaveBeenCalled();
});
it('it should return true for a valid sequenceDiagram definition',function(){
spyOn(mermaid,'parseError');
var str = 'sequenceDiagram\n' +
'Alice->Bob: Hello Bob, how are you?\n\n' +
'%% Comment\n' +
'Note right of Bob: Bob thinks\n' +
'alt isWell\n\n' +
'Bob-->Alice: I am good thanks!\n' +
'else isSick\n' +
'Bob-->Alice: Feel sick...\n' +
'end';
var res = mermaid.parse(str);
expect(res).toBe(true);
expect(mermaid.parseError).not.toHaveBeenCalled();
});
it('it should return false for an invalid sequenceDiagram definition',function(){
spyOn(mermaid,'parseError');
var str = 'sequenceDiagram\n' +
'Alice:->Bob: Hello Bob, how are you?\n\n' +
'%% Comment\n' +
'Note right of Bob: Bob thinks\n' +
'alt isWell\n\n' +
'Bob-->Alice: I am good thanks!\n' +
'else isSick\n' +
'Bob-->Alice: Feel sick...\n' +
'end';
var res = mermaid.parse(str);
expect(res).toBe(false);
expect(mermaid.parseError).toHaveBeenCalled();
});
it('it should return true for a valid dot definition',function(){
spyOn(mermaid,'parseError');
var res = mermaid.parse('digraph\n' +
'{\n' +
' a -> b -> c -- d -> e;\n' +
' a -- e;\n' +
'}');
expect(res).toBe(true);
expect(mermaid.parseError).not.toHaveBeenCalled();
});
it('it should return false for an invalid dot definition',function(){
spyOn(mermaid,'parseError');
var res = mermaid.parse('digraph\n' +
'{\n' +
'a -:> b -> c -- d -> e;\n' +
'a -- e;\n' +
'}');
expect(res).toBe(false);
expect(mermaid.parseError).toHaveBeenCalled();
});
});
});

@@ -21,6 +21,11 @@ /**

if(text.match(/^\s*digraph/)) {
console.log('Detected flow syntax');
//console.log('Detected dot syntax');
return "dotGraph";
}
if(text.match(/^\s*info/)) {
//console.log('Detected info syntax');
return "info";
}
return "graph";

@@ -62,6 +67,15 @@ };

if (className === 'default') {
defaultStyles = '.node' + ' { ' + classes[className].styles.join("; ") + '; }\n';
if (classes.default.styles instanceof Array) {
defaultStyles += "#" + svg.id.trim() + ' .node' + ' { ' + classes[className].styles.join("; ") + '; }\n';
}
if (classes.default.nodeLabelStyles instanceof Array) {
defaultStyles += "#" + svg.id.trim() + ' .node text ' + ' { ' + classes[className].nodeLabelStyles.join("; ") + '; }\n';
}
if (classes.default.edgeLabelStyles instanceof Array) {
defaultStyles += "#" + svg.id.trim() + ' .edgeLabel text ' + ' { ' + classes[className].edgeLabelStyles.join("; ") + '; }\n';
}
} else {
embeddedStyles += '.' + className + ' { ' + classes[className].styles.join("; ") + '; }\n';
//embeddedStyles += svg.id.trim() + ' .' + className + ' { ' + classes[className].styles.join("; ") + '; }\n';
if (classes[className].styles instanceof Array) {
embeddedStyles += "#" + svg.id.trim() + ' .' + className + ' { ' + classes[className].styles.join("; ") + '; }\n';
}
}

@@ -76,2 +90,3 @@ }

s.innerHTML = "/* <![CDATA[ */\n";
// Make this CSS local to this SVG
if (defaultStyles !== "") {

@@ -78,0 +93,0 @@ s.innerHTML += defaultStyles;

@@ -88,2 +88,3 @@ /**

function addStyleToDocument() {
var styleSheetCount = document.styleSheets.length;
var s = document.createElement('style');

@@ -95,2 +96,3 @@ s.innerHTML = '.node { stroke:#eee; }\n.node-square { stroke:#bbb; }\n';

function addSecondStyleToDocument() {
var styleSheetCount = document.styleSheets.length;
var s = document.createElement('style');

@@ -103,2 +105,3 @@ s.innerHTML = '.node2 { stroke:#eee; }\n.node-square { stroke:#beb; }\n';

var svg = document.createElement('svg');
svg.setAttribute('id', 'mermaid-01');
var g1 = document.createElement('g');

@@ -113,21 +116,13 @@ g1.setAttribute('class', 'node');

function addSVGwithStyleToDocument() {
function addMermaidSVGwithStyleToDocument() {
var styleSheetCount = document.styleSheets.length;
var svg = document.createElement('svg');
svg.setAttribute('id', 'mermaid-03');
var s = document.createElement('style');
s.innerHTML = '.node2 { stroke:#eee; }\n.node-square { stroke:#bfb; }\n';
svg.appendChild(s);
document.body.appendChild(svg);
}
function addMermaidSVGwithStyleToDocument(id) {
var svg = document.createElement('svg');
var s = document.createElement('style');
s.setAttribute('type', 'text/css');
s.setAttribute('title', 'mermaid-svg-internal-css');
s.innerHTML = '.node2 { stroke:#eee; }\n.node-square { stroke:#bfe; }\n';
s.innerHTML = '#mermaid-05 .node2 { stroke:#eee; }\n.node-square { stroke:#bfe; }\n';
svg.appendChild(s);
document.body.appendChild(svg);
// The Mock-browser seems not to support stylesheets title attribute, so we add it manually
var sheets = document.styleSheets;
sheets[id].title = "mermaid-svg-internal-css";
document.styleSheets[styleSheetCount].title = 'mermaid-svg-internal-css';
}

@@ -137,2 +132,3 @@

var svg = document.createElement('svg');
svg.setAttribute('id', 'mermaid-01');

@@ -146,7 +142,8 @@ utils.cloneCssStyles(svg, {});

var svg = document.createElement('svg');
svg.setAttribute('id', 'mermaid-01');
utils.cloneCssStyles(svg, { "default": { "styles": ["stroke:#fff","stroke-width:1.5px"] } });
expect(stylesToArray(svg)).toEqual([ '.node { stroke:#fff; stroke-width:1.5px; }']);
expect(stylesToArray(svg)).toEqual([ '#mermaid-01 .node { stroke:#fff; stroke-width:1.5px; }' ]);
// Also verify the elements around the styling
expect(svg.innerHTML).toBe('<style type="text/css" title="mermaid-svg-internal-css">/* <![CDATA[ */\n.node { stroke:#fff; stroke-width:1.5px; }\n/* ]]> */\n</style>');
expect(svg.innerHTML).toBe('<style type="text/css" title="mermaid-svg-internal-css">/* <![CDATA[ */\n#mermaid-01 .node { stroke:#fff; stroke-width:1.5px; }\n/* ]]> */\n</style>');
});

@@ -156,3 +153,5 @@

var svg = document.createElement('svg');
addStyleToDocument();
svg.setAttribute('id', 'mermaid-01');
addStyleToDocument('mermaid');
utils.cloneCssStyles(svg, {});

@@ -178,21 +177,11 @@ // Should not create style element if not needed

it('should handle multiple stylesheets + styles in other SVG', function () {
it('should handle multiple stylesheets + ignore styles in other mermaid SVG', function () {
var svg = generateSVG();
addStyleToDocument();
addSecondStyleToDocument();
addSVGwithStyleToDocument();
addMermaidSVGwithStyleToDocument();
utils.cloneCssStyles(svg, {});
expect(stylesToArray(svg)).toEqual([ '.node { stroke: #eee; }', '.node-square { stroke: #bbb; }', '.node-square { stroke: #beb; }', '.node-square { stroke: #bfb; }']);
expect(stylesToArray(svg)).toEqual([ '.node { stroke: #eee; }', '.node-square { stroke: #bbb; }', '.node-square { stroke: #beb; }']);
});
it('should handle multiple stylesheets + ignore styles in mermaid SVG', function () {
var svg = generateSVG();
addStyleToDocument();
addSecondStyleToDocument();
addSVGwithStyleToDocument();
addMermaidSVGwithStyleToDocument(3);
utils.cloneCssStyles(svg, {});
expect(stylesToArray(svg)).toEqual([ '.node { stroke: #eee; }', '.node-square { stroke: #bbb; }', '.node-square { stroke: #beb; }', '.node-square { stroke: #bfb; }']);
});
it('should handle a default class together with stylesheet in document with classes in SVG', function () {

@@ -202,6 +191,6 @@ var svg = generateSVG();

utils.cloneCssStyles(svg, { "default": { "styles": ["stroke:#fff","stroke-width:1.5px"] } });
expect(stylesToArray(svg)).toEqual([ '.node { stroke:#fff; stroke-width:1.5px; }', '.node { stroke: #eee; }', '.node-square { stroke: #bbb; }']);
expect(stylesToArray(svg)).toEqual([ '#mermaid-01 .node { stroke:#fff; stroke-width:1.5px; }', '.node { stroke: #eee; }', '.node-square { stroke: #bbb; }']);
});
xit('should handle a default class together with stylesheet in document and classDefs', function () {
it('should handle a default class together with stylesheet in document and classDefs', function () {
var svg = generateSVG();

@@ -212,9 +201,10 @@ addStyleToDocument();

"node-circle": { "styles": ["fill:#444", "stroke:#111"] } });
expect(stylesToArray(svg)).toEqual([ '.node { stroke:#fff; stroke-width:1.5px; }',
expect(stylesToArray(svg)).toEqual([ '#mermaid-01 .node { stroke:#fff; stroke-width:1.5px; }',
'.node { stroke: #eee; }',
'.node-square { stroke: #bbb; }',
'.node-square { fill:#eee; stroke:#aaa; }',
'.node-circle { fill:#444; stroke:#111; }' ]);
'#mermaid-01 .node-square { fill:#eee; stroke:#aaa; }',
'#mermaid-01 .node-circle { fill:#444; stroke:#111; }'
]);
});
});

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc