mermaid/dist/mermaid.slim.min.js

6 lines
194 KiB
JavaScript
Raw Normal View History

2014-12-03 19:29:44 +01:00
!function e(t,r,n){function i(o,u){if(!r[o]){if(!t[o]){var s="function"==typeof require&&require;if(!u&&s)return s(o,!0);if(a)return a(o,!0);throw new Error("Cannot find module '"+o+"'")}var c=r[o]={exports:{}};t[o][0].call(c.exports,function(e){var r=t[o][1][e];return i(r?r:e)},c,c.exports,e,t,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;o<n.length;o++)i(n[o]);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"),o=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(o,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"),o=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(o,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(o.select(this),t.edge(e),0,0).classed("label",!0),u=a.node().getBBox();r.labelId&&a.attr("id",r.labelId),n.has(r,"width")||(r.width=u.width),n.has(r,"height")||(r.height=u.height)}),a.applyTransition(r.exit(),t).style("opacity",0).remove(),r}var n=e("./lodash"),i=e("./label/add-label"),a=e("./util"),o=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 o(i,t),u(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),o=r.points.slice(1,r.points.length-1);return o.unshift(c(n,o[0])),o.push(c(a,o[o.length-1])),i(r,o)}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 o(e,t){var r=e.enter().append("g").attr("class","edgePath").style("opacity",0
2014-12-02 18:36:16 +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"),o=e("./barycenter"),u=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=o.partition(e,function(e){return a.has(e,"barycenter")}),u=r.lhs,s=a.sortBy(r.rhs,function(e){return-e.i}),c=[],l=0,h=0,d=0;u.sort(i(!!t)),d=n(c,s,d),a.each(u,function(e){d+=e.vs.length,c.push(e.vs),l+=e.barycenter*e.weight,h+=e.weight,d=n(c,s,d)});var f={vs:a.flatten(c,!0)};return h&&(f.barycenter=l/h,f.weight=h),f}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"),o=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,o=n(e,t,a.v,a.w),u=o.path,s=o.lca,c=0,l=u[c],h=!0;r!==a.w;){if(i=e.node(r),h){for(;(l=u[c])!==s&&e.node(l).maxRank<i.rank;)c++;l===s&&(h=!1)}if(!h){for(;c<u.length-1&&e.node(l=u[c+1]).minRank<=i.rank;)c++;l=u[c]}e.setParent(r,l),r=e.successors(r)[0]}})}function n(e,t,r,n){var i,a,o=[],u=[],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),o.push(i);while(i&&(t[i].low>s||c>t[i].lim));for(a=i,i=n;(i=e.parent(i))!==a;)u.push(i);return{path:o.concat(u.reverse()),lca:a}}function i(e){function t(i){var o=n;a.each(e.children(i),t),r[i]={low:o,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 o=0,u=0,s=t.length,c=m.last(r);return m.each(r,function(t,l){var h=i(e,t),d=h?e.node(h).order:s;(h||t===c)&&(m.each(r.slice(u,l+1),function(t){m.each(e.predecessors(t),function(r){var i=e.node(r),u=i.order;!(o>u||u>d)||i.dummy&&e.node(t).dummy||a(n,r,t)})}),u=l+1,o=d)}),r}var n={};return m.reduce(t,r),n}function n(e,t){function r(t,r,n,o,u){var s;m.each(m.range(r,n),function(r){s=t[r],e.node(s).dummy&&m.each(e.predecessors(s),function(t){var r=e.node(t);r.dummy&&(r.order<o||r.order>u)&&a(i,t,s)})})}function n(t,n){var i,a=-1,o=0;return m.each(n,function(u,s){if("border"===e.node(u).dummy){var c=e.predecessors(u);c.length&&(i=e.node(c[0]).order,r(n,o,s,a,i),o=s,a=i)}r(n,o,n.length,i,t.length)}),n}var i={};return m.reduce(t,n),i}function i(e,t){return e.node(t).dummy?m.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 o(e,t,r){if(t>r){var n=t;t=r,r=n}return m.has(e[t],r)}function u(e,t,r,n){var i={},a={},u={};return m.each(t,function(e){m.each(e,function(e,t){i[e]=e,a[e]=e,u[e]=t})}),m.each(t,function(e){var t=-1;m.each(e,function(e){var s=n(e);if(s.length){s=m.sortBy(s,function(e){return u[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<u[d]&&!o(r,e,d)&&(a[d]=e,a[e]=i[e]=i[d],t=u[d])}}})}),{root:i,align:a}}function s(e,t,r,n,i){var a={},o={},u={},s={},l={},h=e.graph(),d=p(h.nodesep,h.edgesep,i);return m.each(t,function(e){m.each(e,function(t,r){u[t]=t,a[t]=Number.POSITIVE_INFINITY,l[t]=e[r-1]})}),m.each(e.nodes(),function(i){r[i]===i&&c(e,t,d,r,n,a,o,u,l,s,i)}),m.each(t,function(e){m.each(e,function(e){if(s[e]=s[r[e]],e===r[e]&&a[u[r[e]]]<Number.POSITIVE_INFINITY){s[e]+=a[u[r[e]]];var t=o[u[r[e]]];t&&a[t]!==Number.POSITIVE_INFINITY&&(s[e]+=a[t])}})}),s}function c(e,t,r,n,i,a,o,u,s,l,h){if(!m.has(l,h)){l[h]=0;var d,f=h;do{if(s[f]){d=n[s[f]],c(e,t,r,n,i,a,o,u,s,l,d),u[h]===h&&(u[h]=u[d]);var p=r(e,f,s[f]);u[h]!==u[d]?(a[u[d]]=Math.min(a[u[d]],l[h]-l[d]-p),o[u[d]]=u[h]):l[h]=Math.max(l[h],l[d]+p)}f=i[f]}while(f!==h)}}function l(e,t){retur
2014-12-03 19:29:44 +01:00
return o&&(e=o.v,t=o.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 o=a>=0?arguments[a]:e.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(r=o+"/"+r,i="/"===o.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="/"===o(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("/")),o=Math.min(i.length,a.length),u=o,s=0;o>s;s++)if(i[s]!==a[s]){u=s;break}for(var c=[],s=u;s<i.length;s++)c.push("..");return c=c.concat(a.slice(u)),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 o="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,o="object"==typeof e&&e;(o.global===o||o.window===o)&&(n=o);var u=/[\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
},k=function(e,t){for(var r=-1,n=e.length;++r<n;)if(e[r]==t)return!0;return!1},D=function(e,t){if(!e)return t;var r,n={};for(r in t)n[r]=E(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>"):E(b,e)?(t&&B("disallowed character reference"),b[e]):(t&&k(w,e)&&B("disallowed character reference"),e>65535&&(e-=65536,r+=x(e>>>10&1023|55296),e=56320|1023&e),r+=x(e))},F=function(e){return"&#x"+e.charCodeAt(0).toString(16).toUpperCase()+";"},B=function(e){throw Error("Parse error: "+e)},S=function(e,t){t=D(t,S.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&&E(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(u,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)};S.options={allowUnsafeSymbols:!1,encodeEverything:!1,strict:!1,useNamedReferences:!1};var q=function(e,t){t=D(t,q.options);var r=t.strict;return r&&p.test(e)&&B("malformed character reference"),e.replace(m,function(e,n,i,a,o,u,s,c){var l,h,d,f,p;return n?(l=n,h=i,r&&!h&&B("character reference was not terminated by a semicolon"),C(l,r)):a?(d=a,h=o,r&&!h&&B("character reference was not terminated by a semicolon"),l=parseInt(d,16),C(l,r)):u?(f=u,E(y,f)?y[f]:(r&&B("named character reference was not terminated by a semicolon"),e)):(f=s,p=c,p&&t.isAttributeValue?(r&&"="==p&&B("`&` did not start a character reference"),e):(r&&B("named character reference was not terminated by a semicolon"),v[f]+(p||"")))})};q.options={isAttributeValue:!1,strict:!1};var L=function(e){return e.replace(d,function(e){return f[e]})},N={version:"0.5.0",encode:S,decode:q,escape:L,unescape:q};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 T in N)E(N,T)&&(i[T]=N[T]);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:w+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:w+e,i=t[r]||(t[r]={});"object"==r?(i[n]||(i[n]=[])).push(e):i[n]=!0}}function o(e){return e.charCodeAt(0)}function u(e,t){for(var r=e.criteria,n=t.criteria,i=-1,a=r.length;++i<a;){var o=r[i],u=n[i];if(o!==u){if(o>u||"undefined"==typeof o)return 1;if(u>o||"undefined"==typeof u)return-1}}return e.index-t.index}function s(e){var t=-1,r=e.length,n=e[0],i=e[r/2|0],o=e[r-1];if(n&&"object"==typeof n&&i&&"object"==typeof i&&o&&"object"==typeof o)return!1;var u=h();u["false"]=u["null"]=u["true"]=u.undefined=!1;var s=h();for(s.array=e,s.cache=u,s.push=a;++t<r;)s.push(e[t]);return s}function c(e){return"\\"+Q[e]}function l(){return y.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,y.length<A&&y.push(e)}function f(e){var t=e.cache;t&&f(t),e.array=e.cache=e.criteria=e.object=e.number=e.string=e.value=null,v.length<A&&v.push(e)}function p(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){(function(t){var n=e("./graphDb"),a=e("./parser/flow"),o=e("./utils"),u=e("./sequenceRenderer"),s=e("he"),c=e("dagre-d3");r.addVertices=function(e,t){var r=Object.keys(e),i=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 a,o,u=e[r],s="",c=n.getClasses();if(u.classes.length>0)for(o=0;o<u.classes.length;o++)s=i(s,c[u.classes[o]].styles);else s=i(s,c.default.styles);s=i(s,u.styles),a="undefined"==typeof u.text?u.id:u.text;var l=0,h="";switch(u.type){case"round":l=5,h="rect";break;case"square":h="rect";break;case"diamond":h="question";break;case"odd":h="rect_left_inv_arrow";break;case"circle":h="circle";break;default:h="rect"}t.setNode(u.id,{labelType:"html",shape:h,label:a,rx:l,ry:l,style:s,id:u.id})})},r.addEdges=function(e,t){var r,n=0;e.forEach(function(e){n++,r="arrow_open"===e.type?"none":"vee";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)})};var l=function(e,t){n.clear(),a.parser.yy=n,a.parser.parse(e);var i;i=n.getDirection(),"undefined"==typeof i&&(i="TD");var o=new c.graphlib.Graph({multigraph:!0}).setGraph({rankdir:i,marginx:20,marginy:20}).setDefaultEdgeLabel(function(){return{}}),u=n.getVertices(),s=n.getEdges(),l=n.getClasses();"undefined"==typeof l.default&&(l.default={id:"default"},l.default.styles=["fill:#eaeaea","stroke:#666","stroke-width:1.5px"]),r.addVertices(u,o),r.addEdges(s,o);var h=new c.render;h.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}];return shapeSvg=e.insert("polygon",":first-child").attr("points",o.map(function(e){return e.x+","+e.y}).join(" ")).style("fill","#fff").style("stroke","#333").attr("rx",5).attr("ry",5).attr("transform","translate("+-a/2+","+2*a/4+")"),r.intersect=function(e){return c.intersect.polygon(r,o,e)},shapeSvg},h.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}];return shapeSvg=e.insert("polygon",":first-child").attr("points",a.map(function(e){return e.x+","+e.y}).join(" ")).style("fill","#fff").style("stroke","#333").attr("transform","translate("+-n/2+","+2*i/4+")"),r.intersect=function(e){return c.intersect.polygon(r,a,e)},shapeSvg},h.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");c.util.applyStyle(a,r[n+"Style"])};var d=d3.select("#"+t);svgGroup=d3.select("#"+t+" g"),h(d3.select("#"+t+" g"),o);(d.attr("width")-o.graph().width)/2;d.attr("height",o.graph().height+40)},h=function(){var e=document.querySelectorAll(".mermaid"),t=0;for(i=0;i<e.length;i++){var r=e[i];if(!r.getAttribute("data-processed")){r.setAttribute("data-processed",!0);var a;a="mermaidChart"+t,t++;var c=r.innerHTML;c=c.replace(/>/g,"&gt;"),c=c.replace(/</g,"&lt;"),c=s.decode(c).trim(),r.innerHTML='<svg id="'+a+'" width="100%"><g /></svg>',"graph"===o.detectType(c)?(l(c,a),n.bindFunctions()):u.draw(c,a)}}};r.tester=function(){},r.version=function(){return e("../package.json").version};var d=function(e,t){return"undefined"==typeof t?!1:e===t};"undefined"!=typeof document&&document.addEventListener("DOMContentLoaded",function(){"undefined"!=typeof mermaid_config?d(!0,mermaid_config.startOnLoad)&&h():h()
this.trace(e)},parse:function(e){function t(){var e;return e=p.lex()||d,"number"!=typeof e&&(e=r.symbols_[e]||e),e}var r=this,n=[0],i=[null],a=[],o=this.table,u="",s=0,c=0,l=0,h=2,d=1,f=a.slice.call(arguments,1),p=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]);p.setInput(e,g.yy),g.yy.lexer=p,g.yy.parser=this,"undefined"==typeof p.yylloc&&(p.yylloc={});var y=p.yylloc;a.push(y);var v=p.options&&p.options.ranges;this.parseError="function"==typeof g.yy.parseError?g.yy.parseError:Object.getPrototypeOf(this).parseError;for(var b,w,x,A,_,E,k,D,C,F={};;){if(x=n[n.length-1],this.defaultActions[x]?A=this.defaultActions[x]:((null===b||"undefined"==typeof b)&&(b=t()),A=o[x]&&o[x][b]),"undefined"==typeof A||!A.length||!A[0]){var B="";C=[];for(E in o[x])this.terminals_[E]&&E>h&&C.push("'"+this.terminals_[E]+"'");B=p.showPosition?"Parse error on line "+(s+1)+":\n"+p.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(s+1)+": Unexpected "+(b==d?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(B,{text:p.match,token:this.terminals_[b]||b,line:p.yylineno,loc:y,expected:C})}if(A[0]instanceof Array&&A.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+b);switch(A[0]){case 1:n.push(b),i.push(p.yytext),a.push(p.yylloc),n.push(A[1]),b=null,w?(b=w,w=null):(c=p.yyleng,u=p.yytext,s=p.yylineno,y=p.yylloc,l>0&&l--);break;case 2:if(k=this.productions_[A[1]][1],F.$=i[i.length-k],F._$={first_line:a[a.length-(k||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(k||1)].first_column,last_column:a[a.length-1].last_column},v&&(F._$.range=[a[a.length-(k||1)].range[0],a[a.length-1].range[1]]),_=this.performAction.apply(F,[u,c,s,g.yy,A[1],i,a].concat(f)),"undefined"!=typeof _)return _;k&&(n=n.slice(0,-1*k*2),i=i.slice(0,-1*k),a=a.slice(0,-1*k)),n.push(this.productions_[A[1]][0]),i.push(F.$),a.push(F._$),D=o[n[n.length-2]][n[n.length-1]],n.push(D);break;case 3:return!0}}return!0}},f=function(){var e={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e,t){return this.yy=t||this.yy||{},this._input=e,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 e=this._input[0];this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e;var t=e.match(/(?:\r\n?|\n).*/g);return t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,r=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var n=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),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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})},less:function(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.le