1
0
Fork 0
mirror of synced 2024-11-16 14:05:34 -05:00
ultimate-vim/sources_non_forked/markdown-preview.nvim/app/_static/flowchart@1.13.0.min.js
2022-05-19 20:12:11 +08:00

7 lines
No EOL
31 KiB
JavaScript

// flowchart.js, v1.13.0
// Copyright (c)2019 Adriano Raiano (adrai).
// Distributed under MIT license
// http://adrai.github.io/flowchart.js
!function(t,i){if("object"==typeof exports&&"object"==typeof module)module.exports=i(require("Raphael"));else if("function"==typeof define&&define.amd)define(["Raphael"],i);else{var e=i("object"==typeof exports?require("Raphael"):t.Raphael);for(var s in e)("object"==typeof exports?exports:t)[s]=e[s]}}(this,function(t){return function(t){function i(s){if(e[s])return e[s].exports;var o=e[s]={exports:{},id:s,loaded:!1};return t[s].call(o.exports,o,o.exports,i),o.loaded=!0,o.exports}var e={};return i.m=t,i.c=e,i.p="",i(0)}([function(t,i,e){e(9);var s=e(4);e(15);var o={parse:s};"undefined"!=typeof window&&(window.flowchart=o),t.exports=o},function(t,i){function e(t,i){if(!t||"function"==typeof t)return i;var s={};for(var o in i)s[o]=i[o];for(o in t)t[o]&&("object"==typeof s[o]?s[o]=e(s[o],t[o]):s[o]=t[o]);return s}function s(t,i){if("function"==typeof Object.create)t.super_=i,t.prototype=Object.create(i.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}});else{t.super_=i;var e=function(){};e.prototype=i.prototype,t.prototype=new e,t.prototype.constructor=t}}t.exports={defaults:e,inherits:s}},function(t,i,e){function s(t,i,e){this.chart=t,this.group=this.chart.paper.set(),this.symbol=e,this.connectedTo=[],this.symbolType=i.symbolType,this.flowstate=i.flowstate||"future",this.lineStyle=i.lineStyle||{},this.key=i.key||"",this.leftLines=[],this.rightLines=[],this.topLines=[],this.bottomLines=[],this.next_direction=i.next&&i.direction_next?i.direction_next:void 0,this.text=this.chart.paper.text(0,0,i.text),i.key&&(this.text.node.id=i.key+"t"),this.text.node.setAttribute("class",this.getAttr("class")+"t"),this.text.attr({"text-anchor":"start",x:this.getAttr("text-margin"),fill:this.getAttr("font-color"),"font-size":this.getAttr("font-size")});var s=this.getAttr("font"),o=this.getAttr("font-family"),h=this.getAttr("font-weight");s&&this.text.attr({font:s}),o&&this.text.attr({"font-family":o}),h&&this.text.attr({"font-weight":h}),i.link&&this.text.attr("href",i.link),i.function&&(this.text.attr({cursor:"pointer"}),this.text.node.addEventListener("click",function(t){window[i.function](t,i)},!1)),i.target&&this.text.attr("target",i.target);var n=this.getAttr("maxWidth");if(n){for(var r=i.text.split(" "),a="",l=0,p=r.length;l<p;l++){var y=r[l];this.text.attr("text",a+" "+y),a+=this.text.getBBox().width>n?"\n"+y:" "+y}this.text.attr("text",a.substring(1))}if(this.group.push(this.text),e){var x=this.getAttr("text-margin");e.attr({fill:this.getAttr("fill"),stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),width:this.text.getBBox().width+2*x,height:this.text.getBBox().height+2*x}),e.node.setAttribute("class",this.getAttr("class")),i.link&&e.attr("href",i.link),i.target&&e.attr("target",i.target),i.function&&(e.node.addEventListener("click",function(t){window[i.function](t,i)},!1),e.attr({cursor:"pointer"})),i.key&&(e.node.id=i.key),this.group.push(e),e.insertBefore(this.text),this.text.attr({y:e.getBBox().height/2}),this.initialize()}}var o=e(3),h=o.drawLine,n=o.checkLineIntersection;s.prototype.getAttr=function(t){if(this.chart){var i,e=this.chart.options?this.chart.options[t]:void 0,s=this.chart.options.symbols?this.chart.options.symbols[this.symbolType][t]:void 0;return this.chart.options.flowstate&&this.chart.options.flowstate[this.flowstate]&&(i=this.chart.options.flowstate[this.flowstate][t]),i||s||e}},s.prototype.initialize=function(){this.group.transform("t"+this.getAttr("line-width")+","+this.getAttr("line-width")),this.width=this.group.getBBox().width,this.height=this.group.getBBox().height},s.prototype.getCenter=function(){return{x:this.getX()+this.width/2,y:this.getY()+this.height/2}},s.prototype.getX=function(){return this.group.getBBox().x},s.prototype.getY=function(){return this.group.getBBox().y},s.prototype.shiftX=function(t){this.group.transform("t"+(this.getX()+t)+","+this.getY())},s.prototype.setX=function(t){this.group.transform("t"+t+","+this.getY())},s.prototype.shiftY=function(t){this.group.transform("t"+this.getX()+","+(this.getY()+t))},s.prototype.setY=function(t){this.group.transform("t"+this.getX()+","+t)},s.prototype.getTop=function(){var t=this.getY(),i=this.getX()+this.width/2;return{x:i,y:t}},s.prototype.getBottom=function(){var t=this.getY()+this.height,i=this.getX()+this.width/2;return{x:i,y:t}},s.prototype.getLeft=function(){var t=this.getY()+this.group.getBBox().height/2,i=this.getX();return{x:i,y:t}},s.prototype.getRight=function(){var t=this.getY()+this.group.getBBox().height/2,i=this.getX()+this.group.getBBox().width;return{x:i,y:t}},s.prototype.render=function(){if(this.next){var t=this,i=this.getAttr("line-length");if("right"===this.next_direction){var e=this.getRight();this.next.isPositioned||(this.next.setY(e.y-this.next.height/2),this.next.shiftX(this.group.getBBox().x+this.width+i),function e(){for(var s,o=!1,h=0,n=t.chart.symbols.length;h<n;h++){s=t.chart.symbols[h];var r=Math.abs(s.getCenter().x-t.next.getCenter().x);if(s.getCenter().y>t.next.getCenter().y&&r<=t.next.width/2){o=!0;break}}if(o){if("end"===t.next.symbolType)return;t.next.setX(s.getX()+s.width+i),e()}}(),this.next.isPositioned=!0,this.next.render())}else if("left"===this.next_direction){var s=this.getLeft();this.next.isPositioned||(this.next.setY(s.y-this.next.height/2),this.next.shiftX(-(this.group.getBBox().x+this.width+i)),function e(){for(var s,o=!1,h=0,n=t.chart.symbols.length;h<n;h++){s=t.chart.symbols[h];var r=Math.abs(s.getCenter().x-t.next.getCenter().x);if(s.getCenter().y>t.next.getCenter().y&&r<=t.next.width/2){o=!0;break}}if(o){if("end"===t.next.symbolType)return;t.next.setX(s.getX()+s.width+i),e()}}(),this.next.isPositioned=!0,this.next.render())}else{var o=this.getBottom();this.next.isPositioned||(this.next.shiftY(this.getY()+this.height+i),this.next.setX(o.x-this.next.width/2),this.next.isPositioned=!0,this.next.render())}}},s.prototype.renderLines=function(){this.next&&(this.next_direction?this.drawLineTo(this.next,this.getAttr("arrow-text")||"",this.next_direction):this.drawLineTo(this.next,this.getAttr("arrow-text")||""))},s.prototype.drawLineTo=function(t,i,e){this.connectedTo.indexOf(t)<0&&this.connectedTo.push(t);var s,o,r=this.getCenter().x,a=this.getCenter().y,l=this.getRight(),p=this.getBottom(),y=this.getTop(),x=this.getLeft(),g=t.getCenter().x,f=t.getCenter().y,c=t.getTop(),d=t.getRight(),m=t.getLeft(),u=r===g,b=a===f,_=a<f,v=a>f||this===t,w=r>g,L=r<g,k=0,B=this.getAttr("line-length"),A=this.getAttr("line-width");if(e&&"bottom"!==e||!u||!_)if(e&&"right"!==e||!b||!L)if(e&&"left"!==e||!b||!w)if(e&&"right"!==e||!u||!v)if(e&&"right"!==e||!u||!_)if(e&&"bottom"!==e||!w)if(e&&"bottom"!==e||!L||!_)if(e&&"bottom"!==e||!L)if(e&&"right"===e&&w)o=10*Math.max(t.topLines.length,this.rightLines.length),s=h(this.chart,l,[{x:l.x+B/2,y:l.y},{x:l.x+B/2,y:c.y-B/2-o},{x:c.x,y:c.y-B/2-o},{x:c.x,y:c.y}],i),this.rightLines.push(s),t.topLines.push(s),this.rightStart=!0,t.topEnd=!0,k=l.x+B/2;else if(e&&"right"===e&&L)o=10*Math.max(t.topLines.length,this.rightLines.length),s=h(this.chart,l,[{x:c.x,y:l.y-o},{x:c.x,y:c.y-o}],i),this.rightLines.push(s),t.topLines.push(s),this.rightStart=!0,t.topEnd=!0,k=l.x+B/2;else if(e&&"bottom"===e&&u&&v)o=10*Math.max(t.topLines.length,this.bottomLines.length),s=h(this.chart,p,[{x:p.x,y:p.y+B/2-o},{x:l.x+B/2,y:p.y+B/2-o},{x:l.x+B/2,y:c.y-B/2-o},{x:c.x,y:c.y-B/2-o},{x:c.x,y:c.y}],i),this.bottomLines.push(s),t.topLines.push(s),this.bottomStart=!0,t.topEnd=!0,k=p.x+B/2;else if("left"===e&&u&&v){var M=x.x-B/2;m.x<x.x&&(M=m.x-B/2),o=10*Math.max(t.topLines.length,this.leftLines.length),s=h(this.chart,x,[{x:M,y:x.y-o},{x:M,y:c.y-B/2-o},{x:c.x,y:c.y-B/2-o},{x:c.x,y:c.y}],i),this.leftLines.push(s),t.topLines.push(s),this.leftStart=!0,t.topEnd=!0,k=x.x}else"left"===e?(o=10*Math.max(t.topLines.length,this.leftLines.length),s=h(this.chart,x,[{x:c.x+(x.x-c.x)/2,y:x.y},{x:c.x+(x.x-c.x)/2,y:c.y-B/2-o},{x:c.x,y:c.y-B/2-o},{x:c.x,y:c.y}],i),this.leftLines.push(s),t.topLines.push(s),this.leftStart=!0,t.topEnd=!0,k=x.x):"top"===e&&(o=10*Math.max(t.topLines.length,this.topLines.length),s=h(this.chart,y,[{x:y.x,y:c.y-B/2-o},{x:c.x,y:c.y-B/2-o},{x:c.x,y:c.y}],i),this.topLines.push(s),t.topLines.push(s),this.topStart=!0,t.topEnd=!0,k=y.x);else o=10*Math.max(t.topLines.length,this.bottomLines.length),s=h(this.chart,p,[{x:p.x,y:p.y+B/2-o},{x:p.x+(p.x-c.x)/2,y:p.y+B/2-o},{x:p.x+(p.x-c.x)/2,y:c.y-B/2-o},{x:c.x,y:c.y-B/2-o},{x:c.x,y:c.y}],i),this.bottomLines.push(s),t.topLines.push(s),this.bottomStart=!0,t.topEnd=!0,k=p.x+(p.x-c.x)/2;else o=10*Math.max(t.topLines.length,this.bottomLines.length),s=h(this.chart,p,[{x:p.x,y:c.y-B/2-o},{x:c.x,y:c.y-B/2-o},{x:c.x,y:c.y}],i),this.bottomLines.push(s),t.topLines.push(s),this.bottomStart=!0,t.topEnd=!0,k=p.x,c.x>k&&(k=c.x);else o=10*Math.max(t.topLines.length,this.bottomLines.length),s=this.leftEnd&&v?h(this.chart,p,[{x:p.x,y:p.y+B/2-o},{x:p.x+(p.x-c.x)/2,y:p.y+B/2-o},{x:p.x+(p.x-c.x)/2,y:c.y-B/2-o},{x:c.x,y:c.y-B/2-o},{x:c.x,y:c.y}],i):h(this.chart,p,[{x:p.x,y:c.y-B/2-o},{x:c.x,y:c.y-B/2-o},{x:c.x,y:c.y}],i),this.bottomLines.push(s),t.topLines.push(s),this.bottomStart=!0,t.topEnd=!0,k=p.x+(p.x-c.x)/2;else o=10*Math.max(t.topLines.length,this.rightLines.length),s=h(this.chart,l,[{x:l.x+B/2,y:l.y-o},{x:l.x+B/2,y:c.y-B/2-o},{x:c.x,y:c.y-B/2-o},{x:c.x,y:c.y}],i),this.rightLines.push(s),t.topLines.push(s),this.rightStart=!0,t.topEnd=!0,k=l.x+B/2;else o=10*Math.max(t.topLines.length,this.rightLines.length),s=h(this.chart,l,[{x:l.x+B/2,y:l.y-o},{x:l.x+B/2,y:c.y-B/2-o},{x:c.x,y:c.y-B/2-o},{x:c.x,y:c.y}],i),this.rightLines.push(s),t.topLines.push(s),this.rightStart=!0,t.topEnd=!0,k=l.x+B/2;else 0===t.rightLines.length&&0===this.leftLines.length?s=h(this.chart,x,d,i):(o=10*Math.max(t.rightLines.length,this.leftLines.length),s=h(this.chart,l,[{x:l.x,y:l.y-o},{x:l.x,y:d.y-o},{x:d.x,y:d.y-o},{x:d.x,y:d.y}],i)),this.leftLines.push(s),t.rightLines.push(s),this.leftStart=!0,t.rightEnd=!0,k=d.x;else 0===t.leftLines.length&&0===this.rightLines.length?s=h(this.chart,l,m,i):(o=10*Math.max(t.leftLines.length,this.rightLines.length),s=h(this.chart,l,[{x:l.x,y:l.y-o},{x:l.x,y:m.y-o},{x:m.x,y:m.y-o},{x:m.x,y:m.y}],i)),this.rightLines.push(s),t.leftLines.push(s),this.rightStart=!0,t.leftEnd=!0,k=m.x;else 0===t.topLines.length&&0===this.bottomLines.length?s=h(this.chart,p,c,i):(o=10*Math.max(t.topLines.length,this.bottomLines.length),s=h(this.chart,p,[{x:c.x,y:c.y-o},{x:c.x,y:c.y}],i)),this.bottomLines.push(s),t.topLines.push(s),this.bottomStart=!0,t.topEnd=!0,k=p.x;if(this.lineStyle[t.key]&&s&&s.attr(this.lineStyle[t.key]),s){for(var O=0,X=this.chart.lines.length;O<X;O++)for(var T=this.chart.lines[O],S=T.attr("path"),C=s.attr("path"),Y=0,P=S.length-1;Y<P;Y++){var j=[];j.push(["M",S[Y][1],S[Y][2]]),j.push(["L",S[Y+1][1],S[Y+1][2]]);for(var E=j[0][1],z=j[0][2],F=j[1][1],R=j[1][2],$=0,N=C.length-1;$<N;$++){var V=[];V.push(["M",C[$][1],C[$][2]]),V.push(["L",C[$+1][1],C[$+1][2]]);var G=V[0][1],I=V[0][2],W=V[1][1],Q=V[1][2],q=n(E,z,F,R,G,I,W,Q);if(q.onLine1&&q.onLine2){var J;I===Q?G>W?(J=["L",q.x+2*A,I],C.splice($+1,0,J),J=["C",q.x+2*A,I,q.x,I-4*A,q.x-2*A,I],C.splice($+2,0,J),s.attr("path",C)):(J=["L",q.x-2*A,I],C.splice($+1,0,J),J=["C",q.x-2*A,I,q.x,I-4*A,q.x+2*A,I],C.splice($+2,0,J),s.attr("path",C)):I>Q?(J=["L",G,q.y+2*A],C.splice($+1,0,J),J=["C",G,q.y+2*A,G+4*A,q.y,G,q.y-2*A],C.splice($+2,0,J),s.attr("path",C)):(J=["L",G,q.y-2*A],C.splice($+1,0,J),J=["C",G,q.y-2*A,G+4*A,q.y,G,q.y+2*A],C.splice($+2,0,J),s.attr("path",C)),$+=2}}}this.chart.lines.push(s),(void 0===this.chart.minXFromSymbols||this.chart.minXFromSymbols>x.x)&&(this.chart.minXFromSymbols=x.x)}(!this.chart.maxXFromLine||this.chart.maxXFromLine&&k>this.chart.maxXFromLine)&&(this.chart.maxXFromLine=k)},t.exports=s},function(t,i){function e(t,i,e){var s,o,h="M{0},{1}";for(s=2,o=2*e.length+2;s<o;s+=2)h+=" L{"+s+"},{"+(s+1)+"}";var n=[i.x,i.y];for(s=0,o=e.length;s<o;s++)n.push(e[s].x),n.push(e[s].y);var r=t.paper.path(h,n);r.attr("stroke",t.options["element-color"]),r.attr("stroke-width",t.options["line-width"]);var a=t.options.font,l=t.options["font-family"],p=t.options["font-weight"];return a&&r.attr({font:a}),l&&r.attr({"font-family":l}),p&&r.attr({"font-weight":p}),r}function s(t,i,e,s){var o,h;"[object Array]"!==Object.prototype.toString.call(e)&&(e=[e]);var n="M{0},{1}";for(o=2,h=2*e.length+2;o<h;o+=2)n+=" L{"+o+"},{"+(o+1)+"}";var r=[i.x,i.y];for(o=0,h=e.length;o<h;o++)r.push(e[o].x),r.push(e[o].y);var a=t.paper.path(n,r);a.attr({stroke:t.options["line-color"],"stroke-width":t.options["line-width"],"arrow-end":t.options["arrow-end"]});var l=t.options.font,p=t.options["font-family"],y=t.options["font-weight"];if(l&&a.attr({font:l}),p&&a.attr({"font-family":p}),y&&a.attr({"font-weight":y}),s){var x=!1,g=t.paper.text(0,0,s),f=!1,c=e[0];i.y===c.y&&(f=!0);var d=0,m=0;x?(d=i.x>c.x?i.x-(i.x-c.x)/2:c.x-(c.x-i.x)/2,m=i.y>c.y?i.y-(i.y-c.y)/2:c.y-(c.y-i.y)/2,f?(d-=g.getBBox().width/2,m-=t.options["text-margin"]):(d+=t.options["text-margin"],m-=g.getBBox().height/2)):(d=i.x,m=i.y,f?(d+=t.options["text-margin"]/2,m-=t.options["text-margin"]):(d+=t.options["text-margin"]/2,m+=t.options["text-margin"],i.y>c.y&&(m-=2*t.options["text-margin"]))),g.attr({"text-anchor":"start","font-size":t.options["font-size"],fill:t.options["font-color"],x:d,y:m}),l&&g.attr({font:l}),p&&g.attr({"font-family":p}),y&&g.attr({"font-weight":y})}return a}function o(t,i,e,s,o,h,n,r){var a,l,p,y,x,g={x:null,y:null,onLine1:!1,onLine2:!1};return a=(r-h)*(e-t)-(n-o)*(s-i),0===a?g:(l=i-h,p=t-o,y=(n-o)*l-(r-h)*p,x=(e-t)*l-(s-i)*p,l=y/a,p=x/a,g.x=t+l*(e-t),g.y=i+l*(s-i),l>0&&l<1&&(g.onLine1=!0),p>0&&p<1&&(g.onLine2=!0),g)}t.exports={drawPath:e,drawLine:s,checkLineIntersection:o}},function(t,i,e){function s(t){function i(t){var i=t.indexOf("(")+1,e=t.indexOf(")");return i>=0&&e>=0?t.substring(i,e):"{}"}function e(t){var i=t.indexOf("(")+1,e=t.indexOf(")");return i>=0&&e>=0?t.substring(i,e):""}function s(t){var i=t.indexOf("(")+1,e=t.indexOf(")");return i>=0&&e>=0?g.symbols[t.substring(0,i-1)]:g.symbols[t]}function x(t){var i="next",e=t.indexOf("(")+1,s=t.indexOf(")");return e>=0&&s>=0&&(i=E.substring(e,s),i.indexOf(",")<0&&"yes"!==i&&"no"!==i&&(i="next, "+i)),i}t=t||"",t=t.trim();for(var g={symbols:{},start:null,drawSVG:function(t,i){function e(t){if(g[t.key])return g[t.key];switch(t.symbolType){case"start":g[t.key]=new h(x,t);break;case"end":g[t.key]=new n(x,t);break;case"operation":g[t.key]=new r(x,t);break;case"inputoutput":g[t.key]=new a(x,t);break;case"subroutine":g[t.key]=new l(x,t);break;case"condition":g[t.key]=new p(x,t);break;case"parallel":g[t.key]=new y(x,t);break;default:return new Error("Wrong symbol type!")}return g[t.key]}var s=this;this.diagram&&this.diagram.clean();var x=new o(t,i);this.diagram=x;var g={};!function t(i,o,h){var n=e(i);return s.start===i?x.startWith(n):o&&h&&!o.pathOk&&(o instanceof p?(h.yes===i&&o.yes(n),h.no===i&&o.no(n)):o instanceof y?(h.path1===i&&o.path1(n),h.path2===i&&o.path2(n),h.path3===i&&o.path3(n)):o.then(n)),n.pathOk?n:(n instanceof p?(i.yes&&t(i.yes,n,i),i.no&&t(i.no,n,i)):n instanceof y?(i.path1&&t(i.path1,n,i),i.path2&&t(i.path2,n,i),i.path3&&t(i.path3,n,i)):i.next&&t(i.next,n,i),n)}(this.start),x.render()},clean:function(){this.diagram.clean()},options:function(){return this.diagram.options}},f=[],c=0,d=1,m=t.length;d<m;d++)if("\n"===t[d]&&"\\"!==t[d-1]){var u=t.substring(c,d);c=d+1,f.push(u.replace(/\\\n/g,"\n"))}c<t.length&&f.push(t.substr(c));for(var b=1,_=f.length;b<_;){var v=f[b];v.indexOf("->")<0&&v.indexOf("=>")<0&&v.indexOf("@>")<0?(f[b-1]+="\n"+v,f.splice(b,1),_--):b++}for(;f.length>0;){var w=f.splice(0,1)[0].trim();if(w.indexOf("=>")>=0){var L=w.split("=>"),k={key:L[0].replace(/\(.*\)/,""),symbolType:L[1],text:null,link:null,target:null,flowstate:null,function:null,lineStyle:{},params:{}},B=L[0].match(/\((.*)\)/);if(B&&B.length>1)for(var A=B[1].split(","),M=0;M<A.length;M++){var O=A[M].split("=");2==O.length&&(k.params[O[0]]=O[1])}var X;if(k.symbolType.indexOf(": ")>=0&&(X=k.symbolType.split(": "),k.symbolType=X.shift(),k.text=X.join(": ")),k.text&&k.text.indexOf(":$")>=0?(X=k.text.split(":$"),k.text=X.shift(),k.function=X.join(":$")):k.symbolType.indexOf(":$")>=0?(X=k.symbolType.split(":$"),k.symbolType=X.shift(),k.function=X.join(":$")):k.text&&k.text.indexOf(":>")>=0?(X=k.text.split(":>"),k.text=X.shift(),k.link=X.join(":>")):k.symbolType.indexOf(":>")>=0&&(X=k.symbolType.split(":>"),k.symbolType=X.shift(),k.link=X.join(":>")),k.symbolType.indexOf("\n")>=0&&(k.symbolType=k.symbolType.split("\n")[0]),k.link){var T=k.link.indexOf("[")+1,S=k.link.indexOf("]");T>=0&&S>=0&&(k.target=k.link.substring(T,S),k.link=k.link.substring(0,T-1))}if(k.text&&k.text.indexOf("|")>=0){var C=k.text.split("|");k.flowstate=C.pop().trim(),k.text=C.join("|")}g.symbols[k.key]=k}else if(w.indexOf("->")>=0)for(var Y=w.split("->"),P=0,j=Y.length;P<j;P++){var E=Y[P],z=e(E);"true"!==z&&"false"!==z||(E=E.replace("true","yes"),E=E.replace("false","no"));var F=s(E),R=x(E),$=null;if(R.indexOf(",")>=0){var N=R.split(",");R=N[0],$=N[1].trim()}if(g.start||(g.start=F),P+1<j){var V=Y[P+1];F[R]=s(V),F["direction_"+R]=$,$=null}}else if(w.indexOf("@>")>=0)for(var G=w.split("@>"),I=0,W=G.length;I<W;I++)if(I+1!==W){var Q=s(G[I]),q=s(G[I+1]);Q.lineStyle[q.key]=JSON.parse(i(G[I+1]))}}return g}var o=e(7),h=e(13),n=e(10),r=e(12),a=e(11),l=e(14),p=e(5),y=e(6);t.exports=s},function(t,i,e){function s(t,i){i=i||{},o.call(this,t,i),this.textMargin=this.getAttr("text-margin"),this.yes_direction="bottom",this.no_direction="right",this.params=i.params,i.yes&&i.direction_yes&&i.no&&!i.direction_no?"right"===i.direction_yes?(this.no_direction="bottom",this.yes_direction="right"):"top"===i.direction_yes?(this.no_direction="right",this.yes_direction="top"):(this.no_direction="right",this.yes_direction="bottom"):i.yes&&!i.direction_yes&&i.no&&i.direction_no?"right"===i.direction_no?(this.yes_direction="bottom",this.no_direction="right"):(this.yes_direction="right",this.no_direction="bottom"):i.yes&&i.direction_yes&&i.no&&i.direction_no&&i.direction_no!==i.direction_yes?"right"===i.direction_yes?(this.no_direction="bottom",this.yes_direction="right"):"top"===i.direction_yes?(this.no_direction="right",this.yes_direction="top"):(this.no_direction="right",this.yes_direction="bottom"):(this.yes_direction="bottom",this.no_direction="right"),this.yes_direction=this.yes_direction||"bottom",this.no_direction=this.no_direction||"right",this.text.attr({x:2*this.textMargin});var e=this.text.getBBox().width+3*this.textMargin;e+=e/2;var s=this.text.getBBox().height+2*this.textMargin;s+=s/2,s=Math.max(.5*e,s);var h=e/4,n=s/4;this.text.attr({x:h+this.textMargin/2});var a={x:h,y:n},l=[{x:h-e/4,y:n+s/4},{x:h-e/4+e/2,y:n+s/4+s/2},{x:h-e/4+e,y:n+s/4},{x:h-e/4+e/2,y:n+s/4-s/2},{x:h-e/4,y:n+s/4}],p=r(t,a,l);p.attr({stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),fill:this.getAttr("fill")}),i.link&&p.attr("href",i.link),i.target&&p.attr("target",i.target),i.key&&(p.node.id=i.key),p.node.setAttribute("class",this.getAttr("class")),this.text.attr({y:p.getBBox().height/2}),this.group.push(p),p.insertBefore(this.text),this.initialize()}var o=e(2),h=e(1).inherits,n=e(3),r=n.drawPath;h(s,o),s.prototype.render=function(){this.yes_direction&&(this[this.yes_direction+"_symbol"]=this.yes_symbol),this.no_direction&&(this[this.no_direction+"_symbol"]=this.no_symbol);var t=this.getAttr("line-length");if(this.bottom_symbol){var i=this.getBottom();this.bottom_symbol.isPositioned||(this.bottom_symbol.shiftY(this.getY()+this.height+t),this.bottom_symbol.setX(i.x-this.bottom_symbol.width/2),this.bottom_symbol.isPositioned=!0,this.bottom_symbol.render())}if(this.right_symbol){var e=this.getRight();if(!this.right_symbol.isPositioned){this.right_symbol.setY(e.y-this.right_symbol.height/2),this.right_symbol.shiftX(this.group.getBBox().x+this.width+t);var s=this;!function i(){for(var e,o=!1,h=0,n=s.chart.symbols.length;h<n;h++)if(e=s.chart.symbols[h],!s.params["align-next"]||"no"!==s.params["align-next"]){var r=Math.abs(e.getCenter().x-s.right_symbol.getCenter().x);if(e.getCenter().y>s.right_symbol.getCenter().y&&r<=s.right_symbol.width/2){o=!0;break}}if(o){if("end"===s.right_symbol.symbolType)return;s.right_symbol.setX(e.getX()+e.width+t),i()}}(),this.right_symbol.isPositioned=!0,this.right_symbol.render()}}},s.prototype.renderLines=function(){this.yes_symbol&&this.drawLineTo(this.yes_symbol,this.getAttr("yes-text"),this.yes_direction),this.no_symbol&&this.drawLineTo(this.no_symbol,this.getAttr("no-text"),this.no_direction)},t.exports=s},function(t,i,e){function s(t,i){var e=t.paper.rect(0,0,0,0);i=i||{},o.call(this,t,i,e),this.textMargin=this.getAttr("text-margin"),this.path1_direction="bottom",this.path2_direction="right",this.path3_direction="top",this.params=i.params,"path1"===i.direction_next&&!i[i.direction_next]&&i.next&&(i[i.direction_next]=i.next),"path2"===i.direction_next&&!i[i.direction_next]&&i.next&&(i[i.direction_next]=i.next),"path3"===i.direction_next&&!i[i.direction_next]&&i.next&&(i[i.direction_next]=i.next),i.path1&&i.direction_path1&&i.path2&&!i.direction_path2&&i.path3&&!i.direction_path3?"right"===i.direction_path1?(this.path2_direction="bottom",this.path1_direction="right",this.path3_direction="top"):"top"===i.direction_path1?(this.path2_direction="right",this.path1_direction="top",this.path3_direction="bottom"):"left"===i.direction_path1?(this.path2_direction="right",this.path1_direction="left",this.path3_direction="bottom"):(this.path2_direction="right",this.path1_direction="bottom",this.path3_direction="top"):i.path1&&!i.direction_path1&&i.path2&&i.direction_path2&&i.path3&&!i.direction_path3?"right"===i.direction_path2?(this.path1_direction="bottom",this.path2_direction="right",this.path3_direction="top"):"left"===i.direction_path2?(this.path1_direction="bottom",this.path2_direction="left",this.path3_direction="right"):(this.path1_direction="right",this.path2_direction="bottom",this.path3_direction="top"):i.path1&&!i.direction_path1&&i.path2&&!i.direction_path2&&i.path3&&i.direction_path3?"right"===i.direction_path2?(this.path1_direction="bottom",this.path2_direction="top",this.path3_direction="right"):"left"===i.direction_path2?(this.path1_direction="bottom",this.path2_direction="right",this.path3_direction="left"):(this.path1_direction="right",this.path2_direction="bottom",this.path3_direction="top"):(this.path1_direction=i.direction_path1,this.path2_direction=i.direction_path2,this.path3_direction=i.direction_path3),this.path1_direction=this.path1_direction||"bottom",this.path2_direction=this.path2_direction||"right",this.path3_direction=this.path3_direction||"top",this.initialize()}var o=e(2),h=e(1).inherits;h(s,o),s.prototype.render=function(){this.path1_direction&&(this[this.path1_direction+"_symbol"]=this.path1_symbol),this.path2_direction&&(this[this.path2_direction+"_symbol"]=this.path2_symbol),this.path3_direction&&(this[this.path3_direction+"_symbol"]=this.path3_symbol);var t=this.getAttr("line-length");if(this.bottom_symbol){var i=this.getBottom();this.bottom_symbol.isPositioned||(this.bottom_symbol.shiftY(this.getY()+this.height+t),this.bottom_symbol.setX(i.x-this.bottom_symbol.width/2),this.bottom_symbol.isPositioned=!0,this.bottom_symbol.render())}if(this.top_symbol){var e=this.getTop();this.top_symbol.isPositioned||(this.top_symbol.shiftY(this.getY()-this.top_symbol.height-t),this.top_symbol.setX(e.x+this.top_symbol.width),this.top_symbol.isPositioned=!0,this.top_symbol.render())}var s=this;if(this.left_symbol){var o=this.getLeft();this.left_symbol.isPositioned||(this.left_symbol.setY(o.y-this.left_symbol.height/2),this.left_symbol.shiftX(-(this.group.getBBox().x+this.width+t)),function i(){for(var e,o=!1,h=0,n=s.chart.symbols.length;h<n;h++)if(e=s.chart.symbols[h],!s.params["align-next"]||"no"!==s.params["align-next"]){var r=Math.abs(e.getCenter().x-s.left_symbol.getCenter().x);if(e.getCenter().y>s.left_symbol.getCenter().y&&r<=s.left_symbol.width/2){o=!0;break}}if(o){if("end"===s.left_symbol.symbolType)return;s.left_symbol.setX(e.getX()+e.width+t),i()}}(),this.left_symbol.isPositioned=!0,this.left_symbol.render())}if(this.right_symbol){var h=this.getRight();this.right_symbol.isPositioned||(this.right_symbol.setY(h.y-this.right_symbol.height/2),this.right_symbol.shiftX(this.group.getBBox().x+this.width+t),function i(){for(var e,o=!1,h=0,n=s.chart.symbols.length;h<n;h++)if(e=s.chart.symbols[h],!s.params["align-next"]||"no"!==s.params["align-next"]){var r=Math.abs(e.getCenter().x-s.right_symbol.getCenter().x);if(e.getCenter().y>s.right_symbol.getCenter().y&&r<=s.right_symbol.width/2){o=!0;break}}if(o){if("end"===s.right_symbol.symbolType)return;s.right_symbol.setX(e.getX()+e.width+t),i()}}(),this.right_symbol.isPositioned=!0,this.right_symbol.render())}},s.prototype.renderLines=function(){this.path1_symbol&&this.drawLineTo(this.path1_symbol,"",this.path1_direction),this.path2_symbol&&this.drawLineTo(this.path2_symbol,"",this.path2_direction),this.path3_symbol&&this.drawLineTo(this.path3_symbol,"",this.path3_direction)},t.exports=s},function(t,i,e){function s(t,i){i=i||{},this.paper=new o(t),this.options=h(i,n),this.symbols=[],this.lines=[],this.start=null}var o=e(16),h=e(1).defaults,n=e(8),r=e(5),a=e(6);s.prototype.handle=function(t){this.symbols.indexOf(t)<=-1&&this.symbols.push(t);var i=this;return t instanceof r?(t.yes=function(e){return t.yes_symbol=e,t.no_symbol&&(t.pathOk=!0),i.handle(e)},t.no=function(e){return t.no_symbol=e,t.yes_symbol&&(t.pathOk=!0),i.handle(e)}):t instanceof a?(t.path1=function(e){return t.path1_symbol=e,t.path2_symbol&&(t.pathOk=!0),i.handle(e)},t.path2=function(e){return t.path2_symbol=e,t.path3_symbol&&(t.pathOk=!0),i.handle(e)},t.path3=function(e){return t.path3_symbol=e,t.path1_symbol&&(t.pathOk=!0),i.handle(e)}):t.then=function(e){return t.next=e,t.pathOk=!0,i.handle(e)},t},s.prototype.startWith=function(t){return this.start=t,this.handle(t)},s.prototype.render=function(){var t,i,e=0,s=0,o=0,h=0,n=0,r=0,a=0,l=0;for(o=0,h=this.symbols.length;o<h;o++)t=this.symbols[o],t.width>e&&(e=t.width),t.height>s&&(s=t.height);for(o=0,h=this.symbols.length;o<h;o++)t=this.symbols[o],t.shiftX(this.options.x+(e-t.width)/2+this.options["line-width"]),t.shiftY(this.options.y+(s-t.height)/2+this.options["line-width"]);for(this.start.render(),o=0,h=this.symbols.length;o<h;o++)t=this.symbols[o],t.renderLines();n=this.maxXFromLine;var p,y;for(o=0,h=this.symbols.length;o<h;o++)t=this.symbols[o],p=t.getX()+t.width,y=t.getY()+t.height,p>n&&(n=p),y>r&&(r=y);for(o=0,h=this.lines.length;o<h;o++){i=this.lines[o].getBBox(),p=i.x,y=i.y;var x=i.x2,g=i.y2;p<a&&(a=p),y<l&&(l=y),x>n&&(n=x),g>r&&(r=g)}var f=this.options.scale,c=this.options["line-width"];this.minXFromSymbols<a&&(a=this.minXFromSymbols),a<0&&(a-=c),l<0&&(l-=c);var d=n+c-a,m=r+c-l;this.paper.setSize(d*f,m*f),this.paper.setViewBox(a,l,d,m,!0)},s.prototype.clean=function(){if(this.paper){var t=this.paper.canvas;t.parentNode&&t.parentNode.removeChild(t)}},t.exports=s},function(t,i){t.exports={x:0,y:0,"line-width":3,"line-length":50,"text-margin":10,"font-size":14,"font-color":"black","line-color":"black","element-color":"black",fill:"white","yes-text":"yes","no-text":"no","arrow-end":"block",class:"flowchart",scale:1,symbols:{start:{},end:{},condition:{},inputoutput:{},operation:{},subroutine:{},parallel:{}}}},function(t,i){Array.prototype.indexOf||(Array.prototype.indexOf=function(t){"use strict";if(null===this)throw new TypeError;var i=Object(this),e=i.length>>>0;if(0===e)return-1;var s=0;if(arguments.length>0&&(s=Number(arguments[1]),s!=s?s=0:0!==s&&s!=1/0&&s!=-(1/0)&&(s=(s>0||-1)*Math.floor(Math.abs(s)))),s>=e)return-1;for(var o=s>=0?s:Math.max(e-Math.abs(s),0);o<e;o++)if(o in i&&i[o]===t)return o;return-1}),Array.prototype.lastIndexOf||(Array.prototype.lastIndexOf=function(t){"use strict";if(null===this)throw new TypeError;var i=Object(this),e=i.length>>>0;if(0===e)return-1;var s=e;arguments.length>1&&(s=Number(arguments[1]),s!=s?s=0:0!==s&&s!=1/0&&s!=-(1/0)&&(s=(s>0||-1)*Math.floor(Math.abs(s))));for(var o=s>=0?Math.min(s,e-1):e-Math.abs(s);o>=0;o--)if(o in i&&i[o]===t)return o;return-1}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")})},function(t,i,e){function s(t,i){var e=t.paper.rect(0,0,0,0,20);i=i||{},i.text=i.text||"End",o.call(this,t,i,e)}var o=e(2),h=e(1).inherits;h(s,o),t.exports=s},function(t,i,e){function s(t,i){i=i||{},o.call(this,t,i),this.textMargin=this.getAttr("text-margin"),this.text.attr({x:3*this.textMargin});var e=this.text.getBBox().width+4*this.textMargin,s=this.text.getBBox().height+2*this.textMargin,h=this.textMargin,n=s/2,a={x:h,y:n},l=[{x:h-this.textMargin,y:s},{x:h-this.textMargin+e,y:s},{x:h-this.textMargin+e+2*this.textMargin,y:0},{x:h-this.textMargin+2*this.textMargin,y:0},{x:h,y:n}],p=r(t,a,l);p.attr({stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),fill:this.getAttr("fill")}),i.link&&p.attr("href",i.link),i.target&&p.attr("target",i.target),i.key&&(p.node.id=i.key),p.node.setAttribute("class",this.getAttr("class")),this.text.attr({y:p.getBBox().height/2}),this.group.push(p),p.insertBefore(this.text),this.initialize()}var o=e(2),h=e(1).inherits,n=e(3),r=n.drawPath;h(s,o),s.prototype.getLeft=function(){var t=this.getY()+this.group.getBBox().height/2,i=this.getX()+this.textMargin;return{x:i,y:t}},s.prototype.getRight=function(){var t=this.getY()+this.group.getBBox().height/2,i=this.getX()+this.group.getBBox().width-this.textMargin;return{x:i,y:t}},t.exports=s},function(t,i,e){function s(t,i){var e=t.paper.rect(0,0,0,0);i=i||{},o.call(this,t,i,e)}var o=e(2),h=e(1).inherits;h(s,o),t.exports=s},function(t,i,e){function s(t,i){var e=t.paper.rect(0,0,0,0,20);i=i||{},i.text=i.text||"Start",o.call(this,t,i,e)}var o=e(2),h=e(1).inherits;h(s,o),t.exports=s},function(t,i,e){function s(t,i){var e=t.paper.rect(0,0,0,0);i=i||{},o.call(this,t,i,e),e.attr({width:this.text.getBBox().width+4*this.getAttr("text-margin")}),this.text.attr({x:2*this.getAttr("text-margin")});var s=t.paper.rect(0,0,0,0);s.attr({x:this.getAttr("text-margin"),stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),width:this.text.getBBox().width+2*this.getAttr("text-margin"),height:this.text.getBBox().height+2*this.getAttr("text-margin"),fill:this.getAttr("fill")}),i.key&&(s.node.id=i.key+"i");var h=this.getAttr("font"),n=this.getAttr("font-family"),r=this.getAttr("font-weight");h&&s.attr({font:h}),n&&s.attr({"font-family":n}),r&&s.attr({"font-weight":r}),i.link&&s.attr("href",i.link),i.target&&s.attr("target",i.target),this.group.push(s),s.insertBefore(this.text),this.initialize()}var o=e(2),h=e(1).inherits;h(s,o),t.exports=s},function(t,i,e){if("undefined"!=typeof jQuery){var s=e(4);!function(t){function i(t,i){return t==i||Array.isArray(i)&&(i.includes(t)||i.includes(Number(t)))}var e={init:function(i){return this.each(function(){var e=t(this);this.chart=s(e.text()),e.html(""),this.chart.drawSVG(this,i)})},setFlowStateByParam:function(t,e,s){return this.each(function(){var o=this.chart,h=["next","yes","no","path1","path2","path3"];for(var n in o.symbols)if(o.symbols.hasOwnProperty(n)){var r=o.symbols[n],a=r.params[t];if(i(a,e)){r.flowstate=s;for(var l=0;l<h.length;l++){var p=h[l];r[p]&&r[p].params&&r[p].params[t]&&i(r[p].params[t],e)&&(r.lineStyle[r[p].key]={stroke:o.options().flowstate[s].fill})}}}o.clean(),o.drawSVG(this)})},clearFlowState:function(){return this.each(function(){var t=this.chart;for(var i in t.symbols)if(t.symbols.hasOwnProperty(i)){var e=t.symbols[i];e.flowstate=""}t.clean(),t.drawSVG(this)})}};t.fn.flowChart=function(i){return e[i]?e[i].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof i&&i?void t.error("Method "+i+" does not exist on jQuery.flowChart"):e.init.apply(this,arguments)}}(jQuery)}},function(i,e){i.exports=t}])});
//# sourceMappingURL=flowchart.min.js.map