1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4119cfa3"],{"417c":function(e,t,n){},7692:function(e,t,n){},eb21:function(e,t,n){"use strict";n.d(t,"a",(function(){return Ce})),n.d(t,"c",(function(){return Fe})),n.d(t,"b",(function(){return He})),n.d(t,"d",(function(){return Ye}));var o=n("5e90");function r(e,t){return t={exports:{}},e(t,t.exports),t.exports}var i=r((function(e){var t=e.exports=function(e,n){if(n||(n=16),void 0===e&&(e=128),e<=0)return"0";for(var o=Math.log(Math.pow(2,e))/Math.log(n),r=2;o===1/0;r*=2)o=Math.log(Math.pow(2,e/r))/Math.log(n)*r;var i=o-Math.floor(o),a="";for(r=0;r<Math.floor(o);r++){var l=Math.floor(Math.random()*n).toString(n);a=l+a}if(i){var s=Math.pow(n,i);l=Math.floor(Math.random()*s).toString(n);a=l+a}var u=parseInt(a,n);return u!==1/0&&u>=Math.pow(2,e)?t(e,n):a};t.rack=function(e,n,o){var r=function(r){var a=0;do{if(a++>10){if(!o)throw new Error("too many ID collisions, use more bits");e+=o}var l=t(e,n)}while(Object.hasOwnProperty.call(i,l));return i[l]=r,l},i=r.hats={};return r.get=function(e){return r.hats[e]},r.set=function(e,t){return r.hats[e]=t,r},r.bits=e||128,r.base=n||16,r}}));function a(e){if(!(this instanceof a))return new a(e);e=e||[128,36,1],this._seed=e.length?i.rack(e[0],e[1],e[2]):e}a.prototype.next=function(e){return this._seed(e||!0)},a.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},a.prototype.claim=function(e,t){this._seed.set(e,t||!0)},a.prototype.assigned=function(e){return this._seed.get(e)||!1},a.prototype.unclaim=function(e){delete this._seed.hats[e]},a.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};var l=a,s=new l([32,32,1]);function u(){return s.next()}var p=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),c=function(){return c=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},c.apply(this,arguments)},d=function(e){function t(t,n){var o=this;return t.id||(t.id="Event_"+u()),t.text||(t.text=""),t.text&&"string"===typeof t.text&&(t.text={value:t.text,x:t.x,y:t.y+40}),o=e.call(this,t,n)||this,o}return p(t,e),t.prototype.getConnectedTargetRules=function(){var t=e.prototype.getConnectedTargetRules.call(this),n={message:"起始节点不能作为连线的终点",validate:function(){return!1}};return t.push(n),t},t.extendKey="StartEventModel",t}(o["CircleNodeModel"]),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.getAttributes=function(){var t=e.prototype.getAttributes.call(this);return c({},t)},t.extendKey="StartEventNode",t}(o["CircleNode"]),f={type:"bpmn:startEvent",view:h,model:d},y=f,_=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),g=function(e){function t(t,n){var o=this;return t.id||(t.id="Event_"+u()),t.text||(t.text=""),t.text&&"string"===typeof t.text&&(t.text={value:t.text,x:t.x,y:t.y+40}),o=e.call(this,t,n)||this,o}return _(t,e),t.prototype.getConnectedSourceRules=function(){var t=e.prototype.getConnectedSourceRules.call(this),n={message:"结束节点不能作为连线的起点",validate:function(){return!1}};return t.push(n),t},t.extendKey="EndEventModel",t}(o["CircleNodeModel"]),m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _(t,e),t.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},t.prototype.getShape=function(){var t=this.getAttributes(),n=t.x,r=t.y,i=t.fill,a=t.stroke,l=t.strokeWidth,s=t.r,u=e.prototype.getShape.call(this);return Object(o["h"])("g",{},u,Object(o["h"])("circle",{cx:n,cy:r,fill:i,stroke:a,strokeWidth:l,r:s-5}))},t.extendKey="EndEventView",t}(o["CircleNode"]),v={type:"bpmn:endEvent",view:m,model:g},x=v,b=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),w=function(e){function t(t,n){var o=this;return t.id||(t.id="Gateway_"+u()),t.text||(t.text=""),t.text&&"string"===typeof t.text&&(t.text={value:t.text,x:t.x,y:t.y+40}),o=e.call(this,t,n)||this,o.points=[[25,0],[50,25],[25,50],[0,25]],o}return b(t,e),t.extendKey="ExclusiveGatewayModel",t}(o["PolygonNodeModel"]),M=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return b(t,e),t.prototype.getShape=function(){var t=e.prototype.getAttributes.call(this),n=t.x,r=t.y,i=t.fill,a=t.stroke,l=t.strokeWidth,s=t.width,u=t.height,p=t.points;return Object(o["h"])("g",{transform:"matrix(1 0 0 1 "+(n-s/2)+" "+(r-u/2)+")"},Object(o["h"])("polygon",{fill:i,x:n,y:r,stroke:a,strokeWidth:l,points:p}),Object(o["h"])("path",{fill:i,stroke:a,strokeWidth:l,d:"m 16,15 7.42857142857143,9.714285714285715 -7.42857142857143,9.714285714285715 3.428571428571429,0 5.714285714285715,-7.464228571428572 5.714285714285715,7.464228571428572 3.428571428571429,0 -7.42857142857143,-9.714285714285715 7.42857142857143,-9.714285714285715 -3.428571428571429,0 -5.714285714285715,7.464228571428572 -5.714285714285715,-7.464228571428572 -3.428571428571429,0 z"}))},t.extendKey="ExclusiveGatewayNode",t}(o["PolygonNode"]),E={type:"bpmn:exclusiveGateway",view:M,model:w},N=E,O=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),P=function(e){function t(t,n){var o=this;return t.id||(t.id="Activity_"+u()),o=e.call(this,t,n)||this,o}return O(t,e),t.extendKey="UserTaskModel",t}(o["RectNodeModel"]),k=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),t.prototype.getLabelShape=function(){var t=e.prototype.getAttributes.call(this),n=t.x,r=t.y,i=t.width,a=t.height,l=t.stroke;return Object(o["h"])("svg",{x:n-i/2+5,y:r-a/2+5,width:25,height:25,viewBox:"0 0 1274 1024"},Object(o["h"])("path",{fill:l,d:"M655.807326 287.35973m-223.989415 0a218.879 218.879 0 1 0 447.978829 0 218.879 218.879 0 1 0-447.978829 0ZM1039.955839 895.482975c-0.490184-212.177424-172.287821-384.030443-384.148513-384.030443-211.862739 0-383.660376 171.85302-384.15056 384.030443L1039.955839 895.482975z"}))},t.prototype.getShape=function(){var t=e.prototype.getAttributes.call(this),n=t.x,r=t.y,i=t.width,a=t.height,l=t.fill,s=t.stroke,u=t.strokeWidth,p=t.radius;return Object(o["h"])("g",{},[Object(o["h"])("rect",{x:n-i/2,y:r-a/2,rx:p,ry:p,fill:l,stroke:s,strokeWidth:u,width:i,height:a}),this.getLabelShape()])},t.extendKey="UserTaskNode",t}(o["RectNode"]),T={type:"bpmn:userTask",view:k,model:P},S=T,D=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),C=function(e){function t(t,n){var o=this;return t.id||(t.id="Activity_"+u()),o=e.call(this,t,n)||this,o}return D(t,e),t.extendKey="ServiceTaskModel",t}(o["RectNodeModel"]),A=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return D(t,e),t.prototype.getLabelShape=function(){var t=e.prototype.getAttributes.call(this),n=t.x,r=t.y,i=t.width,a=t.height,l=t.stroke;return Object(o["h"])("svg",{x:n-i/2+5,y:r-a/2+5,width:30,height:30,viewBox:"0 0 1274 1024"},Object(o["h"])("path",{fill:l,d:"M882.527918 434.149934c-2.234901-5.303796-7.311523-8.853645-13.059434-9.138124l-61.390185-3.009544c-6.635117-20.973684-15.521508-41.175795-26.513864-60.282968l42.051745-47.743374c4.308119-4.889357 4.955872-12.004405 1.602498-17.59268-46.384423-77.30362-103.969956-101.422947-106.400309-102.410438-5.332449-2.170432-11.432377-1.090844-15.693424 2.77009L654.674467 240.664222c-17.004279-8.654101-35.092239-15.756869-53.995775-21.210068l-3.26537-66.490344c-0.280386-5.747911-3.833305-10.824533-9.134031-13.059434-1.683339-0.709151-30.193673-12.391215-76.866668-12.051477-46.672996-0.339738-75.18333 11.342326-76.866668 12.051477-5.300726 2.234901-8.853645 7.311523-9.134031 13.059434l-3.26537 66.490344c-18.903535 5.453199-36.991496 12.555967-53.995775 21.210068l-48.450479-43.922349c-4.261047-3.860934-10.360975-4.940522-15.693424-2.77009-2.430352 0.98749-60.015885 25.106818-106.400309 102.410438-3.353374 5.588275-2.705622 12.703323 1.602498 17.59268l42.051745 47.743374c-10.992355 19.107173-19.878746 39.309284-26.513864 60.282968l-61.390185 3.009544c-5.747911 0.284479-10.824533 3.834328-13.059434 9.138124-1.01512 2.415003-24.687262 60.190871-2.822278 147.651828 1.583055 6.324032 7.072069 10.893094 13.57518 11.308557 5.892197 0.37146 11.751648 0.523933 17.419741 0.667196 14.498202 0.372483 28.193109 0.723477 40.908712 4.63353 4.212952 1.294482 6.435573 8.270361 9.349949 18.763342 1.287319 4.640694 2.617617 9.43693 4.484128 14.010085 1.794879 4.393054 3.75758 8.570189 5.66093 12.607132 1.302669 2.765997 2.529613 5.380544 3.689019 8.018627 2.986007 6.803963 2.682086 9.773598 2.578732 10.349719-3.061732 3.672646-6.391571 7.238868-9.91379 11.015891-1.810229 1.943258-3.680832 3.949962-5.523807 5.980201l-22.560832 24.8909c-3.865028 4.261047-4.940522 10.365068-2.774183 15.693424 0.991584 2.426259 25.102724 60.011792 102.414531 106.400309 5.588275 3.353374 12.703323 2.701528 17.591657-1.603521l23.476691-20.682042c2.346441-2.061962 4.64888-4.336772 6.875594-6.534833 9.05319-8.93858 14.018272-12.95608 17.73185-11.576663 3.305279 1.222851 6.907317 3.166109 10.720156 5.228071 3.325745 1.794879 6.764054 3.650133 10.465352 5.288446 6.016017 2.662643 12.120039 4.688789 18.019399 6.65149 6.827499 2.266623 13.279445 4.409426 18.819624 7.275707 1.518586 0.782829 1.926886 0.994654 2.358721 7.830339 0.726547 11.496845 1.25048 23.276123 1.753947 34.672684 0.264013 5.900384 0.528026 11.803837 0.815575 17.700127 0.284479 5.743818 3.833305 10.82044 9.138124 13.05534 1.654686 0.698918 29.371958 12.063757 74.869175 12.063757 0.328481 0 3.65832 0 3.986801 0 45.497217 0 73.214489-11.364839 74.869175-12.063757 5.304819-2.234901 8.853645-7.311523 9.138124-13.05534 0.287549-5.89629 0.551562-11.799744 0.815575-17.700127 0.503467-11.396561 1.027399-23.175839 1.753947-34.672684 0.431835-6.835685 0.840134-7.04751 2.358721-7.830339 5.54018-2.866281 11.992125-5.009084 18.819624-7.275707 5.89936-1.962701 12.003382-3.988848 18.019399-6.65149 3.701299-1.638313 7.139607-3.493567 10.465352-5.288446 3.812839-2.061962 7.414877-4.00522 10.720156-5.228071 3.713578-1.379417 8.67866 2.638083 17.73185 11.576663 2.226714 2.198062 4.529153 4.472871 6.875594 6.534833l23.476691 20.682042c4.888334 4.305049 12.003382 4.956895 17.591657 1.603521 77.311807-46.388517 101.422947-103.97405 102.414531-106.400309 2.166339-5.328355 1.090844-11.432377-2.774183-15.693424l-22.560832-24.8909c-1.842974-2.030239-3.713578-4.036943-5.523807-5.980201-3.52222-3.777023-6.852058-7.343245-9.91379-11.015891-0.103354-0.576121-0.407276-3.545756 2.578732-10.349719 1.159406-2.638083 2.38635-5.252631 3.689019-8.018627 1.90335-4.036943 3.866051-8.214079 5.66093-12.607132 1.866511-4.573155 3.196809-9.369392 4.484128-14.010085 2.914376-10.492982 5.136997-17.46886 9.349949-18.763342 12.715603-3.910053 26.41051-4.261047 40.908712-4.63353 5.668093-0.143263 11.527544-0.295735 17.419741-0.667196 6.503111-0.415462 11.992125-4.984524 13.57518-11.308557C907.21518 494.340805 883.543038 436.564937 882.527918 434.149934zM643.49894 643.761929c-35.280528 35.280528-82.191954 54.711066-132.086317 54.711066s-96.806813-19.430538-132.086317-54.711066c-35.280528-35.279504-54.711066-82.191954-54.711066-132.086317 0-49.894364 19.430538-96.80272 54.711066-132.082224 35.283598-35.284621 82.191954-54.711066 132.086317-54.711066s96.80579 19.426445 132.086317 54.711066c35.279504 35.279504 54.711066 82.187861 54.711066 132.082224C698.210006 561.569976 678.782537 608.482425 643.49894 643.761929z"}))},t.prototype.getShape=function(){var t=e.prototype.getAttributes.call(this),n=t.x,r=t.y,i=t.width,a=t.height,l=t.fill,s=t.stroke,u=t.strokeWidth,p=t.radius;return Object(o["h"])("g",{},[Object(o["h"])("rect",{x:n-i/2,y:r-a/2,rx:p,ry:p,fill:l,stroke:s,strokeWidth:u,width:i,height:a}),this.getLabelShape()])},t.extendKey="ServiceTaskNode",t}(o["RectNode"]),j={type:"bpmn:serviceTask",view:A,model:C},L=j,I=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),R=function(e){function t(t,n){var o=this;return t.id||(t.id="Flow_"+u()),o=e.call(this,t,n)||this,o}return I(t,e),t.extendKey="SequenceFlowModel",t}(o["PolylineEdgeModel"]),G=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return I(t,e),t.extendKey="SequenceFlowEdge",t}(o["PolylineEdge"]),F={type:"bpmn:sequenceFlow",view:G,model:R},B=F,X={width:40,height:40},W={width:40,height:40},z={width:40,height:40},H={width:100,height:80},Y={width:100,height:80},U={rect:{radius:5,stroke:"rgb(24, 125, 255)"},circle:{r:18,stroke:"rgb(24, 125, 255)"},polygon:{stroke:"rgb(24, 125, 255)"},polyline:{stroke:"rgb(24, 125, 255)",hoverStroke:"rgb(24, 125, 255)",selectedStroke:"rgb(24, 125, 255)"},edgeText:{background:{fill:"white",height:14,stroke:"transparent",radius:3}}},V=(function(){function e(e){var t=e.lf;t.setTheme(U),t.register(y),t.register(x),t.register(N),t.register(S),t.register(L),t.options.customBpmnEdge||(t.register(B),t.setDefaultEdgeType("bpmn:sequenceFlow"))}e.pluginName="BpmnElement"}(),new l([32,32,1]));function q(){return V.next()}var K=function(){};K.ObjTree=function(){return this},K.ObjTree.VERSION="0.23",K.ObjTree.prototype.xmlDecl='<?xml version="1.0" encoding="UTF-8" ?>\n',K.ObjTree.prototype.attr_prefix="-",K.ObjTree.prototype.parseXML=function(e){var t;if(window.DOMParser){var n=new DOMParser,o=n.parseFromString(e,"application/xml");if(!o)return;t=o.documentElement}else window.ActiveXObject&&(n=new ActiveXObject("Microsoft.XMLDOM"),n.async=!1,n.loadXML(e),t=n.documentElement);if(t)return this.parseDOM(t)},K.ObjTree.prototype.parseHTTP=function(e,t,n){var o,r={};for(var i in t)r[i]=t[i];if(r.method||("undefined"==typeof r.postBody&&"undefined"==typeof r.postbody&&"undefined"==typeof r.parameters?r.method="get":r.method="post"),n){r.asynchronous=!0;var a=this,l=n,s=r.onComplete;r.onComplete=function(e){var t;e&&e.responseXML&&e.responseXML.documentElement&&(t=a.parseDOM(e.responseXML.documentElement)),l(t,e),s&&s(e)}}else r.asynchronous=!1;if("undefined"!=typeof HTTP&&HTTP.Request){r.uri=e;var u=new HTTP.Request(r);u&&(o=u.transport)}else if("undefined"!=typeof Ajax&&Ajax.Request){u=new Ajax.Request(e,r);u&&(o=u.transport)}return n?o:o&&o.responseXML&&o.responseXML.documentElement?this.parseDOM(o.responseXML.documentElement):void 0},K.ObjTree.prototype.parseDOM=function(e){if(e){if(this.__force_array={},this.force_array)for(var t=0;t<this.force_array.length;t++)this.__force_array[this.force_array[t]]=1;var n=this.parseElement(e);if(this.__force_array[e.nodeName]&&(n=[n]),11!=e.nodeType){var o={};o[e.nodeName]=n,n=o}return n}},K.ObjTree.prototype.parseElement=function(e){if(7!=e.nodeType){if(3==e.nodeType||4==e.nodeType){var t=e.nodeValue.match(/[^\x00-\x20]/);if(null==t)return;return e.nodeValue}var n,o={};if(e.attributes&&e.attributes.length){n={};for(var r=0;r<e.attributes.length;r++){var i=e.attributes[r].nodeName;if("string"==typeof i){var a=e.attributes[r].nodeValue;a&&(i=this.attr_prefix+i,"undefined"==typeof o[i]&&(o[i]=0),o[i]++,this.addNode(n,i,o[i],a))}}}if(e.childNodes&&e.childNodes.length){var l=!0;n&&(l=!1);for(r=0;r<e.childNodes.length&&l;r++){var s=e.childNodes[r].nodeType;3!=s&&4!=s&&(l=!1)}if(l){n||(n="");for(r=0;r<e.childNodes.length;r++)n+=e.childNodes[r].nodeValue}else{n||(n={});for(r=0;r<e.childNodes.length;r++){i=e.childNodes[r].nodeName;if("string"==typeof i){a=this.parseElement(e.childNodes[r]);a&&("undefined"==typeof o[i]&&(o[i]=0),o[i]++,this.addNode(n,i,o[i],a))}}}}return n}},K.ObjTree.prototype.addNode=function(e,t,n,o){this.__force_array[t]?(1==n&&(e[t]=[]),e[t][e[t].length]=o):1==n?e[t]=o:2==n?e[t]=[e[t],o]:e[t][e[t].length]=o},K.ObjTree.prototype.writeXML=function(e){var t=this.hash_to_xml(null,e);return this.xmlDecl+t},K.ObjTree.prototype.hash_to_xml=function(e,t){var n=[],o=[];for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];r.charAt(0)!=this.attr_prefix?"undefined"==typeof i||null==i?n[n.length]="<"+r+" />":"object"==typeof i&&i.constructor==Array?n[n.length]=this.array_to_xml(r,i):n[n.length]="object"==typeof i?this.hash_to_xml(r,i):this.scalar_to_xml(r,i):o[o.length]=" "+r.substring(1)+'="'+this.xml_escape(i)+'"'}var a=o.join(""),l=n.join("");return"undefined"==typeof e||null==e||(l=n.length>0?l.match(/\n/)?"<"+e+a+">\n"+l+"</"+e+">\n":"<"+e+a+">"+l+"</"+e+">\n":"<"+e+a+" />\n"),l},K.ObjTree.prototype.array_to_xml=function(e,t){for(var n=[],o=0;o<t.length;o++){var r=t[o];"undefined"==typeof r||null==r?n[n.length]="<"+e+" />":"object"==typeof r&&r.constructor==Array?n[n.length]=this.array_to_xml(e,r):n[n.length]="object"==typeof r?this.hash_to_xml(e,r):this.scalar_to_xml(e,r)}return n.join("")},K.ObjTree.prototype.scalar_to_xml=function(e,t){return"#text"==e?this.xml_escape(t):"<"+e+">"+this.xml_escape(t)+"</"+e+">\n"},K.ObjTree.prototype.xml_escape=function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')};var Q,$=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{while((void 0===t||t-- >0)&&!(o=i.next()).done)a.push(o.value)}catch(l){r={error:l}}finally{try{o&&!o.done&&(n=i["return"])&&n.call(i)}finally{if(r)throw r.error}}return a};(function(e){e["START"]="bpmn:startEvent",e["END"]="bpmn:endEvent",e["GATEWAY"]="bpmn:exclusiveGateway",e["USER"]="bpmn:userTask",e["SYSTEM"]="bpmn:serviceTask",e["FLOW"]="bpmn:sequenceFlow"})(Q||(Q={}));var J=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef"];function Z(e){var t={};return Object.entries(e).forEach((function(e){var n=$(e,2),o=n[0],r=n[1];"object"!==typeof r?0===o.indexOf("-")?t[o]=r:t["-"+o]=r:t[o]=Z(r)})),t}function ee(e){var t={};return Object.entries(e).forEach((function(e){var n=$(e,2),o=n[0],r=n[1];"string"===typeof r?0===o.indexOf("-")?t[o.substr(1)]=r:t[o]=r:t[o]="object"===typeof r?ee(r):r})),t}function te(e,t){var n=new Map;t.nodes.forEach((function(t){var o,r={"-id":t.id};if((null===(o=t.text)||void 0===o?void 0:o.value)&&(r["-name"]=t.text.value),t.properties){var i=Z(t.properties);Object.assign(r,i)}n.set(t.id,r),e[t.type]?Array.isArray(e[t.type])?e[t.type].push(r):e[t.type]=[e[t.type],r]:e[t.type]=r}));var o=t.edges.map((function(e){var t,o,r=n.get(e.targetNodeId);r["bpmn:incoming"]?Array.isArray(r["bpmn:incoming"])?r["bpmn:incoming"].push(e.id):r["bpmn:incoming"]=[r["bpmn:incoming"],e.id]:r["bpmn:incoming"]=e.id;var i=n.get(e.sourceNodeId);i["bpmn:outgoing"]?Array.isArray(i["bpmn:outgoing"])?i["bpmn:outgoing"].push(e.id):i["bpmn:outgoing"]=[i["bpmn:outgoing"],e.id]:i["bpmn:outgoing"]=e.id;var a={"-id":e.id,"-sourceRef":e.sourceNodeId,"-targetRef":e.targetNodeId};if((null===(t=e.text)||void 0===t?void 0:t.value)&&(a["-name"]=null===(o=e.text)||void 0===o?void 0:o.value),e.properties){var l=Z(e.properties);Object.assign(a,l)}return a}));e[Q.FLOW]=o}function ne(e,t){e["bpmndi:BPMNEdge"]=t.edges.map((function(e){var t,n=e.id,o=e.pointsList.map((function(e){var t=e.x,n=e.y;return{"-x":t,"-y":n}})),r={"-id":n+"_di","-bpmnElement":n,"di:waypoint":o};return(null===(t=e.text)||void 0===t?void 0:t.value)&&(r["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":e.text.x-10*e.text.value.length/2,"-y":e.text.y-7,"-width":10*e.text.value.length,"-height":14}}),r})),e["bpmndi:BPMNShape"]=t.nodes.map((function(e){var t,n=e.id,o=100,r=80,i=e.x,a=e.y,l=se.shapeConfigMap.get(e.type);l&&(o=l.width,r=l.height),i-=o/2,a-=r/2;var s={"-id":n+"_di","-bpmnElement":n,"dc:Bounds":{"-x":i,"-y":a,"-width":o,"-height":r}};return(null===(t=e.text)||void 0===t?void 0:t.value)&&(s["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":e.text.x-10*e.text.value.length/2,"-y":e.text.y-7,"-width":10*e.text.value.length,"-height":14}}),s}))}function oe(e){var t=[],n=[],o=e["bpmn:definitions"];if(o){var r=o["bpmn:process"];Object.keys(r).forEach((function(e){if(0===e.indexOf("bpmn:")){var i=r[e];if(e===Q.FLOW){var a=o["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];n=ae(i,a)}else{var l=o["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];t=t.concat(re(i,l,e))}}}))}return{nodes:t,edges:n}}function re(e,t,n){var o=[];if(Array.isArray(e))e.forEach((function(e){var r;r=Array.isArray(t)?t.find((function(t){return t["-bpmnElement"]===e["-id"]})):t;var i=ie(r,n,e);o.push(i)}));else{var r=void 0;r=Array.isArray(t)?t.find((function(t){return t["-bpmnElement"]===e["-id"]})):t;var i=ie(r,n,e);o.push(i)}return o}function ie(e,t,n){var o,r,i=Number(e["dc:Bounds"]["-x"]),a=Number(e["dc:Bounds"]["-y"]),l=n["-name"],s=se.shapeConfigMap.get(t);if(s&&(i+=s.width/2,a+=s.height/2),Object.entries(n).forEach((function(e){var t=$(e,2),n=t[0],r=t[1];-1===J.indexOf(n)&&(o||(o={}),o[n]=r)})),o&&(o=ee(o)),l&&(r={x:i,y:a,value:l},e["bpmndi:BPMNLabel"]&&e["bpmndi:BPMNLabel"]["dc:Bounds"])){var u=e["bpmndi:BPMNLabel"]["dc:Bounds"];r.x=Number(u["-x"])+Number(u["-width"])/2,r.y=Number(u["-y"])+Number(u["-height"])/2}var p={id:e["-bpmnElement"],type:t,x:i,y:a,properties:o};return r&&(p.text=r),p}function ae(e,t){var n=[];if(Array.isArray(e))e.forEach((function(e){var o;o=Array.isArray(t)?t.find((function(t){return t["-bpmnElement"]===e["-id"]})):t,n.push(le(o,e))}));else{var o=void 0;o=Array.isArray(t)?t.find((function(t){return t["-bpmnElement"]===e["-id"]})):t,n.push(le(o,e))}return n}function le(e,t){var n,o,r=t["-name"];if(r){var i=e["bpmndi:BPMNLabel"]["dc:Bounds"],a=0;r.split("\n").forEach((function(e){a<e.length&&(a=e.length)})),n={value:r,x:Number(i["-x"])+10*a/2,y:Number(i["-y"])+7}}Object.entries(t).forEach((function(e){var t=$(e,2),n=t[0],r=t[1];-1===J.indexOf(n)&&(o||(o={}),o[n]=r)})),o&&(o=ee(o));var l={id:t["-id"],type:Q.FLOW,pointsList:e["di:waypoint"].map((function(e){return{x:Number(e["-x"]),y:Number(e["-y"])}})),sourceNodeId:t["-sourceRef"],targetNodeId:t["-targetRef"],properties:o};return n&&(l.text=n),l}var se={pluginName:"bpmn-adapter",install:function(e){e.adapterIn=this.adapterIn,e.adapterOut=this.adapterOut},shapeConfigMap:new Map,setCustomShape:function(e,t){this.shapeConfigMap.set(e,t)},adapterOut:function(e){var t={"-id":"Process_"+q(),"-isExecutable":"false"};te(t,e);var n={"-id":"BPMNPlane_1","-bpmnElement":t["-id"]};ne(n,e);var o={"bpmn:definitions":{"-id":"Definitions_"+q(),"-xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","-xmlns:bpmn":"http://www.omg.org/spec/BPMN/20100524/MODEL","-xmlns:bpmndi":"http://www.omg.org/spec/BPMN/20100524/DI","-xmlns:dc":"http://www.omg.org/spec/DD/20100524/DC","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://bpmn.io/schema/bpmn","-exporter":"bpmn-js (https://demo.bpmn.io)","-exporterVersion":"7.3.0","bpmn:process":t,"bpmndi:BPMNDiagram":{"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":n}}};return o},adapterIn:function(e){if(e)return oe(e)}};se.shapeConfigMap.set(Q.START,{width:X.width,height:X.height}),se.shapeConfigMap.set(Q.END,{width:W.width,height:W.height}),se.shapeConfigMap.set(Q.GATEWAY,{width:z.width,height:z.height}),se.shapeConfigMap.set(Q.SYSTEM,{width:H.width,height:H.height}),se.shapeConfigMap.set(Q.USER,{width:Y.width,height:Y.height});var ue,pe=function(){return pe=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},pe.apply(this,arguments)};function ce(e){switch(e){case"bpmn:sequenceFlow":return ue.SEQUENCE_FLOW;case"bpmn:startEvent":return ue.START_EVENT;case"bpmn:endEvent":return ue.END_EVENT;case"bpmn:userTask":return ue.USER_TASK;case"bpmn:exclusiveGateway":return ue.EXCLUSIVE_GATEWAY;default:return e}}function de(e){var t=e.id,n=e.type,o=e.x,r=e.y,i=e.text,a=void 0===i?"":i,l=e.properties;return{incoming:[],outgoing:[],dockers:[],type:ce(e.type),properties:pe(pe({},l),{name:a&&a.value||"",x:o,y:r,text:a,logicFlowType:n}),key:t}}function he(e){var t=e.id,n=e.type,o=e.sourceNodeId,r=e.targetNodeId,i=e.startPoint,a=e.endPoint,l=e.pointsList,s=e.text,u=void 0===s?"":s,p=e.properties;return{incoming:[o],outgoing:[r],type:ce(n),dockers:[],properties:pe(pe({},p),{name:u&&u.value||"",text:u,startPoint:i,endPoint:a,pointsList:l,logicFlowType:n}),key:t}}function fe(e){var t=new Map,n={flowElementList:[]};return e.nodes.forEach((function(e){var o=de(e);n.flowElementList.push(o),t.set(e.id,o)})),e.edges.forEach((function(e){var o=he(e),r=t.get(e.sourceNodeId);r.outgoing.push(o.key);var i=t.get(e.targetNodeId);i.incoming.push(o.key),n.flowElementList.push(o)})),n}function ye(e){var t=e.incoming,n=e.outgoing,o=e.properties,r=e.key,i=o.text,a=o.startPoint,l=o.endPoint,s=o.pointsList,u=o.logicFlowType,p={id:r,type:u,sourceNodeId:t[0],targetNodeId:n[0],text:i,startPoint:a,endPoint:l,pointsList:s,properties:{}},c=["startPoint","endPoint","pointsList","text","logicFlowType"];return Object.keys(e.properties).forEach((function(t){-1===c.indexOf(t)&&(p.properties[t]=e.properties[t])})),p}function _e(e){var t=e.properties,n=e.key,o=t.x,r=t.y,i=t.text,a=t.logicFlowType,l={id:n,type:a,x:o,y:r,text:i,properties:{}},s=["x","y","text","logicFlowType"];return Object.keys(e.properties).forEach((function(t){-1===s.indexOf(t)&&(l.properties[t]=e.properties[t])})),l}function ge(e){var t={nodes:[],edges:[]},n=e.flowElementList;return n&&n.length>0&&n.forEach((function(e){if(e.type===ue.SEQUENCE_FLOW){var n=ye(e);t.edges.push(n)}else{var o=_e(e);t.nodes.push(o)}})),t}(function(e){e[e["SEQUENCE_FLOW"]=1]="SEQUENCE_FLOW",e[e["START_EVENT"]=2]="START_EVENT",e[e["END_EVENT"]=3]="END_EVENT",e[e["USER_TASK"]=4]="USER_TASK",e[e["EXCLUSIVE_GATEWAY"]=6]="EXCLUSIVE_GATEWAY"})(ue||(ue={}));var me;new Map;(function(e){e["HORIZONTAL"]="horizontal",e["VERTICAL"]="vertical"})(me||(me={}));var ve,xe,be,we,Me,Ee,Ne,Oe,Pe,ke,Te,Se=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{while((void 0===t||t-- >0)&&!(o=i.next()).done)a.push(o.value)}catch(l){r={error:l}}finally{try{o&&!o.done&&(n=i["return"])&&n.call(i)}finally{if(r)throw r.error}}return a},De=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Se(arguments[t]));return e},Ce={pluginName:"control",__lf:null,__controlItems:[{key:"zoom-out",iconClass:"lf-control-zoomOut",title:"缩小流程图",text:"缩小",onClick:function(){Ce.__lf.zoom(!1)}},{key:"zoom-in",iconClass:"lf-control-zoomIn",title:"放大流程图",text:"放大",onClick:function(){Ce.__lf.zoom(!0)}},{key:"reset",iconClass:"lf-control-fit",title:"恢复流程原有尺寸",text:"适应",onClick:function(){Ce.__lf.resetZoom()}},{key:"undo",iconClass:"lf-control-undo",title:"回到上一步",text:"上一步",onClick:function(){Ce.__lf.undo()}},{key:"redo",iconClass:"lf-control-redo",title:"移到下一步",text:"下一步",onClick:function(){Ce.__lf.redo()}}],addItem:function(e){Ce.__controlItems.push(e)},removeItem:function(e){var t=Ce.__controlItems.findIndex((function(t){return t.key===e}));return Ce.__controlItems.splice(t,1)[0]},install:function(){},render:function(e,t){Ce.__lf=e,Ce.__domContainer=t,Ce.__tool=this.__getControlTool(),t.appendChild(Ce.__tool)},destroy:function(){var e;try{null===(e=Ce.__domContainer)||void 0===e||e.removeChild(Ce.__tool)}catch(Ne){console.warn("unexpect destory error",Ne)}},__getControlTool:function(){var e="lf-control-item",t="lf-control-item disabled",n=document.createElement("div"),o=[];return n.className="lf-control",Ce.__controlItems.forEach((function(n){var r=document.createElement("div"),i=document.createElement("i"),a=document.createElement("span");switch(r.className=t,n.onClick&&(r.onclick=n.onClick.bind(null,Ce.__lf)),n.onMouseEnter&&(r.onmouseenter=n.onMouseEnter.bind(null,Ce.__lf)),n.onMouseLeave&&(r.onmouseleave=n.onMouseLeave.bind(null,Ce.__lf)),i.className=n.iconClass,a.className="lf-control-text",a.title=n.title,a.innerText=n.text,r.append(i,a),n.text){case"上一步":Ce.__lf.on("history:change",(function(n){var o=n.data.undoAble;r.className=o?e:t}));break;case"下一步":Ce.__lf.on("history:change",(function(n){var o=n.data.redoAble;r.className=o?e:t}));break;default:r.className=e;break}o.push(r)})),n.append.apply(n,De(o)),n}},Ae=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{while((void 0===t||t-- >0)&&!(o=i.next()).done)a.push(o.value)}catch(l){r={error:l}}finally{try{o&&!o.done&&(n=i["return"])&&n.call(i)}finally{if(r)throw r.error}}return a},je=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Ae(arguments[t]));return e},Le="lf:defaultNodeMenu",Ie="lf:defaultEdgeMenu",Re="lf:defaultGraphMenu",Ge="lf:defaultSelectionMenu",Fe=function(){function e(e){var t=this,n=e.lf;this.__menuDOM=document.createElement("ul"),this.lf=n,this.menuTypeMap=new Map,this.init(),this.lf.setMenuConfig=function(e){t.resetMenuItem(e)},this.lf.addMenuConfig=function(e){t.addMenuItem(e)},this.lf.setMenuByType=function(e){t.setMenuByType(e)}}return e.prototype.init=function(){var e=this,t=[{text:"删除",callback:function(t){e.lf.deleteNode(t.id)}},{text:"编辑文本",callback:function(t){e.lf.graphModel.setTextEditable(t.id)}},{text:"复制",callback:function(t){e.lf.cloneNode(t.id)}}];this.menuTypeMap.set(Le,t);var n=[{text:"删除",callback:function(t){e.lf.deleteEdge(t.id)}},{text:"编辑文本",callback:function(t){e.lf.graphModel.setTextEditable(t.id)}}];this.menuTypeMap.set(Ie,n),this.menuTypeMap.set(Re,[]);var o=[{text:"删除",callback:function(t){e.lf.clearSelectElements(),t.edges.forEach((function(t){return e.lf.deleteEdge(t.id)})),t.nodes.forEach((function(t){return e.lf.deleteNode(t.id)}))}}];this.menuTypeMap.set(Ge,o)},e.prototype.render=function(e,t){var n=this;this.__container=t,this.__currentData=null,this.__menuDOM.className="lf-menu",t.appendChild(this.__menuDOM),this.__menuDOM.addEventListener("click",(function(e){e.stopPropagation();var t=e.target;while(-1===Array.from(t.classList).indexOf("lf-menu-item")&&-1===Array.from(t.classList).indexOf("lf-menu"))t=t.parentElement;Array.from(t.classList).indexOf("lf-menu-item")>-1?(t.onclickCallback(n.__currentData),n.__menuDOM.style.display="none",n.__currentData=null):console.warn("点击区域不在菜单项内,请检查代码!")}),!0),this.lf.on("node:contextmenu",(function(e){var t=e.data,o=e.position,r=o.domOverlayPosition,i=r.x,a=r.y,l=t.id,s=n.lf.graphModel.getNodeModel(l),u=[],p=n.menuTypeMap.get(s.type);u=s&&s.menu&&Array.isArray(s.menu)?s.menu:p||n.menuTypeMap.get(Le),n.__currentData=t,n.showMenu(i,a,u)})),this.lf.on("edge:contextmenu",(function(e){var t=e.data,o=e.position,r=o.domOverlayPosition,i=r.x,a=r.y,l=t.id,s=n.lf.graphModel.getEdgeModel(l),u=[],p=n.menuTypeMap.get(s.type);u=s&&s.menu&&Array.isArray(s.menu)?s.menu:p||n.menuTypeMap.get(Ie),n.__currentData=t,n.showMenu(i,a,u)})),this.lf.on("blank:contextmenu",(function(e){var t=e.position,o=n.menuTypeMap.get(Re),r=t.domOverlayPosition,i=r.x,a=r.y;n.showMenu(i,a,o)})),this.lf.on("selection:contextmenu",(function(e){var t=e.data,o=e.position,r=n.menuTypeMap.get(Ge),i=o.domOverlayPosition,a=i.x,l=i.y;n.__currentData=t,n.showMenu(a,l,r)})),this.lf.on("node:mousedown",(function(){n.__menuDOM.style.display="none"})),this.lf.on("edge:click",(function(){n.__menuDOM.style.display="none"})),this.lf.on("blank:click",(function(){n.__menuDOM.style.display="none"}))},e.prototype.destroy=function(){var e;null===(e=null===this||void 0===this?void 0:this.__container)||void 0===e||e.removeChild(this.__menuDOM),this.__menuDOM=null},e.prototype.showMenu=function(e,t,n){if(n&&n.length){var o=this.__menuDOM;o.innerHTML="",o.append.apply(o,je(this.__getMenuDom(n))),o.children.length&&(o.style.display="block",o.style.top=t+"px",o.style.left=e+"px")}},e.prototype.setMenuByType=function(e){e.type&&e.menu&&this.menuTypeMap.set(e.type,e.menu)},e.prototype.__getMenuDom=function(e){var t=[];return e&&e.length>0&&e.forEach((function(e){var n=document.createElement("li");if(e.className?n.className="lf-menu-item "+e.className:n.className="lf-menu-item",!0===e.icon){var o=document.createElement("span");o.className="lf-menu-item-icon",n.appendChild(o)}var r=document.createElement("span");r.className="lf-menu-item-text",e.text&&(r.innerText=e.text),n.appendChild(r),n.onclickCallback=e.callback,t.push(n)})),t},e.prototype.resetMenuItem=function(e){e&&(void 0!==e.nodeMenu&&this.menuTypeMap.set(Le,e.nodeMenu?e.nodeMenu:[]),void 0!==e.edgeMenu&&this.menuTypeMap.set(Ie,e.edgeMenu?e.edgeMenu:[]),void 0!==e.graphMenu&&this.menuTypeMap.set(Re,e.graphMenu?e.graphMenu:[]))},e.prototype.addMenuItem=function(e){if(e){if(Array.isArray(e.nodeMenu)){var t=this.menuTypeMap.get(Le);this.menuTypeMap.set(Le,t.concat(e.nodeMenu))}if(Array.isArray(e.edgeMenu)){t=this.menuTypeMap.get(Ie);this.menuTypeMap.set(Ie,t.concat(e.edgeMenu))}if(Array.isArray(e.graphMenu)){t=this.menuTypeMap.get(Re);this.menuTypeMap.set(Re,t.concat(e.graphMenu))}}},e.prototype.changeMenuItem=function(e,t){if("add"===e)this.addMenuItem(t);else{if("reset"!==e)throw new Error("The first parameter of changeMenuConfig should be 'add' or 'reset'");this.resetMenuItem(t)}},e.pluginName="Menu",e}(),Be=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{while((void 0===t||t-- >0)&&!(o=i.next()).done)a.push(o.value)}catch(l){r={error:l}}finally{try{o&&!o.done&&(n=i["return"])&&n.call(i)}finally{if(r)throw r.error}}return a},Xe="menu-common",We=200,ze=100,He=(function(){function e(e){var t=this,n=e.lf;this.menuTypeMap=new Map,this.listenDelete=function(){t.hideMenu()},this.lf=n,this.__menuDOM=document.createElement("div"),this.__menuDOM.className="lf-inner-context",this.menuTypeMap.set(Xe,[]),this.lf.setContextMenuByType=function(e,n){t.menuTypeMap.set(e,n)},this.lf.setContextMenuItems=function(e){t.menuTypeMap.set(Xe,e)},this.lf.showContextMenu=function(e){e&&e.id?(t._activeData=e,t.createContextMenu()):console.warn("请检查传入的参数")},this.lf.hideContextMenu=function(){t.hideMenu()}}e.prototype.render=function(e,t){var n=this;this.container=t,e.on("node:click",(function(e){var t=e.data;n._activeData=t,n.createContextMenu()})),e.on("edge:click",(function(e){var t=e.data;n._activeData=t,n.createContextMenu()})),e.on("blank:click",(function(){n.hideMenu()}))},e.prototype.getContextMenuPosition=function(){var e=this._activeData,t=this.lf.graphModel.getElement(e.id);if(t){var n,o;if("edge"===t.BaseType){n=Number.MIN_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER;var r=t.getData();n=Math.max(r.startPoint.x,n),o=Math.min(r.startPoint.y,o),n=Math.max(r.endPoint.x,n),o=Math.min(r.endPoint.y,o),r.pointsList&&r.pointsList.forEach((function(e){n=Math.max(e.x,n),o=Math.min(e.y,o)}))}return"node"===t.BaseType&&(n=e.x+t.width/2,o=e.y-t.height/2),this.lf.graphModel.transformMatrix.CanvasPointToHtmlPoint([n,o])}console.warn("找不到元素"+e.id)},e.prototype.createContextMenu=function(){var e=this,t=this.lf.options.isSilentMode;if(!t){var n=this.menuTypeMap.get(this._activeData.type)||[];n=n.concat(this.menuTypeMap.get(Xe));var o=document.createDocumentFragment();n.forEach((function(t){var n=document.createElement("div");n.className="lf-context-item";var r=document.createElement("img");r.src=t.icon,r.className="lf-context-img",r.addEventListener("click",(function(){e.hideMenu(),t.callback?t.callback(e._activeData):e.addNode({sourceId:e._activeData.id,x:e._activeData.x,y:e._activeData.y,properties:t.properties,type:t.type})})),n.appendChild(r),o.appendChild(n)})),this.__menuDOM.innerHTML="",this.__menuDOM.appendChild(o),this.showMenu()}},e.prototype.addNode=function(e,t){var n=void 0!==t;void 0===t&&(t=e.y);var o=this.lf.getNodeModel(e.sourceId),r=e.x-o.width+We,i=t-e.y/2-20,a=e.x+o.width+We,l=t+e.y/2+20,s=this.lf.getAreaElement([r,i],[a,l]);if(s.length)return t+=ze,void this.addNode(e,t);var u,p,c=this.lf.addNode({type:e.type,x:e.x+200,y:t,properties:e.properties});n&&(u={x:e.x,y:e.y+o.height/2},p={x:c.x-c.width/2,y:c.y}),this.lf.createEdge({sourceNodeId:e.sourceId,targetNodeId:c.id,startPoint:u,endPoint:p})},e.prototype.showMenu=function(){var e=Be(this.getContextMenuPosition(),2),t=e[0],n=e[1];this.__menuDOM.style.display="flex",this.__menuDOM.style.top=n+"px",this.__menuDOM.style.left=t+10+"px",this.container.appendChild(this.__menuDOM),!this.isShow&&this.lf.on("node:delete,edge:delete,node:drag,graph:transform",this.listenDelete),this.isShow=!0},e.prototype.hideMenu=function(){this.__menuDOM.innerHTML="",this.__menuDOM.style.display="none",this.isShow&&this.container.removeChild(this.__menuDOM),this.lf.off("node:delete,edge:delete,node:drag,graph:transform",this.listenDelete),this.isShow=!1},e.pluginName="ContextMenu"}(),function(){function e(e){var t=this,n=e.lf;this.lf=n,this.lf.setPatternItems=function(e){t.shapeList=e}}return e.prototype.render=function(e,t){var n=this;this.panelEl&&t.removeChild(this.panelEl),this.shapeList&&0!==this.shapeList.length&&(this.panelEl=document.createElement("div"),this.panelEl.className="lf-dndpanel",this.shapeList.forEach((function(e){n.panelEl.appendChild(n.createDndItem(e))})),t.appendChild(this.panelEl))},e.prototype.createDndItem=function(e){var t=this,n=document.createElement("div");n.className=e.className?"lf-dnd-item "+e.className:"lf-dnd-item";var o=document.createElement("div");if(o.className="lf-dnd-shape",e.icon&&(o.style.backgroundImage="url("+e.icon+")"),n.appendChild(o),e.label){var r=document.createElement("div");r.innerText=e.label,r.className="lf-dnd-text",n.appendChild(r)}return n.onmousedown=function(){e.type&&t.lf.dnd.startDrag({type:e.type,properties:e.properties,text:e.text}),e.callback&&e.callback()},n},e.pluginName="DndPanel",e}()),Ye=function(){function e(e){var t=this,n=e.lf;this.__disabled=!1,this.isDefalutStopMoveGraph=!1,this.__draw=function(e){var n=t.lf.getPointByClient(e.clientX,e.clientY).domOverlayPosition,o=n.x,r=n.y;t.endPoint={x:o,y:r};var i=t.startPoint,a=i.x,l=i.y,s=t.wrapper.style,u=a,p=l,c=o-a,d=r-l;o<a&&(u=o,c=a-o),r<l&&(p=r,d=l-r),s.left=u+"px",s.top=p+"px",s.width=c+"px",s.height=d+"px"},this.__drawOff=function(){document.removeEventListener("mousemove",t.__draw),document.removeEventListener("mouseup",t.__drawOff),t.__domContainer.removeChild(t.wrapper);var e=t.startPoint,n=e.x,o=e.y,r=t.endPoint,i=r.x,a=r.y,l=[Math.min(n,i),Math.min(o,a)],s=[Math.max(n,i),Math.max(o,a)],u=t.lf.getAreaElement(l,s);u.forEach((function(e){t.lf.select(e.id,!0)})),t.lf.emit("selection:selected",u)},this.lf=n;var o=n.getEditConfig().stopMoveGraph;this.isDefalutStopMoveGraph=o,n.openSelectionSelect=function(){o||(t.isDefalutStopMoveGraph=!1,n.updateEditConfig({stopMoveGraph:!0})),t.open()},n.closeSelectionSelect=function(){t.isDefalutStopMoveGraph||n.updateEditConfig({stopMoveGraph:!1}),t.close()}}return e.prototype.render=function(e,t){var n=this;this.__domContainer=t,e.on("blank:mousedown",(function(o){var r=o.e,i=e.getEditConfig();if(i.stopMoveGraph&&!n.__disabled){var a=e.getPointByClient(r.clientX,r.clientY).domOverlayPosition,l=a.x,s=a.y;n.startPoint={x:l,y:s},n.endPoint={x:l,y:s};var u=document.createElement("div");u.className="lf-selection-select",u.style.top=n.startPoint.y+"px",u.style.left=n.startPoint.x+"px",t.appendChild(u),n.wrapper=u,document.addEventListener("mousemove",n.__draw),document.addEventListener("mouseup",n.__drawOff)}}))},e.prototype.open=function(){this.__disabled=!1},e.prototype.close=function(){this.__disabled=!0},e.pluginName="selection-select",e}(),Ue=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ve=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{while((void 0===t||t-- >0)&&!(o=i.next()).done)a.push(o.value)}catch(l){r={error:l}}finally{try{o&&!o.done&&(n=i["return"])&&n.call(i)}finally{if(r)throw r.error}}return a},qe=(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}Ue(t,e),t.prototype.getEdge=function(){for(var e=this.getAttributes(),t=e.points,n=e.strokeWidth,r=e.stroke,i=e.strokeDashArray,a=t.split(" ").map((function(e){return e.split(",").map((function(e){return Number(e)}))})),l=Ve(a[0],2),s=l[0],u=l[1],p="M"+s+" "+u,c=5,d=1;d<a.length-1;d++){var h=Ve(a[d-1],2),f=h[0],y=h[1],_=Ve(a[d],2),g=_[0],m=_[1],v=Ve(a[d+1],2),x=v[0],b=v[1];if(g===f&&m!==y){var w=m>y?m-c:m+c;p=p+" L "+g+" "+w}if(m===y&&g!==f){var M=g>f?g-c:g+c;p=p+" L "+M+" "+m}if(p=p+" Q "+g+" "+m,g===x&&m!==b){w=m>b?m-c:m+c;p=p+" "+g+" "+w}if(m===b&&g!==x){M=g>x?g-c:g+c;p=p+" "+M+" "+m}}var E=Ve(a[a.length-1],2),N=E[0],O=E[1];return p=p+" L "+N+" "+O,Object(o["h"])("path",{d:p,strokeWidth:n,stroke:r,fill:"none",strokeDashArray:i})},t.extendKey="CurvedEdge"}(o["PolylineEdge"]),function(e){function t(){return null!==e&&e.apply(this,arguments)||this}Ue(t,e)}(o["PolylineEdgeModel"]),function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}()),Ke=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{while((void 0===t||t-- >0)&&!(o=i.next()).done)a.push(o.value)}catch(l){r={error:l}}finally{try{o&&!o.done&&(n=i["return"])&&n.call(i)}finally{if(r)throw r.error}}return a},Qe=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Ke(arguments[t]));return e},$e=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isGroup=!0,t.children=new Set,t.isRestrict=!0,t}return qe(t,e),t.prototype.setAttributes=function(){this.width=500,this.height=200,this.strokeWidth=1,this.zIndex=0},t.prototype.setIsRestrict=function(e){this.isRestrict=e},t.prototype.isInRange=function(e){var t=e.x1,n=e.y1,o=e.x2,r=e.y2;return t>=this.x-this.width/2&&o<=this.x+this.width/2&&n>=this.y-this.height/2&&r<=this.y+this.height/2},t.prototype.setAllowAppendChild=function(e){this.stroke=e?"red":"rgb(24, 125, 255)"},t.prototype.addChild=function(e){this.children.add(e)},t.prototype.removeChild=function(e){this.children.delete(e)},t.prototype.getData=function(){var t=e.prototype.getData.call(this);return t.children=Qe(this.children),t},t}(o["RectNodeModel"]),Je=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return qe(t,e),t.prototype.toFront=function(){},t.prototype.getShapeStyle=function(){var t=e.prototype.getShapeStyle.call(this);return t.radius=0,t},t}(o["RectNode"]),Ze={type:"group",view:Je,model:$e},et=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{while((void 0===t||t-- >0)&&!(o=i.next()).done)a.push(o.value)}catch(l){r={error:l}}finally{try{o&&!o.done&&(n=i["return"])&&n.call(i)}finally{if(r)throw r.error}}return a},tt=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(et(arguments[t]));return e},nt=(function(){function e(e){var t=this,n=e.lf;this.nodeGroupMap=new Map,this.appendNodeToGrop=function(e){var n=e.data,o=t.nodeGroupMap.get(n.id);if(o){var r=t.lf.getNodeModel(o);r.removeChild(n.id),t.nodeGroupMap.delete(n.id),r.setAllowAppendChild(!1)}var i=t.lf.getNodeModel(n.id).getBounds(),a=t.getGroup(i);a&&n.id!==a.id&&(a.addChild(n.id),t.nodeGroupMap.set(n.id,a.id),a.setAllowAppendChild(!1))},this.setActiveGroup=function(e){var n=e.data;t.activeGroup&&(t.activeGroup.setAllowAppendChild(!1),t.activeGroup=void 0);var o=t.lf.getNodeModel(n.id).getBounds();t.activeGroup=t.getGroup(o),t.activeGroup&&t.activeGroup.id!==n.id&&t.activeGroup.setAllowAppendChild(!0)},n.register(Ze),this.lf=n,n.graphModel.addNodeMoveRules((function(e,o,r){if(e.isGroup)return n.graphModel.moveNodes(tt(e.children),o,r,!0),!0;var i=n.getNodeModel(t.nodeGroupMap.get(e.id));if(i&&i.isRestrict){var a=e.getBounds(),l=a.x1,s=a.y1,u=a.x2,p=a.y2,c=i.isInRange({x1:l+o,y1:s+r,x2:u+o,y2:p+r});return c}return!0})),n.on("node:add",this.appendNodeToGrop),n.on("node:drop",this.appendNodeToGrop),n.on("node:dnd-move",this.setActiveGroup),n.on("node:drag",this.setActiveGroup)}e.prototype.getGroups=function(){var e=[];this.lf.graphModel.nodes.forEach((function(t){t.isGroup&&e.push(t)}))},e.prototype.getGroup=function(e){for(var t=this.lf.graphModel.nodes,n=0;n<t.length;n++){var o=t[n];if(o.isGroup&&o.isInRange(e))return o}},e.pluginName="group"}(),{}),ot=[],rt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,it=Array.isArray;function at(e,t){for(var n in t)e[n]=t[n];return e}function lt(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function st(e,t,n){var o,r,i,a={};for(i in t)"key"==i?o=t[i]:"ref"==i?r=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?ve.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===a[i]&&(a[i]=e.defaultProps[i]);return ut(e,a,o,r,null)}function ut(e,t,n,o,r){var i={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==r?++be:r,__i:-1,__u:0};return null==r&&null!=xe.vnode&&xe.vnode(i),i}function pt(e){return e.children}function ct(e,t){this.props=e,this.context=t}function dt(e,t){if(null==t)return e.__?dt(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?dt(e):null}function ht(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return ht(e)}}function ft(e){(!e.__d&&(e.__d=!0)&&we.push(e)&&!yt.__r++||Me!==xe.debounceRendering)&&((Me=xe.debounceRendering)||Ee)(yt)}function yt(){var e,t,n,o,r,i,a,l;for(we.sort(Ne);e=we.shift();)e.__d&&(t=we.length,o=void 0,i=(r=(n=e).__v).__e,a=[],l=[],n.__P&&((o=at({},r)).__v=r.__v+1,xe.vnode&&xe.vnode(o),Mt(n.__P,o,r,n.__n,n.__P.namespaceURI,32&r.__u?[i]:null,a,null==i?dt(r):i,!!(32&r.__u),l),o.__v=r.__v,o.__.__k[o.__i]=o,Et(a,o,l),o.__e!=i&&ht(o)),we.length>t&&we.sort(Ne));yt.__r=0}function _t(e,t,n,o,r,i,a,l,s,u,p){var c,d,h,f,y,_,g=o&&o.__k||ot,m=t.length;for(s=gt(n,t,g,s),c=0;c<m;c++)null!=(h=n.__k[c])&&(d=-1===h.__i?nt:g[h.__i]||nt,h.__i=c,_=Mt(e,h,d,r,i,a,l,s,u,p),f=h.__e,h.ref&&d.ref!=h.ref&&(d.ref&&Ot(d.ref,null,h),p.push(h.ref,h.__c||f,h)),null==y&&null!=f&&(y=f),4&h.__u||d.__k===h.__k?s=mt(h,s,e):"function"==typeof h.type&&void 0!==_?s=_:f&&(s=f.nextSibling),h.__u&=-7);return n.__e=y,s}function gt(e,t,n,o){var r,i,a,l,s,u=t.length,p=n.length,c=p,d=0;for(e.__k=[],r=0;r<u;r++)null!=(i=t[r])&&"boolean"!=typeof i&&"function"!=typeof i?(l=r+d,(i=e.__k[r]="string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?ut(null,i,null,null,null):it(i)?ut(pt,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?ut(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=e,i.__b=e.__b+1,a=null,-1!==(s=i.__i=vt(i,n,l,c))&&(c--,(a=n[s])&&(a.__u|=2)),null==a||null===a.__v?(-1==s&&d--,"function"!=typeof i.type&&(i.__u|=4)):s!==l&&(s==l-1?d--:s==l+1?d++:(s>l?d--:d++,i.__u|=4))):i=e.__k[r]=null;if(c)for(r=0;r<p;r++)null!=(a=n[r])&&0==(2&a.__u)&&(a.__e==o&&(o=dt(a)),Pt(a,a));return o}function mt(e,t,n){var o,r;if("function"==typeof e.type){for(o=e.__k,r=0;o&&r<o.length;r++)o[r]&&(o[r].__=e,t=mt(o[r],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=dt(e)),n.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8===t.nodeType);return t}function vt(e,t,n,o){var r=e.key,i=e.type,a=n-1,l=n+1,s=t[n];if(null===s||s&&r==s.key&&i===s.type&&0==(2&s.__u))return n;if(("function"!=typeof i||i===pt||r)&&o>(null!=s&&0==(2&s.__u)?1:0))for(;a>=0||l<t.length;){if(a>=0){if((s=t[a])&&0==(2&s.__u)&&r==s.key&&i===s.type)return a;a--}if(l<t.length){if((s=t[l])&&0==(2&s.__u)&&r==s.key&&i===s.type)return l;l++}}return-1}function xt(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||rt.test(t)?n:n+"px"}function bt(e,t,n,o,r){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof o&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||xt(e.style,t,"");if(n)for(t in n)o&&n[t]===o[t]||xt(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(Oe,"$1")),t=t.toLowerCase()in e||"onFocusOut"===t||"onFocusIn"===t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o?n.u=o.u:(n.u=Pe,e.addEventListener(t,i?Te:ke,i)):e.removeEventListener(t,i?Te:ke,i);else{if("http://www.w3.org/2000/svg"==r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function wt(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=Pe++;else if(t.t<n.u)return;return n(xe.event?xe.event(t):t)}}}function Mt(e,t,n,o,r,i,a,l,s,u){var p,c,d,h,f,y,_,g,m,v,x,b,w,M,E,N,O,P=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(s=!!(32&n.__u),i=[l=t.__e=n.__e]),(p=xe.__b)&&p(t);e:if("function"==typeof P)try{if(g=t.props,m="prototype"in P&&P.prototype.render,v=(p=P.contextType)&&o[p.__c],x=p?v?v.props.value:p.__:o,n.__c?_=(c=t.__c=n.__c).__=c.__E:(m?t.__c=c=new P(g,x):(t.__c=c=new ct(g,x),c.constructor=P,c.render=kt),v&&v.sub(c),c.props=g,c.state||(c.state={}),c.context=x,c.__n=o,d=c.__d=!0,c.__h=[],c._sb=[]),m&&null==c.__s&&(c.__s=c.state),m&&null!=P.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=at({},c.__s)),at(c.__s,P.getDerivedStateFromProps(g,c.__s))),h=c.props,f=c.state,c.__v=t,d)m&&null==P.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),m&&null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(m&&null==P.getDerivedStateFromProps&&g!==h&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(g,x),!c.__e&&(null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(g,c.__s,x)||t.__v===n.__v)){for(t.__v!==n.__v&&(c.props=g,c.state=c.__s,c.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some((function(e){e&&(e.__=t)})),b=0;b<c._sb.length;b++)c.__h.push(c._sb[b]);c._sb=[],c.__h.length&&a.push(c);break e}null!=c.componentWillUpdate&&c.componentWillUpdate(g,c.__s,x),m&&null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(h,f,y)}))}if(c.context=x,c.props=g,c.__P=e,c.__e=!1,w=xe.__r,M=0,m){for(c.state=c.__s,c.__d=!1,w&&w(t),p=c.render(c.props,c.state,c.context),E=0;E<c._sb.length;E++)c.__h.push(c._sb[E]);c._sb=[]}else do{c.__d=!1,w&&w(t),p=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&++M<25);c.state=c.__s,null!=c.getChildContext&&(o=at(at({},o),c.getChildContext())),m&&!d&&null!=c.getSnapshotBeforeUpdate&&(y=c.getSnapshotBeforeUpdate(h,f)),l=_t(e,it(N=null!=p&&p.type===pt&&null==p.key?p.props.children:p)?N:[N],t,n,o,r,i,a,l,s,u),c.base=t.__e,t.__u&=-161,c.__h.length&&a.push(c),_&&(c.__E=c.__=null)}catch(e){if(t.__v=null,s||null!=i)if(e.then){for(t.__u|=s?160:128;l&&8===l.nodeType&&l.nextSibling;)l=l.nextSibling;i[i.indexOf(l)]=null,t.__e=l}else for(O=i.length;O--;)lt(i[O]);else t.__e=n.__e,t.__k=n.__k;xe.__e(e,t,n)}else null==i&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):l=t.__e=Nt(n.__e,t,n,o,r,i,a,s,u);return(p=xe.diffed)&&p(t),128&t.__u?void 0:l}function Et(e,t,n){for(var o=0;o<n.length;o++)Ot(n[o],n[++o],n[++o]);xe.__c&&xe.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){xe.__e(e,t.__v)}}))}function Nt(e,t,n,o,r,i,a,l,s){var u,p,c,d,h,f,y,_=n.props,g=t.props,m=t.type;if("svg"===m?r="http://www.w3.org/2000/svg":"math"===m?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=i)for(u=0;u<i.length;u++)if((h=i[u])&&"setAttribute"in h==!!m&&(m?h.localName===m:3===h.nodeType)){e=h,i[u]=null;break}if(null==e){if(null===m)return document.createTextNode(g);e=document.createElementNS(r,m,g.is&&g),l&&(xe.__m&&xe.__m(t,i),l=!1),i=null}if(null===m)_===g||l&&e.data===g||(e.data=g);else{if(i=i&&ve.call(e.childNodes),_=n.props||nt,!l&&null!=i)for(_={},u=0;u<e.attributes.length;u++)_[(h=e.attributes[u]).name]=h.value;for(u in _)if(h=_[u],"children"==u);else if("dangerouslySetInnerHTML"==u)c=h;else if(!(u in g)){if("value"==u&&"defaultValue"in g||"checked"==u&&"defaultChecked"in g)continue;bt(e,u,null,h,r)}for(u in g)h=g[u],"children"==u?d=h:"dangerouslySetInnerHTML"==u?p=h:"value"==u?f=h:"checked"==u?y=h:l&&"function"!=typeof h||_[u]===h||bt(e,u,h,_[u],r);if(p)l||c&&(p.__html===c.__html||p.__html===e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(c&&(e.innerHTML=""),_t(e,it(d)?d:[d],t,n,o,"foreignObject"===m?"http://www.w3.org/1999/xhtml":r,i,a,i?i[0]:n.__k&&dt(n,0),l,s),null!=i)for(u=i.length;u--;)lt(i[u]);l||(u="value","progress"===m&&null==f?e.removeAttribute("value"):void 0!==f&&(f!==e[u]||"progress"===m&&!f||"option"===m&&f!==_[u])&&bt(e,u,f,_[u],r),u="checked",void 0!==y&&y!==e[u]&&bt(e,u,y,_[u],r))}return e}function Ot(e,t,n){try{if("function"==typeof e){var o="function"==typeof e.__u;o&&e.__u(),o&&null==t||(e.__u=e(t))}else e.current=t}catch(e){xe.__e(e,n)}}function Pt(e,t,n){var o,r;if(xe.unmount&&xe.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||Ot(o,null,t)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){xe.__e(e,t)}o.base=o.__P=null}if(o=e.__k)for(r=0;r<o.length;r++)o[r]&&Pt(o[r],t,n||"function"!=typeof e.type);n||lt(e.__e),e.__c=e.__=e.__e=void 0}function kt(e,t,n){return this.constructor(e,n)}ve=ot.slice,xe={__e:function(e,t,n,o){for(var r,i,a;t=t.__;)if((r=t.__c)&&!r.__)try{if((i=r.constructor)&&null!=i.getDerivedStateFromError&&(r.setState(i.getDerivedStateFromError(e)),a=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,o||{}),a=r.__d),a)return r.__E=r}catch(t){e=t}throw e}},be=0,ct.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=at({},this.state),"function"==typeof e&&(e=e(at({},n),this.props)),e&&at(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),ft(this))},ct.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ft(this))},ct.prototype.render=pt,we=[],Ee="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ne=function(e,t){return e.__v.__b-t.__v.__b},yt.__r=0,Oe=/(PointerCapture)$|Capture$/i,Pe=0,ke=wt(!1),Te=wt(!0);var Tt,St=function(){return St=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},St.apply(this,arguments)};function Dt(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=e.radius,l=e.className,s=t-r/2,u=n-i/2,p=St(St({width:10,height:10,cx:0,cy:0,rx:a||0,ry:a||0,fill:"transparent",fillOpacity:1,strokeWidth:"1px",stroke:"#000",strokeOpacity:1,className:"lf-basic-shape "+l},e),{x:s,y:u});return Object(o["h"])("rect",St({},p))}function Ct(e){var t=e.x,n=e.y,o=e.width,r=e.height;return{minX:t-o/2,minY:n-r/2,maxX:t+o/2,maxY:n+r/2}}function At(e){var t=Ct(e),n=e.radius,o=t.minX,r=t.minY,i=t.maxX,a=t.maxY;return[{x:o+n,y:r+n},{x:i-n,y:r+n},{x:i-n,y:a-n},{x:o+n,y:a-n}]}function jt(e){var t=e.point,n=e.beforeNode,o=e.afterNode,r=t.x,i=t.y,a={x:r,y:i},l=n.radius,s=Ct(n),u=Ct(o);if(r===s.minX){a.x=u.minX;var p=(i-n.y)/(n.height/2-l);a.y=p?o.y+(o.height/2-l)*p:o.y}else if(r===s.maxX){a.x=u.maxX;p=(i-n.y)/(n.height/2-l);a.y=p?o.y+(o.height/2-l)*p:o.y}else if(i===s.minY){a.y=u.minY;p=(r-n.x)/(n.width/2-l);a.x=p?o.x+(o.width/2-l)*p:o.x}else if(i===s.maxY){a.y=u.maxY;p=(r-n.x)/(n.width/2-l);a.x=p?o.x+(o.width/2-l)*p:o.x}else{var c=At(n),d=At(o),h=Ct(n),f=h.minX,y=h.minY,_=h.maxX,g=h.maxY,m=-1;if(r-f<l&&i-y<l?m=0:_-r<l&&i-y<l?m=1:_-r<l&&g-i<l?m=2:r-f<l&&y-i<l&&(m=3),m>-1){var v=Math.atan2(i-c[m].y,r-c[m].x);a.x=d[m].x+l*Math.cos(v),a.y=d[m].y+l*Math.sin(v)}}return a}function Lt(e){var t,n,o=e.point,r=e.beforeNode,i=e.afterNode,a=i.rx,l=i.ry,s=o,u=(o.y-r.y)/(o.x-r.x),p=a,c=l;return u>=1/0?(t=0,n=c):u<=-1/0?(t=0,n=-c):o.x-r.x>0?(t=p*c/Math.sqrt(c*c+p*p*u*u),n=p*c*u/Math.sqrt(c*c+p*p*u*u)):(t=-p*c/Math.sqrt(c*c+p*p*u*u),n=-p*c*u/Math.sqrt(c*c+p*p*u*u)),s={x:t+i.x,y:n+i.y},s}function It(e){var t,n,o=e.point,r=e.beforeNode,i=e.afterNode,a=o,l=o.x-r.x,s=o.y-r.y,u=r.rx,p=r.ry,c=Math.sqrt((u-Math.abs(l))*(u-Math.abs(l))+s*s)/Math.sqrt(u*u+p*p),d=i.rx,h=i.ry,f=Math.sqrt((d*d+h*h)*c*c*(d*d/(d*d+h*h))),y=f*(h/d);return t=l>=0?d-f:f-d,n=s>0?y:-y,a={x:t+i.x,y:n+i.y},a}Dt.defaultProps={radius:0,stroke:"",strokeDasharray:"",className:""},function(e){e["NODE"]="node",e["CIRCLE_NODE"]="circle-node",e["POLYGON_NODE"]="polygon-node",e["RECT_NODE"]="rect-node",e["TEXT_NODE"]="text-node",e["ELLIPSE_NODE"]="ellipse-node",e["DIAMOND_NODE"]="diamond-node",e["EDGE"]="edge",e["LINE_EDGE"]="line-edge",e["POLYLINE_EDGE"]="polyline-edge",e["BEZIER_EDGE"]="bezier-edge",e["GRAPH"]="graph"}(Tt||(Tt={}));var Rt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Gt=function(){return Gt=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},Gt.apply(this,arguments)},Ft=o["LogicFlowUtil"].createDrag,Bt=function(e){function t(t){var n=e.call(this)||this;n.updatePosition=function(e){var t=e.deltaX,o=e.deltaY,r=n.nodeModel,i=r.x,a=r.y;n.nodeModel.x=i+t/2,n.nodeModel.y=a+o/2,n.nodeModel.moveText(t/2,o/2)},n.getResize=function(e){var t=e.index,n=e.deltaX,o=e.deltaY,r=e.width,i=e.height,a=e.pct,l=void 0===a?1:a,s={width:r,height:i};switch(t){case 0:s.width=r-n*l,s.height=i-o*l;break;case 1:s.width=r+n*l,s.height=i-o*l;break;case 2:s.width=r+n,s.height=i+o*l;break;case 3:s.width=r-n*l,s.height=i+o*l;break;default:break}return s},n.updateRect=function(e){var t=e.deltaX,o=e.deltaY,r=n.nodeModel,i=r.id,a=r.x,l=r.y,s=r.width,u=r.height,p=r.radius,c=n.index,d=n.getResize({index:c,deltaX:t,deltaY:o,width:s,height:u,pct:1}),h=n.nodeModel,f=h.minWidth,y=h.minHeight,_=h.maxWidth,g=h.maxHeight;if(!(d.width<f||d.width>_||d.height<y||d.height>g)){n.updatePosition({deltaX:t,deltaY:o}),n.nodeModel.width=d.width,n.nodeModel.height=d.height,n.nodeModel.setProperties({nodeSize:{width:d.width,height:d.height}});var m,v=n.getNodeEdges(i),x={x:a,y:l,width:s,height:u,radius:p},b={x:n.nodeModel.x,y:n.nodeModel.y,width:n.nodeModel.width,height:n.nodeModel.height,radius:p},w={point:"",beforeNode:x,afterNode:b};v.sourceEdges.forEach((function(e){w.point=e.startPoint,m=jt(w),e.updateStartPoint(m)})),v.targetEdges.forEach((function(e){w.point=e.endPoint,m=jt(w),e.updateEndPoint(m)})),n.eventEmit({beforeNode:x,afterNode:b})}},n.updateEllipse=function(e){var t=e.deltaX,o=e.deltaY,r=n.nodeModel,i=r.id,a=r.rx,l=r.ry,s=r.x,u=r.y,p=n.index,c=a,d=l,h=n.getResize({index:p,deltaX:t,deltaY:o,width:c,height:d,pct:.5}),f=n.nodeModel,y=f.minWidth,_=f.minHeight,g=f.maxWidth,m=f.maxHeight;if(!(h.width<y/2||h.width>g/2||h.height<_/2||h.height>m/2)){n.updatePosition({deltaX:t,deltaY:o}),n.nodeModel.rx=h.width,n.nodeModel.ry=h.height,n.nodeModel.setProperties({nodeSize:{rx:h.width,ry:h.height}});var v,x=n.getNodeEdges(i),b={x:s,y:u},w={rx:h.width,ry:h.height,x:n.nodeModel.x,y:n.nodeModel.y},M={point:{},beforeNode:b,afterNode:w};x.sourceEdges.forEach((function(e){M.point=e.startPoint,v=Lt(M),e.updateStartPoint(v)})),x.targetEdges.forEach((function(e){M.point=e.endPoint,v=Lt(M),e.updateEndPoint(v)})),n.eventEmit({beforeNode:Gt(Gt({},b),{rx:a,ry:l}),afterNode:w})}},n.updateDiamond=function(e){var t=e.deltaX,o=e.deltaY,r=n.nodeModel,i=r.id,a=r.rx,l=r.ry,s=r.x,u=r.y,p=n.index,c=a,d=l,h=n.getResize({index:p,deltaX:t,deltaY:o,width:c,height:d,pct:.5}),f=_n.sizeRange.ellipse,y=f.minRx,_=f.minRy,g=f.maxRx,m=f.maxRy;if(!(h.width<y||h.width>g||h.height<_||h.height>m)){n.updatePosition({deltaX:t,deltaY:o}),n.nodeModel.rx=h.width,n.nodeModel.ry=h.height,n.nodeModel.setProperties({nodeSize:{rx:h.width,ry:h.height}});var v,x={x:s,y:u,rx:a,ry:l},b={rx:h.width,ry:h.height,x:n.nodeModel.x,y:n.nodeModel.y},w={point:{},beforeNode:x,afterNode:b},M=n.getNodeEdges(i);M.sourceEdges.forEach((function(e){w.point=e.startPoint,v=It(w),e.updateStartPoint(v)})),M.targetEdges.forEach((function(e){w.point=e.endPoint,v=It(w),e.updateEndPoint(v)})),n.eventEmit({beforeNode:x,afterNode:b})}},n.eventEmit=function(e){var t=e.beforeNode,o=e.afterNode,r=n.nodeModel,i=r.id,a=r.modelType,l=r.type,s=Gt({id:i,modelType:a,type:l},t),u=Gt({id:i,modelType:a,type:l},o);n.graphModel.eventCenter.emit("node:resize",{oldNodeSize:s,newNodeSize:u})},n.onDraging=function(e){var t=e.deltaX,o=e.deltaY,r=n.nodeModel.modelType;r===Tt.RECT_NODE?n.updateRect({deltaX:t,deltaY:o}):r===Tt.ELLIPSE_NODE?n.updateEllipse({deltaX:t,deltaY:o}):r===Tt.DIAMOND_NODE&&n.updateDiamond({deltaX:t,deltaY:o})},n.index=t.index,n.nodeModel=t.nodeModel,n.graphModel=t.graphModel;var o=n.graphModel.gridSize,r=2;return o>1&&(r=2*o),n.state={},n.dragHandler=Ft({onDraging:n.onDraging,step:r}),n}return Rt(t,e),t.prototype.getNodeEdges=function(e){for(var t=this.graphModel,n=t.edges,o=[],r=[],i=0;i<n.length;i++){var a=n[i];a.sourceNodeId===e?o.push(a):n[i].targetNodeId===e&&r.push(a)}return{sourceEdges:o,targetEdges:r}},t.prototype.render=function(){var e=this.props,t=e.x,n=e.y,o=e.style,r=e.index,i=_n.style.controlPoint,a=i.width,l=i.height,s=i.fill,u=i.stroke;return st("g",{className:"lf-resize-control-"+r},st(Dt,Gt({className:"lf-node-control"},{x:t,y:n},o,{width:a,height:l,fill:s,stroke:u,onMouseDown:this.dragHandler})))},t}(ct),Xt=Bt,Wt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),zt=function(){return zt=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},zt.apply(this,arguments)},Ht=function(e){function t(){var t=e.call(this)||this;return t.state={},t}return Wt(t,e),t.prototype.getResizeControl=function(){var e=this.props,t=e.x,n=e.y,o=e.width,r=e.height,i=e.nodeModel,a=e.graphModel,l={minX:t-o/2,minY:n-r/2,maxX:t+o/2,maxY:n+r/2},s=l.minX,u=l.minY,p=l.maxX,c=l.maxY,d=[{x:s,y:u},{x:p,y:u},{x:p,y:c},{x:s,y:c}];return d.map((function(e,t){return st(Xt,zt({index:t},e,{nodeModel:i,graphModel:a}))}))},t.prototype.getGroupSolid=function(){var e=this.props,t=e.x,n=e.y,o=e.width,r=e.height,i=_n.style.outline,a=i.stroke,l=i.strokeWidth,s=i.strokeDasharray;return st(Dt,{fill:"none",x:t,y:n,width:o,height:r,stroke:a,strokeWidth:l,strokeDasharray:s})},t.prototype.render=function(){return st("g",{className:"lf-resize-control"},this.getGroupSolid(),this.getResizeControl())},t}(ct),Yt=Ht,Ut=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Vt=function(){return Vt=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},Vt.apply(this,arguments)},qt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.minWidth=30,t.minHeight=30,t.maxWidth=2e3,t.maxHeight=2e3,t}return Ut(t,e),t.prototype.setAttributes=function(){this.hideOutline=!0;var e=this.properties.nodeSize;e&&(this.width=e.width,this.height=e.height)},t}(o["RectNodeModel"]),Kt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ut(t,e),t.prototype.getControlGroup=function(e){var t=this.props,n=t.model,r=t.graphModel;return Object(o["h"])(Yt,Vt({},e,{nodeModel:n,graphModel:r}))},t.prototype.getResizeShape=function(){return e.prototype.getShape.call(this)},t.prototype.getShape=function(){var t=e.prototype.getAttributes.call(this),n=this.props.model.isSelected;return Object(o["h"])("g",null,this.getResizeShape(),n?this.getControlGroup(t):"")},t}(o["RectNode"]),Qt={type:"rect",view:Kt,model:qt},$t=Qt,Jt=function(){return Jt=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},Jt.apply(this,arguments)};function Zt(e){var t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,a=e.rx,l=void 0===a?4:a,s=e.ry,u=void 0===s?4:s,p=Jt({cx:n,cy:i,rx:l,ry:u,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1},e);return Object(o["h"])("ellipse",Jt({},p))}var en=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),tn=function(){return tn=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},tn.apply(this,arguments)},nn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.minWidth=30,t.minHeight=30,t.maxWidth=2e3,t.maxHeight=2e3,t}return en(t,e),t.prototype.setAttributes=function(){this.hideOutline=!0;var e=this.properties.nodeSize;e&&(this.rx=e.rx,this.ry=e.ry)},t}(o["EllipseNodeModel"]),on=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return en(t,e),t.prototype.getControlGroup=function(e){var t=this.props,n=t.model,r=t.graphModel;return Object(o["h"])(Yt,tn({},e,{nodeModel:n,graphModel:r}))},t.prototype.getResizeShape=function(e){return Object(o["h"])("g",null,Object(o["h"])(Zt,tn({},e)))},t.prototype.getShape=function(){var t=e.prototype.getAttributes.call(this),n=this.props.model.isSelected;return Object(o["h"])("g",null,this.getResizeShape(t),n?this.getControlGroup(t):"")},t}(o["EllipseNode"]),rn={type:"ellipse",view:on,model:nn},an=rn,ln=function(){return ln=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},ln.apply(this,arguments)};function sn(e){var t=e.fillOpacity,n=void 0===t?1:t,r=e.strokeWidth,i=void 0===r?1:r,a=e.strokeOpacity,l=void 0===a?1:a,s=e.fill,u=void 0===s?"transparent":s,p=e.stroke,c=void 0===p?"#000":p,d=e.points,h=e.className,f=void 0===h?"lf-basic-shape":h,y={fill:u,fillOpacity:n,strokeWidth:i,stroke:c,strokeOpacity:l,points:"",className:f};return y.points=d.map((function(e){return e.join(",")})).join(" "),Object(o["h"])("polygon",ln({},y))}var un=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),pn=function(){return pn=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},pn.apply(this,arguments)},cn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return un(t,e),t.prototype.setAttributes=function(){this.hideOutline=!0;var e=this.properties.nodeSize;e&&(this.rx=e.rx,this.ry=e.ry)},t}(o["DiamondNodeModel"]),dn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return un(t,e),t.prototype.getControlGroup=function(e){var t=this.props,n=t.model,r=t.graphModel;return Object(o["h"])(Yt,pn({},e,{nodeModel:n,graphModel:r}))},t.prototype.getResizeShape=function(e){return Object(o["h"])("g",null,Object(o["h"])(sn,pn({},e)))},t.prototype.getShape=function(){var t=e.prototype.getAttributes.call(this),n=this.props.model.isSelected;return Object(o["h"])("g",null,this.getResizeShape(t),n?this.getControlGroup(t):"")},t}(o["DiamondNode"]),hn={type:"diamond",view:dn,model:cn},fn=hn,yn={pluginName:"node-resize",step:0,style:{outline:{stroke:"#000000",strokeWidth:1,strokeDasharray:"3,3"},controlPoint:{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},sizeRange:{ellipse:{minRx:15,minRy:15,maxRx:150,maxRy:150},diamond:{minRx:15,minRy:15,maxRx:150,maxRy:150}},install:function(e){e.register({type:$t.type,view:$t.view,model:$t.model}),e.register({type:an.type,view:an.view,model:an.model}),e.register({type:fn.type,view:fn.view,model:fn.model})}},_n=yn,gn=function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{while((void 0===t||t-- >0)&&!(o=i.next()).done)a.push(o.value)}catch(l){r={error:l}}finally{try{o&&!o.done&&(n=i["return"])&&n.call(i)}finally{if(r)throw r.error}}return a},mn=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(gn(arguments[t]));return e},vn=(function(){function e(e){var t=this,n=e.lf;this.lf=n,this.pathes=[],n.getPathes=function(){if(!t.startNodeType)throw new Error("需要预先指定开始节点类型");return t.getPathes()},n.setRawPathes=function(e){t.setPathes(e)},n.getRawPathes=function(){return t.pathes},n.setStartNodeType=function(e){t.startNodeType=e}}e.prototype.setPathes=function(e){this.pathes=e.map((function(e){var t=e.routeId,n=e.name,o=e.elements,r=e.type;return{routeId:t,name:n,elements:o,type:r,similarElement:null,weight:0}}))},e.prototype.getPathes=function(){var e=this,t=this.lf.getGraphRawData(),n=new Map,o=[];t.nodes.forEach((function(t){n.set(t.id,{id:t.id,data:t,nextNodes:[]}),t.type===e.startNodeType&&o.push(t.id)})),t.edges.forEach((function(e){var t=n.get(e.sourceNodeId);t.nextNodes.push(e.targetNodeId)}));var r=[];return o.forEach((function(t){r=r.concat(e.findPathElements(n.get(t),n,[]))})),this.getNewPathes(r)},e.prototype.findPathElements=function(e,t,n){void 0===n&&(n=[]);var o=mn(n);if(o.push(e.id),0===e.nextNodes.length)return[o];for(var r=[],i=0;i<e.nextNodes.length;i++){var a=t.get(e.nextNodes[i]),l=void 0,s=o.indexOf(a.id);l=-1!==s?[mn(o.slice(s),[a.id])]:this.findPathElements(a,t,mn(o)),r=r.concat(l)}return r},e.prototype.getNewPathes=function(e){var t=this,n=[],o=new Set;e.forEach((function(e){var r=t.getNewId("path"),i=t.getNewId("路径"),a=t.isLoopPath(e),l=e.join(",");o.has(l)||(o.add(l),n.push({routeId:r,name:i,elements:e,type:a,weight:0,similarElement:""}))}));var r=JSON.parse(JSON.stringify(this.pathes));return n.forEach((function(e){for(var n=0;n<r.length;n++){var o=r[n],i=t.similar2Path(mn(e.elements),mn(o.elements));i>e.weight&&o.weight<=i&&(e.weight=i,e.similarElement=o,i===o.weight&&o.similarElement?(o.similarElement.similarElement=null,o.similarElement.weight=0,o.similarElement=null,o.weight=0):(o.similarElement=e,o.weight=i))}})),n.forEach((function(e){e.similarElement&&e.similarElement.similarElement===e&&(e.routeId=e.similarElement.routeId,e.name=e.similarElement.name),delete e.similarElement,delete e.weight})),this.setPathes(n),n},e.prototype.similar2Path=function(e,t){var n=0,o=e.length+t.length;e.sort(),t.sort();var r=e.shift(),i=t.shift();while(void 0!==r&&void 0!==i)r===i?(n++,r=e.shift(),i=t.shift()):r<i?r=e.shift():r>i&&(i=t.shift());return n/o*200},e.prototype.getNewId=function(e){return e+"_"+u()},e.prototype.isLoopPath=function(e){var t=e.length;return e.indexOf(e[t-1])!==t-1?1:0},e.pluginName="FlowPath"}(),function(){return vn=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},vn.apply(this,arguments)}),xn={LEFT_TOP:-1,LEFT:0,LEFT_BOTTOM:1};(function(){function e(e){var t=this,n=e.lf;this.lf=n,n.layout=function(e){var n=t.lf.getGraphRawData();t.lf.setStartNodeType(e);var o=t.lf.getPathes();return t.levelHeight=[],t.newNodeMap=new Map,t.layout(n,o)}}e.prototype.layout=function(e,t){var n=[];t.forEach((function(e){e.elements.length>n.length&&(n=e.elements)}));for(var o=this.formatData(e),r={nodes:[],edges:[]},i=n.length-1;i>=0;i--)this.setNodePosition(n[i],o,r,i,1);this.lf.graphModel.graphDataToModel(r)},e.prototype.setNodePosition=function(e,t,n,o,r){var i=this,a=t[e],l=a.text,s=a.type,u=a.next,p=a.properties,c=160*o+40,d=120*r,h={id:e,x:c,text:l,y:d,type:s,properties:p};return l&&"object"===typeof l&&(h.text=vn(vn({},l),{x:c+l.x,y:d+l.y})),this.newNodeMap.set(h.id,{x:h.x,y:h.y,type:s}),n.nodes.push(h),a.isFixed=!0,this.addLevelHeight(o,1),u&&u.length>0&&u.forEach((function(r){var a=t[r.nodeId];if(!a.isFixed){var l=i.getLevelHeight(o+1);i.addLevelHeight(o,1),i.setNodePosition(r.nodeId,t,n,o+1,l+1)}n.edges.push(vn({id:r.edgeId,type:r.edgeType,sourceNodeId:e,targetNodeId:r.nodeId,properties:r.properties,text:r.text},i.getEdgeDataPoints(e,r.nodeId)))})),h},e.prototype.getEdgeDataPoints=function(e,t){var n=this.newNodeMap.get(e),o=this.newNodeMap.get(t),r=this.getShape(e),i=r.width,a=r.height,l=this.getShape(t),s=l.width,u=l.height,p=this.getRelativePosition(n,o),c={x:n.x,y:n.y},d={x:o.x,y:o.y};switch(p){case xn.LEFT:c.x=n.x+i/2,d.x=o.x-s/2;break;case xn.LEFT_TOP:c.y=n.y+a/2,d.x=o.x-s/2;break;case xn.LEFT_BOTTOM:c.x=n.x+i/2,d.y=o.y+u/2;break;default:break}return{startPoint:c,endPoint:d}},e.prototype.getRelativePosition=function(e,t){var n,o=e.y,r=t.y;return n=o<r?-1:o===r?0:1,n},e.prototype.getShape=function(e){var t=this.lf.getNodeModel(e);return{height:t.height,width:t.width}},e.prototype.formatData=function(e){var t=e.nodes.reduce((function(e,t){var n=t.type,o=t.properties,r=t.text,i=t.x,a=t.y;return r&&"object"===typeof r&&(r.x=r.x-i,r.y=r.y-a),e[t.id]={type:n,properties:o,text:r,prev:[],next:[]},e}),{});return e.edges.forEach((function(e){var n=e.sourceNodeId,o=e.targetNodeId,r=e.id,i=e.properties,a=e.text,l=a;"object"===typeof a&&(l=a.value),t[n].next.push({edgeId:r,nodeId:o,edgeType:e.type,properties:i,text:l}),t[o].prev.push({edgeId:r,nodeId:n,properties:i,text:l})})),t},e.prototype.addLevelHeight=function(e,t,n){void 0===t&&(t=1),void 0===n&&(n=!1);var o=this.levelHeight[e];o||(o={positiveHeight:0,negativeHeight:0},this.levelHeight[e]=o),n?o.negativeHeight-=t:o.positiveHeight+=t},e.prototype.getLevelHeight=function(e,t){void 0===t&&(t=!1);var n=this.levelHeight[e];return n?t?n.negativeHeight:n.positiveHeight:0},e.pluginName="AutoLayout"})()}}]);
|