mermaid/dist/mermaid.slim.min.js

7 lines
231 KiB
JavaScript
Raw Normal View History

2015-01-05 13:41:32 +01:00
!function e(t,r,n){function i(u,o){if(!r[u]){if(!t[u]){var s="function"==typeof require&&require;if(!o&&s)return s(u,!0);if(a)return a(u,!0);throw new Error("Cannot find module '"+u+"'")}var c=r[u]={exports:{}};t[u][0].call(c.exports,function(e){var r=t[u][1][e];return i(r?r:e)},c,c.exports,e,t,r,n)}return r[u].exports}for(var a="function"==typeof require&&require,u=0;u<n.length;u++)i(n[u]);return i}({1:[function(e,t){t.exports={graphlib:e("./lib/graphlib"),dagre:e("./lib/dagre"),intersect:e("./lib/intersect"),render:e("./lib/render"),util:e("./lib/util"),version:e("./lib/version")}},{"./lib/dagre":8,"./lib/graphlib":9,"./lib/intersect":10,"./lib/render":23,"./lib/util":25,"./lib/version":26}],2:[function(e,t){function r(e,t,r,n){var a=e.append("marker").attr("id",t).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),u=a.append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("stroke-width",1).style("stroke-dasharray","1,0");i.applyStyle(u,r[n+"Style"])}function n(e,t,r,n){var a=e.append("marker").attr("id",t).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),u=a.append("path").attr("d","M 0 0 L 10 5 L 0 10 L 4 5 z").style("stroke-width",1).style("stroke-dasharray","1,0");i.applyStyle(u,r[n+"Style"])}var i=e("./util");t.exports={"default":r,normal:r,vee:n}},{"./util":25}],3:[function(e,t){function r(e,t){var r=t.nodes().filter(function(e){return n.isSubgraph(t,e)}),i=e.selectAll("g.cluster").data(r,function(e){return e});i.enter().append("g").attr("class","cluster").style("opacity",0).append("rect"),n.applyTransition(i.exit(),t).style("opacity",0).remove(),n.applyTransition(i,t).style("opacity",1),n.applyTransition(i.selectAll("rect"),t).attr("width",function(e){return t.node(e).width}).attr("height",function(e){return t.node(e).height}).attr("x",function(e){var r=t.node(e);return r.x-r.width/2}).attr("y",function(e){var r=t.node(e);return r.y-r.height/2})}var n=e("./util");t.exports=r},{"./util":25}],4:[function(e,t){"use strict";function r(e,t){var r=e.selectAll("g.edgeLabel").data(t.edges(),function(e){return a.edgeToId(e)}).classed("update",!0);return r.selectAll("*").remove(),r.enter().append("g").classed("edgeLabel",!0).style("opacity",0),r.each(function(e){var r=t.edge(e),a=i(u.select(this),t.edge(e),0,0).classed("label",!0),o=a.node().getBBox();r.labelId&&a.attr("id",r.labelId),n.has(r,"width")||(r.width=o.width),n.has(r,"height")||(r.height=o.height)}),a.applyTransition(r.exit(),t).style("opacity",0).remove(),r}var n=e("./lodash"),i=e("./label/add-label"),a=e("./util"),u=e("./d3");t.exports=r},{"./d3":7,"./label/add-label":18,"./lodash":20,"./util":25}],5:[function(e,t){"use strict";function r(e,t,r){var i=e.selectAll("g.edgePath").data(t.edges(),function(e){return l.edgeToId(e)}).classed("update",!0);return u(i,t),o(i,t),l.applyTransition(i,t).style("opacity",1),i.selectAll("path.path").each(function(e){var r=t.edge(e);r.arrowheadId=s.uniqueId("arrowhead");var i=h.select(this).attr("marker-end",function(){return"url(#"+r.arrowheadId+")"}).style("fill","none");l.applyTransition(i,t).attr("d",function(e){return n(t,e)}),r.id&&i.attr("id",r.id),l.applyStyle(i,r.style)}),i.selectAll("defs *").remove(),i.selectAll("defs").each(function(e){var n=t.edge(e),i=r[n.arrowhead];i(h.select(this),n.arrowheadId,n,"arrowhead")}),i}function n(e,t){var r=e.edge(t),n=e.node(t.v),a=e.node(t.w),u=r.points.slice(1,r.points.length-1);return u.unshift(c(n,u[0])),u.push(c(a,u[u.length-1])),i(r,u)}function i(e,t){var r=h.svg.line().x(function(e){return e.x}).y(function(e){return e.y});return s.has(e,"lineInterpolate")&&r.interpolate(e.lineInterpolate),s.has(e,"lineTension")&&r.tension(Number(e.lineTension)),r(t)}function a(e){var t=e.getBBox(),r=e.getTransformToElement(e.ownerSVGElement).translate(t.width/2,t.height/2);return{x:r.e,y:r.f}}function u(e,t){var r=e.enter().append("g").attr("class","edgePath").style("opacity",0
2014-12-23 18:06:07 +01:00
}return v}function n(e,t){a.each(e,function(e){e.vs=a.flatten(e.vs.map(function(e){return t[e]?t[e].vs:e}),!0)})}function i(e,t){a.isUndefined(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}var a=e("../lodash"),u=e("./barycenter"),o=e("./resolve-conflicts"),s=e("./sort");t.exports=r},{"../lodash":36,"./barycenter":40,"./resolve-conflicts":45,"./sort":47}],47:[function(e,t){function r(e,t){var r=u.partition(e,function(e){return a.has(e,"barycenter")}),o=r.lhs,s=a.sortBy(r.rhs,function(e){return-e.i}),c=[],l=0,h=0,d=0;o.sort(i(!!t)),d=n(c,s,d),a.each(o,function(e){d+=e.vs.length,c.push(e.vs),l+=e.barycenter*e.weight,h+=e.weight,d=n(c,s,d)});var p={vs:a.flatten(c,!0)};return h&&(p.barycenter=l/h,p.weight=h),p}function n(e,t,r){for(var n;t.length&&(n=a.last(t)).i<=r;)t.pop(),e.push(n.vs),r++;return r}function i(e){return function(t,r){return t.barycenter<r.barycenter?-1:t.barycenter>r.barycenter?1:e?r.i-t.i:t.i-r.i}}var a=e("../lodash"),u=e("../util");t.exports=r},{"../lodash":36,"../util":55}],48:[function(e,t){function r(e){var t=i(e);a.each(e.graph().dummyChains,function(r){for(var i=e.node(r),a=i.edgeObj,u=n(e,t,a.v,a.w),o=u.path,s=u.lca,c=0,l=o[c],h=!0;r!==a.w;){if(i=e.node(r),h){for(;(l=o[c])!==s&&e.node(l).maxRank<i.rank;)c++;l===s&&(h=!1)}if(!h){for(;c<o.length-1&&e.node(l=o[c+1]).minRank<=i.rank;)c++;l=o[c]}e.setParent(r,l),r=e.successors(r)[0]}})}function n(e,t,r,n){var i,a,u=[],o=[],s=Math.min(t[r].low,t[n].low),c=Math.max(t[r].lim,t[n].lim);i=r;do i=e.parent(i),u.push(i);while(i&&(t[i].low>s||c>t[i].lim));for(a=i,i=n;(i=e.parent(i))!==a;)o.push(i);return{path:u.concat(o.reverse()),lca:a}}function i(e){function t(i){var u=n;a.each(e.children(i),t),r[i]={low:u,lim:n++}}var r={},n=0;return a.each(e.children(),t),r}var a=e("./lodash");t.exports=r},{"./lodash":36}],49:[function(e,t){"use strict";function r(e,t){function r(t,r){var u=0,o=0,s=t.length,c=y.last(r);return y.each(r,function(t,l){var h=i(e,t),d=h?e.node(h).order:s;(h||t===c)&&(y.each(r.slice(o,l+1),function(t){y.each(e.predecessors(t),function(r){var i=e.node(r),o=i.order;!(u>o||o>d)||i.dummy&&e.node(t).dummy||a(n,r,t)})}),o=l+1,u=d)}),r}var n={};return y.reduce(t,r),n}function n(e,t){function r(t,r,n,u,o){var s;y.each(y.range(r,n),function(r){s=t[r],e.node(s).dummy&&y.each(e.predecessors(s),function(t){var r=e.node(t);r.dummy&&(r.order<u||r.order>o)&&a(i,t,s)})})}function n(t,n){var i,a=-1,u=0;return y.each(n,function(o,s){if("border"===e.node(o).dummy){var c=e.predecessors(o);c.length&&(i=e.node(c[0]).order,r(n,u,s,a,i),u=s,a=i)}r(n,u,n.length,i,t.length)}),n}var i={};return y.reduce(t,n),i}function i(e,t){return e.node(t).dummy?y.find(e.predecessors(t),function(t){return e.node(t).dummy}):void 0}function a(e,t,r){if(t>r){var n=t;t=r,r=n}var i=e[t];i||(e[t]=i={}),i[r]=!0}function u(e,t,r){if(t>r){var n=t;t=r,r=n}return y.has(e[t],r)}function o(e,t,r,n){var i={},a={},o={};return y.each(t,function(e){y.each(e,function(e,t){i[e]=e,a[e]=e,o[e]=t})}),y.each(t,function(e){var t=-1;y.each(e,function(e){var s=n(e);if(s.length){s=y.sortBy(s,function(e){return o[e]});for(var c=(s.length-1)/2,l=Math.floor(c),h=Math.ceil(c);h>=l;++l){var d=s[l];a[e]===e&&t<o[d]&&!u(r,e,d)&&(a[d]=e,a[e]=i[e]=i[d],t=o[d])}}})}),{root:i,align:a}}function s(e,t,r,n,i){var a={},u={},o={},s={},l={},h=e.graph(),d=f(h.nodesep,h.edgesep,i);return y.each(t,function(e){y.each(e,function(t,r){o[t]=t,a[t]=Number.POSITIVE_INFINITY,l[t]=e[r-1]})}),y.each(e.nodes(),function(i){r[i]===i&&c(e,t,d,r,n,a,u,o,l,s,i)}),y.each(t,function(e){y.each(e,function(e){if(s[e]=s[r[e]],e===r[e]&&a[o[r[e]]]<Number.POSITIVE_INFINITY){s[e]+=a[o[r[e]]];var t=u[o[r[e]]];t&&a[t]!==Number.POSITIVE_INFINITY&&(s[e]+=a[t])}})}),s}function c(e,t,r,n,i,a,u,o,s,l,h){if(!y.has(l,h)){l[h]=0;var d,p=h;do{if(s[p]){d=n[s[p]],c(e,t,r,n,i,a,u,o,s,l,d),o[h]===h&&(o[h]=o[d]);var f=r(e,p,s[p]);o[h]!==o[d]?(a[o[d]]=Math.min(a[o[d]],l[h]-l[d]-f),u[o[d]]=o[h]):l[h]=Math.max(l[h],l[d]+f)}p=i[p]}while(p!==h)}}function l(e,t){retur
2015-01-05 13:41:32 +01:00
return u&&(e=u.v,t=u.w,delete this._edgeLabels[n],delete this._edgeObjs[n],i(this._preds[t],e),i(this._sucs[e],t),delete this._in[t][n],delete this._out[e][n],this._edgeCount--),this},r.prototype.inEdges=function(e,t){var r=this._in[e];if(r){var n=s.values(r);return t?s.filter(n,function(e){return e.v===t}):n}},r.prototype.outEdges=function(e,t){var r=this._out[e];if(r){var n=s.values(r);return t?s.filter(n,function(e){return e.w===t}):n}},r.prototype.nodeEdges=function(e,t){var r=this.inEdges(e,t);return r?r.concat(this.outEdges(e,t)):void 0}},{"./lodash":95}],93:[function(e,t,r){arguments[4][73][0].apply(r,arguments)},{"./graph":92,"./version":96}],94:[function(e,t,r){arguments[4][74][0].apply(r,arguments)},{"./graph":92,"./lodash":95}],95:[function(e,t){t.exports=e(20)},{lodash:101}],96:[function(e,t){t.exports="0.9.1"},{}],97:[function(){},{}],98:[function(e,t,r){(function(e){function t(e,t){for(var r=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n<e.length;n++)t(e[n],n,e)&&r.push(e[n]);return r}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a=function(e){return i.exec(e).slice(1)};r.resolve=function(){for(var r="",i=!1,a=arguments.length-1;a>=-1&&!i;a--){var u=a>=0?arguments[a]:e.cwd();if("string"!=typeof u)throw new TypeError("Arguments to path.resolve must be strings");u&&(r=u+"/"+r,i="/"===u.charAt(0))}return r=t(n(r.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(e){var i=r.isAbsolute(e),a="/"===u(e,-1);return e=t(n(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&a&&(e+="/"),(i?"/":"")+e},r.isAbsolute=function(e){return"/"===e.charAt(0)},r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(n(e,function(e){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},r.relative=function(e,t){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=r.resolve(e).substr(1),t=r.resolve(t).substr(1);for(var i=n(e.split("/")),a=n(t.split("/")),u=Math.min(i.length,a.length),o=u,s=0;u>s;s++)if(i[s]!==a[s]){o=s;break}for(var c=[],s=o;s<i.length;s++)c.push("..");return c=c.concat(a.slice(o)),c.join("/")},r.sep="/",r.delimiter=":",r.dirname=function(e){var t=a(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},r.basename=function(e,t){var r=a(e)[2];return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},r.extname=function(e){return a(e)[3]};var u="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return 0>t&&(t=e.length+t),e.substr(t,r)}}).call(this,e("1YiZ5S"))},{"1YiZ5S":99}],99:[function(e,t){function r(){}var n=t.exports={};n.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var r=[];return window.addEventListener("message",function(e){var t=e.source;if((t===window||null===t)&&"process-tick"===e.data&&(e.stopPropagation(),r.length>0)){var n=r.shift();n()}},!0),function(e){r.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),n.title="browser",n.browser=!0,n.env={},n.argv=[],n.on=r,n.addListener=r,n.once=r,n.off=r,n.removeListener=r,n.removeAllListeners=r,n.emit=r,n.binding=function(){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(){throw new Error("process.chdir is not supported")}},{}],100:[function(e,t,r){(function(e){!function(n){var i="object"==typeof r&&r,a="object"==typeof t&&t&&t.exports==i&&t,u="object"==typeof e&&e;(u.global===u||u.window===u)&&(n=u);var o=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,s=/[\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\u
},D=function(e,t){for(var r=-1,n=e.length;++r<n;)if(e[r]==t)return!0;return!1},k=function(e,t){if(!e)return t;var r,n={};for(r in t)n[r]=_(e,r)?e[r]:t[r];return n},C=function(e,t){var r="";return e>=55296&&57343>=e||e>1114111?(t&&B("character reference outside the permissible Unicode range"),"<22>"):_(b,e)?(t&&B("disallowed character reference"),b[e]):(t&&D(A,e)&&B("disallowed character reference"),e>65535&&(e-=65536,r+=E(e>>>10&1023|55296),e=56320|1023&e),r+=E(e))},F=function(e){return"&#x"+e.charCodeAt(0).toString(16).toUpperCase()+";"},B=function(e){throw Error("Parse error: "+e)},T=function(e,t){t=k(t,T.options);var r=t.strict;r&&g.test(e)&&B("forbidden code point");var n=t.encodeEverything,i=t.useNamedReferences,a=t.allowUnsafeSymbols;return n?(e=e.replace(s,function(e){return i&&_(h,e)?"&"+h[e]+";":F(e)}),i&&(e=e.replace(/&gt;\u20D2/g,"&nvgt;").replace(/&lt;\u20D2/g,"&nvlt;").replace(/&#x66;&#x6A;/g,"&fjlig;")),i&&(e=e.replace(l,function(e){return"&"+h[e]+";"}))):i?(a||(e=e.replace(d,function(e){return"&"+h[e]+";"})),e=e.replace(/&gt;\u20D2/g,"&nvgt;").replace(/&lt;\u20D2/g,"&nvlt;"),e=e.replace(l,function(e){return"&"+h[e]+";"})):a||(e=e.replace(d,F)),e.replace(o,function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),n=1024*(t-55296)+r-56320+65536;return"&#x"+n.toString(16).toUpperCase()+";"}).replace(c,F)};T.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1};var S=function(e,t){t=k(t,S.options);var r=t.strict;return r&&f.test(e)&&B("malformed character reference"),e.replace(y,function(e,n,i,a,u,o,s,c){var l,h,d,p,f;return n?(l=n,h=i,r&&!h&&B("character reference was not terminated by a semicolon"),C(l,r)):a?(d=a,h=u,r&&!h&&B("character reference was not terminated by a semicolon"),l=parseInt(d,16),C(l,r)):o?(p=o,_(m,p)?m[p]:(r&&B("named character reference was not terminated by a semicolon"),e)):(p=s,f=c,f&&t.isAttributeValue?(r&&"="==f&&B("`&` did not start a character reference"),e):(r&&B("named character reference was not terminated by a semicolon"),v[p]+(f||"")))})};S.options={isAttributeValue:!1,strict:!1};var L=function(e){return e.replace(d,function(e){return p[e]})},N={version:"0.5.0",encode:T,decode:S,escape:L,unescape:S};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define(function(){return N});else if(i&&!i.nodeType)if(a)a.exports=N;else for(var q in N)_(N,q)&&(i[q]=N[q]);else n.he=N}(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],101:[function(e,t,r){(function(e){(function(){function n(e,t,r){for(var n=(r||0)-1,i=e?e.length:0;++n<i;)if(e[n]===t)return n;return-1}function i(e,t){var r=typeof t;if(e=e.cache,"boolean"==r||null==t)return e[t]?0:-1;"number"!=r&&"string"!=r&&(r="object");var i="number"==r?t:A+t;return e=(e=e[r])&&e[i],"object"==r?e&&n(e,t)>-1?0:-1:e?0:-1}function a(e){var t=this.cache,r=typeof e;if("boolean"==r||null==e)t[e]=!0;else{"number"!=r&&"string"!=r&&(r="object");var n="number"==r?e:A+e,i=t[r]||(t[r]={});"object"==r?(i[n]||(i[n]=[])).push(e):i[n]=!0}}function u(e){return e.charCodeAt(0)}function o(e,t){for(var r=e.criteria,n=t.criteria,i=-1,a=r.length;++i<a;){var u=r[i],o=n[i];if(u!==o){if(u>o||"undefined"==typeof u)return 1;if(o>u||"undefined"==typeof o)return-1}}return e.index-t.index}function s(e){var t=-1,r=e.length,n=e[0],i=e[r/2|0],u=e[r-1];if(n&&"object"==typeof n&&i&&"object"==typeof i&&u&&"object"==typeof u)return!1;var o=h();o["false"]=o["null"]=o["true"]=o.undefined=!1;var s=h();for(s.array=e,s.cache=o,s.push=a;++t<r;)s.push(e[t]);return s}function c(e){return"\\"+K[e]}function l(){return m.pop()||[]}function h(){return v.pop()||{array:null,cache:null,criteria:null,"false":!1,index:0,"null":!1,number:null,object:null,push:null,string:null,"true":!1,undefined:!1,value:null}}function d(e){e.length=0,m.length<x&&m.push(e)}function p(e){var t=e.cache;t&&p(t),e.array=e.cache=e.criteria=e.object=e.number=e.string=e.value=null,v.length<x&&v.push(e)}function f(e,t,r){t||(t=0),"undefined"==typeof r&&(r=e?e.length:0);for(var n=-1,i=r-t||0,a=Array(0>i?0:i);++n<i;)a[n]=e[t+n];return a}fu
},{}],103:[function(e,t,r){var n=e("./graphDb"),i=e("./parser/flow"),a=e("./parser/dot"),u=e("dagre-d3");r.addVertices=function(e,t){var r=Object.keys(e),n=function(e,t){var r;for(r=0;r<t.length;r++)"undefined"!=typeof t[r]&&(e=e+t[r]+";");return e};r.forEach(function(r){var i,a=e[r],u="";a.classes.length>0&&(u=a.classes.join(" "));var o="";o=n(o,a.styles),i="undefined"==typeof a.text?a.id:a.text;var s=0,c="";switch(a.type){case"round":s=5,c="rect";break;case"square":c="rect";break;case"diamond":c="question";break;case"odd":c="rect_left_inv_arrow";break;case"circle":c="circle";break;default:c="rect"}t.setNode(a.id,{labelType:"html",shape:c,label:i,rx:s,ry:s,"class":u,style:o,id:a.id})})},r.addEdges=function(e,t){var r,n=0;e.forEach(function(e){n++,r="arrow_open"===e.type?"none":"normal";var i="";"undefined"!=typeof e.style&&e.style.forEach(function(e){i=i+e+";"}),"undefined"==typeof e.text?"undefined"==typeof e.style?t.setEdge(e.start,e.end,{style:"stroke: #333; stroke-width: 1.5px;fill:none",arrowheadStyle:"fill: #333",arrowhead:r},n):t.setEdge(e.start,e.end,{style:i,arrowheadStyle:"fill: #333",arrowhead:r},n):"undefined"==typeof e.style?t.setEdge(e.start,e.end,{labelType:"html",style:"stroke: #333; stroke-width: 1.5px;fill:none",labelpos:"c",label:'<span style="background:#e8e8e8">'+e.text+"</span>",arrowheadStyle:"fill: #333",arrowhead:r},n):t.setEdge(e.start,e.end,{labelType:"html",style:i,arrowheadStyle:"fill: #333",label:e.text,arrowhead:r},n)})},r.getClasses=function(e,t){var r;n.clear(),r=t?a.parser:i.parser,r.yy=n,r.parse(e);var u=n.getClasses();return"undefined"==typeof u.default&&(u.default={id:"default"},u.default.styles=["fill:#eaeaea","stroke:#666","stroke-width:1.5px"]),u},r.draw=function(e,t,o){var s;n.clear(),s=o?a.parser:i.parser,s.yy=n,s.parse(e);var c;c=n.getDirection(),"undefined"==typeof c&&(c="TD");var l=new u.graphlib.Graph({multigraph:!0,compound:!0}).setGraph({rankdir:c,marginx:20,marginy:20}).setDefaultEdgeLabel(function(){return{}}),h=n.getSubGraphs(),d=0;h.forEach(function(){d+=1;var e="subG"+d;n.addVertex(e,void 0,void 0,void 0)});var p=n.getVertices(),f=n.getEdges();d=0,h.forEach(function(e){d+=1;var t="subG"+d;e.forEach(function(e){l.setParent(e,t)})}),r.addVertices(p,l),r.addEdges(f,l);var g=new u.render;g.shapes().question=function(e,t,r){var n=t.width,i=t.height,a=.8*(n+i),o=[{x:a/2,y:0},{x:a,y:-a/2},{x:a/2,y:-a},{x:0,y:-a/2}],s=e.insert("polygon",":first-child").attr("points",o.map(function(e){return e.x+","+e.y}).join(" ")).attr("rx",5).attr("ry",5).attr("transform","translate("+-a/2+","+2*a/4+")");return r.intersect=function(e){return u.intersect.polygon(r,o,e)},s},g.shapes().rect_left_inv_arrow=function(e,t,r){var n=t.width,i=t.height,a=[{x:-i/2,y:0},{x:n,y:0},{x:n,y:-i},{x:-i/2,y:-i},{x:0,y:-i/2}],o=e.insert("polygon",":first-child").attr("points",a.map(function(e){return e.x+","+e.y}).join(" ")).attr("transform","translate("+-n/2+","+2*i/4+")");return r.intersect=function(e){return u.intersect.polygon(r,a,e)},o},g.arrows().none=function(e,t,r,n){var i=e.append("marker").attr("id",t).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",8).attr("markerHeight",6).attr("orient","auto"),a=i.append("path").attr("d","M 0 0 L 0 0 L 0 0 z");u.util.applyStyle(a,r[n+"Style"])};var y=d3.select("#"+t);svgGroup=d3.select("#"+t+" g"),g(d3.select("#"+t+" g"),l);var m=document.querySelector("#mermaidChart0");y.attr("height",l.graph().height),y.attr("width",l.graph().width),y.attr("viewBox",m.getBBox().x+" 0 "+l.graph().width+" "+l.graph().height)}},{"./graphDb":104,"./parser/dot":105,"./parser/flow":106,"dagre-d3":1}],104:[function(require,module,exports){var vertices={},edges=[],classes=[],subGraphs=[],direction,funs=[];exports.addVertex=function(e,t,r,n){"undefined"!=typeof e&&0!==e.trim().length&&("undefined"==typeof vertices[e]&&(vertices[e]={id:e,styles:[],classes:[]}),"undefined"!=typeof t&&(vertices[e].text=t),"undefined"!=typeof r&&(vertices[e].type=r),"undefined"!=typeof r&&(vertices[e].type=r),"undefined"!=typeof n&&null!==n&&n.f
break;case 83:this.$=a[u-4],n.addVertex(a[u-2],void 0,void 0,a[u]);break;case 84:case 85:this.$=a[u-4],n.updateLink(a[u-2],a[u]);break;case 87:this.$=[a[u]];break;case 88:a[u-2].push(a[u]),this.$=a[u-2];break;case 90:this.$=a[u-1]+a[u]}},table:[{3:1,4:2,11:[1,3]},{1:[3]},t(r,n,{5:4}),{12:[1,5]},{1:[2,1],6:6,7:7,8:8,9:i,10:a,12:u,19:o,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:s,32:22,34:28,42:29,43:30,57:c,58:l,59:h,60:d,61:p,66:f,67:g,69:y,71:m,72:v,74:b,75:A,77:E,78:x,79:w},{13:[1,40],15:[1,41],16:[1,42],17:[1,43],18:[1,44]},t(_,[2,3]),{8:45,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:s,32:22,34:28,42:29,43:30,57:c,58:l,59:h,60:d,61:p,66:f,67:g,69:y,71:m,72:v,74:b,75:A,77:E,78:x,79:w},t(_,[2,5]),t(_,[2,6]),t(_,[2,7]),t(D,k,{7:46,12:u,19:o}),t(D,[2,18],{7:47,12:u,19:o}),{19:[1,48]},{9:C,10:F,19:B,23:49},{9:C,10:F,19:B,23:53},{9:C,10:F,19:B,23:54},{9:C,10:F,19:B,23:55},{9:C,10:F,19:B,23:56},{9:C,10:F,19:B,23:57},t([9,10,12,19,29,31,57,58,59,60,61,66,67,69,71,72,74,75,77,78,79],n,{5:58}),{67:[1,59]},t(T,[2,36],{33:60,45:61,47:[1,62],48:S,49:L,50:N,51:q}),{12:[1,67]},{12:[1,68]},{12:[1,69]},{12:[1,70]},{12:[1,71]},t(I,[2,48],{12:[1,77],15:[1,75],16:[1,76],35:[1,72],38:[1,73],40:[1,74]}),t(O,[2,50],{42:29,43:30,34:78,66:f,69:y,71:m,72:v,74:b,75:A,77:E,78:x,79:w}),t(R,[2,52],{44:[1,79]}),t(P,[2,111]),t(P,[2,112]),t(P,[2,113]),t(P,[2,114]),t(P,[2,115]),t(P,[2,116]),t(P,[2,117]),t(P,[2,118]),t(P,[2,119]),{9:M,12:j,14:80,19:V,20:83},{9:M,12:j,14:85,19:V,20:83},{9:M,12:j,14:86,19:V,20:83},{9:M,12:j,14:87,19:V,20:83},{9:M,12:j,14:88,19:V,20:83},t(_,[2,4]),t(D,[2,16]),t(D,[2,17]),t(_,[2,22]),t(_,[2,23]),t(_,[2,32]),t(_,[2,33]),t(_,[2,34]),t(_,[2,24]),t(_,[2,25]),t(_,[2,26]),t(_,[2,27]),t(_,[2,28]),{6:6,7:7,8:8,9:i,10:a,12:U,19:o,21:13,22:14,24:15,25:16,26:17,27:18,28:19,29:s,30:89,31:G,32:22,34:28,42:29,43:30,57:c,58:l,59:h,60:d,61:p,66:f,67:g,69:y,71:m,72:v,74:b,75:A,77:E,78:x,79:w},{9:$,11:H,12:Y,13:z,15:W,16:Z,29:K,31:X,35:J,37:Q,38:et,39:tt,40:rt,41:nt,43:114,44:it,48:at,49:ut,50:ot,51:st,52:ct,53:94,54:92,55:93,56:117,57:lt,58:ht,59:dt,60:pt,61:ft,63:96,66:f,69:y,71:m,72:v,74:b,75:A,76:95,77:E,78:x,79:w,80:gt,81:yt,82:mt},{32:127,34:28,42:29,43:30,66:f,69:y,71:m,72:v,74:b,75:A,77:E,78:x,79:w},t(vt,[2,56],{46:128,12:[1,129],52:[1,130]}),{12:[1,131]},t(bt,[2,60]),t(bt,[2,61]),t(bt,[2,62]),t(bt,[2,63]),{34:132,42:29,43:30,65:[1,133],66:f,69:y,71:m,72:v,74:b,75:A,77:E,78:x,79:w},{66:[1,134]},{34:135,42:29,43:30,66:f,69:y,71:m,72:v,74:b,75:A,77:E,78:x,79:w},{34:136,42:29,43:30,66:f,69:y,71:m,72:v,74:b,75:A,77:E,78:x,79:w},{34:137,42:29,43:30,66:f,69:y,71:m,72:v,74:b,75:A,77:E,78:x,79:w},{11:H,12:Y,13:z,15:W,16:Z,29:K,31:X,36:138,43:114,44:it,53:139,56:117,57:lt,58:ht,59:dt,60:pt,61:ft,63:96,66:f,69:y,71:m,72:v,74:b,75:A,77:E,78:x,79:w},{11:H,12:Y,13:z,15:W,16:Z,29:K,31:X,36:141,38:[1,140],43:114,44:it,53:139,56:117,57:lt,58:ht,59:dt,60:pt,61:ft,63:96,66:f,69:y,71:m,72:v,74:b,75:A,77:E,78:x,79:w},{11:H,12:Y,13:z,15:W,16:Z,29:K,31:X,36:142,43:114,44:it,53:139,56:117,57:lt,58:ht,59:dt,60:pt,61:ft,63:96,66:f,69:y,71:m,72:v,74:b,75:A,77:E,78:x,79:w},{11:H,12:Y,13:z,15:W,16:Z,29:K,31:X,36:143,43:114,44:it,53:139,56:117,57:lt,58:ht,59:dt,60:pt,61:ft,63:96,66:f,69:y,71:m,72:v,74:b,75:A,77:E,78:x,79:w},{11:H,12:Y,13:z,15:W,16:Z,29:K,31:X,36:144,43:114,44:it,53:139,56:117,57:lt,58:ht,59:dt,60:pt,61:ft,63:96,66:f,69:y,71:m,72:v,74:b,75:A,77:E,78:x,79:w},t(I,[2,49]),t(O,[2,51]),{43:145,66:f,69:y,71:m,72:v,74:b,75:A,77:E,78:x,79:w},t(r,[2,8]),t(r,[2,13]),t(r,[2,14]),{19:[1,146]},{12:j,19:[2,21],20:147},t(r,[2,9]),t(r,[2,10]),t(r,[2,11]),t(r,[2,12]),{9:C,10:F,19:B,23:148},t(T,[2,30]),t(D,k,{7:46,30:149,12:U,19:o,31:G}),{9:$,11:H,12:Y,13:z,15:W,16:Z,19:[2,86],29:K,31:X,35:J,37:Q,38:et,39:tt,40:rt,41:nt,43:114,44:it,48:at,49:ut,50:ot,51:st,52:ct,53:94,55:150,56:117,57:lt,58:ht,59:dt,60:pt,61:ft,63:96,66:f,69:y,71:m,72:v,74:b,75:A,76:95,77:E,78:x,79:w,80:gt,81:yt,82:mt},t(At,[2,67]),t(At,[2,102]),t(At,[2,103]),t(At,[2,104]),t(At,[2,105]),t(At,Et),t(At,[2,120]),t(At,[2,121]),t(At,[2,122]),t(At,[2,123]),t(At,[2,124]),t(At,[2,125]),t(At,[2,126]),
if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[n]),e!==!1?e:!1):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return e?e:this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){var e=this.conditionStack.length-1;return e>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(e,t,r,n){switch(r){case 0:return 10;case 1:return 38;case 2:return 39;case 3:return 36;case 4:return 37;case 5:break;case 6:break;case 7:break;case 8:return 11;case 9:return 19;case 10:return 17;case 11:return 20;case 12:return 21;case 13:return 18;case 14:return 29;case 15:return 30;case 16:return 25;case 17:return 22;case 18:return 15;case 19:return 4;case 20:return 28;case 21:return 10;case 22:return 33;case 23:return 34;case 24:return 35;case 25:return 36;case 26:return 37;case 27:return 40;case 28:return 6;case 29:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:[\-][x])/i,/^(?:[\-][\-][x])/i,/^(?:[\-][>][>])/i,/^(?:[\-][\-][>][>])/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:participant\b)/i,/^(?:opt\b)/i,/^(?:loop\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:title\b)/i,/^(?:sequenceDiagram\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\->:\n,;]+)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?::[^#\n;]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29],inclusive:!0}}};return e}();return b.lexer=A,e.prototype=b,b.Parser=e,new e}();"undefined"!=typeof e&&"undefined"!=typeof r&&(r.parser=i,r.Parser=i.Parser,r.parse=function(){return i.parse.apply(i,arguments)},r.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),n.exit(1));var i=e("fs").readFileSync(e("path").normalize(t[1]),"utf8");return r.parser.parse(i)},"undefined"!=typeof t&&e.main===t&&r.main(n.argv.slice(1)))}).call(this,e("1YiZ5S"))},{"1YiZ5S":99,fs:97,path:98}],108:[function(e,t,r){var n={},i=[],a=[],u=[];r.addActor=function(e,t,r){n[e]={name:t,description:r},i.push(e)},r.addMessage=function(e,t,r,n){a.push({from:e,to:t,message:r,answer:n})},r.addSignal=function(e,t,r,n){a.push({from:e,to:t,message:r,type:n})},r.getMessages=function(){return a},r.getActors=function(){return n},r.getActor=function(e){return n[e]},r.getActorKeys=function(){return Object.keys(n)},r.clear=function(){n={},a=[]},r.LINETYPE={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16},r.ARROWTYPE={FILLED:0,OPEN:1},r.PLACEMENT={LEFTOF:0,RIGHTOF:1,OVER:2},r.addNote=function(e,t,n){var i={actor:e,placement:t,message:n};u.push(i),a.push({from:e,to:e,message:n,type:r.LINETYPE.NOTE,placement:t})},r.parseError=function(e){console.log("Syntax error:"+e)},r.apply=function(e){if(e instanceof Array)e.forEach(function(e){r.apply(e)});else switch(e.type){case"addActor":r.addActor(e.actor,e.actor,e.actor);break;case"addNote":r.addNote(e.actor,e.placement,e.text);break;case"addMessage":r.addSignal(e.from,e.to,e.msg,e.signalType);break;case"loopStart":r.addSignal(void 0,void 0,e.loopText,e.signalType);break;case"loopEnd":r.addSignal(void 0,void 0,void 0,e.signalType);break;case"optStart":r.addSignal(void 0,void 0,e.optText,e.signalType);break;case"optEnd":r.addSignal(void 0,void 0,void 0,e.signalType);break;case"altStart":r.addSignal(void 0,void 0,e.altText,e.si