mermaid/dist/mermaid.slim.min.js

3 lines
100 KiB
JavaScript
Raw Normal View History

2014-12-01 21:10:09 +01:00
!function r(e,t,u){function s(n,i){if(!t[n]){if(!e[n]){var o="function"==typeof require&&require;if(!i&&o)return o(n,!0);if(a)return a(n,!0);throw new Error("Cannot find module '"+n+"'")}var c=t[n]={exports:{}};e[n][0].call(c.exports,function(r){var t=e[n][1][r];return s(t?t:r)},c,c.exports,r,e,t,u)}return t[n].exports}for(var a="function"==typeof require&&require,n=0;n<u.length;n++)s(u[n]);return s}({1:[function(){},{}],2:[function(r,e,t){(function(r){function e(r,e){for(var t=0,u=r.length-1;u>=0;u--){var s=r[u];"."===s?r.splice(u,1):".."===s?(r.splice(u,1),t++):t&&(r.splice(u,1),t--)}if(e)for(;t--;t)r.unshift("..");return r}function u(r,e){if(r.filter)return r.filter(e);for(var t=[],u=0;u<r.length;u++)e(r[u],u,r)&&t.push(r[u]);return t}var s=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a=function(r){return s.exec(r).slice(1)};t.resolve=function(){for(var t="",s=!1,a=arguments.length-1;a>=-1&&!s;a--){var n=a>=0?arguments[a]:r.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");n&&(t=n+"/"+t,s="/"===n.charAt(0))}return t=e(u(t.split("/"),function(r){return!!r}),!s).join("/"),(s?"/":"")+t||"."},t.normalize=function(r){var s=t.isAbsolute(r),a="/"===n(r,-1);return r=e(u(r.split("/"),function(r){return!!r}),!s).join("/"),r||s||(r="."),r&&a&&(r+="/"),(s?"/":"")+r},t.isAbsolute=function(r){return"/"===r.charAt(0)},t.join=function(){var r=Array.prototype.slice.call(arguments,0);return t.normalize(u(r,function(r){if("string"!=typeof r)throw new TypeError("Arguments to path.join must be strings");return r}).join("/"))},t.relative=function(r,e){function u(r){for(var e=0;e<r.length&&""===r[e];e++);for(var t=r.length-1;t>=0&&""===r[t];t--);return e>t?[]:r.slice(e,t-e+1)}r=t.resolve(r).substr(1),e=t.resolve(e).substr(1);for(var s=u(r.split("/")),a=u(e.split("/")),n=Math.min(s.length,a.length),i=n,o=0;n>o;o++)if(s[o]!==a[o]){i=o;break}for(var c=[],o=i;o<s.length;o++)c.push("..");return c=c.concat(a.slice(i)),c.join("/")},t.sep="/",t.delimiter=":",t.dirname=function(r){var e=a(r),t=e[0],u=e[1];return t||u?(u&&(u=u.substr(0,u.length-1)),t+u):"."},t.basename=function(r,e){var t=a(r)[2];return e&&t.substr(-1*e.length)===e&&(t=t.substr(0,t.length-e.length)),t},t.extname=function(r){return a(r)[3]};var n="b"==="ab".substr(-1)?function(r,e,t){return r.substr(e,t)}:function(r,e,t){return 0>e&&(e=r.length+e),r.substr(e,t)}}).call(this,r("1YiZ5S"))},{"1YiZ5S":3}],3:[function(r,e){function t(){}var u=e.exports={};u.nextTick=function(){var r="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(r)return function(r){return window.setImmediate(r)};if(e){var t=[];return window.addEventListener("message",function(r){var e=r.source;if((e===window||null===e)&&"process-tick"===r.data&&(r.stopPropagation(),t.length>0)){var u=t.shift();u()}},!0),function(r){t.push(r),window.postMessage("process-tick","*")}}return function(r){setTimeout(r,0)}}(),u.title="browser",u.browser=!0,u.env={},u.argv=[],u.on=t,u.addListener=t,u.once=t,u.off=t,u.removeListener=t,u.removeAllListeners=t,u.emit=t,u.binding=function(){throw new Error("process.binding is not supported")},u.cwd=function(){return"/"},u.chdir=function(){throw new Error("process.chdir is not supported")}},{}],4:[function(r,e,t){(function(r){!function(u){var s="object"==typeof t&&t,a="object"==typeof e&&e&&e.exports==s&&e,n="object"==typeof r&&r;(n.global===n||n.window===n)&&(u=n);var i=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,o=/[\x01-\x7F]/g,c=/[\x01-\t\x0B\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,l=/<\u20D2|=\u20E5|>\u20D2|\u205F\u200A|\u219D\u0338|\u2202\u0338|\u2220\u20D2|\u2229\uFE00|\u222A\uFE00|\u223C\u20D2|\u223D\u0331|\u223E\u0333|\u2242\u0338|\u224B\u0338|\u224D\u20D2|\u224E\u0338|\u224F\u0338|\u2250\u0338|\u2261\u20E5|\u2264\u20D2|\u2265\u20D2|\u2266\u0338|\u2267\u0338|\u2268\uFE00|\u2269\uFE00|\u226A\u0338|\u226A\u20D2|\u226B\u0338|\u226B\u20D2|\u227F\u0338|\u2282\u20D2|\u2283\u20D2|\u228A\uFE00|\u228B\uFE00|\u228F\u0338|\u2290\u0338|\u2293\uFE00|\u2294\uFE00|\u22B4
2014-12-01 21:12:14 +01:00
},F=function(r,e){for(var t=-1,u=r.length;++t<u;)if(r[t]==e)return!0;return!1},k=function(r,e){if(!r)return e;var t,u={};for(t in e)u[t]=x(r,t)?r[t]:e[t];return u},C=function(r,e){var t="";return r>=55296&&57343>=r||r>1114111?(e&&q("character reference outside the permissible Unicode range"),"<22>"):x(A,r)?(e&&q("disallowed character reference"),A[r]):(e&&F(D,r)&&q("disallowed character reference"),r>65535&&(r-=65536,t+=v(r>>>10&1023|55296),r=56320|1023&r),t+=v(r))},B=function(r){return"&#x"+r.charCodeAt(0).toString(16).toUpperCase()+";"},q=function(r){throw Error("Parse error: "+r)},S=function(r,e){e=k(e,S.options);var t=e.strict;t&&g.test(r)&&q("forbidden code point");var u=e.encodeEverything,s=e.useNamedReferences,a=e.allowUnsafeSymbols;return u?(r=r.replace(o,function(r){return s&&x(p,r)?"&"+p[r]+";":B(r)}),s&&(r=r.replace(/&gt;\u20D2/g,"&nvgt;").replace(/&lt;\u20D2/g,"&nvlt;").replace(/&#x66;&#x6A;/g,"&fjlig;")),s&&(r=r.replace(l,function(r){return"&"+p[r]+";"}))):s?(a||(r=r.replace(h,function(r){return"&"+p[r]+";"})),r=r.replace(/&gt;\u20D2/g,"&nvgt;").replace(/&lt;\u20D2/g,"&nvlt;"),r=r.replace(l,function(r){return"&"+p[r]+";"})):a||(r=r.replace(h,B)),r.replace(i,function(r){var e=r.charCodeAt(0),t=r.charCodeAt(1),u=1024*(e-55296)+t-56320+65536;return"&#x"+u.toString(16).toUpperCase()+";"}).replace(c,B)};S.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1};var L=function(r,e){e=k(e,L.options);var t=e.strict;return t&&f.test(r)&&q("malformed character reference"),r.replace(m,function(r,u,s,a,n,i,o,c){var l,p,h,d,f;return u?(l=u,p=s,t&&!p&&q("character reference was not terminated by a semicolon"),C(l,t)):a?(h=a,p=n,t&&!p&&q("character reference was not terminated by a semicolon"),l=parseInt(h,16),C(l,t)):i?(d=i,x(y,d)?y[d]:(t&&q("named character reference was not terminated by a semicolon"),r)):(d=o,f=c,f&&e.isAttributeValue?(t&&"="==f&&q("`&` did not start a character reference"),r):(t&&q("named character reference was not terminated by a semicolon"),b[d]+(f||"")))})};L.options={isAttributeValue:!1,strict:!1};var _=function(r){return r.replace(h,function(r){return d[r]})},T={version:"0.5.0",encode:S,decode:L,escape:_,unescape:L};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define(function(){return T});else if(s&&!s.nodeType)if(a)a.exports=T;else for(var N in T)x(T,N)&&(s[N]=T[N]);else u.he=T}(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],5:[function(r,e,t){(function(e){var u=r("./graphDb"),s=r("./parser/flow"),a=r("./utils"),n=r("./sequenceRenderer"),o=r("he");t.addVertices=function(r,e){var t=Object.keys(r),s=function(r,e){var t;for(t=0;t<e.length;t++)"undefined"!=typeof e[t]&&(r=r+e[t]+";");return r};t.forEach(function(t){var a,n,i=r[t],o="",c=u.getClasses();if(i.classes.length>0)for(n=0;n<i.classes.length;n++)o=s(o,c[i.classes[n]].styles);else o=s(o,c.default.styles);o=s(o,i.styles),a="undefined"==typeof i.text?i.id:i.text;var l=0,p="";switch(i.type){case"round":l=5,p="rect";break;case"square":p="rect";break;case"diamond":p="question";break;case"odd":p="rect_left_inv_arrow";break;case"circle":p="circle";break;default:p="rect"}e.setNode(i.id,{labelType:"html",shape:p,label:a,rx:l,ry:l,style:o,id:i.id})})},t.addEdges=function(r,e){var t,u=0;r.forEach(function(r){u++,t="arrow_open"===r.type?"none":"vee";var s="";"undefined"!=typeof r.style&&r.style.forEach(function(r){s=s+r+";"}),"undefined"==typeof r.text?"undefined"==typeof r.style?e.setEdge(r.start,r.end,{style:"stroke: #333; stroke-width: 1.5px;fill:none",arrowheadStyle:"fill: #333",arrowhead:t},u):e.setEdge(r.start,r.end,{style:s,arrowheadStyle:"fill: #333",arrowhead:t},u):"undefined"==typeof r.style?e.setEdge(r.start,r.end,{labelType:"html",style:"stroke: #333; stroke-width: 1.5px;fill:none",labelpos:"c",label:'<span style="background:#e8e8e8">'+r.text+"</span>",arrowheadStyle:"fill: #333",arrowhead:t},u):e.setEdge(r.start,r.end,{labelType:"html",style:s,arrowheadStyle:"fill: #333",label:r.text,arrowhead:t},u)})};var c=function(r,e){u.clear(),s.parser.yy=u,
2014-12-01 21:10:09 +01:00
break;case 9:u.addMessage(a[n-2].a,a[n-2].b,a[n]),this.$="message";break;case 10:u.addMessage(a[n-4].a,a[n-2],a[n],a[n-4].b),this.$="actor";break;case 11:this.$="action";break;case 12:this.$="actor";break;case 13:console.log("Got new message from="+a[n-6]+" to="+a[n-2]+" message="+a[n]+" answer="+a[n-4]),this.$="actor";break;case 24:case 27:case 28:case 29:case 33:this.$=a[n];break;case 25:case 30:this.$=a[n-1]+""+a[n]}},table:[{3:1,4:2,6:[1,3],7:[1,4]},{1:[3]},{5:5,11:6,12:7,13:8,29:9,30:10,31:t,32:u},{1:[2,2]},{8:[1,13]},{1:[2,1]},{6:[1,15],8:s,10:14,28:a},e(n,[2,8],{16:[1,18],18:[1,19]}),{14:[1,20],30:21,31:t,32:u},e(i,[2,24]),e(i,[2,26]),e(o,[2,27]),e(o,[2,28]),{9:[1,22]},{5:23,6:[1,24],11:6,12:7,13:8,29:9,30:10,31:t,32:u},{1:[2,5]},e(c,[2,22],{10:25,8:s,28:a}),e(c,[2,23],{10:26,8:s,28:a}),{13:28,17:27,29:9,30:10,31:t,32:u},{13:30,19:29,29:9,30:10,31:t,32:u},{8:l,15:31,30:34,31:t,32:u,33:32,34:33},e(i,[2,25]),{8:s,10:36,28:a},{1:[2,4]},{1:[2,6]},e(c,[2,20]),e(c,[2,21]),e(n,[2,9]),e(n,[2,17],{30:21,31:t,32:u}),{16:[1,37]},{16:[2,16],30:21,31:t,32:u},e([6,16,18,28],[2,7],{30:34,34:38,8:l,31:t,32:u}),e(p,[2,29]),e(p,[2,31]),e(p,[2,32]),e(p,[2,33]),e([31,32],[2,3]),{13:28,17:39,29:9,30:10,31:t,32:u},e(p,[2,30]),e(n,[2,10])],defaultActions:{3:[2,2],5:[2,1],15:[2,5],23:[2,4],24:[2,6]},parseError:function(r,e){if(!e.recoverable)throw new Error(r);this.trace(r)},parse:function(r){function e(){var r;return r=f.lex()||h,"number"!=typeof r&&(r=t.symbols_[r]||r),r}var t=this,u=[0],s=[null],a=[],n=this.table,i="",o=0,c=0,l=0,p=2,h=1,d=a.slice.call(arguments,1),f=Object.create(this.lexer),g={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(g.yy[m]=this.yy[m]);f.setInput(r,g.yy),g.yy.lexer=f,g.yy.parser=this,"undefined"==typeof f.yylloc&&(f.yylloc={});var y=f.yylloc;a.push(y);var b=f.options&&f.options.ranges;this.parseError="function"==typeof g.yy.parseError?g.yy.parseError:Object.getPrototypeOf(this).parseError;for(var A,D,v,E,w,x,F,k,C,B={};;){if(v=u[u.length-1],this.defaultActions[v]?E=this.defaultActions[v]:((null===A||"undefined"==typeof A)&&(A=e()),E=n[v]&&n[v][A]),"undefined"==typeof E||!E.length||!E[0]){var q="";C=[];for(x in n[v])this.terminals_[x]&&x>p&&C.push("'"+this.terminals_[x]+"'");q=f.showPosition?"Parse error on line "+(o+1)+":\n"+f.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[A]||A)+"'":"Parse error on line "+(o+1)+": Unexpected "+(A==h?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(q,{text:f.match,token:this.terminals_[A]||A,line:f.yylineno,loc:y,expected:C})}if(E[0]instanceof Array&&E.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+A);switch(E[0]){case 1:u.push(A),s.push(f.yytext),a.push(f.yylloc),u.push(E[1]),A=null,D?(A=D,D=null):(c=f.yyleng,i=f.yytext,o=f.yylineno,y=f.yylloc,l>0&&l--);break;case 2:if(F=this.productions_[E[1]][1],B.$=s[s.length-F],B._$={first_line:a[a.length-(F||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(F||1)].first_column,last_column:a[a.length-1].last_column},b&&(B._$.range=[a[a.length-(F||1)].range[0],a[a.length-1].range[1]]),w=this.performAction.apply(B,[i,c,o,g.yy,E[1],s,a].concat(d)),"undefined"!=typeof w)return w;F&&(u=u.slice(0,-1*F*2),s=s.slice(0,-1*F),a=a.slice(0,-1*F)),u.push(this.productions_[E[1]][0]),s.push(B.$),a.push(B._$),k=n[u[u.length-2]][u[u.length-1]],u.push(k);break;case 3:return!0}}return!0}},d=function(){var r={EOF:1,parseError:function(r,e){if(!this.yy.parser)throw new Error(r);this.yy.parser.parseError(r,e)},setInput:function(r,e){return this.yy=e||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,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},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var e=r.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.