(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.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":"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+"\n":"<"+e+a+">"+l+"\n":"<"+e+a+" />\n"),l},K.ObjTree.prototype.array_to_xml=function(e,t){for(var n=[],o=0;o":"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)+"\n"},K.ObjTree.prototype.xml_escape=function(e){return e.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){a0&&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;t0)&&!(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-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;o0)&&!(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;dy?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=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;t2&&(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;tt&&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;c0?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(null!=s&&0==(2&s.__u)?1:0))for(;a>=0||l=0){if((s=t[a])&&0==(2&s.__u)&&r==s.key&&i===s.type)return a;a--}if(l-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_||d.heightg)){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.widthg/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.widthg||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;i0)&&!(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;te.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()):ri&&(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;nn.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